Skip to content

Commit 5b3afcf

Browse files
docs(adr): ADR-0019 records that a flat composeStacks and a packages[] body are judged since 2026-11-13 (#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 #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[]` 包体都受检查」,逐条写明 #32898、#33074、#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 (#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 (#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: - #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. - #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 #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 #32898. - #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 #32586 clause: "and the same rule on a flat `composeStacks` and on every `packages[]` body (#32898, merged 2026-11-13 as `0b23b2a0c4`; #33074, merged 2026-11-13 as `2c98485db5`), and the namespace-prefix rule judged per `packages[]` body (#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 #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` (#32898), where `validateSingleApp` does not call the residual judge; it does at `2c98485db5` (#33074); `namespacePrefixErrors` first exists at `5b2ec820c8` (#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 #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>
1 parent acac1ea commit 5b3afcf

1 file changed

Lines changed: 50 additions & 4 deletions

File tree

‎docs/adr/0019-app-as-consumer-unit.md‎

Lines changed: 50 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ADR-0019: App as the Consumer-Facing Unit
22

3-
**Status**: Accepted — 2026-10-27 (ruled on objectstack#26553, ADR batch 1; proposed 2026-05-31, v3 narrowed to the consumer-surface decision). Landed in spec: `CONSUMER_INSTALLABLE_TYPES` / `isConsumerInstallable`, the `MarketplaceListingSchema.packageType` narrowing, and the `defineStack` check that holds a module package to at most one app, as it does an app package ([#32586](https://github.com/objectstack-ai/objectstack/issues/32586), merged 2026-11-12 as `9ae829108c`). Landed in HotCRM: the split into a suite that surfaces its sales, service and marketing apps, each in a package of its own (hotcrm#2417, by hotcrm#2430, merged 2026-11-12 as hotcrm commit `41d301a7bd`). Pending: the Console marketplace filling `packageType` from the manifest. · **Amended** (2026-11-12, [#32585](https://github.com/objectstack-ai/objectstack/issues/32585), maintainer ruling 「改成 Salesforce 模式」) — D3's fold reversed: a suite (one install: an app package plus the module packages it composes) may surface more than one app, each defined by a different package of the suite, and an app package still defines at most one app. `type: app` is not renamed (「同意」); D3 gains one terminology table for app package, module, app and suite. D1 and D2 are unchanged. Until this amendment the Pending clause ended "HotCRM folded to a single App (D3/D4)"; see the amendment note under D3.
3+
**Status**: Accepted — 2026-10-27 (ruled on objectstack#26553, ADR batch 1; proposed 2026-05-31, v3 narrowed to the consumer-surface decision). Landed in spec: `CONSUMER_INSTALLABLE_TYPES` / `isConsumerInstallable`, the `MarketplaceListingSchema.packageType` narrowing, and the `defineStack` check that holds a module package to at most one app, as it does an app package ([#32586](https://github.com/objectstack-ai/objectstack/issues/32586), merged 2026-11-12 as `9ae829108c`), and the same rule on a flat `composeStacks` and on every `packages[]` body ([#32898](https://github.com/objectstack-ai/objectstack/pull/32898), merged 2026-11-13 as `0b23b2a0c4`; [#33074](https://github.com/objectstack-ai/objectstack/pull/33074), merged 2026-11-13 as `2c98485db5`), and the namespace-prefix rule judged per `packages[]` body ([#33122](https://github.com/objectstack-ai/objectstack/pull/33122), merged 2026-11-13 as `5b2ec820c8`). Landed in HotCRM: the split into a suite that surfaces its sales, service and marketing apps, each in a package of its own (hotcrm#2417, by hotcrm#2430, merged 2026-11-12 as hotcrm commit `41d301a7bd`). Pending: the Console marketplace filling `packageType` from the manifest. · **Amended** (2026-11-12, [#32585](https://github.com/objectstack-ai/objectstack/issues/32585), maintainer ruling 「改成 Salesforce 模式」) — D3's fold reversed: a suite (one install: an app package plus the module packages it composes) may surface more than one app, each defined by a different package of the suite, and an app package still defines at most one app. `type: app` is not renamed (「同意」); D3 gains one terminology table for app package, module, app and suite. D1 and D2 are unchanged. Until this amendment the Pending clause ended "HotCRM folded to a single App (D3/D4)"; see the amendment note under D3.
44
**Shares its number with**: [`0019-approval-as-flow-node`](./0019-approval-as-flow-node.md) (Collapse Approval into Flow — approval as a durable-pause node) — an unrelated decision under the same number. Numbers are never reassigned (AGENTS.md Prime Directive 13); cite this record unambiguously as `ADR-0019-app-as-consumer-unit`.
55
**Date**: 2026-05-31
66
**Deciders**: ObjectStack Protocol Architects
@@ -202,11 +202,57 @@ as a wrapper that surfaces N apps.
202202
> defines more than one app with the same `STACK_SINGLE_APP_VIOLATION`, and the finding names the
203203
> package, each app and the remedy. Every other package type, a stack with no manifest and
204204
> `strict: false` are not judged, as before (`packages/spec/src/stack.test.ts` keeps the `driver`
205-
> pin). The check reads one `defineStack` call. Two shapes are not judged
205+
> pin). At this merge the check read one `defineStack` call, and two shapes were not judged
206206
> ([#32810](https://github.com/objectstack-ai/objectstack/issues/32810)): a flat `composeStacks`
207207
> (the default `manifest: 'last'`) of packages with one app each, which answers one package id
208-
> that carries several apps, and a hand-built `packages[]` body. The placement sentence above
209-
> stands: still argued, not checked.
208+
> that carries several apps, and a hand-built `packages[]` body. Both are judged since
209+
> 2026-11-13; see the next paragraph. The placement sentence above stands: still argued, not
210+
> checked.
211+
>
212+
> **Enforced for compositions and `packages[]` bodies since 2026-11-13.** The paragraph above is
213+
> the reading at #32586's merge. Three merges since judge both shapes it names:
214+
>
215+
> - [#32898](https://github.com/objectstack-ai/objectstack/pull/32898), merged as `0b23b2a0c4`:
216+
> `composeStacks` judges what a composition puts under each package id
217+
> (`packages/spec/src/stack.zod.ts#collectComposedSingleAppErrors`). A flat composition (the
218+
> default `manifest: 'last'`, `'first'` or an index) of inputs that carry no `packages[]` keeps
219+
> one manifest and puts every input's apps under its id, so when that manifest is an `app` or
220+
> `module` package and the inputs bring two or more apps, it is refused with
221+
> `STACK_SINGLE_APP_VIOLATION` (422), naming each app and the input it came from
222+
> (`#flatSingleAppFinding`). The remedy the finding names is `manifest: 'preserve'`, which keeps
223+
> each package's own id (`#SINGLE_APP_COMPOSE_REMEDY`), the shape
224+
> `examples/app-multi-package/objectstack.config.ts` composes. A composition whose result
225+
> carries `packages[]` (under `'preserve'`, or a flat option with an input that carries
226+
> `packages[]`) is judged by the residual rule instead: a top-level app that no body declares
227+
> is registered under the artifact's manifest id, beside the apps of that id's own body, and
228+
> two or more there are refused (`packages/spec/src/stack.zod.ts#residualSingleAppFinding`). The
229+
> same merge holds every `packages[]` body to one app, each by its own `type`, `id` and `apps`,
230+
> at `composeStacks` and at strict `defineStack`
231+
> (`packages/spec/src/stack.zod.ts#collectPackageBodySingleAppErrors`). A composition of one
232+
> input is handed back as it is, judged only by its own `defineStack`.
233+
> - [#33074](https://github.com/objectstack-ai/objectstack/pull/33074), merged as `2c98485db5`:
234+
> changes only how strict `defineStack` counts the top level of a stack that carries
235+
> `packages[]`; the bodies are judged as before. Until then every top-level app counted against
236+
> `manifest.id`; since, the top level is judged by the residual rule #32898 gave `composeStacks`
237+
> (`packages/spec/src/stack.zod.ts#validateSingleApp`), so a top-level app a body declares is a
238+
> copy of that body's app and counts against that body only.
239+
> - [#33122](https://github.com/objectstack-ai/objectstack/pull/33122), merged as `5b2ec820c8`:
240+
> strict `defineStack` judges namespace prefixes per body
241+
> (`packages/spec/src/stack.zod.ts#namespacePrefixErrors`), each body's objects against that
242+
> body's own `namespace` and a top-level object that no body declares against
243+
> `manifest.namespace`, refused with `STACK_NAMESPACE_PREFIX_INVALID`. A body with no
244+
> `namespace` is not judged, the rule's legacy skip. `composeStacks` runs no namespace-prefix
245+
> check.
246+
>
247+
> `packages/spec/src/stack.test.ts` pins each of the three. At `defineStack`, package types other
248+
> than `app` and `module` are not judged by the single-app rule, and `strict: false` skips both
249+
> rules. A stack with no manifest goes unjudged only at its top level: every `packages[]` body it
250+
> carries is still judged by both rules. A `strict: false` stack meets a rule only when it is one
251+
> of two or more inputs to `composeStacks`, and then only the single-app rule. The
252+
> placement sentence stands: on `main` at `b392ff7b`, a module package that defines no object
253+
> builds with an app that names an object of a sibling package, at `defineStack` and in a
254+
> `manifest: 'preserve'` composition (probed once, not kept as a test; reason 2's first bullet
255+
> gives the reason).
210256
>
211257
> **Not decided here.** Several apps in one `type: app` package (option C) is not ruled, and the
212258
> three reasons above contradict it. Per-position app visibility and a per-position default app

0 commit comments

Comments
 (0)