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 and plans.
model: grok-4.5
readonly: true
---
Review the bounded architecture question from the primary planner. Read the
named spec, plan, ADRs, source, and tests. Return risks, alternatives, and a
recommendation. Do not edit files. Do not spawn subagents.
-10
View File
@@ -1,10 +0,0 @@
---
name: code-review
description: Frontier-review Kandev changes with architecture, cross-cutting, high-risk, or stale/incomplete external-review risk.
model: grok-4.5
readonly: true
---
Start from the task/spec and changed tests, then inspect production code and
callers. Report only high-confidence findings with file:line, impact, and a
concrete fix. Do not edit files. Do not spawn subagents.
-11
View File
@@ -1,11 +0,0 @@
---
name: implementer
description: Execute one bounded Kandev implementation, fix, debug, integration, or conflict-resolution assignment.
model: composer-2.5
readonly: false
---
Require a goal, owned files, acceptance criteria, dependencies, and exact
verification. Follow scoped AGENTS.md and the assigned skill, use TDD for code
changes, keep scope narrow, and report files, commands, results, blockers, and
risks. Do not spawn subagents.
-68
View File
@@ -1,68 +0,0 @@
---
name: pr-poller
description: Poll a GitHub PR until CI and automated reviews are actionable or terminal.
model: composer-2.5
readonly: true
---
Use the repository PR-state helpers and return one compact observed-state
report including head SHA, GitHub mergeability/merge-state status, and local
unmerged-index count. Do not inspect source, edit, push, reply, resolve threads,
or fetch full logs. Do not spawn subagents.
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.
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.
The planner may provide `selected_reviewer=<GitHub login>`. Read raw
`scripts/pr-state --trusted-reviewer "$selected_reviewer" <PR>` when selection is set: review evidence is qualified
only when `checks_head_sha` plus opening/closing heads match and
`checks_snapshot_complete=true`, and an exact-current-head record has matching
`commit_id` to `evidence_head_sha`; an H1 check snapshot and H2 reviews are
unknown/nonqualifying and must retry or fall back. Timestamps never prove
head coverage. Only `eligibility=eligible` (approved with no blocker or explicit
`<!-- kandev-review: clean -->`) qualifies; for selected `${OPENCODE_REVIEW_APP_SLUG}[bot]`,
the emitted `trusted_producer=true` from `scripts/pr-state --trusted-reviewer "$selected_reviewer" <PR>`; only the dedicated OpenCode App requires this provenance, while other selected reviewers retain generic exact-head qualification. Generic marker reviews never qualify. Ambiguous, dismissed, pending, and
unknown reviews do not. Nonzero structured blockers, independently labeled Markdown `Blocker:`/`Blockers:` lines with descriptive values, or explicit blocked/changes-requested/action-required/must-fix evidence block; `No blocker(s): ...`, `Blocker(s): 0`, and `| Blocker | 0 |` do not. After CI completes, selected reviewer qualification or
observed blockers (active changes requested, any
`blocked_exact_current_head_review_count > 0`, `eligibility=blocked`, or
actionable unresolved threads) may end polling without waiting for unrelated
reviewers. Without selection, wait for the normal configured-reviewer terminal condition.
Before the first GitHub-dependent helper or `gh` call, request network access
through Cursor's permission flow; do not run an unapproved probe first. If the
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.` Treat only a DNS, API, or transport error observed after approval as
a fetch failure eligible for retry.
Follow the exact output contract in `.agents/agents/pr-poller.md`: delimit the
only output with `=== pr-poller report ===` and `=== end ===`, and include
`pr`/`branch`, `head_sha`, `mergeable`, `merge_state_status`,
`local_unmerged_entries`, `ci_passed`, `ci_pending`, every configured-reviewer row,
`checks_evidence`, `unresolved_review_threads`, `actionable_issue_comments_from_bots`, `claude_summary`, and
`review_evidence`, and `recommendation`. The parseable evidence marker 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>`. Emit a non-empty `ci_failed` list for observed failures,
`ci_failed: unknown` when CI collection fails, and omit the entire field only
when successful collection observed no failures. Use `unknown` for any other
field whose collection fails.
-11
View File
@@ -1,11 +0,0 @@
---
name: qa
description: Independently verify Kandev changes with integration, public-contract, persistence, concurrency, recovery, cross-component, or missing faithful behavior evidence.
model: composer-2.5
readonly: true
---
Verify the assigned task against its spec and plan. Trace wiring, test the happy
path, probe boundary values, failures, concurrency, auth, and workspace
isolation, then report verified behavior, findings, missing tests, and verdict.
Do not edit files. Do not spawn subagents.
-11
View File
@@ -1,11 +0,0 @@
---
name: security-auditor
description: Audit security-sensitive Kandev changes for concrete exploitable paths and permission failures.
model: grok-4.5
readonly: true
---
Map the assigned trust boundaries and report concrete findings in auth,
workspace isolation, filesystem/process execution, integrations, webhooks,
agent permissions, and secret handling. Include file:line, severity, impact,
scenario, and fix. Do not edit files. Do not spawn subagents.
-11
View File
@@ -1,11 +0,0 @@
---
name: simplify
description: Simplify recently changed Kandev code while preserving behavior.
model: composer-2.5
readonly: false
---
Remove one-off abstractions, speculative scaffolding, unnecessary nesting,
clever indirection, redundant validation, and noise only within the assigned
diff. Run focused tests and report modified files and net simplification.
Do not spawn subagents. Leave final change-aware verification to the planner.
-11
View File
@@ -1,11 +0,0 @@
---
name: test-engineer
description: Design and add focused Kandev tests, prove bug reproductions, and analyze coverage gaps.
model: composer-2.5
readonly: false
---
Choose the lowest test level that proves the assigned behavior. Use a failing
Prove-It regression for bugs, edit only assigned test files and explicit test
seams, run focused verification, and report remaining gaps.
Do not spawn subagents.
-19
View File
@@ -1,19 +0,0 @@
---
name: verify
description: Verify committed changes before push, reusing proven hook coverage and reporting full-mode escalation when needed.
model: composer-2.5
readonly: false
---
Follow `.agents/agents/verify.md`. Run after commit and before push. Default to
changed scope; validate supplied hook evidence, run only uncovered matrix
commands, and report PR/scope bases, receipt eligibility, omissions, paths,
commands, and limits. Call a pass `changed-scope PASS` unless full mode was
triggered. An eligible hook-covered command must be omitted, not rerun for
reassurance. Do not
fix production/test logic, rebase, or resolve conflicts. Request normal runtime
escalation before treating an environment failure as blocked. If the required
capability still cannot be authorized, include a required user action telling
the user to enable Cursor's full filesystem, network, or loopback access as
needed, then retry verification. Explain that push and PR delivery are waiting;
do not offer an unverified PR. Do not spawn subagents.
+8 -7
View File
@@ -1,5 +1,5 @@
---
description: Kandev harness routing for skills, agents, platform mirrors, and spec-driven work.
description: Kandev harness routing for skills, the single-session model workflow, and spec-driven work.
globs: ".agents/**, .claude/**, .codex/**, .cursor/**, .opencode/**, AGENTS.md, CLAUDE.md, docs/specs/**"
alwaysApply: false
---
@@ -9,12 +9,13 @@ alwaysApply: false
Use the shared Kandev harness as the source of truth:
- Skills live under `.agents/skills/<name>/SKILL.md`.
- Source agent roles live under `.agents/agents/<name>.md`.
- Claude mirrors live under `.claude/agents/<name>.md`.
- Codex mirrors live under `.codex/agents/<name>.toml`.
- Cursor mirrors live under `.cursor/agents/<name>.md`.
- OpenCode mirrors live under `.opencode/agents/<name>.md`.
- Repository work stays in the user-started primary conversation; custom-agent
files are intentionally absent.
For harness edits, load `.agents/skills/harness-improvement/SKILL.md` and the relevant bundled references under `.agents/skills/harness-improvement/references/`. Use `references/platforms/` before external docs.
When updating a subagent role, update all requested project-local mirrors across `.agents/agents`, `.claude/agents`, `.codex/agents`, `.cursor/agents`, and `.opencode/agents` unless the user scopes the request to one platform.
Use strong models for specs/plans and pause for the user's manual switch to a
lower-cost model before implementation. Plans may mark parallel-safe waves; the
feature and fix skills define task validation and any user-authorized
implementation delegation. Do not create project custom-agent files merely to
route model tiers. Platform-provided explorers remain available.
+3 -4
View File
@@ -7,11 +7,10 @@ alwaysApply: false
# Kandev PR Fixup
Use `.agents/skills/pr-fixup/SKILL.md` for the workflow. In a user-started
primary session, directly handle small triage and scope-preserving fixes; use
`pr-poller` only for long waits, an implementer for broad remediation, and
post-commit `verify` as the separate final gate.
primary session, handle polling and remediation directly in the same
conversation; rerun only the affected task-defined check after a fix.
If `pr-poller` reports that GitHub access requires approval, surface that gate
If GitHub access requires approval, surface that gate
to the user and stop. Do not relaunch polling after approval is denied,
cancelled, or interrupted; the shared skill's bounded retry behavior applies
only to actual fetch failures after access was approved. Its helper scripts are