Skip to content

armgit / avibe

Public Imported from GitHub
0

Make your computer a home for your AI partner. Avibe is the local-first Agent OS: Vibey, its built-in AI partner, works out of the box, and Claude Code, Codex & OpenCode run unchanged beside it — reach them from your browser, phone, or any chat app.

docs(agent-core): freeze C-10 with the owner's fork decisions (#2411)

Call White5b122f6697f9
diff --git a/docs/plans/agent-core-contracts/README.md b/docs/plans/agent-core-contracts/README.md
index 0d6a97664..bb646f002 100644
--- a/docs/plans/agent-core-contracts/README.md
+++ b/docs/plans/agent-core-contracts/README.md
@@ -16,7 +16,7 @@ on it fork; after that, a change needs orchestrator approval and lands here firs
| C-8 | Backend registration | catalog → every backend list | [`backend-registration.md`](backend-registration.md) | P2 |
| C-5, C-7 | Recovery invariants for jobs, tool calls, and delivery, with owners and proofs | `tools`, `loop`, adapter | [`recovery.md`](recovery.md) | P1 |
| C-9 | Context management: tiers, trigger, cut, forked checkpoint, overflow ladder, guards | `harness` → `agent`, adapter | [`context.md`](context.md); rows in [`transcript-rows.schema.json`](transcript-rows.schema.json) | P3 (frozen 2026-10-04) |
-| C-10 | Fork: fork point, side turn, fork Session, lineage, capability, merge-back | `harness`, `agent`, storage, service → C-9, adapter, surfaces | [`fork.md`](fork.md) | before its Phase 1 lanes (draft, owner decisions pending) |
+| C-10 | Fork: fork point, side turn, fork Session, lineage, capability, merge-back | `harness`, `agent`, storage, service → C-9, adapter | [`fork.md`](fork.md) | Phase 1 (frozen 2026-10-10) |
Conventions:
diff --git a/docs/plans/agent-core-contracts/context.md b/docs/plans/agent-core-contracts/context.md
index fe17cc05b..a6d5a1127 100644
--- a/docs/plans/agent-core-contracts/context.md
+++ b/docs/plans/agent-core-contracts/context.md
@@ -151,7 +151,7 @@ out, and §8 (d) applies.
## 6. Checkpoint turn
-A checkpoint is written by a **fork** of the conversation, the only delivery path:
+A checkpoint is written by a **side turn** of the conversation (C-10 `fork.md` §7), the only delivery path:
- The request uses the same hop, system prompt, tool definitions, tool choice, and reasoning settings as the
conversation's next request, and its messages begin with the conversation's projected messages unchanged, so its
@@ -161,11 +161,13 @@ A checkpoint is written by a **fork** of the conversation, the only delivery pat
the cut, which is a prefix of the original request.
- One user message is appended: the checkpoint request (§11).
- The turn's requests take the request pipeline (§10, invariant 1; a request that cannot fit is never sent and
- fails the attempt as an overflow), its responses the admission (invariant 6), and its tool calls the tool pipeline
- (invariant 2). Its responses and results are never committed to the context, and nothing is shown to the user.
+ fails the attempt as an overflow), its responses the admission (invariant 6), and its tool calls the side turn's
+ tool pipeline (invariant 2, C-10 §7 step 3). Its responses and results are never committed to the context, and
+ nothing is shown to the user.
-**Tool policy** ("dreaming": cognition allowed, actuation blocked), a declarative table judged after the turn's
-budget (invariant 2):
+**Tool policy** ("dreaming": cognition allowed, actuation blocked), the side-turn policy `DREAMING` (C-10 §6), a
+declarative table judged after the turn's budget (invariant 2). C-9 owns its values: the table and the two texts
+below, and the budget's 5 rounds, 4,000-token floor, and 1,000-token slack; C-10 §7 step 3 applies them:
| Tool | Rule |
| --- | --- |
@@ -211,9 +213,9 @@ budget (invariant 2):
the audit row. So is a checkpoint whose row the host cannot complete (§10, invariant 4).
- The turn's messages, read from the attempt ledger (§10, invariant 4) with every failed or retried attempt's
partial and its usage, and the turn's tool results, are recorded once per checkpoint turn, on every exit but an
- abort (§10, invariant 4), outcome included, as an audit row
- (`agent_events.event_type = 'context_checkpoint_turn'`, `visibility = 'audit'`, no `context_seq`; shape
- `CheckpointTurn`), never as context.
+ abort (§10, invariant 4), outcome included, as the side turn's audit row (`agent_events.event_type = 'fork_turn'`,
+ `visibility = 'audit'`, no `context_seq`; shape `ForkTurn` with `purpose: checkpoint` and `detail: {reason,
+ mode}`; C-10 F7), never as context.
## 7. Checkpoint row and projection
@@ -353,7 +355,8 @@ ends the run `context_exhausted`, as in P1. The adapter supplies the following;
- A `TranscriptStore` (C-5 §2) implementing the whole protocol C-9 uses: `append_response(..., request=...)` keeps
`ModelResponse.request` for the anchor (§2); `append_payloads(session_id, entries)` writes several payload rows in
one transaction (invariant 3); `append_audit(session_id, kind, payload)` writes a non-context audit row,
- `checkpoint_turn` (§6) or `attempt` (invariant 4), in every mode; every loaded row carries its `created_at` (§3).
+ `fork_turn` (§6, C-10 §7) or `attempt` (invariant 4), in every mode; every loaded row carries its `created_at`
+ (§3).
The SQLite store and the adapter's implement it, and one contract suite runs the same tests on them and on the
in-memory store the engine tests use (`tests/test_transcript_store_contract.py`).
- The full environment block (C-7 §8) on the first input after a checkpoint: the summarized inputs that carried it
@@ -392,8 +395,9 @@ every-exit audit: `test_loop.py`) that fails when its order or owner is broken.
1. **One request pipeline.** Projection, then `budget()` on that final request, once per composed request, then
the C-9 stage, then the provider. Nothing changes a request after it is budgeted; a stage step that changes the
context rebuilds the request from the top. Whether a request fits is always `budget()` on a request actually
- composed: the request to send, the fork the stage would send first (the checkpoint turn composes its requests the
- same way, so the dry run and the turn cannot differ), and the stop check's minimal request (§3: the drop's own
+ composed: the request to send, the side turn the stage would send first (`side_turn_fits`, which composes the
+ caller's rehydrated messages and prefix exactly as the side turn does, so the dry run and the turn cannot differ;
+ C-10 §7), and the stop check's minimal request (§3: the drop's own
row for that cut, built by the one builder of checkpoint rows and projected like any context; with fewer than two
units, the request itself). The one bound
that extends a budget by arithmetic is the checkpoint turn's tool room, from its latest request's budget (§6);
@@ -401,10 +405,10 @@ every-exit audit: `test_loop.py`) that fails when its order or owner is broken.
the stage, before provider admission. Checkpoint requests take the same pipeline. In v1 an Agent with a
`ContextConfig` takes no user hooks (a configuration error), so nothing else can rewrite a request C-9 owns;
hooks with context management are a post-v1 design item (plan §10).
-2. **One tool pipeline** in a checkpoint turn: the turn's budget (once closed, `BUDGET_USED`), then the checkpoint
- table (a denial is its fixed text), then execution (a scratch `write` or `edit` relative to the root's
- descriptor, as joined work an abort waits for), then the bound on the result of every call that ran (§6). The
- two fixed texts are never cut.
+2. **One tool pipeline** in a checkpoint turn, the side turn's (C-10 §7 step 3): the turn's budget (once closed,
+ `BUDGET_USED`), then the checkpoint table (a denial is its fixed text), then execution (a scratch `write` or
+ `edit` relative to the root's descriptor, as joined work an abort waits for), then the bound on the result of
+ every call that ran (§6). The two fixed texts are never cut.
3. **One commit for C-9 state.** A transition (its `context_edit` rows or its `context_compaction` row, and the hook
state of that commit point in `AgentState`) is written in one transaction (`append_payloads`), before any event
announces it; a failed commit leaves nothing. C-9 keeps no other durable state.
@@ -418,9 +422,9 @@ every-exit audit: `test_loop.py`) that fails when its order or owner is broken.
mode, with or without `ContextConfig`, on every exit of the model call but an abort; a failed audit write is a
diagnostic and is not retried. The cancelled run scope admits no further store write, so an aborted call's
unaudited attempts are not kept. It is the one place that usage is kept. A checkpoint attempt's partials and
- usage are kept in its `CheckpointTurn` row (§6), which the turn writes by the same rule: once, on every exit but
- an abort, whichever step ends it (compose, provider, admission, the host's state or hint, building the row,
- commit). A failed request or a host failure after the model answered is a failed checkpoint, counted by the
+ usage are kept in its side turn's `fork_turn` audit row (§6, C-10 F7), written by the same rule: once, on every
+ exit but an abort, whichever step ends it (compose, provider, admission, the host's state or hint, building the
+ row, commit). A failed request or a host failure after the model answered is a failed checkpoint, counted by the
run's bound; an engine error building the row, or a failed commit, ends the run with nothing landed (invariant 3).
5. **Route-scoped anchors.** An anchor answered by another origin (provider, api, model) is invalid (§2).
6. **One admission path.** Every response, of every purpose (conversation, checkpoint), and every partial with
@@ -492,7 +496,8 @@ Rules: terse bullets, not paragraphs. Preserve exact paths, identifiers, command
## 12. Deferred
Not built in v1: background precomputed compaction; server-side compaction (forbidden by hard constraint 8);
-automatic re-read of recently modified files; memory tools (the policy reserves their row); lowering effort for the
+automatic re-read of recently modified files; memory tools (the policy reserves their row; a memory side turn,
+C-10 §13); lowering effort for the
checkpoint turn through a per-message system effort.
Sources: the cut rule, cumulative file lists, and the overflow patterns from Pi (MIT, `7fbbd5f`); the merge rule from
diff --git a/docs/plans/agent-core-contracts/fork.md b/docs/plans/agent-core-contracts/fork.md
index 3d04bebe7..026566960 100644
--- a/docs/plans/agent-core-contracts/fork.md
+++ b/docs/plans/agent-core-contracts/fork.md
@@ -1,8 +1,8 @@
# C-10 Fork
-Status: **draft**, 2026-10-08. Design only. Points the owner decides are marked **[O-n]** and collected in §18. Every
-`file:line` was read on `avibe-agent` at `ce169436c`. After the owner decides, the delta in §16 is applied to the
-contracts it touches, and this file is frozen before the Phase 1 lanes fork (README).
+Status: **frozen** 2026-10-10 by owner decision (§18). Every `file:line` was read on `avibe-agent` at `ce169436c`. The
+delta in §16 is applied to the contracts it touches. A change now needs orchestrator approval and lands here first
+(README).
A fork is an execution context whose model-visible messages begin with a source context's projection at a **fork
point**, and which then diverges on its own. Fork is the base other features build on: C-9's checkpoints today, and
@@ -10,18 +10,21 @@ later an Agent copying itself into a team, managing its own context, and consoli
## 0. Example
-Session P runs on Vibey and has 40 context rows. The user forks from the reply at message 12, whose row has
-`context_seq` 23. P keeps working on a later Turn meanwhile.
+Session P runs on Vibey and has 40 context rows. Its fourth Turn ended with Vibey's reply at `context_seq` 23. Its fifth
+Turn began with the user's input at 24 and is in the middle of a tool batch. The user clicks Fork.
-1. The reservation resolves the fork point. The reply is a response with no tool calls, so the cut is 23. No tool
- call at or before 23 lacks its result, so the cut is legal. It writes Session C with `fork_source_session_id = P`,
- `fork_source_message_id = <message 12>`, and `fork_source_context_seq = 23`, and copies no row.
+1. The reservation resolves the fork point. P has a live Turn whose first input is row 24, so the cut is the largest
+ settled `context_seq` before 24: 23, the end of the previous ended Turn. No tool call at or before 23 lacks its
+ result, so the cut is legal. It writes Session C with `fork_source_session_id = P` and
+ `fork_source_context_seq = 23`, and copies no row. Had the fourth Turn been stopped or failed, its open calls would
+ have been settled by recovery (T2), and the cut would be its last settled row.
2. C's first Turn loads P's rows with `context_seq <= 23` and projects them. The result is what P's model saw at 23:
- checkpoints and edits written up to 23 apply, later ones do not. The user's message becomes C's row 24.
+ checkpoints and edits written up to 23 apply, later ones do not. Nothing of the fifth Turn reaches C: not its input,
+ its tool calls, or its intermediate replies. The user's message becomes C's row 24.
3. P commits 41, 42, and so on. P and C are different Sessions with different locks and `context_seq` spaces. C never
sees what P writes after 23, and P never sees what C writes.
4. P's Watch `w1`, started at row 18, stays P's, and its follow-up goes to P. C's environment block lists only C's
- Watches. C's fork notice says that work started before the fork reports to P.
+ Watches. C's fork notice says that work started before the fork reports to the Session that started it.
5. Later C's context passes its threshold. C-9 runs a **side turn** in C: the same idea of a fork point, without a
new Session. Its prefix is C's latest request, its tools are C's own tool definitions run under the dreaming
policy, and its reply is folded into one `context_compaction` row in C.
@@ -40,7 +43,7 @@ because identity is what an effect beyond the turn needs.
| Result | a value, which the caller folds into its own context (§9) | nothing, or its replies delivered as inputs to another Session (§9) |
| Persists | one audit row in the caller's Session, plus what the caller's fold commits | its own rows; the prefix by reference |
| Layer | engine, `core/agent_core/agent` | storage and service (`storage/agent_transcript.py`, `core/services/session_fork.py`) |
-| Consumers | C-9 checkpoints, memory consolidation, rewriting its own context | the user's "fork from here", `vibe agent run --fork-*`, teammates, delegated exploration |
+| Consumers | C-9 checkpoints, memory consolidation, rewriting its own context | the user's Fork, `vibe agent run --fork-*`, later teammates and delegated exploration |
**Why identity separates them.** A command is a job keyed by its call instance: the committed response that made the
call, in a Session (`core/agent_core/tools/base.py:28-42`). Watches, T2 recovery, approvals, and the user's access
@@ -84,14 +87,16 @@ between a response with no tool calls and a steer.
**How each carrier uses the coordinates.**
- **A fork Session uses `units = None`.** The child stores one number, `fork_source_context_seq = as_of` (C-5 §4).
- Its projection of the inherited rows is the source's view at `as_of`.
+ Its projection of the inherited rows is the source's view at `as_of`. A user's fork always takes the latest point
+ (below); an arbitrary settled point is an internal capability for system mechanisms, with no product surface
+ (owner decision O-2, §18).
- **A side turn uses `as_of` = the caller's latest committed row.** That row is the run's own view. `units` selects
a prefix of that view, which C-9's rolling checkpoint needs (`view.prefix(cut)`, `loop.py:1280-1282`). A side turn
never forks an older view in v1: a side turn exists to reuse a byte prefix of the request just sent (§3).
**Why two coordinates.** A later checkpoint or edit changes how earlier rows project.
-- The view at `as_of` is what the model saw then. A fork "from message 12" wants this view.
+- The view at `as_of` is what the model saw then. A fork Session wants this view.
- A prefix of the current view is what the model sees now, cut short. C-9's rolling checkpoint wants this one.
The view at `as_of` also defines the prefix of a cut in a compacted region:
@@ -102,26 +107,57 @@ The view at `as_of` also defines the prefix of a cut in a compacted region:
### Resolving a fork Session's point
This replaces `resolve_fork_anchor_seq` and `context_bound` (`storage/agent_transcript.py:492-536`). Those match
-`agent_events` rows to an anchor message by wall clock (`:528-534`); this rule uses only `context_seq` and row
-shape.
+`agent_events` rows to an anchor message by wall clock (`:528-534`); this rule uses only `context_seq`, row shape,
+and the live Turn's first input.
-| Request | `as_of` |
+Two kinds of fork, told apart by construction, never by timing:
+
+- **A user's fork**: one the user requests. That is the Workbench Fork and "Ask in a new session" (the HTTP route),
+ and CLI `vibe agent run --fork-session <id>`, even when it names the caller's own Session from inside its Turn.
+- **A self-fork**: the Agent's own fork from inside its live Turn, `vibe agent run --fork-self`. That path resolves
+ the source from the caller's `AVIBE_SESSION_ID` and is the only one that passes `self_fork=True` to the
+ reservation. It is part of the Turn that requests it, and Agents keep it as it is (owner decision O-4).
+
+| Request (Vibey) | `as_of` |
| --- | --- |
-| a response with no tool calls: a reply (`result`, `error`, a hidden final `assistant`) or an answer before a steer | its `context_seq` |
-| a response with tool calls | the `context_seq` of its last tool result, which ends its unit; refused while a result is missing (`session_fork_point_unsettled`) |
-| a consumed input (`user`, `harness`, `agent_initiated`, `annotation`) | the largest settled `context_seq` before it in the source's context, or 0 when there is none, so the fork asks again from there |
-| a row without `context_seq`: display-only, queued, or removed | refused (`session_fork_point_not_in_context`) |
-| no point, and the source has a live Turn | the largest settled `context_seq` before that Turn's first consumed input (of the whole context while the Turn has consumed none), so the live Turn is trimmed |
-| no point, and no live Turn | the largest settled `context_seq` of the source's context |
+| a user's fork, and the source has an unfinished Turn (defined below) | the largest settled `context_seq` before the first input of the earliest unfinished Turn |
+| a user's fork, and every Turn of the source is finished | the largest settled `context_seq` of the source's context: the end of its last Turn |
+| a self-fork | the largest settled `context_seq` of the source's context: the live Turn's input and finished steps, stopping before the response whose call is running the fork, which is still open |
+| a system mechanism's fork at a given `context_seq` `s` (internal only: `reserve_forked_session(..., as_of=s)`, which no CLI, HTTP, or Web path passes) | `s`, when `0 <= s <=` the source's last `context_seq` and `s` is settled; otherwise refused (`ForkPointError`) |
+
+**The owner's rule for a user's fork**, for every backend: a fork never carries a live Turn. The cut is the end of the
+previous **ended** Turn: its final reply, or, for a Turn the user stopped or that failed, its last row once recovery
+has settled it (T2 and T3). The live Turn's input, its tool calls, and its intermediate responses never reach the
+child. Vibey enforces it through its fork point, as below; a native backend trims the live Turn or refuses the fork
+while it is live, by construction or by a check (§11). For Vibey it holds by construction:
+
+- The live Turn writes all of its rows after its first input, because the loop is the Session's single writer
+ (C-5 §2), so every row before that input belongs to an ended Turn.
+- The cut is fixed once, in the reservation's transaction, from committed rows. Rows that receive a `context_seq`
+ later never move into or out of the prefix (C-5 §4).
+- The fork never waits on, or races with, a timing condition.
+
+**Unfinished Turn**, the one definition the cut, §15, and F3 use. A Turn is unfinished while any of these holds:
+
+1. it is live (`session_turns.state` is `starting` or `active`);
+2. it holds a call without a result: T2 has not settled it. Turns run one at a time and each writes its rows after
+ its first input, so the Turn owning an open call is the latest Turn whose first input precedes that call;
+3. it accepted an input that is not in the context yet: a Delivery of that Turn is `accepted` and its input row has
+ no `context_seq`, which T3 admits later.
+
+A Turn's first input is the row its initial Delivery names (`session_turns.initial_delivery_id`; the Delivery and
+its input row share the id). One storage query over `session_turns`, `message_deliveries`, and `messages` finds the
+earliest unfinished Turn, and the cut falls before its first input, so a child never inherits a partial Turn whose
+recovery would land after its fixed point. When T2 or T3 is still pending, the cut falls one Turn earlier than it
+will once they finish; that is the same trade as for a live Turn, and it keeps timing out of the fork.
+
+Other rules:
- **0 is the empty prefix.** A child with `fork_source_context_seq = 0` inherits no row, and its first own row is
`context_seq` 1. `fork_link` already accepts 0 (`agent_transcript.py:677-678`), and `context_view` over no row is
empty.
-- **The requested row must be one of the source's own rows.** A row the source inherited is refused
- (`session_fork_point_inherited`), and the error names the Session that owns it. Forking that Session at that row
- gives the same prefix, and the lineage then names the Session the message belongs to, so a link to the message
- resolves in that Session.
-- Rows that receive a `context_seq` later never move into or out of the prefix (C-5 §4).
+- **An internal point may lie in the source's inherited prefix.** The ancestry walk bounds every ancestor by it
+ (`_ancestry`, `agent_transcript.py:682-698`), so the prefix is the same as a fork of the ancestor at that point.
**Trimming the live Turn changes today's behavior.**
@@ -161,7 +197,7 @@ because they are rendered into the prompt (C-9 §6).
- For a user's fork, correct identity is worth one cold prefix.
- For N teammates forked from one large context, it is N cold copies of that context.
- The remedy is a Session-invariant system prompt, with the Session id moved into the environment block of the
- first input (C-7 §8). That is reserved for Phase 2 (§17).
+ first input (C-7 §8). That is left to the teams design (§17).
## 4. Storage: by reference
@@ -210,18 +246,18 @@ Consequences:
- **Child to source.** The reservation writes top-level metadata on the child Session (`session_fork.py:368-399`):
- `fork_source_session_id`
- - `fork_source_message_id`: the requested message, or for "latest" the anchor where the backend trims
+ - `fork_source_message_id`: unchanged, the anchor message the reservation reads (for a live Turn, its first
+ input, which the cut excludes); native backends trim at it
- `fork_source_context_seq`: Vibey only
- `fork_created_at`
-
- Phase 1 adds no new shape.
+ - `fork_self`: `true` on a self-fork only, so a native backend's first Turn skips the live-Turn check (§11). The
+ reservation copies the source's metadata, so it removes a `fork_self` inherited from a source that was itself a
+ self-fork; only a self-fork's reservation sets it.
- **Source to children.** This is absent today. Lineage is recorded only child to parent, and the UI only shows the
- child's banner (`ui/src/components/workbench/ChatPage.tsx:4071-4083`). Retention, teams, and runaway bounds need
- the reverse lookup. Phase 2 adds:
- - an expression index on `json_extract(metadata_json, '$.fork_source_session_id')`;
- - one metadata key, `fork_initiator`: `user`, or the requesting Session and run.
-
- No column is added. The metadata keys stay the one record.
+ child's banner (`ui/src/components/workbench/ChatPage.tsx:4071-4083`). Retention and teams need the reverse
+ lookup. When one of them is designed, it adds an expression index on
+ `json_extract(metadata_json, '$.fork_source_session_id')` rather than a column, so the metadata keys stay the one
+ record.
- **Side turns.** Each leaves one `fork_turn` audit row in the caller's Session, recording its point, purpose,
policy, and outcome (§7). That row is a side turn's lineage.
@@ -303,7 +339,8 @@ turn runs inside the caller's run, in these steps:
fails.
6. **Audit (F7).** The side turn writes one `fork_turn` audit row (`visibility = 'audit'`, no `context_seq`) on every
exit except an abort. The row holds:
- - its purpose, policy, and point;
+ - its purpose, policy, point, and `detail` (required: the purpose's own fields, checked when the side turn is
+ built);
- every attempt's message, from the ledger, and the turn's tool results;
- its usage, rounds, outcome, and error;
- the id of the folded row.
@@ -325,10 +362,11 @@ move; the API reserves this (§15).
## 8. Fork Session
-- **Reservation.** `reserve_forked_session` (`session_fork.py:177`) gains `at_message_id`.
- - For `vibey`, it resolves `as_of` (§2) inside the reservation's transaction and writes the metadata (§5).
- - For a backend without point-in-time support, `at_message_id` is refused with `session_fork_point_unsupported`
- (§11).
+- **Reservation.** `reserve_forked_session` (`session_fork.py:177`) keeps its callers. For `vibey` it resolves the
+ fork point (§2) inside the reservation's transaction and writes the metadata (§5): the user's latest point, a
+ self-fork's point with `self_fork=True` (only the `--fork-self` path passes it), or, with the internal keyword
+ `as_of`, a settled point a system mechanism names. No CLI, HTTP, or Web path passes `as_of`, and it is refused for
+ other backends. Native backends trim or refuse while live (§11).
- **It owns nothing its ancestors started (F4).** A side turn, by contrast, starts nothing.
- Jobs, Watches, Tasks, delegated runs, and scratch stay with the Session that started them. In a nested fork (P,
then C forked from P, then D forked from C), a job P started still reports to P, not to D's source C.
@@ -347,10 +385,8 @@ move; the API reserves this (§15).
`storage/models.py:875-879`).
- The child has its own writer lock and its own transcript lock (`agent.py:1184-1212`, `agent_transcript.py:331-337`).
- **Display.**
- - The child's Workbench shows its own rows and the fork banner (`ChatPage.tsx:4071-4083`). For a fork taken at a
- message, the banner is extended to name that message, with a link to it in the source Session, which owns it
- (§2) **[O-3]**. A fork at the latest point keeps today's banner, which links to the source Session.
- - The inherited prefix is not rendered in the child.
+ - The child's Workbench is unchanged: its own rows and today's fork banner, which links to the source Session
+ (`ChatPage.tsx:4071-4083`). The inherited prefix is not rendered in the child (owner decision O-3).
- The earlier-record hint already names the source and the seq (`modules/agents/vibey/context.py:86-87`).
## 9. Merge-back
@@ -386,8 +422,9 @@ information shown to the model.
- Today only the Harness's process-wide limit of 8 concurrent runs bounds them (`core/scheduled_tasks.py:3971`).
- Model Hub does not cap spend, by design (`core/handlers/model_hub/usage.py:18-24`).
- Delegation depth is recorded (`parent_run_id`, `vibe/cli.py:6898`) but not bounded.
-- Plain delegation, `vibe agent run --agent`, recurses the same way, so the bound on depth and on live descendants
- belongs to the Harness, not to fork **[O-4]**.
+- Plain delegation, `vibe agent run --agent`, recurses the same way.
+- Owner decision O-4: no new limit. Agents keep forking themselves through `vibe agent run --fork-self` with no
+ depth or descendant bound.
**Model Hub.**
@@ -406,35 +443,53 @@ information shown to the model.
| Layer | Owns | Phase 1 change |
| --- | --- | --- |
-| `core/agent_core/harness` | `ForkPoint`, `settled`, `fork_cut`, `fork_prefix` (pure, §2) | add them; `fork_prefix` is `context_view` plus `prefix` |
+| `core/agent_core/harness` | `ForkPoint`, `settled`, `latest_cut`, `fork_point`, `fork_prefix` (pure, §2) | add them in `harness/fork.py`; `fork_prefix` is `context_view` plus `prefix` |
| `core/agent_core/agent` | side turn: `SideTurn`, `ForkPolicy`, `DREAMING`, `Agent.side_turn`, `Agent.side_turn_fits` | extract them from C-9 (§12) |
-| `storage/agent_transcript.py` | storage by reference, ancestry, `resolve_fork_point` (SQL around `fork_cut`) | replace `resolve_fork_anchor_seq` and `context_bound` |
+| `storage/agent_transcript.py` | storage by reference, ancestry, `resolve_fork_point` (SQL around the harness rule) | replace `resolve_fork_anchor_seq` and `context_bound` |
| `modules/agents/vibey` | the fork notice on the first input; T2 without the inherited branch | as listed |
-| `core/services/session_fork.py` | the reservation for every backend, `at_message_id`, error codes | add `at_message_id` |
-| `modules/agents/catalog.py` | `FORK_AT_MESSAGE_BACKENDS`, a capability-specific set (C-8) | add `{"vibey"}` |
-| surfaces | CLI, HTTP, Web | below |
-
-### Backend support
-
-| Backend | Fork today | Point-in-time | Phase |
-| --- | --- | --- | --- |
-| `vibey` | by reference, at the latest point (`session_fork.py:381-399`) | yes (§2) | 1 |
-| `codex` | `thread/fork` (`modules/agents/codex/agent.py:3316-3421`); `lastTurnId` is used only to trim a live Turn (`:3393-3408`) | `lastTurnId` accepts any completed Turn. Avibe maps only a Turn's initial input to its Codex Turn (`native_turn_id_for_initial_message`, `core/session_turns.py:8008-8044`); point-in-time needs a reply-to-Turn association and, for a fork before an input, the preceding Turn | 3, first |
-| `claude` | `resume` with `fork_session` (`core/handlers/session_handler.py:1558-1563`, `:1730-1731`) | the Agent SDK's `resume_session_at` takes a message UUID, used with `fork_session`; Avibe stores no map from message to UUID | 3; needs the map |
-| `opencode` | `POST /session/{id}/fork`; `messageID` is sent only to trim (`modules/agents/opencode/server.py:818-837`) | `messageID` accepts any message, and the fork excludes it; Avibe stores no map from message to OpenCode id | 3; needs the map |
-
-### Surfaces in v1 [O-2]
-
-- **CLI.** `vibe agent run --fork-session <id> --at <message-id>`, and `--fork-self --at <message-id>`. `--at`
- requires one of the fork flags. The CLI examples in the injected system prompt are live callers, so they need
- parser-backed coverage (AGENTS.md §7).
-- **HTTP.** `POST /api/sessions/<id>/fork` accepts `{"at_message_id": ...}`. Today the route reads no body
- (`vibe/ui_server.py:9377-9400`), and the UI posts `{}` (`ui/src/context/ApiContext.tsx:3702-3703`).
-- **Web.** A "Fork from here" action on a Vibey reply. It is a new UI element, so an approved `design.pen` frame
- comes first **[O-3]**.
-- **IM.** None. The owner decided against slash commands.
-- **A fork tool for Agents.** Not in v1 **[O-4]**. Agents fork through `vibe agent run --fork-self [--at]`, and the
- result returns by callback. A tool with typed merge-back, and side turns for Agents, come with teams.
+| `core/services/session_fork.py` | the reservation for every backend | for `vibey`, call `resolve_fork_point`; the internal keyword `as_of` (no product surface passes it) |
+
+### Backend support and enforcement
+
+Point-in-time fork for native backends is cancelled (owner decision, 2026-10-10): they keep forking at the latest
+point, which they already support. The user-fork rule (§2) holds for every backend. Vibey and Codex enforce it by
+construction; OpenCode and Claude enforce it by a check, with the residual window stated below:
+
+| Backend | Fork | A user's fork while the source has a live Turn | Holds | A self-fork |
+| --- | --- | --- | --- | --- |
+| `vibey` | by reference (§2, §4); arbitrary settled points internally | **trim**: cut at the previous ended Turn, fixed at reservation | by construction | the largest settled point (§2) |
+| `codex` | `thread/fork` (`modules/agents/codex/agent.py:3316-3421`) | **trim**: `lastTurnId` is always the last completed Turn, resolved when the native fork runs (the child's first Turn), so a Turn that starts later is excluded by the backend's own boundary; when the whole turn listing proves no Turn has completed (the source's first Turn is live), the child starts a fresh thread, the empty prefix; an unknown boundary fails closed | by construction | unchanged (trims) |
+| `opencode` | `POST /session/{id}/fork` (`modules/agents/opencode/server.py:818-837`) | **trim**: `messageID` before the live Turn's input; checked at reservation and again at the child's first Turn | by check | unchanged (trims) |
+| `claude` | `resume` with `fork_session` (`core/handlers/session_handler.py:1558-1563`, `:1730-1731`) | **refuse while live**: `session_fork_source_running`, "This conversation is still running. Wait for the current turn to finish, then fork." (en and zh); checked at reservation and again at the child's first Turn | by check | unchanged: copies the transcript as it stands |
+
+A native fork copies when the child first runs, not at reservation, so each check runs at both points. The child's
+first Turn reads the source's Turn rows (`uq_session_turns_live_session`, `storage/models.py:875-879`) in a
+transaction, never a clock; for Claude a live source fails that Turn with the same message, its input kept for an
+explicit retry. A self-fork is exempt: the reservation records `fork_self` on the child, so the first-Turn checks
+skip it.
+
+**Residual window (OpenCode and Claude).** A source Turn that starts after the first-Turn check and before the
+backend makes its copy can still reach the child. Closing it needs no fence: the Turn owner's admission lock is
+best-effort, and Turn dispatch never awaits it (`core/session_turns.py:745-747`), so a fork must not block the
+source's next message. It needs a boundary the backend applies itself, which is the follow-up "native fork
+boundaries", scheduled after Phase 1b:
+
+- **OpenCode:** fork, then revert the private child to the last message of the last completed Turn, resolved before
+ the fork call. Nothing else writes to the child, so nothing races.
+- **Claude:** `resume_session_at` with the UUID of the last message of the last completed Turn, read from Claude's own
+ transcript when the native fork runs, with a fixture-based test against real transcripts. It replaces the refusal:
+ Claude then trims like the others.
+
+### Surfaces
+
+There is no new surface (owner decisions O-2 and O-3). The existing ones keep their shape and reach the cut rule
+through `reserve_forked_session`:
+
+- **Workbench.** The session menu's Fork (`ui/src/components/workbench/useSessionActions.tsx:141-161`) and "Ask in a
+ new session" (`ChatPage.tsx:487-503`) post `{}` to `POST /api/sessions/<id>/fork` (`vibe/ui_server.py:9377-9400`).
+- **CLI.** `vibe agent run --fork-session <id>` and `--fork-self` (`vibe/cli.py:6592-6640`).
+- **Not built:** CLI `--at`, an HTTP `at_message_id`, a Web "fork from here", an IM command, and a fork tool for
+ Agents. Agents fork themselves with `vibe agent run --fork-self`, and the result returns by callback.
## 12. C-9 on the primitive
@@ -492,13 +547,14 @@ already provide, plus work outside fork.
now or a tool later. They run in the background with one task message each. Each shares the prefix by reference
and runs concurrently as its own Session, and their replies come back as Harness inputs (§9).
- Needs from fork: nothing more.
- - Needs elsewhere, reserved for Phase 2: the descendant lookup and `fork_initiator` (§5); the Harness bound on
- depth and live descendants **[O-4]**; a Session-invariant system prompt, so that N forks of one large context hit
- the cache (§3).
+ - Needs elsewhere, left to the teams design: the descendant lookup (§5) and a Session-invariant system prompt, so
+ that N forks of one large context hit the cache (§3). No depth or descendant bound (O-4).
- **Self context management.**
- Explore and come back: a background fork Session with full tools, because exploring needs `bash`. Its reply
returns as a message.
- - Go back: `--fork-self --at <message>` continues from an earlier point. Phase 1 provides it.
+ - Go back: a system mechanism forks the Session at an earlier settled point through the internal API
+ (`reserve_forked_session(..., as_of=s)`, §2, §15) and continues there. Phase 1 provides the API; there is no user
+ or Agent surface for it.
- Rewrite part of its own context: a side turn with `dreaming` over a prefix, folded into a row. Summarizing a
middle range while keeping the head needs a range checkpoint row in C-5 and C-9 projection, not a change to fork.
- **Memory.**
@@ -514,7 +570,7 @@ already provide, plus work outside fork.
| --- | --- | --- | --- |
| F1 | A fork's messages through its cut equal `prefix(source, point)`, and a fork Session gets the same bytes on every request, whatever either Session commits later | harness, storage | a source with checkpoints and edits both before and after the cut, plus a cut before a later checkpoint; after N commits in each Session, the child's projection through `as_of` serializes equal to `project(source, fork_point=as_of)` |
| F2 | A side turn's first request has the caller's endpoint, system prompt, tool definitions, tool choice, and reasoning settings, and its messages begin with the caller's latest request through the cut | agent | the stub's request log, for normal and rolling side turns |
-| F3 | Every fork point is settled; a fork never inherits an open call, and never settles or looks up a call it did not make (settled calls are inherited as history, F1) | harness, storage | every row kind in §2's table, including mid batch, a job handed over, a running foreground job, a Session's first input (0), and an inherited row (refused, naming its owner): resolved settled, or refused |
+| F3 | Every fork point is settled; a fork never inherits an open call, and never settles or looks up a call it did not make (settled calls are inherited as history, F1) | harness, storage, service, adapters | a user's fork while the live Turn is mid tool batch gets exactly the previous ended Turn's prefix; a stopped and a failed previous Turn are legal cuts; nothing of the live Turn (input, calls, responses) reaches the child; every unfinished Turn (§2's definition: live, an open call awaiting T2, or an accepted input awaiting T3) is cut out whole; a Vibey self-fork keeps the live Turn's input and finished steps and no open call (native self-forks keep their behavior, §11); a user's fork of a Session that was itself a self-fork carries no `fork_self`; `--fork-session` naming the caller's own Session is a user's fork; a Codex fork always passes `lastTurnId` resolved at first use, including for a source that was idle at reservation, and starts a fresh thread when the listing proves no Turn has completed; an OpenCode user's fork trims a source that became live after reservation; a Claude user's fork is refused while the source has a live Turn, at reservation and at the child's first Turn, and a Claude self-fork is not; the internal API refuses an unsettled or out-of-range point and accepts 0 |
| F4 | A fork Session owns nothing an ancestor started: jobs, Watches, Tasks, runs, scratch stay with the Session that started them. A side turn starts nothing: its calls have no call instance | vibey, service, agent | a child of a source with a live job Watch neither lists it nor receives its follow-up, and its first input carries the notice; a side turn's `bash` call starts no job even when a policy allowed it |
| F5 | A fork Session never writes a row of its source. A side turn writes only its audit row and, after the reply, what its fold commits | agent, storage | the source's rows before and after a child's Turns; the caller's rows after a failed and after a successful side turn |
| F6 | A side turn has no capability its caller lacks; a fork Session runs an Agent the requesting caller may select, on the source's backend | agent, service | a side turn's call to every tool its policy does not allow is denied and never runs; a reservation without editor on the source, chat in the destination, or selection authority for the Agent (inherited or `--agent`) is refused, as is an Agent on another backend |
@@ -533,12 +589,13 @@ class ForkPoint:
units: Optional[int] = None # side turns: the first `units` units of the view at as_of
class ForkPointError(ValueError):
- code: Literal["session_fork_point_not_in_context", "session_fork_point_inherited",
- "session_fork_point_unsettled"]
+ code: Literal["unsettled", "out_of_range"] # internal: no product surface reaches it
def settled(entries: Sequence[ContextEntry], as_of: int) -> bool: ...
-def fork_cut(entries: Sequence[ContextEntry], target_row_id: Optional[str], *,
- live_input_seq: Optional[int]) -> int: ... # §2's table
+def latest_cut(entries: Sequence[ContextEntry], *, unended_input_seq: Optional[int]) -> int: ...
+# the largest settled point before unended_input_seq: for a user's fork, the first input of the earliest unfinished
+# Turn (§2); None for a self-fork
+def fork_point(entries: Sequence[ContextEntry], as_of: int) -> ForkPoint: ... # internal; raises ForkPointError
def fork_prefix(entries: Sequence[ContextEntry], point: ForkPoint) -> tuple[Message, ...]: ...
# core/agent_core/agent/fork.py (replaces agent/checkpoint.py)
@@ -567,16 +624,22 @@ class Folded:
row: Optional[ContextEntry] # what the fold committed, if anything
error: Optional[str] = None # a fold that failed fails the turn
+@dataclass(frozen=True)
+class CheckpointDetail: # a checkpoint side turn's purpose fields (C-9 section 6)
+ reason: Literal["threshold", "overflow"]
+ mode: Literal["normal", "rolling"]
+
@dataclass(frozen=True)
class SideTurn:
purpose: Literal["checkpoint"] # grows with its consumers ("memory", ...)
+ detail: CheckpointDetail # required, no default; its type matches purpose, checked
+ # in __post_init__, so every fork_turn audit has it
units: Optional[int] # the caller's current view: all of it, or its first units;
# the request puts the caller's rehydrated messages first
prompt: UserMessage
policy: ForkPolicy
max_tokens: Callable[[ModelCapabilities], int] # per route; C-9: min(16,000, O)
fold: Callable[[SideReply], Awaitable[Folded]]
- detail: Mapping[str, Any] = field(default_factory=dict) # purpose fields for the audit; C-9: reason, mode
@dataclass(frozen=True)
class SideTurnResult:
@@ -591,21 +654,19 @@ class Agent:
# v1: only while a run is active. Reserved: while idle, under the adapter's Session writer lock.
# storage/agent_transcript.py
-def resolve_fork_point(conn: Connection, source_session_id: str, at_message_id: Optional[str]) -> int: ...
+def resolve_fork_point(conn: Connection, source_session_id: str, *, as_of: Optional[int] = None,
+ self_fork: bool = False) -> int: ...
+# Neither: the user's latest point (§2), before the first input of the earliest unfinished Turn (§2's definition).
+# self_fork: the largest settled point. as_of: an internal point, checked by fork_point.
# core/services/session_fork.py
-def reserve_forked_session(*, source_session_id: str, at_message_id: Optional[str] = None,
- ...) -> SessionForkResult: ...
-# SessionForkError codes added: session_fork_point_unsupported, session_fork_point_not_in_context,
-# session_fork_point_inherited (details name the owning Session), session_fork_point_unsettled
-
-# modules/agents/catalog.py
-FORK_AT_MESSAGE_BACKENDS: frozenset[str] # {"vibey"} in Phase 1
-```
-
-```text
-vibe agent run (--fork-session <session-id> | --fork-self) [--at <message-id>] --message ...
-POST /api/sessions/<session-id>/fork {"at_message_id"?: string}
+def reserve_forked_session(*, source_session_id: str, ..., self_fork: bool = False,
+ as_of: Optional[int] = None) -> SessionForkResult: ...
+# vibey: resolve_fork_point(conn, source_session_id, as_of=as_of, self_fork=self_fork). self_fork is passed by
+# --fork-self only; as_of is internal (no CLI, HTTP, or Web path passes it) and refused for other backends.
+# ForkPointError surfaces as SessionForkError. A backend that cannot trim a live Turn (claude) refuses a user's
+# fork while the source has one: SessionForkError(code="session_fork_source_running"), localized en and zh.
+def user_fork_source_is_running(fork: Mapping[str, Any]) -> bool: ... # the native first Turn's re-check
```
The `ForkTurn` audit (`agent_events.event_type = 'fork_turn'`, `visibility = 'audit'`, no `context_seq`) replaces
@@ -617,22 +678,23 @@ The `ForkTurn` audit (`agent_events.event_type = 'fork_turn'`, `visibility = 'au
| `purpose` | `checkpoint` |
| `policy` | `dreaming` |
| `point` | `{as_of, units}` |
+| `detail` | for `checkpoint`: `{reason, mode}` |
| `outcome` | `completed` or `failed` |
| `messages` | as in `CheckpointTurn` |
-Its optional fields are `detail` (for `checkpoint`: `{reason, mode}`), `error`, `folded_event_id`, `rounds`, and
-`usage`.
+Its optional fields are `error`, `folded_event_id`, `rounds`, and `usage`.
## 16. Contract delta at freeze
-Built from a search of `docs/plans` for every fork term and every identifier C-10 renames or replaces (`fork`,
-`anchor_seq`, `snapshot`, `dreaming`, `checkpoint_turn`, `CheckpointTurn`, `append_audit`). Rows not listed keep their
-meaning: their "fork" is the side turn or the fork Session as C-10 defines them.
+Applied in the freeze PR. Built from a search of `docs/plans` for every fork term and every identifier C-10 renames
+or replaces (`fork`, `anchor_seq`, `snapshot`, `dreaming`, `checkpoint_turn`, `CheckpointTurn`, `append_audit`). Rows
+not listed keep their meaning: their "fork" is the side turn or the fork Session as C-10 defines them. Line numbers
+are those before the freeze PR.
| File | Location | Change |
| --- | --- | --- |
| `transcript.md` | §1, lines 30-31 | the audit kind `context_checkpoint_turn` (`CheckpointTurn`) becomes `fork_turn` (`ForkTurn`, C-10 §7) |
-| `transcript.md` | §4, lines 87-90 | `anchor_seq` resolution becomes C-10 §2's fork point: settled, 0 for the empty prefix, the source's own rows, no clock |
+| `transcript.md` | §4, lines 87-90 | `anchor_seq` resolution becomes C-10 §2's fork point: settled, the user's latest point, 0 for the empty prefix, no clock |
| `transcript.md` | §5, lines 101-102 | points to F8 |
| `transcript-rows.schema.json` | `CheckpointTurn`, lines 348-404 | becomes `ForkTurn` (§15); the `append_audit` kind in its description becomes `fork_turn` |
| `context.md` | §6, lines 152-216 | the checkpoint is a side turn (C-10 §7); the dreaming table stays here as the value of `DREAMING`; the budget, room, rounds, and bound bullets point to C-10 §7; the audit becomes `fork_turn` with `purpose: checkpoint` and `detail: {reason, mode}` |
@@ -643,31 +705,32 @@ meaning: their "fork" is the side turn or the fork Session as C-10 defines them.
| `context.md` | §12, lines 494-496 | the reserved memory row points to C-10 §13 |
| `loop-control.md` | §1, lines 8-20 | the `Agent` surface adds `side_turn_fits` and `side_turn` (C-10 §15) |
| `loop-control.md` | §7, lines 111-115 | "Snapshot and fork" points to C-10; `snapshot()` stays the `after_run` outcome's state |
-| `backend-registration.md` | its capability-specific sets | adds `FORK_AT_MESSAGE_BACKENDS` |
| plan `avibe-agent-core.md` | §4, line 79 | `agent/` holds the side turn, not a "fork snapshot" |
| plan | §5 table, lines 104 and 106 | C-3's "snapshot and fork" and C-5's "fork by reference" point to C-10 |
| plan | §5.1, lines 165-167 | the child's context is the source's rows up to the fork point (C-10 §2) |
| plan | §5.2, lines 195-199 | checkpoint delivery is a side turn under the `dreaming` policy |
| plan | §6 A10, lines 330-332 | a checkpoint turn's request is a side turn's (C-10 §7) |
-| `README.md`, plan §5 | the C-10 rows | added by this PR as a draft; marked frozen at freeze |
+| `README.md`, plan §5 | the C-10 rows | added as a draft by #2397; marked frozen |
## 17. Phases
| Phase | Scope | Acceptance (properties) |
| --- | --- | --- |
-| 0 | this contract; owner decisions [O-1]–[O-4]; the §16 delta, then freeze | owner approval; `pr-delivery-loop` gates |
-| 1a | point-in-time fork for Vibey: `settled`, `fork_cut`, `resolve_fork_point` (no clock); trimming the live Turn; `at_message_id` with error codes; `FORK_AT_MESSAGE_BACKENDS`; CLI `--at`; the HTTP body; the fork notice; T2's inherited branch removed; the Web action and banner once the frame is approved | F1, F3, F4, F6 (reservation), F8 pin; an E2E on Workbench: fork from an earlier reply while the source runs, continue in the fork, and the source is unaffected (the E2E wave's S8) |
+| 0 | this contract; owner decisions; the §16 delta; freeze | done 2026-10-10 |
+| 1a | the fork point for Vibey: `harness/fork.py` (`ForkPoint`, `settled`, `latest_cut`, `fork_point`, `fork_prefix`), `resolve_fork_point` (no clock); the existing session fork wired to it for `vibey`, trimming the live Turn, and `self_fork` from `--fork-self`; Codex's `lastTurnId` always resolved at first use; OpenCode's live check at first use; Claude's refusal while live (reservation and first Turn, en and zh copy); the fork notice; T2's inherited branch removed; the internal API for an arbitrary settled point (`resolve_fork_point(..., as_of=)` and `reserve_forked_session(..., as_of=)`) | F1, F3, F4, F6 (reservation), F8 pin; an E2E on a local dev instance with a throwaway home: fork a Vibey Session while it runs a long tool call, check the child's context, and check that the parent continues unaffected |
| 1b | C-9 on the side turn, as a pure refactor: `ForkPolicy` and `DREAMING`, `Agent.side_turn`, the `fork_turn` audit | F2, F5, F6 (policy), F7; the C-9 suite passes with only the audit kind renamed |
-| 2 | teammates and Agents: the descendant lookup and `fork_initiator`; the Harness bound [O-4]; a Session-invariant system prompt for warm fork Sessions; an Agent fork tool; side turns while idle | decided when the teams design is written |
-| 3 | point-in-time for native backends: Codex through `lastTurnId`, after adding a reply-to-Turn association and preceding-Turn resolution, then Claude (store message UUIDs; `resume_session_at`) and OpenCode (store message ids; `messageID`) | F1 per backend, to the extent its native store allows |
+| after 1b | native fork boundaries: OpenCode (revert the private child to the boundary), then Claude (`resume_session_at` from its own transcript, replacing the refusal) (§11) | the user-fork rule by construction for every backend; Claude's parser tested on fixtures of real transcripts |
+| later | teams: the descendant lookup, a Session-invariant system prompt, an Agent fork tool, side turns while idle | a separate design |
+
+Point-in-time fork for native backends (the former Phase 3) and the Harness bound are cancelled by owner decision.
-Files each lane touches, from a search of the code, tests, prompts, and UI for the identifiers it changes
-(`resolve_fork_anchor_seq`, `context_bound`, `fork_source_context_seq`, `--fork-self`, `--fork-session`,
-`sessionFork`, `checkpoint_turn`, `CheckpointTurn`, `CheckpointPolicy`, `CHECKPOINT_TOOL_*`, `_fork_fits`):
+Files each lane touches, from a search of the code, tests, and prompts for the identifiers it changes
+(`resolve_fork_anchor_seq`, `context_bound`, `fork_source_context_seq`, `call_instance_result`, `checkpoint_turn`,
+`CheckpointTurn`, `CheckpointPolicy`, `CHECKPOINT_TOOL_*`, `_fork_fits`):
-| Lane | Code | Tests | Docs, prompts, copy |
+| Lane | Code | Tests | Prompts |
| --- | --- | --- | --- |
-| 1a | `core/agent_core/harness/fork.py` (new); `storage/agent_transcript.py` (fork resolution); `core/services/session_fork.py`; `modules/agents/vibey/agent.py` (T2's inherited branch, the fork notice); `modules/agents/catalog.py`; `vibe/cli.py`; `vibe/ui_server.py`; `ui/src` (`context/ApiContext.tsx`, `components/workbench/ChatPage.tsx`, the new action) | `tests/test_agent_transcript.py`, `tests/test_transcript_store_contract.py`, `tests/test_vibey_agent.py`, `tests/test_vibey_agent_context.py`, `tests/test_session_fork.py`, the CLI parser tests | `vibe/i18n/{en,zh}.json`, `ui/src/i18n/{en,zh}.json`, `core/prompts/harness-agents.md`, `docs/CLI.md`, `docs/CLI_ZH.md`, `skills/use-avibe-harness/SKILL.md`, `skills/use-avibe/references/harness.md` |
+| 1a | `core/agent_core/harness/fork.py` (new); `storage/agent_transcript.py` (fork resolution); `core/services/session_fork.py`; `modules/agents/vibey/{agent,store,prompt}.py` (T2's inherited branch, the fork notice); `vibe/cli.py` (`self_fork` from `--fork-self`; localized fork errors); `vibe/ui_server.py` (localized fork errors); `core/handlers/session_handler.py` (Claude's first-Turn check); `modules/agents/codex/agent.py` (`lastTurnId` at first use); `modules/agents/opencode/session.py` (the live check at first use) | `tests/agent_core/agent/test_fork.py` (the pure rule), `tests/test_agent_transcript.py`, `tests/test_transcript_store_contract.py`, `tests/test_vibey_agent.py`, `tests/test_vibey_agent_context.py`, `tests/test_session_fork.py`, `tests/test_ui_session_stream.py` (the Claude fork), `tests/test_claude_cli_path.py`, `tests/test_cli_agent_run_schema.py`, `tests/test_codex_agent.py`, `tests/test_opencode_session_manager.py` | the fork notice's text; `vibe/i18n/{en,zh}.json` and `ui/src/i18n/{en,zh}.json` (`session_fork_source_running`) |
| 1b | `core/agent_core/agent/loop.py`; `core/agent_core/agent/checkpoint.py` (becomes `fork.py`); `core/agent_core/harness/context.py` (the `CHECKPOINT_TOOL_*` constants); `core/agent_core/harness/store.py` (the audit kind); `storage/agent_transcript.py` (the audit map, lines 94-95); `modules/agents/vibey/store.py` (the audit kind) | `tests/agent_core/fakes.py`, `tests/agent_core/agent/test_compaction.py`, `tests/agent_core/agent/test_context.py`, `tests/test_agent_transcript.py`, `tests/test_transcript_store_contract.py` | none |
1b follows 1a; they are not parallel lanes. Both edit `storage/agent_transcript.py` and its two test suites, and 1b
@@ -676,19 +739,27 @@ records the `ForkPoint` that 1a adds in `harness/fork.py`. 1b reopens review on
## 18. Owner decisions
-| ID | Decision | Recommendation |
-| --- | --- | --- |
-| O-1 | The model: one primitive (the fork point) with two carriers separated by identity. A side turn can do nothing that outlives its turn; a fork Session does everything else. C-9's checkpoint becomes the first side turn. | Yes |
-| O-2 | Phase 1 scope: point-in-time fork for Vibey only, on CLI, HTTP, and Web. Native backends come in Phase 3, Codex first; each needs a new map first (Codex: reply to Turn; Claude and OpenCode: message ids). Until then, those backends keep forking at the latest point. | Yes |
-| O-3 | Web UX: "Fork from here" only on Vibey replies. The fork shows the banner naming that message, not the inherited history. Not in v1: "edit and resend" on a user message (the API supports it as "fork before this input"), and rendering inherited history in the child. The action needs a `design.pen` frame. | Yes, replies only, with the banner |
-| O-4 | Forks requested by Agents. There is no fork tool in v1. Bounding self-replication: an Agent can already recurse with `vibe agent run --fork-self` or `--agent`, bounded only by the 8-run concurrency limit. | A Harness bound on depth and live descendants per root, landing in Phase 2 before the tool. Pull it into Phase 1 only if today's exposure should close now: Phase 1 adds no new exposure, because user forks are not recursive |
+Decided 2026-10-10.
+
+| ID | Decision |
+| --- | --- |
+| O-1 | Yes: one primitive (the fork point) with two carriers separated by identity. A side turn can do nothing that outlives its turn; a fork Session does everything else. C-9's checkpoint becomes the first side turn. "It must be implemented this way." |
+| O-2 | Point-in-time fork is internal only. Forking at an arbitrary settled point is an engine capability for system mechanisms (C-9, later memory and self context management), with no CLI, HTTP, or Web surface. A user's fork always takes the latest point: the end of the previous ended Turn, by construction (§2). |
+| O-3 | No new Web interaction. The existing Fork action stays and follows the cut rule. No banner change, no inherited-history rendering, no edit-and-resend, no `design.pen` frame. |
+| O-4 | No new limits. Agents keep forking themselves through `vibe agent run --fork-self`, with no depth or descendant bound. |
+
+Also decided: point-in-time fork for native backends is cancelled, and teams stay a later design.
-Decided in this lane, all reversible:
+Decided in the design lane, all reversible:
-- A fork Session at the latest point trims a live Turn for Vibey (§2).
+- A user's fork of a Vibey Session trims a live Turn (§2), which O-2's rule confirms.
+- The user-fork rule holds for every backend: trim, or refuse while live (Claude); a self-fork is part of the Turn
+ that requests it and keeps today's behavior (O-4). Vibey and Codex hold by construction in Phase 1; OpenCode and
+ Claude by a check until the native fork boundaries land; no fence on the Turn owner. Confirmed by the
+ orchestrator, 2026-10-10.
- The audit kind is renamed `fork_turn` (§7).
- Scratch is not forked (§4).
-- Making the system prompt Session-invariant waits for Phase 2 (§3).
+- Making the system prompt Session-invariant is left to the teams design (§3).
## 19. Rejected alternatives
@@ -702,3 +773,5 @@ Decided in this lane, all reversible:
| Merge a child's turns back into the source | two writers of one context and a second copy of rows (§9) |
| Store the parent-to-children relation in a new column | duplicates the metadata keys; an expression index serves the lookup (§5) |
| Let a side turn run `bash` with a synthetic call instance | a job needs a committed response to be recovered and settled; work that acts belongs in a fork Session (§1) |
+| A user-facing point-in-time fork (CLI `--at`, HTTP `at_message_id`, Web "fork from here") | owner decision O-2: the arbitrary point is an internal capability |
+| A depth or descendant bound on Agent self-forks | owner decision O-4 |
diff --git a/docs/plans/agent-core-contracts/loop-control.md b/docs/plans/agent-core-contracts/loop-control.md
index 3c80c7285..f3e4a1953 100644
--- a/docs/plans/agent-core-contracts/loop-control.md
+++ b/docs/plans/agent-core-contracts/loop-control.md
@@ -17,6 +17,8 @@ class Agent:
def abort(self, reason: str) -> None: ...
def set_tools(self, tools: Sequence[Tool]) -> None: ...
def snapshot(self) -> Snapshot: ...
+ def side_turn_fits(self, turn: SideTurn, route: ModelSelection) -> bool: ... # C-10 fork.md §7, §15
+ async def side_turn(self, turn: SideTurn, route: ModelSelection) -> SideTurnResult: ...
```
`Input` pairs a `UserMessage` with its `messages.id` row. `ModelRouter` returns the `ModelEndpoint` and
@@ -110,6 +112,7 @@ sent with that request gets the error result `Tool <name> is not available.`
## 7. Snapshot and fork
-`snapshot()` returns `(session_id, context_seq, state)`, where `state` is the JSON object hooks keep. A hook that sets
-state causes an `agent_state` row at the next commit point (C-5), so a fork starting at a later `context_seq` restores
-it. Forking is Avibe's existing Session fork; the child's context resolves through C-5.
+`snapshot()` returns `(session_id, context_seq, state)`, where `state` is the JSON object hooks keep; it is the state
+of the `after_run` outcome, not a fork API. A hook that sets state causes an `agent_state` row at the next commit
+point (C-5), so a fork whose point is at or after that row restores it. Fork is C-10 (`fork.md`): the fork point, the
+side turn (`side_turn`, above), and the fork Session, whose context resolves through C-5.
diff --git a/docs/plans/agent-core-contracts/transcript-rows.schema.json b/docs/plans/agent-core-contracts/transcript-rows.schema.json
index 43926c21b..55672e6e2 100644
--- a/docs/plans/agent-core-contracts/transcript-rows.schema.json
+++ b/docs/plans/agent-core-contracts/transcript-rows.schema.json
@@ -345,13 +345,15 @@
}
}
},
- "CheckpointTurn": {
- "description": "`agent_events.content_json` of a `context_checkpoint_turn` audit row (`TranscriptStore.append_audit(kind='checkpoint_turn')`, `visibility = 'audit'`, no `context_seq`): one checkpoint turn and the messages it produced, from the attempt ledger (context.md section 6). Never context.",
+ "ForkTurn": {
+ "description": "`agent_events.content_json` of a `fork_turn` audit row (`TranscriptStore.append_audit(kind='fork_turn')`, `visibility = 'audit'`, no `context_seq`): one side turn (C-10 fork.md section 7), such as a C-9 checkpoint turn, and the messages it produced, from the attempt ledger. Written once on every exit but an abort (C-10 F7). Never context.",
"type": "object",
"required": [
"version",
- "reason",
- "mode",
+ "purpose",
+ "policy",
+ "point",
+ "detail",
"outcome",
"messages"
],
@@ -360,17 +362,62 @@
"version": {
"const": 1
},
- "reason": {
+ "purpose": {
"enum": [
- "threshold",
- "overflow"
- ]
+ "checkpoint"
+ ],
+ "description": "What the side turn is for; grows with its consumers (C-10 section 13)."
},
- "mode": {
+ "policy": {
"enum": [
- "normal",
- "rolling"
- ]
+ "dreaming"
+ ],
+ "description": "The side-turn policy its calls ran under (C-10 section 6)."
+ },
+ "point": {
+ "type": "object",
+ "description": "The fork point (C-10 section 2): the caller's latest committed context_seq, and the number of units of that view the prefix kept (null: all of them).",
+ "required": [
+ "as_of",
+ "units"
+ ],
+ "additionalProperties": false,
+ "properties": {
+ "as_of": {
+ "type": "integer",
+ "minimum": 0
+ },
+ "units": {
+ "type": [
+ "integer",
+ "null"
+ ],
+ "minimum": 0
+ }
+ }
+ },
+ "detail": {
+ "type": "object",
+ "description": "Purpose fields, required. For `checkpoint`, the only purpose in v1: the C-9 reason and mode (context.md section 6). A later purpose adds its own shape with a conditional schema.",
+ "required": [
+ "reason",
+ "mode"
+ ],
+ "additionalProperties": false,
+ "properties": {
+ "reason": {
+ "enum": [
+ "threshold",
+ "overflow"
+ ]
+ },
+ "mode": {
+ "enum": [
+ "normal",
+ "rolling"
+ ]
+ }
+ }
},
"outcome": {
"enum": [
@@ -384,11 +431,16 @@
"null"
]
},
- "compaction_event_id": {
+ "folded_event_id": {
"type": [
"string",
"null"
- ]
+ ],
+ "description": "The row the caller's fold committed (for a checkpoint, its `context_compaction` row), or null."
+ },
+ "rounds": {
+ "type": "integer",
+ "minimum": 0
},
"messages": {
"type": "array",
diff --git a/docs/plans/agent-core-contracts/transcript.md b/docs/plans/agent-core-contracts/transcript.md
index e876d37ce..0b005a90b 100644
--- a/docs/plans/agent-core-contracts/transcript.md
+++ b/docs/plans/agent-core-contracts/transcript.md
@@ -28,7 +28,8 @@ Display-only rows keep `context_seq` null: `interim`, `notify`, an `error` that
`output`, queued or removed inputs, and the `tool_call` trace row written at tool start (its `metadata_json` carries
`tool_call_id` and `job_id` so the activity panel can pair it with the result). Audit rows are never context
either: `agent_events` with `visibility = 'audit'` and no `context_seq`, written by `append_audit`, as
-`context_checkpoint_turn` (`CheckpointTurn`, C-9 `context.md` §6, with its own attempts' partials and usage) or
+`fork_turn` (`ForkTurn`, C-10 `fork.md` §7: one side turn, such as a C-9 checkpoint, with its own attempts' partials
+and usage) or
`model_attempt` (`ModelAttempt`: the usage of a conversation attempt that did not become a response row, C-9
`context.md` §10, invariant 4). The activity panel does not read them.
@@ -84,10 +85,13 @@ The child Session's metadata already records its parent as top-level keys `fork_
`fork_source_message_id` (written by `reserve_forked_session`, read by `fork_metadata_from_session_metadata` in
`core/services/session_fork.py`); C-5 reads those keys and adds no new fork shape.
-- `anchor_seq` is resolved once, when the fork is reserved, as the largest `context_seq` in the source Session among
- rows at or before the anchor message, and persisted as the top-level metadata key `fork_source_context_seq`. Rows
- that receive a `context_seq` later can never move into or out of the prefix. A released fork without that key
- (forked from a non-`vibey` Session) has no Vibey context to inherit and starts empty.
+- `anchor_seq` is the fork point's `as_of` (C-10 `fork.md` §2): resolved once, in the reservation's transaction, from
+ `context_seq`, row shape, and the source's Turn rows, never from a clock, and persisted as the top-level metadata
+ key `fork_source_context_seq`. A user's fork cuts before the first input of the earliest unfinished Turn, as C-10
+ §2 defines it (live, holding a call awaiting T2, or with an accepted input awaiting T3); a self-fork takes the
+ largest settled point; a system mechanism may name any settled point. 0 is the empty prefix. Rows that receive a
+ `context_seq` later can never move into or out of the prefix. A released fork without that key (forked from a
+ non-`vibey` Session) has no Vibey context to inherit and starts empty.
- The child's context = the source's context rows with `context_seq <= anchor_seq` (recursively through the source's
own fork), then the child's rows.
- The child's `context_seq` continues from `anchor_seq + 1`, so the combined order stays total.
@@ -99,4 +103,4 @@ The child Session's metadata already records its parent as top-level keys `fork_
- The context content of a row never changes after commit: `context_seq` and `content_json.model` are written once
(on an input row, when it is consumed). A response row's display columns (§2) may be written again when it is
delivered; they are never context. Context rows are never deleted while a Session or a fork descendant references
- them.
+ them (C-10 F8).
diff --git a/docs/plans/avibe-agent-core.md b/docs/plans/avibe-agent-core.md
index 0ed828119..2510653a2 100644
--- a/docs/plans/avibe-agent-core.md
+++ b/docs/plans/avibe-agent-core.md
@@ -76,7 +76,7 @@ modules/agents/vibey/ backend adapter: BaseAgent implementation, eve
question/permission bridge, Model Hub hop resolution
core/agent_core/
ai/ canonical message model, provider adapters (4 protocols), stream parsing, retry
- agent/ loop, hooks, steer/follow-up queues, dynamic tools, fork snapshot, typed events
+ agent/ loop, hooks, steer/follow-up queues, dynamic tools, side turn (C-10), typed events
harness/ transcript store interface, projection, context management, skills, MCP client
tools/ read / write / edit / bash with output governance; JobHost interface
tests/agent_core/ control-point matrix (acceptance harness), conformance fixtures, stub server
@@ -101,14 +101,14 @@ payload.
| --- | --- | --- | --- |
| C-1 | Canonical message model: user, assistant, and tool-result messages; text, image, thinking, and tool-call blocks; `origin`, `usage`, normalized `stop_reason`; cross-provider transform rules | `ai` → `agent`, `harness`, adapter | `message.schema.json`, `cross-provider.md` |
| C-2 | Provider adapter interface: `stream(ModelRequest) → ProviderEvent*`, error classification | `ai` → `agent` | `provider.md`, `provider-event.schema.json` |
-| C-3 | Loop control: hook points, directives, steer and follow-up semantics, per-call tool set, snapshot and fork | `agent` → adapter, `harness`, tests | `loop-control.md` |
+| C-3 | Loop control: hook points, directives, steer and follow-up semantics, per-call tool set, snapshot; fork is C-10 | `agent` → adapter, `harness`, tests | `loop-control.md` |
| C-4 | Typed agent event stream and its mapping to existing Avibe outputs | `agent` → adapter → Workbench and IM progress | `agent-event.schema.json` |
-| C-5 | Transcript rows: what each context entry stores, `context_seq`, projection, fork by reference | adapter ↔ `harness` | `transcript.md`, `transcript-rows.schema.json` |
+| C-5 | Transcript rows: what each context entry stores, `context_seq`, projection, fork by reference (the fork point is C-10) | adapter ↔ `harness` | `transcript.md`, `transcript-rows.schema.json` |
| C-6 | Model Hub consumer extension: `google` protocol, hop resolution, served-hop report | Model Hub → adapter | `model-hub-consumer.md`, `hop-resolution.schema.json` |
| C-7 | Tools: Pi's surface plus the owner's additions; output governance; job handle | `tools` → `agent`, adapter | `tools.md`, `job.schema.json` |
| C-8 | Backend registration: the catalog as the one declaration, and which sets must include `vibey` | catalog → every backend list | `backend-registration.md` |
| C-9 | Context management: projection tiers, trigger, cut point, checkpoint, overflow ladder, guards | `harness` → `agent`, adapter | `context.md`; row shapes in `transcript-rows.schema.json` |
-| C-10 | Fork: the fork point (a settled cut and its prefix), the side turn, the fork Session, lineage, capability, merge-back (draft) | `harness`, `agent`, storage, service → C-9, adapter, surfaces | `fork.md` |
+| C-10 | Fork: the fork point (a settled cut and its prefix), the side turn, the fork Session, lineage, capability, merge-back (frozen 2026-10-10) | `harness`, `agent`, storage, service → C-9, adapter | `fork.md` |
### 5.1 Transcript storage
@@ -163,8 +163,9 @@ Rules:
crash between commit and delivery re-delivers instead of losing or regenerating the reply: exactly once on
Workbench, at least once on IM (C-5).
- Fork reuses the existing fork metadata (`fork_source_session_id`, `fork_source_message_id`). The child's context is the parent
- chain's rows with `context_seq` up to the anchor's, then the child's own rows. Nothing is copied. Scopes with
- history are dismissed, never deleted, so a parent's prefix cannot disappear from under a child.
+ chain's rows with `context_seq` up to the fork point (C-10 `fork.md` §2: for a user's fork, before the earliest
+ unfinished Turn), then the child's own rows. Nothing is copied. Scopes with history are dismissed, never deleted, so a
+ parent's prefix cannot disappear from under a child.
- Compaction and clearing append rows; they never rewrite or delete. A fork anchored before a checkpoint sees the
full original context.
- Every block that may be large has an inline form and a reserved reference form
@@ -192,11 +193,11 @@ and `bash` results with `context_edit` rows, on by default; and a checkpoint wri
`min(20K, 0.25 T)` verbatim; a cut inside the in-flight Turn keeps its inputs (the first and each steer) as they
were, images included. A tool batch that cannot fit even with the conversation moved out is cut to fit, each
result saying so.
-- **Checkpoint delivery is a fork**: the same model, system prompt, tools, tool choice, and reasoning settings, the
- conversation prefix byte-identical, and the owner-approved three-layer prompt appended (`checkpoint-v2`). The
- checkpoint turn runs through the same loop under a "dreaming" tool policy: `read` allowed, writes only inside the
- Session's scratch directory, everything else denied; at most 5 tool rounds, each tool bounded by the room left in
- the window. Its messages are audit rows, never context.
+- **Checkpoint delivery is a fork**, a side turn (C-10 `fork.md` §7): the same model, system prompt, tools, tool
+ choice, and reasoning settings, the conversation prefix byte-identical, and the owner-approved three-layer prompt
+ appended (`checkpoint-v2`). The checkpoint turn runs through the same loop under the "dreaming" policy: `read`
+ allowed, writes only inside the Session's scratch directory, everything else denied; at most 5 tool rounds, each
+ tool bounded by the room left in the window. Its messages are audit rows, never context.
- **After a checkpoint** the request is the rebuilt system prompt, the in-flight Turn's kept inputs as they were, the
`<context-checkpoint>` message (framing, checkpoint, cumulative `<artifacts>`, an `<earlier-record>` hint), state
rendered from its own stores when the checkpoint was written (the environment's core fields; the skills it loaded
@@ -328,9 +329,9 @@ Properties; the test suites enumerate cases.
origin is sent, and the run completes.
- **A10 One copy.** For every request without a transient `before_model` rewrite (C-3 §3), the context rebuilt from
`messages` and `agent_events` equals what the stub received; no other file or table holds a copy of it. A
- checkpoint turn's request is that context (for a rolling fork, its prefix up to the cut) plus the checkpoint
- request and the turn's admitted responses and tool results (C-9 §6); its audit row also keeps the attempts that
- were retried or failed.
+ checkpoint turn's request, a side turn's (C-10 §7), is that context (for a rolling fork, its prefix up to the cut)
+ plus the checkpoint request and the turn's admitted responses and tool results (C-9 §6); its audit row also keeps
+ the attempts that were retried or failed.
- **A11 Exactly-once commands.** A command started by `bash` runs once across foreground completion, `watch: true`,
foreground-to-Watch handover, and a vibe restart in any of those states; Watch removal ends its process tree.
- **A12 Compaction quality.** On a scripted long-session fixture compacted twice, the agent still states the user's
@@ -387,7 +388,7 @@ contracts and checked against the implementing lane's code before they are close
| --- | --- | --- |
| Product-wide media retention | `storage/media_service.py` | No media file is removed from disk today, whether Workbench upload, IM attachment, or Avibe Agent context snapshot (`<state>/agent_core/media`); session deletion only clears or cascades `media_objects` references. Retention needs one owner for every source. It must be fork-aware: a fork descendant keeps replaying the image tokens of a source Session that was deleted. Recorded as a v1 known limit in PR #2345. |
| Steer receipt fencing in the shared Turn owner | `core/session_turns.py` (`_finish_steer`) | **Done in PR #2345** (orchestrator-authorized cross-lane fix): a negative receipt settles only a current attempt whose Deliveries are still steering or reconciling, and a caller that knows the attempt passes `expected_attempt_id`, so a late or duplicate receipt can no longer pull a Delivery out of a Turn that claimed it. Regression: `test_a_late_negative_steer_receipt_never_moves_a_delivery_its_attempt_no_longer_owns`. |
-| Fork as the runtime's base primitive | `core/agent_core/harness`, `core/agent_core/agent`, `storage/agent_transcript.py`, `core/services/session_fork.py` | Contract [`agent-core-contracts/fork.md`](agent-core-contracts/fork.md) (C-10, draft, owner decisions pending): one fork point with two carriers, the side turn and the fork Session. Phase 1 delivers point-in-time fork for Vibey (CLI, HTTP, Web) and rebuilds C-9's checkpoint turn on the side turn; teammates, an Agent fork tool, and native point-in-time fork follow. |
+| Fork as the runtime's base primitive | `core/agent_core/harness`, `core/agent_core/agent`, `storage/agent_transcript.py`, `core/services/session_fork.py` | Contract [`agent-core-contracts/fork.md`](agent-core-contracts/fork.md) (C-10, frozen 2026-10-10 by owner decision): one fork point with two carriers, the side turn and the fork Session. Phase 1a wires Vibey's existing session fork to the fork point (a user's fork cuts at the end of the previous ended Turn; arbitrary settled points are internal only, with no product surface); Phase 1b rebuilds C-9's checkpoint turn on the side turn. Teams are a later design; native point-in-time fork and a self-fork bound are not planned. |
| Hooks with context management | `core/agent_core/agent/` (C-3, C-9) | In v1, an Agent with a `ContextConfig` takes no user hooks: `before_model` rewrites and `before_tool`/`after_tool` decisions each changed what C-9 owns (the route, the projected prefix, artifacts, the checkpoint budget). A post-v1 design defines which hook outputs C-9 accepts and how it accounts for them before the two are combined (owner decision, PR #2360 round 5). |
| Call-instance identity for job files | `core/agent_core/tools/` (`ToolContext`, job `meta.json`), the adapter | **Done.** A tool call's identity is its instance: the owning response plus the call id, because providers reuse ids. The loop gives every executed call its instance (`ToolContext.call`: the response's row id and `context_seq`), and the job's `meta.json` records it. T2's job lookup (`find_job`), J5's settled check, and the hand-over's owning Turn match on the whole instance in context order; the clock fallback, which assumed a non-decreasing wall clock between a response's commit and its job's start, is gone. |