Harness parity — LLeMbas CLI ⇄ LLeMbas
LLeMbas CLI (TypeScript) and LLeMbas
(Python) are two independent projects that share one harness design: the
same tools, the same permission floor, the same prompt texts, the same model
quirks and metadata, and one protocol between them. Each implements it natively;
neither ever executes the other. The specification is this repository's
harness/ (see its README.md); the CLI embeds it at build time
(src/harness.ts), LLeMbas vendors a pinned, hash-checked copy
(scripts/fetch_harness.py, scripts/harness.lock.json, into
src/lembas/harness_spec/).
This page maps every shared concept to its file in both, and says where they
still differ. Read it before touching either harness, and keep it true — a
wrong row is how one side silently stops matching the other. Paths: CLI under
src/ unless they start with harness/, scripts/ or tests/; LLeMbas under
src/lembas/ unless they start with scripts/ or tests/. The CLI column
describes dev (2.0); where 1.x on main differs, the row says so.
The rule
- A harness change (tools, permissions, prompts, quirks, the loop, the library,
the link) goes into the spec first, then into both implementations — or is
recorded as an open item against the other project.
- A bug found in one is searched for in the other, and the result —
including "not present" — is recorded with the fix.
- Every such fix brings a conformance case in
harness/conformance/, which
both test suites run.
- An LLeMbas administrator's prompt overrides are a local setting, not a
difference.
The spec itself
| Concept |
LLeMbas CLI |
LLeMbas |
| Where the spec lives |
harness/ (source of truth), embedded by harness.ts |
harness_spec/ (vendored), read by services/harness_spec.py |
| Pinning and updating |
harness/VERSION |
scripts/fetch_harness.py --update vX.Y.Z (a CLI tag), scripts/harness.lock.json |
| Spec version reported |
HARNESS_VERSION (harness.ts), sent as harness_spec in initialize and the link's hello (acp/agent.ts, acp/link.ts) |
/.well-known/lembas.json (api/devices.py), /admin/updates (api/admin_updates.py) |
| Conformance runner |
tests/conformance.ts (areas → functions), tests/conformance.test.ts; bun run harness record (scripts/harness.ts) |
tests/test_harness_spec.py (AREAS, and PENDING with reasons) |
| Tool definitions kept equal to the spec |
tests/harness.test.ts |
tests/test_harness_spec.py (DEVICE_TOOLS, SHARED_ADOPTED, TOOLS_PENDING) |
| Prompt texts kept equal to the spec |
tests/harness.test.ts (every file known, no {{ reaches a model) |
tests/test_harness_spec.py (every identical entry of prompts/index.json equals the fragment's default) |
| Filling a text's variables |
prompt/fill.ts fillPrompt (a bullet whose variable is empty disappears) |
services/harness_spec.py fill, prompt_with |
loop.json read by code |
harness.ts LOOP (steps, parallel, nudges, the wrap-up message) |
services/harness_spec.py loop() (the same, plus the LLeMbas budgets) |
Conformance areas
| Area |
LLeMbas CLI |
LLeMbas |
hardline |
permission/hardline.ts hardlineCommand |
services/agent/shell.py hardline_command |
split |
permission/bash.ts splitCommand |
services/agent/shell.py split_command |
plain |
permission/hardline.ts plainCommands |
services/agent/shell.py plain_commands |
arity |
permission/arity.ts prefix |
services/agent/shell.py prefix |
always |
permission/evaluate.ts alwaysPatterns |
services/agent/policy.py always_patterns |
permission |
permission/evaluate.ts evaluate |
pending — LLeMbas's modes are its own table (services/agent/policy.py POLICY) |
chunk |
library/chunks.ts split |
services/library/chunks.py split |
think |
provider/think.ts ThinkSplitter |
services/reasoning.py ReasoningSplitter |
effort |
provider/effort.ts effortRefused, advertisedEfforts |
services/generation.py _effort_was_refused, _advertised_efforts |
edit |
tool/replace.ts (the upstream cascade; the tools call tool/replace-text.ts, which adds the $ escaping) |
not run — the file tools are the CLI's |
unidiff |
tool/unidiff.ts |
not run — the file tools are the CLI's |
envelope |
tool/patch.ts |
not run — the file tools are the CLI's |
plan |
plan/plan.ts normalise, apply, fromTodos |
services/plans.py normalise, apply, from_todos |
prototype (gone in 3.8.0: pages) |
prototype/fence.ts parseInfo, titleFor |
services/prototypes.py info (parse_info, title_for) |
library_scope |
library/store.ts resolveBase |
services/library/documents.py resolve_base |
toolcall_index |
provider/openai-chat.ts ToolCallAccumulator |
services/llm/openai_client.py (the accumulator) |
instructions |
prompt/assemble.ts instructionChain |
run in tests/test_workspace.py |
context |
session/results.ts ResultContext |
run in tests/test_context.py |
prefix |
session/prefix.ts noteFor, offeredFor, unavailable, compactAsk (the engine keeps the state: session/engine.ts prefix()) |
pending (spec 3.1.0) |
levels |
provider/effort.ts levelsOf, levelFields, readLevel |
services/chat.py levels (and what each level sends) |
reasoning |
provider/common.ts turnReasoning, provider/openai-chat.ts toOpenAIMessages (a step-boundary delivery is turn: false: session/engine.ts) |
services/chat.py reasoning_back |
paths |
prompt/assemble.ts envLines, tool/tool.ts absPath |
not run — a chat's paths are the server's tree's |
team |
team/team.ts Team (the app drives it from real turns: team/runtime.ts TeamRuntime) |
services/team.py (the server drives it from real turns: services/team_run.py) |
progress |
session/progress.ts progressText, progressLine |
services/progress.py text, line |
display |
session/display.ts callTitle, callDuration, diffCounts, callFacts, drawnBlock; session/progress.ts endLine |
services/display.py title, duration, change, change_text, facts |
python |
not run — the server's tool |
services/tools/files.py python_text, python_unavailable |
reports |
acp/scheduled.ts reportTool, notifyInstruction, reportResult, runLeaves |
services/reports.py tool_state, instruction, result_text, outcome, note_of |
pages |
pages/fence.ts pagesOf, textProjection, pageNote, pagesOffered |
services/html_pages.py fence, project, note, offered |
rules |
permission/evaluate.ts ruleAction (lookupRule), judgeNewRule |
services/agent/rules.py action, judge |
reattach |
acp/turns.ts reattach — the client's rule, kept there for the cases |
services/device_link.py reattach_decision, the one place _reattach decides; tests/test_harness_spec.py AREAS["reattach"] — the cases run once the vendored spec carries reattach.json (skipped by name until then; tests/test_device_spec310.py states the same table meanwhile) |
editor |
acp/editor.ts trimWindow, editorBlock, rewriteMessage, RewriteOutput, rewriteModel, diffContent |
trim is the server's own cap on /v1/lembas/complete; message and output where it rewrites a selection itself — to map |
device_files |
acp/files.ts judgePath, baseCheck |
what it may expect of a device with fs |
show |
tool/show.ts showPlan |
its own show for a chat on the server — to map |
outstanding |
session/outstanding.ts outstanding — what a session still has out when no turn of it runs (App.out()); read by acp/agent.ts occupied / keeps and by the engine's hold |
run_waits is the rule its own scheduled runs with a team end by: schedule/runner.py follow goes on until runs.outstanding(...)["run_waits"] is false and no reply runs, and settles on the last reply. tests/test_harness_spec.py AREAS["outstanding"] — the cases run once the vendored spec carries outstanding.json (skipped by name until then; 8 of 8 against the CLI's checkout) |
cancel |
acp/turns.ts cancelOf — which turn a session/cancel touches; applied in acp/agent.ts cancel and, for a terminal's session, acp/share.ts (hub/cancel as a request) |
services/device_link.py _cancel — the one place a cancel is sent — carries the reply's turn id in _meta.lembas.turnId to a device that lists harness_turns; without the capability a cancel that would stop another's turn is not sent. The request form is used in _await_turn only. AREAS["cancel"] runs once cancel.json is vendored (7 of 7 against the CLI's checkout) |
last_model |
session/lastmodel.ts startModel, records, clientModel (the last is the server's rule, answered here for the cases) |
services/directories.py start (kind: client; start and record are the device's) |
interactive |
provider/interactive.ts twin, background, scheduledRefusal |
services/interactive.py — to map from the re-copied spec |
delegation |
team/delegation.ts checkMode, whoDecides, tighten |
services/team.py check_mode, who_decides (judged by spec_evaluate), tighten |
subagents |
team/subagents.ts subagentModel, offer (the app: app.ts spawn and the team's resolve; the offer and its note through team/team.ts Team.couldServe) |
services/subagents.py (could_serve, the model rule) |
Tools
Scopes come from each harness/tools/<name>.json: shared (both implement it),
cli (the CLI's alone). LLeMbas runs no agent of its own — an agent chat runs on
a linked CLI — so the execution tools are cli.
| Tool (spec name) |
Scope |
LLeMbas CLI |
LLeMbas |
Differs |
ask_user |
shared |
tool/ask_user.ts; card tui/components/question.tsx |
ask_user in services/tools.py, services/interaction.py |
— (the spec's schema and text since 1.1.0; LLeMbas's card has a third row to ask something back) |
task |
shared |
tool/task.ts, app.ts spawn (a handle; background: true returns it as a job), project/agents.ts, jobs/registry.ts |
task in services/subagent.py (subagent_run a former name); a background helper is a row in chat_jobs |
agent is explore or general on LLeMbas and worktree is ignored there (one hidden chat, no checkout); model picks another model the person may use; since spec 2.0.0 both run a background task as a job and wake the owner with the spec's note |
job_list · job_output · job_stop |
shared |
tool/job_tools.ts, jobs/registry.ts (commands and subagents of this session; bash_list/bash_output/bash_kill former names) |
services/tools.py runners over services/subagent.py (its own background helpers; a device's jobs are the device's, shown over the link) |
LLeMbas has no commands: its list holds helpers only |
job_send |
shared |
tool/job_tools.ts: a running child's inbox under the to_subagent mark, a finished one prompted again under the same id |
services/subagent.py: a steer into the child's running reply, else wake_chat |
— |
report |
shared, offered: subagent |
tool/job_tools.ts; the parent is woken with the message mark (app.wake) |
the child's report writes a machine turn into the parent (_inject, or wake_chat when idle) |
— |
plan_write · plan_update |
shared |
tool/plan_write.ts, plan_update.ts, plan/plan.ts; panel tui/components/plan.tsx |
services/tools.py runners, services/plans.py; panel chat/_plan_panel.html, card chat/_plan.html |
— (todo is a former name of plan_write on both; the CLI keeps the plan in the session store's meta, LLeMbas on Chat.plan_json with a snapshot per message) |
plan_submit |
shared |
tool/plan_submit.ts; card tui/components/plancard.tsx |
services/tools.py, services/interaction.py plan_card (the same card a device's _lembas/plan draws) |
spec 3.1.0: requires: plan — offered in every mode, answers its unavailable text outside plan mode (CLI: session/engine.ts decide; LLeMbas: offered in Plan mode only until it carries 3.1.0); the CLI also writes the plan to a file under .agent/plans/ for the record |
web_search |
shared |
tool/web.ts, search/ |
web_search in services/tools.py, services/search/ |
— (the spec's text since LLeMbas 1.4.0) |
web_fetch |
shared |
tool/web.ts, search/fetch.ts |
web_fetch in services/tools.py, services/fetch.py html_to_markdown |
— since LLeMbas 1.4.0: markdown (turndown's settings, <main>/<article> first), 20,000-character parts with offset; fetch a former name. LLeMbas has no Firecrawl scrape route (the CLI's search.fetch: firecrawl) |
memory |
shared |
tool/memory.ts, memory/store.ts applyOps |
memory in services/tools.py, services/library/memories.py apply_ops / apply |
— since spec 1.2.0 / LLeMbas 1.5.0: one target there (user, narrow.llembas), limit 4,000; the CLI also refuses entries that look like prompt injection (memory/threats.ts), LLeMbas does not (Open items). On dev, with the login's memory scope the CLI's memory is the server's /mcp tool |
notes_search · note_view · note_manage |
shared |
tool/library.ts, library/store.ts |
the same names in services/tools.py, services/library/notes.py |
— since spec 1.2.0: no scope there (narrow.llembas); ids are strings on both |
skills_list · skill_view · skill_manage |
shared |
tool/skills.ts, skill/index.ts |
the same names in services/tools.py (compose_skill, parse_skill), services/library/skills.py; the index is in the prompt as well |
— since spec 1.2.0: create, patch, delete, revert only there (no supporting files, categories or project skills — narrow.llembas); a patch is exact-match there, where the CLI's replace also matches loosely; names are slugs with hyphens there |
knowledge_search · knowledge_get |
shared |
tool/library.ts, library/store.ts |
services/tools.py, services/library/documents.py, retrieval.py |
— the spec's text and base on both; ids are strings in the spec since 1.2.0 (a number is taken by the CLI) |
read · write · list |
cli |
tool/read.ts, tool/write.ts, tool/search.ts |
— |
by design |
edit · multiedit |
cli |
tool/edit.ts, tool/multiedit.ts, tool/replace.ts |
— |
by design |
apply_patch |
cli |
tool/apply_patch.ts, tool/patch.ts, tool/unidiff.ts |
— |
by design |
glob · grep |
cli |
tool/search.ts |
— |
by design |
bash |
cli |
tool/bash.ts, jobs/registry.ts (a command still running at timeout is adopted as a job; background: true starts as one) |
— |
by design |
tasks · decisions |
cli |
tool/project_tools.ts, project/board.ts |
— |
by design |
session_search · settings · view_image |
cli |
tool/session_search.ts, tool/settings.ts, tool/view_image.ts |
— |
by design |
recall |
shared (spec 3.0.0) |
tool/recall.ts, answered by the engine from session/results.ts |
pending |
— |
show |
shared, requires: display (spec 3.0.0) |
tool/show.ts: offered only in a session a client opened that says show; sends _lembas/show |
pending (the viewer, and relaying a device's) |
— |
| Former names |
|
tool/names.ts reads aliases.cli and argument_aliases; todo converts its list into a plan |
services/tools.py resolve_alias: todo → plan_write, subagent_run → task, and since 1.5.0 memory_add/memory_forget → memory, notes_get → note_view, notes_create/_edit/_delete → note_manage, skill_get → skill_view, skill_create/skill_edit → skill_manage (in the chat loop and on /mcp) |
— |
A project offering less (narrow) |
|
harness.ts narrowParameters (conformance only: the CLI offers every shared tool whole) |
services/harness_spec.py narrow, offered_parameters |
— |
| Variables in descriptions |
|
harness.ts fillDescription / fillParameters = prompt/fill.ts; the library's values in tool/spec-vars.ts |
services/harness_spec.py fill / fill_parameters; values in services/tools.py LLEMBAS_VARS |
LLeMbas's fill also drops a line a variable left empty and collapses blank lines, beyond the spec's bullet rule (Open items) |
How a call is drawn (block) |
|
tui/state.ts, tui/components/messages.tsx |
services/tool_blocks.py |
— |
| LLeMbas only |
|
|
report_*, schedule_*, image_generate, scratch_write, custom HTTP tools, remote MCP |
web features, by design |
Permissions
| Concept |
LLeMbas CLI |
LLeMbas |
Modes manual edit auto plan |
harness/permission/modes.json; permission/evaluate.ts; config/schema.ts (unrestricted read as auto) |
services/agent/policy.py (the device's mode is clamped by the device) |
| Hardline floor, protected paths |
harness/permission/hardline.json; permission/hardline.ts |
services/agent/shell.py, services/agent/policy.py refusal |
| Judging a command line |
permission/bash.ts, permission/evaluate.ts (each command and its plain spelling) |
services/agent/shell.py |
| "Always allow" |
harness/permission/arity.json; permission/arity.ts, evaluate.ts |
services/agent/policy.py always_patterns |
| Default rules |
harness/permission/defaults.json; DEFAULT_RULES in evaluate.ts |
pending (see the permission area) |
| Approving |
once, edit then once, session, project, deny, deny with a reason — tui/components/permission.tsx; over ACP session/request_permission |
the approval card on a device chat; first answer on either side wins |
| Device limits |
the global remote: block → Limits in acp/agent.ts |
shown, never set |
Loop, providers, prompts
| Concept |
LLeMbas CLI |
LLeMbas |
Differs |
| The loop: step backstop, budgets, wrap-up, parallel calls |
harness/loop.json; session/engine.ts |
services/generation.py (_run, _wrap_up), services/settings_store.py |
budgets unset by default in the CLI |
| Capacity rule |
session/capacity.ts (against the parent's model and every running subagent job's) |
services/subagent.py, the connection's flags (db/models/connection.py) |
— |
Jobs: marks, caps, the note (loop.json jobs, conformance/jobs.json) |
jobs/note.ts jobNote, jobs/registry.ts; LOOP.jobs in harness.ts |
services/jobs.py note; harness_spec.loop()["jobs"] |
the CLI owns commands; LLeMbas's jobs are its own helpers, and a device's are shown from the link |
| Dialects |
provider/openai-chat.ts alone, to the server's /v1 (1.x: also responses, anthropic, gemini, ollama) |
services/llm/openai_client.py, anthropic_client.py |
by design: the server speaks to providers, the CLI to the server |
| Quirks of real servers |
harness/quirks.json; provider/common.ts, sse.ts, openai-chat.ts |
services/llm/openai_client.py, services/generation.py |
— |
| Reasoning effort |
provider/effort.ts, provider/learned.ts |
services/chat.py, services/generation.py |
— |
| Model metadata |
harness/models/schema.json; config/schema.ts, lembas/webui.ts reads it from /v1/models |
served at /v1/models (api/v1/openai.py) from the model rows |
— |
| Prompt texts |
harness/prompts/ (index.json: which are shared, and their variables), prompt/assemble.ts |
services/prompts.py fragments (core.shared, core.library, core.prototypes, mode.* read the spec's files), services/harness.py |
see below |
| Budgets, wrap-up, nudges |
session/engine.ts from LOOP (budgets unset by default) |
services/generation.py loop_budgets, _over_budget, _wrap_up(limit=), nudges — from harness_spec.loop(), the three budgets overridable in instance settings |
— |
| The plan in the prompt |
{{plan_context}} filled from the session's plan as it stood when the prompt was made; a change by the person is a note (spec 3.1.0) |
{{plan_context}} filled from chat.plan on every step |
3.1.0 pending in LLeMbas |
tasks/continue.md |
session/commands.ts, session/engine.ts |
harness_spec.prompt("tasks/continue.md") in api/chats.py, services/generation.py, web/templating.py |
identical |
| Personality presets |
harness/prompts/personality/; prompt/personality.ts |
services/personalization.py (reads the vendored presets) |
identical |
Context hygiene (context.md) |
at insert time, nothing sent rewritten: ids, read stubs, the cap, edit diffs, recall (session/results.ts) |
pending |
spec 3.0.0 |
| Compaction |
spec 3.1.0: the summary asked for as the next turn of the same conversation — same system prompt and tools, every message, then tasks/compact.md with {{transcript}} and {{previous_summary}} empty; a call in the reply not run; the request no turn (session/engine.ts summarise, session/prefix.ts compactAsk, summaryOf); then the table of reads, the prompt put back; no prune (1.x pruned old outputs first) |
summary as a user + assistant turn, turns kept collapsed (services/compaction.py); separate request until it carries 3.1.0 |
shape |
The prefix (context.md §10) |
spec 3.1.0: the system prompt made once per session (start, after a compaction, on a model switch) and kept in session_meta prefix with the tools left out and what the model was told; a resumed session sends it byte for byte (session/engine.ts prefix(), storedPrefix) |
pending |
spec 3.1.0 |
| No clock in the prompt; the date as a note |
prompt/assemble.ts (no Today:); the note on the first user message and after the date changes (session/prefix.ts noteFor) |
pending |
spec 3.1.0 |
<session-note> on the next user message (loop.json context.note) |
session/prefix.ts noteFor, from LOOP.context.note: date, mode (modes/<mode>.md via assemble.ts modeText), a plan the person changed, memory and instruction files changed between turns, personality, MCP instructions that arrived later; the app reads what it compares (app.ts changing). Stored as a text part of that user message, hidden from transcripts (isNote) |
pending |
spec 3.1.0 |
| The tool list fixed for the session |
decided as the prompt is made (session/engine.ts prefix() → could(), offeredFor): plan always could, display when the session had a client that shows; a call while unmet answers unavailable (decide). Knowledge decided at session start. The wrap-up keeps the list (a call in its reply not run); a tool withdrawn after a final refusal stays listed and answers that refusal; the first request waits up to loop.json context.mcp_wait_ms for the configured MCP servers (app.ts beforeFirst), a later one adds its tools once |
pending |
spec 3.1.0 |
| Cached input tokens per request |
provider/openai-chat.ts (prompt_tokens_details.cached_tokens, cache_read_input_tokens, llama.cpp timings.cache_n, else its last prompt_progress.cache); kept per request in the store's requests table (session/store.ts request), shown by /context |
pending |
spec 3.1.0 |
| Instruction files |
stacked: every AGENTS.md (else CLAUDE.md) from the project root down to the working directory, outermost first (prompt/assemble.ts instructionChain; 1.x: the nearest only) |
pending (over the server's tree) |
spec 3.0.0 |
| Library: chunking, search, fusion |
library/chunks.ts, library/store.ts |
services/library/chunks.py, retrieval.py |
— |
Prompt texts. harness/prompts/index.json records, for each shared text,
which LLeMbas fragment it is, whether LLeMbas's default is word for word the
same, and what each {{variable}} means. Identical since spec 1.1.0:
system/default.md (one text with variables for what differs — the opening
line, the surface, the tool list, the file tools, background commands, the git
section, the current plan; LLeMbas's core.shared fragment, one editable piece
in place of four), the four modes/*.md, blocks/prototypes.md,
blocks/library.md, tasks/continue.md and the six personality/*.md.
Shared but still differing in LLeMbas: family/*.md, blocks/memory.md,
blocks/skills.md, tasks/compact.md. The CLI's alone: system/identity.md,
blocks/skills-empty.md, blocks/agents-*.md, tasks/review.md,
tasks/changelog.md, tasks/init.md.
Connecting
| Concept |
LLeMbas CLI |
LLeMbas |
| The protocol, written down |
harness/acp.md, checked against the code by tests/harness.test.ts |
vendored with the spec |
| ACP role |
agent — acp/agent.ts |
client — services/device_link.py |
| JSON-RPC framing |
acp/rpc.ts |
device_link.Link |
| The link |
acp/link.ts (dials out), service.ts |
api/devices.py device_link_socket (/api/devices/link) |
_lembas protocol versions |
acp/agent.ts LEMBAS_PROTOCOL = 3, alone (1.x: 2, falling back to 1) |
device_link.PROTOCOL = 2, PROTOCOLS = (1, 2), ACP_VERSION = 1 — protocol 3 pending |
| Discovery |
lembas/client.ts reads protocols at login and every dial; a server without 3 is refused with "update the server, or use LLeMbas CLI 1.x" (protocolMismatch) |
/.well-known/lembas.json: protocol: 1, protocols: [1, 2] (3.0.0 raises protocol to 3 on purpose) |
Capabilities (files, commands, attachments, ask, plan, model, turns, shell, since 1.1.0 context, library, prototypes, plan_state, rewind, since 2.0.0 jobs, since 3.0.0 show) |
offered in initialize's _meta.lembas.capabilities |
used only when listed |
Jobs on the link (jobs) |
job / job_note events and sub_tool with jobId forwarded as _lembas/event; _lembas/jobs, _lembas/job/output, _lembas/job/stop, _lembas/job/send, _lembas/job/transcript in acp/agent.ts; jobs in status; job on session/request_permission; machine: true on a note's prompt |
services/device_link.py apply_event → the Jobs strip above the composer and the subagent panel; the routes POST /api/chats/{id}/jobs/{job}/stop and /send call the device; the strip is refilled from status.jobs on reattach and polls while it has rows; a machine prompt is mirrored as the harness's turn |
What only the client knows (context, library, prototypes) |
read from _meta.lembas on session/new and every session/prompt into the session's context (acp/agent.ts contextOf), consumed by prompt/assemble.ts: the instance's instructions, its personalization in place of the device's, the prototype offer; the knowledge scope is no longer read (spec 3.0.0: the device's bases are its own) |
sent by services/device_link.py on every prompt: chat.effective_system_prompt, the owner's personalization, the chat's knowledge bases, prototypes.offered |
The plan on the link (plan_state) |
the plan session update carries _meta.lembas.plan; _lembas/plan carries plan; status answers plan |
generation.plan set from the update, drawn as the same panel and card an ordinary chat has; the structured plan_card on _lembas/plan |
Rewind (rewind) |
_lembas/session/rewind re-kinds the turn's rows as /undo does; files untouched |
Edit and Regenerate on a device chat call it first; the controls say files are not undone |
Library scope (library) |
mcp/index.ts sends _meta.lembas.scope: <sessionId> on every memory call and on the lembas://memory read, for a session the client opened |
api/mcp_server.py resolves the chat by (device token, session id) and answers within its knowledge bases and data group |
| Prototypes |
a fence the model writes is saved under the state directory and named in the transcript (prototype/); /prototype lists them |
rendered live in a sealed frame (services/prototypes.py, api/prototypes.py), for agent chats too |
| One session, both sides |
acp/hub.ts, acp/share.ts |
announced sessions become chats; Chat.device_session_id |
| Turn ids |
acp/turns.ts |
messages keep the turn id; reattach asks _lembas/session/status |
A turn the harness starts (harness_turns, spec 3.10.0) |
acp/agent.ts ownTurn and working: the turn is in the session's turn log, status says busy and names it, _lembas/steer joins it, a prompt waits behind it, unsent on its task end (forward); historyTurns marks its user turn machine |
the turn's row is the harness's (device_link._mirror_turn, devices_own), keeps the device's id for the turn (Message.device_turn_id), and its reply follows the device's events. device_link.HARNESS_TURNS: with it a message typed meanwhile is steered in and unsent on the task end is queued again (_hand_back); the row is reattached by its id and never sent (reattach_decision, _follow_mirror); a machine history turn is stored as the harness's (_import_turns, _take_in_missed) and a turn that began unheard is found (_find_missed_turn). Without it nothing is sent to the session during such a turn (_takes_messages). Pending: vendor 3.10.0 at the CLI tag that carries it |
A steered message is given to the model once (_lembas/steer, spec 3.10.0; part of harness_turns) |
session/engine.ts steerState, carry, takeInbox; acp/agent.ts prompt answers a session/prompt whose turnId is a steered message's id with _meta.lembas.steered (taken, carried, waiting) and runs nothing; leftover hands back unsent only while a client is there to read it |
device_link._settle_steered: taken — the row is delivered; carried / waiting — the row waits (origin = "carried", never drained) until the turn that takes it in says steered with its id (_carried_in) or it is handed back (_release_carried, which starts it as a turn); the reply row of the prompt that did not run is deleted. A message keeps one id whether it is steered or prompted (the row's) |
A schedule's run waits for its subagents (spec 3.10.0, acp.md The run waits for its subagents) |
session/engine.ts awaitReports (EngineOptions.hold, set in app.ts for a schedule's turn): the turn stays open, waiting_for_subagents, the main agent's slot freed (TeamRuntime.leadDone), reports taken in at the step boundary; acp/agent.ts runScheduled stops what is still out when the turn ends otherwise (App.stopSubagents) |
nothing to change to follow a device: the run is one turn under the run's id, and its events are the run's reply's. Its own Chat-type runs with a team: to check against the same rule |
| A session that still has work out (spec 3.10.0) |
acp/agent.ts occupied, keeps; acp/hub.ts busy (the service's restart for an update, the link's close for a change of limits) and releaseFor (a terminal is refused in words, link up or not) |
device-only: status.busy is unchanged, the work is in tree and jobs |
| What has not reached the model yet (spec 3.10.0) |
session/engine.ts CARRIED_META: keepNote (a note after Stop, or one that may not start a turn — with the next message), carry (a steer a harness turn never took in with nobody listening — at the next turn's first step, said with steered and its id); acp/agent.ts forward says unsent before the queue is said empty; leftover carries after a prompt's turn too when no link is up; engine.steerState — a prompt whose turnId is a steered message's id does not run and answers steered: taken | carried | waiting (the last 200 ids taken in kept with the session) |
a steered event may name the id of a message steered into an earlier reply: device_link._mark_steered reads an id that is not in this reply's sent_steers as typed in the terminal — to do: mark the chat's own message instead |
| A web prompt made into a typed one |
acp/prompt.ts (/name via session/commands.ts, @path via project/attach.ts) |
the composer's @ and / lists, uploads as image / resource blocks |
| Deletes not yet acknowledged |
acp/pending.ts |
kept and resent until answered |
| Terminal shell marks |
acp/shellrc.ts (bash, zsh, fish) |
services/agent/terminal.py, services/agent/shell_marks.py (OSC 133 / OSC 7) |
| Device login (RFC 8628) |
lembas/client.ts, lembas/login.ts |
services/devices.py, api/devices.py (/device) |
| The account's models |
lembas/webui.ts, provider/refs.ts (the served id; the older <login>/… forms still resolve) |
api/v1/openai.py |
| Personalization and usage |
lembas/personal.ts |
api/v1/me.py (/v1/me/personalization, /v1/usage) |
| Memory over MCP |
library: lembas → mcp/index.ts LIBRARY_SERVER, its memory tool alone, and the resource lembas://memory for the prompt (app.ts); notes, knowledge and skills stay local (1.x: the whole library) |
api/mcp_server.py (/mcp) |
| Search, fetch and speech through the instance |
search/webui.ts, voice/speech.ts |
api/v1/services.py |
Spec 3.0.0 (draft) — CLI side in progress on dev, LLeMbas pending
harness/VERSION is 3.0.0-draft, and becomes 3.0.0 when both projects implement it. The CLI
on dev loads it and implements the rows that apply to an agent session; LLeMbas implements none
yet. A file in a pending cell is where it is expected to go, not where it is.
| Concept |
Spec |
LLeMbas CLI |
LLeMbas |
Where a tool is offered (sessions, requires, unavailable, confirm) |
harness/tools/*.json, harness/README.md |
harness.ts ToolSpecDef (read for show's unavailable) |
services/harness_spec.py |
The file system as a contract: paths, kinds, levels, errors (fs_access) |
harness/filesystem.md |
— (an agent's disk: one level for the working directory) |
the new tree's view (to be written) |
Stacked instruction files (instructions) |
harness/filesystem.md |
done: prompt/assemble.ts instructionChain (conformance passes) |
to be written |
Chunking by tokens (chunk_tokens) |
harness/filesystem.md |
library/chunks.ts (still characters) |
services/library/chunks.py (still characters) |
Context hygiene: ids, stubs, cap, recall, diffs, compaction table (context) |
harness/context.md, loop.json context, prompts/blocks/context.md |
done: session/results.ts, tool/recall.ts; compaction.prune removed (conformance passes) |
to be written |
Chat file tools read write edit glob grep list mkdir mv rm search |
harness/tools/ |
(read … list as today) |
to be written, over the tree |
show |
harness/tools/show.json, acp.md _lembas/show |
done: tool/show.ts, capability show (offered when the client says show) |
to be written (web UI viewer; relays a device's) |
python (browser Pyodide) |
harness/tools/python.json |
— |
to be written |
Forge verbs commit branch pr merge tag release |
harness/tools/, permission/modes.json confirm |
— |
to be written |
| Memory served by the instance for the device |
filesystem.md Memory, acp.md The HTTP API |
done: the /mcp memory tool and lembas://memory (app.ts); local memory/store.ts only without the scope |
/mcp memory and the resource (to be written) |
Link protocol 3; instance on session/new; the chat's model, no own-model answer |
acp.md Versions, session/new |
done: acp/agent.ts, acp/link.ts, lembas/client.ts |
services/device_link.py (the notice path to be removed) |
Neither library nor prototypes sent by a 3.0.0 instance |
acp.md |
done for library (no longer read) |
to be written |
blocks/workspace.md (a chat's view, told to the model) |
harness/prompts/ |
— |
to be written |
Spec 3.1.0 (draft) — CLI side done on dev, LLeMbas pending
harness/VERSION is 3.1.0-draft. The rows marked spec 3.1.0 above: the prefix stays still
(context.md §10), compaction as the next turn (§7), plan_submit requires: plan, cached tokens
recorded. Conformance area prefix (harness/conformance/prefix.json) passes in the CLI.
Spec 3.2.0 — CLI side done on dev, LLeMbas to do
harness/VERSION is 3.2.0. The CLI carries it on dev (2.0.0-beta.3): the conformance areas
levels, reasoning, paths and team pass there. In the LLeMbas column a file is where it is
expected to go, not where it is.
| Concept |
Spec |
LLeMbas CLI |
LLeMbas |
Effort levels: thinking_switch, off sends enable_thinking: false, default, the start level, a level not offered (levels) |
harness/models/schema.json levels, quirks.json thinking-default, acp.md |
done: provider/effort.ts levelsOf, levelFields, readLevel; config/schema.ts effort; lembas/webui.ts reads thinking_switch |
to do: services/generation.py, services/chat.py, the model rows |
The effort control: none for one level, a Thinking switch for [off, X], else a slider |
harness/models/schema.json levels |
done: tui/commands.ts /effort; the status bar |
to do: the composer's chat settings menu |
capacity.parallel (single_session = 1) |
harness/models/schema.json |
done: session/capacity.ts, team/team.ts parallelFrom |
to do: the model row, /v1/models (single_session beside it) |
Reasoning sent back during its turn (reasoning) |
harness/context.md §8, loop.json context.reasoning |
done: provider/common.ts turnReasoning, provider/openai-chat.ts; session/engine.ts marks deliveries turn: false |
to do: services/llm/openai_client.py, anthropic_client.py, services/generation.py |
No absolute paths in the prompt; relative paths against the project root (paths) |
harness/context.md §11, loop.json context.env, filesystem.md Paths |
done: prompt/assemble.ts envLines, tool/tool.ts absPath, tool/bash.ts |
to do: check the chat prompt names nothing longer than the tree's paths |
Teams: the tools team_add team_send team_read team_stop |
harness/team.md, harness/tools/team_*.json |
done: tool/team_tools.ts, on team/team.ts and team/runtime.ts; members on the subagent machinery (app.ts spawn with member) |
to do: services/tools.py, services/subagent.py |
The size setting agents {min, max}, the cap, when a team is offered |
harness/team.md §2, loop.json team.agents |
done: config/schema.ts agents, config/settings.ts agents.min/agents.max, team/team.ts Team.check/fix; /team size, the agents row in /effort |
to do: chat settings menu, instance setting, per-person default |
The room: delivery and its marks, who receives what, reports, waking, team_read's view |
harness/team.md §5, §7, loop.json team.marks, team.read |
done: team/team.ts send, post, finish, read; team/runtime.ts (delivery at the step boundary, waking); /team |
to do: the Team panel over SSE |
A manager's refusal of work tools; the size across the tree with task; stopping a subtree; waiting for a slot |
harness/team.md §3, §6, §8, §9, loop.json team.work, team.texts |
done: team/team.ts refusal, isWork, taskRefusal, stopCmd, fillSlots; the engine asks before the permission check (session/engine.ts); tool/job_tools.ts job_send |
to do |
blocks/team_lead.md, blocks/team_member.md; size notes (context.note.team*) |
harness/prompts/, loop.json context.note |
done: prompt/assemble.ts (teamLead, member); the notes: team/team.ts noteLines, session/prefix.ts noteFor |
to do |
| A device's team over the link |
harness/team.md §11: members as subagent jobs; the room not carried yet |
done: a member is a subagent job described <name>: <role> (jobs/registry.ts team); /team works over ACP |
to do |
Spec 3.3.0 — CLI side done on dev, LLeMbas to do
harness/VERSION is 3.3.0 (spec commit 02c7282). The CLI carries it on dev (6e0582d, for
2.0.0-beta.5): the conformance area subagents passes there, and team with its step renamed
task_done. In the LLeMbas column a file is where it is expected to go, not where it is.
| Concept |
Spec |
LLeMbas CLI |
LLeMbas |
| "Subagent" everywhere a person or a model reads it; "helper" retired |
harness/subagents.md §1 |
done: /effort, /team, /settings (the config schema's texts), the agent list |
to do: web UI, Desktop, Android, Admin, tool texts |
The subagent's model: the session's, unless the person named another (not_named); no setting; an agent file's model unused |
harness/subagents.md §2, loop.json subagents.texts, subagents.named |
done: team/subagents.ts named, personTexts, subagentModel; session/engine.ts personSaid (the store's messages, compacted ones included); app.ts spawn, the team's resolve |
to do: the chat's own messages as the source; drop any subagent-model setting |
Capacity: same_group, one_request, no fallback |
harness/subagents.md §3 |
done: team/subagents.ts subagentModel, before session/capacity.ts's busy rule |
to do: services/subagents.py (or wherever services/helpers.py went) |
The offer: a model could serve; the setting shown as Subagents; context.note.team_own, subagents.setting.own |
harness/subagents.md §4, team.md §2, loop.json subagents.setting, context.note.team_own |
done: team/team.ts couldServe, fix, unavailable, noteLines; app.ts usableModels; the Subagents row in /effort, /team size, /team |
to do: chat settings menu, the note |
Spec 3.4.0 — CLI side done on dev, LLeMbas done on dev
harness/VERSION is 3.4.0 (spec commits 4b8786b, b66891e; CLI dev f3db970). Both carry it on
dev: the conformance areas progress and delegation pass in both, and team with its new
cases. LLeMbas copies the CLI's harness/ at that commit (the lock is re-pinned to a tag at
release).
| Concept |
Spec |
LLeMbas CLI |
LLeMbas |
| Progress phases: the object, texts, the line, pacing |
harness/progress.md, loop.json progress |
done: session/progress.ts (progressText, progressLine, ProgressTracker on every engine's bus); the spinner line (tui/components/spinner.tsx) |
done: services/progress.py (text, line, Tracker, Pacer, current); set in services/generation.py (_writing, _running_tool, _final_progress, prompt_read); /api/v2 status frame {text, progress}; the page's progress frame and static/js/progress.js; the texts are i18n keys in every catalogue; a scheduled run's progress (schedule/runs.py run_progress) |
| Progress over the link |
acp.md capability progress |
done: the phase event, progress in _lembas/session/status |
done: services/device_link.py (device_progress, apply_event phase; read off the events for a device without it: _derived_phase; _reattach) |
| Only the main agent adds, assigns, replaces, stops, decides; sub-managers; ids, positions, parents; slots |
subagents.md §5, §6, §8, loop.json team |
done: team/team.ts (add with parent, assign, replace, openSlots, info), tool/team_tools.ts |
done: services/team.py (add, assign, replace, open_slots, tree_info, main_only_refusal); the runners in services/team_run.py (RUNNERS, tool_defs) |
| Modes inherited, request options, who decides a call, grants |
subagents.md §7, conformance/delegation.json |
done: team/delegation.ts (checkMode, whoDecides, tighten); session/engine.ts team.permit; app.ts |
done: services/team.py (check_mode, who_decides, tighten, spec_evaluate); at the call team_run.delegation_refusal. A chat on the server never puts its own tools to the person, so its main agent is auto (plan in Plan mode) and a call nobody could allow is refused (members run unattended) |
team_finish, findings, running out of context, ended subagents kept |
subagents.md §9, §11 |
done: team/team.ts finishTask, noteFinding, readFindings, pause; team/runtime.ts (the final turn); session/engine.ts team.contextFull, team.ended |
done: services/team.py (finish_task, note_finding, read_findings, pause); services/team_run.py (note_context, context_full, pause_member, the end/final effects); generation.end_after_round; member chats kept as long as the team (chat.sweep_temporary) |
What clients show: the tree, transcripts read-only, /context per subagent |
subagents.md §12 |
done: /team (session/commands.ts treeText), /team open, /team findings, /context <name> |
done: services/tree_view.py; /api/v2/chats/{chat}/tree, /subagents/{id}/transcript, /findings, /stop; the stream's tree frame; the web activity panel (activity.tree_panel, chat/_activity_tasks.html). Desktop and Android: their engineers |
| The tree over the link; an agent chat's subagents on the device |
acp.md capabilities tree, agents; Subagents in an agent chat |
done: acp/agent.ts (takeAgents, tree), acp/jobs.ts (teamView, teamTranscript, teamFindings, teamStop), acp/share.ts through the hub |
done: services/device_link.py (agents/subagents/said in context_for and _open, configure_agents, clean_tree/_take_tree kept on Chat.team_tree_json, team_view/team_transcript/team_findings/team_stop, subagent on an approval); no server subagents for an agent chat (team_run.may_have_team) |
Spec 3.6.0 — the server's alone, LLeMbas done on dev
phone_action (harness/phone.md) is scope: llembas: the CLI never offers it and has no runner
for the conformance area phone, which is skipped there by name.
| Concept |
Spec |
LLeMbas CLI |
LLeMbas |
Who offers it (requires: phone), the capability phone_actions |
phone.md §1, loop.json phone.capability |
not offered (forCli: scope llembas) |
done: client on POST /api/v2/chats and /messages (api/v2/chats.py), Chat.phone_message_id, services/tools/resolve.py _offered_in, services/tools/phone.py reachable |
| A call checked; what the phone is sent |
phone.md §2, conformance/phone.json check |
— |
done: services/phone.py check |
| The card, the wait, the answer as the result |
phone.md §3, conformance/phone.json result |
— |
done: interaction.phone_card, generation._settle_phone, the interactions route's result, services/phone.py result_text; the app (LLeMbas for Android) carries it out |
Spec 3.7.0 — CLI side done on dev, LLeMbas to do
harness/VERSION is 3.7.0: one display in every client (harness/display.md, loop.json
display), and python's three refusal texts.
| Concept |
Spec |
LLeMbas CLI |
LLeMbas |
A call's one short title, in the transcript, as running_tool's what and over the link |
display.md §1, loop.json display.title |
done: session/display.ts callTitle; said once on the tool_start event (session/engine.ts) and read by the transcript (tui/state.ts), the tracker (session/progress.ts), lembas run (headless.ts) and the link (acp/agent.ts) |
to do: tool_blocks.block_for titles by kind and progress.what_of by another key order — both become the one rule (pattern and query before path) |
| States running / done / failed / denied, the duration, the facts |
display.md §2 |
done: tui/components/messages.tsx ToolLine, session/display.ts resultFacts |
to do: a running state on the card; diff_counts counts by line prefix (a header without a/ b/ is counted, as the CLI's own patches are written) — the spec counts by hunks |
stopped / failed stay on the reply |
display.md §4 |
done: the end item (tui/state.ts, EndLine), kept in the session's meta ended (session/engine.ts storedEnd) |
to do |
| The cards' actions |
display.md §5, loop.json display.actions |
had them: tui/components/permission.tsx, question.tsx, plancard.tsx |
web has them; Desktop to do |
| Numbers in the client's locale |
display.md §6 |
done: tui/locale.ts (LC_ALL, LC_NUMERIC, LANG) |
to do |
| A refused call over the link |
acp.md session/update |
done: one tool_call, failed, _meta.lembas.denied |
reads _lembas/event tool_denied; tool_start now carries title |
Spec 3.8.1 — a text; both carry it on dev
harness/VERSION is 3.8.1 (CLI dev 89e9e47): prompts/blocks/html-pages.md says that what
the person asks to see in the answer is a page, not an HTML file opened with show, and that
what has to run is not a page. No tool, rule, field or conformance case.
| Concept |
Spec |
LLeMbas CLI |
LLeMbas |
| What a page is for, and what a shown file is for |
pages.md §2, prompts/blocks/html-pages.md |
nothing to do: an agent chat is never offered pages; tests/pages.test.ts holds the text |
done on dev: a development copy of harness/ at that commit (tests/test_html_pages.py holds that the text reaches the prompt); the lock is re-pinned to the CLI's next tag at release |
Spec 3.8.0 — both done on dev
harness/VERSION is 3.8.0: reports from scheduled runs, HTML pages in answers, which
permission rule decides.
| Concept |
Spec |
LLeMbas CLI |
LLeMbas |
report_write, requires: scheduled, one report per run |
reports.md §1–§2, tools/report_write.json |
done: tool/report_write.ts; the engine's requirement scheduled (session/engine.ts could/met), set for a session a schedule opened (acp/agent.ts equipReport) |
done: services/reports.py tool_state, clean_call, result_text; the tool in a schedule's run (services/schedule/runner.py) |
| Notify when and its instruction in the run's prompt |
reports.md §3, loop.json scheduled.notify |
the server composes the prompt; /schedule new asks for it (tui/commands.ts), acp/scheduled.ts notifyInstruction for the conformance |
done: the schedule's notify (services/schedule/notify.py policy, default_policy), services/reports.py notify_value, condition, instruction |
| What a run leaves; the retired sentinel |
reports.md §4–§5 |
the device answers with the report (runOutcome); the fallback and the history line are the server's (runLeaves for the conformance) |
done: services/reports.py outcome, note_of, file; notifications from the report (services/schedule/notify.py announce_report) |
| A run on a linked computer |
reports.md §6, acp.md capability reports |
done: scheduled.notify read, scheduled.report in the answer |
done: services/schedule/device.py — notify sent only to a device with reports, the report read from the answer |
| Reading reports |
reports.md §7 |
/reports (tui/reportsmenu.ts, lembas/reports.ts) against /api/v2/reports |
done: api/v2/reports.py (list, one, read, delete), services/reports.py |
| HTML pages: the fence, the note, the projection |
pages.md §1, §3 |
done: pages/fence.ts; the note in the transcript, /pages |
done: services/html_pages.py fence, project, pages_of, note |
| HTML pages: offered |
pages.md §4–§5, models/schema.json html_pages |
never offered (an agent chat); the model's flag is kept and unused |
done: services/html_pages.py offered — the instance's switch, with the model's flag and the chat's switch as ways out |
| Which rule decides; making a rule |
permission/rules.md |
done: permission/evaluate.ts |
done: services/agent/rules.py |
Spec 3.11.0 — CLI side done on dev, LLeMbas in progress
harness/VERSION is 3.11.0 (CLI dev, spec text from commit e427fa8): an editor as the
client of lembas serve --stdio, the files of a linked computer, and files that are not text
shown in a chat. The editor plugins and the desktop workspace are clients of these.
| Concept |
Spec |
LLeMbas CLI |
LLeMbas |
Autocomplete: _lembas/complete, _lembas/complete/cancel; the window trimmed; a newer request cancels the older |
acp.md An editor as the client; conformance/editor.json trim; loop.json editor.complete |
done: acp/editor.ts completeBody, trimWindow, completeOnServer; acp/agent.ts complete (one request under way per client, the login held between requests) |
POST /v1/lembas/complete: the model by model, the person's, the instance's; the provider's own fill-in-the-middle or a strict chat prompt; cancelled when the connection closes |
Rewrite of a selection: _lembas/edit, _lembas/edit/delta, _lembas/edit/cancel; no tools; only the replacement back |
the same; prompts/tasks/rewrite.md; editor.json message, output, model |
done: acp/editor.ts rewriteParams, rewriteMessage, RewriteOutput, rewriteModel, runRewrite; acp/agent.ts edit |
to do where the web UI or Desktop rewrites a file of the server's: the same prompt text and the same cleaning |
Editor context in a prompt (_meta.lembas.editor) |
the same; editor.json context |
done: acp/editor.ts editorBlock, added to the turn's user message in acp/agent.ts prompt; left out of the transcript and the history (ATTACHMENT) |
sent by a client that has an editor open (Desktop's workspace through the server): to do |
Unsaved text: ACP fs/read_text_file, fs/write_text_file |
Unsaved text |
done: tool/buffers.ts (fileText, putText, changedInEditor), used by read, write, edit, multiedit, apply_patch; acp/agent.ts equipEditor |
not a client that offers them (the link reads and writes the device's disk) |
| Edits as ACP diff items, on the approval card and on a finished edit's update |
Edits as diffs; editor.json diff |
done: a tool's preview gives each file's text before and after; ToolContext.changed; acp/agent.ts permissionParams, changed; acp/editor.ts diffContent, diffItems |
does not say editor: true: keeps the unified diff text it draws |
The models for a picker and the person's two model settings: _lembas/models, _lembas/editor/settings |
the same; The HTTP API |
done: acp/editor.ts modelsForPicker, editorSettings, settingsToSet |
GET / PUT /v1/lembas/editor; the instance's default and "allowed for autocomplete" in the administration |
Files that are not text, shown: _lembas/show media kinds, _lembas/show/read; capability media |
acp.md _lembas/show; conformance/show.json; tools/show.json; loop.json files.show |
done: tool/show.ts showPlan; acp/agent.ts showMedia, showRead (a handle per file, good while the request is open) |
to do: say media: true, fetch by the handle, keep the file in the person's files, show it by its own detection (services/file_kinds.py); its own show for a chat on the server |
Device files: _lembas/fs/*; capability fs |
acp.md Device files; conformance/device_files.json; loop.json files |
done: acp/files.ts judgePath, baseCheck, sameAgain (judged again after every wait), oneAtATime, DeviceFiles, moveToTrash, sweepParts; on the link only |
to do: the relay and the /api/v2 routes for the apps, under the device's own limits |
Files that run code: read, changed only where the device's remote.files_that_run_code is on; limits.files_that_run_code |
acp.md Files that run code; loop.json files.runs_code; device_files.json (runs_code) |
done: acp/files.ts runsCode; config/schema.ts remote.files_that_run_code; remote.ts files-that-run-code; said in the hello and initialize (acp/link.ts, acp/agent.ts) |
to do: read limits.files_that_run_code and show such a file as read-only, with the device's sentence |
| Unsaved text is never replaced from the disk; what counts as read |
acp.md Unsaved text; editor.json buffer |
done: tool/buffers.ts textFrom, writeTo, fileText, putText; honoured on serve --stdio only |
not a client that offers them |
Spec 3.9.0 — both done on dev
harness/VERSION is 3.9.0 (CLI dev; the spec text from commit 5570654, which added
interactive-only models to 2add569): the model last used in a directory, the two types of
schedule, one permission rule set right, and interactive-only models. The server carries a
development copy of harness/ and re-pins to the CLI's next tag at release.
| Concept |
Spec |
LLeMbas CLI |
LLeMbas |
| The model last used in a directory: what is remembered, where, and when it is written |
acp.md The model last used in a directory; conformance/last_model.json record |
done: session/lastmodel.ts (models.json in the state directory); written by app.ts at a person's prompt, a model setting and chooseModel (_lembas/configure, a shared terminal's hub/configure); never for a borrowed model, lembas run or a schedule's session (SCHEDULED_META) |
nothing to keep: the server stores no directory's model |
| How a session of the device's own starts |
the same, start |
done: app.ts createApp through startModel — asked, project, directory, global, default |
— |
_lembas/directories: model on a Dir, list: false; capability directory_model |
acp.md _lembas/directories |
done: acp/agent.ts directories |
done: services/directories.py browse (the web's dialog and GET /api/v2/devices/{id}/directories), remembered (list: false) |
| The client's rule: a new agent chat with no model chosen starts on the directory's model when the person has it |
acp.md The client's rule; last_model.json client |
clientModel, for the cases only |
done: services/directories.py start, model_for |
| Schedules: Chat and Agentic |
acp.md Two types of schedule |
done: lembas/schedules.ts scheduleType; /schedule, /schedule new |
done: the schedule form and page (web/templates/schedules/); ran_on on a run in /api/v2 |
| An Agentic run's model: the schedule's, else the directory's, else as before; a run never becomes the directory's |
acp.md Starting a scheduled turn |
done: a scheduled session never remembers (acp/agent.ts: remember: false, forgetful); one opened with no model starts on the directory's |
done: services/schedule/runner.py (through directories.model_for, as the run starts) |
A narrower rule that a later one narrows again is set aside (.env.example after a broad allow) |
permission/rules.md §2 rule 2; six cases in rules.json |
done: permission/evaluate.ts lookupRule |
done: services/agent/rules.py (the same floor was there); to do: a rule written again — the same permission and pattern, later — sets the earlier aside too (five more cases) |
A schedule's session: its model kept with it; a scheduled prompt for a session open in a terminal refused (data.reason: terminal) |
acp.md The run's model, When the device is away, or refuses; loop.json scheduled.texts.terminal |
done: session/store.ts SCHEDULED_MODEL_META, app.ts resume; acp/agent.ts prompt |
to do: show the terminal reason on a failed run |
Interactive-only models: the field interactive_only |
interactive.md, models/schema.json |
done: read from /v1/models (lembas/webui.ts specFor); /model says so |
done: services/llm/providers.py interactive_only (the connection's type), /v1/models, /api/v2 model objects |
| Scheduled work never runs on one |
interactive.md §2; conformance/interactive.json scheduled; last_model.json client with scheduled |
done: provider/interactive.ts scheduledRefusal; app.ts (automated: the start, a switch, a subagent), acp/agent.ts (a scheduled session/new and session/prompt refused, data.reason: interactive_only), cli.ts (lembas run with no terminal at all: provider/interactive.ts nobodyAtIt); in a schedule's session a job's wake and a subagent with no person's turn running count too (app.ts scheduledNow) |
done: services/interactive.py refuse_scheduled, usable; services/schedule/models.py, runner.py — its sentence is the spec's; the two last_model cases with scheduled and the interactive area to run from the re-copied spec |
| A session's background calls go to the twin, a default, or nowhere |
interactive.md §3; interactive.json twin, background |
done: provider/interactive.ts twin, background; app.ts backgroundFor — the title (small_model, else the session's) and compaction, asked for or automatic (session/engine.ts summarise), a subagent's own automatic one included; a model that cannot take the summary passed over (unfit), the model asked named and its use counted under it |
done: services/interactive.py twin, background_model, background, compact_refusal (by connection and data group) |
Open items
- Prompt-injection checks on what is saved — the CLI refuses memory entries and skills that
match
memory/threats.ts (from Hermes Agent); LLeMbas, whose memories and skills also reach
the system prompt, has no such check. The patterns could move into the spec as data.
- The
permission conformance area — LLeMbas's mode table is its own; the
spec's modes.json and default rules are to be adopted. Commands themselves
only ever run on a linked CLI, under the CLI's evaluator and the device's
limits, so this affects what LLeMbas shows, not what runs.
- Prompt texts —
family/*.md, blocks/memory.md, blocks/skills.md and
tasks/compact.md still differ from LLeMbas's fragments (per-person,
per-data-group memory; a different skills index; a coding compaction).
fill beyond the bullet rule — LLeMbas's fill also drops a line that a variable left
empty and collapses blank lines; the CLI keeps the empty line. No case in conformance/fill.json
tells them apart; the prompt texts render the same apart from whitespace.
task's writing helper — LLeMbas's write flag has no place in the spec's
task schema and is reachable only through the subagent_run former name.
Since 2.0.0 the general/explore split carries most of it: explore is the read-only helper.
- Quirks LLeMbas does not handle:
prompt-progress (read when a server sends it --
generation.prompt_read -- but never asked for), no-context-length,
swap-banner, effort-placement (effort_style in models/schema.json).
modes/plan.md wording — {{plan_dir}} is a directory on the CLI and
"the plan" on LLeMbas, where "a plan under the plan" reads oddly; the sentence
wants rephrasing so the variable is a clause, not a place.
conformance/edit.json has no $-in-replacement case; the CLI's
replace-text.ts carries that fix beside the upstream copy.
- A background subagent's approval while the chat is idle — on the CLI the session's asker
shows the card whether or not a prompt runs; LLeMbas has nothing to draw a card on when no reply
is running, so such a request is denied there as before (it is labelled when a reply exists).
- A device chat's capacity is the device's. LLeMbas checks
one_model_at_a_time and
helper-vs-helper on its own helpers' rows only.
Known gaps, kept deliberately
- Dialects. LLeMbas speaks OpenAI chat and Anthropic to its providers; the
CLI (2.0) speaks only OpenAI chat, to the server. 1.x's other three are not
required for parity.
- Background commands, snapshots and undo are the CLI's: they happen on the
machine where the work is. Since spec 2.0.0 a job is a shared concept — LLeMbas runs its own
helpers as jobs and shows a device's jobs over the link — but a command is never one of LLeMbas's.