Repository navigation
fix(setup-preflight): accept sha512 in svn-zip locks - #1596
Conversation
The documented svn-zip project lock records the release zip's sha512 digest, but the parser rejected that key. The shared pre-flight exited 2 before it could report the project's setup findings. Accept and retain sha512 on Lock. It has no local-lock counterpart, so the drift comparison remains unchanged and other unknown keys still raise MalformedLock. Add regression coverage for parsing and missing-snapshot findings, and for an svn-zip pin that matches the machine's local lock. Generated-by: Codex (GPT-6)
Accepting the documented digest for every method let a git-tag lock mistype its commit anchor as sha512 and skip the commit comparison. Validate the digest's method after parsing, independent of key order, and report an empty digest as a missing value rather than a block. Derive scalar keys from Lock while keeping plugins and reconciled as structured blocks. Cover invalid methods, unknown keys, empty values, and the existing empty/version forms of an svn-zip local lock. This does not add digest drift detection or change local-lock formats. Generated-by: Codex (GPT-6)
potiuk
left a comment
There was a problem hiding this comment.
LGTM — a real fix: locks.md and install.md both tell svn-zip adopters to write sha512:, and the parser rejected it, so every skill's pre-flight failed for anyone installed from the signed source release. The digest is accepted only for method: svn-zip regardless of field order, empty and misspelt keys are still rejected, the structured blocks can't take a scalar, and the tests pin each of those boundaries along with both existing forms of an svn-zip local lock. CI is green.
Thank you for the careful write-up, including the scope note: re-fetch digest comparison is indeed separate work, and the note on how svn-zip adopters receive the fix (a new release, then an upgrade from it) is right.
This review was drafted by an AI-assisted tool and
confirmed by an Apache Magpie maintainer. The maintainer
approving this PR has read the findings and signed off. If
something feels off, please reply on the PR and a maintainer
will follow up.More on how Apache Magpie handles maintainer review:
Contributing guide.
Summary
sha512:, but the original parser rejected it and made the shared pre-flight exit 2 before reporting setup findings.method: svn-zip, independent of field order. Invalid methods and empty digests raiseMalformedLock; scalar keys come fromLockwhilepluginsandreconciledremain structured blocks.Type of change
tools/*/withpyproject.toml)Test plan
prek run --all-filespasses, including lychee, workspace checks and skill-script tests.setup-preflighttests pass.20cbbc56, all 15 method-restriction and empty-value diagnostic cases fail; they pass with the revision. The original parser compatibility regression was separately demonstrated on4556f693.sha521:, and invalid scalar assignments to structured blocks. Invalid cases exit 2; valid svn-zip locks still reportsnapshot-never-fetchedandsweep-never-run.fetched_commitremain readable when recorded pin fields match.RFC-AI-0004 compliance
This parser-only correction restores the documented lock contract. It adds no outbound action, host access, configurable skill policy, or LLM data flow. No skill prompt material, dependency or local-lock schema changes.
Linked issues
Closes #1595.
Notes for reviewers (optional)
This PR targets apache/magpie:main from MakerFlyFly:fix/setup-preflight-svn-zip-sha512. The author has completed human review. The two commits retain the original fix and its scoped review revision; the aggregate diff is limited to lockfile.py and test_core.py (+70/-2). Public audit records: MakerFlyFly#4 and MakerFlyFly#5.
Scope and remaining limits: this fixes parsing and the applicability of the new digest field. It does not provide SHA-512 drift detection or ZIP integrity attestation.
upgrade.mdrequests a security-flagged finding when a digest changes under the same version, but the existing local lock records no fetched digest. Implementing that requires coordinated persistence, parser, comparison and legacy-lock changes and is a separate task. This revision does not add digest format checks, duplicate-key policy, general per-method schema validation or a documentation-template test harness.How svn-zip adopters receive the fix: the maintainers must advance the committed pin to a release that contains it, install/upgrade to that snapshot, and refresh the personal checker from that updated source. Repeating
configorupgradewith the same affected pinned snapshot copies the old parser again and does not fix this error. This PR does not change adopter pins or automate an upgrade.Validation uses a Linux checkout with real Git symlinks and Docker
--init; the Windows checkout keeps its existing symlink configuration. Prior reproduction and validation records are preserved, and revision records are stored separately. Python 3.9 is outside the package's declared Python 3.11+ support range.Generative AI (Codex, GPT-6) assisted reproduction, implementation and validation. The author has completed human review of the final change and owns this contribution; upstream maintainer review is pending.
Suggested labels: bug, family:setup, substrate:setup, capability:fix.