Re: [PATCH v2 08/11] Documentation: kconfig-audit: Describe policy overlays
From: sashiko-bot
Date: Fri Dec 04 2026 - 17:50:26 EST
Thank you for your contribution! Sashiko AI review found 3 potential
issues to consider:
- [Medium] kconfig-audit: pattern_prio documented for overlays but
ignored in audit.py
- [Low] Documentation: kconfig-audit: Rule fields intro contradicts
overlay rules
- [Low] Documentation: kconfig-audit: docs_url global overlay override
undocumented
--
commit 181019824e3f6389f3fdc27e65e9f5241c313cc3
Author: Ahmed S. Darwish <darwi@xxxxxxxxxxxxx>
Documentation: kconfig-audit: Describe policy overlays
This commit documents the format, usage, and field reference for
kconfig-audit policy overlay files in Documentation/tools/kconfig-audit.rst.
> diff --git a/Documentation/tools/kconfig-audit.rst b/Documentation/tools/kconfig-audit.rst
> index 5b8e2fa842b1e..e83eb56e43ede 100644
> --- a/Documentation/tools/kconfig-audit.rst
> +++ b/Documentation/tools/kconfig-audit.rst
[ ... ]
> +Overriding an existing rule
> +---------------------------
> +
> +An overlay identifies an existing rule by its exact ``name`` or exact
> +``name_pattern`` string. It changes only the fields it supplies. Omitted
> +fields keep their values from the base policy.
[Severity: Medium]
Does policy overlay support actually honor pattern_prio on name_pattern
rules?
This section and the Policy files reference describe pattern_prio as
supported, and schema/policy-overlay-v1.yml accepts it. In audit.py,
however, PolicyOverlayFile._parse_rule() drops pattern_prio and
Overlayer._update_rule() / _new_rule() never propagate it.
An overlay that sets pattern_prio to adjust precedence or add a
higher-priority neutral exemption therefore silently gets priority 0,
causing wrong rule precedence or ambiguous-policy errors in
Checker._map_pattern_rules().
Either audit.py should propagate pattern_prio for overlays, or the overlay
schema and documentation should reject and note that it is unsupported.
[ ... ]
> @@ -304,11 +402,16 @@ tag is supported so far::
> ``kind``
> ++++++++
>
> -*Required*. Identifies the YAML document's type. For a configuration
> -policy file, the value must be::
> +*Required*. Identifies the YAML document's type.
> +
> +For a configuration policy file, the value must be::
>
> Policy
>
> +For a policy overlay file, the value must be::
> +
> + PolicyOverlay
> +
> ``docs_url``
> ++++++++++++
[Severity: Low]
Should this section document how docs_url behaves in a PolicyOverlay file?
schema/policy-overlay-v1.yml accepts top-level docs_url in overlays, and
Overlayer.apply() replaces policy.docs_url with it. Since
Policy.get_docs_url_for() prepends that single base URL to every rule's
docs_hint, setting it in an overlay rewrites links for all inherited rules.
[ ... ]
> @@ -408,10 +511,12 @@ an exact ``name`` rule.
> ``expected``
> ++++++++++++
>
> -*Required*. Describes the expected state of the matching symbol or
> -symbols.
> +*Required for all rules in policy files*.
> +
> +*Required for newly-added rules in policy overlays*.
[Severity: Low]
Does the Rule fields introduction above this section contradict the new
overlay requirements for expected and severity?
Policy files reference now covers both policy and overlay files, but the
Rule fields intro still states unconditionally that each rule must contain
one expected value and one severity, even though overlay overrides may omit
both.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261203224916.118064-1-darwi@xxxxxxxxxxxxx?part=8