Goal
Findings from bug-hunting settlers must not go straight to GitHub. An orchestrator validates them first; validated findings become issues; the operator can opt into autofix and merge; and every resulting PR is reviewed by a fresh session running the orchestrator model — never by the colony that wrote it.
Evidence
- Findings already exist:
crates/colonizer/src/findings.rs — Finding {title, body, evidence} (~27), filed as GitHub issues with Filed::Issue | Duplicate (~34), capped at MAX_PER_COLONY = 5 (~20). They are emitted as finding events into events.jsonl and counted by scripts/colony-report.mjs, but are not exposed over HTTP.
- Model routing already exists per colony:
Session.model_tier, model_routing, routed_cost_usd (web/src/types.ts ~50–55) plus the gateway/provider layer (crates/colonizer/src/providers.rs, gateway.rs, routing module). "Use the orchestrator model" is therefore a routing decision, not new plumbing.
POST /api/sessions launches a colony, POST /api/sessions/{id}/publish publishes, and Session.publish_stage (crates/colonizer/src/publish.rs) tracks PR state. Merges are not currently acted on (see the open issue about PR state stopping at pr_opened).
- Autopilot plus watchdog attention reasons (
stalled, waiting_for_answer, nudges_exhausted, autopilot_held) give the hold/resume primitives an orchestrator gate needs.
Requested shape
- Expose findings. Serve a colony's findings over HTTP (per session, plus an aggregate feed) including their
Filed state, so the cockpit can show what was found and what was filed.
- Validation stage. Every finding goes to an orchestrator session before filing. It decides: real or not, duplicate-of, severity — and only then files the issue, reusing the
findings.rs filing path including duplicate detection. Rejected findings are recorded with a reason and shown as rejected, never silently dropped.
- Autofix + merge (opt-in, per run and globally). When enabled, a validated finding spawns a fix colony on its own branch; its PR is reviewed by a new session on the orchestrator model with no shared context with the author. Merge only on a passing review; a failing review posts the review as a PR comment and leaves the PR open for a human.
- Independence is a hard invariant. The reviewer must be a different session id with a fresh context. Enforce it in code — reject a review whose session is the author's — and cover it with a test.
- Auditability. Each stage emits an event (
finding, validated, rejected, fix_colony, review, merged) so scripts/colony-report.mjs and the cockpit timeline can reconstruct the chain and the overview can show per-stage counts.
- Default behaviour is validate-and-file only. Autofix, and autofix+merge, are separate escalating opt-ins.
Done when
Credited to @colonizer-settlers as co-author on this issue.
Goal
Findings from bug-hunting settlers must not go straight to GitHub. An orchestrator validates them first; validated findings become issues; the operator can opt into autofix and merge; and every resulting PR is reviewed by a fresh session running the orchestrator model — never by the colony that wrote it.
Evidence
crates/colonizer/src/findings.rs—Finding {title, body, evidence}(~27), filed as GitHub issues withFiled::Issue | Duplicate(~34), capped atMAX_PER_COLONY = 5(~20). They are emitted asfindingevents intoevents.jsonland counted byscripts/colony-report.mjs, but are not exposed over HTTP.Session.model_tier,model_routing,routed_cost_usd(web/src/types.ts~50–55) plus the gateway/provider layer (crates/colonizer/src/providers.rs,gateway.rs, routing module). "Use the orchestrator model" is therefore a routing decision, not new plumbing.POST /api/sessionslaunches a colony,POST /api/sessions/{id}/publishpublishes, andSession.publish_stage(crates/colonizer/src/publish.rs) tracks PR state. Merges are not currently acted on (see the open issue about PR state stopping atpr_opened).stalled,waiting_for_answer,nudges_exhausted,autopilot_held) give the hold/resume primitives an orchestrator gate needs.Requested shape
Filedstate, so the cockpit can show what was found and what was filed.findings.rsfiling path including duplicate detection. Rejected findings are recorded with a reason and shown as rejected, never silently dropped.finding,validated,rejected,fix_colony,review,merged) soscripts/colony-report.mjsand the cockpit timeline can reconstruct the chain and the overview can show per-stage counts.Done when
docs/protocol.mddocuments the new events and endpoints.Credited to @colonizer-settlers as co-author on this issue.