Problem
.github/codeql/config.yml ships a global query-filters exclude for py/unsafe-cyclic-import. The simulation triple (base.py, policy_runner.py, benchmark.py) is the only file shape in the repository that fires the rule today, but query-filters doesn't support path scoping, so the exclude is repository-wide.
The README in .github/codeql/ documents a manual six-month audit recipe to verify no new legitimate violations have been silently suppressed. A calendar-pin is a maintainer-rotation failure mode: when the maintainer who wrote the audit cadence rotates off the project, the assumption drifts silently.
Proposed fix
Add a CI step (or a workflow_dispatch job) that:
- Drops the
query-filters exclude block from .github/codeql/config.yml (in-memory only -- not committed).
- Runs the CodeQL CLI locally per the recipe in
.github/codeql/README.md:
codeql database create db --language=python --source-root=.
codeql database analyze db codeql/python-queries:Imports/UnsafeCyclicImport.ql --format=sarif-latest --output=cyclic-import.sarif
- Parses the SARIF and asserts the violating file set is exactly
{strands_robots/simulation/base.py, strands_robots/simulation/policy_runner.py, strands_robots/simulation/benchmark.py}.
- Fails the workflow with a clear diagnostic if the set has expanded -- the maintainer must either drop the suppression entirely (preferred -- fix the new cycle properly) or explicitly extend it with a documented rationale.
Acceptance criteria
Design questions to resolve in the implementing PR
- Where to install the CodeQL CLI in CI: on
ubuntu-latest via the bundled action, or via curl from the GitHub release? (The bundled action is simpler but less explicit about version pinning.)
- Runtime cost: the recipe builds a database from scratch -- estimate is 60-120s per run on the simulation triple alone. Acceptable for path-filtered PRs; the weekly cron is no concern.
- Whether to make the assertion a hard fail or a soft warning on first introduction. Hard fail is the loud-on-misconfig posture this issue exists to enforce.
- Whether the assertion should also catch removal of one of the three triple modules from the violating set (e.g. someone refactors
benchmark.py so it no longer participates in the cycle). That's not strictly a regression, but it changes the suppression's scope and deserves a docs update.
Context
Filed by autonomous agent. Strands Agents.
Problem
.github/codeql/config.ymlships a globalquery-filtersexclude forpy/unsafe-cyclic-import. The simulation triple (base.py,policy_runner.py,benchmark.py) is the only file shape in the repository that fires the rule today, butquery-filtersdoesn't support path scoping, so the exclude is repository-wide.The README in
.github/codeql/documents a manual six-month audit recipe to verify no new legitimate violations have been silently suppressed. A calendar-pin is a maintainer-rotation failure mode: when the maintainer who wrote the audit cadence rotates off the project, the assumption drifts silently.Proposed fix
Add a CI step (or a workflow_dispatch job) that:
query-filtersexclude block from.github/codeql/config.yml(in-memory only -- not committed)..github/codeql/README.md:{strands_robots/simulation/base.py, strands_robots/simulation/policy_runner.py, strands_robots/simulation/benchmark.py}.Acceptance criteria
.github/codeql/README.mdfor the override path)strands_robots/simulation/or.github/codeql/(path filter), and on a weekly cron for everything else.github/codeql/README.mdnext to the existing manual audit recipeDesign questions to resolve in the implementing PR
ubuntu-latestvia the bundled action, or viacurlfrom the GitHub release? (The bundled action is simpler but less explicit about version pinning.)benchmark.pyso it no longer participates in the cycle). That's not strictly a regression, but it changes the suppression's scope and deserves a docs update.Context
.github/codeql/README.md(added in R2 of security(codeql): suppress py/unsafe-cyclic-import on simulation triple (closes #215) #216) is the human-readable companion to this CI gate.Filed by autonomous agent. Strands Agents.