Agent Continuity Harness (ACH)
Agent Continuity Harness is the formal project name, with
agent-continuity-harness as the repository slug. Use ach as its short
invocation name.
ACH routes long-running AI collaboration through two internal modes:
guard-mode: lightweight drift control, boundary stabilization, and minimal readback for normal multi-turn work.
continuity-mode: formal state, handoff, recovery, and cross-window continuation when chat history is no longer enough.
Do not ask the user to choose between internal modules unless they explicitly ask about internals.
Default Routing
- Start in
guard-mode when the task has no formal state root, recovery dependency, migration, binding, or window handoff requirement.
- Use references/adg/guard.md for guard-mode behavior.
- Enter
continuity-mode when the task depends on formal state, recovery, .cca-bindings.json, state migration, or a cross-window handoff.
- Use references/cca/entry.md for continuity-mode startup.
- Return to
guard-mode when formal continuity is no longer needed and the preserved state is sufficient for future recovery.
Continuity Rules
When entering continuity-mode:
- Read the workspace
.cca-bindings.json before assuming a state root.
- Reuse an existing valid formal state root when one exists.
- Create a new formal state root only when the task actually needs durable continuation and no valid root exists.
- Keep
current-goal, confirmed-constraints, pending-items, and decisions distinct.
- Treat unresolved assumptions as assumptions, not confirmed facts.
Use assets/state-templates/ only as templates for new formal state roots. The templates are not themselves live state.
Use references/cca/outer.md for formal state write decisions, externalization gates, and state-effect rules.
Use references/architecture-branch-map.md and references/design-constraints.md when changing ACH architecture branches, scoped design constraints, or public-project positioning.
User-Facing Status Rendering
When the user asks for current status, progress, what to do next, or to
continue a bound task, recover from ACH state internally but answer in a
user-facing status view by default.
When a formal state root is bound and the CLI is available, prefer
ach status <task-key> --json as the mechanical source for this view instead
of manually reconstructing current route, blockers, artifacts, and read order
from state files.
Default status answers should show only:
- current route or active mouth
- current usable state
- active rules or constraints that affect the next step
- current blockers or open decisions
- the next suggested action
Do not show formal state root mechanics, manifest details, supplemental document
inventory, validator internals, or a full recovery-core dump unless the user
explicitly asks for audit detail, handoff detail, internals, or the raw state
view.
In Codex usage, the chat viewport is the user-facing status surface. CLI status
output is a backend extraction payload for the skill, not the raw user-facing
view.
State-Effect Router
When the user asks to record, externalize, checkpoint, continue from, pause, or
correct durable task state, route the state effect to the smallest appropriate
ACH state target. Do not ask the user to choose a file unless the state effect
is ambiguous and cannot be inferred from the current state root.
Use this routing before editing state:
- route, mouth, current entry, or current valid artifacts changed: update
active-context when present; update current-goal if the recovery core
would otherwise become stale
- confirmed active rule or constraint changed: update
confirmed-constraints; also update active-context when it affects
immediate recovery
- branch tried, rejected, downgraded, or preserved as diagnostic: update
branch-attempt-ledger when present, or reference the branch outcome from
decisions when no supplemental layer is active
- reusable chart, config, workbook output, script, generated table, or summary
created: update
artifact-provenance-index when present
- dependency, conflict, supersession, invalidation, inverted constraint, or
impact relation matters for future reasoning: update
state-relation-index
when present
- ordinary unresolved next step or non-blocking follow-up: update
pending-items
After choosing the write target, close the write-to-use loop. A state write is
not complete merely because content was added to a file; it is complete only
when a future session can recover and use the intended effect from state.
For every durable state edit, check:
- current recovery: if the edit changes what should be treated as current,
update
active-context or the four-file recovery core so compact recovery
and user-facing status can see it
- read path: if the edit changes what should be read next, update read order,
current artifacts, current blockers, or the relevant
read_when surface
- validity relations: if the edit changes old state validity, mark the old
item as
superseded, diagnostic, rejected, or with a
replacement/relation instead of leaving competing states active
- artifact linkage: if the edit creates or updates reusable artifacts, connect
depends_on and source_paths when available and distinguish active
evidence from diagnostic evidence
- user-facing effect: if the user would expect this edit to affect "what is
current", make sure the user-facing status answer would include the effect
without relying on chat memory
- validation: run the affected task's ACH validation when practical; if
validation cannot run, say so explicitly
When a formal state root is bound and the CLI is available, use
ach check-write <task-key> --json after durable state edits to mechanize this
closure check. Use ach add-supplemental and ach artifact add/check for
standard supplemental document and artifact-index maintenance instead of
manually editing manifest entries when those commands cover the needed change.
If an edit is useful only as cold evidence and should not affect current
recovery or user-facing status, keep it out of the default read path and mark
the condition under which it should be read.
Only create or expand supplemental layers when the corresponding complexity
risk exists, such as branch conflict, current-route ambiguity, reusable
artifacts, correction impact, inverted constraints, or cross-window recovery.
For ordinary tasks, keep the four-file recovery core sufficient.
Intent Workflow Presets
ACH should feel like a default workflow, not a set of commands the user must
assemble. When the user uses natural task-control language, translate the
intent into the corresponding ACH workflow without asking them to name ACH
internals or choose files.
Use these presets by default:
- continue, resume, next, or keep going on a bound task: resolve the binding,
run
ach preflight <task-key> --json or ach resume <task-key> --json when
practical, use ach status <task-key> --json for the current user-facing
state view, read only the additionally required state files, then continue
the work
- record, externalize, checkpoint, remember, or lock this in: route the state
effect through
State-Effect Router, use ach record <task-key> when the
effect is a supported structured append, close the write-to-use loop,
validate the affected task root when practical, then report only the
user-visible effect
- correct, revise, rollback an assumption, or self-check for drift: identify
the changed assumption, scan affected constraints, routes, artifacts, and
pending items, downgrade or supersede stale state, update the current
recovery path, validate when practical, then continue from the corrected
state
- pause, stop here, hand off, or prepare for next window: update current goal,
pending items, and
active-context when present, ensure current artifacts
and blockers are named, prefer ach pause <task-key> when practical, then
provide a compact resume summary rather than a raw state dump
- status, progress, what next, or where are we: recover from ACH state
internally, prefer
ach status <task-key> --json when available, and render
the user-facing status view; do not expose manifest, validator, or
supplemental-document mechanics by default
If no bound formal state root exists, remain in guard-mode unless durable
continuation, recovery, or cross-window handoff is actually needed. Create or
bind a formal state root only when the workflow would otherwise depend on chat
memory.
CLI commands are verifier and recovery tools inside these workflows, not the
user-facing workflow itself. Prefer executing the needed ACH commands directly
over instructing the user to run them. If a CLI command fails or is unavailable,
fall back to reading and editing the formal state root directly, and say which
mechanical check could not be automated.
Use ach list for routine task discovery because it stays usable when old
bindings are invalid. Use ach health when the goal is strict workspace
health. Use ach repair <task-key> --safe only for mechanical state-root
repairs; never use it to rewrite user intent, design conclusions, or
project-domain content.
Public Boundary
- Present Agent Continuity Harness as the formal project identity and
ach as
the invocation shorthand.
- Treat
guard-mode and continuity-mode as internal operating modes.
- Do not publish
adg or cca as separate user choices in normal answers.
- Do not create a second state protocol outside
.cca-bindings.json and the formal state root.
- Capability packs may extend ACH, but they must not rewrite routing or state-root rules.
1---2name: ach3description: Formal public entry for Agent Continuity Harness. Use when Codex should keep long-running, drift-prone, cross-window, recovery-sensitive, or stateful collaboration coherent without asking the user to choose internal guard or continuity modes manually. Start in guard-mode by default; enter continuity-mode only when handoff, recovery, formal state, or cross-window continuation is needed.4---56# Agent Continuity Harness (ACH)78Agent Continuity Harness is the formal project name, with9`agent-continuity-harness` as the repository slug. Use `ach` as its short10invocation name.1112ACH routes long-running AI collaboration through two internal modes:1314- `guard-mode`: lightweight drift control, boundary stabilization, and minimal readback for normal multi-turn work.15- `continuity-mode`: formal state, handoff, recovery, and cross-window continuation when chat history is no longer enough.1617Do not ask the user to choose between internal modules unless they explicitly ask about internals.1819## Default Routing20211. Start in `guard-mode` when the task has no formal state root, recovery dependency, migration, binding, or window handoff requirement.222. Use [references/adg/guard.md](./references/adg/guard.md) for guard-mode behavior.233. Enter `continuity-mode` when the task depends on formal state, recovery, `.cca-bindings.json`, state migration, or a cross-window handoff.244. Use [references/cca/entry.md](./references/cca/entry.md) for continuity-mode startup.255. Return to `guard-mode` when formal continuity is no longer needed and the preserved state is sufficient for future recovery.2627## Continuity Rules2829When entering `continuity-mode`:3031- Read the workspace `.cca-bindings.json` before assuming a state root.32- Reuse an existing valid formal state root when one exists.33- Create a new formal state root only when the task actually needs durable continuation and no valid root exists.34- Keep `current-goal`, `confirmed-constraints`, `pending-items`, and `decisions` distinct.35- Treat unresolved assumptions as assumptions, not confirmed facts.3637Use [assets/state-templates/](./assets/state-templates/) only as templates for new formal state roots. The templates are not themselves live state.3839Use [references/cca/outer.md](./references/cca/outer.md) for formal state write decisions, externalization gates, and state-effect rules.40Use [references/architecture-branch-map.md](./references/architecture-branch-map.md) and [references/design-constraints.md](./references/design-constraints.md) when changing ACH architecture branches, scoped design constraints, or public-project positioning.4142## User-Facing Status Rendering4344When the user asks for current status, progress, what to do next, or to45continue a bound task, recover from ACH state internally but answer in a46user-facing status view by default.4748When a formal state root is bound and the CLI is available, prefer49`ach status <task-key> --json` as the mechanical source for this view instead50of manually reconstructing current route, blockers, artifacts, and read order51from state files.5253Default status answers should show only:5455- current route or active mouth56- current usable state57- active rules or constraints that affect the next step58- current blockers or open decisions59- the next suggested action6061Do not show formal state root mechanics, manifest details, supplemental document62inventory, validator internals, or a full recovery-core dump unless the user63explicitly asks for audit detail, handoff detail, internals, or the raw state64view.6566In Codex usage, the chat viewport is the user-facing status surface. CLI status67output is a backend extraction payload for the skill, not the raw user-facing68view.6970## State-Effect Router7172When the user asks to record, externalize, checkpoint, continue from, pause, or73correct durable task state, route the state effect to the smallest appropriate74ACH state target. Do not ask the user to choose a file unless the state effect75is ambiguous and cannot be inferred from the current state root.7677Use this routing before editing state:7879- route, mouth, current entry, or current valid artifacts changed: update80 `active-context` when present; update `current-goal` if the recovery core81 would otherwise become stale82- confirmed active rule or constraint changed: update83 `confirmed-constraints`; also update `active-context` when it affects84 immediate recovery85- branch tried, rejected, downgraded, or preserved as diagnostic: update86 `branch-attempt-ledger` when present, or reference the branch outcome from87 `decisions` when no supplemental layer is active88- reusable chart, config, workbook output, script, generated table, or summary89 created: update `artifact-provenance-index` when present90- dependency, conflict, supersession, invalidation, inverted constraint, or91 impact relation matters for future reasoning: update `state-relation-index`92 when present93- ordinary unresolved next step or non-blocking follow-up: update94 `pending-items`9596After choosing the write target, close the write-to-use loop. A state write is97not complete merely because content was added to a file; it is complete only98when a future session can recover and use the intended effect from state.99100For every durable state edit, check:101102- current recovery: if the edit changes what should be treated as current,103 update `active-context` or the four-file recovery core so compact recovery104 and user-facing status can see it105- read path: if the edit changes what should be read next, update read order,106 current artifacts, current blockers, or the relevant `read_when` surface107- validity relations: if the edit changes old state validity, mark the old108 item as `superseded`, `diagnostic`, `rejected`, or with a109 `replacement`/relation instead of leaving competing states active110- artifact linkage: if the edit creates or updates reusable artifacts, connect111 `depends_on` and `source_paths` when available and distinguish active112 evidence from diagnostic evidence113- user-facing effect: if the user would expect this edit to affect "what is114 current", make sure the user-facing status answer would include the effect115 without relying on chat memory116- validation: run the affected task's ACH validation when practical; if117 validation cannot run, say so explicitly118119When a formal state root is bound and the CLI is available, use120`ach check-write <task-key> --json` after durable state edits to mechanize this121closure check. Use `ach add-supplemental` and `ach artifact add/check` for122standard supplemental document and artifact-index maintenance instead of123manually editing manifest entries when those commands cover the needed change.124125If an edit is useful only as cold evidence and should not affect current126recovery or user-facing status, keep it out of the default read path and mark127the condition under which it should be read.128129Only create or expand supplemental layers when the corresponding complexity130risk exists, such as branch conflict, current-route ambiguity, reusable131artifacts, correction impact, inverted constraints, or cross-window recovery.132For ordinary tasks, keep the four-file recovery core sufficient.133134## Intent Workflow Presets135136ACH should feel like a default workflow, not a set of commands the user must137assemble. When the user uses natural task-control language, translate the138intent into the corresponding ACH workflow without asking them to name ACH139internals or choose files.140141Use these presets by default:142143- continue, resume, next, or keep going on a bound task: resolve the binding,144 run `ach preflight <task-key> --json` or `ach resume <task-key> --json` when145 practical, use `ach status <task-key> --json` for the current user-facing146 state view, read only the additionally required state files, then continue147 the work148- record, externalize, checkpoint, remember, or lock this in: route the state149 effect through `State-Effect Router`, use `ach record <task-key>` when the150 effect is a supported structured append, close the write-to-use loop,151 validate the affected task root when practical, then report only the152 user-visible effect153- correct, revise, rollback an assumption, or self-check for drift: identify154 the changed assumption, scan affected constraints, routes, artifacts, and155 pending items, downgrade or supersede stale state, update the current156 recovery path, validate when practical, then continue from the corrected157 state158- pause, stop here, hand off, or prepare for next window: update current goal,159 pending items, and `active-context` when present, ensure current artifacts160 and blockers are named, prefer `ach pause <task-key>` when practical, then161 provide a compact resume summary rather than a raw state dump162- status, progress, what next, or where are we: recover from ACH state163 internally, prefer `ach status <task-key> --json` when available, and render164 the user-facing status view; do not expose manifest, validator, or165 supplemental-document mechanics by default166167If no bound formal state root exists, remain in `guard-mode` unless durable168continuation, recovery, or cross-window handoff is actually needed. Create or169bind a formal state root only when the workflow would otherwise depend on chat170memory.171172CLI commands are verifier and recovery tools inside these workflows, not the173user-facing workflow itself. Prefer executing the needed ACH commands directly174over instructing the user to run them. If a CLI command fails or is unavailable,175fall back to reading and editing the formal state root directly, and say which176mechanical check could not be automated.177178Use `ach list` for routine task discovery because it stays usable when old179bindings are invalid. Use `ach health` when the goal is strict workspace180health. Use `ach repair <task-key> --safe` only for mechanical state-root181repairs; never use it to rewrite user intent, design conclusions, or182project-domain content.183184## Public Boundary185186- Present Agent Continuity Harness as the formal project identity and `ach` as187 the invocation shorthand.188- Treat `guard-mode` and `continuity-mode` as internal operating modes.189- Do not publish `adg` or `cca` as separate user choices in normal answers.190- Do not create a second state protocol outside `.cca-bindings.json` and the formal state root.191- Capability packs may extend ACH, but they must not rewrite routing or state-root rules.