Skip to content

feat(id): enumerate blob references in applied AT Protocol records (slice 3 of #13787) - #17116

Merged
dezren39 merged 1 commit into
mainfrom
xaltha/13787-blob-refs
Nov 30, 2026
Merged

dezren39 merged 1 commit into
mainfrom
xaltha/13787-blob-refs

Conversation

@dezren39

@dezren39 dezren39 commented Nov 30, 2026 •

Copy link
Copy Markdown
Member

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 blobs module in id-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-link ref — reporting the path to the object (map keys, array indices as decimal strings), the blob CID, and the declared mimeType/size when present. A bare CID link (record references etc.) is not a blob reference, and a $type: "blob" map without a link ref is 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.
  • BlobReference is Serialize, re-exported at the crate root.

CLI: id-import-atproto show gains a per-record blobs list (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-bot with what you need.

…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
@coderabbitai

coderabbitai Bot commented Nov 30, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5e24ff4f-2008-439d-9a7a-0779acf5fd52
Commits

Reviewing files that changed from the base of the PR and between 9cb952f and 898653d.

Files selected for processing: 3

  • pkgs/id/crates/id-import-atproto/src/blobs.rs
  • pkgs/id/crates/id-import-atproto/src/lib.rs
  • pkgs/id/crates/id-import-atproto/src/main.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@dezren39
dezren39 merged commit 3759547 into main Nov 30, 2026
2 checks passed
@dezren39
dezren39 deleted the xaltha/13787-blob-refs branch November 30, 2026 06:44
@dezren39

Copy link
Copy Markdown
Member Author

Verification run 46368321561: FAILURE in the runner checkout step — git fetch of the branch failed 3 times before the command started (no cargo output in the log); not a code failure. Re-dispatching the identical command at the same head 898653d.

@dezren39

Copy link
Copy Markdown
Member Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant