Skip to content

feat(spec): an object extension places the fields, groups and child lists it brings (place) - #36236

Merged
os-zhuang merged 10 commits into
mainfrom
claude/project-thread-g0rke3
Nov 22, 2026
Merged

os-zhuang merged 10 commits into
mainfrom
claude/project-thread-g0rke3

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #35901

Clause-②: yes (widening)
Metadata-protocol: semantic
Skills-docs: follow-up #35902

维护者速读

  • 扩展包作者可以写明自己带来的字段、分组、子表排在原对象哪一项后面;记录页、表单和 Studio 按同一个结果显示,不写就和以前一样。
  • 属于「记录页标签与分组」专题;父对象声明了页签表或分组才生效,没声明时照旧排在末尾并在启动日志里说明。别的包带来的子表不再被父对象的页签表藏掉,没写位置的排在页签末尾。
  • 已经声明页签表的对象会多出其他已安装包的子表页签;父对象可以在自己的页签表里点名它来换位置,撤回本改动即恢复原样。
  • 无。

What changes

An objectExtensions entry gains place, a list of { field, group, after | before }, { group: { key, label, … }, after | before } and { list, after | before, label?, columns? } entries. The registry applies them once, in foldExtendersOntoDefinition, after every contributor's fields are merged, so every reader (record page, forms, Studio, the data and metadata doors) gets one arrangement.

  • Spec (packages/spec/src/data/object.zod.ts): the three placement shapes and ObjectExtensionSchema.place. The parse refuses a field outside the extension's own fields, both anchors at once, an item placed twice or next to itself, and a field whose own group disagrees with its placement. defineStack (collectExtensionPlacementErrors in stack.zod.ts) refuses a list, or a placed group's relatedList, that is not a child object of the extension's own package pointing at the target, a group key the target declares, and a placed field (or a placed group's fields entry) the target declares. The extension's fieldGroups / relatedLists keys now prescribe place. The relatedLists describe states the cross-package exception.
  • Merge (packages/objectql/src/registry-extension-placement.ts, wired into registry-object-registration.ts#foldExtendersOntoDefinition): three passes (groups, fields, lists) over the extensions in ascending priority, then package id. A field joins a group's member list (a group with no fields gets its current members written out on the served copy first, so its order does not move). A list is spliced into relatedLists; no anchor means the end of the tabs, before a trailing sys_approval_request / sys_activity run. An anchor the object lacks sends the item to the end. An item the object (or the base the fold starts from) already arranges keeps that position, so a folded body re-folds to itself. Notes go once per registry to the boot log (console.warn, like reportFieldPatchMisses). engine-registration.ts carries place onto the extension def.
  • Arm (a), one switch: PLACEMENT_ARRANGES_DECLARED_ONLY (read only by arrangementDeclared). List placements apply only where the target declares a non-empty relatedLists; group and field placements only where it declares fieldGroups. Elsewhere the automatic arrangement stays and the boot log names the placement, including that a list entry's label / columns and a field's after / before are inert, and pointing to relatedListTitle / relatedListColumns on the child's FK (Fable's three points).
  • os validate (packages/lint/src/validate-extension-placement.ts, in the reference-integrity suite): extension-placement-not-applied and extension-placement-anchor-missing, both warnings, with os explain entries. It sees a target only when the target is in the same stack, so the boot log stays the main channel; both texts say so.
  • Console flip (deriveRelatedLists): on a parent that declares relatedLists, a side list whose child belongs to another package than the parent is kept (placed ones sit at the spliced entry; unplaced ones after the listed lists). arrangeDeclaredTabs ranks an unnamed related tab before a trailing run of listed approvals / stream tabs.
  • Studio (RelatedListsEditor): such a list shows read-only among the unlisted rows with a "from " badge, and the preview draws it where the record page does. The editor still edits only the authored layers, so a save never copies an extension's placements into the owner.
  • Semantic migration entry object-extension-place-and-cross-package-lists (states the flip); the relatedLists 管记录页页签的显示和顺序:声明了就只显示列出来的;附件、审批、动态用对象名 sys_attachment、sys_approval_request、sys_activity 列进来 #35897 entry's "a later change" clause now points to it. The two entries name each other by entry id, not by tracker number: os migrate meta prints an entry's text verbatim and packages/cli/test/migrate-meta-engine-guidance.test.ts refuses a tracker id there (ce3ab59). Dated notes in ADR-0085 §2 and ADR-0146 D10. Changeset carries both declaration lines and narrows relatedLists 管记录页页签的显示和顺序:声明了就只显示列出来的;附件、审批、动态用对象名 sys_attachment、sys_approval_request、sys_activity 列进来 #35897's note in its own text.
  • ADR-0122 aliases: ObjectExtensionFieldPlacement and ObjectExtensionListPlacement have one shape, so they are pinned isomorphic in packages/spec/src/type-alias-convention.pin.test.ts (886 → 888, with its history line). ObjectExtensionGroupPlacement nests ObjectFieldGroupSchema, which has a parsed shape, so it gains ObjectExtensionGroupPlacementParsed; api-surface and export-origins regenerated (33961ec).

Rulings applied: 7073014077 (F1 + F2 = 「父对象声明了才生效」; an unplaced other-package list on a declared parent goes at the end of the tabs, 「装了就自动排在末尾」, flipping 7072511859's hiding).

Small calls (the thread's, accepted at claim 7072929733):

  1. Several items at one anchor: after an anchor they follow it in ascending priority, then package id; before an anchor they precede it in the same order.
  2. A field inserted into a group without fields gets that group's current members materialised on the served copy, and the field's group set to the group.
  3. "End of tabs" means before the trailing run of sys_approval_request / sys_activity; before: one of those that the parent leaves unlisted is that same position and is not named as a miss.
  4. "Another package" means the child and the parent both belong to a package (not sys_metadata) and the two differ; package-less children keep relatedLists 管记录页页签的显示和顺序:声明了就只显示列出来的;附件、审批、动态用对象名 sys_attachment、sys_approval_request、sys_activity 列进来 #35897's rule.
  5. When the owner already names the list or lists the field, the owner's position wins (silently).
  6. Item 4 is enforced at parse, at defineStack, and by a skip plus warning in the merge, for every placement shape and whichever door registered the extension (a manifest body reaches the registry unparsed; the stored object_extension row is parsed only): a field by where it comes from (the owner's, then the extension folded first), a group's fields and its relatedList, and a list. The merge skips a list (or a group placing one) only on a positive verdict (the child is registered and owned by another package, or by none); an absent child is never a verdict, since its package may register it later in the boot.
  7. A missing anchor puts the item at the end, named in the boot log and by os validate. An anchor another placement brings is found whatever order the two are written or registered in (each pass places in rounds), which is what os validate already accepted.

Follow-up for #35902 (from Fable's review, corrected by the L2): nothing in HotCRM changes meaning today. Its modules use objectExtensions (o2c, psa, revenue) but none writes place, and none of its objects declares relatedLists. About 30 of its objects already declare fieldGroups, so a field or group placement there applies as soon as a module writes one; a list placement waits until the parent declares its tab list.

Review round 1 (reviewed head ce3ab59e; fixes in c151007b)

  • L1-c must-fix 1 / L2 S1: pass 1 judges a placed group's relatedList with the same childPackageOf verdict as pass 3 and skips the group, named, on a foreign owner; an unregistered child is no verdict. Pinned for a raw body and for a body parsed by ObjectExtensionSchema and registered through registerObjectExtension (the stored door, which runs no defineStack). The registry can receive an unparsed place (the manifest loop in engine-registration.ts reads the authored manifest as is), so the merge also drops from a placed group's fields any name the extension does not own, named.
  • L2 S2: a field is owned by where it comes from. placementContributorsOf takes the owner's field names: an extension owns only the keys of its fields that neither the owner nor an extension folded earlier declares. A display-only redeclaration of an owner field therefore cannot place it (merge: skipped, named). defineStack refuses such a placement, at the entry and in a placed group's fields, where the stack defines the extended object.
  • L2 S3: the merge resolves an anchor another placement brings in any order (placeInRounds: rounds in placement order; what still waits when a round places nothing goes to the end, named). os validate and the merge now agree.
  • L2 S4: a list placement's columns are judged by validateRelatedListRefs as a relatedLists entry's are (related-list-column-unknown, error), top level and package bodies, with the same field / injected-column / path rules; its explanation says so.
  • N1 (both reviews): the place describe now says what is refused where; another package's same group key is merged once and named, not refused.
  • N2: left as is (no effect on what shows). S1 covers who owns a group's list, not whether a list of the extension's own package points at the extended object; defineStack refuses that at build, and on an unbuilt body the served entry names a list the record page places nothing for.
  • L1-c nits: the relatedLists 管记录页页签的显示和顺序:声明了就只显示列出来的;附件、审批、动态用对象名 sys_attachment、sys_approval_request、sys_activity 列进来 #35897 entry's sentence is now history ("was hidden too until the parent named it; since object-extension-place-and-cross-package-lists it shows at the end of the tabs"); the ADR-0085 note adds that the parent cannot hide another package's list (only that package's FK relatedList: false does).
  • Changeset and docs: the HotCRM sentence (above), and the own-items, anchor-order and columns rules.

Tests

  • packages/spec/src/data/object-extension-place.test.ts: the three shapes and every parse refusal, at its path.
  • packages/spec/src/stack-extension-place.test.ts: defineStack refusals (ADR-0112 envelope) and the missing-anchor no-refusal; round 1: a redeclared owner field placed at the entry or in a group's fields is refused, placing its own field beside the redeclaration is not.
  • packages/objectql/src/registry-extension-placement.test.ts: tax_id after industry; before an anchor and at the end; a group that lists members; industry removed → last in the group plus one log line; an added group; lists after / before / at the end; owner position wins; two packages at one anchor by priority, then package name, in both registration orders; uninstall and disable restore the owner's order; re-fold is idempotent; arm (a) for lists and groups with the log text; foreign items skipped and named; an unregistered child is no verdict; the manifest loop carries place; the pure function returns by reference. Round 1: a group placing the owner's list (raw and through the stored door) is not added; its own or an unregistered list is (control); a group's foreign field is left out; a redeclared owner field, and a field an earlier extension declares, are not moved; forward anchors for lists, groups across packages and fields; an anchor nobody brings still goes to the end.
  • packages/lint/src/validate-extension-placement.test.ts: control, not-applied for lists and groups, each missing anchor, sibling anchors, package bodies, suite membership.
  • packages/lint/src/validate-related-list-refs.test.ts (round 1): a placement's columns, control, unknown at the top level and in a package body, a child outside the stack unjudged.
  • ui/packages/app-shell/src/utils/__tests__/deriveRelatedLists.otherPackage-35901.test.ts, ui/packages/plugin-detail/src/synth/__tests__/buildDefaultPageSchema.test.ts (trailing run), ui/packages/app-shell/src/views/studio-design/ObjectSettingsPanel.relatedListsOtherPackage-35901.test.tsx.

Acceptance notes

  • With no place written, every object is served as before (the fold returns the merged body by reference when no extension carries placements).
  • A parent with no relatedLists / fieldGroups keeps its automatic arrangement; nothing is dropped.
  • First files to read, by risk: packages/objectql/src/registry-extension-placement.ts (the splice and the idempotence rule), ui/packages/app-shell/src/utils/deriveRelatedLists.ts (the flip branch), packages/spec/src/stack.zod.ts#collectExtensionPlacementErrors.
  • Two-minute check: pnpm --filter @objectstack/objectql exec vitest run src/registry-extension-placement.test.ts → 34 passed.

Verification

Local runs
  • spec: vitest run --project local on the two new files plus every test touching ObjectExtensionSchema / objectExtensions / relatedLists and src/migrations: all passed.
  • objectql: tsc --noEmit clean; the new file (23) plus the extension, overlay and engine-registration tests (135): passed.
  • lint: tsc --noEmit clean; the new rule, suite membership and rule explanations (33): passed.
  • ui: deriveRelatedLists and tab-arrangement tests (95) and the Studio tab-list tests: passed. Three app-shell util files fail locally only because @objectstack/client was not built in this container; they do not import the changed code.
  • pnpm --filter @objectstack/spec check:generated --fix: regenerated and committed.
  • pnpm check:spec-parsed-alias: OK (888 pinned isomorphic); the pin test passed; tsc -p tsconfig.test.json reports nothing in the pin file.
  • A probe over all 639 semantic entries finds no tracker id in the fields os migrate meta prints; spec src/migrations tests (198) passed.
  • CI: every check green on 42d56e66 (74 check-runs: 63 success, 11 skipped), and on ce3ab59e before the round-1 fixes.
  • Round 1: spec placement, defineStack, migrations and alias-pin tests (227) passed, tsc clean; objectql tsc clean, the placement file (34) and every extension / overlay / engine-registration test (23 files, 373) passed; lint tsc clean, related-list refs, placement, suite and explanation tests (52) passed; check:generated --fix regenerated.
  • Main merged in 507fac34 (no conflicts); the protocol index regenerated from the merged tree (42d56e66). On the merged tree: alias gate OK, 640 semantic entries with no tracker id, objectql extension and placement tests (13 files, 155), lint (52) and spec placement / migrations / object tests (21 files, 657) passed.

🤖 Generated with Claude Code

https://claude.ai/code/session_01L6bhgUxeTKkCvZ2iariHQf

…ists it brings (place)

An objectExtensions entry gains `place`: { field, group, after|before },
{ group: {...}, after|before } and { list, after|before, label?, columns? }.
The parse refuses a placement of a field the extension does not add, both
anchors at once, an item placed twice or next to itself, and a field whose
own group disagrees with its placement. defineStack refuses a list (or a
placed group's relatedList) that is not a child object of the extension's
own package pointing at the target, and a group key the target declares.

Claude-Session: https://claude.ai/code/session_01L6bhgUxeTKkCvZ2iariHQf
Co-Authored-By: Claude <noreply@anthropic.com>
…place, and os validate names a placement that will not land

The fold places each extension's own fields, groups and child lists after
every contributor's fields are merged, in ascending priority then package
name, so the record page, the forms and Studio read one arrangement. Where
the extended object declares no relatedLists / fieldGroups the automatic
arrangement stays and the boot log names the placement (Sales ruling
7073014077, arm (a), one switch). An item that is not the extension's own is
skipped and named. The manifest loop carries place onto the extension def.
os validate warns on a placement not applied and on a missing anchor.

Claude-Session: https://claude.ai/code/session_01L6bhgUxeTKkCvZ2iariHQf
Co-Authored-By: Claude <noreply@anthropic.com>
…he parent's relatedLists, and Studio shows it with its source

Flips the hiding #35923 shipped (Sales ruling 7073014077): an unplaced list
whose child belongs to another package than the parent shows at the end of
the tabs, before a trailing approvals / stream run; a placed one sits at the
entry the server splices in. A child of the parent's own package, or one no
package owns, is still the parent's to list. Studio's tab-list editor shows
such a list read-only with a from-package badge and previews it where the
record page draws it.

Claude-Session: https://claude.ai/code/session_01L6bhgUxeTKkCvZ2iariHQf
Co-Authored-By: Claude <noreply@anthropic.com>
… D10 notes, and regenerated artifacts

The semantic entry object-extension-place-and-cross-package-lists states the
flip of #35897's hiding for a child list another package brings; the #35897
entry's later-change clause now points to it. Type aliases for the three
placement schemas, so the reference docs import them.

Claude-Session: https://claude.ai/code/session_01L6bhgUxeTKkCvZ2iariHQf
Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/xl documentation Improvements or additions to documentation protocol:data tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 22, 2026
@github-actions

github-actions Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 3 package(s): @objectstack/lint, @objectstack/objectql, @objectstack/spec, touching 90 documentable anchor(s). ⚠️ 6 changed file(s) yielded no anchor (packages/lint/src/index.ts, packages/spec/api-surface/data.json, packages/spec/authorable-surface/data.json, …), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

44 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: node scripts/docs-audit/affected-docs.mjs --json 76cb36661da9dba890c83e2130ff624f1ed29e90.

⛔ 15 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails.

What this run could not see
  • 6 changed file(s) yielded no anchor (packages/lint/src/index.ts, packages/spec/api-surface/data.json, packages/spec/authorable-surface/data.json, …) — pages documenting those are invisible to this run
  • 2 anchor(s) matched too much of the corpus to be a work list: objectName (symbol, 59 pages), master_detail (literal, 47 pages)
  • 19 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 67 of 249 client-bound route-ledger rows — the other 182 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 182: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 123 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 176 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 76cb36661da9dba890c83e2130ff624f1ed29e90 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 1140eed193f9f1e2669f0c3193134eb76d3c8a95 — the merge of head 42d56e66cbcb04222ddfae95496b5f17d0542db2 into base 76cb36661da9dba890c83e2130ff624f1ed29e90, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 1140eed193f9f1e2669f0c3193134eb76d3c8a95 && git checkout 1140eed193f9f1e2669f0c3193134eb76d3c8a95
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 76cb36661da9dba890c83e2130ff624f1ed29e90 42d56e66cbcb04222ddfae95496b5f17d0542db2 && git checkout -B drift-repro 76cb36661da9dba890c83e2130ff624f1ed29e90 && git merge --no-ff 42d56e66cbcb04222ddfae95496b5f17d0542db2

node scripts/docs-audit/affected-docs.mjs --json 76cb36661da9dba890c83e2130ff624f1ed29e90

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs 76cb36661da9dba890c83e2130ff624f1ed29e90 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

… pinned to parse

Claude-Session: https://claude.ai/code/session_01L6bhgUxeTKkCvZ2iariHQf
Co-Authored-By: Claude <noreply@anthropic.com>
The field and list placement schemas have one shape, so they are pinned
isomorphic; the group placement nests ObjectFieldGroupSchema, which has
a parsed shape, so it gains ObjectExtensionGroupPlacementParsed.
api-surface and export-origins regenerated.

Claude-Session: https://claude.ai/code/session_01L6bhgUxeTKkCvZ2iariHQf
Co-Authored-By: Claude <noreply@anthropic.com>
…not tracker ids

`os migrate meta` prints a semantic entry's reason verbatim, and its pin
refuses a tracker id there. The new entry and the clause it narrows in
related-lists-declared-is-tab-list now point at each other by entry id.

Claude-Session: https://claude.ai/code/session_01L6bhgUxeTKkCvZ2iariHQf
Co-Authored-By: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob

Posted 2026-11-22T04:22Z. The brief handed to the isolated schema-face reviewer for PR #36236 (CONTRACT_REVIEW_TIER). The record follows as its own comment.

Contract review brief — PR #36236 @ ce3ab59e98de9d671e866ee5158a3548c83898e1 (card #35901)

You review at CONTRACT_REVIEW_TIER. Render ONE ## Contract review record on this head — its shape is
node scripts/pm/record-recognisers.mjs --template --paths packages/spec/src/data/object.zod.ts packages/spec/src/migrations/entries/semantic/18.object-extension-place-and-cross-package-lists.ts packages/spec/src/migrations/entries/semantic/18.related-lists-declared-is-tab-list.ts packages/spec/src/stack.zod.ts docs/adr/0085-object-semantic-roles-over-surface-hint-blocks.md docs/adr/0146-studio-designs-setup-administers-one-editor-per-item-paired-customize-package.md — with a PASS or FAIL verdict, and post it as ONE comment
on the PR or its card.

Inputs — these and nothing else:
· card #35901: its body and EVERY comment (rulings and earlier records included)
· the maintainer ruling 7073014077 on #35901 (F1, F2 and the other-package lists), the ruling 7072511859 on #35897, and merged PR #35923 (relatedLists tab list) whose behaviour this PR flips; the Fable analysis file /mnt/project-files/build-seat1/35901/fable-decisions.md is NOT an input
· the HotCRM repository objectstack-ai/hotcrm on its default branch, read only for this question: does any objectExtensions declaration or object there change meaning under the new placement rules (first consumer)
· PR #36236: its body, its file list, and the net diff against main at ce3ab59e98de9d671e866ee5158a3548c83898e1
· the check-runs on ce3ab59e98de9d671e866ee5158a3548c83898e1: their conclusions ARE the gate verdicts
⛔ Not the dispatch order, ⛔ not the dispatching seat's own conclusions — this brief is adversarial by design.

Scope — the paths reviewFace returns as hits on this PR's file list: packages/spec/src/data/object.zod.ts, packages/spec/src/migrations/entries/semantic/18.object-extension-place-and-cross-package-lists.ts, packages/spec/src/migrations/entries/semantic/18.related-lists-declared-is-tab-list.ts, packages/spec/src/stack.zod.ts, docs/adr/0085-object-semantic-roles-over-surface-hint-blocks.md, docs/adr/0146-studio-designs-setup-administers-one-editor-per-item-paired-customize-package.md;
plus every file IN THIS DIFF that directly implements or enforces them — the gate that enforces a rule, the code
a jsdoc or schema line describes, the validator a skill teaches — reviewed for agreement with the contract.
Widen it freely, ⛔ never below hits; the record's Scope: line names the implementing files apart from hits.
The rest of the diff (tests, unrelated modules, lockfiles, generated output, changesets) is the lane seat's
ACCEPT at TIER_DEFAULT, exactly as a standalone PR of those files.
④ judges the hits files and those implementing files ONLY:
lockfiles, generated output, changesets and prose elsewhere in the PR are not reviewed;
code outside the diff is READ to judge them, never reviewed.

Security — a hits path sits on the low-risk skills arm: when the change teaches security, auth or permission
behaviour the path name doesn't show, the record says so and the seat adopting the record adds the security label.
The record says so on its Security-touching: line, and the arm lands on no alone: write no ONLY when no changed
hunk teaches permission, sharing, credential, token, authentication or other security behaviour, else yes.

⛔ READ-ONLY. No worktree, no checkout, no build, no test run, no gate re-run, no ablation: the check-runs
on the head already answered every derived gate family, and a local run costs more than it returns.
If ONE probe is unavoidable, the record's Local-runs: line says probe — REASON; otherwise none.
Scratch space is /tmp/claude-0/-home-user/3d3cbaf6-4903-5fed-92d4-c2b94a45e868/scratchpad/pr-36236/ alone; nothing there you did not write this round is read.

Judge, in the record's own sections:
① Derived judgments — every accept-set and public-surface change the diff implies, each named right or wrong.
② Semver level — the changeset (or skip-changeset) matches what the diff publishes, and the Clause-②: line.
③ Boundary flags — every dev flag and every open_questions entry answered, or escalated.
On every face, SQL push-down: a new id materialisation or in-app join where SQL could push down is a
finding unless a reason is given (AGENTS.md, Prime Directive 5: SQL first).
④ Design judgment — for EVERY hits file: does the change hold against the code it cites and the
scenario it is accepted against? A skill file against the card's eval prompt and the spec it teaches
on main; a schema file against the ruling or ADR it implements and its first consumer; an ADR
against its first consumer and its execution plan. For EVERY implementing file in the diff: does the
code agree with the contract, sentence by sentence? Read the cited code in the live tree, and try to
break the design.
Grade each finding must-fix, should-fix or nit — a nit has no effect on correctness or the contract.
A must-fix is a FAIL; a must-fix or should-fix earns a delta review of its fix; nits alone end the round.
Spell a must-fix or should-fix with its id and grade, S1 (should-fix) — …, and a clean round as
No must-fix, no should-fix.: the queue guard reads a graded finding as OPEN on this head and
refuses the record; the delta record names those it closes by id alone, S1: closed.
A nit is fixed only on the prose faces, or left as an accepted deviation or a follow-up card: a fix
anywhere else moves the head, and this record no longer covers it.
⛔ Judge the tree, never the PR body's account of it.
Sign Implemented-by: with the dev's branch and Reviewed-by: with your session id — the value is the FIRST
thing after each colon.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgXtcSJVbw8Gny1ERbP

维护者速读

扩展包声明「我的字段、分组、子表排在原对象哪一项后面」这件事整体做对了,按你 02:36 的两条裁定:原对象声明了页签表或分组才生效,没声明就照旧并在启动日志里说明;别的包装上的子表不再被页签表藏起来,没写位置的排在页签末尾(审批、动态之前)。合并只在服务端做一次,记录页、表单和 Studio 看到同一个结果;Studio 保存时不会把扩展包的位置写进原对象。
有一个漏洞要补,改动很小:
① 卡上第 4 条规定扩展包不能挪动别人的东西。对「放一个子表页签」,服务端合并时会检查子表是不是这个包自己的,不是就跳过;但对「加一个分组、分组里放一张子表」,只有构建时检查,服务端合并时没有检查。这样一个不经正常构建的包,可以把原对象自己的子表搬进字段区,原来的页签也跟着消失。服务端合并要像页签那样检查并跳过。
L1 结论:补上这一处再审。

席位核对 — REWORK (L1-c) · repo:objectstack#1 · head ce3ab59e · 2026-11-22T04:26Z

Card: Fixes #35901 (epic #35896). Rulings 7073014077 (F1 = F2 = (a)) and 7072511859 (the hiding this flips). Declarations: Clause-②: yes (widening), Metadata-protocol: semantic, Skills-docs: follow-up #35902. Tier H (spec schema), 41 files, +2,552 / −50, so os-zhuang approves after the L2.

Gates:

  • CI is 61 success · 9 expected skip on ce3ab59e, and mergeable is clean. l1-face is CLEAN.
  • The branch is 8 behind main.
  • The two fixes the seat relayed (the ADR-0122 aliases at 33961ec5, and the migrate-meta cross-references by entry id at ce3ab59e) are not in the body yet. Add them before the hand-off.

Must fix

  1. The merge does not skip a placed group whose relatedList names another owner's child.
    • The PR body's small call 6 says item 4 ("an extension places only its own items") is enforced at parse, at defineStack, and by a skip plus warning in the merge. applyExtensionPlacements does that for list placements: childPackageOf(childOf(list)), owned by another package, is noted and skipped. It also does it for field placements (ownFields).
    • The group pass (pass 1) splices { ...entry.group } as written. A group whose relatedList names the extended object's own child, or a third package's, is checked only by collectExtensionPlacementErrors at defineStack, which runs at os build, not when an installed artifact registers.
    • That group would move the owner's list into the field area. Under feat(spec): relatedLists is the record page's tab list, with built-in tabs by object name and per-entry title and columns #35923's shipped rule, a group-placed table on a parent with a declared relatedLists that does not list it also loses its tab. This is the 「不能挪动或隐藏原对象和其他包的…页签」 the card forbids, reachable through the one placement shape the merge does not judge.
    • Fix: in pass 1, judge entry.group.relatedList (its string form, and its object form if ObjectFieldGroupSchema admits one) with the same childPackageOf verdict as pass 3. Skip and note a positive foreign verdict, and treat an unregistered child as no verdict. Pin it beside "foreign items skipped and named".
    • Group fields naming a foreign field is refused at parse (refuseForeignPlacements, place[i].group.fields[j]). If the registry can receive an unparsed body, the same skip there would complete the set. Say which in the reply.

Read and found sound

  • registry-extension-placement.ts.
    • The three passes run in inPlacementOrder: priority, then package id, then registration index.
    • In splice, an "after" item walks past earlier items placed after the same anchor, and a "before" item inserts at the anchor. Both give lowest priority first, as small call 1 says.
    • Missing anchors go to the end and are named. "Before" an unlisted trailing built-in is the end and is not named (small call 3).
    • The owner's position wins (tabsArrange, listedSomewhere, an existing group key), and that is what makes a re-fold idempotent.
    • A group without fields has its members read through readFieldGroupMembership and written out before the splice (small call 2).
    • Arm (a) is read in one place (arrangementDeclared), and the not-applied notes carry Fable's three points (label / columns inert, and relatedListTitle / relatedListColumns named).
    • When nothing applies, the body is returned by reference, so an object with no place is served unchanged.
  • The fold wiring. foldExtendersOntoDefinition applies the placements after every contributor's fields are merged. ownerGroupKeys comes from the packaged owner, not a tenant base. childPackageOf uses the registry owner, and null means registered with no package. Notes are deduped per registry. engine-registration.ts carries place.
  • defineStack (collectExtensionPlacementErrors). Per package body (ADR-0130 D4), a list or a group's relatedList must be a child this body defines with a lookup / master_detail field whose reference is the target, and a group key may not be the target's own. Anchors are left to lint, so removing an owner field never breaks a build (card acceptance 2).
  • Parse. The three strict shapes, with aliases. A list placement refuses the built-in names. The refusals cover: both anchors at once, foreign fields (including a group's fields), an item placed twice, an item placed next to itself, and a field whose own group disagrees with its placement. The card's 「{ field: 'industry', group: 'other' }:校验拒绝」 is the foreign-field refusal.
  • Lint. extension-placement-not-applied and extension-placement-anchor-missing, both warnings in the reference-integrity suite, each with an os explain entry, and saying they see only same-stack targets.
  • The console flip (deriveRelatedLists). Another package's side list is kept on a declared parent only when both packages are known and differ (sys_metadata counts as no package), so package-less children keep relatedLists 管记录页页签的显示和顺序:声明了就只显示列出来的;附件、审批、动态用对象名 sys_attachment、sys_approval_request、sys_activity 列进来 #35897's hiding (small call 4). In arrangeDeclaredTabs, the unnamed related tabs rank tail - 0.5, just before a trailing run of listed approvals and stream tabs, which matches the server's tabsEnd. A group-placed (isPrimary) foreign table takes the body branch first, as before.
  • Studio.
    • The buffer is the authored layer: authoredObjectBuffer gives overlay ?? code, never the served fold (StudioDesignSurface.tsx ~6245). So, as the body says, a save cannot copy a spliced extension entry into the owner.
    • The read-only "from " row and the preview position match the page, and the test pins both, with a same-package control.
  • Migration object-extension-place-and-cross-package-lists. It states the shipped-behaviour flip in its own text, the census, and that deployed metadata was not measured. Its printed text cites no issue id.

Nits (do not block)

  • 18.related-lists-declared-is-tab-list now reads "…a child list another package adds included: it is hidden until the parent names it, … (no longer hidden since object-extension-place-and-cross-package-lists)". That is one clause asserting both. Rewrite it as history ("was hidden until the parent named it; since object-extension-place-and-cross-package-lists it shows at the end of the tabs"), or leave the merged entry's sentence and let the new entry carry the flip, as its own reason already does.
  • objectExtensionPlaceDescription says "a group key the extended object or another package already declares … is refused (here, or at defineStack …)". defineStack judges the target's own keys only. Another package's same key is a merge note (groupAddedBy), not a refusal, so the sentence should say that.
  • The migration's replacement ends "there is no way for the parent to hide it, short of relatedList: false on that package's FK". That FK is the other package's, so in practice the owner cannot hide it. That is the ruling's consequence; worth one sentence in the ADR-0085 note so the approver sees it.

L1 never replaces L2. The Fable schema L2 is the seat's, and the Tier H approval is os-zhuang's.

Generated by Claude Code

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: ce3ab59e98de9d671e866ee5158a3548c83898e1
Local-runs: none
Scope: packages/spec/src/data/object.zod.ts, packages/spec/src/migrations/entries/semantic/18.object-extension-place-and-cross-package-lists.ts, packages/spec/src/migrations/entries/semantic/18.related-lists-declared-is-tab-list.ts, packages/spec/src/stack.zod.ts, docs/adr/0085-object-semantic-roles-over-surface-hint-blocks.md, docs/adr/0146-studio-designs-setup-administers-one-editor-per-item-paired-customize-package.md + packages/objectql/src/registry-extension-placement.ts, packages/objectql/src/registry-object-registration.ts, packages/objectql/src/engine-registration.ts, packages/objectql/src/registry.ts, packages/lint/src/validate-extension-placement.ts, packages/lint/src/reference-integrity-suite.ts, packages/lint/src/rule-explanations.ts, ui/packages/app-shell/src/utils/deriveRelatedLists.ts, ui/packages/plugin-detail/src/synth/buildDefaultPageSchema.ts
Security-touching: no

Reviewed 2026-11-22T04:28Z on PR #36236 (card #35901), read-only: the net diff against main (merge base 48c732c4), the card and its five comments, rulings 7073014077 and 7072511859, merged PR #35923, HotCRM origin/main at 5a17e454, and the 70 check-runs on this head (all success or skipped, none failed). The rest of the diff (tests, Studio editor and vocabulary, i18n, generated spec artifacts, docs pages, the changeset) is the lane seat's ACCEPT at TIER_DEFAULT. Every finding below comes from reading the code; nothing was run.

① Derived judgments

  • ObjectExtensionSchema.place is a new optional key: the accept set widens, and no body that parsed on main is refused. Right.
  • Four new exported schemas (ObjectExtensionFieldPlacementSchema, ObjectExtensionGroupPlacementSchema, ObjectExtensionListPlacementSchema, ObjectExtensionPlacementSchema) and six types join the public surface, and the api-surface, authorable-surface, declaration-map, export-origins and JSON-schema baselines are regenerated in the diff. Right: Build Core, Lint & Repo Gates and Spec property liveness are green.
  • The extension keys fieldGroups and relatedLists are still refused. fieldGroups only changes its prescription; relatedLists was already refused by the strict object as an unknown key and now carries a prescription. No accept-set change. Right.
  • defineStack gains refusals (collectExtensionPlacementErrors) that only a place entry can reach, so no existing stack is newly refused. Right.
  • ObjectSchema.relatedLists keeps its accept set and changes meaning: on a declared, non-empty list a side list whose child belongs to another package is no longer hidden. This is the flip ruling 7073014077 item 2 orders, and it is a semantic change, stated in the describe, the new migration entry and both ADR notes. Right.
  • Two new os validate rules at warning severity, in the reference-integrity suite. They cannot fail a build that passed before. Right.
  • @objectstack/objectql: the fold returns the merged body by reference when no extension carries place (applyExtensionPlacements, early return), so an app that writes no place is served as before. Right.
  • HotCRM (first consumer): four extension files (o2c on crm_contract, crm_account, crm_sales_order; psa on crm_expense, crm_expense_report, crm_expense_request; revenue on crm_sales_order). None writes place, fieldGroups or relatedLists; their fields carry only a field-level group. No HotCRM object declares relatedLists, so the flip fires nowhere there. No declaration or object changes meaning. Right.

② Semver level

Clause-②: yes (widening)

The changeset declares the protocol kind semantic and takes minor on the six packages the diff moves (@objectstack/spec, @objectstack/objectql, @objectstack/lint, @object-ui/app-shell, @object-ui/plugin-detail, @object-ui/i18n). The diff publishes one added key and one changed meaning; semantic outranks added, nothing is narrowed, and a kind takes at least minor. The level matches. The PR body and the changeset carry the same two declaration lines, the ADR-0087 semantic entry is registered, and Check Changeset is green.

③ Boundary flags

  • Small calls 1, 2, 3, 5 and 7 of the PR body agree with the code and with the card's merge rules. Answered.
  • Small call 4 (a child no package owns stays hidden until named) limits the ruled flip to the words of the ruling, "a child list another package adds". A child in the parent's paired .custom package has a different package id, so it shows. Answered; no escalation.
  • Small call 6 (the own-items rule is held at parse, at defineStack and by the merge) does not hold in full: see S1 and S2.
  • PLACEMENT_ARRANGES_DECLARED_ONLY is a compile-time constant set to the ruled arm, pinned by a test, not re-exported from the objectql index and not settable at runtime. The false arm is dead code. Answered.
  • open_questions: the PR body carries none.
  • SQL push-down: the change touches no query path. The fold reads registry maps in memory; it adds no id materialisation and no in-app join. No finding.
  • For the maintainer and card 技能、文档、示例和 HotCRM 用上记录页的新写法:relatedLists 列页签、分组列字段、分组指向子表、扩展包声明位置 #35902, a fact that differs from the follow-on line of ruling 7073014077: HotCRM objects do declare fieldGroups (30 object files, crm_account, crm_contract and crm_expense among them). A field or group placement would therefore apply in HotCRM as soon as a module writes one; only list placements wait for a parent to declare relatedLists. The ruling itself is unaffected. The changeset sentence "To use place on HotCRM's objects, the parent object first declares its relatedLists" is true of lists only.

④ Design judgment

packages/spec/src/data/object.zod.ts: the three shapes, the root refinement and the place describe implement card items 1 to 4 and both arms of ruling 7073014077. Anchors, the end position, the tie order and the declared-only arm match the merge sentence by sentence, except where the findings below say otherwise.

packages/spec/src/stack.zod.ts: collectExtensionPlacementErrors judges a list and a placed group's relatedList per package body, and a group key against the target's own keys. It runs before the early return for a stack with no objects. It holds against the HotCRM module shape (objects and objectExtensions in one body).

Both migration entries: the new entry states the flip, the unchanged cases and the census; I confirmed the HotCRM half of the census. The one-clause edit to the #35897 entry points at the new entry. Hold.

ADR-0085 note and ADR-0146 D10 note: add-only, dated, and they agree with the ruling. The D10 sentence "refused at parse or at defineStack and skipped by the merge with a warning" is wider than the code in two places (S1, S2).

Implementing files: the fold wiring, the manifest loop, the once-per-registry notes, deriveRelatedLists and arrangeDeclaredTabs agree with the contract. The merge and the browser compute the same end of the tabs.

Findings:

  • S1 (should-fix) — the merge does not hold the own-items rule for a placed group's relatedList. applyExtensionPlacements splices { ...entry.group } whole in pass 1 and never asks childPackageOf for the group's relatedList; only pass 3 (lists) asks. defineStack refuses the case, but the stored object_extension door (registrableObjectExtension, which registers the whole parsed body) runs the parse only. An extension saved there can add a group that puts the owner's or another package's child list in the overview. The place describe, the refuseForeignPlacements docstring ("the registry merge for every door") and the ADR-0146 note all say the merge skips such an item with a warning. Fix: judge a placed group's relatedList in pass 1 as pass 3 judges a list, and add the test.
  • S2 (should-fix) — an extension can move a field the owner declares. Parse and merge both read "own" as a key of the extension's fields (isOwn, placementContributorsOf building ownFields from Object.keys(body.fields)). ADR-0146 D10 admits an extension that redeclares an owner field with display-only changes (judgeRedeclaredOwnerFields; a boot only warns). So fields: { industry: { ...same, label } } with place: [{ field: 'industry', group: 'basic', after: 'phone' }] parses, passes defineStack, and pass 2 reorders the owner's field in the owner's group whenever that group lists no fields; an ungrouped owner field can be moved into a group the same way. The fold already holds the owner's field names (ownFields from ownFieldNamesOf(owner)) at the call. Fix: a placed field must also not be a field the owner declares (skip and name it in the merge; refuse it where the owner is known), and add the test.
  • S3 (should-fix) — os validate and the merge disagree on an anchor another placement brings. The lint rule accepts any anchor that some extension of the target places (placedLists, placedGroups, placedFields). The merge finds an anchor only if it is already spliced: passes run in priority, package id and entry order. With place: [{ list: 'a', after: 'b' }, { list: 'b' }], or a lower-priority package anchoring on a higher-priority one's item, the merge sends the item to the end and names it in the boot log, and os validate is silent. The changeset and the rule explanation say os validate warns when the item goes to the end. Fix one side: resolve such anchors in the merge, or make the lint rule follow the merge order.
  • S4 (should-fix) — a list placement's columns are checked nowhere. The describe says they are "as a relatedLists entry's columns", and the parent-side entry refuses a column that is no field of the child (related-list-column-unknown, at validate, build and the write door). Neither collectExtensionPlacementErrors, validate-extension-placement.ts nor validate-related-list-refs.ts reads a placement's columns, so an unknown column reaches the served relatedLists. The child is in the extension's own package, so the build can always judge it. Fix: give a placement's columns the same check.
  • N1 (nit) — the place describe says a group key "the extended object or another package already declares" is refused. Another package's key is only skipped by the merge with a note; nothing refuses it. Reword when the head moves for the fixes above.
  • N2 (nit) — the merge splices a list placement whose child does not point at the target when the body did not pass defineStack. The served entry then names a list the record page places nothing for. No effect on what shows.

S1 to S4 each earn a delta review of their fix.

Implemented-by: claude/project-thread-g0rke3
Reviewed-by: session_01L6bhgUkbQqRUUFSiu2HGob

VERDICT: PASS

…ery door, and anchors resolve in any order

Review round 1 on the placement change:

- The merge judges a placed group's relatedList as it judges a list
  placement, skipping it on a foreign owner, and drops from a placed
  group's fields any name the extension does not own: a manifest body
  reaches the registry unparsed and the stored object_extension door runs
  no defineStack.
- A field is owned by where it comes from: an owner field an extension
  redeclares for its display, or a field an earlier extension declares,
  is not the extension's to place (skipped in the merge, refused by
  defineStack where the extended object is in the stack).
- Each pass places in rounds, so an anchor another placement brings is
  found whatever the order, as os validate already assumed.
- A list placement's columns are judged by validateRelatedListRefs as a
  relatedLists entry's are.
- Prose: the place describe, the #35897 entry's history sentence, the
  ADR-0085 and ADR-0146 notes, the guide and the changeset's HotCRM line.

Claude-Session: https://claude.ai/code/session_01L6bhgUxeTKkCvZ2iariHQf
Co-Authored-By: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob

Posted 2026-11-22T05:16Z. Delta brief for the schema-face reviewer on PR #36236 (CONTRACT_REVIEW_TIER), the same reviewer as the record on ce3ab59e: judge head 42d56e66cbcb04222ddfae95496b5f17d0542db2. Since ce3ab59: c151007 answers L1-c's must-fix (7074179487) and the record's S1–S4 and N1 (N2 kept with a reason in the body); L1-c's two nits and the changeset's HotCRM sentence are revised; main is merged in (507fac3, reported conflict-free) and the protocol index is regenerated on the merged tree (42d56e66cbcb04222ddfae95496b5f17d0542db2). Name every earlier finding closed or open by id, read the merge resolution and the regenerated files for anything beyond a mechanical regen, judge the new code afresh, read the check-runs on the new head, and render ONE delta ## Contract review record on it. Read-only, as before.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 42d56e66cbcb04222ddfae95496b5f17d0542db2
Local-runs: none
Scope: packages/spec/src/data/object.zod.ts, packages/spec/src/migrations/entries/semantic/18.object-extension-place-and-cross-package-lists.ts, packages/spec/src/migrations/entries/semantic/18.related-lists-declared-is-tab-list.ts, packages/spec/src/stack.zod.ts, docs/adr/0085-object-semantic-roles-over-surface-hint-blocks.md, docs/adr/0146-studio-designs-setup-administers-one-editor-per-item-paired-customize-package.md + packages/objectql/src/registry-extension-placement.ts, packages/objectql/src/registry-object-registration.ts, packages/objectql/src/engine-registration.ts, packages/objectql/src/registry.ts, packages/lint/src/validate-extension-placement.ts, packages/lint/src/validate-related-list-refs.ts, packages/lint/src/reference-integrity-suite.ts, packages/lint/src/rule-explanations.ts, ui/packages/app-shell/src/utils/deriveRelatedLists.ts, ui/packages/plugin-detail/src/synth/buildDefaultPageSchema.ts
Security-touching: no

Delta review 2026-11-22T05:18Z of PR #36236 (card #35901), read-only. It follows the record on ce3ab59e. Read: the fix commit c151007b, the merge of main at 507fac34 and the regeneration 42d56e66; the PR's net diff against main (merge base 76cb3666); the PR body's "Review round 1" section; L1-c's comment 7074179487; and the 74 check-runs on this head (63 success, 11 skipped, none failed; mergeable state clean). The merge brought only main's own changes into the PR's files (three unrelated i18n keys left the delta); the PR's own changes since the last record are all in c151007b plus the regenerated protocol index. Nothing was run; every judgment is from reading the code.

Earlier findings:

  • S1: closed
  • S2: closed
  • S3: closed
  • S4: closed
  • N1: closed
  • N2: open, kept as an accepted deviation (reason in the PR body; no effect on what shows)

① Derived judgments

  • The accept set is unchanged from the last record: place is the one new key, and no body that parsed on main is refused. Right.
  • defineStack gains one more refusal (judgeOwnerField): a placed field, or a placed group's fields member, that the extended object declares itself, where the stack defines that object. Only a place entry reaches it, so no existing stack is newly refused. Right.
  • related-list-column-unknown (error) now also judges a list placement's columns. Only a place entry reaches it. Right.
  • placementContributorsOf takes a second parameter (the owner's field names). It is module-internal to objectql, not re-exported from the package index. Right.
  • The merge now resolves an anchor another placement brings in any order. That changes the served order only for bodies that write place, which did not exist on main. Right.
  • HotCRM is unchanged since the last record's reading: no extension writes place, no object declares relatedLists. No declaration or object changes meaning. Right.

② Semver level

Clause-②: yes (widening)

Unchanged: protocol kind semantic, minor on the six moved packages. The fix commit adds refusals and a lint check that only the new key reaches, so nothing is narrowed and the level still matches. Check Changeset is green on this head.

③ Boundary flags

  • Small call 6 (the own-items rule holds at parse, at defineStack and in the merge) now holds for all four shapes: a list, a group's relatedList, a field, and a group's fields.
  • L1-c's question "can the registry receive an unparsed body" is answered in the PR body (yes, the manifest loop), and the merge now drops a foreign name from a placed group's fields and names it.
  • The HotCRM point escalated in the last record is taken up: the changeset now says field and group placements apply in HotCRM as soon as a module writes one, and only list placements wait on relatedLists. The follow-on line of ruling 7073014077 itself still reads as before; that is for the maintainer and 技能、文档、示例和 HotCRM 用上记录页的新写法:relatedLists 列页签、分组列字段、分组指向子表、扩展包声明位置 #35902, not this PR.
  • open_questions: none.
  • SQL push-down: still no query path touched. No finding.

④ Design judgment

packages/objectql/src/registry-extension-placement.ts, judged afresh:

  • Pass 1 reads a placed group's relatedList through relatedListEntryName (string and object form) and asks childPackageOf exactly as pass 3 does. A registered child of another owner skips the group with a note; an unregistered child is no verdict. This is the S1 fix and L1-c's must-fix.
  • Ownership is by origin. placementContributorsOf seeds a claimed set with the owner's field names and adds each extension's keys in fold order, so a redeclared owner field, or a field an earlier extension declares, is in no later extension's ownFields. Pass 2 then skips and names it. This is the S2 fix. With no own contributor the seed is empty, which leaves the earlier behaviour.
  • placeInRounds queues each pass's splices and places, round by round in placement order, every job whose anchor is present. Jobs left when a round places nothing go to the end and are named. I walked the tie cases: several items after one anchor still come out lowest priority first, and several before one anchor too. A two-item cycle sends both to the end; the first is named. This is the S3 fix, and the lint rule and the merge now agree.
  • The idempotence checks (groupSlots already holding the key, listedSomewhere, tabsArrange) still run before a job is queued, so a body that carries the placements re-folds to itself.

packages/lint/src/validate-related-list-refs.ts: the column check is factored into judgeColumns and called for a parent entry (same message as before) and for every list placement at the top level and in each package body. A child outside the stack is left unjudged. This is the S4 fix.

packages/spec/src/stack.zod.ts: judgeOwnerField refuses the redeclare-then-place case where the target is in the stack. Holds.

packages/spec/src/data/object.zod.ts: the place describe now says which door refuses what, that another package's group key is merged once and named rather than refused (N1), that an anchor may be another placement's item, and that columns are judged. Each sentence agrees with the code.

Migration entries and ADR notes: the #35897 entry's sentence is now history and points at the new entry; the ADR-0085 note states that the parent cannot hide another package's list; the ADR-0146 note states ownership by origin and that the merge judges every door. Add-only, and they agree with the code and the ruling.

No must-fix, no should-fix.

  • N3 (nit) — one extension placing both contract and contract.account_id now splices both entries, because tabsArrange runs before either job is placed; before the rounds the second was dropped silently. The record page maps each derived list to one naming entry, so no tab is doubled. Left as is.

Implemented-by: claude/project-thread-g0rke3
Reviewed-by: session_01L6bhgUkbQqRUUFSiu2HGob

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgXtcSJVbw8Gny1ERbP

维护者速读

上一轮唯一的必改项已修好:扩展包在分组里点名别的包的子列表,现在合并时会跳过并在启动日志里写明是谁的列表,不会再把主对象自己的列表挪走;通过已存的扩展记录(不经过 defineStack)进来的也一样拦住。Fable 复核提的另外几条也一起做了:扩展包不能挪它只是"重新声明显示属性"的主对象字段;锚点不管书写或注册先后都能找到;列表放置的列名按 relatedLists 同样规则检查。两条文字小问题已改。新头 42d56e66 全绿、可干净合并。L1-c 结论:通过(增量)。仍需席位安排 Tier H(os-zhuang)。

席位核对 — ACCEPT (L1-c, delta) · repo:objectstack#1 · head 42d56e66 · 2026-11-22T05:18Z

Delta read since my REWORK 7074179487 on ce3ab59e: c151007b read in full; 507fac34 read with --remerge-diff (its only conflict is the generated content/docs/references/index.mdx, regenerated in 42d56e66).

Must-fix closed.

  • registry-extension-placement.ts pass 1 now judges a placed group's relatedList as a list placement is judged: when childPackageOf names an owner other than the extension's package, the group is not added and the boot log names whose list it is. A child no registry entry owns yet stays a non-verdict, as before.
  • The same check holds on the stored object_extension door, which parses but runs no defineStack (test: "a parsed extension whose group places the owner's list is not added, named"), and the controls cover the extension's own package's list and an unregistered list.
  • A placed group's fields are filtered to the extension's own fields, and the foreign names are logged.

Fable round-1 items, read.

  • Ownership by origin. placementContributorsOf(contributors, ownFields): the call site in registry-object-registration.ts passes the owner's ownFields, and the claimed set adds each earlier extension's fields. So a redeclared owner field, or a field an earlier extension added, is not this extension's to move. defineStack refuses the owner-field case where the extended object is in the stack (judgeOwnerField at the entry and in group.fields), and its control accepts placing its own field beside a redeclaration.
  • Anchor order. placeInRounds places every job whose anchor is present, repeats while a round makes progress, and puts the leftovers at the end. It terminates, and the tests cover forward anchors for lists, groups across packages, and fields, plus the "anchor nobody brings" control.
  • Columns. validateRelatedListRefs factors judgeColumns out unchanged and applies it to place[].columns, both at the top level and in each package body. The related-list-column-unknown explanation gains a matching line.

Nits closed.

Face.

  • l1-face is CLEAN on 42d56e66, with 13 items read.
  • Checks: 63 success and 11 skipped, none failing. mergeable_state clean, still draft.
  • The body's "Review round 1" section maps each item, and 33961ec and ce3ab59 are named as asked.
  • One optional nit: the body's CI line still reads "green on ce3ab59". A one-word bump to 42d56e66 would keep it pinned.

Not read here: the contract and Tier H face. The seat owns the Fable L2 delta, and os-zhuang approves. This record is not an approval.


Generated by Claude Code

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob

维护者速读

扩展包(比如 HotCRM 的模块往别人的对象上加字段)现在可以用 place 写明自己带来的字段、分组和子表放在父对象的哪里,只有父对象声明了对应的字段分组或关联列表时才生效(您 02:36Z 定的「父对象声明了才生效」)。另一个包带来的子表不会再被父对象的关联列表藏掉,装了就自动排在页签末尾(「装了就自动排在末尾」)。这翻转了 #35923 的「先隐藏」做法。扩展包不能挪动父对象自己的字段或子表,也不能把别的包的子表拉进字段区。HotCRM 现在没有任何 place,所以今天什么都不变;它约 30 个对象已声明字段分组,以后模块一写 place,字段和分组就会按声明放好。两层审核都已通过,CI 全绿。需要您批准,因为改了两份 ADR,改动也略超 3,000 行。

Tier H approval request · 2026-11-22T05:20Z · @os-zhuang, PR #36236 (#35901, epic #35896) is ready for your review on head 42d56e66cb.

Why it needs a human. It touches governed paths, docs/adr/** ×2 (ADR-0085 and ADR-0146). It is also 3,027 changed lines (+2,946/−81), over the 3,000-line human-merge line.

What it does. ObjectExtension gains place for the fields, groups and child lists it brings. A placement applies only when the parent declares the matching fieldGroups / relatedLists (ruling 7073014077, F1 = F2 = (a)). A list another package brings is never hidden by the parent's relatedLists; once installed it sorts to the end of the tabs (same ruling). That flips #35923's hidden-until-#35901 rule (7072511859), with a semantic migration entry for both. An extension cannot move the owner's fields or lists, and cannot pull another package's child list into the details. Both the build path and the stored object_extension door enforce this.

Reviews.

  • L1-c: REWORK 7074179487 (pass 1 spliced a group naming a foreign child); delta ACCEPT 7074680864 on this head.
  • Contract L2 (schema face, CONTRACT_REVIEW_TIER): PASS 7074206888 on ce3ab59 with four should-fixes (foreign list in a placed group on the stored door, placing a redeclared owner field, forward anchors, unvalidated list columns). Delta PASS on this head, No must-fix, no should-fix.: all four closed and N1 closed. N2 is an accepted deviation; N3 (an extension placing both contract and contract.account_id splices both entries, one tab drawn) is left as a nit.
  • First consumer, HotCRM: no place and no relatedLists anywhere, so nothing changes meaning today.

Gates.

  • Clause-②: yes (widening), protocol kind semantic, minor on six packages.
  • CI: 63 success, 11 skipped, none failed; mergeable clean. ADR-0122 alias pairs are added (pin count 886→888), with api-surface, export-origins and the protocol index regenerated.
  • Main drift: 5 first-parent commits since the merge base; no translations/ or skills/ path.

Still owed after merge. A later #35902 slice flips the skills' cross-package sentence to match (seat 4 holds it).

After your approval, the seat readies this PR and lands it through the queue. The PR carries Fixes #35901.

@objectstack-fleet objectstack-fleet Bot added the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Nov 22, 2026
@os-zhuang
os-zhuang marked this pull request as ready for review November 22, 2026 05:21
@os-zhuang
os-zhuang added this pull request to the merge queue Nov 22, 2026
Merged via the queue into main with commit d33bf5a Nov 22, 2026
83 of 84 checks passed
@os-zhuang
os-zhuang deleted the claude/project-thread-g0rke3 branch November 22, 2026 06:42
247257110 pushed a commit to 247257110/objectstack that referenced this pull request Nov 23, 2026
…ension its new manifest dropped (objectstack-ai#36325)

<!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} -->
_Requested by **Steedos** · [project
thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9UbbCxiFE11rsKwyNffJZKYqJs)_

Fixes objectstack-ai#35609

Clause-②: no
Metadata-protocol: none

## 维护者速读

-
用户能看到什么变化:开发者在本地开发热重载时删掉扩展包给别人对象加字段的声明、或升级/重装一个不再加这些字段的扩展包后,这些字段会立刻从对象上消失,不再需要重启。
- 为什么做:修复「扩展包升级后旧字段还挂在对象上」的数据配置错误,替做扩展包升级和本地开发热重载的构建者解决。
- 出错会怎样:最坏情况是某个包重新注册时误撤了它仍声明的扩展字段,字段在界面和接口上暂时消失;已存数据不受影响,回滚此改动或重启即可恢复。
- 要你做什么:无。

## What changes

`SchemaRegistry.replacingPackageBody` (the wrapper around every
`ObjectQL.registerApp` body registration, which since objectstack-ai#33050 withdraws
the items a new body no longer ships) now does the same for object
extensions:

- Before the body registers, it notes the package's current `extend`
layer of each object. After it registers, a layer that is a new
contributor is one this body wrote (the extend splice always replaces
the package's layer with a new contributor).
- The layers the previous body wrote, for objects the new body no longer
extends, are withdrawn through `withdrawObjectExtension`, the existing
per-object withdrawal the `object_extension` item delete uses
(uninstall's package-wide walk is not reused: it also removes owned
objects). Only the very layer the previous body wrote is withdrawn, so a
layer another door registered under the package id since (the
`object_extension` item door) is kept.
- `withdrawObjectExtension` now records the object's layers in an open
registration run before it removes one (`noteObjectEntry`), so a refusal
later in the run (a later artifact member, the run-end follow door) puts
the extension back. Outside a run this is a no-op, so the item-delete
caller is unchanged.
- The record (`packageBodyExtensions`) is put back on refusal and
forgotten by `uninstallPackage`, beside `packageBodyItems`.

Everything an extension contributes rides on its one contributor layer
(fields, `fieldPatches`, label texts, validations, indexes), so all of
it leaves together. Stored data is untouched: the column keeps its
values and schema sync drops nothing; the field is no longer served.

## Measure first (the card's steps), on main `c30ce97cd7`

| Path | Re-registers without uninstalling? | Dropped extension's field
still served on main? | What said anything |
|:--|:--|:--|:--|
| Bare `registerApp` (card repro) | yes | yes: field, validation and
index all served, `com.t.mod:extend` layer kept | nothing |
| `os dev` reload: `metadata:reloaded` →
`ObjectQLPlugin.refreshReloadedPackages` → `registerApp` | yes (refresh,
never uninstall) | yes | nothing: no warn, schema sync adds only |
| `os dev` reload, full standalone composition (`createStandaloneStack`,
the artifact door's `_reloadAndAnnounce`) | yes | NOT MEASURED on this
composition: neither the first run nor the hand-over round got the
shared verify lock (the round queued about 80 minutes behind two dogfood
batteries). The probe is written (a two-package composed artifact, the
extension dropped by the door's own reload, plus a CONTROL reload) and
is held by the seat; it reaches the same `metadata:reloaded` hook
measured in the row above | nothing |
| install-local upgrade 1.0.0 → 1.0.1 dropping the extension
(`manifest.register`, no uninstall) | yes | yes: `crm_line` served and
`find` returned `cb_account` | the dry run's plan DID say so:
`plan.fields.removed` names `crm_line.cb_account`, `environment.columns`
`reasons: ['removed'], rows: 1`; removed fields need no confirmation
(`schemaUpgradeVerdict`: reported, refused by nothing), so the upgrade
answered 200 and then kept serving the field the plan said was removed |
| install-local re-install of the same id and version without the
extension | yes | yes | nothing |

Stored column, both before and after the fix: `crm_line.cb_account`
keeps its column and its value `ACME` (schema sync drops no column).

After the fix every row above reads "no": the object serves `name` only,
`find` no longer returns `cb_account`, the column still holds `ACME`,
and the dry run's plan is unchanged (it already named the field as
removed; now the runtime agrees with it).

## Tests

- `packages/objectql/src/reregister-extension-withdraw-35609.test.ts`
(new): re-register without the extension (fields, validation and index
gone, owner kept); CONTROL rename; another package's extension of the
same target untouched; same body again keeps it; an extension registered
under the id outside a body kept; a refusal later in the run puts it
back (and the record with it); the reload door drops it, CONTROL reload
keeps it.
-
`packages/cloud-connection/src/marketplace-install-local-reregister-extension-withdraw-35609.test.ts`
(new): real kernel, SQL driver, real schema sync, the install-local
door: upgrade dropping the extension (plan names the field, object no
longer serves it, column keeps its value), same-version re-install,
CONTROL upgrade keeping it.

<details><summary>Readings (ablation: the four fixed objectql files put
back to main, then restored byte-identical to HEAD)</summary>

One locked run, `unfixed-vs-fixed` legs over the same two commands. The
objectql and cloud-connection suites both resolve
`@objectstack/objectql` to `packages/objectql/src` (stack frames read
`../objectql/src/...`), so no dist rebuild was involved; the on-disk
proof is the marker count (`packageBodyExtensions` in
`registry-items.ts`: 0 in the unfixed leg, 9 in the fixed leg) and the
restore was proven by an empty `git diff HEAD` and matching `git
hash-object` = `HEAD:path` for each file.

- UNFIXED (main's four files):
`reregister-extension-withdraw-35609.test.ts` 5 failed / 3 passed (the
controls pass), `package-refused-upgrade-keeps-installed` and
`manifest-service-artifact-refusal-restores` green: `Tests 5 failed | 76
passed (81)`. Install-local readings: `served after upgrade [
'cb_account', 'name' ]`, `find` returns `"cb_account":"ACME"`,
re-install without the extension `[ 'cb_account', 'name' ]`.
- FIXED (HEAD): `Test Files 3 passed (3) · Tests 81 passed (81)`;
install-local `served after upgrade [ 'name' ]`, `find` row has no
`cb_account`, `column after upgrade
{"hasColumn":true,"values":["ACME"]}`, re-install without the extension
`[ 'name' ]`.
- `pnpm --filter @objectstack/objectql test` at the fix (objectql src as
on head `555ef3e2c7`): `Test Files 627 passed (627) · Tests 14240 passed
(14240)`.
- `pnpm --filter @objectstack/objectql typecheck`: exit 0 (`tsc
--noEmit`, then `check:test-typecheck: OK`, debt held).

</details>

## Acceptance notes

- Clause-②: no. Nothing is refused: a body registered again is never
refused over an extension it drops; the dropped layer is withdrawn.
- Owned objects a re-registered body no longer ships are still kept
until a restart; `ingestReloadedObjects`' docblock calls that deliberate
("same lifecycle as their tables"). Not touched here.
- `ObjectQLPlugin.refreshReloadedPackages`' docblock still says items
removed from the artifact stay registered until restart; that has been
out of date since the item withdrawal landed and is now out of date for
extensions too. Not edited (outside this card's file surface). Carried
by objectstack-ai#36328.
- Inferred, not exercised: a withdrawal (this one, an uninstall, an
`object_extension` item delete) is not asked the run-end record-currency
follow door, which judges registered layers only. A withdrawn extension
carrying a currency code field another package's amount follows would
leave that pair unjudged until the follower re-registers. Same gap for
the two existing withdrawal doors; not filed. Carried by objectstack-ai#36328.
- Inferred edge: if a withdrawn layer was the object's last contributor
(an extension with no owner, already an ADR-0029 violation), the entry
is closed and a refusal later in the run restores the contributor list
without reopening the entry. Unreachable through a valid registration.
- Serial constraint: objectstack-ai#36236 (shares `registry.ts`, and places extension
items in the fold) has since landed on `main` as `d33bf5a2`.
`overlap-check` against `origin/main` `d8599c2ca2` reads clean, and
GitHub reports the PR mergeable. This PR's CI ran on the merge with
`99fbaa6d`, before objectstack-ai#36236 landed, so the joint tree is first tested in
the merge queue. Read, not run: a placement rides on its extension's
contributor layer and is applied in the fold, so a withdrawn layer takes
its placements with it. `registry-object-registration.ts` is not
touched.
- Prior rulings: `check-prior-rulings --card 35609` over the four files
read; no conflict. The closest precedents are the item withdrawal this
extends (same wrapper, same restore discipline), ADR-0144 D2/D6 (the
run-end follow door, unchanged), ruling A on objectstack-ai#35228 (one extension per
target per package, unchanged) and ruling 6624345766 (facade form:
`registry.ts` gains only a state field, docblocks and host wiring;
`check:facade-delegation-only` green). Since main grew `registry.ts`,
the file also sits under its facade line ceiling (6426, ruling
6897467376): the long objectstack-ai#35609 prose lives in the facet docblock in
`registry-items.ts`, and the ceiling is not raised.

## Verification

<details><summary>Merge-queue red at 555ef3e, fixed at 368b000
(repo:objectstack#7)</summary>

- What failed: the merge queue dequeued this PR (merge-group run
45007098161, job 137160994478, `Lint · repo & tooling gates`).
`check-facade-delegation-only --self-test` case N6 printed: `the
committed registry is red: is 6441 lines, over its line ceiling of 6426
by 15`. The PR was green on its own head. Main had grown `registry.ts`
to 6409 lines, and this PR's +32 went over the ceiling.
- Fix (`53d2506ddb`, `368b000bed`): merged `origin/main` `4e55e4eb72` (a
merge, no rebase, no force-push). Then I did what the rule says to do:
"a file in facade form does not grow". The detailed extension-withdrawal
prose moved from the facade docblocks to the facet docblock on
`ItemsFacet.replacingPackageBody` (`registry-items.ts`). The facade
keeps a short contract paragraph, and the field doc is one line. The
ceiling row is untouched, so the check is not weakened.
- Comment-only proof: both files were transpiled with `removeComments`,
before and after `368b000bed`. Each pair is byte-identical
(`registry.ts` sha256 prefix `b87e53ad1efa` both sides,
`registry-items.ts` `afb1b850be15` both sides). A control leg with one
injected token compared different (cmp exit 1).
- `pnpm check:facade-delegation-only`: exit 0. `N6 the committed
registry is well-formed against this checkout` passes, and the check
prints `packages/objectql/src/registry.ts: 6421 lines, ceiling 6426 (5
left; ruling 6897467376)`.
- `dispatch-gates --commands` at `368b000bed`: 73 derived. 71 exit 0.
`check:dual-build-cjs-loads` and `check:type-check-debt` exit 3
(PREREQUISITE NOT MET: no full `dist/`), so NOT MEASURED locally and
carried by CI's Build Core and debt-ledger lanes. `--ran` with exit
codes: 73 derived, 71 run, 2 NOT-MEASURED, 0 unrun. Gate derivation read
a tree 7 commits behind the newest `origin/main` `ff60149900`. None of
this PR's files moved there, so I did not merge again.
- `overlap-check --branch`: `VERDICT clean exit 0` against `origin/main`
`ff60149900`.
- NOT MEASURED locally: the `@objectstack/objectql` test suite and
typecheck at the merged head. Reason: the shared verify lock. Three
9-minute tries all ended in queue-timeout behind a dogfood battery
(holder pid 13599, more than 39 minutes). This is a declared narrowing.
The fix commit compiles to identical JS (proof above), and CI's Test
Core and Type Check lanes run both on the merge. The objectql dependency
closure did build under the lock (`VERDICT command-exit 0`).

</details>

<details><summary>Local gates at 555ef3e</summary>

- `dispatch-gates --commands`: 73 commands derived; all run. 70 exit 0.
`check:query-options-erasure` went red (test surface 236 to 237) on a
cast in the new cloud-connection pin; fixed in `555ef3e2c7` and re-run
green (236). `check:dual-build-cjs-loads` and `check:type-check-debt`
exited 3 (PREREQUISITE NOT MET: no full `dist/`, and the closure build
never got the shared lock): NOT MEASURED locally, CI's `Lint & Repo
Gates` carries both.
- Re-run on the final head after the last edit:
`cross-package-test-inputs`, `test-source-alias`, `nul-bytes`,
`refd-timer-probe`, `tier-file-adoption`, `issue-citations`,
`doc-authoring`, `facade-delegation-only`: all exit 0.
- `dispatch-gates --ran`: 73 derived, 73 run, 0 unrun.
- `overlap-check --branch=HEAD`: clean against origin/main and objectstack-ai#36236.
- Not run locally, declared to CI: `test:repo`, the full
cloud-connection suite (only the new file was run), and the Build Core /
Type Check workspace lanes. CI has since run all of them at this head
(round below).
- Dogfood battery: not owed (no `!`, no narrowing arm).

</details>

<details><summary>Hand-over round (repo:objectstack#7) at the same head
555ef3e: the local gaps closed</summary>

No commit in this round; the head declared final stays `555ef3e2c7`. CI
ran this head on the merge with `99fbaa6d` (`b97f554d`), and every
gate-carrying check-run concluded `success`.

- Cloud-connection new file, rerun after the cast removal: `Test Core`
at this head, `@objectstack/cloud-connection:test` printed
`src/marketplace-install-local-reregister-extension-withdraw-35609.test.ts
(3 tests)` passed. The objectql file printed
`src/reregister-extension-withdraw-35609.test.ts (8 tests)` passed. All
10 `Test Core` shards: success.
- Cloud-connection typecheck: `Type Check · workspace` ran
`@objectstack/cloud-connection:typecheck`; `Tasks: 124 successful, 124
total`; success.
- `check:dual-build-cjs-loads`: `Build Core` step "Every published
require entry point actually loads": success.
- `check:type-check-debt`: `Type Check · debt ledger` step "Re-measure
the type-check DEBT / TEST_DEBT ledger": success, lane verdict success.
- Derived gates re-run locally at `555ef3e2c7`, against `origin/main`
`c448c615`: `dispatch-gates --commands` derived 73 commands. 68 exited
0. Five exited 3, PREREQUISITE NOT MET (no built `dist/`; the closure
build never got the lock). CI carries all five at this head with
success: `dts-closure` (Build Core "Sweep the built closure for vanished
declarations"), `dual-build-cjs-loads`, `lean-entry-closure` (Build Core
"The lean engine entry loads no forbidden or unlisted package"),
`sourcemap-no-sources-content` (Build Core "No published source map
embeds source text") and `type-check-debt` (above). `dispatch-gates
--ran` with the exit codes recorded: 73 derived, 68 run, 5 NOT-MEASURED
(derived from exit 3), 0 unrun.
- Still NOT MEASURED: the full `createStandaloneStack` reload probe.
Reason: the shared verify lock. This round queued about 80 minutes
behind two dogfood batteries (holder pid 5424 over 67 minutes), and
retaking the same slot after each exit 99 put the call back behind newer
arrivals. No CI job runs this probe.

</details>

Two-minute check: `pnpm --filter @objectstack/objectql exec vitest run
--maxWorkers=2 src/reregister-extension-withdraw-35609.test.ts` prints 8
passed; revert `registry-items.ts` to `origin/main` and the same command
prints 5 failed.

Read first, by risk: `packages/objectql/src/registry-items.ts`
(`replacingPackageBody`, the identity test that decides which layers the
body wrote), `packages/objectql/src/registry-platform-global.ts`
(`withdrawObjectExtension` now notes the run),
`packages/objectql/src/registry.ts` (host wiring and the record).

Written by repo:objectstack#4 · os-project-manager ·
session_01FEkQ5miLqNucRZevceHwNh (PM-dispatched dev run); continued
after the hand-over by repo:objectstack#7 · zhuangjianguo ·
session_01QsR2jTeURPvEm465RcoYEC.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01QsR2jTeURPvEm465RcoYEC
<!-- signed: repo:objectstack#7 · zhuangjianguo ·
session_01QsR2jTeURPvEm465RcoYEC -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
247257110 pushed a commit to 247257110/objectstack that referenced this pull request Nov 23, 2026
objectstack-ai#35928) (objectstack-ai#36316)

<!-- claude-projects-attribution: {"github_login":"os-project-manager"}
-->
_Requested by **Leehom** · [project
thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1XTRdLmK9YYgMSCJ7NH2PuUY)_

repo:objectstack#7 · zhuangjianguo · session_01QsR2jVTYADzVWfarACx5j3

Fixes objectstack-ai#35928

Clause-②: yes (widening: one new public read, `POST
/api/v1/automation/_record-starts`, and the UI exports that read it)
Metadata-protocol: added
Skills-docs: none — no skill under `skills/**` teaches the console's
stage confirms; `content/docs/automation/flows.mdx` and
`content/docs/frontend/plugins/plugin-grid.mdx` document the read and
the list in this change.
Ruling-ref: 7073655354

## 维护者速读

-
用户在列表单元格或记录页改阶段时,确认框在原来那句话下面列出这次改动会启动的流程名称(按用户语言显示),带审批的流程标「发起审批」;以前只写「可能触发相关自动化」。
- 属于行内编辑专题,按维护者的裁定「能改这条记录的人都看到流程名称」,让用户确认前就知道保存后会发生什么。
- 出错时最多是清单少列或不显示,确认框退回今天那句话,保存本身不受影响;整个改动可以直接撤回。
- 无。

## What changes

**Server (one new read).**

- `@objectstack/spec/api`: `RecordUpdateStartsRequestSchema` (`{ object,
recordId, changes }`, strict), `RecordUpdateStartSchema` (`{ name,
label, startsApproval }`), `RecordUpdateStartsResponseSchema`, and the
contract entry `listRecordUpdateStarts` (`POST
/api/v1/automation/_record-starts`). `_record-starts` joins the
`/automation` domain's reserved position literals (underscore-led, so
the package-namespace install gate is not narrowed).
- `@objectstack/spec/contracts`: `RecordUpdateStartsInput` and the
optional `IAutomationService.listRecordUpdateStarts`.
- `@objectstack/spec/automation`: `recordChangeTriggerHookEvents` /
`recordChangeTriggerFiresOnUpdate`, the record-change token grammar
MOVED out of `@objectstack/trigger-record-change` (whose
`triggerTypeToHookEvents` now delegates to it), so the trigger and the
preview read one rule.
- `@objectstack/service-automation`:
`AutomationEngine.listRecordUpdateStarts` (`record-update-starts.ts`). A
flow is asked only when it is enabled and armed on a `record_change`
trigger for this object whose token binds an update; whether it starts
is `startConditionHolds`, the one start-condition gate every run attempt
passes, over the variables `seedRunVariables` seeds (`record`, its
flattened fields, `previous`). The approval mark is the presence of an
`APPROVAL_NODE_TYPE` node (ADR-0019). A condition that throws is not
listed. Hooks are never listed (ADR-0077 §2).
- `@objectstack/runtime`: the `/automation` domain's `_record-starts`
door, mounted in the dispatcher plugin and recorded in the route ledger.
Order: query parameters refused `400 VALIDATION_ERROR`; body parsed
through the request schema (`400 VALIDATION_FAILED`); `501` when the
engine has no preview; the record read AS THE CALLER through the `/data`
door's own `get` (`callData`), so an unreadable record answers `404
RECORD_NOT_FOUND` exactly like an absent one and the engine is never
asked; a read that answers no record is refused the same `404`; every
`changes` key must be a declared field of the object (else `400
VALIDATION_FAILED` on `changes.KEY`, the engine never asked); then the
engine is handed `previous` = the record read, `record` = that record
with `changes` applied, and the caller's `userId` / `tenantId`.
Anonymous `401`.
- `@objectstack/client`:
`client.automation.listRecordUpdateStarts(request)`.

**UI (two confirms, one reader).**

- `@object-ui/plugin-detail`: `stageChangeStarts.tsx` —
`useRecordUpdateStarts(ask)` (asks the route once per pending move
through the host's `apiFetch`, parses the answer through
`RecordUpdateStartsResponseSchema`, answers `[]` while in flight,
refused, failing, malformed or empty) and `StageChangeStarts` (the list
under the sentence: each flow by its label translated through
`activeFlowsBundle` + the spec's `translateFlow`, the flow runner's
reading; an approval flow marked). Exported for the grid.
- Record page: `recordPathStageChange.tsx` draws it in both
confirmations (the path's `AlertDialog` and the header stage menu's
`RequiredFieldsDialog`, via a new optional `notice` slot in
`@object-ui/fields`).
- List cell: `ObjectGrid`'s state-machine confirm draws it;
`StateChangeConfirm` gains an optional `ask` (the row's record id and
the move).
- `@object-ui/i18n`: `activeFlowsBundle` moves here from
`@object-ui/app-shell`'s module-internal `utils/flowsBundle` (its three
app-shell importers repointed), since the confirms' packages do not
depend on the console; two keys in all eleven packs:
`detail.stageChangeStartsHeading`, `detail.stageChangeStartsApproval`.
- The confirm's sentence is never replaced (not this card: objectstack-ai#35685 S3). A
move that starts nothing, and a failed read, leave the confirm exactly
as today.

Docs: `content/docs/automation/flows.mdx` (§ Which flows a record update
would start), `content/docs/frontend/plugins/plugin-grid.mdx` (the
confirm now names the flows). Changesets:
`35928-record-update-starts-read.md`,
`35928-stage-confirm-names-flows.md`, both carrying the Clause-② and
Metadata-protocol lines.

## Tests

- Engine `record-update-starts.test.ts` (8): condition holds / does not
hold; approval mark CONTROL (an approval flow and a plain flow side by
side); no condition; create / delete / other object / obsolete never
named while `record-before-write` is; an unevaluable condition not
named; an unarmed engine answers nothing; `current_user` evaluated as
the writer named.
- Door `automation-record-update-starts.test.ts` (13): a member is
answered (body parsed through the response schema) and the engine is
handed exactly the record read as the caller; empty list; unreadable
record `404 RECORD_NOT_FOUND` with the engine never asked; unreadable
and absent answer alike; anonymous `401` before any read; malformed body
`400 VALIDATION_FAILED`; query parameter `400 VALIDATION_ERROR`; `501`
without the preview; a GET of the literal is not this door.; a change
key that is not a field `400 VALIDATION_FAILED` on that key (an
undeclared key, a key off the field-name grammar, an inherited member
name), the engine never asked; a change on an object the registry does
not declare refused alike; a read that answers no record `404
RECORD_NOT_FOUND`, never previewed; and the ledger row names
`RecordUpdateStartsRequestSchema` / `RecordUpdateStartsResponseSchema`,
as the clone and publish-drafts suites pin theirs.
- Spec `automation-api.zod.test.ts`: contract count and the new entry's
method/path; request strictness; a leaked `condition` / `nodes` dropped
by the response parse. Each `changes` key is held to the field-name
grammar (refused: a dotted, an upper-case, a digit-initial, a spaced and
an empty key).
- List cell, in its confirm's harness
`ObjectGrid.autosave-35685.test.tsx` (new top-level describe, 3): list
(request body pinned, labels, approval mark under the unchanged
sentence), empty, failure (and Change still saves the move).
- Record page, in each confirm's harness (new top-level describe in
each, 3 + 3): `record-path.stageChange-28199.test.tsx` (the path's
confirmation) and `RecordStageMenu-35891.test.tsx` (the header stage
menu's dialog): list, empty, failure (a refused read, a network error
and a malformed envelope each draw no list).
- `stageChangeStarts-label-35928.test.tsx` (2): a flow named by its
translation where the app's `flows` bundle has one, by its authored
label where not; nothing drawn for no flows.
- Ablation (one-shot under the verify lock, restored by trap, `git diff
HEAD` on both sources empty): removing the `StageChangeStarts` render
from `ObjectGrid.tsx` and from both confirmations in
`recordPathStageChange.tsx` turns exactly the three `list:` pins red
(`Tests 3 failed | 6 passed`); empty and failure pins stay green, as
they should.

## Acceptance notes

- Card acceptance: "Changing a stage that starts a flow shows that flow
by name in both confirms" — pinned in both confirms (list cell, and both
record-page confirmations) and measured live (below); "a stage with
nothing attached shows no list" — the empty pins; "a read failure falls
back to the generic sentence" — the failure pins.
- Residual, stated in the contract docblocks and `flows.mdx`: the
preview binds the caller's user id and tenant only, not their positions,
request params or expand as a live run does, so for a condition reading
those the preview can differ from the save in either direction (it can
miss a flow, or list one a negated test of the writer would stop); the
seat files the follow-up for positions.
- Residual (not widened here): conditions are judged on the record as
the CALLER reads it (field-level security applied), so a condition that
reads a field the caller cannot see is judged on what they see, and one
that throws on a missing field is not listed. The preview can therefore
under-list for a caller with masked fields; it never reveals a masked
value. Documented in `flows.mdx`.
- Residual: the header stage menu's dialog asks with the stage alone;
values typed into that dialog for required fields are not part of the
preview's `changes`.
- Two existing confirm suites (`RecordStageMenu-35891`,
`record-path.stageChange-28199`) now stub `fetch` with a `501` answer in
`beforeEach`, so the new read does not leave for the network under test;
no existing assertion changed. Across the touched UI packages the run
shows 0 `ECONNREFUSED`.
- The approval mark is the ruling's test, "the flow contains an approval
node". Measured live, showcase's `showcase_project_closure` reaches its
sign-off approval through a `subflow` node (the approval node lives in
`showcase_closure_signoff`), so the preview lists it with
`startsApproval: false`. Following subflow references for the mark is a
reading beyond the ruling: filed objectstack-ai#36322.
- Overlap (`overlap-check.mjs` at the head below, exit 1, reported and
not merged around): objectstack-ai#36296 and objectstack-ai#36236 have landed and are merged in.
objectstack-ai#36335 (part of objectstack-ai#35979) moves `activeFlowsBundle` into `@object-ui/i18n`
too and conflicts in `ui/packages/i18n/src/flowsBundle.ts`,
`ui/packages/i18n/src/index.ts` and
`ui/packages/app-shell/src/views/metadata-admin/previews/flow-label-translations.tsx`;
it lands after this PR and drops its copy of the move. Every other open
PR that shares a file merges cleanly.
- Declaration correction: the claim and ruling 7073655354 read
`Metadata-protocol: none`, but the three new `@objectstack/spec/api`
schemas enter the `api` authorable-surface shard (10 keys), which `Check
Changeset` reads as `added` (`none-baseline-moved`). The line is `added`
and `@objectstack/spec` is graded `minor`, as objectstack-ai#32251, objectstack-ai#35789 and objectstack-ai#31883
were for new api request/response schemas. No flow or other metadata key
is added, so the ruling's "no new authorable key" still holds.

## Verification

- Read first: `packages/runtime/src/domains/automation.ts`
`respondToRecordUpdateStarts` (the order of refusals and the
caller-scoped read that admits the engine), then
`packages/services/service-automation/src/record-update-starts.ts`
(which flows are asked and the one gate they pass).
- Live, on a fresh showcase (`pnpm dev -- --fresh`), as a member created
by the admin (`role: user`, not an admin):
- `Website Relaunch` `status: active → completed`: `200
{"flows":[{"name":"showcase_project_closure","label":"Project Closure
with Sign-off (nested pause)","startsApproval":false}]}`
  - same record `→ on_hold` (CONTROL): `200 {"flows":[]}`
- same record `budget 150000 → 250000`: `200
{"flows":[{"name":"showcase_budget_approval","label":"Project Budget
Approval","startsApproval":true}]}`
- an absent record: `404 RECORD_NOT_FOUND`; anonymous: `401
UNAUTHENTICATED`; a body without `changes`: `400 VALIDATION_FAILED`
naming `changes`.
- Zone 2 premise, measured before any code: the same kind of member
reads `GET /api/v1/meta/flow` (200, 33 flows with labels, the admin's
set) and `GET /api/v1/meta/flow/showcase_closure_signoff` (200, its
nodes).
- The console itself was not driven in a browser (its dist is not built
in this container); both confirms are pinned through the real components
above.
- Local, all under `scripts/pm/os-verify-lock.sh` (shared box):
- touched UI packages (`plugin-detail`, `plugin-grid`, `fields`,
`i18n`): `Test Files 1131 passed | 2 skipped` · `Tests 13186 passed | 38
skipped`; after folding the pins into their harness files the three
files plus the label file: `Tests 77 passed (77)`.
- type-check: `tsc --noEmit` (src and test projects) for `i18n`,
`fields`, `plugin-detail`, `plugin-grid`, and src for `app-shell`;
`service-automation`, `runtime`, `client` exit 0.
- server: engine 8/8, door 9/9, `route-ledger.conformance` +
`automation-api-contract-mounts` + `http-dispatcher` green, client
conformance 11, spec `automation-api.zod` + `address-grammar` 87,
`trigger-record-change` 122.
- `dispatch-gates.mjs --commands` (129 families) run and reconciled with
`--ran`: `129 run, 0 NOT-MEASURED`. First pass reds were all this diff's
own owed artefacts, fixed and re-run green: spec `gen:api-surface` /
`gen:docs` / `gen:export-origins` / `gen:declaration-map` /
`gen:strictness-ledger` (api count 533 → 536: the three new schemas),
the route-ledger census sentence (149 → 150), and
`check:test-source-alias` (a spec/automation alias in the trigger
package's vitest config; the door test pays `@objectstack/metadata` at
collection).

- Re-verified after the hand-over (seat 7), main `b3bcfefc` merged in at
`472457d9`, the generated surfaces regenerated at `6bd111ff`
(`gen:schema` → spec build → `gen:api-surface` → `gen:export-origins` →
`gen:declaration-map` → `gen:docs` → `gen:strictness-ledger`;
`check-regen-pending` clear), the changeset correction at `99bfd857`.
Under the verify lock at `6bd111ff`:
- type-check exit 0: `@object-ui/i18n`, `fields`, `plugin-detail` (src
and test; the hand-over's stale-dist red is gone after the closure
build), `plugin-grid`, `app-shell`; `@objectstack/spec`, `runtime` (src
and test layer, after building `@objectstack/driver-turso`),
`service-automation`, `client`, `trigger-record-change`.
- tests: `runtime` Tests 11745 passed | 25 skipped; `service-automation`
4224 passed; `client` 820 passed; `trigger-record-change` 122 passed;
spec `automation-api.zod` + `address-grammar` 87 passed; `plugin-detail`
+ `plugin-grid` + `fields` + `i18n` Test Files 1135 passed | 2 skipped,
Tests 13300 passed | 38 skipped.
- `dispatch-gates.mjs --commands` (129 families): run at `99bfd857` (the
six that started before that commit re-run on it) and reconciled with
`--ran`: `129 derived, 128 run, 1 NOT-MEASURED, 0 UNRUN`. The one
NOT-MEASURED is `check:dual-build-cjs-loads` (exit 3, PREREQUISITE NOT
MET: it needs every package's dist, which this container does not
build); CI runs it in its Lint jobs, green at this head.
- CI at `99bfd857`: every check-run green or skipped by design. Check
Changeset shows two runs: the `synchronize` run (09:07Z, before the body
said `added`) red, the `edited` run (09:08Z) green.
- Contract review rework (L2 at `99bfd857`), at `3ba211dc` and
`d2279e6c` (head):
- the door refuses a change key that is not a declared field of the
object and a read that answers no record; the request schema holds each
change key to the field-name grammar; the ledger row is pinned; the
preview's caller binding is stated in the contract docblocks and
`flows.mdx`; `_record-starts` joins the address module's literal list.
- ablation, one-shot under the verify lock (`ablation-replace.mjs`,
restored by trap, blob == HEAD and `git diff HEAD` empty after each):
the declared-field refusal disabled → `Tests 2 failed | 11 passed` (the
two refusal pins); the no-record refusal disabled → `Tests 1 failed | 12
passed` (its pin).
- local: `runtime` Test Files 637 passed, Tests 11749 passed | 25
skipped; door suite 13/13 at the head; spec `automation-api.zod` +
`address-grammar` 88 passed; type-check exit 0 for `spec`, `runtime`
(src and test layer, at `d2279e6c`), `service-automation`, `client`,
`plugin-detail`.
- `dispatch-gates.mjs --commands` at `3ba211dc`: `129 derived, 129 run,
0 NOT-MEASURED, 0 UNRUN`; the 37 families that read test files re-run at
`d2279e6c` (a one-line test-type fix), all exit 0.
- CI at `d2279e6c`: 70 check-runs, 61 success and 9 skipped by design,
Check Changeset green.
- Delta round (L1-d 7078831268, L2 nit N3 from 7078841748), at
`41487226` (head): the 401 and 501 pins assert `body.error.code`
(`UNAUTHENTICATED`, `NOT_IMPLEMENTED`) beside the status; the spec
changeset names the undeclared-change-key `400 VALIDATION_FAILED` and
the no-record `404` among the door's refusals; the caller-binding limit
reads "can differ from the save in either direction" in the request
schema's docblock, `RecordUpdateStartsInput` and `flows.mdx`. Door suite
13/13; type-check exit 0 for `spec` and `runtime` (src and test layer);
`dispatch-gates.mjs --commands` at `41487226`: `129 derived, 129 run, 0
NOT-MEASURED, 0 UNRUN`; CI at `41487226`: 70 check-runs, 61 success and
9 skipped by design.

https://claude.ai/code/session_01FEkQ5keqTTiV8ptWFNc6ZF
https://claude.ai/code/session_01QsR2jVTYADzVWfarACx5j3

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- signed: repo:objectstack#7 · zhuangjianguo ·
session_01QsR2jVTYADzVWfarACx5j3 -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
247257110 pushed a commit to 247257110/objectstack that referenced this pull request Nov 23, 2026
…nsions entry; judge residual jobs at composition (objectstack-ai#36338)

<!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} -->
_Requested by **Steedos** · [project
thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9UbbCxiFE11rsKwyNffJZKYqJs)_

Fixes objectstack-ai#35711

Clause-②: no (narrowing)
Metadata-protocol: narrowed
Skills-docs: none — no skill teaches placing `objectExtensions` or
`jobs` in a manifest-less input of a `'preserve'` composition; the
refusal names both entries and prescribes the fix

## 维护者速读

-
用户能看到什么变化:应用作者把几个包拼成一个产物时,若某个没有包标识的部分给别人的对象加了字段,这些字段现在能正常使用;以前字段直接消失,写入时报字段不存在,启动日志也一句不提。
-
为什么做:拼包产物里不属于任何包的"剩余部分"的对象扩展没有任何环节去登记,属于同一组拼包问题的最后一个漏洞;同时两个没有包标识的部分声明同名定时任务时,拼包不拦、启动时两个都不运行。
-
出错会怎样:拼包时新拦下三种写法(剩余部分里的同名定时任务;剩余部分和持有产物标识的那个包给同一对象各加一段扩展;剩余部分给同一对象加两段扩展,即使别的包也扩展了这个对象),不论选哪种拼包方式,只要产物里带有多个包就会拦;作者会在校验时看到点名两处的报错;已构建的产物照常启动,只多一条错误日志;撤回本次合并即可恢复原状,不涉及数据迁移。
- 要你做什么:无。本次虽然收紧拼包规则,但不在受管范围,座位会在完整回归测试对准最终版本之后自行合入。

## What changes

Measured first, on main `c30ce97cd7`, through the real `os serve`
(`packages/cli/bin/run-dev.js serve`, SQLite in memory), on
`composeStacks([owner, other, noManifest], { manifest: 'preserve' })`:

- **Residual extension.** The input without a manifest extends
`probe_account` with `residual_note`. `GET
/api/v1/meta/object/probe_account` listed no `residual_note`; `POST
/api/v1/data/probe_account` with it answered `400 INVALID_FIELD`; the
boot logged nothing about it. `os build` of the same config exits 0 and
carries the entry at the artifact's top level (`1 Extensions`), so a
built artifact reaches the same drop. Producers: a composition yields
`packages[]` beside a residual under `'preserve'` with an input that has
no manifest, and under any strategy (`'preserve'`, `'first'`, `'last'`,
an index) once an input is itself a multi-package artifact, whose own
top-level collections are then residual; a flat composition of inputs
that carry no `packages[]` is one package with no residual.
- **Residual jobs.** Two inputs without a manifest declaring job
`probe_nightly`: `composeStacks` accepted them; the boot (with scheduled
work on) logged `NOT SCHEDULED` at `error` and armed neither.

The fix, REGISTER rather than refuse, because the residual already has
an owner: ADR-0130 D4 registers every residual item under `manifest.id`,
and the engine already registers the residual's objects and items there;
an extension was the one residual entry no door registered.

- **`packages/metadata/src/plugin.ts`.** The residual rule
`unclaimedTopLevel` (the one copy every door reads) now lists a
top-level `objectExtensions` entry (type `object_extension`) when it
names a target and no package body carries an entry EQUAL to it by
value. Not by target: the flattened top level repeats each body's entry
and a built artifact loses the references, but each copy still holds
what its body's entry holds; an equal entry is also the case where
nothing is lost. The metadata door still registers no extension (it
never registered a body's either).
- **`packages/objectql/src/plugin.ts`.** The `manifest` service
registers those entries after every body, under the residual's id,
through the registry's `extend` verb with the same contribution a body's
entry builds: `objectExtensionContribution` (`engine-registration.ts`)
is the one reading of an `objectExtensions` entry, and `registerApp`
step 2b now builds a body's contribution through it too, so the two
cannot drift (it carries `place`, which objectstack-ai#36236 added to step 2b on
main). Two follow-ons of registering:
- Under `'preserve'` the residual's id is the last
input-with-a-manifest's body too, and the registry keeps one extension
of a target per package. A residual entry for a target that body also
extends (or two residual entries for one target) keeps only the last
one's fields; the boot says so once per target at `error`, like the
objectstack-ai#35228 arm A1 line for one body.
- An entry whose field names a picklist no package body declares is not
registered and is named at boot (`warn`), the residual objects' own rule
(the boot's picklist audit would refuse the field).
- **`packages/spec/src/stack.zod.ts`, the composition door.** The
residual door now mirrors that reading: an `objectExtensions` entry is
claimed by a body only when a body carries an equal entry; the owner
body's entries for a target the residual also extends are judged with
the residual's, body first (the boot's registration order), so the
objectstack-ai#22934 sentence ("only the last of these entries' fields register") is
now true at that door. `jobs` is judged there by name (a body's job name
claims the slot), where `TOP_LEVEL_COLLECTIONS_NEVER_RESIDUAL` used to
drop it (that set is the owner-stamp mirror and is unchanged).
- **The `jobs` row's wording, at every door.** It said only the last
entry is kept; the binder schedules none. Now: `The runtime keys jobs by
name: the metadata keeps only the last of these entries, and the job
scheduler refuses a name two enabled jobs share, so when both are
enabled neither runs.` (exact only for two enabled jobs; a disabled one
counts no collision). One row, so it stays byte-identical across doors.
- ADR-0087 semantic entry
`stack-residual-extension-registered-and-jobs-judged`, changeset `minor`
for spec, metadata and objectql.

Newly refused at composition (`STACK_CROSS_REFERENCE_INVALID`, 422),
under every manifest strategy once the result carries `packages[]`
(`'preserve'`, and `'first'`/`'last'`/an index with a multi-package
input):

1. two residual jobs of one name;
2. a residual extension for an object the body carrying `manifest.id`
extends with other fields;
3. two residual extensions of one object, also when another package body
extends that object (the claim is by value now; it was by target, so
both counted as that body's copies and composed).

Unchanged: one residual extension for an object ANOTHER package extends
(both register), a residual entry equal to a body's, every
package-claimed extension, one residual job.

Not refused, a known gap left to the binder (stated in
`residualEntryPredicate`'s docblock and the migration entry): a residual
job that shares its name with a package body's job, with other content,
composes as that body's copy, and the boot schedules neither of the two
enabled jobs. Read from code, not driven.

## Tests

New pins, named after the card:

- `packages/spec/src/stack-residual-extension-jobs.test.ts` — residual
job pair refused (code `STACK_CROSS_REFERENCE_INVALID`, status 422,
exact sentence); the single-stack door says the same row; residual
extension sharing the owner body's slot refused, body entry first;
residual extension of a target another body extends composes; two
residual extensions of a target another body extends refused (shape 3);
`'first'` and `'last'` with a nested multi-package input refuse a
residual job pair (with a CONTROL that the artifact carries
`packages[]`); an equal entry is a copy; CONTROLS: one residual job
composes, each body's own job name, two packages each extending one
target, the owner body's own pair reported once.
- `packages/metadata/src/unclaimed-top-level-residual-extension.test.ts`
— `unclaimedTopLevel` lists the residual entry, composed and as built
JSON, never the body's flattened copy; CONTROLS: nothing listed when
every extension is a body's, no residual without `packages[]`.
-
`packages/objectql/src/manifest-service-residual-object-extension.test.ts`
— on a kernel through the `manifest` service: the residual field is
served (composed and built JSON); it serves exactly what the same entry
serves from a body (parity), and a `place`d entry too (anti-vacuity: the
placement changes what is served); CONTROL a package-claimed extension
unchanged, nothing logged; the owner-slot pair serves the last fields
with one `error` line; a dangling-picklist entry is not registered and
is named at `warn`.

<details><summary>Package suites and typecheck</summary>

Head `058d5c2815`. Since f4e83b0 the change is docblocks, the
migration entry, the changeset, the `jobs` row's last clause (now "so
when both are enabled neither runs") and two spec pins (contract review
S1, S2, N3, N4); the spec pin file re-ran here: 13 passed. The objectql
and metadata readings below are from f4e83b0 (`origin/main`
d8599c2 merged in, then the one-reading unification); neither package
changed since. The spec suite's last full run is seat 4's at 5a41a05
(870/870 files, 27886 tests); since then `packages/spec` changed only by
the main merge and a type cast, and its pin was re-run here.

- `pnpm --filter @objectstack/objectql exec vitest run --project local
--maxWorkers=2` — Test Files 628 passed (628), Tests 14272 passed
- `pnpm --filter @objectstack/metadata exec vitest run --maxWorkers=2` —
Test Files 82 passed (82), Tests 2638 passed
- `src/stack-residual-extension-jobs.test.ts` (spec) — 13 passed at
058d5c2 (9 at f4e83b0);
`src/unclaimed-top-level-residual-extension.test.ts` (metadata) — 3
passed; `src/manifest-service-residual-object-extension.test.ts`
(objectql) — 6 passed
- typecheck: `pnpm --filter @objectstack/spec typecheck` exit 0 (tsc,
`check:scripts-typecheck`, `check:test-typecheck` OK), re-run at
8f58c38 (058d5c2 adds comments only); `@objectstack/metadata` exit
0; `@objectstack/objectql` exit 0 (`check:test-typecheck` OK). The first
objectql run after the unification found TS2345 at step 2b (the shared
definition is typed `unknown` per key); fixed in f4e83b0 by handing
it to the registry as the residual caller does.
- These ran outside the verify lock (declared narrowing): the lock was
held by two sibling dogfood batteries for about 100 minutes; the battery
below ran under it.
</details>

<details><summary>Ablation (each fix reverted after commit, through
scripts/ablation-replace.mjs; every restore proven blob == HEAD, `git
diff HEAD` empty)</summary>

- A, metadata listing removed: the metadata pin turns red (1 failed of
3).
- B, objectql registration call deleted: the objectql pin turns red (3
failed of 4 at that time).
- C, spec `jobs` judged by slot again: the spec jobs pin turns red (1
failed of 9).
- D, spec owner-body pairing removed: the owner-slot pin turns red (1
failed of 9).
- E (seat 7, at f4e83b0), `place: ext.place` replaced by `place:
undefined` in `objectExtensionContribution`: the objectql pin turns red
(1 failed of 6, the placement anti-vacuity); restore proven blob == HEAD
(cbc7b4d), `git diff HEAD` empty.
</details>

<details><summary>Real boot (os serve) after the fix</summary>

Same probe as the measure-first reading, at 5957d21: `GET
/api/v1/meta/object/probe_account` lists `residual_note`; `POST
/api/v1/data/probe_account` with it answers a created record.
</details>

## Acceptance notes

- Measure-first, step 2 (producers): `packages[]` beside a residual
comes from `'preserve'` with an input that has no manifest, and from any
strategy once an input is itself a multi-package artifact (its own
top-level collections are residual); `'first'`/`'last'`/an index over
inputs that carry no `packages[]` compose one flat package with no
residual. `os build` carries the composed top level as is (`1
Extensions`, exit 0). This corrects the first version of this note,
which said `'preserve'` only; the composition door's docblock always
said every strategy.
- objectstack-ai#36236 landed on main with `place` in `registerApp` step 2b's
extension literal. Merging main here, the residual builder would have
registered a residual entry without its placement; the two are now one
call (`objectExtensionContribution`), `place` included, and the parity
pin covers a placed entry.
- The residual extension's dangling-picklist judgement reads the stack's
own bodies, like the residual objects' rule; a field naming a picklist
an already-installed package declares is treated as dangling (not
registered, named at boot): conservative, not silent.
- The `jobs` row's sentence changed at every door (it said the last
entry is kept; the binder schedules none). The objectstack-ai#22934 rows stay one
table, byte-identical across doors.
- `defineStack` on a hand-built `packages[]` stack judges its whole top
level as one package (`stack.KEY[i]`), unchanged here.

## Open items (follow-up cards)

- objectstack-ai#36431: a residual job sharing its name with a package body's job
(other content) composes and the boot schedules neither (contract review
S2, L1). Whether composition should refuse a job name shared across
packages is for the maintainer to rule.
- objectstack-ai#36432: a residual picklist named only by a residual extension is
still refused as unreferenced at validate, build and boot (L1);
`packages/metadata/src/picklist-references.ts` still tells authors a
composed stack's top-level `objectExtensions` entry is not registered,
which after this PR holds only for an entry naming a picklist no body
declares (review N1); `sameAuthoredValue` (metadata) hand-copies the
spec's `deepEqualAuthored` and no test holds them equal (review N5).
- Not carried by either card: `logResidualSameTargetExtensions` also
reports an owner-body pair for a target the residual does not extend, a
second line beside `registerApp`'s (review N2).

## Verification

First files to read (by risk): `packages/spec/src/stack.zod.ts`
(`residualEntryPredicate`, `ownerBodyExtensionEntries`, the `jobs` row),
`packages/objectql/src/plugin.ts`
(`registerUnclaimedTopLevelExtensions`),
`packages/metadata/src/unclaimed-top-level-residual-extension.test.ts`.

Two-minute check: `pnpm --filter @objectstack/objectql exec vitest run
--project local --maxWorkers=2
src/manifest-service-residual-object-extension.test.ts` (after building
the objectql closure) — 6 passed.

Local gates at 058d5c2: 100 derived families (`dispatch-gates
--commands`), reconciled with `--ran` (exit codes recorded): 100 run, 0
NOT MEASURED. Seven first exited on a prerequisite (five spec `dist/`
gates: `dist` predated the last comment commit;
`check:dual-build-cjs-loads`: not every package built; the cli test:
`MODULE_NOT_FOUND`) and were re-run after the full closure build: exit 0
each. `check:type-check-debt` exit 0 (its full re-measure, 0 raw tsc
errors). `check:nul-bytes` exit 0. `overlap-check` clean before each
push.

PR check-runs at 058d5c2: Lint & Repo Gates, TypeScript Type Check,
Test Core, Build Core, Governed Surface Queue Guard, Type Check UI, Test
UI, Build & E2E UI, Live E2E UI, Dogfood Regression Gate and Check
Changeset success; Lint UI skipped (no `ui/` path).

Dogfood battery at 058d5c2: `os-verify-lock: VERDICT command-exit 0`
(closure build exit 0, then `pnpm --filter @objectstack/dogfood test`):
Test Files 484 passed, 3 skipped (487); Tests 4107 passed, 68 skipped
(4175). The same counts at f4e83b0.

Clause-② reading (seat 7): the diff refuses at composition three shapes
that compose today (listed under What changes), under every manifest
strategy once the result carries `packages[]`, so it is a narrowing,
declared `no (narrowing)` as the claim's conditional names. The contract
review at f4e83b0 named the third shape and the reach beyond
`'preserve'`, which the first version of this body left out. No governed
path is in the diff: the seat lands it with `--land` once the dogfood
battery is pinned to the head. Registering the residual extension is the
REGISTER judgement stated under What changes.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- signed: repo:objectstack#7 · zhuangjianguo ·
session_01QsR2jTeURPvEm465RcoYEC -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue protocol:data size/xl tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

扩展包给别人的对象加字段、分组、子表时声明放在哪(排在谁后面);带来的东西自动出现在指定位置

3 participants