Repository navigation
fix(lint)!: the publish gate refuses a subflow or map step that calls a flow the deployment does not hold - #38594
Conversation
…s at the publish gate Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q4EjjQkY5yXZrN9BEA3rEK
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q4EjjQkY5yXZrN9BEA3rEK
… changeset Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q4EjjQkY5yXZrN9BEA3rEK
… protocol facade Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q4EjjQkY5yXZrN9BEA3rEK
…ing flow resolves at the publish gate The unmanaged install writes its items one at a time, so the publish gate's subflow-target judgement met a caller before its callee and rolled the whole install back. The door now states its plan's flow names on each flow write, as a publish batch does. The gate reads the stored flow names in one read projected to name, and none for a flow that calls no other flow. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jSjBfkaFUVwRa3pdUK
…he changeset Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jSjBfkaFUVwRa3pdUK
… and warn filters Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jSjBfkaFUVwRa3pdUK
📓 Docs Drift CheckThis PR changes 3 package(s): 21 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 10 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails. What this run could not see
Coarse fallback — 182 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 17286cc025d7e487708a424338ce4bfc2aa449dc && git checkout 17286cc025d7e487708a424338ce4bfc2aa449dc
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 75108ea6df94b13b57ec010aeb77012ec211ebb3 93f3643eafd6aa5d25ec772a661ad83e6e18fdb9 && git checkout -B drift-repro 75108ea6df94b13b57ec010aeb77012ec211ebb3 && git merge --no-ff 93f3643eafd6aa5d25ec772a661ad83e6e18fdb9
node scripts/docs-audit/affected-docs.mjs --json 75108ea6df94b13b57ec010aeb77012ec211ebb3
|
|
repo:objectstack#1 · zhuangjianguo · session_01QsR2jSyQBDMyRnrrWKy7WS Contract-review-claim: session_01QsR2jSyQBDMyRnrrWKy7WS · head a7c00fd · 2026-11-29T13:38Z Seat 1's review thread R1 starts an isolated contract-review sub-agent at |
|
repo:objectstack#1 · zhuangjianguo · session_01QsR2jSyQBDMyRnrrWKy7WS Contract reviewServed-tier: One full round, ① to ④, on PR #38594: the net diff against merge base ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgmentThe delta on record 7238045522: M1: closed.
S1: closed.
S2: closed.
S3: closed.
N1 of that record is fixed: the New at this round: S4 (should-fix) — the gate's universe leaves out a disabled package's registry flows, and the contract says it holds them.
The The implementing files, each against the contract:
Tried and held:
Nits, none with an effect on correctness or the contract:
Open at this head: S4. Nothing here is graded a must-fix, so the verdict is PASS, and the next head owes a delta round on S4. Implemented-by: VERDICT: PASS |
|
repo:objectstack#1 · zhuangjianguo · session_01QsR2jSyQBDMyRnrrWKy7WS The brief the isolated reviewer was handed for contract-review record 7257069704, as it stood (2026-11-29T14:08Z). The reviewer ran at BriefContract review brief — PR #38594 @
|
|
repo:objectstack#1 · zhuangjianguo · session_01QsR2jSyQBDMyRnrrWKy7WS 席位核对 — REWORK · L1 by seat repo:objectstack#1, review thread R1 · Head-sha
|
|
repo:objectstack#1 · zhuangjianguo · session_01QsR2jSyQBDMyRnrrWKy7WS 2026-11-29T14:10Z · Correction to L1 7257085221, its sentence on landing only. It said "Not governed …, so after the delta it lands through the queue." That is wrong. No path of this pull is on a governed surface, but it lands as Tier H on two other grounds, either of which is enough: the pull declares a narrowing ( |
…argets at the publish gate The gate's names read the served registry listing, which drops a disabled package's items, so after a restart a call to such a flow was refused with a sentence saying no installed package holds it. The names now read the registry with its disabled packages, as the docblock and the changeset said. Docblocks, the explanation, the upgrade entry and the changeset's exports list now name a package install's flows and saveMetaItem's copyPlanFlowNames. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jSjBfkaFUVwRa3pdUK
|
repo:objectstack#1 · zhuangjianguo · session_01QsR2jSyQBDMyRnrrWKy7WS Contract-review-claim: session_01QsR2jSyQBDMyRnrrWKy7WS · head 93f3643 · 2026-11-29T14:21Z Delta round on record 7257069704 (PASS at |
|
repo:objectstack#1 · zhuangjianguo · session_01QsR2jSyQBDMyRnrrWKy7WS Contract reviewServed-tier: Delta review, 2026-11-29T14:47Z. This is the delta round that record 7257069704 left owed (PASS at ① Derived judgmentsEverything in ① of record 7257069704 stands, with one line changed:
What the delta does to the other lines:
② Semver level
③ Boundary flags
④ Design judgmentS4: closed.
The The hunks outside S4 are what the commit says they are:
Tried and held:
Nits of record 7257069704:
New at this round, nits only, none with an effect on correctness or the contract:
No must-fix, no should-fix. Implemented-by: VERDICT: PASS |
|
repo:objectstack#1 · zhuangjianguo · session_01QsR2jSyQBDMyRnrrWKy7WS 维护者速读
席位意见:建议批准。请留意第三条里应用包副本安装被拒的情况:在 #38595 修好之前,这类副本装不上。这一条是读代码得出的结论,没有测试钉住;席位认为拒绝比装上之后运行失败好。 席位核对 — ACCEPT · L1 · seat repo:objectstack#1, review thread R1 · Head-sha
|
|
repo:objectstack#1 · zhuangjianguo · session_01QsR2jSyQBDMyRnrrWKy7WS Tier H approval request · 2026-11-29T15:33Z This pull request declares a narrowing ( |
…the engine accepts it (objectstack-ai#38635) <!-- claude-projects-attribution: {"github_login":"os-steve"} --> _Requested by **Steve** · [project thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9JeHmqv6CKCkW8ewrPBLekk)_ Refs objectstack-ai#38433 (items 1, 2) Clause-②: no Metadata-protocol: none ## 维护者速读 - 作者与智能体在校验或保存看板视图时看到的修复建议变了:分组字段是多值、JSON 存储或公式字段时,不再建议改用表格分组,而是建议改用表格列;普通文本、数字、日期字段的建议不变。 - 属于看板分组字段校验规则的复核跟进:原建议会把作者引到一个打开即报错的表格分组。 - 只是提示文字和规则说明变了,不改任何校验结论或严重级别;出错时作者只会读到不准确的建议,可直接撤回。 - 无。 ## What changes `list-view-kanban-group-field-uncategorical` now offers the grid-grouping remedy only on the branch where it holds. - **Hint** (`checkKanbanGroupField`, `packages/lint/src/validate-list-view-field-refs.ts`): the tail is keyed on the engine's own refusal set, read from the same spec predicates the two `engine.aggregate` doors use: - multi-valued (`isMultiValueField`, the multi branch) and structured-JSON (`STRUCTURED_JSON_TYPES`) are refused by `assertGroupByNamesNoJsonStoredField`; - virtual `formula` (`isVirtualSearchField`) is refused by `assertGroupByTargetsAreStored`; - both answer `400 INVALID_FIELD`. A list view `grouping` compiles to that group-header query (`compileListViewGroupQuery`), which the grid sends. - For those three classes the hint now ends `or show "FIELD" as a grid column (a list cannot be grouped by REASON)`; every other warned field (text, number, date and the rest of the stored single-valued scalars) keeps `or show "FIELD" as a grid grouping`. - **Explanation** (`rule-explanations.ts`, this rule's entry only): the fix paragraph now says the same, branch by branch: stored single-valued field gives grid grouping; multi-valued, JSON-stored or `formula` gives grid column only, with the reason. - Measured from the rule's code: before this PR a JSON-stored or `formula` group field already warned, on the **single-valued** branch (it is not in `KANBAN_CATEGORICAL_TYPES`), and got the grid-grouping tail. No finding, severity or accept set changes. - **N2 (item 4), decided: keep the short list deliberately.** `select`, boolean and lookup are the heads of the three families the rule accepts (`select`/`radio`, `BOOLEAN_VALUE_TYPES`, `REFERENCE_VALUE_TYPES`). Naming each member would hand-copy `KANBAN_CATEGORICAL_TYPES` into prose that drifts from it, and would lengthen a hint held to 200 characters. Read first, by risk: 1. `packages/lint/src/validate-list-view-field-refs.ts`, the `ungroupable` / `gridRemedy` hunk in `checkKanbanGroupField`: this is where the set is keyed. 2. `packages/lint/src/validate-list-view-kanban-lanes.test.ts`, the new per-field `it.each`. Two-minute check: `pnpm --filter @objectstack/lint exec vitest run --maxWorkers=2 src/validate-list-view-kanban-lanes.test.ts`. Expect 34 passed. The `tags`, `watchers`, `meta`, `address` and `score` rows assert a grid column; `amount`, `due_date` and `subject` assert a grid grouping. ## Tests At head `e0e643722a`: <details><summary>@objectstack/lint: full suite and typecheck</summary> - `pnpm --filter @objectstack/lint exec vitest run --maxWorkers=2`: Test Files 246 passed (246), Tests 9962 passed, 5 skipped (9967). - `pnpm --filter @objectstack/lint typecheck`: exit 0; check:test-typecheck OK. - `src/validate-list-view-kanban-lanes.test.ts`: 34 passed. </details> <details><summary>Ablation</summary> Forced `gridRemedy` to always take the grid-grouping arm, on disk, then ran the target file: 5 failed / 29 passed. The failures were exactly the five ungroupable rows (`tags`, `watchers`, `meta`, `address`, `score`). Restored with `git checkout HEAD --`, tree clean. </details> ## Acceptance notes - Item 3 of the card (a finding of its own for a `grouping.fields[].field` naming a multi-value, JSON-stored or non-stored field) is not in this PR. It is a narrowing and stays on the card. - `engine.aggregate` also refuses a `groupBy` on a credential or `internal`-flagged column (`rejectCredentialEvaluation`, `rejectInternalFieldEvaluation`). The hint is not keyed on those, because the refusal comes from a flag and not from the storage class. A kanban board grouped by a password field is not a realistic producer. Noted only. ## Verification <details><summary>Derived local gates (dispatch-gates --commands, 70 families)</summary> - `dispatch-gates --ran`: 70 derived, 67 run with exit 0, 3 NOT MEASURED (exit 3, prerequisite), 0 unrun. - NOT MEASURED: `check-plugin-teardown-shape --self-test` (shallow clone cannot reach its pinned fixture commit), `check:dual-build-cjs-loads` and `check:lean-entry-closure` (need dist of packages outside this diff's closure). Left to CI. - `check:docs-transcript-drift` was re-run after building `@objectstack/lint`: exit 0. `check:type-check-debt` and `check:query-options-erasure`: exit 0. - `overlap-check --branch=HEAD`: clean against origin/main and objectstack-ai#38628, objectstack-ai#38605, objectstack-ai#38594, objectstack-ai#38550. </details> --- _Generated by [Claude Code](https://claude.ai/code/session_01ADHkmSwS4mQyXWrddL4r6B)_ <!-- signed: repo:objectstack#3 · os-steve · session_01ADHkmSwS4mQyXWrddL4r6B --> --------- Co-authored-by: Claude <noreply@anthropic.com>
…ng declares (objectstack-ai#38648) <!-- claude-projects-attribution: {"github_login":"os-steve"} --> _Requested by **Steve** · [project thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9JeHmqv6CKCkW8ewrPBLekk)_ Fixes objectstack-ai#38623 Clause-②: no Metadata-protocol: none ## 维护者速读 - 在 Studio、元数据接口或 AI 助手里保存或发布一条翻译时,如果它指向一个已经不存在的对象、字段、校验规则、里程碑或权限集,保存结果里会多出一条提示;以前保存显示一切正常,什么都不说。 - 属于“错误的元数据要被明确指出”这项构建能力:本地校验早就会报这类问题,线上保存却静默通过,这次替在 Studio 和 AI 助手里写翻译的作者补上这个缺口。 - 出错的最坏情况是对一条其实有效的翻译多报一条提示,保存本身照常成功、不会被拒;应用的导航菜单和应用名这类翻译这次仍不检查,可以直接撤回这次改动。 - 无。 ## What changes A `translation` item saved (active) or published over the metadata API now runs `validateTranslationReferences` at the runtime publish gate. An orphan key comes back as a `translation-target-unknown` **advisory** on the save and publish answer (`advisories`, severity `warning`). Before this, no rule ran on a `translation` write (`runtimeAuthoringRulesFor('translation')` was `[]`): the item was accepted as valid while `os validate` refused the same key. **Never a refusal.** Every finding on a translation write is a `warning`, so it lands in `advisories` and never in the 422 `errors`. A published item that names a key an upgrade removed still loads and saves. `os validate` keeps reporting the same key at `error`. **Families the door judges** (the ones the per-write snapshot carries, `RuntimeStackContext`: objects, permissions, books, datasets): - `objects.NAME`, only when the gate did not narrow `objects` to the write's package closure. The i18n layer is process-wide, so a translation may legitimately name an object outside its package's closure. - `objects.NAME.fields.FIELD`, and the field's `options` keys, only for a field that declares options inline. A picklist-bound field's served options are not in the snapshot. - `objects.NAME._validations.RULE` - `objects.NAME._milestones.FIELD.VALUE` - `permissions.NAME` **Not judged at the door:** apps and their navigation (platform-contributed nav items included), `_views`, `_sections`, `_tabs`, `_relatedLists`, `_actions`, `globalActions`, `dashboards`, `forms`, `pages`, `picklists`, `positions`, `reports`, `mappings`, `books` (the implicit per-package book is named by a package id the snapshot never sees), `flows`, `hooks`. Each resolves into a collection no per-write snapshot carries, so the door never guesses a key there unknown; `os validate` still judges all of them. Judging apps and navigation at the door would mean carrying served apps in the snapshot. That is a separate decision and not this card. The changes: - `authoring-rules.ts`: the `validateReferenceIntegrity` entry's `runtimeTypes` gains `translation`, so a translation write dispatches the suite. - `reference-integrity-suite.ts`: the `validateTranslationReferences` member gains `runtimeTypes: ['flow', 'translation']` and still hands its run context straight through. - `validate-translation-references.ts`: the rule reads `runtimeWriteType === 'translation'` off that context as its save-door reading. That is the signal the suite's other members already read for `wholeCollection`. In that reading the rule treats the entry as one item (keyed by its own `locale`), reduces the item to the judged families, and maps every finding to `warning`. - `runtime-gate.ts`: `TYPE_TO_STACK_KEY` gains `translation: 'translations'`. No context row is added, and no metadata-protocol source changes. - `scripts/engine-double-contract.pinned.json`: the three engine doubles the new protocol pin uses (`delete`, `findOne`, `update`) are recorded, written by `check-engine-double-contract --write`. - `content/docs/deployment/validating-metadata.mdx`: the "Reference integrity" row's runtime-publish cell gains `translation` (`✓ᶠᵛᵒᵈᵗʳᵖᵃᶜᵗ`), and its text says what a translation write runs. The superscript legend gains `✓ᵗ` `translation`, and the longest-first note now covers it. Nothing else on the page changes. The CLI reading is byte-identical: without `runtimeWriteType` the rule takes its old path, the whole rule at its own severities. **Control pins moved** (each held `translation` as the ungated control; it now crosses, so the control moves to a type that stays ungated; `tool`'s own control is untouched): - `packages/lint/src/authoring-rule-wiring.test.ts` ("a type nobody gated returns nothing"): `translation` → `doc` - `packages/lint/src/runtime-gate.test.ts` ("runs nothing for a metadata type no rule gates"): `translation` → `doc` - `packages/lint/src/runtime-gate.test.ts` ("returns null for an unmapped type"): `translation` → `doc` - `packages/lint/src/runtime-gate.inert-type-writes.test.ts` ("crossing these five widened no OTHER type s roster"): `translation` → `capability` - `packages/lint/src/runtime-gate.datasource-writes.test.ts` ("the types still awaiting their own readings are untouched"): `translation` → `capability`, and the comment says `translation` crossed on its own reading The seat's reading (7260663888 on objectstack-ai#38623) takes this card as the `translation` reading that the ADR-0049 group B line defers the wiring to. **Read these first** (ranked by risk): 1. `packages/lint/src/validate-translation-references.ts`: `doorJudgedSubset` and the `localeEntries` / `atSaveDoor` lines in `validateTranslationReferences`. This hunk decides what the door may judge; a family added here without its collection in the snapshot is a false advisory on every save. 2. `packages/lint/src/reference-integrity-suite.ts`: the member's `runtimeTypes`. 3. `packages/lint/src/authoring-rules.ts`: the entry's `runtimeTypes`. **Two-minute verification:** `pnpm --filter @objectstack/lint exec vitest run --maxWorkers=2 src/runtime-gate.translation-writes-38623.test.ts` shows 9 passing. The removed field key, the orphan object, rule and milestone, and the orphan permission set come back in `advisories` with `errors` empty. Live keys and the unjudged families come back with neither. ## Tests New files, named for this card: - `packages/lint/src/runtime-gate.translation-writes-38623.test.ts`, through the gate's own entry (`runRuntimeAuthoringRules`): - the dispatch: suite on `translation`, exactly the translation member - a removed field → advisory, `errors` `[]` - an orphan object, validation rule and milestone → advisories - an orphan permission set → advisory - live keys → none - apps, navigation, global actions, positions, views and sections → not judged - a picklist-bound field's option keys → not judged - under a package closure, an object outside it is not judged while its sibling's removed field still is - the CLI reading is unchanged (a bundle, at `error`) - `packages/metadata-protocol/src/protocol.translation-target-door-38623.test.ts`, through the real `saveMetaItem` / `publishMetaItem` write path over a stub engine: - an active save naming a removed field → `success`, the advisory, and the row landed - a draft save says nothing (D1), and its publish answers with the advisory - a permission-set orphan → advisory - live keys → none - an already-published orphan neither blocks nor rides on an unrelated translation write <details><summary>Test runs: the new files at 8775b06; the whole-package readings at 66c22be (before the main merge, which brought no lint or metadata-protocol file)</summary> - At head 8775b06, under the verify lock, after a fresh build of the `@objectstack/metadata-protocol...` closure: `protocol.translation-target-door-38623.test.ts` Tests 5 passed (5), `runtime-gate.translation-writes-38623.test.ts` Tests 9 passed (9), `VERDICT command-exit 0`. The later docs commit changes no code. - `pnpm --filter @objectstack/lint exec vitest run --maxWorkers=2` (whole package): Test Files 247 passed (247), Tests 9977 passed (9977) - `pnpm --filter @objectstack/lint typecheck`: exit 0 (`tsc --noEmit` and `check:test-typecheck` OK) - `pnpm --filter @objectstack/metadata-protocol typecheck`: exit 0 - `pnpm --filter @objectstack/metadata-protocol exec vitest run --maxWorkers=2 src/protocol.translation-target-door-38623.test.ts`: Tests 5 passed (5) - The 29 metadata-protocol test files that mention `translation`: Test Files 29 passed (29), Tests 862 passed (862) </details> <details><summary>Ablation: the entry widening reverted</summary> `'translation'` removed from the entry's `runtimeTypes` through `scripts/ablation-replace.mjs`: - The anchor hit once and the mutation landed (blob 663f139 → 3068dd8e9df2). - lint was rebuilt, and `ablation-dist-preflight.mjs @objectstack/lint '"page", "action", "translation"]' --absent` confirmed the marker absent from all 20 built files. It had been present in the pristine `dist/runtime.js` and `dist/index.js`. Results on the mutant: - lint file: 5 failed / 4 passed. The dispatch case, the removed field, the orphan object, rule and milestone, the permission set and the closure case went quiet. Live keys stayed clean, and so did the unjudged-families, picklist and CLI cases. - protocol file: 4 failed / 1 passed. The active save, the draft publish and the permission set went quiet. The live-key save stayed clean. The already-published-orphan case also fails, because its first save asserts the advisory as a precondition. Restored: blob == HEAD (663f139) and `git diff HEAD` empty. lint was rebuilt, and the protocol file then read 5 passed (5). </details> ## Acceptance notes - **False positives, measured on `examples/app-showcase`'s real `ShowcaseTranslationBundle`** (en + zh-CN; context = the showcase's objects, permissions, books and datasets): - whole-stack `validateTranslationReferences`: 0 findings - the rule unrestricted on the door's snapshot: 85 phantom `translation-target-unknown`. By family: `_views` 28, `_sections` 19, positions 10, flows 10, dashboards 6, `_tabs` 4, reports 4, `globalActions` 2, apps 1, mappings 1. That is why the door judges only the families listed above. - this PR, through `runRuntimeAuthoringRules({ type: 'translation' })` per locale: errors 0, advisories 0 - the lit control on the same context (a removed `showcase_project` field) comes back as one `warning` advisory - A draft save is still never gated (objectstack-ai#4463 D1). The advisory appears on an active save and on publishing a draft, not on the draft save itself. - Found while measuring, not changed here: `os validate` refuses a bundle key under the platform `studio` app at the app level, whatever the navigation id (`translations[0]["zh-CN"].apps.studio`, "which this stack neither defines nor contributes into"), even for a live id such as `nav_api_console`. The lint's apps rung has no platform-app ladder; the objects rung has `isPlatformProvidedObjectName`. Reported to the seat with the CLI reproduction. ## Verification <details><summary>Local gates, derived with dispatch-gates --commands</summary> At head 9b075e6. Gates were derived with `node scripts/pm/dispatch-gates.mjs --commands` (105 families) and each exit code was captured before any pipe. The `--ran` reconciliation reads: 105 derived, 103 run, 2 NOT MEASURED (derived from a recorded exit 3), 0 unrun. - 68 code families were read at the code head: 266bea7, then 8775b06 for the ledger. The docs commit 9b075e6 changes only the page. - 37 families the docs path adds, all at 9b075e6: exit 0. They include `check-adr-links` with its self-test (the local half of Check Documentation Links; lychee runs only in CI, and the edit adds no link), `check:doc-anchors`, `check:doc-frontmatter`, `check:docs-redirects`, `check:docs-single-h1`, `check:docs-spec-enumerations`, `check:docs-audit-scope` and `@objectstack/spec` `check:docs`. - `@objectstack/spec` `check:skill-examples` first exited 3 (PREREQUISITE NOT MET: client SDK not built). After building `@objectstack/client-react...` and `@objectstack/client...` under the lock, it exits 0: "352 prose examples type-check across 3 surface(s)". - `pnpm check:engine-double-contract`: exit 1 before the ledger commit, exit 0 after it at 8775b06. - `pnpm check:objectql-double-limit`: exit 0 ("none new"). - `node scripts/check-nul-bytes.mjs`: exit 0. - `node scripts/pm/overlap-check.mjs --branch=HEAD` at 9b075e6: `VERDICT clean exit 0`. The branch merges cleanly with origin/main and with objectstack-ai#38643, objectstack-ai#38642, objectstack-ai#38594, objectstack-ai#38550 and objectstack-ai#38497. - NOT MEASURED: - `node scripts/check-plugin-teardown-shape.mjs --self-test`: exit 3 (shallow checkout). - `pnpm check:dual-build-cjs-loads`: exit 3 (needs a full `pnpm build`). - `pnpm check:dts-closure`: exit 1. The self-test passed. The scan's red came from a local build that skipped declaration output in an earlier worktree. `@objectstack/lint` and `@objectstack/metadata-protocol` were not among the packages it named. CI's fresh build gives the real reading. The families CI runs (the repo-wide lint, `test:repo`, Check Documentation Links' lychee step, the artifact roster) are read from this PR's check-runs. They were not re-run here. </details> 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01ADHkmSwS4mQyXWrddL4r6B <!-- signed: repo:objectstack#3 · os-steve · session_01ADHkmSwS4mQyXWrddL4r6B --> --------- Co-authored-by: Claude <noreply@anthropic.com>
…hat first ship in 19 move to protocol 19 (objectstack-ai#38627) <!-- claude-projects-attribution: {"github_login":"os-steve"} --> _Requested by **Steve** · [project thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9CGtGeksBgFXURAQ8CAJhT8)_ Fixes objectstack-ai#38256 Clause-②: no Metadata-protocol: none ## 维护者速读 - 从 18 升级到 19 的团队用升级命令时,以前看不到 34 条变化说明,其中三项旧写法也不会被自动删掉;现在这些说明都列在 18 → 19 的升级提示里,三项旧写法会被自动删除。 - 修正第 19 版的升级说明,替用升级命令从 18.x 升上来的团队补上漏掉的提示和自动修改。 - 只是把说明和自动修改挪到正确的大版本下,说明内容不改,三项自动修改的先后顺序也不变;出错只影响升级提示与自动修改落在哪个版本,可以直接撤回。 - 无 ## What changes - **The set, re-derived on `origin/main` (Ask 1).** `semantic/18.*` entries present at the protocol move `204356a6e` (objectstack-ai#37314) and absent at `@objectstack/spec@18.6.0` (`958ee0359`): 579 − 545 = 34, the same 34 ids the card lists. Each is in no `@objectstack/spec@18.*` tag (all 12 read: 0 hits each) and in `19.0.0-next.0` (34 of 34). - **34 semantic entries move to step 19 (Ask 2).** `entries/semantic/18.ID.ts` becomes `19.ID.ts`, R100, ids and bytes unchanged. `gen:migration-registry` files an entry by its file name's major, and `composeMigrationChain(fromMajor)` keeps only the steps above `fromMajor`, so under 18 the 18 → 19 upgrade never listed them. - **Three of the 34 move as whole families, not entries alone.** `object-grid-single-click-edit-retired`, `view-column-state-retired` and `field-inline-edit-boolean-retired` are each the D3 record of a D2 conversion from the same window (`object-grid-single-click-edit-removed`, `view-column-state-removed`, `field-inline-edit-boolean-removed`: absent at 18.6.0, first shipped in 19.0.0-next.0). Ruling B in `migrations.test.ts` and each family's pin hold the D3 entry in its conversion's own step, and under 18 `os migrate meta --from 18` did not run those conversions either. So, per the seat's amended claim: - the three conversions move to `src/conversions/entries/19/`, `toMajor: 19`, `retiredAfter` unchanged (`18.6.0` is still the last stable release that accepted the old shape); - `src/conversions/registry.ts`: they leave `MAJOR_18_CONVERSIONS` and join `MAJOR_19_CONVERSIONS` at `order` 0.1 / 0.1 / 0.2. They were the last three of major 18 (orders 83, 83, 84), so `ALL_CONVERSIONS` runs in exactly the same sequence as before; only the step each is reported under changes. Read off the built registry: major 18's tail is now `manifest-packaging-manifest-deps-removed`, `form-view-drawer-keys-removed`, `view-personal-declarations-removed`, and major 19 starts `object-grid-single-click-edit-removed`, `view-column-state-removed`, `field-inline-edit-boolean-removed`; - each conversion's docblock says protocol 19 and `--from 18`, and the two schema comments that name a moved conversion (`src/ui/component.zod.ts` above `singleClickEdit`, `src/data/field.zod.ts` above the boolean `inlineEdit` refusal) say protocol 19. - **Four retired-key rows move to 19 (Ask 3).** `ai/KnowledgeChunk:metadata`, `ui/ObjectGridProps:singleClickEdit`, `ui/ViewItemWire:columnState`, `ui/ViewMetadata:columnState`: each is in no 18.x tag and in 19.0.0-next.0, so the card's criterion holds. The aging reading: `build-schemas.ts` check (c) proof 1 allows deleting a tombstone once `CURRENT_MAJOR - registeredAt >= 1`. At 18 these rows were deletable now, at major 19, before any stable release ever carried them; at 19 they become deletable at 20, the same as every other retirement that first ships on the 19 line. Proof 2 (the `@objectstack/spec@18.0.0` dating tag) does not date them, since none was `[RETIRED]` there. So the move corrects a verdict rather than changing one wrongly. One row's comment named the 18.x line as its reason and now says why it is under 19. - **Step 18 rationale → step 19 rationale.** The `STEP18_RATIONALE` fragments of the four moved retirements (`object-grid-single-click-edit-retired`, `view-column-state-retired`, `field-inline-edit-boolean-retired`, `knowledge-chunk-metadata-retired`) leave step 18 and their text, unchanged, joins step 19's rationale, before the form view `modalSize` sentence (placed there so it does not share the tail line objectstack-ai#38550 edits). - **Refusal text the moves made false.** `retired-key-removal-version.pin.test.ts` derives a prescription's `os migrate meta --from N` from the conversion's `toMajor`, so the `singleClickEdit`, boolean `inlineEdit` and `columnState` refusals now say `--from 18`. `KnowledgeChunk.metadata`'s tombstone said "removed in @objectstack/spec 18"; it now says 19.0.0, as its three siblings already did. That pin did not catch it because it derives the version only for retirements with a D2 conversion, and this one has none. Reference pages regenerated (`content/docs/references/ai/knowledge-document.mdx`, `ui/component.mdx`, `ui/view.mdx`). - **A sibling entry's wording.** `19.ui-form-view-modal-size-retired` (not one of the 34) called `internal-record-forms-not-loaded` "the protocol-18 semantic entry"; it now says protocol-19, since that entry moves to step 19 here and the sentence prints under the 18 → 19 hop (contract review, S1). The boolean `inlineEdit` prescription's docblock says protocol 19 too. - **Built artifacts declaring a bare `^19`.** The artifact door replays a retired conversion for a `19.0.0` floor only when its step is 19 (`converted-major-step`, `packages/metadata-core/src/artifact-forward-conversion.ts`). Such an artifact that still carried one of the three keys was refused before; it is now converted at ingestion. Artifacts declaring a floor below 19 replayed them already. The changeset says so. - **Order-dependent wording.** None of the 34 says "since the previous entry" or similar. Where an entry names another (for example `18.action-body-does-not-compile-refused` names `body-regexp-pattern-refused`, now under 19), it names the id, not a position, so it still reads right. - One `@objectstack/spec` patch changeset (Ask 4). The id-keyed `adr-0087: registered` markers in `.changeset/pre/*` and the released CHANGELOGs, which say "step 18" for these families, stay as published (AGENTS.md: release-owned). ## Tests Forced test changes, each because the family it pins moved to 19: - `src/data/field-inline-edit-boolean.pin.test.ts`: the conversion's `toMajor` and the step it is wired into read 19; the prescription regex reads `--from 18`. - `src/ui/object-grid-single-click-edit.pin.test.ts`: the same, plus `RETIRED_KEYS_BY_MAJOR[19]`. - `src/ui/view-column-state-retirement.test.ts`: the retired-key rows, the conversion and the D3 entry are read from major 19; the prescription regex reads `--from 18`. No other test changes. The chain pins (`migrations.test.ts`, `semantic-relevance.test.ts`, `step18-rationale-merge.test.ts`, `conversions-major18-merge.test.ts`) read the generated lists and pass unchanged. <details><summary>Readings (head 367d09d, base origin/main ee9fd3d)</summary> Built registry (`dist/migrations`): | | step 18 semantic | step 19 semantic | conversions 18 / 19 | retired keys 18 / 19 | `composeMigrationChain(18)` lists the 34 + the 3 of objectstack-ai#38239 | `composeMigrationChain(17, 18)` lists any | |:--|:--|:--|:--|:--|:--|:--| | before (main) | 579 | 34 | 98 / 8 | 282 / 9 | the 3 only | the 34 | | after | 545 | 68 | 95 / 11 | 278 / 13 | all 37 | none | The semantic id set over every step: 690 ids, 690 unique, before and after. Local runs: - `pnpm --filter @objectstack/spec build` under `os-verify-lock`: command-exit 0. - `pnpm --filter @objectstack/spec test` under `os-verify-lock` at 367d09d (`build` and `check:generated` clean there): `Test Files 913 passed (913)`, `Tests 28893 passed | 1 todo (28894)`. - `pnpm --filter @objectstack/spec typecheck`: command-exit 0. - `pnpm --filter @objectstack/spec check:generated --fix`: regenerated the three reference pages it proved stale. - Derived gates (`dispatch-gates.mjs --commands`) at 367d09d: 122 derived, 122 run, each exit 0; `--ran` reconciles 0 NOT-MEASURED (after `turbo run build --filter=./packages/**` and `git fetch --unshallow`, without which nine exit 3 on unmet prerequisites). - `overlap-check.mjs` before every push: clean with origin/main and with objectstack-ai#38594 (which edits `18.publish-refuses-flows-that-save-and-do-not-run.ts`; `git merge-tree` against its head applies that edit to the renamed `19.` file). One overlap, see Acceptance notes. </details> ## Acceptance notes - **Textual overlap with objectstack-ai#38550.** Both PRs insert a line into `MAJOR_19_CONVERSIONS`'s imports and list directly after `permissionViewAllFieldsBesideRecordBypass` (this one `viewColumnStateRemoved`, objectstack-ai#38550 `viewBulkActionsToActionSelection`), so whichever lands second merges main and resolves it mechanically: both lines kept, in identifier order (`viewBulk…` before `viewColumn…`). `registry.ts.template` merges clean with objectstack-ai#38550. The seat chose to open this PR rather than wait. - Released prereleases (`19.0.0-next.0` to `next.2`) carry these entries, rows and conversions under 18 and stay as published; the fix ships with the next prerelease. ## Verification Read first (by risk): 1. `packages/spec/src/conversions/registry.ts`: the three entries' new `order` values and the docblock that says why. 2. `packages/spec/src/migrations/registry.ts.template`: the four fragments moved from `STEP18_RATIONALE` into step 19's rationale. 3. The renames: `git diff --stat -M origin/main...HEAD` shows R100 for the 34 semantic entries and the three columnState / KnowledgeChunk rows. Two-minute check: in `packages/spec`, run `pnpm gen:migration-registry`, then `grep -n "object-grid-single-click-edit-retired" src/migrations/registry.ts`. On this branch the id sits inside the `semantic:19` region; on main it sits inside `semantic:18`. <!-- signed: repo:objectstack#3 · os-steve · session_01ADHkmQcqpJwkeqnruAv4md --> --------- Co-authored-by: Claude <noreply@anthropic.com>
…s own flows (objectstack-ai#38642) <!-- 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#38595 Clause-②: no Metadata-protocol: none ## 维护者速读 - 管理员把一个应用包以新的命名空间安装或复制之后,复制出来的流程调用的是复制包自己的子流程,按钮触发的也是复制包自己的流程;以前调用的是原包的流程,或者因为找不到流程而每次运行都失败。复制时如果调用方流程排在被调用流程前面,现在两个流程都会复制成功,不再被保存检查拒掉调用方;如果被调用的流程本身复制失败,调用它的流程也一并列为失败并撤回,不会留下指向不存在流程的调用。 - 属于"软件包安装与复制"这块能力,替用新命名空间安装应用包、或复制一份应用包来改的管理员解决"复制后流程跑不起来或串到原包"的问题。 - 只影响带新命名空间的安装和复制;如果改名规则出错,复制包里的某个流程调用会指向错误的名字,原包不受影响,可以直接撤回这次合并恢复原来的行为。 - 无 ## What changes `planNamespaceRename` (`packages/metadata-protocol/src/package-namespace-rename.ts`), the one rename engine behind the unmanaged install's `targetNamespace` and `duplicatePackage`, renamed a package flow under the prefix swap (`crm_child` to `crm2_child`) but rewrote no name that calls it. It now builds a flow rename map from the package's own `flow` items and rewrites a value that EQUALS a renamed flow name, whole, at: - the derived index's `flow` sites, `REFERENCE_SITES.byTarget.get('flow')`, read the same way the object sites are (by property, wherever it occurs). Dumped at runtime on this tree it holds `{fromType:'flow', property:'flowName'}` and `{fromType:'translation', property:'flows'}`, so a `subflow` step's `config.flowName` and a translation's `flows` keys follow; - the one hand-written site, commented as such in the code: a `target` whose sibling executor is `'flow'`. That is `type: 'flow'` on an action (`ActionSchema`, an object's `actions[]`, an inline action, an `action:group` member, an API endpoint) and `actionType: 'flow'` on an `action:button` / `action:icon` page block, where `type` is the component. The index cannot carry `target`, because on every other executor it names a URL, script, page, endpoint or form, and a property-wide site would rewrite those too and list them in the "Used by" answer. A flow the package does not hold keeps its name, a flow the prefix swap keeps keeps its name, and nothing is substring-rewritten. A value that is not a renamed flow name falls through to the rules every string already took, so nothing that read the same before reads differently now. Collisions work as they do for objects: a renamed flow name that meets a name the item already holds at that site (a translation keyed by both `crm_child` and `crm2_child`) refuses the item, and the refusal names the flow. The internal `atReference: boolean` of the walk became the site's rename map (object or flow), so both kinds share one walk and one collision rule. **This round (delta after PR objectstack-ai#38594 merged as d33183a).** `origin/main` was merged into this branch with a merge commit (3a7134a, no conflicts). With both changes on one tree, a parent-first `duplicatePackage` was refused by the publish gate (measurement below). So the `duplicatePackage` leg's `host.saveMetaItem` call in `protocol-package-commits.ts` now passes `copyPlanFlowNames` on a flow write, the unmanaged-install leg's way: the copy names (`rename.copyName`) of every flow row the same duplicate writes. On a non-flow write nothing is passed. The gate's rule itself is not touched; the names are additive (`pending.flows`), so they can let a call to a flow of the same copy through and refuse nothing. **Third round (L1 REWORK 7267334209, route per claim amendment 7267347516).** `duplicatePackage` is best-effort, so a planned flow can still land in `failed[]` after the gate passed its caller on the plan's word. The duplicate leg now closes its flow plan after the copy loop. Each copied flow whose `subflow` / `map` step calls a planned flow (its copy name) that was not written is taken back out of the copy, through the same `undoBatchRowWrite` the object settle uses. It is reported in `failed[]` with an error that names that callee. This repeats until nothing changes, so a caller's caller goes too. The loop reads a caller's address before and after its write for that undo, only when the caller calls a planned flow. The plan is now one list built before the loop (`planFlowSources`). The callee walk uses the spec's `FLOW_REGION_SLOTS_BY_TYPE`, the region table the publish gate walks. The install leg is not touched. ## Tests <details><summary>Engine pins, package-namespace-rename.test.ts (7 new cases)</summary> `flowName` follows; `other_flow`, an unprefixed `bare_child` and a superstring `crm_child_v2` keep their names; a flow action's `target` follows while `modal` / `script` / `api` targets equal to the same string do not; the object `actions[]`, API endpoint and page `actionType` spellings; translation `flows` keys; the collision refusal; and a copy that keeps the source namespace renames nothing. </details> <details><summary>Door pins, new package-namespace-rename-flow-refs-38595.test.ts (6 cases)</summary> The harness (`makeEngine`, `crmBody`) is copied from `package-unmanaged-install.test.ts`, which is not edited. Its automation service answers `listFlows`, so a gate that judges a step's called flow has a non-empty universe. - an unmanaged install with `targetNamespace: 'crm2'` installs, and the stored `crm2_parent` calls `crm2_child`; - the copied flow action reads `target: 'crm2_child'`, and the `modal` control keeps `target: 'crm_child'`; - with the source package installed under its own names beside the copy, the copy's `crm2_parent` calls `crm2_child`; - a call to `other_flow` keeps its name; - `duplicatePackage` into `crm2` gives the same result with the source installed, and the source still calls `crm_child`; - parity: the duplicate and the import into `crm2` store identical flow and action items. </details> <details><summary>Stacking measurement (this round), new describe in package-namespace-rename-flow-refs-38595.test.ts (2 cases)</summary> The source package is installed with its stored flow rows in the order `crm_parent` (a `subflow` step calling `crm_child`), then `crm_child`; the test asserts that order. It is then duplicated into `crm2`. The automation service holds `other_flow`, `crm_child`, `crm_parent`, never `crm2_child`. Measured at 2af21e1 (merge of `main` plus the test, before the fix), the gate refuses. `duplicated.failed` was, verbatim: ``` [{ type: 'flow', name: 'crm_parent', error: 'flow/crm2_parent failed author-time validation: 1 issue — flows[0].nodes[1].config.flowName [flow-subflow-unknown]' }] ``` and only `crm2_child` was copied (`Tests 2 failed | 6 passed (8)`). With the fix (300cf74) the case passes: `failed` is empty, both flows are stored and `crm2_parent` calls `crm2_child`. CONTROL, the gate is live in this harness: a third flow `crm_caller` calls `crm_ghost`, which the engine holds at the source install and no longer at the copy, and the package holds no such flow. The copy keeps the name `crm_ghost`, and with the fix the duplicate still refuses exactly `flow/crm_caller` with `flow-subflow-unknown` while both other flows are copied. So the plan names let through only the copy's own flows. </details> <details><summary>Withdrawal pins (third round), same describe (2 cases)</summary> - (a) L1's parent-first case. `crm_parent` calls `crm_child`, and `crm_child` calls `crm_ghost`, which the engine holds at the source install and drops before the duplicate. `failed` holds `flow/crm_child` and `flow/crm_parent`, and the parent's error names `'crm2_child'`. No flow of the copy is stored, no stored copied flow calls a flow the deployment does not hold, and the copy's object is still copied. - (b) A two-level chain, `crm_a` to `crm_b` to `crm_c`, with `crm_c` calling the dropped `crm_ghost`. All three end in `failed[]` (the errors of `a` and `b` name `'crm2_b'` and `'crm2_c'`). `crm2_solo`, outside the chain, is the only copied flow, and nothing copied calls a missing flow. - The success pins and the `crm_ghost` CONTROL pass unchanged: `Tests 10 passed (10)` for the card file at 712fda7. Ablations, each run after the fix commit 28e4856 with `scripts/ablation-replace.mjs`: - Cascade off: `if (withdrawn.length === 0) break;` became `if (withdrawn.length >= 0) break;` (blob `4ca8e112244c` to `6eec66471fb7`). Result: `Tests 2 failed | 8 passed (10)`. (a) fails with `expected [ 'flow/crm_child' ] to deeply equal [ 'flow/crm_child', 'flow/crm_parent' ]`, which is L1's measured state, and (b) fails with `expected [ 'flow/crm_c' ] …`. - Transitive step off: the line that marks a withdrawn caller as not written was deleted (blob `4ca8e112244c` to `378006812f35`). Result: `Tests 1 failed | 9 passed (10)`. Only (b) fails, with `expected [ 'flow/crm_b', 'flow/crm_c' ] …`. - Both times the tool restored the file: blob equal to HEAD, and `git diff HEAD` empty. </details> <details><summary>Ablation of the second round's line</summary> The fix was committed first (300cf74). `node scripts/ablation-replace.mjs` replaced the guard `...(singular === 'flow'` of the new spread with `...(false` (anchor 1 to 0, blob `d064b03b149a` to `f110fae517f4`). The card test file then failed both new cases (`Tests 2 failed | 6 passed (8)`): the parent-first case with the refusal above, the CONTROL because `crm2_parent` was refused beside `crm_caller`. The tool restored the file: blob equal to HEAD, `git diff HEAD` empty. </details> <details><summary>Package run at 712fda7 (third round)</summary> `pnpm --filter @objectstack/metadata-protocol typecheck && pnpm --filter @objectstack/metadata-protocol exec vitest run --maxWorkers=2` under the verify lock: `VERDICT command-exit 0`, `Test Files 374 passed | 9 skipped (383)`, `Tests 23690 passed | 45 skipped (23735)`. The 69 families `dispatch-gates --commands` derives for this round's four paths: 67 exit 0. `check:dual-build-cjs-loads` and `check:lean-entry-closure` exit 3 (PREREQUISITE NOT MET: they read every package's `dist`), so they are NOT MEASURED here and left to CI. `overlap-check`: clean. </details> <details><summary>Package run at 964a326 (second round)</summary> `pnpm --filter @objectstack/metadata-protocol typecheck && pnpm --filter @objectstack/metadata-protocol exec vitest run --maxWorkers=2` under the verify lock, after building the closure (`pnpm --filter '@objectstack/metadata-protocol^...' build`): `VERDICT command-exit 0`, `Test Files 374 passed | 9 skipped (383)`, `Tests 23688 passed | 45 skipped (23733)`. The card pins after the merge (`package-namespace-rename-flow-refs-38595.test.ts`, `package-namespace-rename.test.ts`, `package-unmanaged-install.test.ts`): `Test Files 3 passed (3)`, `Tests 152 passed (152)`. </details> <details><summary>Package run at 5ec669b (first round)</summary> `pnpm --filter @objectstack/metadata-protocol typecheck && … exec vitest run --maxWorkers=2` under the verify lock: `VERDICT command-exit 0`, `Test Files 373 passed | 9 skipped (382)`, `Tests 23670 passed | 45 skipped (23715)`. The typecheck program lists the test files. </details> <details><summary>Ablation</summary> The fix commit came first. Then `scripts/ablation-replace.mjs` swapped the one line that fills the flow rename map for a no-op (anchor 1 to 0, blob `e90813508b99` to `114356add0b3`). With that in place, 9 of the 13 new cases failed (`Tests 9 failed | 26 passed (35)`): every rewrite pin on both test files. The four that stayed green were the three controls and the parity case, which stays equal when both doors are equally wrong. The tool then restored the file: the blob matched HEAD again and `git diff HEAD` was empty. </details> <details><summary>Under PR objectstack-ai#38594's gate (head 93f3643)</summary> In a throwaway tree at that head, with this branch's two commits cherry-picked, the closure was built and both test files passed (`Tests 42 passed`). With the same ablation there, the install pins fail with the gate's own 422: `INVALID_METADATA`, `flow-subflow-unknown` at `flows[0].nodes[1].config.flowName`, "calls flow 'crm_child' … Did you mean crm2_child". So the gate is live in this harness and the pins pass under it, without depending on its code. The tree was removed afterwards. </details> ## Acceptance notes - **The parent-first duplicate is fixed in this PR now.** The first round reported that with this branch and PR objectstack-ai#38594 both applied, a parent-first `duplicatePackage` fails `flow-subflow-unknown` and writes only the child. PR objectstack-ai#38594 merged without a copy-plan on its duplicate leg, so the seat routed the fix here (claim amendment 7266007014). It was re-measured on the merged tree (see Tests) and fixed on the duplicate leg's `saveMetaItem` call alone. - The `copyPlanFlowNames` doc comment in `protocol-door-requests.ts` said "`duplicatePackage` copies stored rows, which the gate's own read of the stored flows already holds". That stopped being true once the copy's calls name the copy's flows. Per claim amendment 7266793287, 48420e0 rewords that comment only: both copy doors state the field, the names the same copy writes under their written names. In the third round (712fda7), the comment and the changeset sentence say the gate is told the flows the copy PLANS to write. They also say that on the duplicate, a caller whose planned callee was not written is withdrawn with it. No logic changes; metadata-protocol typecheck exits 0, and the 48 families `dispatch-gates --commands` derives for that path ran with 46 at exit 0 and `check:dual-build-cjs-loads` / `check:lean-entry-closure` at exit 3 (PREREQUISITE NOT MET, left to CI). - Measured with the same engine probe, outside this card: the names of other non-object items (dashboard, page, report) are renamed by the prefix swap, but their references are not. That covers app navigation's `dashboardName` / `pageName` / `reportName` and a translation's `dashboards` / `pages` / `reports` keys. A dashboard header action with `actionType: 'flow'` keeps its `actionUrl`. These are reported to the seat as one family. They are not fixed here. - Outside the dispatched file surface, added by the PM's amendment: `scripts/engine-double-contract.pinned.json` gains 3 rows (15 lines) for the new test file's copied stub engine, produced by `node scripts/check-engine-double-contract.mjs --write`. No existing row changed, and `pnpm check:engine-double-contract` exits 0 at fb44b0f and again at 964a326. - Local gates at 964a326: the 77 families `dispatch-gates --commands` derives for this diff were run; 75 exit 0, and `check:dual-build-cjs-loads` and `check:lean-entry-closure` exit 3 (`PREREQUISITE NOT MET`: they read every package's built `dist`, which this worktree built only for the closure), so those two are NOT MEASURED here and are left to CI. `overlap-check`: clean against `origin/main`, objectstack-ai#38618 and objectstack-ai#38497. - Read, not changed (for the seat): whether `importUnmanagedPackage` has the same gap on partial failure. It does not, as read at 712fda7. Its prepare pass refuses the whole install before the base exists if any item fails to convert or rename (422 or the rename refusal). Its `copyPlanFlowNames` is built from `prepared`, which is exactly the items the write loop writes. Any `saveMetaItem` throw in that loop, and any object the batch settle refuses, goes through `rollBackUnmanagedImport`, which deletes the whole new base. So on success every planned flow is written, and on failure nothing remains. The one residue is a rollback that itself fails. It is not silent: `console.error`, plus an answer saying the base could NOT be fully removed and must be uninstalled. ## Verification Read first, by risk: 1. `protocol-package-commits.ts`, the `duplicatePackage` leg's close: the withdrawal block after the copy loop (the fixpoint, the undo and the error text), and `plannedCalleesOf` with `planFlowSources` above the loop. Check that a withdrawn caller is removed from `copied` and pushed to `failed[]` exactly once. 2. `package-namespace-rename.ts`, the `deepRewrite` object branch: the child-site expression `referenceSiteOf(k) ?? (site && k === 'name' ? site : flowTargetSite(v, k))` replaced the old boolean. Object sites must behave exactly as before. 3. `package-namespace-rename-flow-refs-38595.test.ts`: the parent-first duplicate and its CONTROL, the source-still-installed case and the duplicate parity. (`flowTargetSite` and `FLOW_EXECUTOR_KEYS` in `package-namespace-rename.ts`, the one hand-written site, were read in the first round's review.) Two-minute check: `pnpm --filter @objectstack/metadata-protocol exec vitest run --maxWorkers=2 src/package-namespace-rename-flow-refs-38595.test.ts src/package-namespace-rename.test.ts` should report 2 files and 39 tests passing. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01ADHkmQJUGAAa5rz9Yi2DvW <!-- signed: repo:objectstack#3 · os-steve · session_01ADHkmQJUGAAa5rz9Yi2DvW --> --------- Co-authored-by: Claude <noreply@anthropic.com>
… whose documentBy is not a single-valued parent link (objectstack-ai#38662) <!-- claude-projects-attribution: {"github_login":"os-warren"} --> _Requested by **Warren** · [project thread](https://claude.ai/code/project/chan_01U5RdnAAmkSQmZbqh6FtqZ8?thread=cmsg_01U5RdnAAmkSQmZbqh6FtqZ8Xj6YfMRKw8XnmTA1ohBr6K)_ Fixes objectstack-ai#38537 Clause-②: no Metadata-protocol: none **Lands after objectstack-ai#38594** (merged 2026-11-30T01:10Z; main merged into this branch at `d1e1ba3f03`). Both PRs are seat 2's. The overlap is two files (`packages/lint/src/index.ts`, `packages/lint/src/rule-explanations.ts`), in hunks far apart; `overlap-check` reads both clean against each other and main. ## 维护者速读 - 用户能看到什么变化:知识源的“文档单位”(`documentBy`)如果填的不是指向父记录的单值查找字段,`os validate` / `os build` / `os lint` 和发布时都会报错并说明怎么改。之前只有在 Studio / 元数据 API 保存时才会拒绝。 - 为什么做:随包发布或代码注册的知识源不经过保存这道门,填错了没人拦,检索按父记录聚合会悄悄失效。这是 objectstack-ai#38537 的第二个也是最后一个 PR。 - 出错会怎样:只影响声明了 `documentBy` 的知识源;规则误判会让正确的知识源发布失败,删掉 `documentBy` 即可绕开。 - 要你做什么:无。 ## What changes - **New rule** `knowledge-source-document-by-not-parent-link` (`error`) in `validate-knowledge-source.ts`. It refuses a `source.documentBy` that `metadataFields` lists and that is not a single-valued parent link of the indexed object. The checks run in the save door's order: declared by the object, neither credential-class nor `internal`, a `lookup` / `master_detail` type, a target `referenceTargetOf` can read, and not `multiple: true`. Each reason gets its own message, worded like the save door's `documentUnitRefusalText`, naming the field and the fix. Path: `knowledgeSources[i].source.documentBy`. - **Where it runs.** The rule rides the existing `validateKnowledgeSource` registry entry, so it reaches `os validate` / `build` / `lint` and the runtime publish gate (`knowledge_source` writes) with no new wiring. This is what judges a source a package ships or code registers; until now only the metadata API's save door did (objectstack-ai#38564). - **Not judged twice.** A `documentBy` that `metadataFields` does not list is left to the parse, which already names that fix. A member the object does not have is reported once, as `knowledge-source-field-unknown`. An object with no readable field map is not judged. - **Published and explained.** The rule id is re-exported from the root barrel (`index.ts`, one line in the knowledge block). `rule-explanations.ts` gets its `os explain` entry and table row beside the five sibling rules. - **Census pin** (`packages/core/src/security/second-object-read-exposure.pin.test.ts`): the new `referenceTargetOf` import makes `validate-knowledge-source.ts` a caller of the reference-target arbiter, so it is classified `not-a-served-read` beside the other lint callers. It only asks whether a target is declared, and reads and serves nothing of the target. Admitted by the seat for this fix after CI's Test Core (8/12) flagged the unclassified caller. Locally: 1 failed / 3 passed before the entry, 4/4 after. - **Changeset** `patch` for `@objectstack/lint`. ## Route chosen for the parent-link rule (objectstack-ai#38564's PR 2 question) objectstack-ai#38564 left PR 2 two ways to reach `parentLinkRule` / `documentUnitOf` (`service-knowledge`'s `knowledge-search-scope.ts`). The seat accepted a third: - **A: lint imports `@objectstack/service-knowledge`.** Not taken. `@objectstack/lint`'s package description says it "Depends on @objectstack/spec; never on a runtime", and service-knowledge is a runtime service. It would also need a new line on service-knowledge's `exports` surface. - **B: move the rule to "a package lint already reads, for example `@objectstack/core`".** Not taken. Lint does not depend on `@objectstack/core`; its workspace dependencies are `formula`, `metadata-core`, `sdui-parser` and `spec`. Moving it to `spec` would put runtime-shaped logic into the protocol package and widen this PR well past its card. - **C (taken): compose the verdict in lint from the spec predicates `parentLinkRule` itself asks.** Withheld = `isMaskedOnReadFieldType(type, managedBy)` or `internal === true`. That is the reading this file already takes for `knowledge-source-field-never-indexed`, and the one `collectCredentialWriteResponseFields` / `collectInternalWriteResponseFields` compute in core. Target = `referenceTargetOf` (`@objectstack/spec/data`). The type pair `lookup` / `master_detail` is spelled locally, as eight other lint rule files already spell it. Cost: the four-part rule now lives in two places. No test pins their agreement, because no package that depends on both can import `documentUnitOf` without one more barrel line in service-knowledge. The module header names the save door's function so a change to one points at the other. ## Why ADR-0161 K4: "a packaged item meets the gates that need no principal in `os validate` and at publish". `documentBy` is such a gate: it reads only the object definition. objectstack-ai#38564 left it judged at save only, and its body says "PR 2's `os validate` rule covers packaged sources." ## Clause-② and Metadata-protocol, measured from the diff `Clause-②: no` / `Metadata-protocol: none`, a judgement call stated here for review. The rule refuses values of `source.documentBy`, a key objectstack-ai#38564 added in this same prerelease line. Its changeset `.changeset/38537-knowledge-document-by.md` is still pending (not moved to `.changeset/pre/`), so no published version carries the key and nothing an author could write against a release is refused. The metadata API's save door already refuses the same values. Read against `main` instead, a packaged source with a non-parent-link `documentBy` passed `os validate` before this PR and fails it after. If review prefers that reading, the lines become `Clause-②: no (narrowing)` / `Metadata-protocol: narrowed` (level `minor` and an ADR-0087 disposition). ## Verification ### Acceptance (the card's `os validate` half) | Card line | Test (`validate-knowledge-source.document-by.test.ts`) | |:--|:--| | Refuse a text field, a `user` field, an `internal` lookup and a `multiple` lookup, each naming the fix | "refuses a text field / a user field / an internal lookup / a multiple lookup as the document unit, naming the field and the fix" | | (the save door's other reasons) | "… a credential-class field", "… a lookup with no readable target", "… a system column the platform adds" | | Positive controls | "CONTROL: a lookup and a master_detail to the parent are admitted", "CONTROL: a source without documentBy is judged as before" | | Same verdict at publish | "refuses the publish with the words os validate prints", "CONTROL: a single-valued parent link publishes with nothing to report" | | Published id + `os explain` | "the root barrel re-exports it", "os explain answers it" | ### Ablation (`scripts/ablation-replace.mjs`, each mutation verified on disk, each restore verified blob == HEAD `d9f63681062f` with an empty `git diff HEAD`) <details><summary>Call site disabled (<code>const refusal = documentUnitRefusal(…)</code> → <code>undefined</code>): 9 red</summary> `validate-knowledge-source.document-by.test.ts`: 9 failed / 8 passed. All seven refusal tests, "a fields array is read like a field map", and "refuses the publish with the words os validate prints". The controls stay green. </details> <details><summary><code>multiple</code> arm deleted: 1 red</summary> 1 failed / 16 passed: "refuses a multiple lookup as the document unit…". </details> <details><summary><code>internal</code> half of the withheld arm removed: 1 red</summary> 1 failed / 16 passed: "refuses an internal lookup as the document unit…". (A first attempt was refused by the tool before running anything, because its replacement text already occurred in the file; it was re-run with a distinct replacement.) </details> ### Package suite and typecheck - `pnpm --filter @objectstack/lint test`: Test Files 248 passed (248), Tests 9989 passed / 5 skipped. Exit 0. - `pnpm --filter @objectstack/lint typecheck` (tsc + test layer): exit 0. - `eslint` on the four changed source files: exit 0. - `overlap-check`: VERDICT clean exit 0. origin/main merges cleanly, and so do the 7 open PRs sharing a file (objectstack-ai#38651, objectstack-ai#38650, objectstack-ai#38643, objectstack-ai#38605, objectstack-ai#38594, objectstack-ai#38550, objectstack-ai#38497). ### Derived gate families (`dispatch-gates.mjs --commands`, 70) - First pass, captured per the tool's idiom: `--ran` reports "70 derived famil(ies) accounted for — 66 run, 4 NOT-MEASURED (4 DERIVED from a recorded exit 3)". All 66 that ran exited 0, including `check-changeset-no-major --base origin/main`, `check-adr-0087-registration --base origin/main`, `check:doc-authoring`, `check:issue-citations` and `check:cross-package-test-inputs`. - The four exit-3 families each had a prerequisite missing. Three were re-run after fixing it, each exit 0: `check-plugin-teardown-shape --self-test` (needed `git fetch --unshallow`), `check:docs-transcript-drift` (needed the built lint) and `check:lean-entry-closure` (needed the built objectql). These re-runs were by hand, outside the `--ran` record. - `check:dual-build-cjs-loads` was not measured locally: it reads every package's `dist/`, which needs a full build. CI's `Build Core` job runs it on this PR. ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic. (spec untouched) - [x] 2. Every name I added uses the casing for its kind. - [x] 3. No formatter ran; `pnpm lint` passes (eslint on the changed files). - [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: n/a. - [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 维护者速读 block is the maintainer's Chinese brief). - [x] The *Before Submitting* list in CONTRIBUTING.md is done. ## Read first 1. `packages/lint/src/validate-knowledge-source.ts`: `documentUnitRefusal` and the call site after `judgeMembers('metadataFields')`. 2. `packages/services/service-knowledge/src/knowledge-search-scope.ts`: `parentLinkRule` / `documentUnitOf`, the save door's rule this one restates. **Two-minute check:** `pnpm --filter @objectstack/lint exec vitest run src/validate-knowledge-source.document-by.test.ts`. Expect 17 passed. Dogfood: n/a (no `!` in the title, no `(narrowing)` arm). 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01JQwxbWsSJprjGydwaCH1gD <!-- signed: repo:objectstack#2 · os-warren · session_01JQwxbWsSJprjGydwaCH1gD --> --------- Co-authored-by: Claude <noreply@anthropic.com>
… that name no package give the answer the read names (objectstack-ai#38752) <!-- claude-projects-attribution: {"github_login":"os-steve"} --> _Requested by **Steve** · [project thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9BzWvmsAKskRGFXQ4iwDJDW)_ Fixes objectstack-ai#34452 Refs objectstack-ai#34346, objectstack-ai#34417, objectstack-ai#33904, objectstack-ai#34258 (the fold's members, closed into objectstack-ai#34452 on 2026-11-20) and objectstack-ai#33127 (heal 2 only) Clause-②: no (narrowing) Metadata-protocol: none Skills-docs: none — no key an author writes changes; the moved answers are writes, a restart and action reads that name no package, which the skills already teach as "name the package" ## 维护者速读 - 用户能看到什么变化:同名元数据在不点名包时,写入、重启后的读取、动作的读取,都和读取给出同一个答案:停用包当作不存在,环境自己的条目先答,不再随保存或注册顺序变化。 - 为什么做:这是同名读取折叠组 objectstack-ai#34452 的写门与水合半边(读门半边是已合并的 objectstack-ai#38640),合并即关 objectstack-ai#34452;四张成员卡与 objectstack-ai#33127(只修第二处 heal 2)随折叠组关闭。 - 出错会怎样:不点名包、去写或读共享名字的调用方,会改拿 409 冲突或环境自己的条目;点名包就能拿回原来那份。改动可以整体撤回。 - 要你做什么:无(契约复审由席位送审)。 ## What changes Five criteria, one commit each, on `main` after objectstack-ai#38640: 1. **objectstack-ai#34346** (9d731b0): two enabled packages ship a name, and its stored rows are bound to a disabled package D and to one of them, E. The bare publish save, the bare draft save and the bare delete now refuse 409 naming the two enabled holders, as the bare read does. They never name D, and they write or remove nothing. `?package=E` saves and deletes as before. Before, the publish save wrote E's row (200), and the draft save and the delete refused naming E and D. (packages/metadata-protocol/src/protocol-save.ts, protocol-diff-delete-load.ts) 2. **objectstack-ai#34417** (0a14e90, criterion rewritten by the seat to ruling 6942962369): the environment's package-less doc row, hydrated after the artifacts registered (`loadMetaFromDb`), answers first on every bare door, on both transports and in both registration orders. Each holder's exact address (the plain read and `/layers`) reads that holder's own doc. Before, the hydrator grafted the first registered holder's envelope onto the row, so `?package=FIRST` served the environment's row under that holder's name and the bare doors refused 409. (protocol-registry-hydration.ts) 3. **objectstack-ai#33127 heal 2** (a8bf411, `Refs`): for the three healed overlay types, a package-less row with no holder served wears no envelope and is recorded with no holder, by the hydrator and by the heal alike. The enable that later serves one holder builds the row under that holder's envelope, as the hydrator lays it then. Before, the lookup that names no package answered a disabled holder's artifact, and the heal dropped the record. No door's answer moves (registry-only; the pins are in packages/objectql/src/package-scoped-exact-qualifier.test.ts). 4. **objectstack-ai#33904** (616d76d, b61bcd2, 73c2de8 and 9910fbc, ADR-0150 D4, ruling 6942962369): a package's action of a name on one object, and the environment's own package-less action of the name on another object that no package's action of the name binds, are separate items at D4's key `(package, objectName, name)`. One predicate, `holdsEnvironmentOwnAction` (sys-metadata-repository.ts), reads the environment's own action off the item's active rows. The read naming no package serves its row and version, the merged list slots an action by `(name, object)` where a package's action of the name binds that object, an object-less action being a key of its own (elsewhere, by name as on `main`, so a platform item and the environment's object-less row of its name stay one slot, which `/actions/_env/OBJECT/NAME` reads as the platform item's key: runtime action-package-addressing.test.ts), and the delete naming no package removes the environment's row and retires the registry's bare-slot entry it left. With no such row, every door answers as before. Before, the plain read, `/layers` `effective` and `/published` served the package's item, the list named only it, and the delete removed the package's row. The same holds with the package's action object-less and the environment's on an object (73c2de8; before it, the list named only the package's). **List cells with no environment-own action** (73c2de8, declared in the changeset bullet "The merged action list where a package binds the object" and in the `environment-action-on-another-object-answers-first` entry). Two packages P1 on `account` and P2 on `contact`, a package-less row on `account`: FROM the row listed under both packages and P2's own action dropped, TO the row listed as P1's customization and P2's own action listed. A list scoped to a code package on `account`, the environment's row on `contact` passed as a stand-in: FROM the package's slot serving the environment's body, TO the package's own action. A platform action of the name (no package, no stored row) on `lead`, or object-less, beside a package's action on `account` or object-less (9910fbc, the contract review's S3): FROM the platform action dropped, TO both listed (the bound variant moved at 616d76d, the object-less one at 73c2de8); the bare read already refuses that name 409 naming both, so the list now names the two candidates the refusal names. Pins: packages/metadata-protocol/src/protocol.action-list-slot-key.test.ts, red on `main` (8) and on b61bcd2 (3: the object-less cells). 5. **objectstack-ai#34258** (fa54140, ADR-0150 D3/D4): a package-less action row is withheld or served by the holders at its own `(object, name)` key, not the name's. With two or more holders bound to the key, the envelope lookup (`lookupArtifactItem`, protocol-artifact-lookup.ts) lends the ONE enabled holder's envelope; with two enabled holders, or none, it answers as before. The face's withhold judges the key's holders (`actionKeyHoldersOf`, protocol-meta-item-face.ts). Before, a disabled and an enabled holder on the row's object made the row wear the disabled one's envelope when it registered first, and the read withheld it (404). And an enabled package holding the name on another object kept a key whose every holder is disabled served. **Narrowing cell.** Every holder on the row's object disabled (A and B on `account`), an enabled C holding the name on `contact`, the environment's row on `account`: the read naming no package moves FROM 200 serving the row (the name's holders were judged, and C is enabled) TO 404, as a key whose every holder is disabled answers with no other holder of the name. The `!` and `Clause-②: no (narrowing)` cover it. Pin: rest `[objectstack-ai#34258]` "A and B disabled on `account`, C enabled on `contact`" (the "objectstack-ai#34258 key" ablation arm turns it red). The changeset bullet, the `package-less-action-row-judged-at-its-key` entry and the pin title give it as FROM 200 → TO 404 (b0e3f1d, text only). Plus (10c011f) four ADR-0087 semantic entries under step 19: `bare-write-beside-disabled-row-refused-naming-shippers`, `hydrated-doc-row-wears-no-holder-envelope`, `environment-action-on-another-object-answers-first` and `package-less-action-row-judged-at-its-key`. Also the changeset `.changeset/34452-same-name-writes-and-hydration.md` (BREAKING banner, FROM and TO per criterion; objectstack-ai#33127 heal 2 noted as moving no door). What `Fixes objectstack-ai#34452` leaves open, each with its home: - objectstack-ai#34452's scope appendix 7259555802 listed an `_env` cell (the `_env` draft and layered reads answering 409 naming the disabled registry holder). It is moved out of this PR on the seat's ruling, because it is a different mechanism: `admitEnvironmentQualifier` falls back to registry holders, disabled ones included. Filed as objectstack-ai#38753. - objectstack-ai#33127 heal 1 (see Acceptance notes): filed as objectstack-ai#38754. - A bare read of a name whose every holder is disabled answers 404: not to be done, ruled on objectstack-ai#34348 (7187668758). - With ONE enabled shipper beside a disabled one, the bare draft save and the bare delete still refuse 409 naming the disabled package: filed by the seat as objectstack-ai#38769, closed as a duplicate into objectstack-ai#38753 (the `packagelessHolderRefusal` docblock names it as a known gap, citing objectstack-ai#38753). - The hydrated doc row's envelope with one shipper: filed by the seat as objectstack-ai#38770. ## Tests Flipped pins (each pinned the FROM the criterion moves): - packages/runtime/src/domains/meta-disabled-holder-artifact-door.test.ts: the review M1 CONTROL that pinned objectstack-ai#34417's FROM is replaced by the criterion's `[objectstack-ai#34417]` pin. - packages/metadata-protocol/src/protocol.packageless-save-address.test.ts: the objectstack-ai#33904 FROM pins (the read and the delete naming no package answering P's item) now assert the TO. - packages/qa/dogfood/test/action-save-packageless-other-object.dogfood.test.ts and action-list-packageless-other-object.dogfood.test.ts: the objectstack-ai#33904 FROM legs (read, delete, list) now assert the TO. New pins: - `[objectstack-ai#34346]` in packages/runtime/src/domains/meta-disabled-holder-served-stack.test.ts: the three bare writes refuse naming the two shippers and nothing moves, plus a `?package=E` CONTROL. - `[objectstack-ai#34417]` in meta-disabled-holder-artifact-door.test.ts: both transports, both registration orders. - `[objectstack-ai#33127 heal 2]` in packages/objectql/src/package-scoped-exact-qualifier.test.ts: the enable while no holder is served, and the hydrator run in that state. - packages/runtime/src/domains/meta-environment-action-other-object-33904.test.ts (new file): every door naming no package, the list, a restart, the delete, the version, plus CONTROLs with no environment row. - packages/metadata-protocol/src/protocol.action-list-slot-key.test.ts (new file, 73c2de8): the list's slot key, cell by cell with each FROM in the title, plus five CONTROLs (a platform action on the package's object sharing its slot, a customization on the package's object, an object-less customization, a platform item with the environment's object-less row kept one slot, another type slotted by name). - `[objectstack-ai#33904] P's action OBJECT-LESS, the environment's on \`task\`` in protocol.packageless-save-address.test.ts (73c2de8): the list names both, the bare read serves the environment's, the bare delete removes the environment's row. - `[objectstack-ai#34258]` in packages/rest/src/meta-qualified-item-route.test.ts: two disabled holders on the key beside an enabled one on another object (404, both orders), plus the card's CONTROL (one disabled and one enabled on the key: served as C's customization). ## Acceptance notes - objectstack-ai#33127 heal 1 (S1) is not done, on the seat's ruling (objectstack-ai#38754): an install sends no notice, so there is no trigger for it. With an install in that state, every door answers 409 naming E and F in all three states. Only the registry's scoped read of E and the execution list keep the row until the next unscoped hydration. Reported to the seat. - objectstack-ai#34258: the name-grain stored-row check (`enabledRowHolds`) stays as on `main`. A key-grain filter was written and ablated. It turned no pin red, because a sealed holder's rows are declined first (`declinesStoredRow`), so it was dropped as unreachable. - The envelope lookup keeps its earlier answer for two enabled holders at one key (`protocol-artifact-lookup.action-owner-key.test.ts` CONTROL, unchanged). The bare read refuses that name before any envelope. - Rebased over objectstack-ai#38594 (merged), which added `rollback` to the disabled-holders verb. The two helpers this PR adds (`enabledHoldersRefusal`, `disabledRowHoldersRefusal`) take every verb but `rollback`: no rollback door calls them, and the 409 message has no rollback wording. ## Verification Head 5db4acc. It adds two commits to 73c2de8: 9910fbc (the contract review's S3: the platform-action list cell declared in the changeset bullet and the `environment-action-on-another-object-answers-first` entry, the count corrected to three cells, three pins and a CONTROL; no code moves) and 5db4acc (N5: the known-gap note cites objectstack-ai#38753). On them, under the lock (`VERDICT command-exit 0` each): spec build, `gen:migration-registry` no diff, spec migrations 209/209, spec `test:repo` 1608/1608, the two metadata-protocol list and save-address files 120/120 (the list file 13/13), typecheck of metadata-protocol and spec; gate families 1 to 81 of the 103 ran on 9910fbc and 82 to 103 plus `check-issue-citations` on 5db4acc (the two differ by one comment), every one exit 0, `dispatch-gates --ran`: 103 derived, 103 run, 0 NOT-MEASURED; overlap-check `VERDICT clean exit 0` against `origin/main` 6ba8ddd. On 73c2de8 every CI check passed, `Dogfood battery (opt-in)` included (66 success, 13 skipped); a new run is owed on this head. On 73c2de8, on `main` cb8d853 (after objectstack-ai#38640, objectstack-ai#38594, objectstack-ai#38699 and objectstack-ai#38712), in this container, heavy runs under `scripts/pm/os-verify-lock.sh` (shared box). 73c2de8 answers the contract review (S1, S2, N1 to N3): a package's object-less action is a list key of its own, the two list cells that moved are measured, pinned and declared FROM and TO, and three text fixes (the `packagelessHolderRefusal` docblock keeps its known gap; the bare-write entry's surface excludes a stored package-less row; the hydrated-doc entry counts a disabled shipper). On it, under the lock (`VERDICT command-exit 0`, held 1h27m40s): `pnpm build` 123/123; `gen:migration-registry` no diff; spec migrations 209/209; metadata-protocol 23813 passed / 45 skipped; runtime, the whole package, 658 files, 12568 passed / 27 skipped; rest 9099 / 351 skipped; objectql 14570; the two dogfood files 6/6; `test:repo` of objectql, rest, runtime, spec, core and types; typecheck of metadata-protocol, runtime, rest, spec and objectql; all 103 derived gate families exit 0 (`dispatch-gates --ran`: 103 derived, 103 run, 0 NOT-MEASURED); overlap-check `VERDICT clean exit 0` against `origin/main` bb86347. b61bcd2 fixes two CI reds of b0e3f1d, both from objectstack-ai#33904's list slot: the local helper's name `actionObjectKey` was the objectstack-ai#14878 dead member the tree-wide repo pins refuse (renamed `actionSlotSuffix`), and slotting EVERY action by object split a platform item from the environment's object-less row of its name, so `/actions/_env/lead/approve` served the platform item instead of 404 (runtime action-package-addressing.test.ts; bisected with rebuilt dists: `main` and the first three commits green, 616d76d red). On b61bcd2, under the lock (`VERDICT command-exit 0`): metadata-protocol 23803 passed / 45 skipped; runtime, the WHOLE package, 658 files, 12568 passed / 27 skipped; `test:repo` of runtime, objectql, rest, spec, core and types; rest 9099 / 351 skipped; the two dogfood files 6/6; typecheck of metadata-protocol and runtime; `check:issue-citations`, `check-nul-bytes`, `check:adr-symbol-anchors`, `check:slot-lookup`, `check:type-check-debt`, `check:query-options-erasure`, `check:undeclared-dep-imports`, each exit 0; overlap-check clean. The earlier local runtime reading covered `src/domains` only, which is how this cell was missed. b0e3f1d (the L1 delta) changes text only: the changeset bullet, the entry, a pin title and two docblocks. On it, under the lock (`VERDICT command-exit 0`): spec build, `gen:migration-registry` (no diff), spec migrations 209/209, the CLI `migrate-meta-engine-guidance` pin 3/3, `check-adr-0087-registration`, `check-changeset-no-major`, `check-empty-changeset`, rest `meta-qualified-item-route.test.ts` 439/439, metadata-protocol typecheck, `check:upgrade-guide`, `check:issue-citations`, `check-nul-bytes`, each exit 0; overlap-check clean. <details><summary>Suites</summary> Under the verify lock: `VERDICT command-exit 0` (held 1h12m59s). | run | exit | result | |:--|:--|:--| | `pnpm install --frozen-lockfile` | 0 | | | `pnpm --filter @objectstack/spec gen:migration-registry` | 0 | no diff | | `pnpm --filter @objectstack/spec exec vitest run src/migrations` | 0 | 5 files, 209 tests | | `pnpm build` | 0 | 123/123 tasks | | `pnpm --filter @objectstack/metadata-protocol test` | 0 | 376 passed, 9 skipped files; 23803 passed, 45 skipped tests | | `pnpm --filter @objectstack/objectql test` | 0 | 641 files, 14570 tests | | `pnpm --filter @objectstack/rest test` | 0 | 442 files; 9099 passed, 351 skipped tests | | `pnpm --filter @objectstack/runtime exec vitest run --maxWorkers=2 src/domains` | 0 | 245 files; 7487 passed, 6 skipped tests | | dogfood, the two files this PR changes (`action-save-packageless-other-object`, `action-list-packageless-other-object`) | 0 | 2 files, 6 tests | | `typecheck` of metadata-protocol, runtime, rest, spec, objectql | 0 each | | The full dogfood battery is not run locally: this PR's title carries `!`, so it is owed by the opt-in CI lane (`Dogfood battery (opt-in)`) on this head. For reference, an earlier full dogfood run on the same commits over `main` 830ff8b passed: 495 passed and 3 skipped files, 4187 passed and 68 skipped tests. That earlier run also found three type errors after the rebase onto objectstack-ai#38594 (the verb above, and an `undefined` narrowing in `lookupArtifactItem`). They were fixed in the commits that introduced them, and the runs above are on the fixed head. </details> <details><summary>Ablation (dev-ablation.md: commit first, mutate with ablation-replace, rebuild, dist preflight, run, restore from HEAD, prove an empty git diff HEAD, rebuild, preflight --absent)</summary> Run on the branch before the rebuild from `main`. The code is the same, apart from the two type-only fixes named under Suites, which move no runtime path. | arm | mutation | pins red | restored | |:--|:--|:--|:--| | objectstack-ai#34346 | the bare-write refusal beside a disabled binding made conditional (two guards in protocol-save.ts) | runtime `[objectstack-ai#34346]` 4 | diff empty, marker absent | | objectstack-ai#34417 | the hydrated environment doc grafts the holder's envelope again | artifact-door `[objectstack-ai#34417]` 2 | diff empty, marker absent | | objectstack-ai#33127 heal 2 | the no-holder-served branch and its record made conditional | objectql `[objectstack-ai#33127 heal 2]` 2 | diff empty, marker absent | | objectstack-ai#33904 predicate | `holdsEnvironmentOwnAction` answers false | metadata-protocol 3, runtime 3 | diff empty, marker absent | | objectstack-ai#33904 list slot | the list slots actions by name again | metadata-protocol 2, runtime 2 | diff empty, marker absent | | objectstack-ai#33904 list slot, b61bcd2 | arm A: by name again; arm B: every bound object joins the slot (the b0e3f1d rule) | A: metadata-protocol 2, runtime 2, dogfood list 2; B: runtime `action-package-addressing` 1 | each: `git status --porcelain` empty, rebuilt, marker absent | | objectstack-ai#33904 list slot, 73c2de8 | an object-less action is no key of its own again (the b61bcd2 rule) | metadata-protocol 3 (the two object-less list cells and the object-less pin in packageless-save-address); runtime 0 | `git status --porcelain` empty, rebuilt, marker absent | | objectstack-ai#33904 delete heal | the bare-slot entry is not retired on delete | runtime 1 | diff empty, marker absent | | objectstack-ai#34258 lookup | the one enabled holder at the key no longer lends the envelope | rest `[objectstack-ai#34258]` 1 (the CONTROL) | diff empty, marker absent | | objectstack-ai#34258 key | the face's key-grain withhold made conditional | rest `[objectstack-ai#34258]` 1 | diff empty, marker absent | | objectstack-ai#34258 stored rows | a key-grain filter on `enabledRowHolds` (since dropped) | 0: unreachable, see Acceptance notes | diff empty, marker absent | The lookup leg was run again after the fix kept the earlier answer for two enabled holders (the lookup CONTROL in metadata-protocol had gone red in the full suite): 1 red, restored. An `ablation-dist-preflight --absent` reading exits 3 while untracked files are in the tree, even when the dist reading passes; the final readings were taken on a clean tree. </details> <details><summary>Gates</summary> `node scripts/pm/dispatch-gates.mjs --commands` derived 103 families for this diff. All 103 ran on 73c2de8, again across 9910fbc and 5db4acc (see Verification), and before them on 10c011f, after the build above, each with `< /dev/null`, and every one exited 0. This includes `check:type-check-debt`, `check:query-options-erasure` and the `migrate-meta-engine-guidance` CLI pin. `dispatch-gates --ran`: 103 derived, 103 run, 0 NOT-MEASURED, 0 UNRUN. `node scripts/pm/overlap-check.mjs`: merges cleanly with `origin/main` 6ba8ddd, `VERDICT clean exit 0`. </details> 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01ADHkmQmQ1jpFsNcARMbY56 <!-- signed: repo:objectstack#3 · os-steve · session_01ADHkmQmQ1jpFsNcARMbY56 --> --------- Co-authored-by: Claude <noreply@anthropic.com>
Requested by Jianguo · project thread
Fixes #35143
Supersedes #38241 (closed, 7256687325)
Clause-②: yes (narrowing)
Metadata-protocol: narrowed
Skills-docs: follow-up #38259 — skills/objectstack-automation/SKILL.md (the
subflowrow saysos validatewarnsflow-subflow-unknown; it does not say the publish refuses a call to a flow nothing in the deployment holds), skills/objectstack-automation/evals/flows-triggers-approvals.json (the eval that namesflow-subflow-unknown)维护者速读
What changes
The card's last two open lines, re-verified on
main(1208460) first.F1, option label in decision-node and edge conditions: already covered on
main, no change here.flow-condition-option-labelreads every edge condition and everydecisionnode'sconditions[].expression(and query filter operands) since #37491 (optionLabelsBeyondStartinvalidate-flow-trigger-readiness.ts, aterror, same id, runtime gate and CLI). Its positive and negative pins are inflow-publish-checks-second-batch.test.ts, describe "past the start condition". The card gets a line saying so.F6, a
subflow/mapstep calling a flow that does not exist: now refused at the publish gate. It was a CLI-only warning because the gate's per-write snapshot holds just the written flow. The gate now judges the call against the names of every flow the deployment holds, which the host states on a flow publish:includeDisabledPackages, so a disabled package's are included);pending.flows), so a package that ships a flow with its caller publishes;copyPlanFlowNames, new in this head), so a package whose flow calls a sibling it declares later installs;listFlows), so a flow registered straight into the engine with no metadata row resolves.A call that names none of them, and is not the written flow itself, is an
error(flow-subflow-unknown):executeanswersFlow 'X' not foundon every run.Severity per door:
os validate/lint/compile/build):warning, unchanged. The stack is one app, and another installed package may ship the called flow.error. The set is the whole deployment, so "held nowhere" is decided, the lint: an overlay write (no package) of a list view bound to an object that exists nowhere answers 200 with no issue —validateListViewFieldRefsskips it and no other rule judges aviewwrite's binding #24668 reading of a whole collection.listFlows(each logged once atwarn) and an empty set. A missingsys_metadatatable is no stored flow: the other sources still decide. An empty set with no closure is no universe (lint: an overlay write (no package) of a list view bound to an object that exists nowhere answers 200 with no issue —validateListViewFieldRefsskips it and no other rule judges aviewwrite's binding #24668).outside-closure) is not judged here. This rule never refuses a call the engine would accept.Wiring:
@objectstack/lint:validateFlowSubflowTargets(stack, { deploymentFlowNames }), theAuthoringRuleContext.deploymentFlowNamesinput, andrunRuntimeAuthoringRules({ deploymentFlowNames }). The rule's registry entry moves totier: 'gating',surfaces: CLI_AND_RUNTIME,runtimeTypes: ['flow']. Its runtime pass judges nothing without stated names. The rule's explanation text is updated.@objectstack/metadata-protocol:evaluateRuntimeAuthoringGate({ deploymentFlowNames })adds the batch's flow drafts.judgeRuntimeAuthoringRulesreads the names only on a flow write whose body calls another flow (flowCallsAnotherFlowinruntime-authoring-gate.ts;deploymentFlowNamesOf,automationFlowNames,registeredFlowsWithDisabledinprotocol-authoring-gate.ts), through the host's existingservicesRegistry; the registry is listed with its disabled packages, since the served listing drops their items. The stored names are onesys_metadataread,type$inboth spellings, projected tofields: ['name'].saveMetaItemtakes a server-onlycopyPlanFlowNames(protocol-door-requests.ts), whichimportUnmanagedPackagestates on each flow write and the save door hands the gate aspending.flows.protocol.tsmoves no line: one docblock (thependingfield) is reworded in place.@objectstack/spec: the ADR-0087 entrypublish-refuses-flows-that-save-and-do-not-runnow counts eight errors at the publish gate, seven of them also on the CLI: itssurfacenames thesubflow/maprefusal, the warnings sentence says which door each warning is silent at, the acceptance line is no longer seven, and the reason says what holds for a package install.No rule is added, so no "author-time rules (N)" count moves.
Rework on contract review 7238045522 (FAIL at
bc21970eab)This PR continues #38241 (seat 6's branch
claude/issue-35143-flows-leftovers, whose dev ran out of budget). It starts at that head, mergesmain, and closes every open item of the review:importUnmanagedPackagestates its plan's flow names on each flow write (copyPlanFlowNames), which reach the gate aspending.flows, the batch's channel. Pinned inpackage-unmanaged-install.test.ts, describe "a flow calling a sibling flow of the same package": a package declaringcrm_parent(callscrm_child) beforecrm_child, on a protocol whose automation service holds another flow, installs both; the control (a call to a flow nothing holds) is still refused 422 and leaves no row and no base.duplicatePackageis unchanged: it copies stored rows, which the gate's stored read already holds (the review's own reading).fields: ['name']; none at all for a flow that calls no other flow, or only itself. Pinned on the shared harness.surface,reasonandacceptanceCriteriarewritten as above.saveMetaItemon the shared harness: a store read that throws (accepted, onewarn), alistFlowsthat throws (accepted, onewarn), and a missingsys_metadatatable (nowarn; a call to an engine or registry flow is accepted and a call to nothing is still refused).sealedFlowNodeTypeVocabularydocblock is back above its function. N2–N5 are left as the review graded them (no effect on correctness); see the acceptance notes.Patch round on contract review 7257069704 (PASS, S4 open at
a7c00fdd85)includeDisabledPackages: true(registeredFlowsWithDisabled), so a call to a disabled package's flow is let through, as a draft is: the flow is held, and runs once its package is enabled. The docblock, the changeset and this body now say what the code does. Pinned throughsaveMetaItem; removing the option fails the pin.reasongives the right cause (the install states its flow names) and says the rename covers prefixed names only; thependingdocblocks, the lint docblocks and theos explaintext name a package install's flows and a disabled package's; the changeset's Exports bullet namessaveMetaItem'scopyPlanFlowNamesand no longer namesevaluateRuntimeAuthoringGate. N9 and N10 stand as accepted.Why
#35143 "Done when": each line is a rule with its pins, or a line on the card saying which rule covers it. F1 is the second case and F6 is now the first. The hosted copy of the subflow check can be deleted.
Tests
Lint: new pins in flow-publish-checks-second-batch.test.ts (describe flow-subflow-unknown)
warning.error, pathflows[0].nodes[1].config.flowName, message opening,rulesRunnames the rule.mapcall inside a loop body:erroratflows[0].nodes[1].config.body.nodes[0].config.flowName.Metadata-protocol: the describe in protocol.runtime-authoring-gate.test.ts (the shared harness), end to end through saveMetaItem
INVALID_METADATA, issueflow-subflow-unknownat the path, nothing stored.includeDisabledPackages) resolves; a call to nothing in the same case is still a 422.{ where: { type: { $in: ['flow', 'flows'] } }, fields: ['name'] }; a flow calling only itself, and a flow with no call, read nothing.warnnaming the cause; alistFlowsthat throws, the same; a missingsys_metadatatable, nowarn, engine and registry flows still resolve and a call to nothing is still a 422.evaluateRuntimeAuthoringGate: a flow inpending.flowsresolves; without it the call is refused.Metadata-protocol: new describe in package-unmanaged-install.test.ts (M1)
crm_parent(asubflowstep callingcrm_child) beforecrm_child, with an automation service holdingother_flow: installs, both flows stored active.crm_parentcallingcrm_nowhere: refused 422 withflow-subflow-unknown, no active row left, the basecom.example.crm-copyremoved.targetNamespace: 'crm2'is refused 422 (flow 'crm2_parent' could not be written … flows[0].nodes[1].config.flowName [flow-subflow-unknown]) and rolled back, because the rename does not rewriteconfig.flowName; see the acceptance notes.Ablations (each fix removed on disk from the committed head, then restored with git checkout HEAD)
importUnmanagedPackagestates nocopyPlanFlowNames: "installs a package that declares the calling flow before the flow it calls" fails (1 failed / 1 passed).flowCallsAnotherFlowguard dropped): "reads the stored names once …" fails (1 failed / 7 passed).includeDisabledPackages: "lets a call through to a disabled package's flow …" fails (1 failed).Suites (head 93f3643, main merged at 3014176; under os-verify-lock)
@objectstack/linttest: 246 files / 9962 tests passed. typecheck exit 0.@objectstack/metadata-protocoltest: 372 passed / 9 skipped files, 23660 passed / 45 skipped tests. typecheck exit 0.protocol.runtime-authoring-gate.test.ts+package-unmanaged-install.test.ts: 383/383.@objectstack/specsrc/migrations: 5 files / 209 tests.pnpm --filter @objectstack/dogfood testunder the lock after a clean closure build (exit 0): VERDICT command-exit 0, Test Files 495 passed / 3 skipped (498), Tests 4187 passed / 68 skipped (4255), no failure.Acceptance notes
outside-closurecall still fails at run time. Judging that would need the resolver's verdict at the door.targetNamespace) renames its flows but not theconfig.flowNamethat calls them, so a package whose flow calls a sibling is now refused and rolled back unless the deployment holds the old name. Onmainit installed with a step that fails on every run. Making the rename follow flow names is outside this card; reported to the seat as a finding.listFlowsis read with no seal; N3 the empty-set exit depends on the door; N4 the "did you mean" suggestion draws on the unfiltered stored read; N5rulesRunnames the rule on a write where it judged nothing.Verification
packages/metadata-protocol/src/protocol-package-commits.tsimportUnmanagedPackage(copyPlanFlowNames) withprotocol-save.ts(where it becomespending.flows);packages/metadata-protocol/src/protocol-authoring-gate.tsdeploymentFlowNamesOf(the union, the projected read, the no-verdict exits),packages/lint/src/authoring-rules.tsthevalidateFlowSubflowTargetsentry (runtime pass with no names = nothing),packages/lint/src/validate-flow-trigger-readiness.tsvalidateFlowSubflowTargets.pnpm --filter @objectstack/metadata-protocol exec vitest run src/protocol.runtime-authoring-gate.test.ts src/package-unmanaged-install.test.ts -t '35143|sibling flow'. Expect 11 passed, among them a 422 namingflow-subflow-unknownand a package install of a caller before its callee.Gates (head 93f3643)
dispatch-gates --ranat 93f3643, run after the closure build: 103 derived, 102 run (all exit 0), 1 NOT MEASURED, 0 unrun (✓ dispatch-gates --ran: 103 derived famil(ies) accounted for).check:dual-build-cjs-loadsexit 3: needs a full workspace build. Left to CI.overlap-check(--exclude-pr=38241) at a7c00fd: clean against origin/main 3014176 and the two open PRs sharing a file (feat(spec)!: actions that act on many records are placed atselection; a list view'sbulkActionsis retired #38550, feat(objectql): a record in a closed state, and its lines, are closed to change (closedStates, ADR-0162) — trunk #38497). The 93f3643 commit touches only files of this PR.protocol.tsmoves no line, socheck:facade-delegation-only's ceiling is untouched (exit 0 in the sweep).Human Minimum
packages/specholds no runtime logic.pnpm lintpasses (CI-owned run).main, one pull request.packages/spectouched: only a migration entry's text, no generated artifact moves.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_01QsR2jSjBfkaFUVwRa3pdUK