Entropy Evidence Transport Contract
Purpose: unblock SCAN-ENTROPY-186-012 by defining worker → webservice transport for entropy reports.
Implementation status (2026-07-19): target contract, not the current API. The current endpoint accepts
EntropyIngestRequestwithimageOpaqueRatioand layer ratio/byte totals and persists that snapshot for the ordinary scan-status response. The Worker emitsentropy.reportandentropy.layer-summarythrough Surface Manifest but has no client that posts them to this endpoint. The richerEntropyReportRequest, hash verification, replay attachment, and conflict semantics below remain unimplemented.
Endpoint
POST /api/v1/scans/{scanId}/entropy- Headers:
X-Tenant-Id,Content-Type: application/json - Body:
EntropyReportRequest
EntropyReportRequest (JSON)
subject_digest(string, required) — image digest.report_path(string, required) — relative path inside replay bundle (e.g.,artifacts/entropy.report.json).hash(string, required) — SHA256 hex of the report file.penalties(object) —{ overall: number, layers: [{ digest, score, high_entropy_regions: [ { offset, length, reason } ] }] }.created_at(string, ISO-8601 UTC).tool:{ id, version, rng_seed, max_parallel }.
WebService behavior
- Validate tenant, scanId, subject_digest matches scan record.
- Validate SHA256 by re-reading report from bundle if available; else accept hash and queue verification job.
- Persist entropy metadata with scan record and attach to replay manifest.
- Respond
202 Acceptedwith{ status_url }; return409if entropy already recorded for scanId+subject_digest.
Error handling
400malformed request;401/403auth;404scan not found;422hash mismatch;500transient CAS/read errors.
Determinism
- No clocks added server-side; use provided
created_at. - No recalculation of entropy; only verification.
- Log deterministic reasons for rejection to aid reproducible replay.
