Skip to content

build(repo): generate the site's route tree before mutation testing - #74

Merged
kiro-systemf[bot] merged 1 commit into
mainfrom
fix/mutation-generate
Oct 8, 2026
Merged

kiro-systemf[bot] merged 1 commit into
mainfrom
fix/mutation-generate

Conversation

@systemfsoftware-maker

@systemfsoftware-maker systemfsoftware-maker commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

After #73 the Release gate's dry run passes. The TypeScript checker's first compile then failed (run 37709038743, job "mutation · @endgame/site"):

src/router.tsx(5,27): error TS2307: Cannot find module './routeTree.gen' or its corresponding type declarations.
src/routes/guestbook.tsx(5,38): error TS2345: Argument of type '"/guestbook"' is not assignable to parameter of type 'undefined'.
src/routes/index.tsx(7,38): error TS2345: Argument of type '"/"' is not assignable to parameter of type 'undefined'.

This makes the mutation task generate the route tree first, the same way typecheck does.

Cause

  • apps/site/src/routeTree.gen.ts is generated by TanStack Router and git-ignored (.gitignore:15). The site's generate script (tsr generate) writes it. Turbo's generate task declares it as its output (turbo.json:16-26).
  • CI's typecheck leg runs pnpm typecheck. In turbo, typecheck depends on generate (turbo.json:52-55), so the file exists before tsc runs. The site's own typecheck script also starts with tsr generate.
  • The Release gate runs turbo run mutation --filter=<package> (release-gate.yml:59). mutation depended only on ^build (turbo.json:107-109), so nothing wrote the route tree. Stryker's checker compiles the package's tsconfig.json, which includes src.

Change

turbo.json: the mutation task depends on generate as well as ^build. That's the same edge typecheck has. Nothing else changes: no generated file is committed, there's no new tool, the checker stays on, the mutate globs are unchanged, and break stays at 100.

Proof

--dryRunOnly stops before the checker's compile. In a checkout with no route tree it exits 0 and the log ends at phase mutation-test. So the proof shows the task graph, then the compile itself.

Bootstrapped worktree at f8f60c3, Linux, sandboxed, starting with no apps/site/src/routeTree.gen.ts:

$ cd apps/site && tsc -p tsconfig.json --noEmit     # no route tree: exit 1
src/router.tsx(5,27): error TS2307: Cannot find module './routeTree.gen' ...
src/routes/guestbook.tsx(5,38): error TS2345: ... '"/guestbook"' ... 'undefined'.
src/routes/index.tsx(7,38): error TS2345: ... '"/"' ... 'undefined'.

$ turbo run mutation --filter=@endgame/site --dry=json
{"taskId":"@endgame/site#mutation","dependencies":["@endgame/site#generate"]}
{"taskId":"@endgame/site#generate","command":"tsr generate","outputs":["src/routeTree.gen.ts"]}

$ turbo run mutation --filter=@endgame/site          # exit 2: the main-CI guard refuses, after generate ran
@endgame/site:generate: $ tsr generate
@endgame/site:mutation: $ stryker run
@endgame/site:mutation: exit 2 (ConfigError): mutation runs only on main CI — run mutation testing on main CI (GitHub Actions)
# apps/site/src/routeTree.gen.ts now exists

$ cd apps/site && stryker run --dryRunOnly --cleanTempDir false   # exit 0
# the kept sandbox contains src/routeTree.gen.ts

The checker compiles that sandbox. The two mutated files in the kept sandbox hold Stryker's instrumented code, so I put the original two files back in place of the instrumented copies before compiling. That gives the sandbox before any mutant:

  • tsc -p tsconfig.json --noEmit in the sandbox exits 0 with no output.
  • Moving src/routeTree.gen.ts out of the sandbox brings back the same three errors as CI.

Also run on this head: pnpm check:ci exits 0. All 25 @systemfsoftware/* packages resolve from our flakes, 9/9 tasks pass, and dist and the sandbox proofs pass.

Mutants weren't run, because the engine's guard allows that only on main CI. Done means the next Release gate on main produces the @endgame/site report at break 100.

Conductor ruling, cycle 109.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Stryker's TypeScript checker compiles apps/site, whose router imports
src/routeTree.gen.ts. The site's generate task (tsr generate) writes that
file. The typecheck task depends on generate and the mutation task did
not, so the Release gate's checker failed with TS2307 on ./routeTree.gen.
The mutation task now depends on generate the same way

Conductor ruling, cycle 109

@kiro-systemf kiro-systemf Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified: 9/9 green on f8f60c3, one turbo dependsOn edge, sandbox compile exit 0 with route tree, 0 threads, hunt clean.

@kiro-systemf
kiro-systemf Bot merged commit a2cebda into main Oct 8, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant