From 765d2b3536283bf98eefa3e2ffc9cc4d27ce6918 Mon Sep 17 00:00:00 2001 From: Justin Parker Date: Mon, 26 Oct 2026 06:03:07 -0700 Subject: [PATCH] Show each helper's strength and effort as colored level badges AI Assisted --- CHANGELOG.md | 2 +- scripts/test-web-console-logic.mjs | 16 +++++++++++++- scripts/test-web-console-page-ask.mjs | 7 +++++- src/web-console/public/screens/ask.js | 19 +++++++++++++++- src/web-console/public/styles/pieces.css | 28 +++++++++++++++++++++++- src/web-console/public/styles/tokens.css | 19 ++++++++++++++++ src/web-console/public/subagents.js | 16 ++++++++++++-- 7 files changed, 100 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index deab96b..533cd18 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,7 @@ All notable changes to Plan2Code will be documented in this file. - **desktop app**: the window's own title (and so its taskbar entry) now reads **Plan2Code - <folder name>** once a project is open, instead of a plain **Plan2Code** every window shares; two or more windows on different projects read apart without opening each one to check. - **helpers**: a helper (subagent) no longer has to run on the session's own model and effort. A new shared reference, `helper-strength.md`, shipped in Pathfinder, Quick Task, Implement, Implement + Review and Review, matches each helper job to a strength (`light`, `standard`, `strongest` or `inherit`) and an effort (`low`, `medium` or `high`) from signals that can be checked, with floors, one-step escalation and a fallback order for tools that cannot set either, and never names a model or vendor. Review, Implement + Review and Pathfinder name the strength for the helpers they start, and the rules apply in terminal sessions too. - **helpers**: Plan and Revise Plan now offer helpers (subagents), with the web console's **Subagents** button in the top bar, on by default like the other opted-in skills. Each skill has its own rule for what is independent enough to hand off. Plan uses helpers for reading the sources the person names, mapping separate areas of the codebase in Phase 2, gathering evidence on each open tech choice in Phase 4, and one fresh cross-check of the PLAN-DRAFT against the conversation in Phase 7; questions, decisions, sign-offs and the writing of the PLAN-DRAFT stay with the session. Revise Plan uses read-only lookups on the code behind affected and at-risk completed tasks at Steps 1 and 2 and, only after approval and when a revision touches 3 or more phase files, one helper per phase file to apply the approved edits under `specs/`. The rules live in each skill's Helpers section, so they apply in terminal sessions too. `helper-strength.md` now ships in both, with a row for each new kind of helper job (Plan's recon reuses the lookups row) and the PLAN-DRAFT cross-check held at `standard` or above, like a review. -- **web console**: the Subagents dialog has a **Helper strength** choice under Helpers: **Balanced** (the default), **Thrifty**, **Best** or **Match my session**, saved per project and skill and delivered to the agent as a `Helper strength:` line. Helper reports may say what each helper ran with (`strength`, `effort`), and the Subagents tab shows it as one quiet line, such as "Standard, medium effort". +- **web console**: the Subagents dialog has a **Helper strength** choice under Helpers: **Balanced** (the default), **Thrifty**, **Best** or **Match my session**, saved per project and skill and delivered to the agent as a `Helper strength:` line. Helper reports may say what each helper ran with (`strength`, `effort`), and the Subagents tab shows each as a colored badge with a small three-bar level mark (teal for low, amber for medium, violet for high; the session's own model in plain grey), while screen readers still hear one line, such as "Standard, medium effort". - `plan2code` opens the app automatically when a desktop is available; `plan2code --classic` (or no desktop, e.g. over SSH) keeps today's terminal-only flow unchanged, and the installer brings the app in alongside the skills and the command. ### 🔧 Changed diff --git a/scripts/test-web-console-logic.mjs b/scripts/test-web-console-logic.mjs index e2e60e5..30af419 100644 --- a/scripts/test-web-console-logic.mjs +++ b/scripts/test-web-console-logic.mjs @@ -2164,7 +2164,7 @@ test("subagents: helperRows turns a reported strength and effort into one line, } for (const extra of [{}, { strength: "huge", effort: "max" }]) { const row = line(extra); - for (const key of ["strengthLine", "strength", "effort"]) assert.equal(key in row, false, `${JSON.stringify(extra)}: no ${key}`); + for (const key of ["strengthLine", "badges", "strength", "effort"]) assert.equal(key in row, false, `${JSON.stringify(extra)}: no ${key}`); } }); @@ -2180,6 +2180,20 @@ test("page: the Subagents button sits right after Write a brief, and its dialog assert.ok(dialog, "index.html has the Subagents dialog"); for (const id of ["subagents-instruction", "subagents-default", "subagents-max", "subagents-checkin", "subagents-research", "subagents-status", "subagents-cancel", "subagents-save"]) { assert.ok(dialog[1].includes(`id="${id}"`), `the dialog carries #${id}`); +test("subagents: helperRows gives each reported strength and effort a badge ranked 1-3, and the session's own model rank 0", () => { + const badges = (extra) => helperRows([{ id: "h1", title: "One", ask: "a", state: "running", ...extra }]).rows[0].badges; + assert.deepEqual(badges({ strength: "standard", effort: "high" }), [ + { kind: "strength", label: "Standard", level: 2 }, + { kind: "effort", label: "High effort", level: 3 }, + ]); + assert.deepEqual(badges({ strength: "light" }), [{ kind: "strength", label: "Light", level: 1 }]); + assert.deepEqual(badges({ strength: "strongest", effort: "low" }).map((b) => b.level), [3, 1]); + assert.deepEqual(badges({ strength: "inherit", effort: "medium" }), [ + { kind: "strength", label: "Session model", level: 0 }, + { kind: "effort", label: "Medium effort", level: 2 }, + ]); +}); + } assert.doesNotMatch(dialog[1], /\sstyle=/); assert.doesNotMatch(dialog[1], /