Skip to content

fix(go): give vulnerability scans bounded swap headroom - #950

Merged
devantler merged 2 commits into
mainfrom
codex/scanner-swap-671-e29e
Nov 16, 2026
Merged

devantler merged 2 commits into
mainfrom
codex/scanner-swap-671-e29e

Conversation

@devantler

Copy link
Copy Markdown
Contributor

🤖 Generated by the Agentic Engineer

Why

Repeated runner interruptions leave KSail's security validation unfinished and hold up delivery. Successful scans already approach the runner's memory ceiling.

What

Give the scanner bounded temporary swap headroom and verify its cleanup. Security findings still fail validation; hosted proof and KSail adoption remain required before this can count as a repair.

Part of #671

Prepare and verify an owned 4 GiB swap file before symbol analysis, retain the existing deadlines and finding gate, and retire only the owned file afterward. Add refusal controls and native Linux activation proof. Part of #671; historical runner-loss attribution remains open.
@github-code-quality

github-code-quality Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Code coverage overview

Languages: Go, C#

Go / code-coverage/test

main 684b506 codex/scanner-swap-6... c143acd +/-
50% 50% 0%

C# / code-coverage/dotnet

main 684b506 codex/scanner-swap-6... c143acd +/-
100% 100% 0%

Go / code-coverage/go

main 684b506 codex/scanner-swap-6... c143acd +/-
50% 50% 0%

ℹ️ Calculations represent line coverage. Results may change as calculations are updated.


Updated November 16, 2026 03:23 UTC

@devantler

Copy link
Copy Markdown
Contributor Author

🤖 Generated by the Agentic Engineer

Validation at c382dc40776fb3028e2879f6c04c62e4a3bf507f:

  • RED: the new control failed because the scanner had no swap preparation. GREEN: the actual workflow shells prepare/read back/clean their owned file; allocation, formatting, activation, readback and insufficient-disk failures reject successful preparation. The native Linux CI arm additionally verifies real kernel activation, size, private mode and cleanup.
  • Local pass: all 15 repository baseline checks and the manifest render; strict/allowlisted scanner verdict and operational-error controls; Go memory controls; generated read-only workflow parity; instruction layout; ShellCheck on the new test and each production shell separately; YAML parsing; Zizmor with the repository configuration.
  • Local limitations: the existing timeout retry fixture cannot find its Linux-style script process name on macOS. Installed actionlint rejects the already-used native $/ references and job workflow context fields. Those checks remain enabled in hosted CI. No compatibility suppression or security gate changed.
  • The ordinary workflow call sites found on current default branches are KSail, Platform, Go template, Bookkeeper and this catalogue. Their inputs are unchanged. The local full consumer census remains incomplete for unpopulated submodules; the published change requires current consumer validation before adoption.

Correctness and simplification review found no further issue. The scan mode, finding evaluator, 24-minute attempts, timeout-only retry and 60-minute job ceiling remain unchanged. CI is still running, so no external review is requested yet and this remains draft. Native setup success alone will not prove the KSail runner interruption repaired or attribute historical losses; #671 stays open.

Use the raw byte-sized swapon table for the native kernel assertion. The runner does not support JSON output. Part of #950.

devantler commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 Generated by the Agentic Engineer

Fixed the native test at c143acd52f5183bc692722fc35d97769bfe861d4. The preceding CI run activated the owned 4 GiB swap file and executed cleanup, but its size assertion failed because swapon does not support --json. The assertion now reads the documented byte-sized raw table and still checks the exact owned path and minimum size. Upstream command reference.

Local validation passed: swap lifecycle and failure controls, ShellCheck, scanner memory controls, timeout and immutable scanner wiring checks, manifest rendering, all 15 repository baseline checks, and diff whitespace checks.

Hosted proof now passed at this head: CI run 43797444530, native job 133069550714 verified real kernel activation, size, private mode and cleanup. All observed checks are settled without failures, and CodeRabbit completed a finding-free review of this exact head.

This remains draft: final required-gate verification is incomplete. #671 stays open for bounded interruption attribution; native swap setup proof does not establish the cause of historical runner losses or consumer adoption.

@devantler

Copy link
Copy Markdown
Contributor Author

🤖 Generated by the Agentic Engineer

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Nov 16, 2026

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Both govulncheck workflows now check for at least 8 GiB of available disk, prepare and activate a 4 GiB swap file, and disable and remove it during cleanup. Their comments describe GOMEMLIMIT as a soft target and update the job timeout budget. A Bash test checks setup, cleanup, and failure cases, and CI runs simulated and native-kernel checks.

Possibly related issues

Possibly related PRs

  • devantler-tech/.github#946 — Both changes address interrupted govulncheck scans on hosted runners; this PR adds swap headroom, while #946 adds resource sampling and preserves scanner failure status.
Merge Risk: Minimal · up to c143a

The change adds a bounded temporary swap file to the vulnerability-scan workflows and cleans it up afterward. No concrete merge-blocking risk was found. Hosted CI should still confirm the native swap checks before merging.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: bounded swap headroom for Go vulnerability scans, with the conventional-commit prefix. It is specific and matches the summarized changes to the workflows and the swap …
Description check Passed The description states the purpose (repeated runner interruptions, memory ceiling) and the change (bounded temporary swap with verified cleanup). It is related to the changeset, so the lenient check p…
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.
Full details: Title check

Explanation

The title names the main change: bounded swap headroom for Go vulnerability scans, with the conventional-commit prefix. It is specific and matches the summarized changes to the workflows and the swap test script.

Full details: Description check

Explanation

The description states the purpose (repeated runner interruptions, memory ceiling) and the change (bounded temporary swap with verified cleanup). It is related to the changeset, so the lenient check passes.

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

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 684b506 and c143acd.

Files selected for processing: 4

  • .github/tests/test-go-analysis-swap.sh
  • .github/workflows/ci.yaml
  • .github/workflows/validate-go-project-readonly.yaml
  • .github/workflows/validate-go-project.yaml

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

Additional context used

Code guidelines: 2

actions/CONTRIBUTING.md — auto-discovered
CONTRIBUTING.md — auto-discovered
Path-based instructions: 3

Applicability reference: AGENTS.md: # AGENTS.md — devantler-tech/.github (GitHub-as-code) Full detail in [actions/CONTRIBUTING.md](actions/CONTRIBUTING.md).

CodeRabbit inference engine (actions/CONTRIBUTING.md)

Files:

  • .github/tests/test-go-analysis-swap.sh
  • .github/workflows/ci.yaml
Applicability reference: AGENTS.md: # AGENTS.md — devantler-tech/.github (GitHub-as-code) Full detail in [actions/CONTRIBUTING.md](actions/CONTRIBUTING.md).

CodeRabbit inference engine (actions/CONTRIBUTING.md)

Files:

  • .github/workflows/ci.yaml
Applicability reference: AGENTS.md: # AGENTS.md — devantler-tech/.github (GitHub-as-code) Three things share one repo: **The org's public profile** — `profile/README.md` (rendered on the org page), plus the org-wide community health files i...

CodeRabbit inference engine (CONTRIBUTING.md)

Files:

  • .github/tests/test-go-analysis-swap.sh
  • .github/workflows/ci.yaml
  • .github/workflows/validate-go-project-readonly.yaml
  • .github/workflows/validate-go-project.yaml

Copy link
Copy Markdown
Contributor Author

🤖 Generated by the Agentic Engineer

Revalidated c143acd52f5183bc692722fc35d97769bfe861d4 for promotion and protected merge. All 240 check observations are success/skipped, all readable required checks and workflows pass, both commits are verified, there are no unresolved threads or inline findings, and the exact-head CodeRabbit summary classifies GREEN. No newer human requirement or active foreign work signal was found.

As a workflow user, I read CI run 43797444530, native job 133069550714 at this exact head and its filtered output: the real Linux kernel activated the owned swap, verified its private mode, and retired it; preparation failures and insufficient disk were rejected. This demonstrates the swap lifecycle. It does not establish historical runner-loss causality or an affected-consumer scan.

The only unobservable gate is code_quality setup=configured; its analysis has no readable per-head surface. Per the merge policy, the protected merge API will decide that rule. #671 remains open for consumer acceptance and interruption attribution.

@devantler
devantler marked this pull request as ready for review November 16, 2026 05:21
@devantler
devantler merged commit d70d506 into main Nov 16, 2026
241 checks passed
@devantler
devantler deleted the codex/scanner-swap-671-e29e branch November 16, 2026 05:21
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