Replace the generated filler on the 34 math and bit pages with real
descriptions, the edge cases that matter, and one verified example each.
Allow those pure functions in the API output verifier. Fix the example
checker's host-language heuristic, which flagged a Capy result arrow at
the start of a line and the void type. Reword the type page, guide 8 and
three other pages where the mechanical rename produced "an any".
Rewrite skills/capy-bearer/SKILL.md for the any spelling, the * generic
marker, services and ports, file_temp, the sort comparator, and the
anti-patterns from the ludum review.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Keep the compile-time generic marker as *. Update the compiler, stdlib,
fixtures, documentation and editor grammars without a dynamic type alias.
Preserve native identifiers and historical work and patch records.
Replace the port_spawn environment argument with cwd/env options. Report
failed directory changes through EXIT 127 with cwd_failed.
Compile every API example and add a complete Pi RPC service example.
Service examples compile without execution or output blocks. Update ABI
versions and audited golden artifacts.
The SERVICE page now walks through one complete service: a pool of child
processes that takes jobs by signal, frames their output per line, replaces a
child that dies with a delayed self-send, reports on an interval, and closes
its ports on STOP, with the CLI side that starts and drives it. The event
table names every props key and its values, the restart backoff is stated,
and addressing by unit path is explained. The example is a fixture
(site/tests/capy-services-pool.capy) that test_capy_services.sh starts, feeds,
and stops.
TASK handlers had no handler page; handler/task.txt covers the entry point,
the copy semantics of props, the timeout, the on_done props from shell_exec,
and target paths.
Indented code blocks in doc sources rendered as paragraphs because the
markdown renderer only knows fences. All 19 blocks are fences now and the doc
checker rejects indented code outside sig, output, and example sections.
The services guide drops the sentence about locks.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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>
An array type is constructible into dval like scalars and strings, so
port_spawn(["cat"]) resolves and lowers through the dval constructor; a
non-literal array still fails there with the existing message. The service
fixtures and the port_spawn page use the literal form again, and the services
guide names the oversized-message refusal beside the other two reasons a send
returns false.
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>
A component that fails to resolve sets the native status directly. The
final write-back compared request.out with the snapshot taken at request
creation, so a handler that wrote the status back to 200 compared equal
and never reached the response. Status and headers now compare with the
live native response, and native status writes in the core mirror into
the request value so an untouched request.out still keeps a native 500.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>