Skip to content

feat(id-sync): native one-shot HTTPS legs for the bridge (#3818) - #13031

Merged
dezren39 merged 1 commit into
mainfrom
lane-il/3818-bridge-http-legs
Nov 23, 2026
Merged

dezren39 merged 1 commit into
mainfrom
lane-il/3818-bridge-http-legs

Conversation

@dezren39

@dezren39 dezren39 commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

Refs #3818 — remainder 1 of Lane FQ's done record: the one-shot HTTPS legs as native calls. (Not a closing PR: #3818 stays open on remainder 2, the live native-against-hosted session test.)

What landed

pkgs/id/crates/id-sync/src/bridge_http.rs — the native client for the hosted bridge's one-shot routes (GET /v1/bridge/challenge, GET /v1/bridge/heads, POST /v1/bridge/push, POST /v1/bridge/pull):

  • BridgeHttpClient (one binding, one ID key, one front-door base URL) over a BridgeHttp request/response seam; production transport is ReqwestHttp (reqwest over rustls — the workspace's existing HTTPS stack, via id-worlds; one new dependency edge for id-sync plus its Cargo.lock entry).
  • Every leg but challenge fetches a fresh single-use nonce from the challenge leg and signs the bridge-auth transcript (binding, nonce, leg, BLAKE3 of the exact body) — the same auth_transcript/body_hash_hex the dialer uses — sent as x-id-nonce / x-id-proof headers, matching bridgeProof in user-do.ts.
  • Push enforces the receipt bounds client-side (count, per-event, encoded bytes) before anything is sent; pull decodes its batch under the same bounds and reads x-bridge-heads / x-bridge-more. A non-success answer surfaces as BridgeHttpError::Refused with the server's status and named {error, message} code.
  • The design record's dialer bullet is updated to match reality.

Verification (laptop worktree off origin/main, nix develop in pkgs/id)

  • cargo test -p id-sync bridge_http — 7 passed / 0 failed. The tests run the legs against an in-memory mirror of the hosted routes over a native EventStore (nonce mint/consume semantics, proof verify, ingest, position-cut pull): heads on an empty store; wrong-key proof refused as 403 bridge_proof_invalid; a nonce proves exactly one call (replay → 403); push/heads/pull round trip with a duplicate re-push; pull pagination at max_events=1; a malformed event as a refused outcome; an over-bound batch refused locally with zero requests sent.
  • cargo test -p id-sync --lib — 238 passed / 0 failed (the crate's full lib suite, including the dialer's session tests).
  • cargo fmt --check -p id-sync — clean.

See it in action
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

The hosted signed-object bridge's one-shot routes —
GET /v1/bridge/challenge, GET /v1/bridge/heads,
POST /v1/bridge/push, POST /v1/bridge/pull — as native calls in
crates/id-sync/src/bridge_http.rs, the remainder the dialer PR
(#12993) named on #3818.

BridgeHttpClient (one binding, one ID key, one front-door base
URL) over a BridgeHttp request/response seam — reqwest over
rustls in production (ReqwestHttp), the workspace's existing
HTTPS stack. Every leg but challenge fetches a fresh single-use
nonce and signs the bridge-auth transcript over the exact body,
sent as x-id-nonce / x-id-proof; a refusal surfaces the server's
named {error, message} as BridgeHttpError::Refused. Push is
bound-checked client-side in the hosted codec's terms before
anything is sent; pull decodes its batch with the receipt
bounds and reads heads/more from the response headers.

Tests run the legs against an in-memory mirror of the hosted
routes over a native EventStore: heads on an empty store,
wrong-key refusal by name, nonce replay refusal (consumed on
first use), push/heads/pull round trip with duplicate re-push,
pull pagination at max_events, a malformed event as a refused
outcome, and the over-bound batch that never leaves the client.
Design record updated to match; #3818 stays open on the live
native-against-hosted session test.
@dezren39
dezren39 merged commit eb22a54 into main Nov 23, 2026
1 check passed
@coderabbitai

coderabbitai Bot commented Nov 23, 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 33 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: 8cc4f29b-4ebc-4b28-993b-6fc356749da3
Commits

Reviewing files that changed from the base of the PR and between 1c98527 and ed084e2.

Files ignored due to path filters: 1

  • pkgs/id/Cargo.lock is excluded by !**/*.lock
Files selected for processing: 4

  • doc/2026-11-23T05-00-00Z_design_bridge_v1_implementation/2026-11-23T05-00-00Z_design_bridge_v1_implementation.md
  • pkgs/id/crates/id-sync/Cargo.toml
  • pkgs/id/crates/id-sync/src/bridge_http.rs
  • pkgs/id/crates/id-sync/src/lib.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 deleted the lane-il/3818-bridge-http-legs branch November 23, 2026 07:21
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-23T07:22:59.386634Z ed084e2 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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