Repository navigation
test(e2e): cover advisory faults and restarts end to end - #210
Merged
gregpriday merged 3 commits intoNov 19, 2026
Merged
Conversation
…receiver - Run the real `decisions mcp` receiver in process against the clocked Worker and the PWA - Settle a question the offline computer never published as never-published, its plan due - Lose a create's receipt, retry it after the deadline, and get the relay's original receipt back - Refuse an answer the offline phone queued before the deadline and sent after it - Restart the receiver between the expiry and its notice, replay the expiry over the socket, type it once - Recover each outcome by ID with get_decision and `decisions wait --pane mcp`
- Check the relay's history holds one creation, at the replayed receipt's event, and one expiry - Prove the restarted receiver delivers from its own store, keeps the MCP token, and a later restart types nothing more - Fail the replay on any bridge error, and bound its barrier to the same socket - Give each test its own teardown scope with bounded steps, and bound receiver readiness
…nish every teardown - Count the question's creation and expiry only once the returning socket's catch-up has ended - Reuse a receiver's stop in flight, so a teardown after a cut-short stop still waits for it - Wait for late teardown before the next test starts, and fail the hook when a step hangs
gregpriday
deleted the
feature/issue-193-cover-advisory-faults-and-restarts-in
branch
November 19, 2026 14:55
Merged
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.
Adds
e2e/tests/advisory-faults.test.ts, covering the fault cases #160 lists end to end. Each runs through the real Worker on the moved clock, the realdecisions mcpreceiver (the CLI'sdaemon()run in process, writing notices to afile:sink that cannot wake the agent), an MCP SDK client and the PWA in Chromium. Each case ends in the outcomedocs/operations.mddescribes, recovered by ID, and none of them is a human answer.Resolves #193
What the two tests cover
publish-failed/never-publishedwithfallback_due: true, and the never-published notice is written once. The relay answers 404 for it, the phone's inbox stays empty, anddecisions wait <id> --pane mcpexits 14. A text-only create is marked possibly published before its first send, so on a relay younger than seven days only the relay's refusal can settle it; that route is covered bypackages/client/tests/publish-deadline.test.ts.201receipt, replayed, and the relay's history still holds one creation, at that receipt's event, and one expiry. The question readsacceptedwith nothing concluded until the socket brings the expiry, then endsexpiredwith its advisory notice.410 expired, the phone shows "Your answer was not applied", and the relay records no action.advisory_timeout.notice: pending, nothing written). The receiver stops, and a new one on the same state directory writes the notice once, byte for byte the frozen fixture, from what the first had stored (the relay sends it nothing more about the question) and with the same MCP token.socket.syncFromthen has the Worker resend the expiry, which is observed on the wire and handled without error, and nothing more is written; a third receiver started after delivery writes nothing either.get_decision,decisions --json wait <id> --pane mcp(exit 13 or 14, oneresultrecord, no network calls) anddecisions --json get <id> --pane mcpagree field for field.Each test runs on its own relay and moves the clock once, past a 90-second deadline. The CLI's relay client signs on the real clock (
openRuntimepasses it nonow), so the moved clock has to stay inside the relay's two-minute request skew.advisory-loop.test.tskeeps the 15-minute window.Testing
e2e/tests/advisory-faults.test.ts, 2/2 on every run.e2e/tests/advisory-loop.test.ts, 5/5 alongside it.Not covered here
packages/client/tests/publish-safety.test.ts; this suite takes the receipt first, as a reconnecting receiver whose pump runs before its socket catches up does.liveon the same socket, so a gap-recovery sync already queued could resolve it first; an unrelated involvement warning during the replay would fail the no-error check; a pending notice rebuilt over HTTP at startup would pass the restart check (only socket frames are checked); an MCP connect or socket poll that times out keeps running until its own deadline.