Skip to content

docs(coord): the session record has no branch field, and two rosters answer different questions - #259

Open
wshallwshall wants to merge 1 commit into
mainfrom
claude/coord-roster-semantics
Open

docs(coord): the session record has no branch field, and two rosters answer different questions#259
wshallwshall wants to merge 1 commit into
mainfrom
claude/coord-roster-semantics

Conversation

@wshallwshall

Copy link
Copy Markdown
Collaborator

Docs-only, 2 files, +30. No behaviour change.

TWO TRAPS, both walked into on 2026-08-06, neither written down where a reader would look.

  1. A SESSION RECORD HAS NO BRANCH FIELD. It holds exactly cwd, entrypoint, kind, name, nameSource,
    peerProtocol, pid, procStart, sessionId, startedAt, version -- and never has. So any branch shown
    beside a session came from somewhere else:
  • presence.ps1 / occupancy.ps1 report the WORKTREE's branch, live from git worktree list --porcelain (Get-RepoWorktrees). CURRENT.
  • the session-list MCP tool reports a SESSION attribute captured at REGISTRATION. It does not
    follow a later git switch.
    Both are labelled 'branch'. For one checkout they reported two different names and NEITHER WAS
    WRONG -- they answer different questions. A disagreement between them is not evidence of a defect.
  1. isRunning MEANS 'CURRENTLY EXECUTING A TURN', NOT 'ALIVE'. An idle session between turns reads
    false while being perfectly reachable. A session was reported as possibly gone on that basis and was
    in fact live throughout.

⭐ AND session-registry.ps1 ALREADY SAID SO, two paragraphs above where the reader was looking:
'ONLY THE POSITIVE ANSWER IS SAFE TO ACT ON ... nothing here can PROVE a session is gone -- only that
it is present.' So the inference was wrong twice over: a NEGATIVE conclusion drawn from a signal that
cannot support one, using a field that answers a different question. Both traps are now documented in
session-registry.ps1's header and at Get-RepoWorktrees -- the two places a reader actually lands,
rather than only in the docstring that was already being skipped.

Concrete branch and worktree names are deliberately absent: the leak guard refused a first attempt
because a real worktree slug is an internal project name, and the lesson does not need them.

VERIFIED: both files parse; presence.ps1 still runs and still lists 5 live sessions; 272 tests pass
across the coord, presence and occupancy suites. Based on afdc5cb, merge-tree clean.

PROVENANCE: first committed onto a branch whose PR had ALREADY MERGED, so its parent was no longer an
ancestor of main. Caught with git merge-base --is-ancestor before handover, re-cut off current main,
cherry-picked. The pre-squash-base trap does not stop being available just because you know about it.

…ee about one

A session was told a coordinator "might not be there" on the strength of the
session-list MCP tool's `isRunning: false`, and separately the two rosters
reported different branches for one checkout. Both readings were wrong the same
way -- a field answering a question adjacent to the one asked -- and neither trap
was written down anywhere a reader would look.

MEASURED 2026-08-06. A session record holds exactly cwd, entrypoint, kind, name,
nameSource, peerProtocol, pid, procStart, sessionId, startedAt, version. There is
NO branch field. So any branch printed beside a session came from elsewhere, and
the two sources answer different questions while both being labelled "branch":

    presence.ps1 / occupancy.ps1   the WORKTREE's branch, live from
                                   `git worktree list --porcelain`. Current.
    session-list MCP tool          a SESSION attribute captured at registration.
                                   Does not follow a later `git switch`.

For one checkout they reported two different names -- the live roster the branch
that checkout had been switched onto, the session list the one it registered
with. Neither was wrong. A disagreement is not evidence that either roster is
broken, and a branch from the session list must never be quoted as a checkout's
current branch.

ALSO RECORDED, same family: `isRunning` means "currently EXECUTING A TURN", not
"alive". An idle session between turns reads false while being perfectly
reachable. It is not a liveness fence and must not be used as one --
Get-SessionLiveness is, subject to the rule already stated directly above it that
ONLY THE POSITIVE ANSWER IS SAFE TO ACT ON. That rule is why the original
inference was doubly wrong: it drew a negative conclusion from a signal that
cannot support one, using a field that answers a different question.

The concrete branch names are deliberately NOT quoted -- the leak gate refused
the first attempt because a real worktree slug is an internal project name, and
the lesson does not need them.

Documentation only; no behaviour change. Both files parse, presence.ps1 still
runs, 272 tests pass across the coord/presence/occupancy suites.
@wshallwshall
wshallwshall enabled auto-merge (squash) August 6, 2026 17:04
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