jaahd blind checkout for review children

Task 12291 · Running · Coder · created · updated

Epic 12251, child C6b (jaahd side of blind review; the CP side is C6a, built in parallel against the pinned contract below). ## 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 - Operator Q2: base plus diff applied. jaahd leases a worktree, checks out the PR's merge-base detached, and applies the PR diff as uncommitted changes before the session starts. No PR branch name, PR body or commit message is supplied to the session. Blindness = not supplied and forbidden by prompt and CP tool refusal; fetched git objects remaining reachable is accepted. - Q3: the blind tester produces findings only (no commits, no PR). ## Approach (Architect §4.6 C6b — pinned contract) - Lease intent key in `fleet_verdicts.build_lease_intent` (static only): `"blind_apply": {"head_branch": str, "head_sha": str, "base_branch": str, "pr_number": int|null}`. (C6a sends it.) - Capability: jaahd adds `blind_checkout` to its reported `launch_kinds`. Older packages never advertise it, so the CP never places a review child there. MicroVM nodes do not advertise it. - New `apps/jaahd/blind_checkout.py`, run in the lease executor after the slot checkout and before launch: 1. `git fetch --no-tags origin <head_branch>`; on failure fall back to `refs/pull/<n>/head` on GitHub. 2. Verify `head_sha` is the fetched tip or an ancestor. If neither, use the fetched tip and write a note file the role prompt surfaces ("the PR moved since it was reported"). 3. `mb = git merge-base origin/<base_branch> <head_sha>`; `git checkout --detach <mb>`. 4. `git diff --binary <mb> <head_sha> | git apply --index`; `git reset -q`; `git update-ref -d FETCH_HEAD`; delete the fetched remote-tracking ref for the head branch. 5. Assert the working-tree diff is non-empty and its patch-id equals `git patch-id` of `<mb>..<head_sha>`; otherwise refuse the launch with a named reason (normal retry path). Credentials & reach: - Pool node's git access to github.com/jaah-ai/jaah (task forge identity through the worktree remote) — verified (`git ls-remote origin` and `git fetch --dry-run origin <full sha>` succeeded from a pool worktree). Other forges covered by branch-first fetch and unit tests. - Dev pool nodes advertising `blind_checkout` — deferred until this child's `.deb` reaches dev nodes; this child observes it in the console Nodes view after deploy. 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). Do NOT build the CP side (personas, spawn, terminal, placement predicate — C6a). Do NOT supply PR body, commit messages or branch names to the session. MicroVM support is out of this epic. Done means: - AC10 (code side): a review lease carrying `blind_apply` yields a detached worktree at the merge-base with exactly the PR diff applied uncommitted. Unit tests (real temp git repos, not mocks of git) cover: moved base, merged PR, force-pushed head (note file written), empty diff (launch refused with named reason), and the patch-id mismatch refusal. A test asserts FETCH_HEAD and the head remote-tracking ref are gone before launch. - `blind_checkout` appears in `launch_kinds` reported by the new package; an older-version fixture does not report it. - After deploy: observe `blind_checkout` on a dev node in the console Nodes view. - Gates (AC16): `./dc check quick` green; changed-area suites (apps/jaahd) green; merge lane `./dc check full` green.

Activity

  • Draft
  • Ready
  • Runner started