chore(memory): V1-2.1 review findings fixed, evidence, TODO, journal

This commit is contained in:
bchanot committed 2026-10-28 20:16:34 +01:00
1 parent 5620399492
commit 7c4bf124f4
3 files changed
+41 -23

No files matched your search

@@ -49,7 +49,7 @@ files of this pass:
|---|---|---|
| 006 | 2 not ok: another editor uploads a pending key it did not register (L5) | 16/16 |
| 016 | 1 not ok: a draft from a deprecated version takes it as base (M2) | 50/50 |
| 017 | M1 approval on an archived sheet succeeds; M2 base from a deprecated version; the file aborts there | 85/85 |
| 017 | M1 approval on an archived sheet succeeds; M2 base from a deprecated version; the file aborts there | 85/85 (110/110 after the final decisions pass, §4) |
| 018 | 93 not ok of 337: capability holders at aal1 get `rights.capability` instead of `rights.mfa` (§6.7); `delete_sheet_asset` answers a raw code | 337/337 |
| 019 | 38/38 (lost coverage of behaviour that was already correct) | 38/38 |
| sheets-concurrency | 5 failed of 15: publish against withdraw (no version lock), two deprecations (no sheet lock), archive against approve (no sheet lock) | 15/15 |
@@ -57,42 +57,58 @@ files of this pass:
## 4. Real-stack results on the corrected HEAD
Final decisions pass (owner brief « V1-2.1 : décisions finales du propriétaire »), code at
`7eca441` (M6 option A, text size measure, pgTAP 015/017). Earlier figures (1 333 pgTAP) were
the `2af61e7` state.
`5620399` (M6 option A, text size measure with the bounded number walk, pgTAP 015/017/020;
only `.claude/` differs at the final HEAD). Earlier figures (1 333 pgTAP) were the `2af61e7`
state; an intermediate pass at `7eca441` gave 1 352 before the review findings below.
| Run | Fresh stack | Upgraded stack (M3 + Git fixture, then M4+M5) |
|---|---|---|
| pgTAP (`test-db`) | 1 352/1 352 | 1 352/1 352 |
| pgTAP (`test-db`, 18 files) | 1 807/1 807 | 1 807/1 807 |
| sandbox suite, run 1 | 86/86 | 86/86 |
| sandbox suite, run 2 (same stack) | 86/86 | 86/86 |
| of which two-session concurrency (`sheets-concurrency`) | 16/16 each run | 16/16 each run |
| pgTAP again after both suite runs | 1 352/1 352 | 1 352/1 352 |
| pgTAP again after both suite runs | 1 807/1 807 | 1 807/1 807 |
| `types --check` | types match | types match |
PGlite: 127/127 (packages/supabase: the 17 pgTAP files and the closed-code census).
PGlite: 128/128 (packages/supabase: the 18 pgTAP files and the closed-code census).
New in 017: M6 (owner self-grants `sheet_reviewer`; owner-reviewer acknowledges and approves a
version written by E, E publishes; owner refused on a round it authored, `review.separation`;
publication after an author's approval refused, `publish.approval.invalid`) and the document
size (cap − 1 and cap saved and measured, cap + 1 refused, a 2 MiB document of 3-byte
characters saved, cap + 1 in 4-byte characters refused, a dense document within the cap as text
and over it as binary jsonb saved whole, creation over the cap refused, the table CHECK
definition). Every refusal answers `document.too_large` (23514), never a raw constraint error.
New in this pass:
- 017 M6: owner self-grants `sheet_reviewer`; owner-reviewer acknowledges and approves a version
written by E, E publishes; owner refused on a round it authored (`review.separation`);
publication after an author's approval refused (`publish.approval.invalid`).
- 017 size: cap − 1 and cap saved and measured exactly; cap + 1 refused; a 2 MiB document of
3-byte characters saved; cap + 1 in 4-byte characters refused; a dense document within the cap
as text and over it as binary jsonb saved whole; creation over the cap refused; numbers that
JavaScript prints with an exponent stored and measured in plain form; a document under the cap
in compact JavaScript form but over it as measured refused; 9 000 numbers of 131 072 digits
refused with the closed code; the table CHECK definition. Every refusal answers
`document.too_large` (23514), never a raw error.
- 017 `publish.species.other` refused alone.
- 020 (449): the AR-1 B matrix of §15 in full (6 caller classes × aal1/aal2 × grant/revoke × 4
roles × self/other, each refusal with « nothing written »), the regression chain on the real
owner and admin at aal1, and the rights RPCs (`grant_catalog_right` on itself and on another,
`revoke_catalog_right`, `lookup_catalog_account`, `list_catalog_grants`) refused to every
non-owner class at aal2 (`rights.owner`) and at aal1 (`rights.mfa`).
Number bomb on the real image (`runs2/fresh/bomb.log`, sandbox): the shipped function answers
`document.too_large`; the same payload under the previous body (`octet_length(p_doc::text)`
alone, rolled back) fails with `out of memory` after a 1 GiB buffer.
## 5. Timing at the caps (§15, budget 2 000 ms for save, submit, publish)
Synthetic document: 64 views, 1 024 annotations, 8 192 finding nodes (depth 8), 1 089 review
groups, 4 drawings of 2 000 000 bytes. Since the size measure follows the contract, the labels are
calibrated on the text alone: text 2 076 707 bytes (cap 2 097 152), binary jsonb 2 346 648 bytes,
over the cap and accepted, as the contract's measure requires. HTTP wall-clock through PostgREST
on the development machine, milliseconds (min / median / max):
groups, 4 drawings of 2 000 000 bytes. The labels are calibrated on the contract's text measure
alone: text 2 076 707 bytes (cap 2 097 152), binary jsonb 2 346 648 bytes, over the cap and
accepted, as the measure requires. HTTP wall-clock through PostgREST on the development machine,
code `5620399`, milliseconds (min / median / max):
| Stack, run | save (7) | submit (5) | approve (3) | publish (3) |
|---|---|---|---|---|
| fresh, 1 | 118 / 123 / 137 | 4 / 6 / 7 | 189 / 284 / 303 | 198 / 289 / 300 |
| fresh, 2 | 114 / 125 / 139 | 5 / 6 / 6 | 196 / 281 / 292 | 210 / 297 / 307 |
| upgraded, 1 | 123 / 128 / 131 | 5 / 6 / 10 | 286 / 292 / 302 | 208 / 291 / 299 |
| upgraded, 2 | 118 / 123 / 129 | 4 / 6 / 7 | 198 / 285 / 295 | 211 / 292 / 310 |
| fresh, 1 | 135 / 140 / 149 | 5 / 6 / 7 | 195 / 285 / 290 | 208 / 297 / 315 |
| fresh, 2 | 130 / 139 / 145 | 4 / 5 / 6 | 200 / 286 / 301 | 201 / 285 / 304 |
| upgraded, 1 | 130 / 141 / 156 | 5 / 5 / 6 | 196 / 286 / 296 | 306 / 308 / 318 |
| upgraded, 2 | 132 / 136 / 146 | 4 / 5 / 6 | 210 / 284 / 293 | 204 / 291 / 298 |
The core's at-caps fixture is V1-2.2 work; the contract fixes the budgets at the V1-2.3
checkpoint and measures verification (120 s) there.
@@ -125,7 +141,7 @@ RPC), then M4+M5 by `supabase migration up`.
bytes (sha256 equal to the key); the same editor at aal1, a catalogue reader and an anonymous
caller are refused (the historical sheet has no published version).
The rehearsal is reproducible from the repository, re-run on `7eca441` (final decisions pass)
The rehearsal is reproducible from the repository, re-run on `7eca441` and `5620399` (final decisions pass)
with the same results, the only diff lines being the bucket limit and the service_role
privileges: `bash .claude/audits/2026-10-28-v1-2-1-m7/m7-rehearsal.sh [work dir]` (sandbox only; it applies
M4+M5 with `supabase migration up --db-url` on the sandbox port, a step `scripts/db-sandbox.sh`