Repository navigation
feat(spec)!: refuse two entries under one identity in one package at the composition and package-body doors - #35699
Conversation
…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>
📓 Docs Drift Check15 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
Coarse fallback — 176 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 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 |
|
repo:objectstack#1 · os-sales · session_01L6bhgVLY5efsfaT3UG2zwH Contract reviewServed-tier: 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 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.
① Derived judgmentsAccept-set changes the diff implies:
Public-surface changes:
② Semver level
Clause-②: no (narrowing) — correct as written in the PR body and the changeset. ③ Boundary flags
④ Design judgment
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 S1 (should-fix) — The flat composition door refuses legal cross-package reuse when an input carries S2 (should-fix) — The residual package is judged by no door, so the card's defect survives under S3 (should-fix) — The spec door and the registrar disagree about one entry reached twice. N1 (nit) — The docblock above the table still says "the 27 collections" while the table holds 29 ( 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
Shape, id and the no-conversion reasoning match the sibling, and the A1 arm is described as the registrar implements it. Its N3 (nit) — The entry's
No must-fix. Open on this head: S1 (should-fix), S2 (should-fix), S3 (should-fix); nits N1, N2, N3. Implemented-by: 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>
|
repo:objectstack#1 · os-sales · session_01L6bhgTcFanGhTvqS1V2Q4U 维护者速读
席位核对 — ACCEPT (L1-a) · repo:objectstack#1 · head
|
|
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 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. |
|
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 |
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.mdteaches oneobjectExtensionsentry 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, notclaude/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 behinddefineStack's duplicate-entry refusal (all 29 keys: the 27 of the original refusal plusqueuesandassignmentRules) is now read by one helper,duplicateEntryFindings, at four doors, with one wording and per-door origins:stack.KEY[i]— byte-identical to before;packages[i]body of adefineStackcall:stack.packages[i].manifest.KEY[j];composeStacksmakes (every manifest strategy but'preserve'): the inputs' entries together, each labelled with its input ('com.example.sales' (stack #0) objectExtensions[0]).objectsis skipped there, since two inputs declaring one object name is theobjectConflictstrategy's to refuse or fold;'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 fordatasourcesandobjectExtensions), judged as one package. A flat composition with nopackages[]carries all its entries as residual. A nested multi-package input's flattened copies of its bodies are never read as a second entry;'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. Inhooksa 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 isSTACK_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'sDUPLICATE_ARTIFACT_PACKAGE.packages/objectql/src/engine-registration.ts(A1). TheobjectExtensionsloop first logs, aterror, 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.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 twoobjectExtensionsentries for one target refused with the exact message naming both; every flat manifest pick (first,last, an index) refused; a hand-builtpackages[1]body refused atstack.packages[1].manifest.objectExtensions[0] and …[1]; a nested artifact's body refused underlastandpreserve; a loose input underpreserverefused as its body; the single-stack message pinned byte for byte; controls:preservewith two packages each extending one target, two hand-built bodies, one package extending two targets, the same sub-stack passed twice. Added on review:preservewith two manifest-less inputs declaring pagehome, and two extensions for one target, both refused naming both, plus the body-slot control (S2); apreserveartifact with two packages each extending one target, nested in a flat and in apreservecomposition, 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,objectsby its object-conflict refusal); apackages[0]body refused per key; cross-package control underpreserveaccepted 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. Apreservefixture now also meets the residual duplicate finding (second issue of the same envelope).Acceptance notes
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;objectsREFUSEDSTACK_COMPOSE_OBJECT_CONFLICT;appsREFUSEDSTACK_SINGLE_APP_VIOLATION. After: all 29 refused (28STACK_CROSS_REFERENCE_INVALID, which runs before the single-app count as indefineStack;objectsunchanged). A boot census (which entry is served) was not repeated: the original duplicate-entry card measured it for the same collections and registrars.'preserve', a manifest-less input contributes no body; its entries are the residual package, which the residual door now judges (review S2).'preserve', because the finding: one stack can author two entries under onenamein 20+ named collections (objects,pages,flows,permissions,webhooks…), andos validateexits 0; onlyactionsand thefunctionsarray (#22902) refuse it #22934 sentence stays byte-identical at every door.objectExtensionsentry of a packages-carrying artifact is registered by no door at boot (scratch probe onc5b827e5: 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.stack.zod.ts's docblock above the table now says 29 collections (review N1); objects stay withobjectConflict, and the app pair answersSTACK_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.tspasses; then delete the line...collectComposedResidualDuplicateEntryErrors(stacks, composed.packages),instack.zod.tsand rerun: the flat-composition and residual cases go red.Read first, by risk:
packages/spec/src/stack.zod.ts(theduplicateEntryFindingsfamily and the two lines added tocomposeBuiltStacksstep 3b),packages/spec/src/stack-datasource-connector.test.ts(the re-judged fixtures),packages/objectql/src/engine-registration.ts(logSameTargetObjectExtensions).Readings below on head
58464e71unless noted; the review round's readings on headc5b827e5come first.Review round on c5b827e (S1-S3)
The two reds on
58464e71(TypeScript Type Check, Test UI) were cancel-in-progress aggregators after thec5b827e5push, not test failures.Package suites and typecheck
test:repo(the specrepovitest project) is declared to CI: the diff touches none of its tests.Dogfood battery (title carries the bang)
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 HEADempty after):Base control,
stack.zod.tsrestored frome91d9671: 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)
Human Minimum
packages/specholds no runtime logic.pnpm lintwas not run locally (a CI-owned repo scan).main, one pull request.packages/spectouched: its generated artifacts are regenerated and committed (none stale:check:api-surface,check:authorable-surface,check:docs,check:spec-changes,check:upgrade-guideexit 0).content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_01L6bhgVLY5efsfaT3UG2zwH