@wildo-ai/dev-companion 1.1.12 → 1.1.14
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/.tsbuildinfo +1 -1
- package/dist/esm/claude-cli/models/coding-agent-dispatch.models.d.ts +21 -0
- package/dist/esm/claude-cli/models/coding-agent-dispatch.models.d.ts.map +1 -1
- package/dist/esm/claude-cli/models/coding-agent-dispatch.models.js +37 -4
- package/dist/esm/claude-cli/models/coding-agent-dispatch.models.js.map +1 -1
- package/dist/esm/claude-cli/services/accepted-change-commit.companion.service.d.ts.map +1 -1
- package/dist/esm/claude-cli/services/accepted-change-commit.companion.service.js +9 -2
- package/dist/esm/claude-cli/services/accepted-change-commit.companion.service.js.map +1 -1
- package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.d.ts +66 -0
- package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.d.ts.map +1 -1
- package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.js +191 -13
- package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.js.map +1 -1
- package/dist/esm/claude-cli/services/git-change-set.companion.service.d.ts +6 -2
- package/dist/esm/claude-cli/services/git-change-set.companion.service.d.ts.map +1 -1
- package/dist/esm/claude-cli/services/git-change-set.companion.service.js +16 -39
- package/dist/esm/claude-cli/services/git-change-set.companion.service.js.map +1 -1
- package/dist/esm/code-compliance-check/check-raw-feature-id-literals.companion.js +31 -2
- package/dist/esm/code-compliance-check/check-raw-feature-id-literals.companion.js.map +1 -1
- package/dist/esm/companion-api/companion-api.schemas.d.ts +2 -0
- package/dist/esm/companion-api/companion-api.schemas.d.ts.map +1 -1
- package/dist/esm/companion-api/companion-api.schemas.js +8 -0
- package/dist/esm/companion-api/companion-api.schemas.js.map +1 -1
- package/dist/esm/companion-api/controllers/companion.controller.d.ts +13 -0
- package/dist/esm/companion-api/controllers/companion.controller.d.ts.map +1 -1
- package/dist/esm/companion-api/controllers/companion.controller.js +39 -13
- package/dist/esm/companion-api/controllers/companion.controller.js.map +1 -1
- package/dist/esm/companion-api/controllers/long-held-request.companion.d.ts +17 -0
- package/dist/esm/companion-api/controllers/long-held-request.companion.d.ts.map +1 -0
- package/dist/esm/companion-api/controllers/long-held-request.companion.js +33 -0
- package/dist/esm/companion-api/controllers/long-held-request.companion.js.map +1 -0
- package/dist/esm/core/introspection/resources/creation-home-projection.companion.d.ts +9 -0
- package/dist/esm/core/introspection/resources/creation-home-projection.companion.d.ts.map +1 -1
- package/dist/esm/core/introspection/resources/creation-home-projection.companion.js +19 -0
- package/dist/esm/core/introspection/resources/creation-home-projection.companion.js.map +1 -1
- package/dist/esm/core/introspection/resources/creation-plane-projection.companion.service.d.ts.map +1 -1
- package/dist/esm/core/introspection/resources/creation-plane-projection.companion.service.js +7 -1
- package/dist/esm/core/introspection/resources/creation-plane-projection.companion.service.js.map +1 -1
- package/dist/esm/core/introspection/resources/launch-blockers.companion.d.ts +5 -1
- package/dist/esm/core/introspection/resources/launch-blockers.companion.d.ts.map +1 -1
- package/dist/esm/core/introspection/resources/launch-blockers.companion.js +37 -4
- package/dist/esm/core/introspection/resources/launch-blockers.companion.js.map +1 -1
- package/dist/esm/core/introspection/services/companion-introspection.companion.service.d.ts +14 -0
- package/dist/esm/core/introspection/services/companion-introspection.companion.service.d.ts.map +1 -1
- package/dist/esm/core/introspection/services/companion-introspection.companion.service.js +48 -0
- package/dist/esm/core/introspection/services/companion-introspection.companion.service.js.map +1 -1
- package/dist/esm/core/introspection/services/introspection-dependency-tree.companion.d.ts +128 -0
- package/dist/esm/core/introspection/services/introspection-dependency-tree.companion.d.ts.map +1 -0
- package/dist/esm/core/introspection/services/introspection-dependency-tree.companion.js +180 -0
- package/dist/esm/core/introspection/services/introspection-dependency-tree.companion.js.map +1 -0
- package/dist/esm/core/introspection/services/introspection-source-state.companion.service.d.ts +8 -20
- package/dist/esm/core/introspection/services/introspection-source-state.companion.service.d.ts.map +1 -1
- package/dist/esm/core/introspection/services/introspection-source-state.companion.service.js +37 -142
- package/dist/esm/core/introspection/services/introspection-source-state.companion.service.js.map +1 -1
- package/dist/esm/core/introspection/services/introspection-source-walk.worker.d.ts +64 -0
- package/dist/esm/core/introspection/services/introspection-source-walk.worker.d.ts.map +1 -0
- package/dist/esm/core/introspection/services/introspection-source-walk.worker.js +304 -0
- package/dist/esm/core/introspection/services/introspection-source-walk.worker.js.map +1 -0
- package/dist/esm/core/introspection/services/introspection-worker-pool.companion.d.ts +9 -0
- package/dist/esm/core/introspection/services/introspection-worker-pool.companion.d.ts.map +1 -1
- package/dist/esm/core/introspection/services/introspection-worker-pool.companion.js +25 -3
- package/dist/esm/core/introspection/services/introspection-worker-pool.companion.js.map +1 -1
- package/dist/esm/core/runtime/companion-language-model-route.d.ts +16 -1
- package/dist/esm/core/runtime/companion-language-model-route.d.ts.map +1 -1
- package/dist/esm/core/runtime/companion-language-model-route.js +23 -1
- package/dist/esm/core/runtime/companion-language-model-route.js.map +1 -1
- package/dist/esm/core/runtime/restart-drain.companion.d.ts +107 -0
- package/dist/esm/core/runtime/restart-drain.companion.d.ts.map +1 -0
- package/dist/esm/core/runtime/restart-drain.companion.js +237 -0
- package/dist/esm/core/runtime/restart-drain.companion.js.map +1 -0
- package/dist/esm/core/runtime/services/start-companion-application.service.d.ts.map +1 -1
- package/dist/esm/core/runtime/services/start-companion-application.service.js +3 -2
- package/dist/esm/core/runtime/services/start-companion-application.service.js.map +1 -1
- package/dist/esm/core/utils/git-read-broker.companion.d.ts +62 -0
- package/dist/esm/core/utils/git-read-broker.companion.d.ts.map +1 -0
- package/dist/esm/core/utils/git-read-broker.companion.js +282 -0
- package/dist/esm/core/utils/git-read-broker.companion.js.map +1 -0
- package/dist/esm/core/utils/local-write-recording.companion.d.ts +8 -1
- package/dist/esm/core/utils/local-write-recording.companion.d.ts.map +1 -1
- package/dist/esm/core/utils/local-write-recording.companion.js +7 -23
- package/dist/esm/core/utils/local-write-recording.companion.js.map +1 -1
- package/dist/esm/executions/services/companion-executions.companion.service.d.ts +18 -1
- package/dist/esm/executions/services/companion-executions.companion.service.d.ts.map +1 -1
- package/dist/esm/executions/services/companion-executions.companion.service.js +34 -8
- package/dist/esm/executions/services/companion-executions.companion.service.js.map +1 -1
- package/dist/esm/i18n/components/HIGH_LEVEL_VIEWS_CHART_DASHBOARD_LAYOUT_EDITOR.en.d.ts +29 -0
- package/dist/esm/i18n/components/HIGH_LEVEL_VIEWS_CHART_DASHBOARD_LAYOUT_EDITOR.en.d.ts.map +1 -0
- package/dist/esm/i18n/components/HIGH_LEVEL_VIEWS_CHART_DASHBOARD_LAYOUT_EDITOR.en.js +29 -0
- package/dist/esm/i18n/components/HIGH_LEVEL_VIEWS_CHART_DASHBOARD_LAYOUT_EDITOR.en.js.map +1 -0
- package/dist/esm/i18n/components/HIGH_LEVEL_VIEWS_CHART_DASHBOARD_LAYOUT_EDITOR.fr.d.ts +29 -0
- package/dist/esm/i18n/components/HIGH_LEVEL_VIEWS_CHART_DASHBOARD_LAYOUT_EDITOR.fr.d.ts.map +1 -0
- package/dist/esm/i18n/components/HIGH_LEVEL_VIEWS_CHART_DASHBOARD_LAYOUT_EDITOR.fr.js +29 -0
- package/dist/esm/i18n/components/HIGH_LEVEL_VIEWS_CHART_DASHBOARD_LAYOUT_EDITOR.fr.js.map +1 -0
- package/dist/esm/i18n/components/LOW_LEVEL_AI_APPROVAL.en.d.ts +1 -0
- package/dist/esm/i18n/components/LOW_LEVEL_AI_APPROVAL.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_AI_APPROVAL.en.js +2 -1
- package/dist/esm/i18n/components/LOW_LEVEL_AI_APPROVAL.en.js.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_AI_APPROVAL.fr.d.ts +1 -0
- package/dist/esm/i18n/components/LOW_LEVEL_AI_APPROVAL.fr.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_AI_APPROVAL.fr.js +2 -1
- package/dist/esm/i18n/components/LOW_LEVEL_AI_APPROVAL.fr.js.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_AI_CONVERSATION_THREAD.en.d.ts +5 -2
- package/dist/esm/i18n/components/LOW_LEVEL_AI_CONVERSATION_THREAD.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_AI_CONVERSATION_THREAD.en.js +5 -2
- package/dist/esm/i18n/components/LOW_LEVEL_AI_CONVERSATION_THREAD.en.js.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_AI_CONVERSATION_THREAD.fr.d.ts +5 -2
- package/dist/esm/i18n/components/LOW_LEVEL_AI_CONVERSATION_THREAD.fr.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_AI_CONVERSATION_THREAD.fr.js +5 -2
- package/dist/esm/i18n/components/LOW_LEVEL_AI_CONVERSATION_THREAD.fr.js.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_APPROVAL_SEAL.en.d.ts +41 -0
- package/dist/esm/i18n/components/LOW_LEVEL_APPROVAL_SEAL.en.d.ts.map +1 -0
- package/dist/esm/i18n/components/LOW_LEVEL_APPROVAL_SEAL.en.js +41 -0
- package/dist/esm/i18n/components/LOW_LEVEL_APPROVAL_SEAL.en.js.map +1 -0
- package/dist/esm/i18n/components/LOW_LEVEL_APPROVAL_SEAL.fr.d.ts +41 -0
- package/dist/esm/i18n/components/LOW_LEVEL_APPROVAL_SEAL.fr.d.ts.map +1 -0
- package/dist/esm/i18n/components/LOW_LEVEL_APPROVAL_SEAL.fr.js +41 -0
- package/dist/esm/i18n/components/LOW_LEVEL_APPROVAL_SEAL.fr.js.map +1 -0
- package/dist/esm/i18n/components/LOW_LEVEL_CONTENT_SECTION_CONTAINER.en.d.ts +1 -0
- package/dist/esm/i18n/components/LOW_LEVEL_CONTENT_SECTION_CONTAINER.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_CONTENT_SECTION_CONTAINER.en.js +2 -1
- package/dist/esm/i18n/components/LOW_LEVEL_CONTENT_SECTION_CONTAINER.en.js.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_CONTENT_SECTION_CONTAINER.fr.d.ts +1 -0
- package/dist/esm/i18n/components/LOW_LEVEL_CONTENT_SECTION_CONTAINER.fr.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_CONTENT_SECTION_CONTAINER.fr.js +2 -1
- package/dist/esm/i18n/components/LOW_LEVEL_CONTENT_SECTION_CONTAINER.fr.js.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_FORM_FIELD_STRING.en.d.ts +1 -0
- package/dist/esm/i18n/components/LOW_LEVEL_FORM_FIELD_STRING.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_FORM_FIELD_STRING.en.js +2 -1
- package/dist/esm/i18n/components/LOW_LEVEL_FORM_FIELD_STRING.en.js.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_FORM_FIELD_STRING.fr.d.ts +1 -0
- package/dist/esm/i18n/components/LOW_LEVEL_FORM_FIELD_STRING.fr.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_FORM_FIELD_STRING.fr.js +2 -1
- package/dist/esm/i18n/components/LOW_LEVEL_FORM_FIELD_STRING.fr.js.map +1 -1
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_MFA_CHALLENGE.en.d.ts +1 -0
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_MFA_CHALLENGE.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_MFA_CHALLENGE.en.js +2 -1
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_MFA_CHALLENGE.en.js.map +1 -1
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_MFA_CHALLENGE.fr.d.ts +1 -0
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_MFA_CHALLENGE.fr.d.ts.map +1 -1
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_MFA_CHALLENGE.fr.js +2 -1
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_MFA_CHALLENGE.fr.js.map +1 -1
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_TERMS.en.d.ts +2 -0
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_TERMS.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_TERMS.en.js +3 -1
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_TERMS.en.js.map +1 -1
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_TERMS.fr.d.ts +2 -0
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_TERMS.fr.d.ts.map +1 -1
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_TERMS.fr.js +3 -1
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_TERMS.fr.js.map +1 -1
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_USER_AUTH.en.d.ts +1 -1
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_USER_AUTH.en.js +1 -1
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_USER_AUTH.en.js.map +1 -1
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_USER_AUTH.fr.d.ts +1 -1
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_USER_AUTH.fr.js +1 -1
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_USER_AUTH.fr.js.map +1 -1
- package/dist/esm/i18n/components/RESOURCES_LAYOUTS_FILTERS.en.d.ts +2 -0
- package/dist/esm/i18n/components/RESOURCES_LAYOUTS_FILTERS.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/RESOURCES_LAYOUTS_FILTERS.en.js +3 -1
- package/dist/esm/i18n/components/RESOURCES_LAYOUTS_FILTERS.en.js.map +1 -1
- package/dist/esm/i18n/components/RESOURCES_LAYOUTS_FILTERS.fr.d.ts +3 -1
- package/dist/esm/i18n/components/RESOURCES_LAYOUTS_FILTERS.fr.d.ts.map +1 -1
- package/dist/esm/i18n/components/RESOURCES_LAYOUTS_FILTERS.fr.js +4 -2
- package/dist/esm/i18n/components/RESOURCES_LAYOUTS_FILTERS.fr.js.map +1 -1
- package/dist/esm/i18n/components/RESOURCES_LAYOUTS_LIST.en.d.ts +17 -0
- package/dist/esm/i18n/components/RESOURCES_LAYOUTS_LIST.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/RESOURCES_LAYOUTS_LIST.en.js +18 -1
- package/dist/esm/i18n/components/RESOURCES_LAYOUTS_LIST.en.js.map +1 -1
- package/dist/esm/i18n/components/RESOURCES_LAYOUTS_LIST.fr.d.ts +17 -0
- package/dist/esm/i18n/components/RESOURCES_LAYOUTS_LIST.fr.d.ts.map +1 -1
- package/dist/esm/i18n/components/RESOURCES_LAYOUTS_LIST.fr.js +18 -1
- package/dist/esm/i18n/components/RESOURCES_LAYOUTS_LIST.fr.js.map +1 -1
- package/dist/esm/i18n/composite_views/app.creation-conversation.fr.d.ts +206 -195
- package/dist/esm/i18n/composite_views/app.creation-conversation.fr.d.ts.map +1 -1
- package/dist/esm/i18n/composite_views/app.creation-conversation.fr.js +206 -195
- package/dist/esm/i18n/composite_views/app.creation-conversation.fr.js.map +1 -1
- package/dist/esm/i18n/composite_views/app.creation-dossier.fr.d.ts +10 -0
- package/dist/esm/i18n/composite_views/app.creation-dossier.fr.d.ts.map +1 -1
- package/dist/esm/i18n/composite_views/app.creation-dossier.fr.js +12 -2
- package/dist/esm/i18n/composite_views/app.creation-dossier.fr.js.map +1 -1
- package/dist/esm/i18n/resources/wildoApplicationActorSystemExecutions.fr.d.ts +70 -0
- package/dist/esm/i18n/resources/wildoApplicationActorSystemExecutions.fr.d.ts.map +1 -1
- package/dist/esm/i18n/resources/wildoApplicationActorSystemExecutions.fr.js +70 -0
- package/dist/esm/i18n/resources/wildoApplicationActorSystemExecutions.fr.js.map +1 -1
- package/dist/esm/i18n/resources/wildoApplicationActorTasks.fr.d.ts +12 -2
- package/dist/esm/i18n/resources/wildoApplicationActorTasks.fr.d.ts.map +1 -1
- package/dist/esm/i18n/resources/wildoApplicationActorTasks.fr.js +12 -2
- package/dist/esm/i18n/resources/wildoApplicationActorTasks.fr.js.map +1 -1
- package/dist/esm/i18n/resources/wildoApplicationFlowSystemExecutions.fr.d.ts +10 -0
- package/dist/esm/i18n/resources/wildoApplicationFlowSystemExecutions.fr.d.ts.map +1 -1
- package/dist/esm/i18n/resources/wildoApplicationFlowSystemExecutions.fr.js +10 -0
- package/dist/esm/i18n/resources/wildoApplicationFlowSystemExecutions.fr.js.map +1 -1
- package/dist/esm/i18n/resources/workbenchBuildDispatchPlan.fr.d.ts +25 -20
- package/dist/esm/i18n/resources/workbenchBuildDispatchPlan.fr.d.ts.map +1 -1
- package/dist/esm/i18n/resources/workbenchBuildDispatchPlan.fr.js +25 -20
- package/dist/esm/i18n/resources/workbenchBuildDispatchPlan.fr.js.map +1 -1
- package/dist/esm/i18n/resources/workbenchBuildPlanTasks.fr.d.ts +32 -32
- package/dist/esm/i18n/resources/workbenchBuildPlanTasks.fr.js +32 -32
- package/dist/esm/i18n/resources/workbenchBuildPlanTasks.fr.js.map +1 -1
- package/dist/esm/i18n/resources/workbenchBuildTaskRecords.fr.d.ts +65 -65
- package/dist/esm/i18n/resources/workbenchBuildTaskRecords.fr.js +65 -65
- package/dist/esm/i18n/resources/workbenchBuildTaskRecords.fr.js.map +1 -1
- package/dist/esm/i18n/resources/workbenchDossierEntries.fr.d.ts +20 -0
- package/dist/esm/i18n/resources/workbenchDossierEntries.fr.d.ts.map +1 -1
- package/dist/esm/i18n/resources/workbenchDossierEntries.fr.js +20 -0
- package/dist/esm/i18n/resources/workbenchDossierEntries.fr.js.map +1 -1
- package/dist/esm/i18n/resources/workbenchGovernanceQuestions.fr.d.ts +12 -0
- package/dist/esm/i18n/resources/workbenchGovernanceQuestions.fr.d.ts.map +1 -1
- package/dist/esm/i18n/resources/workbenchGovernanceQuestions.fr.js +13 -1
- package/dist/esm/i18n/resources/workbenchGovernanceQuestions.fr.js.map +1 -1
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.en.d.ts +40 -0
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.en.d.ts.map +1 -1
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.en.js +13 -0
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.en.js.map +1 -1
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.fr.d.ts +40 -0
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.fr.d.ts.map +1 -1
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.fr.js +40 -0
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.fr.js.map +1 -1
- package/dist/esm/i18n/system_enums/application-creation.en.d.ts +5 -0
- package/dist/esm/i18n/system_enums/application-creation.en.d.ts.map +1 -1
- package/dist/esm/i18n/system_enums/application-creation.en.js +6 -0
- package/dist/esm/i18n/system_enums/application-creation.en.js.map +1 -1
- package/dist/esm/i18n/system_enums/application-creation.fr.d.ts +175 -170
- package/dist/esm/i18n/system_enums/application-creation.fr.d.ts.map +1 -1
- package/dist/esm/i18n/system_enums/application-creation.fr.js +175 -170
- package/dist/esm/i18n/system_enums/application-creation.fr.js.map +1 -1
- package/dist/esm/i18n/system_enums/flows-actors.fr.d.ts +22 -22
- package/dist/esm/i18n/system_enums/flows-actors.fr.js +22 -22
- package/dist/esm/i18n/system_enums/flows-actors.fr.js.map +1 -1
- package/dist/esm/i18n/system_enums/run-records.fr.d.ts +21 -21
- package/dist/esm/i18n/system_enums/run-records.fr.js +21 -21
- package/dist/esm/i18n/system_enums/run-records.fr.js.map +1 -1
- package/dist/esm/i18n/system_enums/workbench-build.en.d.ts +3 -0
- package/dist/esm/i18n/system_enums/workbench-build.en.d.ts.map +1 -1
- package/dist/esm/i18n/system_enums/workbench-build.en.js +3 -0
- package/dist/esm/i18n/system_enums/workbench-build.en.js.map +1 -1
- package/dist/esm/i18n/system_enums/workbench-build.fr.d.ts +37 -33
- package/dist/esm/i18n/system_enums/workbench-build.fr.d.ts.map +1 -1
- package/dist/esm/i18n/system_enums/workbench-build.fr.js +37 -33
- package/dist/esm/i18n/system_enums/workbench-build.fr.js.map +1 -1
- package/dist/esm/i18n/system_enums/workbench-creation-home.en.d.ts +1 -0
- package/dist/esm/i18n/system_enums/workbench-creation-home.en.d.ts.map +1 -1
- package/dist/esm/i18n/system_enums/workbench-creation-home.en.js +1 -0
- package/dist/esm/i18n/system_enums/workbench-creation-home.en.js.map +1 -1
- package/dist/esm/i18n/system_enums/workbench-creation-home.fr.d.ts +18 -17
- package/dist/esm/i18n/system_enums/workbench-creation-home.fr.d.ts.map +1 -1
- package/dist/esm/i18n/system_enums/workbench-creation-home.fr.js +18 -17
- package/dist/esm/i18n/system_enums/workbench-creation-home.fr.js.map +1 -1
- package/dist/esm/i18n/system_enums/workbench-dossier.fr.d.ts +7 -5
- package/dist/esm/i18n/system_enums/workbench-dossier.fr.d.ts.map +1 -1
- package/dist/esm/i18n/system_enums/workbench-dossier.fr.js +8 -6
- package/dist/esm/i18n/system_enums/workbench-dossier.fr.js.map +1 -1
- package/dist/esm/i18n/system_enums/workbench-secrets.fr.d.ts +12 -12
- package/dist/esm/i18n/system_enums/workbench-secrets.fr.js +12 -12
- package/dist/esm/i18n/system_enums/workbench-secrets.fr.js.map +1 -1
- package/dist/esm/i18n/system_enums/workbench-specification-artifact.fr.d.ts +1 -0
- package/dist/esm/i18n/system_enums/workbench-specification-artifact.fr.d.ts.map +1 -1
- package/dist/esm/i18n/system_enums/workbench-specification-artifact.fr.js +2 -1
- package/dist/esm/i18n/system_enums/workbench-specification-artifact.fr.js.map +1 -1
- package/dist/esm/i18n-labelling/services/labelling-planner.companion.service.d.ts.map +1 -1
- package/dist/esm/i18n-labelling/services/labelling-planner.companion.service.js +3 -4
- package/dist/esm/i18n-labelling/services/labelling-planner.companion.service.js.map +1 -1
- package/dist/esm/i18n-labelling/utils/declared-refusal-codes.utils.d.ts +11 -0
- package/dist/esm/i18n-labelling/utils/declared-refusal-codes.utils.d.ts.map +1 -1
- package/dist/esm/i18n-labelling/utils/declared-refusal-codes.utils.js +21 -0
- package/dist/esm/i18n-labelling/utils/declared-refusal-codes.utils.js.map +1 -1
- package/dist/esm/meta-workflows/models/application-coding-agent.actors-system.definitions.d.ts +5 -1
- package/dist/esm/meta-workflows/models/application-coding-agent.actors-system.definitions.d.ts.map +1 -1
- package/dist/esm/meta-workflows/models/application-coding-agent.actors-system.definitions.js +5 -1
- package/dist/esm/meta-workflows/models/application-coding-agent.actors-system.definitions.js.map +1 -1
- package/dist/esm/meta-workflows/models/playbook-run-record.models.d.ts +12 -0
- package/dist/esm/meta-workflows/models/playbook-run-record.models.d.ts.map +1 -1
- package/dist/esm/meta-workflows/models/playbook-run-record.models.js +9 -0
- package/dist/esm/meta-workflows/models/playbook-run-record.models.js.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.d.ts +200 -20
- package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.js +1107 -230
- package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-follow-up-derivation.companion.d.ts +158 -16
- package/dist/esm/meta-workflows/services/application-build-follow-up-derivation.companion.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-follow-up-derivation.companion.js +381 -46
- package/dist/esm/meta-workflows/services/application-build-follow-up-derivation.companion.js.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-generation-step.companion.service.d.ts +58 -0
- package/dist/esm/meta-workflows/services/application-build-generation-step.companion.service.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-generation-step.companion.service.js +116 -2
- package/dist/esm/meta-workflows/services/application-build-generation-step.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-landing-projection.companion.d.ts +3 -3
- package/dist/esm/meta-workflows/services/application-build-landing-projection.companion.js +3 -3
- package/dist/esm/meta-workflows/services/application-build-landing-projection.companion.js.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-task-closure.companion.d.ts +9 -0
- package/dist/esm/meta-workflows/services/application-build-task-closure.companion.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-task-closure.companion.js +19 -0
- package/dist/esm/meta-workflows/services/application-build-task-closure.companion.js.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-task-coding-policy.companion.service.d.ts +12 -0
- package/dist/esm/meta-workflows/services/application-build-task-coding-policy.companion.service.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-task-coding-policy.companion.service.js +31 -7
- package/dist/esm/meta-workflows/services/application-build-task-coding-policy.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/services/creation-intervention-ledger.companion.service.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/creation-intervention-ledger.companion.service.js +4 -5
- package/dist/esm/meta-workflows/services/creation-intervention-ledger.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/services/creation-run-report.companion.service.d.ts +2 -2
- package/dist/esm/meta-workflows/services/creation-run-report.companion.service.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/creation-run-report.companion.service.js +10 -8
- package/dist/esm/meta-workflows/services/creation-run-report.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/services/foundation-executor.companion.service.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/foundation-executor.companion.service.js +6 -3
- package/dist/esm/meta-workflows/services/foundation-executor.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/services/playbook-run-write-register-window.companion.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/playbook-run-write-register-window.companion.js +3 -5
- package/dist/esm/meta-workflows/services/playbook-run-write-register-window.companion.js.map +1 -1
- package/dist/esm/meta-workflows/services/playbook-run.companion.service.d.ts +68 -3
- package/dist/esm/meta-workflows/services/playbook-run.companion.service.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/playbook-run.companion.service.js +281 -69
- package/dist/esm/meta-workflows/services/playbook-run.companion.service.js.map +1 -1
- package/package.json +18 -18
package/dist/esm/meta-workflows/services/application-build-generation-step.companion.service.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application-build-generation-step.companion.service.js","sourceRoot":"","sources":["../../../../src/meta-workflows/services/application-build-generation-step.companion.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EACL,+BAA+B,EAC/B,kCAAkC,EAClC,qCAAqC,GAEtC,MAAM,sEAAsE,CAAC;AAC9E,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAGzD,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAC/G,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAC9G,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EACrB,2BAA2B,EAC3B,2BAA2B,EAC3B,uBAAuB,EAIvB,iCAAiC,EACjC,8BAA8B,EAC9B,gCAAgC,GACjC,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,6BAA6B,EAAE,MAAM,wDAAwD,CAAC;AACvG,OAAO,EAAE,2BAA2B,EAAE,mCAAmC,EAAE,MAAM,wDAAwD,CAAC;AAE1I,OAAO,EAAE,sBAAsB,EAAE,MAAM,wDAAwD,CAAC;AAChG,OAAO,EAAE,iCAAiC,EAAE,iCAAiC,EAAE,MAAM,+CAA+C,CAAC;AAGrI,OAAO,EAAE,uBAAuB,EAAE,qBAAqB,EAAsB,MA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;IAMzD,YAAA,MAAM,CAAC,uBAAuB,CAAC,kBAAkB,CAAC,CAAA;IAAE,YAAA,QAAQ,EAAE,CAAA;iEAdoB,gCAAgC;QACzB,qCAAqC;QACrC,qCAAqC;QACxC,6BAA6B;QACxB,gCAAgC;QAC1C,2BAA2B;GAdpG,8CAA8C,CA21B1D","sourcesContent":["import * as path from 'node:path';\nimport {\n ApplicationSchemaPlanObligation,\n SCHEMA_PLAN_LOCKFILE_RELATIVE_PATH,\n assessApplicationSchemaPlanObligation,\n type ApplicationSchemaPlanObligationAssessment,\n} from '../../core/config/application-schema-plan-obligation.companion.utils';\nimport { mkdir, readFile } from 'node:fs/promises';\nimport { existsSync, readdirSync } from 'node:fs';\nimport { inject, injectable, optional } from 'inversify';\n\nimport type { AppConfigurationService, LoggerService } from '@wildo-ai/saas-backend-lib';\nimport { SAAS_SERVICE_TYPES, describeCaughtError, executeBoundedSubprocess } from '@wildo-ai/saas-backend-lib';\nimport { BrandDesignState, DesignTokenBlockState, SchemaPlanSyncState } from '@wildo-ai/platform-core-shared';\nimport {\n NO_PLAYBOOK_SPEND_METER,\n SAAS_CONFIG_FILE_NAME,\n applyApplicationDisplayName,\n listDisplayNameBearingPaths,\n resolveBrandSurfaceDirs,\n type ApplicationDisplayNameResult,\n type PlaybookSpend,\n type PropagateBrandAssetsOutcome,\n assertSpecificationWritePermitted,\n SpecificationWriteRefusedError,\n writeSpecificationFileAtomically,\n} from '@wildo-ai/application-creation-runtime';\nimport { assertSpecificationsReadWhole } from '../../core/context/companion-package-loaders.companion';\nimport { loadSpecificationFamilyData, readSpecificationFamiliesForRewrite } from '../../core/context/specification-family-data.companion';\nimport type { EngineCapabilityAlignmentResult, FoundationExecutorCompanionService } from './foundation-executor.companion.service';\nimport { propagateAcceptedBrand } from '../../brand/services/brand-propagation.companion.utils';\nimport { BRAND_RESOLVED_ASSETS_MODULE_PATH, hasAcceptedBrandMarkInWorkingTree } from '../../brand/models/accepted-brand-mark.models';\nimport type { TechnicalDocCompanionService } from '../../technical-doc/services/technical-doc.companion.service';\nimport { AvailableLanguage, type PaletteDerivationAdjustment, type PaletteSeeds, type ThemePersonality } from '@wildo-ai/presets-components-models';\nimport { BuildPlanTaskTargetKind, FrontendConfigSurface, type BuildPlanTask } from '@wildo-ai/saas-specifications/application-creation';\n\nimport { COMPANION_SERVICE_TYPES } from '../../core/inject/models/service-types';\nimport type { CompanionContext } from '../../core/context/companion-context';\nimport { getCompanionConfiguredPrimaryLanguage, getCompanionServedLanguages } from '../../core/config/primary-language.companion.utils';\nimport { signDerivedInputs } from '../../core/utils/derived-input-signature.companion.utils';\nimport { LabellingPlannerCompanionService } from '../../i18n-labelling/services/labelling-planner.companion.service';\nimport { LabellingPlanIncompletenessReason, type LabellingPlanResult } from '../../i18n-labelling/models/labelling-unit.models';\nimport { BACKEND_I18N_TREE_RELATIVE_PATH } from '../../i18n-labelling/utils/per-unit-file.utils';\nimport { requestCompanionRestart } from '../../core/runtime/companion-self-restart.companion';\nimport { BuildPlanTaskLandedProbeKind, type BuildPlanTaskLandedProbe } from './application-build-task-coding-policy.companion.service';\nimport {\n LabellizeOrchestratorCompanionService,\n type LabellizeRunResult,\n} from '../../i18n-labelling/services/labellize-orchestrator.companion.service';\nimport {\n TranslateOrchestratorCompanionService,\n type TranslateRunResult,\n} from '../../i18n-labelling/services/translate-orchestrator.companion.service';\nimport {\n EmailTemplateCompanionService,\n type GenerateEmailTemplatesResult,\n type TranslateEmailTemplateLabelsResult,\n} from '../../email/services/email-template.companion.service';\nimport {\n LogoDeliberationCompanionService,\n type LogoDeliberationResult,\n} from '../../brand/services/logo-deliberation.companion.service';\nimport {\n BrandAcceptCompanionService,\n type BrandAcceptResult,\n} from '../../brand/services/brand-accept.companion.service';\nimport type { CompanionExecutionSessionContext } from '../../core/traceability/companion-traceability.models';\nimport type { LabellingProgressReporter } from '../../i18n-labelling/models/labelling-progress.models';\nimport { GenerationStepProgressTracker, type GenerationStepProgress } from '../models/generation-step-progress.models';\nimport { PlaybookSpendMeasuredUnit, type PlaybookSpendMeterCompanionService } from './playbook-spend-meter.companion.service';\nimport { resolveFrontendConfigSurfaceFile } from './application-build-task-coding-policy.companion.service';\nimport type { WebsitePalette, WebsitePersonality } from '@wildo-ai/saas-website/companion';\nimport {\n BRAND_DESIGN_FRONTEND_RELATIVE_PATH,\n BRAND_WEBSITE_THEME_WEBSITE_RELATIVE_PATH,\n DESIGN_SYSTEM_CONFIG_FRONTEND_RELATIVE_PATH,\n renderBrandDesignModule,\n renderBrandWebsiteThemeModule,\n type BrandDesignInputs,\n} from '../../brand/services/brand-design.companion.utils';\n\n/**\n * The companion generation steps this host can EXECUTE.\n *\n * The values are the `generationStepRef` slugs a build plan authors on a\n * `COMPANION_GENERATION_STEP` target — the closed vocabulary this enum is the\n * named home of. A build plan may only reference steps that exist here: an\n * unknown ref refuses by name (below) instead of silently parking the build,\n * which is exactly how the first generation step ever authored\n * (`i18n-labels`) stalled the Wonder Todos build plan — the vocabulary\n * existed in `_core`, and nothing executed it.\n *\n * Seeds join this enum WHEN a seed-generation pipeline exists to execute —\n * adding the value without one would let a build plan dispatch a step that can\n * only fail; the unknown-ref refusal below is the honest answer until then.\n * The executor is the integration point, not a new lane per step.\n */\nexport enum ApplicationBuildGenerationStep {\n /**\n * The application's labels in its PRIMARY locale — the `labellize` pipeline, and nothing else.\n *\n * It used to translate as well, into every other enabled locale, in the same step. That made \"the\n * labels exist\" and \"every translation is done\" one graph node, and everything that needs only the\n * first waited for the second. Measured on app-creation-test-004 (2026-10-01, #2204): the English\n * labels existed within minutes, translation into four locales then ran for hours at about one\n * file every two minutes per locale, and the documentation portal — which reads primary-locale\n * labels only — stayed dark the whole time. A hand-run `wildo docs publish` succeeded at once.\n *\n * Translation is now {@link I18N_TRANSLATIONS}, its own node, which the dispatch host derives after\n * this one. A step that needs labels to EXIST depends on this step; nothing depends on translation.\n */\n I18N_LABELS = 'i18n-labels',\n /**\n * The application's labels translated into every enabled locale other than the primary — the\n * `translate` pipeline. Split out of {@link I18N_LABELS} (#2204) so translation stops gating the\n * steps that need only the primary locale.\n *\n * DERIVED by the dispatch host rather than authored, for the reason {@link DATABASE_MIGRATIONS} is:\n * the obligation follows from what the application declares (more than one enabled locale) and\n * from the plan carrying a labels step, not from a decision the plan makes. A plan MAY author it,\n * and then the host derives nothing. See `withHostDerivedTranslationStep`.\n *\n * Nothing downstream waits on it, by design: the documentation portal reads primary-locale labels\n * only (#1993 is the issue for translating it), and the website and the application read their\n * label files at run time, so a translation landing is picked up without any republish step.\n */\n I18N_TRANSLATIONS = 'i18n-translations',\n EMAIL_TEMPLATES = 'email-templates',\n /**\n * The brand mark: an expert panel derives creative directions, images are generated, a vision\n * judge scores them, and the winner is promoted into the specifications SSOT.\n *\n * Added under the rule this enum's docblock states — a value joins WHEN a pipeline exists to\n * execute it. That pipeline was fully built and reachable only by a human issuing\n * `POST /brand/{generate,deliberate,accept}-logo`, so an application could acquire a considered\n * mark only if someone drove it by hand (issue #220). Hand-supplying a logo stays available and\n * unchanged; what this adds is the journey's own path to one.\n */\n LOGO = 'logo',\n /**\n * `wildo db generate` — turn the drift between the application's resource model and its accepted\n * schema plan into a committed migration, so a PostgreSQL-backed application's tables exist.\n *\n * Added under the rule this enum's docblock states — a value joins WHEN a pipeline exists to\n * execute it. The pipeline is the CLI's own generate door, which already owns every hard part\n * (the planner, the risk vocabulary, the refusals) and advances the lockfile in the same\n * invocation that writes the migration.\n *\n * Without a lockfile `wildo db generate` treats the whole model as the INITIAL migration and writes\n * the baseline beside it. That is exactly what a PostgreSQL application with no baseline owes, and\n * exactly wrong for a MongoDB-backed one, where it would author a table set nothing uses — so the\n * application's DECLARED store decides (#1144, `ApplicationSchemaPlanObligation`): the step runs\n * for an accepted plan or an owed baseline, and REFUSES for a MongoDB store or an unreadable\n * declaration. See `executeGenerationStep`.\n */\n DATABASE_MIGRATIONS = 'database-migrations',\n /**\n * `wildo docs publish` — derive, render, measure, validate and write the application's customer\n * documentation portal, so the chapters its build authored are something a reader can reach.\n *\n * Added under the rule this enum's docblock states — a value joins WHEN a pipeline exists to\n * execute it — and it is the same shape {@link LOGO} joined in: the pipeline was fully built and\n * reachable ONLY by a human, through `POST /technical-doc/publish-managed` or the `wildo docs\n * publish` command that calls it. Measured on the first end-to-end journey run (#1273): the plan\n * carried SIX `DOCUMENTATION_CHAPTER` tasks, the engine's own derivation refused with *\"Application\n * content remains absent until the app-creator owns an accepted authoring artifact\"*, an agent\n * built that artifact — and nothing published it. `technical-doc` could not even typecheck, because\n * `src/pages/search.tsx` imports a search index the publish is what writes, so\n * `check:technical-doc-typecheck` was red for the whole build and failed a documentation task on a\n * red it did not cause, at $19.33.\n *\n * The step is DERIVED by the dispatch host rather than authored by the decomposer, for the reason\n * {@link DATABASE_MIGRATIONS} is: an application owes it as a consequence of what its plan\n * contains — here, any documentation chapter — rather than as a decision the plan makes. See\n * `withHostDerivedDocumentationPublicationStep`.\n *\n * It runs AFTER the chapters and after `i18n-labels`, and the second is not optional: publication\n * resolves the application's organization-role documentation and refuses without the primary-locale\n * label — *\"requires primary-locale label 'roles.ORG_ADMIN.label'; generate the application's role\n * labels before publishing documentation\"*. Running it early fails on exactly that.\n *\n * It does NOT wait for {@link I18N_TRANSLATIONS}: the primary locale is all it reads (#2204).\n */\n DOCUMENTATION_PUBLICATION = 'documentation-publication',\n /**\n * `wildo design-tokens generate` — rewrite the generated design-token block of the frontend's\n * stylesheet (`frontend/src/index.css`, between `@wildo-ai:design-token:start` and `:end`) from its\n * design-system config, so the stylesheet and the running frontend describe the same page.\n *\n * Added under the rule this enum's docblock states, and in the shape {@link DATABASE_MIGRATIONS}\n * joined: the pipeline is a CLI door that already owns every hard part (which frontend, which config,\n * the markers, the generator), and this step runs it.\n *\n * **Why the step exists (#2358).** The stylesheet block is what the loading screen and the first paint\n * use; the runtime applies the config's tokens only after the app mounts. A DESIGN_SYSTEM build task\n * may write `frontend/src/config/design-system.config.ts` and nothing else, so a design system authored\n * during creation reached the page only through the runtime, after mount, and the first paint kept the\n * scaffold's palette. Nothing ran the command: no Vite hook, no step, no task.\n *\n * **Derived by the dispatch host** for the reason {@link DOCUMENTATION_PUBLICATION} is: the obligation\n * follows from what the plan contains, here anything that WRITES the design-system config — today a\n * coding task targeting the DESIGN_SYSTEM frontend config surface; a generation step that derives the\n * config (the brand design module, #2353) joins the same prerequisite set. The block is regenerated after every writer, because it is a function of the config's final\n * state. See `withHostDerivedDesignTokensStep`.\n *\n * **Landed on the block, not on the file.** `frontend/src/index.css` is committed in every scaffolded\n * application, so \"the stylesheet is committed\" is true before the step ever runs — the trap\n * {@link ApplicationBuildGenerationStepLandedKind} exists for. The step lands when the stylesheet is\n * committed AND `wildo design-tokens validate` reports its block current\n * ({@link ApplicationBuildGenerationStepLandedKind.DESIGN_TOKEN_BLOCK_CURRENT}).\n */\n DESIGN_TOKENS = 'design-tokens',\n\n /**\n * Write `frontend/src/config/brand-design.ts` from the brand's visual tone, so the design-system config can derive\n * its palette from the brand's colours with `derivePaletteSourceConfig(BRAND_PALETTE_SEEDS)` (#2353) and compose its\n * theme from the brand's style words with `composeTheme(BRAND_THEME_PERSONALITY, overrides)` (#2359), instead of a\n * coding agent picking colours by eye and copying a named theme. When the application declares a website, also\n * write `website/src/brand-theme.ts`: `BRAND_WEBSITE_PALETTE` (the same derived palette as the website's colour\n * roles, with the dark roles for its inverse tone) and `BRAND_WEBSITE_PERSONALITY` (the same point, plus the two\n * website axes), so the site and the product show one primary and one character (#2597, #2742).\n *\n * **Why a step and not the coding task.** The brand already names its colours and its style; turning colours into a\n * palette that reads is arithmetic (`derivePalette`), and turning style words into a point on the theme axes is a\n * fixed lexicon (`deriveThemePersonality`). Asking a model to redo either is how the named palettes came to fail AA\n * on every primary button. The step writes the SEEDS, not the palette (the config derives it when evaluated, so a\n * derivation improvement needs no regeneration), and the POINT, not the theme (the config composes it, keeping the\n * overrides the brand genuinely needs).\n *\n * **Derived by the dispatch host**, prepended with no prerequisites (the {@link DATABASE_MIGRATIONS} shape), and\n * every DESIGN_SYSTEM config task waits on it, because the config it writes imports this file. Owed when the plan\n * writes the design-system config, builds the website, or the config already imports the module. See\n * `withHostDerivedBrandDesignStep`.\n *\n * **Landed on content, not on the file.** The file is generated once and then stays committed, so \"committed\" alone\n * would land the step forever after the first build and a rebrand would never reach the design system — the trap\n * {@link ApplicationBuildGenerationStepLandedKind} exists for. It lands when EVERY module it writes is committed AND\n * equals what the brand's current visual tone renders ({@link ApplicationBuildGenerationStepLandedKind.BRAND_DESIGN_CURRENT}). A\n * brand with no visual tone renders the neutral seeds and the default theme's point, so the step is owed and lands\n * either way.\n */\n DESIGN_SYSTEM_BRAND = 'design-system-brand',\n /**\n * Turn on the engine capabilities the application's decisions imply and nothing has turned on (#2497):\n * ORGANIZATIONS for an organization-tenancy domain plan, EMAIL_TRANSACTIONAL because tenant invitations\n * send mail (served by the credential-free development provider), EMAIL_INBOUND when work arrives by email.\n *\n * The foundation step does this, and a build planned without it did not: app-creation-test-005 made its\n * modules through ensure-module tasks and shipped `ORGANIZATIONS: false` under an organization-tenancy\n * plan. DERIVED by the dispatch host for the reason {@link DATABASE_MIGRATIONS} is: the obligation follows\n * from what the application declares, not from a decision the plan makes. See\n * `withHostDerivedEngineCapabilitiesStep`. The derivation is the foundation's own\n * (`FoundationExecutorCompanionService.alignEngineCapabilitiesWithDecisions`), so the two cannot disagree.\n */\n ENGINE_CAPABILITIES = 'engine-capabilities',\n /**\n * Carry the chosen brand's name to the application (#2505): the SaaS config's `displayName`, and every file a\n * template rendered the provisional name into (the page title, the website's copy, the documentation portal).\n *\n * Both creation runs chose \"Groundwork\" and shipped \"App Creation Test 00x\" everywhere, because the brand step\n * decides a name and nothing applied it. DERIVED by the dispatch host whenever the landed brand's name differs from\n * the committed `displayName` (see `withHostDerivedDisplayNameStep`). The rename is\n * `applyApplicationDisplayName`, which derives the files from the templates.\n */\n DISPLAY_NAME = 'display-name',\n}\n\n/**\n * What a generation step may write, relative to its evidence paths (#2505 review F2).\n *\n * The dispatch plan's write scope, and in a shared worktree window the paths the step CLAIMS as its own, are derived\n * from the step's evidence. Most steps own whole directories (a label unit tree, the migrations directory, the brand\n * module's directory), so their evidence directories are the scope. A step whose evidence files sit inside directories\n * other writers share must be scoped to those FILES: widening each to its directory would let it claim, and commit\n * under its name, a concurrent coding run's half-written edits. An exact file is never claimed in a shared window;\n * the wave-end reconciliation commits it with its siblings (the #2497 rule).\n *\n * Applied in ONE place, `resolveGenerationStepWritableRoots`, which the dispatch host calls for every generation step.\n */\nexport enum GenerationStepWriteScope {\n /** The directories holding the evidence paths: the step is their only writer. */\n EVIDENCE_DIRECTORIES = 'EVIDENCE_DIRECTORIES',\n /** Exactly the evidence files: others write the directories around them. */\n EVIDENCE_FILES = 'EVIDENCE_FILES',\n}\n\n/** Total over the steps, so a step added tomorrow does not compile until somebody says what it may write. */\nexport const GENERATION_STEP_WRITE_SCOPE: Readonly<Record<ApplicationBuildGenerationStep, GenerationStepWriteScope>> = {\n [ApplicationBuildGenerationStep.I18N_LABELS]: GenerationStepWriteScope.EVIDENCE_DIRECTORIES,\n [ApplicationBuildGenerationStep.I18N_TRANSLATIONS]: GenerationStepWriteScope.EVIDENCE_DIRECTORIES,\n [ApplicationBuildGenerationStep.EMAIL_TEMPLATES]: GenerationStepWriteScope.EVIDENCE_DIRECTORIES,\n [ApplicationBuildGenerationStep.LOGO]: GenerationStepWriteScope.EVIDENCE_DIRECTORIES,\n [ApplicationBuildGenerationStep.DATABASE_MIGRATIONS]: GenerationStepWriteScope.EVIDENCE_DIRECTORIES,\n [ApplicationBuildGenerationStep.DOCUMENTATION_PUBLICATION]: GenerationStepWriteScope.EVIDENCE_DIRECTORIES,\n // The configuration file, which the worker, minion, provider and roles coding tasks also write.\n [ApplicationBuildGenerationStep.ENGINE_CAPABILITIES]: GenerationStepWriteScope.EVIDENCE_FILES,\n // The page title, the website's packs, the portal's title: every one sits beside files other tasks write.\n [ApplicationBuildGenerationStep.DISPLAY_NAME]: GenerationStepWriteScope.EVIDENCE_FILES,\n // `frontend/src/index.css`: one file in a directory every frontend coding task also writes.\n [ApplicationBuildGenerationStep.DESIGN_TOKENS]: GenerationStepWriteScope.EVIDENCE_FILES,\n // `frontend/src/config/brand-design.ts`, and `website/src/brand-theme.ts` when a website is declared: single files\n // in directories the frontend config and website coding tasks also write.\n [ApplicationBuildGenerationStep.DESIGN_SYSTEM_BRAND]: GenerationStepWriteScope.EVIDENCE_FILES,\n};\n\n/** The compiled registry `wildo db` imports to compute the current plan. Absent ⇒ the plan cannot be computed. */\nconst MODULES_REGISTRY_RELATIVE_PATH = 'backend-api/dist/modules-registry.backend.js';\n\n/** Bounds on the `wildo db generate` subprocess. Generous: it spawns a runner that imports the whole app registry. */\nconst MIGRATION_GENERATION_TIMEOUT_MS = 10 * 60 * 1000;\n\n/**\n * Bounds on a `wildo design-tokens` subprocess. It loads one config file and the SaaS config; measured\n * ~14 s for `validate` on `examples/wonder-todos` (2026-10-03), most of it CLI boot and the config\n * loader's alias graph. Two minutes leaves room for a cold cache without letting a hung CLI hold a board.\n */\nconst DESIGN_TOKENS_CLI_TIMEOUT_MS = 2 * 60 * 1000;\n\n/**\n * How a generation step proves it did its work.\n *\n * Two kinds, because the obvious single answer does not fit every step. Most steps write FILES\n * whose paths are known before they run, and \"landed\" means those files are committed. A migration\n * step cannot: its artifact is `backend-api/migrations/<timestamp>_<name>/migration.sql`, and the\n * timestamp is minted DURING the run.\n *\n * The tempting substitutes were both rejected, and the reasons are worth keeping:\n *\n * - the accepted lockfile — once a plan is accepted it ALREADY EXISTS before every later run of the\n * step, so \"is it committed?\" is trivially true and the step would land having done nothing. That is precisely the directory-prefix shortcut this service's `LOGO` case warns about.\n * - an empty path list — legal, and it makes the dispatch host SKIP the landed check entirely, so a\n * step that generated nothing would read as complete.\n *\n * So the migration step's evidence is not a file at all: it is the STATE the step exists to reach —\n * the model and the accepted plan agree. That is what `wildo db diff --check` answers.\n */\nexport enum ApplicationBuildGenerationStepLandedKind {\n /** Landed when every named path is committed. The shape every file-writing step uses. */\n COMMITTED_PATHS = 'committed_paths',\n /** Landed when the resource model and the accepted schema plan agree. */\n SCHEMA_PLAN_IN_SYNC = 'schema_plan_in_sync',\n /**\n * Landed by construction: the application owes this step nothing. Today that is an `i18n-translations`\n * step on an application whose only enabled locale is the primary (#2204 review). The host never\n * DERIVES that step there, but a plan may AUTHOR it, and its evidence list is empty — and an empty\n * `COMMITTED_PATHS` list never lands, so the step would be ready forever and the plan never finish.\n * An honest \"nothing is owed\" is a landing, not a missing proof.\n */\n NOT_OWED = 'not_owed',\n /**\n * Landed when the stylesheet is COMMITTED and its generated design-token block is CURRENT against the\n * design-system config ({@link DesignTokenBlockState.CURRENT}). Both halves, because each alone is\n * vacuous: the stylesheet is committed before the step ever runs, and a current block in an uncommitted\n * stylesheet is work nobody accepted.\n */\n DESIGN_TOKEN_BLOCK_CURRENT = 'design_token_block_current',\n /**\n * Landed when EVERY module the step writes (the frontend's brand design, and the website's colours when a website\n * is declared, `modulePaths`) is COMMITTED and its text equals what the brand's current visual tone renders\n * ({@link BrandDesignState.CURRENT}). Both halves, for the reason the design-token block needs both: after the first\n * build the files are committed whatever the brand now says, and a current file nobody committed is work nobody\n * accepted.\n */\n BRAND_DESIGN_CURRENT = 'brand_design_current',\n /**\n * Landed when the COMMITTED resolved-assets module lists a MASTER asset whose file is committed (#2410) — the\n * logo step. Not `COMMITTED_PATHS` over the module: `wildo init` scaffolds that module (an empty asset list) and the\n * brand index imports it, so it is committed on every application before the step ever runs, and a presence test\n * landed the step having drawn nothing. See `accepted-brand-mark.models.ts`.\n */\n ACCEPTED_BRAND_MARK = 'accepted_brand_mark',\n /**\n * Landed when the COMMITTED `wildo.saas.config.ts` enables every named capability (#2497) — the\n * `engine-capabilities` step. Not `COMMITTED_PATHS` over the config: every application commits that file\n * before the step runs, so a presence test would land it having enabled nothing.\n */\n ENGINE_CAPABILITIES_ENABLED = 'engine_capabilities_enabled',\n /**\n * Never landed while the labels PLAN is partial in a way that hides units the application owes (#2504): the frontend\n * introspection failed or answered malformed, so the sidebar sections, views, composite views and settings hub are\n * absent from the plan rather than empty; or the fresh resource list could not be read. Evidence read off such a plan\n * is met by the units it can see, so a run on it lands while owing the rest.\n */\n LABEL_PLAN_INCOMPLETE = 'label_plan_incomplete',\n /**\n * Landed when every probe holds (#2504) — the labels step: each planned unit's file is committed, and each planned\n * id of a frontend-derived ROOT unit (a sidebar section, a view, a composite view, a settings-hub entry) is declared in\n * that committed file. Those buckets are one `root.<locale>.ts` each, so a file check alone never notices a missing\n * section: 005's sidebar file existed and held only the engine's three sections.\n */\n LANDED_PROBES = 'landed_probes',\n /**\n * Landed when the COMMITTED `wildo.saas.config.ts` declares `displayName` equal to the brand's name (#2505) — the\n * `display-name` step. Not `COMMITTED_PATHS`: the config is committed before the step runs.\n */\n DISPLAY_NAME_APPLIED = 'display_name_applied',\n /**\n * Never landed while what decides the step cannot be read: the brand for `display-name` (#2694), the domain plan, the\n * business model, the integration plan or the dossier for `engine-capabilities` (#3258). Whether anything is owed is\n * unknown, and it used to read as \"nothing\", so the step landed without running. Passed over like an unanswerable\n * design step, and `detail` says why, on the record and on the board.\n */\n INPUT_UNREADABLE = 'input_unreadable',\n}\n\n/**\n * The plan degradations that hide label units the application owes (#2504), so a labels step may neither land on nor\n * run from such a plan. RESOURCE_REGISTRY_STALE also names the units it hides, which the evidence counts.\n */\nexport const LABEL_PLAN_BLOCKING_INCOMPLETENESS: ReadonlySet<LabellingPlanIncompletenessReason> = new Set([\n LabellingPlanIncompletenessReason.RESOURCE_REGISTRY_STALE,\n LabellingPlanIncompletenessReason.RESOURCE_REGISTRY_UNREADABLE,\n LabellingPlanIncompletenessReason.FRONTEND_INTROSPECTION_FAILED,\n LabellingPlanIncompletenessReason.FRONTEND_INTROSPECTION_MALFORMED,\n]);\n\n/** What the dispatch host must evaluate to decide whether a generation-step task has landed. */\nexport type ApplicationBuildGenerationStepLandedCondition =\n | { readonly kind: ApplicationBuildGenerationStepLandedKind.COMMITTED_PATHS; readonly paths: readonly string[] }\n | { readonly kind: ApplicationBuildGenerationStepLandedKind.SCHEMA_PLAN_IN_SYNC }\n | { readonly kind: ApplicationBuildGenerationStepLandedKind.NOT_OWED }\n | {\n readonly kind: ApplicationBuildGenerationStepLandedKind.DESIGN_TOKEN_BLOCK_CURRENT;\n /** The stylesheet that must be committed; deliberately not named `paths`, so no reader can mistake it for the whole condition. */\n readonly stylesheetPath: string;\n }\n | {\n readonly kind: ApplicationBuildGenerationStepLandedKind.BRAND_DESIGN_CURRENT;\n /**\n * The generated modules that must be committed: the frontend's brand design, and the website's brand colours when\n * the application declares a website (#2597). Not named `paths`, for the reason `stylesheetPath` is not.\n */\n readonly modulePaths: readonly string[];\n }\n | { readonly kind: ApplicationBuildGenerationStepLandedKind.ACCEPTED_BRAND_MARK; readonly modulePath: string }\n | { readonly kind: ApplicationBuildGenerationStepLandedKind.ENGINE_CAPABILITIES_ENABLED; readonly configPath: string; readonly capabilities: readonly string[] }\n | { readonly kind: ApplicationBuildGenerationStepLandedKind.LABEL_PLAN_INCOMPLETE; readonly detail: string }\n | { readonly kind: ApplicationBuildGenerationStepLandedKind.LANDED_PROBES; readonly probes: readonly BuildPlanTaskLandedProbe[] }\n | { readonly kind: ApplicationBuildGenerationStepLandedKind.DISPLAY_NAME_APPLIED; readonly configPath: string; readonly displayName: string }\n | { readonly kind: ApplicationBuildGenerationStepLandedKind.INPUT_UNREADABLE; readonly detail: string };\n\n// `SchemaPlanSyncState` is declared in `@wildo-ai/platform-core-shared` since #2530: the workbench shows it on a step's record.\n\n/**\n * The line `wildo db diff --check` prints when, and only when, it found drift. The CLI exits non-zero for\n * drift and for every could-not-ask failure alike, so this text is the one thing that separates them. A COPY\n * of the message in the CLI's `commands/db/diff.command.ts`, pinned to it by a source-parity test.\n */\nexport const SCHEMA_PLAN_DRIFT_OUTPUT_MARKER = 'ungenerated schema change(s)';\n\n/** Classify a failed `wildo db diff --check`: DRIFTED when the CLI said so, UNANSWERABLE otherwise. */\nexport function classifySchemaPlanCheckFailure(error: unknown): SchemaPlanSyncState {\n const details = (error as { details?: { stdout?: unknown; stderr?: unknown } } | null | undefined)?.details;\n const output = `${typeof details?.stdout === 'string' ? details.stdout : ''}\\n${typeof details?.stderr === 'string' ? details.stderr : ''}`;\n return output.includes(SCHEMA_PLAN_DRIFT_OUTPUT_MARKER) ? SchemaPlanSyncState.DRIFTED : SchemaPlanSyncState.UNANSWERABLE;\n}\n\n// `DesignTokenBlockState` is declared in `@wildo-ai/platform-core-shared` since #2530: the workbench shows it on a step's record.\n\n/**\n * The line `wildo design-tokens validate` prints when, and only when, the block is stale. A COPY of\n * `DESIGN_TOKENS_STALE_BLOCK_OUTPUT_MARKER` in the CLI's `services/design-tokens/design-tokens.constants.ts`,\n * pinned to it by a source-parity test (the companion cannot import the CLI).\n */\nexport const DESIGN_TOKEN_BLOCK_STALE_OUTPUT_MARKER = 'design-token block is stale';\n\n/**\n * The line `validate` prints when the block is current. The positive answer is read from this text, never\n * from a zero exit code, so a check `validate` gains about something other than the block (a palette that\n * fails contrast) cannot turn a current block into an unanswerable one. A COPY of\n * `DESIGN_TOKENS_CURRENT_BLOCK_OUTPUT_MARKER`, pinned the same way.\n */\nexport const DESIGN_TOKEN_BLOCK_CURRENT_OUTPUT_MARKER = 'generated block is up to date';\n\n/**\n * The stylesheet `generate` rewrites, relative to its frontend root: the CLI writes `<frontend>/src/` +\n * `DESIGN_TOKENS_STYLESHEET_FILE_NAME`. Pinned by the parity test.\n */\nexport const DESIGN_TOKEN_STYLESHEET_FRONTEND_RELATIVE_PATH = 'src/index.css';\n\n/** Classify the combined output of a `validate` run, whatever its exit code. */\nexport function classifyDesignTokenValidateOutput(output: string): DesignTokenBlockState {\n if (output.includes(DESIGN_TOKEN_BLOCK_STALE_OUTPUT_MARKER)) return DesignTokenBlockState.STALE;\n if (output.includes(DESIGN_TOKEN_BLOCK_CURRENT_OUTPUT_MARKER)) return DesignTokenBlockState.CURRENT;\n return DesignTokenBlockState.UNANSWERABLE;\n}\n\n/**\n * The frontend directory (app-root relative) whose stylesheet the `design-tokens` step regenerates: the\n * one the DESIGN_SYSTEM surface's config lives in, read off the coding policy's own table. So the step\n * regenerates the stylesheet of exactly the config a DESIGN_SYSTEM task wrote, and an application with\n * several `SAAS_APP` frontends (where the CLI refuses to guess) still gets a definite answer.\n */\nexport function resolveDesignSystemFrontendDirectory(): string {\n const configFile = resolveFrontendConfigSurfaceFile(FrontendConfigSurface.DESIGN_SYSTEM);\n const suffix = `/${DESIGN_SYSTEM_CONFIG_FRONTEND_RELATIVE_PATH}`;\n if (!configFile.endsWith(suffix)) {\n throw new Error(\n `The DESIGN_SYSTEM frontend config surface names ${configFile}, which does not end in ${suffix}; `\n + 'the design-tokens step cannot tell which frontend that config belongs to.',\n );\n }\n return configFile.slice(0, -suffix.length);\n}\n\n/** The stylesheet the `design-tokens` step regenerates, app-root relative (`frontend/src/index.css`). */\nexport function resolveDesignTokenStylesheetPath(): string {\n return path.posix.join(resolveDesignSystemFrontendDirectory(), DESIGN_TOKEN_STYLESHEET_FRONTEND_RELATIVE_PATH);\n}\n\n// `BrandDesignState` is declared in `@wildo-ai/platform-core-shared` since #2530: the workbench shows it on a step's record.\n\n/** The generated brand design module, app-root relative (`frontend/src/config/brand-design.ts`). */\nexport function resolveBrandDesignPath(): string {\n return path.posix.join(resolveDesignSystemFrontendDirectory(), BRAND_DESIGN_FRONTEND_RELATIVE_PATH);\n}\n\n/**\n * Does this design-system config import the generated brand design module? A literal-text test of the config, on\n * purpose: the import is the only way the config can consume it, so a config naming the module depends on it whoever\n * wrote it.\n */\nexport function designSystemConfigImportsBrandDesign(configSource: string): boolean {\n return /from\\s+['\"]\\.\\/brand-design(?:\\.js|\\.ts)?['\"]/.test(configSource);\n}\n\n/**\n * Does the application's design-system config import the generated brand design module? The second half of when the\n * brand step is owed: a config an earlier build wrote that derives from the module must see a later rebrand even when\n * the current plan writes no config. False when the config cannot be read, which owes nothing: there is nothing to feed.\n */\nexport async function readDesignSystemConfigImportsBrandDesign(saasRoot: string): Promise<boolean> {\n try {\n return designSystemConfigImportsBrandDesign(await readFile(path.join(saasRoot, resolveFrontendConfigSurfaceFile(FrontendConfigSurface.DESIGN_SYSTEM)), 'utf8'));\n } catch {\n return false;\n }\n}\n\n/** The combined output a failed bounded subprocess carried, or '' when it carried none. */\nfunction subprocessFailureOutput(error: unknown): string {\n const details = (error as { details?: { stdout?: unknown; stderr?: unknown } } | null | undefined)?.details;\n return `${typeof details?.stdout === 'string' ? details.stdout : ''}\\n${typeof details?.stderr === 'string' ? details.stderr : ''}`;\n}\n\n/** A build plan referenced a generation step this companion cannot execute. Named, so the plan author sees the vocabulary. */\nexport class ApplicationBuildUnknownGenerationStepError extends Error {\n public constructor(taskRef: string, generationStepRef: string) {\n super(\n `Build task ${taskRef} references generation step \"${generationStepRef}\", which this companion cannot execute. `\n + `Known steps: ${Object.values(ApplicationBuildGenerationStep).join(', ')}.`,\n );\n }\n}\n\n/** What one executed i18n-labels step did — the pipeline's result, verbatim. */\nexport interface ApplicationBuildI18nLabelsStepRunResult {\n readonly generationStepRef: ApplicationBuildGenerationStep.I18N_LABELS;\n /** Primary-locale label generation (incremental — fresh units are skipped by the freshness lock). */\n readonly labellize: LabellizeRunResult;\n /** The app-root-relative files this step is responsible for — the same paths the landed check reads. */\n readonly evidencePaths: readonly string[];\n}\n\n/** What one executed i18n-translations step did — the pipeline's result, verbatim. */\nexport interface ApplicationBuildI18nTranslationsStepRunResult {\n readonly generationStepRef: ApplicationBuildGenerationStep.I18N_TRANSLATIONS;\n /** The locales it translated into: every enabled locale but the primary. */\n readonly targetLocales: readonly string[];\n /** Translation into those locales; absent when there were none (an authored step on a one-locale app). */\n readonly translate?: TranslateRunResult;\n /** The app-root-relative files this step is responsible for — the same paths the landed check reads. */\n readonly evidencePaths: readonly string[];\n}\n\n/** What one executed email-templates step did — the per-pipeline results, verbatim. */\nexport interface ApplicationBuildEmailTemplatesStepRunResult {\n readonly generationStepRef: ApplicationBuildGenerationStep.EMAIL_TEMPLATES;\n /** Primary-locale template + labels generation (incremental — existing template+labels pairs are skipped). */\n readonly emailGenerate: GenerateEmailTemplatesResult;\n /** Label translation into the other enabled locales; absent when the app enables only its primary locale. */\n readonly emailTranslate?: TranslateEmailTemplateLabelsResult;\n /** The app-root-relative files this step is responsible for — the same paths the landed check reads. */\n readonly evidencePaths: readonly string[];\n}\n\n/**\n * What one executed logo step did.\n *\n * `deliberation`/`accept` are absent when the step was SKIPPED because the application already has\n * an accepted mark — see the executor for why skipping is the incremental answer here rather than\n * the freshness lock the text pipelines use.\n */\nexport interface ApplicationBuildLogoStepRunResult {\n readonly generationStepRef: ApplicationBuildGenerationStep.LOGO;\n /** The expert-panel deliberation that derived directions, generated marks and picked a winner. */\n readonly deliberation?: LogoDeliberationResult;\n /** Promotion of that winner into `specifications/src/brand/` — images plus the rewritten SSOT. */\n readonly accept?: BrandAcceptResult;\n /** True when an accepted mark already existed and no model was called. */\n readonly skippedBecauseAlreadyAccepted: boolean;\n /**\n * The accepted mark copied to every surface that serves it — the app's public folder and runtime\n * config, the documentation portal, the website's icons and Open Graph image. Runs on BOTH branches:\n * a surface composed after the mark was accepted (a website added later) still receives it.\n */\n readonly propagation?: PropagateBrandAssetsOutcome;\n /** Why propagation could not run. Never fails the step: the mark is accepted either way. */\n readonly propagationError?: string;\n /** The app-root-relative files this step is responsible for — the same paths the landed check reads. */\n readonly evidencePaths: readonly string[];\n}\n\n/**\n * What one executed `database-migrations` step did.\n *\n * `evidencePaths` is present for symmetry with its siblings and carries the MUTATION SCOPE, not the\n * landed evidence — this step lands on `SCHEMA_PLAN_IN_SYNC`, never on a path.\n */\nexport interface ApplicationBuildDatabaseMigrationsStepRunResult {\n readonly generationStepRef: ApplicationBuildGenerationStep.DATABASE_MIGRATIONS;\n /** True when the plan was already in sync and `wildo db generate` had nothing to write. */\n readonly skippedBecauseAlreadyInSync: boolean;\n /** The migration folder names present after the run that were not present before it. Usually 0 or 1. */\n readonly generatedMigrationFolders: readonly string[];\n /** The generator's own output tail — it names the tables and the risk of each change. */\n readonly outputTail: string;\n /** MUTATION SCOPE, not landed evidence. */\n readonly evidencePaths: readonly string[];\n}\n\n/**\n * What one executed `documentation-publication` step did.\n *\n * `published` is the publish service's own report — output count and root — kept whole rather than\n * projected, because the step's value to a reader is \"what did it write\", and this lane has no\n * second opinion about that.\n */\nexport interface ApplicationBuildDocumentationPublicationStepRunResult {\n readonly generationStepRef: ApplicationBuildGenerationStep.DOCUMENTATION_PUBLICATION;\n /** The publish service's report. */\n readonly published: unknown;\n /** The rendered search index, which is both this step's mutation scope and its landed evidence. */\n readonly evidencePaths: readonly string[];\n}\n\n/** What one executed `design-tokens` step did. */\nexport interface ApplicationBuildDesignTokensStepRunResult {\n readonly generationStepRef: ApplicationBuildGenerationStep.DESIGN_TOKENS;\n /** The frontend directory the CLI was pointed at (app-root relative). */\n readonly frontendDirectory: string;\n /** False when the block was already current: `generate` then reports no change and writes nothing. */\n readonly regenerated: boolean;\n /** The CLI's own output tail. */\n readonly outputTail: string;\n /** The stylesheet: the step's mutation scope, and the file its landing requires committed. */\n readonly evidencePaths: readonly string[];\n}\n\n/** What one executed `design-system-brand` step did. */\nexport interface ApplicationBuildDesignSystemBrandStepRunResult {\n readonly generationStepRef: ApplicationBuildGenerationStep.DESIGN_SYSTEM_BRAND;\n /** The seeds written: the brand's first two colours, or the framework's neutral seeds when it names none. */\n readonly seeds: PaletteSeeds;\n /** False when the brand names no colour. */\n readonly fromBrand: boolean;\n /** Every move the derivation makes away from the brand's colours, with the reason — what a reviewer should know before accepting. */\n readonly adjustments: readonly PaletteDerivationAdjustment[];\n /** The point on the theme personality axes written: what the brand's style words select, or the default theme's point. */\n readonly personality: ThemePersonality;\n /** False when the brand states no style words. */\n readonly personalityFromBrand: boolean;\n /**\n * The website's palette and personality point, derived from the same visual tone, when the application declares a\n * website (#2597, #2742); absent without one.\n */\n readonly websiteTheme?: { readonly palette: WebsitePalette; readonly personality: WebsitePersonality };\n /** False when every module already said this, so nothing was written. */\n readonly rewritten: boolean;\n /** The generated modules: the step's whole mutation scope, and the files its landing requires committed. */\n readonly evidencePaths: readonly string[];\n}\n\n/** What one executed `engine-capabilities` step did (#2497): the foundation's own capability record, beside the paths it may write. */\nexport interface ApplicationBuildEngineCapabilitiesStepRunResult extends EngineCapabilityAlignmentResult {\n readonly generationStepRef: ApplicationBuildGenerationStep.ENGINE_CAPABILITIES;\n /** The application's configuration: the only file this step writes. */\n readonly evidencePaths: readonly string[];\n}\n\n/** What one executed `display-name` step did (#2505). */\nexport interface ApplicationBuildDisplayNameStepRunResult extends ApplicationDisplayNameResult {\n readonly generationStepRef: ApplicationBuildGenerationStep.DISPLAY_NAME;\n readonly evidencePaths: readonly string[];\n}\n\n/** One executed generation step's result, discriminated by the step it ran. */\nexport type ApplicationBuildGenerationStepRunResult =\n | ApplicationBuildI18nLabelsStepRunResult\n | ApplicationBuildI18nTranslationsStepRunResult\n | ApplicationBuildEmailTemplatesStepRunResult\n | ApplicationBuildLogoStepRunResult\n | ApplicationBuildDatabaseMigrationsStepRunResult\n | ApplicationBuildDocumentationPublicationStepRunResult\n | ApplicationBuildDesignTokensStepRunResult\n | ApplicationBuildDesignSystemBrandStepRunResult\n | ApplicationBuildEngineCapabilitiesStepRunResult\n | ApplicationBuildDisplayNameStepRunResult;\n\n/** A step's result with what its model calls spent (#2232) — what the step's row records. */\nexport type MeasuredGenerationStepRunResult = ApplicationBuildGenerationStepRunResult & { readonly spend: PlaybookSpend };\n\n/**\n * The identity allowlist for every `wildo` subprocess a generation step runs (`wildo db …`,\n * `wildo design-tokens …`).\n *\n * PATH is the load-bearing entry: the CLI is a GLOBAL install and is deliberately NOT linked into an\n * application's `node_modules/.bin` — verified on both dogfood applications — so it is reachable\n * only through PATH. Kept to the same minimal set the verification hook uses rather than passing the\n * companion's whole environment.\n */\nfunction buildCliSubprocessEnv(): NodeJS.ProcessEnv {\n const env: NodeJS.ProcessEnv = {};\n for (const key of ['PATH', 'HOME', 'USER', 'LOGNAME', 'SHELL', 'TERM']) {\n const value = process.env[key];\n if (value !== undefined) env[key] = value;\n }\n return env;\n}\n\n/** Migration folder names currently on disk (not the lockfile beside them). */\nfunction listMigrationFolders(saasRoot: string): readonly string[] {\n const migrationsRoot = path.join(saasRoot, 'backend-api', 'migrations');\n if (!existsSync(migrationsRoot)) return [];\n return readdirSync(migrationsRoot, { withFileTypes: true })\n .filter((entry) => entry.isDirectory())\n .map((entry) => entry.name)\n .sort();\n}\n\n/**\n * Execute companion-owned generation steps of a build plan, and answer which\n * files each step is responsible for.\n *\n * A `COMPANION_GENERATION_STEP` is deterministic in its ROUTING and its\n * PLACEMENT — which pipeline runs and where the files land is decided by\n * code, never by a coding agent (`application-build-task-coding-policy`\n * refuses to compose a coding contract for one). The CONTENT may still come\n * from a model (labels are generated text), which is exactly the directive's\n * bucket-3 shape: a companion-owned generation step interleaved by the build\n * loop.\n *\n * ## Landed evidence, and why it is planner-derived\n *\n * The build lane's landed answer is GIT: a task has landed when the files it\n * produces are committed. A generation step's target carries only its\n * `generationStepRef` — no paths — so the file set must be DERIVED. For\n * `i18n-labels` it is the labelling planner's unit inventory in the primary\n * locale, and for `i18n-translations` the same inventory crossed with every\n * other enabled locale: exactly the files the pipelines write, re-derivable\n * after a restart, a fresh clone, or a branch switch. Deliberately NOT the\n * whole i18n directory: that is already committed on any app with history, and\n * a directory-prefix check would report the step landed without it ever\n * having run for the units it still owes.\n */\n/**\n * The last schema-plan sync answer per application root, valid while its input signature holds.\n *\n * Module-level rather than per-instance so two service instances resolving landing concurrently — a\n * board read and a `/build/next` — share one 8-9 s subprocess instead of spawning two.\n */\nconst schemaPlanSyncStateCache = new Map<string, { signature: string; state: SchemaPlanSyncState }>();\n\n/** Answers still being computed, so concurrent callers at the same signature await one subprocess. */\nconst schemaPlanSyncStateInFlight = new Map<string, { signature: string | null; compute: Promise<SchemaPlanSyncState> }>();\n\n/**\n * The files that decide the schema-plan sync answer: the compiled MODEL and the ACCEPTED PLAN.\n *\n * Exported so the freshness loop below signs exactly what the resolver signs. Two copies of this list\n * would let the loop refresh on a change the resolver ignores, or miss one it honours.\n */\nexport function signSchemaPlanInputs(saasRoot: string): string | null {\n return signDerivedInputs(\n [path.join(saasRoot, 'backend-api', 'dist'), path.join(saasRoot, 'infrastructure'), ...resolveEngineDistRoots(saasRoot)],\n [path.join(saasRoot, SCHEMA_PLAN_LOCKFILE_RELATIVE_PATH)],\n );\n}\n\n/**\n * The compiled ENGINE the backend resolves: every `@wildo-ai/*` package's `dist` under\n * `backend-api/node_modules`. The engine declares resources (the planner plans them) and owns the\n * planner, so an engine change moves the schema plan without touching either app-local input.\n *\n * Signed since 2026-09-25. It used to be the one unsigned input, on the premise that an engine change\n * respawns the companion and empties this cache. On scratch-journey the companion ran from 12:20Z\n * while engine resources landed in the app's injected snapshot at 13:04Z and 13:41Z: its supervisor\n * was paused and did not restart it. The cache kept answering IN_SYNC, and the build plan reported the\n * migrations step LANDED with 16 changes owed. Walking all six packages there costs about 80 ms,\n * against about 8.5 s to re-derive. The enumeration is total, so a package that starts declaring\n * resources is covered the day it does.\n */\nfunction resolveEngineDistRoots(saasRoot: string): readonly string[] {\n const scope = path.join(saasRoot, 'backend-api', 'node_modules', '@wildo-ai');\n if (!existsSync(scope)) return [];\n return readdirSync(scope)\n .sort()\n .map((name) => path.join(scope, name, 'dist'))\n .filter((dist) => existsSync(dist));\n}\n\n/**\n * The cached schema-plan sync answer for one application root.\n *\n * Module-level rather than a class member because it never used instance state, and because the\n * COMPANION BOOT path warms it (`startIntrospectionFreshnessPlane`). Reaching it through the service\n * would drag the labelling, email and brand service graph into the boot graph to answer a question\n * about two files — and a boot path that fails closed needs the companion it just stopped\n * (`continuity-drift-and-cas-basis.md` Rule 3).\n */\nexport async function resolveSchemaPlanSyncState(saasRoot: string): Promise<SchemaPlanSyncState> {\n /*\n * The answer costs a `wildo db diff --check` SUBPROCESS, which boots the CLI and imports the\n * application's compiled modules registry: measured 8-14 s on `examples/wonder-todos`, 2026-09-18,\n * of which ~5.5 s is the registry import alone. It is asked on every landing resolution — so on\n * every creation-board refresh and every `/build/next` — and it was the single largest remaining\n * cost of both.\n *\n * Nothing about that answer can change unless the MODEL or the ACCEPTED PLAN changes, and both are\n * files. So it is re-derived when they move and reused when they do not: ~17 ms to sign against\n * ~8500 ms to re-run. A TTL is not used here for the same reason the specifications loader has\n * none — this state decides whether the migration step is offered, so drift must surface at the\n * next read rather than at the next expiry.\n *\n * The ENGINE reaches the application through node_modules rather than through either app-local path,\n * so its compiled packages are signed as well (see `resolveEngineDistRoots`). This used to rely on an\n * engine change respawning the companion; one survived an engine change on 2026-09-25 and served a\n * stale IN_SYNC. The answer is still NOT persisted to disk across restarts (#1350).\n */\n const signature = signSchemaPlanInputs(saasRoot);\n if (signature !== null) {\n const cached = schemaPlanSyncStateCache.get(saasRoot);\n if (cached?.signature === signature) return cached.state;\n const inFlight = schemaPlanSyncStateInFlight.get(saasRoot);\n if (inFlight?.signature === signature) return inFlight.compute;\n }\n\n const compute = computeSchemaPlanSyncState(saasRoot);\n schemaPlanSyncStateInFlight.set(saasRoot, { signature, compute });\n try {\n const state = await compute;\n if (signature !== null) schemaPlanSyncStateCache.set(saasRoot, { signature, state });\n return state;\n } finally {\n // A failed derivation caches nothing, so the next caller retries rather than inheriting it.\n if (schemaPlanSyncStateInFlight.get(saasRoot)?.compute === compute) {\n schemaPlanSyncStateInFlight.delete(saasRoot);\n }\n }\n}\n\nasync function computeSchemaPlanSyncState(saasRoot: string): Promise<SchemaPlanSyncState> {\n const { obligation } = await assessApplicationSchemaPlanObligation(saasRoot);\n if (obligation === ApplicationSchemaPlanObligation.NOT_OWED || obligation === ApplicationSchemaPlanObligation.UNDETERMINED) {\n return SchemaPlanSyncState.UNANSWERABLE;\n }\n if (!existsSync(path.join(saasRoot, MODULES_REGISTRY_RELATIVE_PATH))) return SchemaPlanSyncState.UNANSWERABLE;\n if (obligation === ApplicationSchemaPlanObligation.BASELINE_OWED) {\n /*\n * No baseline yet, so the whole model is ungenerated: that is DRIFT, and the step has work. But\n * `diff --check` refuses outright without a lockfile, so it cannot tell drift from could-not-ask\n * here. Plain `wildo db diff` can: it computes the model (refusing a stale or unloadable one, #403)\n * and, with no lockfile, reports the table count and succeeds. Only a computable model is drift.\n */\n try {\n await executeBoundedSubprocess({\n command: 'wildo',\n args: ['db', 'diff'],\n cwd: saasRoot,\n env: buildCliSubprocessEnv(),\n timeoutMs: MIGRATION_GENERATION_TIMEOUT_MS,\n });\n return SchemaPlanSyncState.DRIFTED;\n } catch {\n return SchemaPlanSyncState.UNANSWERABLE;\n }\n }\n try {\n await executeBoundedSubprocess({\n command: 'wildo',\n args: ['db', 'diff', '--check'],\n cwd: saasRoot,\n env: buildCliSubprocessEnv(),\n timeoutMs: MIGRATION_GENERATION_TIMEOUT_MS,\n });\n return SchemaPlanSyncState.IN_SYNC;\n } catch (error) {\n // Drift is named in the CLI's own output; an absent CLI or a runner that could not import the\n // registry is not, and must not put the step at the head of the queue.\n return classifySchemaPlanCheckFailure(error);\n }\n}\n\n/** The last design-token block answer per application root, valid while its input signature holds. Module-level for the reason {@link schemaPlanSyncStateCache} is. */\nconst designTokenBlockStateCache = new Map<string, { signature: string; state: DesignTokenBlockState }>();\n\n/** Answers still being computed, so concurrent landing reads at one signature share one subprocess. */\nconst designTokenBlockStateInFlight = new Map<string, { signature: string | null; compute: Promise<DesignTokenBlockState> }>();\n\n/**\n * The files that decide whether the design-token block is current.\n *\n * - The frontend's whole `src/` tree: the stylesheet itself, the config, and anything the config imports\n * from beside it (an application may keep token values in a module next to the config). 107 files on\n * `examples/wonder-todos`, signed in ~25 ms warm.\n * - The `@wildo-ai/presets-components-models` build the frontend resolves: it owns the default tokens the\n * config spreads and the stylesheet generator, so an engine change can move the expected block with no\n * edit in the application. Only that package, not every engine package under `node_modules`: the other\n * seven hold ~8,000 files (~200–500 ms warm) and none of them feeds the stylesheet (`theme` is runtime\n * behaviour, never CSS).\n *\n * Not signed: the CLI's own copy of the generator, which is a global install. `wildo update` moves it and\n * the application's engine together, so the signed engine build moves too; in framework development an\n * engine change respawns the companion, which empties this cache. Erring toward a re-derivation is always\n * safe here, a missed input is not, so widen this list before narrowing it.\n */\nexport function signDesignTokenBlockInputs(saasRoot: string): string | null {\n const frontendRoot = path.join(saasRoot, resolveDesignSystemFrontendDirectory());\n return signDerivedInputs([\n path.join(frontendRoot, 'src'),\n path.join(frontendRoot, 'node_modules', '@wildo-ai', 'presets-components-models', 'dist'),\n ]);\n}\n\n/**\n * Is the frontend's generated design-token block current against its design-system config?\n *\n * Asked of `wildo design-tokens validate`, the same CLI door the step's execution writes through, and\n * deliberately not re-derived in this process. The companion's own generator is a different copy from the\n * global CLI's; if the two ever disagreed, the step would write one block and land on another, and a\n * generation step is exempt from the loop guard, so it would be re-offered forever. One door on both sides\n * cannot disagree with itself.\n *\n * Cached by input signature, never by TTL, for the reason {@link resolveSchemaPlanSyncState} is: the\n * question costs a subprocess (~14 s on Wonder Todos) and is asked on every landing resolution, while its\n * inputs are files that rarely move between two reads.\n */\nexport async function resolveDesignTokenBlockState(saasRoot: string): Promise<DesignTokenBlockState> {\n const signature = signDesignTokenBlockInputs(saasRoot);\n if (signature !== null) {\n const cached = designTokenBlockStateCache.get(saasRoot);\n if (cached?.signature === signature) return cached.state;\n const inFlight = designTokenBlockStateInFlight.get(saasRoot);\n if (inFlight?.signature === signature) return inFlight.compute;\n }\n\n const compute = computeDesignTokenBlockState(saasRoot);\n designTokenBlockStateInFlight.set(saasRoot, { signature, compute });\n try {\n const state = await compute;\n if (signature !== null) designTokenBlockStateCache.set(saasRoot, { signature, state });\n return state;\n } finally {\n // A failed derivation caches nothing, so the next caller retries rather than inheriting it.\n if (designTokenBlockStateInFlight.get(saasRoot)?.compute === compute) {\n designTokenBlockStateInFlight.delete(saasRoot);\n }\n }\n}\n\nasync function computeDesignTokenBlockState(saasRoot: string): Promise<DesignTokenBlockState> {\n try {\n const result = await executeBoundedSubprocess({\n command: 'wildo',\n args: ['design-tokens', 'validate', resolveDesignSystemFrontendDirectory()],\n cwd: saasRoot,\n env: buildCliSubprocessEnv(),\n timeoutMs: DESIGN_TOKENS_CLI_TIMEOUT_MS,\n });\n return classifyDesignTokenValidateOutput(`${result.stdout}\\n${result.stderr}`);\n } catch (error) {\n // A stale block is named in the CLI's own output; an absent CLI, a timeout or a config that does not\n // load is not, and must not put the step at the head of the queue.\n return classifyDesignTokenValidateOutput(subprocessFailureOutput(error));\n }\n}\n\n/**\n * Whether a generation step's output rests on the specifications package (#3258). Every step but the migration step, which\n * plans from the compiled registry: a failing specifications module says nothing about what that needs, and `wildo db`\n * refuses a stale build on its own account.\n */\nexport function generationStepReadsSpecifications(generationStepRef: string): boolean {\n return generationStepRef !== ApplicationBuildGenerationStep.DATABASE_MIGRATIONS;\n}\n\n/**\n * Which landing checks read the specifications package, so cannot answer while a module fails (#3258). The others answer\n * from git or a file: \"not committed\" or \"no accepted logo\" is a true \"no\" whatever the package does. Total over the\n * kinds, so a new check has to say which it is. `NOT_OWED` is itself derived from the package, for the display-name and\n * capabilities steps among others; it is `false` here only because the landing pass has already landed such a step, so the\n * hold never asks about it. A short read can therefore land a step as owing nothing, with no mark. No write follows from it.\n */\nconst LANDING_CHECK_READS_SPECIFICATIONS: Readonly<Record<ApplicationBuildGenerationStepLandedKind, boolean>> = {\n [ApplicationBuildGenerationStepLandedKind.COMMITTED_PATHS]: false,\n [ApplicationBuildGenerationStepLandedKind.SCHEMA_PLAN_IN_SYNC]: false,\n [ApplicationBuildGenerationStepLandedKind.NOT_OWED]: false,\n [ApplicationBuildGenerationStepLandedKind.DESIGN_TOKEN_BLOCK_CURRENT]: false,\n [ApplicationBuildGenerationStepLandedKind.ACCEPTED_BRAND_MARK]: false,\n [ApplicationBuildGenerationStepLandedKind.BRAND_DESIGN_CURRENT]: true,\n [ApplicationBuildGenerationStepLandedKind.ENGINE_CAPABILITIES_ENABLED]: true,\n [ApplicationBuildGenerationStepLandedKind.LABEL_PLAN_INCOMPLETE]: true,\n [ApplicationBuildGenerationStepLandedKind.LANDED_PROBES]: true,\n [ApplicationBuildGenerationStepLandedKind.DISPLAY_NAME_APPLIED]: true,\n [ApplicationBuildGenerationStepLandedKind.INPUT_UNREADABLE]: true,\n};\n\n/** See {@link LANDING_CHECK_READS_SPECIFICATIONS}. */\nexport function generationStepCheckReadsSpecifications(kind: ApplicationBuildGenerationStepLandedKind): boolean {\n return LANDING_CHECK_READS_SPECIFICATIONS[kind];\n}\n\n/** The brand's visual tone out of an evaluation's exports. See `readBrandVisualTone`. */\nfunction projectBrandVisualTone(specifications: unknown): BrandDesignInputs {\n const exports = specifications as {\n brandSpecification?: { visualTone?: { colorSeeds?: unknown; styleKeywords?: unknown; mood?: unknown } };\n } | undefined;\n const visualTone = exports?.brandSpecification?.visualTone;\n const colorSeeds = visualTone?.colorSeeds ?? [];\n const styleKeywords = visualTone?.styleKeywords ?? [];\n const mood = visualTone?.mood;\n const isStringList = (value: unknown): value is readonly string[] => Array.isArray(value) && value.every((entry) => typeof entry === 'string');\n if (!isStringList(colorSeeds) || !isStringList(styleKeywords) || (mood !== undefined && typeof mood !== 'string')) {\n throw new Error('the brand\\'s visual tone does not carry lists of colour seeds and style keywords');\n }\n return { colorSeeds: [...colorSeeds], styleKeywords: [...styleKeywords], ...(typeof mood === 'string' ? { mood } : {}) };\n}\n\n@injectable()\nexport class ApplicationBuildGenerationStepCompanionService {\n private readonly logDebug: (message: string, context?: Record<string, unknown>) => void;\n /** The running step of each task, by task ref — runtime state only, see {@link GenerationStepProgress}. */\n private readonly progressByTaskRef = new Map<string, GenerationStepProgressTracker>();\n\n public constructor(\n @inject(SAAS_SERVICE_TYPES.Logger) private readonly logger: LoggerService,\n @inject(SAAS_SERVICE_TYPES.AppConfigService) private readonly appConfigService: AppConfigurationService,\n @inject(COMPANION_SERVICE_TYPES.CompanionContext) private readonly companionContext: CompanionContext,\n @inject(COMPANION_SERVICE_TYPES.LabellingPlannerService) private readonly planner: LabellingPlannerCompanionService,\n @inject(COMPANION_SERVICE_TYPES.LabellizeOrchestratorService) private readonly labellize: LabellizeOrchestratorCompanionService,\n @inject(COMPANION_SERVICE_TYPES.TranslateOrchestratorService) private readonly translate: TranslateOrchestratorCompanionService,\n @inject(COMPANION_SERVICE_TYPES.EmailTemplateService) private readonly emailTemplates: EmailTemplateCompanionService,\n @inject(COMPANION_SERVICE_TYPES.LogoDeliberationService) private readonly logoDeliberation: LogoDeliberationCompanionService,\n @inject(COMPANION_SERVICE_TYPES.BrandAcceptService) private readonly brandAccept: BrandAcceptCompanionService,\n @inject(COMPANION_SERVICE_TYPES.TechnicalDocService) private readonly technicalDoc: TechnicalDocCompanionService,\n // The capability derivation the foundation step owns (#2497): one derivation for both lanes.\n @inject(COMPANION_SERVICE_TYPES.FoundationExecutorService) private readonly foundationExecutor: FoundationExecutorCompanionService,\n /*\n * What each step's model calls spent (#2232): a labels or translations pass is model calls, and nothing\n * recorded them when the step ran outside a playbook. Optional so a harness that builds this service\n * positionally need not hand one in; without it a step's spend is NOT OBSERVED, never zero.\n */\n @inject(COMPANION_SERVICE_TYPES.PlaybookSpendMeter) @optional() private readonly spendMeter?: PlaybookSpendMeterCompanionService,\n ) {\n this.logDebug = this.logger.debugByType('ApplicationBuildGenerationStep');\n }\n\n /** What each executed step spent, by the task object it ran — read by the step's row writer (`spentByGenerationStep`). */\n private readonly stepSpendByTask = new WeakMap<BuildPlanTask, PlaybookSpend>();\n\n /**\n * What the generation step last executed for `task` spent (#2232), however it ended — for its row when the run\n * ends FAILED. Keyed by the TASK the dispatcher handed in, not by the thrown error: the step can succeed and\n * something after it still throw (the acceptance commit, a lost file lock), and the step's spend is real either\n * way. `undefined` when no step ran for that task object.\n */\n public spentByGenerationStep(task: BuildPlanTask): PlaybookSpend | undefined {\n return this.stepSpendByTask.get(task);\n }\n\n /**\n * The app-root-relative files this task's generation step is responsible\n * for. The landed check treats the task as landed when EVERY one of them is\n * committed — same doctrine as every coding task, same reader\n * (`isWorktreePathCommitted`).\n */\n public async resolveGenerationStepEvidencePaths(task: BuildPlanTask): Promise<readonly string[]> {\n const generationStepRef = this.requireGenerationStepRef(task);\n switch (generationStepRef) {\n case ApplicationBuildGenerationStep.I18N_LABELS:\n return this.resolveLabelUnitPaths([getCompanionConfiguredPrimaryLanguage(this.appConfigService.config)]);\n case ApplicationBuildGenerationStep.I18N_TRANSLATIONS:\n // Every unit in every TARGET locale. Empty on a one-locale application, which is why the host\n // derives this step only when there is a target (an empty list never lands).\n return this.resolveLabelUnitPaths(this.resolveTranslationTargetLocales());\n case ApplicationBuildGenerationStep.EMAIL_TEMPLATES:\n // Placement is the email domain's authority; this lane only crosses it with the enabled locales.\n return this.emailTemplates.resolveExpectedArtifactRelativePaths(this.resolveEnabledLocales());\n case ApplicationBuildGenerationStep.LOGO:\n /*\n * The SSOT MODULE, the file the step rewrites — its write scope and the place a landing is reported\n * \"found in\". NOT its landing proof: `wildo init` scaffolds this module with an empty asset list, so it\n * exists and is committed before the step runs (#2410). Landing is the `ACCEPTED_BRAND_MARK` condition,\n * which reads the module's content (see `resolveGenerationStepLandedCondition`).\n */\n return [BRAND_RESOLVED_ASSETS_MODULE_PATH];\n case ApplicationBuildGenerationStep.DOCUMENTATION_PUBLICATION:\n /*\n * The publication's render-output manifest, which only the publish writes (`synchronizeGeneratedTree`).\n *\n * Honest evidence by the same test {@link LOGO} passes and `DATABASE_MIGRATIONS` fails: this file exists ONLY\n * as a consequence of this step's work, and the portal already reads it as the sign that a publication exists\n * (`scripts/wait-for-publication.mjs`, `src/generated-consumer-documentation.ts`).\n *\n * It was the search index (`indexes/search.json`) until reference run 42186980114 (#3204). The search page\n * imports that index, and the companion refuses a commit that leaves an import nothing holds (#2332), so the\n * foundation could never commit the portal it composed and the build stopped. The `add-technical-doc` scenario\n * now ships both indexes EMPTY, which makes the index exist BEFORE this step: kept as the evidence, the step\n * would have counted as landed on the foundation's commit and never run.\n *\n * Deliberately not the `docusaurus/` output tree: the rendered page set is named after whichever chapters the\n * plan carries, so it cannot be derived BEFORE the step runs, and evidence that cannot be derived in advance is\n * not evidence. Its directory is also this step's writable root (`EVIDENCE_DIRECTORIES`), which now covers the\n * whole consumer-documentation tree the publish writes.\n */\n return [path.posix.join('technical-doc', 'src', 'generated', 'consumer-documentation', 'render-output-manifest.json')];\n case ApplicationBuildGenerationStep.DATABASE_MIGRATIONS:\n /*\n * ⚠ MUTATION SCOPE ONLY — this path is NOT this step's landed evidence, and using it as\n * such would be the defect the landed-kind vocabulary above exists to prevent: the lockfile\n * already exists before the step runs, so a landed check over it passes having verified\n * nothing.\n *\n * It is named here because `resolveGenerationStepWritableRoots` derives the task's writable roots\n * from these paths' DIRECTORIES (the step is `EVIDENCE_DIRECTORIES` in {@link GENERATION_STEP_WRITE_SCOPE}),\n * and `backend-api/migrations/` is exactly right: the step writes the\n * new migration folder and rewrites the lockfile, and nothing else.\n *\n * `resolveGenerationStepLandedCondition` is the only landed authority, and for this step it\n * answers SCHEMA_PLAN_IN_SYNC.\n */\n return [SCHEMA_PLAN_LOCKFILE_RELATIVE_PATH];\n case ApplicationBuildGenerationStep.DESIGN_TOKENS:\n /*\n * The stylesheet the step rewrites: its whole mutation scope, and the file its landing requires\n * committed. NOT sufficient landed evidence on its own — it is committed in every scaffolded\n * application before the step runs — which is why `resolveGenerationStepLandedCondition` answers\n * DESIGN_TOKEN_BLOCK_CURRENT for this step rather than COMMITTED_PATHS.\n */\n return [resolveDesignTokenStylesheetPath()];\n case ApplicationBuildGenerationStep.DESIGN_SYSTEM_BRAND:\n /*\n * The generated modules (the frontend's, and the website's when one is declared): the step's whole mutation\n * scope, and the files its landing requires committed. Not sufficient landed evidence on their own once a\n * first build has committed them, which is why the landed condition is BRAND_DESIGN_CURRENT rather than\n * COMMITTED_PATHS.\n */\n return this.resolveBrandDesignModulePaths();\n case ApplicationBuildGenerationStep.ENGINE_CAPABILITIES:\n // The mutation scope; landing is ENGINE_CAPABILITIES_ENABLED, which reads what the file says.\n return [SAAS_CONFIG_FILE_NAME];\n case ApplicationBuildGenerationStep.DISPLAY_NAME:\n // The mutation scope: the config and every file a template rendered the name into. Landing reads the config.\n return [SAAS_CONFIG_FILE_NAME, ...listDisplayNameBearingPaths({ applicationRoot: this.companionContext.saasRoot, frameworkRoot: this.frameworkRoot() })];\n default:\n throw new ApplicationBuildUnknownGenerationStepError(task.taskRef, generationStepRef);\n }\n }\n\n /**\n * The paths this task's generation step may write, as the dispatch plan's `allowedPathPrefixes` — and\n * therefore what a shared-window claim (#2240) reads when the step SHARED the tree with concurrent coding runs:\n * a directory root is claimed, an exact file never is (the wave-end reconciliation commits it, see\n * `claimGenerationStepOwnedPaths`). The ONE place they are computed: the dispatch host calls this and derives\n * nothing itself.\n *\n * Read off {@link GENERATION_STEP_WRITE_SCOPE}:\n * - `EVIDENCE_DIRECTORIES`: the directory of each evidence path, for a step whose output is a tree it alone\n * writes (label units, the brand module, the published documentation index, the migrations directory).\n * A file at the application root is its own root, because its directory is the whole tree (#2497).\n * - `EVIDENCE_FILES`: each evidence file itself, for a step whose output sits where other tasks also write\n * (the stylesheet and the brand design module in `frontend/src/`, the website's colours in `website/src/`,\n * the configuration file, the files carrying\n * the display name). Scoping it to the directory would let it commit a concurrent coding run's half-written\n * files under this step's name; a full file path allows exactly that file, the coding policy's own convention.\n *\n * A step ref the vocabulary does not know gets the narrower answer, its files. Defence in depth only:\n * `resolveGenerationStepEvidencePaths` already throws `ApplicationBuildUnknownGenerationStepError` for one.\n */\n public async resolveGenerationStepWritableRoots(task: BuildPlanTask): Promise<readonly string[]> {\n const evidencePaths = await this.resolveGenerationStepEvidencePaths(task);\n const scope = (GENERATION_STEP_WRITE_SCOPE as Readonly<Partial<Record<string, GenerationStepWriteScope>>>)[this.requireGenerationStepRef(task)]\n ?? GenerationStepWriteScope.EVIDENCE_FILES;\n return [...new Set(evidencePaths.map((evidencePath) => {\n const directory = evidencePath.split('/').slice(0, -1).join('/');\n return scope === GenerationStepWriteScope.EVIDENCE_FILES || directory === '' ? evidencePath : `${directory}/`;\n }))].sort();\n }\n\n /**\n * How this task proves it landed — the ONLY landed authority for a generation step.\n *\n * Split from {@link resolveGenerationStepEvidencePaths} because that method answers a different\n * question (which paths may this task write?) and the two answers diverge for exactly one step.\n * Reading landing off the evidence paths would land the migration step on a file that predates it.\n */\n public async resolveGenerationStepLandedCondition(\n task: BuildPlanTask,\n ): Promise<ApplicationBuildGenerationStepLandedCondition> {\n const generationStepRef = this.requireGenerationStepRef(task);\n if (generationStepRef === ApplicationBuildGenerationStep.DATABASE_MIGRATIONS) {\n return { kind: ApplicationBuildGenerationStepLandedKind.SCHEMA_PLAN_IN_SYNC };\n }\n if (generationStepRef === ApplicationBuildGenerationStep.DESIGN_TOKENS) {\n return { kind: ApplicationBuildGenerationStepLandedKind.DESIGN_TOKEN_BLOCK_CURRENT, stylesheetPath: resolveDesignTokenStylesheetPath() };\n }\n if (generationStepRef === ApplicationBuildGenerationStep.DESIGN_SYSTEM_BRAND) {\n return { kind: ApplicationBuildGenerationStepLandedKind.BRAND_DESIGN_CURRENT, modulePaths: this.resolveBrandDesignModulePaths() };\n }\n if (generationStepRef === ApplicationBuildGenerationStep.I18N_TRANSLATIONS && this.resolveTranslationTargetLocales().length === 0) {\n return { kind: ApplicationBuildGenerationStepLandedKind.NOT_OWED };\n }\n if (generationStepRef === ApplicationBuildGenerationStep.LOGO) {\n return { kind: ApplicationBuildGenerationStepLandedKind.ACCEPTED_BRAND_MARK, modulePath: BRAND_RESOLVED_ASSETS_MODULE_PATH };\n }\n if (generationStepRef === ApplicationBuildGenerationStep.I18N_LABELS) {\n // ONE plan per call: the blocking check and the probes are read off the same plan.\n const plan = await this.planner.planAllUnitsWithCompleteness();\n const blocking = plan.incompleteness\n .filter((entry) => entry.reason !== LabellingPlanIncompletenessReason.RESOURCE_REGISTRY_STALE && LABEL_PLAN_BLOCKING_INCOMPLETENESS.has(entry.reason));\n // A stale registry names the units it hides, and the probes below count them; an unreadable plan cannot.\n if (blocking.length > 0) {\n return { kind: ApplicationBuildGenerationStepLandedKind.LABEL_PLAN_INCOMPLETE, detail: blocking.map((entry) => entry.detail).join(' ') };\n }\n /*\n * A unit planned from a family that could not answer is REFUSED by the labelling run (`incompletePlanRefusal`), so\n * its keys cannot arrive however often the step runs, and its probe would stay unmet with no stated cause (#2504\n * review L1). The run is still allowed (it writes every other unit); landing names why it waits, like the reasons\n * that refuse the run outright.\n */\n const refusedReasons = new Set(plan.units.flatMap((unit) => unit.plannedFromIncompleteInputs ?? []));\n if (refusedReasons.size > 0) {\n const refusedUnitCount = plan.units.filter((unit) => (unit.plannedFromIncompleteInputs?.length ?? 0) > 0).length;\n const causes = plan.incompleteness.filter((entry) => refusedReasons.has(entry.reason)).map((entry) => entry.detail);\n return {\n kind: ApplicationBuildGenerationStepLandedKind.LABEL_PLAN_INCOMPLETE,\n detail: `${refusedUnitCount} labelling unit(s) are refused until their inputs answer: ${causes.length > 0 ? causes.join(' ') : [...refusedReasons].join(', ')}`,\n };\n }\n return { kind: ApplicationBuildGenerationStepLandedKind.LANDED_PROBES, probes: this.labelPlanProbes(plan, getCompanionConfiguredPrimaryLanguage(this.appConfigService.config)) };\n }\n if (generationStepRef === ApplicationBuildGenerationStep.DISPLAY_NAME) {\n let brandName: string | undefined;\n try {\n brandName = await this.readLandedBrandName();\n } catch (error) {\n // Unknown is not \"no brand\" (#2694): owing nothing would land the step without running it.\n return {\n kind: ApplicationBuildGenerationStepLandedKind.INPUT_UNREADABLE,\n detail: `The brand could not be read, so whether the application owes its name is unknown: ${describeCaughtError(error)}`,\n };\n }\n if (brandName === undefined) return { kind: ApplicationBuildGenerationStepLandedKind.NOT_OWED };\n return { kind: ApplicationBuildGenerationStepLandedKind.DISPLAY_NAME_APPLIED, configPath: SAAS_CONFIG_FILE_NAME, displayName: brandName };\n }\n if (generationStepRef === ApplicationBuildGenerationStep.ENGINE_CAPABILITIES) {\n let satisfiable: Awaited<ReturnType<FoundationExecutorCompanionService['deriveSatisfiableEngineCapabilityPlan']>>;\n try {\n satisfiable = await this.foundationExecutor.deriveSatisfiableEngineCapabilityPlan();\n } catch (error) {\n // Unknown is not \"nothing derivable\" (#3258): an unreadable plan owing nothing would land the step without running it.\n return {\n kind: ApplicationBuildGenerationStepLandedKind.INPUT_UNREADABLE,\n detail: `What decides the engine capabilities could not be read, so whether any is owed is unknown: ${describeCaughtError(error)}`,\n };\n }\n // Nothing derivable is nothing owed; an empty list would otherwise land trivially, which is the same answer said honestly.\n if (satisfiable === undefined || satisfiable.capabilities.length === 0) return { kind: ApplicationBuildGenerationStepLandedKind.NOT_OWED };\n return { kind: ApplicationBuildGenerationStepLandedKind.ENGINE_CAPABILITIES_ENABLED, configPath: SAAS_CONFIG_FILE_NAME, capabilities: satisfiable.capabilities };\n }\n return {\n kind: ApplicationBuildGenerationStepLandedKind.COMMITTED_PATHS,\n paths: await this.resolveGenerationStepEvidencePaths(task),\n };\n }\n\n /**\n * Does this application owe migrations, and has it accepted a schema plan yet?\n *\n * The population the `database-migrations` step belongs to, and the fact the dispatch host derives\n * that step from when a build plan omits it (#1027). It reads BOTH the lockfile and the authored\n * `applicationDatabase.engine` (#1144). The lockfile alone was the marker until then, on the premise\n * that the foundation playbook writes a PostgreSQL application's baseline — it never did, so a\n * journey-built PostgreSQL application had no lockfile, was offered no migration step, and booted\n * into tables nothing had created. See {@link ApplicationSchemaPlanObligation}.\n */\n public async assessSchemaPlanObligation(): Promise<ApplicationSchemaPlanObligationAssessment> {\n return assessApplicationSchemaPlanObligation(this.companionContext.saasRoot);\n }\n\n /**\n * Does the resource model agree with the accepted schema plan — and if not, is that DRIFT, or could the\n * question not be asked? See {@link SchemaPlanSyncState} for why those two must never be merged.\n *\n * Only IN_SYNC lands the migration step, so an unknown answer can never land a task that generated\n * nothing. Re-running over a clean plan is harmless (`wildo db generate` reports nothing to generate);\n * running it where the check is unanswerable only throws, which is why the caller passes over it.\n */\n public async readSchemaPlanSyncState(): Promise<SchemaPlanSyncState> {\n return resolveSchemaPlanSyncState(this.companionContext.saasRoot);\n }\n\n /**\n * Is the frontend's generated design-token block current against its design-system config — and if\n * not, is it STALE, or could the question not be asked? See {@link DesignTokenBlockState}.\n */\n public async readDesignTokenBlockState(): Promise<DesignTokenBlockState> {\n return resolveDesignTokenBlockState(this.companionContext.saasRoot);\n }\n\n /**\n * Does every module the step writes (the frontend's brand design, and the website's colours when a website is\n * declared) say what the brand's visual tone now renders? See {@link BrandDesignState}.\n *\n * Not cached here: the visual tone comes from the specifications evaluation, which is cached against the signature of\n * the package it evaluates, so an unchanged brand costs a cache read and a changed one re-derives.\n */\n public async readBrandDesignState(): Promise<BrandDesignState> {\n let inputs: BrandDesignInputs;\n try {\n inputs = await this.readBrandVisualTone();\n } catch (error) {\n this.logDebug('The brand design state could not be decided: the brand visual tone could not be read', { error: describeCaughtError(error) });\n return BrandDesignState.UNANSWERABLE;\n }\n let expected: Array<{ readonly modulePath: string; readonly source: string }>;\n try {\n expected = this.renderBrandDesignModules(inputs).map(({ modulePath, source }) => ({ modulePath, source }));\n } catch (error) {\n this.logDebug('The brand design state could not be decided: the brand colour seeds do not derive', { error: describeCaughtError(error) });\n return BrandDesignState.UNANSWERABLE;\n }\n // CURRENT only when EVERY module the step writes says what the brand renders: the website's included (#2597).\n for (const { modulePath, source } of expected) {\n const written = await readFile(path.join(this.companionContext.saasRoot, modulePath), 'utf8').catch(() => undefined);\n if (written !== source) return BrandDesignState.STALE;\n }\n return BrandDesignState.CURRENT;\n }\n\n /**\n * The website's generated theme module, app-root relative, when the application declares a website: written by\n * the same step from the same visual tone (#2597, #2742). Found from the declared services, as brand propagation\n * finds it.\n */\n private resolveBrandWebsiteThemePath(): string | undefined {\n const website = resolveBrandSurfaceDirs(this.companionContext.saasRoot, this.companionContext.servicesByKey).website;\n if (website === undefined) return undefined;\n const websiteDirectory = path.relative(this.companionContext.saasRoot, website).split(path.sep).join('/');\n return path.posix.join(websiteDirectory, BRAND_WEBSITE_THEME_WEBSITE_RELATIVE_PATH);\n }\n\n /** Every module the brand step writes: the frontend's brand design, then the website's theme when one is declared. */\n private resolveBrandDesignModulePaths(): readonly string[] {\n const website = this.resolveBrandWebsiteThemePath();\n return website === undefined ? [resolveBrandDesignPath()] : [resolveBrandDesignPath(), website];\n }\n\n /**\n * What the brand step writes for a visual tone: each module's path and text, the frontend's first. One function, so\n * the step and its CURRENT check cannot disagree about which files exist or what they say.\n */\n private renderBrandDesignModules(inputs: BrandDesignInputs): Array<{ readonly modulePath: string; readonly source: string; readonly websiteTheme?: ApplicationBuildDesignSystemBrandStepRunResult['websiteTheme'] }> {\n const frontend = renderBrandDesignModule(inputs);\n const modules: Array<{ readonly modulePath: string; readonly source: string; readonly websiteTheme?: ApplicationBuildDesignSystemBrandStepRunResult['websiteTheme'] }> = [\n { modulePath: resolveBrandDesignPath(), source: frontend.source },\n ];\n const websitePath = this.resolveBrandWebsiteThemePath();\n if (websitePath !== undefined) {\n const website = renderBrandWebsiteThemeModule(inputs);\n modules.push({ modulePath: websitePath, source: website.source, websiteTheme: { palette: website.palette, personality: website.personality } });\n }\n return modules;\n }\n\n\n /**\n * Run the task's generation step. Incremental by construction: both\n * pipelines consult the freshness lock and skip fresh units, so re-running\n * an already-satisfied step costs a plan read, not a model call.\n *\n * While it runs, its progress is readable through {@link readGenerationStepProgress} (#2215); it is\n * dropped when the step settles, however it ends.\n */\n public async executeGenerationStep(\n task: BuildPlanTask,\n session?: CompanionExecutionSessionContext,\n ): Promise<MeasuredGenerationStepRunResult> {\n const tracker = new GenerationStepProgressTracker(this.requireGenerationStepRef(task));\n this.progressByTaskRef.set(task.taskRef, tracker);\n try {\n /*\n * Measured AS a generation step (#2232): its spend goes on its own row, and every enclosing measurement (a\n * build-dispatch playbook run) tallies it in `generationSteps`, so a total over both counts it once.\n */\n const measured = this.spendMeter\n ? await this.spendMeter.measure(() => this.runGenerationStep(task, tracker.reporter, session), { as: PlaybookSpendMeasuredUnit.GENERATION_STEP })\n : await NO_PLAYBOOK_SPEND_METER.measure(() => this.runGenerationStep(task, tracker.reporter, session));\n this.stepSpendByTask.set(task, measured.spend);\n if (measured.settled.status === 'rejected') throw measured.settled.reason;\n return { ...measured.settled.value, spend: measured.spend };\n } finally {\n // Only our own tracker: a second run of the same task that started meanwhile keeps its own.\n if (this.progressByTaskRef.get(task.taskRef) === tracker) this.progressByTaskRef.delete(task.taskRef);\n }\n }\n\n /**\n * How far the task's generation step has got, while it runs (#2215). `undefined` when no step of that\n * task is running in this companion — the step settled, never ran, or ran before a restart.\n */\n public readGenerationStepProgress(taskRef: string): GenerationStepProgress | undefined {\n return this.progressByTaskRef.get(taskRef)?.snapshot();\n }\n\n private async runGenerationStep(\n task: BuildPlanTask,\n progress: LabellingProgressReporter,\n session?: CompanionExecutionSessionContext,\n ): Promise<ApplicationBuildGenerationStepRunResult> {\n const generationStepRef = this.requireGenerationStepRef(task);\n // A read that did not throw may be short (#3258).\n if (generationStepReadsSpecifications(generationStepRef)) await assertSpecificationsReadWhole(this.companionContext, `The output of build step \"${task.taskRef}\"`);\n switch (generationStepRef) {\n case ApplicationBuildGenerationStep.I18N_LABELS: {\n await this.refuseIncompleteLabelPlan(task);\n this.logDebug('Running the i18n-labels generation step', {\n taskRef: task.taskRef,\n primaryLocale: getCompanionConfiguredPrimaryLanguage(this.appConfigService.config),\n });\n const labellizeResult = await this.labellize.labellize({ progress }, session);\n return {\n generationStepRef,\n labellize: labellizeResult,\n evidencePaths: await this.resolveGenerationStepEvidencePaths(task),\n };\n }\n case ApplicationBuildGenerationStep.I18N_TRANSLATIONS: {\n // Translating from a plan that hides owed units drops their target-locale keys for good (#2504 review).\n await this.refuseIncompleteLabelPlan(task);\n const targetLocales = this.resolveTranslationTargetLocales();\n this.logDebug('Running the i18n-translations generation step', { taskRef: task.taskRef, targetLocales });\n const translateResult = targetLocales.length > 0\n ? await this.translate.translate({ targetLocales: [...targetLocales], progress }, session)\n : undefined;\n return {\n generationStepRef,\n targetLocales,\n ...(translateResult ? { translate: translateResult } : {}),\n evidencePaths: await this.resolveGenerationStepEvidencePaths(task),\n };\n }\n case ApplicationBuildGenerationStep.EMAIL_TEMPLATES: {\n const primaryLocale = getCompanionConfiguredPrimaryLanguage(this.appConfigService.config);\n const targetLocales = this.resolveEnabledLocales().filter((locale) => locale !== primaryLocale);\n this.logDebug('Running the email-templates generation step', {\n taskRef: task.taskRef,\n primaryLocale,\n targetLocales,\n });\n const emailGenerate = await this.emailTemplates.generateTemplates({}, session);\n const emailTranslate = targetLocales.length > 0\n ? await this.emailTemplates.translateEmailTemplateLabels({ targetLocales: [...targetLocales] }, session, { progress })\n : undefined;\n return {\n generationStepRef,\n emailGenerate,\n ...(emailTranslate ? { emailTranslate } : {}),\n evidencePaths: await this.resolveGenerationStepEvidencePaths(task),\n };\n }\n case ApplicationBuildGenerationStep.LOGO: {\n const evidencePaths = await this.resolveGenerationStepEvidencePaths(task);\n /*\n * Incremental, but by PRESENCE rather than by the freshness lock the text pipelines use.\n *\n * Those pipelines skip per UNIT, because a label is cheap and units come and go. A logo\n * deliberation is a panel of three experts, N generated images and a vision judge — the\n * most expensive step in this enum by a wide margin — and an application has exactly one\n * accepted mark. So the honest unit of freshness is \"is there an accepted mark\", and the\n * answer is the same predicate the landed check uses (`hasAcceptedBrandMark`), asked of the\n * working tree. Re-running a satisfied step costs a file read, not a model call.\n *\n * Replacing an existing mark stays a deliberate act through the brand routes; a build must\n * never quietly redraw an application's identity because it ran again.\n */\n if (await this.hasAcceptedBrandMark()) {\n this.logDebug('Skipping the logo generation step — an accepted mark already exists', {\n taskRef: task.taskRef,\n });\n return { generationStepRef, skippedBecauseAlreadyAccepted: true, evidencePaths, ...(await propagateAcceptedBrand(this.companionContext.saasRoot, this.logger)) };\n }\n\n this.logDebug('Running the logo generation step', { taskRef: task.taskRef });\n const deliberation = await this.logoDeliberation.run({});\n /*\n * `run` stages its winner as the standard single-candidate manifest `accept` expects, which\n * is why the two compose with no adapter: the staged manifest IS the hand-off. An identity\n * pin re-asserting that the manifest still held the winner went with the digest fences — a\n * single-candidate staging area written one await earlier has nothing else it could hold.\n */\n const accept = await this.brandAccept.accept({});\n return {\n generationStepRef,\n deliberation,\n accept,\n skippedBecauseAlreadyAccepted: false,\n evidencePaths,\n // The accept propagated the mark it promoted; carried here so the step's record says so.\n ...(accept.propagation !== undefined ? { propagation: accept.propagation } : {}),\n ...(accept.propagationError !== undefined ? { propagationError: accept.propagationError } : {}),\n };\n }\n case ApplicationBuildGenerationStep.DOCUMENTATION_PUBLICATION: {\n const evidencePaths = await this.resolveGenerationStepEvidencePaths(task);\n /*\n * The backend service key the publish derives its OpenAPI documents from, picked the way\n * every other companion caller picks it: the one declared service that is not a frontend.\n * `runForeignKeyResolutionVerification` resolves it identically, and the controller's own\n * `pickResourcesRegistryCarrierServiceKey` answers the same question for the HTTP door.\n */\n const backendServiceKey = Object.entries(this.companionContext.servicesByKey)\n .find(([, service]) => !service.frontendType)?.[0];\n if (backendServiceKey === undefined) {\n throw new Error('Cannot publish documentation: this application declares no backend service to derive its API documents from.');\n }\n this.logDebug('Running the documentation publication step', { taskRef: task.taskRef, backendServiceKey });\n /*\n * NOT skipped when the tree already exists, unlike the logo step beside it.\n *\n * A logo is accepted once and must never be silently redrawn. A documentation portal is a\n * PROJECTION of the application's current configuration, resources and authored chapters —\n * every one of which the build is still changing — so a published tree is stale the moment a\n * later task lands, and re-publishing is how it stays true. The publish is idempotent by\n * construction (it re-derives and rewrites), and `wildo docs publish` exists precisely\n * because the committed tree drifted silently whenever nobody re-ran it.\n */\n const published = await this.technicalDoc.publishManagedDocumentation({ backendServiceKey });\n return { generationStepRef, published, evidencePaths };\n }\n case ApplicationBuildGenerationStep.DISPLAY_NAME: {\n let brandName: string | undefined;\n try {\n brandName = await this.readLandedBrandName();\n } catch (error) {\n throw new Error(`Build task ${task.taskRef} applies the brand's name, and the brand could not be read: ${describeCaughtError(error)}`);\n }\n if (brandName === undefined) {\n throw new Error(`Build task ${task.taskRef} applies the brand's name, and no brand with a name has landed.`);\n }\n this.logDebug('Running the display-name generation step', { taskRef: task.taskRef, brandName });\n const applied = applyApplicationDisplayName({ applicationRoot: this.companionContext.saasRoot, frameworkRoot: this.frameworkRoot(), displayName: brandName });\n return { generationStepRef, ...applied, evidencePaths: await this.resolveGenerationStepEvidencePaths(task) };\n }\n case ApplicationBuildGenerationStep.ENGINE_CAPABILITIES: {\n this.logDebug('Running the engine-capabilities generation step', { taskRef: task.taskRef });\n const aligned = await this.foundationExecutor.alignEngineCapabilitiesWithDecisions();\n return { generationStepRef, ...aligned, evidencePaths: await this.resolveGenerationStepEvidencePaths(task) };\n }\n case ApplicationBuildGenerationStep.DATABASE_MIGRATIONS: {\n const saasRoot = this.companionContext.saasRoot;\n const evidencePaths = await this.resolveGenerationStepEvidencePaths(task);\n\n /*\n * With no accepted plan, `wildo db generate` renders the WHOLE model as the INITIAL migration and\n * writes the baseline in the same invocation. That is exactly what a PostgreSQL application with no\n * baseline owes (#1144): its tables exist only once a migration creates them. It is exactly wrong\n * for a MongoDB-backed application, where it would author a table set nothing uses — so the\n * DECLARED store decides, and anything but a PostgreSQL declaration refuses.\n *\n * `wildo db diff --update-lockfile` was the baseline this refusal used to prescribe. It writes the\n * lockfile and NO migration, so it would accept a plan whose tables were never created.\n */\n const assessment = await this.assessSchemaPlanObligation();\n if (assessment.obligation === ApplicationSchemaPlanObligation.NOT_OWED) {\n throw new Error(\n `Build task ${task.taskRef} runs the database-migrations step, but this application has no accepted schema `\n + `plan (${SCHEMA_PLAN_LOCKFILE_RELATIVE_PATH} is absent) and does not declare PostgreSQL in ${assessment.declaredIn}. `\n + 'A MongoDB-backed application owes no migrations; remove this step from the build plan.',\n );\n }\n if (assessment.obligation === ApplicationSchemaPlanObligation.UNDETERMINED) {\n throw new Error(\n `Build task ${task.taskRef} runs the database-migrations step, but this application has no accepted schema `\n + `plan and its store could not be determined: ${assessment.reason}. Generating without knowing the store `\n + 'could author tables for a MongoDB-backed application.',\n );\n }\n /*\n * The plan is computed by IMPORTING the compiled backend registry, so an unbuilt tree cannot\n * produce one. Generating from a stale or absent model would author a migration for a model\n * nobody has — worse than not generating, because it then gets applied.\n */\n if (!existsSync(path.join(saasRoot, MODULES_REGISTRY_RELATIVE_PATH))) {\n throw new Error(\n `Build task ${task.taskRef} runs the database-migrations step, but ${MODULES_REGISTRY_RELATIVE_PATH} does not `\n + 'exist. The schema plan is computed by importing the compiled backend registry; build backend-api first.',\n );\n }\n\n const before = listMigrationFolders(saasRoot);\n this.logDebug('Running the database-migrations generation step', { taskRef: task.taskRef });\n /*\n * The migration LABEL comes from the task ref, so the folder is traceable back to the task\n * that produced it. Sanitised to the kebab-case shape `--name` accepts; the CLI still owns\n * the timestamp prefix, which is why the resulting path cannot be predicted here.\n */\n const label = task.taskRef.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, '').slice(0, 60)\n || 'build-plan-migration';\n const result = await executeBoundedSubprocess({\n command: 'wildo',\n args: ['db', 'generate', '--name', label],\n cwd: saasRoot,\n env: buildCliSubprocessEnv(),\n timeoutMs: MIGRATION_GENERATION_TIMEOUT_MS,\n });\n const after = listMigrationFolders(saasRoot);\n const generatedMigrationFolders = after.filter((folder) => !before.includes(folder));\n return {\n generationStepRef,\n // A clean plan is a legitimate outcome, not a failure: the resources this task follows may\n // have been migrated by an earlier one. The generator reports \"nothing to generate\".\n skippedBecauseAlreadyInSync: generatedMigrationFolders.length === 0,\n generatedMigrationFolders,\n outputTail: `${result.stdout}${result.stderr}`.slice(-2000),\n evidencePaths,\n };\n }\n case ApplicationBuildGenerationStep.DESIGN_TOKENS: {\n const saasRoot = this.companionContext.saasRoot;\n const evidencePaths = await this.resolveGenerationStepEvidencePaths(task);\n const frontendDirectory = resolveDesignSystemFrontendDirectory();\n const stylesheetPath = path.join(saasRoot, resolveDesignTokenStylesheetPath());\n /*\n * The frontend is NAMED rather than left to the CLI's default resolution: it is the frontend whose\n * config the DESIGN_SYSTEM task wrote, and naming it keeps an application with several `SAAS_APP`\n * frontends — where the CLI refuses to guess — from failing a step whose target is not in doubt.\n *\n * Not skipped when the block is already current, unlike the logo step: `generate` compares before\n * it writes and reports \"no changes\", so a re-run costs one subprocess and changes nothing.\n */\n const before = await readFile(stylesheetPath, 'utf8').catch(() => undefined);\n this.logDebug('Running the design-tokens generation step', { taskRef: task.taskRef, frontendDirectory });\n let result: Awaited<ReturnType<typeof executeBoundedSubprocess>>;\n try {\n result = await executeBoundedSubprocess({\n command: 'wildo',\n args: ['design-tokens', 'generate', frontendDirectory],\n cwd: saasRoot,\n env: buildCliSubprocessEnv(),\n timeoutMs: DESIGN_TOKENS_CLI_TIMEOUT_MS,\n });\n } catch (error) {\n // The subprocess error alone says \"Bounded subprocess failed\"; the CLI's own lines say why\n // (no config, no markers, a config that does not load), and they are what the row must carry.\n const output = subprocessFailureOutput(error).trim();\n throw new Error(\n `Build task ${task.taskRef} could not regenerate the design-token block of ${resolveDesignTokenStylesheetPath()}: `\n + `${describeCaughtError(error)}${output.length > 0 ? `\\n${output.slice(-2000)}` : ''}`,\n );\n }\n const after = await readFile(stylesheetPath, 'utf8').catch(() => undefined);\n return {\n generationStepRef,\n frontendDirectory,\n regenerated: before !== after,\n outputTail: `${result.stdout}${result.stderr}`.slice(-2000),\n evidencePaths,\n };\n }\n case ApplicationBuildGenerationStep.DESIGN_SYSTEM_BRAND: {\n const evidencePaths = await this.resolveGenerationStepEvidencePaths(task);\n let inputs: BrandDesignInputs;\n try {\n // The tone and what it stands on from ONE read (#3258, #3451): the brand family, read whole from its own file.\n const read = await readSpecificationFamiliesForRewrite(this.companionContext, (families) => projectBrandVisualTone(families));\n assertSpecificationWritePermitted(read.basis, { packageRelativePath: `The design system of build step \"${task.taskRef}\"`, fileExists: true, dryRun: false });\n inputs = read.value ?? projectBrandVisualTone(undefined);\n } catch (error) {\n if (error instanceof SpecificationWriteRefusedError) throw error;\n throw new Error(\n `Build task ${task.taskRef} could not read the brand's visual tone to derive the design system: ${describeCaughtError(error)}. `\n + 'Writing the neutral palette and the default theme instead would hide whatever the brand states.',\n );\n }\n // Throws on a seed the derivation cannot read; the brand schema admits hex only, so that is a brand file\n // that bypassed its schema, and the message names the seed.\n const rendered = renderBrandDesignModule(inputs);\n this.logDebug('Running the design-system-brand generation step', {\n taskRef: task.taskRef,\n fromBrand: rendered.fromBrand,\n adjustments: rendered.adjustments.length,\n personalityFromBrand: rendered.personalityFromBrand,\n });\n // The frontend's module, and the website's colours from the same seeds when a website is declared (#2597).\n const modules = this.renderBrandDesignModules(inputs);\n let rewritten = false;\n for (const module of modules) {\n const modulePath = path.join(this.companionContext.saasRoot, module.modulePath);\n const before = await readFile(modulePath, 'utf8').catch(() => undefined);\n if (before === module.source) continue;\n await mkdir(path.dirname(modulePath), { recursive: true });\n await writeSpecificationFileAtomically(modulePath, module.source);\n rewritten = true;\n }\n const websiteTheme = modules.find((module) => module.websiteTheme !== undefined)?.websiteTheme;\n return {\n generationStepRef,\n seeds: rendered.seeds,\n fromBrand: rendered.fromBrand,\n adjustments: rendered.adjustments,\n personality: rendered.personality,\n personalityFromBrand: rendered.personalityFromBrand,\n ...(websiteTheme !== undefined ? { websiteTheme } : {}),\n rewritten,\n evidencePaths,\n };\n }\n default:\n throw new ApplicationBuildUnknownGenerationStepError(task.taskRef, generationStepRef);\n }\n }\n\n /**\n * The brand's visual tone (`visualTone.colorSeeds`, `styleKeywords`, `mood`), read from the specifications companion\n * exports this process evaluates — the same evaluation the build plan and the brand's name are read from. An\n * application with no brand, or a brand with no visual tone, answers empty lists; a specifications package that does\n * not evaluate throws.\n *\n * It was read through the `brand-visual-tone` introspection behaviour until #3223, which reads exactly these exports in\n * a subprocess. `app-creation-test-007` reported a landed `design-system-brand` step as ready again right after a\n * companion restart (landed 21 → 20) and the next wave ran it once more; the SUSPECTED cause, never confirmed on that\n * run, is that subprocess still warming, so the check answered UNANSWERABLE for a brand nothing had changed. Whatever\n * the cause, the subprocess was a second evaluation of the same exports. Read here, the answer is a function of the\n * specifications files alone, so it survives a restart, and it can only be unknown when the plan itself cannot be\n * read (`loadSpecificationFamilyData` is the plan's own reader), in which case nothing is dispatched anyway.\n * One reader for the step and its CURRENT check, as before, so the two cannot disagree.\n */\n private async readBrandVisualTone(): Promise<BrandDesignInputs> {\n return projectBrandVisualTone(await loadSpecificationFamilyData(this.companionContext));\n }\n\n /**\n * Has this application accepted a mark? Asked of the WORKING tree, so a mark accepted and not yet committed is\n * never redrawn by a re-run. The predicate is shared with the landing probe, which asks the committed tree.\n *\n * It used to be a bare `stat()` of the module, justified as \"written only by a promotion\". That was false — the\n * `wildo init` scaffold writes the module with an empty list — so on every fresh application the step skipped\n * itself and no logo was ever drawn (#2410, `app-creation-test-005`).\n */\n private async hasAcceptedBrandMark(): Promise<boolean> {\n return hasAcceptedBrandMarkInWorkingTree(this.companionContext.saasRoot);\n }\n\n private requireGenerationStepRef(task: BuildPlanTask): string {\n const target = task.target;\n if (target?.kind !== BuildPlanTaskTargetKind.COMPANION_GENERATION_STEP) {\n throw new Error(`Build task ${task.taskRef} is not a companion generation step.`);\n }\n return target.generationStepRef;\n }\n\n /**\n * The locales this application ENABLES — `appPreferences.languages.enabledLanguages`,\n * always including the primary. This is the \"every configured locale\" the\n * build task's objective speaks of; an app that enables only its primary\n * locale gets no translate pass and no foreign-locale evidence.\n */\n private resolveEnabledLocales(): readonly AvailableLanguage[] {\n return getCompanionServedLanguages(this.appConfigService.config);\n }\n\n /**\n * The locales the `i18n-translations` step translates into: every enabled locale but the primary.\n *\n * Public because the dispatch host derives that step only when this is non-empty — on a one-locale\n * application the step owes nothing and its evidence list would be empty, and an empty list never\n * lands, so a derived step there would be ready forever.\n */\n public resolveTranslationTargetLocales(): readonly AvailableLanguage[] {\n const primaryLocale = getCompanionConfiguredPrimaryLanguage(this.appConfigService.config);\n return this.resolveEnabledLocales().filter((locale) => locale !== primaryLocale);\n }\n\n /**\n * The probes a labels plan lands on (#2504): every planned unit's primary-locale file declares every key the plan\n * holds for it, exactly and non-empty — the pipeline's own completeness bar (its adoption check), so the step lands\n * exactly when a re-run would generate nothing. A unit the plan could NOT plan (a stale registry's owed hint) has no\n * keys to name, so its file must at least be committed.\n *\n * Exact keys, not the segment after the bucket: the frontend-derived root units nest under a category\n * (`composite_views.app.<view>`, `settings_hub.sections.<ref>`), and a scaffolded root file already carries the\n * category, so a prefix on that segment landed before any of the application's own entries existed.\n */\n private labelPlanProbes(plan: LabellingPlanResult, primaryLocale: string): readonly BuildPlanTaskLandedProbe[] {\n const i18nRoot = this.resolveI18nRelativeRoot();\n const unitPath = (hint: { readonly bucket: string; readonly slug: string }) => path.posix.join(i18nRoot, hint.bucket, `${hint.slug}.${primaryLocale}.ts`);\n const keysByPath = new Map<string, Set<string>>();\n for (const unit of plan.units) {\n const keys = keysByPath.get(unitPath(unit.filePathHint)) ?? new Set<string>();\n for (const key of unit.chunks.flatMap((chunk) => chunk.keys)) keys.add(key);\n keysByPath.set(unitPath(unit.filePathHint), keys);\n }\n const probes: BuildPlanTaskLandedProbe[] = [...keysByPath].map(([filePath, keys]) => (keys.size > 0\n ? { kind: BuildPlanTaskLandedProbeKind.COMMITTED_LABEL_FILE_DECLARES_KEYS, path: filePath, keys: [...keys].sort() }\n : { kind: BuildPlanTaskLandedProbeKind.COMMITTED_FILE, path: filePath }));\n const owed = new Set(plan.incompleteness.flatMap((entry) => entry.expectedUnitHints ?? []).map(unitPath));\n for (const filePath of owed) {\n if (!keysByPath.has(filePath)) probes.push({ kind: BuildPlanTaskLandedProbeKind.COMMITTED_FILE, path: filePath });\n }\n return probes;\n }\n\n /** Every labelling unit's file, in each of the given locales — exactly the files the pipelines write. */\n private async resolveLabelUnitPaths(locales: readonly string[]): Promise<readonly string[]> {\n if (locales.length === 0) return [];\n const i18nRoot = this.resolveI18nRelativeRoot();\n const plan = await this.planner.planAllUnitsWithCompleteness();\n /*\n * The units the plan could NOT plan count too (#2504). A companion whose registry predates the application's\n * resources plans engine resources only, and evidence read off that plan alone landed the step with no label for any\n * resource the application owns. Counting the owed units keeps the step unlanded until they exist.\n */\n const hints = [\n ...plan.units.map((unit) => unit.filePathHint),\n ...plan.incompleteness.flatMap((entry) => entry.expectedUnitHints ?? []),\n ];\n return [...new Set(hints.flatMap((hint) =>\n locales.map((locale) => path.posix.join(i18nRoot, hint.bucket, `${hint.slug}.${locale}.ts`)),\n ))];\n }\n\n /**\n * Refuse to label from a plan that hides units the application owes (#2504): a registry that predates its resources,\n * or a frontend introspection that failed. Running would commit the units it can see and still owe the rest; the\n * remedy is the cause the detail names (a companion restart, or the frontend introspection's error).\n */\n private async refuseIncompleteLabelPlan(task: BuildPlanTask): Promise<void> {\n const plan = await this.planner.planAllUnitsWithCompleteness();\n const blocking = plan.incompleteness.filter((entry) => LABEL_PLAN_BLOCKING_INCOMPLETENESS.has(entry.reason));\n if (blocking.length === 0) return;\n /*\n * A STALE registry is cured, not only reported: the companion asks its supervisor for a restart, which reloads the\n * registry from the application as it is now (the remedy a person would otherwise have to perform, on most creation\n * runs, since a run's companion boots before the application's modules exist). The step is retried on the next\n * dispatch. Without a supervisor nobody would restart the process, so the message names the remedy instead.\n */\n const stale = blocking.some((entry) => entry.reason === LabellingPlanIncompletenessReason.RESOURCE_REGISTRY_STALE);\n const restarting = stale && requestCompanionRestart(this.companionContext.saasRoot, {\n reasonKey: LabellingPlanIncompletenessReason.RESOURCE_REGISTRY_STALE,\n detail: `${task.taskRef}: resource registry predates the application`,\n });\n throw new Error(`Build task ${task.taskRef} cannot generate labels yet: the plan would miss units the application owes. ${blocking.map((entry) => entry.detail).join(' ')}`\n + (restarting\n ? ' The companion is restarting to reload its registry; the step runs again on the next dispatch.'\n // The door: nothing here needs a person's decision, only the cause repaired. `wildo context health` names it. A\n // stale registry a restart did not cure lands here too (the repeat window): the companion is not reloading the\n // application's registry, and its startup log says why.\n : ' Repair the cause named above (`wildo context health` shows the introspection lane; for a registry a restart did not refresh, '\n + 'the companion\\'s startup log names why it could not load the application\\'s companion exports); the step runs again on the next dispatch.'));\n }\n\n /**\n * The chosen brand's name, from the landed brand brief (#2505); `undefined` when no brand has landed or it carries no\n * name. Read through the same companion exports every family is read from.\n *\n * THROWS when those exports cannot be loaded (#2694). It used to answer `undefined` then, which read as \"no brand\":\n * the display-name step owed nothing and landed without running. Each caller now says what an unreadable brand means\n * to it: the landing check reports it (INPUT_UNREADABLE), the step refuses, and the host-derived step derives nothing.\n */\n public async readLandedBrandName(): Promise<string | undefined> {\n const exports = await loadSpecificationFamilyData(this.companionContext) as unknown as { brandSpecification?: { name?: { brandName?: unknown } } };\n const brandName = exports.brandSpecification?.name?.brandName;\n return typeof brandName === 'string' && brandName.trim().length > 0 ? brandName.trim() : undefined;\n }\n\n private frameworkRoot(): string | null {\n return this.companionContext.resolvedHomes.framework.repositoryRoot ?? null;\n }\n\n /** `<backend service path>/src/engine/i18n`, app-root relative — the same tree the orchestrators write into. */\n private resolveI18nRelativeRoot(): string {\n const backendService = Object.values(this.companionContext.backendServices)[0];\n if (!backendService) {\n throw new Error('No backend service configured for per-unit i18n output.');\n }\n return path.posix.join(backendService.path, BACKEND_I18N_TREE_RELATIVE_PATH);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"application-build-generation-step.companion.service.js","sourceRoot":"","sources":["../../../../src/meta-workflows/services/application-build-generation-step.companion.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EACL,+BAA+B,EAC/B,kCAAkC,EAClC,qCAAqC,GAEtC,MAAM,sEAAsE,CAAC;AAC9E,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAGzD,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAC/G,O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A;IAChD,WAAA,MAAM,CAAC,uBAAuB,CAAC,uBAAuB,CAAC,CAAA;IACvD,WAAA,MAAM,CAAC,uBAAuB,CAAC,4BAA4B,CAAC,CAAA;IAC5D,WAAA,MAAM,CAAC,uBAAuB,CAAC,4BAA4B,CAAC,CAAA;IAC5D,WAAA,MAAM,CAAC,uBAAuB,CAAC,oBAAoB,CAAC,CAAA;IACpD,WAAA,MAAM,CAAC,uBAAuB,CAAC,uBAAuB,CAAC,CAAA;IACvD,WAAA,MAAM,CAAC,uBAAuB,CAAC,kBAAkB,CAAC,CAAA;IAClD,WAAA,MAAM,CAAC,uBAAuB,CAAC,mBAAmB,CAAC,CAAA;IAEnD,YAAA,MAAM,CAAC,uBAAuB,CAAC,yBAAyB,CAAC,CAAA;IAMzD,YAAA,MAAM,CAAC,uBAAuB,CAAC,kBAAkB,CAAC,CAAA;IAAE,YAAA,QAAQ,EAAE,CAAA;iEAdoB,gCAAgC;QACzB,qCAAqC;QACrC,qCAAqC;QACxC,6BAA6B;QACxB,gCAAgC;QAC1C,2BAA2B;GAdpG,8CAA8C,CAg3B1D","sourcesContent":["import * as path from 'node:path';\nimport {\n ApplicationSchemaPlanObligation,\n SCHEMA_PLAN_LOCKFILE_RELATIVE_PATH,\n assessApplicationSchemaPlanObligation,\n type ApplicationSchemaPlanObligationAssessment,\n} from '../../core/config/application-schema-plan-obligation.companion.utils';\nimport { mkdir, readFile } from 'node:fs/promises';\nimport { existsSync, readdirSync } from 'node:fs';\nimport { inject, injectable, optional } from 'inversify';\n\nimport type { AppConfigurationService, LoggerService } from '@wildo-ai/saas-backend-lib';\nimport { SAAS_SERVICE_TYPES, describeCaughtError, executeBoundedSubprocess } from '@wildo-ai/saas-backend-lib';\nimport { BrandDesignState, DesignTokenBlockState, SchemaPlanSyncState } from '@wildo-ai/platform-core-shared';\nimport { CoreResourceType } from '@wildo-ai/saas-models';\nimport { OPENAPI_AUTHORED_EXAMPLE_ERROR_NAME } from '@wildo-ai/saas-technical-doc/companion';\nimport {\n NO_PLAYBOOK_SPEND_METER,\n SAAS_CONFIG_FILE_NAME,\n applyApplicationDisplayName,\n listDisplayNameBearingPaths,\n resolveBrandSurfaceDirs,\n type ApplicationDisplayNameResult,\n type PlaybookSpend,\n type PropagateBrandAssetsOutcome,\n assertSpecificationWritePermitted,\n SpecificationWriteRefusedError,\n writeSpecificationFileAtomically,\n} from '@wildo-ai/application-creation-runtime';\nimport { assertSpecificationsReadWhole } from '../../core/context/companion-package-loaders.companion';\nimport { loadSpecificationFamilyData, readSpecificationFamiliesForRewrite } from '../../core/context/specification-family-data.companion';\nimport type { EngineCapabilityAlignmentResult, FoundationExecutorCompanionService } from './foundation-executor.companion.service';\nimport { propagateAcceptedBrand } from '../../brand/services/brand-propagation.companion.utils';\nimport { BRAND_RESOLVED_ASSETS_MODULE_PATH, hasAcceptedBrandMarkInWorkingTree } from '../../brand/models/accepted-brand-mark.models';\nimport type { TechnicalDocCompanionService } from '../../technical-doc/services/technical-doc.companion.service';\nimport { AvailableLanguage, type PaletteDerivationAdjustment, type PaletteSeeds, type ThemePersonality } from '@wildo-ai/presets-components-models';\nimport { BuildPlanTaskTargetKind, FrontendConfigSurface, type BuildPlanTask } from '@wildo-ai/saas-specifications/application-creation';\n\nimport { COMPANION_SERVICE_TYPES } from '../../core/inject/models/service-types';\nimport type { CompanionContext } from '../../core/context/companion-context';\nimport { getCompanionConfiguredPrimaryLanguage, getCompanionServedLanguages } from '../../core/config/primary-language.companion.utils';\nimport { signDerivedInputs } from '../../core/utils/derived-input-signature.companion.utils';\nimport { LabellingPlannerCompanionService } from '../../i18n-labelling/services/labelling-planner.companion.service';\nimport { LabellingPlanIncompletenessReason, type LabellingPlanResult } from '../../i18n-labelling/models/labelling-unit.models';\nimport { BACKEND_I18N_TREE_RELATIVE_PATH } from '../../i18n-labelling/utils/per-unit-file.utils';\nimport { requestCompanionRestart } from '../../core/runtime/companion-self-restart.companion';\nimport { BuildPlanTaskLandedProbeKind, type BuildPlanTaskLandedProbe } from './application-build-task-coding-policy.companion.service';\nimport {\n LabellizeOrchestratorCompanionService,\n type LabellizeRunResult,\n} from '../../i18n-labelling/services/labellize-orchestrator.companion.service';\nimport {\n TranslateOrchestratorCompanionService,\n type TranslateRunResult,\n} from '../../i18n-labelling/services/translate-orchestrator.companion.service';\nimport {\n EmailTemplateCompanionService,\n type GenerateEmailTemplatesResult,\n type TranslateEmailTemplateLabelsResult,\n} from '../../email/services/email-template.companion.service';\nimport {\n LogoDeliberationCompanionService,\n type LogoDeliberationResult,\n} from '../../brand/services/logo-deliberation.companion.service';\nimport {\n BrandAcceptCompanionService,\n type BrandAcceptResult,\n} from '../../brand/services/brand-accept.companion.service';\nimport type { CompanionExecutionSessionContext } from '../../core/traceability/companion-traceability.models';\nimport type { LabellingProgressReporter } from '../../i18n-labelling/models/labelling-progress.models';\nimport { GenerationStepProgressTracker, type GenerationStepProgress } from '../models/generation-step-progress.models';\nimport { PlaybookSpendMeasuredUnit, type PlaybookSpendMeterCompanionService } from './playbook-spend-meter.companion.service';\nimport { resolveFrontendConfigSurfaceFile } from './application-build-task-coding-policy.companion.service';\nimport type { WebsitePalette, WebsitePersonality } from '@wildo-ai/saas-website/companion';\nimport {\n BRAND_DESIGN_FRONTEND_RELATIVE_PATH,\n BRAND_WEBSITE_THEME_WEBSITE_RELATIVE_PATH,\n DESIGN_SYSTEM_CONFIG_FRONTEND_RELATIVE_PATH,\n renderBrandDesignModule,\n renderBrandWebsiteThemeModule,\n type BrandDesignInputs,\n} from '../../brand/services/brand-design.companion.utils';\n\n/**\n * The companion generation steps this host can EXECUTE.\n *\n * The values are the `generationStepRef` slugs a build plan authors on a\n * `COMPANION_GENERATION_STEP` target — the closed vocabulary this enum is the\n * named home of. A build plan may only reference steps that exist here: an\n * unknown ref refuses by name (below) instead of silently parking the build,\n * which is exactly how the first generation step ever authored\n * (`i18n-labels`) stalled the Wonder Todos build plan — the vocabulary\n * existed in `_core`, and nothing executed it.\n *\n * Seeds join this enum WHEN a seed-generation pipeline exists to execute —\n * adding the value without one would let a build plan dispatch a step that can\n * only fail; the unknown-ref refusal below is the honest answer until then.\n * The executor is the integration point, not a new lane per step.\n */\nexport enum ApplicationBuildGenerationStep {\n /**\n * The application's labels in its PRIMARY locale — the `labellize` pipeline, and nothing else.\n *\n * It used to translate as well, into every other enabled locale, in the same step. That made \"the\n * labels exist\" and \"every translation is done\" one graph node, and everything that needs only the\n * first waited for the second. Measured on app-creation-test-004 (2026-10-01, #2204): the English\n * labels existed within minutes, translation into four locales then ran for hours at about one\n * file every two minutes per locale, and the documentation portal — which reads primary-locale\n * labels only — stayed dark the whole time. A hand-run `wildo docs publish` succeeded at once.\n *\n * Translation is now {@link I18N_TRANSLATIONS}, its own node, which the dispatch host derives after\n * this one. A step that needs labels to EXIST depends on this step; nothing depends on translation.\n */\n I18N_LABELS = 'i18n-labels',\n /**\n * The application's labels translated into every enabled locale other than the primary — the\n * `translate` pipeline. Split out of {@link I18N_LABELS} (#2204) so translation stops gating the\n * steps that need only the primary locale.\n *\n * DERIVED by the dispatch host rather than authored, for the reason {@link DATABASE_MIGRATIONS} is:\n * the obligation follows from what the application declares (more than one enabled locale) and\n * from the plan carrying a labels step, not from a decision the plan makes. A plan MAY author it,\n * and then the host derives nothing. See `withHostDerivedTranslationStep`.\n *\n * Nothing downstream waits on it, by design: the documentation portal reads primary-locale labels\n * only (#1993 is the issue for translating it), and the website and the application read their\n * label files at run time, so a translation landing is picked up without any republish step.\n */\n I18N_TRANSLATIONS = 'i18n-translations',\n EMAIL_TEMPLATES = 'email-templates',\n /**\n * The brand mark: an expert panel derives creative directions, images are generated, a vision\n * judge scores them, and the winner is promoted into the specifications SSOT.\n *\n * Added under the rule this enum's docblock states — a value joins WHEN a pipeline exists to\n * execute it. That pipeline was fully built and reachable only by a human issuing\n * `POST /brand/{generate,deliberate,accept}-logo`, so an application could acquire a considered\n * mark only if someone drove it by hand (issue #220). Hand-supplying a logo stays available and\n * unchanged; what this adds is the journey's own path to one.\n */\n LOGO = 'logo',\n /**\n * `wildo db generate` — turn the drift between the application's resource model and its accepted\n * schema plan into a committed migration, so a PostgreSQL-backed application's tables exist.\n *\n * Added under the rule this enum's docblock states — a value joins WHEN a pipeline exists to\n * execute it. The pipeline is the CLI's own generate door, which already owns every hard part\n * (the planner, the risk vocabulary, the refusals) and advances the lockfile in the same\n * invocation that writes the migration.\n *\n * Without a lockfile `wildo db generate` treats the whole model as the INITIAL migration and writes\n * the baseline beside it. That is exactly what a PostgreSQL application with no baseline owes, and\n * exactly wrong for a MongoDB-backed one, where it would author a table set nothing uses — so the\n * application's DECLARED store decides (#1144, `ApplicationSchemaPlanObligation`): the step runs\n * for an accepted plan or an owed baseline, and REFUSES for a MongoDB store or an unreadable\n * declaration. See `executeGenerationStep`.\n */\n DATABASE_MIGRATIONS = 'database-migrations',\n /**\n * `wildo docs publish` — derive, render, measure, validate and write the application's customer\n * documentation portal, so the chapters its build authored are something a reader can reach.\n *\n * Added under the rule this enum's docblock states — a value joins WHEN a pipeline exists to\n * execute it — and it is the same shape {@link LOGO} joined in: the pipeline was fully built and\n * reachable ONLY by a human, through `POST /technical-doc/publish-managed` or the `wildo docs\n * publish` command that calls it. Measured on the first end-to-end journey run (#1273): the plan\n * carried SIX `DOCUMENTATION_CHAPTER` tasks, the engine's own derivation refused with *\"Application\n * content remains absent until the app-creator owns an accepted authoring artifact\"*, an agent\n * built that artifact — and nothing published it. `technical-doc` could not even typecheck, because\n * `src/pages/search.tsx` imports a search index the publish is what writes, so\n * `check:technical-doc-typecheck` was red for the whole build and failed a documentation task on a\n * red it did not cause, at $19.33.\n *\n * The step is DERIVED by the dispatch host rather than authored by the decomposer, for the reason\n * {@link DATABASE_MIGRATIONS} is: an application owes it as a consequence of what its plan\n * contains — here, any documentation chapter — rather than as a decision the plan makes. See\n * `withHostDerivedDocumentationPublicationStep`.\n *\n * It runs AFTER the chapters and after `i18n-labels`, and the second is not optional: publication\n * resolves the application's organization-role documentation and refuses without the primary-locale\n * label — *\"requires primary-locale label 'roles.ORG_ADMIN.label'; generate the application's role\n * labels before publishing documentation\"*. Running it early fails on exactly that.\n *\n * It does NOT wait for {@link I18N_TRANSLATIONS}: the primary locale is all it reads (#2204).\n */\n DOCUMENTATION_PUBLICATION = 'documentation-publication',\n /**\n * `wildo design-tokens generate` — rewrite the generated design-token block of the frontend's\n * stylesheet (`frontend/src/index.css`, between `@wildo-ai:design-token:start` and `:end`) from its\n * design-system config, so the stylesheet and the running frontend describe the same page.\n *\n * Added under the rule this enum's docblock states, and in the shape {@link DATABASE_MIGRATIONS}\n * joined: the pipeline is a CLI door that already owns every hard part (which frontend, which config,\n * the markers, the generator), and this step runs it.\n *\n * **Why the step exists (#2358).** The stylesheet block is what the loading screen and the first paint\n * use; the runtime applies the config's tokens only after the app mounts. A DESIGN_SYSTEM build task\n * may write `frontend/src/config/design-system.config.ts` and nothing else, so a design system authored\n * during creation reached the page only through the runtime, after mount, and the first paint kept the\n * scaffold's palette. Nothing ran the command: no Vite hook, no step, no task.\n *\n * **Derived by the dispatch host** for the reason {@link DOCUMENTATION_PUBLICATION} is: the obligation\n * follows from what the plan contains, here anything that WRITES the design-system config — today a\n * coding task targeting the DESIGN_SYSTEM frontend config surface; a generation step that derives the\n * config (the brand design module, #2353) joins the same prerequisite set. The block is regenerated after every writer, because it is a function of the config's final\n * state. See `withHostDerivedDesignTokensStep`.\n *\n * **Landed on the block, not on the file.** `frontend/src/index.css` is committed in every scaffolded\n * application, so \"the stylesheet is committed\" is true before the step ever runs — the trap\n * {@link ApplicationBuildGenerationStepLandedKind} exists for. The step lands when the stylesheet is\n * committed AND `wildo design-tokens validate` reports its block current\n * ({@link ApplicationBuildGenerationStepLandedKind.DESIGN_TOKEN_BLOCK_CURRENT}).\n */\n DESIGN_TOKENS = 'design-tokens',\n\n /**\n * Write `frontend/src/config/brand-design.ts` from the brand's visual tone, so the design-system config can derive\n * its palette from the brand's colours with `derivePaletteSourceConfig(BRAND_PALETTE_SEEDS)` (#2353) and compose its\n * theme from the brand's style words with `composeTheme(BRAND_THEME_PERSONALITY, overrides)` (#2359), instead of a\n * coding agent picking colours by eye and copying a named theme. When the application declares a website, also\n * write `website/src/brand-theme.ts`: `BRAND_WEBSITE_PALETTE` (the same derived palette as the website's colour\n * roles, with the dark roles for its inverse tone) and `BRAND_WEBSITE_PERSONALITY` (the same point, plus the two\n * website axes), so the site and the product show one primary and one character (#2597, #2742).\n *\n * **Why a step and not the coding task.** The brand already names its colours and its style; turning colours into a\n * palette that reads is arithmetic (`derivePalette`), and turning style words into a point on the theme axes is a\n * fixed lexicon (`deriveThemePersonality`). Asking a model to redo either is how the named palettes came to fail AA\n * on every primary button. The step writes the SEEDS, not the palette (the config derives it when evaluated, so a\n * derivation improvement needs no regeneration), and the POINT, not the theme (the config composes it, keeping the\n * overrides the brand genuinely needs).\n *\n * **Derived by the dispatch host**, prepended with no prerequisites (the {@link DATABASE_MIGRATIONS} shape), and\n * every DESIGN_SYSTEM config task waits on it, because the config it writes imports this file. Owed when the plan\n * writes the design-system config, builds the website, or the config already imports the module. See\n * `withHostDerivedBrandDesignStep`.\n *\n * **Landed on content, not on the file.** The file is generated once and then stays committed, so \"committed\" alone\n * would land the step forever after the first build and a rebrand would never reach the design system — the trap\n * {@link ApplicationBuildGenerationStepLandedKind} exists for. It lands when EVERY module it writes is committed AND\n * equals what the brand's current visual tone renders ({@link ApplicationBuildGenerationStepLandedKind.BRAND_DESIGN_CURRENT}). A\n * brand with no visual tone renders the neutral seeds and the default theme's point, so the step is owed and lands\n * either way.\n */\n DESIGN_SYSTEM_BRAND = 'design-system-brand',\n /**\n * Turn on the engine capabilities the application's decisions imply and nothing has turned on (#2497):\n * ORGANIZATIONS for an organization-tenancy domain plan, EMAIL_TRANSACTIONAL because tenant invitations\n * send mail (served by the credential-free development provider), EMAIL_INBOUND when work arrives by email.\n *\n * The foundation step does this, and a build planned without it did not: app-creation-test-005 made its\n * modules through ensure-module tasks and shipped `ORGANIZATIONS: false` under an organization-tenancy\n * plan. DERIVED by the dispatch host for the reason {@link DATABASE_MIGRATIONS} is: the obligation follows\n * from what the application declares, not from a decision the plan makes. See\n * `withHostDerivedEngineCapabilitiesStep`. The derivation is the foundation's own\n * (`FoundationExecutorCompanionService.alignEngineCapabilitiesWithDecisions`), so the two cannot disagree.\n */\n ENGINE_CAPABILITIES = 'engine-capabilities',\n /**\n * Carry the chosen brand's name to the application (#2505): the SaaS config's `displayName`, and every file a\n * template rendered the provisional name into (the page title, the website's copy, the documentation portal).\n *\n * Both creation runs chose \"Groundwork\" and shipped \"App Creation Test 00x\" everywhere, because the brand step\n * decides a name and nothing applied it. DERIVED by the dispatch host whenever the landed brand's name differs from\n * the committed `displayName` (see `withHostDerivedDisplayNameStep`). The rename is\n * `applyApplicationDisplayName`, which derives the files from the templates.\n */\n DISPLAY_NAME = 'display-name',\n}\n\n/**\n * What a generation step may write, relative to its evidence paths (#2505 review F2).\n *\n * The dispatch plan's write scope, and in a shared worktree window the paths the step CLAIMS as its own, are derived\n * from the step's evidence. Most steps own whole directories (a label unit tree, the migrations directory, the brand\n * module's directory), so their evidence directories are the scope. A step whose evidence files sit inside directories\n * other writers share must be scoped to those FILES: widening each to its directory would let it claim, and commit\n * under its name, a concurrent coding run's half-written edits. An exact file is never claimed in a shared window;\n * the wave-end reconciliation commits it with its siblings (the #2497 rule).\n *\n * Applied in ONE place, `resolveGenerationStepWritableRoots`, which the dispatch host calls for every generation step.\n */\nexport enum GenerationStepWriteScope {\n /** The directories holding the evidence paths: the step is their only writer. */\n EVIDENCE_DIRECTORIES = 'EVIDENCE_DIRECTORIES',\n /** Exactly the evidence files: others write the directories around them. */\n EVIDENCE_FILES = 'EVIDENCE_FILES',\n}\n\n/** Total over the steps, so a step added tomorrow does not compile until somebody says what it may write. */\nexport const GENERATION_STEP_WRITE_SCOPE: Readonly<Record<ApplicationBuildGenerationStep, GenerationStepWriteScope>> = {\n [ApplicationBuildGenerationStep.I18N_LABELS]: GenerationStepWriteScope.EVIDENCE_DIRECTORIES,\n [ApplicationBuildGenerationStep.I18N_TRANSLATIONS]: GenerationStepWriteScope.EVIDENCE_DIRECTORIES,\n [ApplicationBuildGenerationStep.EMAIL_TEMPLATES]: GenerationStepWriteScope.EVIDENCE_DIRECTORIES,\n [ApplicationBuildGenerationStep.LOGO]: GenerationStepWriteScope.EVIDENCE_DIRECTORIES,\n [ApplicationBuildGenerationStep.DATABASE_MIGRATIONS]: GenerationStepWriteScope.EVIDENCE_DIRECTORIES,\n [ApplicationBuildGenerationStep.DOCUMENTATION_PUBLICATION]: GenerationStepWriteScope.EVIDENCE_DIRECTORIES,\n // The configuration file, which the worker, minion, provider and roles coding tasks also write.\n [ApplicationBuildGenerationStep.ENGINE_CAPABILITIES]: GenerationStepWriteScope.EVIDENCE_FILES,\n // The page title, the website's packs, the portal's title: every one sits beside files other tasks write.\n [ApplicationBuildGenerationStep.DISPLAY_NAME]: GenerationStepWriteScope.EVIDENCE_FILES,\n // `frontend/src/index.css`: one file in a directory every frontend coding task also writes.\n [ApplicationBuildGenerationStep.DESIGN_TOKENS]: GenerationStepWriteScope.EVIDENCE_FILES,\n // `frontend/src/config/brand-design.ts`, and `website/src/brand-theme.ts` when a website is declared: single files\n // in directories the frontend config and website coding tasks also write.\n [ApplicationBuildGenerationStep.DESIGN_SYSTEM_BRAND]: GenerationStepWriteScope.EVIDENCE_FILES,\n};\n\n/**\n * What a generation step READS in the application's tree (#3709): the roots (a directory with its trailing slash, or one\n * file) whose change may change what the step produces. A step held for having run on unchanged inputs (#3233) or for\n * failing the same way twice (#3709) is released by a commit or an edit under one of these, and by nothing else, so a\n * sibling's frontend view no longer releases the documentation publication.\n *\n * GENEROUS on purpose, because the two errors cost differently. A root listed here that the step does not read costs one\n * more run after an unrelated change. A root it reads and that is missing here holds the step over a change that could\n * have fixed it, until somebody runs it by name or re-arms it. So a root is left out only when the step's pipeline\n * plainly never opens it.\n *\n * Never the whole story: what a step reads outside the application (the engine's own examples and label keys, the\n * platform's templates) is no path in this tree. A failure caused there names that owner instead\n * (`GenerationStepFailureOwner`), and a person releases the step once it is fixed.\n *\n * Total over the steps, so a step added tomorrow does not compile until somebody says what it reads.\n * `I18N_TRANSLATIONS` is the one DERIVED entry (`undefined` here): it reads the primary locale's label units, which\n * {@link ApplicationBuildGenerationStepCompanionService.resolveGenerationStepReadRoots} reads off the labels step's own\n * evidence, so the two cannot name different trees.\n */\nexport const GENERATION_STEP_READ_ROOTS: Readonly<Record<ApplicationBuildGenerationStep, readonly string[] | undefined>> = {\n // The application's whole vocabulary: schemas, ui-behaviours, specifications, the backend's own keys, every surface.\n [ApplicationBuildGenerationStep.I18N_LABELS]: ['shared-lib/', 'frontend/', 'backend-api/', 'specifications/', 'website/', 'technical-doc/', 'minions/', 'workers/', SAAS_CONFIG_FILE_NAME],\n [ApplicationBuildGenerationStep.I18N_TRANSLATIONS]: undefined,\n // The email definitions and their event data (specifications, the backend's operations), the labels they carry, the locales.\n [ApplicationBuildGenerationStep.EMAIL_TEMPLATES]: ['specifications/', 'backend-api/', 'shared-lib/', SAAS_CONFIG_FILE_NAME],\n // The brand family it derives directions from.\n [ApplicationBuildGenerationStep.LOGO]: ['specifications/', SAAS_CONFIG_FILE_NAME],\n // The compiled registry `wildo db` plans from: the backend and the shared schemas it compiles.\n [ApplicationBuildGenerationStep.DATABASE_MIGRATIONS]: ['backend-api/', 'shared-lib/', SAAS_CONFIG_FILE_NAME],\n // The portal and its chapters, the API reference (backend operations and their examples), the roles and labels, the\n // specifications the derivation reads, and the frontend's ui-behaviours a field's documentation is read from.\n [ApplicationBuildGenerationStep.DOCUMENTATION_PUBLICATION]: ['technical-doc/', 'backend-api/', 'shared-lib/', 'specifications/', 'frontend/', SAAS_CONFIG_FILE_NAME],\n // The design-system configuration and the brand module it imports.\n [ApplicationBuildGenerationStep.DESIGN_TOKENS]: ['frontend/src/config/', SAAS_CONFIG_FILE_NAME],\n // The brand family's visual tone, and the configuration that says whether a website is declared.\n [ApplicationBuildGenerationStep.DESIGN_SYSTEM_BRAND]: ['specifications/', SAAS_CONFIG_FILE_NAME],\n // The decisions it derives the capabilities from: the domain and integration plans.\n [ApplicationBuildGenerationStep.ENGINE_CAPABILITIES]: ['specifications/', SAAS_CONFIG_FILE_NAME],\n // The brand's chosen name, and the templates' rendered files (its own write scope).\n [ApplicationBuildGenerationStep.DISPLAY_NAME]: ['specifications/', SAAS_CONFIG_FILE_NAME],\n};\n\n/**\n * WHO can fix a generation step's failure (#3709): the application, or the framework it is built on. Recorded on the failed\n * run's row, so the dispatch can refuse by name rather than spend attempts on a cause no change in the application reaches.\n *\n * Classified POSITIVELY only ({@link classifyGenerationStepFailureOwner}): a failure the step cannot attribute carries no\n * owner and is treated as before. \"Application\" is never inferred from the absence of a framework cause.\n *\n * Measured on reference run 42886943490: `build-task-documentation-publication` failed 21 times on OpenAPI examples the\n * engine's own resource specifications author, fixed in the engine (446014e0f). No run of the application could have.\n */\nexport enum GenerationStepFailureOwner {\n /** The cause is in what the application authored; a change in its tree can fix it. */\n APPLICATION = 'application',\n /** The cause is in the framework (an engine package, the platform); only a framework change, then a re-run, fixes it. */\n FRAMEWORK = 'framework',\n}\n\n/** Owners classified for thrown failures, keyed by the thrown object so it survives the lanes that rethrow it unchanged. */\nconst generationStepFailureOwners = new WeakMap<object, GenerationStepFailureOwner>();\n\n/** The owner a generation step's failure was classified with, or `undefined` when it was not (or is not an object). */\nexport function readGenerationStepFailureOwner(error: unknown): GenerationStepFailureOwner | undefined {\n return typeof error === 'object' && error !== null ? generationStepFailureOwners.get(error) : undefined;\n}\n\n/**\n * Who owns a generation step's failure, or `undefined` when the step cannot tell (#3709).\n *\n * The documentation publication refuses with `OpenApiAuthoredExampleError` when an authored example is untrue of its\n * schema, and each finding names its operation's resource. An example of an engine resource (`CoreResourceType`) is\n * authored in the engine's resource specification, so a refusal whose findings are ALL on engine resources is the\n * framework's; one naming any application resource is the application's (its finding is one the application fixes).\n * A finding with no resource leaves the failure unclassified.\n *\n * Every other step and failure is unclassified until a cause is measured and given a rule here, rather than guessed.\n */\nexport function classifyGenerationStepFailureOwner(generationStepRef: string, error: unknown): GenerationStepFailureOwner | undefined {\n if (generationStepRef !== ApplicationBuildGenerationStep.DOCUMENTATION_PUBLICATION) return undefined;\n if ((error as { name?: unknown } | null | undefined)?.name !== OPENAPI_AUTHORED_EXAMPLE_ERROR_NAME) return undefined;\n const findings = (error as { findings?: unknown }).findings;\n if (!Array.isArray(findings) || findings.length === 0) return undefined;\n const engineResources = new Set<string>(Object.values(CoreResourceType));\n const resources = findings.map((finding) => (finding as { resourceIdentifier?: unknown }).resourceIdentifier);\n if (resources.some((resource) => typeof resource !== 'string')) return undefined;\n return resources.every((resource) => engineResources.has(resource as string)) ? GenerationStepFailureOwner.FRAMEWORK : GenerationStepFailureOwner.APPLICATION;\n}\n\n/** The compiled registry `wildo db` imports to compute the current plan. Absent ⇒ the plan cannot be computed. */\nconst MODULES_REGISTRY_RELATIVE_PATH = 'backend-api/dist/modules-registry.backend.js';\n\n/** Bounds on the `wildo db generate` subprocess. Generous: it spawns a runner that imports the whole app registry. */\nconst MIGRATION_GENERATION_TIMEOUT_MS = 10 * 60 * 1000;\n\n/**\n * Bounds on a `wildo design-tokens` subprocess. It loads one config file and the SaaS config; measured\n * ~14 s for `validate` on `examples/wonder-todos` (2026-10-03), most of it CLI boot and the config\n * loader's alias graph. Two minutes leaves room for a cold cache without letting a hung CLI hold a board.\n */\nconst DESIGN_TOKENS_CLI_TIMEOUT_MS = 2 * 60 * 1000;\n\n/**\n * How a generation step proves it did its work.\n *\n * Two kinds, because the obvious single answer does not fit every step. Most steps write FILES\n * whose paths are known before they run, and \"landed\" means those files are committed. A migration\n * step cannot: its artifact is `backend-api/migrations/<timestamp>_<name>/migration.sql`, and the\n * timestamp is minted DURING the run.\n *\n * The tempting substitutes were both rejected, and the reasons are worth keeping:\n *\n * - the accepted lockfile — once a plan is accepted it ALREADY EXISTS before every later run of the\n * step, so \"is it committed?\" is trivially true and the step would land having done nothing. That is precisely the directory-prefix shortcut this service's `LOGO` case warns about.\n * - an empty path list — legal, and it makes the dispatch host SKIP the landed check entirely, so a\n * step that generated nothing would read as complete.\n *\n * So the migration step's evidence is not a file at all: it is the STATE the step exists to reach —\n * the model and the accepted plan agree. That is what `wildo db diff --check` answers.\n */\nexport enum ApplicationBuildGenerationStepLandedKind {\n /** Landed when every named path is committed. The shape every file-writing step uses. */\n COMMITTED_PATHS = 'committed_paths',\n /** Landed when the resource model and the accepted schema plan agree. */\n SCHEMA_PLAN_IN_SYNC = 'schema_plan_in_sync',\n /**\n * Landed by construction: the application owes this step nothing. Today that is an `i18n-translations`\n * step on an application whose only enabled locale is the primary (#2204 review). The host never\n * DERIVES that step there, but a plan may AUTHOR it, and its evidence list is empty — and an empty\n * `COMMITTED_PATHS` list never lands, so the step would be ready forever and the plan never finish.\n * An honest \"nothing is owed\" is a landing, not a missing proof.\n */\n NOT_OWED = 'not_owed',\n /**\n * Landed when the stylesheet is COMMITTED and its generated design-token block is CURRENT against the\n * design-system config ({@link DesignTokenBlockState.CURRENT}). Both halves, because each alone is\n * vacuous: the stylesheet is committed before the step ever runs, and a current block in an uncommitted\n * stylesheet is work nobody accepted.\n */\n DESIGN_TOKEN_BLOCK_CURRENT = 'design_token_block_current',\n /**\n * Landed when EVERY module the step writes (the frontend's brand design, and the website's colours when a website\n * is declared, `modulePaths`) is COMMITTED and its text equals what the brand's current visual tone renders\n * ({@link BrandDesignState.CURRENT}). Both halves, for the reason the design-token block needs both: after the first\n * build the files are committed whatever the brand now says, and a current file nobody committed is work nobody\n * accepted.\n */\n BRAND_DESIGN_CURRENT = 'brand_design_current',\n /**\n * Landed when the COMMITTED resolved-assets module lists a MASTER asset whose file is committed (#2410) — the\n * logo step. Not `COMMITTED_PATHS` over the module: `wildo init` scaffolds that module (an empty asset list) and the\n * brand index imports it, so it is committed on every application before the step ever runs, and a presence test\n * landed the step having drawn nothing. See `accepted-brand-mark.models.ts`.\n */\n ACCEPTED_BRAND_MARK = 'accepted_brand_mark',\n /**\n * Landed when the COMMITTED `wildo.saas.config.ts` enables every named capability (#2497) — the\n * `engine-capabilities` step. Not `COMMITTED_PATHS` over the config: every application commits that file\n * before the step runs, so a presence test would land it having enabled nothing.\n */\n ENGINE_CAPABILITIES_ENABLED = 'engine_capabilities_enabled',\n /**\n * Never landed while the labels PLAN is partial in a way that hides units the application owes (#2504): the frontend\n * introspection failed or answered malformed, so the sidebar sections, views, composite views and settings hub are\n * absent from the plan rather than empty; or the fresh resource list could not be read. Evidence read off such a plan\n * is met by the units it can see, so a run on it lands while owing the rest.\n */\n LABEL_PLAN_INCOMPLETE = 'label_plan_incomplete',\n /**\n * Landed when every probe holds (#2504) — the labels step: each planned unit's file is committed, and each planned\n * id of a frontend-derived ROOT unit (a sidebar section, a view, a composite view, a settings-hub entry) is declared in\n * that committed file. Those buckets are one `root.<locale>.ts` each, so a file check alone never notices a missing\n * section: 005's sidebar file existed and held only the engine's three sections.\n */\n LANDED_PROBES = 'landed_probes',\n /**\n * Landed when the COMMITTED `wildo.saas.config.ts` declares `displayName` equal to the brand's name (#2505) — the\n * `display-name` step. Not `COMMITTED_PATHS`: the config is committed before the step runs.\n */\n DISPLAY_NAME_APPLIED = 'display_name_applied',\n /**\n * Never landed while what decides the step cannot be read: the brand for `display-name` (#2694), the domain plan, the\n * business model, the integration plan or the dossier for `engine-capabilities` (#3258). Whether anything is owed is\n * unknown, and it used to read as \"nothing\", so the step landed without running. Passed over like an unanswerable\n * design step, and `detail` says why, on the record and on the board.\n */\n INPUT_UNREADABLE = 'input_unreadable',\n}\n\n/**\n * The plan degradations that hide label units the application owes (#2504), so a labels step may neither land on nor\n * run from such a plan. RESOURCE_REGISTRY_STALE also names the units it hides, which the evidence counts.\n */\nexport const LABEL_PLAN_BLOCKING_INCOMPLETENESS: ReadonlySet<LabellingPlanIncompletenessReason> = new Set([\n LabellingPlanIncompletenessReason.RESOURCE_REGISTRY_STALE,\n LabellingPlanIncompletenessReason.RESOURCE_REGISTRY_UNREADABLE,\n LabellingPlanIncompletenessReason.FRONTEND_INTROSPECTION_FAILED,\n LabellingPlanIncompletenessReason.FRONTEND_INTROSPECTION_MALFORMED,\n]);\n\n/** What the dispatch host must evaluate to decide whether a generation-step task has landed. */\nexport type ApplicationBuildGenerationStepLandedCondition =\n | { readonly kind: ApplicationBuildGenerationStepLandedKind.COMMITTED_PATHS; readonly paths: readonly string[] }\n | { readonly kind: ApplicationBuildGenerationStepLandedKind.SCHEMA_PLAN_IN_SYNC }\n | { readonly kind: ApplicationBuildGenerationStepLandedKind.NOT_OWED }\n | {\n readonly kind: ApplicationBuildGenerationStepLandedKind.DESIGN_TOKEN_BLOCK_CURRENT;\n /** The stylesheet that must be committed; deliberately not named `paths`, so no reader can mistake it for the whole condition. */\n readonly stylesheetPath: string;\n }\n | {\n readonly kind: ApplicationBuildGenerationStepLandedKind.BRAND_DESIGN_CURRENT;\n /**\n * The generated modules that must be committed: the frontend's brand design, and the website's brand colours when\n * the application declares a website (#2597). Not named `paths`, for the reason `stylesheetPath` is not.\n */\n readonly modulePaths: readonly string[];\n }\n | { readonly kind: ApplicationBuildGenerationStepLandedKind.ACCEPTED_BRAND_MARK; readonly modulePath: string }\n | { readonly kind: ApplicationBuildGenerationStepLandedKind.ENGINE_CAPABILITIES_ENABLED; readonly configPath: string; readonly capabilities: readonly string[] }\n | { readonly kind: ApplicationBuildGenerationStepLandedKind.LABEL_PLAN_INCOMPLETE; readonly detail: string }\n | { readonly kind: ApplicationBuildGenerationStepLandedKind.LANDED_PROBES; readonly probes: readonly BuildPlanTaskLandedProbe[] }\n | { readonly kind: ApplicationBuildGenerationStepLandedKind.DISPLAY_NAME_APPLIED; readonly configPath: string; readonly displayName: string }\n | { readonly kind: ApplicationBuildGenerationStepLandedKind.INPUT_UNREADABLE; readonly detail: string };\n\n// `SchemaPlanSyncState` is declared in `@wildo-ai/platform-core-shared` since #2530: the workbench shows it on a step's record.\n\n/**\n * The line `wildo db diff --check` prints when, and only when, it found drift. The CLI exits non-zero for\n * drift and for every could-not-ask failure alike, so this text is the one thing that separates them. A COPY\n * of the message in the CLI's `commands/db/diff.command.ts`, pinned to it by a source-parity test.\n */\nexport const SCHEMA_PLAN_DRIFT_OUTPUT_MARKER = 'ungenerated schema change(s)';\n\n/** Classify a failed `wildo db diff --check`: DRIFTED when the CLI said so, UNANSWERABLE otherwise. */\nexport function classifySchemaPlanCheckFailure(error: unknown): SchemaPlanSyncState {\n const details = (error as { details?: { stdout?: unknown; stderr?: unknown } } | null | undefined)?.details;\n const output = `${typeof details?.stdout === 'string' ? details.stdout : ''}\\n${typeof details?.stderr === 'string' ? details.stderr : ''}`;\n return output.includes(SCHEMA_PLAN_DRIFT_OUTPUT_MARKER) ? SchemaPlanSyncState.DRIFTED : SchemaPlanSyncState.UNANSWERABLE;\n}\n\n// `DesignTokenBlockState` is declared in `@wildo-ai/platform-core-shared` since #2530: the workbench shows it on a step's record.\n\n/**\n * The line `wildo design-tokens validate` prints when, and only when, the block is stale. A COPY of\n * `DESIGN_TOKENS_STALE_BLOCK_OUTPUT_MARKER` in the CLI's `services/design-tokens/design-tokens.constants.ts`,\n * pinned to it by a source-parity test (the companion cannot import the CLI).\n */\nexport const DESIGN_TOKEN_BLOCK_STALE_OUTPUT_MARKER = 'design-token block is stale';\n\n/**\n * The line `validate` prints when the block is current. The positive answer is read from this text, never\n * from a zero exit code, so a check `validate` gains about something other than the block (a palette that\n * fails contrast) cannot turn a current block into an unanswerable one. A COPY of\n * `DESIGN_TOKENS_CURRENT_BLOCK_OUTPUT_MARKER`, pinned the same way.\n */\nexport const DESIGN_TOKEN_BLOCK_CURRENT_OUTPUT_MARKER = 'generated block is up to date';\n\n/**\n * The stylesheet `generate` rewrites, relative to its frontend root: the CLI writes `<frontend>/src/` +\n * `DESIGN_TOKENS_STYLESHEET_FILE_NAME`. Pinned by the parity test.\n */\nexport const DESIGN_TOKEN_STYLESHEET_FRONTEND_RELATIVE_PATH = 'src/index.css';\n\n/** Classify the combined output of a `validate` run, whatever its exit code. */\nexport function classifyDesignTokenValidateOutput(output: string): DesignTokenBlockState {\n if (output.includes(DESIGN_TOKEN_BLOCK_STALE_OUTPUT_MARKER)) return DesignTokenBlockState.STALE;\n if (output.includes(DESIGN_TOKEN_BLOCK_CURRENT_OUTPUT_MARKER)) return DesignTokenBlockState.CURRENT;\n return DesignTokenBlockState.UNANSWERABLE;\n}\n\n/**\n * The frontend directory (app-root relative) whose stylesheet the `design-tokens` step regenerates: the\n * one the DESIGN_SYSTEM surface's config lives in, read off the coding policy's own table. So the step\n * regenerates the stylesheet of exactly the config a DESIGN_SYSTEM task wrote, and an application with\n * several `SAAS_APP` frontends (where the CLI refuses to guess) still gets a definite answer.\n */\nexport function resolveDesignSystemFrontendDirectory(): string {\n const configFile = resolveFrontendConfigSurfaceFile(FrontendConfigSurface.DESIGN_SYSTEM);\n const suffix = `/${DESIGN_SYSTEM_CONFIG_FRONTEND_RELATIVE_PATH}`;\n if (!configFile.endsWith(suffix)) {\n throw new Error(\n `The DESIGN_SYSTEM frontend config surface names ${configFile}, which does not end in ${suffix}; `\n + 'the design-tokens step cannot tell which frontend that config belongs to.',\n );\n }\n return configFile.slice(0, -suffix.length);\n}\n\n/** The stylesheet the `design-tokens` step regenerates, app-root relative (`frontend/src/index.css`). */\nexport function resolveDesignTokenStylesheetPath(): string {\n return path.posix.join(resolveDesignSystemFrontendDirectory(), DESIGN_TOKEN_STYLESHEET_FRONTEND_RELATIVE_PATH);\n}\n\n// `BrandDesignState` is declared in `@wildo-ai/platform-core-shared` since #2530: the workbench shows it on a step's record.\n\n/** The generated brand design module, app-root relative (`frontend/src/config/brand-design.ts`). */\nexport function resolveBrandDesignPath(): string {\n return path.posix.join(resolveDesignSystemFrontendDirectory(), BRAND_DESIGN_FRONTEND_RELATIVE_PATH);\n}\n\n/**\n * Does this design-system config import the generated brand design module? A literal-text test of the config, on\n * purpose: the import is the only way the config can consume it, so a config naming the module depends on it whoever\n * wrote it.\n */\nexport function designSystemConfigImportsBrandDesign(configSource: string): boolean {\n return /from\\s+['\"]\\.\\/brand-design(?:\\.js|\\.ts)?['\"]/.test(configSource);\n}\n\n/**\n * Does the application's design-system config import the generated brand design module? The second half of when the\n * brand step is owed: a config an earlier build wrote that derives from the module must see a later rebrand even when\n * the current plan writes no config. False when the config cannot be read, which owes nothing: there is nothing to feed.\n */\nexport async function readDesignSystemConfigImportsBrandDesign(saasRoot: string): Promise<boolean> {\n try {\n return designSystemConfigImportsBrandDesign(await readFile(path.join(saasRoot, resolveFrontendConfigSurfaceFile(FrontendConfigSurface.DESIGN_SYSTEM)), 'utf8'));\n } catch {\n return false;\n }\n}\n\n/** The combined output a failed bounded subprocess carried, or '' when it carried none. */\nfunction subprocessFailureOutput(error: unknown): string {\n const details = (error as { details?: { stdout?: unknown; stderr?: unknown } } | null | undefined)?.details;\n return `${typeof details?.stdout === 'string' ? details.stdout : ''}\\n${typeof details?.stderr === 'string' ? details.stderr : ''}`;\n}\n\n/** A build plan referenced a generation step this companion cannot execute. Named, so the plan author sees the vocabulary. */\nexport class ApplicationBuildUnknownGenerationStepError extends Error {\n public constructor(taskRef: string, generationStepRef: string) {\n super(\n `Build task ${taskRef} references generation step \"${generationStepRef}\", which this companion cannot execute. `\n + `Known steps: ${Object.values(ApplicationBuildGenerationStep).join(', ')}.`,\n );\n }\n}\n\n/** What one executed i18n-labels step did — the pipeline's result, verbatim. */\nexport interface ApplicationBuildI18nLabelsStepRunResult {\n readonly generationStepRef: ApplicationBuildGenerationStep.I18N_LABELS;\n /** Primary-locale label generation (incremental — fresh units are skipped by the freshness lock). */\n readonly labellize: LabellizeRunResult;\n /** The app-root-relative files this step is responsible for — the same paths the landed check reads. */\n readonly evidencePaths: readonly string[];\n}\n\n/** What one executed i18n-translations step did — the pipeline's result, verbatim. */\nexport interface ApplicationBuildI18nTranslationsStepRunResult {\n readonly generationStepRef: ApplicationBuildGenerationStep.I18N_TRANSLATIONS;\n /** The locales it translated into: every enabled locale but the primary. */\n readonly targetLocales: readonly string[];\n /** Translation into those locales; absent when there were none (an authored step on a one-locale app). */\n readonly translate?: TranslateRunResult;\n /** The app-root-relative files this step is responsible for — the same paths the landed check reads. */\n readonly evidencePaths: readonly string[];\n}\n\n/** What one executed email-templates step did — the per-pipeline results, verbatim. */\nexport interface ApplicationBuildEmailTemplatesStepRunResult {\n readonly generationStepRef: ApplicationBuildGenerationStep.EMAIL_TEMPLATES;\n /** Primary-locale template + labels generation (incremental — existing template+labels pairs are skipped). */\n readonly emailGenerate: GenerateEmailTemplatesResult;\n /** Label translation into the other enabled locales; absent when the app enables only its primary locale. */\n readonly emailTranslate?: TranslateEmailTemplateLabelsResult;\n /** The app-root-relative files this step is responsible for — the same paths the landed check reads. */\n readonly evidencePaths: readonly string[];\n}\n\n/**\n * What one executed logo step did.\n *\n * `deliberation`/`accept` are absent when the step was SKIPPED because the application already has\n * an accepted mark — see the executor for why skipping is the incremental answer here rather than\n * the freshness lock the text pipelines use.\n */\nexport interface ApplicationBuildLogoStepRunResult {\n readonly generationStepRef: ApplicationBuildGenerationStep.LOGO;\n /** The expert-panel deliberation that derived directions, generated marks and picked a winner. */\n readonly deliberation?: LogoDeliberationResult;\n /** Promotion of that winner into `specifications/src/brand/` — images plus the rewritten SSOT. */\n readonly accept?: BrandAcceptResult;\n /** True when an accepted mark already existed and no model was called. */\n readonly skippedBecauseAlreadyAccepted: boolean;\n /**\n * The accepted mark copied to every surface that serves it — the app's public folder and runtime\n * config, the documentation portal, the website's icons and Open Graph image. Runs on BOTH branches:\n * a surface composed after the mark was accepted (a website added later) still receives it.\n */\n readonly propagation?: PropagateBrandAssetsOutcome;\n /** Why propagation could not run. Never fails the step: the mark is accepted either way. */\n readonly propagationError?: string;\n /** The app-root-relative files this step is responsible for — the same paths the landed check reads. */\n readonly evidencePaths: readonly string[];\n}\n\n/**\n * What one executed `database-migrations` step did.\n *\n * `evidencePaths` is present for symmetry with its siblings and carries the MUTATION SCOPE, not the\n * landed evidence — this step lands on `SCHEMA_PLAN_IN_SYNC`, never on a path.\n */\nexport interface ApplicationBuildDatabaseMigrationsStepRunResult {\n readonly generationStepRef: ApplicationBuildGenerationStep.DATABASE_MIGRATIONS;\n /** True when the plan was already in sync and `wildo db generate` had nothing to write. */\n readonly skippedBecauseAlreadyInSync: boolean;\n /** The migration folder names present after the run that were not present before it. Usually 0 or 1. */\n readonly generatedMigrationFolders: readonly string[];\n /** The generator's own output tail — it names the tables and the risk of each change. */\n readonly outputTail: string;\n /** MUTATION SCOPE, not landed evidence. */\n readonly evidencePaths: readonly string[];\n}\n\n/**\n * What one executed `documentation-publication` step did.\n *\n * `published` is the publish service's own report — output count and root — kept whole rather than\n * projected, because the step's value to a reader is \"what did it write\", and this lane has no\n * second opinion about that.\n */\nexport interface ApplicationBuildDocumentationPublicationStepRunResult {\n readonly generationStepRef: ApplicationBuildGenerationStep.DOCUMENTATION_PUBLICATION;\n /** The publish service's report. */\n readonly published: unknown;\n /** The rendered search index, which is both this step's mutation scope and its landed evidence. */\n readonly evidencePaths: readonly string[];\n}\n\n/** What one executed `design-tokens` step did. */\nexport interface ApplicationBuildDesignTokensStepRunResult {\n readonly generationStepRef: ApplicationBuildGenerationStep.DESIGN_TOKENS;\n /** The frontend directory the CLI was pointed at (app-root relative). */\n readonly frontendDirectory: string;\n /** False when the block was already current: `generate` then reports no change and writes nothing. */\n readonly regenerated: boolean;\n /** The CLI's own output tail. */\n readonly outputTail: string;\n /** The stylesheet: the step's mutation scope, and the file its landing requires committed. */\n readonly evidencePaths: readonly string[];\n}\n\n/** What one executed `design-system-brand` step did. */\nexport interface ApplicationBuildDesignSystemBrandStepRunResult {\n readonly generationStepRef: ApplicationBuildGenerationStep.DESIGN_SYSTEM_BRAND;\n /** The seeds written: the brand's first two colours, or the framework's neutral seeds when it names none. */\n readonly seeds: PaletteSeeds;\n /** False when the brand names no colour. */\n readonly fromBrand: boolean;\n /** Every move the derivation makes away from the brand's colours, with the reason — what a reviewer should know before accepting. */\n readonly adjustments: readonly PaletteDerivationAdjustment[];\n /** The point on the theme personality axes written: what the brand's style words select, or the default theme's point. */\n readonly personality: ThemePersonality;\n /** False when the brand states no style words. */\n readonly personalityFromBrand: boolean;\n /**\n * The website's palette and personality point, derived from the same visual tone, when the application declares a\n * website (#2597, #2742); absent without one.\n */\n readonly websiteTheme?: { readonly palette: WebsitePalette; readonly personality: WebsitePersonality };\n /** False when every module already said this, so nothing was written. */\n readonly rewritten: boolean;\n /** The generated modules: the step's whole mutation scope, and the files its landing requires committed. */\n readonly evidencePaths: readonly string[];\n}\n\n/** What one executed `engine-capabilities` step did (#2497): the foundation's own capability record, beside the paths it may write. */\nexport interface ApplicationBuildEngineCapabilitiesStepRunResult extends EngineCapabilityAlignmentResult {\n readonly generationStepRef: ApplicationBuildGenerationStep.ENGINE_CAPABILITIES;\n /** The application's configuration: the only file this step writes. */\n readonly evidencePaths: readonly string[];\n}\n\n/** What one executed `display-name` step did (#2505). */\nexport interface ApplicationBuildDisplayNameStepRunResult extends ApplicationDisplayNameResult {\n readonly generationStepRef: ApplicationBuildGenerationStep.DISPLAY_NAME;\n readonly evidencePaths: readonly string[];\n}\n\n/** One executed generation step's result, discriminated by the step it ran. */\nexport type ApplicationBuildGenerationStepRunResult =\n | ApplicationBuildI18nLabelsStepRunResult\n | ApplicationBuildI18nTranslationsStepRunResult\n | ApplicationBuildEmailTemplatesStepRunResult\n | ApplicationBuildLogoStepRunResult\n | ApplicationBuildDatabaseMigrationsStepRunResult\n | ApplicationBuildDocumentationPublicationStepRunResult\n | ApplicationBuildDesignTokensStepRunResult\n | ApplicationBuildDesignSystemBrandStepRunResult\n | ApplicationBuildEngineCapabilitiesStepRunResult\n | ApplicationBuildDisplayNameStepRunResult;\n\n/** A step's result with what its model calls spent (#2232) — what the step's row records. */\nexport type MeasuredGenerationStepRunResult = ApplicationBuildGenerationStepRunResult & { readonly spend: PlaybookSpend };\n\n/**\n * The identity allowlist for every `wildo` subprocess a generation step runs (`wildo db …`,\n * `wildo design-tokens …`).\n *\n * PATH is the load-bearing entry: the CLI is a GLOBAL install and is deliberately NOT linked into an\n * application's `node_modules/.bin` — verified on both dogfood applications — so it is reachable\n * only through PATH. Kept to the same minimal set the verification hook uses rather than passing the\n * companion's whole environment.\n */\nfunction buildCliSubprocessEnv(): NodeJS.ProcessEnv {\n const env: NodeJS.ProcessEnv = {};\n for (const key of ['PATH', 'HOME', 'USER', 'LOGNAME', 'SHELL', 'TERM']) {\n const value = process.env[key];\n if (value !== undefined) env[key] = value;\n }\n return env;\n}\n\n/** Migration folder names currently on disk (not the lockfile beside them). */\nfunction listMigrationFolders(saasRoot: string): readonly string[] {\n const migrationsRoot = path.join(saasRoot, 'backend-api', 'migrations');\n if (!existsSync(migrationsRoot)) return [];\n return readdirSync(migrationsRoot, { withFileTypes: true })\n .filter((entry) => entry.isDirectory())\n .map((entry) => entry.name)\n .sort();\n}\n\n/**\n * Execute companion-owned generation steps of a build plan, and answer which\n * files each step is responsible for.\n *\n * A `COMPANION_GENERATION_STEP` is deterministic in its ROUTING and its\n * PLACEMENT — which pipeline runs and where the files land is decided by\n * code, never by a coding agent (`application-build-task-coding-policy`\n * refuses to compose a coding contract for one). The CONTENT may still come\n * from a model (labels are generated text), which is exactly the directive's\n * bucket-3 shape: a companion-owned generation step interleaved by the build\n * loop.\n *\n * ## Landed evidence, and why it is planner-derived\n *\n * The build lane's landed answer is GIT: a task has landed when the files it\n * produces are committed. A generation step's target carries only its\n * `generationStepRef` — no paths — so the file set must be DERIVED. For\n * `i18n-labels` it is the labelling planner's unit inventory in the primary\n * locale, and for `i18n-translations` the same inventory crossed with every\n * other enabled locale: exactly the files the pipelines write, re-derivable\n * after a restart, a fresh clone, or a branch switch. Deliberately NOT the\n * whole i18n directory: that is already committed on any app with history, and\n * a directory-prefix check would report the step landed without it ever\n * having run for the units it still owes.\n */\n/**\n * The last schema-plan sync answer per application root, valid while its input signature holds.\n *\n * Module-level rather than per-instance so two service instances resolving landing concurrently — a\n * board read and a `/build/next` — share one 8-9 s subprocess instead of spawning two.\n */\nconst schemaPlanSyncStateCache = new Map<string, { signature: string; state: SchemaPlanSyncState }>();\n\n/** Answers still being computed, so concurrent callers at the same signature await one subprocess. */\nconst schemaPlanSyncStateInFlight = new Map<string, { signature: string | null; compute: Promise<SchemaPlanSyncState> }>();\n\n/**\n * The files that decide the schema-plan sync answer: the compiled MODEL and the ACCEPTED PLAN.\n *\n * Exported so the freshness loop below signs exactly what the resolver signs. Two copies of this list\n * would let the loop refresh on a change the resolver ignores, or miss one it honours.\n */\nexport function signSchemaPlanInputs(saasRoot: string): string | null {\n return signDerivedInputs(\n [path.join(saasRoot, 'backend-api', 'dist'), path.join(saasRoot, 'infrastructure'), ...resolveEngineDistRoots(saasRoot)],\n [path.join(saasRoot, SCHEMA_PLAN_LOCKFILE_RELATIVE_PATH)],\n );\n}\n\n/**\n * The compiled ENGINE the backend resolves: every `@wildo-ai/*` package's `dist` under\n * `backend-api/node_modules`. The engine declares resources (the planner plans them) and owns the\n * planner, so an engine change moves the schema plan without touching either app-local input.\n *\n * Signed since 2026-09-25. It used to be the one unsigned input, on the premise that an engine change\n * respawns the companion and empties this cache. On scratch-journey the companion ran from 12:20Z\n * while engine resources landed in the app's injected snapshot at 13:04Z and 13:41Z: its supervisor\n * was paused and did not restart it. The cache kept answering IN_SYNC, and the build plan reported the\n * migrations step LANDED with 16 changes owed. Walking all six packages there costs about 80 ms,\n * against about 8.5 s to re-derive. The enumeration is total, so a package that starts declaring\n * resources is covered the day it does.\n */\nfunction resolveEngineDistRoots(saasRoot: string): readonly string[] {\n const scope = path.join(saasRoot, 'backend-api', 'node_modules', '@wildo-ai');\n if (!existsSync(scope)) return [];\n return readdirSync(scope)\n .sort()\n .map((name) => path.join(scope, name, 'dist'))\n .filter((dist) => existsSync(dist));\n}\n\n/**\n * The cached schema-plan sync answer for one application root.\n *\n * Module-level rather than a class member because it never used instance state, and because the\n * COMPANION BOOT path warms it (`startIntrospectionFreshnessPlane`). Reaching it through the service\n * would drag the labelling, email and brand service graph into the boot graph to answer a question\n * about two files — and a boot path that fails closed needs the companion it just stopped\n * (`continuity-drift-and-cas-basis.md` Rule 3).\n */\nexport async function resolveSchemaPlanSyncState(saasRoot: string): Promise<SchemaPlanSyncState> {\n /*\n * The answer costs a `wildo db diff --check` SUBPROCESS, which boots the CLI and imports the\n * application's compiled modules registry: measured 8-14 s on `examples/wonder-todos`, 2026-09-18,\n * of which ~5.5 s is the registry import alone. It is asked on every landing resolution — so on\n * every creation-board refresh and every `/build/next` — and it was the single largest remaining\n * cost of both.\n *\n * Nothing about that answer can change unless the MODEL or the ACCEPTED PLAN changes, and both are\n * files. So it is re-derived when they move and reused when they do not: ~17 ms to sign against\n * ~8500 ms to re-run. A TTL is not used here for the same reason the specifications loader has\n * none — this state decides whether the migration step is offered, so drift must surface at the\n * next read rather than at the next expiry.\n *\n * The ENGINE reaches the application through node_modules rather than through either app-local path,\n * so its compiled packages are signed as well (see `resolveEngineDistRoots`). This used to rely on an\n * engine change respawning the companion; one survived an engine change on 2026-09-25 and served a\n * stale IN_SYNC. The answer is still NOT persisted to disk across restarts (#1350).\n */\n const signature = signSchemaPlanInputs(saasRoot);\n if (signature !== null) {\n const cached = schemaPlanSyncStateCache.get(saasRoot);\n if (cached?.signature === signature) return cached.state;\n const inFlight = schemaPlanSyncStateInFlight.get(saasRoot);\n if (inFlight?.signature === signature) return inFlight.compute;\n }\n\n const compute = computeSchemaPlanSyncState(saasRoot);\n schemaPlanSyncStateInFlight.set(saasRoot, { signature, compute });\n try {\n const state = await compute;\n if (signature !== null) schemaPlanSyncStateCache.set(saasRoot, { signature, state });\n return state;\n } finally {\n // A failed derivation caches nothing, so the next caller retries rather than inheriting it.\n if (schemaPlanSyncStateInFlight.get(saasRoot)?.compute === compute) {\n schemaPlanSyncStateInFlight.delete(saasRoot);\n }\n }\n}\n\nasync function computeSchemaPlanSyncState(saasRoot: string): Promise<SchemaPlanSyncState> {\n const { obligation } = await assessApplicationSchemaPlanObligation(saasRoot);\n if (obligation === ApplicationSchemaPlanObligation.NOT_OWED || obligation === ApplicationSchemaPlanObligation.UNDETERMINED) {\n return SchemaPlanSyncState.UNANSWERABLE;\n }\n if (!existsSync(path.join(saasRoot, MODULES_REGISTRY_RELATIVE_PATH))) return SchemaPlanSyncState.UNANSWERABLE;\n if (obligation === ApplicationSchemaPlanObligation.BASELINE_OWED) {\n /*\n * No baseline yet, so the whole model is ungenerated: that is DRIFT, and the step has work. But\n * `diff --check` refuses outright without a lockfile, so it cannot tell drift from could-not-ask\n * here. Plain `wildo db diff` can: it computes the model (refusing a stale or unloadable one, #403)\n * and, with no lockfile, reports the table count and succeeds. Only a computable model is drift.\n */\n try {\n await executeBoundedSubprocess({\n command: 'wildo',\n args: ['db', 'diff'],\n cwd: saasRoot,\n env: buildCliSubprocessEnv(),\n timeoutMs: MIGRATION_GENERATION_TIMEOUT_MS,\n });\n return SchemaPlanSyncState.DRIFTED;\n } catch {\n return SchemaPlanSyncState.UNANSWERABLE;\n }\n }\n try {\n await executeBoundedSubprocess({\n command: 'wildo',\n args: ['db', 'diff', '--check'],\n cwd: saasRoot,\n env: buildCliSubprocessEnv(),\n timeoutMs: MIGRATION_GENERATION_TIMEOUT_MS,\n });\n return SchemaPlanSyncState.IN_SYNC;\n } catch (error) {\n // Drift is named in the CLI's own output; an absent CLI or a runner that could not import the\n // registry is not, and must not put the step at the head of the queue.\n return classifySchemaPlanCheckFailure(error);\n }\n}\n\n/** The last design-token block answer per application root, valid while its input signature holds. Module-level for the reason {@link schemaPlanSyncStateCache} is. */\nconst designTokenBlockStateCache = new Map<string, { signature: string; state: DesignTokenBlockState }>();\n\n/** Answers still being computed, so concurrent landing reads at one signature share one subprocess. */\nconst designTokenBlockStateInFlight = new Map<string, { signature: string | null; compute: Promise<DesignTokenBlockState> }>();\n\n/**\n * The files that decide whether the design-token block is current.\n *\n * - The frontend's whole `src/` tree: the stylesheet itself, the config, and anything the config imports\n * from beside it (an application may keep token values in a module next to the config). 107 files on\n * `examples/wonder-todos`, signed in ~25 ms warm.\n * - The `@wildo-ai/presets-components-models` build the frontend resolves: it owns the default tokens the\n * config spreads and the stylesheet generator, so an engine change can move the expected block with no\n * edit in the application. Only that package, not every engine package under `node_modules`: the other\n * seven hold ~8,000 files (~200–500 ms warm) and none of them feeds the stylesheet (`theme` is runtime\n * behaviour, never CSS).\n *\n * Not signed: the CLI's own copy of the generator, which is a global install. `wildo update` moves it and\n * the application's engine together, so the signed engine build moves too; in framework development an\n * engine change respawns the companion, which empties this cache. Erring toward a re-derivation is always\n * safe here, a missed input is not, so widen this list before narrowing it.\n */\nexport function signDesignTokenBlockInputs(saasRoot: string): string | null {\n const frontendRoot = path.join(saasRoot, resolveDesignSystemFrontendDirectory());\n return signDerivedInputs([\n path.join(frontendRoot, 'src'),\n path.join(frontendRoot, 'node_modules', '@wildo-ai', 'presets-components-models', 'dist'),\n ]);\n}\n\n/**\n * Is the frontend's generated design-token block current against its design-system config?\n *\n * Asked of `wildo design-tokens validate`, the same CLI door the step's execution writes through, and\n * deliberately not re-derived in this process. The companion's own generator is a different copy from the\n * global CLI's; if the two ever disagreed, the step would write one block and land on another, and a\n * generation step is exempt from the loop guard, so it would be re-offered forever. One door on both sides\n * cannot disagree with itself.\n *\n * Cached by input signature, never by TTL, for the reason {@link resolveSchemaPlanSyncState} is: the\n * question costs a subprocess (~14 s on Wonder Todos) and is asked on every landing resolution, while its\n * inputs are files that rarely move between two reads.\n */\nexport async function resolveDesignTokenBlockState(saasRoot: string): Promise<DesignTokenBlockState> {\n const signature = signDesignTokenBlockInputs(saasRoot);\n if (signature !== null) {\n const cached = designTokenBlockStateCache.get(saasRoot);\n if (cached?.signature === signature) return cached.state;\n const inFlight = designTokenBlockStateInFlight.get(saasRoot);\n if (inFlight?.signature === signature) return inFlight.compute;\n }\n\n const compute = computeDesignTokenBlockState(saasRoot);\n designTokenBlockStateInFlight.set(saasRoot, { signature, compute });\n try {\n const state = await compute;\n if (signature !== null) designTokenBlockStateCache.set(saasRoot, { signature, state });\n return state;\n } finally {\n // A failed derivation caches nothing, so the next caller retries rather than inheriting it.\n if (designTokenBlockStateInFlight.get(saasRoot)?.compute === compute) {\n designTokenBlockStateInFlight.delete(saasRoot);\n }\n }\n}\n\nasync function computeDesignTokenBlockState(saasRoot: string): Promise<DesignTokenBlockState> {\n try {\n const result = await executeBoundedSubprocess({\n command: 'wildo',\n args: ['design-tokens', 'validate', resolveDesignSystemFrontendDirectory()],\n cwd: saasRoot,\n env: buildCliSubprocessEnv(),\n timeoutMs: DESIGN_TOKENS_CLI_TIMEOUT_MS,\n });\n return classifyDesignTokenValidateOutput(`${result.stdout}\\n${result.stderr}`);\n } catch (error) {\n // A stale block is named in the CLI's own output; an absent CLI, a timeout or a config that does not\n // load is not, and must not put the step at the head of the queue.\n return classifyDesignTokenValidateOutput(subprocessFailureOutput(error));\n }\n}\n\n/**\n * Whether a generation step's output rests on the specifications package (#3258). Every step but the migration step, which\n * plans from the compiled registry: a failing specifications module says nothing about what that needs, and `wildo db`\n * refuses a stale build on its own account.\n */\nexport function generationStepReadsSpecifications(generationStepRef: string): boolean {\n return generationStepRef !== ApplicationBuildGenerationStep.DATABASE_MIGRATIONS;\n}\n\n/**\n * Which landing checks read the specifications package, so cannot answer while a module fails (#3258). The others answer\n * from git or a file: \"not committed\" or \"no accepted logo\" is a true \"no\" whatever the package does. Total over the\n * kinds, so a new check has to say which it is. `NOT_OWED` is itself derived from the package, for the display-name and\n * capabilities steps among others; it is `false` here only because the landing pass has already landed such a step, so the\n * hold never asks about it. A short read can therefore land a step as owing nothing, with no mark. No write follows from it.\n */\nconst LANDING_CHECK_READS_SPECIFICATIONS: Readonly<Record<ApplicationBuildGenerationStepLandedKind, boolean>> = {\n [ApplicationBuildGenerationStepLandedKind.COMMITTED_PATHS]: false,\n [ApplicationBuildGenerationStepLandedKind.SCHEMA_PLAN_IN_SYNC]: false,\n [ApplicationBuildGenerationStepLandedKind.NOT_OWED]: false,\n [ApplicationBuildGenerationStepLandedKind.DESIGN_TOKEN_BLOCK_CURRENT]: false,\n [ApplicationBuildGenerationStepLandedKind.ACCEPTED_BRAND_MARK]: false,\n [ApplicationBuildGenerationStepLandedKind.BRAND_DESIGN_CURRENT]: true,\n [ApplicationBuildGenerationStepLandedKind.ENGINE_CAPABILITIES_ENABLED]: true,\n [ApplicationBuildGenerationStepLandedKind.LABEL_PLAN_INCOMPLETE]: true,\n [ApplicationBuildGenerationStepLandedKind.LANDED_PROBES]: true,\n [ApplicationBuildGenerationStepLandedKind.DISPLAY_NAME_APPLIED]: true,\n [ApplicationBuildGenerationStepLandedKind.INPUT_UNREADABLE]: true,\n};\n\n/** See {@link LANDING_CHECK_READS_SPECIFICATIONS}. */\nexport function generationStepCheckReadsSpecifications(kind: ApplicationBuildGenerationStepLandedKind): boolean {\n return LANDING_CHECK_READS_SPECIFICATIONS[kind];\n}\n\n/** The brand's visual tone out of an evaluation's exports. See `readBrandVisualTone`. */\nfunction projectBrandVisualTone(specifications: unknown): BrandDesignInputs {\n const exports = specifications as {\n brandSpecification?: { visualTone?: { colorSeeds?: unknown; styleKeywords?: unknown; mood?: unknown } };\n } | undefined;\n const visualTone = exports?.brandSpecification?.visualTone;\n const colorSeeds = visualTone?.colorSeeds ?? [];\n const styleKeywords = visualTone?.styleKeywords ?? [];\n const mood = visualTone?.mood;\n const isStringList = (value: unknown): value is readonly string[] => Array.isArray(value) && value.every((entry) => typeof entry === 'string');\n if (!isStringList(colorSeeds) || !isStringList(styleKeywords) || (mood !== undefined && typeof mood !== 'string')) {\n throw new Error('the brand\\'s visual tone does not carry lists of colour seeds and style keywords');\n }\n return { colorSeeds: [...colorSeeds], styleKeywords: [...styleKeywords], ...(typeof mood === 'string' ? { mood } : {}) };\n}\n\n@injectable()\nexport class ApplicationBuildGenerationStepCompanionService {\n private readonly logDebug: (message: string, context?: Record<string, unknown>) => void;\n /** The running step of each task, by task ref — runtime state only, see {@link GenerationStepProgress}. */\n private readonly progressByTaskRef = new Map<string, GenerationStepProgressTracker>();\n\n public constructor(\n @inject(SAAS_SERVICE_TYPES.Logger) private readonly logger: LoggerService,\n @inject(SAAS_SERVICE_TYPES.AppConfigService) private readonly appConfigService: AppConfigurationService,\n @inject(COMPANION_SERVICE_TYPES.CompanionContext) private readonly companionContext: CompanionContext,\n @inject(COMPANION_SERVICE_TYPES.LabellingPlannerService) private readonly planner: LabellingPlannerCompanionService,\n @inject(COMPANION_SERVICE_TYPES.LabellizeOrchestratorService) private readonly labellize: LabellizeOrchestratorCompanionService,\n @inject(COMPANION_SERVICE_TYPES.TranslateOrchestratorService) private readonly translate: TranslateOrchestratorCompanionService,\n @inject(COMPANION_SERVICE_TYPES.EmailTemplateService) private readonly emailTemplates: EmailTemplateCompanionService,\n @inject(COMPANION_SERVICE_TYPES.LogoDeliberationService) private readonly logoDeliberation: LogoDeliberationCompanionService,\n @inject(COMPANION_SERVICE_TYPES.BrandAcceptService) private readonly brandAccept: BrandAcceptCompanionService,\n @inject(COMPANION_SERVICE_TYPES.TechnicalDocService) private readonly technicalDoc: TechnicalDocCompanionService,\n // The capability derivation the foundation step owns (#2497): one derivation for both lanes.\n @inject(COMPANION_SERVICE_TYPES.FoundationExecutorService) private readonly foundationExecutor: FoundationExecutorCompanionService,\n /*\n * What each step's model calls spent (#2232): a labels or translations pass is model calls, and nothing\n * recorded them when the step ran outside a playbook. Optional so a harness that builds this service\n * positionally need not hand one in; without it a step's spend is NOT OBSERVED, never zero.\n */\n @inject(COMPANION_SERVICE_TYPES.PlaybookSpendMeter) @optional() private readonly spendMeter?: PlaybookSpendMeterCompanionService,\n ) {\n this.logDebug = this.logger.debugByType('ApplicationBuildGenerationStep');\n }\n\n /** What each executed step spent, by the task object it ran — read by the step's row writer (`spentByGenerationStep`). */\n private readonly stepSpendByTask = new WeakMap<BuildPlanTask, PlaybookSpend>();\n\n /**\n * What the generation step last executed for `task` spent (#2232), however it ended — for its row when the run\n * ends FAILED. Keyed by the TASK the dispatcher handed in, not by the thrown error: the step can succeed and\n * something after it still throw (the acceptance commit, a lost file lock), and the step's spend is real either\n * way. `undefined` when no step ran for that task object.\n */\n public spentByGenerationStep(task: BuildPlanTask): PlaybookSpend | undefined {\n return this.stepSpendByTask.get(task);\n }\n\n /**\n * The app-root-relative files this task's generation step is responsible\n * for. The landed check treats the task as landed when EVERY one of them is\n * committed — same doctrine as every coding task, same reader\n * (`isWorktreePathCommitted`).\n */\n public async resolveGenerationStepEvidencePaths(task: BuildPlanTask): Promise<readonly string[]> {\n const generationStepRef = this.requireGenerationStepRef(task);\n switch (generationStepRef) {\n case ApplicationBuildGenerationStep.I18N_LABELS:\n return this.resolveLabelUnitPaths([getCompanionConfiguredPrimaryLanguage(this.appConfigService.config)]);\n case ApplicationBuildGenerationStep.I18N_TRANSLATIONS:\n // Every unit in every TARGET locale. Empty on a one-locale application, which is why the host\n // derives this step only when there is a target (an empty list never lands).\n return this.resolveLabelUnitPaths(this.resolveTranslationTargetLocales());\n case ApplicationBuildGenerationStep.EMAIL_TEMPLATES:\n // Placement is the email domain's authority; this lane only crosses it with the enabled locales.\n return this.emailTemplates.resolveExpectedArtifactRelativePaths(this.resolveEnabledLocales());\n case ApplicationBuildGenerationStep.LOGO:\n /*\n * The SSOT MODULE, the file the step rewrites — its write scope and the place a landing is reported\n * \"found in\". NOT its landing proof: `wildo init` scaffolds this module with an empty asset list, so it\n * exists and is committed before the step runs (#2410). Landing is the `ACCEPTED_BRAND_MARK` condition,\n * which reads the module's content (see `resolveGenerationStepLandedCondition`).\n */\n return [BRAND_RESOLVED_ASSETS_MODULE_PATH];\n case ApplicationBuildGenerationStep.DOCUMENTATION_PUBLICATION:\n /*\n * The publication's render-output manifest, which only the publish writes (`synchronizeGeneratedTree`).\n *\n * Honest evidence by the same test {@link LOGO} passes and `DATABASE_MIGRATIONS` fails: this file exists ONLY\n * as a consequence of this step's work, and the portal already reads it as the sign that a publication exists\n * (`scripts/wait-for-publication.mjs`, `src/generated-consumer-documentation.ts`).\n *\n * It was the search index (`indexes/search.json`) until reference run 42186980114 (#3204). The search page\n * imports that index, and the companion refuses a commit that leaves an import nothing holds (#2332), so the\n * foundation could never commit the portal it composed and the build stopped. The `add-technical-doc` scenario\n * now ships both indexes EMPTY, which makes the index exist BEFORE this step: kept as the evidence, the step\n * would have counted as landed on the foundation's commit and never run.\n *\n * Deliberately not the `docusaurus/` output tree: the rendered page set is named after whichever chapters the\n * plan carries, so it cannot be derived BEFORE the step runs, and evidence that cannot be derived in advance is\n * not evidence. Its directory is also this step's writable root (`EVIDENCE_DIRECTORIES`), which now covers the\n * whole consumer-documentation tree the publish writes.\n */\n return [path.posix.join('technical-doc', 'src', 'generated', 'consumer-documentation', 'render-output-manifest.json')];\n case ApplicationBuildGenerationStep.DATABASE_MIGRATIONS:\n /*\n * ⚠ MUTATION SCOPE ONLY — this path is NOT this step's landed evidence, and using it as\n * such would be the defect the landed-kind vocabulary above exists to prevent: the lockfile\n * already exists before the step runs, so a landed check over it passes having verified\n * nothing.\n *\n * It is named here because `resolveGenerationStepWritableRoots` derives the task's writable roots\n * from these paths' DIRECTORIES (the step is `EVIDENCE_DIRECTORIES` in {@link GENERATION_STEP_WRITE_SCOPE}),\n * and `backend-api/migrations/` is exactly right: the step writes the\n * new migration folder and rewrites the lockfile, and nothing else.\n *\n * `resolveGenerationStepLandedCondition` is the only landed authority, and for this step it\n * answers SCHEMA_PLAN_IN_SYNC.\n */\n return [SCHEMA_PLAN_LOCKFILE_RELATIVE_PATH];\n case ApplicationBuildGenerationStep.DESIGN_TOKENS:\n /*\n * The stylesheet the step rewrites: its whole mutation scope, and the file its landing requires\n * committed. NOT sufficient landed evidence on its own — it is committed in every scaffolded\n * application before the step runs — which is why `resolveGenerationStepLandedCondition` answers\n * DESIGN_TOKEN_BLOCK_CURRENT for this step rather than COMMITTED_PATHS.\n */\n return [resolveDesignTokenStylesheetPath()];\n case ApplicationBuildGenerationStep.DESIGN_SYSTEM_BRAND:\n /*\n * The generated modules (the frontend's, and the website's when one is declared): the step's whole mutation\n * scope, and the files its landing requires committed. Not sufficient landed evidence on their own once a\n * first build has committed them, which is why the landed condition is BRAND_DESIGN_CURRENT rather than\n * COMMITTED_PATHS.\n */\n return this.resolveBrandDesignModulePaths();\n case ApplicationBuildGenerationStep.ENGINE_CAPABILITIES:\n // The mutation scope; landing is ENGINE_CAPABILITIES_ENABLED, which reads what the file says.\n return [SAAS_CONFIG_FILE_NAME];\n case ApplicationBuildGenerationStep.DISPLAY_NAME:\n // The mutation scope: the config and every file a template rendered the name into. Landing reads the config.\n return [SAAS_CONFIG_FILE_NAME, ...listDisplayNameBearingPaths({ applicationRoot: this.companionContext.saasRoot, frameworkRoot: this.frameworkRoot() })];\n default:\n throw new ApplicationBuildUnknownGenerationStepError(task.taskRef, generationStepRef);\n }\n }\n\n /**\n * The paths this task's generation step may write, as the dispatch plan's `allowedPathPrefixes` — and\n * therefore what a shared-window claim (#2240) reads when the step SHARED the tree with concurrent coding runs:\n * a directory root is claimed, an exact file never is (the wave-end reconciliation commits it, see\n * `claimGenerationStepOwnedPaths`). The ONE place they are computed: the dispatch host calls this and derives\n * nothing itself.\n *\n * Read off {@link GENERATION_STEP_WRITE_SCOPE}:\n * - `EVIDENCE_DIRECTORIES`: the directory of each evidence path, for a step whose output is a tree it alone\n * writes (label units, the brand module, the published documentation index, the migrations directory).\n * A file at the application root is its own root, because its directory is the whole tree (#2497).\n * - `EVIDENCE_FILES`: each evidence file itself, for a step whose output sits where other tasks also write\n * (the stylesheet and the brand design module in `frontend/src/`, the website's colours in `website/src/`,\n * the configuration file, the files carrying\n * the display name). Scoping it to the directory would let it commit a concurrent coding run's half-written\n * files under this step's name; a full file path allows exactly that file, the coding policy's own convention.\n *\n * A step ref the vocabulary does not know gets the narrower answer, its files. Defence in depth only:\n * `resolveGenerationStepEvidencePaths` already throws `ApplicationBuildUnknownGenerationStepError` for one.\n */\n public async resolveGenerationStepWritableRoots(task: BuildPlanTask): Promise<readonly string[]> {\n const evidencePaths = await this.resolveGenerationStepEvidencePaths(task);\n const scope = (GENERATION_STEP_WRITE_SCOPE as Readonly<Partial<Record<string, GenerationStepWriteScope>>>)[this.requireGenerationStepRef(task)]\n ?? GenerationStepWriteScope.EVIDENCE_FILES;\n return [...new Set(evidencePaths.map((evidencePath) => {\n const directory = evidencePath.split('/').slice(0, -1).join('/');\n return scope === GenerationStepWriteScope.EVIDENCE_FILES || directory === '' ? evidencePath : `${directory}/`;\n }))].sort();\n }\n\n /**\n * What this task's generation step reads in the application's tree ({@link GENERATION_STEP_READ_ROOTS}, #3709), or\n * `undefined` for a step ref the vocabulary does not know: the caller then reads every path outside the step's write\n * scope as an input, the rule before #3709, rather than holding a step on a guess. Translations read the primary\n * locale's label units, taken from the labels step's own evidence, and the configuration's locale set.\n */\n public async resolveGenerationStepReadRoots(task: BuildPlanTask): Promise<readonly string[] | undefined> {\n const generationStepRef = this.requireGenerationStepRef(task);\n if (!(Object.values(ApplicationBuildGenerationStep) as string[]).includes(generationStepRef)) return undefined;\n const declared = GENERATION_STEP_READ_ROOTS[generationStepRef as ApplicationBuildGenerationStep];\n if (declared !== undefined) return declared;\n const primaryUnits = await this.resolveLabelUnitPaths([getCompanionConfiguredPrimaryLanguage(this.appConfigService.config)]);\n return [...new Set([...primaryUnits, SAAS_CONFIG_FILE_NAME])].sort();\n }\n\n /**\n * How this task proves it landed — the ONLY landed authority for a generation step.\n *\n * Split from {@link resolveGenerationStepEvidencePaths} because that method answers a different\n * question (which paths may this task write?) and the two answers diverge for exactly one step.\n * Reading landing off the evidence paths would land the migration step on a file that predates it.\n */\n public async resolveGenerationStepLandedCondition(\n task: BuildPlanTask,\n ): Promise<ApplicationBuildGenerationStepLandedCondition> {\n const generationStepRef = this.requireGenerationStepRef(task);\n if (generationStepRef === ApplicationBuildGenerationStep.DATABASE_MIGRATIONS) {\n return { kind: ApplicationBuildGenerationStepLandedKind.SCHEMA_PLAN_IN_SYNC };\n }\n if (generationStepRef === ApplicationBuildGenerationStep.DESIGN_TOKENS) {\n return { kind: ApplicationBuildGenerationStepLandedKind.DESIGN_TOKEN_BLOCK_CURRENT, stylesheetPath: resolveDesignTokenStylesheetPath() };\n }\n if (generationStepRef === ApplicationBuildGenerationStep.DESIGN_SYSTEM_BRAND) {\n return { kind: ApplicationBuildGenerationStepLandedKind.BRAND_DESIGN_CURRENT, modulePaths: this.resolveBrandDesignModulePaths() };\n }\n if (generationStepRef === ApplicationBuildGenerationStep.I18N_TRANSLATIONS && this.resolveTranslationTargetLocales().length === 0) {\n return { kind: ApplicationBuildGenerationStepLandedKind.NOT_OWED };\n }\n if (generationStepRef === ApplicationBuildGenerationStep.LOGO) {\n return { kind: ApplicationBuildGenerationStepLandedKind.ACCEPTED_BRAND_MARK, modulePath: BRAND_RESOLVED_ASSETS_MODULE_PATH };\n }\n if (generationStepRef === ApplicationBuildGenerationStep.I18N_LABELS) {\n // ONE plan per call: the blocking check and the probes are read off the same plan.\n const plan = await this.planner.planAllUnitsWithCompleteness();\n const blocking = plan.incompleteness\n .filter((entry) => entry.reason !== LabellingPlanIncompletenessReason.RESOURCE_REGISTRY_STALE && LABEL_PLAN_BLOCKING_INCOMPLETENESS.has(entry.reason));\n // A stale registry names the units it hides, and the probes below count them; an unreadable plan cannot.\n if (blocking.length > 0) {\n return { kind: ApplicationBuildGenerationStepLandedKind.LABEL_PLAN_INCOMPLETE, detail: blocking.map((entry) => entry.detail).join(' ') };\n }\n /*\n * A unit planned from a family that could not answer is REFUSED by the labelling run (`incompletePlanRefusal`), so\n * its keys cannot arrive however often the step runs, and its probe would stay unmet with no stated cause (#2504\n * review L1). The run is still allowed (it writes every other unit); landing names why it waits, like the reasons\n * that refuse the run outright.\n */\n const refusedReasons = new Set(plan.units.flatMap((unit) => unit.plannedFromIncompleteInputs ?? []));\n if (refusedReasons.size > 0) {\n const refusedUnitCount = plan.units.filter((unit) => (unit.plannedFromIncompleteInputs?.length ?? 0) > 0).length;\n const causes = plan.incompleteness.filter((entry) => refusedReasons.has(entry.reason)).map((entry) => entry.detail);\n return {\n kind: ApplicationBuildGenerationStepLandedKind.LABEL_PLAN_INCOMPLETE,\n detail: `${refusedUnitCount} labelling unit(s) are refused until their inputs answer: ${causes.length > 0 ? causes.join(' ') : [...refusedReasons].join(', ')}`,\n };\n }\n return { kind: ApplicationBuildGenerationStepLandedKind.LANDED_PROBES, probes: this.labelPlanProbes(plan, getCompanionConfiguredPrimaryLanguage(this.appConfigService.config)) };\n }\n if (generationStepRef === ApplicationBuildGenerationStep.DISPLAY_NAME) {\n let brandName: string | undefined;\n try {\n brandName = await this.readLandedBrandName();\n } catch (error) {\n // Unknown is not \"no brand\" (#2694): owing nothing would land the step without running it.\n return {\n kind: ApplicationBuildGenerationStepLandedKind.INPUT_UNREADABLE,\n detail: `The brand could not be read, so whether the application owes its name is unknown: ${describeCaughtError(error)}`,\n };\n }\n if (brandName === undefined) return { kind: ApplicationBuildGenerationStepLandedKind.NOT_OWED };\n return { kind: ApplicationBuildGenerationStepLandedKind.DISPLAY_NAME_APPLIED, configPath: SAAS_CONFIG_FILE_NAME, displayName: brandName };\n }\n if (generationStepRef === ApplicationBuildGenerationStep.ENGINE_CAPABILITIES) {\n let satisfiable: Awaited<ReturnType<FoundationExecutorCompanionService['deriveSatisfiableEngineCapabilityPlan']>>;\n try {\n satisfiable = await this.foundationExecutor.deriveSatisfiableEngineCapabilityPlan();\n } catch (error) {\n // Unknown is not \"nothing derivable\" (#3258): an unreadable plan owing nothing would land the step without running it.\n return {\n kind: ApplicationBuildGenerationStepLandedKind.INPUT_UNREADABLE,\n detail: `What decides the engine capabilities could not be read, so whether any is owed is unknown: ${describeCaughtError(error)}`,\n };\n }\n // Nothing derivable is nothing owed; an empty list would otherwise land trivially, which is the same answer said honestly.\n if (satisfiable === undefined || satisfiable.capabilities.length === 0) return { kind: ApplicationBuildGenerationStepLandedKind.NOT_OWED };\n return { kind: ApplicationBuildGenerationStepLandedKind.ENGINE_CAPABILITIES_ENABLED, configPath: SAAS_CONFIG_FILE_NAME, capabilities: satisfiable.capabilities };\n }\n return {\n kind: ApplicationBuildGenerationStepLandedKind.COMMITTED_PATHS,\n paths: await this.resolveGenerationStepEvidencePaths(task),\n };\n }\n\n /**\n * Does this application owe migrations, and has it accepted a schema plan yet?\n *\n * The population the `database-migrations` step belongs to, and the fact the dispatch host derives\n * that step from when a build plan omits it (#1027). It reads BOTH the lockfile and the authored\n * `applicationDatabase.engine` (#1144). The lockfile alone was the marker until then, on the premise\n * that the foundation playbook writes a PostgreSQL application's baseline — it never did, so a\n * journey-built PostgreSQL application had no lockfile, was offered no migration step, and booted\n * into tables nothing had created. See {@link ApplicationSchemaPlanObligation}.\n */\n public async assessSchemaPlanObligation(): Promise<ApplicationSchemaPlanObligationAssessment> {\n return assessApplicationSchemaPlanObligation(this.companionContext.saasRoot);\n }\n\n /**\n * Does the resource model agree with the accepted schema plan — and if not, is that DRIFT, or could the\n * question not be asked? See {@link SchemaPlanSyncState} for why those two must never be merged.\n *\n * Only IN_SYNC lands the migration step, so an unknown answer can never land a task that generated\n * nothing. Re-running over a clean plan is harmless (`wildo db generate` reports nothing to generate);\n * running it where the check is unanswerable only throws, which is why the caller passes over it.\n */\n public async readSchemaPlanSyncState(): Promise<SchemaPlanSyncState> {\n return resolveSchemaPlanSyncState(this.companionContext.saasRoot);\n }\n\n /**\n * Is the frontend's generated design-token block current against its design-system config — and if\n * not, is it STALE, or could the question not be asked? See {@link DesignTokenBlockState}.\n */\n public async readDesignTokenBlockState(): Promise<DesignTokenBlockState> {\n return resolveDesignTokenBlockState(this.companionContext.saasRoot);\n }\n\n /**\n * Does every module the step writes (the frontend's brand design, and the website's colours when a website is\n * declared) say what the brand's visual tone now renders? See {@link BrandDesignState}.\n *\n * Not cached here: the visual tone comes from the specifications evaluation, which is cached against the signature of\n * the package it evaluates, so an unchanged brand costs a cache read and a changed one re-derives.\n */\n public async readBrandDesignState(): Promise<BrandDesignState> {\n let inputs: BrandDesignInputs;\n try {\n inputs = await this.readBrandVisualTone();\n } catch (error) {\n this.logDebug('The brand design state could not be decided: the brand visual tone could not be read', { error: describeCaughtError(error) });\n return BrandDesignState.UNANSWERABLE;\n }\n let expected: Array<{ readonly modulePath: string; readonly source: string }>;\n try {\n expected = this.renderBrandDesignModules(inputs).map(({ modulePath, source }) => ({ modulePath, source }));\n } catch (error) {\n this.logDebug('The brand design state could not be decided: the brand colour seeds do not derive', { error: describeCaughtError(error) });\n return BrandDesignState.UNANSWERABLE;\n }\n // CURRENT only when EVERY module the step writes says what the brand renders: the website's included (#2597).\n for (const { modulePath, source } of expected) {\n const written = await readFile(path.join(this.companionContext.saasRoot, modulePath), 'utf8').catch(() => undefined);\n if (written !== source) return BrandDesignState.STALE;\n }\n return BrandDesignState.CURRENT;\n }\n\n /**\n * The website's generated theme module, app-root relative, when the application declares a website: written by\n * the same step from the same visual tone (#2597, #2742). Found from the declared services, as brand propagation\n * finds it.\n */\n private resolveBrandWebsiteThemePath(): string | undefined {\n const website = resolveBrandSurfaceDirs(this.companionContext.saasRoot, this.companionContext.servicesByKey).website;\n if (website === undefined) return undefined;\n const websiteDirectory = path.relative(this.companionContext.saasRoot, website).split(path.sep).join('/');\n return path.posix.join(websiteDirectory, BRAND_WEBSITE_THEME_WEBSITE_RELATIVE_PATH);\n }\n\n /** Every module the brand step writes: the frontend's brand design, then the website's theme when one is declared. */\n private resolveBrandDesignModulePaths(): readonly string[] {\n const website = this.resolveBrandWebsiteThemePath();\n return website === undefined ? [resolveBrandDesignPath()] : [resolveBrandDesignPath(), website];\n }\n\n /**\n * What the brand step writes for a visual tone: each module's path and text, the frontend's first. One function, so\n * the step and its CURRENT check cannot disagree about which files exist or what they say.\n */\n private renderBrandDesignModules(inputs: BrandDesignInputs): Array<{ readonly modulePath: string; readonly source: string; readonly websiteTheme?: ApplicationBuildDesignSystemBrandStepRunResult['websiteTheme'] }> {\n const frontend = renderBrandDesignModule(inputs);\n const modules: Array<{ readonly modulePath: string; readonly source: string; readonly websiteTheme?: ApplicationBuildDesignSystemBrandStepRunResult['websiteTheme'] }> = [\n { modulePath: resolveBrandDesignPath(), source: frontend.source },\n ];\n const websitePath = this.resolveBrandWebsiteThemePath();\n if (websitePath !== undefined) {\n const website = renderBrandWebsiteThemeModule(inputs);\n modules.push({ modulePath: websitePath, source: website.source, websiteTheme: { palette: website.palette, personality: website.personality } });\n }\n return modules;\n }\n\n\n /**\n * Run the task's generation step. Incremental by construction: both\n * pipelines consult the freshness lock and skip fresh units, so re-running\n * an already-satisfied step costs a plan read, not a model call.\n *\n * While it runs, its progress is readable through {@link readGenerationStepProgress} (#2215); it is\n * dropped when the step settles, however it ends.\n */\n public async executeGenerationStep(\n task: BuildPlanTask,\n session?: CompanionExecutionSessionContext,\n ): Promise<MeasuredGenerationStepRunResult> {\n const tracker = new GenerationStepProgressTracker(this.requireGenerationStepRef(task));\n this.progressByTaskRef.set(task.taskRef, tracker);\n try {\n /*\n * Measured AS a generation step (#2232): its spend goes on its own row, and every enclosing measurement (a\n * build-dispatch playbook run) tallies it in `generationSteps`, so a total over both counts it once.\n */\n const measured = this.spendMeter\n ? await this.spendMeter.measure(() => this.runGenerationStep(task, tracker.reporter, session), { as: PlaybookSpendMeasuredUnit.GENERATION_STEP })\n : await NO_PLAYBOOK_SPEND_METER.measure(() => this.runGenerationStep(task, tracker.reporter, session));\n this.stepSpendByTask.set(task, measured.spend);\n if (measured.settled.status === 'rejected') {\n const reason: unknown = measured.settled.reason;\n // Who can fix it (#3709), recorded beside the failure on the step's row by the dispatch.\n const owner = classifyGenerationStepFailureOwner(this.requireGenerationStepRef(task), reason);\n if (owner !== undefined && typeof reason === 'object' && reason !== null) generationStepFailureOwners.set(reason, owner);\n throw reason;\n }\n return { ...measured.settled.value, spend: measured.spend };\n } finally {\n // Only our own tracker: a second run of the same task that started meanwhile keeps its own.\n if (this.progressByTaskRef.get(task.taskRef) === tracker) this.progressByTaskRef.delete(task.taskRef);\n }\n }\n\n /**\n * How far the task's generation step has got, while it runs (#2215). `undefined` when no step of that\n * task is running in this companion — the step settled, never ran, or ran before a restart.\n */\n public readGenerationStepProgress(taskRef: string): GenerationStepProgress | undefined {\n return this.progressByTaskRef.get(taskRef)?.snapshot();\n }\n\n private async runGenerationStep(\n task: BuildPlanTask,\n progress: LabellingProgressReporter,\n session?: CompanionExecutionSessionContext,\n ): Promise<ApplicationBuildGenerationStepRunResult> {\n const generationStepRef = this.requireGenerationStepRef(task);\n // A read that did not throw may be short (#3258).\n if (generationStepReadsSpecifications(generationStepRef)) await assertSpecificationsReadWhole(this.companionContext, `The output of build step \"${task.taskRef}\"`);\n switch (generationStepRef) {\n case ApplicationBuildGenerationStep.I18N_LABELS: {\n await this.refuseIncompleteLabelPlan(task);\n this.logDebug('Running the i18n-labels generation step', {\n taskRef: task.taskRef,\n primaryLocale: getCompanionConfiguredPrimaryLanguage(this.appConfigService.config),\n });\n const labellizeResult = await this.labellize.labellize({ progress }, session);\n return {\n generationStepRef,\n labellize: labellizeResult,\n evidencePaths: await this.resolveGenerationStepEvidencePaths(task),\n };\n }\n case ApplicationBuildGenerationStep.I18N_TRANSLATIONS: {\n // Translating from a plan that hides owed units drops their target-locale keys for good (#2504 review).\n await this.refuseIncompleteLabelPlan(task);\n const targetLocales = this.resolveTranslationTargetLocales();\n this.logDebug('Running the i18n-translations generation step', { taskRef: task.taskRef, targetLocales });\n const translateResult = targetLocales.length > 0\n ? await this.translate.translate({ targetLocales: [...targetLocales], progress }, session)\n : undefined;\n return {\n generationStepRef,\n targetLocales,\n ...(translateResult ? { translate: translateResult } : {}),\n evidencePaths: await this.resolveGenerationStepEvidencePaths(task),\n };\n }\n case ApplicationBuildGenerationStep.EMAIL_TEMPLATES: {\n const primaryLocale = getCompanionConfiguredPrimaryLanguage(this.appConfigService.config);\n const targetLocales = this.resolveEnabledLocales().filter((locale) => locale !== primaryLocale);\n this.logDebug('Running the email-templates generation step', {\n taskRef: task.taskRef,\n primaryLocale,\n targetLocales,\n });\n const emailGenerate = await this.emailTemplates.generateTemplates({}, session);\n const emailTranslate = targetLocales.length > 0\n ? await this.emailTemplates.translateEmailTemplateLabels({ targetLocales: [...targetLocales] }, session, { progress })\n : undefined;\n return {\n generationStepRef,\n emailGenerate,\n ...(emailTranslate ? { emailTranslate } : {}),\n evidencePaths: await this.resolveGenerationStepEvidencePaths(task),\n };\n }\n case ApplicationBuildGenerationStep.LOGO: {\n const evidencePaths = await this.resolveGenerationStepEvidencePaths(task);\n /*\n * Incremental, but by PRESENCE rather than by the freshness lock the text pipelines use.\n *\n * Those pipelines skip per UNIT, because a label is cheap and units come and go. A logo\n * deliberation is a panel of three experts, N generated images and a vision judge — the\n * most expensive step in this enum by a wide margin — and an application has exactly one\n * accepted mark. So the honest unit of freshness is \"is there an accepted mark\", and the\n * answer is the same predicate the landed check uses (`hasAcceptedBrandMark`), asked of the\n * working tree. Re-running a satisfied step costs a file read, not a model call.\n *\n * Replacing an existing mark stays a deliberate act through the brand routes; a build must\n * never quietly redraw an application's identity because it ran again.\n */\n if (await this.hasAcceptedBrandMark()) {\n this.logDebug('Skipping the logo generation step — an accepted mark already exists', {\n taskRef: task.taskRef,\n });\n return { generationStepRef, skippedBecauseAlreadyAccepted: true, evidencePaths, ...(await propagateAcceptedBrand(this.companionContext.saasRoot, this.logger)) };\n }\n\n this.logDebug('Running the logo generation step', { taskRef: task.taskRef });\n const deliberation = await this.logoDeliberation.run({});\n /*\n * `run` stages its winner as the standard single-candidate manifest `accept` expects, which\n * is why the two compose with no adapter: the staged manifest IS the hand-off. An identity\n * pin re-asserting that the manifest still held the winner went with the digest fences — a\n * single-candidate staging area written one await earlier has nothing else it could hold.\n */\n const accept = await this.brandAccept.accept({});\n return {\n generationStepRef,\n deliberation,\n accept,\n skippedBecauseAlreadyAccepted: false,\n evidencePaths,\n // The accept propagated the mark it promoted; carried here so the step's record says so.\n ...(accept.propagation !== undefined ? { propagation: accept.propagation } : {}),\n ...(accept.propagationError !== undefined ? { propagationError: accept.propagationError } : {}),\n };\n }\n case ApplicationBuildGenerationStep.DOCUMENTATION_PUBLICATION: {\n const evidencePaths = await this.resolveGenerationStepEvidencePaths(task);\n /*\n * The backend service key the publish derives its OpenAPI documents from, picked the way\n * every other companion caller picks it: the one declared service that is not a frontend.\n * `runForeignKeyResolutionVerification` resolves it identically, and the controller's own\n * `pickResourcesRegistryCarrierServiceKey` answers the same question for the HTTP door.\n */\n const backendServiceKey = Object.entries(this.companionContext.servicesByKey)\n .find(([, service]) => !service.frontendType)?.[0];\n if (backendServiceKey === undefined) {\n throw new Error('Cannot publish documentation: this application declares no backend service to derive its API documents from.');\n }\n this.logDebug('Running the documentation publication step', { taskRef: task.taskRef, backendServiceKey });\n /*\n * NOT skipped when the tree already exists, unlike the logo step beside it.\n *\n * A logo is accepted once and must never be silently redrawn. A documentation portal is a\n * PROJECTION of the application's current configuration, resources and authored chapters —\n * every one of which the build is still changing — so a published tree is stale the moment a\n * later task lands, and re-publishing is how it stays true. The publish is idempotent by\n * construction (it re-derives and rewrites), and `wildo docs publish` exists precisely\n * because the committed tree drifted silently whenever nobody re-ran it.\n */\n const published = await this.technicalDoc.publishManagedDocumentation({ backendServiceKey });\n return { generationStepRef, published, evidencePaths };\n }\n case ApplicationBuildGenerationStep.DISPLAY_NAME: {\n let brandName: string | undefined;\n try {\n brandName = await this.readLandedBrandName();\n } catch (error) {\n throw new Error(`Build task ${task.taskRef} applies the brand's name, and the brand could not be read: ${describeCaughtError(error)}`);\n }\n if (brandName === undefined) {\n throw new Error(`Build task ${task.taskRef} applies the brand's name, and no brand with a name has landed.`);\n }\n this.logDebug('Running the display-name generation step', { taskRef: task.taskRef, brandName });\n const applied = applyApplicationDisplayName({ applicationRoot: this.companionContext.saasRoot, frameworkRoot: this.frameworkRoot(), displayName: brandName });\n return { generationStepRef, ...applied, evidencePaths: await this.resolveGenerationStepEvidencePaths(task) };\n }\n case ApplicationBuildGenerationStep.ENGINE_CAPABILITIES: {\n this.logDebug('Running the engine-capabilities generation step', { taskRef: task.taskRef });\n const aligned = await this.foundationExecutor.alignEngineCapabilitiesWithDecisions();\n return { generationStepRef, ...aligned, evidencePaths: await this.resolveGenerationStepEvidencePaths(task) };\n }\n case ApplicationBuildGenerationStep.DATABASE_MIGRATIONS: {\n const saasRoot = this.companionContext.saasRoot;\n const evidencePaths = await this.resolveGenerationStepEvidencePaths(task);\n\n /*\n * With no accepted plan, `wildo db generate` renders the WHOLE model as the INITIAL migration and\n * writes the baseline in the same invocation. That is exactly what a PostgreSQL application with no\n * baseline owes (#1144): its tables exist only once a migration creates them. It is exactly wrong\n * for a MongoDB-backed application, where it would author a table set nothing uses — so the\n * DECLARED store decides, and anything but a PostgreSQL declaration refuses.\n *\n * `wildo db diff --update-lockfile` was the baseline this refusal used to prescribe. It writes the\n * lockfile and NO migration, so it would accept a plan whose tables were never created.\n */\n const assessment = await this.assessSchemaPlanObligation();\n if (assessment.obligation === ApplicationSchemaPlanObligation.NOT_OWED) {\n throw new Error(\n `Build task ${task.taskRef} runs the database-migrations step, but this application has no accepted schema `\n + `plan (${SCHEMA_PLAN_LOCKFILE_RELATIVE_PATH} is absent) and does not declare PostgreSQL in ${assessment.declaredIn}. `\n + 'A MongoDB-backed application owes no migrations; remove this step from the build plan.',\n );\n }\n if (assessment.obligation === ApplicationSchemaPlanObligation.UNDETERMINED) {\n throw new Error(\n `Build task ${task.taskRef} runs the database-migrations step, but this application has no accepted schema `\n + `plan and its store could not be determined: ${assessment.reason}. Generating without knowing the store `\n + 'could author tables for a MongoDB-backed application.',\n );\n }\n /*\n * The plan is computed by IMPORTING the compiled backend registry, so an unbuilt tree cannot\n * produce one. Generating from a stale or absent model would author a migration for a model\n * nobody has — worse than not generating, because it then gets applied.\n */\n if (!existsSync(path.join(saasRoot, MODULES_REGISTRY_RELATIVE_PATH))) {\n throw new Error(\n `Build task ${task.taskRef} runs the database-migrations step, but ${MODULES_REGISTRY_RELATIVE_PATH} does not `\n + 'exist. The schema plan is computed by importing the compiled backend registry; build backend-api first.',\n );\n }\n\n const before = listMigrationFolders(saasRoot);\n this.logDebug('Running the database-migrations generation step', { taskRef: task.taskRef });\n /*\n * The migration LABEL comes from the task ref, so the folder is traceable back to the task\n * that produced it. Sanitised to the kebab-case shape `--name` accepts; the CLI still owns\n * the timestamp prefix, which is why the resulting path cannot be predicted here.\n */\n const label = task.taskRef.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, '').slice(0, 60)\n || 'build-plan-migration';\n const result = await executeBoundedSubprocess({\n command: 'wildo',\n args: ['db', 'generate', '--name', label],\n cwd: saasRoot,\n env: buildCliSubprocessEnv(),\n timeoutMs: MIGRATION_GENERATION_TIMEOUT_MS,\n });\n const after = listMigrationFolders(saasRoot);\n const generatedMigrationFolders = after.filter((folder) => !before.includes(folder));\n return {\n generationStepRef,\n // A clean plan is a legitimate outcome, not a failure: the resources this task follows may\n // have been migrated by an earlier one. The generator reports \"nothing to generate\".\n skippedBecauseAlreadyInSync: generatedMigrationFolders.length === 0,\n generatedMigrationFolders,\n outputTail: `${result.stdout}${result.stderr}`.slice(-2000),\n evidencePaths,\n };\n }\n case ApplicationBuildGenerationStep.DESIGN_TOKENS: {\n const saasRoot = this.companionContext.saasRoot;\n const evidencePaths = await this.resolveGenerationStepEvidencePaths(task);\n const frontendDirectory = resolveDesignSystemFrontendDirectory();\n const stylesheetPath = path.join(saasRoot, resolveDesignTokenStylesheetPath());\n /*\n * The frontend is NAMED rather than left to the CLI's default resolution: it is the frontend whose\n * config the DESIGN_SYSTEM task wrote, and naming it keeps an application with several `SAAS_APP`\n * frontends — where the CLI refuses to guess — from failing a step whose target is not in doubt.\n *\n * Not skipped when the block is already current, unlike the logo step: `generate` compares before\n * it writes and reports \"no changes\", so a re-run costs one subprocess and changes nothing.\n */\n const before = await readFile(stylesheetPath, 'utf8').catch(() => undefined);\n this.logDebug('Running the design-tokens generation step', { taskRef: task.taskRef, frontendDirectory });\n let result: Awaited<ReturnType<typeof executeBoundedSubprocess>>;\n try {\n result = await executeBoundedSubprocess({\n command: 'wildo',\n args: ['design-tokens', 'generate', frontendDirectory],\n cwd: saasRoot,\n env: buildCliSubprocessEnv(),\n timeoutMs: DESIGN_TOKENS_CLI_TIMEOUT_MS,\n });\n } catch (error) {\n // The subprocess error alone says \"Bounded subprocess failed\"; the CLI's own lines say why\n // (no config, no markers, a config that does not load), and they are what the row must carry.\n const output = subprocessFailureOutput(error).trim();\n throw new Error(\n `Build task ${task.taskRef} could not regenerate the design-token block of ${resolveDesignTokenStylesheetPath()}: `\n + `${describeCaughtError(error)}${output.length > 0 ? `\\n${output.slice(-2000)}` : ''}`,\n );\n }\n const after = await readFile(stylesheetPath, 'utf8').catch(() => undefined);\n return {\n generationStepRef,\n frontendDirectory,\n regenerated: before !== after,\n outputTail: `${result.stdout}${result.stderr}`.slice(-2000),\n evidencePaths,\n };\n }\n case ApplicationBuildGenerationStep.DESIGN_SYSTEM_BRAND: {\n const evidencePaths = await this.resolveGenerationStepEvidencePaths(task);\n let inputs: BrandDesignInputs;\n try {\n // The tone and what it stands on from ONE read (#3258, #3451): the brand family, read whole from its own file.\n const read = await readSpecificationFamiliesForRewrite(this.companionContext, (families) => projectBrandVisualTone(families));\n assertSpecificationWritePermitted(read.basis, { packageRelativePath: `The design system of build step \"${task.taskRef}\"`, fileExists: true, dryRun: false });\n inputs = read.value ?? projectBrandVisualTone(undefined);\n } catch (error) {\n if (error instanceof SpecificationWriteRefusedError) throw error;\n throw new Error(\n `Build task ${task.taskRef} could not read the brand's visual tone to derive the design system: ${describeCaughtError(error)}. `\n + 'Writing the neutral palette and the default theme instead would hide whatever the brand states.',\n );\n }\n // Throws on a seed the derivation cannot read; the brand schema admits hex only, so that is a brand file\n // that bypassed its schema, and the message names the seed.\n const rendered = renderBrandDesignModule(inputs);\n this.logDebug('Running the design-system-brand generation step', {\n taskRef: task.taskRef,\n fromBrand: rendered.fromBrand,\n adjustments: rendered.adjustments.length,\n personalityFromBrand: rendered.personalityFromBrand,\n });\n // The frontend's module, and the website's colours from the same seeds when a website is declared (#2597).\n const modules = this.renderBrandDesignModules(inputs);\n let rewritten = false;\n for (const module of modules) {\n const modulePath = path.join(this.companionContext.saasRoot, module.modulePath);\n const before = await readFile(modulePath, 'utf8').catch(() => undefined);\n if (before === module.source) continue;\n await mkdir(path.dirname(modulePath), { recursive: true });\n await writeSpecificationFileAtomically(modulePath, module.source);\n rewritten = true;\n }\n const websiteTheme = modules.find((module) => module.websiteTheme !== undefined)?.websiteTheme;\n return {\n generationStepRef,\n seeds: rendered.seeds,\n fromBrand: rendered.fromBrand,\n adjustments: rendered.adjustments,\n personality: rendered.personality,\n personalityFromBrand: rendered.personalityFromBrand,\n ...(websiteTheme !== undefined ? { websiteTheme } : {}),\n rewritten,\n evidencePaths,\n };\n }\n default:\n throw new ApplicationBuildUnknownGenerationStepError(task.taskRef, generationStepRef);\n }\n }\n\n /**\n * The brand's visual tone (`visualTone.colorSeeds`, `styleKeywords`, `mood`), read from the specifications companion\n * exports this process evaluates — the same evaluation the build plan and the brand's name are read from. An\n * application with no brand, or a brand with no visual tone, answers empty lists; a specifications package that does\n * not evaluate throws.\n *\n * It was read through the `brand-visual-tone` introspection behaviour until #3223, which reads exactly these exports in\n * a subprocess. `app-creation-test-007` reported a landed `design-system-brand` step as ready again right after a\n * companion restart (landed 21 → 20) and the next wave ran it once more; the SUSPECTED cause, never confirmed on that\n * run, is that subprocess still warming, so the check answered UNANSWERABLE for a brand nothing had changed. Whatever\n * the cause, the subprocess was a second evaluation of the same exports. Read here, the answer is a function of the\n * specifications files alone, so it survives a restart, and it can only be unknown when the plan itself cannot be\n * read (`loadSpecificationFamilyData` is the plan's own reader), in which case nothing is dispatched anyway.\n * One reader for the step and its CURRENT check, as before, so the two cannot disagree.\n */\n private async readBrandVisualTone(): Promise<BrandDesignInputs> {\n return projectBrandVisualTone(await loadSpecificationFamilyData(this.companionContext));\n }\n\n /**\n * Has this application accepted a mark? Asked of the WORKING tree, so a mark accepted and not yet committed is\n * never redrawn by a re-run. The predicate is shared with the landing probe, which asks the committed tree.\n *\n * It used to be a bare `stat()` of the module, justified as \"written only by a promotion\". That was false — the\n * `wildo init` scaffold writes the module with an empty list — so on every fresh application the step skipped\n * itself and no logo was ever drawn (#2410, `app-creation-test-005`).\n */\n private async hasAcceptedBrandMark(): Promise<boolean> {\n return hasAcceptedBrandMarkInWorkingTree(this.companionContext.saasRoot);\n }\n\n private requireGenerationStepRef(task: BuildPlanTask): string {\n const target = task.target;\n if (target?.kind !== BuildPlanTaskTargetKind.COMPANION_GENERATION_STEP) {\n throw new Error(`Build task ${task.taskRef} is not a companion generation step.`);\n }\n return target.generationStepRef;\n }\n\n /**\n * The locales this application ENABLES — `appPreferences.languages.enabledLanguages`,\n * always including the primary. This is the \"every configured locale\" the\n * build task's objective speaks of; an app that enables only its primary\n * locale gets no translate pass and no foreign-locale evidence.\n */\n private resolveEnabledLocales(): readonly AvailableLanguage[] {\n return getCompanionServedLanguages(this.appConfigService.config);\n }\n\n /**\n * The locales the `i18n-translations` step translates into: every enabled locale but the primary.\n *\n * Public because the dispatch host derives that step only when this is non-empty — on a one-locale\n * application the step owes nothing and its evidence list would be empty, and an empty list never\n * lands, so a derived step there would be ready forever.\n */\n public resolveTranslationTargetLocales(): readonly AvailableLanguage[] {\n const primaryLocale = getCompanionConfiguredPrimaryLanguage(this.appConfigService.config);\n return this.resolveEnabledLocales().filter((locale) => locale !== primaryLocale);\n }\n\n /**\n * The probes a labels plan lands on (#2504): every planned unit's primary-locale file declares every key the plan\n * holds for it, exactly and non-empty — the pipeline's own completeness bar (its adoption check), so the step lands\n * exactly when a re-run would generate nothing. A unit the plan could NOT plan (a stale registry's owed hint) has no\n * keys to name, so its file must at least be committed.\n *\n * Exact keys, not the segment after the bucket: the frontend-derived root units nest under a category\n * (`composite_views.app.<view>`, `settings_hub.sections.<ref>`), and a scaffolded root file already carries the\n * category, so a prefix on that segment landed before any of the application's own entries existed.\n */\n private labelPlanProbes(plan: LabellingPlanResult, primaryLocale: string): readonly BuildPlanTaskLandedProbe[] {\n const i18nRoot = this.resolveI18nRelativeRoot();\n const unitPath = (hint: { readonly bucket: string; readonly slug: string }) => path.posix.join(i18nRoot, hint.bucket, `${hint.slug}.${primaryLocale}.ts`);\n const keysByPath = new Map<string, Set<string>>();\n for (const unit of plan.units) {\n const keys = keysByPath.get(unitPath(unit.filePathHint)) ?? new Set<string>();\n for (const key of unit.chunks.flatMap((chunk) => chunk.keys)) keys.add(key);\n keysByPath.set(unitPath(unit.filePathHint), keys);\n }\n const probes: BuildPlanTaskLandedProbe[] = [...keysByPath].map(([filePath, keys]) => (keys.size > 0\n ? { kind: BuildPlanTaskLandedProbeKind.COMMITTED_LABEL_FILE_DECLARES_KEYS, path: filePath, keys: [...keys].sort() }\n : { kind: BuildPlanTaskLandedProbeKind.COMMITTED_FILE, path: filePath }));\n const owed = new Set(plan.incompleteness.flatMap((entry) => entry.expectedUnitHints ?? []).map(unitPath));\n for (const filePath of owed) {\n if (!keysByPath.has(filePath)) probes.push({ kind: BuildPlanTaskLandedProbeKind.COMMITTED_FILE, path: filePath });\n }\n return probes;\n }\n\n /** Every labelling unit's file, in each of the given locales — exactly the files the pipelines write. */\n private async resolveLabelUnitPaths(locales: readonly string[]): Promise<readonly string[]> {\n if (locales.length === 0) return [];\n const i18nRoot = this.resolveI18nRelativeRoot();\n const plan = await this.planner.planAllUnitsWithCompleteness();\n /*\n * The units the plan could NOT plan count too (#2504). A companion whose registry predates the application's\n * resources plans engine resources only, and evidence read off that plan alone landed the step with no label for any\n * resource the application owns. Counting the owed units keeps the step unlanded until they exist.\n */\n const hints = [\n ...plan.units.map((unit) => unit.filePathHint),\n ...plan.incompleteness.flatMap((entry) => entry.expectedUnitHints ?? []),\n ];\n return [...new Set(hints.flatMap((hint) =>\n locales.map((locale) => path.posix.join(i18nRoot, hint.bucket, `${hint.slug}.${locale}.ts`)),\n ))];\n }\n\n /**\n * Refuse to label from a plan that hides units the application owes (#2504): a registry that predates its resources,\n * or a frontend introspection that failed. Running would commit the units it can see and still owe the rest; the\n * remedy is the cause the detail names (a companion restart, or the frontend introspection's error).\n */\n private async refuseIncompleteLabelPlan(task: BuildPlanTask): Promise<void> {\n const plan = await this.planner.planAllUnitsWithCompleteness();\n const blocking = plan.incompleteness.filter((entry) => LABEL_PLAN_BLOCKING_INCOMPLETENESS.has(entry.reason));\n if (blocking.length === 0) return;\n /*\n * A STALE registry is cured, not only reported: the companion asks its supervisor for a restart, which reloads the\n * registry from the application as it is now (the remedy a person would otherwise have to perform, on most creation\n * runs, since a run's companion boots before the application's modules exist). The step is retried on the next\n * dispatch. Without a supervisor nobody would restart the process, so the message names the remedy instead.\n */\n const stale = blocking.some((entry) => entry.reason === LabellingPlanIncompletenessReason.RESOURCE_REGISTRY_STALE);\n const restarting = stale && requestCompanionRestart(this.companionContext.saasRoot, {\n reasonKey: LabellingPlanIncompletenessReason.RESOURCE_REGISTRY_STALE,\n detail: `${task.taskRef}: resource registry predates the application`,\n });\n throw new Error(`Build task ${task.taskRef} cannot generate labels yet: the plan would miss units the application owes. ${blocking.map((entry) => entry.detail).join(' ')}`\n + (restarting\n ? ' The companion is restarting to reload its registry; the step runs again on the next dispatch.'\n // The door: nothing here needs a person's decision, only the cause repaired. `wildo context health` names it. A\n // stale registry a restart did not cure lands here too (the repeat window): the companion is not reloading the\n // application's registry, and its startup log says why.\n : ' Repair the cause named above (`wildo context health` shows the introspection lane; for a registry a restart did not refresh, '\n + 'the companion\\'s startup log names why it could not load the application\\'s companion exports); the step runs again on the next dispatch.'));\n }\n\n /**\n * The chosen brand's name, from the landed brand brief (#2505); `undefined` when no brand has landed or it carries no\n * name. Read through the same companion exports every family is read from.\n *\n * THROWS when those exports cannot be loaded (#2694). It used to answer `undefined` then, which read as \"no brand\":\n * the display-name step owed nothing and landed without running. Each caller now says what an unreadable brand means\n * to it: the landing check reports it (INPUT_UNREADABLE), the step refuses, and the host-derived step derives nothing.\n */\n public async readLandedBrandName(): Promise<string | undefined> {\n const exports = await loadSpecificationFamilyData(this.companionContext) as unknown as { brandSpecification?: { name?: { brandName?: unknown } } };\n const brandName = exports.brandSpecification?.name?.brandName;\n return typeof brandName === 'string' && brandName.trim().length > 0 ? brandName.trim() : undefined;\n }\n\n private frameworkRoot(): string | null {\n return this.companionContext.resolvedHomes.framework.repositoryRoot ?? null;\n }\n\n /** `<backend service path>/src/engine/i18n`, app-root relative — the same tree the orchestrators write into. */\n private resolveI18nRelativeRoot(): string {\n const backendService = Object.values(this.companionContext.backendServices)[0];\n if (!backendService) {\n throw new Error('No backend service configured for per-unit i18n output.');\n }\n return path.posix.join(backendService.path, BACKEND_I18N_TREE_RELATIVE_PATH);\n }\n}\n"]}
|