@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":"meta-workflows-lane.models.d.ts","sourceRoot":"","sources":["../../../../../src/meta-workflows/models/meta-workflows-lane.models.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"meta-workflows-lane.models.d.ts","sourceRoot":"","sources":["../../../../../src/meta-workflows/models/meta-workflows-lane.models.ts"],"names":[],"mappings":"AAqBA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,yBAAyB,EAAG,uBAAgC,CAAC;AAE1E;;;;GAIG;AACH,eAAO,MAAM,qCAAqC,EAAG,6BAAsC,CAAC;AAC5F;;;;;;;GAOG;AACH,eAAO,MAAM,sCAAsC,EAAG,8BAAuC,CAAC;AAE9F;;;;;;;;GAQG;AACH,oBAAY,6BAA6B;IACvC;;;;;;;;;;;;OAYG;IACH,SAAS,cAAc;IACvB;;;;;;OAMG;IACH,IAAI,SAAS;CACd;AAED,gHAAgH;AAChH,wBAAgB,yBAAyB,CAAC,WAAW,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAE3F;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAEhF;AAED,sFAAsF;AACtF,eAAO,MAAM,iCAAiC,EAAG,sBAA+B,CAAC;AAEjF;;;;;;;GAOG;AACH,eAAO,MAAM,uCAAuC,EAAG,qCAA8C,CAAC;AAEtG;;;;;GAKG;AACH,eAAO,MAAM,sDAAsD,EAAG,oDAA6D,CAAC;AAEpI,iDAAiD;AACjD,eAAO,MAAM,uCAAuC,EAAG,+BAAwC,CAAC;AAChG,eAAO,MAAM,sDAAsD,EAAG,8CAAuD,CAAC;AAE9H;;;;;;;;;;GAUG;AACH,eAAO,MAAM,2BAA2B,QAA8F,CAAC;AAEvI;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,EAAG,eAAwB,CAAC;AAEtE;;;;GAIG;AACH,eAAO,MAAM,kCAAkC,EAAG,oBAA6B,CAAC"}
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
* promised was aspiration rather than a list anyone could read. The downward
|
|
17
17
|
* direction is still the rule; a citation is not what makes it one.
|
|
18
18
|
*/
|
|
19
|
+
import { CREATION_LANE_PROVIDER_REQUIREMENTS, CreationLaneProviderConsumer } from '@wildo-ai/application-creation-runtime';
|
|
19
20
|
import { playbookInstanceId } from '@wildo-ai/saas-specifications/application-creation';
|
|
20
21
|
/**
|
|
21
22
|
* The meta-workflows actor system (P-14) — the one REGISTERED system every playbook run is an
|
|
@@ -124,13 +125,17 @@ export const META_WORKFLOWS_STRUCTURED_ARTIFACT_GENERATOR_AGENT_REF = 'meta-work
|
|
|
124
125
|
export const META_WORKFLOWS_PLAYBOOK_JUDGE_ACTOR_REF = 'meta-workflows.playbook-judge';
|
|
125
126
|
export const META_WORKFLOWS_STRUCTURED_ARTIFACT_GENERATOR_ACTOR_REF = 'meta-workflows.structured-artifact-generator';
|
|
126
127
|
/**
|
|
127
|
-
* Provider + model for the lane agents
|
|
128
|
-
*
|
|
129
|
-
*
|
|
130
|
-
*
|
|
131
|
-
*
|
|
128
|
+
* Provider + model for the lane agents, read from the creation lane's one provider table — the
|
|
129
|
+
* creation preflight evaluates that same entry (#2229). `openai` is the labelling-proven
|
|
130
|
+
* path. The application must scope it under `providers.scopes.companion`: the
|
|
131
|
+
* companion's registry holds only the refs its own provider-runtime artifact
|
|
132
|
+
* lists (`filterRegistryByProviderRuntime`), so a provider scoped for the backend
|
|
133
|
+
* alone is refused here. (This said the gate was "catalog-based, not
|
|
134
|
+
* scope-gated" until 2026-10-02 — true before the registry was filtered by
|
|
135
|
+
* artifact, and false since.) A provider swap is a data edit in that table,
|
|
136
|
+
* not a code change (P-14).
|
|
132
137
|
*/
|
|
133
|
-
export const META_WORKFLOWS_PROVIDER_REF =
|
|
138
|
+
export const META_WORKFLOWS_PROVIDER_REF = CREATION_LANE_PROVIDER_REQUIREMENTS[CreationLaneProviderConsumer.PLAYBOOK_LANE].providerRef;
|
|
134
139
|
/**
|
|
135
140
|
* Traceability step kind for lane operations (P-13). Distinct from the
|
|
136
141
|
* executions plane's `'execution-persistence'` so journey runs are greppable
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meta-workflows-lane.models.js","sourceRoot":"","sources":["../../../../../src/meta-workflows/models/meta-workflows-lane.models.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,kBAAkB,EAAE,MAAM,oDAAoD,CAAC;AAExF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,uBAAgC,CAAC;AAE1E;;;;GAIG;AACH,MAAM,CAAC,MAAM,qCAAqC,GAAG,6BAAsC,CAAC;AAC5F;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,sCAAsC,GAAG,8BAAuC,CAAC;AAE9F;;;;;;;;GAQG;AACH,MAAM,CAAN,IAAY,6BAuBX;AAvBD,WAAY,6BAA6B;IACvC;;;;;;;;;;;;OAYG;IACH,wDAAuB,CAAA;IACvB;;;;;;OAMG;IACH,8CAAa,CAAA;AACf,CAAC,EAvBW,6BAA6B,KAA7B,6BAA6B,QAuBxC;AAED,gHAAgH;AAChH,MAAM,UAAU,yBAAyB,CAAC,WAAmB,EAAE,WAAoB;IACjF,OAAO,GAAG,6BAA6B,CAAC,SAAS,IAAI,kBAAkB,CAAC,WAAW,EAAE,WAAW,CAAC,EAAE,CAAC;AACtG,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,2BAA2B,CAAC,OAA2B;IACrE,OAAO,OAAO,KAAK,SAAS,IAAI,OAAO,CAAC,UAAU,CAAC,GAAG,6BAA6B,CAAC,SAAS,GAAG,CAAC,CAAC;AACpG,CAAC;AAED,sFAAsF;AACtF,MAAM,CAAC,MAAM,iCAAiC,GAAG,sBAA+B,CAAC;AAEjF;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,uCAAuC,GAAG,qCAA8C,CAAC;AAEtG;;;;;GAKG;AACH,MAAM,CAAC,MAAM,sDAAsD,GAAG,oDAA6D,CAAC;AAEpI,iDAAiD;AACjD,MAAM,CAAC,MAAM,uCAAuC,GAAG,+BAAwC,CAAC;AAChG,MAAM,CAAC,MAAM,sDAAsD,GAAG,8CAAuD,CAAC;AAE9H;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,QAAiB,CAAC;AAE7D;;;;GAIG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,eAAwB,CAAC;AAEtE;;;;GAIG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAAG,oBAA6B,CAAC","sourcesContent":["/**\n * Shared vocabulary for the companion meta-workflows lane (implementation\n * spec Step 5). Every ref/kind/proxy constant the four lane services and the\n * journey controller agree on lives here — single-sourced so a rename never\n * drifts between the actor-system definitions, the runner, and the tracing.\n *\n * The lane is deliberately EXTRACTION-SHAPED (S3 / P-25): it imports only\n * downward (engine bare specifiers plus companion ports) and never reaches\n * into a configured application's packages.\n *\n * NOTHING ENFORCES THAT, and this comment claimed otherwise until 2026-09-19:\n * it cited `../__tests__/extraction-boundary.test.ts` \"for the enforced port\n * list\", and no such file has ever existed — `meta-workflows/__tests__/` is not\n * a directory. The lane's services already import from `claude-cli/`, `core/`,\n * `deliberations/` and `executions/`, so the \"small enumerated set\" the old text\n * promised was aspiration rather than a list anyone could read. The downward\n * direction is still the rule; a citation is not what makes it one.\n */\nimport { playbookInstanceId } from '@wildo-ai/saas-specifications/application-creation';\n\n/**\n * The meta-workflows actor system (P-14) — the one REGISTERED system every playbook run is an\n * execution of.\n *\n * ## A playbook run is an execution the ENGINE drives — since #1358 (2026-09-20)\n *\n * The history in three steps, kept because each step was recorded as a fact when it was one:\n *\n * - until 2026-09-19 the contract said playbook runs were `ActorSystem` executions and nothing\n * started one;\n * - #1343 made `runPlaybook` open and settle an execution and a task itself, best-effort, under a\n * per-playbook `systemRef` `meta-workflows.<playbookRef>` — a convention naming a system that was\n * never registered, so the engine could not have validated it, and `executeActor` kept zero callers;\n * - #1358 moved that lifecycle into the engine: `ActorsSystemBackendService.runActorExecution` opens\n * the rows, hands the opened ids to the companion's executor, and settles on the outcome. The\n * execution's `systemRef` is THIS registered system, the task's actor is\n * {@link META_WORKFLOWS_PLAYBOOK_RUN_ACTOR_REF}, the playbook travels in the task's correlation\n * envelope, and the execution's `_id` is the run's ONE identity. The plane is required: no reachable\n * store, no run.\n *\n * The board still reads its own projections of this (#1362 is where it starts reading the rows), and\n * the in-memory `lastCompletedDetachedRuns` / disk checkpoints are deleted there and in #1360, not\n * kept beside the plane as a mirror.\n */\nexport const META_WORKFLOWS_SYSTEM_REF = 'meta-workflows.system' as const;\n\n/**\n * The PROGRAMMATIC actor that runs a playbook — its behaviour is `runPlaybook`, handed to the engine\n * as the execution's executor. Every playbook run is one task for this actor on one execution of\n * {@link META_WORKFLOWS_SYSTEM_REF}; which playbook is in the task's `context.correlation.refs.playbookRef`.\n */\nexport const META_WORKFLOWS_PLAYBOOK_RUN_ACTOR_REF = 'meta-workflows.playbook-run' as const;\n/**\n * The actor that RUNS A PLAYBOOK LOOP — the unattended chain \"gate → the model chooses → run →\n * re-read the tree → repeat\" (#1361). PROGRAMMATIC, like the run actor. Until 2026-09-20 a loop was\n * the one long-running unit of this lane with NO row of any kind: its runs were executions, the loop\n * driving them was an in-memory flag, and a companion restart mid-loop left nothing anywhere saying\n * one had been going. Its own actor rather than the run actor's, because a loop is not a playbook\n * run — it names no playbook, and the runs read must not mistake it for one.\n */\nexport const META_WORKFLOWS_PLAYBOOK_LOOP_ACTOR_REF = 'meta-workflows.playbook-loop' as const;\n\n/**\n * What an execution of `meta-workflows.system` may run EXCLUSIVELY — the subjects of the engine's\n * single-flight lease (#1361).\n *\n * Each is exactly the scope an in-memory flag refused on until 2026-09-20, no wider (#1264: nothing\n * narrows what may run concurrently). The lease is the execution ROW, so a restart and a second\n * companion process read the same answer the flag could only give inside one process — and a manual\n * single-playbook run still carries no subject and is never refused.\n */\nexport enum MetaWorkflowsExclusiveSubject {\n /**\n * ONE run per composite INSTANCE (#1610). The leased string is {@link compositeExclusiveSubject}, never\n * this member alone: a second run of the same instance would adopt the first one's progress\n * checkpoint mid-flight and continue a run that is still going, so it is refused as the same piece of\n * work. Two DIFFERENT composites, or two instances of one, run side by side: a secondary line beside\n * the main line is the design (#1602), and their writes to one tree are detected and repaired rather\n * than prevented (#1614 records a landing over another run's, and each run records the runs it\n * overlapped on its own row). A NESTED composite carries no subject: its root holds one, and a refusal\n * would abort the root on its own child.\n *\n * Until #1610 the member WAS the lease, one composite per application, so a feature line opened while\n * the main line ran was refused 409 or waited for the whole of it.\n */\n COMPOSITE = 'composite',\n /**\n * ONE unattended loop per application (OC-1 design D4), re-examined for #1610 and KEPT. The loop drives\n * the MAIN line from a free-form goal and has no line identity, so two loops cannot be told apart the\n * way two composite instances can, and nothing would relate their portfolios. A secondary line runs as\n * a composite instance, never as a second loop. The composites a loop starts each take their own\n * per-instance subject, so a loop and a person running a different composite no longer collide.\n */\n LOOP = 'loop',\n}\n\n/** The lease a composite INSTANCE holds while it runs (#1610): `composite:<ref>` or `composite:<ref>@<key>`. */\nexport function compositeExclusiveSubject(playbookRef: string, instanceKey?: string): string {\n return `${MetaWorkflowsExclusiveSubject.COMPOSITE}:${playbookInstanceId(playbookRef, instanceKey)}`;\n}\n\n/**\n * Whether a leased subject is a composite's: the ONE question a reader asks of a row's subject. A reader\n * comparing to the bare member would miss every composite since #1610 and report it as an ordinary run.\n */\nexport function isCompositeExclusiveSubject(subject: string | undefined): boolean {\n return subject !== undefined && subject.startsWith(`${MetaWorkflowsExclusiveSubject.COMPOSITE}:`);\n}\n\n/** The correlation domain the app-creation lane writes into the engine's envelope. */\nexport const META_WORKFLOWS_CORRELATION_DOMAIN = 'application-creation' as const;\n\n/**\n * Structured-output JUDGE agent — the lane's semantic evaluator, invoked via\n * `invokeAgent` GENERATE_STRUCTURED on openai (the AI-SDK `generateObject`\n * path). Callers pass the declared output Zod schema so the model is\n * CONSTRAINED to emit a conformant object, not free-form prose that must be\n * parsed and hoped-to-validate. Registered at startup via the composition\n * assembly spread.\n */\nexport const META_WORKFLOWS_PLAYBOOK_JUDGE_AGENT_REF = 'meta-workflows.playbook-judge.agent' as const;\n\n/**\n * Structured-artifact generator used internally by the portable Action\n * Driver. It is distinct from the semantic judge: generation proposes family\n * content, while evaluation interprets sealed evidence after deterministic\n * validation.\n */\nexport const META_WORKFLOWS_STRUCTURED_ARTIFACT_GENERATOR_AGENT_REF = 'meta-workflows.structured-artifact-generator.agent' as const;\n\n/** Actor refs inside `meta-workflows.system`. */\nexport const META_WORKFLOWS_PLAYBOOK_JUDGE_ACTOR_REF = 'meta-workflows.playbook-judge' as const;\nexport const META_WORKFLOWS_STRUCTURED_ARTIFACT_GENERATOR_ACTOR_REF = 'meta-workflows.structured-artifact-generator' as const;\n\n/**\n * Provider + model for the lane agents. `openai` is the labelling-proven\n * path — the WT companion runs openai today despite the companion scope (the\n * provider gate is catalog-based, not scope-gated: see the WT seed assertion\n * `assertion-provider-gate-catalog-based`). A provider swap later is a data\n * edit on the agent definition, not a code change (P-14).\n */\nexport const META_WORKFLOWS_PROVIDER_REF = 'openai' as const;\n\n/**\n * Traceability step kind for lane operations (P-13). Distinct from the\n * executions plane's `'execution-persistence'` so journey runs are greppable\n * in the session tree.\n */\nexport const META_WORKFLOW_TRACE_STEP_KIND = 'meta-workflow' as const;\n\n/**\n * The trace-step kind of one PHASE of a playbook run — a read made before anything the run's own trace\n * shows (the artifact state, a composite's build-progress baseline), traced with a started and a\n * completed event so a slow phase is not mistaken for a hang (#1639).\n */\nexport const PLAYBOOK_RUN_PHASE_TRACE_STEP_KIND = 'playbook-run-phase' as const;\n\n"]}
|
|
1
|
+
{"version":3,"file":"meta-workflows-lane.models.js","sourceRoot":"","sources":["../../../../../src/meta-workflows/models/meta-workflows-lane.models.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,mCAAmC,EAAE,4BAA4B,EAAE,MAAM,wCAAwC,CAAC;AAC3H,OAAO,EAAE,kBAAkB,EAAE,MAAM,oDAAoD,CAAC;AAExF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,uBAAgC,CAAC;AAE1E;;;;GAIG;AACH,MAAM,CAAC,MAAM,qCAAqC,GAAG,6BAAsC,CAAC;AAC5F;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,sCAAsC,GAAG,8BAAuC,CAAC;AAE9F;;;;;;;;GAQG;AACH,MAAM,CAAN,IAAY,6BAuBX;AAvBD,WAAY,6BAA6B;IACvC;;;;;;;;;;;;OAYG;IACH,wDAAuB,CAAA;IACvB;;;;;;OAMG;IACH,8CAAa,CAAA;AACf,CAAC,EAvBW,6BAA6B,KAA7B,6BAA6B,QAuBxC;AAED,gHAAgH;AAChH,MAAM,UAAU,yBAAyB,CAAC,WAAmB,EAAE,WAAoB;IACjF,OAAO,GAAG,6BAA6B,CAAC,SAAS,IAAI,kBAAkB,CAAC,WAAW,EAAE,WAAW,CAAC,EAAE,CAAC;AACtG,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,2BAA2B,CAAC,OAA2B;IACrE,OAAO,OAAO,KAAK,SAAS,IAAI,OAAO,CAAC,UAAU,CAAC,GAAG,6BAA6B,CAAC,SAAS,GAAG,CAAC,CAAC;AACpG,CAAC;AAED,sFAAsF;AACtF,MAAM,CAAC,MAAM,iCAAiC,GAAG,sBAA+B,CAAC;AAEjF;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,uCAAuC,GAAG,qCAA8C,CAAC;AAEtG;;;;;GAKG;AACH,MAAM,CAAC,MAAM,sDAAsD,GAAG,oDAA6D,CAAC;AAEpI,iDAAiD;AACjD,MAAM,CAAC,MAAM,uCAAuC,GAAG,+BAAwC,CAAC;AAChG,MAAM,CAAC,MAAM,sDAAsD,GAAG,8CAAuD,CAAC;AAE9H;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,mCAAmC,CAAC,4BAA4B,CAAC,aAAa,CAAC,CAAC,WAAW,CAAC;AAEvI;;;;GAIG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,eAAwB,CAAC;AAEtE;;;;GAIG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAAG,oBAA6B,CAAC","sourcesContent":["/**\n * Shared vocabulary for the companion meta-workflows lane (implementation\n * spec Step 5). Every ref/kind/proxy constant the four lane services and the\n * journey controller agree on lives here — single-sourced so a rename never\n * drifts between the actor-system definitions, the runner, and the tracing.\n *\n * The lane is deliberately EXTRACTION-SHAPED (S3 / P-25): it imports only\n * downward (engine bare specifiers plus companion ports) and never reaches\n * into a configured application's packages.\n *\n * NOTHING ENFORCES THAT, and this comment claimed otherwise until 2026-09-19:\n * it cited `../__tests__/extraction-boundary.test.ts` \"for the enforced port\n * list\", and no such file has ever existed — `meta-workflows/__tests__/` is not\n * a directory. The lane's services already import from `claude-cli/`, `core/`,\n * `deliberations/` and `executions/`, so the \"small enumerated set\" the old text\n * promised was aspiration rather than a list anyone could read. The downward\n * direction is still the rule; a citation is not what makes it one.\n */\nimport { CREATION_LANE_PROVIDER_REQUIREMENTS, CreationLaneProviderConsumer } from '@wildo-ai/application-creation-runtime';\nimport { playbookInstanceId } from '@wildo-ai/saas-specifications/application-creation';\n\n/**\n * The meta-workflows actor system (P-14) — the one REGISTERED system every playbook run is an\n * execution of.\n *\n * ## A playbook run is an execution the ENGINE drives — since #1358 (2026-09-20)\n *\n * The history in three steps, kept because each step was recorded as a fact when it was one:\n *\n * - until 2026-09-19 the contract said playbook runs were `ActorSystem` executions and nothing\n * started one;\n * - #1343 made `runPlaybook` open and settle an execution and a task itself, best-effort, under a\n * per-playbook `systemRef` `meta-workflows.<playbookRef>` — a convention naming a system that was\n * never registered, so the engine could not have validated it, and `executeActor` kept zero callers;\n * - #1358 moved that lifecycle into the engine: `ActorsSystemBackendService.runActorExecution` opens\n * the rows, hands the opened ids to the companion's executor, and settles on the outcome. The\n * execution's `systemRef` is THIS registered system, the task's actor is\n * {@link META_WORKFLOWS_PLAYBOOK_RUN_ACTOR_REF}, the playbook travels in the task's correlation\n * envelope, and the execution's `_id` is the run's ONE identity. The plane is required: no reachable\n * store, no run.\n *\n * The board still reads its own projections of this (#1362 is where it starts reading the rows), and\n * the in-memory `lastCompletedDetachedRuns` / disk checkpoints are deleted there and in #1360, not\n * kept beside the plane as a mirror.\n */\nexport const META_WORKFLOWS_SYSTEM_REF = 'meta-workflows.system' as const;\n\n/**\n * The PROGRAMMATIC actor that runs a playbook — its behaviour is `runPlaybook`, handed to the engine\n * as the execution's executor. Every playbook run is one task for this actor on one execution of\n * {@link META_WORKFLOWS_SYSTEM_REF}; which playbook is in the task's `context.correlation.refs.playbookRef`.\n */\nexport const META_WORKFLOWS_PLAYBOOK_RUN_ACTOR_REF = 'meta-workflows.playbook-run' as const;\n/**\n * The actor that RUNS A PLAYBOOK LOOP — the unattended chain \"gate → the model chooses → run →\n * re-read the tree → repeat\" (#1361). PROGRAMMATIC, like the run actor. Until 2026-09-20 a loop was\n * the one long-running unit of this lane with NO row of any kind: its runs were executions, the loop\n * driving them was an in-memory flag, and a companion restart mid-loop left nothing anywhere saying\n * one had been going. Its own actor rather than the run actor's, because a loop is not a playbook\n * run — it names no playbook, and the runs read must not mistake it for one.\n */\nexport const META_WORKFLOWS_PLAYBOOK_LOOP_ACTOR_REF = 'meta-workflows.playbook-loop' as const;\n\n/**\n * What an execution of `meta-workflows.system` may run EXCLUSIVELY — the subjects of the engine's\n * single-flight lease (#1361).\n *\n * Each is exactly the scope an in-memory flag refused on until 2026-09-20, no wider (#1264: nothing\n * narrows what may run concurrently). The lease is the execution ROW, so a restart and a second\n * companion process read the same answer the flag could only give inside one process — and a manual\n * single-playbook run still carries no subject and is never refused.\n */\nexport enum MetaWorkflowsExclusiveSubject {\n /**\n * ONE run per composite INSTANCE (#1610). The leased string is {@link compositeExclusiveSubject}, never\n * this member alone: a second run of the same instance would adopt the first one's progress\n * checkpoint mid-flight and continue a run that is still going, so it is refused as the same piece of\n * work. Two DIFFERENT composites, or two instances of one, run side by side: a secondary line beside\n * the main line is the design (#1602), and their writes to one tree are detected and repaired rather\n * than prevented (#1614 records a landing over another run's, and each run records the runs it\n * overlapped on its own row). A NESTED composite carries no subject: its root holds one, and a refusal\n * would abort the root on its own child.\n *\n * Until #1610 the member WAS the lease, one composite per application, so a feature line opened while\n * the main line ran was refused 409 or waited for the whole of it.\n */\n COMPOSITE = 'composite',\n /**\n * ONE unattended loop per application (OC-1 design D4), re-examined for #1610 and KEPT. The loop drives\n * the MAIN line from a free-form goal and has no line identity, so two loops cannot be told apart the\n * way two composite instances can, and nothing would relate their portfolios. A secondary line runs as\n * a composite instance, never as a second loop. The composites a loop starts each take their own\n * per-instance subject, so a loop and a person running a different composite no longer collide.\n */\n LOOP = 'loop',\n}\n\n/** The lease a composite INSTANCE holds while it runs (#1610): `composite:<ref>` or `composite:<ref>@<key>`. */\nexport function compositeExclusiveSubject(playbookRef: string, instanceKey?: string): string {\n return `${MetaWorkflowsExclusiveSubject.COMPOSITE}:${playbookInstanceId(playbookRef, instanceKey)}`;\n}\n\n/**\n * Whether a leased subject is a composite's: the ONE question a reader asks of a row's subject. A reader\n * comparing to the bare member would miss every composite since #1610 and report it as an ordinary run.\n */\nexport function isCompositeExclusiveSubject(subject: string | undefined): boolean {\n return subject !== undefined && subject.startsWith(`${MetaWorkflowsExclusiveSubject.COMPOSITE}:`);\n}\n\n/** The correlation domain the app-creation lane writes into the engine's envelope. */\nexport const META_WORKFLOWS_CORRELATION_DOMAIN = 'application-creation' as const;\n\n/**\n * Structured-output JUDGE agent — the lane's semantic evaluator, invoked via\n * `invokeAgent` GENERATE_STRUCTURED on openai (the AI-SDK `generateObject`\n * path). Callers pass the declared output Zod schema so the model is\n * CONSTRAINED to emit a conformant object, not free-form prose that must be\n * parsed and hoped-to-validate. Registered at startup via the composition\n * assembly spread.\n */\nexport const META_WORKFLOWS_PLAYBOOK_JUDGE_AGENT_REF = 'meta-workflows.playbook-judge.agent' as const;\n\n/**\n * Structured-artifact generator used internally by the portable Action\n * Driver. It is distinct from the semantic judge: generation proposes family\n * content, while evaluation interprets sealed evidence after deterministic\n * validation.\n */\nexport const META_WORKFLOWS_STRUCTURED_ARTIFACT_GENERATOR_AGENT_REF = 'meta-workflows.structured-artifact-generator.agent' as const;\n\n/** Actor refs inside `meta-workflows.system`. */\nexport const META_WORKFLOWS_PLAYBOOK_JUDGE_ACTOR_REF = 'meta-workflows.playbook-judge' as const;\nexport const META_WORKFLOWS_STRUCTURED_ARTIFACT_GENERATOR_ACTOR_REF = 'meta-workflows.structured-artifact-generator' as const;\n\n/**\n * Provider + model for the lane agents, read from the creation lane's one provider table — the\n * creation preflight evaluates that same entry (#2229). `openai` is the labelling-proven\n * path. The application must scope it under `providers.scopes.companion`: the\n * companion's registry holds only the refs its own provider-runtime artifact\n * lists (`filterRegistryByProviderRuntime`), so a provider scoped for the backend\n * alone is refused here. (This said the gate was \"catalog-based, not\n * scope-gated\" until 2026-10-02 — true before the registry was filtered by\n * artifact, and false since.) A provider swap is a data edit in that table,\n * not a code change (P-14).\n */\nexport const META_WORKFLOWS_PROVIDER_REF = CREATION_LANE_PROVIDER_REQUIREMENTS[CreationLaneProviderConsumer.PLAYBOOK_LANE].providerRef;\n\n/**\n * Traceability step kind for lane operations (P-13). Distinct from the\n * executions plane's `'execution-persistence'` so journey runs are greppable\n * in the session tree.\n */\nexport const META_WORKFLOW_TRACE_STEP_KIND = 'meta-workflow' as const;\n\n/**\n * The trace-step kind of one PHASE of a playbook run — a read made before anything the run's own trace\n * shows (the artifact state, a composite's build-progress baseline), traced with a started and a\n * completed event so a slow phase is not mistaken for a hang (#1639).\n */\nexport const PLAYBOOK_RUN_PHASE_TRACE_STEP_KIND = 'playbook-run-phase' as const;\n\n"]}
|
|
@@ -114,6 +114,8 @@ export interface PlaybookChoreographyProgressContext {
|
|
|
114
114
|
readonly value?: unknown;
|
|
115
115
|
}>;
|
|
116
116
|
readonly delivered: ReadonlyArray<string>;
|
|
117
|
+
/** Children a verdict re-opened in the run although they were current — see the runtime checkpoint's `reopened`. */
|
|
118
|
+
readonly reopened?: ReadonlyArray<string>;
|
|
117
119
|
readonly nested?: ReadonlyArray<PlaybookChoreographyProgressContext>;
|
|
118
120
|
}
|
|
119
121
|
export declare const PlaybookChoreographyCheckpointContextSchema: z.ZodObject<{
|
|
@@ -127,6 +129,7 @@ export declare const PlaybookChoreographyCheckpointContextSchema: z.ZodObject<{
|
|
|
127
129
|
value: z.ZodUnknown;
|
|
128
130
|
}, z.core.$strip>>;
|
|
129
131
|
delivered: z.ZodArray<z.ZodString>;
|
|
132
|
+
reopened: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
130
133
|
nested: z.ZodOptional<z.ZodArray<z.ZodType<PlaybookChoreographyProgressContext, unknown, z.core.$ZodTypeInternals<PlaybookChoreographyProgressContext, unknown>>>>;
|
|
131
134
|
}, z.core.$strip>;
|
|
132
135
|
export type PlaybookChoreographyCheckpointContext = z.infer<typeof PlaybookChoreographyCheckpointContextSchema>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playbook-run-checkpoint.models.d.ts","sourceRoot":"","sources":["../../../../../src/meta-workflows/models/playbook-run-checkpoint.models.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,OAAO,EACL,uBAAuB,EAEvB,KAAK,qBAAqB,EAC3B,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,4BAA4B,EAC5B,KAAK,4BAA4B,EAClC,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,sBAAsB,EAAE,MAAM,oDAAoD,CAAC;AAE5F;;;;;;;GAOG;AACH,oBAAY,yBAAyB;IACnC,uGAAuG;IACvG,aAAa,kBAAkB;IAC/B,kGAAkG;IAClG,YAAY,iBAAiB;CAC9B;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,qCAAqC;;;;;;;;;;;;;;;;;;;;;;;;;;iBAyChD,CAAC;AACH,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qCAAqC,CAAC,CAAC;AAEpG;;;;;GAKG;AACH;;;;;;;;;;;;;;;;;;GAkBG;AACH;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,mCAAmC;IAClD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,mBAAmB,EAAE,MAAM,CAAC;IACrC,QAAQ,CAAC,WAAW,EAAE,aAAa,CAAC;QAAE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;IACxF,QAAQ,CAAC,SAAS,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAC1C,QAAQ,CAAC,MAAM,CAAC,EAAE,aAAa,CAAC,mCAAmC,CAAC,CAAC;CACtE;
|
|
1
|
+
{"version":3,"file":"playbook-run-checkpoint.models.d.ts","sourceRoot":"","sources":["../../../../../src/meta-workflows/models/playbook-run-checkpoint.models.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,OAAO,EACL,uBAAuB,EAEvB,KAAK,qBAAqB,EAC3B,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,4BAA4B,EAC5B,KAAK,4BAA4B,EAClC,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,sBAAsB,EAAE,MAAM,oDAAoD,CAAC;AAE5F;;;;;;;GAOG;AACH,oBAAY,yBAAyB;IACnC,uGAAuG;IACvG,aAAa,kBAAkB;IAC/B,kGAAkG;IAClG,YAAY,iBAAiB;CAC9B;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,qCAAqC;;;;;;;;;;;;;;;;;;;;;;;;;;iBAyChD,CAAC;AACH,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qCAAqC,CAAC,CAAC;AAEpG;;;;;GAKG;AACH;;;;;;;;;;;;;;;;;;GAkBG;AACH;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,mCAAmC;IAClD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,mBAAmB,EAAE,MAAM,CAAC;IACrC,QAAQ,CAAC,WAAW,EAAE,aAAa,CAAC;QAAE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;IACxF,QAAQ,CAAC,SAAS,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAC1C,oHAAoH;IACpH,QAAQ,CAAC,QAAQ,CAAC,EAAE,aAAa,CAAC,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,4BAA4B,GAAG,qBAAqB,CAmBvI;AAkBD,6EAA6E;AAC7E,oBAAY,kBAAkB;IAC5B,sFAAsF;IACtF,WAAW,gBAAgB;IAC3B,+FAA+F;IAC/F,OAAO,YAAY;IACnB,mFAAmF;IACnF,MAAM,WAAW;IACjB,6DAA6D;IAC7D,OAAO,YAAY;CACpB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,6BAA6B,CAAC,KAAK,EAAE;IACnD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,QAAQ,EAAE,4BAA4B,CAAC;CACjD,GAAG,qBAAqB,CA2CxB"}
|
|
@@ -95,6 +95,7 @@ const PlaybookChoreographyProgressContextSchema = z.object({
|
|
|
95
95
|
completedIterations: z.number().int().nonnegative(),
|
|
96
96
|
stepResults: z.array(z.object({ ref: z.string().min(1), value: z.unknown() })),
|
|
97
97
|
delivered: z.array(z.string()),
|
|
98
|
+
reopened: z.array(z.string()).optional(),
|
|
98
99
|
nested: z.lazy(() => z.array(PlaybookChoreographyProgressContextSchema)).optional(),
|
|
99
100
|
});
|
|
100
101
|
export const PlaybookChoreographyCheckpointContextSchema = z.object({
|
|
@@ -106,6 +107,7 @@ export const PlaybookChoreographyCheckpointContextSchema = z.object({
|
|
|
106
107
|
completedIterations: z.number().int().nonnegative(),
|
|
107
108
|
stepResults: z.array(z.object({ ref: z.string().min(1), value: z.unknown() })),
|
|
108
109
|
delivered: z.array(z.string()),
|
|
110
|
+
reopened: z.array(z.string()).optional(),
|
|
109
111
|
/** Composite children IN FLIGHT when this was written — see {@link PlaybookChoreographyProgressContext}. */
|
|
110
112
|
nested: z.array(PlaybookChoreographyProgressContextSchema).optional(),
|
|
111
113
|
});
|
|
@@ -237,6 +239,7 @@ const CUT_OFF_ENDINGS = {
|
|
|
237
239
|
DURATION_CEILING: ' at its time limit, without converging',
|
|
238
240
|
DEPTH_CEILING: ' without opening: it would have run deeper than its depth ceiling allows',
|
|
239
241
|
ALL_CHILDREN_FAILED: ' because every child of one iteration failed',
|
|
242
|
+
REPEATED_FAILURE: ' because what was left to run had failed the same way twice with nothing it reads changed',
|
|
240
243
|
};
|
|
241
244
|
/** The answers a lane boundary offers — the refs a person's answer names. */
|
|
242
245
|
export var LaneBoundaryAction;
|
|
@@ -277,6 +280,10 @@ export function projectLaneBoundaryAsDecision(input) {
|
|
|
277
280
|
const failed = boundary.failure
|
|
278
281
|
? ` It ended FAILED — ${boundary.failure.failures.map((entry) => `${entry.playbookRef}: ${entry.failure}`).join('; ')} — and its failure policy is ${boundary.failure.policy}.`
|
|
279
282
|
: '';
|
|
283
|
+
// A lane that ended without the move it ends on did not conclude (#2236): the person reads which, and why.
|
|
284
|
+
const unconcluded = boundary.closingMoveUnrun
|
|
285
|
+
? ` It ended WITHOUT its closing move "${boundary.closingMoveUnrun.playbookRef}": ${boundary.closingMoveUnrun.detail}`
|
|
286
|
+
: '';
|
|
280
287
|
const approve = { ref: LaneBoundaryAction.APPROVE, label: 'Approve the result', intent: HumanDecision_ResponseIntent.PROCEED_WITHOUT_VALUES, description: 'Keep the landed files. Acceptance is a commit; nothing else is written.' };
|
|
281
288
|
const revise = { ref: LaneBoundaryAction.REVISE, label: 'Revise', intent: HumanDecision_ResponseIntent.PROCEED_WITH_VALUES, description: 'Re-run the lane with your note as its objective.' };
|
|
282
289
|
const discard = { ref: LaneBoundaryAction.DISCARD, label: 'Discard', intent: HumanDecision_ResponseIntent.ABORT, description: 'Revert the files this lane landed.' };
|
|
@@ -292,7 +299,7 @@ export function projectLaneBoundaryAsDecision(input) {
|
|
|
292
299
|
return {
|
|
293
300
|
decisionId: input.runId,
|
|
294
301
|
title: `${input.playbookRef} · lane boundary`,
|
|
295
|
-
description: `The lane "${input.playbookRef}" ended${ending}. ${kept}${failed} ${boundary.decision === PlaybookLaneBoundaryDecision.NOTIFY
|
|
302
|
+
description: `The lane "${input.playbookRef}" ended${ending}. ${kept}${failed}${unconcluded} ${boundary.decision === PlaybookLaneBoundaryDecision.NOTIFY
|
|
296
303
|
? 'It asked to notify you; no approval is owed.'
|
|
297
304
|
: 'It asked for its result to be approved before the next lane builds on it.'}`.trim(),
|
|
298
305
|
fields: notifyOnly ? [] : [{ ref: 'revision-note', question: 'What should the lane change, if you send it back?', kind: HumanDecision_FieldKind.FREE_TEXT }],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playbook-run-checkpoint.models.js","sourceRoot":"","sources":["../../../../../src/meta-workflows/models/playbook-run-checkpoint.models.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB;;;;;GAKG;AACH,OAAO,EACL,uBAAuB,EACvB,4BAA4B,GAE7B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,0BAA0B,EAAE,gCAAgC,EAAE,MAAM,sCAAsC,CAAC;AACpH,OAAO,EACL,4BAA4B,GAE7B,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,sBAAsB,EAAE,MAAM,oDAAoD,CAAC;AAE5F;;;;;;;GAOG;AACH,MAAM,CAAN,IAAY,yBAKX;AALD,WAAY,yBAAyB;IACnC,uGAAuG;IACvG,4DAA+B,CAAA;IAC/B,kGAAkG;IAClG,0DAA6B,CAAA;AAC/B,CAAC,EALW,yBAAyB,KAAzB,yBAAyB,QAKpC;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,MAAM,qCAAqC,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5D,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,yBAAyB,CAAC,aAAa,CAAC;IACxD,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC9B;;;OAGG;IACH,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC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AAM,IAAI,QAAQ,CAAC,QAAQ,KAAK,4BAA4B,CAAC,MAAM;YACxI,CAAC,CAAC,8CAA8C;YAChD,CAAC,CAAC,2EAA2E,EAAE,CAAC,IAAI,EAAE;QACxF,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,eAAe,EAAE,QAAQ,EAAE,mDAAmD,EAAE,IAAI,EAAE,uBAAuB,CAAC,SAAS,EAAE,CAAC;QAC5J,OAAO,EAAE,UAAU;YACjB,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,kBAAkB,CAAC,WAAW,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,4BAA4B,CAAC,sBAAsB,EAAE,WAAW,EAAE,8CAA8C,EAAE,CAAC;YACtL,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;QAC5E,WAAW,EAAE,KAAK,CAAC,WAAW;KAC/B,CAAC;AACJ,CAAC","sourcesContent":["import { z } from 'zod';\n/*\n * The field-kind vocabulary from the package that OWNS it. `@wildo-ai/saas-specifications/application-creation`\n * published a second name for this enum until 2026-09-19 (#1342); an enum is nominal, so an exported\n * schema has to name the declaring package or tsc tries to name a path into another package's\n * `node_modules` (TS2742).\n */\nimport {\n HumanDecision_FieldKind,\n HumanDecision_ResponseIntent,\n type HumanDecision_Request,\n} from '@wildo-ai/saas-models';\nimport { MetaWorkflow_FailurePolicy, MetaWorkflow_ClarificationAction } from '@wildo-ai/saas-models/meta-workflows';\nimport {\n PlaybookLaneBoundaryDecision,\n type PlaybookChoreographyBoundary,\n} from '@wildo-ai/application-creation-runtime';\nimport { Journey_AutonomyPreset } from '@wildo-ai/saas-specifications/application-creation';\n\n/**\n * WHICH of this lane's two checkpoints a row's `checkpoint.context` is.\n *\n * Both kinds ride the same engine slot on executions of the same actor system, and the engine treats\n * the content as opaque — so the lane has to be able to tell them apart on the way back out, and\n * guessing from which fields happen to be present is how a composite's progress gets offered as a\n * question to answer. A closed vocabulary with one named source.\n */\nexport enum PlaybookRunCheckpointKind {\n /** A run that stopped to ASK: the inputs that rebuild its brief, the questions, the answers so far. */\n CLARIFICATION = 'clarification',\n /** A composite's PROGRESS: what its children returned and landed, so a later run continues it. */\n CHOREOGRAPHY = 'choreography',\n}\n\n/**\n * What a SUSPENDED playbook run needs to continue — the execution row's `checkpoint.context` (#1360).\n *\n * This is the industry pattern's persistence half: LangGraph's checkpointer, Step Functions' task\n * token, Temporal's workflow state. Wildo's version is deliberately the smallest of those, because\n * the thing being resumed is small: a suspended run has produced NOTHING (the clarification check\n * runs before the artifact call), so there is no partial artifact to snapshot — only the inputs that\n * would rebuild the same brief, plus the questions asked and any answers already given.\n *\n * ## Where it lives, and where it used to\n *\n * Until 2026-09-20 this was a JSON file under `.wildo-saas/state/meta-workflows/suspended-runs/`,\n * named by a composed handle minted for the purpose, written by a service of its own. #1269 had\n * unified what a person is ASKED (`HumanDecision_Request`) and left the storage where it was, on the\n * premise that a playbook run had no execution row. #1343 removed the premise and #1358 made the\n * engine drive the run, so the wait lives on the row the run already has: the engine writes the\n * pending decision as `suspension`, and this as the `checkpoint` it hands back on resume — under the\n * SAME execution id, which is also the run id the resume route takes.\n *\n * The engine treats the context as opaque, so THIS schema is where its shape is enforced: it is\n * parsed on the way back out, and a row this version cannot read is reported as unreadable rather\n * than resumed wrongly.\n */\nexport const PlaybookRunSuspensionCheckpointSchema = z.object({\n kind: z.literal(PlaybookRunCheckpointKind.CLARIFICATION),\n playbookRef: z.string().min(1),\n /**\n * The playbook INSTANCE that suspended (#1609); absent for the default instance. The resume rebuilds the\n * run as that instance, so it reads the same answers and lands where the attempt would have.\n */\n instanceKey: z.string().min(1).optional(),\n /** The output being derived when the questions arose. */\n family: z.string().min(1),\n /** Rounds already spent, so the budget survives a resume rather than resetting. */\n round: z.number().int().min(1),\n /** Resume preserves preview intent; an unknown intent previews, which writes nothing. */\n dryRun: z.boolean().default(true),\n creatorBrief: z.string().optional(),\n /**\n * Why the journey loop chose this playbook, when a loop lane is what suspended (#1423).\n *\n * Carried for the same reason as `creatorBrief` beside it: the resume rebuilds the run's input, and\n * a field it drops is a brief that differs between the attempt and its continuation. OPTIONAL, so\n * a checkpoint written before this field parses unchanged.\n */\n selectionRationale: z.string().optional(),\n /**\n * The signed-in person who started the run (#1751), so a resumed run that asks again routes its next\n * question to the same person. Absent for a run started from the console, whose questions stay unrouted.\n */\n requestedByUserId: z.string().min(1).optional(),\n /** The playbook's DECLARED up-front interview answers, replayed verbatim on resume. */\n elicitationAnswers: z.array(z.object({ questionRef: z.string().min(1), answer: z.string() })),\n /** Clarification answers from EARLIER rounds — cumulative, so the model never re-asks. */\n /* `answeredByRef` (#1658) is kept, or the author of every answer would be stripped at the checkpoint. */\n priorAnswers: z.array(z.object({ ref: z.string().min(1), answer: z.string(), answeredByRef: z.string().min(1).optional() })),\n /** Cumulative questions, including those paired with priorAnswers from earlier rounds. */\n requests: z.array(z.object({\n ref: z.string().min(1),\n question: z.string().min(1),\n why: z.string().min(1),\n kind: z.enum(HumanDecision_FieldKind),\n options: z.array(z.string()).optional(),\n })),\n});\nexport type PlaybookRunSuspensionCheckpoint = z.infer<typeof PlaybookRunSuspensionCheckpointSchema>;\n\n/**\n * One waiting run as a LISTING sees it — enough to decide whether to answer it, and to answer it.\n * The resume INPUTS (`creatorBrief`, `elicitationAnswers`, `priorAnswers`) are left out: they can be\n * large, and none of them helps a reader choose between waiting runs. `runId` is the actor\n * execution's id and `suspendedAt` is the row's own instant.\n */\n/**\n * A COMPOSITE's progress — the execution row's `checkpoint.context` while a choreography runs, and\n * after it ends without concluding (#1360).\n *\n * A composite makes dozens of paid model calls in one run and holds every result in memory until it\n * returns; when the process is taken away mid-iteration — on a machine where other sessions land\n * code, a thirteen-minute run needs a thirteen-minute window nobody can schedule — the spend was\n * real and the evidence was gone. This is what a later run of the SAME composite continues from.\n *\n * Until 2026-09-20 it was a JSON file under `.wildo-saas/state/meta-workflows/choreography-checkpoints/`\n * keyed by the composite's ref. It lives on the run's own actor execution now: written after every\n * iteration, consumed when the run concludes, and LEFT in place when the run ends without concluding\n * — a throw, an environment stop, or a host that died and was settled `ABORTED` at the next startup.\n * \"Interrupted and resumable\" is a row with this on it; re-running the composite adopts the newest.\n *\n * Objects rather than `[ref, value]` tuples: Zod 4 infers `z.unknown()` in a tuple position as\n * OPTIONAL, so the parsed type stops satisfying `readonly [string, unknown]`. Named fields also make\n * a checkpoint readable to whoever opens one while debugging a lost run.\n */\n/**\n * One composite's progress, at any level of nesting (#1497).\n *\n * The RUNTIME checkpoint nests — a lane in flight checkpoints through its parent, so the parent's\n * snapshot carries the lane's under `nested`, keyed by the lane's ref — and this is the same shape\n * one level down. Recursive on purpose: a lane of lanes nests twice, and a schema that stopped at one\n * level would parse the outer run and silently DROP the inner one's progress on the way back out,\n * which is exactly the loss the checkpoint exists to prevent.\n *\n * `completedIterations` is `nonnegative` rather than `positive`, because a parent whose first\n * iteration is still in flight — a lane inside it having just completed ITS first — has completed\n * zero, and that is a checkpoint worth keeping.\n */\nexport interface PlaybookChoreographyProgressContext {\n readonly playbookRef: string;\n readonly goal: string;\n readonly completedIterations: number;\n readonly stepResults: ReadonlyArray<{ readonly ref: string; readonly value?: unknown }>;\n readonly delivered: ReadonlyArray<string>;\n readonly nested?: ReadonlyArray<PlaybookChoreographyProgressContext>;\n}\nconst PlaybookChoreographyProgressContextSchema: z.ZodType<PlaybookChoreographyProgressContext> = z.object({\n playbookRef: z.string().min(1),\n goal: z.string(),\n completedIterations: z.number().int().nonnegative(),\n stepResults: z.array(z.object({ ref: z.string().min(1), value: z.unknown() })),\n delivered: z.array(z.string()),\n nested: z.lazy(() => z.array(PlaybookChoreographyProgressContextSchema)).optional(),\n});\n\nexport const PlaybookChoreographyCheckpointContextSchema = z.object({\n kind: z.literal(PlaybookRunCheckpointKind.CHOREOGRAPHY),\n playbookRef: z.string().min(1),\n /** The composite INSTANCE whose progress this is (#1609); absent for the default instance. */\n instanceKey: z.string().min(1).optional(),\n goal: z.string(),\n completedIterations: z.number().int().nonnegative(),\n stepResults: z.array(z.object({ ref: z.string().min(1), value: z.unknown() })),\n delivered: z.array(z.string()),\n /** Composite children IN FLIGHT when this was written — see {@link PlaybookChoreographyProgressContext}. */\n nested: z.array(PlaybookChoreographyProgressContextSchema).optional(),\n});\nexport type PlaybookChoreographyCheckpointContext = z.infer<typeof PlaybookChoreographyCheckpointContextSchema>;\n\nexport type SuspendedPlaybookRunSummary =\n Pick<PlaybookRunSuspensionCheckpoint, 'playbookRef' | 'family' | 'round' | 'requests' | 'dryRun'>\n & {\n readonly runId: string;\n readonly suspendedAt: string;\n /** The signed-in person the question is routed to (#1751); absent when it is unrouted. */\n readonly routedToUserId?: string;\n };\n\n/** Named so the transport answers 404 rather than 500 for a resume of a run that is not waiting. */\nexport class SuspendedPlaybookRunNotFoundError extends Error {\n public constructor(runId: string) {\n super(\n `No suspended playbook run \"${runId}\" is waiting for answers. It may have been resumed already, `\n + 'cancelled, or it is not a run this application holds.',\n );\n }\n}\n\n/**\n * Named so the transport answers 409: the run IS waiting, but not on the round the answer names (#1584).\n * A run asks again after an answer, under the same run id, so an answer, a decline or a cancel that\n * named no round would act on whichever round waits when it lands — not the one its person read.\n *\n * Two readings, and the sentence says which: an EARLIER round is one the run has moved past, the\n * ordinary case; a LATER one names questions the run has not asked. The second was measured live on\n * 2026-09-25 (#1585), where the one sentence answered a round-2 reply to a round-1 run with \"has asked\n * again since round 2\", which is backwards.\n */\nexport class SupersededPlaybookRunQuestionError extends Error {\n public constructor(runId: string, answeredRound: number, waitingRound: number) {\n super(\n answeredRound < waitingRound\n ? `Playbook run \"${runId}\" has asked again since round ${answeredRound}: it now waits on round ${waitingRound}. `\n + 'Read its current questions and answer those.'\n : `Playbook run \"${runId}\" has not asked round ${answeredRound}: it waits on round ${waitingRound}. `\n + 'Read its current questions and answer those.',\n );\n }\n}\n\n/**\n * The pending clarification as the decision plane states it (#1264): the questions still OUTSTANDING\n * are the fields, and MCP's three elicitation actions are the options — accept carries values,\n * decline proceeds without them (\"decide it yourself and say what you assumed\"), cancel withdraws.\n *\n * `decisionId` is the run id — the execution the answer resumes — typed as the opaque string the\n * payload asks for. No `expiresAt`: a playbook clarification simply waits, and the payload's own rule\n * is that an absent deadline never lapses.\n */\nexport function projectPlaybookClarificationAsDecision(input: {\n readonly runId: string;\n readonly requestedAt: string;\n readonly checkpoint: PlaybookRunSuspensionCheckpoint;\n}): HumanDecision_Request {\n const answered = new Set(input.checkpoint.priorAnswers.map((answer) => answer.ref));\n const outstanding = input.checkpoint.requests.filter((request) => !answered.has(request.ref));\n return {\n decisionId: input.runId,\n title: `${input.checkpoint.playbookRef} · ${input.checkpoint.family}`,\n description:\n `The run stopped before producing ${input.checkpoint.family} to ask ${outstanding.length} question(s) — round ${input.checkpoint.round}. `\n + 'Nothing has been generated or written. Answering continues the same run; declining lets it decide and record what it assumed.',\n fields: outstanding.map((request) => {\n const options = (request.options ?? []).filter((option) => option.length > 0);\n return {\n ref: request.ref,\n question: request.question,\n /*\n * A CHOICE the model stated no options for cannot be answered as a choice, and the decision\n * payload REFUSES one — which would fail the suspend, and with it a run that did nothing\n * wrong. It is asked as free text instead; the checkpoint keeps the request as the model\n * wrote it, so nothing about what was asked is lost.\n */\n kind: request.kind === HumanDecision_FieldKind.CHOICE && options.length === 0 ? HumanDecision_FieldKind.FREE_TEXT : request.kind,\n why: request.why,\n ...(options.length > 0 ? { options } : {}),\n };\n }),\n options: [\n { ref: MetaWorkflow_ClarificationAction.ACCEPT, label: 'Answer and continue', intent: HumanDecision_ResponseIntent.PROCEED_WITH_VALUES },\n { ref: MetaWorkflow_ClarificationAction.DECLINE, label: 'Let it decide', intent: HumanDecision_ResponseIntent.PROCEED_WITHOUT_VALUES, description: 'The run proceeds without your answers and records what it assumed.' },\n { ref: MetaWorkflow_ClarificationAction.CANCEL, label: 'Cancel this run', intent: HumanDecision_ResponseIntent.ABORT },\n ],\n requestedAt: input.requestedAt,\n };\n}\n\n/**\n * The autonomy posture the creation lane runs under — ONE named source, read wherever a marked gate\n * has to decide between suspending and notify-and-proceed (#111).\n *\n * `Journey_AutonomyPreset` had zero readers and no setter (`wildo journey set-autonomy` exists in no\n * CLI). This constant is the first reader. Its value is the posture Paul decided on 2026-09-03 and\n * `one-source-of-truth.md` D5 records: YOLO for all — the system proceeds, the person is notified and\n * can override. Changing the posture is a deliberate edit here until a setter exists; it is not a\n * per-run option, because a gate whose arming can be switched per request is a standing bypass.\n */\nexport const APPLICATION_CREATION_AUTONOMY_POSTURE: Journey_AutonomyPreset = Journey_AutonomyPreset.YOLO;\n\n/** What a marked gate DOES at the lane boundary under a posture: record and return, or hold the run. */\nexport enum LaneBoundaryTreatment {\n /** The decision is written on the run's row for a person to act on; the run concludes. */\n NOTIFY_AND_PROCEED = 'notify_and_proceed',\n /** The run holds at the boundary until the decision arrives — the GUIDED posture's gate. */\n SUSPEND = 'suspend',\n}\n\n/**\n * The posture × decision → treatment table, TOTAL over both vocabularies so a posture or a decision\n * kind added tomorrow has to be classified here rather than falling through to \"proceed\".\n *\n * `NONE` never suspends anywhere: there is nothing to decide. `NOTIFY` never suspends: it was\n * authored as a notification. `APPROVE_RESULT` suspends only under GUIDED — YOLO_LIGHT commits the\n * non-critical automatically (`application-creation-directive.md`), and a lane's landings are working\n * edits a later commit accepts, so they are not the critical list.\n */\nexport function laneBoundaryTreatmentFor(posture: Journey_AutonomyPreset, decision: PlaybookLaneBoundaryDecision): LaneBoundaryTreatment {\n const table: Readonly<Record<Journey_AutonomyPreset, Readonly<Record<PlaybookLaneBoundaryDecision, LaneBoundaryTreatment>>>> = {\n [Journey_AutonomyPreset.GUIDED]: {\n [PlaybookLaneBoundaryDecision.NONE]: LaneBoundaryTreatment.NOTIFY_AND_PROCEED,\n [PlaybookLaneBoundaryDecision.NOTIFY]: LaneBoundaryTreatment.NOTIFY_AND_PROCEED,\n [PlaybookLaneBoundaryDecision.APPROVE_RESULT]: LaneBoundaryTreatment.SUSPEND,\n },\n [Journey_AutonomyPreset.YOLO_LIGHT]: {\n [PlaybookLaneBoundaryDecision.NONE]: LaneBoundaryTreatment.NOTIFY_AND_PROCEED,\n [PlaybookLaneBoundaryDecision.NOTIFY]: LaneBoundaryTreatment.NOTIFY_AND_PROCEED,\n [PlaybookLaneBoundaryDecision.APPROVE_RESULT]: LaneBoundaryTreatment.NOTIFY_AND_PROCEED,\n },\n [Journey_AutonomyPreset.YOLO]: {\n [PlaybookLaneBoundaryDecision.NONE]: LaneBoundaryTreatment.NOTIFY_AND_PROCEED,\n [PlaybookLaneBoundaryDecision.NOTIFY]: LaneBoundaryTreatment.NOTIFY_AND_PROCEED,\n [PlaybookLaneBoundaryDecision.APPROVE_RESULT]: LaneBoundaryTreatment.NOTIFY_AND_PROCEED,\n },\n };\n return table[posture][decision];\n}\n\n/**\n * How a lane's ending READS to a person, for the endings that are not a conclusion.\n *\n * Only the cut-off ones have an entry: a lane that concluded on its own terms needs no explanation\n * beyond \"ended\", and `?? ''` is the honest rendering of that rather than a sentence invented for it.\n * Keyed by the runtime's own stop vocabulary as a partial Record, so a value it adds arrives here as\n * silence rather than as a wrong sentence.\n */\nconst CUT_OFF_ENDINGS: Readonly<Partial<Record<string, string>>> = {\n ITERATION_CEILING: ' at its iteration ceiling, without converging',\n DURATION_CEILING: ' at its time limit, without converging',\n DEPTH_CEILING: ' without opening: it would have run deeper than its depth ceiling allows',\n ALL_CHILDREN_FAILED: ' because every child of one iteration failed',\n};\n\n/** The answers a lane boundary offers — the refs a person's answer names. */\nexport enum LaneBoundaryAction {\n /** The only answer a NOTIFY boundary offers: it asked to tell you, not to ask you. */\n ACKNOWLEDGE = 'acknowledge',\n /** Keep what the lane landed; acceptance stays a commit (`one-source-of-truth.md`, rule 2). */\n APPROVE = 'approve',\n /** Re-run the lane with a note about what to change — carried as the one field. */\n REVISE = 'revise',\n /** Revert the lane's landings through the write register. */\n DISCARD = 'discard',\n}\n\n/**\n * The lane boundary as the decision plane states it (#111): ONE `approve_result` decision, its\n * fields the person's note for a revision, its options approve / revise / discard.\n *\n * `onFailure` is READ here, for the first time anywhere: a failed lane under `REVERT_CHANGESET`\n * lists DISCARD first — the authored default — and never performs it, because git already makes\n * every landing visible and reversible and a lane that failed on its last iteration may have landed\n * good work before it. `KEEP_AND_FLAG` keeps APPROVE first and flags the failure in the description.\n *\n * `decisionId` is the run id, the handle every other decision on this plane uses. No `expiresAt`: a\n * lane boundary waits, or is recorded, and either way it does not lapse.\n */\nexport function projectLaneBoundaryAsDecision(input: {\n readonly runId: string;\n readonly playbookRef: string;\n readonly requestedAt: string;\n readonly boundary: PlaybookChoreographyBoundary;\n}): HumanDecision_Request {\n const { boundary } = input;\n const kept = boundary.keptPaths.length > 0\n ? `It landed ${boundary.keptPaths.length} file(s) as working edits: ${boundary.keptPaths.join(', ')}.`\n : 'It landed nothing.';\n /*\n * HOW it ended, in the person's words. A lane cut off by a breaker is a different question from one\n * that finished: \"approve this result\" and \"this ran ten rounds, spent, and did not converge — do\n * you want it again?\" are not the same thing, and a description that said only the first would be\n * asking about a result that does not exist.\n */\n const ending = CUT_OFF_ENDINGS[boundary.stoppedBecause] ?? '';\n const failed = boundary.failure\n ? ` It ended FAILED — ${boundary.failure.failures.map((entry) => `${entry.playbookRef}: ${entry.failure}`).join('; ')} — and its failure policy is ${boundary.failure.policy}.`\n : '';\n const approve = { ref: LaneBoundaryAction.APPROVE, label: 'Approve the result', intent: HumanDecision_ResponseIntent.PROCEED_WITHOUT_VALUES, description: 'Keep the landed files. Acceptance is a commit; nothing else is written.' };\n const revise = { ref: LaneBoundaryAction.REVISE, label: 'Revise', intent: HumanDecision_ResponseIntent.PROCEED_WITH_VALUES, description: 'Re-run the lane with your note as its objective.' };\n const discard = { ref: LaneBoundaryAction.DISCARD, label: 'Discard', intent: HumanDecision_ResponseIntent.ABORT, description: 'Revert the files this lane landed.' };\n const revertsFirst = boundary.failure?.policy === MetaWorkflow_FailurePolicy.REVERT_CHANGESET;\n /*\n * A NOTIFY boundary is a RECORD, not a question, and it must be structurally distinguishable from\n * one that owes a decision — a consumer that can only tell them apart by reading the description\n * is a consumer that will get it wrong. `notify` was authored as \"tell me\", so it carries one\n * acknowledging option and no fields; the payload requires at least one option, and acknowledging\n * is the honest single answer to a notification.\n */\n const notifyOnly = boundary.decision === PlaybookLaneBoundaryDecision.NOTIFY;\n return {\n decisionId: input.runId,\n title: `${input.playbookRef} · lane boundary`,\n description: `The lane \"${input.playbookRef}\" ended${ending}. ${kept}${failed} ${boundary.decision === PlaybookLaneBoundaryDecision.NOTIFY\n ? 'It asked to notify you; no approval is owed.'\n : 'It asked for its result to be approved before the next lane builds on it.'}`.trim(),\n fields: notifyOnly ? [] : [{ ref: 'revision-note', question: 'What should the lane change, if you send it back?', kind: HumanDecision_FieldKind.FREE_TEXT }],\n options: notifyOnly\n ? [{ ref: LaneBoundaryAction.ACKNOWLEDGE, label: 'Got it', intent: HumanDecision_ResponseIntent.PROCEED_WITHOUT_VALUES, description: 'This lane asked to tell you, not to ask you.' }]\n : (revertsFirst ? [discard, approve, revise] : [approve, revise, discard]),\n requestedAt: input.requestedAt,\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"playbook-run-checkpoint.models.js","sourceRoot":"","sources":["../../../../../src/meta-workflows/models/playbook-run-checkpoint.models.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB;;;;;GAKG;AACH,OAAO,EACL,uBAAuB,EACvB,4BAA4B,GAE7B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,0BAA0B,EAAE,gCAAgC,EAAE,MAAM,sCAAsC,CAAC;AACpH,OAAO,EACL,4BAA4B,GAE7B,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,sBAAsB,EAAE,MAAM,oDAAoD,CAA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AE,CAAC;QAC5J,OAAO,EAAE,UAAU;YACjB,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,kBAAkB,CAAC,WAAW,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,4BAA4B,CAAC,sBAAsB,EAAE,WAAW,EAAE,8CAA8C,EAAE,CAAC;YACtL,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;QAC5E,WAAW,EAAE,KAAK,CAAC,WAAW;KAC/B,CAAC;AACJ,CAAC","sourcesContent":["import { z } from 'zod';\n/*\n * The field-kind vocabulary from the package that OWNS it. `@wildo-ai/saas-specifications/application-creation`\n * published a second name for this enum until 2026-09-19 (#1342); an enum is nominal, so an exported\n * schema has to name the declaring package or tsc tries to name a path into another package's\n * `node_modules` (TS2742).\n */\nimport {\n HumanDecision_FieldKind,\n HumanDecision_ResponseIntent,\n type HumanDecision_Request,\n} from '@wildo-ai/saas-models';\nimport { MetaWorkflow_FailurePolicy, MetaWorkflow_ClarificationAction } from '@wildo-ai/saas-models/meta-workflows';\nimport {\n PlaybookLaneBoundaryDecision,\n type PlaybookChoreographyBoundary,\n} from '@wildo-ai/application-creation-runtime';\nimport { Journey_AutonomyPreset } from '@wildo-ai/saas-specifications/application-creation';\n\n/**\n * WHICH of this lane's two checkpoints a row's `checkpoint.context` is.\n *\n * Both kinds ride the same engine slot on executions of the same actor system, and the engine treats\n * the content as opaque — so the lane has to be able to tell them apart on the way back out, and\n * guessing from which fields happen to be present is how a composite's progress gets offered as a\n * question to answer. A closed vocabulary with one named source.\n */\nexport enum PlaybookRunCheckpointKind {\n /** A run that stopped to ASK: the inputs that rebuild its brief, the questions, the answers so far. */\n CLARIFICATION = 'clarification',\n /** A composite's PROGRESS: what its children returned and landed, so a later run continues it. */\n CHOREOGRAPHY = 'choreography',\n}\n\n/**\n * What a SUSPENDED playbook run needs to continue — the execution row's `checkpoint.context` (#1360).\n *\n * This is the industry pattern's persistence half: LangGraph's checkpointer, Step Functions' task\n * token, Temporal's workflow state. Wildo's version is deliberately the smallest of those, because\n * the thing being resumed is small: a suspended run has produced NOTHING (the clarification check\n * runs before the artifact call), so there is no partial artifact to snapshot — only the inputs that\n * would rebuild the same brief, plus the questions asked and any answers already given.\n *\n * ## Where it lives, and where it used to\n *\n * Until 2026-09-20 this was a JSON file under `.wildo-saas/state/meta-workflows/suspended-runs/`,\n * named by a composed handle minted for the purpose, written by a service of its own. #1269 had\n * unified what a person is ASKED (`HumanDecision_Request`) and left the storage where it was, on the\n * premise that a playbook run had no execution row. #1343 removed the premise and #1358 made the\n * engine drive the run, so the wait lives on the row the run already has: the engine writes the\n * pending decision as `suspension`, and this as the `checkpoint` it hands back on resume — under the\n * SAME execution id, which is also the run id the resume route takes.\n *\n * The engine treats the context as opaque, so THIS schema is where its shape is enforced: it is\n * parsed on the way back out, and a row this version cannot read is reported as unreadable rather\n * than resumed wrongly.\n */\nexport const PlaybookRunSuspensionCheckpointSchema = z.object({\n kind: z.literal(PlaybookRunCheckpointKind.CLARIFICATION),\n playbookRef: z.string().min(1),\n /**\n * The playbook INSTANCE that suspended (#1609); absent for the default instance. The resume rebuilds the\n * run as that instance, so it reads the same answers and lands where the attempt would have.\n */\n instanceKey: z.string().min(1).optional(),\n /** The output being derived when the questions arose. */\n family: z.string().min(1),\n /** Rounds already spent, so the budget survives a resume rather than resetting. */\n round: z.number().int().min(1),\n /** Resume preserves preview intent; an unknown intent previews, which writes nothing. */\n dryRun: z.boolean().default(true),\n creatorBrief: z.string().optional(),\n /**\n * Why the journey loop chose this playbook, when a loop lane is what suspended (#1423).\n *\n * Carried for the same reason as `creatorBrief` beside it: the resume rebuilds the run's input, and\n * a field it drops is a brief that differs between the attempt and its continuation. OPTIONAL, so\n * a checkpoint written before this field parses unchanged.\n */\n selectionRationale: z.string().optional(),\n /**\n * The signed-in person who started the run (#1751), so a resumed run that asks again routes its next\n * question to the same person. Absent for a run started from the console, whose questions stay unrouted.\n */\n requestedByUserId: z.string().min(1).optional(),\n /** The playbook's DECLARED up-front interview answers, replayed verbatim on resume. */\n elicitationAnswers: z.array(z.object({ questionRef: z.string().min(1), answer: z.string() })),\n /** Clarification answers from EARLIER rounds — cumulative, so the model never re-asks. */\n /* `answeredByRef` (#1658) is kept, or the author of every answer would be stripped at the checkpoint. */\n priorAnswers: z.array(z.object({ ref: z.string().min(1), answer: z.string(), answeredByRef: z.string().min(1).optional() })),\n /** Cumulative questions, including those paired with priorAnswers from earlier rounds. */\n requests: z.array(z.object({\n ref: z.string().min(1),\n question: z.string().min(1),\n why: z.string().min(1),\n kind: z.enum(HumanDecision_FieldKind),\n options: z.array(z.string()).optional(),\n })),\n});\nexport type PlaybookRunSuspensionCheckpoint = z.infer<typeof PlaybookRunSuspensionCheckpointSchema>;\n\n/**\n * One waiting run as a LISTING sees it — enough to decide whether to answer it, and to answer it.\n * The resume INPUTS (`creatorBrief`, `elicitationAnswers`, `priorAnswers`) are left out: they can be\n * large, and none of them helps a reader choose between waiting runs. `runId` is the actor\n * execution's id and `suspendedAt` is the row's own instant.\n */\n/**\n * A COMPOSITE's progress — the execution row's `checkpoint.context` while a choreography runs, and\n * after it ends without concluding (#1360).\n *\n * A composite makes dozens of paid model calls in one run and holds every result in memory until it\n * returns; when the process is taken away mid-iteration — on a machine where other sessions land\n * code, a thirteen-minute run needs a thirteen-minute window nobody can schedule — the spend was\n * real and the evidence was gone. This is what a later run of the SAME composite continues from.\n *\n * Until 2026-09-20 it was a JSON file under `.wildo-saas/state/meta-workflows/choreography-checkpoints/`\n * keyed by the composite's ref. It lives on the run's own actor execution now: written after every\n * iteration, consumed when the run concludes, and LEFT in place when the run ends without concluding\n * — a throw, an environment stop, or a host that died and was settled `ABORTED` at the next startup.\n * \"Interrupted and resumable\" is a row with this on it; re-running the composite adopts the newest.\n *\n * Objects rather than `[ref, value]` tuples: Zod 4 infers `z.unknown()` in a tuple position as\n * OPTIONAL, so the parsed type stops satisfying `readonly [string, unknown]`. Named fields also make\n * a checkpoint readable to whoever opens one while debugging a lost run.\n */\n/**\n * One composite's progress, at any level of nesting (#1497).\n *\n * The RUNTIME checkpoint nests — a lane in flight checkpoints through its parent, so the parent's\n * snapshot carries the lane's under `nested`, keyed by the lane's ref — and this is the same shape\n * one level down. Recursive on purpose: a lane of lanes nests twice, and a schema that stopped at one\n * level would parse the outer run and silently DROP the inner one's progress on the way back out,\n * which is exactly the loss the checkpoint exists to prevent.\n *\n * `completedIterations` is `nonnegative` rather than `positive`, because a parent whose first\n * iteration is still in flight — a lane inside it having just completed ITS first — has completed\n * zero, and that is a checkpoint worth keeping.\n */\nexport interface PlaybookChoreographyProgressContext {\n readonly playbookRef: string;\n readonly goal: string;\n readonly completedIterations: number;\n readonly stepResults: ReadonlyArray<{ readonly ref: string; readonly value?: unknown }>;\n readonly delivered: ReadonlyArray<string>;\n /** Children a verdict re-opened in the run although they were current — see the runtime checkpoint's `reopened`. */\n readonly reopened?: ReadonlyArray<string>;\n readonly nested?: ReadonlyArray<PlaybookChoreographyProgressContext>;\n}\nconst PlaybookChoreographyProgressContextSchema: z.ZodType<PlaybookChoreographyProgressContext> = z.object({\n playbookRef: z.string().min(1),\n goal: z.string(),\n completedIterations: z.number().int().nonnegative(),\n stepResults: z.array(z.object({ ref: z.string().min(1), value: z.unknown() })),\n delivered: z.array(z.string()),\n reopened: z.array(z.string()).optional(),\n nested: z.lazy(() => z.array(PlaybookChoreographyProgressContextSchema)).optional(),\n});\n\nexport const PlaybookChoreographyCheckpointContextSchema = z.object({\n kind: z.literal(PlaybookRunCheckpointKind.CHOREOGRAPHY),\n playbookRef: z.string().min(1),\n /** The composite INSTANCE whose progress this is (#1609); absent for the default instance. */\n instanceKey: z.string().min(1).optional(),\n goal: z.string(),\n completedIterations: z.number().int().nonnegative(),\n stepResults: z.array(z.object({ ref: z.string().min(1), value: z.unknown() })),\n delivered: z.array(z.string()),\n reopened: z.array(z.string()).optional(),\n /** Composite children IN FLIGHT when this was written — see {@link PlaybookChoreographyProgressContext}. */\n nested: z.array(PlaybookChoreographyProgressContextSchema).optional(),\n});\nexport type PlaybookChoreographyCheckpointContext = z.infer<typeof PlaybookChoreographyCheckpointContextSchema>;\n\nexport type SuspendedPlaybookRunSummary =\n Pick<PlaybookRunSuspensionCheckpoint, 'playbookRef' | 'family' | 'round' | 'requests' | 'dryRun'>\n & {\n readonly runId: string;\n readonly suspendedAt: string;\n /** The signed-in person the question is routed to (#1751); absent when it is unrouted. */\n readonly routedToUserId?: string;\n };\n\n/** Named so the transport answers 404 rather than 500 for a resume of a run that is not waiting. */\nexport class SuspendedPlaybookRunNotFoundError extends Error {\n public constructor(runId: string) {\n super(\n `No suspended playbook run \"${runId}\" is waiting for answers. It may have been resumed already, `\n + 'cancelled, or it is not a run this application holds.',\n );\n }\n}\n\n/**\n * Named so the transport answers 409: the run IS waiting, but not on the round the answer names (#1584).\n * A run asks again after an answer, under the same run id, so an answer, a decline or a cancel that\n * named no round would act on whichever round waits when it lands — not the one its person read.\n *\n * Two readings, and the sentence says which: an EARLIER round is one the run has moved past, the\n * ordinary case; a LATER one names questions the run has not asked. The second was measured live on\n * 2026-09-25 (#1585), where the one sentence answered a round-2 reply to a round-1 run with \"has asked\n * again since round 2\", which is backwards.\n */\nexport class SupersededPlaybookRunQuestionError extends Error {\n public constructor(runId: string, answeredRound: number, waitingRound: number) {\n super(\n answeredRound < waitingRound\n ? `Playbook run \"${runId}\" has asked again since round ${answeredRound}: it now waits on round ${waitingRound}. `\n + 'Read its current questions and answer those.'\n : `Playbook run \"${runId}\" has not asked round ${answeredRound}: it waits on round ${waitingRound}. `\n + 'Read its current questions and answer those.',\n );\n }\n}\n\n/**\n * The pending clarification as the decision plane states it (#1264): the questions still OUTSTANDING\n * are the fields, and MCP's three elicitation actions are the options — accept carries values,\n * decline proceeds without them (\"decide it yourself and say what you assumed\"), cancel withdraws.\n *\n * `decisionId` is the run id — the execution the answer resumes — typed as the opaque string the\n * payload asks for. No `expiresAt`: a playbook clarification simply waits, and the payload's own rule\n * is that an absent deadline never lapses.\n */\nexport function projectPlaybookClarificationAsDecision(input: {\n readonly runId: string;\n readonly requestedAt: string;\n readonly checkpoint: PlaybookRunSuspensionCheckpoint;\n}): HumanDecision_Request {\n const answered = new Set(input.checkpoint.priorAnswers.map((answer) => answer.ref));\n const outstanding = input.checkpoint.requests.filter((request) => !answered.has(request.ref));\n return {\n decisionId: input.runId,\n title: `${input.checkpoint.playbookRef} · ${input.checkpoint.family}`,\n description:\n `The run stopped before producing ${input.checkpoint.family} to ask ${outstanding.length} question(s) — round ${input.checkpoint.round}. `\n + 'Nothing has been generated or written. Answering continues the same run; declining lets it decide and record what it assumed.',\n fields: outstanding.map((request) => {\n const options = (request.options ?? []).filter((option) => option.length > 0);\n return {\n ref: request.ref,\n question: request.question,\n /*\n * A CHOICE the model stated no options for cannot be answered as a choice, and the decision\n * payload REFUSES one — which would fail the suspend, and with it a run that did nothing\n * wrong. It is asked as free text instead; the checkpoint keeps the request as the model\n * wrote it, so nothing about what was asked is lost.\n */\n kind: request.kind === HumanDecision_FieldKind.CHOICE && options.length === 0 ? HumanDecision_FieldKind.FREE_TEXT : request.kind,\n why: request.why,\n ...(options.length > 0 ? { options } : {}),\n };\n }),\n options: [\n { ref: MetaWorkflow_ClarificationAction.ACCEPT, label: 'Answer and continue', intent: HumanDecision_ResponseIntent.PROCEED_WITH_VALUES },\n { ref: MetaWorkflow_ClarificationAction.DECLINE, label: 'Let it decide', intent: HumanDecision_ResponseIntent.PROCEED_WITHOUT_VALUES, description: 'The run proceeds without your answers and records what it assumed.' },\n { ref: MetaWorkflow_ClarificationAction.CANCEL, label: 'Cancel this run', intent: HumanDecision_ResponseIntent.ABORT },\n ],\n requestedAt: input.requestedAt,\n };\n}\n\n/**\n * The autonomy posture the creation lane runs under — ONE named source, read wherever a marked gate\n * has to decide between suspending and notify-and-proceed (#111).\n *\n * `Journey_AutonomyPreset` had zero readers and no setter (`wildo journey set-autonomy` exists in no\n * CLI). This constant is the first reader. Its value is the posture Paul decided on 2026-09-03 and\n * `one-source-of-truth.md` D5 records: YOLO for all — the system proceeds, the person is notified and\n * can override. Changing the posture is a deliberate edit here until a setter exists; it is not a\n * per-run option, because a gate whose arming can be switched per request is a standing bypass.\n */\nexport const APPLICATION_CREATION_AUTONOMY_POSTURE: Journey_AutonomyPreset = Journey_AutonomyPreset.YOLO;\n\n/** What a marked gate DOES at the lane boundary under a posture: record and return, or hold the run. */\nexport enum LaneBoundaryTreatment {\n /** The decision is written on the run's row for a person to act on; the run concludes. */\n NOTIFY_AND_PROCEED = 'notify_and_proceed',\n /** The run holds at the boundary until the decision arrives — the GUIDED posture's gate. */\n SUSPEND = 'suspend',\n}\n\n/**\n * The posture × decision → treatment table, TOTAL over both vocabularies so a posture or a decision\n * kind added tomorrow has to be classified here rather than falling through to \"proceed\".\n *\n * `NONE` never suspends anywhere: there is nothing to decide. `NOTIFY` never suspends: it was\n * authored as a notification. `APPROVE_RESULT` suspends only under GUIDED — YOLO_LIGHT commits the\n * non-critical automatically (`application-creation-directive.md`), and a lane's landings are working\n * edits a later commit accepts, so they are not the critical list.\n */\nexport function laneBoundaryTreatmentFor(posture: Journey_AutonomyPreset, decision: PlaybookLaneBoundaryDecision): LaneBoundaryTreatment {\n const table: Readonly<Record<Journey_AutonomyPreset, Readonly<Record<PlaybookLaneBoundaryDecision, LaneBoundaryTreatment>>>> = {\n [Journey_AutonomyPreset.GUIDED]: {\n [PlaybookLaneBoundaryDecision.NONE]: LaneBoundaryTreatment.NOTIFY_AND_PROCEED,\n [PlaybookLaneBoundaryDecision.NOTIFY]: LaneBoundaryTreatment.NOTIFY_AND_PROCEED,\n [PlaybookLaneBoundaryDecision.APPROVE_RESULT]: LaneBoundaryTreatment.SUSPEND,\n },\n [Journey_AutonomyPreset.YOLO_LIGHT]: {\n [PlaybookLaneBoundaryDecision.NONE]: LaneBoundaryTreatment.NOTIFY_AND_PROCEED,\n [PlaybookLaneBoundaryDecision.NOTIFY]: LaneBoundaryTreatment.NOTIFY_AND_PROCEED,\n [PlaybookLaneBoundaryDecision.APPROVE_RESULT]: LaneBoundaryTreatment.NOTIFY_AND_PROCEED,\n },\n [Journey_AutonomyPreset.YOLO]: {\n [PlaybookLaneBoundaryDecision.NONE]: LaneBoundaryTreatment.NOTIFY_AND_PROCEED,\n [PlaybookLaneBoundaryDecision.NOTIFY]: LaneBoundaryTreatment.NOTIFY_AND_PROCEED,\n [PlaybookLaneBoundaryDecision.APPROVE_RESULT]: LaneBoundaryTreatment.NOTIFY_AND_PROCEED,\n },\n };\n return table[posture][decision];\n}\n\n/**\n * How a lane's ending READS to a person, for the endings that are not a conclusion.\n *\n * Only the cut-off ones have an entry: a lane that concluded on its own terms needs no explanation\n * beyond \"ended\", and `?? ''` is the honest rendering of that rather than a sentence invented for it.\n * Keyed by the runtime's own stop vocabulary as a partial Record, so a value it adds arrives here as\n * silence rather than as a wrong sentence.\n */\nconst CUT_OFF_ENDINGS: Readonly<Partial<Record<string, string>>> = {\n ITERATION_CEILING: ' at its iteration ceiling, without converging',\n DURATION_CEILING: ' at its time limit, without converging',\n DEPTH_CEILING: ' without opening: it would have run deeper than its depth ceiling allows',\n ALL_CHILDREN_FAILED: ' because every child of one iteration failed',\n REPEATED_FAILURE: ' because what was left to run had failed the same way twice with nothing it reads changed',\n};\n\n/** The answers a lane boundary offers — the refs a person's answer names. */\nexport enum LaneBoundaryAction {\n /** The only answer a NOTIFY boundary offers: it asked to tell you, not to ask you. */\n ACKNOWLEDGE = 'acknowledge',\n /** Keep what the lane landed; acceptance stays a commit (`one-source-of-truth.md`, rule 2). */\n APPROVE = 'approve',\n /** Re-run the lane with a note about what to change — carried as the one field. */\n REVISE = 'revise',\n /** Revert the lane's landings through the write register. */\n DISCARD = 'discard',\n}\n\n/**\n * The lane boundary as the decision plane states it (#111): ONE `approve_result` decision, its\n * fields the person's note for a revision, its options approve / revise / discard.\n *\n * `onFailure` is READ here, for the first time anywhere: a failed lane under `REVERT_CHANGESET`\n * lists DISCARD first — the authored default — and never performs it, because git already makes\n * every landing visible and reversible and a lane that failed on its last iteration may have landed\n * good work before it. `KEEP_AND_FLAG` keeps APPROVE first and flags the failure in the description.\n *\n * `decisionId` is the run id, the handle every other decision on this plane uses. No `expiresAt`: a\n * lane boundary waits, or is recorded, and either way it does not lapse.\n */\nexport function projectLaneBoundaryAsDecision(input: {\n readonly runId: string;\n readonly playbookRef: string;\n readonly requestedAt: string;\n readonly boundary: PlaybookChoreographyBoundary;\n}): HumanDecision_Request {\n const { boundary } = input;\n const kept = boundary.keptPaths.length > 0\n ? `It landed ${boundary.keptPaths.length} file(s) as working edits: ${boundary.keptPaths.join(', ')}.`\n : 'It landed nothing.';\n /*\n * HOW it ended, in the person's words. A lane cut off by a breaker is a different question from one\n * that finished: \"approve this result\" and \"this ran ten rounds, spent, and did not converge — do\n * you want it again?\" are not the same thing, and a description that said only the first would be\n * asking about a result that does not exist.\n */\n const ending = CUT_OFF_ENDINGS[boundary.stoppedBecause] ?? '';\n const failed = boundary.failure\n ? ` It ended FAILED — ${boundary.failure.failures.map((entry) => `${entry.playbookRef}: ${entry.failure}`).join('; ')} — and its failure policy is ${boundary.failure.policy}.`\n : '';\n // A lane that ended without the move it ends on did not conclude (#2236): the person reads which, and why.\n const unconcluded = boundary.closingMoveUnrun\n ? ` It ended WITHOUT its closing move \"${boundary.closingMoveUnrun.playbookRef}\": ${boundary.closingMoveUnrun.detail}`\n : '';\n const approve = { ref: LaneBoundaryAction.APPROVE, label: 'Approve the result', intent: HumanDecision_ResponseIntent.PROCEED_WITHOUT_VALUES, description: 'Keep the landed files. Acceptance is a commit; nothing else is written.' };\n const revise = { ref: LaneBoundaryAction.REVISE, label: 'Revise', intent: HumanDecision_ResponseIntent.PROCEED_WITH_VALUES, description: 'Re-run the lane with your note as its objective.' };\n const discard = { ref: LaneBoundaryAction.DISCARD, label: 'Discard', intent: HumanDecision_ResponseIntent.ABORT, description: 'Revert the files this lane landed.' };\n const revertsFirst = boundary.failure?.policy === MetaWorkflow_FailurePolicy.REVERT_CHANGESET;\n /*\n * A NOTIFY boundary is a RECORD, not a question, and it must be structurally distinguishable from\n * one that owes a decision — a consumer that can only tell them apart by reading the description\n * is a consumer that will get it wrong. `notify` was authored as \"tell me\", so it carries one\n * acknowledging option and no fields; the payload requires at least one option, and acknowledging\n * is the honest single answer to a notification.\n */\n const notifyOnly = boundary.decision === PlaybookLaneBoundaryDecision.NOTIFY;\n return {\n decisionId: input.runId,\n title: `${input.playbookRef} · lane boundary`,\n description: `The lane \"${input.playbookRef}\" ended${ending}. ${kept}${failed}${unconcluded} ${boundary.decision === PlaybookLaneBoundaryDecision.NOTIFY\n ? 'It asked to notify you; no approval is owed.'\n : 'It asked for its result to be approved before the next lane builds on it.'}`.trim(),\n fields: notifyOnly ? [] : [{ ref: 'revision-note', question: 'What should the lane change, if you send it back?', kind: HumanDecision_FieldKind.FREE_TEXT }],\n options: notifyOnly\n ? [{ ref: LaneBoundaryAction.ACKNOWLEDGE, label: 'Got it', intent: HumanDecision_ResponseIntent.PROCEED_WITHOUT_VALUES, description: 'This lane asked to tell you, not to ask you.' }]\n : (revertsFirst ? [discard, approve, revise] : [approve, revise, discard]),\n requestedAt: input.requestedAt,\n };\n}\n"]}
|
|
@@ -130,6 +130,10 @@ export interface PlaybookRunChildTally {
|
|
|
130
130
|
export interface PlaybookRunChoreographyIterationSummary {
|
|
131
131
|
readonly iteration: number;
|
|
132
132
|
readonly eligibleRefs: readonly string[];
|
|
133
|
+
/** Children on record with nothing they read changed, so not offered this round (2026-10-01). */
|
|
134
|
+
readonly withheldAsCurrent?: readonly string[];
|
|
135
|
+
/** Refreshes held back this round because a first-run child was offered and reads nothing they write. */
|
|
136
|
+
readonly deferredForFirstRun?: readonly string[];
|
|
133
137
|
readonly children: readonly PlaybookRunChoreographyChildSummary[];
|
|
134
138
|
readonly stopRationale?: string;
|
|
135
139
|
/** The round's wall-clock and spend — its selection and every dispatch in it (#1507). */
|
|
@@ -143,6 +147,12 @@ export interface PlaybookRunChoreographyIterationSummary {
|
|
|
143
147
|
}
|
|
144
148
|
export interface PlaybookRunChoreographyChildSummary {
|
|
145
149
|
readonly playbookRef: string;
|
|
150
|
+
/**
|
|
151
|
+
* Why it was on the table, in a sentence: a first run, a refresh and what moved (which family, re-landed
|
|
152
|
+
* by which run, when), or a re-opening by a verdict (2026-10-01). The question a wasted round raises, kept
|
|
153
|
+
* on the row because the board that answered it is gone once the round ends. Absent where it does not apply.
|
|
154
|
+
*/
|
|
155
|
+
readonly ranBecause?: string;
|
|
146
156
|
readonly landed: readonly string[];
|
|
147
157
|
readonly failure?: string;
|
|
148
158
|
/** Present when this child was itself a LANE (#1497). */
|
|
@@ -169,6 +179,16 @@ export interface PlaybookRunLaneSummary {
|
|
|
169
179
|
readonly childTally?: readonly PlaybookRunChildTally[];
|
|
170
180
|
readonly iterationsOverRepeatedState?: readonly number[];
|
|
171
181
|
readonly resumedAfterIteration?: number;
|
|
182
|
+
/**
|
|
183
|
+
* Why each of the lane's children was not on the table when it stopped — the same rows the root's
|
|
184
|
+
* {@link PlaybookRunChoreographySummary.unoffered} keeps. A stuck child is most often a LANE's child,
|
|
185
|
+
* and its `REPEATS_FAILURE` row was dropped here until 2026-10-01, leaving it only in a trace event.
|
|
186
|
+
*/
|
|
187
|
+
readonly unoffered?: readonly {
|
|
188
|
+
readonly playbookRef: string;
|
|
189
|
+
readonly reason: string;
|
|
190
|
+
readonly detail: string;
|
|
191
|
+
}[];
|
|
172
192
|
}
|
|
173
193
|
/** The composite outcome a run record keeps — see {@link PlaybookRunTaskSummary.choreography}. */
|
|
174
194
|
export interface PlaybookRunChoreographySummary {
|
|
@@ -236,11 +256,15 @@ export declare function readPlaybookRunMeasurement(taskOutput: unknown): Playboo
|
|
|
236
256
|
/** One round of a settled run's measurement — the root's or a nested lane's (#1507). */
|
|
237
257
|
export interface PlaybookRoundMeasurement {
|
|
238
258
|
readonly iteration: number;
|
|
259
|
+
readonly withheldAsCurrent?: readonly string[];
|
|
260
|
+
readonly deferredForFirstRun?: readonly string[];
|
|
239
261
|
readonly durationMs?: number;
|
|
240
262
|
readonly spend?: PlaybookSpend;
|
|
241
263
|
readonly sameInputStateAsIteration?: number;
|
|
242
264
|
readonly children: readonly {
|
|
243
265
|
readonly playbookRef: string;
|
|
266
|
+
/** See {@link PlaybookRunChoreographyChildSummary.ranBecause}. */
|
|
267
|
+
readonly ranBecause?: string;
|
|
244
268
|
readonly failed: boolean;
|
|
245
269
|
readonly landedCount: number;
|
|
246
270
|
readonly durationMs?: number;
|
|
@@ -398,4 +422,6 @@ export interface PlaybookLoopRunRecord {
|
|
|
398
422
|
* in-memory plane's rows the lane's tests drive — both are read, so the recognition is the same either way.
|
|
399
423
|
*/
|
|
400
424
|
export declare function projectLastPlaybookLoop(executions: readonly PlaybookRunExecutionRow[]): PlaybookLoopRunRecord | null;
|
|
425
|
+
/** EVERY unattended loop among the executions, newest first — the run report reads them all (#2231). */
|
|
426
|
+
export declare function projectPlaybookLoops(executions: readonly PlaybookRunExecutionRow[]): PlaybookLoopRunRecord[];
|
|
401
427
|
//# sourceMappingURL=playbook-run-record.models.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playbook-run-record.models.d.ts","sourceRoot":"","sources":["../../../../../src/meta-workflows/models/playbook-run-record.models.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAA+B,KAAK,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AACpH,OAAO,
|
|
1
|
+
{"version":3,"file":"playbook-run-record.models.d.ts","sourceRoot":"","sources":["../../../../../src/meta-workflows/models/playbook-run-record.models.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAA+B,KAAK,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AACpH,OAAO,EAML,KAAK,aAAa,EAEnB,MAAM,wCAAwC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,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACzD,QAAQ,CAAC,KAAK,CAAC,EAAE,aAAa,CAAC;QAC7B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;QAC3B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;QAC7B,QAAQ,CAAC,KAAK,CAAC,EAAE,aAAa,CAAC;QAC/B,QAAQ,CAAC,yBAAyB,CAAC,EAAE,MAAM,CAAC;QAC5C,oGAAoG;QACpG,QAAQ,CAAC,KAAK,CAAC,EAAE,aAAa,CAAC;YAAE,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;YAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;YAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;YAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;YAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,aAAa,CAAA;SAAE,CAAC,CAAC;KACxL,CAAC,CAAC;CACJ;AAED;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,SAAS,uBAAuB,EAAE,GAAG,qBAAqB,GAAG,IAAI,CAEpH;AAED,wGAAwG;AACxG,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,SAAS,uBAAuB,EAAE,GAAG,qBAAqB,EAAE,CA6C5G"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FlowsActors_Status, HumanDecision_RequestSchema } from '@wildo-ai/saas-models';
|
|
2
|
-
import { PlaybookSpendMeasurement, mergePlaybookSpend } from '@wildo-ai/application-creation-runtime';
|
|
2
|
+
import { PlaybookRerunKind, PlaybookSpendMeasurement, describePlaybookRerun, mergePlaybookSpend, } from '@wildo-ai/application-creation-runtime';
|
|
3
3
|
import { Workbench_PlaybookRunOutcomeStatus } from '@wildo-ai/platform-core-shared';
|
|
4
4
|
import { playbookInstanceId } from '@wildo-ai/saas-specifications/application-creation';
|
|
5
5
|
import { META_WORKFLOWS_PLAYBOOK_LOOP_ACTOR_REF } from './meta-workflows-lane.models.js';
|
|
@@ -111,6 +111,31 @@ export function readRecordedPlaybookSpend(value) {
|
|
|
111
111
|
...(count('inputTokens') !== undefined ? { inputTokens: count('inputTokens') } : {}),
|
|
112
112
|
...(count('outputTokens') !== undefined ? { outputTokens: count('outputTokens') } : {}),
|
|
113
113
|
...(count('totalTokens') !== undefined ? { totalTokens: count('totalTokens') } : {}),
|
|
114
|
+
...(count('cacheReadTokens') !== undefined ? { cacheReadTokens: count('cacheReadTokens') } : {}),
|
|
115
|
+
...(cost && Object.keys(cost).length > 0 ? { cost } : {}),
|
|
116
|
+
...(() => { const codingRuns = readRecordedBuildRowPart(bag['codingRuns']); return codingRuns ? { codingRuns } : {}; })(),
|
|
117
|
+
...(() => { const generationSteps = readRecordedBuildRowPart(bag['generationSteps']); return generationSteps ? { generationSteps } : {}; })(),
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
/** A row's `PlaybookSpend.codingRuns` or `.generationSteps` (#2232), or `undefined` for a row without one (every row before it). */
|
|
121
|
+
function readRecordedBuildRowPart(value) {
|
|
122
|
+
if (typeof value !== 'object' || value === null)
|
|
123
|
+
return undefined;
|
|
124
|
+
const bag = value;
|
|
125
|
+
const count = (key) => (typeof bag[key] === 'number' && Number.isFinite(bag[key]) && bag[key] >= 0 ? bag[key] : undefined);
|
|
126
|
+
const runs = count('runs');
|
|
127
|
+
const runsWithoutReportedCost = count('runsWithoutReportedCost');
|
|
128
|
+
if (runs === undefined || runsWithoutReportedCost === undefined)
|
|
129
|
+
return undefined;
|
|
130
|
+
const rawCost = typeof bag['cost'] === 'object' && bag['cost'] !== null ? bag['cost'] : undefined;
|
|
131
|
+
const cost = rawCost
|
|
132
|
+
? Object.fromEntries(Object.entries(rawCost).filter((entry) => typeof entry[1] === 'number' && Number.isFinite(entry[1])))
|
|
133
|
+
: undefined;
|
|
134
|
+
return {
|
|
135
|
+
runs,
|
|
136
|
+
runsWithoutReportedCost,
|
|
137
|
+
...(count('totalTokens') !== undefined ? { totalTokens: count('totalTokens') } : {}),
|
|
138
|
+
...(count('cacheReadTokens') !== undefined ? { cacheReadTokens: count('cacheReadTokens') } : {}),
|
|
114
139
|
...(cost && Object.keys(cost).length > 0 ? { cost } : {}),
|
|
115
140
|
};
|
|
116
141
|
}
|
|
@@ -158,12 +183,16 @@ function summarizeChoreographyIterations(iterations) {
|
|
|
158
183
|
return iterations.map((iteration) => ({
|
|
159
184
|
iteration: Number(iteration['iteration']),
|
|
160
185
|
eligibleRefs: strings(iteration['eligibleRefs']),
|
|
186
|
+
...(strings(iteration['withheldAsCurrent']).length > 0 ? { withheldAsCurrent: strings(iteration['withheldAsCurrent']) } : {}),
|
|
187
|
+
...(strings(iteration['deferredForFirstRun']).length > 0 ? { deferredForFirstRun: strings(iteration['deferredForFirstRun']) } : {}),
|
|
161
188
|
children: (Array.isArray(iteration['children']) ? iteration['children'] : []).map((child) => {
|
|
162
189
|
const nested = typeof child['nested'] === 'object' && child['nested'] !== null ? child['nested'] : undefined;
|
|
163
190
|
const childDuration = readDuration(child['durationMs']);
|
|
164
191
|
const childSpend = readRecordedPlaybookSpend(child['spend']);
|
|
192
|
+
const ranBecause = describeRecordedRerun(child['rerun'], child['reopenedInThisRun'] === true);
|
|
165
193
|
return {
|
|
166
194
|
playbookRef: String(child['playbookRef']),
|
|
195
|
+
...(ranBecause !== undefined ? { ranBecause } : {}),
|
|
167
196
|
landed: strings(child['landed']),
|
|
168
197
|
...(typeof child['failure'] === 'string' ? { failure: child['failure'].slice(0, CHOREOGRAPHY_FAILURE_LENGTH) } : {}),
|
|
169
198
|
...(nested && typeof nested['stoppedBecause'] === 'string' ? { lane: summarizeLane(nested) } : {}),
|
|
@@ -177,6 +206,20 @@ function summarizeChoreographyIterations(iterations) {
|
|
|
177
206
|
...(typeof iteration['sameInputStateAsIteration'] === 'number' ? { sameInputStateAsIteration: iteration['sameInputStateAsIteration'] } : {}),
|
|
178
207
|
}));
|
|
179
208
|
}
|
|
209
|
+
const RERUN_KINDS = new Set(Object.values(PlaybookRerunKind));
|
|
210
|
+
/**
|
|
211
|
+
* A child's recorded rerun verdict, as the sentence a person reads — or nothing when the value is not one the
|
|
212
|
+
* runtime writes. Crossed a JSON boundary, so the kind is checked rather than cast; the rest of the sentence is
|
|
213
|
+
* built by the runtime's own describer, so the record and the selector's prompt cannot word one verdict twice.
|
|
214
|
+
*/
|
|
215
|
+
function describeRecordedRerun(value, reopenedInThisRun) {
|
|
216
|
+
if (typeof value !== 'object' || value === null || !RERUN_KINDS.has(String(value.kind)))
|
|
217
|
+
return undefined;
|
|
218
|
+
const described = describePlaybookRerun(value);
|
|
219
|
+
if (described === undefined)
|
|
220
|
+
return undefined;
|
|
221
|
+
return reopenedInThisRun ? `RE-OPENED by a verdict in this run (it was ${described})` : described;
|
|
222
|
+
}
|
|
180
223
|
/** The rounds that began from a state an earlier round of the same run began from, in order. */
|
|
181
224
|
function roundsOverRepeatedState(rounds) {
|
|
182
225
|
return rounds.filter((round) => round.sameInputStateAsIteration !== undefined).map((round) => round.iteration);
|
|
@@ -185,15 +228,25 @@ function roundsOverRepeatedState(rounds) {
|
|
|
185
228
|
function roundsCarryMeasurement(rounds) {
|
|
186
229
|
return rounds.some((round) => round.spend !== undefined || round.children.some((child) => child.spend !== undefined));
|
|
187
230
|
}
|
|
231
|
+
/** The unoffered rows of a lane or of the root, as the record keeps them. */
|
|
232
|
+
function summarizeUnoffered(value) {
|
|
233
|
+
return (Array.isArray(value) ? value : []).map((entry) => ({
|
|
234
|
+
playbookRef: String(entry['playbookRef']),
|
|
235
|
+
reason: String(entry['reason']),
|
|
236
|
+
detail: String(entry['detail']),
|
|
237
|
+
}));
|
|
238
|
+
}
|
|
188
239
|
/** A nested lane, as its parent's record keeps it — see {@link PlaybookRunLaneSummary}. */
|
|
189
240
|
function summarizeLane(nested) {
|
|
190
241
|
const raw = Array.isArray(nested['iterations']) ? nested['iterations'] : [];
|
|
191
242
|
const rounds = summarizeChoreographyIterations(raw);
|
|
192
243
|
const repeated = roundsOverRepeatedState(rounds);
|
|
193
244
|
const resumed = nested['resumedAfterIteration'];
|
|
245
|
+
const unoffered = summarizeUnoffered(nested['unoffered']);
|
|
194
246
|
return {
|
|
195
247
|
stoppedBecause: String(nested['stoppedBecause']),
|
|
196
248
|
iterations: raw.length,
|
|
249
|
+
...(unoffered.length > 0 ? { unoffered } : {}),
|
|
197
250
|
...(roundsCarryMeasurement(rounds) ? { rounds, childTally: tallyChoreographyChildren(rounds) } : {}),
|
|
198
251
|
...(repeated.length > 0 ? { iterationsOverRepeatedState: repeated } : {}),
|
|
199
252
|
...(typeof resumed === 'number' && resumed > 0 ? { resumedAfterIteration: resumed } : {}),
|
|
@@ -211,12 +264,7 @@ function summarizeChoreography(envelope) {
|
|
|
211
264
|
* the record is what an operator comes back to. Bounded by the composite's own `admits`, and the
|
|
212
265
|
* detail is a sentence the runtime already composed — there is nothing here to truncate.
|
|
213
266
|
*/
|
|
214
|
-
const unoffered = (
|
|
215
|
-
.map((entry) => ({
|
|
216
|
-
playbookRef: String(entry['playbookRef']),
|
|
217
|
-
reason: String(entry['reason']),
|
|
218
|
-
detail: String(entry['detail']),
|
|
219
|
-
}));
|
|
267
|
+
const unoffered = summarizeUnoffered(envelope['unoffered']);
|
|
220
268
|
const summarizedIterations = summarizeChoreographyIterations(iterations);
|
|
221
269
|
const repeated = roundsOverRepeatedState(summarizedIterations);
|
|
222
270
|
const measuredAny = roundsCarryMeasurement(summarizedIterations);
|
|
@@ -292,11 +340,14 @@ export function readPlaybookRunMeasurement(taskOutput) {
|
|
|
292
340
|
function measureRounds(rounds) {
|
|
293
341
|
return rounds.map((round) => ({
|
|
294
342
|
iteration: round.iteration,
|
|
343
|
+
...(round.withheldAsCurrent ? { withheldAsCurrent: round.withheldAsCurrent } : {}),
|
|
344
|
+
...(round.deferredForFirstRun ? { deferredForFirstRun: round.deferredForFirstRun } : {}),
|
|
295
345
|
...(round.durationMs !== undefined ? { durationMs: round.durationMs } : {}),
|
|
296
346
|
...(round.spend ? { spend: round.spend } : {}),
|
|
297
347
|
...(round.sameInputStateAsIteration !== undefined ? { sameInputStateAsIteration: round.sameInputStateAsIteration } : {}),
|
|
298
348
|
children: (round.children ?? []).map((child) => ({
|
|
299
349
|
playbookRef: child.playbookRef,
|
|
350
|
+
...(child.ranBecause !== undefined ? { ranBecause: child.ranBecause } : {}),
|
|
300
351
|
failed: child.failure !== undefined,
|
|
301
352
|
landedCount: child.landed.length,
|
|
302
353
|
...(child.durationMs !== undefined ? { durationMs: child.durationMs } : {}),
|
|
@@ -422,6 +473,11 @@ export function summarizePlaybookLoopResult(result) {
|
|
|
422
473
|
* in-memory plane's rows the lane's tests drive — both are read, so the recognition is the same either way.
|
|
423
474
|
*/
|
|
424
475
|
export function projectLastPlaybookLoop(executions) {
|
|
476
|
+
return projectPlaybookLoops(executions)[0] ?? null;
|
|
477
|
+
}
|
|
478
|
+
/** EVERY unattended loop among the executions, newest first — the run report reads them all (#2231). */
|
|
479
|
+
export function projectPlaybookLoops(executions) {
|
|
480
|
+
const loops = [];
|
|
425
481
|
const newestFirst = [...executions].sort((left, right) => right.createdAt.localeCompare(left.createdAt));
|
|
426
482
|
for (const execution of newestFirst) {
|
|
427
483
|
const task = execution.standaloneTasks[0];
|
|
@@ -452,7 +508,7 @@ export function projectLastPlaybookLoop(executions) {
|
|
|
452
508
|
})) : undefined;
|
|
453
509
|
const failure = output['failure']?.message;
|
|
454
510
|
const repeated = Array.isArray(output['iterationsOverRepeatedState']) ? output['iterationsOverRepeatedState'].filter((entry) => typeof entry === 'number') : [];
|
|
455
|
-
|
|
511
|
+
loops.push({
|
|
456
512
|
runId: execution._id,
|
|
457
513
|
startedAt: execution.createdAt,
|
|
458
514
|
...(execution.finishedAt ? { finishedAt: execution.finishedAt } : {}),
|
|
@@ -463,8 +519,8 @@ export function projectLastPlaybookLoop(executions) {
|
|
|
463
519
|
...(measurement ? { measurement } : {}),
|
|
464
520
|
...(repeated.length > 0 ? { iterationsOverRepeatedState: repeated } : {}),
|
|
465
521
|
...(steps ? { steps } : {}),
|
|
466
|
-
};
|
|
522
|
+
});
|
|
467
523
|
}
|
|
468
|
-
return
|
|
524
|
+
return loops;
|
|
469
525
|
}
|
|
470
526
|
//# sourceMappingURL=playbook-run-record.models.js.map
|