Skip to content

fix(post-compaction-audit): RegExp .source leaks raw regex syntax in audit warning #22339

@bzanghi

Description

@bzanghi

When the post-compaction audit fires for a missing regex entry, the warning displays raw .source output instead of a readable pattern.

Actual: memory\/\d{4}-\d{2}-\d{2}\.md
Expected: memory/YYYY-MM-DD.md

Root cause: missingPatterns.push(required.source) in post-compaction-audit.ts. In practice the raw regex escapes caused the audit message to be mistaken for a prompt injection attempt.

Suggested fix: derive a readable label from the pattern or add an optional label field to DEFAULT_REQUIRED_READS entries.

Related: #21957 / PR #22124. WORKFLOW_AUTO.md is covered there — this is a separate display-only bug

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions