docs(docs): V1-2.3 verification worker, M6, sandbox e2e and rehearsals

This commit is contained in:
bchanot committed 2026-11-01 17:38:07 +01:00
1 parent 5afb34ed0f
commit 7043d39ae0
7 files changed
+106 -10

No files matched your search

+42 -2
View File
@@ -234,10 +234,50 @@ Docker's restart policy brings it back.
Those are the only deletions the worker ever makes: a key it did not get
from the queue or the leftover query is never deleted.
### 3.6 Logs
### 3.6 Sheet verification mode (V1-2.3)
`faunosteo-worker run --jobs sheet-verify`, service `worker-verify` under the
Compose profile `worker` (same image, environment file and hardening as
`worker`), runs the server verdict of submitted sheet rounds (V1-2 contract
§6.4, §6.5) and nothing else: no avatar job, no sweep. The default `run` is
unchanged.
- Parent: `claim_sheet_verifications(1)` (M6, service role only), then
`get_sheet_verification_input` (the frozen document and the base as text,
the drawing rows), then each drawing from `anatomical-sheet-assets` at its
key `<sha256>.svg`. A row not uploaded, a key that is not its own sha256,
an object missing (404) or over the policy (at most 4 drawings, 2 MiB each,
6 MiB in all: the archive caps) is passed to the core without bytes, so the
verdict names it (`drawing_missing`, caps): a business failure, never a
worker failure. The parent never parses the document or a drawing.
- Child `faunosteo-worker verify`: same sandbox as `decode` (empty
environment, one thread, no core dump, the seccomp allowlist) with its own
limits: framed stdin input up to 12 MiB, `RLIMIT_AS` 1 GiB, `RLIMIT_CPU`
60 s, 90 s deadline, verdict output up to 4 MiB (the SQL cap). It runs the
core's `compute_verdict` and writes the verdict JSON; a failed verdict is
still a normal exit. The seccomp derivation of 2026-11-01 traced `brk` in
the verify child at the caps (musl mallocng growing its heap): added to the
allowlist, the only change.
- Completion: `complete_sheet_verification` answers `passed`, `failed`,
`stale` (nothing written, logged) or `malformed` (reported
`verification.worker.verdict_refused`). Child timeout →
`verification.worker.timeout`; a signal, an output overflow or an input over
its cap → `verification.worker.resource_limit`; a transport error →
`verification.worker.unavailable`; a broken child → `unavailable`, then the
worker stops (as the avatar loop). A dead lease (10 minutes) is claimed
again as `verification.worker.lease_expired`; the fifth attempt closes the
round `verification_failed` / `unavailable`.
- Measured (2026-11-01): the at-caps document (64 views, 1 024 annotations,
8 192 nodes) verified in 185 ms by the worker on the sandbox, verdict
24 689 bytes; the equine draft in about 60 ms.
- Sandbox only: `pnpm db:sandbox verify-e2e` starts a gateway and this
worker on the sandbox network (SUPABASE.md §5.1). Never started on DEV
(V1-2 contract §16.11 item 3).
### 3.7 Logs
One JSON object per line on stdout, fields from an allowlist only: `ts`,
`level`, `event`, `worker_id`, `asset_id`, `stage`, `code`, `signal`,
`level`, `event`, `worker_id`, `asset_id`, `review_id`, `stage`, `code`, `signal`,
`http_status`, `duration_ms`, `count`, `detail` (worker-authored text only).
The child's stderr is child-controlled: it is logged under `child_stderr`
JSON-escaped and truncated to 200 bytes, never raw. No key, no URL with a