> ## Documentation Index
> Fetch the complete documentation index at: https://docs.jacobpevans.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Goal-statement component library

> Mix-and-match blocks that assemble into a sub-4,000-character goal statement for an autonomous agent run, plus three fully assembled examples.

A goal statement is the contract pasted at the start of an autonomous
session: mission, guardrails, failure protocol, and definition of done, in
under 4,000 characters. This page is a component library — pick **one variant
per category**, fill every placeholder, and assemble in the order the
categories appear here.

The structure is mined from real run contracts. The strongest predictor of a
reliable run is not model size — it is a goal statement where every guardrail
is a hard number and every "done" has a named check.

<Tip>
  **Why under 4,000 characters.** A goal statement that needs more space is
  either restating the base prompt (delete the restatement) or scoping more
  than one run's worth of work (split it). Shorter contracts also survive the
  trip to small local models — see
  [writing prompts for small models](/agent-ops/small-model-prompts).
</Tip>

<Warning>
  **Compatibility — not every pick is safe.** Same-numbered variants are the
  tested pairings (M1+H1+F1+…, M2+H2+F2+…, M3+H3+F3+…) — the assembled examples
  below. When mixing across rows:

  * H1 requires write authority. Never pair it with a read-only or PR-only
    mission.
  * H3 pairs only with a read-only mission (M3).
  * Any composition that delegates (D1/D3) or writes must include the
    [X2 denial list](/agent-ops/prompt-blocks#restrictions-and-denials) —
    filled in, or explicitly "(none this session)".

  These rules are prose, not yet a machine-checkable matrix — a small
  compatibility lint/checklist is a future follow-up.
</Warning>

## 1. Mission

One paragraph. Name the primary objective, the decisive metric or question,
the secondary lanes, the time budget, and the authority level.

**M1 — timed multi-lane run:**

```text theme={null}
## Mission
Run <primary objective> and settle the open questions: <the 1-3 decisive
metrics or answers this run must produce>. Finish the leftover lanes:
<lane 1>, <lane 2>, <lane 3>. <N> hours, fully autonomous, <authority level:
full write authority / PR-only / read-only>.
```

**M2 — single focused build/fix task:**

```text theme={null}
## Mission
Fix <one-sentence problem statement> in <repo>. Root cause first: reproduce
or evidence the failure before changing anything. Deliver one PR against
<target branch>, CI green.
```

**M3 — research/mining sweep:**

```text theme={null}
## Mission
Sweep <corpus> and produce a ranked, evidence-backed report answering:
<the 1-3 questions the sweep must answer>. Read-only: this run mutates
nothing.
```

## 2. Hard conditions (guardrails)

Numbered, each independently checkable, each with a consequence. The header
carries the enforcement rule so the agent cannot treat conditions as advice.

**H1 — disruptive-change window** (for runs that take a serving system down):

```text theme={null}
## Hard conditions (violate any -> stop that lane and restore)
1. Arm a session-independent dead-man restore on <host-fqdn> before any
   disruptive step, and verify it is armed (read back its deadline);
   hard-restore deadline <TIME>.
2. Attempt budget: <N> minutes per attempt; no verified success by then ->
   tear down, restore the previous serving state, diagnose, retry per the
   failure protocol.
3. Reserve the final <N> minutes for restoration + report. After teardown:
   all services back to their pre-run state, verified by a real request to
   each (an HTTP 200 on a health route is not proof; a real
   completion/transaction is).
4. "Process running" is not "healthy" — prove health with a real completion
   and log which backend answered.
5. Crash budget <N> per component. On the last allowed crash, disable every
   auto-restarter first, then stop the lane.
6. A permission denial is final for this session: record it verbatim, never
   retry, never re-route the same effect through another tool.
```

**H2 — change safety** (for code/config work):

```text theme={null}
## Hard conditions
1. Work only in a fresh worktree off <default branch>; never edit the
   default branch directly.
2. One concern per commit, Conventional Commits. No drive-by refactoring.
3. Fix the root cause at the shared call site — never patch the symptom at
   one caller, never disable the check that caught it.
4. Every warning or lint error that fires gets fixed in this change,
   pre-existing or not.
5. A permission denial is final: record it verbatim, stop that path,
   report it.
```

**H3 — read-only:**

```text theme={null}
## Hard conditions
1. READ-ONLY toward every system under investigation: no writes, no
   converges, no PR mutations, no state changes. The only writes allowed
   anywhere: report files in <run-dir>, or commits to the dedicated report
   branch <report-branch>.
2. Every claim in the report is backed by a tool call or command run THIS
   session. Memory may say where to look; only a fresh probe makes a claim
   reportable.
3. Bounded queries only: every search carries a time window, index/scope
   filter, and result cap. An unbounded query is a defect, not a finding.
4. Budget (hard): <N> tool calls / <N> minutes. At budget, stop and publish
   what is complete; mark the rest NOT-CHECKED (budget). Never retry a
   failing source more than twice.
```

## 3. Failure protocol

State what a failed attempt costs, what happens between attempts, and when
to stop. The two live failure modes are blind retry storms and silent
abandonment — the protocol must exclude both.

**F1 — keep-trying cycles** (durable objective, expensive attempts):

```text theme={null}
## Failure protocol (keep trying, never blind-retry)
Never abandon the primary objective. Each cycle: diagnose from logs and live
state -> ONE attempt under the hard conditions -> on failure restore the
previous state, notify <channel> with findings AND options, wait >= <N> min
(durable cadence marker; back off to <2N> if evidence says the failure is
resource exhaustion — say so plainly) -> retry. Other lanes continue between
cycles. Cycling ends at the run deadline: the final cycle restores, then
reports — the objective goes to the report as BLOCKED, not to another retry.
```

**F2 — fail fast** (bounded task, cheap to hand back):

```text theme={null}
## Failure protocol (fail fast)
Attempt budget: 2 full approaches. If the second approach also fails
verification, STOP. Commit the failing state to the branch with a WIP
marker, write up what was tried, the evidence gathered, and the best
remaining hypothesis, and end with a named blocker.
Blocked-with-a-named-blocker is a valid terminal state; a routed-around
check is not. On this exit the write-up replaces the end state below — do
not chase the remaining end-state items.
```

**F3 — degrade, never abort** (sweeps and multi-lane runs):

```text theme={null}
## Failure protocol
A source that errors twice is recorded as UNAVAILABLE with the exact error,
and the sweep continues. Three consecutive probes yielding no new evidence
-> stop that thread and write up what exists. If the subagent substrate
fails, degrade to serial execution — the mission degrades, it does not
abort.
```

## 4. End state (definition of done)

Numbered deliverables. The closing clause "or documented why not" converts
an incomplete run from a silent failure into a report.

**E1 — multi-deliverable:**

```text theme={null}
## End state (each item done, or documented why not)
1. <primary deliverable with its decisive metric>
2. <secondary deliverable>
3. <lane deliverables>
4. Final report at <TIME>: planned / attempted / completed / verified /
   failed / skipped, every failure with root cause.
```

**E2 — single artifact:**

```text theme={null}
## End state (definition of done)
1. The failing behavior is reproduced (or its absence is evidenced) BEFORE
   the fix, and demonstrably gone AFTER — both with quoted command output.
2. Branch pushed; PR open against <target branch> with the evidence in the
   body.
3. All CI checks green. Every review-blocking lint/type/test issue resolved
   for real.
4. A regression check exists that fails if the bug returns — including one
   negative case proving the safety net actually fires.
```

**E3 — report only:**

```text theme={null}
## End state (definition of done)
1. Report delivered at <path> with one evidence row per claim:
   claim | supporting evidence | contradicting evidence | confidence |
   cheapest test that would falsify it | owner | safe next action.
2. Ranked top-<N> findings, each naming the exact object (PR #, service,
   file:line), the recommended action, and the justification.
3. Coverage statement: what was swept, what was skipped, and why — gaps
   declared, never papered over.
```

## 5. Operating rules

The per-run behavioral deltas. Anything true of every run belongs in the
shared base prompt, not here.

**O1 — full autonomy:**

```text theme={null}
## Operating rules
Explore -> plan -> act. Verify before "done": run the check, quote its
output. Denials attach to actions and propagate into every subagent prompt.
Post a routine status to <channel> every hour — never run silent. Durable
checkpoints only: artifacts go on git branches or <run-dir>, never a tmp
path. Address every host by FQDN, never IP. Use the project's canonical
service names in prose and identifiers.
```

**O2 — focused solo work:**

```text theme={null}
## Operating rules
Explore -> plan -> act: read the code the change touches and trace the flow
end to end before editing. Smallest diff that fixes the root cause. Verify
before "done": run the test/build/repro and quote the output. Ask nothing
that a tool call can answer.
```

**O3 — sweep discipline:**

```text theme={null}
## Operating rules
Plan the sweep before the first query: list sources, order, and per-source
budget. One source at a time; summarize each before opening the next.
Prefer counting queries before detail queries. No conclusions from a single
source when a second source is in scope — correlate or mark unconfirmed.
```

## 6. Verification contract

What "done" costs. This is the category small models skip first, so it names
mechanical checks, not judgment — see the
[evidence blocks](/agent-ops/prompt-blocks#verification-and-evidence-blocks)
for the longer task-level forms.

**V1 — evidence per claim:**

```text theme={null}
## Verification contract
Every "done" claim = command output in the transcript. Measurements are
valid only if the system was warm and the responding backend identity is
logged. End-of-run gate: every end-state item is done-with-evidence or
documented-why-not in the final report.
```

**V2 — repro before/after:**

```text theme={null}
## Verification contract
"Fixed" requires: the repro command failing before, passing after, both
outputs quoted in the PR body. "CI green" requires the check-run list, not
an assumption. Never assert state from memory — re-run the command against
live state.
```

**V3 — grader-facing:**

```text theme={null}
## Verification contract
Spot-checkable by a grader: every cited object must exist and match its
description. Fabricated citations score the whole report zero. Dead ends
are documented with the query that produced them — they are evidence too.
```

## 7. Delegation contract

Whether subagents exist, how many, and what happens when the spawn substrate
fails. Every plan built on delegation states its solo fallback.

**D1 — probe, bound, fall back:**

```text theme={null}
## Delegation contract
Probe the subagent substrate with one trivial agent before any fan-out;
verify real output. Healthy -> bounded fan-out (<= 4 in flight, liveness
deadline per agent). Broken -> declared solo path: serialize lanes in
priority order <order>. Pass the denial list into every subagent prompt.
Substrate failure mid-run -> go solo; never restart shared infrastructure
the session itself depends on.
```

**D2 — solo:**

```text theme={null}
## Delegation contract
None. This task runs solo; its scope fits one context. If discovery
balloons past <threshold, e.g. 10 files>, stop and report scope growth
instead of fanning out.
```

**D3 — fan-out with a result contract:**

```text theme={null}
## Delegation contract
Probe one trivial subagent first. Healthy -> fan out per-source readers
(<= 4 in flight), each returning: outcome, evidence, inspected paths,
risks, next action. Merge and rank in the orchestrator. Broken -> serial
sweep in priority order <order>.
```

## Assembled examples

Three full goal statements, one per objective type. Character counts are
measured on the raw text as shown (`wc -c`), all under the 4,000 limit.
They are frontier-targeted: a 30B target gets one lane per session and a
rewrite per [writing prompts for small models](/agent-ops/small-model-prompts).
Compositions that delegate (A and C) get the
[X2 denial list](/agent-ops/prompt-blocks#restrictions-and-denials)
appended at fill time — filled in, or explicitly "(none this session)".

### Example A — unattended infrastructure run (3,423 chars)

M1 + H1 + F1 + E1 + O1 + V1 + D1.

```text theme={null}
# Goal statement — unattended infrastructure run, <START>–<END>

## Mission
Run <primary objective: e.g. bring up cluster mode, measure aggregate throughput under
concurrent load> and settle the open questions: <the 1-3 decisive metrics or answers this run
must produce>. Finish the leftover lanes: <lane 1>, <lane 2>, <lane 3>. <N> hours, fully
autonomous, <authority level: full write authority / read-only / PR-only>.

## Hard conditions (violate any -> stop that lane and restore)
1. Arm a session-independent dead-man restore on <host-fqdn> before any disruptive step,
   and verify it is armed (read back its deadline); hard-restore deadline <TIME>.
2. Attempt budget: <N> minutes per attempt; no verified success by then -> tear down, restore
   the previous serving state, diagnose, retry per the failure protocol.
3. Reserve the final <N> minutes for restoration + report. After teardown: all services back
   to their pre-run state, verified by a real request to each (an HTTP 200 on a health route
   is not proof; a real completion/transaction is).
4. "Process running" is not "healthy" — prove health with a real completion and log which
   backend answered.
5. Crash budget <N> per component. On the last allowed crash, disable every auto-restarter
   first, then stop the lane.
6. A permission denial is final for this session: record it verbatim, never retry, never
   re-route the same effect through another tool.

## Failure protocol (keep trying, never blind-retry)
Never abandon the primary objective. Each cycle: diagnose from logs and live state -> ONE
attempt under conditions 2+5 -> on failure restore the previous state, notify <channel> with
findings AND options, wait >= <N> min (durable cadence marker; back off to <2N> if evidence
says the failure is resource exhaustion — say so plainly) -> retry. Other lanes continue
between cycles. Cycling ends at the run deadline: the final cycle restores, then reports —
the objective goes to the report as BLOCKED, not to another retry.

## End state (each item done, or documented why not)
1. <primary deliverable with its decisive metric>
2. <secondary deliverable>
3. <lane deliverables>
4. Final report at <TIME>: planned / attempted / completed / verified / failed / skipped,
   every failure with root cause.

## Operating rules
Explore -> plan -> act. Verify before "done": run the check, quote its output. Denials attach
to actions and propagate into every subagent prompt. Post a routine status to <channel> every
hour — never run silent. Durable checkpoints only: artifacts go on git branches or
<run-dir>, never a tmp path. Address every host by FQDN, never IP. Use the project's
canonical service names in prose and identifiers.

## Verification contract
Every "done" claim = command output in the transcript. Measurements are valid only if the
system was warm and the responding backend identity is logged. End-of-run gate: every
end-state item is done-with-evidence or documented-why-not in the final report.

## Delegation contract
Probe the subagent substrate with one trivial agent before any fan-out; verify real output.
Healthy -> bounded fan-out (<= 4 in flight, liveness deadline per agent). Broken -> declared
solo path: serialize lanes in priority order <order>. Pass the denial list into every
subagent prompt. Substrate failure mid-run -> go solo; never restart shared infrastructure
the session itself depends on.
```

### Example B — single focused build/fix task (2,499 chars)

M2 + H2 + F2 + E2 + O2 + V2 + D2.

```text theme={null}
# Goal statement — single focused build/fix task

## Mission
Fix <one-sentence problem statement, e.g. "the converge daemon stays penalty-boxed after a
boot-time exit 78"> in <repo>. Root cause first: reproduce or evidence the failure before
changing anything. Deliver one PR against <target branch>, CI green.

## Hard conditions
1. Work only in a fresh worktree off <default branch>; never edit the default branch
   directly.
2. One concern per commit, Conventional Commits. No drive-by refactoring.
3. Fix the root cause at the shared call site — never patch the symptom at one caller, never
   disable the check that caught it.
4. Every warning or lint error that fires gets fixed in this change, pre-existing or not.
5. A permission denial is final: record it verbatim, stop that path, report it.

## Failure protocol (fail fast)
Attempt budget: 2 full approaches. If the second approach also fails verification, STOP.
Commit the failing state to the branch with a WIP marker, write up what was tried, the
evidence gathered, and the best remaining hypothesis, and end with a named blocker.
Blocked-with-a-named-blocker is a valid terminal state; a routed-around check is not. On
this exit the write-up replaces the end state below — do not chase the remaining end-state
items.

## End state (definition of done)
1. The failing behavior is reproduced (or its absence is evidenced) BEFORE the fix, and
   demonstrably gone AFTER — both with quoted command output.
2. Branch pushed; PR open against <target branch> with the evidence in the body.
3. All CI checks green. Every review-blocking lint/type/test issue resolved for real.
4. A regression check exists that fails if the bug returns — including one negative case
   proving the safety net actually fires.

## Operating rules
Explore -> plan -> act: read the code the change touches and trace the flow end to end
before editing. Smallest diff that fixes the root cause. Verify before "done": run the
test/build/repro and quote the output. Ask nothing that a tool call can answer.

## Verification contract
"Fixed" requires: the repro command failing before, passing after, both outputs quoted in
the PR body. "CI green" requires the check-run list, not an assumption. Never assert state
from memory — re-run the command against live state.

## Delegation contract
None. This task runs solo; its scope fits one context. If discovery balloons past
<threshold, e.g. 10 files>, stop and report scope growth instead of fanning out.
```

### Example C — research/mining sweep (2,699 chars)

M3 + H3 + F3 + E3 + O3 + V3 + D3.

```text theme={null}
# Goal statement — research/mining sweep (read-only)

## Mission
Sweep <corpus: e.g. the last 72 h of run transcripts / all open PRs across <org> / index=*
logs for <window>> and produce a ranked, evidence-backed report answering: <the 1-3
questions the sweep must answer>. Read-only: this run mutates nothing.

## Hard conditions
1. READ-ONLY toward every system under investigation: no writes, no converges, no PR
   mutations, no state changes. The only writes allowed anywhere: report files in <run-dir>,
   or commits to the dedicated report branch <report-branch>.
2. Every claim in the report is backed by a tool call or command run THIS session. Memory
   may say where to look; only a fresh probe makes a claim reportable.
3. Bounded queries only: every search carries a time window, index/scope filter, and result
   cap. An unbounded query is a defect, not a finding.
4. Budget (hard): <N> tool calls / <N> minutes. At budget, stop and publish what is
   complete; mark the rest NOT-CHECKED (budget). Never retry a failing source more than
   twice.

## Failure protocol
A source that errors twice is recorded as UNAVAILABLE with the exact error, and the sweep
continues. Three consecutive probes yielding no new evidence -> stop that thread and write
up what exists. If the subagent substrate fails, degrade to serial sweeping — the mission
degrades, it does not abort.

## End state (definition of done)
1. Report delivered at <path> with one evidence row per claim:
   claim | supporting evidence | contradicting evidence | confidence | cheapest test that
   would falsify it | owner | safe next action.
2. Ranked top-<N> findings, each naming the exact object (PR #, service, file:line), the
   recommended action, and the justification.
3. Coverage statement: what was swept, what was skipped, and why — gaps declared, never
   papered over.

## Operating rules
Plan the sweep before the first query: list sources, order, and per-source budget. One
source at a time; summarize each before opening the next. Prefer counting queries before
detail queries. No conclusions from a single source when a second source is in scope —
correlate or mark unconfirmed.

## Verification contract
Spot-checkable by a grader: every cited object must exist and match its description.
Fabricated citations score the whole report zero. Dead ends are documented with the query
that produced them — they are evidence too.

## Delegation contract
Probe one trivial subagent first. Healthy -> fan out per-source readers (<= 4 in flight),
each returning: outcome, evidence, inspected paths, risks, next action. Merge and rank in
the orchestrator. Broken -> serial sweep in priority order <order>.
```

## See also

* [Prompt block library](/agent-ops/prompt-blocks) — task-level blocks
  (roles, budgets, denials, evidence contracts) that pair with these
  goal statements.
* [Writing prompts for small models](/agent-ops/small-model-prompts) —
  how to rewrite these components for a \~30 GB local model.
* [Self-hosted AI agent](/autonomous-agents/hermes-agent) — the autonomous
  agent these contracts were exercised against.
