fix(sage): bind review results to worker responses - #9077
Conversation
Design Review (Fable 5, fork) — 🔴 BLOCK (blocking)Design-level review of Design-Verdict: BLOCK The envelope is parsed from BlockersThe persistence channel's real semantics are never established, and manual verification was waived. WatchThe follow-up contract requires the LLM to round-trip every first-pass finding byte-exactly (prefix equality against [DESIGN-REVIEWED] c6563dc |
First Principles Review (Fable 5, fork) — 🟡 CONCERNSPremise-level review of Confirmed: First-Principles-Verdict: CONCERNS The capability token and Not justified as shipped
What this change shipsIntent: stop the driver from adopting a shared result file it cannot attribute to the worker it dispatched. FIX.
Watch
Subtractions
[FIRST-PRINCIPLES-REVIEWED] c6563dc |
GPT 5.6 Review (fork) — 🔴 changes requested (blocking)Reviewed 1 of 1 blocking finding(s) are security-class and were withheld from adjudication, so the blocking verdict stands. BLOCKING -- src/kiro_crew/apps/builtins/code_review_sage/sage_lib/review_driver.py:1322 -- Legacy runs still trust worker-writable shared results [BLOCK-MERGE] c6563dc Adjudication (Opus 4.8) — is blocking on each finding proportionate?The adjudicable input block is empty (0 findings). One fenced finding, F1. F1 assessment. The finding targets the new response-bound handoff at
The worker is the untrusted boundary the removed [ADJUDICATION] c6563dc total=0 uphold=0 downgrade=0 [ADJUDICATION-FENCED] c6563dc fenced=1 flagged=0 |
Opus 4.8 Review (fork) — ✅ no blocking findingsReviewed Review detailsBoth candidates rest on unestablished premises. Candidate 1 requires a review record exceeding 1 MB "occurring in practice," which its own evidence admits it cannot confirm (a → "could"). Candidate 2's harm ("LLM reformats prior findings") is speculative model behavior it admits it "cannot measure," and the code is fail-closed (the first pass is preserved). Neither re-derives (a)/(b)/(c) cleanly. I verified the neighboring logic — No findings. [OPUS-REVIEWED] c6563dc |
c23864d to
fb80274
Compare
Coverage follow-ups may extend accepted findings and coverage state, but must not replace the first pass metadata that anchors review output.
fb80274 to
c6563dc
Compare
|
@Premshay this PR and #9087 are complementary halves of the same durability theme, and both can land. Audited at fb80274; the head has since moved to c6563dc, but the 7-file set is unchanged. Overlap with #9087: both edit The real blocker is #8143, also yours. It replaces the same shared-staging result channel at the same dispatch sites, and it additionally converts the poster path, the review pool and Two undeclared changes worth adding to the body: Posted from the 2026-09-08 open-PR relationship audit (read-only, one auditor per PR); reply here if any of this is wrong. |
Problem / Motivation
Sage workers currently write a shared staging result file. Record shape and change ID are validated, but the driver cannot prove the file came from the worker it dispatched.
Why it matters
A concurrent or stale writer can race result attribution. Completed reviewer work is also safer when the driver persists it immediately into the run record.
What changed
Workers return a bounded JSON envelope carrying a driver-issued capability and exact change ID. The driver validates it, atomically writes the result directly to run scope, and binds coverage follow-ups to the immutable first-pass digest. Invalid follow-ups retain the first-pass record. Pool concurrency, schema, and posting behavior are unchanged.
Pattern harvest
Rule candidate: an untrusted worker result needs a driver-issued capability and immediate driver-owned persistence before concurrent work can proceed.
Tests
python -m pytest -q src/kiro_crew/apps/builtins/code_review_sage/tests— 810 passed. Flake8 andgit diff --checkpass.What changed (motivation → approach → change)
N/A — covered by the existing
## What changedsection.Manual verification
N/A — focused automated coverage is sufficient.
Related Issues
N/A.
Checklist
Contribution License Agreement
N/A — template placeholder; no CLA wording is supplied.