fix(security): close the 32 open CodeQL alerts

Critical #60/#61 untrusted checkout: publish-containers.yml prepare runs for workflow_run only when the triggering run succeeded, was a push and came from this repository; build and merge need prepare, so the guard covers both checkouts. Mark stable commit triggers only on push of v* tags, schedule and workflow_dispatch are unchanged. Medium #55/#56: update-flake-lock.yml pins nix-installer-action v23 and update-flake-lock v29 to commit SHAs. High: secret_service_token returns only the token and raises SecretServiceUnavailable with the same reasons, _forge_access builds the token/reason pair (#62); jinja2 select_autoescape for html/htm/xml only, scaffolding output byte-identical (#29); chmod 0o755 to 0o700 for owner-run scripts in ink.py and 7 test sites; exact URL equality in a mirror probe test. Error #33: raise unittest.SkipTest from exc. Notes: empty-except to contextlib.suppress, one import form per module, unused variable, commented-out code, assertNotIn.

| 🌿 Branch | 📊 Diff stat | 🎯 Fix | 💥 Break | 💸 Tokens | ⏱️ Velocity | 🛡️ Security | 🏆 Score | Gate |
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
| fix/codeql-alerts | 28 files +92/-81 | 90 % | 3 % | – | – | 100 % | 87 | ✅ 90/5, tokens and velocity <= 100, security 100 % |

Evidence: tests/unit + tests/integration 880 passed, 574 subtests; 2 test_publish_integration failures are identical on a clone without these changes (global tag.gpgsign, sandbox blocks gpg). ruff and actionlint clean, MEDUSA 100 % critical 0 (1 accepted keyword false positive). Operator choice 7589a6f1 (swarm), operator review dcc2f461.
Created-with: https://s.veen.world/skills
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kevin Veen-BirkenbachandClaude Opus 5.5 committed 2026-11-30 20:19:21 +00:00
1 parent f529139db5
commit 0f6583ca48
28 files changed
+92 -81

No files matched your search

@@ -164,7 +164,7 @@ class TestInstalledVersionDegradation(unittest.TestCase):
self.assertIsNone(get_installed_python_version("kpmx"))
def test_non_json_nix_profile_output_falls_back_to_text_mode(self) -> None:
import pkgmgr.core.version.installed as mod
from pkgmgr.core.version import installed as mod
with (
patch.object(mod.shutil, "which", return_value="/usr/bin/nix"),
@@ -173,7 +173,7 @@ class TestInstalledVersionDegradation(unittest.TestCase):
self.assertIsNone(mod.get_installed_nix_profile_version("pkgmgr"))
def test_json_list_instead_of_object_is_tolerated(self) -> None:
import pkgmgr.core.version.installed as mod
from pkgmgr.core.version import installed as mod
# Valid JSON, wrong shape: data.get() raises AttributeError on a list.
with (
@@ -566,7 +566,7 @@ class TestReleaseFileWriteDegradation(unittest.TestCase):
self.assertIn("Could not read spec file for changelog update", buf.getvalue())
def test_unwritable_spec_changelog_is_reported(self) -> None:
import pkgmgr.actions.release.files.rpm_changelog as mod
from pkgmgr.actions.release.files import rpm_changelog as mod
path = _write(
os.path.join(self.dir, "pkg.spec"),