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>
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>