Repository navigation
feat(id): enumerate blob references in applied AT Protocol records (slice 3 of #13787) - #17116
Conversation
…lice 3 of #13787) New blobs module in id-import-atproto: blob_references walks a stored record's decoded value for lexicon blob objects ($type blob + CID-link ref), reporting path, CID, and declared mimeType/size; bare CID links and malformed blob maps are not references. store_blob_references enumerates a whole store for a DID. The CLI show output gains a per-record blobs list. Reference-only accounting for open question 5 on #13787; fetching blob bytes remains a named remainder. Refs #13787
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 13 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
Verification run 46368321561: FAILURE in the runner checkout step — |
|
Post-merge verification: this PR was merged by the merge sweep at 06:44:41Z (merge commit 3759547), ~1 minute after creation — which auto-deleted the head branch and made both branch verification runs (46368321561, 46369322388) fail in the runner checkout fetch, before any code ran. Post-merge run 46371105845 at main (same chained cargo test + clippy + fmt command): SUCCESS, 43 passed / 0 failed (41 previous + 2 new blob tests). No fix-forward needed. — lane 2347-R-D |
Refs #13787 — slice 3: blob reference enumeration (the reference-only first step for the issue's open question 5; fetching blob bytes remains a named remainder, as does live follow).
What lands
New
blobsmodule inid-import-atproto:blob_references(&StoredRecord) -> Vec<BlobReference>: depth-first walk of a stored record's decoded DAG-CBOR value for lexicon blob objects — maps with$type: "blob"and a CID-linkref— reporting the path to the object (map keys, array indices as decimal strings), the blob CID, and the declaredmimeType/sizewhen present. A bare CID link (record references etc.) is not a blob reference, and a$type: "blob"map without a linkrefis malformed as a blob and skipped — the output is exactly the fetchable reference set.store_blob_references(&dyn RecordStore, did): the same enumeration across every record a store holds for a DID, in listing order.BlobReferenceisSerialize, re-exported at the crate root.CLI:
id-import-atproto showgains a per-recordblobslist (path, cid, mimeType, size), so a mirror operator can account for every blob a repo references — storage not held, fetch planning, takedown scoping — without interpreting record contents beyond the blob-object shape.Verification
Remote fleet-run at head
898653d80(same chained command as slices 1–2:cargo test -p id-import-atproto && cargo clippy -p id-import-atproto --all-targets && cargo fmt -p id-import-atproto -- --check, pkgs/id copied out of the git tree, nix dev shell). Run id + result recorded on this PR when it concludes; merging on that verification per seat policy.New tests: blob objects found at any depth with exact paths/CIDs/mime/size (incl. an
embed.images[]shape); bare links and ref-less blob maps excluded; store-wide enumeration across records incl. a top-level blob record (profile avatar shape) and an unknown DID yielding none.{ "direct_parent": null, "links": [], "lineage": { "design": null, "roadmap_item": null, "priority": null }, "pm_meta": 1, "provenance": { "queue_id": null, "scheduled_start": null, "picked_up_at": null, "work_started_at": null, "created_at": "2026-11-30T06:43:02Z", "session_id": null, "lane": null, "host": "htch-runtime", "worktree": "/home/hatch", "model": null, "lane_start_issues": [], "workspace_ref": { "kind": "worktree", "id": "/home/hatch", "repo": "developing-today/code", "branch": "main", "sha": "c36a28d672723b085b14125996bcd72b1931e09d" }, "auth_subject": "xaltha", "stamped_by": "fleet 0.1.0 (native)" } }Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.