Skip to content

P5 O14 M1: the v2 provisioning code, provision, retire and unenroll (endpoint half) - #254

Merged
SSFSKIM merged 16 commits into
masterfrom
p5-o14-m1
Oct 28, 2026
Merged

SSFSKIM merged 16 commits into
masterfrom
p5-o14-m1

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Oct 28, 2026 •

Copy link
Copy Markdown
Owner

P5 O14 M1, the org-protocol and src/endpoint half: the v2 provisioning code, its redemption, the certificate's retirement and the local unenroll (docs/doperpowers/plans/2026-10-27-p5-o14-cutover.md, M1; Interfaces §A, §B).

  • apps/org-protocol/src/provisioning.ts: the smns-provision-v2. codec (encodeProvisioningCodeV2 / decodeProvisioningCodeV2), with named refusals and the optional legacy, plus a provisioning vectors section.
  • mawsd endpoint provision [--name N] [--wait [s]] [--json] is a resumable transaction over four states: nothing held, provisioning.json held, hub-confirmed with a certificate, and org-listed. delegation.json and provisioning.json are written before the hub calls they guard, so a rerun after any interruption never redeems twice. The exit codes are 0 for listed, 4 for hub-confirmed or a transient failure, and 1 for a refusal.
  • mawsd endpoint retire signs a CertRetirement with the delegation key and keeps it durably in retirement.json. It then posts it, DELETEs the enrollment, and destroys the machine key and the delegation key. A lost answer is reconciled on the rerun.
  • mawsd endpoint unenroll is local and contacts no hub. RL10 stops being served at once. Every private key is destroyed, archived ones included, and their key ids are kept in stale-<ISO>/keys.json. The rest of the state moves aside and machine.json is kept.
  • delegated is added to keys --json and status --json.

Not in this PR:

  • The src/mawsd half (secret-reading for provision) waits for O2 on master and follows as p5-o14-m1-mawsd.
  • provision's byteless tombstone is carried by whichever of M1 and M5a lands second (the refresh entry of the spec's Decision Log, 2026-10-28).

Validation Evidence

  • Review: doperpowers:reviewer-high, five rounds; correct at rounds 4 and 5.
    • Round 1: P1, unenroll raced an in-flight provision. P1, unenroll discarded the inbound replay index. P2, moving signatures/ aside re-signed held positions. P2, a pending redemption showed as none. Fixed in c10e6ecf7: lifecycle verbs are serialized, signatures/ and inbound/ are kept, and a pending redemption shows as hub-confirmed. The spec's move list was revised.
    • Round 2: P2, the kept records were not org-scoped. Fixed in 37a385a7c with records-authority.json.
    • Round 3: P2, unmarked records were relabeled with the new provisioning's authority. Fixed in ea50a9b92, which fails closed.
    • Round 4: correct.
    • Round 5, after the merge with M5a and the byteless-tombstone seam (963d33a99): correct.
  • Gate: scripts/ci-gate.sh <wt> --gates static,unit,probes --class1a pool.
    • RED at the first head, run 40627836110. The secret scan flagged the provisioning vector, which embeds the fixed test legacy key. Fixed with one exact-value gitleaks allowlist entry.
    • GREEN at c10e6ecf7 (run 40630081164), at 75938e1f9 (run 40631703380), and at 963d33a99 after the merge with M5a (run 40634099729).
  • Focused runs on the Mac, one file each: provision 22/22, enroll 7/7, cli 14/14, status 3/3, rl10 units 9/9, review 14/14, conversation.local 1/1, actions 34/34, legacy-retired 7/7, org-protocol vectors 5/5, desk-hub org-protocol 4/4; node --test .github/scripts/maws-app-scan.test.mjs 8/8.

Residue

  • The src/mawsd half, waiting on O2.

Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)

…d refusals and its vectors (P5 O14 M1)

Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
… O12 M7c)

Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
…s (P5 O14 M1)

provision redeems a smns-provision-v2. code into a live certificate as a resumable four-state transaction (delegation.json and the legacy key before any hub call, provisioning.json before the first authenticated request, the write set rebuilt from it, completed at start before the key-without-ledger rule); retire signs the certificate's retirement with the delegation key, frees the hub row and destroys the keys once both calls are marked in retirement.json; unenroll is local: RL10 unserved, every private key destroyed with its id kept, the rest moved aside. The src/mawsd half follows O2.

Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-10-28T03:38:17.764788Z d2f8a8b 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.

… in-flight provision (review round 1)

Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
… and inbound/ kept by unenroll, a pending redemption shown; the vectors' legacy key allowlisted (P5 O14 M1)

Enroll, provision (up to its write set), retire and unenroll run one after another, so an unenroll is never undone by a provisioning that awaited its certificate's answer; a wait for the listing that outlives its enrollment is refused unenrolled. unenroll keeps signatures/ and inbound/ in place (the spec's revised move list). A held provisioning.json shows hub-confirmed and delegated in keys and status. The push scan's gitleaks config allowlists the fixed legacy key of the provisioning vector, by rule, path and exact value.

Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
…der another org, hub or recovery key moves signatures/ and inbound/ aside (P5 O14 M1, review round 2)

records-authority.json beside the kept directories names the org, hub and recovery key they were made under; written with an enrollment's set (or at unenroll, for an enrollment made before it), compared when the next set is written, and on a mismatch the records and the marker move to a stale-<time>/ and RL10's ledger and replay-index caches are dropped. A same-authority redo still reuses its signatures.

Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
…ed as their authority (P5 O14 M1, review round 3)

claimRecords and unenroll derive a missing marker only from an enrollment whose set is already written, never from a pending provisioning.json (written before its set, so it named the very enrollment claiming the records): unmarked records with no earlier enrollment to name them move aside.

Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
…bstone

A pending provisioning's first sync precedes its enrollment set, so M5a's first-synced-state rule saw no org and kept the code's key. The legacy key now takes a pending provisioning's org; the test also checks that M5a's legacy status/purge meets the copy unenroll moves aside.

Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
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