Repository navigation
Install the runtime, not the instructions alone - #11
Conversation
cc-orchestrator told its reader to drive every stage through CycleRecorder while install.sh copied skills/ alone. A clean installation had the instruction and no code to satisfy it, so it recorded nothing and first_pass_rate stayed unmeasured however many cycles ran. That is the failure this instrument exists to catch, in the instrument itself. Both installers now carry the runtime to .code-cycle/runtime, one copy per scope rather than one per host: three copies would be three answers to the question of which one a run used. scripts/runtime.manifest is the single list both read, so they cannot drift. A project-scope installation writes .code-cycle/.gitignore containing '*', so installed code cannot be committed to the target repository by accident. --no-runtime and -NoRuntime install the skills alone, and the skill says such an installation records nothing. No test could have seen the gap, because every test imports from scripts/ -- the checkout an installation does not have. tests/installed_stage_check.py refuses that import: it takes an installed runtime, keeps the repository off sys.path, drives a full stage through a scripted executor and asserts the rows. Both CI jobs run it against a real installation, and a test deletes a module from the installed tree to prove the check can still fail. The suite also refuses a module that is neither shipped nor declared as tooling, and a shipped module whose own imports are not shipped.
Review summaryReviewed the accumulated diff from Findings[REV-001] · high · open · blocks:yes — Runtime installation overwrites
|
The runtime install wrote '*' to .code-cycle/.gitignore unconditionally. Two things were wrong with that. It destroyed an existing file, bypassing the --force contract the rest of the installer honours. And it followed a symlink: a repository could point that path at any file on the disk, and installing into that repository truncated it. Reproduced both -- an existing file containing keep-existing-rules became '*', and a link to victim.txt left victim.txt containing '*'. With --force the same held for a linked runtime module. An installation is not authority to modify a file nobody named. Every path the runtime install writes to is now checked: the .code-cycle directory, the runtime directory, the ignore file and each module. A symlink on any of them is refused with the path named, not followed. An existing .gitignore is kept as it is and reported, never merged and never replaced by --force, which asks to replace this toolkit's files and not the target project's. --force on a module removes the entry before copying, so it replaces our file rather than writing through a link. The module loop no longer relies on cp declining a dangling symlink, which is GNU behaviour; PowerShell uses Get-Item over Test-Path for the same reason, a link whose target is gone being a link that Test-Path reports as absent. Four regression tests, all of which fail against the previous installer and pass against this one, plus a Windows CI step covering the existing file and the reparse point. The skills copy is deliberately untouched: a deliberately symlinked skills directory is a plausible setup, a symlinked .code-cycle .gitignore is not.
Resolution summaryReproduced before editing anything, fixed in [REV-001] · high · resolved · valid · blocks:yes — Runtime installation overwrites
|
Re-review summaryReviewed the complete accumulated diff from Previous findings[REV-001] · high · resolved · blocks:no — Runtime installation overwrites
|
What this fixes
cc-orchestratorinstructed its reader to drive every stage throughCycleRecorder, andinstall.shcopiedskills/alone. A clean installation therefore had the instruction and no code to satisfy it: it recorded nothing, andfirst_pass_rate()stayed unmeasured however many cycles ran.This is REV-001 from the review of #10, deferred there because widening what the toolkit distributes is a decision about the installation contract, not a fix to fold into a recording primitive.
What changed
Both installers carry the runtime to
.code-cycle/runtime— under the home directory for a global installation, under the project root for a project one. One copy per scope rather than one per host: a skill is instructions and duplicates harmlessly, but three copies of the code that records a cycle would be three answers to the question of which one a run used.scripts/runtime.manifestis the single list both installers read, so Bash and PowerShell cannot drift. It shipscycle,executors,router,telemetry,security_gateandreview_contract.calibration_store.pyandvalidate-package.pystay in the checkout: campaign tooling and package tooling, which no installed skill points anybody at.A project-scope installation writes
.code-cycle/.gitignorecontaining*, so installed code cannot be committed to the target repository by accident.--no-runtime/-NoRuntimeinstalls the skills alone, and the skill now states that such an installation records nothing rather than implying a rate exists.The test that could have caught it
None of the 310 existing tests could see this gap, because every one of them imports from
scripts/— precisely the checkout an installation does not have. They would all have passed on an installer that shipped nothing.tests/installed_stage_check.pyrefuses that import. It takes an installed runtime directory, strips the repository offsys.path, drives a full stage through a scripted executor — no provider, no network, no credential — and asserts the rows it left. Both CI jobs run it against a real installation.Three more checks close the doors around it:
telemetry.pyfrom the installed tree and requires the check to fail, so the check's own premise is verified rather than assumed;scripts/must be either shipped or declared as tooling, so a new one cannot land without somebody deciding which;Verification
python3 -m unittest discover -s tests—Ran 318 tests ... OK(was 305 before Record a stage by running it #10, 310 after).python3 scripts/validate-package.py—VALID.installed_stage_check.pyagainst it —installed runtime recorded 3 rows.pwshin this environment); the Windows CI job is what exercises it.What this does not do
Nothing reads the recorded rows automatically, and no installed host is wired to construct a
CycleRecorderyet — this makes the code reachable, not the wiring automatic. The rate stays unmeasured until real cycles run.