Repository navigation
mawsd endpoint attest-history: an hour's deadline, one run at a time (P5 O14) - #343
Conversation
…(O14)
On the mini (~390 inventory writers) `mawsd endpoint attest-history [--check]`
gave up after the request's default 10 s ("did not answer daemon.endpoint
within 10 s") while the daemon went on reading every writer's history from
the hub; its outcome lines were lost, and retries every 15 s piled up dozens
of concurrent full-history reads against the production hub.
The deadline. `mawsd endpoint attest-history` now sends `daemon.endpoint`
with a fixed 60 min deadline (ATTEST_HISTORY_TIMEOUT_MS); every other
endpoint command keeps REQUEST_TIMEOUT_MS (10 s). A fixed bound rather than
a `--wait` flag: the CLI's `--wait` on enroll and provision is the module's
own wait, passed through and honoured there, while attest-history waits for
nothing but its own reads, so a `--wait` would be a CLI-only knob the
module's strict parser refuses. The run's length grows with writers and
pages, each hub read bounded at the hub client's 30 s: minutes at ~390
writers, and an hour leaves an order of magnitude over that while still
ending the wait on a daemon that never answers. Nothing on the daemon side
bounds the call: machine.sock's server has only its hello deadline, the host
runtime awaits the handler unbounded, and daemonCommand, LazyEndpoint.cli
and the module's runCli add none; the answer (one line per writer) is far
under the socket's 64 MiB line cap.
One run at a time. The endpoint module records the run in progress per
endpoint; while one runs, attesting or checking, a second is refused (exit
1) with "<run> has been in progress since <time>: no second run starts
beside it; its outcome is in mawsd's log". One flight for both modes, not
two: each is a full read of the hub, and a check beside an attest would
judge records the attest is still posting. A refusal rather than joining:
a second caller's names, project or --json may differ, so its answer is
not the first's. The run is recorded before its first await, so two
requests can't both pass the check. Each run logs its start and its outcome
(the summary line, or the failure) to mawsd's log, where a caller that
stopped waiting finds it, and holds a private mawsd up until it ends (its
idle exit counts clients, and a caller that left is none).
Tests, each failing before the change: src/mawsd/cli.test.ts holds
attest-history and status in the module past 10 s at once, through the real
machine.sock: status gives up at 10 s, attest-history gets its answer;
test/endpoint/cli.test.ts refuses a second run (check, attest, a narrowed
check) while the first reads a stand-in inventory, reads nothing for the
refused ones, and runs the next after the first ended, a failed run
included, with the log lines.
Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
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. |
|
Gate on head eb72b2c: run 40847959810, GREEN on attempt 1. Class 1a ran on the pool (static, unit 4/4, probes, plan), and e2e:desk-web-hub ran on a hosted macos-26 runner (39 passed). Flaky count: 0, with no reruns and no preemption. The run's tree, 4281106e3b73, equals the head's tree. Master hasn't moved since the merge base c6c5235. reviewer-medium found nothing material. Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook) |
… up to an hour and runs one at a time; B2 step 9's burst against production recorded Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
…, bd6b4b0) into p5-o3-c for landing Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
Why
B2 step 9 (2026-10-29, the Mac mini, about 390 DX1 writers) never got a verdict.
mawsd endpoint attest-historyreached the daemon asdaemon.endpointunder the client's default 10 s deadline (REQUEST_TIMEOUT_MS). The command reads every inventory writer's events from the hub page by page, which outlasts that deadline. The CLI printed "did not answer daemon.endpoint within 10 s" while mawsd ran the command to its end, and its outcome lines were lost.Retrying on the timeout made things worse. Two attest runs and about 24 checks between 08:45 and 08:56Z each started another full read of the production hub's history beside the ones still running.
What changes
mawsd endpoint attest-history(attesting and--checkalike) sendsdaemon.endpointwith a 60 min deadline (ATTEST_HISTORY_TIMEOUT_MS). Every other endpoint command keeps 10 s, and the shared default is unchanged. A fixed deadline, rather than--wait, because the module waits for nothing but its own hub reads, each already bounded at 30 s by the hub client.attest-historyrun,--checkor not, is refused while one runs: "… has been in progress since : no second run starts beside it; its outcome is in mawsd's log …". It is refused rather than joined, because a second caller's names,--projector--jsonmay differ. A check beside an attest would also judge records the attest is still posting.started under <names>, thenended, exit N: <summary>orfailed: <message>, so a caller who stopped waiting still finds the outcome. The run holds mawsd (services.hold) until it ends, so a private mawsd's idle exit doesn't cut it short.Tests
statusbeside it still gives up at 10 s.Gates
Class 1a (pool) + hosted e2e:desk-web-hub (architect 682): running; the run id, tree check and flaky count follow in a comment. reviewer-medium: no material findings.
Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)