Skip to content

id: universal signed-and-validated admission gate for both cores (A9120-signature-gate, #10275) - #12893

Merged
dezren39 merged 1 commit into
mainfrom
lane-er/10275-admission-gate
Nov 23, 2026
Merged

dezren39 merged 1 commit into
mainfrom
lane-er/10275-admission-gate

Conversation

@dezren39

@dezren39 dezren39 commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

Implements slice A9120-signature-gate for #10275 — the universal signed-and-validated admission gate for both cores (design part A, cross-cutting invariant 1, S1.12–S1.20).

Preflight (task 17114): all five native blockers re-verified CLOSED via gh REST before implementation — #9083, #10160, #10226, #10244, #10257. Record: #10275 (comment)

What lands (exactly the issue's four owned files, +1759/−0):

  • pkgs/id/crates/id-core/src/admission_gate.rs — AdmissionGate with one pipeline on both admission paths (admit for constructed envelopes, admit_canonical for wire bytes): (1) semantic validation incl. canonical round trip, (2) signature + payload verification via the A9114 envelope (digest recomputed on receipt), (3) signer binding — directory-registered key must equal the body key and the authenticated principal must be the signer, (4) namespace/tenant authorization via the injected A9116-pattern seam (shipped ScopeBindingAuthorizer: body context must equal the authenticated tenant scope), (5) policy — admitted domains + payload budget. AdmissionReceipt has private fields and no constructor outside the gate: no route bypass. The gate consumes the design(pm-stack): tenancy architecture — per-user Turso databases + central tenancy DB, served by Workers and Durable Objects #9083 context contract shape; it does not define tenancy.
  • pkgs/id/crates/id-core/tests/admission_gate.rs — the declared model oracle: proptest generates admission operations (valid, tampered payload, forged signature, unknown/rebound signer, wrong principal, wrong scope, oversized, unadmitted domain, garbage bytes, non-canonical construction, duplicates) against an independent reference model; every accepted set and rejection class compared after every operation. Plus targeted tests for receipt fields, the no-unsigned-local-exception rule, wire/constructed path equivalence, and context validation.
  • pkgs/id/hosted-worker/src/admission-gate.ts + test/admission-gate.test.ts — TS mirror: same pipeline, stage order and rejection classes over the canonical-CBOR codec + WebCrypto Ed25519. Its profile dispatch compiles the atlas-chunk-sha256-utf8 verifier; raw-blake3-256 payload IDs refuse unsupported in this build (as an excluding Rust dispatch does) — blake3 admissions stay with the Rust core.

No crate-root/manifest changes (owned by 9110-02); the test includes the module by path, per the sibling-slice pattern. No production rollout.

Verification (laptop, this branch): the issue's exact oracle command —
cargo test -p id-core --test admission_gate → 6 passed / 0 failed; cd pkgs/id/hosted-worker && bun test admission-gate.test.ts → 8 pass / 0 fail. rustfmt --check clean on both Rust files.

Closes #10275.


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

…(A9120-signature-gate, #10275)

One gate on every admission path for both cores, per design part A
cross-cutting invariant 1 (S1.12-S1.20): semantic validation,
signature + payload verification (digest recomputed on receipt),
signer binding against a directory and the authenticated
principal, namespace/tenant authorization through the A9116 seam
pattern, and policy (admitted domains, payload budget). Local
producers sign before entering; no unsigned-local exception. The
AdmissionReceipt is the only accepted state transition and has no
constructor outside the gate — no route bypass.

- pkgs/id/crates/id-core/src/admission_gate.rs (new)
- pkgs/id/crates/id-core/tests/admission_gate.rs (new) — model
  oracle: generated operations vs an independent reference model
- pkgs/id/hosted-worker/src/admission-gate.ts (new) — TS mirror,
  same pipeline/stages/rejection classes; compiles the atlas
  SHA-256 profile verifier (blake3 admissions stay with the Rust
  core and refuse `unsupported` here, as an excluding dispatch
  does in Rust)
- pkgs/id/hosted-worker/test/admission-gate.test.ts (new)

No crate-root/manifest changes (owned by 9110-02); the test
includes the module by path, per the sibling-slice pattern.

Oracle: cargo test -p id-core --test admission_gate → 6 passed;
bun test admission-gate.test.ts → 8 pass.
@dezren39
dezren39 requested a review from a team as a code owner November 23, 2026 04:39
@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-23T04:40:29.480574Z fbcdef3 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.

@dezren39
dezren39 merged commit 6ceb906 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 51 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: c51d2d39-d4d7-468f-b773-a34594207908
Commits

Reviewing files that changed from the base of the PR and between dfb5e26 and fbcdef3.

Files selected for processing: 4

  • pkgs/id/crates/id-core/src/admission_gate.rs
  • pkgs/id/crates/id-core/tests/admission_gate.rs
  • pkgs/id/hosted-worker/src/admission-gate.ts
  • pkgs/id/hosted-worker/test/admission-gate.test.ts
  • 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

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.

Enforce universal signed-and-validated admission gate for both cores

1 participant