Skip to content

id: implement hosted HTTPS/WS signed-object bridge v1 (from #2046) #3818

Open

Description

@dezren39

Implementation packet for the #2046 serverless-edition synthesis. Use the bridge-semantics investigation and the completed DO-shaped SQLite PoC (#2058, #2276, PR #2848) as the design inputs.

Scope: production HTTPS/WebSocket push/pull between native ID nodes and the hosted per-user store; authenticate with ID-key proof and the account/binding contract; transfer signed objects and proof-carrying chain/fork evidence; reuse native ingest/resolve semantics without server-assigned order, re-signing or authoritative snapshots. Add bounded batches, cursors/frontiers, retry/backpressure and withholding detection. Do not implement shared-world execution here.

Gate: depends on #3808 binding contract and #3811 hosted UserDO; do not start before those contracts are accepted. The semantic PoC is already merged as PR #2848; this is production protocol work, not a duplicate PoC.

Acceptance: native-to-hosted and hosted-to-native convergence, equal-height forks, withheld dependencies, replay into empty stores, retry/idempotence and bounded resource tests; every accepted object keeps its original signature. PR references this issue, #2046, #2852 and #2276.

Activity

  1. added
    kind/featureNew feature or capability request
    task/small-fixQueue packet kind: bounded fix with reproduction and targeted tests
    source/queue-workerFiled or worked by the queue/worker pilot
    priority/highImportant and time-sensitive
    on Nov 1, 2026
  2. developing-today commented on Nov 1, 2026

    @developing-today
    Contributor
  3. added
    app/idPackage/app: id (pkgs/ or apps/ in this repo)
    effort/lLarge: multi-day or open-ended; expect staged check-ins
    on Nov 1, 2026
  4. dezren39 commented on Nov 1, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

  5. added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed on Nov 2, 2026
  6. dezren39 commented on Nov 2, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  7. 72 remaining items

  8. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    Hosted leg landed for review: PR #12911 — #12911 (unmerged, for Felix's review).

    Claim route: queue task 5823. Direct fleet queue claim --task 5823 refused from this seat, so the claim is the GitHub fallback claim (worker felix, comment 7091206714 on this issue).

    Gate state → scope: the triage note (task 18271) records the packet gate discharged — #3808 closed, #3811 closed as completed 2026-11-23 — so this PR implements the full v1 scope rather than a gated subset: event codec (canonical CBOR + Ed25519 + BLAKE3, chain.rs-faithful), the native ingest decision procedure mirrored on the UserDO's SQLite, range reconciliation transcribed from range.rs, ID-key proof auth against the #3808 binding record (fail-closed when no key is bound), the session protocol with acknowledged batches / resume tokens / withholding detection, and the HTTPS push/pull + WebSocket routes. Bridge bytes count toward the storage ceiling.

    What remains on this issue (it stays open): the native Rust dialer — id-sync speaking this wire from Rust. The hosted endpoint, protocol core, and a protocol-faithful reference client are in the PR, and cross-language fixtures (pkgs/id/tests/bridge_fixtures.rs + pinned vectors in the hosted suite) pin the contract in both directions: TS-signed events ingest natively; Rust-signed events verify in the hosted codec.

    Scoping calls recorded in the PR and the design record (doc/2026-11-23T05-00-00Z_design_bridge_v1_implementation/): deep per-kind payload checks not re-implemented (residual divergence surface — only the key holder can produce such an event); membership voiding not in the bridge store (presence semantics unaffected); sync set includes waiting events per the PoC, deduped by id; WS sessions on the classic accept path with retry/resume recovery.

    Evidence: hosted-worker suite 77/77 + tsc clean (sandbox); the six new bridge suites fail 0/6 on pristine main and pass with the change; on the laptop under the fleet build lock, bridge_fixtures 17 passed and bridge_poc 21 passed. No new dependencies.

    Releasing the fallback claim as done with this summary; the issue itself remains open for the dialer leg above.

  9. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    Released by felix (outcome: done). Hosted leg of #3818 landed as PR #12911 (unmerged, for Felix's review): bridge endpoint, protocol core, store, auth, sessions in pkgs/id/hosted-worker + cross-language fixtures. Evidence: hosted-worker 77/77 + tsc clean (sandbox); bridge suites fail 0/6 on pristine main; laptop under build lock bridge_fixtures 17 passed, bridge_poc 21 passed. No new dependencies. #3818 stays open for the native Rust dialer leg. Completion note: #3818 (comment) (queue task 5823; fallback claim comment 7091206714).

  10. added a commit that references this issue on Nov 23, 2026
  11. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    event: PR #12911 MERGED — hosted signed-object bridge v1 (endpoint, protocol core, store)
    by: agent felix (kind muse, Muse sandbox seat), merging after review
    at: 2026-11-22

    PR #12911 merged (+4899/−8, 21 files). The bridge is a sync peer, per the #2058 verdict: chain-faithful event codec (canonical CBOR + Ed25519 + pure-TS BLAKE3, all nine payload families), the native decide_in ingest mirrored on the UserDO store, range reconciliation from range.rs, ID-key proof auth failing closed (503 with no bound key), the session protocol with withholding detection, HTTPS push/pull + WS routes, bridge bytes counted against the storage ceiling.

    Felix's review: re-ran the hosted suite — 77/77; read the crypto seam (src/ed25519.ts): verification is refusal-shaped (any error is false, length gates before crypto), the WebCrypto-vs-verify_strict gap is named honestly and cannot arise for ceremony-produced keys; the laptop cross-language fixtures (17/17 TS↔Rust both directions) pin the real contract. Fail-before: the six bridge suites go 0/6 on pristine main. No new dependencies.

    #3818 stays open for exactly one leg: the native Rust dialer. The merged fixtures are the contract it must satisfy.

  12. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    Agent note — claim (lane FQ, queue task 5823), 2026-11-23

    State: claimed — implementing the remaining leg of #3818: the native Rust dialer.

    Fresh gate recheck: #3808 CLOSED, #3811 CLOSED (completed 2026-11-23) — the start gate is discharged. The hosted leg landed as PR #12911 (merged), whose body names the remainder: "the native Rust dialer leg remains". The design record (doc/2026-11-23T05-00-00Z_design_bridge_v1_implementation/) scopes it: the Rust dialer inside id-sync — the /id-range-sync/1 peer role over the bridge wire (CHALLENGE/AUTH, HELLO/RESUME, RANGE, WANT/BATCH/WANT_END/ACK, DONE/TOKEN) against the hosted endpoint, with ID-key proof auth and withholding detection, driving the native EventStore.

    No other live claim covers this leg (felix released task 5823 at 04:52Z after the hosted leg; the 03:51Z triage routed implementation onward).

  13. added 2 commits that reference this issue on Nov 23, 2026
  14. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    Agent note — native dialer landed (lane FQ, queue task 5823), 2026-11-23

    PR #12993 merged (merge e01d15e6ab3, head 8ef0c2e8adc), verified present on main: pkgs/id/crates/id-sync/src/bridge.rs (1,350 lines).

    What landed — the leg PR #12911's body and the design record named as #3818's remainder: the Rust dialer inside id-sync, the /id-range-sync/1 peer role over the bridge wire.

    • Wire codec (tags, batch encoding, hosted receipt bounds in the hosted codec's order, frame cap on receipt) and the ID-key proof (bridge-auth transcript; empty-body hash = the fixtures' pinned af1349b9…).
    • BridgeStore per-step seam over the native EventStore (heads / sync entries / event bytes / batch ingest / chain frontier, via the existing RangeStore + ingest_batch surface).
    • BridgeDialer: CHALLENGE/AUTH, HELLO or RESUME, the proof-carrying range exchange over the native range core, bounded WANT/BATCH/WANT_END transfer with outcome summaries, DONE/TOKEN, withholding detection, and sync_with_retry with the resume-rejected → HELLO fallback. Transport is a whole-message trait; production impl is tokio-tungstenite's WebSocketStream with a connect helper for /v1/bridge/ws.

    Verification (laptop worktree off origin/main, nix develop): cargo test -p id-sync bridge:: — 6 passed / 0 failed (codec round-trip + bound refusals; transcript/body-hash pins; session vs a mirrored server session over an in-memory pair converging both directions with token resume; withholding evidence; wrong-key refusal; resume fallback). The convergence test was additionally run 5× standalone (5/5) after one tally assertion was corrected: want order is the range exchange's learning order, not chain order, so an event may land Waiting and be released by its predecessor — convergence is the guarantee, the per-kind tally is not. cargo fmt --check clean for the new file.

    Remaining on #3818 (issue stays open, also recorded in the updated design record): (1) the one-shot HTTPS legs (challenge/heads/push/pull) as native calls — the WS session above is the full protocol; the HTTPS legs are the convenience surface; (2) a live native-against-hosted session test (the dialer's tests mirror the server session in Rust; the cross-language event/range contract underneath is pinned by tests/bridge_fixtures.rs and the shared range core).

  15. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    Agent note — claim (lane IL, archer), 2026-11-23

    State: claimed — implementing remainder 1 named in Lane FQ's done record on #3818: the one-shot HTTPS legs (challenge/heads/push/pull) as native calls in pkgs/id/crates/id-sync, against the hosted bridge surface landed by PR #12911 / PR #12993.

    Premise check (fresh REST): #3818 OPEN; FQ's dialer leg merged (e01d15e6ab3) and released; no live claim covers this slice. Remainder 2 (live native-against-hosted session test) stays named on the issue, not part of this slice.

  16. added a commit that references this issue on Nov 23, 2026
  17. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    Agent note — one-shot HTTPS legs landed (lane IL, archer), 2026-11-23

    PR #13031 merged (merge eb22a545a45e, head ed084e2a930 SHA-guarded; module verified present on main): remainder 1 of Lane FQ's done record — the one-shot HTTPS legs (challenge/heads/push/pull) as native calls.

    What landed — pkgs/id/crates/id-sync/src/bridge_http.rs:

    • BridgeHttpClient (one binding, one ID key, one front-door base URL) over a BridgeHttp request/response seam; production transport ReqwestHttp (reqwest over rustls — the workspace's existing HTTPS stack via id-worlds; one new dependency edge for id-sync + its Cargo.lock line).
    • Every leg but challenge fetches a fresh single-use nonce and signs the same bridge-auth transcript the dialer uses, sent as x-id-nonce / x-id-proof (the hosted bridgeProof headers). Non-success answers surface as BridgeHttpError::Refused with the server's status + named {error, message} code.
    • Push is bound-checked client-side in the hosted codec's terms before anything is sent; pull decodes its batch under the receipt bounds and reads heads/more from the x-bridge-heads / x-bridge-more headers.
    • The design record's dialer bullet now records the legs as landed.

    Verification (laptop worktree off origin/main, nix develop in pkgs/id): cargo test -p id-sync bridge_http — 7 passed / 0 failed against an in-memory mirror of the hosted routes over a native EventStore (empty-store heads; wrong-key proof refused as 403 bridge_proof_invalid; a nonce proves exactly one call — replay gets 403; push/heads/pull round trip with duplicate re-push; pull pagination at max_events=1; malformed event as a refused outcome; over-bound batch refused locally with zero requests sent). Full crate suite cargo test -p id-sync --lib — 238 passed / 0 failed; cargo fmt --check -p id-sync clean.

    Remaining on #3818 (unchanged, named for the next slice): remainder 2 only — a live native-against-hosted session test (the dialer and these legs against the deployed hosted worker, not a mirror). #3818 stays open on it.

  18. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    event: remaining leg given its own home — #13036
    by: agent felix (kind muse, Muse sandbox seat)
    at: 2026-11-23

    The hosted bridge v1 scope (PR #12911, merged) is this issue's completed half. The one remaining leg — the native Rust dialer — is now tracked separately as #13036, with the merged cross-language fixtures as its conformance contract. This issue stays open as the parent record until #13036 lands.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    app/idPackage/app: id (pkgs/ or apps/ in this repo)effort/lLarge: multi-day or open-ended; expect staged check-insepic/id-programReprioritization program epic (2026-11-12)kind/featureNew feature or capability requestpriority/highImportant and time-sensitivequeue/blockedQueue or user escalation statesource/queue-workerFiled or worked by the queue/worker pilotstatus/blockedQueue or user escalation statetask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions