Policy violations
What a policy-violation finding of fallow dead-code means, why it matters and how to fix it.
What it reports
Usage violates a configured rule-pack policy.
Architecture explains how fallow finds it.
Why it matters
A call, import, export, catalogue-derived effect, or graph-resolved GDP proof producer violates a configured rule pack (the rulePacks config key). Packs are pure declarative data. Call rules match calls and new expressions, on written plus import-resolved canonical callees. Effect rules match calls only. Import rules match the raw specifier. GDP rules trace @gdp-ts/core proof producers through unambiguous re-exports and restrict which files may create proof factories, optionally by exact static proof kind. This is syntactic ownership analysis, not a runtime authorization guarantee. Follow the rule's message, move a producer into an allowed file, scope the rule with files/exclude globs, or adjust its severity.
Example
src/app.ts imports moment while a rule pack bans the moment specifier with the message 'Use date-fns.'
Fix
Follow the rule's message to replace banned usage or remove a banned export. For a GDP proof producer, move proof factory creation into an allowed file, or correct the rule's allowedFiles and optional proofKinds if the ownership policy was wrong. For a banned-import rule with allowNames, import a listed name by name. To waive one rule, use // fallow-ignore-next-line policy-violation:<pack>/<rule-id> or the file-level form. Use bare policy-violation only when you intend to suppress every rule-pack finding at that scope.
Facts
| Fact | Value |
|---|---|
| Issue type | policy-violation |
| Rule id in SARIF output | fallow/policy-violation |
| Command | fallow dead-code |
| Default severity | warn |
Config key in rules | policy-violation |
| Filter option | --policy-violations |
| Suppression comment | // fallow-ignore-next-line policy-violation |
Fixable with fallow fix | No |
| Opt-in | No |
Note. Requires a configured rule pack (rulePacks config).
When to keep the code
- When a rule must not apply to some folders, limit the rule with its
filesandexcludeglobs. - To keep one finding, suppress only its rule:
// fallow-ignore-next-line policy-violation:<pack>/<rule-id>. A barepolicy-violationtoken hides each rule-pack finding at that place.