Repository navigation
feat(check): .labelle-check-allow — the migration ledger - #661
Conversation
…eady assume flying-platform's packs migration carries 26 known cross-pack reads with per-phase plans (its docs literally say the reads 'stay on the labelle check allowlist until then') — but no allowlist existed, so every check run buried new violations under known ones. Entries are '<rule-slug> <path> [message-substring]': slash-normalized /-boundary path suffix match (portable across OSes), optional substring to allow one foreign name while still flagging a newly-added one, and deliberately NO line numbers (they drift; a stale ledger is worse than none). Suppression is never silent: the report counts what the allowlist ate, and entries that matched nothing get a stale warning so the ledger shrinks with the migration instead of fossilizing. Exit code follows the FILTERED count. Proven against flying-platform: 26/26 suppressed with a phase-annotated ledger, a fresh synthetic violation still fails the run — even in a file holding a needle-narrowed entry. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014pbwN1ytAa8tctZMaTMjAk
📝 WalkthroughWalkthroughThe check command now reads ChangesCheck allowlist support
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant cmdCheck
participant AllowlistFile
participant parseAllowlist
participant applyAllowlist
participant Reporter
cmdCheck->>AllowlistFile: Read .labelle-check-allow
cmdCheck->>parseAllowlist: Parse entries
cmdCheck->>applyAllowlist: Match findings
applyAllowlist-->>cmdCheck: Return kept, suppressed, stale
cmdCheck->>Reporter: Report remaining findings and stale entries
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/check_cmd.zig`:
- Around line 104-110: Move the allowlist loading, filtering, and stale-entry
reporting in the command flow before the zero-pack early return around
applyAllowlist. Ensure projects with no packs still process entries and report
unmatched allowlist entries, while returning success when filtered.kept is
empty; preserve the existing OutOfMemory propagation and unreadable-allowlist
fallback behavior.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 2c13e97f-4c6a-45a5-90f1-dd434a206125
📒 Files selected for processing (1)
src/check_cmd.zig
| const entries = loadAllowlist(arena, io, root) catch |err| switch (err) { | ||
| error.OutOfMemory => return error.OutOfMemory, | ||
| // A missing allowlist is the normal case; an unreadable one must | ||
| // not turn the lint off — run unfiltered and say nothing. | ||
| else => &.{}, | ||
| }; | ||
| const filtered = try applyAllowlist(arena, result.findings, entries); |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Process the allowlist before the zero-pack return.
Lines 97-102 return before this new flow runs. When a project has no packs, every allowlist entry matches no finding, but the command emits no stale-entry warning. Move allowlist filtering and stale reporting before that return. Preserve a successful exit when filtered.kept is empty.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/check_cmd.zig` around lines 104 - 110, Move the allowlist loading,
filtering, and stale-entry reporting in the command flow before the zero-pack
early return around applyAllowlist. Ensure projects with no packs still process
entries and report unmatched allowlist entries, while returning success when
filtered.kept is empty; preserve the existing OutOfMemory propagation and
unreadable-allowlist fallback behavior.
The flying-platform packs migration (its docs/packs-migration.md) carries 26 known cross-pack reads with per-phase retirement plans, and explicitly assumes a
labelle checkallowlist that never existed — so every run buries a NEW violation under 26 known ones, which teaches people to grep past the lint entirely.Format (
.labelle-check-allowat the project root,#comments):/-boundary suffix match — one ledger works on every OS, ands/foo.zigcan't claimpacks/foo.zig.Workerread while a newly-added foreign name still fails.Never silent: the report prints
N known finding(s) suppressed, entries that matched nothing get a stale-entry warning naming their line, and the exit code follows the filtered count.Proven live on flying-platform: 26/26 suppressed by a phase-annotated ledger; a synthetic
rooms__Bedread added to an allowlisted file still fails the run. 4 unit tests (parser, boundary/needle/stale matcher, passthrough, fixture e2e). Local failure set byte-identical to main's (the known Windows-env set).🤖 Generated with Claude Code
https://claude.ai/code/session_014pbwN1ytAa8tctZMaTMjAk
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by CodeRabbit
New Features
.labelle-check-allowfile to suppress known check findings by rule, path, and optional message text.Tests