← Back to PRs

#22494: fix(post-compaction-audit): show readable label for missing regex requirements

by Phineas1500 open 2026-02-21 07:06 View on GitHub →
size: S
## Summary - replace raw regex `.source` output in post-compaction audit warnings with human-readable labels - add label-aware required-read handling for regex entries - update tests to assert readable output (`memory/YYYY-MM-DD.md`) and cover custom labeled regex entries ## Testing - `pnpm vitest run src/auto-reply/reply/post-compaction-audit.test.ts` ## AI Transparency - [x] AI-assisted - [x] Lightly tested (targeted tests only) Fixes #22339 <!-- greptile_comment --> <h3>Greptile Summary</h3> Replaces raw regex `.source` output (e.g., `memory\/\d{4}-\d{2}-\d{2}\.md`) with human-readable labels (e.g., `memory/YYYY-MM-DD.md`) in post-compaction audit warnings. The implementation adds a new object format `{ pattern: RegExp, label?: string }` to the `RequiredRead` type, allowing explicit labels for regex patterns while maintaining backward compatibility with plain strings and RegExp values. - Introduces `resolveRequiredReadMatcher` helper to normalize three input types (string, RegExp, object) into consistent `{ matcher, label }` format - Updates `DEFAULT_REQUIRED_READS` to use the new labeled format for the memory file pattern - Adds comprehensive test coverage for custom labeled regex entries - Improves test assertions to use exact string matching instead of `.includes()` checks <h3>Confidence Score: 5/5</h3> - This PR is safe to merge with minimal risk - The changes are well-contained to a single feature (audit warning formatting), maintain backward compatibility, have comprehensive test coverage, and contain no logical errors. The implementation is clean with proper TypeScript typing and appropriate helper function extraction. - No files require special attention <sub>Last reviewed commit: 651cc21</sub> <!-- greptile_other_comments_section --> <!-- /greptile_comment -->

Most Similar PRs