From ask to release: humans decide, agents do the work
A delivery workflow for Precursor where every request becomes an issue, an agent specifies it, another builds it, a different one reviews it, and a human makes the call at a few gates, set by risk. It runs the same from the Claude app, the Copilot app, or Copilot on GitHub, because the shared contract is GitHub state plus shared prompt files, not the tool that runs them.
Principles
Five rules. Every later choice follows from them.
Workflow state lives in issue/PR labels, assignees and linked PRs. Any agent, local or hosted, reads and moves the same state with gh. Nothing depends on one tool's memory.
Each role is one skill file, written once (today's ship-change and release prompts are the start). Claude, Copilot and hosted Actions all load the same file.
The run that writes a PR never reviews or approves it. A separate, read-only run reviews it against the same written rules.
Docs and minor dependency bumps merge on green. Features need a human click. Auth, telemetry, migrations and workflows get a human review of the diff.
Review loops have a round limit, agents have concurrency and budget caps, two kill switches stop agents and releases, and an agent can open a revert PR at any time.
Rules, skills, tools, agents
The contributor setup has four layers: rules that are always loaded, skills loaded when a task needs them, tools, and an agent, with a human who decides. Each cell shows what is in the repo today, then (→) what this proposal adds.
CLAUDE.md, copilot-instructions.md, ARCHITECTURE.md, CONTRIBUTING.md; quality ratchet limitsAGENTS.md as the one entry point that every tool reads; ADRs in docs/adr/, starting with this proposalmake check (lint, mypy, tests, ratchet, API types, build); 5 workflows: CI, nightly, release, relock, pages; DependabotRELEASE_HOLDThe flow, lane by lane
Columns are stages; rows are who acts. Purple outlines are human gates. Hover a card for its details. The release column already exists (release.yml, nightly, CI-gated). Today, merging is the decision to ship.
↻ Ops loops back to Intake: failed runs, flaky tests, Dependabot majors and sanitised telemetry error reports become new issues, triaged like any other ask.
State machine: labels are the source of truth
One status:* label at a time on the issue. Agents only start work from the state that is theirs. A GitHub Project board can show the same data as a view, but it never holds the state.
status:needs-info (triage asked a question; returns to triage when the author answers) ·
status:needs-human (deadlock, R2, or an agent hit a limit) · wontfix / duplicate (closed with reason).
Orthogonal labels:
risk:r0|r1|r2 · agent:build / agent:docs (opt-in triggers for hosted runs) ·
runner:local|hosted (who has claimed it) · type:*, surface:* (from the issue form).
Claiming: an agent assigns the issue and sets
runner:* before it starts. A second agent that finds it claimed backs off, which keeps local and hosted runs from colliding.
Agent roster
Eight roles. Each is a prompt file plus a trigger. “Both” means the same prompt runs from a local app session or a hosted workflow.
| Role | Trigger | Runs on | Reads | Writes | Token scope |
|---|
Each role is written once (format: see D13). Claude and Copilot load it locally; .github/workflows/agent-<role>.yml passes the same file to the hosted engine.
Review debate: contributor ↔ reviewer
Reviewer approves →
status:ready3 rounds or a
blocker is disputed → needs-humanReviewer files a follow-up issue rather than growing the PR
Rules of engagement
- Reviewer findings carry a severity:
blocker,shouldornit. Only blockers hold the merge. - For each finding, the contributor either fixes it (commit linked in the reply) or argues against it with evidence (a test, a doc, an
ARCHITECTURE.mdrule). It never stays silent and never resolves the reviewer's thread itself. - The reviewer re-checks only what changed and resolves its own threads.
- The reviewer checks the repo's own rules: reuse map, ratchet limits, generated API types, docs-impact checklist, no lockfile edits.
- On escalation, the human reads a one-comment summary (the dispute, both positions, and a recommendation), not the whole thread.
Risk classes and merge authority
The triage agent proposes the risk class from the issue, and a path-based labeler sets it from the diff. When the two differ, the higher class wins.
| Class | What falls in it | Spec gate | Review | Merge |
|---|---|---|---|---|
| R0 routine | website/, docs/, tests-only, typos, Dependabot minor/patch, changelog fragments | Skipped | 1 agent reviewer | Auto-merge on green CI + agent approval |
| R1 standard | Features and fixes in precursor/ and frontend/ outside the R2 paths | Human approves spec | 1 agent reviewer (separate run) | Human click after reading the PR summary and review verdict |
| R2 sensitive | Auth/tokens, services/telemetry/, Alembic migrations, .github/workflows/, release, MCP permissions, major dependencies, a raise of quality_baseline.json | Human approves spec | Agent reviewer + human diff review | Human, with a CODEOWNERS review request |
Human / agent share of effort, per stage
| Stage | Human (proposed) | Agent (proposed) | What the human still does |
|---|
Merge is its own stage because, with nightly releases, it is where the ship decision is made. These are targets to check against the P1–P4 metrics, not commitments.
Guardrails
Untrusted input
- Issue and PR text from anyone other than a maintainer is data. Hosted agents with write access run only after a maintainer sets
status:acceptedor anagent:*label. - Never use
pull_request_targetwith a checkout of the PR head. Review jobs on fork PRs are read-only and post comments through a separate, minimal job. - Agents don't follow links or run commands they find in issue bodies.
What agents may never do
- Push to
main, create tags, publish, or approve their own PR. - Edit
uv.lock/package-lock.json(the Relock workflow owns them), raisequality_baseline.json, or hand-editapiTypes.ts. - Change
.github/workflows/unless the issue is R2, and with a human-approved spec.
Limits & kill switches
- Copilot code review: switched off in the
mainruleset. RELEASE_HOLDrepo variable:release.ymlskips publishing and reports why.- At most N open agent PRs (start at 5), at most 3 review rounds, and a turn/time budget per hosted run.
Traceability
- Every agent comment and commit trailer names the role · runner · model (e.g.
reviewer · hosted · gpt-x). - The PR body links its issue, spec comment and risk class, and holds the docs-impact assessment already required by
copilot-instructions.md. - Weekly metrics: lead time (issue→release), review rounds, % escalated, % auto-merged, reverts, agent PRs closed without merging.
Decisions to take
Each decision has a recommended option. Your picks are saved in this browser. Export them as Markdown to paste into an issue or ADR.
Rollout: earn autonomy in stages
Each phase widens what agents do on their own only after the previous phase's metrics hold.
P1 · Observe done
- Labels, risk labeler, CODEOWNERS
- Triage agent (comments + labels only)
- Reviewer agent comments on every PR (advisory)
- Docs-impact check comment
- Kill-switch variables
P2 · Specify & build done
- Spec agent +
status:*machine - Contributor runs from Claude / Copilot apps, starting at
spec-approved - Changelog fragments + changelog agent
- Claiming protocol (
runner:*)
P3 · Hosted & debate ~3 wks
- Hosted contributor on the
agent:buildlabel (R0/R1) - Review debate loop with escalation
- Auto-merge for R0
- Concurrency and budget caps
P4 · Close the loop ongoing
- Ops agent: failed runs, flaky tests, telemetry reports → issues
- Release-notes agent
- Weekly metrics digest
- Revisit the R0 scope with the data
What exists vs what to build
Already in the repo
- Issue forms adding
needs-triage(.github/ISSUE_TEMPLATE/) - PR template with verification + reuse checklist
- Skills:
triage,spec,ship-change,review,changelog,release - Agent rules:
CLAUDE.md,copilot-instructions.md,ARCHITECTURE.md - CI with quality ratchet, API-types freshness, sharded tests
- Autonomous, CI-gated nightly release to PyPI (
release.yml) + nightly build - Relock workflow (agents never resolve lockfiles), Dependabot
- Opt-in, sanitised telemetry error reports (a source for the Ops agent)
To build
AGENTS.md,docs/adr/(ADR-0001: this workflow), role skills- Label set (
status:*,risk:*,agent:*,runner:*) +actions/labelerpath rules CODEOWNERSand amainruleset (R1/R2 human review)- Hosted
agent-*.ymlworkflows that load the same skills changelog.d/fragments + assembly step (done)RELEASE_HOLDcheck inrelease.yml(done)- Spec comment template (done)
- Website page
contributing/workflow.mdupdated with the result