task_cost_budget, task_time_budget_minutes and task_token_budget no longer
exist: a task is not capped by what it spends. Old config files carrying them
are cleaned on start with a one-time notice, and the settings declaration and
config template drop them. The budget machinery a Goal run injects for itself
(goal_token_budget, off by default) and the run usage accounting stay. The
effect tests that only exercised the configured budgets are removed, and the
Windows CI steps that named them are pruned in the same commit.
Context maintenance follows one trigger: a share of the model window, now
0.90 by default for new configs (existing files keep what they saved).
Removed the absolute-size economic boundary and its setting, HTTP route and
settings UI, the draggable fold handle in the context panel, the retired
multi-threshold and cold-resume keys (old files are cleaned on start), and
the failure-output elision applied to retained messages during a fold,
including the extra model call that picked the lines to keep.
Resolve .reasonix/reasonix.toml only when the root project config is absent. Share selection across loading, local edits, installs and repair; retain project-scope restrictions and reject symlink escapes.
Fixes#6007
A text-less compaction_progress frame now tells a frontend the streamed
digest was discarded, so a retried summary does not append to the cut one.
The pressure effect test counts attempts as pairs with a larger retry cap
instead of capping raw request count. Adds a shared-window room test and
updates SPEC.md.
Add idle_timeout_seconds, a per-provider override of the 300s stream idle
watchdog. One knob bounds both windows a model call can spend silent: the
transport's pre-header deadline (prefill) and the read loop's inter-event
watchdog (generation). Zero or unset keeps the default.
The bound holds where the value is read: IdleTimeoutFromExtra clamps to
[1s, 32767s], so a hand-edited value — which never passes UpsertProvider's
validation — cannot overflow time.Duration(v) * time.Second into a negative
window the transport reads as "no timeout". validateProvider still rejects an
out-of-range value on the edit path.
The stall error names idle_timeout_seconds, and the docs note that a silent
pre-header wait is retried once, so the effective hold can reach ~2x the value.
Add a user-global [tools.shell] env table so every command the bash tool
runs inherits extra KEY=value variables (for example
`BASH_ENV = "~/.reasonix/bashsandbox.rc"`). The value is applied over the
inherited environment but under the host-owned session/egress overrides, so
a preset value never displaces TMPDIR or an egress token.
The variables ride the sandbox spec (sandbox.Spec.ShellEnv), so foreground,
background, and host-terminal runs all inherit them alike. It is
user-global: a cloned repo's reasonix.toml cannot inject variables, because
the shell env is held across the project merge next to the sandbox grants.
Presetting a variable that names a host endpoint (SSH_AUTH_SOCK, DOCKER_HOST,
CONTAINER_HOST, XDG_RUNTIME_DIR) does not unmask it: the denied authority set
resolves from both the host environment and the effective one, so a preset
that points a client elsewhere still leaves the host's own socket masked. The
egress loopback proxy ports are unioned the same way, so a preset proxy is
closed and overriding a variable cannot reopen the host's.
The interpreter itself is still resolved by [tools.shell] prefer/path. A key
that cannot appear in an environment entry is dropped rather than written as
a malformed one, and keys are sorted so identical config yields identical
environment bytes.
`reasonix serve` now generates a per-launch token unless `--auth` or
`[serve].auth_mode` chooses otherwise. `none` remains an explicit opt-out for
deployments fronted by their own authentication: reads stay open to loopback
and bound names only (421 `serve.host_rejected` otherwise), and every
state-changing request, approvals included, needs the launch token (bearer
header or the /auth/token cookie) and otherwise refuses with
`auth.launch_token_required`. A request the loopback gate, a paired-device
gate or the in-process transport already admitted counts as holding it, so
Studio and the TUI keep working unchanged. Token mode also accepts the bearer
header.
The token never reaches the terminal: serve writes it to a 0600 file under the
remote state directory and prints the path, or names the --token-file of a
managed launch. Runtime sandboxes and read tools deny that directory and every
`--token-file`, `--provider-broker-file` and `--provider-broker-token-file`.
[serve] is read from the user config only, so a project reasonix.toml cannot
choose the token, the auth mode, or trust in forwarded headers.
Studio and the 1.x line share config.toml and both read [browser] enabled,
with opposite defaults: 1.x writes enabled = false on every save of the
user file, which Studio then read as the person turning its browser tools
off, and a Studio save wrote enabled = true, which switched the 1.x command
line's browser on.
Studio now decides on [tools] browser_tools (unset = on) and carries
[browser] enabled through a save exactly as read, never writing it where the
file had none. Boot binds the browser tools from the new key.
The settings screen gets a built-in browser switch under Tools, backed by
GET/POST /browser-tools on the provider-edit grant. The save writes the user
file and rebuilds the runtime, declared as runtime-rebuild.
A global [[plugins]] entry had no way to name the workspace it runs for:
${VAR} expansion read only the process environment and the project
.env. Servers that key on the project path in a header or argument
(IntelliJ's IJ_MCP_SERVER_PROJECT_PATH) therefore needed one entry per
project. Installed plugin packages already got ${CLAUDE_PROJECT_DIR};
user and .mcp.json entries did not.
ExpandedPluginForRoot resolves ${REASONIX_WORKSPACE_ROOT} and
${CLAUDE_PROJECT_DIR} to the workspace, and both places that turn an
entry into a spec call it with the root they already hold:
pluginspec.FromEntry (session boot, capdiag, mcp oauth) and the
controller's mcpIdentitySpec (live add, install, reconnect). The host
owns these values, so they outrank a process or .env variable of the
same name; a hook's child process inherits its parent session's
CLAUDE_PROJECT_DIR. Config path fields (sandbox roots, skill paths,
proxy) keep plain environment expansion. WorkspaceRootValue is the one
canonical form (absolute, cleaned, symlinks as opened), also used for
the plugin-package substitution.
Tests (the first three fail before the fix and pass after):
- TestAddMCPServerExpandsWorkspaceRootInLiveHeaders: live AddMCPServer
against an httptest MCP server. Before: live headers = ("",
"/inherited/from/a/parent/hook").
- TestLoadForRootExpandsWorkspaceRootInPluginEntries: two workspaces,
one global http entry and one .mcp.json entry, with a conflicting
CLAUDE_PROJECT_DIR in process env and .env. Before: header = "".
- TestPluginSpecsForRootExpandWorkspaceRoot covers the boot mapping, and
TestWorkspaceRootVarsStayOutOfConfigPathExpansion keeps sandbox paths
out of scope.
write_file replaces the whole file, so a model writing from what it read
earlier silently discards anything changed since: an edit the user made
in their editor while the turn ran, a formatter, another process. The
run now keeps what the agent last saw of each file, through read_file or
its own writes, and write_file refuses when the file holds something
else, telling the model to read it again. edit_file and multi_edit match
their old text against the current file and were already safe.
In 2,217 local sessions, the case never shows in the logs, because an
outside edit is not recorded there, so this is a safety net rather than
a measured gain. It costs nothing until a file has actually changed,
and is on by default. [tools].protect_changed_files and a switch in the
Studio sandbox settings turn it off.
Adds [skills].suppress_warnings (default false), which quiets the non-fatal skill warnings printed during startup discovery. doctor diagnostics are unchanged. Implements #6483.
The task tool, read-only tasks, fleets, parallel tasks, the sub-agent
store and records, profiles and the child's capability grant move from
internal/runtime/agent to internal/runtime/delegation. They are clients
of the agent: they build child agents and run them. The executor loop
now names none of them.
What the loop itself does for a child stays in agent. child_run.go holds
running an agent as a child and composing its answer and host receipts.
child_registry.go holds shaping the child's tool surface. Delegation uses
a small exported surface for these: AppendHostReceipts, AttachReviewReport,
CompleteSubtaskContract, ExpandToolPatterns, MaxToolOutputBytes,
NormalizeToolSchemas, SubagentImageNote, VisionRefFor, WithCallContext
and the host-receipt labels.
Tests followed the code. The ones that check the agent's own judgements
against the real delegation tools (batch skipping, the plan-mode barrier,
contract hints, delegation profiles across the proxy) run as agent_test
in the agent directory through export_test.go. The user-turn retention
test is split so each package pins its half. Test helpers used on both
sides are copied, since neither test binary may import the other. One
test more than before, from that split; none dropped.
Baseline: the moved files carry their debt unchanged under the new path,
and task.go gains the one import line the move costs (-allow-widen).
internal/ was 141 packages side by side, so nothing but a reader's memory
said which were foundations and which assembled the rest. Each now sits in a
layer directory, and the directory is the declaration:
base L0 foundation with no domain in it
contract L1 types and interfaces the layers above agree on
model, tools, safety, ext, state, platform
L2 subsystems, peers of one another
runtime L3 the turn engine
session L4 the controller
assembly L5 the composition root
frontend L6 cli, serve, acp and the host adapters
Only paths change: package names, code and behaviour do not. Imports,
repolint and coverage baselines, sensitive paths, CI package lists and docs
follow the new paths; release notes keep the paths they were written with,
and sample paths inside tests and fixtures keep theirs.
repolint gains layer-order: a package may import its own layer and those
below it, read from where it lives. The 47 imports that point upward today
are recorded as that rule's opening debt (-allow-widen, a new rule's first
baseline) and can only go down. Most of it is config, which still reaches
into eight subsystems and is the next thing to take apart; the rest is
event, history and a few tools reaching into runtime for types that belong
in contract.
Studio has no bot surface. On this line the QQ / Feishu / WeChat gateway
is reachable only as `reasonix bot`, a CLI command no Studio user starts,
and it carries about 12.9k lines: internal/bot, internal/botruntime, the
subcommand, its config section and its docs. It is also where the recent
Windows heap-corruption and gateway-wedge fixes had to land.
What goes with it:
- `reasonix bot`, its completion spec and its usage line in three locales.
- The typed [bot] config, its defaults, render block, model-ref and
migration hooks, and the 0.x QQ import.
- GatewayAPI, the control port only the gateway named, and the two
passive inbox variants only it called; neterr.IsTransient and
textutil.FitGraphemeBytes, which only it used.
- The bot entries in repolint's layer and frontend-parity declarations,
the bot race-test target in CI, BOT_GUIDE.md and its images, and the
[bot] example.
What stays, and why:
- The user config is shared with 1.x installs, which still run the
gateway. [bot] now decodes into an opaque table and is written back
unchanged on every save, so a settings change here does not switch
that gateway off or erase its allowlists. Credential variables the
table names are still kept out of subprocess environments.
- surface.Bot stays: usage records on disk carry it, and dropping it
would re-attribute them to another frontend.
- SECURITY.md and the crash-report worker still describe the bot, since
they serve every release line.
Budgets only fall: frontend-parity drops by 20 edges and the reclaimed
headroom is recorded with -update.
The flash model is `deepseek-flash` everywhere: the id it is served under
lost the generation it never needed. An installed entry is renamed rather
than left behind, and the rename moves every key that named the old id with
it — a price or an effort list stranded under the old key stops answering
for the model that replaced it, which reads downstream as a setting the
user edited reverting to its default.
A preset is now what settles which of its models read images. Reading a
name misses every Kimi, Qwen, MiniMax and Claude model these presets
declare, and `deepseek-flash` spells nothing at all; the spelling stays the
last resort for an address nothing has declared, and stays a correctable
suggestion rather than a claim. The connection that existed only to reach an
image-taking model folds into the entry beside it once that entry reaches
the same model on the same key — unless its user configured it, because
folding would answer their edit by deleting where it lived.
A preset changing shape reaches installs holding the old one through one
declared shape per generation and one upgrade that brings a matching entry
forward. The guard is the whole shape, because an entry holding what we
shipped is ours to move and anything else its user curated. That retires
nine hand-written migrations that each recognised one vendor by hand.
Official list prices live once, in `officialRates`, oldest generation first.
A price change appends rather than edits: the superseded rate is what lets
an installed config be recognised as holding one of ours and brought
forward, instead of quoting a retired rate for the rest of its life. `config`
reads them through `billing.CurrentRate` and `SupersededRates` and restates
none of them — a table written twice is one that drifts, which is how a
vendor's USD rate ended up published on one side only.
`make pricecheck` reads each vendor's own page and compares it against that
table, and says how long ago a person last confirmed each one. It reaches
the network, so it stays out of lint and out of CI. A page it cannot read
exits non-zero: unread is its own verdict and never counts as agreement.
A failed item collapsed every non-cancellation error into one status plus a
sentence, so the caller deciding whether to re-issue the graph with the finished
nodes adopted had to read the message. The identity already existed one layer
down and was being discarded at the fleet boundary: provider.RetryableStatus
knows 429 from 400, and APIError.ErrorCode knows an overflow from a rejection.
Confirmed the identity survives the trip before building on it: a
*provider.APIError returned by Stream reaches RunProfileSpec intact, status and
code readable through errors.As. Classification therefore reads what the error
already carries rather than decorating it.
Four classes, each sourced from a real identity — provider.transient (408, 429,
5xx, or an interrupted stream), provider.rejected (any other 4xx),
context.exhausted (ErrCompactionRequired, or a documented context-overflow
code), and unclassified for everything else. Nothing reads message text. An
error whose producer named nothing is reported unclassified rather than guessed
at, and a test pins that an error whose message reads "rate limit exceeded"
stays unclassified: this is the rule that retired the phrase tables, and a
failure surface is not where it gets an exception.
The identity travels to the branch the failure killed, because a skipped item is
worth re-issuing exactly when its cause was.
Skip policy is unchanged. Retrying inside a run is a separate decision and needs
its own evidence; adopt_ref is already the caller-side retry primitive.
Second half, found while testing the first: a skipped branch made runFleet report
the whole call as cancelled and answer context.Canceled. A rate limit is not an
interruption, and that error is what the turn loop reads to tell an interrupted
call from one that ran and reported. Only a real cancellation answers it now —
including the pre-cancelled context the old skipped check happened to cover — and
the aggregate headline gained the third state it was missing, so a run that
reached its end with failures says how many of its tasks were answered instead of
claiming to be either clean or cancelled.
docs/SPEC.zh-CN.md had drifted three commits behind on 3.13 and 3.14: the
upstream payload, adopt_ref with list_subagents, and the measured for_each
exclusion never crossed, and one sentence had become false — dependencies "never
reach ProfileExecSpec" after they had started travelling on
ContextRequest.Upstream. Both files now describe what the kernel does.
Built, shipped behind the surface, and measured against the call it replaces —
the same graph with one task handling every subject. Three fixtures, twenty-eight
graded runs against a real provider, every run of both arms solved, and mapping
spent 70%, 85% and 98% more tokens for it (exact permutation p <= 0.03 each).
The last fixture was written to be the case mapping should win: ten modules of
near-identical code, a hundred and sixty lines each, and an answer that is the
sum of ten separate derivations so a slip anywhere is a wrong answer. It did not
win there either, and one run solved it by grepping the constants out rather than
reading anything — which is the reason. A mapped child pays a full sub-agent's
fixed cost per subject, while a single child with a tool belt never has to hold
the subjects at all: it reads them one at a time, and when the facts are
extractable it extracts. "One context cannot hold N subjects" assumes an
ingestion an agent does not have to perform.
So the graph vocabulary goes back to id and depends_on, and SPEC 3.14 records the
exclusion as measured rather than as taste.
Two things survive the removal. The edge dedupe in newFleetPlan stays: a task
named twice in one depends_on was already counted twice before for_each existed,
and the item would have waited for a result nothing publishes. So does
unresolvedDepCounts, which adoption needs — an adopted node enters resolved and
its dependents have to be ready on the first pass.
benchmarks/fleet-fanout goes with it. The history holds both if a case that
genuinely needs per-subject isolation ever turns up.
Two fixtures, twenty graded runs against a real provider, and mapping never once
solved something the single-task form did not: 20/20 on both arms. What it cost
was 85% more tokens on the cheap fixture (exact permutation p=0.002) and 98% on
the one written to favour it — ten modules each hiding its effective timeout
behind a three-step derivation, where grepping the constants answers nothing
(p=0.029) — with no wall-clock gain either time, at the default concurrency and
at a ceiling raised past the mapped width.
So the mapped fields leave the provider-visible surface. The schema field and the
sentence describing it are dropped together, so the description never advertises
a parameter the schema does not carry, and a call naming for_each is refused
rather than half-honoured.
There is no setting. A capability the host cannot recommend does not get a knob:
turning it on is a change at the wiring point, to be made once the case that is
still untested is measured — subjects whose combined content one child cannot
hold at all, which neither fixture builds.
The code and its tests stay, and benchmarks/fleet-fanout now holds both pairs.
The evidence for switching it back on and the evidence for deleting it is the
same suite either way.
A capability has no ablation arm — there is no "the same thing with the payload
removed" for for_each the way the dependency edge has one — so the honest
comparison is what this call had to look like before it existed: one task
handling every subject. benchmarks/fleet-fanout holds both, identical except
that the middle item takes for_each rather than depends_on, graded the same.
Against the real provider, n=6 per arm across two concurrency ceilings, both
arms solved 6/6, and mapping a one-file check over twelve subjects spent 85%
more tokens (exact permutation p=0.002) and 47% more money (p=0.026) for no
wall-clock difference (p=0.70). Raising max_subagent_concurrency past the width
did cut the mapped arm's wall time, and cut the single task's by more.
The mechanism is a sub-agent's fixed cost — prefix, reasoning, closing contract,
once per subject — against per-subject work of reading one short file. It is the
same boundary the dependency edge has: both pay in proportion to what a unit of
work costs relative to that overhead, and both fixtures so far measured the cheap
side. So the tool description now says to map only work that needs a run of its
own, and SPEC 3.14 records what the fixture measured and what it did not.
for_each names the item whose submitted subjects this item maps over: its prompt
becomes a template run once per subject, and it reports one bounded aggregate
that its dependents open with over the ordinary dependency edge.
The mapped children are never vertices. The node stays one, so the reachability,
write claims, and skip rules preflight proved are the ones that ran — adding N
vertices mid-run would invalidate the precomputed reachability that
skipDependents and the concurrent-claim check both read.
Four things are fixed before anything starts, and that is what keeps for_each
from being the first keyword of a workflow language: the template, the width
ceiling (max_items, defaulted to 8 and hard-capped at 32), the read-only grant —
which removes the write-claim analysis the host could not have done for an
unknown number of writers — and the source. The source supplies only which
subjects, through submit_items rather than prose, because reading a list out of
an answer is the host guessing at a judgement the structure does not carry. The
caller owns the topology, the worker owns the data: the same split the
dependency edge makes.
submit_items reaches only a source's registry, so a capability nothing in a run
can use never enters its prompt. A source that finishes without submitting fails
the mapped node rather than quietly mapping nothing, while an empty submission is
a real answer that completes it. A source may not be adopted, having never run to
submit anything, nor itself mapped, since it answers with an aggregate rather
than a list.
SPEC 3.14 said the graph vocabulary had no dynamic fan-out. It now says no
computed edges, which is the invariant that actually mattered.
Execute's preflight moved into preflight(), which returns a proven fleetCall,
and the ctx-gated tool attach sits beside the other ctx-keyed host framing in the
two sub-session entries; that is what paid for the new lines without widening the
repolint baseline.
depends_on ordered its endpoints and delivered nothing, so a research →
implement pair paid for the same research twice. Three changes that compose:
- The edge carries the dependency's answer. It travels as
ContextRequest.Upstream, never inside TaskSpec.Objective, because the
objective must stay the pristine text delivery classification judges —
ClassifierTaskText is captured before any host framing. One 8 KiB budget is
shared across a node's dependencies, so a wide fan-in cannot flood the
opening turn and no dependency is starved out of it.
- list_subagents enumerates the children a conversation owns. A reference is
the only address a child answer has, and a background fleet that a restart
repaired to interrupted never delivered the aggregate carrying those
references, leaving its completed children unreachable.
- adopt_ref stands a node down to an already-completed child's answer instead
of running it. It is proven in preflight through ReadFinalAnswer, so what may
be adopted cannot drift from what read_subagent_result may read. Nothing
runs, so the node claims no write_paths and cannot collide with a live
writer; prompt and every execution field are refused on it rather than
silently ignored.
Whether an adopted answer is still valid is not readable from structure, so the
host does not decide it: adoption is addressed by reference, and the caller that
listed the reference judges freshness. That is also why a plan fingerprint does
not quietly reuse matching children — reuse the caller cannot see is reuse it
cannot correct.
A child now inherits something, which is exactly what InheritedContext exists to
keep a decision rather than an accident, so the capsule records it and SPEC 3.13
says so.
--ablate upstream leaves the edge ordering its endpoints while delivering
nothing, which is what lets the payload be measured apart from the order.
Against the real provider on benchmarks/upstream-edge/fleet-edge-wide, n=6 per
arm, removing the payload cost +27.6% tokens (exact permutation p=0.011) and
+59% sub-agent tool calls for the same answer, 6/6 solved either way. On a fact
one grep away it buys nothing: the edge pays in proportion to what the
upstream's work cost against how small its result is.
boot.go's delegation registrations moved to delegation_tools.go and Execute's
spec loop to buildItemSpecs; that, plus folding two defaulting branches into
firstNonEmpty, is what paid for the new lines without widening the repolint
baseline.
KeepErrors classifies a failure from ToolExecution rather than from message
text, because text matching was proven to miss real failures: a failing
`go test` log opens with "=== RUN", and no prefix match can see it. But
checkpointProjectionMessages wrote the projection through ModelMessages, which
strips ToolExecution on the way to a provider — so the record survived exactly
one fold. The second fold saw a tool result with no failure record and text
that matches nothing, folded it into the digest, and the model stopped being
told about the failure.
Measured on a fixture shaped like real `go test` output: present after fold 1,
record stripped after fold 2, gone from the projection after fold 3.
A projection is read twice — as what the model is sent, and as the input the
next compaction classifies — and only the second reading needs the host's own
record. So the strip belongs at the provider boundary, which every request path
already crosses (context_manager.go builds each request through ModelMessages
of its own accord, making the strip at write time redundant as well as harmful).
ProjectionMessages is that same projection with ToolExecution preserved.
Both functions and their shared implementation move to provider/projection.go:
deriving the two copies of a transcript is one responsibility, and provider.go
was already carrying recorded file-size debt this would have widened.
The regression test uses a "=== RUN" fixture on purpose. A synthetic
"error: ..." body survives either way through the text-prefix arm, which is
what let this go unnoticed. Verified by mutation: restoring ModelMessages at
the write site turns it red at fold 2.
Compatibility holds in both directions: ToolExecution is already persisted in
canonical transcripts, so no new field enters the sidecar format, and a
projection written by an older build simply has no record to read.
Retention landed with no way to see it fail. A turn past the budget still folds
into the digest, and the projection reads exactly the same either way — so the
one case where compaction hands a user's own words to the summarizer was the
one case nobody could observe. That also left [[keep]] useless in practice:
an escape hatch only helps someone told it exists at the moment it is needed.
keepUserTurns now returns a userTurnRetention count that rides the existing
telemetry to CompactionTelemetry (user_kept / user_dropped), and a committed
checkpoint that dropped a turn emits a warning naming [[keep]]. The notice
fires after commit, never on a rejected candidate: a checkpoint that was not
installed folded nothing.
The retention code moves to compact_user_turns.go — compact.go was 705 lines
against the 800 ceiling, and this is one responsibility. partitionFoldForProjection
drops its early/carried return values, which have been nil since content-driven
summary replaced the hoist, rather than growing to five results.
Coverage follows the two gaps this series left open:
- A boot-level effect test drives the real Build assembly through a fold and
asserts the constraint reaches the provider request, with a summarizer whose
digest deliberately records nothing. Verified by mutation: stubbing
keepUserTurns to a no-op turns it red.
- Sub-agents inherit retention through subagentOptions, the single construction
point they share; a test pins that inheritance and the child-scoped budget,
since a parent's instructions are the child's constraints and nothing else in
the child transcript records them.
partitionCoversRegion additionally asserts the conservation law: every user turn
in a region is either kept or counted as dropped, so a turn cannot go missing
from the accounting the way it previously could from the projection.
A constraint stated mid-session ("do not change the public API") existed
nowhere but the transcript, yet only the first user turn was pinned and the
rest reached the fold region — so whether it survived was one summarizer
judgement call. The code it constrains stays re-derivable from the workspace;
the constraint does not. That asymmetry of loss, not the token count, is what
decides here.
Every user turn in the fold region now stays verbatim within a budget, on the
existing kept channel rather than a new one. Three properties make it hold:
- It is structural, not a keep-policy bit. A stated constraint is a fact about
the task, so it is not something a policy flag can switch off.
- It ignores policyStart. The keep policy is scoped to messages after the
latest digest so it cannot grow forever; user turns are bounded by budget
instead, which is what lets protection survive repeated compaction.
- It measures with a fixed estimate. A threshold tracking the last turn's
calibrated ratio would keep a turn at one checkpoint and fold it at the next.
Retention is bounded, not unconditional: hoisting user turns without a budget
is what padded an earlier revision's candidates past the acceptance ceiling,
failing compaction outright instead of degrading it. One turn may spend 1500
tokens and all of them min(8192, window*5%), oldest first — the recent tail
already covers the newest turns. Past those bounds a turn folds like any other
content, so KeepUserMarked joins the default policy and [[keep]] becomes the
documented way past the size budget.
Two tests had fixed the defect as correct behavior.
TestCompactKeepsMidSessionUserTurns asserted the mid-session turn must fold and
then relied on a fake summarizer echoing the fact back; its reply now drops the
fact entirely, so the turn has to survive on its own. The partition test that
asserted all user turns fold is rewritten with budget, total-budget and
across-digest guards. TestKeepUserMarkedRequiresUserPrefixMarker moves down to
isUserMarked, which is the only level that can still observe the marker match.
Problem:
The PR head predates newly merged main-v2 changes, so its previous green checks do not cover the current integration tree.
Root cause:
main-v2 advanced in overlapping Desktop runtime DTO, frontend, and capacity budget surfaces after the last PR update.
Fix:
Merge the latest main-v2 history while preserving continuous Goal semantics and the newly landed UI and bundle-budget changes.
Verification:
The merged tree is verified by the focused Goal, race, vet, Desktop, frontend, cache, and repository lint gates before push.
* feat(provider): add exact custom request URLs
Problem:
Custom provider setup mixed base URLs and full request URLs, while legacy chat_url semantics differed across protocols.
Root cause:
The desktop editor reused chat_url for both legacy compatibility behavior and new exact endpoint intent.
Fix:
- add request_url as an explicit exact endpoint field
- preserve legacy chat_url behavior for existing OpenAI, Anthropic, and Responses configs
- simplify the desktop editor to one API address field and migrate only on save
- document and test global and project config round trips
Verification:
- frontend production build and focused editor tests
- focused provider, config, boot, and desktop tests
- desktop go test ./...
* fix(provider): preserve base URL on unchanged endpoint
Problem:
Saving an existing custom provider could rewrite base_url from request_url, changing model discovery and endpoint-derived capabilities even when the user had not changed the API address.
Root cause:
ProviderEditor always derived base_url from the effective request URL instead of preserving the independent stored value for unchanged providers.
Fix:
Preserve the stored base_url when provider kind and effective request URL are unchanged, and derive a new base only for new providers or intentional endpoint/protocol changes. Extract endpoint compatibility logic and provider request URL tests into focused owners, with exact repolint ratchets for the cross-layer contract.
Verification:
- pnpm test:all && pnpm build
- go test ./...
- cd desktop && go test ./...
- go test -race ./internal/provider/openai ./internal/provider/anthropic ./internal/provider/responses
- go vet focused root packages and desktop ./...
- go run ./tools/repolint
* fix(provider): mirror exact URL for legacy OpenAI
Problem:
Older clients ignore request_url and could keep using a stale chat_url after a custom OpenAI-compatible provider was saved with a new exact endpoint.
Root cause:
The desktop editor and save boundary preserved chat_url independently from the authoritative request_url.
Fix:
Mirror the exact OpenAI-compatible request URL into legacy chat_url in both the editor payload and desktop persistence boundary, retain non-OpenAI legacy behavior, and document the downgrade limitation. Add focused downgrade-compatibility coverage and complete the Chinese specification.
Verification:
- pnpm test:all
- pnpm build
- go test ./...
- (cd desktop && go test ./... && go vet ./...)
- go test -race ./internal/provider/openai ./internal/provider/anthropic ./internal/provider/responses
- go vet ./internal/provider/openai ./internal/provider/anthropic ./internal/provider/responses ./internal/config ./internal/boot
- go run ./tools/repolint
- git diff --cached --check
* test(provider): align exact URL copy assertion
Problem:
The provider editor test still asserted the previous English helper copy after the production hint was shortened without changing its meaning.
Root cause:
The final copy-size adjustment and its standalone TSX assertion were not updated together.
Fix:
Assert the current unchanged-URL helper text so the focused editor test covers the shipped copy again.
Verification:
- pnpm exec tsx src/__tests__/provider-editor-model-picker.test.tsx
- pnpm build
- go run ./tools/repolint
- git diff --cached --check
Problem:
Goal mode could pause at host-owned numeric ceilings even while useful work was still progressing.
Root cause:
Default round, turn, wall-time, and stall thresholds were wired as terminal runtime boundaries and persisted as blocked Goal state.
Fix:
Remove host-owned Goal execution ceilings, preserve only user-selected resource limits, convert numeric stall guards into replanning redirects, migrate legacy numeric pauses, and expose cumulative work duration as observational runtime data.
Verification:
- go test ./...
- go test -race ./internal/agent ./internal/control
- go vet ./...
- cd desktop && go test ./...
- cd desktop/frontend && pnpm typecheck && pnpm test:all && pnpm build
- scripts/cache-guard.sh
- scripts/check-cache-impact.sh
- go run ./tools/repolint
* feat(agent): content-driven context maintenance with single compact_ratio
Replace multi-threshold prune/snip/native auto maintenance with one
content-driven checkpoint path (stable prefix + one summary + recent
tail) gated solely by compact_ratio (default 0.85). First-visible tool
results are bounded at creation; prune/snip APIs remain no-ops for
call-site compatibility while legacy config/sidecar fields load and
migrate away.
Also align max_output_tokens auto ladder (0=auto; 128K explicit only),
desktop/settings/docs, and force CompactNow planning so mid-size
strict-alternating sessions (e.g. guardian) still reduce tokens.
Verification: go test ./...; desktop go test ./...; frontend test:all;
cache-guard; race on core packages; live seed→resume→continue smoke
(version=1, one summary, ~$0.0012).
* fix(agent): make context projection durable on Windows and clear CI gates
Problem:
- SaveCompactionState fsynced the parent directory after rename. Windows
returns ERROR_ACCESS_DENIED for directory Sync, so every projection
install failed and Windows smoke tests went red.
- gofmt, repolint, frontend AgentView fixtures, and required cache/docs
PR-body lines also blocked CI for #8244.
Root cause:
- Custom atomic write path reimplemented durability with a directory Sync
that is not portable, instead of using the shared Windows-safe helper.
- Residual format/debt and a missing coldResumePrune fixture field.
Fix:
- Persist sidecars through fileutil.AtomicWriteFile (temp + file fsync +
replace) without directory Sync.
- gofmt touched Go files; shorten essay comments; extract fold helpers;
carry residual structural debt in the repolint baseline after reducing
new essay debt; restore coldResumePrune on settings fixtures.
Verification:
- gofmt clean; go run ./tools/repolint clean
- go test ./internal/agent/ ./internal/config/ ./internal/provider/...
./internal/guardian/ ./internal/cli/
- pnpm settings-refresh-snapshot: 91 passed
* chore: nudge PR head refresh after Windows durability fix
Empty commit so GitHub re-resolves the fork head for #8244 after the
merge of main-v2 and the Windows sidecar write fix.
* fix(agent): close#8244 review blockers for content-driven maintenance
Problem:
Review of PR #8244 requested changes for CI failures, threshold under-count,
legacy native lineage drop, non-atomic CAS/write, residual cold-resume UI, and
duplicate context_maintenance notices.
Root cause:
- Threshold used message-only estimates without tools/role projection.
- Sidecar lineage required exact PromptCacheKey and marked restored before
covered-hash validation.
- Checkpoint install checked transcript outside the install lock and used
non-strict atomic write with EXDEV copy fallback.
- coldResumePrune UI/API remained after behavior removal; locale gzip grew.
- Maintenance notices ignored operationId on reconnect/replay.
- golangci reported unused prune/summary helpers and minor modernize issues.
Fix:
- Estimate compact trigger from final request shape (messages + tools +
provider role projection).
- Normalize legacy |context-editing-native-* keys; restore only if projection
still validates; persist normalized key without version bump/events.
- CAS install under compactionMu; SaveCompactionState uses AtomicWriteFileStrict.
- Remove coldResumePrune settings UI/Wails field/locales; keep config migration.
- Dedupe context_maintenance notices by operationId (bounded FIFO) + tests.
- Delete unused prune/summary helpers; clear golangci; trim locale strings for
bundle budget; strip SPEC trailing space.
Verification:
- make lint (golangci + repolint) clean
- go test agent/config/control/guardian/provider
- pnpm frontend build (locale budgets pass)
- context-maintenance-notice + settings-refresh-snapshot tests
* fix(desktop): gofmt reasoning_display fixture after cold-prune removal
Desktop CI failed gofmt on reasoning_display_app.go after ColdResumePrune
was dropped from the AgentView fixture literal.
* fix(agent): unblock context-maintenance merge blockers
Problem: PR #8244 still had three merge blockers: emit under
compactionMu (deadlock risk), restore rewriting exact-key
sidecars, and initial raw bundle over budget.
Root cause: commitSummaryProjection held the lock through
synchronous sink.Emit; LoadProjectionSidecar persisted whenever
the key already matched; ContextPanel/TranscriptSelectionMenu
were eagerly imported into the initial chunk.
Fix:
- Unlock before emitContextMaintenance; reentrant sink test
- needsNormalization only for legacy native lineage rewrite;
log persist errors instead of ignoring them
- Lazy-load ContextPanel and TranscriptSelectionMenu
- Document pre-interceptor threshold estimate + overflow recovery
- CLI/GOAL docs: compact_ratio default 85%
Verification:
- go test ./internal/agent/ (+ race focused tests)
- make lint (repolint baseline essay bump)
- pnpm build: initial raw 2236.8 / 2240 KiB
- context-maintenance-notice test ok
* fix(agent): close remaining context-maintenance plan gaps
Problem: After the merge blockers landed, plan gaps remained: no
parent-dir fsync on strict checkpoint writes, new writers still
mirrored last_*/blocked_* fields, dead CompactionCapabler shell,
and the pre-interceptor threshold contract lacked a regression test.
Root cause: AtomicWriteFileStrict only fsynced the temp file;
LastReceipt was authoritative but writers still dual-wrote mirrors;
provider.CompactionCapabler had no production callers; Prepare never
invoked interceptors by design without an explicit test.
Fix:
- Strict atomic write: fsync parent directory after rename (Windows/
unsupported FS soft-fail)
- SaveCompactionState / commit / blocked paths: LastReceipt only;
strip last_trigger/last_mode/token mirrors and top-level blocked_*
- Restore receipt-only blocked sidecars on load
- ContextReport/CLI/status prefer LastReceipt with legacy fallback
- Delete unused CompactionCapabler/NativeCompaction shell
- TestPrepareThresholdSkipsExtensionInterceptors
Verification:
- go test ./internal/agent ./internal/fileutil ./internal/provider
- go test -race focused packages
- make lint (repolint clean)
* docs: drop removed context_editing example from zh GUIDE
Problem: GUIDE.zh-CN still suggested context_editing = "native"
after native Anthropic context editing was removed and startup
migration deletes that key.
Root cause: bilingual GUIDE config sample was not fully synced
with the single compact_ratio local-summary contract.
Fix: remove the obsolete config line from docs/GUIDE.zh-CN.md.
English GUIDE already had no such example.
Verification: grep docs for remaining context_editing user examples
(only SPEC migration notes remain, which correctly describe removal).
* fix(fileutil): never fail strict write after successful rename
Problem: AtomicWriteFileStrict returned parent-dir fsync errors after
rename had already published the new file. commitSummaryProjection
and blocked-receipt writers treated that as "not committed" and
rolled memory back, forking disk (new generation) from process
memory (old generation) and allowing paid re-summary loops.
Root cause: post-publish power-loss durability was modeled as a
hard failure even though the atomic publish already completed.
Fix:
- After successful rename, parent-dir fsync is best-effort only
- Returned error still means "destination not published"
- syncParentDir also covers relative parents (".")
- Agent tests: applied and blocked receipts survive injected
post-publish dir-sync faults without generation fork / re-summary
- PR body: document AtomicWriteFileStrict + best-effort dir fsync
Verification:
- go test ./internal/agent ./internal/fileutil
- make lint
Tool-result maintenance had its own trigger at tool_result_snip_ratio (0.6),
below the fold. Every pass rewrites messages in the middle of the prompt, and
that invalidates the provider's cache from the rewrite point on. DeepSeek bills
a miss at 50x a hit, so a pass that drops 20% of a 100K prompt turns 95K cached
tokens into 75K uncached ones: the turn gets cheaper in tokens and about ten
times more expensive in money. #8109 made a pass idempotent per view, which
stops the same results being rewritten twice but not a new stale result
arriving every turn - and in a coding session one usually does. The steady
state was a cache reset per turn, which is what #8118 and #8132 report and the
opposite of what the cache-first design is for.
Maintenance now runs only at compact_ratio, where the prefix is being reset
anyway. It still runs first, because eliding stale results is cheap and often
enough on its own: tool_result_snip_ratio keeps its name and its default but
now says how far down that pass has to land to stand in for the summary. One
prefix switch per fold either way. soft_compact_ratio no longer gates anything,
it just emits its notice.
Below the trigger the transcript is now byte-identical to what the provider
cached, however large it grows.
Problem:
Goal mode could pause useful research after a text-derived 4/6/10 no-progress streak, while the outer 10/20/40 continuation budget did not bound actual model rounds inside one Run.
Root cause:
Cross-turn novelty was acting as both progress telemetry and a termination proxy. The agent exposed no typed host-owned Run boundary, so the controller could not distinguish default Goal budgets, explicit max_steps, or structural stuck conditions.
Fix:
Add a default 16-round Goal Run budget with one tool-free finalization response, typed resumable pause metadata, inherited child budgets, and Goal-only structural stuck detection. Keep cross-turn novelty observational, migrate legacy no_progress pauses, preserve unknown sidecar fields, and expose requestsUsed across CLI, ACP, and Desktop surfaces.
Verification:
- go test ./...
- go test -race ./internal/agent ./internal/control
- go vet ./...
- cd desktop && go test ./...
- cd desktop/frontend && pnpm build
- live DeepSeek, LongCat, and GLM normal/stuck/16-round-resume matrix
Co-authored-by: Will <[email protected]>
KeepErrors only matched tool results starting with "error:" or "blocked:",
the shape the host formats for an execution failure. A tool that ran fine
but reported a failure — a go test FAIL, a compiler error, any non-zero
exit — never matched, so its evidence folded into the digest and the
specific assertion was gone. Measured against a full-history control on
benchmarks/compaction, evidence buried mid-result survived 0 of 6 runs
while the control kept it every time.
provider.Message.ToolExecution already carries State/ExitCode/Verification
and is already stripped before provider requests, so isErrorMessage reads
it instead of guessing. Because the failure then stays identifiable without
its text prefix, a protected failure can also be shortened: snipFailureResult
keeps the failure-carrying lines with two lines of context and drops the
passing noise, holding the projection cost to +3.5% rather than the +100%
that keeping the whole result costs. A text-only failure has no such anchor
and is still carried whole.
The rewrite happens on three paths — the planning pass, the re-write that
follows archiving, and the fold's kept partition — now unified through
maintenanceReplacement/keptForProjection so one cannot silently overwrite
another.
benchmarks/compaction gains the probe that measures this, a -snip arm,
cross-generation planting for revisions that land across a fold, and
alignment with boot's default KeepPolicy. Buried evidence now survives
18 of 18 runs.
I wrote that one child run "costs 100k-220k tokens before it produces
anything", and used it as a threshold to compare a branch's size against. Both
halves were wrong enough to mislead.
The figure is cumulative prompt tokens across the child's own model calls, so
the same context is counted once per call: 27 measured children averaged 134k
tokens over 9.3 calls, which is the same ~14k context re-sent, not 134k tokens
of new material. At the ~90% cache hit these runs saw, the real price of a
child averaged ¥0.017.
The 2-4x delegation cost is unaffected, because both arms are counted the same
way. What is removed is the invented threshold: comparing a branch's size in
tokens against a child's cumulative re-sent context is not a like-for-like
comparison and should never have been stated as one.
The benchmark line is relabelled to say what it measures. For scale, what this
branch itself adds to a child — complete_subtask's schema, its description and
the closing contract — is about 654 tokens of that per-call context, roughly
4.5% of it.
main-v2 had moved 84 commits ahead. Everything auto-merged except
tools/repolint/baseline.json, which is generated: resolved by taking upstream's
and regenerating, rather than hand-merging JSON.
Regenerating surfaced one real violation instead of a carry-forward:
internal/event/event.go had grown past its budget, so the delegation audit sink
and its dispatcher move into audit_forwarder.go where the rest of that concern
already lives. The only baseline entry above upstream is plugin_entry.go's
essay, which is the field comments carried through the earlier extraction.
The question was why the model keeps sidestepping situations built to need
delegation. The recorded reasoning answers it: it does not weigh delegation and
decline, it never reaches the question. On a task built for `explore` it
deliberates over how to read efficiently — "that's 25 files... read them in
parallel batches... I can read multiple files at once" — and delegation does not
enter the decision.
Three causes, one of them a defect. The base system prompt never mentions
delegation; every mention is in the skills index and every one is a brake, sat
next to an accelerator for inline skills. The task tool description says what
the tool does and never when to reach for it. And the model already has cheaper
parallelism in several tool calls per round trip, with no context duplicated,
which is the thing it actually reasons about.
Given the measured 2.4-4.5x cost, the brake is the right default and is not the
defect. The gap is that nothing recognises the rare case where delegation would
pay, and forcing it does not close that gap: in the forced fleet run the parent
derived all three fixes in its own reasoning before dispatching, so the children
re-read the code to apply edits it had already worked out. Delegation moved the
typing, not the thinking.
Numbers behind it: 33 runs with delegation available, 15% delegated, bash
outnumbering every delegation-class call 10 to 1.
The last hypothesis worth testing was that delegation's isolation pays when the
parent is genuinely hurt by what it read. Isolating that mechanism needs the
parent under context pressure, so these two variants pin a workspace
compact_ratio of 0.5% over the same three-package migration.
It did not work. Zero compactions in both arms, at 0.5% of a 1M window, because
the agent keeps its session small by writing a script rather than reading — the
same behaviour that has won it every comparison so far. The arms still came out
4.5x tokens and 5.6x wall for the forced one, but that number is not evidence
about context pressure, because the pressure never arrived.
Kept as an honest record of the attempt rather than deleted, and because they
exercise the project reasonix.toml merge path (verified: the run reports
compact_ratio = 3% (project: reasonix.toml), so the config is read; the session
simply never reaches the threshold).
SPEC 3.17 states this as untested rather than disproved. Provoking it needs a
task that cannot be scripted away, which this corpus does not contain.
Three branches needing three different kinds of work — a logic fix, a half-up
rounding fix, and a manifest regenerated by reading both packages. No bulk
transformation solves them, which is the one shape where delegation has a
theoretical case, and the reason the earlier migration lost so badly.
The first repetition read 1.42x, the closest delegation has come. Two more
repetitions put it at 3.73x and 2.43x, mean 2.41x tokens and 3.65x wall over
identical work with a 100% success rate in both arms. The neutral arm's own
spread across those three runs was 8-37%, so the first reading was a favourable
draw rather than a narrowing — which is exactly what the recorded noise floor
predicted and why it is worth having.
The forced arm's spread was roughly twice the neutral arm's, so delegation buys
variance as well as cost.
SPEC 3.17 now records the four measured task shapes, since a result this
consistent is more useful to the next reader than the counters alone.
Fixture note: the reference fix for the rounding branch was wrong on the first
attempt because Python's round() is banker's rounding, so 1250 stayed 1.2k. The
task keeps that trap deliberately — the docstring says half up — but it is a
reminder that a fixture is only verified when both directions are run.
Running the fixed control produced a clean negative result worth writing down
so the next person does not read a single run as evidence.
Same arm, same six tasks, twice: per-task token use moved by a median of 19%
and as much as 54%. The whole between-arm difference in the same experiment was
2.5%, and five of the six tasks saw no delegation in either arm, so what the
comparison mostly measured was run-to-run variance.
SPEC 3.17 now states that alongside the counters, together with the two ways to
get a real answer: enough repetitions to clear the variance, or restricting the
comparison to tasks where subagent_runs shows delegation actually happened.
Problem:
The PR adds durable context-maintenance semantics and an advanced native Anthropic opt-in that were not covered by the embedded guides.
Fix:
Document projection-based maintenance, durable blocked fingerprints, canonical transcript preservation, and the official-Anthropic-only context_editing setting in English and Chinese.
Verification:
- go test ./docs
- go run ./tools/repolint
- git diff --check
Running the benchmark for real found what three layers of unit tests missed:
the delegation counters never reached any metrics sink. A probe through the
call-context sink passed, a probe through TaskTool passed, a probe through the
CLI sink chain passed — and the real binary still reported no delegation on a
run whose own transcript showed a child agent doing the work.
Optional sink capabilities are forwarded by hand at every wrapper, and two of
them were missing: control's goal-usage tee and the stats recorder. Each
forwards seven other audits and silently dropped the eighth. That is the same
failure this branch has been removing everywhere else — a contract implemented
in many places, missed in one — moved into the sink layer.
A guard now asserts that every wrapper forwarding one audit forwards them all,
so the next optional capability cannot die at whichever wrapper forgot it. It
is a hand-listed set of wrappers, which is weaker than discovering them, but it
would have caught both of these.
SPEC 3.17's control axis is corrected against what the run actually showed:
--ablate subagent removes task, read_only_task, fleet and parallel_tasks, but a
run can still delegate through a runAs=subagent profile skill, and a measured
no-subagent arm spent a child run on explore. That arm is "no task-tool
delegation", not "single agent", and subagent_runs is what says which happened.
Eight commits of orchestration machinery have landed on this branch without
anything measuring whether delegation pays. More agents always cost more
tokens, and the extra tokens alone can look like an improvement, so the
comparison has to hold the model fixed and read host-recorded facts.
Each finished child now emits a DelegationAudit through the same optional-sink
path the readiness audit uses, and run metrics fold it into counters: how many
children ran and at what depth, how many mutations they made, how many files
two children both touched, how many runs ended in a checkable claim versus
prose, how many claims the host refused to back, and how many writes escaped a
declared scope.
false_completions is the counter that matters. It comes from the completion
adjudication, so it measures claims the host refused rather than a reviewer's
opinion — the difference between "the fleet finished faster" and "the fleet
said it finished".
Emitting from one place is only possible because child construction converged
on RunProfileSpec; before that this would have needed the same emission in
five paths, and would have been missed in some.
Two things were deliberately not added rather than approximated. The audit
records the adjudicated status and the count of refused criteria, not an
inferred "claimed" status the host never independently observed. And the
counter for child tool calls is the existing SubagentToolCalls, counted from
tool events, instead of a second field counting receipts under the same name.
Task success rate and rework-after-handoff stay unmeasured: they need a task
corpus with checkers and whole-run mutation ordering, which belong to the
harness driving the arms, not to the instrument recording one run. SPEC 3.17
states what is and is not measured, and that --ablate subagent is the existing
control axis for the single-agent arm.
Sub-agents share one session Host and its connections. For a stdio server that
means they share one process, and read-only does not imply stateless: a browser
server opens a page, selects a tab, scrolls, and every one of those tools may
honestly declare readOnly because nothing reaches the filesystem. Two children
calling it concurrently still interleave on state neither can see, and write
claims cannot help because there is nothing to claim.
A configured server now carries a concurrency policy. serial means the runtime
never runs two calls to it at once across the whole session, whichever child
issues them. The gate lives on the shared runtime because the process being
interleaved on is shared at exactly that scope, and a queued call honours its
own cancellation rather than pinning the session behind a stuck server.
Servers whose names read as known-stateful (browser, playwright, puppeteer,
chrome, chromium, selenium) default to serial; explicit config always wins and
everything else stays parallel, so the shared-Host tradeoff is unchanged.
This is the conservative first version on purpose: one policy per server, not
per capability. Per-tool parallel_safe/exclusive hints and concurrency_key
grouping wait until real servers show which tools within one server differ.
Both config render scopes emit the field, with a round-trip test, because a
safety policy silently dropped on save is worse than one never offered — the
same failure as a profile editor losing read-only. The two scopes now share one
renderPluginPolicy helper so a future policy cannot be added to just one.
Baseline: PluginEntry moves to its own file and the shared-state helpers move
out of usecapability.go, both of which were 2-3x the size ceiling. Every
baseline total drops; the single increase is plugin_entry.go essay 0 -> 9,
which is the pre-existing field comments carried through the extraction while
config.go's essay falls by 10.
Five entry points were building sub-agents outside TaskTool.RunProfileSpec:
read_only_task, boot's two skill runners, reasonix review, and desktop preview.
Each re-resolved tools, depth, and permissions on its own, which is how a
boundary added in one place gets missed in another — the same shape as the
preview path that once built unconfined file tools and the profile editor that
once dropped read-only on save. It already bit this branch: boot's writer skill
runner receives complete_subtask in its registry but not the closing contract,
because the contract is appended on the TaskTool path it bypasses.
read_only_task, the one fork inside package agent, now compiles to a spec and
runs through RunProfileSpec like every other in-package entry point. Its promise
of no durable side effects is preserved as ContextRequest.Ephemeral — a field on
the spec rather than a second construction path — so the convergence carries no
behaviour change, which is the only safe way to do this kind of refactor.
spawn_boundary_test.go enumerates the files still calling the low-level runners
and fails on any new one, with the fix spelled out in the failure. The three
remaining callers are recorded as known debt rather than precedent; folding them
in touches boot, cli, and the desktop module and belongs in its own change.
SPEC 3.15 states the rule: many APIs, one execution primitive.
A fleet item may now declare id and depends_on. That is the entire graph
vocabulary — no conditions, no expressions, no dynamic fan-out — and it is
enough for research → implement backend/frontend → integration → review.
Dependencies live on the plan, never on a task spec. ProfileExecSpec is
unchanged, which is what keeps depends_on from becoming the first keyword of a
workflow language: what a task is does not depend on what ran before it.
Everything is validated before anything starts, alongside the existing write
claim preflight — duplicate ids, ids no task declares, self-edges, and cycles
all fail the whole call, because a fleet that cannot finish has already spent
tokens by the time it discovers that.
The graph also relaxes the write-claim preflight where it should: only items
that can actually run at the same time need disjoint write_paths. An
implement → review pair is serialised by its edge and may share paths, which a
flat fleet had no way to express.
Failure handling stays at one knob. A failed or skipped task always skips its
whole downstream branch — a dependent on a broken input only produces a result
the parent must discard. Independent branches keep going unless fail_fast is
set, which stops starting new tasks while leaving running ones to finish, so a
writer is never abandoned mid-write.
Cache-impact: the fleet schema and description are in the parent prefix, so
this is a one-time invalidation. The regenerated golden baseline puts it at
+273 tool-schema tokens (13801 → 14074); SystemHash is unchanged.