Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .ytstack/DECISIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -1565,3 +1565,20 @@ Plus: ops-layer split during the same session (yopstack created as own public re
**How to apply:** While the ready-for-review count is at the cap, the coordinator dispatches no new implement lane.

**Supersedes:** Narrows "2026-11-15: Hooks read a stale checkout from origin ..." (the behind conditions; "the `open-prs` gate counts pull requests ready for review" becomes the cap on opening).

## 2026-11-16: TeammateIdle counts the teammate's own lane, read from LANES.md or its name, and says it once (issues #97, #98)

**Context:** `hooks/teammate-idle` counted the open tasks of `current_milestone` in `STATE.md` and exited 2 at every idle turn while any was open. In a coordinator session the pointer named an old open milestone (M034) while the lanes worked on M046, so every lane got "13 task(s) still open in milestone M034" about 30 times, also after its report and after the lead confirmed. The payload has `teammate_name` and no loop guard like `stop_hook_active`.

**Options considered:**
- A) Keep the pointer, add a dedupe only.
- B) The lane's scope: its held `LANES.md` row, else a slice ref in the teammate name; silent without one; once per teammate, lane and count.
- C) Read the host's team task list under `~/.claude/tasks/` for the teammate's owned tasks.

**Chose:** B. A row counts only while `claimed` or `running`; any other status of the teammate's row means its work is in. Without a row of its own (team mode claims no lanes) the `M###-S##[-T##]` that stands alone in the name counts, and `spawn-milestone-team` names team-mode teammates after their slice; a lane that has any row (another holder, released, dropped) is not the teammate's, so an old worker of a re-claimed lane is not pushed back to it. With held lanes in `LANES.md`, a name ref outside their milestones is ignored. `LANES.md` is the main checkout's (`yt_lanes_file`). A milestone whose roadmap is `done`, `dropped`, `shipped-informally` or `backlog` never counts. The record is `<session home>/<session-id>/idle-said`; the hook speaks when the count differs from the last one it said for that teammate and lane.

**Reason:** A teammate can only act on its own lane; the pointer is the lead's position, not the lane's. A count that did not change since the last message carries nothing new, so repeating it only costs turns. C reads an undocumented host format.

**How to apply:** A lane that should get the reminder holds its row in `LANES.md` (`ytstack-frontier claim --by <teammate name>`) or carries its slice in its name.

**Supersedes:** None.
2 changes: 1 addition & 1 deletion .ytstack/spec/checks-and-evals.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ sources:
- docs/ux/signal-format.md
- docs/ux/external-plans.md
- docs/ux/upstream-feedback.md
verified_at: 53a0f84
verified_at: e04ddc8
---

# checks-and-evals
Expand Down
2 changes: 1 addition & 1 deletion .ytstack/spec/dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ paths:
- NOTICE
- hooks/lib/git-ctx.sh
- bin/ytstack-gstack-diff
verified_at: f7c0e3c
verified_at: e04ddc8
---

# dependencies
Expand Down
13 changes: 7 additions & 6 deletions .ytstack/spec/hooks-and-state.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .ytstack/spec/skills.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Read from `PREFERENCES.md` in the resolved `.ytstack` directory by `yt_prefs` in
| `autonomy` | `loop`: inside a slice, `plan-task` continues into `test-driven-development`, `verification-before-completion` and `summarize-task`, and `summarize-task` continues with the next `plan-task`, without asking. It stops at the slice boundary and at every gate. `step`: every skill returns control. `slice-milestone` never chains. | `using-ytstack`, `plan-task`, `summarize-task` |
| `quick_lane` | `off`: `quick-task` stops at its gate and points at `plan-task`. `on`: `using-ytstack` routes one-sentence changes with a known cause to `quick-task`. | `quick-task`, `using-ytstack` |
| `minimal_code` | `on`: `hooks/session-start` adds a pointer that tells the agent to load `minimal-code` before writing code or adding a check, and the TDD wrapper applies its ladder in the GREEN step. `off`: no pointer. A rendered brief carries the contract in both cases. | `hooks/session-start`, `test-driven-development`, `bin/ytstack-brief` |
| `team` | `off`: `spawn-milestone-team` dispatches worktree subagents. `on`: it emits an Agent Teams instruction and requires `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1`. | `spawn-milestone-team` |
| `team` | `off`: `spawn-milestone-team` dispatches worktree subagents. `on`: it emits an Agent Teams instruction and requires `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1`; each teammate is named after its slice (`impl-M004-S02`), which `hooks/teammate-idle` reads as the teammate's lane. | `spawn-milestone-team` |
| `merge_by` | `risk` (default): the coordinator merges when `bin/ytstack-risk route` says `unattended` and the host's gates hold, otherwise a person. `human`: always a person. `coordinator`: always the coordinator, except that a `reason: spec` line of the route sends the lane back to the worker first. A value outside the three reads as `human`. | `finish-lane` |
| `evidence_dir` | Where a visual review stores its screenshots, default `.ytstack/evidence`, relative to the main checkout. | `visual-review`, `bin/ytstack-risk`, `bin/ytstack-finish-lane` |
| `escalate` | What a coordinator brings to a person (`docs/ux/coordinator-format.md`, "Who decides"): a comma separated subset of `violation`, `deviation`, `irreversible`, `secret`, `spend`, default all five; `reserved` (a plan line that says verdict, approval or sign-off, or a standing entry) always holds. Everything else the coordinator decides and records in `DECISIONS.md`. A value with an item outside the five reads as all five. | `coordinate` (preamble `ESCALATE`, Step 8), `bin/ytstack-questions new` |
Expand Down
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed

- **TeammateIdle no longer loops on an unrelated milestone** (issues #97,
#98): the hook counted the open tasks of the `STATE.md` pointer's
milestone and fired at every idle turn, so coordinator lanes were asked
about 30 times each to claim tasks of an old open milestone outside their
brief. It now counts only the lane the teammate holds (its claimed or
running row in the main checkout's `LANES.md`, else the `M###-S##[-T##]`
in its name when that lane has no row of someone else), never a done,
dropped, shipped-informally or backlog milestone, and stays silent without
a known lane or after the lane reported. It speaks again only when the open
count changed since it last spoke (`idle-said` in the session home, pruned
by `stop` after 14 days like `stop-said`).
`spawn-milestone-team` 0.5.3 names team-mode teammates after their slice.

## [0.12.0] - 2026-11-16

A coordinator stays on its operating path: standing instructions recorded
Expand Down
2 changes: 1 addition & 1 deletion bin/ytstack-upkeep
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ worktrees() {
fi
# Branches a held lane names: "<branch> <lane> (<status>)", from the
# LANES.md of the main checkout (a linked worktree carries a stale copy).
lanes="$top/.ytstack/LANES.md"; [ -f "$lanes" ] || lanes="$YT_DIR/LANES.md"
lanes=$(yt_lanes_file "$YT_DIR")
[ ! -f "$lanes" ] || held=$(awk -v tab="$TAB" '
/^\|/ && ++n > 2 {
split($0, c, "|"); for (i = 2; i <= 6; i++) gsub(/^[ \t]+|[ \t]+$/, "", c[i])
Expand Down
9 changes: 9 additions & 0 deletions hooks/lib/git-ctx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -889,6 +889,15 @@ yt_standing_lines() {
return 0
}

# yt_lanes_file <yt_dir> -> the LANES.md to read (call yt_git_ctx first): the
# main checkout's .ytstack/LANES.md when it exists (a linked worktree carries a
# stale copy), else <yt_dir>/LANES.md. The one place that says where it lives.
yt_lanes_file() {
local top="${YT_MAIN_TOPLEVEL:-${YT_TOPLEVEL:-}}"
if [ -n "$top" ] && [ -f "$top/.ytstack/LANES.md" ]; then printf '%s\n' "$top/.ytstack/LANES.md"
else printf '%s\n' "$1/LANES.md"; fi
}

# yt_session_home -> the directory of per-session state that a hook and the
# Bash tool of the same session both find: ${XDG_STATE_HOME:-~/.local/state}/
# ytstack/sessions. Not yt_state_base: Claude Code sets CLAUDE_PLUGIN_DATA for
Expand Down
9 changes: 6 additions & 3 deletions hooks/stop
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,12 @@ said() { # said <key>: 0 when this session said it already; records it otherwise
grep -qxF -- "$1" "$f" 2>/dev/null && return 0
if [ ! -d "${f%/*}" ]; then
# A new session dir: prune the dirs of old sessions that only ever held
# stop-said (14 days untouched); a coordinate session's dir stays.
find "$(yt_session_home)" -mindepth 2 -maxdepth 2 -name stop-said -mtime +14 2>/dev/null | while IFS= read -r o; do
[ "$(ls -A "${o%/*}" 2>/dev/null)" = stop-said ] && rm -f "$o" && rmdir "${o%/*}" 2>/dev/null
# stop-said and/or idle-said (hooks/teammate-idle), all 14 days
# untouched; a coordinate session's dir stays.
find "$(yt_session_home)" -mindepth 2 -maxdepth 2 \( -name stop-said -o -name idle-said \) -mtime +14 2>/dev/null | while IFS= read -r o; do
o=${o%/*}; [ -d "$o" ] || continue
case "$(ls -A "$o" 2>/dev/null | tr '\n' ' ')" in "stop-said "|"idle-said "|"idle-said stop-said ") ;; *) continue ;; esac
[ -z "$(find "$o" -type f ! -mtime +14 2>/dev/null)" ] && rm -f "$o/stop-said" "$o/idle-said" && rmdir "$o" 2>/dev/null
done
mkdir -p "${f%/*}" 2>/dev/null || return 1
fi
Expand Down
117 changes: 83 additions & 34 deletions hooks/teammate-idle
Original file line number Diff line number Diff line change
@@ -1,11 +1,26 @@
#!/usr/bin/env bash
# ytstack TeammateIdle hook
# ytstack TeammateIdle hook (issues #97, #98)
#
# Fires when a Claude Code Agent Teams teammate is about to go idle.
# Checks whether the teammate has unfinished work in the shared task list
# and, if so, emits feedback (exit 2) to keep them working.
# Fires when a Claude Code Agent Teams teammate (also a named subagent while
# Agent Teams are on) is about to go idle. When the teammate's own lane still
# has open tasks, it says so once (exit 2 + stderr keeps the teammate working).
#
# Idempotent: safe to re-fire; doesn't double-count.
# The lane's scope, M###-S## (a slice) or M###-S##-T## (a task):
# 1. the LANES.md row whose "Claimed by" names the teammate (its first
# word). Only a claimed or running row counts; a row in any other status
# (reported, merged, ...) means the lane's work is in: silent.
# 2. no row: the M###-S##[-T##] ref in the teammate's name, ending at a
# non-word character (team mode names a teammate after its slice,
# impl-M004-S02). Silent when that lane has any row in LANES.md (another
# holder, released, dropped: it is not this teammate's). With held lanes
# in LANES.md only a milestone among theirs counts.
# Nothing else: never the STATE pointer, no scope known means silence.
# LANES.md is the main checkout's (yt_lanes_file). A milestone whose roadmap
# says done, dropped, shipped-informally or backlog is never counted. Said
# when the open count differs from the last one said for this teammate and
# scope (<session home>/<session id>/idle-said): the payload has no loop
# guard, so a repeat idle with no change stays quiet.
# No session id, no teammate name, no jq or python: silent. Fails open.

set -uo pipefail
trap '' PIPE
Expand All @@ -14,41 +29,75 @@ trap '' PIPE
# DECISIONS 2026-11-07).
. "$(cd "$(dirname "$0")" && pwd)/lib/git-ctx.sh"
yt_read_stdin
case "${YT_SESSION_ID:-}" in ''|.|..|*[!A-Za-z0-9._-]*) exit 0 ;; esac
TM=""
if [ -n "$(yt_jq)" ]; then
TM=$(printf '%s' "$YT_STDIN" | "$(yt_jq)" -r '.teammate_name // "" | tostring' 2>/dev/null)
elif [ -n "$(yt_python)" ]; then
TM=$(printf '%s' "$YT_STDIN" | "$(yt_python)" -I -c '
import json, sys
try:
d = json.load(sys.stdin)
except Exception:
d = {}
print(d.get("teammate_name") or "" if isinstance(d, dict) else "")' 2>/dev/null)
fi
case "$TM" in ''|*[!A-Za-z0-9._-]*) exit 0 ;; esac

yt_git_ctx "${YT_CWD:-$PWD}"
YT_DIR=$(yt_resolve_yt_dir)
[ -n "$YT_DIR" ] || exit 0

# Silent exit if not a ytstack project
[ -z "$YT_DIR" ] && exit 0

STATE_FILE="$YT_DIR/STATE.md"
[ ! -f "$STATE_FILE" ] && exit 0

# Determine current milestone + its slice-plans
CURRENT_MILESTONE=$(sed -n 's/^current_milestone: *//p' "$STATE_FILE" | head -1)
[ -z "$CURRENT_MILESTONE" ] || [ "$CURRENT_MILESTONE" = "none" ] && exit 0

# Count unfinished tasks across all slice-plans for this milestone
OPEN_TASK_COUNT=0
# Every layout, one file per name: plans that landed flat before the milestone
# moved to milestones/M###/ count too (#70).
while IFS= read -r plan; do
[ -f "$plan" ] || continue
# grep -c prints 0 itself and exits 1; `|| echo 0` would yield "0\n0".
count=$(grep -c '^- \[ \] T[0-9][0-9]' "$plan" 2>/dev/null); count=${count:-0}
OPEN_TASK_COUNT=$((OPEN_TASK_COUNT + count))
done <<EOF
$(yt_find_artifacts "$YT_DIR" "$CURRENT_MILESTONE-S[0-9][0-9]-PLAN.md" | awk -F/ 'NF && !s[$NF]++')
EOF
# LANES.md rows: lane TAB status TAB holder (first word of "Claimed by").
ROWS=""
LANES=$(yt_lanes_file "$YT_DIR")
[ -f "$LANES" ] && ROWS=$(awk -F '|' '
function t(s) { gsub(/^[ \t]+|[ \t]+$/, "", s); return s }
/^\|/ && NF >= 11 { l = t($2); s = t($4); c = t($5); split(c, w, " ")
if (l != "" && l != "Lane" && l !~ /^-+$/) print l "\t" s "\t" w[1] }' "$LANES" 2>/dev/null)
MINE=$(printf '%s\n' "$ROWS" | awk -F '\t' -v n="$TM" '$3 == n')
if [ -n "$MINE" ]; then
SCOPE=$(printf '%s\n' "$MINE" | awk -F '\t' '$2 == "claimed" || $2 == "running" { print $1; exit }')
else
# The ref stands alone in the name: impl-M046-S023 names no lane.
SCOPE=$(printf '%s\n' "$TM" | grep -oE '(^|[^A-Za-z0-9])M[0-9]{3}-S[0-9]{2}(-T[0-9]{2})?([^A-Za-z0-9]|$)' | head -1 | grep -oE 'M[0-9]{3}-S[0-9]{2}(-T[0-9]{2})?')
# A lane with a row is not this teammate's (another holder, released, dropped).
[ -z "$SCOPE" ] || ! printf '%s\n' "$ROWS" | awk -F '\t' -v s="$SCOPE" '
{ sl = substr(s, 1, 8) } $1 == s || $1 == sl || index($1, s "-") == 1 { f = 1 } END { exit !f }' || exit 0
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 👍 / 👎.

if [ -n "$SCOPE" ] && [ -n "$ACTIVE" ]; then
printf '%s\n' "$ACTIVE" | grep -qxF "${SCOPE%%-*}" || exit 0
fi
fi
case "$SCOPE" in M[0-9][0-9][0-9]-S[0-9][0-9]|M[0-9][0-9][0-9]-S[0-9][0-9]-T[0-9][0-9]) ;; *) exit 0 ;; esac
M=${SCOPE%%-*}; REST=${SCOPE#*-}; S=${REST%%-*}; T=""
[ "$REST" = "$S" ] || T=${REST#*-}

# If everything done, let teammate idle (exit 0, no feedback)
if [ "$OPEN_TASK_COUNT" -eq 0 ]; then
exit 0
ROAD=$(yt_artifact_path "$YT_DIR" "$M-ROADMAP.md")
case "$(sed -n 's/^status:[ ]*\([^ ]*\).*/\1/p' "$ROAD" 2>/dev/null | head -1)" in
done|dropped|shipped-informally|backlog) exit 0 ;;
esac
PLAN=$(yt_artifact_path "$YT_DIR" "$M-$S-PLAN.md")
[ -f "$PLAN" ] || exit 0
# grep -c prints 0 itself and exits 1; `|| echo 0` would yield "0\n0".
if [ -n "$T" ]; then
N=$(grep -cE "^- \[ \] $T([^0-9]|\$)" "$PLAN" 2>/dev/null)
else
N=$(grep -c '^- \[ \] T[0-9][0-9]' "$PLAN" 2>/dev/null)
fi
case "$N" in ''|*[!0-9]*) N=0 ;; esac
[ "$N" -gt 0 ] || exit 0

# Said when the count differs from the last one said for this teammate and
# scope (lines "<teammate> <scope> <count>"); silent when it cannot be recorded.
SAID="$(yt_session_home)/$YT_SESSION_ID/idle-said"
LAST=$(awk -v t="$TM" -v s="$SCOPE" '$1 == t && $2 == s { n = $3 } END { print n }' "$SAID" 2>/dev/null)
[ "$LAST" != "$N" ] || exit 0
mkdir -p "${SAID%/*}" 2>/dev/null && printf '%s %s %s\n' "$TM" "$SCOPE" "$N" >> "$SAID" 2>/dev/null || exit 0

# Otherwise emit feedback via exit 2 + stderr (lead gets the message)
cat >&2 <<EOF
[ytstack] $OPEN_TASK_COUNT task(s) still open in milestone $CURRENT_MILESTONE.
Check the shared task list and claim the next unblocked task. If you believe
you have no claimable work, confirm with the lead before going idle.
[ytstack] $N task(s) still open in $SCOPE, the lane you hold.
Take the next open one. If none of them is yours to take, tell the lead in one
line and go idle; this is said again only when the open count changes.
EOF
exit 2
4 changes: 2 additions & 2 deletions skills/spawn-milestone-team/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: spawn-milestone-team
description: "Dispatches the current milestone's slices to parallel workers: by default one worktree-isolated implementer subagent per slice plus a fresh verifier per slice, orchestrated from the main session which never edits source; with PREFERENCES team on, a Claude Code Agent Team instead. Use after slice-milestone and plan-eng-review when the slices are independent, or when the user says spawn the team, run the slices in parallel, dispatch the milestone. Not for a single slice or sequential work (plan-task)."
metadata:
tier: task
version: 0.5.2
version: 0.5.3
triggers:
- spawn team
- dispatch milestone
Expand Down Expand Up @@ -328,7 +328,7 @@ After each merge (policy A) or each verified slice (policy B): back to Step 5 an

### Step 5-8 under EXECUTION=team

With `team: on` and Agent Teams enabled, skip the subagent calls and emit the team instruction instead (unchanged from 0.1.x): one teammate per slice using the `ytstack:implementer` definition, an optional architect-lead, the shared task list from the roadmap, teammates with `YTSTACK_NON_INTERACTIVE=1`, the lead coordinating and running `reassess-roadmap` at the end. Present the instruction and wait for "go"; Claude Code creates the team from the next prompt. Teams cannot be resumed after `/resume`; say so once. No lanes are claimed in team mode: the team's shared task list says who holds what.
With `team: on` and Agent Teams enabled, skip the subagent calls and emit the team instruction instead (unchanged from 0.1.x): one teammate per slice using the `ytstack:implementer` definition and named after its slice (`impl-M004-S02`: the TeammateIdle hook reads the slice from the name), an optional architect-lead, the shared task list from the roadmap, teammates with `YTSTACK_NON_INTERACTIVE=1`, the lead coordinating and running `reassess-roadmap` at the end. Present the instruction and wait for "go"; Claude Code creates the team from the next prompt. Teams cannot be resumed after `/resume`; say so once. No lanes are claimed in team mode: the team's shared task list says who holds what.

### Step 9: Report + return

Expand Down
8 changes: 4 additions & 4 deletions tests/hooks-readonly.test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -330,10 +330,10 @@ if [ -e "$ELSEWHERE/.ytstack" ]; then bad "tc: nothing under CLAUDE_PROJECT_DIR"

# ---- 6. teammate-idle / task-created ---------------------------------------
echo "# teammate-idle / task-created"
run teammate-idle "{\"cwd\":$(jstr "$MAIN")}" >/dev/null
eq "ti: open tasks -> exit 2" 2 "$EC"
has "ti: reports open count" "$(cat "$ERR")" "2 task(s) still open"
run teammate-idle "{\"cwd\":$(jstr "$PLAIN")}" >/dev/null
run teammate-idle "{\"session_id\":\"ti1\",\"cwd\":$(jstr "$MAIN"),\"teammate_name\":\"impl-M999-S01\"}" XDG_STATE_HOME="$TMP/xdg" >/dev/null
eq "ti: open tasks of its slice -> exit 2" 2 "$EC"
has "ti: reports open count" "$(cat "$ERR")" "2 task(s) still open in M999-S01"
run teammate-idle "{\"session_id\":\"ti2\",\"cwd\":$(jstr "$PLAIN"),\"teammate_name\":\"impl-M999-S01\"}" XDG_STATE_HOME="$TMP/xdg" >/dev/null
eq "ti: no .ytstack -> exit 0" 0 "$EC"
run task-created "{\"cwd\":$(jstr "$MAIN"),\"tool_input\":{\"subject\":\"touch foo/bar.ts\",\"description\":\"edit foo/bar.ts\"}}" >/dev/null
eq "tcr: drifted path -> exit 2" 2 "$EC"
Expand Down
6 changes: 5 additions & 1 deletion tests/hooks-stop.test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,14 @@ case "$OUT" in *"behind"*|*" / / "*) bad "user scope: no empty origin pointer";
echo "# old session dirs that only held stop-said are pruned (PR #94 review)"
SHM="$XDG_STATE_HOME/ytstack/sessions"
mkdir -p "$SHM/old1" "$SHM/oldc"; : > "$SHM/old1/stop-said"; : > "$SHM/oldc/stop-said"; : > "$SHM/oldc/coordinate"
touch -t 202001010000 "$SHM/old1/stop-said" "$SHM/oldc/stop-said"
mkdir -p "$SHM/oldi" "$SHM/oldb" "$SHM/newi"; : > "$SHM/oldi/idle-said"; : > "$SHM/oldb/idle-said"; : > "$SHM/oldb/stop-said"; : > "$SHM/newi/idle-said"
touch -t 202001010000 "$SHM/old1/stop-said" "$SHM/oldc/stop-said" "$SHM/oldi/idle-said" "$SHM/oldb/idle-said" "$SHM/oldb/stop-said"
SID=fresh2; printf 'current_milestone: M042\nactive_slice: S09\nactive_task: T09\n' > "$WT/.ytstack/STATE.md"; OUT=$(fire "$WT"); has "a new session's reminder" "$OUT" "M042-S09-T09"
eq "an old stop-said-only dir is gone" no "$([ -d "$SHM/old1" ] && echo yes || echo no)"
eq "an old dir with a coordinate marker stays" yes "$([ -d "$SHM/oldc" ] && echo yes || echo no)"
eq "an old idle-said-only dir is gone (teammate-idle)" no "$([ -d "$SHM/oldi" ] && echo yes || echo no)"
eq "an old dir with idle-said and stop-said is gone" no "$([ -d "$SHM/oldb" ] && echo yes || echo no)"
eq "a fresh idle-said dir stays" yes "$([ -d "$SHM/newi" ] && echo yes || echo no)"

echo
echo "$PASS passed, $FAIL failed"
Expand Down
Loading
Loading