Skip to content

fix(policies): warn about enabledPolicies names that match no policy - #1021

Open
Dx-Alz-xD wants to merge 1 commit into
FailproofAI:mainfrom
Dx-Alz-xD:fix/998-unknown-enabled-policies
Open

Dx-Alz-xD wants to merge 1 commit into
FailproofAI:mainfrom
Dx-Alz-xD:fix/998-unknown-enabled-policies

Conversation

@Dx-Alz-xD

@Dx-Alz-xD Dx-Alz-xD commented Nov 17, 2026 •

Copy link
Copy Markdown

With no regex pack installed, enabledPolicies still decides which built-in policies register, and registerBuiltinPolicies drops a name it does not know without a word. failproofai policies now shows an attention line naming such entries and sends enabled_policies_validation_warning, the same way it already handles unknown policyParams keys. It stays quiet once a regex pack is installed, since nothing reads the key then.

The BUILT IN count also includes the failproofai/ spelling, which the hook path already registered.

Part of #998.

Description

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Documentation

Checklist

  • npm run lint passes
  • npx tsc --noEmit passes
  • npm run test:run passes
  • npm run build succeeds

Summary by CodeRabbit

  • Bug Fixes
    • Added a warning when enabledPolicies contains names that do not match a built-in policy, helping you identify unrecognized entries.
    • Recognized policy names are handled consistently, including names with the failproofai/ prefix.
    • Policy-name validation and legacy built-in policy listing are skipped when a regex pack is installed.

With no regex pack installed, enabledPolicies still decides which built-in
policies register, and registerBuiltinPolicies drops a name it does not know
without a word. `failproofai policies` now shows an attention line naming
such entries and sends enabled_policies_validation_warning, the same way it
already handles unknown policyParams keys. It stays quiet once a regex pack
is installed, since nothing reads the key then.

The BUILT IN count also includes the failproofai/<name> spelling, which the
hook path already registered.

Part of FailproofAI#998.
@github-actions

Copy link
Copy Markdown
Contributor

Thanks @Dx-Alz-xD for your contribution to Failproof AI! 🙌

We'd love to discuss your PR and welcome you to our community.

Discord: https://discord.befailproof.ai/
Reddit: https://www.reddit.com/r/failproofai/

@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The policy listing now checks enabled policy names against built-in names when no regex pack is installed. It reports unknown names in an attention message and validation-warning telemetry. Normalized aliases are recognized. Tests and the changelog cover the behavior.

Changes: Enabled policy warnings

Layer / File(s) Summary
Validate and report enabled policy names
src/hooks/manager.ts, __tests__/hooks/policies-listing.test.ts, __tests__/hooks/new-telemetry.test.ts, CHANGELOG.md
The manager checks normalized names while the legacy migration shim is active. It reports unknown names in an attention message and telemetry, and recognizes normalized built-in names. Tests cover unknown names, qualified aliases, and the installed-pack case. The changelog describes the release entry.

Estimated code review effort: 2 (Simple) | ~12 minutes

Change: Bug fix

Possibly related issues

Suggested reviewers: chhhee10

Merge Risk: Minimal · up to df9d7

The policy listing now warns about enabledPolicies names that match no policy, a display and telemetry change with limited blast radius. No merge-blocking risk was identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: the PR makes failproofai warn when enabledPolicies entries match no policy. The title is specific and matches the changeset, which adds the attention line, the enabled…
Description check Passed The description explains the problem and the fix. It says that with no regex pack installed, unknown enabledPolicies names are dropped silently. It states that the policies command now shows an attent…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: the PR makes failproofai warn when enabledPolicies entries match no policy. The title is specific and matches the changeset, which adds the attention line, the enabled_policies_validation_warning telemetry, and the related tests in manager.ts and the policies listing.

Full details: Description check

Explanation

The description explains the problem and the fix. It says that with no regex pack installed, unknown enabledPolicies names are dropped silently. It states that the policies command now shows an attention line and sends enabled_policies_validation_warning. It notes the quiet behavior when a regex pack is installed, and it describes the failproofai/<name> count change. It keeps the template sections, marks the type as Bug fix, and checks all four checklist items. It does not state the policy-level test coverage, but the template does not require it.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

A rabbit checks the policy list,
Unknown names receive a gentle gist.
A known alias hops right through,
While warning notes report what’s new.
I nibble clover, pleased with the fix.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: eea9c56f-3d43-4327-9eb1-8b9a585b14eb
Commits

Reviewing files that changed from the base of the PR and between 97dc40e and df9d704.

Files selected for processing: 4

  • CHANGELOG.md
  • __tests__/hooks/new-telemetry.test.ts
  • __tests__/hooks/policies-listing.test.ts
  • src/hooks/manager.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant