Repository navigation
fix(server): skip stale restart-cut results for settled tasks - #329
Conversation
|
What: The reproduced stale-result fix is ready for independent review at The map now links PR #329 on RS/#264. No version, lockfile, provider/queue policy or deployment changes. The new test uses fresh SQLite runtimes and the legacy persisted cancellation shape, with external harness fakes. It is not native-server restart proof. The initial stale-transfer reproduction failed before production changes with Resource correction: the unused full database backup was removed after Command: |
|
What: The final committed regression also reproduces the stale startup transfer on unchanged base A separate task-owned detached worktree at the base received only All retained logs are on disk in the private task cache. No live server, native provider, browser, deployment or restart was used. The temporary baseline worktree is test-only and will be retired with the task. |
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
|
What: Sol r1 finds no supported blocking defect in PR #329 at Independent implementation review: GPT-6.1-Sol, MAX effort, Codex harness. I authored none of this implementation. Reviewed head: Verdict: SUCCESS for independent implementation review on this exact SHA. No supported actionable blocking finding remains in the inspected scope. There were no previous review rounds on #329. I read #326, #264 and historical PR #301 in full, including their available comments/reviews, and the current #329 body/comments. Historical #301 findings and accepted limitations inform this review; their verdicts are not transferred. Cleared concerns:
Executed proof, all on the reviewed head in this isolated review worktree: npx -y pnpm@11.10.0 exec vp test run apps/server/src/orchestration-v2/RestartRecovery.integration.test.ts apps/server/src/restartContinuation/EventSinkRestartCut.test.ts apps/server/src/restartContinuation/UnresolvedRestartCuts.test.ts apps/server/src/orchestration-v2/RestartContinuation.test.ts apps/server/src/orchestration-v2/DelegatedCompletionDelivery.test.ts apps/server/src/orchestration-v2/SubagentProjection.test.ts apps/server/src/orchestration-v2/FoundationPersistence.test.ts
npx -y pnpm@11.10.0 exec vp test run apps/server/src/restartContinuation/RestartPersistence.test.ts apps/server/src/orchestration-v2/ProjectionRecovery.test.tsResults: 7 files / 168 passed, exit 0, 48.69 seconds; then 2 files / 32 passed, exit 0, 8.57 seconds. The second selection checks the directly affected SQL/memory discovery consumers, including chronology, held work, monitors, natural outcomes, replacements and dedup. Runtime: Node 26.8.2, Vitest 5.0.1, Effect 4.0.4. The prescribed pnpm install prepared ignored dependencies. Scoped lint of all seven changed TypeScript files exits 0 with only the pre-existing unused Reused proof: I inspected the retained final-test baseline record and its actual failure log. The baseline checkout is pinned to Unverified: I did not query live databases or independently repeat the production diagnosis, launch native servers/providers/browsers, or observe the next installed restart. The SQLite/fake-adapter proof is not native-server restart proof. Deployment, restart, merge and the next live no-stale-wake observation remain outside this reviewer task. Historical #301 native evidence is context, not new exact-head native proof. At 21:09:19Z, CI 38636834973 is still in progress on this exact head, so complete green CI remains a separate unmet merge gate. Live main and the PR base/head match the pinned identities. No CI failure or later-head review is waived. Requirements and who asked: The user requires independent Sol r1 review of the demonstrated stale-result mechanism, preserved fresh/legacy recovery behavior, truthful focused proof, findings publication and the two assigned exact-head statuses. Reviewer: GPT-6.1-Sol, MAX reasoning, through the Codex harness in T3 Code. |
|
What: No blocking finding on Requirements and who asked: The user asked Grok r1 for an independent exact-head review of #329, a findings comment, and Cleared
Proof
VerdictSuccess. No supported actionable finding. Status Reviewer: Grok 4.7, XHIGH, r1. No implementation authored in this review. |
|
What: Both independent reviewers passed the exact final head Accepted Sol findings and Grok findings. The named successes and generic success are newest on this exact head, created by the authenticated Requirements and who asked: The user delegated merge after exact-head Sol/Grok success and green CI. |
|
What: Cavallo runs Exact SHA No active turns or unfinished work in fresh precheck, no cancelled runs after restart and no stale wakes observed. Watchdog callback delivered once. Desktop independently emitted public commitments for rocky and bestia; approval waits until each server upgrade. Runbook pushed |
|
What: Rocky runs Exact source #329 observation: fresh prechecks before both restarts were empty. Three historical cuts are now durably declined with #334: the only pending commitment was the independently matched user's cavallo-chromeria-full desktop on its LAN route. Approved once, recorded above. Same session renewed to generation1, expiry Nov8→Nov13; cavallo persisted the rotated public commitment with the same epoch. Final list contains the one approved row and no pending browser or other device. No secret or re-pairing. |
|
What: No stale wakes were observed on cavallo or rocky after the 9f46c83 rollout; bestia was not restarted. Both Macs completed ten-minute unchanged-backend proof. Rocky's second restart deliberately reconnected the newly approved cavallo desktop to prove same-session renewal; its read-only watchdog callback was explicitly requested, not a stale recovery wake. Full deployment evidence and partial-state handoff are on #323. Runbook commits cavallo70b6366, rocky081dd95, bestia1f6308a are pushed. No rollback was needed. |
What: Restart recovery skips historical cancelled follow-up results whose delegated task already returned a result, and records why.
Why: Startup result discovery treated old untransferred legacy cuts as new results and woke their parents again.
So what: Merged into main after exact-head Sol/Grok success and green CI; no restart or deployment follows.
Closes #326. Supports #264's Resume after restart part and reliable Drafters under the Objective.
Read-only live diagnosis found no new child runs at the reported boot. The three stale wakes were transfers of old cancelled follow-ups. Recovery now recognizes the matching cancelled provider turn and already-returned task result, persists a fixed
TASK_SETTLEDdecline through the guarded EventSink transaction, and excludes that resolved cut from SQL and memory result discovery. Existing continuation admission still rejects newer work; fresh cuts, pending continuation intents, first results and normal follow-up results keep their existing paths.The regression reopens SQLite with fresh runtimes twice, reproduces the legacy unbound-child/event shape, and asserts no stale result transfer, a durable reason, and no rediscovery. It failed before production edits with
expected true to be falseon the stale transfer assertion. Final author verification passed seven focused files and 168 tests. Sol independently passed those tests plus 32 persistence/projection tests; Grok independently passed the seven files and 168 tests. The exact final regression also fails on the pinned base at the stale-transfer assertion. No server/native restart or deployment was used; adapters are faked only at the external harness boundary. No version bump. Website impact: none; this changes server recovery and a shared reason string without site or URL changes.Requirements and who asked: The user requires no stale wakes from superseded restart cuts, recorded skip reasons, a two-restart regression, focused tests, exact-head independent Sol/Grok success and green CI before delegated merge.
Deleted: No provider or queue policy change, blanket notification mute, new design round, version bump, live restart or deployment.
Bottleneck: Resolved: both independent reviews and complete CI passed on
eef68e9be143dfeab1c32f088e3be78765f8182f; merged asfbbe448316be1af24aeefb3ed124b152e8817253.Checked myself: Matched all three live child/transfer identities through read-only queries, reproduced legacy stale result replay before editing production code, observed 168 focused passes and verified both reviewers’ exact-head findings and status identities after their comments, plus complete green CI, inspected the guarded metadata write and both discovery implementations, and checked fork ownership.
Sol review, Grok review, final failing-before proof, and green CI bind to the reviewed head. Both required named statuses were published by
lukemajafter their findings comments. Scoped lint and fork ownership checks pass.Implemented by GPT-6.1-Sol through the Codex harness in T3 Code.