Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/lib/spec-map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const SECTION_MAP: Record<string, { gist: string; tag: Tag }> = {
tag: 'optional',
},
capabilities: { gist: 'Layered host interfaces, deny by default; the guest contract and the read-only caller identity.', tag: 'core + optional' },
limits: { gist: 'Wall-clock, compute and memory limits per invocation, answered with 504, 429 and 507.', tag: 'core' },
limits: { gist: 'Wall-clock and memory limits per invocation, and a recommended compute limit, answered with 504, 507 and 429.', tag: 'core' },
composition: { gist: 'One verb calls another through the host, under a declared call graph and a shared budget.', tag: 'optional' },
authz: {
gist: 'Authentication mechanisms, policy matchers, the simple profile, fixed ownership and the execution identity.',
Expand Down
4 changes: 2 additions & 2 deletions src/pages/compare.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ REST:ACT is a wire protocol for the clients of an API to upload components at ru

Extism is a plug-in system built on WebAssembly. The host application defines an interface, and users or customers add logic by writing plug-ins against it. Extism supplies host SDKs for embedding that runtime in an application.

Both share the idea of letting a product's users extend it with their own code. The difference is the layer. Extism is a library that a product's developers embed, and they design the extension points. REST:ACT is a wire protocol, so any client of a compliant server can upload a verb over HTTP, and the server enforces time, compute and memory limits on it, runs it as the caller by default and lists it in its discovery document.
Both share the idea of letting a product's users extend it with their own code. The difference is the layer. Extism is a library that a product's developers embed, and they design the extension points. REST:ACT is a wire protocol, so any client a compliant server allows can upload a verb over HTTP, and the server limits its time and memory, runs it as the caller by default and lists it in its discovery document.

## Cloudflare Workers for Platforms

Expand All @@ -78,7 +78,7 @@ It shares the multi-tenant goal and the idea that uploaded code is untrusted. In

PostgREST serves a Postgres database over HTTP. A function in the exposed schema is callable under `/rpc`. A function that does not modify the database also runs under `GET`, and a request with a valid JWT switches the database session to the role named in the token, so the database decides what the caller may do. Supabase's REST API is PostgREST, and `rpc()` calls its database functions. Supabase recommends `security invoker`, the default, so a function runs with the caller's privileges.

This is the closest relative here. Read-only calls use `GET`, others use `POST`, and the code runs as the caller. PostgREST decides by function volatility: `GET` is always read-only, and `POST` is read-write only for volatile functions. REST:ACT separates a function from an action by declared kind, and a function is a cacheable `GET`. The functions there are SQL or other database code written by whoever administers the database, then exposed. A verb is uploaded at runtime by an API client, is not tied to a database, runs as a WebAssembly component under time, compute and memory limits, and works on the object it is bound to.
This is the closest relative here. Read-only calls use `GET`, others use `POST`, and the code runs as the caller. PostgREST decides by function volatility: `GET` is always read-only, and `POST` is read-write only for volatile functions. REST:ACT separates a function from an action by declared kind, and a function is a cacheable `GET`. The functions there are SQL or other database code written by whoever administers the database, then exposed. A verb is uploaded at runtime by an API client, is not tied to a database, runs as a WebAssembly component under time and memory limits, and works on the object it is bound to.

## Hasura actions

Expand Down
2 changes: 1 addition & 1 deletion src/pages/llms.txt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const GET: APIRoute = ({ site }) => {

> REST:ACT is an HTTP protocol that lets the clients of an API add their own code to the server, within the permissions the server grants them. A client uploads a small program, called a verb, to a path in the server's object tree, and anyone the server allows can call it with GET or POST.

A verb is a WebAssembly component. It runs with the caller's permissions, can use only the host interfaces it imports, and stops when it reaches its time, compute or memory limit. The protocol is specified in ${DRAFT.docname}, written as an Internet-Draft and not yet submitted to the IETF; it is not a standard. restactd is the reference server.
A verb is a WebAssembly component. By default it runs with the caller's permissions, can use only the host interfaces it imports, and stops when it reaches its time or memory limit. The protocol is specified in ${DRAFT.docname}, written as an Internet-Draft and not yet submitted to the IETF; it is not a standard. restactd is the reference server.

## Specification

Expand Down
2 changes: 1 addition & 1 deletion src/pages/restactd.astro
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const facts: { term: string; html: string }[] = [
},
{
term: 'Limits per call',
html: '200,000,000 fuel, 2 s and 32 MiB by default, answered with <span class="code-inline">429</span>, <span class="code-inline">408</span> and <span class="code-inline">507</span>. An operator sets the ceilings.',
html: '200,000,000 fuel, 2 s and 32 MiB by default, answered with <span class="code-inline">429</span>, <span class="code-inline">504</span> and <span class="code-inline">507</span>. An operator sets the ceilings.',
},
{
term: 'Storage',
Expand Down
6 changes: 3 additions & 3 deletions src/pages/security.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Four rules apply to every verb, and a server that skips one is not conformant.
1. A verb is a WebAssembly component. Every verb runs as a WASI 0.2 component. A server may compile JavaScript or Python to a component at upload or run it through an interpreter component, under the same confinement and limits either way. [restactd](/restactd/) interprets, so nothing is compiled per upload.
2. A verb reaches only what it imports. The imports of the component are its capability manifest, and there is no ambient authority beyond them. A server answers `403` at upload for an interface it does not grant, and none of the standard interfaces opens a socket or a file.
3. A verb runs as the caller. A call can do what the caller could do directly and the verb declared, within the policy of the target. Its compute is charged to the caller.
4. A verb is metered. Wall-clock, compute and memory limits apply to every call, and a verb that calls other verbs shares one budget with them.
4. A verb is metered. Every call has a wall-clock limit and a memory limit, and the draft recommends a compute limit as well. A verb that calls other verbs shares one deadline with them and, where the server counts compute, one compute budget.

### Capabilities are an import list

Expand Down Expand Up @@ -81,11 +81,11 @@ A function may not call an action, and may not write: `object.set` and `event.pu

## Resource limits

A server enforces a wall-clock limit and a compute limit separately. Counting instructions does not stop a verb that stalls without computing, and a timer alone is not deterministic. Each breach has its own status code.
The draft requires a wall-clock limit and recommends a separate compute limit. Counting instructions does not stop a verb that stalls without computing, and a timer alone is not deterministic. Each breach has its own status code.

| Limit | Status | restactd default |
|---|---|---|
| Wall-clock time | `408` | 2 s |
| Wall-clock time | `504` | 2 s |
| Compute (fuel) | `429` | 200,000,000 |
| Memory | `507` | 32 MiB |

Expand Down
2 changes: 1 addition & 1 deletion src/pages/start.astro
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ const next = [
<h2>Watch a limit stop a verb</h2>
<p>
A verb that never returns is cut off. The default limits are 2 s of wall-clock time, 200,000,000 fuel and 32 MiB
of memory, and a breach returns <span class="code-inline">408</span>, <span class="code-inline">429</span> or <span class="code-inline">507</span>.
of memory, and a breach returns <span class="code-inline">504</span>, <span class="code-inline">429</span> or <span class="code-inline">507</span>.
</p>
<CodeBlock variant="terminal" html={spinShell} />
</div>
Expand Down
Loading