Skip to content

Mechanical fixes from second audit pass - #59

Merged
orda-aska merged 1 commit into
mainfrom
audit/pass2-mechanical-fixes
Oct 18, 2026
Merged

orda-aska merged 1 commit into
mainfrom
audit/pass2-mechanical-fixes

Conversation

@ahrazzle

Copy link
Copy Markdown
Contributor

Mechanical fixes from a second audit pass, now against aska-digital/ion. Re-applies the still-valid fixes from the earlier mimar audit that the rename did not carry over, plus one extension. Each one has a test that fails without it.

Changes

ion/approve/core.py (evaluate): quorum now counts approvers by lowercased actor. A bus seat Ada and a GitHub login ada previously counted as two approvers toward quorum. Relates to #27.

ion/execute/base.py (safe_push): every refspec destination is checked against the default branch and the ion/ prefix, not just the last. The broker only sees the last refspec's branch, so git push origin docs:refs/heads/docs ion/x:refs/heads/ion/x would previously have pushed docs as well.

ion/approve/bus.py (sync_bus): a bus envelope with seq: null no longer crashes the sync with int(None).

ion/config.py: policy.branch_protection settings are validated at load (require_pr boolean, required_approvals integer >= 0, and the rest). A typo like required_approvals: "many" previously crashed mid-run inside lowers_protection.

ion/analyze/policy.py: a private repo on a paid plan now gets a secret-scanning finding of unknown instead of no finding at all. The conditional-expression-as-statement only recorded blocked_by_plan on the free plan and silently skipped the rest.

ion/collect/github.py: the collaborators field is dropped from the GraphQL query and from normalise. Nothing in the codebase reads it, so it was paying query cost against the API budget on every page for dead data.

ion/collect/github.py (fetch_security_extras): a failed REST read now logs a warning with the repo name before returning None. Previously a persistent 403 or rate limit degraded to secret_scanning: "unknown" with no diagnostic anywhere.

ion/fleet.py (preview): the preview workdir is removed in a finally block. A fixer that raised mid-loop previously leaked full repo clones under the work directory.

Validation

pytest -q: 246 passed (239 existing, 7 new). Each new test was re-run with its fix reverted to confirm it fails. scripts/check_licenses.py: 0 not allowed.

Automated posting by agentic team with human oversight.

…icy fidelity, and resource hygiene

Second audit pass (aska-digital/ion). Re-applies the still-valid fixes from
the mimar audit that the rename did not carry over, plus one extension:

- approve/core: count quorum actors case-insensitively so one identity cannot
  approve twice through case variants (relates to #27).
- execute/base: validate every push refspec destination against the default
  branch and the ion/ prefix, not just the last; the broker only sees the
  last refspec's branch.
- approve/bus: accept sync envelopes with seq null instead of crashing.
- config: validate policy.branch_protection types at load instead of crashing
  mid-run.
- analyze/policy: record unknown (not silence) for secret_scanning on private
  repos under a paid plan.
- collect/github: drop the collaborators field from the GraphQL query and
  normalise; nothing consumes it.
- collect/github: log a warning when the security-extras REST read fails
  instead of degrading silently.
- fleet: clean the preview workdir in a finally block so a failing fixer does
  not leak full clones.

Each fix carries a regression test that fails with the fix reverted.
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