diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json index af658a5e..625c965d 100644 --- a/.claude-plugin/marketplace.json +++ b/.claude-plugin/marketplace.json @@ -9,7 +9,7 @@ { "name": "ytstack", "description": "Claude Code plugin. Project-OS artifact discipline + curated superpowers and gstack skill wrappers + Agent Teams orchestration.", - "version": "0.10.0", + "version": "0.11.0", "source": "./", "author": { "name": "Yesterday", diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json index f6e6b13a..c23e7460 100644 --- a/.claude-plugin/plugin.json +++ b/.claude-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "ytstack", - "version": "0.10.0", + "version": "0.11.0", "description": "BUNDLE: Yesterday Technologies Stack -- opinionated software-development OS for AI agents. Curated superpowers + gstack skills plus Project-OS artifact discipline (PROJECT.md, DECISIONS.md, KNOWLEDGE.md, milestone/slice/task hierarchy), orchestrated via SessionStart hooks.", "author": { "name": "Yesterday", diff --git a/.codex-plugin/plugin.json b/.codex-plugin/plugin.json index ab95ebf0..48b6cd77 100644 --- a/.codex-plugin/plugin.json +++ b/.codex-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "ytstack", - "version": "0.10.0", + "version": "0.11.0", "description": "Project memory, milestone planning, and curated gstack and superpowers workflows for AI coding agents.", "author": { "name": "Yesterday", diff --git a/.kimi-plugin/plugin.json b/.kimi-plugin/plugin.json index 5b118b53..fd14eee9 100644 --- a/.kimi-plugin/plugin.json +++ b/.kimi-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "ytstack", - "version": "0.10.0", + "version": "0.11.0", "description": "BUNDLE: Yesterday Technologies Stack -- opinionated software-development OS for AI agents. Curated superpowers + gstack skills plus Project-OS artifact discipline (PROJECT.md, DECISIONS.md, KNOWLEDGE.md, milestone/slice/task hierarchy), orchestrated via SessionStart hooks.", "author": { "name": "Yesterday", diff --git a/.ytstack/KNOWLEDGE.md b/.ytstack/KNOWLEDGE.md index c36853c4..c06f74ea 100644 --- a/.ytstack/KNOWLEDGE.md +++ b/.ytstack/KNOWLEDGE.md @@ -112,6 +112,8 @@ Patterns, rules, and lessons learned while building ytstack. This file is read b ## Eval runs (`claude plugin eval`) +- **2026-11-15, release 0.11.0 (M031, M032, M033), one case per invocation, `--ablation none --no-publish`:** 1.00 on the first run: `coordinator-resume` ($0.38), `risk-route` ($1.07), `reconcile` ($0.35), `adopt-brownfield` ($0.81), `lesson` ($0.48), `fresh-bugfix` ($0.53), `incident` ($0.52), `signal-intake` ($0.40), `code-review` ($0.76). `external-plan` did not load (an unquoted `: ` in `expected_outcome`); fixed with `>-`, and `tests/evals-frontmatter.test.sh` now lints every case's frontmatter; rerun 1.00 ($0.54). `upstream-suggest` 0.75 on the first run (the final message lacked the draft path), 1.00 on the rerun ($0.57); `upstream-file` 0.80 (no `ytstack-upstream mode` call), then an API weekly-limit abort scored 0 without grading, then 1.00 ($0.57). One run each: the two upstream cases are not stable yet, a known gap of the directive-only channel (no skill fires). Total about $8. + - **2026-11-15, release 0.10.0 (`coordinate` 0.3.0, `signal-intake` 0.1.1, `finish-lane`, `handover-step`, `review-lessons` text only), `--ablation none --no-publish`:** `coordinator-resume` 1/1, score 1.00, $0.38; `signal-intake` 1/1, score 1.00, $0.49. A repeated `--case` flag ran only the last case: run one case per invocation. No case covers `finish-lane`, `handover-step` or `review-lessons`; the standing directory is covered by the shell suites (git-ctx, ytstack-check, ytstack-risk, skill-preambles). - **2026-11-14, release 0.9.2 (`coordinate` 0.2.2), `--case coordinator-resume --ablation none --no-publish`:** 1/1, score 1.00, $0.44, 169 s. Same coverage limit as for 0.9.1: the session spelling is covered by `tests/pr_watch/test_session_spelling.py`. diff --git a/.ytstack/ROADMAP.md b/.ytstack/ROADMAP.md index a55adf47..5c22ba4a 100644 --- a/.ytstack/ROADMAP.md +++ b/.ytstack/ROADMAP.md @@ -48,9 +48,9 @@ Progress legend: `[ ]` todo, `[~]` in progress, `[x]` done, `[-]` skipped. | M028 | Ship the six gstack skills as ytstack's own adaptations (DECISIONS 2026-11-14) -- self-contained `office-hours`, `plan-ceo-review`, `plan-eng-review`, `retro`, `ship`, `document-release` (no gstack install, nothing in `~/.claude/skills/`), `metadata.upstream` baselines, `bin/ytstack-gstack-diff` + release-checklist step, synced to gstack v1.99.3.0. Done 2026-11-14 (3 slices, 11 tasks); released in 0.6.0 (PRs #39, #40). M022-M024 merged with #37; M025-M027 are carried by PR #38. | **done** | 11 | 11 | | M029 | Optional PR watch (DECISIONS 2026-11-14 "PR watch ships inside ytstack as an optional, opt-in tool") -- engine in `tools/pr-watch/`, `bin/ytstack-pr-watch` (enable/disable, install-worker, migrate), Claude Code and Codex hooks that exit at once unless `pr_watch=on`, `docs/pr-watch.md`. Done 2026-11-14 (3 slices); released in 0.8.0 (PR #45), fixes in 0.8.1 and 0.8.2. | **done** | 3 | 3 | | M030 | Review lessons from bot findings -- `bin/ytstack-review-escapes` (bot thread resolution vs. own-role findings), `## Own reviewers` in `REVIEW.md`, escapes as signals of `kind: review`, skill `review-lessons` (role-file proposals for a person), escape rate in `retro`. Pilot and adoption: Yesterday-AI/context-mcp#1650. Done 2026-11-14 (3 slices); released in 0.9.0 (PR #51). | **done** | 9 | 9 | -| M031 | Factory tools explicit (issue #54 rest, #61 leftovers) -- `coordinate` "Factory tools" step and one-step rotation, `ytstack-risk route` reads the review round from the host, SessionStart/upkeep say which tool is off and when the plugin changed under the session, QUICKSTART setup guide and upgrade checklist, `reconcile` detects external plans. Done 2026-11-15 (5 slices, parallel workers); unreleased. | **done** | 15 | 15 | -| M032 | Incident to lesson loop (issue #53) -- incident and lesson records with class, target and count, a shared lesson step called by `incident`, `systematic-debugging`, `finish-lane` and `coordinate`, open lessons in status and frontier, repeats in `retro`. Done 2026-11-15 (3 slices); unreleased. | **done** | 6 | 6 | -| M033 | Upstream feedback channel (issue #55) -- `upstream_feedback: suggest / file / off`, the channel in `using-ytstack`, agent rules (search first, evidence, no personal data), "Upstream" section in `retro` and `lane-retro`. Done 2026-11-15 (1 slice); unreleased. | **done** | 4 | 4 | +| M031 | Factory tools explicit (issue #54 rest, #61 leftovers) -- `coordinate` "Factory tools" step and one-step rotation, `ytstack-risk route` reads the review round from the host, SessionStart/upkeep say which tool is off and when the plugin changed under the session, QUICKSTART setup guide and upgrade checklist, `reconcile` detects external plans. Done 2026-11-15 (5 slices, parallel workers); released in 0.11.0 (PR #66). | **done** | 15 | 15 | +| M032 | Incident to lesson loop (issue #53) -- incident and lesson records with class, target and count, a shared lesson step called by `incident`, `systematic-debugging`, `finish-lane` and `coordinate`, open lessons in status and frontier, repeats in `retro`. Done 2026-11-15 (3 slices); released in 0.11.0 (PR #67). | **done** | 6 | 6 | +| M033 | Upstream feedback channel (issue #55) -- `upstream_feedback: suggest / file / off`, the channel in `using-ytstack`, agent rules (search first, evidence, no personal data), "Upstream" section in `retro` and `lane-retro`. Done 2026-11-15 (1 slice); released in 0.11.0 (PR #67). | **done** | 4 | 4 | **Total:** 39 tasks across M001-M009, 37 done (95%). 2 deferred to user action (git init + push, GitHub repo creation). M010 done (6/6, 2026-11-07); M011 task count pending milestone planning. diff --git a/.ytstack/STATE.md b/.ytstack/STATE.md index dc8c403d..e533de1a 100644 --- a/.ytstack/STATE.md +++ b/.ytstack/STATE.md @@ -1,7 +1,7 @@ --- project: ytstack slug: ytstack -last_updated: 2026-11-15T04:00:00Z +last_updated: 2026-11-15T06:00:00Z current_milestone: none active_slice: none active_task: none @@ -9,6 +9,8 @@ active_task: none # State +**Status (2026-11-15, 0.11.0):** Release of M031 (PR #66, `5654d39`), M032 and M033 (PR #67, `763aed9`). Both PRs got an independent adversarial review before merge (6 and 8 findings, all fixed with tests). Issues #53, #54, #55, #61 are covered; #57 was in 0.10.0. + **Status (2026-11-15, M032 + M033):** M032 DONE (3/3 slices, 6 tasks: `kind: lesson` in the signals ledger, skill `ytstack:lesson` called by `incident`, `systematic-debugging`, `finish-lane`, `coordinate`; lesson lanes in the frontier, open lessons in `coordinate` 0.5.0, repeats in `retro`). M033 DONE (1/1 slice, 4 tasks: `upstream_feedback`, `bin/ytstack-upstream`, `docs/ux/upstream-feedback.md`, "Upstream" in `retro`/`lane-retro`, `lesson` routes ytstack lessons upstream). Both on `m032-m033` on top of M031 (PR #66). Not run: evals `lesson`, `upstream-suggest`, `upstream-file`, `fresh-bugfix` (description of `systematic-debugging` changed). Next: merge #66, then this PR, release. **Status (2026-11-15, M031):** M031 DONE (5/5 slices, 15 tasks, built by parallel workers on `m031-s0N-*` branches and merged into `plan-m031`): `coordinate` 0.4.0 Step 7 "Run the factory tools" and one-step rotation with `ytstack-pr-watch handover`; `ytstack-risk route --pr` reads the round from the review on the host; session-start factory-tool notices and the `version-notice` prompt hook; QUICKSTART setup guide and upgrade checklist; `bin/ytstack-plans` with the external-plan question in `reconcile` and `adopt-brownfield`. Not run: evals `coordinator-resume`, `risk-route`, `external-plan`, `reconcile`, `adopt-brownfield` (at release). M032 (lesson loop, #53) in progress on `m032-lesson-loop`; M033 (#55) after it. diff --git a/.ytstack/spec/checks-and-evals.md b/.ytstack/spec/checks-and-evals.md index 6bf9cbf1..6a50ae0a 100644 --- a/.ytstack/spec/checks-and-evals.md +++ b/.ytstack/spec/checks-and-evals.md @@ -161,7 +161,7 @@ Everything that tells a contributor whether a change is acceptable: the static c - `bin/ytstack-check` -- the checker; its docstring names the flags and exit codes. `bin/ytstack-spec` (the spec tool) and `bin/ytstack-brief` (brief renderer and report check), pinned by `tests/ytstack-spec.test.sh` and `tests/ytstack-brief.test.sh`. - `bin/ytstack-frontier`, `bin/ytstack-questions`, `bin/ytstack-finish-lane`, `bin/ytstack-handover`, `bin/ytstack-watch` -- the coordinator scripts, each with `tests/.test.sh`. -- `bin/ytstack-risk`, `bin/ytstack-review-escapes`, `bin/ytstack-runtime`, `bin/ytstack-signals`, `bin/ytstack-upkeep`, `bin/ytstack-plans`, `bin/ytstack-upstream`, each with `tests/.test.sh` (the live cases of `ytstack-runtime` need `python3` and are skipped without it). +- `bin/ytstack-risk`, `bin/ytstack-review-escapes`, `bin/ytstack-runtime`, `bin/ytstack-signals`, `bin/ytstack-upkeep`, `bin/ytstack-plans`, `bin/ytstack-upstream`, each with `tests/.test.sh` (the live cases of `ytstack-runtime` need `python3` and are skipped without it). Suites under `pipefail` read pipes to the end (`grep_q`, not `grep -q`: SIGPIPE). `tests/evals-frontmatter.test.sh` lints every `evals/*/prompt.md` frontmatter for plain scalars holding `: ` or ` #`, which keep a case from loading. - `tests/run-all.sh` -- the suite runner. `tests/*.test.sh` -- the suites. `tests/codex_plugin_test.py`, `kimi_plugin_test.py`, `kimi_lifecycle_test.py`, `kimi_live_test.py` -- the Python host tests. `evals//` -- the eval cases. `evals/README.md` -- how to run them. - `.github/workflows/ci.yml`, `plugin-check.yml`, `secret-scan.yml`. - `docs/ux/skill-structure.md`, `docs/ux/agent-structure.md`, `docs/ux/writing-style.md` -- the contracts the checker enforces in part. diff --git a/.ytstack/spec/host-adapters.md b/.ytstack/spec/host-adapters.md index a71e44b6..f4d47502 100644 --- a/.ytstack/spec/host-adapters.md +++ b/.ytstack/spec/host-adapters.md @@ -14,7 +14,7 @@ paths: sources: - docs/codex.md - docs/kimi.md -verified_at: 9d8b398 +verified_at: fd19fca --- # host-adapters diff --git a/CHANGELOG.md b/CHANGELOG.md index 8280d83c..43e54aa0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.11.0] - 2026-11-15 + ### Added - **Every incident ends with a lesson** (issue #53): the new skill @@ -947,6 +949,7 @@ model). Research basis: `docs/research/2026-11-07-modernisierung-best-practices. `.ytstack/` artifact model (PROJECT / DECISIONS / KNOWLEDGE / STATE / milestone-slice-task hierarchy). +[0.11.0]: https://github.com/Yesterday-AI/ytstack/compare/v0.10.0...v0.11.0 [0.10.0]: https://github.com/Yesterday-AI/ytstack/compare/v0.9.2...v0.10.0 [0.9.2]: https://github.com/Yesterday-AI/ytstack/compare/v0.9.1...v0.9.2 [0.9.1]: https://github.com/Yesterday-AI/ytstack/compare/v0.9.0...v0.9.1 diff --git a/QUICKSTART.md b/QUICKSTART.md index c8ccac30..dfeaf639 100644 --- a/QUICKSTART.md +++ b/QUICKSTART.md @@ -527,7 +527,7 @@ After every update: Then, by the version you come from (newest first; coming from an older one, do every block down to yours): -- **From 0.10.x** (the release after 0.10.0): nothing to migrate. A coordinator that rotates hands its PR watches to the successor with `bin/ytstack-pr-watch handover --from claude:`. `finish-lane` and `code-review` now post the review record lines in the review body on the pull request, and `ytstack-risk route --pr ` reads them from there, so a repository where agents may not write in the main checkout can route `unattended`. A plan under `plans/` shows up in `bin/ytstack-plans scan`; `reconcile` offers to map it (step 5 above). +- **From 0.10.x** (to 0.11.0): nothing to migrate. Incident records closed before 0.11.0 have no `lesson:` line; `ytstack-signals check` lists them as warnings, not failures. Set `upstream_feedback` in `PREFERENCES.md` (or `~/.ytstack/config`) only if you want something other than `suggest`. A coordinator that rotates hands its PR watches to the successor with `bin/ytstack-pr-watch handover --from claude:`. `finish-lane` and `code-review` now post the review record lines in the review body on the pull request, and `ytstack-risk route --pr ` reads them from there, so a repository where agents may not write in the main checkout can route `unattended`. A plan under `plans/` shows up in `bin/ytstack-plans scan`; `reconcile` offers to map it (step 5 above). - **From 0.9.x:** standing instructions can live as one file each in `.ytstack/standing/` (0.10.0). `STANDING.md` keeps working; nothing to move. After the first entry: `bin/ytstack-check --standing`. - **From 0.9.0 or 0.9.1:** a Claude Code session that registered with its bare id had its PR watch notices stored for a Codex thread and never saw them. Run one `register` in that session (a coordinator: `register --repo OWNER/REPO --all-open`, without `--session`); it moves those watches and their notices (0.9.2). - **From 0.9.0 or older:** a session that ran when the PR watch was switched on registered nothing. Restart it; the coordinator then runs `register --repo OWNER/REPO --all-open` once (0.9.1). diff --git a/README.md b/README.md index ac617d28..1c9f463f 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@

License ci - version + version Claude Code Codex Kimi Code @@ -410,7 +410,7 @@ Every hook and skill preamble resolves the checkout from where the agent actuall ## Status -**v0.10.0 -- shipping, actively dogfooded.** 0.10.0 keeps standing instructions as one file each in `.ytstack/standing/`, so parallel pull requests stop conflicting over them, and keeps the PR watch readable under load: skipped jobs no longer count as work, a push of your own shows `head moved` until the next read, the status block appears only when it changed, and `review-lessons` is suggested only after a review-bot finding. 0.9.2 makes PR watch notices reach a Claude Code session that registered with its id but without the `claude:` prefix, and moves its stuck watches back on the next `register`. 0.9.1 lets a coordinating session register every open pull request of a repository that no other session watches yet (`ytstack-pr-watch register --all-open`), including those opened while it ran without the PR watch hooks; PRs another session owns are skipped and named. 0.9.0 adds Kimi Code host support (#49) and review lessons: a project's own review roles learn from the review-bot findings they missed (`ytstack:review-lessons`, `bin/ytstack-review-escapes`). 0.8.2 makes the PR watch worker skip a `gh` shim from asdf or mise for a standalone `gh` later on `PATH`, and refuse with a clear message when only a shim exists (launchd cannot run shims). 0.8.1 makes the PR watch cheap on a migrated state with many closed PRs. 0.8.0 adds the optional PR watch (`bin/ytstack-pr-watch`, `docs/pr-watch.md`): agents hear about red CI, unresolved bot threads and merge conflicts without polling, and the worker leaves a reserve of the GitHub API quota to them. 0.7.0 added the technical spec (`.ytstack/spec/`, #36), bounded work (#35), coordinator mode (#34), the risk gate (whether a person looks at a change is decided per change, with a visual review for interface changes), the product per worktree, the release watch, signal intake and incidents. Coordinator mode, the risk route and the release watch have run only against a stand-in for `gh` and fixture targets so far. 0.6.0 shipped the six gstack-derived skills as ytstack's own adaptations (no gstack install, nothing in `~/.claude/skills/`) and added the upstream sync check `bin/ytstack-gstack-diff`. 0.5.0 added the status line segment (`bin/ytstack-status`, #31). 0.2.0 made hooks and skills worktree-safe and moved volatile session state out of the repository (issues #24, #26, #27); 0.3.0 pulled superpowers to v7.0.2 and turned gstack into an installed, tag-pinned dependency (#25); 0.4.0 added brownfield import (`adopt-brownfield`, #18), ceremony scaling (quick lane, reconcile, minimal-code guard, STATE lint), the 2026 skill bar (`metadata:` frontmatter, trigger-only descriptions measured by `evals/`, CI), six lifecycle skills (`code-review`, `finish-branch`, `grill`, `retro`, `ship`, `document-release`) and the worktree-subagent execution model. ytstack tracks its own development in `.ytstack/`; see `.ytstack/ROADMAP.md` for what is next. +**v0.11.0 -- shipping, actively dogfooded.** 0.11.0 makes the factory tools explicit: `coordinate` runs the risk route, PR watch, release watch, signals and review lessons as one step and rotates in one step; the risk route reads the review round from the pull request; a session hears which tool is off and when the plugin changed under it; QUICKSTART has a setup guide; plans outside `.ytstack/` can be mapped. Every incident now ends with a lesson (`ytstack:lesson`, a check first), and feedback about ytstack itself has a channel (`upstream_feedback`). 0.10.0 keeps standing instructions as one file each in `.ytstack/standing/`, so parallel pull requests stop conflicting over them, and keeps the PR watch readable under load: skipped jobs no longer count as work, a push of your own shows `head moved` until the next read, the status block appears only when it changed, and `review-lessons` is suggested only after a review-bot finding. 0.9.2 makes PR watch notices reach a Claude Code session that registered with its id but without the `claude:` prefix, and moves its stuck watches back on the next `register`. 0.9.1 lets a coordinating session register every open pull request of a repository that no other session watches yet (`ytstack-pr-watch register --all-open`), including those opened while it ran without the PR watch hooks; PRs another session owns are skipped and named. 0.9.0 adds Kimi Code host support (#49) and review lessons: a project's own review roles learn from the review-bot findings they missed (`ytstack:review-lessons`, `bin/ytstack-review-escapes`). 0.8.2 makes the PR watch worker skip a `gh` shim from asdf or mise for a standalone `gh` later on `PATH`, and refuse with a clear message when only a shim exists (launchd cannot run shims). 0.8.1 makes the PR watch cheap on a migrated state with many closed PRs. 0.8.0 adds the optional PR watch (`bin/ytstack-pr-watch`, `docs/pr-watch.md`): agents hear about red CI, unresolved bot threads and merge conflicts without polling, and the worker leaves a reserve of the GitHub API quota to them. 0.7.0 added the technical spec (`.ytstack/spec/`, #36), bounded work (#35), coordinator mode (#34), the risk gate (whether a person looks at a change is decided per change, with a visual review for interface changes), the product per worktree, the release watch, signal intake and incidents. Coordinator mode, the risk route and the release watch have run only against a stand-in for `gh` and fixture targets so far. 0.6.0 shipped the six gstack-derived skills as ytstack's own adaptations (no gstack install, nothing in `~/.claude/skills/`) and added the upstream sync check `bin/ytstack-gstack-diff`. 0.5.0 added the status line segment (`bin/ytstack-status`, #31). 0.2.0 made hooks and skills worktree-safe and moved volatile session state out of the repository (issues #24, #26, #27); 0.3.0 pulled superpowers to v7.0.2 and turned gstack into an installed, tag-pinned dependency (#25); 0.4.0 added brownfield import (`adopt-brownfield`, #18), ceremony scaling (quick lane, reconcile, minimal-code guard, STATE lint), the 2026 skill bar (`metadata:` frontmatter, trigger-only descriptions measured by `evals/`, CI), six lifecycle skills (`code-review`, `finish-branch`, `grill`, `retro`, `ship`, `document-release`) and the worktree-subagent execution model. ytstack tracks its own development in `.ytstack/`; see `.ytstack/ROADMAP.md` for what is next. Ships: diff --git a/evals/external-plan/prompt.md b/evals/external-plan/prompt.md index 67e98d92..04aa6f61 100644 --- a/evals/external-plan/prompt.md +++ b/evals/external-plan/prompt.md @@ -4,7 +4,8 @@ max_turns: 40 timeout_seconds: 900 allowed_tools: [Read, Glob, Grep, Skill, TodoWrite, Bash, Write, Edit] append_system_prompt: "Headless evaluation run, no human available. When a skill says to ask the user (AskUserQuestion), do not ask: take the option marked RECOMMENDATION or infer the answer from the prompt, then continue. End with one line listing the files you wrote." -expected_outcome: The reconcile skill fires, its preamble reports the plan in plans/ (one plan file with 9 open board rows plus 2 checklist items, the retro file has no open rows), and the agent takes option A. It writes M001-CONTEXT.md, M001-ROADMAP.md with one slice per open board row (EXP-03 to EXP-11) and a slice plan per slice whose Source line points at plans/2026-11-01-export-v2.md with the row id; the EXP-04 slice is blocked by the EXP-03 slice and no slice is blocked by the done EXP-02. PREFERENCES.md records `external_plans: plans mapped `. Nothing under plans/ changes. ytstack-frontier list --milestone M001 lists the slices. +expected_outcome: >- + The reconcile skill fires, its preamble reports the plan in plans/ (one plan file with 9 open board rows plus 2 checklist items, the retro file has no open rows), and the agent takes option A. It writes M001-CONTEXT.md, M001-ROADMAP.md with one slice per open board row (EXP-03 to EXP-11) and a slice plan per slice whose Source line points at plans/2026-11-01-export-v2.md with the row id; the EXP-04 slice is blocked by the EXP-03 slice and no slice is blocked by the done EXP-02. PREFERENCES.md records `external_plans: plans mapped `. Nothing under plans/ changes. ytstack-frontier list --milestone M001 lists the slices. --- Our export v2 plan lives in plans/ and the lane list (ytstack-frontier) shows nothing for it, so we track lanes by hand. Clean up our ytstack setup so the open work shows up there. Do not touch the plan files themselves. diff --git a/tests/evals-frontmatter.test.sh b/tests/evals-frontmatter.test.sh new file mode 100644 index 00000000..0390e086 --- /dev/null +++ b/tests/evals-frontmatter.test.sh @@ -0,0 +1,43 @@ +#!/usr/bin/env bash +# Every evals//prompt.md frontmatter loads as YAML in `claude plugin eval`. +# A plain (unquoted) scalar must not hold ": " or " #": YAML reads the first as +# a new mapping and the second as a comment. 0.11.0 shipped `external-plan` with +# such a line and the case did not load at all. Without PyYAML in CI, this +# checks the one rule that broke, line by line. +ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +pass=0; fail=0 +ok() { pass=$((pass + 1)); echo " ok - $1"; } +bad() { fail=$((fail + 1)); echo " FAIL - $1"; [ -n "${2:-}" ] && echo " $2"; } + +lint() { + awk ' + NR == 1 && $0 != "---" { exit } + NR > 1 && $0 == "---" { exit } + NR > 1 && /^[A-Za-z_][A-Za-z0-9_]*: / { + v = $0; sub(/^[A-Za-z_][A-Za-z0-9_]*: /, "", v) + c = substr(v, 1, 1) + if (c == "\"" || c == "\x27" || c == "[" || c == "{" || c == ">" || c == "|") next + if (index(v, ": ") || index(v, " #")) print FILENAME ":" NR ": plain scalar holds \": \" or \" #\"; quote it or use >-" + } + ' "$1" +} + +echo "# eval case frontmatter" +n=0 +for f in "$ROOT"/evals/*/prompt.md; do + [ -f "$f" ] || continue + n=$((n + 1)) + out=$(lint "$f") + if [ -z "$out" ]; then ok "${f#"$ROOT"/}"; else bad "${f#"$ROOT"/}" "$out"; fi +done +[ "$n" -gt 0 ] && ok "found $n cases" || bad "no eval cases found" + +# The rule itself catches the 0.11.0 defect. +T=$(mktemp -d); trap 'rm -rf "$T"' EXIT +printf -- '---\nruns: 1\nexpected_outcome: it writes `external_plans: plans mapped`\n---\nprompt\n' > "$T/prompt.md" +[ -n "$(lint "$T/prompt.md")" ] && ok "a plain scalar with ': ' is flagged" || bad "a plain scalar with ': ' is flagged" +printf -- '---\nexpected_outcome: >-\n it writes `external_plans: plans mapped`\n---\n' > "$T/prompt.md" +[ -z "$(lint "$T/prompt.md")" ] && ok "a folded scalar passes" || bad "a folded scalar passes" + +echo "$pass passed, $fail failed" +[ "$fail" -eq 0 ] diff --git a/tests/skill-preambles.test.sh b/tests/skill-preambles.test.sh index 9977bf1c..ee003745 100644 --- a/tests/skill-preambles.test.sh +++ b/tests/skill-preambles.test.sh @@ -14,6 +14,10 @@ # Run: /bin/bash tests/skill-preambles.test.sh (exit 0 = all pass) set -uo pipefail +# grep -q at the end of a pipe stops reading at the first match; the writer then +# dies of SIGPIPE and pipefail fails the pipe (reliably on Linux, by chance on +# macOS). grep_q reads its input to the end. +grep_q() { grep "$@" >/dev/null; } ROOT="$(cd "$(dirname "$0")/.." && pwd -P)" PASS=0; FAIL=0 @@ -322,11 +326,11 @@ STANDING_ENTRIES_END" has "$s: two open lessons, one of each" "$OUT" "LESSONS: 2 open (1 proposals, 1 checks to build)" has "$s: and listed" "$OUT" "F002 open process asked-twice 1 - proposal:Q001" rm -rf "$WT/.ytstack/signals" - awk '/^\*\*Step 5 --/ { p = 1 } /^\*\*Step 6 --/ { p = 0 } p' "$ROOT/skills/$s/SKILL.md" | grep -qF -- '--lesson F###' \ + awk '/^\*\*Step 5 --/ { p = 1 } /^\*\*Step 6 --/ { p = 0 } p' "$ROOT/skills/$s/SKILL.md" | grep_q -F -- '--lesson F###' \ && ok "$s: Step 5 renders the brief of a lesson lane" || bad "$s: Step 5 renders the brief of a lesson lane" - awk '/^\*\*Step 8 --/ { p = 1 } /^\*\*Step 9 --/ { p = 0 } p' "$ROOT/skills/$s/SKILL.md" | grep -qF 'daily question' \ + awk '/^\*\*Step 8 --/ { p = 1 } /^\*\*Step 9 --/ { p = 0 } p' "$ROOT/skills/$s/SKILL.md" | grep_q -F 'daily question' \ && ok "$s: Step 8 asks a lesson proposal with the daily question" || bad "$s: Step 8 asks a lesson proposal with the daily question" - awk '/^\*\*Step 11 --/ { p = 1 } /^\*\*Step 12 --/ { p = 0 } p' "$ROOT/skills/$s/SKILL.md" | grep -qF 'LESSONS' \ + awk '/^\*\*Step 11 --/ { p = 1 } /^\*\*Step 12 --/ { p = 0 } p' "$ROOT/skills/$s/SKILL.md" | grep_q -F 'LESSONS' \ && ok "$s: Step 11 names the open lessons in the status" || bad "$s: Step 11 names the open lessons in the status" own_reviewers_on printf '# Runtime\n\n## Release\n\n- deployed: echo abc1234\n\n## Signals\n\n- errors | read: echo none\n- latency | read: echo none\n' > "$WT/.ytstack/RUNTIME.md" @@ -359,7 +363,7 @@ PY for want in 'ytstack-pr-watch handover --from' 'PR watch session:' 'Running workers:' 'address' 'relay' 'Reports after the rotation'; do grep -qF -- "$want" "$TMP/step12.md" && ok "$s: Step 12 names $want" || bad "$s: Step 12 names $want" done - awk '/^\*\*Step 3 --/ { p = 1 } /^\*\*Step 4 --/ { p = 0 } p' "$ROOT/skills/$s/SKILL.md" | grep -qF 'ytstack-pr-watch handover --from' \ + awk '/^\*\*Step 3 --/ { p = 1 } /^\*\*Step 4 --/ { p = 0 } p' "$ROOT/skills/$s/SKILL.md" | grep_q -F 'ytstack-pr-watch handover --from' \ && ok "$s: Step 3 runs the handover for a rotation" || bad "$s: Step 3 runs the handover for a rotation" grep -qF '## Rotation' "$ROOT/docs/ux/coordinator-format.md" && ok "$s: coordinator-format documents the rotation block" || bad "$s: coordinator-format documents the rotation block" # every command of the Procedure, not only Step 7 @@ -374,7 +378,7 @@ PY case "$1" in -C) shift 2 ;; -*|'<'*) break ;; *) sub="$1"; break ;; esac done if [ -z "$sub" ]; then ok "$s: $tool exists"; continue; fi - sed -n '1,40p' "$ROOT/bin/$tool" | grep -qw -- "$sub" && ok "$s: $tool $sub is in its usage" || bad "$s: $tool $sub is in its usage" + sed -n '1,40p' "$ROOT/bin/$tool" | grep_q -w -- "$sub" && ok "$s: $tool $sub is in its usage" || bad "$s: $tool $sub is in its usage" done < "$TMP/step7.cmds" ;; finish-lane) # who merges (M025): risk unless PREFERENCES says otherwise; a typo reads as human @@ -463,18 +467,18 @@ for s in incident systematic-debugging finish-lane coordinate; do grep -qF 'invoke `ytstack:lesson`' "$F" && ok "$s: invokes ytstack:lesson" || bad "$s: invokes ytstack:lesson" if [ "$s" = systematic-debugging ]; then # a thin wrapper: the step lives in its invocation notes, it has no Terminal State - awk '/^## ytstack invocation notes/ { p = 1; next } /^## / { p = 0 } p' "$F" | grep -qF 'ytstack:lesson' \ + awk '/^## ytstack invocation notes/ { p = 1; next } /^## / { p = 0 } p' "$F" | grep_q -F 'ytstack:lesson' \ && ok "$s: the invocation notes name the lesson step" || bad "$s: the invocation notes name the lesson step" else - awk '/^## Terminal State/ { p = 1 } p' "$F" | grep -qF '`ytstack:lesson`' \ + awk '/^## Terminal State/ { p = 1 } p' "$F" | grep_q -F '`ytstack:lesson`' \ && ok "$s: the Terminal State allows ytstack:lesson" || bad "$s: the Terminal State allows ytstack:lesson" fi done -awk '/^### Step 10: Record the lesson/ { p = 1; next } /^### / { p = 0 } p' "$ROOT/skills/incident/SKILL.md" | grep -qF -- '--incident' \ +awk '/^### Step 10: Record the lesson/ { p = 1; next } /^### / { p = 0 } p' "$ROOT/skills/incident/SKILL.md" | grep_q -F -- '--incident' \ && ok "incident: the lesson step passes the record for --incident" || bad "incident: the lesson step passes the record for --incident" -awk '/^### Step 14: Lesson/ { p = 1; next } /^### / { p = 0 } p' "$ROOT/skills/finish-lane/SKILL.md" | grep -qF 'ytstack:lesson' \ +awk '/^### Step 14: Lesson/ { p = 1; next } /^### / { p = 0 } p' "$ROOT/skills/finish-lane/SKILL.md" | grep_q -F 'ytstack:lesson' \ && ok "finish-lane: Step 14 is the lesson" || bad "finish-lane: Step 14 is the lesson" -awk '/^\*\*Step 7 --/ { p = 1 } /^\*\*Step 8 --/ { p = 0 } p' "$ROOT/skills/coordinate/SKILL.md" | grep -qF 'a red `main`' \ +awk '/^\*\*Step 7 --/ { p = 1 } /^\*\*Step 8 --/ { p = 0 } p' "$ROOT/skills/coordinate/SKILL.md" | grep_q -F 'a red `main`' \ && ok "coordinate: Step 7 runs the lesson on a red main" || bad "coordinate: Step 7 runs the lesson on a red main" # ---- technical spec in the preambles (M022) ----------------------------------