Repository navigation
Verify GNN digests before parsing and bind the pin tag to its commit - #30
Merged
Merged
Conversation
validate_gnn_spec.py ran the parser probe before verifying the installed parser digests and never checked that the pin's tag names the pinned commit. For an installed runtime the package is now located with importlib.util.find_spec and its digests are verified before the probe runs; the parser must be imported from that package. The installer's recorded VCS commit (direct_url.json) is compared with the pin. tag_binding() resolves the tag from a --gnn-root checkout or, with --verify-tag-remote, from git ls-remote (peeled object preferred; the normalized owner/name repository from gnn.importers is expanded to a GitHub URL); a tag that resolves elsewhere fails as tag-commit-mismatch, and an unanswerable --verify-tag-remote ends the run as "not run" (exit 2). The receipt gains tag_binding and revision. The --gnn-root path is kept. No language-version check is added: this pin carries no language_version key. scripts/release_check.py's gnn arm passes --verify-tag-remote. Offline tests in tests/test_gnn_pin_binding.py cover each failure mode; gate-metrics.md is regenerated for the new test count. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
What changed
scripts/validate_gnn_spec.py, by hand against currentmain(pin v5.1.0 @75c834bd, read throughgnn.importers; nothing hard-coded):run_probefor the installed-runtime path:locate_package()usesimportlib.util.find_specin the runtime (no parser import), digests are verified, then the probe runs. The parser must be imported from the verified package.direct_url.jsonvcs_info.commit_idvs the pin commit (unresolvable-offlinewhen absent).tag_binding()+--verify-tag-remote: localrefs/tags/<tag>^{commit}in a--gnn-rootcheckout (path kept), otherwisegit ls-remote --tags(peeled^{}preferred). Mismatch fails astag-commit-mismatch.gnn.importersnormalizes the pin's repository toowner/name, so it is expanded tohttps://github.com/<owner/name>forls-remote(caught by running the real arm). If the tag cannot be resolved with the flag set, exit 2 (not run).tag_binding,revision.language_versionkey).scripts/release_check.pygnnarm passes--verify-tag-remote;tests/test_release_gate.pyupdated and extended. Thegnn conformance (pinned)job name is unchanged.docs/gnn.md,docs/gate.md,scripts/README.md,.github/AGENTS.md;docs/_generated/gate-metrics.mdregenerated (test counts 97/84 -> 112/99, fromscripts/gate_metrics.py).Tests
tests/test_gnn_pin_binding.py(14 offline tests): local annotated/lightweight tags, tag pointing elsewhere, offline binding makes no network call, remote peeled commit, remote fallback when the checkout lacks the tag, look-alike tags, failedls-remote, URL expansion, installed-revision mismatch/conflict, digest mismatch exits 2 with the probe never called, missing package,--verify-tag-remotethat cannot answer exits 2, and the mismatch reachingconformance_failures.Verification
uv run pytest -q tests/test_gnn_pin_binding.py tests/test_release_gate.py tests/test_gnn_spec.py: 28 passed, 1 skipped (pinned-parser test, skipped without a runtime in that command)scripts/release_check.py --arm lint --arm types --arm test-full: passed (111 passed, 1 skipped, coverage 90.96%)scripts/release_check.py --arm docs: passedGNN_RUNTIME_PYTHON=<pinned v5.1.0 runtime> scripts/release_check.py --arm gnn: passed with network; receipttag v5.1.0 -> verified,revision verified.manuscript,smoke,package,renderarms not run (unrelated to this change).CI
Remote CI cannot run under the organization's Actions billing lock, so the above local runs are the evidence.
🤖 Generated with Claude Code