Tasks are fire-and-forget only: function TASK:NAME(props : dval) and
task_execute(target, timeout_seconds, props). The durable queue, the
TASK_WORKERS pool with its leases, cancellation, admission health and recovery,
task, task_status, task_await, task_cancel, the background form of shell_exec,
job_status, job_result, job_await, job_cancel, http_request_async, the job
directory and its --job-worker helper, their pages, fixtures, guide sections,
settings documentation and parity rows are gone. A bare TASK handler is a
compile error.
shell_exec(command, {on_done: "/unit.capy:NAME"}) keeps the one job use that
mattered: the command runs in the detached task runner, and TASK:NAME of the
unit receives command, exit_code, stdout, stderr, timed_out and
output_truncated when it finishes. Unit path resolution is shared by tasks and
services. The tasks guide is "Tasks and commands" with a stable slug change.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
function CLI:NAME() compiles like the other named handlers and exports
__bearer_cli_NAME; bearer-cli /unit.capy:NAME runs it, with --get pairs in
request.query. The static gate, the doc checker, the handler form list, the
CLI handler page, the language reference, and the skill file know the form, and
a fixture with a default and a named entry point is in phase 1.
The services handler page and guide now describe the mailbox bound as the
kernel datagram queue, say that an unknown signal is dropped and logged, and
that a send to a listening service is one datagram.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
task_execute(target, timeout_seconds, props) starts a process for TASK:NAME at
once and returns {pid}, or {error} when it cannot. The request worker spawns
the runner through the --task-execute entry of its own binary; that process
forks the detached runner, reports its pid, and exits, so the worker never
owns a zombie. The runner loads settings like the custom server, runs the
handler under the timeout as its invocation deadline with an alarm as the
backstop, and exits. The pool loop shares run_task_once with it. The task
design note records the decided API, the callback into TASK, and what the
second step deletes.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
SERVICE handler page with the event table, state in unit variables, the
synthetic request, and lifetime rules. Guide chapter 12 covers the loop model,
state, start/stop/send, intervals, ports, failure, and what a service is not;
errors and React move to 13 and 14 with stable slugs. The doc scripts accept
the service example entry and recognize SERVICE handlers. The design note fixes
service_every to take the interval before its optional props.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
A top-level var is one mutable Wasm global, initialized in declaration order by
an exported __wasm_call_ctors that the worker already runs once per workspace
after relocation and before INIT. Functions and closures read and assign unit
variables directly; managed values retain and release like locals; a local or
parameter shadows them; an initializer sees only the variables above it and has
no request. Names cannot be request, props, none, or collide with a function,
struct, or alias. The capability scan is seeded with unit variable types, the
LSP reports them as variable symbols, and the services design note now keeps
service state in unit variables with the synthetic request bound for builtins.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
SERVICE:NAME handlers compile like TASK:NAME props handlers and export
__bearer_service_NAME. The Wasm core gains bearer_wasm_invoke_service_event,
which runs one handler with decoded event props against the shared request
value without writing a response back. The worker keeps one workspace per
service process (wasm_worker_service_open/event) and the backend exposes
wasm_backend_service_open, wasm_backend_service_event, and
wasm_backend_service_close for the service loop. Core ABI 39; artifact golden
refreshed for the embedded ABI version.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Handlers take (props : dval, request : dval) for COMPONENT and TASK and
(request : dval) otherwise; every parameter is optional and keeps its name,
and request is bound in every handler body. name : capture type fills an
omitted argument from the caller variable of that name. Exported (dval) dval
functions carry an implicit request capture. Request builtins capture
request; redirect writes request.out. The runtime builds one request value
per request, passes request and props handles to handlers, applies
request.out once after the top-level handler, and drops the pending-props
slot, handler frames, per-handler refresh, and current_request(). Core ABI
38, unit ABI 39. Legacy request type checks and the removed-API migration
table are gone from the compiler. Documentation, generated routes, tests,
and the project home follow; the home page loses the demo and starter.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>