Skip to content

P5 O13 M2: the pairing code, its MAC and fingerprint, and deployment admin - #247

Merged
SSFSKIM merged 15 commits into
masterfrom
p5-o13-m2
Oct 28, 2026
Merged

SSFSKIM merged 15 commits into
masterfrom
p5-o13-m2

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Oct 28, 2026 •

Copy link
Copy Markdown
Owner

P5 O13 M2: the pairing code, its MAC and fingerprint, and the owner's deployment admin command.

The protocol package (apps/org-protocol/src/pairing.ts, spec §A) gains:

  • smns-pair-v1. codes, carrying the hub, org, member, root pins, recoveryPub and a 16-byte k. A code decodes only in its canonical spelling.
  • pairingMac: HMAC-SHA-256, length-prefixed under its own domain smns-pair-mac-v1, over the org, the member and the device entry.
  • pairingFingerprint: xxxxx-xxxxx, over the whole entry its passkey included, so a swapped credential under a kept channelPub shows a different fingerprint (RL DL28).
  • A vector replayed under Node and workerd. The generator regenerates vectors.json and keys.json wholesale, hence that part of the diff.

pnpm --filter desk-hub deployment admin (deploy/admin.ts, admin-device.ts, spec §F) is the owner's hand on the org state until O8's Org page:

  • init: a software admin device, 0600. Refused under /tmp, $TMPDIR, a git work tree, ~/.claude, iCloud or ~/.config/claude-secrets. Excluded from Time Machine before any key is written.
  • genesis --recovery <path | paper>: the recovery key goes only to a removable volume (or paper) and is read back against recoveryPub before anything is signed. A genesis interrupted after its POST is resumable.
  • adopt: anchors an org rooted earlier, checked against the config's orgGenesis.
  • pair --class web-cards|native-mac: the code goes to /dev/tty and the clipboard. The entry's MAC is checked and its fingerprint shown in the approve prompt. Hub strings are escaped and held to a grammar. Two answering entries are refused.
  • devices, remove-device, refresh: the last signs the no-change successor the 30-day backstop needs.
  • Every subcommand prints the head's age first.
  • Confirmations: against a deployment they read /dev/tty, so an agent's shell can sign nothing. --yes works only with a loopback --hub.
  • No two successors of one parent:
    • Every signing verb goes through one amend path, (await anchored(…)).amend(edit), which O14's verbs will also call. It writes the signed proposal into the anchor's pending slot before it posts.
    • Before signing, every verb reconciles a pending proposal: it adopts the proposal if the hub's head is that proposal, resends the same bytes if the hub holds no successor of the parent, and refuses fork otherwise.
    • A per-anchor lock covers every subcommand except init.
    • A not-head answer is no longer signed again.

staging-run.sh admin <args…> runs it against staging. Its filter now flushes per line, and the step refuses init and the local-hub flags.

The branch also carries the O13 refresh commit and the spec's living sections.

Validation Evidence

  • npx vitest run --project desk-hub apps/desk-hub/test/deploy/admin.test.ts → 24/24 against the local hub. Covered:
    • init's placement refusals, and the exclusion before any key, with a failing tmutil stub;
    • genesis to a destination with a corrupted read-back refused, paper typed back, a rooted hub refused, a resume after a kill between POST and anchor, and a forged head on resume refused;
    • the recovery destination refused on the keys' volume, on internal media, beside the keys or in a sync scope;
    • no-tty stops before any request, and --yes refused without --hub;
    • refresh;
    • adopt, plus its wrong-pin, wrong-device and non-root refusals;
    • pair ignoring a foreign MAC, showing the package's fingerprint, and a swapped passkey under a leaked k showing a different one;
    • two entries refused, a control-character id refused, a web-cards entry with stepUpPub refused by the hub;
    • remove-device, including of a second root.
  • pnpm --filter org-protocol test: pairing 12, encodings 15, vectors 5, api 12, workerd 1, channel 35, all passing. desk-hub's staging-scripts 11, staging-only 9, key-files 3, cleanup-paths 4 and org-protocol replay 4, all passing.
  • Staging, by the executor through staging-run.sh admin:
    • adopt against staging's pinned genesis, then devices, then refresh: staging's head went from version 22 to 23.
    • A pair from the agent's shell stopped at Device not configured with nothing sent, which shows the /dev/tty rule live.
    • Pairing and removing a device on staging is M7's, run at the owner's terminal (spec Decision Log, 2026-10-28).
  • eslint and the desk-hub and org-protocol typechecks: clean.
  • No-fork cases, written failing-first:
    • an error after the hub stored the proposal is adopted on the next run, with no second successor;
    • a lost POST is resent byte for byte;
    • fork is refused and the anchor left untouched;
    • two invocations contend for the lock.
      admin.test.ts is now 28/28.
  • Review: doperpowers:reviewer-high, three rounds.
    • Round 1 found five things, all fixed with failing-first tests:
      • control characters could spoof the approve prompt;
      • the recovery destination checked "another volume", not removable media;
      • private keys were written before the backup exclusion;
      • the interrupted-genesis resume trusted an unverified head;
      • revoking a root device left its key in root.keys.
    • Round 2: correct, no findings. Round 3, over the no-fork rule (6d5f45b..a84e091) and the gate fix ddb2114: correct, no findings.
  • ci-gate, --gates static,unit --class1a pool: RED on efcf4f6 (run 40620028563): TS2345 in pairing.ts under desk-hub's Worker-typed program; fixed in ddb2114, which drops TextDecoder's options and checks UTF-8 by round trip. Then GREEN on ac2c5d0, the PR head (run 40622289173).

Residue

  • The removable-media check has not met a physical USB drive. The reviewer's probes confirmed it refuses this Mac's internal, Data and VM volumes and an unmounted path. Acceptance of a real removable drive is first exercised at the owner's production genesis (M7's rollout step 2). If it refuses a real drive, the fix is in admin-device.ts's removableVolume.

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

Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
… volume mounted at genesis)

Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
…with their vector (P5 O13 M2, §A)

Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
…O8 (P5 O13 M2, §F)

init, genesis (the recovery key to its destination alone, checked back; a rerun finishes an interrupted genesis), adopt, refresh, pair (the package's code, MAC and fingerprint; two answering entries refused), devices and remove-device; confirmations at /dev/tty against a deployment, --yes only at the local hub. staging-run.sh gains its admin step, filtered line by line.

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)
…aped and entries held to a grammar, removable media for the recovery key, the exclusion before any key, a rerun's chain verified, a root's key out of the root set

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

chatgpt-codex-connector Bot commented Oct 28, 2026 •

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 ✅ Completed 2026-10-28T02:19:38.530793Z efcf4f6 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.

…package typechecks under the Workers' types too (P5 O13 M2)

Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
…he anchor, the per-anchor lock)

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

Every signing verb goes through one amend path that keeps the signed successor in the anchor's pending slot, durably, before its POST; the next run settles it first (adopted, sent again byte for byte, or refused as a fork, the anchor unchanged). The not-head re-sign is gone. Each subcommand but init holds the anchor's run lock, never taken over.

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)
@SSFSKIM
SSFSKIM merged commit a147a24 into master Oct 28, 2026
SSFSKIM added a commit that referenced this pull request Oct 28, 2026
…ent admin); tracker: the vector generator's churn

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS 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