@wildo-ai/platform-config-lib 1.1.0 → 1.1.2

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.
@@ -1 +1 @@
1
- {"version":3,"file":"define-saas-config.js","sourceRoot":"","sources":["../../../../src/project-config/define-saas-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sCAAsC,EAAE,MAAM,sCAAsC,CAAC;AAC9F,OAAO,EAAE,yBAAyB,EAAE,MAAM,4CAA4C,CAAC;AACvF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,kCAAkC,EAAE,MAAM,4CAA4C,CAAC;AAChG,OAAO,EACL,eAAe,EACf,6BAA6B,EAC7B,uCAAuC,EACvC,2CAA2C,EAC3C,0CAA0C,EAC1C,kCAAkC,EAClC,gBAAgB,EAChB,8BAA8B,EAC9B,iCAAiC,GAMlC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,2BAA2B,EAC3B,yBAAyB,GAC1B,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAC9H,sDAAsD;AACtD,wEAAwE;AACxE,sEAAsE;AACtE,+DAA+D;AAC/D,OAAO,EACL,wBAAwB,EACxB,8BAA8B,GAC/B,MAAM,+CAA+C,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAuB,MAAM,qCAAqC,CAAC;AAChG,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,EACL,0BAA0B,EAC1B,YAAY,EACZ,0BAA0B,GAC3B,MAAM,sCAAsC,CAAC;AAE9C;;;;;;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/D,KAAK,MAAM,UAAU,IAAI,iBAAiB,CAAC,kBAAkB,EAAE,CAAC;gBAC9D,iCAAiC,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;YACpD,CAAC;QACH,CAAC;IACH,CAAC;IACD,KAAK,MAAM,CAAC,aAAa,EAAE,UAAU,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,kBAAkB,IAAI,EAAE,CAAC,EAAE,CAAC;QAC1F,IAAI,UAAU,EAAE,OAAO,KAAK,IAAI;YAAE,SAAS;QAC3C,MAAM,UAAU,GAAG,aAAiC,CAAC;QACrD,IAAI,iCAAiC,CAAC,UAAU,CAAC,KAAK,8BAA8B,CAAC,OAAO;YAAE,SAAS;QACvG,IAAI,CAAC,iCAAiC,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC;YACvD,YAAY,CACV,8BAA8B,EAC9B,sBAAsB,UAAU,EAAE,EAClC,eAAe,UAAU,oPAAoP,UAAU,gCAAgC,CACxT,CAAC;QACJ,CAAC;IACH,CAAC;AACH,CAAC","sourcesContent":["import { ExternalProvider_ExchangeProtocol_Kind } from '@wildo-ai/external-connectors-models';\nimport { MinionPlatformAccessScope } from './shared/minion-platform-access.vocabulary';\nimport { z } from 'zod';\nimport { findMinionResourceAccessViolations } from './shared/minion-resource-access.validation';\nimport {\n AppFrontendType,\n ApplicationAiUsePostureSchema,\n ApplicationClientStorageInventorySchema,\n ApplicationOperatorComplianceIdentitySchema,\n ApplicationProviderComplianceChoicesSchema,\n ApplicationRetentionScheduleSchema,\n EngineCapability,\n EngineCapabilityResolutionMode,\n getEngineCapabilityResolutionMode,\n type ApplicationAiUsePosture,\n type ApplicationClientStorageInventory,\n type ApplicationOperatorComplianceIdentity,\n type ApplicationProviderComplianceChoices,\n type ApplicationRetentionSchedule,\n} from '@wildo-ai/saas-models';\nimport {\n BUILTIN_PROVIDER_CAPABILITY,\n BUILTIN_PROVIDER_PROTOCOL,\n} from '@wildo-ai/saas-models/public-runtime';\nimport { buildMinionServiceName, buildWorkerServiceName, normalizeServiceKeyToDnsName } from '@wildo-ai/platform-core-shared';\n// Phase 0 of the provider-registration refactor — see\n// `.cursor/plans/provider-registration-refactor-implementation-plan.md`\n// §Phase 0.13. Imports are `import type` so the schema-only authoring\n// in Phase 0 does not pull runtime code from the new packages.\nimport {\n UnimplementedFieldSource,\n createUnimplementedFieldWarner,\n} from '../_unimplemented/unimplemented-field-warning';\nimport { emitSoftWarn } from '../_unimplemented/soft-warn';\nimport { RegistryConfigSchema, type RegistryConfig } from '../registry/registry-config.schemas';\nimport { AppDataServicesSchema } from './shared/data-services.schemas';\nimport { ApplicationModulesSchema } from './shared/application-modules.schemas';\nimport { WildoSchemaVersionSchema } from './shared/schema-version.schemas';\nimport {\n AppLibraryDefinitionSchema,\n AppRefSchema,\n AppServiceDefinitionSchema,\n} from './shared/service-definitions.schemas';\n\n/**\n * Per-minion resource access whitelist (KD-11 in\n * `.cursor/plans/minions-and-workers-implementation.md`).\n *\n * Authored at the SaaS-config level (NOT inside `wildo.minion.config.ts`)\n * because the resource catalog is owned by the application's\n * `specifications` block — keeping the whitelist here ensures the\n * single authoring surface for \"what can each minion read / write?\"\n * lives next to \"what services exist in this app?\".\n *\n * Default semantics:\n * - Field omitted → minion gets NO repository access (fail-closed).\n * - `read: []` / `write: []` → explicit \"no access\" (same effect as omission,\n * but documents intent).\n * - `read: ['*']` → all readable resources (escape hatch — Phase 2's\n * `MinionScopedServicesRegistryHandlerBackendService` recognises the\n * wildcard sentinel).\n * - Resource names are validated cross-config in Phase 2 against the\n * parsed resource catalog (`start-minion-application` per IC-2);\n * Phase 1 only validates SHAPE, not membership.\n *\n * The bucket value is the existing `AppRefSchema` shape (strict,\n * `path` only) extended with the optional `resourceAccess` block —\n * extending `AppRefSchema.extend()` keeps the strict-key invariant\n * so an unknown key on a minion entry still parses to a clear error.\n */\nexport const MinionResourceAccessSchema = z.strictObject({\n read: z.array(z.string().min(1)).default([]),\n write: z.array(z.string().min(1)).default([]),\n}).superRefine((resourceAccess, ctx) => {\n // Enforced at PARSE time, not at grant-derivation time, and the difference is\n // the point: this is the declaration an author writes, so the error belongs\n // where they can see the line that caused it. By the time apps-manager derives\n // grants the config is long gone, and the failure would surface as a database\n // privilege nobody asked for.\n for (const violation of findMinionResourceAccessViolations(resourceAccess)) {\n ctx.addIssue({\n code: 'custom',\n path: [violation.axis],\n message: violation.message,\n });\n }\n});\nexport type MinionResourceAccess = z.infer<typeof MinionResourceAccessSchema>;\n\n/**\n * The authored PLATFORM-ACCESS declaration, as one named schema.\n *\n * Extracted from the inline literal it started as because the axis has to be\n * declared at every hop between `wildo.saas.config.ts` and the apps-manager\n * door — the managed declaration, its Zod schema, the bootstrap-config response,\n * the strict application-config object, and the engine's loader mirror. Six\n * hand-written copies of `{ scopes: z.array(...) }` is six chances for one of\n * them to disagree, and a hop that disagrees STRIPS the axis silently.\n *\n * Mirrors {@link MinionPlatformAccessDeclaration}, which is the type the\n * derivation (`buildOwnCronRecordFilter`) consumes.\n */\n/**\n * Reconciled 2026-08-18. Two parallel workstreams briefly declared this axis in\n * this file with different shapes — a flat capability array and this scoped\n * object — which is a duplicate `const`, a PARSE error, and took the whole file\n * (and `wildo config sync`) down. A third party then renamed one of them apart\n * to unblock the parse, which left the other's five call sites dangling.\n *\n * The scoped shape SURVIVED, by agreement with its author; the flat one and its\n * vocabulary are deleted. The name is back to the one those call sites already\n * use, so no consumer carries the scar of the collision.\n */\nexport const MinionPlatformAccessSchema = z.strictObject({\n scopes: z.array(z.enum(MinionPlatformAccessScope)).optional(),\n});\nexport type MinionPlatformAccess = z.infer<typeof MinionPlatformAccessSchema>;\n\n/**\n * The same axis as it TRAVELS, typed structurally.\n *\n * ## Why the carried type is not the authored one\n *\n * `MinionPlatformAccessSchema` infers `{ scopes?: MinionPlatformAccessScope[] }`,\n * and a TypeScript enum is a NOMINAL type. Every hop between the author and the\n * apps-manager door is re-declared in a package that would then have to NAME that\n * enum through a public specifier — and the engine's `AppConfiguration` cannot,\n * so `tsc` refuses the whole application-config schema:\n *\n * TS2742 The inferred type of 'Wildo_Application_ResolvedConfig_Schema'\n * cannot be named without a reference to '…/node_modules/@wildo-ai/saas-models/src'\n * TS7056 The inferred type of this node exceeds the maximum length the compiler will serialize\n *\n * Measured, not guessed: reverting only the engine-side field removes both\n * errors, and re-adding it structurally keeps them away. See\n * `.claude/rules/package-public-entrypoints.md` for the general mechanism.\n *\n * ## Why this loses nothing\n *\n * The vocabulary is enforced where enforcement belongs — at AUTHORING, by\n * `MinionPlatformAccessSchema` above, on the line the author wrote; and at the\n * DOOR, where apps-manager drops any scope this engine cannot name before it\n * mints an attestation. The hops in between are transport. Typing transported\n * data as the closed vocabulary would claim a guarantee the wire cannot give:\n * these values arrive from a stored declaration that some other engine revision\n * may have written.\n */\nexport const MinionPlatformAccessCarriedSchema = z.strictObject({\n scopes: z.array(z.string().min(1)).optional(),\n});\nexport type MinionPlatformAccessCarried = z.infer<typeof MinionPlatformAccessCarriedSchema>;\n\nconst MinionBucketEntrySchema = AppRefSchema.extend({\n resourceAccess: MinionResourceAccessSchema.optional(),\n /**\n * Whether this minion needs a route to the public internet (Step 5-egress).\n *\n * ## Why it is AUTHORED and defaults to false\n *\n * Network segmentation marks the backing-service networks `internal`, but\n * attachment to ANY non-internal network restores NAT — so \"may this runtime\n * reach the internet?\" is decided by one declaration and nowhere else. Marking\n * the data networks internal is necessary and not sufficient.\n *\n * It is NOT inferred from `resourceAccess`. A scraper legitimately reaches the\n * internet, and it is tempting to grant egress to any minion that touches data\n * — but declaring `read: ['todos']` is not a statement about the internet, and\n * conflating them would make egress universal for every data-touching minion,\n * which is precisely the \"everything can reach everything\" posture this removes.\n *\n * The point is not to refuse egress. It is to stop it being universal and\n * unstated, so a reviewer can see which minions leave the cluster and ask why.\n *\n * Default `false`, deliberately: the safe posture is the one an author gets by\n * not thinking about it. A minion that genuinely needs the internet says so in\n * one line, and that line is the thing a security review reads.\n */\n requiresInternetEgress: z.boolean().optional().default(false),\n /**\n * PLATFORM-level access — what this minion may see of the platform's record OF\n * ITSELF (R4 / R5). Today: its own cron/schedule entries.\n *\n * **Independent of `resourceAccess` by requirement, not by accident (R5).**\n * Neither implies the other, and nothing in the derivation of either consults\n * the other. A minion that works on todos and never inspects its schedule is a\n * normal shape; so is a health-reporting minion that reads its tick history and\n * touches no application data.\n *\n * The scope vocabulary has ONE member on purpose. There is no\n * `ALL_CRON_RECORDS`: a scope that could name another minion is a scope\n * somebody eventually grants, and R4 requires a cross-minion read to be\n * INEXPRESSIBLE rather than refused.\n */\n platformAccess: MinionPlatformAccessSchema.optional(),\n});\nexport type MinionBucketEntry = z.infer<typeof MinionBucketEntrySchema>;\n\nconst BootstrapFirstAdminSeedSchema = z.object({\n userTypes: z.array(z.string().min(1)).min(1),\n});\nexport type BootstrapFirstAdminSeed = z.infer<typeof BootstrapFirstAdminSeedSchema>;\n\nconst AppBootstrapSchema = z.object({\n firstAdmin: BootstrapFirstAdminSeedSchema.optional(),\n});\nexport type AppBootstrap = z.infer<typeof AppBootstrapSchema>;\ntype AppBootstrapInput = z.input<typeof AppBootstrapSchema>;\n\n/**\n * Per-runtime provider visibility authored at the application level.\n *\n * `defineSaaSProviders({ scopes })` is the canonical app-side provider\n * graph. Tooling materializes this declaration into runtime-specific\n * artifacts; runtime packages should consume those artifacts instead of\n * importing `wildo.saas.config.ts`.\n */\nexport const EngineCapabilityActivationSchema = z.strictObject({\n enabled: z.boolean(),\n required: z.boolean().optional(),\n});\nexport type EngineCapabilityActivation = z.infer<typeof EngineCapabilityActivationSchema>;\nexport type EngineCapabilityActivationInput = z.input<typeof EngineCapabilityActivationSchema>;\n\nexport const EngineCapabilityActivationsSchema = z.partialRecord(\n z.enum(EngineCapability),\n EngineCapabilityActivationSchema,\n).default({});\nexport type EngineCapabilityActivations = z.infer<typeof EngineCapabilityActivationsSchema>;\n\nexport const ProviderConfigurationsSchema = z.record(\n z.string().min(1),\n z.record(z.string().min(1), z.unknown()).optional(),\n).default(() => ({}));\nexport type ProviderConfigurations = z.infer<typeof ProviderConfigurationsSchema>;\nexport type ProviderConfigurationsInput = z.input<typeof ProviderConfigurationsSchema>;\n\nconst BUILTIN_PROVIDER_CAPABILITY_VALUES = new Set<string>(\n Object.values(BUILTIN_PROVIDER_CAPABILITY),\n);\nconst CUSTOM_PROVIDER_CAPABILITY_PATTERN = /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/;\n\nexport const ProviderCapabilitySelectorSchema = z.string().min(1).refine(\n (value) => BUILTIN_PROVIDER_CAPABILITY_VALUES.has(value) || CUSTOM_PROVIDER_CAPABILITY_PATTERN.test(value),\n {\n message:\n 'Provider capabilities must be a built-in ProviderCapability or app custom kebab-case capability.',\n },\n);\n\nconst KNOWN_PROVIDER_PROTOCOLS = new Set<string>([\n ...(Object.values(ExternalProvider_ExchangeProtocol_Kind) as string[]),\n ...(Object.values(BUILTIN_PROVIDER_PROTOCOL) as string[]),\n]);\n\nexport const ProviderProtocolSelectorSchema = z.string().min(1).refine(\n (value) => KNOWN_PROVIDER_PROTOCOLS.has(value),\n { message: 'protocols must use known external protocol literals.' },\n);\n\nexport const SaasProviderScopeSelectionSchema = z.strictObject({\n engineCapabilities: z.array(z.enum(EngineCapability)).default([]),\n providerCapabilities: z.array(ProviderCapabilitySelectorSchema).default([]),\n protocols: z.array(ProviderProtocolSelectorSchema).default([]),\n});\nexport type SaasProviderScopeSelection = z.infer<typeof SaasProviderScopeSelectionSchema>;\n\nexport const SaasProviderSelectionPolicySchema = z.strictObject({\n primary: z.string().min(1),\n fallbacks: z.array(z.string().min(1)).default([]),\n});\nexport type SaasProviderSelectionPolicy = z.infer<typeof SaasProviderSelectionPolicySchema>;\n\nconst SaasProviderRuntimeScopeSchema = z.strictObject({\n providers: z.record(z.string().min(1), SaasProviderScopeSelectionSchema).default({}),\n selection: z.partialRecord(\n z.enum(EngineCapability),\n SaasProviderSelectionPolicySchema,\n ).optional(),\n}).superRefine((scope, ctx) => {\n const providerRefs = new Set(Object.keys(scope.providers));\n for (const [capability, policy] of Object.entries(scope.selection ?? {})) {\n for (const providerRef of [policy.primary, ...(policy.fallbacks ?? [])]) {\n if (!providerRefs.has(providerRef)) {\n ctx.addIssue({\n code: 'custom',\n path: ['selection', capability],\n message: `Provider selection for ${capability} references \"${providerRef}\" but it is not declared in this scope.`,\n });\n }\n }\n }\n});\nexport type SaasProviderRuntimeScope = z.infer<typeof SaasProviderRuntimeScopeSchema>;\n\nexport const SaasProvidersScopesSchema = z.strictObject({\n backend: SaasProviderRuntimeScopeSchema.optional(),\n companion: SaasProviderRuntimeScopeSchema.optional(),\n frontendServices: z.record(z.string().min(1), SaasProviderRuntimeScopeSchema).optional(),\n minions: z.record(z.string().min(1), SaasProviderRuntimeScopeSchema).optional(),\n workers: z.record(z.string().min(1), SaasProviderRuntimeScopeSchema).optional(),\n});\nexport type SaasProvidersScopes = z.infer<typeof SaasProvidersScopesSchema>;\n\nexport const SaasConfigProvidersBlockSchema = z.strictObject({\n scopes: SaasProvidersScopesSchema,\n}).default(() => ({ scopes: {} }));\nexport type SaasConfigProvidersBlock = z.infer<typeof SaasConfigProvidersBlockSchema>;\nexport type SaasConfigProvidersBlockInput = z.input<typeof SaasConfigProvidersBlockSchema>;\n\nexport interface SaasProviderCatalogEntry {\n engineCapabilities?: readonly string[];\n providerCapabilities?: readonly string[];\n protocols?: readonly string[];\n}\n\nexport type SaasProviderCatalog = Record<string, SaasProviderCatalogEntry>;\n\ntype CatalogFieldValue<\n TCatalog extends SaasProviderCatalog,\n TRef extends keyof TCatalog & string,\n TField extends keyof SaasProviderCatalogEntry,\n> = TCatalog[TRef][TField] extends readonly (infer TValue)[]\n ? Extract<TValue, string>\n : never;\n\nexport interface SaasProviderSelectionPolicyInput<TProviderRef extends string = string> {\n primary: TProviderRef;\n fallbacks?: TProviderRef[];\n}\n\nexport type SaasProviderScopeSelectionInputFromCatalog<\n TCatalog extends SaasProviderCatalog,\n TRef extends keyof TCatalog & string,\n> = {\n engineCapabilities?: Array<CatalogFieldValue<TCatalog, TRef, 'engineCapabilities'>>;\n providerCapabilities?: Array<CatalogFieldValue<TCatalog, TRef, 'providerCapabilities'>>;\n protocols?: Array<CatalogFieldValue<TCatalog, TRef, 'protocols'>>;\n};\n\nexport type SaasProviderRuntimeScopeInputFromCatalog<TCatalog extends SaasProviderCatalog> = {\n providers?: Partial<{\n [TRef in keyof TCatalog & string]: SaasProviderScopeSelectionInputFromCatalog<TCatalog, TRef>;\n }>;\n selection?: Partial<Record<\n EngineCapability,\n SaasProviderSelectionPolicyInput<keyof TCatalog & string>\n >>;\n};\n\nexport type SaasConfigProvidersBlockInputFromCatalog<TCatalog extends SaasProviderCatalog> = {\n scopes: {\n backend?: SaasProviderRuntimeScopeInputFromCatalog<TCatalog>;\n companion?: SaasProviderRuntimeScopeInputFromCatalog<TCatalog>;\n frontendServices?: Record<string, SaasProviderRuntimeScopeInputFromCatalog<TCatalog>>;\n minions?: Record<string, SaasProviderRuntimeScopeInputFromCatalog<TCatalog>>;\n workers?: Record<string, SaasProviderRuntimeScopeInputFromCatalog<TCatalog>>;\n };\n};\n\nexport function defineSaaSProviders(\n providers: z.input<typeof SaasConfigProvidersBlockSchema>,\n): SaasConfigProvidersBlock;\nexport function defineSaaSProviders<TCatalog extends SaasProviderCatalog>(\n providers: SaasConfigProvidersBlockInputFromCatalog<TCatalog>,\n): SaasConfigProvidersBlock;\nexport function defineSaaSProviders(\n providers: z.input<typeof SaasConfigProvidersBlockSchema>,\n): SaasConfigProvidersBlock {\n return SaasConfigProvidersBlockSchema.parse(providers);\n}\n\nexport interface WildoSaasConfig {\n version?: z.infer<typeof WildoSchemaVersionSchema>;\n name: string;\n slug: string;\n displayName: string;\n description?: string;\n type: 'saas';\n services: Record<string, z.infer<typeof AppServiceDefinitionSchema>>;\n modules: z.infer<typeof ApplicationModulesSchema>;\n libraries?: Record<string, z.infer<typeof AppLibraryDefinitionSchema>>;\n specifications?: z.infer<typeof AppRefSchema>;\n minions?: Record<string, MinionBucketEntry>;\n workers?: Record<string, z.infer<typeof AppRefSchema>>;\n engineCapabilities: EngineCapabilityActivations;\n providerConfigurations: ProviderConfigurations;\n providers: SaasConfigProvidersBlock;\n bootstrap?: AppBootstrap;\n dataServices: z.infer<typeof AppDataServicesSchema>;\n /** See `WildoSaasConfigSchema.dataRetention`. Optional and partial: an undeclared class is undecided, never \"forever\". */\n dataRetention?: ApplicationRetentionSchedule;\n /** See `WildoSaasConfigSchema.aiUsePosture`. An enabled AI capability with no entry is reported, never assumed harmless. */\n aiUsePosture?: ApplicationAiUsePosture;\n /** See `WildoSaasConfigSchema.clientStorage`. Keyed by frontend surface; an absent surface is uninventoried, an empty array is \"sets nothing\". */\n clientStorage?: ApplicationClientStorageInventory;\n /**\n * WHO operates this service, in what legal role, on what lawful basis (issue #131).\n *\n * The answers a compliance document needs in its opening sections. Absent, a produced privacy\n * notice cannot name who is publishing it — and because a landing REPLACES the document, an\n * operator who answered by editing it lost the answer on the next regeneration.\n */\n operatorComplianceIdentity?: ApplicationOperatorComplianceIdentity;\n /**\n * Per configured provider, who runs it and where it processes (issue #130).\n *\n * The provider declares what is POSSIBLE; this is the operator's CHOICE among those. A vendor-hosted\n * provider is a third-party recipient a notice must enumerate; a self-hosted one is not a recipient\n * at all, and without this axis a produced notice would call an audit ledger you run yourself a\n * third party.\n */\n providerComplianceChoices?: ApplicationProviderComplianceChoices;\n moduleRegistries?: RegistryConfig;\n}\n\nexport interface WildoSaasConfigInput {\n version?: z.input<typeof WildoSchemaVersionSchema>;\n name: string;\n slug: string;\n displayName: string;\n description?: string;\n type: 'saas';\n services: Record<string, z.input<typeof AppServiceDefinitionSchema>>;\n /**\n * OPTIONAL, matching `ApplicationModulesSchema`, which is `.optional()`. Declared as required\n * here it contradicted its own schema: a config that legitimately omits `modules` parses fine\n * at runtime and was rejected by the type.\n */\n modules?: z.input<typeof ApplicationModulesSchema>;\n libraries?: Record<string, z.input<typeof AppLibraryDefinitionSchema>>;\n specifications?: z.input<typeof AppRefSchema>;\n minions?: Record<string, z.input<typeof MinionBucketEntrySchema>>;\n workers?: Record<string, z.input<typeof AppRefSchema>>;\n engineCapabilities?: z.input<typeof EngineCapabilityActivationsSchema>;\n providerConfigurations?: z.input<typeof ProviderConfigurationsSchema>;\n providers?: z.input<typeof SaasConfigProvidersBlockSchema>;\n bootstrap?: AppBootstrapInput;\n dataServices: z.input<typeof AppDataServicesSchema>;\n /** See `WildoSaasConfigSchema.dataRetention`. */\n dataRetention?: z.input<typeof ApplicationRetentionScheduleSchema>;\n /** See `WildoSaasConfigSchema.aiUsePosture`. */\n aiUsePosture?: z.input<typeof ApplicationAiUsePostureSchema>;\n /** See `WildoSaasConfigSchema.clientStorage`. */\n clientStorage?: z.input<typeof ApplicationClientStorageInventorySchema>;\n operatorComplianceIdentity?: z.input<typeof ApplicationOperatorComplianceIdentitySchema>;\n providerComplianceChoices?: z.input<typeof ApplicationProviderComplianceChoicesSchema>;\n moduleRegistries?: z.input<typeof RegistryConfigSchema>;\n}\n\n/**\n * @wildo_source:part:start platform.config.saas facet:layer:platform facet:family:bootstrap\n *\n * Root `wildo.saas.config.ts` application declaration: services, modules,\n * engine capabilities, provider scopes, provider configurations and data\n * services. Import `defineSaasConfig` from `@wildo-ai/platform-config-lib` and\n * keep cross-service choices here rather than scattering them through runtime\n * source files.\n */\n/**\n * The root schema is `z.strictObject` (not `z.object`) so that authoring an\n * unknown top-level key surfaces as a\n * Zod parse error at `defineSaasConfig` time instead of being silently\n * dropped. A typoed `dataServises:` block (or a removed-then-re-introduced\n * `secretsSharingPolicy`) would otherwise compile cleanly, parse cleanly,\n * and produce no runtime warning — exactly the failure mode the\n * `@unimplemented` machinery exists to prevent. The fail-closed posture\n * trades a slightly louder authoring boundary for a guarantee that every\n * authored top-level concern is either consumed or explicitly rejected.\n */\nexport const WildoSaasConfigSchema = z.strictObject({\n /**\n * Authored schema-format version for this `wildo.saas.config.ts`,\n * expressed as a **SemVer 2.0.0 string** (e.g. `'1.0.0'`,\n * `'2.3.1-rc.1'`, `'1.0.0+build.42'`).\n *\n * SemVer (not a bare integer) keeps MAJOR-vs-MINOR-vs-PATCH meaning explicit\n * for future configuration evolution — bare integers conflate \"breaking\", \"feature\n * add\" and \"bug-fix\" into a single dimension and force every bump to\n * look like a breaking change.\n *\n * The field is intentionally optional (no Zod default) so unauthored\n * configurations stay silent. Version-based migration enforcement is not\n * available yet; an authored value records intent but does not itself perform\n * a migration or authorize an incompatible configuration.\n */\n version: WildoSchemaVersionSchema.optional(),\n name: z.string().min(1),\n slug: z.string().min(1).regex(/^[a-z0-9-]+$/, 'slug must be lowercase alphanumeric with hyphens'),\n displayName: z.string().min(1),\n description: z.string().optional(),\n type: z.literal('saas'),\n\n services: z.record(z.string(), AppServiceDefinitionSchema),\n modules: ApplicationModulesSchema,\n libraries: z.record(z.string(), AppLibraryDefinitionSchema).optional(),\n specifications: AppRefSchema.optional(),\n /**\n * Long-running \"minion\" actor hosts (scheduled or always-up).\n *\n * Each entry can declare a `resourceAccess` read/write whitelist. The\n * current configuration parser accepts the declaration, but a minion runtime\n * does not consume or enforce it yet. Do not rely on this field as an access\n * control until the installed runtime exposes that capability.\n */\n minions: z.record(z.string(), MinionBucketEntrySchema).optional(),\n /**\n * HTTP-only \"worker\" subprocesses (compute-heavy, often Rust/Go).\n *\n * The current configuration parser accepts these declarations, but a worker\n * runtime is not available yet. Workers have no `resourceAccess` field\n * because they do not receive database access by default; a resource\n * whitelist would therefore be misleading.\n */\n workers: z.record(z.string(), AppRefSchema).optional(),\n\n engineCapabilities: EngineCapabilityActivationsSchema,\n providerConfigurations: ProviderConfigurationsSchema,\n\n /**\n * Per-facet provider registries.\n *\n * Authored as a `z.custom` because the value is a constructed object\n * (registry instances carry methods like `getProviderByRef`); strict\n * runtime parsing of method-bearing values is intentionally skipped\n * — the application/provider composition boundary enforces the registry\n * invariants.\n *\n * See the `SaasConfigProvidersBlock` JSDoc above for the role of each\n * registry facet.\n */\n providers: SaasConfigProvidersBlockSchema,\n\n bootstrap: AppBootstrapSchema.optional(),\n dataServices: AppDataServicesSchema,\n\n /**\n * How long this application keeps each class of data, and why.\n *\n * Declared HERE, beside `dataServices`, because the two describe the same thing from opposite ends:\n * `dataServices` says which stores exist, and this says how long what is in them is kept. Both are\n * application-wide operator decisions rather than per-resource authoring.\n *\n * Optional as a whole, and partial within itself. An application that has decided nothing omits it;\n * one that has decided only its customer-data period declares only that. Absence is never read as\n * \"kept forever\" — a compliance document states the classes that ARE declared and marks the rest as\n * needing an operator decision, which is what lets the document be produced today rather than\n * waiting on a number nobody has yet.\n *\n * Two consumers, and the second is why the classes are the STORES: a privacy notice's retention\n * paragraph (issue #89, which is why this exists), and the backup-and-restore inventory a remote\n * environment still has none of (issue #8) — one declaration answers both instead of two that drift.\n */\n dataRetention: ApplicationRetentionScheduleSchema.optional(),\n\n /**\n * Whether each AI capability this application enables DECIDES something about a person, and who\n * reviews it if so.\n *\n * A capability establishes that AI is in use and for what function; it cannot establish consequence,\n * because the same `AI_LLM` backs a summariser that decides nothing and a screener that decides a\n * great deal (issue #92).\n *\n * Optional and partial, like `dataRetention` — but the silence here is the more dangerous one. A\n * notice describing AI use without addressing consequence does not read as \"unknown\", it reads as\n * \"nothing significant happens\", which silently claims an exemption. So an enabled AI capability with\n * no entry is REPORTED as outstanding rather than assumed harmless.\n */\n aiUsePosture: ApplicationAiUsePostureSchema.optional(),\n\n /**\n * What this application stores in a visitor's browser, per FRONTEND SURFACE — the itemised table a\n * cookie notice IS (issue #91).\n *\n * Per surface because a public marketing site and the authenticated application set different things,\n * and one merged list would be wrong for both. The FRAMEWORK's own cookies are not declared here:\n * every application inherits them and none authored them, so they are answered by\n * `ENGINE_CLIENT_STORAGE_ENTRIES` and reported separately.\n *\n * Optional and partial. A surface with no entry has not been inventoried and is reported as such; an\n * empty ARRAY is the different, positive answer — this surface sets nothing of its own.\n */\n clientStorage: ApplicationClientStorageInventorySchema.optional(),\n operatorComplianceIdentity: ApplicationOperatorComplianceIdentitySchema.optional(),\n providerComplianceChoices: ApplicationProviderComplianceChoicesSchema.optional(),\n\n /**\n * Module registries the app pulls modules from. Each entry pairs a\n * stable id (used by lockfile entries + the `--registry <id>` CLI\n * flag) with a registry HTTP origin. Optional — when omitted, CLI\n * commands fall back to alias resolution (`local` / `public`) or\n * the env-policy default (`WILDO_FRAMEWORK_DEVELOPER` → local;\n * else public).\n *\n * Example: `[{ id: 'wildo', url: 'https://registry.wildo.ai' }]`\n *\n * Credentials never live here — they live per-machine under\n * the local Wildo credential store. This config only points at endpoints.\n */\n moduleRegistries: RegistryConfigSchema.optional(),\n\n // Technical-documentation and marketing-website configuration belong in\n // their respective service folders as\n // `wildo.tech-doc.config.ts` and `wildo.website.config.ts`,\n // co-located with the public packages that own their semantics\n // (`@wildo-ai/saas-technical-doc` and `@wildo-ai/saas-website`). The\n // schemas, types, `defineXxxConfig` helpers, and (for website) the\n // jiti-backed loader now live entirely in those packages.\n // The dev companion / Astro build discover and load each per-service\n // file via the unique service of the matching `frontendType`. The\n // single-frontend-per-kind constraint enforced by the `superRefine`\n // below guarantees that \"the TECH_DOC service folder\" and \"the\n // STATIC_WEBSITE service folder\" are unambiguous.\n}).superRefine((config, ctx) => {\n const availableServiceKeys = new Set(Object.keys(config.services));\n const frontendServiceKeys = new Set(\n Object.entries(config.services)\n .filter(([, definition]) => definition.frontendType !== undefined)\n .map(([serviceKey]) => serviceKey),\n );\n\n for (const [moduleId, moduleBinding] of Object.entries(config.modules ?? {})) {\n for (const serviceKey of moduleBinding.services) {\n if (availableServiceKeys.has(serviceKey)) {\n continue;\n }\n\n ctx.addIssue({\n code: 'custom',\n path: ['modules', moduleId, 'services'],\n message: `Module \"${moduleId}\" references unknown service \"${serviceKey}\".`,\n });\n }\n }\n\n // Minion/worker bucket keys are RFC1123-normalized (via `buildMinionServiceName`\n // / `buildWorkerServiceName`) into the k8s object / built image / compose service\n // / worker dispatch-host DNS name at deploy time. camelCase keys are ACCEPTED and\n // normalized — matching the `services.<key>` convention and the existing\n // `WILDO_WORKER_<NAME>_URL` env-key normalization — but two keys that COLLAPSE to\n // the same DNS name would silently deploy as ONE Service/image, and a key that\n // normalizes to EMPTY (all-symbol) would emit an invalid trailing-hyphen name.\n // Fail fast at authoring on either, independently per background-runtime map.\n // The full generated deploy name is `{slug}-{minion|worker}-{dnsName}`. It is\n // used as the k8s Service `metadata.name` AND the `app.kubernetes.io/name` label\n // value — both bounded by the RFC1123 label limit of 63 chars. A longer name is\n // rejected by kubectl at deploy time (and by Docker for the image tag), so fail\n // fast at authoring rather than let CI/deploy blow up. Truncating instead would\n // be a silent \"trick\" that risks a collision with a sibling key — rejected.\n const K8S_LABEL_MAX_LENGTH = 63;\n for (const [mapLabel, bucket, buildServiceName] of [\n ['minions', config.minions, buildMinionServiceName],\n ['workers', config.workers, buildWorkerServiceName],\n ] as const) {\n if (!bucket) continue;\n const dnsNameToKey = new Map<string, string>();\n for (const bucketKey of Object.keys(bucket)) {\n const dnsName = normalizeServiceKeyToDnsName(bucketKey);\n if (dnsName.length === 0) {\n ctx.addIssue({\n code: 'custom',\n path: [mapLabel, bucketKey],\n message:\n `${mapLabel} key \"${bucketKey}\" normalizes to an empty DNS name — it must contain at least ` +\n `one [a-z0-9] character so the deployed k8s Service / image name is valid (e.g. \"market-scraper\").`,\n });\n continue;\n }\n const serviceName = buildServiceName(config.slug, bucketKey);\n if (serviceName.length > K8S_LABEL_MAX_LENGTH) {\n ctx.addIssue({\n code: 'custom',\n path: [mapLabel, bucketKey],\n message:\n `${mapLabel} key \"${bucketKey}\" generates the deploy name \"${serviceName}\" ` +\n `(${serviceName.length} chars), exceeding the ${K8S_LABEL_MAX_LENGTH}-char RFC1123 limit for a ` +\n `k8s Service / label name. Shorten the ${mapLabel.slice(0, -1)} key or the app slug (\"${config.slug}\").`,\n });\n }\n const existing = dnsNameToKey.get(dnsName);\n if (existing !== undefined) {\n ctx.addIssue({\n code: 'custom',\n path: [mapLabel, bucketKey],\n message:\n `${mapLabel} keys \"${existing}\" and \"${bucketKey}\" both normalize to the DNS name \"${dnsName}\" — ` +\n `they would deploy as the SAME k8s Service / image / compose service. Rename one so the normalized names differ.`,\n });\n continue;\n }\n dnsNameToKey.set(dnsName, bucketKey);\n }\n }\n\n const scopeBuckets: Record<string, ReadonlySet<string>> = {\n services: availableServiceKeys,\n minions: new Set(Object.keys(config.minions ?? {})),\n workers: new Set(Object.keys(config.workers ?? {})),\n };\n\n const validateProviderScope = (\n scopePath: Array<string | number>,\n scope: SaasProviderRuntimeScope | undefined,\n ): void => {\n if (!scope) return;\n\n for (const [providerRef, selection] of Object.entries(scope.providers)) {\n for (const capability of selection.engineCapabilities) {\n if (config.engineCapabilities?.[capability]?.enabled !== true) {\n ctx.addIssue({\n code: 'custom',\n path: [...scopePath, 'providers', providerRef, 'engineCapabilities'],\n message:\n `Provider \"${providerRef}\" selects disabled or unauthored engine capability \"${capability}\".`,\n });\n }\n }\n }\n\n for (const [capability, policy] of Object.entries(scope.selection ?? {})) {\n // A FAN_OUT capability (e.g. COMPLIANCE_AUDIT_TRAIL) writes to EVERY declared\n // provider — a `selection` (primary + failover) is meaningless for it. Reject\n // it; declaring the providers is enough (all are active).\n if (\n getEngineCapabilityResolutionMode(capability as EngineCapability)\n === EngineCapabilityResolutionMode.FAN_OUT\n ) {\n ctx.addIssue({\n code: 'custom',\n path: [...scopePath, 'selection', capability],\n message:\n `\"${capability}\" is a FAN_OUT capability — every declared provider is active (no primary/failover). Remove its \\`selection\\` entry; declaring the providers is enough.`,\n });\n continue;\n }\n for (const providerRef of [policy.primary, ...(policy.fallbacks ?? [])]) {\n const providerSelection = scope.providers[providerRef];\n if (providerSelection && !providerSelection.engineCapabilities.includes(capability as EngineCapability)) {\n ctx.addIssue({\n code: 'custom',\n path: [...scopePath, 'selection', capability],\n message:\n `Provider selection for \"${capability}\" references provider \"${providerRef}\" that does not declare engineCapabilities including ${capability}.`,\n });\n }\n }\n }\n };\n\n validateProviderScope(['providers', 'scopes', 'backend'], config.providers?.scopes.backend);\n validateProviderScope(['providers', 'scopes', 'companion'], config.providers?.scopes.companion);\n\n for (const [serviceKey, scope] of Object.entries(config.providers?.scopes.frontendServices ?? {})) {\n if (!availableServiceKeys.has(serviceKey)) {\n ctx.addIssue({\n code: 'custom',\n path: ['providers', 'scopes', 'frontendServices', serviceKey],\n message: `Provider scope references unknown frontend service \"${serviceKey}\".`,\n });\n } else if (!frontendServiceKeys.has(serviceKey)) {\n ctx.addIssue({\n code: 'custom',\n path: ['providers', 'scopes', 'frontendServices', serviceKey],\n message:\n `Provider scope references non-frontend service \"${serviceKey}\". ` +\n 'Only services with a frontendType may appear under providers.scopes.frontendServices.',\n });\n }\n validateProviderScope(['providers', 'scopes', 'frontendServices', serviceKey], scope);\n }\n\n for (const [minionKey, scope] of Object.entries(config.providers?.scopes.minions ?? {})) {\n if (!scopeBuckets.minions.has(minionKey)) {\n ctx.addIssue({\n code: 'custom',\n path: ['providers', 'scopes', 'minions', minionKey],\n message: `Provider scope references unknown minion \"${minionKey}\".`,\n });\n }\n validateProviderScope(['providers', 'scopes', 'minions', minionKey], scope);\n }\n\n for (const [workerKey, scope] of Object.entries(config.providers?.scopes.workers ?? {})) {\n if (!scopeBuckets.workers.has(workerKey)) {\n ctx.addIssue({\n code: 'custom',\n path: ['providers', 'scopes', 'workers', workerKey],\n message: `Provider scope references unknown worker \"${workerKey}\".`,\n });\n }\n validateProviderScope(['providers', 'scopes', 'workers', workerKey], scope);\n }\n\n // At most one service may use each \"single-instance\" frontend kind.\n //\n // `TECH_DOC` and `STATIC_WEBSITE` are framework-managed singletons:\n // a SaaS app has at most one technical-documentation site and at\n // most one marketing/landing site. The per-service config files\n // (`wildo.tech-doc.config.ts` for `TECH_DOC`, `wildo.website.config.ts`\n // for `STATIC_WEBSITE`) are discovered by the companion / Astro\n // build through the unique service of the matching `frontendType`.\n // If the schema allowed two `TECH_DOC` services, the companion\n // would have no deterministic way to project the OpenAPI YAMLs to\n // \"the\" docs root — every consumer would need a \"which docs\n // service?\" indirection for no real-world payoff (multi-doc-site\n // / multi-marketing-site SaaS apps are not a use case we have\n // ever needed to support).\n //\n // The constraint is enforced at parse time so the failure surfaces\n // at `defineSaasConfig` (CLI parse, dev watcher reload) rather than\n // at first companion-driven OpenAPI publish — the latter would be\n // a confusing \"your second docs service was silently picked over\n // the first\" type of failure.\n //\n // `SAAS_APP` is intentionally NOT constrained here: a single repo\n // can ship multiple SaaS-app frontends (e.g. a customer surface and\n // an internal admin), each owning its own session, and the\n // cross-frontend handoff already handles that fan-out via\n // `runtime.endPoints[*].publicUrl`. The session-owning role does not\n // create a unique-receiver assumption the way the docs / website\n // frontends do.\n const singletonFrontends: ReadonlyArray<AppFrontendType> = [\n AppFrontendType.TECH_DOC,\n AppFrontendType.STATIC_WEBSITE,\n ];\n for (const kind of singletonFrontends) {\n const matchingServiceKeys = Object.entries(config.services)\n .filter(([, def]) => def.frontendType === kind)\n .map(([key]) => key);\n if (matchingServiceKeys.length > 1) {\n for (const offendingKey of matchingServiceKeys) {\n ctx.addIssue({\n code: 'custom',\n path: ['services', offendingKey, 'frontendType'],\n message:\n `frontendType='${kind}' may be declared on at most one service ` +\n `per SaaS app (found ${matchingServiceKeys.length}: ${matchingServiceKeys.join(', ')}). ` +\n `${kind} is a framework-managed singleton — the companion / build ` +\n `pipeline addresses it as \"the ${kind} service\" with no disambiguator. ` +\n `Collapse the duplicates into a single service or split them into separate apps.`,\n });\n }\n }\n }\n}) as unknown as z.ZodType<WildoSaasConfig, WildoSaasConfigInput>;\n/** @wildo_source:part:end platform.config.saas */\n\n/**\n * Define a SaaS application configuration.\n * Provides full IDE autocompletion for engine capabilities, provider scopes,\n * services, modules, and data services.\n *\n * @example\n * ```ts\n * import { defineSaasConfig } from '@wildo-ai/platform-config-lib';\n * import { EngineCapability } from '@wildo-ai/saas-models';\n *\n * export default defineSaasConfig({\n * name: 'wonder-todos',\n * slug: 'wonder-todos',\n * displayName: 'Wonder Todos',\n * type: 'saas',\n * engineCapabilities: {\n * [EngineCapability.EMAIL_TRANSACTIONAL]: { enabled: true },\n * [EngineCapability.SMS]: { enabled: false },\n * [EngineCapability.AI_LLM]: { enabled: true },\n * },\n * providerConfigurations: {},\n * providers: defineSaaSProviders({\n * scopes: {\n * backend: {\n * providers: {\n * resend: {\n * engineCapabilities: [EngineCapability.EMAIL_TRANSACTIONAL],\n * providerCapabilities: ['EMAIL_TRANSACTIONAL'],\n * protocols: ['EMAIL_PROVIDER'],\n * },\n * },\n * },\n * },\n * }),\n * // ...\n * });\n * ```\n */\nexport function defineSaasConfig(config: WildoSaasConfigInput): WildoSaasConfig {\n const parsed = WildoSaasConfigSchema.parse(config);\n emitUnimplementedRuntimeWarnings(parsed);\n return parsed;\n}\n\n/**\n * Emit `@unimplemented` parse-time warnings for every authored field that\n * has no runtime consumer yet (Slice 3.4 contract — see\n * `_unimplemented/unimplemented-field-warning.ts` JSDoc for the full\n * design rationale and the per-call dedupe semantics).\n *\n * The full surface and the matching deferred-backlog IDs are documented\n * once in `.cursor/context/cli-dx.md` (\"Schema fields with `@unimplemented`\n * runtime contract\"). When a deferred slice ships, the matching `if`\n * branch below MUST be removed in the same commit as the runtime wiring\n * — leaving a stale warning is worse than silence because authors will\n * start ignoring the channel.\n *\n * Surfaces today:\n *\n * - `version` (!== undefined) → `D-5`\n *\n * The `minions` / `workers` `@unimplemented` branches were REMOVED\n * 2026-05-05 with the close of D-1 once the runtime path landed\n * end-to-end (publisher → per-minion queue → minion consumer →\n * onTick handler / worker host with HTTP+JWT verifier + apps-manager\n * deploy orchestration). See the close-out note in\n * `.claude/plans/minions-and-workers-implementation.md` Phase 4. The\n * per-entry `resourceAccess` soft-warns below stay — those are\n * advisories about the authoring contract, not \"runtime missing\"\n * markers.\n *\n * Provider activation and product feature modeling no longer warn here:\n * `engineCapabilities` and `providers` are active runtime inputs, while\n * entitlement/product features live in the feature system.\n *\n * The `csp?` placeholder warning that previously lived here moved to\n * `engine/saas-technical-doc/src/config/define-tech-doc-config.ts`\n * along with the rest of `WildoTechnicalDocConfigSchema` (Step 7.5\n * refactor, saas-technical-doc.md). The `wildo.tech-doc.config.ts`\n * loader emits `[wildo-tech-doc-config] @unimplemented field 'csp'\n * authored — runtime support tracked under D-CSP` whenever a value\n * is authored.\n *\n * For `version` the test is `!== undefined` because the field is\n * `.optional()` (no default) — the warning fires iff the author wrote\n * `version: <n>` in their config. See the JSDoc on the schema field\n * above for the rationale.\n */\nfunction emitUnimplementedRuntimeWarnings(config: WildoSaasConfig): void {\n const warn = createUnimplementedFieldWarner(UnimplementedFieldSource.SAAS_CONFIG);\n\n if (config.version !== undefined) {\n warn('version', 'D-5');\n }\n\n // H-3 (`minions-and-workers-implementation.md` Phase 1): per-minion\n // soft-warns covering the KD-11 `resourceAccess` authoring posture.\n // These fire AFTER the `@unimplemented` block per the IC-1 emit-\n // ordering contract; the `emitSoftWarn` utility caps repeats\n // process-wide so the dev watcher's per-save re-parses do not spam.\n //\n // Three advisory shapes today (the per-resource membership check\n // against the parsed catalog runs in Phase 2 from\n // `start-minion-application` per IC-2 — Phase 1 only validates\n // STRUCTURAL shape):\n //\n // 1. `resourceAccess.missing` — entry omits the block entirely\n // (fail-closed default; advisory\n // so a forgotten whitelist is\n // visible without blocking dev).\n // 2. `resourceAccess.empty` — both `read` and `write` are\n // empty arrays (intent-equivalent\n // to omission, but flagged so the\n // author knows the minion will be\n // blocked at every repository call).\n // 3. `resourceAccess.read-only` / `resourceAccess.write-only` —\n // one side is empty; flagged so\n // asymmetric whitelists are not\n // accidental typos.\n for (const [minionKey, entry] of Object.entries(config.minions ?? {})) {\n const scope = `minions.${minionKey}`;\n if (!entry.resourceAccess) {\n emitSoftWarn(\n scope,\n 'resourceAccess.missing',\n 'no resourceAccess block authored — the v1 minion runtime will deny every repository call by default (KD-11 fail-closed). Author { read: [...], write: [...] } in wildo.saas.config.ts > minions to opt-in.',\n );\n continue;\n }\n const { read, write } = entry.resourceAccess;\n if (read.length === 0 && write.length === 0) {\n emitSoftWarn(\n scope,\n 'resourceAccess.empty',\n 'resourceAccess block is present but both `read` and `write` are empty arrays — equivalent to omitting the block. Author at least one resource name to grant access.',\n );\n } else if (read.length === 0) {\n emitSoftWarn(\n scope,\n 'resourceAccess.write-only',\n 'resourceAccess.read is empty while resourceAccess.write is non-empty — every write will succeed but no repository read will. If this is intentional (write-only sink) keep as-is; otherwise add the resources you intend to read.',\n );\n } else if (write.length === 0) {\n emitSoftWarn(\n scope,\n 'resourceAccess.read-only',\n 'resourceAccess.write is empty while resourceAccess.read is non-empty — the minion will only be able to read. If this is intentional (read-only scraper) keep as-is; otherwise add the resources you intend to write.',\n );\n }\n }\n\n // M1 (audit-logging Phase 1+2 hardening) — coherence advisory: an ENABLED\n // capability whose resolution mode is FAN_OUT (e.g. COMPLIANCE_AUDIT_TRAIL)\n // writes to EVERY declared provider, so with ZERO providers declaring it the\n // fan-out is a SILENT no-op — the exact compliance hole (an \"enabled\" audit\n // trail that reaches nothing) a config check should surface. The inverse (a\n // provider declaring a non-`enabled` capability) is already a HARD error in the\n // provider-scope refinement, so only this enabled-but-unserved direction needs\n // an advisory. Soft-warn (not fail-closed) so the enable-first-then-wire\n // authoring order isn't blocked.\n const capabilitiesDeclaredByAnyProvider = new Set<EngineCapability>();\n const allProviderScopes = [\n config.providers?.scopes.backend,\n config.providers?.scopes.companion,\n ...Object.values(config.providers?.scopes.frontendServices ?? {}),\n ...Object.values(config.providers?.scopes.minions ?? {}),\n ...Object.values(config.providers?.scopes.workers ?? {}),\n ];\n for (const scope of allProviderScopes) {\n if (!scope) continue;\n for (const providerSelection of Object.values(scope.providers)) {\n for (const capability of providerSelection.engineCapabilities) {\n capabilitiesDeclaredByAnyProvider.add(capability);\n }\n }\n }\n for (const [capabilityKey, activation] of Object.entries(config.engineCapabilities ?? {})) {\n if (activation?.enabled !== true) continue;\n const capability = capabilityKey as EngineCapability;\n if (getEngineCapabilityResolutionMode(capability) !== EngineCapabilityResolutionMode.FAN_OUT) continue;\n if (!capabilitiesDeclaredByAnyProvider.has(capability)) {\n emitSoftWarn(\n 'providers.engineCapabilities',\n `fanout-no-provider:${capability}`,\n `capability \"${capability}\" is enabled and FAN_OUT (every declared provider receives every emission), but NO provider in any scope declares it — its fan-out (e.g. the compliance audit trail) is a SILENT no-op. Declare at least one provider with engineCapabilities: ['${capability}'], or disable the capability.`,\n );\n }\n }\n}\n"]}
1
+ {"version":3,"file":"define-saas-config.js","sourceRoot":"","sources":["../../../../src/project-config/define-saas-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sCAAsC,EAAE,MAAM,sCAAsC,CAAC;AAC9F,OAAO,EAAE,yBAAyB,EAAE,MAAM,4CAA4C,CAAC;AACvF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,kCAAkC,EAAE,MAAM,4CAA4C,CAAC;AAChG,OAAO,EACL,eAAe,EACf,6BAA6B,EAC7B,uCAAuC,EACvC,uCAAuC,EACvC,2CAA2C,EAC3C,0CAA0C,EAC1C,kCAAkC,EAClC,gBAAgB,EAChB,8BAA8B,EAC9B,iCAAiC,GAOlC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,2BAA2B,EAC3B,yBAAyB,GAC1B,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAC9H,sDAAsD;AACtD,wEAAwE;AACxE,sEAAsE;AACtE,+DAA+D;AAC/D,OAAO,EACL,wBAAwB,EACxB,8BAA8B,GAC/B,MAAM,+CAA+C,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAuB,MAAM,qCAAqC,CAAC;AAChG,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,wBAAwB,EAAE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,KAAK,IAAI,iBAAiB,EAAE,CAAC;QACtC,IAAI,CAAC,KAAK;YAAE,SAAS;QACrB,KAAK,MAAM,iBAAiB,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE,CAAC;YAC/D,KAAK,MAAM,UAAU,IAAI,iBAAiB,CAAC,kBAAkB,EAAE,CAAC;gBAC9D,iCAAiC,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;YACpD,CAAC;QACH,CAAC;IACH,CAAC;IACD,KAAK,MAAM,CAAC,aAAa,EAAE,UAAU,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,kBAAkB,IAAI,EAAE,CAAC,EAAE,CAAC;QAC1F,IAAI,UAAU,EAAE,OAAO,KAAK,IAAI;YAAE,SAAS;QAC3C,MAAM,UAAU,GAAG,aAAiC,CAAC;QACrD,IAAI,iCAAiC,CAAC,UAAU,CAAC,KAAK,8BAA8B,CAAC,OAAO;YAAE,SAAS;QACvG,IAAI,CAAC,iCAAiC,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC;YACvD,YAAY,CACV,8BAA8B,EAC9B,sBAAsB,UAAU,EAAE,EAClC,eAAe,UAAU,oPAAoP,UAAU,gCAAgC,CACxT,CAAC;QACJ,CAAC;IACH,CAAC;AACH,CAAC","sourcesContent":["import { ExternalProvider_ExchangeProtocol_Kind } from '@wildo-ai/external-connectors-models';\nimport { MinionPlatformAccessScope } from './shared/minion-platform-access.vocabulary';\nimport { z } from 'zod';\nimport { findMinionResourceAccessViolations } from './shared/minion-resource-access.validation';\nimport {\n AppFrontendType,\n ApplicationAiUsePostureSchema,\n ApplicationClientStorageInventorySchema,\n ApplicationOperatingJurisdictionsSchema,\n ApplicationOperatorComplianceIdentitySchema,\n ApplicationProviderComplianceChoicesSchema,\n ApplicationRetentionScheduleSchema,\n EngineCapability,\n EngineCapabilityResolutionMode,\n getEngineCapabilityResolutionMode,\n type ApplicationAiUsePosture,\n type ApplicationClientStorageInventory,\n type ApplicationOperatingJurisdictions,\n type ApplicationOperatorComplianceIdentity,\n type ApplicationProviderComplianceChoices,\n type ApplicationRetentionSchedule,\n} from '@wildo-ai/saas-models';\nimport {\n BUILTIN_PROVIDER_CAPABILITY,\n BUILTIN_PROVIDER_PROTOCOL,\n} from '@wildo-ai/saas-models/public-runtime';\nimport { buildMinionServiceName, buildWorkerServiceName, normalizeServiceKeyToDnsName } from '@wildo-ai/platform-core-shared';\n// Phase 0 of the provider-registration refactor — see\n// `.cursor/plans/provider-registration-refactor-implementation-plan.md`\n// §Phase 0.13. Imports are `import type` so the schema-only authoring\n// in Phase 0 does not pull runtime code from the new packages.\nimport {\n UnimplementedFieldSource,\n createUnimplementedFieldWarner,\n} from '../_unimplemented/unimplemented-field-warning';\nimport { emitSoftWarn } from '../_unimplemented/soft-warn';\nimport { RegistryConfigSchema, type RegistryConfig } from '../registry/registry-config.schemas';\nimport { AppDataServicesSchema } from './shared/data-services.schemas';\nimport { ApplicationModulesSchema } from './shared/application-modules.schemas';\nimport { WildoSchemaVersionSchema } from './shared/schema-version.schemas';\nimport {\n AppLibraryDefinitionSchema,\n AppRefSchema,\n AppServiceDefinitionSchema,\n} from './shared/service-definitions.schemas';\n\n/**\n * Per-minion resource access whitelist (KD-11 in\n * `.cursor/plans/minions-and-workers-implementation.md`).\n *\n * Authored at the SaaS-config level (NOT inside `wildo.minion.config.ts`)\n * because the resource catalog is owned by the application's\n * `specifications` block — keeping the whitelist here ensures the\n * single authoring surface for \"what can each minion read / write?\"\n * lives next to \"what services exist in this app?\".\n *\n * Default semantics:\n * - Field omitted → minion gets NO repository access (fail-closed).\n * - `read: []` / `write: []` → explicit \"no access\" (same effect as omission,\n * but documents intent).\n * - `read: ['*']` → all readable resources (escape hatch — Phase 2's\n * `MinionScopedServicesRegistryHandlerBackendService` recognises the\n * wildcard sentinel).\n * - Resource names are validated cross-config in Phase 2 against the\n * parsed resource catalog (`start-minion-application` per IC-2);\n * Phase 1 only validates SHAPE, not membership.\n *\n * The bucket value is the existing `AppRefSchema` shape (strict,\n * `path` only) extended with the optional `resourceAccess` block —\n * extending `AppRefSchema.extend()` keeps the strict-key invariant\n * so an unknown key on a minion entry still parses to a clear error.\n */\nexport const MinionResourceAccessSchema = z.strictObject({\n read: z.array(z.string().min(1)).default([]),\n write: z.array(z.string().min(1)).default([]),\n}).superRefine((resourceAccess, ctx) => {\n // Enforced at PARSE time, not at grant-derivation time, and the difference is\n // the point: this is the declaration an author writes, so the error belongs\n // where they can see the line that caused it. By the time apps-manager derives\n // grants the config is long gone, and the failure would surface as a database\n // privilege nobody asked for.\n for (const violation of findMinionResourceAccessViolations(resourceAccess)) {\n ctx.addIssue({\n code: 'custom',\n path: [violation.axis],\n message: violation.message,\n });\n }\n});\nexport type MinionResourceAccess = z.infer<typeof MinionResourceAccessSchema>;\n\n/**\n * The authored PLATFORM-ACCESS declaration, as one named schema.\n *\n * Extracted from the inline literal it started as because the axis has to be\n * declared at every hop between `wildo.saas.config.ts` and the apps-manager\n * door — the managed declaration, its Zod schema, the bootstrap-config response,\n * the strict application-config object, and the engine's loader mirror. Six\n * hand-written copies of `{ scopes: z.array(...) }` is six chances for one of\n * them to disagree, and a hop that disagrees STRIPS the axis silently.\n *\n * Mirrors {@link MinionPlatformAccessDeclaration}, which is the type the\n * derivation (`buildOwnCronRecordFilter`) consumes.\n */\n/**\n * Reconciled 2026-08-18. Two parallel workstreams briefly declared this axis in\n * this file with different shapes — a flat capability array and this scoped\n * object — which is a duplicate `const`, a PARSE error, and took the whole file\n * (and `wildo config sync`) down. A third party then renamed one of them apart\n * to unblock the parse, which left the other's five call sites dangling.\n *\n * The scoped shape SURVIVED, by agreement with its author; the flat one and its\n * vocabulary are deleted. The name is back to the one those call sites already\n * use, so no consumer carries the scar of the collision.\n */\nexport const MinionPlatformAccessSchema = z.strictObject({\n scopes: z.array(z.enum(MinionPlatformAccessScope)).optional(),\n});\nexport type MinionPlatformAccess = z.infer<typeof MinionPlatformAccessSchema>;\n\n/**\n * The same axis as it TRAVELS, typed structurally.\n *\n * ## Why the carried type is not the authored one\n *\n * `MinionPlatformAccessSchema` infers `{ scopes?: MinionPlatformAccessScope[] }`,\n * and a TypeScript enum is a NOMINAL type. Every hop between the author and the\n * apps-manager door is re-declared in a package that would then have to NAME that\n * enum through a public specifier — and the engine's `AppConfiguration` cannot,\n * so `tsc` refuses the whole application-config schema:\n *\n * TS2742 The inferred type of 'Wildo_Application_ResolvedConfig_Schema'\n * cannot be named without a reference to '…/node_modules/@wildo-ai/saas-models/src'\n * TS7056 The inferred type of this node exceeds the maximum length the compiler will serialize\n *\n * Measured, not guessed: reverting only the engine-side field removes both\n * errors, and re-adding it structurally keeps them away. See\n * `.claude/rules/package-public-entrypoints.md` for the general mechanism.\n *\n * ## Why this loses nothing\n *\n * The vocabulary is enforced where enforcement belongs — at AUTHORING, by\n * `MinionPlatformAccessSchema` above, on the line the author wrote; and at the\n * DOOR, where apps-manager drops any scope this engine cannot name before it\n * mints an attestation. The hops in between are transport. Typing transported\n * data as the closed vocabulary would claim a guarantee the wire cannot give:\n * these values arrive from a stored declaration that some other engine revision\n * may have written.\n */\nexport const MinionPlatformAccessCarriedSchema = z.strictObject({\n scopes: z.array(z.string().min(1)).optional(),\n});\nexport type MinionPlatformAccessCarried = z.infer<typeof MinionPlatformAccessCarriedSchema>;\n\nconst MinionBucketEntrySchema = AppRefSchema.extend({\n resourceAccess: MinionResourceAccessSchema.optional(),\n /**\n * Whether this minion needs a route to the public internet (Step 5-egress).\n *\n * ## Why it is AUTHORED and defaults to false\n *\n * Network segmentation marks the backing-service networks `internal`, but\n * attachment to ANY non-internal network restores NAT — so \"may this runtime\n * reach the internet?\" is decided by one declaration and nowhere else. Marking\n * the data networks internal is necessary and not sufficient.\n *\n * It is NOT inferred from `resourceAccess`. A scraper legitimately reaches the\n * internet, and it is tempting to grant egress to any minion that touches data\n * — but declaring `read: ['todos']` is not a statement about the internet, and\n * conflating them would make egress universal for every data-touching minion,\n * which is precisely the \"everything can reach everything\" posture this removes.\n *\n * The point is not to refuse egress. It is to stop it being universal and\n * unstated, so a reviewer can see which minions leave the cluster and ask why.\n *\n * Default `false`, deliberately: the safe posture is the one an author gets by\n * not thinking about it. A minion that genuinely needs the internet says so in\n * one line, and that line is the thing a security review reads.\n */\n requiresInternetEgress: z.boolean().optional().default(false),\n /**\n * PLATFORM-level access — what this minion may see of the platform's record OF\n * ITSELF (R4 / R5). Today: its own cron/schedule entries.\n *\n * **Independent of `resourceAccess` by requirement, not by accident (R5).**\n * Neither implies the other, and nothing in the derivation of either consults\n * the other. A minion that works on todos and never inspects its schedule is a\n * normal shape; so is a health-reporting minion that reads its tick history and\n * touches no application data.\n *\n * The scope vocabulary has ONE member on purpose. There is no\n * `ALL_CRON_RECORDS`: a scope that could name another minion is a scope\n * somebody eventually grants, and R4 requires a cross-minion read to be\n * INEXPRESSIBLE rather than refused.\n */\n platformAccess: MinionPlatformAccessSchema.optional(),\n});\nexport type MinionBucketEntry = z.infer<typeof MinionBucketEntrySchema>;\n\nconst BootstrapFirstAdminSeedSchema = z.object({\n userTypes: z.array(z.string().min(1)).min(1),\n});\nexport type BootstrapFirstAdminSeed = z.infer<typeof BootstrapFirstAdminSeedSchema>;\n\nconst AppBootstrapSchema = z.object({\n firstAdmin: BootstrapFirstAdminSeedSchema.optional(),\n});\nexport type AppBootstrap = z.infer<typeof AppBootstrapSchema>;\ntype AppBootstrapInput = z.input<typeof AppBootstrapSchema>;\n\n/**\n * Per-runtime provider visibility authored at the application level.\n *\n * `defineSaaSProviders({ scopes })` is the canonical app-side provider\n * graph. Tooling materializes this declaration into runtime-specific\n * artifacts; runtime packages should consume those artifacts instead of\n * importing `wildo.saas.config.ts`.\n */\nexport const EngineCapabilityActivationSchema = z.strictObject({\n enabled: z.boolean(),\n required: z.boolean().optional(),\n});\nexport type EngineCapabilityActivation = z.infer<typeof EngineCapabilityActivationSchema>;\nexport type EngineCapabilityActivationInput = z.input<typeof EngineCapabilityActivationSchema>;\n\nexport const EngineCapabilityActivationsSchema = z.partialRecord(\n z.enum(EngineCapability),\n EngineCapabilityActivationSchema,\n).default({});\nexport type EngineCapabilityActivations = z.infer<typeof EngineCapabilityActivationsSchema>;\n\nexport const ProviderConfigurationsSchema = z.record(\n z.string().min(1),\n z.record(z.string().min(1), z.unknown()).optional(),\n).default(() => ({}));\nexport type ProviderConfigurations = z.infer<typeof ProviderConfigurationsSchema>;\nexport type ProviderConfigurationsInput = z.input<typeof ProviderConfigurationsSchema>;\n\nconst BUILTIN_PROVIDER_CAPABILITY_VALUES = new Set<string>(\n Object.values(BUILTIN_PROVIDER_CAPABILITY),\n);\nconst CUSTOM_PROVIDER_CAPABILITY_PATTERN = /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/;\n\nexport const ProviderCapabilitySelectorSchema = z.string().min(1).refine(\n (value) => BUILTIN_PROVIDER_CAPABILITY_VALUES.has(value) || CUSTOM_PROVIDER_CAPABILITY_PATTERN.test(value),\n {\n message:\n 'Provider capabilities must be a built-in ProviderCapability or app custom kebab-case capability.',\n },\n);\n\nconst KNOWN_PROVIDER_PROTOCOLS = new Set<string>([\n ...(Object.values(ExternalProvider_ExchangeProtocol_Kind) as string[]),\n ...(Object.values(BUILTIN_PROVIDER_PROTOCOL) as string[]),\n]);\n\nexport const ProviderProtocolSelectorSchema = z.string().min(1).refine(\n (value) => KNOWN_PROVIDER_PROTOCOLS.has(value),\n { message: 'protocols must use known external protocol literals.' },\n);\n\nexport const SaasProviderScopeSelectionSchema = z.strictObject({\n engineCapabilities: z.array(z.enum(EngineCapability)).default([]),\n providerCapabilities: z.array(ProviderCapabilitySelectorSchema).default([]),\n protocols: z.array(ProviderProtocolSelectorSchema).default([]),\n});\nexport type SaasProviderScopeSelection = z.infer<typeof SaasProviderScopeSelectionSchema>;\n\nexport const SaasProviderSelectionPolicySchema = z.strictObject({\n primary: z.string().min(1),\n fallbacks: z.array(z.string().min(1)).default([]),\n});\nexport type SaasProviderSelectionPolicy = z.infer<typeof SaasProviderSelectionPolicySchema>;\n\nconst SaasProviderRuntimeScopeSchema = z.strictObject({\n providers: z.record(z.string().min(1), SaasProviderScopeSelectionSchema).default({}),\n selection: z.partialRecord(\n z.enum(EngineCapability),\n SaasProviderSelectionPolicySchema,\n ).optional(),\n}).superRefine((scope, ctx) => {\n const providerRefs = new Set(Object.keys(scope.providers));\n for (const [capability, policy] of Object.entries(scope.selection ?? {})) {\n for (const providerRef of [policy.primary, ...(policy.fallbacks ?? [])]) {\n if (!providerRefs.has(providerRef)) {\n ctx.addIssue({\n code: 'custom',\n path: ['selection', capability],\n message: `Provider selection for ${capability} references \"${providerRef}\" but it is not declared in this scope.`,\n });\n }\n }\n }\n});\nexport type SaasProviderRuntimeScope = z.infer<typeof SaasProviderRuntimeScopeSchema>;\n\nexport const SaasProvidersScopesSchema = z.strictObject({\n backend: SaasProviderRuntimeScopeSchema.optional(),\n companion: SaasProviderRuntimeScopeSchema.optional(),\n frontendServices: z.record(z.string().min(1), SaasProviderRuntimeScopeSchema).optional(),\n minions: z.record(z.string().min(1), SaasProviderRuntimeScopeSchema).optional(),\n workers: z.record(z.string().min(1), SaasProviderRuntimeScopeSchema).optional(),\n});\nexport type SaasProvidersScopes = z.infer<typeof SaasProvidersScopesSchema>;\n\nexport const SaasConfigProvidersBlockSchema = z.strictObject({\n scopes: SaasProvidersScopesSchema,\n}).default(() => ({ scopes: {} }));\nexport type SaasConfigProvidersBlock = z.infer<typeof SaasConfigProvidersBlockSchema>;\nexport type SaasConfigProvidersBlockInput = z.input<typeof SaasConfigProvidersBlockSchema>;\n\nexport interface SaasProviderCatalogEntry {\n engineCapabilities?: readonly string[];\n providerCapabilities?: readonly string[];\n protocols?: readonly string[];\n}\n\nexport type SaasProviderCatalog = Record<string, SaasProviderCatalogEntry>;\n\ntype CatalogFieldValue<\n TCatalog extends SaasProviderCatalog,\n TRef extends keyof TCatalog & string,\n TField extends keyof SaasProviderCatalogEntry,\n> = TCatalog[TRef][TField] extends readonly (infer TValue)[]\n ? Extract<TValue, string>\n : never;\n\nexport interface SaasProviderSelectionPolicyInput<TProviderRef extends string = string> {\n primary: TProviderRef;\n fallbacks?: TProviderRef[];\n}\n\nexport type SaasProviderScopeSelectionInputFromCatalog<\n TCatalog extends SaasProviderCatalog,\n TRef extends keyof TCatalog & string,\n> = {\n engineCapabilities?: Array<CatalogFieldValue<TCatalog, TRef, 'engineCapabilities'>>;\n providerCapabilities?: Array<CatalogFieldValue<TCatalog, TRef, 'providerCapabilities'>>;\n protocols?: Array<CatalogFieldValue<TCatalog, TRef, 'protocols'>>;\n};\n\nexport type SaasProviderRuntimeScopeInputFromCatalog<TCatalog extends SaasProviderCatalog> = {\n providers?: Partial<{\n [TRef in keyof TCatalog & string]: SaasProviderScopeSelectionInputFromCatalog<TCatalog, TRef>;\n }>;\n selection?: Partial<Record<\n EngineCapability,\n SaasProviderSelectionPolicyInput<keyof TCatalog & string>\n >>;\n};\n\nexport type SaasConfigProvidersBlockInputFromCatalog<TCatalog extends SaasProviderCatalog> = {\n scopes: {\n backend?: SaasProviderRuntimeScopeInputFromCatalog<TCatalog>;\n companion?: SaasProviderRuntimeScopeInputFromCatalog<TCatalog>;\n frontendServices?: Record<string, SaasProviderRuntimeScopeInputFromCatalog<TCatalog>>;\n minions?: Record<string, SaasProviderRuntimeScopeInputFromCatalog<TCatalog>>;\n workers?: Record<string, SaasProviderRuntimeScopeInputFromCatalog<TCatalog>>;\n };\n};\n\nexport function defineSaaSProviders(\n providers: z.input<typeof SaasConfigProvidersBlockSchema>,\n): SaasConfigProvidersBlock;\nexport function defineSaaSProviders<TCatalog extends SaasProviderCatalog>(\n providers: SaasConfigProvidersBlockInputFromCatalog<TCatalog>,\n): SaasConfigProvidersBlock;\nexport function defineSaaSProviders(\n providers: z.input<typeof SaasConfigProvidersBlockSchema>,\n): SaasConfigProvidersBlock {\n return SaasConfigProvidersBlockSchema.parse(providers);\n}\n\nexport interface WildoSaasConfig {\n version?: z.infer<typeof WildoSchemaVersionSchema>;\n name: string;\n slug: string;\n displayName: string;\n description?: string;\n type: 'saas';\n services: Record<string, z.infer<typeof AppServiceDefinitionSchema>>;\n modules: z.infer<typeof ApplicationModulesSchema>;\n libraries?: Record<string, z.infer<typeof AppLibraryDefinitionSchema>>;\n specifications?: z.infer<typeof AppRefSchema>;\n minions?: Record<string, MinionBucketEntry>;\n workers?: Record<string, z.infer<typeof AppRefSchema>>;\n engineCapabilities: EngineCapabilityActivations;\n providerConfigurations: ProviderConfigurations;\n providers: SaasConfigProvidersBlock;\n bootstrap?: AppBootstrap;\n dataServices: z.infer<typeof AppDataServicesSchema>;\n /** See `WildoSaasConfigSchema.dataRetention`. Optional and partial: an undeclared class is undecided, never \"forever\". */\n dataRetention?: ApplicationRetentionSchedule;\n /** See `WildoSaasConfigSchema.aiUsePosture`. An enabled AI capability with no entry is reported, never assumed harmless. */\n aiUsePosture?: ApplicationAiUsePosture;\n /** See `WildoSaasConfigSchema.clientStorage`. Keyed by frontend surface; an absent surface is uninventoried, an empty array is \"sets nothing\". */\n clientStorage?: ApplicationClientStorageInventory;\n /**\n * WHO operates this service, in what legal role, on what lawful basis (issue #131).\n *\n * The answers a compliance document needs in its opening sections. Absent, a produced privacy\n * notice cannot name who is publishing it — and because a landing REPLACES the document, an\n * operator who answered by editing it lost the answer on the next regeneration.\n */\n /**\n * WHERE this application operates (issue #229).\n *\n * A SIBLING of `operatorComplianceIdentity`, not a field inside it: where you sell is known long\n * before why you may process, and nesting it would make a jurisdiction unrecordable until the\n * lawful bases were settled.\n *\n * Absent means nobody has answered — never \"nowhere\". A declared jurisdiction that no registered\n * assurance source reaches is reported as a known unknown rather than passed over.\n */\n operatingJurisdictions?: ApplicationOperatingJurisdictions;\n operatorComplianceIdentity?: ApplicationOperatorComplianceIdentity;\n /**\n * Per configured provider, who runs it and where it processes (issue #130).\n *\n * The provider declares what is POSSIBLE; this is the operator's CHOICE among those. A vendor-hosted\n * provider is a third-party recipient a notice must enumerate; a self-hosted one is not a recipient\n * at all, and without this axis a produced notice would call an audit ledger you run yourself a\n * third party.\n */\n providerComplianceChoices?: ApplicationProviderComplianceChoices;\n moduleRegistries?: RegistryConfig;\n}\n\nexport interface WildoSaasConfigInput {\n version?: z.input<typeof WildoSchemaVersionSchema>;\n name: string;\n slug: string;\n displayName: string;\n description?: string;\n type: 'saas';\n services: Record<string, z.input<typeof AppServiceDefinitionSchema>>;\n /**\n * OPTIONAL, matching `ApplicationModulesSchema`, which is `.optional()`. Declared as required\n * here it contradicted its own schema: a config that legitimately omits `modules` parses fine\n * at runtime and was rejected by the type.\n */\n modules?: z.input<typeof ApplicationModulesSchema>;\n libraries?: Record<string, z.input<typeof AppLibraryDefinitionSchema>>;\n specifications?: z.input<typeof AppRefSchema>;\n minions?: Record<string, z.input<typeof MinionBucketEntrySchema>>;\n workers?: Record<string, z.input<typeof AppRefSchema>>;\n engineCapabilities?: z.input<typeof EngineCapabilityActivationsSchema>;\n providerConfigurations?: z.input<typeof ProviderConfigurationsSchema>;\n providers?: z.input<typeof SaasConfigProvidersBlockSchema>;\n bootstrap?: AppBootstrapInput;\n dataServices: z.input<typeof AppDataServicesSchema>;\n /** See `WildoSaasConfigSchema.dataRetention`. */\n dataRetention?: z.input<typeof ApplicationRetentionScheduleSchema>;\n /** See `WildoSaasConfigSchema.aiUsePosture`. */\n aiUsePosture?: z.input<typeof ApplicationAiUsePostureSchema>;\n /** See `WildoSaasConfigSchema.clientStorage`. */\n clientStorage?: z.input<typeof ApplicationClientStorageInventorySchema>;\n operatingJurisdictions?: z.input<typeof ApplicationOperatingJurisdictionsSchema>;\n operatorComplianceIdentity?: z.input<typeof ApplicationOperatorComplianceIdentitySchema>;\n providerComplianceChoices?: z.input<typeof ApplicationProviderComplianceChoicesSchema>;\n moduleRegistries?: z.input<typeof RegistryConfigSchema>;\n}\n\n/**\n * @wildo_source:part:start platform.config.saas facet:layer:platform facet:family:bootstrap\n *\n * Root `wildo.saas.config.ts` application declaration: services, modules,\n * engine capabilities, provider scopes, provider configurations and data\n * services. Import `defineSaasConfig` from `@wildo-ai/platform-config-lib` and\n * keep cross-service choices here rather than scattering them through runtime\n * source files.\n */\n/**\n * The root schema is `z.strictObject` (not `z.object`) so that authoring an\n * unknown top-level key surfaces as a\n * Zod parse error at `defineSaasConfig` time instead of being silently\n * dropped. A typoed `dataServises:` block (or a removed-then-re-introduced\n * `secretsSharingPolicy`) would otherwise compile cleanly, parse cleanly,\n * and produce no runtime warning — exactly the failure mode the\n * `@unimplemented` machinery exists to prevent. The fail-closed posture\n * trades a slightly louder authoring boundary for a guarantee that every\n * authored top-level concern is either consumed or explicitly rejected.\n */\nexport const WildoSaasConfigSchema = z.strictObject({\n /**\n * Authored schema-format version for this `wildo.saas.config.ts`,\n * expressed as a **SemVer 2.0.0 string** (e.g. `'1.0.0'`,\n * `'2.3.1-rc.1'`, `'1.0.0+build.42'`).\n *\n * SemVer (not a bare integer) keeps MAJOR-vs-MINOR-vs-PATCH meaning explicit\n * for future configuration evolution — bare integers conflate \"breaking\", \"feature\n * add\" and \"bug-fix\" into a single dimension and force every bump to\n * look like a breaking change.\n *\n * The field is intentionally optional (no Zod default) so unauthored\n * configurations stay silent. Version-based migration enforcement is not\n * available yet; an authored value records intent but does not itself perform\n * a migration or authorize an incompatible configuration.\n */\n version: WildoSchemaVersionSchema.optional(),\n name: z.string().min(1),\n slug: z.string().min(1).regex(/^[a-z0-9-]+$/, 'slug must be lowercase alphanumeric with hyphens'),\n displayName: z.string().min(1),\n description: z.string().optional(),\n type: z.literal('saas'),\n\n services: z.record(z.string(), AppServiceDefinitionSchema),\n modules: ApplicationModulesSchema,\n libraries: z.record(z.string(), AppLibraryDefinitionSchema).optional(),\n specifications: AppRefSchema.optional(),\n /**\n * Long-running \"minion\" actor hosts (scheduled or always-up).\n *\n * Each entry can declare a `resourceAccess` read/write whitelist. The\n * current configuration parser accepts the declaration, but a minion runtime\n * does not consume or enforce it yet. Do not rely on this field as an access\n * control until the installed runtime exposes that capability.\n */\n minions: z.record(z.string(), MinionBucketEntrySchema).optional(),\n /**\n * HTTP-only \"worker\" subprocesses (compute-heavy, often Rust/Go).\n *\n * The current configuration parser accepts these declarations, but a worker\n * runtime is not available yet. Workers have no `resourceAccess` field\n * because they do not receive database access by default; a resource\n * whitelist would therefore be misleading.\n */\n workers: z.record(z.string(), AppRefSchema).optional(),\n\n engineCapabilities: EngineCapabilityActivationsSchema,\n providerConfigurations: ProviderConfigurationsSchema,\n\n /**\n * Per-facet provider registries.\n *\n * Authored as a `z.custom` because the value is a constructed object\n * (registry instances carry methods like `getProviderByRef`); strict\n * runtime parsing of method-bearing values is intentionally skipped\n * — the application/provider composition boundary enforces the registry\n * invariants.\n *\n * See the `SaasConfigProvidersBlock` JSDoc above for the role of each\n * registry facet.\n */\n providers: SaasConfigProvidersBlockSchema,\n\n bootstrap: AppBootstrapSchema.optional(),\n dataServices: AppDataServicesSchema,\n\n /**\n * How long this application keeps each class of data, and why.\n *\n * Declared HERE, beside `dataServices`, because the two describe the same thing from opposite ends:\n * `dataServices` says which stores exist, and this says how long what is in them is kept. Both are\n * application-wide operator decisions rather than per-resource authoring.\n *\n * Optional as a whole, and partial within itself. An application that has decided nothing omits it;\n * one that has decided only its customer-data period declares only that. Absence is never read as\n * \"kept forever\" — a compliance document states the classes that ARE declared and marks the rest as\n * needing an operator decision, which is what lets the document be produced today rather than\n * waiting on a number nobody has yet.\n *\n * Two consumers, and the second is why the classes are the STORES: a privacy notice's retention\n * paragraph (issue #89, which is why this exists), and the backup-and-restore inventory a remote\n * environment still has none of (issue #8) — one declaration answers both instead of two that drift.\n */\n dataRetention: ApplicationRetentionScheduleSchema.optional(),\n\n /**\n * Whether each AI capability this application enables DECIDES something about a person, and who\n * reviews it if so.\n *\n * A capability establishes that AI is in use and for what function; it cannot establish consequence,\n * because the same `AI_LLM` backs a summariser that decides nothing and a screener that decides a\n * great deal (issue #92).\n *\n * Optional and partial, like `dataRetention` — but the silence here is the more dangerous one. A\n * notice describing AI use without addressing consequence does not read as \"unknown\", it reads as\n * \"nothing significant happens\", which silently claims an exemption. So an enabled AI capability with\n * no entry is REPORTED as outstanding rather than assumed harmless.\n */\n aiUsePosture: ApplicationAiUsePostureSchema.optional(),\n\n /**\n * What this application stores in a visitor's browser, per FRONTEND SURFACE — the itemised table a\n * cookie notice IS (issue #91).\n *\n * Per surface because a public marketing site and the authenticated application set different things,\n * and one merged list would be wrong for both. The FRAMEWORK's own cookies are not declared here:\n * every application inherits them and none authored them, so they are answered by\n * `ENGINE_CLIENT_STORAGE_ENTRIES` and reported separately.\n *\n * Optional and partial. A surface with no entry has not been inventoried and is reported as such; an\n * empty ARRAY is the different, positive answer — this surface sets nothing of its own.\n */\n clientStorage: ApplicationClientStorageInventorySchema.optional(),\n operatingJurisdictions: ApplicationOperatingJurisdictionsSchema.optional(),\n operatorComplianceIdentity: ApplicationOperatorComplianceIdentitySchema.optional(),\n providerComplianceChoices: ApplicationProviderComplianceChoicesSchema.optional(),\n\n /**\n * Module registries the app pulls modules from. Each entry pairs a\n * stable id (used by lockfile entries + the `--registry <id>` CLI\n * flag) with a registry HTTP origin. Optional — when omitted, CLI\n * commands fall back to alias resolution (`local` / `public`) or\n * the env-policy default (`WILDO_FRAMEWORK_DEVELOPER` → local;\n * else public).\n *\n * Example: `[{ id: 'wildo', url: 'https://registry.wildo.ai' }]`\n *\n * Credentials never live here — they live per-machine under\n * the local Wildo credential store. This config only points at endpoints.\n */\n moduleRegistries: RegistryConfigSchema.optional(),\n\n // Technical-documentation and marketing-website configuration belong in\n // their respective service folders as\n // `wildo.tech-doc.config.ts` and `wildo.website.config.ts`,\n // co-located with the public packages that own their semantics\n // (`@wildo-ai/saas-technical-doc` and `@wildo-ai/saas-website`). The\n // schemas, types, `defineXxxConfig` helpers, and (for website) the\n // jiti-backed loader now live entirely in those packages.\n // The dev companion / Astro build discover and load each per-service\n // file via the unique service of the matching `frontendType`. The\n // single-frontend-per-kind constraint enforced by the `superRefine`\n // below guarantees that \"the TECH_DOC service folder\" and \"the\n // STATIC_WEBSITE service folder\" are unambiguous.\n}).superRefine((config, ctx) => {\n const availableServiceKeys = new Set(Object.keys(config.services));\n const frontendServiceKeys = new Set(\n Object.entries(config.services)\n .filter(([, definition]) => definition.frontendType !== undefined)\n .map(([serviceKey]) => serviceKey),\n );\n\n for (const [moduleId, moduleBinding] of Object.entries(config.modules ?? {})) {\n for (const serviceKey of moduleBinding.services) {\n if (availableServiceKeys.has(serviceKey)) {\n continue;\n }\n\n ctx.addIssue({\n code: 'custom',\n path: ['modules', moduleId, 'services'],\n message: `Module \"${moduleId}\" references unknown service \"${serviceKey}\".`,\n });\n }\n }\n\n // Minion/worker bucket keys are RFC1123-normalized (via `buildMinionServiceName`\n // / `buildWorkerServiceName`) into the k8s object / built image / compose service\n // / worker dispatch-host DNS name at deploy time. camelCase keys are ACCEPTED and\n // normalized — matching the `services.<key>` convention and the existing\n // `WILDO_WORKER_<NAME>_URL` env-key normalization — but two keys that COLLAPSE to\n // the same DNS name would silently deploy as ONE Service/image, and a key that\n // normalizes to EMPTY (all-symbol) would emit an invalid trailing-hyphen name.\n // Fail fast at authoring on either, independently per background-runtime map.\n // The full generated deploy name is `{slug}-{minion|worker}-{dnsName}`. It is\n // used as the k8s Service `metadata.name` AND the `app.kubernetes.io/name` label\n // value — both bounded by the RFC1123 label limit of 63 chars. A longer name is\n // rejected by kubectl at deploy time (and by Docker for the image tag), so fail\n // fast at authoring rather than let CI/deploy blow up. Truncating instead would\n // be a silent \"trick\" that risks a collision with a sibling key — rejected.\n const K8S_LABEL_MAX_LENGTH = 63;\n for (const [mapLabel, bucket, buildServiceName] of [\n ['minions', config.minions, buildMinionServiceName],\n ['workers', config.workers, buildWorkerServiceName],\n ] as const) {\n if (!bucket) continue;\n const dnsNameToKey = new Map<string, string>();\n for (const bucketKey of Object.keys(bucket)) {\n const dnsName = normalizeServiceKeyToDnsName(bucketKey);\n if (dnsName.length === 0) {\n ctx.addIssue({\n code: 'custom',\n path: [mapLabel, bucketKey],\n message:\n `${mapLabel} key \"${bucketKey}\" normalizes to an empty DNS name — it must contain at least ` +\n `one [a-z0-9] character so the deployed k8s Service / image name is valid (e.g. \"market-scraper\").`,\n });\n continue;\n }\n const serviceName = buildServiceName(config.slug, bucketKey);\n if (serviceName.length > K8S_LABEL_MAX_LENGTH) {\n ctx.addIssue({\n code: 'custom',\n path: [mapLabel, bucketKey],\n message:\n `${mapLabel} key \"${bucketKey}\" generates the deploy name \"${serviceName}\" ` +\n `(${serviceName.length} chars), exceeding the ${K8S_LABEL_MAX_LENGTH}-char RFC1123 limit for a ` +\n `k8s Service / label name. Shorten the ${mapLabel.slice(0, -1)} key or the app slug (\"${config.slug}\").`,\n });\n }\n const existing = dnsNameToKey.get(dnsName);\n if (existing !== undefined) {\n ctx.addIssue({\n code: 'custom',\n path: [mapLabel, bucketKey],\n message:\n `${mapLabel} keys \"${existing}\" and \"${bucketKey}\" both normalize to the DNS name \"${dnsName}\" — ` +\n `they would deploy as the SAME k8s Service / image / compose service. Rename one so the normalized names differ.`,\n });\n continue;\n }\n dnsNameToKey.set(dnsName, bucketKey);\n }\n }\n\n const scopeBuckets: Record<string, ReadonlySet<string>> = {\n services: availableServiceKeys,\n minions: new Set(Object.keys(config.minions ?? {})),\n workers: new Set(Object.keys(config.workers ?? {})),\n };\n\n const validateProviderScope = (\n scopePath: Array<string | number>,\n scope: SaasProviderRuntimeScope | undefined,\n ): void => {\n if (!scope) return;\n\n for (const [providerRef, selection] of Object.entries(scope.providers)) {\n for (const capability of selection.engineCapabilities) {\n if (config.engineCapabilities?.[capability]?.enabled !== true) {\n ctx.addIssue({\n code: 'custom',\n path: [...scopePath, 'providers', providerRef, 'engineCapabilities'],\n message:\n `Provider \"${providerRef}\" selects disabled or unauthored engine capability \"${capability}\".`,\n });\n }\n }\n }\n\n for (const [capability, policy] of Object.entries(scope.selection ?? {})) {\n // A FAN_OUT capability (e.g. COMPLIANCE_AUDIT_TRAIL) writes to EVERY declared\n // provider — a `selection` (primary + failover) is meaningless for it. Reject\n // it; declaring the providers is enough (all are active).\n if (\n getEngineCapabilityResolutionMode(capability as EngineCapability)\n === EngineCapabilityResolutionMode.FAN_OUT\n ) {\n ctx.addIssue({\n code: 'custom',\n path: [...scopePath, 'selection', capability],\n message:\n `\"${capability}\" is a FAN_OUT capability — every declared provider is active (no primary/failover). Remove its \\`selection\\` entry; declaring the providers is enough.`,\n });\n continue;\n }\n for (const providerRef of [policy.primary, ...(policy.fallbacks ?? [])]) {\n const providerSelection = scope.providers[providerRef];\n if (providerSelection && !providerSelection.engineCapabilities.includes(capability as EngineCapability)) {\n ctx.addIssue({\n code: 'custom',\n path: [...scopePath, 'selection', capability],\n message:\n `Provider selection for \"${capability}\" references provider \"${providerRef}\" that does not declare engineCapabilities including ${capability}.`,\n });\n }\n }\n }\n };\n\n validateProviderScope(['providers', 'scopes', 'backend'], config.providers?.scopes.backend);\n validateProviderScope(['providers', 'scopes', 'companion'], config.providers?.scopes.companion);\n\n for (const [serviceKey, scope] of Object.entries(config.providers?.scopes.frontendServices ?? {})) {\n if (!availableServiceKeys.has(serviceKey)) {\n ctx.addIssue({\n code: 'custom',\n path: ['providers', 'scopes', 'frontendServices', serviceKey],\n message: `Provider scope references unknown frontend service \"${serviceKey}\".`,\n });\n } else if (!frontendServiceKeys.has(serviceKey)) {\n ctx.addIssue({\n code: 'custom',\n path: ['providers', 'scopes', 'frontendServices', serviceKey],\n message:\n `Provider scope references non-frontend service \"${serviceKey}\". ` +\n 'Only services with a frontendType may appear under providers.scopes.frontendServices.',\n });\n }\n validateProviderScope(['providers', 'scopes', 'frontendServices', serviceKey], scope);\n }\n\n for (const [minionKey, scope] of Object.entries(config.providers?.scopes.minions ?? {})) {\n if (!scopeBuckets.minions.has(minionKey)) {\n ctx.addIssue({\n code: 'custom',\n path: ['providers', 'scopes', 'minions', minionKey],\n message: `Provider scope references unknown minion \"${minionKey}\".`,\n });\n }\n validateProviderScope(['providers', 'scopes', 'minions', minionKey], scope);\n }\n\n for (const [workerKey, scope] of Object.entries(config.providers?.scopes.workers ?? {})) {\n if (!scopeBuckets.workers.has(workerKey)) {\n ctx.addIssue({\n code: 'custom',\n path: ['providers', 'scopes', 'workers', workerKey],\n message: `Provider scope references unknown worker \"${workerKey}\".`,\n });\n }\n validateProviderScope(['providers', 'scopes', 'workers', workerKey], scope);\n }\n\n // At most one service may use each \"single-instance\" frontend kind.\n //\n // `TECH_DOC` and `STATIC_WEBSITE` are framework-managed singletons:\n // a SaaS app has at most one technical-documentation site and at\n // most one marketing/landing site. The per-service config files\n // (`wildo.tech-doc.config.ts` for `TECH_DOC`, `wildo.website.config.ts`\n // for `STATIC_WEBSITE`) are discovered by the companion / Astro\n // build through the unique service of the matching `frontendType`.\n // If the schema allowed two `TECH_DOC` services, the companion\n // would have no deterministic way to project the OpenAPI YAMLs to\n // \"the\" docs root — every consumer would need a \"which docs\n // service?\" indirection for no real-world payoff (multi-doc-site\n // / multi-marketing-site SaaS apps are not a use case we have\n // ever needed to support).\n //\n // The constraint is enforced at parse time so the failure surfaces\n // at `defineSaasConfig` (CLI parse, dev watcher reload) rather than\n // at first companion-driven OpenAPI publish — the latter would be\n // a confusing \"your second docs service was silently picked over\n // the first\" type of failure.\n //\n // `SAAS_APP` is intentionally NOT constrained here: a single repo\n // can ship multiple SaaS-app frontends (e.g. a customer surface and\n // an internal admin), each owning its own session, and the\n // cross-frontend handoff already handles that fan-out via\n // `runtime.endPoints[*].publicUrl`. The session-owning role does not\n // create a unique-receiver assumption the way the docs / website\n // frontends do.\n const singletonFrontends: ReadonlyArray<AppFrontendType> = [\n AppFrontendType.TECH_DOC,\n AppFrontendType.STATIC_WEBSITE,\n ];\n for (const kind of singletonFrontends) {\n const matchingServiceKeys = Object.entries(config.services)\n .filter(([, def]) => def.frontendType === kind)\n .map(([key]) => key);\n if (matchingServiceKeys.length > 1) {\n for (const offendingKey of matchingServiceKeys) {\n ctx.addIssue({\n code: 'custom',\n path: ['services', offendingKey, 'frontendType'],\n message:\n `frontendType='${kind}' may be declared on at most one service ` +\n `per SaaS app (found ${matchingServiceKeys.length}: ${matchingServiceKeys.join(', ')}). ` +\n `${kind} is a framework-managed singleton — the companion / build ` +\n `pipeline addresses it as \"the ${kind} service\" with no disambiguator. ` +\n `Collapse the duplicates into a single service or split them into separate apps.`,\n });\n }\n }\n }\n}) as unknown as z.ZodType<WildoSaasConfig, WildoSaasConfigInput>;\n/** @wildo_source:part:end platform.config.saas */\n\n/**\n * Define a SaaS application configuration.\n * Provides full IDE autocompletion for engine capabilities, provider scopes,\n * services, modules, and data services.\n *\n * @example\n * ```ts\n * import { defineSaasConfig } from '@wildo-ai/platform-config-lib';\n * import { EngineCapability } from '@wildo-ai/saas-models';\n *\n * export default defineSaasConfig({\n * name: 'wonder-todos',\n * slug: 'wonder-todos',\n * displayName: 'Wonder Todos',\n * type: 'saas',\n * engineCapabilities: {\n * [EngineCapability.EMAIL_TRANSACTIONAL]: { enabled: true },\n * [EngineCapability.SMS]: { enabled: false },\n * [EngineCapability.AI_LLM]: { enabled: true },\n * },\n * providerConfigurations: {},\n * providers: defineSaaSProviders({\n * scopes: {\n * backend: {\n * providers: {\n * resend: {\n * engineCapabilities: [EngineCapability.EMAIL_TRANSACTIONAL],\n * providerCapabilities: ['EMAIL_TRANSACTIONAL'],\n * protocols: ['EMAIL_PROVIDER'],\n * },\n * },\n * },\n * },\n * }),\n * // ...\n * });\n * ```\n */\nexport function defineSaasConfig(config: WildoSaasConfigInput): WildoSaasConfig {\n const parsed = WildoSaasConfigSchema.parse(config);\n emitUnimplementedRuntimeWarnings(parsed);\n return parsed;\n}\n\n/**\n * Emit `@unimplemented` parse-time warnings for every authored field that\n * has no runtime consumer yet (Slice 3.4 contract — see\n * `_unimplemented/unimplemented-field-warning.ts` JSDoc for the full\n * design rationale and the per-call dedupe semantics).\n *\n * The full surface and the matching deferred-backlog IDs are documented\n * once in `.cursor/context/cli-dx.md` (\"Schema fields with `@unimplemented`\n * runtime contract\"). When a deferred slice ships, the matching `if`\n * branch below MUST be removed in the same commit as the runtime wiring\n * — leaving a stale warning is worse than silence because authors will\n * start ignoring the channel.\n *\n * Surfaces today:\n *\n * - `version` (!== undefined) → `D-5`\n *\n * The `minions` / `workers` `@unimplemented` branches were REMOVED\n * 2026-05-05 with the close of D-1 once the runtime path landed\n * end-to-end (publisher → per-minion queue → minion consumer →\n * onTick handler / worker host with HTTP+JWT verifier + apps-manager\n * deploy orchestration). See the close-out note in\n * `.claude/plans/minions-and-workers-implementation.md` Phase 4. The\n * per-entry `resourceAccess` soft-warns below stay — those are\n * advisories about the authoring contract, not \"runtime missing\"\n * markers.\n *\n * Provider activation and product feature modeling no longer warn here:\n * `engineCapabilities` and `providers` are active runtime inputs, while\n * entitlement/product features live in the feature system.\n *\n * The `csp?` placeholder warning that previously lived here moved to\n * `engine/saas-technical-doc/src/config/define-tech-doc-config.ts`\n * along with the rest of `WildoTechnicalDocConfigSchema` (Step 7.5\n * refactor, saas-technical-doc.md). The `wildo.tech-doc.config.ts`\n * loader emits `[wildo-tech-doc-config] @unimplemented field 'csp'\n * authored — runtime support tracked under D-CSP` whenever a value\n * is authored.\n *\n * For `version` the test is `!== undefined` because the field is\n * `.optional()` (no default) — the warning fires iff the author wrote\n * `version: <n>` in their config. See the JSDoc on the schema field\n * above for the rationale.\n */\nfunction emitUnimplementedRuntimeWarnings(config: WildoSaasConfig): void {\n const warn = createUnimplementedFieldWarner(UnimplementedFieldSource.SAAS_CONFIG);\n\n if (config.version !== undefined) {\n warn('version', 'D-5');\n }\n\n // H-3 (`minions-and-workers-implementation.md` Phase 1): per-minion\n // soft-warns covering the KD-11 `resourceAccess` authoring posture.\n // These fire AFTER the `@unimplemented` block per the IC-1 emit-\n // ordering contract; the `emitSoftWarn` utility caps repeats\n // process-wide so the dev watcher's per-save re-parses do not spam.\n //\n // Three advisory shapes today (the per-resource membership check\n // against the parsed catalog runs in Phase 2 from\n // `start-minion-application` per IC-2 — Phase 1 only validates\n // STRUCTURAL shape):\n //\n // 1. `resourceAccess.missing` — entry omits the block entirely\n // (fail-closed default; advisory\n // so a forgotten whitelist is\n // visible without blocking dev).\n // 2. `resourceAccess.empty` — both `read` and `write` are\n // empty arrays (intent-equivalent\n // to omission, but flagged so the\n // author knows the minion will be\n // blocked at every repository call).\n // 3. `resourceAccess.read-only` / `resourceAccess.write-only` —\n // one side is empty; flagged so\n // asymmetric whitelists are not\n // accidental typos.\n for (const [minionKey, entry] of Object.entries(config.minions ?? {})) {\n const scope = `minions.${minionKey}`;\n if (!entry.resourceAccess) {\n emitSoftWarn(\n scope,\n 'resourceAccess.missing',\n 'no resourceAccess block authored — the v1 minion runtime will deny every repository call by default (KD-11 fail-closed). Author { read: [...], write: [...] } in wildo.saas.config.ts > minions to opt-in.',\n );\n continue;\n }\n const { read, write } = entry.resourceAccess;\n if (read.length === 0 && write.length === 0) {\n emitSoftWarn(\n scope,\n 'resourceAccess.empty',\n 'resourceAccess block is present but both `read` and `write` are empty arrays — equivalent to omitting the block. Author at least one resource name to grant access.',\n );\n } else if (read.length === 0) {\n emitSoftWarn(\n scope,\n 'resourceAccess.write-only',\n 'resourceAccess.read is empty while resourceAccess.write is non-empty — every write will succeed but no repository read will. If this is intentional (write-only sink) keep as-is; otherwise add the resources you intend to read.',\n );\n } else if (write.length === 0) {\n emitSoftWarn(\n scope,\n 'resourceAccess.read-only',\n 'resourceAccess.write is empty while resourceAccess.read is non-empty — the minion will only be able to read. If this is intentional (read-only scraper) keep as-is; otherwise add the resources you intend to write.',\n );\n }\n }\n\n // M1 (audit-logging Phase 1+2 hardening) — coherence advisory: an ENABLED\n // capability whose resolution mode is FAN_OUT (e.g. COMPLIANCE_AUDIT_TRAIL)\n // writes to EVERY declared provider, so with ZERO providers declaring it the\n // fan-out is a SILENT no-op — the exact compliance hole (an \"enabled\" audit\n // trail that reaches nothing) a config check should surface. The inverse (a\n // provider declaring a non-`enabled` capability) is already a HARD error in the\n // provider-scope refinement, so only this enabled-but-unserved direction needs\n // an advisory. Soft-warn (not fail-closed) so the enable-first-then-wire\n // authoring order isn't blocked.\n const capabilitiesDeclaredByAnyProvider = new Set<EngineCapability>();\n const allProviderScopes = [\n config.providers?.scopes.backend,\n config.providers?.scopes.companion,\n ...Object.values(config.providers?.scopes.frontendServices ?? {}),\n ...Object.values(config.providers?.scopes.minions ?? {}),\n ...Object.values(config.providers?.scopes.workers ?? {}),\n ];\n for (const scope of allProviderScopes) {\n if (!scope) continue;\n for (const providerSelection of Object.values(scope.providers)) {\n for (const capability of providerSelection.engineCapabilities) {\n capabilitiesDeclaredByAnyProvider.add(capability);\n }\n }\n }\n for (const [capabilityKey, activation] of Object.entries(config.engineCapabilities ?? {})) {\n if (activation?.enabled !== true) continue;\n const capability = capabilityKey as EngineCapability;\n if (getEngineCapabilityResolutionMode(capability) !== EngineCapabilityResolutionMode.FAN_OUT) continue;\n if (!capabilitiesDeclaredByAnyProvider.has(capability)) {\n emitSoftWarn(\n 'providers.engineCapabilities',\n `fanout-no-provider:${capability}`,\n `capability \"${capability}\" is enabled and FAN_OUT (every declared provider receives every emission), but NO provider in any scope declares it — its fan-out (e.g. the compliance audit trail) is a SILENT no-op. Declare at least one provider with engineCapabilities: ['${capability}'], or disable the capability.`,\n );\n }\n }\n}\n"]}
@@ -2,27 +2,32 @@ export declare const FRAMEWORK_RELEASE_NPM_SCOPE = "@wildo-ai";
2
2
  /**
3
3
  * Container registry that hosts the published framework images.
4
4
  *
5
- * Declared EXPLICITLY rather than left to Docker's default resolution. A bare
6
- * `<namespace>/<image>` reference silently means Docker Hub, which is how this
7
- * framework's registry came to be chosen by default rather than by decision.
8
- * Naming the host makes the choice reviewable and makes a future move a config
9
- * change instead of an archaeology exercise.
5
+ * Declared EXPLICITLY rather than left to Docker's default resolution: a bare
6
+ * `<namespace>/<image>` reference silently means Docker Hub, and naming the host
7
+ * makes the choice reviewable and a future move a config change instead of an
8
+ * archaeology exercise. Every consumer-side reference (the compose template's
9
+ * `platformImageRef`) is built from these two constants, and the publish lane
10
+ * refuses any framework config that names a different pair.
10
11
  *
11
- * GHCR is used because publication authenticates with the workflow's own
12
- * run-scoped `GITHUB_TOKEN` (`packages: write`) — no long-lived registry
13
- * credential has to exist — and because public GHCR pulls are not subject to
14
- * Docker Hub's anonymous pull-rate limits, which would otherwise throttle
15
- * consumer CI pulling the base images.
12
+ * ## History, because it moved twice
13
+ *
14
+ * Docker Hub (`wildoai`) was the original home; the images `wildoai/wildo-platform:0.2.0`
15
+ * and `:1.0.1` were pushed there in April 2026. On 2026-08-26 the lane was moved to GHCR
16
+ * (`ghcr.io/wildo-ai`) for two reasons: publication could authenticate with a workflow's
17
+ * own run-scoped `GITHUB_TOKEN`, and public GHCR pulls carry no anonymous pull-rate limit.
18
+ * Neither reason was ever exercised — no publish CI exists, and the lane runs from a
19
+ * developer machine — while the only container credential the framework holds is the
20
+ * Docker Hub one. The first real GHCR publish (2026-09-04) was refused for exactly that.
21
+ * Paul decided on 2026-09-05 to go BACK to Docker Hub rather than mint a second credential.
22
+ *
23
+ * If the lane ever moves to CI, the GHCR argument returns; move both constants and the
24
+ * framework config together, and the publish-lane pin and the compose pins will say so.
16
25
  */
17
- export declare const FRAMEWORK_RELEASE_DOCKER_REGISTRY_HOST = "ghcr.io";
26
+ export declare const FRAMEWORK_RELEASE_DOCKER_REGISTRY_HOST = "docker.io";
18
27
  /**
19
- * Owner namespace under {@link FRAMEWORK_RELEASE_DOCKER_REGISTRY_HOST}.
20
- *
21
- * On GHCR this MUST equal the GitHub organization that owns the repository
22
- * (`wildo-ai`), because GHCR derives package ownership and permissions from it.
23
- * The former Docker Hub namespace was `wildoai` (no hyphen); it is deliberately
24
- * not reused, and that Docker Hub namespace should be retained but left
25
- * unpublished so the name cannot be squatted.
28
+ * Owner namespace under {@link FRAMEWORK_RELEASE_DOCKER_REGISTRY_HOST} — the Docker Hub
29
+ * organization (`wildoai`, no hyphen: Docker Hub namespaces cannot carry one, which is why
30
+ * it differs from the GitHub organization `wildo-ai` and the npm scope `@wildo-ai`).
26
31
  */
27
- export declare const FRAMEWORK_RELEASE_DOCKER_NAMESPACE = "wildo-ai";
32
+ export declare const FRAMEWORK_RELEASE_DOCKER_NAMESPACE = "wildoai";
28
33
  //# sourceMappingURL=framework-release.constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"framework-release.constants.d.ts","sourceRoot":"","sources":["../../../../src/release/framework-release.constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,2BAA2B,cAAc,CAAC;AAEvD;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,sCAAsC,YAAY,CAAC;AAEhE;;;;;;;;GAQG;AACH,eAAO,MAAM,kCAAkC,aAAa,CAAC"}
1
+ {"version":3,"file":"framework-release.constants.d.ts","sourceRoot":"","sources":["../../../../src/release/framework-release.constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,2BAA2B,cAAc,CAAC;AAEvD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,sCAAsC,cAAc,CAAC;AAElE;;;;GAIG;AACH,eAAO,MAAM,kCAAkC,YAAY,CAAC"}
@@ -2,27 +2,32 @@ export const FRAMEWORK_RELEASE_NPM_SCOPE = '@wildo-ai';
2
2
  /**
3
3
  * Container registry that hosts the published framework images.
4
4
  *
5
- * Declared EXPLICITLY rather than left to Docker's default resolution. A bare
6
- * `<namespace>/<image>` reference silently means Docker Hub, which is how this
7
- * framework's registry came to be chosen by default rather than by decision.
8
- * Naming the host makes the choice reviewable and makes a future move a config
9
- * change instead of an archaeology exercise.
5
+ * Declared EXPLICITLY rather than left to Docker's default resolution: a bare
6
+ * `<namespace>/<image>` reference silently means Docker Hub, and naming the host
7
+ * makes the choice reviewable and a future move a config change instead of an
8
+ * archaeology exercise. Every consumer-side reference (the compose template's
9
+ * `platformImageRef`) is built from these two constants, and the publish lane
10
+ * refuses any framework config that names a different pair.
10
11
  *
11
- * GHCR is used because publication authenticates with the workflow's own
12
- * run-scoped `GITHUB_TOKEN` (`packages: write`) — no long-lived registry
13
- * credential has to exist — and because public GHCR pulls are not subject to
14
- * Docker Hub's anonymous pull-rate limits, which would otherwise throttle
15
- * consumer CI pulling the base images.
12
+ * ## History, because it moved twice
13
+ *
14
+ * Docker Hub (`wildoai`) was the original home; the images `wildoai/wildo-platform:0.2.0`
15
+ * and `:1.0.1` were pushed there in April 2026. On 2026-08-26 the lane was moved to GHCR
16
+ * (`ghcr.io/wildo-ai`) for two reasons: publication could authenticate with a workflow's
17
+ * own run-scoped `GITHUB_TOKEN`, and public GHCR pulls carry no anonymous pull-rate limit.
18
+ * Neither reason was ever exercised — no publish CI exists, and the lane runs from a
19
+ * developer machine — while the only container credential the framework holds is the
20
+ * Docker Hub one. The first real GHCR publish (2026-09-04) was refused for exactly that.
21
+ * Paul decided on 2026-09-05 to go BACK to Docker Hub rather than mint a second credential.
22
+ *
23
+ * If the lane ever moves to CI, the GHCR argument returns; move both constants and the
24
+ * framework config together, and the publish-lane pin and the compose pins will say so.
16
25
  */
17
- export const FRAMEWORK_RELEASE_DOCKER_REGISTRY_HOST = 'ghcr.io';
26
+ export const FRAMEWORK_RELEASE_DOCKER_REGISTRY_HOST = 'docker.io';
18
27
  /**
19
- * Owner namespace under {@link FRAMEWORK_RELEASE_DOCKER_REGISTRY_HOST}.
20
- *
21
- * On GHCR this MUST equal the GitHub organization that owns the repository
22
- * (`wildo-ai`), because GHCR derives package ownership and permissions from it.
23
- * The former Docker Hub namespace was `wildoai` (no hyphen); it is deliberately
24
- * not reused, and that Docker Hub namespace should be retained but left
25
- * unpublished so the name cannot be squatted.
28
+ * Owner namespace under {@link FRAMEWORK_RELEASE_DOCKER_REGISTRY_HOST} — the Docker Hub
29
+ * organization (`wildoai`, no hyphen: Docker Hub namespaces cannot carry one, which is why
30
+ * it differs from the GitHub organization `wildo-ai` and the npm scope `@wildo-ai`).
26
31
  */
27
- export const FRAMEWORK_RELEASE_DOCKER_NAMESPACE = 'wildo-ai';
32
+ export const FRAMEWORK_RELEASE_DOCKER_NAMESPACE = 'wildoai';
28
33
  //# sourceMappingURL=framework-release.constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"framework-release.constants.js","sourceRoot":"","sources":["../../../../src/release/framework-release.constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,2BAA2B,GAAG,WAAW,CAAC;AAEvD;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,sCAAsC,GAAG,SAAS,CAAC;AAEhE;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAAG,UAAU,CAAC","sourcesContent":["export const FRAMEWORK_RELEASE_NPM_SCOPE = '@wildo-ai';\n\n/**\n * Container registry that hosts the published framework images.\n *\n * Declared EXPLICITLY rather than left to Docker's default resolution. A bare\n * `<namespace>/<image>` reference silently means Docker Hub, which is how this\n * framework's registry came to be chosen by default rather than by decision.\n * Naming the host makes the choice reviewable and makes a future move a config\n * change instead of an archaeology exercise.\n *\n * GHCR is used because publication authenticates with the workflow's own\n * run-scoped `GITHUB_TOKEN` (`packages: write`) — no long-lived registry\n * credential has to exist — and because public GHCR pulls are not subject to\n * Docker Hub's anonymous pull-rate limits, which would otherwise throttle\n * consumer CI pulling the base images.\n */\nexport const FRAMEWORK_RELEASE_DOCKER_REGISTRY_HOST = 'ghcr.io';\n\n/**\n * Owner namespace under {@link FRAMEWORK_RELEASE_DOCKER_REGISTRY_HOST}.\n *\n * On GHCR this MUST equal the GitHub organization that owns the repository\n * (`wildo-ai`), because GHCR derives package ownership and permissions from it.\n * The former Docker Hub namespace was `wildoai` (no hyphen); it is deliberately\n * not reused, and that Docker Hub namespace should be retained but left\n * unpublished so the name cannot be squatted.\n */\nexport const FRAMEWORK_RELEASE_DOCKER_NAMESPACE = 'wildo-ai';\n"]}
1
+ {"version":3,"file":"framework-release.constants.js","sourceRoot":"","sources":["../../../../src/release/framework-release.constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,2BAA2B,GAAG,WAAW,CAAC;AAEvD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,CAAC,MAAM,sCAAsC,GAAG,WAAW,CAAC;AAElE;;;;GAIG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAAG,SAAS,CAAC","sourcesContent":["export const FRAMEWORK_RELEASE_NPM_SCOPE = '@wildo-ai';\n\n/**\n * Container registry that hosts the published framework images.\n *\n * Declared EXPLICITLY rather than left to Docker's default resolution: a bare\n * `<namespace>/<image>` reference silently means Docker Hub, and naming the host\n * makes the choice reviewable and a future move a config change instead of an\n * archaeology exercise. Every consumer-side reference (the compose template's\n * `platformImageRef`) is built from these two constants, and the publish lane\n * refuses any framework config that names a different pair.\n *\n * ## History, because it moved twice\n *\n * Docker Hub (`wildoai`) was the original home; the images `wildoai/wildo-platform:0.2.0`\n * and `:1.0.1` were pushed there in April 2026. On 2026-08-26 the lane was moved to GHCR\n * (`ghcr.io/wildo-ai`) for two reasons: publication could authenticate with a workflow's\n * own run-scoped `GITHUB_TOKEN`, and public GHCR pulls carry no anonymous pull-rate limit.\n * Neither reason was ever exercised — no publish CI exists, and the lane runs from a\n * developer machine — while the only container credential the framework holds is the\n * Docker Hub one. The first real GHCR publish (2026-09-04) was refused for exactly that.\n * Paul decided on 2026-09-05 to go BACK to Docker Hub rather than mint a second credential.\n *\n * If the lane ever moves to CI, the GHCR argument returns; move both constants and the\n * framework config together, and the publish-lane pin and the compose pins will say so.\n */\nexport const FRAMEWORK_RELEASE_DOCKER_REGISTRY_HOST = 'docker.io';\n\n/**\n * Owner namespace under {@link FRAMEWORK_RELEASE_DOCKER_REGISTRY_HOST} — the Docker Hub\n * organization (`wildoai`, no hyphen: Docker Hub namespaces cannot carry one, which is why\n * it differs from the GitHub organization `wildo-ai` and the npm scope `@wildo-ai`).\n */\nexport const FRAMEWORK_RELEASE_DOCKER_NAMESPACE = 'wildoai';\n"]}