@wildo-ai/platform-config-lib 1.1.4 → 1.1.5
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.
- package/dist/esm/bootstrap/application-backend-env.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/bootstrap-planner.d.ts.map +1 -1
- package/dist/esm/bootstrap/bootstrap.contracts.d.ts +23 -1
- package/dist/esm/bootstrap/bootstrap.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/bootstrap.contracts.js +24 -0
- package/dist/esm/bootstrap/bootstrap.contracts.js.map +1 -1
- package/dist/esm/bootstrap/bootstrap.schemas.d.ts +70 -1
- package/dist/esm/bootstrap/bootstrap.schemas.d.ts.map +1 -1
- package/dist/esm/bootstrap/bootstrap.schemas.js +55 -4
- package/dist/esm/bootstrap/bootstrap.schemas.js.map +1 -1
- package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts +12 -0
- package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/platform-runtime-env.contracts.js +12 -0
- package/dist/esm/bootstrap/platform-runtime-env.contracts.js.map +1 -1
- package/dist/esm/bootstrap/runtime-backing-service-access.d.ts.map +1 -1
- package/dist/esm/bootstrap/runtime-network-policy.d.ts.map +1 -1
- package/dist/esm/bootstrap/runtime-network-topology.d.ts.map +1 -1
- package/dist/esm/bootstrap/runtime-network-topology.js.map +1 -1
- package/dist/esm/bootstrap/runtime-platform-access.d.ts.map +1 -1
- package/dist/esm/bootstrap/runtime-principal.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/runtime-topology.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/wildo-owner-organization.contracts.d.ts +29 -0
- package/dist/esm/bootstrap/wildo-owner-organization.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/wildo-owner-organization.contracts.js +39 -0
- package/dist/esm/bootstrap/wildo-owner-organization.contracts.js.map +1 -1
- package/dist/esm/config-authoring.entry.d.ts.map +1 -1
- package/dist/esm/config-authoring.entry.js.map +1 -1
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/lockfile/build-parallelism.d.ts +40 -0
- package/dist/esm/lockfile/build-parallelism.d.ts.map +1 -0
- package/dist/esm/lockfile/build-parallelism.js +64 -0
- package/dist/esm/lockfile/build-parallelism.js.map +1 -0
- package/dist/esm/lockfile/lockfile-io.d.ts.map +1 -1
- package/dist/esm/lockfile/materialize-infra-section.d.ts +1 -1
- package/dist/esm/lockfile/materialize-infra-section.d.ts.map +1 -1
- package/dist/esm/lockfile/materialize-infra-section.js +1 -1
- package/dist/esm/lockfile/materialize-infra-section.js.map +1 -1
- package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.d.ts.map +1 -1
- package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.js.map +1 -1
- package/dist/esm/project-config/define-framework-config.d.ts.map +1 -1
- package/dist/esm/project-config/define-infra-env-config.d.ts +899 -15
- package/dist/esm/project-config/define-infra-env-config.d.ts.map +1 -1
- package/dist/esm/project-config/define-infra-env-config.js +397 -16
- package/dist/esm/project-config/define-infra-env-config.js.map +1 -1
- package/dist/esm/project-config/define-minion-config.d.ts.map +1 -1
- package/dist/esm/project-config/define-minion-config.js +1 -2
- package/dist/esm/project-config/define-minion-config.js.map +1 -1
- package/dist/esm/project-config/define-saas-config.d.ts +90 -25
- package/dist/esm/project-config/define-saas-config.d.ts.map +1 -1
- package/dist/esm/project-config/define-saas-config.js +165 -12
- package/dist/esm/project-config/define-saas-config.js.map +1 -1
- package/dist/esm/project-config/define-worker-config.d.ts.map +1 -1
- package/dist/esm/project-config/hosted-infra-env-config.d.ts +59 -0
- package/dist/esm/project-config/hosted-infra-env-config.d.ts.map +1 -0
- package/dist/esm/project-config/hosted-infra-env-config.js +187 -0
- package/dist/esm/project-config/hosted-infra-env-config.js.map +1 -0
- package/dist/esm/project-config/index.d.ts +3 -0
- package/dist/esm/project-config/index.d.ts.map +1 -1
- package/dist/esm/project-config/index.js +3 -0
- package/dist/esm/project-config/index.js.map +1 -1
- package/dist/esm/project-config/loader.d.ts +24 -0
- package/dist/esm/project-config/loader.d.ts.map +1 -1
- package/dist/esm/project-config/loader.js +114 -1
- package/dist/esm/project-config/loader.js.map +1 -1
- package/dist/esm/project-config/provider-catalog-types.d.ts.map +1 -1
- package/dist/esm/project-config/provider-companion-discovery.d.ts +32 -0
- package/dist/esm/project-config/provider-companion-discovery.d.ts.map +1 -1
- package/dist/esm/project-config/provider-companion-discovery.js +82 -12
- package/dist/esm/project-config/provider-companion-discovery.js.map +1 -1
- package/dist/esm/project-config/provider-runtime-artifacts.d.ts +71 -22
- package/dist/esm/project-config/provider-runtime-artifacts.d.ts.map +1 -1
- package/dist/esm/project-config/provider-runtime-artifacts.js +135 -13
- package/dist/esm/project-config/provider-runtime-artifacts.js.map +1 -1
- package/dist/esm/project-config/shared/application-creation-verification.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/application-modules.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/application-modules.utils.d.ts.map +1 -1
- package/dist/esm/project-config/shared/auth.schemas.d.ts +14 -35
- package/dist/esm/project-config/shared/auth.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/auth.schemas.js +14 -35
- package/dist/esm/project-config/shared/auth.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/backing-services.schemas.d.ts +17 -12
- package/dist/esm/project-config/shared/backing-services.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/backing-services.schemas.js +17 -12
- package/dist/esm/project-config/shared/backing-services.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/cdn.example.d.ts.map +1 -1
- package/dist/esm/project-config/shared/cdn.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/csp-defaults.d.ts.map +1 -1
- package/dist/esm/project-config/shared/csp-emit.d.ts.map +1 -1
- package/dist/esm/project-config/shared/csp-emit.js.map +1 -1
- package/dist/esm/project-config/shared/csp.schemas.d.ts +11 -12
- package/dist/esm/project-config/shared/csp.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/csp.schemas.js +11 -12
- package/dist/esm/project-config/shared/csp.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/data-services.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/env-example-defaults.d.ts.map +1 -1
- package/dist/esm/project-config/shared/environment.schemas.d.ts +152 -12
- package/dist/esm/project-config/shared/environment.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/environment.schemas.js +186 -9
- package/dist/esm/project-config/shared/environment.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/infra-providers.schemas.d.ts +5 -6
- package/dist/esm/project-config/shared/infra-providers.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/infra-providers.schemas.js +0 -3
- package/dist/esm/project-config/shared/infra-providers.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/infra-service.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/infrastructure-defaults.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/infrastructure-defaults.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/k8s-utils.d.ts.map +1 -1
- package/dist/esm/project-config/shared/k8s-utils.js.map +1 -1
- package/dist/esm/project-config/shared/minion-platform-access.vocabulary.d.ts.map +1 -1
- package/dist/esm/project-config/shared/minion-platform-access.vocabulary.js.map +1 -1
- package/dist/esm/project-config/shared/minion-resource-access.validation.d.ts +77 -47
- package/dist/esm/project-config/shared/minion-resource-access.validation.d.ts.map +1 -1
- package/dist/esm/project-config/shared/minion-resource-access.validation.js +114 -52
- package/dist/esm/project-config/shared/minion-resource-access.validation.js.map +1 -1
- package/dist/esm/project-config/shared/platform-services.schemas.d.ts +50 -0
- package/dist/esm/project-config/shared/platform-services.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/platform-services.schemas.js +57 -0
- package/dist/esm/project-config/shared/platform-services.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/platform-storage.schemas.d.ts +35 -0
- package/dist/esm/project-config/shared/platform-storage.schemas.d.ts.map +1 -0
- package/dist/esm/project-config/shared/platform-storage.schemas.js +37 -0
- package/dist/esm/project-config/shared/platform-storage.schemas.js.map +1 -0
- package/dist/esm/project-config/shared/schema-version.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/service-definitions.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/systems-of-record-env.schemas.d.ts +81 -0
- package/dist/esm/project-config/shared/systems-of-record-env.schemas.d.ts.map +1 -0
- package/dist/esm/project-config/shared/systems-of-record-env.schemas.js +74 -0
- package/dist/esm/project-config/shared/systems-of-record-env.schemas.js.map +1 -0
- package/dist/esm/registry/artifact-domain.schemas.d.ts +1 -1
- package/dist/esm/registry/artifact-domain.schemas.d.ts.map +1 -1
- package/dist/esm/registry/companion-api.schemas.d.ts.map +1 -1
- package/dist/esm/registry/digest.schemas.d.ts.map +1 -1
- package/dist/esm/registry/index.d.ts.map +1 -1
- package/dist/esm/registry/lockfile-modules-section.schemas.d.ts.map +1 -1
- package/dist/esm/registry/module-artifact.schemas.d.ts.map +1 -1
- package/dist/esm/registry/module-manifest.schemas.d.ts +10 -16
- package/dist/esm/registry/module-manifest.schemas.d.ts.map +1 -1
- package/dist/esm/registry/module-manifest.schemas.js +14 -20
- package/dist/esm/registry/module-manifest.schemas.js.map +1 -1
- package/dist/esm/registry/registry-config.schemas.d.ts.map +1 -1
- package/dist/esm/registry/registry-section-schemas.constants.d.ts.map +1 -1
- package/dist/esm/release/framework-release.constants.d.ts.map +1 -1
- package/dist/esm/release/framework-release.constants.js.map +1 -1
- package/dist/esm/schemas/framework-info.schemas.d.ts.map +1 -1
- package/dist/esm/schemas/framework-secrets.schemas.d.ts +12 -1
- package/dist/esm/schemas/framework-secrets.schemas.d.ts.map +1 -1
- package/dist/esm/schemas/framework-secrets.schemas.js +14 -1
- package/dist/esm/schemas/framework-secrets.schemas.js.map +1 -1
- package/dist/esm/schemas/platform-application-config.schemas.d.ts.map +1 -1
- package/dist/esm/schemas/platform-application-secrets.schemas.d.ts.map +1 -1
- package/dist/esm/schemas/platform-config.schemas.d.ts.map +1 -1
- package/dist/esm/workspace-scope/application-subject-manifest.d.ts.map +1 -1
- package/dist/esm/workspace-scope/index.d.ts.map +1 -1
- package/dist/esm/workspace-scope/resolve-homes.d.ts.map +1 -1
- package/dist/esm/workspace-scope/workspace-homes.schemas.d.ts +4 -3
- package/dist/esm/workspace-scope/workspace-homes.schemas.d.ts.map +1 -1
- package/dist/esm/workspace-scope/workspace-homes.schemas.js +6 -5
- package/dist/esm/workspace-scope/workspace-homes.schemas.js.map +1 -1
- package/dist/esm/workspace-scope/workspace-scope.schemas.d.ts +15 -6
- package/dist/esm/workspace-scope/workspace-scope.schemas.d.ts.map +1 -1
- package/dist/esm/workspace-scope/workspace-scope.schemas.js +23 -9
- package/dist/esm/workspace-scope/workspace-scope.schemas.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +7 -7
|
@@ -1,5 +1,44 @@
|
|
|
1
|
+
import { CORE_ORG_ROLES, RegistrationMode, UserTypeDefinitionSchema } from '@wildo-ai/saas-models';
|
|
2
|
+
/**
|
|
3
|
+
* The user type the platform seeds its first administrator with, and the one its organization type grants.
|
|
4
|
+
*
|
|
5
|
+
* Declared because it was already HELD: the platform's INIT seed gave its first administrator `member` long before
|
|
6
|
+
* the platform declared any user type, and nothing checked the pair until organization types — whose granted user
|
|
7
|
+
* types must be declared — became mandatory (#1032). Registration is DISABLED: a platform user exists because the
|
|
8
|
+
* platform seeded them, never because someone signed up.
|
|
9
|
+
*/
|
|
10
|
+
export const WILDO_PLATFORM_MEMBER_USER_TYPE = 'member';
|
|
11
|
+
export const WILDO_PLATFORM_USER_TYPES = {
|
|
12
|
+
[WILDO_PLATFORM_MEMBER_USER_TYPE]: UserTypeDefinitionSchema.parse({
|
|
13
|
+
auth: { registration: { mode: RegistrationMode.DISABLED } },
|
|
14
|
+
}),
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* The ONE organization type the platform's own tenancy declares (#1032, decided 2026-09-14).
|
|
18
|
+
*
|
|
19
|
+
* Every organization carries a type that names a declared organization type, because a member of an
|
|
20
|
+
* organization whose type resolves to nothing cannot sign in. An application declares its types in
|
|
21
|
+
* `wildo.saas.config.ts`; the platform has no such file, so its declaration lives here, beside the
|
|
22
|
+
* identity of the organization it types. Before this, the platform seeded its organizations with no
|
|
23
|
+
* type at all, and `wildo_platform` held two of them.
|
|
24
|
+
*
|
|
25
|
+
* It grants {@link WILDO_PLATFORM_MEMBER_USER_TYPE}, the user type the platform's INIT seeds its first administrator
|
|
26
|
+
* with, so the platform's own first-organization derivation resolves to this type rather than refusing — and a
|
|
27
|
+
* configuration carrying this map must carry {@link WILDO_PLATFORM_USER_TYPES} beside it, or its granted user type
|
|
28
|
+
* is undeclared.
|
|
29
|
+
*/
|
|
30
|
+
export const WILDO_PLATFORM_ORGANIZATION_TYPE = 'platform-operator';
|
|
31
|
+
export const WILDO_PLATFORM_ORGANIZATION_TYPES = {
|
|
32
|
+
[WILDO_PLATFORM_ORGANIZATION_TYPE]: {
|
|
33
|
+
userTypes: [WILDO_PLATFORM_MEMBER_USER_TYPE],
|
|
34
|
+
availableOrgRoles: [CORE_ORG_ROLES.ORG_OWNER, CORE_ORG_ROLES.ORG_ADMIN, CORE_ORG_ROLES.ORG_MEMBER],
|
|
35
|
+
defaultMemberRole: CORE_ORG_ROLES.ORG_MEMBER,
|
|
36
|
+
authOverrides: undefined,
|
|
37
|
+
},
|
|
38
|
+
};
|
|
1
39
|
export const WILDO_OWNER_ORGANIZATION = {
|
|
2
40
|
slug: 'wildo',
|
|
3
41
|
name: 'Wildo',
|
|
42
|
+
type: WILDO_PLATFORM_ORGANIZATION_TYPE,
|
|
4
43
|
};
|
|
5
44
|
//# sourceMappingURL=wildo-owner-organization.contracts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wildo-owner-organization.contracts.js","sourceRoot":"","sources":["../../../../src/bootstrap/wildo-owner-organization.contracts.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"wildo-owner-organization.contracts.js","sourceRoot":"","sources":["../../../../src/bootstrap/wildo-owner-organization.contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,wBAAwB,EAAsD,MAAM,uBAAuB,CAAC;AAuDvJ;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAG,QAAQ,CAAC;AAExD,MAAM,CAAC,MAAM,yBAAyB,GAAoB;IACxD,CAAC,+BAA+B,CAAC,EAAE,wBAAwB,CAAC,KAAK,CAAC;QAChE,IAAI,EAAE,EAAE,YAAY,EAAE,EAAE,IAAI,EAAE,gBAAgB,CAAC,QAAQ,EAAE,EAAE;KAC5D,CAAC;CACH,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAAG,mBAAmB,CAAC;AAEpE,MAAM,CAAC,MAAM,iCAAiC,GAA4B;IACxE,CAAC,gCAAgC,CAAC,EAAE;QAClC,SAAS,EAAE,CAAC,+BAA+B,CAAC;QAC5C,iBAAiB,EAAE,CAAC,cAAc,CAAC,SAAS,EAAE,cAAc,CAAC,SAAS,EAAE,cAAc,CAAC,UAAU,CAAC;QAClG,iBAAiB,EAAE,cAAc,CAAC,UAAU;QAC5C,aAAa,EAAE,SAAS;KACzB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,wBAAwB,GAAmC;IACtE,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,gCAAgC;CACvC,CAAC","sourcesContent":["import { CORE_ORG_ROLES, RegistrationMode, UserTypeDefinitionSchema, type OrganizationTypesConfig, type UserTypesConfig } from '@wildo-ai/saas-models';\n\n/**\n * The ONE identity of the organization that owns Wildo's own applications.\n *\n * ## Why this constant exists\n *\n * This identity used to be hardcoded FOUR times, in two files, as TWO DIFFERENT VALUES — and the\n * result was a platform carrying two organizations, neither of them a customer:\n *\n * | declared in | value |\n * |---|---|\n * | `init-mode-startup.apps-manager.service.ts` (twice) | `wildo-platform` / `Wildo Platform` |\n * | `maintenance/services/app-initialization.service.ts` (twice) | `wildo` / `Wildo` |\n *\n * The two paths provision different things, so ownership split along them. Measured on the dogfood\n * platform (2026-09-01): `wildo-ai-application` — the bootstrap row — was owned by `wildo-platform`,\n * while `wonder-crm`, `wonder-todos` and `secrets-proof` were owned by `wildo`. Worse, OPERATOR\n * REACH followed the same split: the admin seeded by INIT was `ORG_ADMIN` of BOTH organizations,\n * while an admin seeded later by the maintenance path was a member of `wildo` ONLY. Nothing declared\n * that they should differ; it was decided by which code path happened to run.\n *\n * The bootstrap organization is also `ACTIVE` and authority-conferring, so everything that\n * ENUMERATES tenants — an organization switcher, the owner-floor boot report, a cross-tenant audit,\n * a subject-erasure sweep — counted a bootstrap artifact as a real tenant.\n *\n * ## Why ONE organization rather than two declared ones\n *\n * The second organization was never a design. `seedBootstrapApplicationRecord` needs *an* owner for\n * the minimal APPLICATION row it seeds to break a chicken-and-egg (an APPLICATION-primary-scoped\n * execution context resolves its `applicationId` by READING that row). It needs an owner; it never\n * needed a DIFFERENT one. Wildo owning all Wildo applications — including its own — is the coherent\n * reading, and it is what the duplication suggests was intended before the two literals drifted.\n *\n * If a future decision genuinely wants the platform's own application in a separate tenant, that is\n * a SECOND named constant here plus an explicit statement of which consumers must tell them apart —\n * not a second literal at a call site.\n *\n * ## What this does NOT do\n *\n * It does not retrofit an existing platform. Both bootstrap seeding arms look a row up by business\n * key and insert ONLY when absent, and the registration path prefers an existing application's\n * recorded `ownerOrganizationId` over the seeded id — so an installation that already carries two\n * organizations keeps both, with its existing linkage untouched. Only a FRESH platform gets one.\n * Merging the two on an existing installation is a migration with its own decision.\n */\nexport interface WildoOwnerOrganizationIdentity {\n /** Business key. Both provisioning paths upsert the organization by THIS field. */\n readonly slug: string;\n /** Display name written on first seed. */\n readonly name: string;\n /** The organization type written on first seed — a key of {@link WILDO_PLATFORM_ORGANIZATION_TYPES}. */\n readonly type: typeof WILDO_PLATFORM_ORGANIZATION_TYPE;\n}\n\n/**\n * The user type the platform seeds its first administrator with, and the one its organization type grants.\n *\n * Declared because it was already HELD: the platform's INIT seed gave its first administrator `member` long before\n * the platform declared any user type, and nothing checked the pair until organization types — whose granted user\n * types must be declared — became mandatory (#1032). Registration is DISABLED: a platform user exists because the\n * platform seeded them, never because someone signed up.\n */\nexport const WILDO_PLATFORM_MEMBER_USER_TYPE = 'member';\n\nexport const WILDO_PLATFORM_USER_TYPES: UserTypesConfig = {\n [WILDO_PLATFORM_MEMBER_USER_TYPE]: UserTypeDefinitionSchema.parse({\n auth: { registration: { mode: RegistrationMode.DISABLED } },\n }),\n};\n\n/**\n * The ONE organization type the platform's own tenancy declares (#1032, decided 2026-09-14).\n *\n * Every organization carries a type that names a declared organization type, because a member of an\n * organization whose type resolves to nothing cannot sign in. An application declares its types in\n * `wildo.saas.config.ts`; the platform has no such file, so its declaration lives here, beside the\n * identity of the organization it types. Before this, the platform seeded its organizations with no\n * type at all, and `wildo_platform` held two of them.\n *\n * It grants {@link WILDO_PLATFORM_MEMBER_USER_TYPE}, the user type the platform's INIT seeds its first administrator\n * with, so the platform's own first-organization derivation resolves to this type rather than refusing — and a\n * configuration carrying this map must carry {@link WILDO_PLATFORM_USER_TYPES} beside it, or its granted user type\n * is undeclared.\n */\nexport const WILDO_PLATFORM_ORGANIZATION_TYPE = 'platform-operator';\n\nexport const WILDO_PLATFORM_ORGANIZATION_TYPES: OrganizationTypesConfig = {\n [WILDO_PLATFORM_ORGANIZATION_TYPE]: {\n userTypes: [WILDO_PLATFORM_MEMBER_USER_TYPE],\n availableOrgRoles: [CORE_ORG_ROLES.ORG_OWNER, CORE_ORG_ROLES.ORG_ADMIN, CORE_ORG_ROLES.ORG_MEMBER],\n defaultMemberRole: CORE_ORG_ROLES.ORG_MEMBER,\n authOverrides: undefined,\n },\n};\n\nexport const WILDO_OWNER_ORGANIZATION: WildoOwnerOrganizationIdentity = {\n slug: 'wildo',\n name: 'Wildo',\n type: WILDO_PLATFORM_ORGANIZATION_TYPE,\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-authoring.entry.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"config-authoring.entry.d.ts","sourceRoot":"","sources":["../../../src/config-authoring.entry.ts"],"names":[],"mappings":"AAsCA,cAAc,SAAS,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-authoring.entry.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"config-authoring.entry.js","sourceRoot":"","sources":["../../../src/config-authoring.entry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D,iBAAiB,EAAE,CAAC;AAEpB,cAAc,SAAS,CAAC","sourcesContent":["/**\n * What `@wildo-ai/platform-config-lib` resolves to while the CONFIG LOADER evaluates a configuration\n * file from source (`loader.ts` → `resolvePlatformConfigLibEntry`).\n *\n * It is the package root plus one side effect: the Zod decorators are initialized before any schema\n * module in the evaluated graph runs, because a config file's own schemas may be authored with them\n * and the loader owns no other moment to do it.\n *\n * ## It re-exports the WHOLE root, and that is the point\n *\n * Until 2026-09-09 this entry exported `./project-config` and `./workspace-scope` and nothing else,\n * and the narrowing was never a boundary — it was a trap that fired twice, the same way both times.\n * The loader substitutes this file for the package specifier in EVERY module of the evaluated\n * graph, and that graph is not only the authored config: `wildo.saas.config.ts` and the backend\n * config import `@wildo-ai/saas-backend-lib`, which the loader also aliases to source, and the\n * engine's own modules import `@wildo-ai/platform-config-lib` expecting the root. A symbol the\n * root exports but this entry did not was not refused — under jiti it arrived as `undefined`, at\n * the first module-eval use:\n *\n * - `MinionPlatformAccessScope`: an app config importing it beside `AppFrontendType`, same\n * package, same statement, got one and `undefined` for the other. The symptom was answered by\n * moving the enum out of `bootstrap/` into `project-config/` (`minion-platform-access.vocabulary.ts`).\n * - `AdminAppManagedMinionsSchema` / `AdminAppManagedWorkersSchema`: the engine's configuration\n * loader began composing its wire schema from these at module load (removing a hand copy that\n * had silently stripped fields twice). Under the loader it threw\n * \"Cannot read properties of undefined (reading 'optional')\" and `wildo local dev` shut the\n * whole stack down at \"Registering application once and materializing every runtime target\".\n *\n * Moving symbols around cures one name at a time and teaches nothing; an entry that carries the\n * root's value surface cannot have this defect. Nothing in the root is unsafe here — the loader\n * runs under Node, and the root's Node-only modules (lockfile IO, credential generation) are\n * exactly what a Node process may load. If a module ever becomes unsuitable for config evaluation,\n * exclude THAT module from the root, explicitly, with its reason — never narrow this file again.\n */\nimport { initZodDecorators } from '@wildo-ai/zod-decorators';\n\ninitZodDecorators();\n\nexport * from './index';\n"]}
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -25,6 +25,7 @@ export * from './project-config/shared/minion-resource-access.validation';
|
|
|
25
25
|
export * from './project-config/shared/object-storage-session-policy';
|
|
26
26
|
export * from './lockfile/wildo-saas-lock.shared.schemas';
|
|
27
27
|
export * from './lockfile/lockfile-io';
|
|
28
|
+
export * from './lockfile/build-parallelism';
|
|
28
29
|
export * from './lockfile/materialize-infra-section';
|
|
29
30
|
export * from './lockfile/canonical-json';
|
|
30
31
|
export * from './registry';
|
package/dist/esm/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,4CAA4C,CAAC;AAE3D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,gDAAgD,CAAC;AAC/D,cAAc,mCAAmC,CAAC;AAClD,cAAc,kCAAkC,CAAC;AACjD,cAAc,qCAAqC,CAAC;AACpD,cAAc,uCAAuC,CAAC;AACtD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC;AAChD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+CAA+C,CAAC;AAC9D,cAAc,gDAAgD,CAAC;AAC/D,cAAc,6DAA6D,CAAC;AAC5E,cAAc,4CAA4C,CAAC;AAC3D,cAAc,wCAAwC,CAAC;AACvD,cAAc,yCAAyC,CAAC;AACxD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,sCAAsC,CAAC;AACrD,cAAc,oCAAoC,CAAC;AACnD,cAAc,qCAAqC,CAAC;AACpD,cAAc,qDAAqD,CAAC;AACpE,cAAc,2DAA2D,CAAC;AAC1E,cAAc,uDAAuD,CAAC;AACtE,cAAc,2CAA2C,CAAC;AAC1D,cAAc,wBAAwB,CAAC;AACvC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,sCAAsC,CAAC;AACrD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC"}
|
package/dist/esm/index.js
CHANGED
|
@@ -25,6 +25,7 @@ export * from './project-config/shared/minion-resource-access.validation.js';
|
|
|
25
25
|
export * from './project-config/shared/object-storage-session-policy.js';
|
|
26
26
|
export * from './lockfile/wildo-saas-lock.shared.schemas.js';
|
|
27
27
|
export * from './lockfile/lockfile-io.js';
|
|
28
|
+
export * from './lockfile/build-parallelism.js';
|
|
28
29
|
export * from './lockfile/materialize-infra-section.js';
|
|
29
30
|
export * from './lockfile/canonical-json.js';
|
|
30
31
|
export * from './registry/index.js';
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,4CAA4C,CAAC;AAE3D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,gDAAgD,CAAC;AAC/D,cAAc,mCAAmC,CAAC;AAClD,cAAc,kCAAkC,CAAC;AACjD,cAAc,qCAAqC,CAAC;AACpD,cAAc,uCAAuC,CAAC;AACtD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC;AAChD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+CAA+C,CAAC;AAC9D,cAAc,gDAAgD,CAAC;AAC/D,cAAc,6DAA6D,CAAC;AAC5E,cAAc,4CAA4C,CAAC;AAC3D,cAAc,wCAAwC,CAAC;AACvD,cAAc,yCAAyC,CAAC;AACxD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,sCAAsC,CAAC;AACrD,cAAc,oCAAoC,CAAC;AACnD,cAAc,qCAAqC,CAAC;AACpD,cAAc,qDAAqD,CAAC;AACpE,cAAc,2DAA2D,CAAC;AAC1E,cAAc,uDAAuD,CAAC;AACtE,cAAc,2CAA2C,CAAC;AAC1D,cAAc,wBAAwB,CAAC;AACvC,cAAc,sCAAsC,CAAC;AACrD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC","sourcesContent":["export * from './project-config';\nexport * from './workspace-scope';\nexport * from './credentials/credential-generator.service';\n\nexport * from './schemas/platform-application-config.schemas';\nexport * from './schemas/platform-application-secrets.schemas';\nexport * from './schemas/platform-config.schemas';\nexport * from './schemas/framework-info.schemas';\nexport * from './schemas/framework-secrets.schemas';\nexport * from './release/framework-release.constants';\nexport * from './bootstrap/bootstrap.schemas';\nexport * from './bootstrap/bootstrap.contracts';\nexport * from './bootstrap/bootstrap-planner';\nexport * from './bootstrap/application-backend-env.contracts';\nexport * from './bootstrap/wildo-owner-organization.contracts';\nexport * from './bootstrap/application-creation-verification-env.contracts';\nexport * from './bootstrap/platform-runtime-env.contracts';\nexport * from './bootstrap/runtime-topology.contracts';\nexport * from './bootstrap/runtime-principal.contracts';\nexport * from './bootstrap/runtime-backing-service-access';\nexport * from './bootstrap/runtime-network-topology';\nexport * from './bootstrap/runtime-network-policy';\nexport * from './bootstrap/runtime-platform-access';\nexport * from './project-config/minion-local-provider-registration';\nexport * from './project-config/shared/minion-resource-access.validation';\nexport * from './project-config/shared/object-storage-session-policy';\nexport * from './lockfile/wildo-saas-lock.shared.schemas';\nexport * from './lockfile/lockfile-io';\nexport * from './lockfile/materialize-infra-section';\nexport * from './lockfile/canonical-json';\nexport * from './registry';\nexport * from './_unimplemented';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,4CAA4C,CAAC;AAE3D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,gDAAgD,CAAC;AAC/D,cAAc,mCAAmC,CAAC;AAClD,cAAc,kCAAkC,CAAC;AACjD,cAAc,qCAAqC,CAAC;AACpD,cAAc,uCAAuC,CAAC;AACtD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC;AAChD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+CAA+C,CAAC;AAC9D,cAAc,gDAAgD,CAAC;AAC/D,cAAc,6DAA6D,CAAC;AAC5E,cAAc,4CAA4C,CAAC;AAC3D,cAAc,wCAAwC,CAAC;AACvD,cAAc,yCAAyC,CAAC;AACxD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,sCAAsC,CAAC;AACrD,cAAc,oCAAoC,CAAC;AACnD,cAAc,qCAAqC,CAAC;AACpD,cAAc,qDAAqD,CAAC;AACpE,cAAc,2DAA2D,CAAC;AAC1E,cAAc,uDAAuD,CAAC;AACtE,cAAc,2CAA2C,CAAC;AAC1D,cAAc,wBAAwB,CAAC;AACvC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,sCAAsC,CAAC;AACrD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC","sourcesContent":["export * from './project-config';\nexport * from './workspace-scope';\nexport * from './credentials/credential-generator.service';\n\nexport * from './schemas/platform-application-config.schemas';\nexport * from './schemas/platform-application-secrets.schemas';\nexport * from './schemas/platform-config.schemas';\nexport * from './schemas/framework-info.schemas';\nexport * from './schemas/framework-secrets.schemas';\nexport * from './release/framework-release.constants';\nexport * from './bootstrap/bootstrap.schemas';\nexport * from './bootstrap/bootstrap.contracts';\nexport * from './bootstrap/bootstrap-planner';\nexport * from './bootstrap/application-backend-env.contracts';\nexport * from './bootstrap/wildo-owner-organization.contracts';\nexport * from './bootstrap/application-creation-verification-env.contracts';\nexport * from './bootstrap/platform-runtime-env.contracts';\nexport * from './bootstrap/runtime-topology.contracts';\nexport * from './bootstrap/runtime-principal.contracts';\nexport * from './bootstrap/runtime-backing-service-access';\nexport * from './bootstrap/runtime-network-topology';\nexport * from './bootstrap/runtime-network-policy';\nexport * from './bootstrap/runtime-platform-access';\nexport * from './project-config/minion-local-provider-registration';\nexport * from './project-config/shared/minion-resource-access.validation';\nexport * from './project-config/shared/object-storage-session-policy';\nexport * from './lockfile/wildo-saas-lock.shared.schemas';\nexport * from './lockfile/lockfile-io';\nexport * from './lockfile/build-parallelism';\nexport * from './lockfile/materialize-infra-section';\nexport * from './lockfile/canonical-json';\nexport * from './registry';\nexport * from './_unimplemented';\n"]}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How many build-plan coding tasks the creation lane may run AT ONCE in one application (#1528).
|
|
3
|
+
*
|
|
4
|
+
* An OPERATIONAL setting, not product truth: it decides how fast the build spends, never what it
|
|
5
|
+
* builds, so it lives in the application's machine-local state beside the workspace-mutation lock and
|
|
6
|
+
* is safe to delete. The companion reads it at every wave, so it changes without a restart; the CLI
|
|
7
|
+
* writes it (`wildo workbench parallelism <n>`).
|
|
8
|
+
*
|
|
9
|
+
* Absent means {@link DEFAULT_BUILD_PARALLELISM}. `1` is the lane's single-flight behaviour, and remains
|
|
10
|
+
* one command away. Parallel runs share ONE worktree by decision (Paul, 2026-09-24): concurrent agents
|
|
11
|
+
* editing the same tree reconcile fine in practice, so the lane detects and repairs interference instead
|
|
12
|
+
* of preventing it.
|
|
13
|
+
*/
|
|
14
|
+
export declare const BUILD_PARALLELISM_RELATIVE_PATH: string;
|
|
15
|
+
/**
|
|
16
|
+
* Five runs at once, by decision (Paul, 2026-09-24): parallel is the lane's normal mode, not an opt-in.
|
|
17
|
+
*
|
|
18
|
+
* Five rather than more because each slot is a live agent spending on its own, and the wave is already
|
|
19
|
+
* measured to cut wall-clock by more than three at four runs (a live wave of four real agents: 28 s
|
|
20
|
+
* against 86 s of combined run time). It sits under the ACP provider's own limit of ten concurrent
|
|
21
|
+
* sessions, so the setting — not the provider — is what decides the width.
|
|
22
|
+
*/
|
|
23
|
+
export declare const DEFAULT_BUILD_PARALLELISM = 5;
|
|
24
|
+
/**
|
|
25
|
+
* A breaker, not a budget. Each slot is a live coding agent spending on its own, so the ceiling stops
|
|
26
|
+
* a typo (`100`) from becoming a hundred concurrent agents; any value up to it is the operator's call.
|
|
27
|
+
*/
|
|
28
|
+
export declare const MAXIMUM_BUILD_PARALLELISM = 16;
|
|
29
|
+
/** Absolute path of an application's build-parallelism setting. */
|
|
30
|
+
export declare function getBuildParallelismPath(saasRoot: string): string;
|
|
31
|
+
/** Clamp a requested degree into `[1, MAXIMUM_BUILD_PARALLELISM]`; anything unreadable is the default. */
|
|
32
|
+
export declare function normalizeBuildParallelism(value: unknown): number;
|
|
33
|
+
/**
|
|
34
|
+
* The application's build parallelism. Never throws: an absent, unreadable or malformed file reads as
|
|
35
|
+
* the default, because a throughput knob that cannot be read must not stop the build.
|
|
36
|
+
*/
|
|
37
|
+
export declare function readBuildParallelism(saasRoot: string): number;
|
|
38
|
+
/** Record the application's build parallelism, clamped. Returns the degree actually recorded. */
|
|
39
|
+
export declare function writeBuildParallelism(saasRoot: string, degree: number): number;
|
|
40
|
+
//# sourceMappingURL=build-parallelism.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-parallelism.d.ts","sourceRoot":"","sources":["../../../../src/lockfile/build-parallelism.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,+BAA+B,EAAE,MAAmD,CAAC;AAElG;;;;;;;GAOG;AACH,eAAO,MAAM,yBAAyB,IAAI,CAAC;AAE3C;;;GAGG;AACH,eAAO,MAAM,yBAAyB,KAAK,CAAC;AAE5C,mEAAmE;AACnE,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEhE;AAED,0GAA0G;AAC1G,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAGhE;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAQ7D;AAED,iGAAiG;AACjG,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAM9E"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
/**
|
|
4
|
+
* How many build-plan coding tasks the creation lane may run AT ONCE in one application (#1528).
|
|
5
|
+
*
|
|
6
|
+
* An OPERATIONAL setting, not product truth: it decides how fast the build spends, never what it
|
|
7
|
+
* builds, so it lives in the application's machine-local state beside the workspace-mutation lock and
|
|
8
|
+
* is safe to delete. The companion reads it at every wave, so it changes without a restart; the CLI
|
|
9
|
+
* writes it (`wildo workbench parallelism <n>`).
|
|
10
|
+
*
|
|
11
|
+
* Absent means {@link DEFAULT_BUILD_PARALLELISM}. `1` is the lane's single-flight behaviour, and remains
|
|
12
|
+
* one command away. Parallel runs share ONE worktree by decision (Paul, 2026-09-24): concurrent agents
|
|
13
|
+
* editing the same tree reconcile fine in practice, so the lane detects and repairs interference instead
|
|
14
|
+
* of preventing it.
|
|
15
|
+
*/
|
|
16
|
+
export const BUILD_PARALLELISM_RELATIVE_PATH = '.wildo-saas/state/build-parallelism.json';
|
|
17
|
+
/**
|
|
18
|
+
* Five runs at once, by decision (Paul, 2026-09-24): parallel is the lane's normal mode, not an opt-in.
|
|
19
|
+
*
|
|
20
|
+
* Five rather than more because each slot is a live agent spending on its own, and the wave is already
|
|
21
|
+
* measured to cut wall-clock by more than three at four runs (a live wave of four real agents: 28 s
|
|
22
|
+
* against 86 s of combined run time). It sits under the ACP provider's own limit of ten concurrent
|
|
23
|
+
* sessions, so the setting — not the provider — is what decides the width.
|
|
24
|
+
*/
|
|
25
|
+
export const DEFAULT_BUILD_PARALLELISM = 5;
|
|
26
|
+
/**
|
|
27
|
+
* A breaker, not a budget. Each slot is a live coding agent spending on its own, so the ceiling stops
|
|
28
|
+
* a typo (`100`) from becoming a hundred concurrent agents; any value up to it is the operator's call.
|
|
29
|
+
*/
|
|
30
|
+
export const MAXIMUM_BUILD_PARALLELISM = 16;
|
|
31
|
+
/** Absolute path of an application's build-parallelism setting. */
|
|
32
|
+
export function getBuildParallelismPath(saasRoot) {
|
|
33
|
+
return path.join(saasRoot, BUILD_PARALLELISM_RELATIVE_PATH);
|
|
34
|
+
}
|
|
35
|
+
/** Clamp a requested degree into `[1, MAXIMUM_BUILD_PARALLELISM]`; anything unreadable is the default. */
|
|
36
|
+
export function normalizeBuildParallelism(value) {
|
|
37
|
+
if (typeof value !== 'number' || !Number.isFinite(value))
|
|
38
|
+
return DEFAULT_BUILD_PARALLELISM;
|
|
39
|
+
return Math.min(MAXIMUM_BUILD_PARALLELISM, Math.max(1, Math.floor(value)));
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* The application's build parallelism. Never throws: an absent, unreadable or malformed file reads as
|
|
43
|
+
* the default, because a throughput knob that cannot be read must not stop the build.
|
|
44
|
+
*/
|
|
45
|
+
export function readBuildParallelism(saasRoot) {
|
|
46
|
+
const filePath = getBuildParallelismPath(saasRoot);
|
|
47
|
+
if (!existsSync(filePath))
|
|
48
|
+
return DEFAULT_BUILD_PARALLELISM;
|
|
49
|
+
try {
|
|
50
|
+
return normalizeBuildParallelism(JSON.parse(readFileSync(filePath, 'utf8')).degree);
|
|
51
|
+
}
|
|
52
|
+
catch {
|
|
53
|
+
return DEFAULT_BUILD_PARALLELISM;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
/** Record the application's build parallelism, clamped. Returns the degree actually recorded. */
|
|
57
|
+
export function writeBuildParallelism(saasRoot, degree) {
|
|
58
|
+
const recorded = normalizeBuildParallelism(degree);
|
|
59
|
+
const filePath = getBuildParallelismPath(saasRoot);
|
|
60
|
+
mkdirSync(path.dirname(filePath), { recursive: true });
|
|
61
|
+
writeFileSync(filePath, `${JSON.stringify({ degree: recorded, recordedAt: new Date().toISOString() }, null, 2)}\n`, 'utf8');
|
|
62
|
+
return recorded;
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=build-parallelism.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-parallelism.js","sourceRoot":"","sources":["../../../../src/lockfile/build-parallelism.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAW,0CAA0C,CAAC;AAElG;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC;AAE3C;;;GAGG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,EAAE,CAAC;AAE5C,mEAAmE;AACnE,MAAM,UAAU,uBAAuB,CAAC,QAAgB;IACtD,OAAO,IAAI,CAA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C,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAC5H,OAAO,QAAQ,CAAC;AAClB,CAAC","sourcesContent":["import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';\nimport path from 'node:path';\n\n/**\n * How many build-plan coding tasks the creation lane may run AT ONCE in one application (#1528).\n *\n * An OPERATIONAL setting, not product truth: it decides how fast the build spends, never what it\n * builds, so it lives in the application's machine-local state beside the workspace-mutation lock and\n * is safe to delete. The companion reads it at every wave, so it changes without a restart; the CLI\n * writes it (`wildo workbench parallelism <n>`).\n *\n * Absent means {@link DEFAULT_BUILD_PARALLELISM}. `1` is the lane's single-flight behaviour, and remains\n * one command away. Parallel runs share ONE worktree by decision (Paul, 2026-09-24): concurrent agents\n * editing the same tree reconcile fine in practice, so the lane detects and repairs interference instead\n * of preventing it.\n */\nexport const BUILD_PARALLELISM_RELATIVE_PATH: string = '.wildo-saas/state/build-parallelism.json';\n\n/**\n * Five runs at once, by decision (Paul, 2026-09-24): parallel is the lane's normal mode, not an opt-in.\n *\n * Five rather than more because each slot is a live agent spending on its own, and the wave is already\n * measured to cut wall-clock by more than three at four runs (a live wave of four real agents: 28 s\n * against 86 s of combined run time). It sits under the ACP provider's own limit of ten concurrent\n * sessions, so the setting — not the provider — is what decides the width.\n */\nexport const DEFAULT_BUILD_PARALLELISM = 5;\n\n/**\n * A breaker, not a budget. Each slot is a live coding agent spending on its own, so the ceiling stops\n * a typo (`100`) from becoming a hundred concurrent agents; any value up to it is the operator's call.\n */\nexport const MAXIMUM_BUILD_PARALLELISM = 16;\n\n/** Absolute path of an application's build-parallelism setting. */\nexport function getBuildParallelismPath(saasRoot: string): string {\n return path.join(saasRoot, BUILD_PARALLELISM_RELATIVE_PATH);\n}\n\n/** Clamp a requested degree into `[1, MAXIMUM_BUILD_PARALLELISM]`; anything unreadable is the default. */\nexport function normalizeBuildParallelism(value: unknown): number {\n if (typeof value !== 'number' || !Number.isFinite(value)) return DEFAULT_BUILD_PARALLELISM;\n return Math.min(MAXIMUM_BUILD_PARALLELISM, Math.max(1, Math.floor(value)));\n}\n\n/**\n * The application's build parallelism. Never throws: an absent, unreadable or malformed file reads as\n * the default, because a throughput knob that cannot be read must not stop the build.\n */\nexport function readBuildParallelism(saasRoot: string): number {\n const filePath = getBuildParallelismPath(saasRoot);\n if (!existsSync(filePath)) return DEFAULT_BUILD_PARALLELISM;\n try {\n return normalizeBuildParallelism((JSON.parse(readFileSync(filePath, 'utf8')) as { degree?: unknown }).degree);\n } catch {\n return DEFAULT_BUILD_PARALLELISM;\n }\n}\n\n/** Record the application's build parallelism, clamped. Returns the degree actually recorded. */\nexport function writeBuildParallelism(saasRoot: string, degree: number): number {\n const recorded = normalizeBuildParallelism(degree);\n const filePath = getBuildParallelismPath(saasRoot);\n mkdirSync(path.dirname(filePath), { recursive: true });\n writeFileSync(filePath, `${JSON.stringify({ degree: recorded, recordedAt: new Date().toISOString() }, null, 2)}\\n`, 'utf8');\n return recorded;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lockfile-io.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"lockfile-io.d.ts","sourceRoot":"","sources":["../../../../src/lockfile/lockfile-io.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAMH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAEL,KAAK,oBAAoB,EAE1B,MAAM,kCAAkC,CAAC;AAE1C;;GAEG;AACH,eAAO,MAAM,6BAA6B,qCAAqC,CAAC;AAEhF;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE7D;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;CAIuB,CAAC;AAEzD;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC;;;;;OAKG;IACH,QAAQ,CA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6E;IAC7E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6DAA6D;IAC7D,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,wBAAsB,qBAAqB,CAAC,CAAC,EAC3C,cAAc,EAAE,MAAM,EACtB,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EACpB,WAAW,CAAC,EAAE,wBAAwB,GACrC,OAAO,CAAC,CAAC,CAAC,CAgBZ;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,qCAAqC,EAAE,MACP,CAAC;AAE9C,uEAAuE;AACvE,wBAAgB,4BAA4B,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAErE;AAED;;;;;;;;;GASG;AACH,wBAAsB,yBAAyB,CAAC,CAAC,EAC/C,OAAO,EAAE,qBAAqB,GAAG;IAC/B,iEAAiE;IACjE,UAAU,EAAE,MAAM,CAAC;IACnB,2DAA2D;IAC3D,aAAa,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC5B,yDAAyD;IACzD,cAAc,EAAE,MAAM,CAAC,CAAC;CACzB,EACD,OAAO,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,GAAG,IAAI,GAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,GACpD,OAAO,CAAC,CAAC,CAAC,CAuBZ"}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* Lives in `platform-config-lib` (no runtime, no DI, no I/O — pure
|
|
8
8
|
* projection). The CLI-side caller is responsible for loading the
|
|
9
9
|
* authored configs from disk via
|
|
10
|
-
* `
|
|
10
|
+
* `loadInfraEnvConfig` (this package; the CLI's `loadAuthoredInfraEnvConfig` delegates to it) and passing
|
|
11
11
|
* the parsed `backingServices` slice plus the env name.
|
|
12
12
|
*
|
|
13
13
|
* **Slice 2.5c-1 (2026-05-10)**: when the caller supplies an optional
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"materialize-infra-section.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"materialize-infra-section.d.ts","sourceRoot":"","sources":["../../../../src/lockfile/materialize-infra-section.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAKL,KAAK,wBAAwB,EAC9B,MAAM,mDAAmD,CAAC;AAC3D,OAAO,KAAK,EACV,aAAa,EACb,mBAAmB,EAEpB,MAAM,kDAAkD,CAAC;AAC1D,OAAO,KAAK,EAEV,wBAAwB,EACzB,MAAM,kCAAkC,CAAC;AAG1C;;;;;;GAMG;AACH,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,wBAAwB,GAAG,SAAS,CAAC;CACvD;AAED,MAAM,WAAW,8BAA8B;IAC7C,IAAI,EAAE,aAAa,CAAC,sBAAsB,CAAC,CAAC;IAC5C;;;;;;OAMG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;;;;;;;;;;;;;;;OAgBG;IACH,SAAS,CAAC,EAAE,WAAW,CAAC,aAAa,EAAE,mBAAmB,CAAC,CAAC;IAC5D;;;;;;;;;;;;;;;;;OAiBG;IACH,eAAe,CAAC,EAAE,wBAAwB,CAAC;CAC5C;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,8BAA8B,GACtC,wBAAwB,GAAG,SAAS,CAoBtC"}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* Lives in `platform-config-lib` (no runtime, no DI, no I/O — pure
|
|
8
8
|
* projection). The CLI-side caller is responsible for loading the
|
|
9
9
|
* authored configs from disk via
|
|
10
|
-
* `
|
|
10
|
+
* `loadInfraEnvConfig` (this package; the CLI's `loadAuthoredInfraEnvConfig` delegates to it) and passing
|
|
11
11
|
* the parsed `backingServices` slice plus the env name.
|
|
12
12
|
*
|
|
13
13
|
* **Slice 2.5c-1 (2026-05-10)**: when the caller supplies an optional
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"materialize-infra-section.js","sourceRoot":"","sources":["../../../../src/lockfile/materialize-infra-section.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EACL,kBAAkB,EAClB,mCAAmC,EACnC,oBAAoB,GAGrB,MAAM,mDAAmD,CAAC;AAU3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AA+DtD;;;;;GAKG;AACH,MAAM,UAAU,uBAAuB,CACrC,OAAuC;IAEvC,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,SAAS,CAAC;IAEhD,MAAM,YAAY,GAA6C,EAAE,CAAC;IAClE,IAAI,WAAW,GAAG,KAAK,CAAC;IAExB,KAAK,MAAM,GAAG,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;QAC/B,MAAM,YAAY,GAAG,oCAAoC,CACvD,GAAG,CAAC,eAAe,EACnB,OAAO,CAAC,WAAW,EACnB,GAAG,CAAC,OAAO,EACX,OAAO,CAAC,SAAS,EACjB,OAAO,CAAC,eAAe,EAAE,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC,CACnD,CAAC;QACF,IAAI,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,MAAM,KAAK,CAAC;YAAE,SAAS;QACrD,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,EAAE,YAAY,EAAE,CAAC;QAC7C,WAAW,GAAG,IAAI,CAAC;IACrB,CAAC;IAED,OAAO,WAAW,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;AACpD,CAAC;AAED,SAAS,oCAAoC,CAC3C,eAAqD,EACrD,WAAmB,EACnB,OAAe,EACf,SAAsE,EACtE,WAAqD;IAErD,MAAM,YAAY,GAAiD,EAAE,CAAC;IACtE,IAAI,CAAC,eAAe;QAAE,OAAO,YAAY,CAAC;IAE1C,qEAAqE;I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CAAC;IACJ,CAAC;IACD,OAAO,YAAY,CAAC;AACtB,CAAC;AAED;;;;;;;;;;;GAWG;AACH,SAAS,0BAA0B,CAAC,KAA8B;IAChE,OAAO,kBAAkB,CAAC,KAAK,CAAC,CAAC;AACnC,CAAC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,SAAS,uBAAuB,CAC9B,QAAuB,EACvB,IAAwB,EACxB,KAA8B,EAC9B,YAAoB,EACpB,OAAe,EACf,SAAsE;IAEtE,IAAI,CAAC,SAAS;QAAE,OAAO,SAAS,CAAC;IACjC,MAAM,MAAM,GAAG,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACvC,IAAI,CAAC,MAAM;QAAE,OAAO,SAAS,CAAC;IAC9B,MAAM,eAAe,GAAiC;QACpD,WAAW,EAAE,OAAO;QACpB,OAAO,EAAE,SAAS,EAAE,uDAAuD;QAC3E,iBAAiB,EAAE,IAAI;QACvB,MAAM,EAAE,KAAK;KACd,CAAC;IACF,MAAM,YAAY,GAAG,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IAClD,OAAO,kBAAkB,CAAC,YAAY,CAAC,CAAC;AAC1C,CAAC","sourcesContent":["/**\n * `materializeInfraSection` — pure function that projects authored\n * `wildo.infra.<envName>.config.ts` files into the\n * `sections.infra` slice of `wildo-saas.lock.json` (Slice 2.5b of\n * `infra-provider-planner.md`).\n *\n * Lives in `platform-config-lib` (no runtime, no DI, no I/O — pure\n * projection). The CLI-side caller is responsible for loading the\n * authored configs from disk via\n * `loadAuthoredInfraEnvConfig` (`@wildo-ai/wildo-cli`) and passing\n * the parsed `backingServices` slice plus the env name.\n *\n * **Slice 2.5c-1 (2026-05-10)**: when the caller supplies an optional\n * `moduleMap` of `InfraProvider → InfraProviderModule`, the digest\n * is computed from `module.plan(planningContext)` instead of from\n * the authored entry. This captures **provider-version drift**\n * (e.g., a module change to plumbing port, secret env vars,\n * per-app blob paths) on top of authored-config drift. When the\n * map is omitted, behavior matches Slice 2.5b — backward-compatible.\n * When the map IS supplied but doesn't contain a module for the\n * resolved `InfraProvider`, the materializer falls back to the\n * authored-entry digest for that capability (allows partial\n * coverage as the catalog grows in Slice 5).\n *\n * **Slice 4.A.1 / H2 fix (2026-05-07)**: digest computation uses\n * `stableSha256Digest` (recursive sorted-keys serialization via\n * `canonical-json.ts`) so nested-object property reorders don't\n * spuriously trigger drift.\n */\n\nimport {\n BackingServiceKind,\n BackingServiceKindToInfraCapability,\n resolveInfraProvider,\n type BackingServiceEnvConfig,\n type BackingServicesEnvConfig,\n} from '../project-config/shared/backing-services.schemas';\nimport type {\n InfraProvider,\n InfraProviderModule,\n InfraProviderPlanningContext,\n} from '../project-config/shared/infra-providers.schemas';\nimport type {\n SaasLockfileInfraEnvironment,\n SaasLockfileInfraSection,\n} from './wildo-saas-lock.shared.schemas';\nimport { stableSha256Digest } from './canonical-json';\n\n/**\n * Per-env input for the materializer. The caller has already loaded\n * the authored `wildo.infra.<envName>.config.ts` and parsed it via\n * `defineInfraEnvConfig`; we only consume the `backingServices`\n * slice (the only authored surface that maps to `InfraCapability`\n * selections).\n */\nexport interface InfraEnvSelectionInput {\n envName: string;\n backingServices: BackingServicesEnvConfig | undefined;\n}\n\nexport interface MaterializeInfraSectionOptions {\n envs: ReadonlyArray<InfraEnvSelectionInput>;\n /**\n * ISO-8601 timestamp used as the selection time for NEWLY-selected\n * or CHANGED capabilities (see `previousSection` for the sticky-reuse\n * rule). Caller controls it so multi-env writes share one\n * deterministic timestamp (matches the pattern from\n * `materializeSaasProviderRuntimeArtifacts`).\n */\n generatedAt: string;\n /**\n * Optional `InfraProvider → InfraProviderModule` lookup. When\n * present, each capability's `planContributionDigest` is computed\n * from `module.plan(planningContext)` (richer — captures\n * provider-version drift) instead of from the authored entry\n * (Slice 2.5b). Slice 2.5c-1 of `infra-provider-planner.md`.\n *\n * The CLI-side caller in `provider-runtime-sync.service.ts`\n * builds this from `@wildo-ai/platform-infra-providers`'s\n * `buildInfraProviderModuleMap()`. Apps-manager-side callers\n * (none today) would do the same.\n *\n * **Partial coverage**: a missing entry for a resolved provider\n * falls back to the authored-entry digest — no fail-closed. This\n * lets the catalog grow incrementally (Slice 5 stateless modules\n * still pending) without blocking lockfile materialization.\n */\n moduleMap?: ReadonlyMap<InfraProvider, InfraProviderModule>;\n /**\n * The previous lockfile's `sections.infra` (when present). Threaded\n * so `providerSelectedAt` is STICKY: a capability whose resolved\n * `provider` is unchanged retains its prior `providerSelectedAt`\n * instead of being re-stamped with `generatedAt`. Only a newly-\n * selected capability or a provider CHANGE stamps a fresh\n * `generatedAt`.\n *\n * **Why this exists**: `generatedAt` is the lockfile's volatile\n * generation timestamp — it is bumped by EVERY lockfile write,\n * including writes by unrelated subsystems via `withLockfileMutate`.\n * Deriving `providerSelectedAt` directly from it made the field\n * drift on every unrelated write, producing phantom\n * `wildo lock check` failures even when no infra selection changed.\n * Both callers — the `wildo config sync` writer and the\n * `wildo lock check` drift-checker — MUST pass the same previous\n * section so their projections agree.\n */\n previousSection?: SaasLockfileInfraSection;\n}\n\n/**\n * Project authored infra envs into the lockfile `sections.infra`\n * shape. Returns `undefined` when there are no envs to record (so\n * the lockfile writer can skip emitting the section entirely\n * instead of writing an empty `{ environments: {} }`).\n */\nexport function materializeInfraSection(\n options: MaterializeInfraSectionOptions,\n): SaasLockfileInfraSection | undefined {\n if (options.envs.length === 0) return undefined;\n\n const environments: SaasLockfileInfraSection['environments'] = {};\n let recordedAny = false;\n\n for (const env of options.envs) {\n const capabilities = projectBackingServicesToCapabilities(\n env.backingServices,\n options.generatedAt,\n env.envName,\n options.moduleMap,\n options.previousSection?.environments[env.envName],\n );\n if (Object.keys(capabilities).length === 0) continue;\n environments[env.envName] = { capabilities };\n recordedAny = true;\n }\n\n return recordedAny ? { environments } : undefined;\n}\n\nfunction projectBackingServicesToCapabilities(\n backingServices: BackingServicesEnvConfig | undefined,\n generatedAt: string,\n envName: string,\n moduleMap: ReadonlyMap<InfraProvider, InfraProviderModule> | undefined,\n previousEnv: SaasLockfileInfraEnvironment | undefined,\n): SaasLockfileInfraEnvironment['capabilities'] {\n const capabilities: SaasLockfileInfraEnvironment['capabilities'] = {};\n if (!backingServices) return capabilities;\n\n // Iterate via `Object.values(BackingServiceKind)` (Slice 4.A.2 / M7)\n // — avoids an unsafe `kindKey as BackingServiceKind` cast on\n // `Object.entries`'s string keys. `BackingServicesEnvConfigSchema`\n // is `.strict()` so unknown keys can't reach this code path; this\n // tightening just removes the dead defensive guard that came with\n // the cast.\n for (const kind of Object.values(BackingServiceKind)) {\n const entry = backingServices[kind];\n if (!entry) continue;\n const capability = BackingServiceKindToInfraCapability[kind];\n\n // Some kinds carry an additional `provider` brand (e.g. S3 = minio | aws);\n // others don't. The cast lifts to a permissive shape since\n // `BackingServiceEnvConfig` is a discriminated union and the brand only\n // exists on some variants.\n const providerBrand = (entry as BackingServiceEnvConfig & { provider?: string }).provider;\n const provider = resolveInfraProvider(kind, entry.source, providerBrand);\n if (!provider) {\n // Two kinds (METRICS / BACKUP) have no concrete\n // `InfraProvider` catalog entry yet (Slice 1.b). Skip them in\n // the lockfile until the first concrete provider for each is\n // authored — recording an entry without a provider would lie.\n continue;\n }\n\n // Slice 2.5c-1: prefer module.plan() digest when the catalog\n // exposes a module for this provider. Falls back to the\n // authored-entry digest for uncovered providers (Slice 5\n // stateless modules pending) so partial coverage doesn't\n // break materialization.\n const planContributionDigest =\n computeModulePlanDigest(provider, kind, entry, generatedAt, envName, moduleMap)\n ?? computeAuthoredEntryDigest(entry);\n\n // `providerSelectedAt` is STICKY — only a provider's first\n // selection (or re-selection after a change) is a meaningful moment.\n // Reuse the prior timestamp when the resolved provider is unchanged\n // so an unrelated `generatedAt` bump never perturbs it (the root\n // cause of phantom `wildo lock check` infra drift). A newly-added\n // capability or a provider change stamps the fresh `generatedAt`.\n const previousEntry = previousEnv?.capabilities[capability];\n const providerSelectedAt =\n previousEntry && previousEntry.provider === provider\n ? previousEntry.providerSelectedAt\n : generatedAt;\n\n capabilities[capability] = {\n provider,\n providerSelectedAt,\n planContributionDigest,\n };\n }\n return capabilities;\n}\n\n/**\n * Stable digest of an authored `BackingServiceEnvConfig` entry.\n * Uses `stableJsonStringify` (recursive sorted-keys serialization)\n * via `stableSha256Digest` so the digest is insensitive to property-\n * order shuffles at ANY nesting level — not just top-level. This\n * matters for entries with nested objects like\n * `MongoBackingService.options: {retryWrites, w, authSource}` where\n * editor saves frequently reorder the nested keys.\n *\n * Slice 4.A.1 / H2 fix: previously this used `JSON.stringify(entry,\n * Object.keys(entry).sort())` which only sorted top-level keys.\n */\nfunction computeAuthoredEntryDigest(entry: BackingServiceEnvConfig): string {\n return stableSha256Digest(entry);\n}\n\n/**\n * Slice 2.5c-1: compute the digest by invoking the module's\n * `plan()` and hashing its contribution. Returns `undefined` when\n * the module map is missing OR doesn't cover the provider — caller\n * falls back to `computeAuthoredEntryDigest`.\n *\n * **Why include the authored entry IN the planning context**: the\n * module may use authored fields (e.g., a future opt-in flag in\n * `RabbitBackingService`) to vary its contribution. Threading the\n * entry through `config` keeps the digest sensitive to authored\n * drift even when the digest source is `module.plan()`.\n *\n * **Why ignore `generatedAt` in the digest**: the timestamp is the\n * `providerSelectedAt` field, NOT part of plan-contribution\n * identity. Using it would make every `wildo lock` run produce a\n * different digest — defeats drift detection. We don't pass it to\n * `module.plan()`; we pass it through the surrounding shape only.\n */\nfunction computeModulePlanDigest(\n provider: InfraProvider,\n kind: BackingServiceKind,\n entry: BackingServiceEnvConfig,\n _generatedAt: string,\n envName: string,\n moduleMap: ReadonlyMap<InfraProvider, InfraProviderModule> | undefined,\n): string | undefined {\n if (!moduleMap) return undefined;\n const module = moduleMap.get(provider);\n if (!module) return undefined;\n const planningContext: InfraProviderPlanningContext = {\n environment: envName,\n runtime: 'unknown', // Caller doesn't expose runtime per env at this layer.\n backingServiceKey: kind,\n config: entry,\n };\n const contribution = module.plan(planningContext);\n return stableSha256Digest(contribution);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"mater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,OAAO,YAAY,CAAC;AACtB,CAAC;AAED;;;;;;;;;;;GAWG;AACH,SAAS,0BAA0B,CAAC,KAA8B;IAChE,OAAO,kBAAkB,CAAC,KAAK,CAAC,CAAC;AACnC,CAAC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,SAAS,uBAAuB,CAC9B,QAAuB,EACvB,IAAwB,EACxB,KAA8B,EAC9B,YAAoB,EACpB,OAAe,EACf,SAAsE;IAEtE,IAAI,CAAC,SAAS;QAAE,OAAO,SAAS,CAAC;IACjC,MAAM,MAAM,GAAG,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACvC,IAAI,CAAC,MAAM;QAAE,OAAO,SAAS,CAAC;IAC9B,MAAM,eAAe,GAAiC;QACpD,WAAW,EAAE,OAAO;QACpB,OAAO,EAAE,SAAS,EAAE,uDAAuD;QAC3E,iBAAiB,EAAE,IAAI;QACvB,MAAM,EAAE,KAAK;KACd,CAAC;IACF,MAAM,YAAY,GAAG,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IAClD,OAAO,kBAAkB,CAAC,YAAY,CAAC,CAAC;AAC1C,CAAC","sourcesContent":["/**\n * `materializeInfraSection` — pure function that projects authored\n * `wildo.infra.<envName>.config.ts` files into the\n * `sections.infra` slice of `wildo-saas.lock.json` (Slice 2.5b of\n * `infra-provider-planner.md`).\n *\n * Lives in `platform-config-lib` (no runtime, no DI, no I/O — pure\n * projection). The CLI-side caller is responsible for loading the\n * authored configs from disk via\n * `loadInfraEnvConfig` (this package; the CLI's `loadAuthoredInfraEnvConfig` delegates to it) and passing\n * the parsed `backingServices` slice plus the env name.\n *\n * **Slice 2.5c-1 (2026-05-10)**: when the caller supplies an optional\n * `moduleMap` of `InfraProvider → InfraProviderModule`, the digest\n * is computed from `module.plan(planningContext)` instead of from\n * the authored entry. This captures **provider-version drift**\n * (e.g., a module change to plumbing port, secret env vars,\n * per-app blob paths) on top of authored-config drift. When the\n * map is omitted, behavior matches Slice 2.5b — backward-compatible.\n * When the map IS supplied but doesn't contain a module for the\n * resolved `InfraProvider`, the materializer falls back to the\n * authored-entry digest for that capability (allows partial\n * coverage as the catalog grows in Slice 5).\n *\n * **Slice 4.A.1 / H2 fix (2026-05-07)**: digest computation uses\n * `stableSha256Digest` (recursive sorted-keys serialization via\n * `canonical-json.ts`) so nested-object property reorders don't\n * spuriously trigger drift.\n */\n\nimport {\n BackingServiceKind,\n BackingServiceKindToInfraCapability,\n resolveInfraProvider,\n type BackingServiceEnvConfig,\n type BackingServicesEnvConfig,\n} from '../project-config/shared/backing-services.schemas';\nimport type {\n InfraProvider,\n InfraProviderModule,\n InfraProviderPlanningContext,\n} from '../project-config/shared/infra-providers.schemas';\nimport type {\n SaasLockfileInfraEnvironment,\n SaasLockfileInfraSection,\n} from './wildo-saas-lock.shared.schemas';\nimport { stableSha256Digest } from './canonical-json';\n\n/**\n * Per-env input for the materializer. The caller has already loaded\n * the authored `wildo.infra.<envName>.config.ts` and parsed it via\n * `defineInfraEnvConfig`; we only consume the `backingServices`\n * slice (the only authored surface that maps to `InfraCapability`\n * selections).\n */\nexport interface InfraEnvSelectionInput {\n envName: string;\n backingServices: BackingServicesEnvConfig | undefined;\n}\n\nexport interface MaterializeInfraSectionOptions {\n envs: ReadonlyArray<InfraEnvSelectionInput>;\n /**\n * ISO-8601 timestamp used as the selection time for NEWLY-selected\n * or CHANGED capabilities (see `previousSection` for the sticky-reuse\n * rule). Caller controls it so multi-env writes share one\n * deterministic timestamp (matches the pattern from\n * `materializeSaasProviderRuntimeArtifacts`).\n */\n generatedAt: string;\n /**\n * Optional `InfraProvider → InfraProviderModule` lookup. When\n * present, each capability's `planContributionDigest` is computed\n * from `module.plan(planningContext)` (richer — captures\n * provider-version drift) instead of from the authored entry\n * (Slice 2.5b). Slice 2.5c-1 of `infra-provider-planner.md`.\n *\n * The CLI-side caller in `provider-runtime-sync.service.ts`\n * builds this from `@wildo-ai/platform-infra-providers`'s\n * `buildInfraProviderModuleMap()`. Apps-manager-side callers\n * (none today) would do the same.\n *\n * **Partial coverage**: a missing entry for a resolved provider\n * falls back to the authored-entry digest — no fail-closed. This\n * lets the catalog grow incrementally (Slice 5 stateless modules\n * still pending) without blocking lockfile materialization.\n */\n moduleMap?: ReadonlyMap<InfraProvider, InfraProviderModule>;\n /**\n * The previous lockfile's `sections.infra` (when present). Threaded\n * so `providerSelectedAt` is STICKY: a capability whose resolved\n * `provider` is unchanged retains its prior `providerSelectedAt`\n * instead of being re-stamped with `generatedAt`. Only a newly-\n * selected capability or a provider CHANGE stamps a fresh\n * `generatedAt`.\n *\n * **Why this exists**: `generatedAt` is the lockfile's volatile\n * generation timestamp — it is bumped by EVERY lockfile write,\n * including writes by unrelated subsystems via `withLockfileMutate`.\n * Deriving `providerSelectedAt` directly from it made the field\n * drift on every unrelated write, producing phantom\n * `wildo lock check` failures even when no infra selection changed.\n * Both callers — the `wildo config sync` writer and the\n * `wildo lock check` drift-checker — MUST pass the same previous\n * section so their projections agree.\n */\n previousSection?: SaasLockfileInfraSection;\n}\n\n/**\n * Project authored infra envs into the lockfile `sections.infra`\n * shape. Returns `undefined` when there are no envs to record (so\n * the lockfile writer can skip emitting the section entirely\n * instead of writing an empty `{ environments: {} }`).\n */\nexport function materializeInfraSection(\n options: MaterializeInfraSectionOptions,\n): SaasLockfileInfraSection | undefined {\n if (options.envs.length === 0) return undefined;\n\n const environments: SaasLockfileInfraSection['environments'] = {};\n let recordedAny = false;\n\n for (const env of options.envs) {\n const capabilities = projectBackingServicesToCapabilities(\n env.backingServices,\n options.generatedAt,\n env.envName,\n options.moduleMap,\n options.previousSection?.environments[env.envName],\n );\n if (Object.keys(capabilities).length === 0) continue;\n environments[env.envName] = { capabilities };\n recordedAny = true;\n }\n\n return recordedAny ? { environments } : undefined;\n}\n\nfunction projectBackingServicesToCapabilities(\n backingServices: BackingServicesEnvConfig | undefined,\n generatedAt: string,\n envName: string,\n moduleMap: ReadonlyMap<InfraProvider, InfraProviderModule> | undefined,\n previousEnv: SaasLockfileInfraEnvironment | undefined,\n): SaasLockfileInfraEnvironment['capabilities'] {\n const capabilities: SaasLockfileInfraEnvironment['capabilities'] = {};\n if (!backingServices) return capabilities;\n\n // Iterate via `Object.values(BackingServiceKind)` (Slice 4.A.2 / M7)\n // — avoids an unsafe `kindKey as BackingServiceKind` cast on\n // `Object.entries`'s string keys. `BackingServicesEnvConfigSchema`\n // is `.strict()` so unknown keys can't reach this code path; this\n // tightening just removes the dead defensive guard that came with\n // the cast.\n for (const kind of Object.values(BackingServiceKind)) {\n const entry = backingServices[kind];\n if (!entry) continue;\n const capability = BackingServiceKindToInfraCapability[kind];\n\n // Some kinds carry an additional `provider` brand (e.g. S3 = minio | aws);\n // others don't. The cast lifts to a permissive shape since\n // `BackingServiceEnvConfig` is a discriminated union and the brand only\n // exists on some variants.\n const providerBrand = (entry as BackingServiceEnvConfig & { provider?: string }).provider;\n const provider = resolveInfraProvider(kind, entry.source, providerBrand);\n if (!provider) {\n // Two kinds (METRICS / BACKUP) have no concrete\n // `InfraProvider` catalog entry yet (Slice 1.b). Skip them in\n // the lockfile until the first concrete provider for each is\n // authored — recording an entry without a provider would lie.\n continue;\n }\n\n // Slice 2.5c-1: prefer module.plan() digest when the catalog\n // exposes a module for this provider. Falls back to the\n // authored-entry digest for uncovered providers (Slice 5\n // stateless modules pending) so partial coverage doesn't\n // break materialization.\n const planContributionDigest =\n computeModulePlanDigest(provider, kind, entry, generatedAt, envName, moduleMap)\n ?? computeAuthoredEntryDigest(entry);\n\n // `providerSelectedAt` is STICKY — only a provider's first\n // selection (or re-selection after a change) is a meaningful moment.\n // Reuse the prior timestamp when the resolved provider is unchanged\n // so an unrelated `generatedAt` bump never perturbs it (the root\n // cause of phantom `wildo lock check` infra drift). A newly-added\n // capability or a provider change stamps the fresh `generatedAt`.\n const previousEntry = previousEnv?.capabilities[capability];\n const providerSelectedAt =\n previousEntry && previousEntry.provider === provider\n ? previousEntry.providerSelectedAt\n : generatedAt;\n\n capabilities[capability] = {\n provider,\n providerSelectedAt,\n planContributionDigest,\n };\n }\n return capabilities;\n}\n\n/**\n * Stable digest of an authored `BackingServiceEnvConfig` entry.\n * Uses `stableJsonStringify` (recursive sorted-keys serialization)\n * via `stableSha256Digest` so the digest is insensitive to property-\n * order shuffles at ANY nesting level — not just top-level. This\n * matters for entries with nested objects like\n * `MongoBackingService.options: {retryWrites, w, authSource}` where\n * editor saves frequently reorder the nested keys.\n *\n * Slice 4.A.1 / H2 fix: previously this used `JSON.stringify(entry,\n * Object.keys(entry).sort())` which only sorted top-level keys.\n */\nfunction computeAuthoredEntryDigest(entry: BackingServiceEnvConfig): string {\n return stableSha256Digest(entry);\n}\n\n/**\n * Slice 2.5c-1: compute the digest by invoking the module's\n * `plan()` and hashing its contribution. Returns `undefined` when\n * the module map is missing OR doesn't cover the provider — caller\n * falls back to `computeAuthoredEntryDigest`.\n *\n * **Why include the authored entry IN the planning context**: the\n * module may use authored fields (e.g., a future opt-in flag in\n * `RabbitBackingService`) to vary its contribution. Threading the\n * entry through `config` keeps the digest sensitive to authored\n * drift even when the digest source is `module.plan()`.\n *\n * **Why ignore `generatedAt` in the digest**: the timestamp is the\n * `providerSelectedAt` field, NOT part of plan-contribution\n * identity. Using it would make every `wildo lock` run produce a\n * different digest — defeats drift detection. We don't pass it to\n * `module.plan()`; we pass it through the surrounding shape only.\n */\nfunction computeModulePlanDigest(\n provider: InfraProvider,\n kind: BackingServiceKind,\n entry: BackingServiceEnvConfig,\n _generatedAt: string,\n envName: string,\n moduleMap: ReadonlyMap<InfraProvider, InfraProviderModule> | undefined,\n): string | undefined {\n if (!moduleMap) return undefined;\n const module = moduleMap.get(provider);\n if (!module) return undefined;\n const planningContext: InfraProviderPlanningContext = {\n environment: envName,\n runtime: 'unknown', // Caller doesn't expose runtime per env at this layer.\n backingServiceKey: kind,\n config: entry,\n };\n const contribution = module.plan(planningContext);\n return stableSha256Digest(contribution);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wildo-saas-lock.shared.schemas.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"wildo-saas-lock.shared.schemas.d.ts","sourceRoot":"","sources":["../../../../src/lockfile/wildo-saas-lock.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,sCAAsC,EAAE,MAAM,sCAAsC,CAAC;AAC9F,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,OAAO,EAEL,aAAa,EACd,MAAM,kDAAkD,CAAC;AAY1D;;;;;GAKG;AACH,eAAO,MAAM,+BAA+B;;;;;;;kBAO1C,CAAC;AACH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AAExF;;;GAGG;AACH,eAAO,MAAM,wCAAwC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAenD,CAAC;AACH,MAAM,MAAM,kCAAkC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wCAAwC,CAAC,CAAC;AAE1G,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAE7C,CAAC;AACH,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAC;AAE9F;;;;;;;;;;;;GAYG;AACH,QAAA,MAAM,0CAA0C;;;;kBAI9C,CAAC;AACH,MAAM,MAAM,oCAAoC,GAAG,CAAC,CAAC,KAAK,CACxD,OAAO,0CAA0C,CAClD,CAAC;AAEF;;;;;;GAMG;AACH,QAAA,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAYtC,CAAC;AACH,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAA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vF,CAAC,eAAe,CAAC,aAAa,CAAC,EAAE,0CAA0C,CAAC,QAAQ,EAAE;QACtF,CAAC,eAAe,CAAC,iBAAiB,CAAC,EAAE,0CAA0C,CAAC,QAAQ,EAAE;QAC1F,CAAC,eAAe,CAAC,cAAc,CAAC,EAAE,0CAA0C,CAAC,QAAQ,EAAE;KACxF,CAAC,CAAC,MAAM,EAAE;CACZ,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,CAAC,YAAY,CAAC;IAC3D,YAAY,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,kCAAkC,CAAC;CACvE,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,CAAC,MAAM,CAAC;IACtD,SAAS,EAAE,kCAAkC,CAAC,QAAQ,EAAE;IACxD,OAAO,EAAE,gCAAgC,CAAC,QAAQ,EAAE;IACpD,KAAK,EAAE,8BAA8B,CAAC,QAAQ,EAAE;CACjD,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;AAGzB;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,YAAY,CAAC;IACvD,aAAa,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IAC3B,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAClD,QAAQ,EAAE,+BAA+B;CAC1C,CAAC,CAAC","sourcesContent":["/**\n * Canonical `wildo-saas.lock.json` envelope shared by every lockfile\n * writer.\n *\n * The envelope mirrors the existing companion-owned lockfile model:\n * `{ schemaVersion, generatedAt, sections }`. Each subsystem owns a\n * named section under `sections`; the envelope never promotes subsystem\n * data to top-level keys.\n *\n * Reserved section names:\n * - `i18n`: companion labelling/translation state.\n * - `providers`: provider-registration lock section.\n * - `modules`: module-registry lock section.\n * - `infra`: infra-provider planning lock section (per-environment\n * InfraCapability → InfraProvider selection + plan-contribution\n * digest). See `infra-provider-planner.md` for the design.\n */\n\nimport { z } from 'zod';\nimport { ExternalProvider_ExchangeProtocol_Kind } from '@wildo-ai/external-connectors-models';\nimport { EngineCapability } from '@wildo-ai/saas-models';\nimport { RegistryModulesLockSectionSchema } from '../registry/lockfile-modules-section.schemas';\nimport {\n InfraCapability,\n InfraProvider,\n} from '../project-config/shared/infra-providers.schemas';\n\nconst ProviderCapabilityLockValueSchema = z.string().regex(\n /^(?:[A-Z][A-Z0-9_]*(?:\\.[A-Z][A-Z0-9_]*)?|[a-z][a-z0-9]*(?:-[a-z0-9]+)*)$/,\n 'providerCapabilities must use built-in uppercase or app custom kebab-case literals',\n);\n\nconst ProviderProtocolLockValueSchema = z.union([\n z.enum(ExternalProvider_ExchangeProtocol_Kind),\n z.string().regex(/^[A-Z][A-Z0-9_]*$/, 'protocols must use known external protocol literals or backend protocol constants'),\n]);\n\n/**\n * Per-facet, per-provider locked entry. Recorded once per `(facet, ref)`.\n *\n * NEVER includes secret values. `secretsContractDigest` only digests the\n * shape of the contract: env-var names, required-ness, and descriptions.\n */\nexport const SaasLockfileProviderEntrySchema = z.strictObject({\n ref: z.string(),\n digest: z.string(),\n engineCapabilities: z.array(z.enum(EngineCapability)).default([]),\n providerCapabilities: z.array(ProviderCapabilityLockValueSchema),\n protocols: z.array(ProviderProtocolLockValueSchema),\n secretsContractDigest: z.string(),\n});\nexport type SaasLockfileProviderEntry = z.infer<typeof SaasLockfileProviderEntrySchema>;\n\n/**\n * `sections.providers`: provider lock records keyed by runtime scope and\n * provider ref. Runtime scopes mirror `defineSaaSProviders({ scopes })`.\n */\nexport const SaasLockfileRuntimeScopesProvidersSchema = z.strictObject({\n backend: z.record(z.string(), SaasLockfileProviderEntrySchema).optional(),\n companion: z.record(z.string(), SaasLockfileProviderEntrySchema).optional(),\n frontendServices: z.record(\n z.string(),\n z.record(z.string(), SaasLockfileProviderEntrySchema),\n ).optional(),\n workers: z.record(\n z.string(),\n z.record(z.string(), SaasLockfileProviderEntrySchema),\n ).optional(),\n minions: z.record(\n z.string(),\n z.record(z.string(), SaasLockfileProviderEntrySchema),\n ).optional(),\n});\nexport type SaasLockfileRuntimeScopesProviders = z.infer<typeof SaasLockfileRuntimeScopesProvidersSchema>;\n\nexport const SaasLockfileProvidersSectionSchema = z.strictObject({\n runtimeScopes: SaasLockfileRuntimeScopesProvidersSchema,\n});\nexport type SaasLockfileProvidersSection = z.infer<typeof SaasLockfileProvidersSectionSchema>;\n\n/**\n * `sections.infra`: infra-provider lock records keyed by environment\n * name and `InfraCapability`. Captures which `InfraProvider` was\n * selected for a capability in a given environment and the digest of\n * its `plan()` contribution at that time. Drift between authored\n * `wildo.infra.<env>.config.ts` and the lockfile fails CI (future\n * `wildo lock --check` slice).\n *\n * Decomposition is per-environment first (then capability) because\n * `wildo.infra.<env>.config.ts` is per-env: cross-env diffs read more\n * naturally as \"env A provides QUEUE via X, env B provides QUEUE via\n * Y\" than as \"QUEUE is provided by X in env A and Y in env B\".\n */\nconst SaasLockfileInfraCapabilitySelectionSchema = z.strictObject({\n provider: z.enum(InfraProvider),\n providerSelectedAt: z.string().datetime({ offset: true }),\n planContributionDigest: z.string(),\n});\nexport type SaasLockfileInfraCapabilitySelection = z.infer<\n typeof SaasLockfileInfraCapabilitySelectionSchema\n>;\n\n/**\n * Per-environment capability map. Capabilities are sparse — an env\n * only declares the capabilities its app actually selects, so each\n * `InfraCapability` slot is `.optional()`. This mirrors the pattern\n * used by `BackingServicesEnvConfigSchema` (in\n * `../project-config/shared/backing-services.schemas.ts`).\n */\nconst SaasLockfileInfraEnvironmentSchema = z.strictObject({\n capabilities: z.object({\n [InfraCapability.DOCUMENT_DATABASE]: SaasLockfileInfraCapabilitySelectionSchema.optional(),\n [InfraCapability.RELATIONAL_DATABASE]: SaasLockfileInfraCapabilitySelectionSchema.optional(),\n [InfraCapability.AUDIT_LOG_STORAGE]: SaasLockfileInfraCapabilitySelectionSchema.optional(),\n [InfraCapability.OBJECT_STORAGE]: SaasLockfileInfraCapabilitySelectionSchema.optional(),\n [InfraCapability.ANTIVIRUS_SCANNING]: SaasLockfileInfraCapabilitySelectionSchema.optional(),\n [InfraCapability.QUEUING_SYSTEM]: SaasLockfileInfraCapabilitySelectionSchema.optional(),\n [InfraCapability.CACHE_MANAGER]: SaasLockfileInfraCapabilitySelectionSchema.optional(),\n [InfraCapability.METRICS_TELEMETRY]: SaasLockfileInfraCapabilitySelectionSchema.optional(),\n [InfraCapability.BACKUP_MANAGER]: SaasLockfileInfraCapabilitySelectionSchema.optional(),\n }).strict(),\n});\nexport type SaasLockfileInfraEnvironment = z.infer<typeof SaasLockfileInfraEnvironmentSchema>;\n\nexport const SaasLockfileInfraSectionSchema = z.strictObject({\n environments: z.record(z.string(), SaasLockfileInfraEnvironmentSchema),\n});\nexport type SaasLockfileInfraSection = z.infer<typeof SaasLockfileInfraSectionSchema>;\n\nexport const SaasLockfileKnownSectionsSchema = z.object({\n providers: SaasLockfileProvidersSectionSchema.optional(),\n modules: RegistryModulesLockSectionSchema.optional(),\n infra: SaasLockfileInfraSectionSchema.optional(),\n}).catchall(z.unknown());\nexport type SaasLockfileKnownSections = z.infer<typeof SaasLockfileKnownSectionsSchema>;\n\n/**\n * Top-level lockfile envelope.\n *\n * Forward compatibility lives in `sections`: readers validate the\n * sections they know and preserve unknown section payloads as `unknown`.\n * This keeps a provider-only tool from accidentally deleting `i18n` or\n * module-registry state.\n */\nexport const SaasLockfileEnvelopeSchema = z.strictObject({\n schemaVersion: z.literal(2),\n generatedAt: z.string().datetime({ offset: true }),\n sections: SaasLockfileKnownSectionsSchema,\n});\nexport type SaasLockfileEnvelope = z.infer<typeof SaasLockfileEnvelopeSchema>;\n"]}
|
|
1
|
+
{"version":3,"file":"wildo-saas-lock.shared.schemas.js","sourceRoot":"","sources":["../../../../src/lockfile/wildo-saas-lock.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;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M,EAAE,IAAI,EAAE,CAAC;IAClD,QAAQ,EAAE,+BAA+B;CAC1C,CAAC,CAAC","sourcesContent":["/**\n * Canonical `wildo-saas.lock.json` envelope shared by every lockfile\n * writer.\n *\n * The envelope mirrors the existing companion-owned lockfile model:\n * `{ schemaVersion, generatedAt, sections }`. Each subsystem owns a\n * named section under `sections`; the envelope never promotes subsystem\n * data to top-level keys.\n *\n * Reserved section names:\n * - `i18n`: companion labelling/translation state.\n * - `providers`: provider-registration lock section.\n * - `modules`: module-registry lock section.\n * - `infra`: infra-provider planning lock section (per-environment\n * InfraCapability → InfraProvider selection + plan-contribution\n * digest). See `infra-provider-planner.md` for the design.\n */\n\nimport { z } from 'zod';\nimport { ExternalProvider_ExchangeProtocol_Kind } from '@wildo-ai/external-connectors-models';\nimport { EngineCapability } from '@wildo-ai/saas-models';\nimport { RegistryModulesLockSectionSchema } from '../registry/lockfile-modules-section.schemas';\nimport {\n InfraCapability,\n InfraProvider,\n} from '../project-config/shared/infra-providers.schemas';\n\nconst ProviderCapabilityLockValueSchema = z.string().regex(\n /^(?:[A-Z][A-Z0-9_]*(?:\\.[A-Z][A-Z0-9_]*)?|[a-z][a-z0-9]*(?:-[a-z0-9]+)*)$/,\n 'providerCapabilities must use built-in uppercase or app custom kebab-case literals',\n);\n\nconst ProviderProtocolLockValueSchema = z.union([\n z.enum(ExternalProvider_ExchangeProtocol_Kind),\n z.string().regex(/^[A-Z][A-Z0-9_]*$/, 'protocols must use known external protocol literals or backend protocol constants'),\n]);\n\n/**\n * Per-facet, per-provider locked entry. Recorded once per `(facet, ref)`.\n *\n * NEVER includes secret values. `secretsContractDigest` only digests the\n * shape of the contract: env-var names, required-ness, and descriptions.\n */\nexport const SaasLockfileProviderEntrySchema = z.strictObject({\n ref: z.string(),\n digest: z.string(),\n engineCapabilities: z.array(z.enum(EngineCapability)).default([]),\n providerCapabilities: z.array(ProviderCapabilityLockValueSchema),\n protocols: z.array(ProviderProtocolLockValueSchema),\n secretsContractDigest: z.string(),\n});\nexport type SaasLockfileProviderEntry = z.infer<typeof SaasLockfileProviderEntrySchema>;\n\n/**\n * `sections.providers`: provider lock records keyed by runtime scope and\n * provider ref. Runtime scopes mirror `defineSaaSProviders({ scopes })`.\n */\nexport const SaasLockfileRuntimeScopesProvidersSchema = z.strictObject({\n backend: z.record(z.string(), SaasLockfileProviderEntrySchema).optional(),\n companion: z.record(z.string(), SaasLockfileProviderEntrySchema).optional(),\n frontendServices: z.record(\n z.string(),\n z.record(z.string(), SaasLockfileProviderEntrySchema),\n ).optional(),\n workers: z.record(\n z.string(),\n z.record(z.string(), SaasLockfileProviderEntrySchema),\n ).optional(),\n minions: z.record(\n z.string(),\n z.record(z.string(), SaasLockfileProviderEntrySchema),\n ).optional(),\n});\nexport type SaasLockfileRuntimeScopesProviders = z.infer<typeof SaasLockfileRuntimeScopesProvidersSchema>;\n\nexport const SaasLockfileProvidersSectionSchema = z.strictObject({\n runtimeScopes: SaasLockfileRuntimeScopesProvidersSchema,\n});\nexport type SaasLockfileProvidersSection = z.infer<typeof SaasLockfileProvidersSectionSchema>;\n\n/**\n * `sections.infra`: infra-provider lock records keyed by environment\n * name and `InfraCapability`. Captures which `InfraProvider` was\n * selected for a capability in a given environment and the digest of\n * its `plan()` contribution at that time. Drift between authored\n * `wildo.infra.<env>.config.ts` and the lockfile fails CI (future\n * `wildo lock --check` slice).\n *\n * Decomposition is per-environment first (then capability) because\n * `wildo.infra.<env>.config.ts` is per-env: cross-env diffs read more\n * naturally as \"env A provides QUEUE via X, env B provides QUEUE via\n * Y\" than as \"QUEUE is provided by X in env A and Y in env B\".\n */\nconst SaasLockfileInfraCapabilitySelectionSchema = z.strictObject({\n provider: z.enum(InfraProvider),\n providerSelectedAt: z.string().datetime({ offset: true }),\n planContributionDigest: z.string(),\n});\nexport type SaasLockfileInfraCapabilitySelection = z.infer<\n typeof SaasLockfileInfraCapabilitySelectionSchema\n>;\n\n/**\n * Per-environment capability map. Capabilities are sparse — an env\n * only declares the capabilities its app actually selects, so each\n * `InfraCapability` slot is `.optional()`. This mirrors the pattern\n * used by `BackingServicesEnvConfigSchema` (in\n * `../project-config/shared/backing-services.schemas.ts`).\n */\nconst SaasLockfileInfraEnvironmentSchema = z.strictObject({\n capabilities: z.object({\n [InfraCapability.DOCUMENT_DATABASE]: SaasLockfileInfraCapabilitySelectionSchema.optional(),\n [InfraCapability.RELATIONAL_DATABASE]: SaasLockfileInfraCapabilitySelectionSchema.optional(),\n [InfraCapability.AUDIT_LOG_STORAGE]: SaasLockfileInfraCapabilitySelectionSchema.optional(),\n [InfraCapability.OBJECT_STORAGE]: SaasLockfileInfraCapabilitySelectionSchema.optional(),\n [InfraCapability.ANTIVIRUS_SCANNING]: SaasLockfileInfraCapabilitySelectionSchema.optional(),\n [InfraCapability.QUEUING_SYSTEM]: SaasLockfileInfraCapabilitySelectionSchema.optional(),\n [InfraCapability.CACHE_MANAGER]: SaasLockfileInfraCapabilitySelectionSchema.optional(),\n [InfraCapability.METRICS_TELEMETRY]: SaasLockfileInfraCapabilitySelectionSchema.optional(),\n [InfraCapability.BACKUP_MANAGER]: SaasLockfileInfraCapabilitySelectionSchema.optional(),\n }).strict(),\n});\nexport type SaasLockfileInfraEnvironment = z.infer<typeof SaasLockfileInfraEnvironmentSchema>;\n\nexport const SaasLockfileInfraSectionSchema = z.strictObject({\n environments: z.record(z.string(), SaasLockfileInfraEnvironmentSchema),\n});\nexport type SaasLockfileInfraSection = z.infer<typeof SaasLockfileInfraSectionSchema>;\n\nexport const SaasLockfileKnownSectionsSchema = z.object({\n providers: SaasLockfileProvidersSectionSchema.optional(),\n modules: RegistryModulesLockSectionSchema.optional(),\n infra: SaasLockfileInfraSectionSchema.optional(),\n}).catchall(z.unknown());\nexport type SaasLockfileKnownSections = z.infer<typeof SaasLockfileKnownSectionsSchema>;\n\n/**\n * Top-level lockfile envelope.\n *\n * Forward compatibility lives in `sections`: readers validate the\n * sections they know and preserve unknown section payloads as `unknown`.\n * This keeps a provider-only tool from accidentally deleting `i18n` or\n * module-registry state.\n */\nexport const SaasLockfileEnvelopeSchema = z.strictObject({\n schemaVersion: z.literal(2),\n generatedAt: z.string().datetime({ offset: true }),\n sections: SaasLockfileKnownSectionsSchema,\n});\nexport type SaasLockfileEnvelope = z.infer<typeof SaasLockfileEnvelopeSchema>;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"define-framework-config.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"define-framework-config.d.ts","sourceRoot":"","sources":["../../../../src/project-config/define-framework-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAYxB,oBAAY,6BAA6B;IACvC,gBAAgB,qBAAqB;IACrC,mBAAmB,wBAAwB;CAC5C;AAED,oBAAY,gCAAgC;IAC1C,OAAO,YAAY;IACnB,IAAI,SAAS;CACd;AAED,eAAO,MAAM,sCAAsC;;;;iBAIjD,CAAC;AACH,MAAM,MAAM,gCAAgC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sCAAsC,CAAC,CAAC;AAEtG,eAAO,MAAM,oCAAoC;;;;iBAsB/C,CAAC;AACH,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oCAAoC,CAAC,CAAC;AAElG,eAAO,MAAM,uCAAuC;;;;;;;;iBAmClD,CAAC;AACH,MAAM,MAAM,iCAAiC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uCAAuC,CAAC,CAAC;AAExG,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;iBAQrC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAC9E,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAEnF;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,yBAAyB,GAAG,oBAAoB,CAE7F"}
|