Files
FFF_vtt_frozen/docs/research/design-split-check.md
T
SirStone fcd90529b6 test(m4): finish audit, measurement and archive (#76)
- client/e2e/audit.test.mjs: independent player-browser traffic audit (own
  frame catalogue and banned-key list, never leakcheck.nim), with a
  -d:leakfault/otherVision negative control.
- client/e2e/fogbench.test.mjs + tools/fogbench.nim: 50 tokens on a
  16384 px map (server move path and headless SwiftShader cadence);
  results/m4-fog-bench.md records both honestly (SW is not the phone gate).
- Archive prototype-* under docs/archive/prototypes (Q24); DESIGN 13 M4
  done, TESTING 13 M4 accept result, HANDOFF-M4 close-out.
- mutation.sh c1/c2 patch the post-#65 tile-gate line again (they had
  silently become sed no-ops).
2026-11-21 15:43:08 +01:00

231 lines
14 KiB
Markdown

# Design split check (#51)
Verification for the split of `docs/DESIGN.md` v0.30 into the current spec
(`docs/DESIGN.md`), `docs/adr/` and the non-normative `docs/DESIGN-history.md`.
Performed 2026-11-17 against `HEAD` 7b804f4; old text read from `git show
HEAD:docs/DESIGN.md`, no decision changed. §6 covers the second split of the
same day: proof detail out of the spec into `docs/TESTING.md`.
## 1. Size
| file | before | after |
|---|---|---|
| `docs/DESIGN.md` | 306 288 B (1105 lines, many > 4000 chars) | 221 466 B (2619 lines; prose wrapped at 100, table rows exempt) |
| `docs/DESIGN-history.md` | — | 78 707 B (906 lines, not normative) |
| `docs/adr/` | — | 22 ADRs, 32 753 B |
| spec + history + ADRs | 306 KB | 334 KB total, of which 111 KB is non-normative; the spec alone is 27% smaller |
The spec is 27% smaller, but the meaningful measure is what left it: the v0.4-v0.30
change log (4.5 KB), the HANDOFF traceability table (4.4 KB), the dated
owner-decision log Q1-Q24 (63.7 KB), and the duplicated rationale and
superseded statements enumerated in §4 below.
## 2. Section mapping (old → new)
Section numbers are **unchanged**, so every existing `DESIGN §x.y` reference in
issues, docs, code and test comments still resolves. There is nothing to remap
for §1-§13; §14 changed role.
| old | new | note |
|---|---|---|
| §1-§11 | §1-§11 | same numbers, current-only text |
| §12 HANDOFF items | §12 HANDOFF traceability | table moved verbatim to history §B; a pointer remains |
| §13 Milestones | §13 Build status and milestones | same milestones and gates; build-provenance narratives moved to history §D item 14 |
| §14 Open questions (decision log) | §14 Open items | log moved verbatim to history §C; §14 now lists only open questions and PROPOSED choices, plus the ADR index |
`DESIGN 14` references in `tools/groups.mjs` and `tools/groups.test.mjs` (comments
only) referred to the #25 decision-log entry, not to a rule; their subject (the
nine M3 accept groups) is current §13. Code and tests were not edited (docs-only
task); this line is the mapping.
`server/geometry.nim` cites `DESIGN 5.4 / 12`; §5.4 still holds the limitation and
§12 now points to the HANDOFF table in history §B.
## 3. FIXED-rule coverage
Method: every old block containing `[FIXED` in old §1-§11 and §13 was extracted
by script, its opening words normalised (markup, tags and whitespace removed) and
searched in the new spec. Old §12 and §14 blocks are excluded from the new-spec
search because both sections moved **verbatim** into history §B and §C.
| old § | FIXED markers (old) | in new spec | result |
|---|---|---|---|
| 1 | 5 | 5 | verbatim rules kept; two supersession parentheticals dropped |
| 2 | 3 | 3 | kept |
| 3 | 25 | 25 | kept; two prototype-gap notes rewritten as current rules |
| 4 | 25 | 25 | kept; two rationale bullets replaced by ADR-0010 |
| 5 | 68 | 65 | 3 blocks removed: conflict note (historical), derived-label duplication (merged into the derived-kind rule), and the door-push block summary (the full rule is in 5.5, unchanged in meaning) |
| 6 | 28 | 28 | kept; payload-rule headings and slice framing rewritten, rules unchanged |
| 7 | 6 | 6 | kept |
| 8 | 19 | 19 | kept; two rationale bullets replaced by ADR-0010 |
| 9 | 1 | 1 | kept |
| 10 | 2 | 2 | kept; slice-build narratives compressed, test obligations kept |
| 11 | 7 | 7 | kept |
| 12 | 7 | 0 | moved verbatim to history §B (all rows resolved) |
| 13 | 7 | 2 | milestones kept; M3 scope/accept/slice prose compressed, all gates still present (§10.1, §10.3, §13) |
| 14 | 101 | 0 | moved verbatim to history §C |
| total | 304 | 188 | every rule has a survivor: 108 markers moved with §12/§14 to history §B/§C, 8 were merged into a surviving block; see §4 for the 22 blocks that changed wording |
The 22 old blocks whose exact opening words no longer appear, each checked by hand:
| old § | block | surviving statement |
|---|---|---|
| 4 | "Known limitation of the prototype, fixed in M2" | §4.2: move validation is the capsule check + step cap (§5.5) |
| 4 | Steps 3-7 headings with "M3 slice N" | §4.4 steps 3-7, same DDL and same decisions, slice tag removed |
| 5 | "Conflict note (settled later)" | removed as history; superseded by §5.8 (#42/#48) and history §D items 1, 11 |
| 5 | "Derived label, not a stored kind" | merged into §5.8 "Derived kind: a shape label" |
| 6 | "Slice-3 rollout note" | §6 "Catalogue is the contract" |
| 6 | five "payload rules" headers | same rules under the same headings, slice framing removed |
| 6 | property-schema registry bullet | rewritten in §6.1 with the same contents (two registered keys, permissive fallback, enforcement, strict mode); the registry itself is defined in §8 |
| 6 | "Grow push and squeeze ... 5.6's tie-break" | §6.1 keeps the intent, transaction and ack; the algorithm is stated once in §5.6 |
| 8 | "Storage: typed columns, not one JSON object" | §8 bullet keeps the rule; rationale is ADR-0010 |
| 13 | M3 scope, accept paragraph, tiles group, protocol group, build slices | §13 compact M3 entry; group details in §10.3 (tiles, protocol, restart, logs, persistence, characters), §3.2/§6.5 (auth, Origin), §13 (slice list) |
## 4. Dropped as superseded
These statements were removed from the spec because a later dated decision
replaced them; each is quoted in `docs/DESIGN-history.md` §D with its surviving
rule. Nothing was dropped silently.
| old location | superseded statement | superseded by | history §D |
|---|---|---|---|
| §1 | Q6's `wall`\|`door` only | #42, then #48 | 11 |
| §5.4 | status name `blocked`; door-close failure "stuck only if neither side is valid" | #4 | 4 |
| §5.5 | "Former (b) door opened while another wall overlaps clears `stuck`" | Keep rule (2026-11-08) | 10 |
| §5.7 | wall height "no dedicated column and no wire field of their own" | #49 | 8 |
| §5.8 | `terrain` preset/kind; "exact preset match, else `custom`" | #48 | 1, 2 |
| §8/§9 | "the server never interprets props in v1" | #41 | 7 |
| §3.1 | prototype gaps (`gmOnly` unread, global `gseq`) | built server (GMONLY_TOKEN, per-conn `n`) | 6 |
| §4.3 | "close a slow client when lag exceeds a bound" | 2026-11-17 review, §6.4 | 3 |
| §6 header | "14 server messages, 15 with `closing`" | #49, `proto` 2 (16) | 13 |
| §4.3 | connection cap 8 (Q1 log) | #15 (4 per player, 16 total) | 12 |
| §6 | retired `invite.*`, `gmClearBlocked`, `blocked` | #11 | 5 |
| §14 | "the split is not built yet" | #51 (done) | 15 |
## 5. Cross-reference check
Grep over tracked docs, code and tests for `DESIGN`, `§` and `#NN`:
- **Internal section refs** in the new spec: every `§x.y` / section number cited
exists in the new spec. Checked by extracting `\b\d{1,2}(\.\d{1,2})?\b` refs in
the spec and confirming the top-level number is 1-14 and each `x.y` heading
exists where cited (script output below).
- **Old §12/§14 refs**: no remaining *normative* reference to them. `tools/groups.*`
comments cite `DESIGN 14` for the M3 acceptance record; that record is §13 now
and history §C (mapping above, code not edited).
- **Issue refs**: `#NN` references are unchanged; no issue was renumbered. The
split itself is #51; the ADRs cite the originating tickets.
- **ADR links**: every ADR ends with `## Spec` pointing at the section it
constrains; the spec's §14 "Decisions recorded as ADRs" table links every ADR
back and gives its spec sections and tickets.
- **GLOSSARY**: untouched. No term was quoted verbatim in DESIGN in a way that
moved, so no link needed changing.
Machine check performed: for each `x.y` token in `docs/DESIGN.md`, a heading
`### x.y ` exists; for each bare section citation `§x`, a `## x.` heading exists.
---
## 6. Second split: proof detail into `docs/TESTING.md`
Performed 2026-11-17 on top of the split above, on the same current spec. DESIGN now states **what is
true**; `docs/TESTING.md` states **how it is proven**. No rule, decision, threshold or gate criterion
changed; moved blocks keep their tags, tickets and evidence paths.
### 6.1 Size
| file | before | after |
|---|---|---|
| `docs/DESIGN.md` | 221 466 B (2 610 lines) | 198 332 B (2 374 lines) |
| `docs/TESTING.md` | — | 36 426 B (570 lines) |
DESIGN is 23 134 B (10.4 %) smaller. TESTING is larger than the moved bytes because each block gains a
`Rule: DESIGN §x.y` back-link, its own `##`/`###` headings, and the tag legend; the former §10 alone was
18 964 B (215 lines) and moved whole.
### 6.2 Moved-block ledger
| old DESIGN | new TESTING | what moved |
|---|---|---|
| §3.1 notes | §3.1 | `GMONLY_TOKEN` fault-class pointer |
| §3.3 | §3.3 | `/_tiles/` 404 evidence, tile-allowed `[MEASURED]` leak (d) counts, `docs/archive/prototypes/tile-leak` evidence, test-vhost note, slice-9 status-split pin (was in §6.6) |
| §3.4 | §3.4 | the `Test` column of T1-T17, as a proving-test table |
| §4.1 | §4.1 | `vision_ms move-monster` `[MEASURED]` |
| §4.2 | §4.2 | "order proven correct by 3 x 60 s runs" |
| §4.3 | §4.3 | concurrency run `[MEASURED]` (13748 mutations, latencies), the 0.70 ms scale note, the mummy-`WebSocket`-fields test proposal, SQLite-tail measurement, 583 ms outlier detail |
| §4.4 | §4.4 | commit-cost and SIGKILL `[MEASURED]`, chunk write cost and pinning tests, step-5 layout pin, migration-test assert |
| §5.1 | §5.1 | vertex-in-cell bug log and its test |
| §5.2 heading + body | §5.2 | test counts, angle-sort bug narrative and regression test, 64-gon `[MEASURED]` citation |
| §5.3 | §5.3 | measured perf table, bench scenes (`genScene` layouts), thickness measurements, timings caveat, 2x regression gate method |
| §5.4 | §5.4 | token-on-wall test name, leak-test self-consistency caveat |
| §5.5 | §5.5 | in-process-module/unit-test sentence, WS probing test is M3, 0.5 px oracle tolerance, the `[FIXED]` regression baseline |
| §5.7 | §5.7 | `BannedAlways` height → `WALLDATA` |
| §5.8 | §5.8 | door-equivalence oracle pointer, `BannedAlways` label scan |
| §5.9 | §5.9 | the oracle sub-bullet (clearLine height test, band maybe/sure, no-churn, assertions with build tickets), fault-class-copy parenthetical |
| §5.10 | §5.10 | quad-hoisting `[#43 measured]`, joints measurement, oracle body-rectangle rule |
| §6.3 | §6.3 | reducer reconnect-reset `[MEASURED]` test citation |
| §6.4 | §6.4 | leak test (c), `withN` live-bug story, byte-size `[MEASURED]` table |
| §6.5 | §6.5 | the close-assertion consequence |
| §6.6 | §3.3 | slice-9 tile status-split pin (merged with the §3.3 block) |
| §7.3 | §7.3 | browser-unverified note and the M4 pixel check as acceptance criterion |
| §10.1-§10.4 | §10.1-§10.4 | the whole section, reflowed with DESIGN-qualified refs |
| §11.1 | §11.1 | the test-nginx bullet (`tools/nginx.mjs`, fixture tiles) |
| §11.2 | §11.2 | restore-drill procedure |
| §11.3 | §11.3 | SLOW-line provenance `[MEASURED]`, prototype-instrumentation caveat |
| §13 | §13 | M3 measured accept result and `tools/groups` mapping, M4 gate harness mechanics and the prototype-run caveat |
### 6.3 FIXED-rule coverage
`[FIXED` occurrences: 189 in DESIGN before; 187 in DESIGN + 9 in TESTING after = 196. Nothing was
dropped: every removed block containing `[FIXED` has a survivor (each old context was matched in
DESIGN+TESTING by its surrounding text). The 7 extra occurrences are tags that now sit on both a DESIGN
pointer and its TESTING block (§5.3 thickness acceptance, §5.9 oracle rule, §10.4 heading, §11.1 test
nginx) and TESTING's own tag legend.
Per section (old → new DESIGN + TESTING):
| § | before | after DESIGN | after TESTING |
|---|---|---|---|
| 1 | 5 | 5 | 0 |
| 2 | 3 | 3 | 0 |
| 3 | 25 | 25 | 0 |
| 4 | 25 | 25 | 0 |
| 5 | 65 | 64 | 5 |
| 6 | 28 | 28 | 0 |
| 7 | 6 | 6 | 0 |
| 8 | 19 | 19 | 0 |
| 9 | 1 | 1 | 0 |
| 10 | 2 | 1 | 2 |
| 11 | 7 | 7 | 1 |
| 12 | 0 | 0 | 0 |
| 13 | 2 | 2 | 0 |
| 14 | 0 | 0 | 0 |
### 6.4 Left in DESIGN on purpose (rule vs test)
- **Budgets and limits that are requirements:** the 5k-wall < 1 ms polygon target and the p99 > 50 ms
revisit trigger (§5.3), the 2x load/perf regression threshold (§5.3), every M4/M5/M6 accept criterion
and the 64 px tile fallback (§13), the 0.5 px oracle tolerance statement (§5.5).
- **Measured numbers that back a design choice rather than a gate:** the client rendering verdicts and
per-frame overheads (§7.2), the borrow-not-copy 4.9 ms (§4.3), the mummy reading (§4.3), the
complexity reading (§5.3). Moving these would strip the rationale from the decision.
- **§5.2's case list** stays as behaviour ("these cases are handled"); only its counts and bug
regressions moved.
- **§5.5's regression baseline** moved although it is `[FIXED]`: it defines what "equal to the old
implementation" means for a test, so it is proof, not a product rule. It is the one `[FIXED]` item
whose only home is TESTING; DESIGN §5.5 links to it.
- **§10.4's tooling decision** stays visible in DESIGN as a pointer heading with its `[FIXED]` tag; the
detail (Node 26, built-ins only, `tools/groups.mjs`) is in TESTING §10.4.
### 6.5 Cross-reference check
- DESIGN still has headings 1-14, and §10 keeps `10.1`-`10.4` as one-line pointers, so every
`DESIGN 10.x` reference in code and test comments resolves. The mapping (10.x → TESTING §10.x) is
stated in TESTING's header; code comments were left as they are (the instruction was to prefer a
mapping table over editing ~30 comments).
- Every `§x.y` in DESIGN resolves to a DESIGN heading; every `TESTING §x.y` resolves to a TESTING
heading; every `DESIGN §x.y` in TESTING resolves to a DESIGN heading.
- ADR-0015's `## Spec` no longer cites §10.3 and names TESTING §5.8/§10.3; ADR-0012 names TESTING
§10.3; `docs/research/walls-sight-thick-low.md` cites TESTING for the moved §10.2/§10.3.
- §14's "load/perf regression gate at 2x" now points at TESTING §5.3.