Repository navigation
Commit 085ca6b
docs(adr): ADR-0005 appendix (c) — the persisted document is the parsed body once every round-trip key is declared (#20777)
Fixes #20457
Part of #20051 (stage (iii) of ruling 甲 there; stage (iv), the storage
switch, stays on that card).
Clause-②: no
## What this changes
One file, `docs/adr/0005-metadata-customization-overlay.md`:
- **Appendix (c)**, the persisted-document bullet of "Addendum —
2026-05-16 (c)", now states the ruled end state: the persisted document
is the parsed body (`parsed.data`) once every round-trip key is
declared. The bullet itself says the rule is ruled but not yet in force.
- **A dated note directly under that bullet** ("Amended (2026-09-30)"),
written the way ADR-0053's 2026-09-30 in-place amendment is written:
1. the provenance: ruling 甲 on #20051, comment 5856781584, maintainer
「开始总监决裁」;
2. the 2026-05-16 bullet, quoted verbatim and marked superseded;
3. what "every round-trip key is declared" means for `view`: the record
`VIEW_CONSOLE_ROUND_TRIP_KEYS` and its closure test;
4. the stage (ii) symbol that declares each key, on each member:
`ViewItemWireSchema` and `VIEW_METADATA_MEMBERS.listOverlay`, via
`viewSwitcherRowStateFields`, `viewItemWireFields`,
`listOverlayRoundTripFields`, `viewItemBaseShape` and
`flattenedViewOverlayFields`;
5. where the census's other finds map instead (`objectName` to `object`,
and the others);
6. the interim state;
7. what stage (iv) does.
- **Status line**: one new `Amended (2026-09-30, …)` entry. Prime
Directive #13 asks for an amended status line when a recorded decision
is reversed, and every earlier decision-changing amendment of this ADR
is on that line. This is the one line outside the bullet-plus-note
surface the claim names. Same file.
⛔ No persistence code, no GUARD pins, nothing under `packages/`. No
`scripts/adr-anchors/` file either: no gate asked for one (all green
below). The ADR's new code citations are symbol anchors that
`check-adr-symbol-anchors` resolves.
## Declared is not yet enforced: how the text handles that
On `main` the runtime still stores `request.item`. The verbatim-save
pins are still there (`protocol-meta.test.ts` "preserves Studio-only
auxiliary fields verbatim (not stripped)",
`protocol.graft-folded-form-sections.test.ts` "GUARD: Studio-only
round-trip keys still survive the save"). So the ADR states the decision
and the status next to each other:
- the amended bullet ends with **"Ruled, not yet in force"**;
- note item 5 says that today a key no member declares is still stored,
so "declared" does not yet mean "the only keys stored";
- note item 6 lists what stage (iv) does: store the parsed body, flip
the GUARD pins, judge `ViewItemWireSchema`'s top-level `options`, and
first measure the production count of stored rows that carry undeclared
top-level keys.
This follows the PM's working assumption. It also matches the repo
convention: ADR-0053's 2026-09-30 amendment carries an "Interim state"
item in the same way.
## Evidence (head `c8ee5833`)
- Gates were derived with `node scripts/pm/dispatch-gates.mjs --repo
objectstack-ai/objectstack --commands`, with no paths: the same 19 as
the dispatch. Reconciled with `--ran`: "19 derived famil(ies) accounted
for — 19 run, 0 NOT-MEASURED (a DERIVED zero — all 19 recorded an exit
code and none of them is 3)".
- All 19 exit 0 on `c8ee5833`: `check-adr-links` (+ `--self-test`),
`check-adr-symbol-anchors` (+ `--self-test`), `check-ci-filter-parity`,
`check-closing-keyword-parity` (+ `--self-test`),
`check-comment-mask-corpus`, `check:doc-formula-expressions`,
`check:adr-anchors`, `check:cross-package-test-inputs`,
`check:doc-authoring`, `check:driver-memory-census`,
`check:gitlink-declared`, `check:nul-bytes`, `check:pm-governed-merges`,
`check:pm-prior-rulings`, `check:refd-timer-probe`,
`check:watch-hint-literal`.
- `check-adr-symbol-anchors` printed: "2156 anchors across 140 records
resolve — 320 symbol (294 declaration, 26 literal), 1809 file-level, 27
cross-repo, 6 exempt, 9 continuation".
- `check:doc-formula-expressions` first exited 3 (PREREQUISITE NOT MET:
`@objectstack/formula` and `@objectstack/lint` were unbuilt in the fresh
worktree). That run measured nothing. I built both through the verify
lock (a turbo cache hit, 4 of 4) and reran it: exit 0.
- **Ablation** (a one-off; no permanent test file). With the change
committed, I used `scripts/ablation-replace.mjs` to break one new
anchor, renaming `#listOverlayRoundTripFields` to
`#listOverlayRoundTripFieldz` (anchor count 1 to 0, blob `a893abb2` to
`50270267`).
- The gate then printed "❌ check-adr-symbol-anchors: 1 finding(s)" and
"[unresolved-symbol] … `#listOverlayRoundTripFieldz`" at the note's
line.
- I restored the file with `git checkout HEAD --`. Its blob was back to
`a893abb2` and `git diff HEAD` was empty.
- So the gate reads the new anchors; it does not pass over them.
- No changeset: `docs/adr/**` publishes nothing (`skip-changeset`).
## Acceptance notes
These are observations, not filed. Their carrier is stage (iv) on
#20051.
1. **The verbatim-save pin population is wider than the two the ruling
read.** Three tests assert the verbatim save by name:
- `packages/objectql/src/protocol-meta.test.ts`: "preserves Studio-only
auxiliary fields verbatim (not stripped)";
-
`packages/metadata-protocol/src/protocol.graft-folded-form-sections.test.ts`:
"GUARD: Studio-only round-trip keys still survive the save";
-
`packages/metadata-protocol/src/protocol.graft-normalized-operators.test.ts`:
"keeps Studio-only auxiliary fields a `parsed.data` swap would strip".
At least one more depends on the verbatim save:
`protocol.runtime-authoring-gate.test.ts`, "the door persists the
authored body verbatim". Two of the pins need re-judging, not just
flipping. The graft-folded GUARD writes `isPinned` / `isDefault` /
`sortOrder` onto a **form** overlay, and `VIEW_CONSOLE_ROUND_TRIP_KEYS`
records that the console never writes them there. The protocol-meta pin
writes `objectName`, which the census maps to `object`.
2. **Per-type scope of the switch.** `resolveOverlaySchema` validates
every type with a registered schema, and each one is stored as sent
today. The ruling's end state names "a saved view", and the round-trip
census covered `view` only. The amended bullet states the rule with its
condition ("once every round-trip key is declared") and claims a
satisfied condition for `view` only. Whether the stage (iv) switch
covers `dashboard` and the other validated types is stage (iv)'s
question.
3. **Code comments that cite this decision.** The `resolveOverlaySchema`
docblock and the `saveMetaItem` comment in
`packages/metadata-protocol/src/protocol.ts`, and the pins, cite
"ADR-0005 §Validation", a heading this ADR does not have. They describe
today's behaviour, which stays true until stage (iv). No
`scripts/adr-anchors/` entry ties `protocol.ts` to ADR-0005. Stage (iv)
implements the decision in code, so that is where the anchor belongs
(Prime Directive #13).
## 维护者速读(草稿)
**改了什么**:只改了 ADR-0005 这一份文档。
- 附录 (c) 原来写的是:保存视图时原样存请求体,不存解析结果。现在改成裁决甲的终态:所有要往返的键都在契约里声明之后,存的是解析后的结果。
- 这一条下面紧跟一段 2026-09-30 的修订注记,写了四件事:出处(#20051
的裁决甲);原文一字不改地引用,标为"已被取代";逐键列出声明这些键的 spec 符号;现状说明。
- 状态行加了一条"已修订"。
**为什么改**:这是裁决甲的第 (iii) 步。第 (ii) 步已经把控制台会写回、再读回的键都声明进了
spec:置顶、排序、可见性分组、默认视图、列状态,以及设置覆盖标记。所以附录 (c) 现在可以照实写。
**风险与代价(含回滚)**:
- 纯文档改动。不动运行时代码,不动测试,不发布任何包。
- 唯一的风险是读者把新文字当成"运行时已经这样做了"。所以条目本身写明"已裁定、尚未生效";注记也写明:目前仍然原样存请求体,存储切换是第
(iv) 步。
- 回滚:revert 这一个 commit 即可。
**席位意见**:
**你要做的**:审阅后在本 PR 上给 APPROVED。这是 Tier H 治理面 `docs/adr/**`,由席位落地。存储切换本身(第
iv 步)仍挂在 #20051 上,不在本 PR 里。
---
_Generated by [Claude
Code](https://claude.ai/code/session_01KTZmMfzVzjNvyaLyQ8mHvg)_
Co-authored-by: Claude <noreply@anthropic.com>1 parent 274e162 commit 085ca6b
1 file changed
Lines changed: 71 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
334 | 334 | | |
335 | 335 | | |
336 | 336 | | |
337 | | - | |
338 | | - | |
339 | | - | |
340 | | - | |
341 | | - | |
342 | | - | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
343 | 407 | | |
344 | 408 | | |
345 | 409 | | |
| |||
0 commit comments