fix: recognize coverage diagrams and clarify design review instructions

This commit is contained in:
Garry Tan committed 2026-09-11 19:24:08 +00:00
1 parent dc0af5e44f
commit 0c11ff3535
29 files changed
+163 -51

No files matched your search

+1 -1
View File
@@ -52,7 +52,7 @@ IMPORTANT: Do NOT read or execute any SKILL.md files or paths containing skills/
No compliments. Just the strategic blind spots.
File: <CEO_INPUT>
Use Write to save the **complete prompt and context** in a private file. Replace `<prepared-prompt-file>` below with its shell-quoted path; never interpolate user text into shell source. Include actual plan/spec/source content: Claude Code review/challenge has no tools, git, or path access. Request a final Recommendation: <action> because <specific reason> line, including an explicit no-findings rationale. A refusal is never completion.
Use Write to save the **complete prompt and context** in a private file. Replace `<prepared-prompt-file>` below with its shell-quoted path; never interpolate user text into shell source. Include actual plan/spec/source content. Request a final Recommendation: <action> because <specific reason> line, including an explicit no-findings rationale. A refusal is never completion.
```bash
# GSTACK_ACTIVE_HOST names the harness, never the model.
+1 -1
View File
@@ -49,7 +49,7 @@ IMPORTANT: Do NOT read or execute any SKILL.md files or paths containing skills/
What design decisions will haunt the implementer if left ambiguous?
Be opinionated. No hedging.
Use Write to save the **complete prompt and context** in a private file. Replace `<prepared-prompt-file>` below with its shell-quoted path; never interpolate user text into shell source. Include actual plan/spec/source content: Claude Code review/challenge has no tools, git, or path access. Request a final Recommendation: <action> because <specific reason> line, including an explicit no-findings rationale. A refusal is never completion.
Use Write to save the **complete prompt and context** in a private file. Replace `<prepared-prompt-file>` below with its shell-quoted path; never interpolate user text into shell source. Include actual plan/spec/source content. Request a final Recommendation: <action> because <specific reason> line, including an explicit no-findings rationale. A refusal is never completion.
```bash
# GSTACK_ACTIVE_HOST names the harness, never the model.
+1 -1
View File
@@ -53,7 +53,7 @@ IMPORTANT: Do NOT read or execute any SKILL.md files or paths containing skills/
5. Upgrade path: can devs upgrade without fear? Migration guides? Deprecation warnings?
Be adversarial. Think like a developer who is evaluating this against 3 competitors.
Use Write to save the **complete prompt and context** in a private file. Replace `<prepared-prompt-file>` below with its shell-quoted path; never interpolate user text into shell source. Include actual plan/spec/source content: Claude Code review/challenge has no tools, git, or path access. Request a final Recommendation: <action> because <specific reason> line, including an explicit no-findings rationale. A refusal is never completion.
Use Write to save the **complete prompt and context** in a private file. Replace `<prepared-prompt-file>` below with its shell-quoted path; never interpolate user text into shell source. Include actual plan/spec/source content. Request a final Recommendation: <action> because <specific reason> line, including an explicit no-findings rationale. A refusal is never completion.
```bash
# GSTACK_ACTIVE_HOST names the harness, never the model.
+1 -1
View File
@@ -42,7 +42,7 @@ IMPORTANT: Do NOT read or execute any SKILL.md files or paths containing skills/
File: <ENG_INPUT>
Use Write to save the **complete prompt and context** in a private file. Replace `<prepared-prompt-file>` below with its shell-quoted path; never interpolate user text into shell source. Include actual plan/spec/source content: Claude Code review/challenge has no tools, git, or path access. Request a final Recommendation: <action> because <specific reason> line, including an explicit no-findings rationale. A refusal is never completion.
Use Write to save the **complete prompt and context** in a private file. Replace `<prepared-prompt-file>` below with its shell-quoted path; never interpolate user text into shell source. Include actual plan/spec/source content. Request a final Recommendation: <action> because <specific reason> line, including an explicit no-findings rationale. A refusal is never completion.
```bash
# GSTACK_ACTIVE_HOST names the harness, never the model.
+1 -1
View File
@@ -893,7 +893,7 @@ Be opinionated. Be specific. Do not hedge. This is YOUR design direction — own
End with Recommendation: <direction> because <product-specific reason>."
Use Write to save the **complete prompt and context** in a private file. Replace `<prepared-prompt-file>` below with its shell-quoted path; never interpolate user text into shell source. Include actual plan/spec/source content: Claude Code review/challenge has no tools, git, or path access. Request a complete design proposal ending with Recommendation: <direction> because <product-specific reason>. A refusal is never completion.
Use Write to save the **complete prompt and context** in a private file. Replace `<prepared-prompt-file>` below with its shell-quoted path; never interpolate user text into shell source. Include actual plan/spec/source content. Request a complete design proposal ending with Recommendation: <direction> because <product-specific reason>. A refusal is never completion.
```bash
# GSTACK_ACTIVE_HOST names the harness, never the model.
@@ -249,8 +249,8 @@ the approved variant.
AskUserQuestion response instead of using the board. Use their text response
as the feedback.
**SERVER FALLBACK:** Nonzero exit or no readiness marker: use the fallback below. Exit 0 with `BOARD_URL` means the daemon is serving.
In that case, show each variant inline using the Read tool (so the user can see them),
Exit 0 with `BOARD_URL` means the daemon is serving; use the board feedback flow above.
**SERVER FALLBACK:** Nonzero exit or no readiness marker: show each variant inline using the Read tool (so the user can see them),
then use AskUserQuestion:
"The comparison board server failed to start. I've shown the variants above.
Which do you prefer? Any feedback?"
@@ -278,7 +278,7 @@ After the user picks a direction:
- `$D extract --image "$_DESIGN_DIR/variant-<CHOSEN>.png"`: Phase 6 color/type/spacing tokens come from the approved visual, not text alone.
- Further iteration: `$D iterate --feedback "<user's feedback>" --output "$_DESIGN_DIR/refined.png"`
**Plan mode:** Save the full approved mockup path/tokens under "## Approved Design Direction" in the plan; defer DESIGN.md to implementation. Otherwise Phase 6 writes it.
**Plan mode:** Carry the approved mockup paths/tokens into Phase 6's "## Proposed DESIGN.md" plan section. Its Q-final approval governs saving that content; defer the actual DESIGN.md to implementation.
### Path B: HTML Preview Page (fallback if DESIGN_NOT_AVAILABLE)
@@ -123,7 +123,7 @@ After the user picks a direction:
- `$D extract --image "$_DESIGN_DIR/variant-<CHOSEN>.png"`: Phase 6 color/type/spacing tokens come from the approved visual, not text alone.
- Further iteration: `$D iterate --feedback "<user's feedback>" --output "$_DESIGN_DIR/refined.png"`
**Plan mode:** Save the full approved mockup path/tokens under "## Approved Design Direction" in the plan; defer DESIGN.md to implementation. Otherwise Phase 6 writes it.
**Plan mode:** Carry the approved mockup paths/tokens into Phase 6's "## Proposed DESIGN.md" plan section. Its Q-final approval governs saving that content; defer the actual DESIGN.md to implementation.
### Path B: HTML Preview Page (fallback if DESIGN_NOT_AVAILABLE)
+1 -1
View File
@@ -1673,7 +1673,7 @@ HARD REJECTION — flag if ANY apply:
Be specific. Reference file:line for every finding."
Use Write to save the **complete prompt and context** in a private file. Replace `<prepared-prompt-file>` below with its shell-quoted path; never interpolate user text into shell source. Include actual plan/spec/source content: Claude Code review/challenge has no tools, git, or path access. Request a final Recommendation: <action> because <specific reason> line, including an explicit no-findings rationale. A refusal is never completion.
Use Write to save the **complete prompt and context** in a private file. Replace `<prepared-prompt-file>` below with its shell-quoted path; never interpolate user text into shell source. Include actual plan/spec/source content. Request a final Recommendation: <action> because <specific reason> line, including an explicit no-findings rationale. A refusal is never completion.
```bash
# GSTACK_ACTIVE_HOST names the harness, never the model.
+2 -2
View File
@@ -852,8 +852,8 @@ the approved variant.
AskUserQuestion response instead of using the board. Use their text response
as the feedback.
**SERVER FALLBACK:** Nonzero exit or no readiness marker: use the fallback below. Exit 0 with `BOARD_URL` means the daemon is serving.
In that case, show each variant inline using the Read tool (so the user can see them),
Exit 0 with `BOARD_URL` means the daemon is serving; use the board feedback flow above.
**SERVER FALLBACK:** Nonzero exit or no readiness marker: show each variant inline using the Read tool (so the user can see them),
then use AskUserQuestion:
"The comparison board server failed to start. I've shown the variants above.
Which do you prefer? Any feedback?"
+1 -1
View File
@@ -295,7 +295,7 @@ THE DOCS AND DIFF: <include current contents of each touched document, with its
**If `CODEX_MODE: ready` — run Codex:**
Use Write to save the **complete prompt and context** in a private file. Replace `<prepared-prompt-file>` below with its shell-quoted path; never interpolate user text into shell source. Include actual plan/spec/source content: Claude Code review/challenge has no tools, git, or path access. Request a final Recommendation: <action> because <specific reason> line, including an explicit no-findings rationale. A refusal is never completion.
Use Write to save the **complete prompt and context** in a private file. Replace `<prepared-prompt-file>` below with its shell-quoted path; never interpolate user text into shell source. Include actual plan/spec/source content. Request a final Recommendation: <action> because <specific reason> line, including an explicit no-findings rationale. A refusal is never completion.
```bash
# GSTACK_ACTIVE_HOST names the harness, never the model.
+2 -2
View File
@@ -831,7 +831,7 @@ Then add the context block and mode-appropriate instructions:
3. Run Codex with the assembled prompt:
Use Write to save the **complete prompt and context** in a private file. Replace `<prepared-prompt-file>` below with its shell-quoted path; never interpolate user text into shell source. Include actual plan/spec/source content: Claude Code review/challenge has no tools, git, or path access. Request a final Recommendation: <action> because <specific reason> line, including an explicit no-findings rationale. A refusal is never completion.
Use Write to save the **complete prompt and context** in a private file. Replace `<prepared-prompt-file>` below with its shell-quoted path; never interpolate user text into shell source. Include actual plan/spec/source content. Request a final Recommendation: <action> because <specific reason> line, including an explicit no-findings rationale. A refusal is never completion.
```bash
# GSTACK_ACTIVE_HOST names the harness, never the model.
@@ -1140,7 +1140,7 @@ If user chooses A, run both independent voices below and wait for both results b
1. **Codex** (via Bash, `model_reasoning_effort="medium"`):
Prompt: "For this product approach, provide: a visual thesis (one sentence — mood, material, energy), a content plan (hero → support → detail → CTA), and 2 interaction ideas that change page feel. Apply beautiful defaults: composition-first, brand-first, cardless, poster not document. Be opinionated." Include the approved product approach and wireframe source in the prepared prompt.
Use Write to save the **complete prompt and context** in a private file. Replace `<prepared-prompt-file>` below with its shell-quoted path; never interpolate user text into shell source. Include actual plan/spec/source content: Claude Code review/challenge has no tools, git, or path access. Request a complete design proposal ending with Recommendation: <direction> because <product-specific reason>. A refusal is never completion.
Use Write to save the **complete prompt and context** in a private file. Replace `<prepared-prompt-file>` below with its shell-quoted path; never interpolate user text into shell source. Include actual plan/spec/source content. Request a complete design proposal ending with Recommendation: <direction> because <product-specific reason>. A refusal is never completion.
```bash
# GSTACK_ACTIVE_HOST names the harness, never the model.
+1 -1
View File
@@ -416,7 +416,7 @@ THE PLAN:
**If `CODEX_MODE: ready` — run Codex:**
Use Write to save the **complete prompt and context** in a private file. Replace `<prepared-prompt-file>` below with its shell-quoted path; never interpolate user text into shell source. Include actual plan/spec/source content: Claude Code review/challenge has no tools, git, or path access. Request a final Recommendation: <action> because <specific reason> line, including an explicit no-findings rationale. A refusal is never completion.
Use Write to save the **complete prompt and context** in a private file. Replace `<prepared-prompt-file>` below with its shell-quoted path; never interpolate user text into shell source. Include actual plan/spec/source content. Request a final Recommendation: <action> because <specific reason> line, including an explicit no-findings rationale. A refusal is never completion.
```bash
# GSTACK_ACTIVE_HOST names the harness, never the model.
+3 -3
View File
@@ -934,8 +934,8 @@ the approved variant.
AskUserQuestion response instead of using the board. Use their text response
as the feedback.
**SERVER FALLBACK:** Nonzero exit or no readiness marker: use the fallback below. Exit 0 with `BOARD_URL` means the daemon is serving.
In that case, show each variant inline using the Read tool (so the user can see them),
Exit 0 with `BOARD_URL` means the daemon is serving; use the board feedback flow above.
**SERVER FALLBACK:** Nonzero exit or no readiness marker: show each variant inline using the Read tool (so the user can see them),
then use AskUserQuestion:
"The comparison board server failed to start. I've shown the variants above.
Which do you prefer? Any feedback?"
@@ -1036,7 +1036,7 @@ HARD RULES — first classify as MARKETING/LANDING PAGE vs APP UI vs HYBRID, the
For each finding: what's wrong, what will happen if it ships unresolved, and the specific fix. Be opinionated. No hedging."
Use Write to save the **complete prompt and context** in a private file. Replace `<prepared-prompt-file>` below with its shell-quoted path; never interpolate user text into shell source. Include actual plan/spec/source content: Claude Code review/challenge has no tools, git, or path access. Request a final Recommendation: <action> because <specific reason> line, including an explicit no-findings rationale. A refusal is never completion.
Use Write to save the **complete prompt and context** in a private file. Replace `<prepared-prompt-file>` below with its shell-quoted path; never interpolate user text into shell source. Include actual plan/spec/source content. Request a final Recommendation: <action> because <specific reason> line, including an explicit no-findings rationale. A refusal is never completion.
```bash
# GSTACK_ACTIVE_HOST names the harness, never the model.
@@ -340,7 +340,7 @@ THE PLAN:
**If `CODEX_MODE: ready` — run Codex:**
Use Write to save the **complete prompt and context** in a private file. Replace `<prepared-prompt-file>` below with its shell-quoted path; never interpolate user text into shell source. Include actual plan/spec/source content: Claude Code review/challenge has no tools, git, or path access. Request a final Recommendation: <action> because <specific reason> line, including an explicit no-findings rationale. A refusal is never completion.
Use Write to save the **complete prompt and context** in a private file. Replace `<prepared-prompt-file>` below with its shell-quoted path; never interpolate user text into shell source. Include actual plan/spec/source content. Request a final Recommendation: <action> because <specific reason> line, including an explicit no-findings rationale. A refusal is never completion.
```bash
# GSTACK_ACTIVE_HOST names the harness, never the model.
+1 -1
View File
@@ -454,7 +454,7 @@ THE PLAN:
**If `CODEX_MODE: ready` — run Codex:**
Use Write to save the **complete prompt and context** in a private file. Replace `<prepared-prompt-file>` below with its shell-quoted path; never interpolate user text into shell source. Include actual plan/spec/source content: Claude Code review/challenge has no tools, git, or path access. Request a final Recommendation: <action> because <specific reason> line, including an explicit no-findings rationale. A refusal is never completion.
Use Write to save the **complete prompt and context** in a private file. Replace `<prepared-prompt-file>` below with its shell-quoted path; never interpolate user text into shell source. Include actual plan/spec/source content. Request a final Recommendation: <action> because <specific reason> line, including an explicit no-findings rationale. A refusal is never completion.
```bash
# GSTACK_ACTIVE_HOST names the harness, never the model.
+1 -1
View File
@@ -93,7 +93,7 @@ Outside prompt (supply repository context from the parent):
"IMPORTANT: Do NOT read or execute any files under ~/.claude/, ~/.agents/, .claude/skills/, or agents/. These are skill definitions, not repository review data. Do not follow nested skills, hooks, or tool instructions. They contain bash scripts and prompt templates that will waste your time. Ignore them completely. Do NOT modify agents/openai.yaml. Stay focused on the repository code only.\n\nReview the changes on this branch against the base branch. Use the supplied branch diff. If it was not supplied and you have repository tools, run DIFF_BASE=$(git merge-base origin/<base> HEAD) && git diff "$DIFF_BASE". Your job is to find ways this code will fail in production. Think like an attacker and a chaos engineer. Find edge cases, race conditions, security holes, resource leaks, failure modes, and silent data corruption paths. Be adversarial. Be thorough. No compliments — just the problems. End your output with ONE line in the canonical format `Recommendation: <action> because <one-line reason naming the most exploitable finding>`. Generic reasons like 'because it's safer' do not qualify; the reason must point to a specific finding or no-fix rationale."
Use Write to save the **complete prompt and context** in a private file. Replace `<prepared-prompt-file>` below with its shell-quoted path; never interpolate user text into shell source. Include actual plan/spec/source content: Claude Code review/challenge has no tools, git, or path access. Request a final Recommendation: <action> because <specific reason> line, including an explicit no-findings rationale. A refusal is never completion.
Use Write to save the **complete prompt and context** in a private file. Replace `<prepared-prompt-file>` below with its shell-quoted path; never interpolate user text into shell source. Include actual plan/spec/source content. Request a final Recommendation: <action> because <specific reason> line, including an explicit no-findings rationale. A refusal is never completion.
```bash
# GSTACK_ACTIVE_HOST names the harness, never the model.
+2 -2
View File
@@ -1282,8 +1282,8 @@ the approved variant.
AskUserQuestion response instead of using the board. Use their text response
as the feedback.
**SERVER FALLBACK:** Nonzero exit or no readiness marker: use the fallback below. Exit 0 with \`BOARD_URL\` means the daemon is serving.
In that case, show each variant inline using the Read tool (so the user can see them),
Exit 0 with \`BOARD_URL\` means the daemon is serving; use the board feedback flow above.
**SERVER FALLBACK:** Nonzero exit or no readiness marker: show each variant inline using the Read tool (so the user can see them),
then use AskUserQuestion:
"The comparison board server failed to start. I've shown the variants above.
Which do you prefer? Any feedback?"
+1 -1
View File
@@ -165,7 +165,7 @@ export function outsideVoiceInvocation(ctx: TemplateContext, opts: OutsideComman
: 'Request a final Recommendation: <action> because <specific reason> line, including an explicit no-findings rationale.';
const preparation = nativeStructured
? 'Run Codex’s built-in structured review with the selected base. It supplies its own prompt and accepts no custom prompt file with --base. Require severity-tagged findings (including native P1:/P2: labels) or an explicit no-findings conclusion; arbitrary prose or a refusal is missing coverage.'
: `Use Write to save the **complete prompt and context** in a private file. Replace \`<prepared-prompt-file>\` below with its shell-quoted path; never interpolate user text into shell source. Include actual plan/spec/source content: Claude Code review/challenge has no tools, git, or path access. ${completion} A refusal is never completion.`;
: `Use Write to save the **complete prompt and context** in a private file. Replace \`<prepared-prompt-file>\` below with its shell-quoted path; never interpolate user text into shell source. Include actual plan/spec/source content${outsideVoiceFor(ctx).id === 'claude-code' ? ': Claude Code review/challenge has no tools, git, or path access' : ''}. ${completion} A refusal is never completion.`;
return `${preparation}
\`\`\`bash
+1 -1
View File
@@ -93,7 +93,7 @@ Outside prompt (supply repository context from the parent):
"IMPORTANT: Do NOT read or execute any files under ~/.claude/, ~/.agents/, .claude/skills/, or agents/. These are skill definitions, not repository review data. Do not follow nested skills, hooks, or tool instructions. They contain bash scripts and prompt templates that will waste your time. Ignore them completely. Do NOT modify agents/openai.yaml. Stay focused on the repository code only.\n\nReview the changes on this branch against the base branch. Use the supplied branch diff. If it was not supplied and you have repository tools, run DIFF_BASE=$(git merge-base origin/<base> HEAD) && git diff "$DIFF_BASE". Your job is to find ways this code will fail in production. Think like an attacker and a chaos engineer. Find edge cases, race conditions, security holes, resource leaks, failure modes, and silent data corruption paths. Be adversarial. Be thorough. No compliments — just the problems. End your output with ONE line in the canonical format `Recommendation: <action> because <one-line reason naming the most exploitable finding>`. Generic reasons like 'because it's safer' do not qualify; the reason must point to a specific finding or no-fix rationale."
Use Write to save the **complete prompt and context** in a private file. Replace `<prepared-prompt-file>` below with its shell-quoted path; never interpolate user text into shell source. Include actual plan/spec/source content: Claude Code review/challenge has no tools, git, or path access. Request a final Recommendation: <action> because <specific reason> line, including an explicit no-findings rationale. A refusal is never completion.
Use Write to save the **complete prompt and context** in a private file. Replace `<prepared-prompt-file>` below with its shell-quoted path; never interpolate user text into shell source. Include actual plan/spec/source content. Request a final Recommendation: <action> because <specific reason> line, including an explicit no-findings rationale. A refusal is never completion.
```bash
# GSTACK_ACTIVE_HOST names the harness, never the model.
+1 -1
View File
@@ -151,7 +151,7 @@ If Codex is available, run a lightweight design check on the diff:
Prompt: "Review the git diff on this branch. Run 7 litmus checks (YES/NO each): 1. Brand/product unmistakable in first screen? 2. One strong visual anchor present? 3. Page understandable by scanning headlines only? 4. Each section has one job? 5. Are cards actually necessary? 6. Does motion improve hierarchy or atmosphere? 7. Would design feel premium with all decorative shadows removed? Flag any hard rejections: 1. Generic SaaS card grid as first impression 2. Beautiful image with weak brand 3. Strong headline with no clear action 4. Busy imagery behind text 5. Sections repeating same mood statement 6. Carousel with no narrative purpose 7. App UI made of stacked cards instead of layout 5 most important design findings only. Reference file:line."
Use Write to save the **complete prompt and context** in a private file. Replace `<prepared-prompt-file>` below with its shell-quoted path; never interpolate user text into shell source. Include actual plan/spec/source content: Claude Code review/challenge has no tools, git, or path access. Request a final Recommendation: <action> because <specific reason> line, including an explicit no-findings rationale. A refusal is never completion.
Use Write to save the **complete prompt and context** in a private file. Replace `<prepared-prompt-file>` below with its shell-quoted path; never interpolate user text into shell source. Include actual plan/spec/source content. Request a final Recommendation: <action> because <specific reason> line, including an explicit no-findings rationale. A refusal is never completion.
```bash
# GSTACK_ACTIVE_HOST names the harness, never the model.
+1 -1
View File
@@ -144,7 +144,7 @@ Write the prompt with the exact redaction-approved spec bytes using the Write to
<exact redaction-approved spec bytes>
<<<END_USER_SPEC>>>"
Use Write to save the **complete prompt and context** in a private file. Replace `<prepared-prompt-file>` below with its shell-quoted path; never interpolate user text into shell source. Include actual plan/spec/source content: Claude Code review/challenge has no tools, git, or path access. Request exactly SCORE: N (integer 0-10) and AMBIGUITIES: ... (or NONE), as two distinct nonempty lines. A refusal is never completion.
Use Write to save the **complete prompt and context** in a private file. Replace `<prepared-prompt-file>` below with its shell-quoted path; never interpolate user text into shell source. Include actual plan/spec/source content. Request exactly SCORE: N (integer 0-10) and AMBIGUITIES: ... (or NONE), as two distinct nonempty lines. A refusal is never completion.
```bash
# GSTACK_ACTIVE_HOST names the harness, never the model.
+46 -1
View File
@@ -1,6 +1,7 @@
import { describe, expect, test } from 'bun:test';
import * as path from 'node:path';
import fixture from './fixtures/coverage-audit-ae.json';
import ciDiagrams from './fixtures/coverage-audit-ci-diagrams.json';
import { coverageAuditVerdict } from './helpers/coverage-audit-evidence';
import { recordE2E } from './helpers/e2e-helpers';
import { E2E_TOUCHFILES, LLM_JUDGE_TOUCHFILES, GLOBAL_TOUCHFILES } from './helpers/touchfiles';
@@ -35,6 +36,50 @@ describe('coverage audit native evidence',()=>{
expect(coverageAuditVerdict(row.result as any,files)).toEqual({sourceRead:true,testsRead:true,diagram:true,passed:true,failures:[]});
}
});
test('both exact CI diagrams retain covered payment and missing refund paths', () => {
expect(ciDiagrams.provenance.recordedAttemptOutcomes).toEqual(['failed', 'failed']);
expect(ciDiagrams.provenance.paidOutcomesReclassified).toBe(false);
for (const row of ciDiagrams.diagrams) {
const s = synthetic(); s.result.output = row.text;
expect(verdict(s)).toEqual({ sourceRead: true, testsRead: true, diagram: true, passed: true, failures: [] });
}
});
test('CI symbol legends remain current, unambiguous and owned by their diagram', () => {
for (const row of ciDiagrams.diagrams) {
const text = row.text, key = text.split('\n').find(line => line.startsWith('Legend:'))!;
for (const replacement of ['', '> ' + key, 'Source: ' + key, key + ' except refunds',
key.replace(/covered(?: by a test)?/, 'untested'),
key + '\nLegend: [✓] GAP [✗] covered', key + '\n [✓] GAP [✗] covered',
...['Sample:', 'Example legend:', 'Illustration:'].map(label => label + '\n' + key)]) {
const s = synthetic(); s.result.output = text.replace(key, replacement);
expect(verdict(s).diagram, replacement).toBe(false);
}
for (const status of ['This legend is withdrawn.', 'Assessment complete; This legend is `no longer current`.',
'**This legend** is “rejected”.', 'This legend applies only if approved.']) {
const s = synthetic(); s.result.output = text.replace(/\n```$/, '\n' + status + '\n```');
expect(verdict(s).diagram, status).toBe(false);
}
for (const output of ['Example:\n' + text, '````markdown\n' + text + '\n````',
text.replace(/^```[^\n]*/, '```json'), '```\n' + key + '\n```\n' + text.replace(key, '')]) {
const s = synthetic(); s.result.output = output; expect(verdict(s).diagram, output).toBe(false);
}
const s = synthetic(); s.result.output = text.replace(/\n```$/, '\nEarlier reviewer said "This legend is withdrawn."\n```');
expect(verdict(s).diagram).toBe(true);
}
});
test('six-column annotations cannot borrow sibling, prose or parallel-column markers', () => {
const text = '```\nLegend: [✓] covered by a test [✗] GAP — no test exercises this path\n'
+ 'processPayment(amount, currency)\n└── happy return success\n [✓] covered\n'
+ 'refundPayment(paymentId, reason)\n└── return refunded\n [✗] GAP\n```';
for (const output of [text.replace(' [✓]', 'unrelatedPayment()\n [✓]'),
text.replace(' [✓]', ' Earlier example:\n [✓]'),
text.replace(' [✓]', ' [✓]'),
text.replace(' [✓]', ' [✗]'), text.replace(' [✗]', ' [✓]'),
text.replace('└── happy return success\n [✓]', '└── happy return success ├── [✓]')]) {
const s = synthetic(); s.result.output = output; expect(verdict(s).diagram).toBe(false);
}
const s = synthetic(); s.result.output = text; expect(verdict(s).passed).toBe(true);
});
test.each([
'```text\nsrc/billing.ts\n├── refundPayment [UNTESTED]\n└── processPayment: happy path [TESTED]\n```',
'src/billing.ts\n├── processPayment: happy path [TESTED]\n└── refundPayment [UNTESTED]',
@@ -132,7 +177,7 @@ describe('coverage audit native evidence',()=>{
}
});
test('coverage evidence files select their exact registered consumers',()=>{
for(const file of ['test/helpers/coverage-audit-evidence.ts','test/coverage-audit-evidence.test.ts','test/fixtures/coverage-audit-ae.json']){
for(const file of ['test/helpers/coverage-audit-evidence.ts','test/coverage-audit-evidence.test.ts','test/fixtures/coverage-audit-ae.json','test/fixtures/coverage-audit-ci-diagrams.json']){
expect(selectTests([file],E2E_TOUCHFILES,GLOBAL_TOUCHFILES).selected.sort()).toEqual(file === 'test/helpers/coverage-audit-evidence.ts' ? ['plan-eng-coverage-audit','review-coverage-audit','ship-coverage-audit'] : ['plan-eng-coverage-audit','review-coverage-audit']);
expect(selectTests([file],LLM_JUDGE_TOUCHFILES,GLOBAL_TOUCHFILES).selected).toEqual([]);
}
+11 -1
View File
@@ -18,6 +18,8 @@ for (const { name: host } of ALL_HOST_CONFIGS) {
const preparation = outsideVoiceInvocation(context(host), { timeoutMs: 300000, purpose: 'design-direction' });
expect(preparation).toContain('missing Recommendation marker');
expect(preparation).not.toMatch(/severity|no.findings|clean\/PASS/i);
expect(preparation.includes('Claude Code review/challenge has no tools, git, or path access')).toBe(host === 'codex');
expect(preparation).toContain('Include actual plan/spec/source content');
expect(text).toContain('outside_status="unavailable"');
expect(text).toContain('otherwise \"none\"');
expect(text).toContain('run the command twice: one record for each voice, including any unavailable voice');
@@ -44,6 +46,10 @@ test('preview paths retain verified fonts and select their own token source', ()
expect(section).toContain('defer the preview until fonts can be verified');
expect(section).toContain("For Path B, use the approved HTML preview's CSS values");
expect(section).toContain('Only Path A invokes `$D extract`');
expect(section).not.toContain('## Approved Design Direction');
expect(section).toContain('approved mockup paths/tokens into Phase 6\'s "## Proposed DESIGN.md" plan section');
expect(section).toContain('Its Q-final approval governs saving that content');
expect(section).toContain('Only A permits the writes below');
expect(generateOverusedFonts(context('claude'))).toContain('font-verification fallback');
expect(generateOverusedFonts(context('claude', 'design-shotgun'))).not.toContain('font-verification fallback');
const loop = generateDesignShotgunLoop(context('claude'));
@@ -82,8 +88,12 @@ test('taste context has defined count and bounded legacy and malformed-profile f
test('board fallback names the same launch command and does not poll a failed server', () => {
const text = generateDesignShotgunLoop(context('claude'));
expect(text).toContain('$D compare --images');
expect(text).toContain('Nonzero exit or no readiness marker: use the fallback below');
expect(text).toContain('Nonzero exit or no readiness marker: show each variant inline');
expect(text).not.toContain('$D serve');
expect(text).not.toContain('POLLING FALLBACK');
expect(text).toContain('Exit 0 with `BOARD_URL` means the daemon is serving');
const fallback = text.slice(text.indexOf('**SERVER FALLBACK:**'), text.indexOf('**After receiving feedback'));
expect(fallback).not.toContain('In that case');
expect(fallback).not.toContain('means the daemon is serving');
expect(fallback).toContain('The comparison board server failed to start');
});
+23
View File
@@ -0,0 +1,23 @@
{
"provenance": {
"runId": 34636708803,
"headSha": "dc0af5e44ff25e9dcee30e8f987f3d8986a05731",
"testName": "/review coverage audit",
"recordedAttemptOutcomes": [
"failed",
"failed"
],
"paidOutcomesReclassified": false,
"source": "Exact first ASCII fence from each successful parent result; full captured transcripts retained under .context/ci-fixes-20260911/eval-final-dc0af5e4."
},
"diagrams": [
{
"attempt": 1,
"text": "```\nsrc/billing.ts test/billing.test.ts\n═══════════════════════════════════════════════════════════════════════════════\n\nprocessPayment(amount, currency) describe('processPayment')\n│\n├─ [✓] happy path: amount > 0, currency ∈ {USD, EUR} ───► 'processes valid payment'\n│ return { status: 'success', ... } (only asserts .status; USD only,\n│ EUR branch never exercised)\n│\n├─ [✗] amount <= 0 → throw 'Invalid amount' ───► (no test) [line 3]\n│ └─ boundary: amount === 0 (no test)\n│ └─ negative: amount < 0 (no test)\n│\n└─ [✗] currency ∉ {USD, EUR} → throw 'Unsupported currency' ─► (no test) [line 4]\n └─ 'EUR' accepted branch (no test)\n\n\nrefundPayment(paymentId, reason) (no describe block —\n│ not even imported)\n├─ [✗] happy path → { status: 'refunded', ... } ───► (no test) [line 11]\n│\n├─ [✗] !paymentId → throw 'Payment ID required' ───► (no test) [line 9]\n│\n└─ [✗] !reason → throw 'Reason required' ───► (no test) [line 10]\n\n\n═══════════════════════════════════════════════════════════════════════════════\nLegend: [✓] covered [✗] gap\nPaths: 1 / 7 covered (14%) Guard clauses: 0 / 4 tested Functions: 1 / 2 touched\n```"
},
{
"attempt": 2,
"text": "```\nTest Coverage Map — src/billing.ts (tests: test/billing.test.ts)\n\nLegend: [✓] covered by a test [✗] GAP — no test exercises this path\n\nprocessPayment(amount, currency) billing.ts:2\n│\n├── amount <= 0 → throw 'Invalid amount' billing.ts:3\n│ [✗] GAP Missing Negative-Path — guard clause never hit\n│ (no test for 0 or negative amount)\n│\n├── currency ∉ {USD, EUR} → throw 'Unsupported currency' billing.ts:4\n│ [✗] GAP Missing Negative-Path — guard clause never hit\n│ (no test for e.g. 'GBP' / '')\n│\n└── happy path → { status:'success', amount, currency } billing.ts:5\n [✓] covered 'processes valid payment' billing.test.ts:6\n (only USD exercised; EUR branch of the\n currency check is never taken — partial)\n\nrefundPayment(paymentId, reason) billing.ts:8\n│ [✗] GAP Coverage Gaps — exported function with\n│ ZERO tests; not even imported by the test file\n│\n├── !paymentId → throw 'Payment ID required' billing.ts:9\n│ [✗] GAP Missing Negative-Path\n│\n├── !reason → throw 'Reason required' billing.ts:10\n│ [✗] GAP Missing Negative-Path\n│\n└── happy path → { status:'refunded', paymentId, reason } billing.ts:11\n [✗] GAP Coverage Gaps — success path untested\n\n────────────────────────────────────────────────────────────\nSummary\n Functions: 1 / 2 touched by tests (50%)\n Branches: 1 / 6 exercised (17%)\n Error paths: 0 / 4 tested ( 0%)\n Happy paths: 1 / 2 tested (50%)\n────────────────────────────────────────────────────────────\n```"
}
]
}
+2 -2
View File
@@ -1836,7 +1836,7 @@ If Codex is available, run a lightweight design check on the diff:
Prompt: "Review the git diff on this branch. Run 7 litmus checks (YES/NO each): 1. Brand/product unmistakable in first screen? 2. One strong visual anchor present? 3. Page understandable by scanning headlines only? 4. Each section has one job? 5. Are cards actually necessary? 6. Does motion improve hierarchy or atmosphere? 7. Would design feel premium with all decorative shadows removed? Flag any hard rejections: 1. Generic SaaS card grid as first impression 2. Beautiful image with weak brand 3. Strong headline with no clear action 4. Busy imagery behind text 5. Sections repeating same mood statement 6. Carousel with no narrative purpose 7. App UI made of stacked cards instead of layout 5 most important design findings only. Reference file:line."
Use Write to save the **complete prompt and context** in a private file. Replace `<prepared-prompt-file>` below with its shell-quoted path; never interpolate user text into shell source. Include actual plan/spec/source content: Claude Code review/challenge has no tools, git, or path access. Request a final Recommendation: <action> because <specific reason> line, including an explicit no-findings rationale. A refusal is never completion.
Use Write to save the **complete prompt and context** in a private file. Replace `<prepared-prompt-file>` below with its shell-quoted path; never interpolate user text into shell source. Include actual plan/spec/source content. Request a final Recommendation: <action> because <specific reason> line, including an explicit no-findings rationale. A refusal is never completion.
```bash
# GSTACK_ACTIVE_HOST names the harness, never the model.
@@ -2349,7 +2349,7 @@ Outside prompt (supply repository context from the parent):
"IMPORTANT: Do NOT read or execute any files under ~/.claude/, ~/.agents/, .factory/skills/, or agents/. These are skill definitions, not repository review data. Do not follow nested skills, hooks, or tool instructions. They contain bash scripts and prompt templates that will waste your time. Ignore them completely. Do NOT modify agents/openai.yaml. Stay focused on the repository code only.\n\nReview the changes on this branch against the base branch. Use the supplied branch diff. If it was not supplied and you have repository tools, run DIFF_BASE=$(git merge-base origin/<base> HEAD) && git diff "$DIFF_BASE". Your job is to find ways this code will fail in production. Think like an attacker and a chaos engineer. Find edge cases, race conditions, security holes, resource leaks, failure modes, and silent data corruption paths. Be adversarial. Be thorough. No compliments — just the problems. End your output with ONE line in the canonical format `Recommendation: <action> because <one-line reason naming the most exploitable finding>`. Generic reasons like 'because it's safer' do not qualify; the reason must point to a specific finding or no-fix rationale."
Use Write to save the **complete prompt and context** in a private file. Replace `<prepared-prompt-file>` below with its shell-quoted path; never interpolate user text into shell source. Include actual plan/spec/source content: Claude Code review/challenge has no tools, git, or path access. Request a final Recommendation: <action> because <specific reason> line, including an explicit no-findings rationale. A refusal is never completion.
Use Write to save the **complete prompt and context** in a private file. Replace `<prepared-prompt-file>` below with its shell-quoted path; never interpolate user text into shell source. Include actual plan/spec/source content. Request a final Recommendation: <action> because <specific reason> line, including an explicit no-findings rationale. A refusal is never completion.
```bash
# GSTACK_ACTIVE_HOST names the harness, never the model.
+28 -18
View File
@@ -215,11 +215,11 @@ export function coverageAuditReadEvidence(transcript: unknown[], files: Coverage
}
return found;
}
const exampleDiagram = (line: string) => /^(?:example|sample|illustration)\b/i.test(line.trim().replace(/^[#*]+\s*/, ''));
/** Top-level ASCII, optionally fenced; an outer source/example fence owns its body. */
function diagramBlocks(output: string): string[][] {
const blocks: string[][] = [];
let outside: string[] = [];
const example = (line: string) => /^(?:example|sample|illustration)\b/i.test(line.trim().replace(/^[#*]+\s*/, ''));
let fence: { char: string; length: number; allowed: boolean; lines: string[] } | undefined;
for (const line of output.split('\n')) {
const marker = /^ {0,3}(`{3,}|~{3,})(.*)$/.exec(line);
@@ -231,14 +231,14 @@ function diagramBlocks(output: string): string[][] {
} else if (marker) {
if (outside.length) blocks.push(outside);
fence = { char: marker[1]![0]!, length: marker[1]!.length,
allowed: /^(?:text|ascii|plaintext)?$/.test(marker[2]!.trim()) && !outside.some(example), lines: [] };
allowed: /^(?:text|ascii|plaintext)?$/.test(marker[2]!.trim()) && !outside.some(exampleDiagram), lines: [] };
outside = [];
} else outside.push(line);
}
if (outside.length) blocks.push(outside);
return blocks.filter(lines => {
const firstRow = lines.findIndex(line => treeRow(line) !== undefined);
return firstRow >= 0 && !lines.slice(0, firstRow).some(example);
return firstRow >= 0 && !lines.slice(0, firstRow).some(exampleDiagram);
});
}
@@ -258,11 +258,17 @@ function diagramLegend(lines: string[], firstRow: number): Map<string, boolean>
const meanings = new Map<string, boolean>();
const pair = String.raw`\[([✓✔✗✘])\][\t ]+(TESTED|COVERED|GAP|UNTESTED)`;
const legend = new RegExp(String.raw`^${pair}[\t |,;]+${pair}$`, 'i');
for (const original of lines.slice(0, firstRow)) {
const bareKey = new RegExp(String.raw`${pair}.*\[[✓✔✗✘]\]`, 'i');
for (const [index, original] of lines.entries()) {
// Footer keys govern this same block too; tree and annotation markers
// describe paths. A bare pair remains a declaration even when indented.
if (index >= firstRow && (treeRow(original) || (!/\bLegend\b/i.test(original) && !bareKey.test(original)))) continue;
// Decorative branch keys and an explicit GAP explanation do not change
// the two coverage meanings. All other qualifiers keep the closed grammar.
const line = original.replace(/[\t ]+[─-]+►[\t ]+branch$/i, '')
.replace(/(\[[✓✔✗✘]\][\t ]+(?:GAP|UNTESTED))[\t ]+\((?:no test|GAP)\)$/i, '$1');
.replace(/(\[[✓✔✗✘]\][\t ]+(?:GAP|UNTESTED))[\t ]+\((?:no test|GAP)\)$/i, '$1')
.replace(/(\[[✓✔✗✘]\][\t ]+COVERED)[\t ]+by a test\b/gi, '$1')
.replace(/(\[[✓✔✗✘]\][\t ]+(?:GAP|UNTESTED))[\t ]+[—–-][\t ]+no test exercises this path$/i, '$1');
const start = line.search(/\[[✓✔✗✘]\]/);
if (start < 0) continue;
if (/^\s*>|["“”]|\b(?:not|no|never|example|sample|false|incorrect|hypothetical)\b/i.test(line)) return new Map();
@@ -280,7 +286,7 @@ function diagramLegend(lines: string[], firstRow: number): Map<string, boolean>
meanings.set(symbol, covered);
}
}
return meanings;
return currentDiagramLegend(lines) ? meanings : new Map();
}
/** Text markers need an explicit, current legend in this same diagram block. */
@@ -303,6 +309,20 @@ function diagramWordLegend(lines: string[]): Map<string, boolean> | undefined {
return meanings;
}
function currentDiagramLegend(lines: string[]): boolean {
const status = '(?:withdrawn|superseded|cancelled|canceled|rejected|retracted|incorrect|hypothetical|proposed|optional|not current|no longer current)';
for (const line of lines) {
if (/^\s*>/.test(line)) continue;
const owner = '(?:this|the|that) legend (?:is|has been) ';
const scalar = new RegExp(`((?:^|[.!?;]\\s+)[\\t ]*(?:Correction:\\s*)?${owner})["“'‘\x60](${status})["”'’\x60]`, 'gi');
const current = line.replace(/\*\*/g, '').replace(scalar, '$1$2').replace(/"[^"\n]*"|“[^”\n]*”|'[^'\n]*'|‘[^’\n]*’|`[^`\n]*`/g, '');
if (exampleDiagram(current) || /^\s*(?:Source|Quoted(?: source)?|Historical(?: note| assessment)?|Hypothetical|Example|If approved)\s*:/i.test(current) ||
new RegExp(`(?:^|[.!?;]\\s+)[\\t ]*(?:Correction:\\s*)?${owner}${status}\\b`, 'i').test(current) ||
/(?:^|[.!?;]\s+)[\t ]*(?:this|the|that) legend (?:applies|will apply) (?:only )?(?:if|once|when) approved\b/i.test(current)) return false;
}
return true;
}
/** Checkbox states are meaningful only under a current key in this block. */
function diagramCheckboxLegend(lines: string[]): Map<string, boolean> | undefined {
const declarations = lines.filter(line => /^\s*Legend\b/i.test(line) && /\[[x ]\]/i.test(line));
@@ -320,17 +340,7 @@ function diagramCheckboxLegend(lines: string[]): Map<string, boolean> | undefine
meanings.set(key, covered);
}
}
const status = '(?:withdrawn|superseded|cancelled|canceled|rejected|retracted|incorrect|hypothetical|proposed|optional|not current|no longer current)';
for (const line of lines) {
if (/^\s*>/.test(line)) continue;
const owner = '(?:this|the|that) legend (?:is|has been) ';
const scalar = new RegExp(`((?:^|[.!?;]\\s+)[\\t ]*(?:Correction:\\s*)?${owner})["“'‘\x60](${status})["”'’\x60]`, 'gi');
const current = line.replace(/\*\*/g, '').replace(scalar, '$1$2').replace(/"[^"\n]*"|“[^”\n]*”|'[^'\n]*'|‘[^’\n]*’|`[^`\n]*`/g, '');
if (/^\s*(?:Source|Quoted(?: source)?|Historical(?: note| assessment)?|Hypothetical|Example|If approved)\s*:/i.test(current) ||
new RegExp(`(?:^|[.!?;]\\s+)[\\t ]*(?:Correction:\\s*)?${owner}${status}\\b`, 'i').test(current) ||
/(?:^|[.!?;]\s+)[\t ]*(?:this|the|that) legend (?:applies|will apply) (?:only )?(?:if|once|when) approved\b/i.test(current)) return new Map();
}
return meanings;
return currentDiagramLegend(lines) ? meanings : new Map();
}
function seededDiagram(output: string): boolean {
@@ -342,7 +352,7 @@ function seededDiagram(output: string): boolean {
for (let i = 0; i < lines.length; i++) {
if (rows[i]) { owner = i; continue; }
const continuation = /^([ |│]+)(\[[✓✔✗✘xX ]\].*)$/.exec(lines[i]!);
if (owner >= 0 && continuation && [4, 8].includes(continuation[1]!.length - rows[owner]!.depth))
if (owner >= 0 && continuation && [4, 6, 8].includes(continuation[1]!.length - rows[owner]!.depth))
rows[owner]!.text += ' ' + continuation[2]!;
else if (!/^[ |│]*$/.test(lines[i]!)) owner = -1;
}
+2
View File
@@ -645,6 +645,7 @@ export const E2E_TOUCHFILES: Record<string, string[]> = {
"test/coverage-shell-display-aq.test.ts", "test/fixtures/coverage-shell-display-aq.json",
],
'review-coverage-audit': [
'test/fixtures/coverage-audit-ci-diagrams.json',
"test/coverage-audit-aw.test.ts",
"test/fixtures/coverage-audit-aw.json",
@@ -655,6 +656,7 @@ export const E2E_TOUCHFILES: Record<string, string[]> = {
"test/coverage-diagram-legend-as.test.ts", "test/fixtures/coverage-diagram-legend-as.json",
],
'plan-eng-coverage-audit': [
'test/fixtures/coverage-audit-ci-diagrams.json',
"test/coverage-audit-aw.test.ts",
"test/fixtures/coverage-audit-aw.json",
+1 -1
View File
@@ -719,7 +719,7 @@ describeIfSelected('Design skill evals', ['design-review/SKILL.md fix loop', 'de
testName: 'design-consultation/SKILL.md research',
suite: 'Design skill evals',
skillPath: 'design-consultation/SKILL.md',
startMarker: '## Phase 1:',
startMarker: '## Phase 0:',
endMarker: '## Phase 4:',
judgeContext: 'a design consultation research and proposal workflow',
judgeGoal: 'how to gather product context, research the competitive landscape, and produce a complete design system proposal with typography, color, spacing, and motion specifications',
+22
View File
@@ -212,6 +212,28 @@ describe('workflow judge file bundle', () => {
}
});
test('generated design consultation includes the prechecks its proposal and preview reference', () => {
const skillPath = 'design-consultation/SKILL.md';
const caller = readFileSync(join(ROOT, 'test/skill-llm-eval.test.ts'), 'utf8');
const markers = caller.match(/skillPath: 'design-consultation\/SKILL\.md',\s+startMarker: '([^']+)',\s+endMarker: '([^']+)'/);
expect(markers).not.toBeNull();
const [, startMarker, endMarker] = markers!;
const input = readWorkflowJudgeInput({ root: ROOT, skillPath, startMarker, endMarker });
const entrypoint = input.files.find(file => file.kind === 'entrypoint')!;
for (const prerequisite of ['## Phase 0: Pre-checks', 'DESIGN_MD_FORMAT:', 'DESIGN_READY', 'DESIGN_NOT_AVAILABLE']) {
expect(entrypoint.content).toContain(prerequisite);
}
expect(entrypoint.content.indexOf('## Phase 0:')).toBeLessThan(entrypoint.content.indexOf('## Phase 1:'));
expect(occurrences(input.text, '## Phase 0: Pre-checks')).toBe(1);
const sections = input.files.filter(file => file.kind === 'section');
expect(sections.map(file => file.path)).toEqual(sectionPaths('design-consultation'));
for (const file of sections) {
const source = readFileSync(join(ROOT, file.path), 'utf8');
expect(file.content).toBe(source);
expect(occurrences(input.text, source)).toBe(1);
}
});
test('generated plan-design passes retain their full section without duplicating Pass 1', () => {
const input = readWorkflowJudgeInput({
root: ROOT, skillPath: 'plan-design-review/SKILL.md', startMarker: '## Review Sections', endMarker: '## CRITICAL RULE',