Repository navigation
feat(id): apply verified AT Protocol ingests into a record store + CLI (slice 2 of #13787) - #17081
Conversation
…I (slice 2 of #13787) New apply module in id-import-atproto: an injected RecordStore boundary (the crate's transport-injection pattern, one layer up), apply_ingest driving puts/deletion-honouring deletes off the provenance-manifest diff, verbatim DAG-CBOR record storage, and a DAG-CBOR -> JSON rendering. FileRecordStore persists record blocks + the per-DID manifest under a store directory (atomic manifest rename, CID recomputed on read). A dependency-free id-import-atproto binary (apply|show) is the CLI surface: identity from a verified PLC audit log, a DID document, or explicit did:key material; inputs are files, no network I/O. Live follow and blob fetching remain named remainders on #13787. 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 41 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. |
…LI failure type (#13787)
|
Verification run 46362995988 on 63ac911: FAILURE — 2 compile errors in the new binary ( |
|
Lane 2352-D (bravo SUSTAIN landings, 2026-11-29) — full-diff verification at head aae4b56: READ AND VERIFIED against the stated purpose (slice 2 of #13787). apply.rs/store_file.rs/main.rs logic checks out (diff-driven put/delete, rev monotonicity via ingest, foreign-DID refusal before any write, manifest temp+rename, CID recompute on list, strict flag parsing, no new dependencies); the aae4b56 compile fix (explicit From<serde_json::Error> for Failure) is present in the diff. NOT merged by this lane: the author lane is live on this PR — verification run 46362995988 on the previous head FAILED to compile and the re-dispatch on aae4b56 had not concluded at this read. Wake (machine-checkable): PR #17081 still OPEN at head aae4b56 AND the author-posted re-dispatch result for that head recorded on this PR → next landings lane merges on a pass, or fixes forward on a fail. If the author merges it first, this wake is discharged. |
|
Verification run 46363997931 on aae4b56: compiles; 38 passed / 3 failed — all three failures are my new apply tests: the fixture signing key produces a high-S signature for these digests and the verifier (correctly) requires low-S. Fixture fixed in 001c872 ( |
|
Verification run 46365094403 on head 001c872: SUCCESS — |
|
Lane 2352-D wake update: PR #17081 head moved aae4b56 → 001c872 (updated 2026-11-30T06:15:03Z) after my verification note — author still iterating. Wake restated: PR #17081 OPEN at a stable head AND the author re-dispatch result for that head recorded on the PR → next landings lane re-reads the head delta, merges on a pass, fixes forward on a fail. |
Refs #13787 — slice 2 of the AT Protocol read-compatibility work: CLI/store application of the verified ingest that PR #16783 landed as a leaf crate. Live follow and blob fetching remain named remainders on the issue.
What lands
applymodule — the store-application layer:RecordStoretrait: the store as an injected boundary, the same pattern the crate uses for its transport (Fetcher/DnsTxt), so the leaf still depends on no otherid-*crate and every application path is offline-testable.apply_ingest(store, identity, car_bytes, previous_manifest): verifies the CAR via the existingingest_car(withrevmonotonicity against the previous manifest), then applies the provenance-manifest diff — additions/CID changes are put, records that vanished upstream are deleted from the store (the deletion-honouring policy slice 1 recorded), unchanged records are not rewritten. Returns the new manifest + anApplyReport(put/deleted/unchanged + the applied changes). A previous manifest for another DID is refused before any write.value_to_json: DAG-CBOR → JSON rendering ($link/$bytesatproto conventions) for display.MemoryRecordStore: the reference in-memory implementation of the store contract.store_filemodule —FileRecordStore, the shipped persistence surface:<root>/<did>/<collection>/<rkey>.cborrecord files + a per-DIDmanifest.json.apply_carloads the stored manifest, applies, and only then persists the new manifest (temp file + rename, so a crash never leaves a torn manifest claiming arevthe record files don't match). Record CIDs are recomputed on read and checked against the manifest inlist_records— a corrupted/swapped file is reported, never served.id-import-atprotobinary — the CLI surface (no new dependencies; strict declared-flag parsing, unknown input is a usage error):apply --store <dir> --car <file.car>with identity from--plc-log <file>(audit log verified by the existing chain verifier),--doc <file>(DID document), or--did/--key/--pds(explicit material). No network I/O: inputs are files the caller fetched, matching the crate's injected-transport design.show --store <dir> --did <did>: prints the stored manifest + records as JSON.Also:
Error::Storevariant; lib.rs/Cargo.toml docs updated (the book does not cover this crate yet — no book counts change).Verification
Remote dispatch only: fleet-run 46362995988 on head
63ac91193—cargo test -p id-import-atproto && cargo clippy -p id-import-atproto --all-targets && cargo fmt -p id-import-atproto -- --checkinsidenix developon a copy ofpkgs/idoutside the git tree. Result recorded on this PR when the run concludes; merging on the verification judgment per the seat's CI policy, with this run as the fix-forward wake if it lands after merge.New offline tests (signed-CAR fixtures in the
repo.rsstyle): first apply puts every record verbatim (bytes hash to the manifest CID); second apply at a following rev puts 1 change, deletes the vanished record from the store, leaves 1 unchanged, and re-applying either CAR is a rev regression that touches nothing; foreign-DID manifest refused; file-store manifest/record round-trips across a reopened handle; JSON rendering conventions.{ "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-30T05:58:17Z", "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.