Skip to content

feat(id): provisioning surface producing the #3403 gate's evidence - #13162

Merged
dezren39 merged 1 commit into
mainfrom
lane-ps-3403
Nov 23, 2026
Merged

dezren39 merged 1 commit into
mainfrom
lane-ps-3403

Conversation

@dezren39

@dezren39 dezren39 commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

The provisioning/deployment surface for #3403 — the slice Lane HP's gate record and the code-g park note both name as the remainder after PR #12985 landed the validator.

src/provisioning.ts is a pure validator: it consumes deployed-account evidence and never probes an account itself. This PR adds the prober it presupposes, src/provisioning-surface.ts:

  • API-route bucket provisioning — buckets are created only through the Cloudflare API with the cf-r2-jurisdiction header (the id: PoC: verify DO jurisdiction mechanics and confirm vendor residency guarantees #2285 canary showed wrangler's --jurisdiction flag can be silently ignored, creating a default bucket with no warning). Creation is idempotent: a 409 falls through to the read-back.
  • Actual-jurisdiction read-back — a bucket's jurisdiction is taken only from the R2 API. A jurisdiction-less read sees only default-jurisdiction buckets (the canary's jurisdiction-less GET of an eu bucket returned "does not exist"), so the read-back probes each supported jurisdiction with its header before recording a bucket as unverified; a default-jurisdiction bucket is recorded as default, never as the configured claim.
  • Canary result capture — the id: PoC: verify DO jurisdiction mechanics and confirm vendor residency guarantees #2285 canary outcomes are transcribed into the gate's evidence shape verbatim; fields the canary did not determine are captured as unverified, and results for unsupported jurisdictions are dropped. This surface never upgrades a result — the gate judges it.
  • Gate invocation — provisionAndValidate provisions the configured bucket, gathers the evidence, and returns the gate's validated plan or its FailClosed refusal. Under an unsupported jurisdiction it creates nothing. Nothing here authorizes a deployment or makes a residency claim.

Tests: test/provisioning-surface.test.ts (14 tests) runs against a fake client modelling the canary's observed API behaviour, including the create-409/read-back mismatch path and the client header contract. Full hosted-worker suite on the laptop: 116 passed / 0 failed; tsc --noEmit clean. A remote dispatch of the two provisioning test files was attempted (run 45147697038); the fleet-build container has no Node.js (node: command not found, exit 127), so that leg is environmental, not a test result.

#3403 stays open: the remaining step is running this surface against the real account (the live canary/deployment evidence run), which is a production action outside this slice.

The gate in provisioning.ts is a pure validator: it consumes
deployed-account evidence and never probes an account itself. This
adds the prober it presupposes, in pkgs/id/hosted-worker:

- src/provisioning-surface.ts: R2 buckets are provisioned only
  through the Cloudflare API route with the cf-r2-jurisdiction
  header (the #2285 canary showed wrangler's --jurisdiction flag
  can be silently ignored); a bucket's jurisdiction is taken only
  from the API read-back, probing each supported jurisdiction with
  its header because a jurisdiction-less read cannot see scoped
  buckets; canary results are captured into the gate's evidence
  shape verbatim; provisionAndValidate invokes the gate before any
  production signup/migration enablement and returns its plan or
  its refusal. No deployment is authorized and no residency claim
  is made.
- test/provisioning-surface.test.ts: 14 tests against a fake client
  modelling the canary's observed API behaviour, including the
  create-409/read-back mismatch path and the no-create rule under
  an unsupported jurisdiction.
- package.json: the new test file joins the package test script.

Full hosted-worker suite: 116 passed / 0 failed; tsc --noEmit clean.
@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 41 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: a478f85a-bc70-4f6d-8db3-f31edce42e4a
Commits

Reviewing files that changed from the base of the PR and between 96c8407 and ab86cf5.

Files selected for processing: 3

  • pkgs/id/hosted-worker/package.json
  • pkgs/id/hosted-worker/src/provisioning-surface.ts
  • pkgs/id/hosted-worker/test/provisioning-surface.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

@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-23T09:33:21.444228Z ab86cf5 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ab86cf50ca

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +1 to +5
// Provisioning surface for hosted production enablement (#3403): the
// evidence-producing half of the provisioning gate in
// ./provisioning.ts. The gate is a pure validator — it consumes
// deployed-account evidence and never probes an account itself. This
// module is the prober it presupposes:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Add the required design record for the provisioning surface

This change introduces an account-mutating provisioning API and non-obvious evidence decisions, including inferring jurisdiction from a scoped GET when the response omits it, but the commit contains only implementation and tests. The applicable pkgs/id/AGENTS.md requires a dated design document for new behavior, interface changes, and design trade-offs. Add that record describing the provisioning contract, evidence assumptions, and failure behavior; the source comments and commit message do not satisfy the required documentation artifact.

AGENTS.md reference: pkgs/id/AGENTS.md:L159-L168

Useful? React with 👍 / 👎.

@dezren39
dezren39 merged commit 8fec594 into main Nov 23, 2026
2 checks passed
@dezren39
dezren39 deleted the lane-ps-3403 branch November 23, 2026 09:50
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