Skip to content

feat(spec)!: refuse two entries under one identity in one package at the composition and package-body doors - #35699

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

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

Conversation

@objectstack-fleet

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

Copy link
Copy Markdown
Contributor

Requested by Sales · project thread

Fixes #35228
Part of #35608

Clause-②: no (narrowing)
Metadata-protocol: narrowed
Skills-docs: none — no skill teaches splitting one package's entries for one identity across sub-stacks or package bodies; skills/objectstack-data/SKILL.md teaches one objectExtensions entry per extension, and the refusal names both entries and prescribes the merge

维护者速读

  • 用户能看到什么变化:应用作者把同一个包拆成几个模块再拼起来时,如果两个模块给同一个对象加字段(或者两个模块起了同名的页面、流程等),校验和构建现在会直接报错并点出两处位置;以前会悄悄只留后一处。
  • 为什么做:有应用在同一个包里分两处给同一个对象加字段,前一处的字段无声消失,上线后读写才报字段不存在;这次按维护者裁决把"一个包里同一对象只能有一段扩展"在拼包和包内容处也管住,并把同类的其他元数据一起收口。
  • 出错会怎样:已经构建、已经安装的包照常启动,只在启动日志里多一条错误提示;如果误拦了正常写法,作者会在校验时看到报错,撤回这个合并即可恢复原状,不涉及数据迁移。
  • 要你做什么:无

Harness branch: this PR's head is claude/project-thread-nbjebo (harness-assigned, not claude/issue-35228-…), noted for the Duplicate Fix Guard workflow.

The folded card #35608 rides this PR; the seat finishes that card by hand after the merge.

What changes

The ruling on #35228 (maintainer, letter A, runtime arm A1: 「推荐 A,已安装的包只记错误日志、照常启动。」) applied, with #35608 folded in:

  • packages/spec/src/stack.zod.ts. The same-package identity table behind defineStack's duplicate-entry refusal (all 29 keys: the 27 of the original refusal plus queues and assignmentRules) is now read by one helper, duplicateEntryFindings, at four doors, with one wording and per-door origins:
    • a stack's top level: stack.KEY[i] — byte-identical to before;
    • each packages[i] body of a defineStack call: stack.packages[i].manifest.KEY[j];
    • the ONE package a flat composeStacks makes (every manifest strategy but 'preserve'): the inputs' entries together, each labelled with its input ('com.example.sales' (stack #0) objectExtensions[0]). objects is skipped there, since two inputs declaring one object name is the objectConflict strategy's to refuse or fold;
    • the RESIDUAL package of any composition, under every manifest strategy including 'preserve': the top-level entries no body of the composed artifact claims, read by the boot's own residual reading (isResidualTopLevelItem, plus a claimed-by-identity rule for datasources and objectExtensions), judged as one package. A flat composition with no packages[] carries all its entries as residual. A nested multi-package input's flattened copies of its bodies are never read as a second entry;
    • every package body a composition carries or, under 'preserve', assembles, each judged on its own.
      One entry object reached through two inputs (one built sub-stack passed twice) counts once at the door, in every collection but hooks. In hooks a hook reached twice is refused: a built artifact serialises the two references into two equal hook entries and binds both handlers, while a source boot folds them, so accepting it would let one accepted composition behave differently between a source boot and a built boot (one bind against two). Counting hooks by position also makes the composition door agree with the single-stack door for hooks.
      The composition doors join composeStacks' artifact cross-reference pass, so the refusal is STACK_CROSS_REFERENCE_INVALID / 422 and carries the inputs' conversion record like the other composition refusals. Cross-package reuse (ADR-0048 §3.4) is untouched; two bodies under one package id stay the boot's DUPLICATE_ARTIFACT_PACKAGE.
  • packages/objectql/src/engine-registration.ts (A1). The objectExtensions loop first logs, at error, once per (package, target) in a body carrying two or more entries for one target: the target, the package, every entry index, that only the last entry's fields register, and "merge them and rebuild". The line stays quiet when every entry for that target is equal by value (one sub-stack composed twice, as composed or as built JSON); equal entries beside one that differs still log, naming every entry. The outcome is unchanged: nothing refused, nothing merged. registry-object-registration.ts (the replace-on-reload splice) is not touched.
  • Migration entry stack-package-duplicate-entry-refused-at-every-door (semantic, protocol 18) and one changeset (@objectstack/spec + @objectstack/objectql, minor, BREAKING banner, adr-0087: registered).

Tests

  • packages/spec/src/stack-object-extension-duplicate-target.test.ts (objectExtensions: two entries for one object in the same package silently drop the earlier entry's fields #35228): composed stack with two objectExtensions entries for one target refused with the exact message naming both; every flat manifest pick (first, last, an index) refused; a hand-built packages[1] body refused at stack.packages[1].manifest.objectExtensions[0] and …[1]; a nested artifact's body refused under last and preserve; a loose input under preserve refused as its body; the single-stack message pinned byte for byte; controls: preserve with two packages each extending one target, two hand-built bodies, one package extending two targets, the same sub-stack passed twice. Added on review: preserve with two manifest-less inputs declaring page home, and two extensions for one target, both refused naming both, plus the body-slot control (S2); a preserve artifact with two packages each extending one target, nested in a flat and in a preserve composition, accepted, and the nested artifact's own residual pair refused (S1); a hook reached twice refused (S3).
  • packages/spec/src/stack-compose-duplicate-entry-census.test.ts (composeStacks: two sub-stacks of one package that each declare one name in a #22934 collection (e.g. pages) compose with both entries, so the duplicate refusal never runs #35608): the census as a table-driven test over the 29 keys — each input accepted alone; flat composition refused per key (28 by this check, objects by its object-conflict refusal); a packages[0] body refused per key; cross-package control under preserve accepted per key with one entry in each body.
  • packages/objectql/src/engine-same-target-object-extensions-log.test.ts (A1): one error line naming both entries, the earlier field absent and the later served (today's outcome); once per (package, target); controls (one entry; two packages); reload pin — re-registering with a renamed field serves the new name and not the old. Added on review (S3): the accepted twice-passed sub-stack composition, registered as composed and as built JSON, logs no error; equal entries beside a differing one log.
  • packages/spec/src/stack-conversions-record.test.ts: the composition duplicate refusal carries its inputs' conversion records.
  • packages/spec/src/stack-datasource-connector.test.ts: fixture triage. Two flat-composition fixtures declare one connector name in two inputs; that is now also the one composed package's duplicate, so they assert the second finding, and the reversed-order control now asserts the refusal. A preserve fixture now also meets the residual duplicate finding (second issue of the same envelope).

Acceptance notes

  • Census on base e91d9671 (before the fix), composeStacks([A, B]) default strategy, A with the manifest and the first entry, B the second: 26 keys ACCEPTED with 2 entries; objects REFUSED STACK_COMPOSE_OBJECT_CONFLICT; apps REFUSED STACK_SINGLE_APP_VIOLATION. After: all 29 refused (28 STACK_CROSS_REFERENCE_INVALID, which runs before the single-app count as in defineStack; objects unchanged). A boot census (which entry is served) was not repeated: the original duplicate-entry card measured it for the same collections and registrars.
  • Under 'preserve', a manifest-less input contributes no body; its entries are the residual package, which the residual door now judges (review S2).
  • Accepted deviation (review N2): the refusal's remedy does not mention manifest 'preserve', because the finding: one stack can author two entries under one name in 20+ named collections (objects, pages, flows, permissions, webhooks …), and os validate exits 0; only actions and the functions array (#22902) refuse it #22934 sentence stays byte-identical at every door.
  • Out of scope, filed as objectql: a composed artifact's residual top-level objectExtensions entry is registered by no door, and a residual job is judged by no duplicate door #35711 (with review N5, a residual job judged by no door): a residual (top-level, unclaimed) objectExtensions entry of a packages-carrying artifact is registered by no door at boot (scratch probe on c5b827e5: the extended field absent on the resolved target). So at that door the refusal's sentence ("only the last entry's fields register") overstates what registers: none do. The refusal itself stands.
  • The connector-lend rule's flattened-artifact branch now always arrives beside the duplicate finding for a flat composition; it is kept as it was.
  • The A1 line is once per registration of a body; a reload of the same unfixed body logs it again.
  • stack.zod.ts's docblock above the table now says 29 collections (review N1); objects stay with objectConflict, and the app pair answers STACK_CROSS_REFERENCE_INVALID (review N3).

Verification

Two-minute check: pnpm --filter @objectstack/spec exec vitest run --project local src/stack-object-extension-duplicate-target.test.ts passes; then delete the line ...collectComposedResidualDuplicateEntryErrors(stacks, composed.packages), in stack.zod.ts and rerun: the flat-composition and residual cases go red.

Read first, by risk: packages/spec/src/stack.zod.ts (the duplicateEntryFindings family and the two lines added to composeBuiltStacks step 3b), packages/spec/src/stack-datasource-connector.test.ts (the re-judged fixtures), packages/objectql/src/engine-registration.ts (logSameTargetObjectExtensions).

Readings below on head 58464e71 unless noted; the review round's readings on head c5b827e5 come first.

Review round on c5b827e (S1-S3)
closure build --filter='@objectstack/dogfood^...' :: VERDICT command-exit 0
pins (spec: duplicate-target, compose census, conversions-record, datasource-connector) :: Test Files 4 passed · Tests 203 passed
pins (objectql: engine-same-target-object-extensions-log) :: 1 file · 7 passed
pnpm --filter @objectstack/spec test      :: exit 0   Test Files 863 passed · Tests 27626 passed | 1 todo
pnpm --filter @objectstack/objectql test  :: exit 0   Test Files 617 passed · Tests 13930 passed
spec typecheck / objectql typecheck       :: exit 0 / exit 0
dogfood battery :: VERDICT command-exit 0 · Test Files 482 passed | 3 skipped (485) · Tests 4093 passed | 68 skipped (4161)
ablation (scripts/ablation-replace.mjs, each leg red, restored by blob hash):
  A residual filter deleted          -> 37 failed of 203
  B old preserve skip restored       -> 4 failed (both S2 pins, two connector residual refusals)
  C hooks exception deleted          -> 1 failed (hook reached twice)
  D equal-by-value quiet deleted     -> 1 failed of 7 (twice-passed composition)
dispatch-gates --commands :: 97 derived, 97 run, 0 NOT-MEASURED (dual-build-cjs-loads and plugin-teardown self-test now measured, exit 0)
check-platform-checklist --changed-from origin/main :: OK, 6 anchors, 0 lost · overlap-check :: clean
CI on c5b827e5 :: 58 success, 11 skipped (opt-in and queue-only)

The two reds on 58464e71 (TypeScript Type Check, Test UI) were cancel-in-progress aggregators after the c5b827e5 push, not test failures.

Package suites and typecheck
pnpm --filter @objectstack/spec test         :: exit 0   Test Files 863 passed (863) · Tests 27620 passed | 1 todo
pnpm --filter @objectstack/objectql test     :: exit 0   Test Files 617 passed (617) · Tests 13928 passed
pnpm --filter @objectstack/spec typecheck    :: exit 0   (on 85531416, pre-rebase; same blobs)
pnpm --filter @objectstack/objectql typecheck:: exit 0   (on 85531416)
pnpm --filter @objectstack/cli exec vitest run --project unit :: exit 0   431 files · 6159 tests (on 85531416)

test:repo (the spec repo vitest project) is declared to CI: the diff touches none of its tests.

Dogfood battery (title carries the bang)
pnpm --workspace-concurrency=2 --filter='@objectstack/dogfood^...' build :: exit 0
pnpm --filter @objectstack/dogfood test :: VERDICT command-exit 0
  Test Files 482 passed | 3 skipped (485) · Tests 4093 passed | 68 skipped (4161)
Ablation and base control (blobs of both edited source files identical on 85531416 and 58464e7)

Each leg through scripts/ablation-replace.mjs (anchor 1 -> 0, blob moved, restored, git diff HEAD empty after):

delete the flat composition door        -> 30 failed | 95 passed (census flat rows 28 + two #35228 cases)
delete the defineStack package-body door -> 29 failed | 96 passed (census body rows 28 + the hand-built body)
delete the composed package-body door    -> 2 failed | 8 passed  (nested body; preserve loose input)
delete the registrar error log call      -> 2 failed | 3 passed  (both log pins; reload and controls green)

Base control, stack.zod.ts restored from e91d9671: the five new-door pins fail, the single-stack byte-identical pin and the original duplicate-entry suite pass (5 failed | 143 passed).

Gate families (dispatch-gates --commands, 97 derived)
95 :: exit 0
node scripts/check-plugin-teardown-shape.mjs --self-test :: exit 3   NOT MEASURED: needs the unshallowed history
pnpm check:dual-build-cjs-loads :: exit 3                            NOT MEASURED: needs every workspace dist
--ran reconciliation: 97 derived accounted for — 95 run, 2 NOT-MEASURED
node scripts/check-platform-checklist.mjs --changed-from origin/main :: OK, 6 anchors judged, 0 lost
node scripts/pm/overlap-check.mjs :: VERDICT clean exit 0
check:dev-prereqs (local only) :: NOT MEASURED — workspace only partly built (closure build)

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 was not run locally (a CI-owned repo scan).
  • 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 (none stale: check:api-surface, check:authorable-surface, check:docs, check:spec-changes, check:upgrade-guide exit 0).
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English.

🤖 Generated with Claude Code

https://claude.ai/code/session_01L6bhgVLY5efsfaT3UG2zwH

…ion and package-body doors

The #22934 identity table now also runs on the one package a flat
composeStacks makes of its inputs and on every packages[i] body, with the
single-stack wording. The objectql registrar logs an error for a body built
before this that carries two objectExtensions entries for one target, and
keeps its outcome (ruling A, arm A1).

Claude-Session: https://claude.ai/code/session_01L6bhgVLY5efsfaT3UG2zwH
Co-authored-by: Claude <noreply@anthropic.com>
…e same-package duplicate refusal

Two inputs of a flat composition declaring one connector name are one package's
duplicate now, refused beside the connector-lend finding.

Claude-Session: https://claude.ai/code/session_01L6bhgVLY5efsfaT3UG2zwH
Co-authored-by: Claude <noreply@anthropic.com>
@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 20, 2026
@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

15 anchor(s) derived from 2 changed package(s); no hand-written page names any of them, so this run has nothing to list — not a clean bill of health. This check sees only pages that NAME a derived anchor: one that documents this change in prose, or enumerates it in an authoring dialect, names none and stays invisible to it on every run.

What this run could not see
  • 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 — 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 c03a8a342805186e04e05d9903f7f1913b43dabe → packageMentionDocs.

Which tree this was computed on

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

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

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

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgVLY5efsfaT3UG2zwH

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 58464e71d4a2f09b814d24abadbfe2eaf4f1405a
Local-runs: none
Scope: packages/spec/src/stack.zod.ts, packages/spec/src/migrations/entries/semantic/18.stack-package-duplicate-entry-refused-at-every-door.ts + packages/objectql/src/engine-registration.ts
Security-touching: yes

Inputs read: card #35228 (body, 6 comments, ruling 7023505627, claim 7023784590, os-dev-report 7025836839), folded card #35608 (body, 2 comments), this PR's body, its 9-file list and the net diff against main, and the check-runs on the head as of 2026-11-20T00:14Z. The cited code was read in the tree at the head; nothing was built or run. The rest of the diff (five test files, the changeset) is the lane seat's ACCEPT at TIER_DEFAULT.

Verdict in one line: the three doors the ruling names are implemented with the #22934 wording and the A1 arm matches the ruling, so there is no must-fix. Three should-fix findings are open on this head (S1, S2, S3), all at the edges of the composition door, so a delta review is owed after their fix.

Security-touching: yes is meant, conservatively: the identity table this diff now reads at the composition and package-body doors includes permissions, sharingRules, capabilities and positions, so a same-package pair in those collections moves from last-wins to refused. No hits path is under skills/**, so the skills arm's label rule does not apply.

① Derived judgments

Accept-set changes the diff implies:

  1. Flat composeStacks (every manifest strategy but 'preserve'), inputs' top-level entries judged together: 26 keys newly refused, objects skipped. Right. This is the ruling's "on the output of composeStacks" and composeStacks: two sub-stacks of one package that each declare one name in a #22934 collection (e.g. pages) compose with both entries, so the duplicate refusal never runs #35608's fold. objects stays with objectConflict, which is right: mergeObjects already refuses or folds a shared name.
  2. defineStack({ packages }): each packages[i].manifest body judged on its own, 29 keys including objects. Right. The ruling names "every packages[i] body"; a body is registered by registerApp as a top level is.
  3. A composition's carried bodies, and under 'preserve' the body each input with a manifest is assembled into. Right. Reachable only through a strict: false input, and it keeps cross-package reuse apart (each body alone).
  4. A single stack: unchanged, byte for byte. Right. Read in the diff: same key order, same Array.isArray skip, same origin spelling stack.KEY[i], same sentence.
  5. The same entry object reached through two inputs counts once. The accept set is unchanged from main, but the judgment is wrong against the registrar in this same diff: see S3.
  6. The flat door reads the top level of an input that itself carries packages[]. Wrong: see S1.
  7. Under 'preserve', top-level entries that no body carries are judged by no door. Accept set unchanged from main, but the claim "wherever the package is assembled" does not hold there: see S2.

Public-surface changes:

  • No new export: every added function in stack.zod.ts is module-private.
  • Error code for one shape changes: two inputs each declaring an app of one name were refused as STACK_SINGLE_APP_VIOLATION and are now refused first as STACK_CROSS_REFERENCE_INVALID (step 3b runs before 3c, the order defineStack uses). Right, and consistent; the changeset does not say it (nit N3).
  • @objectstack/objectql: one new error-level log line per (package, target), with meta { package, target, entries }. Nothing refused, nothing merged, registry-object-registration.ts untouched. Right against arm A1.
  • Migration entry id stack-package-duplicate-entry-refused-at-every-door matches the changeset's adr-0087: registered line.

② Semver level

@objectstack/spec minor and @objectstack/objectql minor, with a BREAKING banner, Clause-②: no (narrowing) and Metadata-protocol: narrowed. This matches what the diff publishes: it widens no accept set and adds no public export, and it narrows the accept set of composeStacks and of a packages[i] body. The gate's own rule (scripts/check-changeset-no-major.mjs: narrowed beside a line without the (narrowing) arm is a contradiction; a narrowing ships minor in the launch window) agrees, and Check Changeset concluded success on this head. The objectql half is a log line only; minor is acceptable for it.

Clause-②: no (narrowing) — correct as written in the PR body and the changeset.

③ Boundary flags

④ Design judgment

packages/spec/src/stack.zod.ts against ruling 7023505627, #35608, and its first consumers (the boot's package and residual registration).

What holds: one helper reads the table at every door, so the wording cannot drift; the sentence is the #22934 one; origins name the input or the body path as the claim's file surface asked; the refusals join step 3b, so they are STACK_CROSS_REFERENCE_INVALID and carry the inputs' conversion record through the existing composeStacks wrapper; two bodies are never compared with each other.

S1 (should-fix) — The flat composition door refuses legal cross-package reuse when an input carries packages[]. collectComposedDuplicateEntryErrors reads every input's top-level collections as "the ONE package a flat composition makes". That premise fails for an input that carries packages[] and a flattened top level, which composeStacks itself emits: a 'preserve' artifact keeps the flattened copy whenever packagesCarryEveryInputCollection answers false (an input with no manifest, or an input carrying packages[] plus collections of its own). In that copy, two packages' entries under one identity sit side by side, for example two packages each extending crm_line, which is this PR's own accepted control. Nest that artifact in a flat composition and the door reports stack #0 objectExtensions[0] and stack #0 objectExtensions[1] with "only the last of these entries' fields register", which is false: the boot registers each body under its own id and does not register a top-level item a body declares (unclaimedTopLevel, mirrored in this file by isResidualTopLevelItem). The sibling check states the correct rule in its docblock: collectComposedSingleAppErrors says a nested artifact's flattened copies of its bodies' apps are not residual. The docblock of duplicateEntryFindings ("every door below hands it one package and nothing else, so cross-package reuse of a name is never read here") and the changeset's "Unchanged" bullet are therefore not true of this door. Read from code, not driven. Fix shape: for an input that carries packages[], the flat door reads only the top-level entries no body of that input claims.

S2 (should-fix) — The residual package is judged by no door, so the card's defect survives under manifest: 'preserve'. Under 'preserve' the flat door is skipped, and collectComposedPackageBodyDuplicateEntryErrors judges only carried bodies and inputs that have a manifest. Entries of a manifest-less input (and the own collections of an input that carries packages[]) reach only the composed top level. The boot registers those under the artifact's manifest.id as the residual, and its own docblock says two items of one name in one body register last-wins. So composeStacks([defineStack({ manifest, objects }), defineStack({ pages: [home] }), defineStack({ pages: [home] })], { manifest: 'preserve' }) is still accepted with both entries in one package, and the same shape with two objectExtensions entries is the decision analysis's own example with one option added. #35608 asked for exactly this door to be checked (measure item 3), the ruling says "on the output of composeStacks", and the migration entry and changeset say "wherever the package is assembled". The dev disclosed it as an out-of-scope note with no carrier. Close it one of two ways: judge the residual (top-level entries no body claims) as one package under every strategy, which also gives S1 its fix; or file a card for the residual door before #35608 is closed and narrow the entry's and changeset's wording to the doors that are covered.

S3 (should-fix) — The spec door and the registrar disagree about one entry reached twice. collectComposedDuplicateEntryErrors counts one entry object reached through two inputs once and accepts the composition (pinned by "the same built sub-stack passed twice is one declaration"). The concat pass still emits that entry twice (arrays.flat()), so the composed stack, and any artifact built from it, carries two objectExtensions entries for one target. logSameTargetObjectExtensions counts by index, so every boot of that accepted composition logs at error that the fields of the other entry "are missing" and tells the author to "merge them and rebuild". Both statements are false there, a rebuild changes nothing, and the registrar's comment "authoring refuses that body now" is not true of it. The migration entry's acceptance criterion ("the boot log carries no error saying a package declares several objectExtensions entries for one object") fails for a composition this PR accepts, and the same output handed to defineStack as a packages[i] body after serialisation is refused. The docblock's "the boot loses nothing" is also not the whole account for hooks, where the table's own consequence line says every entry's handler is bound and runs. The three places must agree: the composition emits a twice-reached entry once, or the door refuses it, or the registrar's line does not fire on what authoring accepts.

N1 (nit) — The docblock above the table still says "the 27 collections" while the table holds 29 (queues and assignmentRules predate this PR). Fold it into the head that fixes S1 to S3, or leave it.

N2 (nit) — A flat composition of two inputs with two different manifests that reuse one name is now refused with "Rename one of them, or merge them". The refusal is right (one package results, and one entry was dropped at the boot), but the remedy does not mention manifest: 'preserve', which keeps both, as the single-app finding does. Follow-up or accepted deviation.

packages/spec/src/migrations/entries/semantic/18.stack-package-duplicate-entry-refused-at-every-door.ts against its sibling 18.stack-collection-duplicate-entry-refused and the ruling.

Shape, id and the no-conversion reasoning match the sibling, and the A1 arm is described as the registrar implements it. Its replacement ("wherever the package is assembled") and its acceptanceCriteria inherit S2 and S3 and are corrected with them.

N3 (nit) — The entry's surface lists objects among the composition's collections without saying that two inputs sharing an object name stay with objectConflict (the changeset says it), and neither text mentions that a same-name app pair now answers STACK_CROSS_REFERENCE_INVALID where it answered STACK_SINGLE_APP_VIOLATION. Prose only.

packages/objectql/src/engine-registration.ts (implementing file, arm A1), sentence by sentence against the ruling.

  • "Logs an error naming both entries": yes. One error line per (package, target), naming the package, the target and every index, with the fix.
  • "Keeps today's outcome, does not refuse the body": yes. The call sits before the unchanged loop and only reads.
  • "Replace-on-reload is unchanged": yes. The extend splice is not in the diff, and the log is computed per registration, so a re-registration with one entry per target logs nothing.
  • The logger call matches the contract's error(message, error, meta) signature, and the target it groups by is the same raw extend string the loop registers under.
  • Its one disagreement with the contract is S3.

No must-fix. Open on this head: S1 (should-fix), S2 (should-fix), S3 (should-fix); nits N1, N2, N3.

Implemented-by: claude/project-thread-nbjebo
Reviewed-by: session_01L6bhgVLY5efsfaT3UG2zwH

VERDICT: PASS

…ep equal same-target extensions quiet at the registrar

Contract review S1-S3 on the duplicate-identity doors: the composition door
now reads the package the boot registers under manifest.id (every entry of a
flat composition, the unclaimed top level when the artifact carries bodies)
under every manifest strategy; a hook reached twice is counted twice; the
registrar's error line skips entries equal by value. Prose: the table's count,
the migration entry and the changeset.

Claude-Session: https://claude.ai/code/session_01L6bhgVLY5efsfaT3UG2zwH
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgTcFanGhTvqS1V2Q4U

维护者速读

  • 用户能看到什么变化:同一个包里,同一个名字(比如对同一个对象做的两段字段扩展)只能声明一次。以前只有单个 stack 会拦;现在把几个子 stack 组合成一个包,或者手写多包结构里的单个包体时,也会在 os validate、os build 时当场报错,并指出两处各在哪。以前这种情况能通过检查,启动后却悄悄只留下最后一段,前面那段扩展的字段在运行时找不到。
  • 出错会怎样:以前能编译通过的组合,有一部分现在会被拒,需要作者把重复的两段合并成一段,或者给其中一个改名。已经装好的包照常启动,只在日志里记一条错误,告诉作者哪些条目重复了、要合并后重新构建,这就是你选的 A1。
  • 要你做什么:不需要你做任何事。这单属于收窄,L2 已在当前 head 上 PASS,卡线程会落地,并手动关闭 composeStacks: two sub-stacks of one package that each declare one name in a #22934 collection (e.g. pages) compose with both entries, so the duplicate refusal never runs #35608。

席位核对 — ACCEPT (L1-a) · repo:objectstack#1 · head c5b827e5f3abfab7519e591419106419bbf19bf0 · 2026-11-20T01:37Z


Generated by Claude Code

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob

L2 adoption · 2026-11-20T01:39Z · The seat adopts the #35228 card thread's isolated record 7027677167 (on #35228) for head c5b827e5, served at CONTRACT_REVIEW_TIER, which this Clause-②: no (narrowing) fold owes. It was judged under template brief 7027654308 (⛔ lines kept), which covers the whole net diff against main, so it stands on its own and supersedes 7026031587 and 7027587340. The Scope: line covers both path hits plus packages/objectql/src/engine-registration.ts.

The verdict is PASS, with no must-fix and no should-fix items. S1–S3, N1 and N3 are closed. N2 and N6 stand as accepted deviations, and N4 and N5 ride follow-up card #35711. The hooks exception is judged to be inside the maintainer's A+A1 ruling (7023505627) and the #35608 fold, and the PR body states why.

L1-a ACCEPT on this head is 7027655509. check-governed-merges --pr 35699 reads not governed, with 1173 changed lines, and landing-k reads K = 9. #35610 is still open, so no Rule-change: line is owed yet. The fold uses Fixes #35228 plus Part of #35608 (the #35651 trap), so #35608 is closed by hand after the merge. The card thread lands it through the ordinary queue.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgVLY5efsfaT3UG2zwH

Landing (area b1-C, card thread of #35228, #35608 folded) · 2026-11-20T01:41Z: L1-a ACCEPT 7027655509 on head c5b827e5, its Check Changeset condition met (rerun success). L2 record 7027677167 PASS at CONTRACT_REVIEW_TIER under brief 7027654308, adopted by the seat in 7027700389. Not governed (check-governed-merges.mjs --pr 35699: 1173 lines), Clause-②: no (narrowing), #35610 still open so no Rule-change: line is owed. Dogfood battery owed by the ! title and run on this head: 482 files passed. This stroke marks the PR ready and arms auto-merge, so the queue takes it only once the required checks are green; a red check or any new commit other than a clean main merge sends it back to L1. #35608 is closed by hand after the merge (Part of, trap #35651); its follow-up is #35711.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 20, 2026 01:41
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 20, 2026
Merged via the queue into main with commit e75a528 Nov 20, 2026
77 of 78 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-nbjebo branch November 20, 2026 02:15
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/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.

objectExtensions: two entries for one object in the same package silently drop the earlier entry's fields

2 participants