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,7 @@
---
bump: patch
---

### Fixed

- `/planning:interview` page surface (#7749): a question whose `facts` open with a Source quote shows it open under a "Source text" heading above the recommendation, not collapsed under Details. A stored toggle choice still holds; a question without a leading quote renders as before.
2 changes: 1 addition & 1 deletion plugins/planning/skills/interview/context/surface.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ The page is the input surface SKILL.md "Question surface: the page" selects. The
```

`--sync-ledger` runs `round.sh sync-ledger --ledger '<ledger>'` after the write (a missing ledger, or one without exactly one open-question register heading, is refused before anything is written). If the sync fails after the write, the round stays posted and the command exits 1 naming the cause and the `round.sh sync-ledger` command to run once the cause is fixed. It rewrites only the register rows, in id order, from page state, and keeps rows the page never had, the ledger's titles and its round labels, so register row cells need no hand edit; rerun `sync-ledger` after a write the register should show. Each question carries `id` (its `Q<N>`), `short` (the one-line label the page lists), `title` (the full question the card shows), `recommendation` (one line), `basis` (2-3 sentences, shown behind Why), at least two `alternatives` (`{key, text}`), `commits` (what accepting commits the user to, or `[]`), `dependsOn` for its prerequisites, and optionally `stage`. A yes/no question sets `"binary": true` and carries exactly one alternative, the other answer; that alternative may not repeat or contain the recommendation. Send the round's closing constraint probe with a `note-reply` op (no `seq`) so it lands in Notes to Claude, or as a Claude thread line on the round's first question. `add` and `add-round` refuse a question whose `id` already exists (naming the first duplicate and saying nothing was written, so `apply` on a file with one writes none of it), a question that supersedes another and reuses its `short` (give it its own), and a question missing `id`, `short` or `title` (naming the question and the field), without `commits`, or with fewer than two alternatives (one when `binary`). A question with no `stage` takes the newest question's stage and the round that stage is on, and the write warns naming both; set `stage` on every question that opens a new stage. A question whose round is below the newest round when it is added (asked after a later round was posted) records `addedInRound`: the page shows `Added in round N` on it and the register's round cell reads `round <r> (added in round <N>)`, which `import-ledger` reads back.
- **Source.** When a question rests on text the user has not read (a doc, a post, a repo file), open `facts` with a Source block ahead of the recommendation's reasoning: the exact text as a `>` quote (the page sets it apart), a link to its exact section, and one line on why that text makes this a question. The quote lives only on the page. `export-brief` and `export-report` read no `facts`, so the Brief and report carry no quote.
- **Source.** When a question rests on text the user has not read (a doc, a post, a repo file), open `facts` with a Source block ahead of the recommendation's reasoning: the exact text as a leading `>` quote (the page shows it open under "Source text", above the recommendation, and keeps the rest of `facts` under Details), a link to its exact section, and one line on why that text makes this a question. The quote lives only on the page. `export-brief` and `export-report` read no `facts`, so the Brief and report carry no quote.
- **Meta.** `meta` takes `title`, `eyebrow`, `stages`, `next` and `repo`. `stages` is an object mapping each stage key to its label, for example `"stages": {"frame": "Frame", "decide": "Decide"}`; a list is refused (`$.meta.stages: expected object, got list`). Set with `add-round`'s `meta` object or the `meta` op; any other key is refused. `meta.next` is what Claude does after wrap-up, shown on the finished screen. `meta.repo` (`owner/repo`) makes the page link a bare `#N` in any markdown field to that repo's issue; `owner/repo#N` always links to its own repo, and `[text](url)` links, `Qn` refs and code spans are left as written. A bare `#N` with `meta.repo` unset stays plain text and `add`, `add-round` and `apply` warn (non-blocking). Keep round numbers out of `meta.eyebrow`: the page derives the round label (`Round N · <stage>`) from the questions and shows it beside the eyebrow, so a number in the eyebrow goes stale at the next round. Round numbers are session-wide, one counter across every stage, so `Round 12 · Build 2` follows `Round 10 · Build 2` when round 11 ran in another stage. Label each stage in `meta.stages`; without a label the page splits letters from digits (`build2` shows as `Build 2`), `add` and `add-round` warn on a new stage that has none, and the Rounds view lists unlabeled stages after labeled ones in order of first appearance. Every meta write records the newest round in `meta.setInRound`. `add` and `add-round` warn when they open a round above every existing one while meta was last set in an earlier round, and `round.sh status` prints `meta last set in round N, newest question in round M`; refresh `eyebrow` and `next` then. `meta.title` names the whole interview: `add-round` keeps the existing title and warns when its `meta.title` differs, unless `--replace-title` (op field `replaceTitle`) is passed.
- **Visuals** are declared by format (`svg`, `mermaid`, `image`, `markdown`, `html`, `chart`) with a `scope` (`question:<id>`, `group:<id>`, `round:<stage>:<n>`, `all`) and inline `content` or a data-dir-relative `file`. `label` is its tab name (short; the page falls back to `title`, then `id`). `group`, `order` and `primary` arrange visuals: those sharing a `group` are versions or alternatives of one another, `order` sorts them, and at most one live `primary` is allowed per `group` within a `scope`. Change a visual with `replace-visual` (a full object with the same id) or retire it with `archive-visual`; an archived visual stays in `questions.json` and the page and report never show it. `add-round` refuses an id that already exists. Describe what a visual shows; leave out the tool or skill that made it. An `html` visual runs its scripts on the page, in an opaque-origin sandbox that cannot reach the page, so an interactive prototype or an inlined chart library works; the page CSP still blocks remote content. The exported report runs no scripts: when the decision rests on what a scripted visual shows, attach an `image` of it as well. Two or more `image` visuals on a question also get a Gallery tab (one more per group holding a smaller set) with a thumbnail strip, arrow-key flip and a side-by-side compare, in full screen too. Any visual opens in a new tab from the panel or full screen, still sandboxed.
- **Resume.** Resolve the surface again through the SKILL.md start command on every resume, handoff or `/clear`; an absolute `<surface_dir>` or `round.sh` path copied from a handoff or an earlier session names whichever install ran then, so never reuse one. Before the first resumed round run `round.sh --dir '<data_dir>' doctor --ledger '<memory_dir>/<topic-slug>/interview-checklist.md'` (the `--dir` may not exist yet). It prints a `missing:` line per element the running version needs and the ledger or page lacks (the `## Constraint ledger` and `## Open-question register` sections, and open questions on the page without a Basis or without a `Checked against:` line in `facts`), and a `note:` when the ledger's `Planning version:` line or `meta.pluginVersion` names another version. It exits 1 on any `missing:` line and writes nothing; retrofit what it names, then continue. Older ledgers still import and grade. It cannot see the mechanism-tripwire question or whether the assumption sweep ran, and says so. `meta.pluginVersion` records the version that first wrote the data dir; the ledger template carries the `Planning version:` line.
Expand Down
13 changes: 9 additions & 4 deletions plugins/planning/surface/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,12 @@
.note{border-left:3px solid var(--accent);background:var(--accent-soft);padding:9px 14px;border-radius:0 6px 6px 0;font-size:14px}
section.blk{display:grid;gap:8px}
section.blk>h4,details.more>summary{font:500 12px/1 var(--mono);letter-spacing:.07em;text-transform:uppercase;color:var(--muted);margin:0}
details.more{display:grid;gap:12px}
details.more,details.src{display:grid;gap:12px}
details.more>summary{cursor:pointer;padding:4px 0}
details.more[open]>summary{margin-bottom:10px}
details.more>section+section{margin-top:12px}
details.src>summary{font:500 12px/1 var(--mono);letter-spacing:.07em;text-transform:uppercase;color:var(--muted);cursor:pointer;padding:4px 0}
details.src[open]>summary{margin-bottom:10px}
.md{max-width:72ch}
.md p{margin:0 0 .5em}.md p:last-child{margin-bottom:0}
.md ul,.md ol{margin:0 0 .5em;padding-left:20px}
Expand All @@ -226,7 +228,7 @@
.assume{font:500 12.5px var(--mono);color:var(--chg)}
.pill code{font-size:12px;background:none;padding:0}
/* A grid track sized auto grows to its widest unbreakable child; every single-column grid caps it at the container. */
nav.rail,.toolbar,.rail-list,.sec,.qlist,.tree,.act-list,.act-list li,main.detail,.dscroll,.dhead,section.blk,details.more,.recbox,.crows,.alts,ol.hist,ol.hist li,section.answer,.choices,.compose,.conflict,aside.fly,.fhead,.fbody,.nthread,.nmsg,.fs,ul.loose{grid-template-columns:minmax(0,1fr)}
nav.rail,.toolbar,.rail-list,.sec,.qlist,.tree,.act-list,.act-list li,main.detail,.dscroll,.dhead,section.blk,details.more,details.src,.recbox,.crows,.alts,ol.hist,ol.hist li,section.answer,.choices,.compose,.conflict,aside.fly,.fhead,.fbody,.nthread,.nmsg,.fs,ul.loose{grid-template-columns:minmax(0,1fr)}
.alts{display:grid;gap:8px;max-width:80ch}
.alt{display:grid;grid-template-columns:auto minmax(0,1fr);gap:10px;border:1px solid var(--line);border-radius:6px;padding:8px 12px}
.alt .k{font:600 13px var(--mono)}
Expand Down Expand Up @@ -1140,6 +1142,9 @@ <h1 id="title">Interview</h1>
if (q.claudeNote) h += '<div class="note"><b>Claude:</b> ' + inline(q.claudeNote) + "</div>";
const lc = latestClaude(q);
if (lc) h += '<div class="latest" id="latest"><span class="who">' + esc(whoLabel(lc)) + " &middot; " + esc(fmt(lc.at)) + "</span>" + md(lc.text) + "</div>";
let facts = String(q.facts || "").replace(/\r/g, "");
const sm = facts.match(/^(?:[ \t]*\n)*((?:>[^\n]*(?:\n|$)|[ \t]*\n(?=[ \t]*>))+)/), src = sm ? sm[1].replace(/^>[ \t]?/gm, "").trim() : ""; // a Source block opens facts with the quote: it shows above the recommendation
Comment thread
kyle-sexton marked this conversation as resolved.
Resolved
if (src) { facts = facts.slice(sm[0].length); h += '<details class="src" id="src"' + (lsGet("srcOpen", true) ? " open" : "") + "><summary>Source text</summary>" + md(src.replace(/^/gm, "> ")) + "</details>"; }
if (q.recommendation) h += '<section class="blk"><h4>' + (withheld(q) ? "Recommendation withheld" : (marks ? "➡️ " : "") + "Recommendation (Rec)") + '</h4><div class="recbox">' + md(q.recommendation) +
(q.basis ? '<details class="why"><summary>Why</summary>' + md(q.basis) + "</details>" : "") + "</div></section>";
if (q.commits && q.commits.length) {
Expand All @@ -1152,7 +1157,7 @@ <h1 id="title">Interview</h1>
}).join("") + "</div>" + (acc && q.commits.some((c, i) => !cf.has(String(i))) ? '<div class="arow"><button type="button" class="tbtn small" data-toconfirm="' + esc(q.id) + '">Review commitments to confirm</button></div>' : "") + "</section>";
}
let more = "";
if (q.facts) more += '<section class="blk"><h4>What we know</h4>' + md(q.facts) + "</section>";
if (facts.trim()) more += '<section class="blk"><h4>What we know</h4>' + md(facts) + "</section>";
if (altsOf(q).length) more += '<section class="blk"><h4>Alternatives</h4><div class="alts">' + altsOf(q).map(a =>
'<div class="alt' + (d && d.decision === "alt" && d.alt === a.key ? " chosen" : "") + '"><span class="k">(' + esc(a.key) + ")</span><span>" + inline(a.text) + "</span></div>").join("") + "</div></section>";
if (more) h += '<details class="more" id="more"' + (lsGet("moreOpen", false) ? " open" : "") + "><summary>Details: what we know, alternatives</summary>" + more + "</details>";
Expand Down Expand Up @@ -2110,7 +2115,7 @@ <h1 id="title">Interview</h1>
setLocal(k, v); renderFly(); renderAll();
}
});
document.addEventListener("toggle", e => { if (e.target.id === "more") lsSet("moreOpen", e.target.open); }, true);
document.addEventListener("toggle", e => { if (e.target.id === "more") lsSet("moreOpen", e.target.open); else if (e.target.id === "src") lsSet("srcOpen", e.target.open); }, true);
document.addEventListener("input", e => {
if (e.target.id === "note") { if (S.sel && Q[S.sel]) lsSet("draft:" + S.sel, e.target.value); grow(e.target); renderAnswer(); }
else if (e.target.id === "noteText") { lsSet("noteDraft", e.target.value); grow(e.target); }
Expand Down
8 changes: 5 additions & 3 deletions plugins/planning/surface/tests/fixtures/ui_page/round.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
{
"groups": [
{"id": "g1", "title": "Release"},
{"id": "g2", "title": "Chain"}
{"id": "g2", "title": "Chain"},
{"id": "g3", "title": "Sources"}
],
"questions": [
{"id": "Q1", "group": "g1", "stage": "interview", "short": "Ship day", "title": "When should the release ship?", "recommendation": "Ship it on Monday. Watch the error logs for a week after. Roll back on the first new error.", "commits": [], "alternatives": [{"key": "a", "text": "Ship on Friday"}, {"key": "b", "text": "Hold until next month"}]},
{"id": "Q1", "group": "g1", "stage": "interview", "short": "Ship day", "title": "When should the release ship?", "recommendation": "Ship it on Monday. Watch the error logs for a week after. Roll back on the first new error.", "facts": "> Releases ship on a weekday.\n\n[Release policy](https://example.com/policy#days)\n\nThe policy bars weekend releases.", "commits": [], "alternatives": [{"key": "a", "text": "Ship on Friday"}, {"key": "b", "text": "Hold until next month"}]},
{"id": "Q2", "group": "g2", "stage": "interview", "short": "Runner", "title": "Which runner builds the release?", "recommendation": "The hosted runner.", "commits": [], "alternatives": [{"key": "a", "text": "A self-hosted machine"}, {"key": "b", "text": "Both runners"}]},
{"id": "Q3", "group": "g2", "stage": "interview", "short": "Image", "title": "Which image does the runner use?", "recommendation": "The default image.", "dependsOn": ["Q2"], "commits": [], "alternatives": [{"key": "a", "text": "A pinned image"}, {"key": "b", "text": "A custom image"}]},
{"id": "Q4", "group": "g2", "stage": "interview", "short": "Cache", "title": "Should the image cache tools?", "recommendation": "Cache the tool folder.", "dependsOn": ["Q3"], "commits": [], "alternatives": [{"key": "a", "text": "Cache nothing"}, {"key": "b", "text": "Cache the whole disk"}]},
{"id": "Q5", "group": "g2", "stage": "interview", "short": "Timeout", "title": "How long may a build run?", "recommendation": "Twenty minutes.", "dependsOn": ["Q2"], "commits": [], "alternatives": [{"key": "a", "text": "No limit"}, {"key": "b", "text": "Five minutes"}]},
{"id": "Q6", "group": "g2", "stage": "interview", "short": "Cache key", "title": "What keys the tool cache?", "recommendation": "The lock file hash.", "dependsOn": ["Q4"], "commits": [], "alternatives": [{"key": "a", "text": "The branch name"}, {"key": "b", "text": "The date"}]},
{"id": "Q7", "group": "g2", "stage": "interview", "short": "Sign-off", "title": "Who signs off the build setup?", "recommendation": "The release owner.", "dependsOn": ["Q2", "Q3", "Q4", "Q5", "Q6"], "commits": [], "alternatives": [{"key": "a", "text": "The whole team"}, {"key": "b", "text": "Nobody"}]},
{"id": "Q8", "group": "g1", "stage": "interview", "short": "Notes", "title": "Should the release notes list every change?", "recommendation": "List the user-facing changes only.", "commits": [], "alternatives": [{"key": "a", "text": "List every commit"}, {"key": "b", "text": "No release notes"}]}
{"id": "Q8", "group": "g1", "stage": "interview", "short": "Notes", "title": "Should the release notes list every change?", "recommendation": "List the user-facing changes only.", "commits": [], "alternatives": [{"key": "a", "text": "List every commit"}, {"key": "b", "text": "No release notes"}]},
{"id": "Q10", "group": "g3", "stage": "interview", "short": "Quote", "title": "Which quote governs the freeze?", "recommendation": "The first quote.", "facts": "> First paragraph.\n\n> Second paragraph.\n\nRest.", "commits": [], "alternatives": [{"key": "a", "text": "The second quote"}, {"key": "b", "text": "Neither quote"}]}
]
}
Loading
Loading