Autonomy Loop
Use this skill when the user asks to keep meaningful work moving across an
entire epic, act as principal architect, choose the next work repeatedly, run an
autonomous loop, continue a project without routine user involvement, or let
the work chain after each completed slice.
This is a meta-orchestrator. It owns judgment, sequencing, and epic state. It
uses autonomous-execution-contract as the bounded executor for each selected
task.
Intent, scope, and local bindings
Rank and complete bounded work toward the user's current epic. Ordinary execution
of an already selected task belongs to autonomous-execution-contract; that task
does not need this loop's ranking machinery or reactor gates.
Resolve the objective, acceptance criteria, repository, existing plan/checkpoint,
verification commands, authority, and budgets from current instructions and
observed project state. Reuse valid decisions; ask only about a material unresolved
scope or effect after independent preparation makes the choice concrete.
Select evidence and continuation separately. Standalone evidence uses the
project's ordinary plan, command outputs, relevant source/environment identity,
and checkpoints; it needs no synthetic epic digest, receipt, or controller.
Governed-runtime evidence applies only when an actual selected runtime
provides the compiled contract, proof policy, receipt checks, and durable events.
The compiled-contract/receipt sections below specify that profile. For standalone
work their corresponding steps use the ordinary plan, observed verification, and
project checkpoint. Do not fabricate runtime guarantees, IDs, digests, receipts,
or usage; missing required governed evidence holds that action without silently
switching profiles. Reactor continuation can use either evidence profile while
retaining its own stricter gates.
Non-goals and must not
This loop does not select a new product direction, runtime installation, external
publication, or an enforced controller by default. Necessary scoped investigation,
local implementation, and recovery remain autonomous. Do not replace the user's
outcome with the examples or budgets below, expand an active continuation
envelope silently, or claim completion because a budget ended. Never treat a
passing check, worker claim, or detailed plan as effect authorization.
Reasoning Posture
Use adaptive reasoning:
- Loop controller: medium reasoning by default. Ranking tasks, preserving
the epic thesis, interpreting proof/resource state, and choosing bounded
slices require principal-architect judgment.
- Bounded executor: low reasoning by default once a task is selected and
handed to
autonomous-execution-contract.
- Escalate to high reasoning only for: architecture or API boundaries,
product/release/security/privacy decisions, destructive/resource cleanup,
parallelization plans, expensive proof-gate decisions, or repeated failures
after the executor circuit breaker.
Core Contract
Default loop:
- Orient on project state, project doctrine, recent work, proof artifacts, and
resource health. On resume, inspect relevant authority/source changes and
missing evidence; validate digests when the governed profile provides them.
- Reconstruct the active epic, stable acceptance IDs, proof schedule, budgets,
and stop rules in the existing plan, or one compiled epic contract for the
governed profile.
- At epic start, a major pivot, or an architecture-changing blocker, create or
refresh the typed execution DAG. Otherwise preserve it.
- Maintain a ranked ready frontier of at most 5 tasks. After a slice, rescore
only nodes whose dependencies, evidence, risk, or authority changed. A full
frontier refresh is due only at a pivot, compaction recovery, or detected
drift.
- Select one bounded task and express only its per-slice delta: task ID,
objective, selection reason, changed risk/authority, focused verification,
expected evidence, and budget delta.
- Execute that delta with
autonomous-execution-contract, which inherits the
selected plan and authority; governed execution also verifies its compiled
epic invariants by reference and digest.
- Run focused verification, append the required checkpoint/receipt events,
and add the result to the current tranche.
- Commit when the tranche is coherent and the compiled proof schedule says
the commit or milestone gate is satisfied. A slice need not equal a commit.
- Rescore the affected frontier and either stop at a clean checkpoint or
continue if the prompt explicitly grants multi-slice/reactor execution.
For ordinary "continue" prompts, complete one coherent loop iteration. For
explicit multi-slice, epic-completion, "chain", or "reactor" prompts,
keep looping across bounded tasks until a stop rule, budget, or clean milestone
triggers.
Reactor Mode
Reactor mode is this loop's stricter local continuation profile. Select it for
an explicit request to chain this loop across slices or run its reactor. A long
timebox on an executor-only task does not select it. State the selected envelope
before chaining; preserve a different explicitly agreed execution workflow.
The external-effect exclusions below apply even when a separate effect grant
exists. If the requested next task exceeds the active reactor envelope, prepare
the concrete task, effect, verification, and proposed scope change for its owner.
Stop dependent continuation until an authorized envelope amendment or explicit
handoff to a different workflow resolves the conflict. Do not hide the conflict
by reinterpreting a gate as a preference. Independent authorized preparation may
continue. An ordinary bounded executor outside this envelope instead follows
its own existing grants and stop rules.
In reactor mode:
- Complete one bounded slice through
autonomous-execution-contract.
- Verify the slice with focused checks.
- Record its result and observed verification (or required governed receipt)
in the current tranche.
- Commit locally only when the tranche is coherent, commits are permitted,
and the compiled proof schedule is satisfied.
- Record mandatory checkpoint events and re-read only changed
git/resource/proof/authority state.
- Rescore the affected ready frontier; preserve unaffected DAG rankings.
- Start the next bounded slice only if all reactor continuation gates pass.
Reactor Continuation Gates
Continue only when all are true:
- The active epic is still the same epic, not a new strategic direction.
- The worktree can be made clean after the slice, or all remaining changes are
intentionally part of the next immediate slice.
- Focused verification for the previous slice passed, or the next slice is a
direct bounded fix for a newly discovered failure.
- The next task has a clear local verification path.
- The next task does not require push, deploy, publish, production mutation,
credentials, secrets, paid services, or unavailable infrastructure.
- Resource state is acceptable for the next task.
- The loop has not exhausted its configured budget.
Reactor Default Budgets
If the user grants reactor-style autonomy but does not specify a budget, use
these defaults:
- Stop after 4 hours of active controller work, 5 local commits, or 3 submodule
commits plus parent checkpoints, whichever comes first. Tool wait and user
wait are reported separately when the runtime exposes them.
- Permit at most 2 expensive global-proof groups per activation unless the
compiled repository authority requires more or the user explicitly grants a
larger proof budget. A twice-green gate is one proof group with two runs.
- Stop after 3 consecutive failures of the same verification target.
- Stop before an expensive global proof unless the proof budget says it is due.
- Stop at the first clean milestone where the next task would be a new epic.
- External spend defaults to zero. Track any explicitly authorized cost against
a separate ceiling; never infer spend authority from a time or commit budget.
If the user gives a smaller budget, obey it. If the user gives a larger budget,
still enforce all guardrails and stop conditions.
Budget Precedence
Before every expensive proof and before starting another slice, evaluate
budgets in this order:
- authority and non-negotiable stop rules,
- safety/resource breakers,
- explicit user ceilings,
- proof-run and repeated-failure ceilings,
- active-time and external-cost ceilings,
- commit/tranche ceilings.
A lower item never overrides a higher one. Reaching a budget produces a clean
checkpoint/stop reason; it does not establish that the epic is complete.
Compiled Epic Contract
For a selected governed runtime, compile the following once at epic start and
revise it only when authority or the epic changes. Standalone work records the
corresponding objective, decisions, checks, and bounds in its existing plan; it
does not fabricate digests or create a runtime to satisfy this section:
- stable epic ID, objective digest, and acceptance-criterion IDs;
- authority/source digests and precedence;
- stop rules and delegated/reserved decisions;
- proof schedule: focused checks, milestone/global checks, repeat count, and
exact receipt-reuse conditions;
- Git, checkpoint, resource, delegation, and external-cost policy;
- execution DAG, ranked ready frontier, and budget ledger.
The goal runtime may still expose only a flat objective. In that case, keep the
compiled contract in the project's canonical checkpoint source and put a
concise objective plus its digest in goal mode. Do not treat the flat goal as
the whole campaign state.
Proof Schedule And Receipts
Compile repository authority into one proof schedule before implementation.
Project authority wins over this skill. If project rules and the requested
budget conflict, surface the conflict once and stop only when authority cannot
be satisfied.
- Run focused checks after each coherent patch or slice.
- Run expensive/global proof only when the compiled schedule says it is due.
- In the governed profile, a controller-owned receipt should record command/manifest, exit status,
duration, source commit/tree, lock/dependency identity, toolchain, features,
environment contract, and relevant artifact digests.
- Reuse a receipt only when every identity field required by its proof policy is
unchanged. Agent testimony, matching prose, or a commit-message-only claim is
not a receipt.
- Delegated deterministic proof need not be rerun merely because it was
delegated when the controller owns and validates such a receipt. Without a
valid required receipt, rerun the acceptance check through the governed
mechanism. In standalone work, inspect actual delegated outputs and relevant
source/input/environment coverage; rerun only unverifiable, stale, missing, or
insufficient evidence. Matching HEAD alone does not establish reuse validity.
Non-Negotiable Guardrails
- Do not push, publish, deploy, open PRs, merge, rewrite shared history, or
change external shared state unless the user explicitly authorizes it in the
active conversation.
- Do not delete files outside the active project root unless the user
explicitly names and authorizes that scope.
- Do not run broad destructive cleanup such as
git reset --hard, broad
git clean, rm -rf, blanket Docker prune, or cluster/resource pruning
unless the user explicitly authorizes it or the command is limited to known
loop-created/generated resources.
- Preserve user changes. If the worktree is dirty, classify changes before
editing and never revert unrelated edits.
- Treat private-repo policy as binding when present. Never make a private repo
public or weaken visibility/publish guards.
- Reactor continuation stops before secrets, credentials, paid services, or
production infrastructure under its stated gates. Outside reactor continuation,
apply the selected executor's authority; unavailable required infrastructure
still blocks dependent work.
- Stop when the same verification failure persists after the circuit breaker in
autonomous-execution-contract.
Resource Discipline
Before Docker, benchmark, emulator, Kubernetes, or other heavy work:
- Capture a resource preflight:
df -h /
docker system df when Docker is involved
docker ps --format 'table {{.ID}}\t{{.Image}}\t{{.Names}}\t{{.Status}}'
when Docker is involved
- Identify expected generated artifacts, containers, images, clusters, caches,
or temp directories before creating them.
- Prefer project-provided cleanup scripts and narrowly scoped cleanup commands.
- After heavy work, capture a postflight and clean only resources that are
known to be loop-created or documented as safe generated output.
- If disk is critically low, Docker is unhealthy, or the system crashes during
proof work, stop, report the resource state, and recommend the smallest safe
cleanup. Do not improvise broad cleanup outside the project root.
Skill Composition Map
Use precise slices of other skills. Do not load or follow their full workflows
when a narrow contract is enough.
autonomous-execution-contract: use for each selected bounded task. Pass
the project plan and task, or the compiled epic-contract reference/digest
plus per-slice delta when that governed runtime exists. Do not
retransmit unchanged stop, Git, proof, checkpoint, or delegation policy.
objective-to-dag-decomposition: use when the epic is vague, strategic,
or spans multiple subsystems. Produce or refresh the DAG only at epic start,
major pivots, or after a blocker changes the architecture.
next-todos: use its output discipline: imperative, specific, testable,
one sentence each. Use at most 5 ready-frontier tasks during execution; a
longer list is an epic-orientation artifact. Invoke the full skill only when
the user wants durable todo/tranche side effects; otherwise draft the
frontier directly to avoid accidental queue mutation.
git-status-report: use for sync/ahead/behind reporting or before a
handoff. For quick local orientation, raw git status --short --branch and
git submodule status are enough.
test: use for substantial test, lint, typecheck, Playwright, or
benchmark commands. Prefer focused verification first, then global proof.
commit: use for local checkpoint commits when commits are permitted and
touched files need triage. Never push as part of this loop.
handoff: use at the end of a long run, before context loss, or when the
user asks to continue in a new shell. For small material updates, update the
canonical plan/handoff docs directly.
invokellm: use sparingly for high-stakes architecture choices, product
direction, or repeated failure diagnosis. Integrate the result; do not
outsource responsibility.
fp-refine: use when the chosen task is DSL/FP cleanup, or when new
domain code is drifting into mutable, stringly, exception-driven shape.
- Domain-specific RCA/recovery skills: use when logs, traces, or benchmark
artifacts need evidence-backed failure classification before patching.
- Durable background runners: use only when background tranche execution
materially helps. Direct execution is preferred for ordinary local patches.
Memory And Code Indexes
- Query durable memory at every epic start, resume, and major re-rank when a
memory tool is available. Use it to recover prior decisions, house style,
proof status, blockers, and user preferences.
- Use local code indexes opportunistically when present and fresh for code
navigation, impact analysis, verification routing, drift detection, and
cleanup planning.
- Never make correctness depend on a memory tool or code index. If one is
absent, stale, or uncertain, fall back to
rg, repo docs, tests, and
conservative verification.
- Treat memory and indexes as orientation aids. Local files, tests, and proof
artifacts remain the authority for current workspace truth.
Epic Orientation
At the start of an epic or resumed loop:
- Establish the project root and deletion boundary.
- Read current git/submodule state.
- Read canonical project docs when present: project agent instructions,
implementation plans, prompt/handoff docs, roadmap docs, benchmark reports,
and local handoff files. Record relevant identities; compute required
digests only for an actual governed policy. On later iterations, re-read
only changed authority or the narrow evidence needed by the selected task.
- Query memory for prior decisions and current house style when available.
- Check whether a local code index can safely improve impact analysis. Use it
only if available and relevant.
- Identify the north star, active constraints, latest proof state, known
blockers, and open risks.
- If the epic is still blurry, run a compact
objective-to-dag-decomposition
pass before task selection.
- Set an orientation budget appropriate to the repository. If orientation
keeps expanding without changing the ready frontier, stop reading and select
the smallest evidence-gathering task instead.
Project Trajectory Compass
Rank against the user's active objective, the actual customer's outcome,
acceptance criteria, dependency readiness, and current risks. Use repo docs,
memory, recent commits, and proof artifacts as evidence; they do not override
the current user direction.
For an evidence/governance product only, relevant vertical slices might include
schema-backed evidence, history, verifier/recovery visibility, or metering.
Those are conditional examples, not a trajectory for unrelated projects. A
compiler, terminal UI, or documentation project uses its own user outcomes.
Avoid drifting into adjacent product stories merely because they are available.
If no task clearly advances the current epic, stop at a clean checkpoint and
recommend the next epic instead of silently switching.
Task Ranking Rubric
Rank candidate tasks by these criteria:
- Advances the stated project north star.
- Advances the project's customer outcome or resolves a concrete acceptance,
reliability, delivery, or evidence risk identified for this epic.
- Has a clear local verification path.
- Preserves or improves the active proof gate.
- Avoids hardcoding, public-scope drift, and product-story drift.
- Is small enough to execute and commit as a coherent checkpoint.
- Reduces future agent confusion through clearer contracts, tests, or docs.
- Has acceptable resource cost for the current machine state.
When rankings are close, prefer the task that creates a vertical slice of
working product evidence over a broad refactor.
Execution Unit Template
For each selected task, instantiate autonomous-execution-contract like this:
Use autonomous-execution-contract.
Objective: <one bounded task from the ranked epic backlog>
Evidence profile: <standalone | governed runtime>
Project checkpoint: <existing plan/state path>
Epic contract (governed only): <canonical path + verified objective/authority digest>
Task ID: <existing task/plan ID; DAG node when the project uses one>
Task source: autonomy-loop ranked backlog for <epic>.
Selection: selected because <strategic value>, <verification clarity>, and <dependency order>.
Reasoning: low by default; escalate for architecture, safety, product/API, or repeated failure.
Slice delta: <changed authority/risk, focused commands, expected evidence, and budget delta only>.
Inherited policy: <existing project stop/Git/proof/checkpoint/delegation rules>.
For reactor mode, add:
Reactor mode: enabled.
Reactor budget: <commit/time/slice budget, or defaults>.
Reactor gates: clean checkpoint after each slice; re-rank before each next slice; stop on guardrail, repeated failure, resource pressure, or new-epic boundary.
Checkpointing
For an entire epic, maintain resumability:
In the governed profile, when structured checkpoint state is warranted, emit
append-only events that
conform to references/checkpoint-event.schema.json. This compatibility
format does not make a sidecar authoritative when the project already has a
canonical state mechanism.
Prefer project-native state: implementation plans, prompt/handoff docs, issue
files, benchmark manifests, durable tranche files, or other canonical
project state.
If no project-native state exists, create a concise local loop-state file
only for substantial multi-step work.
Record stable acceptance and DAG IDs, completed/current tasks, verification
receipts, resource issues, budgets consumed, commits/tree identities,
blockers, rank changes with reasons, and the next ready frontier.
Commit checkpoints only when the workspace is internally consistent and
verification appropriate to that checkpoint has passed.
For governed execution:
Append a checkpoint event after every commit, expensive proof run, budget or
stop event, authority revision, and context compaction. Standalone execution
updates its existing checkpoint at these material boundaries without requiring
a synthetic event ledger. Also checkpoint before
a long command that risks losing recoverable state. A checkpoint is not a
claim of completion.
Stop Conditions
Stop and report clearly when:
- The epic acceptance criteria are satisfied.
- The next decision changes product/API/release/security/privacy strategy.
- Required infrastructure, credentials, or system resources are unavailable.
- Resource cleanup would require broad destructive action.
- The loop reaches a coherent checkpoint and no explicit multi-loop/timebox was
provided.
- Reactor mode reaches its slice, commit, time, or failure budget.
- Repeated failures trigger the executor circuit breaker.
- The remaining work is a new epic rather than the current epic.
Final Report
Report:
- Current epic and whether it is complete, blocked, or paused at a checkpoint.
- Tasks completed and tasks still ranked next.
- Verification passed, failed, or skipped.
- Commits created and whether anything was pushed.
- Current branch, submodule pointers, and workspace cleanliness.
- Resource state and cleanup performed when heavy resources were used.
- Active/tool/wait/user-idle time and fresh/cached/output/reasoning tokens when
the runtime exposes them; otherwise label the available aggregate precisely.
- Verification evidence (or governed proof receipts) produced or reused, its
relevant identities, and why reuse was
admissible.
- The next bounded task that should be fed to
autonomous-execution-contract,
or the next reactor-ready slice when reactor mode remains appropriate.
1---2name: autonomy-loop3description: Drive an epic as a principal-architect loop: rank tasks, execute bounded slices, verify, checkpoint, and optionally chain safely.4---56# Autonomy Loop78Use this skill when the user asks to keep meaningful work moving across an9entire epic, act as principal architect, choose the next work repeatedly, run an10autonomous loop, continue a project without routine user involvement, or let11the work chain after each completed slice.1213This is a meta-orchestrator. It owns judgment, sequencing, and epic state. It14uses `autonomous-execution-contract` as the bounded executor for each selected15task.1617## Intent, scope, and local bindings1819Rank and complete bounded work toward the user's current epic. Ordinary execution20of an already selected task belongs to `autonomous-execution-contract`; that task21does not need this loop's ranking machinery or reactor gates.2223Resolve the objective, acceptance criteria, repository, existing plan/checkpoint,24verification commands, authority, and budgets from current instructions and25observed project state. Reuse valid decisions; ask only about a material unresolved26scope or effect after independent preparation makes the choice concrete.2728Select evidence and continuation separately. **Standalone evidence** uses the29project's ordinary plan, command outputs, relevant source/environment identity,30and checkpoints; it needs no synthetic epic digest, receipt, or controller.31**Governed-runtime evidence** applies only when an actual selected runtime32provides the compiled contract, proof policy, receipt checks, and durable events.33The compiled-contract/receipt sections below specify that profile. For standalone34work their corresponding steps use the ordinary plan, observed verification, and35project checkpoint. Do not fabricate runtime guarantees, IDs, digests, receipts,36or usage; missing required governed evidence holds that action without silently37switching profiles. Reactor continuation can use either evidence profile while38retaining its own stricter gates.3940## Non-goals and must not4142This loop does not select a new product direction, runtime installation, external43publication, or an enforced controller by default. Necessary scoped investigation,44local implementation, and recovery remain autonomous. Do not replace the user's45outcome with the examples or budgets below, expand an active continuation46envelope silently, or claim completion because a budget ended. Never treat a47passing check, worker claim, or detailed plan as effect authorization.4849## Reasoning Posture5051Use adaptive reasoning:5253- **Loop controller:** medium reasoning by default. Ranking tasks, preserving54 the epic thesis, interpreting proof/resource state, and choosing bounded55 slices require principal-architect judgment.56- **Bounded executor:** low reasoning by default once a task is selected and57 handed to `autonomous-execution-contract`.58- **Escalate to high reasoning only for:** architecture or API boundaries,59 product/release/security/privacy decisions, destructive/resource cleanup,60 parallelization plans, expensive proof-gate decisions, or repeated failures61 after the executor circuit breaker.6263## Core Contract6465Default loop:66671. Orient on project state, project doctrine, recent work, proof artifacts, and68 resource health. On resume, inspect relevant authority/source changes and69 missing evidence; validate digests when the governed profile provides them.702. Reconstruct the active epic, stable acceptance IDs, proof schedule, budgets,71 and stop rules in the existing plan, or one compiled epic contract for the72 governed profile.733. At epic start, a major pivot, or an architecture-changing blocker, create or74 refresh the typed execution DAG. Otherwise preserve it.754. Maintain a ranked ready frontier of at most 5 tasks. After a slice, rescore76 only nodes whose dependencies, evidence, risk, or authority changed. A full77 frontier refresh is due only at a pivot, compaction recovery, or detected78 drift.795. Select one bounded task and express only its per-slice delta: task ID,80 objective, selection reason, changed risk/authority, focused verification,81 expected evidence, and budget delta.826. Execute that delta with `autonomous-execution-contract`, which inherits the83 selected plan and authority; governed execution also verifies its compiled84 epic invariants by reference and digest.857. Run focused verification, append the required checkpoint/receipt events,86 and add the result to the current tranche.878. Commit when the tranche is coherent and the compiled proof schedule says88 the commit or milestone gate is satisfied. A slice need not equal a commit.899. Rescore the affected frontier and either stop at a clean checkpoint or90 continue if the prompt explicitly grants multi-slice/reactor execution.9192For ordinary "continue" prompts, complete one coherent loop iteration. For93explicit multi-slice, epic-completion, "chain", or "reactor" prompts,94keep looping across bounded tasks until a stop rule, budget, or clean milestone95triggers.9697## Reactor Mode9899Reactor mode is this loop's stricter local continuation profile. Select it for100an explicit request to chain this loop across slices or run its reactor. A long101timebox on an executor-only task does not select it. State the selected envelope102before chaining; preserve a different explicitly agreed execution workflow.103104The external-effect exclusions below apply even when a separate effect grant105exists. If the requested next task exceeds the active reactor envelope, prepare106the concrete task, effect, verification, and proposed scope change for its owner.107Stop dependent continuation until an authorized envelope amendment or explicit108handoff to a different workflow resolves the conflict. Do not hide the conflict109by reinterpreting a gate as a preference. Independent authorized preparation may110continue. An ordinary bounded executor outside this envelope instead follows111its own existing grants and stop rules.112113In reactor mode:1141151. Complete one bounded slice through `autonomous-execution-contract`.1162. Verify the slice with focused checks.1173. Record its result and observed verification (or required governed receipt)118 in the current tranche.1194. Commit locally only when the tranche is coherent, commits are permitted,120 and the compiled proof schedule is satisfied.1215. Record mandatory checkpoint events and re-read only changed122 git/resource/proof/authority state.1236. Rescore the affected ready frontier; preserve unaffected DAG rankings.1247. Start the next bounded slice only if all reactor continuation gates pass.125126### Reactor Continuation Gates127128Continue only when all are true:129130- The active epic is still the same epic, not a new strategic direction.131- The worktree can be made clean after the slice, or all remaining changes are132 intentionally part of the next immediate slice.133- Focused verification for the previous slice passed, or the next slice is a134 direct bounded fix for a newly discovered failure.135- The next task has a clear local verification path.136- The next task does not require push, deploy, publish, production mutation,137 credentials, secrets, paid services, or unavailable infrastructure.138- Resource state is acceptable for the next task.139- The loop has not exhausted its configured budget.140141### Reactor Default Budgets142143If the user grants reactor-style autonomy but does not specify a budget, use144these defaults:145146- Stop after 4 hours of active controller work, 5 local commits, or 3 submodule147 commits plus parent checkpoints, whichever comes first. Tool wait and user148 wait are reported separately when the runtime exposes them.149- Permit at most 2 expensive global-proof groups per activation unless the150 compiled repository authority requires more or the user explicitly grants a151 larger proof budget. A twice-green gate is one proof group with two runs.152- Stop after 3 consecutive failures of the same verification target.153- Stop before an expensive global proof unless the proof budget says it is due.154- Stop at the first clean milestone where the next task would be a new epic.155- External spend defaults to zero. Track any explicitly authorized cost against156 a separate ceiling; never infer spend authority from a time or commit budget.157158If the user gives a smaller budget, obey it. If the user gives a larger budget,159still enforce all guardrails and stop conditions.160161### Budget Precedence162163Before every expensive proof and before starting another slice, evaluate164budgets in this order:1651661. authority and non-negotiable stop rules,1672. safety/resource breakers,1683. explicit user ceilings,1694. proof-run and repeated-failure ceilings,1705. active-time and external-cost ceilings,1716. commit/tranche ceilings.172173A lower item never overrides a higher one. Reaching a budget produces a clean174checkpoint/stop reason; it does not establish that the epic is complete.175176## Compiled Epic Contract177178For a selected governed runtime, compile the following once at epic start and179revise it only when authority or the epic changes. Standalone work records the180corresponding objective, decisions, checks, and bounds in its existing plan; it181does not fabricate digests or create a runtime to satisfy this section:182183- stable epic ID, objective digest, and acceptance-criterion IDs;184- authority/source digests and precedence;185- stop rules and delegated/reserved decisions;186- proof schedule: focused checks, milestone/global checks, repeat count, and187 exact receipt-reuse conditions;188- Git, checkpoint, resource, delegation, and external-cost policy;189- execution DAG, ranked ready frontier, and budget ledger.190191The goal runtime may still expose only a flat objective. In that case, keep the192compiled contract in the project's canonical checkpoint source and put a193concise objective plus its digest in goal mode. Do not treat the flat goal as194the whole campaign state.195196## Proof Schedule And Receipts197198Compile repository authority into one proof schedule before implementation.199Project authority wins over this skill. If project rules and the requested200budget conflict, surface the conflict once and stop only when authority cannot201be satisfied.202203- Run focused checks after each coherent patch or slice.204- Run expensive/global proof only when the compiled schedule says it is due.205- In the governed profile, a controller-owned receipt should record command/manifest, exit status,206 duration, source commit/tree, lock/dependency identity, toolchain, features,207 environment contract, and relevant artifact digests.208- Reuse a receipt only when every identity field required by its proof policy is209 unchanged. Agent testimony, matching prose, or a commit-message-only claim is210 not a receipt.211- Delegated deterministic proof need not be rerun merely because it was212 delegated when the controller owns and validates such a receipt. Without a213 valid required receipt, rerun the acceptance check through the governed214 mechanism. In standalone work, inspect actual delegated outputs and relevant215 source/input/environment coverage; rerun only unverifiable, stale, missing, or216 insufficient evidence. Matching HEAD alone does not establish reuse validity.217218## Non-Negotiable Guardrails219220- Do not push, publish, deploy, open PRs, merge, rewrite shared history, or221 change external shared state unless the user explicitly authorizes it in the222 active conversation.223- Do not delete files outside the active project root unless the user224 explicitly names and authorizes that scope.225- Do not run broad destructive cleanup such as `git reset --hard`, broad226 `git clean`, `rm -rf`, blanket Docker prune, or cluster/resource pruning227 unless the user explicitly authorizes it or the command is limited to known228 loop-created/generated resources.229- Preserve user changes. If the worktree is dirty, classify changes before230 editing and never revert unrelated edits.231- Treat private-repo policy as binding when present. Never make a private repo232 public or weaken visibility/publish guards.233- Reactor continuation stops before secrets, credentials, paid services, or234 production infrastructure under its stated gates. Outside reactor continuation,235 apply the selected executor's authority; unavailable required infrastructure236 still blocks dependent work.237- Stop when the same verification failure persists after the circuit breaker in238 `autonomous-execution-contract`.239240## Resource Discipline241242Before Docker, benchmark, emulator, Kubernetes, or other heavy work:2432441. Capture a resource preflight:245 - `df -h /`246 - `docker system df` when Docker is involved247 - `docker ps --format 'table {{.ID}}\t{{.Image}}\t{{.Names}}\t{{.Status}}'`248 when Docker is involved2492. Identify expected generated artifacts, containers, images, clusters, caches,250 or temp directories before creating them.2513. Prefer project-provided cleanup scripts and narrowly scoped cleanup commands.2524. After heavy work, capture a postflight and clean only resources that are253 known to be loop-created or documented as safe generated output.2545. If disk is critically low, Docker is unhealthy, or the system crashes during255 proof work, stop, report the resource state, and recommend the smallest safe256 cleanup. Do not improvise broad cleanup outside the project root.257258## Skill Composition Map259260Use precise slices of other skills. Do not load or follow their full workflows261when a narrow contract is enough.262263- **`autonomous-execution-contract`**: use for each selected bounded task. Pass264 the project plan and task, or the compiled epic-contract reference/digest265 plus per-slice delta when that governed runtime exists. Do not266 retransmit unchanged stop, Git, proof, checkpoint, or delegation policy.267- **`objective-to-dag-decomposition`**: use when the epic is vague, strategic,268 or spans multiple subsystems. Produce or refresh the DAG only at epic start,269 major pivots, or after a blocker changes the architecture.270- **`next-todos`**: use its output discipline: imperative, specific, testable,271 one sentence each. Use at most 5 ready-frontier tasks during execution; a272 longer list is an epic-orientation artifact. Invoke the full skill only when273 the user wants durable todo/tranche side effects; otherwise draft the274 frontier directly to avoid accidental queue mutation.275- **`git-status-report`**: use for sync/ahead/behind reporting or before a276 handoff. For quick local orientation, raw `git status --short --branch` and277 `git submodule status` are enough.278- **`test`**: use for substantial test, lint, typecheck, Playwright, or279 benchmark commands. Prefer focused verification first, then global proof.280- **`commit`**: use for local checkpoint commits when commits are permitted and281 touched files need triage. Never push as part of this loop.282- **`handoff`**: use at the end of a long run, before context loss, or when the283 user asks to continue in a new shell. For small material updates, update the284 canonical plan/handoff docs directly.285- **`invokellm`**: use sparingly for high-stakes architecture choices, product286 direction, or repeated failure diagnosis. Integrate the result; do not287 outsource responsibility.288- **`fp-refine`**: use when the chosen task is DSL/FP cleanup, or when new289 domain code is drifting into mutable, stringly, exception-driven shape.290- **Domain-specific RCA/recovery skills**: use when logs, traces, or benchmark291 artifacts need evidence-backed failure classification before patching.292- **Durable background runners**: use only when background tranche execution293 materially helps. Direct execution is preferred for ordinary local patches.294295## Memory And Code Indexes296297- Query durable memory at every epic start, resume, and major re-rank when a298 memory tool is available. Use it to recover prior decisions, house style,299 proof status, blockers, and user preferences.300- Use local code indexes opportunistically when present and fresh for code301 navigation, impact analysis, verification routing, drift detection, and302 cleanup planning.303- Never make correctness depend on a memory tool or code index. If one is304 absent, stale, or uncertain, fall back to `rg`, repo docs, tests, and305 conservative verification.306- Treat memory and indexes as orientation aids. Local files, tests, and proof307 artifacts remain the authority for current workspace truth.308309## Epic Orientation310311At the start of an epic or resumed loop:3123131. Establish the project root and deletion boundary.3142. Read current git/submodule state.3153. Read canonical project docs when present: project agent instructions,316 implementation plans, prompt/handoff docs, roadmap docs, benchmark reports,317 and local handoff files. Record relevant identities; compute required318 digests only for an actual governed policy. On later iterations, re-read319 only changed authority or the narrow evidence needed by the selected task.3204. Query memory for prior decisions and current house style when available.3215. Check whether a local code index can safely improve impact analysis. Use it322 only if available and relevant.3236. Identify the north star, active constraints, latest proof state, known324 blockers, and open risks.3257. If the epic is still blurry, run a compact `objective-to-dag-decomposition`326 pass before task selection.3278. Set an orientation budget appropriate to the repository. If orientation328 keeps expanding without changing the ready frontier, stop reading and select329 the smallest evidence-gathering task instead.330331## Project Trajectory Compass332333Rank against the user's active objective, the actual customer's outcome,334acceptance criteria, dependency readiness, and current risks. Use repo docs,335memory, recent commits, and proof artifacts as evidence; they do not override336the current user direction.337338For an evidence/governance product only, relevant vertical slices might include339schema-backed evidence, history, verifier/recovery visibility, or metering.340Those are conditional examples, not a trajectory for unrelated projects. A341compiler, terminal UI, or documentation project uses its own user outcomes.342Avoid drifting into adjacent product stories merely because they are available.343If no task clearly advances the current epic, stop at a clean checkpoint and344recommend the next epic instead of silently switching.345346## Task Ranking Rubric347348Rank candidate tasks by these criteria:3493501. Advances the stated project north star.3512. Advances the project's customer outcome or resolves a concrete acceptance,352 reliability, delivery, or evidence risk identified for this epic.3533. Has a clear local verification path.3544. Preserves or improves the active proof gate.3555. Avoids hardcoding, public-scope drift, and product-story drift.3566. Is small enough to execute and commit as a coherent checkpoint.3577. Reduces future agent confusion through clearer contracts, tests, or docs.3588. Has acceptable resource cost for the current machine state.359360When rankings are close, prefer the task that creates a vertical slice of361working product evidence over a broad refactor.362363## Execution Unit Template364365For each selected task, instantiate `autonomous-execution-contract` like this:366367```text368Use autonomous-execution-contract.369370Objective: <one bounded task from the ranked epic backlog>371Evidence profile: <standalone | governed runtime>372Project checkpoint: <existing plan/state path>373Epic contract (governed only): <canonical path + verified objective/authority digest>374Task ID: <existing task/plan ID; DAG node when the project uses one>375Task source: autonomy-loop ranked backlog for <epic>.376Selection: selected because <strategic value>, <verification clarity>, and <dependency order>.377Reasoning: low by default; escalate for architecture, safety, product/API, or repeated failure.378Slice delta: <changed authority/risk, focused commands, expected evidence, and budget delta only>.379Inherited policy: <existing project stop/Git/proof/checkpoint/delegation rules>.380```381382For reactor mode, add:383384```text385Reactor mode: enabled.386Reactor budget: <commit/time/slice budget, or defaults>.387Reactor gates: clean checkpoint after each slice; re-rank before each next slice; stop on guardrail, repeated failure, resource pressure, or new-epic boundary.388```389390## Checkpointing391392For an entire epic, maintain resumability:393394- In the governed profile, when structured checkpoint state is warranted, emit395 append-only events that396 conform to `references/checkpoint-event.schema.json`. This compatibility397 format does not make a sidecar authoritative when the project already has a398 canonical state mechanism.399400- Prefer project-native state: implementation plans, prompt/handoff docs, issue401 files, benchmark manifests, durable tranche files, or other canonical402 project state.403- If no project-native state exists, create a concise local loop-state file404 only for substantial multi-step work.405- Record stable acceptance and DAG IDs, completed/current tasks, verification406 receipts, resource issues, budgets consumed, commits/tree identities,407 blockers, rank changes with reasons, and the next ready frontier.408- Commit checkpoints only when the workspace is internally consistent and409 verification appropriate to that checkpoint has passed.410411For governed execution:412Append a checkpoint event after every commit, expensive proof run, budget or413stop event, authority revision, and context compaction. Standalone execution414updates its existing checkpoint at these material boundaries without requiring415a synthetic event ledger. Also checkpoint before416a long command that risks losing recoverable state. A checkpoint is not a417claim of completion.418419## Stop Conditions420421Stop and report clearly when:422423- The epic acceptance criteria are satisfied.424- The next decision changes product/API/release/security/privacy strategy.425- Required infrastructure, credentials, or system resources are unavailable.426- Resource cleanup would require broad destructive action.427- The loop reaches a coherent checkpoint and no explicit multi-loop/timebox was428 provided.429- Reactor mode reaches its slice, commit, time, or failure budget.430- Repeated failures trigger the executor circuit breaker.431- The remaining work is a new epic rather than the current epic.432433## Final Report434435Report:436437- Current epic and whether it is complete, blocked, or paused at a checkpoint.438- Tasks completed and tasks still ranked next.439- Verification passed, failed, or skipped.440- Commits created and whether anything was pushed.441- Current branch, submodule pointers, and workspace cleanliness.442- Resource state and cleanup performed when heavy resources were used.443- Active/tool/wait/user-idle time and fresh/cached/output/reasoning tokens when444 the runtime exposes them; otherwise label the available aggregate precisely.445- Verification evidence (or governed proof receipts) produced or reused, its446 relevant identities, and why reuse was447 admissible.448- The next bounded task that should be fed to `autonomous-execution-contract`,449 or the next reactor-ready slice when reactor mode remains appropriate.