Skip to content

sminos 1.4.1: provisioning codes, hub check, hub leave (desk provisioning keys) - #313

Merged
SSFSKIM merged 6 commits into
mainfrom
desk-provisioning-keys
Oct 21, 2026
Merged

SSFSKIM merged 6 commits into
mainfrom
desk-provisioning-keys

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Oct 21, 2026 •

Copy link
Copy Markdown
Owner

The machine side of the desk's provisioning keys: a devcloud VM can enroll at the desk hub at boot with no human
step, check its own enrollment, and leave. The design and execution record is the MAWS spec
docs/doperpowers/specs/2026-10-21-desk-provisioning-keys-design.md (M3), on MAWS branch desk-provisioning-keys
(SSFSKIM/MAWS#97). sminos 1.4.1 (above main's 1.4.0).

What changes

  • sminos hub enroll decodes both code kinds: smns-enroll-v1. (one-time, as before) and smns-provision-v1.
    (a reusable provisioning key with a name prefix). The code is read from stdin or the hidden prompt only.

    • With a provisioning code, the name is --name or the host name. A name outside the key's prefix is refused
      locally, exit 2, before anything is sent.
    • The hub's new refusals (key-revoked, key-expired, key-exhausted, prefix-mismatch) are worded for the
      operator.
    • name-taken exits 3, so the boot can pick another suffix.
  • sminos hub check (new) runs GET /machine/enrollment with the stored credential and writes nothing. Its exit
    codes:

    • 0: accepted.
    • 1: not enrolled here.
    • 3: rejected. The Worker answered 403 not-enrolled, or Access answered its 401 page past a 600 s propagation grace
      from enrolled and again on a recheck 90 s later.
    • 4: undecided. This covers an outage, any other answer, or Access's 401 inside the grace. The boot retries it with
      backoff.
  • sminos hub leave (new) runs DELETE /machine/enrollment.

    • On 200, or on a rejection by the same rule, it removes hub.json, exit 0. The daemon's supervisor stops the
      uplink on its own.
    • Anything else keeps the credential, exit 1.
    • A lock shared with enroll's write means leave removes only the credential it checked. A replacement installed
      meanwhile is kept, exit 1.
  • sminos hub show exits 0 when a credential file is held and 1 when none is. It stays local.

  • Tests:

    • hub_standin.py learns keys, /machine/enrollment, Access's 401 for a token it does not hold, a token not yet at
      Access's edge, the Worker's not-enrolled window, held answers and outages.
    • test-hub.sh covers every exit and race above.
    • The parity vectors are regenerated from MAWS 0602580be, with enroll_parity.py comparing whole tagged dicts
      and whole refusal messages.
  • Docs: the skill's SKILL.md and references/setup.md cover enrolling at provisioning time, check and the
    boot's rule, and leave.

  • Whole answers only (c30601c8, the whole-branch xhigh panel's fix): check and leave decide only on a complete body. The body must have been read to its declared length, its last chunk, or EOF. A cut answer is undecided: check exits 4, and leave exits 1 and keeps hub.json.

Commits:

Validation Evidence

  • ci-gate on 0b0b324c (final head): GREEN, 8/8, https://github.com/SSFSKIM/doperpowers/actions/runs/39554649339.
  • ci-gate on d358c760: GREEN, 8/8, https://github.com/SSFSKIM/doperpowers/actions/runs/39547860824. The gates
    are shell-lint, repo-checks, sminos-mods, mods-types, sminos, issue-tracker, board-api and sminos-suites.
  • The panel fix, at c30601c8: the panel's truncated-chunked 403 not-enrolled, and a truncated marked 401 past the grace, both failed first. Against d358c760, check exited 3 and leave deleted hub.json. After the fix, check exits 4, leave exits 1, and the file is byte-identical. test-hub.sh passes 1994/1994, and run-sminos-tests.sh 2127/2127.
  • Local, at 7831e8ac:
    • bash sminos/tests/run-sminos-tests.sh: exit 0, 2127/2127.
    • test-hub.sh: 1871/1871.
    • python3 sminos/tests/enroll_parity.py …: exit 0, 150 ok, 0 FAIL. The vectors hold 15 decoded enroll,
      15 decoded provision and 90 refused cases.
    • The race regression (leave against a concurrent enroll --replace) failed against f3ea1a0e before the fix:
      leave exited 0 and deleted the replacement. It passes after.
  • Cross-repository acceptance walk against the MAWS local hub (MAWS 3165c5f78, this branch d358c760): items
    1–8, 10 and 11 pass as written.
    • Enrollment through a key, its bounds, revocation of the key, leave, and admin-revoked and lost-200 credentials
      learned through Access inside and past the grace all behave as specified.
    • An older sminos (origin/main 1.3.1) refuses the code with enrollment code: not smns-enroll-v1, exit 2, and
      sends no request.
    • The stop/revoke/reboot/re-enroll loop holds: check 4 with the hub down, then 3, then enroll --replace exits 0
      and the next check exits 0.
    • The full walk is the appendix of MAWS docs/doperpowers/specs/2026-10-21-desk-provisioning-keys-report.md.
  • Reviews: M3 was reviewed by the SDE task-reviewer and by reviewer-high. Both findings were fixed and
    re-reviewed clean.

Unresolved Review Findings

  • sminos/tests/dx7-enroll-codes.gen.mjs: the one-time code's padding vector ends its JSON in x, so it refuses
    on bad JSON as well as on padding. Left because the review named only the provisioning case, which now carries =
    on valid JSON and exercises the shared decoder's padding refusal.
  • The merge commit d358c760's message kept git's # Conflicts: comment lines. It is cosmetic, and history is not
    rewritten.

Residue

  • The daemon's log wording on a removed hub.json. After hub leave, UplinkSupervisor logs "restarting it on
    the credential as it is now" even though there is no credential to restart on. Its behaviour is right: it stops the
    child and starts none. The wording belongs to the daemon and was outside M3's scope.

Sminos-Session: smns-erb-71#b4948247 (doperpowers on macbook)

…ning keys M3)

`sminos hub enroll` decodes either kind of code as the hub's decodeCode
does (`smns-enroll-v1.` and `smns-provision-v1.`, tagged by kind, refusals
in the hub's whole words) and enrolls through a provisioning key under
--name or the host's name, refusing a name not under the key's prefix
before anything is sent (exit 2). The key's refusals are said with what
to do; name-taken exits 3 so a boot can pick another suffix.

`hub check` asks the hub whether it still accepts the stored credential
(GET /machine/enrollment) and writes nothing: 0 accepted, 1 not enrolled,
3 rejected, 4 undecided. `hub leave` revokes the enrollment (DELETE) and
removes hub.json on acceptance or rejection, keeping it otherwise. Both
read the answer by one rule: the Worker's 403 not-enrolled is a rejection
at once; Access's 401 page only past a 600 s propagation grace after
`enrolled` and when it holds on one recheck 90 s later
(SMINOS_ACCESS_RECHECK_S). `hub show` exits 1 when no credential is held.

The stand-in answers a token it does not hold as Access does (401, its
page), and gains provisioning keys, its machine's own record and
revocation, an orphan revocation (403 not-enrolled), a token not yet at
Access's edge, canned answers, an outage on the same port, and a request
log. The DX7 vectors are regenerated over MAWS 0602580be with the
provisioning cases.

Sminos-Session: smns-erb-71#b4948247 (doperpowers on macbook)
A leave reads the credential, then waits for the hub's answer — up to the
90 s recheck past the grace. An `enroll --replace` meanwhile installs a
live credential under the name the revocation freed, and leave then
removed it, revoking nothing: the hub kept the replacement, the machine
lost its only secret. Enroll's write and leave's check-and-remove now run
under one lock (daemon/hub.lock, flock), and leave removes hub.json only
while it still holds the credential leave asked about; a replacement is
kept and said, exit 1. Pinned by a stand-in hold on the DELETE's answer.

The provisioning vectors' padding case now pads a body that decodes
without its padding (it was a padless invalid JSON); regenerated over
MAWS 0602580be.

Sminos-Session: smns-erb-71#b4948247 (doperpowers on macbook)
Sminos-Session: smns-erb-71#b4948247 (doperpowers on macbook)

# Conflicts:
#	.claude-plugin/marketplace.json
#	sminos/.claude-plugin/plugin.json
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 21, 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-21T05:36:43.178697Z d358c76 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.

A bounded read stops at its bound, or returns what came before an early
close, without raising, and a chunked or close-delimited answer has no
length to compare with: a chunked 403 not-enrolled padded to 64 KiB whose
last chunk never came read as whole, so check said rejected (3) and leave
removed a live credential; two such Access 401 pages past the grace did the
same. The body now counts only once the response's end is reached (its
declared length, a chunked body's last chunk, or the close of one with
neither) within the 64 KiB bound; anything less is undecided — check exits
4, leave exits 1 and keeps hub.json. Pinned by the stand-in's raw answers.

Sminos-Session: smns-erb-71#b4948247 (doperpowers on macbook)
…this branch 1.4.1)

Sminos-Session: smns-erb-71#b4948247 (doperpowers on macbook)
@SSFSKIM SSFSKIM changed the title sminos 1.3.2: provisioning codes, hub check, hub leave (desk provisioning keys) sminos 1.4.1: provisioning codes, hub check, hub leave (desk provisioning keys) Oct 21, 2026
…minos stays 1.4.1)

Sminos-Session: smns-erb-71#b4948247 (doperpowers on macbook)
@SSFSKIM
SSFSKIM merged commit acdb914 into main Oct 21, 2026
8 of 10 checks passed
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