ADR-125
the native session is a grounded host runtime over the installed engine, never a workflow
accepted · 2026-09-03 · L4 · cites 8
0ADR-125: the native session is a grounded host runtime, never a workflow #
Context #
Bare nika opened a concierge card on every stream, and a hidden
nika thread opened a conversation that was a proof of reuse and not a
product: a hardcoded vendor model (xai/grok-4), a plaintext history
folded into one prompt, a temporary agent: workflow written to /tmp
per turn with tools: [] and permits: {}, no grounding, no trace, no
guard. The pack's failure transcript showed the consequence: asked to
author a workflow, the model invented a JSON workflow language, confused
Nika with n8n, and finally claimed it did not know Nika. The one-door
pack's law: the native session must make that class of failure
structurally difficult, and it must be subject to Nika's own
data-boundary discipline before any workflow exists.
Decision #
- A new L4 crate, `nika-session`, is the runtime. It owns the
conversation and nothing the engine already owns: the grammar, the
catalogs, the codes, the checker, the runtime and the project file
grammar are queried, never mirrored (the crate depends laterally on
nika-cli-hostfor the ONE probe and the ONE oracle facade, ADR-124's precedent). - The session observes the project once (
ProjectSnapshot: the proven root — the git root, else the working directory — the project file and its ceiling, the workflows the ONE walker lists with the checker's verdicts, honest about truncation). - The human chooses the intelligence on the first run, in the
atelier order and in human words (an AI app they already have · an
API · a local engine · none); the choice is kept at
~/.nika/session-intelligence.json, shared by every install channel. The census is deterministic (presence, never a dial, never a value). An explicit choice this machine cannot serve is refused with its fix and never replaced. Each path names its data locus before the first turn. - The reasoner is ONE inference over the chosen path — the same
infer-grade seat adapter
nika rundispatches through, the same provider registry and one-shot infer verb a workflow'sinfer:rides, or none. Never a temporary workflow, never a trace for a chat turn, never a hidden shell. - The context broker hands the model a minimal typed bundle: the
identity core (six laws) and the language digest, the snapshot's
compact facts, the snippets the HUMAN named (only
.nika.yamlandnika.yaml, only inside the root, bounded, obvious secrets redacted with the kinds recorded), the diagnostics, the recent dialogue. The environment is never injected. The model does not decide its own read boundary. - Nika facts are answered by the engine before any model is asked: the workflows, the builtins, the providers, a workflow's verdict through the facade, a code through the explain ladder, a shape through the ONE router. A session without conversational intelligence still answers them.
- Every reply is read by the hallucination guard before a human
sees it: a
nika:<builtin>, a<provider>/<model>, aNIKA-…code, anmcp:<server>, anika <verb>or a top-level workflow field the engine does not carry is corrected under the reply; a claim of ignorance about Nika is corrected too. Nothing invented is presented as real. - One door. Bare
nikaon an interactive terminal enters the session; a pipe keeps the deterministic concierge (exit 0).nika threadis deleted in the same change, with no alias.
Consequences #
- The session is a product surface with a data boundary, not a chatbot over a workflow: what leaves the machine is the bundle, and the human read where it goes before typing.
- Proof: the crate's tests (a turn writes nothing · the reasoner
receives only the bundle, redacted, never the environment · the
seven inventions of the pack's adversarial corpus corrected · the
unserved choice refused with its fix · the facts without any model ·
the preference round trip · the first screen in the atelier order);
session_pty.rson the real binary (the pipe is the concierge, the TTY is the session, the first run asks once, the kept choice never asks again,nika threadis the parser's own refusal). - The concierge's
nika threadteaching and theRunVerdictfields the thread alone read are gone (zero legacy).
Follow-ups #
- Wave 5: project changes authored from the session (preview → consent → apply → the real check), run attachment, the human gate returning to the session as a pending decision.
- The intelligence changed in-session (
/intelligencere-asks). - The language digest generated from the canon at build time.
read at v0.118.7 · the decision record ships with the engine