Agent web jobs now stop after Brain consolidation and enter needs_review with a persisted review queue (blocking: high-severity, low-confidence, sensitive-category findings; audit sample of clean clusters). Humans decide confirm/reject/unsure/needs_clarification via new review API and frontend queue; a finalizer applies decisions (rejections suppressed with reason codes), performs bounded targeted reruns for clarifications, drafts RFIs only for kept issues, and only then marks the job done and sends the final email. Two-phase email (review-required, then final report), per-decision feedback labels with redacted aggregate metrics, restart recovery from job artifacts, and CLI --no-review bypass. Classic pipeline unchanged. 65 non-LLM tests.
25 lines
865 B
Python
25 lines
865 B
Python
import json
|
|
from backend.review.store import ReviewStore
|
|
|
|
|
|
def test_queue_and_decisions_round_trip(tmp_path):
|
|
store = ReviewStore(str(tmp_path))
|
|
queue = [{"review_item_id": "finding:1", "blocking": True}]
|
|
store.write_queue(queue)
|
|
assert store.read_queue() == queue
|
|
store.append_decision({"review_item_id": "finding:1", "decision": "confirm"})
|
|
assert store.read_decisions()["finding:1"]["decision"] == "confirm"
|
|
|
|
|
|
def test_progress_counts_required_items(tmp_path):
|
|
store = ReviewStore(str(tmp_path))
|
|
queue = [
|
|
{"review_item_id": "a", "blocking": True},
|
|
{"review_item_id": "b", "blocking": False},
|
|
]
|
|
store.write_queue(queue)
|
|
store.append_decision({"review_item_id": "a", "decision": "confirm"})
|
|
progress = store.progress(queue)
|
|
assert progress["required"] == 1
|
|
assert progress["completed"] == 1
|