The ticket blamed a wrong table list — that the hook catches tickets and
ticket_history but misses ticket_deps and ticket_idmap. Filing the T-454
findings disproved that: tickets and ticket_history were left unstaged
too, aborting the commit.
The hook has no logic to fix; it is one line delegating to
`pql plan export --stage`. That call reports writing both files and
stages neither, with rows_written 0. Tested both ways — untracked-new
and tracked-modified fail identically, so this is not about new-month
rollover. The only common factor is the zero row count.
Since ticket mutations already write through synchronously, the export
always finds nothing left to append, which makes rows_written 0 the
normal case and the staging step effectively dead. Changes that did
persist likely did so because another file in the commit was staged by
hand. The fix belongs in pql: stage on file state, not row count.
Raised to high — a silent data-loss path, invisible behind the hook's
`2>/dev/null || true`.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>