Skip to content

fix(lint, metadata-protocol)!: the object_extension publish door folds the written entry among other packages' extensions by priority, as os build does - #33702

Merged
objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/project-thread-jn4a36
Nov 15, 2026
Merged

objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/project-thread-jn4a36

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Leehom · project thread

Fixes #33494

Clause-②: no (narrowing) — at the runtime object_extension publish door (Studio, PUT /api/v1/meta/object_extension/TARGET, the MCP and AI authoring doors) the expression rule now reads each field of the target as os build serves it when another package's published extension adds the same field. One shape it accepted is now refused (shape 3: a higher-priority package's formula for a field the written entry also adds closes a cycle through another field of the entry), and two it refused now publish (shape 1, a tie at the priority that decides the field; shape 2, the written entry outranked there). os build, os validate and os lint are unchanged. The new gate input (storedObjectExtensions on runRuntimeAuthoringRules and evaluateRuntimeAuthoringGate, the StoredObjectExtension type from @objectstack/lint/runtime) is optional and additive. Measured first-party exposure: no two first-party packages extend the same object (examples/app-showcase one entry on showcase_account; packages/plugins/plugin-auth one on sys_sso_provider; HotCRM origin/main 2492ac6 one module, o2c, extending crm_contract and crm_account), so no first-party write changes verdict.
Metadata-protocol: narrowed
Skills-docs: none owed — this PR edits content/docs/deployment/validating-metadata.mdx (the object extension paragraph states the door's fold); the skills teach defineObjectExtension({ extend, fields, priority }) and formula fields and say nothing of how the door read a field two packages add.

维护者速读

  • 改了什么:运行时 object_extension 发布口在判断扩展字段(如公式循环)时,现在把其他软件包已发布的同目标扩展连同其优先级一起折叠,用的是 os build 的同一个折叠函数,所以发布口看到的字段定义与 build 一致:同优先级冲突的字段两边都不判,被更高优先级覆盖的字段按覆盖者的定义判。
  • 为什么改:此前发布口拿到的目标对象里,其他包加的字段是没有优先级的普通字段,写入条目总是盖在上面。结果有两种情况发布口拒绝而 build 放行(同优先级、被更高优先级覆盖),一种情况发布口放行而 build 拒绝(更高优先级的兄弟公式经由本条目的另一个字段构成循环)。
  • 风险与回滚:发布口一处收窄、两处放宽,build 不变。需要两个软件包扩展同一对象的同名字段并带公式循环才会触发;第一方实测没有两个包扩展同一对象。新输入是可选的,宿主不提供时行为与之前相同。回滚即 revert。
  • 先看:packages/lint/src/validate-expressions.ts(扩展遍历:stored 条目只折叠不判定、回填跳过 stored 名称)、packages/lint/src/object-graph.ts(objectExtensionsByTarget / objectsAsServed 的 stored 参数)、packages/metadata-protocol/src/protocol-authoring-gate.ts(otherPackagesExtensionsOf)。
  • 两分钟验证:pnpm --filter @objectstack/lint exec vitest run src/runtime-gate.object-formula-cycle.test.ts,预期 20 条全过,其中 #33494 一组 5 条:同优先级与被覆盖两种情形发布口与 build 都放行,更高优先级兄弟公式构成的循环在发布口按本条目的字段拒绝。
  • 需要你做的:无,席位落地。

What changes

packages/lint/src/object-graph.ts. objectExtensionsByTarget(stack, stored = []) and objectsAsServed(stack, stored = []) take an optional list of StoredObjectExtension (an extension the host's registry already holds for another package: extend, priority, fields, packageId). Each is collected by the fold's own collect, one carrier per entry below 0 (registered before the stack's own entries), marked stored: true on its VisibleObjectExtension. They sort and fold exactly as any entry: ascending priority, a later writer replacing the whole field, a name whose deciding writers share a priority put in tied. The build never passes the list, so every build verdict is what it was.

packages/lint/src/validate-expressions.ts. StackExpressionOptions.storedObjectExtensions, read on an object_extension write only (storedExtensions). It reaches the top-of-pass fold (objectsAsServed(stack, storedExtensions), so the field, type and nullable indexes see the build's winner and leave a tie out) and the extension walk (objectExtensionsByTarget(stack, storedExtensions)). In the walk a stored entry is folded in and never judged or located; the fill-back from base (the target as served before the write, which carries the stored entries' fields as plain fields) skips the names they add, so a tied name is not served again as one sibling's definition. The call-site comment is rewritten to this reading. Neither edit touches the gate-setup region PR #33434 edits (its hunks at ~:2374-2380 and after ~:2396; this PR changes the one fold call between them, as the seat's surface amendment allows).

packages/lint/src/formula-cycle-issues.ts. extensionFormulaLoci reads stored: a stored entry locates nothing, and a name it adds later in fold order than the written entry removes the written entry's locus (the sibling's definition is the one served). So a cycle a higher sibling closes through another field of the written entry is named on that field alone, and the sibling's member is never charged to the write.

packages/lint/src/runtime-gate.ts, authoring-rules.ts, runtime.ts. runRuntimeAuthoringRules({ storedObjectExtensions }) (optional) hands the list to AuthoringRuleContext.storedObjectExtensions on an object_extension write only, the same value in every pass; the expression rule passes it to runStackExpressionPasses. @objectstack/lint/runtime exports the StoredObjectExtension type.

packages/metadata-protocol/src/protocol-authoring-gate.ts, runtime-authoring-gate.ts. New otherPackagesExtensionsOf(registry, target, writtenPackage): each extend contributor of the target (getObjectContributors) of a package other than the written one, with its priority and fields, in the registry's order; a disabled package's left out (isPackageDisabled, as every served fold withholds it); [] for a registry that cannot answer. judgeRuntimeAuthoringRules states it on an object_extension write (the target and package objectExtensionWriteFold already names) and evaluateRuntimeAuthoringGate passes it through (optional storedObjectExtensions). No packages/spec schema moves: the registry already held each sibling's package and priority.

packages/spec/src/migrations/entries/semantic/18.object-extension-formula-cycle-refused.ts (PR #33442's entry, not yet released): reason and acceptanceCriteria now state the door's fold, "at the priority that decides it" in place of "at the same priority", and the tie exception for both the build and the door on a declared object.

content/docs/deployment/validating-metadata.mdx: the object extension paragraph's last sentence states the door's fold and "at the priority that decides it".

.changeset/33494-extension-door-priority-fold.md: @objectstack/lint, @objectstack/metadata-protocol and @objectstack/spec minor, both declaration lines, the Skills-docs: line, a BREAKING banner (Before / Now / Unchanged / Fix) and adr-0087: not-required (already-registered object-extension-formula-cycle-refused) (this PR updates that unreleased entry rather than registering a new one). Its Now paragraph corrects, by quotation, the pending .changeset/33153-extension-formula-cycle.md Now clause and Unchanged sentence the carry note 6886038545 names, and "at the same priority" there. That changeset is not edited (it is another PR's).

Why

Card #33494 (from PR #33442's contract review, record 6885259034 finding 1 and its observation): the door's snapshot (#33072) carried every other package's extension field on the target as a plain field with no priority, so the gate folded the written entry over all of them. os build folds every package's entry by priority and serves the winner. The door refused a tie and an outranked entry the build accepts, and accepted a higher sibling's cycle through another field of the entry that the build refuses.

Tests

  1. packages/lint/src/runtime-gate.object-formula-cycle.test.ts: the A formula field an object extension adds that reads itself, or two that read each other, is refused at neither the publish door nor os build #33153 pin "the door judges the written entry's own definition whatever a sibling's priority" is replaced by a #33494 describe (5 cases) at the real gate (runRuntimeAuthoringRules, type: 'object_extension', with storedObjectExtensions) and the build (runAuthoringRules('build', …) over both packages):
    • ⭐ shapes 1 and 2: a tie (200/200) and an outranked entry (sibling 300, written 200), the written s__c reading itself: no cycle finding at the door, none in the build.
    • ⭐ LIT shape 3: the sibling (300) serves s__c = record.a__c + 1, the written entry (200) adds s__c (number) and a__c = record.s__c * 2: refused at the door on a__c only, in the engine's sentence (formulaCycleMessage('a__c', ['a__c', 's__c'])); the build names the sibling's s__c at the sibling's entry and a__c at the written entry.
    • the entry that outranks the sibling (300 over 200) is still refused at the door at the entry, and by the build at the same entry.
    • a tied name the sibling stored as a self-reading formula is not served back from the target and not charged to the write (door and build both clean).
    • a host that states no extensions leaves the door as it was (the written entry folded over the served target).
  2. packages/runtime/src/domains/meta-object-extension-item.test.ts, new describe [#33494] (4 cases) through the real saveMetaItem + publishMetaItem, with a third package registered as an extender of the account (registerObjectExtension, priority 200 or 300): ⭐ the tie and the outranked self-reading formula publish (the row goes active), as os build accepts each; ⭐ shape 3 gets 422 INVALID_METADATA with expression-invalid at object 'crm_account' · objectExtensions[0] · field 'a__c' expression and the row stays a draft; CONTROL: an entry outranking the sibling with a self-reading formula is still refused.
  3. packages/metadata-protocol/src/protocol-authoring-gate.extension-write-fold.test.ts, new describe [#33494] (2 cases): otherPackagesExtensionsOf lists every other package's extend contributor in the registry's order with its priority and fields, leaving out the owner, the written package and a disabled package; a registry with no contributors member, or one that throws, states none.
  4. Meta-tests (validate-expressions.test.ts, validate-security-posture.test.ts, validate-expressions / validate-security-posture 也有同形的 spec 不声明键的 ?? 别名读法(#5009 建议 3 的核对结果) #5017 receiver scans): storedNames (a Set of names) and stored (the fold's list parameter) tabled as plumbing receivers, each with its reason.

Red at base: the head's lint test file over the base lint sources (git restore --source=41b64bb0 of the six lint source files): 2 of 20 red, the shapes 1/2 case and the shape 3 LIT; restored with git checkout HEAD --, git diff HEAD empty.

Ablations (one-shot through node scripts/ablation-replace.mjs on committed head e681d49f; each restore verdict "blob == HEAD and git diff HEAD is empty"; lint tests read src/):

  • A1, the fill-back skip (&& !storedNames.has(n) dropped): 1 of 20 red, the tied-name case.
  • A2, stored entries locating (if (entry.stored) loci.delete(name) made unreachable behind a globalThis marker): 1 of 20 red, the shape 3 LIT (the sibling's s__c charged to the write). A first attempt was a no-op (its replacement kept the anchor text; the tool refused and restored), so it was rerun with the marker.
  • A3, the top fold without the stored list (objectsAsServed(stack)): 2 of 20 red, shapes 1/2 and shape 3.
  • R1, the host carry, for the runtime pins that read metadata-protocol through dist/: the registry handed as globalThis.__ablationR1 (undefined) in judgeRuntimeAuthoringRules, pnpm --filter @objectstack/metadata-protocol run build, ablation-dist-preflight found the marker in dist/, runtime -t 33494: 3 red (both publish LITs and the shape 3 LIT), the CONTROL green. Restore leg: rebuilt, --absent found no marker, 4/4 green. (A first R1 attempt was also a no-op for the same reason and is not counted.)

Acceptance notes

  • Where the snapshot is built (measured): packages/metadata-protocol/src/protocol-authoring-gate.ts (judgeRuntimeAuthoringRules), not packages/runtime/src/domains/; the seat amended the claim's surface (6888588670).
  • No second fold. The door's fold is objectsAsServed / objectExtensionsByTarget with the host's entries added to their input; the tie set and the ordering are the build's.
  • A tied name the target's owner also declares: in the build the tied name is filled back from the authored object (the object walk's); at the door the target's base layer is not carried (only the served target), so the walk leaves every name a stored entry adds to the fold, and such a name is absent there. It needs an owner field re-declared by two packages at the priority that decides it, plus a formula cycle through it; the verdict charged to the write can only differ by a member under that name. Noted, not filed.
  • A disabled package's extension is left out (isPackageDisabled), as the served fold leaves it out; an enable door's asEnabled reading is not this write's.
  • The legacy NS__NAME filing (extensionTargetKey, objectql: a manifest objectExtensions entry or hydrated row whose extend folds to a legacy key opens a second, owner-less object entry #28858) is not mirrored: the host reads the contributors under the target the body names, as the gate folds it.
  • Other as-served checks on this door read the same fold now (the field-formula and validation-rule passes' field, type and nullable indexes), so a type or null-guard verdict on a field another package outranks is the build's too.
  • Not changed, by the order's fence: packages/spec schemas; the door roster and its pins; PR fix(lint): the flow and hook publish doors stop requiring a null guard on the current row's created_at and updated_at in an ordering comparison #33434's hunks.

Verification

Head 763105ec: the fix e681d49f, the meta-test tabling 78ad84f3, the ADR-0087 marker dd37779e, and a merge of origin/main e9884e19 (base 41b64bb0). PR #33434 landed before the merge; it merged clean, and both its stamped-column index and this PR's objectsAsServed(stack, storedExtensions) are on the merged line.

Package tests

Run on head 763105ec (the merge of origin/main e9884e19, which brought PR #33434) after a whole-repo pnpm -r run build (VERDICT command-exit 0):

  • @objectstack/lint pnpm test: 210/210 files, 8998/8998 tests; pnpm --filter @objectstack/lint typecheck (tsc + test typecheck) exit 0.
  • @objectstack/metadata-protocol pnpm test: 340 files passed and 9 skipped, 22883 tests passed and 43 skipped; typecheck exit 0.
  • @objectstack/runtime src/domains/meta-object-extension-item.test.ts: 50/50; pnpm --filter @objectstack/runtime typecheck exit 0.
  • @objectstack/spec src/migrations: 198/198 (round 0, on e681d49f; the entry's text has not moved since).
Gates (dispatch-gates --commands)

The derivation at 763105ec is 114 lines. Every line ran after the whole-repo build of 763105ec, its exit code captured before any pipe, and all 114 exited 0. dispatch-gates --ran: 114 derived, 114 run, 0 NOT-MEASURED, 0 UNRUN. The record is pm-orders/spec/33494-gates-ran.txt in the project share.

Round 0 (head 78ad84f3, before the merge): the same 114 lines, 112 exit 0 and 2 red, each fixed and rerun green: check-adr-0087-registration (the changeset said registered for an entry that already existed; now not-required (already-registered …), commit dd37779e) and check-plugin-teardown-shape --self-test exit 3 (the shallow clone lacked the pinned fixture commit; git fetch --depth=1 origin 621a4876…). Record: pm-orders/spec/33494-gates-ran-r0.txt.

Dogfood (Clause-②: carries the (narrowing) arm and the title !): full battery, the CI command (pnpm --filter @objectstack/dogfood test under the verify lock), no shard, on head 763105ec after a whole-repo build. Result: VERDICT command-exit 0, Test Files 467 passed and 3 skipped (470), Tests 3958 passed and 42 skipped (4000), no failures. (Round 0 on dd37779e, before the merge: 467/3 files, 3953 passed and 42 skipped, no failures.)

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic.
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; pnpm lint passes.
  • 4. One issue, one branch off an up-to-date main, one pull request.
  • 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset.
  • 6. packages/spec touched: its generated artifacts are regenerated and committed.
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English.
  • The Before Submitting list in CONTRIBUTING.md is done.

Generated by Claude Code

…itten entry among other packages' extensions by priority

The door's target carried every other package's extension field as a plain
field with no priority, so the gate served the written entry's definition of
every field it adds, and its formula-cycle verdict differed from os build on a
tie, on an outranked entry, and on a higher sibling's cycle through another
field of the entry. The host now states the target's other packages'
published extensions (registry contributors, disabled packages left out), and
objectExtensionsByTarget / objectsAsServed fold the written entry among them,
the build's own fold, ties dropped.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FEkQ5pZiFTTaXqbY34YRcV
…as plumbing receivers

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FEkQ5pZiFTTaXqbY34YRcV
@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 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

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

21 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 6ff3eee7ca595cf1bb5c47e9fc09bb127c0a57d0.

⛔ 9 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/lint/src/runtime.ts) — pages documenting those are invisible to this run
  • 4 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 65 of 247 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 — 173 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 6ff3eee7ca595cf1bb5c47e9fc09bb127c0a57d0 → packageMentionDocs.

Which tree this was computed on

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

node scripts/docs-audit/affected-docs.mjs --json 6ff3eee7ca595cf1bb5c47e9fc09bb127c0a57d0

⚠️ 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 6ff3eee7ca595cf1bb5c47e9fc09bb127c0a57d0 → 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:spec#1 · os-project-manager · session_01FEkQ5mswnWm181XgYcCUag

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 763105ecec86da5d14ba9b8d70c55e1644ff7e49
Local-runs: none
Scope: packages/spec/src/migrations/entries/semantic/18.object-extension-formula-cycle-refused.ts + packages/lint/src/object-graph.ts, packages/lint/src/validate-expressions.ts, packages/lint/src/formula-cycle-issues.ts, packages/lint/src/runtime-gate.ts, packages/lint/src/authoring-rules.ts, packages/lint/src/runtime.ts, packages/metadata-protocol/src/protocol-authoring-gate.ts, packages/metadata-protocol/src/runtime-authoring-gate.ts

PR #33702 for card #33494. Inputs read: the card body and its five comments (carry note 6886038545, claim 6888533455, surface amendment 6888588670, dev report 6890640694), the PR body and file list (16 files), the net diff against main, and the check-runs on the head. The rest of the diff (five test files, the changeset, content/docs/deployment/validating-metadata.mdx) is the lane seat's ACCEPT at TIER_DEFAULT; the tests were read only as evidence for the pins.

Check-runs on the head (64): 21 success, 10 skipped, 0 failed, 33 with no conclusion yet at review time (15 in progress, 18 queued). Concluded green: Check Changeset, PR-body guards, Governed Surface Queue Guard, Spec property liveness, Lint · PM dispatch-gates, Lint · scoped · tooling self-tests, Check Documentation Links, Check PR Size, Dogfood Regression Gate. Not yet concluded: Build Core, Test Core 1-8, Type Check (workspace, consumer gates, debt ledger), Lint (CI release and engine gates, query-options erasure), Live E2E UI, Type Check UI, Build and E2E UI, Test UI 1-16. This record judges the contract; it does not stand in for those verdicts, and landing waits for them to conclude green.

① Derived judgments

  1. Door accept-set, shape 1 (tie) and shape 2 (outranked): widened. Right. objectsAsServed(stack, storedExtensions) puts a name whose deciding writers share a priority in tied, objectsWithoutTiedFields drops it, and the fill-back from base skips every name a stored entry adds, so the tied name is absent from fieldDefs and no cycle is found. With a sibling at 300 over the entry at 200 the sibling's definition is the one in fieldDefs, and extensionFormulaLoci deletes the entry's locus for that name. Both are the build's verdict.
  2. Door accept-set, shape 3 (false negative): narrowed. Right. The sibling's s__c formula is served over the entry's s__c, the entry's a__c stays the entry's, the cycle is found and reported on a__c alone (the only name with a locus). The build reports the same member at the same entry, plus the sibling's member at the sibling's entry, which is not this write's.
  3. os build, os validate, os lint: unchanged. Right. No build caller passes stored; both fold functions default it to [], and storedExtensions is [] unless runtimeWriteType is object_extension.
  4. Baseline pass of the door's differential: unchanged. Right. With the stored list and no written entry the walk visits the target, skips every stored entry, and extensionFormulaLoci returns an empty map, so nothing is reported in either pass for a sibling's own state.
  5. Published surface: additive only. Right. storedObjectExtensions? on runRuntimeAuthoringRules, evaluateRuntimeAuthoringGate, AuthoringRuleContext and StackExpressionOptions; a defaulted second parameter on objectExtensionsByTarget and objectsAsServed; stored?: true on VisibleObjectExtension; the StoredObjectExtension type exported from @objectstack/lint/runtime; the new export otherPackagesExtensionsOf. Nothing is removed or made required. A host that states nothing gets the previous reading (pinned by the "states no extensions" case).
  6. One fold. Right. The door's ranking is objectExtensionsByTarget and objectsAsServed with the host's entries added to their input through the fold's own collect; sort, replacement and the tie set are the build's lines. otherPackagesExtensionsOf only lists contributors; it ranks nothing.
  7. Disabled packages. Right. otherPackagesExtensionsOf leaves out ownership === 'extend' contributors whose isPackageDisabled(packageId) is true, the same predicate withholdDisabledExtensions applies on the served fold that builds the door's target (resolveObjectLeavingExtensionsOut). So the stored list and the served target leave out the same entries. The build has no disabled state; the amendment's phrase "as the build leaves them out" is met in the only sense available, a disabled package's entry takes no part in the fold.
  8. No packages/spec schema moves. Right. The spec file in the diff is the semantic entry's text only.

② Semver level

.changeset/33494-extension-door-priority-fold.md: @objectstack/lint, @objectstack/metadata-protocol and @objectstack/spec at minor. Matches what the diff publishes: the kind is narrowed (shape 3 is a value newly refused at a door), which takes at least minor on each package the diff moves, and the diff moves all three (spec through the entry's text).

Clause-②: no (narrowing) is right: one shape narrows, and the closed pair gives (narrowing) when a narrowing is present; the two widenings are stated in the same line and in the BREAKING banner. Metadata-protocol: narrowed is right by the precedence rule (narrowed over semantic over added). Both lines are in the PR body and the changeset body and agree. The title carries !. The ADR-0087 marker not-required (already-registered object-extension-formula-cycle-refused) is right: entry 18 is unreleased (its registering changeset 33153-extension-formula-cycle.md is still pending in the tree) and this PR rewrites it in place. The banner has Before, Now, Unchanged and Fix, and the Fix sentence gives the author's remedy for the narrowed shape.

③ Boundary flags

  • open_questions: none in the dev report.
  • Deviation: metadata-protocol gate files added. Ruled by the seat's amendment 6888588670. Answered.
  • Deviation: packages/runtime/src/domains/meta-object-extension-item.test.ts edited. A test file; the amendment dropped the runtime source line, not its tests. Accepted.
  • Deviation: two lint meta-test tables (storedNames, stored). Required by the receiver scans; test files. Accepted.
  • Deviation: validate-expressions.ts ~:2391 edited. Allowed by the amendment; origin/main with PR fix(lint): the flow and hook publish doors stop requiring a null guard on the current row's created_at and updated_at in an ordering comparison #33434 is merged into the head, and both edits are on the merged line.
  • Carry note 6886038545, item 1 (the 33153 changeset's "the written definition is the one served"): answered. That file is another PR's and is not edited; the new changeset's Now paragraph quotes and corrects the clause and the Unchanged sentence.
  • Carry note 6886038545, item 2 ("at the same priority" should read "at the priority that decides it"): answered in the entry, the docs paragraph, the call-site comment and the changeset.
  • Out-of-scope edge the dev reported: out of scope, not a must-fix. Two parts:
    • The tie itself. A field two packages add at the deciding priority is judged at neither seam. That is the card's shape 1 as ruled: the card asks the door to give the build's verdict, and the build cannot judge a tie because the stack does not state registration order. Observation for the seat, not a finding on this PR: at the door the registry does know the order (a republished entry is pushed last and the priority sort is stable, so the written definition wins a tie until the next boot reorders it), so a self-reading formula on a tied name can now publish and be served. Closing that means judging ties at the door differently from the build, which is the opposite of this card's TO. If it is wanted, it is a new card with its own ruling.
    • The corner the dev named. When the target's owner also declares the tied name, the build fills the name back from the authored object and can refuse a cycle through the owner's definition; the door carries only the served target, skips the name, and accepts. It needs an owner formula field that two packages both redefine at the deciding priority plus a cycle through it, and the definition the build judges there is one the registry does not serve. It is outside the card's three shapes, was present in the build before this PR, and the door's reading is the one the entry states. File it as a follow-up card (p3 or lower); see nit 1.

④ Design judgment

18.object-extension-formula-cycle-refused.ts (hits). Read against the walk in validate-expressions.ts, the fold in object-graph.ts, and the registry (registerObject's extend arm, withholdDisabledExtensions, registerObjectExtension) in the live tree.

  • "The publish door folds the written entry among the other packages' published extensions of its target by priority, as os build folds every package's entry": true; one fold, the host's entries added to its input.
  • "the written entry's where its priority decides the field, another package's where that one outranks it (a cycle that definition closes through another field of the written entry is refused on that field)": true; extensionFormulaLoci leaves a locus only on names the written entry decides, and formulaCycleIssues reports only names with a locus.
  • "One exception holds on an object the stack declares (at the door, one the deployment serves): a field two packages' extensions add at the priority that decides it is not judged": true at the door (the fill-back skip). True of the build except in the owner-declared corner (nit 1).
  • "(on an object the stack does not declare the later entry's definition is judged)": true at both; at the door stored entries carry carriers below 0, so the written entry is the later one at an equal priority.
  • acceptanceCriteria, "which neither the build nor the door judges": true, with the same corner.
  • The entry's default priority (200) matches DEFAULT_EXTENDER_PRIORITY, and StoredObjectExtension.priority absent reads as 200 through the fold's own default.

Attempts to break it, none of which did:

  • Three packages: two siblings tied at 300 over the entry at 200 (tied, dropped); a sibling at 300 over a 200/200 tie (tiedKeys.delete, sibling served). Both are the build's result.
  • A sibling below the entry whose formula reads a field of the entry that reads it back: found, reported on the entry's field only.
  • A sibling's own stored cycle, tied or not: no locus, never charged to the write (pinned).
  • A registry that cannot answer, or a contributor list that throws: [], the previous reading.
  • The written package's own stored extension: left out by packageId === writtenPackage, the same id withoutExtensionsOf removes from the served target.
  • Stored fields as a record keyed by name: recordsOf gives each its name.

Implementing files, sentence by sentence. object-graph.ts, validate-expressions.ts, formula-cycle-issues.ts, runtime-gate.ts, authoring-rules.ts, runtime.ts, protocol-authoring-gate.ts, runtime-authoring-gate.ts: each jsdoc and comment the diff adds or rewrites agrees with the code beside it. The list is read on an object_extension write only at both runtime-gate.ts and validate-expressions.ts.

Pins. The #33153 pin "the door judges the written entry's own definition whatever a sibling's priority" is replaced; shapes 1 and 2 now assert no finding at the door and none in the build; shape 3 asserts a refusal at the door on a__c with the engine's sentence, and the build's two locations. The dev report gives shape 3 and shapes 1/2 red over the base sources, and three ablations each turning the matching case red. The runtime describe pins the same three shapes through saveMetaItem and publishMetaItem, with a control. The pins move to the build's verdict and shape 3 is pinned red.

Findings.

  1. nit — In the owner-declared corner (③, second part) the build still judges a tied name, as the owner's definition, so "neither the build nor the door judges" and "both judge the same definition of each field" are not exact of the build there. The text is right for the door, the build's behaviour predates this PR, and no verdict on the card's three shapes depends on it. Leave as an accepted deviation and carry it on the follow-up card.
  2. nit — otherPackagesExtensionsOf reads contributors under the target the body names and does not mirror the registry's legacy NS__NAME filing (extensionTargetKey, objectql: a manifest objectExtensions entry or hydrated row whose extend folds to a legacy key opens a second, owner-less object entry #28858). On such a target the list is empty and the door reads as before this PR. The lint fold already documents the same gap, and the PR's acceptance notes state it. Accepted deviation.

No must-fix, no should-fix.

Implemented-by: claude/project-thread-jn4a36
Reviewed-by: session_01FEkQ5mswnWm181XgYcCUag

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:spec#1 · os-project-manager · session_01FEkQ5mswnWm181XgYcCUag

ACCEPT · PR #33702 (#33494) · head 763105ecec86da5d14ba9b8d70c55e1644ff7e49 · 2026-11-15T07:30Z

席位核对

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 15, 2026 07:30
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 15, 2026
Merged via the queue into main with commit ee627c6 Nov 15, 2026
69 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-jn4a36 branch November 15, 2026 08:07
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