@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":"playbook-instance.companion.service.js","sourceRoot":"","sources":["../../../../../src/meta-workflows/services/playbook-instance.companion.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE/C,OAAO,EACL,wBAAwB,EACxB,4BAA4B,EAC5B,sBAAsB,EACtB,2BAA2B,EAC3B,qBAAqB,EACrB,2BAA2B,GAE5B,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,6BAA6B,EAAE,MAAM,+BAA+B,CAAC;AAC9E,OAAO,EAAE,4BAA4B,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAEpG,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAC7E,OAAO,EACL,0BAA0B,EAC1B,sCAAsC,EAEtC,yBAAyB,EACzB,8BAA8B,EAC9B,sBAAsB,EAEtB,kBAAkB,GAEnB,MAAM,oDA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AAM,CAAC,uBAAuB,CAAC,2BAA2B,CAAC,CAAA;IAC3D,WAAA,MAAM,CAAC,uBAAuB,CAAC,kBAAkB,CAAC,CAAA;;GAR1C,gCAAgC,CAqQ5C;;AAED,wGAAwG;AACxG,SAAS,iBAAiB,CAAC,KAAc;IACvC,MAAM,IAAI,GAAI,KAAmC,EAAE,IAAI,CAAC;IACxD,OAAO,IAAI,KAAK,SAAS,CAAC;AAC5B,CAAC","sourcesContent":["import * as path from 'node:path';\nimport { inject, injectable } from 'inversify';\n\nimport {\n PlaybookElicitationError,\n PlaybookLaneBoundaryDecision,\n landPlaybookActivation,\n landPlaybookInstanceClosure,\n refinementProducersOf,\n resolveApplicationLineScope,\n type RefinementCatalogEntry,\n} from '@wildo-ai/application-creation-runtime';\nimport { getFrameworkKnowledgePlaybook } from '@wildo-ai/framework-knowledge';\nimport { getWorkspaceMutationLockPath, withDedicatedFileLock } from '@wildo-ai/platform-config-lib';\nimport type { LoggerService } from '@wildo-ai/saas-backend-lib';\nimport { SAAS_SERVICE_TYPES } from '@wildo-ai/saas-backend-lib';\nimport { MetaWorkflow_Executor } from '@wildo-ai/saas-models/meta-workflows';\nimport {\n MetaWorkflowPlaybookSchema,\n ApplicationPlaybookInstanceClosureKind,\n ApplicationSpecificationFamily,\n PlaybookInstanceKeySchema,\n secondaryLineDefinitionOfEntry,\n withPlaybookActivation,\n type ApplicationCreatorInputs,\n playbookInstanceId,\n type ApplicationPlaybookActivation,\n} from '@wildo-ai/saas-specifications/application-creation';\n\nimport { COMPANION_SERVICE_TYPES } from '../../core/inject/models/service-types';\nimport type { CompanionContext } from '../../core/context/companion-context';\nimport { AcceptOrigin, DecisionRecordActor, type AcceptedChangeCommitCompanionService } from '../../claude-cli/services/accepted-change-commit.companion.service';\nimport {\n APPLICATION_CREATION_AUTONOMY_POSTURE,\n LaneBoundaryTreatment,\n laneBoundaryTreatmentFor,\n} from '../models/playbook-run-checkpoint.models';\nimport { readCompiledApplicationLineCatalog } from '../models/application-line-catalog.models';\nimport type { DossierCompanionService } from './dossier.companion.service';\nimport type { PlaybookRunCompanionService } from './playbook-run.companion.service';\n\n/** The same prefix every landed specification constant carries (issue #65): app identity lives in values, never in export names. */\nconst LANDED_CONSTANT_PREFIX = 'application';\n\n/**\n * How long opening an instance waits for the workspace lock before refusing. Short on purpose: the caller is\n * a person in a conversation, and a coding run holding the tree for minutes is a reason to say \"busy\", not to\n * hang the conversation.\n */\nconst OPEN_INSTANCE_LOCK_RETRIES = { retries: 10, minTimeout: 250, maxTimeout: 2_000 } as const;\n\n/** A request to open an instance the host cannot honour; named so the transport answers 4xx. */\nexport class PlaybookInstanceRefusedError extends Error {}\n\n/** The tree is being written by a coding run right now; named so the transport answers 409. */\nexport class PlaybookInstanceTreeBusyError extends Error {}\n\nexport interface OpenPlaybookInstanceResult {\n readonly activation: ApplicationPlaybookActivation;\n /** `<ref>@<key>`: how every surface addresses this instance from now on. */\n readonly instanceId: string;\n readonly packageRelativePath: string;\n /** The commit that recorded it; absent when the posture leaves acceptance to a person, or on a dry run. */\n readonly commitSha?: string;\n readonly note: string;\n}\n\n/**\n * Opening a playbook INSTANCE (#1609): the one act that writes the dossier's activation record, and the\n * first act that must be committed the moment it is taken.\n *\n * ## Why here, and not in the dossier service\n *\n * An answer is a working edit a person commits with the rest of their work; an activation is a decision\n * about what the application is building, and it is committed at once under the automatic posture, with its\n * purpose and actor as trailers. That needs the workspace lock and the accept door, which the dossier's\n * answers never did.\n *\n * ## The lock is taken BEFORE the write\n *\n * A coding run's baseline must never see the dossier half-recorded, and a decision the tree was too busy to\n * commit must not be left behind as an uncommitted edit. So the write and the commit happen together under\n * the lock, or neither happens: a busy tree answers \"busy, try again\" with nothing written.\n */\n@injectable()\nexport class PlaybookInstanceCompanionService {\n private readonly logDebug: (message: string, context?: Record<string, unknown>) => void;\n\n public constructor(\n @inject(SAAS_SERVICE_TYPES.Logger) private readonly logger: LoggerService,\n @inject(COMPANION_SERVICE_TYPES.CompanionContext) private readonly companionContext: CompanionContext,\n @inject(COMPANION_SERVICE_TYPES.DossierService) private readonly dossier: DossierCompanionService,\n @inject(COMPANION_SERVICE_TYPES.AcceptedChangeCommitService) private readonly acceptedChangeCommit: AcceptedChangeCommitCompanionService,\n @inject(COMPANION_SERVICE_TYPES.PlaybookRunService) private readonly playbookRuns: Pick<PlaybookRunCompanionService, 'abandonInstanceRuns' | 'readLandedFamilies'>,\n ) {\n this.logDebug = this.logger.debugByType('PlaybookInstanceCompanionService');\n }\n\n public async openInstance(input: {\n readonly playbookRef: string;\n readonly instanceKey: string;\n readonly purpose: string;\n /** Families a secondary line needs although the main line declares them not applicable (#1608); refused on any other instance. */\n readonly neededFamilies?: readonly ApplicationSpecificationFamily[];\n /** The families a refinement line re-derives (#1608); required on one, refused on any other instance. */\n readonly refinedFamilies?: readonly ApplicationSpecificationFamily[];\n readonly actor: DecisionRecordActor;\n readonly dryRun?: boolean;\n }): Promise<OpenPlaybookInstanceResult> {\n const specificationsPackageRoot = this.companionContext.resolvedSpecifications?.packageRoot;\n if (!specificationsPackageRoot) {\n throw new PlaybookInstanceRefusedError('No specifications package is declared in wildo.saas.config.ts; there is nowhere to record the instance.');\n }\n const parsedKey = PlaybookInstanceKeySchema.safeParse(input.instanceKey);\n if (!parsedKey.success) {\n throw new PlaybookInstanceRefusedError(`\"${input.instanceKey}\" is not an instance key: use a kebab-case slug, e.g. \"enterprise-segment\".`);\n }\n if (input.purpose.trim().length === 0) {\n throw new PlaybookInstanceRefusedError('An instance is opened FOR something: say what, in the creator\\'s terms.');\n }\n const playbook = MetaWorkflowPlaybookSchema.safeParse(getFrameworkKnowledgePlaybook(input.playbookRef)?.playbook);\n if (!playbook.success) {\n throw new PlaybookInstanceRefusedError(`No compiled playbook is registered under \"${input.playbookRef}\".`);\n }\n /*\n * The same rule the run applies, stated where the instance is OPENED so nobody opens one that could\n * never run: a playbook acting on the application as a whole has no instances.\n */\n const executor = playbook.data.executor;\n if (executor === MetaWorkflow_Executor.CODING_AGENT || executor === MetaWorkflow_Executor.DETERMINISTIC_CLI || executor === MetaWorkflow_Executor.HUMAN) {\n throw new PlaybookInstanceRefusedError(`\"${input.playbookRef}\" acts on the application as a whole, so it has no instances.`);\n }\n\n const posture = laneBoundaryTreatmentFor(APPLICATION_CREATION_AUTONOMY_POSTURE, PlaybookLaneBoundaryDecision.APPROVE_RESULT);\n const commits = posture === LaneBoundaryTreatment.NOTIFY_AND_PROCEED && input.dryRun !== true;\n const record = async (): Promise<OpenPlaybookInstanceResult> => {\n const current = await this.dossier.readCreatorInputs();\n if (input.refinedFamilies !== undefined && input.refinedFamilies.length > 0) {\n await this.assertRefinable({\n entryPlaybookRef: input.playbookRef, instanceKey: parsedKey.data, purpose: input.purpose, families: input.refinedFamilies,\n ...(input.neededFamilies ? { neededFamilies: input.neededFamilies } : {}), current,\n });\n }\n let landed: Awaited<ReturnType<typeof landPlaybookActivation>>;\n try {\n landed = await landPlaybookActivation({\n specificationsPackageRoot,\n constantPrefix: LANDED_CONSTANT_PREFIX,\n playbook: playbook.data,\n current,\n instanceKey: parsedKey.data,\n purpose: input.purpose,\n ...(input.neededFamilies !== undefined ? { neededFamilies: input.neededFamilies } : {}),\n ...(input.refinedFamilies !== undefined ? { refinedFamilies: input.refinedFamilies } : {}),\n ...(input.dryRun === true ? { dryRun: true } : {}),\n });\n } catch (error) {\n // A closed instance re-opened, or families asked of an instance that is not a line: the caller's mistake, named.\n if (error instanceof PlaybookElicitationError) throw new PlaybookInstanceRefusedError(error.message);\n throw error;\n }\n const instanceId = playbookInstanceId(input.playbookRef, parsedKey.data);\n const specificationsRelativeRoot = path.relative(this.companionContext.saasRoot, specificationsPackageRoot);\n const written = [landed.packageRelativePath, ...landed.wiringEdits.map((edit) => edit.packageRelativePath)]\n .map((relative) => path.posix.join(specificationsRelativeRoot, relative));\n if (!commits) {\n return {\n activation: landed.activation,\n instanceId,\n packageRelativePath: landed.packageRelativePath,\n note: input.dryRun === true\n ? 'Dry run: nothing was written.'\n : 'Recorded as a working edit: the autonomy posture leaves committing it to you.',\n };\n }\n const committed = await this.acceptedChangeCommit.commitDecisionRecord({\n paths: written,\n summary: `Open the playbook instance ${instanceId}${landed.activation.neededFamilies ? ` (needs ${landed.activation.neededFamilies.join(', ')})` : ''}${landed.activation.refinedFamilies ? ` (refines ${landed.activation.refinedFamilies.join(', ')})` : ''}`,\n purpose: input.purpose,\n actor: input.actor,\n origin: AcceptOrigin.AUTONOMY_POSTURE,\n });\n this.logDebug('Playbook instance opened', { instanceId, commitSha: committed.commitSha });\n return {\n activation: landed.activation,\n instanceId,\n packageRelativePath: landed.packageRelativePath,\n commitSha: committed.commitSha,\n note: `Opened and committed (${committed.commitSha.slice(0, 8)}). Run it with instanceKey \"${parsedKey.data}\".`,\n };\n };\n if (input.dryRun === true) return record();\n try {\n return await withDedicatedFileLock(getWorkspaceMutationLockPath(this.companionContext.saasRoot), record, { retries: OPEN_INSTANCE_LOCK_RETRIES });\n } catch (error) {\n if (error instanceof PlaybookInstanceRefusedError) throw error;\n if (isLockUnavailable(error)) {\n throw new PlaybookInstanceTreeBusyError('The application\\'s working tree is being written right now (a coding run holds it). Nothing was recorded; try again in a moment.');\n }\n throw error;\n }\n }\n\n /**\n * What a refinement line names must be something it can refine (#1608). Refused with the reason otherwise,\n * before anything is written:\n * - the instance must BE a refinement line (the landing refuses targets elsewhere too; saying so here first\n * gives the right reason);\n * - a producer the line admits must re-derive the family from its own prior output, among the playbooks\n * the application's line actually runs;\n * - the family must apply to the application, counting the families this same request needs back;\n * - the application must already HOLD it: a refinement changes what exists, and a family nobody produced\n * yet would be authored from scratch under the name of a refinement.\n */\n private async assertRefinable(input: {\n readonly entryPlaybookRef: string;\n readonly instanceKey: string;\n readonly purpose: string;\n readonly families: readonly ApplicationSpecificationFamily[];\n readonly neededFamilies?: readonly ApplicationSpecificationFamily[];\n readonly current: ApplicationCreatorInputs | undefined;\n }): Promise<void> {\n if (secondaryLineDefinitionOfEntry(input.entryPlaybookRef)?.namesRefinedFamilies !== true) {\n throw new PlaybookInstanceRefusedError(`\"${input.entryPlaybookRef}\" is not a refinement line's entry, so an instance of it names no families to refine.`);\n }\n /*\n * The dossier as it would stand with this line open, so the families it needs back already apply. A re-open\n * that names none keeps what the line already needs (the landing does the same), so it is counted here too.\n */\n const neededFamilies = input.neededFamilies\n ?? input.current?.activations?.[playbookInstanceId(input.entryPlaybookRef, input.instanceKey)]?.neededFamilies;\n const withLine = withPlaybookActivation(input.current, {\n playbookRef: input.entryPlaybookRef, instanceKey: input.instanceKey, purpose: input.purpose,\n ...(neededFamilies && neededFamilies.length > 0 ? { neededFamilies: [...neededFamilies] } : {}),\n });\n const lineCatalog = readCompiledApplicationLineCatalog();\n const scope = resolveApplicationLineScope({ catalog: lineCatalog, creatorInputs: withLine });\n const entry = getFrameworkKnowledgePlaybook(input.entryPlaybookRef)?.playbook as RefinementCatalogEntry | undefined;\n const catalog: RefinementCatalogEntry[] = [\n ...(entry ? [entry] : []),\n ...(entry?.method?.choreography?.admits ?? []).flatMap((ref) => {\n const child = getFrameworkKnowledgePlaybook(ref)?.playbook as RefinementCatalogEntry | undefined;\n return child ? [child] : [];\n }),\n ];\n const inapplicable = input.families.filter((family) => scope.notApplicableFamilies.has(family));\n if (inapplicable.length > 0) {\n throw new PlaybookInstanceRefusedError(\n `${inapplicable.join(', ')} does not apply to this kind of application, so there is nothing to refine. A feature line that needs it back can bring it in.`,\n );\n }\n const unrefinable = input.families.filter((family) => !refinementProducersOf(catalog, input.entryPlaybookRef, family).some((ref) => scope.admittedPlaybookRefs.has(ref)));\n if (unrefinable.length > 0) {\n throw new PlaybookInstanceRefusedError(\n `Nothing this application runs refines ${unrefinable.join(', ')} from what it already holds, so a refinement line cannot change it. Refinable: the families a model re-derives from their own prior output (the requirements, the feature drafts, the plans, the brand, the roadmap).`,\n );\n }\n const landed = await this.playbookRuns.readLandedFamilies();\n const absent = input.families.filter((family) => !landed.has(family));\n if (absent.length > 0) {\n throw new PlaybookInstanceRefusedError(\n `The application does not hold ${absent.join(', ')} yet, so there is nothing to refine: a refinement changes what exists. Let the main line produce it first.`,\n );\n }\n }\n\n /**\n * CLOSE an instance (#1608, #1609 R10): completed, or abandoned. Recorded and committed at once under the\n * workspace lock, like opening one, with the reason as the purpose trailer. What it contributed stays, marked\n * with it. ABANDONING also cancels its runs waiting on a person and consumes its interrupted progress; a run\n * in flight stops at its next round, when its selector reads the closure.\n */\n public async closeInstance(input: {\n readonly playbookRef: string;\n readonly instanceKey: string;\n readonly kind: ApplicationPlaybookInstanceClosureKind;\n readonly reason?: string;\n readonly actor: DecisionRecordActor;\n }): Promise<{\n readonly instanceId: string;\n readonly commitSha?: string;\n readonly withdrawnRunIds: readonly string[];\n readonly consumedCheckpointRunIds: readonly string[];\n readonly note: string;\n }> {\n const specificationsPackageRoot = this.companionContext.resolvedSpecifications?.packageRoot;\n if (!specificationsPackageRoot) {\n throw new PlaybookInstanceRefusedError('No specifications package is declared in wildo.saas.config.ts; there is nowhere to record the closure.');\n }\n const instanceId = playbookInstanceId(input.playbookRef, input.instanceKey);\n const reason = input.reason?.trim() || undefined;\n const commits = laneBoundaryTreatmentFor(APPLICATION_CREATION_AUTONOMY_POSTURE, PlaybookLaneBoundaryDecision.APPROVE_RESULT) === LaneBoundaryTreatment.NOTIFY_AND_PROCEED;\n const record = async (): Promise<string | undefined> => {\n let landed: Awaited<ReturnType<typeof landPlaybookInstanceClosure>>;\n try {\n landed = await landPlaybookInstanceClosure({\n specificationsPackageRoot,\n constantPrefix: LANDED_CONSTANT_PREFIX,\n current: await this.dossier.readCreatorInputs(),\n playbookRef: input.playbookRef,\n instanceKey: input.instanceKey,\n closure: { kind: input.kind, ...(reason ? { reason } : {}) },\n });\n } catch (error) {\n // An instance nobody opened, or one already closed: the caller's mistake, named.\n if (error instanceof PlaybookElicitationError) throw new PlaybookInstanceRefusedError(error.message);\n throw error;\n }\n if (!commits) return undefined;\n const specificationsRelativeRoot = path.relative(this.companionContext.saasRoot, specificationsPackageRoot);\n const written = [landed.packageRelativePath, ...landed.wiringEdits.map((edit) => edit.packageRelativePath)]\n .map((relative) => path.posix.join(specificationsRelativeRoot, relative));\n const committed = await this.acceptedChangeCommit.commitDecisionRecord({\n paths: written,\n summary: `Close the playbook instance ${instanceId} (${input.kind})`,\n purpose: reason ?? `The instance is ${input.kind}.`,\n actor: input.actor,\n origin: AcceptOrigin.AUTONOMY_POSTURE,\n });\n return committed.commitSha;\n };\n let commitSha: string | undefined;\n try {\n commitSha = await withDedicatedFileLock(getWorkspaceMutationLockPath(this.companionContext.saasRoot), record, { retries: OPEN_INSTANCE_LOCK_RETRIES });\n } catch (error) {\n if (error instanceof PlaybookInstanceRefusedError) throw error;\n if (isLockUnavailable(error)) {\n throw new PlaybookInstanceTreeBusyError('The application\\'s working tree is being written right now (a coding run holds it). Nothing was recorded; try again in a moment.');\n }\n throw error;\n }\n /* After the record, and outside the lock: the closure is the decision, and clearing its runs follows from it. */\n const cleared = input.kind === ApplicationPlaybookInstanceClosureKind.ABANDONED\n ? await this.playbookRuns.abandonInstanceRuns({ playbookRef: input.playbookRef, instanceKey: input.instanceKey })\n : { withdrawnRunIds: [], consumedCheckpointRunIds: [] };\n this.logDebug('Playbook instance closed', { instanceId, kind: input.kind, commitSha, ...cleared });\n return {\n instanceId,\n ...(commitSha ? { commitSha } : {}),\n ...cleared,\n note: `${instanceId} is ${input.kind}.${commitSha ? ` Committed (${commitSha.slice(0, 8)}).` : ' Recorded as a working edit: the autonomy posture leaves committing it to you.'}`\n + (input.kind === ApplicationPlaybookInstanceClosureKind.ABANDONED\n ? ` ${cleared.withdrawnRunIds.length} waiting run(s) withdrawn, ${cleared.consumedCheckpointRunIds.length} interrupted checkpoint(s) consumed; a run in flight stops at its next round.`\n : ''),\n };\n }\n}\n\n/** The file lock's own \"could not acquire\" failure, told apart from a failure of the work it guards. */\nfunction isLockUnavailable(error: unknown): boolean {\n const code = (error as { code?: unknown } | null)?.code;\n return code === 'ELOCKED';\n}\n"]}
|
|
1
|
+
{"version":3,"file":"playbook-instance.companion.service.js","sourceRoot":"","sources":["../../../../../src/meta-workflows/services/playbook-instance.companion.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE/C,OAAO,EACL,wBAAwB,EACxB,4BAA4B,EAC5B,sBAAsB,EACtB,2BAA2B,EAC3B,qBAAqB,EACrB,2BAA2B,GAE5B,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,6BAA6B,EAAE,MAAM,+BAA+B,CAAC;AAC9E,OAAO,EAAE,4BAA4B,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAEpG,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAC7E,OAAO,EACL,0BAA0B,EAC1B,sCAAsC,EAEtC,yBAAyB,EACzB,8BAA8B,EAC9B,sBAAsB,EAEtB,kBAAkB,GAEnB,MAAM,oDAAoD,CAAC;AAE5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AAEjF,OAAO,EAAE,YAAY,EAAkE,MAAM,oEAAoE,CAAC;AAClK,OAAO,EACL,qCAAqC,EACrC,qBAAqB,EACrB,wBAAwB,GACzB,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAAE,kCAAkC,EAAE,MAAM,2CAA2C,CAAC;AAE/F,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAG9E,oIAAoI;AACpI,MAAM,sBAAsB,GAAG,aAAa,CAAC;AAE7C;;;;GAIG;AACH,MAAM,0BAA0B,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,EAAE,KAAK,EAAW,CAAC;AAEhG,gGAAgG;AAChG,MAAM,OAAO,4BAA6B,SAAQ,KA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ectable } from 'inversify';\n\nimport {\n PlaybookElicitationError,\n PlaybookLaneBoundaryDecision,\n landPlaybookActivation,\n landPlaybookInstanceClosure,\n refinementProducersOf,\n resolveApplicationLineScope,\n type RefinementCatalogEntry,\n} from '@wildo-ai/application-creation-runtime';\nimport { getFrameworkKnowledgePlaybook } from '@wildo-ai/framework-knowledge';\nimport { getWorkspaceMutationLockPath, withDedicatedFileLock } from '@wildo-ai/platform-config-lib';\nimport type { LoggerService } from '@wildo-ai/saas-backend-lib';\nimport { SAAS_SERVICE_TYPES } from '@wildo-ai/saas-backend-lib';\nimport { MetaWorkflow_Executor } from '@wildo-ai/saas-models/meta-workflows';\nimport {\n MetaWorkflowPlaybookSchema,\n ApplicationPlaybookInstanceClosureKind,\n ApplicationSpecificationFamily,\n PlaybookInstanceKeySchema,\n secondaryLineDefinitionOfEntry,\n withPlaybookActivation,\n type ApplicationCreatorInputs,\n playbookInstanceId,\n type ApplicationPlaybookActivation,\n} from '@wildo-ai/saas-specifications/application-creation';\n\nimport { COMPANION_SERVICE_TYPES } from '../../core/inject/models/service-types';\nimport type { CompanionContext } from '../../core/context/companion-context';\nimport { AcceptOrigin, DecisionRecordActor, type AcceptedChangeCommitCompanionService } from '../../claude-cli/services/accepted-change-commit.companion.service';\nimport {\n APPLICATION_CREATION_AUTONOMY_POSTURE,\n LaneBoundaryTreatment,\n laneBoundaryTreatmentFor,\n} from '../models/playbook-run-checkpoint.models';\nimport { readCompiledApplicationLineCatalog } from '../models/application-line-catalog.models';\nimport type { DossierCompanionService } from './dossier.companion.service';\nimport { serializeDossierWrite } from './dossier-write-queue.companion.utils';\nimport type { PlaybookRunCompanionService } from './playbook-run.companion.service';\n\n/** The same prefix every landed specification constant carries (issue #65): app identity lives in values, never in export names. */\nconst LANDED_CONSTANT_PREFIX = 'application';\n\n/**\n * How long opening an instance waits for the workspace lock before refusing. Short on purpose: the caller is\n * a person in a conversation, and a coding run holding the tree for minutes is a reason to say \"busy\", not to\n * hang the conversation.\n */\nconst OPEN_INSTANCE_LOCK_RETRIES = { retries: 10, minTimeout: 250, maxTimeout: 2_000 } as const;\n\n/** A request to open an instance the host cannot honour; named so the transport answers 4xx. */\nexport class PlaybookInstanceRefusedError extends Error {}\n\n/** The tree is being written by a coding run right now; named so the transport answers 409. */\nexport class PlaybookInstanceTreeBusyError extends Error {}\n\nexport interface OpenPlaybookInstanceResult {\n readonly activation: ApplicationPlaybookActivation;\n /** `<ref>@<key>`: how every surface addresses this instance from now on. */\n readonly instanceId: string;\n readonly packageRelativePath: string;\n /** The commit that recorded it; absent when the posture leaves acceptance to a person, or on a dry run. */\n readonly commitSha?: string;\n readonly note: string;\n}\n\n/**\n * Opening a playbook INSTANCE (#1609): the one act that writes the dossier's activation record, and the\n * first act that must be committed the moment it is taken.\n *\n * ## Why here, and not in the dossier service\n *\n * An answer is a working edit a person commits with the rest of their work; an activation is a decision\n * about what the application is building, and it is committed at once under the automatic posture, with its\n * purpose and actor as trailers. That needs the workspace lock and the accept door, which the dossier's\n * answers never did.\n *\n * ## The lock is taken BEFORE the write\n *\n * A coding run's baseline must never see the dossier half-recorded, and a decision the tree was too busy to\n * commit must not be left behind as an uncommitted edit. So the write and the commit happen together under\n * the lock, or neither happens: a busy tree answers \"busy, try again\" with nothing written.\n */\n@injectable()\nexport class PlaybookInstanceCompanionService {\n private readonly logDebug: (message: string, context?: Record<string, unknown>) => void;\n\n public constructor(\n @inject(SAAS_SERVICE_TYPES.Logger) private readonly logger: LoggerService,\n @inject(COMPANION_SERVICE_TYPES.CompanionContext) private readonly companionContext: CompanionContext,\n @inject(COMPANION_SERVICE_TYPES.DossierService) private readonly dossier: DossierCompanionService,\n @inject(COMPANION_SERVICE_TYPES.AcceptedChangeCommitService) private readonly acceptedChangeCommit: AcceptedChangeCommitCompanionService,\n @inject(COMPANION_SERVICE_TYPES.PlaybookRunService) private readonly playbookRuns: Pick<PlaybookRunCompanionService, 'abandonInstanceRuns' | 'readLandedFamilies'>,\n ) {\n this.logDebug = this.logger.debugByType('PlaybookInstanceCompanionService');\n }\n\n public async openInstance(input: {\n readonly playbookRef: string;\n readonly instanceKey: string;\n readonly purpose: string;\n /** Families a secondary line needs although the main line declares them not applicable (#1608); refused on any other instance. */\n readonly neededFamilies?: readonly ApplicationSpecificationFamily[];\n /** The families a refinement line re-derives (#1608); required on one, refused on any other instance. */\n readonly refinedFamilies?: readonly ApplicationSpecificationFamily[];\n readonly actor: DecisionRecordActor;\n readonly dryRun?: boolean;\n }): Promise<OpenPlaybookInstanceResult> {\n const specificationsPackageRoot = this.companionContext.resolvedSpecifications?.packageRoot;\n if (!specificationsPackageRoot) {\n throw new PlaybookInstanceRefusedError('No specifications package is declared in wildo.saas.config.ts; there is nowhere to record the instance.');\n }\n const parsedKey = PlaybookInstanceKeySchema.safeParse(input.instanceKey);\n if (!parsedKey.success) {\n throw new PlaybookInstanceRefusedError(`\"${input.instanceKey}\" is not an instance key: use a kebab-case slug, e.g. \"enterprise-segment\".`);\n }\n if (input.purpose.trim().length === 0) {\n throw new PlaybookInstanceRefusedError('An instance is opened FOR something: say what, in the creator\\'s terms.');\n }\n const playbook = MetaWorkflowPlaybookSchema.safeParse(getFrameworkKnowledgePlaybook(input.playbookRef)?.playbook);\n if (!playbook.success) {\n throw new PlaybookInstanceRefusedError(`No compiled playbook is registered under \"${input.playbookRef}\".`);\n }\n /*\n * The same rule the run applies, stated where the instance is OPENED so nobody opens one that could\n * never run: a playbook acting on the application as a whole has no instances.\n */\n const executor = playbook.data.executor;\n if (executor === MetaWorkflow_Executor.CODING_AGENT || executor === MetaWorkflow_Executor.DETERMINISTIC_CLI || executor === MetaWorkflow_Executor.HUMAN) {\n throw new PlaybookInstanceRefusedError(`\"${input.playbookRef}\" acts on the application as a whole, so it has no instances.`);\n }\n\n const posture = laneBoundaryTreatmentFor(APPLICATION_CREATION_AUTONOMY_POSTURE, PlaybookLaneBoundaryDecision.APPROVE_RESULT);\n const commits = posture === LaneBoundaryTreatment.NOTIFY_AND_PROCEED && input.dryRun !== true;\n const record = async (): Promise<OpenPlaybookInstanceResult> => {\n const current = await this.dossier.readCreatorInputs();\n if (input.refinedFamilies !== undefined && input.refinedFamilies.length > 0) {\n await this.assertRefinable({\n entryPlaybookRef: input.playbookRef, instanceKey: parsedKey.data, purpose: input.purpose, families: input.refinedFamilies,\n ...(input.neededFamilies ? { neededFamilies: input.neededFamilies } : {}), current,\n });\n }\n let landed: Awaited<ReturnType<typeof landPlaybookActivation>>;\n try {\n landed = await landPlaybookActivation({\n specificationsPackageRoot,\n constantPrefix: LANDED_CONSTANT_PREFIX,\n playbook: playbook.data,\n current,\n instanceKey: parsedKey.data,\n purpose: input.purpose,\n ...(input.neededFamilies !== undefined ? { neededFamilies: input.neededFamilies } : {}),\n ...(input.refinedFamilies !== undefined ? { refinedFamilies: input.refinedFamilies } : {}),\n ...(input.dryRun === true ? { dryRun: true } : {}),\n });\n } catch (error) {\n // A closed instance re-opened, or families asked of an instance that is not a line: the caller's mistake, named.\n if (error instanceof PlaybookElicitationError) throw new PlaybookInstanceRefusedError(error.message);\n throw error;\n }\n const instanceId = playbookInstanceId(input.playbookRef, parsedKey.data);\n const specificationsRelativeRoot = path.relative(this.companionContext.saasRoot, specificationsPackageRoot);\n const written = [landed.packageRelativePath, ...landed.wiringEdits.map((edit) => edit.packageRelativePath)]\n .map((relative) => path.posix.join(specificationsRelativeRoot, relative));\n if (!commits) {\n return {\n activation: landed.activation,\n instanceId,\n packageRelativePath: landed.packageRelativePath,\n note: input.dryRun === true\n ? 'Dry run: nothing was written.'\n : 'Recorded as a working edit: the autonomy posture leaves committing it to you.',\n };\n }\n const committed = await this.acceptedChangeCommit.commitDecisionRecord({\n paths: written,\n summary: `Open the playbook instance ${instanceId}${landed.activation.neededFamilies ? ` (needs ${landed.activation.neededFamilies.join(', ')})` : ''}${landed.activation.refinedFamilies ? ` (refines ${landed.activation.refinedFamilies.join(', ')})` : ''}`,\n purpose: input.purpose,\n actor: input.actor,\n origin: AcceptOrigin.AUTONOMY_POSTURE,\n });\n this.logDebug('Playbook instance opened', { instanceId, commitSha: committed.commitSha });\n return {\n activation: landed.activation,\n instanceId,\n packageRelativePath: landed.packageRelativePath,\n commitSha: committed.commitSha,\n note: `Opened and committed (${committed.commitSha.slice(0, 8)}). Run it with instanceKey \"${parsedKey.data}\".`,\n };\n };\n /*\n * The dossier write queue INSIDE the workspace lock (#2179): the lock keeps a coding run out of the tree, the\n * queue keeps an answer landing at the same moment from building on the same dossier read. Nothing holding\n * the queue asks for the workspace lock, so the two cannot deadlock.\n */\n const recordQueued = (): Promise<OpenPlaybookInstanceResult> => serializeDossierWrite(specificationsPackageRoot, record);\n if (input.dryRun === true) return recordQueued();\n try {\n return await withDedicatedFileLock(getWorkspaceMutationLockPath(this.companionContext.saasRoot), recordQueued, { retries: OPEN_INSTANCE_LOCK_RETRIES });\n } catch (error) {\n if (error instanceof PlaybookInstanceRefusedError) throw error;\n if (isLockUnavailable(error)) {\n throw new PlaybookInstanceTreeBusyError('The application\\'s working tree is being written right now (a coding run holds it). Nothing was recorded; try again in a moment.');\n }\n throw error;\n }\n }\n\n /**\n * What a refinement line names must be something it can refine (#1608). Refused with the reason otherwise,\n * before anything is written:\n * - the instance must BE a refinement line (the landing refuses targets elsewhere too; saying so here first\n * gives the right reason);\n * - a producer the line admits must re-derive the family from its own prior output, among the playbooks\n * the application's line actually runs;\n * - the family must apply to the application, counting the families this same request needs back;\n * - the application must already HOLD it: a refinement changes what exists, and a family nobody produced\n * yet would be authored from scratch under the name of a refinement.\n */\n private async assertRefinable(input: {\n readonly entryPlaybookRef: string;\n readonly instanceKey: string;\n readonly purpose: string;\n readonly families: readonly ApplicationSpecificationFamily[];\n readonly neededFamilies?: readonly ApplicationSpecificationFamily[];\n readonly current: ApplicationCreatorInputs | undefined;\n }): Promise<void> {\n if (secondaryLineDefinitionOfEntry(input.entryPlaybookRef)?.namesRefinedFamilies !== true) {\n throw new PlaybookInstanceRefusedError(`\"${input.entryPlaybookRef}\" is not a refinement line's entry, so an instance of it names no families to refine.`);\n }\n /*\n * The dossier as it would stand with this line open, so the families it needs back already apply. A re-open\n * that names none keeps what the line already needs (the landing does the same), so it is counted here too.\n */\n const neededFamilies = input.neededFamilies\n ?? input.current?.activations?.[playbookInstanceId(input.entryPlaybookRef, input.instanceKey)]?.neededFamilies;\n const withLine = withPlaybookActivation(input.current, {\n playbookRef: input.entryPlaybookRef, instanceKey: input.instanceKey, purpose: input.purpose,\n ...(neededFamilies && neededFamilies.length > 0 ? { neededFamilies: [...neededFamilies] } : {}),\n });\n const lineCatalog = readCompiledApplicationLineCatalog();\n const scope = resolveApplicationLineScope({ catalog: lineCatalog, creatorInputs: withLine });\n const entry = getFrameworkKnowledgePlaybook(input.entryPlaybookRef)?.playbook as RefinementCatalogEntry | undefined;\n const catalog: RefinementCatalogEntry[] = [\n ...(entry ? [entry] : []),\n ...(entry?.method?.choreography?.admits ?? []).flatMap((ref) => {\n const child = getFrameworkKnowledgePlaybook(ref)?.playbook as RefinementCatalogEntry | undefined;\n return child ? [child] : [];\n }),\n ];\n const inapplicable = input.families.filter((family) => scope.notApplicableFamilies.has(family));\n if (inapplicable.length > 0) {\n throw new PlaybookInstanceRefusedError(\n `${inapplicable.join(', ')} does not apply to this kind of application, so there is nothing to refine. A feature line that needs it back can bring it in.`,\n );\n }\n const unrefinable = input.families.filter((family) => !refinementProducersOf(catalog, input.entryPlaybookRef, family).some((ref) => scope.admittedPlaybookRefs.has(ref)));\n if (unrefinable.length > 0) {\n throw new PlaybookInstanceRefusedError(\n `Nothing this application runs refines ${unrefinable.join(', ')} from what it already holds, so a refinement line cannot change it. Refinable: the families a model re-derives from their own prior output (the requirements, the feature drafts, the plans, the brand, the roadmap).`,\n );\n }\n const landed = await this.playbookRuns.readLandedFamilies();\n const absent = input.families.filter((family) => !landed.has(family));\n if (absent.length > 0) {\n throw new PlaybookInstanceRefusedError(\n `The application does not hold ${absent.join(', ')} yet, so there is nothing to refine: a refinement changes what exists. Let the main line produce it first.`,\n );\n }\n }\n\n /**\n * CLOSE an instance (#1608, #1609 R10): completed, or abandoned. Recorded and committed at once under the\n * workspace lock, like opening one, with the reason as the purpose trailer. What it contributed stays, marked\n * with it. ABANDONING also cancels its runs waiting on a person and consumes its interrupted progress; a run\n * in flight stops at its next round, when its selector reads the closure.\n */\n public async closeInstance(input: {\n readonly playbookRef: string;\n readonly instanceKey: string;\n readonly kind: ApplicationPlaybookInstanceClosureKind;\n readonly reason?: string;\n readonly actor: DecisionRecordActor;\n }): Promise<{\n readonly instanceId: string;\n readonly commitSha?: string;\n readonly withdrawnRunIds: readonly string[];\n readonly consumedCheckpointRunIds: readonly string[];\n readonly note: string;\n }> {\n const specificationsPackageRoot = this.companionContext.resolvedSpecifications?.packageRoot;\n if (!specificationsPackageRoot) {\n throw new PlaybookInstanceRefusedError('No specifications package is declared in wildo.saas.config.ts; there is nowhere to record the closure.');\n }\n const instanceId = playbookInstanceId(input.playbookRef, input.instanceKey);\n const reason = input.reason?.trim() || undefined;\n const commits = laneBoundaryTreatmentFor(APPLICATION_CREATION_AUTONOMY_POSTURE, PlaybookLaneBoundaryDecision.APPROVE_RESULT) === LaneBoundaryTreatment.NOTIFY_AND_PROCEED;\n const record = async (): Promise<string | undefined> => {\n let landed: Awaited<ReturnType<typeof landPlaybookInstanceClosure>>;\n try {\n landed = await landPlaybookInstanceClosure({\n specificationsPackageRoot,\n constantPrefix: LANDED_CONSTANT_PREFIX,\n current: await this.dossier.readCreatorInputs(),\n playbookRef: input.playbookRef,\n instanceKey: input.instanceKey,\n closure: { kind: input.kind, ...(reason ? { reason } : {}) },\n });\n } catch (error) {\n // An instance nobody opened, or one already closed: the caller's mistake, named.\n if (error instanceof PlaybookElicitationError) throw new PlaybookInstanceRefusedError(error.message);\n throw error;\n }\n if (!commits) return undefined;\n const specificationsRelativeRoot = path.relative(this.companionContext.saasRoot, specificationsPackageRoot);\n const written = [landed.packageRelativePath, ...landed.wiringEdits.map((edit) => edit.packageRelativePath)]\n .map((relative) => path.posix.join(specificationsRelativeRoot, relative));\n const committed = await this.acceptedChangeCommit.commitDecisionRecord({\n paths: written,\n summary: `Close the playbook instance ${instanceId} (${input.kind})`,\n purpose: reason ?? `The instance is ${input.kind}.`,\n actor: input.actor,\n origin: AcceptOrigin.AUTONOMY_POSTURE,\n });\n return committed.commitSha;\n };\n let commitSha: string | undefined;\n try {\n // The dossier write queue inside the workspace lock, as when opening one (#2179).\n commitSha = await withDedicatedFileLock(\n getWorkspaceMutationLockPath(this.companionContext.saasRoot),\n () => serializeDossierWrite(specificationsPackageRoot, record),\n { retries: OPEN_INSTANCE_LOCK_RETRIES },\n );\n } catch (error) {\n if (error instanceof PlaybookInstanceRefusedError) throw error;\n if (isLockUnavailable(error)) {\n throw new PlaybookInstanceTreeBusyError('The application\\'s working tree is being written right now (a coding run holds it). Nothing was recorded; try again in a moment.');\n }\n throw error;\n }\n /* After the record, and outside the lock: the closure is the decision, and clearing its runs follows from it. */\n const cleared = input.kind === ApplicationPlaybookInstanceClosureKind.ABANDONED\n ? await this.playbookRuns.abandonInstanceRuns({ playbookRef: input.playbookRef, instanceKey: input.instanceKey })\n : { withdrawnRunIds: [], consumedCheckpointRunIds: [] };\n this.logDebug('Playbook instance closed', { instanceId, kind: input.kind, commitSha, ...cleared });\n return {\n instanceId,\n ...(commitSha ? { commitSha } : {}),\n ...cleared,\n note: `${instanceId} is ${input.kind}.${commitSha ? ` Committed (${commitSha.slice(0, 8)}).` : ' Recorded as a working edit: the autonomy posture leaves committing it to you.'}`\n + (input.kind === ApplicationPlaybookInstanceClosureKind.ABANDONED\n ? ` ${cleared.withdrawnRunIds.length} waiting run(s) withdrawn, ${cleared.consumedCheckpointRunIds.length} interrupted checkpoint(s) consumed; a run in flight stops at its next round.`\n : ''),\n };\n }\n}\n\n/** The file lock's own \"could not acquire\" failure, told apart from a failure of the work it guards. */\nfunction isLockUnavailable(error: unknown): boolean {\n const code = (error as { code?: unknown } | null)?.code;\n return code === 'ELOCKED';\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { ApplicationSpecificationLandingConcurrency } from '@wildo-ai/application-creation-runtime';
|
|
2
|
+
import { ApplicationSpecificationLandingConcurrency, type PlaybookJudgedGapCriterion, type PlaybookLandingHistory } from '@wildo-ai/application-creation-runtime';
|
|
3
3
|
import type { LoggerService } from '@wildo-ai/saas-backend-lib';
|
|
4
4
|
import type { CompanionContext } from '../../core/context/companion-context';
|
|
5
5
|
declare const RunWriteRecordSchema: z.ZodObject<{
|
|
@@ -12,6 +12,27 @@ declare const RunWriteRecordSchema: z.ZodObject<{
|
|
|
12
12
|
*/
|
|
13
13
|
traceSessionId: z.ZodOptional<z.ZodString>;
|
|
14
14
|
at: z.ZodString;
|
|
15
|
+
/**
|
|
16
|
+
* When the run STARTED — before it read anything it derives from (review F7, 2026-10-01). `at` is when its
|
|
17
|
+
* writes were recorded, which is later; a run admitted beside a writer of a family it reads lands after
|
|
18
|
+
* that writer, so judging it by `at` would call its output current although it was derived from the old
|
|
19
|
+
* input. Optional: a record from before it existed is judged by `at`.
|
|
20
|
+
*/
|
|
21
|
+
startedAt: z.ZodOptional<z.ZodString>;
|
|
22
|
+
/**
|
|
23
|
+
* The catalog VERSION of the playbook that ran (#2158). A landing made by a version other than the one the
|
|
24
|
+
* catalog holds now is a REFRESH, so a changed method re-derives unattended. Optional: older records carry
|
|
25
|
+
* none and are not judged out of date.
|
|
26
|
+
*/
|
|
27
|
+
playbookVersion: z.ZodOptional<z.ZodString>;
|
|
28
|
+
/**
|
|
29
|
+
* Per family the run landed, the aspects it MEASURABLY changed (`measureChangedAspects`, #2146); `null` when the
|
|
30
|
+
* change could not be confined to aspects, which counts as a change of the whole family. A record without this
|
|
31
|
+
* field predates measurement, and only then does the writer's declaration decide.
|
|
32
|
+
*/
|
|
33
|
+
aspectsChanged: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodArray<z.ZodString>>>>;
|
|
34
|
+
/** Aspect keys the brief-adequacy gate added to this run's brief: read by it, beyond what it declares. */
|
|
35
|
+
readAspectsAdded: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
15
36
|
files: z.ZodArray<z.ZodObject<{
|
|
16
37
|
/** App-root-relative path of the written file. */
|
|
17
38
|
path: z.ZodString;
|
|
@@ -34,8 +55,36 @@ declare const RunWriteRecordSchema: z.ZodObject<{
|
|
|
34
55
|
*/
|
|
35
56
|
acceptedAt: z.ZodOptional<z.ZodString>;
|
|
36
57
|
acceptedCommitSha: z.ZodOptional<z.ZodString>;
|
|
58
|
+
/**
|
|
59
|
+
* The criteria the advisory judge rated GAP, stamped after the run when its overall verdict was GAP
|
|
60
|
+
* (#2142). The judge answers AFTER the writes are recorded, so this arrives by a second write
|
|
61
|
+
* (`markJudgedGap`). Read back as `PlaybookLandingHistory.lastLandingJudgedGapByPlaybook`, so an
|
|
62
|
+
* unattended round reports a rejected-and-unchanged playbook as STUCK rather than as finished.
|
|
63
|
+
* Optional: a record from before it existed, an unjudged run and a non-GAP verdict all carry none.
|
|
64
|
+
*/
|
|
65
|
+
judgedGapCriteria: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
66
|
+
criterionRef: z.ZodString;
|
|
67
|
+
rationale: z.ZodOptional<z.ZodString>;
|
|
68
|
+
}, z.core.$strict>>>;
|
|
37
69
|
}, z.core.$strict>;
|
|
38
70
|
export type PlaybookRunWriteRecord = z.infer<typeof RunWriteRecordSchema>;
|
|
71
|
+
/** One revert, as its marker records it (#2157, #2231). `markerId` is the marker's file name, one per revert. */
|
|
72
|
+
export interface PlaybookRunRevertMarker {
|
|
73
|
+
readonly markerId: string;
|
|
74
|
+
readonly runId: string;
|
|
75
|
+
readonly playbookRef: string;
|
|
76
|
+
readonly at: string;
|
|
77
|
+
readonly paths: readonly string[];
|
|
78
|
+
readonly forced: boolean;
|
|
79
|
+
/** The reverted run's footprint — when it ran and what it wrote — when the marker carries it. */
|
|
80
|
+
readonly runFootprint?: {
|
|
81
|
+
readonly runAt: string;
|
|
82
|
+
readonly writtenFiles: readonly {
|
|
83
|
+
readonly path: string;
|
|
84
|
+
readonly sha256: string;
|
|
85
|
+
}[];
|
|
86
|
+
};
|
|
87
|
+
}
|
|
39
88
|
/** One file's change, as the board renders it. */
|
|
40
89
|
export interface PlaybookRunFileDiff {
|
|
41
90
|
readonly path: string;
|
|
@@ -85,9 +134,14 @@ export declare class PlaybookRunWriteRecordNotFoundError extends Error {
|
|
|
85
134
|
*
|
|
86
135
|
* Records live in the gitignored companion state directory. Deleting them all costs exactly the
|
|
87
136
|
* convenience — git still holds every accepted state, and `git diff` still shows every un-accepted write.
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
*
|
|
137
|
+
* (`.claude/rules/one-source-of-truth.md`: cache, not ledger — losing it costs time, never truth.)
|
|
138
|
+
*
|
|
139
|
+
* ONE decision reads them, and it is a decision to NOT SPEND (2026-10-01): {@link deriveLandingHistory}
|
|
140
|
+
* tells the eligibility board when each playbook last landed, so an unattended selection stops re-running
|
|
141
|
+
* a playbook whose inputs have not moved (`PlaybookEligibility.rerun`). Deleting the records makes every
|
|
142
|
+
* playbook read as a first run again (once the companion re-reads the register: the summary is kept until
|
|
143
|
+
* the next record, revert or restart) — a re-run, never a lost fact — which is the one kind of refusal
|
|
144
|
+
* Rule 5 lets runtime state make. Everything else here serves the list/revert doors a human operates.
|
|
91
145
|
*
|
|
92
146
|
* ## Revert protects the human's later edits
|
|
93
147
|
*
|
|
@@ -116,6 +170,29 @@ export declare class PlaybookRunWriteRegisterCompanionService {
|
|
|
116
170
|
registerMutationListener(listener: () => void): void;
|
|
117
171
|
private notifyMutation;
|
|
118
172
|
constructor(logger: LoggerService, companionContext: CompanionContext);
|
|
173
|
+
/** The record-derived half of {@link deriveLandingHistory}, kept until the register next changes. */
|
|
174
|
+
private landingSummary;
|
|
175
|
+
/**
|
|
176
|
+
* When each playbook last landed, and when each family's file last changed — the host's record of its
|
|
177
|
+
* own runs that `PlaybookEligibility.rerun` reads (2026-10-01).
|
|
178
|
+
*
|
|
179
|
+
* Why the register and not git: during the definition phase nothing is committed (on
|
|
180
|
+
* app-creation-test-004 every family after the vision was a working edit), and a commit time is when a
|
|
181
|
+
* change was ACCEPTED, not when it was derived. The register holds the instant each run landed.
|
|
182
|
+
*
|
|
183
|
+
* A family's change is the latest run that wrote its file — unless a REVERT came after it (`revertOf`, read from
|
|
184
|
+
* the markers under `reverts/`, #2157), or the file no longer holds the bytes that run wrote, which is the same
|
|
185
|
+
* test `revert` uses (`diverged`): then somebody changed it OUTSIDE the runs, dated by the file's mtime. Outside
|
|
186
|
+
* edits are also reported on their own (`lastOutsideEditByFamily`), including one hidden BETWEEN two landings, so
|
|
187
|
+
* no later landing can mask them. A family no run ever wrote is left out, and the runtime falls back to git.
|
|
188
|
+
*
|
|
189
|
+
* On the board's hot path, so the parse of every record is memoised until the register changes; what is
|
|
190
|
+
* read per call is only the handful of family files given here.
|
|
191
|
+
*
|
|
192
|
+
* @param familyFiles family → its file, app-root-relative, for the families that have content.
|
|
193
|
+
*/
|
|
194
|
+
deriveLandingHistory(familyFiles: ReadonlyMap<string, string>): Promise<PlaybookLandingHistory | undefined>;
|
|
195
|
+
private summarizeLandings;
|
|
119
196
|
record(record: PlaybookRunWriteRecord): Promise<void>;
|
|
120
197
|
/** Newest first. A record that no longer parses is skipped (a cache never fails its reader). */
|
|
121
198
|
list(): Promise<readonly PlaybookRunWriteRecord[]>;
|
|
@@ -146,10 +223,20 @@ export declare class PlaybookRunWriteRegisterCompanionService {
|
|
|
146
223
|
* A pure READ — nothing is locked, written or reverted.
|
|
147
224
|
*/
|
|
148
225
|
markAccepted(runId: string, commitSha: string, at: string): Promise<void>;
|
|
226
|
+
/**
|
|
227
|
+
* Stamp the criteria the judge rated GAP onto a recorded run (#2142). Same read-modify-record shape as
|
|
228
|
+
* `markAccepted`; `record` notifies, so the memoised landing summary is re-derived.
|
|
229
|
+
*/
|
|
230
|
+
markJudgedGap(runId: string, criteria: readonly PlaybookJudgedGapCriterion[]): Promise<void>;
|
|
149
231
|
describeRunDiff(runId: string): Promise<PlaybookRunDiff>;
|
|
150
232
|
revert(runId: string, options?: {
|
|
151
233
|
readonly force?: boolean;
|
|
152
234
|
}): Promise<PlaybookRunRevertOutcome>;
|
|
235
|
+
/**
|
|
236
|
+
* Every revert marker, oldest first (#2231): what the intervention ledger counts as a person's revert. A marker
|
|
237
|
+
* that no longer parses is skipped, as `list` skips a record — the register is a cache, never a reader's failure.
|
|
238
|
+
*/
|
|
239
|
+
listReverts(): Promise<readonly PlaybookRunRevertMarker[]>;
|
|
153
240
|
/**
|
|
154
241
|
* Why each of a run's files no longer holds what the run wrote (#1614): a LATER recorded run wrote the
|
|
155
242
|
* same path, or nothing recorded did. Acceptance reads this so a run whose work was refined by a later
|
|
@@ -157,6 +244,7 @@ export declare class PlaybookRunWriteRegisterCompanionService {
|
|
|
157
244
|
*/
|
|
158
245
|
describeSuccession(runId: string): Promise<ReadonlyMap<string, PlaybookRunFileSuccession>>;
|
|
159
246
|
private resolveRegisterDirectory;
|
|
247
|
+
private resolveRevertDirectory;
|
|
160
248
|
private resolveRecordPath;
|
|
161
249
|
}
|
|
162
250
|
export {};
|
package/dist/esm/meta-workflows/services/playbook-run-write-register.companion.service.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playbook-run-write-register.companion.service.d.ts","sourceRoot":"","sources":["../../../../../src/meta-workflows/services/playbook-run-write-register.companion.service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"playbook-run-write-register.companion.service.d.ts","sourceRoot":"","sources":["../../../../../src/meta-workflows/services/playbook-run-write-register.companion.service.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,0CAA0C,EAE1C,KAAK,0BAA0B,EAC/B,KAAK,sBAAsB,EAE5B,MAAM,wCAAwC,CAAC;AAChD,OAAO,K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