Skip to content

chore(audit): close 3 governance debt items from 2026-05-07 audit#553

Merged
neuron7xLab merged 2 commits intoneuron7xLab:mainfrom
neuron7x:debt-audit-cleanup-2026-05-07
May 7, 2026
Merged

chore(audit): close 3 governance debt items from 2026-05-07 audit#553
neuron7xLab merged 2 commits intoneuron7xLab:mainfrom
neuron7x:debt-audit-cleanup-2026-05-07

Conversation

@neuron7x
Copy link
Copy Markdown
Contributor

@neuron7x neuron7x commented May 7, 2026

Closes 3 contradictions surfaced by the codebase audit run after PRs #551 + #552:

  1. README invariant-count drift — badges + headline table claimed 87, registry returns 90, body prose already said 90.
  2. commit-acceptor-gate.yml self-contradiction — gate that enforces SHA-pinning used floating @v6 tags itself.
  3. Latency-budget test isolation — module-level os.environ mutations from PR feat(api): IERD-Q6 Phase-4 entry — server_compute latency budget gate #550 leaked across session, breaking downstream metrics-expectations test (3/6 → 6/6 after fix).

See commit message for details. mypy --strict + ruff clean. validator exit 0.

…audit

After the IERD-Q4 Phase-3 EXIT (PR neuron7xLab#551) and typed governance models
(PR neuron7xLab#552) landed, an audit across docs/CLAIMS.yaml, every
.claude/commit_acceptors/*.yaml, and the .github/workflows tree
surfaced three concrete contradictions. This PR closes them.

1. README invariant-count drift
-------------------------------
* README.md:12  badge invariants-87  → invariants-90
* README.md:35  badge physics_gate-87_invariants → 90_invariants
* README.md:175 table "87 in INVARIANTS.yaml" → "90 in INVARIANTS.yaml"

`python scripts/count_invariants.py` is authoritative — returns 90.
The body prose at lines 24/148/781 already said 90; the badges and
the headline table were stale. CI gate `invariant-count-sync` did
not catch the drift because shields-style markdown badges sit
outside the regex it audits.

2. commit-acceptor-gate.yml self-contradiction
----------------------------------------------
The workflow that enforces architectural-boundary contracts
(forbidden imports, diff-bound acceptors, claim_type caps) used
floating action tags:

  - actions/checkout@v6
  - actions/setup-python@v6

while every other workflow pins by 40-char SHA. The repo-policy
gate explicitly checks that all third-party actions are pinned.
Repinned both to the canonical SHAs already used elsewhere
(de0fac2e... v6.0.2, a309ff8b... v6) so the gate now follows the
discipline it prescribes.

3. Latency-budget test isolation regression
-------------------------------------------
The PR neuron7xLab#550 implementation set five env vars at module import time
(four `os.environ.setdefault` + one unconditional
`os.environ["GEOSYNC_DISABLE_METRICS"] = "1"`). Pytest collects the
module before fixtures run, so those mutations leaked across the
session boundary, polluting downstream test modules.

Refactor: env-var window is now bounded to the lifetime of the
module-scoped `client` fixture, which snapshots → applies overrides →
yields → restores. `create_app` is imported lazily through
`importlib` inside the same window so settings (Pydantic, env-driven)
resolve under the overrides, not under whatever leaked from upstream
test modules.

Co-running this test with tests/observability/test_metrics_expectations.py
now passes 6/6 (was 3/6 before the fix).

Local verification
------------------
mypy --strict + ruff: clean on the touched test
pytest tests/api/test_latency_budget_server_compute.py
       tests/observability/test_metrics_expectations.py -q: 6/6 pass
python scripts/count_invariants.py: 90
commit_acceptor validator: exit 0

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@neuron7x neuron7x requested a review from neuron7xLab as a code owner May 7, 2026 11:43
detect-secrets flags the literal strings 'audit_secret' and
'rbac_secret' in the new _REQUIRED_ENV dict (same keyword-detector
pattern as in the workflow YAML, where the inline pragma is already
applied). The values are non-real test fixtures.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@neuron7xLab neuron7xLab merged commit f6fc648 into neuron7xLab:main May 7, 2026
20 checks passed
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