@wildo-ai/dev-companion 1.1.8 → 1.1.9
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/bin/companion-supervisor.d.mts +33 -0
- package/bin/companion-supervisor.mjs +174 -0
- package/bin/wildo-dev-companion-supervised.mjs +16 -0
- package/dist/esm/brand/models/logo-generation.actors-system.definitions.d.ts.map +1 -1
- package/dist/esm/brand/models/logo-generation.actors-system.definitions.js +8 -2
- package/dist/esm/brand/models/logo-generation.actors-system.definitions.js.map +1 -1
- package/dist/esm/brand/models/logo-judge.actors-system.definitions.d.ts.map +1 -1
- package/dist/esm/brand/models/logo-judge.actors-system.definitions.js +8 -2
- package/dist/esm/brand/models/logo-judge.actors-system.definitions.js.map +1 -1
- package/dist/esm/brand/services/brand-accept.companion.service.d.ts +1 -1
- package/dist/esm/brand/services/brand-accept.companion.service.d.ts.map +1 -1
- package/dist/esm/brand/services/brand-accept.companion.service.js +9 -11
- package/dist/esm/brand/services/brand-accept.companion.service.js.map +1 -1
- package/dist/esm/claude-cli/models/application-coding-run-checkpoint.models.d.ts +21 -0
- package/dist/esm/claude-cli/models/application-coding-run-checkpoint.models.d.ts.map +1 -1
- package/dist/esm/claude-cli/models/application-coding-run-checkpoint.models.js +33 -1
- package/dist/esm/claude-cli/models/application-coding-run-checkpoint.models.js.map +1 -1
- package/dist/esm/claude-cli/models/coding-agent-dispatch.models.d.ts +41 -2
- 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 +43 -1
- 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 +57 -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 +75 -1
- 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 +90 -5
- 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 +242 -22
- package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.js.map +1 -1
- package/dist/esm/companion-api/companion-api.schemas.d.ts +23 -2
- package/dist/esm/companion-api/companion-api.schemas.d.ts.map +1 -1
- package/dist/esm/companion-api/companion-api.schemas.js +13 -2
- package/dist/esm/companion-api/companion-api.schemas.js.map +1 -1
- package/dist/esm/companion-api/controllers/companion.controller.d.ts +63 -7
- package/dist/esm/companion-api/controllers/companion.controller.d.ts.map +1 -1
- package/dist/esm/companion-api/controllers/companion.controller.js +315 -39
- package/dist/esm/companion-api/controllers/companion.controller.js.map +1 -1
- package/dist/esm/core/config/primary-language.companion.utils.d.ts +5 -4
- package/dist/esm/core/config/primary-language.companion.utils.d.ts.map +1 -1
- package/dist/esm/core/config/primary-language.companion.utils.js +5 -4
- package/dist/esm/core/config/primary-language.companion.utils.js.map +1 -1
- package/dist/esm/core/context/application-module-generations.companion.d.ts +103 -0
- package/dist/esm/core/context/application-module-generations.companion.d.ts.map +1 -0
- package/dist/esm/core/context/application-module-generations.companion.js +313 -0
- package/dist/esm/core/context/application-module-generations.companion.js.map +1 -0
- package/dist/esm/core/context/companion-package-loaders.companion.d.ts +19 -19
- package/dist/esm/core/context/companion-package-loaders.companion.d.ts.map +1 -1
- package/dist/esm/core/context/companion-package-loaders.companion.js +52 -40
- package/dist/esm/core/context/companion-package-loaders.companion.js.map +1 -1
- package/dist/esm/core/inject/models/container.d.ts.map +1 -1
- package/dist/esm/core/inject/models/container.js +4 -0
- package/dist/esm/core/inject/models/container.js.map +1 -1
- package/dist/esm/core/inject/models/service-types.d.ts +4 -0
- package/dist/esm/core/inject/models/service-types.d.ts.map +1 -1
- package/dist/esm/core/inject/models/service-types.js +4 -0
- package/dist/esm/core/inject/models/service-types.js.map +1 -1
- package/dist/esm/core/introspection/resources/creation-console-answer.companion.d.ts +15 -1
- package/dist/esm/core/introspection/resources/creation-console-answer.companion.d.ts.map +1 -1
- package/dist/esm/core/introspection/resources/creation-console-answer.companion.js +38 -3
- package/dist/esm/core/introspection/resources/creation-console-answer.companion.js.map +1 -1
- package/dist/esm/core/introspection/resources/creation-console-projection.companion.d.ts +21 -0
- package/dist/esm/core/introspection/resources/creation-console-projection.companion.d.ts.map +1 -1
- package/dist/esm/core/introspection/resources/creation-console-projection.companion.js +64 -25
- package/dist/esm/core/introspection/resources/creation-console-projection.companion.js.map +1 -1
- 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 +2 -0
- package/dist/esm/core/introspection/resources/creation-home-projection.companion.js.map +1 -1
- package/dist/esm/core/introspection/resources/creation-plane-dispatch.custom-impl.companion.service.d.ts +0 -28
- package/dist/esm/core/introspection/resources/creation-plane-dispatch.custom-impl.companion.service.d.ts.map +1 -1
- package/dist/esm/core/introspection/resources/creation-plane-dispatch.custom-impl.companion.service.js +192 -19
- package/dist/esm/core/introspection/resources/creation-plane-dispatch.custom-impl.companion.service.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 +27 -5
- 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 +47 -0
- package/dist/esm/core/introspection/resources/launch-blockers.companion.d.ts.map +1 -0
- package/dist/esm/core/introspection/resources/launch-blockers.companion.js +98 -0
- package/dist/esm/core/introspection/resources/launch-blockers.companion.js.map +1 -0
- package/dist/esm/core/introspection/services/companion-introspection.companion.service.d.ts +6 -1
- 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 +20 -1
- package/dist/esm/core/introspection/services/companion-introspection.companion.service.js.map +1 -1
- package/dist/esm/core/introspection/services/introspection-derivation-state.companion.service.d.ts +34 -8
- package/dist/esm/core/introspection/services/introspection-derivation-state.companion.service.d.ts.map +1 -1
- package/dist/esm/core/introspection/services/introspection-derivation-state.companion.service.js +61 -12
- package/dist/esm/core/introspection/services/introspection-derivation-state.companion.service.js.map +1 -1
- package/dist/esm/core/introspection/services/introspection-input-closure.companion.d.ts +44 -0
- package/dist/esm/core/introspection/services/introspection-input-closure.companion.d.ts.map +1 -0
- package/dist/esm/core/introspection/services/introspection-input-closure.companion.js +104 -0
- package/dist/esm/core/introspection/services/introspection-input-closure.companion.js.map +1 -0
- package/dist/esm/core/introspection/services/introspection-source-state.companion.service.d.ts +41 -22
- 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 +64 -47
- package/dist/esm/core/introspection/services/introspection-source-state.companion.service.js.map +1 -1
- package/dist/esm/core/introspection/subprocess/expert-persona-brief.renderer.d.ts +7 -1
- package/dist/esm/core/introspection/subprocess/expert-persona-brief.renderer.d.ts.map +1 -1
- package/dist/esm/core/introspection/subprocess/expert-persona-brief.renderer.js +13 -4
- package/dist/esm/core/introspection/subprocess/expert-persona-brief.renderer.js.map +1 -1
- package/dist/esm/core/introspection/subprocess/specification-artifacts.behavior.d.ts.map +1 -1
- package/dist/esm/core/introspection/subprocess/specification-artifacts.behavior.js +7 -0
- package/dist/esm/core/introspection/subprocess/specification-artifacts.behavior.js.map +1 -1
- package/dist/esm/core/lock/wildo-saas-lock.schemas.d.ts +4 -4
- package/dist/esm/core/runtime/companion-env-file.d.ts +39 -9
- package/dist/esm/core/runtime/companion-env-file.d.ts.map +1 -1
- package/dist/esm/core/runtime/companion-env-file.js +75 -16
- package/dist/esm/core/runtime/companion-env-file.js.map +1 -1
- package/dist/esm/core/runtime/services/start-companion-application.service.d.ts +7 -3
- 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 +29 -11
- package/dist/esm/core/runtime/services/start-companion-application.service.js.map +1 -1
- package/dist/esm/core/utils/bounded-concurrency.utils.d.ts +17 -0
- package/dist/esm/core/utils/bounded-concurrency.utils.d.ts.map +1 -0
- package/dist/esm/core/utils/bounded-concurrency.utils.js +37 -0
- package/dist/esm/core/utils/bounded-concurrency.utils.js.map +1 -0
- package/dist/esm/core/utils/derived-input-signature.companion.utils.d.ts +10 -1
- package/dist/esm/core/utils/derived-input-signature.companion.utils.d.ts.map +1 -1
- package/dist/esm/core/utils/derived-input-signature.companion.utils.js +9 -2
- package/dist/esm/core/utils/derived-input-signature.companion.utils.js.map +1 -1
- package/dist/esm/creation-conversation/creation-conversation.actors-system.definitions.d.ts.map +1 -1
- package/dist/esm/creation-conversation/creation-conversation.actors-system.definitions.js +2 -0
- package/dist/esm/creation-conversation/creation-conversation.actors-system.definitions.js.map +1 -1
- package/dist/esm/creation-conversation/creation-conversation.function-tools.d.ts.map +1 -1
- package/dist/esm/creation-conversation/creation-conversation.function-tools.js +66 -6
- package/dist/esm/creation-conversation/creation-conversation.function-tools.js.map +1 -1
- package/dist/esm/deliberations/models/deliberation-agents.actors-system.definitions.d.ts +0 -17
- package/dist/esm/deliberations/models/deliberation-agents.actors-system.definitions.d.ts.map +1 -1
- package/dist/esm/deliberations/models/deliberation-agents.actors-system.definitions.js +10 -4
- package/dist/esm/deliberations/models/deliberation-agents.actors-system.definitions.js.map +1 -1
- package/dist/esm/email/services/email-template.companion.service.d.ts +6 -1
- package/dist/esm/email/services/email-template.companion.service.d.ts.map +1 -1
- package/dist/esm/email/services/email-template.companion.service.js +4 -1
- package/dist/esm/email/services/email-template.companion.service.js.map +1 -1
- package/dist/esm/expert-personas/models/expert-persona-critique.actors-system.definitions.d.ts.map +1 -1
- package/dist/esm/expert-personas/models/expert-persona-critique.actors-system.definitions.js +8 -2
- package/dist/esm/expert-personas/models/expert-persona-critique.actors-system.definitions.js.map +1 -1
- package/dist/esm/expert-personas/models/expert-persona-derivation.actors-system.definitions.d.ts.map +1 -1
- package/dist/esm/expert-personas/models/expert-persona-derivation.actors-system.definitions.js +8 -2
- package/dist/esm/expert-personas/models/expert-persona-derivation.actors-system.definitions.js.map +1 -1
- package/dist/esm/expert-personas/services/expert-persona.companion.service.d.ts.map +1 -1
- package/dist/esm/expert-personas/services/expert-persona.companion.service.js +7 -7
- package/dist/esm/expert-personas/services/expert-persona.companion.service.js.map +1 -1
- package/dist/esm/i18n/composite_views/app.creation-conversation.en.d.ts.map +1 -1
- package/dist/esm/i18n/composite_views/app.creation-conversation.en.js +41 -1
- package/dist/esm/i18n/composite_views/app.creation-conversation.en.js.map +1 -1
- package/dist/esm/i18n/resources/workbenchAspects.en.d.ts.map +1 -1
- package/dist/esm/i18n/resources/workbenchAspects.en.js +7 -0
- package/dist/esm/i18n/resources/workbenchAspects.en.js.map +1 -1
- package/dist/esm/i18n/resources/workbenchBuildDispatchPlan.en.d.ts +5 -0
- package/dist/esm/i18n/resources/workbenchBuildDispatchPlan.en.d.ts.map +1 -1
- package/dist/esm/i18n/resources/workbenchBuildDispatchPlan.en.js +5 -0
- package/dist/esm/i18n/resources/workbenchBuildDispatchPlan.en.js.map +1 -1
- package/dist/esm/i18n/resources/workbenchBuildPlanTasks.en.d.ts +1 -1
- package/dist/esm/i18n/resources/workbenchBuildPlanTasks.en.d.ts.map +1 -1
- package/dist/esm/i18n/resources/workbenchBuildPlanTasks.en.js +2 -1
- package/dist/esm/i18n/resources/workbenchBuildPlanTasks.en.js.map +1 -1
- package/dist/esm/i18n/resources/workbenchDossierEntries.en.d.ts +46 -0
- package/dist/esm/i18n/resources/workbenchDossierEntries.en.d.ts.map +1 -1
- package/dist/esm/i18n/resources/workbenchDossierEntries.en.js +12 -0
- package/dist/esm/i18n/resources/workbenchDossierEntries.en.js.map +1 -1
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.en.d.ts +266 -0
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.en.d.ts.map +1 -1
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.en.js +91 -5
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.en.js.map +1 -1
- package/dist/esm/i18n/system_enums/application-creation.en.d.ts +41 -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 +45 -1
- package/dist/esm/i18n/system_enums/application-creation.en.js.map +1 -1
- package/dist/esm/i18n/system_enums/localization.en.d.ts +82 -0
- package/dist/esm/i18n/system_enums/localization.en.d.ts.map +1 -0
- package/dist/esm/i18n/system_enums/localization.en.js +82 -0
- package/dist/esm/i18n/system_enums/localization.en.js.map +1 -0
- package/dist/esm/i18n/system_enums/risk-register.en.d.ts +1 -0
- package/dist/esm/i18n/system_enums/risk-register.en.d.ts.map +1 -1
- package/dist/esm/i18n/system_enums/risk-register.en.js +1 -0
- package/dist/esm/i18n/system_enums/risk-register.en.js.map +1 -1
- package/dist/esm/i18n/system_enums/workbench-dossier.en.d.ts +10 -0
- package/dist/esm/i18n/system_enums/workbench-dossier.en.d.ts.map +1 -1
- package/dist/esm/i18n/system_enums/workbench-dossier.en.js +13 -0
- package/dist/esm/i18n/system_enums/workbench-dossier.en.js.map +1 -1
- package/dist/esm/i18n-labelling/models/labelling-progress.models.d.ts +43 -0
- package/dist/esm/i18n-labelling/models/labelling-progress.models.d.ts.map +1 -0
- package/dist/esm/i18n-labelling/models/labelling-progress.models.js +34 -0
- package/dist/esm/i18n-labelling/models/labelling-progress.models.js.map +1 -0
- package/dist/esm/i18n-labelling/services/labellize-orchestrator.companion.service.d.ts +8 -0
- package/dist/esm/i18n-labelling/services/labellize-orchestrator.companion.service.d.ts.map +1 -1
- package/dist/esm/i18n-labelling/services/labellize-orchestrator.companion.service.js +97 -56
- package/dist/esm/i18n-labelling/services/labellize-orchestrator.companion.service.js.map +1 -1
- package/dist/esm/i18n-labelling/services/translate-orchestrator.companion.service.d.ts +18 -0
- package/dist/esm/i18n-labelling/services/translate-orchestrator.companion.service.d.ts.map +1 -1
- package/dist/esm/i18n-labelling/services/translate-orchestrator.companion.service.js +269 -153
- package/dist/esm/i18n-labelling/services/translate-orchestrator.companion.service.js.map +1 -1
- package/dist/esm/i18n-labelling/utils/labelling-concurrency.utils.d.ts +41 -0
- package/dist/esm/i18n-labelling/utils/labelling-concurrency.utils.d.ts.map +1 -0
- package/dist/esm/i18n-labelling/utils/labelling-concurrency.utils.js +47 -0
- package/dist/esm/i18n-labelling/utils/labelling-concurrency.utils.js.map +1 -0
- package/dist/esm/i18n-labelling/utils/per-unit-file.utils.d.ts +12 -0
- package/dist/esm/i18n-labelling/utils/per-unit-file.utils.d.ts.map +1 -1
- package/dist/esm/i18n-labelling/utils/per-unit-file.utils.js +10 -2
- package/dist/esm/i18n-labelling/utils/per-unit-file.utils.js.map +1 -1
- package/dist/esm/i18n-labelling/utils/staged-label-file-writer.utils.d.ts +89 -0
- package/dist/esm/i18n-labelling/utils/staged-label-file-writer.utils.d.ts.map +1 -0
- package/dist/esm/i18n-labelling/utils/staged-label-file-writer.utils.js +229 -0
- package/dist/esm/i18n-labelling/utils/staged-label-file-writer.utils.js.map +1 -0
- package/dist/esm/meta-workflows/models/build-task-rearm.models.d.ts +67 -1
- package/dist/esm/meta-workflows/models/build-task-rearm.models.d.ts.map +1 -1
- package/dist/esm/meta-workflows/models/build-task-rearm.models.js +64 -0
- package/dist/esm/meta-workflows/models/build-task-rearm.models.js.map +1 -1
- package/dist/esm/meta-workflows/models/creation-intervention.models.d.ts +308 -0
- package/dist/esm/meta-workflows/models/creation-intervention.models.d.ts.map +1 -0
- package/dist/esm/meta-workflows/models/creation-intervention.models.js +365 -0
- package/dist/esm/meta-workflows/models/creation-intervention.models.js.map +1 -0
- package/dist/esm/meta-workflows/models/generation-step-progress.models.d.ts +61 -0
- package/dist/esm/meta-workflows/models/generation-step-progress.models.d.ts.map +1 -0
- package/dist/esm/meta-workflows/models/generation-step-progress.models.js +58 -0
- package/dist/esm/meta-workflows/models/generation-step-progress.models.js.map +1 -0
- package/dist/esm/meta-workflows/models/meta-workflows-lane.models.d.ts +10 -6
- package/dist/esm/meta-workflows/models/meta-workflows-lane.models.d.ts.map +1 -1
- package/dist/esm/meta-workflows/models/meta-workflows-lane.models.js +11 -6
- package/dist/esm/meta-workflows/models/meta-workflows-lane.models.js.map +1 -1
- package/dist/esm/meta-workflows/models/playbook-run-checkpoint.models.d.ts +3 -0
- package/dist/esm/meta-workflows/models/playbook-run-checkpoint.models.d.ts.map +1 -1
- package/dist/esm/meta-workflows/models/playbook-run-checkpoint.models.js +8 -1
- package/dist/esm/meta-workflows/models/playbook-run-checkpoint.models.js.map +1 -1
- package/dist/esm/meta-workflows/models/playbook-run-record.models.d.ts +26 -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 +66 -10
- package/dist/esm/meta-workflows/models/playbook-run-record.models.js.map +1 -1
- package/dist/esm/meta-workflows/services/application-assembly-checks.companion.utils.d.ts +13 -0
- package/dist/esm/meta-workflows/services/application-assembly-checks.companion.utils.d.ts.map +1 -0
- package/dist/esm/meta-workflows/services/application-assembly-checks.companion.utils.js +33 -0
- package/dist/esm/meta-workflows/services/application-assembly-checks.companion.utils.js.map +1 -0
- package/dist/esm/meta-workflows/services/application-assembly-repair.companion.utils.d.ts +145 -0
- package/dist/esm/meta-workflows/services/application-assembly-repair.companion.utils.d.ts.map +1 -0
- package/dist/esm/meta-workflows/services/application-assembly-repair.companion.utils.js +179 -0
- package/dist/esm/meta-workflows/services/application-assembly-repair.companion.utils.js.map +1 -0
- package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.d.ts +376 -17
- 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 +805 -39
- package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-generation-step.companion.service.d.ts +93 -7
- 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 +142 -25
- package/dist/esm/meta-workflows/services/application-build-generation-step.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-task-coding-policy.companion.service.d.ts +120 -3
- 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 +325 -16
- package/dist/esm/meta-workflows/services/application-build-task-coding-policy.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-website-context.companion.service.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-website-context.companion.service.js +15 -6
- package/dist/esm/meta-workflows/services/application-build-website-context.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/services/application-maturity-executor.companion.service.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/application-maturity-executor.companion.service.js +10 -11
- package/dist/esm/meta-workflows/services/application-maturity-executor.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/services/capability-composition-executor.companion.service.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/capability-composition-executor.companion.service.js +10 -11
- package/dist/esm/meta-workflows/services/capability-composition-executor.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/services/creation-intervention-ledger.companion.service.d.ts +82 -0
- package/dist/esm/meta-workflows/services/creation-intervention-ledger.companion.service.d.ts.map +1 -0
- package/dist/esm/meta-workflows/services/creation-intervention-ledger.companion.service.js +291 -0
- package/dist/esm/meta-workflows/services/creation-intervention-ledger.companion.service.js.map +1 -0
- package/dist/esm/meta-workflows/services/creation-lane-preflight.companion.service.d.ts +60 -0
- package/dist/esm/meta-workflows/services/creation-lane-preflight.companion.service.d.ts.map +1 -0
- package/dist/esm/meta-workflows/services/creation-lane-preflight.companion.service.js +66 -0
- package/dist/esm/meta-workflows/services/creation-lane-preflight.companion.service.js.map +1 -0
- package/dist/esm/meta-workflows/services/creation-run-report.companion.service.d.ts +53 -0
- package/dist/esm/meta-workflows/services/creation-run-report.companion.service.d.ts.map +1 -0
- package/dist/esm/meta-workflows/services/creation-run-report.companion.service.js +164 -0
- package/dist/esm/meta-workflows/services/creation-run-report.companion.service.js.map +1 -0
- package/dist/esm/meta-workflows/services/dossier-write-queue.companion.utils.d.ts +37 -0
- package/dist/esm/meta-workflows/services/dossier-write-queue.companion.utils.d.ts.map +1 -0
- package/dist/esm/meta-workflows/services/dossier-write-queue.companion.utils.js +52 -0
- package/dist/esm/meta-workflows/services/dossier-write-queue.companion.utils.js.map +1 -0
- package/dist/esm/meta-workflows/services/dossier.companion.service.d.ts +74 -14
- package/dist/esm/meta-workflows/services/dossier.companion.service.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/dossier.companion.service.js +180 -28
- package/dist/esm/meta-workflows/services/dossier.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/services/foundation-executor.companion.service.d.ts +2 -3
- 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 +2 -8
- package/dist/esm/meta-workflows/services/foundation-executor.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/services/interview-answer-proposal.companion.d.ts +67 -0
- package/dist/esm/meta-workflows/services/interview-answer-proposal.companion.d.ts.map +1 -0
- package/dist/esm/meta-workflows/services/interview-answer-proposal.companion.js +64 -0
- package/dist/esm/meta-workflows/services/interview-answer-proposal.companion.js.map +1 -0
- package/dist/esm/meta-workflows/services/playbook-instance.companion.service.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/playbook-instance.companion.service.js +11 -3
- package/dist/esm/meta-workflows/services/playbook-instance.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/services/playbook-run-write-register.companion.service.d.ts +92 -4
- package/dist/esm/meta-workflows/services/playbook-run-write-register.companion.service.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/playbook-run-write-register.companion.service.js +328 -7
- package/dist/esm/meta-workflows/services/playbook-run-write-register.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/services/playbook-run.companion.service.d.ts +105 -6
- 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 +309 -39
- package/dist/esm/meta-workflows/services/playbook-run.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/services/playbook-spend-meter.companion.service.d.ts +62 -1
- package/dist/esm/meta-workflows/services/playbook-spend-meter.companion.service.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/playbook-spend-meter.companion.service.js +152 -2
- package/dist/esm/meta-workflows/services/playbook-spend-meter.companion.service.js.map +1 -1
- package/package.json +22 -18
- package/dist/esm/.tsbuildinfo +0 -1
- package/dist/esm/__tests__/asset-noop.d.ts +0 -3
- package/dist/esm/__tests__/asset-noop.d.ts.map +0 -1
- package/dist/esm/__tests__/asset-noop.js +0 -2
- package/dist/esm/__tests__/asset-noop.js.map +0 -1
- package/dist/esm/__tests__/chdir-dogfood-app.setup.d.ts +0 -2
- package/dist/esm/__tests__/chdir-dogfood-app.setup.d.ts.map +0 -1
- package/dist/esm/__tests__/chdir-dogfood-app.setup.js +0 -44
- package/dist/esm/__tests__/chdir-dogfood-app.setup.js.map +0 -1
- package/dist/esm/__tests__/internal-test-view.d.ts +0 -39
- package/dist/esm/__tests__/internal-test-view.d.ts.map +0 -1
- package/dist/esm/__tests__/internal-test-view.js +0 -2
- package/dist/esm/__tests__/internal-test-view.js.map +0 -1
- package/dist/esm/claude-cli/services/__tests__/support/in-memory-coding-actor-plane.d.ts +0 -50
- package/dist/esm/claude-cli/services/__tests__/support/in-memory-coding-actor-plane.d.ts.map +0 -1
- package/dist/esm/claude-cli/services/__tests__/support/in-memory-coding-actor-plane.js +0 -157
- package/dist/esm/claude-cli/services/__tests__/support/in-memory-coding-actor-plane.js.map +0 -1
- package/dist/esm/meta-workflows/services/__tests__/application-build-task-coding.companion.test-fixtures.d.ts +0 -8
- package/dist/esm/meta-workflows/services/__tests__/application-build-task-coding.companion.test-fixtures.d.ts.map +0 -1
- package/dist/esm/meta-workflows/services/__tests__/application-build-task-coding.companion.test-fixtures.js +0 -43
- package/dist/esm/meta-workflows/services/__tests__/application-build-task-coding.companion.test-fixtures.js.map +0 -1
- package/dist/esm/meta-workflows/services/__tests__/support/in-memory-actor-plane.d.ts +0 -79
- package/dist/esm/meta-workflows/services/__tests__/support/in-memory-actor-plane.d.ts.map +0 -1
- package/dist/esm/meta-workflows/services/__tests__/support/in-memory-actor-plane.js +0 -193
- package/dist/esm/meta-workflows/services/__tests__/support/in-memory-actor-plane.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"brand-accept.companion.service.js","sourceRoot":"","sources":["../../../../../src/brand/services/brand-accept.companion.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAExE,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAC7E,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAE9C,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EACL,0BAA0B,EAC1B,aAAa,EACb,kBAAkB,EAElB,mBAAmB,GACpB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,2BAA2B,EAC3B,SAAS,GAGV,MAAM,uBAAuB,CAAC;AAK/B,OAAO,EACL,gBAAgB,EAChB,+BAA+B,GAEhC,MAAM,+BAA+B,CAAC;AAGvC,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AAEjF,OAAO,EAAE,6BAA6B,EAAE,MAAM,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0BACvF,wBAAwB;iBAC7B;aACF,CAAC,CAAC;QACL,CAAC;QACD,OAAO,iBAAiB,CAAC;IAC3B,CAAC;CACF,CAAA;AA1eY,2BAA2B;IADvC,UAAU,EAAE;IAKR,WAAA,MAAM,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAA;IACjC,WAAA,MAAM,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAA;IAE9C,WAAA,MAAM,CAAC,kBAAkB,CAAC,oBAAoB,CAAC,CAAA;IAE/C,WAAA,MAAM,CAAC,uBAAuB,CAAC,gBAAgB,CAAC,CAAA;IAEhD,WAAA,MAAM,CAAC,uBAAuB,CAAC,oBAAoB,CAAC,CAAA;qCAPO,aAAa;QAE1C,0BAA0B,oBAMT,6BAA6B;GAZpE,2BAA2B,CA0evC","sourcesContent":["import { copyFile, mkdir, readFile, writeFile } from 'node:fs/promises';\nimport type { PropagateBrandAssetsOutcome } from '@wildo-ai/application-creation-runtime';\nimport { propagateAcceptedBrand } from './brand-propagation.companion.utils';\nimport { basename, resolve } from 'node:path';\n\nimport { inject, injectable } from 'inversify';\nimport {\n ErrorBuilderBackendService,\n LoggerService,\n SAAS_SERVICE_TYPES,\n type AgentsBackendService,\n describeCaughtError,\n} from '@wildo-ai/saas-backend-lib';\nimport {\n ErrorCustomMessageReference,\n ErrorType,\n type AgentTraceContext,\n type FlowsActors_Agent_Invocation,\n} from '@wildo-ai/saas-models';\nimport {\n LLMProvider_GenerateStructuredInputSchema,\n LLMProvider_GenerateStructuredOutputSchema,\n} from '@wildo-ai/external-connectors-models';\nimport {\n BrandAssetFormat,\n BrandRenderPromptResponseSchema,\n type BrandAssetConfig,\n} from '@wildo-ai/saas-specifications';\nimport type { LLMProvider_ImageContent } from '@wildo-ai/external-connectors-models';\n\nimport { COMPANION_SERVICE_TYPES } from '../../core/inject/models/service-types';\nimport type { CompanionContext } from '../../core/context/companion-context';\nimport { CompanionIntrospectionService } from '../../core/introspection/services/companion-introspection.companion.service';\nimport { LOGO_JUDGE_AGENT_REF } from '../models/logo-judge.actors-system.definitions';\nimport {\n BrandLogoJudgeRecommendation,\n BrandLogoJudgeVerdictSchema,\n BrandLogoJudgeVerdictStrictSchema,\n type BrandLogoJudgeVerdict,\n} from '../models/logo-judge.schemas';\n\n/**\n * The staging manifest written by `LogoGenerationCompanionService` or the logo deliberation\n * (`generated/brand/manifest.json`). Only `assets` is read here; the generation step's own verbatim\n * `prompt` cache key is ignored.\n */\ninterface GeneratedAssetManifest {\n assets: BrandAssetConfig[];\n}\n\nexport interface BrandAcceptOptions {\n /** Run the judge review point and include its verdict (default: true). */\n runJudge?: boolean;\n /**\n * Gate promotion on the judge: when true, a non-`ACCEPT` verdict throws\n * before any file is written. Default false — the human accept POST is the\n * authority and may override a `REVISE`/`REJECT` verdict (the judge is\n * advisory). Ignored when `runJudge` is false.\n */\n requireJudgeAcceptance?: boolean;\n}\n\n/** The promoted result surfaced back to the accept route. */\nexport interface BrandAcceptResult {\n /** SSOT-relative paths of the image files copied into `specifications/src/brand/assets/`. */\n promotedFiles: string[];\n /** The `BrandAssetConfig[]` written into `resolved-assets.generated.ts` (SSOT storageRefs). */\n promotedAssets: BrandAssetConfig[];\n /** The app-root-relative path of the rewritten SSOT module. */\n resolvedAssetsModulePath: string;\n /** The judge verdict when the judge ran and succeeded; null otherwise. */\n judgeVerdict: BrandLogoJudgeVerdict | null;\n /** Non-fatal warnings (e.g. the judge was requested but its LLM call failed). */\n warnings: string[];\n /**\n * The accepted mark copied to every surface that serves it — the app frontend, the website, the docs\n * portal, the backend's runtime `brandAssets`. Every accept propagates, whichever door accepted.\n */\n propagation?: PropagateBrandAssetsOutcome;\n /** Why propagation could not run; also appended to `warnings`. Never fails the accept. */\n propagationError?: string;\n}\n\nconst GENERATED_BRAND_DIR_SEGMENTS = ['.wildo-saas', 'generated', 'brand'] as const;\nconst SPEC_BRAND_DIR_SEGMENTS = ['specifications', 'src', 'brand'] as const;\nconst RESOLVED_ASSETS_MODULE = 'resolved-assets.generated.ts';\n/** The `storageRef` prefix promoted assets carry — relative to the brand spec folder. */\nconst SSOT_ASSET_REF_PREFIX = './assets';\n\n/**\n * Brand ACCEPT / PROMOTE companion service — the second, DECOUPLED half of the\n * brand/logo system (the first half is `LogoGenerationCompanionService`, which\n * generates candidates into staging).\n *\n * It performs the ACCEPT review-point promotion: it reads a staged candidate\n * from the generation STAGING area (`.wildo-saas/generated/brand/`), OPTIONALLY\n * invokes the `brand.logo.judge.agent` VISION review point (attaching the staged\n * master logo image so the judge scores the actual rendered pixels against the\n * authored brief) and includes its verdict, then PROMOTES the\n * accepted candidate into the specification SSOT: it copies the master +\n * derived image files into `specifications/src/brand/assets/` and rewrites\n * `specifications/src/brand/resolved-assets.generated.ts` so\n * `generatedResolvedBrandAssets` lists the promoted `BrandAssetConfig[]` with\n * `storageRef` now pointing at `./assets/<file>` (relative to the brand spec\n * folder). The application-owned brand snapshot composes that module through\n * its `resolvedAssets` field, so the promoted set becomes the source of truth\n * every brand-image consumer resolves against.\n *\n * **Human bypass.** The promote step is exactly what a HUMAN path performs by\n * hand: drop logo files into `specifications/src/brand/assets/` and list them\n * in `resolved-assets.generated.ts`. Because promotion works from ANY staged\n * candidate manifest (whether the image agent or a designer produced the\n * files), a human can bypass generation entirely — stage a hand-made master +\n * `manifest.json` under `.wildo-saas/generated/brand/` and run accept, or edit\n * the SSOT module directly. The accept step is a convenience over the SSOT, not\n * a gate on it.\n */\n@injectable()\nexport class BrandAcceptCompanionService {\n private readonly logDebug: (message: string, context?: Record<string, unknown>) => void;\n\n constructor(\n @inject(SAAS_SERVICE_TYPES.Logger) private readonly logger: LoggerService,\n @inject(SAAS_SERVICE_TYPES.ErrorBuilderService)\n private readonly errorBuilder: ErrorBuilderBackendService,\n @inject(SAAS_SERVICE_TYPES.AgentsBackendService)\n private readonly agentsService: AgentsBackendService,\n @inject(COMPANION_SERVICE_TYPES.CompanionContext)\n private readonly companionContext: CompanionContext,\n @inject(COMPANION_SERVICE_TYPES.IntrospectionService)\n private readonly companionIntrospectionService: CompanionIntrospectionService,\n ) {\n this.logDebug = this.logger.debugByType('BrandAcceptCompanionService');\n this.logger.setDebugTypeLogging('BrandAcceptCompanionService', true);\n }\n\n public async accept(\n options: BrandAcceptOptions = {},\n traceContext?: AgentTraceContext,\n ): Promise<BrandAcceptResult> {\n const runJudge = options.runJudge !== false;\n const warnings: string[] = [];\n\n // ── 1. Read + validate the staged candidate ────────────────\n const brandDir = resolve(this.companionContext.saasRoot, ...GENERATED_BRAND_DIR_SEGMENTS);\n const manifest = await this.readStagingManifest(brandDir);\n this.logDebug('brand accept — candidate loaded', { assetCount: manifest.assets.length });\n\n // ── 2. Judge review point (optional, advisory) ─────────────\n let judgeVerdict: BrandLogoJudgeVerdict | null = null;\n if (runJudge) {\n const outcome = await this.runJudgeReview(manifest, traceContext);\n if (outcome.verdict) {\n judgeVerdict = outcome.verdict;\n this.logDebug('brand accept — judge verdict', {\n recommendation: judgeVerdict.recommendation,\n overallScore: judgeVerdict.overallScore,\n });\n if (\n options.requireJudgeAcceptance\n && judgeVerdict.recommendation !== BrandLogoJudgeRecommendation.ACCEPT\n ) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.VALIDATION,\n context: {\n message:\n `Judge did not recommend ACCEPT (got ${judgeVerdict.recommendation}, `\n + `overallScore ${judgeVerdict.overallScore}) and \\`requireJudgeAcceptance\\` was set. `\n + `Rationale: ${judgeVerdict.rationale}`,\n },\n });\n }\n } else {\n // The judge is advisory: a failed LLM call must not block a human accept\n // (unless the human explicitly gated on it via requireJudgeAcceptance).\n if (options.requireJudgeAcceptance) {\n throw this.errorBuilder.buildError(ErrorType.INTERNAL, undefined, {\n customMessageReference: ErrorCustomMessageReference.INTERNAL,\n context: {\n message:\n `\\`requireJudgeAcceptance\\` was set but the judge review could not complete: `\n + `${outcome.error ?? 'unknown error'}`,\n },\n });\n }\n warnings.push(`Judge review requested but did not complete: ${outcome.error ?? 'unknown error'}`);\n }\n }\n\n // ── 3. Promote: copy files → SSOT assets/ ──────────────────\n const specBrandDir = resolve(this.companionContext.saasRoot, ...SPEC_BRAND_DIR_SEGMENTS);\n const assetsDir = resolve(specBrandDir, 'assets');\n await mkdir(assetsDir, { recursive: true });\n\n const promotedAt = new Date().toISOString();\n const promotedAssets: BrandAssetConfig[] = [];\n const promotedFiles: string[] = [];\n\n for (const asset of manifest.assets) {\n const fileName = basename(asset.storageRef);\n const sourceFile = resolve(this.companionContext.saasRoot, asset.storageRef);\n const destFile = resolve(assetsDir, fileName);\n\n try {\n await copyFile(sourceFile, destFile);\n } catch (error) {\n throw this.errorBuilder.buildError(ErrorType.INTERNAL, undefined, {\n customMessageReference: ErrorCustomMessageReference.INTERNAL,\n context: {\n message:\n `Failed to copy staged asset '${asset.ref}' from '${asset.storageRef}' into the `\n + `specification SSOT assets/ folder: `\n + describeCaughtError(error),\n },\n });\n }\n\n promotedAssets.push({\n ...asset,\n // Rewrite the storage locator to the SSOT-relative path; preserve\n // composition / theme / purpose / derivedFrom; stamp the\n // acceptance moment as generatedAt.\n storageRef: `${SSOT_ASSET_REF_PREFIX}/${fileName}`,\n generatedAt: promotedAt,\n });\n promotedFiles.push(`${SPEC_BRAND_DIR_SEGMENTS.join('/')}/assets/${fileName}`);\n }\n\n // ── 4. Rewrite the SSOT module ─────────────────────────────\n const resolvedAssetsPath = resolve(specBrandDir, RESOLVED_ASSETS_MODULE);\n await this.rewriteResolvedAssetsModule(resolvedAssetsPath, promotedAssets, promotedAt);\n\n const resolvedAssetsModulePath = `${SPEC_BRAND_DIR_SEGMENTS.join('/')}/${RESOLVED_ASSETS_MODULE}`;\n this.logDebug('brand accept — promoted to SSOT', {\n promotedFiles: promotedFiles.length,\n resolvedAssetsModulePath,\n });\n\n const { propagation, propagationError } = await propagateAcceptedBrand(this.companionContext.saasRoot, this.logger, promotedAssets);\n if (propagationError !== undefined) warnings.push(`The mark is accepted but could not be propagated: ${propagationError}`);\n\n return {\n promotedFiles,\n promotedAssets,\n resolvedAssetsModulePath,\n judgeVerdict,\n warnings,\n ...(propagation !== undefined ? { propagation } : {}),\n ...(propagationError !== undefined ? { propagationError } : {}),\n };\n }\n\n /** Read + shape-check the staging manifest; a missing/invalid manifest is a clear VALIDATION error. */\n private async readStagingManifest(brandDir: string): Promise<GeneratedAssetManifest> {\n let raw: string;\n try {\n raw = await readFile(resolve(brandDir, 'manifest.json'), 'utf8');\n } catch {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.VALIDATION,\n context: {\n message:\n 'No staged logo candidate found. Expected a manifest at '\n + '`.wildo-saas/generated/brand/manifest.json` (produced by `POST /api/companion/brand/generate-logo`, '\n + 'or dropped there by a human path).',\n },\n });\n }\n\n let manifest: GeneratedAssetManifest;\n try {\n manifest = JSON.parse(raw) as GeneratedAssetManifest;\n } catch (error) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.VALIDATION,\n context: {\n message: `Staged brand manifest is not valid JSON: ${describeCaughtError(error)}`,\n },\n });\n }\n\n if (\n !manifest\n || !Array.isArray(manifest.assets)\n || manifest.assets.length === 0\n ) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.VALIDATION,\n context: {\n message:\n 'Staged brand manifest is malformed — expected `{ assets: BrandAssetConfig[] }` '\n + 'with at least one asset.',\n },\n });\n }\n\n return manifest;\n }\n\n /**\n * Run the JUDGE review point as a TRUE VISION review: re-assemble the current\n * brief (via the `brand-render-prompt` introspection subprocess, the same\n * source the logo generation step used), READ the staged master logo image off\n * disk and base64-encode it, then invoke `brand.logo.judge.agent`\n * (GENERATE_STRUCTURED with a VISION image part) so the model SCORES the actual\n * rendered pixels against the brief and returns the strict-validated verdict.\n *\n * The master image rides the engine's multimodal structured-generation path\n * (`LLMProvider_GenerateStructuredInputSchema.images`): the AI SDK feeds the\n * pixels to the vision-capable model (`gpt-4o`) while still constraining the\n * answer to {@link BrandLogoJudgeVerdictSchema}. The structural asset\n * descriptors (the derived asset set) remain in the text prompt as\n * SUPPORTING metadata — they answer \"is the asset set complete?\", which the\n * pixels alone cannot. When the master is not a vision-readable raster\n * (e.g. a hand-staged SVG master), the image is omitted and the judge degrades\n * to the structural review, noted in the prompt so it never silently pretends\n * to have seen pixels it could not decode.\n *\n * Best-effort by design: any failure (subprocess, provider, malformed output,\n * unreadable image) is returned as `{ verdict: null, error }` so the caller can\n * decide whether to proceed (advisory) or fail (`requireJudgeAcceptance`).\n */\n private async runJudgeReview(\n manifest: GeneratedAssetManifest,\n traceContext?: AgentTraceContext,\n ): Promise<{ verdict: BrandLogoJudgeVerdict | null; error?: string }> {\n try {\n const introspection = await this.companionIntrospectionService.requestInfo({\n serviceKey: this.pickBrandCarrierServiceKey(),\n behavior: 'brand-render-prompt',\n input: {},\n });\n if (introspection.success === false) {\n return { verdict: null, error: `brief assembly failed: ${introspection.error.message}` };\n }\n\n const render = BrandRenderPromptResponseSchema.parse(introspection.data);\n const masterImage = await this.loadMasterImageForJudge(manifest);\n const prompt = this.buildJudgePrompt(render.prompt, manifest, masterImage.attached);\n\n const input: {\n prompt: string;\n schema: typeof BrandLogoJudgeVerdictSchema;\n images?: LLMProvider_ImageContent[];\n } = { prompt, schema: BrandLogoJudgeVerdictSchema };\n if (masterImage.image) {\n input.images = [masterImage.image];\n }\n\n const invocation: FlowsActors_Agent_Invocation<\n typeof LLMProvider_GenerateStructuredInputSchema,\n typeof LLMProvider_GenerateStructuredOutputSchema\n > = {\n agentRef: LOGO_JUDGE_AGENT_REF,\n initiator: {},\n invocationContext: [],\n input,\n output: { object: {} },\n executionContext: {},\n artifactBindings: [],\n };\n\n const response = await this.agentsService.invokeAgent(invocation, traceContext);\n const rawObject = (response.output as { object?: unknown } | undefined)?.object;\n const parsed = BrandLogoJudgeVerdictStrictSchema.safeParse(rawObject);\n if (!parsed.success) {\n return {\n verdict: null,\n error:\n 'judge returned a verdict that does not match the contract: '\n + parsed.error.issues.map((issue) => `${issue.path.join('.')}: ${issue.message}`).join('; '),\n };\n }\n return { verdict: parsed.data };\n } catch (error) {\n return { verdict: null, error: describeCaughtError(error) };\n }\n }\n\n /**\n * Locate the staged MASTER logo (the generated primary — the single asset with\n * no `derivedFrom`), read its bytes off disk and return a base64 data-URI image\n * part the judge invocation attaches for vision review.\n *\n * Only vision-readable RASTER masters (PNG / WEBP) are attached; a non-raster\n * master (a hand-staged SVG / ICO the model cannot decode) returns\n * `{ image: null, attached: false }` so the judge degrades to a structural\n * review rather than shipping an undecodable part to the provider. A read\n * failure likewise degrades (best-effort — the caller already treats a\n * verdict-less outcome as advisory).\n */\n private async loadMasterImageForJudge(\n manifest: GeneratedAssetManifest,\n ): Promise<{ image: LLMProvider_ImageContent | null; attached: boolean }> {\n const master = manifest.assets.find((asset) => !asset.derivedFrom) ?? manifest.assets[0];\n if (!master) {\n return { image: null, attached: false };\n }\n\n const mediaType = this.rasterMediaTypeForFormat(master.format);\n if (!mediaType) {\n this.logDebug('brand accept — master is not a vision-readable raster; judge degrades to structural review', {\n masterRef: master.ref,\n format: master.format,\n });\n return { image: null, attached: false };\n }\n\n try {\n const bytes = await readFile(resolve(this.companionContext.saasRoot, master.storageRef));\n const dataUri = `data:${mediaType};base64,${bytes.toString('base64')}`;\n return { image: { type: 'image', image: dataUri }, attached: true };\n } catch (error) {\n this.logDebug('brand accept — could not read master image for judge; degrading to structural review', {\n masterRef: master.ref,\n storageRef: master.storageRef,\n error: describeCaughtError(error),\n });\n return { image: null, attached: false };\n }\n }\n\n /** Map a raster brand-asset format to its IANA media type; non-raster formats (SVG/ICO) return null (not vision-readable). */\n private rasterMediaTypeForFormat(format: BrandAssetConfig['format']): string | null {\n switch (format) {\n case BrandAssetFormat.PNG:\n return 'image/png';\n case BrandAssetFormat.WEBP:\n return 'image/webp';\n default:\n return null;\n }\n }\n\n /**\n * Compose the judge text prompt: the desired-mark brief + a structural\n * description of the staged candidate. When `imageAttached` is true the master\n * logo image travels alongside this text as a vision part (see\n * {@link runJudgeReview}); the prompt then directs the model to judge the\n * PIXELS it can see, using the asset descriptors only as supporting metadata.\n * When false the model has no pixels and judges structurally, and the prompt\n * says so honestly.\n */\n private buildJudgePrompt(\n briefPrompt: string,\n manifest: GeneratedAssetManifest,\n imageAttached: boolean,\n ): string {\n const lines: string[] = [];\n lines.push('# Brand brief (the DESIRED logo)');\n lines.push(briefPrompt);\n lines.push('');\n lines.push('# Candidate under review (staged)');\n lines.push(\n imageAttached\n ? '- The generated MASTER logo image is ATTACHED to this message. Judge what you actually SEE.'\n : '- NOTE: the master image could not be attached (not a vision-readable raster, or unreadable). '\n + 'Judge structurally from the descriptors below and say so in your rationale.',\n );\n lines.push(`- asset count: ${manifest.assets.length}`);\n lines.push('- assets:');\n for (const asset of manifest.assets) {\n const dims = asset.width && asset.height ? ` ${asset.width}x${asset.height}` : '';\n const derived = asset.derivedFrom ? ` derivedFrom=${asset.derivedFrom}` : ' (generated primary — the ATTACHED master)';\n lines.push(\n ` - ${asset.ref}: ${asset.composition}/${asset.theme}/${asset.purpose} `\n + `${asset.format}${dims}${derived}`,\n );\n }\n lines.push('');\n lines.push('# Your task');\n lines.push(\n imageAttached\n ? 'Judge how well the ATTACHED master logo satisfies the brief. Evaluate what you SEE: '\n + 'composition + visual balance, legibility when scaled down to a favicon/small size, '\n + 'on-brand aesthetic + colour, and adherence to the authored mark direction + symbolism '\n + '(and respect for the avoid-list). Use the asset descriptors above only for asset-set '\n + 'completeness/coherence. Score overall fit, brief alignment, and production '\n + 'craft. Give a recommendation (ACCEPT / REVISE / REJECT), a rationale grounded in the '\n + 'image, concrete strengths, and concrete concerns. Do not invent details you cannot see.'\n : 'Judge how well this candidate satisfies the brief from the descriptors above (no image was '\n + 'available). Score overall fit, brief alignment (mark direction + symbolism honoured, '\n + 'avoid-list respected), and production craft (asset-set completeness + coherence). '\n + 'Give a recommendation (ACCEPT / REVISE / REJECT), a rationale, concrete strengths, and '\n + 'concrete concerns. Judge only from the brief and descriptors — do not invent facts.',\n );\n return lines.join('\\n');\n }\n\n /**\n * Rewrite `resolved-assets.generated.ts` so `generatedResolvedBrandAssets`\n * lists the promoted assets. Preserves the file's existing header (import +\n * JSDoc) by splicing at the `export const generatedResolvedBrandAssets`\n * marker and re-emitting only the export. The output is valid TS that\n * compiles: `import type { BrandAssetConfig } from '@wildo-ai/saas-specifications'`\n * stays in the header, and the const is typed `BrandAssetConfig[]`.\n */\n private async rewriteResolvedAssetsModule(\n modulePath: string,\n assets: BrandAssetConfig[],\n generatedAt: string,\n ): Promise<void> {\n const existing = await readFile(modulePath, 'utf8').catch(() => null);\n const header = this.extractModuleHeader(existing);\n const body =\n `export const generatedResolvedBrandAssets: BrandAssetConfig[] = ${this.serializeAssets(assets)};\\n`;\n const banner =\n `// Promoted by the brand ACCEPT step (BrandAcceptCompanionService) at ${generatedAt}.\\n`\n + `// Do NOT hand-edit for AI-path promotions — re-run accept. Human path: replace files in\\n`\n + `// ./assets/ and edit this list directly.\\n`;\n await writeFile(modulePath, `${header}${banner}${body}`, 'utf8');\n }\n\n /**\n * Recover the module header (everything before the `generatedResolvedBrandAssets`\n * export) so the authored import + JSDoc survive the rewrite. Falls back to a\n * faithful minimal header if the file is missing or the marker is absent (e.g.\n * a human deleted it) — the accept step must still emit a compiling module.\n */\n private extractModuleHeader(existing: string | null): string {\n const marker = 'export const generatedResolvedBrandAssets';\n if (existing) {\n const index = existing.indexOf(marker);\n if (index >= 0) {\n return existing.slice(0, index);\n }\n }\n return (\n `import { BrandAssetComposition, BrandAssetFormat, BrandAssetPurpose, BrandAssetTheme } from '@wildo-ai/saas-specifications';\\n`\n + `import type { BrandAssetConfig } from '@wildo-ai/saas-specifications';\\n\\n`\n + `/**\\n`\n + ` * GENERATED + COMMITTED brand assets — the ACCEPTED logo set. This is the\\n`\n + ` * source-of-truth \\`resolvedAssets\\` consumed by the application-owned brand snapshot.\\n`\n + ` * The image files live beside this file in \\`./assets/\\`; each entry's\\n`\n + ` * \\`storageRef\\` is a path relative to THIS spec's brand folder.\\n`\n + ` */\\n`\n );\n }\n\n /** Serialize the promoted assets as an idiomatic TS array literal (unquoted keys, single-quoted strings). */\n private serializeAssets(assets: BrandAssetConfig[]): string {\n if (assets.length === 0) return '[]';\n const entries = assets.map((asset) => this.serializeAsset(asset));\n return `[\\n${entries.join('\\n')}\\n]`;\n }\n\n private serializeAsset(asset: BrandAssetConfig): string {\n const lines: string[] = [' {'];\n const push = (key: string, value: string): void => {\n lines.push(` ${key}: ${value},`);\n };\n push('ref', this.q(asset.ref));\n /*\n * The four closed vocabularies are emitted as ENUM MEMBERS, never as quoted strings.\n *\n * `BrandAssetConfig` types these fields as `BrandAssetComposition`, `BrandAssetTheme`,\n * `BrandAssetPurpose` and `BrandAssetFormat`. A quoted literal is not assignable to a TS enum, so\n * emitting `composition: 'SYMBOL'` produced `TS2322: Type '\"SYMBOL\"' is not assignable to type\n * 'BrandAssetComposition'` — and the file this writes lives in the application's SPECIFICATIONS\n * package, whose typecheck is a required verification for every spec-stage and view build task.\n *\n * Measured on the first end-to-end journey run (#1273): the brand accept step promoted nine\n * assets at 08:34 and every spec-stage and view task from that moment on failed\n * `check:specifications-typecheck`, authored nothing, and was re-dispatched. 36 errors, all in\n * this one generated file, and the whole band stalled behind them for hours.\n *\n * The member NAME equals its VALUE in all four enums, so the mapping is direct rather than a\n * lookup — and if that ever stops being true this line breaks loudly at the application's\n * typecheck, which is where it should break.\n */\n push('composition', `BrandAssetComposition.${asset.composition}`);\n push('theme', `BrandAssetTheme.${asset.theme}`);\n push('purpose', `BrandAssetPurpose.${asset.purpose}`);\n push('storageRef', this.q(asset.storageRef));\n push('format', `BrandAssetFormat.${asset.format}`);\n if (asset.width !== undefined) push('width', String(asset.width));\n if (asset.height !== undefined) push('height', String(asset.height));\n if (asset.derivedFrom !== undefined) push('derivedFrom', this.q(asset.derivedFrom));\n push('generatedAt', this.q(asset.generatedAt));\n lines.push(' },');\n return lines.join('\\n');\n }\n\n /** Single-quote a string for TS source emission, escaping backslashes + single quotes. */\n private q(value: string): string {\n return `'${value.replace(/\\\\/g, '\\\\\\\\').replace(/'/g, \"\\\\'\")}'`;\n }\n\n /**\n * Pick the first backend service — the `brand-render-prompt` behavior routes\n * to the `specifications` target every backend service declares (mirror of\n * `LogoGenerationCompanionService.pickBrandCarrierServiceKey`).\n */\n private pickBrandCarrierServiceKey(): string {\n const backendServiceKey = Object.entries(this.companionContext.servicesByKey)\n .find(([, service]) => !service.frontendType)?.[0];\n if (!backendServiceKey) {\n throw this.errorBuilder.buildError(ErrorType.CONFIGURATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.CONFIGURATION,\n context: {\n message: 'No backend service is available to resolve the brand-render-prompt behavior '\n + '(needed for the judge review). It routes to the `specifications` target, declared on '\n + 'every backend service.',\n },\n });\n }\n return backendServiceKey;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"brand-accept.companion.service.js","sourceRoot":"","sources":["../../../../../src/brand/services/brand-accept.companion.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,gCAAgC,EAAoC,MAAM,wCAAwC,CAAC;AAC5H,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAC7E,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAE9C,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EACL,0BAA0B,EAC1B,aAAa,EACb,kBAAkB,EAElB,mBAAmB,GACpB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,2BAA2B,EAC3B,SAAS,GAGV,MAAM,uBAAuB,CAAC;AAK/B,OAAO,EACL,gBAAgB,EAChB,+BAA+B,GAEhC,MAAM,+BAA+B,CAAC;AACvC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AA2B,CAAC,aAAa;gBACjE,OAAO,EAAE;oBACP,OAAO,EAAE,8EAA8E;0BACnF,uFAAuF;0BACvF,wBAAwB;iBAC7B;aACF,CAAC,CAAC;QACL,CAAC;QACD,OAAO,iBAAiB,CAAC;IAC3B,CAAC;CACF,CAAA;AAneY,2BAA2B;IADvC,UAAU,EAAE;IAKR,WAAA,MAAM,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAA;IACjC,WAAA,MAAM,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAA;IAE9C,WAAA,MAAM,CAAC,kBAAkB,CAAC,oBAAoB,CAAC,CAAA;IAE/C,WAAA,MAAM,CAAC,uBAAuB,CAAC,gBAAgB,CAAC,CAAA;IAEhD,WAAA,MAAM,CAAC,uBAAuB,CAAC,oBAAoB,CAAC,CAAA;qCAPO,aAAa;QAE1C,0BAA0B,oBAMT,6BAA6B;GAZpE,2BAA2B,CAmevC","sourcesContent":["import { copyFile, mkdir, readFile } from 'node:fs/promises';\nimport { writeSpecificationFileAtomically, type PropagateBrandAssetsOutcome } from '@wildo-ai/application-creation-runtime';\nimport { propagateAcceptedBrand } from './brand-propagation.companion.utils';\nimport { basename, resolve } from 'node:path';\n\nimport { inject, injectable } from 'inversify';\nimport {\n ErrorBuilderBackendService,\n LoggerService,\n SAAS_SERVICE_TYPES,\n type AgentsBackendService,\n describeCaughtError,\n} from '@wildo-ai/saas-backend-lib';\nimport {\n ErrorCustomMessageReference,\n ErrorType,\n type AgentTraceContext,\n type FlowsActors_Agent_Invocation,\n} from '@wildo-ai/saas-models';\nimport {\n LLMProvider_GenerateStructuredInputSchema,\n LLMProvider_GenerateStructuredOutputSchema,\n} from '@wildo-ai/external-connectors-models';\nimport {\n BrandAssetFormat,\n BrandRenderPromptResponseSchema,\n type BrandAssetConfig,\n} from '@wildo-ai/saas-specifications';\nimport { BRAND_RESOLVED_ASSETS_MODULE_FILE, BRAND_RESOLVED_ASSETS_MODULE_HEADER } from '@wildo-ai/saas-specifications/application-creation';\nimport type { LLMProvider_ImageContent } from '@wildo-ai/external-connectors-models';\n\nimport { COMPANION_SERVICE_TYPES } from '../../core/inject/models/service-types';\nimport type { CompanionContext } from '../../core/context/companion-context';\nimport { CompanionIntrospectionService } from '../../core/introspection/services/companion-introspection.companion.service';\nimport { LOGO_JUDGE_AGENT_REF } from '../models/logo-judge.actors-system.definitions';\nimport {\n BrandLogoJudgeRecommendation,\n BrandLogoJudgeVerdictSchema,\n BrandLogoJudgeVerdictStrictSchema,\n type BrandLogoJudgeVerdict,\n} from '../models/logo-judge.schemas';\n\n/**\n * The staging manifest written by `LogoGenerationCompanionService` or the logo deliberation\n * (`generated/brand/manifest.json`). Only `assets` is read here; the generation step's own verbatim\n * `prompt` cache key is ignored.\n */\ninterface GeneratedAssetManifest {\n assets: BrandAssetConfig[];\n}\n\nexport interface BrandAcceptOptions {\n /** Run the judge review point and include its verdict (default: true). */\n runJudge?: boolean;\n /**\n * Gate promotion on the judge: when true, a non-`ACCEPT` verdict throws\n * before any file is written. Default false — the human accept POST is the\n * authority and may override a `REVISE`/`REJECT` verdict (the judge is\n * advisory). Ignored when `runJudge` is false.\n */\n requireJudgeAcceptance?: boolean;\n}\n\n/** The promoted result surfaced back to the accept route. */\nexport interface BrandAcceptResult {\n /** SSOT-relative paths of the image files copied into `specifications/src/brand/assets/`. */\n promotedFiles: string[];\n /** The `BrandAssetConfig[]` written into `resolved-assets.generated.ts` (SSOT storageRefs). */\n promotedAssets: BrandAssetConfig[];\n /** The app-root-relative path of the rewritten SSOT module. */\n resolvedAssetsModulePath: string;\n /** The judge verdict when the judge ran and succeeded; null otherwise. */\n judgeVerdict: BrandLogoJudgeVerdict | null;\n /** Non-fatal warnings (e.g. the judge was requested but its LLM call failed). */\n warnings: string[];\n /**\n * The accepted mark copied to every surface that serves it — the app frontend, the website, the docs\n * portal, the backend's runtime `brandAssets`. Every accept propagates, whichever door accepted.\n */\n propagation?: PropagateBrandAssetsOutcome;\n /** Why propagation could not run; also appended to `warnings`. Never fails the accept. */\n propagationError?: string;\n}\n\nconst GENERATED_BRAND_DIR_SEGMENTS = ['.wildo-saas', 'generated', 'brand'] as const;\nconst SPEC_BRAND_DIR_SEGMENTS = ['specifications', 'src', 'brand'] as const;\n// The module's name and header are one definition with the brief's landing and the logo step (#2237).\nconst RESOLVED_ASSETS_MODULE = BRAND_RESOLVED_ASSETS_MODULE_FILE;\n/** The `storageRef` prefix promoted assets carry — relative to the brand spec folder. */\nconst SSOT_ASSET_REF_PREFIX = './assets';\n\n/**\n * Brand ACCEPT / PROMOTE companion service — the second, DECOUPLED half of the\n * brand/logo system (the first half is `LogoGenerationCompanionService`, which\n * generates candidates into staging).\n *\n * It performs the ACCEPT review-point promotion: it reads a staged candidate\n * from the generation STAGING area (`.wildo-saas/generated/brand/`), OPTIONALLY\n * invokes the `brand.logo.judge.agent` VISION review point (attaching the staged\n * master logo image so the judge scores the actual rendered pixels against the\n * authored brief) and includes its verdict, then PROMOTES the\n * accepted candidate into the specification SSOT: it copies the master +\n * derived image files into `specifications/src/brand/assets/` and rewrites\n * `specifications/src/brand/resolved-assets.generated.ts` so\n * `generatedResolvedBrandAssets` lists the promoted `BrandAssetConfig[]` with\n * `storageRef` now pointing at `./assets/<file>` (relative to the brand spec\n * folder). The application-owned brand snapshot composes that module through\n * its `resolvedAssets` field, so the promoted set becomes the source of truth\n * every brand-image consumer resolves against.\n *\n * **Human bypass.** The promote step is exactly what a HUMAN path performs by\n * hand: drop logo files into `specifications/src/brand/assets/` and list them\n * in `resolved-assets.generated.ts`. Because promotion works from ANY staged\n * candidate manifest (whether the image agent or a designer produced the\n * files), a human can bypass generation entirely — stage a hand-made master +\n * `manifest.json` under `.wildo-saas/generated/brand/` and run accept, or edit\n * the SSOT module directly. The accept step is a convenience over the SSOT, not\n * a gate on it.\n */\n@injectable()\nexport class BrandAcceptCompanionService {\n private readonly logDebug: (message: string, context?: Record<string, unknown>) => void;\n\n constructor(\n @inject(SAAS_SERVICE_TYPES.Logger) private readonly logger: LoggerService,\n @inject(SAAS_SERVICE_TYPES.ErrorBuilderService)\n private readonly errorBuilder: ErrorBuilderBackendService,\n @inject(SAAS_SERVICE_TYPES.AgentsBackendService)\n private readonly agentsService: AgentsBackendService,\n @inject(COMPANION_SERVICE_TYPES.CompanionContext)\n private readonly companionContext: CompanionContext,\n @inject(COMPANION_SERVICE_TYPES.IntrospectionService)\n private readonly companionIntrospectionService: CompanionIntrospectionService,\n ) {\n this.logDebug = this.logger.debugByType('BrandAcceptCompanionService');\n this.logger.setDebugTypeLogging('BrandAcceptCompanionService', true);\n }\n\n public async accept(\n options: BrandAcceptOptions = {},\n traceContext?: AgentTraceContext,\n ): Promise<BrandAcceptResult> {\n const runJudge = options.runJudge !== false;\n const warnings: string[] = [];\n\n // ── 1. Read + validate the staged candidate ────────────────\n const brandDir = resolve(this.companionContext.saasRoot, ...GENERATED_BRAND_DIR_SEGMENTS);\n const manifest = await this.readStagingManifest(brandDir);\n this.logDebug('brand accept — candidate loaded', { assetCount: manifest.assets.length });\n\n // ── 2. Judge review point (optional, advisory) ─────────────\n let judgeVerdict: BrandLogoJudgeVerdict | null = null;\n if (runJudge) {\n const outcome = await this.runJudgeReview(manifest, traceContext);\n if (outcome.verdict) {\n judgeVerdict = outcome.verdict;\n this.logDebug('brand accept — judge verdict', {\n recommendation: judgeVerdict.recommendation,\n overallScore: judgeVerdict.overallScore,\n });\n if (\n options.requireJudgeAcceptance\n && judgeVerdict.recommendation !== BrandLogoJudgeRecommendation.ACCEPT\n ) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.VALIDATION,\n context: {\n message:\n `Judge did not recommend ACCEPT (got ${judgeVerdict.recommendation}, `\n + `overallScore ${judgeVerdict.overallScore}) and \\`requireJudgeAcceptance\\` was set. `\n + `Rationale: ${judgeVerdict.rationale}`,\n },\n });\n }\n } else {\n // The judge is advisory: a failed LLM call must not block a human accept\n // (unless the human explicitly gated on it via requireJudgeAcceptance).\n if (options.requireJudgeAcceptance) {\n throw this.errorBuilder.buildError(ErrorType.INTERNAL, undefined, {\n customMessageReference: ErrorCustomMessageReference.INTERNAL,\n context: {\n message:\n `\\`requireJudgeAcceptance\\` was set but the judge review could not complete: `\n + `${outcome.error ?? 'unknown error'}`,\n },\n });\n }\n warnings.push(`Judge review requested but did not complete: ${outcome.error ?? 'unknown error'}`);\n }\n }\n\n // ── 3. Promote: copy files → SSOT assets/ ──────────────────\n const specBrandDir = resolve(this.companionContext.saasRoot, ...SPEC_BRAND_DIR_SEGMENTS);\n const assetsDir = resolve(specBrandDir, 'assets');\n await mkdir(assetsDir, { recursive: true });\n\n const promotedAt = new Date().toISOString();\n const promotedAssets: BrandAssetConfig[] = [];\n const promotedFiles: string[] = [];\n\n for (const asset of manifest.assets) {\n const fileName = basename(asset.storageRef);\n const sourceFile = resolve(this.companionContext.saasRoot, asset.storageRef);\n const destFile = resolve(assetsDir, fileName);\n\n try {\n await copyFile(sourceFile, destFile);\n } catch (error) {\n throw this.errorBuilder.buildError(ErrorType.INTERNAL, undefined, {\n customMessageReference: ErrorCustomMessageReference.INTERNAL,\n context: {\n message:\n `Failed to copy staged asset '${asset.ref}' from '${asset.storageRef}' into the `\n + `specification SSOT assets/ folder: `\n + describeCaughtError(error),\n },\n });\n }\n\n promotedAssets.push({\n ...asset,\n // Rewrite the storage locator to the SSOT-relative path; preserve\n // composition / theme / purpose / derivedFrom; stamp the\n // acceptance moment as generatedAt.\n storageRef: `${SSOT_ASSET_REF_PREFIX}/${fileName}`,\n generatedAt: promotedAt,\n });\n promotedFiles.push(`${SPEC_BRAND_DIR_SEGMENTS.join('/')}/assets/${fileName}`);\n }\n\n // ── 4. Rewrite the SSOT module ─────────────────────────────\n const resolvedAssetsPath = resolve(specBrandDir, RESOLVED_ASSETS_MODULE);\n await this.rewriteResolvedAssetsModule(resolvedAssetsPath, promotedAssets, promotedAt);\n\n const resolvedAssetsModulePath = `${SPEC_BRAND_DIR_SEGMENTS.join('/')}/${RESOLVED_ASSETS_MODULE}`;\n this.logDebug('brand accept — promoted to SSOT', {\n promotedFiles: promotedFiles.length,\n resolvedAssetsModulePath,\n });\n\n const { propagation, propagationError } = await propagateAcceptedBrand(this.companionContext.saasRoot, this.logger, promotedAssets);\n if (propagationError !== undefined) warnings.push(`The mark is accepted but could not be propagated: ${propagationError}`);\n\n return {\n promotedFiles,\n promotedAssets,\n resolvedAssetsModulePath,\n judgeVerdict,\n warnings,\n ...(propagation !== undefined ? { propagation } : {}),\n ...(propagationError !== undefined ? { propagationError } : {}),\n };\n }\n\n /** Read + shape-check the staging manifest; a missing/invalid manifest is a clear VALIDATION error. */\n private async readStagingManifest(brandDir: string): Promise<GeneratedAssetManifest> {\n let raw: string;\n try {\n raw = await readFile(resolve(brandDir, 'manifest.json'), 'utf8');\n } catch {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.VALIDATION,\n context: {\n message:\n 'No staged logo candidate found. Expected a manifest at '\n + '`.wildo-saas/generated/brand/manifest.json` (produced by `POST /api/companion/brand/generate-logo`, '\n + 'or dropped there by a human path).',\n },\n });\n }\n\n let manifest: GeneratedAssetManifest;\n try {\n manifest = JSON.parse(raw) as GeneratedAssetManifest;\n } catch (error) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.VALIDATION,\n context: {\n message: `Staged brand manifest is not valid JSON: ${describeCaughtError(error)}`,\n },\n });\n }\n\n if (\n !manifest\n || !Array.isArray(manifest.assets)\n || manifest.assets.length === 0\n ) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.VALIDATION,\n context: {\n message:\n 'Staged brand manifest is malformed — expected `{ assets: BrandAssetConfig[] }` '\n + 'with at least one asset.',\n },\n });\n }\n\n return manifest;\n }\n\n /**\n * Run the JUDGE review point as a TRUE VISION review: re-assemble the current\n * brief (via the `brand-render-prompt` introspection subprocess, the same\n * source the logo generation step used), READ the staged master logo image off\n * disk and base64-encode it, then invoke `brand.logo.judge.agent`\n * (GENERATE_STRUCTURED with a VISION image part) so the model SCORES the actual\n * rendered pixels against the brief and returns the strict-validated verdict.\n *\n * The master image rides the engine's multimodal structured-generation path\n * (`LLMProvider_GenerateStructuredInputSchema.images`): the AI SDK feeds the\n * pixels to the vision-capable model (`gpt-4o`) while still constraining the\n * answer to {@link BrandLogoJudgeVerdictSchema}. The structural asset\n * descriptors (the derived asset set) remain in the text prompt as\n * SUPPORTING metadata — they answer \"is the asset set complete?\", which the\n * pixels alone cannot. When the master is not a vision-readable raster\n * (e.g. a hand-staged SVG master), the image is omitted and the judge degrades\n * to the structural review, noted in the prompt so it never silently pretends\n * to have seen pixels it could not decode.\n *\n * Best-effort by design: any failure (subprocess, provider, malformed output,\n * unreadable image) is returned as `{ verdict: null, error }` so the caller can\n * decide whether to proceed (advisory) or fail (`requireJudgeAcceptance`).\n */\n private async runJudgeReview(\n manifest: GeneratedAssetManifest,\n traceContext?: AgentTraceContext,\n ): Promise<{ verdict: BrandLogoJudgeVerdict | null; error?: string }> {\n try {\n const introspection = await this.companionIntrospectionService.requestInfo({\n serviceKey: this.pickBrandCarrierServiceKey(),\n behavior: 'brand-render-prompt',\n input: {},\n });\n if (introspection.success === false) {\n return { verdict: null, error: `brief assembly failed: ${introspection.error.message}` };\n }\n\n const render = BrandRenderPromptResponseSchema.parse(introspection.data);\n const masterImage = await this.loadMasterImageForJudge(manifest);\n const prompt = this.buildJudgePrompt(render.prompt, manifest, masterImage.attached);\n\n const input: {\n prompt: string;\n schema: typeof BrandLogoJudgeVerdictSchema;\n images?: LLMProvider_ImageContent[];\n } = { prompt, schema: BrandLogoJudgeVerdictSchema };\n if (masterImage.image) {\n input.images = [masterImage.image];\n }\n\n const invocation: FlowsActors_Agent_Invocation<\n typeof LLMProvider_GenerateStructuredInputSchema,\n typeof LLMProvider_GenerateStructuredOutputSchema\n > = {\n agentRef: LOGO_JUDGE_AGENT_REF,\n initiator: {},\n invocationContext: [],\n input,\n output: { object: {} },\n executionContext: {},\n artifactBindings: [],\n };\n\n const response = await this.agentsService.invokeAgent(invocation, traceContext);\n const rawObject = (response.output as { object?: unknown } | undefined)?.object;\n const parsed = BrandLogoJudgeVerdictStrictSchema.safeParse(rawObject);\n if (!parsed.success) {\n return {\n verdict: null,\n error:\n 'judge returned a verdict that does not match the contract: '\n + parsed.error.issues.map((issue) => `${issue.path.join('.')}: ${issue.message}`).join('; '),\n };\n }\n return { verdict: parsed.data };\n } catch (error) {\n return { verdict: null, error: describeCaughtError(error) };\n }\n }\n\n /**\n * Locate the staged MASTER logo (the generated primary — the single asset with\n * no `derivedFrom`), read its bytes off disk and return a base64 data-URI image\n * part the judge invocation attaches for vision review.\n *\n * Only vision-readable RASTER masters (PNG / WEBP) are attached; a non-raster\n * master (a hand-staged SVG / ICO the model cannot decode) returns\n * `{ image: null, attached: false }` so the judge degrades to a structural\n * review rather than shipping an undecodable part to the provider. A read\n * failure likewise degrades (best-effort — the caller already treats a\n * verdict-less outcome as advisory).\n */\n private async loadMasterImageForJudge(\n manifest: GeneratedAssetManifest,\n ): Promise<{ image: LLMProvider_ImageContent | null; attached: boolean }> {\n const master = manifest.assets.find((asset) => !asset.derivedFrom) ?? manifest.assets[0];\n if (!master) {\n return { image: null, attached: false };\n }\n\n const mediaType = this.rasterMediaTypeForFormat(master.format);\n if (!mediaType) {\n this.logDebug('brand accept — master is not a vision-readable raster; judge degrades to structural review', {\n masterRef: master.ref,\n format: master.format,\n });\n return { image: null, attached: false };\n }\n\n try {\n const bytes = await readFile(resolve(this.companionContext.saasRoot, master.storageRef));\n const dataUri = `data:${mediaType};base64,${bytes.toString('base64')}`;\n return { image: { type: 'image', image: dataUri }, attached: true };\n } catch (error) {\n this.logDebug('brand accept — could not read master image for judge; degrading to structural review', {\n masterRef: master.ref,\n storageRef: master.storageRef,\n error: describeCaughtError(error),\n });\n return { image: null, attached: false };\n }\n }\n\n /** Map a raster brand-asset format to its IANA media type; non-raster formats (SVG/ICO) return null (not vision-readable). */\n private rasterMediaTypeForFormat(format: BrandAssetConfig['format']): string | null {\n switch (format) {\n case BrandAssetFormat.PNG:\n return 'image/png';\n case BrandAssetFormat.WEBP:\n return 'image/webp';\n default:\n return null;\n }\n }\n\n /**\n * Compose the judge text prompt: the desired-mark brief + a structural\n * description of the staged candidate. When `imageAttached` is true the master\n * logo image travels alongside this text as a vision part (see\n * {@link runJudgeReview}); the prompt then directs the model to judge the\n * PIXELS it can see, using the asset descriptors only as supporting metadata.\n * When false the model has no pixels and judges structurally, and the prompt\n * says so honestly.\n */\n private buildJudgePrompt(\n briefPrompt: string,\n manifest: GeneratedAssetManifest,\n imageAttached: boolean,\n ): string {\n const lines: string[] = [];\n lines.push('# Brand brief (the DESIRED logo)');\n lines.push(briefPrompt);\n lines.push('');\n lines.push('# Candidate under review (staged)');\n lines.push(\n imageAttached\n ? '- The generated MASTER logo image is ATTACHED to this message. Judge what you actually SEE.'\n : '- NOTE: the master image could not be attached (not a vision-readable raster, or unreadable). '\n + 'Judge structurally from the descriptors below and say so in your rationale.',\n );\n lines.push(`- asset count: ${manifest.assets.length}`);\n lines.push('- assets:');\n for (const asset of manifest.assets) {\n const dims = asset.width && asset.height ? ` ${asset.width}x${asset.height}` : '';\n const derived = asset.derivedFrom ? ` derivedFrom=${asset.derivedFrom}` : ' (generated primary — the ATTACHED master)';\n lines.push(\n ` - ${asset.ref}: ${asset.composition}/${asset.theme}/${asset.purpose} `\n + `${asset.format}${dims}${derived}`,\n );\n }\n lines.push('');\n lines.push('# Your task');\n lines.push(\n imageAttached\n ? 'Judge how well the ATTACHED master logo satisfies the brief. Evaluate what you SEE: '\n + 'composition + visual balance, legibility when scaled down to a favicon/small size, '\n + 'on-brand aesthetic + colour, and adherence to the authored mark direction + symbolism '\n + '(and respect for the avoid-list). Use the asset descriptors above only for asset-set '\n + 'completeness/coherence. Score overall fit, brief alignment, and production '\n + 'craft. Give a recommendation (ACCEPT / REVISE / REJECT), a rationale grounded in the '\n + 'image, concrete strengths, and concrete concerns. Do not invent details you cannot see.'\n : 'Judge how well this candidate satisfies the brief from the descriptors above (no image was '\n + 'available). Score overall fit, brief alignment (mark direction + symbolism honoured, '\n + 'avoid-list respected), and production craft (asset-set completeness + coherence). '\n + 'Give a recommendation (ACCEPT / REVISE / REJECT), a rationale, concrete strengths, and '\n + 'concrete concerns. Judge only from the brief and descriptors — do not invent facts.',\n );\n return lines.join('\\n');\n }\n\n /**\n * Rewrite `resolved-assets.generated.ts` so `generatedResolvedBrandAssets`\n * lists the promoted assets. Preserves the file's existing header (import +\n * JSDoc) by splicing at the `export const generatedResolvedBrandAssets`\n * marker and re-emitting only the export. The output is valid TS that\n * compiles: `import type { BrandAssetConfig } from '@wildo-ai/saas-specifications'`\n * stays in the header, and the const is typed `BrandAssetConfig[]`.\n */\n private async rewriteResolvedAssetsModule(\n modulePath: string,\n assets: BrandAssetConfig[],\n generatedAt: string,\n ): Promise<void> {\n const existing = await readFile(modulePath, 'utf8').catch(() => null);\n const header = this.extractModuleHeader(existing);\n const body =\n `export const generatedResolvedBrandAssets: BrandAssetConfig[] = ${this.serializeAssets(assets)};\\n`;\n const banner =\n `// Promoted by the brand ACCEPT step (BrandAcceptCompanionService) at ${generatedAt}.\\n`\n + `// Do NOT hand-edit for AI-path promotions — re-run accept. Human path: replace files in\\n`\n + `// ./assets/ and edit this list directly.\\n`;\n // Atomically: this module is in the evaluated specifications graph (brand/index.ts → companion-exports.ts), so a\n // reader must never see it half-written (#2250).\n await writeSpecificationFileAtomically(modulePath, `${header}${banner}${body}`);\n }\n\n /**\n * Recover the module header (everything before the `generatedResolvedBrandAssets`\n * export) so the authored import + JSDoc survive the rewrite. Falls back to a\n * faithful minimal header if the file is missing or the marker is absent (e.g.\n * a human deleted it) — the accept step must still emit a compiling module.\n */\n private extractModuleHeader(existing: string | null): string {\n const marker = 'export const generatedResolvedBrandAssets';\n if (existing) {\n const index = existing.indexOf(marker);\n if (index >= 0) {\n return existing.slice(0, index);\n }\n }\n return BRAND_RESOLVED_ASSETS_MODULE_HEADER;\n }\n\n /** Serialize the promoted assets as an idiomatic TS array literal (unquoted keys, single-quoted strings). */\n private serializeAssets(assets: BrandAssetConfig[]): string {\n if (assets.length === 0) return '[]';\n const entries = assets.map((asset) => this.serializeAsset(asset));\n return `[\\n${entries.join('\\n')}\\n]`;\n }\n\n private serializeAsset(asset: BrandAssetConfig): string {\n const lines: string[] = [' {'];\n const push = (key: string, value: string): void => {\n lines.push(` ${key}: ${value},`);\n };\n push('ref', this.q(asset.ref));\n /*\n * The four closed vocabularies are emitted as ENUM MEMBERS, never as quoted strings.\n *\n * `BrandAssetConfig` types these fields as `BrandAssetComposition`, `BrandAssetTheme`,\n * `BrandAssetPurpose` and `BrandAssetFormat`. A quoted literal is not assignable to a TS enum, so\n * emitting `composition: 'SYMBOL'` produced `TS2322: Type '\"SYMBOL\"' is not assignable to type\n * 'BrandAssetComposition'` — and the file this writes lives in the application's SPECIFICATIONS\n * package, whose typecheck is a required verification for every spec-stage and view build task.\n *\n * Measured on the first end-to-end journey run (#1273): the brand accept step promoted nine\n * assets at 08:34 and every spec-stage and view task from that moment on failed\n * `check:specifications-typecheck`, authored nothing, and was re-dispatched. 36 errors, all in\n * this one generated file, and the whole band stalled behind them for hours.\n *\n * The member NAME equals its VALUE in all four enums, so the mapping is direct rather than a\n * lookup — and if that ever stops being true this line breaks loudly at the application's\n * typecheck, which is where it should break.\n */\n push('composition', `BrandAssetComposition.${asset.composition}`);\n push('theme', `BrandAssetTheme.${asset.theme}`);\n push('purpose', `BrandAssetPurpose.${asset.purpose}`);\n push('storageRef', this.q(asset.storageRef));\n push('format', `BrandAssetFormat.${asset.format}`);\n if (asset.width !== undefined) push('width', String(asset.width));\n if (asset.height !== undefined) push('height', String(asset.height));\n if (asset.derivedFrom !== undefined) push('derivedFrom', this.q(asset.derivedFrom));\n push('generatedAt', this.q(asset.generatedAt));\n lines.push(' },');\n return lines.join('\\n');\n }\n\n /** Single-quote a string for TS source emission, escaping backslashes + single quotes. */\n private q(value: string): string {\n return `'${value.replace(/\\\\/g, '\\\\\\\\').replace(/'/g, \"\\\\'\")}'`;\n }\n\n /**\n * Pick the first backend service — the `brand-render-prompt` behavior routes\n * to the `specifications` target every backend service declares (mirror of\n * `LogoGenerationCompanionService.pickBrandCarrierServiceKey`).\n */\n private pickBrandCarrierServiceKey(): string {\n const backendServiceKey = Object.entries(this.companionContext.servicesByKey)\n .find(([, service]) => !service.frontendType)?.[0];\n if (!backendServiceKey) {\n throw this.errorBuilder.buildError(ErrorType.CONFIGURATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.CONFIGURATION,\n context: {\n message: 'No backend service is available to resolve the brand-render-prompt behavior '\n + '(needed for the judge review). It routes to the `specifications` target, declared on '\n + 'every backend service.',\n },\n });\n }\n return backendServiceKey;\n }\n}\n"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { type CodingAgent_Usage } from '@wildo-ai/external-connectors-models';
|
|
2
3
|
import type { GitWorktreeSnapshot } from './coding-agent-dispatch.models';
|
|
3
4
|
/**
|
|
4
5
|
* What a PARKED coding run needs to be continued — the `checkpoint.context` of its execution (#1359).
|
|
@@ -110,8 +111,28 @@ export declare const ApplicationCodingRunCheckpointSchema: z.ZodObject<{
|
|
|
110
111
|
parkedUntil: z.ZodOptional<z.ZodString>;
|
|
111
112
|
}, z.core.$strict>;
|
|
112
113
|
parkedAt: z.ZodString;
|
|
114
|
+
priorLegsUsage: z.ZodOptional<z.ZodObject<{
|
|
115
|
+
contextUsed: z.ZodOptional<z.ZodNumber>;
|
|
116
|
+
contextWindowSize: z.ZodOptional<z.ZodNumber>;
|
|
117
|
+
inputTokens: z.ZodOptional<z.ZodNumber>;
|
|
118
|
+
outputTokens: z.ZodOptional<z.ZodNumber>;
|
|
119
|
+
cachedReadTokens: z.ZodOptional<z.ZodNumber>;
|
|
120
|
+
cachedWriteTokens: z.ZodOptional<z.ZodNumber>;
|
|
121
|
+
totalTokens: z.ZodOptional<z.ZodNumber>;
|
|
122
|
+
cost: z.ZodOptional<z.ZodObject<{
|
|
123
|
+
amount: z.ZodNumber;
|
|
124
|
+
currency: z.ZodString;
|
|
125
|
+
}, z.core.$strip>>;
|
|
126
|
+
}, z.core.$strip>>;
|
|
113
127
|
}, z.core.$strip>;
|
|
114
128
|
export type ApplicationCodingRunCheckpoint = z.infer<typeof ApplicationCodingRunCheckpointSchema>;
|
|
129
|
+
/**
|
|
130
|
+
* A resumed run's usage: the earlier legs' and this leg's, as ONE run (#2232 review). Tokens add, because each
|
|
131
|
+
* leg reports its own; the context pair is the latest reading; the cost is this leg's, because the agent reports
|
|
132
|
+
* the session's cumulative total and a resumed session continues from it — unless this leg reported none, or a
|
|
133
|
+
* zero after a positive figure (a crashed result's zeroed value), which leaves the earlier total standing.
|
|
134
|
+
*/
|
|
135
|
+
export declare function mergeResumedLegUsage(prior: CodingAgent_Usage | undefined, leg: CodingAgent_Usage | undefined): CodingAgent_Usage | undefined;
|
|
115
136
|
/**
|
|
116
137
|
* The STARTUP reading of a parked run: may a host that has just restarted keep this question open?
|
|
117
138
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application-coding-run-checkpoint.models.d.ts","sourceRoot":"","sources":["../../../../../src/claude-cli/models/application-coding-run-checkpoint.models.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"application-coding-run-checkpoint.models.d.ts","sourceRoot":"","sources":["../../../../../src/claude-cli/models/application-coding-run-checkpoint.models.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAgE,KAAK,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAE5I,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAE1E;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,sCAAsC,EAAG,wBAAiC,CAAC;AAgBxF,eAAO,MAAM,oCAAoC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAgB/C,CAAC;AACH,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oCAAoC,CAAC,CAAC;AAElG;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,iBAAiB,GAAG,SAAS,EAAE,GAAG,EAAE,iBAAiB,GAAG,SAAS,GAAG,iBAAiB,GAAG,SAAS,CAY5I;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,2BAA2B,CAAC,UAAU,EAAE,8BAA8B,GAAG,OAAO,CAE/F"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { MetaWorkflow_ApplicationCodingTaskContractSchema } from '@wildo-ai/saas-models/meta-workflows';
|
|
3
|
-
import { CodingAgent_SessionSuspensionSchema } from '@wildo-ai/external-connectors-models';
|
|
3
|
+
import { CodingAgent_SessionSuspensionSchema, CodingAgent_UsageSchema } from '@wildo-ai/external-connectors-models';
|
|
4
4
|
/**
|
|
5
5
|
* What a PARKED coding run needs to be continued — the `checkpoint.context` of its execution (#1359).
|
|
6
6
|
*
|
|
@@ -50,7 +50,39 @@ export const ApplicationCodingRunCheckpointSchema = z.object({
|
|
|
50
50
|
/** The agent session an answer re-enters, and whether and until when it can be. */
|
|
51
51
|
suspension: CodingAgent_SessionSuspensionSchema,
|
|
52
52
|
parkedAt: z.string().min(1),
|
|
53
|
+
/**
|
|
54
|
+
* What the run's legs so far reported, up to this park (#2232 review). A resume re-enters the SAME execution
|
|
55
|
+
* and row, and its agent turn reports only its own leg's TOKENS (a turn's tally) while its COST is the
|
|
56
|
+
* session's cumulative total. Without this the row's tokens lost every leg before the last. Absent when the
|
|
57
|
+
* parked leg reported nothing, and on every checkpoint written before the field.
|
|
58
|
+
*/
|
|
59
|
+
priorLegsUsage: CodingAgent_UsageSchema.optional(),
|
|
53
60
|
});
|
|
61
|
+
/**
|
|
62
|
+
* A resumed run's usage: the earlier legs' and this leg's, as ONE run (#2232 review). Tokens add, because each
|
|
63
|
+
* leg reports its own; the context pair is the latest reading; the cost is this leg's, because the agent reports
|
|
64
|
+
* the session's cumulative total and a resumed session continues from it — unless this leg reported none, or a
|
|
65
|
+
* zero after a positive figure (a crashed result's zeroed value), which leaves the earlier total standing.
|
|
66
|
+
*/
|
|
67
|
+
export function mergeResumedLegUsage(prior, leg) {
|
|
68
|
+
if (!prior)
|
|
69
|
+
return leg;
|
|
70
|
+
if (!leg)
|
|
71
|
+
return prior;
|
|
72
|
+
const merged = { ...prior };
|
|
73
|
+
for (const key of ['inputTokens', 'outputTokens', 'cachedReadTokens', 'cachedWriteTokens', 'totalTokens']) {
|
|
74
|
+
if (prior[key] !== undefined || leg[key] !== undefined)
|
|
75
|
+
merged[key] = (prior[key] ?? 0) + (leg[key] ?? 0);
|
|
76
|
+
}
|
|
77
|
+
if (leg.contextUsed !== undefined)
|
|
78
|
+
merged.contextUsed = leg.contextUsed;
|
|
79
|
+
if (leg.contextWindowSize !== undefined)
|
|
80
|
+
merged.contextWindowSize = leg.contextWindowSize;
|
|
81
|
+
const zeroAfterPositive = leg.cost?.amount === 0 && (prior.cost?.amount ?? 0) > 0;
|
|
82
|
+
if (leg.cost !== undefined && !zeroAfterPositive)
|
|
83
|
+
merged.cost = leg.cost;
|
|
84
|
+
return merged;
|
|
85
|
+
}
|
|
54
86
|
/**
|
|
55
87
|
* The STARTUP reading of a parked run: may a host that has just restarted keep this question open?
|
|
56
88
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application-coding-run-checkpoint.models.js","sourceRoot":"","sources":["../../../../../src/claude-cli/models/application-coding-run-checkpoint.models.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,gDAAgD,EAAE,MAAM,sCAAsC,CAAC;AACxG,OAAO,EAAE,mCAAmC,EAAE,MAAM,sCAAsC,CAAC;
|
|
1
|
+
{"version":3,"file":"application-coding-run-checkpoint.models.js","sourceRoot":"","sources":["../../../../../src/claude-cli/models/application-coding-run-checkpoint.models.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,gDAAgD,EAAE,MAAM,sCAAsC,CAAC;AACxG,OAAO,EAAE,mCAAmC,EAAE,uBAAuB,EAA0B,MAAM,sCAAsC,CAAC;AAI5I;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,CAAC,MAAM,sCAAsC,GAAG,wBAAiC,CAAC;AAExF;;;GAGG;AACH,MAAM,8BAA8B,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC1B,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC7B,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,WAAW,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;CAC9E,CAAC,CAAC;AACH,MAAM,mCAAmC,GAAG,CAAC,CAAC,MAAM,CAClD,CAAC,KAAK,EAAE,EAAE,CAAC,8BAA8B,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,EAClE,EAAE,KAAK,EAAE,qDAAqD,EAAE,CACjE,CAAC;AAEF,MAAM,CAAC,MAAM,oCAAoC,GAA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AAG,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;IAClF,IAAI,GAAG,CAAC,IAAI,KAAK,SAAS,IAAI,CAAC,iBAAiB;QAAE,MAAM,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC;IACzE,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,UAAU,2BAA2B,CAAC,UAA0C;IACpF,OAAO,UAAU,CAAC,UAAU,CAAC,SAAS,CAAC;AACzC,CAAC","sourcesContent":["import { z } from 'zod';\nimport { MetaWorkflow_ApplicationCodingTaskContractSchema } from '@wildo-ai/saas-models/meta-workflows';\nimport { CodingAgent_SessionSuspensionSchema, CodingAgent_UsageSchema, type CodingAgent_Usage } from '@wildo-ai/external-connectors-models';\n\nimport type { GitWorktreeSnapshot } from './coding-agent-dispatch.models';\n\n/**\n * What a PARKED coding run needs to be continued — the `checkpoint.context` of its execution (#1359).\n *\n * ## Why this exists, and what it replaced\n *\n * A coding run that stops to ask the operator closes its agent process and releases the worktree\n * lock. Continuing it needs three things the agent's persisted session does not hold: the CONTRACT\n * the run is bounded by (mutation scope, verification checks), the BASELINE its final change set is\n * measured from, and the agent SESSION to re-enter.\n *\n * Until 2026-09-20 those lived in an in-process map, because a coding task had no execution and so\n * nowhere durable to put resume inputs. A companion restart emptied the map, and a second path\n * (`reconstructParkedCodingTaskForResume`) re-composed the contract from the build plan and captured\n * a FRESH baseline — so after a restart, a resumed run's change set was measured from the instant of\n * the answer, not from the instant the run began, and the edits made before the question fell out of\n * it. Two resume paths, the restart one the less exercised and the less faithful.\n *\n * Now the engine's execution driver writes this on the run's own execution when it suspends, hands\n * it back on resume, and clears it when the run concludes. One path, in-process or not, held to the\n * original bounds and the original baseline.\n *\n * ## What it is NOT\n *\n * Not the task row's `input`. That row is the run's durable IDENTITY and deliberately carries no\n * prompt or context bytes. This is transient resume input: it exists only while a question stands\n * (or a run ended without concluding), and the contract inside it is the one the run was admitted\n * under, context sources included, because the bounds are only the original bounds if nothing\n * re-derives them.\n */\nexport const APPLICATION_CODING_RUN_CHECKPOINT_KIND = 'application-coding-run' as const;\n\n/**\n * The baseline is written by this host and read back by it, so its TYPE is the host's own\n * `GitWorktreeSnapshot`; what is validated is the shape a change-set capture actually dereferences.\n */\nconst GitWorktreeSnapshotShapeSchema = z.object({\n headSha: z.string().min(1),\n capturedAt: z.string().min(1),\n files: z.record(z.string(), z.looseObject({ changeKind: z.string().min(1) })),\n});\nconst GitWorktreeSnapshotCheckpointSchema = z.custom<GitWorktreeSnapshot>(\n (value) => GitWorktreeSnapshotShapeSchema.safeParse(value).success,\n { error: 'The checkpoint baseline is not a worktree snapshot.' },\n);\n\nexport const ApplicationCodingRunCheckpointSchema = z.object({\n kind: z.literal(APPLICATION_CODING_RUN_CHECKPOINT_KIND),\n /** The build-plan task this run was dispatched for — what the dispatcher's parked-run lookup matches on. */\n taskRef: z.string().min(1),\n contract: MetaWorkflow_ApplicationCodingTaskContractSchema,\n baseline: GitWorktreeSnapshotCheckpointSchema,\n /** The agent session an answer re-enters, and whether and until when it can be. */\n suspension: CodingAgent_SessionSuspensionSchema,\n parkedAt: z.string().min(1),\n /**\n * What the run's legs so far reported, up to this park (#2232 review). A resume re-enters the SAME execution\n * and row, and its agent turn reports only its own leg's TOKENS (a turn's tally) while its COST is the\n * session's cumulative total. Without this the row's tokens lost every leg before the last. Absent when the\n * parked leg reported nothing, and on every checkpoint written before the field.\n */\n priorLegsUsage: CodingAgent_UsageSchema.optional(),\n});\nexport type ApplicationCodingRunCheckpoint = z.infer<typeof ApplicationCodingRunCheckpointSchema>;\n\n/**\n * A resumed run's usage: the earlier legs' and this leg's, as ONE run (#2232 review). Tokens add, because each\n * leg reports its own; the context pair is the latest reading; the cost is this leg's, because the agent reports\n * the session's cumulative total and a resumed session continues from it — unless this leg reported none, or a\n * zero after a positive figure (a crashed result's zeroed value), which leaves the earlier total standing.\n */\nexport function mergeResumedLegUsage(prior: CodingAgent_Usage | undefined, leg: CodingAgent_Usage | undefined): CodingAgent_Usage | undefined {\n if (!prior) return leg;\n if (!leg) return prior;\n const merged: CodingAgent_Usage = { ...prior };\n for (const key of ['inputTokens', 'outputTokens', 'cachedReadTokens', 'cachedWriteTokens', 'totalTokens'] as const) {\n if (prior[key] !== undefined || leg[key] !== undefined) merged[key] = (prior[key] ?? 0) + (leg[key] ?? 0);\n }\n if (leg.contextUsed !== undefined) merged.contextUsed = leg.contextUsed;\n if (leg.contextWindowSize !== undefined) merged.contextWindowSize = leg.contextWindowSize;\n const zeroAfterPositive = leg.cost?.amount === 0 && (prior.cost?.amount ?? 0) > 0;\n if (leg.cost !== undefined && !zeroAfterPositive) merged.cost = leg.cost;\n return merged;\n}\n\n/**\n * The STARTUP reading of a parked run: may a host that has just restarted keep this question open?\n *\n * **Yes whenever its session can be re-entered at all** (`resumable`) — and that is the same test a\n * live host applies, because a restarted host is in exactly the same position. The engine's own\n * contract on `awaitingInputTtlMs` says why: the parked run holds NO live agent process (\"the child is\n * closed the moment the run parks\"), the agent persists the session on disk, and \"a later answer\n * re-enters it through `session/load`\". A live host answering an hour later and a restarted host\n * answering an hour later both start a fresh agent and load the same session file. Nothing the first\n * holds is missing from the second: since #1360 the contract, the baseline and the session id are all\n * on this checkpoint, on the execution's own row.\n *\n * **`parkedUntil` is not read here, deliberately.** The same contract calls it \"an informational\n * freshness bound … not a timer that reaps a process\". Until #1533 this predicate read it as exactly\n * that timer, and it was the one reaper in the lane: on the #1273 run three parked coding runs —\n * carrying named product findings from twenty to forty minutes of agent work — were aborted at the\n * next boot after waiting 16, 22 and 40 minutes, two of them in the same second, because a respawn\n * is the most common event in this repository and a parked run waits for a human by design.\n *\n * **A session that genuinely cannot be loaded is discovered where it is USED**, not guessed at by a\n * clock: an answer to it resumes the run, `session/load` fails, and the engine settles the run FAILED\n * with that error, on the row the operator is looking at. Guessing at boot destroyed answerable\n * questions to avoid an error that the answer path already reports.\n *\n * A NON-resumable park (the agent advertises no `loadSession`) is not answerable on its own session by\n * any host, live or restarted, so it is not kept.\n */\nexport function isParkedCodingRunAnswerable(checkpoint: ApplicationCodingRunCheckpoint): boolean {\n return checkpoint.suspension.resumable;\n}\n"]}
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { type MetaWorkflow_ApplicationCodingTaskContract } from '@wildo-ai/saas-models/meta-workflows';
|
|
10
10
|
import { FlowsActors_Status } from '@wildo-ai/saas-models';
|
|
11
|
+
import type { BuildTaskLandedOverride } from '../../meta-workflows/models/build-task-rearm.models';
|
|
11
12
|
/**
|
|
12
13
|
* Run limits (P-18): defaults 30 min / 10 MiB, request-overridable up to
|
|
13
14
|
* hard caps 60 min / 32 MiB. The byte cap REJECTS (SIGTERMs the run), it
|
|
@@ -68,11 +69,47 @@ export declare enum VerificationKind {
|
|
|
68
69
|
* infrastructure error.
|
|
69
70
|
*
|
|
70
71
|
* Invisible to every other check in the catalog: a missing table is not a type
|
|
71
|
-
* error, so an application can typecheck green in
|
|
72
|
+
* error, so an application can typecheck green in every package and still
|
|
72
73
|
* refuse to boot with `postgresql_table_schema_mismatch`. That is the 2026-09-07
|
|
73
74
|
* wonder-todos crash-loop this check exists to turn into a build failure.
|
|
74
75
|
*/
|
|
75
|
-
SCHEMA_PLAN_DRIFT = "schema_plan_drift"
|
|
76
|
+
SCHEMA_PLAN_DRIFT = "schema_plan_drift",
|
|
77
|
+
/**
|
|
78
|
+
* `pnpm run build`, cwd = `<saasRoot>/<path>` — the package's OWN build script, so the template that wrote the
|
|
79
|
+
* package stays the authority on how it builds (`astro build` for the website, `docusaurus build` for the
|
|
80
|
+
* documentation portal).
|
|
81
|
+
*
|
|
82
|
+
* A typecheck cannot answer whether a site BUILDS (#2228): `astro build` refuses a page with no sections and
|
|
83
|
+
* renders every route, and `docusaurus build` refuses until the documentation is published and resolves every
|
|
84
|
+
* link. Measured on app-creation-test-004 (2026-10-01): the build lane read near-complete while the website did
|
|
85
|
+
* not build. Asked at the end of a build only (`bottom_up.assemble-verify` and the exhausted-plan gate), never
|
|
86
|
+
* per task — a site build takes minutes, and a task owes the package typecheck, which is the fast half.
|
|
87
|
+
* A package the application does not have answers "nothing to build".
|
|
88
|
+
*/
|
|
89
|
+
PACKAGE_BUILD = "package_build",
|
|
90
|
+
/**
|
|
91
|
+
* `wildo config validate` at the application root — does the application's configuration pass the checks the
|
|
92
|
+
* backend runs at startup? Warnings do not fail it; errors do, and an application with configuration errors
|
|
93
|
+
* does not boot (#2228). A CLI command that is not on PATH is "we could not ask", never a failing check.
|
|
94
|
+
*/
|
|
95
|
+
CONFIG_VALIDATE = "config_validate",
|
|
96
|
+
/**
|
|
97
|
+
* The RUNNING backend answers `GET <api base>/health/ready` with 200 (#2228) — the address is the one the frontend
|
|
98
|
+
* uses, `VITE_API_BASE_URL` in `frontend/.env`. A typecheck, a build and a config validation can all pass while
|
|
99
|
+
* the backend crash-loops at boot; only asking the running process answers whether it serves.
|
|
100
|
+
*
|
|
101
|
+
* Three outcomes: 200 passes; any other status fails (it is up and refuses readiness, and its body says why); no
|
|
102
|
+
* answer at all is "we could not ask" — a stopped backend and a crash-looping one look the same from here, so it is
|
|
103
|
+
* reported unrun, never as a pass.
|
|
104
|
+
*/
|
|
105
|
+
BACKEND_READY = "backend_ready",
|
|
106
|
+
/**
|
|
107
|
+
* `wildo local smoke --json` at the application root (#2228): sign in to the RUNNING application in a browser and
|
|
108
|
+
* render every page its navigation offers, failing on a crash or a server error. The CLI owns the drive — the
|
|
109
|
+
* companion ships into every application and must not carry a browser — and answers COULD_NOT_ASK where Playwright,
|
|
110
|
+
* its browser or the running application is absent, which this check reports unrun, never as a pass.
|
|
111
|
+
*/
|
|
112
|
+
BROWSER_SMOKE = "browser_smoke"
|
|
76
113
|
}
|
|
77
114
|
/**
|
|
78
115
|
* The only terminal interpretation the typed application-coding host writes.
|
|
@@ -210,6 +247,8 @@ export interface ApplicationCodingTaskVerificationPlan {
|
|
|
210
247
|
/** Where a coding run was started from (#1454, Step 7); stamped on the row so the thread shows it. */
|
|
211
248
|
export interface CodingRunOrigin {
|
|
212
249
|
readonly conversationId?: string;
|
|
250
|
+
/** Set when an operator ran a task the landing probe calls landed, and why (#2217). Stamped on the run's row. */
|
|
251
|
+
readonly landedOverride?: BuildTaskLandedOverride;
|
|
213
252
|
}
|
|
214
253
|
export interface ApplicationCodingTaskRunAdmission {
|
|
215
254
|
taskId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coding-agent-dispatch.models.d.ts","sourceRoot":"","sources":["../../../../../src/claude-cli/models/coding-agent-dispatch.models.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACL,KAAK,0CAA0C,EAChD,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAa,kBAAkB,EAAuB,MAAM,uBAAuB,CAAC;AAE3F;;;;;;GAMG;AACH,eAAO,MAAM,2BAA2B,QAAc,CAAC;AACvD,eAAO,MAAM,4BAA4B,QAAc,CAAC;AACxD,eAAO,MAAM,mCAAmC,QAAmB,CAAC;AACpE,eAAO,MAAM,gCAAgC,QAAmB,CAAC;AAEjE;;;;;;;;GAQG;AACH,oBAAY,gBAAgB;IAC1B;;;OAGG;IACH,SAAS,cAAc;IACvB;;;OAGG;IACH,WAAW,gBAAgB;IAC3B;;;;OAIG;IACH,0BAA0B,+BAA+B;IACzD;;;;;;;;OAQG;IACH,sBAAsB,2BAA2B;IACjD;;;;;;;;;;;;;;;;OAgBG;IACH,iBAAiB,sBAAsB;
|
|
1
|
+
{"version":3,"file":"coding-agent-dispatch.models.d.ts","sourceRoot":"","sources":["../../../../../src/claude-cli/models/coding-agent-dispatch.models.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACL,KAAK,0CAA0C,EAChD,MAAM,sCAAsC,CAAC;AAC9C,O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ructure error.
|
|
69
69
|
*
|
|
70
70
|
* Invisible to every other check in the catalog: a missing table is not a type
|
|
71
|
-
* error, so an application can typecheck green in
|
|
71
|
+
* error, so an application can typecheck green in every package and still
|
|
72
72
|
* refuse to boot with `postgresql_table_schema_mismatch`. That is the 2026-09-07
|
|
73
73
|
* wonder-todos crash-loop this check exists to turn into a build failure.
|
|
74
74
|
*/
|
|
75
75
|
VerificationKind["SCHEMA_PLAN_DRIFT"] = "schema_plan_drift";
|
|
76
|
+
/**
|
|
77
|
+
* `pnpm run build`, cwd = `<saasRoot>/<path>` — the package's OWN build script, so the template that wrote the
|
|
78
|
+
* package stays the authority on how it builds (`astro build` for the website, `docusaurus build` for the
|
|
79
|
+
* documentation portal).
|
|
80
|
+
*
|
|
81
|
+
* A typecheck cannot answer whether a site BUILDS (#2228): `astro build` refuses a page with no sections and
|
|
82
|
+
* renders every route, and `docusaurus build` refuses until the documentation is published and resolves every
|
|
83
|
+
* link. Measured on app-creation-test-004 (2026-10-01): the build lane read near-complete while the website did
|
|
84
|
+
* not build. Asked at the end of a build only (`bottom_up.assemble-verify` and the exhausted-plan gate), never
|
|
85
|
+
* per task — a site build takes minutes, and a task owes the package typecheck, which is the fast half.
|
|
86
|
+
* A package the application does not have answers "nothing to build".
|
|
87
|
+
*/
|
|
88
|
+
VerificationKind["PACKAGE_BUILD"] = "package_build";
|
|
89
|
+
/**
|
|
90
|
+
* `wildo config validate` at the application root — does the application's configuration pass the checks the
|
|
91
|
+
* backend runs at startup? Warnings do not fail it; errors do, and an application with configuration errors
|
|
92
|
+
* does not boot (#2228). A CLI command that is not on PATH is "we could not ask", never a failing check.
|
|
93
|
+
*/
|
|
94
|
+
VerificationKind["CONFIG_VALIDATE"] = "config_validate";
|
|
95
|
+
/**
|
|
96
|
+
* The RUNNING backend answers `GET <api base>/health/ready` with 200 (#2228) — the address is the one the frontend
|
|
97
|
+
* uses, `VITE_API_BASE_URL` in `frontend/.env`. A typecheck, a build and a config validation can all pass while
|
|
98
|
+
* the backend crash-loops at boot; only asking the running process answers whether it serves.
|
|
99
|
+
*
|
|
100
|
+
* Three outcomes: 200 passes; any other status fails (it is up and refuses readiness, and its body says why); no
|
|
101
|
+
* answer at all is "we could not ask" — a stopped backend and a crash-looping one look the same from here, so it is
|
|
102
|
+
* reported unrun, never as a pass.
|
|
103
|
+
*/
|
|
104
|
+
VerificationKind["BACKEND_READY"] = "backend_ready";
|
|
105
|
+
/**
|
|
106
|
+
* `wildo local smoke --json` at the application root (#2228): sign in to the RUNNING application in a browser and
|
|
107
|
+
* render every page its navigation offers, failing on a crash or a server error. The CLI owns the drive — the
|
|
108
|
+
* companion ships into every application and must not carry a browser — and answers COULD_NOT_ASK where Playwright,
|
|
109
|
+
* its browser or the running application is absent, which this check reports unrun, never as a pass.
|
|
110
|
+
*/
|
|
111
|
+
VerificationKind["BROWSER_SMOKE"] = "browser_smoke";
|
|
76
112
|
})(VerificationKind || (VerificationKind = {}));
|
|
77
113
|
/**
|
|
78
114
|
* The only terminal interpretation the typed application-coding host writes.
|
|
@@ -264,6 +300,12 @@ export const APPLICATION_CODING_TASK_VERIFICATION_CATALOG = {
|
|
|
264
300
|
// workspace directory, so each is a fixed ref like the four layers above.
|
|
265
301
|
'check:website-typecheck': { checkRef: 'check:website-typecheck', kind: VerificationKind.TYPECHECK, path: 'website' },
|
|
266
302
|
'check:technical-doc-typecheck': { checkRef: 'check:technical-doc-typecheck', kind: VerificationKind.TYPECHECK, path: 'technical-doc' },
|
|
303
|
+
// Whole-application questions a typecheck cannot answer (#2228). Asked at the end of a build, never per task.
|
|
304
|
+
'check:website-build': { checkRef: 'check:website-build', kind: VerificationKind.PACKAGE_BUILD, path: 'website' },
|
|
305
|
+
'check:technical-doc-build': { checkRef: 'check:technical-doc-build', kind: VerificationKind.PACKAGE_BUILD, path: 'technical-doc' },
|
|
306
|
+
'check:config-validate': { checkRef: 'check:config-validate', kind: VerificationKind.CONFIG_VALIDATE, path: null },
|
|
307
|
+
'check:backend-ready': { checkRef: 'check:backend-ready', kind: VerificationKind.BACKEND_READY, path: null },
|
|
308
|
+
'check:browser-smoke': { checkRef: 'check:browser-smoke', kind: VerificationKind.BROWSER_SMOKE, path: null },
|
|
267
309
|
};
|
|
268
310
|
/**
|
|
269
311
|
* The one PARAMETRIC check ref, for the package families whose directory is chosen at composition
|