feat(kanban): full-review coverage gate on request_changes (t_164f0178) - #999
Conversation
…harden n/a + findings parsing Addresses all 7 findings from Apollo review r3 on #999: - F1: _set_status_direct refuses any move out of review except done/blocked/archived (inside the write txn); PATCH and bulk pre-check the same predicate for a 409. _reopen_if_review deleted. - F2: n/a reasons are NFKC-normalized, zero-width/control chars stripped, and inability phrases matched anywhere (could not/cannot/unable/missing/ not available/no ... tool/exhausted/timed out, ...). - F3: test helpers and gate fixtures build lenses from REQUIRED_REVIEW_LENSES; SKILL.md example lens set == schema is tested. - F4: newest current-run comment that parses to a JSON object wins. - F5: items need 3+ visible chars incl. a letter/digit; review_minutes 0..1440. - F6: lens keys and states casefolded. - F7: reopen_review_task drops the home-session guard (no "allowed" line), CLI reopen-review always refuses; review_reopened documented as historical. Verified: gate + skill + dashboard + requeue-kinds tests 126 passed; kanban neighbours 342 passed (3 fails were worker HERMES_SESSION_ID env leak and the override-set change, both fixed/pass with env stripped); 13/13 new parser/dashboard mutants killed.
2ad6249 to
ceb398a
Compare
request_changes now refuses unless the current review run carries a review_coverage JSON comment: all four lenses (contract, execution, cross-vendor, mutation) done or 'n/a: <applicability reason>', findings>=1 with matching items, review_minutes, battery (named attachment on re-review), and the delegate batch_id. Inability to run a lens must be kanban_block(kind=capability). Refusal names the missing field. Class sweep of review->implementer entry points: tool, CLI and gateway /kanban all route via kb.request_changes; the legacy reopen_review_task bypass (CLI reopen-review, dashboard single/bulk drag) is retired and refuses. CLI gains --coverage and claim --review for human-only boards. KANBAN_GUIDANCE, tool schema and bundled sdlc-review state the gate. Mutation sweep: 10/10 parser mutants killed.
…opener grading, backtick form, optional battery - Lens list lives in hermes_cli/kanban_review_schema.py; gate, tool description and worker prompt all read it (operator steer: lens set is being revised). - n/a grades only the OPENING of the reason for an inability report, so 'vendors cannot differ' is accepted and 'skipped'/'ran out of time' refused. - Accept the documented inline-code form of the review_coverage line. - battery optional (CI owns suites); nonempty string when given. - Tests: one refusing test per surviving parser mutant, both n/a directions, verbatim SKILL.md example; rewrite test_sdlc_review_skill lens test to the four-lens/coverage/capability-block property.
…harden n/a + findings parsing Addresses all 7 findings from Apollo review r3 on #999: - F1: _set_status_direct refuses any move out of review except done/blocked/archived (inside the write txn); PATCH and bulk pre-check the same predicate for a 409. _reopen_if_review deleted. - F2: n/a reasons are NFKC-normalized, zero-width/control chars stripped, and inability phrases matched anywhere (could not/cannot/unable/missing/ not available/no ... tool/exhausted/timed out, ...). - F3: test helpers and gate fixtures build lenses from REQUIRED_REVIEW_LENSES; SKILL.md example lens set == schema is tested. - F4: newest current-run comment that parses to a JSON object wins. - F5: items need 3+ visible chars incl. a letter/digit; review_minutes 0..1440. - F6: lens keys and states casefolded. - F7: reopen_review_task drops the home-session guard (no "allowed" line), CLI reopen-review always refuses; review_reopened documented as historical. Verified: gate + skill + dashboard + requeue-kinds tests 126 passed; kanban neighbours 342 passed (3 fails were worker HERMES_SESSION_ID env leak and the override-set change, both fixed/pass with env stripped); 13/13 new parser/dashboard mutants killed.
…re request_changes test_kanban_review_load_gates.py landed on main (53d766b) after r3's rebase and calls bare kb.request_changes, which the coverage gate now refuses (CI slice 10/16: 3 failures at :141). Route _one_round through tests.kanban_review_helpers.
ceb398a to
becdee4
Compare
|
🤖 merged-by: apollo · lane: discord · gate: BYPASS: FR paused 09-22; gate=CI green + Apollo review · why: t_164f0178 r3: all 7 Apollo r3 findings fixed and verified by grep on head becdee4 (F1 review-exit guard owned by _set_status_direct + single/bulk tests; F2 NFKC+zero-width strip and inability phrases matched anywhere; F3 schema-driven fixtures/skill test; F4 newest VALID coverage; F5 items/minutes bounds; F6 casefold; F7 dead reopen routing removed). CI 40/40 green; local 113/114 with the one red identical on base (UNHOMED-card policy in this home, not the PR); 0 conflicts with main; reviewed by Apollo 06:5x PT |
|
🤖 merged-by: apollo · lane: boil-ocean · gate: BYPASS: FR PAUSED by Ace ruling 2026-09-22 (state/fleetreview-pause-20260922.md); Apollo-reviewed lands via bypass · why: re-enqueue: prior merge_group CI run hit startup_failure (0 jobs) and wedged the queue head in AWAITING_CHECKS; content unchanged |
…n it opens (t_f31e2ff3) Rebased onto #999 (review-coverage gate, becdee4). A card parked in review has no run, so no review_coverage comment can carry the current run_id; with #999's gate every human/Apollo send-back was refused. request_changes(claimer=..., coverage=...): - parked review + claimer: refuse with the gate's own message when no coverage is given, BEFORE opening a run (no claim churn); otherwise open the review run via _open_review_run (same claimed(source_status=review) event as the dispatched reviewer), record coverage as a comment bound to the new run, run the #999 gate, request changes -- one write_txn. Any refusal after the claim rolls back claim + comment. - coverage is recorded on whichever run is closed (also an active review run), so the CLI --coverage pre-post from #999 now routes through here. - comment journal entry written only after commit. Surfaces: CLI request-changes --coverage passes through; kanban_request_changes tool gains optional `coverage`; dashboard gains POST /tasks/{id}/request-changes (review->ready status writes stay refused per #999). Verified: test_kanban_review_sendback.py + test_kanban_review_coverage_gate.py 77 passed (py3.11 venv, via test-gate). Depends on #999.
FleetReviewFleetReview's daily member-call budget is spent (600/600 for 2026-09-26 UTC); review skipped. FleetReview · reviewKind: skipped-budget |
…n it opens (t_f31e2ff3) Rebased onto #999 (review-coverage gate, becdee4). A card parked in review has no run, so no review_coverage comment can carry the current run_id; with #999's gate every human/Apollo send-back was refused. request_changes(claimer=..., coverage=...): - parked review + claimer: refuse with the gate's own message when no coverage is given, BEFORE opening a run (no claim churn); otherwise open the review run via _open_review_run (same claimed(source_status=review) event as the dispatched reviewer), record coverage as a comment bound to the new run, run the #999 gate, request changes -- one write_txn. Any refusal after the claim rolls back claim + comment. - coverage is recorded on whichever run is closed (also an active review run), so the CLI --coverage pre-post from #999 now routes through here. - comment journal entry written only after commit. Surfaces: CLI request-changes --coverage passes through; kanban_request_changes tool gains optional `coverage`; dashboard gains POST /tasks/{id}/request-changes (review->ready status writes stay refused per #999). Verified: test_kanban_review_sendback.py + test_kanban_review_coverage_gate.py 77 passed (py3.11 venv, via test-gate). Depends on #999.
…n it opens (t_f31e2ff3) Rebased onto #999 (review-coverage gate, becdee4). A card parked in review has no run, so no review_coverage comment can carry the current run_id; with #999's gate every human/Apollo send-back was refused. request_changes(claimer=..., coverage=...): - parked review + claimer: refuse with the gate's own message when no coverage is given, BEFORE opening a run (no claim churn); otherwise open the review run via _open_review_run (same claimed(source_status=review) event as the dispatched reviewer), record coverage as a comment bound to the new run, run the #999 gate, request changes -- one write_txn. Any refusal after the claim rolls back claim + comment. - coverage is recorded on whichever run is closed (also an active review run), so the CLI --coverage pre-post from #999 now routes through here. - comment journal entry written only after commit. Surfaces: CLI request-changes --coverage passes through; kanban_request_changes tool gains optional `coverage`; dashboard gains POST /tasks/{id}/request-changes (review->ready status writes stay refused per #999). Verified: test_kanban_review_sendback.py + test_kanban_review_coverage_gate.py 77 passed (py3.11 venv, via test-gate). Depends on #999.
Card t_164f0178 (Ace ruling 2026-09-24): a review round must grade the whole deliverable and report ALL findings.
Gate —
kb.request_changesrefuses unless the current review run has areview_coverage: {json}comment:doneorn/a: <applicability reason>; 'cannot/could not/unavailable/failed' reasons are refused → must usekanban_block(kind=capability)itemslist matching the countseeded/none-first-roundonly allowed on first round), batch_idClass sweep (review → implementer): tool, CLI and gateway
/kanbanall go throughkb.request_changes. The legacyreopen_review_taskbypass (CLIreopen-review, dashboard single + bulk drag) is retired and refuses (409 on dashboard). CLI adds--coverageandclaim --reviewso human-only boards still have a path. Approval (complete) andblock(kind=capability)unaffected.Brief: KANBAN_GUIDANCE, tool schema and bundled sdlc-review skill state the gate + one delegate_task batch. Argus harness untouched.
Tests: new
test_kanban_review_coverage_gate.py(18) — real DB persistence through tool handler, run_slash, and a realpython -m hermes_cli.main kanban request-changessubprocess: 3 lenses refused, 4+findings accepted, capability block + approval unaffected, stale-round and re-review battery rules. Neighbor kanban suites: 411 passed; 1 failure (test_review_tools_are_gated_and_visible_to_kanban_workers, ModuleNotFoundError acp) reproduces identically on base. Mutation sweep over the parser: 10/10 mutants killed.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.