Skip to content

chore(ci): SPDX headers on line 1 and Actions lockfile minted - #307

Merged
hyperpolymath merged 7 commits into
mainfrom
chore/ci-hygiene-lockfile-spdx
Aug 7, 2026
Merged

chore(ci): SPDX headers on line 1 and Actions lockfile minted#307
hyperpolymath merged 7 commits into
mainfrom
chore/ci-hygiene-lockfile-spdx

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Two estate gates, one change.

SPDX — the linter checks head -1 only, so workflows carrying their identifier below a managed-by comment report as missing one. Each file's own identifier is moved to line 1; nothing is imposed (repos here are variously MPL-2.0, PMPL-1.0-or-later, AGPL-3.0-or-later). Licences in this repo: MPL-2.0.

Lockfile (minted)gh actions-lock resolves each symbolic ref to a verified commit plus owner_id, repo_id and the transitive dependencies of composite actions. That is what Scorecard's Pinned-Dependencies check wants, and what an inline SHA cannot express.

⚠ Do not additionally SHA-pin inline — the mechanisms are mutually exclusive, and inline pinning removes actions from the lockfile (measured on hypatia: 14 startup_failures).

Verified: all workflows parse · no duplicate SPDX identifiers · gh actions-lock --verify-local: All 25 workflows have complete lockfile coverage.

🤖 Generated with Claude Code

Two estate gates, one change.

**SPDX.** `governance / Workflow security linter` checks `head -1 | grep`, so a
workflow carrying its identifier below a managed-by comment reports as missing
one. Each file's OWN identifier is moved to line 1 — nothing is imposed, because
repositories here are variously MPL-2.0, PMPL-1.0-or-later and AGPL-3.0-or-later
and a default would mis-declare the minority. Licences seen here: MPL-2.0.

**Lockfile.** `gh actions-lock` resolves each symbolic ref to a verified commit
plus owner_id, repo_id and the transitive dependencies of composite actions —
which is what OSSF Scorecard's Pinned-Dependencies check is asking for, and what
an inline SHA cannot express.

⚠ Do NOT additionally SHA-pin inline. The mechanisms are mutually exclusive:
`gh actions-lock` refuses a ref no tag or branch contains, so inline pinning
REMOVES actions from the lockfile. Measured on hypatia 2026-08-07 — 40 inline
pins caused 14 startup_failures and dropped 7 lockfile entries.

Verified: all workflows parse, no duplicate identifiers, lockfile verify says
"All 25 workflows have complete lockfile coverage.".
Comment thread .github/workflows/container-publish.yml Outdated
@@ -1,3 +1,4 @@
# This workflow is managed by gh actions-lock.
Comment thread .github/workflows/container-publish.yml Outdated
@@ -1,3 +1,4 @@
# This workflow is managed by gh actions-lock.
Comment thread .github/workflows/pages-deploy.yml Outdated
@@ -1,3 +1,4 @@
# This workflow is managed by gh actions-lock.
Comment thread .github/workflows/pages-deploy.yml Outdated
@@ -1,3 +1,4 @@
# This workflow is managed by gh actions-lock.
Comment thread .github/workflows/pages.yml Outdated
@@ -1,3 +1,4 @@
# This workflow is managed by gh actions-lock.
Comment thread .github/workflows/pages.yml Outdated
@@ -1,3 +1,4 @@
# This workflow is managed by gh actions-lock.
Comment thread .github/workflows/pages.yml Outdated
@@ -1,3 +1,4 @@
# This workflow is managed by gh actions-lock.
Comment thread .github/workflows/pages.yml Outdated
@@ -1,3 +1,4 @@
# This workflow is managed by gh actions-lock.
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 95 issues detected

Severity Count
🔴 Critical 7
🟠 High 31
🟡 Medium 57

⚠️ Action Required: Critical security issues found!

View findings
[
  {
    "reason": "Issue in build.yml",
    "type": "missing_timeout_minutes",
    "file": "build.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in pages-deploy.yml",
    "type": "missing_timeout_minutes",
    "file": "pages-deploy.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in push-email-notify.yml",
    "type": "missing_timeout_minutes",
    "file": "push-email-notify.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in instant-sync.yml",
    "type": "secret_action_without_presence_gate",
    "file": "instant-sync.yml",
    "action": "peter-evans/repository-dispatch",
    "rule_module": "workflow_audit",
    "severity": "high"
  },
  {
    "reason": "Issue in codeql.yml",
    "type": "codeql_missing_actions_language",
    "file": "codeql.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "believe_me undermines formal verification (4 occurrences, CWE-704)",
    "type": "believe_me",
    "file": "/home/runner/work/boj-server/boj-server/src/abi/Boj/SafetyLemmas.idr",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "critical"
  },
  {
    "reason": "Shell execution -- validate input before passing to shell (1 occurrences, CWE-78)",
    "type": "js_exec_sync",
    "file": "/home/runner/work/boj-server/boj-server/mcp-bridge/lib/nickel-validator.js",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "high"
  },
  {
    "reason": "eval() -- arbitrary code execution (2 occurrences, CWE-94)",
    "type": "js_eval",
    "file": "/home/runner/work/boj-server/boj-server/mcp-bridge/lib/security.js",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "critical"
  },
  {
    "reason": "Deno -A grants all permissions -- use specific --allow-* flags (1 occurrences, CWE-250)",
    "type": "js_deno_all_perms",
    "file": "/home/runner/work/boj-server/boj-server/mcp-bridge/main.d.ts",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "high"
  },
  {
    "reason": "Zig @ptrCast performs unchecked pointer type conversion (1 occurrences, CWE-704)",
    "type": "zig_ptr_cast",
    "file": "/home/runner/work/boj-server/boj-server/ffi/zig/src/cartridge_shim.zig",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "high"
  }
]

Powered by Hypatia Neurosymbolic CI/CD Intelligence

Comment thread .github/workflows/e2e.yml Outdated
Comment thread .github/workflows/actions.lock
Comment thread .github/workflows/abi-drift.yml Outdated
@gitar-bot

gitar-bot Bot commented Aug 7, 2026

Copy link
Copy Markdown

Note

Automatic reviews are paused because your trial's included automatic processing has been used for this period. Upgrade now, or comment "Gitar review" to run a review anytime.
Learn more

Code Review ✅ Approved 3 resolved / 3 findings

Updates CI workflows to add SPDX headers and mint an Actions lockfile, but pushes SPDX identifiers to line 2, replaces immutable SHA pins with mutable tags, and downgrades the rust-toolchain pin to a floating branch.

✅ 3 resolved
Bug: SPDX pushed to line 2, contradicting the PR's stated goal

📄 .github/workflows/e2e.yml:1-2 📄 .github/workflows/release.yml:1-2 📄 .github/workflows/dogfood-gate.yml:1-2 📄 .github/workflows/codeql.yml:1-2 📄 .github/workflows/governance.yml:1-2
The PR description states the goal is to place each file's SPDX identifier on line 1 because the linter checks head -1 only, and that workflows carrying SPDX below a managed-by comment report as missing. But the diff does the opposite in all ~25 workflows: it inserts # This workflow is managed by gh actions-lock. as the new line 1 and pushes # SPDX-License-Identifier: MPL-2.0 down to line 2. If the described head-1 linter exists (it was not found in this repo, so it likely lives in the org governance bundle), every one of these files would now report as missing an SPDX identifier — the exact failure the PR claims to fix. Move the SPDX identifier back to line 1 (above the managed-by comment), or confirm the linter scans the whole file rather than only the first line.

Security: SHA pins replaced with mutable tags; lockfile not enforced at runtime

📄 .github/workflows/actions.lock:1-4 📄 .github/workflows/e2e.yml:36 📄 .github/workflows/release.yml:29
Every workflow is changed from immutable commit-SHA pins (e.g. actions/checkout@de0fac2...) to mutable version tags (e.g. actions/checkout@v6.0.2). GitHub Actions resolves these tags at runtime to whatever commit the tag currently points to; Git tags are movable, so a compromised or repointed tag would silently run different code. The new actions.lock is meant to provide the pinning guarantee, but no workflow or script in the repo ever invokes gh actions-lock --verify (grep for actions.lock/actions-lock returns nothing), so the lockfile is a static artifact with zero runtime enforcement. This is a supply-chain security regression and likely fails OpenSSF Scorecard's Pinned-Dependencies check, which specifically wants hash pins — contrary to the PR's claim. Add a CI step that runs gh actions-lock --verify-local (fail on drift), or retain the inline SHA pins.

Security: rust-toolchain pinned SHA downgraded to floating @master branch

📄 .github/workflows/abi-drift.yml:81 📄 .github/workflows/actions.lock:163-167
abi-drift.yml changes dtolnay/rust-toolchain@b3b07ba8... # stable to dtolnay/rust-toolchain@master. Unlike a version tag, @master tracks the branch tip and changes on every upstream push, so each CI run may pull different action code with no immutability at all. The lockfile records a specific commit for dtolnay/rust-toolchain@master, but as noted it is never enforced, so this ref resolves live to the current branch head. Pin to a released tag (the action publishes @stable/version tags) or keep an explicit SHA rather than a branch name.

Options

Display: compact → Showing less information.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Important

Your trial ends in 3 days — upgrade now to keep code review, CI analysis, auto-apply, custom automations, and more.

Was this helpful? React with 👍 / 👎 | Gitar

gitar-bot[bot]
gitar-bot Bot previously requested changes Aug 7, 2026

@gitar-bot gitar-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ This PR is blocked due to unresolved code review findings.

Configure merge blocking · Maintainers can dismiss this review.

`gh actions-lock` inserts `# This workflow is managed by gh actions-lock.` at
line 1, which displaced the SPDX identifier moved there earlier in this branch.
The linter greps `head -1` only, so the header read as missing again.

Each file's OWN identifier is moved back to line 1 — nothing imposed. Files
already correct are untouched, and any file carrying two identifiers aborts the
change rather than guessing.
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 95 issues detected

Severity Count
🔴 Critical 7
🟠 High 31
🟡 Medium 57

⚠️ Action Required: Critical security issues found!

View findings
[
  {
    "reason": "Issue in build.yml",
    "type": "missing_timeout_minutes",
    "file": "build.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in pages-deploy.yml",
    "type": "missing_timeout_minutes",
    "file": "pages-deploy.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in push-email-notify.yml",
    "type": "missing_timeout_minutes",
    "file": "push-email-notify.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in instant-sync.yml",
    "type": "secret_action_without_presence_gate",
    "file": "instant-sync.yml",
    "action": "peter-evans/repository-dispatch",
    "rule_module": "workflow_audit",
    "severity": "high"
  },
  {
    "reason": "Issue in codeql.yml",
    "type": "codeql_missing_actions_language",
    "file": "codeql.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "believe_me undermines formal verification (4 occurrences, CWE-704)",
    "type": "believe_me",
    "file": "/home/runner/work/boj-server/boj-server/src/abi/Boj/SafetyLemmas.idr",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "critical"
  },
  {
    "reason": "Shell execution -- validate input before passing to shell (1 occurrences, CWE-78)",
    "type": "js_exec_sync",
    "file": "/home/runner/work/boj-server/boj-server/mcp-bridge/lib/nickel-validator.js",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "high"
  },
  {
    "reason": "eval() -- arbitrary code execution (2 occurrences, CWE-94)",
    "type": "js_eval",
    "file": "/home/runner/work/boj-server/boj-server/mcp-bridge/lib/security.js",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "critical"
  },
  {
    "reason": "Deno -A grants all permissions -- use specific --allow-* flags (1 occurrences, CWE-250)",
    "type": "js_deno_all_perms",
    "file": "/home/runner/work/boj-server/boj-server/mcp-bridge/main.d.ts",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "high"
  },
  {
    "reason": "Zig @ptrCast performs unchecked pointer type conversion (1 occurrences, CWE-704)",
    "type": "zig_ptr_cast",
    "file": "/home/runner/work/boj-server/boj-server/ffi/zig/src/cartridge_shim.zig",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "high"
  }
]

Powered by Hypatia Neurosymbolic CI/CD Intelligence

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 95 issues detected

Severity Count
🔴 Critical 7
🟠 High 31
🟡 Medium 57

⚠️ Action Required: Critical security issues found!

View findings
[
  {
    "reason": "Issue in build.yml",
    "type": "missing_timeout_minutes",
    "file": "build.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in pages-deploy.yml",
    "type": "missing_timeout_minutes",
    "file": "pages-deploy.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in push-email-notify.yml",
    "type": "missing_timeout_minutes",
    "file": "push-email-notify.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in instant-sync.yml",
    "type": "secret_action_without_presence_gate",
    "file": "instant-sync.yml",
    "action": "peter-evans/repository-dispatch",
    "rule_module": "workflow_audit",
    "severity": "high"
  },
  {
    "reason": "Issue in codeql.yml",
    "type": "codeql_missing_actions_language",
    "file": "codeql.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "believe_me undermines formal verification (4 occurrences, CWE-704)",
    "type": "believe_me",
    "file": "/home/runner/work/boj-server/boj-server/src/abi/Boj/SafetyLemmas.idr",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "critical"
  },
  {
    "reason": "Shell execution -- validate input before passing to shell (1 occurrences, CWE-78)",
    "type": "js_exec_sync",
    "file": "/home/runner/work/boj-server/boj-server/mcp-bridge/lib/nickel-validator.js",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "high"
  },
  {
    "reason": "eval() -- arbitrary code execution (2 occurrences, CWE-94)",
    "type": "js_eval",
    "file": "/home/runner/work/boj-server/boj-server/mcp-bridge/lib/security.js",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "critical"
  },
  {
    "reason": "Deno -A grants all permissions -- use specific --allow-* flags (1 occurrences, CWE-250)",
    "type": "js_deno_all_perms",
    "file": "/home/runner/work/boj-server/boj-server/mcp-bridge/main.d.ts",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "high"
  },
  {
    "reason": "Zig @ptrCast performs unchecked pointer type conversion (1 occurrences, CWE-704)",
    "type": "zig_ptr_cast",
    "file": "/home/runner/work/boj-server/boj-server/ffi/zig/src/cartridge_shim.zig",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "high"
  }
]

Powered by Hypatia Neurosymbolic CI/CD Intelligence

@gitar-bot
gitar-bot Bot dismissed their stale review August 7, 2026 14:41

✅ All code review findings resolved.

Configure merge blocking

Signed-off-by: Jonathan D.A. Jewell <6759885+hyperpolymath@users.noreply.github.com>
@hyperpolymath
hyperpolymath merged commit 9a725a0 into main Aug 7, 2026
@hyperpolymath
hyperpolymath deleted the chore/ci-hygiene-lockfile-spdx branch August 7, 2026 16:17
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