Problem
tests/init-e2e-flags.test.ts:105 uses existsSync(CLI_PATH) to gate the e2e test suite, which checks whether dist/cli.js exists, not whether it is fresh. A dist/cli.js built from any prior commit satisfies the gate, so running npx vitest without npm run build:cli first silently exercises stale code while tests report green.
Current Status
Suggested Sequencing
Fixing this changes the suite-wide build-freshness contract — scoped outside PR #316's blast radius. Suggested approaches:
- Replace existence check with freshness check (
mtime(dist/cli.js) > mtime(newest src/**/*.ts))
- Have e2e suite build into a temp dir itself (ensures freshness by construction)
Acceptance Criteria
Related
Problem
tests/init-e2e-flags.test.ts:105usesexistsSync(CLI_PATH)to gate the e2e test suite, which checks whetherdist/cli.jsexists, not whether it is fresh. Adist/cli.jsbuilt from any prior commit satisfies the gate, so runningnpx vitestwithoutnpm run build:clifirst silently exercises stale code while tests report green.Current Status
Suggested Sequencing
Fixing this changes the suite-wide build-freshness contract — scoped outside PR #316's blast radius. Suggested approaches:
mtime(dist/cli.js) > mtime(newest src/**/*.ts))Acceptance Criteria
npx vitestwithout priornpm run build:clieither fails or rebuilds automaticallyRelated