audit: summary + group-by report options (#35) #36

Merged
KofTwentyTwo merged 18 commits from feature/GH-35-audit-summary-reports into develop 2026-06-09 15:17:56 +00:00
18 Commits
Author SHA1 Message Date
james.maes 472d78b914 docs: track the six open PRs (#29/#30/#31/#33/#34/#35) and review notes 2026-06-09 09:49:55 -05:00
james.maes 7159bc1b48 docs(#35): close punch list; record review follow-ups and PR readiness 2026-06-09 07:45:58 -05:00
james.maes 3852c9122b fix(#35): harden group risk under --only; review-driven follow-ups
Address findings from a three-agent adversarial review of the GH-35
delta:

- Compute the repo-wide incompatibility set from the full report, not the
  --only-narrowed listing, so a filtered listing can no longer understate
  a group's policy-aware risk. Add groupFilesWith(r, spec, incompatIDs)
  and thread the full-report set through the text/markdown/JSON renderers.
- Use path.Base (not filepath.Base) on the slash-normalized enumerate
  path when matching the config file, for cross-platform correctness.
- Tests: directory-grouping escalation across a mixed bucket, incompat
  beating the headerless-unknown fallback, non-policy tokens not
  escalating, incompatibleIDs cardinality (0/1/3 ids), the filtered-
  listing risk contract, nested/--only config exclusion, no detected-
  license/violation leak on the skipped config, and a check exit-code
  regression guard for the config exclusion.
- Docs: correct the README grouped-output samples (risk markers,
  (no-header) label, JSON group shape) and note the check exit-code
  implication of the config exclusion in README and CHANGELOG.
2026-06-09 07:44:21 -05:00
james.maes 56c3e9410b docs(#35): document self-config exclusion, policy-aware risk, and decisions
README: policy-aware group risk and the .license-tool.yaml exclusion.
CHANGELOG: comprehensive Unreleased entry for the audit reporting overhaul.
DESIGN: post-implementation addenda recording the two new features and the
three audit-flagged items resolved by decision (dep-grouping non-goal,
JSON percentages declined, go.mod not a supported ecosystem).
2026-06-09 07:12:06 -05:00
james.maes 2822d862d8 feat(#35): policy-aware group risk
A group's [risk] marker was computed solely from its files' license
categories, so it was policy-blind: an Apache-2.0 group beside an
AGPL-3.0-or-later group read "low" even though the pair is a curated
hard incompatibility, and a deny-listed permissive license also read
"low".

Escalate a group's risk to "high" when it carries a policy concern: a
file whose license is party to a repo-level hard incompatibility
(computed once over the distinct source ids via policy.Incompatible),
or a file carrying a file-scoped policy-violation token. Category-only
risk is preserved when there is no policy concern, with no false
escalation (MIT beside AGPL, not an incompatibility, stays "low").
2026-06-09 07:10:16 -05:00
james.maes ce192cad54 feat(#35): exclude tool's own .license-tool.yaml from source coverage
The config file is YAML (commentable), so the audit counted it as a
coverable source file missing a managed header, inflating sourceTotal
and sourceMissing. It is tool metadata, not coverable source, and never
carries a header.

Mark any file whose basename is .license-tool.yaml as skipped (reason
"tool config") in the audit pipeline, so it still appears in the file
listing but is excluded from source/header tallies. Export
config.RepoConfigName as the single source of truth for the name.
2026-06-08 15:30:38 -05:00
james.maes bbba9d28bf docs(#35): document --only filter and JSON-always-full behavior 2026-06-08 15:12:54 -05:00
james.maes 366ffece45 feat(#35): --only filter to list problem files (missing|unknown|copyleft|violations) 2026-06-08 15:12:29 -05:00
james.maes b43e362a21 fix(#35): unify (no-header) token, unknown-risk for headerless groups, full JSON under --summary 2026-06-08 14:58:42 -05:00
james.maes 83df6402ab docs(#35): document audit risk/attribution/findings/sort/depth enhancements 2026-06-08 14:24:37 -05:00
james.maes 96389108a8 feat(#35): per-group license breakdown, --depth directory grouping 2026-06-08 14:21:52 -05:00
james.maes 29c7108c80 feat(#35): per-group risk markers, (no-header) rename, --sort key|count 2026-06-08 14:14:19 -05:00
james.maes daef9c396d feat(#35): findings + totals/percentages + riskLevel parity across text/markdown/json 2026-06-08 14:07:52 -05:00
james.maes 48fd159368 feat(#35): attributable policy violations (which license/rule/file) in all formats 2026-06-08 14:01:30 -05:00
james.maes b28d245c60 feat(#35): wire --summary and --group-by audit flags + document them
Closes #35
2026-06-08 13:29:35 -05:00
james.maes dd4b34ba93 feat(#35): RenderOptions for summary + grouped views across all formats 2026-06-08 13:19:45 -05:00
james.maes c3755f7baf feat(#35): add pure GroupFiles + ParseGroupBy for audit grouping 2026-06-08 13:12:04 -05:00
james.maes 6051a36198 docs(#35): spec audit summary + group-by report options 2026-06-08 13:04:49 -05:00