# SOLONCODE hosted service

The hosted service runs a fixed SOLONCODE program registry and keeps workspace
credentials, jobs and event history in a separate SQLite Durable Object for each
workspace. The intended origin is `https://soloncode.solonsky.net`.

This document describes the interface. A deployment and its local and live
acceptance records establish which revision is actually running.

## Requests and access

Send the exact `Origin: https://soloncode.solonsky.net` header and your workspace
bearer token. POST requests use `Content-Type: application/json` and compact JSON
without a trailing newline. Cookies, cross-origin requests and ambiguous request
encodings are refused. Keep tokens out of URLs, public pages and source control.

A reader can inspect jobs and synchronize. An operator can submit and cancel
jobs. An owner can also approve drafts. The native administrator credential is
separate from these workspace roles and must stay on the server side.

The production workspace is `personal`. The three `qualification-*` workspaces
are reserved for finite verification. Their clock and restart controls and
synthetic programs are unavailable in the production workspace.

## Workspace API

All paths below start with `/api/workspaces/personal/v1`.

| Method | Path | Purpose |
| --- | --- | --- |
| GET | `/session` | Inspect the authenticated session |
| GET | `/programs` | Read the available program registry |
| POST | `/jobs` | Submit a permanent job ID as a draft |
| GET | `/jobs` | List jobs |
| GET | `/jobs/{id}` | Inspect one job and its typed outputs |
| POST | `/jobs/{id}/decision` | Apply an owner decision at the current version |
| POST | `/jobs/{id}/cancel` | Cancel a draft or queued job at its current version |
| POST | `/sync` | Synchronize using the versioned service protocol |

The production registry contains `sum`, `float-identity`, `truth-identity` and
`record-identity`. It accepts typed inputs rather than uploaded implementation
source, JavaScript, SQL, model prompts or arbitrary tool definitions.

For example, the compact body below creates a new sum draft for 20 and 22:

```json
{"id":"example-sum","program":"sum","inputs":{"a":{"t":"number","bits":"4034000000000000"},"b":{"t":"number","bits":"4036000000000000"}}}
```

Use the version returned by the service when making the owner decision:

```json
{"version":1,"decision":"yes"}
```

Here `1` is the version of a newly created draft in this example. Read the actual
version before deciding; do not reuse a stale version. The decision is one of
`yes`, `no` or `unknown`. A program's Truth value cannot grant native permission.

## Execution and uncertainty

An accepted approval persists the queued state, reserves completion capacity and
schedules the provider alarm before returning HTTP 202. The requesting client can
then close. The server performs the queued work and retains its outcome.

Identical submissions with the same permanent ID return the existing job. A
different request using that ID conflicts. Version checks prevent stale decisions.
Revocation and expiry are checked again after the request body is read.

An uncertain external effect fences later dispatch. It is retained for inspection
and is not automatically retried. Provider alarms can be redelivered; this service
does not promise global exactly-once delivery.

## Values and resource limits

Numbers use 16 lowercase hexadecimal digits containing their finite IEEE-754
binary64 bits. Float negative zero is preserved. Truth has its own explicit tag;
Text, Boolean, Record and Truth do not become interchangeable permissions.

Ordinary request bodies are limited to 131072 bytes. Only the authenticated native
administrator can send a restore body of up to 1048576 bytes to the fixed restore
target. Canonical stored row JSON and outstanding completion reservations are
limited to 524288 bytes per workspace. These are application accounting limits,
not promises about provider disk allocation, total memory or execution time.

## Recovery and publication

A complete protected backup can be restored into the distinct fixed restore
target after validation. The source remains intact. Restored credentials do not
inherit authority in the target, and restoring data does not replay callbacks.

Public assets contain documentation, examples, grammar and declaration
interfaces. Compiler and runtime implementation sources, worker bundles, source
maps, secrets, databases, backups and local verification evidence stay private.
The public language interface does not make the implementation repository public.

## Verification limits

The deployed C04 profile has finite local and public-provider evidence. The
public composition contains 87 selected main tasks and five byte-quota checks,
including a separately checked backup, one restoration into the distinct target,
and a client that closes before the provider executes its queued work.

Four original partial-body race cases remain unobserved at the owning public
handler. A malformed duplicate-Authorization request returned an HTML 400 response;
its owning JSON refusal was not observed. The original failed attempts remain
failed. Local owning-handler checks do not establish those missing public
observations. The cause of the transport difference is not established.

Treat non-JSON responses and lost mutation responses as uncertain transport
outcomes. Do not repeat an action using a new ID, assume approval or convert an
unknown result into success. No whole-platform, unlimited-scale, general source
execution or continuous-availability guarantee follows from these finite checks.
