Repository navigation
sminos 1.4.1: provisioning codes, hub check, hub leave (desk provisioning keys) - #313
Merged
Merged
Conversation
…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
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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)
…minos stays 1.4.1) Sminos-Session: smns-erb-71#b4948247 (doperpowers on macbook)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 branchdesk-provisioning-keys(SSFSKIM/MAWS#97). sminos 1.4.1 (above main's 1.4.0).
What changes
sminos hub enrolldecodes both code kinds:smns-enroll-v1.(one-time, as before) andsmns-provision-v1.(a reusable provisioning key with a name prefix). The code is read from stdin or the hidden prompt only.
--nameor the host name. A name outside the key's prefix is refusedlocally, exit 2, before anything is sent.
key-revoked,key-expired,key-exhausted,prefix-mismatch) are worded for theoperator.
name-takenexits 3, so the boot can pick another suffix.sminos hub check(new) runsGET /machine/enrollmentwith the stored credential and writes nothing. Its exitcodes:
403 not-enrolled, or Access answered its 401 page past a 600 s propagation gracefrom
enrolledand again on a recheck 90 s later.backoff.
sminos hub leave(new) runsDELETE /machine/enrollment.200, or on a rejection by the same rule, it removeshub.json, exit 0. The daemon's supervisor stops theuplink on its own.
leaveremoves only the credential it checked. A replacement installedmeanwhile is kept, exit 1.
sminos hub showexits 0 when a credential file is held and 1 when none is. It stays local.Tests:
hub_standin.pylearns keys,/machine/enrollment, Access's 401 for a token it does not hold, a token not yet atAccess's edge, the Worker's
not-enrolledwindow, held answers and outages.test-hub.shcovers every exit and race above.0602580be, withenroll_parity.pycomparing whole tagged dictsand whole refusal messages.
Docs: the skill's
SKILL.mdandreferences/setup.mdcover enrolling at provisioning time,checkand theboot's rule, and
leave.Whole answers only (
c30601c8, the whole-branch xhigh panel's fix):checkandleavedecide 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:checkexits 4, andleaveexits 1 and keepshub.json.Commits:
f3ea1a0e: M3.7831e8ac: review fixes.leavekeeps a replacement credential, and the padding vector now holds padding.d358c760: merge of main (1.3.1 → 1.3.2).c30601c8: the panel fix. reviewer-medium found no material issues.0b0b324c: merge of main. Main is at 1.4.0 (The to-human message tool: mid-turn messages arrive word for word (to-human 0.5.0, sminos 1.4.0, 7.201.0) #312, tests(sde): Test 5 and Test 8 judge the answer, not its vocabulary #314); this branch bumps to 1.4.1.Validation Evidence
0b0b324c(final head): GREEN, 8/8, https://github.com/SSFSKIM/doperpowers/actions/runs/39554649339.d358c760: GREEN, 8/8, https://github.com/SSFSKIM/doperpowers/actions/runs/39547860824. The gatesare shell-lint, repo-checks, sminos-mods, mods-types, sminos, issue-tracker, board-api and sminos-suites.
c30601c8: the panel's truncated-chunked 403not-enrolled, and a truncated marked 401 past the grace, both failed first. Againstd358c760,checkexited 3 andleavedeletedhub.json. After the fix,checkexits 4,leaveexits 1, and the file is byte-identical.test-hub.shpasses 1994/1994, andrun-sminos-tests.sh2127/2127.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, 150ok, 0FAIL. The vectors hold 15 decodedenroll,15 decoded
provisionand 90 refused cases.leaveagainst a concurrentenroll --replace) failed againstf3ea1a0ebefore the fix:leaveexited 0 and deleted the replacement. It passes after.3165c5f78, this branchd358c760): items1–8, 10 and 11 pass as written.
leave, and admin-revoked and lost-200 credentialslearned through Access inside and past the grace all behave as specified.
enrollment code: not smns-enroll-v1, exit 2, andsends no request.
check4 with the hub down, then 3, thenenroll --replaceexits 0and the next
checkexits 0.docs/doperpowers/specs/2026-10-21-desk-provisioning-keys-report.md.re-reviewed clean.
Unresolved Review Findings
sminos/tests/dx7-enroll-codes.gen.mjs: the one-time code's padding vector ends its JSON inx, so it refuseson 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.
d358c760's message kept git's# Conflicts:comment lines. It is cosmetic, and history is notrewritten.
Residue
hub.json. Afterhub leave,UplinkSupervisorlogs "restarting it onthe 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)