Skip to content

Verify GNN digests before parsing and bind the pin tag to its commit - #30

Merged
docxology merged 1 commit into
mainfrom
fix/pass4-redo-2026-11-12
Nov 12, 2026
Merged

docxology merged 1 commit into
mainfrom
fix/pass4-redo-2026-11-12

Conversation

@docxology

Copy link
Copy Markdown
Collaborator

What changed

scripts/validate_gnn_spec.py, by hand against current main (pin v5.1.0 @ 75c834bd, read through gnn.importers; nothing hard-coded):

  • Digests before run_probe for the installed-runtime path: locate_package() uses importlib.util.find_spec in the runtime (no parser import), digests are verified, then the probe runs. The parser must be imported from the verified package.
  • Installed revision: direct_url.json vcs_info.commit_id vs the pin commit (unresolvable-offline when absent).
  • tag_binding() + --verify-tag-remote: local refs/tags/<tag>^{commit} in a --gnn-root checkout (path kept), otherwise git ls-remote --tags (peeled ^{} preferred). Mismatch fails as tag-commit-mismatch. gnn.importers normalizes the pin's repository to owner/name, so it is expanded to https://github.com/<owner/name> for ls-remote (caught by running the real arm). If the tag cannot be resolved with the flag set, exit 2 (not run).
  • Receipt: tag_binding, revision.
  • Not added: the language-version check (this pin has no language_version key).
  • scripts/release_check.py gnn arm passes --verify-tag-remote; tests/test_release_gate.py updated and extended. The gnn conformance (pinned) job name is unchanged.
  • Docs: docs/gnn.md, docs/gate.md, scripts/README.md, .github/AGENTS.md; docs/_generated/gate-metrics.md regenerated (test counts 97/84 -> 112/99, from scripts/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, failed ls-remote, URL expansion, installed-revision mismatch/conflict, digest mismatch exits 2 with the probe never called, missing package, --verify-tag-remote that cannot answer exits 2, and the mismatch reaching conformance_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: passed
  • GNN_RUNTIME_PYTHON=<pinned v5.1.0 runtime> scripts/release_check.py --arm gnn: passed with network; receipt tag v5.1.0 -> verified, revision verified.
  • manuscript, smoke, package, render arms 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

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>
@docxology
docxology merged commit 248f98a into main Nov 12, 2026
0 of 4 checks passed
@docxology
docxology deleted the fix/pass4-redo-2026-11-12 branch November 12, 2026 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant