4.5 KiB
4.5 KiB
Contract: V1-2.3 worker verification (M6)
Owner brief « Validation définitive V1-2.2 », 2026-11-01 (V1-2.2 VERIFIED at c73415a, BDR-092):
start V1-2.3 along the validated plan, V1-2 contract §16.4 (objective, prerequisites, tests,
acceptance), §6.4 (server verdict), §6.5 (failures), §12.3 (M6). Branch
feature/v1-2-anatomical-sheets. Sandbox stack only; DEV and production untouched; no merge;
no V1-2.4; STOP at the owner checkpoint (server workflow V1-2.1 to V1-2.3).
Criteria
- W1 M6
sheet_verification_jobs, forward-only, service role only (revoked frompublic,anon,authenticated),security definer,search_path = '':claim_sheet_verifications(limit)(clamped,for update skip locked, roundsverifyingwith no live lease, token +locked_atset,attemptsincremented, an expired lease counted, the attempt limit closing the roundverification_failed/unavailable);get_sheet_verification_input(review_id, lease_token)(the frozen document and the base as text, the referenced drawing rows registered for the sheet: asset id, sha256, byte size, bucket, object key; nothing for a stale token or status);complete_sheet_verification(review_id, lease_token, verdict)(accepted only whileverifyingwith the live token; binding = the round's sheet, version, revision, review; a passed verdict's group keys =general, the document's view and zone ids and the base's removed ones, its drawings = the document's asset ids with the rows' sha256; a failed verdict accepted without groups or drawings, its code from the closed list; elsestaleormalformed, nothing written; moves toopenorverification_failed/failed; audited);fail_sheet_verification(review_id, lease_token, code)(closed worker codes; claimable again below the limit,verification_failed/unavailableat it; audited). pgTAP allowed and denied cases;database.types.tsregenerated; publication still refused without an approved round whose passed verdict is current. - W2 Child
verify: the same binary, empty environment, rlimits and seccomp installed before reading stdin; reads one framed input (binding, rows, document, base, drawing bytes) under the per-command input cap; runsfaunosteo_corecompute_verdict; writes the verdict JSON under the output cap. The parent never parses the document or the drawings. Seccomp allowlist derived again for this path (Dockerteststage). - W3 Spawner per command: input cap, output cap, deadline and memory per command (
decodeunchanged);verifysized on the at-caps fixture (about 13 MiB input). - W4 Mode
run --jobs sheet-verify: claim, input, Storage downloads (missing object = drawing missing for the core, never a worker failure), child, completion; transient, timeout, resource and crash outcomes reported byfail_sheet_verificationwith a closed code; a broken sandbox stops the worker. Avatar and purge processing unchanged in the default mode; the verification mode runs no sweep. RPC body cap of this mode raised to the verdict size. - W5 Compose service of its own under the
workerprofile (read-only,cap_drop: ALL, same hardening asworker); sandbox start of the verification worker; never started on DEV. - W6 Tests:
pnpm worker:test(sandbox, seccomp derivation), unit and fake-backend job tests for each §6.5 row, hostile corpus through the child, e2e on the sandbox stack (clean sheet passes, each failure and its exit, stale or malformed completion writes nothing, avatars and purges unaffected, publication refused without a current passed verdict, the sandbox working copy verified in place with its shared drawing, verification time at the caps within budget), upgrade rehearsal from the DEV state (Git fixture of the DEV drawing, §12.3),pnpm e2e:avatarunchanged. - W7 Docs describe only what is implemented: V1-2 contract §6.4, §6.5, §12.3, §16.4; STORAGE.md worker section; RUST.md; SUPABASE.md; DEPLOY.md / compose notes; CLAUDE.md.
- W8 Gates:
pnpm rust:check,pnpm worker:test,pnpm worker:image, sandboxtest-dbandtypes --check,pnpm check:allon the final HEAD,pnpm e2e:shellon the sandbox; fresh verifier and security reviews on the final HEAD.
Proposals for the owner (checkpoint)
Closed worker failure codes, attempt limit (five), lease duration, the service name: chosen by the implementer, listed at the checkpoint for confirmation.
Out of scope
DEV and production (every §16.11 operation), screens, V1-2.4 onwards, merge, deploy.