Skip to content

fix: sourced modules no longer overwrite the caller's SCRIPT_DIR - #79

Merged
hyperpolymath merged 6 commits into
mainfrom
claude/new-session-ywdrth-scriptdir
Oct 20, 2026
Merged

hyperpolymath merged 6 commits into
mainfrom
claude/new-session-ywdrth-scriptdir

Conversation

@hyperpolymath

@hyperpolymath hyperpolymath commented Oct 19, 2026 •

Copy link
Copy Markdown
Owner

Summary

On main, network-repair --help exits 1 on every distribution in Distribution Matrix Tests and in Tests:

src/main.sh: line 17: .../src/utils/utils/privileges.sh: No such file or directory

Every module that src/main.sh sources starts by assigning the global SCRIPT_DIR to its own directory. That covers utils/logging.sh and everything in diagnostics/ and repairs/. Once main.sh has sourced utils/logging.sh, SCRIPT_DIR is src/utils, so main.sh's next source resolves under src/utils/utils/.

Changes

  • 8800119. Each sourced module resolves the directory it needs into its own name and leaves SCRIPT_DIR to main.sh:
    • NR_UTILS_DIR is always src/utils, whichever module sets it.
    • repairs/routing.sh sets NR_REPAIRS_DIR, because two of its functions re-source interfaces.sh at run time.
  • 7895d9c (CodeRabbit):
    • Diagnostics that find issues no longer abort diagnose under set -e.
    • The safe-mode test reads diagnose's output once.
    • The colour test accepts empty colours when stdout is not a terminal.
    • Two ShellCheck warnings are fixed.
  • 45da73d (CodeRabbit): comments in repairs/routing.sh.
  • 4270e56: a regression test. Sourcing any module from a fresh shell must leave the caller's SCRIPT_DIR alone. The test fails on main.

Testing

Check main this PR
./network-repair --help / --version exit 1 exit 0
tests/run-tests.sh 20/25 25/25
tests/test-utils.sh fails passes
shellcheck -S warning on src/ 2 warnings clean
CI: Unit Tests, ShellCheck, Integration (ubuntu 20.04/22.04/24.04, debian:12), most distro jobs red green

Still red here, fixed elsewhere

🤖 Generated with Claude Code

https://claude.ai/code/session_01Y6FD63UrriRBHqmhhEca9t

Every module that src/main.sh sources (utils/logging.sh and all of
diagnostics/ and repairs/) began by assigning the global
SCRIPT_DIR to its own directory. After main.sh sourced utils/logging.sh,
SCRIPT_DIR was src/utils, so its next line sourced
src/utils/utils/privileges.sh and `network-repair --help` exited 1 on
every distribution in the matrix and in Tests.

Each module now resolves the directory it needs into a name of its own:
NR_UTILS_DIR (always src/utils, whichever module sets it) and, in
repairs/routing.sh, NR_REPAIRS_DIR for the two interfaces.sh re-sources
its functions do at run time. Those used to work only because
repairs/networkmanager.sh happened to be sourced last and left
SCRIPT_DIR at src/repairs.

Checked locally against main (eed2f99):
- `network-repair --help` and `--version`: exit 1 -> exit 0
- tests/run-tests.sh: 20/25 -> 24/25
- tests/integration/test-safe-mode.sh: 2 checks pass -> 9
- `bash -n` on every .sh: clean
- shellcheck -S warning on src/: the same two pre-existing findings
  (SC1010, SC2064), none added

Still failing, unrelated to this change: `diagnose` exits 1 under
set -e when an interface has no address (diagnostics/interfaces.sh,
`ip=$(get_interface_ip ...)`), and test-utils.sh expects COLOR_RED to be
non-empty when stdout is not a terminal.

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

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 920be1aa-6aa6-4421-8f5d-739e033f56c4
📥 Commits

Reviewing files that changed from the base of the PR and between 8800119 and 4270e56.

📒 Files selected for processing: 7
  • src/diagnostics/connectivity.sh
  • src/diagnostics/interfaces.sh
  • src/main.sh
  • src/repairs/routing.sh
  • src/utils/privileges.sh
  • tests/run-tests.sh
  • tests/test-utils.sh

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📜 Recent review details
⏰ Context from checks skipped due to timeout: 26
  • GitHub Check: hypatia / Hypatia Neurosymbolic Analysis
  • GitHub Check: scan / shell-secrets
  • GitHub Check: scan / gitleaks
  • GitHub Check: scan / rust-secrets
  • GitHub Check: lint
  • GitHub Check: archlinux
  • GitHub Check: Runtime Policy
  • GitHub Check: ubuntu-22.04
  • GitHub Check: rockylinux-9
  • GitHub Check: ubuntu-24.04
  • GitHub Check: alpine-3.19
  • GitHub Check: alpine-3.20
  • GitHub Check: ubuntu-20.04
  • GitHub Check: fedora-40
  • GitHub Check: debian-11
  • GitHub Check: fedora-39
  • GitHub Check: almalinux-9
  • GitHub Check: opensuse-tumbleweed
  • GitHub Check: antipattern-check
  • GitHub Check: opensuse-leap-15.5
  • GitHub Check: debian-12
  • GitHub Check: check
  • GitHub Check: check
  • GitHub Check: Network Namespace Integration Tests
  • GitHub Check: analyze (actions, none)
  • GitHub Check: semgrep-cloud-platform/scan
⚠️ CI failures not shown inline: 8

GitHub Actions: Hypatia Security Scan / 0_hypatia _ Hypatia Neurosymbolic Analysis.txt: fix: sourced modules no longer overwrite the caller's SCRIPT_DIR

Conclusion: failure

View job details

##[group]GITHUB_TOKEN Permissions
 Actions: read
 Contents: read
 Metadata: read
 SecurityEvents: write
 ##[endgroup]
 Secret source: Actions
 Cache mode: write
 Using locked action versions from the workflow's lockfile
 Prepare workflow directory
 Prepare all required actions
 Getting action download info
 ##[error]lockfile verification did not produce a result for this action. Unable to resolve action `actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1`: invalid lockfile pin. Run `gh actions-lock` to update the lockfile. lockfile verification did not produce a result for this action. lockfile verification did not produce a result for this action. lockfile verification did not produce a result for this action

GitHub Actions: Hypatia Security Scan / hypatia _ Hypatia Neurosymbolic Analysis: fix: sourced modules no longer overwrite the caller's SCRIPT_DIR

Conclusion: failure

View job details

##[group]GITHUB_TOKEN Permissions
 Actions: read
 Contents: read
 Metadata: read
 SecurityEvents: write
 ##[endgroup]
 Secret source: Actions
 Cache mode: write
 Using locked action versions from the workflow's lockfile
 Prepare workflow directory
 Prepare all required actions
 Getting action download info
 ##[error]lockfile verification did not produce a result for this action. Unable to resolve action `actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1`: invalid lockfile pin. Run `gh actions-lock` to update the lockfile. lockfile verification did not produce a result for this action. lockfile verification did not produce a result for this action. lockfile verification did not produce a result for this action

GitHub Actions: Secret Scanner / 0_scan _ shell-secrets.txt: fix: sourced modules no longer overwrite the caller's SCRIPT_DIR

Conclusion: failure

View job details

##[group]GITHUB_TOKEN Permissions
 Contents: read
 Metadata: read
 ##[endgroup]
 Secret source: Actions
 Cache mode: write
 Using locked action versions from the workflow's lockfile
 Prepare workflow directory
 Prepare all required actions
 Getting action download info
 ##[error]Unable to resolve action `actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1`: invalid lockfile pin. Run `gh actions-lock` to update the lockfile

GitHub Actions: Secret Scanner / scan _ shell-secrets: fix: sourced modules no longer overwrite the caller's SCRIPT_DIR

Conclusion: failure

View job details

##[group]GITHUB_TOKEN Permissions
 Contents: read
 Metadata: read
 ##[endgroup]
 Secret source: Actions
 Cache mode: write
 Using locked action versions from the workflow's lockfile
 Prepare workflow directory
 Prepare all required actions
 Getting action download info
 ##[error]Unable to resolve action `actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1`: invalid lockfile pin. Run `gh actions-lock` to update the lockfile

GitHub Actions: Secret Scanner / 1_scan _ gitleaks.txt: fix: sourced modules no longer overwrite the caller's SCRIPT_DIR

Conclusion: failure

View job details

##[group]GITHUB_TOKEN Permissions
 Contents: read
 Metadata: read
 ##[endgroup]
 Secret source: Actions
 Cache mode: write
 Using locked action versions from the workflow's lockfile
 Prepare workflow directory
 Prepare all required actions
 Getting action download info
 ##[error]Unable to resolve action `actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1`: invalid lockfile pin. Run `gh actions-lock` to update the lockfile

GitHub Actions: Secret Scanner / scan _ gitleaks: fix: sourced modules no longer overwrite the caller's SCRIPT_DIR

Conclusion: failure

View job details

##[group]GITHUB_TOKEN Permissions
 Contents: read
 Metadata: read
 ##[endgroup]
 Secret source: Actions
 Cache mode: write
 Using locked action versions from the workflow's lockfile
 Prepare workflow directory
 Prepare all required actions
 Getting action download info
 ##[error]Unable to resolve action `actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1`: invalid lockfile pin. Run `gh actions-lock` to update the lockfile

GitHub Actions: Secret Scanner / 2_scan _ rust-secrets.txt: fix: sourced modules no longer overwrite the caller's SCRIPT_DIR

Conclusion: failure

View job details

##[group]GITHUB_TOKEN Permissions
 Contents: read
 Metadata: read
 ##[endgroup]
 Secret source: Actions
 Cache mode: write
 Using locked action versions from the workflow's lockfile
 Prepare workflow directory
 Prepare all required actions
 Getting action download info
 ##[error]Unable to resolve action `actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1`: invalid lockfile pin. Run `gh actions-lock` to update the lockfile

GitHub Actions: Secret Scanner / scan _ rust-secrets: fix: sourced modules no longer overwrite the caller's SCRIPT_DIR

Conclusion: failure

View job details

##[group]GITHUB_TOKEN Permissions
 Contents: read
 Metadata: read
 ##[endgroup]
 Secret source: Actions
 Cache mode: write
 Using locked action versions from the workflow's lockfile
 Prepare workflow directory
 Prepare all required actions
 Getting action download info
 ##[error]Unable to resolve action `actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1`: invalid lockfile pin. Run `gh actions-lock` to update the lockfile
🧰 Additional context used
📚 Code guidelines: 1
CLAUDE.md — unknown
📓 Path-based instructions: 2
Source excerpt: Create diagnostic function in `src/diagnostics/`

📄 CodeRabbit inference engine (CLAUDE.md)

Files:

  • src/diagnostics/interfaces.sh
  • src/diagnostics/connectivity.sh
Source excerpt: Create repair function in `src/repairs/`

📄 CodeRabbit inference engine (CLAUDE.md)

Files:

  • src/repairs/routing.sh
🔇 Additional comments: 3
src/utils/privileges.sh: 1

46-46: LGTM!

src/main.sh: 1

134-134: 🎯 Functional Correctness

The failure-aggregation concern is refuted. Although errexit is disabled inside functions called on the left side of ||, check_dns_cache explicitly returns 0, so it cannot cause diagnose_dns to report a false pass. Its preceding commands also handle expected failures.

The unrecorded routing and NetworkManager checks likewise explicitly return 0. All checks that can report issues are already added to total_issues.

tests/run-tests.sh: 1

255-259: LGTM!

📝 Summary

Summary by CodeRabbit

  • Bug Fixes
    • Improved reliability when running diagnostics and repair tools from different locations by correcting how shared tools are found.
    • Diagnostics now collect failure results across checks rather than stopping before the overall result is reported.
    • Improved handling of duplicate-IP checks and privilege cleanup, and corrected a network probe argument.
  • Documentation
    • Clarified guidance on how sourced modules locate their directories and documented repair outcomes and failure conditions.

Diagnostic and repair modules now resolve shared paths through NR_UTILS_DIR and NR_REPAIRS_DIR. The main script collects diagnostic failure statuses. The changes also update diagnostic checks, repair comments, a privilege trap, and shell tests.

Changes: Module paths and diagnostic handling

Layer / File(s) Summary
Resolve utility and repair imports
src/diagnostics/*.sh, src/repairs/*.sh, src/utils/logging.sh, src/main.sh, tests/test-utils.sh
Diagnostic and repair scripts use NR_UTILS_DIR for utility imports. Repair routing uses NR_REPAIRS_DIR for interfaces.sh. logging.sh uses NR_UTILS_DIR to locate colors.sh. A test checks that module sourcing does not change SCRIPT_DIR.
Collect diagnostic results
src/main.sh, src/diagnostics/connectivity.sh, src/diagnostics/interfaces.sh, tests/run-tests.sh
run_all_diagnostics records non-zero diagnostic statuses instead of exiting before collecting them. Duplicate-IP detection handles an unset map entry, and the MTU probe quotes its ping argument. The safe-mode test checks one captured command result and the diagnostic summary.
Update repair notes and shell checks
src/repairs/routing.sh, src/utils/privileges.sh, tests/test-utils.sh
Repair routing comments describe documented outcomes and conditions. The require_root EXIT trap defers expansion of SUDO_KEEPER_PID. Colour tests check variable definition and disabled-colour values.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 4270e

Sourced modules no longer overwrite the caller's SCRIPT_DIR, so path resolution is fixed. Nothing actionable blocks merge.

Security architecture risk: 🟡 Moderate · up to 4270e

Restoring CLI execution exposes two existing control gaps: repeated repairs can leave sudo-refresh workers running after exit, and dry-run repairs can change host networking. Both require a local invocation with sufficient sudo or root authority; no unauthenticated remote privilege bypass is established.

Retained concerns

  • Medium · security · inferred: The restored CLI exposes repeated credential-worker creation without corresponding ownership of every worker. For example, --apply-fixes repair-network calls require_root in repair_interfaces and again in repair_down_interfaces. Each successful non-root call starts another sudo-refresh loop and replaces the shared PID and EXIT trap; cleanup targets only the newest worker. Earlier workers may therefore continue refreshing the invoking user's credentials after the repair session, depending on sudo policy. The mechanism predates this PR, but the base CLI failed before dispatch. Root execution creates no keepers, and successful sudo authorization remains required.
  • Medium · security · inferred: The restored CLI also exposes a preview-to-mutation control gap. With --dry-run repair-network, require_apply_fixes permits execution without APPLY_FIXES. The interface-repair flow then reaches interface_up, which executes a real privileged ip link set operation when an interface is down; neither that operation nor run_privileged enforces dry-run behavior. Thus an authorized operator requesting a preview can change host networking. This implementation predates the PR, but normal CLI reachability is restored by this change.
Security review details

Security Blast Radius

  • inferred — The demonstrated exposure is local to the invoking user's sudo credential lifecycle and the host's network interfaces. Credential reuse remains bounded by sudo policy; the inspected paths do not establish authority over other users, tenants or remote services.

Security Findings and Attack Paths

  • inferred — A successful non-root repair-network invocation reaches nested privilege requests before completing interface inspection. Multiple workers are consequently possible even without repeated CLI commands, while normal exit cleanup targets only the most recently recorded PID.
  • inferred — An authorized local operator can request --dry-run repair-network yet reach a real interface-state change. The guard treats dry-run as permission to enter repairs, but the demonstrated mutation sink does not distinguish preview from execution.

Trust Boundaries and Controls

  • observed — Default configuration disables APPLY_FIXES. The direct interface-repair command checks the shared guard, but that guard also permits DRY_RUN. Sudo authentication remains a separate authority check, and root callers skip credential-worker creation entirely.

Resilience and Maintainability Implications

  • inferred — For one successful privilege request without later PID mutation, EXIT cleanup targets its worker. Repeated requests lack equivalent ownership of earlier workers. Interruption and alternate shell execution contexts remain unvalidated; the function registers only EXIT cleanup.

Hardening Proposals

  • proposed — Give credential refresh a single, idempotent lifecycle owner, and enforce preview behavior at the privileged mutation boundary rather than relying solely on entrypoint admission.
Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly and concisely identifies the main change: sourced modules no longer overwrite the caller's SCRIPT_DIR.
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 22 functions across 15 files.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The pull request description directly explains the SCRIPT_DIR path-resolution failure, the module changes, regression tests, and reported test results. It matches the changeset.
✨ Finishing Touches
🛠️ Fix failing CI checks
  • Commit to this branch
  • Create a new PR
📝 Generate docstrings
  • 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 19, 2026 18:43
@chatgpt-codex-connector

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 ⚠️ Failed 2026-10-19T18:43:37.274698Z 8800119 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.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitai Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Add Carrot credits or activate Agent usage billing to use Autofix

@coderabbitai

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

✅ Coding Agent task started: View task and status

The task will inspect the CI failures, validate its fix, and commit the fix to this branch automatically.

Note: Fixing CI failures is a beta feature and may encounter errors. Expect some limitations and changes as we gather feedback and continue to improve it.

⏭️ Checks skipped: 2 · already failing on `main` (not caused by this PR)
  • GitHub Actions: Hypatia Security Scan / 0_hypatia _ Hypatia Neurosymbolic Analysis.txt
  • GitHub Actions: Distribution Matrix Tests / 0_Matrix Summary.txt

@hyperpolymath
hyperpolymath enabled auto-merge (squash) October 19, 2026 20:27
@coderabbitai

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

🤖 Completed: Generate docstrings for PR #79 — View commit 45da73d

coderabbitai Bot and others added 3 commits October 19, 2026 20:30
test-utils.sh now sources logging.sh and every diagnostics and repairs
module in a fresh shell, started from /, with SCRIPT_DIR preset, and
fails if any module changes it. That is the bug this PR fixes, so the
fix now has a test: on main the test fails at logging.sh.

The test is the one CodeRabbit wrote for the same bug on #78 (fa99baa),
moved here, where the fix lives.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y6FD63UrriRBHqmhhEca9t
hyperpolymath pushed a commit that referenced this pull request Oct 19, 2026
fa99baa fixed the same bug as #79 with different variable names, so
whichever PR merged second would conflict. src/ and tests/ now match
#79 at 4270e56 exactly: NR_UTILS_DIR / NR_REPAIRS_DIR in the modules,
diagnostics that report issues without tripping errexit, the safe-mode
and colour test fixes, and the module-loading regression test that
fa99baa introduced. Once #79 merges this change is a no-op.

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

hyperpolymath commented Oct 19, 2026 •

Copy link
Copy Markdown
Owner Author

CI status at 4270e56. Unit Tests, ShellCheck, Integration Tests (ubuntu 20.04/22.04/24.04, debian:12) and most distro jobs pass, with 4270e56 adding a SCRIPT_DIR regression test. Every remaining failure stops before any test runs, in a service this PR does not touch:

Check Failure Fix
scan / gitleaks, scan / shell-secrets, scan / rust-secrets, hypatia invalid lockfile pin for actions/checkout@3d3c42e…, inside the standards reusables at the old pin Waits on the estate re-pin to standards 75bd599 (owner's decision).
lint-workflows The SPDX check reads only line 1, where gh actions-lock puts its banner. The SHA-pin check rejects tag refs that actions.lock resolves. #80 (SPDX) and #81 (pinning), both copied from the template.
debian-11, Integration Tests - debian:11 bullseye-security returns 404 for every package; Debian 11 is past end of life. #82 drops debian:11.
rockylinux-9, almalinux-9 dnf refuses to replace the image's curl-minimal with curl. #82: dnf install -y --allowerasing …
opensuse-leap-15.5, opensuse-tumbleweed actions/checkout cannot find tar in the image. #82 installs tar and gzip before checkout.
Matrix Summary Aggregates the distro jobs above. Goes green with #82.

#80–#82 are workflow-only fixes, each in its own PR. Once they merge, I'll merge main into this branch. The scan and hypatia checks stay red until the standards re-pin. No job was re-run: these failures are deterministic.


Generated by Claude Code

hyperpolymath pushed a commit that referenced this pull request Oct 20, 2026
CodeRabbit's CI-fix agent ported its own version of the SCRIPT_DIR fix
into this PR. #79 is that fix, and the owner's order lands #79 first and
keeps each PR to its own change rather than cross-porting. The port uses
different variable names and tests from #79, so it would conflict with
#79 in fourteen files once #79 merges. Its tests cover #79's change, not
this one. This PR stays the distro install fix. Its jobs go green once #79
is in main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y6FD63UrriRBHqmhhEca9t
@hyperpolymath
hyperpolymath merged commit 1e05887 into main Oct 20, 2026
28 of 40 checks passed
@hyperpolymath
hyperpolymath deleted the claude/new-session-ywdrth-scriptdir branch October 20, 2026 12:35
@sonarqubecloud

Copy link
Copy Markdown

hyperpolymath added a commit that referenced this pull request Oct 20, 2026
## Why

Five distro jobs fail before any test runs, on main and on every PR. The
failures are listed on #79.

## What

| Job | Failure | Fix |
|---|---|---|
| `debian-11`, `Integration Tests - debian:11` | `bullseye-security`
returns 404 for every package; Debian 11 is past end of life. | Removed
from both workflow matrices, `tests/distro-matrix.json` and
`tests/run-container-tests.sh`. `debian:12` stays. |
| `rockylinux-9`, `almalinux-9` | `dnf` will not replace the image's
`curl-minimal` with `curl`. | `dnf install -y --allowerasing …`, in the
workflow and in the local runner's install line. |
| `opensuse-leap-15.5`, `opensuse-tumbleweed` | `actions/checkout`
cannot find `tar` in the image. | A step before checkout runs `zypper
--non-interactive install tar gzip`. |

`Matrix Summary` aggregates these jobs and should go green once they do.

No action refs change, so `actions.lock` is untouched.

## Tested

- The edited workflows parse with yq. The `tar` step is the first step
of the openSUSE job, and both matrices now end at `debian:12`.
- `tests/distro-matrix.json` parses with jq. `run-container-tests.sh`
passes `bash -n`. Its one `shellcheck -S warning` hit (SC2207, line 280)
was already there before this PR.
- This session had no container runtime, so the jobs themselves were not
run locally; this PR's CI run is the test.

`CLAUDE.md` still lists "Debian 11, 12" among the system-test targets.
It is the repository's own instruction file, so it is left for the owner
to edit.

---
_Generated by [Claude
Code](https://claude.ai/code/session_01Y6FD63UrriRBHqmhhEca9t)_

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
hyperpolymath added a commit that referenced this pull request Oct 20, 2026
## Why

Workflow Security Linter's "Check SHA-Pinned Actions" step requires an
inline 40-hex SHA on every `uses:` line. This repository pins its
actions with tag refs that `actions.lock` resolves, so the step rejects
every one of them. That keeps the linter red on main whatever else it
finds. This is the second failing step, after the SPDX check that #80
fixes.

## What

- The step now runs `scripts/check-action-pinning.js`, copied unchanged
from rsr-template-repo (ec33724). A ref passes when it is an inline SHA
or when `actions.lock` resolves it.
- The script runs under Bun 1.4.2, the estate pin. A new "Install
verified Bun 1.4.2" step downloads it from the release archive and
checks its sha256, as hyperpolymath/rsr-template-repo#249 now does in
the template.
- bf2a196 first used the template's `oven-sh/setup-bun@v2.2.0` with
`bun-version: latest`. SonarCloud failed this PR on that tag-pinned
third-party action ("C Security Rating"), and the runtime was unpinned.
9d13eba replaces it, on the owner's call.
  - `actions.lock` is unchanged from main.
- One change from the template: the example in the error message now
labels `actions/checkout@3d3c42e…` as v7.0.1, which is what this
repository's lock records. The template says v6.0.1.

## Tested

- The script passes on this branch's workflows: "all action refs are
pinned".
- It fails on a planted `uses: some-org/unlocked-action@v1`.
- I extracted the Bun step from the workflow and ran it with a scratch
`RUNNER_TEMP` whose path contains a space. The checksum printed `OK` and
`bun --version` prints `1.4.2`.
- standards' `validate-actions-lock.sh` (75bd599) passes on the lock.

## Merge order

The owner's order is #79 → #82 → #80 → #81 → #78. This PR and #80 change
different steps of the same workflow, so they don't conflict. The linter
goes fully green only once both are in. scan and hypatia also need the
estate re-pin to standards `75bd599`.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01Y6FD63UrriRBHqmhhEca9t

---------

Co-authored-by: Claude <noreply@anthropic.com>
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