@wildo-ai/platform-config-lib 1.1.5 → 1.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (138) hide show
  1. package/dist/esm/bootstrap/bootstrap.contracts.d.ts +3 -2
  2. package/dist/esm/bootstrap/bootstrap.contracts.d.ts.map +1 -1
  3. package/dist/esm/bootstrap/bootstrap.contracts.js +3 -2
  4. package/dist/esm/bootstrap/bootstrap.contracts.js.map +1 -1
  5. package/dist/esm/bootstrap/bootstrap.schemas.d.ts +47 -0
  6. package/dist/esm/bootstrap/bootstrap.schemas.d.ts.map +1 -1
  7. package/dist/esm/bootstrap/bootstrap.schemas.js +8 -0
  8. package/dist/esm/bootstrap/bootstrap.schemas.js.map +1 -1
  9. package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts +12 -1
  10. package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts.map +1 -1
  11. package/dist/esm/bootstrap/platform-runtime-env.contracts.js +12 -0
  12. package/dist/esm/bootstrap/platform-runtime-env.contracts.js.map +1 -1
  13. package/dist/esm/bootstrap/platform-store-preconnect.d.ts +37 -0
  14. package/dist/esm/bootstrap/platform-store-preconnect.d.ts.map +1 -0
  15. package/dist/esm/bootstrap/platform-store-preconnect.js +43 -0
  16. package/dist/esm/bootstrap/platform-store-preconnect.js.map +1 -0
  17. package/dist/esm/bootstrap/runtime-backing-service-access.d.ts.map +1 -1
  18. package/dist/esm/bootstrap/runtime-backing-service-access.js +8 -4
  19. package/dist/esm/bootstrap/runtime-backing-service-access.js.map +1 -1
  20. package/dist/esm/bootstrap/runtime-topology.contracts.d.ts +36 -3
  21. package/dist/esm/bootstrap/runtime-topology.contracts.d.ts.map +1 -1
  22. package/dist/esm/bootstrap/runtime-topology.contracts.js +36 -13
  23. package/dist/esm/bootstrap/runtime-topology.contracts.js.map +1 -1
  24. package/dist/esm/index.d.ts +1 -0
  25. package/dist/esm/index.d.ts.map +1 -1
  26. package/dist/esm/index.js +1 -0
  27. package/dist/esm/index.js.map +1 -1
  28. package/dist/esm/lockfile/lockfile-io.d.ts +7 -1
  29. package/dist/esm/lockfile/lockfile-io.d.ts.map +1 -1
  30. package/dist/esm/lockfile/lockfile-io.js +17 -3
  31. package/dist/esm/lockfile/lockfile-io.js.map +1 -1
  32. package/dist/esm/lockfile/materialize-infra-section.d.ts +27 -6
  33. package/dist/esm/lockfile/materialize-infra-section.d.ts.map +1 -1
  34. package/dist/esm/lockfile/materialize-infra-section.js +23 -10
  35. package/dist/esm/lockfile/materialize-infra-section.js.map +1 -1
  36. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.d.ts +455 -6
  37. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.d.ts.map +1 -1
  38. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.js +27 -0
  39. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.js.map +1 -1
  40. package/dist/esm/project-config/application-public-pricing-catalog.loader.d.ts +13 -0
  41. package/dist/esm/project-config/application-public-pricing-catalog.loader.d.ts.map +1 -0
  42. package/dist/esm/project-config/application-public-pricing-catalog.loader.js +56 -0
  43. package/dist/esm/project-config/application-public-pricing-catalog.loader.js.map +1 -0
  44. package/dist/esm/project-config/define-infra-env-config.d.ts +0 -27
  45. package/dist/esm/project-config/define-infra-env-config.d.ts.map +1 -1
  46. package/dist/esm/project-config/define-infra-env-config.js +0 -2
  47. package/dist/esm/project-config/define-infra-env-config.js.map +1 -1
  48. package/dist/esm/project-config/define-saas-config.d.ts +52 -0
  49. package/dist/esm/project-config/define-saas-config.d.ts.map +1 -1
  50. package/dist/esm/project-config/define-saas-config.js +65 -15
  51. package/dist/esm/project-config/define-saas-config.js.map +1 -1
  52. package/dist/esm/project-config/index.d.ts +3 -0
  53. package/dist/esm/project-config/index.d.ts.map +1 -1
  54. package/dist/esm/project-config/index.js +3 -0
  55. package/dist/esm/project-config/index.js.map +1 -1
  56. package/dist/esm/project-config/loader.d.ts +11 -0
  57. package/dist/esm/project-config/loader.d.ts.map +1 -1
  58. package/dist/esm/project-config/loader.js +34 -7
  59. package/dist/esm/project-config/loader.js.map +1 -1
  60. package/dist/esm/project-config/npm-version-range.d.ts +23 -0
  61. package/dist/esm/project-config/npm-version-range.d.ts.map +1 -0
  62. package/dist/esm/project-config/npm-version-range.js +175 -0
  63. package/dist/esm/project-config/npm-version-range.js.map +1 -0
  64. package/dist/esm/project-config/provider-companion-discovery.d.ts +256 -30
  65. package/dist/esm/project-config/provider-companion-discovery.d.ts.map +1 -1
  66. package/dist/esm/project-config/provider-companion-discovery.js +719 -40
  67. package/dist/esm/project-config/provider-companion-discovery.js.map +1 -1
  68. package/dist/esm/project-config/provider-runtime-artifacts.d.ts +125 -2
  69. package/dist/esm/project-config/provider-runtime-artifacts.d.ts.map +1 -1
  70. package/dist/esm/project-config/provider-runtime-artifacts.js +283 -66
  71. package/dist/esm/project-config/provider-runtime-artifacts.js.map +1 -1
  72. package/dist/esm/project-config/shared/backing-service-servability.d.ts +157 -0
  73. package/dist/esm/project-config/shared/backing-service-servability.d.ts.map +1 -0
  74. package/dist/esm/project-config/shared/backing-service-servability.js +256 -0
  75. package/dist/esm/project-config/shared/backing-service-servability.js.map +1 -0
  76. package/dist/esm/project-config/shared/backing-services.schemas.d.ts +62 -67
  77. package/dist/esm/project-config/shared/backing-services.schemas.d.ts.map +1 -1
  78. package/dist/esm/project-config/shared/backing-services.schemas.js +71 -68
  79. package/dist/esm/project-config/shared/backing-services.schemas.js.map +1 -1
  80. package/dist/esm/project-config/shared/csp-emit.d.ts.map +1 -1
  81. package/dist/esm/project-config/shared/csp-emit.js +41 -2
  82. package/dist/esm/project-config/shared/csp-emit.js.map +1 -1
  83. package/dist/esm/project-config/shared/infra-providers.schemas.d.ts +180 -4
  84. package/dist/esm/project-config/shared/infra-providers.schemas.d.ts.map +1 -1
  85. package/dist/esm/project-config/shared/infra-providers.schemas.js +40 -0
  86. package/dist/esm/project-config/shared/infra-providers.schemas.js.map +1 -1
  87. package/dist/esm/project-config/static-asset-import-noop.d.ts +26 -0
  88. package/dist/esm/project-config/static-asset-import-noop.d.ts.map +1 -0
  89. package/dist/esm/project-config/static-asset-import-noop.js +49 -0
  90. package/dist/esm/project-config/static-asset-import-noop.js.map +1 -0
  91. package/dist/esm/registry/companion-api.schemas.d.ts +0 -176
  92. package/dist/esm/registry/companion-api.schemas.d.ts.map +0 -1
  93. package/dist/esm/registry/companion-api.schemas.js.map +0 -1
  94. package/dist/esm/registry/index.d.ts +3 -1
  95. package/dist/esm/registry/index.d.ts.map +1 -1
  96. package/dist/esm/registry/index.js +3 -1
  97. package/dist/esm/registry/index.js.map +1 -1
  98. package/dist/esm/registry/local-checkout-source.d.ts +31 -0
  99. package/dist/esm/registry/local-checkout-source.d.ts.map +1 -0
  100. package/dist/esm/registry/local-checkout-source.js +45 -0
  101. package/dist/esm/registry/local-checkout-source.js.map +1 -0
  102. package/dist/esm/registry/lockfile-modules-section.schemas.d.ts +174 -14
  103. package/dist/esm/registry/lockfile-modules-section.schemas.d.ts.map +1 -1
  104. package/dist/esm/registry/lockfile-modules-section.schemas.js +120 -11
  105. package/dist/esm/registry/lockfile-modules-section.schemas.js.map +1 -1
  106. package/dist/esm/registry/module-artifact.schemas.d.ts +79 -0
  107. package/dist/esm/registry/module-artifact.schemas.d.ts.map +1 -1
  108. package/dist/esm/registry/module-artifact.schemas.js +36 -0
  109. package/dist/esm/registry/module-artifact.schemas.js.map +1 -1
  110. package/dist/esm/registry/module-manifest.schemas.d.ts +393 -7
  111. package/dist/esm/registry/module-manifest.schemas.d.ts.map +1 -1
  112. package/dist/esm/registry/module-manifest.schemas.js +488 -40
  113. package/dist/esm/registry/module-manifest.schemas.js.map +1 -1
  114. package/dist/esm/registry/module-search.schemas.d.ts +80 -0
  115. package/dist/esm/registry/module-search.schemas.d.ts.map +1 -0
  116. package/dist/esm/registry/module-search.schemas.js +112 -0
  117. package/dist/esm/registry/module-search.schemas.js.map +1 -0
  118. package/dist/esm/registry/registry-config.schemas.d.ts +16 -0
  119. package/dist/esm/registry/registry-config.schemas.d.ts.map +1 -1
  120. package/dist/esm/registry/registry-config.schemas.js +8 -0
  121. package/dist/esm/registry/registry-config.schemas.js.map +1 -1
  122. package/dist/esm/registry/registry-errors.d.ts +126 -2
  123. package/dist/esm/registry/registry-errors.d.ts.map +1 -1
  124. package/dist/esm/registry/registry-errors.js +183 -14
  125. package/dist/esm/registry/registry-errors.js.map +1 -1
  126. package/dist/esm/registry/registry-keys.schemas.d.ts +80 -0
  127. package/dist/esm/registry/registry-keys.schemas.d.ts.map +1 -0
  128. package/dist/esm/registry/registry-keys.schemas.js +68 -0
  129. package/dist/esm/registry/registry-keys.schemas.js.map +1 -0
  130. package/dist/esm/registry/registry-section-schemas.constants.d.ts +25 -3
  131. package/dist/esm/registry/registry-section-schemas.constants.d.ts.map +1 -1
  132. package/dist/esm/workspace-scope/workspace-homes.schemas.d.ts +13 -11
  133. package/dist/esm/workspace-scope/workspace-homes.schemas.d.ts.map +1 -1
  134. package/dist/esm/workspace-scope/workspace-homes.schemas.js +2 -2
  135. package/dist/esm/workspace-scope/workspace-homes.schemas.js.map +1 -1
  136. package/package.json +7 -7
  137. package/dist/esm/registry/companion-api.schemas.js +0 -165
  138. package/dist/tsconfig.build.tsbuildinfo +0 -1
@@ -0,0 +1,157 @@
1
+ import { BackingServiceKind, BackingServiceSource, type BackingServicesEnvConfig } from './backing-services.schemas';
2
+ import { InfraProvider } from './infra-providers.schemas';
3
+ /**
4
+ * Is a `backingServices` declaration one the platform can actually SERVE?
5
+ *
6
+ * ## The defect this closes (#1693)
7
+ *
8
+ * A declaration used to be accepted when it merely parsed. Two classes of parseable declaration serve
9
+ * nothing, and both passed `wildo config sync` and `wildo lock check` in silence:
10
+ *
11
+ * 1. **It resolves to no provider** — `redis: { source: MANAGED }`, a managed MongoDB brand other
12
+ * than `'atlas'`. The lockfile materializer skipped the kind without a word.
13
+ * 2. **It resolves to a provider no module can serve** — the seven managed PostgreSQL entries have no
14
+ * module, and `AWS_S3` has one whose credential broker does not exist yet (#14). The materializer
15
+ * fell back to hashing the authored entry, so the lockfile recorded a selection nothing executes.
16
+ *
17
+ * Neither "provisions nothing". The generators honour `source`, so a MANAGED cache gets no
18
+ * self-hosted workload — while apps-manager, which named its modules and was never told the
19
+ * declaration, minted the application's credential on the PLATFORM's own server. The application
20
+ * received a credential for a server it never connects to. Since #1692 apps-manager is told, dispatches
21
+ * on the declared provider and refuses one it cannot serve
22
+ * ({@link findBackingServiceDeclarationsThePlatformCannotServe}); this offline check stops the same
23
+ * declarations before they reach it.
24
+ *
25
+ * ## Why the servable set is an INPUT here, not computed here
26
+ *
27
+ * Servability is a property of the provider-module CATALOGUE (`@wildo-ai/platform-infra-providers`),
28
+ * and that package depends on this one — never the reverse. So the catalogue derives the set
29
+ * (`collectServableInfraProviders()`) and every caller hands it in. The check itself lives here, once,
30
+ * so `wildo config validate`, `wildo config sync` and `wildo lock check` cannot disagree about which
31
+ * declarations they refuse: the two lockfile projections reach it through `materializeInfraSection`,
32
+ * which REQUIRES the set, and `config validate` calls {@link findUnservableBackingServiceDeclarations}
33
+ * directly.
34
+ *
35
+ * ## No opt-out, deliberately
36
+ *
37
+ * An earlier design offered `acceptUnresolved: true`. It was dropped: it makes a known-broken
38
+ * configuration representable, which is exactly a setting that looks like a control and does
39
+ * nothing. A kind becomes declarable as `MANAGED` in the same change that adds the module serving it.
40
+ */
41
+ /** Why a declaration cannot be served. */
42
+ export declare enum BackingServiceUnservableReason {
43
+ /** The `(kind, source, provider)` tuple names no `InfraProvider` catalogue entry at all. */
44
+ NO_PROVIDER = "no-provider",
45
+ /**
46
+ * It names a catalogue entry, but no provider module serves that entry — either none exists, or the
47
+ * one that exists declares `unservableReason`.
48
+ */
49
+ NO_SERVING_MODULE = "no-serving-module",
50
+ /**
51
+ * A module serves the entry, but THIS platform holds no administrative credentials for it — an Atlas
52
+ * declaration on a platform with no Atlas API key, a self-hosted PostgreSQL declaration on a platform with
53
+ * no PostgreSQL admin (#1692).
54
+ *
55
+ * Only apps-manager can know this: which admin clients a platform holds is platform configuration, and one
56
+ * platform hosts many applications. The offline checks (`config validate` / `config sync` / `lock check`)
57
+ * never produce it. apps-manager refuses the registration rather than minting on another provider — a
58
+ * substitution would hand the application a credential for a server it does not connect to.
59
+ */
60
+ NOT_HELD_BY_PLATFORM = "not-held-by-platform"
61
+ }
62
+ /** The authored half of a backing-service entry that decides which provider it names. */
63
+ export interface BackingServiceProviderSelection {
64
+ source: BackingServiceSource;
65
+ /** The brand, when the kind distinguishes several. See `resolveInfraProvider` for the vocabulary. */
66
+ provider?: string;
67
+ }
68
+ /** The simplest authored declaration that selects one catalogue entry. */
69
+ export interface InfraProviderCanonicalDeclaration extends BackingServiceProviderSelection {
70
+ kind: BackingServiceKind;
71
+ }
72
+ /**
73
+ * For every `InfraProvider`, the SIMPLEST declaration that selects it — the inverse of
74
+ * `resolveInfraProvider`, used to tell an author what they may write instead.
75
+ *
76
+ * Total over `InfraProvider` (a `Record`), so a provider added to the catalogue is a compile error
77
+ * here until someone states how it is declared. That the inverse is truthful is pinned by a test that
78
+ * resolves every row back through `resolveInfraProvider`; it is never trusted by construction.
79
+ */
80
+ export declare const INFRA_PROVIDER_CANONICAL_DECLARATIONS: Readonly<Record<InfraProvider, InfraProviderCanonicalDeclaration>>;
81
+ /** One declaration the platform cannot serve, with everything the refusal message needs. */
82
+ export interface UnservableBackingServiceDeclaration {
83
+ envName: string;
84
+ kind: BackingServiceKind;
85
+ declared: BackingServiceProviderSelection;
86
+ reason: BackingServiceUnservableReason;
87
+ /** The catalogue entry it names, when it names one (`NO_SERVING_MODULE`). */
88
+ resolvedProvider?: InfraProvider;
89
+ /** The simplest servable declarations for the same kind — what the author may write instead. */
90
+ servableAlternatives: ReadonlyArray<BackingServiceProviderSelection>;
91
+ }
92
+ /**
93
+ * The servable declarations for one kind, one per servable provider, in catalogue order.
94
+ *
95
+ * Empty when nothing can serve the kind — then the only servable choice is not to declare it.
96
+ */
97
+ export declare function servableBackingServiceDeclarations(kind: BackingServiceKind, servableProviders: ReadonlySet<InfraProvider>): ReadonlyArray<BackingServiceProviderSelection>;
98
+ /**
99
+ * Every declaration in one environment that the platform cannot serve. Empty means every declared
100
+ * kind resolves to a provider in `servableProviders`.
101
+ *
102
+ * Pure. `servableProviders` comes from `collectServableInfraProviders()` in
103
+ * `@wildo-ai/platform-infra-providers`; see the file header for why it is an input.
104
+ */
105
+ export declare function findUnservableBackingServiceDeclarations(input: {
106
+ envName: string;
107
+ backingServices: BackingServicesEnvConfig | undefined;
108
+ servableProviders: ReadonlySet<InfraProvider>;
109
+ }): UnservableBackingServiceDeclaration[];
110
+ /**
111
+ * The declarations an application REGISTERS with that THIS platform cannot serve — apps-manager's half of
112
+ * the servability check (#1692; the offline half is {@link findUnservableBackingServiceDeclarations}, #1693).
113
+ *
114
+ * Two sets, because they answer different questions:
115
+ *
116
+ * - `catalogueServableProviders` — what the provider-module catalogue can serve at all
117
+ * (`collectServableInfraProviders()`). Every DECLARED kind is checked against it: a declaration the
118
+ * catalogue refuses is refused here too, even if an older CLI let it through.
119
+ * - `platformServableProviders` — the subset this platform holds what it needs for (an admin client for a
120
+ * provider apps-manager mints on, nothing for one it does not). Checked only for `mintedKinds`, the kinds
121
+ * apps-manager mints a credential on for THIS application: an environment's declaration also names stores
122
+ * only the platform uses, and refusing an application over an admin client it would never use would be a
123
+ * refusal with nothing behind it.
124
+ *
125
+ * A catalogue finding keeps its catalogue reason; a provider the catalogue serves and this platform does not
126
+ * is {@link BackingServiceUnservableReason.NOT_HELD_BY_PLATFORM}. Alternatives are always what THIS platform
127
+ * can serve, because that is what the author can actually switch to here.
128
+ *
129
+ * Pure; apps-manager supplies both sets. An absent `declaredProviders` yields nothing — the previous
130
+ * behaviour for every kind (see `ApplicationBackingServiceProviderDeclarations`).
131
+ */
132
+ export declare function findBackingServiceDeclarationsThePlatformCannotServe(input: {
133
+ envName: string;
134
+ declaredProviders: Partial<Record<BackingServiceKind, BackingServiceProviderSelection>> | undefined;
135
+ mintedKinds: ReadonlySet<BackingServiceKind>;
136
+ catalogueServableProviders: ReadonlySet<InfraProvider>;
137
+ platformServableProviders: ReadonlySet<InfraProvider>;
138
+ }): UnservableBackingServiceDeclaration[];
139
+ /**
140
+ * One line per finding: the environment, the kind, what was declared, why it cannot be served, and
141
+ * the declarations that ARE servable for that kind. Shared by every caller so the wording is one.
142
+ */
143
+ export declare function describeUnservableBackingServiceDeclaration(finding: UnservableBackingServiceDeclaration): string;
144
+ /** Thrown when a declaration the platform cannot serve reaches a lockfile projection. */
145
+ export declare class UnservableBackingServiceDeclarationError extends Error {
146
+ readonly findings: ReadonlyArray<UnservableBackingServiceDeclaration>;
147
+ constructor(findings: ReadonlyArray<UnservableBackingServiceDeclaration>);
148
+ }
149
+ /** Refuse, naming every unservable declaration across every environment at once. */
150
+ export declare function assertBackingServiceDeclarationsServable(input: {
151
+ envs: ReadonlyArray<{
152
+ envName: string;
153
+ backingServices: BackingServicesEnvConfig | undefined;
154
+ }>;
155
+ servableProviders: ReadonlySet<InfraProvider>;
156
+ }): void;
157
+ //# sourceMappingURL=backing-service-servability.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"backing-service-servability.d.ts","sourceRoot":"","sources":["../../../../../src/project-config/shared/backing-service-servability.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EAEpB,KAAK,wBAAwB,EAC9B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,0CAA0C;AAC1C,oBAAY,8BAA8B;IACxC,4FAA4F;IAC5F,WAAW,gBAAgB;IAC3B;;;OAGG;IACH,iBAAiB,sBAAsB;IACvC;;;;;;;;;OASG;IACH,oBAAoB,yBAAyB;CAC9C;AAED,yFAAyF;AACzF,MAAM,WAAW,+BAA+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AC7C,0BAA0B,EAAE,WAAW,CAAC,aAAa,CAAC,CAAC;IACvD,yBAAyB,EAAE,WAAW,CAAC,aAAa,CAAC,CAAC;CACvD,GAAG,mCAAmC,EAAE,CAyBxC;AAoBD;;;GAGG;AACH,wBAAgB,2CAA2C,CAAC,OAAO,EAAE,mCAAmC,GAAG,MAAM,CAMhH;AAED,yFAAyF;AACzF,qBAAa,wCAAyC,SAAQ,KAAK;IACjE,QAAQ,CAAC,QAAQ,EAAE,aAAa,CAAC,mCAAmC,CAAC,CAAC;gBAE1D,QAAQ,EAAE,aAAa,CAAC,mCAAmC,CAAC;CASzE;AAED,oFAAoF;AACpF,wBAAgB,wCAAwC,CAAC,KAAK,EAAE;IAC9D,IAAI,EAAE,aAAa,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,eAAe,EAAE,wBAAwB,GAAG,SAAS,CAAA;KAAE,CAAC,CAAC;IAChG,iBAAiB,EAAE,WAAW,CAAC,aAAa,CAAC,CAAC;CAC/C,GAAG,IAAI,CAOP"}
@@ -0,0 +1,256 @@
1
+ import { BackingServiceKind, BackingServiceSource, resolveInfraProvider, } from './backing-services.schemas.js';
2
+ import { InfraProvider } from './infra-providers.schemas.js';
3
+ /**
4
+ * Is a `backingServices` declaration one the platform can actually SERVE?
5
+ *
6
+ * ## The defect this closes (#1693)
7
+ *
8
+ * A declaration used to be accepted when it merely parsed. Two classes of parseable declaration serve
9
+ * nothing, and both passed `wildo config sync` and `wildo lock check` in silence:
10
+ *
11
+ * 1. **It resolves to no provider** — `redis: { source: MANAGED }`, a managed MongoDB brand other
12
+ * than `'atlas'`. The lockfile materializer skipped the kind without a word.
13
+ * 2. **It resolves to a provider no module can serve** — the seven managed PostgreSQL entries have no
14
+ * module, and `AWS_S3` has one whose credential broker does not exist yet (#14). The materializer
15
+ * fell back to hashing the authored entry, so the lockfile recorded a selection nothing executes.
16
+ *
17
+ * Neither "provisions nothing". The generators honour `source`, so a MANAGED cache gets no
18
+ * self-hosted workload — while apps-manager, which named its modules and was never told the
19
+ * declaration, minted the application's credential on the PLATFORM's own server. The application
20
+ * received a credential for a server it never connects to. Since #1692 apps-manager is told, dispatches
21
+ * on the declared provider and refuses one it cannot serve
22
+ * ({@link findBackingServiceDeclarationsThePlatformCannotServe}); this offline check stops the same
23
+ * declarations before they reach it.
24
+ *
25
+ * ## Why the servable set is an INPUT here, not computed here
26
+ *
27
+ * Servability is a property of the provider-module CATALOGUE (`@wildo-ai/platform-infra-providers`),
28
+ * and that package depends on this one — never the reverse. So the catalogue derives the set
29
+ * (`collectServableInfraProviders()`) and every caller hands it in. The check itself lives here, once,
30
+ * so `wildo config validate`, `wildo config sync` and `wildo lock check` cannot disagree about which
31
+ * declarations they refuse: the two lockfile projections reach it through `materializeInfraSection`,
32
+ * which REQUIRES the set, and `config validate` calls {@link findUnservableBackingServiceDeclarations}
33
+ * directly.
34
+ *
35
+ * ## No opt-out, deliberately
36
+ *
37
+ * An earlier design offered `acceptUnresolved: true`. It was dropped: it makes a known-broken
38
+ * configuration representable, which is exactly a setting that looks like a control and does
39
+ * nothing. A kind becomes declarable as `MANAGED` in the same change that adds the module serving it.
40
+ */
41
+ /** Why a declaration cannot be served. */
42
+ export var BackingServiceUnservableReason;
43
+ (function (BackingServiceUnservableReason) {
44
+ /** The `(kind, source, provider)` tuple names no `InfraProvider` catalogue entry at all. */
45
+ BackingServiceUnservableReason["NO_PROVIDER"] = "no-provider";
46
+ /**
47
+ * It names a catalogue entry, but no provider module serves that entry — either none exists, or the
48
+ * one that exists declares `unservableReason`.
49
+ */
50
+ BackingServiceUnservableReason["NO_SERVING_MODULE"] = "no-serving-module";
51
+ /**
52
+ * A module serves the entry, but THIS platform holds no administrative credentials for it — an Atlas
53
+ * declaration on a platform with no Atlas API key, a self-hosted PostgreSQL declaration on a platform with
54
+ * no PostgreSQL admin (#1692).
55
+ *
56
+ * Only apps-manager can know this: which admin clients a platform holds is platform configuration, and one
57
+ * platform hosts many applications. The offline checks (`config validate` / `config sync` / `lock check`)
58
+ * never produce it. apps-manager refuses the registration rather than minting on another provider — a
59
+ * substitution would hand the application a credential for a server it does not connect to.
60
+ */
61
+ BackingServiceUnservableReason["NOT_HELD_BY_PLATFORM"] = "not-held-by-platform";
62
+ })(BackingServiceUnservableReason || (BackingServiceUnservableReason = {}));
63
+ /**
64
+ * For every `InfraProvider`, the SIMPLEST declaration that selects it — the inverse of
65
+ * `resolveInfraProvider`, used to tell an author what they may write instead.
66
+ *
67
+ * Total over `InfraProvider` (a `Record`), so a provider added to the catalogue is a compile error
68
+ * here until someone states how it is declared. That the inverse is truthful is pinned by a test that
69
+ * resolves every row back through `resolveInfraProvider`; it is never trusted by construction.
70
+ */
71
+ export const INFRA_PROVIDER_CANONICAL_DECLARATIONS = {
72
+ [InfraProvider.MONGODB_SELF]: { kind: BackingServiceKind.MONGODB, source: BackingServiceSource.SELF },
73
+ [InfraProvider.MONGODB_ATLAS]: { kind: BackingServiceKind.MONGODB, source: BackingServiceSource.MANAGED, provider: 'atlas' },
74
+ [InfraProvider.POSTGRES_SELF]: { kind: BackingServiceKind.POSTGRESQL, source: BackingServiceSource.SELF },
75
+ [InfraProvider.POSTGRES_MANAGED]: { kind: BackingServiceKind.POSTGRESQL, source: BackingServiceSource.MANAGED },
76
+ [InfraProvider.POSTGRES_AWS_RDS]: { kind: BackingServiceKind.POSTGRESQL, source: BackingServiceSource.MANAGED, provider: 'aws-rds' },
77
+ [InfraProvider.POSTGRES_GCP_CLOUD_SQL]: { kind: BackingServiceKind.POSTGRESQL, source: BackingServiceSource.MANAGED, provider: 'gcp-cloud-sql' },
78
+ [InfraProvider.POSTGRES_AZURE_DATABASE]: { kind: BackingServiceKind.POSTGRESQL, source: BackingServiceSource.MANAGED, provider: 'azure-database' },
79
+ [InfraProvider.POSTGRES_SUPABASE]: { kind: BackingServiceKind.POSTGRESQL, source: BackingServiceSource.MANAGED, provider: 'supabase' },
80
+ [InfraProvider.POSTGRES_NEON]: { kind: BackingServiceKind.POSTGRESQL, source: BackingServiceSource.MANAGED, provider: 'neon' },
81
+ [InfraProvider.POSTGRES_RENDER]: { kind: BackingServiceKind.POSTGRESQL, source: BackingServiceSource.MANAGED, provider: 'render' },
82
+ [InfraProvider.REDIS_SELF]: { kind: BackingServiceKind.REDIS, source: BackingServiceSource.SELF },
83
+ [InfraProvider.RABBITMQ_SELF]: { kind: BackingServiceKind.RABBITMQ, source: BackingServiceSource.SELF },
84
+ [InfraProvider.MINIO_SELF]: { kind: BackingServiceKind.S3, source: BackingServiceSource.SELF },
85
+ [InfraProvider.AWS_S3]: { kind: BackingServiceKind.S3, source: BackingServiceSource.MANAGED },
86
+ [InfraProvider.CLAMAV_SELF]: { kind: BackingServiceKind.CLAMAV, source: BackingServiceSource.SELF },
87
+ [InfraProvider.IMMUDB_SELF]: { kind: BackingServiceKind.IMMUDB, source: BackingServiceSource.SELF },
88
+ };
89
+ /**
90
+ * The servable declarations for one kind, one per servable provider, in catalogue order.
91
+ *
92
+ * Empty when nothing can serve the kind — then the only servable choice is not to declare it.
93
+ */
94
+ export function servableBackingServiceDeclarations(kind, servableProviders) {
95
+ const alternatives = [];
96
+ for (const provider of Object.values(InfraProvider)) {
97
+ if (!servableProviders.has(provider))
98
+ continue;
99
+ const declaration = INFRA_PROVIDER_CANONICAL_DECLARATIONS[provider];
100
+ if (declaration.kind !== kind)
101
+ continue;
102
+ alternatives.push({
103
+ source: declaration.source,
104
+ ...(declaration.provider === undefined ? {} : { provider: declaration.provider }),
105
+ });
106
+ }
107
+ return alternatives;
108
+ }
109
+ /**
110
+ * Every declaration in one environment that the platform cannot serve. Empty means every declared
111
+ * kind resolves to a provider in `servableProviders`.
112
+ *
113
+ * Pure. `servableProviders` comes from `collectServableInfraProviders()` in
114
+ * `@wildo-ai/platform-infra-providers`; see the file header for why it is an input.
115
+ */
116
+ export function findUnservableBackingServiceDeclarations(input) {
117
+ const findings = [];
118
+ if (!input.backingServices)
119
+ return findings;
120
+ for (const kind of Object.values(BackingServiceKind)) {
121
+ const entry = input.backingServices[kind];
122
+ if (!entry)
123
+ continue;
124
+ const finding = classifyBackingServiceDeclaration({
125
+ envName: input.envName,
126
+ kind,
127
+ declared: entry,
128
+ servableProviders: input.servableProviders,
129
+ });
130
+ if (finding)
131
+ findings.push(finding);
132
+ }
133
+ return findings;
134
+ }
135
+ /**
136
+ * One kind's declaration against a servable set: `undefined` when it resolves to a provider in the set,
137
+ * otherwise the finding. The single place the resolve-then-check rule lives, so the offline checks above and
138
+ * apps-manager's registration check below cannot disagree about what a declaration names.
139
+ */
140
+ function classifyBackingServiceDeclaration(input) {
141
+ const declared = {
142
+ source: input.declared.source,
143
+ ...(input.declared.provider === undefined ? {} : { provider: input.declared.provider }),
144
+ };
145
+ const resolvedProvider = resolveInfraProvider(input.kind, declared.source, declared.provider);
146
+ if (resolvedProvider !== undefined && input.servableProviders.has(resolvedProvider))
147
+ return undefined;
148
+ return {
149
+ envName: input.envName,
150
+ kind: input.kind,
151
+ declared,
152
+ reason: resolvedProvider === undefined
153
+ ? BackingServiceUnservableReason.NO_PROVIDER
154
+ : BackingServiceUnservableReason.NO_SERVING_MODULE,
155
+ ...(resolvedProvider === undefined ? {} : { resolvedProvider }),
156
+ servableAlternatives: servableBackingServiceDeclarations(input.kind, input.servableProviders),
157
+ };
158
+ }
159
+ /**
160
+ * The declarations an application REGISTERS with that THIS platform cannot serve — apps-manager's half of
161
+ * the servability check (#1692; the offline half is {@link findUnservableBackingServiceDeclarations}, #1693).
162
+ *
163
+ * Two sets, because they answer different questions:
164
+ *
165
+ * - `catalogueServableProviders` — what the provider-module catalogue can serve at all
166
+ * (`collectServableInfraProviders()`). Every DECLARED kind is checked against it: a declaration the
167
+ * catalogue refuses is refused here too, even if an older CLI let it through.
168
+ * - `platformServableProviders` — the subset this platform holds what it needs for (an admin client for a
169
+ * provider apps-manager mints on, nothing for one it does not). Checked only for `mintedKinds`, the kinds
170
+ * apps-manager mints a credential on for THIS application: an environment's declaration also names stores
171
+ * only the platform uses, and refusing an application over an admin client it would never use would be a
172
+ * refusal with nothing behind it.
173
+ *
174
+ * A catalogue finding keeps its catalogue reason; a provider the catalogue serves and this platform does not
175
+ * is {@link BackingServiceUnservableReason.NOT_HELD_BY_PLATFORM}. Alternatives are always what THIS platform
176
+ * can serve, because that is what the author can actually switch to here.
177
+ *
178
+ * Pure; apps-manager supplies both sets. An absent `declaredProviders` yields nothing — the previous
179
+ * behaviour for every kind (see `ApplicationBackingServiceProviderDeclarations`).
180
+ */
181
+ export function findBackingServiceDeclarationsThePlatformCannotServe(input) {
182
+ const findings = [];
183
+ if (!input.declaredProviders)
184
+ return findings;
185
+ const platformServable = new Set([...input.platformServableProviders].filter((provider) => input.catalogueServableProviders.has(provider)));
186
+ for (const kind of Object.values(BackingServiceKind)) {
187
+ const declared = input.declaredProviders[kind];
188
+ if (!declared)
189
+ continue;
190
+ const catalogueFinding = classifyBackingServiceDeclaration({
191
+ envName: input.envName,
192
+ kind,
193
+ declared,
194
+ servableProviders: input.catalogueServableProviders,
195
+ });
196
+ if (catalogueFinding) {
197
+ findings.push({ ...catalogueFinding, servableAlternatives: servableBackingServiceDeclarations(kind, platformServable) });
198
+ continue;
199
+ }
200
+ if (!input.mintedKinds.has(kind))
201
+ continue;
202
+ const platformFinding = classifyBackingServiceDeclaration({ envName: input.envName, kind, declared, servableProviders: platformServable });
203
+ if (platformFinding)
204
+ findings.push({ ...platformFinding, reason: BackingServiceUnservableReason.NOT_HELD_BY_PLATFORM });
205
+ }
206
+ return findings;
207
+ }
208
+ function describeUnservableReason(finding) {
209
+ switch (finding.reason) {
210
+ case BackingServiceUnservableReason.NO_PROVIDER:
211
+ return 'names no infrastructure provider';
212
+ case BackingServiceUnservableReason.NO_SERVING_MODULE:
213
+ return `names provider '${finding.resolvedProvider}', which no provider module can serve yet`;
214
+ case BackingServiceUnservableReason.NOT_HELD_BY_PLATFORM:
215
+ return `names provider '${finding.resolvedProvider}', for which this platform holds no administrative credentials, `
216
+ + 'so apps-manager cannot mint on it (which admin clients a platform holds is platform configuration)';
217
+ }
218
+ }
219
+ function renderSelection(selection) {
220
+ return selection.provider === undefined
221
+ ? `{ source: '${selection.source}' }`
222
+ : `{ source: '${selection.source}', provider: '${selection.provider}' }`;
223
+ }
224
+ /**
225
+ * One line per finding: the environment, the kind, what was declared, why it cannot be served, and
226
+ * the declarations that ARE servable for that kind. Shared by every caller so the wording is one.
227
+ */
228
+ export function describeUnservableBackingServiceDeclaration(finding) {
229
+ const why = describeUnservableReason(finding);
230
+ const instead = finding.servableAlternatives.length === 0
231
+ ? 'nothing can serve this kind today, so do not declare it'
232
+ : `servable declarations for '${finding.kind}': ${finding.servableAlternatives.map(renderSelection).join(' | ')}`;
233
+ return `environment '${finding.envName}': backingServices.${finding.kind} ${renderSelection(finding.declared)} ${why}; ${instead}.`;
234
+ }
235
+ /** Thrown when a declaration the platform cannot serve reaches a lockfile projection. */
236
+ export class UnservableBackingServiceDeclarationError extends Error {
237
+ findings;
238
+ constructor(findings) {
239
+ super('These backing-service declarations cannot be served, so the platform would hand the application '
240
+ + 'a credential for a server it never connects to:\n'
241
+ + findings.map((finding) => ` - ${describeUnservableBackingServiceDeclaration(finding)}`).join('\n'));
242
+ this.name = 'UnservableBackingServiceDeclarationError';
243
+ this.findings = findings;
244
+ }
245
+ }
246
+ /** Refuse, naming every unservable declaration across every environment at once. */
247
+ export function assertBackingServiceDeclarationsServable(input) {
248
+ const findings = input.envs.flatMap((env) => findUnservableBackingServiceDeclarations({
249
+ envName: env.envName,
250
+ backingServices: env.backingServices,
251
+ servableProviders: input.servableProviders,
252
+ }));
253
+ if (findings.length > 0)
254
+ throw new UnservableBackingServiceDeclarationError(findings);
255
+ }
256
+ //# sourceMappingURL=backing-service-servability.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"backing-service-servability.js","sourceRoot":"","sources":["../../../../../src/project-config/shared/backing-service-servability.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,oBA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AK,CACH,kGAAkG;cAChG,mDAAmD;cACnD,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,2CAA2C,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CACtG,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,0CAA0C,CAAC;QACvD,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;CACF;AAED,oFAAoF;AACpF,MAAM,UAAU,wCAAwC,CAAC,KAGxD;IACC,MAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,wCAAwC,CAAC;QACpF,OAAO,EAAE,GAAG,CAAC,OAAO;QACpB,eAAe,EAAE,GAAG,CAAC,eAAe;QACpC,iBAAiB,EAAE,KAAK,CAAC,iBAAiB;KAC3C,CAAC,CAAC,CAAC;IACJ,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC;QAAE,MAAM,IAAI,wCAAwC,CAAC,QAAQ,CAAC,CAAC;AACxF,CAAC","sourcesContent":["import {\n BackingServiceKind,\n BackingServiceSource,\n resolveInfraProvider,\n type BackingServicesEnvConfig,\n} from './backing-services.schemas';\nimport { InfraProvider } from './infra-providers.schemas';\n\n/**\n * Is a `backingServices` declaration one the platform can actually SERVE?\n *\n * ## The defect this closes (#1693)\n *\n * A declaration used to be accepted when it merely parsed. Two classes of parseable declaration serve\n * nothing, and both passed `wildo config sync` and `wildo lock check` in silence:\n *\n * 1. **It resolves to no provider** — `redis: { source: MANAGED }`, a managed MongoDB brand other\n * than `'atlas'`. The lockfile materializer skipped the kind without a word.\n * 2. **It resolves to a provider no module can serve** — the seven managed PostgreSQL entries have no\n * module, and `AWS_S3` has one whose credential broker does not exist yet (#14). The materializer\n * fell back to hashing the authored entry, so the lockfile recorded a selection nothing executes.\n *\n * Neither \"provisions nothing\". The generators honour `source`, so a MANAGED cache gets no\n * self-hosted workload — while apps-manager, which named its modules and was never told the\n * declaration, minted the application's credential on the PLATFORM's own server. The application\n * received a credential for a server it never connects to. Since #1692 apps-manager is told, dispatches\n * on the declared provider and refuses one it cannot serve\n * ({@link findBackingServiceDeclarationsThePlatformCannotServe}); this offline check stops the same\n * declarations before they reach it.\n *\n * ## Why the servable set is an INPUT here, not computed here\n *\n * Servability is a property of the provider-module CATALOGUE (`@wildo-ai/platform-infra-providers`),\n * and that package depends on this one — never the reverse. So the catalogue derives the set\n * (`collectServableInfraProviders()`) and every caller hands it in. The check itself lives here, once,\n * so `wildo config validate`, `wildo config sync` and `wildo lock check` cannot disagree about which\n * declarations they refuse: the two lockfile projections reach it through `materializeInfraSection`,\n * which REQUIRES the set, and `config validate` calls {@link findUnservableBackingServiceDeclarations}\n * directly.\n *\n * ## No opt-out, deliberately\n *\n * An earlier design offered `acceptUnresolved: true`. It was dropped: it makes a known-broken\n * configuration representable, which is exactly a setting that looks like a control and does\n * nothing. A kind becomes declarable as `MANAGED` in the same change that adds the module serving it.\n */\n\n/** Why a declaration cannot be served. */\nexport enum BackingServiceUnservableReason {\n /** The `(kind, source, provider)` tuple names no `InfraProvider` catalogue entry at all. */\n NO_PROVIDER = 'no-provider',\n /**\n * It names a catalogue entry, but no provider module serves that entry — either none exists, or the\n * one that exists declares `unservableReason`.\n */\n NO_SERVING_MODULE = 'no-serving-module',\n /**\n * A module serves the entry, but THIS platform holds no administrative credentials for it — an Atlas\n * declaration on a platform with no Atlas API key, a self-hosted PostgreSQL declaration on a platform with\n * no PostgreSQL admin (#1692).\n *\n * Only apps-manager can know this: which admin clients a platform holds is platform configuration, and one\n * platform hosts many applications. The offline checks (`config validate` / `config sync` / `lock check`)\n * never produce it. apps-manager refuses the registration rather than minting on another provider — a\n * substitution would hand the application a credential for a server it does not connect to.\n */\n NOT_HELD_BY_PLATFORM = 'not-held-by-platform',\n}\n\n/** The authored half of a backing-service entry that decides which provider it names. */\nexport interface BackingServiceProviderSelection {\n source: BackingServiceSource;\n /** The brand, when the kind distinguishes several. See `resolveInfraProvider` for the vocabulary. */\n provider?: string;\n}\n\n/** The simplest authored declaration that selects one catalogue entry. */\nexport interface InfraProviderCanonicalDeclaration extends BackingServiceProviderSelection {\n kind: BackingServiceKind;\n}\n\n/**\n * For every `InfraProvider`, the SIMPLEST declaration that selects it — the inverse of\n * `resolveInfraProvider`, used to tell an author what they may write instead.\n *\n * Total over `InfraProvider` (a `Record`), so a provider added to the catalogue is a compile error\n * here until someone states how it is declared. That the inverse is truthful is pinned by a test that\n * resolves every row back through `resolveInfraProvider`; it is never trusted by construction.\n */\nexport const INFRA_PROVIDER_CANONICAL_DECLARATIONS: Readonly<Record<InfraProvider, InfraProviderCanonicalDeclaration>> = {\n [InfraProvider.MONGODB_SELF]: { kind: BackingServiceKind.MONGODB, source: BackingServiceSource.SELF },\n [InfraProvider.MONGODB_ATLAS]: { kind: BackingServiceKind.MONGODB, source: BackingServiceSource.MANAGED, provider: 'atlas' },\n [InfraProvider.POSTGRES_SELF]: { kind: BackingServiceKind.POSTGRESQL, source: BackingServiceSource.SELF },\n [InfraProvider.POSTGRES_MANAGED]: { kind: BackingServiceKind.POSTGRESQL, source: BackingServiceSource.MANAGED },\n [InfraProvider.POSTGRES_AWS_RDS]: { kind: BackingServiceKind.POSTGRESQL, source: BackingServiceSource.MANAGED, provider: 'aws-rds' },\n [InfraProvider.POSTGRES_GCP_CLOUD_SQL]: { kind: BackingServiceKind.POSTGRESQL, source: BackingServiceSource.MANAGED, provider: 'gcp-cloud-sql' },\n [InfraProvider.POSTGRES_AZURE_DATABASE]: { kind: BackingServiceKind.POSTGRESQL, source: BackingServiceSource.MANAGED, provider: 'azure-database' },\n [InfraProvider.POSTGRES_SUPABASE]: { kind: BackingServiceKind.POSTGRESQL, source: BackingServiceSource.MANAGED, provider: 'supabase' },\n [InfraProvider.POSTGRES_NEON]: { kind: BackingServiceKind.POSTGRESQL, source: BackingServiceSource.MANAGED, provider: 'neon' },\n [InfraProvider.POSTGRES_RENDER]: { kind: BackingServiceKind.POSTGRESQL, source: BackingServiceSource.MANAGED, provider: 'render' },\n [InfraProvider.REDIS_SELF]: { kind: BackingServiceKind.REDIS, source: BackingServiceSource.SELF },\n [InfraProvider.RABBITMQ_SELF]: { kind: BackingServiceKind.RABBITMQ, source: BackingServiceSource.SELF },\n [InfraProvider.MINIO_SELF]: { kind: BackingServiceKind.S3, source: BackingServiceSource.SELF },\n [InfraProvider.AWS_S3]: { kind: BackingServiceKind.S3, source: BackingServiceSource.MANAGED },\n [InfraProvider.CLAMAV_SELF]: { kind: BackingServiceKind.CLAMAV, source: BackingServiceSource.SELF },\n [InfraProvider.IMMUDB_SELF]: { kind: BackingServiceKind.IMMUDB, source: BackingServiceSource.SELF },\n};\n\n/** One declaration the platform cannot serve, with everything the refusal message needs. */\nexport interface UnservableBackingServiceDeclaration {\n envName: string;\n kind: BackingServiceKind;\n declared: BackingServiceProviderSelection;\n reason: BackingServiceUnservableReason;\n /** The catalogue entry it names, when it names one (`NO_SERVING_MODULE`). */\n resolvedProvider?: InfraProvider;\n /** The simplest servable declarations for the same kind — what the author may write instead. */\n servableAlternatives: ReadonlyArray<BackingServiceProviderSelection>;\n}\n\n/**\n * The servable declarations for one kind, one per servable provider, in catalogue order.\n *\n * Empty when nothing can serve the kind — then the only servable choice is not to declare it.\n */\nexport function servableBackingServiceDeclarations(\n kind: BackingServiceKind,\n servableProviders: ReadonlySet<InfraProvider>,\n): ReadonlyArray<BackingServiceProviderSelection> {\n const alternatives: BackingServiceProviderSelection[] = [];\n for (const provider of Object.values(InfraProvider)) {\n if (!servableProviders.has(provider)) continue;\n const declaration = INFRA_PROVIDER_CANONICAL_DECLARATIONS[provider];\n if (declaration.kind !== kind) continue;\n alternatives.push({\n source: declaration.source,\n ...(declaration.provider === undefined ? {} : { provider: declaration.provider }),\n });\n }\n return alternatives;\n}\n\n/**\n * Every declaration in one environment that the platform cannot serve. Empty means every declared\n * kind resolves to a provider in `servableProviders`.\n *\n * Pure. `servableProviders` comes from `collectServableInfraProviders()` in\n * `@wildo-ai/platform-infra-providers`; see the file header for why it is an input.\n */\nexport function findUnservableBackingServiceDeclarations(input: {\n envName: string;\n backingServices: BackingServicesEnvConfig | undefined;\n servableProviders: ReadonlySet<InfraProvider>;\n}): UnservableBackingServiceDeclaration[] {\n const findings: UnservableBackingServiceDeclaration[] = [];\n if (!input.backingServices) return findings;\n\n for (const kind of Object.values(BackingServiceKind)) {\n const entry = input.backingServices[kind];\n if (!entry) continue;\n const finding = classifyBackingServiceDeclaration({\n envName: input.envName,\n kind,\n declared: entry,\n servableProviders: input.servableProviders,\n });\n if (finding) findings.push(finding);\n }\n return findings;\n}\n\n/**\n * One kind's declaration against a servable set: `undefined` when it resolves to a provider in the set,\n * otherwise the finding. The single place the resolve-then-check rule lives, so the offline checks above and\n * apps-manager's registration check below cannot disagree about what a declaration names.\n */\nfunction classifyBackingServiceDeclaration(input: {\n envName: string;\n kind: BackingServiceKind;\n declared: BackingServiceProviderSelection;\n servableProviders: ReadonlySet<InfraProvider>;\n}): UnservableBackingServiceDeclaration | undefined {\n const declared: BackingServiceProviderSelection = {\n source: input.declared.source,\n ...(input.declared.provider === undefined ? {} : { provider: input.declared.provider }),\n };\n const resolvedProvider = resolveInfraProvider(input.kind, declared.source, declared.provider);\n if (resolvedProvider !== undefined && input.servableProviders.has(resolvedProvider)) return undefined;\n return {\n envName: input.envName,\n kind: input.kind,\n declared,\n reason: resolvedProvider === undefined\n ? BackingServiceUnservableReason.NO_PROVIDER\n : BackingServiceUnservableReason.NO_SERVING_MODULE,\n ...(resolvedProvider === undefined ? {} : { resolvedProvider }),\n servableAlternatives: servableBackingServiceDeclarations(input.kind, input.servableProviders),\n };\n}\n\n/**\n * The declarations an application REGISTERS with that THIS platform cannot serve — apps-manager's half of\n * the servability check (#1692; the offline half is {@link findUnservableBackingServiceDeclarations}, #1693).\n *\n * Two sets, because they answer different questions:\n *\n * - `catalogueServableProviders` — what the provider-module catalogue can serve at all\n * (`collectServableInfraProviders()`). Every DECLARED kind is checked against it: a declaration the\n * catalogue refuses is refused here too, even if an older CLI let it through.\n * - `platformServableProviders` — the subset this platform holds what it needs for (an admin client for a\n * provider apps-manager mints on, nothing for one it does not). Checked only for `mintedKinds`, the kinds\n * apps-manager mints a credential on for THIS application: an environment's declaration also names stores\n * only the platform uses, and refusing an application over an admin client it would never use would be a\n * refusal with nothing behind it.\n *\n * A catalogue finding keeps its catalogue reason; a provider the catalogue serves and this platform does not\n * is {@link BackingServiceUnservableReason.NOT_HELD_BY_PLATFORM}. Alternatives are always what THIS platform\n * can serve, because that is what the author can actually switch to here.\n *\n * Pure; apps-manager supplies both sets. An absent `declaredProviders` yields nothing — the previous\n * behaviour for every kind (see `ApplicationBackingServiceProviderDeclarations`).\n */\nexport function findBackingServiceDeclarationsThePlatformCannotServe(input: {\n envName: string;\n declaredProviders: Partial<Record<BackingServiceKind, BackingServiceProviderSelection>> | undefined;\n mintedKinds: ReadonlySet<BackingServiceKind>;\n catalogueServableProviders: ReadonlySet<InfraProvider>;\n platformServableProviders: ReadonlySet<InfraProvider>;\n}): UnservableBackingServiceDeclaration[] {\n const findings: UnservableBackingServiceDeclaration[] = [];\n if (!input.declaredProviders) return findings;\n const platformServable = new Set(\n [...input.platformServableProviders].filter((provider) => input.catalogueServableProviders.has(provider)),\n );\n\n for (const kind of Object.values(BackingServiceKind)) {\n const declared = input.declaredProviders[kind];\n if (!declared) continue;\n const catalogueFinding = classifyBackingServiceDeclaration({\n envName: input.envName,\n kind,\n declared,\n servableProviders: input.catalogueServableProviders,\n });\n if (catalogueFinding) {\n findings.push({ ...catalogueFinding, servableAlternatives: servableBackingServiceDeclarations(kind, platformServable) });\n continue;\n }\n if (!input.mintedKinds.has(kind)) continue;\n const platformFinding = classifyBackingServiceDeclaration({ envName: input.envName, kind, declared, servableProviders: platformServable });\n if (platformFinding) findings.push({ ...platformFinding, reason: BackingServiceUnservableReason.NOT_HELD_BY_PLATFORM });\n }\n return findings;\n}\n\nfunction describeUnservableReason(finding: UnservableBackingServiceDeclaration): string {\n switch (finding.reason) {\n case BackingServiceUnservableReason.NO_PROVIDER:\n return 'names no infrastructure provider';\n case BackingServiceUnservableReason.NO_SERVING_MODULE:\n return `names provider '${finding.resolvedProvider}', which no provider module can serve yet`;\n case BackingServiceUnservableReason.NOT_HELD_BY_PLATFORM:\n return `names provider '${finding.resolvedProvider}', for which this platform holds no administrative credentials, `\n + 'so apps-manager cannot mint on it (which admin clients a platform holds is platform configuration)';\n }\n}\n\nfunction renderSelection(selection: BackingServiceProviderSelection): string {\n return selection.provider === undefined\n ? `{ source: '${selection.source}' }`\n : `{ source: '${selection.source}', provider: '${selection.provider}' }`;\n}\n\n/**\n * One line per finding: the environment, the kind, what was declared, why it cannot be served, and\n * the declarations that ARE servable for that kind. Shared by every caller so the wording is one.\n */\nexport function describeUnservableBackingServiceDeclaration(finding: UnservableBackingServiceDeclaration): string {\n const why = describeUnservableReason(finding);\n const instead = finding.servableAlternatives.length === 0\n ? 'nothing can serve this kind today, so do not declare it'\n : `servable declarations for '${finding.kind}': ${finding.servableAlternatives.map(renderSelection).join(' | ')}`;\n return `environment '${finding.envName}': backingServices.${finding.kind} ${renderSelection(finding.declared)} ${why}; ${instead}.`;\n}\n\n/** Thrown when a declaration the platform cannot serve reaches a lockfile projection. */\nexport class UnservableBackingServiceDeclarationError extends Error {\n readonly findings: ReadonlyArray<UnservableBackingServiceDeclaration>;\n\n constructor(findings: ReadonlyArray<UnservableBackingServiceDeclaration>) {\n super(\n 'These backing-service declarations cannot be served, so the platform would hand the application '\n + 'a credential for a server it never connects to:\\n'\n + findings.map((finding) => ` - ${describeUnservableBackingServiceDeclaration(finding)}`).join('\\n'),\n );\n this.name = 'UnservableBackingServiceDeclarationError';\n this.findings = findings;\n }\n}\n\n/** Refuse, naming every unservable declaration across every environment at once. */\nexport function assertBackingServiceDeclarationsServable(input: {\n envs: ReadonlyArray<{ envName: string; backingServices: BackingServicesEnvConfig | undefined }>;\n servableProviders: ReadonlySet<InfraProvider>;\n}): void {\n const findings = input.envs.flatMap((env) => findUnservableBackingServiceDeclarations({\n envName: env.envName,\n backingServices: env.backingServices,\n servableProviders: input.servableProviders,\n }));\n if (findings.length > 0) throw new UnservableBackingServiceDeclarationError(findings);\n}\n"]}