Skip to content

An [override.<id>] table narrows where an inherited rule reads without restating its regexp or message - #204

Merged
HackingGate merged 1 commit into
mainfrom
an-override-table-narrows-an-inherited-rules-files-without-restating-it
Sep 20, 2026
Merged

HackingGate merged 1 commit into
mainfrom
an-override-table-narrows-an-inherited-rules-files-without-restating-it

Conversation

@HackingGate

Copy link
Copy Markdown
Owner

A policy file may write [override.<id>] carrying files.include,
files.exclude and files.glob. The loader keeps the inherited rule
whole -- check, message and provenance -- and replaces only the files
keys the table names, so a field it does not name keeps the set's value
and a tightening the set ships later reaches the narrowed rule on the
next pin bump. The one spelling before this was an own [rule.<id>],
which replaces the inherited rule whole and so restates the set's
regexp and message byte for byte, with nothing to report when the copy
stops being current.

The table is read from the raw TOML rather than through a serde struct,
so every refusal names the section and lists the three keys it may
carry: an override carrying any other key, an override of an id nothing
inherited defines or that inherit.disabled_rules drops, and an
override beside an own [rule.<id>] of the same id are each refused at
load. An [override] in a bundled set or an inherit.paths file is
refused too, since such a file inherits nothing. The shadow report is
untouched: a same-id rule that changes the check is still a full rule
and still gets the note.

This repository's own no-stale-anchored-fact, a same-id copy whose
message had already drifted a sentence from the set's, becomes an
override of the set's rule carrying the four excluded paths. The
released shim on PATH cannot load a policy with the table until the
next release, which is the same window adding a set opens.

Closes #194

@coderabbitai

coderabbitai Bot commented Sep 20, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 12 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: a5040bbd-a149-429f-bc6b-3dcb4bc9c20a

📥 Commits

Reviewing files that changed from the base of the PR and between 310ebab and 39f05cf.

📒 Files selected for processing (5)
  • docs/REFERENCE.md
  • policy/principles.toml
  • src/config.rs
  • tests/scan_cli.rs
  • tests/structural_documentation.rs

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

Comment @coderabbitai help to get the list of available commands.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.47788% with 17 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.61%. Comparing base (310ebab) to head (39f05cf).

Files with missing lines Patch % Lines
src/config.rs 92.47% 17 Missing ⚠️

❌ Your patch status has failed because the patch coverage (92.47%) is below the target coverage (100.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #204      +/-   ##
==========================================
- Coverage   93.63%   93.61%   -0.02%     
==========================================
  Files          44       44              
  Lines       17057    17283     +226     
==========================================
+ Hits        15971    16180     +209     
- Misses       1086     1103      +17     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@HackingGate
HackingGate merged commit 15abd0c into main Sep 20, 2026
20 of 21 checks passed
@HackingGate
HackingGate deleted the an-override-table-narrows-an-inherited-rules-files-without-restating-it branch September 20, 2026 07:09
HackingGate added a commit that referenced this pull request Sep 20, 2026
…out restating its regexp or message (#204)

A policy file may write `[override.<id>]` carrying `files.include`,
`files.exclude` and `files.glob`. The loader keeps the inherited rule
whole -- check, message and provenance -- and replaces only the `files`
keys the table names, so a field it does not name keeps the set's value
and a tightening the set ships later reaches the narrowed rule on the
next pin bump. The one spelling before this was an own `[rule.<id>]`,
which replaces the inherited rule whole and so restates the set's
regexp and message byte for byte, with nothing to report when the copy
stops being current.

The table is read from the raw TOML rather than through a serde struct,
so every refusal names the section and lists the three keys it may
carry: an override carrying any other key, an override of an id nothing
inherited defines or that `inherit.disabled_rules` drops, and an
override beside an own `[rule.<id>]` of the same id are each refused at
load. An `[override]` in a bundled set or an `inherit.paths` file is
refused too, since such a file inherits nothing. The shadow report is
untouched: a same-id rule that changes the check is still a full rule
and still gets the note.

This repository's own `no-stale-anchored-fact`, a same-id copy whose
message had already drifted a sentence from the set's, becomes an
override of the set's rule carrying the four excluded paths. The
released shim on PATH cannot load a policy with the table until the
next release, which is the same window adding a set opens.

Closes #194
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.

An own rule of the same id replaces the inherited one whole, so narrowing a base rule's files means restating its regexp and message

2 participants