The terminal's round shipped `<kind>#<id> <keys> <text>` with a numeric id
(1-9 digits) and sends /approve <id>, /always <id>, /deny <id> when an id
was shown, /answer <n> without one. lembas_ask now says approval#12 yn …;
ids are a counter per display; /answer with one word is the option, with
two the id and the option. A lembas_ask value cut to state.max_bytes ends
in U+2026 (ask_id.ellipsis), the placed kind too.
Conformance: terminal.json ask_id cases redone (+7).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tools.test.ts still expected "call question again" (changed by the T2
commit); the display's TUI test expected lembas_ask without the ask id.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- User texts: "LLeMbas server" (the word used most) instead of "LLeMbas
instance"; "sign-in" instead of 1.x's "connection"/"webui connection";
"forge" out of SECURITY.md, the config schema, get.sh's help (earlier
commit) and the workspace prompt block. --help: lembas logout [name],
service run [name], files_that_run_code in remote --json.
- within.ts relativeWithin(): the four relative()-and-".." copies (showPath,
the editor's and autocomplete's paths, the prompt's paths) and read.ts's
root+"/" use the one containment. paths.json: a ..cache env case.
- permission/modes.ts: the mode order from modes.json, stricterMode and
clampMode — the seven tables in app, config/load, tool/settings,
session/commands, acp/agent, acp/scheduled and team/delegation go.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- loop.json terminal.surface.ask_id (spec 3.15.0): # and four characters,
new for each approval and each question of a card; texts.wrong_id;
feature terminal_ask_id.
- lembas_ask: "approval yn #k3f9 terminal_run: make test". The released
terminal's parse_ask (kind, keys, text) reads it with the id at the start
of the text, so nothing breaks there.
- /approve, /always, /deny, /answer take the id as their first word; another
id decides nothing and is said; no id answers what is asked now.
Conformance: terminal.json kind ask_id (+6). Display test for the binding.
Also: the await test expects `reported` for an end a user-var record alone
reports (the previous commit's rule).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- promptFree: under a via=uservar record the input mark is not read; the
pane's last line decides whether the prompt is free.
- awaitCommand / awaitPlaced mark an end reported only by such a record
(reported); runAnswer and placedAnswer add run.texts.unverified and do not
give the exit status as known.
Spec: acp.md, The user var route. Conformance: terminal.json prompt +2,
answer +1.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
loop.json terminal.secrets (spec 3.15.0) replaces
terminal.complete.history_secret: named patterns (assignments and set/setenv
of key/token/secret/password/credential/auth names, client password options,
-u user:pass, Authorization/Bearer/Basic, user:pass@ in an address, key
prefixes, a long high-entropy word), one entry for history lines alone.
- lembas complete --shell: a matching typed line makes no request — status 0,
empty output, texts.secret on stderr, the rule's name in --debug.
- History lines are filtered by the same table.
- A terminal context's block with such a command: placeholder, no output.
Conformance: terminal.json kind secret (40 ordinary commands that must not
match, 26 that must), a context case.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- acp/files.ts openRegular(): stat first, regular files only, opened
O_NONBLOCK and checked again; fs/read, stat's hash and the base check use
it. A named pipe under a root stopped the service.
- terminal/context.ts: judgeFile refuses the CLI's own directories (own);
takeContext reads, parses and only then removes. A file that does not read
as a context is left where it is. A context with no command and no screen
is valid and adds nothing (chip_empty; refusals.empty removed).
- lembas terminal starts with a refused --terminal-context and shows the
sentence as a warning.
Spec: acp.md (fs/read, Terminal context), loop.json terminal.context.
Conformance: terminal.json kind file +3 (own), the empty case now accepted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
permission/rules.md §3 (spec 3.15.0): an always answer to a call asked
about for reaching outside the project also makes an external_directory
rule per such path, for the session only, never saved to a project.
evaluate's Decision names those paths (outside); alwaysRules() is what the
engine and the conformance runner both make. A project rule that cannot be
saved no longer fails the approved call.
Conformance: rules.json `call` (+3).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- check() picks the newest release of the running major; a later one is
named (major) and installed only by name. lembas update and the TUI say so.
- update.json held: set by lembas update vX and --rollback, cleared by a
plain lembas update; autoUpdate skips while it is set.
- The fetcher's limit is 30 s of silence (waiting, or between two pieces),
not 30 s in all.
- installTag returns a listing failure; lembas update prints messages, not
stacks.
- get.sh's version_line_ok and the updater's versionLineRefusal: a signed
list must name the version tagged. tests/fixtures/release-version.json is
run against both.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
One ownDir() makes paths.data and paths.state 0700 and tightens an existing
looser one; every writer of the two uses it. The session and library
databases (and their -wal/-shm) and the prompt history are 0600, existing
files included.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- permission/rules.md §1, defaults.json user_only (spec 3.15.0): for a call
of the settings tool only the default and user layers are read. A
project's key that matches it (settings, sett*, *) and a rule made in the
session are not read for it; the loader drops a project key that matches
the name and says so.
- loop.json files.runs_code.project_dirs (was project_dir): .agent and
.lembas. src/runs-code.ts is the one definition; edit mode's guarded files
and device files both read it.
Conformance: rules.json +7, device_files.json +6.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- family/anthropic.md: plan_write/plan_update and their statuses, not the
todo tool removed in spec 1.1.0.
- ask_user's result: 'call ask_user again', not 'question'.
- --help: -m takes a model's id; settings.json's example likewise.
- /trust makes the project directory, so 'no project directory yet — /trust
creates it' is true; it points at /reload.
- SECURITY.md: auto mode.
- tasks.json: the plan, not 'todo', is the checklist of the task at hand.
- tests/harness.test.ts: no prompt text, tool description or tool result may
name a tool the registry does not have, or a former name of one.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The limits are read live, but only load() and session/new asked them: a
session already in memory (the hub's, across links), a terminal's shared
session and an open web terminal were never judged again. lembas remote
disable, a removed root, a lowered mode or terminal off changed nothing for
them.
- get() and terminalFor() judge the session by the rule a new one in its
directory is judged by; one that no longer fits is refused and halted (turn,
queue, subagents, jobs); one that fits is lowered to max_mode. cancel,
status and delete are always answered; a session shared by name stays.
- The link applies a change at once (enforce) instead of waiting for a
request, then redials as before.
- terminal input is judged like terminal/open; a refused terminal is closed
with a reason.
- sessions/list needs a cwd on the link; status and title of a session out
of reach answer as for one that does not exist.
- One within(path, dir) replaces the containment copies; the two written
with relative() called a child named ..cache outside.
Spec: acp.md. Conformance: limits.json (new, 24 cases), paths.json op
within. Link tests against a stand-in server for each of the four changes.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
- src/shutdown.ts: every command's process group is remembered until it is
empty; on exit what is left gets TERM, a grace, KILL. Signals of a run:
first SIGINT stops the turn and the wait for jobs (exit 130), a second, or
SIGTERM/SIGHUP once, ends it now (143/129) with the groups killed.
- settleJobs takes a stop signal and says which jobs it stops; a failed or
cancelled prompt does not wait for its jobs.
- A foreground command that leaves a program in its group says so; the
listener on its output is taken off when the call returns.
- A spawn error is reported as what it was.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
`!`…`` in a command file ran through bash -c with the arguments pasted in
and only the hardline checked — for a prompt from the link too, before any
mode applied. It is now judged as a bash call of the line in the session's
mode and rules and runs only on allow; the arguments are positional
parameters and ARGUMENTS in the environment; placeholders are filled in one
pass; a substitution has the bash tool's environment and a 10 s limit.
Spec: permission/rules.md §6.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The grep tool's permission is judged for the directory it searches; the
files in it were then read with rg --hidden and their lines returned, so a
.env came back unasked in manual and plan mode. Each file a match comes from
is now judged as read of it would be (the rules and the mode as they are);
what is not allowed is left out and named after the matches.
Spec: filesystem.md, 'A search does not read what read would ask about'.
glob/list return names only and are unchanged; show is the person's view.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The files a command names were read from its spelling. Brace lists, ~name,
variables and a path riding on an option read protected files unasked in
manual mode; in auto mode a command could write a protected path; a very
long line kept the judge busy for seconds; the force-push floor matched the
word "main" anywhere and missed deletions.
- permission/rules.md §5 (spec 3.15.0): words are read with their quoting,
expanded as far as modelled (braces, ~, $HOME/$PWD, globs); anything else
is unresolved, and an unresolved word is never allowed by a rule. Option
values, name=PATH operands, redirections and cd are read.
- A path a line may write (a redirection's target, or named by a program
that is not a known reader) that is a protected path is refused in every
mode.
- A line over 32 KiB is asked about in every mode without being analysed;
prefix() no longer joins every prefix of a command.
- force-push-main is a reader of the push's refspecs (check: git_push).
Conformance: permission.json 39 -> 99 cases, hardline.json 44 -> 69.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
LLEMBAS_TERM, LLEMBAS_TERM_PANE, LLEMBAS_TERM_EXECUTABLE, LLEMBAS_TERM_STATUS_DIR,
llembas-term-status=1, llembas-term-input=1, the llembas-term directory and the
llembas_term_status user var are the names. The ones from before the rename are
also read — a whole family at a time, the new one first — so the terminal's
releases before it work unchanged. One place decides: src/terminal/env.ts
(terminalNames, namesOf, isMagic). lembas --version --json: terminal_contract 4,
capability terminal_names_2. connection.json: product term.
The terminal's tests run in both spellings (scripts/test-terminal-names.sh, in
scripts/ci.sh).
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
terminal_run in the display's manual mode types the command without Enter and opens no card;
the call waits for the person and answers ran, dismissed, left or unknown. lembas terminal
settings reads, sets and forgets; the display and lembas complete use what holds in their
directory. lembas complete: --cwd may be left out, --debug says each decision.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A header, the conversation, one row per tool call and cards; input is what the terminal
writes to the pane. The terminal profile of tools (no bash, no file tool), two modes, a typed
command waited for by the pane's status record, context that continues, one conversation per
window, the terminal's two models. The TUI in a split pane keeps working for contract 1.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Spec first. The CLI is the engine behind a LLeMbas terminal: a display-only surface
(lembas terminal) in place of the TUI in a split pane, which stays for a terminal
written for contract 1. Offered: terminal client only.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
- lembas_state is empty until the TUI's prompt box takes what is typed, and
while a menu, panel or subagent's view is in front of it: the first `idle`
means a typed line reaches the box.
- /terminal-context is in no menu (found only in a LLeMbas terminal); a test
drives the real Root with the terminal's one write — the command line,
Enter, the question as a bracketed paste, Enter.
- `lembas sessions --json`: the recent sessions as one array.
- Spec: those three, and that a terminal decides by terminal_contract and
capabilities, not by the version number.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A session whose prefix was kept before the terminal tools existed, or in a
LLeMbas terminal, listed them when carried on outside one. The headless
approval offers a typed command once only; the state publisher is started once.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The CLI's side of harness spec 3.12.0, for a terminal emulator with LLeMbas
built in. Without LLEMBAS_TTY nothing here applies.
- src/terminal/env.ts: the terminal's environment; `lembas --version --json`.
- src/terminal/uservars.ts, tui.ts: the TUI's state as user vars (OSC 1337
SetUserVar), on start and on change, emptied on every way out.
- src/terminal/context.ts, session.ts, command.ts: the context file — read
once, removed, checked — as one <terminal> block on the person's next
message; `--terminal-context` for the TUI and `lembas run`,
`/terminal-context` in the TUI; a chip in the transcript.
- src/tool/terminal.ts, src/terminal/pane.ts: terminal_run and terminal_read
through the terminal's own program, as an argument list.
- src/permission/evaluate.ts: a typed command is judged as bash would judge
it, then asked every time outside auto mode, never always.
- src/terminal/complete.ts: `lembas complete --shell`.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The contract between a terminal emulator with LLeMbas built in and the CLI,
written into the spec before the implementation that follows it:
- acp.md, "A terminal as the client": recognising the terminal by its
environment (LLEMBAS_TTY, LLEMBAS_TTY_PANE, LLEMBAS_TTY_EXECUTABLE), the
session's state as user vars, the terminal context file, the tools
terminal_run and terminal_read, `lembas complete --shell`, and what
`lembas --version --json` says.
- context.md §12: the <terminal> block of a message.
- permission/rules.md §4: a command typed into the person's terminal is
judged as bash would judge it, then asked every time outside auto mode.
- tools/terminal_run.json, tools/terminal_read.json (requires: terminal,
offered: main); loop.json `terminal`; conformance/terminal.json.
The CLI's alone: a server offers none of it.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The display pane is a column of the root now: it stands at the right over the
terminal's full height, beside the prompt and the status bar, from 80 columns
(layout.ts decides both columns' widths from the terminal's width alone). Below
that it is no longer silently absent: the status bar names the key, and alt+d
puts the display in the transcript's place and back.
An images tab shows what view_image viewed, what show showed and what was
attached, drawn by OpenTUI's own image renderable (kitty graphics where the
terminal is found to support them, sixel, else blocks); `images: auto|on|off`.
The transcript has two views over the same items: full, and compact, where a
round of tool calls is one line and a failure or a refusal always has its own.
`transcript: auto|full|compact`, alt+t, /transcript.
The pane gets a session header, a tab bar that fits its width, clickable tabs
and rows of known width; the status bar has a short form for a narrow column,
and the welcome box's hints and the prompt's placeholder no longer wrap inside
a phrase.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
New `connection.md` and `connection.json`: the address rule, discovery and its
outcomes, identity (`llembas-<product>/<version>`), versions judged both ways,
a refused token, the link's handshake, close codes and liveness, the one
reconnect schedule, state between programs as codes, and the table of
conditions, codes and sentences. Conformance: `address` (47 cases), `version`
(31), `errors` (81), answered by `src/lembas/connection.ts`.
`acp.md`: a failed turn is reported in the prompt's answer
(`_meta.lembas.error`); `_lembas/complete` as the code reads it (`sessionId`,
`open`, `context`, `too_large`); the link's close code 4409 for a device
replaced by a newer link of itself, and `linked` only once `initialize` is
answered; `clientInfo`, and the answer to a client that says a higher protocol.
Two points are written as open, not as rules: which address a client stores,
and `min_clients` in discovery.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>