Commit f115182
feat(spec): App as the consumer-facing unit (ADR-0019) (#1406)
* docs(adr): ADR-0019 App as the consumer-facing unit (Package ≡ App)
Establish the App as the single consumer-facing noun: download = open =
uninstall, one identity throughout. Internal composition (plugins,
modules, drivers) becomes invisible bundle detail, like frameworks inside
a .app. Remove the suite-contains-apps container; HotCRM folds into one
App. Builds on ADR-0003.
* docs(adr): ADR-0019 v2 — merge metadata/code plane split & capability contract
Merge Axis B into ADR-0019: packages are two categories (metadata, hot-
loaded; code, compiled into the server build), mapped to two runtime
planes joined by a capability-by-reference contract. Add D5-D7 (two
planes; consumer App must be pure metadata; requires/provides contract).
Relax D4: an App owns a SET of namespaces (uninstall removes the set),
so suites fold without object renames. Record honestly that the
capability contract is mostly unbuilt today (closed CAPABILITY_PROVIDERS
table + inert provides/requires schema) and surface the risks as
Consequences and Open questions.
* feat(spec): ADR-0019 P2 — manifest two-tier + consumer-App rules (warn-only)
Add CONSUMER_INSTALLABLE_TYPES + isConsumerInstallable (D2 tier split),
and a consumer-app-rules module with validateConsumerAppPurity (D6) and
validateRequiresShape (D7). Wire both into defineStack as non-blocking
warnings so existing code-bearing apps still build. Add tests + a P2
landing-plan doc. No runtime/registry changes (capability registry +
install gate remain P4).
* refactor(spec): narrow ADR-0019 to 'App as consumer unit'; revert plane/purity scope
Per design review, narrow the scheme to its one cheap, certain part — the
consumer surface is one App — and revert the metadata/code plane, D6 purity,
and D7 capability-contract apparatus (premises did not hold: consumer apps
legitimately carry code-bearing metadata like L2 sandboxed-JS hooks, and
auto-review was dropped as a requirement).
Lands:
- isConsumerInstallable(type) + CONSUMER_INSTALLABLE_TYPES (single source of truth)
- MarketplaceListingSchema.packageType constrained to consumer-installable types,
so a non-App consumer listing cannot be represented (guarantee in the contract)
Reverts: consumer-app-rules.{ts,test.ts}, the defineStack warn-only wiring, the
P2 plan doc. ADR-0019 rewritten to v3 (decision = D1-D4; the larger scheme moved
to an explicit, gated 'Out of scope' section).
* feat(spec): enforce one App per package in defineStack (ADR-0019 D1/D3)
A package with manifest.type === 'app' must define exactly one app. Zero is
rejected (an app package with no app surface); more than one is the banned
'suite contains apps' shape — fold into one app with multiple tabs, or split
into separate packages. Non-app package types are unconstrained. Mirrors the
existing validateNamespacePrefix pattern. Existing examples already define
exactly one app, so this is non-breaking.
* fix(spec): relax one-App rule to 'at most one'; restore green suite
The previous commit hard-required exactly one app for type:app packages,
which broke 31 existing spec fixtures that use type:app with zero apps to
test unrelated behavior. The banned case per ADR-0019 D3 is *multiple* apps
(the suite shape), not zero. Relax validateSingleApp to reject >1 only;
allow 0. Add tests. Full spec suite green (6628), tsc clean, compose-stacks
+ app-crm smoke green.
* test(spec): cover at-most-one-App rule in defineStack (ADR-0019)
Adds the validateSingleApp tests that failed to land in the prior commit:
one app ok, zero apps ok, >1 app throws, non-app types unconstrained.
* fix(spec): make at-most-one-App tests use cross-ref-valid apps
The reject-case test used name+label-only apps, which trip the cross-
reference landing check (runs before the single-app rule) and threw the
wrong error. Give each app navigation to a defined object so the suite
fixture reaches validateSingleApp. Full spec suite green (6628), tsc clean.
* fix(spec): use valid 2-char app names in non-app-type test fixture
Final fix for the at-most-one-App test suite: the driver fixture used
single-char app names ('a'/'b') which fail the SnakeCaseIdentifier
min-2-char rule and threw the wrong error. Use 'app_a'/'app_b'. Full spec
suite green (6624 passed, 0 failed), tsc clean.
* docs: align package-registry + marketplace-publishing to ADR-0019
Update the two docs that still described the old 'suite contains apps'
model:
- package-registry.zod.ts doc comment: App is the one consumer unit; a
consumer package defines at most one app; internal contributions are
invisible bundle parts.
- marketplace-publishing.md §1-2 + §6: taxonomy rewritten around the App;
HotCRM reference reframed as one App with internal plugins; §6 replaced
with the two valid shapes (one App bundling plugins, or independent Apps)
and an explicit 'no suite' note.
* docs: finish ADR-0019 alignment in marketplace-publishing + package-registry
Complete the partial doc update: package-registry.zod.ts header comment and
marketplace-publishing.md sections 2.1/2.2/6 + summary now describe the App as
the one consumer unit (at most one app per package; internal contributions
invisible; no suite-contains-apps). Removes the remaining old 'suite' wording.
* docs(spec): fix package-registry header to ADR-0019 (App is the consumer unit)
The earlier 'docs: align ...' commit message claimed this file was updated,
but the edit had silently failed — the header still described the old
'package may contain ... multiple apps (suite of applications)' model. Replace
it with the ADR-0019 model: App is the one consumer-facing unit, at most one
app per consumer package, internal contributions invisible. No 'suite'.
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 25fedfd commit f115182
10 files changed
Lines changed: 425 additions & 68 deletions
File tree
- .changeset
- docs
- adr
- design
- packages/spec/src
- cloud
- kernel
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
5 | 8 | | |
6 | 9 | | |
7 | 10 | | |
| |||
35 | 38 | | |
36 | 39 | | |
37 | 40 | | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
42 | 49 | | |
43 | 50 | | |
44 | 51 | | |
45 | 52 | | |
46 | 53 | | |
47 | | - | |
| 54 | + | |
48 | 55 | | |
49 | | - | |
| 56 | + | |
50 | 57 | | |
51 | 58 | | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
56 | 66 | | |
57 | 67 | | |
58 | | - | |
| 68 | + | |
59 | 69 | | |
60 | | - | |
| 70 | + | |
61 | 71 | | |
62 | | - | |
63 | | - | |
64 | | - | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
65 | 79 | | |
66 | 80 | | |
67 | 81 | | |
| |||
353 | 367 | | |
354 | 368 | | |
355 | 369 | | |
356 | | - | |
| 370 | + | |
357 | 371 | | |
358 | | - | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
359 | 376 | | |
360 | | - | |
| 377 | + | |
361 | 378 | | |
362 | | - | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
363 | 383 | | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
369 | | - | |
370 | | - | |
371 | | - | |
372 | | - | |
373 | | - | |
374 | | - | |
375 | | - | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | | - | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
383 | 392 | | |
384 | | - | |
385 | | - | |
386 | | - | |
387 | | - | |
388 | | - | |
| 393 | + | |
| 394 | + | |
389 | 395 | | |
390 | | - | |
391 | | - | |
| 396 | + | |
392 | 397 | | |
393 | | - | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
394 | 401 | | |
395 | | - | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | | - | |
400 | | - | |
401 | | - | |
402 | | - | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
403 | 405 | | |
404 | 406 | | |
405 | | - | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
406 | 415 | | |
407 | 416 | | |
408 | 417 | | |
| |||
591 | 600 | | |
592 | 601 | | |
593 | 602 | | |
594 | | - | |
| 603 | + | |
595 | 604 | | |
596 | 605 | | |
597 | 606 | | |
| |||
0 commit comments