Context
Discovered during implementation of arch-check suppression (issue #23 / PR from branch archon/task-feat-issue-23-arch-check-suppression).
Description
_parse_suppressions() accepts any string for policy with no validation against known policy names. A typo like policy = "import_cycle" (missing trailing s) will silently load, never match any violation, and surface only as a stale suppression warning at runtime — requiring a full arch-check run to catch.
This is intentional for custom policies (which have arbitrary names), but built-in policy names are a closed set: import_cycles, cross_package, layer_bypass, coupling_ceiling, orphan_detection.
Suggested approach
In _parse_suppressions(), after loading policy, check if it matches a built-in name or any [[custom]] policy name defined in the same config. If it matches neither, emit an ArchConfigError with a "did you mean X?" suggestion (using difflib.get_close_matches). This catches typos at config-load time rather than waiting for a stale warning at run time.
Custom policy names are available from config.custom at the call site; threading them in is straightforward.
Context
Discovered during implementation of arch-check suppression (issue #23 / PR from branch
archon/task-feat-issue-23-arch-check-suppression).Description
_parse_suppressions()accepts any string forpolicywith no validation against known policy names. A typo likepolicy = "import_cycle"(missing trailings) will silently load, never match any violation, and surface only as a stale suppression warning at runtime — requiring a fullarch-checkrun to catch.This is intentional for custom policies (which have arbitrary names), but built-in policy names are a closed set:
import_cycles,cross_package,layer_bypass,coupling_ceiling,orphan_detection.Suggested approach
In
_parse_suppressions(), after loadingpolicy, check if it matches a built-in name or any[[custom]]policy name defined in the same config. If it matches neither, emit anArchConfigErrorwith a "did you mean X?" suggestion (usingdifflib.get_close_matches). This catches typos at config-load time rather than waiting for a stale warning at run time.Custom policy names are available from
config.customat the call site; threading them in is straightforward.