Add WUMING_MIN_SEVERITY severity floor #104

Manually merged
marvin8 merged 7 commits from feat/issue-83-min-severity into main 2026-10-16 22:04:12 +00:00
Collaborator

Adds a configurable minimum severity for posted findings (wave 1, PR 1).

  • WUMING_MIN_SEVERITY (low|medium|high|critical, unset = post everything) filters findings immediately after review, before position resolution and before the #82 verification pass — below-floor findings never cost LLM calls.
  • Invalid values raise ValueError at config load; unrecognised severity values fail closed when a floor is set.
  • All seven agent prompts gain severity calibration and an explicit no-findings permission.
  • Verified against the wave-1 spec; whole-branch fresh-context review returned APPROVE WITH FINDINGS (one cosmetic import nit, fixed; review-focus areas verified with evidence).

Refs #83

Adds a configurable minimum severity for posted findings (wave 1, PR 1). - `WUMING_MIN_SEVERITY` (`low|medium|high|critical`, unset = post everything) filters findings immediately after review, before position resolution and before the #82 verification pass — below-floor findings never cost LLM calls. - Invalid values raise `ValueError` at config load; unrecognised severity values fail closed when a floor is set. - All seven agent prompts gain severity calibration and an explicit no-findings permission. - Verified against the wave-1 spec; whole-branch fresh-context review returned APPROVE WITH FINDINGS (one cosmetic import nit, fixed; review-focus areas verified with evidence). Refs #83
🐛 wrap calibration block to line length and pin prompt-test imports
All checks were successful
/ pr-review (pull_request) Successful in 1m30s
/ gitleaks (pull_request) Successful in 17s
/ checks (pull_request) Successful in 1m46s
/ deploy-docs (pull_request) Has been skipped
/ publish-container (pull_request) Has been skipped
8734f409a7
forgejo-actions left a comment

WuMing

Found 3 issue(s). See inline comments below.

## WuMing Found **3** issue(s). See inline comments below.
AGENTS.md Outdated
@ -101,6 +101,7 @@ tools/
- `WUMING_PROGRESS` — `true`/`1` force on; `false`/`0` force off; when unset or empty, auto-detects: enabled when stdout is a TTY and `CI` env var is absent
- `WUMING_MAX_DIFF_LINES` — integer; if the raw diff line count exceeds this value and it is > 0, posts a plain PR comment and exits without inline review (default: `0` = disabled)
- `WUMING_MAX_FILE_LINES` — integer; when > 0, fetches the full content of each changed file from Forgejo and includes it in the agent's context (files exceeding this line count are excluded); (default: `0` = disabled)
- `WUMING_MIN_SEVERITY` — `low`|`medium`|`high`|`critical`; minimum severity for posted findings (below-floor and unrecognised severities are dropped); (default: unset = post everything)

docs [MEDIUM]

Incomplete and ambiguous. The PR states that an invalid WUMING_MIN_SEVERITY value raises ValueError at config load, but this entry never mentions that invalid config values are rejected — a reader could reasonably assume an unknown value silently falls back (contrast the neighbouring WUMING_VERIFY row, which explicitly documents its fail-closed parsing). Additionally, the parenthetical "unrecognised severities are dropped" is stated unconditionally, yet per the implementation unknown finding severities only fail closed when a floor is actually set; when the variable is unset everything is posted. Fix: document that only low|medium|high|critical are accepted for the env var (any other value is an error at startup), and scope the dropping sentence to findings evaluated against an active floor, e.g. "unrecognised finding severities are dropped when a floor is set".

**docs** [MEDIUM] Incomplete and ambiguous. The PR states that an invalid WUMING_MIN_SEVERITY value raises `ValueError` at config load, but this entry never mentions that invalid config values are rejected — a reader could reasonably assume an unknown value silently falls back (contrast the neighbouring `WUMING_VERIFY` row, which explicitly documents its fail-closed parsing). Additionally, the parenthetical "unrecognised severities are dropped" is stated unconditionally, yet per the implementation unknown *finding* severities only fail closed when a floor is actually set; when the variable is unset everything is posted. Fix: document that only `low|medium|high|critical` are accepted for the env var (any other value is an error at startup), and scope the dropping sentence to findings evaluated against an active floor, e.g. "unrecognised finding severities are dropped when a floor is set". <!-- wuming:sha256:98d6d3fa7ac5cf77e161f16e015e8004a00c6a05d5e896521e3c30ea2ffd2ddc -->
README.md Outdated
@ -158,6 +158,7 @@ See the [Forgejo/GitHub Actions guide](https://wuming.marvin8.zone/getting-start
| `WUMING_PROGRESS` | — | `true`/`1` force on; `false`/`0` force off; when unset or empty, auto-detects: enabled when stdout is a TTY and `CI` env var is absent |
| `WUMING_MAX_DIFF_LINES` | `0` | Maximum raw diff size in lines. When the diff exceeds this value and it is greater than 0, WuMing posts a single plain PR comment explaining the PR is too large to review automatically, then exits without posting inline comments. Set to `0` to disable. |
| `WUMING_MAX_FILE_LINES` | `0` | Maximum file size (in lines) for full-file context fetching. When greater than 0, WuMing fetches the complete content of each changed file from Forgejo and includes it in the agent's context, giving the model visibility beyond the diff hunks. Files exceeding this line count are excluded. Set to `0` (the default) to disable. |
| `WUMING_MIN_SEVERITY` | *(unset)* | Minimum severity for posted findings: `low`, `medium`, `high`, or `critical`. Findings below the floor are dropped before posting (unrecognised severity values are dropped too). Unset by default — all findings are posted. |

docs [MEDIUM]

Missing error behavior for the configuration value. The default column and prose cover the floor semantics, but unlike the WUMING_VERIFY row directly below ("Only true/false ... are accepted — any other value is an error, not a fallback to the default"), this row does not state that an unrecognised WUMING_MIN_SEVERITY value raises an error at config load rather than being ignored. The sentence "unrecognised severity values are dropped too" also conflates the env var value with the severity of a finding, and its unconditional wording conflicts with "Unset by default — all findings are posted" (unknown finding severities are only dropped when a floor is set). Fix: state that only low/medium/high/critical are accepted and that any other value is an error, and qualify the drop behavior as applying to findings when a floor is set.

**docs** [MEDIUM] Missing error behavior for the configuration value. The default column and prose cover the floor semantics, but unlike the `WUMING_VERIFY` row directly below ("Only `true`/`false` ... are accepted — any other value is an error, not a fallback to the default"), this row does not state that an unrecognised `WUMING_MIN_SEVERITY` value raises an error at config load rather than being ignored. The sentence "unrecognised severity values are dropped too" also conflates the env var value with the severity of a finding, and its unconditional wording conflicts with "Unset by default — all findings are posted" (unknown finding severities are only dropped when a floor is set). Fix: state that only `low`/`medium`/`high`/`critical` are accepted and that any other value is an error, and qualify the drop behavior as applying to findings when a floor is set. <!-- wuming:sha256:17c31a8003caa2b2980f9ded4106e68791d559fcc976c34c827c00e787a5f744 -->
@ -96,6 +97,7 @@ async def _main() -> None:
raw_comments = await router.review(
file_diffs, backend, progress=progress, pr_info=pr_info
)
raw_comments = _apply_severity_floor(raw_comments, config.min_severity)

code [MEDIUM]

The severity floor is applied at the correct point in the pipeline, but there is no integration-level test that verifies this ordering: that below-floor findings are dropped before _resolve_positions and before the verification LLM call. The PR's key efficiency claim is that dropped findings never cost verifier LLM calls, so add a test around _main/_review_and_publish that injects a below-floor finding and asserts the verifier backend and position resolver are not invoked for it.

**code** [MEDIUM] The severity floor is applied at the correct point in the pipeline, but there is no integration-level test that verifies this ordering: that below-floor findings are dropped before _resolve_positions and before the verification LLM call. The PR's key efficiency claim is that dropped findings never cost verifier LLM calls, so add a test around _main/_review_and_publish that injects a below-floor finding and asserts the verifier backend and position resolver are not invoked for it. <!-- wuming:sha256:df5de228def2c7e8345fd9a4ddc30e7415d6b061c2372f62b49429cd68db382f -->
✅ pin floor-before-verify order and document strict parsing
All checks were successful
/ gitleaks (pull_request) Successful in 33s
/ checks (pull_request) Successful in 2m1s
/ deploy-docs (pull_request) Has been skipped
/ publish-container (pull_request) Has been skipped
/ pr-review (pull_request) Successful in 3m20s
b7ac816911
Author
Collaborator

src/wuming/main.py

code [MEDIUM]

✅ Fixed in commit b7ac816 — test_pipeline_floor_before_verification drives one below-floor and one in-diff above-floor finding through _main with WUMING_MIN_SEVERITY=medium and asserts the verifier receives only the above-floor finding and the review posts only it. Both findings sit on the same in-diff line, so position resolution would keep both — the floor is the only filter that can drop it.

[`src/wuming/main.py`](https://forge.marvin8.zone/marvin8/wuming/pulls/104#issuecomment-5602) > **code** [MEDIUM] ✅ Fixed in commit `b7ac816` — `test_pipeline_floor_before_verification` drives one below-floor and one in-diff above-floor finding through `_main` with `WUMING_MIN_SEVERITY=medium` and asserts the verifier receives only the above-floor finding and the review posts only it. Both findings sit on the same in-diff line, so position resolution would keep both — the floor is the only filter that can drop it.
Author
Collaborator

AGENTS.md

docs [MEDIUM]

✅ Fixed in commit b7ac816 — the entry now states that parsing is fail-closed: any other value raises ValueError at config load.

[`AGENTS.md`](https://forge.marvin8.zone/marvin8/wuming/pulls/104#issuecomment-5603) > **docs** [MEDIUM] ✅ Fixed in commit `b7ac816` — the entry now states that parsing is fail-closed: any other value raises `ValueError` at config load.
Author
Collaborator

README.md

docs [MEDIUM]

✅ Fixed in commit b7ac816 — the row now states only the four levels are accepted and any other value is an error at startup, not a fallback to posting everything.

[`README.md`](https://forge.marvin8.zone/marvin8/wuming/pulls/104#issuecomment-5604) > **docs** [MEDIUM] ✅ Fixed in commit `b7ac816` — the row now states only the four levels are accepted and any other value is an error at startup, not a fallback to posting everything.
forgejo-actions left a comment

WuMing

Found 1 issue(s). See inline comments below.

## WuMing Found **1** issue(s). See inline comments below.
AGENTS.md Outdated
@ -101,6 +101,7 @@ tools/
- `WUMING_PROGRESS` — `true`/`1` force on; `false`/`0` force off; when unset or empty, auto-detects: enabled when stdout is a TTY and `CI` env var is absent
- `WUMING_MAX_DIFF_LINES` — integer; if the raw diff line count exceeds this value and it is > 0, posts a plain PR comment and exits without inline review (default: `0` = disabled)
- `WUMING_MAX_FILE_LINES` — integer; when > 0, fetches the full content of each changed file from Forgejo and includes it in the agent's context (files exceeding this line count are excluded); (default: `0` = disabled)
- `WUMING_MIN_SEVERITY` — `low`|`medium`|`high`|`critical`; minimum severity for posted findings (below-floor and unrecognised severities are dropped); parsing is fail-closed — any other value raises `ValueError` at config load; (default: unset = post everything)

docs [LOW]

Same ambiguity as the README table: the parenthetical states that unrecognised severities are dropped, while the default note says "unset = post everything". Unrecognised severity values only fail closed when a floor is configured, so the parenthetical should be qualified (e.g. "when a floor is set, below-floor and unrecognised severities are dropped") to match the actual behaviour and the PR description.

**docs** [LOW] Same ambiguity as the README table: the parenthetical states that unrecognised severities are dropped, while the default note says "unset = post everything". Unrecognised severity values only fail closed when a floor is configured, so the parenthetical should be qualified (e.g. "when a floor is set, below-floor and unrecognised severities are dropped") to match the actual behaviour and the PR description. <!-- wuming:sha256:24c27543efc45c3dbde26c19ea067804e3041da53ec241e0c66d59261a844fba -->
📝 qualify unrecognised-severity drop as floor-conditional
All checks were successful
/ gitleaks (pull_request) Successful in 21s
/ checks (pull_request) Successful in 2m25s
/ deploy-docs (pull_request) Has been skipped
/ publish-container (pull_request) Has been skipped
/ pr-review (pull_request) Successful in 4m7s
8a92bc0a18
Author
Collaborator

AGENTS.md

docs [LOW]

✅ Fixed in commit pending-push — the parenthetical is now qualified: "when a floor is set, below-floor and unrecognised severities are dropped". The README table row carried the same unconditional phrasing, so it was qualified identically to keep the two documents consistent.

[`AGENTS.md`](https://forge.marvin8.zone/marvin8/wuming/pulls/104#issuecomment-5626) > **docs** [LOW] ✅ Fixed in commit pending-push — the parenthetical is now qualified: "when a floor is set, below-floor and unrecognised severities are dropped". The README table row carried the same unconditional phrasing, so it was qualified identically to keep the two documents consistent.
agent-pi force-pushed feat/issue-83-min-severity from 8a92bc0a18
All checks were successful
/ gitleaks (pull_request) Successful in 21s
/ checks (pull_request) Successful in 2m25s
/ deploy-docs (pull_request) Has been skipped
/ publish-container (pull_request) Has been skipped
/ pr-review (pull_request) Successful in 4m7s
to ca63fb8305
All checks were successful
/ gitleaks (pull_request) Successful in 18s
/ pr-review (pull_request) Successful in 58s
/ checks (pull_request) Successful in 2m15s
/ deploy-docs (pull_request) Has been skipped
/ publish-container (pull_request) Has been skipped
2026-10-16 21:53:02 +00:00
Compare
marvin8 approved these changes 2026-10-16 22:03:41 +00:00
marvin8 manually merged commit 7e5e35c410 into main 2026-10-16 22:04:12 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
marvin8/wuming!104
No description provided.