v10 · four issues · one build

Four fictions the hooks believed

Each of these is a value that looked like a measurement and wasn't: a counter counting the wrong thing, an identifier pointing at a dead process, a writer editing a file nothing reads, and a doc promising a setting that cannot exist. None of them ever threw an error.

The four

issuethe fictionwhat it actually was
#3317"30 conversational turns" counted /goal starts, then SUMMED them: 1+2+…+N. ~8 calls tripped a limit of 30.
#3318"session pid" process.pid of the run-hook.mjs child, which exits immediately. No row was ever addressable.
#3330"sanitising sessions-index" rewrote a CC-internal file with 0 occurrences in the 2.1.226 binary.
#3323"ork sets worktree.baseRef" nothing sets it, and a plugin cannot — CC reads only 2 keys from a plugin settings.json.

#3317 — the triangular number

stop/goal-tracker.ts       counts lines with started_at && !ended_at
                           Nth /goal close  ->  turn_count: N

goal-budget-guard.ts       turns += parsed.turn_count   over ALL closed entries
                           = 1 + 2 + 3 + ... + N  =  N(N+1)/2

DEFAULT_MAX_TURNS = 30     N=8 -> 36  ->  brake trips

a real per-turn counter already existed, unused:
  prompt/cache-break-detector.ts   turnCount = (prev ?? 0) + 1

The same fake count fed the spun/aborted classification against a threshold of 10, so the status label was fiction too.

#3330 — proving a negative, properly

"grep found nothing" is worthless unless the grep can find something.

sessions-index      0 in 2.1.226   0 in 2.1.224

positive controls   sessionTitle        14
                    hookSpecificOutput  36
                    SessionEnd          34   <- the probe works

concatenation ruled out: 'sessions-' has 2 hits, both PHP SDK prose
CC derives firstPrompt from the JSONL transcript, never from disk
216 project dirs, 3 index files, newest 2026-04-14, none for this project

Caught in the act, from the real file:

- "firstPrompt": "<command-name>/ork:commit</command-name><command-args>ship it</command-args>"
+ "firstPrompt": "/ork:commit ship it"

Honest limit, stated by the worker: static absence proves the current binaries cannot open that path. It cannot prove a future CC won't reintroduce it.

Every test flips

Verified by the coordinator, independently of the workers' own reports: restore origin/main's SOURCE, keep the new tests.

         AFTER (fix)        BEFORE (origin/main source)
 #3317   21 passed          5 failed | 16 passed
 #3318   26 passed          8 failed | 18 passed
 #3330   28 passed          2 failed | 26 passed

 15 tests flip. Not one passes in both states.

Why four issues share one PR

The required Build check fails on drift in plugins/, src/hooks/dist/, README.md and docs/site/lib/generated/, and those artifacts are committed on purpose because marketplace installs have no build toolchain. So every PR must carry regenerated output. Two PRs touching src/hooks/ therefore collide on 22 generated files and on bundle-stats.json, whose numbers shift for every bundle when any shared module changes — a conflict no merge can resolve, because the resolution is "re-run the build".

Four issues, one branch, one build. Authoring was parallel; integration is deliberately not.

Audit a counter or identifier for the same class of fiction.