Skip to content

fix(metadata-protocol,cli,cloud-connection)!: refuse an object extension that re-declares an owner's field beyond its display properties (ADR-0146 D10) - #30712

Merged
objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/project-thread-bfig1w
Nov 5, 2026
Merged

objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/project-thread-bfig1w

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Elon · project thread

Fixes #30610

Clause-②: no (narrowing)
Metadata-protocol: narrowed
Skills-docs: no move — skills/** and content/docs/** already teach fieldPatches as the way to change a base field's display, and no page teaches taking an owner field over through fields; the prescription ships in the refusal text.

ADR-0087 disposition (in the changeset): not-required (no-migration-prescription) — a refused shape with no mechanical rewrite (which keys of a re-declared field were meant as display and which as a takeover is a judgement about the field), and no first-party artifact writes the shape (measured below). A stored row that already re-declares an owner field keeps registering with the registry's warning and is judged when next saved or published.

维护者速读

  • 改了什么:模块包在 objectExtensions[].fields 里重新声明属主对象已有的字段(例如把 amount 的类型从数字改成文本、去掉必填、改成只读)时,现在在三道门被拒:元数据保存/发布/恢复(400 VALIDATION_ERROR)、os validate(退出码 1)、市场安装(422 VALIDATION_ERROR)。提示语点名 fieldPatches 和可改的展示属性白名单。
  • 为什么改:ADR-0146 D10 规定基础字段只能改展示属性;但扩展在 fields 里写同名字段会整体替换属主字段,过去只有注册表打一条警告,任何门都不拦。
  • 风险与回滚:属于收窄,但第一方产物(examples、HotCRM)实测 0 处使用这种写法;只改展示属性的重复声明照常放行,注册表警告保留。回滚即回退本 PR。
  • 先看:packages/metadata-protocol/src/protocol-extension-redeclared-owner-field.ts(判定本身,redeclaredFieldChanges 的比较规则是风险点),packages/metadata-protocol/src/protocol-object-extension-item.ts 第 7 步,packages/cloud-connection/src/marketplace-install-local-plugin.ts 的 2e'。
  • 两分钟验证:pnpm --filter @objectstack/metadata-protocol exec vitest run src/protocol-extension-redeclared-owner-field.test.ts,预期 12 个用例全绿(类型变更被拒、只改标签放行)。
  • 需要你做的:无,席位落地(契约档复审由席位执行)。

What changes

ADR-0146 D10, second rule: "Everything else on a base field — type, required, unique, reference, defaultValue, formulas, options membership — is refused on the extension with a prescription naming the whitelist." An objectExtensions[].fields key naming a field the extended object's owner declares replaces that field whole in mergeObjectDefinitions ({ ...base.fields, ...extension.fields }), and before this PR no door refused it; only reportRedeclaredFields warned.

One judge — packages/metadata-protocol/src/protocol-extension-redeclared-owner-field.ts, beside the __c judge (judgeExtensionFieldSuffix):

  • judgeRedeclaredOwnerFields({ packageId, objectExtensions, ownerOf, at }) returns every entry that re-declares an owner field and changes something outside BASE_FIELD_DISPLAY_WHITELIST (read from @objectstack/spec/data, never re-spelled), located, with changed (the keys, sorted) and the sentence.
  • redeclaredFieldChanges(extensionField, ownerField): both bodies are read through FieldSchema first (a default the parse stamps on one side is no change), then compared key by key, skipping the whitelisted keys, name and the ADR-0010 _ envelope. options is compared as membership keyed by stored value, each option without its whitelisted label, so a relabel or reorder is no change.
  • Not judged: an extension of an object its own package owns, an object with no known owner at that door, and a key the owner does not declare (an added field).
  • Envelopes: redeclaredOwnerFieldRefusalError (VALIDATION_ERROR / 400 with issues[], the __c judge's envelope) and redeclaredOwnerFieldInstallMessage (the install door's sentence).

Three doors call it:

  • Publish — objectExtensionItemRefusal step 7 (protocol-object-extension-item.ts), which the save (draft and live), the per-item and package publish, and the restore doors already ask. The owner is the registry's getObjectOwner(target) — its own declaration, never the resolved object, which already carries this package's earlier extension.
  • os validate — packages/cli/src/utils/extension-redeclared-owner-fields.ts walks the artifact (each packages[] entry under its id, or the stack under manifest.id); step 3a-v-bis of validate.ts exits 1 with the rows on errors (code: VALIDATION_ERROR). An owner outside the artifact is judged at install.
  • Install — POST /api/v1/marketplace/install-local step 2e', on the managed and the .custom pair branches, beside the field-patch target check: 422 VALIDATION_ERROR, every refusal in details.refusals, before any write. The owner is a package this artifact delivers, or the installed owner (getObjectOwner).

reportRedeclaredFields (packages/objectql/src/registry.ts) is unchanged and stays a warning.

Measurement (the card's step 1)

At origin/main f4d568ba:

  • No door refuses the shape: judgeExtensionFieldSuffix judges only the suffix; the field-patch target check judges fieldPatches keys; the registry warns.
  • First-party re-declarations of an owner field: 0. examples/app-showcase/src/data/extensions/account.extension.ts (the only extension under examples/**) adds loyalty_tier, linkedin_url, csat_score, none of which showcase_account declares, and extends its own package's object. packages/plugins/plugin-auth/src/manifest.ts extends sys_sso_provider with oidc_client_secret, which packages/platform-objects/src/identity/sys-sso-provider.object.ts does not declare. HotCRM (objectstack-ai/hotcrm 6961ab1): no objectExtensions anywhere.

Tests

All at head 435f30c7.

  • The judge — packages/metadata-protocol/src/protocol-extension-redeclared-owner-field.test.ts, 12 cases: refused on a type change, a dropped required, readonly + defaultValue, an added option value, the array spelling located by index; admitted on a display-only re-declaration (labels, help text, option labels, reordered options), a parse-stamped default (required: false against an owner that omits it), an added field, the package's own object, an unknown owner, the _ envelope; the save doors' envelope VALIDATION_ERROR / 400 with every entry in issues.
  • Publish door — a new top-level describe in packages/runtime/src/domains/meta-object-extension-item.test.ts (the real-store rig: better-sqlite3 behind ObjectQL, the real protocol and registry), with a writable module package that depends on the base: a type change is refused at the save door (VALIDATION_ERROR / 400 at fields.name, no row, no extender); a draft stored before the rule is refused at publish and stays a draft; a display-only re-declaration saves and publishes.
  • os validate — packages/cli/test/validate-extension-redeclared-owner-field.test.ts (integration tier, spawns the CLI): an assembled artifact whose second package re-declares the first's amount as text exits 1 with packages[1].manifest.objectExtensions[0].fields.amount, code: VALIDATION_ERROR, changed: ['type']; a label-only re-declaration validates clean.
  • Install door — a new top-level describe in packages/cloud-connection/src/marketplace-install-local-field-patch-targets.test.ts (the 2e harness, a real SchemaRegistry): a type change of the installed owner's field is refused 422 VALIDATION_ERROR with the refusal in details.refusals and nothing registered, synced or written; an added option value on an owner the same artifact delivers is refused at packages[1]…; a display-only re-declaration installs.
  • validate-build-gate-parity.test.ts: the new gate is classified in VALIDATE_ONLY_GATES.
Ablation (one-time, not kept)

Committed first, then node scripts/ablation-replace.mjs on protocol-extension-redeclared-owner-field.ts: anchor if (changed.length === 0) continue; (x1) replaced by if (changed.length >= 0) continue; (the judge refuses nothing); pnpm --filter @objectstack/metadata-protocol build; ablation-dist-preflight.mjs saw the marker in dist/.

  • judge: 6 failed / 6 passed (every refusal case red)
  • runtime rig: 2 failed / 20 passed (the save and publish refusals)
  • install door: 2 failed / 9 passed (both refusals)
  • os validate: 1 failed / 1 passed (the refusal)

Restored from HEAD (blob e7ae83e11485 equals the HEAD blob, git diff HEAD empty), rebuilt, ablation-dist-preflight.mjs --absent passed over 24 built files; the runtime, install and os validate files green again.

Acceptance notes

  • os build does not run the check yet (VALIDATE_ONLY_GATES row in validate-build-gate-parity.test.ts), the same build-side gap the field-patch target check carries; the install door refuses what the build emits.
  • os validate judges only an owner declared by another package of the same artifact. A single-package module stack that extends an installed base is judged at install.
  • At the install door the installed owner's declaration carries the platform columns the registry injects, so re-declaring one of those (e.g. owner_id) is judged there and not at os validate.
  • In a .custom pair, an unsuffixed fields key is refused first by the __c judge, whose prescription already names fieldPatches.

Verification

Affected packages (head 435f30c)
  • pnpm --filter @objectstack/metadata-protocol test: Test Files 318 passed, 4 skipped; Tests 22466 passed, 26 skipped — exit 0
  • pnpm --filter @objectstack/cloud-connection test: Test Files 70 passed; Tests 893 passed — exit 0
  • pnpm --filter @objectstack/cli exec vitest run --project unit: Test Files 389 passed; Tests 5431 passed — exit 0
  • pnpm --filter @objectstack/cli exec vitest run --project integration test/validate-extension-redeclared-owner-field.test.ts: 2 passed — exit 0 (the rest of the integration layer is declared to CI)
  • pnpm --filter @objectstack/runtime exec vitest run src/domains/meta-object-extension-item.test.ts: 22 passed — exit 0
  • typecheck: metadata-protocol, cli, cloud-connection, runtime — each exit 0
Derived gates + lint (head 435f30c)
  • node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack: 64 families. All 64 ran with exit 0; --ran reconciliation: "64 derived famil(ies) accounted for — 64 run, 0 NOT-MEASURED".
  • First pass: check-plugin-teardown-shape --self-test, check:dual-build-cjs-loads and check:i18n-coverage exited 3 (prerequisites). Re-run after fetching the pinned commit and a whole-tree turbo run build (exit 0): all three exit 0.
  • Three families that ran while the ablation held its mutation (check:registry-log-declared, check:rest-log-spy-declared, check:route-envelope) were re-run on the restored tree: exit 0.
  • node scripts/check-commit-card-trailers.mjs --range origin/main..HEAD: exit 0.
  • pnpm lint: exit 0.
Dogfood battery (the `(narrowing)` arm)

Head 435f30c7, after the whole-tree build, under the lock: pnpm --filter @objectstack/dogfood test — VERDICT command-exit 0, Test Files 421 passed, 3 skipped (424); Tests 3513 passed, 36 skipped (3549); no failures.

origin/main moved 10 commits since the branch point (f4d568ba); none touches a file this PR changes, and git merge-tree merges clean.


Generated by Claude Code

…t re-declares an owner field beyond its display properties

ADR-0146 D10: a base field changes only within the display-property
whitelist. An objectExtensions[].fields entry naming a field the extended
object's owner declares replaces that field whole in the registry fold, so
it is now refused at the object_extension save/publish/restore doors, at
os validate (owner in the same artifact) and at the marketplace install door
when it changes anything outside BASE_FIELD_DISPLAY_WHITELIST. One judge,
judgeRedeclaredOwnerFields; the prescription names fieldPatches and the
whitelist. The registry warning stays.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016WV4cx4CnMVtuDswCA9p2c
…efusal at each door; add its changeset

The object_extension save and publish doors (real store and registry), os
validate on an assembled artifact, and the install-local door each refuse a
type change of an owner field with VALIDATION_ERROR and admit a display-only
re-declaration.

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

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 3 package(s): @objectstack/cli, @objectstack/cloud-connection, @objectstack/metadata-protocol, touching 30 documentable anchor(s). ⚠️ 1 changed file(s) yielded no anchor (packages/metadata-protocol/src/index.ts), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

37 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 badf24dffc27773f566987e810e36896bbd34c2b.

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

What this run could not see
  • 1 changed file(s) yielded no anchor (packages/metadata-protocol/src/index.ts) — pages documenting those are invisible to this run
  • 1 cross-cutting symbol(s) contributed no route anchor: packageId (4 routes)
  • 1 anchor(s) matched too much of the corpus to be a work list: os validate (command, 87 pages)
  • 5 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 63 of 221 client-bound route-ledger rows — the other 158 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 158: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 55 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 103 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 — 45 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 badf24dffc27773f566987e810e36896bbd34c2b → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 29087b212d64a1c407b916fdd174e0d59f50a9be — the merge of head 435f30c7f5e18059de44fb0d3579aed79aff88f5 into base badf24dffc27773f566987e810e36896bbd34c2b, 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 29087b212d64a1c407b916fdd174e0d59f50a9be && git checkout 29087b212d64a1c407b916fdd174e0d59f50a9be
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin badf24dffc27773f566987e810e36896bbd34c2b 435f30c7f5e18059de44fb0d3579aed79aff88f5 && git checkout -B drift-repro badf24dffc27773f566987e810e36896bbd34c2b && git merge --no-ff 435f30c7f5e18059de44fb0d3579aed79aff88f5

node scripts/docs-audit/affected-docs.mjs --json badf24dffc27773f566987e810e36896bbd34c2b

⚠️ 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 badf24dffc27773f566987e810e36896bbd34c2b → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#1 · os-elon-musk · session_016WV4cytLmJxfAmgPVjUbbW

Contract-review-claim: session_016WV4cytLmJxfAmgPVjUbbW · head 674555f · 2026-11-05T23:03Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#1 · os-elon-musk · session_016WV4cytLmJxfAmgPVjUbbW

Contract-review-claim: session_016WV4cytLmJxfAmgPVjUbbW · head 435f30c · 2026-11-05T23:06Z

(Supersedes the claim on 674555f, comment 6671822373: the head moved by one test-only commit while that claim was held.)

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#1 · os-elon-musk · session_016WV4cytLmJxfAmgPVjUbbW

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 435f30c7f5e18059de44fb0d3579aed79aff88f5
Local-runs: none
Scope: packages/metadata-protocol/src/protocol-extension-redeclared-owner-field.ts, packages/metadata-protocol/src/protocol-extension-redeclared-owner-field.test.ts, packages/metadata-protocol/src/protocol-object-extension-item.ts, packages/metadata-protocol/src/index.ts, packages/cli/src/commands/validate.ts, packages/cli/src/utils/extension-redeclared-owner-fields.ts, packages/cli/test/validate-extension-redeclared-owner-field.test.ts, packages/cli/test/validate-build-gate-parity.test.ts, packages/cloud-connection/src/marketplace-install-local-plugin.ts, packages/cloud-connection/src/marketplace-install-local-field-patch-targets.test.ts, packages/runtime/src/domains/meta-object-extension-item.test.ts + packages/spec/src/data/field-customization.ts (BASE_FIELD_DISPLAY_WHITELIST), packages/spec/src/data/field.zod.ts (FieldSchema, a strict object with stamped defaults), packages/objectql/src/registry.ts (mergeObjectDefinitions, getObjectOwner, reportRedeclaredFields), packages/metadata-protocol/src/protocol-extension-field-suffix.ts (the __c judge and its wiring precedent), packages/cli/src/utils/field-patch-targets.ts and artifact-packages.ts (the validate walk), packages/metadata-protocol/src/protocol-save.ts, protocol-history-and-publish.ts and protocol-authoring-gate.ts (the three callers of objectExtensionItemRefusal), docs/adr/0146 D10, examples/app-showcase/src/data/extensions/account.extension.ts, packages/plugins/plugin-auth/src/manifest.ts, packages/platform-objects/src/identity/sys-sso-provider.object.ts (the measurement). Reviewed at 435f30c7; the delta from the claimed 674555fc is one test-only line (a raw sys_metadata seed drops organization_id: null), read.

① Derived judgments

  1. The refused shape is D10's, and only D10's — right. judgeRedeclaredOwnerFields refuses an objectExtensions[].fields key only when (a) the extended object has a known owner, (b) that owner is a different package from the extension's, (c) the owner's own declaration (ownerFieldOf(owner.definition, name)) carries the key, and (d) redeclaredFieldChanges is non-empty. Each of (a)–(c) defaults to "not judged", so an added field, an extension of the package's own object and an unknown owner are untouched; nothing else in the accept set moves.
  2. The whitelist is the ADR's constant, not a guessed list — right. FIELD_DISPLAY_KEYS / OPTION_DISPLAY_KEYS are built from BASE_FIELD_DISPLAY_WHITELIST.field / .option imported from @objectstack/spec/data (label, description, inlineHelpText, placeholder; option label), and the prescription text is derived from the same constant. packages/spec/** is not touched.
  3. "Changes anything outside the whitelist" is read against the merge's real semantics — right. mergeObjectDefinitions spreads { ...base.fields, ...extension.fields }, so a re-declaration replaces the owner's field whole; the judge therefore counts an omitted structural key (dropped required) as a change, compares options as membership keyed by stored value with option label removed (relabel/reorder = no change; added value = options), ignores name and the ADR-0010 _ envelope, and reads both sides through FieldSchema first so a parse-stamped default (required: false, hidden: false, sortable: true, type-aware unique) is stamped on both sides. The dev's "display-only re-declaration is admitted" is therefore exactly "the served field is the owner's field with display keys changed".
  4. Three doors, one judge — right. Publish/save/restore: step 7 of objectExtensionItemRefusal, whose three callers on main are protocol-save.ts :1204 (draft and live save), protocol-history-and-publish.ts :736 (per-item and package publish) and protocol-authoring-gate.ts :121 (restore); owner = registry.getObjectOwner(target) (the own contributor's declaration, never the resolved object, which already carries this package's earlier extension). os validate: step 3a-v-bis, walk mirrors findFieldPatchTargetRefusals (same artifactPackages + declaredObjects shape; packages[] under its own id, or the stack under manifest.id). Install: install-local step 2e' on both the managed branch and the .custom pair branch, before any write, with the same UNRUNNABLE_REFUSAL_CODE/STATUS (VALIDATION_ERROR/422) and details.refusals envelope step 2e uses; owner = delivered body first, then registry.getObjectOwner. Same judge, same message, same changed list at all three. An extension of an object outside the artifact is not judged at os validate (no owner known there) and is judged at install — declared in the PR and consistent with the field-patch precedent.
  5. A registry without getObjectOwner leaves step 7 unasked (registry?.getObjectOwner?.(target)), the fail-open direction every other target check in that gate takes; the real SchemaRegistry has it (registry.ts :6623). Right.
  6. reportRedeclaredFields is unchanged — packages/objectql/src/registry.ts is not in the diff. Right.
  7. Nothing unrelated narrows. validate.ts adds one step that exits 1 only on a non-empty refusal list; validate-build-gate-parity.test.ts classifies the new gate under VALIDATE_ONLY_GATES (so os build is explicitly unchanged); index.ts adds exports only. No door loses an accepted body other than the D10 shape.
  8. Claim "zero first-party re-declarations" — holds, re-measured on origin/main. examples/** has one extension (account.extension.ts: loyalty_tier, linkedin_url, csat_score), none declared by account.object.ts (showcase_account), and it extends its own package's object; plugin-auth extends sys_sso_provider with oidc_client_secret, which sys-sso-provider.object.ts does not declare; HotCRM at 6961ab1 contains no objectExtensions. The narrowing reaches no first-party artifact.

② Semver level

minor for @objectstack/metadata-protocol, @objectstack/cli, @objectstack/cloud-connection — the three packages whose doors narrow; runtime carries only a test. A breaking accept-set narrowing ships as minor under the pre-GA rule check-changeset-no-major.mjs states, marked ! / BREAKING in the changeset. Clause-②: no (narrowing) and Metadata-protocol: narrowed are on the PR body and the changeset, first-of-line, matching the seat's amended claim (6670473941). The ADR-0087 marker not-required (no-migration-prescription) matches the measurement in ①.8 (no first-party user; no mechanical rewrite exists because which keys were meant as display is a judgement). Check Changeset: success on this head. Consistent.

③ Boundary flags

  • Dev deviation 1 (no → no (narrowing)): the seat's amendment 6670473941 records it; the dogfood battery ran on 435f30c7, as the arm requires. Answered.
  • Dev deviation 2 (ADR-0087 not-required): consistent with ①.8; a registered entry would need packages/spec, which the claim forbids. Answered.
  • Dev deviation 3 (tests in packages/runtime and packages/cloud-connection): added to the file surface by amendment 6670473941. Answered.
  • Dev deviation 4 (no assignee / reviewer request): the seat's standing lines; not a contract matter.
  • open_questions: none. out_of_scope_findings: os build does not run the check (VALIDATE_ONLY_GATES row) — the same gap the field-patch target row carries; the install door refuses what the build emits. Not a must-fix for this card (the card named os validate, publish and install); carrier none is acceptable, a follow-up card may close both rows together.
  • PR author is objectstack-fleet[bot]; no extra author note owed.
  • Check-runs on 435f30c7 at review time: Check Changeset, Governed Surface Queue Guard, Dogfood Regression Gate, PR-body guards, PR Size, Lint · PM dispatch-gates, Lint · tooling self-tests: success; Build Core, Test Core shards, Type Check ×4, Lint ×6, Live E2E UI: in_progress. This record does not stand in for them: landing pre-check ② (all green) stays the seat's.
  • Added by this review: none that blocks (see ④ should-fix notes).

④ Design judgment

  • protocol-extension-redeclared-owner-field.ts against mergeObjectDefinitions, FieldSchema and D10: holds. The judge's definition of "change" is the one the fold makes real (whole replace), the whitelist is read not spelled, and the acceptance scenario (a module turning amount: number into text, dropping required, adding readonly/defaultValue/formula, adding an option value) is refused with fieldPatches and the whitelist named; a label/help/placeholder/option-label-only re-declaration is admitted. Tried to break it: (i) key present on the owner, absent on the extension → counted (correct, the fold would drop it); (ii) options reorder/relabel → no change, added/removed value or changed option visibleWhen/color → options (correct: membership and non-display option keys stay the vendor's); (iii) the array spelling of fields → located by index; (iv) owner declaration carrying _packageId/_provenance → stripped before parse. Pins: 12 unit cases, including each refusal and each admission; the dev's ablation (the changed.length === 0 guard flipped to always continue) turned 6/6 refusal cases red and left admissions green, which is the right shape for a refusing judge.
  • protocol-object-extension-item.ts step 7: holds. Order after the __c judge is right (a .custom pair's unsuffixed key gets the __c sentence first, which also names fieldPatches). The runtime rig pins the real registry: a type change is refused at save with VALIDATION_ERROR/400 at fields.name and no row, a pre-rule draft is refused at publish and stays a draft, a display-only re-declaration saves and publishes. Pins assert code + status + location + absence of a row/extender.
  • validate.ts + utils/extension-redeclared-owner-fields.ts: holds. The walk is the field-patch walk's shape, the verdict is the shared judge, and --json carries path/code/changed. The integration test spawns the CLI on an assembled two-package artifact and asserts exit 1 + the located row + changed: ['type'], and exit 0 on relabel.
  • marketplace-install-local-plugin.ts 2e': holds on both branches; refuses before any write (test asserts no registration, no sync, empty dir). Owner resolution (delivered first, then installed) matches the field-patch target precedent and D10's "owner's own declaration" reading. The multi-package case pins options membership against an owner the same artifact delivers.
  • validate-build-gate-parity.test.ts: the row is a truthful classification, not a widening.

Should-fix (non-blocking, none is a FAIL):

  1. A display-only re-declaration through fields is admitted, but it still replaces the owner's field whole, so it bypasses the ADR-0029 D9.2a tenantPatched yield that fieldPatches honours, and still draws the registry warning. That is the card's scope ("when the entry changes anything outside the whitelist"), not a defect of this PR; a follow-up may decide whether D10's prescription should be "always fieldPatches" for an owner field.
  2. Step 7 runs before the item's strict parse. An extension field carrying a key FieldSchema refuses fails safeParse on one side only, so its changed list may name stamped defaults (required, hidden, sortable...) before the schema's own sentence. The accept set is the same (the body is refused either way); only which sentence the author reads first differs. Skipping the judge when either side fails to parse would hand the schema gate the first word.
  3. D10's text names protocol-package-install.ts#installPackage as the install door; on main neither the __c judge nor this one is wired there — install-local is the door in practice (the metadata-protocol + cli + install-local: __c extension fields only in a .custom package — refused at save/publish/restore, os validate, both install doors and duplicate #28564 precedent), and a code package registered at boot (registerApp) stays with the warning, as the card scoped. Worth a one-line ADR errata when D10 is next opened.

Implemented-by: claude/project-thread-bfig1w
Reviewed-by: session_016WV4cytLmJxfAmgPVjUbbW

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#1 · os-elon-musk · session_016WV4cytLmJxfAmgPVjUbbW

席位核对 · ACCEPT · 2026-11-05T23:34Z · #30610

Head-sha: 435f30c

  • Shape: 12 files, +856/−3, across packages/metadata-protocol (the judge, its wiring into objectExtensionItemRefusal, one export, tests), packages/cli (os validate), packages/cloud-connection (install-local), packages/runtime (one door test), one changeset. That matches the claimed surface (claim 6670139047, amendments 6670237566 and 6670473941). Not governed.
  • Contract review: PASS at CONTRACT_REVIEW_TIER, record 6671933596 (claim 6671883625, superseding 6671822373 on the earlier head), no must-fix, reviewed at this head.
  • Premise, measured: an objectExtensions[].fields key that names a field the extended object's owner declares replaces that field whole ({ ...base.fields, ...extension.fields }), so a different package could take over an owner field with only a registry warning. D10's refused shape: owner from getObjectOwner, a different package, a change outside BASE_FIELD_DISPLAY_WHITELIST (imported from @objectstack/spec/data, not re-spelled).
  • Spot check (from the diff and the review):
    • One judge, one message and one changed list at every door: save, publish and restore (step 7 of objectExtensionItemRefusal), os validate, and install-local on both the managed and the .custom pair branches; 422 before any write.
    • Display-only re-declaration, an added field, the extender's own object and an unknown owner are admitted (pinned).
    • Zero first-party re-declarations, re-measured by the reviewer on origin/main (app-showcase, plugin-auth, HotCRM 6961ab1).
    • The dev's ablation turned every refusal case red while admissions stayed green.
  • Gates: every check-run on this head has concluded: 35 success, 13 skipped, 0 failure.
  • Accepted deviations: the os build gap (VALIDATE_ONLY_GATES row) is acknowledged with no carrier. The review's three should-fix notes are accepted as non-blocking: (1) a display-only re-declaration through fields still bypasses the D9.2a tenantPatched yield that fieldPatches honours, which is card-scoped and left for a follow-up decision; (2) changed may list stamped defaults ahead of the schema's own sentence for a key FieldSchema refuses (message order only); (3) D10 names installPackage as the install door, while install-local is the door in practice, a one-line ADR erratum for when D10 is next opened.
  • Contract: Clause-②: no (narrowing), Metadata-protocol: narrowed, ADR-0087 not-required (no-migration-prescription), Skills-docs: no move, confirmed from the diff and the review.
  • Landing: ready, then auto-merge, through the relay.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 5, 2026 23:35
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge November 5, 2026 23:35
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 5, 2026
Merged via the queue into main with commit a91ad42 Nov 5, 2026
49 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-bfig1w branch November 5, 2026 23:58
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 size/l tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

1 participant