fix(check-affected): run the unit suite for every production source change

TH
39m ago
+100-40

Summary

#3995 passed pnpm check:affected --run --head and then failed eager-closure-budgets in CI Coverage. vitest related follows imports, but that gate reads sources as text, so related never selects it. The runner also dropped unit whenever vitest-related ran, even for fail-open plans. Most source paths (src/, packages/daemon, packages/selectors) never selected unit at all. Other unit-core tests have the same blind spot, for example cli-startup-import-closure.test.ts, so a hand list or a location-based set would miss some.

  • A production change under src/ or packages/*/src now selects unit (own:unit-text-gates).
  • unit never defers to the related run. A fail-open plan runs every local check. provider-integration still defers on a narrowed plan.
  • Test-only changes are unchanged.

Cost: about 3 min per source-changing run (check:unit: 165 s vitest plus smoke).

Validation

  • pnpm check:affected --run --head 919d757732: 42 checks passed, exactCommit=true, including unit and provider-integration.
  • check:affected:test: 86 pass. Restoring the unit skip, the fail-open skip, or the model rule each fails the new tests.
  • End to end: a committed plant that added one module to the platform-apple runner closure passed vitest-related. unit then failed it on eager-closure-budgets (exactCommit=true). The plant was dropped.
  • Docs delta 919d757732..02d0e69d4b: agent-guidance passed (exactCommit=true).
  • Not device-facing.

🤖 Generated with Claude Code