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
44 changes: 44 additions & 0 deletions .ytstack/DECISIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -1261,3 +1261,47 @@ Plus: ops-layer split during the same session (yopstack created as own public re
- `bin/ytstack-risk` counts `M###-*` files in those directories as process records, like the flat ones.

**Supersedes:** None. Narrows "Writing stays flat" of M018-S03 (`yt_find_artifacts`).

## 2026-11-15: Progress per phase counts slices of each roadmap; the denominator log lives outside the tree (issue #81)

**Context:** Issue #81: in a four-day coordinator run the human asked for "% per phase" 37 times and the coordinator drew 22 charts by hand. Rows were added to phases, their denominators grew and progress looked negative. The issue asked for a report per phase and a log of every denominator change with its cause, kept out of the repository.

**Options considered:**
- A) Rows are tasks (`M###-S##-PLAN.md` checkboxes).
- B) Rows are the slices of each `M###-ROADMAP.md`, the unit a lane works on; done from the checkbox or a `merged` lane, in review from the lane status.
- C) The log in `.ytstack/` (committed history).

**Chose:** B, with the log under `<state base>/repos/<repo key>/phases/` (`snapshot`, `denominator.log`, the state base of `yt_state_base`). Each `--phases` run compares the slice ids per phase with the run before and appends one line per change (`first report`, `new phase`, `added S05`, `removed S04`, `phase left the report`). A `dropped` roadmap is left out.

**Reason:** A coordinator dispatches and finishes slices, and `LANES.md` says which are in review; tasks have no lane status. The log records when a report saw a change, not a host fact or a plan state, and it changes on every report: committed, it would make every status a diff in the tree (the issue asked for it to stay out). Keying by the repository makes linked worktrees share one log.

**How to apply:**
- A status with progress uses `ytstack-status --phases`, never a count by hand (`coordinate` Step 11).
- The change shown is the one since the previous `--phases` run; a second run without a change shows none.
- Only the text report advances the snapshot and appends to the log; `--json` shows the same change and writes nothing, so drawing a chart never uses up the delta a status needs. Snapshot and log are written under a noclobber lock with a `mktemp` file (PR #90 review; refines the bullet above: "run" means text report).
- A phase that joins or leaves is named on its own line, in the total and in the JSON (`joined`, `left`), also when the total stays equal. A `done` or `shipped-informally` milestone counts all its slices as done; a `backlog` roadmap is left out like a `dropped` one (PR #90 review).

**Supersedes:** None.

## 2026-11-15: Lane liveness is part of `ytstack-frontier check`, worktree cleanup only prints commands, peers are list lines in `LANES.md` (issue #84)

**Context:** Issue #84: in a four-day coordinator run lanes finished and nobody took them over overnight, 97 worktrees piled up, and after a compaction the coordinator sent a production request to the wrong session of another repository. `ytstack-upkeep` flagged only lanes held for more than 24 hours.

**Options considered:**
- A) A new command for liveness; `check` stays a format check.
- B) `check` reads a well-formed table for stalled lanes, one `stale:` line each, exit 2 (format problems keep exit 1 and skip the liveness read).
- For "the worker reported": a report file the worker writes, or what the files already show.
- For peers: a second Markdown table in `LANES.md`, or list lines.

**Chose:** B with N = 60 minutes (`--minutes`). A running row counts as reported when its row carries a pull request or its worktree no longer exists; silent when its branch had no commit for N minutes, counted from the claim when that is newer. A ready lane is stale when nobody claimed it for N minutes since a check first saw it ready; that first sight is kept outside the tree in `<state base>/repos/<repo key>/frontier-ready`. `ytstack-upkeep --worktrees` prints the inventory and the `git worktree remove` / `git branch -D` commands for merged or closed, clean, unlocked, unheld ones and runs none. Peers are `- <role> | <repository> | <address> | <last contact UTC>` lines under `## Peers`, keyed by role and repository.

**Reason:** The issue names `check`, and the coordinator already runs it at a rotation and upkeep on a schedule; a separate exit code keeps upkeep and every caller able to tell a broken table from a slow lane. Workers do not push and leave no report on disk, so a pull request in the row and a removed worktree are the local traces a report leaves; anything else would need the host. 60 minutes is longer than one task commit of a worker and much shorter than the overnight gap of the issue. The first sight of a ready lane changes with every check and is no plan state, so it stays out of the tree like the other volatile state. Printing commands instead of running them keeps a removal with a person (`rm -r` and branch deletion of parallel sessions are irreversible), and a locked worktree is a running session on Claude Code. Every existing reader of `LANES.md` (finish-lane, lane-retro, upkeep, the preambles) takes every line that starts with `|` as a lane row; list lines are invisible to all of them.

**How to apply:**
- A `stale:` line is a prompt to read the branch and set the row, or to dispatch; no script releases a lane by itself.
- A message to a session of another repository goes to the address under `## Peers`, and `peer set` runs after each contact.
- A new reader of `LANES.md` reads the lanes table only from lines that start with `|`.
- A running row with a pull request is a fix round (`finish-lane`, `spawn-milestone-team`), not a report: it is checked for commits like any implement lane, counted from the first time a check sees that pull request and round in the row; a new round restarts the clock. The only "the worker ended" signal left is a worktree that no longer exists. A `review` or `prepare` lane commits nothing: it is stale after 3 x N minutes since its claim. First sights of ready lanes and fix rounds share `<state base>/repos/<repo key>/frontier-seen`, written under a noclobber lock with a `mktemp` file (PR #90 review; replaces "a pull request in its row" as a report signal and the file name `frontier-ready` above).
- `--worktrees` prints no command for a branch with any open pull request, or whose local head is in neither the pull request head nor `origin/<branch>` (unpushed commits). It leaves out the worktree it runs in and reads `LANES.md` from the main checkout (PR #90 review).

**Supersedes:** None. Extends "2026-11-13: Coordinator mode keeps lanes, questions and standing instructions in files and reads host facts fresh (M024, issue #34)".
2 changes: 1 addition & 1 deletion .ytstack/spec/artifacts.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ The `.ytstack/` artifact model: the Markdown files that hold a project's memory
| `codebase/{stack,architecture,conventions,concerns}.md`, `backlog/README.md` | `adopt-brownfield` | refreshed by deleting the file and running the skill again |
| `spec/SPEC.md`, `spec/<area>.md` | `init-project` (every area `planned`), `adopt-brownfield` (pointer-only over existing documents; also for a project that has `.ytstack/` and no spec) | the task that changes the area, in its own commits; `reassess-roadmap` sets `verified_at` when it answers the drift report |
| `HANDOFF.md` | `handoff-session`; `coordinate` when it rotates (its format with the "Rotation" block of `docs/ux/coordinator-format.md`) | the user; the rotating coordinator appends its workers' reports under "Reports after the rotation"; no hook writes it |
| `LANES.md` | `bin/ytstack-frontier claim` (first claim) | `bin/ytstack-frontier` (`set`, `release`), one row per call; called by `spawn-milestone-team`, `coordinate`, `finish-lane` |
| `LANES.md` | `bin/ytstack-frontier claim` or `peer set` (first write) | `bin/ytstack-frontier` (`set`, `release`), one row per call; called by `spawn-milestone-team`, `coordinate`, `finish-lane`; its `## Peers` lines (sessions in other repositories) by `ytstack-frontier peer set` from `coordinate` |
| `questions/Q###-<slug>.md` | `bin/ytstack-questions new` (from `coordinate`, `reassess-roadmap`, `review-lessons` (a proposed line for a role file, `blocks:` the finding), and from `bin/ytstack-upkeep --question`, which keeps at most one open or asked file titled `Upkeep found ...`) | the agent fills Context, Options, Recommendation; `ask` and `answer` change the state; the answer text is the human's |
| `standing/<YYYYMMDDTHHMMZ>-<slug>.md`, `STANDING.md` | `coordinate`, when the human gives an instruction that holds beyond the task: a new file with `given`, `scope`, `supersedes` (`docs/ux/coordinator-format.md`); appended to `STANDING.md` only where no `standing/` exists | an entry is never edited; a newer one supersedes it by name, readers skip it; `STANDING.md` alone stays valid, also as an index, and is read beside the directory |
| `handover/<date>-<slug>.sh` and its receipt | `handover-step` through `bin/ytstack-handover new`; the receipt by the script when the human runs it | a script that ran is not edited |
Expand Down
6 changes: 3 additions & 3 deletions .ytstack/spec/checks-and-evals.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ Everything that tells a contributor whether a change is acceptable: the static c
- `new` records a finding once: a second sighting of the key raises its count, a sighting of a `fixed` one writes a regression with `reopens:`, a `dismissed` one stays dismissed; writes under a noclobber lock. `list`, `set`, `incident new`, `check` (findings and incident records; every mitigation names a handover script that passes `bin/ytstack-handover check` unless declined).
- `--kind review` records an escaped review-bot finding (key `review:<role>:<class-slug>`) without a "Signals" source; `review-checked` records and asks which merged pull request had its escape check, in `signals/review-checks`; `--tally` adds caught/escaped per role as a fourth field, which `check` validates. `lesson new` records a lesson (`kind: lesson`, key `lesson:<area>:<class-slug>`, a `target` of `check`, `knowledge`, `contract` or `proposal`, never `AGENTS.md` or `CLAUDE.md`; a repeat raises the count) and links it into an incident record with `--incident`; `lesson list [--since]` lists them; `check` fails on a closed incident without a recorded lesson and on a `fixed` lesson whose target is a proposal or a missing file.

**`bin/ytstack-upkeep`**: one read-only run over `.ytstack/` with eight counted sections (spec, state, gates, questions, lanes, runtime, review policy, review checks) and a ninth, `factory tools`, that lists the lines of `yt_factory_notices` (a factory tool that is off although the project would use it, `hooks-and-state`) and is never counted; exit 0 with `nothing needs a look`, 10 otherwise. `review checks` lists, only when `REVIEW.md` declares own reviewers, the merged pull requests without a line in `signals/review-checks` (an anchored window from 14 days before the earliest time in that file, or 14 days ago without one, at most 90 days back; cut at 500 with a notice), from one `gh pr list --search merged:>=<day>` (one call per 100) (plus one `gh repo view` when `origin` is not a GitHub URL); a failed read is an item, a missing `gh` or `jq` a note. `--question` writes one question file and none while an earlier `Upkeep found ...` is open or asked. `docs/recipes/recurring-upkeep.md` puts it on a schedule.
**`bin/ytstack-upkeep`**: one read-only run over `.ytstack/` with eight counted sections (spec, state, gates, questions, lanes, runtime, review policy, review checks) and a ninth, `factory tools`, that lists the lines of `yt_factory_notices` (a factory tool that is off although the project would use it, `hooks-and-state`) and is never counted; exit 0 with `nothing needs a look`, 10 otherwise. `review checks` lists, only when `REVIEW.md` declares own reviewers, the merged pull requests without a line in `signals/review-checks` (an anchored window from 14 days before the earliest time in that file, or 14 days ago without one, at most 90 days back; cut at 500 with a notice), from one `gh pr list --search merged:>=<day>` (one call per 100) (plus one `gh repo view` when `origin` is not a GitHub URL); a failed read is an item, a missing `gh` or `jq` a note. `--question` writes one question file and none while an earlier `Upkeep found ...` is open or asked. `lanes` also lists the `stale:` lines of `ytstack-frontier check`, once per lane. `--worktrees` prints instead the linked worktrees (not the main one, not the one it runs in) and local branches with the state of their pull request (an open one first, else the newest; one `gh pr list --state all`), the age of the last commit, uncommitted changes, unpushed commits (the local head in neither the PR head nor `origin/<branch>`), a lock and the held lane of the main checkout's `LANES.md` that names the branch, then the `git worktree remove` / `git branch -D` commands for the merged or closed ones with none of those, never run; none without the PR state; exit 10 with a command. `docs/recipes/recurring-upkeep.md` puts it on a schedule.

**`bin/ytstack-upstream`** (`docs/ux/upstream-feedback.md`): `mode` prints the effective `upstream_feedback` through `yt_upstream_feedback`, the repository and the path of the rules, and asks `gh auth status` only for `file` (without a login: `mode: suggest` and a note); `draft` writes an issue body with `TODO:` lines, the ytstack version, host and OS under `$TMPDIR` (never inside a git checkout) and never calls `gh`; `check` exits 1 on a `TODO:` left, an empty "Evidence", no filled `Searched:` line, an email address (not `noreply`), a token-looking string (the rule of `bin/ytstack-handover`) or a home directory path. It never posts; the agent does, after `check`.

Expand All @@ -91,7 +91,7 @@ Everything that tells a contributor whether a change is acceptable: the static c

**The coordinator scripts** (formats and rules: `docs/ux/coordinator-format.md`; each has a suite of the same name under `tests/`)

- `bin/ytstack-frontier`: `list` prints lane, state and detail per slice (done, claimed, blocked, ready) of the current milestone (with `none`: the highest roadmap not `done`, `dropped`, `shipped-informally` or `backlog`), then one lesson lane `lesson-F###` per open or planned lesson whose target is a check (blocked without non-empty "Files" and "Verification" in the lesson; listed also without a milestone); `claim` refuses a held lane and names the holder; `claim`, `set` and `release` change one row of `LANES.md` under a lock; `check` validates the file. The lock is the file `LANES.md.lock`, created by the shell under noclobber and not by `mkdir`, which is no lock on Ubuntu 26.04 (see `.ytstack/KNOWLEDGE.md`).
- `bin/ytstack-frontier`: `list` prints lane, state and detail per slice (done, claimed, blocked, ready) of the current milestone (with `none`: the highest roadmap not `done`, `dropped`, `shipped-informally` or `backlog`), then one lesson lane `lesson-F###` per open or planned lesson whose target is a check (blocked without non-empty "Files" and "Verification" in the lesson; listed also without a milestone); `claim` refuses a held lane and names the holder; `claim`, `set` and `release` change one row of `LANES.md` under a lock; `check` validates the file and then prints one `stale:` line per lane that stalls, exit 2 (issue #84): a `running` row whose worktree no longer exists, an `implement` row whose branch had no commit for `--minutes` (default 60, from the claim when that is newer, or from the first sight of its fix round when the row carries a pull request), a `review` or `prepare` row running 3 x `--minutes` since its claim, and a `ready` lane nobody claimed for `--minutes` since a check first saw it (first sights in `<state base>/repos/<repo key>/frontier-seen`, outside the tree, under a noclobber lock); `peer set` and `peer list` keep the `## Peers` lines of `LANES.md` (role, repository, address, last contact), list items that no table reader sees. The lock is the file `LANES.md.lock`, created by the shell under noclobber and not by `mkdir`, which is no lock on Ubuntu 26.04 (see `.ytstack/KNOWLEDGE.md`).
- `bin/ytstack-plans` (`docs/ux/external-plans.md`): `scan` counts the work rows (task-list items, rows of tables with a status or checkbox column, nothing in a code fence) of `plans/`, `roadmap/` and their variants and prints one line per directory with `verdict=large` from 10 open rows and the answer recorded in `PREFERENCES.md`; exit 0 only for a large directory without an answer. `rows` prints `path:line`, state, id, section and title per row; a relative PATH is read from where the command was started, else from the repository root, and the output names files relative to the root. It writes nothing; the mapping is the agent's (`reconcile`, `adopt-brownfield`).
- `bin/ytstack-questions`: `new`, `list`, `next`, `ask` (once), `answer` (refused without text under "Answer"), `check`.
- `bin/ytstack-finish-lane`: one step per call (`leftovers`, `commit`, `push`, `open-pr`, `wait-head`, `body-check`, `gates`, `merge`, `route`); every gate is read from GitHub through `gh` at the moment of the call, and `merge` passes the reviewed commit to the host so that a moved head cannot be merged. `route --lane <ref> [--pr <n>]` reads the lane's worker (the author) and plan from `LANES.md` and runs `bin/ytstack-risk route`; with `--pr` it passes the pull request on, and a lane without a plan file is routed from the host's reviews. `leftovers` and `commit` leave the evidence directory out. Its suite uses a stand-in for `gh` and a local bare remote.
Expand Down Expand Up @@ -184,7 +184,7 @@ Not covered by these checks: `claude plugin eval` (costs money). `bash tests/run
- DECISIONS.md -- "2026-11-14: Kimi uses native plugin bootstrap and pending lifecycle context (M020)". Source of the offline Kimi CI checks and the separately run native suite.
- DECISIONS.md -- "2026-11-13: Whether a person looks at a change is decided per change: a floor from the diff, the class an independent reviewer states, a ceiling per area, lenses per kind of change (M025)". Source of `bin/ytstack-risk` and the lint rules for `auto_merge` and `REVIEW.md`. Extended by "2026-11-15: The risk route reads the review round from the review on the host first; the plan is the fallback (M031-S02, issue #54)".
- DECISIONS.md -- "2026-11-13: `RUNTIME.md` has three sections with a fixed line format, read only through `bin/ytstack-runtime` (M025-S01)"
- DECISIONS.md -- "2026-11-13: After a merge the release is watched, not driven; upkeep is a script and a recipe, not a skill (M026)". Source of `release` and `bin/ytstack-upkeep`.
- DECISIONS.md -- "2026-11-13: After a merge the release is watched, not driven; upkeep is a script and a recipe, not a skill (M026)". Source of `release` and `bin/ytstack-upkeep`. Extended by "2026-11-15: Lane liveness is part of `ytstack-frontier check`, worktree cleanup only prints commands, peers are list lines in `LANES.md` (issue #84)": the `stale:` lines, `ytstack-upkeep --worktrees`, `peer set` and `peer list`.
- DECISIONS.md -- "2026-11-13: Production findings and incidents are skill work on read-only access; a mitigation is a handover script a person runs (M027)". Source of `bin/ytstack-signals`. "2026-11-15: Feedback about ytstack itself goes through one channel with a setting; a script checks the body, the agent posts (M033-S01, issue #55)" is the source of `bin/ytstack-upstream`.
- DECISIONS.md -- "2026-11-13: The technical spec is a set of artifacts of its own under `.ytstack/spec/` (M022, issue #36)". Source of `bin/ytstack-spec` and the two spec checks.
- DECISIONS.md -- "2026-11-13: Verification, review and orchestration work are bounded like code (M023, issue #35)". Source of `bin/ytstack-brief`.
Expand Down
Loading
Loading