Skip to content

feat(spec)!: composeStacks refuses a flat composition that puts two or more apps under one app or module package id, and every packages[] body is held to one app - #32898

Merged
objectstack-fleet[bot] merged 5 commits into
mainfrom
claude/project-thread-2eliu6
Nov 13, 2026
Merged

objectstack-fleet[bot] merged 5 commits into
mainfrom
claude/project-thread-2eliu6

Conversation

@objectstack-fleet

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

Copy link
Copy Markdown
Contributor

Requested by Sales · project thread

Fixes #32810

Clause-②: no (narrowing)
Metadata-protocol: narrowed
Skills-docs: follow-up #32977 (skills/objectstack-platform/references/bootstrap.md; skills/objectstack-ui/SKILL.md and the ADR-0019 note folded in by comment 6846119916)

维护者速读

  • 改了什么: composeStacks 扁平组合(默认 manifest: 'last'、'first' 或下标)若把两个以上应用放到同一个 app/module 包 id 下,现在会被拒(STACK_SINGLE_APP_VIOLATION,422),报错写出包 id、每个应用来自哪个输入、以及改用 manifest: 'preserve';defineStack 与 composeStacks 也按同一规则判每个 packages[] 包体;结果带 packages[] 时,没有任何包体声明的顶层应用(例如 preserve 下没有 manifest 的输入带来的应用)会被加载路径登记到制品 manifest 的 id 下,现在和该 id 包体自己的应用一起判。defineStack 的报错文案补上 preserve 改法,包类型标签从类型推导。
  • 为什么改: ADR-0019 D3 修订后要求一个包至多一个应用;spec: defineStack refuses a module package that defines more than one app, the enforcement of the amended ADR-0019 D3 (a suite surfaces several apps, one per package) #32586 只在 defineStack 判单个包,扁平组合会把各包的应用合到一个包 id 下,没有任何一道门拦。
  • 风险与回滚: 收窄。本仓无产品调用方命中(唯一产品调用 examples/app-multi-package 已用 preserve),7 个 spec 测试夹具与一页入门文档按席位同意的方式改了;hotcrm 的测试视图 test/helpers/composed-stack.ts 是扁平组合,升级到含本改动的版本前要先迁(平台读法卡 runtime: no public reader returns a composed artifact's collections across its packages[] bodies, so a consumer that needs "every collection of the suite" can only compose flat — which #32810 refuses for a suite #32827)。回滚即 revert 本 PR。
  • 先看: packages/spec/src/stack.zod.ts 的 collectComposedSingleAppErrors(及 flatSingleAppFinding / residualSingleAppFinding)与 composeBuiltStacks 第 3c 步;同文件 singleAppFinding / validateSingleApp;packages/spec/src/stack.test.ts 新 describe。
  • 两分钟验证: pnpm --filter @objectstack/spec exec vitest run src/stack.test.ts -t "composeStacks — at most one App",预期 11 条全绿,其中一条是「扁平组合 app 包与 module 包各一应用被拒,点名包、各应用来源与 preserve 改法」。
  • 需要你做的: 无,席位落地(你已选「随 18.4.0 发」)。

席位意见:可以落地。落地头契约复审 PASS 6845646714,CI 全绿,非受管面,随 18.4.0 发版。

What changes

  • composeStacks judges what it puts under each package id (packages/spec/src/stack.zod.ts, new collectComposedSingleAppErrors, called as step 3c of composeBuiltStacks, after the artifact cross-reference pass — the order defineStack runs its cross-reference and single-app refusals in):
    • A flat composition (manifest: 'last', the default, 'first' or an index) of inputs that carry no packages[] keeps one manifest and concatenates every input's apps under it: its result is one package. When that manifest is an app or module package and the result holds two or more apps, it is refused with STACK_SINGLE_APP_VIOLATION (422), header composeStacks single-app validation failed (N issues):. The finding names the package, each app with the input it came from and the remedy, e.g. "A 'module' package must define at most one app, but composeStacks with manifest: 'last' gives package 'com.example.crm.service' 2 ('crm_sales' from 'com.example.crm' (stack #0), 'crm_service' from 'com.example.crm.service' (stack Add metamodel interfaces for ObjectQL/ObjectUI contract #1)): a composition that keeps one manifest puts every input's apps under that one package id. Keep one app per package and compose the packages into one artifact with composeStacks(stacks, { manifest: 'preserve' }), which keeps each package's own id (a flat composition puts every app back under one) — ADR-0019 (app-as-consumer-unit) D3 as amended (a suite may surface several apps, one per package)."
    • Every packages[] body the result carries is judged by its own type, id and apps, under every manifest option.
    • The apps no package body declares (added in 91fca555, answering contract-review should-fix S1 in record 6839703155). A result that carries packages[] registers each body under its own id, and the boot's residual rule (unclaimedTopLevel in @objectstack/metadata, mirrored in this file by isResidualTopLevelItem) registers every top-level app that no body declares under the artifact's manifest id. Under every manifest option those apps are now counted together with the apps of the body that carries that id, and two or more, at least one of them residual, are refused (residualSingleAppFinding). That closes a 'preserve' composition whose input has no manifest but brings an app, which the first head accepted, and it stops counting a nested artifact's flattened copies of its bodies' apps against the kept manifest of a flat composition, which the first head over-refused. A one-app-per-package 'preserve' composition, where every input that defines an app carries a manifest, leaves no residual app and builds as before.
    • A single-input composition is still handed back untouched (the early return), judged only by its own defineStack, and not at all when that input was built with strict: false.
  • defineStack judges every packages[] body too (validateSingleApp now adds collectPackageBodySingleAppErrors), so a hand-assembled artifact whose body defines two apps is refused at the door it enters. The stack's own package is judged as before; the read const type = config.manifest?.type that the manifest.type liveness evidence quotes is unchanged.
  • One finding builder per package (singleAppFinding, for the authored stack and every packages[] body; a composition's result is judged by flatSingleAppFinding and residualSingleAppFinding with the same predicate and constants): review nit N3 — the remedy now names composeStacks(stacks, { manifest: 'preserve' }); review nit N2 — the package-type label is derived from the type (An 'app' package, A 'module' package), not two hard-coded strings. The words "must define at most one app" stay, which packages/cli/test/generate-scaffolds-reach-stack.e2e.test.ts and stack-refusal-envelopes.test.ts match. Nit N1 (the module finding offers no fold remedy) is unchanged. A package with no id (reachable only through strict: false) is printed by its name, as stackLabel does, not as 'undefined' (contract-review nit N4).
  • Records: the StackSingleAppViolationError docblock names its two raise sites; the STACK_SINGLE_APP_VIOLATION ledger comment in error-code-ledger.zod.ts says the same (enum member, family and status untouched); the composeStacks TSDoc and the manifest option's doc state the rule.
  • ADR-0087: a new semantic entry, packages/spec/src/migrations/entries/semantic/18.compose-stacks-flat-second-app-refused.ts (adr-0087: registered compose-stacks-flat-second-app-refused), no D2 conversion — whether the inputs are one package or several, and which app stays where, is the author's call.
  • Changeset .changeset/32810-compose-stacks-single-app.md: @objectstack/spec minor, BREAKING banner, Before / Now / Unchanged / Fix; the Fix names the flat-composition-as-a-test-view usage and its move.
  • Docs: content/docs/getting-started/examples.mdx § Composition Pattern taught composeStacks([CrmApp, TodoApp]), two app packages with an app each composed flat, which this change refuses. It now composes with { manifest: 'preserve' } and says why (added to the claim's file surface by the seat).

Why

ADR-0019 (app-as-consumer-unit) D3 as amended: a suite may surface several apps, each defined by a different package, and no package defines more than one — the Console addresses an app by its package id, read by its id a multi-app package answers as absent, and disabling a module removes the app that module owns. #32586 (merged 9ae829108c) enforced it per authored package in defineStack. On origin/main 2ca09de55, validateSingleApp had one caller (defineStack), and composeStacks concatenated apps under its one selected manifest without judging the result, so the default composition of a suite produced exactly the removed shape, and the #32586 finding's remedy did not say to compose under preserve. Declared means enforced.

Measured: who composes suite packages, and with which manifest option

Read-only. objectstack at 2ca09de55 (the branch point); hotcrm at 8277e61 (shallow clone of main, read-only); the shipped templates are this repo's packages/create-objectstack.

Tree Caller manifest Affected
objectstack 2ca09de55 examples/app-multi-package/objectstack.config.ts:68 (orders module + core app) 'preserve' no — builds unchanged
packages/**/src, ui/** — no call site: the hits are comments and ui/packages/core's deprecated re-export
packages/create-objectstack (one bundled template, blank) — no composeStacks
tests outside packages/spec: 52 files in cli, runtime, metadata, objectql, core, plugin-dev, plugin-security, service-automation, verify flat and 'preserve' no — all green against the new dist (see Verification)
packages/spec tests flat 7 tests in 5 files sat on two apps under one package id: moved, see Tests
content/docs/getting-started/examples.mdx:324 flat yes — rewritten to 'preserve'
hotcrm 8277e61 objectstack.config.ts:56, the artifact (5 packages; sales, service, marketing one app each; revenue, o2c none) 'preserve' no — HotCRM's shape builds unchanged
test/helpers/composed-stack.ts:43, a test view of every collection flat (default 'last') yes — selected manifest app.objectstack.hotcrm (type: 'app') with three apps; refused at module load. 165 of 266 test files load it (158 directly, 7 through test/helpers/flow-regions.ts / stack-picklists.ts; static git grep, not a run). hotcrm pins @objectstack/* 18.3.0, so nothing breaks before it bumps. Its move needs a public reader of a composed artifact's collections (resolveArtifactCollections is internal to @objectstack/runtime): filed by the seat as #32827, to land before or with the release that carries this
cloud — — not in the card's list; not read (no access)

Seat disposition of the measurement: ruled A by the lane seat in the card thread, not yet recorded on the card itself (contract review ③). Narrow as the card orders; the hotcrm move rides #32827 and the hotcrm lane.

Tests

  • packages/spec/src/stack.test.ts, new describe "composeStacks — at most one App per package, judged on what the composition puts under each package id": a flat composition (default 'last') of an app package and a module package with one app each is refused (envelope code, status, one issue, header), naming the package, both apps with their inputs and the preserve remedy; the same under 'first' and index 0, selecting the app package; the same packages under 'preserve' build unchanged, each body carrying its one app; defineStack refuses a hand-assembled packages[] body with two apps, naming the body (packages[0]) and both apps; composeStacks refuses such a body that reached it through strict: false, under 'last' and 'preserve'; controls: a single-input composition is returned by identity, a flat composition whose inputs bring one app is accepted, and a flat composition whose selected manifest is a plugin package is not judged. The existing HotCRM planned-shape pin (preserve of an app package and three modules) is unchanged and green. Added in 91fca555: a 'preserve' composition whose input with no manifest brings an app is refused, naming the package, the body's app, the residual app and the remedy; a flat composition of a nested artifact whose flattened copy repeats its body's app, plus a module with one app, is accepted; a flat composition with a nested artifact and two further modules with an app each is refused, counting only the two residual apps; and a package with no id is named by its name.
  • Moved fixtures (each disposition agreed with the seat before the edit):
    • compose-stacks.test.ts "should compose outputs of defineStack" pinned two app packages' apps under one id (apps length 2), the removed shape: the todo stack now carries no app (objects 2, last-wins manifest kept), and the two-app pair is asserted refused (STACK_SINGLE_APP_VIOLATION, 422).
    • compose-stacks-key-loss.test.ts "concatenates in stack order", compose-key-dispositions-export.pin.test.ts pin 4 (every concat key) and compose-stacks-concat-shape-refusal.test.ts's apps control: the subject is the concat pass, so the selected (last) manifest is a plugin package, which this rule does not judge; a comment beside each says so and says to retype it if a ruling ever holds plugin to one app.
    • compose-stacks-manifest-preserve.test.ts: the flat composition used as the reference (bodiesReproduceFlattened) and as the objectConflict CONTROL now composes a second package with no app (withObjects(…, false)); the apps comparison still reads one app.
  • Ablation, first head (dd30cfb0; the spec tests import src/, so no dist leg), each through scripts/ablation-replace.mjs in WRAP mode, running stack.test.ts, compose-stacks.test.ts and compose-stacks-manifest-preserve.test.ts; every leg restored with git diff HEAD empty and the blob equal to HEAD (b18fea40):
    • A — revert the composeStacks refusal (collectComposedSingleAppErrors(...) → []): 4 red — the flat refusal, 'first'/index, the strict: false body, and the moved compose-stacks.test.ts pin.
    • B — revert the defineStack body judgment: 1 red — the hand-assembled packages[] body.
    • C — revert N3 (remedy without manifest: 'preserve'): 2 red — the flat finding and the body finding.
    • D — mutation: judge the top level under 'preserve' too: 2 red — the preserve control and the existing HotCRM planned-shape pin.
    • E — mutation: the count test loosened from "more than one app" to "at least one app": 5 red — the one-app flat control, the moved integration pin and the three preserve-file references.
  • Ablation, 91fca555, the same way and the same three files, each leg restored to the HEAD blob (93e8d785):
    • F — drop the residual judgment (a result with packages[] returns no finding): 2 red — the preserve residual refusal and the nested-artifact flat refusal.
    • G — mutation: count every top-level app whatever the result carries (the first head's flat rule under every option): 5 red — the existing HotCRM planned-shape pin, the preserve control, the preserve residual refusal (its wording), the nested-artifact acceptance and the nested-artifact refusal (its wording).
    • H — print id alone: 1 red — the package named by its name.

Acceptance notes

Verification

Final head 91fca555: the fix (79650a1a), the fixture moves (dd30cfb0), one merge of origin/main c04aa295db (cf5a8840; it brought 32 files, all under ui/packages/{app-shell,auth,i18n} and .changeset/), and the contract-review fix (91fca555). No further merge of main: the lane seat parked this PR until the 18.4.0 version commit lands.

Each command's exit code was written to disk before any pipe. Heavy runs held scripts/pm/os-verify-lock.sh. All of the following ran on 91fca555:

  • pnpm --filter @objectstack/spec build: exit 0.

  • pnpm --filter @objectstack/spec test: exit 0. 836 of 836 files passed; 26745 tests passed, 1 todo.

  • pnpm --filter @objectstack/spec typecheck: exit 0, including check:test-typecheck.

  • pnpm --filter @objectstack/spec check:generated: exit 0. All 14 generated artifacts are up to date.

  • pnpm exec eslint on the changed .ts files: exit 0, no findings.

  • Gate families from node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack: 119 derived, 119 run, every one exit 0. --ran reconciliation: 0 NOT-MEASURED, 0 UNRUN. This covers check-changeset-no-major and check-adr-0087-registration.

  • Consumers: the 52 test files outside packages/spec that call composeStacks or build a packages[] artifact, run against the @objectstack/spec dist built from this head:

    Package Files Tests Exit
    cli 31 369 0
    core 1 13 0
    metadata 2 38 0
    objectql 1 33 0
    plugin-dev 1 20 0
    plugin-security 1 28 0
    runtime 9 218 0
    service-automation 2 7 0
    verify 2 17 0

    Plus packages/cli's two nightly-tier e2e files, test/build-multi-package-artifact.e2e.test.ts and test/build-package-docs-attachment.e2e.test.ts. These were run with OS_TEST_TIERS=nightly: 2 files, 11 tests, exit 0.

  • Dogfood: pnpm --filter @objectstack/dogfood test, the full battery with no shard or path, after turbo run build --filter='@objectstack/dogfood^...': exit 0. 456 files passed and 3 skipped (459); 3831 tests passed and 42 skipped (3873).

  • Ablation: legs A to E ran on dd30cfb0 and legs F to H on 91fca555, both listed under Tests. Each leg went red on the tests named there and was restored to its HEAD blob.

  • CI on 91fca555: 68 check-runs completed with none failed. On cf5a8840, Type Check · workspace had timed out in its checkout step without measuring anything. On this head it ran its type-check step to success.

  • Contract review: round 1 on cf5a8840 (brief 6839695698, record 6839703155) passed with one should-fix (S1) and five nits. All six were answered in 91fca555. The delta round on 91fca555 (record 6840656371) passed. It found no must-fix and no open should-fix. Its four new nits, N6 to N9, are wording and dead-fallback points under packages/spec/src, left as accepted deviations.

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

🤖 Generated with Claude Code

https://claude.ai/code/session_01L6bhgWcBCVseHddrok9Ndf

…ckage id to at most one app

A flat composition (manifest 'last', 'first' or an index) keeps one manifest
and concatenates every input's apps under it, so an app package and a module
package with one app each became one package id with two apps. composeStacks
now refuses that with STACK_SINGLE_APP_VIOLATION, naming the package, each app
with its input and the manifest: 'preserve' remedy; defineStack and
composeStacks judge every packages[] body by the same rule. The defineStack
finding names the preserve remedy and derives its package-type label from the
type.

Claude-Session: https://claude.ai/code/session_01L6bhgWcBCVseHddrok9Ndf
Co-authored-by: Claude <noreply@anthropic.com>
…package id; docs example composes under preserve

The concat-mechanics pins compose with a selected plugin manifest, the
preserve reference fixtures give the second package no app, and the
composeStacks plus defineStack integration pin now asserts that two app
packages with an app each are refused flat. The getting-started composition
example composes CRM and Todo with manifest: 'preserve'.

Claude-Session: https://claude.ai/code/session_01L6bhgWcBCVseHddrok9Ndf
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/m 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 12, 2026
@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/spec, touching 15 documentable anchor(s).

4 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:

  • content/docs/api/client-sdk.mdx (via ERROR_CODE_LEDGER (symbol, a top-level const object))
  • content/docs/api/error-catalog.mdx (via ERROR_CODE_LEDGER (symbol, a top-level const object))
  • content/docs/api/error-handling-server.mdx (via ERROR_CODE_LEDGER (symbol, a top-level const object))
  • content/docs/kernel/contracts/data-engine.mdx (via ERROR_CODE_LEDGER (symbol, a top-level const object))

⛔ 3 release-owned page(s) also name something this change touched. These are read-only:

  • content/docs/releases/v17/17-0.mdx (via ERROR_CODE_LEDGER (symbol, a top-level const object))
  • content/docs/releases/v17/17-1.mdx (via ERROR_CODE_LEDGER (symbol, a top-level const object))
  • content/docs/releases/v17/17-4.mdx (via ERROR_CODE_LEDGER (symbol, a top-level const object))

content/docs/releases/ is RELEASE-OWNED (AGENTS.md "Documentation Guardrails"): release
notes are written centrally at release time, and a code PR that edits them is the exact PR
that guardrail exists to stop. They are still audited — read-only. If one of them is actually
wrong, file an issue or open a dedicated docs-only PR; do not edit it here.

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

Which tree this was computed on

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

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

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

…er the artifact's manifest id, as the load path registers them

A result that carries packages[] registers each body under its own id, and the
boot's residual rule registers every top-level app no body declares under the
artifact's manifest id. The composed judgment now follows that: under every
manifest option, those residual apps are counted together with the apps of the
body that has the manifest id. A preserve composition whose input has no
manifest but brings an app is refused, and a flat composition of a nested
artifact whose flattened copy repeats its bodies' apps is no longer counted
against the kept manifest.

Also from the contract review's nits: findings print a package with no id by
its name, the docblocks say which door judges what (strict: false inputs
included), the composeStacks example names this refusal, and the semantic
entry says that under preserve the artifact identity is the last input's.

Claude-Session: https://claude.ai/code/session_01L6bhgWcBCVseHddrok9Ndf
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/l and removed size/m labels Nov 13, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:spec#2 · os-sales · session_01L6bhgWcBCVseHddrok9Ndf

Contract review brief — PR #32898 @ cf5a8840c971909a859314ddfa2f91076e63be4b (card #32810)

You review at CONTRACT_REVIEW_TIER. Render ONE ## Contract review record on this head — its shape is
node scripts/pm/record-recognisers.mjs --template --paths packages/spec/src/api/error-code-ledger.zod.ts packages/spec/src/migrations/entries/semantic/18.compose-stacks-flat-second-app-refused.ts packages/spec/src/stack.zod.ts — with a PASS or FAIL verdict, and post it as ONE comment
on the PR or its card.

Inputs — these and nothing else:
· card #32810: its body and EVERY comment (rulings and earlier records included)
· PR #32898: its body, its file list, and the net diff against main at cf5a8840c971909a859314ddfa2f91076e63be4b
· the check-runs on cf5a8840c971909a859314ddfa2f91076e63be4b: their conclusions ARE the gate verdicts
⛔ Not the dispatch order, ⛔ not the dispatching seat's own conclusions — this brief is adversarial by design.

Scope — the paths reviewFace returns as hits on this PR's file list: packages/spec/src/api/error-code-ledger.zod.ts, packages/spec/src/migrations/entries/semantic/18.compose-stacks-flat-second-app-refused.ts, packages/spec/src/stack.zod.ts;
plus every file IN THIS DIFF that directly implements or enforces them — the gate that enforces a rule, the code
a jsdoc or schema line describes, the validator a skill teaches — reviewed for agreement with the contract.
Widen it freely, ⛔ never below hits; the record's Scope: line names the implementing files apart from hits.
The rest of the diff (tests, unrelated modules, lockfiles, generated output, changesets) is the lane seat's
ACCEPT at TIER_DEFAULT, exactly as a standalone PR of those files.
④ judges the hits files and those implementing files ONLY:
lockfiles, generated output, changesets and prose elsewhere in the PR are not reviewed;
code outside the diff is READ to judge them, never reviewed.

⛔ READ-ONLY. No worktree, no checkout, no build, no test run, no gate re-run, no ablation: the check-runs
on the head already answered every derived gate family, and a local run costs more than it returns.
If ONE probe is unavoidable, the record's Local-runs: line says probe — REASON; otherwise none.
Scratch space is /tmp/claude-0/-home-user/6e75bbcc-4a4c-5619-8f0a-c202ed2ad733/scratchpad/pr-32898/ alone; nothing there you did not write this round is read.

Judge, in the record's own sections:
① Derived judgments — every accept-set and public-surface change the diff implies, each named right or wrong.
② Semver level — the changeset (or skip-changeset) matches what the diff publishes, and the Clause-②: line.
③ Boundary flags — every dev flag and every open_questions entry answered, or escalated.
④ Design judgment — for EVERY hits file: does the change hold against the code it cites and the
scenario it is accepted against? A skill file against the card's eval prompt and the spec it teaches
on main; a schema file against the ruling or ADR it implements and its first consumer; an ADR
against its first consumer and its execution plan. For EVERY implementing file in the diff: does the
code agree with the contract, sentence by sentence? Read the cited code in the live tree, and try to
break the design.
Grade each finding must-fix, should-fix or nit — a nit has no effect on correctness or the contract.
A must-fix is a FAIL; a must-fix or should-fix earns a delta review of its fix; nits alone end the round.
A nit is fixed only on the prose faces, or left as an accepted deviation or a follow-up card: a fix
anywhere else moves the head, and this record no longer covers it.
⛔ Judge the tree, never the PR body's account of it.
Sign Implemented-by: with the dev's branch and Reviewed-by: with your session id — the value is the FIRST
thing after each colon.

Head facts, for you to verify, not to adopt:
· Net diff: git diff c04aa295db900486337e4a32255324ea43b03960 cf5a8840c971909a859314ddfa2f91076e63be4b (the merge base with main; the head merged main once at that commit).
· Check-runs on the head: 68. Two concluded failure: Type Check · workspace (job 131554007825) and TypeScript Type Check (job 131564106104, the type-check lane aggregator). Read both jobs' steps and logs yourself and judge what they measured.
· The lane seat parked this PR until a release version commit lands. It will not be readied, queued or re-merged with main before then.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:spec#2 · os-sales · session_01L6bhgWcBCVseHddrok9Ndf

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: cf5a8840c971909a859314ddfa2f91076e63be4b
Local-runs: none
Scope: packages/spec/src/api/error-code-ledger.zod.ts, packages/spec/src/migrations/entries/semantic/18.compose-stacks-flat-second-app-refused.ts, packages/spec/src/stack.zod.ts + none

Read for this record: card #32810 (body and its six comments), PR #32898 (body, its 11 files, the net diff from merge base c04aa295 to the head, the 68 check-runs, and the steps and logs of both failed jobs). The implementation sits wholly inside the three hits files, so the second half of Scope: is empty. The tests, the changeset and the docs page of the diff were read as evidence and stay the lane seat's ACCEPT. Code outside the diff was read, never reviewed: packages/core/src/artifact-packages.ts, packages/metadata/src/plugin.ts, packages/runtime/src/artifact-collections.ts, packages/runtime/src/app-plugin.ts, ADR-0019, ADR-0130 and the neighbouring semantic entry of the same rule line.

① Derived judgments

  1. composeStacks, two or more inputs, a flat option ('last', 'first', an index), selected manifest of type app or module, two or more entries in the composed apps: newly refused, STACK_SINGLE_APP_VIOLATION, 422. Right wherever the result carries no packages[]: by ADR-0130 D4's second branch the whole artifact is then one package, and ADR-0019 D3 as amended removes a package that defines several apps. Where the result does carry packages[], see ④ S1.
  2. composeStacks, every option: a packages[] body of type app or module with two or more apps is newly refused. Right: each body registers under its own id (resolveArtifactPackageEntries).
  3. defineStack, strict: the same body rule, newly refused. Right, and declared in the changeset and in the ADR-0087 entry. The non-strict path is unchanged.
  4. defineStack, the stack's own package: the predicate is unchanged (the read config.manifest?.type that the liveness evidence quotes, more than one entry in apps). The finding text changes: the remedy names composeStacks(stacks, { manifest: 'preserve' }) and the type label is derived from the type. The words "must define at most one app" remain. Right, card Work 3.
  5. Envelope: no new code, class or status. A second raise site with the header composeStacks single-app validation failed (N issues):, one string per finding on issues, wrapped by withRefusalConversions like every other composeStacks refusal. The ledger's enum member, family and position are untouched (comment only). Right, and it follows the precedent STACK_CROSS_REFERENCE_INVALID set: two raise sites, one code, the header naming the pass.
  6. Not moved, read in the tree: a 'preserve' composition whose inputs all carry a manifest and one app or none; a single input (returned before the options are parsed); zero inputs; a selected manifest that is absent or of another type; strict: false at defineStack. No export is added or removed, and ComposeStacksOptionsSchema keeps its shape (TSDoc only), so no generated reference moves.
  7. ADR-0087: registered compose-stacks-flat-second-app-refused, a semantic entry with no D2 conversion. Right: which app stays in which package is not derivable.

② Semver level

.changeset/32810-compose-stacks-single-app.md grades @objectstack/spec minor. That matches what the diff publishes: one package moves, and a Metadata-protocol: narrowed kind takes at least minor (AGENTS.md, Post-Task Checklist step 3). The Clause-② declaration reads no (narrowing) in the PR body and in the changeset, and it is the right arm: the accept set of two exported functions narrows and nothing widens. The changeset carries the BREAKING banner, the Before, Now, Unchanged and Fix paragraphs, and exactly one ADR-0087 marker, whose name equals the entry's id. Check Changeset concluded success on the head.

③ Boundary flags

  • The two failed check-runs measured nothing about this diff. Type Check · workspace (job 131554007825) timed out in step 2, Checkout repository, after 20 minutes inside git fetch. Every later step was skipped, among them Type check workspace packages and the CLI transcript check. The closing Lane verdict step then exited 1 because scripts/ci/lane-verdict.mjs was not on disk: the tree was never checked out. TypeScript Type Check (job 131564106104) is the aggregator. It printed ok for the other three lanes and failed on typecheck-workspace alone. Of the remaining 66 check-runs, ten are skipped (opt-in or path-gated lanes, the dogfood shards among them) and the rest concluded success.
  • What that leaves unanswered on this head. The per-package typecheck task of the affected packages. For @objectstack/spec the source half is answered: Type Check · source gates concluded success and its step Type check (@objectstack/spec) runs tsc --noEmit. The test half is not: check:test-typecheck is part of the package's typecheck script, and its debt file lists three test files this diff edits (stack.test.ts, compose-stacks.test.ts, compose-stacks-key-loss.test.ts). The dependents' tsc --noEmit is not answered either. Escalated to the lane seat: the job is re-run to a real verdict before the PR is readied. This record does not read the lane as green.
  • Author. The PR's user.login is objectstack-fleet[bot]; no separate author note is owed.
  • Branch name. Answered by the restated claim, comment 6836152532.
  • Both doors judge packages[] bodies. Answered by card Work 2.
  • The top level of a 'preserve' composition is not judged. Not answered as the PR states it: ④ S1.
  • plugin and the other types are not judged, and a flat composition whose selected manifest is a plugin takes every input's apps under that id. Answered by card Work 4: out of scope here, a decision card if the lane wants it. For that card: the new control test and three moved fixtures (retyped to a plugin manifest) now pin this shape as accepted.
  • The object and action conflict arms are untouched. Verified in the diff: the hunks are the single-app helpers, one class docblock, the option's TSDoc, the composeStacks TSDoc and step 3c.
  • File surface. All 11 files fall inside the claim as restated in comment 6836576990.
  • hotcrm. The measurement found one caller this change refuses, the flat test view in hotcrm's test/helpers/composed-stack.ts. Its route depends on runtime: no public reader returns a composed artifact's collections across its packages[] bodies, so a consumer that needs "every collection of the suite" can only compose flat — which #32810 refuses for a suite #32827, which is open with no PR. The PR body says the seat ruled this "A" in the card thread; card spec: a flat composeStacks (default manifest 'last') of packages with one app each yields one package id with several apps, and no door refuses it (the single-app rule of ADR-0019 D3 as amended) #32810 carries no such comment. Escalated to the lane seat: put the disposition on the card, and land runtime: no public reader returns a composed artifact's collections across its packages[] bodies, so a consumer that needs "every collection of the suite" can only compose flat — which #32810 refuses for a suite #32827 no later than the release that carries this change, because the changeset's Fix paragraph names the reader that card adds.
  • Skills-docs follow-up. skills/objectstack-ui/SKILL.md is answered by comment 6837415956 (the skills lane takes it when the card lands). skills/objectstack-platform/references/bootstrap.md has no card among the inputs; the PR body says the seat files it. Escalated to the seat.
  • open_questions. The PR body raises none.

④ Design judgment

packages/spec/src/stack.zod.ts, judged against ADR-0019 D3 as amended, ADR-0130 D4, D6 and the 2026-09-22 addendum, the card's acceptance, and the first consumer of what it emits, the load path.

What holds:

  • The card's three acceptance sentences. A flat composition of an app package and a module package with one app each is refused with a finding that names the package, each app with its input, and the 'preserve' remedy. A 'preserve' composition of one app per package is not touched: under that option only bodies are judged, and each holds one app. The HotCRM shape (an app package and modules, each with a manifest) takes the same path.
  • selectManifest agrees with the finding: 'first' and 'last' skip an input with no manifest, an index reads that slot only, and a slot with no manifest leaves the result without one, which is not judged, as before.
  • The body walk reads the list the result really carries: the concatenated packages under a flat option, the preserved entries under 'preserve'. In strict defineStack it reads the parsed data, so a body's apps is an array there.
  • Step 3c runs after the manifest, the apps concatenation and the preserved entries exist, and after the artifact pass, the order defineStack uses.
  • The header, code, status and issues agree with the class docblock, the ledger comment and the existing defineStack site.

S1 · should-fix · the top level is judged by the manifest option, while the load path decides by whether the result carries packages[]. collectComposedSingleAppErrors skips the top level under 'preserve' and gives this reason: the load path registers the bodies and only the bodies, and the flattened collections beside them, where the emitter keeps any, are a copy of the bodies'. The tree disagrees with both halves.

  • packagesCarryEveryInputCollection, in the same file, keeps the flattened half exactly where it is not a copy: an input with no manifest, and an input that carries packages plus collections of its own. compose-stacks-manifest-preserve.test.ts pins both ("keeps the flattened copy when an input has NO manifest to own its collections", "keeps the flattened copy when a packages-carrying input declares collections of its own").
  • The residual rule (unclaimedTopLevel and MetadataPlugin.registerUnclaimedTopLevel in packages/metadata/src/plugin.ts, called by both boot doors) registers every top-level item that no body declares under the stack's own manifest.id, and apps is in its field map. Under 'preserve' that manifest is the last input's, and that package's body already carries its own app.

So composeStacks([appPackage, extras], { manifest: 'preserve' }), where appPackage defines one app and extras is a stack with no manifest that defines one app, is accepted, and at load the app package's id owns two apps. That is the shape the rule removes, and the Console reaches the second app only by name. Composed flat, the same two inputs are refused, and the finding prescribes exactly that 'preserve' call. The same holds for an input that carries packages[] and an app of its own, for example the result of a flat composition this door accepted.

The mirror case over-refuses. Under a flat option, an input that carries packages[] together with flattened copies (a 'preserve' result that kept the additive shape) brings apps its bodies own. The door counts them against the selected manifest and says the composition gives that package N apps, while at load each registers under its body's id and only the unclaimed ones go to the manifest id. The remedy it names still works there, so that half is a wrong sentence, not a wrong prescription.

Owed, one of two. Either judge what registration puts under the artifact's manifest id under every option; the inputs that are assembled into no body are the two cases packagesCarryEveryInputCollection already walks. Or correct the docblock, the composeStacks TSDoc sentence "the result is held to ADR-0019 D3 as amended" and the reach of the remedy, and card the residual route for the door that reads unclaimedTopLevel. Either one moves the head and earns a delta review.

Nits, none of which changes what is accepted or refused:

  • N1 · nit. The collectComposedSingleAppErrors docblock says each input passed its own defineStack with one app, and that a single input's own defineStack already judged it. Neither is true of an input built with strict: false, which defineStack does not judge and the single-input return hands back unjudged. The boundary itself is the declared one.
  • N2 · nit. The singleAppFinding docblock says every door judges a package through it, a composed result included. The flat branch restates the predicate inline and writes its own sentence; only the constants are shared.
  • N3 · nit. The composeStacks @example still opens with a flat composeStacks([crm, todo]) as the simple case, and its comment lists what that call throws on without this refusal.
  • N4 · nit. A finding names a package by id alone, so a manifest or body that has a name and no id (reachable only through strict: false) prints as 'undefined', while stackLabel in the same finding and the load path fall back to name.

packages/spec/src/api/error-code-ledger.zod.ts, judged against the class it describes and the rows around it. The added comment agrees with the code sentence by sentence: two raise sites, one rule, and the door: 'none' reading holds, because composeStacks has no call site under packages/*/src outside packages/spec, and the defineStack calls there are a shipped template config, a verify fixture and the downstream-contract stack, none behind an HTTP handler; packages/runtime/src and packages/rest/src hold neither. No finding.

packages/spec/src/migrations/entries/semantic/18.compose-stacks-flat-second-app-refused.ts, judged against ADR-0087 D3, the SemanticMigration type and the neighbouring entry 18.module-package-second-app-refused.ts. surface, reason and acceptanceCriteria agree with the code and with ADR-0019's three reasons, and the strings carry no tracker number.

  • N5 · nit. replacement says the artifact's manifest is "still the last input's". That is true of the default. A composition that used 'first' or an index, both named in surface, and follows the entry gets the last input's manifest as the artifact's, a different artifact identity from the one it had (ADR-0130 D6), unless it reorders its inputs. The entry does not say so.

Grades: S1 should-fix; N1 to N5 nit. No must-fix. The nits sit under packages/spec/src, so they are left as accepted deviations unless they ride the S1 change.

Implemented-by: claude/project-thread-2eliu6
Reviewed-by: session_01L6bhgU7jN46DmQ6XFvz28s

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:spec#2 · os-sales · session_01L6bhgWcBCVseHddrok9Ndf

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 91fca555334a5988a46d0f736f95ec24b69a1a80
Local-runs: none
Scope: packages/spec/src/api/error-code-ledger.zod.ts, packages/spec/src/migrations/entries/semantic/18.compose-stacks-flat-second-app-refused.ts, packages/spec/src/stack.zod.ts + none

This is a delta round. It follows record 6839703155, rendered on cf5a8840, and covers the one commit between that head and this one: five files, the three hits files plus stack.test.ts and the changeset. It judges whether that commit answers S1 and the nits N1 to N5, and what the commit newly accepts or refuses. Everything else in record 6839703155 stands as written there.

Read for this round: the diff from cf5a8840 to the head, the 68 check-runs on the head and the steps of the Type Check · workspace job, card #32810 (still six comments, none added since the first round) and card #32827. The PR body was written for cf5a8840 and is not judged against this head. The tests and the changeset were read as evidence and stay the lane seat's ACCEPT. Code outside the diff was read, never reviewed: packages/metadata/src/plugin.ts (unclaimedTopLevel, artifactItemSlot, claimedArtifactSlots, registerUnclaimedTopLevel), packages/core/src/artifact-packages.ts, and in stack.zod.ts the unchanged isResidualTopLevelItem, residualSlotOf, preservePackageEntries, packagesCarryEveryInputCollection, validateSingleApp and steps 1 to 8 of composeBuiltStacks.

① Derived judgments

  1. composeStacks now reads the top level of its result by whether the result carries packages[], under every manifest option, and no longer by the option. Right: that is the question the load path asks (ADR-0130 D4, unclaimedTopLevel).
  2. Newly refused relative to cf5a8840: a result that carries packages[] and keeps a manifest of type app or module, where the apps of the body with that manifest's id plus the top-level apps that no body declares come to two or more, at least one of them undeclared. Under 'preserve' that is an input with no manifest that defines an app, or a nested artifact with an app of its own, beside the last input's own app. Under a flat option it is the apps of the inputs composed beside a nested artifact. Right: the residual rule registers each such app under the artifact's manifest id, beside that package's own. Same code STACK_SINGLE_APP_VIOLATION, 422, same composeStacks header.
  3. Newly accepted relative to cf5a8840: a flat composition with a nested artifact among its inputs, whose top-level apps come to two or more only because the nested artifact's flattened copy repeats apps its bodies declare. Right: those apps register under their bodies' ids. main accepts this shape too, so the net narrowing against main shrinks here.
  4. A result with no packages[]: unchanged from cf5a8840. Every app counts against the one kept manifest.
  5. A finding now prints a package by its id, else its name. Text only.
  6. Not moved by this commit: the envelope (code, class, status, header, issues), the ledger enum (comment only), the shape of ComposeStacksOptionsSchema (TSDoc only), every export, the defineStack predicate, a single input, zero inputs, a kept manifest that is absent or of another type.
  7. Reach in this tree: outside tests, the one call of composeStacks under 'preserve' is in examples/app-multi-package/objectstack.config.ts, and both of its inputs carry a manifest, so the wider refusal of item 2 does not reach it.
  8. ADR-0087: still one semantic entry and no conversion. Its surface, replacement and reason now state the case of item 2.

② Semver level

Unchanged and still right: @objectstack/spec minor, the BREAKING banner, the no (narrowing) arm of the Clause-② declaration, the Metadata-protocol: narrowed kind, and one ADR-0087 marker whose name equals the entry's id. This commit widens the narrowing by item 2 of ①, and both prose faces declare it: the changeset's Before, Now, Unchanged and Fix paragraphs, and the entry's surface. A wider narrowing inside a minor that already declares a narrowing needs no higher level. Check Changeset concluded success on the head.

③ Boundary flags

④ Design judgment

packages/spec/src/stack.zod.ts, judged against the load path it now cites, ADR-0130 D4 and D6, and ADR-0019 D3 as amended.

S1 is answered, and the answer holds. The commit took the first of the two routes the first record offered: it judges what registration puts under the artifact's manifest id, under every option. Read against the load path, piece by piece:

  • Which apps. residualSingleAppFinding asks the existing mirror, isResidualTopLevelItem. For apps the mirror claims by name, as artifactItemSlot and claimedArtifactSlots do for any item that is not a view container, and an app with no name has no slot on either side. It is the function the owner-stamp gate already uses, and a @objectstack/metadata test holds it equal to the rule it mirrors.
  • Which id. manifest.id, the first operand of unclaimedTopLevel's ownerId.
  • Which bodies. The entries of the packages the result really carries at step 3c: the concatenated list under a flat option, the preserved list under 'preserve'.
  • When. Step 3c runs before step 8 removes the flattened copy, and the order does not matter. Step 8 removes it only when packagesCarryEveryInputCollection holds, which is exactly when no input brings an undeclared app. The walk reads each input's own apps, the arrays step 3 concatenated.
  • The hole of the first record. composeStacks([appPackage, extras], { manifest: 'preserve' }), where extras has no manifest and defines an app, is refused. The finding names both apps and where each came from. A test pins it.
  • The mirror over-refusal. A flat composition of an additive nested artifact and one more package is accepted, and the same with two more packages is refused naming only the two undeclared apps. Tests pin both.

Tried against it, each with the outcome registration gives:

  • Duplicate body ids. With an undeclared app present, the apps of every body with the manifest's id are counted. With none, the door accepts and resolveArtifactPackageEntries refuses the artifact at load with DUPLICATE_ARTIFACT_PACKAGE. No package ends with two apps.
  • Undeclared apps with no name. They have no slot, so they are not counted, and no door registers them.
  • A kept plugin manifest with undeclared apps. Not judged, as before; ③.
  • Nesting, several levels. A 'preserve' composition of an app package and a module package (flattened copy removed); then flat with a third package: accepted, one undeclared app under the third's id. That result under 'preserve' with a fourth app package placed last: refused, the fourth's own app plus the undeclared one. The same two inputs in the other order: accepted, the undeclared app is alone under the kept module id. That result flat with a fifth package: refused, two undeclared apps under the fifth's id. All four verdicts match what the residual rule would register.
  • An index that selects an input with no manifest. The result keeps no manifest, neither branch runs, and the bodies are still judged. At load the undeclared apps register under no package id. This is the changeset's "a composition that keeps no manifest".
  • An empty packages: [] on an input. The result carries the key, no body claims anything, every top-level app counts against the kept manifest. unclaimedTopLevel reads it the same way.
  • One package, two findings. A body with two apps plus an undeclared app yields the body finding and the residual finding. Both are true.
  • Two undeclared apps of one name. Counted as two, while the registry keeps one slot. The flat branch counts entries the same way, and two definitions for one slot under one package id are no shape to accept. Observation only.

The nits of the first record:

  • N1. Addressed. The docblock now says a single input is judged by nothing but its own defineStack, and by nothing at all when it was built with strict: false.
  • N2. Addressed. The singleAppFinding docblock now limits itself to the authored stack and the bodies, and sends the composed case to collectComposedSingleAppErrors.
  • N3. Addressed. The @example comment lists the single-app refusal for the plain call.
  • N4. Addressed. singleAppPackageLabel falls back to name at all four print sites, and a test pins it.

New in this round, none of which changes what is accepted or refused:

  • N6 · nit. The collectComposedSingleAppErrors docblock says that under 'preserve' every input with a manifest is assembled into a body of its own. That is not true of an input that carries a manifest and packages[]: preservePackageEntries carries its entries and assembles its own manifest into no body. The last clause of the same sentence names that input as a source of undeclared apps, so the paragraph's conclusion is right.
  • N7 · nit. The residual finding has one sentence for two shapes. When no body has the kept manifest's id (the flat case the third new test pins), "beside the apps of that package's own body" refers to nothing, and the first remedy clause, a manifest for each input, is already met. The clause that helps is the last one, and the remedy as a whole works.
  • N8 · nit. manifest.id ?? composed.id copies the load path's expression, but at step 3c no top-level id exists on the result: step 5 composes the remaining keys later, and id is not a declared stack key. The second operand reads nothing there. No effect, since a manifest that passed the strict parse always has an id.

packages/spec/src/api/error-code-ledger.zod.ts. The comment now lists three things judged at composeStacks: a flat composition's one selected manifest, each body, and the artifact's manifest id with the top-level apps no body declares. It agrees with the code. No finding.

packages/spec/src/migrations/entries/semantic/18.compose-stacks-flat-second-app-refused.ts. replacement and reason agree with the code.

  • N5. Addressed. replacement says that under 'preserve' the artifact's manifest is the last input's, and that a composition which selected another input's manifest reorders its inputs to keep its identity. The changeset says the same.
  • N9 · nit. surface is inexact at two corners. Its new clause describes an undeclared app "while the package of the artifact's manifest id already defines one"; the code also refuses two undeclared apps under a kept manifest whose own package defines none, for example two inputs with no manifest and an app each, composed under 'preserve' with a module package that has no app. Its first clause still reads "the inputs bring two or more apps" for a flat option, which now includes the accepted case of item 3 in ①. The finding itself is exact in both.

Grades: S1 answered, no should-fix open; N1 to N5 addressed; N6 to N9 nit. No must-fix. The new nits sit under packages/spec/src, where a fix moves the head, so they are left as accepted deviations, or ride the follow-up card of ③.

Implemented-by: claude/project-thread-2eliu6
Reviewed-by: session_01L6bhgU7jN46DmQ6XFvz28s

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:spec#2 · os-tesla · session_01L9qibvfX5bawZKtfa6u7j9

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 16e4c087248237dfd5e77d81044b204426f51191
Local-runs: none
Scope: packages/spec/src/api/error-code-ledger.zod.ts, packages/spec/src/compose-key-dispositions-export.pin.test.ts, packages/spec/src/compose-stacks-concat-shape-refusal.test.ts, packages/spec/src/compose-stacks-key-loss.test.ts, packages/spec/src/compose-stacks-manifest-preserve.test.ts, packages/spec/src/compose-stacks.test.ts, packages/spec/src/migrations/entries/semantic/18.compose-stacks-flat-second-app-refused.ts, packages/spec/src/stack.test.ts, packages/spec/src/stack.zod.ts + docs/adr/0019-app-as-consumer-unit.md, docs/adr/0130-release-artifact-as-co-ownership-boundary.md, packages/runtime/src/artifact-collections.ts, packages/runtime/src/index.ts, packages/runtime/src/artifact-collections.public-reader.test.ts, packages/cloud-connection/src/marketplace-install-local-jobs.test.ts, examples/app-multi-package/objectstack.config.ts, skills/objectstack-ui/SKILL.md (read, not reviewed)

Landing-head round. The head merges main c54a23d2 (81 first-parent commits since c04aa295) into 91fca555. The net diff against main is line for line the diff records 6839703155 and 6840656371 judged (11 files, +613 −35). This record judges what main brought.

① Derived judgments

  1. The accept-set changes are the ones the earlier records named, each still right. composeStacks refuses a flat result that puts two or more apps under one app or module manifest. Under every option it refuses a packages[] body with two apps, and undeclared top-level apps beside the manifest-id body's own. Strict defineStack refuses a two-app body. Same code and 422; no export, enum member or schema shape moves.
  2. main did not touch stack.zod.ts, packages/metadata/src/plugin.ts or packages/core/src/artifact-packages.ts since c04aa295, so the residual rule the new code mirrors is unchanged.
  3. No new caller is refused. The only non-test composeStacks call at the head is still examples/app-multi-package/objectstack.config.ts:68, under 'preserve'. The tests main added compose under 'preserve' with one app or none per package, or flat with no apps: artifact-collections.public-reader.test.ts takes its flat baseline without apps; marketplace-install-local-jobs.test.ts:576 has a manifest-less input with no app.
  4. No collision in the records. Semantic entry ids are unique at the head; main added six 18.* entries, none on this surface. main's ledger edit is at another row. @objectstack/spec is still 18.3.0, so the 18. prefix holds.

② Semver level

@objectstack/spec minor with the BREAKING banner matches what the diff publishes. Clause-②: no (narrowing) is the right arm: two exported functions narrow and nothing widens. There is one ADR-0087 marker, equal to the entry id. Check Changeset concluded success on this head.

③ Boundary flags

④ Design judgment

The narrowing makes the spec's own refusal real and takes no declared capability away. ADR-0019 D3 as amended, on main, removes a package that defines more than one app; its note names exactly these two shapes (a flat composeStacks of one-app packages and a hand-built packages[] body) as not yet judged and points at this card. The use a flat composition served beyond that, one view of a suite's collections, is delivered on main by the public reader, so it is implemented, not narrowed at the consumer.

Tried against the tree at this head: a new product caller composing flat with two apps (none); a main fixture with a manifest-less input that brings an app under 'preserve' (none); the reader's output composed again (its top-level apps are body-declared, not residual, so accepted); a changed load-path rule that would make the mirror disagree (files unchanged).

No must-fix and no should-fix. N6 to N9 of record 6840656371 stand as accepted deviations. New nits:

Implemented-by: claude/project-thread-2eliu6
Reviewed-by: subagent of session_01L9qibvfX5bawZKtfa6u7j9

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:spec#2 · os-tesla · session_01L9qibvfX5bawZKtfa6u7j9

维护者速读

  • 改了什么:composeStacks 扁平组合若把两个以上应用放到同一个 app/module 包 id 下,现在拒收(STACK_SINGLE_APP_VIOLATION,422),报错点名包 id、各应用来源和 manifest: 'preserve' 改法;defineStack 与 composeStacks 也按同一规则判每个 packages[] 包体和未被包体声明的顶层应用。
  • 为什么改:ADR-0019 D3 要求一个包至多一个应用,扁平组合是最后一个没被拦的形状。
  • 风险与回滚:收窄,minor + BREAKING 说明。本仓唯一产品调用已用 preserve;hotcrm 锁在 18.3.0,升级到 18.4.0 时按 changeset 迁移(读取器 resolveArtifactCollections 已在 main)。回滚即 revert。
  • 先看:packages/spec/src/stack.zod.ts 的 collectComposedSingleAppErrors 与 composeBuiltStacks 第 3c 步。
  • 两分钟验证:pnpm --filter @objectstack/spec exec vitest run src/stack.test.ts -t "composeStacks — at most one App",预期全绿。
  • 需要你做的:无。你已在决策卡选「随 18.4.0 发」。

席位意见:可以落地。

席位核对

ACCEPT · seat domain:spec#2 · head 16e4c087 · 2026-11-13T06:42Z

  1. Shape: Fixes #32810 (first content line; no other closing keyword in the body), draft, base main, 11 files, +613/−35; changeset .changeset/32810-compose-stacks-single-app.md (@objectstack/spec minor, BREAKING banner). Clause-②: no (narrowing), Metadata-protocol: narrowed, matching claim 6845568919. Head 16e4c087 = relay pr_update_branch merge of main c54a23d2 into 91fca555; the PR's own hunks are unchanged.
  2. Premise: runtime: no public reader returns a composed artifact's collections across its packages[] bodies, so a consumer that needs "every collection of the suite" can only compose flat — which #32810 refuses for a suite #32827 merged (PR feat(runtime): export resolveArtifactCollections, the reader of every collection of a composed suite #32928); resolveArtifactCollections exported at packages/runtime/src/index.ts:351 on this head (seat re-read). The only non-test composeStacks call is examples/app-multi-package/objectstack.config.ts:68, under 'preserve' (seat re-read).
  3. Contract review: owed at CONTRACT_REVIEW_TIER (narrowing face + packages/spec/src/**). Full review PASS 6839703155 (cf5a8840), delta PASS 6840656371 (91fca555), landing-head PASS 6845646714 (16e4c087, isolated subagent; seat spot-checked its reader, caller and SKILL.md claims). No must-fix or should-fix.
  4. Gates / check-runs: on head 16e4c087: 72 runs, 60 success, 12 skipped, 0 failed, 0 running; mergeable_state clean; Dogfood Regression Gate success (the ! / narrowing rule). K = 3 first-party commits since this head's base: under 15, no new locale pack.
  5. Accepted deviations and out-of-scope findings: N6–N9 (6840656371) accepted deviations. N10 (examples.mdx "flattens" sentence) | Acceptance notes. N11 (changeset could name resolveArtifactCollections) | Acceptance notes. N12 (ADR-0019 note goes stale) | folded into skills: bootstrap.md teaches composeStacks without saying a suite composes under manifest 'preserve', now that a flat composition with two or more apps under one app or module package is refused #32977, comment 6846119916. Skills SKILL.md § App Navigation preserve remedy | folded into skills: bootstrap.md teaches composeStacks without saying a suite composes under manifest 'preserve', now that a flat composition with two or more apps under one app or module package is refused #32977 (same comment); PR body Skills-docs: line corrected by the seat. spec: strict defineStack counts every top-level app of a packages[]-carrying stack against the stack's own manifest, while composeStacks and the load path count only the apps no body declares #32978 (strict defineStack on an additive packages[] artifact) | filed spec: strict defineStack counts every top-level app of a packages[]-carrying stack against the stack's own manifest, while composeStacks and the load path count only the apps no body declares #32978, dispatched after this lands.
  6. Landing: not governed (check-governed-merges --pr 32898: 0 of 11 paths), 648 changed lines ≤ 3000. Maintainer ruling 6845568919 (「随 18.4.0 发」) lifts the release hold. The seat readies the PR and arms auto-merge under the maintainer's standing words 「车道经理应该使用 pm-dispatch 技能审核和落地pr」 and 「你应该是使用 pm-dispatch 技能自主审核和落地 pr」.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 13, 2026 06:42
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 13, 2026
Merged via the queue into main with commit 0b23b2a Nov 13, 2026
73 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-2eliu6 branch November 13, 2026 07:15
scbdzhwl pushed a commit to scbdzhwl/objectstack-analysis that referenced this pull request Nov 16, 2026
…ition of two apps under one package is refused (objectstack-ai#33475)

<!-- claude-projects-attribution: {"github_login":"os-project-manager"}
-->
_Requested by **Leehom** · [project
thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1XXDXbLfrrkD6FUmGTNP2aVq)_

Fixes objectstack-ai#32977

domain:skills#1 · os-project-manager · session_01FEkQ5mo8ZsDz2BHVZiwWLs

Clause-②: no
Metadata-protocol: none

## 维护者速读

- 改了什么:`bootstrap.md`「多应用组合」一节改为:套件(一个 app 包加若干 module 包,各带一个应用)用
`composeStacks(stacks, { manifest: 'preserve' })` 组合,保留每个包自己的
id(`examples/app-multi-package` 就这么用);扁平组合(`'last'` 默认、`'first'`、索引)只留一个
manifest,一个 app/module 包 id
下落两个以上应用即被拒(`STACK_SINGLE_APP_VIOLATION`,422)。删掉「本仓没有应用用它」这句错话。`objectstack-ui/SKILL.md`「App
Navigation」补同一条补救:套件用 `preserve` 组合,扁平组合会被拒。
- 为什么改:objectstack-ai#32810(PR objectstack-ai#32898)已让 `composeStacks` 拒绝扁平组合出「一个包 id 下多个应用」,技能文字没教
`preserve`,AI 照写扁平组合会白跑一轮被拒。
- 风险与回滚:纯技能文字,两个文件 +32/-24 行,外加 `@objectstack/skills` patch
changeset;新增文字由同文件删除重复内容付账,两个文件都仍在 token 上限内,未抬任何上限;回滚即还原本 PR。
- 先看:`skills/objectstack-platform/references/bootstrap.md` 的 Multi-App
Composition 一节;`skills/objectstack-ui/SKILL.md` 第 139–147 行(App
Navigation 第二段)。
- 两分钟验证:`node scripts/check-skills-token-ratchet.mjs | grep -E
"bootstrap|objectstack-ui/SKILL"`,预期 bootstrap.md
1340/1343、objectstack-ui SKILL.md 3809/3814,均不超限。
- 需要你做的:受管面 Tier H(`skills/**`):请批准或合并。

## What changes

- **`skills/objectstack-platform/references/bootstrap.md`, § Multi-App
Composition.** The `composeStacks()` paragraph said "No app in this repo
uses it — read the schema before reaching for it" and named no strategy
for a suite. It now says: a suite (an app package plus module packages,
one app each) composes with `composeStacks(stacks, { manifest:
'preserve' })`, which keeps each package's own id
(`examples/app-multi-package`); a flat `manifest` (`'last'`, the
default, `'first'` or an index) keeps one, so two or more apps under one
`app` or `module` package id are refused (`STACK_SINGLE_APP_VIOLATION`,
422). Card Work items 1 and 2.
- **`skills/objectstack-ui/SKILL.md`, § App Navigation** (fold
6846119916 row 1). The suite sentence now ends with the remedy: the
suite composes with `composeStacks(stacks, { manifest: 'preserve' })`,
which serves each app under its own package id; a flat composition puts
them under one and is refused.
- **`.changeset/32977-skills-suite-composes-under-preserve.md`**:
`'@objectstack/skills': patch`, carrying both declaration lines.
- **`docs/adr/0019-app-as-consumer-unit.md` is not touched** (fold
6846119916 row 2). The folded row and objectstack-ai#33135 name the same sentence of
the 2026-11-12 "Enforced for modules" note ("Two shapes are not judged
... a flat `composeStacks` ... and a hand-built `packages[]` body"), so
the ADR stays with objectstack-ai#33135 as the order rules. objectstack-ai#33135's Expected names
only the hand-built body; the flat-composition half of that sentence is
false too since PR objectstack-ai#32898, so objectstack-ai#33135's PR should rewrite the whole
sentence (noted in the report for the seat).

### Paid in the same file (no ceiling moved)

- `bootstrap.md`: the title's "(moved verbatim from SKILL.md)" (no
longer true once this section changes); "this is how real multi-app
composition happens" and "equal the physical table name" (the second
restates `objectstack-platform/SKILL.md` § Object naming); "Use barrel
exports to keep config clean:" and "A minimal but complete project from
scratch:" (each restates its heading); "(traditional)" and "(key becomes
name) ... for readability" in the Map Format comments (the sentence
above the block says the key becomes the `name`); the `stack.zod.ts`
file pointer (`references/_index.md` carries the schema pointers).
- `objectstack-ui/SKILL.md`: the `subforms` example's "relationshipField
+ columns are derived from the child object" comment (the paragraph
under the list says the FK and columns are derived in every case); the
`requiresObject` / `requiresService` note shortened to what it says
("hide an item whose optional system object or kernel service is
missing"). The pinned lines named in the file's CEILINGS entry are
untouched.

## Why

Read on `origin/main` 34c0522, `packages/spec/src/stack.zod.ts`:

- `SINGLE_APP_PACKAGE_TYPES` = `app`, `module`.
`SINGLE_APP_COMPOSE_REMEDY` is the text every single-app finding names:
"compose the packages into one artifact with composeStacks(stacks, {
manifest: 'preserve' }), which keeps each package's own id (a flat
composition puts every app back under one)".
- `composeStacks` calls `collectComposedSingleAppErrors(stacks,
composed, opts.manifest)` and throws `StackSingleAppViolationError`
(`code = 'STACK_SINGLE_APP_VIOLATION'`, `status = 422` from
`StackRefusalError`) with the header `composeStacks single-app
validation failed (N issues):`. With no `packages[]` in the result,
`flatSingleAppFinding` refuses when the composed manifest's type is in
the set and the composed `apps` has more than one entry, naming each app
with the input it came from.
- `examples/app-multi-package/objectstack.config.ts` line 68: `export
default composeStacks([ordersStack, coreStack], { manifest: 'preserve'
});`, so the old "No app in this repo uses it" was false.

## Acceptance notes

- `resolveArtifactCollections` (`@objectstack/runtime`, named in
6846119916 as the platform reader the remedy could name) is not taught:
the ask is the `preserve` remedy, the file has no headroom, and an
author composes with `composeStacks`, not with the runtime reader.
- No eval is added: the card asks for teaching text only.
- `origin/main` moved to b5f2f51 (objectstack-ai#33292) after the branch was cut; it
touches none of these files, so no merge.

## Verification

Head `f4fc5ea9`, base `origin/main` 34c0522.

<details><summary>Line and token budget (skills/**)</summary>

- `skills/objectstack-platform/references/bootstrap.md`: 190 to 188
lines, 5398 to 5390 bytes; token ratchet 1342 to 1340 (ceiling 1343,
headroom 3).
- `skills/objectstack-ui/SKILL.md`: 301 to 301 lines, 15276 to 15253
bytes; token ratchet 3814 to 3809 (ceiling 3814, headroom 5).
- Whole package, all `skills/*/SKILL.md`: 4602 to 4602 lines. Bundle
total (whole shipped tree): 244649 to 244642 tokens.
- `node scripts/pm/check-skill-line-ratchet.mjs`: exit 0. `node
scripts/check-skills-token-ratchet.mjs`: exit 0. No ceiling raised.

</details>

<details><summary>Derived gates: 48 derived, 46 run green, 2 NOT
MEASURED</summary>

`node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack` derived 48 families for the three paths.
`turbo run build --filter=@objectstack/formula
--filter=@objectstack/lint --filter=@objectstack/spec` ran first under
the verify lock (VERDICT command-exit 0, 87s). Each family was then run
with its exit code captured before any pipe.

- 46 exit 0, among them `check-adr-0087-registration`,
`check-empty-changeset`, `check-skills-token-ratchet` (scan and
`--self-test` each), `@objectstack/lint check:doc-formula-expressions`,
`@objectstack/spec check:skill-docs` and `check:skill-refs`,
`check:doc-authoring`, `check:nul-bytes`, `check:pm-governed-merges`,
`check:published-files`, `check:scaffold-emission-policy`,
`check:skill-compatibility`, `check:skill-frame-sync`,
`check:skill-identifier-liveness`, `check:skill-links`;
`check:dts-closure` and `check:sourcemap-no-sources-content` over the 5
built packages only.
- NOT MEASURED, exit 3 PREREQUISITE NOT MET (every package's `dist/`):
`check:dual-build-cjs-loads`, `check:lean-entry-closure`. No package
source is touched, so no full build was paid; CI builds and runs them.
- `--ran`: "48 derived famil(ies) accounted for — 46 run, 2 NOT-MEASURED
(2 DERIVED from a recorded exit 3)".
- CI families are read from this PR's check-runs, not re-run here.

</details>

<details><summary>Tier and governed readings</summary>

- `dispatch-gates --tier`: MANDATORY contract-review tier, `skills/**`
under clause ① (the published catalog); no one-line exit for this
surface.
- `node scripts/pm/check-governed-merges.mjs --branch
claude/project-thread-rqofat`: exit 3, GOVERNED, landing tier H. 2 of 3
paths on the register (`skills/**`); the changeset is not. Size +32 /
-24, under the 3000 threshold.

</details>

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01FEkQ5mo8ZsDz2BHVZiwWLs

<!-- signed: domain:skills#1 · os-project-manager ·
session_01FEkQ5pjSPT7ui2EUcunaVb -->

Co-authored-by: Claude <noreply@anthropic.com>
scbdzhwl pushed a commit to scbdzhwl/objectstack-analysis that referenced this pull request Nov 16, 2026
…] body are judged since 2026-11-13 (objectstack-ai#33502)

<!-- claude-projects-attribution: {"github_login":"os-project-manager"}
-->
_Requested by **Leehom** · [project
thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1X4e82tcKptpRRoyvCJDwBeL)_

Fixes objectstack-ai#33135

domain:skills#1 · os-project-manager · session_01FEkQ5obDWQ7NdtH2f9iZXC

Clause-②: no
Metadata-protocol: none

## 维护者速读

- 改了什么:ADR-0019 在 2026-11-12 的执行记录里写着「两种形状不受检查:扁平的 `composeStacks`,和手工拼的
`packages[]` 包体」。这句改成当日的读数(过去时),并在其后新增一段「自 2026-11-13 起,组合与 `packages[]`
包体都受检查」,逐条写明 objectstack-ai#32898、objectstack-ai#33074、objectstack-ai#33122 三次合并各自检查了什么;状态行的「已落地」也补上这三次合并及其提交号。
- 为什么改:这句话两半在 `main` 上都已不成立:扁平组合把两个以上应用放到同一个 app/module
包名下会被拒(`STACK_SINGLE_APP_VIOLATION`,422),手工拼的包体也按包分别检查单应用和命名空间前缀。照着旧文字读的作者或
AI 会以为这些形状不受检查。
- 风险与回滚:只改决策记录文字,不动代码、协议和技能包;回滚即还原本 PR。
- 先看:`docs/adr/0019-app-as-consumer-unit.md` D3 修订说明下的「Enforced for
compositions and `packages[]` bodies since 2026-11-13」一段;再看第 3
行状态行新增的那半句。
- 两分钟验证:`pnpm check:adr-symbol-anchors`,预期 exit 0、「anchors across 156
records resolve」。
- 需要你做的:受管面 Tier H(`docs/adr/**`):请批准或合并。

## What changes

- **`docs/adr/0019-app-as-consumer-unit.md`, D3, the 2026-11-12 note
"Enforced for modules since 2026-11-12".** Its sentence "The check reads
one `defineStack` call. Two shapes are not judged (objectstack-ai#32810): a flat
`composeStacks` … and a hand-built `packages[]` body." is rewritten as
the reading at that merge, in the past tense, and points to the next
paragraph: "At this merge the check read one `defineStack` call, and two
shapes were not judged (objectstack-ai#32810): … Both are judged since 2026-11-13; see
the next paragraph." The rest of that paragraph is unchanged.
- **New dated paragraph "Enforced for compositions and `packages[]`
bodies since 2026-11-13."**, following the file's own convention (the
2026-11-12 note keeps the paragraph before it "as written" and adds a
dated note). One bullet per merge:
- objectstack-ai#32898 (`0b23b2a0c4`): `composeStacks` refuses a flat composition
(`'last'`, `'first'` or an index) whose kept manifest is an `app` or
`module` package and that brings two or more apps,
`STACK_SINGLE_APP_VIOLATION` (422), naming each app and its input; the
remedy is `manifest: 'preserve'`; every `packages[]` body of a
composition is held to one app; a one-input composition is handed back
unjudged.
- objectstack-ai#33074 (`2c98485db5`): changes only how strict `defineStack` counts
the top level of a `packages[]` stack. Before, every top-level app
counted against `manifest.id`; since, the residual rule objectstack-ai#32898 gave
`composeStacks` (top-level apps no body declares count against
`manifest.id` beside that id's own body). Bodies are judged as before,
per body since objectstack-ai#32898.
- objectstack-ai#33122 (`5b2ec820c8`): strict `defineStack` judges namespace prefixes
per body against the body's own namespace, residual top-level objects
against `manifest.namespace`, `STACK_NAMESPACE_PREFIX_INVALID`; a body
with no namespace is not judged.
- What stays unjudged at `defineStack` (other package types, no
manifest, `strict: false`, the last now judged at `composeStacks`), and
the placement sentence, which stands (measured, below).
- **Status line, "Landed in spec".** After the objectstack-ai#32586 clause: "and the
same rule on a flat `composeStacks` and on every `packages[]` body
(objectstack-ai#32898, merged 2026-11-13 as `0b23b2a0c4`; objectstack-ai#33074, merged 2026-11-13 as
`2c98485db5`), and the namespace-prefix rule judged per `packages[]`
body (objectstack-ai#33122, merged 2026-11-13 as `5b2ec820c8`)."
- Not touched: the D3 reasons, the 2026-11-12 "Enforced today, and not
yet." paragraph, ADR-0130 (the order's surface is this file only), and
`skills/**` (PR objectstack-ai#33475 teaches the flat-compose fact there).

## Why

Read on `origin/main` `b392ff7b`, not from the card:

- `packages/spec/src/stack.zod.ts`: `collectComposedSingleAppErrors` and
`flatSingleAppFinding` (flat result: every app counts against the one
kept manifest), `SINGLE_APP_PACKAGE_TYPES` = `app`, `module`,
`SINGLE_APP_COMPOSE_REMEDY` (names `manifest: 'preserve'`),
`collectPackageBodySingleAppErrors` (each body by its own `type`, `id`,
`apps`), `validateSingleApp` and `residualSingleAppFinding` (one judge
for both doors), `namespacePrefixErrors` (per body, residual top level),
`composeStacks`' `stacks.length === 1` early return.
- `examples/app-multi-package/objectstack.config.ts` composes with
`manifest: 'preserve'`.
- Attribution per PR, read from each merge commit's tree:
`residualSingleAppFinding`, `flatSingleAppFinding` and
`collectPackageBodySingleAppErrors` exist at `0b23b2a0c4` (objectstack-ai#32898),
where `validateSingleApp` does not call the residual judge; it does at
`2c98485db5` (objectstack-ai#33074); `namespacePrefixErrors` first exists at
`5b2ec820c8` (objectstack-ai#33122).
- Each merge commit is an ancestor of `origin/main` (`git merge-base
--is-ancestor`, exit 0 for all three, after deepening the shallow
clone).
- One probe against `packages/spec/dist` built from `b392ff7b`, not kept
as a test:

  | Shape | Answer |
  |:--|:--|
| flat `composeStacks` (default `'last'`) of two module stacks with one
app each | refused, `STACK_SINGLE_APP_VIOLATION` 422 |
  | the same under `manifest: 'preserve'` | accepted |
| hand-built `packages[]` body (module) with two apps, `defineStack` |
refused, `STACK_SINGLE_APP_VIOLATION` 422 |
| hand-built body, namespace `svc`, object `crm_case` | refused,
`STACK_NAMESPACE_PREFIX_INVALID` 422 |
  | control: same body with `svc_case` | accepted |
  | placement: module with no objects, app names `crm_case` | accepted |
| placement: object-less body's app names a sibling body's object,
`defineStack` and `'preserve'` compose | accepted |

The placement sentence therefore stands, as the order asked to measure.

Ruling: Leehom 2026-11-14T21:21:06Z 「开放 p3卡认领」 (p3 cards open for
claiming); scope widened to both halves by the skills seat's note
6884985712 on the card.

## Acceptance notes

- **The 2026-11-12 paragraph is edited, not kept verbatim.** The order
asks for both "rewrite the whole sentence" and "keep the dated paragraph
as the reading at that date". Rewriting the one sentence into the past
tense, with a pointer to the new note, does both: the paragraph still
reads as at objectstack-ai#32586's merge, and no present-tense sentence on the page is
false.
- No out-of-scope findings.

## Verification

Head `691fe886` (round 1, after contract review 6885553305; round 0 was
`c72ef404`), base `origin/main` `b392ff7b`.

<details><summary>Derived gates: 21 derived, 21 run, all exit
0</summary>

`node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack` derived 21 families for the one path. Each
ran on head `c72ef404` (round 0) and again on `691fe886`, 21 of 21 exit
0 (`33135-gates-ran-r1.txt`) with its exit code captured before any
pipe, after building `@objectstack/lint...` under the verify lock
(VERDICT command-exit 0, 86s):

- exit 0: `check-adr-links` (scan and `--self-test`),
`check-closing-keyword-parity` (scan and `--self-test`),
`check-comment-mask-corpus`, `plan-test-core-shards --self-test`,
`@objectstack/lint check:doc-formula-expressions`, `check:adr-anchors`,
`check:adr-index`, `check:adr-symbol-anchors` ("3594 anchors across 156
records resolve"), `check:ci-filter-parity`,
`check:closed-ceremony-text`, `check:cross-package-test-inputs`,
`check:doc-authoring`, `check:driver-memory-census`,
`check:gitlink-declared`, `check:nul-bytes`, `check:pm-governed-merges`,
`check:pm-prior-rulings`, `check:refd-timer-probe`,
`check:watch-hint-literal`.
- `--ran` reconciliation: "21 derived famil(ies) accounted for — 21 run,
0 NOT-MEASURED".
- The path-less symbol continuations (`#flatSingleAppFinding`,
`#SINGLE_APP_COMPOSE_REMEDY`, `#collectPackageBodySingleAppErrors`,
`#validateSingleApp`, `#residualSingleAppFinding`,
`#namespacePrefixErrors`) are not judged by `check:adr-symbol-anchors`
(that spelling is off in this corpus); each was found by `grep` as a
declaration in `packages/spec/src/stack.zod.ts` on `b392ff7b`.
- CI families are read from this PR's check-runs, not re-run here.

</details>

<details><summary>Tier and governed readings</summary>

- `dispatch-gates --tier`: MANDATORY contract-review tier for
`docs/adr/**`; no one-line exit for this surface. This thread ran at the
claim's default model; the seat's in-seat contract review is the owed
record.
- `node scripts/pm/check-governed-merges.mjs --branch
claude/project-thread-bd7546`: GOVERNED, landing tier H (人合),
`docs/adr/**` x1. Size +50 / -4, under the 3000 threshold.
- `node scripts/pm/check-skill-line-ratchet.mjs`: exit 0 (no skill file
touched). No changeset: `docs/adr/**` ships in no package
(`skip-changeset`).

</details>

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01FEkQ5obDWQ7NdtH2f9iZXC

<!-- signed: domain:skills#1 · os-project-manager ·
session_01FEkQ5pjSPT7ui2EUcunaVb -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
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

3 participants