Skip to content

feat(id-import-atproto): live follow — subscribeRepos/Jetstream ingestion (slice 5 of #13787) - #17254

Merged
developing-today-fleet[bot] merged 8 commits into
mainfrom
xaltha/13787-live-follow
Nov 30, 2026
Merged

developing-today-fleet[bot] merged 8 commits into
mainfrom
xaltha/13787-live-follow

Conversation

@developing-today-fleet

@developing-today-fleet developing-today-fleet Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Slice 5 of #13787 — live follow, the last named remainder. Slices 1–4 landed resolution + verified ingest (#16783), CLI/store application (#17081), blob references (#17116) and blob fetching (#17126); this slice adds the live piece and closes the issue.

What lands

New live module in pkgs/id/crates/id-import-atproto (leaf pattern preserved — no new dependencies, no network I/O in the crate):

  • Both wire shapes, one normalized form. parse_firehose_frame parses relay com.atproto.sync.subscribeRepos DAG-CBOR frames (header + body; #commit ops recovered with their record bytes from the frame's CAR slice, whose block hashes the CAR reader verifies; #identity/#account/#info carried as informational events). parse_jetstream_event parses Jetstream JSON events, reversing the atproto JSON conventions ($link/$bytes singleton objects) at any depth so record CIDs can be checked against the canonical DAG-CBOR encoding.
  • Per-account filtered follow into the existing ingestion path. LiveFollow (followed DID + last rev + last relay seq) applies commit ops into the slice-2 RecordStore: creates/updates put verbatim record bytes only after the bytes hash to the op's CID, deletes remove the local copy (the deletion-honouring policy), non-commit and other-DID events are filtered (not trusted to the subscription's wantedDids), rev/seq regressions are rejected before the store is touched, and a tooBig commit is refused with a fall-back-to-full-ingest error.
  • Subscription URL builders for both endpoints (subscribeRepos with cursor/wantedDids; Jetstream with wantedDids/cursor) — the caller drives whatever websocket transport it has and feeds frames in, exactly as callers fetch CAR/PLC inputs today.
  • CLI follow subcommand: applies a captured frames file (Jetstream JSON-lines or concatenated firehose frames) into a file store, resuming rev state from the store's last full-ingest manifest, and prints the follow report (events/filtered/put/deleted, final rev, resume cursor) as JSON.

Trust posture, stated plainly (also in the module docs): live ops are CID-hash-verified — content is bound to its CID exactly as in slices 1/4 — but are not commit-signature/MST verified per diff. That remains the full CAR ingest's job, and its rev monotonicity refuses to roll back past anything a follow accepted. Live follow is a light path in the same sense as the PDS light reads: timely, CID-checked, periodically anchored by a verified snapshot. This answers the issue's open question 4: live follow is in scope as a filtered per-account follow in both shapes, not a relay-scale programme.

Test-oracle repair included (pre-existing breakage on main)

cargo test -p id-import-atproto did not compile on current main: the recent ecdsa/elliptic-curve bump (#17130 lock reunify + deps bump) renamed VerifyingKey::to_encoded_point → to_sec1_point (7 test sites) and made Signature::normalize_s return the signature directly instead of an Option (2 test sites). Control run on plain main (fleet-run 46446993350) failed with the identical 9 errors. This PR repairs those 9 test-only call sites so the crate's suite runs again; no production code changes.

Verification

  • fleet-run 46456076009 SUCCESS at head 8eebeba: cargo fmt --check clean, cargo test -p id-import-atproto 52 passed / 0 failed (45 pre-existing + 7 new live-follow tests: Jetstream create/link-roundtrip/update-delete-filtering/forged-CID, firehose apply + cursor + replay, tooBig refusal, URL builders).
  • Clippy note: under the runner's clippy 1.99, --all-targets emits warn-level lints across the whole crate (pre-existing files included — e.g. cbor.rs 71, apply.rs 47, live.rs 60, same lint classes); no errors. The crate's lints are warn-level by its own Cargo config; a crate-wide clippy-drift cleanup is separate work from this slice.

Closes #13787 — with this slice every named piece is landed: DID resolution + verified repo/record ingest, CLI/store application, blob references, blob fetching, and live follow.

{
  "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-30T16:10:36Z",
    "session_id": null,
    "lane": null,
    "host": "htch-runtime",
    "worktree": "/home/hatch/workspace/github-work/code-13787-live",
    "model": null,
    "lane_start_issues": [],
    "workspace_ref": {
      "kind": "worktree",
      "id": "/home/hatch/workspace/github-work/code-13787-live",
      "repo": "developing-today/code",
      "branch": "xaltha/13787-live-follow",
      "sha": "8eebebace0e2b7dad069f70911a5ca2463280c8b"
    },
    "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.

@coderabbitai

coderabbitai Bot commented Nov 30, 2026

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

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: 55331ae1-4790-4a49-b157-b795a3f1be6a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • 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

@developing-today-fleet
developing-today-fleet Bot merged commit d8751de into main Nov 30, 2026
2 checks passed
@developing-today-fleet
developing-today-fleet Bot deleted the xaltha/13787-live-follow branch November 30, 2026 16:11
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.

id: AT Protocol read compatibility — DID resolution + repo/record ingestion (consider)

1 participant