Repository navigation
fix(metadata-protocol)!: the save door refuses every hook with no body, including one with neither a body nor a handler (#21689) - #21706
Conversation
…, not only a handler-only one Claude-Session: https://claude.ai/code/session_017ErfyP2Rx7XWHJA27QjyUi Co-authored-by: Claude <noreply@anthropic.com>
…predicate refuses Claude-Session: https://claude.ai/code/session_017ErfyP2Rx7XWHJA27QjyUi Co-authored-by: Claude <noreply@anthropic.com>
…-field refusal on the real door Claude-Session: https://claude.ai/code/session_017ErfyP2Rx7XWHJA27QjyUi Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017ErfyP2Rx7XWHJA27QjyUi Co-authored-by: Claude <noreply@anthropic.com>
…ok-no-body-save-door
…ok-no-body-save-door
📓 Docs Drift CheckThis PR changes 1 package(s): 5 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
What this run could not see
Coarse fallback — 11 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 8889850e9246d840185c39e6f5c672a9d5e42417 && git checkout 8889850e9246d840185c39e6f5c672a9d5e42417
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 16d241a6af00be4acce9883190fc333a5f560825 15402d98f8760f77e30a3058208925c460035ba6 && git checkout -B drift-repro 16d241a6af00be4acce9883190fc333a5f560825 && git merge --no-ff 15402d98f8760f77e30a3058208925c460035ba6
node scripts/docs-audit/affected-docs.mjs --json 16d241a6af00be4acce9883190fc333a5f560825
|
ACCEPT — PR #21706 at head
|
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 37190715356 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
…t blocks[i].dataset, naming the block (objectstack-ai#21702) (objectstack-ai#21712) Fixes objectstack-ai#21702 Clause-②: yes (narrowing) Triage direction `5977861131` (enforce), claim `5977924610`. The joined arm of `ReportSchema`'s refinement now refuses each block of a `joined` report that binds no `dataset`, at `blocks[i].dataset`, naming the block, with the prescription to bind the block to a dataset. The refinement comment "each block dataset-bound" and the reports guide's type-table cell "(each block dataset-bound)" were declarations; they are now enforced. ## What changes - **The refusal** (`packages/spec/src/ui/report.zod.ts`). A per-block arm inside the joined branch of `ReportSchema`'s `superRefine`, right after the existing "needs `blocks`" check. For each block whose `dataset` is undefined it adds one `custom` issue at `['blocks', i, 'dataset']`. The message comes from a module-private builder, `joinedBlockDatasetRequired`, worded like the neighbouring joined refusals: ```text a `joined` report draws each block from that block's own `dataset`, and block `NAME` binds none, so nothing queries it and it draws no rows. Bind the block to a dataset: set its `dataset` to the dataset whose measures (`values`) and dimensions (`rows`) it shows. ``` `NAME` is the block's `name`. A block whose `name` is empty (its own `too_small` issue, which does not stop the refinement) is named by position instead, as `blocks[1]`. - **What stays accepted.** `JoinedReportBlockSchema.dataset` stays `.optional()`: `blocks` is read on a `joined` report only, so the requirement lives on the joined arm, and a block on a non-joined report is not judged (pinned). No type, export or JSON Schema key changes. The block's `dataset` `.describe()` now reads "Dataset name to bind (ADR-0021); a joined report refuses a block without one", and `content/docs/references/ui/report.mdx` is regenerated with `gen:docs` (two table rows). - **The ADR-0087 kit**, in objectstack-ai#21687's shape: - the D3 semantic entry `entries/semantic/18.ui-report-joined-block-dataset-required.ts`; - its step-18 rationale fragment in `STEP18_RATIONALE` at **order 77**, inserted where its id sorts. 77 is the next free order: the highest on `main` is 76, re-read at `7e0066af7a` just before this PR. objectstack-ai#21699 (74 to 76) and objectstack-ai#21698 landed before this branch's base `16d241a6af`, so no merge was needed; - `registry.ts` regenerated with `gen:migration-registry`; - one BREAKING `@objectstack/spec` `minor` changeset, `.changeset/21702-joined-report-block-dataset-required.md`, carrying the `Clause-②` line, the `adr-0087: registered ui-report-joined-block-dataset-required` disposition marker and a FROM → TO table. The fragment and entry text state each decision in words and carry no tracker number. No tombstone (no key is removed) and no D2 conversion (only the author knows which dataset a block was meant to show). - **`content/docs/ui/reports.mdx`: no edit.** No sentence there became false; the type-table cell became true. See Acceptance notes. ## Census, at base `16d241a6af`, before any edit `git grep` for a `type: 'joined'` report across `examples/**`, `packages/**`, `skills/**`, `content/docs/**`, `docs/**`, `scripts/**` and `apps/**` gave 33 lines in 15 files: CHANGELOG quotations, the spec's own comments, and these reports: | where | joined reports | unbound blocks | |:--|:--|:--| | `examples/app-showcase` `TaskOverviewReport` | 1 | 0 | | `content/docs/ui/reports.mdx` example | 1 | 0 | | `packages/lint` `validate-chart-bindings.test.ts` (raw stacks, never parsed) | 4 | 0 | | `packages/platform-objects` `report-form-echo-decisions.test.ts` | 2 | 0 | | `packages/spec` tests (`report.test.ts`, `filter-save-door-face-parity.test.ts`, `joined-report-block-type.test.ts`) and the `report-joined-chart-removed` conversion fixture | 10 | 0 | | `packages/metadata-protocol` `protocol.invalid-metadata-422-face-inventory.test.ts` | 1 | **1**, unbound on purpose (below) | | `skills/**` | 0 | 0 | - Triage measured hotcrm `4054ec26` (1 joined report, 0 unbound blocks) and cloud `2205b530` (none). I took those readings as given. I read hotcrm's `src/sales/reports/churn.report.ts` once, to shape the preservation fixture. Every block binds a dataset: three bind `account_metrics` and the fourth, `recently_closed_lost`, binds `opportunity_metrics`. So triage's line "every block binds `account_metrics`" is slightly off; its conclusion, zero unbound blocks, stands. - **objectui (read only, at `2e818d0b51` and at this repo's pin `ab18797215`).** Studio's joined-report authoring **can** save a block with no `dataset`. That producer is this narrowing's reach: - `ReportDefaultInspector.tsx` renders the blocks through `SchemaForm` with the spec `reportForm` "Joined blocks" repeater; - `RepeaterField`'s `add()` seeds a blank row with every column `undefined`; - the row's `dataset` column is free text and not required (the block's derived JSON Schema `required` is `["name"]`, measured); - the bundled `ReportSchema` (`clientValidation.ts`) and the save door both accepted the result. Filed as objectstack-ai/objectui#11601: category ①, no labels, dedupe query and hit count in its body. After the spec bump, Studio's live validation and the save door both refuse such a block at `blocks.N.dataset`. - The renderers, at the pin: `DatasetReportRenderer`'s joined branch passes `String(block.dataset ?? '')` to each block's table, and that table's query hook goes idle on an empty name (`:443`). A report whose blocks all lack one fails `isDatasetReport` and falls through to the presentation bridge. `DrillDownDrawer`'s `isDatasetBoundReport` lists the records instead of drawing it. ## Fixture triage: one test-only file outside the claim's file surface `protocol.invalid-metadata-422-face-inventory.test.ts` section 5 (the joined-report `chart` door pins) left its block **unbound on purpose**: the door's author-time gate refuses an unresolvable dataset with `chart-dataset-unknown`, and the stub engine had no dataset universe. The new refusal turned 2 of its 23 tests red (`Tests 2 failed | 21 passed`): the container case got a second issue at `blocks.0.dataset`, and the CONTROL was refused at `blocks.0.dataset`. That second red is the metadata save door (`422 INVALID_METADATA`, `writeFace: 'meta-envelope'`) refusing the probe shape. - **Disposition: add the declaration.** The block binds `task_metrics`, and the harness gains an optional `makeProtocol({ datasets })`, which registers that dataset through `registry.listItems('dataset')`. Every other caller passes nothing, so the registry lists nothing, as before. Result: `Tests 23 passed (23)`. - **The registration is load-bearing.** I mutated the CONTROL to call `makeProtocol()` without datasets (`scripts/ablation-replace.mjs`, anchor 1 → 0, blob `f718099c2d` → `9dc51bd7b8`). Predicted 1 red / 22 green; observed `Tests 1 failed | 22 passed`. The failure was `chart-dataset-unknown` at `reports[0].blocks[0].dataset`, "Declared datasets: (none)". Restore: blob back to `f718099c2d`, which equals HEAD, and `git diff HEAD` is empty. - This file is outside the claim's declared file surface. It is reported in the dev report as a deviation. - Queue check: objectstack-ai#21706, queued at this writing, appends a section to the same file at line 570 and later. A local `git merge-tree` of this head with that queue head exits 0. The file is not `merge=os-regen` routed, so that local answer is also GitHub's. ## Doors, tested and probed - **Pins** (`packages/spec/src/ui/report-joined-block-dataset.test.ts`, 16 tests): - the triage probe shape is refused once per block at `blocks.0.dataset` and `blocks.1.dataset`, each naming its block; a bound block beside an unbound one draws one issue, at the unbound index; an empty name is named by position; - the new issue joins the other joined-arm refusals rather than replacing them; - taking the advice parses; - CONTROLS: a block on a non-joined report, and `JoinedReportBlockSchema` parsed on its own, both still parse; - doors: `defineReport` throws; the registered `report` type schema refuses (and accepts the bound report); `ObjectStackDefinitionSchema`, the stack parse `objectstack validate` runs, refuses at `reports.1.blocks.{0,1}.dataset`; `defineStack` answers `STACK_SCHEMA_INVALID` / 422; - preservation: the showcase `TaskOverviewReport` (mirrored byte for byte) parses with output equal to its input, and a fixture shaped like hotcrm's `customer_churn_signals` parses, gaining only the `drilldown` default; - ledger: one D3 entry at protocol 18 with no conversion; the step-18 rationale names it; no `JoinedReportBlock:dataset` tombstone, with a control on a known tombstone. - **`objectstack validate`, the real CLI** (`packages/cli/bin/run.js`, built here). Fixtures were temporary, in the session scratchpad, outside the repo; `@objectstack/spec` resolved to this worktree's build. - The triage probe stack (two blocks, each only `name` + `label`): **exit 1**, `"code": "STACK_SCHEMA_INVALID"`, `defineStack validation failed (2 issues)` at `reports.0.blocks.0.dataset` and `reports.0.blocks.1.dataset`, each with the message above. - CONTROL, the same report with both blocks bound to a declared dataset: **exit 0**, `"valid": true`. - The showcase app (`examples/app-showcase/objectstack.config.ts`, four reports including `TaskOverviewReport`): **exit 0**, `"valid": true`. - **The CLI door's verdict is this arm's, proven through `dist`.** The CLI reads `@objectstack/spec` through `dist`, so the mutation was rebuilt: - mutated leg: the `ctx.addIssue` of the new arm became a `globalThis` marker assignment (anchor 1 → 0, blob `fadd536165` → `2cbfdb9feb`); `@objectstack/spec` rebuilt; `ablation-dist-preflight.mjs` found the marker in `dist` (exit 0); the probe then gave **exit 0**, `"valid": true`. That reproduces the card's reading at `main`; - restore leg: blob back to `fadd536165`, which equals HEAD, and `git diff HEAD` is empty; rebuilt; `--absent` found the marker in none of 228 built files (exit 0); the probe gave **exit 1** `STACK_SCHEMA_INVALID` again. ## Ablation of the refusal, at the pins (predicted first) `scripts/ablation-replace.mjs` replaced the arm's `ctx.addIssue(...)` with a no-op (anchor 1 → 0, blob `fadd536165` → `45f34370c5`). The pins import `./report.zod` relatively, which resolves to `src`, so no build was needed. Predicted: 8 red, the 4 refusal pins and the 4 door pins; 8 green, the advice, the 2 controls, the 2 preservation pins and the 3 ledger pins; `report.test.ts` untouched. Observed: `Tests 8 failed | 80 passed (88)` over the pin file and `report.test.ts`. The 8 were exactly the predicted ones. Restore: blob equals HEAD (`fadd536165`), and `git diff HEAD` is empty. ## Verification (all at head `c4e3ab9631` unless noted) - `@objectstack/spec` full suite (`vitest run --project local --maxWorkers=2`): `Test Files 613 passed (613)`, `Tests 18201 passed | 1 todo`. - `pnpm --filter @objectstack/spec typecheck` (tsc, scripts, test layer: `check:test-typecheck: OK`) and `pnpm --filter @objectstack/metadata-protocol typecheck`: exit 0. `--listFiles` shows both edited test files in their programs. - Consumers that parse a joined report: `platform-objects` `report-form-echo-decisions.test.ts` 35 passed; `lint` `validate-chart-bindings.test.ts` 47 passed; `@objectstack/example-showcase` whole suite `32 files, 399 passed`; `metadata-protocol` face-inventory 23 passed. - `pnpm --filter @objectstack/spec check:generated`: one artifact stale before regeneration (`content/docs/references/**`), regenerated with `gen:docs`; then `check:generated` exit 0. - Derived gates: `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack` derived 115 commands. Every one was run, with its exit code recorded before any pipe. `--ran` reconciled **115 derived, 115 run, 0 NOT-MEASURED, 0 UNRUN**. - Two first exited 3 (prerequisite not met, packages with no `dist`): `check:skill-examples` and `check:dual-build-cjs-loads`. Both were re-run green after building those packages. All 115 exited 0. - Among them: `check:adr-0087-registration`, `check:changeset-no-major`, `check:migration-registry`, `check:spec-changes`, `check:upgrade-guide`, `check:authorable-surface`, `check:api-surface`, `check:docs`, `check:doc-authoring`, `check:issue-citations`, `check:nul-bytes`, `check:cross-package-test-inputs`. - eslint, narrowed and proven: 1. population: `eslint.config.mjs`'s `**/*.{ts,…}` block covers all five changed `.ts` files; 2. `--format json`: 5 files, 0 errors, 0 warnings; 3. invariance: the config enables no type-aware linting (no `parserOptions.project`, as its own comment states), so this diff cannot move a verdict on an untouched file. The repo-wide `pnpm lint` is CI's. - Declared to CI: the path-scheduled jobs (Test Core shards, Dogfood, Temporal Conformance, Build Core), the whole-workspace type-check lanes and every downstream consumer suite of `@objectstack/spec` beyond the four above. ## Acceptance notes (observations, not filed) - `reports.mdx` says a `joined` report "must declare at least one block". That is still true, but it no longer names every requirement: each block must now also bind a `dataset`. Not edited, under the claim's rule that only a sentence this change makes false is edited. Carrier: none. - The block row in the spec's own `reportForm` (`packages/spec/src/ui/report.form.ts`, "Joined blocks" repeater) offers `dataset` with no `ref:dataset` widget and no `required`. objectstack-ai/objectui#11601 names this as a possible spec-side fix for the Studio producer, to be measured first. Carrier: objectstack-ai/objectui#11601's acting seat. - The requirement is a refinement, so the published JSON Schema does not carry it. `ui/Report` already sits in `dropped-refinements.baseline.json`, and the new arm adds no site there. The `.describe()` text is now the JSON-Schema-visible hint. - The joined arm, this check included, does not run while a block carries an unknown key or a wrong-typed member: that issue aborts the refinement. The dataset refusal then arrives after that first issue is fixed. This is existing behaviour shared by every arm of the refinement. --- _Generated by [Claude Code](https://claude.ai/code/session_01T9u38rswFp5Rw8DswRUReJ)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
… instead of a tracker number (stage 10) (objectstack-ai#21713) Part of objectstack-ai#20749 Clause-②: no Stage 10 of this card, and the first area of class (e): the test strings shipped under `packages/spec/src`, as ruled in `5902360492` on objectstack-ai#20513. This stage takes the whole `automation/` directory. Its 105 test-title and test-message literals carried 110 tracker ids citing 55 records. Each id now either states what its record decided, in words (form D), or is dropped where the title already says it. Text only: no assertion, fixture value, test count or code comment changes. ## Census at the base (`7e0066af7a`, the claim's base) Instrument: stage 9's `census.cjs` (md5 `6e42a45a926d375013c32d62f16a296e`, byte-identical), plus one added classification pass. A literal counts as a test title when its folded message is argument 0 of a `describe` / `it` / `test` call, `.each` / `.skip` / `.only` chains included. Everything else is an "other" string. Reference: the same instrument reads **1803 messages / 1919 ids in 425 files at `9b8c7f38d7`**, stage 9's reading exactly. Since then, objectstack-ai#21699 added 1 / 1 (`ui/component-props-unknown-members.pin.test.ts:143`) and objectstack-ai#21700 moved 3 / 3 (the two reader literals it re-anchored), which gives 1801 / 1917 at the base. | directory | files | titles msg / ids | other msg / ids | total msg / ids | excluded files | |:--|--:|--:|--:|--:|:--| | `data/` | 95 | 445 / 475 | 23 / 26 | 468 / 501 | | | `ui/` | 81 | 374 / 397 | 18 / 18 | 392 / 415 | `report.test.ts` 3 / 3 | | `api/` | 40 | 181 / 193 | 8 / 8 | 189 / 201 | | | `system/` | 34 | 128 / 138 | 26 / 27 | 154 / 165 | `job.test.ts` 4 / 4 | | (files directly in `src/`) | 30 | 117 / 119 | 1 / 1 | 118 / 120 | | | **`automation/`** (this PR) | 21 | 101 / 106 | 4 / 4 | **105 / 110** | | | `kernel/` | 36 | 92 / 96 | 10 / 10 | 102 / 106 | | | `shared/` | 21 | 73 / 81 | 12 / 14 | 85 / 95 | | | `contracts/` | 25 | 59 / 70 | 4 / 4 | 63 / 74 | | | `conversions/` | 9 | 34 / 34 | 0 | 34 / 34 | | | `security/` | 8 | 28 / 28 | 0 | 28 / 28 | | | `ai/` | 9 | 13 / 15 | 5 / 5 | 18 / 20 | | | `identity/` | 6 | 14 / 14 | 1 / 1 | 15 / 15 | | | `integration/` | 4 | 13 / 13 | 1 / 1 | 14 / 14 | | | `migrations/` | 2 | 9 / 12 | 0 | 9 / 12 | | | `marketplace/`, `meta-spelling/`, `studio/` | 5 | 7 / 7 | 0 | 7 / 7 | | | **total** | **426** | **1688 / 1798** | **113 / 119** | **1801 / 1917** | 7 / 7 | - **Excluded, in flight under this seat:** `system/job.test.ts` carries objectstack-ai#16292 (`:92`), objectstack-ai#14478 (`:471`), objectstack-ai#4667 (`:836`) and objectstack-ai#19184 (`:881`), and `ui/report.test.ts` carries objectstack-ai#20161 (`:233`), objectstack-ai#3916 (`:334`) and objectstack-ai#5013 (`:426`). All seven sit in titles. They wait for a later stage, after objectstack-ai#21703 and objectstack-ai#21702. - **Controls.** Lit, single line: `automation/approval.test.ts:135` reads one title with objectstack-ai#3508. Lit, multi-line: `api/discovery-environment-subset.pin.test.ts:63-66`, a `+` chain, reads as ONE message with its id on `:65`. Dark: the `// objectstack-ai#3508` comment at `automation/approval.test.ts:131` reads 0. Planted in a scratch copy of the head file: an id in a title reads 1 / 1, and an id in a comment reads 0. - **A wider pattern** (any `#` plus digits, so two-digit and six-digit numbers too) reads the same 105 / 110 in `automation/` at the base, and 0 / 0 at the head. - **At the head:** 1696 messages / 1807 ids in 405 files. `automation/` reads 0 / 0. Nothing else moved. ## How the area was chosen The directories are ranked by id count, and a stage takes whole directories up to about 100 ids. The four busiest each exceed that bound alone: `data/` (501), `ui/` (415), `api/` (201) and `system/` (165). The files directly in `src/` (120) are 20% over. `automation/` (110) is the busiest whole directory within about 10% of the bound, so it is this stage. The rule picked it before any card was read. Its 55 records (53 in this repository, 2 in objectui) were all readable in one pass. 54 answer 200. objectstack-ai#6362 answers 404, and its decision was read from its landing commit `b5404f496`. **Named for the next stages** (by directory, from the table): `data/` (about five stages, by subdirectory or file group; `data/driver/` alone is 52), `ui/` (about four), `api/` (two), `system/` (two), the files directly in `src/` (one), `kernel/` (one), `shared/` (one), `contracts/` with `conversions/` (one, 108), and `security/`, `ai/`, `identity/`, `integration/`, `migrations/`, `marketplace/`, `meta-spelling/` and `studio/` together (one, 96). The seven excluded ids join `system/` and `ui/` once their owners land. ## What each id became 38 literals (40 ids) now state a decision in words. 67 literals (70 ids) drop a citation the title already explains. Each record was read with its comments through REST, and where a record has no comments, from what landed. | record | ids | result | |:--|--:|:--| | objectstack-ai#3508 | 2 | `APPROVER_VALUE_BINDINGS`: "an approver value is picked from the records the engine resolves". `APPROVER_VALUE_SOURCES` (the follow-up): "where each picker finds its candidates, published on the wire". | | objectui#2955 | 1 | "for the decision dialog to render and enforce": both decision entry points collect the typed outputs, and `required` is enforced. | | objectstack-ai#3810 | 1 | "names the match-everything-write hazard": a filter emptied by interpolation matches every row, and the node is refused instead. The test pins the words `match-everything write`. | | objectstack-ai#4001 | 13 | "strict as of objectstack-ai#4001 批 9" becomes "an unknown key is refused, not stripped" (5 titles). Also "refused, not stripped", "an unknown key is refused, per shape" and "the unknown-key gate". Dropped from 5 titles that already read "unknown keys are rejected, not stripped". | | objectui#2670 | 1 | "so the flow designer renders it as a template": the designer's loop and region rendering reads this marker. | | objectstack-ai#4396 | 2 | "a function that writes says so; pure is the default", and "the authoring surface where a function declares its effect" (landed `eb4204b`). | | objectstack-ai#4697 | 2 | `defaultValue`: "a declared variable is bound on every path" (ruling A). Dropped once. | | objectstack-ai#3896 | 3 | "outputSchema retired: declared, never validated" (the audit close-out's reason, as `flow.zod.ts`'s tombstone records it). Dropped twice. | | objectstack-ai#4247 | 1 | "maxRetries — one default, and no zero-attempt “retry”" (landed `a648e96`). | | objectstack-ai#16134, objectstack-ai#15713 | 7 | "a region node reusing a top-level id is refused — one node-id space now spans every region" (ruling, batch 61). Dropped from 5 titles that state uniqueness. | | objectstack-ai#9205 | 5 | "template reference — notify content localized through an email template" (the ruled emailTemplates route). Three titles say "the template path" where they said "pre-objectstack-ai#9205". Dropped once. | | objectstack-ai#7086 | 1 | "severity — the closed info \| warning \| critical vocabulary" (the enum route). | | objectstack-ai#4415 | 3 | "FlowNodeSchema parses its own regions" (ruling 2026-08-07, direction 1). Dropped from 2 titles that already say it. | | objectstack-ai#4347 | 1 | "collectFlowGraphs — every region is walked, not only the top level" (landed `31e0be9`). | | objectstack-ai#4401 | 2 | "FLOW_REGION_SLOTS, the one declaration of where regions live" (landed `4bfd455`). Dropped once. | | objectstack-ai#4414 | 1 | "`condition` is pointed at the out-edges, NOT given the one-edit rename" (one working routing model, landed `5293114`). | | objectstack-ai#15429 | 1 | "taking every true branch must be declared" (ruling item 2: explicit `inclusive`). | | objectstack-ai#14149 | 3 | "every entry older than the value role" (ruling A: a value-role CEL slot on `assignment`). Dropped twice. | | objectstack-ai#19938 | 4 | "the CRUD `fields.*` value slots added exactly two rows". Dropped three times. | | objectstack-ai#15572 | 3 | "predicateSlotRefusal — a predicate slot holds bare CEL text", and "the other two doors refuse it". Dropped once. | | objectstack-ai#15662 | 1 | "structuralConditionRefusal — a structural condition is CEL text or an expression". | | objectstack-ai#15792, objectstack-ai#15807 | 4 | "REFUSES an `ast`-only envelope — admitted at first, refused once an evaluated slot required a `source`". Dropped from 2 titles that state the rule. | | objectstack-ai#17493 | 3 | Table row "a blank string — blanks are refused" (ruling A). Dropped twice. | | objectstack-ai#14945 | 4 | "EndConfigSchema — the `end` node contract: it may refuse the run with a message" (ruling 2′). Dropped three times. | | objectstack-ai#15617 | 4 | "`failed` is the fold INCLUDING what a delegating node rolled up from its child — it answers what the run caused" (ruling option 1). Dropped three times. | | dropped only | 36 | objectstack-ai#3196, objectstack-ai#3266, objectstack-ai#4158, objectstack-ai#4277, objectstack-ai#4343 (2), objectstack-ai#4389, objectstack-ai#4525, objectstack-ai#4738, objectstack-ai#4964 (2), objectstack-ai#6758, objectstack-ai#7085, objectstack-ai#9106, objectstack-ai#12278, objectstack-ai#14964, objectstack-ai#15430, objectstack-ai#15646 (3), objectstack-ai#16752, objectstack-ai#17306, objectstack-ai#17852, objectstack-ai#18102, objectstack-ai#18112 (2), objectstack-ai#18847, objectstack-ai#19151, objectstack-ai#19961 (4), objectstack-ai#20316 (2): each title already states the pinned decision. For objectstack-ai#4988 and objectstack-ai#6414, the two expect messages already say what was retired. | | objectstack-ai#6362 (404) | 1 | Dropped. The title "PRESERVES all seven envelope keys — measured, not assumed" carries the decision recorded in `b5404f496` (`webhook` was measured, and all seven keys survive). | ## Readers - **Test-name filters:** none. A tracked-tree search for `-t` and `--testNamePattern` finds only `packages/qa/dogfood/README.md:142` (`-t "owner-scoped"`), which is unrelated. - **Snapshots:** none. `automation/` has no `__snapshots__` and no `toMatchSnapshot`. - **Titles by substring:** every old title, plus a window around each id (250 needles), was searched across the tracked tree outside its own file. No gate, doc or script matches one. The hits are other files' own titles with the same words: `identity/`, `security/` and `automation/` siblings, a later stage's lot. There are also two code comments in `flow.zod.ts` and `flow-function.zod.ts`, which belong to the comment lane. - **Twin tables, not readers:** `packages/lint/src/validate-expressions.test.ts:4442/4445` and `packages/services/service-automation/src/decision-branch-expression-absent.test.ts:61/64` repeat the `flow-decision-branch-expression-absent` table's row names. Nothing compares them mechanically: the "same table" parity is prose in the headers, and it covers assertions, not names. They are outside this stage's surface (see Acceptance notes). ## Text-only proof A scratch tool (`textonly10.cjs`) compares base and head file by file on three legs: 1. **Skeleton:** the full AST, with string pieces masked. It must be identical. 2. **Comments:** every comment, byte-equal. 3. **Strings:** each string leaf that changed must sit in a test-call title position, or on one of the 4 declared lines (`flow-decision-branch-expression-absent.test.ts:63` and `:66`, table `name` values that feed `$name` titles; `sync-retirement.test.ts:120` and `:158`, expect messages). It must carry a tracker id before and no `#` plus digits after. - **Result:** 21 of 21 files SAME, 105 changed (101 title, 4 declared), on all three legs. - **Diff hunks:** exactly the 105 planned lines, with every file keeping its line count. - **Controls (10 of 10 as predicted, on scratch copies, each anchor hit once):** identifier rename DIFF; numeric literal DIFF; comment edit COMMENT DIFF; a non-title string with an id VIOLATION; a rewritten title given a new id VIOLATION; a title that was id-free at base edited VIOLATION; one title reverted to base SAME (104 changed); a declared string keeping an id VIOLATION; an undeclared expect message changed VIOLATION; a title re-split into a `+` chain DIFF. **Test counts:** the 21 files run at the base (in a separate base worktree) and at the head: 801 / 801 tests on both sides, with the same count and status sequence per file in 21 of 21. 560 full test names change, and each equals the base name with the planned replacements applied. ## Changeset: `skip-changeset` Measured, not assumed: - `npm pack --dry-run` of `@objectstack/spec` lists 2068 files, under `files[]` (`dist`, `src/**/*.zod.ts` and the rest). 0 of the 21 touched files are in it, and 0 `*.test.ts` at all. The control `src/automation/flow.zod.ts` is in it. - In `dist/`, three new phrases and three old ones each read in 0 files. The control `A predicate slot holds BARE CEL TEXT` reads in 2. So this PR publishes nothing, and no changeset is added. ## Verification (at `f3dc3fab03`) - `pnpm turbo run build` over all packages: 71 / 71. - `@objectstack/spec`: `vitest run --project local`, 612 files and 18185 passed, 1 todo. `typecheck` exit 0, including `check:test-typecheck`, whose program holds all 21 touched files. - **Gates:** `dispatch-gates --commands` derived 79 families, and all 79 exit 0. `--ran` reconciles: 79 derived, 79 run, 0 NOT-MEASURED, 0 UNRUN. - **ESLint, a proven narrowing:** `--no-inline-config` over the 21 files, 0 errors and 0 warnings. The population comes from ESLint's own config: 21 configured, 0 ignored. No `parserOptions.project` or `projectService`, so no untouched file's verdict can move. - `check-governed-merges --test`: NOT governed, 210 changed lines. ## Acceptance notes - **Twin row names in other packages:** the lint and service-automation copies of the decision-branch table keep their `the objectstack-ai#19961 shape` and `the objectstack-ai#17493 control` row names, and their twin `describe` titles keep their ids. The lint copy is this card's own later share (the `packages/lint` test strings). The service-automation copy belongs to that package's lane. - **Code comments still carry ids** in these 21 files (for example `approval.test.ts:56`, `:69` and `:131`). They are the comment lane's, untouched here. - **`origin/main` moved** three commits past the base before this PR opened (objectstack-ai#21701, objectstack-ai#21707, objectstack-ai#21706). None touches `packages/spec`, so nothing was merged. --- _Generated by [Claude Code](https://claude.ai/code/session_01T9u38rswFp5Rw8DswRUReJ)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
…nfig kernel too, and the diagnostics locked count reads the item envelope derivation (objectstack-ai#21694) (objectstack-ai#21715) Fixes objectstack-ai#21694 Clause-②: no (narrowing) ## Arm 1a: no recorded reason exempts a host-config kernel I measured H1 before writing any code. - **Where the short-circuit came from.** `if (this.environmentId === undefined) return null;` opened both `lockWriteRefusal` and `assertLockAllowsDelete`. It arrived in 8eca8f3 (2026-05-29, "Update files", then in `packages/objectql/src/protocol.ts`), and neither docblock gave a reason. The only rationale ever written is the title of the test that pinned it: "environmentId=undefined bypasses L3 (control-plane bootstrap)" (`packages/objectql/src/protocol-lock-enforcement.test.ts`). 2796a1f (objectstack-ai#1775) later called the bypass "intentional" in the registry-shadow suite's docblock, again without a reason. - **ADR-0010 records no carve-out.** The §3.3 lock table has no topology column. §6 Phase 1 places `_lock` enforcement in save, publish, delete and rollback. The "single-process dev / bootstrap" sentence in §3.8 is about the `OS_METADATA_WRITABLE` type hatch, which this gate never read. - **objectstack-ai#6710's precedent refutes the inference.** The `MetadataAuthoringChannel` docblock and the comment in `assertRuntimeAuthoringRules` record three facts. `environmentId` is a row-scoping key. The CLI's host-config assembler (`serve.ts`, `new ObjectQLPlugin()` with no options) leaves it undefined while it serves end-user `PUT /api/v1/meta/*`. That assembler is the showcase's own boot shape. objectstack-ai#6710 re-keyed the ADR-0005 carve-out to a declared `authoringChannel`, and objectstack-ai#5086, objectstack-ai#7674 and objectstack-ai#9380 retired the same proxy elsewhere. - **`getEffectiveLock` has no topology term.** Its artifact limb reads the registry, and its overlay limb reads `sys_metadata` through the engine. It does resolve a lock on a host-config kernel: pin 1 is refused there with both `source=overlay` and `source=artifact`. So the gate refuses on every topology, as `packagedBaseRefusal` does. I kept no exemption for the declared `package-author` channel either. No ADR or comment records one for L3, and no assembly in this repository declares that channel (`git grep` finds 0 non-test declarations). H3 (arm 1b) is not taken. ## What changed Only `packages/metadata-protocol/src/protocol.ts` changes at runtime. 1. **The gate.** `lockWriteRefusal` and `assertLockAllowsDelete` lose the short-circuit. `publishMetaItem` (through `promoteDraftForPublish`) and `rollbackMetaItem` already call them unconditionally, so those two verbs now refuse on a host-config kernel too. 2. **The two call sites inside `if (this.environmentId !== undefined)`.** `saveMetaItem` and `deleteMetaItem` asked the gate inside that block, behind their package doors, so removing the short-circuit alone would not reach them. The gate moves out of the block, and it keeps its rank on both kernels: it runs only when `packagedBaseRefusal` admits the write. - On an environment kernel the package door has already thrown by that point, so nothing changes there. - On a host-config kernel the package door is the repository's (`SysMetadataRepository.assertAllowed`, at the write), so a packaged base it refuses keeps that answer. - Without the rank, a packaged app or object that declares `_lock` would answer `ITEM_LOCKED` on a host-config kernel and `NOT_OVERRIDABLE` on an environment kernel. That would be a new topology split in the refusal code. Ablation 2 below pins it. 3. **The count.** `getMetaDiagnostics().stats[type].locked` now counts items whose `servedLockState(...)` reports a lock other than `'none'`. That is the same derivation `getMetaItem` and `getMetaItemLayered` publish. The field's docblock says so. No `packages/spec/src/**` file is touched, so no contract review is owed on that ground. No governed surface is touched. ## Reach: correcting the card's "no shipped producer" Triage graded p3 on the premise that "every `protection.lock` in `platform-objects` is on `object`". Three apps carry one too: `setup`, `studio` and `account` (`packages/platform-objects/src/apps/*.app.ts`, `protection.lock: 'full'`). `app` has `supportsOverlay: true`, so the objectstack-ai#6960 carve-out lets a removal past the package door, and only the `_lock` gate stood behind it. - **At the base (16d241a).** I ran the real `ObjectStackProtocolImplementation` over an in-memory double, without an `environmentId`. Deleting a packaged app that declares `_lock: 'full'` answered success. An environment kernel answered `403 ITEM_LOCKED`. - **On this branch, on a live showcase.** I started a fresh dev server (`pnpm dev -- --fresh -p 38694`) and signed in as the seeded admin. `DELETE /api/v1/meta/object/sys_organization` answered `200` ("No customization overlay found"), where an environment kernel answers `403 NOT_OVERRIDABLE`, so the server is host-config. - `GET /api/v1/meta/app/setup` answers `lock: full`, `editable: false`, `deletable: false`. - `DELETE /api/v1/meta/app/setup` answers `403 ITEM_LOCKED` ("app/setup is locked (_lock=full, source=artifact)"). The grade is the seat's call. This corrects the premise behind it. ## What moves (H2) - **The dev server's own boot.** The fresh showcase boot above logged no `ITEM_LOCKED`, no "is locked (_lock=" and no "metadata store could not be read" (0 hits in 72 lines). Nothing the boot writes is refused. - **`examples/**`.** No example declares `_lock` or `protection:` (`git grep`: 0 hits). - **Writers that now meet the gate on a host-config kernel**, as they already did on an environment kernel: - `os migrate meta --stored --apply` (`migrateStoredMetadata`): a row whose effective lock refuses the write is reported failed instead of rewritten. - `deletePackage` and `discardPackageDrafts`: a locked item becomes a `failed[]` row. - `duplicatePackage`. - plugin-security's permission-set projection. - service-automation's flow-credential migration. - the `/automation` doors, which write through `saveMetaItem` and `deleteMetaItem`. - **A host-config deployment that relied on writing a `_lock`ed item.** Its saves, publishes, rollbacks and deletes are refused now, as on an environment kernel. A stored row that declares `full` can no longer be written or removed through `/meta` on any kernel. The ADR-0010 §3.8 override path is not implemented, and that is unchanged here. - **Fail-closed read.** On a host-config kernel the gate's own `sys_metadata` read now runs first. A failed read is answered `503 SERVICE_UNAVAILABLE`, with the driver error on `cause` (objectstack-ai#5706), before anything is written. A delete used to reach the store and answer with the driver's code or a `500`. - **NOT MEASURED: the cloud control-plane assembly.** It is outside this repository, and if it declares `package-author` and writes `_lock`ed items through `saveMetaItem`, it now meets the gate. - **Tests that moved: 14 cases in 6 files, all fixtures, none a product regression.** Each one leaned on the bypass: - `metadata-protocol/protocol.delete-rewrap-envelope.test.ts` (4 cases). The fault was injected into the first `sys_metadata` read, which is now the gate's own read and fails closed with a 503. The fault now arms once the lock verdict is in, so it lands on the probe read this file pins. - `objectql/protocol-lock-enforcement.test.ts` (1 case). It pinned the bypass itself. It now pins `ITEM_LOCKED` on save and delete, and asserts no `update` or `delete` reached the engine. - `objectql/plugin.authoring-channel.test.ts` (1 case). The bare `new ObjectQLPlugin()` kernel had no driver, so the gate's read failed closed with a 503 before the authoring gate could answer. It now registers a memory driver, as `serve.ts` does, and also asserts that nothing is stored. - `objectql/protocol-meta.test.ts` (1 case). "Fail fast when findOne is unavailable" now asserts the gate's `503 SERVICE_UNAVAILABLE`, with `cause` being the driver error. The test title loses its "500". - `objectql/protocol-publish-package-drafts.test.ts` (3 cases). The double stubbed `assertLockAllowsWrite`, but since objectstack-ai#8594 the publish path asks `lockWriteRefusal`. The stub moves to `lockWriteRefusal`. - `objectql/protocol-registry-shadow.test.ts` (4 cases). The suite wrote its overlay row through a `PUT` that the bypass admitted. The row is now written before the package's lock arrives, which is the pre-dating overlay that the envelope graft exists for. The two removal cases use `no-overlay`, because `full` now refuses removal on every kernel, and the first case also asserts that a further `PUT` is refused. ## The count's cost (H4) `servedLockState` makes no store read. It is `resolveLockState` (pure), plus two `packagedBaseRefusal` calls (registry lookups, which build an `Error` only for a refused item), plus `isArtifactBacked` (registry). The list items already carry the merged artifact protection (`mergeArtifactProtection` in `getMetaItems`), which is the same document shape the item read derives from. So the sweep stays bounded at one registry walk per item, and the store reads are unchanged. ## One authority (H5) I grepped `packages/metadata-protocol/src` and `packages/rest/src` (non-test) for `_lock` readers. - **What remains.** `getEffectiveLock` remains for the doors, `servedLockState` for the read and now for the count, and `mergeArtifactProtection` copies the envelope. - **What went.** The declared-`_lock` count was the only second predicate, and it is gone. - **`rest`.** It has none. - **`runtime`.** The `/automation` doors ask `packagedBaseRefusal`, then write through `saveMetaItem` and `deleteMetaItem`, so the `_lock` gate covers them. - One same-family disagreement is left, and it is not topological. It is in the acceptance notes and the report. ## Pins `packages/metadata-protocol/src/protocol.lock-door-read-agree.test.ts` runs the real doors and the real reads. Each refusal asserts `code` and `status` (ADR-0112). 1. **Pin 1, host-config.** - An overlay `view` row is tried with each of the four `_lock` states. Save and delete do what `editable` and `deletable` say: `ITEM_LOCKED`/403 where the read says no, and admitted past the gate where it says yes. Admission is proved by spying on the gate (reached, answered `null`). - A publish of a `full` row is refused. - A packaged `app` declaring `full` is refused on delete with `ITEM_LOCKED`/403. Its save keeps `NOT_OVERRIDABLE`/403, and the gate is not reached. 2. **Pin 2, both kernels.** `stats[type].locked` equals the number of items whose `getMetaItem` envelope reads locked, for `flow`, `action`, `app` and `view`. - Lit control: the tiles are `{flow: 1, action: 1, app: 2, view: 2}`. - A count of declared `_lock` would give `{0, 0, 1, 2}`. The flow, action and second app are locked by the package door alone. 3. **Pin 3, environment kernel, unchanged.** An overlay `full` row is refused `ITEM_LOCKED` on save and delete, and a `no-delete` row passes the gate on save and is refused on delete. A packaged app keeps `NOT_OVERRIDABLE` on save and `ITEM_LOCKED` on delete, the same codes the host-config kernel now gives. ## Reverse verification Both ablations ran from the committed fix (HEAD 2ec0a2c), through `scripts/ablation-replace.mjs`, inside a script with an `EXIT INT TERM` trap that restores from `HEAD`. The pin file imports `./protocol.js` (source), so no rebuild is in the path. The predicted direction was declared before running. 1. **Ablation 1 restored the short-circuit in both helpers and the declared-`_lock` count.** - The anchors landed on disk: the gate anchor went from 2 to 0 with 2 markers on disk, and the count anchor from 1 to 0 with 1 marker. The blob went from 185d138 to 5b338f26488f. - The result was as predicted. In pin 1, 5 cases went red, and the `_lock=none` control stayed green. Both pin 2 cases went red. All 3 pin 3 cases stayed green. Total: 7 failed, 4 passed (11). 2. **Ablation 2 removed the rank at both call sites (`true ||` before `packagedBaseRefusal`).** - The anchor went from 2 to 0, with 2 markers on disk. - Only the packaged-app case went red, because the save answered `ITEM_LOCKED` instead of `NOT_OVERRIDABLE`. Pin 3's environment twin stayed green. Total: 1 failed, 10 passed. **Restore.** After each ablation the blob equals the `HEAD` blob 185d138, `git diff HEAD` on the file is empty and `git status --porcelain` is empty. The tool proved this on each leg, and so did the trap. ## Tests On the merged head 4265c6b (after objectstack-ai#21706): - `@objectstack/metadata-protocol`: `vitest run`, 211 files passed and 3 skipped, 3589 tests passed and 19 skipped. `typecheck` (`tsc --noEmit`) is green, and `--listFiles` shows it compiles 214 test files, including both test files touched here. - `@objectstack/objectql`: `vitest run --project local`, 372 files and 7458 tests passed. `typecheck` (tsc, tsconfig.scripts, `check:test-typecheck`) is green. On 2ec0a2c (before the second merge of main, which touched neither package's lock path): - `@objectstack/rest` (`--project local`): 260 files, 4897 tests passed, 326 skipped. - `@objectstack/runtime` (`--project local`): 321 files, 4563 tests passed, 19 skipped. - `@objectstack/plugin-security` (the 7 files that call the write verbs): 150 tests passed. - `@objectstack/service-automation` (2 files): 24 tests passed. These four were run because the order asked to measure which tests move. They are downstream consumers, and this is not a public-surface change. ## Gates Run on head 4265c6b, after the final commit. Each command's exit code was captured before any pipe. - **Derived set.** `node scripts/pm/dispatch-gates.mjs --commands` (no paths) derives 74 families. All 74 exit 0, and the `--ran` reconciliation reads "74 derived, 74 run, 0 NOT-MEASURED, 0 UNRUN". These include `check:adr-0087-registration` (the `no-migration-prescription` disposition is accepted), `check:empty-changeset`, `check:changeset-no-major` (its level axis is PR-scoped and reads this body in CI), `check:engine-double-contract`, `check:nul-bytes`, `check:doc-authoring`, `check:cross-package-test-inputs`, `check:test-source-alias`, `check:published-files` and `check:dts-closure`. - **`check:engine-double-contract`.** At first it asked for the new pin file's `findOne` double to be recorded. `--write` added one row to `scripts/engine-double-contract.pinned.json`, with "0 added or grown, 0 lost", and that row is committed here. - **Artifact-roster block.** The derivation prints 54 roster commands outside its total, and all 54 were run. 51 exit 0. `check-closing-target-claim`, `check-partof-closing-keyword` and `check-single-claim-paths` exit 2 NOT WIRED, because they read a pull request (`PR_NUMBER` / `PR_BODY`). I ran the body gate locally against this body before opening the PR, and the other two run in CI on this PR. - **The four symbol-anchor sweeps**, which no path derives for a source change. All four exit 0: - `check:adr-symbol-anchors`: 2167 anchors across 140 records resolve. - `check:scripts-symbol-anchors`: 3760 anchors across 282 scripts resolve. - `check:spec-docblock-symbol-anchors`: 4877 anchors across 1865 spec sources resolve. - `check:adr-anchors`: green. NOT MEASURED locally, owned by CI: - the Dogfood Regression Gate. The live showcase checks above cover its door for the setup app. - the Temporal Conformance live-database job. - the whole-workspace type-check lanes. - the full `pnpm lint`. ## Acceptance notes - **Same family, not topological (reported, not filed).** An env-wide `view` row declares `_lock: 'full'`. An org-scoped read (`getMetaItem` with `organizationId: 'org_a'`) serves that row and reports `lock: full`, `editable: false`. The `_lock` gate for an `org_a` save admits, because `getEffectiveLock`'s overlay limb looks up `organization_id = org_a` only. Measured on both kernels with the protocol over a double: the save went on to validation. This is the door and the read disagreeing on the org axis, and ADR-0010 §3.3 rejects overlay writes under `full`. The report names it for the seat. - **Pre-existing on a host-config kernel, untouched here.** - Deleting a packaged object with no overlay row is a no-op success, while the read says `deletable: false`. That is the package door objectstack-ai#21670 accepted, not the `_lock` gate, which ranks below it. - A stored row of a code-only type that declares `_lock` now answers `ITEM_LOCKED`, where an environment kernel answers `NOT_CREATABLE`. The host-config protocol has no `NOT_CREATABLE` door. No producer writes such a row. - **Two `lockSource` vocabularies.** The door's sentence names the limb (`source=artifact` or `source=overlay`), while the envelope carries the declared `MetadataLockSource` (`package` for the setup app). This is pre-existing. - **The objectstack-ai#21670 table.** Its host-config door is the repository gate alone, and its items declare no `_lock`, so it stays valid. The `_lock` limb on that kernel is covered by pin 1 here. --- _Generated by [Claude Code](https://claude.ai/code/session_017ErfyP2Rx7XWHJA27QjyUi)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
Fixes #21689
Clause-②: no (narrowing)
This carries out triage's ruling on #21689 (comment 5977077883, unlocked in 5977495602): one predicate. The metadata save door refuses any hook with no
body, with a named error and the prescription "give it abody". The handler-only refusal that #21658 landed (PR #21686,ced217ca30) is now one case of it.HookSchemais untouched.What changes
runtimeHookWithoutBodyRefusalinpackages/metadata-protocol/src/protocol.tskeeps its name, its one call site insaveMetaItemand its one envelope. Its predicate widens from "a non-emptyhandlerstring and nobodyobject" to "nobodyobject". It is the same judgement install-local'scollectHooksWithoutBodymakes on its own door (hookCarriesBodyinpackages/runtime/src/app-artifact-handlers.ts).VALIDATION_ERROR/ 400, unchanged. No code is added and the ledger is not edited.handlername and nobody, which the runtime then refuses at bind: a runtime-authored hook holds no functions, so that form can never run #21658. It runs in draft and in publish mode, after the type-schema parse (a malformedbodykeeps the schema's located 422), and before the authoring gate and every write.handlerthat names a function, the message is byte-identical to the one The metadata save door answers 200 to a hook with ahandlername and nobody, which the runtime then refuses at bind: a runtime-authored hook holds no functions, so that form can never run #21658 shipped. It names the hook and the function.handler: "Invalid hook: 'NAME' carries nobody, so it has nothing to run. Give it abody(sandboxed JS,{ language: 'js', source }, or an expression), which is stored with the hook. A hook saved through the metadata API ships with no code package, so itsbodyis the only code it can run."body, with or without ahandlerbeside it.The PM's mechanism hypotheses, measured (at
1db5322ba2, then rerun on the merged head15402d98f8)handlernames a function. The measured messages read right for both shapes (quoted above; the sweep's failure output below shows the neither text verbatim as the door produced it).metadata-protocolsuite went 7 failed / 3461 passed (4 files), and the fullobjectqlsuite went 6 failed / 7446 passed (3 files). The five named suites, plusmetadata-protocolprotocol.save-receipt-wordingandobjectqlmetadata-validation-sweep. A grep ofruntime,rest,plugins/*,services/*,cli,verify,qaandexamples/**for hook saves through this door (type: 'hook'items,/meta/hookpaths) found onlyruntime's two pin tests, which already carry bodies. See the fixture triage below.migrateStoredMetadataandduplicatePackagesurface a stored bare row as their recorded failure; stored rows keep their bytes.protocol.stored-residue-resave.test.ts).duplicatePackageover a package holding one bare hook row and one body hook row answered{ success: false, copiedCount: 1, failedCount: 1 }with this refusal infailed[0].error, and the source rows' bytes were unchanged.migrateStoredMetadata({ apply: true })over a bare row answered{ scanned: 1, canonical: 1, rewritten: 0, failed: 0 }with the bytes unchanged. Population of stored bare hooks reachable from this repository: zero.examples/**andpackages/qa/**seed nosys_metadatahook rows (zerotype: 'hook'items).handlerhook never passessaveMetaItem.1db5322ba2. Every production call site either saves a fixed type other thanhook(automation.tsandflow-credential-migration.tsfor flow,packages.tsfor app,permission-set-projection.tsfor permission) or forwards an author's or a stored row's type. The forwarding callers are the RESTPUT /meta/:type/:name(rest-server.ts), the dispatcher's metadata save (domains/meta.ts),migrateStoredMetadataandduplicatePackage.AppPlugin,loadArtifactBundle, the install-local door and the boot path make zerosaveMetaItemcalls. The composed pin's X and Z controls hold it end to end.os meta registerforwards the author's own file and emits no hook of its own. Theoscreate and scaffold templates authordefineStacksources, which reach the artifact door and never this one.packages/mcphas no hook tool. Studio is at the objectui pinab18797215, unchanged since #21658's census, which read its hook skeleton carrying abody. Not measured: the cloud AI build agent's metadata tools, which live outside this repository.Fixture triage: seven probe suites move to a body-carrying hook
Each probe item gains
body: { language: 'js', source: 'return;' }and nothing else. No probe is deleted, and no assertion is changed or loosened.metadata-protocolprotocol.code-only-types(2 probes)hook(allowRuntimeCreateonly) on either kernel; the #5264 matrix shows a hook save answers a repository receipt.success: trueand one row on both kernels, and the receipt fields.metadata-protocolprotocol.meta-types-mint-door-agreementPUT /meta/hookbehaves as/meta/typesadvertises (declared, creatable), read off one fact.metadata-protocolprotocol.unrecognised-meta-typeobjectqloverlay-precedence(3 probes:hook, pluralhooks, single-kernel bypass)allowRuntimeCreatetypes pass the overlay whitelist, and a single kernel bypasses the overlay gate.objectqlprotocol-meta(3 probes)NOT_OVERRIDABLE/ 403; a brand-new hook and an edit of a DB-only hook are accepted.NOT_OVERRIDABLEprobe was green before the move too, because the provenance gate runs first. It moved anyway, so that the refusal it measures can only be the provenance gate's. The registry-seeded items there are scenery for provenance, not saves through the door, and keep their bytes.metadata-protocolprotocol.save-receipt-wording(OVERLAYLESS_PROBES.hook)objectqlmetadata-validation-sweep(FIXTURES.hook)events.The enumeration pin, on the real door (ADR-0112: each refusal asserts
codeandstatus)Composed kernel,
packages/runtime/src/hook-handler-package-scope.pin.test.ts, throughPUT /api/v1/meta/hook/NAMEas the signed-in administrator:bodyhook saves.VALIDATION_ERROR, naming the hook and the function and prescribing abody; GET by name answers 404.VALIDATION_ERROR, naming the hook and prescribing abody; GET by name answers 404.skipsOf, a new reader of the engine logger'sskipping hookwarns).handlerhook through its own door is unchanged.functionsentry binds and runs. App Z's hook naming a function its--artifactruntime module exports binds and runs.At unit level, section 8 of
protocol.invalid-metadata-422-face-inventory.test.tsis new. It covers publish and draft with neither field, and an emptyhandler. Each case assertscode,status, the named hook, the prescription and an empty store. Section 7 (#21658) is unchanged and still green.Reverse verification (the fix committed first, at
0c32c32bb1)Mutation.
node scripts/ablation-replace.mjsrestored the old handler-only guard after the body test:typeof hook.handler !== 'string' || hook.handler === ''returnsundefined, behind a marker constantABLATED_21689_NEITHER. The anchor count went 1 to 0 and the blob went3059168d5703to237d2559c48b.@objectstack/metadata-protocolwas rebuilt, andnode scripts/ablation-dist-preflight.mjs @objectstack/metadata-protocol ABLATED_21689_NEITHERfound the marker indist/index.jsanddist/index.cjs. A shelltraprestore on EXIT, INT and TERM wrapped the whole run.The first attempt was a no-op, and it is disclosed here. Its replacement re-contained the anchor line, so
ablation-replacerefused it ("the anchor count moved 1 to 1"), ran nothing and proved the restore. The second attempt re-spelled the body test (typeof hook.body === 'object' && hook.body, the same truth table), so the anchor left the file.Prediction: pin 3 red, and pins 1, 2 and 4 green. Observed:
handler). 15 passed, including all of section 7 (handler-only refused in both modes, the body CONTROL, body beside handler, malformed body 422).{ status: 200 }withSaved hook 'scope_authored_bare' (env-wide, state=active).skipsOf('scope_authored_bare')held 3 binder skips, which also proves the new reader fires.Restore.
ablation-replacerestored the file. The blob equals HEAD (3059168d5703) andgit diff HEADis empty. The outer trap's hash compare agreed.git status --porcelainis empty.--absentpreflight found the marker in none of the 24 built files, and the tree was clean.Tests (at
15402d98f8, after mergingorigin/main8843505d91, which carries PR #21693)pnpm --filter @objectstack/metadata-protocol exec vitest run --maxWorkers=2: 210 files passed and 3 skipped; 3578 tests passed and 19 skipped.pnpm --filter @objectstack/objectql exec vitest run --maxWorkers=2 --project local: 372 files and 7455 tests passed.hook-handler-package-scope.pin.test.tsandstored-metadata-body-boundary.pin.test.ts: 14/14.tsc --noEmit. Its program includes all five edited test files (--listFiles, one hit each).tscpluscheck:test-typecheck, OK, with the debt ledgers held. Their test layers compile undertsconfig.test.json(include: src/**/*).pnpm turbo run build --filter='@objectstack/runtime^...' --concurrency=2, 29/29.packages/specmoved on main's side, sopnpm --filter @objectstack/spec check:generatedalso ran: all 15 generated artifacts are up to date.packages/runtime's suite is declared to CI.Gates (at
15402d98f8)Every family below ran first at
623b4a0b94and ran again in full on the merged head15402d98f8. The figures are the second run's.Derived.
node scripts/pm/dispatch-gates.mjs --commands(no paths) derives 66 families, the same list on both heads, and all 66 ran.check:dual-build-cjs-loads: 106 published require entry points across 66 packages load. On the first head it had exited 3, PREREQUISITE NOT MET, for want of a full build.--ranreconciliation: 66 accounted for, 66 run, 0 NOT-MEASURED (a derived zero), 0 UNRUN.Artifact-roster block (54 families, outside the derived total). All 54 ran.
check:error-status-conformance,check:error-code-casing,check:authz-resolver,check:route-ledger-census,check-changeset-fixedandcheck:engine-double-contract.check-closing-target-claim,check-partof-closing-keywordandcheck-single-claim-paths. They are rerun with this PR's context, and the results go in the os-dev report.Symbol-anchor sweeps, all exit 0:
check:adr-symbol-anchors: 2167 anchors across 140 records.check:scripts-symbol-anchors: 3760 anchors across 282 scripts.check:spec-docblock-symbol-anchors: 4867 anchors across 1861 spec sources.check:adr-anchors: OK.Lint. CI owns
pnpm lint. This PR records a proven narrowing instead:eslint.config.mjslintsfiles: ['**/*.{ts,tsx,mts,cts,js,jsx,mjs,cjs}'].eslint --no-inline-config --format jsonover the 10 changed TS files reports 10 files, 0 errors and 0 warnings.parserOptions.project), so this diff cannot move the verdict of any untouched file.Changeset
.changeset/21689-hook-no-body-save-door.md:minorfor@objectstack/metadata-protocol,Clause-②: no (narrowing), the BREAKING banner, and the ADR-0087 markernot-required (no-migration-prescription)with the census above.check-adr-0087-registration --base origin/mainaccepts it.Landing point
As the claim predicted:
packages/metadata-protocol/src/protocol.ts,runtimeHookWithoutBodyRefusal(saveMetaItem, typehook), plus the seven probe suites. No producer elsewhere needs a change. No governed surface is touched. PR #21693, which edits the read region and the import block ofprotocol.ts, landed on main before this PR opened. It is merged in here; the merge was clean, and this diff touches neither region.Acceptance notes
handlername and nobody, which the runtime then refuses at bind: a runtime-authored hook holds no functions, so that form can never run #21658's PR recorded this for thehandlerform, and it now covers the neither form too.publishMetaItem,rollbackMetaItemandrevertCommitcan make a draft or a history version stored before this change into an active bare row, which the runtime skips at re-sync as before. Carrier: none.os meta register hook --data FILEforwards the author's file through this door, so a bare hook file now gets this 400 and the CLI prints its message. It needs no change of its own.skipping hook with unresolved handlerfor a hook that has nohandler. No stored row of that shape can be minted through this door any more. Noted, not filed.Generated by Claude Code