Fix per-surface test command priority
Per-surface test commands in `createAnaJson` use direct runner invocation (`pnpm vitest run`) instead of the developer's actual test script (`pnpm run test`). This skips setup steps like `prisma:generate`, `dotenv`, `cross-env`, and build prerequisites. R3 pre-launch testing found 12 of 29 surfaces (41%) across 17 real repos produce mismatched commands; 8 would cause test failures on the first pipeline run. The fix: invert the priority so script passthrough comes first, with direct invocation as fallback for surfaces that lack a test script.
verdict PASSscore 10 / 10findings 6 (1 risk · 1 debt · 4 obs)duration 38mrejection cycles 0shipped May 21, 2026surface cli
Pipeline timeline
Intent to proven code in 38m across Think, Plan, Build, and Verify.
Think7m
Plan3m
Build6m
Verify4m
Assertion ledger
10 claims, each independently verified. Showing 8 — show all →
| ID | Says | Matcher | |
|---|---|---|---|
| A001 | Surfaces with a test script use the developer's script instead of a direct runner command | verified | ok |
| A002 | Complex test scripts with setup steps are preserved, not overridden | verified | ok |
| A003 | Surfaces without a test script fall back to direct framework invocation | verified | ok |
| A004 | Surfaces with neither test script nor detected framework get no test command | verified | ok |
| A005 | Bun workspaces use the correct bun run prefix for script passthrough | verified | ok |
| A006 | An empty test script is treated as present and uses script passthrough | verified | ok |
| A007 | Root-level test commands are not affected by this change | verified | ok |
| A008 | Build commands still use script passthrough as before | verified | ok |
Findings 6 total
obspackages/cli/src/commands/init/state.ts→ monitor
scripts['test'] !== undefined treats explicit null value as 'present' — a package.json with test: null would get script passthrough producing a broken pnpm run test
obspackages/cli/tests/commands/init/makeTestCommand.test.ts→ closed
File not in contract file_changes was modified — makeTestCommand.test.ts assertions updated to match new behavior
riskpackages/cli/src/commands/init/state.ts→ closed
surface.path injected into shell command without sanitization — paths with spaces or special chars produce broken subshell
debtpackages/cli/tests/commands/init/monorepoCommandScoping.test.ts→ closed
A006 empty-string assertion uses toContain('run test') — weaker than other assertions that use toBe for exact match
obspackages/cli/tests/commands/init/monorepoCommandScoping.test.ts→ monitor
Repeated tmpDir/cwdDir setup+teardown boilerplate in all 4 new tests — follows existing pattern but adds to known tech debt
+1more findings
Integrity seal
scopesha256:598fb8b9d551f...
contractsha256:de80e2fcca47e...
plansha256:015b79fab2abc...
specsha256:8f16d434919f2...
build-reportsha256:2a965d663ea8a...
build-datasha256:87c1adaf9a56f...
verify-reportsha256:1f952e7744374...
verify-datasha256:ee7e927c99347...
audit cmd$ ana proof audit fix-surface-test-priority → all hashes match