Skip to content

mawsd endpoint attest-history: an hour's deadline, one run at a time (P5 O14) - #343

Merged
SSFSKIM merged 1 commit into
masterfrom
p5-o14-attest-deadline
Oct 29, 2026
Merged

SSFSKIM merged 1 commit into
masterfrom
p5-o14-attest-deadline

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Oct 29, 2026

Copy link
Copy Markdown
Owner

Why

B2 step 9 (2026-10-29, the Mac mini, about 390 DX1 writers) never got a verdict. mawsd endpoint attest-history reached the daemon as daemon.endpoint under 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

  • The deadline. mawsd endpoint attest-history (attesting and --check alike) sends daemon.endpoint with 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.
  • One run at a time. The endpoint module keeps the run in progress per endpoint. A second attest-history run, --check or 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, --project or --json may differ. A check beside an attest would also judge records the attest is still posting.
  • The log. Each run logs started under <names>, then ended, exit N: <summary> or failed: <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

  • src/mawsd/cli.test.ts, through the real machine.sock: attest-history waits past 10 s and gets its answer, while status beside it still gives up at 10 s.
  • test/endpoint/cli.test.ts, against a stand-in hub that holds its first read: a second check, an attest, and a narrowed check are all refused without reading the hub. A run goes ahead after the first ends, including after one that failed. The log lines are asserted.
  • Fail-first: with the fix stashed, both new tests fail for the intended reason.

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)

…(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)
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 29, 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-29T09:19:38.861091Z eb72b2c 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.

@SSFSKIM

SSFSKIM commented Oct 29, 2026

Copy link
Copy Markdown
Owner Author

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)

@SSFSKIM
SSFSKIM merged commit 5d31f62 into master Oct 29, 2026
SSFSKIM added a commit that referenced this pull request Oct 29, 2026
… 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)
SSFSKIM added a commit that referenced this pull request Oct 29, 2026
…, bd6b4b0) into p5-o3-c for landing

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