diff --git a/CHANGELOG.md b/CHANGELOG.md index e7967f426c..2c2d57ac34 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ The second Opus gate (run 39161502626) went 127/132. Each of the five reds is no - **plan-ceo-finding-floor, Edit menu** (3 of 10 measured trials): after that Create, Opus edited the plan and the cropped Edit menu stayed unanswered. Twice Claude Code showed the menu before publishing the Edit, and once three Edits were pending at once, so the check found no single published Edit. The plan's own PreToolUse input now covers an unpublished Edit, as it already did for Write, and the visible diff must match exactly one pending Edit on the owned plan. An Edit to another file, a diff matching none or several pending Edits, and a foreign session are still refused. - **shared-libs-review-index-flags** (the fourth gate, run 39173752116): the skip-worktree review read all three evidence files in one `for f in ; do echo "=== $f"; cat -n "$f"; done` loop. A loop over literal paths now counts as reading a file only when its output names that file. A loop over a variable list, a file missing from the output, a path outside the repo and the existing loop with no path in its output are still rejected. - **investigate-owned-abort and investigate-owned-ending-error** (the slot gate, run 39195396438): both actors asked their one continue/abort question in their own words ("go ahead … or stop now?") with exactly a Continue and an Abort option. The fixture recognized the question only by the words continue, proceed or abort in its text, refused it, then refused the re-ask as a second question. It now identifies the question by its two options' meanings. A second question, a question before the lock is acquired, an option set without an abort choice, three or more options and options whose descriptions contradict their labels are still refused. +- **plan-design-with-ui-scope** (gate run 39199692993): Opus titled its focus question "Review focus: all 7 dimensions or specific areas?" and opened the body with "I rated this plan 5/10 on design completeness". The check required the word "design" in the title, so it missed the acknowledged design focus. An all-7 or focus title now also passes when the body carries the skill's own rating sentence ("I rated this plan N/10 on design completeness"). A focus title with no rating, a rating with no focus choice, a target menu that mentions a design system and a 5/7 dimension count are still refused. ### If you… - **…compare pass rates across the switch:** Fable trials carry `harness_version: 5` and Opus trials `6`; they are separate series. diff --git a/test/fixtures/design-ui-focus-capture-39199692993.json b/test/fixtures/design-ui-focus-capture-39199692993.json new file mode 100644 index 0000000000..ca271dc12d --- /dev/null +++ b/test/fixtures/design-ui-focus-capture-39199692993.json @@ -0,0 +1,179 @@ +{ + "provenance": { + "kind": "public native AskUserQuestion calls and answers only (observation.json fingerprints[].nativeCall, byte-exact)", + "runId": 39199692993, + "artifact": "paid-slice-4-a1", + "headSha": "521fd755f08aee5d4223d705bb435e5f14b3aa2b", + "recordedOutcome": "ceiling_reached", + "recordedReviewCount": 1, + "recordedStep0Count": 4, + "recordedPassed": false, + "note": "The Step 0D question was titled 'Review focus: all 7 dimensions or specific areas?' and carried 'I rated this plan 5/10 on design completeness' in its body; the runner reached the review ceiling on Issue 1 but the focus predicate required 'design' in the title, so the gate failed." + }, + "calls": [ + { + "preReview": true, + "observedAtMs": 28904, + "call": { + "sessionId": "07135ef6-a767-4590-93a6-fdeb2bfa7ed3", + "toolUseId": "toolu_017hS4A4BLRpYc3Sn6opxhR7", + "questions": [ + { + "question": "D1 — Add gstack skill routing rules to CLAUDE.md?\nProject/branch/task: main branch, reviewing the User Dashboard UI plan.\nELI10: gstack routes requests to the right skill more reliably when CLAUDE.md has a short routing section. This is one-time setup, separate from the design review. We're in plan mode, so if you pick A the CLAUDE.md edit and commit wait until plan mode ends.\nStakes if we pick wrong: Without rules you invoke skills by hand; with them, CLAUDE.md gains a section and a commit.\nRecommendation: A because routing is a one-time setup that saves manual invocations later.\nNote: options differ in kind, not coverage — no completeness score.\nPros / cons:\nA) Add routing rules (recommended)\n ✅ Future requests like 'review this plan' auto-route to the right gstack skill\n ✅ One-time change, a short appended section at the end of CLAUDE.md\n ❌ Edits and commits CLAUDE.md, deferred here because plan mode is read-only\nB) No thanks\n ✅ CLAUDE.md stays exactly as it is, no commit added to the repo\n ✅ Nothing to defer, review continues with zero side effects\n ❌ You keep invoking skills manually by slash command every time\nNet: small one-time repo edit vs. manual skill invocation.", + "header": "Routing", + "multiSelect": false, + "options": [ + { + "label": "Add routing rules (recommended)", + "description": "Append the skill routing section to CLAUDE.md and commit (deferred until plan mode ends)." + }, + { + "label": "No thanks", + "description": "Set routing_declined and invoke skills manually." + } + ] + } + ], + "answered": true, + "failed": false, + "answers": { + "D1 — Add gstack skill routing rules to CLAUDE.md?\nProject/branch/task: main branch, reviewing the User Dashboard UI plan.\nELI10: gstack routes requests to the right skill more reliably when CLAUDE.md has a short routing section. This is one-time setup, separate from the design review. We're in plan mode, so if you pick A the CLAUDE.md edit and commit wait until plan mode ends.\nStakes if we pick wrong: Without rules you invoke skills by hand; with them, CLAUDE.md gains a section and a commit.\nRecommendation: A because routing is a one-time setup that saves manual invocations later.\nNote: options differ in kind, not coverage — no completeness score.\nPros / cons:\nA) Add routing rules (recommended)\n ✅ Future requests like 'review this plan' auto-route to the right gstack skill\n ✅ One-time change, a short appended section at the end of CLAUDE.md\n ❌ Edits and commits CLAUDE.md, deferred here because plan mode is read-only\nB) No thanks\n ✅ CLAUDE.md stays exactly as it is, no commit added to the repo\n ✅ Nothing to defer, review continues with zero side effects\n ❌ You keep invoking skills manually by slash command every time\nNet: small one-time repo edit vs. manual skill invocation.": "Add routing rules (recommended)" + }, + "unansweredQuestionIndices": [], + "answeredAt": "2026-10-19T04:42:03.524Z" + } + }, + { + "preReview": true, + "observedAtMs": 66192, + "call": { + "sessionId": "07135ef6-a767-4590-93a6-fdeb2bfa7ed3", + "toolUseId": "toolu_012ek9RcVGhViod3XrD9W3Zd", + "questions": [ + { + "question": "D2 — Review focus: all 7 dimensions or specific areas?\nProject/branch/task: main branch, User Dashboard plan (review-input.md).\nELI10: I rated this plan 5/10 on design completeness. The biggest gaps are information hierarchy and layout per breakpoint, row anatomy and empty-state content, and modal/toast accessibility details. I'll generate visual mockups next, then review all 7 dimensions unless you want me to narrow the focus.\nStakes if we pick wrong: Narrowing skips dimensions, which the implementer then guesses at.\nRecommendation: A because the gaps span hierarchy, states, a11y and visual spec, so a partial pass leaves holes.\nCompleteness: A=10/10, B=6/10\nPros / cons:\nA) All 7 dimensions (recommended)\n ✅ Every gap gets its own decision, so the implementer has nothing left to guess\n ✅ Catches issues across dimensions such as mobile order versus a11y focus order\n ❌ More questions, one per gap, so the review takes longer (human: ~1 hr / CC: ~15 min)\nB) Focus on hierarchy, states and accessibility only\n ✅ Fewer decisions and a faster path to an implementable plan for this dashboard\n ✅ Targets the three areas where the plan is currently weakest\n ❌ Visual tokens, AI-slop risk and unresolved decisions go unreviewed\nNet: thoroughness versus a faster, narrower pass.", + "header": "Focus", + "multiSelect": false, + "options": [ + { + "label": "All 7 dimensions (recommended)", + "description": "Full review: hierarchy, states, journey, AI slop, design system, responsive/a11y, unresolved decisions." + }, + { + "label": "Hierarchy, states, a11y", + "description": "Narrow review to the three weakest areas." + } + ] + } + ], + "answered": true, + "failed": false, + "answers": { + "D2 — Review focus: all 7 dimensions or specific areas?\nProject/branch/task: main branch, User Dashboard plan (review-input.md).\nELI10: I rated this plan 5/10 on design completeness. The biggest gaps are information hierarchy and layout per breakpoint, row anatomy and empty-state content, and modal/toast accessibility details. I'll generate visual mockups next, then review all 7 dimensions unless you want me to narrow the focus.\nStakes if we pick wrong: Narrowing skips dimensions, which the implementer then guesses at.\nRecommendation: A because the gaps span hierarchy, states, a11y and visual spec, so a partial pass leaves holes.\nCompleteness: A=10/10, B=6/10\nPros / cons:\nA) All 7 dimensions (recommended)\n ✅ Every gap gets its own decision, so the implementer has nothing left to guess\n ✅ Catches issues across dimensions such as mobile order versus a11y focus order\n ❌ More questions, one per gap, so the review takes longer (human: ~1 hr / CC: ~15 min)\nB) Focus on hierarchy, states and accessibility only\n ✅ Fewer decisions and a faster path to an implementable plan for this dashboard\n ✅ Targets the three areas where the plan is currently weakest\n ❌ Visual tokens, AI-slop risk and unresolved decisions go unreviewed\nNet: thoroughness versus a faster, narrower pass.": "All 7 dimensions (recommended)" + }, + "unansweredQuestionIndices": [], + "answeredAt": "2026-10-19T04:42:40.029Z" + } + }, + { + "preReview": true, + "observedAtMs": 105839, + "call": { + "sessionId": "07135ef6-a767-4590-93a6-fdeb2bfa7ed3", + "toolUseId": "toolu_011LXbhx85dhPoqJpWx5FzMe", + "questions": [ + { + "question": "D3 — Want outside design voices before the detailed review?\nProject/branch/task: main branch, User Dashboard plan, text-only review (designer has no API key).\nELI10: Before the 7 passes I can bring in two independent reviewers: Codex checks the plan against hard design rules and a litmus scorecard, and a fresh Claude subagent does a completeness read. That gives a second opinion on hierarchy and AI-slop risk.\nStakes if we pick wrong: Skipping means one reviewer's judgment; running costs a few minutes.\nRecommendation: A because with no mockups to anchor on, a cross-model check adds signal — this is a taste call, no strong preference either way.\nNote: options differ in kind, not coverage — no completeness score.\nPros / cons:\nA) Yes, run outside design voices (recommended)\n ✅ Codex hard-rule + litmus scorecard plus an independent Claude completeness read\n ✅ Disagreements surface with both perspectives in the relevant pass\n ❌ Adds a few minutes; Codex may be missing here, in which case only the Claude voice runs and it's tagged single-model\nB) No, proceed without\n ✅ Straight into the 7 passes with the plan text as anchor, since mockups were unavailable\n ✅ Fewest steps to a fixed plan\n ❌ Findings rest on one reviewer; no cross-model check on slop risk or hierarchy\nNet: a cross-model check versus speed.", + "header": "Voices", + "multiSelect": false, + "options": [ + { + "label": "Yes, run outside design voices (recommended)", + "description": "✅ Codex hard-rule + litmus scorecard plus an independent Claude completeness read. ✅ Disagreements surface with both perspectives in the relevant pass. ❌ Adds a few minutes; Codex may be missing here, in which case only the Claude voice runs and it's tagged single-model." + }, + { + "label": "No, proceed without", + "description": "✅ Straight into the 7 passes with the approved mockup as anchor. ✅ Fewest steps to a fixed plan. ❌ Findings rest on one reviewer; no cross-model check on slop risk or hierarchy." + } + ] + } + ], + "answered": true, + "failed": false, + "answers": { + "D3 — Want outside design voices before the detailed review?\nProject/branch/task: main branch, User Dashboard plan, text-only review (designer has no API key).\nELI10: Before the 7 passes I can bring in two independent reviewers: Codex checks the plan against hard design rules and a litmus scorecard, and a fresh Claude subagent does a completeness read. That gives a second opinion on hierarchy and AI-slop risk.\nStakes if we pick wrong: Skipping means one reviewer's judgment; running costs a few minutes.\nRecommendation: A because with no mockups to anchor on, a cross-model check adds signal — this is a taste call, no strong preference either way.\nNote: options differ in kind, not coverage — no completeness score.\nPros / cons:\nA) Yes, run outside design voices (recommended)\n ✅ Codex hard-rule + litmus scorecard plus an independent Claude completeness read\n ✅ Disagreements surface with both perspectives in the relevant pass\n ❌ Adds a few minutes; Codex may be missing here, in which case only the Claude voice runs and it's tagged single-model\nB) No, proceed without\n ✅ Straight into the 7 passes with the plan text as anchor, since mockups were unavailable\n ✅ Fewest steps to a fixed plan\n ❌ Findings rest on one reviewer; no cross-model check on slop risk or hierarchy\nNet: a cross-model check versus speed.": "No, proceed without" + }, + "unansweredQuestionIndices": [], + "answeredAt": "2026-10-19T04:43:20.787Z" + } + }, + { + "preReview": true, + "observedAtMs": 120288, + "call": { + "sessionId": "07135ef6-a767-4590-93a6-fdeb2bfa7ed3", + "toolUseId": "toolu_01DCMpa595puK3USZW3raRrC", + "questions": [ + { + "question": "D4 — Search learnings from your other projects too?\nProject/branch/task: main branch, User Dashboard design review.\nELI10: gstack can look for lessons it saved in your other local projects and apply them here. The data never leaves your machine. This project has no saved learnings yet.\nStakes if we pick wrong: Cross-project can carry one client's patterns into another; project-only misses useful past lessons.\nRecommendation: A because solo developers benefit from reused patterns and nothing leaves the machine.\nNote: options differ in kind, not coverage — no completeness score.\nPros / cons:\nA) Enable cross-project learnings (recommended)\n ✅ Past dashboard/modal pitfalls from other repos can show up in this review\n ✅ Stays fully local, one config flag you can flip back anytime\n ❌ Patterns from unrelated client codebases could bleed into this project's advice\nB) Keep learnings project-scoped only\n ✅ Strict separation between codebases, safest for client or agency work\n ✅ Advice is grounded only in this repo's own history\n ❌ This repo has zero learnings so far, so nothing gets reused today\nNet: reuse across projects versus strict isolation.", + "header": "Learnings", + "multiSelect": false, + "options": [ + { + "label": "Enable cross-project (recommended)", + "description": "Set cross_project_learnings true and search all local projects." + }, + { + "label": "Project-scoped only", + "description": "Set cross_project_learnings false." + } + ] + } + ], + "answered": true, + "failed": false, + "answers": { + "D4 — Search learnings from your other projects too?\nProject/branch/task: main branch, User Dashboard design review.\nELI10: gstack can look for lessons it saved in your other local projects and apply them here. The data never leaves your machine. This project has no saved learnings yet.\nStakes if we pick wrong: Cross-project can carry one client's patterns into another; project-only misses useful past lessons.\nRecommendation: A because solo developers benefit from reused patterns and nothing leaves the machine.\nNote: options differ in kind, not coverage — no completeness score.\nPros / cons:\nA) Enable cross-project learnings (recommended)\n ✅ Past dashboard/modal pitfalls from other repos can show up in this review\n ✅ Stays fully local, one config flag you can flip back anytime\n ❌ Patterns from unrelated client codebases could bleed into this project's advice\nB) Keep learnings project-scoped only\n ✅ Strict separation between codebases, safest for client or agency work\n ✅ Advice is grounded only in this repo's own history\n ❌ This repo has zero learnings so far, so nothing gets reused today\nNet: reuse across projects versus strict isolation.": "Enable cross-project (recommended)" + }, + "unansweredQuestionIndices": [], + "answeredAt": "2026-10-19T04:43:34.239Z" + } + }, + { + "preReview": false, + "observedAtMs": 144027, + "call": { + "sessionId": "07135ef6-a767-4590-93a6-fdeb2bfa7ed3", + "toolUseId": "toolu_01NJo4GTi8BhVcNScBYM8XK1", + "questions": [ + { + "question": "D5 — Issue 1: Dashboard hierarchy and layout per breakpoint\nProject/branch/task: main branch, User Dashboard plan, Pass 1 (Information Architecture).\nELI10: Users land here right after login, scan for a second, and either act or leave. The plan doesn't say which panel wins that second or how the three panels sit on phone versus desktop. Principle: every screen has a hierarchy; if everything competes, nothing wins.\nStakes if we pick wrong: Unread notifications get buried below a long activity feed, or the page ships as a generic 3-card grid.\nRecommendation: 1A because notifications are the only actionable content; quick actions are just two links and fit the page header without needing their own panel.\nCompleteness: 1A=9/10, 1B=8/10, 1C=4/10\nPros / cons:\nA) Action-first: header row + Notifications main, Activity rail (recommended)\n ✅ Page header: 'Dashboard' h1 with the two quick-action links at its right (wrapping below on mobile)\n ✅ lg: Notifications in a ~2/3 main column, Recent activity ~1/3 rail; md/sm: single column, Notifications then Activity\n ❌ Quick actions lose a standalone 'panel', so its empty/loading states mostly disappear (QuickActions is static config)\nB) Activity-first: Activity main column, Notifications right rail\n ✅ Reads like a timeline home, good if activity is what users came for\n ✅ Keeps the three components as separate panels exactly as named in the plan\n ❌ Unread notifications sit in a narrow rail and drop below the activity feed on mobile\nC) Equal three-panel grid, stacked on mobile\n ✅ Simplest Tailwind layout (grid-cols-1 md:grid-cols-3) with almost nothing to specify\n ✅ Each panel gets identical treatment, so there are fewer one-off styles\n ❌ Generic SaaS card mosaic with no lead content: an AI-slop hard-rejection pattern\nNet: actionable-first hierarchy versus a timeline-first or flat layout.", + "header": "Hierarchy", + "multiSelect": false, + "options": [ + { + "label": "1A Action-first (recommended)", + "description": "Header row with quick-action links; Notifications main column, Activity rail on lg; single column Notifications then Activity on sm/md." + }, + { + "label": "1B Activity-first", + "description": "Activity main column, Notifications right rail; mobile Activity then Notifications." + }, + { + "label": "1C Equal 3-panel grid", + "description": "Three equal panels on md+, stacked on mobile." + } + ] + } + ], + "answered": true, + "failed": false, + "answers": { + "D5 — Issue 1: Dashboard hierarchy and layout per breakpoint\nProject/branch/task: main branch, User Dashboard plan, Pass 1 (Information Architecture).\nELI10: Users land here right after login, scan for a second, and either act or leave. The plan doesn't say which panel wins that second or how the three panels sit on phone versus desktop. Principle: every screen has a hierarchy; if everything competes, nothing wins.\nStakes if we pick wrong: Unread notifications get buried below a long activity feed, or the page ships as a generic 3-card grid.\nRecommendation: 1A because notifications are the only actionable content; quick actions are just two links and fit the page header without needing their own panel.\nCompleteness: 1A=9/10, 1B=8/10, 1C=4/10\nPros / cons:\nA) Action-first: header row + Notifications main, Activity rail (recommended)\n ✅ Page header: 'Dashboard' h1 with the two quick-action links at its right (wrapping below on mobile)\n ✅ lg: Notifications in a ~2/3 main column, Recent activity ~1/3 rail; md/sm: single column, Notifications then Activity\n ❌ Quick actions lose a standalone 'panel', so its empty/loading states mostly disappear (QuickActions is static config)\nB) Activity-first: Activity main column, Notifications right rail\n ✅ Reads like a timeline home, good if activity is what users came for\n ✅ Keeps the three components as separate panels exactly as named in the plan\n ❌ Unread notifications sit in a narrow rail and drop below the activity feed on mobile\nC) Equal three-panel grid, stacked on mobile\n ✅ Simplest Tailwind layout (grid-cols-1 md:grid-cols-3) with almost nothing to specify\n ✅ Each panel gets identical treatment, so there are fewer one-off styles\n ❌ Generic SaaS card mosaic with no lead content: an AI-slop hard-rejection pattern\nNet: actionable-first hierarchy versus a timeline-first or flat layout.": "1A Action-first (recommended)" + }, + "unansweredQuestionIndices": [], + "answeredAt": "2026-10-19T04:43:54.256Z" + } + } + ] +} diff --git a/test/helpers/free-fixtures-data.ts b/test/helpers/free-fixtures-data.ts index 8833a0ab41..c420a5e136 100644 --- a/test/helpers/free-fixtures-data.ts +++ b/test/helpers/free-fixtures-data.ts @@ -74,6 +74,7 @@ export const FREE_FIXTURES: Readonly> = { 'test/fixtures/design-handoff-n-calls.json': ['test/design-completion-handoff-scored.test.ts'], 'test/fixtures/design-handoff-q-calls.json': ['test/design-completion-handoff-scored.test.ts'], 'test/fixtures/design-md-legacy.md': ['test/design-md.test.ts'], + 'test/fixtures/design-ui-focus-capture-39199692993.json': ['test/plan-design-with-ui-fixture.test.ts'], 'test/fixtures/design-ui-focus-capture.json': ['test/plan-design-with-ui-fixture.test.ts'], 'test/fixtures/detector-corpora/auto-decide-preserved/**': ['test/detector-corpus-auto-decide-preserved.test.ts'], 'test/fixtures/detector-corpora/plan-ceo-section-loading/**': ['test/detector-corpus-plan-ceo-section-loading.test.ts'], diff --git a/test/plan-design-with-ui-fixture.test.ts b/test/plan-design-with-ui-fixture.test.ts index 6334dd5cdd..cb54f207c1 100644 --- a/test/plan-design-with-ui-fixture.test.ts +++ b/test/plan-design-with-ui-fixture.test.ts @@ -80,6 +80,9 @@ nativeFinding.nativeCall.questions[0].options = [ // whose comma-less Step 0D title the focus predicate once rejected. const captured = JSON.parse(fs.readFileSync(${JSON.stringify(path.join(ROOT, 'test/fixtures/design-ui-focus-capture.json'))}, 'utf8')) .calls.map(({ preReview, observedAtMs, call }) => nativePlanCallFingerprint(call, observedAtMs, preReview)); +// Run 39199692993 slice 4 (521fd755): the Step 0D title omitted 'design'; its body carried the rating. +const capturedRated = JSON.parse(fs.readFileSync(${JSON.stringify(path.join(ROOT, 'test/fixtures/design-ui-focus-capture-39199692993.json'))}, 'utf8')) + .calls.map(({ preReview, observedAtMs, call }) => nativePlanCallFingerprint(call, observedAtMs, preReview)); const unnumberedFinding = fp('unnumbered-finding', "Which region is the dashboard's primary anchor, and how is the page composed?", false); unnumberedFinding.nativeCall.questions[0].options = nativeFinding.nativeCall.questions[0].options; const finding = fp('finding', 'Which loading feedback should Save show?', false); @@ -130,6 +133,13 @@ mock.module(${JSON.stringify(path.join(ROOT, 'test/helpers/claude-pty-runner.ts' expect(opts.isLastStep0AUQ(fp('focus-ones', 'D1 — Review all 7 design dimensions, or focus on specific ones?'))).toBe(true); if (mode.startsWith('native-')) expect(opts.isLastStep0AUQ(nativeFocus)).toBe(true); expect(opts.isLastStep0AUQ(captured[1])).toBe(true); + expect(opts.isLastStep0AUQ(capturedRated[1])).toBe(true); + for (const unrated of ['D2 — Review focus: all 7 dimensions or specific areas?\\nELI10: I will review every dimension unless you narrow the focus.', + 'D3 — Want outside design voices before the detailed review?\\nELI10: I rated this plan 5/10 on design completeness.', + 'D1 — Which file should I review against the design system?\\nELI10: I rated this plan 5/10 on design completeness.', + 'D2 — Review focus: all 7 dimensions or specific areas?\\nELI10: I rated this plan 5/7 on design completeness.']) { + expect(opts.isLastStep0AUQ(fp('unrated', unrated))).toBe(false); + } // Run on b2f729b slice 5: the rating sentence led the title and 'design' named only the completeness. expect(opts.isLastStep0AUQ(fp('focus-rated', "D2 — I've rated this plan 5/10 on design completeness. Review all 7 dimensions, or focus on specific areas?\\nProject/branch/task: main."))).toBe(true); // Run 37166586458 slice 5 (dfaf154): the Step 0D title spelled the count as a word. @@ -209,6 +219,8 @@ mock.module(${JSON.stringify(path.join(ROOT, 'test/helpers/claude-pty-runner.ts' fs.writeFileSync(${JSON.stringify(facts)}, JSON.stringify({ calls, cwd: cwd, seeded: true })); if (mode === 'throw') throw new Error('controlled UI observation failure'); const observed = mode === 'captured' ? captured + : mode === 'captured-rated' ? capturedRated + : mode === 'captured-rated-no-focus' ? capturedRated.filter((_, index) => index !== 1) : mode === 'captured-no-focus' ? captured.filter((_, index) => index !== 1) : mode === 'captured-focus-after-finding' ? [...captured.filter((_, index) => index !== 1), captured[1]] : mode.startsWith('target-menu') ? [target, fp('other', 'Which artifact should I inspect?', false)] @@ -254,12 +266,12 @@ await import(${JSON.stringify(path.join(ROOT, 'test/skill-e2e-plan-design-with-u } finally { fs.rmSync(directory, { recursive: true, force: true }); } } -test.each(['source', 'paraphrase', 'native-sequence', 'native-unnumbered', 'native-passes', 'captured'])('UI gate seeds the exact target and accepts Design progress with an unselected no-UI alternative (%s)', mode => { +test.each(['source', 'paraphrase', 'native-sequence', 'native-unnumbered', 'native-passes', 'captured', 'captured-rated'])('UI gate seeds the exact target and accepts Design progress with an unselected no-UI alternative (%s)', mode => { const result = exercise(mode); expect(result.code, result.output).toBe(0); }, 20_000); -test.each(['target-menu', 'target-menu-design-system', 'focus-only', 'captured-no-focus', 'captured-focus-after-finding', 'native-setup-only', 'native-voices-only', 'early-exit', 'timeout', 'exited', 'unanswered-finding', 'failed-finding', 'no-native-finding'])('UI gate rejects %s and removes its fixture', mode => { +test.each(['target-menu', 'target-menu-design-system', 'focus-only', 'captured-no-focus', 'captured-focus-after-finding', 'captured-rated-no-focus', 'native-setup-only', 'native-voices-only', 'early-exit', 'timeout', 'exited', 'unanswered-finding', 'failed-finding', 'no-native-finding'])('UI gate rejects %s and removes its fixture', mode => { const result = exercise(mode); expect(result.code, result.output).toBe(1); expect(result.output).toContain('plan-design-review with UI scope FAILED'); diff --git a/test/skill-e2e-plan-design-with-ui.test.ts b/test/skill-e2e-plan-design-with-ui.test.ts index 3ecd183985..5d262e342e 100644 --- a/test/skill-e2e-plan-design-with-ui.test.ts +++ b/test/skill-e2e-plan-design-with-ui.test.ts @@ -29,11 +29,13 @@ const designFocusBoundary = (fp: AskUserQuestionFingerprint): boolean => // A target menu can mention a design system without reviewing this plan. // The source Step 0D question, or a native title (first line) that offers all // seven design dimensions/passes versus a focus, in any order or wording. The - // count may be a numeral or a word; the title must name design. + // count may be a numeral or a word; the title must name design, unless the + // body carries the step's own design-completeness rating (run 39199692993). const title = text.split(/\r?\n/, 1)[0]!; + const rated = /\bI(?:['’]ve| have)? rated this plan (?:10(?:\.0+)?|[0-9](?:\.\d+)?)\/10 on design completeness\b/i; return /^I(?:['’]ve| have) rated this plan (?:10(?:\.0+)?|[0-9](?:\.\d+)?)\/10 on design completeness\.[\s\S]*\bWant me to focus on specific areas instead of all (?:7|seven)\?/i.test(text) || (/\ball (?:7|seven) (?:design )?(?:dimensions|passes)\b/i.test(title) && /\bfocus\b/i.test(title) - && /\bdesign\b/i.test(title) && /\?\s*$/.test(title)); + && (/\bdesign\b/i.test(title) || rated.test(text.slice(title.length))) && /\?\s*$/.test(title)); }); // Require a choice about the supplied UI, not a workflow offer after focus.