@wildo-ai/saas-backend-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.
- package/dist/esm/base-classes/services/controllers/controller-resource.backend.service.d.ts +14 -3
- package/dist/esm/base-classes/services/controllers/controller-resource.backend.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/controllers/controller-resource.backend.service.js +115 -22
- package/dist/esm/base-classes/services/controllers/controller-resource.backend.service.js.map +1 -1
- package/dist/esm/base-classes/services/controllers/controllers-registry-handler.backend.service.d.ts +3 -1
- package/dist/esm/base-classes/services/controllers/controllers-registry-handler.backend.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/controllers/controllers-registry-handler.backend.service.js +8 -3
- package/dist/esm/base-classes/services/controllers/controllers-registry-handler.backend.service.js.map +1 -1
- package/dist/esm/base-classes/services/repositories/field-clearing-partition.backend.d.ts +11 -0
- package/dist/esm/base-classes/services/repositories/field-clearing-partition.backend.d.ts.map +1 -1
- package/dist/esm/base-classes/services/repositories/field-clearing-partition.backend.js +11 -2
- package/dist/esm/base-classes/services/repositories/field-clearing-partition.backend.js.map +1 -1
- package/dist/esm/base-classes/services/repositories/http-api/http-api-resource-repository.backend.service.d.ts +1 -0
- package/dist/esm/base-classes/services/repositories/http-api/http-api-resource-repository.backend.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/repositories/http-api/http-api-resource-repository.backend.service.js +6 -1
- package/dist/esm/base-classes/services/repositories/http-api/http-api-resource-repository.backend.service.js.map +1 -1
- package/dist/esm/base-classes/services/repositories/http-api/odata-query-compiler.backend.d.ts.map +1 -1
- package/dist/esm/base-classes/services/repositories/http-api/odata-query-compiler.backend.js +16 -0
- package/dist/esm/base-classes/services/repositories/http-api/odata-query-compiler.backend.js.map +1 -1
- package/dist/esm/base-classes/services/repositories/infrastructure-tier-contract.backend.d.ts +20 -6
- package/dist/esm/base-classes/services/repositories/infrastructure-tier-contract.backend.d.ts.map +1 -1
- package/dist/esm/base-classes/services/repositories/infrastructure-tier-contract.backend.js +88 -32
- package/dist/esm/base-classes/services/repositories/infrastructure-tier-contract.backend.js.map +1 -1
- package/dist/esm/base-classes/services/repositories/introspection/introspection-resource-repository.backend.service.d.ts +3 -1
- package/dist/esm/base-classes/services/repositories/introspection/introspection-resource-repository.backend.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/repositories/introspection/introspection-resource-repository.backend.service.js +32 -7
- package/dist/esm/base-classes/services/repositories/introspection/introspection-resource-repository.backend.service.js.map +1 -1
- package/dist/esm/base-classes/services/repositories/introspection/introspection-resource-source.backend.port.d.ts +8 -5
- package/dist/esm/base-classes/services/repositories/introspection/introspection-resource-source.backend.port.d.ts.map +1 -1
- package/dist/esm/base-classes/services/repositories/introspection/introspection-resource-source.backend.port.js.map +1 -1
- package/dist/esm/base-classes/services/repositories/postgresql-resource-repository.backend.service.d.ts +31 -0
- package/dist/esm/base-classes/services/repositories/postgresql-resource-repository.backend.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/repositories/postgresql-resource-repository.backend.service.js +127 -5
- package/dist/esm/base-classes/services/repositories/postgresql-resource-repository.backend.service.js.map +1 -1
- package/dist/esm/base-classes/services/repositories/repositories-registry-handler.backend.service.d.ts +71 -1
- package/dist/esm/base-classes/services/repositories/repositories-registry-handler.backend.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/repositories/repositories-registry-handler.backend.service.js +62 -2
- package/dist/esm/base-classes/services/repositories/repositories-registry-handler.backend.service.js.map +1 -1
- package/dist/esm/base-classes/services/repositories/repository-resource.backend.service.d.ts +21 -0
- package/dist/esm/base-classes/services/repositories/repository-resource.backend.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/repositories/repository-resource.backend.service.js +126 -4
- package/dist/esm/base-classes/services/repositories/repository-resource.backend.service.js.map +1 -1
- package/dist/esm/base-classes/services/services/resource-operation-implementation-coverage.backend.utils.d.ts +3 -26
- package/dist/esm/base-classes/services/services/resource-operation-implementation-coverage.backend.utils.d.ts.map +1 -1
- package/dist/esm/base-classes/services/services/resource-operation-implementation-coverage.backend.utils.js +3 -68
- package/dist/esm/base-classes/services/services/resource-operation-implementation-coverage.backend.utils.js.map +1 -1
- package/dist/esm/base-classes/services/services/services-registry-handler.backend.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/services/services-registry-handler.backend.service.js +4 -2
- package/dist/esm/base-classes/services/services/services-registry-handler.backend.service.js.map +1 -1
- package/dist/esm/billing/services/custom-impl/billing-account.mutations.custom-impl.backend.service.js +6 -6
- package/dist/esm/billing/services/custom-impl/billing-account.mutations.custom-impl.backend.service.js.map +1 -1
- package/dist/esm/compliance/audit-trails/services/audit-event-dispatcher.backend.service.d.ts +38 -0
- package/dist/esm/compliance/audit-trails/services/audit-event-dispatcher.backend.service.d.ts.map +1 -1
- package/dist/esm/compliance/audit-trails/services/audit-event-dispatcher.backend.service.js +40 -0
- package/dist/esm/compliance/audit-trails/services/audit-event-dispatcher.backend.service.js.map +1 -1
- package/dist/esm/compliance/audit-trails/services/audit-logs.backend.service.d.ts +20 -0
- package/dist/esm/compliance/audit-trails/services/audit-logs.backend.service.d.ts.map +1 -1
- package/dist/esm/compliance/audit-trails/services/audit-logs.backend.service.js +28 -0
- package/dist/esm/compliance/audit-trails/services/audit-logs.backend.service.js.map +1 -1
- package/dist/esm/compliance/audit-trails/services/siem-export-config-cache-invalidation.custom-impl.backend.service.d.ts +12 -0
- package/dist/esm/compliance/audit-trails/services/siem-export-config-cache-invalidation.custom-impl.backend.service.d.ts.map +1 -0
- package/dist/esm/compliance/audit-trails/services/siem-export-config-cache-invalidation.custom-impl.backend.service.js +118 -0
- package/dist/esm/compliance/audit-trails/services/siem-export-config-cache-invalidation.custom-impl.backend.service.js.map +1 -0
- package/dist/esm/compliance/audit-trails/services/siem-webhook-delivery.backend.service.d.ts.map +1 -1
- package/dist/esm/compliance/audit-trails/services/siem-webhook-delivery.backend.service.js +8 -5
- package/dist/esm/compliance/audit-trails/services/siem-webhook-delivery.backend.service.js.map +1 -1
- package/dist/esm/compliance/audit-trails/services/utils/ocsf-activity-mapping.backend.utils.d.ts.map +1 -1
- package/dist/esm/compliance/audit-trails/services/utils/ocsf-activity-mapping.backend.utils.js +14 -0
- package/dist/esm/compliance/audit-trails/services/utils/ocsf-activity-mapping.backend.utils.js.map +1 -1
- package/dist/esm/config/custom/application-config-controller.backend.service.d.ts.map +1 -1
- package/dist/esm/config/custom/application-config-controller.backend.service.js +7 -1
- package/dist/esm/config/custom/application-config-controller.backend.service.js.map +1 -1
- package/dist/esm/config/models/app-config.backend.schemas.d.ts +4 -0
- package/dist/esm/config/models/app-config.backend.schemas.d.ts.map +1 -1
- package/dist/esm/config/services/app-configuration.backend.utils.d.ts +10 -1
- package/dist/esm/config/services/app-configuration.backend.utils.d.ts.map +1 -1
- package/dist/esm/config/services/app-configuration.backend.utils.js +13 -2
- package/dist/esm/config/services/app-configuration.backend.utils.js.map +1 -1
- package/dist/esm/data-seeding/services/shared/data-seed-scope-iteration.shared.utils.d.ts +2 -2
- package/dist/esm/data-seeding/services/shared/data-seed-scope-iteration.shared.utils.js +2 -2
- package/dist/esm/data-seeding/services/shared/data-seed-scope-iteration.shared.utils.js.map +1 -1
- package/dist/esm/databases/models/filter.backend.schemas.js +2 -2
- package/dist/esm/databases/models/filter.backend.schemas.js.map +1 -1
- package/dist/esm/databases/services/aggregation/aggregation-authorization.backend.service.d.ts.map +1 -1
- package/dist/esm/databases/services/aggregation/aggregation-authorization.backend.service.js +20 -1
- package/dist/esm/databases/services/aggregation/aggregation-authorization.backend.service.js.map +1 -1
- package/dist/esm/databases/services/redis.service.d.ts +27 -0
- package/dist/esm/databases/services/redis.service.d.ts.map +1 -1
- package/dist/esm/databases/services/redis.service.js +29 -0
- package/dist/esm/databases/services/redis.service.js.map +1 -1
- package/dist/esm/errors/services/error-handler.backend.service.d.ts.map +1 -1
- package/dist/esm/errors/services/error-handler.backend.service.js +5 -0
- package/dist/esm/errors/services/error-handler.backend.service.js.map +1 -1
- package/dist/esm/external-data/controllers/external-data-admin.backend.contracts.d.ts +41 -0
- package/dist/esm/external-data/controllers/external-data-admin.backend.contracts.d.ts.map +1 -0
- package/dist/esm/external-data/controllers/external-data-admin.backend.contracts.js +40 -0
- package/dist/esm/external-data/controllers/external-data-admin.backend.contracts.js.map +1 -0
- package/dist/esm/external-data/controllers/external-data-admin.backend.controller.d.ts +64 -0
- package/dist/esm/external-data/controllers/external-data-admin.backend.controller.d.ts.map +1 -0
- package/dist/esm/external-data/controllers/external-data-admin.backend.controller.js +193 -0
- package/dist/esm/external-data/controllers/external-data-admin.backend.controller.js.map +1 -0
- package/dist/esm/external-data/external-data-pipeline-run.backend.service.d.ts +13 -2
- package/dist/esm/external-data/external-data-pipeline-run.backend.service.d.ts.map +1 -1
- package/dist/esm/external-data/external-data-pipeline-run.backend.service.js +8 -2
- package/dist/esm/external-data/external-data-pipeline-run.backend.service.js.map +1 -1
- package/dist/esm/external-data/external-data-transform.backend.d.ts.map +1 -1
- package/dist/esm/external-data/external-data-transform.backend.js +7 -1
- package/dist/esm/external-data/external-data-transform.backend.js.map +1 -1
- package/dist/esm/external-data/models/external-data-pipeline-state.backend.schemas.d.ts +2 -0
- package/dist/esm/external-data/models/external-data-pipeline-state.backend.schemas.d.ts.map +1 -1
- package/dist/esm/external-data/models/external-data-pipeline-state.backend.schemas.js +13 -0
- package/dist/esm/external-data/models/external-data-pipeline-state.backend.schemas.js.map +1 -1
- package/dist/esm/external-providers/services/external-providers-registry.backend.service.d.ts +14 -0
- package/dist/esm/external-providers/services/external-providers-registry.backend.service.d.ts.map +1 -1
- package/dist/esm/external-providers/services/external-providers-registry.backend.service.js +6 -0
- package/dist/esm/external-providers/services/external-providers-registry.backend.service.js.map +1 -1
- package/dist/esm/files/controllers/file.controller.d.ts +24 -1
- package/dist/esm/files/controllers/file.controller.d.ts.map +1 -1
- package/dist/esm/files/controllers/file.controller.js +66 -2
- package/dist/esm/files/controllers/file.controller.js.map +1 -1
- package/dist/esm/files/handlers/file-upload-route-locals.backend.types.d.ts +17 -0
- package/dist/esm/files/handlers/file-upload-route-locals.backend.types.d.ts.map +1 -0
- package/dist/esm/files/handlers/file-upload-route-locals.backend.types.js +1 -0
- package/dist/esm/files/handlers/file-upload-route-locals.backend.types.js.map +1 -0
- package/dist/esm/files/handlers/resource-file-upload-handler.backend.service.d.ts +5 -1
- package/dist/esm/files/handlers/resource-file-upload-handler.backend.service.d.ts.map +1 -1
- package/dist/esm/files/handlers/resource-file-upload-handler.backend.service.js +42 -3
- package/dist/esm/files/handlers/resource-file-upload-handler.backend.service.js.map +1 -1
- package/dist/esm/files/services/file-operation-handler.backend.service.d.ts +18 -0
- package/dist/esm/files/services/file-operation-handler.backend.service.d.ts.map +1 -1
- package/dist/esm/files/services/file-operation-handler.backend.service.js +36 -28
- package/dist/esm/files/services/file-operation-handler.backend.service.js.map +1 -1
- package/dist/esm/files/services/file-upload-grant.backend.service.d.ts +163 -0
- package/dist/esm/files/services/file-upload-grant.backend.service.d.ts.map +1 -0
- package/dist/esm/files/services/file-upload-grant.backend.service.js +442 -0
- package/dist/esm/files/services/file-upload-grant.backend.service.js.map +1 -0
- package/dist/esm/files/services/files.backend.service.d.ts +19 -0
- package/dist/esm/files/services/files.backend.service.d.ts.map +1 -1
- package/dist/esm/files/services/files.backend.service.js +78 -15
- package/dist/esm/files/services/files.backend.service.js.map +1 -1
- package/dist/esm/files/utils/file-uploader.utils.d.ts.map +1 -1
- package/dist/esm/files/utils/file-uploader.utils.js +12 -0
- package/dist/esm/files/utils/file-uploader.utils.js.map +1 -1
- package/dist/esm/flows-actors/a2a/services/a2a-task-cancellation.backend.service.js +5 -5
- package/dist/esm/flows-actors/a2a/services/a2a-task-cancellation.backend.service.js.map +1 -1
- package/dist/esm/flows-actors/services/agents.backend.service.d.ts +79 -0
- package/dist/esm/flows-actors/services/agents.backend.service.d.ts.map +1 -1
- package/dist/esm/flows-actors/services/agents.backend.service.js +319 -42
- package/dist/esm/flows-actors/services/agents.backend.service.js.map +1 -1
- package/dist/esm/flows-actors/utils/acp-session-runner.backend.utils.d.ts +151 -41
- package/dist/esm/flows-actors/utils/acp-session-runner.backend.utils.d.ts.map +1 -1
- package/dist/esm/flows-actors/utils/acp-session-runner.backend.utils.js +300 -139
- package/dist/esm/flows-actors/utils/acp-session-runner.backend.utils.js.map +1 -1
- package/dist/esm/index.d.ts +4 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +14 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/inject/models/container.d.ts.map +1 -1
- package/dist/esm/inject/models/container.js +4 -0
- package/dist/esm/inject/models/container.js.map +1 -1
- package/dist/esm/inject/models/service-types.d.ts +3 -0
- package/dist/esm/inject/models/service-types.d.ts.map +1 -1
- package/dist/esm/inject/models/service-types.js +2 -0
- package/dist/esm/inject/models/service-types.js.map +1 -1
- package/dist/esm/mcp/controllers/mcp.controller.d.ts.map +1 -1
- package/dist/esm/mcp/controllers/mcp.controller.js +12 -4
- package/dist/esm/mcp/controllers/mcp.controller.js.map +1 -1
- package/dist/esm/mcp/models/mcp-tool.backend.schemas.d.ts +34 -0
- package/dist/esm/mcp/models/mcp-tool.backend.schemas.d.ts.map +1 -1
- package/dist/esm/mcp/models/mcp-tool.backend.schemas.js +42 -0
- package/dist/esm/mcp/models/mcp-tool.backend.schemas.js.map +1 -1
- package/dist/esm/mcp/services/mcp-server.backend.service.d.ts +29 -1
- package/dist/esm/mcp/services/mcp-server.backend.service.d.ts.map +1 -1
- package/dist/esm/mcp/services/mcp-server.backend.service.js +131 -3
- package/dist/esm/mcp/services/mcp-server.backend.service.js.map +1 -1
- package/dist/esm/mcp/services/mcp-tool-adapter.backend.service.d.ts +64 -2
- package/dist/esm/mcp/services/mcp-tool-adapter.backend.service.d.ts.map +1 -1
- package/dist/esm/mcp/services/mcp-tool-adapter.backend.service.js +130 -6
- package/dist/esm/mcp/services/mcp-tool-adapter.backend.service.js.map +1 -1
- package/dist/esm/notifications/services/notifications-dispatcher.backend.service.d.ts +9 -0
- package/dist/esm/notifications/services/notifications-dispatcher.backend.service.d.ts.map +1 -1
- package/dist/esm/notifications/services/notifications-dispatcher.backend.service.js +11 -36
- package/dist/esm/notifications/services/notifications-dispatcher.backend.service.js.map +1 -1
- package/dist/esm/notifications/webhooks/outbound/batches/m2m-webhook-delivery.batch.backend.service.d.ts.map +1 -1
- package/dist/esm/notifications/webhooks/outbound/batches/m2m-webhook-delivery.batch.backend.service.js +9 -7
- package/dist/esm/notifications/webhooks/outbound/batches/m2m-webhook-delivery.batch.backend.service.js.map +1 -1
- package/dist/esm/notifications/webhooks/outbound/batches/m2m-webhook-delivery.batch.utils.d.ts +5 -5
- package/dist/esm/notifications/webhooks/outbound/batches/m2m-webhook-delivery.batch.utils.d.ts.map +1 -1
- package/dist/esm/notifications/webhooks/outbound/batches/m2m-webhook-delivery.batch.utils.js +14 -13
- package/dist/esm/notifications/webhooks/outbound/batches/m2m-webhook-delivery.batch.utils.js.map +1 -1
- package/dist/esm/notifications/webhooks/outbound/m2m-webhook-signed-request.backend.utils.d.ts +2 -1
- package/dist/esm/notifications/webhooks/outbound/m2m-webhook-signed-request.backend.utils.d.ts.map +1 -1
- package/dist/esm/notifications/webhooks/outbound/m2m-webhook-signed-request.backend.utils.js +2 -2
- package/dist/esm/notifications/webhooks/outbound/m2m-webhook-signed-request.backend.utils.js.map +1 -1
- package/dist/esm/notifications/webhooks/outbound/services/webhook-config-test-endpoint.custom-impl.backend.service.d.ts.map +1 -1
- package/dist/esm/notifications/webhooks/outbound/services/webhook-config-test-endpoint.custom-impl.backend.service.js +9 -7
- package/dist/esm/notifications/webhooks/outbound/services/webhook-config-test-endpoint.custom-impl.backend.service.js.map +1 -1
- package/dist/esm/organizations/services/organization-unit-custom-implementation.backend.service.d.ts.map +1 -1
- package/dist/esm/organizations/services/organization-unit-custom-implementation.backend.service.js +4 -1
- package/dist/esm/organizations/services/organization-unit-custom-implementation.backend.service.js.map +1 -1
- package/dist/esm/requests/service/websocket.service.d.ts.map +1 -1
- package/dist/esm/requests/service/websocket.service.js +56 -7
- package/dist/esm/requests/service/websocket.service.js.map +1 -1
- package/dist/esm/resources/models/custom-service-implementations.backend.definition.d.ts.map +1 -1
- package/dist/esm/resources/models/custom-service-implementations.backend.definition.js +2 -0
- package/dist/esm/resources/models/custom-service-implementations.backend.definition.js.map +1 -1
- package/dist/esm/resources/services/resource-id.backend.service.js +3 -3
- package/dist/esm/resources/services/resource-id.backend.service.js.map +1 -1
- package/dist/esm/resources/services/resources-registry.backend.service.js +1 -1
- package/dist/esm/resources/services/resources-registry.backend.service.js.map +1 -1
- package/dist/esm/runtime/services/execution-context-creator.backend.service.d.ts.map +1 -1
- package/dist/esm/runtime/services/execution-context-creator.backend.service.js +13 -7
- package/dist/esm/runtime/services/execution-context-creator.backend.service.js.map +1 -1
- package/dist/esm/runtime/services/start-application.backend.service.d.ts +28 -0
- package/dist/esm/runtime/services/start-application.backend.service.d.ts.map +1 -1
- package/dist/esm/runtime/services/start-application.backend.service.js +82 -0
- package/dist/esm/runtime/services/start-application.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/models/jwt.backend.schemas.d.ts +3 -23
- package/dist/esm/security/authentications/models/jwt.backend.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/models/jwt.backend.schemas.js +20 -45
- package/dist/esm/security/authentications/models/jwt.backend.schemas.js.map +1 -1
- package/dist/esm/security/authentications/services/auth-methods/auth-method-management.backend.service.d.ts +9 -1
- package/dist/esm/security/authentications/services/auth-methods/auth-method-management.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/auth-methods/auth-method-management.backend.service.js +9 -1
- package/dist/esm/security/authentications/services/auth-methods/auth-method-management.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/services/auth-methods/auth-mfa.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/auth-methods/auth-mfa.backend.service.js +5 -3
- package/dist/esm/security/authentications/services/auth-methods/auth-mfa.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/services/auth-token-issuer.backend.service.d.ts +25 -1
- package/dist/esm/security/authentications/services/auth-token-issuer.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/auth-token-issuer.backend.service.js +55 -4
- package/dist/esm/security/authentications/services/auth-token-issuer.backend.service.js.map +1 -1
- package/dist/esm/security/authorizations/initiator-organization-confinement.backend.d.ts.map +1 -1
- package/dist/esm/security/authorizations/initiator-organization-confinement.backend.js +24 -1
- package/dist/esm/security/authorizations/initiator-organization-confinement.backend.js.map +1 -1
- package/dist/esm/security/authorizations/privileged-access-review.backend.utils.d.ts +117 -0
- package/dist/esm/security/authorizations/privileged-access-review.backend.utils.d.ts.map +1 -0
- package/dist/esm/security/authorizations/privileged-access-review.backend.utils.js +104 -0
- package/dist/esm/security/authorizations/privileged-access-review.backend.utils.js.map +1 -0
- package/dist/esm/security/authorizations/services/authorizations.backend.service.d.ts +101 -6
- package/dist/esm/security/authorizations/services/authorizations.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authorizations/services/authorizations.backend.service.js +210 -30
- package/dist/esm/security/authorizations/services/authorizations.backend.service.js.map +1 -1
- package/dist/esm/security/consumable-tokens/batches/consumable-tokens-cleanup.batch.backend.service.d.ts +18 -1
- package/dist/esm/security/consumable-tokens/batches/consumable-tokens-cleanup.batch.backend.service.d.ts.map +1 -1
- package/dist/esm/security/consumable-tokens/batches/consumable-tokens-cleanup.batch.backend.service.js +110 -74
- package/dist/esm/security/consumable-tokens/batches/consumable-tokens-cleanup.batch.backend.service.js.map +1 -1
- package/dist/esm/security/consumable-tokens/consumable-token-models.exports.d.ts +22 -0
- package/dist/esm/security/consumable-tokens/consumable-token-models.exports.d.ts.map +1 -0
- package/dist/esm/security/consumable-tokens/consumable-token-models.exports.js +22 -0
- package/dist/esm/security/consumable-tokens/consumable-token-models.exports.js.map +1 -0
- package/dist/esm/security/consumable-tokens/models/consumable-tokens.backend.resources-config.schemas.d.ts +17 -3
- package/dist/esm/security/consumable-tokens/models/consumable-tokens.backend.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/security/consumable-tokens/models/consumable-tokens.backend.resources-config.schemas.js +12 -0
- package/dist/esm/security/consumable-tokens/models/consumable-tokens.backend.resources-config.schemas.js.map +1 -1
- package/dist/esm/security/consumable-tokens/services/consumable-token.backend.service.d.ts +20 -0
- package/dist/esm/security/consumable-tokens/services/consumable-token.backend.service.d.ts.map +1 -1
- package/dist/esm/security/consumable-tokens/services/consumable-token.backend.service.js +58 -5
- package/dist/esm/security/consumable-tokens/services/consumable-token.backend.service.js.map +1 -1
- package/dist/esm/security/jwt/services/jwt.backend.service.d.ts.map +1 -1
- package/dist/esm/security/jwt/services/jwt.backend.service.js +1 -18
- package/dist/esm/security/jwt/services/jwt.backend.service.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +15 -9
- package/dist/esm/.builder.pid +0 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start-application.backend.service.js","sourceRoot":"","sources":["../../../../../src/runtime/services/start-application.backend.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAKzD,OAAO,EAAE,kCAAkC,EAAE,MAAM,kFAAkF,CAAC;AAItI,OAAO,EAAE,SAAS,EAAE,2BAA2B,EAAE,6BAA6B,EAAE,2BAA2B,EAAE,cAAc,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,cAAc,EAAE,kBAAkB,EAAE,qCAAqC,EAAE,sCAAsC,EAAE,8BAA8B,EAAE,sCAAsC,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAExd,OAAO,EAAE,wDAAwD,EAAuC,MAAM,uBAAuB,CAAC;AACtI,OAAO,EAAE,kBAAkB,EAA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AAA;qCA9DL,aAAa;QACO,uBAAuB;QACkB,wCAAwC;QAClE,+BAA+B;QACjB,yCAAyC;QAC1D,qCAAqC;QACtB,wCAAwC;QACjE,wBAAwB;QAC3B,0BAA0B;QAC1B,mBAAmB;QACR,4BAA4B;QACzB,sCAAsC;QACT,qCAAqC;QACzC,2DAA2D;QACrG,cAAc;QAClB,YAAY;QACd,kBAAkB;QACoB,qCAAqC;QACjC,uCAAuC;QACvC,uCAAuC;QACjD,yCAAyC;QAC3C,wCAAwC;QACxD,gCAAgC;QAChB,0BAA0B;QAChB,6CAA6C;QACxD,oCAAoC;QACnD,yBAAyB;QACrB,2BAA2B;QACnB,sCAAsC;QACrC,mCAAmC;QACzC,gCAAgC;QACzC,+BAA+B;QAK1B,8BAA8B;QAC1B,gCAAgC,YAepB,2BAA2B,YAWnF,yCAAyC;GA5ErF,8BAA8B,CAskE1C;;AAED;;;;GAIG;AACH,SAAS,yBAAyB,CAAI,MAAyC;IAC3E,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;QAAE,OAAO,MAAM,CAAC;IACzC,OAAO,MAAM,EAAE,IAAI,IAAI,MAAM,EAAE,KAAK,IAAI,EAAE,CAAC;AAC/C,CAAC","sourcesContent":["import 'reflect-metadata';\nimport { injectable, inject, optional } from 'inversify';\nimport type { PersistenceAdapterType, ResourceConfiguration_InitializationFactoryMap, ResourceRelationship, ResourcesRegistry, ResourceType, RolesConfiguration, FlowsActors_Agent, ResourceConfiguration, FeatureDefinitionWithAutoRegister, FeatureConfiguration, ScopeFeatures, MilestoneDefinition, ForeignKeyFillabilityViolation, CompositionSeedabilityViolation, CompositionSeedabilityResourceInput, CompositionCascadeDeletabilityViolation, NotificationBadgeDefinition, ResourceServerInstance } from '@wildo-ai/saas-models';\nimport type { DataSeedDefinition } from '~wildo-backend-lib/data-seeding/models/data-seed.shared.schemas';\nimport type { DataSeedScopeResolver } from '~wildo-backend-lib/data-seeding/services/data-seed-scope-resolver-registry.backend.service';\nimport type { DataSeedScopeResolverRegistryBackendService } from '~wildo-backend-lib/data-seeding/services/data-seed-scope-resolver-registry.backend.service';\nimport { runDataSeedingApplicationBootstrap } from '~wildo-backend-lib/data-seeding/services/data-seed-application-bootstrap.backend';\nimport type { FlowActorSystem_InitializationFactoryMap } from '~wildo-backend-lib/flows-actors/models/flows-actors.backend.schemas';\nimport type { FunctionTool } from '~wildo-backend-lib/flows-actors/models/function-tools.backend.definitions';\nimport type { BackendProviderRegistry } from '@wildo-ai/external-connectors-private/backend';\nimport { ErrorType, ErrorCustomMessageReference, FeatureUnavailabilityBehavior, FeatureUnavailabilityReason, BILLING_SCOPES, ActivationCriterionType, ResourcePrimaryScope, CoreResourceType, CoreResourceOperation, CORE_APP_ROLES, RelationshipNature, validateRequiredForeignKeyFillability, ForeignKeyFillabilityViolationSeverity, validateCompositionSeedability, validateCompositionCascadeDeletability, ChildLifecycleStrategy, EngineCapability } from '@wildo-ai/saas-models';\nimport type { LifecycleConfig, OrganizationUnitNarrowingDeclaration } from '@wildo-ai/saas-models';\nimport { collectApplicationResourcesWithNoPersonalDataDeclaration, type PersonalDataDeclarationSubject } from '@wildo-ai/saas-models';\nimport { SAAS_SERVICE_TYPES } from '~wildo-backend-lib/inject/models/service-types';\nimport { LoggerService } from '~wildo-backend-lib/monitoring/logger/services/logger.service';\nimport { describeCaughtError, projectCaughtErrorLogFields } from '~wildo-backend-lib/errors/utils/error-log-level-classification.backend.utils';\nimport type { AuditLogsBackendService } from '~wildo-backend-lib/compliance/audit-trails/services/audit-logs.backend.service';\nimport {\n ADMINISTRATIVELY_USABLE_USER_STATUSES,\n measureUsableSuperAdminPopulation,\n resolveSuperAdminConferringRoles,\n SUPER_ADMIN_FLOOR_MINIMUM,\n} from '~wildo-backend-lib/security/authorizations/super-admin-floor.backend.utils';\nimport {\n ADMINISTRATIVELY_USABLE_ORGANIZATION_MEMBER_STATUSES,\n ADMINISTRATIVELY_USABLE_OWNER_USER_STATUSES,\n measureOrganizationsMissingUsableOwner,\n ORGANIZATION_OWNER_FLOOR_MINIMUM,\n resolveOrganizationOwnerConferringRoles,\n} from '~wildo-backend-lib/security/authorizations/organization-owner-floor.backend.utils';\nimport { ApplicationRuntimeProfile, resolveApplicationRuntimeProfileBootAssertions } from '~wildo-backend-lib/config/bootstrap/application-runtime-profile.backend';\nimport { AppConfigurationService } from '~wildo-backend-lib/config/services/app-configuration.backend.service';\nimport { ApplicationStartupConfigValidatorService } from '~wildo-backend-lib/config/services/application-startup-config-validator.backend.service';\nimport { ObservabilityBackendService } from '~wildo-backend-lib/monitoring/observability/services/observability.backend.service';\nimport type { AppConfiguration } from '~wildo-backend-lib/config/models/app-config.backend.schemas';\nimport type { AppConfiguration_BackendAuthored } from '~wildo-backend-lib/config/models/app-config.backend-authored.definitions';\nimport type { ProviderRuntimeArtifact } from '~wildo-backend-lib/config/models/provider-runtime-artifact.backend.schemas';\nimport { ResourcesRegistryBackendService } from '~wildo-backend-lib/resources/services/resources-registry.backend.service';\nimport type { SubjectSessionRevocationBackendService } from '~wildo-backend-lib/compliance/privacy/services/subject-session-revocation.backend.service';\nimport type { AuthTokenIssuerBackendService } from '~wildo-backend-lib/security/authentications/services/auth-token-issuer.backend.service';\nimport { BackendProviderRegistryBackendService } from '~wildo-backend-lib/external-providers/services/backend-provider-registry.backend.service';\nimport { ExternalProvidersRegistryBackendService } from '~wildo-backend-lib/external-providers/services/external-providers-registry.backend.service';\nimport { FeatureDefinitionRegistryBackendService } from '~wildo-backend-lib/features/services/feature-definition-registry.backend.service';\nimport { MilestoneDefinitionRegistryBackendService } from '~wildo-backend-lib/guidance/services/milestone-definition-registry.backend.service';\nimport { MilestoneConditionRegistryBackendService } from '~wildo-backend-lib/guidance/services/milestone-condition-registry.backend.service';\nimport type { MilestoneConditionFn } from '~wildo-backend-lib/guidance/services/milestone-condition-registry.backend.service';\nimport { LifecycleEvaluatorBackendService } from '~wildo-backend-lib/guidance/services/lifecycle-evaluator.backend.service';\nimport { initializeLifecycleCustomImplementations } from '~wildo-backend-lib/guidance/services/lifecycle-custom-implementations.backend';\nimport { createDormancyDetectionBatch } from '~wildo-backend-lib/guidance/batches/dormancy-detection.batch.backend.service';\nimport { createDataSeedingScheduledRerunBatch } from '~wildo-backend-lib/data-seeding/batches/data-seeding-scheduled-rerun.batch.backend.service';\nimport { createExternalDataPipelineScheduledRunBatch } from '~wildo-backend-lib/external-data/batches/external-data-pipeline-scheduled-run.batch.backend.service';\nimport { createDataSeedingRunCleanupBatch } from '~wildo-backend-lib/data-seeding/batches/data-seeding-run-cleanup.batch.backend.service';\nimport { FlowsActorsRegistryService } from '~wildo-backend-lib/flows-actors/services/flows-actors-registry.service';\nimport { ResourceServerInstancesRegistryBackendService } from '~wildo-backend-lib/mcp/services/resource-server-instances-registry.backend.service';\nimport { RepositoriesRegistryHandlerBackendService } from '~wildo-backend-lib/base-classes/services/repositories/repositories-registry-handler.backend.service';\nimport { ServicesRegistryHandlerBackendService } from '~wildo-backend-lib/base-classes/services/services/services-registry-handler.backend.service';\nimport { ControllersRegistryHandlerBackendService } from '~wildo-backend-lib/base-classes/services/controllers/controllers-registry-handler.backend.service';\nimport { AbstractControllerBackendService } from '~wildo-backend-lib/base-classes/services/controllers/abstract-controller.backend.service';\nimport { getManualControllersBackend } from '~wildo-backend-lib/base-classes/models/manual-controllers.backend.definition';\nimport { HttpServerBackendService } from './http-server.backend.service';\nimport { ErrorBuilderBackendService } from '~wildo-backend-lib/errors/services/error-builder.backend.service';\nimport { ErrorHandlerService } from '~wildo-backend-lib/errors/services/error-handler.backend.service';\nimport { AuthorizationsBackendService } from '~wildo-backend-lib/security/authorizations/services/authorizations.backend.service';\nimport { BatchesCronjobsExecutor_BackendService } from '~wildo-backend-lib/base-classes/services/batches/batches-cronjobs-executor.backend.service';\nimport { BatchesCronjobsCustomExecution_Service } from '~wildo-backend-lib/base-classes/services/batches/batches-cronjobs-custom-execution.service';\nimport { ExecutionContextCreatorBackendService } from '~wildo-backend-lib/runtime/services/execution-context-creator.backend.service';\nimport { AuthExecutionContextFactoryBackendService } from '~wildo-backend-lib/security/authentications/services/auth-execution-context-factory.backend.service';\nimport { ResourceOperationCustomImplementationRegistryBackendService } from '~wildo-backend-lib/base-classes/services/services/resource-operation-custom-implementation-registry.backend.service';\nimport { CoreBackend_ServiceImplementationsFactories } from '~wildo-backend-lib/resources/models/custom-service-implementations.backend.definition';\nimport { createFilesCleanupBatch } from '~wildo-backend-lib/files/batches/files-cleanup.batch.backend.service';\nimport { createConsumableTokensCleanupBatch } from '~wildo-backend-lib/security/consumable-tokens/batches/consumable-tokens-cleanup.batch.backend.service';\nimport { createA2AAbandonedTaskSweepBatch } from '~wildo-backend-lib/flows-actors/a2a/batches/a2a-abandoned-task-sweep.batch.backend.service';\nimport { createAnonymousSessionCleanupBatch } from '~wildo-backend-lib/security/authentications/batches/anonymous-session-cleanup.batch.backend.service';\nimport { createOrganizationMemberInvitationSweepBatch } from '~wildo-backend-lib/organizations/batches/organization-member-invitation-sweep.batch.backend.service';\nimport { createSuspensionReactivationSweepBatch } from '~wildo-backend-lib/base-classes/services/batches/suspension-reactivation-sweep.batch.backend.service';\nimport { createResourceRetentionSweepBatch } from '~wildo-backend-lib/base-classes/services/batches/resource-retention-sweep.batch.backend.service';\nimport { createOrganizationPurgeBatch } from '~wildo-backend-lib/organizations/batches/organization-purge.batch.backend.service';\nimport { isScimProvisioningEnabledForAnyOrgType } from '~wildo-backend-lib/organizations/services/scim-provisioning-gate.backend.utils';\nimport { emailBatchSendService } from '~wildo-backend-lib/notifications/email/services/email-batch-send.batch.backend.service';\nimport { m2mWebhookDeliveryBatchService } from '~wildo-backend-lib/notifications/webhooks/outbound/batches/m2m-webhook-delivery.batch.backend.service';\nimport { a2aPushDeliveryBatchService } from '~wildo-backend-lib/flows-actors/a2a/batches/a2a-push-delivery.batch.backend.service';\nimport { siemWebhookDeliveryBatchService } from '~wildo-backend-lib/compliance/audit-trails/batches/siem-webhook-delivery.batch.backend.service';\nimport { immudbAuditReconcileBatchService } from '~wildo-backend-lib/compliance/audit-trails/batches/immudb-audit-reconcile.batch.backend.service';\nimport { auditLogsArchiveBatchService } from '~wildo-backend-lib/compliance/audit-trails/batches/audit-logs-archive.batch.backend.service';\nimport { shouldWarnLayer2AuditProviderInactive } from '~wildo-backend-lib/compliance/audit-trails/utils/layer2-audit-provider-boot-diagnostic.backend.utils';\nimport { StripeStandardBillingProvider } from '~wildo-backend-lib/billing/services/stripe-standard-billing-provider.backend.service';\n// Internal callers go through the path alias (the `@wildo-ai/saas-backend-lib/custom-batch-manifests`\n// subpath export exists for external spec-layer consumers; self-imports through the public\n// package name are not wired in this workspace's tsconfig path map).\nimport {\n ANONYMOUS_SESSION_CLEANUP_BATCH_REF,\n ORGANIZATION_MEMBER_INVITATION_SWEEP_BATCH_REF,\n SUSPENSION_REACTIVATION_SWEEP_BATCH_REF,\n JOB_EXECUTIONS_RETENTION_SWEEP_BATCH_REF,\n JOB_PAYLOAD_STORAGE_RETENTION_SWEEP_BATCH_REF,\n ENGINE_JOB_EXECUTIONS_RETENTION_SWEEP_MANIFEST,\n ENGINE_JOB_PAYLOAD_STORAGE_RETENTION_SWEEP_MANIFEST,\n ORGANIZATION_PURGE_BATCH_REF,\n CONSUMABLE_TOKENS_CLEANUP_BATCH_REF,\n A2A_ABANDONED_TASK_SWEEP_BATCH_REF,\n DATA_SEEDING_RUN_CLEANUP_BATCH_REF,\n DATA_SEEDING_SCHEDULED_RERUN_BATCH_REF,\n DATA_SEEDING_SCHEDULED_RERUN_DEFAULT_CRON,\n EXTERNAL_DATA_PIPELINE_SCHEDULED_RUN_BATCH_REF,\n DORMANCY_DETECTION_BATCH_REF,\n EMAIL_BATCH_SEND_BATCH_REF,\n FILES_CLEANUP_BATCH_REF,\n M2M_WEBHOOK_DELIVERY_BATCH_REF,\n A2A_PUSH_DELIVERY_BATCH_REF,\n SIEM_WEBHOOK_DELIVERY_BATCH_REF,\n IMMUDB_AUDIT_RECONCILE_BATCH_REF,\n AUDIT_LOGS_ARCHIVE_BATCH_REF,\n RAG_RECONCILIATION_SWEEP_BATCH_REF,\n RAG_EMBEDDING_DRAIN_BATCH_REF,\n} from '~wildo-backend-lib/base-classes/services/batches/engine-custom-batch-manifests';\nimport { createRagReconciliationSweepBatch } from '~wildo-backend-lib/rag/batches/rag-reconciliation-sweep.batch.backend.service';\nimport { createRagEmbeddingDrainBatch } from '~wildo-backend-lib/rag/batches/rag-embedding-drain.batch.backend.service';\nimport { SAAS_SERVICE_TYPES as TYPES } from '~wildo-backend-lib/inject/models/service-types';\nimport { ResourceCustomServiceImplementationFactory } from '~wildo-backend-lib/base-classes/services/services/resource-operation-custom-implementation.factory.backend';\nimport { MongoDBService } from '~wildo-backend-lib/databases/services/mongodb.service';\nimport { RedisService } from '~wildo-backend-lib/databases/services/redis.service';\nimport { I18nBackendService, CustomLabelsMap } from '~wildo-backend-lib/i18n/services/i18n.backend.service';\nimport { FileStorageRouterBackendService } from '~wildo-backend-lib/files/storage/file-storage-router.backend.service';\nimport { PdfTemplateBindingBackendService } from '~wildo-backend-lib/pdf-templates/services/pdf-template-binding.backend.service';\nimport type { PdfTemplateBindingsMap } from '~wildo-backend-lib/pdf-templates/models/pdf-template-binding';\nimport { QueueWorkerInitializerBackendService } from '~wildo-backend-lib/queue/queue-worker-initializer.backend.service';\nimport { CronJobSyncBackendService } from '~wildo-backend-lib/queue/cron-job-sync.backend.service';\nimport type { ProductCatalogSyncBackendService } from '~wildo-backend-lib/billing/services/back-office/product-catalog-sync.backend.service';\nimport type { UsageMeteringBackendService } from '~wildo-backend-lib/billing/services/back-office/usage-metering.backend.service';\nimport {\n createBillingSubjectErasureEffect,\n TERMINAL_SUBSCRIPTION_STATUSES,\n} from '~wildo-backend-lib/billing/services/back-office/billing-subject-erasure-effect.backend';\nimport type { SystemAccessBackendService } from '~wildo-backend-lib/base-classes/services/services/system-access.backend.service';\nimport type { BillingFeatureSyncBackendService } from '~wildo-backend-lib/billing/services/back-office/billing-feature-sync.backend.service';\nimport { initializeBillingCustomImplementations, registerBillingPostOperationHooks, setBillingWebSocketService } from '~wildo-backend-lib/billing/services/custom-impl/billing-custom-implementations.backend';\nimport { ExternalProvider_ExchangeProtocol_Kind, type StandardBilling_Interface } from '@wildo-ai/external-connectors-models';\nimport type { WebhookHandlerBackendService } from '~wildo-backend-lib/notifications/webhooks/services/webhook-handler.backend.service';\nimport type { WebhookAutoControllerBackendService } from '~wildo-backend-lib/notifications/webhooks/controllers/webhook-auto-controller.backend.service';\nimport { BillingWebhookAdapter } from '~wildo-backend-lib/billing/services/webhooks/billing-webhook-adapter.backend.service';\nimport { BillingWebhookCapabilityHandler } from '~wildo-backend-lib/billing/services/webhooks/billing-webhook-capability-handler.backend.service';\nimport { BillingWebhookEventRouterBackendService } from '~wildo-backend-lib/billing/services/webhooks/billing-webhook-event-router.backend.service';\nimport type { WebSocketService } from '~wildo-backend-lib/requests/service/websocket.service';\nimport type { BillingConfiguration, ProductDefinition, ChartDefinition, GuidanceFlowDefinition } from '@wildo-ai/saas-models';\nimport { ChartRegistryBackendService } from '~wildo-backend-lib/charts/services/chart-registry.backend.service';\nimport { GuidanceTriggerEvaluatorBackendService } from '~wildo-backend-lib/guidance/services/guidance-trigger-evaluator.backend.service';\nimport { DataSeedRegistryBackendService } from '~wildo-backend-lib/data-seeding/services/data-seed-registry.backend.service';\nimport { DataSeedDispatcherBackendService } from '~wildo-backend-lib/data-seeding/services/data-seed-dispatcher.backend.service';\nimport { DataSeedingAdminBackendController } from '~wildo-backend-lib/data-seeding/controllers/data-seeding-admin.backend.controller';\nimport { EmailTemplateRegistryBackendService } from '~wildo-backend-lib/notifications/email/services/email-template-registry.backend.service';\nimport type { EmailTemplateDefinitionsMap } from '~wildo-backend-lib/notifications/email/models/email-template-definition';\nimport { BillingStateBackendService } from '~wildo-backend-lib/billing/services/back-office/billing-state.backend.service';\nimport { resolveFeatureGatedCoreResourceExclusions } from '~wildo-backend-lib/runtime/utils/feature-gated-core-resource-exclusions.backend.utils';\nimport { resolveApplicationConfigForStartup } from '~wildo-backend-lib/runtime/utils/application-startup-config-access.backend.utils';\n\n\n\n/**\n * Configuration object for {@link StartApplicationBackendService.initialize}.\n *\n * Groups the 25+ positional parameters into a single typed config,\n * preventing silent mis-ordering bugs (e.g. `customLabels` passed as `undefined`\n * at the wrong positional slot).\n */\nexport interface ApplicationInitializationConfig {\n sharedResourceConfigurations: ResourceConfiguration_InitializationFactoryMap;\n sharedResourceFieldIdentifiers?: Record<string, string>;\n sharedResourceRelationships: ResourceRelationship[];\n\n backendResourceConfigurations?: ResourceConfiguration_InitializationFactoryMap;\n backendResourceFieldIdentifiers?: Record<string, string>;\n backendResourceRelationships?: ResourceRelationship[];\n\n /**\n * App-declared notification badge definitions (merged with the framework's\n * `coreNotificationBadgeDefinitions` in the registry). DERIVED_QUERY badges\n * are recomputed by the dispatcher on source-resource mutations + on connect.\n */\n notificationBadgeDefinitions?: NotificationBadgeDefinition[];\n\n /**\n * Resources this application narrows by ORGANIZATION UNIT, keyed by resource type.\n *\n * assurance-control: WILDO.ACCESS.LEAST_PRIVILEGE — least-privilege confinement of a\n * unit-scoped principal to the records of their unit.\n *\n * Naming a resource here admits a caller whose authority for it comes ONLY from an organization\n * unit grant, and then confines every read and write to the rows of the units that grant covers.\n * ADDITIVE: a caller whose organization-wide role already satisfies the operation is not narrowed\n * at all, so opting a resource in can never shrink a result set someone could already see.\n *\n * `unitFieldName` must name a real field on that resource's schema holding the owning\n * `ORGANIZATION_UNITS` id. The authorization plane (membership, unit membership, units themselves,\n * and roles-bearing machine credentials) may never be declared here — startup fails closed if it\n * is, because a resource that ISSUES authority must not be governed by the authority it issues.\n */\n organizationUnitNarrowing?: Readonly<Partial<Record<string, OrganizationUnitNarrowingDeclaration>>>;\n\n customServiceImplementations: ResourceCustomServiceImplementationFactory[];\n\n\n customRoles?: RolesConfiguration;\n customControllers?: AbstractControllerBackendService[];\n container?: any;\n controllerWhiteList?: string[];\n isPlatformApplication?: boolean;\n /**\n * PLATFORM MODE ONLY (refused otherwise): the persistence adapter the platform service's OWN\n * resources are built on. Platform startups hydrate `AppConfigurationService` AFTER\n * `super.initialize()`, so the normal config-driven adapter resolution cannot see their choice\n * at repository-construction time — this passes the answer the platform already holds from its\n * Phase-1 bridged config. See `RepositoriesRegistryHandlerBackendService.platformModeDefaultAdapter`\n * for the full ordering rationale (Phase 5.2, D7). Non-platform applications declare their\n * adapter in application config (`DATABASE_DEFAULT_ADAPTER`); a second knob here would smuggle\n * the decision past that contract, which is why passing it without `isPlatformApplication`\n * throws.\n */\n platformPersistenceAdapter?: PersistenceAdapterType;\n\n customBatchesFactory?: (deps: {\n logger: LoggerService;\n errorBuilder: ErrorBuilderBackendService;\n errorHandler: ErrorHandlerService;\n executionContextCreatorService: ExecutionContextCreatorBackendService;\n resourcesRegistryService: ResourcesRegistryBackendService;\n repositoriesRegistryService: RepositoriesRegistryHandlerBackendService;\n servicesRegistryService: ServicesRegistryHandlerBackendService;\n }) => Map<string, BatchesCronjobsCustomExecution_Service<any, any>>;\n\n flowsActorsRegistry?: {\n flowActorSystemsFactoryMap?: FlowActorSystem_InitializationFactoryMap;\n agents?: FlowsActors_Agent[];\n functionTools?: FunctionTool[];\n };\n\n /**\n * App-declared NAMED external resource-server instances (R-2): multiple MCP servers and/or A2A\n * agents, each served at its own URL segment with its own RFC 8707 audience, discovery document,\n * and curated content (MCP tools via `operation.mcp.servers`; A2A skills via `actorSystemRefs`).\n *\n * Purely ADDITIVE — the unnamed default `/mcp` and `/a2a` surfaces always exist and are not\n * declared here. Membership refs are validated against the resource + actor-system registries at\n * startup, so a ref typo is a startup failure rather than a silently-empty surface.\n */\n resourceServerInstances?: ResourceServerInstance[];\n\n customLabels?: CustomLabelsMap;\n backendProviderRegistry?: BackendProviderRegistry;\n\n customFeatureDefinitions?: FeatureDefinitionWithAutoRegister[];\n customFeatureConfiguration?: {\n profiles?: Record<string, ScopeFeatures>;\n defaultProfile?: string;\n unavailabilityPolicy?: Partial<FeatureConfiguration['unavailabilityPolicy']>;\n };\n\n chartDefinitions?: ChartDefinition[];\n customMilestoneDefinitions?: MilestoneDefinition[];\n customMilestoneConditions?: Array<{ ref: string; fn: MilestoneConditionFn }>;\n productDefinitions?: ProductDefinition[];\n emailTemplateDefinitions?: EmailTemplateDefinitionsMap;\n /** Generated provider topology module imported by the application package. */\n providerRuntime?: ProviderRuntimeArtifact;\n /**\n * Backend-only generated PDF template bindings.\n *\n * Shared `z_file({ generation })` metadata carries only a stable\n * `templateId` because resource schemas are consumed by frontend,\n * specification, and companion surfaces. The live React-PDF template object\n * stays here, in backend startup configuration, and is validated against the\n * already-initialized resource registry before services/controllers accept\n * traffic.\n */\n pdfTemplateBindings?: PdfTemplateBindingsMap;\n backendConfig?: AppConfiguration_BackendAuthored;\n guidanceFlowDefinitions?: GuidanceFlowDefinition[];\n\n /**\n * Declarative data-seed definitions collected from `BackendDomainModule.seeds`.\n *\n * Consumed by the `DataSeedRegistry` / `DataSeedDispatcher` to run\n * application-lifecycle seeds at boot (Step 7.7) and resource-lifecycle /\n * lazy seeds at request time. See `.cursor/plans/seeding-first-class.md`.\n */\n dataSeeds?: DataSeedDefinition[];\n\n /**\n * Phase 7 / Item 47 (cron scheduler) — Slice 3.\n *\n * Custom scope-iteration callbacks aggregated from each module's\n * `BackendDomainModule.dataSeedScopeResolvers`. Forwarded to\n * `runDataSeedingApplicationBootstrap`, which calls\n * `DataSeedScopeResolverRegistryBackendService.registerResolvers` once\n * per boot.\n *\n * Cron seeds with `schedule.iterationStrategy === CUSTOM_RESOLVER`\n * resolve their `relatedId` rows via the resolver registered under the\n * matching `customResolverKey`.\n */\n dataSeedScopeResolvers?: Record<string, DataSeedScopeResolver>;\n\n /**\n * WHICH RUNTIME is booting this lifecycle, which determines which boot\n * ASSERTIONS apply. Defaults to\n * {@link ApplicationRuntimeProfile.APPLICATION_BACKEND}, so a host that does\n * not declare a profile is over-validated rather than under-validated.\n *\n * Distinct from {@link headlessMode} and its siblings: those control which\n * subsystems START, this controls which DECLARATION CLASSES are asserted to\n * be complete. See `application-runtime-profile.backend.ts`.\n */\n runtimeProfile?: ApplicationRuntimeProfile;\n /** Skip HTTP server initialization (used by apps-manager for E2E testing) */\n headlessMode?: boolean;\n /** Skip cron-job sync for non-HTTP runtimes like minions. */\n skipCronSync?: boolean;\n /**\n * Skip the shared application job consumers for runtimes that connect to\n * RabbitMQ only for their own dedicated topology (default: `false`).\n *\n * The canonical opt-in is a `BackgroundRuntimeType.MINION`: it reuses the\n * full backend startup lifecycle but must consume ONLY its own\n * `minion-tick.<name>` queue, never the shared operations/scheduled/callbacks\n * queues. When `true`, the queue-worker initializer still connects to the\n * broker (the minion's tick consumer needs that connection) but does NOT run\n * `jobConsumer.startConsuming()` — otherwise RabbitMQ would round-robin each\n * scheduled-cron tick between the backend-api pod and the minion, and the\n * minion would dead-letter every tick it cannot interpret (~50% loss).\n *\n * Sibling of {@link skipCronSync}; both default `false` so backend-api is\n * unaffected. Never set on the primary backend-api runtime.\n */\n skipJobConsumers?: boolean;\n /**\n * Runtime-specific decorator hook for the services registry.\n *\n * Used by the minion kernel to install resource-access enforcement without\n * changing the backend-api DI graph.\n */\n servicesRegistryDecoratorFactory?: (\n registry: ServicesRegistryHandlerBackendService,\n context: {\n appConfig: AppConfiguration;\n errorBuilder: ErrorBuilderBackendService;\n },\n ) => ServicesRegistryHandlerBackendService;\n /**\n * Runtime-specific hook that runs immediately after the resource catalog is\n * initialized and before downstream registries (services, flows/actors, controllers)\n * are installed.\n *\n * Minion startup uses this to cross-validate its `resourceAccess` whitelist\n * against the live application resource catalog.\n */\n afterResourcesRegistryInitialized?: (context: {\n appConfig: AppConfiguration;\n resourcesRegistryService: ResourcesRegistryBackendService;\n errorBuilder: ErrorBuilderBackendService;\n }) => Promise<void> | void;\n\n /**\n * Caller-supplied `<scope>.<name>` identifier for THIS backend process.\n * Runtime provider selection is now expected to come from materialized\n * provider-scope artifacts. Examples:\n * - `'services.backend-api'` for a regular backend service\n * - `'minions.marketingScrapper'` for a minion process\n * - `'workers.myRustWorker'` for a worker process\n *\n * Each app's bootstrap (`index.ts`) is responsible for choosing\n * the correct value. The current runtime keeps the field so the\n * materializer can bind the process to its provider scope without\n * inferring from `SERVICE_NAME`.\n */\n serviceIdentifier?: string;\n}\n\n/**\n * Start Application Backend Service\n *\n * Orchestrates the initialization of the backend application by:\n * 1. Initializing application configuration\n * 1.5. Initializing roles configuration (defaults + custom roles)\n * 2. Initializing resources registry with all 4 sources\n * 3. Initializing repositories registry with mongoose models\n * 4. Initializing services registry with business logic layer\n * 5. Initializing controllers registry with HTTP endpoints layer\n * 6. Initializing HTTP server with Express.js and middleware\n * 7. Validating all components are properly initialized\n *\n * This service ensures proper startup sequence and dependency management.\n */\n\n/** @wildo_source:part:start saas.backend.billing.resolution-failure-reasons facet:layer:backend facet:family:billing */\n/**\n * Why billing-provider resolution failed at startup. Each reason maps 1:1 to a\n * DISTINCT config surface an app author must fix, so `billing.enabled: true`\n * that cannot resolve a provider fails LOUD with an actionable message instead\n * of the historical catch-all (\"set providerRef + its secret\") that misdirected\n * authors to the secret when the real gap was backend-scope authoring.\n *\n * Read this as a debugging map — the fatal startup message names the surface,\n * and each reason below is the surface:\n * - PROVIDER_REF_UNSET → `billing.providerRef` in `./backend-api/src/saas-config.backend.ts`\n * - PROVIDER_NOT_REACHABLE_ON_BACKEND → author the ref under `providers.scopes.backend` in `./wildo.saas.config.ts` + a matching backend contribution in `./backend-api/src/provider-contributions.ts` (the classic trap: authored only in a frontend scope), then `wildo config sync`\n * - PROVIDER_DISABLED → the ref resolves but is disabled for the BILLING protocol in external-provider config\n * - SECRET_MISSING → the env var named by the provider's `secretRef` is absent from the per-env `providerEnv` secrets\n * - RESOLUTION_ERROR → the provider threw while resolving (registry / billing-SDK fault)\n */\nenum BillingProviderResolutionFailureReason {\n /** `billing.enabled` is true but `billing.providerRef` is unset. */\n PROVIDER_REF_UNSET = 'provider-ref-unset',\n /**\n * `providerRef` is set, but no billing runtime contract is exposed to the\n * backend registry for it — the provider is not authored in\n * `providers.scopes.backend` (a common trap: it is authored only in a\n * frontend scope) and/or has no matching backend runtime-owner\n * contribution. The provider is filtered out of the active catalog.\n */\n PROVIDER_NOT_REACHABLE_ON_BACKEND = 'provider-not-reachable-on-backend',\n /** The provider resolves but is disabled by external-provider configuration. */\n PROVIDER_DISABLED = 'provider-disabled',\n /** The provider resolves but its secret (env var `secretRef`) is absent. */\n SECRET_MISSING = 'secret-missing',\n /** An unexpected error was thrown while resolving (registry/SDK fault). */\n RESOLUTION_ERROR = 'resolution-error',\n}\n/** @wildo_source:part:end saas.backend.billing.resolution-failure-reasons */\n\n/**\n * Discriminated result of {@link StartApplicationBackendService.resolveBillingProvider}.\n * A `null` provider always carries a `reason` (and optional `detail`) so the\n * caller can build a surface-specific error instead of a generic one.\n */\ntype BillingProviderResolution =\n | { provider: StandardBilling_Interface; reason?: undefined; detail?: undefined }\n | { provider: null; reason: BillingProviderResolutionFailureReason; detail?: string };\n\n/**\n * Build the fatal startup message for a failed billing-provider resolution,\n * routed by {@link BillingProviderResolutionFailureReason} to the SPECIFIC\n * config surface the operator must fix. Historically this was a single\n * catch-all (\"set providerRef + its secret\"), which misdirected operators\n * whenever the real gap was backend-scope authoring (providerRef + secret\n * both present, provider simply not exposed to the backend runtime).\n *\n * Every branch names the file/field to edit and the follow-up command\n * (`wildo config sync`) so the message is actionable without reading source.\n */\nfunction describeBillingProviderResolutionFailure(\n reason: BillingProviderResolutionFailureReason,\n billingConfig: BillingConfiguration,\n detail?: string,\n): string {\n const providerRef = billingConfig.providerRef ?? '(unset)';\n const prefix = 'billing.enabled is true but the billing provider could not be resolved.';\n const disableHint = 'Alternatively set billing.enabled=false to run without billing.';\n\n switch (reason) {\n case BillingProviderResolutionFailureReason.PROVIDER_REF_UNSET:\n return `${prefix} billing.providerRef is unset — set it (e.g. 'stripe') in your `\n + `backend app config (saas-config.backend.ts → billing.providerRef). ${disableHint}`;\n\n case BillingProviderResolutionFailureReason.PROVIDER_NOT_REACHABLE_ON_BACKEND:\n return `${prefix} providerRef='${providerRef}' is set, but that provider is not exposed `\n + `to the BACKEND runtime, so no billing runtime contract could be loaded. A common `\n + `cause is authoring the provider only in a frontend scope. Fix: author '${providerRef}' `\n + `under providers.scopes.backend in wildo.saas.config.ts AND add a matching backend `\n + `contribution (runtimeTargets [{ kind: 'backend' }], protocols ['BILLING_PROVIDER', `\n + `'WEBHOOK_ORIGINATOR']) in the backend package's provider-contributions, then re-run `\n + `\\`wildo config sync\\` to regenerate the provider runtime artifact. ${disableHint}`;\n\n case BillingProviderResolutionFailureReason.PROVIDER_DISABLED:\n return `${prefix} providerRef='${providerRef}' resolves but is disabled by external-provider `\n + `configuration for the BILLING protocol. Enable it for this environment, then re-run `\n + `\\`wildo config sync\\`. ${disableHint}`;\n\n case BillingProviderResolutionFailureReason.SECRET_MISSING:\n return `${prefix} providerRef='${providerRef}' resolves but its secret `\n + `(env var '${detail ?? 'UNKNOWN'}') is missing. Populate it in your per-env secrets `\n + `(providerEnv) and re-run \\`wildo config sync\\` so it lands in the backend .env. ${disableHint}`;\n\n case BillingProviderResolutionFailureReason.RESOLUTION_ERROR:\n return `${prefix} providerRef='${providerRef}' threw while resolving`\n + `${detail ? `: ${detail}` : ''}. Inspect the backend provider registry / billing SDK `\n + `wiring. ${disableHint}`;\n\n default: {\n // Exhaustiveness guard: adding a new reason without a message\n // branch fails the type-check here rather than shipping a blank\n // fatal at runtime.\n const _exhaustive: never = reason;\n return `${prefix} providerRef='${providerRef}' (${String(_exhaustive)}). ${disableHint}`;\n }\n }\n}\n\n@injectable()\nexport class StartApplicationBackendService {\n /**\n * The profile this runtime booted under. Defaults FAIL-SAFE to `APPLICATION_BACKEND` — the\n * profile that asserts and reports the most — so a host that never declares one is never\n * silently exempted from a check it should run.\n */\n private resolvedRuntimeProfile: ApplicationRuntimeProfile = ApplicationRuntimeProfile.APPLICATION_BACKEND;\n\n protected logDebug: (message: string, context?: Record<string, unknown>) => void;\n protected isInitialized = false;\n private isPlatformMode = false;\n\n constructor(\n @inject(SAAS_SERVICE_TYPES.Logger) protected readonly logger: LoggerService,\n @inject(SAAS_SERVICE_TYPES.AppConfigService) protected readonly appConfigService: AppConfigurationService,\n @inject(SAAS_SERVICE_TYPES.ApplicationStartupConfigValidatorService) protected readonly applicationStartupConfigValidator: ApplicationStartupConfigValidatorService,\n @inject(SAAS_SERVICE_TYPES.ResourceRegistryService) protected readonly resourcesRegistryService: ResourcesRegistryBackendService,\n @inject(SAAS_SERVICE_TYPES.RepositoriesRegistryHandlerService) protected readonly repositoriesRegistryService: RepositoriesRegistryHandlerBackendService,\n @inject(SAAS_SERVICE_TYPES.ServicesRegistryHandlerService) protected servicesRegistryService: ServicesRegistryHandlerBackendService,\n @inject(SAAS_SERVICE_TYPES.ControllersRegistryHandlerService) protected readonly controllersRegistryService: ControllersRegistryHandlerBackendService,\n @inject(SAAS_SERVICE_TYPES.HttpServerService) protected readonly httpServerService: HttpServerBackendService,\n @inject(SAAS_SERVICE_TYPES.ErrorBuilderService) protected readonly errorBuilder: ErrorBuilderBackendService,\n @inject(SAAS_SERVICE_TYPES.ErrorHandlerService) protected readonly errorHandler: ErrorHandlerService,\n @inject(SAAS_SERVICE_TYPES.AuthorizationsService) protected readonly authorizationsService: AuthorizationsBackendService,\n @inject(SAAS_SERVICE_TYPES.BatchesCronjobsExecutorService) protected readonly batchesExecutor: BatchesCronjobsExecutor_BackendService,\n @inject(SAAS_SERVICE_TYPES.ExecutionContextCreatorBackendService) protected readonly executionContextCreatorBackendService: ExecutionContextCreatorBackendService,\n @inject(SAAS_SERVICE_TYPES.ResourceOperationCustomImplementationRegistryService) protected readonly customImplRegistry: ResourceOperationCustomImplementationRegistryBackendService,\n @inject(SAAS_SERVICE_TYPES.MongoDBService) protected readonly mongoDBService: MongoDBService,\n @inject(SAAS_SERVICE_TYPES.RedisService) protected readonly redisService: RedisService,\n @inject(SAAS_SERVICE_TYPES.I18nService) protected readonly i18nService: I18nBackendService,\n @inject(SAAS_SERVICE_TYPES.BackendProviderRegistryService) protected readonly backendProviderRegistryService: BackendProviderRegistryBackendService,\n @inject(SAAS_SERVICE_TYPES.ExternalProvidersRegistryService) protected readonly externalProvidersRegistryService: ExternalProvidersRegistryBackendService,\n @inject(SAAS_SERVICE_TYPES.FeatureDefinitionRegistryService) protected readonly featureDefinitionRegistryService: FeatureDefinitionRegistryBackendService,\n @inject(SAAS_SERVICE_TYPES.MilestoneDefinitionRegistry) protected readonly milestoneDefinitionRegistry: MilestoneDefinitionRegistryBackendService,\n @inject(SAAS_SERVICE_TYPES.MilestoneConditionRegistry) protected readonly milestoneConditionRegistry: MilestoneConditionRegistryBackendService,\n @inject(SAAS_SERVICE_TYPES.LifecycleEvaluator) protected readonly lifecycleEvaluator: LifecycleEvaluatorBackendService,\n @inject(SAAS_SERVICE_TYPES.FlowsActorsRegistryService) protected readonly flowsActorsRegistryService: FlowsActorsRegistryService,\n @inject(SAAS_SERVICE_TYPES.ResourceServerInstancesRegistry) protected readonly resourceServerInstancesRegistry: ResourceServerInstancesRegistryBackendService,\n @inject(SAAS_SERVICE_TYPES.QueueWorkerInitializerService) protected readonly queueWorkerInitializer: QueueWorkerInitializerBackendService,\n @inject(SAAS_SERVICE_TYPES.CronJobSyncService) protected readonly cronJobSyncService: CronJobSyncBackendService,\n @inject(SAAS_SERVICE_TYPES.ChartRegistryService) protected readonly chartRegistryService: ChartRegistryBackendService,\n @inject(SAAS_SERVICE_TYPES.GuidanceTriggerEvaluator) protected readonly guidanceTriggerEvaluator: GuidanceTriggerEvaluatorBackendService,\n @inject(SAAS_SERVICE_TYPES.EmailTemplateRegistry) protected readonly emailTemplateRegistryService: EmailTemplateRegistryBackendService,\n @inject(SAAS_SERVICE_TYPES.PdfTemplateBinding) protected readonly pdfTemplateBindingService: PdfTemplateBindingBackendService,\n @inject(SAAS_SERVICE_TYPES.FileStorageRouter) protected readonly fileStorageRouter: FileStorageRouterBackendService,\n // Phase 2.F — data-seeding subsystem. Registry stays inert until\n // Step 7.7 calls `registerSeeds(config.dataSeeds ?? [])`; dispatcher\n // is invoked from the same step (and later from Level-B hooks /\n // lazy-access — Phases 3 / 5).\n @inject(SAAS_SERVICE_TYPES.DataSeedRegistry) protected readonly dataSeedRegistryService: DataSeedRegistryBackendService,\n @inject(SAAS_SERVICE_TYPES.DataSeedDispatcher) protected readonly dataSeedDispatcherService: DataSeedDispatcherBackendService,\n // Phase 7 / Item 47 (Slice 3) — cron CUSTOM_RESOLVER registry. Same\n // boot lifecycle as `dataSeedRegistryService`: hydrated once in Step\n // 7.7 from `ApplicationInitializationConfig.dataSeedScopeResolvers`.\n @inject(SAAS_SERVICE_TYPES.DataSeedScopeResolverRegistry) protected readonly dataSeedScopeResolverRegistryService: DataSeedScopeResolverRegistryBackendService,\n // Slice 2 Phase 4 — observability reconcile + graceful-flush wiring. Appended LAST on\n // PURPOSE: `StartApplicationBackendService` has platform subclasses with FORWARDING\n // constructors that spread a positional `super([...])` array (see\n // `start-application.apps-manager.platform.service.ts` and `...registry.platform.service.ts`).\n // Inserting a param mid-list shifts every later arg and mis-injects them — it crashed the\n // apps-manager with \"featureDefinitionRegistryService.registerCoreFeatures is not a function\".\n // Appending keeps those subclasses aligned (they don't forward this last arg → it is\n // `undefined` there, which is HARMLESS because the reconcile call is gated on\n // `!isPlatformApplication`). Wonder-todos uses this class directly, so Inversify injects it\n // by symbol regardless of position. Optional type + `?.` call site reflect the platform case.\n @inject(SAAS_SERVICE_TYPES.ObservabilityBackendService) protected readonly observabilityBackendService?: ObservabilityBackendService,\n // APPENDED for the same subclass-forwarding reason as `observabilityBackendService` above:\n // subclasses that do not forward this arg receive `undefined`, which is harmless here — the\n // super-administrator floor REPORT degrades to a log-only finding when no audit sink is\n // bound, and the report is non-fatal by design either way.\n @inject(SAAS_SERVICE_TYPES.AuditLogsService) @optional() protected readonly auditLogsService?: AuditLogsBackendService,\n // Appended LAST (platform-subclass forwarding, as above). The organization-owner floor REPORT\n // builds its own whole-estate measuring context from this factory; a platform subclass that does\n // not forward it receives `undefined`, which is harmless — `reportOrganizationOwnerFloor` skips\n // when it is absent, and platform mode runs no tenant population anyway.\n @inject(SAAS_SERVICE_TYPES.AuthExecutionContextFactory) @optional()\n protected readonly authExecutionContextFactory?: AuthExecutionContextFactoryBackendService,\n // Appended for the same platform-subclass compatibility reason as the optional services above.\n ) {\n this.logger = logger;\n this.appConfigService = appConfigService;\n this.resourcesRegistryService = resourcesRegistryService;\n this.repositoriesRegistryService = repositoriesRegistryService;\n this.servicesRegistryService = servicesRegistryService;\n this.controllersRegistryService = controllersRegistryService;\n this.httpServerService = httpServerService;\n this.authorizationsService = authorizationsService;\n\n this.logDebug = this.logger.debugByType('StartApplicationBackendService');\n this.logger.setDebugTypeLogging('StartApplicationBackendService', false);\n\n this.logDebug('Start application service created');\n }\n\n /**\n * Initialize the backend application with a structured configuration object.\n */\n public async initialize(config: ApplicationInitializationConfig): Promise<void> {\n\n if (this.isInitialized) {\n this.logDebug('Application already initialized, skipping');\n return;\n }\n\n const {\n sharedResourceConfigurations,\n sharedResourceFieldIdentifiers,\n sharedResourceRelationships,\n backendResourceConfigurations,\n backendResourceFieldIdentifiers,\n backendResourceRelationships = [],\n notificationBadgeDefinitions,\n organizationUnitNarrowing,\n resourceServerInstances,\n customServiceImplementations,\n customRoles,\n customControllers,\n container,\n controllerWhiteList,\n isPlatformApplication = false,\n platformPersistenceAdapter,\n customBatchesFactory,\n flowsActorsRegistry,\n customLabels,\n backendProviderRegistry,\n customFeatureDefinitions,\n customFeatureConfiguration,\n chartDefinitions,\n customMilestoneDefinitions,\n customMilestoneConditions,\n productDefinitions,\n emailTemplateDefinitions,\n providerRuntime,\n pdfTemplateBindings,\n backendConfig,\n guidanceFlowDefinitions,\n dataSeeds,\n dataSeedScopeResolvers,\n runtimeProfile = ApplicationRuntimeProfile.APPLICATION_BACKEND,\n headlessMode = false,\n skipCronSync = false,\n skipJobConsumers = false,\n servicesRegistryDecoratorFactory,\n afterResourcesRegistryInitialized,\n } = config;\n\n // Resolved ONCE, here, so every gated validator below reads the same\n // decision. Resolving per-call-site would let two validators disagree\n // about the runtime they are validating.\n const bootAssertions = resolveApplicationRuntimeProfileBootAssertions(runtimeProfile);\n /**\n * Kept on the instance so LATER boot steps can consult the same profile this method resolved.\n * Boot steps run as separate methods, and one that has to re-derive the profile is one that\n * can derive it differently — the assertions exist precisely so every step reads one answer.\n */\n this.resolvedRuntimeProfile = runtimeProfile;\n\n try {\n this.logDebug('🚀 Starting backend application initialization...');\n // Step 1: Initialize application configuration\n this.logDebug('📋 Initializing application configuration...');\n\n // Persist platform mode for validation differences\n this.isPlatformMode = !!isPlatformApplication;\n\n if(!isPlatformApplication) {\n await this.appConfigService.initialize();\n if (providerRuntime) {\n this.appConfigService.applyProviderRuntime(providerRuntime);\n }\n this.appConfigService.applyBackendConfig(backendConfig ?? {});\n if (backendConfig) {\n this.logger.info('Backend config applied', {\n sections: Object.keys(backendConfig),\n });\n }\n this.appConfigService.assertNoPreOverridePlaceholders();\n this.logDebug('✅ Application configuration initialized successfully');\n /**\n * Establish the default MongoDB connection — ONLY when this application has a\n * MongoDB to connect to.\n *\n * The loader builds `database.mongodb` only when the environment supplies\n * `MONGODB_HOST`, so its ABSENCE is the application saying it has no MongoDB. Until\n * 2026-08-28 this connect was unconditional and rethrowing, which made a mongod a\n * hard boot requirement for every application — including one whose every resource\n * is on PostgreSQL.\n *\n * Contrast the two blocks immediately below: Redis degrades to in-memory with a\n * warning, and file storage is explicitly non-fatal. MongoDB was the only backing\n * service that could refuse a boot by being absent rather than by being broken.\n *\n * It stays FATAL when a MongoDB IS declared and the connection fails — that is a\n * real outage and must not be softened into a warning.\n */\n if (this.appConfigService.config.database?.mongodb) {\n try {\n await this.mongoDBService.connect();\n this.logDebug('✅ MongoDB default connection established');\n } catch (e) {\n this.logger.error('❌ MongoDB default connection failed', e as any);\n throw e;\n }\n } else {\n this.logDebug('↷ No MongoDB configured for this application — skipping the default connection.');\n }\n // Establish Redis connection for caching, sessions, and WebSocket sync\n // Redis is optional - graceful fallback to in-memory if unavailable\n try {\n await this.redisService.connect();\n this.logDebug('✅ Redis connection established');\n } catch (e) {\n this.logger.warn('⚠️ Redis connection failed, using in-memory fallbacks', { ...projectCaughtErrorLogFields(e) });\n }\n\n // Initialize file storage (MinIO/S3) — optional, skipped when not configured\n if (this.fileStorageRouter.isConfigured()) {\n try {\n await this.fileStorageRouter.initialize();\n this.logDebug('✅ File storage initialized');\n } catch (e) {\n // Non-fatal AND not final. An application backend fetches short-lived storage\n // credentials from apps-manager, so a backend that boots BEFORE its issuer is\n // listening fails here with ECONNREFUSED through no fault of its own — an\n // ordinary outcome of concurrent respawn.\n //\n // `WildoManagedStorageProvider.healthCheck()` retries acquisition on every\n // readiness probe, so this clears WITHOUT a restart once the issuer is up\n // (proven live on a platform service 2026-08-13: same PID, monotonic uptime,\n // unhealthy → healthy). The previous wording — \"file operations will fail at\n // runtime\" — described the behaviour before that recovery existed, and now\n // sends whoever greps this log hunting a defect that will have fixed itself.\n this.logger.warn('⚠️ File storage initialization failed at startup — will retry on each readiness probe', { ...projectCaughtErrorLogFields(e) });\n }\n } else {\n this.logDebug('📦 File storage not configured, skipping initialization');\n }\n }\n\n // This is the only application-config read allowed before the\n // platform subclass hydrates AppConfigurationService. The helper\n // branches before evaluating the throwing getter, then every\n // startup decision below consumes this resolved boundary value.\n const applicationConfig = resolveApplicationConfigForStartup(this.appConfigService, isPlatformApplication);\n\n if (applicationConfig) {\n this.applicationStartupConfigValidator.validate(applicationConfig);\n }\n\n // Step 1.5: Initialize roles configuration\n this.logDebug('🔐 Initializing roles configuration...');\n if (customRoles) {\n this.authorizationsService.initializeRolesWithCustom(customRoles);\n this.logDebug('✅ Roles configuration initialized with custom roles');\n } else {\n // Roles are already initialized with defaults in the constructor\n this.logDebug('✅ Roles configuration using default roles only');\n }\n\n // Step 2: Initialize resources registry with all 4 sources\n this.logDebug('🔧 Initializing resources registry...');\n\n // Read lifecycle config early — needed for both resource exclusion and evaluator init\n // Platform apps don't use lifecycle, billing, or feature gating\n const lifecycleConfig: LifecycleConfig | undefined = applicationConfig?.lifecycle;\n\n // Compute excluded resource types based on app configuration.\n // When billing/lifecycle is disabled, their resource types are excluded\n // from the registry (no routes, no repositories, no frontend resources).\n // When billing IS enabled, scope variants for scopes not in enabledScopes\n // are also excluded (e.g., USER variants when only ORG billing is enabled).\n const excludedResourceTypes = resolveFeatureGatedCoreResourceExclusions(\n applicationConfig,\n { isPlatformApplication },\n );\n\n if (excludedResourceTypes) {\n this.logDebug(`Feature-gated resources excluded: ${excludedResourceTypes.size} types`, {\n billingDisabled: !applicationConfig?.billing?.enabled,\n billingDisabledScopes: (() => {\n const billingConfig = applicationConfig?.billing;\n if (!billingConfig?.enabled) return 'all';\n const enabledSet = new Set<string>(billingConfig.enabledScopes ?? []);\n return BILLING_SCOPES.filter(s => !enabledSet.has(s));\n })(),\n lifecycleDisabled: !lifecycleConfig?.enabled,\n });\n }\n\n await this.resourcesRegistryService.initialize(\n sharedResourceConfigurations,\n sharedResourceFieldIdentifiers,\n sharedResourceRelationships,\n (backendResourceConfigurations ?? {}) as ResourceConfiguration_InitializationFactoryMap,\n backendResourceFieldIdentifiers,\n backendResourceRelationships,\n notificationBadgeDefinitions,\n undefined, // customAdditionalUserNotificationDefinitions\n excludedResourceTypes,\n organizationUnitNarrowing,\n );\n this.logDebug('✅ Resources registry initialized successfully');\n if (applicationConfig && afterResourcesRegistryInitialized) {\n await afterResourcesRegistryInitialized({\n appConfig: applicationConfig,\n resourcesRegistryService: this.resourcesRegistryService,\n errorBuilder: this.errorBuilder,\n });\n this.logDebug('✅ Runtime-specific resource-catalog hook completed');\n }\n\n this.pdfTemplateBindingService.initialize(pdfTemplateBindings ?? {}, {\n assertCompleteness: bootAssertions.assertsGeneratedPdfBindingCompleteness,\n });\n this.logDebug('✅ PDF template bindings initialized successfully');\n\n // Step 2.0.1: Initialize feature definition registry\n this.logDebug('🏷️ Initializing feature definition registry...');\n this.featureDefinitionRegistryService.registerCoreFeatures();\n if (customFeatureDefinitions && customFeatureDefinitions.length > 0) {\n this.featureDefinitionRegistryService.registerCustomFeatures(customFeatureDefinitions);\n }\n this.featureDefinitionRegistryService.validateDefinitions();\n this.featureDefinitionRegistryService.logStartupSummary();\n\n // Build and set the merged FeatureConfiguration (profiles + policy)\n if (customFeatureConfiguration) {\n const allDefinitions = this.featureDefinitionRegistryService.getAllDefinitions();\n this.featureDefinitionRegistryService.setConfiguration({\n definitions: allDefinitions,\n profiles: customFeatureConfiguration.profiles ?? {},\n defaultProfile: customFeatureConfiguration.defaultProfile,\n unavailabilityPolicy: {\n defaultBehavior: customFeatureConfiguration.unavailabilityPolicy?.defaultBehavior ?? FeatureUnavailabilityBehavior.UPGRADE_PROMPT,\n whenBillingDisabled: customFeatureConfiguration.unavailabilityPolicy?.whenBillingDisabled ?? FeatureUnavailabilityBehavior.HIDE,\n roleDefaults: customFeatureConfiguration.unavailabilityPolicy?.roleDefaults ?? {},\n reasonDefaults: customFeatureConfiguration.unavailabilityPolicy?.reasonDefaults ?? {\n [FeatureUnavailabilityReason.FEATURE_NOT_ENABLED]: FeatureUnavailabilityBehavior.UPGRADE_PROMPT,\n [FeatureUnavailabilityReason.LIMIT_EXCEEDED]: FeatureUnavailabilityBehavior.LIMIT_UPGRADE_PROMPT,\n [FeatureUnavailabilityReason.NOT_CONFIGURED]: FeatureUnavailabilityBehavior.HIDE,\n },\n },\n });\n this.logDebug('✅ Feature configuration set (profiles + unavailability policy)');\n }\n const analyticsValueMoments = applicationConfig?.analytics?.valueMoments;\n\n this.featureDefinitionRegistryService.warnMisplacedLimitFeatures();\n this.featureDefinitionRegistryService.warnInvalidFeatureReferences({\n featureProfiles: customFeatureConfiguration?.profiles,\n chartDefinitions,\n guidanceFlowDefinitions,\n productDefinitions,\n analyticsValueMoments,\n });\n this.logDebug('✅ Feature definition registry initialized successfully');\n\n // Step 2.0.2: Initialize milestone definition registry\n this.logDebug('🏅 Initializing milestone definition registry...');\n if (customMilestoneConditions && customMilestoneConditions.length > 0) {\n for (const { ref, fn } of customMilestoneConditions) {\n this.milestoneConditionRegistry.registerCondition(ref, fn);\n }\n this.logDebug(`Registered ${customMilestoneConditions.length} custom milestone condition(s)`);\n }\n if (customMilestoneDefinitions && customMilestoneDefinitions.length > 0) {\n this.milestoneDefinitionRegistry.registerCustomMilestones(customMilestoneDefinitions);\n this.milestoneDefinitionRegistry.validateDefinitions();\n this.milestoneDefinitionRegistry.logStartupSummary();\n }\n this.logDebug('✅ Milestone definition registry initialized successfully');\n\n // Step 2.0.3: Initialize lifecycle evaluator configuration\n if (!isPlatformApplication && lifecycleConfig?.enabled) {\n this.logDebug('🔄 Initializing lifecycle evaluator...');\n this.lifecycleEvaluator.setLifecycleConfig(lifecycleConfig);\n\n // Late-binding initialization for lifecycle custom implementations\n initializeLifecycleCustomImplementations(this.lifecycleEvaluator, lifecycleConfig, this.errorBuilder);\n\n // Validate activation criteria refs against registries\n if (lifecycleConfig.activationCriteria?.criteria) {\n for (const criterion of lifecycleConfig.activationCriteria.criteria) {\n if (criterion.criterionType === ActivationCriterionType.MILESTONE) {\n const exists = !!this.milestoneDefinitionRegistry.getDefinition(criterion.milestoneRef);\n if (!exists) {\n this.logger.warn(`Lifecycle activation criterion references unknown milestone: '${criterion.milestoneRef}'`);\n }\n } else if (criterion.criterionType === ActivationCriterionType.GUIDANCE_COMPLETED) {\n this.logDebug(`Lifecycle activation criterion references guidance flow: '${criterion.guidanceFlowRef}' (validated at runtime)`);\n }\n }\n }\n\n this.logDebug('✅ Lifecycle evaluator configured', {\n dormancyThresholdDays: lifecycleConfig.dormancyThresholdDays,\n activityDebounceMinutes: lifecycleConfig.activityDebounceMinutes,\n dormancyCronSchedule: lifecycleConfig.dormancyCronSchedule,\n activationCriteriaCount: lifecycleConfig.activationCriteria?.criteria?.length ?? 0,\n });\n } else if (!isPlatformApplication) {\n this.logDebug('🔄 Lifecycle system disabled (lifecycle.enabled = false or not configured)');\n }\n\n // Step 2.1: Initialize first-class backend provider registry.\n //\n // The composed catalog (engine + app-contributed via\n // `backendProviderRegistry`) is filtered by the authored\n // `providerRuntime.providerRefs` so this backend process only\n // exposes providers materialized for it. Any ref claimed by the\n // runtime artifact but missing from the catalog fails startup\n // loudly — there is no silent fallback to the unfiltered catalog.\n this.logDebug('📦 Initializing backend provider registry...');\n this.backendProviderRegistryService.initialize(backendProviderRegistry, providerRuntime);\n this.logDebug('✅ Backend provider registry initialized', {\n providerRuntimeApplied: Boolean(providerRuntime),\n providerCount: this.backendProviderRegistryService.getRegistry().modules.size,\n });\n\n // Step 2.2: Initialize external providers registry.\n // Skip for platform applications - they initialize config later and will refresh the registry\n if (applicationConfig) {\n this.logDebug('🔌 Initializing external providers registry...');\n await this.externalProvidersRegistryService.initialize();\n this.logDebug('✅ External providers registry initialized successfully');\n\n // F5 (audit Phase 5) — required-capability boot guard. Fail LOUD if any\n // capability the app marked `activation.required` resolves no active\n // provider (a hard requirement with nothing to serve it). Generalizes the\n // audit coherence to EVERY capability; audit is the first user, not special.\n // (Platform apps initialize the registry later, in the `else` branch — they\n // author no `required` capabilities, so the guard belongs on the app path.)\n const missingRequiredCapabilities = this.externalProvidersRegistryService.getRequiredCapabilitiesWithoutProvider();\n if (missingRequiredCapabilities.length > 0) {\n throw this.errorBuilder.buildError(ErrorType.CONFIGURATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.CONFIGURATION,\n context: {\n message:\n `Required engine capabilities resolve no active provider: [${missingRequiredCapabilities.join(', ')}]. `\n + 'Each is marked `required` in engineCapabilities but has no provider serving it — '\n + 'declare a provider for it (SELECT_ONE needs a primary; FAN_OUT needs ≥1 declared), '\n + 'or drop the `required` flag.',\n missingRequiredCapabilities,\n },\n });\n }\n\n // G4 (audit Phase 5) — fail-OPEN audit-sink reconcile. Distinct from the\n // F5 hard guard above: this WARNS (never throws) when COMPLIANCE_AUDIT_TRAIL\n // is ENABLED but no provider resolves to deliver it — the operator turned on\n // Layer-2 audit fan-out yet nothing serves it (Layer-1 database audit is\n // unaffected). Mirrors ObservabilityBackendService's declared-but-inactive\n // reconcile. The resolved-provider-refs check is the faithful proxy for \"the\n // composite resolves zero live sinks\" (it builds one sink per resolved ref).\n // A `required` audit cap with no provider already threw in F5 above, so this\n // only fires for an enabled-but-not-required capability.\n //\n // Gated on the runtime profile: only a runtime EXPECTED to host the Layer-2\n // audit fan-out (the application backend) treats \"enabled but no provider\" as\n // a misconfiguration. An auxiliary runtime such as a minion is Layer-1-only by\n // design — the immudb node client is installed only in the backend, and the\n // backend's `immudb.audit-reconcile` cron backfills the minion's `AUDIT_LOGS`\n // rows into Layer-2 — so warning there is false-alarm noise on every restart,\n // not a real signal. `assertsLayer2AuditProviderPresence` is read off the same\n // `bootAssertions` decision resolved once above, so this gate cannot disagree\n // with the sibling profile-gated validators about which runtime is booting.\n if (\n shouldWarnLayer2AuditProviderInactive({\n runtimeAssertsLayer2AuditProviderPresence: bootAssertions.assertsLayer2AuditProviderPresence,\n complianceAuditTrailEnabled: this.externalProvidersRegistryService.isEngineCapabilityEnabled(\n EngineCapability.COMPLIANCE_AUDIT_TRAIL,\n ),\n resolvedAuditProviderRefCount: this.externalProvidersRegistryService.getResolvedProviderRefsForCapability(\n EngineCapability.COMPLIANCE_AUDIT_TRAIL,\n ).length,\n })\n ) {\n this.logger.warn(\n 'COMPLIANCE_AUDIT_TRAIL is enabled but no audit-log provider resolves — Layer-2 provider '\n + 'audit fan-out is INACTIVE (Layer-1 database audit is unaffected). Declare an audit provider '\n + '(e.g. immudb) in defineSaaSProviders, or disable the capability if Layer-1 alone is intended.',\n );\n }\n } else {\n this.logDebug('🔌 Skipping external providers registry initialization (platform app - will initialize after config is ready)');\n }\n\n // Step 2.3: Initialize flows-actors registry\n this.logDebug('🎭 Initializing flows-actors registry...');\n const mergedFlowActorSystemsFactoryMap = {\n ...(flowsActorsRegistry?.flowActorSystemsFactoryMap || {}),\n };\n const mergedAgents = [\n ...(flowsActorsRegistry?.agents || []),\n ];\n const mergedFunctionTools = [\n ...(flowsActorsRegistry?.functionTools || []),\n ];\n await this.flowsActorsRegistryService.initialize(\n mergedFlowActorSystemsFactoryMap,\n mergedAgents,\n mergedFunctionTools\n );\n this.logDebug('✅ Flows-actors registry initialized successfully');\n\n // Step 2.3b: Register the app's NAMED external resource-server instances (multiple MCP\n // servers / A2A agents) and validate their membership refs. Runs HERE deliberately — after\n // BOTH the resources registry (Step 2.1, for `operation.mcp.servers`) and the flows-actors\n // registry (Step 2.3, for an agent's `actorSystemRefs`) — because validation resolves refs\n // against them. A bad ref throws a CONFIGURATION error and fails startup (fail-closed):\n // a tool that silently belongs to no catalog, or a card advertising an unroutable skill,\n // is worse than a refusal to boot.\n // Membership validation is gated on the runtime profile: it asserts that every\n // `operation.mcp.servers` / `actorSystemRefs` ref resolves to a declared instance,\n // which is only meaningful for a runtime that actually SERVES those transports.\n // A minion mounts none and carries no declarations, so running this would fail its\n // boot over refs describing a surface it cannot expose — the exact crash-loop that\n // motivated the profile mechanism. Registration itself always runs: an empty\n // registry is the correct state for a non-serving runtime, and `tryGetInstance`\n // callers stay fail-closed against it.\n this.logDebug('🔀 Registering external resource-server instances...');\n this.resourceServerInstancesRegistry.initialize(resourceServerInstances);\n if (bootAssertions.assertsResourceServerMembershipCompleteness) {\n this.resourceServerInstancesRegistry.validateDeclaredMembership(\n this.flowsActorsRegistryService.getActors().map((system) => system.ref),\n );\n this.logDebug('✅ External resource-server instances registered + validated');\n } else {\n this.logDebug('✅ External resource-server instances registered (membership validation N/A for this runtime profile)', {\n runtimeProfile,\n });\n }\n\n // Step 2.4: Initialize I18n service with custom labels\n this.logDebug('🌐 Initializing I18n service...');\n this.i18nService.initialize(customLabels || {}, {\n suppressEmptyWarning: isPlatformApplication,\n });\n this.logDebug('✅ I18n service initialized successfully');\n\n // Step 2.4b: Initialize email template registry\n if (emailTemplateDefinitions && Object.keys(emailTemplateDefinitions).length > 0) {\n this.emailTemplateRegistryService.initialize(emailTemplateDefinitions);\n }\n\n if (!isPlatformApplication) {\n // Reconcile OTLP observability (post-config): compare the `--import` preload's\n // runtime state against the OBSERVABILITY_TELEMETRY provider selection, warn on\n // mismatch (E11), and wire graceful telemetry flush into the shutdown coordinator.\n // `?.` — platform subclasses don't forward this arg (see the constructor note); this\n // branch is non-platform so it's always defined here, but the guard is defensive.\n this.observabilityBackendService?.initialize();\n }\n\n // Step 2.5: Register chart definitions\n if (chartDefinitions && chartDefinitions.length > 0) {\n this.logDebug('📊 Registering chart definitions...', { count: chartDefinitions.length });\n for (const chartDef of chartDefinitions) {\n this.chartRegistryService.registerChart(chartDef);\n }\n this.logDebug('✅ Chart definitions registered successfully', { count: chartDefinitions.length });\n } else {\n this.logDebug('📊 No chart definitions provided, skipping chart registration');\n }\n\n // Step 2.5b: Register guidance flow definitions\n if (guidanceFlowDefinitions && guidanceFlowDefinitions.length > 0) {\n this.logDebug('🧭 Registering guidance flow definitions...', { count: guidanceFlowDefinitions.length });\n this.guidanceTriggerEvaluator.initializeFlows(guidanceFlowDefinitions);\n this.logDebug('✅ Guidance flow definitions registered successfully', { count: guidanceFlowDefinitions.length });\n } else {\n this.logDebug('🧭 No guidance flow definitions provided, skipping guidance registration');\n }\n\n // Step 2.6: Debug URL generation\n this.logDebug('🌐 Displaying generated URLs for debugging...');\n this.resourcesRegistryService.debugDisplayGeneratedUrls();\n\n // Step 3: Initialize repositories registry\n this.logDebug('🗄️ Initializing repositories registry...');\n const resourcesRegistry = this.resourcesRegistryService.getResourcesRegistry();\n\n // Guardrail: a REQUIRED composition-parent FK that the user must supply on\n // org-wide create (the parent is OPTIONAL_CONTEXT/STANDALONE) must be\n // user-fillable — otherwise the create form is silently dead (the\n // todoListId-create class of bug). Surface violations at boot rather than as\n // an unexplained client-side validation failure.\n //\n // Severity split: TARGET_NOT_SEARCHABLE degrades the picker → WARN (a custom\n // create surface might still supply the FK). EXCLUDED_FROM_CREATE is genuinely\n // impossible to create (no context, no control) → FAIL loud so the misconfig\n // never ships. The validator call itself is try/catch-guarded so a validator\n // edge case can never block startup; the intentional FAIL throw is outside\n // that guard so it propagates.\n let fkFillabilityViolations: ForeignKeyFillabilityViolation[] = [];\n try {\n fkFillabilityViolations = validateRequiredForeignKeyFillability(\n resourcesRegistry.resourceConfigurations as any,\n );\n } catch (error) {\n this.logger.warn('⚠️ required-foreign-key fillability guardrail skipped (validation error)', {\n ...projectCaughtErrorLogFields(error),\n });\n }\n for (const violation of fkFillabilityViolations) {\n if (violation.severity === ForeignKeyFillabilityViolationSeverity.WARN) {\n this.logger.warn(`⚠️ Required foreign key may be unfillable on create [${violation.kind}]: ${violation.message}`, {\n resourceType: violation.resourceType,\n foreignKeyField: violation.foreignKeyField,\n parentResourceType: violation.parentResourceType,\n kind: violation.kind,\n });\n }\n }\n const fkFillabilityFailures = fkFillabilityViolations.filter(\n (violation) => violation.severity === ForeignKeyFillabilityViolationSeverity.FAIL,\n );\n if (fkFillabilityFailures.length > 0) {\n throw new Error(\n `Resource configuration error — ${fkFillabilityFailures.length} required foreign key(s) are impossible to fill on create:\\n` +\n fkFillabilityFailures.map((failure) => ` • ${failure.message}`).join('\\n'),\n );\n }\n\n // --- Composition-seedability guard (onParentCreate lifecycle) ---\n // FAIL-CLOSED: a composition that OPTED IN to `onParentCreate.enabled` but\n // whose child is not seedable (not default-materializable AND no override)\n // is a genuine misconfig — the runtime seed would silently no-op. It fires\n // ONLY on enabled adopters, so it never trips the dozens of on-demand\n // compositions that legitimately do not eager-seed. The validator call is\n // try/catch-guarded so a validator edge case can never block startup; the\n // intentional throw is outside that guard. See\n // .claude/plans/composition-oncreate-lifecycle.md.\n let compositionSeedabilityViolations: CompositionSeedabilityViolation[] = [];\n try {\n compositionSeedabilityViolations = validateCompositionSeedability(\n resourcesRegistry.resourceConfigurations as any,\n );\n } catch (error) {\n this.logger.warn('⚠️ composition-seedability guardrail skipped (validation error)', {\n ...projectCaughtErrorLogFields(error),\n });\n }\n for (const violation of compositionSeedabilityViolations) {\n this.logger.warn(`⚠️ [composition-seedability] ${violation.message}`, {\n childResourceType: violation.childResourceType,\n parentResourceType: violation.parentResourceType,\n missingFields: violation.missingFields,\n });\n }\n if (compositionSeedabilityViolations.length > 0) {\n throw new Error(\n `Resource configuration error — ${compositionSeedabilityViolations.length} composition relationship(s) enabled ` +\n `onParentCreate seeding but are not seedable:\\n` +\n compositionSeedabilityViolations.map((violation) => ` • ${violation.message}`).join('\\n'),\n );\n }\n\n // --- Composition cascade-DELETABILITY guard (onParentDelete lifecycle) ---\n // The delete-side counterpart of the seedability guard above. It is wired FAIL-CLOSED for\n // IMPERSONALIZE_AND_RETAIN edges only, and warn-only for DELETE edges:\n // - DELETE violations are a KNOWN, pre-existing backlog (the 16 billing edges tracked in\n // KNOWN_CASCADE_DELETABILITY_GAPS) awaiting a compliance decision — throwing on them\n // would fail boot on the current registry, so they stay a warning until resolved.\n // - IMPERSONALIZE_AND_RETAIN violations have NO such backlog (no core edge declares the\n // strategy yet), and their runtime failure mode is far worse: the misconfiguration\n // surfaces only when a real erasure runs, throws INSIDE the parent-delete transaction\n // and rolls the deletion back — i.e. a GDPR erasure request fails in production. Catch\n // it at boot instead.\n let cascadeDeletabilityViolations: CompositionCascadeDeletabilityViolation[] = [];\n try {\n cascadeDeletabilityViolations = validateCompositionCascadeDeletability(\n resourcesRegistry.resourceConfigurations as any,\n );\n } catch (error) {\n this.logger.warn('⚠️ composition-cascade-deletability guardrail skipped (validation error)', {\n ...projectCaughtErrorLogFields(error),\n });\n }\n const retainCascadeViolations = cascadeDeletabilityViolations.filter(\n (violation) => violation.strategy === ChildLifecycleStrategy.IMPERSONALIZE_AND_RETAIN,\n );\n const deleteCascadeViolations = cascadeDeletabilityViolations.filter(\n (violation) => violation.strategy !== ChildLifecycleStrategy.IMPERSONALIZE_AND_RETAIN,\n );\n // ONE aggregated line for the known DELETE backlog — per-violation warnings would put ~16\n // lines in every boot log and train operators to ignore the channel.\n if (deleteCascadeViolations.length > 0) {\n // Report the EDGES, not a presumed cause. An earlier version asserted \"known backlog —\n // pending a retain-vs-delete compliance decision\", which is true only for the billing\n // families; a live run showed platform resources in the same list, where the cause is\n // simply a missing DELETE op. Stating one registry's story for every registry's\n // violations is how an operator learns to ignore the channel.\n const distinctEdges = [\n ...new Set(deleteCascadeViolations.map((v) => `${v.childResourceType} <- ${v.parentResourceType}`)),\n ];\n this.logger.warn(\n `⚠️ [composition-cascade-deletability] ${distinctEdges.length} onParentDelete edge(s) declare a DELETE ` +\n `cascade toward a child that cannot be cascade-deleted (missing discovery and/or DELETE op). Deleting ` +\n `such a parent throws CONFIGURATION inside its delete transaction and ROLLS BACK the parent delete, ` +\n `once a child row exists. Each edge needs a decision: add the missing op(s), retain the children ` +\n `(disable the cascade, or use strategy IMPERSONALIZE_AND_RETAIN with a retention-governed child), or ` +\n `drop onParentDelete.`,\n {\n edges: distinctEdges,\n // Surfaced because a duplicated pair means the SAME relationship is registered twice\n // for that child — a registry-assembly problem, not a cascade problem.\n duplicatedEdgeReports: deleteCascadeViolations.length - distinctEdges.length,\n },\n );\n }\n for (const violation of retainCascadeViolations) {\n this.logger.warn(`⚠️ [composition-cascade-deletability] ${violation.message}`, {\n childResourceType: violation.childResourceType,\n parentResourceType: violation.parentResourceType,\n strategy: violation.strategy,\n });\n }\n if (retainCascadeViolations.length > 0) {\n throw new Error(\n `Resource configuration error — ${retainCascadeViolations.length} composition relationship(s) declared ` +\n `onParentDelete.strategy = IMPERSONALIZE_AND_RETAIN but cannot be impersonalized-and-retained:\\n` +\n retainCascadeViolations.map((violation) => ` • ${violation.message}`).join('\\n'),\n );\n }\n\n // --- Composition seed op-path resolvability guard (onParentCreate lifecycle) ---\n // Complements the saas-models seedability guard above. That one verifies the\n // child's CREATE *DTO* is fillable; it cannot see whether the seed's SERVICE\n // op-path resolves — a backend-only concern. At seed time `createAsSystem`\n // resolves the child's default CREATE op via `getServiceOperationPathDefault`,\n // which accepts ONLY INTERNAL_CALL / API_CALL / API_CALL_WITH_CALLBACK — a\n // REPOSITORY_ONLY (or absent) default CREATE throws OPERATION_PATH_NOT_FOUND and\n // the runtime seed silently no-ops (the exact bug runtime-verify caught on the\n // first org/state adopters). Catch that class at boot, fail-closed, by reusing\n // the very resolver the seed uses (config-only, so callable here). Feature-gated\n // children are legitimately absent from the registry (the runtime seed skips\n // them the same way via `tryGetResourceConfiguration`) → they must not fail boot.\n const compositionSeedOpPathViolations: string[] = [];\n for (const childConfig of Object.values(\n resourcesRegistry.resourceConfigurations,\n ) as unknown as CompositionSeedabilityResourceInput[]) {\n const childResourceType = childConfig.resourceIdentifier;\n const parentRelationships: ResourceRelationship[] = childConfig.resourceRelationships?.parentRelationships ?? [];\n for (const relationship of parentRelationships) {\n if (relationship.nature !== RelationshipNature.COMPOSITION) continue;\n if (relationship.childOperations?.lifecycle?.onParentCreate?.enabled !== true) continue;\n // Feature-excluded child → absent from the registry → the runtime seed\n // skips it (same `tryGetResourceConfiguration` check), so don't fail boot.\n if (!this.resourcesRegistryService.tryGetResourceConfiguration(childResourceType)) continue;\n try {\n this.resourcesRegistryService.getServiceOperationPathDefault(\n childResourceType,\n CoreResourceOperation.CREATE,\n );\n } catch {\n compositionSeedOpPathViolations.push(\n `Composition child '${childResourceType}' (parent '${relationship.resourceType1}') enabled ` +\n `onParentCreate but createAsSystem cannot resolve a default CREATE service op-path — typically a ` +\n `REPOSITORY_ONLY or absent default CREATE variant (the service tier accepts only INTERNAL_CALL / ` +\n `API_CALL). The runtime seed would silently no-op. Make the default CREATE variant INTERNAL_CALL.`,\n );\n }\n }\n }\n if (compositionSeedOpPathViolations.length > 0) {\n throw new Error(\n `Resource configuration error — ${compositionSeedOpPathViolations.length} composition relationship(s) enabled ` +\n `onParentCreate seeding but their child has no service-resolvable default CREATE op:\\n` +\n compositionSeedOpPathViolations.map((message) => ` • ${message}`).join('\\n'),\n );\n }\n\n const resourceConfigurations = new Map(\n Object.entries(resourcesRegistry.resourceConfigurations) as [ResourceType, ResourceConfiguration<any, any, any>][]\n );\n\n if (platformPersistenceAdapter !== undefined && !isPlatformApplication) {\n throw new Error(\n 'platformPersistenceAdapter is a PLATFORM-MODE parameter. An application declares its '\n + 'persistence adapter in application config (DATABASE_DEFAULT_ADAPTER); accepting it here '\n + 'would smuggle the decision past that contract.',\n );\n }\n if (platformPersistenceAdapter !== undefined) {\n // BEFORE initializeRepositories, necessarily: this is the construction-time answer.\n this.repositoriesRegistryService.setPlatformModeDefaultPersistenceAdapter(platformPersistenceAdapter);\n }\n\n // Initialize repositories registry on the active default connection\n const activeConnection = this.mongoDBService.getConnection();\n await this.repositoriesRegistryService.initializeRepositories(resourceConfigurations, activeConnection || undefined);\n this.logDebug('✅ Repositories registry initialized successfully');\n\n // PostgreSQL DDL is owned OUTSIDE the engine (the schema planner plans; migrations apply),\n // so a PostgreSQL-backed table can silently disagree with what the repository writes — most\n // sharply for framework-owned columns no app schema declares. Prove the physical tables\n // match the plan HERE, once, rather than letting the first request fail on a bare\n // `column \"...\" does not exist`. Deliberately after `initializeRepositories` (the plans must\n // exist) and outside it (the PostgreSQL connection is lazy and need not be reachable while\n // repositories are being constructed). No-op unless a resource is PostgreSQL-backed, so it\n // never forces a connection an application does not use.\n // THE PRODUCTION MIGRATION DOOR (K7), deliberately immediately BEFORE the schema gate:\n // the runner brings the database to the shipped migrations' state, then the gate verifies\n // the result — so the gate stays the backstop even for the runner itself (K6). Both\n // no-op unless a resource is PostgreSQL-backed, and the runner additionally no-ops when\n // the deployable ships no migrations directory. Concurrency (N instances booting at\n // once) is the runner's own property via the in-database advisory lock.\n //\n // PLATFORM MODE DEFERS BOTH (Phase 5.2): the AppConfigurationService a platform service\n // hydrates AFTER this method cannot answer connection questions here, and this shared\n // body must not read it (the 2026-08-02 incident class, platform/CLAUDE.md). Platform\n // startups invoke `applyStartupPostgresMigrations()` + `verifyPostgreSqlTableSchemas()`\n // themselves — apps-manager immediately after this method returns (its Phase 2.5,\n // BEFORE its first repository read, with the connection supplied by the Phase-1\n // `connectWithUrl` pre-connect door rather than by hydration — Phase 5.3);\n // module-registry in its platform-owner phase, post-hydration.\n if (!isPlatformApplication) {\n this.logDebug('🚚 Applying startup PostgreSQL migrations (if any)...');\n await this.repositoriesRegistryService.applyStartupPostgresMigrations();\n\n this.logDebug('🧮 Verifying PostgreSQL physical table schemas...');\n await this.repositoriesRegistryService.verifyPostgreSqlTableSchemas();\n this.logDebug('✅ PostgreSQL physical table schemas verified');\n }\n\n // Preserve the historical post-repository factory lifecycle:\n // custom factories may resolve repository-backed services while\n // materializing their registrations.\n this.customImplRegistry.initialize([\n ...CoreBackend_ServiceImplementationsFactories,\n ...customServiceImplementations,\n ]);\n\n if (applicationConfig) {\n // Runtime-contract validation needs both the populated email\n // template registry and the finalized `transactionalCore`\n // registrations. It still runs before service/controller\n // initialization, so no operation can accept traffic first.\n this.logDebug('🧭 Validating initialized runtime contracts...');\n this.applicationStartupConfigValidator.validateInitializedRuntimeContracts(applicationConfig);\n // RAG store capability probe (fail-closed) — async because it EXECUTES a pgvector\n // expression on the live connection; no-op for applications with no `.ragSource()`\n // fields, so it never forces a database connection an application does not use.\n await this.applicationStartupConfigValidator.validateInitializedRagStoreCapability();\n if (bootAssertions.assertsPersistenceTransactionReadiness) {\n await this.applicationStartupConfigValidator\n .validateInitializedRuntimeTransactionReadiness(\n applicationConfig,\n );\n } else {\n this.logDebug(\n '🧭 Skipping persistence transaction-readiness proof: this runtime does not own it '\n + '(ApplicationRuntimeProfileBootAssertions.assertsPersistenceTransactionReadiness). '\n + 'The probe touches a synthetic collection no resourceAccess declares, and proves a '\n + 'deployment-wide property the application backend already proves.',\n );\n }\n this.logDebug('✅ Initialized runtime contracts validated successfully');\n }\n\n // Step 4: Initialize services registry (business logic layer)\n this.logDebug('🏢 Initializing services registry...');\n await this.servicesRegistryService.initializeServices();\n if (servicesRegistryDecoratorFactory) {\n if (!applicationConfig) {\n throw new Error('servicesRegistryDecoratorFactory requires application configuration and cannot run during pre-hydration platform startup.');\n }\n this.servicesRegistryService = servicesRegistryDecoratorFactory(this.servicesRegistryService, {\n appConfig: applicationConfig,\n errorBuilder: this.errorBuilder,\n });\n this.rebindServicesRegistryForRuntime(container, this.servicesRegistryService);\n this.logDebug('✅ Runtime-specific services registry decorator installed');\n }\n this.logDebug('✅ Services registry initialized successfully');\n\n // Step 4.4: Supply the session revoker used when a subject erasure scrubs a person's row.\n //\n // Unconditional, unlike the billing effect below: an erased person's login must stop\n // working in every deployment, so this is a core privacy control rather than a\n // provider-tied one. Registered as a PORT rather than injected directly because\n // `AuthTokenIssuer` already depends on the services-registry handler, which is where the\n // scrub chokepoint that calls this lives — a direct dependency would close that cycle.\n if (container) {\n (container.get(SAAS_SERVICE_TYPES.SubjectSessionRevocationService) as SubjectSessionRevocationBackendService)\n .register(async (userId: string) => {\n await (container.get(SAAS_SERVICE_TYPES.AuthTokenIssuer) as AuthTokenIssuerBackendService)\n .invalidateAllTokensForUser(userId);\n });\n this.logDebug('🔒 Subject-erasure session revoker registered');\n }\n\n // Step 4.5: Initialize billing services (if enabled)\n if (applicationConfig?.billing?.enabled && container) {\n await this.initializeBillingServices(container, applicationConfig.billing, productDefinitions);\n }\n\n // Step 4.6: Initialize webhook auto-controller (must happen before controllers registry)\n if (!isPlatformApplication && container) {\n await this.initializeWebhookAutoController(container);\n }\n\n // Step 5: Initialize controllers registry (HTTP endpoints layer)\n this.logDebug('🌐 Initializing controllers registry...');\n\n\n // Get manual controllers from provided container\n let allCustomControllers: AbstractControllerBackendService[] = [];\n\n if (container) {\n // G-4: SCIM controller mount is app-global — it mounts when ANY registered\n // org type opts into scimProvisioning (organizationTypes[t].scimProvisioning.enabled).\n // Per-org / per-token enforcement happens downstream once mounted (DIRECTORY_PROVISIONING\n // feature + the org-type scimProvisioning.enabled gate via isScimProvisioningEnabledForOrg).\n // Fail-closed: off unless a type opts in.\n const directoryProvisioningEnabled = isScimProvisioningEnabledForAnyOrgType(\n this.resourcesRegistryService.getOrganizationTypesConfig(),\n );\n const analyticsEnabled = !!applicationConfig?.analytics?.enabled;\n const manualControllers = isPlatformApplication ? [] : getManualControllersBackend(container, { directoryProvisioningEnabled, analyticsEnabled });\n allCustomControllers = [\n ...manualControllers,\n ...(customControllers || [])\n ];\n\n\n\n this.logDebug('📋 Controllers to register', {\n manualControllers: manualControllers.length,\n runtimeCustomControllers: customControllers?.length || 0,\n totalCustomControllers: allCustomControllers.length\n });\n } else {\n allCustomControllers = customControllers || [];\n\n this.logDebug('📋 Controllers to register', {\n manualControllers: 0,\n runtimeCustomControllers: customControllers?.length || 0,\n totalCustomControllers: allCustomControllers.length\n });\n }\n if(!isPlatformApplication) {\n await this.controllersRegistryService.initialize(\n allCustomControllers.length > 0 ? allCustomControllers : undefined,\n controllerWhiteList\n );\n this.logDebug('✅ Controllers registry initialized successfully');\n } else {\n this.logDebug('Skipping controllers registry initialization in platform mode (will be started by apps-manager)');\n }\n\n // Step 5.5: Initialize batches/cronjobs (core engine + custom + resource-based)\n this.logDebug('🧵 Initializing batches & cronjobs...');\n const customBatches = customBatchesFactory\n ? customBatchesFactory({\n logger: this.logger,\n errorBuilder: this.errorBuilder,\n errorHandler: this.errorHandler,\n executionContextCreatorService: this.executionContextCreatorBackendService,\n resourcesRegistryService: this.resourcesRegistryService,\n repositoriesRegistryService: this.repositoriesRegistryService,\n servicesRegistryService: this.servicesRegistryService,\n })\n : new Map<string, BatchesCronjobsCustomExecution_Service<any, any>>();\n\n // Register core engine batches (always present, independent of custom app)\n customBatches.set(FILES_CLEANUP_BATCH_REF, createFilesCleanupBatch());\n // Hourly RAG reconciliation sweep (plan §3.c backstop, DL1). Registered UNCONDITIONALLY,\n // like files-cleanup: on an application with no `.ragSource()` fields it finds zero\n // resource types and zero chunk sets and costs one enumeration — a better trade than\n // corpus convergence silently depending on a registration condition. It is also the\n // bound every chunk-tier log-never-throw seam cites, so it must exist wherever they do.\n customBatches.set(RAG_RECONCILIATION_SWEEP_BATCH_REF, createRagReconciliationSweepBatch());\n // Five-minute RAG embedding drain (plan §3.d, Phase 4): fills the NULL-vector ledger\n // the sweep counts, and re-embeds on class→model binding moves. Registered\n // UNCONDITIONALLY for the sweep's reason — an app with no `.ragSource()` fields\n // returns after one detection walk; a RAG app with no embeddings provider gets the\n // one-WARN-per-run visibility instead of a silently frozen backlog.\n customBatches.set(RAG_EMBEDDING_DRAIN_BATCH_REF, createRagEmbeddingDrainBatch());\n customBatches.set(CONSUMABLE_TOKENS_CLEANUP_BATCH_REF, createConsumableTokensCleanupBatch());\n customBatches.set(A2A_ABANDONED_TASK_SWEEP_BATCH_REF, createA2AAbandonedTaskSweepBatch());\n // Daily hygiene sweep for the invitation→membership-junction model: prunes\n // long-stale INVITED rows + orphan PENDING_INVITATION users. Always present\n // (invitations are a core org capability, not a feature-gated add-on).\n customBatches.set(ORGANIZATION_MEMBER_INVITATION_SWEEP_BATCH_REF, createOrganizationMemberInvitationSweepBatch());\n // Hourly sweep that lifts EXPIRED time-boxed suspensions. Registered UNCONDITIONALLY:\n // `organizationMembers | suspend` and `users | suspend_user` both accept a window and\n // persist the resolved instant, so an application without this batch records \"for seven\n // days\" and suspends forever. Unlike the invitation sweep above, correctness does NOT\n // hold without it — the batch is what makes the declared contract true.\n customBatches.set(SUSPENSION_REACTIVATION_SWEEP_BATCH_REF, createSuspensionReactivationSweepBatch());\n /**\n * Retention sweeps for the two `.ttl()` resources. Registered UNCONDITIONALLY, like the\n * suspension sweep above and for the same reason: without them the declared contract is\n * simply untrue on PostgreSQL, which has no native TTL. On MongoDB the TTL index also\n * expires these rows — the sweep then finds nothing and costs one cheap query, which is\n * a better trade than retention silently depending on which store an app happens to use.\n */\n customBatches.set(\n JOB_EXECUTIONS_RETENTION_SWEEP_BATCH_REF,\n createResourceRetentionSweepBatch(\n CoreResourceType.JOB_EXECUTIONS as ResourceType,\n ENGINE_JOB_EXECUTIONS_RETENTION_SWEEP_MANIFEST,\n ),\n );\n customBatches.set(\n JOB_PAYLOAD_STORAGE_RETENTION_SWEEP_BATCH_REF,\n createResourceRetentionSweepBatch(\n CoreResourceType.JOB_PAYLOAD_STORAGE as ResourceType,\n ENGINE_JOB_PAYLOAD_STORAGE_RETENTION_SWEEP_MANIFEST,\n ),\n );\n // WS-A tenant teardown — destroys tenants whose retention window has elapsed.\n // Registered UNCONDITIONALLY (no feature gate) for real applications: `request_deletion`\n // is always reachable, so a tenant can always end up marked, and an application without\n // this batch would accumulate marked-but-never-destroyed tenants forever — the exact\n // failure a retention window exists to prevent. Every field of `tenantTeardown` defaults,\n // so an app that declares no block still purges on a 30-day window.\n //\n // Skipped for `isPlatformApplication`: platform services (apps-manager, crontabs-batches-\n // manager, ...) have no ORGANIZATIONS to tear down, and `applicationConfig` is\n // not yet populated at this point in a platform application's boot — it resolves config\n // in its own later phase, AFTER this `super.initialize()` call returns — so reading it here\n // unconditionally threw `app_configuration_not_initialized` at platform-apps-manager boot.\n if (applicationConfig) {\n customBatches.set(ORGANIZATION_PURGE_BATCH_REF, createOrganizationPurgeBatch(applicationConfig.tenantTeardown));\n }\n // Event-triggered (enqueued by the notifications dispatcher, no cron).\n // Registered unconditionally so any email notification enqueued onto\n // the custom-batch queue can resolve its executor.\n customBatches.set(EMAIL_BATCH_SEND_BATCH_REF, emailBatchSendService);\n // Event-triggered M2M outbound webhook delivery (enqueued by\n // `M2MWebhookDispatcherBackendService.enqueueDelivery`, no cron) and\n // SIEM webhook delivery (enqueued by\n // `AuditEventDispatcherBackendService.dispatchToOrganizationAuditSinks`, no\n // cron). Both are registered unconditionally for the SAME reason as\n // email: the dispatchers gate enqueue per-org/per-endpoint, so the\n // drains MUST always resolve — else an enqueued job hits\n // `JOB_BATCH_REF_NOT_FOUND` and is silently dead-lettered.\n customBatches.set(M2M_WEBHOOK_DELIVERY_BATCH_REF, m2mWebhookDeliveryBatchService);\n customBatches.set(SIEM_WEBHOOK_DELIVERY_BATCH_REF, siemWebhookDeliveryBatchService);\n // A2A push-notification delivery (enqueued by `A2APushDispatcherBackendService` on a\n // task transition, no cron). Registered unconditionally for the same reason as its two\n // siblings above: the dispatcher gates enqueue per registered webhook, so the drain\n // MUST always resolve — an enqueued job that hits `JOB_BATCH_REF_NOT_FOUND` is silently\n // dead-lettered, which for a notification means the client is never told and nothing\n // says so.\n customBatches.set(A2A_PUSH_DELIVERY_BATCH_REF, a2aPushDeliveryBatchService);\n // Audit Phase 3 — cron completeness reconciler. Registered unconditionally\n // (like the sibling delivery drains) so a mis-set global flag can't orphan the\n // schedule; it no-ops cleanly when no reconcilable audit sink is declared.\n customBatches.set(IMMUDB_AUDIT_RECONCILE_BATCH_REF, immudbAuditReconcileBatchService);\n // Audit Phase 5 / F1 — cron audit-log ARCHIVAL. Registered\n // unconditionally (like the reconcile batch); it no-ops cleanly at\n // tick time when `auditTrail.archiveAfterDays` is unset (opt-in) or\n // no file-storage provider is configured. Never deletes (AUDIT_LOGS\n // is immutable, G5) — it copies aged rows to durable archival\n // artifacts.\n customBatches.set(AUDIT_LOGS_ARCHIVE_BATCH_REF, auditLogsArchiveBatchService);\n\n if (applicationConfig && this.appConfigService.anonymousSessionsEnabled) {\n customBatches.set(ANONYMOUS_SESSION_CLEANUP_BATCH_REF, createAnonymousSessionCleanupBatch());\n this.logDebug('✅ Anonymous session cleanup batch registered');\n }\n\n // Register lifecycle dormancy detection batch (only when lifecycle is enabled)\n if (lifecycleConfig?.enabled) {\n customBatches.set(DORMANCY_DETECTION_BATCH_REF, createDormancyDetectionBatch(lifecycleConfig.dormancyCronSchedule));\n this.logDebug('✅ Dormancy detection batch registered', { cronSchedule: lifecycleConfig.dormancyCronSchedule });\n }\n\n // Register data-seeding scheduled-rerun batch (Phase 7 / Item 47, Slice 5).\n //\n // Gate: at least one passed `dataSeeds` entry declares a `schedule?:`\n // block. We pre-filter the in-memory definitions array (rather than\n // querying the registry, which is hydrated later in Step 7) so apps\n // without any cron-opted-in seeds don't spawn a minute-tick cron that\n // would always no-op. Platform mode bypasses entirely (no per-tenant\n // data seeds run on the platform process).\n if (applicationConfig) {\n const hasScheduledSeeds = (dataSeeds ?? []).some((seed) => seed.schedule !== undefined);\n if (hasScheduledSeeds) {\n // Fallback ladder is flat by design: the Zod schema\n // applies `DATA_SEEDING_SCHEDULED_RERUN_DEFAULT_CRON`\n // as a default when `dataSeeding.scheduledRerunCronSchedule`\n // is missing but the `dataSeeding` block is present;\n // when the whole block is absent, we short-circuit to\n // the shared constant. Both branches land on the SAME\n // literal, so there's a single source of truth — no\n // `?? manifest.cronExpression ?? '* * * * *'` tail.\n const dataSeedingConfig = applicationConfig.dataSeeding;\n const cronSchedule = dataSeedingConfig?.scheduledRerunCronSchedule\n ?? DATA_SEEDING_SCHEDULED_RERUN_DEFAULT_CRON;\n customBatches.set(\n DATA_SEEDING_SCHEDULED_RERUN_BATCH_REF,\n createDataSeedingScheduledRerunBatch(cronSchedule),\n );\n this.logDebug('✅ Data-seeding scheduled-rerun batch registered', { cronSchedule });\n }\n\n // Register the ETL pipeline scheduled-run batch (partial-resource paper, PR-12).\n //\n // Gate: at least one registered resource declares `externalDataPipeline.scheduleCron` — the\n // resources registry is initialized in an earlier step, so we query it directly.\n // Apps with no scheduled pipelines don't spawn a minute-tick cron that would\n // always no-op; on-demand pipelines (no `scheduleCron`) run only through the\n // run service's imperative door. Same platform-mode bypass as the sibling above.\n const hasScheduledEtlPipelines = this.resourcesRegistryService\n .getResourceTypes()\n .some((resourceType) => {\n const configuration = this.resourcesRegistryService.getResourceConfiguration(resourceType) as {\n externalDataPipeline?: { scheduleCron?: string };\n };\n return configuration?.externalDataPipeline?.scheduleCron !== undefined;\n });\n if (hasScheduledEtlPipelines) {\n customBatches.set(\n EXTERNAL_DATA_PIPELINE_SCHEDULED_RUN_BATCH_REF,\n createExternalDataPipelineScheduledRunBatch(),\n );\n this.logDebug('✅ ETL pipeline scheduled-run batch registered');\n }\n\n // Register data-seeding run-cleanup batch (audit L4-10,\n // post-Phase-7 close-out). Daily retention sweep that prunes\n // terminal `DataSeedRun` rows older than\n // `DataSeedingConfig.runRetentionDays` (default 30) while\n // preserving the MAX(seedVersion) row per business-key group\n // (so dispatcher idempotency is never broken).\n //\n // Gate: any registered seeds (regardless of `schedule?:`).\n // Apps with no seeds produce no `DataSeedRun` rows so the\n // sweep would always no-op. Platform mode bypasses (no\n // per-tenant data seeds run on the platform process).\n //\n // Retention is read at TICK time from app config (NOT at\n // registration), so an in-place config change takes effect\n // on the next daily tick without redeploy — see the\n // manifest's JSDoc and `resolveRetentionDays()` in the\n // batch body.\n const hasAnySeeds = (dataSeeds ?? []).length > 0;\n if (hasAnySeeds) {\n customBatches.set(\n DATA_SEEDING_RUN_CLEANUP_BATCH_REF,\n createDataSeedingRunCleanupBatch(),\n );\n this.logDebug('✅ Data-seeding run-cleanup batch registered');\n }\n }\n\n await this.batchesExecutor.initialize(customBatches);\n this.logDebug('✅ Batches & cronjobs initialized');\n\n // Step 6: Initialize HTTP server (skip here in platform mode or headless runtimes)\n if (this.shouldInitializeHttpServer({ headlessMode })) {\n // Register operator-facing admin controllers BEFORE HTTP init so they get\n // mounted at their custom root paths (e.g. /internal/admin/data-seeding)\n // by registerRoutes(). They MUST go through registerCustomController(), not\n // through getManualControllersBackend(), because the manual-controllers list\n // is mounted under /api/v1 by the controllers registry — root-level admin\n // surfaces (mirroring /health) must skip that prefix.\n if (container) {\n try {\n const dataSeedingAdminController = container.get(\n SAAS_SERVICE_TYPES.DataSeedingAdminController,\n ) as DataSeedingAdminBackendController;\n this.httpServerService.registerCustomController(dataSeedingAdminController);\n this.logDebug('🌱 Data-seeding admin controller registered for root mount');\n } catch (error) {\n this.logger.warn('⚠️ Failed to register DataSeedingAdminController; admin endpoints will be unavailable', {\n ...projectCaughtErrorLogFields(error),\n });\n }\n }\n\n this.logger.info('🌍 Initializing HTTP server...');\n await this.httpServerService.initialize();\n this.logger.info('✅ HTTP server initialized successfully');\n } else if (this.isPlatformMode) {\n this.logDebug('Skipping HTTP server initialization in platform mode (will be started by apps-manager)');\n } else {\n this.logDebug('Skipping HTTP server initialization in headless mode');\n }\n\n // Step 7: Initialize queue workers (for background job processing)\n if (!this.isPlatformMode) {\n this.logger.info('🐰 Initializing queue workers...');\n try {\n // Headless job-processing runtimes (minions) still connect to\n // RabbitMQ here — their own tick consumer needs the adapter\n // connection + topology channel — but must NOT consume the\n // shared operations/scheduled/callbacks queues, or RabbitMQ\n // round-robins the scheduled-cron ticks onto them and they\n // dead-letter every tick they can't interpret. We also turn\n // OFF queue monitoring for those runtimes: it watches exactly\n // those four shared queues (which this runtime doesn't own),\n // and the backend-api pod already monitors them.\n await this.queueWorkerInitializer.initialize(\n skipJobConsumers\n ? { startJobConsumers: false, enableMonitoring: false }\n : undefined,\n );\n this.logger.info('✅ Queue workers initialized (if RabbitMQ configured)');\n } catch (error) {\n // Queue workers failing shouldn't prevent app from starting\n this.logger.warn('⚠️ Queue worker initialization skipped or failed:', error);\n }\n\n // Step 7.5: Sync cron jobs to crontabs-batches-manager\n if (this.shouldSyncCronJobs({ skipCronSync })) {\n this.logger.info('🕐 Syncing cron jobs to crontabs-manager...');\n try {\n // Initialize the sync service\n this.cronJobSyncService.initialize();\n\n // Sync cron jobs. Transient failures do not fail startup:\n // CronJobSyncBackendService keeps one capped,\n // process-lifecycle-aware reconciliation retry pending.\n await this.cronJobSyncService.syncCronJobsToManager();\n } catch (error) {\n // This catch is a final guard for an unexpected service\n // defect; ordinary remote failures are contained and\n // retried by CronJobSyncBackendService.\n this.logger.error('Unexpected cron job sync failure:', error);\n }\n } else {\n this.logDebug('Skipping cron job sync for this runtime profile');\n }\n } else {\n this.logDebug('Skipping queue worker initialization in platform mode');\n }\n\n // Step 7.7: Data-seeding subsystem — register declarations and run\n // application-lifecycle seeds (Phase 2.F of seeding-first-class plan).\n // Extracted into `runDataSeedingStep()` so it can be unit-tested in\n // isolation without standing up the full 30+ dependency boot chain.\n await this.runDataSeedingStep(dataSeeds, dataSeedScopeResolvers);\n\n // Step 7.8: Report — not enforce — the last-super-administrator floor. Runs AFTER\n // seeding so a seeded first administrator counts; see `reportSuperAdminFloor()` for why\n // this can never be fatal.\n await this.reportSuperAdminFloor();\n\n // Step 7.9: The per-tenant twin. Separate call, separate report: the application floor\n // answers \"can anyone administer this deployment\", this one answers \"which tenants can\n // nobody administer\" — different populations, different remedies, and an operator\n // needs both named rather than one folded into the other.\n await this.reportOrganizationOwnerFloor();\n\n // Step 7.10: Report — never enforce — which of the APPLICATION's own resources have said\n // nothing about whether their rows are about people. Reads the registry only: no database,\n // no execution context, so unlike the two floors above it needs nothing to be seeded and\n // cannot be confined to an empty set by a wrong context.\n this.reportApplicationPersonalDataDeclarations();\n\n // Step 8: Validate initialization\n await this.validateInitialization({ headlessMode });\n\n // Step 8.5: If the application's authored authentication policy (`userTypes.*.auth` —\n // MFA, password, lockout, enabled methods, step-up, session) moved since the last boot,\n // record it in the audit trail. Emitted HERE — after `validateInitialization`, with the\n // repositories registry and the audit boundary live and the resolved policy in effect —\n // because this boot is where the change takes effect and there is no human actor to name\n // (the \"who authored it\" lives in the deployment / source history).\n //\n // Gated three ways: `applicationConfig` is undefined in platform mode (the platform-gate);\n // and `!headlessMode` restricts the emit to the auth-SERVING runtime. A minion boots this\n // same lifecycle headlessly (`headlessMode: true`) with the SAME app config, so without\n // this gate every minion would write a duplicate row for one change — and a background\n // runtime that serves no HTTP/auth is not the honest emitter of an authentication-policy\n // change anyway. `shouldInitializeHttpServer` draws the identical `!headlessMode` line.\n // (Horizontally-scaled serving replicas can still race to one extra row per change; that\n // is safe over-recording in an append-only trail — the gap this closes is UNDER-recording.)\n // The service call is fully self-contained and fire-and-forget, so it cannot fail boot.\n //\n // assurance-control: WILDO.AUDIT.SECURITY_EVENT WILDO.IDENTITY.SESSION_ASSURANCE — the boot-time\n // activation point that guarantees a change to the authored authentication-assurance policy is\n // evidenced, from the auth-serving runtime, on the deployment that puts it into effect.\n if (applicationConfig && this.auditLogsService && !headlessMode) {\n await this.auditLogsService.emitApplicationAuthPolicyChangeIfChanged({\n applicationId: applicationConfig.appIdentity.appName,\n userTypes: applicationConfig.userTypes,\n });\n }\n\n this.isInitialized = true;\n\n\n // Step 9: Display debug information (after initialization is complete)\n this.logDebug('📋 Displaying implemented Mongoose schemas...');\n this.debugDisplayMongooseSchemas({\n showSchemaStructure: true,\n showIndexes: true,\n maxFieldDepth: 2,\n });\n\n this.logDebug('🌐 Displaying registered routes...');\n this.debugDisplayRegisteredRoutes();\n\n this.logDebug('🎉 Backend application initialization completed successfully');\n\n } catch (error) {\n // This orchestration layer does not handle the failure; it propagates\n // it to the runtime host. Logging here would duplicate the terminal\n // process-boundary record and lose host identity/context.\n throw error;\n }\n }\n\n /**\n * Initialize the webhook auto-controller with its dependencies.\n *\n * Must run BEFORE the controllers registry mounts the controller's router:\n * `initialize()` is what actually registers the webhook routes (the route\n * set is data-dependent and the webhook handler is not constructor-injected,\n * so the base class's constructor-time `setupRoutes()` hook is a no-op — see\n * `WebhookAutoControllerBackendService.initialize()` for the full rationale).\n * Async because route definitions are read from first-class provider runtime contracts.\n */\n private async initializeWebhookAutoController(container: any): Promise<void> {\n try {\n const webhookHandler = container.get(SAAS_SERVICE_TYPES.WebhookHandlerService) as WebhookHandlerBackendService;\n const webhookAutoController = container.get(SAAS_SERVICE_TYPES.WebhookAutoController) as WebhookAutoControllerBackendService;\n\n await webhookAutoController.initialize(webhookHandler);\n this.logDebug('🔗 Webhook auto-controller initialized');\n } catch (error) {\n // Non-fatal — if no webhook providers are registered, this is expected\n this.logger.warn('Webhook auto-controller initialization skipped', {\n ...projectCaughtErrorLogFields(error),\n });\n }\n }\n\n /**\n * Initialize billing services when billing is enabled.\n *\n * Resolves the billing provider from the external connectors system\n * and initializes all billing services (product catalog sync,\n * usage metering, promotions, custom implementations) and wires up webhooks.\n */\n private async initializeBillingServices(\n container: any,\n billingConfig: BillingConfiguration,\n appProductDefinitions?: ProductDefinition[],\n ): Promise<void> {\n this.logDebug('💳 Initializing billing services...');\n\n // Resolve the billing provider BEFORE the non-fatal try below.\n //\n // \"billing.enabled = true but no provider resolvable\" is an\n // INCOHERENT CONFIG, not a runtime hiccup, and must FAIL LOUD at\n // startup. The previous warn-and-return silently degraded: billing\n // resources stayed registered (enabled ⇒ not excluded) but the\n // back-office services that register their operation paths + run\n // the org auto-create never initialized. The result was request-\n // time FATALs (`resources_registry_operation_path_not_found` on\n // `organizationBillingAccounts` / `products` / `prices` /\n // `promotions`) during org provisioning — exactly the\n // silent-degradation anti-pattern the design philosophy forbids.\n //\n // The try/catch further down stays scoped to RUNTIME init errors\n // (a provider that resolves but then throws mid-wire) which remain\n // non-fatal. Config incoherence is a different, fatal class.\n const resolution = await this.resolveBillingProvider(billingConfig);\n if (!resolution.provider) {\n throw this.errorBuilder.buildError(ErrorType.CONFIGURATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.CONFIGURATION,\n context: {\n message: describeBillingProviderResolutionFailure(\n resolution.reason,\n billingConfig,\n resolution.detail,\n ),\n providerRef: billingConfig.providerRef ?? null,\n resolutionFailureReason: resolution.reason,\n },\n });\n }\n const billingProvider = resolution.provider;\n\n try {\n // 2. Get billing services from DI container\n const catalogSync = container.get(SAAS_SERVICE_TYPES.ProductCatalogSyncService) as ProductCatalogSyncBackendService;\n const usageMetering = container.get(SAAS_SERVICE_TYPES.UsageMeteringService) as UsageMeteringBackendService;\n\n // 3. Product definitions from the custom app (like customRoles, customFeatureDefinitions)\n const productDefinitions: ProductDefinition[] = appProductDefinitions ?? [];\n\n // 4. Initialize services in dependency order\n await catalogSync.initialize(productDefinitions, billingProvider);\n await usageMetering.initialize(billingProvider);\n\n // 4b. Register the provider-side half of subject erasure.\n //\n // Registered HERE, inside the billing bootstrap, because that is what keeps the erasure\n // orchestrator domain-agnostic: `system-access` runs whatever declared itself relevant to\n // a subject and never learns that billing exists. It also ties the effect's lifetime to\n // the provider's — a deployment with no billing provider configured registers nothing,\n // rather than registering an effect that would fail at erasure time.\n container\n .get(SAAS_SERVICE_TYPES.SubjectErasureExternalEffectsService)\n .register(createBillingSubjectErasureEffect({\n getBillingProvider: () => billingProvider,\n listBillingAccountsForSubject: async (billingAccountResourceType, scopeFieldName, subjectIds) => {\n const systemAccess = container.get(SAAS_SERVICE_TYPES.SystemAccessService) as SystemAccessBackendService;\n return normalizeSystemListResult(await systemAccess.listAsSystem(\n billingAccountResourceType,\n { [scopeFieldName]: { $in: subjectIds } },\n )) as Array<{ _id: string; providerCustomerId?: string }>;\n },\n listActiveSubscriptions: async (subscriptionResourceType, billingAccountFkField, billingAccountId) => {\n const systemAccess = container.get(SAAS_SERVICE_TYPES.SystemAccessService) as SystemAccessBackendService;\n return normalizeSystemListResult(await systemAccess.listAsSystem(\n subscriptionResourceType,\n {\n [billingAccountFkField]: billingAccountId,\n status: { $nin: TERMINAL_SUBSCRIPTION_STATUSES },\n },\n )) as Array<{ _id: string; providerSubscriptionId?: string }>;\n },\n logWarn: (message, context) => this.logger.warn(message, context),\n }));\n this.logDebug('🧹 Billing subject-erasure effect registered');\n\n // 4a. Sync product catalog to DB (ensures products/prices exist before billing state endpoint queries them)\n try {\n const syncResult = await catalogSync.syncProductCatalog();\n this.logDebug('📦 Product catalog synced at startup', {\n synced: syncResult.synced,\n created: syncResult.created,\n updated: syncResult.updated,\n featuresDirty: syncResult.featuresDirty.length,\n });\n } catch (syncError) {\n this.logger.warn('⚠️ Product catalog startup sync failed (non-fatal)', {\n ...projectCaughtErrorLogFields(syncError),\n });\n }\n\n // 4b. Initialize billing custom implementations (late-binding for resource-centric operations)\n const featureSync = container.get(SAAS_SERVICE_TYPES.BillingFeatureSyncService) as BillingFeatureSyncBackendService;\n const billingStateService = container.get(SAAS_SERVICE_TYPES.BillingStateService) as BillingStateBackendService;\n initializeBillingCustomImplementations(billingProvider, featureSync, billingStateService, billingConfig, this.errorBuilder);\n\n // 4c. Register post-operation hooks (feature sync fires automatically after subscription mutations)\n registerBillingPostOperationHooks(this.servicesRegistryService);\n\n // 5. Wire up billing webhooks\n // The WebhookAutoControllerBackendService auto-registers routes from provider definitions,\n // so we only need to register the adapter (verify+parse) and handler (dispatch).\n const webhookHandler = container.get(SAAS_SERVICE_TYPES.WebhookHandlerService) as WebhookHandlerBackendService;\n const webhookAutoController = container.get(SAAS_SERVICE_TYPES.WebhookAutoController) as WebhookAutoControllerBackendService;\n\n const billingAdapter = new BillingWebhookAdapter(billingProvider, billingConfig.providerRef);\n webhookHandler.registerAdapter(billingConfig.providerRef, 'billing', billingAdapter);\n\n const webSocketService = container.get(SAAS_SERVICE_TYPES.WebSocketService) as WebSocketService;\n setBillingWebSocketService(webSocketService);\n const webhookEventRouter = new BillingWebhookEventRouterBackendService(this.servicesRegistryService, this.resourcesRegistryService, this.logger, webSocketService);\n const billingCapabilityHandler = new BillingWebhookCapabilityHandler(webhookEventRouter);\n webhookAutoController.registerCapabilityHandler(billingCapabilityHandler);\n\n this.logDebug('✅ Billing services initialized successfully', {\n providerRef: billingConfig.providerRef,\n enabledScopes: billingConfig.enabledScopes,\n });\n } catch (error) {\n // Billing initialization failure is non-fatal: the app can still run without billing\n this.logger.error('❌ Billing services initialization failed (billing will be unavailable)', {\n ...projectCaughtErrorLogFields(error),\n });\n }\n }\n\n /**\n * Resolve the StandardBilling_Interface from the external providers system.\n *\n * Flow:\n * 1. Get the billing providerRef from config (e.g., 'stripe')\n * 2. Verify the configured provider exposes the billing protocol\n * 3. Load the billing runtime contract from the backend provider registry\n *\n * Returns a discriminated {@link BillingProviderResolution}: on failure the\n * `provider` is null and a `reason` (plus optional `detail`) names the exact\n * config surface at fault, so the startup guard can route the operator to the\n * right fix (scope authoring vs. secret vs. disabled) rather than a catch-all.\n */\n private async resolveBillingProvider(billingConfig: BillingConfiguration): Promise<BillingProviderResolution> {\n const providerRef = billingConfig.providerRef;\n if (!providerRef) {\n this.logDebug('No billing providerRef configured');\n return { provider: null, reason: BillingProviderResolutionFailureReason.PROVIDER_REF_UNSET };\n }\n\n try {\n const runtimeContract = this.backendProviderRegistryService.getRuntimeContract(\n providerRef,\n ExternalProvider_ExchangeProtocol_Kind.BILLING_PROVIDER,\n );\n if (runtimeContract?.kind !== 'billing') {\n // No billing runtime contract exposed to the backend registry for\n // this ref — the provider was filtered out of the active catalog\n // because it is not authored in `providers.scopes.backend` (and/or\n // lacks a backend runtime-owner contribution). This is distinct\n // from \"secret missing\": the ref never reached the backend host.\n this.logDebug('Billing provider not reachable on the backend runtime', { providerRef });\n return {\n provider: null,\n reason: BillingProviderResolutionFailureReason.PROVIDER_NOT_REACHABLE_ON_BACKEND,\n };\n }\n\n if (!this.externalProvidersRegistryService.isProviderEnabled(\n providerRef,\n ExternalProvider_ExchangeProtocol_Kind.BILLING_PROVIDER,\n )) {\n this.logDebug('Billing provider disabled by external provider configuration', { providerRef });\n return { provider: null, reason: BillingProviderResolutionFailureReason.PROVIDER_DISABLED };\n }\n\n // The framework currently ships a single `kind: 'billing'`\n // adapter (Stripe, via `StripeStandardBillingProvider`).\n // The instantiation here is keyed on `kind` only — no\n // provider literal — so the CI guard\n // (`no-provider-ref-branches.guard.test.ts`) accepts it.\n // When a second billing adapter arrives, factor the\n // adapter constructor into the runtime contract via\n // `sdkFactory: (secretKey, opts) => StandardBilling_Interface`,\n // mirror of the LLM and email surfaces — do NOT\n // reintroduce a `provider === '<ref>'` branch here.\n const secretRef = runtimeContract.secretRef;\n const secretKey = secretRef\n ? this.externalProvidersRegistryService.getProviderSecret(\n providerRef,\n ExternalProvider_ExchangeProtocol_Kind.BILLING_PROVIDER,\n secretRef,\n )\n : undefined;\n if (!secretKey) {\n this.logger.warn('Billing provider configured but secret is missing', { providerRef, secretRef });\n return {\n provider: null,\n reason: BillingProviderResolutionFailureReason.SECRET_MISSING,\n detail: secretRef,\n };\n }\n\n this.logDebug('Billing provider resolved from first-class billing runtime contract', { providerRef });\n return { provider: new StripeStandardBillingProvider(secretKey, runtimeContract.apiVersion) };\n } catch (error) {\n const detail = describeCaughtError(error);\n this.logger.warn('Failed to resolve billing provider', { providerRef, error: detail });\n return { provider: null, reason: BillingProviderResolutionFailureReason.RESOLUTION_ERROR, detail };\n }\n }\n\n async shutdown(): Promise<void> {\n this.logDebug('Starting graceful shutdown');\n\n\n // Cancel delayed cron reconciliation before stopping queue workers, so\n // shutdown cannot start a fresh platform request in the background.\n this.cronJobSyncService.shutdown();\n\n // Then shut down queue workers and wait for in-flight jobs.\n try {\n await this.queueWorkerInitializer.shutdown();\n } catch (error) {\n this.logger.error('Error during queue worker shutdown', error as any);\n }\n }\n /**\n * Check if the application is initialized\n */\n public isApplicationInitialized(): boolean {\n return this.isInitialized;\n }\n\n /**\n * Get application configuration\n */\n public async getAppConfig(): Promise<AppConfiguration> {\n this.ensureInitialized();\n return this.appConfigService.config;\n }\n\n /**\n * Get resources registry\n */\n public getResourcesRegistry(): ResourcesRegistry {\n this.ensureInitialized();\n return this.resourcesRegistryService.getResourcesRegistry();\n }\n\n /**\n * Get repositories registry handler\n */\n public getRepositoriesRegistry(): RepositoriesRegistryHandlerBackendService {\n this.ensureInitialized();\n return this.repositoriesRegistryService;\n }\n\n /**\n * Debug function to display all implemented Mongoose schemas\n * Convenient access to schema debugging from the main application service\n */\n public debugDisplayMongooseSchemas(options: {\n showSchemaStructure?: boolean;\n showIndexes?: boolean;\n showVirtuals?: boolean;\n resourceTypeFilter?: string[];\n maxFieldDepth?: number;\n } = {}): void {\n this.logDebug('\\n🚀 === WILDO.AI BACKEND - MONGOOSE SCHEMAS DEBUG ===\\n');\n\n if (!this.isInitialized) {\n this.logDebug('⚠️ Application not initialized yet. Schemas may not be available.');\n return;\n }\n\n this.repositoriesRegistryService.debugDisplayMongooseSchemas(options);\n }\n\n /**\n * Quick debug summary of all schemas\n */\n public debugShowSchemasSummary(): void {\n this.logDebug('\\n🚀 === WILDO.AI BACKEND - SCHEMAS SUMMARY ===\\n');\n\n if (!this.isInitialized) {\n this.logDebug('⚠️ Application not initialized yet. Schemas may not be available.');\n return;\n }\n\n this.repositoriesRegistryService.debugShowSchemasSummary();\n }\n\n /**\n * Debug function to display all registered routes\n */\n public debugDisplayRegisteredRoutes(): void {\n this.logDebug('\\n🌐 === WILDO.AI BACKEND - REGISTERED ROUTES ===\\n');\n\n if (!this.isInitialized) {\n this.logDebug('⚠️ Application not initialized yet. Routes may not be available.');\n return;\n }\n\n this.controllersRegistryService.displayAllRoutes();\n }\n\n /**\n * Get the controllers registry for route registration\n */\n public getControllersRegistry(): ControllersRegistryHandlerBackendService {\n this.ensureInitialized();\n return this.controllersRegistryService;\n }\n\n /**\n * Get the services registry for business logic access\n */\n public getServicesRegistry(): ServicesRegistryHandlerBackendService {\n this.ensureInitialized();\n return this.servicesRegistryService;\n }\n\n /**\n * Get the HTTP server service instance\n */\n public getHttpServer(): HttpServerBackendService {\n this.ensureInitialized();\n return this.httpServerService;\n }\n\n /**\n * Get the authorizations service instance\n */\n public getAuthorizationsService(): AuthorizationsBackendService {\n this.ensureInitialized();\n return this.authorizationsService;\n }\n\n /**\n * Step 7.7 — Data-seeding subsystem hand-off.\n *\n * Thin adapter around {@link runDataSeedingApplicationBootstrap}: this\n * method exists so subclasses (e.g. `PlatformAppsManager_ApplicationStartupService`)\n * can override / observe the step without reaching into the helper, and\n * so the heavy `initialize()` reads as a flat sequence of `await`s.\n *\n * The helper itself is exhaustively unit-tested at\n * `~/data-seeding/services/__tests__/data-seed-application-bootstrap.backend.test.ts`.\n * See the helper's JSDoc for the full contract (registration always runs,\n * dispatch is skipped in platform mode, dispatcher failures are FATAL).\n */\n protected async runDataSeedingStep(\n dataSeeds: readonly DataSeedDefinition[] | undefined,\n dataSeedScopeResolvers: Readonly<Record<string, DataSeedScopeResolver>> | undefined,\n ): Promise<void> {\n await runDataSeedingApplicationBootstrap({\n dataSeeds,\n dataSeedScopeResolvers,\n isPlatformMode: this.isPlatformMode,\n logger: this.logger,\n logDebug: this.logDebug,\n registry: this.dataSeedRegistryService,\n scopeResolverRegistry: this.dataSeedScopeResolverRegistryService,\n dispatcher: this.dataSeedDispatcherService,\n servicesRegistry: this.servicesRegistryService,\n });\n }\n\n /**\n * Report — never enforce — the last-super-administrator floor at startup.\n *\n * ## Why this exists next to the write guards\n *\n * Every write that could remove the last administratively usable super-administrator already\n * refuses (`super-admin-floor.backend.utils`, wired into the USERS role verbs, the core\n * UPDATE, DELETE and subject erasure). So this can only ever observe a breach that arrived\n * around those paths: a direct database edit, a restore from a backup taken mid-erasure, a seed\n * that authored no administrator, or — the one with no user row involved at all — a role-table\n * reconfiguration that dropped or renamed a custom role carrying\n * `inheritFrom: APP_ADMIN_SUPER_ADMIN`, silently reclassifying its holders as non-administrators.\n *\n * ## Why it MUST NOT fail startup\n *\n * A fresh application legitimately boots with zero users: the first administrator arrives\n * through seeding or first-run registration. A framework that refused to start on this data\n * condition would brick every greenfield app on its first run, and — worse — would make the\n * breach unrecoverable in exactly the situation where the operator needs the app up to fix it.\n * The finding is loud (`logger.error` + a CRITICAL audit event) and non-blocking. Rejected:\n * throwing `ErrorType.CONFIGURATION`, for both reasons above.\n *\n * ## Why every failure is swallowed\n *\n * A diagnostic that can take the application down is a worse defect than the one it reports.\n * The floor query needs the users repository and the role table; in platform mode, in reduced\n * runtime profiles, or in a minimal test container, either may legitimately be absent. All of\n * that degrades to a debug line.\n *\n * assurance-control: WILDO.ACCESS.ADMINISTRATIVE_CONTINUITY — surface the absence of an\n * accountable administrative principal, which is unrecoverable in-product once reached.\n */\n protected async reportSuperAdminFloor(): Promise<void> {\n // Platform mode runs no application user population — there is no floor to measure.\n if (this.isPlatformMode) return;\n /**\n * ONLY the runtime that owns the application's administrative population.\n *\n * The report reads `users` and `organizations` across the whole application. A confined\n * runtime (minion/worker) holds table-scoped grants covering neither, so it cannot perform\n * the read — and has no accountability for the answer even if it could. Observed on a\n * clean-room PostgreSQL boot (2026-08-24): the marketing-scrapper minion produced\n * `permission denied for table users` and `for table organizations` on every startup.\n *\n * It never blocked anything — the report is non-fatal by design — which is precisely why it\n * lasted: a recurring, ignorable error inside an otherwise healthy boot. The application\n * backend still runs both reports, so no observation is lost.\n */\n if (!resolveApplicationRuntimeProfileBootAssertions(this.resolvedRuntimeProfile).reportsAdministrativeContinuityFloors) return;\n\n try {\n if (!this.repositoriesRegistryService.getRepository(CoreResourceType.USERS)) {\n this.logDebug('Skipping the super-administrator floor report: no users repository is registered');\n return;\n }\n\n const executionContext = await this.executionContextCreatorBackendService.createForInternalOperation({\n operation: this.resourcesRegistryService.getServiceOperationPathDefault(\n CoreResourceType.USERS,\n CoreResourceOperation.LIST,\n ),\n initiatorRoles: [\n {\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],\n relatedPrimaryScope: ResourcePrimaryScope.APPLICATION,\n },\n ],\n });\n\n const population = await measureUsableSuperAdminPopulation({\n executionContext,\n repositoriesRegistry: this.repositoriesRegistryService,\n errorBuilder: this.errorBuilder,\n conferringRoles: resolveSuperAdminConferringRoles(this.authorizationsService),\n });\n\n if (population.meetsFloor) {\n this.logDebug('Super-administrator floor satisfied', {\n usableSuperAdminCount: population.usableSuperAdminCount,\n });\n return;\n }\n\n // ERROR, not warn: there is no in-product remedy — every door that could appoint a new\n // administrator is gated on the role that is missing. The recovery is necessarily\n // out-of-band (a direct database write, or a seed), so the log has to stand alone and\n // say what to do.\n this.logger.error(\n 'No administratively usable super-administrator exists. The application cannot be '\n + 'administered, and no in-product path can grant the role because every such path '\n + 'requires it. Restore one out-of-band (seed or direct database write) by giving an '\n + 'ACTIVE user one of the conferring roles below.',\n {\n usableSuperAdminCount: population.usableSuperAdminCount,\n requiredUsableSuperAdminCount: SUPER_ADMIN_FLOOR_MINIMUM,\n conferringRoles: population.conferringRoles,\n usableStatuses: [...ADMINISTRATIVELY_USABLE_USER_STATUSES],\n },\n );\n\n await this.auditLogsService?.logApplicationSuperAdminFloorBreached({\n usableSuperAdminCount: population.usableSuperAdminCount,\n requiredUsableSuperAdminCount: SUPER_ADMIN_FLOOR_MINIMUM,\n conferringRoles: population.conferringRoles,\n usableStatuses: [...ADMINISTRATIVELY_USABLE_USER_STATUSES],\n }, executionContext);\n } catch (error) {\n // See the header: a diagnostic must never be the reason startup fails.\n this.logDebug('Super-administrator floor report could not run', projectCaughtErrorLogFields(error));\n }\n }\n\n /**\n * Report — never enforce — the last-organization-owner floor, per tenant.\n *\n * The write guards are the protection; this is the only surface that observes states they never\n * saw (a direct database edit, a restore from a backup taken mid-erasure, a seed that authored no\n * owner, or a role-table reconfiguration that changed which roles confer ownership).\n *\n * NON-FATAL, for the same reason as its application twin and one more of its own: a fresh\n * deployment legitimately has zero organizations, and a tenant left ownerless by an out-of-band\n * edit is a condition to report, not a reason to refuse to serve every OTHER tenant.\n *\n * Cost is three queries regardless of tenant count — see\n * {@link measureOrganizationsMissingUsableOwner}. The breached list is logged in full because an\n * operator cannot act on a count, but it is the ONLY thing that scales with the breach, not with\n * the tenant base.\n */\n protected async reportOrganizationOwnerFloor(): Promise<void> {\n // Platform mode runs no tenant population — there is no floor to measure.\n if (this.isPlatformMode) return;\n /**\n * ONLY the runtime that owns the application's administrative population.\n *\n * The report reads `users` and `organizations` across the whole application. A confined\n * runtime (minion/worker) holds table-scoped grants covering neither, so it cannot perform\n * the read — and has no accountability for the answer even if it could. Observed on a\n * clean-room PostgreSQL boot (2026-08-24): the marketing-scrapper minion produced\n * `permission denied for table users` and `for table organizations` on every startup.\n *\n * It never blocked anything — the report is non-fatal by design — which is precisely why it\n * lasted: a recurring, ignorable error inside an otherwise healthy boot. The application\n * backend still runs both reports, so no observation is lost.\n */\n if (!resolveApplicationRuntimeProfileBootAssertions(this.resolvedRuntimeProfile).reportsAdministrativeContinuityFloors) return;\n\n try {\n if (!this.repositoriesRegistryService.getRepository(CoreResourceType.ORGANIZATIONS)\n || !this.repositoriesRegistryService.getRepository(CoreResourceType.ORGANIZATION_MEMBERS)) {\n this.logDebug('Skipping the organization-owner floor report: organization repositories are not registered');\n return;\n }\n\n const authExecutionContextFactory = this.authExecutionContextFactory;\n if (!authExecutionContextFactory) {\n this.logDebug('Skipping the organization-owner floor report: the auth execution-context factory is not bound');\n return;\n }\n\n const population = await measureOrganizationsMissingUsableOwner({\n // The report builds its OWN system context from this factory. It is a whole-estate\n // backstop and must NOT trust a caller-supplied context: a role-less or wrong-execution-\n // type context silently confined the ORGANIZATIONS scope-root read to the empty set and\n // the backstop then reported a healthy estate. See the block comment in\n // `measureOrganizationsMissingUsableOwner`.\n authExecutionContextFactory,\n repositoriesRegistry: this.repositoriesRegistryService,\n errorBuilder: this.errorBuilder,\n conferringRoles: resolveOrganizationOwnerConferringRoles(this.authorizationsService),\n });\n\n // The PREVENTIVE half, and the only one this floor has. A tenant with exactly one usable\n // owner is a single resignation or suspension away from being unadministrable, and it is\n // the population the floor will REFUSE to help — every removal there answers 409 until a\n // second owner exists. WARN, not error: nothing is broken yet, and an error here on a\n // legitimately small tenant would train operators to ignore the channel.\n if (population.singleOwnerOrganizations.length > 0) {\n this.logger.warn(\n 'Organizations have exactly ONE administratively usable owner. Each is one lifecycle '\n + 'event away from being unadministrable, and the owner floor will refuse every removal '\n + 'there until a second owner is granted. Recommend at least two owners per tenant.',\n {\n singleOwnerOrganizationCount: population.singleOwnerOrganizations.length,\n singleOwnerOrganizations: population.singleOwnerOrganizations,\n protectedOrganizationCount: population.protectedOrganizationCount,\n },\n );\n }\n\n if (population.ownerlessOrganizations.length === 0) {\n this.logDebug('Organization-owner floor satisfied for every protected tenant', {\n protectedOrganizationCount: population.protectedOrganizationCount,\n });\n return;\n }\n\n // ERROR, not warn: these tenants cannot administer THEMSELVES, and no member of them can\n // fix it — granting ownership requires the authority they just lost. Recovery exists but\n // is an out-of-tenant operator action, so the log names it rather than leaving the reader\n // to discover there is one. (Until 2026-08-05 this said no in-product path existed at all;\n // `organizationMembers.grantOwnership` is that path.)\n this.logger.error(\n 'Organizations exist with no administratively usable owner. They cannot administer '\n + 'themselves, and no member of them can repair it — granting ownership requires the '\n + 'authority that was lost. Repair from the platform tier with '\n + '`organizationMembers.grantOwnership`, which promotes an EXISTING member of the tenant '\n + 'and requires APP_ADMIN_SUPER_ADMIN. Failing that, restore out-of-band by giving an '\n + 'ACTIVE member an ACTIVE membership with a conferring role.',\n {\n ownerlessOrganizationCount: population.ownerlessOrganizations.length,\n protectedOrganizationCount: population.protectedOrganizationCount,\n ownerlessOrganizations: population.ownerlessOrganizations,\n requiredUsableOwners: ORGANIZATION_OWNER_FLOOR_MINIMUM,\n conferringRoles: resolveOrganizationOwnerConferringRoles(this.authorizationsService),\n usableMembershipStatuses: [...ADMINISTRATIVELY_USABLE_ORGANIZATION_MEMBER_STATUSES],\n usableOwnerUserStatuses: [...ADMINISTRATIVELY_USABLE_OWNER_USER_STATUSES],\n },\n );\n } catch (error) {\n // See the header: a diagnostic must never be the reason startup fails.\n this.logDebug('Organization-owner floor report could not run', projectCaughtErrorLogFields(error));\n }\n }\n\n /**\n * WHICH of the application's own resources have never been asked whether they hold personal data.\n *\n * ## Why this reports and does not refuse — the decision, not an omission\n *\n * Issue #93 asked whether a resource holding personal data should be REQUIRED to declare it, and\n * the evidence for requiring it was strong. Measured across two applications, a declaration gets\n * made if and only if the framework refuses to start without it: `exportSubject` is fail-closed at\n * registration and was declared on 10 of 12 resources, while `retentionPolicy` and\n * `.impersonalizeWith()` are unenforced and were declared on 1 and 0.\n *\n * Paul decided against refusing: a hard constraint on every author, for every resource, forever is\n * too strict, and it is the shape `application-creation-directive.md` warns about — the system must\n * work first, with protection arriving as a judge-style guard rather than a refusal wired into the\n * mechanism. So the log line is the whole enforcement here, and the half that actually produces\n * declarations is the framework knowledge that teaches an author to write one while authoring the\n * resource, where it costs a line.\n *\n * ## WARN, and the wording matters more than the level\n *\n * This reports \"unanswered\", never \"undeclared personal data\". Most resources genuinely hold none,\n * and a report that implied otherwise would be wrong about the majority of its own findings — which\n * is precisely how a diagnostic channel trains its readers to skim. ERROR is reserved for the two\n * administrative floors above, where something IS broken.\n *\n * ## Application resources only\n *\n * The engine declares its own posture across ~85 resources and an application author cannot change\n * any of them. `applicationResourceTypes` comes from the registry, which records the split at the\n * one point where the app and core factory maps are still distinguishable.\n */\n private reportApplicationPersonalDataDeclarations(): void {\n try {\n const registry = this.resourcesRegistryService?.getResourcesRegistry();\n if (!registry) {\n this.logDebug('Skipping the personal-data declaration report: the resources registry is not available');\n return;\n }\n\n const unanswered = collectApplicationResourcesWithNoPersonalDataDeclaration({\n resourceConfigurations: registry.resourceConfigurations as unknown as Record<string, PersonalDataDeclarationSubject>,\n applicationResourceTypes: registry.applicationResourceTypes,\n });\n\n if (unanswered.length === 0) {\n this.logDebug('Every application resource has answered the personal-data question', {\n applicationResourceCount: registry.applicationResourceTypes.length,\n });\n return;\n }\n\n this.logger.warn(\n 'Application resources have said NOTHING about whether their rows are about people. This is '\n + 'not a claim that they hold personal data — most resources do not — it is that the question '\n + 'is unanswered, so a generated privacy notice can say nothing about them and an erasure '\n + 'request has no instruction for them. Answer it on the resource configuration with any of: '\n + '`retentionPolicy` (RETAIN_ONLY is the checked way to say \"holds no personal data of its '\n + 'own\"), `dataSubjectPolicy`, `systemAccessPolicy.exportSubject`, or a `.dataCategories()` '\n + 'declaration on the fields that hold it.',\n {\n unansweredResourceCount: unanswered.length,\n applicationResourceCount: registry.applicationResourceTypes.length,\n unansweredResources: unanswered,\n },\n );\n } catch (error) {\n // A diagnostic must never be the reason startup fails — the same contract as the two floors.\n this.logDebug('Personal-data declaration report could not run', projectCaughtErrorLogFields(error));\n }\n }\n\n /**\n * Validate that all components are properly initialized\n */\n private async validateInitialization(options: { headlessMode?: boolean } = {}): Promise<void> {\n this.logDebug('Validating application initialization...');\n\n try {\n // Validate app config is accessible\n if (!this.isPlatformMode) {\n const config = this.appConfigService.config;\n if (!config) {\n const error = this.errorBuilder.buildError(\n ErrorType.CONFIGURATION,\n undefined,\n {customMessageReference: ErrorCustomMessageReference.START_APPLICATION_CONFIGURATION_FAILED}\n );\n throw error;\n }\n }\n\n // Validate resources registry is accessible\n const registry = this.resourcesRegistryService.getResourcesRegistry();\n if (!registry) {\n const error = this.errorBuilder.buildError(\n ErrorType.INTERNAL,\n undefined,\n {customMessageReference: ErrorCustomMessageReference.START_APPLICATION_INITIALIZATION_FAILED}\n );\n throw error;\n }\n\n // Validate repositories registry is accessible\n // const repositoriesDebugInfo = this.repositoriesRegistryService.getDebugInfo();\n // if (!repositoriesDebugInfo.isInitialized) {\n // throw new Error('Repositories registry is not initialized');\n // }\n\n // Validate services registry is accessible\n // const servicesDebugInfo = this.servicesRegistryService.getDebugInfo();\n // if (!servicesDebugInfo.isInitialized) {\n // throw new Error('Services registry is not initialized');\n // }\n\n // Validate controllers registry is accessible\n // const controllersDebugInfo = this.controllersRegistryService.getDebugInfo();\n // if (!controllersDebugInfo.isInitialized) {\n // throw new Error('Controllers registry is not initialized');\n // }\n\n // // Validate HTTP server is running\n // if (!this.httpServerService.isRunning()) {\n // throw new Error('HTTP server is not running');\n // }\n\n const serverInfo = options.headlessMode\n ? undefined\n : this.httpServerService.getServerInfo();\n\n // this.logDebug('Application initialization validation successful', {\n // appName: config.appIdentity.appName,\n // environment: process.env.APPLICATION_ENV,\n // resourcesCount: Object.keys(registry.resourceConfigurations).length,\n // repositoriesCount: repositoriesDebugInfo.repositoryCount,\n // repositoriesOperationPaths: repositoriesDebugInfo.operationPathsCount,\n // servicesCount: servicesDebugInfo.serviceCount,\n // servicesOperationPaths: servicesDebugInfo.operationPathsCount,\n // controllersCount: controllersDebugInfo.controllerCount,\n // controllersOperationPaths: controllersDebugInfo.operationPathsCount,\n // totalRoutes: controllersDebugInfo.totalRoutes,\n // httpServerRunning: this.httpServerService.isRunning(),\n // serverHost: serverInfo?.host,\n // serverPort: serverInfo?.port\n // });\n\n } catch (error) {\n // Validation failure ownership stays with the terminal runtime host.\n throw error;\n }\n }\n\n /**\n * Ensure the application is initialized before operations\n */\n private ensureInitialized(): void {\n if (!this.isInitialized) {\n const error = this.errorBuilder.buildError(\n ErrorType.INTERNAL,\n undefined,\n { customMessageReference: ErrorCustomMessageReference.START_APPLICATION_STARTUP_FAILED }\n );\n throw error;\n }\n }\n\n protected shouldInitializeHttpServer(options: { headlessMode?: boolean }): boolean {\n return !this.isPlatformMode && !options.headlessMode;\n }\n\n protected shouldSyncCronJobs(options: { skipCronSync?: boolean }): boolean {\n return !this.isPlatformMode && !options.skipCronSync;\n }\n\n private rebindServicesRegistryForRuntime(container: any, registry: ServicesRegistryHandlerBackendService): void {\n if (!container || typeof container.rebind !== 'function') {\n return;\n }\n container.rebind(SAAS_SERVICE_TYPES.ServicesRegistryHandlerService).toConstantValue(registry);\n }\n}\n\n/**\n * `listAsSystem` returns either a bare array or a paginated envelope depending on whether the caller\n * asked for pagination. The erasure effect's reads never paginate, but narrowing by CAST would be a\n * lie that survives until the day someone adds a pagination argument — normalise instead.\n */\nfunction normalizeSystemListResult<T>(result: T[] | { data?: T[]; items?: T[] }): T[] {\n if (Array.isArray(result)) return result;\n return result?.data ?? result?.items ?? [];\n}\n\n"]}
|
|
1
|
+
{"version":3,"file":"start-application.backend.service.js","sourceRoot":"","sources":["../../../../../src/runtime/services/start-application.backend.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAKzD,OAAO,EAAE,kCAAkC,EAAE,MAAM,kFAAkF,CAAC;AAItI,OAAO,EAAE,SAAS,EAAE,2BAA2B,EAAE,6BAA6B,EAAE,2BAA2B,EAAE,cAAc,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,cAAc,EAAE,kBAAkB,EAAE,qCAAqC,EAAE,sCAAsC,EAAE,8BAA8B,EAAE,sCAAsC,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAExd,OAAO,EAAE,wDAAwD,EAAuC,MAAM,uBAAuB,CAAC;AACtI,OAAO,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAAC;AACpF,OAAO,EAAE,aAAa,EAAE,MAAM,8DAA8D,CAAC;AAC7F,OAAO,EAAE,mBAAmB,EAAE,2BAA2B,EAAE,MAAM,8EAA8E,CAAC;AAEhJ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,CAAI,MAAyC;IAC3E,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;QAAE,OAAO,MAAM,CAAC;IACzC,OAAO,MAAM,EAAE,IAAI,IAAI,MAAM,EAAE,KAAK,IAAI,EAAE,CAAC;AAC/C,CAAC","sourcesContent":["import 'reflect-metadata';\nimport { injectable, inject, optional } from 'inversify';\nimport type { PersistenceAdapterType, ResourceConfiguration_InitializationFactoryMap, ResourceRelationship, ResourcesRegistry, ResourceType, RolesConfiguration, FlowsActors_Agent, ResourceConfiguration, FeatureDefinitionWithAutoRegister, FeatureConfiguration, ScopeFeatures, MilestoneDefinition, ForeignKeyFillabilityViolation, CompositionSeedabilityViolation, CompositionSeedabilityResourceInput, CompositionCascadeDeletabilityViolation, NotificationBadgeDefinition, ResourceServerInstance } from '@wildo-ai/saas-models';\nimport type { DataSeedDefinition } from '~wildo-backend-lib/data-seeding/models/data-seed.shared.schemas';\nimport type { DataSeedScopeResolver } from '~wildo-backend-lib/data-seeding/services/data-seed-scope-resolver-registry.backend.service';\nimport type { DataSeedScopeResolverRegistryBackendService } from '~wildo-backend-lib/data-seeding/services/data-seed-scope-resolver-registry.backend.service';\nimport { runDataSeedingApplicationBootstrap } from '~wildo-backend-lib/data-seeding/services/data-seed-application-bootstrap.backend';\nimport type { FlowActorSystem_InitializationFactoryMap } from '~wildo-backend-lib/flows-actors/models/flows-actors.backend.schemas';\nimport type { FunctionTool } from '~wildo-backend-lib/flows-actors/models/function-tools.backend.definitions';\nimport type { BackendProviderRegistry } from '@wildo-ai/external-connectors-private/backend';\nimport { ErrorType, ErrorCustomMessageReference, FeatureUnavailabilityBehavior, FeatureUnavailabilityReason, BILLING_SCOPES, ActivationCriterionType, ResourcePrimaryScope, CoreResourceType, CoreResourceOperation, CORE_APP_ROLES, RelationshipNature, validateRequiredForeignKeyFillability, ForeignKeyFillabilityViolationSeverity, validateCompositionSeedability, validateCompositionCascadeDeletability, ChildLifecycleStrategy, EngineCapability } from '@wildo-ai/saas-models';\nimport type { LifecycleConfig, OrganizationUnitNarrowingDeclaration } from '@wildo-ai/saas-models';\nimport { collectApplicationResourcesWithNoPersonalDataDeclaration, type PersonalDataDeclarationSubject } from '@wildo-ai/saas-models';\nimport { SAAS_SERVICE_TYPES } from '~wildo-backend-lib/inject/models/service-types';\nimport { LoggerService } from '~wildo-backend-lib/monitoring/logger/services/logger.service';\nimport { describeCaughtError, projectCaughtErrorLogFields } from '~wildo-backend-lib/errors/utils/error-log-level-classification.backend.utils';\nimport type { AuditLogsBackendService } from '~wildo-backend-lib/compliance/audit-trails/services/audit-logs.backend.service';\nimport {\n ADMINISTRATIVELY_USABLE_USER_STATUSES,\n measureUsableSuperAdminPopulation,\n resolveSuperAdminConferringRoles,\n SUPER_ADMIN_FLOOR_MINIMUM,\n} from '~wildo-backend-lib/security/authorizations/super-admin-floor.backend.utils';\nimport {\n ADMINISTRATIVELY_USABLE_ORGANIZATION_MEMBER_STATUSES,\n ADMINISTRATIVELY_USABLE_OWNER_USER_STATUSES,\n measureOrganizationsMissingUsableOwner,\n ORGANIZATION_OWNER_FLOOR_MINIMUM,\n resolveOrganizationOwnerConferringRoles,\n} from '~wildo-backend-lib/security/authorizations/organization-owner-floor.backend.utils';\nimport { enumeratePrivilegedAccessPopulation } from '~wildo-backend-lib/security/authorizations/privileged-access-review.backend.utils';\nimport { ApplicationRuntimeProfile, resolveApplicationRuntimeProfileBootAssertions } from '~wildo-backend-lib/config/bootstrap/application-runtime-profile.backend';\nimport { AppConfigurationService } from '~wildo-backend-lib/config/services/app-configuration.backend.service';\nimport { ApplicationStartupConfigValidatorService } from '~wildo-backend-lib/config/services/application-startup-config-validator.backend.service';\nimport { ObservabilityBackendService } from '~wildo-backend-lib/monitoring/observability/services/observability.backend.service';\nimport type { AppConfiguration } from '~wildo-backend-lib/config/models/app-config.backend.schemas';\nimport type { AppConfiguration_BackendAuthored } from '~wildo-backend-lib/config/models/app-config.backend-authored.definitions';\nimport type { ProviderRuntimeArtifact } from '~wildo-backend-lib/config/models/provider-runtime-artifact.backend.schemas';\nimport { ResourcesRegistryBackendService } from '~wildo-backend-lib/resources/services/resources-registry.backend.service';\nimport type { SubjectSessionRevocationBackendService } from '~wildo-backend-lib/compliance/privacy/services/subject-session-revocation.backend.service';\nimport type { AuthTokenIssuerBackendService } from '~wildo-backend-lib/security/authentications/services/auth-token-issuer.backend.service';\nimport { BackendProviderRegistryBackendService } from '~wildo-backend-lib/external-providers/services/backend-provider-registry.backend.service';\nimport { ExternalProvidersRegistryBackendService } from '~wildo-backend-lib/external-providers/services/external-providers-registry.backend.service';\nimport { FeatureDefinitionRegistryBackendService } from '~wildo-backend-lib/features/services/feature-definition-registry.backend.service';\nimport { MilestoneDefinitionRegistryBackendService } from '~wildo-backend-lib/guidance/services/milestone-definition-registry.backend.service';\nimport { MilestoneConditionRegistryBackendService } from '~wildo-backend-lib/guidance/services/milestone-condition-registry.backend.service';\nimport type { MilestoneConditionFn } from '~wildo-backend-lib/guidance/services/milestone-condition-registry.backend.service';\nimport { LifecycleEvaluatorBackendService } from '~wildo-backend-lib/guidance/services/lifecycle-evaluator.backend.service';\nimport { initializeLifecycleCustomImplementations } from '~wildo-backend-lib/guidance/services/lifecycle-custom-implementations.backend';\nimport { createDormancyDetectionBatch } from '~wildo-backend-lib/guidance/batches/dormancy-detection.batch.backend.service';\nimport { createDataSeedingScheduledRerunBatch } from '~wildo-backend-lib/data-seeding/batches/data-seeding-scheduled-rerun.batch.backend.service';\nimport { createExternalDataPipelineScheduledRunBatch } from '~wildo-backend-lib/external-data/batches/external-data-pipeline-scheduled-run.batch.backend.service';\nimport { createDataSeedingRunCleanupBatch } from '~wildo-backend-lib/data-seeding/batches/data-seeding-run-cleanup.batch.backend.service';\nimport { FlowsActorsRegistryService } from '~wildo-backend-lib/flows-actors/services/flows-actors-registry.service';\nimport { ResourceServerInstancesRegistryBackendService } from '~wildo-backend-lib/mcp/services/resource-server-instances-registry.backend.service';\nimport { RepositoriesRegistryHandlerBackendService } from '~wildo-backend-lib/base-classes/services/repositories/repositories-registry-handler.backend.service';\nimport { ServicesRegistryHandlerBackendService } from '~wildo-backend-lib/base-classes/services/services/services-registry-handler.backend.service';\nimport { ControllersRegistryHandlerBackendService } from '~wildo-backend-lib/base-classes/services/controllers/controllers-registry-handler.backend.service';\nimport { AbstractControllerBackendService } from '~wildo-backend-lib/base-classes/services/controllers/abstract-controller.backend.service';\nimport { getManualControllersBackend } from '~wildo-backend-lib/base-classes/models/manual-controllers.backend.definition';\nimport { HttpServerBackendService } from './http-server.backend.service';\nimport { ErrorBuilderBackendService } from '~wildo-backend-lib/errors/services/error-builder.backend.service';\nimport { ErrorHandlerService } from '~wildo-backend-lib/errors/services/error-handler.backend.service';\nimport { AuthorizationsBackendService } from '~wildo-backend-lib/security/authorizations/services/authorizations.backend.service';\nimport { BatchesCronjobsExecutor_BackendService } from '~wildo-backend-lib/base-classes/services/batches/batches-cronjobs-executor.backend.service';\nimport { BatchesCronjobsCustomExecution_Service } from '~wildo-backend-lib/base-classes/services/batches/batches-cronjobs-custom-execution.service';\nimport { ExecutionContextCreatorBackendService } from '~wildo-backend-lib/runtime/services/execution-context-creator.backend.service';\nimport { AuthExecutionContextFactoryBackendService } from '~wildo-backend-lib/security/authentications/services/auth-execution-context-factory.backend.service';\nimport { ResourceOperationCustomImplementationRegistryBackendService } from '~wildo-backend-lib/base-classes/services/services/resource-operation-custom-implementation-registry.backend.service';\nimport { CoreBackend_ServiceImplementationsFactories } from '~wildo-backend-lib/resources/models/custom-service-implementations.backend.definition';\nimport { createFilesCleanupBatch } from '~wildo-backend-lib/files/batches/files-cleanup.batch.backend.service';\nimport { createConsumableTokensCleanupBatch } from '~wildo-backend-lib/security/consumable-tokens/batches/consumable-tokens-cleanup.batch.backend.service';\nimport { createA2AAbandonedTaskSweepBatch } from '~wildo-backend-lib/flows-actors/a2a/batches/a2a-abandoned-task-sweep.batch.backend.service';\nimport { createAnonymousSessionCleanupBatch } from '~wildo-backend-lib/security/authentications/batches/anonymous-session-cleanup.batch.backend.service';\nimport { createOrganizationMemberInvitationSweepBatch } from '~wildo-backend-lib/organizations/batches/organization-member-invitation-sweep.batch.backend.service';\nimport { createSuspensionReactivationSweepBatch } from '~wildo-backend-lib/base-classes/services/batches/suspension-reactivation-sweep.batch.backend.service';\nimport { createResourceRetentionSweepBatch } from '~wildo-backend-lib/base-classes/services/batches/resource-retention-sweep.batch.backend.service';\nimport { createOrganizationPurgeBatch } from '~wildo-backend-lib/organizations/batches/organization-purge.batch.backend.service';\nimport { isScimProvisioningEnabledForAnyOrgType } from '~wildo-backend-lib/organizations/services/scim-provisioning-gate.backend.utils';\nimport { emailBatchSendService } from '~wildo-backend-lib/notifications/email/services/email-batch-send.batch.backend.service';\nimport { m2mWebhookDeliveryBatchService } from '~wildo-backend-lib/notifications/webhooks/outbound/batches/m2m-webhook-delivery.batch.backend.service';\nimport { a2aPushDeliveryBatchService } from '~wildo-backend-lib/flows-actors/a2a/batches/a2a-push-delivery.batch.backend.service';\nimport { siemWebhookDeliveryBatchService } from '~wildo-backend-lib/compliance/audit-trails/batches/siem-webhook-delivery.batch.backend.service';\nimport { immudbAuditReconcileBatchService } from '~wildo-backend-lib/compliance/audit-trails/batches/immudb-audit-reconcile.batch.backend.service';\nimport { auditLogsArchiveBatchService } from '~wildo-backend-lib/compliance/audit-trails/batches/audit-logs-archive.batch.backend.service';\nimport { shouldWarnLayer2AuditProviderInactive } from '~wildo-backend-lib/compliance/audit-trails/utils/layer2-audit-provider-boot-diagnostic.backend.utils';\nimport { StripeStandardBillingProvider } from '~wildo-backend-lib/billing/services/stripe-standard-billing-provider.backend.service';\n// Internal callers go through the path alias (the `@wildo-ai/saas-backend-lib/custom-batch-manifests`\n// subpath export exists for external spec-layer consumers; self-imports through the public\n// package name are not wired in this workspace's tsconfig path map).\nimport {\n ANONYMOUS_SESSION_CLEANUP_BATCH_REF,\n ORGANIZATION_MEMBER_INVITATION_SWEEP_BATCH_REF,\n SUSPENSION_REACTIVATION_SWEEP_BATCH_REF,\n JOB_EXECUTIONS_RETENTION_SWEEP_BATCH_REF,\n JOB_PAYLOAD_STORAGE_RETENTION_SWEEP_BATCH_REF,\n ENGINE_JOB_EXECUTIONS_RETENTION_SWEEP_MANIFEST,\n ENGINE_JOB_PAYLOAD_STORAGE_RETENTION_SWEEP_MANIFEST,\n ORGANIZATION_PURGE_BATCH_REF,\n CONSUMABLE_TOKENS_CLEANUP_BATCH_REF,\n A2A_ABANDONED_TASK_SWEEP_BATCH_REF,\n DATA_SEEDING_RUN_CLEANUP_BATCH_REF,\n DATA_SEEDING_SCHEDULED_RERUN_BATCH_REF,\n DATA_SEEDING_SCHEDULED_RERUN_DEFAULT_CRON,\n EXTERNAL_DATA_PIPELINE_SCHEDULED_RUN_BATCH_REF,\n DORMANCY_DETECTION_BATCH_REF,\n EMAIL_BATCH_SEND_BATCH_REF,\n FILES_CLEANUP_BATCH_REF,\n M2M_WEBHOOK_DELIVERY_BATCH_REF,\n A2A_PUSH_DELIVERY_BATCH_REF,\n SIEM_WEBHOOK_DELIVERY_BATCH_REF,\n IMMUDB_AUDIT_RECONCILE_BATCH_REF,\n AUDIT_LOGS_ARCHIVE_BATCH_REF,\n RAG_RECONCILIATION_SWEEP_BATCH_REF,\n RAG_EMBEDDING_DRAIN_BATCH_REF,\n} from '~wildo-backend-lib/base-classes/services/batches/engine-custom-batch-manifests';\nimport { createRagReconciliationSweepBatch } from '~wildo-backend-lib/rag/batches/rag-reconciliation-sweep.batch.backend.service';\nimport { createRagEmbeddingDrainBatch } from '~wildo-backend-lib/rag/batches/rag-embedding-drain.batch.backend.service';\nimport { SAAS_SERVICE_TYPES as TYPES } from '~wildo-backend-lib/inject/models/service-types';\nimport { ResourceCustomServiceImplementationFactory } from '~wildo-backend-lib/base-classes/services/services/resource-operation-custom-implementation.factory.backend';\nimport { MongoDBService } from '~wildo-backend-lib/databases/services/mongodb.service';\nimport { RedisService } from '~wildo-backend-lib/databases/services/redis.service';\nimport { I18nBackendService, CustomLabelsMap } from '~wildo-backend-lib/i18n/services/i18n.backend.service';\nimport { FileStorageRouterBackendService } from '~wildo-backend-lib/files/storage/file-storage-router.backend.service';\nimport { PdfTemplateBindingBackendService } from '~wildo-backend-lib/pdf-templates/services/pdf-template-binding.backend.service';\nimport type { PdfTemplateBindingsMap } from '~wildo-backend-lib/pdf-templates/models/pdf-template-binding';\nimport { QueueWorkerInitializerBackendService } from '~wildo-backend-lib/queue/queue-worker-initializer.backend.service';\nimport { CronJobSyncBackendService } from '~wildo-backend-lib/queue/cron-job-sync.backend.service';\nimport type { ProductCatalogSyncBackendService } from '~wildo-backend-lib/billing/services/back-office/product-catalog-sync.backend.service';\nimport type { UsageMeteringBackendService } from '~wildo-backend-lib/billing/services/back-office/usage-metering.backend.service';\nimport {\n createBillingSubjectErasureEffect,\n TERMINAL_SUBSCRIPTION_STATUSES,\n} from '~wildo-backend-lib/billing/services/back-office/billing-subject-erasure-effect.backend';\nimport type { SystemAccessBackendService } from '~wildo-backend-lib/base-classes/services/services/system-access.backend.service';\nimport type { BillingFeatureSyncBackendService } from '~wildo-backend-lib/billing/services/back-office/billing-feature-sync.backend.service';\nimport { initializeBillingCustomImplementations, registerBillingPostOperationHooks, setBillingWebSocketService } from '~wildo-backend-lib/billing/services/custom-impl/billing-custom-implementations.backend';\nimport { ExternalProvider_ExchangeProtocol_Kind, type StandardBilling_Interface } from '@wildo-ai/external-connectors-models';\nimport type { WebhookHandlerBackendService } from '~wildo-backend-lib/notifications/webhooks/services/webhook-handler.backend.service';\nimport type { WebhookAutoControllerBackendService } from '~wildo-backend-lib/notifications/webhooks/controllers/webhook-auto-controller.backend.service';\nimport { BillingWebhookAdapter } from '~wildo-backend-lib/billing/services/webhooks/billing-webhook-adapter.backend.service';\nimport { BillingWebhookCapabilityHandler } from '~wildo-backend-lib/billing/services/webhooks/billing-webhook-capability-handler.backend.service';\nimport { BillingWebhookEventRouterBackendService } from '~wildo-backend-lib/billing/services/webhooks/billing-webhook-event-router.backend.service';\nimport type { WebSocketService } from '~wildo-backend-lib/requests/service/websocket.service';\nimport type { BillingConfiguration, ProductDefinition, ChartDefinition, GuidanceFlowDefinition } from '@wildo-ai/saas-models';\nimport { ChartRegistryBackendService } from '~wildo-backend-lib/charts/services/chart-registry.backend.service';\nimport { GuidanceTriggerEvaluatorBackendService } from '~wildo-backend-lib/guidance/services/guidance-trigger-evaluator.backend.service';\nimport { DataSeedRegistryBackendService } from '~wildo-backend-lib/data-seeding/services/data-seed-registry.backend.service';\nimport { DataSeedDispatcherBackendService } from '~wildo-backend-lib/data-seeding/services/data-seed-dispatcher.backend.service';\nimport { DataSeedingAdminBackendController } from '~wildo-backend-lib/data-seeding/controllers/data-seeding-admin.backend.controller';\nimport { ExternalDataAdminBackendController } from '~wildo-backend-lib/external-data/controllers/external-data-admin.backend.controller';\nimport { EmailTemplateRegistryBackendService } from '~wildo-backend-lib/notifications/email/services/email-template-registry.backend.service';\nimport type { EmailTemplateDefinitionsMap } from '~wildo-backend-lib/notifications/email/models/email-template-definition';\nimport { BillingStateBackendService } from '~wildo-backend-lib/billing/services/back-office/billing-state.backend.service';\nimport { resolveFeatureGatedCoreResourceExclusions } from '~wildo-backend-lib/runtime/utils/feature-gated-core-resource-exclusions.backend.utils';\nimport { resolveApplicationConfigForStartup } from '~wildo-backend-lib/runtime/utils/application-startup-config-access.backend.utils';\n\n\n\n/**\n * Configuration object for {@link StartApplicationBackendService.initialize}.\n *\n * Groups the 25+ positional parameters into a single typed config,\n * preventing silent mis-ordering bugs (e.g. `customLabels` passed as `undefined`\n * at the wrong positional slot).\n */\nexport interface ApplicationInitializationConfig {\n sharedResourceConfigurations: ResourceConfiguration_InitializationFactoryMap;\n sharedResourceFieldIdentifiers?: Record<string, string>;\n sharedResourceRelationships: ResourceRelationship[];\n\n backendResourceConfigurations?: ResourceConfiguration_InitializationFactoryMap;\n backendResourceFieldIdentifiers?: Record<string, string>;\n backendResourceRelationships?: ResourceRelationship[];\n\n /**\n * App-declared notification badge definitions (merged with the framework's\n * `coreNotificationBadgeDefinitions` in the registry). DERIVED_QUERY badges\n * are recomputed by the dispatcher on source-resource mutations + on connect.\n */\n notificationBadgeDefinitions?: NotificationBadgeDefinition[];\n\n /**\n * Resources this application narrows by ORGANIZATION UNIT, keyed by resource type.\n *\n * assurance-control: WILDO.ACCESS.LEAST_PRIVILEGE — least-privilege confinement of a\n * unit-scoped principal to the records of their unit.\n *\n * Naming a resource here admits a caller whose authority for it comes ONLY from an organization\n * unit grant, and then confines every read and write to the rows of the units that grant covers.\n * ADDITIVE: a caller whose organization-wide role already satisfies the operation is not narrowed\n * at all, so opting a resource in can never shrink a result set someone could already see.\n *\n * `unitFieldName` must name a real field on that resource's schema holding the owning\n * `ORGANIZATION_UNITS` id. The authorization plane (membership, unit membership, units themselves,\n * and roles-bearing machine credentials) may never be declared here — startup fails closed if it\n * is, because a resource that ISSUES authority must not be governed by the authority it issues.\n */\n organizationUnitNarrowing?: Readonly<Partial<Record<string, OrganizationUnitNarrowingDeclaration>>>;\n\n customServiceImplementations: ResourceCustomServiceImplementationFactory[];\n\n\n customRoles?: RolesConfiguration;\n customControllers?: AbstractControllerBackendService[];\n container?: any;\n controllerWhiteList?: string[];\n isPlatformApplication?: boolean;\n /**\n * PLATFORM MODE ONLY (refused otherwise): the persistence adapter the platform service's OWN\n * resources are built on. Platform startups hydrate `AppConfigurationService` AFTER\n * `super.initialize()`, so the normal config-driven adapter resolution cannot see their choice\n * at repository-construction time — this passes the answer the platform already holds from its\n * Phase-1 bridged config. See `RepositoriesRegistryHandlerBackendService.platformModeDefaultAdapter`\n * for the full ordering rationale (Phase 5.2, D7). Non-platform applications declare their\n * adapter in application config (`DATABASE_DEFAULT_ADAPTER`); a second knob here would smuggle\n * the decision past that contract, which is why passing it without `isPlatformApplication`\n * throws.\n */\n platformPersistenceAdapter?: PersistenceAdapterType;\n\n customBatchesFactory?: (deps: {\n logger: LoggerService;\n errorBuilder: ErrorBuilderBackendService;\n errorHandler: ErrorHandlerService;\n executionContextCreatorService: ExecutionContextCreatorBackendService;\n resourcesRegistryService: ResourcesRegistryBackendService;\n repositoriesRegistryService: RepositoriesRegistryHandlerBackendService;\n servicesRegistryService: ServicesRegistryHandlerBackendService;\n }) => Map<string, BatchesCronjobsCustomExecution_Service<any, any>>;\n\n flowsActorsRegistry?: {\n flowActorSystemsFactoryMap?: FlowActorSystem_InitializationFactoryMap;\n agents?: FlowsActors_Agent[];\n functionTools?: FunctionTool[];\n };\n\n /**\n * App-declared NAMED external resource-server instances (R-2): multiple MCP servers and/or A2A\n * agents, each served at its own URL segment with its own RFC 8707 audience, discovery document,\n * and curated content (MCP tools via `operation.mcp.servers`; A2A skills via `actorSystemRefs`).\n *\n * Purely ADDITIVE — the unnamed default `/mcp` and `/a2a` surfaces always exist and are not\n * declared here. Membership refs are validated against the resource + actor-system registries at\n * startup, so a ref typo is a startup failure rather than a silently-empty surface.\n */\n resourceServerInstances?: ResourceServerInstance[];\n\n customLabels?: CustomLabelsMap;\n backendProviderRegistry?: BackendProviderRegistry;\n\n customFeatureDefinitions?: FeatureDefinitionWithAutoRegister[];\n customFeatureConfiguration?: {\n profiles?: Record<string, ScopeFeatures>;\n defaultProfile?: string;\n unavailabilityPolicy?: Partial<FeatureConfiguration['unavailabilityPolicy']>;\n };\n\n chartDefinitions?: ChartDefinition[];\n customMilestoneDefinitions?: MilestoneDefinition[];\n customMilestoneConditions?: Array<{ ref: string; fn: MilestoneConditionFn }>;\n productDefinitions?: ProductDefinition[];\n emailTemplateDefinitions?: EmailTemplateDefinitionsMap;\n /** Generated provider topology module imported by the application package. */\n providerRuntime?: ProviderRuntimeArtifact;\n /**\n * Backend-only generated PDF template bindings.\n *\n * Shared `z_file({ generation })` metadata carries only a stable\n * `templateId` because resource schemas are consumed by frontend,\n * specification, and companion surfaces. The live React-PDF template object\n * stays here, in backend startup configuration, and is validated against the\n * already-initialized resource registry before services/controllers accept\n * traffic.\n */\n pdfTemplateBindings?: PdfTemplateBindingsMap;\n backendConfig?: AppConfiguration_BackendAuthored;\n guidanceFlowDefinitions?: GuidanceFlowDefinition[];\n\n /**\n * Declarative data-seed definitions collected from `BackendDomainModule.seeds`.\n *\n * Consumed by the `DataSeedRegistry` / `DataSeedDispatcher` to run\n * application-lifecycle seeds at boot (Step 7.7) and resource-lifecycle /\n * lazy seeds at request time. See `.cursor/plans/seeding-first-class.md`.\n */\n dataSeeds?: DataSeedDefinition[];\n\n /**\n * Phase 7 / Item 47 (cron scheduler) — Slice 3.\n *\n * Custom scope-iteration callbacks aggregated from each module's\n * `BackendDomainModule.dataSeedScopeResolvers`. Forwarded to\n * `runDataSeedingApplicationBootstrap`, which calls\n * `DataSeedScopeResolverRegistryBackendService.registerResolvers` once\n * per boot.\n *\n * Cron seeds with `schedule.iterationStrategy === CUSTOM_RESOLVER`\n * resolve their `relatedId` rows via the resolver registered under the\n * matching `customResolverKey`.\n */\n dataSeedScopeResolvers?: Record<string, DataSeedScopeResolver>;\n\n /**\n * WHICH RUNTIME is booting this lifecycle, which determines which boot\n * ASSERTIONS apply. Defaults to\n * {@link ApplicationRuntimeProfile.APPLICATION_BACKEND}, so a host that does\n * not declare a profile is over-validated rather than under-validated.\n *\n * Distinct from {@link headlessMode} and its siblings: those control which\n * subsystems START, this controls which DECLARATION CLASSES are asserted to\n * be complete. See `application-runtime-profile.backend.ts`.\n */\n runtimeProfile?: ApplicationRuntimeProfile;\n /** Skip HTTP server initialization (used by apps-manager for E2E testing) */\n headlessMode?: boolean;\n /** Skip cron-job sync for non-HTTP runtimes like minions. */\n skipCronSync?: boolean;\n /**\n * Skip the shared application job consumers for runtimes that connect to\n * RabbitMQ only for their own dedicated topology (default: `false`).\n *\n * The canonical opt-in is a `BackgroundRuntimeType.MINION`: it reuses the\n * full backend startup lifecycle but must consume ONLY its own\n * `minion-tick.<name>` queue, never the shared operations/scheduled/callbacks\n * queues. When `true`, the queue-worker initializer still connects to the\n * broker (the minion's tick consumer needs that connection) but does NOT run\n * `jobConsumer.startConsuming()` — otherwise RabbitMQ would round-robin each\n * scheduled-cron tick between the backend-api pod and the minion, and the\n * minion would dead-letter every tick it cannot interpret (~50% loss).\n *\n * Sibling of {@link skipCronSync}; both default `false` so backend-api is\n * unaffected. Never set on the primary backend-api runtime.\n */\n skipJobConsumers?: boolean;\n /**\n * Runtime-specific decorator hook for the services registry.\n *\n * Used by the minion kernel to install resource-access enforcement without\n * changing the backend-api DI graph.\n */\n servicesRegistryDecoratorFactory?: (\n registry: ServicesRegistryHandlerBackendService,\n context: {\n appConfig: AppConfiguration;\n errorBuilder: ErrorBuilderBackendService;\n },\n ) => ServicesRegistryHandlerBackendService;\n /**\n * Runtime-specific hook that runs immediately after the resource catalog is\n * initialized and before downstream registries (services, flows/actors, controllers)\n * are installed.\n *\n * Minion startup uses this to cross-validate its `resourceAccess` whitelist\n * against the live application resource catalog.\n */\n afterResourcesRegistryInitialized?: (context: {\n appConfig: AppConfiguration;\n resourcesRegistryService: ResourcesRegistryBackendService;\n errorBuilder: ErrorBuilderBackendService;\n }) => Promise<void> | void;\n\n /**\n * Caller-supplied `<scope>.<name>` identifier for THIS backend process.\n * Runtime provider selection is now expected to come from materialized\n * provider-scope artifacts. Examples:\n * - `'services.backend-api'` for a regular backend service\n * - `'minions.marketingScrapper'` for a minion process\n * - `'workers.myRustWorker'` for a worker process\n *\n * Each app's bootstrap (`index.ts`) is responsible for choosing\n * the correct value. The current runtime keeps the field so the\n * materializer can bind the process to its provider scope without\n * inferring from `SERVICE_NAME`.\n */\n serviceIdentifier?: string;\n}\n\n/**\n * Start Application Backend Service\n *\n * Orchestrates the initialization of the backend application by:\n * 1. Initializing application configuration\n * 1.5. Initializing roles configuration (defaults + custom roles)\n * 2. Initializing resources registry with all 4 sources\n * 3. Initializing repositories registry with mongoose models\n * 4. Initializing services registry with business logic layer\n * 5. Initializing controllers registry with HTTP endpoints layer\n * 6. Initializing HTTP server with Express.js and middleware\n * 7. Validating all components are properly initialized\n *\n * This service ensures proper startup sequence and dependency management.\n */\n\n/** @wildo_source:part:start saas.backend.billing.resolution-failure-reasons facet:layer:backend facet:family:billing */\n/**\n * Why billing-provider resolution failed at startup. Each reason maps 1:1 to a\n * DISTINCT config surface an app author must fix, so `billing.enabled: true`\n * that cannot resolve a provider fails LOUD with an actionable message instead\n * of the historical catch-all (\"set providerRef + its secret\") that misdirected\n * authors to the secret when the real gap was backend-scope authoring.\n *\n * Read this as a debugging map — the fatal startup message names the surface,\n * and each reason below is the surface:\n * - PROVIDER_REF_UNSET → `billing.providerRef` in `./backend-api/src/saas-config.backend.ts`\n * - PROVIDER_NOT_REACHABLE_ON_BACKEND → author the ref under `providers.scopes.backend` in `./wildo.saas.config.ts` + a matching backend contribution in `./backend-api/src/provider-contributions.ts` (the classic trap: authored only in a frontend scope), then `wildo config sync`\n * - PROVIDER_DISABLED → the ref resolves but is disabled for the BILLING protocol in external-provider config\n * - SECRET_MISSING → the env var named by the provider's `secretRef` is absent from the per-env `providerEnv` secrets\n * - RESOLUTION_ERROR → the provider threw while resolving (registry / billing-SDK fault)\n */\nenum BillingProviderResolutionFailureReason {\n /** `billing.enabled` is true but `billing.providerRef` is unset. */\n PROVIDER_REF_UNSET = 'provider-ref-unset',\n /**\n * `providerRef` is set, but no billing runtime contract is exposed to the\n * backend registry for it — the provider is not authored in\n * `providers.scopes.backend` (a common trap: it is authored only in a\n * frontend scope) and/or has no matching backend runtime-owner\n * contribution. The provider is filtered out of the active catalog.\n */\n PROVIDER_NOT_REACHABLE_ON_BACKEND = 'provider-not-reachable-on-backend',\n /** The provider resolves but is disabled by external-provider configuration. */\n PROVIDER_DISABLED = 'provider-disabled',\n /** The provider resolves but its secret (env var `secretRef`) is absent. */\n SECRET_MISSING = 'secret-missing',\n /** An unexpected error was thrown while resolving (registry/SDK fault). */\n RESOLUTION_ERROR = 'resolution-error',\n}\n/** @wildo_source:part:end saas.backend.billing.resolution-failure-reasons */\n\n/**\n * Discriminated result of {@link StartApplicationBackendService.resolveBillingProvider}.\n * A `null` provider always carries a `reason` (and optional `detail`) so the\n * caller can build a surface-specific error instead of a generic one.\n */\ntype BillingProviderResolution =\n | { provider: StandardBilling_Interface; reason?: undefined; detail?: undefined }\n | { provider: null; reason: BillingProviderResolutionFailureReason; detail?: string };\n\n/**\n * Build the fatal startup message for a failed billing-provider resolution,\n * routed by {@link BillingProviderResolutionFailureReason} to the SPECIFIC\n * config surface the operator must fix. Historically this was a single\n * catch-all (\"set providerRef + its secret\"), which misdirected operators\n * whenever the real gap was backend-scope authoring (providerRef + secret\n * both present, provider simply not exposed to the backend runtime).\n *\n * Every branch names the file/field to edit and the follow-up command\n * (`wildo config sync`) so the message is actionable without reading source.\n */\nfunction describeBillingProviderResolutionFailure(\n reason: BillingProviderResolutionFailureReason,\n billingConfig: BillingConfiguration,\n detail?: string,\n): string {\n const providerRef = billingConfig.providerRef ?? '(unset)';\n const prefix = 'billing.enabled is true but the billing provider could not be resolved.';\n const disableHint = 'Alternatively set billing.enabled=false to run without billing.';\n\n switch (reason) {\n case BillingProviderResolutionFailureReason.PROVIDER_REF_UNSET:\n return `${prefix} billing.providerRef is unset — set it (e.g. 'stripe') in your `\n + `backend app config (saas-config.backend.ts → billing.providerRef). ${disableHint}`;\n\n case BillingProviderResolutionFailureReason.PROVIDER_NOT_REACHABLE_ON_BACKEND:\n return `${prefix} providerRef='${providerRef}' is set, but that provider is not exposed `\n + `to the BACKEND runtime, so no billing runtime contract could be loaded. A common `\n + `cause is authoring the provider only in a frontend scope. Fix: author '${providerRef}' `\n + `under providers.scopes.backend in wildo.saas.config.ts AND add a matching backend `\n + `contribution (runtimeTargets [{ kind: 'backend' }], protocols ['BILLING_PROVIDER', `\n + `'WEBHOOK_ORIGINATOR']) in the backend package's provider-contributions, then re-run `\n + `\\`wildo config sync\\` to regenerate the provider runtime artifact. ${disableHint}`;\n\n case BillingProviderResolutionFailureReason.PROVIDER_DISABLED:\n return `${prefix} providerRef='${providerRef}' resolves but is disabled by external-provider `\n + `configuration for the BILLING protocol. Enable it for this environment, then re-run `\n + `\\`wildo config sync\\`. ${disableHint}`;\n\n case BillingProviderResolutionFailureReason.SECRET_MISSING:\n return `${prefix} providerRef='${providerRef}' resolves but its secret `\n + `(env var '${detail ?? 'UNKNOWN'}') is missing. Populate it in your per-env secrets `\n + `(providerEnv) and re-run \\`wildo config sync\\` so it lands in the backend .env. ${disableHint}`;\n\n case BillingProviderResolutionFailureReason.RESOLUTION_ERROR:\n return `${prefix} providerRef='${providerRef}' threw while resolving`\n + `${detail ? `: ${detail}` : ''}. Inspect the backend provider registry / billing SDK `\n + `wiring. ${disableHint}`;\n\n default: {\n // Exhaustiveness guard: adding a new reason without a message\n // branch fails the type-check here rather than shipping a blank\n // fatal at runtime.\n const _exhaustive: never = reason;\n return `${prefix} providerRef='${providerRef}' (${String(_exhaustive)}). ${disableHint}`;\n }\n }\n}\n\n@injectable()\nexport class StartApplicationBackendService {\n /**\n * The profile this runtime booted under. Defaults FAIL-SAFE to `APPLICATION_BACKEND` — the\n * profile that asserts and reports the most — so a host that never declares one is never\n * silently exempted from a check it should run.\n */\n private resolvedRuntimeProfile: ApplicationRuntimeProfile = ApplicationRuntimeProfile.APPLICATION_BACKEND;\n\n protected logDebug: (message: string, context?: Record<string, unknown>) => void;\n protected isInitialized = false;\n private isPlatformMode = false;\n\n constructor(\n @inject(SAAS_SERVICE_TYPES.Logger) protected readonly logger: LoggerService,\n @inject(SAAS_SERVICE_TYPES.AppConfigService) protected readonly appConfigService: AppConfigurationService,\n @inject(SAAS_SERVICE_TYPES.ApplicationStartupConfigValidatorService) protected readonly applicationStartupConfigValidator: ApplicationStartupConfigValidatorService,\n @inject(SAAS_SERVICE_TYPES.ResourceRegistryService) protected readonly resourcesRegistryService: ResourcesRegistryBackendService,\n @inject(SAAS_SERVICE_TYPES.RepositoriesRegistryHandlerService) protected readonly repositoriesRegistryService: RepositoriesRegistryHandlerBackendService,\n @inject(SAAS_SERVICE_TYPES.ServicesRegistryHandlerService) protected servicesRegistryService: ServicesRegistryHandlerBackendService,\n @inject(SAAS_SERVICE_TYPES.ControllersRegistryHandlerService) protected readonly controllersRegistryService: ControllersRegistryHandlerBackendService,\n @inject(SAAS_SERVICE_TYPES.HttpServerService) protected readonly httpServerService: HttpServerBackendService,\n @inject(SAAS_SERVICE_TYPES.ErrorBuilderService) protected readonly errorBuilder: ErrorBuilderBackendService,\n @inject(SAAS_SERVICE_TYPES.ErrorHandlerService) protected readonly errorHandler: ErrorHandlerService,\n @inject(SAAS_SERVICE_TYPES.AuthorizationsService) protected readonly authorizationsService: AuthorizationsBackendService,\n @inject(SAAS_SERVICE_TYPES.BatchesCronjobsExecutorService) protected readonly batchesExecutor: BatchesCronjobsExecutor_BackendService,\n @inject(SAAS_SERVICE_TYPES.ExecutionContextCreatorBackendService) protected readonly executionContextCreatorBackendService: ExecutionContextCreatorBackendService,\n @inject(SAAS_SERVICE_TYPES.ResourceOperationCustomImplementationRegistryService) protected readonly customImplRegistry: ResourceOperationCustomImplementationRegistryBackendService,\n @inject(SAAS_SERVICE_TYPES.MongoDBService) protected readonly mongoDBService: MongoDBService,\n @inject(SAAS_SERVICE_TYPES.RedisService) protected readonly redisService: RedisService,\n @inject(SAAS_SERVICE_TYPES.I18nService) protected readonly i18nService: I18nBackendService,\n @inject(SAAS_SERVICE_TYPES.BackendProviderRegistryService) protected readonly backendProviderRegistryService: BackendProviderRegistryBackendService,\n @inject(SAAS_SERVICE_TYPES.ExternalProvidersRegistryService) protected readonly externalProvidersRegistryService: ExternalProvidersRegistryBackendService,\n @inject(SAAS_SERVICE_TYPES.FeatureDefinitionRegistryService) protected readonly featureDefinitionRegistryService: FeatureDefinitionRegistryBackendService,\n @inject(SAAS_SERVICE_TYPES.MilestoneDefinitionRegistry) protected readonly milestoneDefinitionRegistry: MilestoneDefinitionRegistryBackendService,\n @inject(SAAS_SERVICE_TYPES.MilestoneConditionRegistry) protected readonly milestoneConditionRegistry: MilestoneConditionRegistryBackendService,\n @inject(SAAS_SERVICE_TYPES.LifecycleEvaluator) protected readonly lifecycleEvaluator: LifecycleEvaluatorBackendService,\n @inject(SAAS_SERVICE_TYPES.FlowsActorsRegistryService) protected readonly flowsActorsRegistryService: FlowsActorsRegistryService,\n @inject(SAAS_SERVICE_TYPES.ResourceServerInstancesRegistry) protected readonly resourceServerInstancesRegistry: ResourceServerInstancesRegistryBackendService,\n @inject(SAAS_SERVICE_TYPES.QueueWorkerInitializerService) protected readonly queueWorkerInitializer: QueueWorkerInitializerBackendService,\n @inject(SAAS_SERVICE_TYPES.CronJobSyncService) protected readonly cronJobSyncService: CronJobSyncBackendService,\n @inject(SAAS_SERVICE_TYPES.ChartRegistryService) protected readonly chartRegistryService: ChartRegistryBackendService,\n @inject(SAAS_SERVICE_TYPES.GuidanceTriggerEvaluator) protected readonly guidanceTriggerEvaluator: GuidanceTriggerEvaluatorBackendService,\n @inject(SAAS_SERVICE_TYPES.EmailTemplateRegistry) protected readonly emailTemplateRegistryService: EmailTemplateRegistryBackendService,\n @inject(SAAS_SERVICE_TYPES.PdfTemplateBinding) protected readonly pdfTemplateBindingService: PdfTemplateBindingBackendService,\n @inject(SAAS_SERVICE_TYPES.FileStorageRouter) protected readonly fileStorageRouter: FileStorageRouterBackendService,\n // Phase 2.F — data-seeding subsystem. Registry stays inert until\n // Step 7.7 calls `registerSeeds(config.dataSeeds ?? [])`; dispatcher\n // is invoked from the same step (and later from Level-B hooks /\n // lazy-access — Phases 3 / 5).\n @inject(SAAS_SERVICE_TYPES.DataSeedRegistry) protected readonly dataSeedRegistryService: DataSeedRegistryBackendService,\n @inject(SAAS_SERVICE_TYPES.DataSeedDispatcher) protected readonly dataSeedDispatcherService: DataSeedDispatcherBackendService,\n // Phase 7 / Item 47 (Slice 3) — cron CUSTOM_RESOLVER registry. Same\n // boot lifecycle as `dataSeedRegistryService`: hydrated once in Step\n // 7.7 from `ApplicationInitializationConfig.dataSeedScopeResolvers`.\n @inject(SAAS_SERVICE_TYPES.DataSeedScopeResolverRegistry) protected readonly dataSeedScopeResolverRegistryService: DataSeedScopeResolverRegistryBackendService,\n // Slice 2 Phase 4 — observability reconcile + graceful-flush wiring. Appended LAST on\n // PURPOSE: `StartApplicationBackendService` has platform subclasses with FORWARDING\n // constructors that spread a positional `super([...])` array (see\n // `start-application.apps-manager.platform.service.ts` and `...registry.platform.service.ts`).\n // Inserting a param mid-list shifts every later arg and mis-injects them — it crashed the\n // apps-manager with \"featureDefinitionRegistryService.registerCoreFeatures is not a function\".\n // Appending keeps those subclasses aligned (they don't forward this last arg → it is\n // `undefined` there, which is HARMLESS because the reconcile call is gated on\n // `!isPlatformApplication`). Wonder-todos uses this class directly, so Inversify injects it\n // by symbol regardless of position. Optional type + `?.` call site reflect the platform case.\n @inject(SAAS_SERVICE_TYPES.ObservabilityBackendService) protected readonly observabilityBackendService?: ObservabilityBackendService,\n // APPENDED for the same subclass-forwarding reason as `observabilityBackendService` above:\n // subclasses that do not forward this arg receive `undefined`, which is harmless here — the\n // super-administrator floor REPORT degrades to a log-only finding when no audit sink is\n // bound, and the report is non-fatal by design either way.\n @inject(SAAS_SERVICE_TYPES.AuditLogsService) @optional() protected readonly auditLogsService?: AuditLogsBackendService,\n // Appended LAST (platform-subclass forwarding, as above). The organization-owner floor REPORT\n // builds its own whole-estate measuring context from this factory; a platform subclass that does\n // not forward it receives `undefined`, which is harmless — `reportOrganizationOwnerFloor` skips\n // when it is absent, and platform mode runs no tenant population anyway.\n @inject(SAAS_SERVICE_TYPES.AuthExecutionContextFactory) @optional()\n protected readonly authExecutionContextFactory?: AuthExecutionContextFactoryBackendService,\n // Appended for the same platform-subclass compatibility reason as the optional services above.\n ) {\n this.logger = logger;\n this.appConfigService = appConfigService;\n this.resourcesRegistryService = resourcesRegistryService;\n this.repositoriesRegistryService = repositoriesRegistryService;\n this.servicesRegistryService = servicesRegistryService;\n this.controllersRegistryService = controllersRegistryService;\n this.httpServerService = httpServerService;\n this.authorizationsService = authorizationsService;\n\n this.logDebug = this.logger.debugByType('StartApplicationBackendService');\n this.logger.setDebugTypeLogging('StartApplicationBackendService', false);\n\n this.logDebug('Start application service created');\n }\n\n /**\n * Initialize the backend application with a structured configuration object.\n */\n public async initialize(config: ApplicationInitializationConfig): Promise<void> {\n\n if (this.isInitialized) {\n this.logDebug('Application already initialized, skipping');\n return;\n }\n\n const {\n sharedResourceConfigurations,\n sharedResourceFieldIdentifiers,\n sharedResourceRelationships,\n backendResourceConfigurations,\n backendResourceFieldIdentifiers,\n backendResourceRelationships = [],\n notificationBadgeDefinitions,\n organizationUnitNarrowing,\n resourceServerInstances,\n customServiceImplementations,\n customRoles,\n customControllers,\n container,\n controllerWhiteList,\n isPlatformApplication = false,\n platformPersistenceAdapter,\n customBatchesFactory,\n flowsActorsRegistry,\n customLabels,\n backendProviderRegistry,\n customFeatureDefinitions,\n customFeatureConfiguration,\n chartDefinitions,\n customMilestoneDefinitions,\n customMilestoneConditions,\n productDefinitions,\n emailTemplateDefinitions,\n providerRuntime,\n pdfTemplateBindings,\n backendConfig,\n guidanceFlowDefinitions,\n dataSeeds,\n dataSeedScopeResolvers,\n runtimeProfile = ApplicationRuntimeProfile.APPLICATION_BACKEND,\n headlessMode = false,\n skipCronSync = false,\n skipJobConsumers = false,\n servicesRegistryDecoratorFactory,\n afterResourcesRegistryInitialized,\n } = config;\n\n // Resolved ONCE, here, so every gated validator below reads the same\n // decision. Resolving per-call-site would let two validators disagree\n // about the runtime they are validating.\n const bootAssertions = resolveApplicationRuntimeProfileBootAssertions(runtimeProfile);\n /**\n * Kept on the instance so LATER boot steps can consult the same profile this method resolved.\n * Boot steps run as separate methods, and one that has to re-derive the profile is one that\n * can derive it differently — the assertions exist precisely so every step reads one answer.\n */\n this.resolvedRuntimeProfile = runtimeProfile;\n\n try {\n this.logDebug('🚀 Starting backend application initialization...');\n // Step 1: Initialize application configuration\n this.logDebug('📋 Initializing application configuration...');\n\n // Persist platform mode for validation differences\n this.isPlatformMode = !!isPlatformApplication;\n\n if(!isPlatformApplication) {\n await this.appConfigService.initialize();\n if (providerRuntime) {\n this.appConfigService.applyProviderRuntime(providerRuntime);\n }\n this.appConfigService.applyBackendConfig(backendConfig ?? {});\n if (backendConfig) {\n this.logger.info('Backend config applied', {\n sections: Object.keys(backendConfig),\n });\n }\n this.appConfigService.assertNoPreOverridePlaceholders();\n this.logDebug('✅ Application configuration initialized successfully');\n /**\n * Establish the default MongoDB connection — ONLY when this application has a\n * MongoDB to connect to.\n *\n * The loader builds `database.mongodb` only when the environment supplies\n * `MONGODB_HOST`, so its ABSENCE is the application saying it has no MongoDB. Until\n * 2026-08-28 this connect was unconditional and rethrowing, which made a mongod a\n * hard boot requirement for every application — including one whose every resource\n * is on PostgreSQL.\n *\n * Contrast the two blocks immediately below: Redis degrades to in-memory with a\n * warning, and file storage is explicitly non-fatal. MongoDB was the only backing\n * service that could refuse a boot by being absent rather than by being broken.\n *\n * It stays FATAL when a MongoDB IS declared and the connection fails — that is a\n * real outage and must not be softened into a warning.\n */\n if (this.appConfigService.config.database?.mongodb) {\n try {\n await this.mongoDBService.connect();\n this.logDebug('✅ MongoDB default connection established');\n } catch (e) {\n this.logger.error('❌ MongoDB default connection failed', e as any);\n throw e;\n }\n } else {\n this.logDebug('↷ No MongoDB configured for this application — skipping the default connection.');\n }\n // Establish Redis connection for caching, sessions, and WebSocket sync\n // Redis is optional - graceful fallback to in-memory if unavailable\n try {\n await this.redisService.connect();\n this.logDebug('✅ Redis connection established');\n } catch (e) {\n this.logger.warn('⚠️ Redis connection failed, using in-memory fallbacks', { ...projectCaughtErrorLogFields(e) });\n }\n\n // Initialize file storage (MinIO/S3) — optional, skipped when not configured\n if (this.fileStorageRouter.isConfigured()) {\n try {\n await this.fileStorageRouter.initialize();\n this.logDebug('✅ File storage initialized');\n } catch (e) {\n // Non-fatal AND not final. An application backend fetches short-lived storage\n // credentials from apps-manager, so a backend that boots BEFORE its issuer is\n // listening fails here with ECONNREFUSED through no fault of its own — an\n // ordinary outcome of concurrent respawn.\n //\n // `WildoManagedStorageProvider.healthCheck()` retries acquisition on every\n // readiness probe, so this clears WITHOUT a restart once the issuer is up\n // (proven live on a platform service 2026-08-13: same PID, monotonic uptime,\n // unhealthy → healthy). The previous wording — \"file operations will fail at\n // runtime\" — described the behaviour before that recovery existed, and now\n // sends whoever greps this log hunting a defect that will have fixed itself.\n this.logger.warn('⚠️ File storage initialization failed at startup — will retry on each readiness probe', { ...projectCaughtErrorLogFields(e) });\n }\n } else {\n this.logDebug('📦 File storage not configured, skipping initialization');\n }\n }\n\n // This is the only application-config read allowed before the\n // platform subclass hydrates AppConfigurationService. The helper\n // branches before evaluating the throwing getter, then every\n // startup decision below consumes this resolved boundary value.\n const applicationConfig = resolveApplicationConfigForStartup(this.appConfigService, isPlatformApplication);\n\n if (applicationConfig) {\n this.applicationStartupConfigValidator.validate(applicationConfig);\n }\n\n // Step 1.5: Initialize roles configuration\n this.logDebug('🔐 Initializing roles configuration...');\n if (customRoles) {\n this.authorizationsService.initializeRolesWithCustom(customRoles);\n this.logDebug('✅ Roles configuration initialized with custom roles');\n } else {\n // Roles are already initialized with defaults in the constructor\n this.logDebug('✅ Roles configuration using default roles only');\n }\n\n // Step 2: Initialize resources registry with all 4 sources\n this.logDebug('🔧 Initializing resources registry...');\n\n // Read lifecycle config early — needed for both resource exclusion and evaluator init\n // Platform apps don't use lifecycle, billing, or feature gating\n const lifecycleConfig: LifecycleConfig | undefined = applicationConfig?.lifecycle;\n\n // Compute excluded resource types based on app configuration.\n // When billing/lifecycle is disabled, their resource types are excluded\n // from the registry (no routes, no repositories, no frontend resources).\n // When billing IS enabled, scope variants for scopes not in enabledScopes\n // are also excluded (e.g., USER variants when only ORG billing is enabled).\n const excludedResourceTypes = resolveFeatureGatedCoreResourceExclusions(\n applicationConfig,\n { isPlatformApplication },\n );\n\n if (excludedResourceTypes) {\n this.logDebug(`Feature-gated resources excluded: ${excludedResourceTypes.size} types`, {\n billingDisabled: !applicationConfig?.billing?.enabled,\n billingDisabledScopes: (() => {\n const billingConfig = applicationConfig?.billing;\n if (!billingConfig?.enabled) return 'all';\n const enabledSet = new Set<string>(billingConfig.enabledScopes ?? []);\n return BILLING_SCOPES.filter(s => !enabledSet.has(s));\n })(),\n lifecycleDisabled: !lifecycleConfig?.enabled,\n });\n }\n\n await this.resourcesRegistryService.initialize(\n sharedResourceConfigurations,\n sharedResourceFieldIdentifiers,\n sharedResourceRelationships,\n (backendResourceConfigurations ?? {}) as ResourceConfiguration_InitializationFactoryMap,\n backendResourceFieldIdentifiers,\n backendResourceRelationships,\n notificationBadgeDefinitions,\n undefined, // customAdditionalUserNotificationDefinitions\n excludedResourceTypes,\n organizationUnitNarrowing,\n );\n this.logDebug('✅ Resources registry initialized successfully');\n if (applicationConfig && afterResourcesRegistryInitialized) {\n await afterResourcesRegistryInitialized({\n appConfig: applicationConfig,\n resourcesRegistryService: this.resourcesRegistryService,\n errorBuilder: this.errorBuilder,\n });\n this.logDebug('✅ Runtime-specific resource-catalog hook completed');\n }\n\n this.pdfTemplateBindingService.initialize(pdfTemplateBindings ?? {}, {\n assertCompleteness: bootAssertions.assertsGeneratedPdfBindingCompleteness,\n });\n this.logDebug('✅ PDF template bindings initialized successfully');\n\n // Step 2.0.1: Initialize feature definition registry\n this.logDebug('🏷️ Initializing feature definition registry...');\n this.featureDefinitionRegistryService.registerCoreFeatures();\n if (customFeatureDefinitions && customFeatureDefinitions.length > 0) {\n this.featureDefinitionRegistryService.registerCustomFeatures(customFeatureDefinitions);\n }\n this.featureDefinitionRegistryService.validateDefinitions();\n this.featureDefinitionRegistryService.logStartupSummary();\n\n // Build and set the merged FeatureConfiguration (profiles + policy)\n if (customFeatureConfiguration) {\n const allDefinitions = this.featureDefinitionRegistryService.getAllDefinitions();\n this.featureDefinitionRegistryService.setConfiguration({\n definitions: allDefinitions,\n profiles: customFeatureConfiguration.profiles ?? {},\n defaultProfile: customFeatureConfiguration.defaultProfile,\n unavailabilityPolicy: {\n defaultBehavior: customFeatureConfiguration.unavailabilityPolicy?.defaultBehavior ?? FeatureUnavailabilityBehavior.UPGRADE_PROMPT,\n whenBillingDisabled: customFeatureConfiguration.unavailabilityPolicy?.whenBillingDisabled ?? FeatureUnavailabilityBehavior.HIDE,\n roleDefaults: customFeatureConfiguration.unavailabilityPolicy?.roleDefaults ?? {},\n reasonDefaults: customFeatureConfiguration.unavailabilityPolicy?.reasonDefaults ?? {\n [FeatureUnavailabilityReason.FEATURE_NOT_ENABLED]: FeatureUnavailabilityBehavior.UPGRADE_PROMPT,\n [FeatureUnavailabilityReason.LIMIT_EXCEEDED]: FeatureUnavailabilityBehavior.LIMIT_UPGRADE_PROMPT,\n [FeatureUnavailabilityReason.NOT_CONFIGURED]: FeatureUnavailabilityBehavior.HIDE,\n },\n },\n });\n this.logDebug('✅ Feature configuration set (profiles + unavailability policy)');\n }\n const analyticsValueMoments = applicationConfig?.analytics?.valueMoments;\n\n this.featureDefinitionRegistryService.warnMisplacedLimitFeatures();\n this.featureDefinitionRegistryService.warnInvalidFeatureReferences({\n featureProfiles: customFeatureConfiguration?.profiles,\n chartDefinitions,\n guidanceFlowDefinitions,\n productDefinitions,\n analyticsValueMoments,\n });\n this.logDebug('✅ Feature definition registry initialized successfully');\n\n // Step 2.0.2: Initialize milestone definition registry\n this.logDebug('🏅 Initializing milestone definition registry...');\n if (customMilestoneConditions && customMilestoneConditions.length > 0) {\n for (const { ref, fn } of customMilestoneConditions) {\n this.milestoneConditionRegistry.registerCondition(ref, fn);\n }\n this.logDebug(`Registered ${customMilestoneConditions.length} custom milestone condition(s)`);\n }\n if (customMilestoneDefinitions && customMilestoneDefinitions.length > 0) {\n this.milestoneDefinitionRegistry.registerCustomMilestones(customMilestoneDefinitions);\n this.milestoneDefinitionRegistry.validateDefinitions();\n this.milestoneDefinitionRegistry.logStartupSummary();\n }\n this.logDebug('✅ Milestone definition registry initialized successfully');\n\n // Step 2.0.3: Initialize lifecycle evaluator configuration\n if (!isPlatformApplication && lifecycleConfig?.enabled) {\n this.logDebug('🔄 Initializing lifecycle evaluator...');\n this.lifecycleEvaluator.setLifecycleConfig(lifecycleConfig);\n\n // Late-binding initialization for lifecycle custom implementations\n initializeLifecycleCustomImplementations(this.lifecycleEvaluator, lifecycleConfig, this.errorBuilder);\n\n // Validate activation criteria refs against registries\n if (lifecycleConfig.activationCriteria?.criteria) {\n for (const criterion of lifecycleConfig.activationCriteria.criteria) {\n if (criterion.criterionType === ActivationCriterionType.MILESTONE) {\n const exists = !!this.milestoneDefinitionRegistry.getDefinition(criterion.milestoneRef);\n if (!exists) {\n this.logger.warn(`Lifecycle activation criterion references unknown milestone: '${criterion.milestoneRef}'`);\n }\n } else if (criterion.criterionType === ActivationCriterionType.GUIDANCE_COMPLETED) {\n this.logDebug(`Lifecycle activation criterion references guidance flow: '${criterion.guidanceFlowRef}' (validated at runtime)`);\n }\n }\n }\n\n this.logDebug('✅ Lifecycle evaluator configured', {\n dormancyThresholdDays: lifecycleConfig.dormancyThresholdDays,\n activityDebounceMinutes: lifecycleConfig.activityDebounceMinutes,\n dormancyCronSchedule: lifecycleConfig.dormancyCronSchedule,\n activationCriteriaCount: lifecycleConfig.activationCriteria?.criteria?.length ?? 0,\n });\n } else if (!isPlatformApplication) {\n this.logDebug('🔄 Lifecycle system disabled (lifecycle.enabled = false or not configured)');\n }\n\n // Step 2.1: Initialize first-class backend provider registry.\n //\n // The composed catalog (engine + app-contributed via\n // `backendProviderRegistry`) is filtered by the authored\n // `providerRuntime.providerRefs` so this backend process only\n // exposes providers materialized for it. Any ref claimed by the\n // runtime artifact but missing from the catalog fails startup\n // loudly — there is no silent fallback to the unfiltered catalog.\n this.logDebug('📦 Initializing backend provider registry...');\n this.backendProviderRegistryService.initialize(backendProviderRegistry, providerRuntime);\n this.logDebug('✅ Backend provider registry initialized', {\n providerRuntimeApplied: Boolean(providerRuntime),\n providerCount: this.backendProviderRegistryService.getRegistry().modules.size,\n });\n\n // Step 2.2: Initialize external providers registry.\n // Skip for platform applications - they initialize config later and will refresh the registry\n if (applicationConfig) {\n this.logDebug('🔌 Initializing external providers registry...');\n await this.externalProvidersRegistryService.initialize();\n this.logDebug('✅ External providers registry initialized successfully');\n\n // F5 (audit Phase 5) — required-capability boot guard. Fail LOUD if any\n // capability the app marked `activation.required` resolves no active\n // provider (a hard requirement with nothing to serve it). Generalizes the\n // audit coherence to EVERY capability; audit is the first user, not special.\n // (Platform apps initialize the registry later, in the `else` branch — they\n // author no `required` capabilities, so the guard belongs on the app path.)\n const missingRequiredCapabilities = this.externalProvidersRegistryService.getRequiredCapabilitiesWithoutProvider();\n if (missingRequiredCapabilities.length > 0) {\n throw this.errorBuilder.buildError(ErrorType.CONFIGURATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.CONFIGURATION,\n context: {\n message:\n `Required engine capabilities resolve no active provider: [${missingRequiredCapabilities.join(', ')}]. `\n + 'Each is marked `required` in engineCapabilities but has no provider serving it — '\n + 'declare a provider for it (SELECT_ONE needs a primary; FAN_OUT needs ≥1 declared), '\n + 'or drop the `required` flag.',\n missingRequiredCapabilities,\n },\n });\n }\n\n // G4 (audit Phase 5) — fail-OPEN audit-sink reconcile. Distinct from the\n // F5 hard guard above: this WARNS (never throws) when COMPLIANCE_AUDIT_TRAIL\n // is ENABLED but no provider resolves to deliver it — the operator turned on\n // Layer-2 audit fan-out yet nothing serves it (Layer-1 database audit is\n // unaffected). Mirrors ObservabilityBackendService's declared-but-inactive\n // reconcile. The resolved-provider-refs check is the faithful proxy for \"the\n // composite resolves zero live sinks\" (it builds one sink per resolved ref).\n // A `required` audit cap with no provider already threw in F5 above, so this\n // only fires for an enabled-but-not-required capability.\n //\n // Gated on the runtime profile: only a runtime EXPECTED to host the Layer-2\n // audit fan-out (the application backend) treats \"enabled but no provider\" as\n // a misconfiguration. An auxiliary runtime such as a minion is Layer-1-only by\n // design — the immudb node client is installed only in the backend, and the\n // backend's `immudb.audit-reconcile` cron backfills the minion's `AUDIT_LOGS`\n // rows into Layer-2 — so warning there is false-alarm noise on every restart,\n // not a real signal. `assertsLayer2AuditProviderPresence` is read off the same\n // `bootAssertions` decision resolved once above, so this gate cannot disagree\n // with the sibling profile-gated validators about which runtime is booting.\n if (\n shouldWarnLayer2AuditProviderInactive({\n runtimeAssertsLayer2AuditProviderPresence: bootAssertions.assertsLayer2AuditProviderPresence,\n complianceAuditTrailEnabled: this.externalProvidersRegistryService.isEngineCapabilityEnabled(\n EngineCapability.COMPLIANCE_AUDIT_TRAIL,\n ),\n resolvedAuditProviderRefCount: this.externalProvidersRegistryService.getResolvedProviderRefsForCapability(\n EngineCapability.COMPLIANCE_AUDIT_TRAIL,\n ).length,\n })\n ) {\n this.logger.warn(\n 'COMPLIANCE_AUDIT_TRAIL is enabled but no audit-log provider resolves — Layer-2 provider '\n + 'audit fan-out is INACTIVE (Layer-1 database audit is unaffected). Declare an audit provider '\n + '(e.g. immudb) in defineSaaSProviders, or disable the capability if Layer-1 alone is intended.',\n );\n }\n } else {\n this.logDebug('🔌 Skipping external providers registry initialization (platform app - will initialize after config is ready)');\n }\n\n // Step 2.3: Initialize flows-actors registry\n this.logDebug('🎭 Initializing flows-actors registry...');\n const mergedFlowActorSystemsFactoryMap = {\n ...(flowsActorsRegistry?.flowActorSystemsFactoryMap || {}),\n };\n const mergedAgents = [\n ...(flowsActorsRegistry?.agents || []),\n ];\n const mergedFunctionTools = [\n ...(flowsActorsRegistry?.functionTools || []),\n ];\n await this.flowsActorsRegistryService.initialize(\n mergedFlowActorSystemsFactoryMap,\n mergedAgents,\n mergedFunctionTools\n );\n this.logDebug('✅ Flows-actors registry initialized successfully');\n\n // Step 2.3b: Register the app's NAMED external resource-server instances (multiple MCP\n // servers / A2A agents) and validate their membership refs. Runs HERE deliberately — after\n // BOTH the resources registry (Step 2.1, for `operation.mcp.servers`) and the flows-actors\n // registry (Step 2.3, for an agent's `actorSystemRefs`) — because validation resolves refs\n // against them. A bad ref throws a CONFIGURATION error and fails startup (fail-closed):\n // a tool that silently belongs to no catalog, or a card advertising an unroutable skill,\n // is worse than a refusal to boot.\n // Membership validation is gated on the runtime profile: it asserts that every\n // `operation.mcp.servers` / `actorSystemRefs` ref resolves to a declared instance,\n // which is only meaningful for a runtime that actually SERVES those transports.\n // A minion mounts none and carries no declarations, so running this would fail its\n // boot over refs describing a surface it cannot expose — the exact crash-loop that\n // motivated the profile mechanism. Registration itself always runs: an empty\n // registry is the correct state for a non-serving runtime, and `tryGetInstance`\n // callers stay fail-closed against it.\n this.logDebug('🔀 Registering external resource-server instances...');\n this.resourceServerInstancesRegistry.initialize(resourceServerInstances);\n if (bootAssertions.assertsResourceServerMembershipCompleteness) {\n this.resourceServerInstancesRegistry.validateDeclaredMembership(\n this.flowsActorsRegistryService.getActors().map((system) => system.ref),\n );\n this.logDebug('✅ External resource-server instances registered + validated');\n } else {\n this.logDebug('✅ External resource-server instances registered (membership validation N/A for this runtime profile)', {\n runtimeProfile,\n });\n }\n\n // Step 2.4: Initialize I18n service with custom labels\n this.logDebug('🌐 Initializing I18n service...');\n this.i18nService.initialize(customLabels || {}, {\n suppressEmptyWarning: isPlatformApplication,\n });\n this.logDebug('✅ I18n service initialized successfully');\n\n // Step 2.4b: Initialize email template registry\n if (emailTemplateDefinitions && Object.keys(emailTemplateDefinitions).length > 0) {\n this.emailTemplateRegistryService.initialize(emailTemplateDefinitions);\n }\n\n if (!isPlatformApplication) {\n // Reconcile OTLP observability (post-config): compare the `--import` preload's\n // runtime state against the OBSERVABILITY_TELEMETRY provider selection, warn on\n // mismatch (E11), and wire graceful telemetry flush into the shutdown coordinator.\n // `?.` — platform subclasses don't forward this arg (see the constructor note); this\n // branch is non-platform so it's always defined here, but the guard is defensive.\n this.observabilityBackendService?.initialize();\n }\n\n // Step 2.5: Register chart definitions\n if (chartDefinitions && chartDefinitions.length > 0) {\n this.logDebug('📊 Registering chart definitions...', { count: chartDefinitions.length });\n for (const chartDef of chartDefinitions) {\n this.chartRegistryService.registerChart(chartDef);\n }\n this.logDebug('✅ Chart definitions registered successfully', { count: chartDefinitions.length });\n } else {\n this.logDebug('📊 No chart definitions provided, skipping chart registration');\n }\n\n // Step 2.5b: Register guidance flow definitions\n if (guidanceFlowDefinitions && guidanceFlowDefinitions.length > 0) {\n this.logDebug('🧭 Registering guidance flow definitions...', { count: guidanceFlowDefinitions.length });\n this.guidanceTriggerEvaluator.initializeFlows(guidanceFlowDefinitions);\n this.logDebug('✅ Guidance flow definitions registered successfully', { count: guidanceFlowDefinitions.length });\n } else {\n this.logDebug('🧭 No guidance flow definitions provided, skipping guidance registration');\n }\n\n // Step 2.6: Debug URL generation\n this.logDebug('🌐 Displaying generated URLs for debugging...');\n this.resourcesRegistryService.debugDisplayGeneratedUrls();\n\n // Step 3: Initialize repositories registry\n this.logDebug('🗄️ Initializing repositories registry...');\n const resourcesRegistry = this.resourcesRegistryService.getResourcesRegistry();\n\n // Guardrail: a REQUIRED composition-parent FK that the user must supply on\n // org-wide create (the parent is OPTIONAL_CONTEXT/STANDALONE) must be\n // user-fillable — otherwise the create form is silently dead (the\n // todoListId-create class of bug). Surface violations at boot rather than as\n // an unexplained client-side validation failure.\n //\n // Severity split: TARGET_NOT_SEARCHABLE degrades the picker → WARN (a custom\n // create surface might still supply the FK). EXCLUDED_FROM_CREATE is genuinely\n // impossible to create (no context, no control) → FAIL loud so the misconfig\n // never ships. The validator call itself is try/catch-guarded so a validator\n // edge case can never block startup; the intentional FAIL throw is outside\n // that guard so it propagates.\n let fkFillabilityViolations: ForeignKeyFillabilityViolation[] = [];\n try {\n fkFillabilityViolations = validateRequiredForeignKeyFillability(\n resourcesRegistry.resourceConfigurations as any,\n );\n } catch (error) {\n this.logger.warn('⚠️ required-foreign-key fillability guardrail skipped (validation error)', {\n ...projectCaughtErrorLogFields(error),\n });\n }\n for (const violation of fkFillabilityViolations) {\n if (violation.severity === ForeignKeyFillabilityViolationSeverity.WARN) {\n this.logger.warn(`⚠️ Required foreign key may be unfillable on create [${violation.kind}]: ${violation.message}`, {\n resourceType: violation.resourceType,\n foreignKeyField: violation.foreignKeyField,\n parentResourceType: violation.parentResourceType,\n kind: violation.kind,\n });\n }\n }\n const fkFillabilityFailures = fkFillabilityViolations.filter(\n (violation) => violation.severity === ForeignKeyFillabilityViolationSeverity.FAIL,\n );\n if (fkFillabilityFailures.length > 0) {\n throw new Error(\n `Resource configuration error — ${fkFillabilityFailures.length} required foreign key(s) are impossible to fill on create:\\n` +\n fkFillabilityFailures.map((failure) => ` • ${failure.message}`).join('\\n'),\n );\n }\n\n // --- Composition-seedability guard (onParentCreate lifecycle) ---\n // FAIL-CLOSED: a composition that OPTED IN to `onParentCreate.enabled` but\n // whose child is not seedable (not default-materializable AND no override)\n // is a genuine misconfig — the runtime seed would silently no-op. It fires\n // ONLY on enabled adopters, so it never trips the dozens of on-demand\n // compositions that legitimately do not eager-seed. The validator call is\n // try/catch-guarded so a validator edge case can never block startup; the\n // intentional throw is outside that guard. See\n // .claude/plans/composition-oncreate-lifecycle.md.\n let compositionSeedabilityViolations: CompositionSeedabilityViolation[] = [];\n try {\n compositionSeedabilityViolations = validateCompositionSeedability(\n resourcesRegistry.resourceConfigurations as any,\n );\n } catch (error) {\n this.logger.warn('⚠️ composition-seedability guardrail skipped (validation error)', {\n ...projectCaughtErrorLogFields(error),\n });\n }\n for (const violation of compositionSeedabilityViolations) {\n this.logger.warn(`⚠️ [composition-seedability] ${violation.message}`, {\n childResourceType: violation.childResourceType,\n parentResourceType: violation.parentResourceType,\n missingFields: violation.missingFields,\n });\n }\n if (compositionSeedabilityViolations.length > 0) {\n throw new Error(\n `Resource configuration error — ${compositionSeedabilityViolations.length} composition relationship(s) enabled ` +\n `onParentCreate seeding but are not seedable:\\n` +\n compositionSeedabilityViolations.map((violation) => ` • ${violation.message}`).join('\\n'),\n );\n }\n\n // --- Composition cascade-DELETABILITY guard (onParentDelete lifecycle) ---\n // The delete-side counterpart of the seedability guard above. It is wired FAIL-CLOSED for\n // IMPERSONALIZE_AND_RETAIN edges only, and warn-only for DELETE edges:\n // - DELETE violations are a KNOWN, pre-existing backlog (the 16 billing edges tracked in\n // KNOWN_CASCADE_DELETABILITY_GAPS) awaiting a compliance decision — throwing on them\n // would fail boot on the current registry, so they stay a warning until resolved.\n // - IMPERSONALIZE_AND_RETAIN violations have NO such backlog (no core edge declares the\n // strategy yet), and their runtime failure mode is far worse: the misconfiguration\n // surfaces only when a real erasure runs, throws INSIDE the parent-delete transaction\n // and rolls the deletion back — i.e. a GDPR erasure request fails in production. Catch\n // it at boot instead.\n let cascadeDeletabilityViolations: CompositionCascadeDeletabilityViolation[] = [];\n try {\n cascadeDeletabilityViolations = validateCompositionCascadeDeletability(\n resourcesRegistry.resourceConfigurations as any,\n );\n } catch (error) {\n this.logger.warn('⚠️ composition-cascade-deletability guardrail skipped (validation error)', {\n ...projectCaughtErrorLogFields(error),\n });\n }\n const retainCascadeViolations = cascadeDeletabilityViolations.filter(\n (violation) => violation.strategy === ChildLifecycleStrategy.IMPERSONALIZE_AND_RETAIN,\n );\n const deleteCascadeViolations = cascadeDeletabilityViolations.filter(\n (violation) => violation.strategy !== ChildLifecycleStrategy.IMPERSONALIZE_AND_RETAIN,\n );\n // ONE aggregated line for the known DELETE backlog — per-violation warnings would put ~16\n // lines in every boot log and train operators to ignore the channel.\n if (deleteCascadeViolations.length > 0) {\n // Report the EDGES, not a presumed cause. An earlier version asserted \"known backlog —\n // pending a retain-vs-delete compliance decision\", which is true only for the billing\n // families; a live run showed platform resources in the same list, where the cause is\n // simply a missing DELETE op. Stating one registry's story for every registry's\n // violations is how an operator learns to ignore the channel.\n const distinctEdges = [\n ...new Set(deleteCascadeViolations.map((v) => `${v.childResourceType} <- ${v.parentResourceType}`)),\n ];\n this.logger.warn(\n `⚠️ [composition-cascade-deletability] ${distinctEdges.length} onParentDelete edge(s) declare a DELETE ` +\n `cascade toward a child that cannot be cascade-deleted (missing discovery and/or DELETE op). Deleting ` +\n `such a parent throws CONFIGURATION inside its delete transaction and ROLLS BACK the parent delete, ` +\n `once a child row exists. Each edge needs a decision: add the missing op(s), retain the children ` +\n `(disable the cascade, or use strategy IMPERSONALIZE_AND_RETAIN with a retention-governed child), or ` +\n `drop onParentDelete.`,\n {\n edges: distinctEdges,\n // Surfaced because a duplicated pair means the SAME relationship is registered twice\n // for that child — a registry-assembly problem, not a cascade problem.\n duplicatedEdgeReports: deleteCascadeViolations.length - distinctEdges.length,\n },\n );\n }\n for (const violation of retainCascadeViolations) {\n this.logger.warn(`⚠️ [composition-cascade-deletability] ${violation.message}`, {\n childResourceType: violation.childResourceType,\n parentResourceType: violation.parentResourceType,\n strategy: violation.strategy,\n });\n }\n if (retainCascadeViolations.length > 0) {\n throw new Error(\n `Resource configuration error — ${retainCascadeViolations.length} composition relationship(s) declared ` +\n `onParentDelete.strategy = IMPERSONALIZE_AND_RETAIN but cannot be impersonalized-and-retained:\\n` +\n retainCascadeViolations.map((violation) => ` • ${violation.message}`).join('\\n'),\n );\n }\n\n // --- Composition seed op-path resolvability guard (onParentCreate lifecycle) ---\n // Complements the saas-models seedability guard above. That one verifies the\n // child's CREATE *DTO* is fillable; it cannot see whether the seed's SERVICE\n // op-path resolves — a backend-only concern. At seed time `createAsSystem`\n // resolves the child's default CREATE op via `getServiceOperationPathDefault`,\n // which accepts ONLY INTERNAL_CALL / API_CALL / API_CALL_WITH_CALLBACK — a\n // REPOSITORY_ONLY (or absent) default CREATE throws OPERATION_PATH_NOT_FOUND and\n // the runtime seed silently no-ops (the exact bug runtime-verify caught on the\n // first org/state adopters). Catch that class at boot, fail-closed, by reusing\n // the very resolver the seed uses (config-only, so callable here). Feature-gated\n // children are legitimately absent from the registry (the runtime seed skips\n // them the same way via `tryGetResourceConfiguration`) → they must not fail boot.\n const compositionSeedOpPathViolations: string[] = [];\n for (const childConfig of Object.values(\n resourcesRegistry.resourceConfigurations,\n ) as unknown as CompositionSeedabilityResourceInput[]) {\n const childResourceType = childConfig.resourceIdentifier;\n const parentRelationships: ResourceRelationship[] = childConfig.resourceRelationships?.parentRelationships ?? [];\n for (const relationship of parentRelationships) {\n if (relationship.nature !== RelationshipNature.COMPOSITION) continue;\n if (relationship.childOperations?.lifecycle?.onParentCreate?.enabled !== true) continue;\n // Feature-excluded child → absent from the registry → the runtime seed\n // skips it (same `tryGetResourceConfiguration` check), so don't fail boot.\n if (!this.resourcesRegistryService.tryGetResourceConfiguration(childResourceType)) continue;\n try {\n this.resourcesRegistryService.getServiceOperationPathDefault(\n childResourceType,\n CoreResourceOperation.CREATE,\n );\n } catch {\n compositionSeedOpPathViolations.push(\n `Composition child '${childResourceType}' (parent '${relationship.resourceType1}') enabled ` +\n `onParentCreate but createAsSystem cannot resolve a default CREATE service op-path — typically a ` +\n `REPOSITORY_ONLY or absent default CREATE variant (the service tier accepts only INTERNAL_CALL / ` +\n `API_CALL). The runtime seed would silently no-op. Make the default CREATE variant INTERNAL_CALL.`,\n );\n }\n }\n }\n if (compositionSeedOpPathViolations.length > 0) {\n throw new Error(\n `Resource configuration error — ${compositionSeedOpPathViolations.length} composition relationship(s) enabled ` +\n `onParentCreate seeding but their child has no service-resolvable default CREATE op:\\n` +\n compositionSeedOpPathViolations.map((message) => ` • ${message}`).join('\\n'),\n );\n }\n\n const resourceConfigurations = new Map(\n Object.entries(resourcesRegistry.resourceConfigurations) as [ResourceType, ResourceConfiguration<any, any, any>][]\n );\n\n if (platformPersistenceAdapter !== undefined && !isPlatformApplication) {\n throw new Error(\n 'platformPersistenceAdapter is a PLATFORM-MODE parameter. An application declares its '\n + 'persistence adapter in application config (DATABASE_DEFAULT_ADAPTER); accepting it here '\n + 'would smuggle the decision past that contract.',\n );\n }\n if (platformPersistenceAdapter !== undefined) {\n // BEFORE initializeRepositories, necessarily: this is the construction-time answer.\n this.repositoriesRegistryService.setPlatformModeDefaultPersistenceAdapter(platformPersistenceAdapter);\n }\n\n // Initialize repositories registry on the active default connection\n const activeConnection = this.mongoDBService.getConnection();\n await this.repositoriesRegistryService.initializeRepositories(resourceConfigurations, activeConnection || undefined);\n this.logDebug('✅ Repositories registry initialized successfully');\n\n // PostgreSQL DDL is owned OUTSIDE the engine (the schema planner plans; migrations apply),\n // so a PostgreSQL-backed table can silently disagree with what the repository writes — most\n // sharply for framework-owned columns no app schema declares. Prove the physical tables\n // match the plan HERE, once, rather than letting the first request fail on a bare\n // `column \"...\" does not exist`. Deliberately after `initializeRepositories` (the plans must\n // exist) and outside it (the PostgreSQL connection is lazy and need not be reachable while\n // repositories are being constructed). No-op unless a resource is PostgreSQL-backed, so it\n // never forces a connection an application does not use.\n // THE PRODUCTION MIGRATION DOOR (K7), deliberately immediately BEFORE the schema gate:\n // the runner brings the database to the shipped migrations' state, then the gate verifies\n // the result — so the gate stays the backstop even for the runner itself (K6). Both\n // no-op unless a resource is PostgreSQL-backed, and the runner additionally no-ops when\n // the deployable ships no migrations directory. Concurrency (N instances booting at\n // once) is the runner's own property via the in-database advisory lock.\n //\n // PLATFORM MODE DEFERS BOTH (Phase 5.2): the AppConfigurationService a platform service\n // hydrates AFTER this method cannot answer connection questions here, and this shared\n // body must not read it (the 2026-08-02 incident class, platform/CLAUDE.md). Platform\n // startups invoke `applyStartupPostgresMigrations()` + `verifyPostgreSqlTableSchemas()`\n // themselves — apps-manager immediately after this method returns (its Phase 2.5,\n // BEFORE its first repository read, with the connection supplied by the Phase-1\n // `connectWithUrl` pre-connect door rather than by hydration — Phase 5.3);\n // module-registry in its platform-owner phase, post-hydration.\n if (!isPlatformApplication) {\n this.logDebug('🚚 Applying startup PostgreSQL migrations (if any)...');\n await this.repositoriesRegistryService.applyStartupPostgresMigrations();\n\n this.logDebug('🧮 Verifying PostgreSQL physical table schemas...');\n await this.repositoriesRegistryService.verifyPostgreSqlTableSchemas();\n this.logDebug('✅ PostgreSQL physical table schemas verified');\n }\n\n // Preserve the historical post-repository factory lifecycle:\n // custom factories may resolve repository-backed services while\n // materializing their registrations.\n this.customImplRegistry.initialize([\n ...CoreBackend_ServiceImplementationsFactories,\n ...customServiceImplementations,\n ]);\n\n if (applicationConfig) {\n // Runtime-contract validation needs both the populated email\n // template registry and the finalized `transactionalCore`\n // registrations. It still runs before service/controller\n // initialization, so no operation can accept traffic first.\n this.logDebug('🧭 Validating initialized runtime contracts...');\n this.applicationStartupConfigValidator.validateInitializedRuntimeContracts(applicationConfig);\n // RAG store capability probe (fail-closed) — async because it EXECUTES a pgvector\n // expression on the live connection; no-op for applications with no `.ragSource()`\n // fields, so it never forces a database connection an application does not use.\n await this.applicationStartupConfigValidator.validateInitializedRagStoreCapability();\n if (bootAssertions.assertsPersistenceTransactionReadiness) {\n await this.applicationStartupConfigValidator\n .validateInitializedRuntimeTransactionReadiness(\n applicationConfig,\n );\n } else {\n this.logDebug(\n '🧭 Skipping persistence transaction-readiness proof: this runtime does not own it '\n + '(ApplicationRuntimeProfileBootAssertions.assertsPersistenceTransactionReadiness). '\n + 'The probe touches a synthetic collection no resourceAccess declares, and proves a '\n + 'deployment-wide property the application backend already proves.',\n );\n }\n this.logDebug('✅ Initialized runtime contracts validated successfully');\n }\n\n // Step 4: Initialize services registry (business logic layer)\n this.logDebug('🏢 Initializing services registry...');\n await this.servicesRegistryService.initializeServices();\n if (servicesRegistryDecoratorFactory) {\n if (!applicationConfig) {\n throw new Error('servicesRegistryDecoratorFactory requires application configuration and cannot run during pre-hydration platform startup.');\n }\n this.servicesRegistryService = servicesRegistryDecoratorFactory(this.servicesRegistryService, {\n appConfig: applicationConfig,\n errorBuilder: this.errorBuilder,\n });\n this.rebindServicesRegistryForRuntime(container, this.servicesRegistryService);\n this.logDebug('✅ Runtime-specific services registry decorator installed');\n }\n this.logDebug('✅ Services registry initialized successfully');\n\n // Step 4.4: Supply the session revoker used when a subject erasure scrubs a person's row.\n //\n // Unconditional, unlike the billing effect below: an erased person's login must stop\n // working in every deployment, so this is a core privacy control rather than a\n // provider-tied one. Registered as a PORT rather than injected directly because\n // `AuthTokenIssuer` already depends on the services-registry handler, which is where the\n // scrub chokepoint that calls this lives — a direct dependency would close that cycle.\n if (container) {\n (container.get(SAAS_SERVICE_TYPES.SubjectSessionRevocationService) as SubjectSessionRevocationBackendService)\n .register(async (userId: string) => {\n await (container.get(SAAS_SERVICE_TYPES.AuthTokenIssuer) as AuthTokenIssuerBackendService)\n .invalidateAllTokensForUser(userId);\n });\n this.logDebug('🔒 Subject-erasure session revoker registered');\n }\n\n // Step 4.5: Initialize billing services (if enabled)\n if (applicationConfig?.billing?.enabled && container) {\n await this.initializeBillingServices(container, applicationConfig.billing, productDefinitions);\n }\n\n // Step 4.6: Initialize webhook auto-controller (must happen before controllers registry)\n if (!isPlatformApplication && container) {\n await this.initializeWebhookAutoController(container);\n }\n\n // Step 5: Initialize controllers registry (HTTP endpoints layer)\n this.logDebug('🌐 Initializing controllers registry...');\n\n\n // Get manual controllers from provided container\n let allCustomControllers: AbstractControllerBackendService[] = [];\n\n if (container) {\n // G-4: SCIM controller mount is app-global — it mounts when ANY registered\n // org type opts into scimProvisioning (organizationTypes[t].scimProvisioning.enabled).\n // Per-org / per-token enforcement happens downstream once mounted (DIRECTORY_PROVISIONING\n // feature + the org-type scimProvisioning.enabled gate via isScimProvisioningEnabledForOrg).\n // Fail-closed: off unless a type opts in.\n const directoryProvisioningEnabled = isScimProvisioningEnabledForAnyOrgType(\n this.resourcesRegistryService.getOrganizationTypesConfig(),\n );\n const analyticsEnabled = !!applicationConfig?.analytics?.enabled;\n const manualControllers = isPlatformApplication ? [] : getManualControllersBackend(container, { directoryProvisioningEnabled, analyticsEnabled });\n allCustomControllers = [\n ...manualControllers,\n ...(customControllers || [])\n ];\n\n\n\n this.logDebug('📋 Controllers to register', {\n manualControllers: manualControllers.length,\n runtimeCustomControllers: customControllers?.length || 0,\n totalCustomControllers: allCustomControllers.length\n });\n } else {\n allCustomControllers = customControllers || [];\n\n this.logDebug('📋 Controllers to register', {\n manualControllers: 0,\n runtimeCustomControllers: customControllers?.length || 0,\n totalCustomControllers: allCustomControllers.length\n });\n }\n if(!isPlatformApplication) {\n await this.controllersRegistryService.initialize(\n allCustomControllers.length > 0 ? allCustomControllers : undefined,\n controllerWhiteList\n );\n this.logDebug('✅ Controllers registry initialized successfully');\n } else {\n this.logDebug('Skipping controllers registry initialization in platform mode (will be started by apps-manager)');\n }\n\n // Step 5.5: Initialize batches/cronjobs (core engine + custom + resource-based)\n this.logDebug('🧵 Initializing batches & cronjobs...');\n const customBatches = customBatchesFactory\n ? customBatchesFactory({\n logger: this.logger,\n errorBuilder: this.errorBuilder,\n errorHandler: this.errorHandler,\n executionContextCreatorService: this.executionContextCreatorBackendService,\n resourcesRegistryService: this.resourcesRegistryService,\n repositoriesRegistryService: this.repositoriesRegistryService,\n servicesRegistryService: this.servicesRegistryService,\n })\n : new Map<string, BatchesCronjobsCustomExecution_Service<any, any>>();\n\n // Register core engine batches (always present, independent of custom app)\n customBatches.set(FILES_CLEANUP_BATCH_REF, createFilesCleanupBatch());\n // Hourly RAG reconciliation sweep (plan §3.c backstop, DL1). Registered UNCONDITIONALLY,\n // like files-cleanup: on an application with no `.ragSource()` fields it finds zero\n // resource types and zero chunk sets and costs one enumeration — a better trade than\n // corpus convergence silently depending on a registration condition. It is also the\n // bound every chunk-tier log-never-throw seam cites, so it must exist wherever they do.\n customBatches.set(RAG_RECONCILIATION_SWEEP_BATCH_REF, createRagReconciliationSweepBatch());\n // Five-minute RAG embedding drain (plan §3.d, Phase 4): fills the NULL-vector ledger\n // the sweep counts, and re-embeds on class→model binding moves. Registered\n // UNCONDITIONALLY for the sweep's reason — an app with no `.ragSource()` fields\n // returns after one detection walk; a RAG app with no embeddings provider gets the\n // one-WARN-per-run visibility instead of a silently frozen backlog.\n customBatches.set(RAG_EMBEDDING_DRAIN_BATCH_REF, createRagEmbeddingDrainBatch());\n customBatches.set(CONSUMABLE_TOKENS_CLEANUP_BATCH_REF, createConsumableTokensCleanupBatch());\n customBatches.set(A2A_ABANDONED_TASK_SWEEP_BATCH_REF, createA2AAbandonedTaskSweepBatch());\n // Daily hygiene sweep for the invitation→membership-junction model: prunes\n // long-stale INVITED rows + orphan PENDING_INVITATION users. Always present\n // (invitations are a core org capability, not a feature-gated add-on).\n customBatches.set(ORGANIZATION_MEMBER_INVITATION_SWEEP_BATCH_REF, createOrganizationMemberInvitationSweepBatch());\n // Hourly sweep that lifts EXPIRED time-boxed suspensions. Registered UNCONDITIONALLY:\n // `organizationMembers | suspend` and `users | suspend_user` both accept a window and\n // persist the resolved instant, so an application without this batch records \"for seven\n // days\" and suspends forever. Unlike the invitation sweep above, correctness does NOT\n // hold without it — the batch is what makes the declared contract true.\n customBatches.set(SUSPENSION_REACTIVATION_SWEEP_BATCH_REF, createSuspensionReactivationSweepBatch());\n /**\n * Retention sweeps for the two `.ttl()` resources. Registered UNCONDITIONALLY, like the\n * suspension sweep above and for the same reason: without them the declared contract is\n * simply untrue on PostgreSQL, which has no native TTL. On MongoDB the TTL index also\n * expires these rows — the sweep then finds nothing and costs one cheap query, which is\n * a better trade than retention silently depending on which store an app happens to use.\n */\n customBatches.set(\n JOB_EXECUTIONS_RETENTION_SWEEP_BATCH_REF,\n createResourceRetentionSweepBatch(\n CoreResourceType.JOB_EXECUTIONS as ResourceType,\n ENGINE_JOB_EXECUTIONS_RETENTION_SWEEP_MANIFEST,\n ),\n );\n customBatches.set(\n JOB_PAYLOAD_STORAGE_RETENTION_SWEEP_BATCH_REF,\n createResourceRetentionSweepBatch(\n CoreResourceType.JOB_PAYLOAD_STORAGE as ResourceType,\n ENGINE_JOB_PAYLOAD_STORAGE_RETENTION_SWEEP_MANIFEST,\n ),\n );\n // WS-A tenant teardown — destroys tenants whose retention window has elapsed.\n // Registered UNCONDITIONALLY (no feature gate) for real applications: `request_deletion`\n // is always reachable, so a tenant can always end up marked, and an application without\n // this batch would accumulate marked-but-never-destroyed tenants forever — the exact\n // failure a retention window exists to prevent. Every field of `tenantTeardown` defaults,\n // so an app that declares no block still purges on a 30-day window.\n //\n // Skipped for `isPlatformApplication`: platform services (apps-manager, crontabs-batches-\n // manager, ...) have no ORGANIZATIONS to tear down, and `applicationConfig` is\n // not yet populated at this point in a platform application's boot — it resolves config\n // in its own later phase, AFTER this `super.initialize()` call returns — so reading it here\n // unconditionally threw `app_configuration_not_initialized` at platform-apps-manager boot.\n if (applicationConfig) {\n customBatches.set(ORGANIZATION_PURGE_BATCH_REF, createOrganizationPurgeBatch(applicationConfig.tenantTeardown));\n }\n // Event-triggered (enqueued by the notifications dispatcher, no cron).\n // Registered unconditionally so any email notification enqueued onto\n // the custom-batch queue can resolve its executor.\n customBatches.set(EMAIL_BATCH_SEND_BATCH_REF, emailBatchSendService);\n // Event-triggered M2M outbound webhook delivery (enqueued by\n // `M2MWebhookDispatcherBackendService.enqueueDelivery`, no cron) and\n // SIEM webhook delivery (enqueued by\n // `AuditEventDispatcherBackendService.dispatchToOrganizationAuditSinks`, no\n // cron). Both are registered unconditionally for the SAME reason as\n // email: the dispatchers gate enqueue per-org/per-endpoint, so the\n // drains MUST always resolve — else an enqueued job hits\n // `JOB_BATCH_REF_NOT_FOUND` and is silently dead-lettered.\n customBatches.set(M2M_WEBHOOK_DELIVERY_BATCH_REF, m2mWebhookDeliveryBatchService);\n customBatches.set(SIEM_WEBHOOK_DELIVERY_BATCH_REF, siemWebhookDeliveryBatchService);\n // A2A push-notification delivery (enqueued by `A2APushDispatcherBackendService` on a\n // task transition, no cron). Registered unconditionally for the same reason as its two\n // siblings above: the dispatcher gates enqueue per registered webhook, so the drain\n // MUST always resolve — an enqueued job that hits `JOB_BATCH_REF_NOT_FOUND` is silently\n // dead-lettered, which for a notification means the client is never told and nothing\n // says so.\n customBatches.set(A2A_PUSH_DELIVERY_BATCH_REF, a2aPushDeliveryBatchService);\n // Audit Phase 3 — cron completeness reconciler. Registered unconditionally\n // (like the sibling delivery drains) so a mis-set global flag can't orphan the\n // schedule; it no-ops cleanly when no reconcilable audit sink is declared.\n customBatches.set(IMMUDB_AUDIT_RECONCILE_BATCH_REF, immudbAuditReconcileBatchService);\n // Audit Phase 5 / F1 — cron audit-log ARCHIVAL. Registered\n // unconditionally (like the reconcile batch); it no-ops cleanly at\n // tick time when `auditTrail.archiveAfterDays` is unset (opt-in) or\n // no file-storage provider is configured. Never deletes (AUDIT_LOGS\n // is immutable, G5) — it copies aged rows to durable archival\n // artifacts.\n customBatches.set(AUDIT_LOGS_ARCHIVE_BATCH_REF, auditLogsArchiveBatchService);\n\n if (applicationConfig && this.appConfigService.anonymousSessionsEnabled) {\n customBatches.set(ANONYMOUS_SESSION_CLEANUP_BATCH_REF, createAnonymousSessionCleanupBatch());\n this.logDebug('✅ Anonymous session cleanup batch registered');\n }\n\n // Register lifecycle dormancy detection batch (only when lifecycle is enabled)\n if (lifecycleConfig?.enabled) {\n customBatches.set(DORMANCY_DETECTION_BATCH_REF, createDormancyDetectionBatch(lifecycleConfig.dormancyCronSchedule));\n this.logDebug('✅ Dormancy detection batch registered', { cronSchedule: lifecycleConfig.dormancyCronSchedule });\n }\n\n // Register data-seeding scheduled-rerun batch (Phase 7 / Item 47, Slice 5).\n //\n // Gate: at least one passed `dataSeeds` entry declares a `schedule?:`\n // block. We pre-filter the in-memory definitions array (rather than\n // querying the registry, which is hydrated later in Step 7) so apps\n // without any cron-opted-in seeds don't spawn a minute-tick cron that\n // would always no-op. Platform mode bypasses entirely (no per-tenant\n // data seeds run on the platform process).\n if (applicationConfig) {\n const hasScheduledSeeds = (dataSeeds ?? []).some((seed) => seed.schedule !== undefined);\n if (hasScheduledSeeds) {\n // Fallback ladder is flat by design: the Zod schema\n // applies `DATA_SEEDING_SCHEDULED_RERUN_DEFAULT_CRON`\n // as a default when `dataSeeding.scheduledRerunCronSchedule`\n // is missing but the `dataSeeding` block is present;\n // when the whole block is absent, we short-circuit to\n // the shared constant. Both branches land on the SAME\n // literal, so there's a single source of truth — no\n // `?? manifest.cronExpression ?? '* * * * *'` tail.\n const dataSeedingConfig = applicationConfig.dataSeeding;\n const cronSchedule = dataSeedingConfig?.scheduledRerunCronSchedule\n ?? DATA_SEEDING_SCHEDULED_RERUN_DEFAULT_CRON;\n customBatches.set(\n DATA_SEEDING_SCHEDULED_RERUN_BATCH_REF,\n createDataSeedingScheduledRerunBatch(cronSchedule),\n );\n this.logDebug('✅ Data-seeding scheduled-rerun batch registered', { cronSchedule });\n }\n\n // Register the ETL pipeline scheduled-run batch (partial-resource paper, PR-12).\n //\n // Gate: at least one registered resource declares `externalDataPipeline.scheduleCron` — the\n // resources registry is initialized in an earlier step, so we query it directly.\n // Apps with no scheduled pipelines don't spawn a minute-tick cron that would\n // always no-op; on-demand pipelines (no `scheduleCron`) run only through the\n // run service's imperative door. Same platform-mode bypass as the sibling above.\n const hasScheduledEtlPipelines = this.resourcesRegistryService\n .getResourceTypes()\n .some((resourceType) => {\n const configuration = this.resourcesRegistryService.getResourceConfiguration(resourceType) as {\n externalDataPipeline?: { scheduleCron?: string };\n };\n return configuration?.externalDataPipeline?.scheduleCron !== undefined;\n });\n if (hasScheduledEtlPipelines) {\n customBatches.set(\n EXTERNAL_DATA_PIPELINE_SCHEDULED_RUN_BATCH_REF,\n createExternalDataPipelineScheduledRunBatch(),\n );\n this.logDebug('✅ ETL pipeline scheduled-run batch registered');\n }\n\n // Register data-seeding run-cleanup batch (audit L4-10,\n // post-Phase-7 close-out). Daily retention sweep that prunes\n // terminal `DataSeedRun` rows older than\n // `DataSeedingConfig.runRetentionDays` (default 30) while\n // preserving the MAX(seedVersion) row per business-key group\n // (so dispatcher idempotency is never broken).\n //\n // Gate: any registered seeds (regardless of `schedule?:`).\n // Apps with no seeds produce no `DataSeedRun` rows so the\n // sweep would always no-op. Platform mode bypasses (no\n // per-tenant data seeds run on the platform process).\n //\n // Retention is read at TICK time from app config (NOT at\n // registration), so an in-place config change takes effect\n // on the next daily tick without redeploy — see the\n // manifest's JSDoc and `resolveRetentionDays()` in the\n // batch body.\n const hasAnySeeds = (dataSeeds ?? []).length > 0;\n if (hasAnySeeds) {\n customBatches.set(\n DATA_SEEDING_RUN_CLEANUP_BATCH_REF,\n createDataSeedingRunCleanupBatch(),\n );\n this.logDebug('✅ Data-seeding run-cleanup batch registered');\n }\n }\n\n await this.batchesExecutor.initialize(customBatches);\n this.logDebug('✅ Batches & cronjobs initialized');\n\n // Step 6: Initialize HTTP server (skip here in platform mode or headless runtimes)\n if (this.shouldInitializeHttpServer({ headlessMode })) {\n // Register operator-facing admin controllers BEFORE HTTP init so they get\n // mounted at their custom root paths (e.g. /internal/admin/data-seeding)\n // by registerRoutes(). They MUST go through registerCustomController(), not\n // through getManualControllersBackend(), because the manual-controllers list\n // is mounted under /api/v1 by the controllers registry — root-level admin\n // surfaces (mirroring /health) must skip that prefix.\n if (container) {\n try {\n const dataSeedingAdminController = container.get(\n SAAS_SERVICE_TYPES.DataSeedingAdminController,\n ) as DataSeedingAdminBackendController;\n this.httpServerService.registerCustomController(dataSeedingAdminController);\n this.logDebug('🌱 Data-seeding admin controller registered for root mount');\n\n // The external-data operator door (list pipelines + run one now). Same\n // root-mount reasoning, and registered beside its sibling so a future\n // reader finds every /internal admin surface in one place.\n const externalDataAdminController = container.get(\n SAAS_SERVICE_TYPES.ExternalDataAdminController,\n ) as ExternalDataAdminBackendController;\n this.httpServerService.registerCustomController(externalDataAdminController);\n this.logDebug('🔌 External-data admin controller registered for root mount');\n } catch (error) {\n this.logger.warn('⚠️ Failed to register DataSeedingAdminController; admin endpoints will be unavailable', {\n ...projectCaughtErrorLogFields(error),\n });\n }\n }\n\n this.logger.info('🌍 Initializing HTTP server...');\n await this.httpServerService.initialize();\n this.logger.info('✅ HTTP server initialized successfully');\n } else if (this.isPlatformMode) {\n this.logDebug('Skipping HTTP server initialization in platform mode (will be started by apps-manager)');\n } else {\n this.logDebug('Skipping HTTP server initialization in headless mode');\n }\n\n // Step 7: Initialize queue workers (for background job processing)\n if (!this.isPlatformMode) {\n this.logger.info('🐰 Initializing queue workers...');\n try {\n // Headless job-processing runtimes (minions) still connect to\n // RabbitMQ here — their own tick consumer needs the adapter\n // connection + topology channel — but must NOT consume the\n // shared operations/scheduled/callbacks queues, or RabbitMQ\n // round-robins the scheduled-cron ticks onto them and they\n // dead-letter every tick they can't interpret. We also turn\n // OFF queue monitoring for those runtimes: it watches exactly\n // those four shared queues (which this runtime doesn't own),\n // and the backend-api pod already monitors them.\n await this.queueWorkerInitializer.initialize(\n skipJobConsumers\n ? { startJobConsumers: false, enableMonitoring: false }\n : undefined,\n );\n this.logger.info('✅ Queue workers initialized (if RabbitMQ configured)');\n } catch (error) {\n // Queue workers failing shouldn't prevent app from starting\n this.logger.warn('⚠️ Queue worker initialization skipped or failed:', error);\n }\n\n // Step 7.5: Sync cron jobs to crontabs-batches-manager\n if (this.shouldSyncCronJobs({ skipCronSync })) {\n this.logger.info('🕐 Syncing cron jobs to crontabs-manager...');\n try {\n // Initialize the sync service\n this.cronJobSyncService.initialize();\n\n // Sync cron jobs. Transient failures do not fail startup:\n // CronJobSyncBackendService keeps one capped,\n // process-lifecycle-aware reconciliation retry pending.\n await this.cronJobSyncService.syncCronJobsToManager();\n } catch (error) {\n // This catch is a final guard for an unexpected service\n // defect; ordinary remote failures are contained and\n // retried by CronJobSyncBackendService.\n this.logger.error('Unexpected cron job sync failure:', error);\n }\n } else {\n this.logDebug('Skipping cron job sync for this runtime profile');\n }\n } else {\n this.logDebug('Skipping queue worker initialization in platform mode');\n }\n\n // Step 7.7: Data-seeding subsystem — register declarations and run\n // application-lifecycle seeds (Phase 2.F of seeding-first-class plan).\n // Extracted into `runDataSeedingStep()` so it can be unit-tested in\n // isolation without standing up the full 30+ dependency boot chain.\n await this.runDataSeedingStep(dataSeeds, dataSeedScopeResolvers);\n\n // Step 7.8: Report — not enforce — the last-super-administrator floor. Runs AFTER\n // seeding so a seeded first administrator counts; see `reportSuperAdminFloor()` for why\n // this can never be fatal.\n await this.reportSuperAdminFloor();\n\n // Step 7.9: The per-tenant twin. Separate call, separate report: the application floor\n // answers \"can anyone administer this deployment\", this one answers \"which tenants can\n // nobody administer\" — different populations, different remedies, and an operator\n // needs both named rather than one folded into the other.\n await this.reportOrganizationOwnerFloor();\n\n // Step 7.95: The CEILING, beside the two floors. They ask \"is there at least one\n // administrator\"; this asks \"who are they\" — the enumeration a periodic privileged-access\n // review reads (#202). Same non-fatal posture, same gate, and it decides nothing.\n await this.reportPrivilegedAccessPopulation();\n\n // Step 7.10: Report — never enforce — which of the APPLICATION's own resources have said\n // nothing about whether their rows are about people. Reads the registry only: no database,\n // no execution context, so unlike the two floors above it needs nothing to be seeded and\n // cannot be confined to an empty set by a wrong context.\n this.reportApplicationPersonalDataDeclarations();\n\n // Step 8: Validate initialization\n await this.validateInitialization({ headlessMode });\n\n // Step 8.5: If the application's authored authentication policy (`userTypes.*.auth` —\n // MFA, password, lockout, enabled methods, step-up, session) moved since the last boot,\n // record it in the audit trail. Emitted HERE — after `validateInitialization`, with the\n // repositories registry and the audit boundary live and the resolved policy in effect —\n // because this boot is where the change takes effect and there is no human actor to name\n // (the \"who authored it\" lives in the deployment / source history).\n //\n // Gated three ways: `applicationConfig` is undefined in platform mode (the platform-gate);\n // and `!headlessMode` restricts the emit to the auth-SERVING runtime. A minion boots this\n // same lifecycle headlessly (`headlessMode: true`) with the SAME app config, so without\n // this gate every minion would write a duplicate row for one change — and a background\n // runtime that serves no HTTP/auth is not the honest emitter of an authentication-policy\n // change anyway. `shouldInitializeHttpServer` draws the identical `!headlessMode` line.\n // (Horizontally-scaled serving replicas can still race to one extra row per change; that\n // is safe over-recording in an append-only trail — the gap this closes is UNDER-recording.)\n // The service call is fully self-contained and fire-and-forget, so it cannot fail boot.\n //\n // assurance-control: WILDO.AUDIT.SECURITY_EVENT WILDO.IDENTITY.SESSION_ASSURANCE — the boot-time\n // activation point that guarantees a change to the authored authentication-assurance policy is\n // evidenced, from the auth-serving runtime, on the deployment that puts it into effect.\n if (applicationConfig && this.auditLogsService && !headlessMode) {\n await this.auditLogsService.emitApplicationAuthPolicyChangeIfChanged({\n applicationId: applicationConfig.appIdentity.appName,\n userTypes: applicationConfig.userTypes,\n });\n }\n\n this.isInitialized = true;\n\n\n // Step 9: Display debug information (after initialization is complete)\n this.logDebug('📋 Displaying implemented Mongoose schemas...');\n this.debugDisplayMongooseSchemas({\n showSchemaStructure: true,\n showIndexes: true,\n maxFieldDepth: 2,\n });\n\n this.logDebug('🌐 Displaying registered routes...');\n this.debugDisplayRegisteredRoutes();\n\n this.logDebug('🎉 Backend application initialization completed successfully');\n\n } catch (error) {\n // This orchestration layer does not handle the failure; it propagates\n // it to the runtime host. Logging here would duplicate the terminal\n // process-boundary record and lose host identity/context.\n throw error;\n }\n }\n\n /**\n * Initialize the webhook auto-controller with its dependencies.\n *\n * Must run BEFORE the controllers registry mounts the controller's router:\n * `initialize()` is what actually registers the webhook routes (the route\n * set is data-dependent and the webhook handler is not constructor-injected,\n * so the base class's constructor-time `setupRoutes()` hook is a no-op — see\n * `WebhookAutoControllerBackendService.initialize()` for the full rationale).\n * Async because route definitions are read from first-class provider runtime contracts.\n */\n private async initializeWebhookAutoController(container: any): Promise<void> {\n try {\n const webhookHandler = container.get(SAAS_SERVICE_TYPES.WebhookHandlerService) as WebhookHandlerBackendService;\n const webhookAutoController = container.get(SAAS_SERVICE_TYPES.WebhookAutoController) as WebhookAutoControllerBackendService;\n\n await webhookAutoController.initialize(webhookHandler);\n this.logDebug('🔗 Webhook auto-controller initialized');\n } catch (error) {\n // Non-fatal — if no webhook providers are registered, this is expected\n this.logger.warn('Webhook auto-controller initialization skipped', {\n ...projectCaughtErrorLogFields(error),\n });\n }\n }\n\n /**\n * Initialize billing services when billing is enabled.\n *\n * Resolves the billing provider from the external connectors system\n * and initializes all billing services (product catalog sync,\n * usage metering, promotions, custom implementations) and wires up webhooks.\n */\n private async initializeBillingServices(\n container: any,\n billingConfig: BillingConfiguration,\n appProductDefinitions?: ProductDefinition[],\n ): Promise<void> {\n this.logDebug('💳 Initializing billing services...');\n\n // Resolve the billing provider BEFORE the non-fatal try below.\n //\n // \"billing.enabled = true but no provider resolvable\" is an\n // INCOHERENT CONFIG, not a runtime hiccup, and must FAIL LOUD at\n // startup. The previous warn-and-return silently degraded: billing\n // resources stayed registered (enabled ⇒ not excluded) but the\n // back-office services that register their operation paths + run\n // the org auto-create never initialized. The result was request-\n // time FATALs (`resources_registry_operation_path_not_found` on\n // `organizationBillingAccounts` / `products` / `prices` /\n // `promotions`) during org provisioning — exactly the\n // silent-degradation anti-pattern the design philosophy forbids.\n //\n // The try/catch further down stays scoped to RUNTIME init errors\n // (a provider that resolves but then throws mid-wire) which remain\n // non-fatal. Config incoherence is a different, fatal class.\n const resolution = await this.resolveBillingProvider(billingConfig);\n if (!resolution.provider) {\n throw this.errorBuilder.buildError(ErrorType.CONFIGURATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.CONFIGURATION,\n context: {\n message: describeBillingProviderResolutionFailure(\n resolution.reason,\n billingConfig,\n resolution.detail,\n ),\n providerRef: billingConfig.providerRef ?? null,\n resolutionFailureReason: resolution.reason,\n },\n });\n }\n const billingProvider = resolution.provider;\n\n try {\n // 2. Get billing services from DI container\n const catalogSync = container.get(SAAS_SERVICE_TYPES.ProductCatalogSyncService) as ProductCatalogSyncBackendService;\n const usageMetering = container.get(SAAS_SERVICE_TYPES.UsageMeteringService) as UsageMeteringBackendService;\n\n // 3. Product definitions from the custom app (like customRoles, customFeatureDefinitions)\n const productDefinitions: ProductDefinition[] = appProductDefinitions ?? [];\n\n // 4. Initialize services in dependency order\n await catalogSync.initialize(productDefinitions, billingProvider);\n await usageMetering.initialize(billingProvider);\n\n // 4b. Register the provider-side half of subject erasure.\n //\n // Registered HERE, inside the billing bootstrap, because that is what keeps the erasure\n // orchestrator domain-agnostic: `system-access` runs whatever declared itself relevant to\n // a subject and never learns that billing exists. It also ties the effect's lifetime to\n // the provider's — a deployment with no billing provider configured registers nothing,\n // rather than registering an effect that would fail at erasure time.\n container\n .get(SAAS_SERVICE_TYPES.SubjectErasureExternalEffectsService)\n .register(createBillingSubjectErasureEffect({\n getBillingProvider: () => billingProvider,\n listBillingAccountsForSubject: async (billingAccountResourceType, scopeFieldName, subjectIds) => {\n const systemAccess = container.get(SAAS_SERVICE_TYPES.SystemAccessService) as SystemAccessBackendService;\n return normalizeSystemListResult(await systemAccess.listAsSystem(\n billingAccountResourceType,\n { [scopeFieldName]: { $in: subjectIds } },\n )) as Array<{ _id: string; providerCustomerId?: string }>;\n },\n listActiveSubscriptions: async (subscriptionResourceType, billingAccountFkField, billingAccountId) => {\n const systemAccess = container.get(SAAS_SERVICE_TYPES.SystemAccessService) as SystemAccessBackendService;\n return normalizeSystemListResult(await systemAccess.listAsSystem(\n subscriptionResourceType,\n {\n [billingAccountFkField]: billingAccountId,\n status: { $nin: TERMINAL_SUBSCRIPTION_STATUSES },\n },\n )) as Array<{ _id: string; providerSubscriptionId?: string }>;\n },\n logWarn: (message, context) => this.logger.warn(message, context),\n }));\n this.logDebug('🧹 Billing subject-erasure effect registered');\n\n // 4a. Sync product catalog to DB (ensures products/prices exist before billing state endpoint queries them)\n try {\n const syncResult = await catalogSync.syncProductCatalog();\n this.logDebug('📦 Product catalog synced at startup', {\n synced: syncResult.synced,\n created: syncResult.created,\n updated: syncResult.updated,\n featuresDirty: syncResult.featuresDirty.length,\n });\n } catch (syncError) {\n this.logger.warn('⚠️ Product catalog startup sync failed (non-fatal)', {\n ...projectCaughtErrorLogFields(syncError),\n });\n }\n\n // 4b. Initialize billing custom implementations (late-binding for resource-centric operations)\n const featureSync = container.get(SAAS_SERVICE_TYPES.BillingFeatureSyncService) as BillingFeatureSyncBackendService;\n const billingStateService = container.get(SAAS_SERVICE_TYPES.BillingStateService) as BillingStateBackendService;\n initializeBillingCustomImplementations(billingProvider, featureSync, billingStateService, billingConfig, this.errorBuilder);\n\n // 4c. Register post-operation hooks (feature sync fires automatically after subscription mutations)\n registerBillingPostOperationHooks(this.servicesRegistryService);\n\n // 5. Wire up billing webhooks\n // The WebhookAutoControllerBackendService auto-registers routes from provider definitions,\n // so we only need to register the adapter (verify+parse) and handler (dispatch).\n const webhookHandler = container.get(SAAS_SERVICE_TYPES.WebhookHandlerService) as WebhookHandlerBackendService;\n const webhookAutoController = container.get(SAAS_SERVICE_TYPES.WebhookAutoController) as WebhookAutoControllerBackendService;\n\n const billingAdapter = new BillingWebhookAdapter(billingProvider, billingConfig.providerRef);\n webhookHandler.registerAdapter(billingConfig.providerRef, 'billing', billingAdapter);\n\n const webSocketService = container.get(SAAS_SERVICE_TYPES.WebSocketService) as WebSocketService;\n setBillingWebSocketService(webSocketService);\n const webhookEventRouter = new BillingWebhookEventRouterBackendService(this.servicesRegistryService, this.resourcesRegistryService, this.logger, webSocketService);\n const billingCapabilityHandler = new BillingWebhookCapabilityHandler(webhookEventRouter);\n webhookAutoController.registerCapabilityHandler(billingCapabilityHandler);\n\n this.logDebug('✅ Billing services initialized successfully', {\n providerRef: billingConfig.providerRef,\n enabledScopes: billingConfig.enabledScopes,\n });\n } catch (error) {\n // Billing initialization failure is non-fatal: the app can still run without billing\n this.logger.error('❌ Billing services initialization failed (billing will be unavailable)', {\n ...projectCaughtErrorLogFields(error),\n });\n }\n }\n\n /**\n * Resolve the StandardBilling_Interface from the external providers system.\n *\n * Flow:\n * 1. Get the billing providerRef from config (e.g., 'stripe')\n * 2. Verify the configured provider exposes the billing protocol\n * 3. Load the billing runtime contract from the backend provider registry\n *\n * Returns a discriminated {@link BillingProviderResolution}: on failure the\n * `provider` is null and a `reason` (plus optional `detail`) names the exact\n * config surface at fault, so the startup guard can route the operator to the\n * right fix (scope authoring vs. secret vs. disabled) rather than a catch-all.\n */\n private async resolveBillingProvider(billingConfig: BillingConfiguration): Promise<BillingProviderResolution> {\n const providerRef = billingConfig.providerRef;\n if (!providerRef) {\n this.logDebug('No billing providerRef configured');\n return { provider: null, reason: BillingProviderResolutionFailureReason.PROVIDER_REF_UNSET };\n }\n\n try {\n const runtimeContract = this.backendProviderRegistryService.getRuntimeContract(\n providerRef,\n ExternalProvider_ExchangeProtocol_Kind.BILLING_PROVIDER,\n );\n if (runtimeContract?.kind !== 'billing') {\n // No billing runtime contract exposed to the backend registry for\n // this ref — the provider was filtered out of the active catalog\n // because it is not authored in `providers.scopes.backend` (and/or\n // lacks a backend runtime-owner contribution). This is distinct\n // from \"secret missing\": the ref never reached the backend host.\n this.logDebug('Billing provider not reachable on the backend runtime', { providerRef });\n return {\n provider: null,\n reason: BillingProviderResolutionFailureReason.PROVIDER_NOT_REACHABLE_ON_BACKEND,\n };\n }\n\n if (!this.externalProvidersRegistryService.isProviderEnabled(\n providerRef,\n ExternalProvider_ExchangeProtocol_Kind.BILLING_PROVIDER,\n )) {\n this.logDebug('Billing provider disabled by external provider configuration', { providerRef });\n return { provider: null, reason: BillingProviderResolutionFailureReason.PROVIDER_DISABLED };\n }\n\n // The framework currently ships a single `kind: 'billing'`\n // adapter (Stripe, via `StripeStandardBillingProvider`).\n // The instantiation here is keyed on `kind` only — no\n // provider literal — so the CI guard\n // (`no-provider-ref-branches.guard.test.ts`) accepts it.\n // When a second billing adapter arrives, factor the\n // adapter constructor into the runtime contract via\n // `sdkFactory: (secretKey, opts) => StandardBilling_Interface`,\n // mirror of the LLM and email surfaces — do NOT\n // reintroduce a `provider === '<ref>'` branch here.\n const secretRef = runtimeContract.secretRef;\n const secretKey = secretRef\n ? this.externalProvidersRegistryService.getProviderSecret(\n providerRef,\n ExternalProvider_ExchangeProtocol_Kind.BILLING_PROVIDER,\n secretRef,\n )\n : undefined;\n if (!secretKey) {\n this.logger.warn('Billing provider configured but secret is missing', { providerRef, secretRef });\n return {\n provider: null,\n reason: BillingProviderResolutionFailureReason.SECRET_MISSING,\n detail: secretRef,\n };\n }\n\n this.logDebug('Billing provider resolved from first-class billing runtime contract', { providerRef });\n return { provider: new StripeStandardBillingProvider(secretKey, runtimeContract.apiVersion) };\n } catch (error) {\n const detail = describeCaughtError(error);\n this.logger.warn('Failed to resolve billing provider', { providerRef, error: detail });\n return { provider: null, reason: BillingProviderResolutionFailureReason.RESOLUTION_ERROR, detail };\n }\n }\n\n async shutdown(): Promise<void> {\n this.logDebug('Starting graceful shutdown');\n\n\n // Cancel delayed cron reconciliation before stopping queue workers, so\n // shutdown cannot start a fresh platform request in the background.\n this.cronJobSyncService.shutdown();\n\n // Then shut down queue workers and wait for in-flight jobs.\n try {\n await this.queueWorkerInitializer.shutdown();\n } catch (error) {\n this.logger.error('Error during queue worker shutdown', error as any);\n }\n }\n /**\n * Check if the application is initialized\n */\n public isApplicationInitialized(): boolean {\n return this.isInitialized;\n }\n\n /**\n * Get application configuration\n */\n public async getAppConfig(): Promise<AppConfiguration> {\n this.ensureInitialized();\n return this.appConfigService.config;\n }\n\n /**\n * Get resources registry\n */\n public getResourcesRegistry(): ResourcesRegistry {\n this.ensureInitialized();\n return this.resourcesRegistryService.getResourcesRegistry();\n }\n\n /**\n * Get repositories registry handler\n */\n public getRepositoriesRegistry(): RepositoriesRegistryHandlerBackendService {\n this.ensureInitialized();\n return this.repositoriesRegistryService;\n }\n\n /**\n * Debug function to display all implemented Mongoose schemas\n * Convenient access to schema debugging from the main application service\n */\n public debugDisplayMongooseSchemas(options: {\n showSchemaStructure?: boolean;\n showIndexes?: boolean;\n showVirtuals?: boolean;\n resourceTypeFilter?: string[];\n maxFieldDepth?: number;\n } = {}): void {\n this.logDebug('\\n🚀 === WILDO.AI BACKEND - MONGOOSE SCHEMAS DEBUG ===\\n');\n\n if (!this.isInitialized) {\n this.logDebug('⚠️ Application not initialized yet. Schemas may not be available.');\n return;\n }\n\n this.repositoriesRegistryService.debugDisplayMongooseSchemas(options);\n }\n\n /**\n * Quick debug summary of all schemas\n */\n public debugShowSchemasSummary(): void {\n this.logDebug('\\n🚀 === WILDO.AI BACKEND - SCHEMAS SUMMARY ===\\n');\n\n if (!this.isInitialized) {\n this.logDebug('⚠️ Application not initialized yet. Schemas may not be available.');\n return;\n }\n\n this.repositoriesRegistryService.debugShowSchemasSummary();\n }\n\n /**\n * Debug function to display all registered routes\n */\n public debugDisplayRegisteredRoutes(): void {\n this.logDebug('\\n🌐 === WILDO.AI BACKEND - REGISTERED ROUTES ===\\n');\n\n if (!this.isInitialized) {\n this.logDebug('⚠️ Application not initialized yet. Routes may not be available.');\n return;\n }\n\n this.controllersRegistryService.displayAllRoutes();\n }\n\n /**\n * Get the controllers registry for route registration\n */\n public getControllersRegistry(): ControllersRegistryHandlerBackendService {\n this.ensureInitialized();\n return this.controllersRegistryService;\n }\n\n /**\n * Get the services registry for business logic access\n */\n public getServicesRegistry(): ServicesRegistryHandlerBackendService {\n this.ensureInitialized();\n return this.servicesRegistryService;\n }\n\n /**\n * Get the HTTP server service instance\n */\n public getHttpServer(): HttpServerBackendService {\n this.ensureInitialized();\n return this.httpServerService;\n }\n\n /**\n * Get the authorizations service instance\n */\n public getAuthorizationsService(): AuthorizationsBackendService {\n this.ensureInitialized();\n return this.authorizationsService;\n }\n\n /**\n * Step 7.7 — Data-seeding subsystem hand-off.\n *\n * Thin adapter around {@link runDataSeedingApplicationBootstrap}: this\n * method exists so subclasses (e.g. `PlatformAppsManager_ApplicationStartupService`)\n * can override / observe the step without reaching into the helper, and\n * so the heavy `initialize()` reads as a flat sequence of `await`s.\n *\n * The helper itself is exhaustively unit-tested at\n * `~/data-seeding/services/__tests__/data-seed-application-bootstrap.backend.test.ts`.\n * See the helper's JSDoc for the full contract (registration always runs,\n * dispatch is skipped in platform mode, dispatcher failures are FATAL).\n */\n protected async runDataSeedingStep(\n dataSeeds: readonly DataSeedDefinition[] | undefined,\n dataSeedScopeResolvers: Readonly<Record<string, DataSeedScopeResolver>> | undefined,\n ): Promise<void> {\n await runDataSeedingApplicationBootstrap({\n dataSeeds,\n dataSeedScopeResolvers,\n isPlatformMode: this.isPlatformMode,\n logger: this.logger,\n logDebug: this.logDebug,\n registry: this.dataSeedRegistryService,\n scopeResolverRegistry: this.dataSeedScopeResolverRegistryService,\n dispatcher: this.dataSeedDispatcherService,\n servicesRegistry: this.servicesRegistryService,\n });\n }\n\n /**\n * Report — never enforce — the last-super-administrator floor at startup.\n *\n * ## Why this exists next to the write guards\n *\n * Every write that could remove the last administratively usable super-administrator already\n * refuses (`super-admin-floor.backend.utils`, wired into the USERS role verbs, the core\n * UPDATE, DELETE and subject erasure). So this can only ever observe a breach that arrived\n * around those paths: a direct database edit, a restore from a backup taken mid-erasure, a seed\n * that authored no administrator, or — the one with no user row involved at all — a role-table\n * reconfiguration that dropped or renamed a custom role carrying\n * `inheritFrom: APP_ADMIN_SUPER_ADMIN`, silently reclassifying its holders as non-administrators.\n *\n * ## Why it MUST NOT fail startup\n *\n * A fresh application legitimately boots with zero users: the first administrator arrives\n * through seeding or first-run registration. A framework that refused to start on this data\n * condition would brick every greenfield app on its first run, and — worse — would make the\n * breach unrecoverable in exactly the situation where the operator needs the app up to fix it.\n * The finding is loud (`logger.error` + a CRITICAL audit event) and non-blocking. Rejected:\n * throwing `ErrorType.CONFIGURATION`, for both reasons above.\n *\n * ## Why every failure is swallowed\n *\n * A diagnostic that can take the application down is a worse defect than the one it reports.\n * The floor query needs the users repository and the role table; in platform mode, in reduced\n * runtime profiles, or in a minimal test container, either may legitimately be absent. All of\n * that degrades to a debug line.\n *\n * assurance-control: WILDO.ACCESS.ADMINISTRATIVE_CONTINUITY — surface the absence of an\n * accountable administrative principal, which is unrecoverable in-product once reached.\n */\n protected async reportSuperAdminFloor(): Promise<void> {\n // Platform mode runs no application user population — there is no floor to measure.\n if (this.isPlatformMode) return;\n /**\n * ONLY the runtime that owns the application's administrative population.\n *\n * The report reads `users` and `organizations` across the whole application. A confined\n * runtime (minion/worker) holds table-scoped grants covering neither, so it cannot perform\n * the read — and has no accountability for the answer even if it could. Observed on a\n * clean-room PostgreSQL boot (2026-08-24): the marketing-scrapper minion produced\n * `permission denied for table users` and `for table organizations` on every startup.\n *\n * It never blocked anything — the report is non-fatal by design — which is precisely why it\n * lasted: a recurring, ignorable error inside an otherwise healthy boot. The application\n * backend still runs both reports, so no observation is lost.\n */\n if (!resolveApplicationRuntimeProfileBootAssertions(this.resolvedRuntimeProfile).reportsAdministrativeContinuityFloors) return;\n\n try {\n if (!this.repositoriesRegistryService.getRepository(CoreResourceType.USERS)) {\n this.logDebug('Skipping the super-administrator floor report: no users repository is registered');\n return;\n }\n\n const executionContext = await this.executionContextCreatorBackendService.createForInternalOperation({\n operation: this.resourcesRegistryService.getServiceOperationPathDefault(\n CoreResourceType.USERS,\n CoreResourceOperation.LIST,\n ),\n initiatorRoles: [\n {\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],\n relatedPrimaryScope: ResourcePrimaryScope.APPLICATION,\n },\n ],\n });\n\n const population = await measureUsableSuperAdminPopulation({\n executionContext,\n repositoriesRegistry: this.repositoriesRegistryService,\n errorBuilder: this.errorBuilder,\n conferringRoles: resolveSuperAdminConferringRoles(this.authorizationsService),\n });\n\n if (population.meetsFloor) {\n this.logDebug('Super-administrator floor satisfied', {\n usableSuperAdminCount: population.usableSuperAdminCount,\n });\n return;\n }\n\n // ERROR, not warn: there is no in-product remedy — every door that could appoint a new\n // administrator is gated on the role that is missing. The recovery is necessarily\n // out-of-band (a direct database write, or a seed), so the log has to stand alone and\n // say what to do.\n this.logger.error(\n 'No administratively usable super-administrator exists. The application cannot be '\n + 'administered, and no in-product path can grant the role because every such path '\n + 'requires it. Restore one out-of-band (seed or direct database write) by giving an '\n + 'ACTIVE user one of the conferring roles below.',\n {\n usableSuperAdminCount: population.usableSuperAdminCount,\n requiredUsableSuperAdminCount: SUPER_ADMIN_FLOOR_MINIMUM,\n conferringRoles: population.conferringRoles,\n usableStatuses: [...ADMINISTRATIVELY_USABLE_USER_STATUSES],\n },\n );\n\n await this.auditLogsService?.logApplicationSuperAdminFloorBreached({\n usableSuperAdminCount: population.usableSuperAdminCount,\n requiredUsableSuperAdminCount: SUPER_ADMIN_FLOOR_MINIMUM,\n conferringRoles: population.conferringRoles,\n usableStatuses: [...ADMINISTRATIVELY_USABLE_USER_STATUSES],\n }, executionContext);\n } catch (error) {\n // See the header: a diagnostic must never be the reason startup fails.\n this.logDebug('Super-administrator floor report could not run', projectCaughtErrorLogFields(error));\n }\n }\n\n /**\n * Report — never enforce — the last-organization-owner floor, per tenant.\n *\n * The write guards are the protection; this is the only surface that observes states they never\n * saw (a direct database edit, a restore from a backup taken mid-erasure, a seed that authored no\n * owner, or a role-table reconfiguration that changed which roles confer ownership).\n *\n * NON-FATAL, for the same reason as its application twin and one more of its own: a fresh\n * deployment legitimately has zero organizations, and a tenant left ownerless by an out-of-band\n * edit is a condition to report, not a reason to refuse to serve every OTHER tenant.\n *\n * Cost is three queries regardless of tenant count — see\n * {@link measureOrganizationsMissingUsableOwner}. The breached list is logged in full because an\n * operator cannot act on a count, but it is the ONLY thing that scales with the breach, not with\n * the tenant base.\n */\n protected async reportOrganizationOwnerFloor(): Promise<void> {\n // Platform mode runs no tenant population — there is no floor to measure.\n if (this.isPlatformMode) return;\n /**\n * ONLY the runtime that owns the application's administrative population.\n *\n * The report reads `users` and `organizations` across the whole application. A confined\n * runtime (minion/worker) holds table-scoped grants covering neither, so it cannot perform\n * the read — and has no accountability for the answer even if it could. Observed on a\n * clean-room PostgreSQL boot (2026-08-24): the marketing-scrapper minion produced\n * `permission denied for table users` and `for table organizations` on every startup.\n *\n * It never blocked anything — the report is non-fatal by design — which is precisely why it\n * lasted: a recurring, ignorable error inside an otherwise healthy boot. The application\n * backend still runs both reports, so no observation is lost.\n */\n if (!resolveApplicationRuntimeProfileBootAssertions(this.resolvedRuntimeProfile).reportsAdministrativeContinuityFloors) return;\n\n try {\n if (!this.repositoriesRegistryService.getRepository(CoreResourceType.ORGANIZATIONS)\n || !this.repositoriesRegistryService.getRepository(CoreResourceType.ORGANIZATION_MEMBERS)) {\n this.logDebug('Skipping the organization-owner floor report: organization repositories are not registered');\n return;\n }\n\n const authExecutionContextFactory = this.authExecutionContextFactory;\n if (!authExecutionContextFactory) {\n this.logDebug('Skipping the organization-owner floor report: the auth execution-context factory is not bound');\n return;\n }\n\n const population = await measureOrganizationsMissingUsableOwner({\n // The report builds its OWN system context from this factory. It is a whole-estate\n // backstop and must NOT trust a caller-supplied context: a role-less or wrong-execution-\n // type context silently confined the ORGANIZATIONS scope-root read to the empty set and\n // the backstop then reported a healthy estate. See the block comment in\n // `measureOrganizationsMissingUsableOwner`.\n authExecutionContextFactory,\n repositoriesRegistry: this.repositoriesRegistryService,\n errorBuilder: this.errorBuilder,\n conferringRoles: resolveOrganizationOwnerConferringRoles(this.authorizationsService),\n });\n\n // The PREVENTIVE half, and the only one this floor has. A tenant with exactly one usable\n // owner is a single resignation or suspension away from being unadministrable, and it is\n // the population the floor will REFUSE to help — every removal there answers 409 until a\n // second owner exists. WARN, not error: nothing is broken yet, and an error here on a\n // legitimately small tenant would train operators to ignore the channel.\n if (population.singleOwnerOrganizations.length > 0) {\n this.logger.warn(\n 'Organizations have exactly ONE administratively usable owner. Each is one lifecycle '\n + 'event away from being unadministrable, and the owner floor will refuse every removal '\n + 'there until a second owner is granted. Recommend at least two owners per tenant.',\n {\n singleOwnerOrganizationCount: population.singleOwnerOrganizations.length,\n singleOwnerOrganizations: population.singleOwnerOrganizations,\n protectedOrganizationCount: population.protectedOrganizationCount,\n },\n );\n }\n\n if (population.ownerlessOrganizations.length === 0) {\n this.logDebug('Organization-owner floor satisfied for every protected tenant', {\n protectedOrganizationCount: population.protectedOrganizationCount,\n });\n return;\n }\n\n // ERROR, not warn: these tenants cannot administer THEMSELVES, and no member of them can\n // fix it — granting ownership requires the authority they just lost. Recovery exists but\n // is an out-of-tenant operator action, so the log names it rather than leaving the reader\n // to discover there is one. (Until 2026-08-05 this said no in-product path existed at all;\n // `organizationMembers.grantOwnership` is that path.)\n this.logger.error(\n 'Organizations exist with no administratively usable owner. They cannot administer '\n + 'themselves, and no member of them can repair it — granting ownership requires the '\n + 'authority that was lost. Repair from the platform tier with '\n + '`organizationMembers.grantOwnership`, which promotes an EXISTING member of the tenant '\n + 'and requires APP_ADMIN_SUPER_ADMIN. Failing that, restore out-of-band by giving an '\n + 'ACTIVE member an ACTIVE membership with a conferring role.',\n {\n ownerlessOrganizationCount: population.ownerlessOrganizations.length,\n protectedOrganizationCount: population.protectedOrganizationCount,\n ownerlessOrganizations: population.ownerlessOrganizations,\n requiredUsableOwners: ORGANIZATION_OWNER_FLOOR_MINIMUM,\n conferringRoles: resolveOrganizationOwnerConferringRoles(this.authorizationsService),\n usableMembershipStatuses: [...ADMINISTRATIVELY_USABLE_ORGANIZATION_MEMBER_STATUSES],\n usableOwnerUserStatuses: [...ADMINISTRATIVELY_USABLE_OWNER_USER_STATUSES],\n },\n );\n } catch (error) {\n // See the header: a diagnostic must never be the reason startup fails.\n this.logDebug('Organization-owner floor report could not run', projectCaughtErrorLogFields(error));\n }\n }\n\n /**\n * WHO holds privileged access right now, at both scopes — the review's raw material (#202).\n *\n * assurance-control: WILDO.ACCESS.PRIVILEGED_REVIEW — surface the privileged-access population at\n * a moment an operator is present, so a periodic review has an explicitly scoped list to decide\n * over.\n *\n * ## Why it reports the SHAPE and not the roster\n *\n * The roster is what a reviewer needs and a boot log is the wrong place to put it: it would be\n * per-principal lines on every restart, unread, and it would put administrator identities into a\n * log stream that has no reason to hold them. What the log CAN carry is the size and the axes —\n * how many at each scope, which roles confer it, and which tenants could not be read — which is\n * enough to notice that the population moved and to know a review is due. The roster stays one\n * call away in `enumeratePrivilegedAccessPopulation`.\n *\n * ## Why it is not a review\n *\n * Nothing here schedules, decides or records an outcome. The occurrence record is the\n * application's to supply as a declared host artifact\n * (`PRIVILEGED_ACCESS_REVIEW_HOST_RECORD_ARTIFACT_KIND_REF`), because Wildo cannot witness a human\n * review — and a boot line that read as one would be the framework asserting a decision nobody\n * made.\n *\n * NON-FATAL and gated exactly like the two floors above: a confined runtime holds no grant over\n * `users` or `organizations`, and a diagnostic must never be why startup fails.\n */\n protected async reportPrivilegedAccessPopulation(): Promise<void> {\n if (this.isPlatformMode) return;\n if (!resolveApplicationRuntimeProfileBootAssertions(this.resolvedRuntimeProfile).reportsAdministrativeContinuityFloors) return;\n\n try {\n if (!this.repositoriesRegistryService.getRepository(CoreResourceType.USERS)) {\n this.logDebug('Skipping the privileged-access population report: no users repository is registered');\n return;\n }\n const authExecutionContextFactory = this.authExecutionContextFactory;\n if (!authExecutionContextFactory) {\n this.logDebug('Skipping the privileged-access population report: the auth execution-context factory is not bound');\n return;\n }\n\n const population = await enumeratePrivilegedAccessPopulation({\n authExecutionContextFactory,\n repositoriesRegistry: this.repositoriesRegistryService,\n errorBuilder: this.errorBuilder,\n applicationScopeConferringRoles: resolveSuperAdminConferringRoles(this.authorizationsService),\n organizationScopeConferringRoles: resolveOrganizationOwnerConferringRoles(this.authorizationsService),\n // Supplied, never read inside the enumeration — see its `observedAt` doc.\n observedAt: new Date().toISOString(),\n });\n\n this.logDebug('Privileged-access population observed', {\n observedAt: population.observedAt,\n applicationScopeHolderCount: population.applicationScopeHolders.length,\n organizationScopeHolderCount: population.organizationScopeHolders.length,\n applicationScopeConferringRoles: population.applicationScopeConferringRoles,\n organizationScopeConferringRoles: population.organizationScopeConferringRoles,\n });\n\n // WARN and separate, because it is the only part a reader must act on: a tenant the\n // enumeration could not read is absent from the population, and an absent tenant looks\n // exactly like one with no privileged access — the wrong direction to be wrong in.\n if (population.unreadableOrganizationIds.length > 0) {\n this.logger.warn(\n 'The privileged-access enumeration could not read the memberships of some tenants. Those tenants are '\n + 'ABSENT from the population, which is indistinguishable from having no privileged access — treat a '\n + 'review taken now as incomplete for them.',\n { unreadableOrganizationIds: population.unreadableOrganizationIds },\n );\n }\n } catch (error) {\n this.logDebug('Privileged-access population report could not run', projectCaughtErrorLogFields(error));\n }\n }\n\n /**\n * WHICH of the application's own resources have never been asked whether they hold personal data.\n *\n * ## Why this reports and does not refuse — the decision, not an omission\n *\n * Issue #93 asked whether a resource holding personal data should be REQUIRED to declare it, and\n * the evidence for requiring it was strong. Measured across two applications, a declaration gets\n * made if and only if the framework refuses to start without it: `exportSubject` is fail-closed at\n * registration and was declared on 10 of 12 resources, while `retentionPolicy` and\n * `.impersonalizeWith()` are unenforced and were declared on 1 and 0.\n *\n * Paul decided against refusing: a hard constraint on every author, for every resource, forever is\n * too strict, and it is the shape `application-creation-directive.md` warns about — the system must\n * work first, with protection arriving as a judge-style guard rather than a refusal wired into the\n * mechanism. So the log line is the whole enforcement here, and the half that actually produces\n * declarations is the framework knowledge that teaches an author to write one while authoring the\n * resource, where it costs a line.\n *\n * ## WARN, and the wording matters more than the level\n *\n * This reports \"unanswered\", never \"undeclared personal data\". Most resources genuinely hold none,\n * and a report that implied otherwise would be wrong about the majority of its own findings — which\n * is precisely how a diagnostic channel trains its readers to skim. ERROR is reserved for the two\n * administrative floors above, where something IS broken.\n *\n * ## Application resources only\n *\n * The engine declares its own posture across ~85 resources and an application author cannot change\n * any of them. `applicationResourceTypes` comes from the registry, which records the split at the\n * one point where the app and core factory maps are still distinguishable.\n */\n private reportApplicationPersonalDataDeclarations(): void {\n try {\n const registry = this.resourcesRegistryService?.getResourcesRegistry();\n if (!registry) {\n this.logDebug('Skipping the personal-data declaration report: the resources registry is not available');\n return;\n }\n\n const unanswered = collectApplicationResourcesWithNoPersonalDataDeclaration({\n resourceConfigurations: registry.resourceConfigurations as unknown as Record<string, PersonalDataDeclarationSubject>,\n applicationResourceTypes: registry.applicationResourceTypes,\n });\n\n if (unanswered.length === 0) {\n this.logDebug('Every application resource has answered the personal-data question', {\n applicationResourceCount: registry.applicationResourceTypes.length,\n });\n return;\n }\n\n this.logger.warn(\n 'Application resources have said NOTHING about whether their rows are about people. This is '\n + 'not a claim that they hold personal data — most resources do not — it is that the question '\n + 'is unanswered, so a generated privacy notice can say nothing about them and an erasure '\n + 'request has no instruction for them. Answer it on the resource configuration with any of: '\n + '`retentionPolicy` (RETAIN_ONLY is the checked way to say \"holds no personal data of its '\n + 'own\"), `dataSubjectPolicy`, `systemAccessPolicy.exportSubject`, or a `.dataCategories()` '\n + 'declaration on the fields that hold it.',\n {\n unansweredResourceCount: unanswered.length,\n applicationResourceCount: registry.applicationResourceTypes.length,\n unansweredResources: unanswered,\n },\n );\n } catch (error) {\n // A diagnostic must never be the reason startup fails — the same contract as the two floors.\n this.logDebug('Personal-data declaration report could not run', projectCaughtErrorLogFields(error));\n }\n }\n\n /**\n * Validate that all components are properly initialized\n */\n private async validateInitialization(options: { headlessMode?: boolean } = {}): Promise<void> {\n this.logDebug('Validating application initialization...');\n\n try {\n // Validate app config is accessible\n if (!this.isPlatformMode) {\n const config = this.appConfigService.config;\n if (!config) {\n const error = this.errorBuilder.buildError(\n ErrorType.CONFIGURATION,\n undefined,\n {customMessageReference: ErrorCustomMessageReference.START_APPLICATION_CONFIGURATION_FAILED}\n );\n throw error;\n }\n }\n\n // Validate resources registry is accessible\n const registry = this.resourcesRegistryService.getResourcesRegistry();\n if (!registry) {\n const error = this.errorBuilder.buildError(\n ErrorType.INTERNAL,\n undefined,\n {customMessageReference: ErrorCustomMessageReference.START_APPLICATION_INITIALIZATION_FAILED}\n );\n throw error;\n }\n\n // Validate repositories registry is accessible\n // const repositoriesDebugInfo = this.repositoriesRegistryService.getDebugInfo();\n // if (!repositoriesDebugInfo.isInitialized) {\n // throw new Error('Repositories registry is not initialized');\n // }\n\n // Validate services registry is accessible\n // const servicesDebugInfo = this.servicesRegistryService.getDebugInfo();\n // if (!servicesDebugInfo.isInitialized) {\n // throw new Error('Services registry is not initialized');\n // }\n\n // Validate controllers registry is accessible\n // const controllersDebugInfo = this.controllersRegistryService.getDebugInfo();\n // if (!controllersDebugInfo.isInitialized) {\n // throw new Error('Controllers registry is not initialized');\n // }\n\n // // Validate HTTP server is running\n // if (!this.httpServerService.isRunning()) {\n // throw new Error('HTTP server is not running');\n // }\n\n const serverInfo = options.headlessMode\n ? undefined\n : this.httpServerService.getServerInfo();\n\n // this.logDebug('Application initialization validation successful', {\n // appName: config.appIdentity.appName,\n // environment: process.env.APPLICATION_ENV,\n // resourcesCount: Object.keys(registry.resourceConfigurations).length,\n // repositoriesCount: repositoriesDebugInfo.repositoryCount,\n // repositoriesOperationPaths: repositoriesDebugInfo.operationPathsCount,\n // servicesCount: servicesDebugInfo.serviceCount,\n // servicesOperationPaths: servicesDebugInfo.operationPathsCount,\n // controllersCount: controllersDebugInfo.controllerCount,\n // controllersOperationPaths: controllersDebugInfo.operationPathsCount,\n // totalRoutes: controllersDebugInfo.totalRoutes,\n // httpServerRunning: this.httpServerService.isRunning(),\n // serverHost: serverInfo?.host,\n // serverPort: serverInfo?.port\n // });\n\n } catch (error) {\n // Validation failure ownership stays with the terminal runtime host.\n throw error;\n }\n }\n\n /**\n * Ensure the application is initialized before operations\n */\n private ensureInitialized(): void {\n if (!this.isInitialized) {\n const error = this.errorBuilder.buildError(\n ErrorType.INTERNAL,\n undefined,\n { customMessageReference: ErrorCustomMessageReference.START_APPLICATION_STARTUP_FAILED }\n );\n throw error;\n }\n }\n\n protected shouldInitializeHttpServer(options: { headlessMode?: boolean }): boolean {\n return !this.isPlatformMode && !options.headlessMode;\n }\n\n protected shouldSyncCronJobs(options: { skipCronSync?: boolean }): boolean {\n return !this.isPlatformMode && !options.skipCronSync;\n }\n\n private rebindServicesRegistryForRuntime(container: any, registry: ServicesRegistryHandlerBackendService): void {\n if (!container || typeof container.rebind !== 'function') {\n return;\n }\n container.rebind(SAAS_SERVICE_TYPES.ServicesRegistryHandlerService).toConstantValue(registry);\n }\n}\n\n/**\n * `listAsSystem` returns either a bare array or a paginated envelope depending on whether the caller\n * asked for pagination. The erasure effect's reads never paginate, but narrowing by CAST would be a\n * lie that survives until the day someone adds a pagination argument — normalise instead.\n */\nfunction normalizeSystemListResult<T>(result: T[] | { data?: T[]; items?: T[] }): T[] {\n if (Array.isArray(result)) return result;\n return result?.data ?? result?.items ?? [];\n}\n\n"]}
|