Skip to content

feat(lock): check-only closure mode for actions.lock (#963) - #1318

Merged
hyperpolymath merged 2 commits into
mainfrom
claude/kind-curie-w54eub
Oct 20, 2026
Merged

hyperpolymath merged 2 commits into
mainfrom
claude/kind-curie-w54eub

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Implements the recommendation for #963 criterion 5, as the owner decided:

What changes

scripts/close-lock.sh --check [DIR | LOCKFILE]

scripts/lock-selfcheck.sh

  • A dangling edge becomes a third POISON verdict, after unkeyed refs and self-SHA refs.
  • It runs inside the existing "Lockfile self-consistency" job, so no required-check name changes.

.githooks/pre-commit

  • When actions.lock is staged, the hook checks the staged content.
  • Like the canonical-names guard, it runs only where the repository carries scripts/close-lock.sh.

scripts/tests/fixtures/actions-lock-closure/: five locks plus expected.tsv:

Hypatia at aa34a4cc agrees on all five. hyperpolymath/hypatia#941 vendors a byte-identical copy and tests ActionsLock.parse/1 against the same table. If either side drifts, one of the two suites goes red.

Tests

  • close-lock-test: 34/34, 8 of them new.
    • Each corpus row is checked by exit code and by the exact dangling list.
    • The lock bytes must be unchanged, gh must not be called, and a missing lock exits 2.
    • Two mutants each fail exactly one row: no case folding, and ignoring workflows: refs.
  • lock-selfcheck-test: 9/9, 2 of them new.
    • The base fixture lock had no dependencies: section, so it was not closed (Hypatia rejects that shape). It now carries the record.
    • A mutant without the closure verdict fails both new cases.
  • Unchanged and passing: apply-baseline-test 52/52, exemption-ratchet-test 14/14, hypatia-blocking-gate-test 46/46.
  • This branch's own state: its lock is closed, and lock-selfcheck.sh HEAD reports SELF-CONSISTENT.

No licence headers are touched. The new fixture files carry MPL-2.0 SPDX from birth.

Refs #963 · companion: hyperpolymath/hypatia#941


Generated by Claude Code

Owner decision on #963 criterion 5: Hypatia stays the authority for
actions.lock closure. A deterministic local check guards the same
property before push, and a shared corpus of test lockfiles binds the
two implementations.

scripts/close-lock.sh --check [DIR | LOCKFILE]
  Reports the dangling edges the repair passes would close, and nothing
  else: no gh call, no write. An edge dangles when a ref under workflows:
  or in a record's nested uses: has no top-level record of its own.
  Owner/repo compare case-insensitively and refs exactly, the same
  normalisation as GitHub's parser, #1294/#1314, and Hypatia's
  ActionsLock.normalise_ref/1. Exit 0 closed, 1 dangling, 2 no lock.

scripts/lock-selfcheck.sh
  A dangling edge is a third POISON verdict, after unkeyed refs and
  self-SHA refs. It runs in the existing "Lockfile self-consistency" job,
  so no required check name changes. Only that job calls the script.

.githooks/pre-commit
  When actions.lock is staged, the staged content is checked. Like the
  canonical-names guard, this runs only where the repository carries
  scripts/close-lock.sh.

scripts/tests/fixtures/actions-lock-closure/
  Five locks and expected.tsv: closed v0.0.2, closed v0.0.3 with
  hostname, closed case-variant, the #963 nested shape, and a dangling
  workflows: ref. Hypatia at aa34a4cc agrees on all five: ok, ok, ok,
  transitive_dependencies_missing, workflow_dependencies_missing.
  hyperpolymath/hypatia vendors a byte-identical copy for its own test.

Tests
  close-lock-test: 34/34, 8 of them new. Each corpus row is checked by
  exit code and exact dangling list, the lock bytes must be unchanged,
  gh must not be called, and a missing lock exits 2. Two mutants each
  fail exactly one row: no case folding fails the case variant, and
  ignoring workflows: refs fails the dangling workflow ref.
  lock-selfcheck-test: 9/9, 2 of them new. Its base fixture lock had no
  dependencies: section, so it was not closed (Hypatia rejects that shape
  as workflow_dependencies_missing). It now carries the record. A mutant
  without the closure verdict fails both new cases.
  With gawk installed, these pass unchanged: regen-dependabot-locks 59,
  complete-job-refs 20, relock-sha-keys 12, prune-stale 18,
  check-lock-sync 13, validate-actions-lock 7.
  The hook blocks a staged lock with the #963 shape and names the ref.
  main's own lock is closed, and lock-selfcheck on HEAD is
  SELF-CONSISTENT.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TbbnKqskQA5mj5gfMniPzi
@coderabbitai

coderabbitai Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 49 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 013caf90-e62d-4bee-a080-d6a2a393db6b
📥 Commits

Reviewing files that changed from the base of the PR and between a2d1854 and 898539a.

⛔ Files ignored due to path filters: 6
  • scripts/tests/fixtures/actions-lock-closure/closed-case-variant.lock is excluded by !**/*.lock
  • scripts/tests/fixtures/actions-lock-closure/closed-v0.0.2.lock is excluded by !**/*.lock
  • scripts/tests/fixtures/actions-lock-closure/closed-v0.0.3.lock is excluded by !**/*.lock
  • scripts/tests/fixtures/actions-lock-closure/dangling-nested.lock is excluded by !**/*.lock
  • scripts/tests/fixtures/actions-lock-closure/dangling-workflow-ref.lock is excluded by !**/*.lock
  • scripts/tests/fixtures/actions-lock-closure/expected.tsv is excluded by !**/*.tsv
📒 Files selected for processing: 5
  • .githooks/pre-commit
  • scripts/close-lock.sh
  • scripts/lock-selfcheck.sh
  • scripts/tests/close-lock-test.sh
  • scripts/tests/lock-selfcheck-test.sh
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@hyperpolymath
hyperpolymath marked this pull request as ready for review October 20, 2026 12:38
@hyperpolymath
hyperpolymath enabled auto-merge (squash) October 20, 2026 12:38
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-20T12:39:53.098596Z aa303a4 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

SonarCloud reported 13 new issues on #1318. Its issue list is not
reachable from here, but every test the PR adds uses [ ], which is the
finding #1291 and #1305 cleared the same way. All twelve such lines are
now [[ ]]. Lines this PR does not touch keep their [ ].

close-lock-test 34/34, lock-selfcheck-test 9/9. --check still exits 0,
1 and 2 for a closed lock, a dangling one and a missing one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TbbnKqskQA5mj5gfMniPzi
@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown
Contributor

DEED–K9 green

🟢 conformant · commit 898539a9198d · run 39423861158

Category Status Pass Fail Indeterminate N/A Since previous revision
DEED syntax 🟢 conformant 4 0 0 0 — no comparable baseline
K9 contract typecheck 🟢 conformant 1 0 0 0 — no comparable baseline
K9 validator self-test 🟢 conformant 37 0 0 0 — no comparable baseline
K9 positive/negative controls 🟢 conformant 27 0 0 0 — no comparable baseline
K9 live corpus (L0–L2) 🟢 conformant 12 0 0 2 — no comparable baseline
K9 live corpus (L0–L2): 2 finding(s) / scope notes
  • 2-protocols/k9-coordination/examples/minimal.k9 — not_applicable: Routed to another dialect; not validated as a K9 contract.
  • coordination.k9 — not_applicable: Routed to another dialect; not validated as a K9 contract.

Scope: DEED syntax and K9 contracts L0–L2. L3 signature verification and routed coordination dialects are not certified. Green is limited to this scope. Orange is missing evidence; grey is an explicit scope exclusion. Logs and report.json are in the dated conformance-evidence artifact on the linked run.

@hyperpolymath
hyperpolymath merged commit bc66416 into main Oct 20, 2026
50 checks passed
@hyperpolymath
hyperpolymath deleted the claude/kind-curie-w54eub branch October 20, 2026 12:49
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.

2 participants