A unit command that says python runs on Braid's own interpreter, and the fix round that corrects it fails its check #148
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What happened in run 48
openspec.apply[1]wrote.osf/test/unit.commandthe way the project's CI runs its tests:python -m pytest backend/tests && npm --prefix frontend test. Every agent in the run ran its own tests withbackend/.venv/bin/python.pythonto Braid's own interpreter,/opt/openspecflow/app/.venv/bin/python, which has no pytest. It failed in 0.1 s (No module named pytest). No test ran, and the judge was skipped as not due.agent.fixread that, rewrote the command tobackend/.venv/bin/python -m pytest backend/tests && npm --prefix frontend test, checked that it exits 0, and wrote its note. Its completion check then failed: "the code has not changed since round 1's check, so nothing was fixed".The run recovered, but round 1 checked nothing, and the step that fixed it shows as not needed.
Why
PATH(Dockerfile:ENV PATH=/opt/openspecflow/app/.venv/bin:${PATH}), andPATHpasses through to every child: scripted steps, the lanes and the agents' shells. So a project's barepython,piporpytestis Braid's.python -m pytest, which is right on CI aftersetup-pythonandpip install, and wrong in the lane.since-verify:changedcompares the code without.osf/. A fix whose whole correction is the lane command cannot pass it, though the lane command is part of what the loop checks.since-verify:changeddecides nothing, as the judge's check did not before #145.How often: production's log has 15 unit commands written by agents since 09-15. Three are a bare
python -m pytest …: one on 09-29, and two on 10-05, including this run.Proposal
PATH, and with the project's environments first: the virtualenvsscript.dependenciesmade (backend/.venv/binhere) andnode_modules/.bin. Thenpython -m pytestmeans the project's Python, as it does on CI. Braid's own scripted steps keep their interpreter..osf/test/*.commandalong with the code.The console, too. Two rows of run 48's VERIFY & FIX band read wrong:
agent.judgewas skipped as designed: with the lanes red, the fix goes first, and the judge looks once they pass. Braid recorded why: "the fix loop's next step is fix in round 1: the unit lane failed: the suite exited 1". The spine draws it struck through as "not needed".agent.fixran for 2m 52s and made the fix that let round 2 pass, then was skipped on retry. The spine draws it struck through as "not needed", and its step view says "This step was not needed on this run, so it never ran."Both come from one rule. The spine (
Spine.tsx) and the step view (Transcript.tsx) word everyskip_kind: not_neededthe same way, whatever reason the skip recorded.Proposal:
Two simulated runs now show this bug (#149), both known failures of #148:
tests/sim/python-on-path.yaml: the unit command sayspython, and the tests need a module only the project's environment has. Round 1's unit lane should pass.tests/sim/fix-only-lane-command.yaml: the fix round's whole correction is the unit command. It should succeed, not be skipped.The fix removes both markers; the sim lane fails until it does. Run them with
python -m osf.sim python-on-path fix-only-lane-command.For the console part,
python -m osf.sim --keep red-lane-then-fixleaves a run up with round 1's judge skipped for a red lane, to check its row against.Shipped in two changes, both live and archived.
1.
lanes-use-the-projects-environment(61ff22a)PATHand the project's environments first: each.venv/binandnode_modules/.binthatscript.dependenciesmakes. Sopython -m pytestin a lane is the project's Python, as on CI. This covers the fix loop's lanes, an OpenSpec change's unit-test step, andapply test. Braid's own steps call$OSF_PYTHONand are unchanged.PATHwithout settingVIRTUAL_ENV, so the existing removal of it never ran..osf/test/unit.commandpasses its check.python-on-pathandfix-only-lane-commandpass; bothknown_failuremarkers are gone, and each scenario fails again with its fix reverted.2.
fix-loop-skip-says-why(e67c248, live withadb75b7)lanes failed,fix made,checks passed), with the whole reason in the hover.step.skip_reasonandstep.skip_note, and the API addsran. Run 48'sagent.fixnow readsran: true. Its recorded reason stays empty until anosfd rebuild, because it predates the migration.red-lane-then-fixsimulated run.Deploy note: two deploys failed the self-check on a
/tmp/tmp.*left behind. The new listing named it: Chromium's profile, from the browser check, recreated after its scratch directory was removed.adb75b7stops every process naming that directory before removing it.