Repository navigation
test(e2e): run advisory questions end to end on a controllable clock - #205
Merged
gregpriday merged 4 commits intoNov 19, 2026
Merged
gregpriday merged 4 commits into
gregpriday merged 4 commits into
Conversation
- Run the relay as an e2e-only entry with a shifted clock, translated alarms and a route that moves it - Move the relay, the bridge and the phone together in steps inside the skew allowance - Cover a timely answer, an ignored advisory, a decline and an expired gated approval - Prove the relay's own alarm closes questions with nobody reading them - Share the MCP agent, pane sink and pairing helpers with the MCP loop suite
…what was signed - Serialize the room's alarm passes, re-arm a stale alarm on restore, and refuse a move that leaves jobs due - Date clocked HTTP responses on the moved clock, so a client never learns a wall-clock skew - Refuse moves after one fails partway, and attach phones between moves - Bind the approval's gate to its pane, check the signed record, and sample fallback_due on every view - Keep the phone off the relay in the alarm test and require the first expiry before the second deadline - Check the notice substitutions exactly once, poll get_decision within MCP's rate limit
…he alarm test's margin - Hold the approval's pane busy so get_decision is read while the expiry waits to be typed - Ask the alarm test's questions for the shortest windows, five seconds apart, and order them by injection time - Re-arm the alarm whenever a room restores a moved clock, and date the control route's responses too
gregpriday
deleted the
feature/issue-192-run-an-advisory-question-end-to-end-with
branch
November 19, 2026 13:59
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 a controllable clock across the relay, the bridge and the phone, and an end-to-end suite that takes advisory questions through the standalone path (agent → MCP → relay → phone → the asking pane) past their deadlines without waiting for them.
Resolves #192
The clock
worker/tests/e2e-clock-worker.tsis an e2e-only entry thatwrangler devruns in place of the config'smain(the shipped bundle is built frommainand never includes it). It wraps the production Worker andDecisionRoombehind a shiftedDate.now, translates the room's native alarms between the moved and the real clock, and answersPOST /__e2e/clock(an absolute offset) by running the room's alarm, as the runtime would once the time arrived. Alarm passes run one at a time. A restored offset re-arms a stale alarm, and HTTP responses carry the moved time inDate, the header a client learns its skew from.TestClock.nowis passed asnowtoRelayClient,DecisionsBridgeandstartDecisionsMcpServer.TestClock.advance(ms)moves all three in steps of at most 60 s (half the relay's request skew allowance). Each step moves the test process first, then the relay, then the phone, so the bridge is never behind the relay when an expiry reaches it (an expiry received well before its deadline is refused for good). A move that fails partway refuses every later one. Settling the bridge stays with the test, so the follow-up (Cover advisory faults and restarts in the end-to-end suite #193) can move time while a participant is offline.The outcomes (
e2e/tests/advisory-loop.test.ts)Reply by, the time left (counting down as the clock moves) and the agent's plan. After it, the phone shows the relay-confirmed closed state. The pane receives theadvisory-unanswerednotice, byte for byteADVISORY_TIMEOUT_NOTICE_FIXTURE.duewith this run's ID, alias, injection ID, question and deadline substituted.get_decisionmatchesADVISORY_TIMEOUT_DECISION_FIXTURE(fallback_due: true, the statedplanned_fallback).cancelledwithclosed_reason: declinedand a singlestatus: declinednotice. Its deadline passing later makes nothing due.human-requiredand blocking, and the phone shows "Human decision required". When it expires the pane receivesstatus: expiredwithauthorised: no. Everyget_decisionview on the way reportsfallback_due: false, including one read while the pane is busy and the expiry is still waiting to be typed.The pane sink, the SDK connection, pairing and the inbox helpers move from
mcp-loop.test.tstoe2e/tests/mcp-agent.tsso both suites share them.startRelaytakes an optionalscript, anduntilan optional poll interval.Testing
e2e/tests/advisory-loop.test.ts, 5/5 on every run (repeated runs, about 10 s each).e2e/tests/mcp-loop.test.tsande2e/tests/sync-replay.test.ts, 11/11.developafter rebuilding the app: own and adjacent 14/14.typecheck:changed, so the CIpnpm typecheckcovers the new files (the entry is underworker/tests, which the worker tsconfig includes).