Skip to content

Latest commit

 

History

History
4425 lines (3823 loc) · 268 KB

repl-spec.md

File metadata and controls

4425 lines (3823 loc) · 268 KB

The XMD REPL

xmd repl is a full-screen terminal you keep working in. Submit an XMD entry, watch it run for real, submit the next one when it settles, and look at what any of them did — while they are running and afterwards, in this process or in another one.

xmd repl                                  # a fresh execution with an empty draft
xmd repl 'xmd://repl/<execution>/entries' # reopen exactly that retained history
xmd repl --deny-all                       # the same, answering every agent request with no
xmd repl --sidekick-agent claude           # the same, with a Sidekick that talks to claude
xmd repl --include ../shared --include=/absolute/other
xmd repl 'xmd://repl/<execution>/entries' --include ../shared

The command line, and the order it is read in

xmd repl --attach <sessionId> connects one interactive UI to an exact live parent-owned XMD child. It accepts one returned ID, with no cold location or --sidekick-acp. Grammar is checked before connection or terminal acquisition. An unknown/ended reference and a second UI refuse without replacement or takeover. The normal interactive command retains terminal-before-history preflight; child hosting is a separate terminal-free path.

xmd repl takes one optional location and the five Agent options xmd run takes, with the same spellings, the same descriptions and the same defaults: --agent-provider (default acpx), --default-agent (falling back to DEFAULT_AGENT_NAME), and the mutually exclusive --approve-all, --approve-reads and --deny-all. An unstated permission line means --approve-reads.

Its Sidekick selection has a separate option: --sidekick-agent names the agent a fresh Sidekick conversation is opened under. It is a separate selection rather than a second spelling of --default-agent — that one is the agent a <Session> an entry writes means by default, and who a person talks to about their entries is not the same choice as who their entries talk to. Unstated, it falls back to DEFAULT_AGENT_NAME and then to this build's own default; --default-agent is never its fallback, and either one may be written without the other. Both reach the one selected --agent-provider, and no permission option an entry runs under grants the Sidekick a tool of its own — its conversations install that same selected provider with constraints of their own rather than inheriting what an entry runs under: no tools, no MCP servers, every native request denied without asking, and no customization of the agent's own system prompt.

An explicit Markdown file path such as --sidekick-agent ./fixture.md selects a scripted Sidekick. Resolve it in the contextual launch directory and snapshot its source before entering the terminal UI. A missing or unreadable file refuses startup. Behavior errors surface through the Markdown TestAgent worker when it opens or serves the conversation. Each scripted conversation gets its own scenario and retains the selected fixture's identity. A saved conversation under a named agent keeps that name when the startup selection changes. Scripted scenarios live for the invoking process, which joins their workers on teardown.

Cold startup settles an unfinished entry's recorded project before loading any plugin or finalizing the profile. An available original directory with a different canonical root is offered explicitly without a default answer. Acceptance binds its retained spelling for relative plugins, includes and mount sources; decline, cancellation, EOF or a failed presentation starts no live session and appends nothing. Unavailable, inaccessible, non-directory or canonically changed originals refuse without a replacement-path prompt. Matching roots require no question. A host unable to answer refuses a required switch. A finalized profile with incompatible roots refuses rather than being reinstalled.

Use --include to select existing component directories, as with xmd run and xmd test. Both --include <directory> and --include=<directory> accept a value. Repetition preserves occurrence order, and the first directory defining an ordinary component wins. Explicit values replace the default search list ["components", "."]; omitting the option keeps both defaults. Relative paths resolve from the invocation's contextual working directory, and absolute paths stay absolute. The command captures them after startup selects the project. After the execution id is known, its session/components directory is appended once. This effective list serves execution, validation, entry Syntax and the packaged Plan's draft check. Configured definitions win over session definitions; only genuine absence falls through, and a selected malformed or unreadable component fails. These directories select ordinary components and grant no permission; canonical protected components keep their implementations.

--allow-absolute is the shared run/REPL boolean switch, default off. It enables absolute host Dir selection within effective write and enclosing restrictions. A nested opt-in cannot widen an enclosing denial. File, File.Delete and Glob operands remain relative. Agent permission switches grant none of this permission.

Add an external host directory with a required document destination:

xmd repl --allow-absolute --mount /work/manuals:/reference --mount /work/fixtures:/fixtures

Both --mount SOURCE:TARGET and --mount=SOURCE:TARGET repeat. Split at the last colon: drive-qualified SOURCE paths retain their drive colon. SOURCE resolves lexically against the captured invocation cwd, without stat, creation, realpath or permission. No tilde, environment, URI or escape expansion is performed. TARGET is absolute POSIX document spelling: reject NUL, backslash, colon, //, .. segments, normalized /, duplicates and overlapping destinations. Normalize repeated separators, dot segments and trailing separators. Disjoint pairs are sorted; equality is exact normalized spelling, without filesystem identity, symlink or case-fold equivalence. Sources may coincide.

<Dir path="/reference"> ensures the selected SOURCE before children use it as actual cwd. File reads/writes/deletions retain their relative operands; Glob retains its patterns and a foreground process its argv. The mapping grants no permission, Git operation or native Agent tooling. New mapped absolute ensures, including converted relative operands, require the explicit absolute opt-in and effective write permission. The command's own cwd and a held conversation's cwd never move. Under the unchanged /work/manuals/docs:/reference pair, a new nested .. follows authored /, ensures ordinary host /, and only its own Unit allows children there. Scope exit restores /reference and its source. On Windows, component-changing document spellings refuse before provider work; native SOURCE paths keep native spelling.

The execution carries an immutable private authored/actual directory frame beside its expansion environment through ordinary bodies, projections and admitted generated work. No Context publishes that frame. Canonical Dir prepares its effective request and candidate frame together; only its own validated ensure Unit, after applicable acknowledgement, admits the candidate's children.

Conversion of interpreted document paths preserves their components. On Windows, document backslashes, colons and components ending in a dot or space refuse before an effective request or child frame exists. Plain . and .. remain document navigation, and the captured host drive root supplies an unmapped document root. Native SOURCE spelling remains native.

Everything that can be refused is refused in this order, and each step happens before anything the next one would touch:

  1. The line. A token that is not the location or one of its declared options, a switch given a value, a value option given none or an empty one, and a second location are each refused here — before a per-user directory is formed, a history file is created or the terminal's modes are touched.
  2. The Agent configuration. Two permission switches together and an unknown --agent-provider are refused next, before any adapter exists.
  3. The command assembly. Invocation cwd, configured absolute directories, selected Plugins, Agent stack, provider dependencies and permission mode are captured once in the command scope. The mount table is admitted at this boundary before any terminal, history or provider adapter exists. After storage supplies the execution id, one immutable execution profile adds session/components and constructs the includes-dependent Plan declaration and vocabulary. No Plugin or Agent stack is installed again, and every entry uses the same finalized search list.
  4. The terminal. Only then is a terminal asked for. Over a pipe the command refuses, having left nothing behind.

Nothing here starts an agent. An entry that asks for none materializes no adapter at all; the provider validates availability the first time a turn wants one.

The session workspace

Responses, manual entries and Sidekick submissions start in the selected launch project. Ordinary File path="notes.md" writes there. Session storage remains separate: <REPL.ComponentDir><File path="Greeting.md">Hello</File></REPL.ComponentDir> writes session/components/Greeting.md without invoking it, and later invocation uses the caller's cwd. AssetDir selects read-only session/assets. Other private session storage grants no document file access even when stored beneath the project.

Fresh publication and legacy first-message publication ensure components before the pair is ready. An existing directory and its files survive; a non-directory refuses without replacement. Cold reading ensures nothing: an older pair missing components remains unchanged, and a later authorized File write creates its parents. Exit preserves storage; a second session has its own components and assets. Journal layout and legacy publication remain unchanged.

New Repository selections use the configured host managed root. Existing workspace: true entries retain their session-relative placement and managed root; acknowledged paths and results remain unchanged. Current permissions and fixed file limits still govern new operations in those continuations.

The host binds cwd on the actual response, validation and entry owners through ordinary Env middleware at min. Nested contexts restore the enclosing directory on every exit. This grants no permission or native tool, changes no source bytes and selects no Repository. The selected project remains the basis for ambient Git discovery and invocation-relative options. Authenticated Git reads retain their owner; a Repository value grants no File access outside the fixed roots. The Sidekick's native conversation keeps its recorded identity and configuration.

Read <Guide.Environment /> and <Guide.Entries /> for the component-writing, discovery, later submission and output-reading journey. Current <REPL.Environment /> reports the response's actual cwd and fresh effective file read/write/absolute policy. current response policy describes the invoking scope. submitted-entry start policy (session scope; entry content may narrow it) is observed afresh through a joined read in the actual session entry-task owner, not copied from CLI flags or response policy. approved import separately states eligibility under current response read/write plus required individual approval, independent of absolute; it establishes neither validation nor approval. These XMD-operation observations grant nothing and describe neither native tools, component admission nor nested scopes of a running entry. Reading them starts no entry, target filesystem work, import prompt or provider/model call; a failed read presents no partial policy. The callback ends with its owner.

The guides teach relative paths resolved from the current working directory, including inside a scoped Dir. A leading slash does not mean the workspace root. Sidekick uses the approved import control for intentional external host file inputs instead of reaching them through absolute File, command or Dir paths. Absolute host Dir selection requires the invocation's explicit opt-in. A leading slash retains its host meaning. Repository/Worktree paired placement stays with its provider and grants no absolute permission.

Importing a host asset

Import a non-repository file directly in a Sidekick response:

<REPL.ImportAsset source="/known/external/mock ü.html" destination="assets/mock ü.html" />

Both nonempty string props are required. The control accepts only this self-closing form and these two props. Propose assets/<original filename>, preserving its spelling. Repository inputs follow repository acquisition. The root supplies the existing session workspace; response cwd cannot select another destination root. New destinations must name a file beneath this session's assets/ subtree. Other session paths refuse before approval or destination work. Missing workspace or host importer refuses.

The question shows the exact resolved source, absolute destination and returned workspace-relative path, then states: Import copies this file into your session assets folder. It offers Import and Decline, with neither selected. An untouched or invalid answer leaves the same question pending. Closing hides the form and leaves it unanswered. Stop withdraws this question and joins its response while an entry's independent question stays waiting.

Before Import, only permitted metadata resolution occurs: no source-content read, parent creation, staging allocation or destination-data write. Decline and cancellation during approval produce none of those effects. Effective read and write restrictions apply before metadata and again after approval; publication rechecks write permission. Approval grants no native Agent tool or ordinary Files permission. Absolute denial does not prevent this separately approved import, and approval never installs an absolute allowance. Canonical destination checks before approval, after approval and immediately before publication keep assets-root and parent links inside that subtree. Existing copies and acknowledged outcomes at older paths remain unchanged.

Import preserves exact source bytes, including binary data, and leaves the source unchanged. Absolute or escaping destinations and observed outward parent links refuse. A file, directory or symlink occupying the destination, including a dangling link or a late collision, survives. Choose a new explicit destination and obtain fresh approval; import neither replaces nor chooses an alternate name.

The final file appears only after a complete private byte copy. Successful feedback is exactly its relative path, after native completion, cleanup and outcome acknowledgement. Temporary work belongs to the response; Stop and Exit join native requests before removing incomplete staging. If an issued publication completes during cancellation or feedback fails after publication, complete bytes may remain. Cleanup preserves them. An uncertain publication, cleanup failure or failed outcome append stops the exchange without successful feedback or automatic retry. The retained intent stays unfinished.

Later ordinary entries read the session copy through AssetDir, including after the external source changes or disappears and after cold reopen. The project's assets path is an independent ordinary path. Passive inspection imports nothing and asks nothing. History retains operands and outcomes, never asset bytes, and supplies no crash recovery or destination adoption.

Project and session file contexts

New responses and all ordinary entries start in the launch project. Sidekick XMD Files access reaches that fixed project, read-only session/assets and this session's components, excluding other private session storage even beneath the project. A cwd, mount, absolute opt-in or Repository value grants no additional file authority. Terminal host operations enforce canonical effective destinations after transformations and effective permissions before target I/O. Acknowledged composed answers restore before current live checks. This is an XMD boundary, not an operating-system sandbox for shell or trusted native code.

<REPL.AssetDir><File path="mock.html" /></REPL.AssetDir> reads the session copy of assets/mock.html. It also supports ordinary Glob capture with relative patterns. Entering it creates nothing; writes, delete, ensures and temporary allocation remain denied even through nested projected scopes.

<REPL.ComponentDir><File path="Greeting.md">Hello</File></REPL.ComponentDir> publishes session source without invoking it. Both paired components take no root/session prop, project once, return ordinary rendered text with optional as, and restore enclosing cwd and permissions. Configured components still win; invoking a definition needs no preliminary source read. Outside these scopes, File operands are ordinary project paths. Testing remains session-owned.

The shared checklist

Edit the TODO checklist above Message, or read it from an entry or response:

<Sidekick.Todo as="items" />

Each item has text and completed. One todo.md in the session workspace owns this list across entries, directories and chat selections. Missing means empty and creates nothing. Reopening restores this file, with no pending changes, recovery marker or automatic prompt.

The paired form takes exactly one fenced unified diff and returns its own committed items. Both forms require as before body effects and render nothing. A completed retained result restores its historical value without rereading or rewriting the file. Both response forms receive ordinary designated result feedback; an entry capture starts no feedback exchange.

<Sidekick.Todo as="items">
```diff
@@ -1 +1 @@
-- [ ] Review the proposal
+- [x] Review the proposal
```
</Sidekick.Todo>

Source contains blank lines and flat, unindented - [ ] text, - [x] text or - [X] text tasks. Inline Markdown source, untouched lines, trailing spaces, LF/CRLF and final-newline disposition survive edits. Unsupported lines and images refuse with their line location. Malformed UTF-8 refuses without a fabricated line number or byte replacement. Literal U+FFFD remains valid; an initial BOM remains part of the source and the flat grammar refuses it.

All hunks match their declared old positions exactly. Bare hunks or optional todo.md, a/todo.md and b/todo.md headers are accepted, including valid no-final-newline markers. Fuzzy, malformed, multi-file, rename and binary patches refuse. A stale editor compares its complete opening source. Validation precedes one existing Files replacement; a refusal or no-op changes nothing and creates no change observation. Issued native work joins before mutation ordering or session shutdown releases it. Unknown replacement acknowledgement stays unknown; a later read establishes current contents only.

Selecting TODO shows the retained checklist in the Sidekick reading area. Background task or message activity preserves the selected tab. + creates a task. Task Space checks or reopens and Enter edits. Down from the last task creates another. Enter saves the editor, Escape cancels, arrows edit its caret and Tab leaves the region. Tasks show ☐ when incomplete and ☑ when complete. Only the task with keyboard focus on its label or an action shows ↑, ↓ and x beside its first displayed row for move up, move down and remove. These controls share the list background. Left/Right reaches them within the focused task row. Alt+Up/Down navigates locally without reordering. The TODO tab is its fixed entry between the conversation and Message. Background changes preserve focus, composer text and reading positions.

The list uses its natural displayed height up to eight, six and three task rows at 160x36, 120x30 and 72x20. Wrapped labels consume rows. Empty and short lists reserve no unused task rows. The header and + stay fixed, and Message normally shows three value rows. Completed rows retain position and use subdued strikethrough with readable focus. Markdown labels are inert terminal text; links display labels, braces and component-like text execute nothing, and source terminal escapes never reach the terminal.

The live TODO service owns external refresh independently of frame demand. Explicit reads reread current source. Outside edits refresh views without creating pending observations or wakes; invalid or unreadable source remains a visible failure rather than stale items or empty success.

Committed human and component changes produce ordered, detached origin/diff/items observations in the live TODO plugin. Prompt middleware selects one finite batch at activation. Successful canonical completion retires only that batch; later edits stay pending. Normal requests carry deltas. A failed or stopped request marks recovery, so the next independently allowed prompt rereads and explicitly supplies the fresh full checklist. Success returns later prompts to deltas. Recovery starts no work and bypasses no hold or unknown-feedback refusal.

An idle eligible human commit can send one message through the existing dispatch, with origin todo, label TODO change and a fresh ordinary message ID. Busy or held edits consume no FIFO slot, and becoming idle starts nothing. Eligibility includes joined entry readiness, storage/reopen state, admission and test reservations, dispatch state, configuration, questions, permissions and readable conversation state. The root rechecks after suspension. Refusal leaves no deferred wake. Component changes use normal result feedback; external changes do neither. The wake preserves Message and Draft takeover. Its text is:

Review the committed TODO changes supplied with this request and continue
appropriately. Read Sidekick.Todo if you need the current checklist.

The checklist is one selected Plugin's repl contribution: the service one live logical session owns, the single Sidekick.Todo declaration both surfaces read it through, and the default-max Agent.prompt content and resource middleware that carries committed changes into a held turn's content. That middleware is not a feature-owned provider rewrite: a held turn's own terminal keeps the captured provider, the selected agent and the exact checked Session, and the composed text it delegates is the text canonical publication and the matching feedback acknowledgement retain. A profile without that value has no checklist service, declaration or documentation, and leaves other contributions untouched. Selected Plugin session services owns when each part runs.

The held turn's private turn-local terminal validates the unchanged selected agent, exact checked Session and timeout, bypasses ancestor minimum-priority routing/default handlers, and calls the captured provider with its retained receiver. Before native prompt subscription, core fixes the final XMD-composed input in the pending canonical description and acknowledges matching feedback intent. Canonical publication follows joined owning cleanup; middleware return and stream.done establish no canonical outcome.

Testing session components

After ordinary File entries create a component and its companion test, a Sidekick response requests real tests explicitly:

<REPL.Test path="components/Greeting.test.md" as="tests" />
<Output><Json value={tests} /></Output>

REPL.Test is a self-closing write control. Its only required prop is path; ordinary as capture is optional. A directory target such as components discovers **/*.test.md recursively, deduplicates documents and executes them in normalized relative-path code-point order. Both target forms preserve the finalized REPL component selection: configured directories, session components, then registered defaults. They do not promote the document or target directory as the CLI directory test command does.

Targets resolve against the paired session workspace, including inside a response Dir. Empty, absolute and lexically escaping paths refuse before execution. Literal # and % belong to the filename. A missing selected file is an execution failure. Discovery failure before any document starts gives control-refusal feedback with its diagnostic and no completed report.

A completed request returns this detached JSON-compatible value, and designated feedback retains the same value whether or not it was captured:

{
  path: string,
  status: "passed" | "failed" | "no-tests",
  documents: [{
    path: string,
    status: "passed" | "failed" | "no-tests",
    tests: TestResult[],
    error: null | { name: string, message: string },
    report: string
  }]
}

The top-level path preserves the requested spelling; document paths are normalized session-relative paths, including components/. Tests are actual Testing results: status pass or fail, source location, optional name and optional structured error with kind, full message and optional actual/expected values. Output is drained independently and partial rendering survives document failure. A successful execution has error null; otherwise the actual failure's name and full message remain. No outcome is inferred from report text.

A document passes only after successful execution with reached tests. An otherwise valid zero-test execution is no-tests with its genuine testing-policy diagnostic. Parse or runtime failure before the first Test is failed, including when there are no results. An empty explicit Testing boundary is still no-tests. A suite passes only when every document passes; an empty selection or all no-tests documents is no-tests; every other combination is failed. Ordinary document failure allows later documents to run. Cancellation, refusal, persistence, Files infrastructure, disclosure and owning-cleanup failures produce no completed report and retain their authoritative failure paths.

Each document has a fresh execution scope and real useTesting session under the clean command host, with its providers, immutable declarations and selected TypeScript loader. Entry and response bindings or registrations are not copied. Document cleanup joins before the next document starts. Nested Execution uses the existing testing host. Testing grants no permission and adds no terminal writer, pane or automatic chat summary. Only explicit Output publishes chat.

The root admits testing only when no entry reservation or active test exists and the session is ready. Its test slot is acquired without suspension before discovery and held through suite cleanup. Person Run, Sidekick Submit and a second test refuse during this interval, including cancellation cleanup. A test also refuses while an entry is preparing, executing, paused or tearing down. Refusal queues nothing, preserves the draft and appends no entry.

The response owns testing. Stop cancels and joins its test work before releasing the slot; Exit likewise joins it before shutdown completes. An already admitted ordinary entry remains session-owned and survives Sidekick Stop. Completed reports remain retained facts after source changes or removal. Reopening and inspection execute no test, provider or component. An unmatched test intent is unknown work; only a new explicit REPL.Test starts another run.

Read Guide.Entries for the executable create, test, fail, fix, retest and reuse sequence. File availability follows actual File outcomes, not entry completion alone.

One live journey

Run xmd repl. The screen shows + New Round, a Sessions list that says it is empty, an Entries list with nothing in it yet, and a location of the form xmd://repl/<execution>/entries — the execution already exists, as an empty history file, before you have typed anything.

Activate + New Round, type or paste one XMD entry, then press Tab and Enter to activate Send. What was in the draft is now the entry, and an admitted entry is immutable. The run begins, and the screen fills in as it goes — the scopes the entry admitted, the bindings its eval blocks published, the source a generated fragment produced before that fragment was admitted, and each line the document rendered.

Open the next draft. It is always the next entry's, so it goes on taking keystrokes while this entry runs and while you are reading an earlier position: an admitted entry is immutable, so there is never one those keystrokes could be editing. Activate Send before the entry ahead of it is done and the REPL says so, and what you typed stays exactly as you typed it, character for character. When that entry has both settled and finished coming down, the same draft becomes the next entry — and only then does it leave the input and the location.

When the entry asks a question, the identity header says an entry is waiting for an answer and the existing Answer action in History remains available. Focus, the route and the Sessions filter stay where they were. Activate Answer with Enter or a pointer and the question's drawer opens: the whole message, and then every field the schema declares, with its title, its description, whether it is required, and exactly the values it will accept. All of that is one ordered whole, and it is that whole — not the message alone — that scrolls when it is taller than the drawer. Wheel input and the Content paging keys reach the rest. The title, Submit and Close stay outside the moving content, so every field and offered value remains reachable while the submission and closing actions stay visible. Fill them in, or activate one of an enum's offered values, and press Enter from any of them to offer the whole object. The answer is recorded, and what the document renders after it changes because of the recorded answer rather than because of anything this process remembered. An answer the schema rejects keeps the question open and says what is wrong with it, under the field it belongs to. Escape closes the drawer without answering and discards what was typed into it — an entry's drawer, whose own close works this way and whose rule the Sidekick's form does not share; the question stays open, so the row that announces it is still there and activating it opens the drawer again. An answer the schema accepts ends the question, and the drawer goes with it: it leaves the screen and it leaves the location, because a URL naming a drawer nothing mounts describes a view nobody can be shown. A question that disappears some other way — teardown, or a settlement elsewhere — takes its drawer with it in the same way, and nothing becomes an answer, because none was given.

A question belongs to the entry that is asking it, which is read on the Entries surface. Activating the announcement therefore goes to that surface, selects the entry still running, and leaves the draft and the Sessions filter where they were — so a question is reachable from either surface without the screen moving on its own first. A location naming that drawer beside Sessions, beside an earlier history position, or beside an entry that has already settled is refused.

Press Enter on [exit] to leave. It is on the screen in every state — while an entry runs, while a question or a request waits, and while an earlier position is being read — and while a drawer is open it belongs to that drawer, so it is reachable without reaching past the modal. Leaving is lifecycle and nothing else: it answers no question, decides no permission request, and appends no close, no cancellation and no audit. An entry whose root never closed stays unfinished, because that is what it is. The command cancels and joins everything it owns, gives the terminal back once, prints what reopens the location it was at — minus the drawers only a running process could have mounted, so what it prints is a location a second process can be handed — and exits zero.

Press Enter on [pause] to stop expansion at its next boundary. [continue] exists only while a continuation is actually held — not while a pause is still being taken — and releases the holds. Pausing cancels nothing: the execution is suspended, not abandoned. Open the History drawer to select an earlier position; the whole view freezes there and is read only. [live] returns to the head.

Pause is offered from the moment Run reserves the next entry, which is before that entry exists. Submitting validates the document first, and validating reads the definition of every component it names — so there is a window, as long as a disk or an import takes, in which the person has pressed Run and nothing is running yet. The control is there throughout it, and activating it asks that this exact entry stop before it expands anything.

The button and what expansion is doing are separate: the control reads [pause] in every state, and the state stands beside it as plain text that is neither a button nor a keyboard stop.

[pause] preparing
[pause] pausing
[pause] paused [continue]

preparing means a submission is being prepared and nobody has asked it to stop. pausing means somebody has and nothing is held yet — the same word for a preparation and for a live walk that has been asked and has not yet stopped, because it is the same situation. paused means a continuation is really held, and [continue] exists only then. Expansion that is playing shows the control and no word at all.

The request is applied when that entry is admitted, which is the earliest moment a hold means anything. Starting an entry imports __root__ before it expands anything its author wrote, and retaining that import is what gives the entry its position; the request is taken in the same transition that establishes it, so the hold is in place before the first authored step and after the entry is something a person can walk back to. An entry held ahead of its position would be paused expansion above a history that says nothing was submitted.

So a Pause pressed during startup — after Run, after validation, while the execution is being built — is still a request and not a hold. It waits for that entry's admission exactly as one pressed during validation does, and until then there is no continuation, so no [continue]. The setup import is not an authored expansion step: holding it would hold the very operation the position comes from.

A pause request belongs to the one submission it was made against. It is in no record and no location: a refusal, a withdrawal or closing the command discards it, it cannot reach a later entry, and reopening a location restores no preparation and starts no work. Pause asks and cancels nothing — neither the preparation nor the entry — and asking twice asks for the same thing.

Preparation is not execution. A reserved entry is not running, paused, admitted or settled; it adds no history position and no head state, and the rows around the body keep their count throughout.

When the root settles, its recorded output is what the transcript shows, and the screen stops asking for frames.

Entries: a catalog you come back to

The Entries surface lists every entry this execution has admitted, numbered in the order they were submitted. That order is what it is: an entry's place comes from when it was admitted, so one that finished first, published first or failed cannot move ahead of one submitted before it. Each row carries its outcome before its name — [unfinished] while it is running or if it was interrupted before closing, and then [ok], [err] or [cancelled] — because a root name is as long as its author made it and the sidebar is not.

Each entry has a stable key from that same order — entry-1, entry-2, and so on — and it is the key a location names, so a link to what you are reading keeps meaning it. The first entry's key and every marker spelling it ever had are unchanged, so a location written before an execution could hold more than one entry still opens on exactly what it always did.

Selecting a row changes what you are reading and nothing else. The transcript becomes that entry's own, its scopes and published values become the ones to inspect, and the entry you selected is part of the location. Live execution, the draft, the history position, the Sessions chronology, the Sessions filter and focus outside the list all stay where they were — and output from the entry that is still running appears under that entry, never under the settled one you are reading.

The list is windowed rather than clipped. Wheel input moves its measured viewport without selecting an entry. Up/Down reaches the next logical list row, revealing it before focus moves; Right enters nested scopes and Left returns to their parent. Enter selects the focused row. No horizontal scrolling exists. Rows outside the window are not drawn, focusable or pointer targets.

Entries run one at a time. There is no queue: a submission while one is running, while one has settled but its work is still coming down, or while you are reading an earlier position is refused, and refusing it starts nothing.

What a later entry starts from

An XMD child reference can be published as eligible root JSON and selected in a later entry. The nested XMD.Session capture does not export itself. Capture the returned JSON at the entry root, for example:

<Parse as="child" schema={{type:"object",properties:{sessionId:{type:"string"}},required:["sessionId"],additionalProperties:false}}>
<Agent name="xmd"><Session name="worker">
<XMD.Session as="started" /><Json value={started} />
</Session></Agent>
</Parse>

A later entry uses <Agent name="xmd"><XMD.Session sessionId={child.sessionId}><Prompt>Continue.</Prompt></XMD.Session></Agent>. The object carries identity only. Completed-document output can restore that data; selection, attachment and Shutdown still require the original live child. Capturing it extends no lifetime and grants no foreign parent's shutdown authority.

The root values an earlier entry durably published are what the next one begins with. For each name it is the last value any earlier entry retained, in Journal order, and the values are the entry's own to change — they behave like values authored earlier in the same environment, and a later export replaces one through the ordinary rules.

A root <Let>, an ordinary component capture and an eval block's export all reach the next entry. Writing

<Let as="saved" value="alpha" />

is enough for the next entry to read {saved}, and the same is true of <Json value={{ answer: 42 }} as="saved" />, of a Markdown component captured with as, and of a <Git.Commit as="commit" /> whose object id a later entry consumes without committing again.

None of them is retained on its own. What the entry hands on is its outcome: when the entry settles, the data its root holds is carried on the ordinary result that settles it, and that is the one thing a later entry starts from. So the question is never which construct wrote a name, or in what order — it is what the root held when the entry finished.

That is also why the value that crosses is the value as it stood then, rather than as it stood at the capture. The binding inside the entry is the exact object the expression or the component produced, so the entry goes on using it the way it always has; a change it makes to that object before it settles is part of what the entry hands on, and a change made to a copy a later entry received reaches nothing.

Initial bare bindings enter only through the trusted executeInstalled() input exported from @executablemd/core/host, not ordinary execute(), Context, component, middleware, document props or a durable-record input. Before any installation or document code, core parses and name-validates the whole record and recursively detaches its values. The recipient's copies remain ordinarily mutable. The REPL derives the input exclusively from values durably retained before that entry's admission, so replay derives it from the same retained bytes.

Values that stay in the entry that made them

Explicit Entry Stop runs and joins authored Finally before retaining cancelled Close. It skips Catch and joins an already-entered finalizer without restarting it. Exit instead leaves an unentered logical finalizer pending and joins physical resources. A finalizer entered on the ordinary forward path restores acknowledged effects on continuation. Cleanup acknowledged without a terminal Close can leave an unfinished history that refuses continuation before live body work; failed append or cleanup is not successful Stop and admits no successor.

What crosses between entries is ordinary JSON data: text, numbers, true, false, null, lists and plain objects of those. A function, a live handle, a class instance, a cycle, a non-finite number and undefined are entry-local. They bind exactly as they always have and stay usable for the rest of that entry, and they are not converted into data, not kept alive past the entry, and not published.

A name bound only to a value like that is simply absent from what the entry hands on, which is not the same as clearing it — so the name keeps whichever value an entry last settled under it:

<Let as="saved" value="alpha" />
<Handle as="saved" />

The second entry uses that handle. The third entry — and a cold reading of the file — still reads saved as "alpha", because the second entry's outcome carried no saved to replace it with. A name only ever bound to a value like that is absent from inheritance altogether: there is no removal, nothing is deleted, and nothing warns.

What survives is what was retained. An entry that failed settles its entry and hands on the root data its own failing outcome carried, because a failure is an outcome.

A cancellation is not a result. An entry whose cancellation the file records settles its entry too, but it carries no computed root data of its own: there is no map on it, and none is reconstructed for it — whatever a cancelled run had computed went with it rather than standing in for a result. What it does not do is unretain the facts recorded before it. An eval export that entry really made is a fact the file holds, and the entry after it inherits that export exactly as it would from any other settled entry, while a capture the entry reached and never recorded stays absent. Either way the next entry may start.

"Nothing unretained crosses" is about outcomes, not about names. An entry that mutated a value it inherited and never named again still hands the mutated value on, because what its outcome carries is the root it actually had. What does not cross is anything no outcome ever acknowledged — a value a running entry holds, a value an entry that never settled computed, a value a discarded result had. The reserved props namespace belongs to each entry's own validated root and is never inherited.

An entry interrupted before its root closed is a different thing, and there are two kinds of it.

Left unfinished. Exit, EOF, a terminal failure and the command's own teardown end an entry without appending any outcome for it. The file holds no close, so the entry is unfinished, and an unfinished entry permits no successor — opening that execution can resume where its records stop, without repeating the effects it already recorded. It can perform unrecorded work; it is not passive inspection or a general repair. Inspect the exact entry through Source and Journal first. A joined fatal refusal may leave this history unfinished; Entry Stop then refuses because no task remains, and no successor is permitted. In particular, reopening immutable source entering B does not replace the session-owned repository A or resolve that repository refusal.

Stopped. An explicit Entry Stop is the other kind, and it is final. The entry's own root retains a cancelled close before the entry is released, so the entry has an outcome and is settled: what it had already completed stands, what it had already printed stays where it was recorded, the retained exports it published are inherited exactly as a settled entry's are, and no answer, permission or result it was waiting on is invented for it. It is projected and never resumed — reopening that execution reads it and runs nothing — and a successor may be submitted once that terminal is retained and every resource the stopped entry held has been released. A stop whose append or cleanup failed is not a stop that succeeded: the session admits no successor after one.

A history written before captures were retained

A file whose entries were written before root captures were published is read as it is. A completed entry there exposes the values it actually recorded, and a capture it never recorded stays absent: nothing re-runs its source, repeats an effect it already performed, or writes a value into it after the fact.

An entry such a file shows as unfinished simply continues. Nothing marks it and there is no mode to continue in: its retained prefix is restored — its recorded effects are not performed again — its remaining body runs, and the ordinary outcome it settles carries the root data it then holds, including the captures in the part that had never run. A file holding both kinds of entry is an ordinary file, because the only difference between them is what their own outcomes recorded.

What is refused is a history whose records say something this version cannot read: an outcome carrying computed data it cannot parse, or a name no binding could have. That is a refusal with nothing appended and no execution started, and it is a different answer from an outcome that simply carries none.

This comes from the file and from nothing else, so a later entry begins from the same values whether the earlier ones ran a moment ago in this process or were read back cold from the journal.

Reading what an entry started with and what it handed on

Select an entry, open the Bindings tab, and the pane shows that entry's Input: the ordinary root values it was started with. Choose Output above the rows to see the complete root data its successful result carried — every name, including the ones it inherited and never touched, not only the ones it changed. The heading names the entry and the view, so entry-1 Output and entry-2 Input are never mistaken for one another, and each row opens its whole value in a drawer of its own.

Input   Output
entry-2 Input
count = 1
config = {"mode":"draft"}
kept = "same"

When there are more values than the pane has rows, the choices and the heading stay where they are and the values scroll beneath them, like any other list here: the arrow keys bring the next value into view, the wheel moves them, and a value that is not shown is not a pointer target.

An entry that changes a value it received changes its own copy. Selecting the earlier entry again shows its Input and Output exactly as they were, and the later entry's Input still shows what it was given.

Output says what the entry did rather than inventing a result:

  • Running while the entry has not closed — and at any history position before its close, even when the file now holds its result;
  • Failed: with the failure's message, and no rows, for an entry that failed;
  • Stopped, and no rows, for an entry Entry Stop ended;
  • Output unavailable for this older entry for a successful result written before results carried root data;
  • (no bindings) for an Input or Output that is really empty.

Output is not always what the next entry receives. A failed or stopped entry shows no Output, yet the values it had retained still reach its successor as described above, and a name bound only to an entry-local value is absent from Output while its earlier value still crosses.

The view you choose stays as you select other entries and history positions, and an entry finishing never changes it or moves focus. It is not part of the location. A nested component scope keeps showing the values it published. Both views read the records the file already holds: nothing re-runs, and no snapshot is written.

One cold journey

The command prints what reopens where it ended: a line saying so, and under it the whole xmd repl <location>. Run that — on this machine, in a new process, with nothing carried over — and the same view comes back: the same catalog of entries in the same order with the same outcomes, the same selected entry and scope, the same binding values, the same transcript, the same generated source, the same recorded question and answer, the same History positions and the same terminal output.

Opening validates every entry before returning a view, including entries after the selected history position. The open session keeps settled entry summaries and the bindings in effect at the head. When a view needs settled binding values or a position inside a settled entry, it reads the corresponding journal ranges and verifies their exact bytes against the ranges validated at open. It reads no live component source, compiles no eval and asks nobody a question. Only the unfinished final entry's retained records return to the engine for continuation. That entry may perform work it had not yet recorded. Passive Source and Journal inspection does not open execution. It preserves uncertainty when no live host observation remains and never reconstructs an old joined verdict. A location naming a history this version cannot read, or naming an entry its selected prefix never admitted, refuses whole, with nothing appended and no execution started. The entry and Sidekick histories are read record by record, with no limit on their combined decoded length or on the decoded length of either file. An entry record longer than 536,870,888 UTF-16 code units including its newline refuses with the record number and the limit.

An interactive cold reopen identifies the execution and shows its reopen command, elapsed time and the status and duration of each restore phase. The clock starts when the attempt begins and stops on failure or when the requested reading opens. Retry starts a new attempt with fresh timing.

The entry journal is counted through EOF using the same entry boundaries and record decoder as the paged reader. The total covers the whole journal, including entries after the requested history position, and applies to the journal version and exact bytes being projected. When counting cannot establish a total, the display shows the projected count with the total unknown and omits determinate fill. A publication refusal before entry open shows the failed stage without a round count.

The bar advances when an entry range projects successfully. An entry with a recorded failure or cancellation counts, as does the unfinished final entry once its retained prefix projects. Viewing a saved range again or continuing an unfinished entry adds no round. A refusal preserves the number of successfully projected rounds and shows that restore stopped. A changed journal invalidates its total.

When the rounds are done and saved Sidekick history is still being projected, the display shows the completed round count and explains that the retained conversation is still opening with an unknown count. The requested route and its normal focus appear with the first live presentation. The visible Sidekick conversation shows a notice with the restored round count and elapsed time for a nonempty restore. The notice disappears on interaction and is never saved with the conversation. Counting and projection leave opportunities to present updated progress and handle terminal input and resize. An empty or short reopen has no minimum display time. Attachment and headless startup keep their own paths.

You may supply the include options again when reopening a location. Completed entries show their retained output and submitted entry source even after included files change or disappear; inspecting them reads no live component source, compiles no eval and asks no Agent. Imported component bytes remain retained for replay. New entries use this command's selected directories.

A component called twice keeps two source readings. Each nested source and recorded answer belongs to the call that produced it, while caller content projected through <Content /> keeps its caller's source. Current records name the owning source import directly. Older records remain readable when their ownership is unambiguous; an older ambiguous history still refuses without repairing its bytes or repeating completed work.

The packaged Plan, in the REPL's own drawer

<Plan> is the same packaged Component xmd plan runs, declared by this command rather than reimplemented by it. Its authorship turns go to the configured provider, and its review is asked through the REPL's own Elicitation provider — so the plan you are reviewing appears in the drawer in front of you rather than in a readline this process is not reading.

The review is a bounded form: approve, request changes, or stop. Choosing "request changes" without the feedback that option requires is refused like any other invalid answer — the review stays open, no answer is recorded and no turn begins. Supplying it resumes the same provider conversation, and what comes back is reviewed again. Approving admits exactly the source the provider returned: the returned program is rendered at the <Plan> invocation and executed inline by the enclosing <Evaluate>, never appended as unrelated output.

A returned program is a generated fragment, so it runs under the ordinary ceiling and the generated-expression grammar: it may ask questions, write files and compose values it holds, and it may not compute one (specs/executable-mdx-spec.md §5.3.3). Canonical <Elicit> is in that ceiling's write table, so a generated program can preview what it is about to do and ask before doing it — and its validated answer drives what follows through ordinary bindings.

The ordinary ceiling is the command's default rather than the entry's answer. The session offers it in each entry's own execution scope as ordinary middleware that delegates first and supplies the default only where nothing nearer stated one, so a plugin or host installation that states its own selection is the one that entry runs under — including a defined empty one, which refuses the entry's setup instead of being replaced.

Sessions: two owners, and which conversation you are reading

The Sessions surface shows the agent work this execution has, in two labelled sections: Entry agents, then Sidekick. Two, because the two histories are two files with two owners and no shared scheduling number — one interleaved list would have to claim an order neither file establishes. Each section keeps its own order, and an empty one says it holds no turns. A Sidekick history this version cannot read says why instead, because an empty section for a file that holds somebody's conversations is the one answer that cannot be corrected later. An execution with no Sidekick installation has one list and says so when it is empty.

The Transcript column of the staged workspace — and its narrow outlet — shows the same work as one displayed list, with no section heading over either owner. That is what the person who accepted this screen asked for. It is a presentation and nothing more: the two owners keep their separate domains, each keeps its own recorded order, each row keeps its own destination, and every row says whose work it is and which conversation it was in. The two orders are shown one after the other and never interleaved, so this list still claims no order across the two files. Everything the sections say below about what each owner holds, what a row means and how a conversation filters is true of this list too.

Entry agents shows every Agent turn the entries did, in one order: the turns the history retains, then the turns this process is watching, by the order they were scheduled. A turn says how far it has got — queued, streaming, how it ended, and whether the history holds it yet — and a turn that has finished is not the same as one that has been recorded: only the second is a position you can go to.

Sidekick shows every turn this execution's chat history holds, across every conversation in it, in that history's own order — so the conversations that preceded an agent change are still there. Each row says it is the Sidekick's, which chat it belongs to and which agent answered in that chat, read from the chat and the turn rather than from whichever agent is selected now. Its title is the exact saved message a person sent; a turn that carried a previous response's results is Automatic feedback rather than something anybody said, and its machine input, bootstrap and reference chapters never become a person's words. A turn whose request this history cannot establish says so instead of borrowing the most recent message.

Progress and recording are separate. Before publication a row says only what the owner has actually observed — a request asked, a turn generating, a reply being evaluated — and never that a provider reported a start nobody reported. A saved Prompt establishes its own completed, failed or cancelled status and nothing about the program it returned: a completed turn with no evaluated-response record reads Turn saved; no evaluated reply recorded.

A turn keeps its identity when its record arrives. The row a person is reading is the same row before and after publication, and what replaces it is its own record rather than a second row beside it. Entry rows and Sidekick rows are never merged, whatever they have in common: they have different owners, so an equal provider conversation or an equal turn number leaves two rows.

Show token usage starts unchecked in the identity row. Click it or focus it from the History controls and press Space or Enter. The setting follows the current REPL through navigation and resizing. Every new invocation starts unchecked, including when it opens a saved location. The checkbox changes the presentation without starting provider work or writing history.

When checked, saved Sidekick turns show reported token usage beside their recording and outcome in Sessions, Transcript and chat. A failed or cancelled Prompt, a failed evaluated reply and a saved Prompt without an evaluated reply each retain their own usage. An unavailable report, an unrecorded turn and a reported zero remain distinguishable. Reading a saved chat exposes its token sources, counters, scopes and retained limitations as text.

The ACP Prompt usage contract defines the source views and counter meanings. For each saved Prompt, the display takes the last token reading of each source. It counts at most one response or quota-total view, preferring the response, when the reading covers a main-loop turn total or a last-request snapshot and supplies a number. The turn can show other reported views with unknown coverage. Missing counters stay unknown. Cached and reasoning counters stay in the source detail. A reported total is shown in place of the input and output breakdown when both are missing.

The Sidekick total uses every saved Sidekick turn in the retained owner history, once per conversation and turn, across all selections. In the chat pane it appears above the composer controls, which keep their own rows. It sums each counter independently, identifies partial and unknown coverage and counts unavailable and uncountable turns separately. The associated entry outcome shows an Entry agents summary of that entry's retained Prompts when its terminal is present in the selected prefix. The same counter rules apply to that summary. Reopening, replay and presentation read retained facts without starting provider work or writing usage.

Conversations are the provider's own session keys, offered in Entry agents order and then Sidekick order, each owner earliest-observed first and a duplicate key offered once: above the Sessions surface's own list, and behind the All sessions selector at the head of the Transcript. A queued turn belongs to none of them yet, and the name the document gave its <Session> is not an answer to which conversation a provider opened, so a turn without one appears under All sessions and nowhere else. A Sidekick turn's key is the one its own saved record names — a failed or cancelled record included — and an earlier turn's key is never substituted for a later one's. The conversation a successful publication names belongs to its own live turn before anything is acknowledged, and it still does not make that turn saved.

Selecting a conversation filters both owners' rows — both sections on the Sessions surface, the one list in the Transcript — and changes nothing else: the route gains a session and keeps its surface, its scopes and its history position, and the selected work, the Draft, the composer and focus stay where they were. Clearing it back to All restores both whole. The Sidekick's facts are applicable beside any entry position, because freezing a prefix freezes entry facts and a chat has no position in that history — so a Sidekick conversation can be selected where the frozen prefix contains no such conversation, while an entry-only key absent from that prefix is still refused. Work in the conversations you are not reading — a turn starting, text streaming, a record appending — moves neither the route, the history position nor the focused control.

A conversation filter key must have applicable evidence from its own owner. A key this live owner genuinely observed remains known for that owner's lifetime, including after Stop; saved files do not establish those ephemeral observations. A key with no applicable evidence refuses, and cold reopening refuses a selector supported only by an observation the former owner lost.

Reading a previous chat

A retained eager resume refusal appears as one incomplete attempt. An explicit message already has a durable request, including a message carrying recovered feedback, so that request owns the attempt. Automatic feedback records its request at canonical begin. A refusal before that boundary has no established request and appears beside the preceding attempt on its own. It creates no feedback intent or acknowledgement. A second ordinary outcome for the same request still refuses the history.

For a classified resume refusal, chat displays the screened ACP details as literal text followed by the saved recovery message. A missing or blank detail leaves the recovery message alone. The live exchange, including an original continuation refusal, uses the same text as the saved attempt. The entry Journal returns the canonical saved fields with their original values.

Activating a Sidekick turn opens the chat that contains it and brings that turn into view. It sets view=sidekick, right=sidekick and that chat's own identifier, and preserves the conversation filter, the saved surface, the selected entry and its scopes, the history position and both texts. Bringing the turn into view is ordinary process-local window navigation: a copied location promises the same chat and no scroll offset. Selecting a reading starts no provider, performs no generated program, creates no history record and stops nothing that is running.

The turn to show is kept until a frame that measures the destination chat can place it. The frame answering the selection is the one being left, and a frame with no room for a chat beside the reading — or one showing Bindings — has measured no chat window at all, so there is no offset it could compute. The chat's own measurement is what puts the turn on screen, and what it lands on is that turn's own evaluated reply or inert anchor rather than the first message carrying its number.

What it lands on is also always a row that chat actually draws. Where the turn's own reply said nothing to the person there is no such row, and the reveal is the request that turn answered — its own, or, for a turn carrying a previous response's results, the person request its chain began with, established from the history's own request boundaries. Nothing is composed to be landed on, and a turn whose containing request this history cannot establish reveals nothing rather than a row chosen by resemblance. The next time somebody moves that window themselves, the kept request is spent.

A turn that has no rendered reply still has somewhere to land — automatic feedback, a saved turn with no evaluated reply, a turn that failed. What it says there is what its records hold, and never a reply rebuilt from its source or an extra message attributed to a person.

A chat whose own setup did not finish says so. One left prepared was interrupted while it was being set up; one that failed kept the agent's own reason and preserved the association before it. Either is a real saved chat a location may name and a reader may open, and what it holds is that status — not an absence of messages.

Omitting the chat follows the current one. An explicit identifier pins the reading to that chat, and it has the usual controls only while it is the active association. Every other saved chat is read-only: no composer, no [send], no [retry], no Configure, no pending question, no Follow, TODO or QUEUE and no [stop] addressing it, absent from the screen, its focus order and its target map rather than drawn and refused. A current-chat question or Configure drawer is hidden while an older chat is read and keeps every value already typed into it. Root actions still check the actual current conversation, so the selector can never redirect an operation into old work.

[Back to current chat] sits outside the scrolling transcript. It clears only the chat selector: the Sidekick stays the selected reading, and the current message comes back exactly as it was. Selecting Entries, Sessions or Bindings keeps the selection available for returning. Background work and resizing never retarget a chat somebody explicitly selected and never take focus. An agent change asked for from the chat being read returns to the new current chat by clearing the selector; one that fails preserves both the reading and the association it was asked of.

The list is windowed rather than clipped: it moves through as many rows as the frame can place. Wheel input and the reading keys move its content while the way to the other surface stays fixed. What the window is not showing is not drawn, not focusable and reaches no pointer.

Permission: a live request, and a retained audit

A headless child's ACP permission callback offers the original owner's actual options. ACP and UI submit to that same owner. An unoffered option or malformed response leaves it pending; a stale presentation cannot settle a later request. Input withdrawal removes and joins the corresponding callback, without creating a denial. Correlated response outcomes are transient live-turn notices outside reply text and retained Prompt records; accepted means original-owner acceptance, not journal publication or completed work.

A turn waiting for permission says so on its own row, and that is all arriving does: nothing moves, nothing takes focus, and nothing else stops. Activate it and a drawer shows what is being asked — its kind, the call, whose turn is waiting, and every choice the provider offered in the provider's order. A choice that lasts says it lasts for this Agent session, because nothing here can make a rule that outlives the conversation asking. The drawer is windowed like the list behind it, so however many options a provider offers, each one can be reached and [close] never scrolls away.

Choosing one answers that request; closing the drawer denies it, which is the same decision the session's own policy would make and is recorded as such. Either way the drawer closes only when the request is settled — a screen that closed first would be claiming an answer nobody gave — and focus returns to the turn that was waiting.

A retained audit is inert. What the history holds is what was granted, read and never answered again — a recorded request offers no control, and a cold process shows the audit without offering to decide anything. Ending the command answers nothing: a torn-down process does not fabricate a denial, a selection or a cancelled audit on the person's behalf.

Permission composition runs outermost first: core's audit observer, this session's authoritative policy, document/provider composition, then base denial. One private grant ledger belongs to each inherited Prompt scope.

Move between regions and edit within them

From the Round editor, one Tab enters Send without activating it. Continue with Tab to reach the tabs, right reading, Message, History, Transcript, selected work and the editor again. When the editor is closed, the Draft region enters + New Round. Shift+Tab reverses the same cycle. Both directions use each region's fixed entry; an absent region is skipped. Moving focus selects, sends and answers nothing.

Transcript -> Selected work -> Draft -> Round actions -> Tabs/Configure
    ^                                      |
    |                                      v
 History <- Message <- TODO <- Right reading <-----+

Ctrl+G shows a numbered focus hint near each displayed shortcut destination. It lists destinations the shortcut can reveal with the route each digit opens. The hints appear without moving focus or changing either draft or the selection. Escape or Ctrl+G again dismisses them and keeps focus. An offered digit enters the region at the same fixed control as Tab and dismisses the hints.

Digit Region
1 Sidekick Message
2 Transcript
3 Selected work
4 Round editor, or + New Round when the editor is closed
5 Tabs/Configure
6 Right reading
7 TODO
8 History
9 Narrow surface bar

A shortcut reveals the destination's outlet when needed. It preserves both drafts and the selected entry and conversation. Unavailable digits are omitted and pressing one leaves the hints open. A modal keeps focus in its own branch and suppresses focus hints. The prefix and digit are consumed without entering either field.

Arrows move between local controls along their group's axis. Right enters a vertical group from its anchor; Left returns to that anchor. A group always enters its first admitted child. Local edges stop, and Alt+Up/Down walks the region's controls in their described order without wrapping. No region remembers its last focused child.

Navigation topology is derived from the active focus root's mounted controls in canonical order whenever navigation is requested. A focusable description may declare a region key, Tab rank, axis and recovery preference, nested groups, innermost-group anchor status and entry preference. Covered or unmounted controls are not destinations, and the mounted tree remains the one focus store. Conflicting region declarations, conflicting group axes and multiple anchors for one group refuse validation.

Tab and Backtab belong to the tree and enter the next or previous region at its fixed entry. Other navigation keys first reach the focused control's ancestry; unhandled keys navigate along the declared axis, into a group from its anchor, back to that anchor, or through an anchorless group to its parent. Alt+Up/Down uses the region's depth-first order. A pushed modal enters its first region's entry. Survivor recovery for a removed or uncovered control tries its own neighbours, ancestor anchors, its region's entry, then the lowest recovery preference; it never substitutes the first control on the screen. The profile's fixed entries and narrow recovery above remain applicable.

Draft, Message, entry-answer values, Sidekick-answer values and Configure Agent show a caret. Left/Right and Backspace use grapheme boundaries; insertion and paste occur at the caret. Up/Down follows displayed rows and retains the preferred visual column; Home/End reaches that row's boundaries. Plain arrows stay in the field. Alt+Up/Down reaches its local actions, and Tab leaves its region. Each value keeps its own caret through focus departure, modal coverage and resize; an explicitly replaced value or a new question starts at its end. Enter in the Round editor inserts a newline. Enter on Send submits; other fields keep their submission or Apply meaning. Control-J, a shifted Enter and Terminal.app's Shift+Return insert a newline; releasing a key inserts nothing. Control-C in a focused Message that holds text clears it, as described under Message below.

While the screen is open it enables bracketed paste. A framed paste inserts one text value at the caret, preserving blank lines, indentation, tabs and Unicode. CR, LF and CRLF line separators become LF in the value; framing markers never enter it. Paste does not activate a field's submission or other keyboard actions. The screen disables paste mode with its terminal reset on every exit.

Selected work, Sidekick chat, empty Bindings and drawer readings have one stable focusable anchor on their first visible row. The anchor adds no row or pointer target. Up/Down scrolls one fitted row, PageUp/PageDown moves one page less a row, and Home/End reaches the reading's boundaries. Enter does nothing. Reading scroll changes no selection, History position, text or running work. New output and background questions preserve focus and a reading positioned away from its tail. Focus, caret and navigation metadata are process-local and enter neither a location nor a retained record.

PageUp and PageDown that a control in drawer Content does not handle move that drawer's window by its capacity less one displayed row, with a minimum of one row. This works from editable values and options, including a window containing only controls. Plain arrows and Home/End keep their editing meaning. Paging preserves values and the fixed Content entry and adds no Tab stop. If a keyboard page move removes the focused row, Freedom chooses its surviving destination using the existing recovery rules.

The wheel scrolls the reading beneath your pointer without moving keyboard focus. Each decoded tick requests three displayed rows: up moves toward preceding content and down toward following content. Content edges stop movement without wrapping or moving another reading. When the focused control is inside that reading, the wheel stops before hiding it. Use keyboard navigation to reveal further controls, or move focus elsewhere to scroll farther with the wheel. A reading anchor belongs to its viewport rather than a particular row.

Every drawer is a window

A drawer shows as much content as its measured window holds. Wheel input over the window and its keyboard reading or paging keys reach the rest. Questions, permission requests, History positions, retained binding values, recorded answers, the Entries catalog and Configure use this same bounded reading behavior. Only the rows admitted to the window appear, receive focus or become control targets.

A wheel target covers the complete measured viewport, including text, trailing spaces, blank rows and empty body cells. Headings, borders, gutters, composers and fixed actions are outside that target. A fitting or empty viewport consumes wheel input without movement. Only the top modal's interactive subtree receives scrolling; input outside it cannot reach background content, including a visibly uncovered pane. At an edge, the event stops at that viewport.

Only what is in the window is on the screen. A row above or below it is in no cell, reaches no pointer and is no stop for Tab, so the last position in a long History is genuinely absent until the window reaches it — and then it is an ordinary control that selects that position. Scrolling is only scrolling: it moves the window and changes nothing else. It selects no position, answers no question, writes nothing to the file and does not touch the location, so moving through a long record cannot change what you are reading.

A drawer is bounded. A rule along the top of its rectangle says where the reading behind it stops, and its title and its rows start one cell in from each side, so a title cannot be read as one more line of what the drawer is covering. Both belong to the rectangle and both are measured: the window is measured at what is left after them, so a reading one row longer than that window is reached with wheel or keyboard scrolling rather than drawn over the rule. A drawer holding a question nobody has answered yet — the question itself, or a pending permission request — is named in the accent this screen uses for waiting, so the drawer you have to act on says so before you have read a word of it.

The title and [close] stay outside the moving content. A question's [submit] is fixed beside Close and any available Sidekick Stop, even when its fields are below the content window. Tab cycles Content -> Actions -> History/Exit; Shift+Tab reverses it. Content enters the first admitted editable value for a question, Agent for Configure, the first admitted list row for History/catalog, the first offered permission option, or a reading anchor. Actions enters Submit for a question and Close otherwise. Local arrows and Alt+Up/Down reach the other controls. Opening a question reveals its first editable value. Escape closes the top drawer, including the catalog.

History over a held form or Configure contains input in its own modal and closes to the exact surviving opener. Form values and carets remain held underneath. Permission close settles its denial before restoring its waiting turn; entry question close discards its values, Sidekick question close keeps them, and Configure close discards unapplied choices. Successful answers retain their own existing destinations when visible. No background update can issue a late restoration. The rows below the body stay where they are — [history] and [exit] stay reachable from inside an open drawer, where they belong to that drawer.

The drawer is measured within the space between the identity header and History, in the rectangle its owner already uses. Its fixed title and actions carry its guidance. Above Content, show what Enter does for the focused control, Esc to close, Tab to move, and PageUp/PageDown to read more. Keep reading and editing directions appropriate to the focused control. Fit this guidance to the measured drawer width in as many rows as it takes. Its rows reduce the scrolling Content window, and the fixed controls stay reachable.

The right pane's two tabs are its heading: Bindings and Sidekick side by side on one row, in that order, each name said once and neither repeated by a title of the column's own. Which one is showing is its active styling, and keyboard focus is the separate mark it has always been — focus on a tab does not select it until it is activated. Each tab is as wide as its own name, so a pointer aimed at a name reaches the tab bearing it. When the Sidekick is the one showing, the pane holds its acknowledged chat, the one box its messages are typed into, and one control: [send] while it is idle, [stop] while it is working. The tabs stay above the reading and the box below it, so the way between the two readings and the place a person types do not scroll away with the conversation.

Every message keeps its own rows. A message is fitted to the width the pane was measured at before anything counts rows, so its line breaks, blank lines and whitespace survive and one that is wider than the pane is paid out over as many rows as it needs — the message after it begins below the last of them. Nothing is truncated and nothing earlier is dropped to make room.

The chat follows its newest messages. A message arriving, or a live preview growing, moves the window far enough to keep the latest rows at the bottom; earlier ones move up and stay reachable with the wheel and reading keys. Scrolling up is how you stop following, and that reading stays where you left it while messages continue to arrive and be saved — reaching the end again is how following resumes. A turn chosen from Sessions takes precedence over following, and a previous chat stays where it was put while the current one works. None of this is in the location: a copied location restores the chat somebody selected and promises no scroll position.

Outside drawers, the identity header explains readiness and the next available action. When visible, the Round editor heading gives editing guidance, including Enter for a newline and Tab for Send. Other focus destinations remain available through the existing Tab traversal and Ctrl+G hints.

The Round editor holds this execution's next document. Its Send runs that document. Enter in Message Sidekick asks the Sidekick. Typing and Backspace reach whichever holds focus and leave the other exactly as it was. Both texts survive switching tabs, navigating History and resizing; the draft is in the location, and the message is this process's own and appears in no location. An empty box sends nothing.

Each of the three columns keeps one blank row above its first heading. It is layout space rather than a row of content: it holds no text, reaches no pointer and is no stop for Tab, and both passes measure it, so what a column has left for its reading is the engine's own remainder after it. Where a column has a header band — the Transcript's and the right pane's — the band owns that row and paints it with the header's own surface, so the space reads as the top of the heading rather than as a strip of the reading pushed down. The sidebar has no band and keeps its own surface there. The sidebar's lower Entries heading is that column's second reading rather than the top of another column, and takes no second gap. The narrow profile routes one outlet, heads no shared column and takes no gap at all.

The Transcript's name is inset by the same two cells its body is, so the column's heading lines up with what it names. The band around it keeps the whole inner width: it draws the header surface and the rule that closes it, and only the row holding the text moves.

The three columns share the row. The sidebar is thirty-six columns at both the wide and the medium profile, and what is left is split equally between the Transcript and the right pane, in whole cells, with the spare cell of an odd remainder going to the Transcript. The right pane holds a conversation, which is the reading that wants the room, and it is the same width under either of its two tabs.

Thirty-six rather than a share of the terminal, because this column's two readings are rows of text that have to be legible whole: completed, not recorded yet is the longest state a turn carries and All conversations (filtered) the widest control, and a row that cut a turn's state in half would say something untrue. Thirty-six leaves thirty-two inside the body's gutter and thirty past the focus marker, which is the room the column had before it was inset — so the same rows fit, at the medium profile as well as the wide one.

The reading has no window buttons or extra Tab stops. Wheel input and the reading's keyboard navigation move its content. Meaningful navigation controls keep their pane's surface, while Send, Stop, Apply, footer actions and drawer choices keep the draft's action surface. Focus remains the marker and foreground.

Every shared column's body sits two cells in from its pane on each side: the Sidekick's chat viewport, composer and announcements; the Transcript's directions and retained reading; and the sidebar's Sessions and Entries lists. Each column's heading — the Transcript's band, the right pane's tab row, Sessions and Entries — spans the whole column, because a column says what it is across its full width, and the edge under a band spans it too. The gutters hold no text, are part of no row and are no part of any pointer target; they carry the surface of the column they are in. Bindings keeps its own layout, and the question and Configure drawers keep the whole pane.

Text is fitted to the body that holds it rather than to the pane above it, so a line too long for a narrowed body is paid out over more rows and the rows a window cannot hold are reached with wheel input or the reading keys. The narrow profile routes one outlet, has no shared column and is given no inset of its own.

Message Sidekick is drawn as a block: its name and focus marker on one row, and the message itself in the rows the pane's measured width cut it into beneath them. The name stays put, so you can still see what you are typing into while the text scrolls inside it. An empty message is one blank row. The value grows to at most six rows — the name is not one of them — and then shows its caret's rows. Moving the caret reveals the corresponding part of the value; text outside that window remains in the message. On a screen with less room the cap is smaller: the composer is measured with its label and one value row, and it grows only as far as leaves the chat a row. Growing it takes rows from the chat, which keeps following its own newest messages as that room shrinks.

Wrapping is display only. The message Send carries is the text you typed, with your own line breaks, blank lines and whitespace and none of the breaks the pane drew — and long words are broken only between graphemes. The block is one field throughout: one focus owner, one value, one Tab stop, and Enter and [send] mean exactly what they meant on one row.

A multiline paste remains one editable Message and starts no send, waiting message, entry or provider work. One deliberate Enter or [send] submits the complete value once, including text inserted at a middle caret. Pasting while a turn is running leaves that draft unsent when the turn finishes.

Control-C while Message has focus and holds any text, whitespace or several lines included, clears it: the value is empty, its caret is at the start and Message keeps the focus, so typing goes on there. Clearing is a Message edit and nothing else. The Draft and its takeover, a question's answer, the queue, the Sidekick's exchange and any admitted entry stay as they were. On an empty Message, Control-C leaves as it does everywhere else.

While the Sidekick is working the box stays editable, because composing the next question while a reply comes back is the ordinary case — and what was typed then is not sent by the cycle finishing. [send] offers nothing to activate while a cycle is in flight, [stop] is what is offered instead, and Stop joins only the Sidekick: an entry it already admitted belongs to the session and goes on running.

What the response is saying arrives as it is written. The literal <Output> of the source that has come back so far is shown in the chat as a preview, with nothing pressed to make it appear, and the same item becomes the reply when there is one. It is only ever what the agent has literally written: computed text waits until something computes it, an example in a fence is an example, and a prefix that cannot be read as a root shows nothing at all rather than source. Nothing of it has happened — no control has run, no entry has been filled, no turn is acknowledged — and a prefix that happens to read as finished is not permission to run it. The preview, the reply and every other conversation body are drawn as written Markdown.

An Output declaration can sit inside control flow or a scoped component. Its text waits for evaluation when an executable ancestor decides whether or how it renders: neither arm of an If previews, even with a literal true condition. Unconditional Output directly nested inside Output previews its literal text once. Passive examples stay literal, and unfinished enclosing syntax does not expose its nested declarations as top-level text. A complete conditional response can therefore be valid and have no preview text.

A preview stays a preview while the response runs its controls, and only the evaluated reply replaces it: actual Output, including the partial Output an ordinary runtime failure leaves, with the effects it performed before failing standing.

A reply that succeeded and selected no <Output> said nothing to the person, and the chat shows nothing for it — no empty row, no sentence about the absence and no bare name. It is not a failure and not an omission: running controls is the work, and its account of itself is the saved turn in Sessions and its own records. Its request stays where it is. A reply that failed keeps its recorded reason in the chat whether or not it selected any Output, and where it had rendered some, that text stands after the reason; a failure is a fact about the evaluation, so what is shown of it never depends on what the response chose to say. The turn a provider finished and whose evaluated reply nobody recorded is neither of those, and keeps saying exactly that.

Generation can also end without a reply. A provider failure leaves the attempt as this history saved it: the literal Output of what it had said, beside the reason it stopped, and none of its controls run. That attempt stays in the item its preview was in — one account of one failure, where the saved one takes the live one's place inside the row rather than arriving beside it. A conversation reopened later, which has no live row to keep, shows the same attempt as the turn it was. A Stop leaves what was on the screen as an attempt too, but claims nothing further — no turn, no acceptance, no reply and no recorded failure — and nothing of it is written down to preserve a screen, so a conversation reopened later has no account of it. A new message replaces whatever was left that way.

How far each reading is scrolled belongs to that reading, and to this process alone. Two bindings that happen to share a name in different scopes are two readings and keep two positions; a reading you come back to opens where you left it, bounded by what the window now holds; and a reading you have not opened starts at its first row. No location and no record carries any of it, so another process opening the same URL opens each reading at its start.

The form language a question is drawn in

A top-level string field marked writeOnly is presented as a password. Its entered text is absent from validation diagnostics and submit observations. The live resolver still supplies the original answer to Core. A correlated marked question with no capable ACP presenter is refused and withdrawn; closing or cancelling an unmarked presentation retains its existing pending behavior.

The child ACP path delivers the actual message and complete normalized schema. Standard requestedSchema preserves original field names and unconditional rules; visible text explains conditional requirements. Namespaced optional metadata retains the complete if/then schema for capable clients. Original Core validation still decides acceptance. An invalid answer reports normalized issues and leaves the same request pending; a fresh presentation can correct it. UI and ACP stale responses refuse after one owner resolves. A client without form capability sees the full question and a precise refusal, while the child keeps waiting.

A question's schema is read whole before anybody is asked. What this REPL draws is a closed object of string fields, each with its title, description, whether it is required, its minimum length and the exact enum values it accepts, plus at most one if/then condition that requires further fields when one field takes a stated value. A schema outside that language is refused by the provider, naming the exact path that put it outside — and the refusal has asked nobody, published no drawer and moved no counter.

Every answer is validated by the compiler that will judge it, so what the screen enforces and what the record accepts cannot disagree. An invalid answer keeps the question open with its issues under the fields they belong to. A field that was deliberately cleared is present and empty; one nobody touched is absent.

Cold Agent reconstruction

A cold process over a retained location shows the Agent work the history holds: the turns, their conversations, their text, how each ended, the questions that were asked and the answers that were given, the program a generated fragment admitted and what it wrote.

Work a packaged Component did on the entry's behalf is shown under that Component. A declared component's record retains the origin it is known by and the bytes it is, so the scope every effect inside it is recorded against is the one the history already describes — and the program that Component returned is a scope of its own beneath it, owning the questions the program asked, which carry a place in the generated source and no path at all. A turn whose provider failed or was cancelled restores with the text it had streamed and the status it ended with, as terminal retained state — never as queued, streaming or reconnecting.

No provider is reached to do it, no adapter is materialized, and nothing is appended: the history file is byte-identical before and after a cold run.

How this command ends

A connected child UI ends with [detach], terminal EOF or connection loss. Each joins its UI readers, terminal modes, rendering, frame demand and exclusive lease. The parent-owned root and independently admitted work continue; reattachment shows current state without replaying acknowledged effects. In the owning parent, <XMD.Session.Shutdown sessionId={child.sessionId} /> stops the exact child and returns after actual root, socket and process cleanup joins. Ending the parent performs the same cleanup. Unknown/ended IDs refuse. Cold retained-history opening is a separate operation and does not reopen an ended resource.

Parent registration waits until the child's root, exact selected Sidekick conversation and private endpoint are ready. Before that transfer, creator cancellation joins startup rather than leaving an unregistered child alive.

Activating [exit], pressing Control-C, Escape on the too-small refusal, EOF, a renderer that cannot present, a terminal that fails mid-read and a cancelled command scope all end the same way: the owner cancels and joins every Prompt, provider task, pending permission operation, observer and frame subscription it started, appends nothing after that, and gives the terminal's modes back exactly once. Work that was interrupted leaves no record, because a record for it would be a record of something that did not happen. What was already appended stays readable, and is what a cold process shows.

One chord ends it, and it is the only one: Control-C. Raw mode clears ISIG, so no signal reaches this process and the byte is the whole of the notice — which is why dropping it with the other chords left the reflex every terminal program answers doing nothing, and saying nothing about why.

The one place Control-C means something else is a focused Message that holds text, where it clears the message and the command goes on. Everywhere else no mounted control handles the key, and the command answers it as leaving: ending is a lifecycle outcome its owner decides. That includes a Message holding text behind a drawer or on a reading that is not shown, because it does not have the focus, and an attached child UI, where leaving detaches it as [detach] does. A burst that clears and then leaves acts on nothing after the leaving keystroke.

Control-C therefore leaves both screens a running command can be sitting on, and they are not the same screen: the refusal below the minimum size, which places no control at all and offers Escape besides; and the one shown for a location this command cannot show, which does place a control. Before the first frame is presented there is no focused Message, and Control-C leaves.

A stopped cold restore offers Retry, Show error details, and Quit when the terminal fits the controls. Retry joins the failed passive read and starts a fresh attempt for the same location. It resets the count and diagnostics and checks the retained history, publication and applicable project consent again. Plugin assembly and live admission keep their existing failure outcomes. The details view shows the safe diagnostic in a scrollable reading. Escape from details returns to the stopped count.

Quit or Escape from a stopped restore joins input and gives back the terminal before reporting the same diagnostic on stderr. It exits nonzero without a reopen command. Leaving during restoration joins the active attempt and prevents a live frame from that attempt. The history refusal remains whole, including when part of the journal projected before the failure.

[exit] stays on the action row regardless, because leaving has to be a control a person can see rather than a key they have to know — and because a pointer reaches a control and reaches no keystroke.

Leaving takes no further keystroke. The terminal's bytes arrive on a stream the command owns, and releasing it cancels the read it was holding rather than asking the terminal to finish one: a release that waited for the next key would make leaving cost the very thing the person has stopped doing.

The terminal-input resource arms release before acquisition can suspend. Release actively cancels and joins the outstanding native read, is idempotent, and leaves no reader, listener, task or unsettled promise behind. EOF closes the stream normally; read failure is a terminal failure; owner cancellation is neither an EOF nor a read failure.

The location it prints is the one it was showing, minus the drawers only a running process could have mounted: a waiting question and a pending request are in no history, so a location naming one is a location nobody could reopen. Everything a second process can reconstruct stays — the history position, the surface, the selected entry, the conversation filter and the draft.

What the screen does at each size

terminal what it shows
160x36 and larger an identity row; Transcript (36 columns), selected work or its Round editor (54 columns at this width), and Sidekick (70 columns); the drawer layer; the round bar at the base of selected work, followed immediately by compact History on the last row
120x30 and larger the same three columns, with widths of 24, 40 and 56 at this size
72x20 and larger One full-width routed surface below Sessions, Entries and Sidekick. History is the final row. The Entries round bar and Sidekick's compact selected-entry row, when present, are directly above History. The identity header shows execution status across all three outlets.
smaller than 72x20 a refusal saying the minimum, that growing the window recovers, and that Escape leaves; it shows nothing else, and offers no control to point at

The Transcript on the left is the agent work this execution has, read as requests and replies, as one list: the entry agents' turns and the Sidekick's in the same list, neither of them under a heading of its own. Each row says whose work it is and which conversation it was in, which is how the two owners are told apart here — they keep their own authority and their own recorded order, and one displayed list does not merge their histories. A recorded successful turn has no status suffix in the Transcript. Queued, streaming, unrecorded, failed, and interrupted turns keep their status. Output previews start at the first nonblank line. Entry output and Sidekick replies omit leading blank lines on screen while preserving indentation, internal spacing, and recorded output.

An addressed Sidekick exchange keeps the person's message and the explicit Output from its saved replies. A control result or entry result that reached a completed receiving turn appears as a separate [X] row. The association comes from the response and request records. A queued person's message keeps its own request even when the same prompt delivers earlier feedback.

Activating a feedback row opens its details over the centre pane, or in a lower drawer on the narrow Sidekick surface. Show recorded feedback reveals the complete input recorded for the receiving turn. A combined input is shown as one packet, including any queued message it carried. Hide recorded feedback collapses it. Linked entry selects the admitted entry when the current history contains it. The feedback details summarize that entry's recorded outcome and output before the expander. An addressed reply shows the exchange's linked entries and Output above Saved turns. A selected turn shows the entry it admitted, its own Output, and its retained origin. Its row is marked this turn. Turn labels wrap at narrower widths and include their usage when enabled. Escape and the close control dismiss inspection. The selected work and Draft focus shortcuts close a centre inspection and reveal their requested controls. These readings can be opened again after reopening the execution.

The All sessions selector at its head is the filter for that list. It is a control: activating it shows the conversations this reading holds — the same choices Sessions offers, each named by what the provider actually opened — and choosing one leaves only that conversation's rows, whichever owner did them. All sessions brings them all back. The choices are put away again by choosing one or by activating the selector a second time, and putting them away chooses nothing.

The selected work in the centre names the entry and the scopes you are reading as breadcrumbs, with the way to the Entries catalog in front of them, and shows that entry's exact source, its execution state and its results. Every name in that trail except the last one is a way back out to it: the reading is already at the last, and choosing an outer name leaves the reading there with the scopes beneath it no longer selected — the same thing choosing that scope's row in the catalog does. + New Round replaces that reading with an inset, outlined Executable Markdown editor and a round bar at the bottom. The gold Round n · draft heading names the next round after the most recently admitted round, even when an earlier one was selected. At 72×20, New Round opens the Entries view first and shows the gold heading above the focused editor. At that size, focus on Send removes the heading and its key guidance from the frame and gives their rows to the editor. Returning focus to the editor restores them. The editor fills the available space above the round bar. When the draft is empty its first interior row shows the muted Executable Markdown placeholder. The Sidekick conversation and unsent Message remain available.

The bar shows ✎ draft, Send and X. Send is dim and admits nothing while the draft is empty. X discards the draft and returns focus to + New Round. A refused submission leaves the text in the editor. When Send admits a round, the live work replaces the editor and the bar shows ● running · user and offers Stop for that exact round while it runs. History highlights the draft with ✎ while the editor is open and shows the running round with a spinner glyph after admission. Unfiltered Transcript shows the round's ── Round n ── separator alongside the conversation rows.

The right column opens on Sidekick. Its tabs are Sidekick, TODO, and Bindings. With open tasks, the TODO label includes their count, as in TODO 2. With zero open tasks it reads TODO. The TODO tab shows the shared checklist in the reading area, with Message and its actions below. Bindings is available at the two three-column sizes.

Follow starts checked and keeps its live setting across rounds, navigation and resizing. Send stays available beside Stop during an active exchange. A held queue shows its reason and offers Resume queue beside the other fixed actions. When the actions cannot fit one row, each control stays whole.

A new Sidekick reply failure in the active conversation opens a notification without moving focus. Uncertain automatic feedback uses its existing inline recovery controls. With Sidekick visible, it sits one cell inside the right edge below the Sidekick header and spans 52 columns in a three-column frame. In the narrow Sidekick outlet it leaves one column on each side. The notification includes a short diagnostic and offers Retry while the saved request is still eligible. Escape or X dismisses it. A modal takes precedence while open. The notification has no timeout. The conversation keeps the failed reply and its diagnostic after dismissal, and the Sidekick header shows the failed status until the next turn. Dismissal and retry presentation belong to the current process, and reopening a saved failure shows its record without a notification.

While messages wait, a list above the composer shows the notice Waiting messages are kept only in this REPL. and the messages in admission order. Each message shows its origin, text and X, accessible as Remove message. X withdraws its exact still-pending message. The list and notice collapse when the final message leaves. The queue has no tab or count.

At 160, 120 and 72 columns the queue shows up to five, four and three fitted rows respectively, as constrained by the available height. Overflow scrolls within the list. The notice shows ↓ more while later rows are below it and ↑ more at the end when earlier rows are above it.

Message is the fixed entry of its keyboard region. Follow, Send, Stop, Resume and the vertical group of pending X controls belong to that same region, adding no Tab stop. Local navigation reveals a hidden neighbour before focusing it. Wheel scrolls only the queue viewport, preserves focus and stops before hiding its focused X. Fixed controls stay reachable during overflow. Background queue changes request no focus and change no drafts, selection, History, filter or route. Existing modal ownership contains the queue controls.

The accepted 160x36, 120x30 and 72x20 compositions retain their geometry, colour, focus, caret and wheel contracts. Follow uses the existing measured header and input region; an inactive narrow outlet offers no Follow target.

Resizing the window is ordinary. Dragging a corner produces a stream of sizes, and each one redraws the screen for the size that is actually there: the execution you are in, the surface you are on, what you had selected and what you had typed all survive it, and none of it ends the command. A size this REPL does not support shows the refusal above and recovers when the window grows.

At narrow, the outlets the route did not select remain in the model and are not on the screen: it is in no cell, in no target map, and no pointer reaches it. What stays is the way between them: Sessions, Entries and Sidekick are on the narrow surface bar, because a screen you cannot leave is not one this route may put you on.

The narrow Tab cycle is Surface bar -> routed content -> composer when present -> History. The bar enters Sessions without selecting it. Explicit Sidekick selection reaches Message when available; Bindings is absent. If resize removes focus, recovery enters surviving routed content, then the bar. Widening retains the surviving destination. Below 72x20 no controls are mounted; recovery uses the routed content's fixed entry and then the bar, without activating either.

A narrow frame has no inspection column, so the bindings and the recorded questions are not on it in any sense — not drawn, not something a pointer can reach, and not a stop Tab or Shift+Tab visits. What a wider window shows there, the narrow one does not pretend to offer. Answering a question at that size therefore leaves you on the entry the answer belongs to, which is a control you can see, and the catalog moves as far as it has to for that entry to be showing. Which entry and which scope you had selected does not change, and a wider window shows the record itself again.

The location is not on the screen. It is the longest thing this command could draw and the one thing a reader never has to act on while they are reading, so no row carries it and none is kept for it at any size. When the command ends it prints the whole xmd repl <location>, under one line saying that is what reopens this view: a person who has just had their terminal handed back wants something they can run, and the screen that would have explained it has gone. The command is indented rather than marked, so the line stays exactly what can be pasted. The location is quoted, because it carries ?, & and = structurally and a shell would read them — and single-quoted safely, because every character outside [A-Za-z0-9-._~:@] is percent-encoded, so a location can never contain the quote that would close it. Source text, provider output and an event's own origin are content and are shown as written, URLs included.

History is one compact row at every size: its name, one mark for each entry in admission order, the head's own state, and the controls that are available now. It is a map of the whole recorded order, which is the one thing on this screen not read at the selected prefix. The positions after the selected one are where a reader can go next, so a map that stopped at the selection would be a map of the part of the file they had already reached. What crosses is a marker and a kind per position, and nothing of what any of them holds: an entry inside the selected prefix shows the outcome it had reached by then, and a later one shows only that it exists.

An entry's mark is a way to go to that entry, not a checkpoint. Every exact retained position — an entry's and every minor one between them — is still reached through the History drawer, so a compact row never costs a reader a position, and [live] returns from any of them to the head. The selected position keeps its own surface and the head its own colour, so the two can sit side by side.

The map and the content are one reading, taken from one acknowledged array and carried together through the frame. Nothing on this screen pairs a prefix with a map the file no longer has: a record retained while the terminal is being measured changes the next reading, not half of this one. Where that reading cannot be built at all, because the file holds a record this process can no longer read, the whole screen is the refusal — not a map standing beside a prefix that still looks plausible.

The contextual controls sit at the right of the History row, side by side, each as wide as its own label so a pointer on one reaches that one. Order is priority: a control that will not fit whole is not drawn at all rather than drawn half off the row. It is not there in any sense — not a cell, not something a pointer can reach, and not a stop Tab visits — because a control you can neither see nor hit is worse than one that is honestly absent. The controls it keeps are the first ones in that order, without exception: where a wide control will not fit, a narrower one after it is left out too, so the row you read at one size is a prefix of the row you read at a larger one and nothing moves under your hand.

Every row says what it has room to say. A row is as wide as the region the frame measured for it, and so is its text: a name nobody bounded — a prompt, a root, a tool call — is shortened with an ellipsis so that what the row is about stays on it. A turn keeps its state, a retained grant keeps its outcome, an entry keeps its outcome, and where a row is too narrow even for that, the fact survives and the name keeps whatever is left in front of it. What the row shows is shortened; what the product holds is not, and the whole of it is still in the record, the transcript and the drawer that shows it.

What fits is measured rather than counted. The screen asks the terminal how much room each region actually has — with every scrolling list empty, but with the headings, fixed actions and the complete labels in place — and only then decides which rows and which controls exist. So what you can see, focus and click are the same set, at every size, and a row the frame has no room for is never described as though it had somewhere to be.

Execution action refusals use the identity header. Field refusals stay with their fields and Sidekick notices stay in the Sidekick pane. History is the last row and follows the round bar directly whenever the bar is visible. History keeps its existing map, head or frozen-position label, and admitted actions.

What the screen says the execution is doing

The identity header shows execution readiness and any action needed to proceed, using compact wording at 72×20. Reserve space for the meaningful state and next action before fitting the session identifier. Keep the usage control reachable. A visible execution action refusal appears within the header, wrapping at the measured width as needed. Keep readiness visible during a refusal. The refusal gives the reason and any available recovery. When the refusal exceeds the header's available rows, the header shows which rows are visible and wheel scrolling over the refusal reveals the remaining rows without moving focus.

Readiness is read from the file and from this process together. The durable side cannot answer it alone: a root close is recorded the moment a document settles, while the task that produced it is still coming down, and a submission taken in that window has nowhere to go. So there is a state between "settled" and "ready" — the close is retained, the entry's task has not been joined, and no successor may start yet. It resolves without anybody typing: when the teardown finishes, the header says the next entry may start.

The states a person can tell apart: no entry yet; an entry running; an entry waiting for an answer; an entry waiting for a permission; an entry whose close is retained while its teardown finishes; an entry admitted that never reached an outcome, which no successor may follow; and a settled execution ready for the next entry. A frozen position is its own state and says so before any of them.

A refusal that was only ever true of a moment stops being shown. When the readiness refuses a submission it says why, keeps the draft exactly as it is, starts nothing and appends nothing. When the entry it named finishes, that refusal goes rather than contradicting the sentence above it. A document that cannot be admitted and an answer a schema rejected are refusals of the thing itself: they stay until the thing changes, and the schema's complaint stays under the field it is about rather than with execution readiness.

The session marks readiness refusals when raising them with a namespaced, nonenumerable own property carrying its normalized sentence. Across loaded copies, the screen obtains both classification and displayed text from that same mark, never from a writable error name or an independent member.

A failed entry says what it failed with. The reason the Journal recorded is drawn beside the compact outcome, on its own row, flattened to one line and cut to the region it is drawn in — the whole of it, introduction included. A reason is whatever the thing that failed said, and what failed may be a compiler; the unbounded text stays in the file, which is where something unbounded belongs. An entry that did not fail is given no failure text.

A waiting permission is announced, not taken. Permission belongs to Sessions. A request arriving while another surface is being read says that it is waiting and where it is answered; it moves no route, opens no drawer, takes no focus, and changes neither the selected entry, the conversation filter, the draft nor the history position. The control that answers it is the one Sessions already had.

A frozen position says what it cannot do. It begins by naming itself, states that submitting is unavailable there, and offers the way back to the head as a control on the screen. The live head's status does not reach it — not what is running, not what is waiting, not what could be paused — because a prefix is a reading of the file and the head is not part of it. The draft belongs to no position and is unchanged.

None of this is retained. The status, the guidance and the emphasis are computed on the way to a frame from the resolved view; they are in no location member and no record, and replay neither produces nor consumes them. A cold reopen shows the same state because the file and the location say the same things, not because anything stored what a previous process was displaying.

What the emphasis says

Every row of this screen is drawn as the thing it is. What a run produced stands ahead of the facts about the events that produced it; an entry that closed ok, one that closed err and one still running are three different readings rather than three spellings of the same one; a question nobody has answered yet reads as waiting; and a retained position reads as history until you return to the head. A drawer says which kind of reading it is showing before it says which one — a binding, a recorded answer, a permission request — and separates what a field is called from what it means from the value you are editing. Whatever acts carries the same surface wherever it is, in a drawer or in the footer, so you can tell what you can press from what you can only read.

The columns are told apart by more than what is in them. Each pane carries its own surface across every cell it holds, a continuous one-cell rule parts it from the column beside it, and a pane with a title draws that title on a surface of its own — so the band naming a column reads as the chrome above a reading rather than as the first line of it. The rule between two columns and the rule that closes a header or opens the footer are different readings and are drawn differently. A header's own edge is a row of the screen, taken out of the band the title sits in and measured there, so a column with a title holds one row fewer of its reading than a column without one — and the footer keeps readiness and compact History at every supported size, because that edge is the header's and not the footer's. None of this is needed to operate the screen. Where focus is, what the execution is doing and which of the two inputs you are typing into are each said in text as well, so a terminal that ignores colour loses nothing you need. The two pane tabs are the one exception: which of them is selected is their styling, because the heading of the reading you are looking at should not also spell out that you are looking at it. Which reading is showing is legible without colour from the pane itself — the Sidekick's body is the box its messages are typed into, and Bindings has none.

The focused control has a distinct background across its measured width and a bold, underlined label. A focused selected row has its own background and keeps its selection marker. As focus moves, a selected row returns to its selected background. The focus cue is the same after Tab, Shift+Tab and a direct shortcut.

Source and JSON are read character by character. In a draft, in a read-only source row and in the source a question shows you, a heading, the characters that open and close a tag, a tag's name, an attribute's name, a quoted value, the braces around a reference and what the reference names are each drawn as the thing they are; and a binding's or a recorded answer's complete value shows its keys, its strings, its numbers, its booleans, its nulls and its punctuation apart. Reading is all it is. Nothing is validated, evaluated, rejected or rewritten, every character you typed is still there — a half-written as="ans included — and anything the screen cannot classify reads as ordinary source. Nor is anything guessed at: a value is read as JSON because this product serialized one, not because some text happens to begin with a brace.

A reading of this screen with the colour thrown away loses nothing it needs. An outcome is spelled [ok] or [err], a selected row keeps its *, a focused control keeps its >, the round bar says draft while the editor is open, and every state the emphasis distinguishes is also said in words. The emphasis is how the screen is read quickly; the text is how it is read at all.

Sequential entries, and nothing else

One execution admits entries in submission order, one at a time, into one append-only journal. There is no concurrent entry, no submission queue, no fork from a history position, no renaming, deleting, reordering, importing or exporting an entry, no snapshot and no sidecar file. Two processes writing one execution is unsupported. Before appending each entry record, the writer checks the journal against the acknowledged file identity and bytes and appends through the descriptor it checked. A detected change or unreadable historical range refuses further readings and appends in that session, including appends from an entry already running.

An entry's segment begins at its root import_component admission and ends at that root's Close; only the final segment may be unfinished. Before projecting any entry, the whole acknowledged prefix is partitioned and validated. Work before admission, nested or repeated admission in an unfinished segment, a Close without an open segment, work between Close and the next admission, a second unfinished segment, or a segment the entry reader cannot parse refuses the model whole rather than yielding a partial catalog.

Each execution receives a private view of exactly its segment. It delegates appends to the physical stream and advances its acknowledged state only after append acknowledgement. A closed or nonfinal segment cannot write. Repeated root names and coroutine IDs therefore cannot correlate across entries. The CLI owns the range and marker conversion; core receives no physical offsets and DurableStream gains no physical-offset API. Later entries namespace their segment-local markers by entry key; the first entry's existing marker spelling stays unchanged.

A retained file operation's name is the digest of record version, operation kind and complete authored request, without filesystem canonicalization for naming. Equal requests share a name and are distinguished by durable-engine position within that entry's segment, never by searching names or adding an entry label to the record.

The Sessions surface presents the Agent work every entry did, in its own Entry agents section, and an execution with no Agent work has one that says so. The Sidekick section beside it is that execution's chat history, which is not entry work and has no entry position.

What this process is doing, element by element

While an entry runs, the screen can say where each element of it has reached: entered, active, waiting, exited, and then settled, failed or cancelled. An element that has returned stays in exit while its own cleanup runs, because that is where it is — a component with a destructor has not finished until the destructor has.

Waiting is counted, not guessed. An element waits when something it is actually waiting on says so: a question nobody has answered, a permission request the turn that asked for it owns, a hold the expansion controller is keeping. A request nobody answers releases its wait when its scope goes, and decides nothing on the way out. Each of those removes itself when it resolves, opening and closing a drawer changes none of them, and ordinary suspension is not waiting at all. Two questions at once are two waiting elements rather than one screen that is busy.

All of it is this process's, and none of it is written down. A cold process reconstructs none of it, a reading frozen at an earlier position shows none of it, and an entry that finishes takes its own with it. Source that is still on the screen and a record the history retained prove only that something was written and something was recorded — never that anything is running now.

One entry, read as output and then source

Marked input is projected before command bytes enter the entry’s output buffer or undergo control escaping. The producing entry owns that privacy operation through provider cleanup after root Close and through Stop/join, preserving channel routing, selection and drafts.

The transcript pane holds one entry's reading: what it produced, and then the source that produced it. A narrow frame has no transcript pane; its one routed Entries outlet holds the catalog and the reading of the entry the catalog has selected — the same two things the sidebar and the transcript are at a wider size, stacked because there is one column for them. The catalog takes its own height while it fits and its share when it does not, and the reading takes what is left. The two share one vertical window, so going from an answer to the reason for it is one movement rather than two panes to reconcile. A reading belongs to an entry; with nothing selected it is the last entry the prefix admitted, which is what a one-entry execution has always shown.

Output says which of four things is true, and never two of them. Text still arriving is Output · live. The retained final result replaces it once and the label becomes Output. A root that settled having rendered nothing reads No rendered output. and then the outcome it closed with, and a recorded reason beside it. A prefix that retained no output for its entry reads No entry output recorded at this checkpoint. — never text borrowed from a later position or from a run still going. Output text is drawn as written Markdown.

Which of those is shown is decided by what the record says, not by the words in it. A document whose own prose contains failed is still output; a root that closed err is a failure whatever it rendered. Nothing is attributed to an <Elicit> or a <File>, reconstructed by concatenating block results, or invented as a receipt for a bound value that emitted nothing.

Ordinary exec stdout and stderr stream into the producing entry's reading as Command stdout and Command stderr, between Output and Source. The channel labels follow received order. Long lines wrap in the same scrollable reading; blank lines and partial lines remain readable. This presentation is separate from rendered document Output: forwarding adds nothing to the root result. Bound commands display only what the document explicitly renders, a <Let as> capture still hides stdout, and silent exec displays neither channel.

Command text is inert before measurement and drawing. LF separates rows; other C0 controls, DEL and C1 controls appear as ASCII \xNN escapes. Cursor motion, clearing, OSC and terminal mode sequences therefore remain readable text. The same conversion applies to rendered Output, including explicit interpolation of captured diagnostics and saved output. It changes display copies only; captured values, retained channel strings and source bytes remain intact.

Source is the exact text the entry admitted. Beside each row is a rail saying which region the row is in, and against the pane's right inner edge is the reading of the element that owns it — glyph and word together, so the reading survives a reader who cannot tell two of these colours apart. Only the first row of each delimiter carries one: a tag written across several rows is one element, not two phases.

Nesting comes from where the delimiters are, and from nothing else. An element whose span lies inside another's is that one's child; one that merely follows it is its sibling.

A document that writes one element inside a <Loop>, or writes the same element twice, makes several calls of it at one position. Each is its own reading, in its own group, in the order they were observed: showing only the last would say the earlier ones never happened, and one badge for all of them would say several calls were one. An element nothing was observed of is read once, unobserved. Source nothing has been observed in gets the rail that means exactly that, and acquires no phase from retained syntax.

An <Evaluate> that admitted a generated fragment shows that fragment where its producer was written. The enclosure bytes stay exactly as authored and only what they enclose is replaced, so the tags a reader sees are the ones in their file; a self-closing one keeps its row and the fragment sits underneath it. The fragment keeps its own offsets, because those are the only ones its own recorded positions were ever counted in. A refused, absent or ambiguous admission keeps the producer: nothing is matched by name or by sibling order.

Replacing what is displayed rewrites no submitted source and no record.

Written Markdown in Output and in the chat

An entry's rendered Output and a Sidekick conversation body are drawn as the Markdown they were written in, by one display rule. In the chat the rule covers a person's message and the Sidekick's preview, reply and unfinished attempt. The speaker, origin, status and gutter in front of a body are not part of it: the body is formatted first, so a heading or a fence can begin on its first row.

A heading is drawn as its text in the source-heading style. Strong text is bold, emphasis is italic and a link is underlined, each in the colour of the text around it; inline and fenced code take the code colour. An ordered item keeps the number it was written with, a bullet is drawn as •, and an item's further lines and nested items are set in under its marker. A task item's marker, its [ ] or [x] and the start of its text share one row, tight, loose or ordered. A link shows its label and nothing of its target: the target is not drawn, cannot be activated, and reaches the terminal as no hyperlink or other control sequence. A reference is a link only where the body defines its label, and a bare web or mail address is a link drawn as written.

An emphasis run of more than 256 consecutive * or _ characters stays literal. An inline section with more than 1,024 of those characters in shorter runs draws its emphasis markers as written. Other inline constructs in the section keep their formatting.

A fence is drawn line for line. Its delimiter rows stay, as punctuation, and its payload keeps every indentation, blank line and line break, with any Markdown inside it left unformatted. A fence that has not closed holds everything after its opening row, and indented code is drawn the same way. Raw HTML, a component-like tag, a table, an image and a delimiter that never closed are drawn as the text they are. Each written line stays one logical line, so text with no Markdown in it is drawn line for line in the body's own style, and the measured wrapping in Everything on this screen was measured fits every row.

The command-text conversion above makes every displayed run of both bodies inert before the Markdown is read, so a carriage return cannot become a line break and a control sequence stays readable text.

Formatting changes display copies only. It draws exactly the body its owner supplies — the selected live or retained Output, the admitted preview, the evaluated reply, the saved message — and adds or removes nothing of it. Retained Output, saved messages and replies, their raw inspection and copy routes, and every read keep that body exactly as it was supplied, link targets included. Evaluation can make a reply differ from the source the agent wrote, and settlement can supply computed text the preview never held; each stage is drawn from its own body, and the same body is drawn the same way at every stage. A cold reopen draws the retained body. Source, command stdout and stderr, recorded feedback, title and headline previews, an entry's work rows in the chat, the Draft and the composer keep their own presentation.

A body is read again only when its text changes. The selected reading and the chat each hold the bodies their latest frame drew, so a Draft or composer edit reads none, and a streamed delta reads the one reply it changed. A body that changes, closes or leaves the view is let go at the next frame.

Everything on this screen was measured

Measurement and committed presentation both omit retired window controls; their former rows become viewport capacity. Ordinary composer edits reuse stable chat and Transcript preparation. The measured windows select their rows before descriptions are made.

No text is clipped and none is estimated. Every width is an answer from the engine that will draw it, asked through a probe that draws nothing, and every break is at a grapheme boundary — a UTF-16 code unit is not a cell, and a cut between a character and its combining mark makes two rows neither of which is a character.

A line too long for its region is wrapped at the last word boundary that fits, and a word longer than the region is broken at the longest grapheme that fits. Whitespace is kept where it was typed, blank lines stay rows, and concatenating one line's rows recovers exactly the line. A continuation is set in to the column its own line was written at, so a wrapped line is still read at its own depth; that indent is display, and no source byte or offset moves with it. The rail, the gap after it and the status column are reserved first, from measurements rather than character counts, and the column is wide enough for every reading a badge can hold — including a cleanup wait, which says two things at once — so an element settling cannot reflow the document beside it.

The Round editor keeps each source line on one row and scrolls it sideways to reveal the caret. Measure the outline and inset as part of the pane. Fit the source and caret to the remaining interior width and height. The empty placeholder occupies the first interior display row and changes neither the source nor its caret offsets. A queued message wraps between its origin and its X, and its continuation rows line up with its text: a wrapped row is the same message, never a new one, and the X stays one control on its first row.

A question's own read-only preview is measured the same way, at the width its drawer was given. A drawer row is one row, so a line left unwrapped has nowhere to put its tail and the window has no second row to scroll to — reaching the decisions below it is not the same as having read what they decide.

A region with no room for even one grapheme is the frame refusal that already recovers on resize. It is never a clip: shortening somebody's source would be this screen editing the content it exists to show.

What is retained, and what is not

Protected input has no retained plaintext representation. Public bindings, command facts and feedback contain safe views or field receipts. Cold inspection remains passive and starts no provider or command. The feature adds no second retained output log.

Include directories configure the current command. They add no location member, manifest or profile record; pass them again when reopening if new work needs them. The location remains route state, and existing events retain past work.

Each execution is one file of serialized ordinary DurableEvents — the same records any other XMD run writes. There is no manifest, no cache, no materialized model, no checkpoint file and no record type of the REPL's own. The file and the location are the whole of the state, which is what makes reconstruction from them possible at all.

Forwarded command presentation belongs to this process and the entry that produced it. It remains available after that entry joins, but a frozen history position shows no process-local command presentation. Cold viewing reads the existing entry-owned exec records, including stdout, stderr and exit status; it starts no command and reconstructs no visible output from hidden or bound records. No additional output log is retained.

The location carries route state only: which surface, which entry and scopes, which drawers, which history position, the draft for the next entry, which reading is selected, which right-hand pane was being read and which saved Sidekick chat is being read. Those members are independent — a location names a selected entry on either surface, beside a drawer stack, a conversation filter and a frozen position, so going to Sessions to follow a conversation and coming back returns you to the entry you left. The Sidekick's two are independent in the same way: view=sidekick names it as the reading while the surface underneath stays selected, right=bindings or right=sidekick retains the pane, an omitted view selects the surface itself and an omitted right means the Sidekick — so a location written before either existed still names the view it described. sidekick=<saved-chat-id> is the third, and independent of the other two and of session: session names an actual provider conversation and filters the Sessions list, while sidekick selects one saved CLI chat to read. Omitting it follows the current chat; an explicit identifier has to name a chat this execution's readable Sidekick history actually holds, including one whose setup was only prepared or failed and has no provider conversation at all. An unknown identifier is refused rather than answered with the current chat, a missing or unreadable chat history keeps its own storage refusal, and an execution still held in the older single file has no saved chat to select and is not upgraded by being read. It grants no provider or execution capability: a stored location is no right to continue an old conversation. It is encoded after every member that was canonical before it, so a location written before it existed still comes back out spelled exactly as it went in. A fresh ordinary REPL opens with focus in Message when the composer is available. A narrow frame reveals Sidekick for that initial focus. An opening dialog keeps its focus. An explicit location opens the reading it names. The pane shows one of its two readings at a time. Only the visible reading contributes cells and focus targets. Activating the Sidekick tab focuses Message when available. Selecting the Sidekick sets both and changes nothing else; selecting Entries or Sessions clears the reading and selects that surface; selecting Bindings retains the pane and puts the saved surface back. Each of those keeps the selected chat available for returning to. Resizing rewrites none of them. It never carries focus, pause state, how far a window is scrolled, form internals, rendered cells, this process's overlay, or the Sidekick's own question and Configure drawers, which belong to the process that is asking. A copied location restores the chat somebody selected and promises no row of it.

view and right use their closed location grammar: unknown, empty or repeated values refuse before layout interpretation rather than surviving as arbitrary strings.

The files an entry wrote in the checkout you are standing in

Mapped File reads retain their composed values even outside checkout/session coverage. Continuing the same unfinished entry restores an acknowledged value without reading or rewriting the original source. Reassigning an unchanged TARGET to another distinct, unaliased source leaves that value historical and routes the next new read to the current source. Omitting the pair leaves the saved read historical and routes new work to ordinary host placement. A fresh entry reads live; there is no cache by path and history restores no missing pair. An enclosing unrecorded ensure may execute or refuse on continuation.

A prospectively associated mapped ensure already covered by the existing recorder restores its own acknowledged Unit or ordinary refusal under source reassignment. Replay independently validates authored occurrence and every operand before original binding and physical result. Unit permits current-placement children without ensuring or proving the new folder exists; refusal permits none. Omitting that ensure's TARGET is unsupported. This adds no ensure coverage and no saved outcome for unacknowledged work. A separate current ensure is new authored work, not insertion at an old slot. Legacy physical-only history remains physical; malformed or inconsistent association refuses before live work rather than falling back. Current paths still require provider permission, actual containment and disclosure checks.

The closed repl_mount_file/v1 association for a mapped read or already-covered mapped ensure contains the independent authored occurrence, form and operands, original binding, existing physical result and original coverage. Replay checks the authored expectations before original physical attribution; admission and replay both validate the original component conversion, physical fingerprint and result. Only the engine consumes a slot; abandoned replay authorizes no live fallback.

Canonical read/ensure calls enter the shared recorder directly. Its live continuation collects the ordinary Files chain in the invoking scope, excludes only its own registration, and preserves every other middleware, terminal, Context change and resource lifetime inline. Completed replay collects none of that chain. Raw calls use the same recording body and validators, and an uncertain append establishes no saved value or Unit.

Start the REPL inside a Git checkout and an entry's file work is retained too, under the ordinary physical records. The prospective mapped class above uses its closed association record. The physical records keep a self-closing <File path="…" as="…" /> text read; a paired <File path="…">…</File> write, after its content has expanded; a self-closing <File.Delete path="…" />; a self-closing <File.Copy from="…" to="…" />; and the directory a paired <Dir path="…">…</Dir> ensures, before its content is entered. The reads, writes and deletions an admitted <Evaluate> fragment performs are kept on the same terms, because a fragment's operations go to the same document filesystem an authored one does.

A copy uses the physical record even when its working directory came from a mount. Each entry numbers received copy calls from zero within each durable coroutine, counting uncovered, refused and synthetic calls. The copy record and name carry this ordinal. Its fingerprint binds the ordinal, the received working directory and both ordered operands. Admission requires strictly increasing nonnegative safe integer ordinals per coroutine and accepts gaps. A copy record requires an ordinal.

After restoring any pending ambient selection, an equal ordinal offers the current fingerprint to the durable matcher before live work. A changed operand at that occurrence diverges, including when the new destination is uncovered. A lower retained ordinal fails before live work. A higher ordinal stays pending while the current call takes the live path. Acknowledged Unit and ordinary refusals restore before Files composition or target observations.

The host routes each live delegation by its effective resolved operands after authorization and containment. The destination's resolved parent and final entry determine coverage. Both managed operand slots precede the destination checkout's mutation hold. Owned-root coverage requires no Git lease. A covered dispatch cannot insert an outcome ahead of retained history. The outer recorder publishes the final composed answer after settlement when at least one dispatch reached covered storage. Uncovered and purely synthetic calls have no copy result. If native copy completed before an unacknowledged append, a continuation attempts the operation live. An occupied destination then produces an ordinary refusal with its bytes intact.

What that buys is the one thing experimentation needs: leave an entry at a question, come back to the printed location, and the work it already did is not done again. The question is offered again, and the write after it happens for the first time when you answer.

Every existing restoration branch precedes current policy, canonicalization, discovery and holds. A genuinely new absolute directory request checks write and absolute before targetOf, managed ownership, live selection, holds and workspace canonicalization. Early refusal discovers no coverage and appends no new file-operation record; normal enclosing failure recording remains. Permitted work uses the complete composed chain and the terminal independently checks the final transformed request. Retained keys, associations and prefix bytes are unchanged.

A completed operation answers from what it produced, and reads nothing. So a file somebody else changed in the meantime stays changed, a file somebody deleted stays deleted, and a checkout you have since moved or removed does not stop the entry continuing — only a new operation needs the checkout to be there, and it fails or succeeds exactly as it would have the first time. The honest cost of that is one window: work can happen and its outcome can fail to be recorded, and a continuation then does that one operation again. Work that was recorded before you left is answered from the record, so an edit somebody made in the meantime survives the continuation untouched.

A retained read is the same rule, which is worth saying plainly because its answer is a value you can see. The binding a completed read produced is the text it read when it ran: a question showing that binding still shows it after the file has changed, because nothing re-reads the file to answer an operation that is already done. Type a new entry that reads the same path and it reads what is there now. What is retained is each operation, not a value the session remembers for a path.

Except for selected mapped reads, any of the four anywhere else — beside the document, in a temporary directory, in any directory outside the selected checkouts and the marked entry's owned workspace — is ordinary file work, is retained by nothing here, and happens again if the entry is continued. A marked workspace entry retains the same four operations in its workspace, including an ensure of the root, through existing local-operation records and without a Git lease. Checkout routing and holds take precedence where they apply. Completed workspace operations restore before live resolution or I/O, just as checkout operations do. Searches and temporary directories are ordinary throughout, wherever they point. The lexical path rules and the permission a <File> already answers to are unchanged, and they are not checkout validation: a path this run may not read or write is refused the same way it is anywhere else.

Sidekick entries additionally retain those same four file operations inside the host-captured project, assets and components roots, including an ensure of a root itself, through the shared local-operation records. This portable coverage needs no Git provider and grants no additional file authority beyond Project and session file contexts.

For new work, the most specific managed placement routes first, then the captured ambient checkout, then owned-root coverage when neither checkout covers the target. Live root and target use the same canonical path basis; restored operations perform no canonicalization and answer before current live permission or root checks. Work covered only by owned roots takes no Git lease. Glob and path checks remain unrecorded; no filesystem/journal transaction or file snapshot is promised.

One entry at a time changes one repository. A second entry — in this process or another — whose next new write, deletion or directory is in a checkout somebody else is changing is told so immediately rather than waiting:

Another XMD entry or process holds this checkout. End that work before trying
again. Nothing was read and nothing was changed.

Reading is not changing, so it is not excluded: an entry may read a file in a checkout another entry is holding, and reading takes nothing that would stop that entry carrying on. Only a new write, deletion or directory waits on the hold, and a completed operation of any kind takes nothing at all.

Starting outside a checkout without an owned workspace retains none of this: the entry performs ordinary file work, exactly as it would anywhere else, and never looks for a repository twice. Selecting a Repository is a separate matter and works from anywhere, which is the next section.

The shared-Git-directory mutation hold is a kernel-released exclusive lock on a hashed sidecar outside every checkout. Independently opened handles exclude one another, including two in one process. The native descriptor is the live resource, with no substitutable acquisition token or holder table. The entry acquires it lazily through single-flight acquisition, arms release before opening the descriptor, and retains it until joined entry teardown. This exclusion applies only to participating sidecar users, not arbitrary Git tools or external file edits.

Mutation contention refuses before changes and is fatal and unrecorded rather than a completed file/Git outcome. Managed-slot contention likewise refuses before selection recording begins. The first new file operation in a restored placement, including a read, reacquires its slot without rerunning the selector or inspecting the checkout; reacquisition contention is fatal stale state, not that operation's saved result. When both placement and mutation holds are needed, the slot is acquired first. New Worktree selection takes mutation ownership before running its selector.

The repositories and worktrees an entry selected

An entry may also work in a checkout it asks for rather than the one you are standing in:

<Repository name="project" url="/absolute/path/to/remote.git">
  <Worktree name="experiment" branch="experiment" as="worktree" />
  <Dir path={worktree}>
    <File path="note.md">first</File>
    <File path="note.md" as="held" />
    <Elicit schema={{ type: "string", enum: ["continue"] }} as="answer">Recorded value: {held}</Elicit>
    <File path="after.md">continued</File>
  </Dir>
</Repository>

<Repository name=".." url={..}> selects a persistent checkout beneath the configured host managed root for new entries, creating it the first time and reusing it afterwards. The returned checkout path is absolute on this host. For a checkout inside the launch project, derive its project-relative address from the returned path; a later File read needs no acquisition. An outside checkout is unavailable to Sidekick File work even with absolute opt-in. Authenticated Git reads retain their separate owner and lexical Repository/Worktree selection.

base names the requested creation base, not a promise about current HEAD. If a compatible owned checkout advances from creation base A to B, a fresh same-base selection reuses B and preserves tracked edits, index and untracked files. Inspect current HEAD separately when reporting the revision. An occupied unowned destination, incompatible origin or different creation base refuses without replacing files or resetting work. Placement grants no extra permission.

<Worktree name=".." branch={..}> selects a linked checkout of the Repository in scope, or — written outside one, in a directory inside a Git checkout — of the repository you opened the session in. Written outside one with no checkout around you, it refuses with the same actionable sentence it has always had: run from inside a checkout, or write a <Repository> around it. Both forms behave as they do anywhere else: paired, they scope their content and the working directory; self-closing, they render nothing and return the checkout path, which a sibling <Dir> may then render at. Who creates, reuses or refuses a managed checkout, and in what words, is unchanged — it is the same selection an ordinary xmd run performs.

What is new is that the selection is retained. Leave the entry at the question above and come back to the printed location: the Repository and the Worktree answer from what they recorded. No checkout is cloned, no worktree add runs, no sidecar is read, no credential is opened and no lock is taken to answer them. The file work inside them answers from its own records exactly as the ambient section describes, and the write after the question happens for the first time when you answer.

The routing record contains the canonical managed root, checkout root, common Git directory, credential-free repository identity, display name and owner checkout. A root-level Worktree records its ambient Repository owner as its own answer. No origin, publication evidence, object source, Git session, authentication, lock or opaque selection identifier is retained.

Historical validation uses pure slot arithmetic against the root the record itself carries and holds the result to its request; it never recanonicalizes that root against today's disk. The entry passively registers the placement privately and mints a fresh selection for this execution. Native operations authenticate that selection against the entry's private membership rather than trusting an editable Repository Context.

A completed selection says where the entry was working. It is not a claim that the checkout is still there. Remove it between leaving and coming back and the entry still continues — the selection answers, the completed reads and writes answer, and nothing is recreated or repaired to make that true. Only new work meets today's filesystem: a new read of a file that is not there fails exactly as it would have the first time, and a new <Dir> creates the directory it names, because <Dir> creates directories and is not checkout validation. A new entry selecting the same Repository selects it afresh, which is an ordinary reuse of whatever is on disk.

Two holds answer two different questions, and a message tells you which one you met. One entry at a time owns a managed checkout: a second entry asking for the same Repository or Worktree is refused immediately, naming the checkout, and may have it once the first entry has been torn down. Separately, one entry at a time changes one repository, which is the shared-Git-directory hold the ambient section describes — a new <Worktree> takes it, because creating a linked checkout writes into administration every checkout of that repository shares, and a new write, deletion or directory takes it too. Neither hold is taken to answer a completed selection or a completed file operation, and a read takes only the ownership of the checkout it is reading in.

Clone authentication and per-selection native children are torn down and joined before placement acknowledgement, path binding or body expansion. Cleanup failure is fatal and publishes no successful selection. Native selection that finished without acknowledgement runs live on continuation under the ordinary strict partial-creation adoption policy; an acknowledged placement never re-enters that path. Publication failure follows the language spec's persistence fence, without a success result or compensating Close.

Publication and pull-request work follow their retained contracts below. The sections after this one say what else an entry retains: the Git work it did in these checkouts, and the issues it filed and read, which need no checkout at all.

Staging, switching and committing in an entry

Inside a Git checkout with a commit in it, type this:

<File path="note.md">first</File>
<Git.Commit message="Record experiment" as="commit">
  <Git.Add paths="note.md" />
</Git.Commit>
<Elicit schema={{ type: "string", enum: ["continue"] }} as="answer">Recorded commit: {commit}</Elicit>
<File path="after.md">continued</File>

The staging child finishes before the commit starts. The commit writes the current index — nothing is staged for it and nothing is amended — and commit binds its full object id. Leave at the question, change the file, stage something else and make a commit of your own from a shell, then come back to the printed location. The question still shows the object id the entry recorded. Nothing ran again: not the write, not the staging, not the commit, and not a single git command. Your file, your index and your HEAD are exactly as you left them. Answering performs the write after the question for the first time.

That saved id describes the earlier commit. It is not today's HEAD, and nothing re-resolves it. A new entry that stages and commits commits what the checkout holds now.

Retention is installed at the ordinary Git implementation slot. Upstream middleware may answer, refuse, or transform and delegate; the request received at that slot is the one recorded. A wholly substituted answer retains nothing. Each reached call has exactly one durable operation and no outer envelope.

The same body works inside a lexical <Repository> and inside a selected <Worktree>, including a self-closing Worktree's captured path entered through <Dir> while the enclosing Repository stays the owner. A new <Git.Switch> uses the ordinary rules: named branches only; an existing branch ignores a creation-only base; a missing branch starts at the base you supplied or at live HEAD; Git refuses a branch another checkout of the same repository holds, and refuses changes it would overwrite. A completed Switch restores its result without switching anything back.

A refusal you asked for is retained as a refusal. Repair the checkout after it was acknowledged and that historical answer stays a refusal — a new invocation can succeed. <Git.Add> is not all-or-none: a pathspec naming an ignored path stages what Git already matched and then refuses, and nothing here undoes that. <Git.Commit> refuses an index that already matches HEAD rather than making an empty commit, and refuses when this host cannot say who the commit would be by — the message names the two commands that fix it, and no other identity is substituted for yours. That refusal reaches Commit alone.

Who the commit is by is read from your own Git once per entry, and only when a commit really runs. An entry that commits nothing, and a reopened entry whose commit is already recorded, ask nothing about who you are. Hooks, signing, filesystem monitors and repository credential helpers stay disabled.

The local-Git result records the selected checkout, branch, commit, HEAD tree and index tree before and after the operation. Operation-specific evidence is Add's ordered pathspecs; Switch's requested and resolved branch and base; or Commit's message digest and byte length, parent, tree, commit and second. The raw message is not retained a second time. Records contain no file list, checkout contents, Git output or credential.

What an entry writes down, it can read back. A result this build cannot parse, or one that does not describe the operation it stands at, ends the entry before anything is recorded rather than becoming a saved answer no continuation can use.

The received invocation is captured once before the first suspension. Per-call native children finish and close before the result is validated against the request and entry registrations and before acknowledgement. A cancellation joins those children before the entry settles.

Native completion and acknowledgement are different moments, and the gap is real. Interrupt an entry after the commit object exists and before its result is written down, and the journal holds no completion: the commit is in your repository, and a continuation runs that <Git.Commit> live. It may then refuse empty-index, because the earlier attempt already consumed the index. Nothing adopts the commit that was made, predicts an id or rolls anything back.

The first new Git operation inside a restored placement takes that placement's ownership of the managed checkout and then the hold on the repository it is changing, in that order, and keeps both until the entry is torn down. A completed Git operation takes neither. A no-op Add, a same-branch Switch and a Commit that will refuse take them too: whether git will change anything is not predicted.

Reading the repository an entry is standing in

Inside the same checkout, type this:

<Git.Files prefix="src/" limit={5} as="files" />
<Git.Changes compare="unstaged" as="changes" />
<Git.Diff compare="unstaged" limit={4096} as="diff" />
<Git.File commit="HEAD~1" path="src/expand.ts" as="before" />
<Git.Commit ref="HEAD" verify={true} yq='pick(["sha", "git_verify_commit_result"])' as="head" />
<Json value={files.paths} />

Five reads and nothing changed. <Git.Files> lists the tracked paths the index holds, relative to the repository root, excluding untracked files and the contents of any checkout nested beside them. <Git.Changes> reports each changed path with Git's own letter for what happened to it, for the index against the working tree, HEAD against the index, or two commits you name directly. <Git.Diff> answers the same comparison as patch text. <Git.File> answers the text one commit holds at one path — the commit's bytes, not the working copy, so it still answers after you have edited the file. <Git.Commit ref> answers one commit's stored metadata, and with verify={true} the receipt of this checkout's own git verify-commit. Reopen the entry and the saved page answers with the same receipt, running neither Git nor the verifier, even after HEAD or the trust configuration changed.

A page is bounded: 100 records, or 4096 characters of text, unless you ask for more. Ask for more and you get more; nothing caps it beyond what a number can represent. When something remains, next holds the complete arguments of the read that continues it, so a later entry follows it by passing the value back:

<Git.Files prefix={files.next.prefix} limit={files.next.limit} cursor={files.next.cursor} as="more" />

Follow one after the answer has changed and the read refuses rather than stitching two repositories together: The Git observation changed. Restart <Git.Files> without cursor. A change elsewhere that does not alter this answer needs no restart, and raising limit between pages is safe — a limit is how much of an answer to return, not which answer it is. <Git.File> carries its resolved commit in next, so moving the branch under it changes nothing about the file you are reading.

Leave an entry at a question after these reads, change every file behind it, and come back. The saved pages answer again: the same paths, the same statuses, the same patch window, the same commit — and not a single git command. The entry after it inherits those bound values and can render members of them without reading anything. Reads after the question run for the first time, against the repository as it is now. Delete the checkout outright and the saved pages still answer; reading one consults nothing.

A refusal you asked for is retained as a refusal, exactly as a transition's is. A revision that names no commit, a path the commit does not hold, a directory or a nested checkout's recorded commit where a file was asked for, and a file that is not text each say which it was and what to write instead. A directory is a directory under either spelling: src and src/ both refuse, and neither answers with something found inside it. None of them quotes anything Git printed.

These reads change nothing, so they take no hold on the repository you are changing: another entry committing in the same checkout does not wait for a read, and a read does not wait for it. Inside one entry it is the other way round, and deliberately: one read runs several Git commands against one private index copy, so that entry's own <Git.Add>, <Git.Switch> or <Git.Commit> waits for the read to finish and be written down before it runs. Nothing moves under a sequence already in progress. The first new read inside a restored managed placement takes that placement's ownership and nothing else; a completed read takes neither. Hooks, signing, filesystem monitors, external diff programs, text conversion, content filters and repository credential helpers stay disabled, and no read reaches a remote — a missing object refuses instead.

The branch an entry published

Inside a lexical <Repository> — or a <Worktree> of one, including a self-closing Worktree's captured path entered through <Dir> — type this:

<Repository name="project" url="/absolute/path/to/remote.git">
  <Git.Switch branch="review/push" />
  <File path="notes.md">Ready for review.</File>
  <Git.Add paths="notes.md" />
  <Git.Commit message="Prepare notes" as="commit" />
  <Git.Push />
  <Elicit schema={{ type: "string", enum: ["continue"] }} as="answer">
    The branch containing {commit} was published. Continue?
  </Elicit>
  <File path="after.md">Continued.</File>
</Repository>

<Git.Push /> takes no props and no content, renders nothing and binds nothing. It publishes the branch the selected checkout is on to that Repository's origin, without forcing and without changing upstream tracking.

Leave at the question, make another commit on that branch from a shell, then come back to the printed location. The branch on the remote still holds the commit the entry published, nothing was pushed a second time, and no git ran at all. Answering performs the write after the question for the first time. A new <Git.Push /> after that publishes what the checkout holds now, which is what makes this retention rather than a cache.

What is written down before anything is contacted is the request: the branch, the commit, the destination ref and the origin this publication asked for. So an entry interrupted between asking and hearing back publishes that same request when you continue it — the commit it named, not today's HEAD — and an entry whose push the remote accepted and whose result was never written down adopts that completion rather than repeating it. One publication happens, not two.

The decisions are the ones publication has everywhere else. A destination that does not exist yet, and one holding a commit this branch already contains, are published once with an exact non-force refspec. A destination already holding this exact commit is adopted and nothing is pushed. A destination holding work this branch does not contain is a conflict: nothing is published, nothing is forced and nothing is fetched. Permanent ambiguity and a host that could not answer are their own refusals, and an acknowledged refusal replays as itself rather than being retried for you.

A detached HEAD refuses before anything is contacted, because a commit is not somewhere to publish it. A checkout that records no usable origin refuses on the same terms. Neither writes a request down, and neither reads a credential.

Your checkout's own configuration cannot redirect a publication: the transport runs in a repository this run created, reading your objects through a read-only door, so a pushurl, a URL rewrite, a pre-push hook or a credential helper written into the checkout reaches nothing. The commit a saved request named has to still be readable — a missing object refuses rather than being fetched — and a moved branch or HEAD alone refuses nothing.

A publication takes ownership of the managed checkout it reads from, and takes no hold on the repository itself: it changes no file, index, branch or configuration there. Another entry committing in that repository does not stop it; another entry holding the checkout does, before a request exists.

The pull request an entry opened, and the feedback it read

Write the rest of the common path beside that publication:

<Git.Push />
<PullRequest title="Prepare the release" as="pullRequest">Ready for review.</PullRequest>
<PullRequest.Reviews url={pullRequest.url} as="reviews" />
<PullRequest.Comments url={pullRequest.url} as="comments" />
<PullRequest.Checks url={pullRequest.url} as="checks" />

<PullRequest> opens a pull request for the branch this entry published, or brings the one you numbered up to date, and binds its number, URL, state and head and base commits. It publishes nothing itself: what admits it is this entry's own last acknowledged <Git.Push /> of that branch, from this checkout, at this commit. A publication by another entry, by another checkout, or one a handler answered without reaching the Git host authorizes nothing, and neither does a failed or still-pending one. A refusal happens before a request is written down, before a credential is read and before anything is contacted.

The three reads name a pull request by URL and need no Repository and no working directory at all. Each binds its own array, and each is its own retained snapshot: reviews are not comments, and a partial answer binds nothing.

Leave at a question after all four and come back to the printed location. The pull request answers with the number and URL it was opened under, and each read answers with the array it saw — no second pull request is opened, no collection is asked for again, and no git runs. What you get back is what this entry acknowledged, even if somebody has reviewed it since.

An entry interrupted between asking for a pull request and hearing back opens that request when you continue it: the title, the verbatim body, the draft state, the base and the original head commit it named, however far the checkout has moved. One pull request is opened, not two, and one whose creation the service accepted but whose result was never written down is adopted rather than repeated.

A read written after the question is new work, so it reaches the service and answers with the feedback that is there now. That is the difference between reopening an entry and writing a fresh read in it.

Which pull requests you may read is the operator's to state, beside the credential, rather than the document's. A URL outside what this host authorized refuses — including on reopening, so permission withdrawn while you were away is withdrawn for the continuation too.

The issue an entry filed, and the one it read

An entry files and reads issues wherever you started the REPL, inside a checkout or not. Nothing about it needs one: no repository is discovered, no managed root is made and no lock is taken.

<IssueTracker url="https://github.com/octo/project">
  <Issue title="The REPL loses a pasted newline" as="filed">
    Pasting two lines into the draft submits the first one.
  </Issue>
  <Issue url={filed.url} as="found" />
</IssueTracker>

Filed {found.url}, titled {found.title}.

<Issue title=…>…</Issue> files one issue in the enclosing <IssueTracker>, using its expanded content as the description, and binds { url }. <Issue url=… /> reads one and binds the fields every tracker has: the URL, the title, the description, the tags and the assignee. Both are the ordinary components the language already documents, and a REPL entry writes them exactly as any other document does.

What is new is that both are retained. Leave the entry at a question and come back to the printed location: the filed issue answers with the URL it was filed under and the read answers with the snapshot it saw. No tracker is asked again, no configuration is read and no credential is opened to answer either of them — and the read still says what it said even if somebody has edited the issue since.

An issue lives at a service rather than in your checkout, so the interrupted case is the one that matters. An entry whose upsert was accepted by the tracker and interrupted before this end could write it down retains nothing: continue it and the same attempt is made again, under the same key it used the first time. The tracker recognizes that key as its own mark and answers with the issue that is already there. One issue is filed, not two. A read has no key and reconciles nothing — an interrupted one is simply made again, which is what a second observation of a live object is.

A refused tracker stays refused. Whether this deployment may reach a target at all is the operator's XMD_WORKFLOW_GITHUB_ISSUES ceiling, and a target outside it sends no request and carries no credential. A conflict, an ambiguity or an unavailable service keeps the provider's own vocabulary here exactly as it does elsewhere.

What the head says the execution is doing

Seven states and no eighth, in one precedence, each a fact about retained records and about work this process actually owns:

Reading When
1 HEAD · SETTLING an outcome is retained and the entry's work is still coming down
2 HEAD · EXPANSION PAUSED no outcome, and the controller is paused
3 HEAD · PAUSING EXPANSION no outcome, and it is pausing
4 HEAD · LIVE work this process owns, and none of the above
5 HEAD · EMPTY nothing retained and nothing owned
6 HEAD · SETTLED no owned work, and the latest entry has an outcome
7 HEAD · UNFINISHED no owned work, and it has none

Owned work means every resource the entry acquired is still standing — its outer Agent attachment and its consumers included. A body that returned and a root Close that was recorded are both earlier than that, so neither of them says an entry has finished; SETTLING is the window between them, and it is the one a reader watching a run end is actually in. A retained success, a failure and a cancellation all become a neutral SETTLED: which of them it was belongs to the reading, not to the head. An entry with no outcome and nothing holding it is UNFINISHED — stopped, never an inferred pause.

Pausing stops expansion, not work that has already started elsewhere. A head that changes while nothing is appended publishes through the wake the session and the controller already send; History has no clock of its own.

History is immutable; the present is explicit

A view frozen at a history position shows what the file held at that position and nothing else: exactly the entries admitted by then, each with the outcome it had reached by then. It fills nothing from the live head: no live output, no waiting question, no pause capability, and it cannot open the question this process is asking. What it does not freeze is the draft, which is the next entry's and belongs to no position — it stays editable beneath the selected work, and [live] brings it back to the head with the current catalog. Choosing a position from before the selected entry was admitted clears that entry and the scopes beneath it rather than guessing another, and keeps the draft, the surface, the conversation filter and the position itself. Before the root closes, output this process has produced but the file has not recorded appears as an explicit overlay; once the durable close exists, the recorded output replaces it.

Submit one complete program to a live child

Run a program in the exact child whose sessionId the owning parent returned:

xmd repl submit --attach "$sessionId" - <<'XMD'
---
returns:
  type: object
  properties: {status: {type: string}}
  required: [status]
  additionalProperties: false
---
<AssertEquals actual={2 + 2} expected={4} />
<Return value={{status: "hold"}} />
XMD

Interruption handling has its subscription and receiver ready before input or socket acquisition can block. Before remote interaction it cancels and joins local acquisition; after interaction begins it keeps the exact interaction's reader and connection observed through Stop settlement.

The command reads stdin successfully to EOF before beginning a source transfer. The child collects the complete program before reserving its shared entry/test slot. It submits exactly once, using the child's captured ordinary entry profile, permissions and project working directory. Draft, Message and human takeover stay as they are. A busy slot refuses immediately once the source is collected; it queues no entry. Complete empty input follows ordinary entry validation. There is no total source-size limit. Private source parts fit both the 64-KiB UTF-8 text bound and the encoded 1-MiB frame bound. One part waits for collector consumption before the next credit; a closing part's text precedes its normal stream completion. Failed input, cancellation and EOF before that completion admit no prefix.

Stdout contains JSON lines. Every admitted reference has exactly {sessionId, execution, entry}, where entry is its admission-order key such as entry-1:

  • admitted: {kind:"admitted", submission} precedes progress.
  • progress: {kind:"progress", submission, head, output, waiting} describes intermediate work. head is live, pausing, paused or settling. output:{text,offset,length} holds the latest at most 4096 Unicode code points of disclosed rendered output, its absolute offset and full observed length. waiting:{questions,permissions} counts only that entry's waits. Buffered Output may remain empty while questions or permission requests wait. Slow observations coalesce and cannot block the entry.
  • finished: {kind:"finished", submission, joined:true, outcome, result, error, journal} follows the exact entry's join, output consumption and owned cleanup. outcome is completed, failed or interrupted. A successful result is {value:Json}, including {value:null}; otherwise it is null. A failure supplies disclosed {name,message} in error; otherwise error is null. The separate journal fact is completed, failed, cancelled, unfinished or unavailable.
  • unavailable: {kind:"unavailable", submission, reason} says complete joined evidence could not be delivered. It carries the known reference, or null when admission acknowledgement never arrived. An oversized final result becomes this small record, with its known reference and no truncated result.

The example finishes with outcome:"completed", result:{value:{status:"hold"}}, error:null and journal:"completed". The workflow value hold does not change the execution outcome. A refusal admits nothing, writes its reason to stderr and exits 1. Losing acknowledgement is unavailable evidence, never proof of refusal and never permission to resend.

The first Ctrl-C cancels and joins input/startup before admission; its finished record has submission, result, error and journal all null. After admission it requests Entry Stop for the retained exact handle, joins that Stop and cleanup, and leaves the child available. Repeated signals join the same request. Natural completion can win; a late control refuses without reaching a successor or replacing the completed result. Actual Stop-publication and cleanup failures retain their existing precedence. Connection loss stops observation and leaves an admitted entry with its session.

Status is assigned after command cleanup: 0 for joined completion, 1 for refusal or a known execution/Stop/cleanup failure, 130 for proved requested interruption, and 2 for unavailable final evidence or payload. A known canonical failure keeps status 1 if delivery then fails. Progress and journal status never replace the joined outcome. Unknown, ended and mismatched child references refuse without starting a replacement; prepared Sidekick attachments grant no submission rights.

Attaching to the live Sidekick

Start new chat in an established child offers a fresh reference inline to the same live REPL before selecting its different conversation. The receipt shows the actual xmd repl --attach <sessionId> command and {sessionId: "<sessionId>"} for later parent composition. [saved reference; continue] retains the person's acknowledgement and activates that conversation; frame acknowledgement and UI loss do neither. Before that action, reattaching with the original ID shows the same pending offer. [cancel switch] joins and retires its unused endpoint. After activation the old endpoint/UI service and host lease join before the new instruction starts. Explicit fresh attachment sends nothing. Old references refuse attachment and selection but retain the owning parent's Shutdown authority over the same child. Shutdown through either owned reference ends all its associations; saved ended IDs recreate nothing.

Replacement handoff keeps an acknowledged, canonically selected association even if its continuation fails. An association that was never selected is retired instead.

The entry composition Agent name="xmd" with a canonical Session starts a parent-owned headless child before XMD.Session reads its exact {sessionId}. Reading sends no Prompt; Session names remain labels and distinct declarations have distinct identities. The shipped Guide.Children chapter and REPL.Syntax describe startup, later selection, xmd repl --attach <sessionId>, detach and Shutdown using ordinary host facts. No provider-private file is required.

Before document code, entry assembly captures the child manager and identity setup. The factory-delivered setup associates preparation with the exact opaque request and the genuine finished Session object with its child. Labels, Context, copied Session properties and JSON references establish no parent Shutdown authority.

Canonical Agent name="xmd" Session placement records {type:"xmd_session", name: sessionIdentity + "/xmd-child"} with result exactly {sessionId} in the issuing document's journal before acquiring child resources. Only the live allocation body permits fresh startup. Trusted setup forwards the original construction configuration to genuine activation, returns its original failure without acquisition, and acquires only after its successful Result. Genuine finish settles the provider-issued Session unchanged. An unfinished document restores allocation and performs exact live lookup; an ended original refuses without recreation.

The child's private endpoint validates its exact live owner/execution/conversation/cwd association. A symlinked temporary path resolves to a validated canonical private location; an unsafe location refuses with an actionable directory requirement. Its ACP/UI question and permission response capability belongs to this child connection. The prepared Sidekick attachment described below retains its original rights and still cannot answer questions.

A headless child's opaque address association contains only version, transport, socket, owner, execution, conversation and cwd. The public sessionId binds the live root and its exact selected conversation; outer ACP session IDs are connection mappings. Native publication and cleanup preserve ownership, mode, no-follow and identity-checked protection, including after canonicalizing a symlinked temporary input.

A POSIX REPL can initialize its Sidekick and publish a private attachment without UI input:

xmd repl --sidekick-acp /absolute/private/attachment.json
xmd sidekick acp --attach /absolute/private/attachment.json
xmd sidekick read --attach /absolute/private/attachment.json status

--sidekick-acp occurs once and requires an absolute file name. It is off when omitted. Unsupported hosts refuse the option; the ordinary REPL remains available. Attachment is specific to this Sidekick, independently of repository ACP. If no conversation is selected, startup sends one real initial Sidekick message through the root's dispatch and waits for its joined completion before publishing the attachment. The message asks for a brief readiness reply without entry submission or draft changes. Existing selected history is reused without another initialization message or provider setup. Initialization failure is an observable startup error and leaves no published endpoint. Omitting the option keeps ordinary startup passive.

Initialization changes no provider, model, effort, includes, permissions or native identity. It uses the same entry admission and pending/uncertain-effect rules as every Sidekick message. A conversation switch invalidates the attachment.

The descriptor is an exclusively published regular mode-0600 file in an owner-controlled parent, pointing to a Unix socket inside a fresh mode-0700 directory. Symlink, occupied, insecure, stale and mismatched descriptors refuse. It binds one live owner, execution, conversation and canonical project cwd; it contains no native session identifier or credential. Exit joins command work, connections and subscriptions, closes the listener, and removes only names whose identities still belong to this owner. Replaced files remain intact.

The stdio command speaks ACP protocol 1 using SDK 1.3. It accepts text and advertises load and close, with no filesystem, terminal, MCP, configuration or additional-directory authority. An issued ACP session names an attachment to this owner, not a new Sidekick. Exact load and cwd validation replay public state without a prompt or write. A failed load fences fallback creation on that bridge.

A prompt uses the same root-owned dispatch and admission as UI Send. It stays pending through generation, controls, entry submission, automatic feedback, questions and joined cleanup. Public activity and provisional previews use tool updates; assistant text comes from acknowledged, evaluated Output. An earlier answer or bare end_turn does not prove joined completion. Acceptance metadata marks the actual saved message; completing-RPC metadata separately names the joined exchange. Neither resolves uncertain underlying-provider feedback or supplies a product verdict.

EOF and bridge loss detach observation while the live producer retains its reservation. Explicit ACP cancel captures and joins only that attachment's exact current exchange; close does so before releasing its mapping. Neither closes the underlying conversation nor cancels an independently admitted entry. ACP cannot clear the unsent composer, take over a held draft or answer a question. The existing UI remains the question's answer authority.

Closed passive reads are:

xmd sidekick read --attach FILE status
xmd sidekick read --attach FILE message MESSAGE_REF [--follow]
xmd sidekick read --attach FILE entry ENTRY source|prompt|output [--cursor CURSOR]
xmd sidekick read --attach FILE entry ENTRY journal [--yq EXPRESSION] [--max-bytes POSITIVE]

Prompt pages additionally accept --prompt POSITIVE and --field request|reply|error. References come from acknowledged owner status; an unassociated saved message remains unknown. Follow takes a race-free snapshot and subsequent updates for that exact message, without dispatching, evaluating or appending. Source, Prompt and Output pages retain the existing text windows. Their opaque continuation restates the resolved entry/prompt and binds the execution, conversation and view; a newer entry cannot retarget it. Journal instead accepts ordinary --yq and returns exactly value, next, prev and last, with the same complete-input query meaning and pagination as REPL.Entry.Journal. Reuse navigation as --yq with the same positive entry; --cursor is refused for Journal; --yq and --max-bytes are refused for other views. Journal's optional --max-bytes is a positive safe integer byte count for the complete compact UTF-8 JSON {value,next,prev,last}, including escaping and navigation. The private envelope and newline receive additional room automatically. Navigation carries the applicable budget, and a later explicit argument overrides it. The client forwards inherited policy as maxBytes too, so an older pinned host whose closed schema cannot honor the argument refuses instead of silently using its fixed limit. No host is replaced, restarted or reloaded. Omission keeps the existing default. Reads accept no file path, source or write operation, and no other view gains a limit override.

A new authenticated connection to the same surviving root reads that exact entry's session-owned execution observation alongside its retained Journal. The original submit connection need not remain attached. After root loss a saved journal has unknown execution, and the old attachment refuses; no replacement host or cold attachment endpoint is created. Idle Sidekick status proves no entry outcome: a live entry can be awaiting Elicit while busy is false.

The private versioned framed protocol bounds Sidekick message text and each direct source part at 64 KiB, descriptors at 16 KiB and ordinary frames at 1 MiB. Only a matching configured Journal value reply may exceed that frame bound, within its usable page budget plus exact private framing room. The receive allowance is established before input; each send carries its own allowance. Each observer has at most 64 pending public updates. Malformed or slow observers detach safely; a subsequent exact read/follow obtains the owner's current facts. After owner-process loss joined completion is unavailable, rather than reconstructed from a saved preview or text.

Selected Plugin session services

xmd repl assembles the same bundled @executablemd/git Plugin value with its own entry-history admission rather than installing it directly. Git contributes the vocabulary and its two domain admissions. The command contributes its entry-history admission from inside the same contribution, so admission runs within each execution's own journal read rather than being attached outside it. The assembly keeps the bundled Plugin's name, identity-based deduplication and place in Plugin order, and delegates every other command untouched.

Selected Plugins may return a CLI-owned repl contribution from @executablemd/cli/api. initialize({ workspace }) runs once per live logical session after route and history validation; its resources end with that session. A child initializes independently in its own workspace. UI attachment, detachment and history inspection initialize nothing. Failure or cancellation joins prior setup before entry work, conversation work or attachment publication begins.

The CLI exports Repl and ReplApi with an initialize operation using that same argument. The logical session owner applies selected callbacks through this operation in selection order. Extension objects and callbacks are retained before session work; malformed contributions refuse, and extension-only installations remain selected. The first selected initializer is outermost and cleanup unwinds in reverse order.

repl.components declares identity components once. The ordinary entry vocabulary and eligible Sidekick forms derive from those declarations; absent generated metadata offers no generated form. Canonical identity, form dispatch and effect permissions still decide execution. repl.sidekick() runs once per live conversation after its provider is installed and before capture, sharing initialized session state. A contribution composes a held turn by installing ordinary default-max Agent.prompt content and resource middleware there, which changes the delegated text and the stream above that turn's own terminal and nothing else. Its resources and middleware end with that conversation; entry Prompts inherit none of them. Command installation contributes package documentation through the existing documentation helpers and starts no session service. Documentation lookup grants no execution authority. Contributed Sidekick invocations use host-owned intent/outcome recording. Intent acknowledgement precedes the body; accepted values reach designated feedback after component and callback cleanup join. Core supplies the per-call cancellation fact: a cancelled call leaves intent unmatched, while an ordinary failed call retains its known outcome. A response Stop does not classify every invocation as cancelled. The Plugin receives no private journal. Syntax, Submit, Elicit and builtin controls keep their existing feedback and recording ownership.

The Sidekick recorder receives its protected-return projection closure directly from the conversation-owned privacy installation and retains that installation through joined cleanup. Projection changes only the recorder's observation, leaving the selected Result and live binding intact.

Recording correlates intent and outcome by the exact observation object and keeps the response owner selected through joined cleanup. Ordinary entries attach no host invocation observer.

Who owns what

When eager ensure refuses to continue the original conversation, the failed result still offers Start new chat after the attempt is saved. Retry remains unavailable for that request while live and after reopening. A subscription failure that reached canonical begin keeps its existing recovery behavior. The entry Journal reads the canonical saved failure.

The host acquires one protected-input installation before each producing entry’s providers. It keeps that owner until those providers join, safely seals each independent output channel, and then disposes live input and pending text. Output received after disposal refuses instead of falling back to raw forwarding.

Only the REPL terminal renderer writes presentation bytes while the interface owns the terminal. Each entry installs its downstream process display handlers before acquiring execution resources and keeps them through joined teardown. Cleanup output belongs to that entry even after root Close, while another history position is selected, or while Sidekick is active. Arrival wakes the screen without moving selection, focus, Follow or either editable draft. Ordinary xmd run retains its existing foreground forwarding.

The Sidekick shows saved work and unknown feedback receipt with the fixed controls above the ordinary Message tray. The chat shows the full instruction from an unused recovery decision. Use saved instruction loads it into an empty Message composer. Send requires a separate action and checks the exact saved text again. The chat and entry output remain available in their reading surfaces. Navigation, resizing and inspection send nothing and retain no decision.

After the exchange and cleanup join, an explicit Send from Message can bind a distinct new instruction to the original conversation. The owner reconciles the entire unresolved Submit set, checks the remaining request and control frontier and establishes exact ownership before binding the decision. This exchange uses the existing dispatch slot. Earlier waiting messages stay held and ordered for explicit queue action. The prompt carries the new instruction and recovery context. The interrupted payload, prompts, controls and entries are not replayed. Unknown old receipt remains visible and running entries retain their lifetime.

A human Sidekick Stop during automatic feedback retains a human-stop record after cancellation and cleanup join. It binds the exact retained prefix, unresolved requests and unfinished controls. It proves the local join only. Cold continuation still requires exact retained clean ownership. A later request, another active conversation, a new unfinished control or a used decision ends the Stop's eligibility. ACP, Retry, TODO and Resume do not supply a fresh recovery instruction.

When ownership or exact native session load refuses, the fixed status gives the reason and offers Start new chat. In a local REPL this prepares and selects a different same-agent conversation without a prompt, keeping both drafts, entry history and the prior chat. An established attached child uses the reference handoff and captures its distinct instruction from Message.

An unselected retained replacement preparation is withdrawn by the first deliberate fallback action. A further action is required to prepare a fresh chat.

A cold original continues only with exact retained clean ownership evidence. An outer failed Prompt outcome or unreadable/fatal canonical history refuses. A free lock or forced release supplies no joined-stop evidence. Deliberate abandonment prepares a different same-agent conversation before canonical activation; setup failure leaves the original selected. Recovery decisions bind the exact retained prefix, uncertainty positions, unfinished controls and one new message. A used decision cannot dispatch again; an unused one requires renewed deliberate action and exact checks. No inspection or reference record dispatches a message. Fatal recording failure retains precedence and causes no compensating history append.

Repository and issue behavior belong to the entry that is executing, and to nothing wider. The command selects it; the entry's own task prepares it, once, inside that task, and everything it takes — the Git session it reads through, where it looked for a checkout, the managed checkouts it selected, the hold on each of those and the hold on the repository it changes — is released when the entry is torn down. The selections an entry made are its own: a continuation rebuilds which checkouts it was working in from what it recorded, and rebuilding them reaches nothing. Each entry reads and writes its own range of the one history, so the same text typed twice is two sets of records rather than one replayed, and the entry after an interrupted one replays nothing of it however identical its text. No second name for the entry appears in a record: which history an entry may continue is the range it was given. Reading is not owning: a settled history, a frozen position and a refused location prepare nothing, look for no checkout and hold nothing. A host that registers no recording runs the same file work with nothing retained, which is what Node and Bun do even in a marked workspace. Deno and compiled hosts retain workspace file work through their existing recorder; <Issue> and <Git.Push /> there report that no provider is installed, exactly as they do under any other host that installs none.

An entry's publication and issue work are named by the execution and the entry's own position in it, and by nothing else. Two entries holding identical text are two entries; an entry of another execution is somebody else's; and a tracker URL, a prop, a component answer and anything else a document can write take no part in it. That is what makes the interrupted upsert above answerable: the key is derived from facts that survive leaving and coming back.

Components receive immutable view data and answer with a typed semantic action. They hold no events, no history, no session, no repository and no host operation, so a keystroke cannot reach the file except through the one place that owns the product's state. Focus belongs to the mounted tree: Tab and Backtab traverse its regions, a drawer contains it while it is open, and the control that has it is marked.

Keyed commit and mounted lifetime. A parent offers its complete child set. The tree validates all of it before any mutation, applies additions and updates before removals, sets canonical order, and acknowledges only after commit. Identity is parent, key and type: redescription preserves the node and its running lifetime; a changed key or type replaces it.

Validation is synchronous and effect-free. It attaches, updates, draws and removes nothing, moves no focus and advances no frame. Commit repeats the same predicate over the actual apply inputs; validation is no reservation and need not have been called first. Children must be descriptions issued by the tree, sibling keys must be unique, at most one child may request focus, and requested focus must lie inside the innermost modal. There is no caller-supplied layout policy or second validator; layout belongs to the parent. An absent description leaves no mounted node, input, focus, frame contribution or output.

Construction is synchronous inside commit. Ongoing work belongs to the node's scope; render bodies own no resources. Event dispatch walks the target's own mounted ancestry and the first handler produces the typed action. An unhandled normalized event is an explicit failure.

Normalized input is decided once, at the host, which names an event shape and a position and never an action. Text is its own event and goes to whichever field has focus, and to nothing at all when a control has it rather than a field — so a keystroke never edits a field nobody is looking at. Ctrl+G, then 4 reaches the editor or New Round when the Draft destination is offered. The decoder names navigation keys, including Alt+Up/Down and the Control-G focus prefix. Unassigned Control or Alt chords are discarded as a unit. Control-J, Enter carrying only Shift, and Enter carrying both Control and Alt — how Terminal.app sends Shift+Return as ESC CR — are text containing a newline on a press or repeat, and a release is nothing. Plain Enter stays Enter. Control-C is named as an interrupt rather than decided here: the focused Message clears with it, and anywhere else the command leaves. A pointer is resolved against the exact frame that produced its coordinates, so a stale frame, a node that has gone and a target behind a drawer all reach nothing — and activating a control with a pointer produces the same action as pressing Enter on it.

Hit-testing is half-open on both axes. Bounds must be whole terminal cells; fractional bounds refuse rather than being rounded into a different target. Published frame bytes, bounds and target maps remain immutable across later renders and renderer recovery, so a held older frame keeps its original answers.

Wheel input carries decoded direction and coordinates. The presented frame resolves those coordinates to a live mounted viewport owner independently of control activation targets. Dispatch uses that frame's tree revision and the owner's mounted ancestry. Stale input, a removed target or a target outside the top modal reaches nothing. A wheel event never means a click or focus request.

Presentation time has one owner: a single acknowledged frame stream, advanced only once every subscriber has applied the previous timestamp. A settled screen schedules no timer.

A frame subscription owns its demand; cancellation removes that demand without acknowledging an unapplied timestamp. With no subscriber there is no frame timer. An animation spanning components belongs to their nearest common mounted ancestor, and ends with that ancestor rather than independent descendant clocks. Presentation time changes no journal, route, model selection or execution pause state. A measurement requested for an action creates no frame subscription or acknowledgement.

Frame preparation revalidates terminal size on every attempt. A size change abandons and rebuilds the preparation. Rebuilding is bounded per frame, with no final attempt exempt from validation: exhausting that budget releases the subscription without applying its timestamp and defers to the next frame, rather than presenting contradicted geometry or ending the command.

Each connected UI numbers presentations locally and acknowledges only after the exact bytes have applied at matching dimensions. The root preserves this order: frame subscription, tick, current size, commit/layout/render, presentation, then acknowledgement. Refused resize redraws without acknowledging unapplied geometry or accepting stale targets. Slow or failed connections release their own lease and frame work; a detached root holds no screen frame demand.

Submitting is not on the input loop. Validating a document and starting an entry both suspend, and the keyboard belongs to the person throughout: the draft keeps taking what they type, Pause and Exit keep working, and what the submission finishes with is reported back to the loop rather than written from inside it, so the screen has one writer. There is one next entry slot, reserved before the slow part begins, and one gate decides who takes it — a person pressing Run and a reply asking for the same thing are answered on the same terms.

What the gate decided is checked again when the entry actually starts, because validating suspends and everything the decision rested on can move while it does. A person who walked back to a recorded position, typed into the draft, or withdrew the request has changed what they are asking for, and the submission is refused at the start rather than admitted on the strength of the earlier answer. A refusal there admits nothing, appends nothing and leaves the draft where it is.

A reply's submission is written down before the slot it took is acted on; a person's Run is not. The difference is who is waiting: a person pressing Run can see what happened if the process dies, and a reply asked for an entry inside a response that is itself retained, so something will read its controls back. The Submit intent therefore binds what it took: the entry id it claimed, the exact source, the draft revision that source came from, how many entries preceded the slot, and — separately from that count — the entry journal the slot was counted in, as a record count with the byte count and digest of exactly those records. New root admissions carry the strict normalized absolute project pair executablemd.repl-placement: { projectDirectory, canonicalProjectRoot }. New Submit intents carry the identical pair in submit.placement, beside their existing reservation binding. Unknown members, malformed pairs and mismatched intent/admission pairs refuse. Existing workspace: true is mutually exclusive with project placement and preserves its session cwd and managed-root meaning. Completed placement-less history remains inspectable; unfinished placement-less history refuses live continuation. No record is rewritten or upgraded.

The count and the journal binding are different facts. A count of earlier entries names a slot; it cannot say which records preceded that slot, so a different valid history of the same length satisfies it. Only the retained bytes distinguish them, and they are measured off the file rather than from re-encoded records: re-encoding rebuilds an envelope in the reading process's own member order, which is a valid encoding of the same history and not the same bytes.

They also have to be the bytes of the whole history, not of the prefix the screen is reading. A screen opened at a recorded position keeps showing that position, and that is deliberate — but where somebody is reading is not what the next entry is called. Both submitters count the entries the file holds, so the person's Run and a reply's Submit cannot disagree about the next slot, and a reopening reconciles a reservation against every entry rather than against the ones its opening happened to include. A history this process cannot read supplies no count at all: it refuses, because an unreadable history is not an empty one.

The bytes have to be acknowledged ones. Owning the next slot stops another submitter taking it; it does not stop an append already issued from landing, and a file that only grows still has a moment in which a record has been written and not yet acknowledged. So the order is: establish that the session will take an entry at all, let the entry writer settle, then bind, then acknowledge the intent. A session that is ending, running an entry or following an unsettled one refuses before any of that — a refusal is a refusal, not work that waits for the entry in flight, and a refusal discovered after the intent was written leaves a record claiming an attempt that was refused on terms it could have asked about.

Reopening answers any Submit intent that has no outcome before it admits anything else, and answers which history first. If the entry journal no longer begins with the records the reservation was taken against, that refuses — before either finding, because reporting that nothing took a slot this reading cannot locate is as much a claim about the history as reporting that something did. Once the binding holds, the reservation is found by the slot's ordinal, the entry id and the source together: the slot is either occupied by the entry it named under the bytes it reserved, or nothing took it. Those are two real states — a process that stopped before the entry existed, and one that stopped before the receipt — and anything else is the two files disagreeing, which refuses rather than picking. Records after the bound prefix are ordinary; the entry the reservation reserved is one of them.

Placement matching happens before session opening can initialize or resume the unfinished final entry. It reads the original relevant Submit even after its control is settled, so another reopen preserves placement. A completed entry is projected without execution, and old records are never rewritten.

The finding is projected cold, with nothing appended and no conversation opened, and is retained at the next explicit mutating action. Nothing is acted on: an entry that was never admitted is not submitted now, and one that was is not re-run.

What a reply reads is about the history rather than about the screen. A person standing at a recorded position, inside a nested scope or on either tab has changed nothing the file says, so the reads answer from the acknowledged head — and the bindings read is the projection's own record of durably published root values, not the pane that displays them. A running entry's text is the one thing no record holds; it is credited to the entry whose task is producing it, because the overlay a screen shows answers at the position its session was opened at and would otherwise report an earlier entry's retained output as the running one's. No read starts an entry, resumes one or waits for one: a running entry's window is a truthful snapshot of what it has printed so far rather than a promise of more.

A live HostExecution.bindings() read uses the original execution's captured disclosure policy, including the exact scanner its journal gate adopted; a later same-name Context cannot replace it. A secret refuses the read whole. After a suspending read, the session revalidates the exact running entry before layering those live values over retained head values.

A reply's own vocabulary and an entry's are described separately, because they differ: a construct that is ordinary in an entry can be unavailable in a reply. What a reply may write is the compact surface derived from what is admitted; what an entry may write is a read over the ordinary entry's current registry, finalized includes and host declarations. The index uses core's structured symbols. Named lookup uses core's full reference selection and renderer. It carries the existing assertion defaults, including Assert, AssertEquals and AssertThrows, without entering the broader CLI run profile's testing, Verbose or web bootstrap. Each ask reads current session component files; Plugin selection is captured once per command, and another configured command describes its own selection. Earlier saved discovery stays historical feedback.

Bare <REPL.Syntax /> returns a compact index with exact names in symbol order under their existing categories and a copyable named lookup. Each purpose uses the symbol's trimmed description, collapses whitespace to single spaces and takes the text through the first period, question mark or exclamation point followed by a space, or keeps the whole description if none matches. A missing or blank description points to the named reference. An origin-only repository TypeScript component instead says its contract is unavailable without importing it. A purpose longer than 160 UTF-16 code units keeps the first 159 and an ellipsis. Markdown escaping follows truncation. The index omits prop tables, schemas, detailed usage and origin boilerplate. <REPL.Syntax names={["If", "File"]} /> returns complete selected references, including engine and installed structural forms, props and parent constraints. Canonical bare <Syntax />, CLI syntax and version-1 JSON keep their existing formats.

The index omits testing-package components absent from the ordinary profile and points to Markdown tests. Named lookup can describe those components with availability no, their package documentation, a complete test example and the supported REPL.Test invocation. Ordinary same-named components keep their usual precedence. Names absent from both contexts refuse, including a mixed request containing an unknown name; no partial documentation is returned. Availability means resolvable in the described ordinary entry, not authorized for every effect or guaranteed successful. Describing admits and authorizes nothing; reference-only registrations and middleware end with the ask. CLI xmd syntax and xmd run retain their run-profile assertion support.

Assertions run directly in ordinary entries with their existing forms and prop validation. A passing assertion continues:

<Let as="actual" value={2 + 2} />
<AssertEquals actual={actual} expected={4} />
<Output>Check passed.</Output>

An unhandled failing assertion fails only its entry and prevents later ordinary effects in that entry. Its diagnostic retains the comparison details, and the entry joins its owned cleanup before the session admits the next entry. The same session can then execute another entry normally.

Assertion registration activates no testing and installs no TestAgent. A bare canonical Test in an ordinary REPL entry still refuses because no testing behavior is installed; its body does not execute. This differs from ordinary xmd run, whose inactive testing package skips Test bodies. REPL.Test retains its explicit isolated testing execution.

The host's facts are read where they are known. The working directory and the platform are contextual and read at the ask; the runtime, the build and the release it belongs to are stated by the host a runtime entrypoint installed; and the command's own come last — where a declared name is looked for, which Plugins it installed, and how an Agent permission request is answered. The Plugin selection is reported as names, in the command's order, and never as the values that provide what they contribute. A fact the host cannot state is reported as an explicit unknown rather than omitted or given a default, an empty Plugin selection is reported as none rather than left out, and a host that describes itself not at all refuses the read rather than returning a snapshot with a hole in it.

The Sidekick belongs to the execution, and one explicit message is what makes it act. One is acquired per running REPL — for a fresh execution, a cold reopening and either storage shape alike — and selecting a tab, navigating History, selecting an entry or resizing reaches that same conversation rather than creating another. Reopening restores its conversation and its chat and asks a provider for nothing: no handle is opened, no turn is sent and nothing is written until somebody says something. An execution still held in the older single file is upgraded by that first message and by nothing before it, and while that handoff is in progress the screen holds new entry admissions and says so — an entry already running continues through the same movable writer, keeps its execution id, its route and its task, and its later appends reach the file the pair published. Those appends wait for the handoff rather than racing it: a record issued after the history's bytes have been copied is held until the writer has moved, so nothing lands in the file the pair superseded and the history the pair names is the whole of it. Typing, Send and Stop stay usable while a record waits.

Storage handoff arms release before the entry-writer hold can wait for an in-flight append. Held appends resume on the published entries file after successful publication, or on the original file after refusal or cancellation; cancellation during acquisition cannot strand the writer hold.

The screen is drawn again whenever the Sidekick's own reading or busy state moves, not only when somebody presses a key: a reply arriving, an automatic follow-up starting, a cycle failing and a joined Stop are all things no keystroke announces. That notification carries nothing and authorizes nothing — the screen reads the conversation afresh when it is told to look.

Sending accepts the exact text, UI revisions and origin into the live owner's FIFO across UI, delivered ACP and eligible TODO wake messages. Sixteen messages may wait beside the one active exchange. Each message is at most 65536 UTF-8 bytes; a full queue or oversize message refuses before clearing text, with no eviction or truncation. Successful composer Send clears only its accepted Message revision. Newer typing survives; Retry consumes no composer text and ACP changes neither field.

The live feedback exception sets aside one unresolved feedback record, identified by its position in the conversation record. The live owner binds that position to the current exchange's exact provider request. This can be a feedback-only request or a queued message's request carrying the completed round's results. An otherwise eligible message can enter the FIFO while either request is live. An earlier record with the same text, a mismatched acknowledgement and a pending recovery decision remain subject to the guard. The exception ends with the request's ownership and is absent on cold reopen.

Queue admission starts no additional prompt, evaluation or writer. Before a waiting head starts, the owner checks eligibility again. A refusal leaves the head queued without sending it and shows the reason in the queue hold. Remove message withdraws that exact item while leaving the feedback guard and hold in force. Resume queue rechecks the guard, and explicit recovery uses a distinct new instruction to address unresolved feedback.

Waiting work has no ordinary saved message record. When it starts, ordinary saved acknowledgement releases only matching Draft takeover before response controls run. The entire exchange and its cleanup finish before the next starts. Human Sidekick Stop holds remaining work until explicit guarded Resume, which passes the unknown-feedback guard only for a head bound to a retained human Stop. Attachment cancellation ends only its exact exchange and supplies no Stop binding. If acceptance remains unknown, the independent eligibility recheck holds the waiting head as described above. Ordinary failure holds without automatic retry. Fatal failures retain their authority. Pending work must be removed before ordinary agent replacement. Waiting work ends with this live owner and has no cold recovery or automatic replay.

A reply may ask a question, and it is answered in the Sidekick's own pane. When one is waiting, the pane says so and offers one control that opens its form; the Sidekick's tab says so too while that pane is the hidden one. Arrival announces and nothing more: it changes no selected tab, no route, no History position, no focus and neither composer, and it opens nothing. Opening is a deliberate act, and only that act opens it.

The form is the same bounded form an entry's question is asked through — the complete message, the fields in their declared order, an enum's offered values, the conditional required markers, what the last attempt was told was wrong, and the control that submits — shown through one window inside the pane that owns it, above the unchanged rows below the body. It covers that pane while it is open, so Stop comes with it: a question a reply is waiting on can be stopped from in front of it. The way out of the form is its own close, exactly as an entry's drawer is left before anything behind it can be reached.

What is typed into it is kept. An answer the schema rejects leaves the same question waiting with every value where it was typed and says what is wrong; closing the form, or going to another pane and coming back, keeps the question, the values and those messages — and brings the form back only when it is opened again. A field named message or draft edits that form and neither composer. A different question starts with an empty form, because values typed for one question are not an answer to another, and a question that ends takes its form with it. None of this is in the location or in any record: it is a fact about this process holding a suspended request, so a cold reopen shows what the stopped process wrote and no live form at all.

An answer the schema accepts ends the question, is recorded once by the same canonical operation that records an entry's, and reaches the reply that asked as its own designated feedback. The two owners stay independent throughout: an entry may be asking at the same moment, neither answer can be taken for the other, and Stop withdraws the Sidekick's question — with no answer and no outcome — while the entry's stays waiting and answerable.

The agent, the model and the thinking effort are configured in the Sidekick's own pane. Configure says which agent this conversation is with, what has been asked for and what the agent was last verified on — two separate lines, because a preference is a request and only a turn that actually started says what was applied. Opening Configure explicitly asks the agent what it offers; while a turn is running that read refuses and says so, and the choices already read for this conversation stay usable. Effort belongs to a model: choosing a model leaves the previous model's levels behind rather than carrying them over, and an unread model's levels say so instead of being filled in from another's.

Only one of these actions runs at a time, and each of them is one thing a person asked for: while an inspection, an Apply or a replacement is running, a message and another of those actions are both refused before anything is written or asked of the agent, and the reason is said in the drawer that was pressed. A preference Apply is the one action admitted beside a message already running, because saving a preference is a record of this history rather than work the conversation does.

Preference saving captures the active conversation and scalar settings before any suspension. A save during first setup with no active conversation refuses rather than waiting to attach itself to whichever setup wins. Saving reads no provider handle or options and sends no turn.

After retaining a message or feedback and applying its acknowledgement, the response reads the latest acknowledged preference for its own conversation immediately before Prompt handoff. No suspension intervenes between that choice and prompt; an unreadable preference refuses rather than falling back. A save acknowledged before handoff belongs to that turn; one acknowledged after belongs to the next.

The shared chat writer serializes physical append and in-memory publication as one operation for messages, feedback, controls, canonical turn events and preferences. Callers queue in arrival order. A cancelled waiter removes only its own place; the current holder keeps ownership and transfers it directly to the longest-waiting caller. The hold is never kept across a Prompt, evaluation, question, entry completion, inspection or setup.

An agent that advertises more choices than the drawer can draw is read with the wheel or Content paging keys. A choice below the window remains available; nothing is dropped to make the list fit. [close] and Apply stay outside the window, so the list cannot scroll them away.

Apply saves and closes — the selection that asked for it, and only that one. A drawer closed and deliberately opened again, or edited while an Apply was still running, is a different selection, so an answer arriving late leaves it as it is rather than closing it or applying itself to what is on the screen now. That it holds the same model or the same effort does not make it the selection that asked: a drawer reopened after a save is initialized from exactly what that save asked with. Close discards what was chosen and not applied and changes nothing — the list the agent gave is not a selection, so reopening reuses it and shows the saved preference again. A failed Apply keeps every choice and says why.

Escape closes Configure, and closing it means that one thing: the visible [close] control and Escape are two ways to ask for the same act, not two meanings of it. Either way nothing is saved, no agent is asked, neither composer is touched, a pending question keeps its own values, a preference already acknowledged stays saved, and focus goes back to the control that opened the drawer. A route drawer in front of Configure owns Escape while it is there: the first one closes that drawer and exposes the Configure held underneath with every choice still in it, and the next one closes Configure. A Configure that is not the thing on the screen — behind another pane, another tab, or a drawer in front of it — consumes no Escape at all. A saved model or effort is used by the next turn, which is where an agent can actually be asked: saving asks nothing of it, stops nothing, and leaves a turn already running on the settings it was given. A setting left out asks for no change to it and resets nothing.

Entering a different agent is explicitly starting a new conversation, and the control says so before it is pressed. The old chat and what it was with stay in the history; the new conversation starts empty of them, and nothing of the old agent's choices goes with it. A replacement that cannot be set up leaves the old conversation active and its reason in the drawer.

A request whose turn failed can be asked again. Retry sends that request's own saved text as a new message in the same conversation — not whatever is in the message box, which is neither sent nor cleared by it — and it joins the same live FIFO a Send uses. The failed attempt stays exactly where it is. A request whose acceptance this history cannot establish is not offered again, because the agent may already have it; neither is one this conversation has moved past, because something asked after it has since been answered. Both stay in the chat and stay readable — what goes is the offer to send them again.

A conversation continues its own native history through the adapter this build runs. What the Sidekick's provider first built a session under — those tools, servers, permission settings and that system prompt — is written into the conversation's own history before anything native can be created, and stays there unchanged as the account of how the chat began. A later explicit message is sent through today's adapter and today's Sidekick assembly to that same native conversation, even when the adapter command or the configuration differs. After a host Codex upgrade, the installed build must confirm the original conversation on a live load before Sidekick uses it. The Sidekick's own controls apply to every turn as it is built — no provider tools, no MCP servers, strict permission routing and every native permission request denied — and the turn's model and effort are applied and read back before it is sent. Reopening asks for nothing. A resume, identity, build or configuration the provider cannot actually perform fails that message and leaves the chat, its turns and its history standing; nothing is created in their place, and the person is told why rather than being given a new conversation that looks like the old one.

One message does these things in this order: establish storage, resolve the conversation, open it, deliver the orientation if this conversation has not been oriented, write down what the person said, send one turn, and evaluate what came back. Each step that can be read back is written before the work it describes, so a process that stops in the middle leaves an account of what it was doing. A fresh conversation is recorded as prepared before it is opened and as activated only once setup succeeded; a failed setup is recorded as failed and activates no replacement.

Which agent answers is the conversation's own, settled when it was opened and never changed in place — so reopening continues a conversation under the agent it was opened with, whatever this process was started with, and choosing a different agent explicitly starts another conversation. The chat a person has already read stays in front of them, and the new conversation records which association it replaced. It becomes the one in use only once it is set up and the agent has answered for itself; an agent that cannot be reached is refused in its own words, leaving the conversation a person was in exactly where it was. Nothing falls back to another agent, and making the change sends nothing.

Which model and effort it runs under is a request this history holds and the next turn puts into effect, because a configuration can only be asked of an agent on a turn. It is applied model first — effort levels belong to a model — and read back, so a turn that happened ran under what was asked for. An agent that refuses the request leaves the turn unsent and says what it does offer, and the request stays recorded: a Sidekick that quietly dropped it would answer as something nobody chose. What a person chooses between is the agent's own answer, read only when they ask for it, through a session the provider takes and gives up again — so opening Configure costs no turn. A setting an agent does not offer is reported as offering nothing, which is not the same as offering an empty list.

The orientation — the bootstrap, the derived guide index, the compact description of the admitted response controls — travels with a turn when the conversation has no canonically completed turn. The draft travels with every turn, because it is the piece that changes. Exactly what was delivered is retained, with a digest of those bytes, as a fact about that turn.

It travels again, once, when the orientation this build would give differs from the orientation the conversation was last given — and given means delivered, not offered. A reference record is written before the turn that carries it, so by itself it says only what was meant to be sent; what establishes delivery is a canonically completed turn whose retained input actually carried that text. Neither half is enough alone: a record with no completed turn is an offer whose fate is unknown, and a completed turn whose input carried something else is a record about a different turn. An offer is reconciled rather than dropped: the turn that owns it is the first completed turn recorded after it that was sent exactly that text, so a delivery whose own marker never landed is still read off the conversation. What cannot be matched that way stays unresolved — it is not promoted to delivered and not discarded because the work that composed it is over — and nothing resends it, because guessing whether a provider already accepted a turn is the one thing that cannot be corrected afterwards. So a refresh whose turn fails is still owed by the next explicit message, and the record it left stays readable without claiming to have superseded anything. Nothing inside one run can differ — the assets and the admitted ceiling are fixed for its lifetime — so the case is a conversation continued by a later build, and the only honest way to notice is to compare the digests retained against the ones current. A refresh re-orients and nothing more: chapter bodies stay on demand, the ceiling is unchanged, and no provider or admission policy widens. It is recorded like any other orientation, so the turn after it carries none again.

A successful complete reply is evaluated as a root under the selection this conversation's execution captured, through that execution, on a durable sequence separate from the turn that produced it. Only the root's Output reaches the person.

Nested declarations follow the ordinary source ownership, component-return and capture rules of language §6.9. A declaration in an unexecuted branch still hides surrounding documentation and can produce empty selected output. It does not make that branch previewable or widen the response's component and effect permissions.

The controls are captured once, when the conversation opens: each control the REPL defines is published as a component answer under its own name and the selection naming them is offered from the same installation, so canonical capture resolves and seals them before any response exists and a response's request states no table — only which evaluation it is, the bytes, and the classes it may draw on. Two conversations are two captures, and a control a reply names that the capture did not seal reaches no body. What is still each response's own is where a control's pair is filed and which slot a Submit binds, and that is given up only once the response's work and its cleanup have joined.

Live preview uses the canonical turn's optional snapshot-observation protocol in executable-mdx-spec.md. Before a candidate leaves core, the originating execution clears the accumulated source prefix through its authenticated disclosure policy, so secrets split across pieces are checked together. A finding or an absent, foreign or failed policy sends null once and withdraws preview for the rest of that turn. This screen decision neither replaces the pre-append gate nor serializes the scan failure as an Agent terminal.

The owner registers its response before handing over the request. Canonical begin consumes that registration and returns the fresh opaque observation object; every subsequent update belongs to that exact response/object pair. Updates for stopped, replaced or already-answered registrations change nothing.

A provider turn that failed, was cancelled or stopped early runs no control at all — it is source nobody finished writing — and nothing is written down for it. A reply belongs to a turn the canonical journal says completed, and that requirement holds: a record naming a reply for a turn that never completed makes the history unreadable, which is the whole reason the requirement exists. The account of a failed attempt is already retained, in the canonical record that holds its status and whatever it streamed, and the chat shows it as the incomplete attempt it is rather than as a reply. A failure takes its turn ordinal and establishes neither a completed response nor a delivered orientation, so the next explicit message continues the same conversation at the next ordinal and is oriented again.

Only an explicit Output region is chat. A response that declared none still ran its controls and still rendered its body — the chapter a read returned, the receipt a Submit was given — and none of that is shown to the person: it is the reply's own working rather than an answer anybody asked for.

A reply may also ask the person. The captured selection names Elicit, so a reply may write canonical paired <Elicit> — the same component an entry writes, with the same bounded form, the same compiled schema, the same validated answer and the same durable record — it is in the write class because asking is not reading, and paired because the question is its content. The question belongs to the conversation rather than to the entry: a reply's question and an entry's are two pending questions with two answers, answering either leaves the other where it was, and Stop withdraws the reply's without touching the entry's. A question this surface cannot draw is refused before anybody is asked, and what the refusal says is which schemas it accepts.

What the reply asked for comes back to it. Once the response has finished and its scope has joined, the results are sent, in admission order, as one next turn of the same conversation. Every control in the ceiling is included, writes as well as reads: a reply that asked the root to fill the draft or admit an entry has to be told what happened, or its next response is written against a guess, and a reply that asked a question has to be told the answer. Canonical syntax self-description is the one exception — its return is the reply's to render or capture — and an ordinary component return is never intercepted.

A question's answer is retained the way every other operation's is: an intent before anybody is asked and an outcome once they have answered. So a question still waiting when a process stops is readable as an operation that began and whose result nobody knows, and it is reported as that rather than re-asked or given an answer nobody gave.

Each answer is in its own terms, read back from what was retained. The binding map is the map itself, with no provenance or status put inside it. A filled draft is acknowledged and never echoed back as its own source. A submission is the exact entry's terminal outcome once its teardown has joined, followed by the read instruction for that entry, with no output body or summary; a submission that was refused before it reserved anything says so and names no entry, which is a different thing from an entry that ran and failed. An output read is the window the read itself renders, fenced long enough to hold its text, with its adjacent instructions pinned to that entry.

A reply reads one entry's saved evidence through four reads of its own, and each of them answers with a page rather than with prose:

<REPL.Entry.Source entry={22} offset={0} limit={4096} />
<REPL.Entry.Prompt entry={22} prompt={9} field="reply" />
<REPL.Entry.Output entry={22} />
<REPL.Entry.Journal entry={22} yq=".records" />

Source is the exact source that entry was admitted with. Prompt is one saved agent turn's reply, request or complete failure message. Output is what the entry printed. Journal queries the complete permitted value {entry,status,failure,prompts,records,execution} before paging the query result. Its optional yq defaults to .. Optional maxBytes is a positive safe integer byte count, validated before Journal inspection. For example, request an intact large diagnostic object with an 8 MiB response budget:

<REPL.Entry.Journal entry={22} yq="." maxBytes={8388608} />

Each record carries marker, type, nullable name, position, prompt and agent, its status, exec and required nullable promptError. A supported settled exec has {exitCode,stdout?,stderr?}; other records have exec: null. Missing channels are absent members, retained empty channels are empty strings, and timeout, cancellation or missing results invent no exit or complete output. Protocol ok, a nonzero command exit and the enclosing failed entry remain separate facts. Journal exposes no arbitrary result payload or provider data.

execution is exactly this host's observation of the selected entry:

{
  joined: boolean | null;
  outcome: "completed" | "failed" | "interrupted" | null;
  error: { name: string; message: string } | null;
}
Host observation joined outcome error
Admitted work or owned cleanup is live false null null
Exact task and cleanup joined successfully true completed null
Clean explicit interruption and cleanup joined true interrupted null
Actual execution, Stop or cleanup failure after join true failed Disclosed name/message
No observation for this entry, including cold reading null null null

The retained status and failure keep their meanings. A joined fatal refusal can have status: "unfinished" and failure: null; a successful Close followed by cleanup failure can have status: "completed" beside failed execution. Canonical failure precedence stays unchanged; an actual Stop or cleanup failure outranks the interrupt request. A Close, last operation, absent question, printing flag or Sidekick busy value never establishes join.

Only detached name/message cleared through the original entry's owned HostExecution.disclose appears. The call uses the contextual Execution.disclose chain, honoring replacements and outer Result transforms, then applies the original execution's captured protected-input projection and scanner to the final candidate. A later reader's policy cannot substitute for that owner; disabling scanning still projects marked inputs. Before handle/policy readiness or after revocation, clearance refuses without waiting. Unavailable or failed clearance supplies exactly {name:"Error",message:"Execution error details were withheld because disclosure checks could not complete."}. Joined remains true and outcome remains failed; that sentence describes withholding rather than the original failure. Errors outside entry expansion, such as outer entry cleanup, can lack clearance and use this form. A later response's policy clears no earlier error. No unchecked text reaches the query input, and no stack, cause, provider data or capability is exposed. The original direct submitter can receive diagnostic text that this later Journal read must withhold; that difference does not describe a different failure.

Observations belong to the selected admitted entry and the surviving session, not the latest task or observing connection. Reading performs no join, Stop, admission or recovery. An unfinished entry with joined failed execution permits no successor and has no running task for Entry Stop. Inspect its Source and Journal, preserve completed effects and explain the specific refusal. Blind resend or reopening is not a demonstrated safe continuation: opening unfinished execution can perform unrecorded work. Cold history keeps unknown execution, even beside a completed terminal.

promptError contains exactly the selected saved Prompt error: required message, optional name and cause strings, and optional diagnostic in Core's saved-failure schema. Its turn is joined by marker within the selected entry, independently of record position.

Saved record promptError
Non-Prompt record, including a failed command or root Close null
Completed Prompt null
Failed or cancelled Prompt with a saved error The selected saved error object
Message-only failed Prompt {message: "Internal error"}, with name/cause only if saved
Failed or cancelled Prompt without a saved error null

Empty messages and details stay empty; optional absent fields stay absent. The entry-level failure string and numeric prompt keep their own meanings.

For example, find a failed command anywhere in the selected entry:

<REPL.Entry.Journal entry={22} yq={'[.records[] | select(.type == "exec" and .exec.exitCode == 1)]'} />

Find failed Prompts anywhere in the entry, then inspect one returned Prompt number without relying on record position:

<REPL.Entry.Journal entry={22} yq={'[.records[] | select(.prompt != null and .status == "failed")]'} as="failures" />
<Output><Json value={failures} /></Output>
<REPL.Entry.Journal entry={22} yq={'.records[] | select(.prompt == 9) | .promptError'} as="failure" />
<Output><Json value={failure} /></Output>

The existing attachment CLI returns the same page for that selection:

xmd sidekick read --attach /absolute/private/attachment.json entry 22 journal --yq '.records[] | select(.prompt == 9) | .promptError'

Every successful Journal read has exactly {value,next,prev,last}. The value may be any JSON type. Small complete results have null navigation. Explicit or inherited maxBytes counts the complete compact UTF-8 JSON response, including keys, punctuation, escaping and navigation. Private attachment framing consumes none of that usable budget. Omission preserves the existing conservative bound. Strings use at most 4096 code points; arrays use at most twenty items per page. Smaller byte budgets shorten pages while those code-point and item maxima stay separate units. Objects and indivisible items that exceed the applicable bound refuse clearly without truncation and direct a narrower yq selection, such as a record's .exec.stdout, .exec.stderr or .promptError.diagnostic.acp.details. No text or record is cut before the query. Zero or multiple top-level results, invalid expressions and non-JSON results refuse through the existing query engine; null and false are valid answers.

Returned navigation is ordinary yq. Reuse it with the same positive entry number. Each request recomputes current retained data and host observation; growth can shift pages. Generated windows preserve the original query and finite range so later requests can offer next, prev and last without retained inspection state. Navigation also carries the applicable byte budget, so following it needs no repeated maxBytes. An explicit later budget overrides inherited policy and governs all regenerated navigation. A smaller override repages from the selected window's start when its old slice no longer fits. Fresh ordinary queries keep the default when no budget is supplied. The exact formatter shape is recognized through strict JSON and complete formatter equality; edited or noncanonical queries keep ordinary evaluator semantics. A generated window for another entry refuses. Journal takes no offset or limit props.

Both evaluations needed for a recognized generated Journal window use the same captured complete input.

entry and prompt are nonzero whole numbers. A positive entry number is immutable admission order counting from one, and a positive prompt number is a saved turn's own sequence plus one rather than its position in the list, so two turns that finished in the order their providers answered keep the numbers their records state and a number no turn saved refuses rather than being renumbered into its neighbour. Omitted and -1 are the latest, and a further negative counts back from it. Each selector resolves once, when the read happens.

Source, Prompt and Output text windows count Unicode code points and default to 4096 of them. Source and Prompt start at the beginning. Output's omitted offset is the last window, which is what a reader of output wants, and an explicit zero is the beginning, which omission cannot express. A negative offset counts back from what is available and clamps there, and a positive one past the end stays where it was asked for and answers with an empty window. A limit is a positive whole number with no maximum of its own, and what comes back is bounded by the evidence. Each of these three text pages carries previous and next: either null, or the complete arguments of the read beside it, with the entry and prompt stated as the numbers they resolved to, an absolute offset, the limit that was asked for and the same Prompt field. A continuation followed after another entry has been admitted therefore reads the entry it was about.

Text pages state the entry's status and, for a Prompt read, the turn's own separately. Journal exposes those statuses in its complete query input. An entry is completed, failed, cancelled, running or unfinished; a saved turn is completed, failed or cancelled, and a turn that returned well-formed text and ended failed is failed. A turn that saved nothing for the field being read answers text: null with no window either side of it, which is a different answer from the empty string a turn that saved emptiness gives. Evidence the history does not hold refuses, as does a zero, fractional or out-of-range selector, an unknown field and a limit that is not a positive whole number; a refusal is that operation's outcome and the response goes on.

Terminal evidence decides an entry's status even while the task that produced it is still unwinding. Without one, the entry this process is executing is running and any other is unfinished, so a cold reader of an interrupted history is told it is unfinished rather than that it is still going. Output uses the retained document result when one exists. Without one, a running entry uses text this process has observed for that exact entry. A cancelled Close carries no document result or retained output. For the entry admitted by a live Sidekick Send, that Send's output reads may instead use the exact execution stream's final text after the close value has been consumed and execution and entry cleanup have joined. This live observation keeps the same entry, extent and pinned window arguments and changes no retained terminal. Sidekick Stop ends that Send's live access; later entry completion cannot restore it. Other cold and historical readers gain no output from this exception and keep the existing empty-window behavior when no output is available. Fatal persistence, Files, disclosure and cleanup failures retain their existing outcome. These reads take the acknowledged head whatever position, scope or tab the screen is on, and they open no entry, resume none, wait for none, execute no source, reach no entry's provider and change nothing they read.

A successful read answers with its page object. An ordinary as binds that object, an uncaptured read renders nothing, and the page goes back to the conversation as the read's own result either way — capturing one does not switch its feedback off. Only an explicit Output region is chat, so a reply that wants a page in front of the person composes one:

<REPL.Entry.Prompt entry={22} prompt={9} as="turn" />
<Output>{turn}</Output>

A submission's receipt names the entry that was admitted and the read that explains it: an entry that completed is pointed at its output, and one that failed or was cancelled at its Journal, because an entry that failed may have printed nothing at all. The number is the admitted entry's, whatever entry or recorded position the screen is showing.

These reads are of the validated journal projection and of this process's own observed output, and of nothing else. They reach no provider session file, and the retained publication, secret and persistence protections stand in front of anything a page carries.

A page produced from the owning Send's final live observation is retained only through the read's existing control-outcome and feedback records and their existing disclosure and persistence gates. It is a saved observation of that read, not retained output on the cancelled entry. No additional cancellation payload, output record or record version is written.

These four are what a response reads an entry with. The single output read they replaced is no longer one a reply may write, and a response that names it is refused at admission like any other name the capture did not seal. What a chat saved before the replacement holds still reads as what it was: its retained observation comes back as the rendered window it was recorded as, under the name that produced it, and nothing re-evaluates the record to show it.

One result is its own value, because one question has one answer — a binding map delivered alone is the map, parseable as it stands, with no heading, fence or envelope. Several each get a short heading naming the control that produced them, and a value that was serialized is fenced there, in a fence longer than any run of backticks inside it: it is sitting among other things now, and a published string may hold a fence of its own. Canonical text beside it — a chapter, the entry vocabulary, the environment snapshot — was never serialized and keeps its own formatting.

A failure is its reason, and which failure it is matters. An operation that did not happen is refused; an operation that answered with bad news answered. A submission whose entry ran and failed produced that entry's receipt — the entry, its reason and that entry's read instruction — and the receipt is the answer, so it is never introduced as a refused submission. The two are told apart from the retained facts, the intent that reserved the entry and the outcome that observed its terminal status, rather than from the text that distinction chooses the wording of. Nothing internal crosses — no correlation id, no order number, no wrapper, no status word for something that worked. An ordinary failure of the response goes back with them, so the reply can continue from what already happened rather than repeating it, and the results that succeeded stay retained and are not sent again.

In a session with an asset workspace, Sidekick can use <REPL.InspectImage path="…" /> to inspect an imported PNG. Use a path relative to the session assets directory. Each response can inspect up to two regular PNG files of at most 2 MiB each. The reader requires Files read permission and refuses symbolic links. Each success retains the relative path and SHA-256 in the control outcome and adds the corresponding PNG to the next live feedback prompt, in control order. Image bytes remain in the session assets and the live request. Recovered feedback gives the retained references and asks the agent to request the assets again if it needs to see them.

One shared dispatch service owns a Sidekick message exchange through generation, control evaluation, automatic feedback and joined cleanup. UI Send and Retry preserve their existing input reduction and acknowledgement revisions. A dispatch captures its caller's UI or attachment origin before spawning, reserves under the same message/configuration admission policy at activation. Waiting work reserves no active cycle and appends no message until it starts. The returned handle observes this exact exchange. Dropping observation leaves the root-owned producer and reservation intact; cancellation through an old completed handle reaches no later exchange.

Every saved message carries an opaque public ID and its origin beside the conversation-scoped numeric turn, and a record missing either is unreadable rather than assumed. A public message reference binds execution, conversation and the acknowledged saved ID. External-origin messages preserve unsent human composer text and held draft ownership; only a UI acknowledgement clears its exact UI revision. External attribution appears in the existing chat. Passive observation exposes current public state and subsequent changes without another prompt or append. Its live terminal index is lost with the owning root; retained history alone establishes no joined-cleanup result after process loss.

A failed follow-up makes the whole exchange fail even when an earlier turn answered. Its safe error retains that earlier answer as partial evidence. A preview, a successful first turn, idle state and a product verdict inside Output are distinct from the final exchange result.

Follow is about execution, not scrolling: it decides whether a Sidekick Send goes on after the entry it submitted settles, and has nothing to do with whether a reading keeps its newest rows in view. It is on when the REPL starts, stays as you set it across rounds, navigation and resizing, and is not saved — the next REPL starts with it on again. Only an entry the Sidekick submitted during Send is a round; a Draft Send is not, and a round is one admitted entry rather than one provider turn. The evaluation the Sidekick invokes during Send creates and owns the continuation, so nothing else watches entries and starts turns.

When that exact entry settles, and the current exchange and its cleanup have joined, the continuation gives the Sidekick the entry's actual outcome — completed, failed or interrupted, each its own — and its actual output, as two separate facts. The Submit answer is still the receipt described above; the output comes through the continuation, never through the receipt's wording. With Follow on, the next eligible queued message goes first and another autonomous round only after it, under the queue's own rules (#964). That message carries the settled round's results and its request uses the live feedback exception. FIFO applies across origins and the handoff leaves a held queue in place. Turning Follow off lets the current round finish and ends automatic continuation at that point. The receipt and control results remain retained without a delivery marker for feedback that was not sent. Ordinary read-only designated feedback still receives its answer with Follow off; a refused Submit creates no round. Fatal storage, disclosure and cleanup failures keep their outcome, feedback whose acceptance is unknown is never resent, and only explicit evaluated Output becomes the Sidekick's chat: the work associated with a message — its entry, its state and its output — is shown beside the conversation as work, not as something the Sidekick said.

There are two Stops. The Draft's Stop is Entry Stop: it finishes the running entry as interrupted, retains that outcome, and joins the entry's cleanup before the next entry may be admitted. The stopped entry cannot be resumed as that entry; what it completed stands and what it printed stays partial. Its interrupted outcome reaches the Sidekick as the round's result, and Follow stays on. Leaving with Exit is different and keeps its recovery: an entry Exit leaves running stays unfinished, and reopening the history continues it.

The Sidekick's Stop ends the asking and nothing else. It is there while a reply is generating and while the Sidekick's question is waiting, whether or not an entry is running. It ends the current Send and the continuation that Send would have made, preserves your Follow setting for the next Send you make, cancels the generation in flight, the controls of the response being evaluated and the wait for an entry's outcome, and it stops any turn that would have followed — and it returns only once all of that has come down, so nobody is told their Sidekick stopped while it is still writing to their history. Everything already done stands: the chat, the drafts, the records, and an entry that was admitted, which belongs to the session and runs on its own terms — and its later settlement starts nothing for the Send that was stopped.

The boundary is the exact entry's durable admission, and nothing else stands in for it. A passed validation, a taken slot, a live session and an allocated task are all true before any entry exists: a task is started before the record that gives its entry a position, and the execution installs its providers and composes its envelope in between. A submission cancelled anywhere in that interval withdraws its own request and cancels the startup it allocated, joining it, so nothing can go on to admit an entry nobody is waiting for. Past that acknowledgement the entry is the session's: cancelling a caller's wait is not cancelling an entry, and the entry keeps running while its later completion starts no turn.

A cancelled startup leaves nothing behind it — no admission, no terminal, no settlement, and no entry for a later reading to find. The slot it held is free, because there is no entry for anything to follow. An admitted entry holds the slot until it has an outcome and its cleanup has joined: one left unfinished by Exit or a lost process keeps holding it, and one finished by Entry Stop releases it once its interrupted outcome is retained and its cleanup has joined. The Submit intent stands as what it is: a reserved request whose result was never acknowledged, and no completion receipt is manufactured for it. The history is re-read before Stop answers, because the cycle was writing to it and its own reading never finished; an intent with no outcome is what Stop leaves, and that is what a reopened or refreshed view shows. Stopping when nothing is running does nothing at all: Stop is not a way to discard a conversation.

A turn interrupted this way retains nothing of its own. The turn ordinal it would have taken belongs to the open conversation rather than to the file, so a later message takes the next one the conversation gives it; every claim this host writes about what a turn carried is read back from that turn's canonical record rather than from an ordinal predicted before it was sent.

A saved message carries a message ID of this host's own, written before its turn and never rewritten. Which turn that message became is read from the records for its own request — the message, then everything up to the next message or feedback text in the same conversation — and a request whose records hold no turn has none: unknown rather than unsent, because a turn whose record never landed may well have been taken. The two numbers are never compared, and their happening to agree establishes nothing. A reply belongs to the turn its own records hold, so the chat stays in the order things were said even where a message has no turn beside it and the message after it does.

A response has an identity of its own, which is neither of those numbers. It is fixed before the response is shown or anything of it is written, and it is the one name the response's live view, controls, root evaluation, outcome, Submit and feedback all use. No two responses of a history share it: not an unfinished response whose controls never answered, not a response an earlier build named by number, and not the automatic turns that follow one message without a message of their own. A control therefore holds a position no other response's control holds, and a history that records two operations at one position is still refused rather than read. A reopened history reads each identity back from the records that carry it; nothing derives one from a message ID or a turn.

Which conversation a turn ran in is established by that turn's own record, so a conversation whose mapping nothing acknowledged separately is still established and a later process continues it where it was. When even that record did not land, the provider's own retained account is what the next turn resolves to, and the message nothing acknowledged is not sent again. A turn the provider says ran somewhere else is retained as a turn that happened and is not published as this conversation's reply: showing a person words from a conversation they have never been in is the one answer that cannot be corrected later. The turn's own operations do not run, nothing replaces the established association, and a history that has come to name two conversations refuses to be continued at all rather than choosing one.

An explicit message carries what an interrupted response of this conversation actually did, when one is still unaccounted for: the operations that answered, in the words each control answers in, and the question that was asked and never answered, in the words it was asked in — in the order they happened, beside the draft as it stands now and the person's own message. It is one ordinary turn rather than an automatic recovery: nothing is filled again, nothing is asked again, no answer or outcome is invented, and an old fill does not come back over text a person has since typed. The account is carried once; a later message does not repeat it.

A submission refused before it took a slot writes nothing down, because a reservation that was never taken has no outcome to record — and it still reaches the next turn, carried as the refusal it was, in the place in the order it happened. It claims no entry and reserves nothing.

A response that asked for nothing and failed at nothing ends the exchange: the next move is the person's. A turn the provider did not finish ends it too, because a turn that produced nothing is not a reply to correct. A completed turn whose reply secret detection withheld ends it without pausing: its record establishes that the turn received what it was sent, so the feedback it carried and the TODO changes the turn selected are delivered. Nothing from the reply is saved or evaluated. A live preview may have shown a prefix the disclosure policy cleared before the credential arrived; the finding withdraws that preview, as the live preview rule under Who owns what states, and the chat then shows the saved turn with this account. The next message from the composer continues the same native conversation. A turn that names a native conversation other than the one this chat established is not withheld: it keeps the refusal any other credential in a record receives, records no completion and delivers nothing. There is no limit on how many turns one message may take: each one costs a provider turn, a response that asks for nothing ends it, and a provider failure pauses.

A delivery is claimed before it is sent, claiming nothing, and established afterwards against the turn that carried it: a completed turn whose canonical input is exactly that text. An ordinal alone would count a delivery against whatever turn happened to be in that position, and this host's own record of having sent something is never what proves a turn took it.

A root that fails after it began rendering keeps what it rendered. The partial text and whether the root declared an output region are the evaluator's own answer, retained as they are rather than recomputed or blanked, and the controls that ran before the failure stay retained while nothing after it runs. An admission refusal rendered nothing, so nothing is reported about what it rendered. A durability, Files, secret-policy or teardown failure keeps its own classification and is not read as a root that rendered something.

Submit's intent is the one control pair the root writes rather than the control wrapper. That intent binds the reservation it took, and the reservation does not exist until the session's terms are established, the entry writer has settled and the slot is held — all inside the work. An intent written before that would bind nothing, and a response's history would hold two intents for one submission.

Filling the shared draft starts nothing, and submitting is a separate request. A fill is applied by the loop that owns the draft and the request waits for it, so a submission after one reserves the text the fill put there. While a person has taken the draft over, a fill refuses and stays refused until they ask the Sidekick for something.

A pause request is the root's, as process-local state on the exact reservation it was made against; the session owns the entry task and the expansion controller, and the controller stays absent until there is an admitted entry to pause. An allocated task is busy, not admitted: offering a controller for one would let a hold land on the import the entry's position comes from. Preparation never turns Pause into something an idle or historical entry can be asked to do. The session takes the request in the one synchronous transition that establishes its entry's admission — the record is persisted and the work that would expand the body has not resumed — rather than from a scheduled waiter, a frame, an acknowledgement or whichever entry happens to be latest, and it takes it once. From that transition on the controller owns the hold, Continue releases it, and an entry already admitted keeps its own control when a submission behind it is refused.

An entry can also be admitted, hold the mode it was asked for, and then fail before any boundary is crossed: its root metadata and document envelope are composed in that interval. Cleanup belonging to the entry clears the mode before a successor starts, without releasing a continuation nobody is standing in.

A burst of input is one frame but not one tree. Keys typed faster than the screen draws arrive together, and an action that changes which controls are offered mounts them before the next key of that burst is dispatched — otherwise the key reaching for a control that has just appeared reaches whatever used to be there. Nothing is drawn and no frame is acknowledged for it, and a pointer is still resolved against the frame that published its coordinates.

Exclusions

  • Two processes writing one execution is unsupported. There is no lease protocol; do not open the same location twice for writing. The hold on a checkout is a different thing: it says one entry at a time may mutate one repository, and it says nothing about who may write this execution's history.
  • A retained local Git result does not authorize a pull request. The entry's own acknowledged publication admits retained pull-request work on the terms of the pull-request contract. What an entry retains is <Repository> and <Worktree> selection, the file and directory work inside those checkouts and the one it was started in, <Git.Add>, <Git.Switch> and <Git.Commit> in them, the page each of <Git.Files>, <Git.Changes>, <Git.Diff>, <Git.File> and a <Git.Commit ref> read answered with, the branch <Git.Push /> published, the pull request it opened and the feedback it read, and the issues it filed and read. A runtime that installs no repository provider — Node and Bun — refuses the Git components, the five reads and publication included, before any native operation or remote contact, while ordinary <File> and <Dir> work keeps working there.
  • A read confers nothing. Nothing a page holds authorizes a mutation, a publication, a pull request or an Agent, and the opaque cursor a next carries is continuation data rather than permission: a follow-up read authenticates and routes on its own terms and then checks that the cursor describes the checkout it reached.
  • A read is not a snapshot. One observation may run several Git commands against one private index copy and one pair of resolved commit ids, and that is as much as it promises: nothing locks the repository, watches it or compares every write that happened while it ran. What continuation checks is whether the answer changed, not whether the filesystem did.
  • <Issue> is the same component here as under every other host: one implementation, the same props, forms and return contract, asking a semantic issue operation for its work. The repl command registers it as an ordinary default like every other command does; what an entry supplies is the policy beneath it, declared to that entry's own execution over the default — and a repository component of that name keeps its ordinary precedence over both. What such a component does not get is the identity an entry's own issue work is named by.
  • Generated selection is unchanged. An admitted generated <File> read, write or <File.Delete /> is retained exactly as an authored one is, because both cross the one document filesystem. <Glob> stays ordinary and is retained by nothing here, authored or generated. A generated <Repository>, <Worktree> or <Dir> refuses before any provider is asked.
  • Nothing inventories the managed root. There is no listing of the checkouts an entry or a session has selected, no snapshot of their contents, and no restoration pass; a managed checkout is somebody's work and nothing here deletes one.
  • Continuing an entry is explicit. Returning to the live head starts the one unfinished entry, once; a frozen position starts nothing at all.
  • A continuation does not reconcile what is on disk. Nothing compares a saved file result with the filesystem, reports a difference or offers to repair one — if what you are looking at is not what you expected, that is for you to read and act on. An issue is the one exception, and it is the provider's rather than this command's: an interrupted upsert presents the key it used the first time, and the tracker answers with the issue it already filed under that mark.
  • xmd repl takes one optional location, the five Agent options above and --sidekick-agent. It renders no file and takes no document reference.
  • <Session.Launch> is unavailable. This command has no terminal to give away — it is using it — so a document that reaches for a native agent UI refuses through the established missing-launcher contract, starts no foreground process, and leaves terminal ownership and restoration with the REPL.
  • There is no browser elicitation and no readline permission handling. A question is answered in the drawer and a permission request in the surface, or not at all.
  • The REPL runs where a terminal is: it is not available over a pipe, and help acquires no terminal or filesystem capability. Whether there is a terminal is settled before a history exists, so a piped invocation leaves nothing behind.
  • A location is resolved against the retained history before anything replays. A route naming a scope or a drawer the file does not hold is refused without the execution being started, so a typo cannot cause a record.
  • A waiting question's drawer cannot be reopened from a URL. A Journal records answers, never a question that is still waiting, so no history can establish that drawer — it exists only while the process holding the question is running. A location carrying one is refused before anything replays.