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
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
bump: minor
---

### Changed

- `/planning:interview` runs the pre-round contradiction pass only for a round whose recommendations cite an answered row or a confirmed constraint, and scopes each sweep after the first to the rows the last sweep's answers changed ([#17736](https://github.com/melodic-software/claude-code-plugins/issues/17736)).
- An assumption-sweep `decision` item below the interview's level, or one a quoted owner ruling already routed to design, is no longer asked: it becomes a `deferred` register row with `arbiter: /planning:design`. It still counts for the register gate, and the Brief's `### Deferred questions` still has to list it ([#17736](https://github.com/melodic-software/claude-code-plugins/issues/17736)).
- A round that only re-asks earlier rows takes no new round number, so the next round with a new row keeps the round numbers contiguous for `check-open-questions.sh --procedure` ([#17736](https://github.com/melodic-software/claude-code-plugins/issues/17736)).

### Fixed

- `check-open-questions.sh --procedure` accepts the round field `round <r> (added in round <N>)` that the page export writes, reading it as round r the way `import-ledger` does. Any other text after `round <N>` still fails ([#17736](https://github.com/melodic-software/claude-code-plugins/issues/17736)).
294 changes: 148 additions & 146 deletions plugins/planning/scripts/check-open-questions.sh
Comment thread
kyle-sexton marked this conversation as resolved.
Resolved

Large diffs are not rendered by default.

85 changes: 85 additions & 0 deletions plugins/planning/scripts/check-open-questions.test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -727,6 +727,44 @@ EOT
)"
expect_exit "--procedure malformed round field -> 1" 1 --ledger "$proc_badround" --procedure

proc_added="$(
mkledger <<'EOT'
- Q1 | answered | round 1 | Who writes? | admin
- Q2 | answered | round 2 | What format? | html
- Q3 | answered | round 1 (added in round 2) | Retention window? | 30 days
EOT
)"
expect_exit "--procedure page-synced 'added in round' row -> 0" 0 --ledger "$proc_added" --procedure
expect_stdout "--procedure page-synced 'added in round' row reports procedure=ok" "status=clean procedure=ok" --ledger "$proc_added" --procedure
for cell in 'round 1 (added in round 2) extra' 'round 1 (sweep) (added in round 2)' 'round 1 (added in round two)' 'round 1 (added)' 'round 1 extra'; do
proc_extra="$(
mkledger <<EOT
- Q1 | answered | round 1 | Who writes? | admin
- Q2 | answered | $cell | What format? | html
EOT
)"
expect_exit "--procedure round field '$cell' -> 1" 1 --ledger "$proc_extra" --procedure
if [[ "$(stderr_of --ledger "$proc_extra" --procedure)" == *"Q2: round field is not 'round <N>'"* ]]; then pass "--procedure names the round field '$cell'"; else fail "--procedure names the round field '$cell'"; fi
done

proc_reask="$(
mkledger <<'EOT'
- Q1 | answered | round 1 | Who writes? | admin
- Q2 | answered | round 1 | What format? | html, answered when re-asked
- Q3 | answered | round 2 | Retention window? | 30 days
EOT
)"
expect_exit "--procedure re-ask-only round with no round number -> 0" 0 --ledger "$proc_reask" --procedure
proc_reask_numbered="$(
mkledger <<'EOT'
- Q1 | answered | round 1 | Who writes? | admin
- Q2 | answered | round 1 | What format? | html, answered when re-asked
- Q3 | answered | round 3 | Retention window? | 30 days
EOT
)"
expect_exit "--procedure re-ask-only round that took a round number -> 1" 1 --ledger "$proc_reask_numbered" --procedure
if [[ "$(stderr_of --ledger "$proc_reask_numbered" --procedure)" == *"round 2 has no register row"* ]]; then pass "--procedure names the round a re-ask-only round left empty"; else fail "--procedure names the round a re-ask-only round left empty"; fi

# 51. An empty resolution fails for every retired status, missing field included.
for retired in answered deferred withdrawn blocked; do
proc_empty="$(
Expand Down Expand Up @@ -1199,6 +1237,53 @@ printf '%s\n' '- S1 | sweep 1 | undecided | decision | Q2 | Q2' >>"$stray_sweep_
expect_exit "a sweep row outside the sweep section -> 1" 1 --ledger "$stray_sweep_row" --procedure
if [[ "$(stderr_of --ledger "$stray_sweep_row" --procedure)" == *"sweep row outside the '## Assumption sweep' section"* ]]; then pass "the stray sweep row is named"; else fail "the stray sweep row is named"; fi

design_deferred="$TMP/design-deferred.md"
cat >"$design_deferred" <<'EOF'
# /interview Checklist

## Steps

- [x] Step 2 exit: Assumption sweep

## Open-question register

- Q1 | answered | round 1 | Who writes? | admin
- Q2 | deferred | round 2 | Which queue backs the retry step? | a design choice below this interview; defer until design; arbiter: /planning:design
- Q3 | deferred | round 2 | Cache key layout? | answered-from-decision: "the cache key layout goes to design". Basis: owner, round 1; arbiter: /planning:design

## Assumption sweep

- sweep 1 | register through Q1
- S1 | sweep 1 | undecided | decision | Q1 recommendation, retry queue | Q2
- S2 | sweep 1 | hidden-default | decision | Q1 recommendation, cache key layout | Q3
EOF
expect_exit "decision items deferred to /planning:design as register rows -> 0" 0 --ledger "$design_deferred" --procedure
expect_stdout "the register gate counts the /planning:design rows" "registered=3 open=0 deferred=2 blocked=0 withdrawn=0 answered=1 superseded=0 brief=unchecked status=clean procedure=ok" --ledger "$design_deferred" --procedure
design_brief="$TMP/design-brief.md"
cat >"$design_brief" <<'EOF'
## Brief

### Deferred questions

- Q2: Which queue backs the retry step? Defer until design; **arbiter: /planning:design**
- Q3: Cache key layout? Routed by the owner; **arbiter: /planning:design**

## Plan
EOF
expect_stdout "the Brief lists the /planning:design rows -> brief=ok" "brief=ok status=clean" --ledger "$design_deferred" --brief "$design_brief"
design_brief_missing="$TMP/design-brief-missing.md"
cat >"$design_brief_missing" <<'EOF'
## Brief

### Deferred questions

- Q2: Which queue backs the retry step? Defer until design; **arbiter: /planning:design**

## Plan
EOF
expect_exit "a /planning:design row absent from the Brief -> 2" 2 --ledger "$design_deferred" --brief "$design_brief_missing"
if [[ "$(stderr_of --ledger "$design_deferred" --brief "$design_brief_missing")" == *"absent from the Brief's deferred questions: Q3"* ]]; then pass "the /planning:design row absent from the Brief is named"; else fail "the /planning:design row absent from the Brief is named"; fi

if [[ "$fails" -ne 0 ]]; then
printf '\n%d test(s) failed.\n' "$fails" >&2
exit 1
Expand Down
4 changes: 2 additions & 2 deletions plugins/planning/skills/interview/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ Alternatives:

**Name the evidence-settled decisions in the round header.** A decision whose evidence leaves only one viable answer gets no question. The round header lists each on one `Settled by evidence:` line, by id and plain name, with the answer and its Basis: `Settled by evidence: Q7 (log format), JSON lines, Basis: verified, src/log.ts:12`. Each takes its `Q<N>` and an `answered` register row with the resolution `answered-from-evidence: <answer>. Basis: <source>`. The user can reopen one by id: its row goes back to `open` and it is asked in full in the next round. Any decision with a live alternative is still asked.

**One question at a time (`question_pacing`).** Pacing: resolve `question_pacing` once, before the first round or the page start, per [`${CLAUDE_PLUGIN_ROOT}/reference/config.md`](../../reference/config.md) "Convention-home keys", with `${user_config.question_pacing}` as its user layer (unexpanded or empty means unset; the default is `round`), and report the value and its layer in one line. `auto` settles to `round` or `single` after the Step 1 survey and before the first round or the page start, and everything after reads that choice: `single` when the topic is broad and open-ended (many independent directions, little settled upstream, no spec or earlier answer to anchor on), `round` otherwise. State the choice and how to switch in one line ("Asking one at a time: this topic is wide open. Say 'give me the whole round' to switch."). `round` asks the frontier as one set. `single` computes the frontier the same way, then asks one question per message in blast-radius order: each message carries one question in the full layout, the `Held:` line when one applies, and the closing probe, with no topic header. One frontier is still one round: one round number, one `round-<N>.md` file and one contradiction pass, sent over several messages. A round fired from inside another workflow's phase ignores `single` ("Rounds fire at phase boundaries"). Register each question `open` in the message that asks it, and recompute the frontier after each answer, since an answer can prune or add questions. The user's request in the session ("one at a time", "give me the whole round") overrides it for that session. The page honors `single` too: the session posts the round with its first question and adds each later one after the one before it is answered ([`context/lane-page.md`](context/lane-page.md)).
**One question at a time (`question_pacing`).** Pacing: resolve `question_pacing` once, before the first round or the page start, per [`${CLAUDE_PLUGIN_ROOT}/reference/config.md`](../../reference/config.md) "Convention-home keys", with `${user_config.question_pacing}` as its user layer (unexpanded or empty means unset; the default is `round`), and report the value and its layer in one line. `auto` settles to `round` or `single` after the Step 1 survey and before the first round or the page start, and everything after reads that choice: `single` when the topic is broad and open-ended (many independent directions, little settled upstream, no spec or earlier answer to anchor on), `round` otherwise. State the choice and how to switch in one line ("Asking one at a time: this topic is wide open. Say 'give me the whole round' to switch."). `round` asks the frontier as one set. `single` computes the frontier the same way, then asks one question per message in blast-radius order: each message carries one question in the full layout, the `Held:` line when one applies, and the closing probe, with no topic header. One frontier is still one round: one round number, one `round-<N>.md` file and at most one contradiction pass, sent over several messages. A round fired from inside another workflow's phase ignores `single` ("Rounds fire at phase boundaries"). Register each question `open` in the message that asks it, and recompute the frontier after each answer, since an answer can prune or add questions. The user's request in the session ("one at a time", "give me the whole round") overrides it for that session. The page honors `single` too: the session posts the round with its first question and adds each later one after the one before it is answered ([`context/lane-page.md`](context/lane-page.md)).

`Q<N>` numbering runs continuously across rounds (Q1…Q4 in round one, Q5… in round two; visible depth). Close the round with one probe inviting a constraint that breaks the recommendations, worded "something else", never "anything else": "Is there something else that would change these recommendations?" (eval case `interview-closing-probe-something-else`). Put the note that the user may answer in any order before the probe. In the terminal lane an inline round is the last message of the turn that sends it and the probe its last line, because the user answers what the turn ends on: write its round file, run its checks and register its rows before it is sent (under `single`, each row in the message that asks it), and call no tool after it. A correction that changes a question already shown resends the whole round with the note in its header (under `single`, only that question, the note above it); any other note waits for the top of the next round. Wait for the answers before computing the next round. The recommendation+basis discipline holds per question. Inline prose carries the recommendation, its reasoning, AND the probe in one readable block; a card cannot.

Expand Down Expand Up @@ -309,7 +309,7 @@ When the resolved lane's spoke shows Step 3's confirmation gate outside this con

**Re-ground open recommendations before they are shown.** On resume, and before a queued round is shown, check each open recommendation: its `Basis:` cites a source read this session or a constraint row, and it does not rest on an artifact the constraint ledger now excludes. A consequential one that fails gets a research dispatch before the user sees it, or is shown marked "not yet researched". When the user adds a constraint mid-interview, write the `confirmed` row at once and re-check every open recommendation's `Checked against:` line against it; revise the ones it changes and say which.

**Check each draft round against earlier answers before it is shown.** Every round after the first, before it is asked inline or posted with `add-round`, gets a contradiction pass: a fresh-context non-fork sub-agent runs only the assumption sweep's contradiction category over the draft round and the register's `answered` rows ([`context/assumption-sweep.md`](context/assumption-sweep.md) "Pre-round contradiction pass"). Fix each contradiction in the draft before the round goes out: revise the recommendation so it holds with the earlier answer or constraint, or, for an earlier answer, ask one question that names both sides. A question that weighs earlier answers, whether it comes from this pass or the sweep, lists their `Q<N>` ids as the answers it reconciles; a round of sweep items is labeled a sweep round, per that file's "Disposition".
**Check each draft round against earlier answers before it is shown.** A round after the first whose recommendations cite an `answered` row or a `confirmed` constraint, before it is asked inline or posted with `add-round`, gets a contradiction pass; a round whose recommendations cite neither skips it. The pass is a fresh-context non-fork sub-agent that runs only the assumption sweep's contradiction category over the draft round and the register's `answered` rows ([`context/assumption-sweep.md`](context/assumption-sweep.md) "Pre-round contradiction pass"). Fix each contradiction in the draft before the round goes out: revise the recommendation so it holds with the earlier answer or constraint, or, for an earlier answer, ask one question that names both sides. A question that weighs earlier answers, whether it comes from this pass or the sweep, lists their `Q<N>` ids as the answers it reconciles; a round of sweep items is labeled a sweep round, per that file's "Disposition".

**Composed artifacts are candidates.** A design from explore or research output, or read from an existing implementation, is a candidate, never a recommendation, until re-derived against the constraint ledger: check it against every row, recommend only what survives, and name the rows on its `Checked against:` line. A research or exploration brief dispatched mid-interview carries the constraint ledger verbatim.

Expand Down
27 changes: 21 additions & 6 deletions plugins/planning/skills/interview/context/assumption-sweep.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ is asked, stated, or blocked before the confirmation gate.
- `me` and `auto` runs with a register, once no open question remains on the frontier and before
the Step 3 register gate and confirmation gate. The `auto` Mixed path runs it after its residue round.
- Skipped when the run asked no question (no register exists) and in `lock`.
- After the answers to sweep rows land, sweep again over what those answers changed. Step 3 starts
when a sweep adds no `open` row.
- After the answers to sweep rows land, sweep again, scoped to the rows the last sweep's answers
changed ("Follow-up sweep scope" under "Dispatch"). Step 3 starts when a sweep adds no `open` row.

## Dispatch

Expand All @@ -31,6 +31,13 @@ Hand it:
Withhold the rationale that sold each recommendation. The sweep checks what would be locked, not
why it was recommended.

**Follow-up sweep scope.** The first sweep covers the whole ledger. Each later sweep covers only the
rows the last sweep's answers changed: the rows that sweep added, and each earlier row whose
resolution, recommendation or `Commits you to:` parts those answers revised. Hand it those rows,
the `answered` rows and constraint rows they name as dependencies, and the parts of the Brief draft
they changed. It looks for items in the changed rows only, read against those dependencies. When
the last sweep's answers changed no row, there is nothing to sweep and Step 3 starts.

## What it looks for

- **Undecided details:** a decision the draft relies on that no register row covers.
Expand Down Expand Up @@ -104,7 +111,13 @@ You write the results, not the sub-agent, so register ids stay contiguous.
`Q<N>`, written `open` and
asked in the next round with a recommendation. A `person` item the user cannot answer, and a
`tenant` item when the user is not the setting's owner, are `deferred` to the Brief's
`### Deferred questions` with its arbiter tag.
`### Deferred questions` with its arbiter tag. A `decision` item below this skill's level (how
the work is built, not what it must do; never while a `confirmed` constraint row settles
mechanism decisions in this interview), or one a quoted prior owner ruling already routed to
design, is not asked: its row is written `deferred` with `arbiter: /planning:design` in its
resolution (and the quoted ruling, when one routed it), and goes to the Brief's
`### Deferred questions` under its `Q<N>` with that arbiter. It counts for the register gate like
any `deferred` row, and the `--brief` cross-check needs it in the Brief.
Comment thread
kyle-sexton marked this conversation as resolved.
Resolved
- **contradiction:** one row naming both sides, asked as a choice between them.
- **hedged:** no new row. The rows go to the confirmation restate.
- **coined-term:** a register row asking the user to accept or rename the term, with the closest
Expand Down Expand Up @@ -147,9 +160,11 @@ its question.

## Pre-round contradiction pass

Before every round after the first is asked inline or posted with `add-round`, check the draft
round against what the user already answered, so a conflict is caught before the user sees it
rather than at the next sweep.
Before a round after the first is asked inline or posted with `add-round`, check the draft round
against what the user already answered, so a conflict is caught before the user sees it rather
than at the next sweep. Run the pass only when a recommendation in the draft round cites an
`answered` row or a `confirmed` constraint: its `Checked against:` line names a constraint, or its
Context or `Basis:` cites an earlier answer. A round whose recommendations cite neither skips it.

- **Dispatch:** a fresh-context (non-fork) sub-agent, as in "Dispatch" above. Hand it the draft
round (each question with its recommendation, `Checked against:` line and `Commits you to:`
Expand Down
Loading
Loading