fix(domain): refuse three non-canonical v3 shapes, R5.5 LOW fixes, R5.6 plan
check_v3_shape at read_report_document v3 and parse_envelope (sheet, practitioner as non-objects, severity as non-string); Protocol errors final; DEV address must be an own unicast address. SQL confirm function and DEV keys characterised, no change.
This commit is contained in:
1 parent
13db5539a3
commit
d502dfa923
11 files changed
+369
-37
No files matched your search
@@ -3392,3 +3392,47 @@ together with the serde decision above; the seed regenerated once by the Rust to
|
||||
re-uploaded only if their bytes change (they do not: `horse.svg` is frozen); `.prettierignore` on the
|
||||
Rust-written paths; the migration-map cascade debt (§11.12) fixed before any changeset renames a view,
|
||||
zone, region, category or cited reference.
|
||||
|
||||
### 11.18 R5.5 closed; targeted corrections before R5.6 (2026-10-24)
|
||||
|
||||
Owner brief « Clôture R5.5, corrections ciblées et préparation R5.6 ». Contract
|
||||
`.claude/tasks/contracts/2026-10-24-rust-r5-5-closing.md`.
|
||||
|
||||
**Real local stack: PASS, run by the owner by hand** (`pnpm e2e:sheet-assets`, 11 checks, verdict
|
||||
`e2e:sheet-assets OK`). This result is the owner's, distinct from the assistant's simulated-server suite
|
||||
(`upload_tool`); the assistant did not rerun it. R5.5 is closed. FLOOR clarification and the 4 MiB cap
|
||||
accepted; `evals.md:205` stays declared, not requalified.
|
||||
|
||||
**Two LOW corrections.** `Protocol` errors (a malformed HTTP answer, a key a header refuses) are final, no
|
||||
longer retried (test `a_malformed_answer_is_final_and_not_retried`: one request, exit 1). The DEV address must
|
||||
be an own unicast address: bound, then connected to itself (no packet) with that address kept as the local end;
|
||||
a subnet broadcast binds but refuses the connect (binary test over the host's `inet` and `brd` addresses). The
|
||||
other LOW reserves of §11.16 stay tracked.
|
||||
|
||||
**Serde hardening of three v3 shapes (owner go).** `report::read::check_v3_shape` refuses on the raw value,
|
||||
before the typed read, `sheet` or `practitioner` not an object and an observation `severity` not a string
|
||||
(`ReadFailure::Invalid` with the field named). Called at the two entries that read a v3 report from outside:
|
||||
`read_report_document` (v3 branch: PDF import, bare archives, draft restore) and `parse_envelope` (the session's
|
||||
archive copy). Nothing else narrowed: an unknown field and an absent `severity` are read as before; `null`
|
||||
severity was and stays refused (optional, never nullable). Test `characterisation_serde_tolerance` turned
|
||||
around (5 cases, the envelope entry included). Every R2-R4 suite, the PDF import suites, the envelope goldens and
|
||||
the N-1 reader pass unchanged; no authentic archive was rejected. Not covered by the go, left as is: the same
|
||||
derives on Report v2 and on the other contracts.
|
||||
|
||||
**`confirm_sheet_asset_upload`, characterised (no SQL change).** EXECUTE revoked from `public`, `anon`,
|
||||
`authenticated`, granted to `service_role` only (migration 20261009100000; pgTAP 006: an editor gets 42501,
|
||||
the service role confirms, twice is idempotent; `anon` is covered by the grant, not by its own assertion). The
|
||||
function sets `uploaded_at` for the row id without checking that `<sha256>.svg` exists in `storage.objects` or
|
||||
that its bytes match: a service-role caller can confirm a row with no object or with other bytes under the key.
|
||||
Not exploitable from an API role: no INSERT, UPDATE or DELETE policy exists on the bucket, so only the service
|
||||
role can place bytes, and the service role already bypasses RLS. In the tool, the row is confirmed only after the
|
||||
object is read back and hashed. Debt before any public exposure: check the object's existence (and size) in the
|
||||
function. On DEV, see the next point: the service role is reachable from the LAN today.
|
||||
|
||||
**DEV stack (owner §5).** Measured without printing a secret: the stack uses the Supabase CLI's public default
|
||||
JWT secret, the service key is the public demo key (`iss: supabase-demo`), and 54321 is open to the LAN by
|
||||
design, so a device of the network can act as `service_role` on DEV. The checks to run for 54321 (listener, UFW,
|
||||
rootless or rootful Docker, a probe from another device) and the two remedies are in ENVIRONMENTS.md §3.6. No
|
||||
firewall or configuration was changed.
|
||||
|
||||
**R5.6 prepared, not started.** Plan `.claude/tasks/plans/2026-10-24-rust-r5-6-fingerprint-switch.md`.
|
||||
Reference in new issue
Block a user