Skip to content

Writing a constitution

A constitution specifies a desired state, not a plan. The worker decides the steps. You decide what "done" looks like.

Three moves: create the fiber, write the spec, install the dispatch contract.

1. Create the fiber

felt add pipeline/covariance-loader "Rewrite the covariance loader" -t constitution

The constitution tag serves browsing only (felt ls -t constitution). It gates nothing — the daemon reads the shuttle: block, never tags.

Path the slug under the right parent so containment carries the relationship. See Organizing.

2. Write the spec

The body follows one fixed shape.

Open with a lede — a heading-less paragraph that orients both readers: the human skimming a kanban card, and the worker landing cold at 3 a.m. Say what this is, why now, where it sits. Weave in [[wikilinks]] to related fibers.

Then ## Desired State — the contract, and the one required heading. Write done-conditions in checkable terms where the work allows. Name the quality bar if it earns naming. Name anything you are specifically not asking for.

Then only sections the fiber has earned, named for what they hold: "Touch points", "Sharding rationale", "Considered alternatives". Resist a generic "Context" section — a section named for nothing in particular fills up like a junk drawer.

The loader rebuilds the full covariance on every call, which dominates runtime
in the [[pipeline/mcmc-driver]] inner loop. Caching was tried and reverted
because the cache key ignored the binning scheme.

## Desired State

`load_covariance()` returns in under 50 ms for a warm call on the fiducial
binning. The cache key includes the binning scheme and the survey mask hash.
`pytest tests/test_covariance.py` passes, including the two currently-skipped
cache tests.

Not in scope: the Gaussian-approximation path. That is [[pipeline/gauss-cov]].

Keep the body small and the network rich. Depth belongs in linked sub-fibers.

Do not write worker mechanics into the spec — verification cadence, exit discipline, when to spawn subagents. The agent-side skill carries those for every worker, and instructions dated to one model generation age badly.

The ## Status handoff

The worker owns ## Status. You do not write it when authoring; the first worker creates it.

It gives the next reader a landing pad. Each session rewrites it — never appends. It holds the now: what landed, where the worker got stuck, what the next reader needs on arrival. Multi-paragraph prose is fine. Chronology that matters goes into commits, not here.

The kanban headline

Write outcome: as one or two sentences, rewritten every session: where the work stands, and what the reader does next. A human reads it on the board without opening anything.

When the work is blocked, lead the outcome with Blocked: … so the card reads as "answer me," not "review me."

Optional: tapestry.html

Use tapestry.html as the fiber's living, visual index to sub-fibers, sent files, and findings. The worker rewrites it as the work changes and can embed it in the body:

:::{embed} tapestry.html
:::

Readers also accept existing report.html companions and explicit embeds.

Code-shaped work whose story is commits plus an outcome line needs none.

3. Install the dispatch contract

shuttle install pipeline/covariance-loader \
  --project-dir "$PWD" \
  --model claude-opus

This writes the shuttle: block, validates the agent against the registry, and sets the fiber's status: active. The daemon picks it up on the next poll.

Add --disabled to stash it as a draft (status: open). It sits in the board's Desk under Drafts, and waits. shuttle resume <fiber> arms it later.

install is create-only. Run it against a fiber that already has a block and it refuses, naming the verb you actually wanted — shuttle status <fiber> to inspect the block's state and the daemon's dispatch assessment, reshape to change kind or schedule, set-model/set-agent to change the agent, or uninstall to start over.

You can also write the block by hand while drafting. shuttle install adds schema validation, which makes it the canonical path. felt preserves a hand-written block without judging it; use shuttle check to validate the schema and shuttle status to inspect dispatch eligibility. A block without status: active does not dispatch.

The two kinds

The shuttle CLI validates shuttle.kind (internal/shuttle/schema.go); felt preserves it as opaque frontmatter.

oneshot

The default, and the kind most work wants. Dispatches on the next poll while status: active. Redispatches after every clean handoff until a worker or a human closes it or puts it to rest.

A oneshot need not have a finish line. A hub you come back to — a debug intake, a practice — is a oneshot that rests between sessions: status: open with horizon: stashed, under Resting on the board's Desk, and started by hand when you want it. A worker puts it there with shuttle rest when the session ends with nothing to review; see Lifecycle.

shuttle install <fiber> --project-dir "$PWD"

standing

Recurring, driven by a cron expression. Installed with the repeat verb:

shuttle repeat <fiber> \
  --schedule "0 9 * * 1-5" --tz Europe/Paris --project-dir "$PWD"

shuttle computes due-ness from the cron expression against the run's last service (its dispatch or handoff stamp), and stores nothing. So no dispatch can silently consume a slot.

A standing constitution has no review. Its cycle is scheduled → running → scheduled: a run's exit leaves it status: active, its outcome the latest digest, and it fires again at the next tick. A run whose content needs you asks (shuttle ask); the card then waits on your turn with the question, still on its schedule. Say in the constitution's body when a run should ask, and what it holds until you answer. When you are done with a run that waits on you — you talked with its worker, or answered its question — Temper run (shuttle close --tempered=true) ends it: the ask clears, the worker stops, and the constitution stays armed for its next tick. Keep runs additive: products go to their own channel (a notification, an email, a dated file), not only to a field the next run overwrites.

Two verbs stop a schedule. Pause schedule (shuttle rest, status: open) is undone by Resume schedule (shuttle resume), which picks it up from the next tick. Retire (shuttle close --tempered=false) ends it; shuttle reopen brings it back. shuttle close refuses a standing constitution without a verdict. A stashed horizon alone does not stop a schedule.

Oneshots alone make a coherent system. Ignore standing until you want it.

A stored kind: pinned is read as oneshot; shuttle check warns about it, and scripts/migrate-pinned.py rewrites it.

Channels

shuttle.channel: <name> names the board channel a constitution speaks in, such as UNIONS or cmbx. A channel is where the human reads and answers a body of work; it exists only where a constitution declares it, and it is independent of the constitution's role and of where the fiber is filed, so a paper filed under one project can speak in another's channel. A thread speaks in its orchestrator's channel unless it declares its own; a constitution with none above it speaks in the board's catch-all, #misc. shuttle thread copies the parent's channel to the thread. Set it with shuttle channel <fiber> <name> (--clear removes it), or from the board's channel menu.

Seats

A constitution names its office with its top-level role: <office> or role: <office>/<person> (roles). Setting shuttle.seat: true marks it as a seat of that role; a true seat requires a role. The office's charter is roles/<office> in the shared store or in a repository linked in at its top level (where a charter lives). A role may have any number of seats, and the charter itself stays host-free and is never dispatched. Seat changes only its column at rest (Roles rather than Drafts or Resting, the board's Desk drawing it under Roles & standing) and what it means, never its lifecycle.

shuttle role <fiber> analyst
shuttle seat <fiber>
shuttle seat <fiber> --clear

shuttle role <fiber> --clear clears the role and seat.

Changing kind

install and repeat refuse to clobber an existing block. To convert, use shuttle reshape:

shuttle reshape <fiber> standing --schedule "0 9 * * 1" --tz UTC

kind is optional — omit it to leave the current kind alone and edit only the schedule (shuttle reshape <fiber> --schedule "0 7 * * *"). Reshape changes only kind and the schedule, and leaves the rest of the block — including the daemon-owned runtime: keys — untouched. It never touches felt's lifecycle fields (status, tempered, outcome), so a constitution closed for review can be reshaped in place without being re-armed. A standing target needs a schedule, from --schedule or echoed from the existing block; a oneshot target drops the schedule, and passing --schedule/--tz against one is an error.

Agent selection

shuttle agents prints the effective registry — run it for your current list. The maintained fleet ships built in:

Family Built-in ids Notes
Claude claude-opus (registry default), claude-sonnet, claude-fable, claude-haiku Browser access ("chrome") is an explicit axis on Claude agents, not a separate agent.
Codex codex-astra, codex-terra, codex-sol, codex-luna Launched with --approve-for-me: Codex's automatic reviewer handles approval requests.
Pi pi-luna, pi-haiku, pi-sonnet, pi-opus, pi-fable, pi-grok, pi-gemini-flash, pi-kimi, pi-deepseek-flash, pi-glm-flash, pi-union-alpha The four Claude agents use anthropic (Haiku/Sonnet/Opus 5.5, Fable 5.2); sign in with Pi's /login anthropic. pi-union-alpha uses OpenRouter's free Union Alpha model.
Antigravity agy-neon, agy-argon, agy-flash Google's Antigravity CLI (agy), launched with --dangerously-skip-permissions; effort is the model slug's suffix. felt setup antigravity installs its hooks and skills.

Two orthogonal axes layer on the base id: effort (validated against the resolved agent's allowed levels) and chrome (Claude only, for browser work).

shuttle set-agent <fiber> claude-opus --effort high
shuttle set-agent <fiber> claude-opus --chrome
shuttle set-model <fiber> codex-luna    # agent-only shorthand

Add your own agents

Your registry file layers over the built-ins by default. Set builtins: "restrict" when it should be the complete registry for one host. Run shuttle agents init to seed ~/.config/shuttle/agents.json (or $SHUTTLE_AGENTS_FILE), then edit it — new ids, aliases, or replacements for built-in ones. To change only an agent's default effort, shuttle agents effort <id> <level> writes an override instead of a copied record. See Configuring agents.

Required gates

You set these three gates by hand. Install refuses, or the daemon ignores the fiber, unless all three hold. Check them first, but expect more — see Dispatch eligibility for the full ordered list the daemon evaluates.

  • project_dir — the worker's working directory on the target host. install and repeat require it (install allows omitting it only with --disabled). The daemon also checks that the directory exists. It runs that gate last, because that gate alone touches the filesystem. On macOS a stat inside a synced folder can raise a permission prompt nobody can grant.
  • host — the owning daemon's host id. A daemon dispatches a block if and only if block.host equals its own id, which shuttle resolves (shuttle host): SHUTTLE_HOST, else the file ~/.shuttle/host, else the system hostname — consulted once and then written to that file, so the name cannot drift. shuttle offers no "local" default and no wildcard. An absent host leaves the fiber unowned and ineligible on every daemon. install and repeat stamp it by default.
  • status: active — the sole dispatch gate. open marks a draft or a pause. closed marks awaiting review (the human's, or a thread's orchestrator's) or a terminus.

One more condition lives outside the block: the fiber must sit in a felt store the daemon polls.

Work that should wait for an orchestrator is a draft thread: shuttle thread <parent> "<ask>" --disabled. It stays unarmed until the orchestrator runs shuttle resume <thread>. Containment relates the work; it does not gate dispatch.

A thread carries its parent's immutable identity and owner hint in shuttle.thread_parent, with the session that asked for it in asked_by. A closed thread is its orchestrator's to review: without a verdict it sits in orchestrator_review until the orchestrator tempers it, discards it, or marks it for the human with shuttle close <thread> --review "<why>", which writes shuttle.review: {note, at} and puts it before the human, waiting on them. The close notice the orchestrator receives says the verdict is its own. See Thread review. Its owner captures results durably even when the parent has no local archive copy. Delivery resolves the parent's current authority by identity; an unavailable authority retains the result for retry.

Thread lifecycle notices are durable inbox entries, checked against the owning thread's current document before they are placed or forwarded, and again before a worker receives them. An unresolved recipient waits; once authoritative resolution chooses the recipient UID, moving the child cannot redirect the result. A close tempered or discarded by the human supplies quiet context naming that verdict. It supersedes the unreviewed close notice and never wakes the orchestrator. A handoff remains current after its successor dispatches, until another handoff, close or rest replaces it. Unavailable owners retain their notices for retry, with a shared 30-second validation backoff across hook processes. Healthy notices can pass deferred notices, so delivery order can differ from queue order. A notice with no structured signal, whose text names no single fiber, is delivered without validation. Settled and offered entries expire after 14 days. An entry settles after its signal is stamped, so by the time its dedup entry expires the signal is more than 14 days old, and the inbox refuses a stamp that old: an expired notice cannot return. An outside asker's waking notice is a separate entry, sent once through the asker's session transport: a refusal is final because the orchestrator keeps the same result, any answer the transport recorded settles it, and only an outcome the daemon could not learn (a timeout, an unreachable owner) is tried again.

A delivery with an unknown outcome is sent once more to the same conversation, five minutes later (thirty when the receiver queued it), and is carried to a conversation that replaced the original as soon as the original ends, or five minutes after the send, each time with a possible-repeat warning. shuttle doctor reports fiber context pending for at least ten minutes.

Human in the loop

Every dispatch runs autonomously; shuttle offers no interactive mode. When work needs a human, that expectation rides one of two channels.

Per-dispatch. The card drawer's message box carries a free-text "From User" directive; a line asking the worker to talk first makes that run wait for you. The worker reads the directive at the top of its context. The directive applies to that moment only — the next dispatch starts clean.

Structural. Some work simply cannot one-shot: a 2FA step, a final send in your own voice, a draft-and-stage shape where the human commits. Write the gate into the constitution text: "I will be present; drive to the send and wait." The worker reads the spec as its contract and stays alive at that gate.

If a flow has a human-gated step, write the gate into the spec. No flag does this.