fix(test): give the dispatcher suite a project root that exists - #70216
Open
drussell23 wants to merge 1 commit into
Open
fix(test): give the dispatcher suite a project root that exists#70216drussell23 wants to merge 1 commit into
drussell23 wants to merge 1 commit into
Conversation
`project_root` was hardcoded to Path('/tmp/test-project-6b') — a directory
nothing creates. Every op failed GENERATE with `target_file_missing:
backend/core/utils.py` and never reached the GATE / APPROVE / APPLY terminals
these tests assert on.
It went unnoticed because the CancelToken fake (fixed in #70215) short-circuited
each op to POSTMORTEM before GENERATE ran. One dead fake concealing another;
repairing the first is what made this one visible.
Now materialised per-test from `tmp_path`, with the target file actually
written — real parseable content, since VALIDATE runs an AST pass and an empty
placeholder would only trade target_file_missing for a SyntaxError. `tmp_path`
rather than a fixed directory because a shared /tmp path is order-dependent
state between sessions, and this repo's node policy makes /tmp unwritable
outright.
The target path is now ONE constant instead of two literals that had to agree
with a third value (the root) for the suite to work at all — a disagreement
between them is not diagnosable by reading any one of them.
Progress: test_artifact_generation_threads_classify_to_validate now passes and
the failure SET shifted. Still 9 red. The next one down is a different defect
of the same class — test_gate_can_write_denied_terminal now reaches COMPLETE
rather than CANCELLED with dispatcher-off/on parity intact, i.e. the gate is
not consulting `stack.can_write` at all, so that fake is likely modelling a
seam production no longer reads.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
[integrity-verified: ee2c4d48eddb]
💡 PR Description Suggestions
|
📊 PR Size AnalysisSize: Review Checklist
|
💡 PR Description Suggestions |
🤖 CI/CD Pipeline ResultsStatus: success Pipeline Stages
|
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.
project_rootwas hardcoded toPath("/tmp/test-project-6b")— a directory nothing creates. Every op failed GENERATE withtarget_file_missing: backend/core/utils.pyand never reached the GATE / APPROVE / APPLY terminals these tests assert on.It went unnoticed because the
CancelTokenfake (fixed in #70215) short-circuited each op to POSTMORTEM before GENERATE ran. One dead fake concealing another — repairing the first is what made this visible.The fix
Materialised per-test from
tmp_path, with the target file actually written:target_file_missingfor aSyntaxError.tmp_pathrather than a fixed directory, because a shared/tmppath is order-dependent state between sessions, and this repo's node policy makes/tmpunwritable outright.Status — still 9 red
test_artifact_generation_threads_classify_to_validatenow passes and the failure set shifted, which is the signal that this was a real cause rather than a reshuffle.The next one down is the same defect class again:
test_gate_can_write_denied_terminalnow reachesCOMPLETEinstead ofCANCELLED, with dispatcher-off/on parity intact. Both paths agree, so the gate is not consultingstack.can_writeat all — that fake is likely modelling a seam production no longer reads.canary_not_promotedis produced ingovernance/integration.py:480, which is where the next trace should start.🤖 Generated with Claude Code
Summary by cubic
Fix dispatcher tests by using a real, per-test project root and target file instead of a hardcoded
/tmppath. This lets ops pass GENERATE and reach the expected GATE/APPROVE/APPLY terminals._FIXTURE_ROOTtotmp_pathand createsbackend/core/utils.pywith parseable content._TARGET_RELconstant and updated the generator,target_files, and config to use it.project_rootfrom_FIXTURE_ROOT(notPath('/tmp/test-project-6b')), removing/tmpstate and unwritable-node issues; failure set shifted and at least one test now passes.Written for commit 5bea6cb. Summary will update on new commits.