Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
5951bf6
feat: standing entries end by until, until-check or a closing entry; …
lx-0 Nov 15, 2026
239e297
feat: bin/ytstack-standing: add, end and list standing entries (#72, …
lx-0 Nov 15, 2026
3d80462
feat: standing-prompt hook flags standing instructions; stop blocks o…
lx-0 Nov 15, 2026
2661181
feat: inject standing entries at session start and into lane briefs (…
lx-0 Nov 15, 2026
75bbab0
feat: coordinate records standing entries with ytstack-standing and l…
lx-0 Nov 15, 2026
6ca0393
docs: standing entries: format, roles, coordinate mode, spec, decisio…
lx-0 Nov 15, 2026
054b8d1
feat: operating checklist for coordinate mode, injected at session st…
lx-0 Nov 15, 2026
806d92e
feat: coordinate-mode hooks warn on hand-written briefs, stale LANES.…
lx-0 Nov 15, 2026
5d4a834
docs: coordinate operating path: spec, decision, changelog (#76)
lx-0 Nov 15, 2026
8551ba1
test: hooks-standing does not assume the default branch is main
lx-0 Nov 15, 2026
bdbe540
fix: standing commands run only from merged entries; pending entries …
lx-0 Nov 15, 2026
c8155dc
fix: coordinate hooks: per-session lint streak, phrase classifier, lo…
lx-0 Nov 15, 2026
2537a8c
fix: session-start shrinks the standing list before it cuts the next …
lx-0 Nov 15, 2026
f5b116d
fix: coordinate and resume-session find the automatic handoff the hoo…
lx-0 Nov 15, 2026
fe8da06
docs: merged-only commands, pending entries, classifier, streak (PR #…
lx-0 Nov 15, 2026
d79c5a1
fix: pre-tool-use-agent falls back to python3 without jq (Codex findi…
lx-0 Nov 15, 2026
5390d8f
fix: pending entries reach SessionStart before standing/ exists; lint…
lx-0 Nov 15, 2026
f95562f
docs: spec for the marker's repo key, pending entries at session star…
lx-0 Nov 15, 2026
60d7690
test: skill-preambles defines eq (Codex finding on PR #87)
lx-0 Nov 15, 2026
f56421f
fix: briefs carry the whole text of standing entries; add finds a mas…
lx-0 Nov 15, 2026
6a4ffd2
fix: fail closed without a default branch, whole pending text in list…
lx-0 Nov 15, 2026
29d1764
docs: spec for the body column, the default-ref order and overlapping…
lx-0 Nov 15, 2026
62e5d3f
docs: skills spec names the standing section of the brief
lx-0 Nov 15, 2026
1234c16
fix: standing-prompt flags temporary holds with until/bis/solange/whi…
lx-0 Nov 15, 2026
39275b7
Merge remote-tracking branch 'origin/main' into feat/72-73-standing
lx-0 Nov 15, 2026
5e9ee5c
docs: stamp the dependencies area after the merge of main (no vendor …
lx-0 Nov 15, 2026
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
72 changes: 72 additions & 0 deletions .ytstack/DECISIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -1305,3 +1305,75 @@ Plus: ops-layer split during the same session (yopstack created as own public re
- `--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)".

## 2026-11-15: Coordinate mode is a session marker the coordinate preamble writes; the standing hooks act only with it (issue #72)

**Context:** A 12-hour coordinator run got seven standing instructions in one day and recorded none in `.ytstack/standing/`; it wrote them to its private memory. Issue #72 asks for a prompt hook that flags such instructions and a Stop check that holds the turn when they were not recorded, both only in coordinate mode. Nothing marked a session as a coordinator: `LANES.md` exists in every checkout of a project that ever coordinated, also in a worker's or a human's other session.

**Options considered:**
- A) `LANES.md` (or `standing/`) in the resolved `.ytstack` means coordinate mode.
- B) The `coordinate` preamble writes a marker per session out of tree; the hooks act only with it.
- C) Parse the transcript for a `ytstack:coordinate` invocation.

**Chose:** B. The marker is `<session home>/<session id>/coordinate` with the resolved `.ytstack` on its first line. `<session home>` is `${XDG_STATE_HOME:-~/.local/state}/ytstack/sessions` (`yt_session_home`), not `yt_state_base`: Claude Code exports `CLAUDE_PLUGIN_DATA` to hooks only, so a skill preamble in the Bash tool and a hook would resolve two different directories. The session id in the preamble is `CLAUDE_CODE_SESSION_ID`, the hook payload's `session_id` in the hooks.

**Reason:** A marker is written exactly by the session that runs the skill and survives compactions and worktree moves (keyed by the session only, like `plugin-version`). A would flag prompts of every session in the project. C is slow, host-specific and undocumented.

**How to apply:**
- `hooks/standing-prompt` (UserPromptSubmit) and the standing part of `hooks/stop` end at once without the marker; they read files and local git only, never the network and never a command of an entry.
- The prompt counter (`prompts`) and the flags (`standing-flags`) live beside the marker; `hooks/stop` writes `standing-stop`, so the same flagged prompts block once.
- Claude Code only. Codex registers no ytstack UserPromptSubmit hook and a Kimi shell has no session id; both keep the skill's Step 9 and the preamble's prompt-gap line without the hooks.

**Supersedes:** None. Narrows "2026-11-15: SessionStart stays read-only ...": session state a skill writes goes under the session home, not under `yt_state_base`.

## 2026-11-15: Standing entries end by `until`, `until-condition` or `until-check` and are closed by an entry of `kind: end`; their commands run only in `ytstack-standing list` (issues #73, #74)

**Context:** Many standing instructions are temporary ("until the load test ends", "while the v2 plan runs"). They could only be written as prose and ended when someone remembered. Issue #74 adds a compliance self-check (`check:`), a SessionStart injection of the active entries and the entries in lane briefs. Both kinds of command come from a file in the repository.

**Options considered:**
- A) `until` only; conditions stay prose.
- B) `until`, `until-condition` and `until-check` (a command, exit 0 = ended), plus `check` (non-zero = not kept); an ended entry is closed by a new entry.
- C) As B, but an ended entry is edited or deleted.

**Chose:** B. `until-check` may stand alone: the command is then the condition; with `until-condition` the sentence says for people what it checks. The closing entry has `kind: end` and `supersedes: <entry>` and is no instruction itself; `ytstack-standing end` writes it. The commands run only in `ytstack-standing list`, which the `coordinate` preamble calls: `bash -c` in the checkout's toplevel, stdin closed, `YTSTACK_STANDING_TIMEOUT` seconds each (default 5), at most ten per call; a timeout counts as not ended and as a failed check. No hook runs them; `session-start` and the readers apply only a passed `until`. Roles in the scope (coordinator, lane, reviewer as whole words) filter the injection and the briefs; a scope naming no role is for everyone.

**Reason:** Append-only stays (C would lose why and when an instruction ended). A hook runs on every prompt or session start under a seconds budget; a repository command there would slow every session and run before a person looked at it. In the coordinate preamble the session is already working in the repository, and a change under `standing/` goes to a person (`bin/ytstack-risk floor`).

**How to apply:**
- `bin/ytstack-check --standing` validates the keys: `until` a real ISO UTC time after `given`, the three others one line, `kind` only `end`, an `end` names its entry.
- `bin/ytstack-standing add` writes by default in its own worktree on `standing/<YYYYMMDD>`, commits, pushes and opens or updates one pull request per UTC day (`ytstack-pr-watch create` when the PR watch is on); `--here` and user scope write in place.
- The SessionStart injection keeps at most six lines and is the last block cut for the 10,000-character cap, after the Next action, the factory tools and the minimal-code line.

**Supersedes:** None. Extends "2026-11-14: Standing instructions are one file per entry in `.ytstack/standing/` ..." with optional keys and a closing entry.

## 2026-11-15: In coordinate mode the operating path is injected and checked by hooks that warn; a lint repeated in three sessions blocks once (issue #76)

**Context:** A 12-hour coordinator run used almost none of ytstack's tooling: hand-written briefs, a `LANES.md` stale for a day, instructions in private memory, no release watch, a STATE pointer two milestones behind with a lint nobody acted on. Every rule was in the skill text; nothing on the path failed when it was skipped. Issue #75's correction names the same bypass of `ytstack-brief render`.

**Options considered:**
- A) More skill text.
- B) In coordinate mode (the session marker): an ordered operating checklist injected at SessionStart and printed by the preamble; a PreToolUse hook on `Agent`, `Task`, `SendMessage` that warns on a prompt without a rendered brief; a Stop check for `LANES.md` and the STATE pointer that warns, and blocks once when the same finding came in N sessions in a row.
- C) As B, but the PreToolUse hook denies a dispatch without a brief.

**Chose:** B with N = 3 (`YT_LINT_STREAK_N`). The checklist lives once, between markers in `docs/ux/coordinator-format.md`; the hook and the preamble read it from there and a test compares them. The marker of a rendered brief is its first line `# Brief: <ref> (<project>)`, which `ytstack-brief render` already prints; no new line was added. `LANES.md` counts as stale when it changed more than five minutes before the newest dispatch or report of the session (a claim comes just before its dispatch). The counter is per repository out of tree (`<state base>/repos/<repo key>/coordinate-lints`); a session counts once, a clean stop resets it.

**Reason:** A checklist that arrives with every compaction is read when the skill text is not. A deny (C) would also hit a research or lookup agent, which needs no brief; a warning on the path is enough to make the bypass visible. Blocking at once on a lint would stop a session for a pointer the human may want to keep for a day; three sessions in a row is a pattern, not a moment.

**How to apply:** The hooks act only with the coordinate marker and read local files only. A coordinate session gets the checklist instead of the minimal-code line. Codex and Kimi are not covered (no ytstack hook on their subagent tools; no session id in a Kimi shell).

**Supersedes:** None. Extends "2026-11-15: Coordinate mode is a session marker ..." with three more hook parts.

## 2026-11-15: A standing entry's command runs only when the entry is merged; pending means this machine's standing branches (review of PR #87)

**Context:** The independent review of PR #87 found that `ytstack-standing list` read every `origin/standing/*` branch and ran the `check` and `until-check` of its entries: anyone who can push a branch got code execution in the coordinator's preamble. It also found that pending entries never reached the SessionStart injection or the briefs, and that an entry on an earlier day's unmerged branch could not be superseded.

**Options considered:**
- A) Run the commands of every entry the list shows, as before.
- B) Run commands only for a working-tree entry whose file is the one on the default branch; read pending entries only from local `standing/*` branches and their upstreams, as text; start a new day's branch from the newest pending one.
- C) Never run commands.

**Chose:** B. Pending entries are shown (marked) in `list`, the SessionStart injection and the briefs, never executed (`[check not run: pending]`, `[check not run: not on <branch>]`). Outside a repository and in one without a commit the files are the user's own and run. A remote branch no local branch tracks is not read at all.

**Reason:** "Merged" is the one state in which a person looked at the command (a change under `standing/` goes to a person). C would drop the compliance check of issue #74. Starting the new day from the pending branch keeps one pull request per day and lets `end`/`--supersedes` see what waits; the cost is that a day's pull request carries the earlier day's commits until that one merges.

**Supersedes:** Narrows "2026-11-15: Standing entries end by `until` ...": the commands run only for merged entries.
4 changes: 2 additions & 2 deletions .ytstack/spec/artifacts.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ The `.ytstack/` artifact model: the Markdown files that hold a project's memory
| `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` 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 |
| `standing/<YYYYMMDDTHHMMZ>-<slug>.md`, `STANDING.md` | `coordinate` through `bin/ytstack-standing add`, when the human gives an instruction that holds beyond the task: a new file with `given`, `scope`, `supersedes` and optionally `until`, `until-condition`, `until-check`, `check` (`docs/ux/coordinator-format.md`), by default on the day's `standing/<YYYYMMDD>` branch and pull request; appended to `STANDING.md` only where no `standing/` exists | an entry is never edited; a newer one supersedes it by name, an ended one is closed by an entry of `kind: end` (`ytstack-standing end`), readers skip both and an entry whose `until` passed; `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 |
| `retro/LANES-<date>.md` | `lane-retro`, with a `## Upstream` section like the retro's | appended on a second run of the same day |
| `archive/<date>/`, `archive/INDEX.md`, `RECONCILE-<date>.md` | `reconcile` | -- |
Expand Down Expand Up @@ -190,7 +190,7 @@ Automatic handoffs and the session journal are not artifacts. `hooks/pre-compact
- DECISIONS.md -- "2026-11-13: Verification, review and orchestration work are bounded like code (M023, issue #35)" (the `Runs:` line, `## Gates`, `## Review`, the evidence fields of a summary)
- DECISIONS.md -- "2026-11-13: `STATE.md` is a pointer with a size bound; history leaves it through `reconcile`, a closed milestone is folded into the spec (M022-S03)"; "2026-11-15: A plan outside `.ytstack/` is detected by a script and mapped by the agent, after one question (M031-S05, issue #54)" (the external plan class)
- DECISIONS.md -- "2026-11-13: Coordinator mode keeps lanes, questions and standing instructions in files and reads host facts fresh (M024, issue #34)" (the lanes table is not part of `STATE.md`, which narrows the proposal in issue #34)
- DECISIONS.md -- "2026-11-14: Standing instructions are one file per entry in `.ytstack/standing/`; `STANDING.md` stays valid (issue #57)"
- DECISIONS.md -- "2026-11-14: Standing instructions are one file per entry in `.ytstack/standing/`; `STANDING.md` stays valid (issue #57)", extended by "2026-11-15: Standing entries end by `until`, `until-condition` or `until-check` and are closed by an entry of `kind: end`; their commands run only in `ytstack-standing list` (issues #73, #74)"
- DECISIONS.md -- "2026-04-23: `.ytstack/` location is user-chosen (project vs user vs both)"; "2026-11-15: New artifacts follow the directory a milestone already lives in (issue #70)"
- DECISIONS.md -- "2026-05-31: active_slice is plan-task-owned and team-member-guarded (M012 / issue #21-RC1)"
- DECISIONS.md -- "2026-05-31: post-tool-use-bash is stub-once; summarize-task owns commit-to-task linking (M015 / issue #22)"
Expand Down
Loading
Loading