@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
|
@@ -0,0 +1,365 @@
|
|
|
1
|
+
import { PlaybookSpendMeasurement, mergePlaybookSpend } from '@wildo-ai/application-creation-runtime';
|
|
2
|
+
/**
|
|
3
|
+
* THE INTERVENTION LEDGER of a creation run (#2231) — what a PERSON (or the session driving creation for
|
|
4
|
+
* one) did to keep the lane going, derived from what the lane already records.
|
|
5
|
+
*
|
|
6
|
+
* ## Why this exists
|
|
7
|
+
*
|
|
8
|
+
* A creation run recorded what the playbooks did and nothing about what a person did. On
|
|
9
|
+
* app-creation-test-004 (2026-10-01) the driving session kept the run report by hand: fifteen interventions,
|
|
10
|
+
* each restart, hand edit, manual commit, re-arm and forced answer counted from memory, the spend added up
|
|
11
|
+
* run by run. That report is the only measure of whether the next run needs a person less, and nothing in
|
|
12
|
+
* the lane could produce it. The run's own history showed the gap: `161f4f9 build-task-logo: commit what
|
|
13
|
+
* the wave left, writer unknown` is an intervention, and only its prose said so.
|
|
14
|
+
*
|
|
15
|
+
* ## Derived, not declared
|
|
16
|
+
*
|
|
17
|
+
* Every entry is computed from a record that exists for another reason, so a person is asked for nothing
|
|
18
|
+
* but the REASON (`.claude/rules/derive-before-you-ask.md`):
|
|
19
|
+
*
|
|
20
|
+
* | kind | derived from |
|
|
21
|
+
* |---|---|
|
|
22
|
+
* | a manual commit | a commit NOT authored by the companion that commits, unchanged, a file a recorded run wrote |
|
|
23
|
+
* | a hand edit | a commit not authored by the companion that changes such a file to something the run did not write, or the same change still uncommitted in the working tree |
|
|
24
|
+
* | a companion restart | a boot whose reconciliation found runs in flight (`CreationRestartRecord`, written at that boot) |
|
|
25
|
+
* | a re-arm | a person's re-arm on a build task's run row (`wildo build rearm`) |
|
|
26
|
+
* | an override | a run started past a landing the person said was wrong (`wildo build run --despite-landed`) |
|
|
27
|
+
* | a revert | a revert marker in the playbook write register (`wildo creation revert`); a forced one says so |
|
|
28
|
+
*
|
|
29
|
+
* ## What it covers, and what it cannot see
|
|
30
|
+
*
|
|
31
|
+
* - **One creation run is one application**, from its first recorded run: the same identity a defect found
|
|
32
|
+
* during it carries in its `**Creation run:** <slug>` field (#2287), so the ledger and the issues filed
|
|
33
|
+
* against the run cover the same thing. A person's later edit of a file a run wrote is still a HAND_EDIT,
|
|
34
|
+
* because a creation is never "over": an application keeps being built by its lane.
|
|
35
|
+
* - **A reverted run still owns what it wrote, until its revert.** The revert deletes the run's write record,
|
|
36
|
+
* so its marker keeps the footprint (when it ran, what it wrote): a commit of those files before the revert
|
|
37
|
+
* is still that run's, and committing the restored files afterwards is not a second intervention. Only a
|
|
38
|
+
* marker written before it carried the footprint loses that, and the report says how many (`notChecked`).
|
|
39
|
+
* - **Answers.** Answering or declining a question the lane asked is the lane working, not a person stepping in.
|
|
40
|
+
* What counts as overriding an answer is overriding a VERDICT: running a task past its landing probe.
|
|
41
|
+
*
|
|
42
|
+
* ## A record for people, not an input to the lane
|
|
43
|
+
*
|
|
44
|
+
* Nothing in the creation lane reads this, and nothing may decide from it
|
|
45
|
+
* (`.claude/rules/application-creation-directive.md`, "Records"): `wildo creation report` renders it and a
|
|
46
|
+
* person reads it. The only thing it stores is what cannot be derived, each restart (an instant no later
|
|
47
|
+
* read can recover) and each reason a person gives; both are throwaway state under `.wildo-saas/state/`.
|
|
48
|
+
*/
|
|
49
|
+
/** What kind of act an intervention was. One named source for the vocabulary. */
|
|
50
|
+
export var CreationInterventionKind;
|
|
51
|
+
(function (CreationInterventionKind) {
|
|
52
|
+
/** The companion booted with runs in flight; its reconciliation settled them interrupted. */
|
|
53
|
+
CreationInterventionKind["COMPANION_RESTART"] = "companion_restart";
|
|
54
|
+
/** A file a recorded run wrote was changed by something no recorded run is: a person, a tool, a session. */
|
|
55
|
+
CreationInterventionKind["HAND_EDIT"] = "hand_edit";
|
|
56
|
+
/** A person committed, unchanged, what a run wrote: the lane's own commit did not happen or did not cover it. */
|
|
57
|
+
CreationInterventionKind["MANUAL_COMMIT"] = "manual_commit";
|
|
58
|
+
/** A person put a build task back in the queue after a run that completed without landing. */
|
|
59
|
+
CreationInterventionKind["BUILD_TASK_REARM"] = "build_task_rearm";
|
|
60
|
+
/** A person overruled the lane's verdict: ran a task its landing probe called landed. */
|
|
61
|
+
CreationInterventionKind["VERDICT_OVERRIDE"] = "verdict_override";
|
|
62
|
+
/** A person undid a playbook run's writes. */
|
|
63
|
+
CreationInterventionKind["RUN_REVERT"] = "run_revert";
|
|
64
|
+
})(CreationInterventionKind || (CreationInterventionKind = {}));
|
|
65
|
+
/** Where an intervention's reason came from. */
|
|
66
|
+
export var CreationInterventionReasonSource;
|
|
67
|
+
(function (CreationInterventionReasonSource) {
|
|
68
|
+
/** The person stated it for this entry (`wildo creation reason`). */
|
|
69
|
+
CreationInterventionReasonSource["STATED"] = "stated";
|
|
70
|
+
/** The record the act left already carries it: a re-arm's or an override's note. */
|
|
71
|
+
CreationInterventionReasonSource["RECORDED_NOTE"] = "recorded_note";
|
|
72
|
+
/** The subject of the person's own commit: their words about it, until they state another. */
|
|
73
|
+
CreationInterventionReasonSource["COMMIT_MESSAGE"] = "commit_message";
|
|
74
|
+
})(CreationInterventionReasonSource || (CreationInterventionReasonSource = {}));
|
|
75
|
+
/** The lane name of the BUILD: every coding run of the build plan, whoever started it. */
|
|
76
|
+
export const CREATION_BUILD_LANE = 'build';
|
|
77
|
+
/** The lane name of the unattended playbook LOOP (`wildo creation loop`), whose rows name no playbook. */
|
|
78
|
+
export const CREATION_LOOP_LANE = 'unattended loop';
|
|
79
|
+
/** The lane of a playbook execution the report could not read (older than its page of rows). */
|
|
80
|
+
export const CREATION_UNRESOLVED_PLAYBOOK_LANE = 'playbook (row not read)';
|
|
81
|
+
/** The author git records for every commit the companion makes (`accepted-change-commit.companion.service.ts`). */
|
|
82
|
+
export const COMPANION_COMMIT_AUTHOR_NAME = 'Wildo development companion';
|
|
83
|
+
/**
|
|
84
|
+
* The trailers that mark a commit made through the lane's own accept door (`accepted-change-commit`'s
|
|
85
|
+
* `Wildo-Coding-Run` / `Wildo-Playbook-Run`). A person's `wildo creation accept` carries one and is still a
|
|
86
|
+
* person's commit, so it is still an intervention; the trailer only lets the summary say which door it was.
|
|
87
|
+
*/
|
|
88
|
+
export const LANE_ACCEPT_TRAILER_KEYS = ['Wildo-Coding-Run', 'Wildo-Playbook-Run'];
|
|
89
|
+
/**
|
|
90
|
+
* Whether a footprint still owns its files at a commit instant (#2231). A REVERTED run owns them until its revert.
|
|
91
|
+
*
|
|
92
|
+
* Git's commit instants (`%cI`) have no milliseconds and a revert's does, so within the revert's own second time
|
|
93
|
+
* cannot say which came first. There the CONTENT decides: a commit holding exactly the bytes the run wrote is the
|
|
94
|
+
* run's work, committed before it was undone; any other bytes (the restored pre-image) came after. Outside that
|
|
95
|
+
* second, time decides alone.
|
|
96
|
+
*/
|
|
97
|
+
function ownsAt(footprint, path, at, committedSha256) {
|
|
98
|
+
if (!footprint.files.has(path) || footprint.at > at)
|
|
99
|
+
return false;
|
|
100
|
+
if (footprint.until === undefined)
|
|
101
|
+
return true;
|
|
102
|
+
const untilTime = Date.parse(footprint.until);
|
|
103
|
+
const atTime = Date.parse(at);
|
|
104
|
+
if (!Number.isFinite(untilTime) || !Number.isFinite(atTime))
|
|
105
|
+
return at < footprint.until;
|
|
106
|
+
const revertSecond = Math.floor(untilTime / 1000) * 1000;
|
|
107
|
+
if (atTime < revertSecond)
|
|
108
|
+
return true;
|
|
109
|
+
if (atTime >= revertSecond + 1000)
|
|
110
|
+
return false;
|
|
111
|
+
return committedSha256 !== undefined && committedSha256 === footprint.files.get(path);
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* The latest run that wrote `path` and still owned it at `at`, or `undefined` when no recorded run did.
|
|
115
|
+
* `committedSha256` is the bytes the commit holds there, which settles a commit in a reverted run's last second.
|
|
116
|
+
*/
|
|
117
|
+
export function findRunOwningPathAt(path, at, footprints, committedSha256) {
|
|
118
|
+
let owner;
|
|
119
|
+
for (const footprint of footprints) {
|
|
120
|
+
if (!ownsAt(footprint, path, at, committedSha256))
|
|
121
|
+
continue;
|
|
122
|
+
if (owner === undefined || footprint.at > owner.at)
|
|
123
|
+
owner = footprint;
|
|
124
|
+
}
|
|
125
|
+
return owner;
|
|
126
|
+
}
|
|
127
|
+
const uniqueTargets = (targets) => {
|
|
128
|
+
const seen = new Map();
|
|
129
|
+
for (const target of targets)
|
|
130
|
+
seen.set(`${target.lane}\u0000${target.task ?? ''}`, target);
|
|
131
|
+
return [...seen.values()];
|
|
132
|
+
};
|
|
133
|
+
/**
|
|
134
|
+
* A commit as an intervention, or `null` when it is not one: the companion authored it, or it touched no
|
|
135
|
+
* path a run had written by then (a person's own work beside the lane is not the lane's business).
|
|
136
|
+
*
|
|
137
|
+
* MANUAL_COMMIT when every run-owned path holds exactly what its run left; HAND_EDIT as soon as one holds
|
|
138
|
+
* something else. Paths are attributed to the latest run that wrote them before the commit.
|
|
139
|
+
*/
|
|
140
|
+
export function classifyCommitAsIntervention(commit, footprints) {
|
|
141
|
+
if (commit.authorName === COMPANION_COMMIT_AUTHOR_NAME)
|
|
142
|
+
return null;
|
|
143
|
+
const owned = commit.files
|
|
144
|
+
.map((file) => ({ file, owner: findRunOwningPathAt(file.path, commit.at, footprints, file.sha256) }))
|
|
145
|
+
.filter((entry) => entry.owner !== undefined);
|
|
146
|
+
if (owned.length === 0)
|
|
147
|
+
return null;
|
|
148
|
+
const changed = owned.filter((entry) => entry.owner.files.get(entry.file.path) !== entry.file.sha256);
|
|
149
|
+
const kind = changed.length > 0 ? CreationInterventionKind.HAND_EDIT : CreationInterventionKind.MANUAL_COMMIT;
|
|
150
|
+
const throughLaneAccept = LANE_ACCEPT_TRAILER_KEYS.some((key) => new RegExp(`^${key}:`, 'm').test(commit.body));
|
|
151
|
+
const paths = (kind === CreationInterventionKind.HAND_EDIT ? changed : owned).map((entry) => entry.file.path);
|
|
152
|
+
const summary = kind === CreationInterventionKind.HAND_EDIT
|
|
153
|
+
? `a commit by ${commit.authorName} changed ${paths.length} file(s) a run had written, to content the run did not write: ${paths.join(', ')}`
|
|
154
|
+
: `${commit.authorName} committed ${paths.length} file(s) a run had written${throughLaneAccept ? ', through the lane\'s accept' : ''}: ${paths.join(', ')}`;
|
|
155
|
+
return {
|
|
156
|
+
id: `commit:${commit.sha.slice(0, 12)}`,
|
|
157
|
+
kind,
|
|
158
|
+
at: commit.at,
|
|
159
|
+
targets: uniqueTargets(owned.map((entry) => entry.owner.target)),
|
|
160
|
+
summary,
|
|
161
|
+
evidence: `commit ${commit.sha.slice(0, 12)} "${commit.subject}"`,
|
|
162
|
+
...(commit.subject.trim().length > 0 ? { reason: { text: commit.subject.trim(), source: CreationInterventionReasonSource.COMMIT_MESSAGE } } : {}),
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Hand edits not committed yet: a working-tree file a run wrote, whose bytes are neither what the run left
|
|
167
|
+
* nor what HEAD holds. Bytes equal to HEAD were committed and are judged by their commit; bytes equal to the
|
|
168
|
+
* run's are the run's own output waiting for a commit. Read only while no run is in flight, because a run
|
|
169
|
+
* in flight writes files no record yet names (the caller says so when it skips this).
|
|
170
|
+
*/
|
|
171
|
+
export function classifyWorkingTreeEdits(dirty, footprints, observedAt) {
|
|
172
|
+
const edits = [];
|
|
173
|
+
for (const file of dirty) {
|
|
174
|
+
const owner = findRunOwningPathAt(file.path, observedAt, footprints);
|
|
175
|
+
if (owner === undefined)
|
|
176
|
+
continue;
|
|
177
|
+
if (file.sha256 === owner.files.get(file.path) || file.sha256 === file.headSha256)
|
|
178
|
+
continue;
|
|
179
|
+
edits.push({
|
|
180
|
+
id: `edit:${file.path}@${(file.sha256 ?? 'deleted').slice(0, 12)}`,
|
|
181
|
+
kind: CreationInterventionKind.HAND_EDIT,
|
|
182
|
+
at: observedAt,
|
|
183
|
+
targets: [owner.target],
|
|
184
|
+
summary: `${file.path}, which a run wrote, holds uncommitted content no recorded run wrote`,
|
|
185
|
+
evidence: `working tree, observed ${observedAt}`,
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
return edits;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Re-arms and overrides off the build's run rows. A re-arm whose reason is not one a PERSON may give is
|
|
192
|
+
* the wave's own (it re-runs a task a sibling interfered with) and is not counted: nobody intervened.
|
|
193
|
+
*/
|
|
194
|
+
export function deriveBuildAttemptInterventions(attempts, personRearmReasons) {
|
|
195
|
+
const interventions = [];
|
|
196
|
+
for (const attempt of attempts) {
|
|
197
|
+
const target = { lane: CREATION_BUILD_LANE, task: attempt.taskRef };
|
|
198
|
+
if (attempt.rearm && personRearmReasons.includes(attempt.rearm.reason)) {
|
|
199
|
+
interventions.push({
|
|
200
|
+
id: `rearm:${attempt.runTaskId}`,
|
|
201
|
+
kind: CreationInterventionKind.BUILD_TASK_REARM,
|
|
202
|
+
at: attempt.rearm.rearmedAt,
|
|
203
|
+
targets: [target],
|
|
204
|
+
summary: `${attempt.taskRef} re-armed after its run of ${attempt.startedAt} (${attempt.rearm.reason})`,
|
|
205
|
+
evidence: `run row ${attempt.runTaskId}`,
|
|
206
|
+
reason: { text: attempt.rearm.note, source: CreationInterventionReasonSource.RECORDED_NOTE },
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
if (attempt.landedOverride) {
|
|
210
|
+
interventions.push({
|
|
211
|
+
id: `override:${attempt.runTaskId}`,
|
|
212
|
+
kind: CreationInterventionKind.VERDICT_OVERRIDE,
|
|
213
|
+
at: attempt.startedAt,
|
|
214
|
+
targets: [target],
|
|
215
|
+
summary: `${attempt.taskRef} run although its landing probe called it landed (${attempt.landedOverride.reason})`,
|
|
216
|
+
evidence: `run row ${attempt.runTaskId}`,
|
|
217
|
+
reason: { text: attempt.landedOverride.note, source: CreationInterventionReasonSource.RECORDED_NOTE },
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
return interventions;
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Each revert, once. A FORCED revert (over files edited since the run) is still one act, so it is one
|
|
225
|
+
* entry that says it was forced, never a revert and an override counted twice.
|
|
226
|
+
*/
|
|
227
|
+
export function deriveRevertInterventions(reverts) {
|
|
228
|
+
return reverts.map((revert) => ({
|
|
229
|
+
id: `revert:${revert.markerId}`,
|
|
230
|
+
kind: CreationInterventionKind.RUN_REVERT,
|
|
231
|
+
at: revert.at,
|
|
232
|
+
targets: [{ lane: revert.playbookRef, task: revert.runId }],
|
|
233
|
+
summary: `${revert.paths.length} file(s) of ${revert.playbookRef} run ${revert.runId} reverted${revert.forced ? ', forced over edits made since the run' : ''}`,
|
|
234
|
+
evidence: `revert marker ${revert.markerId}`,
|
|
235
|
+
}));
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* A restart as an intervention. Its targets are resolved through what the reader knows: a coding run's task
|
|
239
|
+
* id to its build task, a playbook execution to its playbook (or the loop). A composite's child interrupted
|
|
240
|
+
* with its root is the root's work, so it is folded into the root, and the summary counts RUNS, not rows. An
|
|
241
|
+
* id nothing resolves still counts, under {@link CREATION_UNRESOLVED_PLAYBOOK_LANE}, because the restart did
|
|
242
|
+
* interrupt it.
|
|
243
|
+
*/
|
|
244
|
+
export function deriveRestartIntervention(restart, resolve) {
|
|
245
|
+
const coding = restart.codingTaskIds.map((taskId) => ({ lane: CREATION_BUILD_LANE, ...(resolve.codingTaskRef(taskId) ? { task: resolve.codingTaskRef(taskId) } : {}) }));
|
|
246
|
+
const generation = restart.generationExecutionIds.map(() => ({ lane: CREATION_BUILD_LANE }));
|
|
247
|
+
const interrupted = new Set(restart.playbookExecutionIds);
|
|
248
|
+
const playbookRuns = restart.playbookExecutionIds
|
|
249
|
+
.map((executionId) => ({ executionId, known: resolve.playbookExecution(executionId) }))
|
|
250
|
+
// A child whose root was interrupted too is that root's work, not a run of its own.
|
|
251
|
+
.filter(({ known }) => known?.rootRunId === undefined || !interrupted.has(known.rootRunId));
|
|
252
|
+
const playbooks = playbookRuns.map(({ executionId, known }) => ({ lane: known?.lane ?? CREATION_UNRESOLVED_PLAYBOOK_LANE, task: executionId }));
|
|
253
|
+
const runs = restart.codingTaskIds.length + playbookRuns.length + restart.generationExecutionIds.length;
|
|
254
|
+
return {
|
|
255
|
+
id: `restart:${restart.bootAt}`,
|
|
256
|
+
kind: CreationInterventionKind.COMPANION_RESTART,
|
|
257
|
+
at: restart.bootAt,
|
|
258
|
+
targets: uniqueTargets([...coding, ...generation, ...playbooks]),
|
|
259
|
+
summary: `the companion restarted with ${runs} run(s) in flight: ${restart.codingTaskIds.length} coding, `
|
|
260
|
+
+ `${playbookRuns.length} playbook or loop, ${restart.generationExecutionIds.length} generation step(s)`,
|
|
261
|
+
evidence: `restart record ${restart.bootAt}`,
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
/** A person's stated reason, keyed by intervention id. A stated reason replaces a derived one. */
|
|
265
|
+
export function applyStatedReasons(interventions, stated) {
|
|
266
|
+
return interventions.map((intervention) => {
|
|
267
|
+
const reason = stated[intervention.id];
|
|
268
|
+
return reason ? { ...intervention, reason: { text: reason.reason, source: CreationInterventionReasonSource.STATED } } : intervention;
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* The INDEPENDENCE SCORE (#2231): interventions per lane, and per landed unit. Lower is more independent; 0
|
|
273
|
+
* means nobody stepped in. A lane with interventions and no landing has no ratio — `null`, never infinity
|
|
274
|
+
* and never zero — and says so beside its count.
|
|
275
|
+
*
|
|
276
|
+
* A landed unit is a build task the plan reads LANDED or a playbook run that landed files. An intervention
|
|
277
|
+
* that unblocked two lanes is counted once in each lane and once in the total.
|
|
278
|
+
*/
|
|
279
|
+
export function deriveIndependenceScore(interventions, landedByLane) {
|
|
280
|
+
const counts = new Map();
|
|
281
|
+
for (const intervention of interventions) {
|
|
282
|
+
for (const lane of new Set(intervention.targets.map((target) => target.lane)))
|
|
283
|
+
counts.set(lane, (counts.get(lane) ?? 0) + 1);
|
|
284
|
+
}
|
|
285
|
+
const lanes = new Set([...counts.keys(), ...landedByLane.keys()]);
|
|
286
|
+
const ratio = (numerator, denominator) => (denominator > 0 ? Math.round((numerator / denominator) * 100) / 100 : numerator === 0 ? 0 : null);
|
|
287
|
+
const byLane = [...lanes]
|
|
288
|
+
.map((lane) => ({ lane, interventions: counts.get(lane) ?? 0, landed: landedByLane.get(lane) ?? 0 }))
|
|
289
|
+
.map((entry) => ({ ...entry, interventionsPerLanding: ratio(entry.interventions, entry.landed) }))
|
|
290
|
+
.sort((left, right) => right.interventions - left.interventions || left.lane.localeCompare(right.lane));
|
|
291
|
+
const landedUnits = [...landedByLane.values()].reduce((sum, count) => sum + count, 0);
|
|
292
|
+
return { interventions: interventions.length, landedUnits, interventionsPerLandedUnit: ratio(interventions.length, landedUnits), byLane };
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* The journey's spend, counted ONCE (#2232, #2231).
|
|
296
|
+
*
|
|
297
|
+
* Root playbook runs + coding runs + generation steps + loop selections, less the coding runs and generation
|
|
298
|
+
* steps a playbook run's own figure already contains (`PlaybookSpend.codingRuns` / `.generationSteps`), because
|
|
299
|
+
* each of those is also on its build task's row.
|
|
300
|
+
*
|
|
301
|
+
* A root row that reported a cost and no coding part was recorded before #2232 counted that part. If coding
|
|
302
|
+
* runs started inside its window, the total may count them twice; the number of such runs is returned rather
|
|
303
|
+
* than guessed away, because a coding run started by a person while an unrelated lane ran is in that window
|
|
304
|
+
* too, and subtracting it would undercount.
|
|
305
|
+
*/
|
|
306
|
+
export function deriveJourneySpend(input) {
|
|
307
|
+
const cost = {};
|
|
308
|
+
const add = (currency, amount) => { cost[currency] = Math.round(((cost[currency] ?? 0) + amount) * 1e6) / 1e6; };
|
|
309
|
+
const playbookSpends = input.playbookRuns.flatMap((run) => (run.spend ? [run.spend] : []));
|
|
310
|
+
const merged = mergePlaybookSpend(playbookSpends);
|
|
311
|
+
for (const [currency, amount] of Object.entries(merged.cost ?? {}))
|
|
312
|
+
add(currency, amount);
|
|
313
|
+
for (const [currency, amount] of Object.entries(merged.codingRuns?.cost ?? {}))
|
|
314
|
+
add(currency, -amount);
|
|
315
|
+
// A generation step inside a playbook run is in its figure AND on its own row: counted once, from the row.
|
|
316
|
+
for (const [currency, amount] of Object.entries(merged.generationSteps?.cost ?? {}))
|
|
317
|
+
add(currency, -amount);
|
|
318
|
+
let generationStepsWithoutRecordedSpend = 0;
|
|
319
|
+
let generationTokens;
|
|
320
|
+
for (const step of input.generationSteps) {
|
|
321
|
+
// A step no meter observed recorded nothing either: a floor, never a free step.
|
|
322
|
+
if (!step.spend || step.spend.measurement === PlaybookSpendMeasurement.NOT_OBSERVED) {
|
|
323
|
+
if (step.settledAt !== undefined)
|
|
324
|
+
generationStepsWithoutRecordedSpend += 1;
|
|
325
|
+
continue;
|
|
326
|
+
}
|
|
327
|
+
for (const [currency, amount] of Object.entries(step.spend.cost ?? {}))
|
|
328
|
+
add(currency, amount);
|
|
329
|
+
if (step.spend.totalTokens !== undefined)
|
|
330
|
+
generationTokens = (generationTokens ?? 0) + step.spend.totalTokens;
|
|
331
|
+
}
|
|
332
|
+
for (const loop of input.loopSelections)
|
|
333
|
+
for (const [currency, amount] of Object.entries(loop.cost ?? {}))
|
|
334
|
+
add(currency, amount);
|
|
335
|
+
let codingRunsWithoutReportedCost = 0;
|
|
336
|
+
let codingTokens;
|
|
337
|
+
for (const run of input.codingRuns) {
|
|
338
|
+
if (run.cost)
|
|
339
|
+
add(run.cost.currency, run.cost.amount);
|
|
340
|
+
else if (run.settledAt !== undefined)
|
|
341
|
+
codingRunsWithoutReportedCost += 1;
|
|
342
|
+
if (run.tokens?.totalTokens !== undefined)
|
|
343
|
+
codingTokens = (codingTokens ?? 0) + run.tokens.totalTokens;
|
|
344
|
+
}
|
|
345
|
+
const playbookTokens = merged.totalTokens !== undefined
|
|
346
|
+
? merged.totalTokens - (merged.codingRuns?.totalTokens ?? 0) - (merged.generationSteps?.totalTokens ?? 0)
|
|
347
|
+
: undefined;
|
|
348
|
+
const totalTokens = codingTokens === undefined && playbookTokens === undefined && generationTokens === undefined
|
|
349
|
+
? undefined
|
|
350
|
+
: (codingTokens ?? 0) + (playbookTokens ?? 0) + (generationTokens ?? 0);
|
|
351
|
+
const unpartedWindows = input.playbookRuns
|
|
352
|
+
.filter((run) => run.spend?.cost !== undefined && run.spend.codingRuns === undefined)
|
|
353
|
+
.map((run) => ({ from: run.startedAt, to: run.finishedAt ?? '' }));
|
|
354
|
+
const codingRunsPossiblyCountedTwice = input.codingRuns.filter((run) => run.cost !== undefined
|
|
355
|
+
&& unpartedWindows.some((window) => run.startedAt >= window.from && run.startedAt <= window.to)).length;
|
|
356
|
+
return {
|
|
357
|
+
cost: Object.fromEntries(Object.entries(cost).map(([currency, amount]) => [currency, Math.round(amount * 100) / 100])),
|
|
358
|
+
...(totalTokens !== undefined ? { totalTokens } : {}),
|
|
359
|
+
codingRunsWithoutReportedCost,
|
|
360
|
+
playbookRunsWithoutSpend: input.playbookRuns.filter((run) => run.spend === undefined).length,
|
|
361
|
+
generationStepsWithoutRecordedSpend,
|
|
362
|
+
codingRunsPossiblyCountedTwice,
|
|
363
|
+
};
|
|
364
|
+
}
|
|
365
|
+
//# sourceMappingURL=creation-intervention.models.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"creation-intervention.models.js","sourceRoot":"","sources":["../../../../../src/meta-workflows/models/creation-intervention.models.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,kBAAkB,EAAsB,MAAM,wCAAwC,CAAC;AAE1H;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AAEH,iFAAiF;AACjF,MAAM,CAAN,IAAY,wBAaX;AAbD,WAAY,wBAAwB;IAClC,6FAA6F;IAC7F,mEAAuC,CAAA;IACvC,4GAA4G;IAC5G,mDAAuB,CAAA;IACvB,iHAAiH;IACjH,2DAA+B,CAAA;IAC/B,8FAA8F;IAC9F,iEAAqC,CAAA;IACrC,yFAAyF;IACzF,iEAAqC,CAAA;IACrC,8CAA8C;IAC9C,qDAAyB,CAAA;AAC3B,CAAC,EAbW,wBAAwB,KAAxB,wBAAwB,QAanC;AAED,gDAAgD;AAChD,MAAM,CAAN,IAAY,gCAOX;AAPD,WAAY,gCAAgC;IAC1C,qEAAqE;IACrE,qDAAiB,CAAA;IACjB,oFAAoF;IACpF,mEAA+B,CAAA;IAC/B,8FAA8F;IAC9F,qEAAiC,CAAA;AACnC,CAAC,EAPW,gCAAgC,KAAhC,gCAAgC,QAO3C;AAED,0FAA0F;AAC1F,MAAM,CAAC,MAAM,mBAAmB,GAAG,OAAO,CAAC;AAE3C,0GAA0G;AAC1G,MAAM,CAAC,MAAM,kBAAkB,GAAG,iBAAiB,CAAC;AAEpD,gGAAgG;AAChG,MAAM,CAAC,MAAM,iCAAiC,GAAG,yBAAyB,CAAC;AAoC3E,mHAAmH;AACnH,MAAM,CAAC,MAAM,4BAA4B,GAAG,6BAA6B,CAAC;AAE1E;;;;GAIG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAsB,CAAC,kBAAkB,EAAE,oBAAoB,CAAC,CAAC;AActG;;;;;;;GAOG;AACH,SAAS,MAAM,CAAC,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I,CAAC,KAAK,CAAC,MAAM,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;QACtH,GAAG,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACrD,6BAA6B;QAC7B,wBAAwB,EAAE,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,MAAM;QAC5F,mCAAmC;QACnC,8BAA8B;KAC/B,CAAC;AACJ,CAAC","sourcesContent":["import { PlaybookSpendMeasurement, mergePlaybookSpend, type PlaybookSpend } from '@wildo-ai/application-creation-runtime';\n\n/**\n * THE INTERVENTION LEDGER of a creation run (#2231) — what a PERSON (or the session driving creation for\n * one) did to keep the lane going, derived from what the lane already records.\n *\n * ## Why this exists\n *\n * A creation run recorded what the playbooks did and nothing about what a person did. On\n * app-creation-test-004 (2026-10-01) the driving session kept the run report by hand: fifteen interventions,\n * each restart, hand edit, manual commit, re-arm and forced answer counted from memory, the spend added up\n * run by run. That report is the only measure of whether the next run needs a person less, and nothing in\n * the lane could produce it. The run's own history showed the gap: `161f4f9 build-task-logo: commit what\n * the wave left, writer unknown` is an intervention, and only its prose said so.\n *\n * ## Derived, not declared\n *\n * Every entry is computed from a record that exists for another reason, so a person is asked for nothing\n * but the REASON (`.claude/rules/derive-before-you-ask.md`):\n *\n * | kind | derived from |\n * |---|---|\n * | a manual commit | a commit NOT authored by the companion that commits, unchanged, a file a recorded run wrote |\n * | a hand edit | a commit not authored by the companion that changes such a file to something the run did not write, or the same change still uncommitted in the working tree |\n * | a companion restart | a boot whose reconciliation found runs in flight (`CreationRestartRecord`, written at that boot) |\n * | a re-arm | a person's re-arm on a build task's run row (`wildo build rearm`) |\n * | an override | a run started past a landing the person said was wrong (`wildo build run --despite-landed`) |\n * | a revert | a revert marker in the playbook write register (`wildo creation revert`); a forced one says so |\n *\n * ## What it covers, and what it cannot see\n *\n * - **One creation run is one application**, from its first recorded run: the same identity a defect found\n * during it carries in its `**Creation run:** <slug>` field (#2287), so the ledger and the issues filed\n * against the run cover the same thing. A person's later edit of a file a run wrote is still a HAND_EDIT,\n * because a creation is never \"over\": an application keeps being built by its lane.\n * - **A reverted run still owns what it wrote, until its revert.** The revert deletes the run's write record,\n * so its marker keeps the footprint (when it ran, what it wrote): a commit of those files before the revert\n * is still that run's, and committing the restored files afterwards is not a second intervention. Only a\n * marker written before it carried the footprint loses that, and the report says how many (`notChecked`).\n * - **Answers.** Answering or declining a question the lane asked is the lane working, not a person stepping in.\n * What counts as overriding an answer is overriding a VERDICT: running a task past its landing probe.\n *\n * ## A record for people, not an input to the lane\n *\n * Nothing in the creation lane reads this, and nothing may decide from it\n * (`.claude/rules/application-creation-directive.md`, \"Records\"): `wildo creation report` renders it and a\n * person reads it. The only thing it stores is what cannot be derived, each restart (an instant no later\n * read can recover) and each reason a person gives; both are throwaway state under `.wildo-saas/state/`.\n */\n\n/** What kind of act an intervention was. One named source for the vocabulary. */\nexport enum CreationInterventionKind {\n /** The companion booted with runs in flight; its reconciliation settled them interrupted. */\n COMPANION_RESTART = 'companion_restart',\n /** A file a recorded run wrote was changed by something no recorded run is: a person, a tool, a session. */\n HAND_EDIT = 'hand_edit',\n /** A person committed, unchanged, what a run wrote: the lane's own commit did not happen or did not cover it. */\n MANUAL_COMMIT = 'manual_commit',\n /** A person put a build task back in the queue after a run that completed without landing. */\n BUILD_TASK_REARM = 'build_task_rearm',\n /** A person overruled the lane's verdict: ran a task its landing probe called landed. */\n VERDICT_OVERRIDE = 'verdict_override',\n /** A person undid a playbook run's writes. */\n RUN_REVERT = 'run_revert',\n}\n\n/** Where an intervention's reason came from. */\nexport enum CreationInterventionReasonSource {\n /** The person stated it for this entry (`wildo creation reason`). */\n STATED = 'stated',\n /** The record the act left already carries it: a re-arm's or an override's note. */\n RECORDED_NOTE = 'recorded_note',\n /** The subject of the person's own commit: their words about it, until they state another. */\n COMMIT_MESSAGE = 'commit_message',\n}\n\n/** The lane name of the BUILD: every coding run of the build plan, whoever started it. */\nexport const CREATION_BUILD_LANE = 'build';\n\n/** The lane name of the unattended playbook LOOP (`wildo creation loop`), whose rows name no playbook. */\nexport const CREATION_LOOP_LANE = 'unattended loop';\n\n/** The lane of a playbook execution the report could not read (older than its page of rows). */\nexport const CREATION_UNRESOLVED_PLAYBOOK_LANE = 'playbook (row not read)';\n\n/** What an intervention unblocked: a lane (a playbook ref, or {@link CREATION_BUILD_LANE}) and, when known, its task. */\nexport interface CreationInterventionTarget {\n readonly lane: string;\n /** The build task's ref, or the playbook run's id. Absent when the record names no task. */\n readonly task?: string;\n}\n\nexport interface CreationIntervention {\n /** Stable across reads: `<kind>:<the record it was derived from>`. What `wildo creation reason` names. */\n readonly id: string;\n readonly kind: CreationInterventionKind;\n /** When it happened, ISO-8601. */\n readonly at: string;\n /** What it unblocked. Never empty: an act on nothing a run owns is no intervention in a creation run. */\n readonly targets: readonly CreationInterventionTarget[];\n /** What happened, in one line. */\n readonly summary: string;\n /** What it was derived from — a commit, a run row, a record — so a reader can check it. */\n readonly evidence: string;\n readonly reason?: { readonly text: string; readonly source: CreationInterventionReasonSource };\n}\n\n/** What one recorded run wrote: its lane and task, when it wrote, and each path's bytes after it (sha256; `null` = deleted). */\nexport interface CreationRunFootprint {\n readonly target: CreationInterventionTarget;\n readonly at: string;\n readonly files: ReadonlyMap<string, string | null>;\n /**\n * When the run stopped owning its files: a REVERTED run owns what it wrote until the revert, and no longer.\n * Without it, committing the restored files would read as a hand edit of a run that was already undone.\n */\n readonly until?: string;\n}\n\n/** The author git records for every commit the companion makes (`accepted-change-commit.companion.service.ts`). */\nexport const COMPANION_COMMIT_AUTHOR_NAME = 'Wildo development companion';\n\n/**\n * The trailers that mark a commit made through the lane's own accept door (`accepted-change-commit`'s\n * `Wildo-Coding-Run` / `Wildo-Playbook-Run`). A person's `wildo creation accept` carries one and is still a\n * person's commit, so it is still an intervention; the trailer only lets the summary say which door it was.\n */\nexport const LANE_ACCEPT_TRAILER_KEYS: readonly string[] = ['Wildo-Coding-Run', 'Wildo-Playbook-Run'];\n\n/** A commit, with the content of the run-owned paths it touched. */\nexport interface CreationCommitObservation {\n readonly sha: string;\n /** Committer date, ISO-8601: when it entered history. */\n readonly at: string;\n readonly authorName: string;\n readonly subject: string;\n readonly body: string;\n /** Each path it changed with its committed bytes' sha256 (`null` = deleted). Only paths a run owned need a hash. */\n readonly files: readonly { readonly path: string; readonly sha256: string | null }[];\n}\n\n/**\n * Whether a footprint still owns its files at a commit instant (#2231). A REVERTED run owns them until its revert.\n *\n * Git's commit instants (`%cI`) have no milliseconds and a revert's does, so within the revert's own second time\n * cannot say which came first. There the CONTENT decides: a commit holding exactly the bytes the run wrote is the\n * run's work, committed before it was undone; any other bytes (the restored pre-image) came after. Outside that\n * second, time decides alone.\n */\nfunction ownsAt(footprint: CreationRunFootprint, path: string, at: string, committedSha256: string | null | undefined): boolean {\n if (!footprint.files.has(path) || footprint.at > at) return false;\n if (footprint.until === undefined) return true;\n const untilTime = Date.parse(footprint.until);\n const atTime = Date.parse(at);\n if (!Number.isFinite(untilTime) || !Number.isFinite(atTime)) return at < footprint.until;\n const revertSecond = Math.floor(untilTime / 1000) * 1000;\n if (atTime < revertSecond) return true;\n if (atTime >= revertSecond + 1000) return false;\n return committedSha256 !== undefined && committedSha256 === footprint.files.get(path);\n}\n\n/**\n * The latest run that wrote `path` and still owned it at `at`, or `undefined` when no recorded run did.\n * `committedSha256` is the bytes the commit holds there, which settles a commit in a reverted run's last second.\n */\nexport function findRunOwningPathAt(\n path: string,\n at: string,\n footprints: readonly CreationRunFootprint[],\n committedSha256?: string | null,\n): CreationRunFootprint | undefined {\n let owner: CreationRunFootprint | undefined;\n for (const footprint of footprints) {\n if (!ownsAt(footprint, path, at, committedSha256)) continue;\n if (owner === undefined || footprint.at > owner.at) owner = footprint;\n }\n return owner;\n}\n\nconst uniqueTargets = (targets: readonly CreationInterventionTarget[]): CreationInterventionTarget[] => {\n const seen = new Map<string, CreationInterventionTarget>();\n for (const target of targets) seen.set(`${target.lane}\\u0000${target.task ?? ''}`, target);\n return [...seen.values()];\n};\n\n/**\n * A commit as an intervention, or `null` when it is not one: the companion authored it, or it touched no\n * path a run had written by then (a person's own work beside the lane is not the lane's business).\n *\n * MANUAL_COMMIT when every run-owned path holds exactly what its run left; HAND_EDIT as soon as one holds\n * something else. Paths are attributed to the latest run that wrote them before the commit.\n */\nexport function classifyCommitAsIntervention(commit: CreationCommitObservation, footprints: readonly CreationRunFootprint[]): CreationIntervention | null {\n if (commit.authorName === COMPANION_COMMIT_AUTHOR_NAME) return null;\n const owned = commit.files\n .map((file) => ({ file, owner: findRunOwningPathAt(file.path, commit.at, footprints, file.sha256) }))\n .filter((entry): entry is { file: (typeof commit.files)[number]; owner: CreationRunFootprint } => entry.owner !== undefined);\n if (owned.length === 0) return null;\n const changed = owned.filter((entry) => entry.owner.files.get(entry.file.path) !== entry.file.sha256);\n const kind = changed.length > 0 ? CreationInterventionKind.HAND_EDIT : CreationInterventionKind.MANUAL_COMMIT;\n const throughLaneAccept = LANE_ACCEPT_TRAILER_KEYS.some((key) => new RegExp(`^${key}:`, 'm').test(commit.body));\n const paths = (kind === CreationInterventionKind.HAND_EDIT ? changed : owned).map((entry) => entry.file.path);\n const summary = kind === CreationInterventionKind.HAND_EDIT\n ? `a commit by ${commit.authorName} changed ${paths.length} file(s) a run had written, to content the run did not write: ${paths.join(', ')}`\n : `${commit.authorName} committed ${paths.length} file(s) a run had written${throughLaneAccept ? ', through the lane\\'s accept' : ''}: ${paths.join(', ')}`;\n return {\n id: `commit:${commit.sha.slice(0, 12)}`,\n kind,\n at: commit.at,\n targets: uniqueTargets(owned.map((entry) => entry.owner.target)),\n summary,\n evidence: `commit ${commit.sha.slice(0, 12)} \"${commit.subject}\"`,\n ...(commit.subject.trim().length > 0 ? { reason: { text: commit.subject.trim(), source: CreationInterventionReasonSource.COMMIT_MESSAGE } } : {}),\n };\n}\n\n/**\n * Hand edits not committed yet: a working-tree file a run wrote, whose bytes are neither what the run left\n * nor what HEAD holds. Bytes equal to HEAD were committed and are judged by their commit; bytes equal to the\n * run's are the run's own output waiting for a commit. Read only while no run is in flight, because a run\n * in flight writes files no record yet names (the caller says so when it skips this).\n */\nexport function classifyWorkingTreeEdits(\n dirty: readonly { readonly path: string; readonly sha256: string | null; readonly headSha256: string | null }[],\n footprints: readonly CreationRunFootprint[],\n observedAt: string,\n): CreationIntervention[] {\n const edits: CreationIntervention[] = [];\n for (const file of dirty) {\n const owner = findRunOwningPathAt(file.path, observedAt, footprints);\n if (owner === undefined) continue;\n if (file.sha256 === owner.files.get(file.path) || file.sha256 === file.headSha256) continue;\n edits.push({\n id: `edit:${file.path}@${(file.sha256 ?? 'deleted').slice(0, 12)}`,\n kind: CreationInterventionKind.HAND_EDIT,\n at: observedAt,\n targets: [owner.target],\n summary: `${file.path}, which a run wrote, holds uncommitted content no recorded run wrote`,\n evidence: `working tree, observed ${observedAt}`,\n });\n }\n return edits;\n}\n\n/** A build task's run row, as far as interventions read it. */\nexport interface CreationBuildAttemptObservation {\n readonly taskRef: string;\n readonly runTaskId: string;\n readonly startedAt: string;\n readonly rearm?: { readonly reason: string; readonly note: string; readonly rearmedAt: string };\n readonly landedOverride?: { readonly reason: string; readonly note: string };\n}\n\n/**\n * Re-arms and overrides off the build's run rows. A re-arm whose reason is not one a PERSON may give is\n * the wave's own (it re-runs a task a sibling interfered with) and is not counted: nobody intervened.\n */\nexport function deriveBuildAttemptInterventions(\n attempts: readonly CreationBuildAttemptObservation[],\n personRearmReasons: readonly string[],\n): CreationIntervention[] {\n const interventions: CreationIntervention[] = [];\n for (const attempt of attempts) {\n const target = { lane: CREATION_BUILD_LANE, task: attempt.taskRef };\n if (attempt.rearm && personRearmReasons.includes(attempt.rearm.reason)) {\n interventions.push({\n id: `rearm:${attempt.runTaskId}`,\n kind: CreationInterventionKind.BUILD_TASK_REARM,\n at: attempt.rearm.rearmedAt,\n targets: [target],\n summary: `${attempt.taskRef} re-armed after its run of ${attempt.startedAt} (${attempt.rearm.reason})`,\n evidence: `run row ${attempt.runTaskId}`,\n reason: { text: attempt.rearm.note, source: CreationInterventionReasonSource.RECORDED_NOTE },\n });\n }\n if (attempt.landedOverride) {\n interventions.push({\n id: `override:${attempt.runTaskId}`,\n kind: CreationInterventionKind.VERDICT_OVERRIDE,\n at: attempt.startedAt,\n targets: [target],\n summary: `${attempt.taskRef} run although its landing probe called it landed (${attempt.landedOverride.reason})`,\n evidence: `run row ${attempt.runTaskId}`,\n reason: { text: attempt.landedOverride.note, source: CreationInterventionReasonSource.RECORDED_NOTE },\n });\n }\n }\n return interventions;\n}\n\n/** A revert marker of the playbook write register. */\nexport interface CreationRevertObservation {\n /** The marker's own name: one per revert, never per run. */\n readonly markerId: string;\n readonly runId: string;\n readonly playbookRef: string;\n readonly at: string;\n readonly paths: readonly string[];\n readonly forced: boolean;\n}\n\n/**\n * Each revert, once. A FORCED revert (over files edited since the run) is still one act, so it is one\n * entry that says it was forced, never a revert and an override counted twice.\n */\nexport function deriveRevertInterventions(reverts: readonly CreationRevertObservation[]): CreationIntervention[] {\n return reverts.map((revert) => ({\n id: `revert:${revert.markerId}`,\n kind: CreationInterventionKind.RUN_REVERT,\n at: revert.at,\n targets: [{ lane: revert.playbookRef, task: revert.runId }],\n summary: `${revert.paths.length} file(s) of ${revert.playbookRef} run ${revert.runId} reverted${revert.forced ? ', forced over edits made since the run' : ''}`,\n evidence: `revert marker ${revert.markerId}`,\n }));\n}\n\n/** What a boot found in flight, as `CreationInterventionLedgerCompanionService.recordRestart` wrote it. */\nexport interface CreationRestartRecord {\n readonly bootAt: string;\n readonly codingTaskIds: readonly string[];\n readonly playbookExecutionIds: readonly string[];\n readonly generationExecutionIds: readonly string[];\n}\n\n/** What the report knows of one meta-workflows execution a restart interrupted. */\nexport interface CreationInterruptedPlaybookExecution {\n /** The playbook it ran, or {@link CREATION_LOOP_LANE} for the unattended loop. */\n readonly lane: string;\n /** Set on a composite's CHILD: the root run whose tree it belongs to. */\n readonly rootRunId?: string;\n}\n\n/**\n * A restart as an intervention. Its targets are resolved through what the reader knows: a coding run's task\n * id to its build task, a playbook execution to its playbook (or the loop). A composite's child interrupted\n * with its root is the root's work, so it is folded into the root, and the summary counts RUNS, not rows. An\n * id nothing resolves still counts, under {@link CREATION_UNRESOLVED_PLAYBOOK_LANE}, because the restart did\n * interrupt it.\n */\nexport function deriveRestartIntervention(\n restart: CreationRestartRecord,\n resolve: {\n readonly codingTaskRef: (taskId: string) => string | undefined;\n readonly playbookExecution: (executionId: string) => CreationInterruptedPlaybookExecution | undefined;\n },\n): CreationIntervention {\n const coding = restart.codingTaskIds.map((taskId) => ({ lane: CREATION_BUILD_LANE, ...(resolve.codingTaskRef(taskId) ? { task: resolve.codingTaskRef(taskId)! } : {}) }));\n const generation = restart.generationExecutionIds.map(() => ({ lane: CREATION_BUILD_LANE }));\n const interrupted = new Set(restart.playbookExecutionIds);\n const playbookRuns = restart.playbookExecutionIds\n .map((executionId) => ({ executionId, known: resolve.playbookExecution(executionId) }))\n // A child whose root was interrupted too is that root's work, not a run of its own.\n .filter(({ known }) => known?.rootRunId === undefined || !interrupted.has(known.rootRunId));\n const playbooks = playbookRuns.map(({ executionId, known }) => ({ lane: known?.lane ?? CREATION_UNRESOLVED_PLAYBOOK_LANE, task: executionId }));\n const runs = restart.codingTaskIds.length + playbookRuns.length + restart.generationExecutionIds.length;\n return {\n id: `restart:${restart.bootAt}`,\n kind: CreationInterventionKind.COMPANION_RESTART,\n at: restart.bootAt,\n targets: uniqueTargets([...coding, ...generation, ...playbooks]),\n summary: `the companion restarted with ${runs} run(s) in flight: ${restart.codingTaskIds.length} coding, `\n + `${playbookRuns.length} playbook or loop, ${restart.generationExecutionIds.length} generation step(s)`,\n evidence: `restart record ${restart.bootAt}`,\n };\n}\n\n/** A person's stated reason, keyed by intervention id. A stated reason replaces a derived one. */\nexport function applyStatedReasons(\n interventions: readonly CreationIntervention[],\n stated: Readonly<Record<string, { readonly reason: string }>>,\n): CreationIntervention[] {\n return interventions.map((intervention) => {\n const reason = stated[intervention.id];\n return reason ? { ...intervention, reason: { text: reason.reason, source: CreationInterventionReasonSource.STATED } } : intervention;\n });\n}\n\n/**\n * The INDEPENDENCE SCORE (#2231): interventions per lane, and per landed unit. Lower is more independent; 0\n * means nobody stepped in. A lane with interventions and no landing has no ratio — `null`, never infinity\n * and never zero — and says so beside its count.\n *\n * A landed unit is a build task the plan reads LANDED or a playbook run that landed files. An intervention\n * that unblocked two lanes is counted once in each lane and once in the total.\n */\nexport function deriveIndependenceScore(\n interventions: readonly CreationIntervention[],\n landedByLane: ReadonlyMap<string, number>,\n): {\n readonly interventions: number;\n readonly landedUnits: number;\n readonly interventionsPerLandedUnit: number | null;\n readonly byLane: readonly { readonly lane: string; readonly interventions: number; readonly landed: number; readonly interventionsPerLanding: number | null }[];\n} {\n const counts = new Map<string, number>();\n for (const intervention of interventions) {\n for (const lane of new Set(intervention.targets.map((target) => target.lane))) counts.set(lane, (counts.get(lane) ?? 0) + 1);\n }\n const lanes = new Set([...counts.keys(), ...landedByLane.keys()]);\n const ratio = (numerator: number, denominator: number): number | null => (denominator > 0 ? Math.round((numerator / denominator) * 100) / 100 : numerator === 0 ? 0 : null);\n const byLane = [...lanes]\n .map((lane) => ({ lane, interventions: counts.get(lane) ?? 0, landed: landedByLane.get(lane) ?? 0 }))\n .map((entry) => ({ ...entry, interventionsPerLanding: ratio(entry.interventions, entry.landed) }))\n .sort((left, right) => right.interventions - left.interventions || left.lane.localeCompare(right.lane));\n const landedUnits = [...landedByLane.values()].reduce((sum, count) => sum + count, 0);\n return { interventions: interventions.length, landedUnits, interventionsPerLandedUnit: ratio(interventions.length, landedUnits), byLane };\n}\n\n/** One playbook ROOT run's spend, as its row records it (a root's spend includes its children). */\nexport interface CreationPlaybookRunSpend {\n readonly runId: string;\n readonly playbookRef: string;\n readonly instanceKey?: string;\n readonly startedAt: string;\n readonly finishedAt?: string;\n readonly status: string;\n /** Absent on a row from before #1507, or one whose process stopped before it settled. */\n readonly spend?: PlaybookSpend;\n}\n\n/** One coding run's spend, as its build task's row records it. */\nexport interface CreationCodingRunSpend {\n readonly runTaskId: string;\n readonly taskRef: string;\n readonly startedAt: string;\n readonly settledAt?: string;\n readonly tokens?: { readonly totalTokens?: number; readonly cacheReadTokens?: number };\n readonly cost?: { readonly amount: number; readonly currency: string };\n}\n\n/** One build GENERATION STEP's spend, as its row records it (#2232). `spend` is absent on a row from before it. */\nexport interface CreationGenerationStepSpend {\n readonly runTaskId: string;\n readonly taskRef: string;\n readonly startedAt: string;\n readonly settledAt?: string;\n readonly spend?: PlaybookSpend;\n}\n\n/** An unattended loop's own selection spend: its total less the lanes it ran, each a root run of its own. */\nexport interface CreationLoopSelectionSpend {\n readonly runId: string;\n readonly startedAt: string;\n readonly cost?: Readonly<Record<string, number>>;\n}\n\n/**\n * The journey's spend, counted ONCE (#2232, #2231).\n *\n * Root playbook runs + coding runs + generation steps + loop selections, less the coding runs and generation\n * steps a playbook run's own figure already contains (`PlaybookSpend.codingRuns` / `.generationSteps`), because\n * each of those is also on its build task's row.\n *\n * A root row that reported a cost and no coding part was recorded before #2232 counted that part. If coding\n * runs started inside its window, the total may count them twice; the number of such runs is returned rather\n * than guessed away, because a coding run started by a person while an unrelated lane ran is in that window\n * too, and subtracting it would undercount.\n */\nexport function deriveJourneySpend(input: {\n readonly playbookRuns: readonly CreationPlaybookRunSpend[];\n readonly codingRuns: readonly CreationCodingRunSpend[];\n readonly generationSteps: readonly CreationGenerationStepSpend[];\n readonly loopSelections: readonly CreationLoopSelectionSpend[];\n}): {\n readonly cost: Readonly<Record<string, number>>;\n readonly totalTokens?: number;\n readonly codingRunsWithoutReportedCost: number;\n readonly playbookRunsWithoutSpend: number;\n /** Settled generation steps whose row records no spend (rows from before #2232): left out, so a floor. */\n readonly generationStepsWithoutRecordedSpend: number;\n readonly codingRunsPossiblyCountedTwice: number;\n} {\n const cost: Record<string, number> = {};\n const add = (currency: string, amount: number) => { cost[currency] = Math.round(((cost[currency] ?? 0) + amount) * 1e6) / 1e6; };\n const playbookSpends = input.playbookRuns.flatMap((run) => (run.spend ? [run.spend] : []));\n const merged = mergePlaybookSpend(playbookSpends);\n for (const [currency, amount] of Object.entries(merged.cost ?? {})) add(currency, amount);\n for (const [currency, amount] of Object.entries(merged.codingRuns?.cost ?? {})) add(currency, -amount);\n // A generation step inside a playbook run is in its figure AND on its own row: counted once, from the row.\n for (const [currency, amount] of Object.entries(merged.generationSteps?.cost ?? {})) add(currency, -amount);\n let generationStepsWithoutRecordedSpend = 0;\n let generationTokens: number | undefined;\n for (const step of input.generationSteps) {\n // A step no meter observed recorded nothing either: a floor, never a free step.\n if (!step.spend || step.spend.measurement === PlaybookSpendMeasurement.NOT_OBSERVED) {\n if (step.settledAt !== undefined) generationStepsWithoutRecordedSpend += 1;\n continue;\n }\n for (const [currency, amount] of Object.entries(step.spend.cost ?? {})) add(currency, amount);\n if (step.spend.totalTokens !== undefined) generationTokens = (generationTokens ?? 0) + step.spend.totalTokens;\n }\n for (const loop of input.loopSelections) for (const [currency, amount] of Object.entries(loop.cost ?? {})) add(currency, amount);\n let codingRunsWithoutReportedCost = 0;\n let codingTokens: number | undefined;\n for (const run of input.codingRuns) {\n if (run.cost) add(run.cost.currency, run.cost.amount);\n else if (run.settledAt !== undefined) codingRunsWithoutReportedCost += 1;\n if (run.tokens?.totalTokens !== undefined) codingTokens = (codingTokens ?? 0) + run.tokens.totalTokens;\n }\n const playbookTokens = merged.totalTokens !== undefined\n ? merged.totalTokens - (merged.codingRuns?.totalTokens ?? 0) - (merged.generationSteps?.totalTokens ?? 0)\n : undefined;\n const totalTokens = codingTokens === undefined && playbookTokens === undefined && generationTokens === undefined\n ? undefined\n : (codingTokens ?? 0) + (playbookTokens ?? 0) + (generationTokens ?? 0);\n const unpartedWindows = input.playbookRuns\n .filter((run) => run.spend?.cost !== undefined && run.spend.codingRuns === undefined)\n .map((run) => ({ from: run.startedAt, to: run.finishedAt ?? '' }));\n const codingRunsPossiblyCountedTwice = input.codingRuns.filter((run) => run.cost !== undefined\n && unpartedWindows.some((window) => run.startedAt >= window.from && run.startedAt <= window.to)).length;\n return {\n cost: Object.fromEntries(Object.entries(cost).map(([currency, amount]) => [currency, Math.round(amount * 100) / 100])),\n ...(totalTokens !== undefined ? { totalTokens } : {}),\n codingRunsWithoutReportedCost,\n playbookRunsWithoutSpend: input.playbookRuns.filter((run) => run.spend === undefined).length,\n generationStepsWithoutRecordedSpend,\n codingRunsPossiblyCountedTwice,\n };\n}\n"]}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { LabellingProgressPhase, LabellingProgressReporter } from '../../i18n-labelling/models/labelling-progress.models';
|
|
2
|
+
/**
|
|
3
|
+
* How far a RUNNING companion generation step has got (#2215).
|
|
4
|
+
*
|
|
5
|
+
* ## Why it exists
|
|
6
|
+
*
|
|
7
|
+
* `wildo build tasks` printed one line per task — status and attempt count — so a generation step that
|
|
8
|
+
* ran for hours read "running" the whole time. On `app-creation-test-004` (2026-10-01) the session
|
|
9
|
+
* driving the build could not tell slow from stuck and worked progress out by counting `*.de.ts` files.
|
|
10
|
+
* An operator who reads "running" for two hours will reasonably kill the companion.
|
|
11
|
+
*
|
|
12
|
+
* ## What it is, and what it is not
|
|
13
|
+
*
|
|
14
|
+
* Per-run RUNTIME state (`one-source-of-truth.md` rule 5): held in memory by the service that runs the
|
|
15
|
+
* step, present while the step runs, gone when it settles. Losing it costs the display and nothing
|
|
16
|
+
* else — the step's real outcome is its durable execution row and the files it wrote.
|
|
17
|
+
*
|
|
18
|
+
* Every generation step gets one, so "running since 14:02, last advanced 14:03" is visible for any of
|
|
19
|
+
* them. Only steps whose pipelines report counts (the labelling pipelines) carry `counters`; the rest
|
|
20
|
+
* show elapsed and last-advanced time only.
|
|
21
|
+
*/
|
|
22
|
+
export interface GenerationStepProgress {
|
|
23
|
+
readonly generationStepRef: string;
|
|
24
|
+
/** When the step began. ISO-8601. */
|
|
25
|
+
readonly startedAt: string;
|
|
26
|
+
/** When anything was last reported — a phase planned or a unit settled. ISO-8601. */
|
|
27
|
+
readonly lastAdvancedAt: string;
|
|
28
|
+
/** One counter per phase and locale, in the order the phases were planned. */
|
|
29
|
+
readonly counters: readonly GenerationStepProgressCounter[];
|
|
30
|
+
}
|
|
31
|
+
/** Units of one phase in one locale. */
|
|
32
|
+
export interface GenerationStepProgressCounter {
|
|
33
|
+
readonly phase: LabellingProgressPhase;
|
|
34
|
+
readonly locale: string;
|
|
35
|
+
/** Units the phase planned. */
|
|
36
|
+
readonly total: number;
|
|
37
|
+
/** Units that settled, failed or not. */
|
|
38
|
+
readonly done: number;
|
|
39
|
+
/** Of `done`, the units that did not end with their words. */
|
|
40
|
+
readonly failed: number;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Accumulates one step's progress from the labelling pipelines' reports.
|
|
44
|
+
*
|
|
45
|
+
* `now` is injected so the timestamps are testable; production passes `() => new Date()`.
|
|
46
|
+
*/
|
|
47
|
+
export declare class GenerationStepProgressTracker {
|
|
48
|
+
private readonly generationStepRef;
|
|
49
|
+
private readonly now;
|
|
50
|
+
private readonly startedAt;
|
|
51
|
+
private lastAdvancedAt;
|
|
52
|
+
private readonly counters;
|
|
53
|
+
/** The port the pipelines report through. */
|
|
54
|
+
readonly reporter: LabellingProgressReporter;
|
|
55
|
+
constructor(generationStepRef: string, now?: () => Date);
|
|
56
|
+
snapshot(): GenerationStepProgress;
|
|
57
|
+
private planned;
|
|
58
|
+
private unitSettled;
|
|
59
|
+
private advance;
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=generation-step-progress.models.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generation-step-progress.models.d.ts","sourceRoot":"","sources":["../../../../../src/meta-workflows/models/generation-step-progress.models.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,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
|
|
4
|
+
* `now` is injected so the timestamps are testable; production passes `() => new Date()`.
|
|
5
|
+
*/
|
|
6
|
+
export class GenerationStepProgressTracker {
|
|
7
|
+
generationStepRef;
|
|
8
|
+
now;
|
|
9
|
+
startedAt;
|
|
10
|
+
lastAdvancedAt;
|
|
11
|
+
counters = new Map();
|
|
12
|
+
/** The port the pipelines report through. */
|
|
13
|
+
reporter;
|
|
14
|
+
constructor(generationStepRef, now = () => new Date()) {
|
|
15
|
+
this.generationStepRef = generationStepRef;
|
|
16
|
+
this.now = now;
|
|
17
|
+
this.startedAt = this.now().toISOString();
|
|
18
|
+
this.lastAdvancedAt = this.startedAt;
|
|
19
|
+
this.reporter = {
|
|
20
|
+
planned: (phase, unitCount, locales) => this.planned(phase, unitCount, locales),
|
|
21
|
+
unitSettled: (phase, outcomes) => this.unitSettled(phase, outcomes),
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
snapshot() {
|
|
25
|
+
return {
|
|
26
|
+
generationStepRef: this.generationStepRef,
|
|
27
|
+
startedAt: this.startedAt,
|
|
28
|
+
lastAdvancedAt: this.lastAdvancedAt,
|
|
29
|
+
counters: [...this.counters.values()].map((counter) => ({ ...counter })),
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
planned(phase, unitCount, locales) {
|
|
33
|
+
for (const locale of locales) {
|
|
34
|
+
// A phase planned twice in one step (a retried pipeline) restarts its count rather than doubling it.
|
|
35
|
+
this.counters.set(counterKey(phase, locale), { phase, locale, total: unitCount, done: 0, failed: 0 });
|
|
36
|
+
}
|
|
37
|
+
this.advance();
|
|
38
|
+
}
|
|
39
|
+
unitSettled(phase, outcomes) {
|
|
40
|
+
for (const outcome of outcomes) {
|
|
41
|
+
const counter = this.counters.get(counterKey(phase, outcome.locale));
|
|
42
|
+
// An outcome for a phase nobody planned is not counted: a total it does not belong to would lie.
|
|
43
|
+
if (counter === undefined)
|
|
44
|
+
continue;
|
|
45
|
+
counter.done++;
|
|
46
|
+
if (outcome.failed)
|
|
47
|
+
counter.failed++;
|
|
48
|
+
}
|
|
49
|
+
this.advance();
|
|
50
|
+
}
|
|
51
|
+
advance() {
|
|
52
|
+
this.lastAdvancedAt = this.now().toISOString();
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
function counterKey(phase, locale) {
|
|
56
|
+
return `${phase}\u0000${locale}`;
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=generation-step-progress.models.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generation-step-progress.models.js","sourceRoot":"","sources":["../../../../../src/meta-workflows/models/generation-step-progress.models.ts"],"names":[],"mappings":"AAgDA;;;;GAIG;AACH,MAAM,OAAO,6BAA6B;IASrB;IACA;IATF,SAAS,CAAS;IAC3B,cAAc,CAAS;IACd,QAAQ,GAAG,IAAI,GAAG,EAA0G,CAAC;IAE9I,6CAA6C;IAC7B,QAAQ,CAA4B;IAEpD,YACmB,iBAAyB,EACzB,MAAkB,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE;QADlC,sBAAiB,GAAjB,iBAAiB,CAAQ;QACzB,QAAG,GAAH,GAAG,CAA+B;QAEnD,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC;QAC1C,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,SAAS,CAAC;QACrC,IAAI,CAAC,QAAQ,GAAG;YACd,OAAO,EAAE,CAAC,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,SAAS,EAAE,OAAO,CAAC;YAC/E,WAAW,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,QAAQ,CAAC;SACpE,CAAC;IACJ,CAAC;IAEM,QAAQ;QACb,OAAO;YACL,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;YACzC,SAAS,EAAE,IA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AAE,CAAC;AACnC,CAAC","sourcesContent":["import type {\n LabellingProgressPhase,\n LabellingProgressReporter,\n LabellingProgressUnitOutcome,\n} from '../../i18n-labelling/models/labelling-progress.models';\n\n/**\n * How far a RUNNING companion generation step has got (#2215).\n *\n * ## Why it exists\n *\n * `wildo build tasks` printed one line per task — status and attempt count — so a generation step that\n * ran for hours read \"running\" the whole time. On `app-creation-test-004` (2026-10-01) the session\n * driving the build could not tell slow from stuck and worked progress out by counting `*.de.ts` files.\n * An operator who reads \"running\" for two hours will reasonably kill the companion.\n *\n * ## What it is, and what it is not\n *\n * Per-run RUNTIME state (`one-source-of-truth.md` rule 5): held in memory by the service that runs the\n * step, present while the step runs, gone when it settles. Losing it costs the display and nothing\n * else — the step's real outcome is its durable execution row and the files it wrote.\n *\n * Every generation step gets one, so \"running since 14:02, last advanced 14:03\" is visible for any of\n * them. Only steps whose pipelines report counts (the labelling pipelines) carry `counters`; the rest\n * show elapsed and last-advanced time only.\n */\nexport interface GenerationStepProgress {\n readonly generationStepRef: string;\n /** When the step began. ISO-8601. */\n readonly startedAt: string;\n /** When anything was last reported — a phase planned or a unit settled. ISO-8601. */\n readonly lastAdvancedAt: string;\n /** One counter per phase and locale, in the order the phases were planned. */\n readonly counters: readonly GenerationStepProgressCounter[];\n}\n\n/** Units of one phase in one locale. */\nexport interface GenerationStepProgressCounter {\n readonly phase: LabellingProgressPhase;\n readonly locale: string;\n /** Units the phase planned. */\n readonly total: number;\n /** Units that settled, failed or not. */\n readonly done: number;\n /** Of `done`, the units that did not end with their words. */\n readonly failed: number;\n}\n\n/**\n * Accumulates one step's progress from the labelling pipelines' reports.\n *\n * `now` is injected so the timestamps are testable; production passes `() => new Date()`.\n */\nexport class GenerationStepProgressTracker {\n private readonly startedAt: string;\n private lastAdvancedAt: string;\n private readonly counters = new Map<string, { phase: LabellingProgressPhase; locale: string; total: number; done: number; failed: number }>();\n\n /** The port the pipelines report through. */\n public readonly reporter: LabellingProgressReporter;\n\n public constructor(\n private readonly generationStepRef: string,\n private readonly now: () => Date = () => new Date(),\n ) {\n this.startedAt = this.now().toISOString();\n this.lastAdvancedAt = this.startedAt;\n this.reporter = {\n planned: (phase, unitCount, locales) => this.planned(phase, unitCount, locales),\n unitSettled: (phase, outcomes) => this.unitSettled(phase, outcomes),\n };\n }\n\n public snapshot(): GenerationStepProgress {\n return {\n generationStepRef: this.generationStepRef,\n startedAt: this.startedAt,\n lastAdvancedAt: this.lastAdvancedAt,\n counters: [...this.counters.values()].map((counter) => ({ ...counter })),\n };\n }\n\n private planned(phase: LabellingProgressPhase, unitCount: number, locales: readonly string[]): void {\n for (const locale of locales) {\n // A phase planned twice in one step (a retried pipeline) restarts its count rather than doubling it.\n this.counters.set(counterKey(phase, locale), { phase, locale, total: unitCount, done: 0, failed: 0 });\n }\n this.advance();\n }\n\n private unitSettled(phase: LabellingProgressPhase, outcomes: readonly LabellingProgressUnitOutcome[]): void {\n for (const outcome of outcomes) {\n const counter = this.counters.get(counterKey(phase, outcome.locale));\n // An outcome for a phase nobody planned is not counted: a total it does not belong to would lie.\n if (counter === undefined) continue;\n counter.done++;\n if (outcome.failed) counter.failed++;\n }\n this.advance();\n }\n\n private advance(): void {\n this.lastAdvancedAt = this.now().toISOString();\n }\n}\n\nfunction counterKey(phase: LabellingProgressPhase, locale: string): string {\n return `${phase}\\u0000${locale}`;\n}\n"]}
|
|
@@ -100,13 +100,17 @@ export declare const META_WORKFLOWS_STRUCTURED_ARTIFACT_GENERATOR_AGENT_REF: "me
|
|
|
100
100
|
export declare const META_WORKFLOWS_PLAYBOOK_JUDGE_ACTOR_REF: "meta-workflows.playbook-judge";
|
|
101
101
|
export declare const META_WORKFLOWS_STRUCTURED_ARTIFACT_GENERATOR_ACTOR_REF: "meta-workflows.structured-artifact-generator";
|
|
102
102
|
/**
|
|
103
|
-
* Provider + model for the lane agents
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
*
|
|
103
|
+
* Provider + model for the lane agents, read from the creation lane's one provider table — the
|
|
104
|
+
* creation preflight evaluates that same entry (#2229). `openai` is the labelling-proven
|
|
105
|
+
* path. The application must scope it under `providers.scopes.companion`: the
|
|
106
|
+
* companion's registry holds only the refs its own provider-runtime artifact
|
|
107
|
+
* lists (`filterRegistryByProviderRuntime`), so a provider scoped for the backend
|
|
108
|
+
* alone is refused here. (This said the gate was "catalog-based, not
|
|
109
|
+
* scope-gated" until 2026-10-02 — true before the registry was filtered by
|
|
110
|
+
* artifact, and false since.) A provider swap is a data edit in that table,
|
|
111
|
+
* not a code change (P-14).
|
|
108
112
|
*/
|
|
109
|
-
export declare const META_WORKFLOWS_PROVIDER_REF:
|
|
113
|
+
export declare const META_WORKFLOWS_PROVIDER_REF: string;
|
|
110
114
|
/**
|
|
111
115
|
* Traceability step kind for lane operations (P-13). Distinct from the
|
|
112
116
|
* executions plane's `'execution-persistence'` so journey runs are greppable
|