From e963513a8a7e217dfdf4c61edd2dcb032399a602 Mon Sep 17 00:00:00 2001 From: Justin Parker Date: Wed, 4 Nov 2026 19:23:33 -0800 Subject: [PATCH] Offer Skip on two of Diagnose's opening questions AI Assisted --- scripts/test-web-console-source.mjs | 9 +++++++++ src/plan2code-diagnose.md | 2 +- src/web-console/notes/diagnose.md | 4 ++-- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/scripts/test-web-console-source.mjs b/scripts/test-web-console-source.mjs index 8d0322d..4f10853 100644 --- a/scripts/test-web-console-source.mjs +++ b/scripts/test-web-console-source.mjs @@ -536,3 +536,12 @@ test("prefs: Help and the readme name every tab and section, and the dialog's un assert.ok(!new RegExp(`class="[^"]*\\b${cls}\\b[^"]*"`).test(html), `index.html has no .${cls} left`); } }); + +test("Diagnose's opening cards: only What is wrong is required", () => { + const notes = fs.readFileSync(path.join(ROOT, "src", "web-console", "notes", "diagnose.md"), "utf8"); + const batch = JSON.parse(notes.match(/```jsonc\n(.*)\n```/)[1]); + const required = Object.fromEntries(batch.items.map((item) => [item.id, item.required !== false])); + assert.deepEqual(required, { bug: true, expected: false, "see-it": false }); + const prompt = fs.readFileSync(path.join(ROOT, "src", "plan2code-diagnose.md"), "utf8"); + assert.match(prompt, /the last two `"required":false`/, "the prompt says the last two cards are optional"); +}); diff --git a/src/plan2code-diagnose.md b/src/plan2code-diagnose.md index 8c2fc74..2ee5e89 100644 --- a/src/plan2code-diagnose.md +++ b/src/plan2code-diagnose.md @@ -57,7 +57,7 @@ Keep with you: the reproduction, any bisect, the cause judgment and every questi ### Step 1: The Bug -A typed argument is the report; ask only for what it leaves out. Otherwise ask in one batch (console: three `text` cards, the first with a placeholder example of a real report, no `"templates"`): +A typed argument is the report; ask only for what it leaves out. Otherwise ask in one batch (console: three `text` cards, the first with a placeholder example of a real report, the last two `"required":false`, no `"templates"`): > "1. **What is wrong?** The bug, in a sentence or two. > 2. **Expected vs actual:** what should happen, and what happens instead. diff --git a/src/web-console/notes/diagnose.md b/src/web-console/notes/diagnose.md index 0e91f47..db615ee 100644 --- a/src/web-console/notes/diagnose.md +++ b/src/web-console/notes/diagnose.md @@ -5,10 +5,10 @@ An argument that already describes the bug skips the cards it answers. Otherwise one `--wait` batch, no `templates`: ```jsonc -{"title":"Diagnose a bug","headline":{"stage":"The bug","cleared":0,"total":3},"items":[{"id":"bug","kind":"text","title":"What is wrong","body":"The bug, in a sentence or two."},{"id":"expected","kind":"text","title":"Expected and actual","body":"What should happen, and what happens instead."},{"id":"see-it","kind":"text","title":"How to see it","body":"The steps, command, page or input that shows it, and since when if known."}]} +{"title":"Diagnose a bug","headline":{"stage":"The bug","cleared":0,"total":3},"items":[{"id":"bug","kind":"text","title":"What is wrong","body":"The bug, in a sentence or two."},{"id":"expected","kind":"text","title":"Expected and actual","required":false,"body":"What should happen, and what happens instead."},{"id":"see-it","kind":"text","title":"How to see it","required":false,"body":"The steps, command, page or input that shows it, and since when if known."}]} ``` -A follow-up the answers leave open is a new card with a new id. +A follow-up the answers leave open is a new card with a new id. A skipped card is no answer: work from the rest, never guess the missing steps, and ask again when you cannot show someone else the bug without it. ## The cause