mirror of
https://github.com/garrytan/gstack.git
synced 2026-09-09 14:38:59 +02:00
The dangling-event repair kept only the FIRST "started" entry per skill+session key and treated "completed" as a set, so any key where one run completed and another dangles was never repaired — and keys are not unique per run: legacy entries with no session field all share the bare-skill key, and the preamble's "$$-epoch" session ids collide within the same second. One old completion masked every future dangler forever. The hook now counts started vs completed per key and appends completions for the DIFFERENCE. Idempotency holds by construction: the appended completions balance the counts, so the next Stop appends nothing. Pinned with the two-runs-one-dangling case plus a re-run no-op assertion; all existing fail-open cases pass unchanged. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>