@babylonjs-toolkit/agent 1.2.2 → 1.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Babylon Toolkit Desktop Agent (1.2.
|
|
1
|
+
# Babylon Toolkit Desktop Agent (1.2.3)
|
|
2
2
|
|
|
3
3
|
The desktop agent owns the entire pipeline end to end — frontend and UI design, gameplay code, shaders, generated art and audio, 3D models in headless Blender, whole game levels and prefabs in a terminal-driven Unity Editor, the interactive glTF export, the web build, the dev server, and visual QA by screenshotting both Unity and the running browser.
|
|
4
4
|
|
|
@@ -318,13 +318,17 @@ only when something changed — a task result, a finished run, the next run star
|
|
|
318
318
|
reopened because you added a task after it was complete (the dashboard drops back to *paused* and
|
|
319
319
|
the After Action Report is revised when the new work is done). A `check` at every phase boundary and
|
|
320
320
|
at run end fails if anything was skipped — a plan without its dashboard, tasks that differ from the plan,
|
|
321
|
-
a *complete* that is not, a visual task with no snapshot,
|
|
321
|
+
a *complete* that is not, a visual task with no snapshot, frames saved to `snapshots/` that never reached
|
|
322
|
+
the page, a ticked task with no verifier result. Phase by
|
|
322
323
|
phase and task by task it shows what was actually done, files, tests, verifier verdicts, attempts,
|
|
323
324
|
decisions, deferrals and follow-ups. The snapshots tell the story of the build, taken from the captures
|
|
324
|
-
the work already makes (never an extra session just for a picture):
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
325
|
+
the work already makes (never an extra session just for a picture): a plan-wide "before" ahead of T1;
|
|
326
|
+
for every visual task a **progression** from the same camera as each meaningful layer lands (a terrain:
|
|
327
|
+
heightmap → textures → roads → trees → foliage → lighting) — the builder's before, milestone and built
|
|
328
|
+
frames, then the verifier's verified frames — played back as a storyboard, plus before/after sliders and
|
|
329
|
+
stills where those prove the point, and one plan-wide before/after in the After Action Report. They reach
|
|
330
|
+
the page while the task is being built: the helper refuses to mark a task built while a frame saved for it
|
|
331
|
+
is not on the dashboard, or a visual task built with no frame at all. When later work
|
|
328
332
|
revises an earlier result, the earlier entry is marked **Updated** with who changed it and why —
|
|
329
333
|
nothing is rewritten silently.
|
|
330
334
|
|
package/package.json
CHANGED
|
@@ -25,6 +25,7 @@ Run tasks from a plan: build each with its tests, have an independent verifier c
|
|
|
25
25
|
|
|
26
26
|
- **TIME MATTERS** (default): follow *Work fast*, take the direct route, never re-read. Print `⏱️ [bt-execute] TIME MATTERS` (or `⏱️ [bt-execute] No time limit`) and start every subagent prompt with `TIME MATTERS.` unless it is off. Speed never relaxes tests, the verifier, live checks or "tick only on PASS".
|
|
27
27
|
- **Never commit** — no git commit, stage, stash, reset, checkout, push or branch switch, in any mode. Changes stay in the working tree.
|
|
28
|
+
- **Snapshots tell the story — ENFORCED.** The dashboard's snapshots are the chronicle of how the plan came together, read long after the run; a row of "No snapshot" loses that record for good. Every visual task leaves its progression on the page *as it is built*, through `dashboard.mjs snapshot` only (*Snapshots tell the story*, below). Speed, TIME MATTERS and `--auto-pilot` never thin it.
|
|
28
29
|
- **Scope:** only the selected tasks. Ambiguous, or blocked by an unfinished task → stop and tell the user *(auto-pilot: decide, log it)*.
|
|
29
30
|
- **Open the run first** — before docs, code or pre-flight: take the clock, append `⏱ Run <n> start`, do *Run start*, so a refreshed dashboard shows the run within a minute.
|
|
30
31
|
- **Read the docs once:** for Babylon work, the Agent Reference (https://raw.githubusercontent.com/babylontoolkit/agent/main/reference.md) once per session plus only the sub-documents the tasks need, searched — the authority on conventions and API. Unreadable → stop and tell the user *(auto-pilot: retry 3×, carry on, log it)*. Read the checklist and the `SPEC.md` parts the tasks touch; re-read after a compaction.
|
|
@@ -47,7 +48,7 @@ Work in **phases**: the plan's `### Phase N` groups, else up to 3 consecutive ta
|
|
|
47
48
|
- **Tracks** (`Track: <letter>`): one builder subagent per track, all at once, each given its owned files from the plan's *Tracks and owned files* and the *Parallel rules*. A `Track: integration` task is the closing step you run once the phase's tracks are built. The phase verifier starts when all of it is built; the next phase may build meanwhile unless it depends on this one.
|
|
48
49
|
- **No tracks:** one builder subagent per phase, tasks in order, kept for its fix loop.
|
|
49
50
|
|
|
50
|
-
1. **Build** to the Agent Reference's **Coding Practices — ENFORCED** (clean code in the project's language, full-word names, maintainable structure; JSDoc always, never a fail reason) and, for HUDs and overlays, **Game UI Performance — ENFORCED** (per-frame values through refs and one frame loop, never React state, props, a store or per-frame EventBus messages). Write the tests `Tests:` names (else meaningful Acceptance and edge cases) in the feature folder's `tests/`, in the repo's runner and style; get them green — fix the code, not the test, unless the test is wrong; nothing testable → say so.
|
|
51
|
+
1. **Build** to the Agent Reference's **Coding Practices — ENFORCED** (clean code in the project's language, full-word names, maintainable structure; JSDoc always, never a fail reason) and, for HUDs and overlays, **Game UI Performance — ENFORCED** (per-frame values through refs and one frame loop, never React state, props, a store or per-frame EventBus messages). Write the tests `Tests:` names (else meaningful Acceptance and edge cases) in the feature folder's `tests/`, in the repo's runner and style; get them green — fix the code, not the test, unless the test is wrong; nothing testable → say so. A visual task **saves its progression as it builds** (*Snapshots tell the story*): a "before" frame before its first change, a frame each time a meaningful layer lands, and its built frame, kept from the captures it takes to iterate, from the same camera, and added with `dashboard.mjs snapshot` **before** its `built` write. It checks its own work with **one quick look** (a capture at one viewport, or a scripted probe) and never runs the Acceptance's live proof; that is the verifier's.
|
|
51
52
|
2. **Verify** with an **independent verifier** subagent (charter below) given the changed files — one per phase (`--strict`: per task), the only live checker, returning PASS/FAIL per task with evidence.
|
|
52
53
|
3. **Tick** each passed task `- [x]` at once, unless it depends on one that failed this phase. Never tick partial, skipped or unverified work.
|
|
53
54
|
4. **Fix loop:** the task's builder fixes it and re-runs its tests; then **resume the same verifier** (`SendMessage` or equivalent) with only the failed items and the fix — never a fresh verifier (`--strict`: a fresh adversarial verifier re-checks the whole task). Records-only slips (a stale number or note) you fix and re-check. 3 attempts (`--strict`: 5), each changing something material; stop early when two fail alike with no new idea. Still failing → unticked; stop and report *(auto-pilot: defer, continue)*.
|
|
@@ -62,11 +63,11 @@ Work in **phases**: the plan's `### Phase N` groups, else up to 3 consecutive ta
|
|
|
62
63
|
|
|
63
64
|
### The verifier's charter
|
|
64
65
|
|
|
65
|
-
*"Confirm each task's Acceptance is met and run its `Verify` commands against their expected output. Re-run the tests and the relevant suite once; tests that miss the Acceptance or named edge cases, or could not fail, are a FAIL. Read the diff for real defects: logic errors, broken callers, unhandled named edge cases, documented behavior dropped or inverted, a sibling-skill template re-implemented instead of copied. FAIL a touched code file that breaks Coding Practices — ENFORCED: not in the project's language; needless `any`; one- or two-letter names, cryptic abbreviations or code-golf tricks (loop counters, axis/`uv` names, toolkit aliases and exported-data names excepted); dead code, unused imports, leftover `console.log`; structure a newcomer cannot maintain. FAIL a HUD, overlay or GUI file that breaks Game UI Performance — ENFORCED: a per-frame value (speed, needles, timers, bars) through React state, props, context, a store or a per-frame EventBus post; a setter, `dispatch(` or `EventBus.PostMessage(` inside `requestAnimationFrame`, a frame-loop hook, a render observable or `update()`; `width` / `height` / `top` / `left` / `innerHTML` / SVG geometry written, or layout read, per frame; a Babylon GUI control assigned every frame without a changed-value check; a frame loop on a menu, pause or results screen, splash, preloader or landing page, or doing what CSS could (a 3D or scroll-scrubbed hero that pauses off-screen is fine); a HUD loop writing while hidden or paused; a CSS `transition` on a property the loop writes. Quote the lines. JSDoc is never a FAIL — list gaps under non-blocking `JSDoc notes`. You are the only live checker: check live (browser through `bt-cdp.mjs`, Unity where relevant) every task whose correctness shows only at runtime — rendering, UI, interaction, Unity↔Babylon parity — and the plan's final end-to-end check, judging the running result as a user would, beside any reference image; unit tests never substitute. One session per phase on the running dev server, exporting only as *Work fast* allows.
|
|
66
|
+
*"Confirm each task's Acceptance is met and run its `Verify` commands against their expected output. Re-run the tests and the relevant suite once; tests that miss the Acceptance or named edge cases, or could not fail, are a FAIL. Read the diff for real defects: logic errors, broken callers, unhandled named edge cases, documented behavior dropped or inverted, a sibling-skill template re-implemented instead of copied. FAIL a touched code file that breaks Coding Practices — ENFORCED: not in the project's language; needless `any`; one- or two-letter names, cryptic abbreviations or code-golf tricks (loop counters, axis/`uv` names, toolkit aliases and exported-data names excepted); dead code, unused imports, leftover `console.log`; structure a newcomer cannot maintain. FAIL a HUD, overlay or GUI file that breaks Game UI Performance — ENFORCED: a per-frame value (speed, needles, timers, bars) through React state, props, context, a store or a per-frame EventBus post; a setter, `dispatch(` or `EventBus.PostMessage(` inside `requestAnimationFrame`, a frame-loop hook, a render observable or `update()`; `width` / `height` / `top` / `left` / `innerHTML` / SVG geometry written, or layout read, per frame; a Babylon GUI control assigned every frame without a changed-value check; a frame loop on a menu, pause or results screen, splash, preloader or landing page, or doing what CSS could (a 3D or scroll-scrubbed hero that pauses off-screen is fine); a HUD loop writing while hidden or paused; a CSS `transition` on a property the loop writes. Quote the lines. JSDoc is never a FAIL — list gaps under non-blocking `JSDoc notes`. You are the only live checker: check live (browser through `bt-cdp.mjs`, Unity where relevant) every task whose correctness shows only at runtime — rendering, UI, interaction, Unity↔Babylon parity — and the plan's final end-to-end check, judging the running result as a user would, beside any reference image; unit tests never substitute. One session per phase on the running dev server, exporting only as *Work fast* allows. Save the frames from that session that show each visual task's verified result to `[SNAPSHOTS]` as `T<n>-<NN>-<stage>.png`: the same camera or viewport as the builder's progression, plus any angle or comparison (Unity beside browser, before beside after, running beside reference) that proves the Acceptance. Add each to its task with `dashboard.mjs snapshot` and return each path with its one-line caption. Snapshots never add a page session or an export of their own, but inside your session a capture costs seconds, so take it. Set each task `verifying` as you start it. A test count in the plan means 'named tests pass, no new failures'. Resumed after a fix, re-check only the failed items and what the fix touched. [SCOPE] Return PASS/FAIL per task with evidence, one line on what you ran live and where (or `none — tests only`), and records-only slips separately."*
|
|
66
67
|
|
|
67
|
-
`[SCOPE]` — **standard:** *"Do not add mutation testing, fuzzing, restarts or audits of untouched files unless something you found points there; aim for about 25 tool calls and report rather than expand."* **`--strict`:** *"Be adversarial: actively look for any reason the Acceptance is NOT met — mutation checks against the tests, randomized inputs, re-deriving values from the plan's Decisions and Design Reference, live QA of every rendered or exported surface."* For a task built on a sibling skill (e.g. bt-design's 3D-Hero-Scroll), give the verifier its relevant part — its documented options are Acceptance.
|
|
68
|
+
`[SNAPSHOTS]` is the feature folder's `snapshots/` path. `[SCOPE]` — **standard:** *"Do not add mutation testing, fuzzing, restarts or audits of untouched files unless something you found points there; aim for about 25 tool calls and report rather than expand."* **`--strict`:** *"Be adversarial: actively look for any reason the Acceptance is NOT met — mutation checks against the tests, randomized inputs, re-deriving values from the plan's Decisions and Design Reference, live QA of every rendered or exported surface."* For a task built on a sibling skill (e.g. bt-design's 3D-Hero-Scroll), give the verifier its relevant part — its documented options are Acceptance.
|
|
68
69
|
|
|
69
|
-
**Every subagent gets a brief, not homework:** its task blocks with the Decisions / Design Reference entries they cite, the SPEC.md parts touched, the Reference excerpts needed with links (**always the full Coding Practices — ENFORCED**), its owned files (track builders: plus the *Parallel rules*), the test command, the `wait.mjs` and `bt-cdp.mjs` paths, its exact `dashboard.mjs` lines with the folder filled in (`task`, `snapshot`; `--verbose`: its `details` fields), the project's agent instructions, *Work fast*, and: *"Do not read the Agent Reference or SPEC.md in full — the parts you need are here, and this overrides any standing instruction to read it first. Read one sub-document (search it, never the whole file) only if you hit an API this brief does not cover, and say which."*
|
|
70
|
+
**Every subagent gets a brief, not homework:** its task blocks with the Decisions / Design Reference entries they cite, the SPEC.md parts touched, the Reference excerpts needed with links (**always the full Coding Practices — ENFORCED**), its owned files (track builders: plus the *Parallel rules*), the test command, the `wait.mjs` and `bt-cdp.mjs` paths, its exact `dashboard.mjs` lines with the folder filled in (`task`, `snapshot`; `--verbose`: its `details` fields), **builders and verifiers: the whole *Snapshots tell the story* section**, the project's agent instructions, *Work fast*, and: *"Do not read the Agent Reference or SPEC.md in full — the parts you need are here, and this overrides any standing instruction to read it first. Read one sub-document (search it, never the whole file) only if you hit an API this brief does not cover, and say which."*
|
|
70
71
|
|
|
71
72
|
## Feature folder and dashboard
|
|
72
73
|
|
|
@@ -86,17 +87,29 @@ Work in **phases**: the plan's `### Phase N` groups, else up to 3 consecutive ta
|
|
|
86
87
|
|
|
87
88
|
The page, starter data and live file come from `templates/dashboard/` *(skills loaded through a tool: `load_skill` + `read_skill_resource`; as files: this skill's folder)*; `dashboard.html` is copied with `{{slug}}` replaced, never edited. **`data-schema.md` documents every field, status and snapshot shape — read it once per run; brief each role on its parts.** bt-plan writes all three; create any that is missing. **Every write goes through `scripts/dashboard.mjs`** (atomic, shape-checked; options in its header; no Node → `data-schema.md`'s fallback).
|
|
88
89
|
|
|
89
|
-
- **Three writes per task** (`task <feature-folder> T7 --set '{…}'`): `in-progress` at start (you, launching its builder, or a builder starting its next task); `built` by the builder once green
|
|
90
|
+
- **Three writes per task** (`task <feature-folder> T7 --set '{…}'`): `in-progress` at start (you, launching its builder, or a builder starting its next task); `built` by the builder once green **and its frames are on the dashboard**, with `summary` (what was done, anything surprising), `files`, `tests`; `done` by you at the tick, with `verifier`, `attempts`, `doneAt`, `DECISION` lines and `checkedLive` (what ran live and where, or `""`). The verifier adds `verifying`; a FAIL is `in-progress` with `attempts` + 1; a deferral `deferred` with `deferredReason`.
|
|
90
91
|
- **The helper writes the live file** on every `task` status change and `status` write, keeping *Current run activity* current. Agents never write it; no watchdog is launched.
|
|
91
|
-
- **Snapshots are the chronicle — ENFORCED**, added only with `snapshot <feature-folder> <T<n>|P<N>|plan> --src snapshots/… --caption "…"` (`--before … --after …`: comparison; `--frame "src|stage|caption"` repeated: progression
|
|
92
|
-
- **`check <feature-folder>` is the gate** at every phase boundary and run end; nothing closes while it fails. It catches snapshots that cannot show and skipped deliverables: a missing page or data file, tasks unlike the plan's checklist, a false or summary-less `complete`, a visual task `done` without a snapshot, a ticked task without a verifier result.
|
|
92
|
+
- **Snapshots are the chronicle — ENFORCED**, added only with `snapshot <feature-folder> <T<n>|P<N>|plan> --src snapshots/… --caption "…"` (`--before … --after …`: comparison; `--frame "src|stage|caption"` repeated: progression; target `comparison` with `--before`/`--after`: the plan-wide before/after), never snapshot JSON. Who takes which frames, and when: *Snapshots tell the story*, below.
|
|
93
|
+
- **`check <feature-folder>` is the gate** at every phase boundary and run end; nothing closes while it fails. It catches snapshots that cannot show and skipped deliverables: a missing page or data file, tasks unlike the plan's checklist, a false or summary-less `complete`, a visual task `done` without a snapshot, frames left in `snapshots/` that no entry shows, a ticked task without a verifier result.
|
|
93
94
|
- **A record, never a gate on a task.** Never silently rewrite an earlier result: change it and add `{ at, by: "T<n>", note }` to its `updates` (`--note "…" --by T<n>`), badged **Updated**; superseded snapshots stay.
|
|
94
95
|
|
|
96
|
+
### Snapshots tell the story — ENFORCED
|
|
97
|
+
|
|
98
|
+
The snapshots are how a human sees what was built and how it came together. Choose them for meaning, not coverage, and never just one before and one after per task: show **the story of the build**.
|
|
99
|
+
|
|
100
|
+
- **Progressions first.** For a task with visible output, capture a frame each time a meaningful layer of the work lands, from the **same camera or viewport** every time so the frames line up, and caption each with what that stage added. A terrain: heightmap → splat textures → road network → trees → foliage → baked lighting. A UI: layout → styling → states → motion. A shader: base colour → each lighting term → final. A level: blockout → props → lighting → post. A fix: the fault → the fix. A progression can span several tasks; record it on the phase (`P<N>`), each frame's `task` set.
|
|
101
|
+
- **Then whatever proves the point.** A comparison when a change is best seen side by side (a fix, the state before the phase, Unity beside the browser for parity); a second angle when one view hides it (overview, ground level, close detail); a still when one image proves one thing.
|
|
102
|
+
- **As many frames as the build has meaningful stages:** usually 3–8 for a visual task, none for a task with nothing to see. No near-duplicates and no frame per iteration; a failed attempt only when it explains a decision (say so in the caption).
|
|
103
|
+
- **Who takes them.** *You:* before T1 of the first run changes anything, the **plan-wide "before"** (`snapshots/plan-before.png`) from the camera or viewport that will best show the finished feature. That is the starting state, even if it is an empty scene or the old page; skip it only when the plan has nothing to see. At run end, the plan-wide "after" from the same camera. *The builder:* a "before" frame before the first change of a visual task, milestone frames as each layer lands, and its built frame. It is already capturing to iterate, so it keeps the meaningful frames instead of discarding them, and adds them **before** its `built` write. *The verifier:* the verified frames from its live session. *You* pick, order and caption them into the phase's progression, and add any frame a subagent returned without adding.
|
|
104
|
+
- **Cheap, never extra.** Frames come from the sessions and exports the work already runs, never an extra page session or re-export just for a picture. Inside a session that is open anyway, a capture costs seconds: take it.
|
|
105
|
+
- **The helper holds the line.** `snapshots/` holds only frames worth showing; iteration captures go to scratch. A task cannot move to `built`, `verifying` or `done` while a `snapshots/T<n>-…` frame of its own is on no dashboard entry. A visual task (kind `live`, `game` or `unity`) cannot be `built` with no snapshot at all; `--no-frame "<why>"` is only for a task that truly has nothing to show yet, and the reason lands in the activity log. `check` also fails on a closed phase's unshown `P<N>-…` frames and, once a run has ended, on a `plan-before` the After Action Report does not use. A refusal is fixed by adding the frames, never by moving or deleting them.
|
|
106
|
+
- **Files.** `snapshots/T<n>-<NN>-<stage>.png` (phase-level `P<N>-<NN>-<stage>.png`; plan-wide `plan-before` / `plan-after`), at most about 1600 px wide; JPEG or WebP for large scenes. Unity frames come through the bridge's camera capture, browser frames through `bt-cdp.mjs`. Every frame reaches the page only through `dashboard.mjs snapshot`; a subagent that cannot run it returns paths and captions for you to add.
|
|
107
|
+
|
|
95
108
|
### Run start, phases, run end
|
|
96
109
|
|
|
97
|
-
- **Run start:** create any missing `.agents/specs/`, `complete/`, `archived/`, `profile/`, `recon/` (each with an empty `.gitkeep`); re-copy `dashboard.html` and an existing `documents/<slug>_summary.html` from their templates; **sync the dashboard with the plan** — add missing phases and tasks in plan order as `pending` with an `updates` note (`Added to the plan after <phase 2 ran / it was complete> — <why>`), remove dropped ones with an `activity` line. Then `status <feature-folder> in-progress`, `runs` + 1, the run-log link, an `activity` line; in git, add `.agents/*/*/documents/*_live.js` to `.gitignore` once. Before T1 of the first run, save `snapshots/plan-before.png
|
|
98
|
-
- **Each phase, after its ticks:** status, times and minutes (its `⏱` line), verifier result, a 2–3 sentence summary,
|
|
99
|
-
- **Run end — the After Action Report.** Status from **re-reading the checkboxes**: all `- [x]` → `complete`; all ticked or ⏭️ DEFERRED → `incomplete`; else `paused` — never `in-progress`. Write `followUps` and `afterAction` (fields in `data-schema.md`): headline, body, highlights, **one plan-wide before/after** (`comparison`), the "after" from the same camera in the final end-to-end session; the key progression in `afterAction.snapshots` if it tells the story best; and every run `afterAction.testing` — each suite the plan touched re-run **once in full** (one `suites` entry each, never summed from tasks), a `summary` and `gaps`. An early end writes it too (*Interim* while `paused`; revised next run with an `updates` entry); finishing a reopened plan rewrites it, notes the change and retakes the "after". Then open `dashboard.html` headless once: every snapshot shows.
|
|
110
|
+
- **Run start:** create any missing `.agents/specs/`, `complete/`, `archived/`, `profile/`, `recon/` (each with an empty `.gitkeep`); re-copy `dashboard.html` and an existing `documents/<slug>_summary.html` from their templates; **sync the dashboard with the plan** — add missing phases and tasks in plan order as `pending` with an `updates` note (`Added to the plan after <phase 2 ran / it was complete> — <why>`), remove dropped ones with an `activity` line. Then `status <feature-folder> in-progress`, `runs` + 1, the run-log link, an `activity` line; in git, add `.agents/*/*/documents/*_live.js` to `.gitignore` once. Before T1 of the first run changes anything, save `snapshots/plan-before.png`, the plan-wide "before" (*Snapshots tell the story*).
|
|
111
|
+
- **Each phase, after its ticks:** status, times and minutes (its `⏱` line), verifier result, a 2–3 sentence summary, the phase's progression (its tasks' frames in build order from one camera, `snapshot P<N> --frame …`) when it spans tasks, `decisions`, `activeTime` (all runs: each `⏱ Run <n> end` line's `active` plus this run's), an `activity` line, a "so far" `outcome`, and `check` passing.
|
|
112
|
+
- **Run end — the After Action Report.** Status from **re-reading the checkboxes**: all `- [x]` → `complete`; all ticked or ⏭️ DEFERRED → `incomplete`; else `paused` — never `in-progress`. Write `followUps` and `afterAction` (fields in `data-schema.md`): headline, body, highlights, **one plan-wide before/after** (`snapshot <feature-folder> comparison --before snapshots/plan-before.png --after snapshots/plan-after.png --caption "…"`), the "after" from the same camera in the final end-to-end session; the key progression in `afterAction.snapshots` if it tells the story best; and every run `afterAction.testing` — each suite the plan touched re-run **once in full** (one `suites` entry each, never summed from tasks), a `summary` and `gaps`. An early end writes it too (*Interim* while `paused`; revised next run with an `updates` entry); finishing a reopened plan rewrites it, notes the change and retakes the "after". Then open `dashboard.html` headless once: every snapshot shows.
|
|
100
113
|
- **Plan summary, only when `complete`:** copy `templates/summary/summary.html` to `documents/<slug>_summary.html` (`{{slug}}` replaced) and write `documents/<slug>_summary.js` per **`summary-guide.md`** and its worked example `summary.template.js` — the plan for people who never see the code, on-screen names in **bold**, real values, no file names, task IDs or test counts. Set `afterAction.planSummary`. A reopened plan keeps its summary until it completes again; then rewrite it, add the date to `stamp` (`Fixed on 2026-10-19; updated on 2026-11-02`) and say in the lead what changed.
|
|
101
114
|
- **`--verbose`** changes what is written, never what is done: `detail: "verbose"`, each task's `details` from whoever has the facts (the builder at `built`, the verifier as it checks, you in fix rounds), and at run end `afterAction.sections` — fields and card order in `data-schema.md`. Later runs never thin it.
|
|
102
115
|
|
|
@@ -106,7 +119,7 @@ The page, starter data and live file come from `templates/dashboard/` *(skills l
|
|
|
106
119
|
- **Export minimally:** only the Unity project under test, the task's scenes, and only when the change alters that export; never widen a plan's export step.
|
|
107
120
|
- **Never sleep** — wait only with `node https://raw.githubusercontent.com/babylontoolkit/agent/main/references/scripts/wait.mjs port|url|file|log|cmd … --timeout <s>`, or run a long command in the foreground with a generous timeout. Drive pages only by importing `https://raw.githubusercontent.com/babylontoolkit/agent/main/references/scripts/bt-cdp.mjs` (its own headless Chrome and DevTools port) — never the user's browser or a harness of your own.
|
|
108
121
|
- **Judge visuals by looking**; numeric gates only when the plan asks.
|
|
109
|
-
- **Keep evidence light:** the project's tools; no one-off tools, ledgers, md5 or environment records, archives or capture trees unless the plan asks.
|
|
122
|
+
- **Keep evidence light:** the project's tools; no one-off tools, ledgers, md5 or environment records, archives or capture trees unless the plan asks. The dashboard's snapshots are the exception: they are the record a human reads, alongside the run log, and are never cut for speed.
|
|
110
123
|
- **Someone else's red is not your task:** another feature's failing test you did not touch is logged as pre-existing.
|
|
111
124
|
|
|
112
125
|
## Auto-pilot (`--auto-pilot`)
|
|
@@ -7,10 +7,12 @@
|
|
|
7
7
|
* renamed over the original), so the page can never load a half-written file and no hand edit can break it.
|
|
8
8
|
*
|
|
9
9
|
* node dashboard.mjs live <feature-folder> --task T19 --role implementer --activity "…" [--phase 7] [--step "…"]… [--reset] [--title "…"]
|
|
10
|
-
* node dashboard.mjs task <feature-folder> <task-id> --set '{"status":"built","summary":"…"}' [--note "why an earlier result changed" --by T21]
|
|
10
|
+
* node dashboard.mjs task <feature-folder> <task-id> --set '{"status":"built","summary":"…"}' [--note "why an earlier result changed" --by T21] [--no-frame "why a visual task has no built frame"]
|
|
11
11
|
* node dashboard.mjs snapshot <feature-folder> <T7|P2|plan> --src snapshots/T7-01-stage.png --caption "…" [--title "…"] [--source unity]
|
|
12
12
|
* (comparison: --before snapshots/a.png --after snapshots/b.png [--before-caption …] [--after-caption …];
|
|
13
13
|
* progression: --frame "snapshots/x.png|stage|caption" repeated)
|
|
14
|
+
* node dashboard.mjs snapshot <feature-folder> comparison --before snapshots/plan-before.png --after snapshots/plan-after.png --caption "…"
|
|
15
|
+
* (the After Action Report's one plan-wide before/after — replaces the previous one)
|
|
14
16
|
* node dashboard.mjs activity <feature-folder> "Phase 2 verified — T4–T6 PASS"
|
|
15
17
|
* node dashboard.mjs status <feature-folder> in-progress|paused|complete|incomplete
|
|
16
18
|
* node dashboard.mjs check <feature-folder>
|
|
@@ -28,15 +30,22 @@
|
|
|
28
30
|
* an image under `path` (or `file`, `image`, …) instead of `src`, or a `src` that is not a file under the feature
|
|
29
31
|
* folder — because such an entry renders as "No snapshot".
|
|
30
32
|
*
|
|
33
|
+
* The snapshots are the story of how the plan was built, so frames are never left behind. A `task --set` that moves
|
|
34
|
+
* a task to `built`, `verifying` or `done` is refused while `snapshots/` holds a `<task-id>-…` image no dashboard entry
|
|
35
|
+
* shows — add each with `snapshot` first. Moving a visual task (kind live, game or unity) to `built` with no snapshot
|
|
36
|
+
* at all is refused too, unless `--no-frame "<reason>"` records why it has nothing to show yet.
|
|
37
|
+
*
|
|
31
38
|
* `check` is the gate at every phase boundary and at run end. Beyond the snapshots it fails, listing every problem in
|
|
32
39
|
* one message, when a deliverable was skipped: a `documents/<slug>_plan.md` without `dashboard.html`, the dashboard
|
|
33
40
|
* data or the live file; dashboard tasks that differ from the plan's checklist (ids or order); a `complete` status
|
|
34
41
|
* while the plan has an unticked box or without `documents/<slug>_summary.html`; a visual task (kind live, game or
|
|
35
42
|
* unity) that is `done` with no snapshot of its own or progression frame tagged with its id; a task ticked in the plan
|
|
36
|
-
* whose dashboard entry has no verifier result. With no plan in the folder, the plan checks are skipped.
|
|
43
|
+
* whose dashboard entry has no verifier result. With no plan in the folder, the plan checks are skipped. It also
|
|
44
|
+
* fails on frames left behind in `snapshots/`: a built or finished task's `T<n>-…` images, a closed phase's `P<N>-…`
|
|
45
|
+
* images and — once a run has ended — a `plan-before` image that no dashboard entry shows.
|
|
37
46
|
*/
|
|
38
47
|
import { existsSync, readFileSync, readdirSync, renameSync, statSync, writeFileSync } from 'node:fs';
|
|
39
|
-
import { basename, join, relative } from 'node:path';
|
|
48
|
+
import { basename, join, relative, resolve } from 'node:path';
|
|
40
49
|
|
|
41
50
|
/** How many entries a task's live step log keeps. */
|
|
42
51
|
const MAXIMUM_LIVE_STEPS = 12;
|
|
@@ -46,6 +55,16 @@ const LIVE_PREFIX = 'window.FEATURE_LIVE';
|
|
|
46
55
|
const ROLE_FOR_TASK_STATUS = { 'in-progress': 'implementer', built: 'implementer', verifying: 'verifier' };
|
|
47
56
|
/** Task kinds whose result is seen on screen, so a `done` task of this kind must have a snapshot. */
|
|
48
57
|
const VISUAL_TASK_KINDS = new Set(['live', 'game', 'unity']);
|
|
58
|
+
/** Task statuses that mean its builder is finished, so every frame saved for it belongs on the dashboard. */
|
|
59
|
+
const BUILT_TASK_STATUSES = new Set(['built', 'verifying', 'done']);
|
|
60
|
+
/** Phase statuses that mean a phase is closed, so every `P<N>-…` frame saved for it belongs on the dashboard. */
|
|
61
|
+
const CLOSED_PHASE_STATUSES = new Set(['done', 'partial', 'deferred']);
|
|
62
|
+
/** Run statuses that mean a run has ended and written its After Action Report. */
|
|
63
|
+
const RUN_ENDED_STATUSES = new Set(['paused', 'complete', 'incomplete']);
|
|
64
|
+
/** Image files a snapshot can show. */
|
|
65
|
+
const SNAPSHOT_IMAGE_FILE = /\.(png|jpe?g|webp|gif|avif)$/i;
|
|
66
|
+
/** The plan-wide "before" frame, saved before T1 of the first run. */
|
|
67
|
+
const PLAN_BEFORE_FILE = /^plan-before\.(png|jpe?g|webp|gif|avif)$/i;
|
|
49
68
|
/** A plan checklist line: `- [ ] **T3.1** — …` or `- [x] T4 …`; captures the tick mark and the task id. */
|
|
50
69
|
const PLAN_CHECKLIST_LINE = /^\s*[-*]\s+\[([ xX])\]\s+(?:\*\*)?(T\d+(?:\.\d+)*)\b/;
|
|
51
70
|
/** Folders the watchdog never descends into when looking for signs of work. */
|
|
@@ -306,7 +325,8 @@ function findTask(dashboard, taskId) {
|
|
|
306
325
|
|
|
307
326
|
/**
|
|
308
327
|
* Merges fields into one task, optionally recording why an earlier result changed. A change that sets `status` also
|
|
309
|
-
* rewrites the live file (see `writeLiveForTask`); any other change leaves it as it was.
|
|
328
|
+
* rewrites the live file (see `writeLiveForTask`); any other change leaves it as it was. A move to `built`,
|
|
329
|
+
* `verifying` or `done` is refused while the task's frames are left behind (see `frameHandOffProblem`).
|
|
310
330
|
* @param {string} folder The feature folder.
|
|
311
331
|
* @param {string[]} argumentList The task id and options.
|
|
312
332
|
*/
|
|
@@ -328,16 +348,57 @@ function writeTask(folder, argumentList) {
|
|
|
328
348
|
if (problems.length) throw new Error(snapshotRefusal(problems));
|
|
329
349
|
}
|
|
330
350
|
Object.assign(task, changes);
|
|
351
|
+
const noFrameReason = typeof options['no-frame'] === 'string' ? options['no-frame'] : '';
|
|
352
|
+
const handOffProblem = frameHandOffProblem(folder, data, task, changes.status, noFrameReason);
|
|
353
|
+
if (handOffProblem) throw new Error(handOffProblem);
|
|
331
354
|
const now = localTime();
|
|
332
355
|
if (typeof options.note === 'string') {
|
|
333
356
|
task.updates = Array.isArray(task.updates) ? task.updates : [];
|
|
334
357
|
task.updates.push({ at: now.stamp, by: typeof options.by === 'string' ? options.by : taskId, note: options.note });
|
|
335
358
|
}
|
|
359
|
+
if (noFrameReason && changes.status === 'built') {
|
|
360
|
+
data.activity = Array.isArray(data.activity) ? data.activity : [];
|
|
361
|
+
data.activity.push({ at: now.stamp, text: `${taskId} built with no frame yet — ${noFrameReason}` });
|
|
362
|
+
}
|
|
336
363
|
data.updatedAt = now.stamp;
|
|
337
364
|
writeData(dashboardPath, prefix, data);
|
|
338
365
|
if (typeof changes.status === 'string') writeLiveForTask(folder, phase.number, task, changes.summary);
|
|
339
366
|
}
|
|
340
367
|
|
|
368
|
+
/**
|
|
369
|
+
* Why a status change must wait for the task's frames, or `''` when it may go ahead. The snapshots are the story of
|
|
370
|
+
* the build, so a task never moves past its builder while a frame saved for it (`snapshots/<task-id>-…`) is on no
|
|
371
|
+
* dashboard entry, and a visual task is not `built` until its built frame is on the page — unless the builder gives
|
|
372
|
+
* a reason it has nothing to show yet.
|
|
373
|
+
* @param {string} folder The feature folder.
|
|
374
|
+
* @param {any} dashboard The dashboard data, with the change already merged.
|
|
375
|
+
* @param {any} task The task, with the change already merged.
|
|
376
|
+
* @param {string | undefined} newStatus The status being written, if any.
|
|
377
|
+
* @param {string} noFrameReason The `--no-frame` reason, or `''`.
|
|
378
|
+
* @returns {string} The refusal message, or `''`.
|
|
379
|
+
*/
|
|
380
|
+
function frameHandOffProblem(folder, dashboard, task, newStatus, noFrameReason) {
|
|
381
|
+
if (!BUILT_TASK_STATUSES.has(newStatus)) return '';
|
|
382
|
+
const leftBehind = framesNamedFor(unshownSnapshotFiles(folder, dashboard), task.id);
|
|
383
|
+
if (leftBehind.length) {
|
|
384
|
+
return [
|
|
385
|
+
`refused — ${task.id} cannot be "${newStatus}" while its frames are on disk but not on the dashboard (the snapshots tell the story of the build):`,
|
|
386
|
+
...leftBehind.map((name) => ` snapshots/${name}`),
|
|
387
|
+
'Add them first, then repeat this write — a progression from one camera, or a still each:',
|
|
388
|
+
` node dashboard.mjs snapshot ${folder} ${task.id} --frame "snapshots/${leftBehind[0]}|<stage>|<what this stage added>" … --caption "…"`,
|
|
389
|
+
` node dashboard.mjs snapshot ${folder} ${task.id} --src snapshots/${leftBehind[0]} --caption "…"`,
|
|
390
|
+
].join('\n');
|
|
391
|
+
}
|
|
392
|
+
const isVisual = VISUAL_TASK_KINDS.has(task.kind);
|
|
393
|
+
if (newStatus !== 'built' || !isVisual || noFrameReason || taskIdsWithSnapshots(dashboard).has(task.id)) return '';
|
|
394
|
+
return [
|
|
395
|
+
`refused — ${task.id} (kind ${task.kind}) is visual and has no snapshot, so the dashboard would show nothing of what was built.`,
|
|
396
|
+
`Save its built frame (and the before / milestone frames you took) to snapshots/${task.id}-<NN>-<stage>.png, add them with`,
|
|
397
|
+
` node dashboard.mjs snapshot ${folder} ${task.id} --src snapshots/${task.id}-01-<stage>.png --caption "…"`,
|
|
398
|
+
'then repeat this write. Only when it truly has nothing to show yet, add --no-frame "<why>" to this write.',
|
|
399
|
+
].join('\n');
|
|
400
|
+
}
|
|
401
|
+
|
|
341
402
|
/**
|
|
342
403
|
* Refuses a change that would give a task field the wrong shape (a list replaced by a string, …), which would
|
|
343
404
|
* break the page.
|
|
@@ -428,15 +489,20 @@ function snapshotListFor(dashboard, target) {
|
|
|
428
489
|
/**
|
|
429
490
|
* Appends one snapshot — a still (`--src`), a comparison (`--before` and `--after`) or a progression (`--frame`,
|
|
430
491
|
* repeated, each `src|stage|caption`) — to a task, a phase or the plan, building the shape the page renders and
|
|
431
|
-
* refusing an image that is not on disk.
|
|
492
|
+
* refusing an image that is not on disk. The target `comparison` instead sets the After Action Report's one
|
|
493
|
+
* plan-wide before/after. This is the way to add snapshots: nobody writes snapshot JSON by hand.
|
|
432
494
|
* @param {string} folder The feature folder.
|
|
433
495
|
* @param {string[]} argumentList The target and options.
|
|
434
496
|
*/
|
|
435
497
|
function writeSnapshot(folder, argumentList) {
|
|
436
498
|
const { options, positional } = parseOptions(argumentList, ['frame']);
|
|
437
499
|
const [target] = positional;
|
|
438
|
-
const usage = 'usage: snapshot <feature-folder> <T3|P1|plan> (--src snapshots/x.png | --before snapshots/a.png --after snapshots/b.png | --frame "snapshots/x.png|stage|caption"…) --caption "…" [--title "…"] [--source browser|unity|blender|reference] [--before-caption "…"] [--after-caption "…"] [--task T3]';
|
|
500
|
+
const usage = 'usage: snapshot <feature-folder> <T3|P1|plan|comparison> (--src snapshots/x.png | --before snapshots/a.png --after snapshots/b.png | --frame "snapshots/x.png|stage|caption"…) --caption "…" [--title "…"] [--source browser|unity|blender|reference] [--before-caption "…"] [--after-caption "…"] [--task T3]';
|
|
439
501
|
if (!target) throw new Error(usage);
|
|
502
|
+
const isPlanComparison = target === 'comparison';
|
|
503
|
+
if (isPlanComparison && !(typeof options.before === 'string' && typeof options.after === 'string')) {
|
|
504
|
+
throw new Error('the plan-wide comparison takes --before snapshots/plan-before.png --after snapshots/plan-after.png');
|
|
505
|
+
}
|
|
440
506
|
const caption = typeof options.caption === 'string' ? options.caption : '';
|
|
441
507
|
const snapshot = { title: typeof options.title === 'string' ? options.title : caption, caption, source: typeof options.source === 'string' ? options.source : 'browser' };
|
|
442
508
|
if (typeof options.src === 'string') {
|
|
@@ -458,7 +524,12 @@ function writeSnapshot(folder, argumentList) {
|
|
|
458
524
|
if (problems.length) throw new Error(snapshotRefusal(problems));
|
|
459
525
|
const { dashboardPath } = dataPaths(folder);
|
|
460
526
|
const { prefix, data } = readData(dashboardPath);
|
|
461
|
-
|
|
527
|
+
if (isPlanComparison) {
|
|
528
|
+
data.afterAction = data.afterAction && typeof data.afterAction === 'object' ? data.afterAction : {};
|
|
529
|
+
data.afterAction.comparison = snapshot;
|
|
530
|
+
} else {
|
|
531
|
+
snapshotListFor(data, target).push(snapshot);
|
|
532
|
+
}
|
|
462
533
|
data.updatedAt = localTime().stamp;
|
|
463
534
|
writeData(dashboardPath, prefix, data);
|
|
464
535
|
}
|
|
@@ -585,6 +656,53 @@ function allSnapshots(dashboard) {
|
|
|
585
656
|
return entries;
|
|
586
657
|
}
|
|
587
658
|
|
|
659
|
+
/**
|
|
660
|
+
* The images one snapshot entry shows: a progression's frames, a comparison's two sides, or the still itself.
|
|
661
|
+
* @param {any} snapshot A still, comparison or progression.
|
|
662
|
+
* @returns {any[]} Objects that carry a `src`.
|
|
663
|
+
*/
|
|
664
|
+
function snapshotImages(snapshot) {
|
|
665
|
+
if (!snapshot || typeof snapshot !== 'object') return [];
|
|
666
|
+
if (Array.isArray(snapshot.frames)) return snapshot.frames;
|
|
667
|
+
if (snapshot.before !== undefined || snapshot.after !== undefined) return [snapshot.before, snapshot.after];
|
|
668
|
+
return [snapshot];
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
/**
|
|
672
|
+
* The images in the feature folder's `snapshots/` that no dashboard entry shows — frames a builder or verifier saved
|
|
673
|
+
* that never reached the page, so the story of the build is missing them.
|
|
674
|
+
* @param {string} folder The feature folder.
|
|
675
|
+
* @param {any} dashboard The dashboard data.
|
|
676
|
+
* @returns {string[]} File names inside `snapshots/`, e.g. `T1-02-lit.png`.
|
|
677
|
+
*/
|
|
678
|
+
function unshownSnapshotFiles(folder, dashboard) {
|
|
679
|
+
const snapshotsFolder = join(folder, 'snapshots');
|
|
680
|
+
if (!existsSync(snapshotsFolder)) return [];
|
|
681
|
+
const shownPaths = new Set(
|
|
682
|
+
allSnapshots(dashboard)
|
|
683
|
+
.flatMap(({ snapshot }) => snapshotImages(snapshot))
|
|
684
|
+
.map((image) => (image && typeof image.src === 'string' ? image.src : ''))
|
|
685
|
+
.filter((source) => source && !/^[a-z]+:/i.test(source))
|
|
686
|
+
.map((source) => resolve(folder, source)),
|
|
687
|
+
);
|
|
688
|
+
return readdirSync(snapshotsFolder)
|
|
689
|
+
.filter((name) => SNAPSHOT_IMAGE_FILE.test(name))
|
|
690
|
+
.filter((name) => !shownPaths.has(resolve(snapshotsFolder, name)))
|
|
691
|
+
.sort();
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
/**
|
|
695
|
+
* The file names saved for one task or phase: those named `<id>-…` (`T7-02-lit.png`, `P2-01-blockout.png`).
|
|
696
|
+
* `T1-` never matches `T10-…` or `T1.2-…`.
|
|
697
|
+
* @param {string[]} fileNames File names inside `snapshots/`.
|
|
698
|
+
* @param {string} ownerId A task id (`T7`, `T3.1`) or phase id (`P2`).
|
|
699
|
+
* @returns {string[]}
|
|
700
|
+
*/
|
|
701
|
+
function framesNamedFor(fileNames, ownerId) {
|
|
702
|
+
const prefix = `${ownerId}-`.toLowerCase();
|
|
703
|
+
return fileNames.filter((name) => name.toLowerCase().startsWith(prefix));
|
|
704
|
+
}
|
|
705
|
+
|
|
588
706
|
/**
|
|
589
707
|
* Appends one milestone to the activity log.
|
|
590
708
|
* @param {string} folder The feature folder.
|
|
@@ -703,24 +821,63 @@ function planProblems(folder, dashboard, planTasks) {
|
|
|
703
821
|
}
|
|
704
822
|
|
|
705
823
|
/**
|
|
706
|
-
*
|
|
707
|
-
*
|
|
824
|
+
* The ids of tasks that have something on the page: a snapshot of their own, or a phase or After Action Report
|
|
825
|
+
* progression frame tagged with their id.
|
|
708
826
|
* @param {any} dashboard The dashboard data.
|
|
709
|
-
* @returns {string
|
|
827
|
+
* @returns {Set<string>}
|
|
710
828
|
*/
|
|
711
|
-
function
|
|
829
|
+
function taskIdsWithSnapshots(dashboard) {
|
|
712
830
|
const sharedLists = [dashboard.afterAction && dashboard.afterAction.snapshots, ...(dashboard.phases || []).map((phase) => phase.snapshots)];
|
|
713
|
-
const
|
|
831
|
+
const taskIds = new Set(
|
|
714
832
|
sharedLists
|
|
715
833
|
.flatMap((list) => (Array.isArray(list) ? list : []))
|
|
716
834
|
.flatMap((snapshot) => (snapshot && Array.isArray(snapshot.frames) ? snapshot.frames : []))
|
|
717
835
|
.map((frame) => frame && frame.task),
|
|
718
836
|
);
|
|
837
|
+
for (const task of (dashboard.phases || []).flatMap((phase) => phase.tasks || [])) {
|
|
838
|
+
if (Array.isArray(task.snapshots) && task.snapshots.length) taskIds.add(task.id);
|
|
839
|
+
}
|
|
840
|
+
return taskIds;
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
/**
|
|
844
|
+
* Visual tasks marked `done` with nothing to show for it: no snapshot of their own and no phase or After Action
|
|
845
|
+
* Report progression frame tagged with their id.
|
|
846
|
+
* @param {any} dashboard The dashboard data.
|
|
847
|
+
* @returns {string[]} One line per task.
|
|
848
|
+
*/
|
|
849
|
+
function visualTaskProblems(dashboard) {
|
|
850
|
+
const taskIds = taskIdsWithSnapshots(dashboard);
|
|
719
851
|
return (dashboard.phases || [])
|
|
720
852
|
.flatMap((phase) => phase.tasks || [])
|
|
721
|
-
.filter((task) => task.status === 'done' && VISUAL_TASK_KINDS.has(task.kind))
|
|
722
|
-
.
|
|
723
|
-
|
|
853
|
+
.filter((task) => task.status === 'done' && VISUAL_TASK_KINDS.has(task.kind) && !taskIds.has(task.id))
|
|
854
|
+
.map((task) => `${task.id} (kind ${task.kind}) is done with no snapshot — add the builder's frames and the verifier's comparison with \`dashboard.mjs snapshot\``);
|
|
855
|
+
}
|
|
856
|
+
|
|
857
|
+
/**
|
|
858
|
+
* Frames left behind in `snapshots/`: a built or finished task's `T<n>-…` images, a closed phase's `P<N>-…` images,
|
|
859
|
+
* and — once a run has ended — a `plan-before` image, that no dashboard entry shows.
|
|
860
|
+
* @param {string} folder The feature folder.
|
|
861
|
+
* @param {any} dashboard The dashboard data.
|
|
862
|
+
* @returns {string[]} One line per task, phase or plan-wide frame.
|
|
863
|
+
*/
|
|
864
|
+
function unshownFrameProblems(folder, dashboard) {
|
|
865
|
+
const unshown = unshownSnapshotFiles(folder, dashboard);
|
|
866
|
+
if (!unshown.length) return [];
|
|
867
|
+
const problems = [];
|
|
868
|
+
const report = (ownerId, names) => {
|
|
869
|
+
if (names.length) problems.push(`${ownerId} has frames on disk that no dashboard entry shows: ${names.map((name) => `snapshots/${name}`).join(', ')} — add each to ${ownerId} with \`dashboard.mjs snapshot\``);
|
|
870
|
+
};
|
|
871
|
+
for (const phase of dashboard.phases || []) {
|
|
872
|
+
for (const task of (phase.tasks || []).filter((candidate) => BUILT_TASK_STATUSES.has(candidate.status))) report(task.id, framesNamedFor(unshown, task.id));
|
|
873
|
+
if (CLOSED_PHASE_STATUSES.has(phase.status)) report(`P${phase.number}`, framesNamedFor(unshown, `P${phase.number}`));
|
|
874
|
+
}
|
|
875
|
+
if (RUN_ENDED_STATUSES.has(dashboard.status)) {
|
|
876
|
+
for (const name of unshown.filter((candidate) => PLAN_BEFORE_FILE.test(candidate))) {
|
|
877
|
+
problems.push(`snapshots/${name} is not in the After Action Report — make it the plan-wide "before": \`dashboard.mjs snapshot <feature-folder> comparison --before snapshots/${name} --after snapshots/plan-after.png --caption "…"\``);
|
|
878
|
+
}
|
|
879
|
+
}
|
|
880
|
+
return problems;
|
|
724
881
|
}
|
|
725
882
|
|
|
726
883
|
/**
|
|
@@ -758,7 +915,7 @@ function checkData(folder) {
|
|
|
758
915
|
}
|
|
759
916
|
const snapshots = allSnapshots(data);
|
|
760
917
|
const problems = snapshots.flatMap(({ snapshot, where }) => snapshotProblems(folder, snapshot, where));
|
|
761
|
-
const deliverables = [...missing, ...visualTaskProblems(data), ...(planTasks ? planProblems(folder, data, planTasks) : [])];
|
|
918
|
+
const deliverables = [...missing, ...visualTaskProblems(data), ...unshownFrameProblems(folder, data), ...(planTasks ? planProblems(folder, data, planTasks) : [])];
|
|
762
919
|
const refusals = [problems.length ? snapshotRefusal(problems) : '', deliverables.length ? deliverableRefusal(deliverables) : ''].filter(Boolean);
|
|
763
920
|
if (refusals.length) throw new Error(refusals.join('\n'));
|
|
764
921
|
const planNote = planTasks ? `; the dashboard matches the plan's ${planTasks.length} tasks` : '';
|
|
@@ -82,9 +82,12 @@ instead of a blank page if something still cannot render — it keeps checking a
|
|
|
82
82
|
milestones); `paused`, `complete` and `incomplete` show *Execution debrief* (the After Action Report card, marked
|
|
83
83
|
*Interim* while paused), with *Continue this plan* — the commands that pick up where it stopped — above it.
|
|
84
84
|
- **Cadence is per task — three writes**, each with `dashboard.mjs task`: when it starts (`in-progress`), the moment
|
|
85
|
-
it is built (`built` — summary, files and tests filled in right then
|
|
86
|
-
attempts, done time, `checkedLive`). The verifier
|
|
87
|
-
`in-progress` with `attempts` + 1. Each status write
|
|
85
|
+
it is built (`built` — summary, files and tests filled in right then, after its frames were added with
|
|
86
|
+
`dashboard.mjs snapshot`) and when it passes (`done` — verifier, attempts, done time, `checkedLive`). The verifier
|
|
87
|
+
adds `verifying` while it checks; a FAIL sends the task back to `in-progress` with `attempts` + 1. Each status write
|
|
88
|
+
also updates the live file. A move to `built`, `verifying` or `done` is refused while a `snapshots/T<n>-…` frame of
|
|
89
|
+
that task is on no dashboard entry, and a visual task's move to `built` is refused with no snapshot at all unless
|
|
90
|
+
`--no-frame "<why>"` says it has nothing to show yet.
|
|
88
91
|
|
|
89
92
|
## `<slug>_dashboard.js` fields
|
|
90
93
|
|
|
@@ -115,7 +118,7 @@ Top level:
|
|
|
115
118
|
| `headline` | one sentence: what the plan delivered |
|
|
116
119
|
| `body` | 2–4 paragraphs: what was built, how it was proven, what surprised |
|
|
117
120
|
| `highlights` | the results worth remembering |
|
|
118
|
-
| `comparison` | ONE before/after for the plan as a whole — "before" captured before T1 started, "after" at the end, from the same camera or viewport: `{ "title", "caption", "source", "before": { "src", "caption" }, "after": { "src", "caption" } }`; `null` when the plan has nothing to see |
|
|
121
|
+
| `comparison` | ONE before/after for the plan as a whole — "before" captured before T1 started, "after" at the end, from the same camera or viewport: `{ "title", "caption", "source", "before": { "src", "caption" }, "after": { "src", "caption" } }`, written with `dashboard.mjs snapshot <feature-folder> comparison --before snapshots/plan-before.png --after snapshots/plan-after.png --caption "…"`; `null` when the plan has nothing to see |
|
|
119
122
|
| `snapshots` | optional: the plan's key progression, or the end-to-end proof |
|
|
120
123
|
| `testing` | how the plan was tested — every run, not only `--verbose` (below) |
|
|
121
124
|
| `sections` | `--verbose` only: `[{ "title", "body": [paragraphs], "items": [bullets] }]`, in this order where they apply — Architecture · Phase by phase · Problems and resolutions · Deviations from the plan · Known limitations · Lessons learned · Estimate vs actual · Recommended next steps |
|
|
@@ -181,7 +184,7 @@ Each task:
|
|
|
181
184
|
|
|
182
185
|
## Snapshot shapes
|
|
183
186
|
|
|
184
|
-
**Add snapshots with `node <skills>/bt-execute/scripts/dashboard.mjs snapshot <feature-folder> <T3|P1|plan> --src snapshots/… --caption "…"`** (`--before`/`--after` for a comparison, `--frame "src|stage|caption"` repeated for a progression) — never by writing the JSON yourself. The image key is **`src`**, relative to the feature folder; an entry with `path` (or `file`, `image`, `url`, `href`) instead would render as "No snapshot", so every helper write repairs it to `src` (and an unknown `source` to `"browser"`), `check` repairs any already in the file, and the page reads those keys too. An image that is not on disk is refused — `check` fails on it. **The snapshots are the chronicle of the build: `check` passing is part of every phase boundary and of run end.**
|
|
187
|
+
**Add snapshots with `node <skills>/bt-execute/scripts/dashboard.mjs snapshot <feature-folder> <T3|P1|plan> --src snapshots/… --caption "…"`** (`--before`/`--after` for a comparison, `--frame "src|stage|caption"` repeated for a progression) — never by writing the JSON yourself. The image key is **`src`**, relative to the feature folder; an entry with `path` (or `file`, `image`, `url`, `href`) instead would render as "No snapshot", so every helper write repairs it to `src` (and an unknown `source` to `"browser"`), `check` repairs any already in the file, and the page reads those keys too. An image that is not on disk is refused — `check` fails on it. **The snapshots are the chronicle of the build — they tell the story of how the plan came together: `check` passing is part of every phase boundary and of run end.** Every visual task (`kind` `live`, `game` or `unity`) leaves a progression from one camera as it is built — a before frame, a frame per meaningful layer, the built frame (the builder, added before its `built` write) and the verified frames (the verifier), usually 3–8 in all — plus any comparison or angle that proves the point; a task with nothing to see needs none. The plan as a whole gets `snapshots/plan-before.png` before T1 and one plan-wide before/after (target `comparison`) at run end. Frames come from the sessions and exports the work already runs, never an extra page session or re-export just for a picture; inside an open session a capture costs seconds, so take it. Who takes which frame: bt-execute's *Snapshots tell the story*.
|
|
185
188
|
|
|
186
189
|
Any list of snapshots may mix them. `source` names where the image came from: `"browser"`, `"unity"`,
|
|
187
190
|
`"blender"`, `"reference"`.
|
|
@@ -225,6 +228,9 @@ every problem in one message — when a snapshot cannot show its image or a deli
|
|
|
225
228
|
- `status` is `complete` while the plan has an unticked box, or without `documents/<slug>_summary.html`;
|
|
226
229
|
- a visual task (`kind` `live`, `game` or `unity`) is `done` with no snapshot of its own and no phase or After Action
|
|
227
230
|
Report progression frame whose `task` is its id;
|
|
231
|
+
- frames were left behind in `snapshots/`: a `T<n>-…` image of a `built`, `verifying` or `done` task, a `P<N>-…` image
|
|
232
|
+
of a closed phase (`done`, `partial`, `deferred`) or — once the run has ended (`paused`, `complete`, `incomplete`) —
|
|
233
|
+
a `plan-before` image, that no dashboard entry shows. Fix it by adding the frames, never by moving or deleting them;
|
|
228
234
|
- a task ticked in the plan has no `verifier` result.
|
|
229
235
|
|
|
230
236
|
With no plan in the folder (a legacy flat plan) the plan checks are skipped.
|