Repository navigation
refactor(spec)!: rename the Studio helper defineForm to defineMetadataForm and its modules to *.metadata-form.ts - #37366
Conversation
…aForm and its modules to *.metadata-form.ts ADR-0159 question 1 (ruled A): the name defineForm and the *.form.ts suffix go to the new `form` metadata type. This commit is the rename and the suffix move alone (the card's PR A): 18 modules renamed, import specifiers swept by both spellings, the i18n surface constant, the gate self-test and fixtures, comments and path citations re-pointed, lint text re-worded, the generated spec artifacts regenerated, and the semantic ADR-0087 entry registered. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011y7As9cjn4Y9vAUQbVH4fq
…e-points Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011y7As9cjn4Y9vAUQbVH4fq
📓 Docs Drift CheckThis PR changes 10 package(s): 158 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 25 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails. What this run could not see
Coarse fallback — 192 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 97b70cca0f971b4e478f07ef9077069b189c1288 && git checkout 97b70cca0f971b4e478f07ef9077069b189c1288
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 1028438748dfbb6a76a981a25310fe39c481fb2c ebd9872fcdbfdece26f4e27969669bbd02f9c42a && git checkout -B drift-repro 1028438748dfbb6a76a981a25310fe39c481fb2c && git merge --no-ff ebd9872fcdbfdece26f4e27969669bbd02f9c42a
node scripts/docs-audit/affected-docs.mjs --json 1028438748dfbb6a76a981a25310fe39c481fb2c
|
…three SchemaForm tests the rename edits check:test-source-alias judges the test files a change edits: the three SchemaForm tests reach celAuthoring's dynamic imports of @objectstack/lint and @objectstack/formula, so each now loads them at module top. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011y7As9cjn4Y9vAUQbVH4fq
…ead a form over both types ADR-0159 card ②, everything past the rename (PR B of the card's cut): FormSchema derived from FormViewSchema by reference with defineForm and *.form.ts; the registry row, the stack's forms collection and the forms translation family; one projection of the three old view shapes; the effective form read resolved over both types; the form write's removal of the old-shape row; the address clash refusal (FORM_ADDRESS_TAKEN); the package-less list-at-a-form's-name refusal on save, publish and restore; the anonymous doors' two-type withdrawal layer with rule 7's closed links; the lint rules, the liveness ledger and the showcase form. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011y7As9cjn4Y9vAUQbVH4fq
…gation, cli i18n bucket, provenance row, checklist waiver, transcript counts Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011y7As9cjn4Y9vAUQbVH4fq
…les, showcase feedback form zh-CN, walk-parity fixture member; typed form-body refinement params Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011y7As9cjn4Y9vAUQbVH4fq
…ocol serving no form item, one registry heal for old-shape removals, the by-name form read keeps the generic answer unless resolved across types, census and enumeration pins Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011y7As9cjn4Y9vAUQbVH4fq
The owner-stamp fixture tables, the meta list/item census, the CLI schema-gate classification and the metadata-form catalog ratchets each gain the form type (ADR-0159 card ②, #37086). Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011y7As9cjn4Y9vAUQbVH4fq
…label Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011y7As9cjn4Y9vAUQbVH4fq
…object translateForm reads a form item's section headings at objects.<object>._sections.<name>, so translation-target-unknown must accept those keys. The showcase feedback form's zh-CN section heading tripped it in the dogfood build. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011y7As9cjn4Y9vAUQbVH4fq
… zh-CN, ja-JP and es-ES (objectstack-ai#37377) Fixes objectstack-ai#36836 Clause-②: no Metadata-protocol: none ## 维护者速读 - 用中文、日文、西班牙文做报表的人,在报表设置面板里看到的"数据来源 / 指标 / 分组 / 列分组"及六条说明,现在和英文说的是同一件事(之前还是旧的"数据集 / 度量 / 行 / 列"开发者说法)。 - 属于报表面板改用业务用语的收尾,替日文、西班牙文和中文的报表搭建者补齐译文。 - 出错只会是某条译文措辞不够好,不影响任何功能或数据,随时可以直接改回或再改。 - 无。 ## What changes Translation text only, in the three hand-written locale bundles of `@objectstack/platform-objects` (`zh-CN`, `ja-JP`, `es-ES` `*.metadata-forms.generated.ts`). No key added or dropped; `pnpm check:i18n` is in sync. **The six rows objectstack-ai#36447 reworded** (the six ledger-pinned hints PR objectstack-ai#36814 left marked "not re-judged"), re-translated from the current English in ja-JP and es-ES, and in zh-CN too (see Acceptance notes): | Leaf | zh-CN | ja-JP | es-ES | |:---|:---|:---|:---| | `report.sections.dataset_binding.description` | 报表的数字从哪里来、如何分组和排序,以及点击某一行时打开哪些记录 | レポートの数値をどこから取得し、どのようにグループ化して並べ替えるか、そして行をクリックしたときにどのレコードを開くか。 | De dónde provienen las cifras del informe, cómo se agrupan y ordenan, y qué registros se abren al hacer clic en una fila. | | `report.fields.dataset.helpText` | 报表从这里取数;每个人只能看到自己有权限的记录 | レポートはここから数値を読み取ります。各ユーザーには、アクセス権のあるレコードだけが表示されます。 | El informe obtiene sus cifras de aquí; cada persona solo ve los registros a los que tiene acceso. | | `report.fields.values.helpText` | 要展示的指标,例如合计、计数、平均值或比率(来自数据来源) | 表示する指標。合計、件数、平均、比率など(データソースから取得)。 | Las métricas que se mostrarán, como totales, recuentos, promedios o proporciones (de la fuente de datos). | | `report.fields.rows.helpText` | 按哪些字段分组(来自数据来源) | グループ化に使うフィールド(データソースから取得)。 | Los campos por los que agrupar (de la fuente de datos). | | `report.fields.drilldown.helpText` | 点击汇总后的行或单元格,打开其中的记录 | 集計された行またはセルをクリックして、その元になっているレコードを開きます。 | Haz clic en una fila o celda resumida para abrir los registros que hay detrás. | | `report.fields.runtimeFilter.helpText` | 每次显示报表时都会应用的筛选,叠加在数据来源自身的条件之上 | レポートを表示するたびに適用されるフィルター。データソース自体の条件に加えて適用されます。 | Un filtro que se aplica cada vez que se muestra el informe, además de las condiciones propias de la fuente de datos. | The `values` hint is translated against the current English from objectstack-ai#36879 ("…such as totals, counts, averages or ratios…") in all three locales (scope note item 1 and 2). `exportOptions.fileNamePrefix` was already done by objectstack-ai#36879 and is untouched. **The eight label leaves** (scope note item 3), each in zh-CN / ja-JP / es-ES, top level and the `blocks` twin moved together: | Leaves | was | now | |:---|:---|:---| | `dataset`, `blocks.dataset` | 数据集 · データセット · Conjunto de datos | 数据来源 · データソース · Fuente de datos | | `values`, `blocks.values` | 度量 · メジャー · Medidas | 指标 · 指標 · Métricas | | `rows`, `blocks.rows` | 行 · 行 · Filas | 分组 · グループ化 · Agrupar por | | `columns`, `blocks.columns` | 列 · 列 · Columnas | 列分组 · 列のグループ化 · Agrupar columnas por | zh-CN uses the console overlay's words; ja-JP and es-ES use the words this catalog already spends on the data source (データソース / Fuente de datos, e.g. `report.fields["dateRange.dimension"]`). **The heading** (scope note item 4): `report.sections.dataset_binding.label` 数据集绑定 / データセットのバインド / Vinculación del conjunto de datos becomes 数据来源绑定 / データソースの紐付け / Vinculación de la fuente de datos, so the heading names the source with the same word as the field under it. **Ledgers.** The three decision ledgers that pin these leaves are updated in place: `report-form-echo-decisions.test.ts` and `report-dataset-panel-echo-decisions.test.ts` record the re-judgement on each row (the "not re-judged" notes are resolved); the vocabulary twin test now asserts the business vocabulary (heading and field twins name the source once, the description no longer speaks of dimensions); the `AND` token test now asserts the business-wording hint carries no `AND` in any locale, while the dataset filter twin keeps it. `object-lifecycle-panel-echo-decisions.test.ts` copied its "rows" fragment (行 / filas) from `report.fields.rows.label`; that leaf left the record-row sense, so the eight copies now point at `sys_import_job.fields.total_rows.label` (総行数 / Filas totales, authored, no provenance row), and the renderings did not move. ## Tests <details><summary>platform-objects translations suite + typecheck — green at 1928c08</summary> ``` pnpm --filter @objectstack/platform-objects exec vitest run --maxWorkers=2 src/apps/translations Test Files 26 passed (26) Tests 610 passed (610) pnpm --filter @objectstack/platform-objects run typecheck (tsc --noEmit, scripts tsconfig, check:test-typecheck) os-verify-lock: VERDICT command-exit 0 ``` First run before the ledger fixes was red (2 files): a syntax slip in a ledger reason, and the lifecycle ledger's twin assertion `ja-JP twin report.fields.rows.label lost the shared fragment: expected 'グループ化' to contain '行'` — the expected consequence of moving the rows label, fixed by re-pointing the twin. </details> <details><summary>Local gates — at 1928c08</summary> ``` pnpm check:i18n EXIT=0 check-i18n-bundles: OK (10 package(s) — all bundles in sync, no undeclared authoring keys). pnpm check:i18n-stale-fill EXIT=0 OK (11 bundle set(s) — no new stale fills, 1 baselined). pnpm check:nul-bytes EXIT=0 pnpm check:doc-authoring EXIT=0 pnpm check:issue-citations EXIT=0 (self-test + scan: no issue citations added) pnpm check:cross-package-test-inputs EXIT=0 pnpm check:i18n-coverage EXIT=3 NOT MEASURED: showcase config needs service-print built; declared to CI node scripts/pm/overlap-check.mjs --branch=HEAD VERDICT clean (origin/main and objectstack-ai#37366 merge cleanly) ``` The remaining derived families are whole-tree gates unrelated to translation text; CI runs them. </details> ## Acceptance notes - **Card item "the six rows … the PR names them"**: named in the first table above. - **zh-CN went beyond the scope note's `values` hint.** The card's premise that zh-CN "follows the new meaning" holds for the console overlay, not for the platform zh-CN bundle, which still carried the semantic-layer wording on all six rows (要绑定的数据集…, 度量/维度). Five of the six zh-CN values are copied verbatim from the console overlay, which already carried the current English; the section description has no overlay twin and was translated fresh. Same file, same defect class, same gate family. - **Same-family leftovers, not in this card**: on this panel other ja-JP / es-ES leaves objectstack-ai#36447 reworded still read the old developer wording — `columns.helpText`, `order.helpText`, `blocks.helpText`, `chart.helpText`, `dateRange.helpText` and `exportOptions.helpText`, and the `joined_blocks` / `filter_and_chart` section descriptions (zh-CN shares several of them). They are reported to the seat, not fixed here. - The console's own zh overlay (`metadata-form-zh-cn.ts`, open PR objectstack-ai#37366) still reads `要统计的指标(来自数据来源)` for the `values` hint, the pre-objectstack-ai#36879 meaning; that file is outside this PR. - `compactToolbar` rows are untouched (sibling objectstack-ai#36874 follows this PR on the same bundles). ## Verification First read, by risk: 1. `packages/platform-objects/src/apps/translations/ja-JP.metadata-forms.generated.ts` and `es-ES.metadata-forms.generated.ts`, the `report` block: the 15 changed values per locale. 2. `packages/platform-objects/src/apps/translations/report-form-echo-decisions.test.ts`: the rewritten vocabulary twin test and the `AND` token test. 3. `packages/platform-objects/src/apps/translations/object-lifecycle-panel-echo-decisions.test.ts`: the re-pointed "rows" twin. Two-minute check: `pnpm --filter @objectstack/platform-objects exec vitest run src/apps/translations` — expect 26 files, 610 tests passed. In the browser: switch Studio to 日本語, open any report, and the Data Source section reads データソース / 指標 / グループ化 under the heading データソースの紐付け. --- _Generated by [Claude Code](https://claude.ai/code/session_01Utp6Ca6EBDpTBZk8v46Jjv)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
…es of each standard unit of measure (ADR-0158 U6) (objectstack-ai#37389) <!-- claude-projects-attribution: {"github_login":"os-bill"} --> _Requested by **Bill** · [project thread](https://claude.ai/code/project/chan_016iMXWSZDzqWRWvWzdNo8wg?thread=cmsg_016iMXWSZDzqWRWvWzdNo8wg8ZBQe4UHadd2fGHGeWRW9V)_ repo:objectstack#5 · os-bill · session_01Utp6CbdHk3orAeensH6EzS Fixes objectstack-ai#35498 Refs objectstack-ai#35339 Clause-②: yes (widening) Metadata-protocol: none ## 维护者速读 - 管理员在设置的「配置」下、「计量单位」下面多一个「标准单位设置」页,可以给千克、克、件等国际标准单位各设一个显示小数位(比如珠宝行把克设成 3 位,砂石场把千克设成 0 位);所有成员都能看到这些设置,别的组织看不到。 - 这是「计量单位」第一期里你选的「组织可改,新开一处设置」那一项;数量按单位显示的卡片会读它,本改动本身还不改变任何页面上数字的显示。 - 只有组织管理员能新增、修改或删除,删除即清除;每次改动都记审计;组织里还留着设置时不能删除该组织,要先删掉设置,和汇率一样;可以直接撤回,因为还没有地方读取它。 - 需要你做的:无。 ## What changes - **`@objectstack/platform-objects`**: new organization-owned object `sys_standard_unit_setting` (ADR-0158 U6; Open item 10 option A), registered in the first manifest beside `sys_unit`. - `code`: text, max 3. A format rule admits exactly the `STANDARD_UNITS` codes in exact uppercase (`STANDARD_UNIT_SETTING_CODE_PATTERN`). Unique per organization, immutable after create. - `decimal_places`: 0 to 12, scale 0, required. - Field history on both columns. No tenancy opt-out, so `organization_id` is injected. - Setup → Configuration → Standard Unit Settings, directly under Units of Measure, with all eleven nav labels translated. The translation bundles are regenerated; the zh-CN object strings are translated. - **`@objectstack/plugin-security`**: - `member_default` reads it (read only). - `organization_admin` gets an explicit line: create, edit and delete. Clearing a setting is deleting its row. - **`@objectstack/spec`**: `sys_standard_unit_setting` joins `PLATFORM_OBJECTS_BY_PACKAGE['platform-objects']`. - **`@objectstack/cli`**: - The organization-ownership inventory lists the object as attributed. - The Setup nav count pin goes from 36 to 37. - `scripts/platform-object-tenancy-census.json` is regenerated. **Precedent: `sys_unit.decimal_places`.** The setting follows the same concept as an org unit's own decimal places: range 0 to 12, field history, member read, organization-admin write. The settings-key route (ADR-0144 D4's `localization.currency`) was measured and not followed, for four reasons. It is one org-wide scalar. Members read it only through a server projection. Its audit keeps hashes, not values. A per-code map would need a new settings column kind. The area approved this on claim amendments 7178077326 and 7178144166. **Deviations from the first shape, all on the card (amendments 7178077326, 7178144166, 7179529249):** - **No reader in this PR (amendment 7178077326).** The display card objectstack-ai#35490 adds the reader with its first caller, and the ADR-0158 L4 clamp to the field's `scale` goes there. "A member can read them" is met by `member_default` read over the data API. - **Clear = delete, not set-to-null (amendment 7178144166).** An organization delete refuses `DELETE_RESTRICTED` while any organization-owned row remains. Only `sys_unit` is exempt, through the engine's own cascade. So a row with no delete would block the organization delete forever. This follows `sys_exchange_rate`'s posture: an admin deletes the setting, then the organization delete goes through. Pinned below. **Why `code` is text plus a format rule, not a select.** A select's option values are stored lowercase (`kgm`), while a unit code is stored in exact uppercase everywhere (U4). The rule's pattern is built from the `STANDARD_UNITS` keys, so a code the table gains is admitted with no second edit. First files to read, by risk: 1. `packages/plugins/plugin-security/src/objects/default-permission-sets.ts`: the two `sys_standard_unit_setting` lines. 2. `packages/platform-objects/src/system/sys-standard-unit-setting.object.ts`: the format rule and the immutable-code rule. 3. `packages/plugins/plugin-security/src/default-permission-sets.standard-unit-setting.integration.test.ts`: the tenancy posture it boots under. Two-minute check: `pnpm --filter @objectstack/plugin-security exec vitest run --maxWorkers=2 src/default-permission-sets.standard-unit-setting.integration.test.ts` prints 15 passed. It boots a real stack under the `isolated` tenancy posture. It shows each of these: - an admin and an owner set, change and clear a setting, each act landing in `sys_audit_log` with old and new values; - an admin changes and deletes a setting the owner created, and the owner one the admin created (the `organization_admin` line, no superuser bits); - a member reads, and is refused 403 `PERMISSION_DENIED` on every write; - another organization's setting is never read, changed or cleared; - a non-standard or lowercase code, an out-of-range value, a duplicate code and a changed code are each refused; - an organization delete refuses 409 `DELETE_RESTRICTED` naming this object, and succeeds once the setting is deleted. ## Tests **Rework round 1 (L1 7180149059, contract record 7180135740), head `98cbc47602`.** S1: the changeset sentence and the object's docblock now state the posture the isolation holds under (`isolated`; `single` raises no wall, `group` walls by membership, ADR-0105 D1), and N1 says the display card objectstack-ai#35490 *will* read the value. S2: new cases where an admin and an owner each change and delete a setting the other created, plus the effective-permission map (delete kept, no `modifyAllRecords`). Affected tests re-run: the real-stack suite 15 passed (15), the declaration suite 14 passed (14). Ablation of the `organization_admin` line to `allowEdit: false, allowDelete: false` turned 8 of 15 red, the new cross-creator cases among them; restored, with the blob equal to HEAD and `git diff HEAD` empty. All readings below are on head `03e453e3`, and the tree is byte-identical to the commit. <details><summary>Package suites and typecheck (under the verify lock)</summary> - `@objectstack/plugin-security`, `src/default-permission-sets.standard-unit-setting.integration.test.ts`: Test Files 1 passed (1), Tests 12 passed (12). - `@objectstack/platform-objects`, full suite: Test Files 127 passed (127), Tests 2176 passed (2176). This includes the new `sys-standard-unit-setting.object.test.ts`. - `@objectstack/cli` unit layer, `src/utils/organization-ownership-inventory.test.ts` and `test/connect-agent-both-halves-wire.pin.test.ts`: Test Files 2 passed (2), Tests 28 passed (28). The CLI integration layer is left to CI. - `@objectstack/spec`, `src/system/constants/platform-object-names.test.ts`: Test Files 1 passed (1), Tests 14 passed (14). - Typecheck of `platform-objects`, `plugin-security`, `cli` and `spec`: run in one `set -e` batch that reached its last part, so each exited 0. `platform-objects` reports `check:test-typecheck: OK`. - The full `plugin-security` suite and `test:repo` are left to CI. </details> <details><summary>Ablation: the member read grant</summary> - `node scripts/ablation-replace.mjs` changed `member_default`'s `sys_standard_unit_setting` line to `allowRead: false`. Evidence: anchor x1 → x0, blob `d4a112e3` → `87691407`. - The suite went 2 failed | 10 passed. The member read test and the cross-organization read test both failed with `PermissionDeniedError`. - Restored: the blob equals HEAD (`d4a112e3`) and `git diff HEAD` is empty. </details> ## Acceptance notes - **The cross-organization pins need the `isolated` posture.** Under the default `single` posture no tenant wall stands, so another organization's row is visible. That is ADR-0105 D1's design, and every organization-owned object behaves the same way. The suite registers `tenancy: { posture: 'isolated' }`, as a deployment with organizations runs. The first run without it showed the other organization's row, which is how this was found. The `sys_unit` suite pins no cross-organization read. - **External members get no read**, the same as `sys_unit`. The display card objectstack-ai#35490 already owes what an external member sees (comment 7030066814). - **No ADR text in this diff.** The ADR-0158 amendment (U3, U6 and L4 notes, and the Open item 10 answer) is drafted in the card report; the area lands it as row 7179515770 on the weekly ADR revisions card objectstack-ai#37245 after this PR merges. - **Locale fill.** zh-CN carries translated object strings. The other nine locales carry the generator's English fill; nav labels are translated in all eleven. ## Verification <details><summary>Derived gate families (106 families, 212 commands) and the --ran reconciliation</summary> - `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack` derived 212 commands from the tree at `03e453e3`. Each was run, with its exit code captured before any pipe. - 211 exited 0. Five of those first exited 3 because a build prerequisite was missing: `check-plugin-teardown-shape --self-test` needed an unshallowed clone, and `check:skill-examples`, `check:dual-build-cjs-loads`, `check:i18n-coverage` and `check:published-readme-exports` needed a full build. All five exited 0 after `git fetch --unshallow` and a full turbo build (122 of 122 tasks). - `pnpm check:platform-checklist` exited 1 on one problem: `areas/automation.json` cites `FlowItemMoreMenu.tsx#FlowItemMoreMenu`, a symbol the `ui/` file no longer declares. That is the base tree's own state: this diff touches neither `ui/` nor `docs/qa/`, and the cited file is the same on `origin/main`. - `--ran` printed: "106 derived famil(ies) accounted for — 106 run, 0 NOT-MEASURED (a DERIVED zero — all 106 recorded an exit code and none of them is 3)". </details> <details><summary>Overlap check</summary> - `node scripts/pm/overlap-check.mjs --branch=HEAD` against origin/main `02520ab480` printed "VERDICT clean exit 0". Two open PRs share a file, objectstack-ai#37371 (`default-permission-sets.ts`) and objectstack-ai#37366 (`platform-objects/src/plugin.ts`); both merge cleanly with this branch. </details> <details><summary>Not measured locally</summary> - The CLI `integration` layer, `test:repo`, the full `plugin-security` suite and the repo-wide lint are left to CI. - Dogfood: n/a. The title has no `!`, and Clause-② is a widening. </details> --- 🤖 Generated with [Claude Code](https://claude.com/claude-code) _Generated by [Claude Code](https://claude.ai/code/session_01Utp6CXM7nqtiQ3M9JqGAqL)_ <!-- signed: repo:objectstack#5 · os-bill · session_01Utp6CbdHk3orAeensH6EzS --> --------- Co-authored-by: Claude <noreply@anthropic.com>
… verifier that checks a quote as the asking user (ADR-0160 D9) (objectstack-ai#37396) Fixes objectstack-ai#37364 Clause-②: yes Metadata-protocol: added Skills-docs: follow-up objectstack-ai#37177 ## 维护者速读 - 用户能看到什么变化:用户无感。本次只交付"引用"的格式定义和核对器;AI 回答里的引用还没有产生方,也没有界面展示。 - 为什么做:记录范围 AI 问询专题的第 10 行前半(引用格式与核对器),按维护者已定的三条裁决实现;界面展示和云端产生引用两张后续卡依赖它。 - 出错会怎样:最坏是核对器把一条真实的引用判为"未核对通过"而丢掉,回答少一条引用;它以提问人本人的权限读记录,不会让提问人看到无权看的内容;撤回此 PR 即可,没有数据需要迁移。 - 要你做什么:无。 ## What changes Governing text: ADR-0160 D9 as amended by objectstack-ai#37370 (third amendment), ruling 7177410380 on objectstack-ai#37144 (Q1 A, Q2 A, Q3 A), ADR point 23. **Spec (`@objectstack/spec/ai`)** - `record-citation.zod.ts` (new): `RecordCitationSchema` = `{ object, id, context?, anchor?, quote }`, closed with `strictObject` (unknown key refused, near-miss aliases such as `objectName`/`recordId`/`pack`/`section`/`text`), every string `min(1)`. `RecordCitationsSchema` = an array of at most `RECORD_CITATIONS_MAX` (20). `RECORD_CITATIONS_PART_TYPE = 'data-record-citations'`: the UI-message data part that carries the verified list (the precedent is `BUILD_PROGRESS_FRAME_TYPE`). - `record-body-anchor.ts` (new): `headingsOf` and `slugOf` moved here unchanged from `service-record-context/src/body-outline.ts`, together with the private readers they need. This way the server and the console derive the same anchor. `slugOf` stays module-private, as before. The tag reader `headingsOf` already used is exported as `stripBodyTags`, because the verifier matches an html body with the same notion of a tag. - Generated: `authorable-surface/ai.json` (5 `RecordCitation` rows), `json-schema.manifest`, `api-surface`, `export-origins`, `declaration-map`, `content/docs/references/ai/*`, and the strictness-ledger count (`ai/` 113 to 114), all written by `check:generated --fix`. **Service (`@objectstack/service-record-context`)** - `body-outline.ts` re-imports `headingsOf` and `BodyHeading` from spec and re-exports them. `body-outline.test.ts` passes untouched. - `verify-citations.ts` (new), `verifyRecordCitations(citations, door)`, exported from `src/index.ts`. It never persists or renders. **The matching rule, which ADR-0160 D9 leaves to row 10 and which the card's What 3 settles.** A citation survives only when its trimmed `quote` is a substring of one of these data-member strings of `get_record_context`'s answer for its `(object, id, context, anchor)`, read through the door bound to the asking user: - a field entry's `value` when it is a string, and its `display`, at the root and in every related-list cell (Q3: a related-row quote is cited on the root record); - `body.text` (the whole body, or the section `anchor` named). An `html`/`richtext` body (judged by the type the caller is served) is also matched with its tags removed. Whitespace runs collapse to one space on both sides. Case and every other character must agree. These are never matched: notes, the framing sentence, any label, the pack/record header (`pack.*`, `record.*`, a row's `displayName`), outline headings, and a value that is not a string (a number, boolean, list or object; its `display` is matched where present). A quote that is empty once trimmed verifies nothing. **What the verifier does with the list.** It makes one `executeGetRecordContext` call per distinct tuple. Any refused call drops its citations (point 23): a `context` no pack has, several packs and no `context` (Q2), an anchor that does not resolve, a record the caller cannot read or that does not exist, an object not served, guarded or unexposed. No retry without the offending argument. An entry that does not parse is dropped, and only the first 20 entries are read. The result is the verified subset in input order, with no reason attached, so a hidden record and a missing one look alike. <details><summary>Read first (by risk)</summary> 1. `packages/services/service-record-context/src/verify-citations.ts`: `haystackOf` holds the matching rule above. The risky part is which strings it collects. 2. `packages/spec/src/ai/record-citation.zod.ts`: the public shape, the aliases and the cap of 20. 3. `packages/services/service-record-context/src/body-outline.ts`: the move. Byte-identical logic now lives in `packages/spec/src/ai/record-body-anchor.ts` (only `stripTags` was renamed to the exported `stripBodyTags`). </details> ## Tests - `packages/spec/src/ai/record-citation.test.ts` (6): the shape refuses an unknown key (`unrecognized_keys`), an empty `quote` (`too_small`), a missing `quote` and `null` (`invalid_type`), an empty `context`/`anchor`. It admits `context` and `anchor`. The list is capped at 20 (`too_big`). The part type is pinned. - `packages/services/service-record-context/src/__tests__/verify-citations.test.ts` (16), one per acceptance bullet plus the rule. Each "dropped" case has a control leg: - section by anchor verified, stale anchor refused, anchor scopes the match; - related-list cell verified on the root, while another policy's row is not; - note, framing and labels refused (the control shows the answer carries each); - withheld and hidden field refused (the control verifies the same quote unhidden); - outline body without anchor refused, the same quote with its anchor verified; - two packs without `context` refused, one pack verified, named packs verified, unknown pack refused; - no read access (unreadable row, missing id, unserved, guarded, unexposed object) all answer `[]`; - one call per distinct tuple (`listCalls` = 2 for 5 citations), unparsable entries dropped, cap of 20, html/richtext tag-stripped and markdown not, whitespace collapse, non-string value not matched. <details><summary>Readings (head 36ec0cf)</summary> - `pnpm --filter @objectstack/service-record-context test`: Test Files 3 passed (3), Tests 115 passed (115). `typecheck`: exit 0. - `pnpm --filter @objectstack/spec test`: first run on c46e26d had 1 failure, `alias-integrity.test.ts` (aliases `recordId` and `record_id` collapse onto one probe). Fixed in 36ec0cf by dropping `record_id`. Re-run of that file plus `record-citation.test.ts`: 26/26. The final full-suite reading is in the report. - `pnpm --filter @objectstack/spec typecheck`: exit 0. - Ablation, one behaviour (the data-member restriction): `scripts/ablation-replace.mjs` made `haystackOf` also collect `answer.framing`, the note texts and `pack.label`. Result: anchor 1 to 0, blob c35fc72 to dcec1804, and `refuses a quote that appears only in a note, the framing, or a label` went red (1 failed / 15 passed). Restored: blob equals HEAD, `git diff HEAD` empty. A first attempt was a no-op that the tool refused before running: its replacement contained the anchor. The test runs `src` directly, so no dist rebuild was needed for the mutated file. </details> ## Acceptance notes - **The cap of 20** is the card's "an array with a cap" turned into a number. It bounds both how many calls a model's list can trigger and the persisted list. Easy to change before 10b/10c read it. - **Tag-stripping removes a tag with nothing in its place**, as `headingsOf` reads heading text. So a quote that spans two paragraph elements, written with a space where the two paragraphs meet, is not verified. HTML entities in the body are not decoded either: an ampersand entity has to be quoted as the entity. Both follow the card's rule as written. They only make verification stricter, never looser. - **Overlap**: objectstack-ai#37366 also writes the generated `packages/spec/export-origins/ai.json`. Whichever PR lands second regenerates it. - Out of scope, as the card says: an MCP verify tool, rendering (10b), producing and persisting citations (cloud 10c). ## Verification Two minutes: `pnpm --filter @objectstack/service-record-context exec vitest run --maxWorkers=2 src/__tests__/verify-citations.test.ts`. Expect 16 passed. The `context (Q2)` block shows a two-pack object dropping a citation that has no `context`. --- _Generated by [Claude Code](https://claude.ai/code/session_01Utp6CbeF2saT6wUBV4E9uc)_ <!-- signed: repo:objectstack#5 · os-bill · session_01Utp6CbeF2saT6wUBV4E9uc --> --------- Co-authored-by: Claude <noreply@anthropic.com>
… regions, parse prerelease versions in the MCP save test, key the objectui pin claim on the spec major (objectstack-ai#37557) Fixes objectstack-ai#37549 Clause-②: no Metadata-protocol: none ## 维护者速读 - 用户无感:发版流程里,版本号升到 19 之后,有三处会红,这里一起修掉:迁移登记表的生成不会再拒收第 19 版的下线条目;MCP 保存草稿的一条测试不再把预发布版本号(19.0.0-next.0)读坏;界面仓的版本说法检查不再写死 18。"版本发布"那个 PR 的核心测试和界面测试可以变绿。 - 为什么做:给发第一个 19 预发布版(next 渠道)清掉阻断。版本 PR 的必过检查一直是红的,现在没法合并。 - 出错会怎样:只给模板加了两个空区段,另外改了三份测试;不改任何已发布行为。出问题直接撤回这个 PR 即可。 - 要你做什么:无。 ## What changes - `packages/spec/src/migrations/registry.ts.template`: opens an empty `retired-key:19` region in `RETIRED_KEYS_BY_MAJOR` and an empty `retired-def:19` region in `RETIRED_DEFS_BY_MAJOR`, each placed and shaped like its major-18 sibling. `semantic:19` and `step19` already existed, so the migration-step side needed nothing. - `retired-def:19` goes beyond the card's wording, as an in-place fix of the same defect class. `build-schemas.ts` prescribes new retired-def entry files under the same `CURRENT_MAJOR` (`renderNewEntryFiles`, used for both kinds). So the first whole-def removal on the 19 tree would have hit the same generator refusal. Same file, same gate family, same mechanical fix. - `scripts/build-migration-registry.ts` needs no change. Its lines ~422–441 are `--self-test` fixtures, not a region list: the generator discovers regions from the template's markers. - Pin (`packages/spec/scripts/build-migration-registry-entry.test.ts`, new `describe`): every kind in `KINDS` has an open and close marker in the template for each of two majors, the spec package's major (what `build-schemas.ts` registers new entries under) and `PROTOCOL_MAJOR`. On `main` today these are 18 and 19, so the pin reds on `main` before the fix and names the missing region and the major. - Why `PROTOCOL_MAJOR` and not "spec major + 1": the protocol major moves first, on `main` (it reads 19 while the package is still 18.6.0). It is the leading signal for the next major. - "spec major + 1" would also red the Version PR tree itself (19 + 1 = 20), unless a major-20 region were opened now. - Item 2 (seat-amended scope, card objectstack-ai#37549): `packages/runtime/src/domains/mcp-authoring.test.ts`. The `[objectstack-ai#34774]` describe parsed `SERVER` with `split('.')`, so on the Version PR tree (`19.0.0-next.0`) the patch field was `0-next` and the built version was `19.0.NaN`, which the door refuses as not SemVer. It now parses with `SEMVER_2_0_0_VERSION_PATTERN` from `@objectstack/spec/kernel`, the grammar the door itself judges with, and drops the prerelease from the versions it builds. A new case declares the server's own version verbatim and `${major}.${minor}.0-next.0`, and asserts both save byte-identically to no declaration. Test-only; `@objectstack/runtime` ships `dist` alone, so no runtime changeset is owed. - Item 3 (seat-amended scope): `ui/scripts/__tests__/doc-version-claims.test.ts`. The `skills/objectui/SKILL.md` KNOWN_CLAIMS row was the literal `@objectstack/spec 18.x`. It is now keyed on `SPEC_MAJOR`, read from `packages/spec/package.json` under `workspaceRoot()`. The literal in the skill can't go, because the root `check-skill-compatibility-version.mjs` requires the pin and rewrites it with the version step. So `skills/**` is not touched, and the PR stays off Tier H. - Changeset `.changeset/37549-retired-key-19-region.md` (patch; the template renders into the shipped `registry.ts`). ## Tests <details><summary>Pin reds on the pre-fix template (origin/main 1af67b2 template restored, then put back)</summary> ``` × opens and closes `retired-key:19` × opens and closes `retired-def:19` AssertionError: src/migrations/registry.ts.template has no `os-generated retired-key:19` region, but major 19 is current (spec package 18.6.0, PROTOCOL_VERSION major 19); an entry registered there is refused by gen:migration-registry. ... Tests 2 failed | 8 passed (10) os-verify-lock: VERDICT command-exit 1 ``` </details> <details><summary>Version tree: spec temporarily at 19.0.0-next.0 (not committed)</summary> `pnpm gen:migration-registry && pnpm exec vitest run --maxWorkers=2 scripts/build-migration-registry-entry.test.ts scripts/build-schemas-check-mode.retired-keys.test.ts` (both projects), with `packages/spec/package.json` version set to `19.0.0-next.0`. The run includes "the printed route registers: write exactly the files check (b) names, run the generator, and (b) is silent", the case that fails on objectstack-ai#35129. ``` Test Files 2 passed (2) Tests 20 passed (20) os-verify-lock: VERDICT command-exit 0 ``` The version was restored to `18.6.0` afterwards; `git status` was clean apart from the intended diff. </details> <details><summary>18.6.0 tree: same two files</summary> ``` Test Files 2 passed (2) Tests 23 passed (23) os-verify-lock: VERDICT command-exit 0 ``` </details> <details><summary>Items 2 and 3 on the Version tree (spec at 19.0.0-next.0 and the objectui skill pin at 19.x, both temporary, restored after)</summary> ``` runtime mcp-authoring.test.ts Tests 57 passed (57) ui doc-version-claims.test.ts Tests 29 passed (29) ``` Ablation on the same tree with the origin/main 1af67b2 versions of the two tests: runtime `1 failed | 55 passed` (the `SemVer form (e.g. 18.6.0)` case), ui 2 failed (`skills/objectui/SKILL.md :: @objectstack/spec 18.x`), matching objectstack-ai#35129's CI failures. On the 18.6.0 tree: runtime 57/57, ui 29/29. `ui` `scripts/` suite at the final head: `172 passed | 2 skipped` files, `5130 passed` tests. </details> <details><summary>Spec package, local project, at 2fd0411: `pnpm --filter @objectstack/spec test` and `pnpm typecheck`</summary> ``` Test Files 899 passed (899) Tests 28505 passed | 1 todo (28506) os-verify-lock: VERDICT command-exit 0 typecheck (tsc + check:scripts-typecheck + check:test-typecheck): VERDICT command-exit 0 ``` `test:repo` (the vitest `repo` project) belongs to CI's Test Core. Only its one touched-path file, `build-schemas-check-mode.retired-keys.test.ts`, was run locally (above). </details> ## Acceptance notes - In-flight spec PRs objectstack-ai#37366, objectstack-ai#37371 and objectstack-ai#37422: `node scripts/pm/overlap-check.mjs --pr=37366,37371,37422` gives `VERDICT clean exit 0`. Their migration changes are major-18 semantic entry files only, and none touches the template. - L2: the template is the generator's skeleton for a gitignored generated file. The two regions are empty, so no exported value or key changes shape: `RETIRED_KEYS_BY_MAJOR[19]` / `RETIRED_DEFS_BY_MAJOR[19]` become empty arrays. Body amended by the seat (repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA) to cover the three items the card's scope grew to; the dev report on objectstack-ai#37549 (7194227076) carries the full evidence. ## Verification Two-minute check: `pnpm --filter @objectstack/spec exec vitest run --project local --maxWorkers=2 scripts/build-migration-registry-entry.test.ts`, expected to show `Tests 10 passed (10)`. Then set the spec version to `19.0.0-next.0` and run `scripts/build-schemas-check-mode.retired-keys.test.ts`, which should also be green. Read first: (1) the two new template regions; (2) the pin's choice of majors (spec package major and `PROTOCOL_MAJOR`). Local gate subset at 2fd0411: derived by `node scripts/pm/dispatch-gates.mjs --commands`. Verdicts are in the dev report on the card. `check:doc-formula-expressions` is NOT MEASURED locally (PREREQUISITE NOT MET: `@objectstack/formula` and `@objectstack/lint` are not built in this worktree); CI runs it. The full farm belongs to CI. --- _Generated by [Claude Code](https://claude.ai/code/session_01L6bhgV6i8jfWwSXjpWJrjA)_ <!-- signed: repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA --> --------- Co-authored-by: Claude <noreply@anthropic.com>
…adataForms options slot) (objectstack-ai#37569) <!-- claude-projects-attribution: {"github_login":"os-sales"} --> _Requested by **Sales** · [project thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4UuPE7uyDAJyqjwwMzomWv5ff)_ Fixes objectstack-ai#36950 Clause-②: yes (widening) Metadata-protocol: added Skills-docs: none — `skills/objectstack-i18n/SKILL.md` names the `metadataForms` group only, never its leaf keys; the group is platform-owned, so no app author writes the new key ## 维护者速读 - 用户能看到什么变化:非英文的搭建者在 Studio 里打开对象、字段、报表、仪表盘、钩子、动作、页面、智能体、技能的配置表单时,下拉框里的选项名(例如共享模型「私有 — 仅所有者」、字段类型、删除行为、默认时间段)改为显示当前语言;以前这些选项在所有语言下都是英文,周围的字段名却已经翻译。 - 为什么做:翻译包里没有放选项名的位置,服务端也不翻译它们。 - 出错会怎样:只多翻译一层显示文字,选项的值不变,保存下来的数据不变;某个选项没有译文时仍显示原来的英文。 - 要你做什么:这个 PR 改动约 3,790 行(主要是 10 种语言的译文),超过 3,000 行,按规则需要授权审批人批准后由座位落地。 ## What changes **The reading the card asked for** (at `021524cd`, `METADATA_FORM_REGISTRY` walked with the extractor's path rule): of the 18 registered Studio forms, 9 carry a select row with `options` — `object`, `field`, `hook`, `report`, `dashboard`, `action`, `page`, `agent`, `skill` — 38 rows, 187 options (185 distinct `type.path.value` keys: `object`'s `fields.deleteBehavior` is listed twice, with the same names). Every one is seen by a builder: the console's `SchemaForm` renders `fieldSpec.options` ahead of the schema enum (`ui/packages/app-shell/src/views/metadata-admin/SchemaForm.tsx`, the enum/select branch), and the server translated only `label`, `helpText` and `placeholder` of a form field. - **Spec, translation slot** (`packages/spec/src/system/translation.zod.ts`). A `metadataForms.<type>.fields.<path>` entry accepts `options`: a record from option `value` to its translated name, the shape `objects.<object>.fields.<field>.options` already has. `choices` and `values` are refused there, as on the object-field face, and the refusal names `options` as the key to write (the `aliases` row of the strict object is the rename hint of that unknown-key refusal, not an accepted spelling). - **Spec, resolver** (`packages/spec/src/system/i18n-resolver.ts`). `translateFormField` overlays each `options[]` entry's `label` with the translation keyed by its `value`, along the locale chain; an option with no translation, or with a non-string value, is passed through unchanged. This is the walker `resolveMetadataFormLabels` uses, which `/api/v1/meta/types` localizes served forms with. - **Lint, extractor** (`packages/lint/src/i18n-walk.ts`). `walkFormField` emits `metadataForms.<type>.fields.<path>.options.<value>` for every option of a row, seeded with its English label, so `os i18n extract` and `pnpm check:i18n` offer exactly the keys the resolver reads. - **Platform-objects, shipped locales.** `node scripts/check-i18n-bundles.mjs --write` added the 185 keys to all eleven `*.metadata-forms.generated.ts` packs; the ten translated packs then got hand-written names (ar, de, es-ES, fr, ja-JP, ko, pt-BR, ru, zh-CN, zh-Hant) and a second `--write` dropped every source-hash row they had seeded. The 17 Default Period choices take the wording of the console's own period chip (`ui/packages/i18n/src/locales/*`, `dashboard.filters.range.*` and `dashboard.filters.custom`), so the period an author picks reads as the period a viewer sees. Loanwords that read the same as English (`URL`, `HTML`, `JSON`, `Markdown`, and per locale words such as de `Text`, fr `Date`) are spelled so they are not byte-echoes of the source, which the catalog's zero-echo pins require (`object-lifecycle-panel-echo-decisions.test.ts`, `report-form-echo-decisions.test.ts`): for example zh-CN `网址(URL)`, de `Textfeld`, fr `Date (sans heure)`. - `content/docs/references/system/translation.mdx` regenerated (`gen:docs`). Small calls made here (no card): the rename hints for `choices` / `values` mirror the object-field face; a non-string option value is passed through untouched rather than stringified, since every option a registered form lists has a string value (the reading found none other). ## Why A non-English builder saw a translated field label with English choices under it on every server-rendered Studio form. The bundle had no slot for the names, so no locale could fix it. ## Verification - `packages/spec/src/system/i18n-resolver.test.ts`, new top-level describe "select option names": a choice is renamed by its value and keeps its other keys; a value with no translation keeps its English label; a nested repeater row is reached by its dot path; the input form is not mutated. - `packages/platform-objects/src/metadata-translations/form-option-labels.test.ts` (new): through the SERVED bundle and the real registry, the object form's sharing model reads `私有 — 仅所有者` in zh-CN; the reading floor (≥30 option rows over ≥8 forms) holds; for each of the ten translated locales every choice of every form select has a non-empty name that differs from its English label. - Local runs on this branch: `packages/spec` full suite green (vitest, 618 s); `packages/lint` 236 files / 9,680 tests green; `packages/platform-objects` translations + metadata-translations 29 files green; `packages/cli` `test/i18n-extract.test.ts` green; `node scripts/check-i18n-bundles.mjs` exit 0; `pnpm check:i18n-coverage` could not measure here (exit 3: the example apps are not built in this worktree), so CI carries that one; `pnpm --filter @objectstack/spec check:generated` exit 0 after `gen:docs`. - `node scripts/pm/overlap-check.mjs` exit 0 against `origin/main` and the open PRs sharing these files (objectstack-ai#37422, objectstack-ai#37366). Contract review (L2) is owed before landing: the diff changes `packages/spec/src/**` and declares `Clause-②: yes (widening)`. Changed lines exceed 3,000, so landing needs an authorized approval. ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic. - [x] 2. Every name I added uses the casing for its kind. - [x] 3. No formatter ran; `pnpm lint` passes. - [x] 4. One issue, one branch off an up-to-date `main`, one pull request. - [x] 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset. - [x] 6. `packages/spec` touched: its generated artifacts are regenerated and committed. - [x] 7. No hand edits to `content/docs/references/`, `packages/*/CHANGELOG.md` or `content/docs/releases/`. - [x] 8. Title, body and comments are in English. - [x] The *Before Submitting* list in CONTRIBUTING.md is done. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01L6bhgUpnvPnJ1hR74pUrVj --- _Generated by [Claude Code](https://claude.ai/code/session_01L6bhgUpnvPnJ1hR74pUrVj)_ <!-- signed: repo:objectstack#2 · os-sales · session_01L6bhgUpnvPnJ1hR74pUrVj --> --------- Co-authored-by: Claude <noreply@anthropic.com>
…e a select's options in Chinese under zh-CN (objectstack-ai#37698) <!-- claude-projects-attribution: {"github_login":"os-sales"} --> _Requested by **Sales** · [project thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4UuPE7uyDAJyqjwwMzomWv5ff)_ Fixes objectstack-ai#37607 Clause-②: no Metadata-protocol: none Skills-docs: none (no page under `skills/**` names the console's curated inspector overlay) ## 维护者速读 - 用户能看到什么变化:中文界面下,Studio 里页面检查器的「类型」「记录操作」下拉,和报表、仪表盘检查器的「默认时间段」下拉,选项现在显示中文(例如「记录页」「抽屉(右侧预览)」「本季度」),不再是英文选项配中文标签。用词和平台中文翻译包、服务器下发的表单完全一致,也和报表/仪表盘页面上时间段筛选按钮的用词一致。英文界面不变。 - 为什么做:objectstack-ai#37569 给平台翻译包加了选项名的位置,但这几个检查器读的是控制台自己的翻译表,没读到。 - 出错会怎样:只影响下拉选项的显示文字,存进去的值不变,不影响数据。 - 要你做什么:无。 ## What changes - **`ui/packages/app-shell/src/views/metadata-admin/metadata-form-zh-cn.ts`**: the `page` rows `type` and `interfaceConfig.recordAction` and the `report` row `dateRange.defaultRange` gain `options: { <value>: … }`, the slot `resolveMetadataFormLabels` reads since objectstack-ai#37569. Each map is the platform pack's map (`packages/platform-objects/src/apps/translations/zh-CN.metadata-forms.generated.ts`), copied as is. The header now lists option names among the strings the table carries. - **`metadata-form-i18n.ts`**: the `dashboard` row `dateRange.defaultRange` gains the same map. - **`default-period-labels.ts` retired**, with its calls in `ReportDefaultInspector.tsx` and `DashboardDefaultInspector.tsx` (and their now-unused `useObjectTranslation`). It renamed the Default Period options from the console's `dashboard.filters.range.*` rows for zh only; the overlay names them now, and the platform words equal those rows (pinned below). - **New pin `metadata-form-option-names.test.ts`**: - each option map in `ZH_CN_SPEC_FORMS` equals the platform pack's map, byte for byte (`JSON.stringify`), and the table names exactly the three expected rows; - the platform pack names options on no other row of the `page` / `report` / `dashboard` / `view` forms, so a new one is copied rather than missed; - for each of the four selects, every option `getPageForm` / `getReportForm` / `getDashboardForm` renders under `zh-CN` reads the pack's name (this is what pins the dashboard map, which lives in `metadata-form-i18n.ts`); - one named zh option per form (记录页, 抽屉(右侧预览), 本季度, 近 30 天), and an `en-US` control keeping the spec's English. The pack is read from the checkout's source with a run-time `import()` (a data-only module whose one import is type-only). - **`ReportDefaultInspector.defaultPeriodLabels-36835.test.tsx`**: no longer imports the retired helper. A new case pins the zh names `getReportForm('zh-CN')` gives to the zh pack's `dashboard.filters.range.*` / `dashboard.filters.custom` rows the period chip reads, beside the existing en case; the rendered zh case is unchanged and passes through the new route. - **Changeset**: `@object-ui/app-shell` patch. Small calls made here (no card): - The card prefers reading the names from a served or bundled form's slot. The curated inspectors render the console's own copy of the spec form, and this table's documented posture is data-only with no runtime import (it sits on the Pending changes sheet's eager graph), so the route is the card's second one: copy, plus a byte-equality pin against the pack. - `default-period-labels.ts` is retired in full rather than reduced: the slot now covers everything it did (it was zh-only), and the period-chip parity it guarded is kept by the objectstack-ai#36835 test. ## Why Out-of-diff note 1 of the Contract review record 7195508409 on PR objectstack-ai#37569: under zh-CN the curated page, report and dashboard inspectors showed English select options beside Chinese labels, and objectstack-ai#36950's slot did not reach them. ## Verification Head `8df05bb67`: - `pnpm --dir ui exec vitest run` on `metadata-form-option-names.test.ts`, `metadata-form-i18n.test.ts`, `page-schema.test.ts`, `report-schema.test.ts`, `dashboard-schema.test.ts`, `ReportDefaultInspector.test.tsx`, `ReportDefaultInspector.i18nTitle.test.tsx`, `ReportDefaultInspector.defaultPeriodLabels-36835.test.tsx`, `DashboardDefaultInspector.test.tsx`, `DashboardDefaultInspector.layoutColumns-11796.test.tsx`: 10 files, 96 tests passed. - `eslint` on the 6 touched source and test files: 0 errors. - `check:test-source-alias`, `check:changeset-fixed`, `ui` `check:changeset-claims`: exit 0. - `node scripts/pm/overlap-check.mjs`: clean (shares `metadata-form-zh-cn.ts` with objectstack-ai#37366, merges cleanly). ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic (not touched). - [x] 2. Every name I added uses the casing for its kind. - [x] 3. No formatter ran; lint passes. - [x] 4. One issue, one branch off an up-to-date `main`, one pull request. - [x] 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset. - [x] 6. `packages/spec` not touched. - [x] 7. No hand edits to `content/docs/references/`, `packages/*/CHANGELOG.md` or `content/docs/releases/`. - [x] 8. Title, body and comments are in English. - [x] The *Before Submitting* list in CONTRIBUTING.md is done. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01L6bhgUpnvPnJ1hR74pUrVj --- _Generated by [Claude Code](https://claude.ai/code/session_01L6bhgUpnvPnJ1hR74pUrVj)_ <!-- signed: repo:objectstack#2 · os-sales · session_01L6bhgUpnvPnJ1hR74pUrVj --> Co-authored-by: Claude <noreply@anthropic.com>
…bjectstack-ai#36423) (objectstack-ai#37667) <!-- claude-projects-attribution: {"github_login":"os-sales"} --> _Requested by **Sales** · [project thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4UuDJAbBe3iTrFcF7GZrucZ32)_ Fixes objectstack-ai#36423 The card's second item, time in column, was dropped by the maintainer's ruling 7122246952 (「不需要这个功能」); this card's acceptance is the first item alone, the comment and attachment counts, under the seat routes recorded with the stage-1 readings (7121884710): the comment count is the open-thread count the record page's icon shows, the reader is shared in `plugin-detail`, and the read is one grouped read per counted object over the loaded cards, never one per card. ## What changes - **Spec.** `KanbanConfigSchema` gains `cardFooter: { comments?: boolean, attachments?: boolean }`, optional, no default, an inline `strictObject` (an unknown member is refused by name, so a later foot item is one more member). Regenerated: `authorable-surface/ui.json`, `content/docs/references/ui/view.mdx`, the strictness-ledger counts; the `kanban` liveness note cites the reader, the board and the pin test. New `src/ui/kanban-config-card-footer.test.ts`. - **Reader (`@object-ui/plugin-detail`, `comments/recordCounts.ts`).** `useRecordCounts({ dataSource, objectName, recordIds, comments, attachments, reloadKey })`, with `compileCommentCountQuery`, `compileAttachmentCountQuery` and `readRecordCounts`. Both ride `DataSource.queryGroupHeaders` (`POST /data/:object/query`, the reader's permissions): - comments: `sys_comment` where `object_name` is the object, `record_id` is one of the cards, `parent_id` is empty and `is_resolved` is not `true` (the SQL driver's `$ne` is NULL-safe, so a deployment that stores no resolution counts every thread), grouped by `record_id`; - attachments: `sys_attachment` where `parent_object` is the object and `parent_id` is one of the cards, grouped by `parent_id`. A refused read draws no count. A cut answer (`hasMore`: the door cut the groups to `OS_DATA_DEFAULT_PAGE_SIZE`) is never read as the whole set: `askRecordCounts` keeps the exact counts of the records it names and asks again, still one grouped read per round, over the records it did not name, until an answer is whole, names none of them, or `MAX_COUNT_ROUNDS` (20) is reached; a record still unnamed then has no count, never a zero. The counts are asked again on a write to the counted object announced on the data-invalidation bus (`sys_comment` / `sys_attachment`), and while a new set of cards is asked (a lane's next page, a card created) the cards in both sets keep their counts, so no foot blinks. - **Attachments panel (`@object-ui/app-shell`, `RecordAttachmentsPanel`).** An upload and the uploader's own delete go through the storage route, not the data source, so no mutation event carried them; the panel now announces each as a `sys_attachment` write (`notifyDataChanged`). A delete through the data door is announced by the data source's own mutation event, as a comment posted through the data source is. - **Record page (`@object-ui/app-shell`, `RecordDetailView`).** Resolving or reopening a thread (the resolution door, `PUT /api/v1/comments/:id/resolution`) and a member's delete of their own comment (the own-comment door, `DELETE /api/v1/comments/:id`) go through the authenticated fetch, not the data source; each stored write is now announced as a `sys_comment` write. A refused write is not. - **Board (`@object-ui/plugin-kanban`).** `ObjectKanban` asks comments only on an object with `enable.feeds !== false` and attachments only on one with `enable.files === true`, once its definition settles, and re-asks on refresh, invalidation and a host reload. The counts reach the cards through the existing `KanbanCardDisplay` context; `SortableCard` draws a foot (`data-kanban-card-footer`) with each count above zero. - **Relay.** `ListView` (`case 'kanban'`), `ObjectView#generateViewSchema` and the Console's `kanbanViewOptions` relay `cardFooter` only when declared. - **视图设置.** Beside the two card toggles: 「显示评论数」 / 「显示附件数」, each offered only where the object has that count, both off by default. A toggle writes its member on or gone; turning the last one off writes no `cardFooter`. - **i18n.** `list.optionsMenu.kanbanFooterComments`, `kanbanFooterAttachments`, `kanban.cardFooter.comments`, `kanban.cardFooter.attachments` in all 11 packs (zh-Hant generated); the two `{{count}}` labels join the count-neutral list (the number stands after a label and a colon). ## Decisions made here - **Orphan replies are not counted.** On the record page a reply whose parent was deleted is a thread of its own. The server read counts top-level comments only (`parent_id` empty), so such a reply does not count on the card. Counting it would need the parent's existence per row, which a grouped read cannot see. - **A replaced ask is not called off (review N4, accepted).** When a newer ask replaces one in flight (a write announced mid-read, several files uploaded one after another), the older answer is dropped, but `askRecordCounts` takes no cancel signal, so over a cut answer its remaining rounds still run. Only a deployment that cuts grouped reads sees the extra reads; the reader's header states it. - **Unstamped comments are not counted.** The record page reads a record's comments by `thread_id`; the card counts by the stamped pair `object_name` + `record_id`, the indexed key the read gate narrows by. A comment written before the pair existed is not counted on the card until `os migrate comment-parent-pair --apply` has stamped it. - **The footer toggles are offered by capability**, comments where `enable.feeds` is on (opt-out, as the record page), attachments where `enable.files` is on (opt-in), so an author is not offered a count the object cannot have. ## Verification - New tests, all green: - `plugin-kanban/src/ObjectKanban.cardFooter-36423.test.tsx` (4): the counts per card from exactly one `sys_comment` and one `sys_attachment` read over the loaded ids (resolved threads, replies and another object's rows not counted); nothing read or drawn without the key or with both members off; a count the object lacks is never asked; a refused read draws no count while the other still draws. With the board's footer read turned off, 3 of the 4 go red (the "nothing read" case is a control). - `plugin-detail/src/comments/recordCounts-36423.test.tsx` (8): the compiled reads, the answer's reading, and the hook's asking (once per set, again on a new set or reload key, never for a count not asked, no records, or a source without the grouped door). - `plugin-list/src/__tests__/ListView.kanbanCardFooter-36423.test.tsx` (3): relay, the toggles' writes, and the capability gating. - `spec/src/ui/kanban-config-card-footer.test.ts` (3), plus a case each in `app-shell/.../kanbanDraft-36370.test.ts` and `plugin-view/.../ObjectView.harness.test.tsx`. - `pnpm --dir ui exec vitest run` over `plugin-kanban`, `i18n`, `plugin-detail/src/comments` and the list's kanban and view-settings tests: 2,785 green. `packages/spec`: 30,067 green; the one red (`scripts/def-key-collisions.test.ts`) fails to find `tsx` in a temp copy of this worktree's `node_modules` and does not touch this diff. - `check:authorable-surface`, `check:docs`, `check:liveness`, `check:variant-docs`, `check:api-surface`, `check:export-origins`, `check:declaration-map`: pass. `type-check` for `plugin-detail`, `plugin-kanban`, `plugin-list`, `plugin-view`: clean. `eslint` on the changed files: 0 errors. - `overlap-check`: exit 0 (shares files with objectstack-ai#37581, objectstack-ai#37422, objectstack-ai#37366; each merges cleanly). ### Contract review round 1 (7202278679): S1, S2, N1, N2 - **S1** (a cut answer drawn as a whole one): `askRecordCounts` reads `hasMore` off the answer and asks again over the unnamed records. Pins: `recordCounts-36423.test.tsx` (the second round asks only the records the first did not name; one read when whole; an answer naming none stops) and board case (e) (a page of one group: every card past the cut shows its count, two grouped reads). - **S2** (no re-ask after a counted row is written): the reader subscribes to the bus for each counted object it asks; the Attachments panel announces its storage-route upload and own delete. Pins: the hook re-asks on a `sys_comment` write and not on another object's; board case (f) (a thread posted on another card draws its count); `RecordAttachmentsPanel.announce-36423.test.tsx` (3: upload announced, refused upload not, own delete announced). - **N1**: both exceptions to "the record page's number" are now in the changeset and above. The `cardFooter` jsdoc follows with the next change to `view.zod.ts`, as the review allows; this round leaves `packages/spec` untouched. - **N2**: the counts of cards in both sets stay drawn while a new set is asked; another object's counts never. - With the cut loop and the bus subscription turned off, 4 of the new cases go red. `vitest` over `plugin-detail`, `plugin-kanban`, the Attachments panel tests and the list's footer test: 4,666 green. `type-check` for `plugin-detail`, `plugin-kanban` and the changed `app-shell` files: clean; `eslint`: 0 errors. Clause-②: yes (widening) Metadata-protocol: added Skills-docs: follow-up objectstack-ai#37612 ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic. - [x] 2. Every name I added uses the casing for its kind. - [x] 3. No formatter ran; `eslint` on the changed files passes (the full `pnpm lint` runs in CI). - [x] 4. One issue, one branch off an up-to-date `main`, one pull request. - [x] 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset. - [x] 6. `packages/spec` touched: its generated artifacts are regenerated and committed. - [x] 7. No hand edits to `content/docs/references/`, `packages/*/CHANGELOG.md` or `content/docs/releases/`. - [x] 8. Title, body and comments are in English. - [ ] The *Before Submitting* list in CONTRIBUTING.md is done. (full local suite not run; CI carries it) --- _Generated by [Claude Code](https://claude.ai/code/session_01L6bhgUuauSMJu1nVSQRQri)_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01L6bhgUuauSMJu1nVSQRQri ### Contract review round 2 (7203377375): S2 remainder, N3, N4 - **S2** (the comment doors): `handleResolveComment` and the own-comment branch of `handleDeleteComment` announce a `sys_comment` write once the door answers. Pins in `RecordDetailView.commentsResolved-36075.test.tsx` (4): a stored ✓ is announced, a refused ✓ is not, a member's door delete is announced, a refused door delete is not. With the two announcements removed, the two "announced" cases go red. The reader's header now lists which drawer writes reach the bus and how. - **N3** (seat ruling: in this commit): the `cardFooter` jsdoc and `describe` in `view.zod.ts` and the `kanban` liveness note say one grouped read per counted object, and over a cut answer one more over the cards it did not name, up to 20; the jsdoc also names both exceptions to the record page's number (round 1's N1). Regenerated `content/docs/references/ui/view.mdx`; `check:generated`, `check:authorable-surface`, `check:docs`, `check:liveness`, `check:api-surface`, `check:variant-docs` pass. The changeset names `MAX_COUNT_ROUNDS` and the 20-read bound. - **N4**: accepted and stated (see Decisions). - `vitest` over every `RecordDetailView` test (873), `plugin-detail/src/comments`, the board's footer test and the Attachments panel tests: green. `packages/spec` `view.test.ts` and the footer spec test: 492 green. `type-check` on the changed `app-shell` files: clean; `eslint`: 0 errors. <!-- signed: repo:objectstack#2 · os-sales · session_01L6bhgUuauSMJu1nVSQRQri --> --------- Co-authored-by: Claude <noreply@anthropic.com>
objectstack-ai#37675) <!-- claude-projects-attribution: {"github_login":"os-sales"} --> _Requested by **Sales** · [project thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4UuPE7uyDAJyqjwwMzomWv5ff)_ Fixes objectstack-ai#37625 Clause-②: no (published prose and comments only; no behaviour changes) Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:多语言技能文档里,「语言接口由翻译服务自己注册」这句话改成了「由运行时的 HTTP 分发器挂载,数据来自翻译服务」,同时在方法清单里补上 `getSourceLocale()` / `setSourceLocale()`。两处 spec 代码注释也做了同样的更正。代码和平台行为都不变。 - 为什么做:objectstack-ai#37614 的审核发现这句话与 main 不符:翻译服务从 objectstack-ai#23347 起就不再挂任何 HTTP 路由。自己手工组装内核的开发者照旧文档做,会以为装了翻译服务就有这三个接口,实际上没有。 - 出错会怎样:只改文字,撤回即可。为了不超出技能篇幅上限,同一文件里压缩了四处措辞,没有删掉事实。 - 要你做什么:这是受管的技能文件,需要审批人批准后才能合并。 ## What changes - **`skills/objectstack-i18n/SKILL.md`, Registration.** Before: "It self-registers `GET /api/v1/i18n/locales`, `/translations/:locale` and `/labels/:object/:locale`; …". After: "The runtime's HTTP dispatcher, which `os serve` composes, mounts `GET /api/v1/i18n/locales`, `/translations/:locale` and `/labels/:object/:locale`, served from the i18n service; …". The rest of the sentence (the `isDefault` / `sourceLocale` clause) is unchanged. Checked on `main`: `packages/services/service-i18n/src/i18n-service-plugin.ts:27-39` ("It mounts NO HTTP route", naming `createDispatcherPlugin` the one owner); `packages/runtime/src/dispatcher-plugin.ts:1752`, `:1761`, `:1770` mount the three paths; `packages/cli/src/commands/serve.ts` composes `createDispatcherPlugin`. - **Same file, methods list (the card's optional item).** The `getLocales()` bullet gains `getSourceLocale()` / `setSourceLocale()`: both shipped implementations provide them (`file-i18n-adapter.ts:302`, `:307`; `core/src/fallbacks/memory-i18n.ts:275`, `:280`). `getFallbackLocale()` is left out: the file adapter has it (`:285`) but the in-memory fallback deliberately does not (its docblock at `:254`), and the list is "methods both shipped adapters implement". - **Paid in the same file, no fact removed** (6306 → 6333 tokens, ceiling 6333): "is not in `node_modules` to read" → "is not in `node_modules`"; "Methods implemented by both shipped adapters" → "Methods both shipped adapters implement"; "full snapshot for a locale" → "a locale's full snapshot"; "You do not wire this plugin" → "Don't wire this plugin". - **Spec comments.** The `GetLocalesResponseSchema` docblock (`packages/spec/src/api/protocol.zod.ts`) said the descriptor helper is shared by the dispatcher's `/i18n` domain "and `service-i18n`'s autonomous route"; it now names the dispatcher as the route's one owner (`service-i18n` mounts none since objectstack-ai#23347). The `toLocaleDescriptors` comment (`packages/spec/src/system/i18n-resolver.ts`) now says both once served the route and the dispatcher owns it. Comments only: no schema, describe or export changes. - **Changeset**: `@objectstack/skills` and `@objectstack/spec` patch. Small calls made here (no card): the skill names "the runtime's HTTP dispatcher, which `os serve` composes" rather than the internal `createDispatcherPlugin` name, which a client author cannot act on. ## Why Review N1 of PR objectstack-ai#37614 (contract record 7197064778): a shipped skill stated a wrong fact about where the i18n routes come from. ## Verification Run at `a359107dd`, each exit 0: - `node scripts/check-skills-token-ratchet.mjs` (`skills/objectstack-i18n/SKILL.md` 6333/6333). - `node scripts/check-skill-links.mjs`, `node scripts/check-skill-identifier-liveness.mjs`, `node scripts/check-skill-top-level-keys.mjs`. - `pnpm --filter @objectstack/spec check:skill-refs`, `check:skill-docs`. - `node scripts/pm/overlap-check.mjs`: clean (objectstack-ai#37422 and objectstack-ai#37366 share `i18n-resolver.ts` and merge cleanly). The skill edit was drafted by a contract-tier subagent, as `dispatch-gates --tier` requires for `skills/**`, and checked here against the cited lines; the spec comments were edited here. Contract review (L2) is owed before landing: `skills/**` is a governed surface (Tier H). ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic. - [x] 2. Every name I added uses the casing for its kind. - [x] 3. No formatter ran; `pnpm lint` passes. - [x] 4. One issue, one branch off an up-to-date `main`, one pull request. - [x] 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset. - [x] 6. `packages/spec` touched: its generated artifacts are regenerated and committed (comments only; none change). - [x] 7. No hand edits to `content/docs/references/`, `packages/*/CHANGELOG.md` or `content/docs/releases/`. - [x] 8. Title, body and comments are in English. - [x] The *Before Submitting* list in CONTRIBUTING.md is done. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01L6bhgUpnvPnJ1hR74pUrVj --- _Generated by [Claude Code](https://claude.ai/code/session_01L6bhgUpnvPnJ1hR74pUrVj)_ <!-- signed: repo:objectstack#2 · os-sales · session_01L6bhgUpnvPnJ1hR74pUrVj --> Co-authored-by: Claude <noreply@anthropic.com>
…he record form and /forms/NAME (objectstack-ai#37743) <!-- claude-projects-attribution: {"github_login":"os-sales"} --> _Requested by **Sales** · [project thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4UuDJAbBe3iTrFcF7GZrucZ32)_ Fixes objectstack-ai#37677 A `repeater` field with no `span` rendered one cell wide in a two-column form, on the record form and on `/forms/NAME`, though the spec's form field `span` docblock lists repeater among the types that take the whole row on `span: 'auto'`. ## Premise, measured on `main` (94843b8) A two-column form with a text field, a textarea and a repeater, no `span` anywhere: | Renderer | textarea row | repeater row | |---|---|---| | Record Edit dialog (`ModalForm`, `columns: 2`) | `@md:col-span-2` | no span class (one cell) | | `/forms/NAME` (`FormPage`, 2-column section) | `sm:col-span-2` | no span class (one cell) | The contract side is right and the renderers are wrong: repeater used to reach the full row through the wide `field:grid` widget it mapped to. Since objectui#11448 it maps to `field:object`, the JSON editor that `json`, `object`, `composite` and `record` also take, and `field:object` is not on the wide list. Only the docblock's "through the `field:grid` widget" clause was stale. ## What changes - **`@object-ui/plugin-form` (`autoLayout.ts`).** The `span: 'auto'` default (`isWideFormField`) also reads the OBJECT field's type off `FormField.field`, through a new `WIDE_DECLARED_FIELD_TYPES = {repeater}`. The same set is matched on `FormField.type` too, for the caller that passes raw object-field types (app-shell's `ObjectFormDesigner`). Neither `repeater` nor `field:object` joins `WIDE_FIELD_TYPES`: `isWideFieldType` is the type-only answer app-shell's `richtextSurfaceParity` test holds equal to plugin-detail's. - **`@object-ui/console` (`FormPage.tsx`).** The named-form page now passes the object field's `type` beside its `multiple` into `resolveColSpan`, so both renderers read the same declaration. - **`@object-ui/app-shell` (`ObjectFormDesigner.tsx`).** The Studio form designer canvas now asks the form's own `span: 'auto'` default (`resolveColSpan`, with the widget id as `type` and the raw type in the stash) instead of `isWideFieldType` on the widget id, so it lays a repeater out across the row as the runtime form does (contract review S1). Every other type answers as before: the stash carries no `multiple`. - **`@objectstack/spec` (`view.zod.ts`, describe only).** The `span` describe now says repeater is wide "by its object-field type: the JSON editor it maps to is shared with json, composite and record, which stay one cell". `liveness/view.json` row `form.sections` carries the re-read; `content/docs/references/ui/view.mdx` regenerated. ## Decisions made here - **Width by declaration, not by widget id.** Adding `field:object` to the wide list would also widen `json`, `object`, `composite` and `record`, which the docblock does not list. The multi-file rule already reads `FormField.field` the same way. - **Detail view not touched.** plugin-detail's own wide list has no repeater either, but the card and the docblock are about the form `span` key; the detail view's width is not part of this contract. ## Verification - New and extended pins, red on `main` and green here (4 red with the two source files reverted): - `plugin-form/src/__tests__/repeaterAutoSpan-37677.test.tsx` (5): the record Edit dialog renders the repeater row `@md:col-span-2`; a `json` field on the same widget and a text field stay one cell (control); `resolveColSpan` on `field:object` is 1 alone, full with `field.type: 'repeater'`, 1 with `field.type: 'json'`; the bare designer type is wide through `resolveColSpan` while `isWideFieldType('repeater')` stays false; an authored `colSpan: 1` still wins (control). - `app-shell/src/views/studio-design/ObjectFormDesigner.test.tsx`: the repeater pin ("lays a `repeater` field out the way the runtime form resolves it") now asserts `col-span-full`; a new `json` control on the same widget stays one cell. `ObjectFormDesigner.typeName-13148.test.tsx`'s catalog sweep derived its expected span from the canvas's old rule and went red on `5c42345811` (Test UI 10/16); its control now expects a repeater to span the row (fourth commit). All 12 `ObjectFormDesigner*` files: 82 green. - `console/src/components/FormPage.fieldSpan-37559.test.tsx` (+3): a repeater takes `sm:col-span-2`; a `json` field stays one cell; `colSpan: 1` on a repeater wins. - `app-shell/src/views/richtextSurfaceParity.test.tsx` (unchanged): the detail and form type-only wide sets still agree on every spec type. It went red on the first head (`bb58f2016b`, Test UI 5/16) when `repeater` sat on `WIDE_FIELD_TYPES`; the second commit moves it to the declaration rule, and the test is green locally. - `vitest` over all of `plugin-form` and every `FormPage*` test: green; plugin-form `__tests__` re-run after the second commit: 1,031 passed. `tsc -p tsconfig.test.json` for `plugin-form`: no errors in the changed files. `eslint` on the changed files: 0 errors. - After the review fixes (third commit): `ObjectFormDesigner.test.tsx`, `richtextSurfaceParity`, `repeaterAutoSpan-37677` and `autoLayout.test.ts`: 80 green; app-shell `tsc -p tsconfig.test.json` clean on the designer files (with a rebuilt plugin-form dist); `eslint`: 0 errors. - `packages/spec`: built, then `check:generated` (14 artifacts up to date) and `check:api-surface` unchanged. - `overlap-check`: exit 0 (objectstack-ai#37422 and objectstack-ai#37366 share the spec files and merge cleanly). Clause-②: no Metadata-protocol: none Skills-docs: none ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic. (Describe text only.) - [x] 2. Every name I added uses the casing for its kind. - [x] 3. No formatter ran; `eslint` on the changed files passes (the full `pnpm lint` runs in CI). - [x] 4. One issue, one branch off an up-to-date `main`, one pull request. --- _Generated by [Claude Code](https://claude.ai/code/session_01L6bhgUuauSMJu1nVSQRQri)_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01L6bhgUuauSMJu1nVSQRQri <!-- signed: repo:objectstack#2 · os-sales · session_01L6bhgUuauSMJu1nVSQRQri --> --------- Co-authored-by: Claude <noreply@anthropic.com>
… a token reads its stored sentence (objectstack-ai#37731) <!-- claude-projects-attribution: {"github_login":"os-sales"} --> _Requested by **Sales** · [project thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4UuPE7uyDAJyqjwwMzomWv5ff)_ Fixes objectstack-ai#37635 Clause-②: no Metadata-protocol: none Skills-docs: none (no page under `skills/**` describes the stored milestone summary code) ## 维护者速读 - 用户能看到什么变化:应用作者给里程碑摘要模板新加了一个 `{token}` 之后,之前写下的动态记录在中文等翻译语言下不再显示“带空洞”的翻译句,而是显示当时存下的完整英文句。新写的记录不受影响,照常显示翻译。 - 为什么做:objectstack-ai#37582 的审核发现,旧行没有新 token 的值,翻译句里那个位置会变成空白,而存下的英文句是完整的。 - 出错会怎样:最坏是某行显示英文原句而不是翻译,不会丢数据,也不会出现空白。 - 要你做什么:无。 ## What changes - **Fallback (item 1)**, `activity-summary-message.ts` + `audit-writers.ts`: - The writer adds `names` to a fired milestone's summary code: every distinct `{token}` name the fired template held, interpolated or not (`milestoneTokenNames`). - The composer renders a translated template only when each token it names either has a stored value or is listed in `names` (it was in the template and its value was empty, so it renders empty as in the stored sentence). Any other token makes `composeActivitySummary` answer `undefined`, so the row keeps its stored sentence, as it already does for a locale with no entry. - `readActivitySummaryMessage` accepts `names` only as a string list, and still reads a code without it. - **One token grammar (item 2, N3)**: `milestoneTokenRe()` moves to `activity-summary-message.ts` and is exported; the writer imports it, and the composer's literal `/\{(\w+)\}/g` is gone. - **Per-read caching (item 3, N4)**, `readerSummaryLocale`: each `(object, field, value)` milestone's answer is computed once per read, and each object's packaged base is read once per read, shared by the translated definition and every milestone answer. - **Stale comments (item 4, N6)**: the `scalarOverridesPackagedBase` jsdoc and the `valueOverridesPackagedBase` jsdoc in `packages/spec/src/system/i18n-resolver.ts` name the five scalars (an object's three, a rule's `message`, a milestone's `summary`) instead of "three scalars" / "its two callers"; the header of `audit-option-label-summary.test.ts` says a reader may now read the milestone composed in its language (objectstack-ai#37524), while the stored sentence stays untranslated. - **Changeset**: `@objectstack/plugin-audit` and `@objectstack/spec` patch. Small calls made here (no card): - **How a row tells "empty" from "added later"**: store the template's token names on the row (the card's example). The alternative, a hash or the whole template, carries more and still needs the names to judge a translation. - **A token only the translation names** (not in the authored template) now also keeps the stored sentence. objectstack-ai#37582 rendered it empty; a translation with a token the row never had cannot be composed whole either, so one rule covers both. - **Rows written before this change** carry no `names`: they compose only when every token of the translation has a stored value. Such a row with an empty value shows its stored sentence instead of the translation; it never shows a hole. - The cache key is `(object, field, value)`, one level finer than the card's `(object, field)`, because the answer depends on the value; the packaged base is cached per object. ## Why Contract review records 7196337094 and 7197635792 on PR objectstack-ai#37582 (accepted deviations and nits, adopted at ACCEPT), carried here per the one-card-per-PR rule. ## Verification Head `48cd3c9dd`: - `packages/plugins/plugin-audit`: `vitest run src/`: 110 files, 1846 tests passed. New cases in `activity-summary-message.test.ts`: red-first for a token added after the row (keeps the stored sentence), an empty listed token renders empty, a translation-only token, a code without `names` (composes when every token has a value, else keeps the stored sentence), one packaged-base read for many rows and two milestones, and `names` validation. `activity-milestone-summary-locale.integration.test.ts` pins the stored `names` and, through the real writer, SQLite driver and read middleware, that a zh-CN reader reads the stored English for a row written before the template gained `{note}`, with the lost row (whose template held `{note}`) still composed as a control. - `tsc --noEmit -p packages/plugins/plugin-audit` and `eslint` on the 5 touched plugin-audit files: exit 0. - `check:changeset-fixed`, `check:test-source-alias`: exit 0. - `node scripts/pm/overlap-check.mjs`: clean (shares `i18n-resolver.ts` with objectstack-ai#37422 and objectstack-ai#37366, both merge cleanly). ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic (doc comments only). - [x] 2. Every name I added uses the casing for its kind. - [x] 3. No formatter ran; lint passes. - [x] 4. One issue, one branch off an up-to-date `main`, one pull request. - [x] 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset. - [x] 6. `packages/spec` touched (comments only): no generated artifact depends on them. - [x] 7. No hand edits to `content/docs/references/`, `packages/*/CHANGELOG.md` or `content/docs/releases/`. - [x] 8. Title, body and comments are in English. - [x] The *Before Submitting* list in CONTRIBUTING.md is done. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01L6bhgUpnvPnJ1hR74pUrVj --- _Generated by [Claude Code](https://claude.ai/code/session_01L6bhgUpnvPnJ1hR74pUrVj)_ <!-- signed: repo:objectstack#2 · os-sales · session_01L6bhgUpnvPnJ1hR74pUrVj --> Co-authored-by: Claude <noreply@anthropic.com>
… "0 deleted, 4 failed" (objectstack-ai#37809) <!-- claude-projects-attribution: {"github_login":"os-sales"} --> _Requested by **Sales** · [project thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4UuDJAbBe3iTrFcF7GZrucZ32)_ Fixes objectstack-ai#37758 A list bulk Delete whose records were refused said only 「成功 0 条,失败 4 条」 ("0 deleted, 4 failed"). The server gives every refused record a readable, localized reason (a restrict delete says which child records still reference it), and the one-record Delete shows it; the batch summary dropped it. ## What changes - **`@object-ui/core` (`actions/recordDelete.ts`).** The bulk branch of `run` keeps each rejected result's reason. The summary toast keeps its count title (`objectActions.bulkDeletePartial`) and gains a description: - one line per distinct reason, in the order the records were handed in; - each line led by the names of the records that reason refused (the same ADR-0079 resolver the success toast uses), up to three names and then `+N`; - a reason whose records have no name reads alone (the title already counts them); - at most three reasons, then "And N more"; - an external datasource's refusal reads as the read-only sentence, as the one-record toast reads it; - a refusal with no message adds no line, so a batch with no reason at all keeps today's bare count toast. The one-record toast is unchanged. - **`@object-ui/i18n`.** Two keys in all 11 packs: `objectActions.bulkDeleteRefusedNamed` (`{{names}}: {{reason}}`, with each pack's own colon) and `objectActions.bulkDeleteMoreReasons`. The name/reason join is allowlisted in `untranslated-identity-4376` as a format string, as `detail.fieldChangeLabel` is. - **`@object-ui/plugin-view`.** The two keys join `ObjectView`'s `objectActions.*` fallback table. ## Decisions made here - **Grouped by the exact reason text, named by record.** The card's own restrict example carries each record's dependent count in its sentence ("referenced by 3 records" / "by 1 record"), so records rarely share a byte-identical reason. Naming the records under each reason answers "which", which the acceptance allows ("reason, then how many records or which"); records that do share a reason are one line. - **No counted noun in either new key.** "And {{more}} more" and the name list carry no plural noun, so no pack needs a CLDR plural family for them (`plural-categories-11432`). The option is `more`, not `count`, so i18next does not go looking for one. - **The description is joined with `\n`,** as `writeWarningToast` and `studioSaveBar` do. Each reason the server sends ends in its own punctuation. - **Not in this PR:** the related list's inline bulk-delete outcome line (`plugin-detail` `RelatedList.tsx`, `bulkDeleteOutcome`) has the same count-only shape, and a view-declared `operation: 'delete'` bulk action (the card's "also seen") was not measured. Both are for the seat to file or fold. ## Verification - `core/src/actions/__tests__/recordDelete.test.ts`: 6 new or changed cases, red on `main` and green here (6 red with `recordDelete.ts` reverted): an all-refused batch for one reason (names, `+1`), a mixed batch (two reasons, order kept, the deleted record not named), nameless records (reason alone), five reasons (three listed, "And 2 more"), an external-datasource refusal (read-only sentence), and the existing partial-failure case now with its description. Controls: refusals with no message keep the bare count with no description; the one-record refusal toast is unchanged. - `plugin-view` `ObjectView.gridDelete-10383`: the registered object-view bulk Delete's partial-failure pin now also asserts the refusal reason rides in the description. - `vitest` over `core/src/actions`, all `plugin-view` tests, `app-shell` `useObjectActions*` and all of `i18n` (1,867 passed, including key parity, plural categories and the untranslated-identity gate): green. `tsc -p tsconfig.test.json` for `core`: clean. `eslint` on the changed files: 0 errors. - `overlap-check`: exit 0 (objectstack-ai#37676 and objectstack-ai#37366 share the locale packs and merge cleanly). - Premise: static read on `main` cac93cc (the bulk branch reads no rejected `reason`), and the red tests above. Clause-②: no Metadata-protocol: none Skills-docs: none ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic. (No spec change.) - [x] 2. Every name I added uses the casing for its kind. - [x] 3. No formatter ran; `eslint` on the changed files passes (the full `pnpm lint` runs in CI). - [x] 4. One issue, one branch off an up-to-date `main`, one pull request. --- _Generated by [Claude Code](https://claude.ai/code/session_01L6bhgUuauSMJu1nVSQRQri)_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01L6bhgUuauSMJu1nVSQRQri Co-authored-by: Claude <noreply@anthropic.com>
… spec's predicate (objectstack-ai#37835) <!-- claude-projects-attribution: {"github_login":"os-elon-musk"} --> _Requested by **Elon** · [project thread](https://claude.ai/code/project/chan_01WedDzV26nniwxv7jC88B9D?thread=cmsg_01WedDzV26nniwxv7jC88B9DLCo5F2y7fgbM8tstGoyyUn)_ Fixes objectstack-ai#37810 Clause-②: no Metadata-protocol: none ## 维护者速读 - 用户无感:引擎内部调用(钩子、流程)排序时判断「计算字段不能排序」,改为与 HTTP 数据接口读同一个来源,今天的结果完全不变。 - 属于排序闸门统一来源的收尾,替上一张排序闸门卡把引擎这一侧补齐,并改掉六处仍提旧集合名的注释。 - 出错的话只会是某种字段类型的排序被误拒或误放,一条测试会立刻变红;改动可以直接撤回。 - 无。 ## What changes - **The engine door reads the one source.** `assertOrderByIsMaterializable` (`packages/objectql/src/engine-top-level.ts`) judged "computed on read" with its own `type === 'formula'`. It now asks `isVirtualSearchField` from `@objectstack/spec/data`, the predicate the Data API door (`assertSortFieldsExist`, third verdict) and the sortability projection already read. `SEARCH_VIRTUAL_TYPES` is pinned to exactly `formula`, and `isVirtualSearchField` is true exactly for a string `type` in that set, so no verdict moves for any field, schema-valid or not. Code, status, `field`, `fields` and message are unchanged. - **A pin holds the two doors together.** `packages/objectql/src/engine-sort-door-agreement.test.ts`: for every member of `FieldType.options` it asks the engine door and the Data API door about the same sort over the same definition, and fails if they part. It copies no verdict table. A companion field declaring `sortable: false` tells the Data API door's third verdict (computed type, names the field alone) from its fourth (names the companion), the same device as the metadata-protocol agreement test. The engine door does not judge `sortable: false`, so the companion never moves its answer. A control asserts the table has both refused and accepted types. - **The ledger of other sites now lives beside the engine door.** The docblock gains a "ONE SOURCE" paragraph and "THE OTHER SITES" list: `fieldHasColumn` and `SqlDriver.createColumn` (driver-sql), `remote-transport.ts` (driver-turso), `planFormulaProjection` and `search-companion.ts` (objectql), `VIRTUAL_FIELD_TYPES` (plugin-audit). None of those sites changes. - **Comments that named the retired set.** `packages/lint/src/validate-sortable-fields.ts` (two places; the first pointed at a note that no longer exists and now points at the two doors' "ONE SOURCE" notes), `packages/drivers/driver-sql/src/sql-driver-external-unprovisioned-sort-anchor.test.ts` (two places), and the two `ui/packages/plugin-list` tests. Comment-only. - **Changeset:** `@objectstack/objectql` patch. ## Read first 1. `packages/objectql/src/engine-top-level.ts`, the `assertOrderByIsMaterializable` hunk: the one-line predicate swap is the only behaviour edit in the PR. 2. `packages/objectql/src/engine-sort-door-agreement.test.ts`: how the Data API door's third verdict is told from its fourth. 3. `packages/lint/src/validate-sortable-fields.ts`: the rewritten pointer near the top of the docblock. ## Two-minute check `pnpm --filter @objectstack/objectql exec vitest run src/engine-sort-door-agreement.test.ts` prints `Tests 50 passed (50)` (one control plus 49 field types). ## Tests All runs at head `4edfb2fd99`, through `scripts/pm/os-verify-lock.sh`, after building the `@objectstack/objectql` dependency closure. <details><summary>Package suites and typecheck (all green)</summary> ``` pnpm --filter @objectstack/objectql test Test Files 639 passed (639) Tests 14485 passed (14485) pnpm --filter @objectstack/objectql typecheck check:test-typecheck: OK, the test layer compiles under packages/objectql/tsconfig.test.json (debt file unchanged) pnpm --filter @objectstack/lint typecheck check:test-typecheck: OK pnpm --filter @objectstack/driver-sql exec vitest run src/sql-driver-external-unprovisioned-sort-anchor.test.ts Test Files 1 passed (1) Tests 12 passed (12) os-verify-lock: VERDICT command-exit 0 ``` </details> <details><summary>Ablation: the pin goes red the day the spec's set grows without the engine door</summary> The future case, staged on disk: `SEARCH_VIRTUAL_TYPES` in `packages/spec/src/data/search-fields.ts` widened to `formula` and `summary` with `scripts/ablation-replace.mjs` (anchor 1 to 0, blob changed), spec rebuilt, and `scripts/ablation-dist-preflight.mjs` found the widened set in 2 built files of `packages/spec/dist`. (Its tree reading answered exit 3 only because the source spells the set with single quotes and the build with double quotes; the dist reading, the one the suite consumes, passed.) ``` Leg A engine door reads isVirtualSearchField, spec set widened -> Tests 50 passed (50) Leg B engine door back to its formula literal, spec set widened -> Tests 1 failed | 49 passed (50) FAIL a `summary` field: the engine door refuses it exactly when the Data API door calls it computed - "engineCallsComputed": true, + "engineCallsComputed": false, Leg C formula literal, spec restored and rebuilt (preflight: widened set absent from all 614 built files) -> 50 passed Leg D this PR as committed, today's spec -> 50 passed ``` So Leg B is the drift the card describes: the Data API door refuses `summary` and the engine door lets it through. Leg A shows the change ends it, and Leg C shows the two are identical today. After restoring, both source files matched their HEAD blobs, `git status --porcelain` was empty and `git diff HEAD` was empty. </details> ## Acceptance notes - **One comment outside the claimed surface still names `UNMATERIALIZED_SORT_TYPES`.** `packages/metadata-protocol/src/protocol-query-validation.ts` around line 613, in the Data API door's own "ONE SOURCE" note: "This door used to carry a set of its own for the same fact (`UNMATERIALIZED_SORT_TYPES`, `formula` alone, retired here)". It is a history pointer, kept on purpose so a search for the old name lands on its replacement (contract record 7209730357, N4). The card's acceptance line reads "no comment outside CHANGELOG files", and the card's own list names the six comments edited here. The file is not in the claim, so it is left as it is and raised in the report. The shipped changeset `.changeset/37386-sort-door-reads-projection-predicate.md` does not name the set. - **The refusal text still says "A formula field is virtual".** Unchanged on purpose: no verdict and no message moves, and `query-expression-conformance.test.ts` pins the wording across doors. The day `SEARCH_VIRTUAL_TYPES` grows, that sentence needs the type name too. Noted, not filed. - **The driver-sql anchor test still asserts `not.toBe('formula')`.** `driver-sql` depends on `@objectstack/spec`, so it could ask `isVirtualSearchField` instead. The claim makes that file comment-only, so it is left alone. Noted, not filed. - **The pin calls the door function, not `ObjectQL.find`.** That keeps it free of an engine boot for 49 types. `query-expression-conformance.test.ts` already pins the wiring from `engine.find` / `engine.findOne` to this door. - **The `ui/` comment edits run no local test.** Comment-only. `Test UI` covers them in CI. ## Verification - `node scripts/pm/dispatch-gates.mjs --commands` (76 families for this diff) run at `4edfb2fd99`: 73 exit 0. `--ran` reconciliation: 76 of 76 accounted for. - NOT MEASURED, prerequisite missing in this container (CI runs all three): `node scripts/check-plugin-teardown-shape.mjs --self-test` (exit 3, its pinned fixture commit is out of reach of a shallow clone); `pnpm check:dual-build-cjs-loads` (exit 3, PREREQUISITE NOT MET: 80 packages have no `dist/`); `pnpm --dir ui exec vitest run scripts/` (one red case, `unit-registry-absence-collision.test.ts`, because `@objectstack/client` has no `dist/` here, so the files that import it could not be measured; this diff touches no `ui/` module). - `node scripts/check-platform-checklist.mjs --changed-from origin/main`: OK, 1 anchor judged, 0 lost. - `node scripts/pm/overlap-check.mjs`: clean against `origin/main` `9b50fedbfa` and the two open PRs that share `engine-top-level.ts` (objectstack-ai#37676, objectstack-ai#37366). - Dogfood: not run. The title has no `!` and there is no `(narrowing)` arm. --- _Generated by [Claude Code](https://claude.ai/code/session_016WV4cxBECSPtHxQMZDHSie)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
…ows by whole checkpoints (ADR-0154 D8, D10) (objectstack-ai#37605) <!-- claude-projects-attribution: {"github_login":"os-sales"} --> _Requested by **Sales** · [project thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4UuWkuYc3V797qxZSYHo5QzBw)_ Part of objectstack-ai#31908 Clause-②: yes (narrowing) — narrowed: `sys_audit_log` now declares `lifecycle.seal` on every deployment, so `os migrate audit-key-material`, `audit-mail-bodies`, `audit-metadata-bodies` and `audit-side-copies` with `--apply` refuse on SQLite or Turso without `--sealer-stopped`, and on Postgres or MySQL take the audit seal lock and refuse after ten minutes, where 18.6.0 ran them unlocked on a deployment that sealed nothing; `os audit verify` exits 1 on a row it reads `late` and unsealed (the S4 arm); `os audit verify` refuses with `archive_not_connected` and exits 2 where the `archive` datasource is declared and not connected on its own boot (fix: `autoConnect: true`, or make it reachable), where 18.6.0 printed that nothing is sealed and exited 0; `verifyAuditLedger` throws for `sys_audit_log` when its `archive` datasource is not connected and no `archive` is passed; on a sealed object with no `archive` whose lifecycle is declared in packaged metadata, a retention override below the declared window, global or for one organization, is rejected (reported at `error`, the declared window applies), where 18.6.0 applied it. An object created at runtime is outside the override arm and outside signed expiry: it keeps the 18.6.0 row-cutoff retention sweep, and a settings override applies to it; the `os audit verify` arms hold for it as for any sealed object. This breaks the bound changeset `35c9a30` (objectstack-ai#33675) set ("a deployment that did not opt in sees no change"). Widened: `LifecycleService.registerExpiryPrefix` and the `LifecycleExpiryPrefix*` types (the request with `tenants` and `tenantColumn`), `takesSignedExpiry` and `SignedExpiryRegistryLike`, three optional owner reads on `LifecycleEngineLike.registry`, `policy: 'expiry'`, the skip reasons `seal-expiry-pending` and `seal-delete-unsupported`. Metadata-protocol: semantic — beside `lifecycle.seal`, the authored `retention.maxAge`, `ttl.expireAfter` and `archive.keep` no longer delete a row at its row cutoff: rows leave by whole checkpoints under a signed expiry amendment (seat ruling on review 7198128323 S2; the changeset moves all four packages `minor`) Skills-docs: objectstack-ai#37881 — this claim's second PR (amendment 7193137455) rewrites `skills/objectstack-data/rules/lifecycle.md`, which says the sweeper deletes sealed rows until it lands (hence `Part of`, not `Fixes`) ## 维护者速读 - 每个部署的审计日志从此默认带防篡改封印:管理员跑审计校验时,被改、被删、被脱敏、按策略到期的记录都能分辨出来,热库和归档库都算。 - **这是对运维可见的破坏性变化**:SQLite 和 Turso 部署下次跑 `os migrate audit-*`(包括升级流程里的 `audit-side-copies --apply`)会被拒,要先停掉服务再带 `--sealer-stopped`;Postgres 和 MySQL 会先等封存锁,最多等 10 分钟。 - **过期删除不可撤回**:过了保留期的审计记录按整段检查点删除,删之前先签一份到期说明,校验时读作“到期”而不是“丢失”,但删掉的行找不回来。 - **宿主没有传加密服务时**,`sys_audit_log` 过了 `archive.keep` 也会一直留着,封存器每小时报一次 error。出错时只会多留、不会多删:链条有缺口、签名不可信、检查点或到期说明不属于这条链、前后接不上,都一律保留并告警一次。 - **没有 archive 的封存对象上,保留期覆盖不能把窗口缩短到声明值以下**:运维在设置里把这类对象的保留期改短(全局或某个组织)会被拒绝并报 error,按对象声明的窗口执行;改长照常生效。想留得更短,只能改对象自己的声明。带 archive 的对象(比如 `sys_audit_log`)上,覆盖仍然决定什么时候转入归档。 - **签名到期只覆盖打包元数据里声明的对象**:运行时创建的封存对象(在 Studio 等处建的、存在数据库里的)照旧按保留期清扫(被清掉的行在校验里读作“丢失”)、覆盖照样生效,和现在一样,不受“覆盖下限”和“签名到期”这两条收窄影响;但 `os audit verify` 的两条收窄对它一样适用,比如有 late 未封存的行时同样 exit 1。让运行时对象也支持签名到期另开卡。 - **按租户设的保留期**设在对象的 `organization_id` 列上,所以只有链列也是 `organization_id`(`seal.chainField: 'organization_id'`)的对象,才按这个组织自己的保留期过期;其他链(不属于任何组织的链,以及保留期设在另一列上的对象的所有链)一律按所有保留期里最长的那个保留。代价是:保留期设在非链列上的对象,租户设的更短保留期对它的封存记录不起作用,记录会留到最长的保留期。 **Tier:** Tier H (declared narrowing: the Clause-② line above; seat ruling on review 7202871622). About 2,996 changed lines (under 3,000). No governed path: `packages/spec/src/data/object.zod.ts` changes one `.describe()` sentence only, and the `skills/**` wording fix is split into this claim's second PR (amendment 7193137455), Tier H on its own. The release page `content/docs/releases/v18/18-6.mdx` is release-owned and is not edited here (AGENTS.md "Documentation Guardrails"). ## What changes ADR-0154 D8 + D10, slice P4c, the last slice of objectstack-ai#31908. - **`sys_audit_log` is sealed by default.** Its lifecycle now declares `seal: { valueFields: ['old_value', 'new_value', 'metadata'] }` (`packages/plugins/plugin-audit/src/objects/sys-audit-log.object.ts`). The chain column is the default `tenant_id` (a lookup, one text value on every store). - **LifecycleService: sealed objects expire only through a registered seam** (`packages/objectql/src/lifecycle/lifecycle-service.ts`). Signed expiry covers objects whose lifecycle is declared in packaged metadata; an object created at runtime keeps the row-cutoff retention sweep. Extending signed expiry to runtime-created objects is a separate card. The test is one predicate, `takesSignedExpiry` (new, `lifecycle/signed-expiry-scope.ts`, exported), which the routing, the audit floors and the sealer's expiry all ask; it answers yes only for an object the registry places in packaged metadata. Any other sealed object keeps the row-cutoff path, and the sealer's expiry answers no run for it (seat ruling 7209154881). New public `registerExpiryPrefix(expiry)` (the name slice plan 6759503769 ruled) (one slot; a later registration replaces it; the disposer clears only its own) and the types `LifecycleExpiryPrefix`, `LifecycleExpiryPrefixRequest`, `LifecycleExpiryPrefixRun`. For an object with `lifecycle.seal`: - the `retention.maxAge` / `ttl.expireAfter` legs and the archive's `keep` prune never delete by a row cutoff; each asks the seam to `plan({ object, policy, policyValue, cutoff, tenants?, tenantColumn? })`; - each run's `rowIds` are deleted by id (hot and archive for an archiving object; through the engine, reap guards asked, for the rest), and `run.complete()` is called only when every one is gone; - with no seam registered, rows are kept, the archive copy still runs, the sweep reports `seal-expiry-pending`, and one `warn` says so; - a tenant-scoped window (on the partition `reap()` uses, through the same floors) travels as `tenants`, with the column it is set on (`tenantColumn`), which need not be the chain column (review 7202871622 S4); - an archive store with no `bulkDelete` is never planned (`seal-delete-unsupported`), so no amendment is signed over rows it could not delete. - **plugin-audit: the expiry writer** (new `audit-seal/expiry.ts`, `AuditSealer.expire`, registration in `audit-plugin.ts`): - per chain, from the first remaining checkpoint (which must follow and link to the last admitted expiry, or be sequence 0), take consecutive checkpoints whose window ended at or before the chain's cutoff aligned down to a UTC day, each the chain's own, linked to the one before and admitted by a trusted signature, at most 10,000 rows a sweep; a chain holding a checkpoint or stored expiry that is not its own, or one that does not link, is not expired at all and is said once (review 7202871622 M3); - each chain's window: where `tenantColumn` is the object's chain column, an organization's chain takes its own tenant window (else the global one); every other chain, the chain of rows about no organization and every chain of an object whose windows sit on another column, takes the longest window configured; its amendment signs it (seat rulings on S1 and on review 7202871622 S4). No row is read to pick a window; - sign and store the chain's `expiry` amendment (the S1 key-id loop, then the sink, best-effort), then answer the run; `complete()` removes each checkpoint's seed, then the checkpoint, oldest first (review n5), and removes a seed only when it is the secret sealed under that checkpoint's own coordinate; - a stored, admitted amendment that still covers the first remaining checkpoint is resumed (no second amendment); the resume branch admits each checkpoint as the fresh branch does (the chain's own, linked to the one before, a trusted signature), requires them consecutive from the amendment's first sequence to its last sequence and digest, reads them a page at a time, and removes them oldest first; otherwise nothing in the range is deleted; an unadmitted amendment deletes nothing; - a gap or an untrusted checkpoint stops the chain there and is said once; - planning holds the `audit.sealer` lock and the DB seal-pass lock, so two replicas never sign two amendments over one range; a fully drained plan is memoised for the day; - registered only when the plugin has a crypto provider (otherwise nothing could be signed); - on a sealed object with no `archive`, a retention override cannot shorten the declared window (review 7207510869): beside the expiry, the plugin registers a retention floor (`LifecycleService.registerRetentionFloor`, the mechanism the job queue uses) for every object whose packaged metadata declares `lifecycle.seal` and no `archive`, at its declared `retention.maxAge` and `ttl.expireAfter` (new `audit-seal/retention-floor.ts`), and registers it again before every sealer pass (new `AuditSealerOptions.beforePass`) so it follows the registry; a lifecycle service with no retention floors is given no expiry, so its sealed rows are kept, and the plugin says so at `error`. An archiving sealed object expires only past `archive.keep`, which takes no override; - the sealer's head falls back to the last admitted expiry (the chain's own, its signature verified) when a chain has no checkpoint left (`last_sequence`, `last_removed_digest`), and the object floor to the newest admitted `covered_to`; both, like the expiry, read stored amendments page by page until an admitted one answers. - **Verifier: the S4 arm** (seat ruling 6885452378, ADR-0154 D3 as amended in objectstack-ai#33489): a window that starts at or before the newest window a trusted `window` checkpoint names is sealed, so a lagging chain's rows read `late` and unsealed. It also holds an honoured expiry to what it signed: an amendment stored under another chain than its signed organization is a `chain_key` fault, as a checkpoint is, and a checkpoint in an honoured range reads `expired` only within the window the range covers (review 7202871622 M3). - **verify harness** (`packages/verify/src/harness.ts`, ruling 6884540128 item 4): an `AuditPlugin` that `bootStack` mounts (extra, stack `plugins`, or `requires: ['audit']` provider) adopts `harnessCryptoProvider()`, the instance settings and the engine get; an instance with its own provider keeps it. - **Docs:** the `lifecycle.seal` describe sentence (and the regenerated `content/docs/references/data/object.mdx`), `content/docs/data-modeling/objects.mdx` (the sentence at :277, the day alignment, the row budget and tenant windows, plus one line that `sys_audit_log` declares the block), `content/docs/deployment/cli.mdx` (the audit seal lock and `--sealer-stopped` for every run covering the audit log), `content/docs/upgrading.mdx` (the 18.5.0 line now holds on every deployment), `content/docs/deployment/production-readiness.mdx`. ## Tests - `packages/objectql/src/lifecycle/lifecycle-service.sealed-expiry.test.ts` (new, 13): a sealed object created at runtime keeps the row-cutoff sweep, retained and archiving, and never asks the expiry (seat ruling 7209154881); against a real `SchemaRegistry`, a sealed object the registry does not place in an installed package's metadata keeps the row-cutoff sweep, while one it does takes the signed expiry; pending skip and the once-only warning; `archive.keep` plan on both stores and complete-after-delete; `retention.maxAge` per-id engine deletes; `ttl.expireAfter`; a partial guard veto leaves its run uncompleted; a failing plan deletes nothing; slot replacement and disposer; a malformed registration; an unsealed object keeps the row-cutoff path; an archive store with no `bulkDelete` is never planned; a tenant-scoped window travels to the expiry with the column it is set on (review S1, S4, n3). - `packages/objectql/src/lifecycle/signed-expiry-scope.test.ts` (new, 3): `takesSignedExpiry` answers yes only when the registry places the object in packaged metadata: a registry that cannot be asked answers no; an installed `code` or `marketplace` source answers yes, an `authored` or unknown one no; a plain registration from code answers yes, an owner under no installed package or a tenant-authored one no. - `packages/plugins/plugin-audit/src/audit-seal/audit-seal-expiry-live.integration.test.ts` (new, 10): the real-kernel end-to-end over SQLite with an `archive` datasource. `sys_audit_log` sealed by its own declaration; the plugin's sealer seals; an interrupted expiry (amendment stored, rows still there) reads `expired`; the kernel's own LifecycleService sweep archives, resumes, deletes exactly the expired rows from both stores and then their checkpoints and seeds; a second same-day sweep signs nothing; verify then reads no gap and the untouched windows `unmodified` in hot and in archive; a fully expired chain's next checkpoint links to `last_removed_digest`; `modified`, `missing` and `redacted` are still told apart. A second boot: a sound chain expires whole, a chain stops at a checkpoint no trusted key signed, a chain with a gap is kept, each said once; a stored expiry is never resumed over a checkpoint no trusted key signed (no row and no seed it lists is deleted); a chain head never follows an expiry amendment no trusted key signed (review M1). - `audit-seal-expiry-window.test.ts` (new, 7): each chain's window — its organization's own where the windows are set on the chain column, the global one, the longest for a chain of no one organization (review S1) and for every chain where the windows are set on another column (S4); and the `policy_change_log` shape over the sealer itself (declared `tenant_id`, injected `organization_id`, the two values differing): windows on `tenant_id` expire each organization's chain under its own window, windows on `organization_id` keep every row to the longest (S4). - `audit-seal-expiry-admission.test.ts` (new, 14, review 7202871622 M3 and n6, review 7205485052): one pin per check an expiry or the sealer's head makes before it acts — a fresh run's checkpoints bound to the chain and linked, the first linked to the last expiry; a resumed range's checkpoints bound, consecutive, linked, each signature trusted, ending at the amendment's digest, none before its first sequence; a stored expiry bound to the chain; the newest admitted expiry found past more stored ones than one page; and the sealer's head under the same two rules; and a checkpoint whose seed handle names another secret drops nothing but its own row. - `audit-seal-verifier.test.ts` (+2): an amendment stored under another chain is a `chain_key` fault; a checkpoint whose window ends past its honoured range's `covered_to` is judged, not read `expired` (M3). - `audit-seal-sealer.test.ts` (+1): the S4 sole-chain window reads `late` unsealed and `ok` false. - `audit-seal-retention-floor.test.ts` (new, 10, review 7207510869, S7 of 7209130288 and seat rulings 7209154881, 7210805783): over a real `LifecycleService` and the plugin's own registration, an object created at runtime, and one owned under a package id no installed code or marketplace package answers, take no floor and no expiry while a packaged one takes both, and the sealer's expiry answers no run for a runtime object before it resolves a seam; a global and a tenant override below the declared window are rejected and the expiry is asked for the declared window, with both rejections on the sweep report; an override above it still applies and is what the expiry signs; a lengthened declaration is the floor from the next sealer pass on; a lifecycle service without floors gets no expiry; and which windows a sealed object is floored at. - `audit-plugin.test.ts` (+3): the expiry is registered with a crypto provider, unregistered on destroy, not registered without one, and boot survives a lifecycle service without the seam. - Existing pins adjusted for the seal default (not loosened): `packages/cli/src/commands/audit/verify.integration.test.ts` and `verify.ownership-queue.integration.test.ts` now expect `sys_audit_log` beside the fixture ledger in `objects` and in the unreachable-archive message, and case 4 reads that a project with no seal of its own still checks the platform's sealed audit log (exit 0); the four `os migrate audit-*` archive and preview integration files (`audit-mail-bodies.archive`, `audit-key-material.archive`, `audit-side-copies.archive`, `preview-read-only`) pass `--sealer-stopped` on their SQLite `--apply` runs (and `preview-read-only`, now judged by the test-source alias gate's source reach, pays its twelve dynamic imports at module top); the two `os migrate audit-*` dogfood files (`packages/qa/dogfood/test/audit-key-material.dogfood.test.ts`, `audit-mail-bodies.dogfood.test.ts`) pass the same flag on their `--apply` runs; and in plugin-audit, `audit-seal-chain-field-34164.test.ts` passes `archive: () => 'none'` (its boot connects no archive datasource, as `os audit verify` establishes), and `audit-seal-host-seam-resolve-34280.integration.test.ts` forgets what the loop's own first pass reported before each pin counts its own passes. <details><summary>Ablations (each restored, blob == HEAD)</summary> - Verifier S4 arm `|| start <= this.newestSealedWindow()` → `|| false`: the new sole-chain pin goes red (`expected [] to deeply equal [ Array(1) ]`), 1 failed | 57 passed. - Lifecycle routing `if (lc.seal) return this.reapSealed(…)` disabled: 5 of the 9 new lifecycle pins go red. - Archive keep branch `if (lc.seal) {` disabled: the two archive pins go red. - Resume admission (signature check and the last-sequence/digest match) disabled, and the sealer's expiry signature check disabled: the two M1 pins go red, 2 failed | 8 passed. - Reviews 7202871622 and 7205485052, one check at a time (each its own pin red, 1 failed, every other selected pin skipped): the fresh run's binding, link and first link; the resumed range's binding, sequence continuity, link, signature, last digest and first-sequence floor; the stored expiry's binding and paging; the sealer head's binding and paging; the verifier's `chain_key` fault on an amendment and its window bound on an honoured range (15); S4's own-window branch and its longest-elsewhere branch (2); the seed coordinate check (1); review 7207510869: the floor registration, its refresh before each sealer pass, and the no-floors refusal (3); seat ruling 7209154881: the lifecycle routing, the floor and the sealer's expiry each scoped to packaged objects (3); the packaged-metadata predicate's installed-source answer and its default when the registry cannot answer (2). 26 of 26 red. </details> ## Acceptance notes - **Rows are kept, never over-deleted, whenever something is off.** No crypto provider, a one-shot boot, a gap, an untrusted checkpoint, a reap guard veto, or a failing plan all keep the rows. A deployment whose `AuditPlugin` has no crypto provider now keeps `sys_audit_log` rows past `archive.keep` instead of pruning them, says so once per process at `warn`, and its sealer reports the missing provider hourly at `error`. An expiry, once run, deletes for good. - **`os migrate audit-* --apply` on SQLite or Turso now needs `--sealer-stopped`** whenever it rewrites `sys_audit_log`: the 18.6.0 rule for a sealed object (ADR-0154 D3 amended, B, seat ruling 6885005594) now meets every deployment. On Postgres and MySQL every such run now takes the audit seal lock and waits up to ten minutes; dry runs are unchanged. Declared as the narrowing arm with a BREAKING banner and an ADR-0087 marker (review M2). - **The day-aligned cutoff** keeps a row up to one day past its policy, on top of D8's bound, so a drained chain gains at most one expiry amendment a day; amendments are never removed. **10,000 rows a sweep per sealed object**, across its chains; a backlog keeps rows longer, and a cut run continues in the next amendment. Both exceed D8's stated bound in the safe direction; the seat kept them and the add-only ADR-0154 note follows in its own governed PR, beside the skills PR. - **On a sealed object with no `archive`, a retention override cannot shorten the declared window** (review 7207510869, S7 of 7209130288): an override may lengthen it, one below it is rejected at every sweep (`floorViolations`, `error`), and the declared window applies. On an object that archives (`sys_audit_log` among them), an override still sets when rows move to the archive, and `archive.keep` takes no override. - **Signed expiry covers objects whose lifecycle is declared in packaged metadata** (seat ruling 7209154881): an object created at runtime keeps the 18.6.0 row-cutoff retention sweep (its expired rows read as missing), its overrides apply, and it takes no floor. Extending signed expiry to runtime-created objects is a separate card. - **Tenant-scoped retention windows** are set on the object's `organization_id` column, and apply as the seat ruled on S1 and S4: where the windows are set on the chain column an organization's chain expires under its own window; every other chain under the longest of all, never shorter than a window set for a row in it; each amendment signs the value its chain expired under. The cost: on an object whose windows sit on another column than its chain column, a shorter tenant window has no effect on its sealed rows, which are kept to the longest. `sys_audit_log` itself archives, and `keep` has no override. - `os audit verify` on a deployment with no `archive` datasource anywhere already reads the hot store alone (`'none'`); a library caller of `verifyAuditLedger` that composes no archive must now pass `archive` for `sys_audit_log`, as the adjusted test does. - **File surface past the claim:** the two CLI `os audit verify` integration pins, the four CLI `os migrate audit-*` integration files and the two dogfood files above (expectations, the flag and module-top imports only), `content/docs/deployment/production-readiness.mdx`, `content/docs/upgrading.mdx`, the new `audit-seal-expiry-window.test.ts` and `audit-seal-expiry-admission.test.ts`, `seal-store.testkit.ts` (the in-memory store double judges `$lte`), `packages/verify/vitest.config.ts` (one anchored alias the source-alias gate asks for), `scripts/engine-double-contract.pinned.json` and the plugin-audit tenant-audit census page (both regenerated by their own `--write`). Named here for the seat's claim amendment. - The CLI `os serve` composition is unchanged (it already hands its host provider to `AuditPlugin`, P4b). - The `skills/objectstack-data/rules/lifecycle.md` "not built yet" wording follows in this claim's second PR (Tier H, amendment 7193137455); until then this PR is `Part of objectstack-ai#31908`. - **Small decisions:** the seam is `registerExpiryPrefix` as ruled, and its three types now share that stem (`LifecycleExpiryPrefix`, `LifecycleExpiryPrefixRequest`, `LifecycleExpiryPrefixRun`), so a reader finds them beside the method. A chain of no one organization takes the longest window rather than the global one, the safe reading of the S1 ruling. Under S4 no row is read to pick a window (seat ruling on review 7205485052). Stored expiry amendments are read 50 a page until an admitted one answers, in place of the 10-row scans (review minor). The in-memory store double now judges `$lte`, which the expiry's queries use. A resumed range is read 20 checkpoints a page, as a fresh run is; the chain walk never takes a row with no `chain_key` as its key. These last two have no pin of their own: neither changes a result on a store the platform writes. - **Owed before queueing:** the delta contract-review-tier L2 over this head (round 7, after review 7210787318 PASS with S8, S9, n17, n19 and n20 to close), done by the seat. ## Verification Two-minute check: `cd packages/plugins/plugin-audit && pnpm exec vitest run src/audit-seal/audit-seal-expiry-live.integration.test.ts` — expect `Tests 10 passed (10)`. Read first (risk order): `packages/plugins/plugin-audit/src/audit-seal/expiry.ts` (`chainRun`: resume, gap, admission, budget), `packages/objectql/src/lifecycle/lifecycle-service.ts` (`sweepSealed` / `deleteSealedRows`: complete only after every row is gone), `packages/plugins/plugin-audit/src/audit-seal/sealer.ts` (`expire`: locks around planning; the head fallback). <details><summary>Local runs at ff14eb2 (each under os-verify-lock, exit captured before any pipe)</summary> - `pnpm turbo run build` over spec, objectql, plugin-audit and verify: exit 0. - plugin-audit full: Tests 1879 passed (1879), exit 0. - objectql full: Tests 14449 passed (14449), exit 0. - verify full: Tests 503 passed (503), exit 0. - cli `src/commands/audit/`, `serve-audit-registration.contract`, `app-audit-plugin-host-crypto`, `schema-migrate.one-shot-family.integration`: Tests 221 passed (221), exit 0. - `tsc --noEmit` of plugin-audit (with its test-typecheck layer) and objectql, and `eslint` on the changed sources: exit 0. - `gen:schema && gen:docs` regenerated `content/docs/references/data/object.mdx`. - `dispatch-gates --commands`: 142 derived, 141 exit 0. One NOT MEASURED: `check-plugin-teardown-shape --self-test` exits 3, PREREQUISITE NOT MET (needs an unshallow clone). - dogfood_battery at ff14eb2: `turbo run build --filter='@objectstack/dogfood^...'` 73 of 73 tasks, then `pnpm --filter @objectstack/dogfood test`: Test Files 488 passed | 3 skipped (491), Tests 4135 passed | 68 skipped (4203), exit 0. - Ablations at ff14eb2: 26 single-check ablations, each its own pin red, each file restored byte for byte. - `overlap-check` at ff14eb2: merges cleanly with origin/main c826e8a and the PR heads sharing `content/docs/deployment/cli.mdx` (objectstack-ai#37807, objectstack-ai#37366). - Earlier heads: 51ba1c1, 5860216, 4deab94, 46e272e (review 7198128323), 48e81f3 and c05884d (review 7202871622; CI green), 65a5d7d (reviews 7205485052 and 7207510869; CI green), 71bb12a (review 7209130288; CI green), 05e6a57 (review 7210787318; CI green). </details> --- _Generated by [Claude Code](https://claude.ai/code/session_01L6bhgUd6hon2o34LQSLbZt)_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01L6bhgUd6hon2o34LQSLbZt <!-- signed: repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA --> --------- Co-authored-by: Claude <noreply@anthropic.com>
…a type with its loader, its registry and two authoring guards (objectstack-ai#37676) <!-- claude-projects-attribution: {"github_login":"os-bill"} --> _Requested by **Bill** · [project thread](https://claude.ai/code/project/chan_016iMXWSZDzqWRWvWzdNo8wg?thread=cmsg_016iMXWSZDzqWRWvWzdNo8wgHittdG1nUD4Ne4ozfqAXgk)_ Fixes objectstack-ai#37304 Clause-②: yes (narrowing) Metadata-protocol: narrowed Skills-docs: follow-up objectstack-ai#37310 ## 维护者速读 - 用户能看到什么变化:知识源成为一种正式的应用配置,可以随应用一起发布,也可以在 Studio 里新建和修改;保存后平台自动建立、更新或清除对应的检索索引。旧写法升级时会被明确拒绝,迁移命令会列出每一处要改的地方。 - 为什么做:属于“知识检索平台化”专题,让应用写一份知识源配置就有可用的检索,并且谁能建知识源、能索引哪些数据都有人管。 - 出错会怎样:只影响用到知识检索的应用。旧配置没迁移时会报出要改的位置,不会悄悄丢数据或建错索引;新增的“管理知识源”权限默认只有平台管理员有;回退本改动即可恢复原状。 - 要你做什么:批准一次。这是一次不兼容的协议收紧,改了两份对外技能文件(各一两行),改动量也超过三千行,按规则要你批准后才能合并。 ## What changes **New metadata type: `knowledge_source`.** Registered in the metadata type registry with the one schema `KnowledgeSourceSchema`; a stack carries its sources in the new top-level collection `knowledgeSources` (`*.knowledge-source.ts` or `.yml`). An item can be created and changed at run time (Studio, MCP) and takes no environment overlay. Studio's menu lists the type under AI, and ADR-0084's type table carries its row. **New platform capability: `manage_knowledge_sources`.** Platform administrators hold it by default. Nothing else grants it. - **The schema is strict.** An undeclared key is refused. `id` becomes `name`, `source.contentFields` becomes `source.content`, a non-empty list of field names; `'*'` is refused with the instruction to list the fields, and an empty-string member is refused too (it names no field). `embedding`, `vectorStore`, `adapterConfig`, `refresh.cron` and the `file` / `http` source kinds are retired with their ADR-0087 entries (three conversions, six retired keys, six retired defs, four semantic entries on protocol 19). `os migrate meta --from 18` lists every edit and `--write` applies the ones it can prove. - **The loader** (`service-knowledge`, `knowledge-source-loader.ts`). `KnowledgeServicePlugin` reads the published items when it starts and follows the type while it runs: an added source is registered and built when a build is due; a changed one is registered again (a changed `where` or `metadataFields` rebuilds inside the generation, a changed `content` or `split` builds a new one); a removed one is unregistered and its index dropped. The reap guard's object set follows the sources. - **The registry** (`knowledge-source-registry.ts`), under the maintainer's rulings on this card (record 7192063608, forks 6 and 4d, both A). A source is held by `(package, name)`. A source registered in code belongs to no package; it shares one slot with an environment-authored item of the same name, and the second of the two to arrive is refused `409 RESOURCE_CONFLICT`, naming both doors. A package's source of the same name is a second source. Code names a source by its face: the bare name for the package-less one, `NAMESPACE-NAME` for a package's; a bare name several sources answer to is refused `409`, naming the candidates. `search` hits carry the face as `sourceId`. No `IKnowledgeService` signature changes for addressing. - **`IKnowledgeAdapter.dropSource?(ctx)`**, implemented by `knowledge-memory`, `knowledge-pgvector` and `knowledge-turso`; the contract suite (`@objectstack/service-knowledge/testing`) takes `implements.dropSource`. An adapter reads the source's index key from `ctx.source.name` (it was `ctx.source.id`): the bare name for a package-less source, so an existing index is found under the same key and nothing is rebuilt. - **Guard one: the capability.** A write of a `knowledge_source` through `/meta` (REST and the dispatcher: save, publish, rollback, delete) and through the MCP draft door needs `manage_knowledge_sources` beside `manage_metadata`: `403 PERMISSION_DENIED` naming the capability, `401` for an anonymous caller. It is one row in the existing per-type table `META_TYPE_WRITE_CAPABILITIES` (`packages/rest/src/meta-item-read-gate.ts`), so the three doors that already ask that table ask it for this type too. The package doors ask it as well (maintainer's ruling A, record 7207325373 on objectstack-ai#37304): each of the twelve doors that write an existing package (enable, disable, publish, publish-drafts, discard-drafts, the commit revert, rollback, revert, adopt-orphans, duplicate, the manifest update, delete) refuses a caller without the capability `403` when the package holds a knowledge source: an item, a pending draft, or, for the commit revert and the rollback, a commit that touched one. A package that holds none is written as before; a holding that cannot be read refuses `503`. Two doors are not asked, see Acceptance notes. - **Guard two: source admission at save.** The same doors save a source only when its author may themselves search what it would index: an object of a disabled package, an object the API does not serve for `search`, a system object without `enable.aiReadable`, or a field the author may not query refuses the save `403`, naming the object or the field; a verdict that cannot be reached refuses `503`. The fields a source's `where` reads are judged with the fields it serves, at save and at search. A knowledge service that is registered and cannot be resolved refuses the save `503` at every door (REST, the dispatcher, MCP). The duplicate door admits each knowledge source it would copy for the caller before anything is copied, and refuses the whole copy when one is refused. Over MCP the human is judged. - **The push door leaves.** `IKnowledgeService.indexDocument` and `deleteDocument` are removed with the `file` / `http` branches that served them. - **Removed exports**, twelve names from `@objectstack/spec/ai`. The `embedding` module: `EmbeddingModelSchema`, `VectorStoreSchema`, `VectorStoreProviderSchema` and the types `EmbeddingModel`, `VectorStore`, `VectorStoreProvider` (the knowledge source was their only composer). The retired source kinds: `FileKnowledgeSourceSchema`, `HttpKnowledgeSourceSchema`, `KnowledgeSourceKindSchema` and the types `FileKnowledgeSource`, `HttpKnowledgeSource`, `KnowledgeSourceKind`. The changeset lists the same twelve. - **Boot notice** (`packages/objectql`). A deployment that holds `knowledge_source` items and mounts no knowledge service says so once at boot, at warn, naming the items; it is not a boot refusal. - **CLI.** `os knowledge status` prints the package that holds a source and no longer a source kind. - **Showcase.** `examples/app-showcase` ships `showcase_task_notes` (object `showcase_task`, adapter `memory`) and mounts the knowledge service and the memory store. - **Docs.** `content/docs/protocol/knowledge.mdx` and `content/docs/ai/knowledge-rag.mdx` describe the type, the loader, who may author a source, and one name per source; the generated references follow. - **Skills (Tier H), enumeration row only**, under ruling A on objectstack-ai#32584: `knowledgeSources` joins the top-level key list in `skills/objectstack-platform/SKILL.md`. `skills/objectstack-ai/SKILL.md`'s compiled `supportKb` example changes two keys (`id` to `name`, `contentFields` to `content`) because the old spelling is now refused at parse. Teaching the type (prose, tables, evals) rides objectstack-ai#37310. - **One ceiling, raised by the row's measured delta and by no more** (`scripts/check-skills-token-ratchet.mjs`): `skills/objectstack-platform/SKILL.md` was at zero headroom (24603 priced bytes, 6151 tokens, after objectstack-ai#37442's row); the `knowledgeSources` row adds 20 bytes, so the priced text is 24623 bytes, 6156 tokens, and the ceiling moves 6151 to 6156, pinned at the measurement. Nothing else in the file is cut and nothing rides along. `skills/objectstack-ai/SKILL.md` stays at 6799 tokens under its ceiling of 6801. - **The two rulings the raise path names**, quoted: - Ruling A on objectstack-ai#32584 (record 6819475461): "a product PR that adds an authorable `defineStack()` top-level key, or a live member of a schema symbol bound to a registered exhaustive skills section, carries the matching skills enumeration row in the same PR. Only that row; prose, examples and evals still go to the skills sub-card." - objectstack-ai#32673 letter A (record 6840575378): "a PR that adds a metadata key and, under ruling A on objectstack-ai#32584, carries the matching enumeration row in a published skill may raise that skill file's token cap by the row's measured delta, and by no more. The PR body cites ruling A and this ruling. Nothing else in the file is cut to make room, and no wider raise rides along." ## Tests - `packages/spec/src/ai/knowledge-source.test.ts`: the strict schema, `'*'` refused, an empty-string member refused (and `minLength: 1` in the JSON Schema), every retired key answered with its prescription. - `packages/services/service-knowledge/src/__tests__/knowledge-source-registry.test.ts` (new): the slot rules above, both orders of arrival at each door, face resolution and the `409` with its candidates. - `.../knowledge-source-loader.test.ts` (new): boot read, add, change (each of the two rebuild arms), remove with `dropSource`, an adapter without `dropSource`, the reap guard following the sources. - `.../knowledge-source-admission.test.ts`: each refusal of guard two and its fail-closed `503`; the fields `where` reads (keys, `$and` / `$or` / `$not`, `{ $field }` comparands) judged at save and at search. - The adapter contract suite with `dropSource: true` in `knowledge-memory` and `knowledge-turso`; `knowledge-pgvector` declares it in `contract.live-postgres.test.ts` (see Remaining). - `packages/rest/src/meta-type-write-capability.test.ts`: every write shape of a `knowledge_source` for a caller with `manage_metadata` alone, with `manage_platform_settings`, and with a record grant: `403 PERMISSION_DENIED`, store unchanged, no protocol call; a holder of both saves, publishes, rolls back and resets; the capability without `manage_metadata` is refused by the door's own admission. - `packages/rest/src/meta-write-door-capability-enumeration.test.ts`, `packages/runtime/src/domains/meta-save-capability-gate.test.ts`, `packages/runtime/src/domains/mcp-authoring.test.ts`: guard two at REST, the dispatcher and the MCP save door (the human is judged); on a real kernel, a knowledge service whose factory throws answers `503` at the dispatcher and at MCP, and one never registered is not asked. - `packages/runtime/src/domains/meta-type-write-capability-parity.test.ts`: REST and the dispatcher answer the same for the new row. - `packages/runtime/src/domains/packages-knowledge-source-gate.test.ts` (new): each of the twelve package doors refuses a `manage_metadata`-only caller when the package holds a source (item or draft) and the writer never runs; a holder goes on with no listing read; a package with none answers as before; a listing that throws refuses `503`; the engine's own call is not asked; the commit revert and the rollback read the timeline; the duplicate door's admission of each copied source; a host with no metadata store holds none; the install door and the ensure-customization door are not asked. - `packages/runtime/src/domains/packages-ensure-customization.test.ts`: a base that holds a knowledge source (a registered item and a stored row) gets a pair that holds none, and the door writes one manifest and no row. - `packages/objectql/src/knowledge-source-unserved.test.ts` (new): the boot notice. - `packages/metadata-core/src/knowledge-source-save-admission.test.ts` (new): the admission seam. ## Acceptance notes - **Governed (Tier H) and over 3000 changed lines**: draft until the maintainer's approval. The diff touches `skills/**` and declares a narrowing. - **Rulings this PR implements**: record 7192063608 on objectstack-ai#37304 (forks 6 and 4d, both A); earlier on the same card Q1 = B (the type sits in ADR-0150's bucket 3) and Q2 = B (`manage_knowledge_sources` beside `manage_metadata`, platform administrators only); and ruling A of 2026-11-27 (record 7207325373): every write door of an existing package asks the capability when the package holds a knowledge source, and install stays unasked. The ADR-0150 rows ride objectstack-ai#37545. One ADR line is edited here, with the zone's approval (claim comment 7203310811 on objectstack-ai#37304, amended by 7204020473): ADR-0084's type table gains the `knowledge_source` row its item 6 prescribes for a type registered after the ruling (AI, `ai`, 5, 高级), spelled as the `ai_context` row is. Nothing else under `docs/adr/**` changes. - **The loader's signal** is `protocol.onMetadataMutation` (a save, a publish, a delete, a revert) plus the `metadata:reloaded` hook (a package published, installed or removed, a dev reload), not `metadataService.subscribe`. After either it reads the published set again and reconciles, so a missed event is repaired by the next one. - **Guard two is not asked where no knowledge service is mounted** (there is nothing to ask, and the item is inert there), nor for a system write. - **Two package doors are not asked the new capability (limits).** The install door (`POST /packages`): a package's source arrives by that door's own admission, as the ruling leaves it. The ensure-customization door (`POST /packages/:id/ensure-customization`): it writes nothing of the base and creates an empty pair, so it creates, changes and removes no knowledge source; the seat confirmed this reading on the condition that the pair holds no source, which `packages-ensure-customization.test.ts` pins. - **The package gate reads before it answers.** For a caller without the capability the twelve doors read the package's drafts and items (and its commits, for the two timeline verbs) before the door's own request checks. A host with no metadata store at all (the table was never created, or the engine holds no `sys_metadata` object) reads as holding none, by the same rule the protocol's overlay reads use; any other failed read refuses `503`. - **The read-side author exemption** stays keyed on `manage_metadata`. - **A bare name two sources answer to** is refused `409` at the call that names it (`resolveSourceRef`), listing the candidates; both sources register. Where the host cannot place a package's namespace, the package's face is its bare name, and that name answers `409` for both sources until the package is placed. - **The four narrowings the ADR-0150 addendum asks this card to declare, each counted on this tree**: the install refusal inside a namespace (two packages of one namespace holding a source of one name): 0. The name grammar (a source whose name the grammar refuses): 0. The `409` for a bare name two packages hold: 0. The package-less row under a name a package holds: 0. The tree holds one knowledge source, `showcase_task_notes` (`examples/app-showcase/src/ai/task-notes.knowledge-source.ts`), and no first-party code registers one through the plugin door. - **`KnowledgeIndexStatusEntry.kind` is removed** with the source kinds; `packageId` is added. - **One ADR-0087 marker.** The gate allows exactly one marker per breaking changeset, so the changeset carries `registered …` and names `indexDocument` / `deleteDocument` in prose: they are runtime-interface members with no metadata form, and the compiler reports each call (`TS2339`). - **The boot notice adds one boot read** of `knowledge_source` rows on a kernel that does not hydrate from its database; it registers nothing (`plugin.integration.test.ts` pins the permitted reads and now names this one). - **pgvector `dropSource` and a concurrent build in another process**: the drop retires the active and the building generation in one transaction but does not hold the builder lock across it, so a build already running in another process could still write its generation afterwards. Not changed here; it is a candidate follow-up. - **objectstack-ai#37479 (unregistered adapter) is not folded in.** The loader runs after publish, so it is not a refusal point for publish; objectstack-ai#37442 adds the coded refusal for an unmounted adapter. - **The showcase mounts the two plugins by hand** rather than declaring `requires: ['knowledge']` (objectstack-ai#37442): the token mounts a libSQL or pgvector store, which needs a configured embedder, and the demo runs on the in-memory store with none. A host that mounts the service itself keeps its own, as objectstack-ai#37442 specifies. - **Merged with `main` three times** (no rebase). The first merge (at `45ed022b`) followed objectstack-ai#37442, objectstack-ai#37570 and objectstack-ai#37578: four textual conflicts (the migration registry template, the CLI knowledge test fixture, the pgvector adapter's search refusal, the knowledge service's reindex chain and unmounted-adapter refusal). Code and fixtures those PRs wrote against the 18 source shape follow the 19 shape here: `source.id` is `source.name`, `contentFields` is `content`, `reportUnmountedAdapters` names a source by its face, and the unmounted-adapter index test calls `reindexSource` now that `indexDocument` is gone. The second merge (at `c2bfa3ef7`) was forced by a conflict: `main` had gained its own protocol 19 conversion (`permission-view-all-fields-beside-record-bypass`), so the conversion registry, the migration registry template and the retired-key pin now carry both sets, sorted as the registry sorts them; `packages/spec/authorable-surface/ai.json` was merged three ways by hand so that this PR's removals and `main`'s new `ai/Skill:context` both stand; every generated spec surface was regenerated afterwards. The third merge (at `8b9b9d235`) was forced by objectstack-ai#37723, which moved the ADR-0150 D3 rule into `packages/metadata-core/src/package-scoped-resolution.ts`: `core`'s file is taken from `main` (a re-export) and the `knowledge_source` row with its comment sits in `metadata-core`'s `PACKAGE_SCOPED_TYPES`; `default-changes.ts` keeps both protocol 19 entries (`main`'s `ai/AIModelConfig:provider` and this PR's `ai/KnowledgeSource:refresh`); the Studio menu placement pin takes `main`'s move of `position` and keeps this PR's row. The merge is its own commit and `packages/spec/authorable-defaults/ai.json` was regenerated in the next one (`737f44341`). - **The declared default of `ai/KnowledgeSource:refresh`** sits under major 19 in `default-changes.ts` (no parsed value changes: the published JSON Schema now states the `{}` the parser always applied). - **Enumeration pins found by CI, not by the first local pass.** The first head was verified on the packages the change edits. CI then failed on tests in packages it does not edit, each a list that counts metadata types or the platform administrator's capabilities: the owner-stamp boot fixture and the unbundled-type list (`packages/metadata`), the tier list (`packages/metadata-protocol`), the type-label counts (`packages/platform-objects`), four golden grant lists (`packages/plugins/plugin-security`), and the generated `zh-Hant` locale. Each gained the one entry; no product code changed for them. The suites of those packages and the workspace type check now run locally as well (see Verification). - **Review round 1.** The contract review on `45ed21271` (comment 7206413701) read PASS with findings, and the seat ordered a rework (7206423476). This head answers it: authoring guards cover more doors and more of what a source reads (the package doors, the duplicate door, the fields `where` reads, the service lookup at the dispatcher and at MCP), the `content` member refuses the empty string, the changeset lists the twelve removed exports, and this body is corrected on the face collision and states the narrowing counts. The findings' detail is with the seat. Two nits are carried by cards the zone files under objectstack-ai#37304 (ADR-0084 prose; tombstone wording for code-door registrants). - **Existing tests edited outside the card's first surface** (claim amended by the zone, comment 7207505784 on objectstack-ai#37304), each because a package door now reads the package for a caller without the capability: - `packages-publish-drafts-request-conformance.test.ts`: the real-protocol case's caller also holds `manage_knowledge_sources` (its engine is one nothing may touch; the case pins the protocol's own order). Assertions unchanged. - `packages-publish-drafts-probe-caller-context.test.ts`: the protocol double gains a `getMetaItemsPerPackage` stub beside its `getMetaItems` stub. Assertions unchanged. - `package-state-host-store.test.ts` (a kernel with no driver) and `domains/error-passthrough.test.ts` (a protocol double that throws from every member): the caller also holds `manage_knowledge_sources`. Assertions unchanged. - `packages-ensure-customization.test.ts`, "duplicate: 400 before a row is read": **the measure changes.** The door now reads the source package's knowledge sources to admit them before the copy runs, so the case counts the reads made inside `protocol.duplicatePackage` (still 0) instead of every engine read; it also asserts the copy was entered once. - **Open PRs that will conflict with this one** (overlap-check on this head against 12 open PR heads; `main` itself merges cleanly): objectstack-ai#37422 (the generated references and `scripts/check-skills-token-ratchet.mjs`: whichever lands second re-measures the row), objectstack-ai#37366 (`packages/spec/export-origins/ai.json`). Whichever of each pair lands second merges `main`. ## Verification First files to read, by risk: 1. `packages/services/service-knowledge/src/knowledge-source-registry.ts`: the slot and face rules. 2. `packages/services/service-knowledge/src/knowledge-source-loader.ts`: what each metadata event does to an index. 3. `packages/rest/src/meta-item-read-gate.ts` (`META_TYPE_WRITE_CAPABILITIES`) and `packages/metadata-core/src/knowledge-source-save-admission.ts`: the two guards. 4. `packages/runtime/src/domains/packages.ts` (`refuseKnowledgeSourcePackageWrite`, `refuseDuplicatedKnowledgeSources`): the guards at the package doors. Two-minute check: `pnpm --filter @objectstack/service-knowledge exec vitest run --maxWorkers=2 src/__tests__/knowledge-source-registry.test.ts src/__tests__/knowledge-source-loader.test.ts`. Head `cf128e59f` (review round 1). Verified so far on this head, locally, every heavy run under `scripts/pm/os-verify-lock.sh`: build exit 0; `@objectstack/runtime` full suite exit 0 (657 files, 13676 passed, 25 skipped); `@objectstack/metadata-core` and `@objectstack/core` exit 0; `tsc --noEmit` on `packages/runtime` exit 0. Running now on the same head, and written here when they end: the other package suites, the workspace type check, the derived gates, the full dogfood battery and the ablations. CI on this head is in progress. The previous head's readings (`45ed21271`: 62 check runs green, 185 gates, the dogfood battery, six ablations) are in the os-dev report, comment 7206197293 on objectstack-ai#37304. <details><summary>Skills readings (the diff touches <code>skills/**</code>)</summary> | | Lines before | Lines after | Tokens before | Tokens after | |---|---|---|---|---| | `skills/objectstack-platform/SKILL.md` | 421 | 421 | 6151 | 6156 (ceiling 6156) | | `skills/objectstack-ai/SKILL.md` | 486 | 486 | 6799 | 6799 (ceiling 6801) | | All `SKILL.md` files together | 4961 | 4961 | | | | Ratcheted (authored) bundle | | | 199660 | 199665 (ceiling 204478) | `skills/objectstack-ai/references/_index.md` is generator-owned (53 lines to 52: the embedding module's row leaves, the knowledge source's row is reworded) and is measured, not ratcheted. "Before" is `main` at the third merge (`8b9b9d235`), read with the same script; the bundle's before figure is this tree's reading less the row's 5 tokens. </details> ## Remaining - The same reviewer's read of the round 1 delta (`45ed21271..cf128e5`), then the seat's hand-off. - `knowledge-pgvector`'s `dropSource` contract cases have not run anywhere yet: there is no pgvector in the build container, and the job with a PostgreSQL service does not run on `pull_request`. Their first run is the merge queue. ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic. - [x] 2. Every name I added uses the casing for its kind. - [x] 3. No formatter ran; `pnpm lint` passes. - [x] 4. One issue, one branch off an up-to-date `main`, one pull request. - [x] 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset. - [x] 6. `packages/spec` touched: its generated artifacts are regenerated and committed. - [x] 7. No hand edits to `content/docs/references/`, `packages/*/CHANGELOG.md` or `content/docs/releases/`. - [x] 8. Title, body and comments are in English. - [x] The *Before Submitting* list in CONTRIBUTING.md is done. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01Utp6CZe3KTAXogcUJuvYEx <!-- signed: repo:objectstack#5 · os-bill · session_01Utp6CZe3KTAXogcUJuvYEx --> --------- Co-authored-by: Claude <noreply@anthropic.com>
… move from step 18 to step 19, so `os migrate meta --from 18` shows them (objectstack-ai#38239) repo:objectstack#3 · os-tesla · session_01L9qibvcTXi4hWgjz8G8ium <!-- claude-projects-attribution: {"github_login":"os-tesla"} --> _Requested by **Tesla** · [project thread](https://claude.ai/code/project/chan_01AXsQkLFKRdQCqQ3RTr6Jao?thread=cmsg_01AXsQkLFKRdQCqQ3RTr6JaoT8rr3zveNwye1npfS2EynC)_ Fixes objectstack-ai#38142 Clause-②: no Metadata-protocol: none ## 维护者速读 - 从 18 升级到 19 的作者,以前在升级提示里看不到三条变化(表单工具改名、表单类型、发布时拒收存不住的数据模型字段),现在这三条会列在 18 → 19 的升级提示里。 - 修正第 19 版升级说明,替用升级命令从 18.x 升上来的团队补上漏掉的提示。 - 只是把三条说明挪到正确的大版本下,内容一字不改,不碰任何数据或配置;出错也只是提示位置不对,可以直接撤回。 - 无 ## What changes - Three ADR-0087 semantic entries move from protocol major 18 to 19: `semantic/18.ID.ts` becomes `semantic/19.ID.ts` for `define-form-studio-helper-renamed-define-metadata-form`, `form-type-define-form-and-packageless-list-at-form-name` (both from objectstack-ai#37366) and `publish-refuses-data-model-fields-that-save-and-do-not-work` (from objectstack-ai#37513). The ids and the file contents are unchanged (pure renames, 100% similarity). - Why 19: `gen:migration-registry` files an entry by its filename's major, and `composeMigrationChain(fromMajor)` keeps only the steps above `fromMajor` (`packages/spec/src/migrations/chain.ts:42`). All three were added after `PROTOCOL_VERSION` moved to 19 (`204356a6e`, objectstack-ai#37314). None is in `@objectstack/spec@18.6.0`, the last 18.x release; objectstack-ai#37513 first shipped in `19.0.0-next.0`, objectstack-ai#37366 in `19.0.0-next.2` (tag ancestry). Filed under 18, they were skipped by exactly the 18 → 19 upgrade they describe. - `form-type-…` still follows `define-form-…` in id order, so its "since the previous entry" sentence still reads right. - The id-keyed `adr-0087: registered` markers in `.changeset/pre/*` and the released CHANGELOGs stay valid and are not edited. - One `@objectstack/spec` patch changeset. The registry, `spec-changes.json` and the upgrade guide are generated and not committed, so nothing else changes in the diff. ## Tests No test file changes: the pins that read the chain (`semantic-relevance.test.ts`, `migrations.test.ts`) read the generated step lists, not counts or ids for these entries. The before/after readings below are probes against the generated registry, kept in the project, not in this PR. <details><summary>Readings (head fc06c4d, base origin/main 23fa361)</summary> Generated registry and `composeMigrationChain(18)`: | | step 18 semantic | step 19 semantic | chain `--from 18` lists the three | |:--|:--|:--|:--| | before (main) | 582, holds all three | 21, holds none | MISSING ×3 | | after (this branch) | 579 | 24, holds all three | LISTED ×3 | `applyMetaMigrations(stack, 18)` on a minimal stack: before, `todos=21`, all three NOT LISTED; after, `todos=24`, all three are `todos`. Local runs at fc06c4d: - `pnpm exec turbo run build --filter='./packages/**' --filter='@objectstack/dogfood^...'` under `os-verify-lock`: command-exit 0. - `pnpm --filter @objectstack/spec typecheck`: command-exit 0. - `pnpm --filter @objectstack/spec test`: `Test Files 911 passed (911)`, `Tests 28851 passed | 1 todo (28852)`. - Derived gates (`dispatch-gates.mjs --commands`): 83 run, each exit 0; `--ran` reconciles 83 derived, 83 run, 0 NOT MEASURED (a derived zero: every line records its exit code). - `overlap-check.mjs` before the first push: merges cleanly with origin/main, 0 open PR heads overlap. </details> ## Acceptance notes - **Should `check-adr-0087-registration` read the major?** Not built here (claim). The measured answer: in the window the per-entry files exist (`f293d454b`, 2026-08-10, to origin/main `23fa3619`), every entry added landed at or above the protocol major of its day, except these three. - Protocol 17 (to `4e9fe9ff6`, the 17 → 18 bump): 50 added under 17 and 717 under 18 (the next major, filed before the bump), 0 below 17. The one explicit backfill in the window (`5823d593db`, "backfill nine ADR-0087 ledger entries missing from the v17 stock") landed under 17, equal to the protocol major then. - Protocol 18 (to `204356a6e`, the 18 → 19 bump): 345 under 18, 0 below. The bump commit itself added one entry under 19. - Protocol 19 (since): 33 under 19, 3 under 18. Those 3 are this card's, renamed here. - So a rule "a newly added entry's major is equal to `PROTOCOL_MAJOR` or above it" would have fired on exactly these three in about 1,150 additions, and on no backfill. "Equal to `PROTOCOL_MAJOR`" would have been wrong: it refuses the 717 entries filed ahead of the 17 → 18 bump. The gate already reads the paths of the entries a diff adds, so the check would close a blind spot of an existing gate rather than add a new one. A later backfill below the current major would still need a named exemption. Whether to file the card is the seat's decision. - Reach, corrected by the contract review (comment 7237861973): that reading measures the protocol move, not the release. 34 more `semantic/18.*` entries were added between `spec@18.6.0` (`958ee0359`) and the move, ship in no 18.x release, and are skipped by `--from 18` the same way; each was filed while `PROTOCOL_MAJOR` read 18, so the at-or-above rule would not have refused them. They are outside this PR's claim; the carrier is the seat's. - Releases already out: `19.0.0-next.0` and `next.2` carry these entries under 18, so `os migrate meta --from 18` on those prereleases still skips them. The fix ships with the next prerelease. No released text is edited (AGENTS.md: CHANGELOGs are release-owned). ## Verification Read first (by risk): 1. The three renames: `git diff --stat -M origin/main...HEAD` shows `R100` for each. 2. The changeset. Two-minute check: in `packages/spec`, `pnpm gen:migration-registry` and then `grep -n "publish-refuses-data-model-fields-that-save-and-do-not-work" src/migrations/registry.ts`. On this branch the id sits inside the `semantic:19` region; on main it sits inside `semantic:18`. --- _Generated by [Claude Code](https://claude.ai/code/session_01L9qibvcTXi4hWgjz8G8ium)_ Co-authored-by: Claude <noreply@anthropic.com>
…ut of step with main (week of 2026-11-25) (objectstack-ai#38289) <!-- claude-projects-attribution: {"github_login":"os-elon-musk"} --> _Requested by **Elon** · [project thread](https://claude.ai/code/project/chan_01WedDzV26nniwxv7jC88B9D?thread=cmsg_01WedDzV26nniwxv7jC88B9DDypKu7B9nwbu5WuV7AEio8)_ Fixes objectstack-ai#37245 Clause-②: no Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:用户无感;只在十份设计记录里补了带日期的说明,写明主线现在实际怎么做,原有的决定文字一个字没动。 - 为什么做:属于「每周设计记录修订」滚动清单(11 月 25 日这一周);清单每一行指出一处「记录写的和主线不一致」,这次一并补齐,免得照着记录干活的人被过时说法带偏。 - 出错会怎样:最坏是某条补充说明写得不准,读这些设计记录的人会碰到;纯文档、只增不删,可以直接撤回,不影响任何功能。 - 要你做什么:请审这些补充说明并亲手合并(设计记录须由你本人合)。 ## What changes Ten ADR files gain notes dated 2026-11-28. Every diff line is an addition: 239 lines added, 0 removed. No original decision text is rewritten, and no decision changes. Each note follows the note convention its own record already uses. Each row's "what is true now" was read against the code on `main` before it was written. Where a row was wrong or had gone stale, the note says what `main` does, and the table and the list under it say so. | Row (comment id on the card) | ADR and section | Result | |:---|:---|:---| | Card body row (from objectstack-ai#37238) | ADR-0146, the 2026-11-24 amendment, "32 registered types" | **Landed. Row stale.** The row asks for 33; the registry holds 35 entries on `main`. The note states no count and points at the registry and at ADR-0084's table. | | 7155511307, nit 1 | ADR-0160 D1, the door's page cap sentence | **Landed. Row stale.** The row says the door has no page cap. PR objectstack-ai#37354 added one. The note says what `main` does: the list is cut one row under the door's cap, not at it. | | 7155511307, nit 2 | ADR-0160 D1, "only contains braces" | **Landed** as the row asks. | | 7155511307, nit 3 | ADR-0160 D3, the link-field sentence | **Landed as a note that the sentence stands.** | | 7161785832 | ADR-0158, Open items 9 and 12 | **Landed.** | | 7178404228, anchor half | ADR-0066, line 146 | **No edit.** PR objectstack-ai#37621 already landed it (record 7198334624). | | 7178404228, end-state half, with 7201928772 | ADR-0066 D2 ⑧ | **Landed.** Its prerequisite, PR objectstack-ai#37371, is merged. The proposed text is tightened in two places, listed below. | | 7179515770 | ADR-0158 U3, U6, L4, Open item 10 | **Landed.** | | 7184833647 | ADR-0159, Context, "One name already taken" (line 109) | **Landed as a note. The anchor line is untouched.** This is not a no-edit row: the anchor resolves, onto the opposite meaning. See below. | | 7187445064 | ADR-0158 L1, L2, Open items 6, 8, 10 and 11, and a new Open item 13 | **Landed.** | | 7195437501 | ADR-0010, the amendment note of 2026-11-24 | **Landed**, with one arm `main` has gained since the row was written. See below. | | 7212321297, first row | ADR-0067 D3 | **Landed. Row wording wrong.** The note carries the revert rule that the `form` type brought. See below. | | 7212321297, second row | ADR-0160, implementation split, row 7's bullet | **Landed.** The row places the stale path near line 425; it is near line 491. | | 7213085888 | ADR-0048 §3.5 | **Landed.** The row's ready text, dated 2026-11-28, with symbol anchors where it had line numbers. | | 7215202653, corrected by 7215223685, with 7224476684 | ADR-0150 D3, the note of 2026-11-26 | **Landed.** Item 2 of the first row said the two doors were still open. The later row supersedes it: PR objectstack-ai#37948 merged, and both doors now refuse. | | 7217585102 | ui ADR-0057, A2 and A3 | **Landed. Row stale on one line.** The plan-marker line is written as `main` is today, after PR objectstack-ai#37970, and not only as it was after PR objectstack-ai#37720. | Comments that are not rows: 7186949648 (triage note), 7196224618 (a one-row claim), 7196910014 (its report), 7198334624 (its landing record) and 7237786310 (this claim). **No row is held.** Every prerequisite is merged on `main`: PRs objectstack-ai#37219, objectstack-ai#37240, objectstack-ai#37268, objectstack-ai#37354, objectstack-ai#37366 (which carried objectstack-ai#37422), objectstack-ai#37371, objectstack-ai#37389, objectstack-ai#37423, objectstack-ai#37449, objectstack-ai#37640, objectstack-ai#37720, objectstack-ai#37818, objectstack-ai#37931, objectstack-ai#37948, objectstack-ai#37970, objectstack-ai#37065, objectstack-ai#36138 and objectstack-ai#37021. The card has 19 comments as of this pull request; a row added after comment 7237786310 is not in it. ### Where a note differs from its row - **ADR-0146.** The row offers two forms, "give the count" or "point to ADR-0084's table". The note takes the second. A count written today would already be the third reading (32, then 33, now 35). - **ADR-0160 D1, the page cap.** The row's premise was true when it was written and is not now. `RecordContextDoor.pageCap` exists, and both doors answer it. The note records the one-row difference between the amendment's words and the code: a list whose cut plus its probe row would pass the cap is cut one row under the cap. - **ADR-0160 D3, the link field.** The note leaves the wording alone. - **ADR-0066 D2 ⑧.** Two changes to the proposed text. The note says in words that `viewAllFieldsReadVote` replaced `superuserFieldVote`, and anchors only the function that exists. And it does not say that nothing re-opens a lock across sets: another set's `viewAllFields` still makes a hidden field readable, and another set's field row with `editable: true` still grants the edit, because field grants union without deny. - **ADR-0159, line 109.** PR objectstack-ai#37422 was merged into PR objectstack-ai#37366's branch, so the anchor `view.zod.ts#defineForm` resolves and the gate is green on it. It now resolves onto the `form` type's factory, while the paragraph describes the Studio helper, which is `defineMetadataForm` today. The paragraph is Context and describes the tree before the ruling was carried out, so the note leaves it as written and states both names. - **ADR-0010.** The row covers the three restore doors of PR objectstack-ai#37423. The same rule has since gained a second refusal, from PR objectstack-ai#37640: a restore that would write a version the platform registered into a package's row. The note has one sentence on it. That sentence goes beyond the row; cut it if the note should carry the row alone. - **ADR-0067 D3.** The row asks for a note "naming `form` as a translated metadata type". D3 is about undo granularity and has no such notion. The contract reviews of PR objectstack-ai#37422 sent one fact to this record: a `form` item is reverted only after every `view` row its commit edited is put back, and it joins `failed[]` otherwise. The note records that. - **ADR-0048.** The row's text was dated 2026-11-24. The note is dated 2026-11-28, the day it was written into the record. - **ADR-0150.** Besides answering "Not judged yet", the note qualifies one sentence of the 2026-11-26 note that said too much: the draft discard is newly refused only over a stored package-less draft. Where it was already refused, only its sentence moved. - **ADR-0158.** Row 7179515770 points at a draft held by its seat, which this session could not read. The notes are written from the two rows and the code. Open item 13 is a new numbered item at the end of the list, carried from the display card; it is marked not built and not settled. - **ui ADR-0057.** The row asks for "what main does after objectstack-ai#37720". `main` has moved once more: since PR objectstack-ai#37970 the entry's marker stands for a write that waits for approval. The note says that, and that A5's "Not recorded yet" bullet held until that pull request merged. ## Tests Docs only. No package is touched, so no build closure and no package test is owed for the change. No tested behaviour changed, so there is no ablation. What was checked by hand, on the committed text: - Each phrase a note quotes from its ADR was compared with the base file. - Each verbatim maintainer quotation was compared, byte for byte, with its record on GitHub. - Each cited path and symbol exists on `main`. The one exception is deliberate: the ADR-0160 note names `packages/spec/src/ai/skill.form.ts` to say that no such file exists. - Upstream moved ten commits while this was written (`e42520c67b` to `e2a0e90025`). None touches an ADR file or a file a note cites. `overlap-check` answers `VERDICT clean exit 0` against `origin/main` at `e2a0e90025`, and no open pull request shares a file with this branch. The local gate set is the `dispatch-gates --commands` derivation for this change set, 27 commands, run on the final commit `c2c3345747`. Each exit code was captured before any pipe. Reconciliation: `Run reconciliation — 27 derived, 27 run, 0 NOT-MEASURED, 0 UNRUN`, all 27 with a recorded exit code. <details><summary>ADR gates on c2c3345 (all exit 0)</summary> | Command | Exit | Verdict line | |:---|:---|:---| | `pnpm check:adr-symbol-anchors` | 0 | `check-adr-symbol-anchors: 4525 anchors across 164 records resolve`, 0 line anchors survive. On the base commit the same gate reads 4478. | | `node scripts/check-adr-links.mjs` | 0 | `check-adr-links: 1268 relative link destination(s) under docs/adr/ resolve` | | `node scripts/check-adr-links.mjs --self-test` | 0 | | | `pnpm check:adr-anchors` | 0 | | | `pnpm check:adr-index` | 0 | `adr-index --report: OK — docs/adr/README.md is current, every record parsed` | | `pnpm check:doc-authoring` | 0 | | | `pnpm check:nul-bytes` | 0 | `check-nul-bytes: OK (scanned 28605 text file(s)`, no raw control bytes | | `pnpm check:closed-ceremony-text` | 0 | | | `pnpm --filter @objectstack/lint run check:doc-formula-expressions` | 0 | run after building `@objectstack/formula` and `@objectstack/lint` under the verify lock | | `pnpm --dir ui run check:new-line-citations` | 0 | `VERDICT new-cross-file-line-citations: 0 new citation(s)`. Not in the derived list; run because a ui ADR changed. | </details> <details><summary>The other derived families on c2c3345 (all exit 0)</summary> `node scripts/check-closing-keyword-parity.mjs` and its `--self-test`, `node scripts/check-comment-mask-corpus.mjs`, `node scripts/ci/plan-test-core-shards.mjs --self-test`, `pnpm check:ci-filter-parity`, `pnpm check:cross-package-test-inputs`, `pnpm check:driver-memory-census`, `pnpm check:gitlink-declared`, `pnpm check:pm-governed-merges`, `pnpm check:pm-prior-rulings`, `pnpm check:published-files`, `pnpm check:refd-timer-probe`, `pnpm check:registry-log-declared`, `pnpm check:rest-log-spy-declared`, `pnpm check:tier-file-adoption`, `pnpm check:undeclared-dep-imports`, `pnpm check:watch-hint-literal`. Before the push: `node scripts/check-commit-card-trailers.mjs --range origin/main..HEAD` exit 0, one commit message, no card relation and no model identifier in the trailer pair. </details> <details><summary>The ui scripts test family: one prerequisite failure, then green</summary> Derived command: `pnpm --dir ui exec vitest run scripts/`, run under the verify lock with `--maxWorkers=2`. - First run: `VERDICT command-exit 1`. `Test Files 1 failed | 171 passed | 2 skipped (174)`, `Tests 1 failed | 5144 passed | 2 skipped (5147)`. The one failure was `scripts/__tests__/unit-registry-absence-collision.test.ts`, with `Failed to resolve entry for package "@objectstack/client"`. The package had no build output in the fresh worktree. That is a missing prerequisite, not a verdict on this change. - After building the `@objectstack/client` closure under the lock, the same command on the same commit: `VERDICT command-exit 0`. `Test Files 172 passed | 2 skipped (174)`, `Tests 5145 passed | 2 skipped (5147)`. </details> Not run locally: the repository test project behind `test:repo`, which CI runs on the pull request and on the merge group. Every other family CI runs is read from this pull request's check runs, not re-run here. ## Acceptance notes - **Changeset.** None, and the pull request carries `skip-changeset`. `docs/adr/**` and `ui/docs/adr/**` ship in no package: the ui tree's root is a private workspace root and `ui/docs` is under no package directory. - **Governed surface.** `docs/adr/**` lands by the maintainer's hand. This pull request stays a draft; the seat hands it over. - **The registry count.** The card row and the amendment both carry a number. The repository rule for a volatile count is to remove it and not to sync it, so the note adds none. - **Seen and left alone.** These are outside the card and are not changed here. - ADR-0084, near line 226, says `form` is not a registered type. It is about the working names of the 2026-07-01 table, and `form` is registered now. It is a candidate row for next week's card of this name. - One internal skill playbook and ui ADR-0056 still use the Studio form helper's old name. The review of PR objectstack-ai#37366 already recorded both. - Comments in the console's chat scope helper still describe the `app:PKG:build` dock key and the Studio copilot. ## Verification ### Read first 1. `docs/adr/0066-unified-authorization-model.md`, the note of 2026-11-28 under D2 ⑧. It is the highest-risk hunk: one long paragraph on authorization, and it supersedes parts of three earlier notes. Check the sentences on what another set can still re-open, and the sentence that stored sets are read with the new meaning and never rewritten. 2. `docs/adr/0150-behavioural-metadata-addressed-by-package-objects-keep-the-literal-prefix.md`, the amendment note of 2026-11-28. Check the four cells and their remedies (enable, enable, name the package, name the package) against the ruling it quotes. 3. `docs/adr/0158-units-of-measure-standard-unit-table-org-units-quantity-unit-declaration-base-quantity.md`, the notes under Open items 6 and 10 and the new Open item 13. Both notes quote the maintainer, and item 10's records the shape of a new system object. ### Two-minute check Run `git diff --numstat origin/main...HEAD` on this branch. Expect ten rows, nine under `docs/adr/` and one under `ui/docs/adr/`, each with `0` in the removed column, and 239 added lines in total. Then run `pnpm check:adr-symbol-anchors` and expect exit 0 with a line that contains `check-adr-symbol-anchors: 4525 anchors across 164 records resolve`. --- _Generated by [Claude Code](https://claude.ai/code/session_016WV4cxRDKprCtjpEdtiPFW)_ <!-- signed: repo:objectstack#1 · os-elon-musk · session_016WV4cxRDKprCtjpEdtiPFW --> --------- Co-authored-by: Claude <noreply@anthropic.com>
…g, 56 changesets added) and state what npm publishes (objectstack-ai#38645) <!-- claude-projects-attribution: {"github_login":"os-steve"} --> _Requested by **Steve** · [project thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9St4eUWHFcCKuRUrCZPperJ)_ Fixes objectstack-ai#38189 Clause-②: no Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:v19 发布页的 breaking 清单补上 11 月 26 日之后合进来的 56 条改动(其中 30 条还在 main 上、下一次预发布才带上,页上逐条标明),计数和页头的发布状态也改成现在 npm 上的真实情况。 - 为什么做:升级到 19 的人把这页当完整清单用;原清单只数到 19.0.0-next.0 的输入,之后 next.1、next.2 和 main 上的 breaking 改动大多没列。 - 出错会怎样:只改一个文档页,不影响任何代码或发布;某条写错了,读者会被误导,但直接撤回这个改动即可恢复原页。 - 要你做的:无。 ## What changes `content/docs/releases/v19/index.mdx` only. - **Header.** The publication sentence now states what npm answers: `latest` is 18.6.0, `next` is `19.0.0-next.2`; the line's versions on npm are `19.0.0-next.0` (2026-11-26) and `19.0.0-next.2` (2026-11-28). `19.0.0-next.1` was versioned on `main` (30a8047) and is not on npm, so its changes first ship in `next.2`. - **How this list was built.** Re-measured at `6eb23c87` (origin/main at start, 2026-11-29) with the method the page states: `classifyReleaseBullet` over every changeset on `main` — the 1,185 in `.changeset/pre/` (consumed by the next.0, next.1 and next.2 version passes) and the 219 still pending. 159 breaking from 155 PRs: 98 to act on, 61 registered. - **56 new lines' worth of changesets**, each sorted by the classifier into 需手动处理 (27) or 自动迁移 (29), placed under the page's existing topic headings, with three new ones: 需手动处理 → Knowledge; 自动迁移 → Knowledge sources, Sharing and permissions. The 30 still pending carry "— on `main`". - **自动迁移 intro** and **Coming from 18.x step 3**: the registered split restated in changesets (31 on the protocol-19 step, 30 on the protocol-18 step, of 61). - **Callout**: no longer says no prerelease was published. ## Tests The classifier run (script in the dev's scratchpad; it imports `classifyReleaseBullet` from `scripts/release-github-releases.mjs` and feeds each changeset body as a CHANGELOG bullet, `- ` on the first line and two-space indent on the rest), at `b03fd5f5`'s parent tree `6eb23c87` (the diff touches no changeset): <details><summary>Raw counts</summary> ``` ALL 1404 {"manual":98,"migrated":61,"other":830,"added":403,"semantic":12} OLD (in a46efa8 set) 950 {"migrated":31,"manual":71,"other":563,"added":278,"semantic":7} NEW (after a46efa8) 454 {"manual":27,"other":267,"added":125,"migrated":30,"semantic":5} NEW next.0 45 {"other":27,"added":13,"migrated":1,"semantic":2,"manual":2} NEW next.1 138 {"manual":9,"other":80,"migrated":12,"added":36,"semantic":1} NEW next.2 52 {"added":11,"other":38,"manual":3} NEW pending 219 {"added":65,"other":122,"migrated":17,"manual":13,"semantic":2} missing-from-tree of a46 set: none ``` The same function over the 950 files as they stood at `a46efa8c` (`git show a46efa8:.changeset/FILE`): `{"migrated":31,"manual":71,"other":563,"added":278,"semantic":7}`, and 0 of the 950 changed section between `a46efa8c` and `6eb23c87` — the page's first count reproduces exactly. </details> <details><summary>The 57 breaking changesets added after a46efa8 (pass · section · PR · file)</summary> ``` next.0 manual 37477 37004-retire-knowledge-ragflow.md next.0 manual 37491 36964-flow-option-label-filters.md next.0 migrated 37437 35827-data-table-staged-edit-retired.md (already on the page) next.1 manual 37605 31908-p4c-sealed-expiry.md next.1 manual 37640 37604-platform-record-followups.md next.1 manual 37668 37104-knowledge-settings-readers.md next.1 manual 37720 37682-i18n-retire-build-chat-keys.md next.1 manual 37720 37682-retire-build-chat-frontend.md next.1 manual 37818 37608-disabled-holder-publish-rollback-refused.md next.1 manual 37883 37575-first-render-grid-shell-passes.md next.1 manual 37900 36689-mcp-stdio-disabled-package-every-caller.md next.1 manual 37902 37678-knowledge-turso-settings-group.md next.1 migrated 37366 37086-define-metadata-form-rename.md next.1 migrated 37366 37086-form-metadata-type.md next.1 migrated 37371 36055-view-all-stops-voting-on-fields.md next.1 migrated 37513 35143-data-model-publish-checks.md next.1 migrated 37584 37499-disabled-holder-unbound-row-bare-write-refused.md next.1 migrated 37600 36595-related-list-key-under-arrangement.md next.1 migrated 37676 37304-knowledge-source-governed-type.md next.1 migrated 37783 37712-agent-model-provider-retired.md next.1 migrated 37807 35143-seeds-actions-checks.md next.1 migrated 37840 36377-flow-bare-ordering-record-date-arithmetic.md next.1 migrated 37870 37613-book-audience-one-gate.md next.1 migrated 37910 37717-lookup-depends-on-param-computed-field.md next.2 manual 37948 37851-disabled-holder-own-row-publish-rollback-refused.md next.2 manual 38028 managed-email-password-held-off.md next.2 manual 38042 36679-secret-rewrap-confirmation-exit.md pending manual 37896 runtime-object-less-action-no-record.md pending manual 37963 37467-knowledge-title-arm-retired.md pending manual 37982 37907-knowledge-turso-test-connection.md pending manual 38038 38019-knowledge-source-review-follow-ups.md pending manual 38085 37622-related-list-keys-agree-under-arrangement.md pending manual 38180 auth-switches-read-declaration.md pending manual 38209 35879-served-schema-platform-stamped-keys.md pending manual 38268 sec2-wf9p-f12.md pending manual 38269 37752-app-list-edit-with-ai-removed.md pending manual 38310 38041-knowledge-source-closure-system-object.md pending manual 38431 36987-auth-updateuser-returns-void.md pending manual 38452 38377-retire-split-algorithm-version.md pending manual 38580 36057-scenarios-delete-agent-confirmation-names.md pending migrated 37924 37856-ask-ai-action-type-retired.md pending migrated 37929 36495-action-locations-acted-on.md pending migrated 37971 37307-knowledge-source-references.md pending migrated 38001 automation-variable-keys-reserved-segments.md pending migrated 38013 37983-knowledge-source-save-needs-the-service.md pending migrated 38060 37961-knowledge-source-unmounted-adapter-refused-at-save.md pending migrated 38096 34562-record-structural-lint.md pending migrated 38107 35143-views-dashboards-checks.md pending migrated 38145 37214-chart-series-measure-format-refused.md pending migrated 38168 36544-form-view-modal-size-retired.md pending migrated 38216 33912-share-unknown-recipient-ledger.md pending migrated 38216 33912-share-unknown-recipient.md pending migrated 38273 33806-pending-confirmation-service-one-seam.md pending migrated 38299 35924-publish-reparses-object-draft.md pending migrated 38398 37753-build-progress-frame-retired.md pending migrated 38470 38369-knowledge-held-without-embedder-or-store.md pending migrated 38545 38150-adopt-orphans-door-retired.md ``` PR = the `(#N)` of the commit that added the changeset (`git log --diff-filter=A`). The pass is the version commit that moved the file into `.changeset/pre/`: next.0 33a31dc, next.1 30a8047, next.2 9d111a7 (`packages/spec/package.json` reads `19.0.0-next.0/1/2` at each). </details> <details><summary>Page cross-checks</summary> - Every one of the 155 PRs behind a breaking changeset is linked on the page (0 missing), and the page links no PR outside that set. - Each of the 30 pending changesets sits on a line carrying "— on `main`", and no published one does. - `!`-titled first-parent commits since 18.6.0 (958ee03) to `6eb23c87`: 135 (87 to `a46efa8c`, as the page said); all 135 are in the list. - Registered markers resolved to their entry files (`packages/spec/src/migrations/entries/*/N.*`, `packages/spec/src/conversions/entries/N/`, and metadata-core's forward conversion for `permission-view-all-fields-beside-record-bypass`): the 30 registered changesets added after `a46efa8c` name 39 ids, all on step 19; the 31 before it name 33 ids, 32 on step 18 and `protocol-18-range-refused` on step 19. </details> ## Acceptance notes - **Pending changesets are in the list.** The card's done-when covers every changeset between `a46efa8c` and the measurement sha; 30 of those are still in `.changeset/` and ship in the next cut, so their lines are marked "on `main`" and the intro says so. - **`19.0.0-next.1` is not on npm.** `npm view PKG versions` for `@objectstack/spec`, `core`, `cli`, `runtime` and `@object-ui/i18n` lists `19.0.0-next.0` and `19.0.0-next.2` only. The header states that fact and no more. - **The registered split is now counted in changesets, not entries.** The old page said 41 registered entries, 39 on protocol 18. Counting the ids in the registered markers gives 33 at `a46efa8c` (32 on step 18), so the 41/39 could not be reproduced from any stated method. The rewritten intro and step 3 count changesets (31 on step 19, 30 on step 18, of 61), which match the bullets one to one. - **Followed the classifier where a title has no `!`:** objectstack-ai#37605, objectstack-ai#37883, objectstack-ai#37963, objectstack-ai#38209 and objectstack-ai#38269 are breaking by their banner or their `(narrowing)` arm; objectstack-ai#38209's Clause-② reads "no (narrowing …)", which the classifier counts as breaking although the body says nothing a client sends is refused. Listed as classified; no changeset changed. - **objectstack-ai#37513** merged before the next.0 cut but its changeset was consumed by next.1 (its body says the next.0 CHANGELOG missed it). - **One line, several changesets**: objectstack-ai#37720, objectstack-ai#37366 and objectstack-ai#38216 each carry two changesets; objectstack-ai#37818 with objectstack-ai#37948, objectstack-ai#38038 with objectstack-ai#38310 and objectstack-ai#38013 with objectstack-ai#38060 share a line. The existing 102 lines were not rewritten. - **Counts on a release page**: each is anchored to a named measurement sha, the snapshot the card asks for; it is not a count kept in sync with the tree. - **objectstack-ai#37437** (closed card objectstack-ai#37922's bullet) is not added twice. - **Check Changeset** will be red: this docs-only PR publishes nothing from any package, the `skip-changeset` case, and the dispatch opens it without labels, so that label is the seat's to apply. ## Verification Read first, by risk: the method paragraph and header (`index.mdx` lines 6-47), the 自动迁移 intro, then the new 需手动处理 → Knowledge block. Two-minute check: `git show 6eb23c8:.changeset/pre/37851-disabled-holder-own-row-publish-rollback-refused.md | head -12` shows the `fix(metadata-protocol)!` summary and the BREAKING banner behind the objectstack-ai#37948 line; `npm view @objectstack/spec dist-tags` prints `{ latest: '18.6.0', next: '19.0.0-next.2' }`. <details><summary>Local gate readings at b03fd5f</summary> ``` dispatch-gates --commands at b03fd5f: 52 commands (1 path changed) first pass: 47 exit 0; 5 exit 3/1 = PREREQUISITE NOT MET (lint, spec, client-react unbuilt), re-run after building the closures under os-verify-lock (VERDICT command-exit 0 both): pnpm --filter '@objectstack/lint...' build ; pnpm --filter '@objectstack/client-react...' build final: 52 of 52 :: exit 0 ✓ dispatch-gates --ran: 52 derived famil(ies) accounted for — 52 run, 0 NOT-MEASURED (a DERIVED zero — all 52 recorded an exit code and none of them is 3). check-release-page-status: OK — 3 GA major(s) in scope (v16, v17, v18) ``` </details> 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01ADHkmRar3Kkg6SpwVgaaVE <!-- signed: repo:objectstack#3 · os-steve · session_01ADHkmRar3Kkg6SpwVgaaVE --> Co-authored-by: Claude <noreply@anthropic.com>
Requested by Alice · project thread
Fixes #37086 — now carries the card's whole cut: PR A (item 3's rename and suffix move) and PR B #37422 (the
formtype, its factorydefineForm, everything else), which merged into this branch on the maintainer's approval (2026-11-27T03:24Z). Reviews of record: this PR's ACCEPT 7204174977 and merge delta 7203719013; #37422's ACCEPT 7204181264 and merge delta 7203725192 on20a80b19d1, the head #37422 merged at.Clause-②: yes (narrowing)
Metadata-protocol: narrowed
Skills-docs: follow-up #37105
维护者速读
What changes
defineForm(the Studio schema-bound metadata-form helper,packages/spec/src/ui/view.zod.ts) is renameddefineMetadataForm, with the same argument and result;packages/spec/src/index.tsand the@objectstack/spec/uibarrel export the new name, andpackages/spec/tsup.config.ts's pure-constructor set names it.defineFormis absent between this PR and PR B, never dual-meaning (ADR-0159 question 1, ruled A, ruling record 7131569242).*.form.tsto*.metadata-form.ts(the card counted 17 at689e5695b98; 18 at this head,email-templatebeing the newer one), plus their one dedicated test (ai-context.metadata-form.test.ts). Import specifiers swept by both spellings: 32 files underpackages/spec/src(the seven domain barrels,system/metadata-form-registry.ts, the tests, andkernel/repeater-item-titles.test.ts's 15../DIR/NAME.formimports).scripts/i18n-bundle-surface.mjs:METADATA_FORM_MODULE_SUFFIXbecomes.metadata-form.ts, its module note re-worded.scripts/pm/dispatch-gates.self-test.mjsre-spells its suffix cases (the live-walk assertion included) and gains one case: aformitem source (examples/app-crm/src/forms/lead.form.ts) is not a metadata-form module.scripts/pm/dispatch-gates.data.mjskind text,scripts/pm/landing-k.mjsfixture path,scripts/check-i18n-bundles.mjscomments.scripts/pm/dispatch-gates.mjsis not edited (it spells no suffix).packages/lint/src/rule-explanations.ts(thevisibility-root-mislayeredexplanation), thedataarm of the field-rule message inpackages/lint/src/validate-expressions.ts, the docblock ofvalidate-visibility-predicates.tswith its twotoContainpins and theMOVEDtoken pin, and the row ofcontent/docs/protocol/objectui/layout-dsl.mdx. The test's file-name detector reads both spellings (/[.-](form|view|page)\.ts/).packages/lint/src,packages/cli/src,packages/cli/test,packages/platform-objects/src,packages/metadata-protocol/src,packages/spec/src,packages/spec/liveness/,ui/packages/app-shell/src/views/metadata-admin/, and two live citations indocs/qa/platform-checklist/areas/studio-authoring.json.packages/spec/api-surface*,packages/spec/export-origins/(7 files),content/docs/references/ui/view.mdx, regenerated bycheck:generated --fix.define-form-studio-helper-renamed-define-metadata-form(theruntime-export-retiredcategory is closed: the helper is declared in a*.zod.ts, a metadata surface by the gate's reading).Outside-use reading (question 1), recorded before the rename's first commit
defineFormoutside this repository (seat record 7177011389 on form metadata type: define, register and serveformitems (ADR-0159, card ②) #37086, each repository's head listed there; objectui's one hit is a comment).objectstack-ai/cloudat03769766a92: 0 hits (repo:cloud seat record 7177053511).Count at this head (
80da0864base)git grep -lw defineFormnamed 61 files at the base. After this PR the word survives only in released or historical text, which is not rewritten: 8CHANGELOG.md,content/docs/releases/v17/17-0.mdx,docs/audits/2026-06-handwritten-docs-accuracy-followups.md, ADR-0159 itself, the new migration entry and changeset (which name the old spelling as the FROM side), and the historical sentence added todefineMetadataForm's docblock.Tests
Local runs at this head
pnpm --filter @objectstack/spec build: VERDICT command-exit 0.pnpm --filter @objectstack/spec check:generated: 3 of 14 stale before--fix(api-surface, export-origins, docs), 14 of 14 green after.pnpm --filter @objectstack/spec test: Test Files 894 passed, 1 skipped (895); Tests 28417 passed.pnpm --filter @objectstack/lint exec vitest run: Test Files 235 passed (235); Tests 9629 passed.pnpm check:pm-dispatch-gates(the self-test this PR edits): 2314 cases pass, fast tier.check-adr-0087-registration --base origin/main0,check-changeset-no-major0,check-empty-changeset0;check:commit-card-trailers0,check:nul-bytes0,check:ratchet-remedy-authority0,check-skills-token-ratchet0 (and--self-test0),check:i18n-stale-fill0,check:adr-anchors0,check:spec-docblock-symbol-anchors0,check:scripts-symbol-anchors0,check-platform-checklist --changed-from origin/main0,landing-k --self-test0,check:i18n-walk-parity0.check:i18n-coverageNOT MEASURED locally (exit 3, example build closure absent): cited from CI.pnpm check:i18n: OK, 10 packages in sync;node scripts/check-i18n-bundles.mjs --writechanged no bundle (git statusclean after it).Acceptance notes
.claude/skills/spec-property-retirement/SKILL.mdlines 264 and 318 spell*.form.tsanddefineForm(a governed path);ui/docs/adr/0056-permission-editing-studio.mdline 349 namessecurity/permission.form.ts(an ADR);docs/adr/0159is the record itself. Two pending changesets (35926-field-inline-edit-boolean-retired.md,36425-retire-internal-forms.md) and two released migration entries (18.field-max-length-…,18.field-min-length-…) andregistry.ts.templatename the old spelling as history; not rewritten.pnpm check:platform-checklistis red at this head onareas/automation.json(FlowItemMoreMenu.tsx#FlowItemMoreMenu), a file this PR does not touch: red at the base80da0864too. The scoped run--changed-from origin/mainis green.narrowed: since feat(spec)!: form is a metadata type of its own, and the form doors read a form over both types #37422 merged into this branch, this PR carries the card's narrowing (item 5's refusal), which feat(spec)!: form is a metadata type of its own, and the form doors read a form over both types #37422 declared asMetadata-protocol: narrowed. A's own commits change no metadata an author writes.Verification
Two minutes:
git grep -nw defineForm -- packages ui scriptsreturns only the docblock's history sentence and the migration entry;pnpm --filter @objectstack/spec exec vitest run src/system/metadata-form-registry(or any metadata-form test) is green.🤖 Generated with Claude Code
https://claude.ai/code/session_011y7As9cjn4Y9vAUQbVH4fq
Generated by Claude Code