Appendix A: Glossary
Definitions of the load-bearing terms in kiki's reference. When a term is used in multiple places, this is the canonical definition.
Concepts
- Thread — the kiki atom. A stable sqlite
thread_idrepresenting a themed sequence of jj revisions. While active, its live head is the managed workspace's current@, persisted asthread_head_commit_id. Bookmark name, workspace path, tmux session, and agent harness session are mutable projections of that identity. - Thread head — the exact commit at the managed workspace's current
@, persisted after observed workspace operations. It is the live synchronization source for follows. It is not inferred from the thread bookmark. Creating a follows edge refreshes the parent from a pinned jj operation view rather than trusting a possibly lagging cached head. - Owned stack — in v1, the provable single-parent chain after the follows edge's exact synchronized base through the thread head. Merge commits, multiple candidate roots, or foreign topology are not guessed through; they produce
TopologyDivergedand require a human choice. - Bookmark — jj's term for a named pointer to a revision. In kiki, the bookmark is a human-facing checkpoint, reopen handle, and branch pushed to a remote. Kiki checkpoints it explicitly at lifecycle and publication boundaries; it does not pretend jj moves it whenever
@gains a child. Canonical identity stays withthread_id, and live state stays with the thread head. - Follows — a directed parent-thread link enabling live cascade.
- Ambient coordinator — kiki's posture: it observes and reacts to jj/tmux/gh state without gatekeeping the underlying tools.
- Thread lifecycle states —
Creating | Active | CreateFailed | ClosePreflight | CloseCommit | CloseFailed | Closed | ProjectionDiverged | DestroyCommit | DestroyFailed | Destroyed. Creation, close, reopen, and the later destroy surface are durable sagas.ProjectionDivergedmeans a mutable projection such as the bookmark, jj workspace record, path, or tmux session no longer matches recorded state and cannot be repaired unambiguously. The former missing-directory-onlyOrphanedcase isProjectionDiverged { reason: WorkspaceDirectoryMissing }.Closedis a soft archive retaining the checkpoint bookmark and revisions.Destroyedtombstones kiki's thread identity; jj revisions remain unless a separately approved--abandon-revisionsplan named an exact safe chain.
Scope tiers
- Acceptance slice — what v1 must ship to be accepted. The canonical enumeration lives in Orientation and nowhere else; chapters describe behavior and link to the ledger for when it ships.
- v1.x polish — post-acceptance work that deepens v1 but must not block the acceptance slice unless explicitly promoted. Enumerated in the same Orientation ledger.
Cascade
- Cascade reconciliation — the follows-aware process that classifies a parent change, waits for the affected managed agent's safe boundary, makes the workspace reflect the desired jj state, injects context, and acknowledges delivery. The reconciliation is either
NativeRewriteorParentAdvance. NativeRewrite— jj has already evolved a descendant's commits in repository state because an ancestor was rewritten. The intent pins the exact old-base → evolved-base transition, not the descendant's volatile working-copy commit. Kiki does not rebase the descendant again; at a safe boundary it verifies the current descendant still contains the evolved base and normally materializes it withjj workspace update-stale.ParentAdvance— a parent's persisted thread head gained a new exact commit that is not already an ancestor of the following child. Kiki explicitly rebases the child's provably linear owned stack onto that exact commit at a safe boundary, then materializes the result.- Materialization — updating a workspace's on-disk files to the working-copy commit already recorded for that workspace in jj repository state. Repository evolution and workspace materialization are separate events.
- Pause-propagate-resume — the protocol that interrupts a child agent at the next safe boundary, reconciles and materializes the desired state, injects a context message, and resumes the agent.
- Core invariant — kiki does not materialize evolved state or perform an explicit follows rebase in a managed workspace while that workspace's managed agent is mid-edit, and it does not resume from a working tree that may hide unsnapshotted edits. Direct human
jjoperations are an explicit escape hatch and may materialize a stale workspace earlier. - Soft pause / Hard escalation — soft = inject context through the exclusive
PreToolUseboundary using aSoftBatchproof. Hard = pause or terminate the old incarnation and resume or start a replacement through proof-carryingRestartStartup; an untracked prepended message is not delivery evidence. WorkspaceProbe— a non-materializing check run immediately before reconciliation. It returns a filesystem fingerprint and classifies the workspace asFreshClean,FreshDirty,StaleClean,StaleDirty, orUnknown; a backend that cannot prove cleanliness returnsUnknown, which is handled like dirty state before any mutation.WorkspaceRecovery— the hard-paused recovery path for a stale workspace with unsnapshotted or indeterminate edits. It runs outside the source workspace, invokes jj's stale-workspace recovery, enumerates divergent successors, and verifies which result retains the edits before anything resumes.sync_intent— the sole durable record of one ordered cascade reconciliation. It owns kind, base transition, normalized trigger operations, result ids, state (Detected | Reconciling | Materialized | Delivered | Acknowledged | RecoveryRequired | TopologyDiverged | Superseded), recovery details, byte-stable payload and anchor, one exactSoftBatchorRestartStartupdelivery proof, and the durable delivery-attempt history with its exhaustion state. UI and delivery queries derive progress from these rows rather than shadow counters, and retry bounds are evaluated against them rather than in-memory counts a restart would forget.- Embedded cascade outbox — the payload, anchor, transcript id, and delivery timestamps stored on a materialized
sync_intent. It pins what the agent sees across crash and retry boundaries without creating a second protocol authority. See the embedded-outbox design note. SoftBatchdelivery proof — intent-embedded state preventing a dispatched tool batch from treating a second concurrentPreToolUseas acknowledgement. The first admitted call bindsBlockbefore reconciliation may mutate files, and every call in that batch is blocked.PostToolBatchrecords exact completion; only a later model turn may acknowledge and clear the proof. For Claude Code the batch is the parallel tool batch; for Codex's proven-serial dispatch it is a single tool call whose blocked completion is reported by the harness's next turn-scoped hook event, since a denied call never runs, fires no post-tool event, and the emitting hook's own RPC dies with the hook.RestartStartupdelivery proof — hard-restart mode binding a pending payload to a replacement incarnation and one-usestartup_delivery_id. The payload is mandatory startup input; an acceptance handshake marks delivery, and only the resulting first model turn causally echoing that id may acknowledge it.
Transcript
- Thread transcript — kiki's locally stored record of human-authored, agent-authored, and kiki-authored conversational text events per thread, bound to jj change-ids. Rows live in
~/.config/kiki/repos/<repo_id>/state.db, are never pushed, and do not enter the source repo; an explicitly consented catch-up may still send selected text to the configured model provider. Rows distinguishauthor(human|agent|kk) fromdirection(inbound_to_agent|outbound_from_agent|local_record) so kiki-authored context is not misattributed to the agent. - Local-storage / no-publication rule — transcript rows are stored under
~/.config/kiki/and do not feed externally published artifacts (kk publishPR drafting, auto-describe, auto-rename). Sending transcript-derived catch-up or MCP output to a hosted harness is a separate provider-egress boundary and requires remembered consent for the exact thread, provider, purpose, and disclosure version. synthesized=TRUE— flag on a transcript row indicating it is kiki-composed content the agent received (cascade injections, reopen catch-up, hard-escalation framing). The flag is what letskk reopencatch-up exclude prior catch-ups from its source query, breaking the recursion that would otherwise compound on every reopen.anchor_unknown=TRUE— flag on a backfilled transcript row whose timestamp predates the availableop_historyand cannot be reliably anchored to a(change_id, commit_id, op_id). Anchor-aware queries skip these rows by default;--recentand FTS5 search include them. See transcript anchoring.- TranscriptAdapter — the v1.x capture-side trait abstracting per-harness session-record discovery, tailing, projection to
(author, direction, text, dedup_key), and offset reporting. Its first implementations read Claude Code session JSONL and Codex rollout JSONL.
Agent and harness
- Harness — an agent runtime kiki spawns and coordinates with (Claude Code and Codex in v1; others deferred). Exposes a
Harnessfactory trait +RunningAgentinstance trait. - Runtime agent incarnation — one kiki-managed harness process, identified by a kiki UUID separately from the harness's resumable conversation/session id. Delivery acknowledgement belongs to the incarnation, so restarting with the same harness session cannot falsely acknowledge output seen only by the prior process.
- Capabilities — typed struct returned by a
Harnessdescribing what it proves:soft_pause,session_resume,structured_tool_hooks,parallel_batch_boundary,exclusive_pre_tool_use,restart_startup_delivery,mcp_client, andquiescence_detection. The cascade orchestrator branches on behavioral proofs, not on the settings mechanism used to obtain them. - Agent display states — the four-value human-facing projection (
idle,working,finished,blocked) ofAgentStatusplus turn-completion and attention signals, defined in Harness adapter. Display-only; the orchestrator branches onAgentStatus, never on these. - PreToolUse / PostToolBatch hooks — kiki's protocol entry points, which each adapter maps onto its harness's hook events; kiki exclusively owns the pre-tool boundary in every managed v1 process incarnation. The first admitted call fixes the whole batch's pass/block decision before mutation; a blocked batch emits the saved payload for every call once prepared.
PostToolBatchmarks only that exactSoftBatchcomplete, and a later model turn performs acknowledgement. Claude Code'sPostToolUseevent is not part of the protocol, and Codex's cannot be: a denied call never executes and fires no post-tool event, so a proven-serial Codex adapter reports its single-call batch complete through the next turn-scoped hook event, which cannot arrive before the blocked call resolved.RestartStartupuses its tagged startup-input proof instead. - Delivery receipt — the Codex adapter's authoritative consumption evidence: the harness session record's persisted result for a blocked
tool_use_id, which must match the saved payload byte-identically before acknowledgement.MarkDeliveredproves only that the hook wrote stdout; the receipt proves the model received the payload rather than a timeout-substituted or launcher-generic result. A contrary receipt redelivers on the arriving batch at most once per intent — a repeat fails over toRestartStartup, which does not ride the hook output; an unreadable one defers or fails closed intoRestartStartup. ContextMessage—{ kind: MessageKind, text: String, structured: Option<JSON> }— the byte-stable cascade communication embedded in a materialized intent for delivery to the thread's agent.
Auth
- Bootstrap Admin credential — daemon bootstrap authority stored at
~/.config/kiki/admin-cred(mode0600). It is not automatically presented by every CLI invocation and is not itself evidence of human presence. - Human approval — a short-lived, one-use capability bound to one requesting credential, method, target, argument digest, and daemon-rendered plan. It is issued only after an enrolled foreground
ApprovalPresenterconfirms a persisted challenge. Kiki atomically claims it into one durable operation journal before external effects; crashes may resume only that exact plan, never reuse it for another action. ThreadScoped<T>credential — bound to one thread. Stored at~/.config/kiki/repos/<repo_id>/credentials/<thread_id>(mode0600). Read bykk-hook, contextualkk, and later same-thread readers. Launch-scoped harness settings — Claude Code's generated settings file or Codex's generatedCODEX_HOME— reference it by absolute path; Claude Code's ownership-tracked fallback merges only.claude/settings.local.json. Kiki never writes tracked.claude/settings.jsonor anything under<workspace>/.codex/.- Repo-summary read scope — the small expansion of
ThreadScoped<T>allowing a sidebar process to subscribe to read-only one-line summaries of sibling threads in the same repo. Same-repo only, read-only, summaries only (no diffs, no transcripts). The single cross-thread read aThreadScoped<T>credential can perform. - Projection divergence — an observed mismatch between a thread row and a mutable external projection: missing jj workspace record, mismatched path, missing or moved bookmark, or missing tmux session. Kiki repairs only provably unambiguous cases automatically; otherwise
kk repairpresents explicit outcomes.
State
- Operation-history cache — normalized
op_historynodes,op_history_parentsDAG edges, per-viewop_workspace_heads, and theop_watch_frontier, populated by live watching and restart catch-up. The workspace dimension is load-bearing because jj's op log is repo-shared but@is workspace-local; no singular parent or cursor may flatten incomparable operations. Transcript backfill consults this cache and leaves ambiguous anchors unknown. pending_kkd_prepends— TTL-bounded sidecar table the JSONL projector consults to recognize kiki-composed--resumeprepended messages and capture them assynthesized=TRUE.
UI
- Overlay TUI — the interactive
kkUI invoked from inside tmux viaprefix+k(or by running barekkinside a registered repo). Two-pane: left sidebar with Stack and Activity sections, right content pane (transcript / diff / PR comments). Carries the full action set (spawn, publish, close, interrupt) gated by daemon-issued foreground approval cards for consequential verbs. Dismissed withq/esc. - Persistent sidebar pane — opt-in left tmux pane (default 32 cols) running a long-running
kk sidebar --thread <id>ratatui process. Renders the same Stack + Activity sections as the overlay sidebar, restricted to navigation-only keybindings. - Shell pane — opt-out tmux pane (default on) running the user's
$SHELLat the thread's workspace cwd, laid out alongside the agent pane in the same tmux window (default position: below; configurable to the right). The pane kiki manages — singular — so directjj/gh/ test invocations live alongside the agent without leaving the thread. Spawned at thread birth, re-ensured idempotently atkk switch/kk reopen, not auto-respawned after a user-initiated kill in the same continuous attach. Transparent to kkd after spawn — kkd does not track its state or processes. Additional panes the user splits into the session via native tmux are not "shell panes" in kiki's vocabulary; they are just tmux panes and kiki ignores them. - Stack-aware collapse —
kk log's default topology rule: the current thread plus its full follows-ancestor chain renders revision-by-revision; siblings, descendants-not-on-the-current-line, and unrelated threads collapse to one-line summaries; trunk renders as its own root. LogRenderer/StatusRenderer— pure-function rendering modules inkiki-core.LogRendererproduces the stack-aware revision view;StatusRendererproduces the kk-shaped header used bykk statusand reused by the sidebar via--no-jj. Single source of truth across CLI, overlay TUI, and persistent sidebar pane.
v2 / future
- Causal chain — UUID stamped on each MCP-driven post, used to detect cycles, depth excess, and branch fan-out in inter-thread messaging. See Roadmap.