Repository navigation
versionctl: several mirror pointers per file for npm lockfiles (#273) - #274
Conversation
…273) Mirrors are unique per (path, pointer) instead of per path, and adopt and prepare chain edits to one file so later pointers keep earlier ones. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
What: Independent review approves this exact candidate with no blocking findings. Candidate and verdict
Review evidenceI read the full
Independently executed proofAll execution used a disposable export, never either protected checkout: git -C /Users/rocky/.t3/worktrees/agentsmd/cb0d6c7f-ee124e5bf59e5982 archive a1d56d94503f6536069646b44eb94d34b967da23 | tar -x -C <scratch>
cd <scratch>
python3 -m unittest discover -s tools/versionctl/tests -p 'test_*.py'Result: 9 tests passed, initially and again after restoring the exact candidate from the discrimination checks. Additional
Regression discrimination command:
Also passed: Limits and cleanupThis is deterministic CLI proof and source review, not behavioral Live Verification or a complete release/package/install gate. I did not independently rerun the author's 515-test root suite, release or install anything, or modify either checkout. All created scratch files, exports, bytecode and temporary test repositories were removed; scratch absence verified. Both protected checkout status checks were clean. Elon recordRequirements and who asked: #273 and this review request require both npm lockfile fields to track VERSION and both verification commands to check them, advancing deterministic delivery. |
|
Agent cost not published: |
What changed: A version policy can declare several mirror pointers in one file, so
versionctl prepareupdates bothpackage-lock.jsonversion fields (/versionand/packages//version) anddoctor/release-checkverify both.Why: Policy validation allowed one mirror per file, and
adopt/preparebuilt each mirror's new text from disk, so a second pointer in the same file would have overwritten the first.So what: Ready for the user's merge approval once independent review passes; release and install follow under repository policy.
Closes #273
Design choice
Chose several mirror pointers per file over special-casing npm lockfiles. It is the smaller and more general change: uniqueness moves from
pathto(path, pointer), andadopt/preparepass the already-updated text of a file into the next pointer's edit (updated_mirror_text(..., text=changes.get(path))). No npm-specific code, no new policy field, and any other file with two version fields works the same way.doctorandrelease-checkalready read each mirror independently, so they needed no change.Proof
test_npm_lockfile_declares_both_version_fieldsfailed withINVALID_POLICY: mirror paths must be unique and cannot equal versionSource. With only the policy fix (no chaining) it failed with{'version': '0.1.0', 'packages': {'': {'version': '0.1.1'}}}(first field clobbered).doctor,prepare patch(updatespackage.json,/version,/packages//version),release-check, then checksdoctorflags exactly the stale/packages//versionandrelease-checkexits 15.test_duplicate_mirror_pointer_is_rejectedkeeps exact duplicates invalid.python3 -m unittest discover -s tools/versionctl/tests -p 'test_*.py': OK.python3 -m unittest discover -s tests: 515 tests OK.versionctl release-checkon a1d56d9: ok, 17.6.0 (minor: compatible capability).project-policy.md).Elon record
VERSIONafterprepare.npm versionsync.adopt/prepare.release-check.🤖 Generated with Claude Code