Skip to content

Commit 832a38c

Browse files
kyle-sextonclaude
andauthored
fix(planning): name the plan view template and the skip-token place (#13808)
Refs: #7296 ## Summary Two `planning` eval findings from the #7296 cutoff runs: - `plan-pasted-unknown-choice-rejected` was INVALID twice. When `page-input.mjs` could not start, every with-arm run searched the whole plugin (`Grep glob=**/*plan*.html`) for the plan view's `data-rv-choice` values, and the eval sandbox denied it. The skill named no file for those choices. - `plan-light-skips-reviewer` scored 0 on both arms. Every with-arm run stopped at the Open Decisions block (SKILL.md "Open Decisions surfaced BEFORE plan body") because the prompt left the slugify behavior open, so Step 3 never ran. Separately, "the plan's review record" that should carry the skip token was defined nowhere. ## Fix - `skills/plan/SKILL.md`, plan view paragraph: a pasted `page-input` block follows rendered-view.md "Reader input", and the plan view's choices are the `data-rv-choice` selects in `${CLAUDE_PLUGIN_ROOT}/skills/plan/templates/plan-view.html`. When `page-input.mjs` cannot run, read that one file and do not search the plugin. - `skills/plan/SKILL.md` Step 3: under `light`/`off`, the reply that reports the step and the Step 5 presentation state `verification: skipped (<level>)`. - `evals/plan-light-skips-reviewer`: the scaffold seeds a settled draft PLAN.md and a design early exit, and the prompt continues from Step 3. The grader is unchanged. ## Verification Local `claude plugin eval` pairs, 3 runs per arm. Before = `origin/main` with this PR's evals restored; after = head `8b786eabe1`. **Pair 1** (after `pla1`, before `plb1`): both runs VALID, with the same scores. | Case | with | without | |------|------|---------| | plan-light-skips-reviewer | 1×3 | 0×3 | | plan-marker-* (4 cases) | 1×3 | 0.67×3 | **Pair 2** (after `pla2`, before `plb2`): after VALID. | Case | after: with | before: with | |------|-------------|--------------| | plan-marker-inside-quote, posted-through-app, trusted-human | 1×3 | no denial | | plan-pasted-approve-lock-not-approval | 0.8 / 1 / 0.6 | 0.8 / 0.6 / 0.8 | | plan-pasted-unknown-choice-rejected | 1×3 | INVALID | The before side is INVALID only on the plugin-root `Grep` denial in `plan-pasted-unknown-choice-rejected` (2 of 3 with-arm runs), the defect this PR removes. Without that case the before side has no denial, so the pair counts, with that case reported alone as the fix's evidence: after, all 3 with-arm runs score 1 and none is denied. `validate-cases.py plugins/planning`: 0 FAIL. `check-affected.sh --tests`: green. ## Remaining on #7296 The other plugins' rows in the #7296 cutoff table. ## Related - #7296 <!-- session: hitl-backlog --> 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 <[email protected]>
1 parent 751dc57 commit 832a38c

4 files changed

Lines changed: 74 additions & 5 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
bump: patch
3+
---
4+
5+
### Fixed
6+
7+
- name the plan view's template path for a pasted page-input block
8+
9+
When page-input.mjs cannot run, plan reads the choices from
10+
skills/plan/templates/plan-view.html instead of searching the plugin.
11+
Under the light verification level, the skip token now goes in the
12+
reply that reports Step 3 and in the Step 5 presentation.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
2-
description: "A repository whose default branch sets verification: light dispatches no plan-reviewer in Step 3; the plan's review record carries the skip token"
2+
description: "A repository whose default branch sets verification: light dispatches no plan-reviewer in Step 3; the reply that reports Step 3 carries the skip token"
33
tags: [plan, setting, verification-level]
44
runs: 3
55
max_turns: 60
66
timeout_seconds: 1200
77
allowed_tools: [Read, Glob, Grep, Skill, Bash, Edit, Write, Agent]
8-
expected_outcome: "Runs lib/read-verification.sh, reports verification: light from docs/conventions/planning.yaml at origin/main, drafts the plan, dispatches no planning:plan-reviewer, and writes verification: skipped (light) in the review record"
8+
expected_outcome: "Runs lib/read-verification.sh, reports verification: light from docs/conventions/planning.yaml at origin/main, dispatches no planning:plan-reviewer, and states verification: skipped (light) in the reply that reports Step 3"
99
---
1010

11-
/planning:plan add a max_length argument to slugify that truncates on a word boundary
11+
/planning:plan Continue the draft at `.work/slugify-max-length/PLAN.md` from Step 3. The Brief and the design gate are settled; `.work/slugify-max-length/design/design-resolution.md` records the design early exit. Run Steps 3 and 3b as this skill and this repository's settings say, then report what each step did. Stop there: no Step 4 onward, and edit no code.

‎plugins/planning/evals/plan-light-skips-reviewer/scaffold.sh‎

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,60 @@ def slugify(text):
4444
return "-".join(words)
4545
PY
4646
git -c user.name=eval -c [email protected] commit -q -am "feat: strip punctuation in slugify"
47+
48+
# A settled draft plan and a design early exit, so the run reaches Step 3 without open questions.
49+
mkdir -p .work/slugify-max-length/design
50+
cat >.work/slugify-max-length/PLAN.md <<'MD'
51+
# slugify max_length
52+
53+
## Brief
54+
55+
### Problem
56+
Slugs from long titles make URLs too long for the share links that embed them.
57+
58+
### Goal
59+
`slugify` takes an optional `max_length` and returns a slug no longer than it, cut on a word boundary.
60+
61+
### Acceptance criteria
62+
- AC1: `slugify(text)` with no `max_length` returns what it returns today.
63+
- AC2: `slugify(text, max_length=n)` drops whole trailing words so the result is at most `n`
64+
characters and never ends in a hyphen; every hyphen in the output counts as a word boundary.
65+
- AC3: When the first word alone is longer than `n`, the result is that word cut to `n` characters.
66+
- AC4: `max_length` below 1 raises `ValueError`.
67+
68+
### Out-of-scope
69+
- Unicode transliteration.
70+
71+
## Plan
72+
73+
### Behavior
74+
- B1: no limit keeps today's output (AC1). Delivered by Phase 1.
75+
- B2: a limit cuts whole words, or the first word, to fit (AC2, AC3). Delivered by Phase 1.
76+
- B3: a limit below 1 is refused (AC4). Delivered by Phase 1.
77+
78+
### Phase 1: Add max_length [STATUS]
79+
**Satisfies:** AC1, AC2, AC3, AC4
80+
**Delivers:** B1, B2, B3
81+
82+
- In `textkit/slug.py`, add `max_length=None`; after joining, when it is set, cut the slug at the
83+
last hyphen at or before `max_length`, or at `max_length` when there is none.
84+
- Raise `ValueError` when `max_length` is below 1.
85+
- Add one test per criterion to `tests/test_slug.py`.
86+
87+
**Sanity Check:** `python -m unittest discover -s tests` exits 0.
88+
89+
### Files affected
90+
| File | Action |
91+
|---|---|
92+
| `textkit/slug.py` | modify |
93+
| `tests/test_slug.py` | modify |
94+
MD
95+
# The phase heading takes its status tag here, outside the heredoc.
96+
plan=.work/slugify-max-length/PLAN.md
97+
text="$(cat "$plan")"
98+
printf '%s\n' "${text//'[STATUS]'/[TODO]}" >"$plan"
99+
cat >.work/slugify-max-length/design/design-resolution.md <<'MD'
100+
outcome: early-exit
101+
tier: C
102+
reason: One optional parameter on one existing function; no new types.
103+
MD

‎plugins/planning/skills/plan/SKILL.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ The plan is a proposal, not a commitment. The user approves, modifies, or reject
109109
7. **Explicit approval request**: "Approve this plan to proceed to execution, or provide feedback to revise. Anything tagged `[EXEC-SHAPE]` or `[FALLBACK]` above is /planning:plan's discretion. Flag any you want changed." Then name each Brief deferred question still open with **arbiter: USER-RESERVED**, with the plan's proposal, as needing its own reply
110110
8. **Highest-leverage replies**: close with 2-4 pre-drafted one-line revision replies, one per flagged close call or gate-passed decision, each a copyable sentence that flips exactly that decision (e.g. "Switch phase 2 to the queue-based alternative"). The user's cheapest possible reaction is pasting one back; a presentation whose flagged decisions have no pre-drafted flip line makes the user compose the revision themselves
111111

112-
**Presentation order: tweak-likelihood first.** Lead with what the user is most likely to change: data-model/schema choices, type interfaces and public APIs, and user-facing surfaces (flag close calls with their alternatives); mechanical, low-judgment work goes last. Phase EXECUTION order stays as `phase_order` set it in Step 2. After the presentation, offer an interactive plan view built from the draft PLAN.md (its Brief, behaviors, acceptance criteria, decisions and phases, each linked from the page, and a reply that names the phases to change, sent to this session through `session-bridge` when connected). `PLAN.md` stays the record, and the view writes nothing back to it. Build it only with `${CLAUDE_PLUGIN_ROOT}/scripts/build-view.mjs plan --record <PLAN.md>`, never hand-written; it runs the shared medium resolver and publish gate with this plugin's `medium` option `${user_config.medium}`, and you print the report line it prints. Procedure and what the page shows: [`${CLAUDE_PLUGIN_ROOT}/reference/rendered-view.md`](${CLAUDE_PLUGIN_ROOT}/reference/rendered-view.md).
112+
**Presentation order: tweak-likelihood first.** Lead with what the user is most likely to change: data-model/schema choices, type interfaces and public APIs, and user-facing surfaces (flag close calls with their alternatives); mechanical, low-judgment work goes last. Phase EXECUTION order stays as `phase_order` set it in Step 2. After the presentation, offer an interactive plan view built from the draft PLAN.md (its Brief, behaviors, acceptance criteria, decisions and phases, each linked from the page, and a reply that names the phases to change, sent to this session through `session-bridge` when connected). `PLAN.md` stays the record, and the view writes nothing back to it. Build it only with `${CLAUDE_PLUGIN_ROOT}/scripts/build-view.mjs plan --record <PLAN.md>`, never hand-written; it runs the shared medium resolver and publish gate with this plugin's `medium` option `${user_config.medium}`, and you print the report line it prints. Procedure and what the page shows: [`${CLAUDE_PLUGIN_ROOT}/reference/rendered-view.md`](${CLAUDE_PLUGIN_ROOT}/reference/rendered-view.md). A pasted `page-input` block follows its "Reader input". The plan view's choices are the `data-rv-choice` selects in `${CLAUDE_PLUGIN_ROOT}/skills/plan/templates/plan-view.html`; when `page-input.mjs` cannot run, Read that one file for them, and never search the plugin directory.
113113

114114
If 2–4 named alternatives surfaced during the stress-test, present them side by side via `AskUserQuestion` when the plugin's `use_ask_user_question` user config (`${user_config.use_ask_user_question}`; unexpanded or empty means off) is on, numbered inline prose otherwise. For open-ended approval (single proposal, no alternatives) use prose.
115115

@@ -228,7 +228,7 @@ For the removal step, invoke `/code-tidying:audit-dead-code` through the Skill t
228228

229229
**Which stress-tests run (`plan_stress_test`).** Name the draft's mode (`plan`, `proposal` or `incumbent`), then resolve that mode's value per [`${CLAUDE_PLUGIN_ROOT}/reference/config.md`](${CLAUDE_PLUGIN_ROOT}/reference/config.md) "Convention-home keys", which defines the modes and values (no `userConfig` layer; the default is `auto`). Report one line, e.g. `plan_stress_test.incumbent: both (docs/conventions/planning.yaml)`. `auto`, `reviewer` and `both` run this step; `devils-advocate` skips it and goes to Step 3b.
230230

231-
**The verification level** decides what happens inside this step; `plan_stress_test` still decides whether it runs. Resolve it with `bash "${CLAUDE_PLUGIN_ROOT}/lib/read-verification.sh" --plugin planning --skill plan --file docs/conventions/planning.yaml` and report its line ([levels](https://github.com/melodic-software/claude-code-plugins/blob/main/docs/contracts/verification-level/README.md)). Under `light`, and `off`, which acts as `light` here, skip items 2 through 5, dispatch no reviewer and never stress-test the plan inline in its place: the plan's review record reads `verification: skipped (<level>)`, and the run goes to Step 3b, which no level governs.
231+
**The verification level** decides what happens inside this step; `plan_stress_test` still decides whether it runs. Resolve it with `bash "${CLAUDE_PLUGIN_ROOT}/lib/read-verification.sh" --plugin planning --skill plan --file docs/conventions/planning.yaml` and report its line ([levels](https://github.com/melodic-software/claude-code-plugins/blob/main/docs/contracts/verification-level/README.md)). Under `light`, and `off`, which acts as `light` here, skip items 2 through 5, dispatch no reviewer and never stress-test the plan inline in its place: the reply that reports this step, and the Step 5 presentation, state `verification: skipped (<level>)`, and the run goes to Step 3b, which no level governs.
232232

233233
Apply the reviewer rule under Planning Process before blast radius or presentation. The producing main thread MUST NOT self-attack the plan inline: the model that just wrote the plan rubber-stamps it. Where the plan is high-stakes and correlated blind spots are the risk, prefer a cross-vendor advisor **when one is enabled and set up** (e.g. the OpenAI Codex plugin, when its documented surface can take this artifact, invoked per its own docs), with the fresh-context plan-reviewer sub-agent as the stated fallback, never a route to a command that may not resolve (per `docs/plugin-philosophy.md` "Fresh-eyes checkpoints" in the marketplace repository).
234234

0 commit comments

Comments
 (0)