QM-56: Hand the test-economy rules to every prompt that can write tests - #1433
Merged
Merged
Conversation
pcapriolo-yc
added a commit
that referenced
this pull request
Sep 19, 2026
* Ship the factory wrapper inside this repository The software factory's instruction book (the sandbox wrapper, the three work-ticket workflows, their prompts and skill, and the tools scripts) moves from the private deployment repository into factory/. The loop's work stage now fetches this repository at the commit the running core was built from (GIT_SHA) into /workspace/qm-source and starts factory/.claude/io-coding-agent-js.sh from it, so the wrapper and the loop always come from the same commit. A core with no full build sha fetches main. Cold and warm sandboxes share one fetch-then-checkout script. Nothing specific to the monorepo the factory was carved out of remains: the Rails app table and stack start path, the proof icon fonts, the X-Current-User proof auth, the hard-coded publish project and GitLab bot user ids, and the IO- ticket prefix in the linkback scan are gone or configuration-driven. Browser proof runs only against a configured stack (IO_PROOF_START_CMD / IO_PROOF_BASE_URL_CMD) and says so honestly otherwise. factory/ is excluded from eslint, knip, and prettier: the workflows run inside the Claude Workflow sandbox with its globals and are kept byte-stable. test/factory-layout.test.ts pins the file inventory, executable bits, shell syntax, the wrapper handshake, the tool preflight, and the absence of every monorepo literal. * Classify factory/ as implementation when no source dirs are configured The mutation gate and the source helper fall back to a built-in directory list when IO_SOURCE_APP_DIRS is unset. That list predates factory/, so a change to the wrapper was unclassifiable and the gate failed closed. The first factory-on-factory run found this and ledgered it. * QM-56: Hand the test-economy rules to every prompt that can write tests (#1433) Co-authored-by: Sprite <noreply@sprites.dev> --------- Co-authored-by: Sprite <noreply@sprites.dev>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes QM-56.
Changes
Why this matters: The factory's test-economy rules (fewer, better tests; the smallest test that proves the change) only reached the
add-testsagent and the mutation-gate repair agent. But the agent that writes a run's code —implementon a normal pass,feedback-reviseon a feedback re-run — usually writes the tests too, and it received no economy constraint at all. By the time the rules arrived, the bloat was already in the tree, and every later pass is additive rather than pruning. On QM-42 a feedback re-run produced 17 tests and 483 lines in a single file, including a 124-line fixture, before any agent had seen the rules.What changes:
feedback-reviseandimplementagent prompts now carryTEST_QUALITY_RULESandTEST_HOWTO, so every agent that can write tests is held to the same standard before it writes anything.implementprompt and the rules sit outside the kickback branch.test/factory-layout.test.tsfails, naming the offending prompt, iffeedback-revise,implement, oradd-testsever stops interpolating the rules.Acceptance stories:
feedback-reviseagent used to get no test-economy rules; it now gets them before it writes its first test.implementagent gets the same rules on both branches, where before it got none on either.add-testsand mutation-gate repair agents keep the rules they already had, and the proof agent is untouched.Test Plan
NODE_ENV=test ALLOW_UNSIGNED_TEST_IDENTITY=1 node --experimental-test-module-mocks --test test/factory-layout.test.tsnpm run typecheck && npm run lintProof it works
The new guard passes on this branch and fails with the offending label named when either insertion is reverted, so the rules are provably delivered to both newly covered agents. This change alters only the prompt text handed to background agents, so it has no visible surface and produced no screenshots or recordings.