Skip to content

fix(dag): SessionMoved wake wedge — mixed directory stamps leave workflows with no directory owner #269

Description

@LeXwDeX

Tracked from the v1.0.13 release notes (PR #268) and the DAG-LOC-01 arbitration (probe C4 in packages/opencode/test/dag/dag-location-guards.test.ts).

Symptom

After a session moves (SessionMoved / session.next.moved), a session's workflows can end up with mixed directory stamps across their rows: the workflow row keeps the stamp of the directory that created it while the session now durably lives elsewhere. The fail-closed ownership policy (a stamp must match exactly one instance directory) then leaves the workflow with NO owner: wakes for it are deliberately wedged rather than risked being mis-delivered.

Current behavior is pinned by probe C4 (SessionMoved wedge pin) — the probe asserts the wedge itself, i.e. NO directory acts on the mixed-stamp workflow.

Why it was pinned, not fixed (v1.0.13 decision)

A real fix needs an atomic-DB-adoption redesign: the directory stamp must move WITH the session in one transaction (or adoption must consult a session-sourced location that is updated atomically with the move), so there is never a window where stamps disagree. SpawnReady eviction is the current mitigation.

Acceptance (for whoever picks this up)

  • Mixed-stamp scenarios after SessionMoved resolve to exactly one live owner (the session's new durable directory) within bounded time, without cross-directory double-adoption.
  • Probe C4 flips from pinning the wedge to pinning the resolution.
  • Mutation-falsifiable evidence for the new ownership transition (red-first), in the style of the H1 latch probe (ab4cddb).
  • All existing DAG-LOC-01 guards stay green (21 probes in dag-location-guards.test.ts).

Activity

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions