Skip to content

fix: teammate-idle counts only the lane's own scope and says it once (#97, #98) - #101

Merged
lx-0 merged 4 commits into
mainfrom
fix/97-98-teammate-idle
Nov 17, 2026
Merged

lx-0 merged 4 commits into
mainfrom
fix/97-98-teammate-idle

Conversation

@lx-0

@lx-0 lx-0 commented Nov 16, 2026

Copy link
Copy Markdown
Member

Root cause

hooks/teammate-idle read current_milestone from STATE.md (the lead's pointer, here an old open milestone M034) and counted the unchecked tasks of every slice plan of it. It exited 2 whenever that count was above zero and kept no record of what it had said. The TeammateIdle payload has no loop guard like stop_hook_active, so every idle turn of every lane got "13 task(s) still open in milestone M034". That happened even when the lane was dispatched for M046, had reported, or had been confirmed by the lead.

Fix

  • The scope is the lane the teammate holds. That is the LANES.md row whose Claimed by starts with the payload's teammate_name, and it counts only while the row is claimed or running. Any other status of the row means the work is in, and the hook stays silent. Without a row (team mode claims no lanes), the M###-S##[-T##] in the teammate's name counts. When LANES.md has held lanes, that milestone must be one of theirs. A slice counts its unchecked T## boxes, a task counts its own box.
  • The hook never reads the STATE pointer, never counts a milestone whose roadmap status is done, dropped, shipped-informally or backlog, and stays silent with no scope, no session id or no teammate name.
  • It says each teammate, lane and count once per session, recorded in <session home>/<session-id>/idle-said (same pattern as stop-said). If progress changes the count, it gives one new message. It stays silent when it cannot record what it said.
  • spawn-milestone-team 0.5.3 names team-mode teammates after their slice (impl-M004-S02). That keeps the useful case: a teammate whose own slice still has open tasks.
  • Docs: spec hooks-and-state (table, rules, written files, tests), skills (team row), and checks-and-evals (verified_at). Also a DECISIONS entry and a CHANGELOG Fixed entry.

Verification

  • tests/hooks-teammate-idle.test.sh (new) reproduces both issues. Against the old hook: 7 passed, 23 failed. Against the new hook: 30 passed, 0 failed.
  • tests/hooks-worktree.test.sh 32 passed, tests/hooks-readonly.test.sh 108 passed (updated to name the teammate).
  • bash tests/run-all.sh (bash 3.2, Darwin): ALL SUITES PASSED.
  • bash tests/run-all.sh --linux from a git archive HEAD export (bash 5.3, alpine): ALL SUITES PASSED.
  • python3 bin/ytstack-check: OK (with 9 warnings, as on main). bin/ytstack-spec lint: 0 failures. bin/ytstack-spec drift: no area to look at.

Closes #97
Closes #98

🤖 Generated with Claude Code

lx-0 and others added 2 commits November 16, 2026 22:04
…97, #98)

The hook counted the open tasks of STATE.md's current_milestone and exited 2
at every idle turn while any was open, so coordinator lanes looped on an old
open milestone (M034) outside their brief. It now counts only the lane the
teammate holds (its claimed or running LANES.md row, else the M###-S##[-T##]
in its name), skips done, dropped, shipped-informally and backlog milestones,
stays silent without a known scope, and says the same teammate, lane and
count once per session (idle-said in the session home).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-16T21:15:33.588667Z e07d061 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e07d06168e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread hooks/teammate-idle
SCOPE=$(printf '%s\n' "$MINE" | awk -F '\t' '$2 == "claimed" || $2 == "running" { print $1; exit }')
else
SCOPE=$(printf '%s\n' "$TM" | grep -oE 'M[0-9]{3}-S[0-9]{2}(-T[0-9]{2})?' | head -1)
ACTIVE=$(printf '%s\n' "$ROWS" | awk -F '\t' '$3 != "" && $3 != "-" && $2 != "merged" && $2 != "dropped" { print substr($1, 1, 4) }')

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Exclude blocked rows from the held-milestone filter

When a team-mode teammate has no row of its own and LANES.md retains a blocked lane from an earlier milestone, this filter still adds that lane's milestone to ACTIVE because it excludes only merged and dropped. bin/ytstack-frontier does not classify blocked as held, and changing a row to blocked does not clear its Claimed by value, so line 61 rejects a valid current teammate name such as impl-M046-S01 and the hook silently omits its open-task reminder. Restrict ACTIVE to the actual held statuses before applying the milestone guard.

Useful? React with 👍 / 👎.

lx-0 and others added 2 commits November 16, 2026 22:25
… last said count (#97, #98)

- the name fallback stays silent when the named lane has any row in LANES.md
  (another holder, released, dropped), and the ref must stand alone in the name
- LANES.md is read from the main checkout through yt_lanes_file, shared with
  ytstack-upkeep
- speaks when the count differs from the last one said (2 -> 1 -> 2 is said)
- stop prunes 14-day-old session dirs holding only idle-said and/or stop-said
- spec text matches the code (first word, yt_artifact_path)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
lx-0 added a commit that referenced this pull request Nov 16, 2026
- yt_lanes_file is the unified resolver (also for PR #101's callers):
  out-of-tree file, else the main checkout's LANES.md, else <yt_dir>'s
  (no snapshots), else the out-of-tree path; prints the path and sets
  YT_LANES_FILE/YT_LANES_SOURCE
- migrate takes the main checkout's copy, refuses while a worktree's copy
  differs, marks both; migrate --from <old path|key> for a moved checkout;
  where says how to recover
- goal: coordinate sets --rounds 30; ytstack-goal calls do not re-arm; the
  stop goes through once every open slice waits for a person; a stale or
  unreadable running row is no background work; any Stop-hook block leaves
  its transcript offset; scan at most 2 MB; --if-unset replaces a reached
  goal; hooks/stop prints through python without jq before a message counts
  as said
- upkeep: merge-commit subjects no longer give "##N"
- docs: QUICKSTART, README, coordinator-format example, evals note

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@lx-0
lx-0 merged commit 6633459 into main Nov 17, 2026
4 checks passed
@lx-0
lx-0 deleted the fix/97-98-teammate-idle branch November 17, 2026 08:40
lx-0 added a commit that referenced this pull request Nov 17, 2026
Resolve against #101: keep the unified yt_lanes_file (out of tree first,
then the main checkout's non-snapshot LANES.md) and drop #101's duplicate;
keep both CHANGELOG sections and DECISIONS entries; spec row and test
lists carry both idle-said and goal mode.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
lx-0 added a commit that referenced this pull request Nov 17, 2026
* feat: the host is the ledger of a lane; lanes file out of tree (#79)

A lane's state is its pull request, read fresh. What only the coordinator
knows lives in one lanes file per repository, out of tree at
${XDG_STATE_HOME:-~/.local/state}/ytstack/repos/<repo key>/LANES.md,
resolved by yt_lanes_file for every reader (frontier, stop lint, upkeep,
status --phases, finish-lane route, coordinate/finish-lane/lane-retro
preambles).

- ytstack-frontier where | migrate | snapshot; a repo LANES.md without a
  snapshot: key stays the lanes file until migrate (LANES_MIGRATE in the
  coordinate preamble)
- finish-lane bundles roadmap tick, decisions and the milestone snapshot
  on the lane branch before the push
- ytstack-upkeep: bookkeeping section, days with more than 3 merged PRs
  that changed only .ytstack/ (local refs)
- coordinate 0.8.0, finish-lane 0.8.0, lane-retro 0.2.1,
  spawn-milestone-team 0.5.3; DECISIONS, spec, docs, CHANGELOG
- tests isolate XDG_STATE_HOME; widen a timing-sensitive heartbeat check

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat: goal mode keeps a long-running session working (#99)

ytstack-goal set <M###>|"<sentence>" writes a goal marker out of tree
(<session home>/<id>/goal). The Stop hook holds the stop while the goal is
open, naming open slices, the milestone's exit criteria, missing files and
failed checks, and lets it through for an asked question, a recorded
blocker (ytstack-goal block), a running lane or a PR watched for this
session, or a reached bound (--until, --rounds), said once. Inside a
hook-continued turn it blocks again only after a tool call in the
transcript, so it cannot loop; a standing or lint block comes first.

- ytstack-goal set | status (runs --check) | block | clear | hook
- coordinate 0.9.0: sets the current milestone as the goal (--if-unset),
  checklist item 14 clears it; Codex uses its native /goal
- DECISIONS, spec, coordinator-format "Goal mode", docs/codex.md, CHANGELOG
- spec dependencies verified_at moved (git-ctx resolver only, no
  dependency change)

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix: coordinate names no host in its goal-mode instructions (#99)

tests/codex_plugin_test.py allows another host's name only in shell
comments; the goal lines now say "a host with its own /goal".

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix: review of PR #102: main checkout first, bounded goal, person waits

- yt_lanes_file is the unified resolver (also for PR #101's callers):
  out-of-tree file, else the main checkout's LANES.md, else <yt_dir>'s
  (no snapshots), else the out-of-tree path; prints the path and sets
  YT_LANES_FILE/YT_LANES_SOURCE
- migrate takes the main checkout's copy, refuses while a worktree's copy
  differs, marks both; migrate --from <old path|key> for a moved checkout;
  where says how to recover
- goal: coordinate sets --rounds 30; ytstack-goal calls do not re-arm; the
  stop goes through once every open slice waits for a person; a stale or
  unreadable running row is no background work; any Stop-hook block leaves
  its transcript offset; scan at most 2 MB; --if-unset replaces a reached
  goal; hooks/stop prints through python without jq before a message counts
  as said
- upkeep: merge-commit subjects no longer give "##N"
- docs: QUICKSTART, README, coordinator-format example, evals note

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant