Repository navigation
fix(metadata-core,objectql,cloud-connection,cli)!: the package upgrade plan counts the fields a package adds through objectExtensions - #34419
Conversation
…nto their targets Co-Authored-By: Claude <noreply@anthropic.com>
…ts verdict Co-Authored-By: Claude <noreply@anthropic.com>
…sion fields Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
…grade-plan-extensions
📓 Docs Drift CheckThis PR changes 4 package(s): 12 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 4 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 57 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin ae362da6d115afaf684eddf85eaf5fe5ae459277 && git checkout ae362da6d115afaf684eddf85eaf5fe5ae459277
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin a121e29c280aefb60fdbd48f3f765c5dc8902884 9b0824ae367aa8d525b7da230ea86077c70a96ed && git checkout -B drift-repro a121e29c280aefb60fdbd48f3f765c5dc8902884 && git merge --no-ff 9b0824ae367aa8d525b7da230ea86077c70a96ed
node scripts/docs-audit/affected-docs.mjs --json a121e29c280aefb60fdbd48f3f765c5dc8902884
|
|
repo:objectstack#1 · os-project-manager · session_01FEkQ5pNoRjsgMJKr5utN33 Final head · area o1-E · 2026-11-16T16:45Z Head-sha: 7bf9cf5 |
|
review#2 · os-project-manager · session_01FEkQ5mjfxPu5HKjUtuveBR Contract-review-claim: session_01FEkQ5mjfxPu5HKjUtuveBR · head 7bf9cf5 · 2026-11-16T16:47Z |
|
repo:objectstack#1 · os-project-manager · session_01FEkQ5mww9UksbwbjvM4aYn 席位核对 · PR #34419 · L1-b · 2026-11-16T16:49ZHead-sha: L1 · ACCEPT · area o1-E 定稿评论 6922829814 所钉 head。merge-base
落地条款:非受管路径,由区线程落地;须同时具备本 ACCEPT、review#2 的 CONTRACT_REVIEW_TIER PASS(已认领)、钉在本 head 的 battery,以及 narrowing 落地前 |
|
review#2 · os-project-manager · session_01FEkQ5mjfxPu5HKjUtuveBR Contract reviewServed-tier: First record on this PR; no earlier findings to close. Card #34095 read with comments 6899454419, 6918052417, 6918208447, 6918321707, 6922677907, 6922813677; PR comments 6921109056, 6922829814, 6922882363. ① Derived judgments
② Semver level
S1 (should-fix) — the changeset's BREAKING and "Who moves" text names two arms (extension field retyped; extension field dropped beside an added one, both 409). The diff publishes two more that it does not name: ③ Boundary flags
④ Design judgmentThe narrowing makes an existing refusal real rather than taking a capability away: an extension field stores a column like an owned one, and ruling Q3 already asks the confirmation for that column. Tried to break it:
N1 (nit) — ownership transition: an object owned on one side and extension-only on the other is listed in No must-fix. One should-fix (S1), open until a delta read. Implemented-by: VERDICT: PASS |
…xtension destructive_type refusal Co-Authored-By: Claude <noreply@anthropic.com>
|
repo:objectstack#1 · os-project-manager · session_01FEkQ5pNoRjsgMJKr5utN33 Delta head · area o1-E · 2026-11-16T18:24Z Head-sha: 432c9d2 (one commit over 7bf9cf5; changeset and one test file only, no source change) |
|
review#2 · os-project-manager · session_01FEkQ5mjfxPu5HKjUtuveBR Contract-review-claim: session_01FEkQ5mjfxPu5HKjUtuveBR · head 432c9d2 · 2026-11-16T18:25Z |
|
repo:objectstack#1 · os-project-manager · session_01FEkQ5mww9UksbwbjvM4aYn 席位核对 · PR #34419 · L1-b · delta · 2026-11-16T18:27ZHead-sha: 结论:delta ACCEPT。
落地条款不变:须 review#2 对本 head 的 S1 delta 复读 PASS(已认领 6925266614),再执行 |
|
review#2 · os-project-manager · session_01FEkQ5mjfxPu5HKjUtuveBR Contract reviewServed-tier: Delta read of record 6923010837 (PASS at ① Derived judgmentsNo accept-set or public-surface change in the delta: no source file moves. The four arms the changeset now lists are the four the diff publishes, as judged in 6923010837 ① and S1. ② Semver levelLevel, S1 — closed. ③ Boundary flags
④ Design judgmentNo design moves. The new test sits beside the owned No must-fix, no should-fix. Carry-over, all nits, not taken (6925231306), none blocks: Implemented-by: VERDICT: PASS |
…grade-plan-extensions
|
review#2 · os-project-manager · session_01FEkQ5mjfxPu5HKjUtuveBR Contract-review-claim: session_01FEkQ5mjfxPu5HKjUtuveBR · head 9b0824a · 2026-11-16T19:31Z |
|
review#2 · os-project-manager · session_01FEkQ5mjfxPu5HKjUtuveBR Contract reviewServed-tier: Delta read of record 6925311152 (PASS at ① Derived judgmentsNo accept-set or public-surface change: the patch against ② Semver levelChangeset, level, ③ Boundary flags
④ Design judgmentAsked: do the composed-bundle changes on
No must-fix, no should-fix. Carry-over: S1 closed (6925311152). Nits as before, not taken, none blocks: Implemented-by: VERDICT: PASS |
|
repo:objectstack#1 · os-project-manager · session_01FEkQ5pNoRjsgMJKr5utN33 Final head · area o1-E · 2026-11-16T19:42Z Head-sha: 9b0824a = 432c9d2 + a merge of main a121e29 (15 commits; K was 15). Merge-only: |
|
repo:objectstack#1 · os-project-manager · session_01FEkQ5mww9UksbwbjvM4aYn 席位核对 · PR #34419 · L1-b · merge-only delta · 2026-11-16T19:43ZHead-sha: 结论:merge-only ACCEPT。 这次合并没有改变本 PR 的内容。
落地条款:按席位的落地路线执行 |
|
repo:objectstack#1 · os-project-manager · session_01FEkQ5pNoRjsgMJKr5utN33 Land · area o1-E · 2026-11-16T19:43Z
State: ready for review and auto-merge enabled. |
Requested by Leehom · project thread
Fixes #34095
Clause-②: no (narrowing)
Metadata-protocol: none
Skills-docs: none —
git grepofskills/finds no page that teaches the upgrade plan's field lists or the schema upgrade confirmation;skills/objectstack-platform/references/operations.mdnamesos diffin one table row ("Compare two ObjectStack config files and detect breaking changes"), which stays true as written.This PR is the platform half of the card. The cloud half (service-cloud
upgradeSideOf, in the cloud repository) stays with the cloud seat, as the card body says: it can passobjectExtensionsbesideobjectsin the side it builds, and the comparison in@objectstack/metadata-corethen folds them the same way.维护者速读
objectExtensions加到对象上的字段也算进去:新增、删除、改类型都会出现在预览、受影响列的行数和升级确认判定里。--confirm-upgrade确认即可;扩展字段带renamedFrom改成不存列的类型(如 formula)——回 422destructive_type,确认令牌不管用,要保留可存储的类型或手工搬数据。回滚即还原本 PR,没有数据迁移。package-upgrade-verdict.ts的既有裁决(记录 6709061297):删除的字段由 dry run 报告,任何门都不拒。删字段只在已有规则要求确认处才要确认:同对象同时新增字段(疑似改名),或改成无存储列的类型。packages/metadata-core/src/package-upgrade-plan.ts(objectsByName的合并和只读扩展对象的比较)、packages/cli/src/commands/diff.ts(扩展对象的打印)、packages/cloud-connection/src/marketplace-install-rename-planner.ts(安装门的取侧)。pnpm --filter @objectstack/metadata-core exec vitest run src/package-upgrade-plan.test.ts,应看到objectExtensions: an extension field counts like an owned one一组全部通过。What changes
The comparison (
comparePackageVersions,@objectstack/metadata-core):PackageUpgradeSidegains an optionalobjectExtensionslist. Each side's objects are now the objects as the registry serves them from that version: the owner's declaration, with each extension'sfieldsmerged over it by name (a later writer replaces the whole field), in ascendingpriority(200when none is declared), equal priorities in the order the side lists them. This is the registry's own fold (mergeObjectDefinitions, applied byfoldExtendersOntoDefinition), keyed by theextendstring verbatim as the registry keys it. After the fold every existing rule applies to an extension field unchanged. No new verdict category is added.Objects reached only through an extension (another package owns them) are compared by the fields the extensions add, against no fields when the other version does not reach the object at all. They are never listed in
plan.objects.added/removed: the upgrade neither creates nor drops them.The side readers read
objectExtensionswith the same collection reader asobjects:sideOfin@objectstack/objectql(planUpgrade, the dry run's and the hosted door's plan) andpackageUpgradeSideOfin@objectstack/cloud-connection(the install-local door's schema verdict at step 2c′ and the declared-rename planner). The fold itself lives in one place, the comparison.os diffalready passed the whole union stack to the comparison, so it now compares extension fields too. It also prints the field changes of an object it reaches only through an extension, underobjects.NAME.fields.What the door now refuses that it installed before. Four arms, each named in the changeset with its fix:
needs_confirmordestructive:409 SCHEMA_UPGRADE_CONFIRMATION_REQUIRED; fix: confirm with the token (--confirm-upgrade);409, a suspected rename; fix: the token, orrenamedFromwhen it is a rename;409, a suspected rename. The owned and the extension fields of one object are one field map now, so they pair; onmainthey were never compared. Fix: the token, as for any suspected rename;renamedFromand whose new type stores no column:422 VALIDATION_ERROR,details.refusals[].reason: 'destructive_type', at step 2c″ before any write, because the plan's type change now reachesplanInstallDeclaredRenames. No token answers it, so--confirm-upgradeis the wrong fix: keep a stored type for the renamed field, or carry the values by hand.Landing point: the fold went into the comparison (
package-upgrade-plan.ts), not into each side reader, so the three callers that build a side (planUpgrade, install-local,os diff) share one fold and the cloud half needs only to pass the list.Tests
packages/metadata-core/src/package-upgrade-plan.test.ts, new top-level describe: an extension field added is listed infields.added; the rollback lists it infields.removed; an extension-only object is compared and never listed as an object; a retyped extension field is aneeds_confirm/destructivetype change and the verdict lists it; a dropped extension field is listed removed and, alone, is refused by nothing, while dropped beside an added one it is a suspected rename the verdict lists; the higherprioritywrites last; CONTROL: an owned-field plan is byte-identical with empty extension lists and with an unchanged extension of another object.packages/objectql/src/package-upgrade-environment.test.ts, new describe, through the realmanifestservice'splanUpgradeand a HotCRM-shaped two-package artifact: added extension fields listed; the rollback lists them and counts the rows holding a value; a retyped extension field is a type change whose column is read.packages/cloud-connection/src/marketplace-install-local-upgrade-plan.test.ts, new describe, through the install-local door: a retyped extension field answers409with codeSCHEMA_UPGRADE_CONFIRMATION_REQUIREDnaming it and writes nothing; a drop beside an add answers409as a suspected rename; the dry run lists an added extension field, and adding one or dropping one alone installs unrefused. The file's test-onlyfoldmirror readsobjectExtensionstoo.packages/cloud-connection/src/marketplace-install-local-declared-rename.test.ts, one new case beside the owneddestructive_typeone: an extension field renamed withrenamedFrominto aformulaanswers422with codeVALIDATION_ERRORand reasondestructive_type, and nothing is registered, synced, carried or written to the ledger.packages/cli/test/diff-upgrade-plan.test.ts, new describe: an extension field added to an owned object prints under it; an extension-only object prints its type change and is not an added or removed object.Red first, each against
origin/main's source with the fix committed (restore leggit checkout HEAD, proved by the HEAD blob hash and an emptygit status):package-upgrade-plan.tsat base:Tests 6 failed | 18 passed (24); the six are the new non-control cases, the control passes.package-upgrade-environment.tsat base (side withoutobjectExtensions):Tests 3 failed | 16 passed (19).marketplace-install-rename-planner.tsat base:Tests 2 failed | 25 passed (27), the two409cases (the dry run case reads the test's own fold).diff.tsat base:Tests 1 failed | 9 passed (10), the extension-only object.destructive_typeextension case, by a one-off ablation (node scripts/ablation-replace.mjs, theobjectExtensionsread deleted frompackageUpgradeSideOf; anchor 1 → 0, restored to the HEAD blob withgit diff HEADempty):Tests 1 failed | 27 passed (28), the new case only, which then installed200. Restored:Tests 28 passed (28).Acceptance notes
package-upgrade-verdict.ts(ruling record 6709061297) says a removed field is reported by a dry run and refused by nothing, and this dispatch's ruling says extension fields count like owned ones with no new verdict category. So a dropped extension field is listed infields.removedwith its rows counted, and needs confirmation only where an owned drop does: beside an added stored field of the same object (a suspected rename), or as a retype to a type with no stored column (destructive). Both are pinned. Seat route ② (seat decision, not a maintainer ruling) keeps this reading.fieldPatcheschange display properties only and store no column, so they stay out of the comparison.content/docs/deployment/cli.mdxdescribes the schema confirmation in terms of "a stored field", which reads correctly for an extension field; it is not edited here.Verification
Run on head
9b0824ae(origin/mainmerged in), every command throughscripts/pm/os-verify-lock.sh.Narrowing battery (full dogfood)
pnpm --filter '@objectstack/dogfood^...' build && pnpm --filter @objectstack/dogfood test, no shard: exit 0,Test Files 475 passed | 3 skipped (478),Tests 4019 passed | 42 skipped (4061).Package tests and typecheck
vitest run:Test Files 27 passed (27),Tests 1038 passed (1038).vitest run --maxWorkers=2:Test Files 604 passed (604),Tests 13478 passed (13478).vitest run --maxWorkers=2:Test Files 86 passed (86),Tests 1258 passed (1258).vitest run --project unit --maxWorkers=2:Test Files 424 passed (424),Tests 6029 passed (6029).dispatch-gates
432c9d2c(before the main merge, same changed paths): 72 families, 71 exit 0;check:dual-build-cjs-loadsexit 3 (prerequisite: every package'sdist), NOT MEASURED here, CI runs it.--ranreconciliation: 72 derived, 72 run, 0 unrun.Generated by Claude Code