Repository navigation
feat(conformance): verify normal server resume and replay - #46
Merged
austinchennn merged 2 commits intoOct 17, 2026
Merged
austinchennn merged 2 commits into
austinchennn merged 2 commits into
Conversation
2 of 6 tasks
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.
Description
Adds opt-in
server-resume-replay-v1black-box coverage for normal server recovery: unacknowledged suffix replay, resumeFrom 0, an empty replay suffix and replacement of a still-active connection. Real WebSockets and independent JSONL drivers verify both server output history and deduplication of already handled client context.Issue association
Refs #17. This is a server recovery substep, not automatic client recovery, full bidirectional recovery or completion of the issue.
Merged latest upstream main
771d79f, including #42/#43 and now-merged #44 server input/#45 client control validation. All merged profiles, driver dispatch, CLI constraints and packaging checks are preserved. This independent PR still targets main; #47 and fork Draft #1 remain separate increments.Behaviours Completed
server/resume/suffix,/from-zero,/caught-up,/replace. Explicit server+driver-only profile; existing defaults/profiles and heartbeat-specific flags retain their behavior.Files Changed
conformance/scenarios/server-resume.json,src/node/server-resume.ts: four cases, two independent cursors, context/close/model barriers and multi-peer failure evidence/cleanup.conformance/src/resume-oracle.ts: SDK-independent effects, session/format/cursor checks and complete replay expectations.conformance/src/node/drivers/server-resume.ts,drivers/typescript-server.ts: public Hub.attach/Connection.receive/closed, onContext, fakeModel events/sessions and bounded snapshots; no handcrafted expected wire frames in the official driver.conformance/src/node/fixtures/resume-server.ts,test/server-resume.test.mjs: independent actual wire faults, same-seq positive control and bounded lifecycle verification.conformance/src/node/{runner,cli}.ts,src/report.ts,build.mjs,test/consumer.mjs: profile/inventory selection, package assets/fixture, actual installed success and missing-required-case checks. Merged heartbeat dispatch/configuration is preserved.README.md,conformance/{README.md,driver-protocol.md}: usage, minimal language-neutral JSONL contract, ownership and scope limits.Brief Explanation
Runner controls scenarios/deadlines, transport records real traffic, driver observes only public SDK/model/edge APIs, and the oracle independently judges sequence/history and application effects. A public WebSocket edge is used around Hub because serve() does not expose per-connection close delivery; no private parked/session/socket/inbox/outbox state is inspected. Driver shutdown terminates physical peers, awaits their SDK close callbacks, then closes the Hub so parked expiry/heartbeat timers are cleared.
Prefix model events plus an ordered pong establish the capture window. After reconnect, actual context handling and a new public model marker fence replay, followed by live pong, second wire close, SDK close confirmation and final drain. Pongs alone are not treated as proof of arbitrary async completion. The fixture is inert: no scripts/tools/background producers, only synchronous public model injection and context observations. Deadline is bounded local test policy, not a normative latency requirement.
No production SDK, normative spec/schema/vector, dependency or lockfile changes. The new recovery profile does not use heartbeat clock controls or exercise ACK-deleted history, even though those independent contributions are now on its base.
Testing
Local environment: macOS 26.6.2 arm64, Node 22.23.3. Commands used Node 22 first on PATH.
npm run test:conformance: 121 passed (102 latest-main tests + 19 recovery tests). All four official server cases pass; build and conformance typecheck are part of this command.npm run test:conformance:consumer: final actual tarball installed outside the repository, without SDK peer installation; all merged profiles plus recovery pass. Removingserver/resume/suffixyields incomplete at inventory/exit 1. Schemas/scenarios resolve from installed assets. Re-run after final CLI parameter-isolation adjustment: passed.npm test: 465 passed, 26 SDK files, including fix(protocol): reject incomplete replay after ACK deletion #43's new regressions.npm run test:e2e: 7 passed.npm run typecheck,npm run check:spec: passed (23 schemas, 1 registered capability, 156 control vectors, 9 audio vectors).npm run check:budgets: passed, including zero-dependency/import rules; production sizes unchanged relative to rebased main (protocol 2.16 KB min+gzip / 5 KB; core 5.11/15; client 5.26/20).git diff --check: passed. No separate lint/format script is configured. Python, standalone Workers and production SDK pack/consumer/release dry-run were not rerun locally because this diff is conformance/docs; standalone conformance packaging was exercised above. Hosted CI is separate evidence. No package published.Unsure About
Implementation Order and Acceptance — #17
The current issue checklist was re-read before delivery. Upstream access is read-only, so its author's issue body was not modified. Checked subitems below mean locally implemented and verified, PR pending merge, not upstream delivery. Maintainer-copyable progress retaining the mixed parent unchecked:
Latest status: #42/#43/#44/#45 are merged and included in the tested base; this PR and #47 remain pending. Fork Draft #1 remains stacked on this branch. No supervisor/contributor issue text or checkmark was rewritten and no mixed parent was marked complete.
Integration refresh: merged main without rewriting review history; nine conflicting common files were resolved additively. Full build/conformance/SDK/e2e/type/spec/budget/tarball checks were rerun in
/private/tmp/vrt-open-46-_7uzs_xjagainst byte-identical tracked sources, using same-version temporary esbuild binaries (0.25.10 build/budget; 0.28.2 Vite) and workspace links to the matching mirrored packages, to avoid the previously observed Desktop native file-open stall. No environment workaround or dependency change is committed. Direct Desktop native-build completion is not claimed. This is integration maintenance, not new #17 feature acceptance; upstream issue text/checkmarks remain unchanged.