mirror of
https://github.com/jparkerweb/plan2code.git
synced 2026-11-29 05:11:19 -08:00
Give Help a Review Loop topic and open it from both Review Loop links
AI Assisted
This commit is contained in:
1 parent
bcb6e43dbd
commit
e0f82cc36b
12 files changed
+152
-14
No files matched your search
@@ -60,7 +60,7 @@ Key design points:
|
||||
- **A loop stop leads with why and what to do next, in two places.** `evidence_markdown` in `loop_driver.rs` opens the report doc with a `> [!CAUTION]` box (the reason, then the stop line) and a `> [!TIP]` box (the advice); `render.js` draws a blockquote that opens with either marker as a colored `md-alert` and hides the marker. The stop card shows the same two as `.loop-why` and `.loop-advice` from `loopEnd.advice`. The advice is the failed phase's own `loopOutcome.nextStep` (one line, 300 characters, optional, only for a `failed` report that refused the phase), else `stop_advice()`'s words for the cause. `failed_words` puts the reason before the agent's summary, since a failed report's summary often reads like success.
|
||||
- **`validate()` in `patches.mjs` enforces four workflow rules mechanically**: max three open required questions, no internal vocabulary in a title, one recommended option, and no loop markers or metrics-scraper bait.
|
||||
- **The palette is written twice for dark, and that duplication is the mechanism.** `@media (prefers-color-scheme: dark) :root:not([data-theme="light"])` follows the system; `:root[data-theme="dark"]` is the explicit choice from the colors panel. Drop the `:not()` and a system-dark browser overrides someone who asked for light. A chosen accent is applied as an inline custom property on `:root` (CSSOM, which the CSP allows), and the default is applied by REMOVING that override so the stylesheet's own per-theme values win. The server's `data-looks-accent` stand-in only lasts until `applyLooks()` runs, which removes it first thing — left on, its rule would beat "Reset this tab".
|
||||
- **Help is in the page, built on first open.** The **?** button (`#btn-about`) opens `<dialog id="help-modal">`, which replaced the old "What this page is" About dialog. Its 23 panels (in four groups, with a filter box above the tab list) and their icon sheet are hand-written HTML and SVG in `<template id="help-content">` in `index.html` (after `#start-poses`), cloned into `#help-panels` the first time **?** is pressed (except the dashboard topic's card list: `buildHelp()` fills its `.help-cards` from `SKILL_CATALOG` and `CATALOG_GROUPS` at that moment, in the dashboard's order), so first load builds nothing and Help still reads fully once the server is gone. `help.js` supplies the tab list and rules, `screens/help-dialog.js` the wiring (tab buttons, roving focus, `renderAbout()` for the live connection line on tab 1, `lightDismiss()`, and a Ctrl/⌘+Enter guard scoped to this dialog). SVG is styled by class and CSS variables only — a `style=` attribute is dropped by the CSP, and a test fails on one — and every number the prose quotes sits in a `data-fact` span a test checks against the constant it comes from.
|
||||
- **Help is in the page, built on first open.** The **?** button (`#btn-about`) opens `<dialog id="help-modal">`, which replaced the old "What this page is" About dialog. Its 24 panels (in four groups, with a filter box above the tab list) and their icon sheet are hand-written HTML and SVG in `<template id="help-content">` in `index.html` (after `#start-poses`), cloned into `#help-panels` the first time **?** is pressed (except the dashboard topic's card list: `buildHelp()` fills its `.help-cards` from `SKILL_CATALOG` and `CATALOG_GROUPS` at that moment, in the dashboard's order), so first load builds nothing and Help still reads fully once the server is gone. `help.js` supplies the tab list and rules, `screens/help-dialog.js` the wiring (tab buttons, roving focus, `renderAbout()` for the live connection line on tab 1, `lightDismiss()`, and a Ctrl/⌘+Enter guard scoped to this dialog). SVG is styled by class and CSS variables only — a `style=` attribute is dropped by the CSP, and a test fails on one — and every number the prose quotes sits in a `data-fact` span a test checks against the constant it comes from.
|
||||
- **Stuck sessions are explained twice, in Help and on the status line.** `stuck` ("When something looks stuck") is the second tab in `HELP_TABS`; its panel opens with a `help-callout` ("Check this first": Plan2Code often waits for a permission in the terminal, which the page cannot see) and four You see / Likely cause / Do this rows before the diagram. The quiet and Not running status lines carry a "What to check" button (`openHelpOn("stuck")`) inside the existing `role="status"` element, so it exists only while the symptom shows. Every finished and paused screen gets a "Before you close this" panel from `renderCloseGuide()` in `renderHandoff()` (Safe to close, Start fresh, Carry on). Tests in `scripts/test-web-console-source.mjs` check the tab order, the callout and rows, and the `renderCloseGuide` call.
|
||||
- **Starting ticks are staged by the page, never answered by the server.** A `multi` row with `ticked: true` is seeded into the person's staged answer once (`seedStaged`, marked in `page.local.seeded`); an `answer` on the item would settle the card before anyone saw it, and a staged answer already flows through Send, drafts, the settled record and the reply words.
|
||||
- **Markdown is rendered to DOM nodes, never to an HTML string** (`public/render.js`), so agent-authored text that quotes a hostile source cannot execute. Only `marked.lexer()` is used.
|
||||
|
||||
@@ -69,7 +69,7 @@ One row per file under `src/web-console/public/` (the games and their sound are
|
||||
| `public/styles/responsive.css` | Print, then the narrow-window rules: last, so its overrides come after everything they override |
|
||||
| `public/styles/shell.css` | The page shell: banner, top bar and meter, layout, sidebar, aside, footer, waiting and arrival |
|
||||
| `public/styles/tokens.css` | Colors, type, sizes and the light and dark themes: the variables every other file reads |
|
||||
| `public/help.js` | the Help dialog's PURE rules: `HELP_TABS` (23 tabs: ids, order, labels, diagram flags; `HELP_GROUPS` and `helpGroupStart()` name the four group headings, Start here, Working in a session, Tools and Reference, each a run of neighbors so grouping never moves a tab; every tab uses the chosen highlight color; Implementation Loop sits right after Watching a build, The git board right after it, and Activities right after Ask a quick question), `helpTabFor()` (which tab opens, FR-8 order, first match wins: finished → Stopping and finishing, server gone or agent adrift → When something looks stuck, opened from the Workspace dialog → Your workspace, then Ask, the Subagents tab → Subagents, a red-meter dashboard → Session meter, dashboard, a doc or the Overview, a git session → The git board, a build, else What this page is) and `helpKeyTarget()` (roving arrow keys, Home, End, wrapping; a re-export of `tabs.js`'s `tabKeyTarget`). No module-scope DOM, so `node --test` covers it |
|
||||
| `public/help.js` | the Help dialog's PURE rules: `HELP_TABS` (24 tabs: ids, order, labels, diagram flags; `HELP_GROUPS` and `helpGroupStart()` name the four group headings, Start here, Working in a session, Tools and Reference, each a run of neighbors so grouping never moves a tab; every tab uses the chosen highlight color; Implementation Loop sits right after Watching a build, Review Loop right after it, The git board right after that, and Activities right after Ask a quick question), `helpTabFor()` (which tab opens, FR-8 order, first match wins: finished → Stopping and finishing, server gone or agent adrift → When something looks stuck, opened from the Workspace dialog → Your workspace, then Ask, the Subagents tab → Subagents, a red-meter dashboard → Session meter, dashboard, a doc or the Overview, a git session → The git board, a build, else What this page is) and `helpKeyTarget()` (roving arrow keys, Home, End, wrapping; a re-export of `tabs.js`'s `tabKeyTarget`). No module-scope DOM, so `node --test` covers it |
|
||||
| `public/tabs.js` | the WAI-ARIA tabs shared by Help and User Preferences: `wireTabs()` (buttons and panel links, roving tabindex, automatic activation, `aria-orientation` switching at 720 px, an optional `beforeSelect` guard) and the pure `tabKeyTarget()` |
|
||||
| `public/prefs.js` | User Preferences' PURE rules: `PREFS_TABS` (Appearance, Agents & models, System, Sounds & activities, with hints and the sections each holds), `prefsOpenTab()` and `prefsResetScope()` (the looks keys Reset this tab resets per tab, or null) |
|
||||
| `public/git-board.js` | PURE, one import (`pr-url.js`): the git board's rules from a `state.git` snapshot: branch order and the Remote only fold at `REMOTE_FOLD` 50, whether a new branch name is free, which buttons show and are enabled, whether the board still waits on the agent (`boardAwaiting()`: from a click until the agent's next post, not just until `wait` collects it), the plain sentence each click sends as `reply`, the "Last refreshed" line, which files start ticked in the commit dialog, the pull-request link, and the current branch's page on its host (`boardBranchLink()`, null until the branch is pushed under its own name); the next step (ten rules, `nextStep()`), the tab that owns it, where it sits on the Save, Share, Review, Tidy path (`PATH_STOPS`, `boardPath()`), whether the task card carries the commit table (`cardShowsFiles()`), per-tab badges (`tabBadges()`), the busy mode and per-control gate (`busyMode()`, `controlAllowed()`), the tab to show (`pickTab()`), and the create-panel sources and clean-up groups. `app.js` only renders what it says |
|
||||
|
||||
@@ -14,7 +14,14 @@
|
||||
### A new file under src/web-console/ needs a row in the AGENTS-architecture console files tables; run scripts/test-web-console-shape.mjs after adding one, since it fails until the row exists.
|
||||
- Kind: convention
|
||||
- About: scripts/test-web-console-shape.mjs, .agents-docs/AGENTS-architecture-console-page.md
|
||||
- Noted: 2026-11-14, implement-review
|
||||
- Why: test-web-console-shape.mjs fails on any file under src/web-console/ the console files tables do not list
|
||||
- Noted: 2026-11-14, implement-review, checked 2026-11-28
|
||||
|
||||
### A new Help topic needs a HELP_TABS entry, a matching hi-<id> icon and help-panel in index.html in the same order, and the topic count raised in the session test and the docs that state it.
|
||||
- Kind: convention
|
||||
- About: src/web-console/public/help.js
|
||||
- Why: openHelpOn() stays on the default topic for an id Help lacks, so the Review Loop link shipped opening Implementation Loop.
|
||||
- Noted: 2026-11-28, quick-task
|
||||
|
||||
### A new page module under src/web-console/public/ must be added to the file list in src/web-console/static.mjs, or the server answers 404 for it and the whole page never draws.
|
||||
- Kind: correction
|
||||
@@ -31,7 +38,8 @@
|
||||
### A no-hop dashboard request goes as a __<name> send; the agent answers with a top-level patch key checked in validate() (patches.mjs), and pointersForSend() maps it to console-launches.md.
|
||||
- Kind: convention
|
||||
- About: src/web-console/patches.mjs, src/web-console/pointers.mjs
|
||||
- Noted: 2026-11-17, quick-task
|
||||
- Why: A patch key validate() does not know is refused with exit 3, and a send pointersForSend() does not map leaves the agent without console-launches.md.
|
||||
- Noted: 2026-11-17, quick-task, checked 2026-11-28
|
||||
|
||||
### A page screen never imports another screen (the shape test forbids it): what two screens share, such as the loop setup field builders, goes in a module beside state.js, like public/loop-parts.js.
|
||||
- Kind: convention
|
||||
@@ -104,7 +112,8 @@
|
||||
### To drive launcher prompts in scripts/test-launcher.mjs, use runAtTerminal(): it marks stdin as a terminal with a preload file and answers each prompt only once it shows on stdout.
|
||||
- Kind: convention
|
||||
- About: scripts/test-launcher.mjs
|
||||
- Noted: 2026-11-17, implement-review
|
||||
- Why: Each launcher prompt opens a new readline, so piping all answers at once loses every answer after the first.
|
||||
- Noted: 2026-11-17, implement-review, checked 2026-11-28
|
||||
|
||||
### When a card in src/plan2code-deps.md changes (what it lists or asks), change the same card in src/web-console/notes/deps.md in the same edit: the console builds the card from the notes.
|
||||
- Kind: correction
|
||||
|
||||
@@ -89,7 +89,7 @@ Scroll down for the utilities. Outside a git repository the **Git** card says so
|
||||
- **Yours to set up.** Light or dark and a highlight color, a **Card width** of Narrow (720px), Comfortable (880px, the default), Wide (1080px) or Ultra wide (1440px), and a role that puts the most useful starters first (see *Your role*). All remembered on your machine.
|
||||
- **Files in your notes, and a notebook of your own.** Attach a screenshot or a document to any note or quick question (see *Attachments in notes and questions*), and keep a private notebook per folder (see *Your notebook*).
|
||||
- **Where you are, at the bottom.** The footer names the folder and its git branch; click it to open the Workspace dialog (see *Your workspace*).
|
||||
- **Help.** The **?** at the top right opens a Help dialog with 23 topics, one per tab, opening on the one for where you are. It is part of the page, so it reads fully even when the page has lost its program.
|
||||
- **Help.** The **?** at the top right opens a Help dialog with 24 topics, one per tab, opening on the one for where you are. It is part of the page, so it reads fully even when the page has lost its program.
|
||||
- Works offline, on your own machine only. No account, no install, no network.
|
||||
|
||||
An Implement phase ends on a sign-off card: read the completion report, then review the code first, approve the phase, or ask for changes. Implement + Review has already reviewed the code, so its card has no review button. Finalize always offers one last review of the whole feature after its checks, before the summary is written and the spec is archived.
|
||||
|
||||
@@ -36,7 +36,7 @@ Details: [Status line](./.agents-docs/AGENTS-architecture-statusline.md)
|
||||
|
||||
## Web Console
|
||||
|
||||
Optional local browser UI (`src/web-console/`, zero dependencies, detached `node` server on `127.0.0.1`) installed once under `~/.plan2code/console/<version>/` (`installSharedConsole` in `install.js`) and reached from every skill through a forwarding stub, `src/web-console-stub/console.mjs`. The bare `plan2code` skill opens its dashboard, a card menu that launches any skill in the same session. Pages cover questions, sign-off gates (with an in-page code review, and in Implement, Implement + Review and Quick task a **Changes** tab: a `diff` doc block fed by the `changes.mjs` skill script, parsed by `public/diff-parse.js` and drawn by `public/diff-view.js`), build progress, the living document, a spec's saved prototypes (a **Prototypes** tab: an `.md` read in place, an `.html` opened in the default browser), an **Ask** chat, a read-only **Workspace** of extra folders (remembered per folder and spec in `~/.plan2code/console/workspaces.json`), a session meter, a **git board** for the `git` workflow (a Save, Share, Review, Tidy path, one task card for the step you are on, and the Changes, Branches and Sync tabs folded into **All branches and tools**; branches, pull, push, commits and pull-request links, drawn from `state.git`; contract in `notes/git.md`), **Stop with a handoff** (handoffs live in `~/.plan2code/handoffs/`, owned by `handoffs.mjs`, swept after 30 days, and offered as dashboard chips to pick up in the same session), a private **Notebook** in the top bar (named tabs of Markdown and pictures, a live-preview CodeMirror editor, one notepad per folder in `~/.plan2code/notepads/`, owned by `notepads.mjs`, private: the agent reads a tab only when you start Pathfinder, Plan, Quick task, Diagnose, UI Prototype or Revise plan from the dashboard with it and send the box it fills (an idea box marked `fill: "note"`, up to five ticked pictures attached), which then marks the tab sent via `POST /notepad/tab/sent`; the agent CLI never imports the store; removed only through Cleanup once a month untouched), **Activities** behind the top bar's die (thirteen small games, Snake, Mini golf, Light Trails, Bug Hunt, Sunset Drive, Stack Deploy, Bumper Ring, Rapids Run, Hot Potato, Crossing Rush, Bounce Road, Ghoul Rush and Flock Dash, listed in `public/activities.js` with one module per game under `public/activities/` (Ghoul Rush is its own folder of modules, `public/activities/ghoul-rush/`) and a card line (`blurb`) each, a picker of game rows in two columns, ordered Recently played or A to Z (saved in `activityOrder`), with never-picked games under Not played yet, once two are listed, that plays one game at a time (another pick drops the last game's round), driven by `screens/activities.js` (keys, key releases for a game with `release()`, canvas pointer events for a game with `pointer()`, one frame timer), paused whenever the person's turn comes and resumed only by the person (while that pause's banner is up, only by its **Unpause game** button), best scores in flat `activityBest<Id>` keys in `looks.json` (and the time each game was last picked in `activityPlayed<Id>`) (lowest wins for a game that sets `lowerIsBetter`; Mini golf opens on a dashboard of its six 18-hole courses, one file each under `public/activities/golf-course-<id>.js`, and keeps a best per course, `activityBestGolf<Course>`), and one number a game may keep between sessions in `activityMemo<Id>` (Snake's tally of surprises found, Light Trails' furthest arena, Bug Hunt's tally of finds, Sunset Drive's roads found, Stack Deploy's highest floor, Bumper Ring's furthest arena, Rapids Run's furthest dam, Hot Potato's furthest venue, Crossing Rush's furthest zone, Bounce Road's furthest stage, Ghoul Rush's most stages cleared in a run, Flock Dash's furthest stage), never shown to the agent), a built-in 23-topic Help, the app-only **Implementation Loop** (a dashboard card and a setup screen drawn by the page, `public/screens/loop-setup.js`; the last setup remembered per project in `~/.plan2code/console/loop-setup.json`, owned by `loop-setup.mjs`; a page that locks while `state.loop.driving` is set, until the app posts `loopEnd`; a skill run with `--loop` reports a `loopOutcome` instead of asking for sign-off, per `notes/loop.md`), the app-only **Review Loop** (a card beside it, `screens/review-loop-setup.js`, the setup remembered in `~/.plan2code/console/review-loop-setup.json` owned by `review-loop-setup.mjs`; the app's `review_loop.rs` drives review-and-fix rounds, each a Review session opened with `--loop --round N --role` that reports a `roundOutcome` per `notes/review-loop.md`; its end screen is `public/review-loop-end.js`), a first-run Welcome, User Preferences (gear: four tabs, Appearance, Agents & models, System and Sounds & activities, on the `public/tabs.js` helper Help also uses, with `public/prefs.js`, `screens/prefs-dialog.js` and `screens/agents-view.js`), an agent-less **setup** page (the `setup` workflow `plan2code` or the desktop app opens wheLine truncated
|
||||
Optional local browser UI (`src/web-console/`, zero dependencies, detached `node` server on `127.0.0.1`) installed once under `~/.plan2code/console/<version>/` (`installSharedConsole` in `install.js`) and reached from every skill through a forwarding stub, `src/web-console-stub/console.mjs`. The bare `plan2code` skill opens its dashboard, a card menu that launches any skill in the same session. Pages cover questions, sign-off gates (with an in-page code review, and in Implement, Implement + Review and Quick task a **Changes** tab: a `diff` doc block fed by the `changes.mjs` skill script, parsed by `public/diff-parse.js` and drawn by `public/diff-view.js`), build progress, the living document, a spec's saved prototypes (a **Prototypes** tab: an `.md` read in place, an `.html` opened in the default browser), an **Ask** chat, a read-only **Workspace** of extra folders (remembered per folder and spec in `~/.plan2code/console/workspaces.json`), a session meter, a **git board** for the `git` workflow (a Save, Share, Review, Tidy path, one task card for the step you are on, and the Changes, Branches and Sync tabs folded into **All branches and tools**; branches, pull, push, commits and pull-request links, drawn from `state.git`; contract in `notes/git.md`), **Stop with a handoff** (handoffs live in `~/.plan2code/handoffs/`, owned by `handoffs.mjs`, swept after 30 days, and offered as dashboard chips to pick up in the same session), a private **Notebook** in the top bar (named tabs of Markdown and pictures, a live-preview CodeMirror editor, one notepad per folder in `~/.plan2code/notepads/`, owned by `notepads.mjs`, private: the agent reads a tab only when you start Pathfinder, Plan, Quick task, Diagnose, UI Prototype or Revise plan from the dashboard with it and send the box it fills (an idea box marked `fill: "note"`, up to five ticked pictures attached), which then marks the tab sent via `POST /notepad/tab/sent`; the agent CLI never imports the store; removed only through Cleanup once a month untouched), **Activities** behind the top bar's die (thirteen small games, Snake, Mini golf, Light Trails, Bug Hunt, Sunset Drive, Stack Deploy, Bumper Ring, Rapids Run, Hot Potato, Crossing Rush, Bounce Road, Ghoul Rush and Flock Dash, listed in `public/activities.js` with one module per game under `public/activities/` (Ghoul Rush is its own folder of modules, `public/activities/ghoul-rush/`) and a card line (`blurb`) each, a picker of game rows in two columns, ordered Recently played or A to Z (saved in `activityOrder`), with never-picked games under Not played yet, once two are listed, that plays one game at a time (another pick drops the last game's round), driven by `screens/activities.js` (keys, key releases for a game with `release()`, canvas pointer events for a game with `pointer()`, one frame timer), paused whenever the person's turn comes and resumed only by the person (while that pause's banner is up, only by its **Unpause game** button), best scores in flat `activityBest<Id>` keys in `looks.json` (and the time each game was last picked in `activityPlayed<Id>`) (lowest wins for a game that sets `lowerIsBetter`; Mini golf opens on a dashboard of its six 18-hole courses, one file each under `public/activities/golf-course-<id>.js`, and keeps a best per course, `activityBestGolf<Course>`), and one number a game may keep between sessions in `activityMemo<Id>` (Snake's tally of surprises found, Light Trails' furthest arena, Bug Hunt's tally of finds, Sunset Drive's roads found, Stack Deploy's highest floor, Bumper Ring's furthest arena, Rapids Run's furthest dam, Hot Potato's furthest venue, Crossing Rush's furthest zone, Bounce Road's furthest stage, Ghoul Rush's most stages cleared in a run, Flock Dash's furthest stage), never shown to the agent), a built-in 24-topic Help, the app-only **Implementation Loop** (a dashboard card and a setup screen drawn by the page, `public/screens/loop-setup.js`; the last setup remembered per project in `~/.plan2code/console/loop-setup.json`, owned by `loop-setup.mjs`; a page that locks while `state.loop.driving` is set, until the app posts `loopEnd`; a skill run with `--loop` reports a `loopOutcome` instead of asking for sign-off, per `notes/loop.md`), the app-only **Review Loop** (a card beside it, `screens/review-loop-setup.js`, the setup remembered in `~/.plan2code/console/review-loop-setup.json` owned by `review-loop-setup.mjs`; the app's `review_loop.rs` drives review-and-fix rounds, each a Review session opened with `--loop --round N --role` that reports a `roundOutcome` per `notes/review-loop.md`; its end screen is `public/review-loop-end.js`), a first-run Welcome, User Preferences (gear: four tabs, Appearance, Agents & models, System and Sounds & activities, on the `public/tabs.js` helper Help also uses, with `public/prefs.js`, `screens/prefs-dialog.js` and `screens/agents-view.js`), an agent-less **setup** page (the `setup` workflow `plan2code` or the desktop app opens wheLine truncated
|
||||
|
||||
One agent list and one lookup rule serve the launcher, the console and the app: `src/launcher/agents.json` (the built-ins and starter templates with per-OS install data) and `src/web-console/agent-lookup.mjs` (`loadAgentList()` and `findAgent()`, both copied by `install.js` into `~/.plan2code/bin/`); the app carries a Rust twin held to the same cases by `scripts/fixtures/agent-lookup-cases.json`.
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ All notable changes to Plan2Code will be documented in this file.
|
||||
- **Desktop app**: round 1 reviews the whole change and each later round only the last round's fixes; the app counts a round clean only with the reviewer's report, tests that ran and passed, and no Critical or Warning, and an agent that cannot start its own reviewer gets a separate reviewer and fixer session.
|
||||
- **Desktop app**: the Review Loop's banner shows a dot per round with its counts, the Suggestions batch and final check by name, Stop after this round, and Stop now with Keep or Discard for the unfinished round.
|
||||
- **Desktop app**: the Review Loop ends on one report (also saved as `REVIEW-LOOP-<date>.md` for a spec's work) listing every finding still open, with Continue one round at a time up to 6, the Suggestions pick, an optional squash of the round commits, PR Prep and Fix what's left by hand.
|
||||
- **Desktop app**: Help has a Review Loop topic (with a diagram of the rounds), opened by How the Review Loop works on the dashboard card and on the setup screen.
|
||||
- **Learning**: before the lessons card asks for approval, a fresh read-only helper (or the same agent in a separate step) grades every waiting lesson on four tests; each row shows its Fails and Doubts with reasons, the card says who checked and how long it took, and a suggested wording can be taken with Use this wording.
|
||||
- **Learning**: a Tidy up action (in the banner when lessons near their limit, and in the dashboard's menu) proposes merging, rewording, retiring or moving saved lessons, each graded by the same check before you decide.
|
||||
- **Learning**: the lessons reader shows under each lesson how often it was followed and when last (recorded on this machine only).
|
||||
|
||||
@@ -693,15 +693,17 @@ test("the favicon is served as an SVG with a PNG fallback and the page points at
|
||||
/* ---------------------------------------------------------------- help */
|
||||
|
||||
|
||||
test("help: 23 tabs with unique ids", () => {
|
||||
assert.equal(HELP_TABS.length, 23);
|
||||
assert.equal(new Set(HELP_TABS.map((t) => t.id)).size, 23);
|
||||
test("help: 24 tabs with unique ids", () => {
|
||||
assert.equal(HELP_TABS.length, 24);
|
||||
assert.equal(new Set(HELP_TABS.map((t) => t.id)).size, 24);
|
||||
assert.ok(Object.isFrozen(HELP_TABS) && HELP_TABS.every((t) => Object.isFrozen(t)), "the tab list is frozen");
|
||||
const ids = HELP_TABS.map((t) => t.id);
|
||||
assert.equal(ids.indexOf("learning"), ids.indexOf("dashboard") + 1, "Learning comes right after The dashboard");
|
||||
assert.equal(ids.indexOf("loop"), ids.indexOf("build") + 1, "Implementation Loop comes right after Watching a build");
|
||||
assert.equal(HELP_TABS[ids.indexOf("loop")].label, "Implementation Loop");
|
||||
assert.equal(ids.indexOf("git"), ids.indexOf("loop") + 1, "The git board comes right after Implementation Loop");
|
||||
assert.equal(ids.indexOf("review-loop"), ids.indexOf("loop") + 1, "Review Loop comes right after Implementation Loop");
|
||||
assert.equal(HELP_TABS[ids.indexOf("review-loop")].label, "Review Loop");
|
||||
assert.equal(ids.indexOf("git"), ids.indexOf("review-loop") + 1, "The git board comes right after Review Loop");
|
||||
assert.equal(HELP_TABS[ids.indexOf("git")].label, "The git board");
|
||||
assert.equal(helpTabFor({ workflow: "git" }), "git");
|
||||
assert.equal(ids.indexOf("deps"), ids.indexOf("git") + 1, "Update dependencies comes right after The git board");
|
||||
|
||||
@@ -405,6 +405,23 @@ test("help: the stuck tab is second, and openHelpOn only opens a tab that exists
|
||||
assert.match(opener[1], /HELP_TABS\.some\(/, "openHelpOn only opens a tab that exists");
|
||||
});
|
||||
|
||||
// A link that names a topic Help lacks falls back to wherever Help opened, so
|
||||
// each loop's "How it works" link must open a topic of its own that exists.
|
||||
test("help: each loop's link opens its own Help topic", () => {
|
||||
const ids = HELP_TABS.map((t) => t.id);
|
||||
assert.ok(ids.includes("review-loop"), "Help has a Review Loop topic");
|
||||
assert.equal(HELP_TABS[ids.indexOf("review-loop")].label, "Review Loop");
|
||||
const dash = publicSource("screens/dashboard.js");
|
||||
const link = dash.match(/function loopHelpLink\(entry\) \{([\s\S]*?)\n\}/);
|
||||
assert.ok(link, "dashboard.js has loopHelpLink");
|
||||
assert.match(link[1], /openHelpOn\(review \? "review-loop" : "loop"\)/, "the dashboard's Review Loop link opens Review Loop, the other opens Implementation Loop");
|
||||
const setup = publicSource("screens/review-loop-setup.js");
|
||||
assert.match(setup, /"How the Review Loop works"/, "the Review Loop setup screen names its own loop");
|
||||
assert.match(setup, /openHelpOn\("review-loop"\)/, "the Review Loop setup screen opens Review Loop");
|
||||
assert.doesNotMatch(setup, /openHelpOn\("loop"\)/, "the Review Loop setup screen never opens Implementation Loop");
|
||||
assert.match(publicSource("screens/loop-setup.js"), /openHelpOn\("loop"\)/, "the Implementation Loop setup still opens Implementation Loop");
|
||||
});
|
||||
|
||||
test("models: the page's built-in rows match the shipped agent list's builtins", () => {
|
||||
const app = publicSource("screens/agents/agents-data.js");
|
||||
const list = (src) => JSON.parse(src.match(/const MODEL_CLIS = (\[[^\]]*\]);/)[1]);
|
||||
|
||||
@@ -24,6 +24,7 @@ export const HELP_TABS = Object.freeze([
|
||||
tab("meter", "Session meter", false),
|
||||
tab("build", "Watching a build", false),
|
||||
tab("loop", "Implementation Loop", true),
|
||||
tab("review-loop", "Review Loop", true),
|
||||
tab("git", "The git board", false),
|
||||
tab("deps", "Update dependencies", false),
|
||||
tab("subagents", "Subagents", false),
|
||||
|
||||
@@ -1129,6 +1129,12 @@
|
||||
<path d="M5 12a7 7 0 0 1 12-5l2 2M19 12a7 7 0 0 1-12 5l-2-2" />
|
||||
<path d="M19 4v5h-5M5 20v-5h5" />
|
||||
</symbol>
|
||||
<symbol id="hi-review-loop" viewBox="0 0 24 24" fill="none">
|
||||
<path d="m17 2.5 4 4-4 4" />
|
||||
<path d="M3 11V9a4 4 0 0 1 4-4h14" />
|
||||
<path d="m7 21.5-4-4 4-4" />
|
||||
<path d="M21 13v2a4 4 0 0 1-4 4H3" />
|
||||
</symbol>
|
||||
<symbol id="hi-git" viewBox="0 0 24 24" fill="none">
|
||||
<circle cx="6" cy="5" r="2" />
|
||||
<circle cx="6" cy="19" r="2" />
|
||||
@@ -2606,6 +2612,108 @@
|
||||
</p>
|
||||
</section>
|
||||
|
||||
<section class="help-panel" data-tab="review-loop">
|
||||
<h3>Review Loop</h3>
|
||||
<p class="help-lead">
|
||||
In the desktop app, the Review Loop reviews a finished change and fixes
|
||||
what it finds, in rounds, on its own. Each round's reviewer starts
|
||||
fresh. The dashboard's Review Loop card starts it.
|
||||
</p>
|
||||
<figure class="help-figure" data-figure="review-loop">
|
||||
<svg class="help-diagram" viewBox="0 0 560 110" role="img" aria-labelledby="hd-review-loop-title hd-review-loop-desc">
|
||||
<title id="hd-review-loop-title">The rounds of a Review Loop</title>
|
||||
<desc id="hd-review-loop-desc">
|
||||
You answer the setup once. Then, each round, a fresh reviewer reviews
|
||||
the change, the findings are fixed and the round is committed. The
|
||||
rounds repeat until one comes back clean or the round cap is reached,
|
||||
and a report is written at the end.
|
||||
</desc>
|
||||
<defs>
|
||||
<marker id="hd-review-loop-arrow" viewBox="0 0 8 8" refX="7" refY="4" markerWidth="5" markerHeight="5" orient="auto-start-reverse">
|
||||
<path class="hd-arrow" d="M0 0 L8 4 L0 8 z" />
|
||||
</marker>
|
||||
</defs>
|
||||
<rect class="hd-box" x="1" y="22" width="94" height="40" rx="8" />
|
||||
<rect class="hd-accent" x="117" y="22" width="94" height="40" rx="8" />
|
||||
<rect class="hd-box" x="233" y="22" width="94" height="40" rx="8" />
|
||||
<rect class="hd-box" x="349" y="22" width="94" height="40" rx="8" />
|
||||
<rect class="hd-box" x="465" y="22" width="94" height="40" rx="8" />
|
||||
<text class="hd-label" x="48" y="47" text-anchor="middle">Setup</text>
|
||||
<text class="hd-label hd-accent" x="164" y="47" text-anchor="middle">Review</text>
|
||||
<text class="hd-label" x="280" y="47" text-anchor="middle">Fixes</text>
|
||||
<text class="hd-label" x="396" y="47" text-anchor="middle">Commit</text>
|
||||
<text class="hd-label" x="512" y="47" text-anchor="middle">Report</text>
|
||||
<path class="hd-line" d="M96 42 H114" marker-end="url(#hd-review-loop-arrow)" />
|
||||
<path class="hd-line" d="M212 42 H230" marker-end="url(#hd-review-loop-arrow)" />
|
||||
<path class="hd-line" d="M328 42 H346" marker-end="url(#hd-review-loop-arrow)" />
|
||||
<path class="hd-line" d="M444 42 H462" marker-end="url(#hd-review-loop-arrow)" />
|
||||
<path class="hd-flow" d="M164 16 V8 H396 V16" />
|
||||
<text class="hd-label small" x="280" y="90" text-anchor="middle">once per round, until a clean one</text>
|
||||
</svg>
|
||||
<figcaption>Commit is on only when you leave it on in the setup.</figcaption>
|
||||
</figure>
|
||||
<h4>What it reviews</h4>
|
||||
<ul>
|
||||
<li>
|
||||
<strong>Branch against main, with uncommitted changes</strong>:
|
||||
everything the branch changed since it left main.
|
||||
</li>
|
||||
<li><strong>Uncommitted changes only</strong>: what your working tree holds right now.</li>
|
||||
<li><strong>A spec's work</strong>: the files the chosen spec's phases built.</li>
|
||||
</ul>
|
||||
<p>
|
||||
Round 1 reviews the whole change. Each later round reviews only what
|
||||
the round before it fixed. Please do not edit the project's files while
|
||||
rounds run: anything changed goes into the round.
|
||||
</p>
|
||||
<h4>Rounds and fixes</h4>
|
||||
<ul>
|
||||
<li>
|
||||
Each round has a <strong>fresh reviewer</strong>, whatever the
|
||||
Subagents switch says, and the findings are fixed in the same round.
|
||||
An agent that cannot start helpers runs a reviewer session, then a
|
||||
fixer session.
|
||||
</li>
|
||||
<li>
|
||||
The <strong>round cap</strong> (1 to 6) is the most rounds it runs.
|
||||
It stops sooner on a clean round.
|
||||
</li>
|
||||
<li>
|
||||
Suggestions are listed in the report for you to pick, unless you turn
|
||||
on <strong>Apply Suggestions on their own</strong>; then they are
|
||||
applied in one last pass.
|
||||
</li>
|
||||
<li>
|
||||
With <strong>Commit each round</strong> on, every round is committed
|
||||
to the branch you are on. It never pushes.
|
||||
</li>
|
||||
<li>
|
||||
A round that goes quiet longer than the minutes you set is retried once.
|
||||
</li>
|
||||
</ul>
|
||||
<h4>Stopping it</h4>
|
||||
<ul>
|
||||
<li>
|
||||
<strong>Stop after this round</strong>, on the banner at the top of
|
||||
the window, lets the round finish, then ends the loop.
|
||||
</li>
|
||||
<li>
|
||||
<strong>Stop now</strong> ends the agent at once. The end screen then
|
||||
asks whether to keep or discard what the round had changed.
|
||||
</li>
|
||||
</ul>
|
||||
<h4>The end screen</h4>
|
||||
<p>
|
||||
It says why the loop ended (clean, the round cap, you, or a failure) and
|
||||
<strong>Read the full report</strong> opens what each round found and
|
||||
fixed. Before you sign off you can add another round, up to 6 in all
|
||||
(<strong>Run one more round</strong> after the round cap,
|
||||
<strong>Continue</strong> after another stop), tick Suggestions to apply in one last pass, and squash
|
||||
the round commits into one. After sign-off it offers PR Prep, a Quick
|
||||
task for the Critical and Warning findings still open, or the dashboard.
|
||||
</p>
|
||||
</section>
|
||||
|
||||
<!-- Tab 14: The git board -->
|
||||
<section class="help-panel" data-tab="git">
|
||||
<h3>The git board</h3>
|
||||
|
||||
@@ -832,7 +832,7 @@ function loopHelpLink(entry) {
|
||||
const review = entry && entry.skill === REVIEW_LOOP_SKILL;
|
||||
const a = el("button", "dash-card-link", review ? "How the Review Loop works" : "How the loop works");
|
||||
a.type = "button";
|
||||
a.addEventListener("click", () => hooks.openHelpOn("loop"));
|
||||
a.addEventListener("click", () => hooks.openHelpOn(review ? "review-loop" : "loop"));
|
||||
return a;
|
||||
}
|
||||
|
||||
|
||||
@@ -186,9 +186,9 @@ export function renderReviewLoopSetup(main) {
|
||||
back.type = "button";
|
||||
back.addEventListener("click", close);
|
||||
actions.appendChild(back);
|
||||
const help = el("button", "linky loop-help", "How the loop works");
|
||||
const help = el("button", "linky loop-help", "How the Review Loop works");
|
||||
help.type = "button";
|
||||
help.addEventListener("click", () => hooks.openHelpOn("loop"));
|
||||
help.addEventListener("click", () => hooks.openHelpOn("review-loop"));
|
||||
actions.appendChild(help);
|
||||
pane.appendChild(actions);
|
||||
main.appendChild(pane);
|
||||
|
||||
Reference in new issue
Block a user