chore(memory): V1-2.2 checkpoint, evidence, BDR-086, LRN-097/098, TODO

This commit is contained in:
bchanot committed 2026-10-29 14:05:28 +01:00
1 parent ca31b787b6
commit 17d919971e
8 files changed
+213 -4

No files matched your search

+8
View File
@@ -633,3 +633,11 @@ Owner brief « V1-2.1 : décisions finales du propriétaire » on checkpoint 2af
- M6 option A: `grant.self_review` dropped from `grant_catalog_right` + `SHEET_FAILURE_KINDS`. Owner at aal2 + verified factor may self-grant `sheet_reviewer`. Separation stays per round: author refused at ack + approve (`review.separation`), author approval refused again at publish (`publish.approval.invalid`). pgTAP 015 flipped, 017 owner-reviewer block (7 cases). Residual: owner reviewing others' drafts is now a normal path, audited like any grant.
- M7: Git fixture accepted for V1-2.1 upgrade rehearsal (horse.svg, sha256 = DEV asset row). Bytes/metadata/relations compared before/after. No DEV Storage read -> live DEV object integrity NOT shown; checked when owner applies M4-M6 on DEV. Contract §12.3, §16.2, §17.3.
- Size: one measure = UTF-8 bytes of jsonb text form `octet_length(content::text)` (`": "`, `", "` separators, jsonb key order, numeric without exponent). Base table CHECK `pg_column_size` (binary jsonb, uncompressed at write, bigger than text for dense docs) replaced in M5 by the text measure; `check_document_structure` drops pg_column_size. TS/Rust: no check today; core must compute same form in V1-2.2 (compact JSON.stringify shorter -> necessary not sufficient). Alternative rejected: compact JSON measure (SQL cannot compute it exactly: numeric prints no exponent).
## BDR-086 — V1-2.2 core authoring surface: verdict, PreviewSheet, edits, cleaning (2026-10-29)
- **Status**: implemented + tested; READY FOR REVIEW; DEV untouched
V1-2.2 core built (contract §16.3), no SQL/screen/DEV. Owner answers 2026-10-29 before code: editor exports (Inkscape/Illustrator/Figma/Affinity) supplied by owner under tests/fixtures/svg/exports/owner, cairo 1.18.4 + ImageMagick 7.1.2-18 exports committed meanwhile; strict-parse fail = `verification.integrity.document` (+ `.base`), 19 rule errors = `verification.validation.rules` (§6.7 aligned on §6.5); PreviewSheet draft = caps excess + missing drawings reported, published/deprecated = refused.
Design choices: verdict snake_case in the shape M5 SQL reads (groups[{key,digest,coverable}], drawings[{asset_id,sha256}], fingerprint), pure `compute_verdict`, NOT exported to wasm (O15). Digest = sha256(JCS({"group": key, ...content})) from typed doc (omitted status written inherited); general = doc minus views/annotations/finding_zones; view:<id> = views of id + annotations drawn in it; zone:<id> = zones of id; removal = {removed:true}; coverable = no to_confirm/inherited. Size = PG jsonb text measure (`size.rs`), oracle by PGlite 17.5. Edit: free op `sheet.edit` doc in → doc out; refuses ambiguous keys (duplicate id among siblings), unknown keys, id change, bad position, finding depth > 8; no cascade beyond tree descendants (dependents lists the rest); views whose drawing/crop changed → annotations to_confirm. Cleaning: sanitiser walk classes removals `active` (script, embeds, image, animation, a, on*, external refs, @import, javascript:, expression(, image-set(, behavior:, backslash); cleaning-only reading drops oversized title/desc (stored reader still refuses, too_complex).
Alt: verdict in wasm (rejected, O15); handle-applied edits (kept free op, page holds text for undo); serde tagged derive for commands (rejected: +100 KB wasm).
Reviews: verifier ECARTS(6) then ECARTS(3) (owner exports, helper); security PASS x2, MEDIUMs fixed (PIs, HTML fetchers, long-title bypass, quadratic groups, cubic view walk, bounds). Open owner: dangling #id across inlined drawings, clean upload = original bytes, stricter-than-table refusals, edit reading (contract 8.1/9.2), cairo rgb() colours. Module 596 671 B of 600 000.
+3
View File
@@ -481,3 +481,6 @@ R5.4: `draft/{labels,changelog,review_report,drawing,overlay,app_review,svg_comp
- V1-2.1 review pass on 1281667: verifier ECARTS(6) (missing proofs: AR-1 B matrix, non-owner rights RPCs, publish.species.other; LOW docs), security PASS + MEDIUM number-exponent OOM (9000 x 1e131071 = 1 GiB text, raw OOM). Fixed 3eba6d8: bounded number walk before text measure; pgTAP 020 (449). Re-run 5620399: pgTAP 1807 x2 both stacks, suite 86/86 x2 both. Correction: earlier 'DEV metadata identical' = DEV container state only (ids, start times), no DEV data read.
- V1-2.1 second reviews on 7c4bf12: security BLOCK HIGH = my number walk quadratic (jsonb_path_query per row, PG17 list_delete_first; 200k numbers 2.2 s native, ~26 s near cap). Fixed 538d103: jsonb_path_query_array + jsonb_array_elements (linear, 600k 0.4 s). Verifier ECARTS(1) LOW: red-on-old raw log now committed (.out). Rerun 2379d28: pgTAP 1808, suite 87/87 x2 both stacks.
- V1-2.1 final: code 2379d28 (= HEAD code), check:all green on 532c61e, security PASS (1f9fa8b), verifier CONFORME on doc deltas after ECARTS(3) LOW fixed. Declared VERIFIED pending owner. Open V1-2.3: e2e:avatar DEV target, quadratic status walks, ingress cap, schema_version 2.0 raw 22P02. DEV containers untouched. STOP at checkpoint.
## 2026-10-29
- 2026-10-29 V1-2.2 core built (size, review groups, verdict, PreviewSheet, sheet.edit, clean_svg); owner answers before code (exports by owner, integrity.document, draft load). Verifier ECARTS 6 then 3, security PASS x2, fixes ca31b78; check:all green. DEV untouched. STOP: READY FOR REVIEW.
+10
View File
@@ -663,3 +663,13 @@ Adapting pgTAP across PGlite and the real Supabase image: the fixtures must resp
## LRN-096 — jsonb_path_query row iteration is quadratic; numeric text has no exponent (2026-10-28)
PostgreSQL 17 `jsonb_path_query` (SRF) builds its whole match list on the first call and pops rows with `list_delete_first` -> O(n^2) when iterated row by row (FOR loop, count(*)): 200k matches 2.2 s, 400k ~27 s. Early `exit` saves nothing. Use one `jsonb_path_query_array(...)` then `jsonb_array_elements` (linear: 600k 0.4 s). Also: `numeric` prints no exponent, so `octet_length(jsonb::text)` of `1e131071` x 9000 (90 kB payload) = 1.2 GB -> raw OOM; sum printed numbers first. Apply to any SQL walk over user jsonb (status walks `sheet_all_reviewed`, `sheet_has_to_confirm` use the same SRF pattern, bounded today by core caps).
## LRN-097 — serde tagged enums and owned-Value reads double the wasm size (2026-10-29)
serde derive cost in wasm: internally/adjacently tagged enums buffer through serde's private Content, so every type reachable through them gets a second Deserialize monomorphization (ContentDeserializer); `serde_json::from_value` (owned Value) is a third, distinct from `T::deserialize(&value)`. V1-2.2 measured: edit commands with tagged derive + owned from_value of the document = 635.7 KB gzip (budget 600); commands read via `Value` then `T::deserialize(&inner)`, document via `&Value` = 582.7 KB.
Apply: in crates reaching wasm, read tagged wire forms through `serde_json::Value` with hand dispatch on the tag (keep ts-rs shape with `ts(tag, content, rename_all)`), always deserialize documents from `&Value`, measure `pnpm wasm:build` gzip after any new op; probe by removing one export at a time (cargo release wasm + gzip -9) before guessing.
## LRN-098 — Real SVG exports vs the allowlist; what the tree never reads (2026-10-29)
Real vector exports vs R3 allowlist: cairo 1.18 writes colours as `rgb(20%, 40%, 70%)`; allowlist drops any function call in presentation attributes → cleaned drawing keeps shapes, loses colours. ImageMagick 7 MVG export writes style settings as bare text between elements (dropped silently, not a "removal"). Property test generators for SVG must avoid repeated attribute names (XML malformed) or most cases test nothing.
Apply: classify fixtures by actual outcome before writing expectations; report colour loss on cleaning as an owner decision (allow numeric rgb()/rgba() = reader change); dedupe attribute names in generators.
Also: the tree drops processing instructions and comments, so "read with no removal" is not "bytes safe": `<?xml-stylesheet href=…?>` survives in stored bytes; scan PIs separately (fail-closed) wherever original bytes are kept.