Skip to content

feat(queue): configurable min-severity gate (Codex #3)#16

Merged
telivity-otaip merged 1 commit into
mainfrom
feat/min-severity-gate
Jun 18, 2026
Merged

feat(queue): configurable min-severity gate (Codex #3)#16
telivity-otaip merged 1 commit into
mainfrom
feat/min-severity-gate

Conversation

@telivity-otaip

Copy link
Copy Markdown
Collaborator

Summary

Codex review finding #3 — no way to focus the loop on what matters. The loop processed whatever the scanner surfaced in priority order, so a flood of low-severity documentation / dead-code tasks could burn the per-run budget before a critical test-failure was ever reached. This adds a configurable severity floor.

Changes

  • SEVERITY_RANK + meetsSeverityFloor() (types.ts / task-queue.ts) — single source of truth for severity ordering: critical < high < medium < low.
  • TaskQueue minSeverity option — below-floor tasks are refused at enqueue; any below-floor task persisted under an older, lower floor is skipped at dequeue, so tightening the floor takes effect on the next reload.
  • ImprovementLoopConfig.minSeverity — optional, threaded through runLoop. Defaults to low (accept everything) → existing callers are unaffected.
  • run:a --min-severity <critical|high|medium|low> — CLI surface; the run summary prints the active floor.

Test plan

New task-queue.test.ts cases:

  • enqueue drops below-floor, keeps at-or-above-floor
  • default floor (low) accepts every severity — backwards-compatibility guard
  • a medium task persisted under the default floor is not served after reload with --min-severity high
  • meetsSeverityFloor truth table

Local validation: asil-improvement-loop 184 tests, asil-runners 65 tests, build + typecheck clean across both packages.

The loop processed whatever the scanner surfaced, so a flood of low-severity
documentation/dead-code tasks could spend the budget before a critical
test-failure was ever reached. Add a severity floor.

- `SEVERITY_RANK` + `meetsSeverityFloor()` define the ordering (critical <
  high < medium < low).
- `TaskQueue` gains a `minSeverity` option. Below-floor tasks are refused at
  enqueue, and any below-floor task persisted under an older, lower floor is
  skipped at dequeue (so tightening the floor takes effect on reload).
- `ImprovementLoopConfig.minSeverity` (optional, defaults to `low` =
  accept-everything) threads through `runLoop`.
- `run:a --min-severity <critical|high|medium|low>` exposes it on the CLI and
  the run summary prints the active floor.

Default behavior is unchanged: omitting the floor accepts every severity.

Adds queue tests (enqueue drop, default-accepts-all, persisted-below-floor
skip) and a `meetsSeverityFloor` table.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@telivity-otaip telivity-otaip merged commit d6e7251 into main Jun 18, 2026
2 checks passed
@telivity-otaip telivity-otaip deleted the feat/min-severity-gate branch June 18, 2026 05:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant