Blind review children, control plane

Task 12298 · Queued · Coder · created · updated

Epic 12251, child C6a. Needs C2 (`declare_tier`/`on_tier_declared`, `review_findings.record`, `findings` arg) and C3b (A9 vendor rule, decisions for review personas). Pairs with C6b (jaahd, already built against the pinned `blind_apply` contract). Verification order: the AC10/AC11 dev oracles run once C6b's package is on the dev pool — not a build edge. ## Original requirement (verbatim, epic ask 5) "Routable review units: new CP-dispatched personas `reviewer`, `security_reviewer`, `tester` as blind children of a coder task for Major and security-sensitive review tiers (diff + spec only, never the author's self-assessment; may run on a different vendor than the author); Minor/Standard keep in-session lanes whose model/agent the dispatch prompt names from the routing decision and telemetry attributes. Their findings write the ledger's security-findings facts." Epic Done means (verbatim): "A Major-tier coder task spawns a blind `reviewer` child on a different provider when policy asks; its findings land on the ledger row." ## Settled decisions D2 advisory only; D5 coder declares tier; D6 own per-project switch "Blind review", OFF by default, only under `intelligent_routing`; A7 Major → reviewer + tester, Security → reviewer + security_reviewer + tester, others none; A9 different vendor preferred. R8: child receives only the PR diff, the coder task's body, and the parent epic's PRD and architecture; never PR body, coder report, settle summary, commit messages, transcript or Q&A. Q3: tester produces findings only. ## Approach (Architect §4.6 C6a, AD15) - Personas in `persona_registry.PERSONA_RECORDS`: `reviewer`, `security_reviewer`, `tester` — mode=analysis, delivery=db, terminals=("review",), manifest `report`, no licence, autonomous_default=True, model="high". - New terminal `review` in `task_manifest.TERMINAL_TYPES` (`task_manifest.py:87-93`), the jaahd mirror + parity test, and `task_terminal.settle_task`; `findings` (list, may be empty) required → `review_findings.record(lane='blind_<persona>')`. - Migration: `tasks.review_target jsonb null` = {coder_task_id, pr_number, pr_url, base_branch, head_branch, head_sha}. - Spawn: `blind_review.on_tier` registered on `declare_tier`; acts when plan feature on, `project.blind_review` on, tier ∈ {major, security}; idempotent per (coder, persona), upgrades add only missing; children `ready`, `parent_task_id=coder.id`, NO task_dependencies edges; `review_target` from the coder's last PrQueueIn, head_branch = `projects.branch_prefix` + `task-<id>`. No head_sha ever reported → nothing spawned and the coder's Routing panel says why. - Body: `blind_review.compose_body` from coder title + body only + fixed role brief (inspect only the uncommitted diff; do not inspect history or `jaah-forge pr view` the authoring PR). `blind_review.epic_inputs` walks coder.parent_task_id to its business_analysis/architecture children and reads current `prd`/`architecture` via `task_artifacts.current_artifact`, fed through a REVIEW_PERSONAS branch in `_task_prerequisite_artifacts` (`task_wire.py:1360-1369`). - Control-tool refusal: `task_read`, `task_get` peers, `artifact_read`, `task_search` refuse the reviewed coder task and its artifacts to a REVIEW_PERSONAS caller (same 404 as no access). - Lease intent: send `blind_apply` (C6b contract). Placement predicate `blind_review.node_can_run(node_row)` (reads `nodes.launch_kinds` for `blind_checkout`) in `build_dispatch_plan`'s candidate filter (`routes/fleet.py:1221`) and `placement_grants._node_refusal` (`:497`) feeding `unplaceable_reason` (`:348`) — never in `_account_refusal`. Turning Blind review on with no capable static node is refused with a named reason shown on the project toggle; MicroVM projects refused. - Advisory: nothing reads the children's state for the coder, merge lane, epic rollup or Finish (rollup and Finish ignore REVIEW_PERSONAS). Findings render in C2's Review findings tab. Credentials & reach: - Dev UI flows (AC10, AC11 merge-lane observation, AC12): `me/jaah/debug/main/operator-login` and `org/console/dev-login` — verified. - Pool git access to github.com/jaah-ai/jaah — verified. - Dev pool nodes advertising `blind_checkout` — deferred until C6b's package is deployed to dev. - AC10 "different provider": dev Jaah org accounts on two built-in providers — deferred (operator to confirm). - AC11 API test: the worktree only — verified. Out of scope: changing account quota semantics or spillover; training a model from scratch; routing analysis personas before coder tasks have data; public marketplace billing; any ledger metric definition (owned by the outcome ledger epic). MUST NOT make findings block, delay or gate a PR, the merge lane or a settle. MUST NOT pass the author's self-assessment to a blind child. MUST NOT change the code-review policy's tier definitions. Do NOT write ledger facts (C9). Done means: - AC10 Blind reviewer child on a different provider (Blind review ON, different vendor ON, declared Major). → Verify: on dev in the Jaah project, a coder task whose runner declares Major spawns `reviewer` and `tester` children (A7), visible on the coder task page with their provider. The reviewer's provider differs from the coder's when another eligible provider is available. Its routing decision says so. Declaring Security-sensitive additionally spawns `security_reviewer`. Declaring Standard or nothing spawns none. With Blind review OFF, nothing spawns. - AC11 Blindness and advisory. → Verify: an API test asserts the child's composed prompt contains the diff, the task body and the PRD/architecture, and contains none of the PR body, coder report, settle summary, commit messages or transcript. On dev, a child 🔴 finding does not change the coder PR's merge-lane state; the PR merges on its gate alone. Tightened (R4d): the API test is built on a real epic chain (epic → BA/architect with artifacts → coder with a report and summary → child) through `dispatch_compose/task_prompt.build_task_prompt`, and also asserts the task-tool refusal. - AC12 Findings recorded (pre-ledger). → Verify: on dev, the coder task page lists the child's findings with severity, file:line, category, the detecting configuration and the authoring configuration. - Gates (AC16): `./dc check quick` green; changed-area suites green; merge lane `./dc check full` green.

Activity

  • Draft
  • Ready