@wildo-ai/dev-companion 1.1.12 → 1.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/.tsbuildinfo +1 -1
- package/dist/esm/claude-cli/models/coding-agent-dispatch.models.d.ts +21 -0
- package/dist/esm/claude-cli/models/coding-agent-dispatch.models.d.ts.map +1 -1
- package/dist/esm/claude-cli/models/coding-agent-dispatch.models.js +37 -4
- package/dist/esm/claude-cli/models/coding-agent-dispatch.models.js.map +1 -1
- package/dist/esm/claude-cli/services/accepted-change-commit.companion.service.d.ts.map +1 -1
- package/dist/esm/claude-cli/services/accepted-change-commit.companion.service.js +9 -2
- package/dist/esm/claude-cli/services/accepted-change-commit.companion.service.js.map +1 -1
- package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.d.ts +66 -0
- package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.d.ts.map +1 -1
- package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.js +191 -13
- package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.js.map +1 -1
- package/dist/esm/claude-cli/services/git-change-set.companion.service.d.ts +6 -2
- package/dist/esm/claude-cli/services/git-change-set.companion.service.d.ts.map +1 -1
- package/dist/esm/claude-cli/services/git-change-set.companion.service.js +16 -39
- package/dist/esm/claude-cli/services/git-change-set.companion.service.js.map +1 -1
- package/dist/esm/code-compliance-check/check-raw-feature-id-literals.companion.js +31 -2
- package/dist/esm/code-compliance-check/check-raw-feature-id-literals.companion.js.map +1 -1
- package/dist/esm/companion-api/companion-api.schemas.d.ts +2 -0
- package/dist/esm/companion-api/companion-api.schemas.d.ts.map +1 -1
- package/dist/esm/companion-api/companion-api.schemas.js +8 -0
- package/dist/esm/companion-api/companion-api.schemas.js.map +1 -1
- package/dist/esm/companion-api/controllers/companion.controller.d.ts +13 -0
- package/dist/esm/companion-api/controllers/companion.controller.d.ts.map +1 -1
- package/dist/esm/companion-api/controllers/companion.controller.js +39 -13
- package/dist/esm/companion-api/controllers/companion.controller.js.map +1 -1
- package/dist/esm/companion-api/controllers/long-held-request.companion.d.ts +17 -0
- package/dist/esm/companion-api/controllers/long-held-request.companion.d.ts.map +1 -0
- package/dist/esm/companion-api/controllers/long-held-request.companion.js +33 -0
- package/dist/esm/companion-api/controllers/long-held-request.companion.js.map +1 -0
- package/dist/esm/core/introspection/resources/creation-home-projection.companion.d.ts +9 -0
- package/dist/esm/core/introspection/resources/creation-home-projection.companion.d.ts.map +1 -1
- package/dist/esm/core/introspection/resources/creation-home-projection.companion.js +19 -0
- package/dist/esm/core/introspection/resources/creation-home-projection.companion.js.map +1 -1
- package/dist/esm/core/introspection/resources/creation-plane-projection.companion.service.d.ts.map +1 -1
- package/dist/esm/core/introspection/resources/creation-plane-projection.companion.service.js +7 -1
- package/dist/esm/core/introspection/resources/creation-plane-projection.companion.service.js.map +1 -1
- package/dist/esm/core/introspection/resources/launch-blockers.companion.d.ts +5 -1
- package/dist/esm/core/introspection/resources/launch-blockers.companion.d.ts.map +1 -1
- package/dist/esm/core/introspection/resources/launch-blockers.companion.js +37 -4
- package/dist/esm/core/introspection/resources/launch-blockers.companion.js.map +1 -1
- package/dist/esm/core/introspection/services/companion-introspection.companion.service.d.ts +14 -0
- package/dist/esm/core/introspection/services/companion-introspection.companion.service.d.ts.map +1 -1
- package/dist/esm/core/introspection/services/companion-introspection.companion.service.js +48 -0
- package/dist/esm/core/introspection/services/companion-introspection.companion.service.js.map +1 -1
- package/dist/esm/core/introspection/services/introspection-dependency-tree.companion.d.ts +128 -0
- package/dist/esm/core/introspection/services/introspection-dependency-tree.companion.d.ts.map +1 -0
- package/dist/esm/core/introspection/services/introspection-dependency-tree.companion.js +180 -0
- package/dist/esm/core/introspection/services/introspection-dependency-tree.companion.js.map +1 -0
- package/dist/esm/core/introspection/services/introspection-source-state.companion.service.d.ts +8 -20
- package/dist/esm/core/introspection/services/introspection-source-state.companion.service.d.ts.map +1 -1
- package/dist/esm/core/introspection/services/introspection-source-state.companion.service.js +37 -142
- package/dist/esm/core/introspection/services/introspection-source-state.companion.service.js.map +1 -1
- package/dist/esm/core/introspection/services/introspection-source-walk.worker.d.ts +64 -0
- package/dist/esm/core/introspection/services/introspection-source-walk.worker.d.ts.map +1 -0
- package/dist/esm/core/introspection/services/introspection-source-walk.worker.js +304 -0
- package/dist/esm/core/introspection/services/introspection-source-walk.worker.js.map +1 -0
- package/dist/esm/core/introspection/services/introspection-worker-pool.companion.d.ts +9 -0
- package/dist/esm/core/introspection/services/introspection-worker-pool.companion.d.ts.map +1 -1
- package/dist/esm/core/introspection/services/introspection-worker-pool.companion.js +25 -3
- package/dist/esm/core/introspection/services/introspection-worker-pool.companion.js.map +1 -1
- package/dist/esm/core/runtime/companion-language-model-route.d.ts +16 -1
- package/dist/esm/core/runtime/companion-language-model-route.d.ts.map +1 -1
- package/dist/esm/core/runtime/companion-language-model-route.js +23 -1
- package/dist/esm/core/runtime/companion-language-model-route.js.map +1 -1
- package/dist/esm/core/runtime/restart-drain.companion.d.ts +107 -0
- package/dist/esm/core/runtime/restart-drain.companion.d.ts.map +1 -0
- package/dist/esm/core/runtime/restart-drain.companion.js +237 -0
- package/dist/esm/core/runtime/restart-drain.companion.js.map +1 -0
- package/dist/esm/core/runtime/services/start-companion-application.service.d.ts.map +1 -1
- package/dist/esm/core/runtime/services/start-companion-application.service.js +3 -2
- package/dist/esm/core/runtime/services/start-companion-application.service.js.map +1 -1
- package/dist/esm/core/utils/git-read-broker.companion.d.ts +62 -0
- package/dist/esm/core/utils/git-read-broker.companion.d.ts.map +1 -0
- package/dist/esm/core/utils/git-read-broker.companion.js +282 -0
- package/dist/esm/core/utils/git-read-broker.companion.js.map +1 -0
- package/dist/esm/core/utils/local-write-recording.companion.d.ts +8 -1
- package/dist/esm/core/utils/local-write-recording.companion.d.ts.map +1 -1
- package/dist/esm/core/utils/local-write-recording.companion.js +7 -23
- package/dist/esm/core/utils/local-write-recording.companion.js.map +1 -1
- package/dist/esm/executions/services/companion-executions.companion.service.d.ts +18 -1
- package/dist/esm/executions/services/companion-executions.companion.service.d.ts.map +1 -1
- package/dist/esm/executions/services/companion-executions.companion.service.js +34 -8
- package/dist/esm/executions/services/companion-executions.companion.service.js.map +1 -1
- package/dist/esm/i18n/components/HIGH_LEVEL_VIEWS_CHART_DASHBOARD_LAYOUT_EDITOR.en.d.ts +29 -0
- package/dist/esm/i18n/components/HIGH_LEVEL_VIEWS_CHART_DASHBOARD_LAYOUT_EDITOR.en.d.ts.map +1 -0
- package/dist/esm/i18n/components/HIGH_LEVEL_VIEWS_CHART_DASHBOARD_LAYOUT_EDITOR.en.js +29 -0
- package/dist/esm/i18n/components/HIGH_LEVEL_VIEWS_CHART_DASHBOARD_LAYOUT_EDITOR.en.js.map +1 -0
- package/dist/esm/i18n/components/HIGH_LEVEL_VIEWS_CHART_DASHBOARD_LAYOUT_EDITOR.fr.d.ts +29 -0
- package/dist/esm/i18n/components/HIGH_LEVEL_VIEWS_CHART_DASHBOARD_LAYOUT_EDITOR.fr.d.ts.map +1 -0
- package/dist/esm/i18n/components/HIGH_LEVEL_VIEWS_CHART_DASHBOARD_LAYOUT_EDITOR.fr.js +29 -0
- package/dist/esm/i18n/components/HIGH_LEVEL_VIEWS_CHART_DASHBOARD_LAYOUT_EDITOR.fr.js.map +1 -0
- package/dist/esm/i18n/components/LOW_LEVEL_AI_APPROVAL.en.d.ts +1 -0
- package/dist/esm/i18n/components/LOW_LEVEL_AI_APPROVAL.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_AI_APPROVAL.en.js +2 -1
- package/dist/esm/i18n/components/LOW_LEVEL_AI_APPROVAL.en.js.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_AI_APPROVAL.fr.d.ts +1 -0
- package/dist/esm/i18n/components/LOW_LEVEL_AI_APPROVAL.fr.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_AI_APPROVAL.fr.js +2 -1
- package/dist/esm/i18n/components/LOW_LEVEL_AI_APPROVAL.fr.js.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_AI_CONVERSATION_THREAD.en.d.ts +5 -2
- package/dist/esm/i18n/components/LOW_LEVEL_AI_CONVERSATION_THREAD.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_AI_CONVERSATION_THREAD.en.js +5 -2
- package/dist/esm/i18n/components/LOW_LEVEL_AI_CONVERSATION_THREAD.en.js.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_AI_CONVERSATION_THREAD.fr.d.ts +5 -2
- package/dist/esm/i18n/components/LOW_LEVEL_AI_CONVERSATION_THREAD.fr.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_AI_CONVERSATION_THREAD.fr.js +5 -2
- package/dist/esm/i18n/components/LOW_LEVEL_AI_CONVERSATION_THREAD.fr.js.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_APPROVAL_SEAL.en.d.ts +41 -0
- package/dist/esm/i18n/components/LOW_LEVEL_APPROVAL_SEAL.en.d.ts.map +1 -0
- package/dist/esm/i18n/components/LOW_LEVEL_APPROVAL_SEAL.en.js +41 -0
- package/dist/esm/i18n/components/LOW_LEVEL_APPROVAL_SEAL.en.js.map +1 -0
- package/dist/esm/i18n/components/LOW_LEVEL_APPROVAL_SEAL.fr.d.ts +41 -0
- package/dist/esm/i18n/components/LOW_LEVEL_APPROVAL_SEAL.fr.d.ts.map +1 -0
- package/dist/esm/i18n/components/LOW_LEVEL_APPROVAL_SEAL.fr.js +41 -0
- package/dist/esm/i18n/components/LOW_LEVEL_APPROVAL_SEAL.fr.js.map +1 -0
- package/dist/esm/i18n/components/LOW_LEVEL_CONTENT_SECTION_CONTAINER.en.d.ts +1 -0
- package/dist/esm/i18n/components/LOW_LEVEL_CONTENT_SECTION_CONTAINER.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_CONTENT_SECTION_CONTAINER.en.js +2 -1
- package/dist/esm/i18n/components/LOW_LEVEL_CONTENT_SECTION_CONTAINER.en.js.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_CONTENT_SECTION_CONTAINER.fr.d.ts +1 -0
- package/dist/esm/i18n/components/LOW_LEVEL_CONTENT_SECTION_CONTAINER.fr.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_CONTENT_SECTION_CONTAINER.fr.js +2 -1
- package/dist/esm/i18n/components/LOW_LEVEL_CONTENT_SECTION_CONTAINER.fr.js.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_FORM_FIELD_STRING.en.d.ts +1 -0
- package/dist/esm/i18n/components/LOW_LEVEL_FORM_FIELD_STRING.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_FORM_FIELD_STRING.en.js +2 -1
- package/dist/esm/i18n/components/LOW_LEVEL_FORM_FIELD_STRING.en.js.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_FORM_FIELD_STRING.fr.d.ts +1 -0
- package/dist/esm/i18n/components/LOW_LEVEL_FORM_FIELD_STRING.fr.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_FORM_FIELD_STRING.fr.js +2 -1
- package/dist/esm/i18n/components/LOW_LEVEL_FORM_FIELD_STRING.fr.js.map +1 -1
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_MFA_CHALLENGE.en.d.ts +1 -0
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_MFA_CHALLENGE.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_MFA_CHALLENGE.en.js +2 -1
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_MFA_CHALLENGE.en.js.map +1 -1
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_MFA_CHALLENGE.fr.d.ts +1 -0
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_MFA_CHALLENGE.fr.d.ts.map +1 -1
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_MFA_CHALLENGE.fr.js +2 -1
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_MFA_CHALLENGE.fr.js.map +1 -1
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_TERMS.en.d.ts +2 -0
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_TERMS.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_TERMS.en.js +3 -1
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_TERMS.en.js.map +1 -1
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_TERMS.fr.d.ts +2 -0
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_TERMS.fr.d.ts.map +1 -1
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_TERMS.fr.js +3 -1
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_TERMS.fr.js.map +1 -1
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_USER_AUTH.en.d.ts +1 -1
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_USER_AUTH.en.js +1 -1
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_USER_AUTH.en.js.map +1 -1
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_USER_AUTH.fr.d.ts +1 -1
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_USER_AUTH.fr.js +1 -1
- package/dist/esm/i18n/components/PUBLIC_LAYOUTS_USER_AUTH.fr.js.map +1 -1
- package/dist/esm/i18n/components/RESOURCES_LAYOUTS_FILTERS.en.d.ts +2 -0
- package/dist/esm/i18n/components/RESOURCES_LAYOUTS_FILTERS.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/RESOURCES_LAYOUTS_FILTERS.en.js +3 -1
- package/dist/esm/i18n/components/RESOURCES_LAYOUTS_FILTERS.en.js.map +1 -1
- package/dist/esm/i18n/components/RESOURCES_LAYOUTS_FILTERS.fr.d.ts +3 -1
- package/dist/esm/i18n/components/RESOURCES_LAYOUTS_FILTERS.fr.d.ts.map +1 -1
- package/dist/esm/i18n/components/RESOURCES_LAYOUTS_FILTERS.fr.js +4 -2
- package/dist/esm/i18n/components/RESOURCES_LAYOUTS_FILTERS.fr.js.map +1 -1
- package/dist/esm/i18n/components/RESOURCES_LAYOUTS_LIST.en.d.ts +17 -0
- package/dist/esm/i18n/components/RESOURCES_LAYOUTS_LIST.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/RESOURCES_LAYOUTS_LIST.en.js +18 -1
- package/dist/esm/i18n/components/RESOURCES_LAYOUTS_LIST.en.js.map +1 -1
- package/dist/esm/i18n/components/RESOURCES_LAYOUTS_LIST.fr.d.ts +17 -0
- package/dist/esm/i18n/components/RESOURCES_LAYOUTS_LIST.fr.d.ts.map +1 -1
- package/dist/esm/i18n/components/RESOURCES_LAYOUTS_LIST.fr.js +18 -1
- package/dist/esm/i18n/components/RESOURCES_LAYOUTS_LIST.fr.js.map +1 -1
- package/dist/esm/i18n/composite_views/app.creation-conversation.fr.d.ts +206 -195
- package/dist/esm/i18n/composite_views/app.creation-conversation.fr.d.ts.map +1 -1
- package/dist/esm/i18n/composite_views/app.creation-conversation.fr.js +206 -195
- package/dist/esm/i18n/composite_views/app.creation-conversation.fr.js.map +1 -1
- package/dist/esm/i18n/composite_views/app.creation-dossier.fr.d.ts +10 -0
- package/dist/esm/i18n/composite_views/app.creation-dossier.fr.d.ts.map +1 -1
- package/dist/esm/i18n/composite_views/app.creation-dossier.fr.js +12 -2
- package/dist/esm/i18n/composite_views/app.creation-dossier.fr.js.map +1 -1
- package/dist/esm/i18n/resources/wildoApplicationActorSystemExecutions.fr.d.ts +70 -0
- package/dist/esm/i18n/resources/wildoApplicationActorSystemExecutions.fr.d.ts.map +1 -1
- package/dist/esm/i18n/resources/wildoApplicationActorSystemExecutions.fr.js +70 -0
- package/dist/esm/i18n/resources/wildoApplicationActorSystemExecutions.fr.js.map +1 -1
- package/dist/esm/i18n/resources/wildoApplicationActorTasks.fr.d.ts +12 -2
- package/dist/esm/i18n/resources/wildoApplicationActorTasks.fr.d.ts.map +1 -1
- package/dist/esm/i18n/resources/wildoApplicationActorTasks.fr.js +12 -2
- package/dist/esm/i18n/resources/wildoApplicationActorTasks.fr.js.map +1 -1
- package/dist/esm/i18n/resources/wildoApplicationFlowSystemExecutions.fr.d.ts +10 -0
- package/dist/esm/i18n/resources/wildoApplicationFlowSystemExecutions.fr.d.ts.map +1 -1
- package/dist/esm/i18n/resources/wildoApplicationFlowSystemExecutions.fr.js +10 -0
- package/dist/esm/i18n/resources/wildoApplicationFlowSystemExecutions.fr.js.map +1 -1
- package/dist/esm/i18n/resources/workbenchBuildDispatchPlan.fr.d.ts +25 -20
- package/dist/esm/i18n/resources/workbenchBuildDispatchPlan.fr.d.ts.map +1 -1
- package/dist/esm/i18n/resources/workbenchBuildDispatchPlan.fr.js +25 -20
- package/dist/esm/i18n/resources/workbenchBuildDispatchPlan.fr.js.map +1 -1
- package/dist/esm/i18n/resources/workbenchBuildPlanTasks.fr.d.ts +32 -32
- package/dist/esm/i18n/resources/workbenchBuildPlanTasks.fr.js +32 -32
- package/dist/esm/i18n/resources/workbenchBuildPlanTasks.fr.js.map +1 -1
- package/dist/esm/i18n/resources/workbenchBuildTaskRecords.fr.d.ts +65 -65
- package/dist/esm/i18n/resources/workbenchBuildTaskRecords.fr.js +65 -65
- package/dist/esm/i18n/resources/workbenchBuildTaskRecords.fr.js.map +1 -1
- package/dist/esm/i18n/resources/workbenchDossierEntries.fr.d.ts +20 -0
- package/dist/esm/i18n/resources/workbenchDossierEntries.fr.d.ts.map +1 -1
- package/dist/esm/i18n/resources/workbenchDossierEntries.fr.js +20 -0
- package/dist/esm/i18n/resources/workbenchDossierEntries.fr.js.map +1 -1
- package/dist/esm/i18n/resources/workbenchGovernanceQuestions.fr.d.ts +12 -0
- package/dist/esm/i18n/resources/workbenchGovernanceQuestions.fr.d.ts.map +1 -1
- package/dist/esm/i18n/resources/workbenchGovernanceQuestions.fr.js +13 -1
- package/dist/esm/i18n/resources/workbenchGovernanceQuestions.fr.js.map +1 -1
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.en.d.ts +40 -0
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.en.d.ts.map +1 -1
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.en.js +13 -0
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.en.js.map +1 -1
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.fr.d.ts +40 -0
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.fr.d.ts.map +1 -1
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.fr.js +40 -0
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.fr.js.map +1 -1
- package/dist/esm/i18n/system_enums/application-creation.en.d.ts +5 -0
- package/dist/esm/i18n/system_enums/application-creation.en.d.ts.map +1 -1
- package/dist/esm/i18n/system_enums/application-creation.en.js +6 -0
- package/dist/esm/i18n/system_enums/application-creation.en.js.map +1 -1
- package/dist/esm/i18n/system_enums/application-creation.fr.d.ts +175 -170
- package/dist/esm/i18n/system_enums/application-creation.fr.d.ts.map +1 -1
- package/dist/esm/i18n/system_enums/application-creation.fr.js +175 -170
- package/dist/esm/i18n/system_enums/application-creation.fr.js.map +1 -1
- package/dist/esm/i18n/system_enums/flows-actors.fr.d.ts +22 -22
- package/dist/esm/i18n/system_enums/flows-actors.fr.js +22 -22
- package/dist/esm/i18n/system_enums/flows-actors.fr.js.map +1 -1
- package/dist/esm/i18n/system_enums/run-records.fr.d.ts +21 -21
- package/dist/esm/i18n/system_enums/run-records.fr.js +21 -21
- package/dist/esm/i18n/system_enums/run-records.fr.js.map +1 -1
- package/dist/esm/i18n/system_enums/workbench-build.en.d.ts +3 -0
- package/dist/esm/i18n/system_enums/workbench-build.en.d.ts.map +1 -1
- package/dist/esm/i18n/system_enums/workbench-build.en.js +3 -0
- package/dist/esm/i18n/system_enums/workbench-build.en.js.map +1 -1
- package/dist/esm/i18n/system_enums/workbench-build.fr.d.ts +37 -33
- package/dist/esm/i18n/system_enums/workbench-build.fr.d.ts.map +1 -1
- package/dist/esm/i18n/system_enums/workbench-build.fr.js +37 -33
- package/dist/esm/i18n/system_enums/workbench-build.fr.js.map +1 -1
- package/dist/esm/i18n/system_enums/workbench-creation-home.en.d.ts +1 -0
- package/dist/esm/i18n/system_enums/workbench-creation-home.en.d.ts.map +1 -1
- package/dist/esm/i18n/system_enums/workbench-creation-home.en.js +1 -0
- package/dist/esm/i18n/system_enums/workbench-creation-home.en.js.map +1 -1
- package/dist/esm/i18n/system_enums/workbench-creation-home.fr.d.ts +18 -17
- package/dist/esm/i18n/system_enums/workbench-creation-home.fr.d.ts.map +1 -1
- package/dist/esm/i18n/system_enums/workbench-creation-home.fr.js +18 -17
- package/dist/esm/i18n/system_enums/workbench-creation-home.fr.js.map +1 -1
- package/dist/esm/i18n/system_enums/workbench-dossier.fr.d.ts +7 -5
- package/dist/esm/i18n/system_enums/workbench-dossier.fr.d.ts.map +1 -1
- package/dist/esm/i18n/system_enums/workbench-dossier.fr.js +8 -6
- package/dist/esm/i18n/system_enums/workbench-dossier.fr.js.map +1 -1
- package/dist/esm/i18n/system_enums/workbench-secrets.fr.d.ts +12 -12
- package/dist/esm/i18n/system_enums/workbench-secrets.fr.js +12 -12
- package/dist/esm/i18n/system_enums/workbench-secrets.fr.js.map +1 -1
- package/dist/esm/i18n/system_enums/workbench-specification-artifact.fr.d.ts +1 -0
- package/dist/esm/i18n/system_enums/workbench-specification-artifact.fr.d.ts.map +1 -1
- package/dist/esm/i18n/system_enums/workbench-specification-artifact.fr.js +2 -1
- package/dist/esm/i18n/system_enums/workbench-specification-artifact.fr.js.map +1 -1
- package/dist/esm/i18n-labelling/services/labelling-planner.companion.service.d.ts.map +1 -1
- package/dist/esm/i18n-labelling/services/labelling-planner.companion.service.js +3 -4
- package/dist/esm/i18n-labelling/services/labelling-planner.companion.service.js.map +1 -1
- package/dist/esm/i18n-labelling/utils/declared-refusal-codes.utils.d.ts +11 -0
- package/dist/esm/i18n-labelling/utils/declared-refusal-codes.utils.d.ts.map +1 -1
- package/dist/esm/i18n-labelling/utils/declared-refusal-codes.utils.js +21 -0
- package/dist/esm/i18n-labelling/utils/declared-refusal-codes.utils.js.map +1 -1
- package/dist/esm/meta-workflows/models/application-coding-agent.actors-system.definitions.d.ts +5 -1
- package/dist/esm/meta-workflows/models/application-coding-agent.actors-system.definitions.d.ts.map +1 -1
- package/dist/esm/meta-workflows/models/application-coding-agent.actors-system.definitions.js +5 -1
- package/dist/esm/meta-workflows/models/application-coding-agent.actors-system.definitions.js.map +1 -1
- package/dist/esm/meta-workflows/models/playbook-run-record.models.d.ts +12 -0
- package/dist/esm/meta-workflows/models/playbook-run-record.models.d.ts.map +1 -1
- package/dist/esm/meta-workflows/models/playbook-run-record.models.js +9 -0
- package/dist/esm/meta-workflows/models/playbook-run-record.models.js.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.d.ts +200 -20
- package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.js +1107 -230
- package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-follow-up-derivation.companion.d.ts +158 -16
- package/dist/esm/meta-workflows/services/application-build-follow-up-derivation.companion.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-follow-up-derivation.companion.js +381 -46
- package/dist/esm/meta-workflows/services/application-build-follow-up-derivation.companion.js.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-generation-step.companion.service.d.ts +58 -0
- package/dist/esm/meta-workflows/services/application-build-generation-step.companion.service.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-generation-step.companion.service.js +116 -2
- package/dist/esm/meta-workflows/services/application-build-generation-step.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-landing-projection.companion.d.ts +3 -3
- package/dist/esm/meta-workflows/services/application-build-landing-projection.companion.js +3 -3
- package/dist/esm/meta-workflows/services/application-build-landing-projection.companion.js.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-task-closure.companion.d.ts +9 -0
- package/dist/esm/meta-workflows/services/application-build-task-closure.companion.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-task-closure.companion.js +19 -0
- package/dist/esm/meta-workflows/services/application-build-task-closure.companion.js.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-task-coding-policy.companion.service.d.ts +12 -0
- package/dist/esm/meta-workflows/services/application-build-task-coding-policy.companion.service.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-task-coding-policy.companion.service.js +31 -7
- package/dist/esm/meta-workflows/services/application-build-task-coding-policy.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/services/creation-intervention-ledger.companion.service.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/creation-intervention-ledger.companion.service.js +4 -5
- package/dist/esm/meta-workflows/services/creation-intervention-ledger.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/services/creation-run-report.companion.service.d.ts +2 -2
- package/dist/esm/meta-workflows/services/creation-run-report.companion.service.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/creation-run-report.companion.service.js +10 -8
- package/dist/esm/meta-workflows/services/creation-run-report.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/services/foundation-executor.companion.service.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/foundation-executor.companion.service.js +6 -3
- package/dist/esm/meta-workflows/services/foundation-executor.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/services/playbook-run-write-register-window.companion.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/playbook-run-write-register-window.companion.js +3 -5
- package/dist/esm/meta-workflows/services/playbook-run-write-register-window.companion.js.map +1 -1
- package/dist/esm/meta-workflows/services/playbook-run.companion.service.d.ts +68 -3
- package/dist/esm/meta-workflows/services/playbook-run.companion.service.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/playbook-run.companion.service.js +281 -69
- package/dist/esm/meta-workflows/services/playbook-run.companion.service.js.map +1 -1
- package/package.json +18 -18
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playbook-run-record.models.js","sourceRoot":"","sources":["../../../../src/meta-workflows/models/playbook-run-record.models.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,2BAA2B,EAA8B,MAAM,uBAAuB,CAAC;AACpH,OAAO,EACL,iBAAiB,EACjB,wBAAwB,EACxB,qBAAqB,EACrB,kBAAkB,GAKnB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,kCAAkC,EAAmC,MAAM,gCAAgC,CAAC;AACrH,OAAO,EAAE,kBAAkB,EAAE,MAAM,oDAAoD,CAAC;AAExF,OAAO,EAAE,sCAAsC,EAAE,MAAM,8BAA8B,CAAC;AACtF,OAAO,EAAE,8BAA8B,EAAE,MAAM,oCAAoC,CAAC;AA4BpF;;;;GAIG;AACH,MAAM,UAAU,2BAA2B,CAAC,MAAe;IACzD,MAAM,IAAI,GAAG,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC;IAC7E,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAC/D,2FAA2F;IAC3F,6FAA6F;IAC7F,IAAI,wBAAwB,CAAC,MAAM,CAAC,EAAE,CAAC;QACrC,MAAM,OAAO,GAAG,MAAiC,CAAC;QAClD,OAAO,EAAE,YAAY,EAAE,OAAO,CAAC,YAAY,EAAE,aAAa,EAAE,OAAO,CAAC,aAAa,IAAI,IAAI,EAAE,YAAY,EAAE,OAAO,CAAC,YAAY,EAAE,CAAC;IAClI,CAAC;IACD,MAAM,KAAK,GAAI,MAA8B,CAAC,KAAK,CAAC;IACpD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI;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,GAAG,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,2BAA2B,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACzE,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAC5B,CAAC,CAAC;IACL,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["import { FlowsActors_Status, HumanDecision_RequestSchema, type HumanDecision_Request } from '@wildo-ai/saas-models';\nimport {\n PlaybookRerunKind,\n PlaybookSpendMeasurement,\n describePlaybookRerun,\n mergePlaybookSpend,\n type PlaybookLoopInterruption,\n type PlaybookRerunVerdict,\n type PlaybookSpend,\n type PlaybookSpendBuildRowPart,\n} from '@wildo-ai/application-creation-runtime';\nimport { Workbench_PlaybookRunOutcomeStatus, type Workbench_PlaybookRunRound } from '@wildo-ai/platform-core-shared';\nimport { playbookInstanceId } from '@wildo-ai/saas-specifications/application-creation';\n\nimport { META_WORKFLOWS_PLAYBOOK_LOOP_ACTOR_REF } from './meta-workflows-lane.models';\nimport { isEnvironmentalPlaybookFailure } from './playbook-loop-environment.models';\n\n/**\n * WHAT A PLAYBOOK RUN SAYS ABOUT ITSELF ON ITS OWN ROW, and how the runs read is derived from rows\n * (#1362).\n *\n * ## Why this exists\n *\n * Since #1358 a playbook run is an actor-system execution with one task. The ROW said that the run\n * happened and how it ended; what the run DID — accepted or not, what the judge thought, whether it\n * stopped to ask — lived only in an in-process map (`lastCompletedDetachedRuns`), one entry per\n * playbook ref. A companion restart emptied it, so the creation board's timeline forgot every\n * completed run while the rows that proved them sat unread one table over. The map was defended as a\n * per-run cache whose loss \"costs the summary and no fact\"; the summary is what the board renders.\n *\n * So the run writes a SUMMARY on its task when it settles — small, and sufficient for a reader that\n * was not there — and the runs read is a projection of the rows. The full result envelope (review\n * guide, landed paths) stays what it was: an in-process enrichment a poller gets from the process\n * that ran the run, and nobody else needs.\n */\n\n/** The judge's verdict as a reader renders it — all `null` when the run had no judge. */\nexport interface PlaybookRunJudgeSummary {\n readonly judgeOverall: string | null;\n readonly judgeCriteria: ReadonlyArray<{ readonly criterionRef: string; readonly verdict: string; readonly rationale: string }> | null;\n readonly judgeSkipped: string | null;\n}\n\n/**\n * Read a run result's judge block. ONE reader, used when the summary is written and when a live\n * result is rendered, so a row and a live record cannot describe one verdict two ways. A result\n * envelope without a judge (a playbook with no evaluation treatment, a dry run) answers all null.\n */\nexport function readPlaybookRunJudgeVerdict(result: unknown): PlaybookRunJudgeSummary {\n const none = { judgeOverall: null, judgeCriteria: null, judgeSkipped: null };\n if (typeof result !== 'object' || result === null) return none;\n // A row read back after a restart carries the SUMMARY this function once produced, not the\n // envelope; it is returned as it was written rather than re-derived from a `judge` it lacks.\n if (isPlaybookRunTaskSummary(result)) {\n const summary = result as PlaybookRunJudgeSummary;\n return { judgeOverall: summary.judgeOverall, judgeCriteria: summary.judgeCriteria ?? null, judgeSkipped: summary.judgeSkipped };\n }\n const judge = (result as { judge?: unknown }).judge;\n if (typeof judge !== 'object' || judge === null) return none;\n const { judged, overall, criteria, skipped } = judge as { judged?: unknown; overall?: unknown; criteria?: unknown; skipped?: unknown };\n if (judged === true && typeof overall === 'string') {\n return {\n judgeOverall: overall,\n judgeCriteria: Array.isArray(criteria)\n ? criteria.map((entry) => ({\n criterionRef: String((entry as { criterionRef?: unknown }).criterionRef ?? ''),\n verdict: String((entry as { verdict?: unknown }).verdict ?? ''),\n rationale: String((entry as { rationale?: unknown }).rationale ?? ''),\n }))\n : [],\n judgeSkipped: null,\n };\n }\n return { judgeOverall: null, judgeCriteria: null, judgeSkipped: typeof skipped === 'string' && skipped.length > 0 ? skipped : null };\n}\n\n/**\n * Whether a run result is the SUMMARY a settled row carries ({@link summarizePlaybookRunResult}) rather than a live\n * envelope. The summary always carries the judge's two keys, which no envelope does; every reader that accepts either\n * asks this one question, so a row and a live record cannot be told apart two ways.\n */\nfunction isPlaybookRunTaskSummary(result: object): boolean {\n return 'judgeOverall' in result && 'judgeSkipped' in result;\n}\n\n/** What a settled run's task `output` carries. A THROWN run carries the engine's `{ failure }` instead. */\nexport interface PlaybookRunTaskSummary extends PlaybookRunJudgeSummary {\n /** Whether the run's output was accepted into the workspace; `null` when the envelope does not say. */\n readonly accepted: boolean | null;\n readonly dryRun: boolean;\n /** Present on a run that STOPPED TO ASK: which family it is asking about, and which round. */\n readonly awaitingCreatorInput?: { readonly family: string; readonly round: number };\n /**\n * Present on a COMPOSITE run: why it stopped, what its children landed, and each iteration's children.\n *\n * A composite authors nothing itself, so its judge fields are always empty and `accepted` is always false —\n * without this block a composite that landed nothing reads exactly like one that landed everything. Measured\n * 2026-09-21 in the end-to-end run (#1273): `top_down.market-analysis` ran three research rounds, settled\n * COMPLETED with `ok: true`, landed no market snapshot, and nothing anywhere recorded why it stopped.\n */\n readonly choreography?: PlaybookRunChoreographySummary;\n /**\n * How long the run took and what its model calls reported spending (#1507) — present on every run the\n * companion measured, composite or not. Absent on a row written before it existed. A run that THREW\n * carries the engine's `{ failure }` instead of this summary, and this same `measurement` beside it\n * (`ActorExecutionRunOptions.recordBesideFailure`), which `readPlaybookRunMeasurement` reads either way.\n */\n readonly measurement?: PlaybookRunMeasurement;\n /**\n * The OTHER root runs this run shared the application with while it ran (#1610), oldest first. Present\n * only on a ROOT run, and only when there were any.\n *\n * Two lines now run side by side and write one tree. Their writes are not prevented from meeting: a\n * landing over another run's is detected where it happens (#1614), and this is the other half — each\n * run says, on its own row, which runs it overlapped, so \"what else was running when this landed\" has\n * an answer after both processes are gone.\n */\n readonly overlappedRuns?: readonly PlaybookRunOverlap[];\n}\n\n/**\n * Another ROOT run whose time on the application overlapped this one's (#1610): what a reader needs to\n * find it and say what it was. Its own children are never listed, and neither are this run's.\n */\nexport interface PlaybookRunOverlap {\n readonly runId: string;\n readonly playbookRef: string;\n readonly instanceKey?: string;\n readonly startedAt: string;\n}\n\n/**\n * The ROOT runs whose time overlapped `self`'s window (#1610), from the execution rows.\n *\n * A row is a root when its correlation names no `rootRunId`: a composite's child records its tree's root,\n * and a child overlaps its root by construction, so listing children would bury the one fact the record\n * exists for under a composite's own work. A row that names no playbook (the unattended loop, the judge)\n * is not a playbook run and is skipped.\n *\n * A run's window is its row's creation until it FINISHED, or until it suspended to ask: a run waiting on\n * a person writes nothing. A row still running is open-ended. Windows that merely touch do not overlap.\n */\nexport function findOverlappingRootRuns(\n executions: readonly PlaybookRunExecutionRow[],\n self: { readonly runId: string; readonly startedAt: string; readonly endedAt: string },\n): readonly PlaybookRunOverlap[] {\n const overlaps: PlaybookRunOverlap[] = [];\n for (const execution of executions) {\n if (execution._id === self.runId) continue;\n const refs = execution.standaloneTasks[0]?.context?.correlation?.refs;\n const playbookRef = refs?.['playbookRef'];\n if (typeof playbookRef !== 'string' || typeof refs?.['rootRunId'] === 'string') continue;\n const running = execution.status === FlowsActors_Status.PROCESSING || execution.status === FlowsActors_Status.PENDING;\n const createdAt = execution.createdAt.toISOString();\n const endedAt = running ? undefined : execution.finishedAt?.toISOString() ?? execution.suspension?.suspendedAt ?? createdAt;\n if (createdAt >= self.endedAt) continue;\n if (endedAt !== undefined && endedAt <= self.startedAt) continue;\n const instanceKey = refs?.['instanceKey'];\n overlaps.push({ runId: execution._id, playbookRef, ...(typeof instanceKey === 'string' ? { instanceKey } : {}), startedAt: createdAt });\n }\n return overlaps.sort((left, right) => left.startedAt.localeCompare(right.startedAt));\n}\n\n/** Read a row summary's overlap record back (#1610); `undefined` for a row that carries none. */\nexport function readPlaybookRunOverlaps(taskOutput: unknown): readonly PlaybookRunOverlap[] | undefined {\n if (typeof taskOutput !== 'object' || taskOutput === null) return undefined;\n const overlaps = (taskOutput as { overlappedRuns?: unknown }).overlappedRuns;\n if (!Array.isArray(overlaps)) return undefined;\n const read = overlaps.filter((entry): entry is PlaybookRunOverlap => typeof entry === 'object' && entry !== null\n && typeof (entry as { runId?: unknown }).runId === 'string' && typeof (entry as { playbookRef?: unknown }).playbookRef === 'string');\n return read.length > 0 ? read : undefined;\n}\n\n/** A run's wall-clock and its spend, as a host meter saw them (#1507). */\nexport interface PlaybookRunMeasurement {\n readonly durationMs: number;\n readonly spend: PlaybookSpend;\n}\n\n/**\n * What one child PLAYBOOK REF cost across a composite run, summed over every time it was dispatched (#1507).\n *\n * Per playbook ref, not per build task: `bottom_up.build-dispatch` runs whichever task is ready, so its\n * tally spans every task it dispatched. The per-TASK view of the #1273 bill — `build-task-capture-view`\n * attempted three times at $5.91 · $10.42 · $21.15 — is `GET /api/companion/build/tasks`, whose attempts\n * carry each run's cost. What this answers is the lane's question: how often did this child run, how\n * often did it produce anything (`dispatches` beside `landings`), and whether each dispatch cost more\n * than the last (`costPerDispatch`, in order).\n */\nexport interface PlaybookRunChildTally {\n readonly playbookRef: string;\n readonly dispatches: number;\n readonly failures: number;\n /** Dispatches that landed at least one file. */\n readonly landings: number;\n readonly durationMs: number;\n /** Every dispatch's spend together. Absent when no dispatch of this child carried one (a row from before #1507). */\n readonly spend?: PlaybookSpend;\n /** Each dispatch's reported cost, in dispatch order, per currency — present only when some dispatch reported one. */\n readonly costPerDispatch?: ReadonlyArray<Readonly<Record<string, number>> | null>;\n}\n\n/** One round of a composite, as its record keeps it (#1507) — the same shape for the root and for a nested lane. */\nexport interface PlaybookRunChoreographyIterationSummary {\n readonly iteration: number;\n readonly eligibleRefs: readonly string[];\n /** Children on record with nothing they read changed, so not offered this round (2026-10-01). */\n readonly withheldAsCurrent?: readonly string[];\n /** Refreshes held back this round because a first-run child was offered and reads nothing they write. */\n readonly deferredForFirstRun?: readonly string[];\n readonly children: readonly PlaybookRunChoreographyChildSummary[];\n readonly stopRationale?: string;\n /** The round's wall-clock and spend — its selection and every dispatch in it (#1507). */\n readonly durationMs?: number;\n readonly spend?: PlaybookSpend;\n /**\n * The first round of this run that began from the SAME input state (#1507) — tree, step results and\n * delivered set. Present only on a repeat: a lane spending without converging.\n */\n readonly sameInputStateAsIteration?: number;\n}\n\nexport interface PlaybookRunChoreographyChildSummary {\n readonly playbookRef: string;\n /**\n * Whether it re-ran over a landing the record already held: the recorded rerun verdict was REFRESH or CURRENT (a\n * landing re-opened), never FIRST_RUN (#3213). Absent when no verdict was recorded. Read from the KIND, because\n * {@link ranBecause} is a sentence written for a first run too (\"FIRST RUN — no landing of it is recorded\").\n */\n readonly reranOverLanding?: boolean;\n /**\n * Why it was on the table, in a sentence: a first run, a refresh and what moved (which family, re-landed\n * by which run, when), or a re-opening by a verdict (2026-10-01). The question a wasted round raises, kept\n * on the row because the board that answered it is gone once the round ends. Absent where it does not apply.\n */\n readonly ranBecause?: string;\n readonly landed: readonly string[];\n readonly failure?: string;\n /** Present when this child was itself a LANE (#1497). */\n readonly lane?: PlaybookRunLaneSummary;\n /** This dispatch's wall-clock and spend (#1507); a lane's covers its whole subtree. Absent on rows from before. */\n readonly durationMs?: number;\n readonly spend?: PlaybookSpend;\n}\n\n/**\n * A nested LANE as its parent's record keeps it: how it ended and how many rounds it took (#1497), and\n * since #1507 each round's cost and repeat marker, its children's tally and where it resumed.\n *\n * The rounds used to be dropped here as \"disposable run state, not a record\", which lost exactly the\n * thing #1507 exists for in the journey's real shape: the umbrella runs the build lane NESTED, so the\n * build lane's repeated dispatches over one state — the #1273 case — would reach the row as one\n * child's total. What is kept is the summarized round (duration, spend, repeat, children with their\n * failure and landings), bounded by the lane's own iteration ceiling; the objectives, reads and step\n * values stay disposable.\n */\nexport interface PlaybookRunLaneSummary {\n readonly stoppedBecause: string;\n readonly iterations: number;\n readonly rounds?: readonly PlaybookRunChoreographyIterationSummary[];\n readonly childTally?: readonly PlaybookRunChildTally[];\n readonly iterationsOverRepeatedState?: readonly number[];\n readonly resumedAfterIteration?: number;\n /**\n * Why each of the lane's children was not on the table when it stopped — the same rows the root's\n * {@link PlaybookRunChoreographySummary.unoffered} keeps. A stuck child is most often a LANE's child,\n * and its `REPEATS_FAILURE` row was dropped here until 2026-10-01, leaving it only in a trace event.\n */\n readonly unoffered?: readonly { readonly playbookRef: string; readonly reason: string; readonly detail: string }[];\n}\n\n/** The composite outcome a run record keeps — see {@link PlaybookRunTaskSummary.choreography}. */\nexport interface PlaybookRunChoreographySummary {\n /** The runtime's own stop vocabulary (`PlaybookChoreographyStopReason`), carried as its value. */\n readonly stoppedBecause: string;\n /** Specification files the children landed, in landing order. Empty is the finding a reader needs. */\n readonly landed: readonly string[];\n /**\n * Why each admitted child was NOT on the table, when the lane stopped for want of one (#1506).\n *\n * Absent for every other stop. Present, its first entries are the ones a creator can act on — an\n * unanswered interview — because the question a stopped lane raises is always \"and now what\".\n */\n readonly unoffered?: readonly { readonly playbookRef: string; readonly reason: string; readonly detail: string }[];\n /**\n * The lane boundaries' decisions, as the decision plane states them (#111) — one per boundary that\n * OWED a decision, the root composite's and every nested lane's, outermost first. This is the\n * NOTIFY half of a marked gate: a person reads them off the row and acts through the run and\n * revert doors.\n *\n * Typed as the payload rather than `unknown`: a reader that cannot tell a NOTIFY boundary from an\n * APPROVE_RESULT one without parsing prose is the shape this whole record exists to remove.\n */\n readonly boundaryDecisions?: readonly HumanDecision_Request[];\n readonly iterations: readonly PlaybookRunChoreographyIterationSummary[];\n /** Per child ref, summed over the run — see {@link PlaybookRunChildTally}. Absent on rows from before #1507. */\n readonly childTally?: readonly PlaybookRunChildTally[];\n /** Iterations that began from an input state an earlier iteration had already begun from, in order (#1507). Absent when none did. */\n readonly iterationsOverRepeatedState?: readonly number[];\n /**\n * Present on a composite RESUMED from a checkpoint: the iterations completed before it (#1507). They\n * ran in the previous run it resumed — whose own row carries whatever it recorded — so they are not in\n * this record's figures, and the totals say so by counting them as unobserved.\n */\n readonly resumedAfterIteration?: number;\n /** The run ended on an environmental failure and a re-run resumes it from its checkpoint. */\n readonly resumableFromCheckpoint: boolean;\n}\n\n/** A child's failure is kept, bounded: enough to say what went wrong, never a whole stack in a jsonb column. */\nconst CHOREOGRAPHY_FAILURE_LENGTH = 600;\n\nconst SPEND_MEASUREMENTS = new Set<string>(Object.values(PlaybookSpendMeasurement));\n\n/**\n * A spend figure read back from an envelope or a row — admitted only when it has the shape the runtime\n * writes, so a malformed value is ABSENT rather than rendered as a figure (#1507). Crossed a JSON\n * boundary, so every field is checked rather than cast.\n */\nexport function readRecordedPlaybookSpend(value: unknown): PlaybookSpend | undefined {\n if (typeof value !== 'object' || value === null) return undefined;\n const bag = value as Record<string, unknown>;\n const count = (key: string): number | undefined => (typeof bag[key] === 'number' && Number.isFinite(bag[key]) && (bag[key] as number) >= 0 ? bag[key] as number : undefined);\n const measurement = bag['measurement'];\n const modelCalls = count('modelCalls');\n const callsNotFullyMeasured = count('callsNotFullyMeasured');\n const unobservedSegments = count('unobservedSegments');\n if (typeof measurement !== 'string' || !SPEND_MEASUREMENTS.has(measurement)\n || modelCalls === undefined || callsNotFullyMeasured === undefined || unobservedSegments === undefined) return undefined;\n const rawCost = typeof bag['cost'] === 'object' && bag['cost'] !== null ? bag['cost'] as Record<string, unknown> : undefined;\n const cost = rawCost\n ? Object.fromEntries(Object.entries(rawCost).filter((entry): entry is [string, number] => typeof entry[1] === 'number' && Number.isFinite(entry[1])))\n : undefined;\n return {\n measurement: measurement as PlaybookSpendMeasurement,\n modelCalls,\n callsNotFullyMeasured,\n unobservedSegments,\n ...(count('inputTokens') !== undefined ? { inputTokens: count('inputTokens')! } : {}),\n ...(count('outputTokens') !== undefined ? { outputTokens: count('outputTokens')! } : {}),\n ...(count('totalTokens') !== undefined ? { totalTokens: count('totalTokens')! } : {}),\n ...(count('cacheReadTokens') !== undefined ? { cacheReadTokens: count('cacheReadTokens')! } : {}),\n ...(cost && Object.keys(cost).length > 0 ? { cost } : {}),\n ...(() => { const codingRuns = readRecordedBuildRowPart(bag['codingRuns']); return codingRuns ? { codingRuns } : {}; })(),\n ...(() => { const generationSteps = readRecordedBuildRowPart(bag['generationSteps']); return generationSteps ? { generationSteps } : {}; })(),\n };\n}\n\n/** A row's `PlaybookSpend.codingRuns` or `.generationSteps` (#2232), or `undefined` for a row without one (every row before it). */\nfunction readRecordedBuildRowPart(value: unknown): PlaybookSpendBuildRowPart | undefined {\n if (typeof value !== 'object' || value === null) return undefined;\n const bag = value as Record<string, unknown>;\n const count = (key: string): number | undefined => (typeof bag[key] === 'number' && Number.isFinite(bag[key]) && (bag[key] as number) >= 0 ? bag[key] as number : undefined);\n const runs = count('runs');\n const runsWithoutReportedCost = count('runsWithoutReportedCost');\n if (runs === undefined || runsWithoutReportedCost === undefined) return undefined;\n const rawCost = typeof bag['cost'] === 'object' && bag['cost'] !== null ? bag['cost'] as Record<string, unknown> : undefined;\n const cost = rawCost\n ? Object.fromEntries(Object.entries(rawCost).filter((entry): entry is [string, number] => typeof entry[1] === 'number' && Number.isFinite(entry[1])))\n : undefined;\n return {\n runs,\n runsWithoutReportedCost,\n ...(count('totalTokens') !== undefined ? { totalTokens: count('totalTokens')! } : {}),\n ...(count('cacheReadTokens') !== undefined ? { cacheReadTokens: count('cacheReadTokens')! } : {}),\n ...(cost && Object.keys(cost).length > 0 ? { cost } : {}),\n };\n}\n\nconst readDuration = (value: unknown): number | undefined => (typeof value === 'number' && Number.isFinite(value) && value >= 0 ? value : undefined);\n\n/**\n * Per child ref, summed over a composite's iterations (#1507) — computed from the SAME per-dispatch\n * figures the iterations carry, so the tally and the iterations cannot disagree. Ordered by dispatches,\n * most first: the child that ran most often is the one a reader of a looping lane looks for.\n */\nfunction tallyChoreographyChildren(iterations: readonly PlaybookRunChoreographyIterationSummary[]): readonly PlaybookRunChildTally[] {\n const byRef = new Map<string, { dispatches: number; failures: number; landings: number; durationMs: number; spends: PlaybookSpend[]; costs: (Readonly<Record<string, number>> | null)[] }>();\n for (const iteration of iterations) {\n for (const child of iteration.children) {\n const entry = byRef.get(child.playbookRef) ?? { dispatches: 0, failures: 0, landings: 0, durationMs: 0, spends: [], costs: [] };\n entry.dispatches += 1;\n if (child.failure !== undefined) entry.failures += 1;\n if (child.landed.length > 0) entry.landings += 1;\n entry.durationMs += child.durationMs ?? 0;\n if (child.spend) entry.spends.push(child.spend);\n entry.costs.push(child.spend?.cost ?? null);\n byRef.set(child.playbookRef, entry);\n }\n }\n return [...byRef.entries()]\n .map(([playbookRef, entry]) => ({\n playbookRef,\n dispatches: entry.dispatches,\n failures: entry.failures,\n landings: entry.landings,\n durationMs: entry.durationMs,\n ...(entry.spends.length > 0 ? { spend: mergePlaybookSpend(entry.spends) } : {}),\n ...(entry.costs.some((cost) => cost !== null) ? { costPerDispatch: entry.costs } : {}),\n }))\n .sort((left, right) => right.dispatches - left.dispatches || left.playbookRef.localeCompare(right.playbookRef));\n}\n\n/**\n * A composite's rounds as its record keeps them — for the root and, recursively, for every nested lane\n * (#1497, #1507). One summarizer for both, so a lane's round and the root's cannot be described two ways.\n */\nfunction summarizeChoreographyIterations(iterations: readonly Record<string, unknown>[]): PlaybookRunChoreographyIterationSummary[] {\n const strings = (value: unknown): string[] => (Array.isArray(value) ? value.filter((item): item is string => typeof item === 'string') : []);\n return iterations.map((iteration) => ({\n iteration: Number(iteration['iteration']),\n eligibleRefs: strings(iteration['eligibleRefs']),\n ...(strings(iteration['withheldAsCurrent']).length > 0 ? { withheldAsCurrent: strings(iteration['withheldAsCurrent']) } : {}),\n ...(strings(iteration['deferredForFirstRun']).length > 0 ? { deferredForFirstRun: strings(iteration['deferredForFirstRun']) } : {}),\n children: (Array.isArray(iteration['children']) ? iteration['children'] as Record<string, unknown>[] : []).map((child) => {\n const nested = typeof child['nested'] === 'object' && child['nested'] !== null ? child['nested'] as Record<string, unknown> : undefined;\n const childDuration = readDuration(child['durationMs']);\n const childSpend = readRecordedPlaybookSpend(child['spend']);\n const ranBecause = describeRecordedRerun(child['rerun'], child['reopenedInThisRun'] === true);\n const reranOverLanding = recordedRerunIsOverLanding(child['rerun']);\n return {\n playbookRef: String(child['playbookRef']),\n ...(ranBecause !== undefined ? { ranBecause } : {}),\n ...(reranOverLanding !== undefined ? { reranOverLanding } : {}),\n landed: strings(child['landed']),\n ...(typeof child['failure'] === 'string' ? { failure: child['failure'].slice(0, CHOREOGRAPHY_FAILURE_LENGTH) } : {}),\n ...(nested && typeof nested['stoppedBecause'] === 'string' ? { lane: summarizeLane(nested) } : {}),\n ...(childDuration !== undefined ? { durationMs: childDuration } : {}),\n ...(childSpend ? { spend: childSpend } : {}),\n };\n }),\n ...(typeof iteration['stopRationale'] === 'string' ? { stopRationale: iteration['stopRationale'] } : {}),\n ...(() => { const durationMs = readDuration(iteration['durationMs']); return durationMs !== undefined ? { durationMs } : {}; })(),\n ...(() => { const spend = readRecordedPlaybookSpend(iteration['spend']); return spend ? { spend } : {}; })(),\n ...(typeof iteration['sameInputStateAsIteration'] === 'number' ? { sameInputStateAsIteration: iteration['sameInputStateAsIteration'] } : {}),\n }));\n}\n\nconst RERUN_KINDS = new Set<string>(Object.values(PlaybookRerunKind));\n\n/**\n * A child's recorded rerun verdict, as the sentence a person reads — or nothing when the value is not one the\n * runtime writes. Crossed a JSON boundary, so the kind is checked rather than cast; the rest of the sentence is\n * built by the runtime's own describer, so the record and the selector's prompt cannot word one verdict twice.\n */\nfunction describeRecordedRerun(value: unknown, reopenedInThisRun: boolean): string | undefined {\n if (typeof value !== 'object' || value === null || !RERUN_KINDS.has(String((value as { kind?: unknown }).kind))) return undefined;\n const described = describePlaybookRerun(value as PlaybookRerunVerdict);\n if (described === undefined) return undefined;\n return reopenedInThisRun ? `RE-OPENED by a verdict in this run (it was ${described})` : described;\n}\n\n/**\n * Whether a child's recorded rerun verdict re-ran it over a landing the record held (REFRESH, or a CURRENT landing a\n * verdict re-opened) — `undefined` when no valid verdict was recorded. A FIRST_RUN had nothing to stand (#3213).\n */\nfunction recordedRerunIsOverLanding(value: unknown): boolean | undefined {\n const kind = typeof value === 'object' && value !== null ? String((value as { kind?: unknown }).kind) : undefined;\n if (kind === undefined || !RERUN_KINDS.has(kind)) return undefined;\n return kind === PlaybookRerunKind.REFRESH || kind === PlaybookRerunKind.CURRENT;\n}\n\n/** The rounds that began from a state an earlier round of the same run began from, in order. */\nfunction roundsOverRepeatedState(rounds: readonly PlaybookRunChoreographyIterationSummary[]): number[] {\n return rounds.filter((round) => round.sameInputStateAsIteration !== undefined).map((round) => round.iteration);\n}\n\n/** Whether any round or dispatch carries a figure — a row from before #1507 carries none and gets no tally. */\nfunction roundsCarryMeasurement(rounds: readonly PlaybookRunChoreographyIterationSummary[]): boolean {\n return rounds.some((round) => round.spend !== undefined || round.children.some((child) => child.spend !== undefined));\n}\n\n/** The unoffered rows of a lane or of the root, as the record keeps them. */\nfunction summarizeUnoffered(value: unknown): { readonly playbookRef: string; readonly reason: string; readonly detail: string }[] {\n return (Array.isArray(value) ? value as Record<string, unknown>[] : []).map((entry) => ({\n playbookRef: String(entry['playbookRef']),\n reason: String(entry['reason']),\n detail: String(entry['detail']),\n }));\n}\n\n/** A nested lane, as its parent's record keeps it — see {@link PlaybookRunLaneSummary}. */\nfunction summarizeLane(nested: Record<string, unknown>): PlaybookRunLaneSummary {\n const raw = Array.isArray(nested['iterations']) ? nested['iterations'] as Record<string, unknown>[] : [];\n const rounds = summarizeChoreographyIterations(raw);\n const repeated = roundsOverRepeatedState(rounds);\n const resumed = nested['resumedAfterIteration'];\n const unoffered = summarizeUnoffered(nested['unoffered']);\n return {\n stoppedBecause: String(nested['stoppedBecause']),\n iterations: raw.length,\n ...(unoffered.length > 0 ? { unoffered } : {}),\n ...(roundsCarryMeasurement(rounds) ? { rounds, childTally: tallyChoreographyChildren(rounds) } : {}),\n ...(repeated.length > 0 ? { iterationsOverRepeatedState: repeated } : {}),\n ...(typeof resumed === 'number' && resumed > 0 ? { resumedAfterIteration: resumed } : {}),\n };\n}\n\nfunction summarizeChoreography(envelope: Record<string, unknown>): PlaybookRunChoreographySummary | undefined {\n if (envelope['choreographed'] !== true) return undefined;\n const strings = (value: unknown): string[] => (Array.isArray(value) ? value.filter((item): item is string => typeof item === 'string') : []);\n const iterations = Array.isArray(envelope['iterations']) ? envelope['iterations'] as Record<string, unknown>[] : [];\n /*\n * WHY nothing was on the table, when that is why the run ended (#1506).\n *\n * Kept in the record rather than only in the HTTP response, because the response is read once and\n * the record is what an operator comes back to. Bounded by the composite's own `admits`, and the\n * detail is a sentence the runtime already composed — there is nothing here to truncate.\n */\n const unoffered = summarizeUnoffered(envelope['unoffered']);\n const summarizedIterations = summarizeChoreographyIterations(iterations);\n const repeated = roundsOverRepeatedState(summarizedIterations);\n const measuredAny = roundsCarryMeasurement(summarizedIterations);\n return {\n stoppedBecause: String(envelope['stoppedBecause']),\n landed: strings(envelope['landed']),\n ...(unoffered.length > 0 ? { unoffered } : {}),\n iterations: summarizedIterations,\n ...(measuredAny ? { childTally: tallyChoreographyChildren(summarizedIterations) } : {}),\n ...(repeated.length > 0 ? { iterationsOverRepeatedState: repeated } : {}),\n ...(() => {\n const resumed = (envelope['resumedFrom'] as { completedIterations?: unknown } | undefined)?.completedIterations;\n return typeof resumed === 'number' && resumed > 0 ? { resumedAfterIteration: resumed } : {};\n })(),\n resumableFromCheckpoint: envelope['resumableFromCheckpoint'] === true,\n ...(() => {\n const decisions = envelope['boundaryDecisions'];\n if (!Array.isArray(decisions) || decisions.length === 0) return {};\n // Parsed rather than cast: the row is read back by a person's client, and a malformed entry\n // must be absent rather than served as a decision nobody can answer.\n const parsed = decisions.map((entry) => HumanDecision_RequestSchema.safeParse(entry)).filter((entry) => entry.success).map((entry) => entry.data);\n return parsed.length > 0 ? { boundaryDecisions: parsed } : {};\n })(),\n };\n}\n\n/**\n * A run's choreography, from a live result envelope or from the summary a settled row carries (#2530) — one reader for\n * both, as for the judge's verdict. `undefined` for a run of a single playbook.\n */\nexport function readPlaybookRunChoreography(result: unknown): PlaybookRunChoreographySummary | undefined {\n if (typeof result !== 'object' || result === null) return undefined;\n if (isPlaybookRunTaskSummary(result)) return (result as PlaybookRunTaskSummary).choreography;\n return summarizeChoreography(result as Record<string, unknown>);\n}\n\n/**\n * A composite run's rounds as the workbench's run row carries them (#2530): the run's own in order, each followed by\n * the rounds of every lane one of its children ran, depth first. A lane's round names the round whose child ran it and\n * that child, so the flat list keeps every depth the record keeps (a lane's rounds are kept when they were measured,\n * which every run since #1507 is).\n */\nexport function playbookRunRoundsOf(choreography: PlaybookRunChoreographySummary): Workbench_PlaybookRunRound[] {\n const rounds: Workbench_PlaybookRunRound[] = [];\n const visit = (iterations: readonly PlaybookRunChoreographyIterationSummary[], lane?: { readonly roundKey: string; readonly playbookRef: string }): void => {\n for (const iteration of iterations) {\n const roundKey = lane ? `${lane.roundKey}/${lane.playbookRef}/${iteration.iteration}` : String(iteration.iteration);\n rounds.push({\n roundKey,\n parentRoundKey: lane?.roundKey ?? null,\n lanePlaybookRef: lane?.playbookRef ?? null,\n iteration: iteration.iteration,\n sameInputStateAsIteration: iteration.sameInputStateAsIteration ?? null,\n stopRationale: iteration.stopRationale ?? null,\n children: iteration.children.map((child) => ({\n playbookRef: child.playbookRef,\n ranBecause: child.ranBecause ?? null,\n reranOverLanding: child.reranOverLanding ?? null,\n landed: [...child.landed],\n failure: child.failure ?? null,\n })),\n });\n for (const child of iteration.children) {\n if (child.lane?.rounds) visit(child.lane.rounds, { roundKey, playbookRef: child.playbookRef });\n }\n }\n };\n visit(choreography.iterations);\n return rounds;\n}\n\n/**\n * What a settled run writes on its own task. `measurement` is the host's reading of the run as a whole\n * (#1507), passed beside the result rather than carried on it: the result object is the key the\n * suspension registry is looked up by, so it cannot be copied to add a field.\n */\nexport function summarizePlaybookRunResult(\n result: unknown,\n measurement?: PlaybookRunMeasurement,\n /** The root runs this one overlapped (#1610); omitted, or empty, writes nothing. */\n overlappedRuns?: readonly PlaybookRunOverlap[],\n): PlaybookRunTaskSummary {\n const envelope = (typeof result === 'object' && result !== null ? result : {}) as Record<string, unknown>;\n const suspended = envelope['status'] === Workbench_PlaybookRunOutcomeStatus.AWAITING_CREATOR_INPUT;\n return {\n accepted: typeof envelope['accepted'] === 'boolean' ? envelope['accepted'] : null,\n dryRun: envelope['dryRun'] === true,\n ...readPlaybookRunJudgeVerdict(result),\n ...(suspended ? { awaitingCreatorInput: { family: String(envelope['family']), round: Number(envelope['round']) } } : {}),\n ...(() => { const choreography = summarizeChoreography(envelope); return choreography ? { choreography } : {}; })(),\n ...(measurement ? { measurement } : {}),\n ...(overlappedRuns && overlappedRuns.length > 0 ? { overlappedRuns } : {}),\n };\n}\n\n/**\n * The measurement a row's task summary carries, read back for the runs read (#1507) — the run's own,\n * and for a composite its per-iteration and per-child figures. Read from the ROW, never from a live\n * envelope, so a reader after a restart sees exactly what one before it saw. A run that threw carries\n * it beside its `failure` and is read the same way. `undefined` for a row that carries none: written\n * before #1507, or settled ABORTED because its process stopped before the run could.\n */\nexport function readPlaybookRunMeasurement(taskOutput: unknown): PlaybookSettledRunMeasurement | undefined {\n if (typeof taskOutput !== 'object' || taskOutput === null) return undefined;\n const summary = taskOutput as { measurement?: { durationMs?: unknown; spend?: unknown }; choreography?: PlaybookRunChoreographySummary };\n const durationMs = readDuration(summary.measurement?.durationMs);\n const spend = readRecordedPlaybookSpend(summary.measurement?.spend);\n if (durationMs === undefined || spend === undefined) return undefined;\n const choreography = summary.choreography;\n return {\n durationMs,\n spend,\n ...(choreography && Array.isArray(choreography.iterations) ? { iterations: measureRounds(choreography.iterations) } : {}),\n ...(choreography?.childTally ? { childTally: choreography.childTally } : {}),\n ...(choreography?.iterationsOverRepeatedState ? { iterationsOverRepeatedState: choreography.iterationsOverRepeatedState } : {}),\n ...(choreography?.resumedAfterIteration !== undefined ? { resumedAfterIteration: choreography.resumedAfterIteration } : {}),\n };\n}\n\n/** The measurement view of a composite's rounds — recursive through nested lanes (#1507). */\nfunction measureRounds(rounds: readonly PlaybookRunChoreographyIterationSummary[]): PlaybookRoundMeasurement[] {\n return rounds.map((round) => ({\n iteration: round.iteration,\n ...(round.withheldAsCurrent ? { withheldAsCurrent: round.withheldAsCurrent } : {}),\n ...(round.deferredForFirstRun ? { deferredForFirstRun: round.deferredForFirstRun } : {}),\n ...(round.durationMs !== undefined ? { durationMs: round.durationMs } : {}),\n ...(round.spend ? { spend: round.spend } : {}),\n ...(round.sameInputStateAsIteration !== undefined ? { sameInputStateAsIteration: round.sameInputStateAsIteration } : {}),\n children: (round.children ?? []).map((child) => ({\n playbookRef: child.playbookRef,\n ...(child.ranBecause !== undefined ? { ranBecause: child.ranBecause } : {}),\n failed: child.failure !== undefined,\n landedCount: child.landed.length,\n ...(child.durationMs !== undefined ? { durationMs: child.durationMs } : {}),\n ...(child.spend ? { spend: child.spend } : {}),\n ...(child.lane ? {\n lane: {\n playbookRef: child.playbookRef,\n stoppedBecause: child.lane.stoppedBecause,\n iterations: child.lane.iterations,\n ...(child.lane.rounds ? { rounds: measureRounds(child.lane.rounds) } : {}),\n ...(child.lane.childTally ? { childTally: child.lane.childTally } : {}),\n ...(child.lane.iterationsOverRepeatedState ? { iterationsOverRepeatedState: child.lane.iterationsOverRepeatedState } : {}),\n ...(child.lane.resumedAfterIteration !== undefined ? { resumedAfterIteration: child.lane.resumedAfterIteration } : {}),\n },\n } : {}),\n })),\n }));\n}\n\n/** One round of a settled run's measurement — the root's or a nested lane's (#1507). */\nexport interface PlaybookRoundMeasurement {\n readonly iteration: number;\n readonly withheldAsCurrent?: readonly string[];\n readonly deferredForFirstRun?: readonly string[];\n readonly durationMs?: number;\n readonly spend?: PlaybookSpend;\n readonly sameInputStateAsIteration?: number;\n readonly children: readonly {\n readonly playbookRef: string;\n /** See {@link PlaybookRunChoreographyChildSummary.ranBecause}. */\n readonly ranBecause?: string;\n readonly failed: boolean;\n readonly landedCount: number;\n readonly durationMs?: number;\n readonly spend?: PlaybookSpend;\n /** Present when the child was a nested LANE: its own rounds, tally and repeats. */\n readonly lane?: PlaybookLaneMeasurement;\n }[];\n}\n\n/** A nested lane's measurement, as the runs read serves it (#1507). */\nexport interface PlaybookLaneMeasurement {\n readonly playbookRef: string;\n readonly stoppedBecause: string;\n readonly iterations: number;\n readonly rounds?: readonly PlaybookRoundMeasurement[];\n readonly childTally?: readonly PlaybookRunChildTally[];\n readonly iterationsOverRepeatedState?: readonly number[];\n readonly resumedAfterIteration?: number;\n}\n\n/** What the runs read serves about a settled run's cost (#1507) — see {@link readPlaybookRunMeasurement}. */\nexport interface PlaybookSettledRunMeasurement extends PlaybookRunMeasurement {\n readonly iterations?: readonly PlaybookRoundMeasurement[];\n readonly childTally?: readonly PlaybookRunChildTally[];\n readonly iterationsOverRepeatedState?: readonly number[];\n readonly resumedAfterIteration?: number;\n}\n\n/**\n * The slice of an execution row the runs read needs — a full platform row satisfies it.\n *\n * `createdAt` / `finishedAt` are the stored row's DATES (#2187). Every comparison and record here uses\n * their ISO-`Z` form, so they order against the other ISO-`Z` instants this file compares them with\n * (`suspension.suspendedAt`, a run's own start and end). The rows used to carry local-offset text,\n * which compared against a `Z` string by characters, not by time.\n */\nexport interface PlaybookRunExecutionRow {\n readonly _id: string;\n readonly status: FlowsActors_Status;\n readonly createdAt: Date;\n readonly finishedAt?: Date;\n readonly suspension?: { readonly suspendedAt?: string } | null;\n /** The single-flight subject the run holds while it runs (#1361) — how the read tells a composite from an ordinary run. */\n readonly exclusiveSubject?: string;\n readonly standaloneTasks: ReadonlyArray<{\n readonly context?: { readonly correlation?: { readonly refs?: Readonly<Record<string, string>> } };\n readonly output?: unknown;\n }>;\n}\n\nexport interface PlaybookRunningRecord {\n readonly runId: string;\n readonly playbookRef: string;\n /** The playbook INSTANCE (#1609), read from the row's correlation; absent for the default instance. */\n readonly instanceKey?: string;\n readonly startedAt: string;\n readonly traceSessionId?: string;\n /** The creation conversation the run was started from, when it was (#1454) — read from the same envelope. */\n readonly conversationId?: string;\n /** Present on a RUNNING record only: what the run holds exclusively, if anything. */\n readonly exclusiveSubject?: string;\n}\n\nexport interface PlaybookSettledRunRecord extends PlaybookRunningRecord {\n readonly finishedAt: string;\n readonly ok: boolean;\n readonly result?: unknown;\n readonly error?: string;\n readonly awaitingCreatorInput?: { readonly runId: string; readonly family: string; readonly round: number };\n /**\n * True on a run that did not conclude because the ENVIRONMENT took it (#3235): its error is a lost network, a wake\n * that aborted a model call, an infrastructure kill, an account condition (`isEnvironmentalPlaybookFailure`). Such a\n * run is INTERRUPTED, never REFUSED: nothing about the work was judged, and running it again resumes it (a thrown\n * composite keeps its checkpoint). Measured on app-creation-test-007: `REFUSED cross_cutting.compliance … Delay was\n * aborted`, the instant the machine woke.\n */\n readonly interruptedByEnvironment?: true;\n /** Duration and spend, and for a composite per iteration and per child (#1507). Read from the row. */\n readonly measurement?: PlaybookSettledRunMeasurement;\n /** The other root runs it overlapped (#1610), read from its row. */\n readonly overlappedRuns?: readonly PlaybookRunOverlap[];\n}\n\n/**\n * The runs read, from the rows.\n *\n * - **running**: every execution still `PROCESSING` — and since #1358 that is every run, synchronous\n * or detached, composite or not. Until this existed a synchronous non-composite run was reported\n * NOWHERE while it ran.\n * - **settled**: the most recent execution per playbook INSTANCE that is no longer running (#1609): one\n * per `<ref>` for the default instance and per `<ref>@<key>` for another, so a second instance\n * settling never hides the first one's outcome. \"What happened to the run I submitted\", not a history. A run WAITING\n * on a person is settled-and-ok with `awaitingCreatorInput` — a suspension did not throw, and the\n * field exists precisely so `ok: true` is not read as \"finished\".\n *\n * `ok` is \"did not fail\": `COMPLETED` or waiting. `ABORTED` (a restart) and `CANCELLED` are not ok,\n * and say why in `error`, because a reader polling for its run must not take a run the host lost\n * for one that worked.\n *\n * `enrich` hands back the full result envelope for a run THIS process ran; a row from before a\n * restart has only its summary, which is returned as `result` so a reader sees the verdict either way.\n */\nexport function projectPlaybookRunRecords(\n executions: readonly PlaybookRunExecutionRow[],\n enrich: (runId: string) => unknown | undefined = () => undefined,\n): { readonly running: readonly PlaybookRunningRecord[]; readonly settled: readonly PlaybookSettledRunRecord[] } {\n const running: PlaybookRunningRecord[] = [];\n const settledByInstance = new Map<string, PlaybookSettledRunRecord>();\n const newestFirst = [...executions].sort((left, right) => right.createdAt.getTime() - left.createdAt.getTime());\n for (const execution of newestFirst) {\n const task = execution.standaloneTasks[0];\n const refs = task?.context?.correlation?.refs;\n const playbookRef = refs?.['playbookRef'];\n // A row that names no playbook is not a playbook run this read can describe (the judge and the\n // generator run under the same system); skipped rather than reported under an invented ref.\n if (typeof playbookRef !== 'string') continue;\n const instanceKey = typeof refs?.['instanceKey'] === 'string' ? refs['instanceKey'] : undefined;\n const instanceId = playbookInstanceId(playbookRef, instanceKey);\n const base: PlaybookRunningRecord = {\n runId: execution._id,\n playbookRef,\n ...(instanceKey !== undefined ? { instanceKey } : {}),\n startedAt: execution.createdAt.toISOString(),\n ...(typeof refs?.['traceSessionId'] === 'string' ? { traceSessionId: refs['traceSessionId'] } : {}),\n ...(typeof refs?.['conversationId'] === 'string' ? { conversationId: refs['conversationId'] } : {}),\n };\n if (execution.status === FlowsActors_Status.PROCESSING || execution.status === FlowsActors_Status.PENDING) {\n running.push({ ...base, ...(execution.exclusiveSubject !== undefined ? { exclusiveSubject: execution.exclusiveSubject } : {}) });\n continue;\n }\n if (settledByInstance.has(instanceId)) continue;\n const output = (typeof task?.output === 'object' && task.output !== null ? task.output : {}) as {\n failure?: { message?: unknown };\n awaitingCreatorInput?: { family?: unknown; round?: unknown };\n };\n const waiting = execution.status === FlowsActors_Status.AWAITING_APPROVAL;\n const ok = execution.status === FlowsActors_Status.COMPLETED || waiting;\n const failureMessage = typeof output.failure?.message === 'string' ? output.failure.message : undefined;\n const enriched = enrich(execution._id);\n const measurement = readPlaybookRunMeasurement(task?.output);\n const overlappedRuns = readPlaybookRunOverlaps(task?.output);\n settledByInstance.set(instanceId, {\n ...base,\n finishedAt: execution.finishedAt?.toISOString() ?? execution.suspension?.suspendedAt ?? execution.createdAt.toISOString(),\n ok,\n ...(ok ? { result: enriched !== undefined ? enriched : task?.output } : {}),\n ...(ok ? {} : { error: failureMessage ?? `The run ended ${execution.status} without concluding.` }),\n ...(!ok && failureMessage !== undefined && isEnvironmentalPlaybookFailure(failureMessage) ? { interruptedByEnvironment: true as const } : {}),\n ...(waiting && output.awaitingCreatorInput\n ? { awaitingCreatorInput: { runId: execution._id, family: String(output.awaitingCreatorInput.family), round: Number(output.awaitingCreatorInput.round) } }\n : {}),\n ...(measurement ? { measurement } : {}),\n ...(overlappedRuns ? { overlappedRuns } : {}),\n });\n }\n return { running, settled: [...settledByInstance.values()] };\n}\n\n/**\n * What the unattended playbook LOOP writes on its own row (#1507): why it stopped, how many steps it\n * took, and what those steps took and spent — per step, per lane, and which steps began from a working\n * tree an earlier step had already begun from. The loop is the other lane that iterates, and the only\n * one whose selection calls land on no run row, so without this its spend was recorded nowhere.\n */\nexport function summarizePlaybookLoopResult(result: {\n readonly stoppedBecause: string;\n /** Where the environment stopped the loop, when it did (#3235); kept on the row so a later reader sees it too. */\n readonly interruption?: PlaybookLoopInterruption;\n readonly durationMs: number;\n readonly spend: PlaybookSpend;\n readonly steps: ReadonlyArray<{\n readonly iteration: number;\n readonly durationMs: number;\n readonly spend: PlaybookSpend;\n readonly sameInputStateAsIteration?: number;\n readonly lanes: ReadonlyArray<{ readonly playbookRef: string; readonly landed?: readonly string[]; readonly failure?: string; readonly durationMs: number; readonly spend: PlaybookSpend }>;\n }>;\n}): Record<string, unknown> {\n const repeated = result.steps.filter((step) => step.sameInputStateAsIteration !== undefined).map((step) => step.iteration);\n return {\n stoppedBecause: result.stoppedBecause,\n ...(result.interruption ? { interruption: { ...result.interruption, failure: result.interruption.failure.slice(0, 500) } } : {}),\n stepCount: result.steps.length,\n measurement: { durationMs: result.durationMs, spend: result.spend },\n steps: result.steps.map((step) => ({\n iteration: step.iteration,\n durationMs: step.durationMs,\n spend: step.spend,\n ...(step.sameInputStateAsIteration !== undefined ? { sameInputStateAsIteration: step.sameInputStateAsIteration } : {}),\n lanes: step.lanes.map((lane) => ({\n playbookRef: lane.playbookRef,\n failed: lane.failure !== undefined,\n landedCount: lane.landed?.length ?? 0,\n durationMs: lane.durationMs,\n spend: lane.spend,\n })),\n })),\n ...(repeated.length > 0 ? { iterationsOverRepeatedState: repeated } : {}),\n };\n}\n\n/** The newest playbook LOOP, as the runs read serves it (#1507). */\nexport interface PlaybookLoopRunRecord {\n readonly runId: string;\n readonly startedAt: string;\n readonly finishedAt?: string;\n readonly status: FlowsActors_Status;\n readonly stoppedBecause?: string;\n readonly stepCount?: number;\n readonly error?: string;\n /** The loop's wall-clock and spend; absent on a row from before #1507. */\n readonly measurement?: PlaybookRunMeasurement;\n /** Steps that began from a tree an earlier step began from. */\n readonly iterationsOverRepeatedState?: readonly number[];\n readonly steps?: ReadonlyArray<{\n readonly iteration: number;\n readonly durationMs?: number;\n readonly spend?: PlaybookSpend;\n readonly sameInputStateAsIteration?: number;\n /** Each lane the step ran, with its own figures — the per-lane view the loop row writes (#1507). */\n readonly lanes?: ReadonlyArray<{ readonly playbookRef: string; readonly failed: boolean; readonly landedCount: number; readonly durationMs?: number; readonly spend?: PlaybookSpend }>;\n }>;\n}\n\n/**\n * The newest unattended LOOP among the meta-workflows executions (#1507) — the reader of what\n * `summarizePlaybookLoopResult` writes. The loop is not a playbook run (its task names no playbook, so\n * the runs projection skips it), and without this its selection spend and repeated steps would be\n * written and read by nothing.\n *\n * A loop's task is recognised by its actor: `actors.actorRef` on a platform row, `actorRef` on the\n * in-memory plane's rows the lane's tests drive — both are read, so the recognition is the same either way.\n */\nexport function projectLastPlaybookLoop(executions: readonly PlaybookRunExecutionRow[]): PlaybookLoopRunRecord | null {\n return projectPlaybookLoops(executions)[0] ?? null;\n}\n\n/** EVERY unattended loop among the executions, newest first — the run report reads them all (#2231). */\nexport function projectPlaybookLoops(executions: readonly PlaybookRunExecutionRow[]): PlaybookLoopRunRecord[] {\n const loops: PlaybookLoopRunRecord[] = [];\n const newestFirst = [...executions].sort((left, right) => right.createdAt.getTime() - left.createdAt.getTime());\n for (const execution of newestFirst) {\n const task = execution.standaloneTasks[0] as (PlaybookRunExecutionRow['standaloneTasks'][number] & { actors?: { actorRef?: unknown }; actorRef?: unknown }) | undefined;\n const actorRef = task?.actors?.actorRef ?? task?.actorRef;\n if (actorRef !== META_WORKFLOWS_PLAYBOOK_LOOP_ACTOR_REF) continue;\n const output = (typeof task?.output === 'object' && task.output !== null ? task.output : {}) as Record<string, unknown>;\n const measurement = (() => {\n const raw = output['measurement'] as { durationMs?: unknown; spend?: unknown } | undefined;\n const durationMs = readDuration(raw?.durationMs);\n const spend = readRecordedPlaybookSpend(raw?.spend);\n return durationMs !== undefined && spend ? { durationMs, spend } : undefined;\n })();\n const steps = Array.isArray(output['steps']) ? (output['steps'] as Record<string, unknown>[]).map((step) => ({\n iteration: Number(step['iteration']),\n ...(readDuration(step['durationMs']) !== undefined ? { durationMs: readDuration(step['durationMs'])! } : {}),\n ...(() => { const spend = readRecordedPlaybookSpend(step['spend']); return spend ? { spend } : {}; })(),\n ...(typeof step['sameInputStateAsIteration'] === 'number' ? { sameInputStateAsIteration: step['sameInputStateAsIteration'] } : {}),\n ...(Array.isArray(step['lanes']) ? {\n lanes: (step['lanes'] as Record<string, unknown>[]).map((lane) => ({\n playbookRef: String(lane['playbookRef']),\n failed: lane['failed'] === true,\n landedCount: typeof lane['landedCount'] === 'number' ? lane['landedCount'] : 0,\n ...(readDuration(lane['durationMs']) !== undefined ? { durationMs: readDuration(lane['durationMs'])! } : {}),\n ...(() => { const spend = readRecordedPlaybookSpend(lane['spend']); return spend ? { spend } : {}; })(),\n })),\n } : {}),\n })) : undefined;\n const failure = (output['failure'] as { message?: unknown } | undefined)?.message;\n const repeated = Array.isArray(output['iterationsOverRepeatedState']) ? (output['iterationsOverRepeatedState'] as unknown[]).filter((entry): entry is number => typeof entry === 'number') : [];\n loops.push({\n runId: execution._id,\n startedAt: execution.createdAt.toISOString(),\n ...(execution.finishedAt ? { finishedAt: execution.finishedAt.toISOString() } : {}),\n status: execution.status,\n ...(typeof output['stoppedBecause'] === 'string' ? { stoppedBecause: output['stoppedBecause'] } : {}),\n ...(typeof output['stepCount'] === 'number' ? { stepCount: output['stepCount'] } : {}),\n ...(typeof failure === 'string' ? { error: failure } : {}),\n ...(measurement ? { measurement } : {}),\n ...(repeated.length > 0 ? { iterationsOverRepeatedState: repeated } : {}),\n ...(steps ? { steps } : {}),\n });\n }\n return loops;\n}\n\n"]}
|
|
1
|
+
{"version":3,"file":"playbook-run-record.models.js","sourceRoot":"","sources":["../../../../src/meta-workflows/models/playbook-run-record.models.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,2BAA2B,EAA8B,MAAM,uBAAuB,CAAC;AACpH,OAAO,EACL,iBAAiB,EACjB,wBAAwB,EACxB,qBAAqB,EACrB,kBAAkB,GAKnB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,kCAAkC,EAAmC,MAAM,gCAAgC,CAAC;AACrH,OAAO,EAAE,kBAAkB,EAAE,MAAM,oDAAoD,CAAC;AAExF,OAAO,EAAE,sCAAsC,EAAE,MAAM,8BAA8B,CAAC;AACtF,OAAO,EAAE,8BAA8B,EAAE,MAAM,oCAAoC,CAAC;AA4BpF;;;;GAIG;AACH,MAAM,UAAU,2BAA2B,CAAC,MAAe;IACzD,MAAM,IAAI,GAAG,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC;IAC7E,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAC/D,2FAA2F;IAC3F,6FAA6F;IAC7F,IAAI,wBAAwB,CAAC,MAAM,CAAC,EAAE,CAAC;QACrC,MAAM,OAAO,GAAG,MAAiC,CAAC;QAClD,OAAO,EAAE,YAAY,EAAE,OAAO,CAAC,YAAY,EAAE,aAAa,EAAE,OAAO,CAAC,aAAa,IAAI,IAAI,EAAE,YAAY,EAAE,OAAO,CAAC,YAAY,EAAE,CAAC;IAClI,CAAC;IACD,MAAM,KAAK,GAAI,MAA8B,CAAC,KAAK,CAAC;IACpD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAC7D,MAAM,EAAE,MAAM,EAAE,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,EAAE,MAAM,CAAC,gBAAgB,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACrG,GAAG,CAAC,OAAO,MAAM,CAAC,WAAW,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACtF,GAAG,CAAC,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC1D,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACvC,GAAG,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,2BAA2B,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACzE,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAC5B,CAAC,CAAC;IACL,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["import { FlowsActors_Status, HumanDecision_RequestSchema, type HumanDecision_Request } from '@wildo-ai/saas-models';\nimport {\n PlaybookRerunKind,\n PlaybookSpendMeasurement,\n describePlaybookRerun,\n mergePlaybookSpend,\n type PlaybookLoopInterruption,\n type PlaybookRerunVerdict,\n type PlaybookSpend,\n type PlaybookSpendBuildRowPart,\n} from '@wildo-ai/application-creation-runtime';\nimport { Workbench_PlaybookRunOutcomeStatus, type Workbench_PlaybookRunRound } from '@wildo-ai/platform-core-shared';\nimport { playbookInstanceId } from '@wildo-ai/saas-specifications/application-creation';\n\nimport { META_WORKFLOWS_PLAYBOOK_LOOP_ACTOR_REF } from './meta-workflows-lane.models';\nimport { isEnvironmentalPlaybookFailure } from './playbook-loop-environment.models';\n\n/**\n * WHAT A PLAYBOOK RUN SAYS ABOUT ITSELF ON ITS OWN ROW, and how the runs read is derived from rows\n * (#1362).\n *\n * ## Why this exists\n *\n * Since #1358 a playbook run is an actor-system execution with one task. The ROW said that the run\n * happened and how it ended; what the run DID — accepted or not, what the judge thought, whether it\n * stopped to ask — lived only in an in-process map (`lastCompletedDetachedRuns`), one entry per\n * playbook ref. A companion restart emptied it, so the creation board's timeline forgot every\n * completed run while the rows that proved them sat unread one table over. The map was defended as a\n * per-run cache whose loss \"costs the summary and no fact\"; the summary is what the board renders.\n *\n * So the run writes a SUMMARY on its task when it settles — small, and sufficient for a reader that\n * was not there — and the runs read is a projection of the rows. The full result envelope (review\n * guide, landed paths) stays what it was: an in-process enrichment a poller gets from the process\n * that ran the run, and nobody else needs.\n */\n\n/** The judge's verdict as a reader renders it — all `null` when the run had no judge. */\nexport interface PlaybookRunJudgeSummary {\n readonly judgeOverall: string | null;\n readonly judgeCriteria: ReadonlyArray<{ readonly criterionRef: string; readonly verdict: string; readonly rationale: string }> | null;\n readonly judgeSkipped: string | null;\n}\n\n/**\n * Read a run result's judge block. ONE reader, used when the summary is written and when a live\n * result is rendered, so a row and a live record cannot describe one verdict two ways. A result\n * envelope without a judge (a playbook with no evaluation treatment, a dry run) answers all null.\n */\nexport function readPlaybookRunJudgeVerdict(result: unknown): PlaybookRunJudgeSummary {\n const none = { judgeOverall: null, judgeCriteria: null, judgeSkipped: null };\n if (typeof result !== 'object' || result === null) return none;\n // A row read back after a restart carries the SUMMARY this function once produced, not the\n // envelope; it is returned as it was written rather than re-derived from a `judge` it lacks.\n if (isPlaybookRunTaskSummary(result)) {\n const summary = result as PlaybookRunJudgeSummary;\n return { judgeOverall: summary.judgeOverall, judgeCriteria: summary.judgeCriteria ?? null, judgeSkipped: summary.judgeSkipped };\n }\n const judge = (result as { judge?: unknown }).judge;\n if (typeof judge !== 'object' || judge === null) return none;\n const { judged, overall, criteria, skipped } = judge as { judged?: unknown; overall?: unknown; criteria?: unknown; skipped?: unknown };\n if (judged === true && typeof overall === 'string') {\n return {\n judgeOverall: overall,\n judgeCriteria: Array.isArray(criteria)\n ? criteria.map((entry) => ({\n criterionRef: String((entry as { criterionRef?: unknown }).criterionRef ?? ''),\n verdict: String((entry as { verdict?: unknown }).verdict ?? ''),\n rationale: String((entry as { rationale?: unknown }).rationale ?? ''),\n }))\n : [],\n judgeSkipped: null,\n };\n }\n return { judgeOverall: null, judgeCriteria: null, judgeSkipped: typeof skipped === 'string' && skipped.length > 0 ? skipped : null };\n}\n\n/**\n * Whether a run result is the SUMMARY a settled row carries ({@link summarizePlaybookRunResult}) rather than a live\n * envelope. The summary always carries the judge's two keys, which no envelope does; every reader that accepts either\n * asks this one question, so a row and a live record cannot be told apart two ways.\n */\nfunction isPlaybookRunTaskSummary(result: object): boolean {\n return 'judgeOverall' in result && 'judgeSkipped' in result;\n}\n\n/** What a settled run's task `output` carries. A THROWN run carries the engine's `{ failure }` instead. */\nexport interface PlaybookRunTaskSummary extends PlaybookRunJudgeSummary {\n /** Whether the run's output was accepted into the workspace; `null` when the envelope does not say. */\n readonly accepted: boolean | null;\n readonly dryRun: boolean;\n /** Present on a run that STOPPED TO ASK: which family it is asking about, and which round. */\n readonly awaitingCreatorInput?: { readonly family: string; readonly round: number };\n /**\n * Present on a COMPOSITE run: why it stopped, what its children landed, and each iteration's children.\n *\n * A composite authors nothing itself, so its judge fields are always empty and `accepted` is always false —\n * without this block a composite that landed nothing reads exactly like one that landed everything. Measured\n * 2026-09-21 in the end-to-end run (#1273): `top_down.market-analysis` ran three research rounds, settled\n * COMPLETED with `ok: true`, landed no market snapshot, and nothing anywhere recorded why it stopped.\n */\n readonly choreography?: PlaybookRunChoreographySummary;\n /**\n * How long the run took and what its model calls reported spending (#1507) — present on every run the\n * companion measured, composite or not. Absent on a row written before it existed. A run that THREW\n * carries the engine's `{ failure }` instead of this summary, and this same `measurement` beside it\n * (`ActorExecutionRunOptions.recordBesideFailure`), which `readPlaybookRunMeasurement` reads either way.\n */\n readonly measurement?: PlaybookRunMeasurement;\n /**\n * The OTHER root runs this run shared the application with while it ran (#1610), oldest first. Present\n * only on a ROOT run, and only when there were any.\n *\n * Two lines now run side by side and write one tree. Their writes are not prevented from meeting: a\n * landing over another run's is detected where it happens (#1614), and this is the other half — each\n * run says, on its own row, which runs it overlapped, so \"what else was running when this landed\" has\n * an answer after both processes are gone.\n */\n readonly overlappedRuns?: readonly PlaybookRunOverlap[];\n /**\n * Present on a run producing the BUILD PLAN when the build tasks already built could not be read (#3449, R10): the brief\n * named none and the normalizer held the answer to none, so this re-decompose could drop or reshape built work with\n * nothing refusing it. The reason the read failed. Written on the row whatever the run's ending (completed, waiting,\n * thrown), because a re-decompose that rewrote built tasks is read afterwards, from its row, by whoever finds them\n * rebuilt. Absent when the read succeeded, or found no build plan (a first decompose has nothing built to keep).\n */\n readonly builtTasksUnread?: string;\n}\n\n/**\n * Another ROOT run whose time on the application overlapped this one's (#1610): what a reader needs to\n * find it and say what it was. Its own children are never listed, and neither are this run's.\n */\nexport interface PlaybookRunOverlap {\n readonly runId: string;\n readonly playbookRef: string;\n readonly instanceKey?: string;\n readonly startedAt: string;\n}\n\n/**\n * The ROOT runs whose time overlapped `self`'s window (#1610), from the execution rows.\n *\n * A row is a root when its correlation names no `rootRunId`: a composite's child records its tree's root,\n * and a child overlaps its root by construction, so listing children would bury the one fact the record\n * exists for under a composite's own work. A row that names no playbook (the unattended loop, the judge)\n * is not a playbook run and is skipped.\n *\n * A run's window is its row's creation until it FINISHED, or until it suspended to ask: a run waiting on\n * a person writes nothing. A row still running is open-ended. Windows that merely touch do not overlap.\n */\nexport function findOverlappingRootRuns(\n executions: readonly PlaybookRunExecutionRow[],\n self: { readonly runId: string; readonly startedAt: string; readonly endedAt: string },\n): readonly PlaybookRunOverlap[] {\n const overlaps: PlaybookRunOverlap[] = [];\n for (const execution of executions) {\n if (execution._id === self.runId) continue;\n const refs = execution.standaloneTasks[0]?.context?.correlation?.refs;\n const playbookRef = refs?.['playbookRef'];\n if (typeof playbookRef !== 'string' || typeof refs?.['rootRunId'] === 'string') continue;\n const running = execution.status === FlowsActors_Status.PROCESSING || execution.status === FlowsActors_Status.PENDING;\n const createdAt = execution.createdAt.toISOString();\n const endedAt = running ? undefined : execution.finishedAt?.toISOString() ?? execution.suspension?.suspendedAt ?? createdAt;\n if (createdAt >= self.endedAt) continue;\n if (endedAt !== undefined && endedAt <= self.startedAt) continue;\n const instanceKey = refs?.['instanceKey'];\n overlaps.push({ runId: execution._id, playbookRef, ...(typeof instanceKey === 'string' ? { instanceKey } : {}), startedAt: createdAt });\n }\n return overlaps.sort((left, right) => left.startedAt.localeCompare(right.startedAt));\n}\n\n/** Read a row summary's overlap record back (#1610); `undefined` for a row that carries none. */\nexport function readPlaybookRunOverlaps(taskOutput: unknown): readonly PlaybookRunOverlap[] | undefined {\n if (typeof taskOutput !== 'object' || taskOutput === null) return undefined;\n const overlaps = (taskOutput as { overlappedRuns?: unknown }).overlappedRuns;\n if (!Array.isArray(overlaps)) return undefined;\n const read = overlaps.filter((entry): entry is PlaybookRunOverlap => typeof entry === 'object' && entry !== null\n && typeof (entry as { runId?: unknown }).runId === 'string' && typeof (entry as { playbookRef?: unknown }).playbookRef === 'string');\n return read.length > 0 ? read : undefined;\n}\n\n/** A run's wall-clock and its spend, as a host meter saw them (#1507). */\nexport interface PlaybookRunMeasurement {\n readonly durationMs: number;\n readonly spend: PlaybookSpend;\n}\n\n/**\n * What one child PLAYBOOK REF cost across a composite run, summed over every time it was dispatched (#1507).\n *\n * Per playbook ref, not per build task: `bottom_up.build-dispatch` runs whichever task is ready, so its\n * tally spans every task it dispatched. The per-TASK view of the #1273 bill — `build-task-capture-view`\n * attempted three times at $5.91 · $10.42 · $21.15 — is `GET /api/companion/build/tasks`, whose attempts\n * carry each run's cost. What this answers is the lane's question: how often did this child run, how\n * often did it produce anything (`dispatches` beside `landings`), and whether each dispatch cost more\n * than the last (`costPerDispatch`, in order).\n */\nexport interface PlaybookRunChildTally {\n readonly playbookRef: string;\n readonly dispatches: number;\n readonly failures: number;\n /** Dispatches that landed at least one file. */\n readonly landings: number;\n readonly durationMs: number;\n /** Every dispatch's spend together. Absent when no dispatch of this child carried one (a row from before #1507). */\n readonly spend?: PlaybookSpend;\n /** Each dispatch's reported cost, in dispatch order, per currency — present only when some dispatch reported one. */\n readonly costPerDispatch?: ReadonlyArray<Readonly<Record<string, number>> | null>;\n}\n\n/** One round of a composite, as its record keeps it (#1507) — the same shape for the root and for a nested lane. */\nexport interface PlaybookRunChoreographyIterationSummary {\n readonly iteration: number;\n readonly eligibleRefs: readonly string[];\n /** Children on record with nothing they read changed, so not offered this round (2026-10-01). */\n readonly withheldAsCurrent?: readonly string[];\n /** Refreshes held back this round because a first-run child was offered and reads nothing they write. */\n readonly deferredForFirstRun?: readonly string[];\n readonly children: readonly PlaybookRunChoreographyChildSummary[];\n readonly stopRationale?: string;\n /** The round's wall-clock and spend — its selection and every dispatch in it (#1507). */\n readonly durationMs?: number;\n readonly spend?: PlaybookSpend;\n /**\n * The first round of this run that began from the SAME input state (#1507) — tree, step results and\n * delivered set. Present only on a repeat: a lane spending without converging.\n */\n readonly sameInputStateAsIteration?: number;\n}\n\nexport interface PlaybookRunChoreographyChildSummary {\n readonly playbookRef: string;\n /**\n * Whether it re-ran over a landing the record already held: the recorded rerun verdict was REFRESH or CURRENT (a\n * landing re-opened), never FIRST_RUN (#3213). Absent when no verdict was recorded. Read from the KIND, because\n * {@link ranBecause} is a sentence written for a first run too (\"FIRST RUN — no landing of it is recorded\").\n */\n readonly reranOverLanding?: boolean;\n /**\n * Why it was on the table, in a sentence: a first run, a refresh and what moved (which family, re-landed\n * by which run, when), or a re-opening by a verdict (2026-10-01). The question a wasted round raises, kept\n * on the row because the board that answered it is gone once the round ends. Absent where it does not apply.\n */\n readonly ranBecause?: string;\n readonly landed: readonly string[];\n readonly failure?: string;\n /** Present when this child was itself a LANE (#1497). */\n readonly lane?: PlaybookRunLaneSummary;\n /** This dispatch's wall-clock and spend (#1507); a lane's covers its whole subtree. Absent on rows from before. */\n readonly durationMs?: number;\n readonly spend?: PlaybookSpend;\n}\n\n/**\n * A nested LANE as its parent's record keeps it: how it ended and how many rounds it took (#1497), and\n * since #1507 each round's cost and repeat marker, its children's tally and where it resumed.\n *\n * The rounds used to be dropped here as \"disposable run state, not a record\", which lost exactly the\n * thing #1507 exists for in the journey's real shape: the umbrella runs the build lane NESTED, so the\n * build lane's repeated dispatches over one state — the #1273 case — would reach the row as one\n * child's total. What is kept is the summarized round (duration, spend, repeat, children with their\n * failure and landings), bounded by the lane's own iteration ceiling; the objectives, reads and step\n * values stay disposable.\n */\nexport interface PlaybookRunLaneSummary {\n readonly stoppedBecause: string;\n readonly iterations: number;\n readonly rounds?: readonly PlaybookRunChoreographyIterationSummary[];\n readonly childTally?: readonly PlaybookRunChildTally[];\n readonly iterationsOverRepeatedState?: readonly number[];\n readonly resumedAfterIteration?: number;\n /**\n * Why each of the lane's children was not on the table when it stopped — the same rows the root's\n * {@link PlaybookRunChoreographySummary.unoffered} keeps. A stuck child is most often a LANE's child,\n * and its `REPEATS_FAILURE` row was dropped here until 2026-10-01, leaving it only in a trace event.\n */\n readonly unoffered?: readonly { readonly playbookRef: string; readonly reason: string; readonly detail: string }[];\n}\n\n/** The composite outcome a run record keeps — see {@link PlaybookRunTaskSummary.choreography}. */\nexport interface PlaybookRunChoreographySummary {\n /** The runtime's own stop vocabulary (`PlaybookChoreographyStopReason`), carried as its value. */\n readonly stoppedBecause: string;\n /** Specification files the children landed, in landing order. Empty is the finding a reader needs. */\n readonly landed: readonly string[];\n /**\n * Why each admitted child was NOT on the table, when the lane stopped for want of one (#1506).\n *\n * Absent for every other stop. Present, its first entries are the ones a creator can act on — an\n * unanswered interview — because the question a stopped lane raises is always \"and now what\".\n */\n readonly unoffered?: readonly { readonly playbookRef: string; readonly reason: string; readonly detail: string }[];\n /**\n * The lane boundaries' decisions, as the decision plane states them (#111) — one per boundary that\n * OWED a decision, the root composite's and every nested lane's, outermost first. This is the\n * NOTIFY half of a marked gate: a person reads them off the row and acts through the run and\n * revert doors.\n *\n * Typed as the payload rather than `unknown`: a reader that cannot tell a NOTIFY boundary from an\n * APPROVE_RESULT one without parsing prose is the shape this whole record exists to remove.\n */\n readonly boundaryDecisions?: readonly HumanDecision_Request[];\n readonly iterations: readonly PlaybookRunChoreographyIterationSummary[];\n /** Per child ref, summed over the run — see {@link PlaybookRunChildTally}. Absent on rows from before #1507. */\n readonly childTally?: readonly PlaybookRunChildTally[];\n /** Iterations that began from an input state an earlier iteration had already begun from, in order (#1507). Absent when none did. */\n readonly iterationsOverRepeatedState?: readonly number[];\n /**\n * Present on a composite RESUMED from a checkpoint: the iterations completed before it (#1507). They\n * ran in the previous run it resumed — whose own row carries whatever it recorded — so they are not in\n * this record's figures, and the totals say so by counting them as unobserved.\n */\n readonly resumedAfterIteration?: number;\n /** The run ended on an environmental failure and a re-run resumes it from its checkpoint. */\n readonly resumableFromCheckpoint: boolean;\n}\n\n/** A child's failure is kept, bounded: enough to say what went wrong, never a whole stack in a jsonb column. */\nconst CHOREOGRAPHY_FAILURE_LENGTH = 600;\n\nconst SPEND_MEASUREMENTS = new Set<string>(Object.values(PlaybookSpendMeasurement));\n\n/**\n * A spend figure read back from an envelope or a row — admitted only when it has the shape the runtime\n * writes, so a malformed value is ABSENT rather than rendered as a figure (#1507). Crossed a JSON\n * boundary, so every field is checked rather than cast.\n */\nexport function readRecordedPlaybookSpend(value: unknown): PlaybookSpend | undefined {\n if (typeof value !== 'object' || value === null) return undefined;\n const bag = value as Record<string, unknown>;\n const count = (key: string): number | undefined => (typeof bag[key] === 'number' && Number.isFinite(bag[key]) && (bag[key] as number) >= 0 ? bag[key] as number : undefined);\n const measurement = bag['measurement'];\n const modelCalls = count('modelCalls');\n const callsNotFullyMeasured = count('callsNotFullyMeasured');\n const unobservedSegments = count('unobservedSegments');\n if (typeof measurement !== 'string' || !SPEND_MEASUREMENTS.has(measurement)\n || modelCalls === undefined || callsNotFullyMeasured === undefined || unobservedSegments === undefined) return undefined;\n const rawCost = typeof bag['cost'] === 'object' && bag['cost'] !== null ? bag['cost'] as Record<string, unknown> : undefined;\n const cost = rawCost\n ? Object.fromEntries(Object.entries(rawCost).filter((entry): entry is [string, number] => typeof entry[1] === 'number' && Number.isFinite(entry[1])))\n : undefined;\n return {\n measurement: measurement as PlaybookSpendMeasurement,\n modelCalls,\n callsNotFullyMeasured,\n unobservedSegments,\n ...(count('inputTokens') !== undefined ? { inputTokens: count('inputTokens')! } : {}),\n ...(count('outputTokens') !== undefined ? { outputTokens: count('outputTokens')! } : {}),\n ...(count('totalTokens') !== undefined ? { totalTokens: count('totalTokens')! } : {}),\n ...(count('cacheReadTokens') !== undefined ? { cacheReadTokens: count('cacheReadTokens')! } : {}),\n ...(cost && Object.keys(cost).length > 0 ? { cost } : {}),\n ...(() => { const codingRuns = readRecordedBuildRowPart(bag['codingRuns']); return codingRuns ? { codingRuns } : {}; })(),\n ...(() => { const generationSteps = readRecordedBuildRowPart(bag['generationSteps']); return generationSteps ? { generationSteps } : {}; })(),\n };\n}\n\n/** A row's `PlaybookSpend.codingRuns` or `.generationSteps` (#2232), or `undefined` for a row without one (every row before it). */\nfunction readRecordedBuildRowPart(value: unknown): PlaybookSpendBuildRowPart | undefined {\n if (typeof value !== 'object' || value === null) return undefined;\n const bag = value as Record<string, unknown>;\n const count = (key: string): number | undefined => (typeof bag[key] === 'number' && Number.isFinite(bag[key]) && (bag[key] as number) >= 0 ? bag[key] as number : undefined);\n const runs = count('runs');\n const runsWithoutReportedCost = count('runsWithoutReportedCost');\n if (runs === undefined || runsWithoutReportedCost === undefined) return undefined;\n const rawCost = typeof bag['cost'] === 'object' && bag['cost'] !== null ? bag['cost'] as Record<string, unknown> : undefined;\n const cost = rawCost\n ? Object.fromEntries(Object.entries(rawCost).filter((entry): entry is [string, number] => typeof entry[1] === 'number' && Number.isFinite(entry[1])))\n : undefined;\n return {\n runs,\n runsWithoutReportedCost,\n ...(count('totalTokens') !== undefined ? { totalTokens: count('totalTokens')! } : {}),\n ...(count('cacheReadTokens') !== undefined ? { cacheReadTokens: count('cacheReadTokens')! } : {}),\n ...(cost && Object.keys(cost).length > 0 ? { cost } : {}),\n };\n}\n\nconst readDuration = (value: unknown): number | undefined => (typeof value === 'number' && Number.isFinite(value) && value >= 0 ? value : undefined);\n\n/**\n * Per child ref, summed over a composite's iterations (#1507) — computed from the SAME per-dispatch\n * figures the iterations carry, so the tally and the iterations cannot disagree. Ordered by dispatches,\n * most first: the child that ran most often is the one a reader of a looping lane looks for.\n */\nfunction tallyChoreographyChildren(iterations: readonly PlaybookRunChoreographyIterationSummary[]): readonly PlaybookRunChildTally[] {\n const byRef = new Map<string, { dispatches: number; failures: number; landings: number; durationMs: number; spends: PlaybookSpend[]; costs: (Readonly<Record<string, number>> | null)[] }>();\n for (const iteration of iterations) {\n for (const child of iteration.children) {\n const entry = byRef.get(child.playbookRef) ?? { dispatches: 0, failures: 0, landings: 0, durationMs: 0, spends: [], costs: [] };\n entry.dispatches += 1;\n if (child.failure !== undefined) entry.failures += 1;\n if (child.landed.length > 0) entry.landings += 1;\n entry.durationMs += child.durationMs ?? 0;\n if (child.spend) entry.spends.push(child.spend);\n entry.costs.push(child.spend?.cost ?? null);\n byRef.set(child.playbookRef, entry);\n }\n }\n return [...byRef.entries()]\n .map(([playbookRef, entry]) => ({\n playbookRef,\n dispatches: entry.dispatches,\n failures: entry.failures,\n landings: entry.landings,\n durationMs: entry.durationMs,\n ...(entry.spends.length > 0 ? { spend: mergePlaybookSpend(entry.spends) } : {}),\n ...(entry.costs.some((cost) => cost !== null) ? { costPerDispatch: entry.costs } : {}),\n }))\n .sort((left, right) => right.dispatches - left.dispatches || left.playbookRef.localeCompare(right.playbookRef));\n}\n\n/**\n * A composite's rounds as its record keeps them — for the root and, recursively, for every nested lane\n * (#1497, #1507). One summarizer for both, so a lane's round and the root's cannot be described two ways.\n */\nfunction summarizeChoreographyIterations(iterations: readonly Record<string, unknown>[]): PlaybookRunChoreographyIterationSummary[] {\n const strings = (value: unknown): string[] => (Array.isArray(value) ? value.filter((item): item is string => typeof item === 'string') : []);\n return iterations.map((iteration) => ({\n iteration: Number(iteration['iteration']),\n eligibleRefs: strings(iteration['eligibleRefs']),\n ...(strings(iteration['withheldAsCurrent']).length > 0 ? { withheldAsCurrent: strings(iteration['withheldAsCurrent']) } : {}),\n ...(strings(iteration['deferredForFirstRun']).length > 0 ? { deferredForFirstRun: strings(iteration['deferredForFirstRun']) } : {}),\n children: (Array.isArray(iteration['children']) ? iteration['children'] as Record<string, unknown>[] : []).map((child) => {\n const nested = typeof child['nested'] === 'object' && child['nested'] !== null ? child['nested'] as Record<string, unknown> : undefined;\n const childDuration = readDuration(child['durationMs']);\n const childSpend = readRecordedPlaybookSpend(child['spend']);\n const ranBecause = describeRecordedRerun(child['rerun'], child['reopenedInThisRun'] === true);\n const reranOverLanding = recordedRerunIsOverLanding(child['rerun']);\n return {\n playbookRef: String(child['playbookRef']),\n ...(ranBecause !== undefined ? { ranBecause } : {}),\n ...(reranOverLanding !== undefined ? { reranOverLanding } : {}),\n landed: strings(child['landed']),\n ...(typeof child['failure'] === 'string' ? { failure: child['failure'].slice(0, CHOREOGRAPHY_FAILURE_LENGTH) } : {}),\n ...(nested && typeof nested['stoppedBecause'] === 'string' ? { lane: summarizeLane(nested) } : {}),\n ...(childDuration !== undefined ? { durationMs: childDuration } : {}),\n ...(childSpend ? { spend: childSpend } : {}),\n };\n }),\n ...(typeof iteration['stopRationale'] === 'string' ? { stopRationale: iteration['stopRationale'] } : {}),\n ...(() => { const durationMs = readDuration(iteration['durationMs']); return durationMs !== undefined ? { durationMs } : {}; })(),\n ...(() => { const spend = readRecordedPlaybookSpend(iteration['spend']); return spend ? { spend } : {}; })(),\n ...(typeof iteration['sameInputStateAsIteration'] === 'number' ? { sameInputStateAsIteration: iteration['sameInputStateAsIteration'] } : {}),\n }));\n}\n\nconst RERUN_KINDS = new Set<string>(Object.values(PlaybookRerunKind));\n\n/**\n * A child's recorded rerun verdict, as the sentence a person reads — or nothing when the value is not one the\n * runtime writes. Crossed a JSON boundary, so the kind is checked rather than cast; the rest of the sentence is\n * built by the runtime's own describer, so the record and the selector's prompt cannot word one verdict twice.\n */\nfunction describeRecordedRerun(value: unknown, reopenedInThisRun: boolean): string | undefined {\n if (typeof value !== 'object' || value === null || !RERUN_KINDS.has(String((value as { kind?: unknown }).kind))) return undefined;\n const described = describePlaybookRerun(value as PlaybookRerunVerdict);\n if (described === undefined) return undefined;\n return reopenedInThisRun ? `RE-OPENED by a verdict in this run (it was ${described})` : described;\n}\n\n/**\n * Whether a child's recorded rerun verdict re-ran it over a landing the record held (REFRESH, or a CURRENT landing a\n * verdict re-opened) — `undefined` when no valid verdict was recorded. A FIRST_RUN had nothing to stand (#3213).\n */\nfunction recordedRerunIsOverLanding(value: unknown): boolean | undefined {\n const kind = typeof value === 'object' && value !== null ? String((value as { kind?: unknown }).kind) : undefined;\n if (kind === undefined || !RERUN_KINDS.has(kind)) return undefined;\n return kind === PlaybookRerunKind.REFRESH || kind === PlaybookRerunKind.CURRENT;\n}\n\n/** The rounds that began from a state an earlier round of the same run began from, in order. */\nfunction roundsOverRepeatedState(rounds: readonly PlaybookRunChoreographyIterationSummary[]): number[] {\n return rounds.filter((round) => round.sameInputStateAsIteration !== undefined).map((round) => round.iteration);\n}\n\n/** Whether any round or dispatch carries a figure — a row from before #1507 carries none and gets no tally. */\nfunction roundsCarryMeasurement(rounds: readonly PlaybookRunChoreographyIterationSummary[]): boolean {\n return rounds.some((round) => round.spend !== undefined || round.children.some((child) => child.spend !== undefined));\n}\n\n/** The unoffered rows of a lane or of the root, as the record keeps them. */\nfunction summarizeUnoffered(value: unknown): { readonly playbookRef: string; readonly reason: string; readonly detail: string }[] {\n return (Array.isArray(value) ? value as Record<string, unknown>[] : []).map((entry) => ({\n playbookRef: String(entry['playbookRef']),\n reason: String(entry['reason']),\n detail: String(entry['detail']),\n }));\n}\n\n/** A nested lane, as its parent's record keeps it — see {@link PlaybookRunLaneSummary}. */\nfunction summarizeLane(nested: Record<string, unknown>): PlaybookRunLaneSummary {\n const raw = Array.isArray(nested['iterations']) ? nested['iterations'] as Record<string, unknown>[] : [];\n const rounds = summarizeChoreographyIterations(raw);\n const repeated = roundsOverRepeatedState(rounds);\n const resumed = nested['resumedAfterIteration'];\n const unoffered = summarizeUnoffered(nested['unoffered']);\n return {\n stoppedBecause: String(nested['stoppedBecause']),\n iterations: raw.length,\n ...(unoffered.length > 0 ? { unoffered } : {}),\n ...(roundsCarryMeasurement(rounds) ? { rounds, childTally: tallyChoreographyChildren(rounds) } : {}),\n ...(repeated.length > 0 ? { iterationsOverRepeatedState: repeated } : {}),\n ...(typeof resumed === 'number' && resumed > 0 ? { resumedAfterIteration: resumed } : {}),\n };\n}\n\nfunction summarizeChoreography(envelope: Record<string, unknown>): PlaybookRunChoreographySummary | undefined {\n if (envelope['choreographed'] !== true) return undefined;\n const strings = (value: unknown): string[] => (Array.isArray(value) ? value.filter((item): item is string => typeof item === 'string') : []);\n const iterations = Array.isArray(envelope['iterations']) ? envelope['iterations'] as Record<string, unknown>[] : [];\n /*\n * WHY nothing was on the table, when that is why the run ended (#1506).\n *\n * Kept in the record rather than only in the HTTP response, because the response is read once and\n * the record is what an operator comes back to. Bounded by the composite's own `admits`, and the\n * detail is a sentence the runtime already composed — there is nothing here to truncate.\n */\n const unoffered = summarizeUnoffered(envelope['unoffered']);\n const summarizedIterations = summarizeChoreographyIterations(iterations);\n const repeated = roundsOverRepeatedState(summarizedIterations);\n const measuredAny = roundsCarryMeasurement(summarizedIterations);\n return {\n stoppedBecause: String(envelope['stoppedBecause']),\n landed: strings(envelope['landed']),\n ...(unoffered.length > 0 ? { unoffered } : {}),\n iterations: summarizedIterations,\n ...(measuredAny ? { childTally: tallyChoreographyChildren(summarizedIterations) } : {}),\n ...(repeated.length > 0 ? { iterationsOverRepeatedState: repeated } : {}),\n ...(() => {\n const resumed = (envelope['resumedFrom'] as { completedIterations?: unknown } | undefined)?.completedIterations;\n return typeof resumed === 'number' && resumed > 0 ? { resumedAfterIteration: resumed } : {};\n })(),\n resumableFromCheckpoint: envelope['resumableFromCheckpoint'] === true,\n ...(() => {\n const decisions = envelope['boundaryDecisions'];\n if (!Array.isArray(decisions) || decisions.length === 0) return {};\n // Parsed rather than cast: the row is read back by a person's client, and a malformed entry\n // must be absent rather than served as a decision nobody can answer.\n const parsed = decisions.map((entry) => HumanDecision_RequestSchema.safeParse(entry)).filter((entry) => entry.success).map((entry) => entry.data);\n return parsed.length > 0 ? { boundaryDecisions: parsed } : {};\n })(),\n };\n}\n\n/**\n * A run's choreography, from a live result envelope or from the summary a settled row carries (#2530) — one reader for\n * both, as for the judge's verdict. `undefined` for a run of a single playbook.\n */\nexport function readPlaybookRunChoreography(result: unknown): PlaybookRunChoreographySummary | undefined {\n if (typeof result !== 'object' || result === null) return undefined;\n if (isPlaybookRunTaskSummary(result)) return (result as PlaybookRunTaskSummary).choreography;\n return summarizeChoreography(result as Record<string, unknown>);\n}\n\n/**\n * A composite run's rounds as the workbench's run row carries them (#2530): the run's own in order, each followed by\n * the rounds of every lane one of its children ran, depth first. A lane's round names the round whose child ran it and\n * that child, so the flat list keeps every depth the record keeps (a lane's rounds are kept when they were measured,\n * which every run since #1507 is).\n */\nexport function playbookRunRoundsOf(choreography: PlaybookRunChoreographySummary): Workbench_PlaybookRunRound[] {\n const rounds: Workbench_PlaybookRunRound[] = [];\n const visit = (iterations: readonly PlaybookRunChoreographyIterationSummary[], lane?: { readonly roundKey: string; readonly playbookRef: string }): void => {\n for (const iteration of iterations) {\n const roundKey = lane ? `${lane.roundKey}/${lane.playbookRef}/${iteration.iteration}` : String(iteration.iteration);\n rounds.push({\n roundKey,\n parentRoundKey: lane?.roundKey ?? null,\n lanePlaybookRef: lane?.playbookRef ?? null,\n iteration: iteration.iteration,\n sameInputStateAsIteration: iteration.sameInputStateAsIteration ?? null,\n stopRationale: iteration.stopRationale ?? null,\n children: iteration.children.map((child) => ({\n playbookRef: child.playbookRef,\n ranBecause: child.ranBecause ?? null,\n reranOverLanding: child.reranOverLanding ?? null,\n landed: [...child.landed],\n failure: child.failure ?? null,\n })),\n });\n for (const child of iteration.children) {\n if (child.lane?.rounds) visit(child.lane.rounds, { roundKey, playbookRef: child.playbookRef });\n }\n }\n };\n visit(choreography.iterations);\n return rounds;\n}\n\n/**\n * What a settled run writes on its own task. `measurement` is the host's reading of the run as a whole\n * (#1507), passed beside the result rather than carried on it: the result object is the key the\n * suspension registry is looked up by, so it cannot be copied to add a field.\n */\nexport function summarizePlaybookRunResult(\n result: unknown,\n measurement?: PlaybookRunMeasurement,\n /** The root runs this one overlapped (#1610); omitted, or empty, writes nothing. */\n overlappedRuns?: readonly PlaybookRunOverlap[],\n): PlaybookRunTaskSummary {\n const envelope = (typeof result === 'object' && result !== null ? result : {}) as Record<string, unknown>;\n const suspended = envelope['status'] === Workbench_PlaybookRunOutcomeStatus.AWAITING_CREATOR_INPUT;\n return {\n accepted: typeof envelope['accepted'] === 'boolean' ? envelope['accepted'] : null,\n dryRun: envelope['dryRun'] === true,\n ...readPlaybookRunJudgeVerdict(result),\n ...(suspended ? { awaitingCreatorInput: { family: String(envelope['family']), round: Number(envelope['round']) } } : {}),\n ...(() => { const choreography = summarizeChoreography(envelope); return choreography ? { choreography } : {}; })(),\n ...(measurement ? { measurement } : {}),\n ...(overlappedRuns && overlappedRuns.length > 0 ? { overlappedRuns } : {}),\n };\n}\n\n/**\n * The measurement a row's task summary carries, read back for the runs read (#1507) — the run's own,\n * and for a composite its per-iteration and per-child figures. Read from the ROW, never from a live\n * envelope, so a reader after a restart sees exactly what one before it saw. A run that threw carries\n * it beside its `failure` and is read the same way. `undefined` for a row that carries none: written\n * before #1507, or settled ABORTED because its process stopped before the run could.\n */\nexport function readPlaybookRunMeasurement(taskOutput: unknown): PlaybookSettledRunMeasurement | undefined {\n if (typeof taskOutput !== 'object' || taskOutput === null) return undefined;\n const summary = taskOutput as { measurement?: { durationMs?: unknown; spend?: unknown }; choreography?: PlaybookRunChoreographySummary };\n const durationMs = readDuration(summary.measurement?.durationMs);\n const spend = readRecordedPlaybookSpend(summary.measurement?.spend);\n if (durationMs === undefined || spend === undefined) return undefined;\n const choreography = summary.choreography;\n return {\n durationMs,\n spend,\n ...(choreography && Array.isArray(choreography.iterations) ? { iterations: measureRounds(choreography.iterations) } : {}),\n ...(choreography?.childTally ? { childTally: choreography.childTally } : {}),\n ...(choreography?.iterationsOverRepeatedState ? { iterationsOverRepeatedState: choreography.iterationsOverRepeatedState } : {}),\n ...(choreography?.resumedAfterIteration !== undefined ? { resumedAfterIteration: choreography.resumedAfterIteration } : {}),\n };\n}\n\n/** Why a build-plan run could not read the tasks already built, read back from its row whatever its ending (R10, #3449). */\nexport function readPlaybookRunBuiltTasksUnread(taskOutput: unknown): string | undefined {\n if (typeof taskOutput !== 'object' || taskOutput === null) return undefined;\n const reason = (taskOutput as { builtTasksUnread?: unknown }).builtTasksUnread;\n return typeof reason === 'string' && reason !== '' ? reason : undefined;\n}\n\n/** The measurement view of a composite's rounds — recursive through nested lanes (#1507). */\nfunction measureRounds(rounds: readonly PlaybookRunChoreographyIterationSummary[]): PlaybookRoundMeasurement[] {\n return rounds.map((round) => ({\n iteration: round.iteration,\n ...(round.withheldAsCurrent ? { withheldAsCurrent: round.withheldAsCurrent } : {}),\n ...(round.deferredForFirstRun ? { deferredForFirstRun: round.deferredForFirstRun } : {}),\n ...(round.durationMs !== undefined ? { durationMs: round.durationMs } : {}),\n ...(round.spend ? { spend: round.spend } : {}),\n ...(round.sameInputStateAsIteration !== undefined ? { sameInputStateAsIteration: round.sameInputStateAsIteration } : {}),\n children: (round.children ?? []).map((child) => ({\n playbookRef: child.playbookRef,\n ...(child.ranBecause !== undefined ? { ranBecause: child.ranBecause } : {}),\n failed: child.failure !== undefined,\n landedCount: child.landed.length,\n ...(child.durationMs !== undefined ? { durationMs: child.durationMs } : {}),\n ...(child.spend ? { spend: child.spend } : {}),\n ...(child.lane ? {\n lane: {\n playbookRef: child.playbookRef,\n stoppedBecause: child.lane.stoppedBecause,\n iterations: child.lane.iterations,\n ...(child.lane.rounds ? { rounds: measureRounds(child.lane.rounds) } : {}),\n ...(child.lane.childTally ? { childTally: child.lane.childTally } : {}),\n ...(child.lane.iterationsOverRepeatedState ? { iterationsOverRepeatedState: child.lane.iterationsOverRepeatedState } : {}),\n ...(child.lane.resumedAfterIteration !== undefined ? { resumedAfterIteration: child.lane.resumedAfterIteration } : {}),\n },\n } : {}),\n })),\n }));\n}\n\n/** One round of a settled run's measurement — the root's or a nested lane's (#1507). */\nexport interface PlaybookRoundMeasurement {\n readonly iteration: number;\n readonly withheldAsCurrent?: readonly string[];\n readonly deferredForFirstRun?: readonly string[];\n readonly durationMs?: number;\n readonly spend?: PlaybookSpend;\n readonly sameInputStateAsIteration?: number;\n readonly children: readonly {\n readonly playbookRef: string;\n /** See {@link PlaybookRunChoreographyChildSummary.ranBecause}. */\n readonly ranBecause?: string;\n readonly failed: boolean;\n readonly landedCount: number;\n readonly durationMs?: number;\n readonly spend?: PlaybookSpend;\n /** Present when the child was a nested LANE: its own rounds, tally and repeats. */\n readonly lane?: PlaybookLaneMeasurement;\n }[];\n}\n\n/** A nested lane's measurement, as the runs read serves it (#1507). */\nexport interface PlaybookLaneMeasurement {\n readonly playbookRef: string;\n readonly stoppedBecause: string;\n readonly iterations: number;\n readonly rounds?: readonly PlaybookRoundMeasurement[];\n readonly childTally?: readonly PlaybookRunChildTally[];\n readonly iterationsOverRepeatedState?: readonly number[];\n readonly resumedAfterIteration?: number;\n}\n\n/** What the runs read serves about a settled run's cost (#1507) — see {@link readPlaybookRunMeasurement}. */\nexport interface PlaybookSettledRunMeasurement extends PlaybookRunMeasurement {\n readonly iterations?: readonly PlaybookRoundMeasurement[];\n readonly childTally?: readonly PlaybookRunChildTally[];\n readonly iterationsOverRepeatedState?: readonly number[];\n readonly resumedAfterIteration?: number;\n}\n\n/**\n * The slice of an execution row the runs read needs — a full platform row satisfies it.\n *\n * `createdAt` / `finishedAt` are the stored row's DATES (#2187). Every comparison and record here uses\n * their ISO-`Z` form, so they order against the other ISO-`Z` instants this file compares them with\n * (`suspension.suspendedAt`, a run's own start and end). The rows used to carry local-offset text,\n * which compared against a `Z` string by characters, not by time.\n */\nexport interface PlaybookRunExecutionRow {\n readonly _id: string;\n readonly status: FlowsActors_Status;\n readonly createdAt: Date;\n readonly finishedAt?: Date;\n readonly suspension?: { readonly suspendedAt?: string } | null;\n /** The single-flight subject the run holds while it runs (#1361) — how the read tells a composite from an ordinary run. */\n readonly exclusiveSubject?: string;\n readonly standaloneTasks: ReadonlyArray<{\n readonly context?: { readonly correlation?: { readonly refs?: Readonly<Record<string, string>> } };\n readonly output?: unknown;\n }>;\n}\n\nexport interface PlaybookRunningRecord {\n readonly runId: string;\n readonly playbookRef: string;\n /** The playbook INSTANCE (#1609), read from the row's correlation; absent for the default instance. */\n readonly instanceKey?: string;\n readonly startedAt: string;\n readonly traceSessionId?: string;\n /** The creation conversation the run was started from, when it was (#1454) — read from the same envelope. */\n readonly conversationId?: string;\n /** Present on a RUNNING record only: what the run holds exclusively, if anything. */\n readonly exclusiveSubject?: string;\n}\n\nexport interface PlaybookSettledRunRecord extends PlaybookRunningRecord {\n readonly finishedAt: string;\n readonly ok: boolean;\n readonly result?: unknown;\n readonly error?: string;\n readonly awaitingCreatorInput?: { readonly runId: string; readonly family: string; readonly round: number };\n /**\n * True on a run that did not conclude because the ENVIRONMENT took it (#3235): its error is a lost network, a wake\n * that aborted a model call, an infrastructure kill, an account condition (`isEnvironmentalPlaybookFailure`). Such a\n * run is INTERRUPTED, never REFUSED: nothing about the work was judged, and running it again resumes it (a thrown\n * composite keeps its checkpoint). Measured on app-creation-test-007: `REFUSED cross_cutting.compliance … Delay was\n * aborted`, the instant the machine woke.\n */\n readonly interruptedByEnvironment?: true;\n /** Duration and spend, and for a composite per iteration and per child (#1507). Read from the row. */\n readonly measurement?: PlaybookSettledRunMeasurement;\n /** The other root runs it overlapped (#1610), read from its row. */\n readonly overlappedRuns?: readonly PlaybookRunOverlap[];\n /** A build-plan run that could not read the tasks already built, and why (see `PlaybookRunTaskSummary.builtTasksUnread`). */\n readonly builtTasksUnread?: string;\n}\n\n/**\n * The runs read, from the rows.\n *\n * - **running**: every execution still `PROCESSING` — and since #1358 that is every run, synchronous\n * or detached, composite or not. Until this existed a synchronous non-composite run was reported\n * NOWHERE while it ran.\n * - **settled**: the most recent execution per playbook INSTANCE that is no longer running (#1609): one\n * per `<ref>` for the default instance and per `<ref>@<key>` for another, so a second instance\n * settling never hides the first one's outcome. \"What happened to the run I submitted\", not a history. A run WAITING\n * on a person is settled-and-ok with `awaitingCreatorInput` — a suspension did not throw, and the\n * field exists precisely so `ok: true` is not read as \"finished\".\n *\n * `ok` is \"did not fail\": `COMPLETED` or waiting. `ABORTED` (a restart) and `CANCELLED` are not ok,\n * and say why in `error`, because a reader polling for its run must not take a run the host lost\n * for one that worked.\n *\n * `enrich` hands back the full result envelope for a run THIS process ran; a row from before a\n * restart has only its summary, which is returned as `result` so a reader sees the verdict either way.\n */\nexport function projectPlaybookRunRecords(\n executions: readonly PlaybookRunExecutionRow[],\n enrich: (runId: string) => unknown | undefined = () => undefined,\n): { readonly running: readonly PlaybookRunningRecord[]; readonly settled: readonly PlaybookSettledRunRecord[] } {\n const running: PlaybookRunningRecord[] = [];\n const settledByInstance = new Map<string, PlaybookSettledRunRecord>();\n const newestFirst = [...executions].sort((left, right) => right.createdAt.getTime() - left.createdAt.getTime());\n for (const execution of newestFirst) {\n const task = execution.standaloneTasks[0];\n const refs = task?.context?.correlation?.refs;\n const playbookRef = refs?.['playbookRef'];\n // A row that names no playbook is not a playbook run this read can describe (the judge and the\n // generator run under the same system); skipped rather than reported under an invented ref.\n if (typeof playbookRef !== 'string') continue;\n const instanceKey = typeof refs?.['instanceKey'] === 'string' ? refs['instanceKey'] : undefined;\n const instanceId = playbookInstanceId(playbookRef, instanceKey);\n const base: PlaybookRunningRecord = {\n runId: execution._id,\n playbookRef,\n ...(instanceKey !== undefined ? { instanceKey } : {}),\n startedAt: execution.createdAt.toISOString(),\n ...(typeof refs?.['traceSessionId'] === 'string' ? { traceSessionId: refs['traceSessionId'] } : {}),\n ...(typeof refs?.['conversationId'] === 'string' ? { conversationId: refs['conversationId'] } : {}),\n };\n if (execution.status === FlowsActors_Status.PROCESSING || execution.status === FlowsActors_Status.PENDING) {\n running.push({ ...base, ...(execution.exclusiveSubject !== undefined ? { exclusiveSubject: execution.exclusiveSubject } : {}) });\n continue;\n }\n if (settledByInstance.has(instanceId)) continue;\n const output = (typeof task?.output === 'object' && task.output !== null ? task.output : {}) as {\n failure?: { message?: unknown };\n awaitingCreatorInput?: { family?: unknown; round?: unknown };\n };\n const waiting = execution.status === FlowsActors_Status.AWAITING_APPROVAL;\n const ok = execution.status === FlowsActors_Status.COMPLETED || waiting;\n const failureMessage = typeof output.failure?.message === 'string' ? output.failure.message : undefined;\n const enriched = enrich(execution._id);\n const measurement = readPlaybookRunMeasurement(task?.output);\n const overlappedRuns = readPlaybookRunOverlaps(task?.output);\n const builtTasksUnread = readPlaybookRunBuiltTasksUnread(task?.output);\n settledByInstance.set(instanceId, {\n ...base,\n finishedAt: execution.finishedAt?.toISOString() ?? execution.suspension?.suspendedAt ?? execution.createdAt.toISOString(),\n ok,\n ...(ok ? { result: enriched !== undefined ? enriched : task?.output } : {}),\n ...(ok ? {} : { error: failureMessage ?? `The run ended ${execution.status} without concluding.` }),\n ...(!ok && failureMessage !== undefined && isEnvironmentalPlaybookFailure(failureMessage) ? { interruptedByEnvironment: true as const } : {}),\n ...(waiting && output.awaitingCreatorInput\n ? { awaitingCreatorInput: { runId: execution._id, family: String(output.awaitingCreatorInput.family), round: Number(output.awaitingCreatorInput.round) } }\n : {}),\n ...(measurement ? { measurement } : {}),\n ...(overlappedRuns ? { overlappedRuns } : {}),\n ...(builtTasksUnread !== undefined ? { builtTasksUnread } : {}),\n });\n }\n return { running, settled: [...settledByInstance.values()] };\n}\n\n/**\n * What the unattended playbook LOOP writes on its own row (#1507): why it stopped, how many steps it\n * took, and what those steps took and spent — per step, per lane, and which steps began from a working\n * tree an earlier step had already begun from. The loop is the other lane that iterates, and the only\n * one whose selection calls land on no run row, so without this its spend was recorded nowhere.\n */\nexport function summarizePlaybookLoopResult(result: {\n readonly stoppedBecause: string;\n /** Where the environment stopped the loop, when it did (#3235); kept on the row so a later reader sees it too. */\n readonly interruption?: PlaybookLoopInterruption;\n readonly durationMs: number;\n readonly spend: PlaybookSpend;\n readonly steps: ReadonlyArray<{\n readonly iteration: number;\n readonly durationMs: number;\n readonly spend: PlaybookSpend;\n readonly sameInputStateAsIteration?: number;\n readonly lanes: ReadonlyArray<{ readonly playbookRef: string; readonly landed?: readonly string[]; readonly failure?: string; readonly durationMs: number; readonly spend: PlaybookSpend }>;\n }>;\n}): Record<string, unknown> {\n const repeated = result.steps.filter((step) => step.sameInputStateAsIteration !== undefined).map((step) => step.iteration);\n return {\n stoppedBecause: result.stoppedBecause,\n ...(result.interruption ? { interruption: { ...result.interruption, failure: result.interruption.failure.slice(0, 500) } } : {}),\n stepCount: result.steps.length,\n measurement: { durationMs: result.durationMs, spend: result.spend },\n steps: result.steps.map((step) => ({\n iteration: step.iteration,\n durationMs: step.durationMs,\n spend: step.spend,\n ...(step.sameInputStateAsIteration !== undefined ? { sameInputStateAsIteration: step.sameInputStateAsIteration } : {}),\n lanes: step.lanes.map((lane) => ({\n playbookRef: lane.playbookRef,\n failed: lane.failure !== undefined,\n landedCount: lane.landed?.length ?? 0,\n durationMs: lane.durationMs,\n spend: lane.spend,\n })),\n })),\n ...(repeated.length > 0 ? { iterationsOverRepeatedState: repeated } : {}),\n };\n}\n\n/** The newest playbook LOOP, as the runs read serves it (#1507). */\nexport interface PlaybookLoopRunRecord {\n readonly runId: string;\n readonly startedAt: string;\n readonly finishedAt?: string;\n readonly status: FlowsActors_Status;\n readonly stoppedBecause?: string;\n readonly stepCount?: number;\n readonly error?: string;\n /** The loop's wall-clock and spend; absent on a row from before #1507. */\n readonly measurement?: PlaybookRunMeasurement;\n /** Steps that began from a tree an earlier step began from. */\n readonly iterationsOverRepeatedState?: readonly number[];\n readonly steps?: ReadonlyArray<{\n readonly iteration: number;\n readonly durationMs?: number;\n readonly spend?: PlaybookSpend;\n readonly sameInputStateAsIteration?: number;\n /** Each lane the step ran, with its own figures — the per-lane view the loop row writes (#1507). */\n readonly lanes?: ReadonlyArray<{ readonly playbookRef: string; readonly failed: boolean; readonly landedCount: number; readonly durationMs?: number; readonly spend?: PlaybookSpend }>;\n }>;\n}\n\n/**\n * The newest unattended LOOP among the meta-workflows executions (#1507) — the reader of what\n * `summarizePlaybookLoopResult` writes. The loop is not a playbook run (its task names no playbook, so\n * the runs projection skips it), and without this its selection spend and repeated steps would be\n * written and read by nothing.\n *\n * A loop's task is recognised by its actor: `actors.actorRef` on a platform row, `actorRef` on the\n * in-memory plane's rows the lane's tests drive — both are read, so the recognition is the same either way.\n */\nexport function projectLastPlaybookLoop(executions: readonly PlaybookRunExecutionRow[]): PlaybookLoopRunRecord | null {\n return projectPlaybookLoops(executions)[0] ?? null;\n}\n\n/** EVERY unattended loop among the executions, newest first — the run report reads them all (#2231). */\nexport function projectPlaybookLoops(executions: readonly PlaybookRunExecutionRow[]): PlaybookLoopRunRecord[] {\n const loops: PlaybookLoopRunRecord[] = [];\n const newestFirst = [...executions].sort((left, right) => right.createdAt.getTime() - left.createdAt.getTime());\n for (const execution of newestFirst) {\n const task = execution.standaloneTasks[0] as (PlaybookRunExecutionRow['standaloneTasks'][number] & { actors?: { actorRef?: unknown }; actorRef?: unknown }) | undefined;\n const actorRef = task?.actors?.actorRef ?? task?.actorRef;\n if (actorRef !== META_WORKFLOWS_PLAYBOOK_LOOP_ACTOR_REF) continue;\n const output = (typeof task?.output === 'object' && task.output !== null ? task.output : {}) as Record<string, unknown>;\n const measurement = (() => {\n const raw = output['measurement'] as { durationMs?: unknown; spend?: unknown } | undefined;\n const durationMs = readDuration(raw?.durationMs);\n const spend = readRecordedPlaybookSpend(raw?.spend);\n return durationMs !== undefined && spend ? { durationMs, spend } : undefined;\n })();\n const steps = Array.isArray(output['steps']) ? (output['steps'] as Record<string, unknown>[]).map((step) => ({\n iteration: Number(step['iteration']),\n ...(readDuration(step['durationMs']) !== undefined ? { durationMs: readDuration(step['durationMs'])! } : {}),\n ...(() => { const spend = readRecordedPlaybookSpend(step['spend']); return spend ? { spend } : {}; })(),\n ...(typeof step['sameInputStateAsIteration'] === 'number' ? { sameInputStateAsIteration: step['sameInputStateAsIteration'] } : {}),\n ...(Array.isArray(step['lanes']) ? {\n lanes: (step['lanes'] as Record<string, unknown>[]).map((lane) => ({\n playbookRef: String(lane['playbookRef']),\n failed: lane['failed'] === true,\n landedCount: typeof lane['landedCount'] === 'number' ? lane['landedCount'] : 0,\n ...(readDuration(lane['durationMs']) !== undefined ? { durationMs: readDuration(lane['durationMs'])! } : {}),\n ...(() => { const spend = readRecordedPlaybookSpend(lane['spend']); return spend ? { spend } : {}; })(),\n })),\n } : {}),\n })) : undefined;\n const failure = (output['failure'] as { message?: unknown } | undefined)?.message;\n const repeated = Array.isArray(output['iterationsOverRepeatedState']) ? (output['iterationsOverRepeatedState'] as unknown[]).filter((entry): entry is number => typeof entry === 'number') : [];\n loops.push({\n runId: execution._id,\n startedAt: execution.createdAt.toISOString(),\n ...(execution.finishedAt ? { finishedAt: execution.finishedAt.toISOString() } : {}),\n status: execution.status,\n ...(typeof output['stoppedBecause'] === 'string' ? { stoppedBecause: output['stoppedBecause'] } : {}),\n ...(typeof output['stepCount'] === 'number' ? { stepCount: output['stepCount'] } : {}),\n ...(typeof failure === 'string' ? { error: failure } : {}),\n ...(measurement ? { measurement } : {}),\n ...(repeated.length > 0 ? { iterationsOverRepeatedState: repeated } : {}),\n ...(steps ? { steps } : {}),\n });\n }\n return loops;\n}\n\n"]}
|