Skip to content

test(runbooks): fork-session context-fate probe#1013

Merged
michael-wojcik merged 3 commits into
Synaptic-Labs-AI:mainfrom
michael-wojcik:fix/restart-live-id-reconciliation
Jun 22, 2026
Merged

test(runbooks): fork-session context-fate probe#1013
michael-wojcik merged 3 commits into
Synaptic-Labs-AI:mainfrom
michael-wojcik:fix/restart-live-id-reconciliation

Conversation

@michael-wojcik

Copy link
Copy Markdown
Collaborator

Summary

Adds the disposable --fork-session context-fate probe runbook — the empirical instrument that settled the Resume/Restart/Persistence reliability cluster's central question and refuted the planned durable fix's premise.

What landed

  • tests/runbooks/994-fork-session-context-fate.md — a SAFE, self-runnable probe measuring whether --fork-session leaves a stale session_id field at the new-id context path. Verdict: CASE 1 (FRESH)session_init writes a fresh live-id context on fork; no stale field. Includes a journal-artifact (masking-proof) detector, a non-vacuity control, and a hard-guarded disposable cleanup (format-checked temp-slug, protected-token guard).
  • tests/runbooks/RUNBOOK_RUN_DATES.md — records the CASE 1 run.
  • Reverts an exploratory is_session_restarted predicate added earlier on this branch — it has no consumer (the probe refuted the case-3 premise the durable fix was built on), so it is dead code. Net diff vs main is runbook-only.

Why

The probe's CASE-1 verdict empirically refuted the "stale session_id field on restart" (case-3) mechanism the planned durable #994 reconciliation had inferred — so that durable fix has no scenario and stands down. Re-diagnosis under the corrected premise confirmed the cluster is already cured at HEAD:

Cluster shipped-value was PR #1010 (the cheap-win self-diagnosis, already merged); this PR preserves the reusable probe instrument.

No version bumptests/runbooks/ dev tooling only; the canonical 4 version files are untouched.

Context: #994 / #992 / #995 (no auto-close keyword — #994/#992 already closed; #995 stays open for sub-1).

Pure predicate: a session is restarted when the live stdin session_id
differs from the persisted-context session_id, with both present and valid.
Structural discriminator only -- never keys on leadSessionId == session_id
(true in both in-process and tmux modes). Lands as a sibling to
detect_stale_session_block rather than a shared accessor: the two read
different sources (the live context SSOT vs the CLAUDE.md Resume line) that
can legitimately disagree after a restart, so they remain independent.
A disposable, operator-safe probe that empirically settles whether
--fork-session leaves a stale session_id field at the new-id context path.
It does not: session_init writes a fresh live-id context on the fork. The
detector keys on OLD session_start events copied into the new journal --
robust to session_init overwriting the context field, since --fork-session
inherits the lead agent_type. Includes a format-guarded cleanup that aborts
unless the disposable temp-slug is set, and a non-vacuity control (a
simulated dir-copy must trip the detector). Records the measured CASE 1
(FRESH) verdict in the run-dates log.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant