Skip to content

P5 O14 M1, the src/mawsd half: mawsd endpoint provision reads its code from a prompt or stdin and waits as the module does - #300

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

SSFSKIM merged 3 commits into
masterfrom
p5-o14-m1-mawsd

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Oct 28, 2026

Copy link
Copy Markdown
Owner

P5 O14 M1, the src/mawsd half (docs/doperpowers/plans/2026-10-27-p5-o14-cutover.md, M1, the parts marked [needs O2]). M1's endpoint and org-protocol half landed as #254 (fc117d1, P5 Decision Log 83). This is the half that carries the secret, written now that O2's mawsd is on master (7a5893b, P5 Decision Log 107).

  • What changed. O2's CLI read a secret, and stretched the request deadline, for enroll only. That path is now a table of secret-reading commands, enroll and provision. Each one names:
    • its code: Enrollment code: or Provisioning code: at the prompt, and the same name in its refusals;
    • the flags it passes to the module;
    • how long the module waits when no --wait is given. enroll does not wait, so its request keeps the 10 s default. provision waits 300 s, the endpoint module's own default.
  • The new path. mawsd endpoint provision [--name <name>] [--wait [<seconds>]] [--json] reaches Endpoint.cli('provision', args, secret). The code comes from the hidden prompt or from stdin, never from argv, and an argument the command does not know (enroll's --replace included) is refused without being echoed. Before this change, endpoint provision passed through with no secret, and its request gave up after 10 s.
  • Unchanged: enroll and the top-level mawsd enroll; every other endpoint command; src/endpoint/; src/mawsd/endpoint-seam.ts.
  • The daemon's resident set: no reading owed. This is CLI code that runs in the command's own process. The daemon loads the same mawsd.js bundle but runs none of it, so the change adds nothing to the daemon's idle resident set, and no daemon-idle reading on the mini is owed against acceptance 14's bound.

Validation Evidence

  • Tests fail first, then pass. Locally, after a fresh electron-vite build:
    • vitest run src/mawsd/cli.test.ts: 33 passed. The 3 new tests fail on the old cli.ts.
    • vitest run src/mawsd/cli-prompt.test.ts, under a real pty: 4 passed. The 2 new tests fail on the old cli.ts. They cover the hidden prompt and a pipe, with the module's answer held past the 10 s default deadline both under --wait 30 and with no --wait.
    • In CI's unit job (run 40717846770), src/mawsd/cli-prompt.test.ts ran its 4 tests (24 s) and src/mawsd/cli.test.ts its 33.
  • Review. reviewer-high (M1's rung), round 1: correct, no findings.
  • Gate at cb1bd94. scripts/ci-gate.sh <wt> --gates static,unit,probes --class1a pool, run 40717846770: GREEN.
    • ci-gate's coverage notes named nothing under src/mawsd. They were its standing notes: the daemon-idle groups and three others skipped as "unreadable package script", and dashboard skipped for a "nonliteral selection".
    • src/endpoint is untouched, so the hosted e2e:desk-web-hub run is not required (Decision Log 94).
  • Gate at the head a0e9a0f, after master was merged in (master's moves since were docs only): class 1a GREEN, run 40719043635 (labelled p5-o14-m1-mawsd-head).

Residue

  • none

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

…t or stdin, and waits as long as the module may (P5 O14 M1, the src/mawsd half)

O2's CLI read a secret and stretched the request deadline for `enroll` only.
That path is now a table of secret-reading commands, `enroll` and `provision`.
Each command has its own flags and its own wait when no `--wait` is given:
enroll does not wait, and provision waits 300 s, which is the module's default.
`mawsd endpoint provision` reaches `Endpoint.cli('provision', args, secret)`
with the code read from the hidden prompt ("Provisioning code: ") or from
stdin, never from argv. An argument it does not know (enroll's --replace
included) is refused unechoed. Before this change, `endpoint provision` passed
through with no secret, and its request gave up after 10 s.

Tests:
- cli.test.ts: provision's code from a pipe and from the prompt, its flags,
  and the refusals.
- cli-prompt.test.ts, under a real pty: the hidden prompt and the pipe, the
  module's answer held past the 10 s default deadline under `--wait 30` and
  under no `--wait`.

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 53737d3 into master Oct 28, 2026
SSFSKIM added a commit that referenced this pull request Oct 28, 2026
…e; O8 M2's landing (#295), the remote rows, residue 11 to 17

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
SSFSKIM added a commit that referenced this pull request Oct 28, 2026
…e by the caller's path; the no-module branches go

Through #300's secret-command table: revoke and grant are its source commands, '-' read from stdin to its end and sent as daemon.endpoint's secret, a relative file made absolute against the caller's cwd (the daemon's is its own). cli.ts's 'none (arrives with P5 O10)' and keys's no-module fallback, dead since M10 binds the module, are removed with the tests that pinned them: a daemon with no module answers keys like any command. The process scene drives revoke from a relative path, revoke - and grant - through the built daemon.

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