Repository navigation
[lifecycle-RSK] RSK-06: Route latch and phase writes through events #1796
Copy link
Copy link
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Tracking
- Epic: [lifecycle-RSK] Run-state kernel #1790
- Size: 1 SP
- Blocked by: [lifecycle-RSK] RSK-04: Add the run field, write helpers, and the projection #1794
- Design doc:
docs/architecture/task-lifecycle-target-architecture.md(not yet onmain) - Ticket plan:
docs/architecture/task-lifecycle-run-state-kernel-tickets.md(not yet onmain)
Context
The abort path carries the highest bug value. Every writer of a latch field must go through a helper before any latch read flips. This includes the external writers, so #1797 and #1798 do not break their compile.
Developer Notes
- Route each source in the design doc "Abort sources and reasons" table through its helper.
-
cancelTask:reasonSetatClineProvider.ts:3572,abortRequested(false)throughabortTask(), thenabandonRequestedat:3588. Keep this order for issue fix(task-lifecycle): preserve parent-child link when delegated subtask is interrupted #560. -
abortTask(isAbandoned)(Task.ts:2680-2687):abortRequested(isAbandoned). This coversremoveClineFromStack(ClineProvider.ts:631),createTaskWithHistoryItem(ClineProvider.ts:1389), and the checkpoint-restore delete (checkpointRestoreHandler.ts:34, abandoned false). -
disposeOnce(Task.ts:2770):disposeRequested. It must not changereason. - Chunk-loop catch (
Task.ts:3718):setAbortReason("user_cancelled"), thenabortRequested(false). RSK-19 (d0dec4b) changed this line. Do not passcancelReason, because that brings back race R-4. Retry backoff (Task.ts:3738):setAbortReason("user_cancelled"), thenabortRequested(false). -
resumeAfterDelegationresets (Task.ts:2881-2883): confirm the instance is always new, then delete the three latch resets. A reset has no event. [lifecycle-RSK] RSK-10: Route stream, ask, and turn-field writes through events #1804 owns the resets at:2884-2886. - Do not fix race R-4 here. [lifecycle-RSK] RSK-19: Keep the first abort reason #1802 owns it.
- Route the four
isInitializedwrites through theinitializedhelper (Task.ts:2266, 2391, 2412, 2892). Each instance takes one of these paths. [lifecycle-RSK] RSK-11: Flip isInitialized reads #1799 flips the reads after these writes have soaked on nightly. - Confirm the comparison shows zero untagged divergence and zero untagged rejections on these paths.
Exit criteria: every latch write, and every isInitialized write, goes through a helper in Task, ClineProvider, and checkpointRestoreHandler. The fields stay authoritative. Tests pass.
Reversibility: reads are unchanged, so behavior is unchanged.
PR: #2128. The last item stays open until the nightly soak shows the comparison data.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
Activity
[-][lifecycle-RSK] RSK-06: Route latch writes through events[/-][+][lifecycle-RSK] RSK-06: Route latch and phase writes through events[/+]