audit: find every concern with more than one implementation, and every bypass of an existing chokepoint #834

Open
opened 2026-10-20 03:29:52 +00:00 by hexajon · 0 comments
Owner

I keep finding the same defect one instance at a time. One concern has several independent implementations and no single owner, so a check added in one place does not reach the others, and a new caller picks whichever copy is nearest. Each instance so far was found by accident, after it caused a bug:

  • ADR 0018: severity prints scattered across call sites, consolidated into internal/diag.
  • ADR 0049: three HTTP clients built independently, only one with the transport policy, consolidated into internal/httpx.
  • ADR 0056: five git run helpers, each with its own output disposition, to consolidate into internal/gitexec (#808).
  • #527: 17 Run* variants in internal/git.
  • #833: five git push calls that skip the guarded Writer.

I want one sweep that finds the rest, not a sixth surprise.

Scope

  1. Every existing chokepoint: the write guard (internal/service guard and the Writer), internal/httpx, internal/diag, internal/gitexec, internal/safeio, the forge client constructors, and the shared identifier and staging helpers. For each one, find every production call path that does the same job without going through it.
  2. Every concern with no chokepoint yet that has two or more implementations: for example config and credential reads, forge URL and repo resolution, refusal text, ref validation, JSON output, and pagination.

Acceptance criteria

  • Each chokepoint in scope 1 has a parity test that fails on a bypass, or an issue that tracks the missing test.
  • Each bypass found is filed as its own issue, linked to this one as a dependency.
  • Each duplicated concern found in scope 2 is filed as its own issue, linked to this one, naming every copy by file and line.
  • This issue closes with a comment that lists every chokepoint checked, every finding, and the issue for each finding.
I keep finding the same defect one instance at a time. One concern has several independent implementations and no single owner, so a check added in one place does not reach the others, and a new caller picks whichever copy is nearest. Each instance so far was found by accident, after it caused a bug: - ADR 0018: severity prints scattered across call sites, consolidated into `internal/diag`. - ADR 0049: three HTTP clients built independently, only one with the transport policy, consolidated into `internal/httpx`. - ADR 0056: five git run helpers, each with its own output disposition, to consolidate into `internal/gitexec` (#808). - #527: 17 `Run*` variants in `internal/git`. - #833: five `git push` calls that skip the guarded Writer. I want one sweep that finds the rest, not a sixth surprise. ## Scope 1. Every existing chokepoint: the write guard (`internal/service` guard and the Writer), `internal/httpx`, `internal/diag`, `internal/gitexec`, `internal/safeio`, the forge client constructors, and the shared identifier and staging helpers. For each one, find every production call path that does the same job without going through it. 2. Every concern with no chokepoint yet that has two or more implementations: for example config and credential reads, forge URL and repo resolution, refusal text, ref validation, JSON output, and pagination. ## Acceptance criteria - Each chokepoint in scope 1 has a parity test that fails on a bypass, or an issue that tracks the missing test. - Each bypass found is filed as its own issue, linked to this one as a dependency. - Each duplicated concern found in scope 2 is filed as its own issue, linked to this one, naming every copy by file and line. - This issue closes with a comment that lists every chokepoint checked, every finding, and the issue for each finding.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
sixfold-space/madtea#834
No description provided.