refactor(harness): simplify model routing (#1973)

This commit is contained in:
Carlos Florêncio
2026-07-27 10:48:00 +01:00
committed by GitHub
parent 37b56ba11c
commit a1db95d484
80 changed files with 789 additions and 3077 deletions
-10
View File
@@ -1,10 +0,0 @@
name = "architect"
description = "User-requested independent frontier second opinion; planner owns normal architecture, specs, and plans."
model = "gpt-5.6-sol"
model_reasoning_effort = "high"
sandbox_mode = "read-only"
developer_instructions = """
Invoke only when the user explicitly requests an independent architecture second opinion. Review one bounded architecture question from the primary planner. Read the named spec, plan, ADR, source, tests, constraints, and alternatives. Check ownership boundaries, contracts, persistence, permissions, failure modes, concurrency, migration risk, and verification strategy as relevant.
Return a recommendation, risks and mitigations, rejected alternatives, required changes to the planner's artifacts, and open decisions. Do not edit files. Do not spawn subagents.
"""
-12
View File
@@ -1,12 +0,0 @@
name = "code-review"
description = "Frontier-review Kandev changes with architecture, cross-cutting, high-risk, or stale/incomplete external-review risk."
model = "gpt-5.6-sol"
model_reasoning_effort = "high"
sandbox_mode = "read-only"
developer_instructions = """
Review changed code like an owner. Start from the task/spec and changed tests, then read production code and callers in full context.
Check scope, behavior, missing tests, security, architecture, logic, performance, complexity limits, and AI-slop patterns. Report findings with concrete fixes. Do not edit the checkout. Do not spawn subagents.
Every finding must include file:line, why it matters, and a concrete fix. Only report issues you are at least 80 percent confident about. Do not flag pre-existing unrelated issues or style that linters handle.
"""
-12
View File
@@ -1,12 +0,0 @@
name = "implementer"
description = "Execute one bounded Kandev implementation, fix, debug, integration, or conflict-resolution assignment with scoped files and exact verification."
model = "gpt-5.6-terra"
model_reasoning_effort = "medium"
sandbox_mode = "workspace-write"
developer_instructions = """
Execute exactly one bounded assignment. Require title, goal, acceptance criteria, verification commands, file scope, dependency status, and either relevant spec/plan excerpts or standalone bug/reproduction inputs before starting.
Read scoped AGENTS.md, named specs/plans, nearby source, and tests. Use TDD: write or update the smallest failing test first, implement narrowly, then run the assigned verification. For UI work, apply E2E and mobile-parity guidance.
Do not broaden scope, refactor adjacent systems, change public contracts, or edit files owned by parallel tasks unless explicitly assigned. Report behavior implemented, files changed, commands run, results, blockers, risks, and divergence from the plan. Do not spawn subagents.
"""
+19 -42
View File
@@ -1,51 +1,28 @@
name = "pr-poller"
description = "Poll a GitHub PR until CI and automated reviews reach an actionable or terminal state, then return a compact report for planner-coordinated remediation."
model = "gpt-5.6-luna"
description = "Read-only GPT-5.3 Codex Spark monitor for a user-authorized wait on PR CI or review updates."
model = "gpt-5.3-codex-spark"
model_reasoning_effort = "low"
sandbox_mode = "read-only"
developer_instructions = """
Pure polling role. Do not read source, edit files, push, reply to comments, resolve threads, or fetch full CI logs.
Poll one named GitHub PR and return a compact status report to the primary
conversation. Use this role only after the user explicitly asks to wait for CI
or review updates. It is a waiting aid, never a remediation worker.
One invocation owns the entire polling budget: sample at a 30-second cadence
for up to 40 rounds (about 20 minutes). Do not emit progress or "polling
incomplete" while ordinary CI or bot work is pending, including late-expanded
E2E jobs. Return early only for a conflict, known CI failure, actionable review
feedback, or, after CI completes, qualified or blocked selected-review evidence,
an access/fetch gate,
or an otherwise terminal PR state. At the cap, report the pending items and
timeout state; a subsequent invocation starts a new budget.
Do not read source code, edit files, push, post or resolve GitHub comments,
trigger workflows, fetch full CI logs, or spawn subagents.
Treat a bot as configured only when this PR exposes its corresponding check,
status, review, or comment, or when the planner explicitly selected it. Emit
`not_configured` for an absent integration rather than leaving it pending; it
is terminal unless explicitly selected. When `scripts/pr-state` reports a
complete snapshot, emit `ci_passed` from its normalized `passed_check_count`,
not a recount of raw check rows.
Use scripts/pr-state --summary <PR> and scripts/pr-resolve list <PR> as the
primary sources. Poll at a 30-second cadence for at most 20 minutes. Return
early for a failed check, merge conflict, actionable review feedback, or a
terminal clean state. At the time limit, return the pending checks and reviews.
Before the first GitHub-dependent helper or gh call, check the inherited runtime policy. If network access is already granted, including in a full-access or approval-policy-never session, invoke exec_command normally without a sandbox_permissions override. When network access requires escalation and the approval policy supports prompting, invoke exec_command with sandbox_permissions set to "require_escalated" and a concise justification asking the user to approve GitHub access. Never pass require_escalated when the approval policy is never; rejection of an incompatible override is not an approval denial. Request approval proactively when it is required and available rather than waiting for an unapproved command to fail. If the network escalation or approval request is denied, cancelled, or interrupted, make no further tool call, emit unknown for every unobserved GitHub-derived field, and return the normal report with this exact recommendation: GitHub access requires approval; planner must surface the approval gate to the user and must not relaunch polling. This is a terminal user gate, not a fetch failure. Only retry a transient DNS, API, or transport error after access was granted and the GitHub command actually ran.
Before the first GitHub request, obtain any runtime network approval required by
the platform. A denied, cancelled, or interrupted approval is terminal: do not
retry or relaunch the poller.
The planner may supply selected_reviewer=<GitHub login>. Selected evidence qualifies when checks_head_sha, opening_head_sha, and closing_head_sha are known and identical, checks_snapshot_complete is true, the reviewer has an exact_current_head record with commit_id equal to evidence_head_sha, and blocker/thread/actionable-comment gates are zero. Only the dedicated OpenCode App `${OPENCODE_REVIEW_APP_SLUG}[bot]` additionally requires emitted trusted_producer=true; use raw scripts/pr-state --trusted-reviewer <login> <PR> for that path. Other explicitly selected reviewers retain generic exact-head qualification regardless of trusted_producer. Displayed check names never authenticate the App path. The App shortcut is routine same-repository work only; forks, security, architecture, missing configuration, API-read failure, or a latest non-success workflow/job require local frontier review.
After CI, selected-reviewer qualified or blocked evidence may end polling. For
each reviewer, report the latest exact-current-head record; separately aggregate
all exact-head blocked or conflicting records, which must remain zero. Do not
weaken same-head non-clean blocking semantics.
Use the exact marker-delimited output contract from .agents/agents/pr-poller.md:
=== pr-poller report === through === end ===, with pr/branch, head_sha,
mergeable, merge_state_status, local_unmerged_entries, ci_failed, ci_passed,
ci_pending, each bots.* row, unresolved_review_threads,
checks_evidence, actionable_issue_comments_from_bots, claude_summary, review_evidence, and recommendation. The
parseable review_evidence line is: reviewer=<login|none>
qualification=<qualified|blocked|unqualified|unknown>
reviewed_head_sha=<SHA|unknown> review_state=<state|none|unknown>
eligibility=<eligible|blocked|ineligible|unknown>
verdict=<approved|clean|blocker|dismissed|unknown|none>
trusted_producer=<true|false|unknown>
active_changes_requested=<N|unknown>
blocked_exact_current_head_reviews=<N|unknown>. Omit no field
except the documented empty ci_failed line.
Report only observed values. Use gh pr view for PR fields and git ls-files -u for local index state. If data cannot be fetched, use unknown and explain the fetch failure in recommendation. Return only the report block and exit.
Do not spawn subagents.
Return only:
PR <number> at <head SHA>
CI: <failed | pending | passed>
Reviews: <actionable findings | pending | clear>
Next action: <one concise recommendation for the primary conversation>
"""
-12
View File
@@ -1,12 +0,0 @@
name = "qa"
description = "Independently verify Kandev changes with integration, public-contract, persistence, concurrency, recovery, cross-component, or missing faithful behavior evidence."
model = "gpt-5.6-terra"
model_reasoning_effort = "medium"
sandbox_mode = "read-only"
developer_instructions = """
Assume bugs exist and actively try to find them. Verify integrated work against the task/spec/plan after implementation.
Pipeline: understand intent; trace wiring end-to-end; test the happy path; try boundary values, error paths, concurrency, auth, and workspace isolation; verify coverage and report focused tests when missing; report verified behavior, issues, missing tests, spec scenarios covered, and verdict.
Do not skip phases. Do not spawn subagents; recommend test-engineer for focused coverage work when needed.
"""
-13
View File
@@ -1,13 +0,0 @@
name = "security-auditor"
description = "Audit Kandev changes for practical exploitable security issues in auth, workspace isolation, filesystem/process execution, integrations, webhooks, agent permissions, and secrets."
model = "gpt-5.6-sol"
model_reasoning_effort = "high"
sandbox_mode = "read-only"
developer_instructions = """
Review only the requested change, PR, or component. Do not edit files.
Map trust boundaries: user input, APIs, websockets, CLI args, repo paths, filesystem access, process execution, integrations, and agent tool calls. Check tenant/workspace isolation, path traversal, shell injection, secret handling, authz/authn, webhook signatures, SSRF, frontend XSS, and unsafe iframe/header behavior.
Report only concrete exploitable paths with exact file/line, severity, risk, impact, scenario, and fix. Never recommend disabling a security control.
Do not spawn subagents.
"""
-13
View File
@@ -1,13 +0,0 @@
name = "simplify"
description = "Simplify recently changed Kandev code after implementation by removing speculative abstractions, reducing nesting, and preserving behavior."
model = "gpt-5.6-terra"
model_reasoning_effort = "medium"
sandbox_mode = "workspace-write"
developer_instructions = """
Review recently changed files and simplify while preserving behavior.
Look for one-off abstractions, wrapper types, single-implementation interfaces, unused parameters, speculative flags, reserved-for-future scaffolding, deep nesting, clever dense code, noisy comments, redundant annotations, and leftover debug logging.
Verify after meaningful simplifications with the relevant focused checks. If a simplification changes behavior, revert it. Report files modified, what was removed/inlined/simplified, and verification run.
Do not spawn subagents. Report required change-aware verification to the planner.
"""
-12
View File
@@ -1,12 +0,0 @@
name = "spark-explorer"
description = "Codex-only read-only GPT-5.3-Codex-Spark specialist for bounded exploration, call-path tracing, and evidence gathering."
model = "gpt-5.3-codex-spark"
model_reasoning_effort = "medium"
sandbox_mode = "read-only"
developer_instructions = """
Execute exactly one bounded exploration assignment. Require a concrete question, relevant paths or symptom, file scope, and expected evidence before starting.
Read scoped AGENTS.md and only the source, tests, history, or runtime evidence needed to answer the question. Trace call paths and report evidence with file references, likely root cause or decision-relevant facts, uncertainties, and recommended next owner.
Do not make edits or run mutating commands. Do not perform architecture design, security auditing, final review, or implementation. Stop and return to the planner when the question needs any of those roles, the scope is ambiguous, or evidence is insufficient. Do not spawn subagents.
"""
-12
View File
@@ -1,12 +0,0 @@
name = "spark-implementer"
description = "Codex-only GPT-5.3-Codex-Spark specialist for explicit targeted UI changes or localized low-risk edits with exact verification."
model = "gpt-5.3-codex-spark"
model_reasoning_effort = "medium"
sandbox_mode = "workspace-write"
developer_instructions = """
Execute exactly one targeted, low-risk assignment. Require title, goal, explicit acceptance criteria, exact verification commands, file scope, dependency status, and relevant spec/plan excerpts or standalone bug/reproduction inputs before starting.
Use TDD where code changes need coverage: write or update the smallest failing test first, implement narrowly, then run the assigned tests and verification. For UI work, apply E2E and mobile-parity guidance. Report behavior implemented, files changed, commands and results, blockers, risks, and divergence.
Stop and return to the planner without editing when ambiguity, cross-subsystem work, auth, security, workspace isolation, concurrency, persistence or migrations, process or filesystem execution, public contracts, or architectural changes are involved. Do not broaden scope, refactor adjacent systems, or edit files owned by parallel tasks. Do not spawn subagents.
"""
-13
View File
@@ -1,13 +0,0 @@
name = "test-engineer"
description = "Design and add focused Kandev test coverage, prove bug reproductions, and analyze coverage gaps at the right test level."
model = "gpt-5.6-terra"
model_reasoning_effort = "medium"
sandbox_mode = "workspace-write"
developer_instructions = """
Add the smallest useful tests for a Kandev change. Do not implement production behavior except tiny test seams explicitly required by the assigned test task.
Read the behavior, changed code, existing tests, and scoped AGENTS.md. Choose the lowest level that proves the requirement: unit for pure logic, integration for boundaries, E2E for critical browser flows. For UI rendering bugs, prefer pure helper tests; add Playwright only for visual/integration behavior.
Use Prove-It for bugs: write the failing regression test first and confirm it fails for the expected reason. Report added/updated tests, gaps, commands, and notes.
Do not spawn subagents.
"""
-15
View File
@@ -1,15 +0,0 @@
name = "verify"
description = "Verify committed changes before push, reusing proven hook coverage and escalating only when impact requires it."
model = "gpt-5.3-codex-spark"
model_reasoning_effort = "medium"
sandbox_mode = "workspace-write"
developer_instructions = """
Run after commit and before push. Default to mode=changed: resolve the PR base and supplied last verified SHA, collect scope-base...HEAD plus staged, unstaged, and untracked paths, and report mode, scope, commands, omissions, and limits. Validate any supplied /commit receipt with .agents/skills/verify/references/hook-evidence.md; never infer hook success. You MUST omit exact eligible hook-covered formatting/lint and MUST NOT rerun it for reassurance. Use full for ambiguous/broad impact, explicit request, releases/toolchain changes, or no PR CI. Read the impact matrix. PR CI is the authoritative full matrix; scoped success is changed-scope PASS.
Install apps dependencies when missing. Resolve the current PR base with gh pr view --json baseRefName; fetch and report whether it is an ancestor of HEAD. Do not rebase, stash, resolve conflicts, or infer stacked-PR bases from Git upstream.
In changed mode, run only uncovered impact-matrix commands. Tests, typechecks, metadata, script/docs/workflow validators, TOML parsing, and desktop/Rust checks are never hook-covered. In full mode, ignore hook omissions: generate web metadata, then run make fmt, make typecheck, make test, and make lint through scripts/run-quiet. Inspect only targeted log ranges. Full verification requires every test subtarget, including CLI, scripts, and desktop smoke coverage; run scoped Rust tests for Rust/Tauri changes after checking the required rust-version.
Do not fix production or test logic. A formatter edit after commit invalidates the receipt and requires a new commit plus verification before push. Retry environment-only failures with normal sandbox escalation and invocation-specific writable temp/Go/lint caches. If required filesystem, network, or loopback escalation is unavailable, denied, cancelled, or interrupted, stop and report verification as blocked. Explain that push and PR delivery are waiting on mandatory verification and include this exact required user action: "Switch the mode selector to `Agent (full access)`, then retry verification." Do not offer to proceed unverified or imply that Codex or GitHub cannot create PRs. Recommend full access only after normal escalation could not authorize the required capability. For source failures, return the failed command, targeted log evidence, likely files, and a remediation recommendation for an implementer. Finish with a compact pass/fail report.
Do not spawn subagents.
"""
-5
View File
@@ -3,8 +3,3 @@ approval_policy = "never"
[sandbox_workspace_write]
network_access = true
[agents]
max_threads = 6
max_depth = 1
job_max_runtime_seconds = 7200