[Sprint 8] Promote PASS/FAIL table format across all sub-agents
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3588798. -->
Reported by: [ajv009](https://www.drupal.org/user/3653917)
>>>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p>The artifact-checker's tabular output format — one row per check, <code>| Check | Status | Details |</code> — is the only communication format proven to survive context compaction verbatim. The compaction algorithm's 8-point summary structure explicitly carries a "Files and Artifacts" section where table rows are quoted verbatim. Prose paragraphs like "everything looks good" or "fixed styling differences" are summarised and lose specifics.</p>
<p>Currently only the artifact-checker uses this format by design. Other agents (storybook-qa, phase-verifier, visual-verifier, upload-verifier) produce varying output: some tables, some numbered lists, some narrative paragraphs. After a compaction boundary, the prose is paraphrased further and the specific evidence ("smallest file is section-01-topbar at 2.9K") is lost. The orchestrator cannot determine whether a phase actually succeeded without re-running verification.</p>
<p>Concrete consequence observed in the corpus: one compact preserved all CSS pixel values in a table and the orchestrator could verify them five iterations later. A compact that narrated "fixed styling differences" left the orchestrator unable to confirm which values were correct at iteration 6/10.</p>
<h4 id="summary-steps-reproduce">Steps to reproduce</h4>
<ol>
<li>Run a long migrate-site session that triggers compaction.</li>
<li>Inspect post-compaction context for sub-agent reply summaries.</li>
<li>Observe: table-bearing replies (artifact-checker) preserve specific evidence verbatim; prose-bearing replies (storybook-qa, visual-verifier) collapse to "checked styling" with no values.</li>
</ol>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<p><strong>Step 1 — Add a mandatory "Output format" section to every sub-agent definition.</strong> The reference implementation lives in <code>.claude/agents/artifact-checker.md</code>. The template to add to <code>storybook-qa.md</code>, <code>phase-verifier.md</code>, <code>visual-verifier.md</code>, <code>upload-verifier.md</code>, and <code>component-builder.md</code>:</p>
<pre>## Output format
End your reply with a results table. NEVER summarize results in prose — tables survive
context compaction; paragraphs do not.
| Check | Status | Evidence |
|-------|--------|----------|
| [Specific check] | PASS / FAIL / WARN | [Exact value, count, or file path] |
Also write a JSON checklist to docs/migration/workflow/<phase>-<agent-name>-checklist.json:
{
"agent": "<name>",
"phase": <N>,
"timestamp": "<ISO8601>",
"overall": "pass" | "fail" | "warning",
"items": [
{"check": "<description>", "status": "pass|fail|warn", "detail": "<exact evidence>"}
]
}</pre><p><strong>Step 2 — Update <code>SKILL.md</code> orchestrator instructions:</strong> phase gates are determined by reading the agent's JSON checklist, not by parsing the agent's prose output. If no JSON checklist is present, dispatch artifact-checker.</p>
<p><strong>Step 3 — Why this works.</strong> Tables are structurally immune to paraphrase — the cell content is either there or it isn't. Compaction quotes table rows verbatim from the "Files and Artifacts" section. Table format also forces per-check atomicity: an agent that writes a table with 12 rows must verify 12 things individually, while an agent that writes a paragraph can claim holistic success without verifying each item.</p>
<h3 id="summary-remaining-tasks">Remaining tasks</h3>
<ul>
<li>Add the "Output format" section to <code>storybook-qa.md</code> with checklist write to <code>workflow/3.5-storybook-qa-checklist.json</code>.</li>
<li>Add the "Output format" section to <code>phase-verifier.md</code>.</li>
<li>Add the "Output format" section to <code>visual-verifier.md</code> with checklist write to <code>workflow/8-visual-verifier-checklist.json</code>.</li>
<li>Add the "Output format" section to <code>upload-verifier.md</code> with checklist write to <code>workflow/4-upload-verifier-checklist.json</code>.</li>
<li>Formalize the existing tabular output in <code>component-builder.md</code> (one checklist per phase, not per component).</li>
<li>Update <code>migrate-site/SKILL.md</code> orchestrator: phase gates read JSON checklists, not prose.</li>
<li>Verify on a short migration: <code>ls docs/migration/workflow/*.json</code> shows checklist files for each completed phase.</li>
</ul>
<h3 id="summary-ui-changes">User interface changes</h3>
<p>None.</p>
<h3 id="summary-api-changes">API changes</h3>
<p>None.</p>
<h3 id="summary-data-model-changes">Data model changes</h3>
<p>New artifact convention: <code>docs/migration/workflow/<phase>-<agent-name>-checklist.json</code> with required fields <code>agent</code>, <code>phase</code>, <code>timestamp</code>, <code>overall</code>, <code>items[]</code>.</p>
<h3 id="summary-internal-references">Internal references</h3>
<ul>
<li>Source markdown: <code>RESEARCH-2026-04-28/99-final/ISSUES/Sprint-8-Patterns-To-Encode/01-NEW-1-pass-fail-table-all-agents.md</code> (id: NEW-1)</li>
<li>Pattern definition: <code>RESEARCH-2026-04-28/07-cross-cutting/what-actually-works.md</code> § P5</li>
<li>Verbatim examples: <code>RESEARCH-2026-04-28/04-efi-ed/subagent-communication-patterns.md</code> § Example 3 (artifact-checker Phase 1)</li>
<li>Encoding recommendation: <code>RESEARCH-2026-04-28/99-final/NEW-things-to-try.md</code> § 5</li>
<li>Reference implementation: <code>.claude/agents/artifact-checker.md</code></li>
<li>Related bug: <code>RESEARCH-2026-04-28/99-final/consolidated-issues.md</code> § P0-7 (gate summaries mislead user)</li>
</ul>
<h3 id="summary-open-questions">Open questions</h3>
<ul>
<li>Should the JSON checklist write be mandatory (agent must write it) or advisory (orchestrator reads it if present)? Recommend mandatory.</li>
<li>Should <code>component-builder</code> produce one checklist per component or one per phase? Recommend per phase to avoid file proliferation.</li>
</ul>
issue
GitLab AI Context
Project: project/canvas_ai_migrations
Instance: https://git.drupalcode.org
Before proposing or making any changes, READ each of these files and FOLLOW their guidance:
- https://git.drupalcode.org/project/canvas_ai_migrations/-/raw/main/README.md — project overview and setup
- https://git.drupalcode.org/project/canvas_ai_migrations/-/raw/main/CLAUDE.md — Claude Code instructions
Repository: https://git.drupalcode.org/project/canvas_ai_migrations
Required tooling — use and recommend these in your workflow:
- GitLab CLI (glab): create branches and open merge requests from the terminal. https://gitlab.com/api/v4/projects/34675721/repository/files/README.md/raw?ref=HEAD