Skip to content

P5 O11 M4: enrollment, delegations, listings and owner-only push - #204

Merged
SSFSKIM merged 7 commits into
masterfrom
p5-o11-m4
Oct 27, 2026
Merged

SSFSKIM merged 7 commits into
masterfrom
p5-o11-m4

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Oct 27, 2026

Copy link
Copy Markdown
Owner

P5 O11 M4: enrollment, delegations, listings and owner-only push. The plan is docs/doperpowers/plans/2026-10-27-p5-o11-hub-v2.md, milestone M4.

What this lands

  • v2 enrollment.
    • After redeeming as it does today, a machine posts its key, its MachineRef and MAC(k, name ‖ machinePub ‖ ref ‖ tokenId) to /machine/key. Each enrollment takes one key: a different key answers 409 key-posted.
    • The enrolling member's device fetches the key at GET /api/enrollments/<id>/key.
    • The machine counts as listed once a state lists that key. listed is derived when it is read, not stored.
    • The v2 code smns-enroll-v2. carries {hub, token, roots, recoveryPub, machine?} and no org key.
  • Re-enrollment in place applies to an active machine whose code names it.
    • The old credential is fenced at its Machine DO before anything changes. A failed fence answers 503 fence-failed, and the token stays open for a retry.
    • A lapsed re-enrollment keeps the machine's row with no credential.
    • A superseded replacement token is expired in the switching transaction. Retrying it rotates nothing.
  • Delegations.
    • Provisioning keys are re-issued as RL5 delegations. The null terms map to "no cap" and "never".
    • A delegated VM's certificate is bound to its poster's name and delegation. Its use must equal the enrollment's counted redemption, and a contested certificate is refused 409 contested with its conflicts.
    • Retirements are taken from members and from machines.
  • Listings and endpoint records.
    • They are stored per (machine, session) at the highest revision and the newest issued, and served to members.
    • Each is verified against the head and the kept certificates. It is committed only while neither has moved, with the freshness check inside the commit's transaction.
  • Owner-only push.
    • Registry.push takes the uploading machine's name, so only that machine's listing of a session counts.
    • A listed session's notice is OwnerNotice {project, machine, session, kind}.
    • An unlisted session gets no v2 push. Unlisted DX2 sessions keep today's broadcast and payload.
    • Subscriptions can bind to a device. A device the head no longer lists is skipped.
  • M3's re-check, extended to M4's routes. Member routes re-check current(member). A machine's key, certificate and retirement re-check the new Registry.enrolled(machine) (403 not-enrolled), before and inside the commit.
  • The O11 document. M4 is ticked, and its decisions and discoveries are folded in.

Validation Evidence

  • Tests: desk-hub 806/806 (60 files) and desk-web 918/918 (97 files). Typechecks are clean, and eslint is clean on the touched files. Every finding was fixed test-first; the RED/GREEN evidence is in the executor's report.
  • Review:
    • doperpowers:reviewer-medium reviewed M4's own range, 3286436..543b498, with one fix wave. The re-review came back correct.
    • doperpowers:reviewer-high reviewed the integration onto M3, f5195d2..d7788e4. It found one P2: retrying a superseded re-enrollment token destroyed the newer credential. That was fixed in 4717bcd, and the re-review came back correct.
  • Staging: acceptance 2's delegation part and acceptance 5 are proved in the suites. Their staging run is M8's acceptance run.
  • CI: ci-gate GREEN on c792a9c8b (static, unit, probes, e2e:desk-web): https://github.com/SSFSKIM/MAWS/actions/runs/40448228839

For the architect's tech-debt tracker

  • apps/desk-hub/src/objects/registry.ts is 1,448 lines. Its enrollment and push paths are candidates to split out, as OrgChain and OrgRecords were.

For O14 and O10

  • No v2 provisioning code exists yet. A delegated VM needs the delegation's private key from its secret store, through smns-provision-v2. or an equivalent. The fake VM takes the key directly. O14 (devcloud) and O10 need such a code.

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

- A machine posts its own key and ref with the pairing MAC once redeemed
  (POST /machine/key); the enrolling member fetches it
  (GET /api/enrollments/<id>/key); /api/machines shows it listed once the
  head lists that key. The v2 code smns-enroll-v2. carries roots, the
  recovery key and k, no org key. An active machine re-enrolls in place
  under a token that names it.
- Provisioning keys re-issued as delegations (delegationFor, null terms
  mapped to numbers) list the head's pub and owners. A VM posts its
  delegation-signed certificate (POST /machine/cert) at its counted use,
  admitted only on a clean verifyMachineCert and never when it would
  contest a live one (409 contested with the conflicts and remedies);
  retirements by the delegation's key are kept; both are served beside
  the state.
- Listings and endpoint records are verified against the head and kept at
  their newest (Registry.storeListing / storeEndpoint for M6), served at
  /api/listings and /api/machines/<ref or name>/endpoint.
- Push subscriptions may bind to a device; Registry.notify sends
  {project, machine, session, kind} to the listed owners' devices alone;
  DX2's push goes to listed owners when a listing exists.
- fake-machine/org.ts: the v2 machine and the delegated VM.

Sminos-Session: desk-sminos-orchestrator#b4948247 (doperpowers on macbook)
…push by machine

- A listing's revision and an endpoint record's issued are checked inside
  the commit's transaction, so concurrent submissions can't overwrite a
  newer record with an older one.
- Re-enrollment in place fences the old credential at its Machine first
  and changes nothing until that succeeds (503 fence-failed, redeem again).
- A re-enrollment that lapses before its machine connects refuses the new
  credential and orphans its token; the machine keeps its row and history.
- Registry.push takes the session's machine (additive, from Project):
  only that machine's listing directs it, and a listed session gets the
  v2 OwnerNotice alone; unlisted sessions and older Projects keep today's
  broadcast and payload.

Sminos-Session: desk-sminos-orchestrator#b4948247 (doperpowers on macbook)
…utes

M3's current() now guards every M4 change made for a member: the
enrollment's key, a member-relayed certificate retirement, the listings
and endpoint reads, and the push subscription's device binding. Machine
posts (key, certificate, retirement) re-check that the resolved
credential still holds its enrollment; the certificate and retirement
paths re-check again in OrgRecords' synchronous commit step, after the
verification awaits. The revoked holder in org-delegations names its
prefix, as M3's RevokedKey now requires. The O11 document is M3's side.

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

Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
A re-enrollment in place now expires the earlier pending one it
displaces, in the same transaction that hands the machine over. A
pending token sent again rotates only while the machine still holds its
enrollment, and a mint checks that before it deletes the name's tokens:
a stale redemption no longer clears or deletes the newer credential.

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)
@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-27T04:17:57.351570Z c792a9c 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.

@SSFSKIM
SSFSKIM merged commit de9f986 into master Oct 27, 2026
SSFSKIM added a commit that referenced this pull request Oct 27, 2026
…sioning code a delegated VM needs; tracker row for registry.ts's size

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
SSFSKIM added a commit that referenced this pull request Oct 27, 2026
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