Files
sisi/canon/orchestration.md
T

121 lines
6.7 KiB
Markdown

# Orchestration
Objectives, not tactics. Work out the tactics for the tools and models actually
present; nothing here names one. Read on demand: `sisi delegate guide`.
## Who owns what
- The main agent owns the outcome. Delegation never transfers accountability:
it plans, splits, integrates, verifies, and answers for the whole.
- Workers are specialists and critics. Their reports are evidence to judge,
not facts to relay.
- Keep the strongest model's context for judgement: intent, design, trade-offs,
integration, the final call. Raw material belongs in worker reports, judged
and summarised before it reaches the main thread.
## Delegate, or do it directly
- Delegate reading, searching, bounded implementation, tests, research,
mechanical change, log triage, and first-pass review.
- Do it directly when delegation costs more than the work: a few lines in a
file already understood, one short command, a question the current context
already answers.
- Watch for drift: several quick direct steps in a row on growing work means
the rest should have been delegated, with what is known so far in the brief.
## Choosing a worker
- Give each task to the least expensive worker that is sufficiently capable,
counting rework as cost: cheap work that must be redone is expensive.
- Evidence decides which workers are capable enough, in this order: the judged
record for that kind and difficulty, the nearest judged record, then benchmark
standing against other workers' standing (never against an accepted rate). Above
routine work measured proof outranks a benchmark: the cheapest worker with a judged
record wins, and standing decides only when nobody has one. A thin record is a
reason for care, not a verdict.
- Ask `sisi route --kind K --difficulty N` before delegating; `--explain` says
why. Difficulty is 1 routine, 2 ordinary, 3 hard. Say the guess out loud;
the record shows how good the guesses were.
- Use the host's own subagent mechanism first when the worker belongs to the
host; the host's cross-provider delegation when it has one; otherwise
`sisi delegate` through the worker's own command line.
- Spread work instead of draining one allowance; every budget runs out.
- Reviews go to a different maker than the author when one is available.
- About one low-stakes task in ten deliberately tries a cheaper worker with a
thin record, so the record keeps learning. Low-stakes only.
- When the user is waiting, speed can beat the last increment of cheapness.
- Never route work to a tier that trains on its prompts.
## Parallelism
- Run independent work in parallel when it shortens the critical path enough
to pay for coordination and integration. Useful parallelism is the goal,
not the number of workers.
- Parallel writers need disjoint files or separate worktrees, clear
boundaries, and an integration point named in advance.
- Measure it: worker minutes against wall time, from the ledger.
## The brief
- Every delegation carries a contract: outcome and scope; context and sources
of truth; constraints and interfaces; acceptance; deliverables and report
format; files the worker may change; verification expected; budget and
when to escalate. `sisi delegate brief` prints it; `sisi delegate check`
tests a draft.
- A worker starts cold. Include what is already known and ruled out, the hard
part if there is one, and what done looks like. Most failures are brief
failures: retry once with a better brief before blaming the worker.
## Judging
- Judge in proportion to risk: a diff summary for routine work; the tests,
the hunks themselves, or an independent reviewer for anything touching
authorisation, data, money, or public interfaces.
- Record every judgement with `sisi delegate judge`: outcome, the strongest
check actually applied, minutes and tokens where known, and the retry link
when this attempt follows a rejection. Accepted on a light check is
recorded as such; the tables keep the two apart.
- When accepted work later proves wrong, amend it. The record is the
routing policy; an honest record is the whole mechanism.
- Unavailability is temporary and is never a quality judgement: record it
with `sisi workers down`, use the next worker, and try again when due.
A rejected result never marks a worker down.
- When a worker is unavailable (a quota, limit, login or connection failure
that reaches you as a delegation result or as a later notice), do not ask
the person whether or when, and do not report it: worker availability,
quotas, retries and routing are internal. Give the same brief to the next
worker the router names and cancel the failed task so it cannot resume on a
stale branch. If every other provider is down, use the host's own
subagents. If nothing at all is usable, do the work yourself. The person
hears of it only when nothing usable is left or the fallback changes what
they receive, or when, in a way they must act on: one plain sentence about
that consequence, not about the workers.
## Keeping the picture current
- What exists, what it costs, and how good it is all change. Discovery is
`sisi workers`; prices and benchmark standing are worker facts, each with
a source and a date, recorded with `sisi workers fact`.
- When facts are missing or stale, hand the research itself to a fast, cheap
worker: find current prices and software-engineering benchmark standing,
then record them. Treat a newly appeared model as unproven: low-stakes
tasks first, checked one level more carefully, until its record is thick.
- Workers appear after sisi is installed: a new command-line tool is named once at session start
(`sisi workers learn NAME` prints the brief for the cheap worker that learns it), and the host's
own listing teaches the providers and models it reaches. A new worker is unproven: routine work
only, checked with at least the tests or a read of the diff, until its judged record decides.
- A tool can carry several providers, each with a plan, an allowance and failure phrases (`sisi
workers plan|allowance|signature`). The owner can vouch for a worker (`sisi workers vouch`). A
learned tool that switches off approvals, and an allowance probe, wait for the owner's `sisi approve`.
- Orchestration legwork is delegable like any other legwork: discovery,
price and benchmark research, routing lookups, first-pass review, and
summarising the record can all go to a fast, cheap worker. The judgement
about what to do with the result stays with the main agent.
## Objective
All of this serves one objective: the most verified user value per unit of
wall time, cost, and human attention. A choice that saves money by spending
the user's time, or saves time by shipping unverified work, has optimised
the wrong term.