@babylonjs-toolkit/agent 1.1.61 → 1.1.64

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.1.61)
1
+ # Babylon Toolkit Desktop Agent (1.1.64)
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
 
@@ -299,7 +299,9 @@ banner and the milestones so far. Once the run is over, that slot becomes the **
299
299
  (marked *Interim* if the plan is not finished yet), and the milestone history folds into the Milestone
300
300
  activity logs at the bottom. The After Action Report is the whole plan's execution summarized — what
301
301
  was built, how it was proven, what surprised, the run's figures — around **one before/after for the
302
- plan as a whole**, taken from the same camera before the first task and after the last. Recon docs
302
+ plan as a whole**, taken from the same camera before the first task and after the last — and a
303
+ **Testing and verification** section: each test suite's final result from one last full run, what is
304
+ not covered, and every task's tests, test cases, live check and verifier result. Recon docs
303
305
  stay in `.agents/recon/`; older flat specs and plans in `.agents/specs/` keep working where they are.
304
306
 
305
307
  Add `--verbose` to `bt-execute` for a fully written-up dashboard: every task card gains its approach
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@babylonjs-toolkit/agent",
3
- "version": "1.1.61",
3
+ "version": "1.1.64",
4
4
  "description": "Installs the Babylon Toolkit Desktop Agent for Claude Code, Codex, GitHub Copilot, Gemini CLI and Antigravity.",
5
5
  "keywords": [
6
6
  "babylonjs",
@@ -99,9 +99,9 @@ On top of the per-task updates:
99
99
  - **Run start — the first thing the run does** (*Open the run before anything else*): **refresh `dashboard.html`** — copy it again from the template with `{{slug}}` replaced (it is never edited, so this is always safe, and it is how layout fixes reach dashboards created by older versions); then **sync the dashboard with the plan file** — re-read its checklist and add any phase or task (including sub-tasks like `T3.1`) the dashboard lacks, in plan order, as `pending`, with an `updates` note on it (`Added to the plan after <the plan was complete / phase 2 ran> — <why, if the plan says>`); a task the plan no longer has is removed with an `activity` line saying so. Then `status: "in-progress"`, `runs` + 1, the run-log document link, an `activity` line, the first live-file write, and the watchdog launched in the background. In a git repository, check `.gitignore` has `.agents/specs/*/documents/*_live.js` and append it once if not — the live file is never staged or committed; `<slug>_dashboard.js` and `snapshots/` are.
100
100
  - **Each phase, after its ticks and before its commit:** the phase's status, times and minutes (from its `⏱` line), its verifier result and a two-or-three-sentence summary of what it delivered; the phase-level snapshots (a progression spanning several tasks — below); `decisions`; `activeTime`; an `activity` line; and a current "so far" `outcome` headline.
101
101
  - **A deferral:** the task's `status: "deferred"` and `deferredReason`, an `activity` line.
102
- - **Run end — the After Action Report.** **decide the status by re-reading the plan file's checkboxes, never from memory:** `complete` when every task in the plan is `- [x]`; `incomplete` when every task is either ticked or marked ⏭️ DEFERRED; otherwise `paused` (the run covered only a slice, or tasks were added). The page refuses a `complete` it can see is false — it shows the plan as paused with a warning — but the plan file is the authority; never leave `in-progress` behind, because the status picks the page's top slot: `in-progress` shows *Current run activity* (the live file and the milestones), any other run-ended status shows the After Action Report in its place. Write `followUps` for a human, and `afterAction` — the whole plan's execution, start to finish: a one-sentence headline of what the plan delivered; two to four paragraphs on what was built, how it was proven and what surprised; highlights; and **one before/after for the plan as a whole** (`comparison`) — the plan-wide "before" frame beside a final "after" taken now from the same camera or viewport (the end-to-end check's session supplies it). Add the plan's key progression to `afterAction.snapshots` if one tells the story better than any single phase. The figures (tasks, tests, retries, time) are computed by the page — never type them in. A run that ends before the plan is finished writes it too; the page marks it *Interim* while `paused`, and the next run revises it with an `updates` entry. **A reopened plan** (tasks added after it was complete) works the same way: the run that finishes the added tasks rewrites the After Action Report to cover them, notes the change in its `updates` (`Revised — T7 added after completion: <why>`), and retakes the plan-wide "after" from the same camera so the comparison shows the plan as it now stands.
102
+ - **Run end — the After Action Report.** **decide the status by re-reading the plan file's checkboxes, never from memory:** `complete` when every task in the plan is `- [x]`; `incomplete` when every task is either ticked or marked ⏭️ DEFERRED; otherwise `paused` (the run covered only a slice, or tasks were added). The page refuses a `complete` it can see is false — it shows the plan as paused with a warning — but the plan file is the authority; never leave `in-progress` behind, because the status picks the page's top slot: `in-progress` shows *Current run activity* (the live file and the milestones), any other run-ended status shows the After Action Report in its place. Write `followUps` for a human, and `afterAction` — the whole plan's execution, start to finish: a one-sentence headline of what the plan delivered; two to four paragraphs on what was built, how it was proven and what surprised; highlights; and **one before/after for the plan as a whole** (`comparison`) — the plan-wide "before" frame beside a final "after" taken now from the same camera or viewport (the end-to-end check's session supplies it). Add the plan's key progression to `afterAction.snapshots` if one tells the story better than any single phase. Write `afterAction.testing` on every run, not only `--verbose`: run every test suite the plan touched **once more, in full, at run end** and record each as a `suites` entry (name, command, passed, failed, how many tests this plan added, and a `note` for any failure that pre-dates the plan) — never add up the tasks' counts, which re-count the same suite once per task; a `summary` of how the plan was tested (unit tests, the verifier's re-runs, what was checked live and on what, the end-to-end check); and `gaps` — what no test or live check covers. The page builds the task-by-task table and the list of test cases from the tasks. The figures (tasks, tests, retries, time) are computed by the page — never type them in. A run that ends before the plan is finished writes it too; the page marks it *Interim* while `paused`, and the next run revises it with an `updates` entry. **A reopened plan** (tasks added after it was complete) works the same way: the run that finishes the added tasks rewrites the After Action Report to cover them, notes the change in its `updates` (`Revised — T7 added after completion: <why>`), and retakes the plan-wide "after" from the same camera so the comparison shows the plan as it now stands.
103
103
  - **`--verbose` — the same work, written up in depth.** It changes what is written, never what is done: tests, the verifier, live checks and snapshot captures are exactly as without it, and TIME MATTERS still holds (the extra cost is writing, not checking). Set `detail: "verbose"` at run start. Each task gets a `details` write-up (fields in `data-schema.md`), filled in by whoever has the facts, at the same per-task moments as everything else:
104
- - **the implementer, when the task is built:** `approach` (how it was built, how the pieces fit together, why this way and not the alternatives it weighed); `changes` — every file touched, with what changed in it and why; `testCases` — every named case with its expected and actual result; `problems` — each failed attempt or dead end, with what failed, the root cause and the fix; `notes` for a future maintainer; `timing.build`;
104
+ - **the implementer, when the task is built:** `approach` (how it was built, how the pieces fit together, why this way and not the alternatives it weighed); `changes` — every file touched, with what changed in it and why; `testCases` — every named case with its expected and actual result, the result leading with `PASS` or `FAIL` (`"PASS — 0→74 km/h on held W"`); `problems` — each failed attempt or dead end, with what failed, the root cause and the fix; `notes` for a future maintainer; `timing.build`;
105
105
  - **the verifier, while it checks:** `acceptance` — every Acceptance item with its verdict and the evidence it rests on (command output, the screenshot, the line read); `liveCheck` — what it looked at, on which engine, at what resolution, and how it judged it; `timing.verify`;
106
106
  - **you, at the tick and in the fix loop:** each fix round added to `problems`, `timing.fix`, and snapshot captions that say what to notice, not just what is shown.
107
107
 
@@ -334,8 +334,8 @@
334
334
  .figures { margin: 0; padding: 14px 18px; border-radius: var(--radius-small); background: var(--bg-sunken); border: 1px solid var(--line); display: grid; gap: 2px; align-self: start; }
335
335
  .figures div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-top: 1px solid var(--line); }
336
336
  .figures div:first-child { border-top: 0; }
337
- .figures dt { color: var(--text-muted); font-size: 13px; }
338
- .figures dd { margin: 0; font: 700 13.5px/1.5 var(--font-mono); text-align: right; }
337
+ .figures dt { flex: none; color: var(--text-muted); font-size: 13px; white-space: nowrap; }
338
+ .figures dd { min-width: 0; margin: 0; font: 700 13.5px/1.5 var(--font-mono); text-align: right; overflow-wrap: anywhere; }
339
339
 
340
340
  /* ---------- Snapshots ---------- */
341
341
  .gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 16px; margin-top: 18px; }
@@ -600,6 +600,8 @@
600
600
  .task-live { padding: 12px 14px; border-radius: var(--radius-small); background: var(--active-soft); }
601
601
  .now-warning { margin: 8px 0 0; padding: 8px 12px; border-left: 3px solid var(--failed); border-radius: 0 var(--radius-small) var(--radius-small) 0; background: var(--failed-soft); font-size: 13.5px; }
602
602
  .tag.tag-watchdog { color: var(--updated); border-color: color-mix(in srgb, var(--updated) 45%, transparent); background: var(--updated-soft); letter-spacing: 0.06em; }
603
+ .tag.tag-snapshots { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
604
+ .tag-snapshots svg { width: 13px; height: 13px; flex: none; }
603
605
  .task-live .now-head { font-size: 10.5px; }
604
606
  .task-id { font: 700 13px/1 var(--font-mono); color: var(--text-muted); }
605
607
  .task-title { font-weight: 600; min-width: 0; }
@@ -648,6 +650,19 @@
648
650
  .aar-section h4 { font-size: 15.5px; }
649
651
  .aar-section p { margin: 0 0 8px; color: var(--text-muted); font-size: 14px; }
650
652
  .aar-section ul { margin: 0; padding-left: 18px; color: var(--text-muted); font-size: 14px; display: grid; gap: 4px; }
653
+ .testing { margin-top: 24px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius-small); background: var(--bg); display: grid; gap: 14px; }
654
+ .testing > h4 { margin: 0; font-size: 15.5px; }
655
+ .testing > p { margin: 0; color: var(--text-muted); font-size: 14px; }
656
+ .testing-part > summary { cursor: pointer; font: 700 11px/1.6 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint); }
657
+ .testing-part[open] > summary { margin-bottom: 10px; }
658
+ .testing-cases { display: grid; gap: 16px; }
659
+ .case-head { margin-bottom: 6px; font-size: 13.5px; font-weight: 600; }
660
+ .case-head .task-link { margin-right: 6px; }
661
+ .cell-note { margin-top: 2px; color: var(--text-muted); font-size: 12.5px; }
662
+ .count { font: 700 12.5px/1.5 var(--font-mono); }
663
+ .count-pass { color: var(--done); }
664
+ .count-fail { color: var(--failed); }
665
+ .task-link { font: 700 12.5px/1.5 var(--font-mono); }
651
666
 
652
667
  /* ---------- Updated notifications ---------- */
653
668
  .updated-badge {
@@ -712,7 +727,7 @@
712
727
  /* ---------- Containment: nothing is ever wider than its card ---------- */
713
728
  /* A single-column grid's column defaults to the width of its longest unbreakable line (a long path,
714
729
  a hash), which pushes every paragraph in it past the card's edge. Size those columns to the card. */
715
- .tasks, .task-body, .task-details, .highlights, .figures, .live-steps, .update-notes,
730
+ .tasks, .task-body, .task-details, .highlights, .figures, .live-steps, .update-notes, .testing, .testing-cases,
716
731
  .detail-block ul, .aar-section ul { grid-template-columns: minmax(0, 1fr); }
717
732
  .highlights li { grid-template-columns: 22px minmax(0, 1fr); }
718
733
  /* Long paths, identifiers and URLs wrap wherever they must instead of running off the edge. */
@@ -785,6 +800,8 @@
785
800
  const STATUS_ICONS = { done: '✓', 'in-progress': '◐', built: '◆', verifying: '⟳', pending: '○', deferred: '⏭', failed: '✕' };
786
801
  /** Longest test or acceptance result still shown as a single badge; anything longer is wrapping text. */
787
802
  const VERDICT_BADGE_MAX_LENGTH = 16;
803
+ // The report's task-by-task testing table starts open for a short plan and folded for a long one.
804
+ const TESTING_TABLE_OPEN_ROWS = 12;
788
805
  /** Where the Babylon Toolkit Desktop Agent, whose skills generate this dashboard, is published. */
789
806
  const SKILLS_DOWNLOAD_URL = 'https://www.npmjs.com/package/@babylonjs-toolkit/agent';
790
807
  /** Minutes without a live update before the Now banner warns that the run has gone quiet. */
@@ -975,7 +992,7 @@
975
992
  <article class="card after-action">
976
993
  <div class="after-action-head">
977
994
  <span class="kicker">After Action Report${afterAction.writtenAt ? ` <span>· ${escapeHtml(afterAction.writtenAt)}</span>` : ''}</span>
978
- <span class="meta">${isFinal ? '' : '<span class="status status-in-progress">Interim — plan not finished</span>'}${updatedBadge(afterAction.updates)}</span>
995
+ <span class="meta">${snapshotBadge([...(comparison && comparison.before && comparison.after ? [comparison] : []), ...(afterAction.snapshots || [])])}${isFinal ? '' :'<span class="status status-in-progress">Interim — plan not finished</span>'}${updatedBadge(afterAction.updates)}</span>
979
996
  </div>
980
997
  ${afterAction.headline ? `<h3 class="headline">${formatInline(afterAction.headline)}</h3>` : ''}
981
998
  ${comparison && comparison.before && comparison.after ? `<div class="plan-compare">${renderSnapshot(comparison)}</div>` : ''}
@@ -986,6 +1003,7 @@
986
1003
  </div>
987
1004
  ${renderFigures(allTasks, doneCount)}
988
1005
  </div>
1006
+ ${renderTesting(allTasks)}
989
1007
  ${renderAfterActionSections(afterAction.sections)}
990
1008
  ${updateNotes(afterAction.updates)}
991
1009
  </article>
@@ -1003,11 +1021,16 @@
1003
1021
  const phases = report.phases || [];
1004
1022
  const retried = allTasks.filter((task) => Number(task.attempts) > 1).length;
1005
1023
  const deferred = allTasks.filter((task) => task.status === 'deferred' || task.status === 'failed').length;
1006
- const testsPassed = allTasks.reduce((total, task) => total + (task.tests ? Number(task.tests.passed) || 0 : 0), 0);
1024
+ // Each task reports the whole suite it ran, so adding up the tasks counts the same tests many times over.
1025
+ // The final suites are the true count; without them, say how many tasks were tested.
1026
+ const suites = finalSuites();
1027
+ const testsFigure = suites.length
1028
+ ? ['Tests passing', `${suites.reduce((total, suite) => total + (Number(suite.passed) || 0), 0)}${sumFailed(suites) ? ` · ${sumFailed(suites)} failed` : ''}`]
1029
+ : ['Tasks with tests', `${allTasks.filter(hasTests).length} / ${allTasks.length}`];
1007
1030
  const rows = [
1008
1031
  ['Tasks verified', `${doneCount} / ${allTasks.length}`],
1009
1032
  ['Phases', `${phases.filter((phase) => phase.status === 'done').length} / ${phases.length}`],
1010
- ['Tests passing', String(testsPassed)],
1033
+ testsFigure,
1011
1034
  ['Needed a second attempt', String(retried)],
1012
1035
  ['Deferred', String(deferred)],
1013
1036
  ['Active time', report.activeTime || '—'],
@@ -1060,10 +1083,20 @@
1060
1083
  </article>`;
1061
1084
  }
1062
1085
 
1086
+ // A camera badge on a task's row, so tasks with pictures stand out without opening them.
1087
+ function snapshotBadge(snapshots) {
1088
+ const list = Array.isArray(snapshots) ? snapshots : [];
1089
+ if (!list.length) return '';
1090
+ const images = list.reduce((total, snapshot) => total + (Array.isArray(snapshot.frames) ? snapshot.frames.length : snapshot.before || snapshot.after ? 2 : 1), 0);
1091
+ const label = `${list.length} snapshot${list.length === 1 ? '' : 's'}${images !== list.length ? ` · ${images} images` : ''}`;
1092
+ return `<span class="tag tag-snapshots" title="${escapeAttribute(label)}" aria-label="${escapeAttribute(label)}"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M4 8h3l2-3h6l2 3h3a1 1 0 0 1 1 1v9a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1z"/><circle cx="12" cy="13" r="3.5"/></svg>${list.length}</span>`;
1093
+ }
1094
+
1063
1095
  function renderTask(task) {
1064
1096
  const status = task.status || 'pending';
1065
1097
  const tags = [
1066
- task.kind ? `<span class="tag">${escapeHtml(task.kind)}</span>` : '',
1098
+ snapshotBadge(task.snapshots),
1099
+ task.kind ?`<span class="tag">${escapeHtml(task.kind)}</span>` : '',
1067
1100
  task.verifyLevel === 'live' ? '<span class="tag">live check</span>' : '',
1068
1101
  task.attempts > 1 ? `<span class="tag">${escapeHtml(task.attempts)} attempts</span>` : '',
1069
1102
  status === 'built' || status === 'verifying' ? `<span class="status status-${status}">${STATUS_LABELS[status]}</span>` : '',
@@ -1191,6 +1224,104 @@
1191
1224
  return blocks ? `<div class="task-details">${blocks}</div>` : '';
1192
1225
  }
1193
1226
 
1227
+ /* ===================== Testing and verification ===================== */
1228
+
1229
+ /** The suites as they stand at the end of the plan — bt-execute writes them from one last full run of each. */
1230
+ function finalSuites() {
1231
+ const testing = report.afterAction && report.afterAction.testing;
1232
+ return testing && Array.isArray(testing.suites) ? testing.suites : [];
1233
+ }
1234
+
1235
+ function sumFailed(suites) {
1236
+ return suites.reduce((total, suite) => total + (Number(suite.failed) || 0), 0);
1237
+ }
1238
+
1239
+ function hasTests(task) {
1240
+ return Boolean(task.tests && (Number(task.tests.passed) || Number(task.tests.failed)));
1241
+ }
1242
+
1243
+ function hasLiveCheck(task) {
1244
+ return task.verifyLevel === 'live' || Boolean(task.details && task.details.liveCheck);
1245
+ }
1246
+
1247
+ function testCasesOf(task) {
1248
+ return (task.details && task.details.testCases) || [];
1249
+ }
1250
+
1251
+ /**
1252
+ * The After Action Report's testing section. The final suites and how the plan was tested are written by
1253
+ * bt-execute; the task-by-task table and the test cases are read from the tasks, so they always agree with them.
1254
+ */
1255
+ function renderTesting(allTasks) {
1256
+ const testing = (report.afterAction && report.afterAction.testing) || {};
1257
+ const suites = finalSuites();
1258
+ const checked = allTasks.filter((task) => task.verifier || hasTests(task) || testCasesOf(task).length || ['done', 'deferred', 'failed'].includes(task.status));
1259
+ const gaps = testing.gaps || [];
1260
+ if (!suites.length && !checked.length && !testing.summary && !gaps.length) return '';
1261
+
1262
+ const suiteTable = detailTable(['Suite', 'Passed', 'Failed', 'Added', 'Command'], [32, 11, 11, 11, 35],
1263
+ suites.map((suite) => [
1264
+ `${formatInline(suite.name || '')}${suite.note ? `<div class="cell-note">${formatInline(suite.note)}</div>` : ''}`,
1265
+ `<span class="count count-pass">${escapeHtml(suite.passed ?? '—')}</span>`,
1266
+ `<span class="count${Number(suite.failed) ? ' count-fail' : ''}">${escapeHtml(suite.failed ?? 0)}</span>`,
1267
+ escapeHtml(suite.added ?? '—'),
1268
+ suite.command ? `<code>${escapeHtml(suite.command)}</code>` : '',
1269
+ ]));
1270
+
1271
+ const withTests = checked.filter(hasTests).length;
1272
+ const liveChecks = checked.filter(hasLiveCheck).length;
1273
+ const verified = checked.filter((task) => task.status === 'done').length;
1274
+ const taskTable = detailTable(['Task', 'Verifier', 'Tests', 'Test files', 'Cases', 'Live check'], [27, 12, 14, 31, 8, 8],
1275
+ checked.map((task) => {
1276
+ const cases = testCasesOf(task);
1277
+ // Results often record what was observed rather than a verdict, so count the cases and flag only stated failures.
1278
+ const casesFailed = cases.filter((testCase) => /^fail/i.test(String(testCase.result || '').trim())).length;
1279
+ const tests = task.tests || {};
1280
+ return [
1281
+ `<a class="task-link" href="#task-${escapeAttribute(task.id || '')}">${escapeHtml(task.id || '')}</a><div class="cell-note">${escapeHtml(task.title || '')}</div>`,
1282
+ `${taskVerdict(task)}${Number(task.attempts) > 1 ? `<div class="cell-note">${escapeHtml(task.attempts)} attempts</div>` : ''}`,
1283
+ hasTests(task)
1284
+ ? `<span class="count count-pass">${escapeHtml(tests.passed ?? 0)} passed</span>${Number(tests.failed) ? `<div class="count count-fail">${escapeHtml(tests.failed)} failed</div>` : ''}`
1285
+ : `<span class="cell-note" title="${escapeAttribute(tests.note || '')}">${tests.note ? escapeHtml(tests.note) : '—'}</span>`,
1286
+ (tests.files || []).length ? tests.files.map((file) => `<code>${escapeHtml(file)}</code>`).join('<br>') : '—',
1287
+ cases.length ? `${cases.length}${casesFailed ? `<div class="count count-fail">${casesFailed} failed</div>` : ''}` : '—',
1288
+ hasLiveCheck(task) ? `<span title="${escapeAttribute((task.details && task.details.liveCheck) || 'Checked live')}">Yes</span>` : '—',
1289
+ ];
1290
+ }));
1291
+
1292
+ const caseTasks = checked.filter((task) => testCasesOf(task).length);
1293
+ const caseCount = caseTasks.reduce((total, task) => total + testCasesOf(task).length, 0);
1294
+ const caseTables = caseTasks.map((task) => `
1295
+ <div class="detail-block">
1296
+ <div class="case-head"><a class="task-link" href="#task-${escapeAttribute(task.id || '')}">${escapeHtml(task.id || '')}</a> ${escapeHtml(task.title || '')}</div>
1297
+ ${detailTable(['Case', 'Expected', 'Result'], [28, 36, 36],
1298
+ testCasesOf(task).map((testCase) => [formatInline(testCase.name || ''), formatInline(testCase.expected || ''), verdict(testCase.result)]))}
1299
+ </div>`).join('');
1300
+
1301
+ return `
1302
+ <div class="testing">
1303
+ <h4>Testing and verification</h4>
1304
+ ${paragraphs(testing.summary)}
1305
+ ${suiteTable ? `<div class="detail-block"><h4>Final test suites</h4>${suiteTable}</div>` : ''}
1306
+ ${gaps.length ? `<div class="detail-block"><h4>Not covered</h4><ul>${gaps.map((gap) => `<li>${formatInline(gap)}</li>`).join('')}</ul></div>` : ''}
1307
+ ${taskTable ? `<details class="testing-part" ${checked.length <= TESTING_TABLE_OPEN_ROWS ? 'open' : ''}>
1308
+ <summary>Task by task · ${verified} of ${allTasks.length} verified · ${withTests} with tests · ${liveChecks} checked live</summary>
1309
+ ${taskTable}
1310
+ </details>` : ''}
1311
+ ${caseTables ? `<details class="testing-part">
1312
+ <summary>Every test case · ${caseCount} across ${caseTasks.length} task${caseTasks.length === 1 ? '' : 's'}</summary>
1313
+ <div class="testing-cases">${caseTables}</div>
1314
+ </details>` : ''}
1315
+ </div>`;
1316
+ }
1317
+
1318
+ /** A task's verifier result as one badge, from its status; the verifier's full sentence is its tooltip. */
1319
+ function taskVerdict(task) {
1320
+ const tone = { done: 'pass', failed: 'fail' }[task.status] || 'other';
1321
+ const label = { done: 'PASS', failed: 'FAIL' }[task.status] || STATUS_LABELS[task.status] || task.status || '';
1322
+ return `<span class="verdict verdict-${tone}" title="${escapeAttribute(task.verifier || '')}">${escapeHtml(label)}</span>`;
1323
+ }
1324
+
1194
1325
  /** Verbose After Action Report sections: Architecture, Problems and resolutions, Lessons learned … */
1195
1326
  function renderAfterActionSections(sections) {
1196
1327
  if (!(sections || []).length) return '';
@@ -1459,6 +1590,13 @@
1459
1590
  afterAction.updates = asUpdates(afterAction.updates);
1460
1591
  afterAction.snapshots = repairSnapshots(afterAction.snapshots);
1461
1592
  ['body', 'highlights', 'sections'].forEach((key) => { if (afterAction[key] !== undefined) afterAction[key] = asList(afterAction[key]); });
1593
+ if (afterAction.testing !== undefined) {
1594
+ if (afterAction.testing === null || typeof afterAction.testing !== 'object') afterAction.testing = null;
1595
+ else {
1596
+ afterAction.testing.suites = asList(afterAction.testing.suites).filter((suite) => suite && typeof suite === 'object');
1597
+ afterAction.testing.gaps = asTextList(afterAction.testing.gaps);
1598
+ }
1599
+ }
1462
1600
  }
1463
1601
  data.phases.forEach((phase) => {
1464
1602
  phase.updates = asUpdates(phase.updates);
@@ -1697,6 +1835,12 @@
1697
1835
  lightboxCaption.textContent = trigger.dataset.caption || '';
1698
1836
  lightbox.classList.add('is-open');
1699
1837
  });
1838
+ // A link to a task opens its card, not just scrolls to the folded row.
1839
+ document.addEventListener('click', (event) => {
1840
+ const link = event.target.closest('a[href^="#task-"]');
1841
+ const target = link && document.getElementById(decodeURIComponent(link.getAttribute('href').slice(1)));
1842
+ if (target && target.tagName === 'DETAILS') target.open = true;
1843
+ });
1700
1844
  const close = () => lightbox.classList.remove('is-open');
1701
1845
  lightbox.addEventListener('click', close);
1702
1846
  document.addEventListener('keydown', (event) => { if (event.key === 'Escape') close(); });
@@ -32,6 +32,11 @@ window.FEATURE_DASHBOARD = {
32
32
  "highlights": [],
33
33
  "comparison": null,
34
34
  "snapshots": [],
35
+ "testing": {
36
+ "summary": [],
37
+ "suites": [],
38
+ "gaps": []
39
+ },
35
40
  "sections": [],
36
41
  "updates": []
37
42
  },
@@ -114,9 +114,21 @@ Top level:
114
114
  | `highlights` | the results worth remembering |
115
115
  | `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 |
116
116
  | `snapshots` | optional: the plan's key progression, or the end-to-end proof |
117
+ | `testing` | how the plan was tested — every run, not only `--verbose` (below) |
117
118
  | `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 |
118
119
  | `updates` | see *Updated notifications* |
119
120
 
121
+ `afterAction.testing` — the page shows it as *Testing and verification*, beside a task-by-task table and
122
+ every test case that it reads from the tasks themselves:
123
+
124
+ | Field | Meaning |
125
+ |---|---|
126
+ | `summary` | paragraphs: how the plan was tested — unit tests, the verifier's re-runs, what was checked live and on what, the end-to-end check |
127
+ | `suites` | `[{ "name", "command", "passed", "failed", "added", "note" }]` — every suite the plan touched, from **one last full run of each at run end**, never added up from the tasks (each task reports the whole suite it ran, so a sum counts the same tests many times). `added` is how many tests this plan wrote; `note` explains any failure that pre-dates the plan |
128
+ | `gaps` | what is not covered by a test or a live check, one string per point |
129
+
130
+ The page's *Tests passing* figure is the sum of `suites`; without them it shows how many tasks have tests.
131
+
120
132
  Each phase:
121
133
 
122
134
  | Field | Meaning |
@@ -155,7 +167,7 @@ Each task:
155
167
  |---|---|
156
168
  | `approach` | paragraphs: how it was built, how the pieces fit, why this way and not the alternatives |
157
169
  | `changes` | `[{ "file", "change": "what changed in it and why" }]` |
158
- | `testCases` | `[{ "name", "expected", "result": "PASS" \| "FAIL …" }]` |
170
+ | `testCases` | `[{ "name", "expected", "result" }]` — `result` leads with `PASS` or `FAIL`, then what was observed: `"PASS — 0→74 km/h on held W"` |
159
171
  | `acceptance` | `[{ "criterion", "result": "PASS" \| "FAIL", "evidence" }]` |
160
172
  | `problems` | `[{ "attempt": "1", "failed", "cause", "fix" }]` |
161
173
  | `liveCheck` | what was looked at, where, at what resolution, how it was judged |