Skip to content

Commit fa31010

Browse files
docs(qa): draft-publish-lifecycle audit clause expects the catalogued refusal's denied row (#29169)
<!-- claude-projects-attribution: {"github_login":"os-warren"} --> _Requested by **Warren** · [project thread](https://claude.ai/code/project/chan_01U5RdnAAmkSQmZbqh6FtqZ8?thread=cmsg_01U5RdnAAmkSQmZbqh6FtqZ8QHK3iqqgqvPgxTg59PhVfa)_ Fixes #29013 Clause-②: no Metadata-protocol: none ## 维护者速读 - 改了什么:发版检查清单 `studio-authoring.draft-publish-lifecycle` 的 acceptance[10] 改为:受编目的拒绝(四个码)各写一行 denied 审计,带操作者与小写码;NO_DRAFT、INVALID_REQUEST、5xx 不写。acceptance[3] 写明线上码 METADATA_CONFLICT,并说明过期 If-Match 要在草稿存在时发。 - 为什么改:#28355 之后产品对 422 INVALID_METADATA 会写一行 denied 审计,旧条款仍说「不写」,QA 每轮都判 FAIL,让测试者习惯忽略红灯。 - 风险与回滚:只改一份 QA 清单 JSON,不发布任何包、不动产品代码;回滚即 revert 本 PR。 - 先看:`docs/qa/platform-checklist/areas/studio-authoring.json` 中该条目的 acceptance[10] clause/verify,其次 acceptance[3].verify 与新增的 revision 11 history 行。 - 两分钟验证:`pnpm check:platform-checklist`,预期输出 `check-platform-checklist: OK — 16 areas, 352 items`。 - 需要你做的:无,席位落地。 ## What changes One file, `docs/qa/platform-checklist/areas/studio-authoring.json` (+7 / -6), the item `studio-authoring.draft-publish-lifecycle` only: 1. **acceptance[10].clause** — the denials list gains the four catalogued refusals the single-item doors (save, publish, rollback, delete) now audit after #28355: `invalid_metadata` (422 INVALID_METADATA), `not_overridable`, `not_creatable`, `destructive_change`, each exactly one `denied` row with the lower-case code. The sentence "A 422 INVALID_METADATA spec refusal ... write no row" is replaced by: a refusal outside that set writes no row (404 NO_DRAFT, 400 INVALID_REQUEST, any 5xx). Source pointer: `packages/metadata-protocol/src/protocol-refusal-audit.ts#REFUSAL_AUDIT_CODES`. 2. **acceptance[10].verify** — asks for steps[7]'s stray-key 422 as exactly ONE `denied` / `invalid_metadata` / `save` row (source `protocol.saveMetaItem`) with the authenticated actor, and for no row from steps[12]'s 400 INVALID_REQUEST or a publish with no pending draft (404 NO_DRAFT). A missing row, a duplicate row, a SCREAMING-coded row, or a row for NO_DRAFT / INVALID_REQUEST is a FAIL. 3. **acceptance[3]** — the clause spells the wire code `METADATA_CONFLICT`; the verify says to send the stale If-Match while a draft row exists, because with no draft row the `?mode=draft` door answers 409 "(current is null)" for any token, the published version included (`protocol-lock-version-gates.ts#storedParentForToken`), which does not exercise the stale-token guard. 4. `revision` 10 → 11 and one `history` row (ref #29013). ## Why QA run #29002 (subject 7fa9873) scored acceptance[10] FAIL: the stray-key dashboard draft save answered 422 INVALID_METADATA and `/audit` held a `denied` / `invalid_metadata` row with the actor. That is what #28355 decided, so the clause, not the product, was stale. The rewrite is stronger, not weaker: a 422 that used to score a row as a FAIL now owes one, and two uncatalogued refusals are named as owing none. ## Tests No product code changed, so no test was added. The premise was re-measured on `origin/main` 0a41075 through the real protocol doors (`ObjectStackProtocolImplementation`, the persisting fake engine of `protocol.refusal-audit-rows.test.ts`) with a throwaway probe file, deleted before commit: <details><summary>Probe readings (vitest, 5/5 cases ran)</summary> | Case | Answer | Audit rows | |:---|:---|:---| | dashboard draft save, widget with a stray key, actor usr_admin | 422 INVALID_METADATA (`widgets.0` unrecognized key) | one: save / denied / invalid_metadata / actor usr_admin / protocol.saveMetaItem | | control: valid dashboard draft save | 200, state draft | one: save / allowed / ok | | publish, no pending draft | 404 NO_DRAFT | none | | rollback, no toVersion | 400 INVALID_REQUEST | none | | draft save with the published version as If-Match, no draft row | 409 METADATA_CONFLICT "... (current is null)", currentVersion null | one: save / denied / metadata_conflict | A sixth case (stale If-Match while a draft exists) is NOT MEASURED: that fake engine's `update` does not mutate rows, so the stored draft never moved and the token stayed current. The clause's stale-draft half is unchanged and was read as holding by QA run #29002. </details> ## Acceptance notes - `steps` were not edited (file surface: acceptance[10], acceptance[3], revision, history). The NO_DRAFT leg in the new verify is a publish sent when no draft is pending, which a runner can send after steps[3] without a new step. - The batch-publish codes (`batch_aborted`, `namespace_prefix`, `stored_type_not_canonical`) and `item_locked` are carried over unchanged from revision 10. ## Verification <details><summary>Gate run on e6afed5 — 16 derived, 16 run, 0 NOT-MEASURED</summary> `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack` derived 16 families for this one-file change; all 16 ran and exited 0, including `pnpm check:platform-checklist` (`OK — 16 areas, 352 items (347 active, 1 planned)`; symbol anchors 1088/1098 resolved, 10 on the named #16898 residual) and `pnpm --filter @objectstack/lint run check:doc-formula-expressions`. `dispatch-gates --ran FILE` → `Run reconciliation — 16 derived, 16 run, 0 NOT-MEASURED, 0 UNRUN`. CI-owned families (lint, Test Core and the rest) are not re-run locally. </details> --- 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01JQwxbWcvRkRqeQHg9HPzVi Co-authored-by: Claude <noreply@anthropic.com>
1 parent d089dac commit fa31010

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

‎docs/qa/platform-checklist/areas/studio-authoring.json‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@
406406
"title": "Metadata draft→publish lifecycle: drafts staged not served, publish flips visibility atomically, conflicts and invalid drafts refused, and the history/audit/diff/rollback forensics tell the truth",
407407
"since": "v16",
408408
"status": "active",
409-
"revision": 10,
409+
"revision": 11,
410410
"priority": "P1",
411411
"surface": "mixed",
412412
"personas": ["admin (authors drafts)", "end user (must not see drafts)"],
@@ -456,9 +456,9 @@
456456
"evidence": "the three reads"
457457
},
458458
{
459-
"clause": "optimistic concurrency holds: a write carrying a stale If-Match version answers 409 metadata_conflict — a concurrent edit is reported, never silently overwritten",
459+
"clause": "optimistic concurrency holds: a write carrying a stale If-Match version answers 409 METADATA_CONFLICT — a concurrent edit is reported, never silently overwritten",
460460
"oracle": "api",
461-
"verify": "re-PUT with the superseded version token → 409 with the metadata_conflict code (the ADR-0008 chain the receipt's version field exists for)",
461+
"verify": "re-PUT with the superseded version token while a draft row of this name exists → 409 with the wire code METADATA_CONFLICT (the ADR-0008 chain the receipt's version field exists for; acceptance[10]'s audit row stores it lower-case, metadata_conflict). Send it while a draft is staged: with no draft row the ?mode=draft door judges the token against no head, so any If-Match, the published version included, answers 409 '… (current is null)' (packages/metadata-protocol/src/protocol-lock-version-gates.ts#storedParentForToken) and does not exercise the stale-token guard",
462462
"evidence": "the 409 response"
463463
},
464464
{
@@ -498,9 +498,9 @@
498498
"evidence": "the rollback response + the post-rollback GET + the reverted-render screenshot + the 400 response"
499499
},
500500
{
501-
"clause": "audit rows carry the actor — GET .../audit lists the save/publish/rollback attempts each stamped with the acting user, resolved from the authenticated session identity ([#7941] — the sole source; `resolveMetaWriteActor` no longer reads `X-Actor` at all), never anonymous. An allowed attempt writes an outcome 'allowed' row. Of the denials, only those the protocol audits write a row: outcome 'denied' with code item_locked (403 ITEM_LOCKED), metadata_conflict (409 on a stale If-Match or a lost race), or, on the batch publish, batch_aborted, namespace_prefix or stored_type_not_canonical. A 422 INVALID_METADATA spec refusal and a 404 NO_DRAFT write no row (packages/metadata-protocol/src/protocol.ts and protocol-lock-version-gates.ts, the recordMetadataAudit callers; protocol-save-conflict.ts)",
501+
"clause": "audit rows carry the actor — GET .../audit lists the save/publish/rollback attempts each stamped with the acting user, resolved from the authenticated session identity ([#7941] — the sole source; `resolveMetaWriteActor` no longer reads `X-Actor` at all), never anonymous. An allowed attempt writes an outcome 'allowed' row. Of the denials, only those the protocol audits write a row, outcome 'denied' with the lower-case code: item_locked (403 ITEM_LOCKED) and metadata_conflict (409 METADATA_CONFLICT on a stale If-Match or a lost race), which their own gates write; on the batch publish, batch_aborted, namespace_prefix or stored_type_not_canonical; and, at the four single-item doors (save, publish, rollback, delete), exactly one row per catalogued refusal ([#28355]): invalid_metadata (422 INVALID_METADATA, e.g. the stray-key draft save of steps[7]), not_overridable (403 NOT_OVERRIDABLE), not_creatable (403 NOT_CREATABLE) and destructive_change (409 DESTRUCTIVE_CHANGE). A refusal outside that set writes no row: a 404 NO_DRAFT, a 400 INVALID_REQUEST (the bad-toVersion rollback of steps[12]) and any 5xx (packages/metadata-protocol/src/protocol-refusal-audit.ts#REFUSAL_AUDIT_CODES, the closed map withRefusalAudit reads at each door; protocol.ts and protocol-lock-version-gates.ts, the other recordMetadataAudit callers; protocol-save-conflict.ts)",
502502
"oracle": "api",
503-
"verify": "the /audit body's rows for this name include the publish and rollback actions, and steps[5]'s stale-If-Match 409 as an outcome 'denied', code 'metadata_conflict' save row, each with a non-empty actor field; no row is expected for a 422 spec refusal",
503+
"verify": "the /audit body's rows for this name include the publish and rollback actions, steps[5]'s stale-If-Match 409 as an outcome 'denied', code 'metadata_conflict' save row, and steps[7]'s 422 INVALID_METADATA stray-key refusal as exactly ONE outcome 'denied', code 'invalid_metadata', operation 'save' row (source protocol.saveMetaItem), each with a non-empty actor field naming the authenticated runner. steps[12]'s 400 INVALID_REQUEST rollback, and a POST .../publish sent when no draft is pending (404 NO_DRAFT), add no row. A catalogued refusal with no denied row, a second row for one refusal, a row coded in the SCREAMING wire spelling, or a row for NO_DRAFT or INVALID_REQUEST is a FAIL",
504504
"evidence": "the audit response"
505505
},
506506
{
@@ -537,7 +537,8 @@
537537
{ "revision": 7, "date": "2026-10-19", "change": "steps[2], acceptance[6].clause and acceptance[6].verify corrected from QA run #24604 (18.0 sweep round 2, ba4afcc2), re-read at the console pin 4016370af3c9: the Studio item header reads 'Draft · N unpublished' (engine.studio.itemDraftPending, objectui#12725) — 'Unpublished draft' is the chip of other surfaces (ObjectListViewInspector, the OWD overview), not this item header — and a REST publish shows in Studio only after a reload. The round's other draft notes are not taken: no step of this item discards a draft (so the ?state=draft discard spelling has no clause to correct), and the NS_ prefix a scratch dashboard was given is not required (the namespace-prefix rule judges objects only — packages/spec/src/kernel/namespace-prefix.ts). Wave anchor #24579 round 2 §3 (6272314386)", "ref": "#24671" },
538538
{ "revision": 8, "date": "2026-10-20", "change": "automated dropped and fixtures.knownGaps[0] added — §2 theme \"pins that cover no full clause\" of wave anchor #24579 (18.0 sweep), one of the leftovers round 6 (#24697) named. Tier 1 run #24598 scored every clause not-run on dashboard-designer-roundtrip.dogfood.test.ts, green 3/3 at ba4afcc2: it saves, publishes and reads back a layout-less dashboard, which is acceptance[1]'s post-publish half and no full clause. Round 1's QA run #24571 had scored acceptance[0]–[5] and [7]–[11] pass on that pin alone; QA run #24604 drove acceptance[6] and negative[0]–[4] by hand. The item had no knownGaps, so the line is new: it says what the pin asserts and when `automated` may return. The item is now Tier 2 (P1, no pin). No clause changed", "ref": "#24723" },
539539
{ "revision": 9, "date": "2026-10-27", "change": "acceptance[8] (clause, verify) and steps[9] follow the diff's shipped granularity, and acceptance[5].verify names the earlier refusal (checklist-accuracy findings c8 and c5 of the coordinator leg of QA run #26715, at 3fcafcd3; re-read at 43731031). (1) The clause expected the edited widget's own key (widgets[0].title); the door answered changed [{ path: 'widgets', from, to }]. diffMetaItem's diff is shallow by contract (protocol.ts diffShallow: top-level keys only, deep structural diffs out of scope), so the clause now asks for the changed top-level key and no unchanged one — still never a whole-document dump. (2) A stray widget key is refused at the draft save (422 INVALID_METADATA, unrecognized_keys), so there is no invalid draft to publish; that refusal now scores the invalid-draft clause beside the unchanged live read", "ref": "#26715" },
540-
{ "revision": 10, "date": "2026-10-31", "change": "acceptance[10] names which denials the audit trail records, in place of 'attempts (allowed and denied)'. The protocol writes a denied row only for item_locked, metadata_conflict (the save door's 409 on a stale If-Match included, packages/metadata-protocol/src/protocol-save-conflict.ts) and the batch publish's batch_aborted, namespace_prefix and stored_type_not_canonical; a 422 INVALID_METADATA spec refusal and a 404 NO_DRAFT write none. The verify gains steps[5]'s 409 as a denied metadata_conflict row with its actor, which this item already drives, so the clause is stronger. The other denial codes the sys_metadata_audit object documents (not_overridable, not_creatable, invalid_metadata, destructive_change) have no writer in packages/metadata-protocol at this base. Accuracy finding of QA run #27441. Wave anchor #27377, wave-3 accuracy slice S2; read at base a0f865491d", "ref": "#27441" }
540+
{ "revision": 10, "date": "2026-10-31", "change": "acceptance[10] names which denials the audit trail records, in place of 'attempts (allowed and denied)'. The protocol writes a denied row only for item_locked, metadata_conflict (the save door's 409 on a stale If-Match included, packages/metadata-protocol/src/protocol-save-conflict.ts) and the batch publish's batch_aborted, namespace_prefix and stored_type_not_canonical; a 422 INVALID_METADATA spec refusal and a 404 NO_DRAFT write none. The verify gains steps[5]'s 409 as a denied metadata_conflict row with its actor, which this item already drives, so the clause is stronger. The other denial codes the sys_metadata_audit object documents (not_overridable, not_creatable, invalid_metadata, destructive_change) have no writer in packages/metadata-protocol at this base. Accuracy finding of QA run #27441. Wave anchor #27377, wave-3 accuracy slice S2; read at base a0f865491d", "ref": "#27441" },
541+
{ "revision": 11, "date": "2026-11-02", "change": "acceptance[10] (clause, verify) re-pointed to #28355: revision 10 said a 422 INVALID_METADATA spec refusal writes no row, and #28355 now stamps one denied row per catalogued refusal at the four single-item doors (protocol-refusal-audit.ts, REFUSAL_AUDIT_CODES = NOT_OVERRIDABLE, NOT_CREATABLE, INVALID_METADATA, DESTRUCTIVE_CHANGE, stored lower-case). The clause names those four beside item_locked, metadata_conflict and the batch codes, and keeps NO_DRAFT, INVALID_REQUEST and 5xx as writing none; the verify asks for steps[7]'s 422 as exactly one denied invalid_metadata save row with the actor, and for no row from steps[12]'s 400 or a NO_DRAFT publish. acceptance[3] spells the wire code METADATA_CONFLICT and says the stale If-Match must be sent while a draft row exists. Measured at base 0a41075a through the real protocol doors with a throwaway probe (deleted): the stray-key dashboard draft save answered 422 INVALID_METADATA with one denied invalid_metadata row carrying the actor; a publish with no draft answered 404 NO_DRAFT and a rollback with no toVersion 400 INVALID_REQUEST, neither writing a row; a draft save carrying the published version as If-Match with no draft row answered 409 METADATA_CONFLICT (current is null). Stronger, not weaker: the 422 that scored a row as a FAIL now owes one. QA run #29002 clause FAIL", "ref": "#29013" }
541542
]
542543
},
543544
{

0 commit comments

Comments
 (0)