Let Diagnose start from a Notebook tab

AI Assisted
This commit is contained in:
jparkerweb committed 2026-11-09 08:08:43 -08:00
1 parent 9a23b15fc9
commit 92d4d880bf
8 files changed
+18 -9

No files matched your search

+2 -2
View File
@@ -232,7 +232,7 @@ and hides it while *Hide unavailable workflows* is on. Its chip has a visible
removes the folder (any other spec also asks you to type its name). Click a card and Planny
flies while it gets ready;
a few seconds later the same page is that skill's console, already running. No
command names to remember. Pathfinder, Plan, Quick Task and Revise plan can also
command names to remember. Pathfinder, Plan, Quick Task, Diagnose and Revise plan can also
start from one of your [Notebook](#your-notebook) tabs: see *Sent from the
dashboard* there.
@@ -1974,7 +1974,7 @@ origin.
| `POST /notepad/tab/delete` | `{ id }`. Removes the tab from the index, then its folder (text and pictures); 404 `no-such-tab`. |
| `POST /notepad/tab/order` | `{ order: [id] }`, every current id exactly once; 400 `bad` otherwise. |
| `POST /notepad/tab/last` | `{ id }`. Remembers the open tab; 404 `no-such-tab`. |
| `POST /notepad/tab/sent` | `{ id, workflow, spec? }`. Records that the tab was sent (`workflow` one of `pathfinder`, `plan`, `quick-task`, `revise-plan`; `spec` like `specs/<name>`) as `sent: { workflow, spec?, at }` on its `tabs.json` entry, shown back in `GET /notepad`'s `tabs`. The page posts it only after the Send that carried the filled box; 400 `bad-sent`, 404 `no-such-tab`. |
| `POST /notepad/tab/sent` | `{ id, workflow, spec? }`. Records that the tab was sent (`workflow` one of `pathfinder`, `plan`, `quick-task`, `revise-plan`, `diagnose`; `spec` like `specs/<name>`) as `sent: { workflow, spec?, at }` on its `tabs.json` entry, shown back in `GET /notepad`'s `tabs`. The page posts it only after the Send that carried the filled box; 400 `bad-sent`, 404 `no-such-tab`. |
| `GET /notepad/images/<tab>/<uuid>.jpg`, `<uuid>.thumb.jpg` | Serves a picture or its thumbnail as `image/jpeg`, only by a tab id and a UUID name, a regular file (never a link) whose real path stays inside `~/.plan2code/notepads/`; anything else is 404. |
| `POST /subagents` | `{ on, instruction, max }` (`instruction: null` for the shipped default). Saves the switch for this project and skill and answers `{ ok, setting }`; 400 `not-offered` on a skill without the switch, `bad`, `too-long` (over 2,000 characters) or `max` (outside 1 to 20). |
| `GET /agents` | The agents view's data: your custom agents and the shipped built-ins and templates, each entry merged with its lookup result `{ state, path, where, folder }`: `state` is `found` (on PATH), `outside` (saved Windows PATH, npm's global folder or an install folder) or `missing`, and `where` says which search found it. Built-ins carry their `install` lines for the server's OS only. |
+1 -1
View File
@@ -733,7 +733,7 @@ footer a { color: inherit; }
<li>
<h3>Start from your Notebook</h3>
<div>
<p>Start Pathfinder, Plan, Quick Task or Revise plan from a Notebook tab. The agent reads the tab only once you send it.</p>
<p>Start Pathfinder, Plan, Quick Task, Diagnose or Revise plan from a Notebook tab. The agent reads the tab only once you send it.</p>
</div>
</li>
</ul>
+3
View File
@@ -2416,6 +2416,9 @@ test("noteSwitchShows: Pathfinder, Plan and Quick Task on Start fresh, Revise pl
assert.equal(noteSwitchShows(entry(skill), scan, sel("exploring")), false, `${skill} on a picked spec`);
assert.equal(noteSwitchShows(entry(skill), scan, sel("exploring", { planChange: true })), false, `${skill} on a picked spec with a brief`);
}
const diagnose = entry("plan2code-diagnose");
assert.equal(noteSwitchShows(diagnose, scan, null), true, "Diagnose on Start fresh");
assert.equal(noteSwitchShows(diagnose, scan, sel("documented")), true, "Diagnose launches untargeted, so a picked spec does not hide it");
const revise = entry("plan2code-1b-revise-plan");
assert.equal(noteSwitchShows(revise, scan, null), false, "Revise plan is grayed on Start fresh");
for (const state of ["documented", "building", "built"]) {
+2
View File
@@ -973,6 +973,8 @@ test("POST /notepad/tab/sent answers 200, 400 and 404, and GET /notepad carries
assert.equal(ok.body.ok, true);
assert.equal(ok.body.sent.workflow, "quick-task");
assert.deepEqual((await getJson(s, "/notepad")).body.tabs, [{ id, name: "Idea", sent: ok.body.sent }]);
assert.equal((await post({ id, workflow: "diagnose" })).status, 200, "Diagnose can be sent from a tab");
assert.equal((await post({ id, workflow: "quick-task" })).status, 200);
assert.deepEqual(await post({ id, workflow: "document" }), { status: 400, body: { error: "bad-sent" } });
assert.deepEqual(await post({ id, workflow: "revise-plan", spec: "../x" }), { status: 400, body: { error: "bad-sent" } });
assert.deepEqual(await post({ id: "ffffffffffff", workflow: "plan" }), { status: 404, body: { error: "no-such-tab" } });
@@ -581,6 +581,8 @@ test("the Notebook switch shows on Start fresh for Pathfinder, Plan and Quick Ta
assert.equal(await offersNote(main, "paused", "/plan2code-1b-revise-plan"), false, "Revise plan with a brief waiting");
assert.equal(await offersNote(main, "ready", "/plan2code-3-implement"), false, "Implement never");
assert.equal(await offersNote(main, "Start from scratch", "/plan2code-xray"), false, "a utility never");
assert.equal(await offersNote(main, "Start from scratch", "/plan2code-diagnose"), true, "Diagnose on Start fresh");
assert.equal(await offersNote(main, "ready", "/plan2code-diagnose"), true, "Diagnose on a picked spec");
});
test("the switch lists the Notebook's tabs beside a preview: an empty tab grayed, five ticks at most, a Long tab note, and + note: on the command", async (t) => {
+1 -1
View File
@@ -114,7 +114,7 @@ const isFile = (p) => {
// The workflows a tab can be sent to from the dashboard, and the spec a Revise
// plan send names.
export const SENT_WORKFLOWS = ["pathfinder", "plan", "quick-task", "revise-plan"];
export const SENT_WORKFLOWS = ["pathfinder", "plan", "quick-task", "revise-plan", "diagnose"];
const SENT_SPEC_RE = /^specs\/[A-Za-z0-9._-]+$/;
// A tab's `sent` record as stored, or null when it does not hold up.
+2 -2
View File
@@ -2,10 +2,10 @@
## The bug
An argument that already describes the bug skips the cards it answers. Otherwise one `--wait` batch, no `templates`:
An argument that already describes the bug skips the cards it answers. Otherwise one `--wait` batch, no `templates`; the first card carries `"fill":"note"` (a Notebook tab fills it):
```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","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."}]}
{"title":"Diagnose a bug","headline":{"stage":"The bug","cleared":0,"total":3},"items":[{"id":"bug","kind":"text","title":"What is wrong","fill":"note","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 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.
+5 -3
View File
@@ -715,12 +715,14 @@ const NOTE_FRESH_CARDS = new Set(["plan2code-0-pathfinder", "plan2code-1-plan",
/**
* Whether a lit card's confirm pane offers the Notebook switch: Pathfinder,
* Plan and Quick Task on Start fresh (no spec picked), and Revise plan on a
* picked spec with no plan change brief waiting (a waiting brief is what that
* revision is about). Never on a grayed card, never on any other card.
* Plan and Quick Task on Start fresh (no spec picked), Diagnose whenever it is
* lit (it launches untargeted, so a picked spec does not matter), and Revise
* plan on a picked spec with no plan change brief waiting (a waiting brief is
* what that revision is about). Never on a grayed card, never on any other card.
*/
export function noteSwitchShows(entry, scan, sel) {
if (!entry || !cardAvailability(entry, scan, sel).on) return false;
if (entry.skill === "plan2code-diagnose") return true;
if (NOTE_FRESH_CARDS.has(entry.skill)) return !sel;
if (entry.skill === "plan2code-1b-revise-plan") return Boolean(sel) && sel.planChange !== true;
return false;