fix: hoist target.repo to top-level for Tangled pull records

Author: Aaron Steven White
Commit b1d65a1c00d73ab5dae9b960a9a729202adf78e9
Parent: 4c082b653a
Structural diff unavailable

These commits were pushed via plain git push, so no pre-parsed schemas are available. Install git-remote-cospan and re-push via panproto:// to see scope-level changes, breaking change detection, and semantic diffs.

brew install panproto/tap/git-remote-cospan
1 file changed +14 -1
@@ -235,8 +235,21 @@ async fn dispatch_special_upsert(
235235 
236236         // ─── Pull Request (SSE event on create) ─────────────────────
237237         "dev.cospan.repo.pull" | "sh.tangled.repo.pull" => {
238+            // Tangled pulls have target.repo instead of top-level repo;
239+            // hoist it so the lens expression can find it.
240+            let rec = if rec.get("repo").is_none() {
241+                if let Some(target_repo) = rec.get("target").and_then(|t| t.get("repo")).cloned() {
242+                    let mut patched = rec.clone();
243+                    patched.as_object_mut().map(|o| o.insert("repo".to_string(), target_repo));
244+                    patched
245+                } else {
246+                    rec.clone()
247+                }
248+            } else {
249+                rec.clone()
250+            };
238251             let mut row: db::pull::PullRow =
239-                serde_json::from_value(transform_record(state, collection, rec))?;
252+                serde_json::from_value(transform_record(state, collection, &rec))?;
240253             row.did = did.to_string();
241254             row.rkey = rkey.to_string();
242255             row.indexed_at = Utc::now();
cospan · schematic version control on atproto built on AT Protocol