Skip to content

0.40.0 - 2026-09-29

Choose a tag to compare

@github-actions github-actions released this 29 Sep 09:18

Release Notes

Added

  • policy.split({ port, conf?, reserve?, used? }) hands the window's split
    back as a value: { window, max_output, limit, held } — the profile's
    window and the wire's cap (0 for none), the most a request may cost, and
    what reserve held back beyond the cap — with room beside them when
    used names what a request costs: the reply's side, min(window − used, max_output). They are the same readings policy.window, result_cap and
    thinking_cap make for themselves, off the same profile through the same
    three functions, so a caller can log the numbers a run is sized by, check
    a conf before opening a session, or size something of its own against the
    split rather than a second guess at it. A reading, not a policy: it plugs
    into no seam and changes nothing by being called. The shape is
    policy.shapes.split.

  • policy.thinking_cap({ port, conf, call_reserve, budget? }) sends the
    reasoning's stop point with every request, and coding.run{ call_reserve = N } is the opt that puts it on a run. The model cannot see its room, and
    its reasoning comes out of the same allowance as the answer: a beat whose
    prompt has grown has less left for both, nothing in the conversation says so,
    and the tool call the model was about to make never gets written [measured
    2026-09-13 in a sibling lane: a prompt of 24,984 tokens in a 32k window,
    7,121 of them spent thinking, and the call that followed arrived as {}].
    The filter takes the reply's room — the window less the Port's count of the
    request, and no more than profile.max_output where the wire carries that
    cap — less call_reserve, capped by budget when the caller has one, and
    sends it as request.thinking.budget_tokens; under one token it sends
    nothing, since "stop after 0 tokens" is not a stop point. The room is read
    off the same profile policy.window splits the window by, through a
    reply_room beside its request_limit, so the split between prompt and
    reply is decided in one place; what the fold held back as reserve is not
    named to this filter and not subtracted again — it is that room. The conf
    has to turn reasoning on (thinking = true, or a table whose enabled is
    not false), and the filter refuses one that does not: the adapter reads a
    thinking table on the request as reasoning on, and the request's replaces
    the conf's, so a budget over a conf that asked for no reasoning would switch
    it on by itself. It reads no log and keeps nothing between beats — the room
    comes from the Port's own count of the request the fold has just built, which
    is the count the fold already asked for when nothing before this filter
    changed the request. No other harness sizes reasoning per request; the ones surveyed fix
    an effort for the run, and what varies with the remaining room is done
    provider-side where it is done at all. The evidence for doing it here is a
    sibling lane's [measured 2026-09-14: on a 32k window, the beats where the
    stop point fired still delivered their tool call, where the unbounded ones
    filled the window and delivered nothing]. It is opt-in and reaches the wire
    only on a dialect that takes a per-request budget — vLLM's
    thinking_token_budget; llm_proto.openai warns and sends nothing on the
    others, and Anthropic deprecated its own budget_tokens in 4.6.

  • coding.run{ seed = "names" } seeds the targets by path instead of by
    content, and it is the default: the spec, then the list of files to edit,
    and the model reads the parts it needs with the read tool.
    coding.seed(spec, targets, { mode = "names" }) is the same thing as a
    function; seed = "full" is every target whole and line-numbered, the shape
    the loop had before. Names is the shape every run in the sibling lane has
    taken since 2026-09-14 — the rework runs it judged correct (4 of 6), and a
    1,991-line target (2 of 2) that no window in that lane could have held whole
    — and the one published comparison prefers it too: a viewer-based agent
    measured whole-file seeding worst of its options (SWE-agent ACI, 12.7
    against 18.0 for a 100-line viewer). Full has no run behind it since the
    lane switched. seed joins the knobs strict requires a caller to state,
    and goes into the config record with the rest.

  • std.fs has an append op, and coding.run{ ops } says which ops the model
    is handed. Appending is how a file too large for one reply gets written:
    write the first part, append the rest, one call at a time. Without it a
    model that runs out of room mid-file has nothing to continue with — it
    rewrites from the top and loses what it had, or leaves the file empty
    [measured 2026-09-17 in a sibling lane: a run said it would add its tests on
    the next turn, hit the window, and left a 0-byte file. In the one run of
    that task the lane later judged correct, the model's first write arrived
    without its content and was refused, the reply was cut, and the file was
    then written and extended by three appends; the other runs of the task used
    append as well and were still judged wrong — append got the file written,
    it did not get the task right]. The op reads and writes through the
    same primitives the other ops use, holds to the same path_lock, and refuses
    a file that is not there rather than creating one: the op that creates a file
    is write, and one call that either creates or extends is a call whose
    result the caller cannot predict. coding.run{ ops = { read = "read", edit = { "search_replace", "write", "append" } } } picks the tool set; the default
    is { read = "read", edit = { "search_replace" } }, the two tools the loop
    has always handed out. Every edit op is path-locked to the targets, every one
    counts toward the edits a run has landed, and every one resets
    policy.repeat_cap — what makes an old read new again is the file having
    changed, and any of them changes it. The system line names the edit tools it
    was given, an op std.fs does not have is refused by name, and ops joins
    the knobs strict requires a caller to state.

  • policy.require_args() refuses a tool call whose required arguments did not
    all arrive, before the handler runs: { ok = false, reason = "argument_missing", missing = <key> }, naming the argument and saying where
    a call like that comes from. A reply that runs out of room stops wherever it
    had got to, and that may be the middle of a call's arguments — the call
    reaches the tool with a path and no content, and the tool answers in its
    own vocabulary for a field it found missing, which says nothing about the
    reply having been cut [measured 2026-09-17 in a sibling lane: five fs_write
    calls arrived with no content and three of them drew no word about it, so
    the model sent the same shape again]. The check is on the arguments rather
    than on finish_reason, because the servers do not fill that field reliably
    — vLLM reports a call cut at the output ceiling as a whole one — and nothing
    is retried or repaired: re-sending on the harness's own initiative is the
    loop other harnesses report. A tool declaring no required list is handed
    back as it is. coding.run wraps its tools with it, outermost of the three:
    a call that arrived without its arguments is not a repeat of anything and has
    no result to measure. Beside it, a beat whose answer stopped at the output
    limit (stop_reason = max_tokens / length) is no longer read as the
    model declaring it is done, and the next request carries the fact as one
    harness line.

  • coding.config_of(opts, resolved) and coding.result_of(st, max_iters) are
    the two halves of a run that were built inline: what the run was configured
    with — every knob with its value and whether that value came from the
    caller, this module's default, or was discovered by asking the port —
    and the result the run answers with. Both are functions of their arguments,
    so what a config event will say, and what a given end state reports, can be
    checked without opening a session.

  • knl.shapes.tool_spec declares what a tool is — its name, what the model is
    told about it, its input schema, and the function that runs it. That triple
    was written three times and nowhere declared: std.fs.tool_specs answers
    with it, knl_adapter.tools takes an array of it, and a device's map holds
    it under the name. Now the kernel owns the one declaration and the other two
    are projections of it — a device's entry is the spec minus the name its map
    keys on, and knl_adapter.shapes.tool_decl (what a provider is shown) is the
    spec minus the handler, both taken from its fields rather than restated.
    knl.device checks each entry against that shape instead of a hand-written
    reading of it beside it, so a tool with no handler, or one whose handler is
    not a function, is refused where the device is built and the message names
    the tool.

  • coding.run splits its opts by where a value comes from, and refuses to
    start without the ones it cannot answer. Three facts about the model are
    tripwires rather than defaults, because a default here is a number invented
    about somebody else's server: the reply's room (llm.conf.max_tokens, the
    cap the wire carries, or the new reserve opt, the tokens the fold holds
    back when no cap is sent), the window (llm.conf.context_window, or a port
    whose profile can ask its server — asked up front now, so the refusal comes
    before the baseline verify rather than out of the fold a command later), and
    the reply's seconds (llm.conf.timeout, the line agent.run already draws).
    All three are checked together and the refusal names each missing one and
    the opt it goes in. thinking, the sampling knobs and reasoning_effort are
    not tripwires: absent, they are not sent, and the server's own default
    stands. The loop's own policy — iterations, turns, the verify's timeout
    curve, the caps, done — keeps every default it had, and strict = true
    gives those defaults up: each such knob must then be named by the caller,
    and the run refuses while any is not, listing all of them at once. strict
    is a lever the top level pulls on itself and is never read from the
    environment here, for the reason rustc has --cap-lints. What a run was
    configured with is written into the record as one config event and handed
    back as result.config: every knob with the value it ran at and where that
    value came from — caller, default, or discovered for a window a port
    asked its server for — so what a run did is read off its own log instead of
    reconstructed from the caller's source.

  • policy.window{ fit = { reserve } } holds tokens back for the reply. The
    limit a fitted window measures against is the context window less
    profile.max_output, so a port that sends no answer cap leaves the whole of
    it to the request: the fold fills it with prompt and the model has nowhere
    left to answer [measured 2026-09-13 in a sibling lane: in=32,718 / out=50
    for two beats in a row]. reserve is a whole number of tokens held back
    beyond what the wire's cap already covers — max(0, reserve - max_output),
    so a reserve at or under a cap that is there holds nothing extra — and a
    reserve leaving the request less than one token raises rather than sending a
    window of nothing. The fold's report says how many were held (reserve)
    beside the number the candidate was measured against (limit), and the
    predicate fit hands back is held against that same number. Absent, the
    window is the one it was.

  • A coding.run ends when the model says it does, and a green verify alone no
    longer ends one. The verify passing is one fact and never the whole of it: a
    spec spanning a function and the test it asked for goes green on the part
    that had to compile while the test is not written yet [measured
    2026-09-11/12: of 9 runs, the 4 that landed a single edit converged on a
    green before any test existed]. done = "declare" — the default, so a
    caller that says nothing gets it — ends a run when the model answers WITHOUT
    a tool call while the verify is green and an edit has landed. done = "plan"
    adds a plan tool: the model first files the steps it will take, each with a
    shell command that exits 0 once that step is done; the harness runs every
    check after each iteration and hands the results back as facts, and the run
    ends only when all of them pass as well. check_timeout is the seconds one
    such check may take, and is required in that mode. The result says which mode
    ran (done) and, in plan mode, what the checks came to — plan = { total, passed, filed, failing }, where failing names the checks still
    red when the run ended rather than leaving a caller with a count.

  • A failed fs_search_replace says what is actually there. "Not found" on its
    own was the one failure a model could not act on: it said the guess was
    wrong without saying what the file holds, so a model that believes the code
    reads one way re-sends the same belief [measured 2026-09-11: one run sent
    collect::<Vec<u32>>() four times; the file held what the model itself had
    written two edits earlier, and it took narrowing the read twice and six
    attempts to copy it]. The sibling failures already did better —
    search_ambiguous returns the match count, result_too_large the size and
    the limit — and this closes the last one. The result now carries the point
    where the search stopped agreeing with the file and the file's own text from
    there, in the shape the search tried to name; when not even the first line
    occurs, the line sharing the most identifiers with it, which is the case a
    model working from a paraphrase of the seed lands in. An edit whose { minus
    } count differs from what it replaced is reported as well, so a snippet
    appended after a block without its closing brace is answered by the tool
    rather than by the verify two iterations later.

  • std.fs.tool_specs / register_tools require opts.allowed. Which tools a
    model is handed is the caller's decision and nobody else's; a default meant a
    caller that said nothing still got a surface someone else picked, and then had
    no way to know what its model was holding. The old default {"read","edit"}
    handed out the line-addressed edit in particular, which a loop then
    compensated for by telling the model in prose which tool to call — and a
    spec's own "read this file first" was overridden that way [measured
    2026-09-12]. There is no opt-in tier any more either: write, rollback and
    search_replace sit beside the other two, named or absent.

  • The Lua half of the std.fs / std.ts / std.sql / std.kv bridges is an
    embedded module rather than a source file compiled into one call site.
    fs_tools / ts_tools / sql_tools / kv_tools now live under
    blocks/lib/, each bridge requires its own by name after registering the
    Rust half, and the require path answers the way it does for every other
    module: a project's .agent-block/lib/fs_tools/ wins, the embedded source is
    the fallback. So agent-block vendor fs_tools changes which file operations a
    model is handed, under what names and locked to which paths, with no install
    in between. A VM with no require registry — a unit test's bare Lua::new() —
    still gets the embedded source directly; only "module not found" falls back,
    so a syntax error inside a project's copy is reported rather than silently
    replaced.

  • A module vendors with its specs. vendor policy writes
    .agent-block/lib/policy/spec/*.lua beside init.lua — the same mlua-lspec
    specs that check the embedded module — and lua-spec-runner --project <dir>
    (just test-lua-project <dir>) runs a project's vendored specs with its
    .agent-block/lib/ first on the require path, so the copy that was edited is
    the one they check. --list shows the count (policy (spec/: 11)). The
    specs are listed by build.rs from the tree (blocks/{,lib/}<module>/spec/),
    not by hand; the lspec fixtures for agent, coding and llm_proto moved
    from tests/fixtures/ into those spec/ directories, and lua-spec-runner
    looks in both blocks/<name>/spec/ and blocks/lib/<name>/spec/.

  • -p/--project reads AGENT_BLOCK_PROJECT from the environment, so a fixture
    suite (AGENT_BLOCK_PROJECT=<dir> cargo test -p agent-block) can be pointed at
    a project's vendored copies. An explicit -p still wins.

  • agent-block knl sessions [--after <ID>] [--limit <N>] [--store <PATH>] and
    agent-block knl backup --to <PATH> [--store <PATH>]: the two questions a
    reader outside the host could not ask of a kernel store. export --session
    needs an id, and the only listing of a store's sessions was
    knl.views.sessions, which is Lua running inside the host; sessions is
    that listing as JSON Lines, { "session": <id>, "head_seq": <n> } one
    record a line, paged by an exclusive cursor (the last id printed is the next
    call's --after, and the default limit is 1000). It reads the stream
    counter rather than the events, so it is the truth of which sessions exist
    rather than of which still hold rows. backup copies a store that something
    is writing to, which cp is not: in WAL mode the -wal file holds
    committed pages the main file does not yet, and a copy taken between two
    writes can carry half a transaction. The copy is the whole file taken in one
    step under one read transaction, so it opens as an ordinary kernel database
    and export --store <copy> reads it; the destination must not exist, and a
    path that already holds something is refused rather than overwritten. Both
    resolve --store the way export does and fail the same way — one line on
    stderr and exit 1 — except that an empty listing is an answer rather than a
    failure.

    Three other additions of the release are deliberately not taken.
    archive_then_retain and its Sink would need a retention policy this
    project has not decided — when a run's log may go, and where it goes first —
    and the door stays open upstream for when it does. ProjectionRunner::follow
    has nothing to run: the kernel builds no eventsdb projections. And
    Filter::stream_prefix selects nothing meaningful here, because this
    kernel's session ids are UUIDs.

Changed

  • The two consumers, agent and coding, are written in Teal and live
    under blocks/lib/ with every other embedded module
    (blocks/lib/agent/init.tl, blocks/lib/coding/init.tl). They were the
    last embedded modules in Lua, and they sat where htl check could not
    see them: the checker reads the modules under blocks/lib, and a block
    at blocks/<name>/ belongs to none of them. Nothing changes for a
    caller — require("agent") and require("coding") answer the same
    tables, agent-block vendor agent still writes lib/agent/init.lua (the
    Lua the binary embeds, as for every Teal module), and inspect_tools
    reports the same two blocks. Both take one shape now, stated in the code
    rather than the header: prepare takes the opts to a Run — for agent
    the provider, the MCP servers connected and every tool source bound into
    one map; for coding the tripwires, the targets, the fs tools locked to
    them, the seed, the system line and the seams — run_loop drives the
    beats, and result_of reads what it answered into the result callers
    have always read. host_types.d.tl declares what the two read of the
    host that nothing had declared: tool.call / tool.schema, the mcp
    functions, and std.fs.tool_specs. policy.require_args's published
    type takes its opts as optional, as the function always did.

  • The kernel's shapes are a sub-module, knl.shapes (blocks/lib/knl/ shapes.tl). knl/init.tl held the code and, in the middle of it, a
    thousand lines of data — every public contract as an lshape and the
    registry that names the shape of each export. The data reads nothing of the
    code's, so it is in a file of its own now, required by init.tl and
    published as knl.shapes unchanged: a caller reads require("knl").shapes
    as before and the 33 keys are the ones they were. What is visible from
    outside is agent-block vendor knl, which writes lib/knl/shapes.lua
    beside lib/knl/init.lua as it writes every module with its sub-modules,
    and the spec runner, whose freshness check reads every .tl beside a
    module's init.tl rather than that file alone. fs_tools.tool_specs is
    one builder per op behind a <total> map and a context built once, from a
    single 725-line function, and answers the same specs in the same order.
    The Lua specs stand in for the knl bridge with one fake,
    knl/spec/fake_bridge.lua, where four carried their own; a spec of the
    fake pins what it mirrors.

  • knl is written in Teal, and its declaration is the module. The kernel was
    the last of the embedded modules still in Lua, typed for the ones above it
    by a hand-written blocks/lib/knl.d.tl that a drift test held to the
    module's exported names. The records that file declared — Session,
    Device, Request, Outcome and the rest — are in blocks/lib/knl/ init.tl now, beside the module's table and aliased into it with type X = X, so kernel.Session still names the type from a module that requires
    this one and the two can no longer say different things: Teal holds the
    module to its own record at build time, which is what the declaration was
    standing in for. They are declared BESIDE the table rather than inside it
    because a record nested in the module record is a KEY of it in the
    generated Lua, and knl/spec/api_spec.lua walks those keys — every export
    must have a registry entry. knl.d.tl is gone, and the drift test now
    reads the module's own record, which is a tighter check than before: the
    four Outcome constructors the old declaration left out are declared now.
    The bridge's types come from knl_types through a local type import, so
    the kernel's load-time requires are the one they have always been
    (lshape) — a hard require would raise in the VMs that have no
    knl_types, which is the case the registry's pcall fallback exists for.
    Nothing a caller sees moved: require("knl") answers the same table with
    the same exports, knl.shapes, knl.views and knl.Outcome hold the same
    names, and every spec runs unchanged against the Lua Teal generates. One
    local function was renamed on the way — record, which appends an event
    through the dev-mode contract, is record_event, because record is how
    Teal spells a type declaration and a local cannot take that name.

  • just gen regenerates every file in the tree a generator owns, and just check runs it first: gen lint test test-lua check-tl test-tl. Two files
    are rendered from Rust — blocks/lib/knl_types.d.tl for the checker and
    blocks/lib/knl_types.lua for the two runners with no host — by the test
    that also pins them byte for byte, which writes instead of comparing under
    AGENT_BLOCK_WRITE_DTS. Nothing in check had ever run it, so the gate
    could only REPORT that one of them was stale and leave the person to
    remember a cargo test incantation. With the generator first the run
    converges from any starting state — stale, hand-edited or clean all end at
    the same bytes — and a second just check changes nothing. The paths are
    one generated variable in the justfile rather than a list per consumer.
    It converges only because the formatters leave those two alone, which is
    what the .styluaignore entry is for: stylua reformatting one after the
    generator wrote it is what put just lint and cargo test -p agent-block-core at odds in the first place.

  • .githooks/pre-commit, tracked and opt-in, refuses a commit whose generated
    files disagree with their generator: it runs just gen and stops if that
    changed anything, naming the recipe that settles it. just hooks points
    core.hooksPath at the directory; nothing installs it for you, because
    core.hooksPath is a setting in your own clone. git commit --no-verify is
    the way past it, for the commit that is changing the generator itself.

  • The host's globals are declared in one place, blocks/lib/host_types.d.tl,
    and a module written in Teal states none of its own. It used to write the
    pair — local host = require("host_types") and then global std: host.Std
    — and a project's own .tl was told to do the same; now it requires the
    file and the globals come with it. std, tool, sh, http, mcp and
    log are declared there against the records already beside them, and the
    knl syscall bridge with them, loose (a map of syscalls) for the reason
    Mcp is loose: naming its vocabulary would have the file read knl back.
    The reason it has to be one place is a checker one and is written at the
    declarations: a global declared in a .tl that other modules REQUIRE
    splits that module's record types, so two consumers in one check run each
    get their own knl.Session and a value cannot pass between them [htl
    0.8.0]. Nothing at run time changed — a declaration generates no code, the
    globals are still the host's, and a spec can still install a fake std
    before requiring the module.

  • policy is one module in five files. blocks/lib/policy/init.lua had
    grown past three thousand lines, and it is now the door — the header, the
    eleven gathered by name, policy.shapes, the api registry and its dev-mode
    gate — over four files grouped by what their policies read: room
    (window, tokens, result_cap, thinking_cap — the ones that size against the
    model's window, and the one split of it they share, request_limit for the
    prompt and reply_room for the reply), tools (repeat_cap, require_args —
    the ones that wrap the device's tools map), carry (the one filter that
    reads the log) and loop (verdict, stagnation, retry, escalate — what the
    loop asks between beats); shared holds the defaults, the log readers, the
    contract prelude and the shapes more than one file hands out. Nothing a
    caller sees moved: require("policy") answers the same table with the same
    eleven exports and the same shapes, every spec runs unchanged against it,
    and agent-block vendor policy copies the six files as one module
    (policy.<name> is how a sub-file is named, as llm_proto.openai is). The
    every-module fixture counts twenty-seven embedded names where it counted
    twenty-two.

  • coding.run seeds the targets by name unless told otherwise: seed
    defaults to "names", where the loop had always handed every target over
    whole and line-numbered. A caller that wants the old shape says seed = "full". coding.seed the helper is unchanged — its mode left nil still
    reads as "full" — the default moved on the loop alone. The reasons are
    under Added, with the opt.

  • The coding loop's state is one table and its steps are plain functions.
    coding.run's implementation held its state in a dozen mutable locals that
    a dozen nested closures read and wrote: the plan tool handler wrote the
    steps into a local, the verdict's changed read an edit counter the loop
    moved, the Outcome.match arms smuggled the answer out through a sink table
    and recorded a failure by side effect, and the run's own result was built
    inline around an immediately-invoked function. What a step touched could
    only be learnt by reading everything above it. The loop now holds one st
    table with every moving field named and initialised in one place, and each
    step is a module-level function of its arguments — run_verify,
    run_checks, edits_in, failing_of, beat_outcome (whose arms return
    the answer, or the reason there is none, instead of writing it somewhere),
    run_iteration, and the two below. coding.run's behaviour is unchanged,
    and is now covered end to end: four tests drive the real binary and the real
    bridges against a scripted in-process model — the model declaring on a green
    verify, a green that does not end the run while tools are still being
    called, done = "plan" ending when every filed check passes, and the
    tripwire that refuses a run naming the reply no room.

  • The four bridge tool modules are libraries, and the bridge does the wiring.
    fs_tools / kv_tools / sql_tools / ts_tools were still the scripts
    they had been before they moved under blocks/lib/: each assigned onto
    std.fs / std.kv / std.sql / std.ts as a side effect and returned
    nothing, so require("fs_tools") answered true and the delegation idiom
    the README gives for every other module — local base = require("embedded.fs_tools"), wrap what it answers — had nothing to wrap.
    Each now ends with return M, like every other embedded module, and the
    bridge installs the functions that table holds onto std.<x> after
    require has found it. A vendored copy is installed the same way, and
    through its __index chain as well, so a copy that wraps one function and
    inherits the rest is whole on both sides: std.fs.tool_specs is the
    wrapper, std.fs.register_tools is the base's. A copy still written the old
    way is refused by name, with the command that rewrites it, rather than
    leaving the tools silently missing.

    Each module publishes its opts contract as data under M.shapes and asserts
    it in dev beside the refusals it already had — the hand-written ones stay,
    and stay loud in both modes, because a caller that omits allowed omits it
    in production too. Each has a spec of its own now
    (blocks/lib/<name>/spec/), and one e2e test holds the whole set to the
    rule: every embedded module answers a table, under its own name and under
    the embedded. alias.

  • The OpenAI adapter sends no answer cap when the caller names none, and
    profile answers max_output = nil to match. The server's own limit is then
    the window less the prompt, which is the cap a self-hosted model actually
    has; the 4,096 this adapter used to invent was a second, smaller one, and it
    was the one that cut replies [measured 2026-09-12: 103 of 415 beats ended
    mid-reasoning without reaching a tool call, 26 of them at exactly 4,096. The
    server was vLLM, which has only --max-model-len 32768 and treats a request
    with no max_tokens as asking for the whole remainder]. The generic backend
    no longer fills the field either — max_tokens is the request's or the
    conf's, or absent. The knl_adapter's openai Port therefore declares no
    default_max_output, so a fold sized by the profile holds nothing back for
    room the wire never asked for. A conf that names max_tokens is unaffected.

    The Anthropic adapter still sends one, because max_tokens is a required
    field of the Messages API, and its module says why rather than sharing a
    constant that reads as a policy. profile reports the model's own maximum
    as max_output_limit for a caller that wants to raise the cap.

  • agent.run requires timeout and max_iterations, and passes max_tokens
    through as named or not at all. The line is whether the caller knows the
    value and the module cannot: how long this model's reply may take and how
    many beats the run is granted are the run's — the 120 and 20 that stood in
    for them were the same second ceiling as the 4,096 above, under other names.
    A run that names neither answers ok = false saying which, as it does for
    a missing prompt. What stays in the module is what a caller has no basis to
    choose: the retry curve after a transport or API error, the stagnation and
    repeat thresholds, the verify timeout read off the log.

    job.toml requires timeout and job.tick requires max_runs on the same
    line: how long its block may run is the job's to say, how many runs the host
    carries is the manager's (agent-block serve --max-runs, which it already
    passed).

    ScriptSource::DefaultAgent carries an AgentProfile — provider, endpoint,
    model, timeout, beats, answer cap — since the embedded invoker has no other
    place to be told what the run is granted. The profile has no Default; it
    is injected as _AGENT_PROFILE and passed to agent.run whole.

  • The kernel's event store is eventsdb 0.6.0, and nothing in that release
    breaks a caller — every entry is an addition, and the one type that grew a
    field is #[non_exhaustive] — so the move is a version and the two
    subcommands above. What it gives us is the two things a caller could not
    build from outside: a log that is open and being written to can be copied
    consistently, and the store itself can now be watched. The tracing feature
    is on, which is dep:tracing and nothing else — the spans are at debug
    and the events at trace/warn, and this binary's subscriber defaults to
    info, so it costs nothing at the default level. What it shows is what a
    wrapper around the call cannot see, because it is inside the call: how long
    the write lock was held, which batch a projection took, whether a
    subscription woke on the commit channel or on the poll.

  • AGENT_BLOCK_LOG_SPANS=1 turns every span's close into a log line. Most of
    what the store reports is a span with no event inside it — the fields and
    the duration are the whole of it — and the default formatter prints events
    only, showing the spans around them as context, so those paths were silent
    at any filter level. With the switch on they read as
    eventsdb.append{stream=… count=1 position=42}: close time.busy=27µs, so
    the two halves together are
    AGENT_BLOCK_LOG_SPANS=1 RUST_LOG=eventsdb_sqlite=debug. It is off by
    default because it is every span in the process, this binary's own
    included.

  • mlua-pkg is 0.11 (was 0.9). The Registry / Resolver / FsResolver /
    MemoryResolver surface host.rs builds the require chain from is
    unchanged between the two, so nothing in the chain moved; what the bump
    buys is a resolver written against the current trait — the one a Teal
    (.tl) resolver implements — being something the same Registry can hold,
    which is the first step of typing blocks/lib.

  • htl 0.7 is a dependency of agent-block-core, with default features
    off and macros / pkg / dts on: include_tl! for a module written as
    .tl, the resolver that puts one into the require chain, and the
    .d.tl a #[host_module] declares. Nothing uses it yet — this is the
    graph being proven before a module moves. What it proved: mlua stays one
    copy at 0.12.1 with error-send joining its features, and the batteries
    compile under that; the second mlua-batteries (0.7) the proc macro
    pulls is host-side only, so one std.* registers into a state, not two.

  • A module may be written in Teal. Every filesystem tier of the require
    chain (script_dir > .agent-block/lib > lib > $AGENT_BLOCK_HOME/lib)
    now has a Teal resolver ahead of its Lua one: name.tl (or name/init.tl)
    is type-checked and generated at the require, name.d.tl beside a
    name.lua types the Lua without replacing it, and a type error in a .tl
    refuses the require — named with file and line — rather than falling
    through to a copy in a lower tier. The checker is compiled into each VM at
    start (Htl::from_lua; the cost is traced at debug as htl checker attached). What a .tl can require is what has a .tl or .d.tl the
    checker can see: the embedded modules have none yet, so a .tl that
    requires knl or policy is refused with no type information for required module until their declarations land. just check-tl (in
    just check) runs htl check --strict over blocks/lib, with
    crates/agent-block-core/htl.toml naming the require root; just test-tl
    runs htl test there, outside check until the first *_test.tl exists.

  • mcp_tools is the first embedded module written in Teal
    (blocks/lib/mcp_tools/init.tl, embedded through include_tl!): the same
    two functions with the same behaviour, typed — tool_decl over a Tool
    record with both spellings of the schema key, result_text over Blocks
    — and a type error or an htl lint in it is now a cargo build error. What
    the host embeds and vendor writes is the Lua Teal generates, which
    carries no comments; the module's own words are in the .tl.
    blocks/lib/host_types.d.tl is where a Teal module learns the shape of
    the globals the host owns (std, so far only json.encode, growing with
    each module that moves): global std: host.Std is a declaration that
    generates nothing, so the global stays late-bound and a spec can still
    install a fake before requiring the module. host_types.lua beside it is
    the run-time half of that require, an empty table, embedded like any
    other entry. lua-spec-runner takes a Teal module's Lua from the binary
    that embeds it (agent-block vendor into target/lua-spec-runner/), so
    just test-lua builds agent-block first; just lint runs htl fmt over
    blocks/lib beside stylua.

  • The Lua half of the four bridge tool modules is written in Teal —
    sql_tools, kv_tools, ts_tools, fs_tools (blocks/lib/<name>/ init.tl), embedded through include_tl! both in EMBEDDED_LIBS and in
    each bridge's fallback (bridge/{sql,kv,ts,fs}.rs). The same tools with
    the same behaviour, typed: an Opts record per module, one Input shape
    its handlers share, one Def per op, and M.shapes.* as lshape.Schema;
    fs_tools types its helpers (diverges_at, nearest_line,
    line_edit_for, fit_lines) and what tool_specs answers (Spec).
    blocks/lib/lshape.d.tl declares the vendored validator for the checker
    — the t DSL and check — without touching the upstream copy beside it;
    a tool module keeps its tolerant pcall(require, "lshape"), and the
    bridge's bare-VM fallback answers require("host_types") from
    package.preload before running the source (bridge/mod.rs).
    host_types.d.tl grows std.sql / std.ts / std.fs / std.kv.list
    and the tool bridge. The 42 specs of the four modules pass against the
    generated Lua.

  • agent-block vendor ends the copy it writes with a newline. The
    hand-written sources did; the Lua Teal generates for a module does not,
    and a copy that ends mid-line is one whose last line cannot be spliced
    after — the function M.x() … end a project adds before return M.

  • The Teal checker is a state of its own (Htl::new +
    Htl::with_checker_lua), and the VM that runs scripts holds only the
    runtime half: a script cannot require("tl") and reach the compiler, and
    the checker's search path — what a .tl's require is resolved against —
    is no longer the VM's package.path, so a plain .lua resolves exactly
    as before. The declarations the binary carries (host_types.d.tl,
    lshape.d.tl) are written at start to a directory under the temp dir
    named by their content (agent-block-dts-<version>-<hash>/) and put on
    the checker's path, last: a project's lib/foo.tl can require ("host_types") and global std: host.Std against the binary that runs
    it, which before was a type error and a refused require. A project's
    own htl.toml is applied to the checker too, as htl check applies it:
    [check] paths is where a project declares the modules the host supplies
    at run time. And every embedded name is in package.preload (answering
    embedded.<name>), which is where htl looks for a module the host
    provides: a .d.tl on its own in a tier — lib/knl.d.tl, put there to
    type a project's .tl against the kernel — makes the Teal resolver step
    aside instead of answering with its declaration-only stub, and the
    embedded module answers. e2e_teal_lib.rs pins each of these, and
    e2e_host_types_drift.rs holds host_types.d.tl to the host: every
    function it declares on std.* / tool / log is one the VM registers.

  • fs_tools' read no longer raises on a limit that is not a number.
    The move to Teal had floored tonumber(input.limit) without the nil
    check, so limit = "all" from a model raised bad argument #1 to 'floor' where the Lua module had read the whole range; it reads the whole
    range again. A fractional limit is floored (2.5 lines was never a
    thing).

  • The first *_test.tl (blocks/lib/mcp_tools/spec/mcp_tools_test.tl,
    htl test), and just test-tl is in just check. lua-spec-runner
    refuses a binary older than a .tl it would take the Lua from, and skips
    the vendor step under --project.

  • The Teal modules carry htl's markers where they apply. ---@struct on
    every record a module builds whole — mcp_tools.Decl, each tool
    module's Def and Shapes, fs_tools.Spec, and Tool.Meta in
    host_types.d.tl — so a literal short of a field is reported where it
    is written, not found at the first call; ---@nilable on std.kv.get
    and std.ts.last, the two host functions that answer nil, so indexing
    their result directly is reported. What comes from outside — a caller's
    Opts, a model's Input, MCP's Tool and Block — stays unmarked:
    every field of those may be absent, which is the fact, and the loud
    refusals that name a missing one stay in the code.

  • job is written in Teal (blocks/lib/job/init.tl, embedded through
    include_tl!): the same four — read / tick / run and the records
    they write — with the shapes named. Decl is ---@struct with every /
    prompt / context as ---@optional, which is exactly what decl
    promised in prose; Facts, Plan (Start / Skip), Config and
    RunResult are built whole and say so; a Session record is what job
    asks of the kernel's session (append, query), and a spec's fake
    answers the same two. host_types.d.tl grows sh (exec with its
    ExecResult / ExecOpts, kill), std.time.now and std.fs.read.
    The 40 job specs pass against the generated Lua, and job_test.tl
    (htl test) holds the pure half — duration, decl, tick.

  • llm_proto is written in Teal, the two adapters with it
    (blocks/lib/llm_proto/{init,openai,anthropic}.tl, embedded through
    include_tl!): the same wire format, transport and parse, with the
    vocabulary as records. Spec names every field an adapter reads, in one
    place; ToolChoice / Thinking / Classified / Wire / Usage /
    Profile / Health / Result are ---@struct with their optional
    fields marked; Decoded is what a parse answers and Adapter what both
    dialects are. The wire bodies stay {string:any} — they are JSON, and
    the provider's. host_types.d.tl grows http (request with
    RequestOpts / Response), std.env (get nilable, get_or),
    std.task.sleep and std.json.decode. The 117 llm_proto specs pass
    against the generated Lua, and llm_proto_test.tl (htl test) holds
    the pure half — the two normalizers, classify_error, retry_delay,
    health_of, server_root, estimate_tokens.

  • The kernel is declared for the checker, so a module written in Teal can
    require("knl"). Two files. blocks/lib/knl_types.d.tl is generated:
    the syscall types bridge/knl.rs declares (schema-bridge IR) rendered as
    Teal — a record per object, an enum per closed set, a type alias for the
    rest, a field's own object nested and named after it — by the same
    source the lshape knl_types module comes from, so the two cannot
    disagree. The tree holds a copy for the checker at cargo build and in
    CI, a test pins it to the renderer (AGENT_BLOCK_WRITE_DTS=1 regenerates
    it), and the host hands the checker its own render at start beside
    host_types.d.tl, so a project's .tl is checked against the binary
    that runs it. blocks/lib/knl.d.tl is hand-written while knl is Lua:
    the module's exports — open / resume / session / device / beat
    / fold / error / api / views.* / export — the Session the
    kernel's userdata is, Device, DeviceConfig, OutcomeValue, and
    shapes as lshape schemas; e2e_knl_decl_drift.rs holds every declared
    name to what require("knl") exports.

  • supervisor is written in Teal (blocks/lib/supervisor/init.tl,
    embedded through include_tl!), the first module checked against
    knl.d.tl: child / parallel / merge with the same contracts, typed
    — ChildOpts / ChildBudget / ChildEntry / ParallelOpts /
    MergeOpts as what a caller writes, Slot (---@struct) as what a
    sibling's place in parallel's answer holds, ApiArg / ApiEntry as
    the registry's form, and the query options a merge freezes as the
    kernel's own QueryOpts. host_types.d.tl grows std.task.scope /
    with_timeout and the Scope a body spawns into; lshape.d.tl grows
    t._internal. The 55 supervisor specs pass against the generated Lua,
    and supervisor_test.tl (htl test) holds the refusals a call meets
    before a child is opened. Two things the move settled for every module
    after it: a record a module needs only for itself is declared beside
    M, not nested in it — nested, it is a key of the module table, and a
    spec that holds that table to the registry sees an export — and the
    tree now carries blocks/lib/knl_types.lua, the lshape module the host
    builds at start, rendered by the same generator and pinned by the same
    test as knl_types.d.tl: htl test and lua-spec-runner have no host
    to build one, and the kernel's tolerant pcall(require, "knl_types")
    otherwise met htl's declaration-only stub and raised at its first index.

  • policy is written in Teal, all six files (blocks/lib/policy/ {init,shared,room,tools,carry,loop}.tl, embedded through include_tl!):
    the eleven policies and split with the same contracts, typed. Every
    factory's opts is a record beside the file that owns it; shared
    declares what the six share — a stored Event, a BeatRecord, a
    ToolPair, the registry's ApiArg / ApiEntry, and the Port /
    Profile a room policy asks — and the door names each factory by the
    type its file exports (room.WindowFactory, loop.RetryFactory, …),
    aliases that generate no Lua. Split, Verdict and a Check are
    ---@struct with their optional fields marked. Two readings changed
    form for the checker and not the reader: the profile's whole numbers are
    floored where they are formatted, and opts_of is generic so a factory
    keeps its opts' type through the prelude. The 213 policy specs pass
    against the generated Lua, and policy_test.tl (htl test) holds
    split, retry and escalate's default judgement.

  • knl_adapter is written in Teal (blocks/lib/knl_adapter/init.tl,
    embedded through include_tl!): the two Ports are records with the
    metatable the Lua gave them — the same __index class, so
    LLMPort.new{...} and port:open(conf) read as they did — and the
    checker holds a provider impl to build / parse / classify and a
    tool source to declare / invoke. Verdict, Profile, the count
    cache and what the transport Seen are records beside M.
    host_types.d.tl grows the mcp bridge (list_tools, call), and
    llm_proto's Adapter names DEFAULT_MAX_TOKENS. The 74 knl_adapter
    specs pass against the generated Lua, and knl_adapter_test.tl (htl test) holds the Port contracts and the tool binding.

  • session is the second module written in Teal
    (blocks/lib/session/init.tl): the same load / save / clear over
    std.kv, with Messages ({{string:any}}) as what load answers and
    save takes. Its record is named M, so the generated module reads as a
    hand-written one does (M.NS = ..., return M) and a vendored copy is
    edited the same way. host_types.d.tl grows with it: std.kv (get /
    set / delete) and the log bridge (debug / info / warn /
    error).

Removed

  • The seal is gone. Every embedded module can be shadowed and vendored, the
    kernel and its declaration layer included: a lib/knl/init.lua is the kernel
    that run uses, and agent-block vendor knl (or knl_adapter, or lshape)
    writes the copy with the specs that check it. AGENT_BLOCK_UNSEAL no longer
    exists — there is nothing left for it to downgrade — and vendor --list no
    longer prints a sealed column. Every module here is Lua so that a project
    can change any of it, which is what a runtime that is Lua on top of Rust is
    for; a module being well tested and a module being replaceable are
    independent properties, and the seal took the one for the other. What is
    true, and what the seal stood in for, is that a replacement of the kernel has
    to keep what the rest of the binary reads by name — and that is said where it
    can be checked rather than asserted in prose: the module doc of
    crates/agent-block-core/src/bridge/knl.rs for the Rust half, and the specs
    vendor knl writes beside the copy for the Lua half. knl_types is still
    the one embedded module with no file to hand out, being generated at start
    from the Rust types; a filesystem copy of it wins over the generated one, and
    vendor knl_types now says that rather than calling it sealed.

Fixed

  • A coding.run plan check that percent-encodes one of the run's target
    paths is refused when the plan is filed, rather than run every iteration
    until the cap. A framework's dynamic-route directory — [ns], [id],
    [...slug] — reaching a check as %5Bns%5D names a file that does not
    exist and that no edit will bring into being, so the check cannot pass in
    this run or any other; the run then spends every remaining iteration
    re-running it. What the model got back from running it was the shell's own
    No such file or directory, which has been shown not to be enough to make
    it write the path differently.

    So M.plan_of says it at the filing, in the terms the model has to act on:
    steps[1].check names '<what was written>', which is '<the path>' percent-encoded: that path does not exist, so the check can never pass. Use <the path> exactly as written. The refusal is the filing's, like a
    malformed plan — the tool answers bad_plan, no plan is stored, the model
    refiles, and nothing counts as an edit or as progress. Every offending check
    in a plan is named in the one message, so a plan with three of them is one
    round trip. declare mode files no plan and is untouched.

    The test is a decode-and-compare rather than a list of characters: if a
    target path appears in a check once its escapes are resolved and did not
    appear before, the model encoded it, whatever it encoded — an encoded slash
    in a path with no brackets at all is the same mistake and is caught the same
    way. A check that merely contains a % decodes to itself and cannot trip
    it. M.plan_of takes the targets and the repository to hold a check
    against; called without them it checks what it always did.

  • coding.run with done = "plan" ends the run when every check the model
    filed passes, instead of running to the iteration cap. M.decide required a
    declaration — an answer with no tool call — in every mode, and a model that
    keeps calling tools never produces one: a run whose plan was filed, whose
    seven checks all passed and whose verify was green burned all ten iterations
    and reported ok = false, failure_reason = "max_iters" with every fact
    green.

    The declaration is there because a green verify is not enough by itself — a
    spec spanning a function and the tests it asked for goes green before the
    tests exist — but plan mode already has that covered, and has it in a better
    form: the checks are the model's own description of what finished looks
    like, filed in advance, in shell commands, and confirmed by the harness
    rather than taken on the model's word. The test a green verify cannot see is
    one of the checks. So the declaration is no longer waited for in that mode;
    it still ends the run when the checks agree, being the same condition. A
    plan with no checks in it still never ends a run — zero of zero passing
    describes nothing — and declare mode is untouched. The seed says the new
    rule too, since a model told to announce an ending that has already happened
    keeps calling tools.

  • agent-block knl sessions / export / backup with no -p read the
    project they are run in, instead of failing with no kernel database at '<home>/.agent-block/projects/./knl.sqlite'. -p/--project defaults to .,
    and the kernel database is placed under a name DERIVED from the root's text
    (project_slug), so . slugged to . and the reader looked somewhere
    nothing had ever written. project_slug's doc states the precondition — the
    caller passes a root it resolved, because a relative path would slug two
    different projects to the same name — and the host honoured it by
    canonicalizing in host::run, which left every path that does not go
    through the host: all four subcommands. -p with an absolute path always
    worked, which is why this survived.

    The root is now resolved once, in main.rs, right after parsing and before
    .env, the sandbox and the host, so every consumer gets the same absolute
    root and the host's own canonicalize has nothing left to do. A --project
    that cannot be resolved is refused in those terms rather than carried into a
    path built from it: --project '<path>' could not be resolved, naming the
    flag the caller got wrong instead of a file they have never heard of.

  • knl <verb> on a project whose log has never been written names the project
    it looked for, not only the file it did not find. The path is the slug of a
    root, which a reader cannot un-slug at a glance, so "nothing here yet" and
    "you are in the wrong directory" used to produce the same sentence. A
    --store the caller typed is still reported back as typed — it was derived
    from nothing, so there is nothing to explain.

Docs

  • The README's "Overriding a block or a module" says what a vendored copy's
    history is: git. vendor writes a plain file with the version in its
    header and keeps nothing else — no hash, no --diff, no backup on
    --force — because the log of the project the copy lives in answers every
    question those would (what was edited, what upstream changed, how to merge
    the two, what to send upstream).

  • Doc comments in the bus, MCP handler and host modules said which internal
    note a decision came from rather than what the decision was — a reference
    no reader outside this machine can follow, and one that outlived the note
    it pointed at. Each now carries the reasoning itself: why the dispatcher
    awaits one handler at a time, why a second bus.on for the same kind
    replaces rather than refuses, why notifications reach Lua on the Isle that
    defined the callback, why they travel on a bounded channel. Build-order
    numbering is gone from the same comments, which describe what the code is
    rather than the order it arrived in.

  • The README says what an embedded module is, under "Writing a module": one
    lib/<name>/init.lua that returns the table of what it exports and writes
    nothing onto globals, replaceable by a project's copy of the same name that
    can wrap the original, with its checks beside it in
    lib/<name>/spec/*_spec.lua, the opts its public functions take and the
    values they answer declared as M.shapes and asserted at the boundary in
    dev mode beside refusals that stay loud in prod, and a header in English
    that says what it is, how it is used and what it does not do. The seven
    spec files still called *_test.lua are *_spec.lua now, which is what
    every other one was already called; discovery reads the spec/ directory
    and the file's use of the framework, never the suffix, so only the names
    changed.

Install agent-block 0.40.0

Install prebuilt binaries via shell script

curl --proto '=https' --tlsv1.2 -LsSf https://github.com/ynishi/agent-block/releases/download/v0.40.0/agent-block-installer.sh | sh

Install prebuilt binaries via powershell script

powershell -ExecutionPolicy Bypass -c "irm https://github.com/ynishi/agent-block/releases/download/v0.40.0/agent-block-installer.ps1 | iex"

Download agent-block 0.40.0

File Platform Checksum
agent-block-aarch64-apple-darwin.tar.xz Apple Silicon macOS checksum
agent-block-x86_64-apple-darwin.tar.xz Intel macOS checksum
agent-block-x86_64-pc-windows-msvc.zip x64 Windows checksum
agent-block-x86_64-unknown-linux-gnu.tar.xz x64 Linux checksum