Skip to content

hooks: Stop and SessionStart read a stale checkout and repeat the same message forever #82

Closed

Description

@lx-0

Experience

Over 4 days, the ytstack Stop hook emitted the same message 1,645 times: "M034-S04-T05 is still the active task and has no summary". The coordinator never acted on it. Every one of 25 SessionStart injections showed "Current: M034 / S04 / T05" and 2 to 4 STATE lint lines, and all 25 were ignored.

Why

  • The pointer was stale. Origin had fixed it, but the coordinator's main checkout was a local main 168 commits behind origin/main, so the hooks read the stale STATE.md. Nothing said the checkout was behind.
  • hooks/stop checks only the flat $YT_DIR/$M-$S-$T-SUMMARY.md. (Artifacts of a milestone that lives in milestones/M###/ are still written flat #70 / PR fix: new artifacts follow the directory their milestone lives in (#70) #77 moves it to the shared lookup.)
  • There is no dedupe per session and pointer: the same text is sent on every stop.
  • The hook is not aware of coordinator mode. A coordinator holds no task by design.
  • In SessionStart, "Next action" was cut ("omitted: see STATE.md -- injection near the 10,000-char cap") because the using-ytstack body took the budget.
  • A manual handoff from day 1 was still listed as current on day 4.

Proposals

  1. hooks/stop:
  2. Both hooks: on the default branch and behind origin/<default> (local refs only, no fetch), read STATE.md from the origin ref and say "checkout N commits behind origin".
  3. SessionStart puts "Next action" ahead of the using-ytstack body inside the size budget.
  4. A manual handoff older than the newest automatic one is listed as older, not as current.

Related: #76 (proposal 4, escalating lints), #70.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions