Skip to content

Software factory: validator runs that check zero files no longer pass#5199

Merged
jurgenwerk merged 2 commits into
mainfrom
cs-11426-improve-flow-green-baseline-gate-must-reject-vacuous
Jun 15, 2026
Merged

Software factory: validator runs that check zero files no longer pass#5199
jurgenwerk merged 2 commits into
mainfrom
cs-11426-improve-flow-green-baseline-gate-must-reject-vacuous

Conversation

@jurgenwerk

@jurgenwerk jurgenwerk commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Fixes CS-11426.

A validator that says "pass" should mean "I looked at your code and it's fine." Before this fix, it could also mean "I found no code to look at" — and it said "pass" either way. So the agent would ask "is everything OK?" before its files had actually arrived on the realm, get a "pass" that checked nothing, and move on believing its work was verified when nothing was. Now that situation returns an error saying "there was nothing to check — re-run," instead of a fake green light.

Both footguns were observed in real adjust-flow runs: the first baseline run_parse returned {status: "passed", filesChecked: 0} because it ran before the seeded files reached the realm, and a single-file run_parse on a component false-failed with cross-file resolution errors a whole-realm run contradicted.

What

Vacuous passes are now errors (tool layer). A whole-realm run_parse / run_lint / run_evaluate / run_instantiate / run_tests that passed while checking zero files / modules / instances / tests is rewritten to status: "error" with a message telling the agent to re-run once the realm contains the files. Until now the zero-coverage rule existed only as instruction text ("a zero-test run counts as failed") with no enforcement anywhere. Single-file runs are exempt — an explicit path either resolves to one checked file or errors on its own.

run_parse and run_lint now sync the workspace first, exactly like the other three validators already did. Their engines read realm files, so an unsynced workspace was invisible to them — that's the precise mechanism behind the observed filesChecked: 0 false green. With all five syncing, the seed sequence (copy → sync → validate) is enforced mechanically rather than by prose.

Scope choice: the rewrite lives in the agent-facing tool wrappers, not the shared engines. The validation pipeline's step semantics ("no files returns passed", asserted by name in the step tests) are unchanged — bootstrap issues use the no-op validator and implementation issues always have files by validation time.

Docs: the bootstrap-seed adjust instructions and the orchestrator operations skill state both behaviors, and the skill now documents the single-file run_parse footgun (per the ticket's option b): files importing same-realm siblings can false-fail in isolation; whole-realm parse is the source of truth.

Verification

  • 8 new unit tests (vacuous rewrite per tool, single-file exemption, pass-through of real coverage and of genuine errors, sync-before-engine ordering, sync-failure surfacing); factory-tool-builder.test.ts 44/44 green.
  • validation-pipeline.test.ts, issue-loop.test.ts, factory-brief.test.ts all green locally; ember-tsc, eslint, prettier clean.

🤖 Generated with Claude Code

…run_lint

The agent-facing run_* tools could report green without checking
anything: a whole-realm run that discovered zero files, modules,
instances, or tests returned status 'passed'. In the adjust flow's
green-baseline gate this produced a false green when the first
run_parse fired before the seeded files reached the realm. The
zero-coverage trap was instruction text only ('a zero-test run counts
as failed') with no enforcement anywhere.

Two mechanical fixes in the tool layer (factory-tool-builder):

- run_parse and run_lint now sync the workspace to the realm before
  running, like run_tests / run_evaluate / run_instantiate already
  did — the engines read realm files, so unsynced workspaces were
  invisible to them.
- A whole-realm result that passed while checking zero
  files/modules/instances/tests is rewritten to status 'error' with a
  message telling the agent to re-run after the realm contains the
  files. Single-file runs are exempt (an explicit path either resolves
  or errors on its own). The validation pipeline's step semantics are
  unchanged — bootstrap issues use the no-op validator and
  implementation issues always have files by validation time.

The bootstrap-seed adjust instructions and the orchestrator operations
skill now state both behaviors, and the skill documents the
single-file run_parse footgun: a file importing same-realm siblings
can report cross-file resolution errors a whole-realm run does not,
so whole-realm parse is the source of truth.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@jurgenwerk jurgenwerk changed the title Software factory: reject vacuous zero-coverage validator passes + sync before run_parse/run_lint Software factory: validators sync the workspace first and fail when they find nothing to check Jun 11, 2026
@jurgenwerk jurgenwerk changed the title Software factory: validators sync the workspace first and fail when they find nothing to check Software factory: stop validators passing on an empty realm Jun 11, 2026
@jurgenwerk
jurgenwerk requested a review from Copilot June 11, 2026 13:00
@jurgenwerk jurgenwerk changed the title Software factory: stop validators passing on an empty realm Software factory: validator runs that check zero files no longer pass Jun 11, 2026

Copilot AI 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.

Pull request overview

This PR strengthens Software Factory validator semantics so that a “passed” validation result always implies real work was performed, preventing false-green baseline gates when the realm/workspace isn’t yet populated or indexed.

Changes:

  • Rewrite whole-realm run_* results from passederror when they report zero checked files/modules/instances/tests (single-file path runs are exempt).
  • Add workspace sync-before-run for run_parse and run_lint (bringing them in line with the other validators).
  • Update adjust-flow seed instructions + orchestrator operations skill docs, and add unit tests covering the new behaviors.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
packages/software-factory/src/factory-tool-builder.ts Adds vacuous-pass rewriting to error results; adds sync-before-run for run_parse and run_lint; updates tool descriptions accordingly.
packages/software-factory/tests/factory-tool-builder.test.ts Adds unit tests for vacuous-pass rewriting and sync-before-engine ordering/failure surfacing.
packages/software-factory/src/factory-seed.ts Updates adjust-seed instructions to reflect sync + zero-coverage-is-error behavior.
packages/software-factory/.agents/skills-orchestrator/software-factory-operations/SKILL.md Updates ops skill docs to reflect validator sync behavior and zero-coverage semantics; documents the single-file run_parse caveat.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/software-factory/src/factory-tool-builder.ts
Comment thread packages/software-factory/tests/factory-tool-builder.test.ts
…ll path-taking tools

The vacuous-pass message no longer tells the agent to sync (the tool
already did) and names the validated unit instead of always saying
'file'. The single-file exemption now has explicit tests for run_lint,
run_evaluate, and run_instantiate alongside the existing run_parse one.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@jurgenwerk
jurgenwerk marked this pull request as ready for review June 12, 2026 09:09
@jurgenwerk
jurgenwerk requested a review from a team June 12, 2026 09:09
@jurgenwerk
jurgenwerk merged commit ccb0b2e into main Jun 15, 2026
27 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.

3 participants