chore(audit): sweep alias/exception tables for rot - entries that mask defects instead of recording divergence #303
Labels
No labels
breaking
bug
documentation
enhancement
epic
good first issue
help wanted
refactoring
resolution/duplicate
resolution/invalid
resolution/wontfix
security
severity/critical
severity/high
severity/low
severity/medium
status/abandoned
status/blocked
status/needs-decision
status/needs-info
status/needs-verification
testing
upstream
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
sixfold-space/madtea#303
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Follow-up to #291, generalizing its root pattern. Deferred by owner direction (2026-07-20): file now, sweep in a later pass.
The pattern
#291's collision was invisible partly because a parity alias was papering over it:
cliCanonicalAliasesmappedactions/artifacts -> actions/run-artifacts, so the parity suite saw a satisfied mapping while the actual CLI carried two collidingartifactscommands and the per-run one was unreachable. The alias recorded what the surface was SUPPOSED to look like, and its existence silenced the very check that should have caught the drift. When PR #302 fixed the collision, the alias was already dead weight.That is a class, not an instance: any alias table, exception list, or divergence-recording map can rot from "documenting a legitimate divergence" into "masking a defect" - and these tables are precisely the places drift guards are told not to look.
The sweep
Audit every such table for entries that are dead (target or source no longer exists), self-satisfied (the divergence they record has since been fixed, so the entry now maps a live name onto a live name and could hide a future collision), or masking (the entry exists because a defect was papered over rather than fixed). Known tables to start from - the sweep should enumerate exhaustively rather than trust this list:
cliCanonicalAliasesand any sibling maps ininternal/parity/endpointSuggestionsininternal/service/api/suggestions.go(suggestions pointing at renamed/removed commands)hooks/that name specific commands or pathsAcceptance
Sweep record, so the audit is repeatable.
Method: read every table, crawled the full CLI command tree (516 leaves), mechanically checked every alias/override source and target against it; parity suite green throughout.
Classification - the four canonicalization maps in internal/parity/parity.go (the unguarded corner):
package -> packagesDEAD (nopackagecommand exists - the noun is already plural; remap unreachable, removed)The
actions/artifacts -> actions/run-artifactsalias that motivated this issue was already removed by hand in the collision-guard commit - which is exactly the problem: nothing FORCED that removal.Every guarded allowlist is healthy: IntentionalCLIOnly/MCPOnly, gated domains, KnownGaps, safetyWithheldKeys, routing/diag/cli-after-cd/mutation/side-effect allowlists, ownerRepoNoOpSites, getConfigForDirSites - all bidirectionally machine-locked already (the ...AreUsed / ...PinnedSites pattern). endpointSuggestions is machine-validated by suggestion_drift.go - the model the alias maps needed. Hook scripts' tool references: all name live tools (no reverse existence-guard exists; noted below). MASKING entries found: zero.
Fix landed: alias_staleness_test.go adds the missing guards - source-liveness (would have forced the artifacts removal), target-resolution, domain-head liveness, override-prefix liveness, and the MCP-side mirror - each with a planted-violation subtest so a refactor cannot neuter it. One subtlety: liveness walks the cobra tree INCLUDING hidden commands (
madtea apiis hidden by design and its alias is live).Flagged, not decided here: (1)
packagesbeing plural while its command siblings are singular is a naming question, separate from the dead-alias removal; (2) madt_* names written inside hooks/*.sh have no existence guard (routing drift reads them as a corpus only) - same rot class one layer out, all currently live, low priority.