feat(explain): add --simple option and findings summary #105

Merged
pdurlej merged 3 commits from issue-85-88-explain-simple into main 2026-06-17 23:43:52 +02:00
Contributor

Canary Context Pack

Product story

Users need a way to get a simpler, less overwhelming explanation of rules. Also, when outputting to text, omitting hundreds of findings without a breakdown of their severities makes it hard to gauge the remaining risk.

What changed

  • Added --simple flag to explain command for simplified output.
  • Enhanced text formatter to summarize omitted findings by severity (e.g. 2 error, 2 warning, 1 info).
  • Extracted tests to test_cli_explain.py.

Why it changed

Split from Gemini 3.5 Flash's batch to properly address issues #85 and #88 in a granular PR.

Files touched

  • src/fallow_py/cli.py
  • src/fallow_py/rule_explain.py
  • src/fallow_py/formatters.py
  • tests/test_cli_explain.py

Relevant context

Closes #85, Closes #88.

Runtime evidence

pytest tests/test_cli_explain.py passes successfully.

Known constraints

None.

Explicit out-of-scope

None.

Requested decision

Approve and merge.

Merge blockers

CI/CD test failures.

## Canary Context Pack ### Product story Users need a way to get a simpler, less overwhelming explanation of rules. Also, when outputting to text, omitting hundreds of findings without a breakdown of their severities makes it hard to gauge the remaining risk. ### What changed - Added `--simple` flag to `explain` command for simplified output. - Enhanced text formatter to summarize omitted findings by severity (e.g. `2 error, 2 warning, 1 info`). - Extracted tests to `test_cli_explain.py`. ### Why it changed Split from Gemini 3.5 Flash's batch to properly address issues #85 and #88 in a granular PR. ### Files touched - `src/fallow_py/cli.py` - `src/fallow_py/rule_explain.py` - `src/fallow_py/formatters.py` - `tests/test_cli_explain.py` ### Relevant context Closes #85, Closes #88. ### Runtime evidence `pytest tests/test_cli_explain.py` passes successfully. ### Known constraints None. ### Explicit out-of-scope None. ### Requested decision Approve and merge. ### Merge blockers CI/CD test failures.
feat(explain): add --simple option and findings summary (fixes #85, #88)
Some checks failed
CI / Python 3.11 (push) Failing after 1m9s
CI / Python 3.12 (push) Failing after 1m13s
CI / Python 3.13 (push) Failing after 1m12s
CI / Python 3.11 (pull_request) Failing after 1m9s
CI / Python 3.12 (pull_request) Failing after 1m14s
CI / Python 3.13 (pull_request) Failing after 1m13s
5e3e8ff207
fix(explain): keep simple output in contract
All checks were successful
CI / Python 3.11 (push) Successful in 1m0s
CI / Python 3.12 (push) Successful in 1m10s
CI / Python 3.13 (push) Successful in 1m6s
CI / Python 3.11 (pull_request) Successful in 1m0s
CI / Python 3.12 (pull_request) Successful in 1m3s
CI / Python 3.13 (pull_request) Successful in 1m3s
d6fb2890ac
Imports ConfigError for explain failures, removes premature common-fixes links from rule output, and covers unknown-rule behavior in the new simple explain tests. This keeps docs/rules.md aligned with generated rule output while #86/#87 remain separate cookbook work.

Verified:

- python3 -m pytest -q tests/test_cli_explain.py tests/test_pyfallow.py::test_cli_explain_rule_by_id_slug_and_all tests/test_pyfallow.py::test_rule_explanations_cover_rules_and_docs_do_not_drift

- python3 -m pytest -q

- python3 -m compileall -q src tests mcp/src mcp/tests

- python3 -m fallow_py analyze --root . --fail-on warning --min-confidence medium
codex approved these changes 2026-06-10 22:13:10 +02:00
Dismissed
codex left a comment

approve_merge after CI.

I re-reviewed after the fix commit d6fb289. The prior blockers are resolved: explain error handling imports ConfigError, generated rule docs stay in sync because premature cookbook links were removed, and unknown-rule behavior is covered by the new simple-mode test.

Verified locally:

  • python3 -m pytest -q tests/test_cli_explain.py tests/test_pyfallow.py::test_cli_explain_rule_by_id_slug_and_all tests/test_pyfallow.py::test_rule_explanations_cover_rules_and_docs_do_not_drift
  • python3 -m pytest -q
  • python3 -m compileall -q src tests mcp/src mcp/tests
  • python3 -m fallow_py analyze --root . --fail-on warning --min-confidence medium
approve_merge after CI. I re-reviewed after the fix commit `d6fb289`. The prior blockers are resolved: explain error handling imports `ConfigError`, generated rule docs stay in sync because premature cookbook links were removed, and unknown-rule behavior is covered by the new simple-mode test. Verified locally: - `python3 -m pytest -q tests/test_cli_explain.py tests/test_pyfallow.py::test_cli_explain_rule_by_id_slug_and_all tests/test_pyfallow.py::test_rule_explanations_cover_rules_and_docs_do_not_drift` - `python3 -m pytest -q` - `python3 -m compileall -q src tests mcp/src mcp/tests` - `python3 -m fallow_py analyze --root . --fail-on warning --min-confidence medium`
pdurlej scheduled this pull request to auto merge when all checks succeed 2026-06-10 22:20:09 +02:00
Merge remote-tracking branch 'origin/main' into HEAD
All checks were successful
CI / Python 3.11 (push) Successful in 55s
CI / Python 3.12 (push) Successful in 1m0s
CI / Python 3.13 (push) Successful in 1m0s
CI / Python 3.11 (pull_request) Successful in 55s
CI / Python 3.12 (pull_request) Successful in 59s
CI / Python 3.13 (pull_request) Successful in 58s
445cbe9dc3
ollama dismissed codex's review 2026-06-17 23:22:22 +02:00
Reason:

New commits pushed, approval review dismissed automatically according to repository settings

codex approved these changes 2026-06-17 23:23:10 +02:00
codex left a comment

approve_merge.

Re-approved after updating the branch with current main. The diff remains scoped to explain --simple, omitted-findings text summary, and focused CLI formatter tests. No new blocker found; remaining gate is CI on the refreshed head.

approve_merge. Re-approved after updating the branch with current main. The diff remains scoped to `explain --simple`, omitted-findings text summary, and focused CLI formatter tests. No new blocker found; remaining gate is CI on the refreshed head.
pdurlej deleted branch issue-85-88-explain-simple 2026-06-17 23:43:52 +02:00
Sign in to join this conversation.
No description provided.