Skip to content

[lifecycle-RSK] RSK-06: Route latch and phase writes through events #1796

Description

@edelauna

Tracking

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: reasonSet at ClineProvider.ts:3572, abortRequested(false) through abortTask(), then abandonRequested at :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 covers removeClineFromStack (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 change reason.
  • Chunk-loop catch (Task.ts:3718): reasonSet(cancelReason), then abortRequested(false). Retry backoff (Task.ts:3738): reasonSet("user_cancelled"), then abortRequested(false).
  • resumeAfterDelegation resets (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 isInitialized writes through the initialized helper (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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions