[E00-S01-T12] Root commands exist for build/test/typecheck #379

Merged
kpcto merged 1 commits from feature/165 into main 2026-08-28 23:01:51 +00:00
Member

What changed

Locks in the [E00-S01-T12] root build/test/typecheck commands (#165). The root scripts were bootstrap-committed in E00-S01-T05 (0d1bd19); this PR adds the regression suite that makes the acceptance criteria enforceable rather than incidental:

  • tests/root-commands.test.mjs (new) — a node:test suite (zero dependencies, lockfile untouched) that fails if any root command is ever removed or drifts:
    • asserts the root package.json declares scripts.build (pnpm -r run build), scripts.test (node --test "tests/**/*.test.mjs"), and scripts.typecheck (pnpm -r run typecheck) exactly;
    • then invokes each root command at the workspace root and asserts exit 0: pnpm run build compiles every workspace package, pnpm run typecheck type-checks every package, and pnpm run test runs the whole node --test suite — the "invoke each root command and confirm it runs" test-plan step.
    • the test-command probe passes EPPP_ROOT_COMMANDS_SKIP_INVOKE=1 to the nested run so the suite (which is itself part of tests/**/*.test.mjs) does not re-invoke pnpm run test endlessly; nested runs skip the invocation probes while the outer probe still proves the command exits 0.

Explicitly out of scope per the brief (not touched): apps/packages/extensions separation (E00-S01-T11), frozen lockfile clean install (E00-S01-T13), no core imports a concrete extension (E00-S01-T14). No CI workflow changes — test-suite wiring in CI is E00-S05 by design (same as T05–T11); the existing CI job (frozen install + pnpm -r list on Node 24) stays green.

Criterion → test table

Acceptance criterion Test (fails without the committed config)
a root build command exists tests/root-commands.test.mjs: "a root build command exists in package.json" — asserts scripts.build is exactly pnpm -r run build. Mutation-probed: deleting scripts.build fails this test (and the invocation probe)
a root test command exists tests/root-commands.test.mjs: "a root test command exists in package.json" — asserts scripts.test is exactly node --test "tests/**/*.test.mjs". Mutation-probed: changing it to node --test fails this test
a root typecheck command exists tests/root-commands.test.mjs: "a root typecheck command exists in package.json" — asserts scripts.typecheck is exactly pnpm -r run typecheck
invoke each root command and confirm it runs tests/root-commands.test.mjs: "the root build command runs successfully (pnpm run build)", "the root typecheck command runs successfully (pnpm run typecheck)", "the root test command runs successfully (pnpm run test)" — each spawns the root command via the pinned pnpm (corepack) and asserts exit 0; the test probe runs the whole node --test suite with a recursion guard

Test plan executed

  • Clean-state install from the branch (no node_modules), Node 24 (v24.20.0): pnpm install --frozen-lockfile via corepack → success, using pnpm v11.23.0, lockfile unchanged ✓
  • pnpm -r list --depth -1 (second CI step), Node 24 → lists all four workspace projects, exit 0 ✓
  • node --test tests/root-commands.test.mjs → 6/6 pass ✓
  • Full suite node --test "tests/**/*.test.mjs" on Node 24 (v24.20.0) → 42/42 pass (10 architecture-import + 6 workspace-config + 5 node-engine + 3 typescript-pin + 4 strict-tsconfig + 8 workspace-layout + 6 root-commands), exit 0 ✓
  • Recursion guard probe: EPPP_ROOT_COMMANDS_SKIP_INVOKE=1 node --test tests/root-commands.test.mjs → 3 pass, 3 skipped (invocation probes), no recursion ✓
  • Mutation probes: deleting scripts.build fails "a root build command exists in package.json" + the build invocation probe; changing scripts.test fails "a root test command exists in package.json"; restoring the scripts returns to 42/42 ✓

Risks / notes

  • The suite pins the exact root script strings; a deliberate change to a root command must update this suite in the same change (the repo's established lock-in convention).
  • The test-command probe needs pnpm resolvable (corepack enabled / node_modules present), i.e. the documented developer/CI path.

Refs #165

## What changed Locks in the [E00-S01-T12] root build/test/typecheck commands (#165). The root scripts were bootstrap-committed in E00-S01-T05 (`0d1bd19`); this PR adds the regression suite that makes the acceptance criteria **enforceable** rather than incidental: - **`tests/root-commands.test.mjs`** (new) — a `node:test` suite (zero dependencies, lockfile untouched) that fails if any root command is ever removed or drifts: - asserts the root `package.json` declares `scripts.build` (`pnpm -r run build`), `scripts.test` (`node --test "tests/**/*.test.mjs"`), and `scripts.typecheck` (`pnpm -r run typecheck`) exactly; - then **invokes each root command** at the workspace root and asserts exit 0: `pnpm run build` compiles every workspace package, `pnpm run typecheck` type-checks every package, and `pnpm run test` runs the whole `node --test` suite — the "invoke each root command and confirm it runs" test-plan step. - the test-command probe passes `EPPP_ROOT_COMMANDS_SKIP_INVOKE=1` to the nested run so the suite (which is itself part of `tests/**/*.test.mjs`) does not re-invoke `pnpm run test` endlessly; nested runs skip the invocation probes while the outer probe still proves the command exits 0. Explicitly out of scope per the brief (not touched): apps/packages/extensions separation (E00-S01-T11), frozen lockfile clean install (E00-S01-T13), no core imports a concrete extension (E00-S01-T14). No CI workflow changes — test-suite wiring in CI is E00-S05 by design (same as T05–T11); the existing CI job (frozen install + `pnpm -r list` on Node 24) stays green. ## Criterion → test table | Acceptance criterion | Test (fails without the committed config) | | --- | --- | | a root build command exists | `tests/root-commands.test.mjs`: "a root build command exists in package.json" — asserts `scripts.build` is exactly `pnpm -r run build`. Mutation-probed: deleting `scripts.build` fails this test (and the invocation probe) | | a root test command exists | `tests/root-commands.test.mjs`: "a root test command exists in package.json" — asserts `scripts.test` is exactly `node --test "tests/**/*.test.mjs"`. Mutation-probed: changing it to `node --test` fails this test | | a root typecheck command exists | `tests/root-commands.test.mjs`: "a root typecheck command exists in package.json" — asserts `scripts.typecheck` is exactly `pnpm -r run typecheck` | | invoke each root command and confirm it runs | `tests/root-commands.test.mjs`: "the root build command runs successfully (pnpm run build)", "the root typecheck command runs successfully (pnpm run typecheck)", "the root test command runs successfully (pnpm run test)" — each spawns the root command via the pinned pnpm (corepack) and asserts exit 0; the test probe runs the whole `node --test` suite with a recursion guard | ## Test plan executed - Clean-state install from the branch (no `node_modules`), Node 24 (v24.20.0): `pnpm install --frozen-lockfile` via corepack → success, `using pnpm v11.23.0`, lockfile **unchanged** ✓ - `pnpm -r list --depth -1` (second CI step), Node 24 → lists all four workspace projects, exit 0 ✓ - `node --test tests/root-commands.test.mjs` → **6/6 pass** ✓ - Full suite `node --test "tests/**/*.test.mjs"` on Node 24 (v24.20.0) → **42/42 pass** (10 architecture-import + 6 workspace-config + 5 node-engine + 3 typescript-pin + 4 strict-tsconfig + 8 workspace-layout + 6 root-commands), exit 0 ✓ - Recursion guard probe: `EPPP_ROOT_COMMANDS_SKIP_INVOKE=1 node --test tests/root-commands.test.mjs` → 3 pass, 3 skipped (invocation probes), no recursion ✓ - Mutation probes: deleting `scripts.build` fails "a root build command exists in package.json" + the build invocation probe; changing `scripts.test` fails "a root test command exists in package.json"; restoring the scripts returns to 42/42 ✓ ## Risks / notes - The suite pins the exact root script strings; a deliberate change to a root command must update this suite in the same change (the repo's established lock-in convention). - The test-command probe needs `pnpm` resolvable (corepack enabled / `node_modules` present), i.e. the documented developer/CI path. Refs #165
bot-implementer added 1 commit 2026-08-28 22:56:59 +00:00
test: lock in root build/test/typecheck commands (E00-S01-T12)
CI / Frozen lockfile install (pull_request) Successful in 44s
5c6ca444d9
kpcto merged commit c8693fe0b7 into main 2026-08-28 23:01:51 +00:00
kpcto deleted branch feature/165 2026-08-28 23:01:51 +00:00
Sign in to join this conversation.