@wildo-ai/dev-companion 1.1.12 → 1.1.13
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/services/coding-agent-dispatch.companion.service.d.ts.map +1 -1
- package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.js +8 -6
- package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.js.map +1 -1
- package/dist/esm/companion-api/controllers/companion.controller.d.ts +6 -0
- package/dist/esm/companion-api/controllers/companion.controller.d.ts.map +1 -1
- package/dist/esm/companion-api/controllers/companion.controller.js +13 -1
- package/dist/esm/companion-api/controllers/companion.controller.js.map +1 -1
- package/dist/esm/core/introspection/resources/creation-home-projection.companion.d.ts.map +1 -1
- package/dist/esm/core/introspection/resources/creation-home-projection.companion.js +7 -0
- package/dist/esm/core/introspection/resources/creation-home-projection.companion.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-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/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/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/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 +5 -0
- package/dist/esm/i18n/system_enums/application-creation.fr.d.ts.map +1 -1
- package/dist/esm/i18n/system_enums/application-creation.fr.js +5 -0
- package/dist/esm/i18n/system_enums/application-creation.fr.js.map +1 -1
- package/dist/esm/i18n/system_enums/workbench-build.en.d.ts +2 -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 +2 -0
- package/dist/esm/i18n/system_enums/workbench-build.en.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 +80 -4
- 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 +235 -42
- 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 +56 -3
- 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 +182 -33
- 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-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-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/playbook-run.companion.service.d.ts +67 -2
- 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 +243 -48
- package/dist/esm/meta-workflows/services/playbook-run.companion.service.js.map +1 -1
- package/package.json +17 -17
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coding-agent-dispatch.companion.service.js","sourceRoot":"","sources":["../../../../src/claude-cli/services/coding-agent-dispatch.companion.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgFG;;;;;;;;;;;;;AAEH,OAAO,EACL,gDAAgD,GAEjD,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACL,+BAA+B,EAC/B,qCAAqC,GACtC,MAAM,sEAAsE,CAAC;AAC9E,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAChF,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,EACL,wBAAwB,EACxB,sBAAsB,EACtB,4BAA4B,EAC5B,+BAA+B,EAC/B,iCAAiC,GAClC,MAAM,w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AK,CAAC;IACpB,IAAI,SAA8B,CAAC;IACnC,IAAI,QAAmC,CAAC;IACxC,MAAM,OAAO,GAAG,IAAI,OAAO,CAAI,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACjD,SAAS,GAAG,OAAO,CAAC;QACpB,QAAQ,GAAG,MAAM,CAAC;IACpB,CAAC,CAAC,CAAC;IACH,OAAO;QACL,OAAO;QACP,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;YACjB,IAAI,OAAO;gBAAE,OAAO;YACpB,OAAO,GAAG,IAAI,CAAC;YACf,SAAS,CAAC,KAAK,CAAC,CAAC;QACnB,CAAC;QACD,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE;YAChB,IAAI,OAAO;gBAAE,OAAO;YACpB,OAAO,GAAG,IAAI,CAAC;YACf,QAAQ,CAAC,KAAK,CAAC,CAAC;QAClB,CAAC;KACF,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,SAAS,kCAAkC,CAAC,IAAgD;IAC1F,MAAM,MAAM,GAAG,IAAI,CAAC,gBAAgB,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,SAAS,KAAK,uCAAuC,CAAC,CAAC;IAC1I,MAAM,OAAO,GAAG,MAAM,EAAE,OAA8D,CAAC;IACvF,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,OAAO,CAAC,OAAO,KAAK,QAAQ;QAAE,OAAO,EAAE,CAAC;IAC5E,OAAO,EAAE,0BAA0B,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,OAAO,OAAO,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;AACjJ,CAAC","sourcesContent":["/**\n * Application coding-task host — the typed Flows/Actors coding path.\n *\n * `runApplicationCodingTask` admits one typed `MetaWorkflow_ApplicationCodingTaskContract`\n * (the episode runtime's coding revision owner is the caller), renders its\n * prompt from the sealed contract, creates an `Actors_Task` row, spawns the\n * Claude CLI in the background against the application worktree, captures\n * a read-only git change set with per-file attribution, runs the contract's\n * registered verification checks, then PATCHes the task with status/output/\n * artifacts. One admission never spans the multi-minute run (P-16) —\n * callers await the settlement or poll `/tasks/actors/:taskId`. The raw\n * `POST /coding-agent/dispatch` endpoint (caller-composed prompt) was\n * deleted at the first-activation hard cut.\n *\n * # Locking & recursion cap (P-20 / P-19b / P-35)\n *\n * Runs are single-flight, serialized by a cross-process lock on the\n * dedicated target `<saasRoot>/.wildo-saas/state/workspace-mutation.lock`\n * (`withDedicatedFileLock` from `@wildo-ai/platform-config-lib`,\n * proper-lockfile pattern — an in-memory mutex alone is forbidden because\n * the CLI mutates the same worktree from other processes). An in-memory\n * flag fronts the lock for fast 409s. The lock is held for the WHOLE run.\n *\n * That is the SINGLE-FLIGHT mode. A CONCURRENT run (#1528, a parallel build\n * wave) holds no lock and takes it only around its commit, so the lock is\n * no longer the signal that \"a coding agent is running\" — the\n * `coding-run.heartbeat` beaten from the active-run set is (see\n * `CODING_RUN_HEARTBEAT_RELATIVE_PATH`).\n *\n * The P-35 recursion cap falls out structurally: a dispatched run that\n * calls dispatch (it has shell access and can read the machine-local\n * token) always finds the lock held by ITS OWN run and is rejected 409 —\n * a dispatched run can never dispatch. Deliberately, the lock does NOT\n * gate Paul's parallel sessions (P-19b): CLAUDE.md forbids session\n * coordination; per-file attribution is the compensation, not exclusion.\n *\n * ⚠️ **THE CAP IS A SIDE EFFECT OF THE LOCK BEING GLOBAL, AND #48 PROPOSES\n * MAKING IT PER-SCOPE.** Admission by disjoint mutation scopes deletes this\n * refusal silently: a recursing run asks for a task in ANOTHER module, is\n * found disjoint, and is admitted. Nothing throws, nothing logs, and the\n * first symptom is a fan-out nobody asked for — this repository's \"a\n * construct that refuses needs its paired path\" lesson running BACKWARDS,\n * with a refusal removed as a side effect, which is the harder direction to\n * notice.\n *\n * So the cap must become an EXPLICIT guard in the same change: a run's own\n * dispatch identity refused at admission regardless of scope disjointness.\n * Note that identity is the hard part and is not solved here — the child's\n * environment is composed by this service, but an HTTP request from the\n * agent's shell carries none of it, and the machine-local token the agent\n * reads is the same one an operator uses. Whoever scopes the lock owns\n * finding that channel; do not assume it exists.\n *\n * It is TRIPWIRED rather than left to memory. The single-flight tests below\n * dispatch the SAME scope twice, so they keep passing under scope-aware\n * admission and would let the cap vanish green. `refuses a second dispatch\n * whose mutation scope is DISJOINT — the P-35 recursion cap (#48)` varies\n * the scope on purpose and goes red instead.\n *\n * # Traceability (P-21)\n *\n * L2 runs dispatch through `AgentsBackendService.invokeAgent`, so they DO\n * reach the engine `AgentCallTraceSink` (on success and on failure, gated by\n * the agent-traceability policy and silent when no sink is bound) and they DO\n * run through the provider's Bottleneck limiter, which `executeAgentViaACP`\n * schedules the session on. The pre-ACP direct claude-cli lane bypassed both;\n * that is history, not the current shape. Two things still do not come free:\n * a NONE policy level or an unbound sink means no engine trace at all, so this\n * service also owns its companion-traceability events (DEBUG) and artifacts\n * (DEBUG_VERBOSE). The background phase runs under an INTERNAL trace session\n * (`createInternalSession`) because the HTTP request session ends at the\n * 202-style response.\n *\n * # Run limits (P-18)\n *\n * Defaults 30 min / 10 MiB; request-overridable up to hard caps\n * 60 min / 32 MiB. The byte cap REJECTS (kills the run), it does not\n * truncate. Args stay `--print` + `--model` (no extraArgs field), prompt\n * on stdin, env = `{ PATH, HOME, SHELL, TERM }` (composed inside\n * the ACP session runner).\n */\n\nimport {\n MetaWorkflow_ApplicationCodingTaskContractSchema,\n type MetaWorkflow_ApplicationCodingTaskContract,\n} from '@wildo-ai/saas-models/meta-workflows';\nimport {\n ApplicationSchemaPlanObligation,\n assessApplicationSchemaPlanObligation,\n} from '../../core/config/application-schema-plan-obligation.companion.utils';\nimport { isAbsolute, join, normalize, relative, sep, dirname } from 'node:path';\nimport { existsSync, readFileSync } from 'node:fs';\nimport { appendFile, mkdir, writeFile } from 'node:fs/promises';\nimport {\n CODING_ANSWERS_FILE_NAME,\n CodingQuestionAnswerer,\n getFamilyPackageRelativePath,\n renderCodingQuestionAnswerEntry,\n renderCodingQuestionAnswersHeader,\n} from '@wildo-ai/application-creation-runtime';\nimport { AcceptOrigin, ApplicationSpecificationFamily } from '@wildo-ai/saas-specifications/application-creation';\nimport { describeSpecificationDefinitionFault, SpecificationModuleFaultReading, specificationModuleFaultsAreAVerdict } from '@wildo-ai/saas-specifications';\nimport {\n AgentAnswerAttemptDecision,\n decideAgentAnswerAttempt,\n ParkedQuestionAnswerOutputSchema,\n ParkedQuestionAnswerVerdict,\n readParkedQuestionAnswers,\n renderParkedQuestionAnswerPrompt,\n withParkedQuestionAnswer,\n type ParkedQuestionAnswerOutput,\n type ParkedQuestionAnswerRecord,\n} from '../models/parked-question-answer.models';\nimport { PARKED_QUESTION_ANSWERER_AGENT_REF } from '../models/parked-question-answerer.actors-system.definitions';\nimport {\n applicationCodingExclusiveSubject,\n CODING_RUN_WINDOW_RETENTION_MS,\n CodingRunConcurrency,\n deriveInterferenceSuspected,\n describeRunConcurrency,\n failedVerificationBesideSiblings,\n isConcurrentRunSubject,\n selectBudgetCountingFailures,\n collectRunClaimedPaths,\n writtenLocationsOfSessionEvent,\n type CodingRunConcurrencyRecord,\n type CodingRunWindow,\n} from '../models/concurrent-coding-runs.models';\n\nimport { inject, injectable, optional } from 'inversify';\nimport {\n ActorsSystemBackendService,\n AgentsBackendService,\n ErrorBuilderBackendService,\n LoggerService,\n SAAS_SERVICE_TYPES,\n WorkerShutdownManagerBackendService,\n executeBoundedSubprocess,\n describeCaughtError,\n actorExecutionSuspensionRef,\n isActorExecutionNotSuspendedError,\n isActorExecutionSubjectBusyError,\n type ActorExecutionConclusion,\n type ActorExecutionOpenRequest,\n type ActorExecutionRunOptions,\n type ActorExecutionSuspensionRequest,\n type OpenedActorExecution,\n} from '@wildo-ai/saas-backend-lib';\nimport {\n Actor_Task_Topics,\n type AgentTraceContext,\n ErrorCustomMessageReference,\n ErrorType,\n FlowsActors_IO_PartKind,\n FlowsActors_Status,\n isWildoBackendError,\n type ArtifactInstance,\n type FlowsActors_Agent_Invocation,\n HumanDecision_FieldKind,\n HumanDecision_ResponseIntent,\n type HumanDecision_Request,\n describeModelProviderAccountRefusal,\n} from '@wildo-ai/saas-models';\nimport {\n CodingAgent_EndOfTurnClassification,\n CodingAgent_OperationContext_BaseSchema,\n CodingAgent_RunTaskInputSchema,\n CodingAgent_RunTaskOutputSchema,\n CodingAgent_SessionSuspensionSchema,\n CodingAgent_StopReason,\n type CodingAgent_RunTaskOutput,\n type CodingAgent_SessionSuspension,\n type CodingAgent_Usage,\n} from '@wildo-ai/external-connectors-models';\nimport {\n getWorkspaceMutationLockPath as resolveWorkspaceMutationLockPath,\n withDedicatedFileLock,\n} from '@wildo-ai/platform-config-lib';\n\nimport {\n CodingRunFailureAttribution,\n sanitizeWorkbenchCreationPlaneIdentity,\n Workbench_ParkedCodingQuestionOptionRef,\n WORKBENCH_PARKED_CODING_QUESTION_FIELD_REF,\n WORKBENCH_TASK_CORRELATION_DOMAIN,\n WorkbenchTaskCorrelationRef,\n FRONTEND_MODULES_REGISTRY_RELATIVE_PATH,\n FRONTEND_SETTINGS_HUB_CONFIG_RELATIVE_PATH,\n FrontendSettingsHubWiringFindingCode,\n frontendRegistryPassesSettingsHub,\n settingsHubConfigAuthorsRail,\n BuildTaskRearmReason,\n CreationDriveAcceptDisposition,\n type Wildo_Application_Actor_Task,\n} from '@wildo-ai/platform-core-shared';\nimport { COMPANION_SERVICE_TYPES } from '../../core/inject/models/service-types';\nimport type { CompanionContext } from '../../core/context/companion-context';\nimport { describeApplicationSpecificationModuleFault, readSpecificationsEvaluationFindings } from '../../core/context/companion-package-loaders.companion';\nimport { InFlightWorkHeartbeat } from '../../core/runtime/in-flight-work-heartbeat.companion';\nimport type {\n CompanionExecutionSessionContext,\n} from '../../core/traceability/companion-traceability.models';\nimport { CompanionTraceabilityLevel, CompanionTraceAliasKind } from '../../core/traceability/companion-traceability.models';\nimport { CompanionTraceabilityService } from '../../core/traceability/companion-traceability.service';\nimport { CompanionIntrospectionService } from '../../core/introspection/services/companion-introspection.companion.service';\nimport { CompanionExecutionsCompanionService } from '../../executions/services/companion-executions.companion.service';\nimport { CompanionActorTasksListQuerySchema, CompanionExecutionsListQuerySchema, type CompanionCodingAgentStatusResponse } from '../../companion-api/companion-api.schemas';\nimport { GitChangeSetCompanionService, isConcurrentHostLanePath, isOutsideApplicationRootPath } from './git-change-set.companion.service';\nimport { CodingRunWriteRegisterCompanionService, applicationRootSpellings } from './coding-run-write-register.companion.service';\nimport { PlaybookLaneBoundaryDecision } from '@wildo-ai/application-creation-runtime';\nimport {\n APPLICATION_CREATION_AUTONOMY_POSTURE,\n LaneBoundaryTreatment,\n laneBoundaryTreatmentFor,\n} from '../../meta-workflows/models/playbook-run-checkpoint.models';\nimport { AcceptedChangeCommitCompanionService, type BuildCheckpointOutcome } from './accepted-change-commit.companion.service';\nimport {\n readIsolatedVerificationRecheck,\n withIsolatedVerificationRecheck,\n type IsolatedVerificationRecheck,\n} from '../models/shared-tree-reconciliation.models';\nimport { listInFlightCodingRuns, type InFlightCodingRun } from './in-flight-coding-runs.companion';\nimport {\n APPLICATION_CODING_AGENT_BINDINGS,\n APPLICATION_CODING_TURN_CLASSIFIER_AGENT_REF,\n CodingTurnEndClassificationOutputSchema,\n APPLICATION_CODING_AGENT_REFS,\n APPLICATION_CODING_SYSTEM_REF,\n APPLICATION_CODING_WORKTREE_SUBJECT,\n isApplicationCodingAgentRef,\n resolveSelectedApplicationCodingAgentBinding,\n type ApplicationCodingAgentBinding,\n} from '../../meta-workflows/models/application-coding-agent.actors-system.definitions';\nimport { humanDecisionSettler } from '../../meta-workflows/models/human-decision-settler.models';\nimport { BRIEF_PROVENANCE_UNAVAILABLE_SOURCE_REF } from '../../meta-workflows/models/build-brief-content-trust.models';\nimport {\n ChangeSetAttributionClass,\n RESOURCES_REGISTRY_COULD_NOT_ASK_MARKER,\n DESIGN_SYSTEM_BRAND_ADVISORY_MARKER,\n DESIGN_SYSTEM_BRAND_COULD_NOT_ASK_MARKER,\n ApplicationCodingTaskDisposition,\n codingRunChangedNoFileOfItsOwn,\n deriveApplicationCodingTaskDisposition,\n CodingRunStart,\n deriveCodingRunFailureAttribution,\n verificationFailureIsCarried,\n deriveCodingRunStart,\n isAttributedToAnotherWriter,\n APPLICATION_CODING_CONTRACT_REFUSAL_MARKER,\n INTERRUPTED_AT_STARTUP_OUTPUT_FIELD,\n type ApplicationCodingTaskRunAdmission,\n type CodingRunOrigin,\n type ApplicationCodingTaskVerificationPlan,\n DISPATCH_DEFAULT_MAX_CAPTURED_BYTES,\n DISPATCH_DEFAULT_TIMEOUT_MS,\n DISPATCH_HARD_MAX_CAPTURED_BYTES,\n DISPATCH_HARD_MAX_TIMEOUT_MS,\n VerificationKind,\n renderApplicationCodingTaskAgentPrompt,\n resolveApplicationCodingTaskVerificationPlans,\n type GitChangeSetCapture,\n type GitWorktreeSnapshot,\n isClosingReport,\n parseClosingReportUnmetRequirements,\n parseClosingReportMetRequirements,\n SETTLED_HEAD_OUTPUT_FIELD,\n} from '../models/coding-agent-dispatch.models';\nimport { CodingSessionFrameRetention, type CodingSessionRetentionSummary } from '../models/coding-session-frame-retention';\nimport { isInfrastructureShapedAgentFailure, isProviderAccountAgentFailure, waitForApplicationPackagesPublished } from '../../core/runtime/dev-compile-quiet.companion';\nimport { readCodingAgentUsageLimit, readRecordedCodingAgentUsageLimit, type CodingAgentUsageLimit } from '../models/coding-agent-usage-limit.models';\nimport {\n describeVerificationToolUnavailableRefusal,\n normalizeHostCheckFailureMessage,\n refuseWhenVerificationToolIsAbsent,\n resolveExecutableOnPath,\n verbProbeKnowsTheVerb,\n VERIFICATION_HOST_FAILURE_REASK_MS,\n VerificationHostCause,\n VerificationToolUnavailableError,\n type VerificationToolUnavailableHold,\n} from '../models/verification-tool-availability.models';\nimport type { NetworkEnvironmentFailureKind } from '../../core/runtime/network-environment-failure.companion';\nimport {\n CODING_AGENT_CONNECTIVITY_WAIT_LIMIT_MS,\n nextCodingAgentConnectivityProbeDelayMs,\n deriveCodingRunNetworkFailure,\n readAgentPassageTexts,\n readCodingRunNetworkReport,\n isCodingAgentWorkFrame,\n networkFailureKindOfFailedProbe,\n type CodingAgentConnectivityLoss,\n readRecordedNetworkFailureKind,\n type CodingAgentConnectivityHold,\n type CodingAgentConnectivityProbeResult,\n} from '../models/coding-agent-connectivity.models';\nimport {\n composeCodingAgentRouteEnvironment,\n describeCodingAgentProbeRoute,\n probeCodingAgentRoute,\n readClaudeCodeSettingSources,\n readClaudeCodeSettingsEnvironments,\n resolveCodingAgentProbeRoute,\n type CodingAgentProbeRoute,\n} from '../models/coding-agent-route.models';\nimport type { Actors_Memory_Context } from '@wildo-ai/saas-models';\nimport { diagnoseCarriedVerificationFailure } from '../../meta-workflows/models/carried-verification-failure.models';\nimport { assemblyRepairRunInputField } from '../../meta-workflows/services/application-assembly-repair.companion.utils';\nimport {\n NothingToRearmError,\n readBuildTaskInterference,\n readBuildTaskRearm,\n readGivenLandedOverride,\n withBuildTaskInterference,\n withBuildTaskRearm,\n type BuildTaskInterference,\n type BuildTaskRearm,\n} from '../../meta-workflows/models/build-task-rearm.models';\nimport { withWebsiteCopyReview, type WebsiteCopyReview } from '../../meta-workflows/models/website-copy-review.models';\nimport { withWebsiteVisualReview, type WebsiteVisualReview } from '../../meta-workflows/models/website-visual-review.models';\nimport { checkWebsiteDemoScenarios } from '../../meta-workflows/services/website-demo-facts.models';\nimport { describeWorkspaceFreshness, readWorkspaceElements } from '../../core/introspection/workspace-elements.companion';\nimport { collectWebsiteDemoScenarios, WebsiteDemoScenarioCollectionFault } from '../../core/website/website-source-module.companion';\nimport {\n APPLICATION_CODING_RUN_CHECKPOINT_KIND,\n ApplicationCodingRunCheckpointSchema,\n isParkedCodingRunAnswerable,\n mergeResumedLegUsage,\n type ApplicationCodingRunCheckpoint,\n} from '../models/application-coding-run-checkpoint.models';\nimport { findApplicationDocumentationChapterFileFaults } from '../../technical-doc/services/technical-documentation-chapter-files.companion';\nimport { ACTOR_TASK_OUTPUT_FIELDS_HELD_ON_THE_TASK_ROW_ONLY } from '../../executions/models/execution-task-snapshot.models';\n\n/** The longest one read of the completed coding runs is shared, whatever else happens (#3204). */\nconst COMPLETED_CODING_TASKS_HOLD_MS = 5_000;\n\n/** How many completed coding runs the shared read holds: the most recently updated (see {@link CodingAgentDispatchCompanionService}). */\nconst COMPLETED_CODING_TASKS_WINDOW = 200;\n\n/**\n * The stored fields a listing of coding runs leaves out (#3204): the transcript, ~80% of a run's row and read only by the\n * workbench's single-row conversation, never by a listing (`ACTOR_TASK_OUTPUT_FIELDS_HELD_ON_THE_TASK_ROW_ONLY`).\n */\nconst CODING_RUN_LISTING_OMITTED_FIELDS: readonly string[] = ACTOR_TASK_OUTPUT_FIELDS_HELD_ON_THE_TASK_ROW_ONLY.map((field) => `output.${field}`);\n/**\n * The least time between two build checkpoints a settlement asks for (#3204). A minute keeps the history readable (a\n * checkpoint names the runs of its minute) and its cost negligible; a forced checkpoint (a wave's end) ignores it.\n */\nexport const BUILD_CHECKPOINT_MIN_INTERVAL_MS = 60_000;\n\n/** Fixed, non-overridable limits for the verification hook subprocess. */\nconst VERIFICATION_TIMEOUT_MS = 10 * 60_000;\n/** How often a READ of a hold whose command lacks the verb asks the command again, in the background (#3432); an admission always asks. */\nconst VERIFICATION_VERB_PROBE_INTERVAL_MS = 30_000;\n\n/** A check whose command is absent or lacks the verb (#3423, #3432), as the verification pass reports it to the hold. */\ntype UnavailableVerificationTool = Pick<VerificationToolUnavailableHold, 'hostCause' | 'command' | 'verbProbeArgs' | 'checkRef' | 'message'>;\n/** How long the running backend has to answer `/health/ready` (#2228). Readiness is a cheap probe; a backend slower than this is not serving. */\nconst BACKEND_READY_TIMEOUT_MS = 10_000;\n/** How much of the agent's final message a not-repaired verdict carries (#2409): enough for its reason, not its transcript. */\nconst OVERRIDE_NOT_REPAIRED_AGENT_SAY_CHARS = 600;\nconst VERIFICATION_MAX_CAPTURED_BYTES = 10 * 1024 * 1024;\n\n\n/** Tail size persisted on the task row; full streams go to traceability artifacts. */\nconst OUTPUT_TAIL_CHARS = 16_000;\n\ninterface ActiveRunState {\n taskId: string;\n startedAt: string;\n /** Cancels the in-flight coding session. Cooperative first, kill second. */\n abortController: AbortController;\n /** Whether it shares the tree with a wave (#1528); a concurrent run takes the workspace lock only to commit. */\n mode: CodingRunConcurrency;\n /**\n * Present once the run was CANCELLED and its park is being withdrawn — by its own chain on the way\n * out, or by a per-run cancel no chain held, whose guard entry this is (#1581, eighth to tenth reviews).\n * The entry stays registered meanwhile, so a person's answer is refused until the withdraw is done;\n * and a second cancel AWAITS this withdraw's outcome rather than starting another or guessing.\n */\n withdrawal?: Promise<CancelledParkOutcome>;\n /**\n * TRUE for the registration a per-run cancel takes while it withdraws a park no chain holds (#1581). It\n * holds the task against a concurrent answer and WRITES NOTHING, so it is never a live writer (#1805\n * review F4): counting it deferred reconciliations nothing would ever resume.\n */\n withdrawalGuard?: true;\n}\n\n/**\n * What became of a cancelled run's park (#1581, tenth review). Told apart because a person is told\n * which: a best-effort withdraw can fail, and the store can fail to answer at all.\n */\nexport enum CancelledParkOutcome {\n /** The park is gone — withdrawn now, or none was left to withdraw. */\n ENDED = 'ended',\n /** The withdraw failed and the question is still waiting. */\n STILL_WAITING = 'still-waiting',\n /** Neither could be confirmed: the run could not be read. */\n UNCONFIRMED = 'unconfirmed',\n}\n\n/**\n * A read that found NO park — the task, its execution or its wait is absent — as opposed to a read that\n * failed. The store's `NOT_FOUND` and the driver's `ACTOR_EXECUTION_NOT_SUSPENDED` are the only answers\n * that mean \"nothing is waiting here\"; anything else means \"could not tell\" (#1581, tenth review R10-1).\n */\nfunction isAbsentParkRead(error: unknown): boolean {\n return (error as { customMessageReference?: unknown } | null)?.customMessageReference === ErrorCustomMessageReference.NOT_FOUND\n || isActorExecutionNotSuspendedError(error);\n}\n\n/**\n * How a parked run's resume went (#1581, seventh review). The two answerers act on it: only a resume\n * that RAN can have parked again, and a person whose answer resumed nothing is told why.\n */\nenum ParkedRunResumeOutcome {\n /** The driver admitted the resume and the continued turn ran, however it then ended. */\n RAN = 'ran',\n /** An operator's cancel was found before any turn — before the driver moved anything, or just after, when the question is handed back — and the chain withdraws the park. */\n CANCELLED = 'cancelled',\n /** The driver refused before moving anything — the run no longer waits on this decision, or another run holds its subject. The park is as it was. */\n REFUSED = 'refused',\n}\ntype ParkedRunResume =\n | { readonly outcome: ParkedRunResumeOutcome.RAN | ParkedRunResumeOutcome.CANCELLED }\n | { readonly outcome: ParkedRunResumeOutcome.REFUSED; readonly refusal: unknown };\n\n/**\n * The trace half of one coding run: the internal session its writes are attributed to, and the\n * errors tracing itself raised — which feed the run's disposition, because required evidence that\n * could not be recorded makes a working result a `TRACEABILITY_FAILED` one.\n *\n * Opened BEFORE the engine drives the run (#1359) because the session is also the scope every actor\n * plane write of that run carries, and the driver takes its scope when the run starts.\n */\ninterface CodingRunTrace {\n readonly runSession: CompanionExecutionSessionContext | undefined;\n readonly runStep: ReturnType<CompanionTraceabilityService['createStep']> | undefined;\n readonly traceabilityErrors: unknown[];\n readonly traceBestEffort: (operation: string, write: () => Promise<void>) => Promise<void>;\n}\n\nenum CodingRunEnding {\n /** The agent stopped to ask the operator; the run waits on its execution and can be continued. */\n PARKED = 'parked',\n /** The disposition ladder classified the run — a working result or a reported failure, both terminal. */\n CONCLUDED = 'concluded',\n}\n\ntype CodingRunResult =\n | { readonly kind: CodingRunEnding.PARKED; readonly suspension: ActorExecutionSuspensionRequest; readonly output: unknown; readonly afterSettle: () => Promise<void> }\n | { readonly kind: CodingRunEnding.CONCLUDED; readonly conclusion: ActorExecutionConclusion; readonly output: unknown; readonly afterSettle: () => Promise<void> };\n\n/**\n * How many change-set file entries ride on the durable row's summary.\n *\n * A build task's change-set is a handful of files by construction — the task declares its mutation\n * scope — so this bounds the pathological case rather than the ordinary one. Chosen over \"all of\n * them\" because the row is read by a judge whose brief is assembled per run, and over \"none of them\"\n * because that is what made the judge answer INDETERMINATE about work it could not see.\n */\nconst CHANGE_SET_SUMMARY_FILE_LIMIT = 40;\n\n/**\n * Where this process says \"a coding agent is running\", app-root-relative. Beaten while ANY run is in\n * {@link CodingAgentDispatchCompanionService}'s active set — single-flight or concurrent, fresh or\n * resumed — and removed when none is.\n *\n * ## Why the lock is not enough\n *\n * The dev supervisor holds a restart while a coding run is in flight, because a restart kills the\n * agent with the companion (#1026). It used to know that from the workspace-mutation lock's heartbeat\n * alone. Since #1528 a CONCURRENT run holds no lock — it takes one only around its commit — so a\n * parallel build wave was invisible to the hold. Measured 2026-09-27 on Wonder Todos: a\n * `bottom_up.build-dispatch` ran five concurrent children, two of them edited the frontend, the\n * frontend's rebuild made the supervisor restart the companion onto it, and every child still running\n * was killed; the run ended \"the host running this execution stopped\" with no measurement.\n *\n * A COPY of `CODING_RUN_HEARTBEAT_RELATIVE_PATH` in\n * `scripts/dev-orchestrator/runtime-supervisor-lifecycle.mjs`, which cannot import this source; pinned\n * equal by `scripts/__tests__/runtime-supervisor-workspace-mutation-hold.test.mjs`.\n */\nconst CODING_RUN_HEARTBEAT_RELATIVE_PATH = '.wildo-saas/state/coding-run.heartbeat';\n\n/** How often that file's mtime is refreshed; the supervisor judges it stale at three times this (`AGENT_RUN_HEARTBEAT_STALE_MS`). */\nconst CODING_RUN_HEARTBEAT_INTERVAL_MS = 5_000;\n\n/** Local narrow: is this an indexable object (not null, not an array)? */\nfunction isRecordValue(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\n/**\n * What a settled application coding run ACTUALLY did, read back from its durable row.\n *\n * Admission and settlement are different instants, and the gap between them is the whole run. A\n * caller that reports the first as the second says a green thing about work that has not happened\n * — which is what `bottom_up.build-dispatch` did on its first playbook run: `finishedAt` equalled\n * the coding run's `startedAt` to the millisecond. So this is the shape a waiting caller reports\n * INSTEAD of its own admission.\n *\n * `succeeded` is the durable row's own verdict, never re-derived here: the disposition ladder that\n * produced it (agent failure → capture failure → verification failure → traceability failure →\n * working result) lives at the one site that can see all four, and a second opinion computed from\n * a subset would disagree with it eventually.\n */\n/**\n * A run a restart stopped while it was writing (#1805): a coding run or a generation step, as the startup\n * sweeps report it, for the one recovery over every such run.\n */\nexport interface InterruptedRun {\n /** The run's durable task id — where its baseline lives, and its write record's key. */\n readonly taskId: string;\n /**\n * TRUE when the run held only its own task, so siblings wrote in the same tree beside it (#1528). Its\n * capture then holds files that may be theirs, and nothing that survived the restart says which.\n */\n readonly sharedTree: boolean;\n}\n\nexport interface ApplicationCodingTaskSettledOutcome {\n readonly taskId: string;\n /** The build-plan task this run was dispatched for, when the row records one. */\n readonly taskRef: string | null;\n /** The durable actor-task status: COMPLETED, FAILED, ABORTED, CANCELLED — or AWAITING_APPROVAL for a parked run (#1359). */\n readonly status: string;\n readonly succeeded: boolean;\n readonly disposition: string | null;\n /**\n * The run PARKED asking the operator a question, so it is neither finished nor failed. Its row\n * WAITS (`AWAITING_APPROVAL`), and reporting that as a failure would tell an operator to\n * re-dispatch work that is one answer away from continuing. Read from the STATUS, not from the\n * question left on the output — a withdrawn park keeps its output and is waiting for nobody.\n */\n readonly awaitingAnswer: boolean;\n /** Named, not counted: a caller that must say WHY a run failed cannot do it from a number. */\n readonly failedVerificationRefs: readonly string[];\n /**\n * Every verification check the run gated on, pass or fail. The `dispatch-outcome-sound` treatment's\n * first criterion reads exactly this — \"every required verification check succeeded\" — and it cannot\n * be answered from the failures alone: a run that ran NO checks and a run that passed three are\n * indistinguishable once only the empty failure list survives.\n */\n readonly verification: ReadonlyArray<{ readonly checkRef: string; readonly success: boolean }>;\n /** The run's change-set as the host sealed it (shas, whether HEAD moved, stats), carried verbatim. */\n readonly changeSetSummary: Record<string, unknown> | null;\n /**\n * What the run changed OUTSIDE its declared scope, RECORDED rather than refused (2026-09-13). It may\n * include a parallel session's edits, which is why it is evidence for a reviewer and not a verdict.\n */\n readonly scopeAssessment: Record<string, unknown> | null;\n /**\n * Why the agent's turn ended. A turn that stopped on `max_tokens` or `refusal` leaves a partial change\n * set that looks exactly like a complete one from the diff alone.\n */\n readonly agentStopReason: string | null;\n}\n\n/** One live frame relayed to an SSE subscriber: an agent event or a ladder state change. */\nexport interface CodingSessionLiveFrame {\n readonly channel: 'event' | 'state';\n readonly payload: unknown;\n}\n\ninterface VerificationOutcome {\n kind: VerificationKind;\n path: string | null;\n success: boolean;\n message: string;\n stdoutTail: string;\n stderrTail: string;\n /**\n * What exactly failed, one identity per finding, for a check that can fail for more than one reason. A check already\n * red at baseline is forgiven only for these: a new finding in it is the run's. Absent when a check cannot say, and\n * then the check is forgiven as a whole.\n */\n failureFindings?: readonly string[];\n /**\n * Advice a check gives without failing (#2818), one sentence each. A passing check's output reaches no reader, so a\n * check with something to say on a pass lifts it here, and the commit body prints it beside \"passed\".\n */\n advisories?: readonly string[];\n}\n\n/**\n * What changed inside the run window outside the sealed task scope — RECORDED for the reviewer, never\n * a reason to fail the run. See {@link assessApplicationCodingTaskMutationScope} for why.\n */\ninterface ApplicationCodingTaskScopeAssessment {\n /**\n * Changed-during-run paths (application-relative) that fall outside `allowedPathPrefixes` or inside\n * `prohibitedPathPrefixes`. This run's work OR a parallel session's — the change set cannot tell\n * which, so this is a list to read, not a verdict.\n *\n * Never a path ABOVE the application root (#1020). Such a path is keyed `../…` and lands in the\n * change set as `OUTSIDE_APPLICATION_ROOT` — visible and counted there — but a task scope is\n * application-relative by contract and could never have admitted it, so listing it here would only\n * ever name other sessions' edits elsewhere in the repository. Measured: 38 of 39 on one run.\n */\n outOfScopePaths: string[];\n /**\n * Every changed path the scope list above DELIBERATELY drops, each with the attribution class that\n * dropped it: committed inside the window, written by a concurrent companion lane, or above the\n * application root.\n *\n * The exclusions themselves are right and unchanged — a task scope is application-relative and could\n * never have admitted a `../…` path (#1020); a commit inside the window empties the dirty set every\n * other class is computed from; a concurrent lane's writes are not this run's to answer for. What was\n * missing is that a reader could not tell a deliberate exclusion from an omission.\n *\n * The evaluation treatment's judge found that twice in one hour on 2026-09-16, about a DIFFERENT\n * class each time — first `outside_application_root` (\"the evidence therefore does not account for\n * it\"), then `committed_during_run` (\"only labeled `committed_during_run`; it is not listed in\n * `outOfScopePaths` or otherwise accounted for\"). Reporting one class and excluding three is what\n * made the second finding inevitable, so this is total over the predicate rather than a list of the\n * classes anyone has complained about so far.\n */\n excludedFromScopeAssessment: Array<{ path: string; attribution: ChangeSetAttributionClass }>;\n /**\n * A commit landed inside the run window, so this window's attribution is\n * INCOMPLETE: a commit empties the dirty set every other class here is\n * computed from, and a parallel session's commit is indistinguishable from\n * the agent's own.\n *\n * RECORDED, NOT REFUSED — decided 2026-08-19, and the reasoning is the same\n * rule the plan applies to every other strictness in this vertical: exactness\n * is retained where a protected, accepted-state or real-effect consumer needs\n * it, and nowhere else. A coding run produces a WORKING result; it mutates no\n * accepted truth. Refusing the whole run here bought no protection of\n * anything accepted, while on a shared tree with parallel sessions ANY commit\n * overlapping ANY run — including one touching nothing the agent touched —\n * failed that run, with no worktree isolation to fall back on (ruled out for\n * this application) and no remedy a single session can enforce.\n *\n * What replaces the refusal is visibility that a consumer cannot miss: the\n * committed paths are recovered into the change set as\n * `COMMITTED_DURING_RUN`, and this flag rides on the recorded result. The\n * OBLIGATION moves with it — whatever later accepts this working result must\n * treat `historyMutated` as attribution it cannot rely on, and must not\n * promote it without review. That obligation belongs to whoever reviews and\n * commits the result: no code reads `historyMutated`.\n */\n historyMutated: boolean;\n}\n\n/**\n * Which changed-during-run paths fall outside the task's declared scope. RECORDED, NOT REFUSED.\n *\n * Decided by Paul, 2026-09-13, after measuring what the refusal cost. `build-task-company-config` made\n * its two in-scope edits, stopped at `end_turn`, and was recorded failed — against three\n * `marketing/website` files a parallel Claude Code session edited inside the run window. The capture\n * compares a snapshot at dispatch with one at the end, so a file that was clean at dispatch and dirty\n * at the end is `RUN_EXCLUSIVE` whoever wrote it. On a tree where several sessions work at once, that\n * made EVERY coding run fail the moment anyone touched anything else: the intended use — hand the\n * Wildo lane a change and keep editing elsewhere meanwhile — could not work at all.\n *\n * The same reasoning was already applied twice and is now applied everywhere: a commit landing\n * mid-run (2026-08-19) and a concurrent research lane (2026-09-09) were each excluded because they\n * cannot be attributed. A parallel session's uncommitted edit is the same fact, and it cannot be\n * listed by root, so the refusal itself is what goes. This is also the application-creation\n * directive: mutation is free, git makes every change visible and reversible, and acceptance is the\n * commit — a restriction arrives later as a judge reading this list, never as a refusal in the lane.\n *\n * What stays enforced is the agent's OWN act: an edit whose permission request declares a location\n * outside the scope is still denied in flight by the runner. What this list adds is visibility for\n * what that guard cannot see — shell commands, which declare no location, and other people's edits.\n * One limit on that: for an application nested inside its repository, a NEW untracked file created\n * OUTSIDE the application is not listed, because `ls-files --others` run from the application root sees\n * only untracked files beneath it. A shell write escaping the application is visible here when it\n * modifies a tracked file, not when it creates one. Verification runs regardless.\n * assurance-control: WILDO.SOFTWARE.AI_PRODUCED_CHANGE_CONTROL — what a run changed outside its task's scope inside the application, shell writes included, is recorded on its result; a new file a shell command creates outside the application is the one change this list cannot see.\n */\nfunction assessApplicationCodingTaskMutationScope(\n changeSet: GitChangeSetCapture,\n allowedPrefixes: readonly string[],\n prohibitedPrefixes: readonly string[],\n): ApplicationCodingTaskScopeAssessment {\n const normalizedAllowed = allowedPrefixes.map(normalizeApplicationRelativePrefix);\n const normalizedProhibited = prohibitedPrefixes.map(normalizeApplicationRelativePrefix);\n /*\n * Committed paths are deliberately EXCLUDED from the scope decision. They are\n * present in `changeSet.files` (as `COMMITTED_DURING_RUN`) so nothing is\n * invisible, but nobody can attribute them: a parallel session's commit and\n * the agent's own look identical from here, so listing them would record\n * other people's work as this run's. `historyMutated` carries that fact forward\n * instead, for whoever reviews the result.\n */\n /*\n * A disappearance is only listed when the run can be held responsible for it, and a commit\n * landing inside the window is precisely when it cannot.\n *\n * `disappearedFromBaseline` is \"dirty at baseline, no longer dirty post-run\", which has two\n * causes that look identical from here: the agent reverted or deleted the file (attributable,\n * and a real boundary breach if the path is out of scope), or a commit emptied the dirty set\n * (not attributable — a parallel session's commit and the agent's own are indistinguishable,\n * which is the exact reasoning the `COMMITTED_DURING_RUN` exclusion above already applies).\n *\n * Including them unconditionally made the two treatments contradict each other: the committed\n * PATHS were excluded as unattributable while the disappearance THAT SAME COMMIT CAUSED was\n * used to fail the run. Measured 2026-08-28 on wonder-crm — a run that stopped cleanly at\n * `end_turn`, honoured every permission decision and wrote NOTHING (`runExclusive: 0`,\n * `appearedDuringRun: 0`) was recorded `mutation_scope_violation` against 13 engine paths it\n * never touched, because a human committed at 17:47:56 and 17 baseline-dirty files left the\n * set. The field's own contract already said they \"are NOT attributed change-set entries\".\n *\n * So the exclusion is conditional, not blanket: with no commit in the window a disappearance\n * IS the run's doing and is still listed. Only the case the run cannot be responsible for is\n * dropped, and it stays visible — the paths remain on `disappearedFromBaseline`, and\n * `historyMutated` tells the reviewer the window is unattributable.\n */\n const disappearancesAttributableToTheRun = changeSet.headMovedDuringRun\n ? []\n : changeSet.disappearedFromBaseline;\n\n /*\n * A CONCURRENT_HOST_LANE path is excluded for the same reason a committed one\n * is, and the exclusion is applied in the same place for the same reason: it\n * belongs to a companion lane that runs INSIDE this window and is not this\n * run's to write. The research dispatch takes no workspace-mutation lock by\n * design — it mutates nothing but its own evidence store — and that store is\n * committable and therefore fully visible here, so before this filter (2026-09-09,\n * while this check still refused) one `POST /api/companion/research` overlapping\n * a coding run failed the coding run as `MUTATION_SCOPE_VIOLATION` against files\n * it never touched. Today nothing refuses; the filter keeps another lane's\n * writes off the out-of-scope list the reviewer reads, so that list names only\n * paths that could be this run's.\n *\n * Both halves are filtered, and the second is easy to miss: an entry carries\n * an attribution class, while a DISAPPEARANCE is a bare path — so the\n * disappearance of an evidence file a research round rewrote or deleted would\n * otherwise be listed. One predicate answers both (its own contract says why it\n * is exported).\n */\n /*\n * And a path ABOVE THE APPLICATION ROOT is excluded on the same terms (#1020): the scope this list\n * is compared against is application-relative, so `../engine/…` can never be admitted by it, and on a\n * monorepo checkout such a path is another session's edit — 38 of the 39 paths one run was recorded\n * against. The entry stays in the change set as `OUTSIDE_APPLICATION_ROOT` and is counted; the bare\n * disappearance is filtered by the same predicate, for the reason given above.\n */\n /*\n * THE exclusion predicate, named once and read twice: by the scope list that drops these entries and\n * by the record that names them. Deriving both from one function is the point — the previous shape\n * excluded three classes and reported one, which is how the judge came to read an unexplained gap\n * twice in an hour, about a different class each time.\n */\n const isExcludedFromScopeAssessment = isAttributedToAnotherWriter;\n const outOfScopePaths = [\n ...changeSet.files\n .filter((entry) => !isExcludedFromScopeAssessment(entry.attribution))\n .map((entry) => entry.path),\n ...disappearancesAttributableToTheRun.filter((path) => !isConcurrentHostLanePath(path) && !isOutsideApplicationRootPath(path)),\n ]\n .filter((path) => {\n const normalizedPath = normalizeApplicationRelativePrefix(path);\n const inAllowedScope = normalizedAllowed.some((prefix) => matchesApplicationRelativePrefix(normalizedPath, prefix));\n const inProhibitedScope = normalizedProhibited.some((prefix) => matchesProhibitedPrefix(normalizedPath, prefix));\n return !inAllowedScope || inProhibitedScope;\n });\n /*\n * Everything the scope list deliberately drops, named WITH THE CLASS that dropped it, so the record\n * reconciles itself instead of leaving a reader to infer an omission. Derived from the predicate\n * above, so a class added to the exclusion tomorrow is reported here the same day.\n */\n const excludedFromScopeAssessment = changeSet.files\n .filter((entry) => isExcludedFromScopeAssessment(entry.attribution))\n .map((entry) => ({ path: entry.path, attribution: entry.attribution }));\n return {\n // No field here gates the run: all are recorded for whoever reviews and commits this result.\n outOfScopePaths,\n excludedFromScopeAssessment,\n historyMutated: changeSet.headMovedDuringRun,\n };\n}\n\n/**\n * The LIVE counterpart of {@link assessApplicationCodingTaskMutationScope}:\n * decides, while the agent is still running, whether one absolute path is\n * inside the task's declared mutation scope.\n *\n * Deliberately reuses the SAME normalisation and boundary matching as the\n * post-hoc assessment. Two predicates answering \"is this path in scope?\" with\n * different rules would make the record contradict the guard — a path the live\n * guard permitted listed as out of scope afterwards, or a refused one missing\n * from that list's reasoning. (The post-hoc assessment only records since\n * 2026-09-13; the agreement still matters, because the reviewer reads both.)\n *\n * It NARROWS and never widens: the permission ceiling still decides the KIND of\n * operation, and this only refuses a path that ceiling would otherwise allow.\n * A path outside the workspace is refused outright rather than reasoned about.\n */\n/*\n * The option refs and the field ref moved to `@wildo-ai/platform-core-shared` on 2026-09-19, beside\n * the `workbenchParkedCodingQuestions` row that carries them to a browser. They are re-exported here\n * under their old names so this file's callers are unchanged, and there is ONE declaration.\n */\nexport { Workbench_ParkedCodingQuestionOptionRef as ParkedCodingQuestionOptionRef } from '@wildo-ai/platform-core-shared';\nexport { WORKBENCH_PARKED_CODING_QUESTION_FIELD_REF as PARKED_CODING_QUESTION_FIELD_REF } from '@wildo-ai/platform-core-shared';\n\n/**\n * Exported for tests that build the service without its constructor (field initializers do not run\n * under `Object.create`), so they read the PRODUCTION classification rather than a copy of it.\n */\nexport const CODING_RUN_OPTIONS: ActorExecutionRunOptions<CodingRunResult> = {\n suspendOn: (result) => (result.kind === CodingRunEnding.PARKED ? result.suspension : null),\n concludeAs: (result) => (result.kind === CodingRunEnding.CONCLUDED ? result.conclusion : null),\n};\n\n/**\n * Project a parked coding run as a decision a person can be shown.\n *\n * ONE free-text field, because that is what ACP gives us: `CodingAgent_SessionSuspension` carries the\n * agent's end-of-turn message and nothing structured. The payload's field set is general enough to\n * carry that as its degenerate case, which is the point of modelling a question as a field set rather\n * than as \"the question\".\n *\n * `resumable: false` is surfaced in the description rather than hidden: the question is still real,\n * but answering starts a NEW session that must restate the task context — a degradation the person\n * deciding should see, not one the caller should smooth over.\n */\nfunction projectParkedCodingQuestionAsDecision(parked: {\n /** The TASK id — the lane's handle everywhere (the answer door, the live stream, the board row). */\n readonly taskId: string;\n readonly taskRef: string;\n readonly suspension: { readonly question: string; readonly resumable: boolean };\n readonly parkedAt: string;\n}): HumanDecision_Request {\n return {\n decisionId: parked.taskId,\n title: parked.taskRef,\n description: parked.suspension.resumable\n ? 'The coding agent stopped to ask. Answering resumes the same session.'\n : 'The coding agent stopped to ask. This session cannot be re-entered, so answering starts a NEW one that must restate the task context.',\n fields: [{\n ref: WORKBENCH_PARKED_CODING_QUESTION_FIELD_REF,\n question: parked.suspension.question,\n kind: HumanDecision_FieldKind.FREE_TEXT,\n }],\n options: [\n { ref: Workbench_ParkedCodingQuestionOptionRef.ANSWER, label: 'Answer and continue', intent: HumanDecision_ResponseIntent.PROCEED_WITH_VALUES },\n { ref: Workbench_ParkedCodingQuestionOptionRef.CANCEL, label: 'Cancel this run', intent: HumanDecision_ResponseIntent.ABORT },\n ],\n requestedAt: parked.parkedAt,\n };\n}\n\nexport function buildApplicationCodingTaskLocationPredicate(\n workspaceRootPath: string,\n allowedPrefixes: readonly string[],\n prohibitedPrefixes: readonly string[],\n): (absolutePath: string) => boolean {\n const normalizedAllowed = allowedPrefixes.map(normalizeApplicationRelativePrefix);\n const normalizedProhibited = prohibitedPrefixes.map(normalizeApplicationRelativePrefix);\n\n /*\n * Compare against BOTH the configured root and its physical realpath.\n *\n * Agents report CANONICAL absolute paths. Measured live on 2026-08-27: with a\n * workspace under `/var/folders/...` (a macOS symlink to `/private/var/...`),\n * the agent's permission request named the `/private/...` form while the\n * configured root was the `/var/...` form, so an IN-SCOPE edit was refused and\n * the run reported the agent declining to do its job. A scope predicate that\n * silently denies everything is worse than one that denies nothing, because\n * it looks like the agent failing rather than the guard misfiring.\n */\n const candidateRoots = applicationRootSpellings(workspaceRootPath);\n\n // assurance-control: WILDO.SOFTWARE.AI_PRODUCED_CHANGE_CONTROL — a task's write scope admits only paths inside the application that its allowed prefixes cover and its prohibited prefixes do not, under either spelling of the root.\n return (absolutePath: string): boolean => {\n if (!isAbsolute(absolutePath)) {\n return false;\n }\n const relativePath = candidateRoots\n .map((root) => relative(root, absolutePath))\n .find((candidate) => candidate && !candidate.startsWith('..') && !isAbsolute(candidate));\n if (!relativePath) {\n return false;\n }\n const normalizedPath = normalizeApplicationRelativePrefix(relativePath.split(sep).join('/'));\n const inAllowedScope = normalizedAllowed.some((prefix) => matchesApplicationRelativePrefix(normalizedPath, prefix));\n const inProhibitedScope = normalizedProhibited.some((prefix) => matchesProhibitedPrefix(normalizedPath, prefix));\n return inAllowedScope && !inProhibitedScope;\n };\n}\n\n\nfunction normalizeApplicationRelativePrefix(value: string): string {\n return value.replace(/\\\\/g, '/').replace(/^\\.\\//, '').replace(/\\/+$/, '');\n}\n\n/**\n * A PROHIBITION matches case-insensitively (#3224 review): on a case-insensitive file system (macOS by default)\n * `Build-Task-Decisions.json` and `.Wildo-Saas/` ARE the prohibited entries, so an exact compare let a case variant through.\n * The allowed side stays exact: a prohibition may be wider than written, an admission may not.\n */\nfunction matchesProhibitedPrefix(path: string, prefix: string): boolean {\n return matchesApplicationRelativePrefix(path.toLowerCase(), prefix.toLowerCase());\n}\n\n/** Prefix matches require a path boundary: `src/app` does not admit `src/application`. */\nfunction matchesApplicationRelativePrefix(path: string, prefix: string): boolean {\n return path === prefix || path.startsWith(`${prefix}/`);\n}\n\n/** How long one read of the coding agent's login serves the polled status route (#1637). */\nconst CODING_AGENT_LOGIN_CACHE_MS = 60_000;\n\n/**\n * What a generation step that SHARED the working tree with concurrent coding runs may claim as its own (#2240):\n * the captured paths under the directories only it writes. Its capture also holds its siblings' writes, so a\n * path outside those directories is not its to be named for, and the wave reconciliation commits it, writer\n * unknown.\n *\n * The directories are the dispatch plan's writable roots for the step, derived from its evidence paths (the\n * label unit trees, the brand module's directory, the published documentation index, the migrations\n * directory), never a second hand-kept list. A coding run that edited a file under one of them anyway would\n * have it committed under the step's name; that is the step's tree, and the coding policy keeps the generated\n * documentation prefix out of a coding run's scope for exactly that reason.\n *\n * An entry may also name ONE FILE: a step `GENERATION_STEP_WRITE_SCOPE` scopes to its `EVIDENCE_FILES` (the\n * `design-tokens` stylesheet #2358, the `design-system-brand` module #2353, the `engine-capabilities` step's\n * `wildo.saas.config.ts` #2497, every file of the `display-name` step #2505 review F2). Such a file is NEVER claimed\n * here: other writers share it or the directory around it (frontend coding tasks write beside the stylesheet, coding\n * tasks write the configuration, website section tasks write the label packs), so claiming it would commit a concurrent\n * run's half-written edits under this step's name. It is left for the wave-end reconciliation, which commits it with its\n * siblings. A NESTED directory written without its trailing slash still claims what lies beneath it, and `src/app` never\n * claims `src/application`; a bare root-level name cannot be told from a root-level file, so it is dropped too. Every\n * root `resolveGenerationStepWritableRoots` answers for a directory carries its slash.\n */\nexport function claimGenerationStepOwnedPaths(capturedPaths: readonly string[], ownedPathPrefixes: readonly string[]): readonly string[] {\n // A file path read as a directory (`frontend/index.html/`) prefixes nothing, and a root-level file is dropped outright,\n // so neither is ever claimed.\n const prefixes = ownedPathPrefixes\n .filter((prefix) => prefix.length > 0 && prefix !== '/' && (prefix.endsWith('/') || prefix.includes('/')))\n .map((prefix) => (prefix.endsWith('/') ? prefix : `${prefix}/`));\n return capturedPaths.filter((capturedPath) => prefixes.some((prefix) => capturedPath.startsWith(prefix)));\n}\n\n@injectable()\nexport class CodingAgentDispatchCompanionService {\n private readonly logDebug: (message: string, context?: Record<string, unknown>) => void;\n\n /**\n * The CANCEL HANDLE of the coding session this process is driving — nothing more (#1361).\n *\n * Until 2026-09-20 this was also the single-flight flag (the \"fast 409\" in front of the lockfile),\n * and the status route's answer to \"is a run active\". Both now read the actor plane: a coding run\n * holds the engine's lease on the `worktree` subject, so the refusal and the badge are as true\n * after a restart, or from a second process, as inside the one driving the run. What cannot live\n * on a row is an `AbortController`, so that is what stays here.\n */\n private readonly activeRuns = new Map<string, ActiveRunState>();\n\n /**\n * The {@link CODING_RUN_HEARTBEAT_RELATIVE_PATH} beat, in step with {@link activeRuns}. Built on first\n * use, because harnesses build this service through `Object.create` and skip field initializers.\n */\n private codingRunHeartbeat: InFlightWorkHeartbeat | undefined;\n\n /**\n * How deeply each task's coding work is in flight — what the heartbeat reads, rather than\n * {@link activeRuns}'s size.\n *\n * `activeRuns` is keyed by task and RE-ENTERED: a run that parks on a question is resumed from inside\n * its own chain (#1559), and that resume swaps its own registration in under the same key and puts the\n * run's back afterwards (#1581). The heartbeat must not follow the set's size through that swap: a\n * resume with no run registered around it would be one entry that appears and disappears unsynced, and\n * a CONCURRENT run with no sibling would have the supervisor restart under it. So the heartbeat counts\n * depth: {@link registerActiveRun} adds one, {@link unregisterActiveRun} takes one, and the resume adds\n * and takes its own. The answer chain is held whole because it is registered whole (#1581). Built\n * lazily for the same `Object.create` reason as the beat itself.\n */\n private codingWorkDepth: Map<string, number> | undefined;\n\n private adjustCodingWorkDepth(taskId: string, delta: 1 | -1): void {\n this.codingWorkDepth ??= new Map();\n const next = (this.codingWorkDepth.get(taskId) ?? 0) + delta;\n if (next > 0) this.codingWorkDepth.set(taskId, next);\n else this.codingWorkDepth.delete(taskId);\n this.syncCodingRunHeartbeat();\n }\n\n private syncCodingRunHeartbeat(): void {\n // No application root, nowhere to beat — a harness, never a running companion. The beat describes\n // the run; it must never be able to fail it.\n const saasRoot = this.companionContext?.saasRoot;\n if (typeof saasRoot !== 'string') return;\n this.codingRunHeartbeat ??= new InFlightWorkHeartbeat(\n join(saasRoot, CODING_RUN_HEARTBEAT_RELATIVE_PATH),\n CODING_RUN_HEARTBEAT_INTERVAL_MS,\n (message, error) => this.logDebug(message, { error: describeCaughtError(error) }),\n );\n this.codingRunHeartbeat.sync((this.codingWorkDepth?.size ?? 0) > 0);\n }\n\n /**\n * Who cancelled a run, keyed by its ABORT CONTROLLER (#1751 review N2). A resumed turn swaps a new\n * registration in that SHARES the run's controller and restores the old one afterwards, so a field on\n * the registration was lost when a person cancelled during that turn; the controller is the one thing\n * both registrations hold. Not the abort REASON: consumers of the signal throw its reason, and the lane\n * classifies a cancelled turn by its AbortError.\n */\n private readonly cancellersByController = new WeakMap<AbortController, string>();\n\n /**\n * Every coding run's time in the tree, kept for the runs that overlap it (#1528): a concurrent run\n * records which runs shared the tree with it and which paths they both changed. Pruned to\n * {@link CODING_RUN_WINDOW_RETENTION_MS}; in-process, because the comparison is only ever made by\n * the process that drove both runs.\n */\n private codingRunWindows: CodingRunWindow[] = [];\n\n /**\n * The coding agent's account usage limit, while it lasts (#2388): set by the run that met it, released by\n * its reset or by a success whose run STARTED after the limit was met (an earlier sibling's success proves\n * nothing, #2388 review F4). The build wave reads it before it fills a slot\n * ({@link readCodingAgentUsageLimitHold}), so no turn is started into a window certain to refuse it.\n *\n * In-process on purpose, and that is also the operator's door: a hold is only ever a reason not to START\n * a turn, so losing it costs at most one turn, which meets the limit again, records it again and is\n * counted by nothing. Restarting the companion clears it — the way past a stated reset after switching\n * the agent's account, until a console verb exists for that. An explicitly dispatched single task\n * (`wildo build run <task>`) is never held: an operator who starts one is choosing to try, and its success —\n * a run started after the limit — releases the hold.\n */\n private codingAgentUsageLimitHold: (CodingAgentUsageLimit & { readonly taskRef: string; readonly runTaskId: string }) | undefined;\n\n /**\n * The network loss holding coding admissions (#3236): set by a run whose failure names the network, and by a\n * connectivity probe that fails (at admission, or at a cancelled turn's settlement on a host whose traffic goes\n * direct). Released by a probe of the agent's API that succeeds (at admission, at a settlement, or the background\n * probe that runs while it is open), by a success whose run STARTED after the loss was met, by a person's re-arm for\n * the environment, and, for an agent with no host to probe, after one interval's pause. While it holds,\n * {@link awaitCodingAgentConnectivity} keeps every new admission waiting on a probe, so no turn is started into a\n * network certain to fail it. See `coding-agent-connectivity.models.ts` for the probe and the bound.\n *\n * In-process, like the usage-limit hold and for the same reason: a hold is only a reason not to START a turn, so\n * losing it to a restart costs at most one turn, which meets the loss again and records it again.\n */\n private codingAgentConnectivityHold: CodingAgentConnectivityHold | undefined;\n\n /**\n * A verification check that cannot be asked for a host cause that will not clear on its own (#3423, #3432), one of\n * {@link VerificationHostCause}: set by the run that met it, released by its cause's probe (a PATH lookup for an absent\n * command, asking the command for the verb, a re-ask once `reaskAfter` passes), by a run that ASKED the held check, or by\n * a person's re-arm for the environment. While it holds, every coding admission probes first and is refused, without\n * spending an attempt, while the cause stands.\n *\n * An absent command and a command lacking the verb open on the FIRST run: their probes are free, so a hold opened\n * wrongly costs one probe, while each turn admitted into them costs a whole coding turn that its check then cannot\n * judge. Any other host cause opens once it repeats on two distinct tasks each run alone ({@link hostCheckFailureLedger}).\n * In-process, like the other holds: a restart loses it and the next run meets it again.\n */\n private verificationToolUnavailableHold: VerificationToolUnavailableHold | undefined;\n\n /**\n * Host-attributed check failures seen on runs that ran ALONE (#3432), keyed by check and normalized message, with the\n * tasks each was met on: two distinct tasks open a {@link VerificationHostCause.REPEATED_HOST_FAILURE} hold. A run that\n * ASKS the check clears its entries, since the cause is then gone. Kept across a re-ask, so the same failure on the run\n * a re-ask admits holds again at once rather than after two more tasks.\n */\n private hostCheckFailureLedger: Map<string, { readonly checkRef: string; readonly message: string; readonly taskRefs: Set<string> }> | undefined;\n\n /** {@link hostCheckFailureLedger}, created on first use. */\n private hostCheckFailures(): Map<string, { readonly checkRef: string; readonly message: string; readonly taskRefs: Set<string> }> {\n return (this.hostCheckFailureLedger ??= new Map());\n }\n\n /** The verb probe of a {@link VerificationHostCause.COMMAND_LACKS_VERB} hold in flight, and when the last one started. */\n private verbProbeInFlight: Promise<void> | undefined;\n private verbProbeStartedAtMs = 0;\n\n /**\n * Every network loss this process recorded, with when it was seen and when it ended, kept for the turns in flight\n * across it (#3236): a turn settling `cancelled` is the network's when it was running at a loss, did no work after\n * it, and settled while it held or within a grace after it ended (`deriveCodingRunNetworkFailure`). A loss is\n * recorded when a turn REPORTS the network and when a connectivity probe FAILS (at admission, or at a cancelled\n * turn's settlement), and it ends when the hold it opened is released. It outlives the hold, because the measured\n * turns settled on reconnect, after a probe could already have released it. Pruned to\n * {@link CODING_RUN_WINDOW_RETENTION_MS} after it ended.\n *\n * In-process, like the hold, and losing it to a restart costs nothing it was needed for: a coding turn cannot outlive\n * the process that drove it, so every turn whose attribution would read this record dies with it, and is settled\n * through the interrupted-run path at the next start rather than by this attribution.\n */\n private connectivityLosses: CodingAgentConnectivityLoss[] | undefined;\n\n /** The background probe of an open hold (re-review of 1da455d5d, R1), or undefined while no hold is open. */\n private backgroundConnectivityProbe: { readonly cancel: () => void } | undefined;\n\n /**\n * Who wants to know that a run's writes were committed by the loop (#1534).\n *\n * A commit LANDS a task, so every derived board that reads landing is stale the moment one is made.\n * The workbench's `accept` invalidates the creation-plane projection itself; the loop cannot,\n * because the projection already depends on THIS service and injecting it back would be a cycle.\n * So the dependency points the way it already does: the projection subscribes here.\n */\n private readonly runAcceptedListeners: Array<() => void> = [];\n\n public registerRunAcceptedListener(listener: () => void): void {\n this.runAcceptedListeners.push(listener);\n }\n\n /**\n * Who wants to know that a build task's RUN STATE changed (#1310) — every trigger is listed on\n * {@link announceRunStateChanged}: selected, started (fresh or resumed), settled, refused before\n * admission, re-armed, and a generation step opening and ending.\n *\n * Wider than {@link registerRunAcceptedListener} on purpose. Each moves the creation boards through\n * actor-plane state no file signature can see: a selected or started run is in flight to the\n * next-task selection, a settled one changes its dispatch row and can LAND a task declaring no\n * product (the RAN-not-PROVEN mark), a refusal leaves a counted failure, and a re-arm releases a task\n * the loop guard or attempt budget was holding — which is what un-stucks the eligibility board's\n * all-stuck gate. Same direction as the accepted-run seam, for the same reason: the projection\n * depends on this service, so it subscribes here.\n *\n * One timing is deliberate rather than exact: a run that PARKS inside a fresh chain is announced\n * when that chain ends, after the answering agent's turn, so for about one model call a cached\n * board may still count it as in flight. Announcing at the park would re-derive the boards and\n * then again at the chain's end, for a window that closes on its own.\n */\n private readonly runStateChangedListeners: Array<() => void> = [];\n\n public registerRunStateChangedListener(listener: () => void): void {\n this.runStateChangedListeners.push(listener);\n }\n\n /**\n * Who wants to know that a build task's coding run COMPLETED (#2593): the build task and the run, announced once per\n * run after its rows have moved and its writes were accepted under the posture. Separate from\n * {@link registerRunStateChangedListener}, which carries no identity because the boards only need to re-derive: a\n * listener here acts on ONE run (the build dispatch service reviews a website task's copy and records the review on\n * that run). Same direction as the other seams: the listener's service depends on this one.\n *\n * A listener must not hold the run up: it is called synchronously, inside the run's settle (a single-flight run still\n * holds the workspace lock there), so anything slow is started and left to finish on its own.\n */\n private readonly runCompletedListeners: Array<(completed: { readonly taskRef: string; readonly runTaskId: string }) => void> = [];\n\n public registerRunCompletedListener(listener: (completed: { readonly taskRef: string; readonly runTaskId: string }) => void): void {\n this.runCompletedListeners.push(listener);\n }\n\n private announceRunCompleted(completed: { readonly taskRef: string; readonly runTaskId: string }): void {\n for (const listener of this.runCompletedListeners) {\n try { listener(completed); } catch (error) { this.logDebug('A run-completed listener threw', { error: describeCaughtError(error) }); }\n }\n }\n\n /**\n * Every read-modify-write of a coding run's MEMORY goes through this one lane (#2593): a re-arm, an interference and\n * a copy review each append to the long-term store by writing the whole memory back, so two of them interleaved on\n * one run would drop the first one's entry. They used to be sequential by accident (the wave re-armed, then recorded\n * the interference); the copy review starts when a run completes, which is not ordered against either.\n */\n private runMemoryWrites: Promise<unknown> | undefined;\n\n /** Run `write` after every memory write already queued, whether those succeeded or not; `undefined` = none queued. */\n private serializeRunMemoryWrite<T>(write: () => Promise<T>): Promise<T> {\n // A run's memory is about to change: a per-task read held for a task outside the window may describe it (#3204).\n this.completedRunsOutsideWindow?.clear();\n const next = (this.runMemoryWrites ?? Promise.resolve()).then(write, write);\n // And once it has: a read made during the write may hold the rows as they were before it.\n this.runMemoryWrites = next.catch(() => undefined).finally(() => this.completedRunsOutsideWindow?.clear());\n return next;\n }\n\n /**\n * Tell the run-state-changed listeners, each isolated from the others.\n *\n * Called at every change to a build task's run state that no file shows:\n *\n * - **SELECTED** — {@link openSelectedApplicationCodingExecution} opened a PENDING execution, which\n * the next-task selection already counts as in flight, whichever door opened it;\n * - **STARTED** — a fresh run ADMITTED (after its active-run entry exists), and a resumed run once\n * the engine has moved its rows back to PROCESSING (inside `resumeParkedRunHoldingLock`'s\n * executor, the one moment its start is true);\n * - **SETTLED** — LAST in the `finally` of each TOP-LEVEL chain, a fresh run's background body and\n * `resumeBody`, after the parked-question answering, the active-run release and the settlement\n * resolve, so a board re-derived because of it reads the chain's final state. Never from inside\n * `resumeParkedRunHoldingLock`'s own `finally`, which is a step of a chain some caller settles.\n * Every ending reaches it, including the ones that returned early;\n * - **RE-ARMED** — {@link rearmBuildTask}, even when one of its updates threw.\n *\n * Public because a GENERATION STEP's execution and a coding dispatch refused before admission are\n * opened and settled by the build dispatch service, so that service announces those.\n */\n public announceRunStateChanged(): void {\n // Every held read of the run rows describes the state before this change (#3204).\n this.markRunRowsChanged();\n for (const listener of this.runStateChangedListeners) {\n try { listener(); } catch (error) { this.logDebug('A run-state-changed listener threw', { error: describeCaughtError(error) }); }\n }\n }\n /**\n * Per-process settlement signal of every application coding task THIS\n * process admitted: resolved when the background run has recorded its\n * terminal durable result (or given up trying). This is the \"owner's\n * completion hook\" the episode driver waits on instead of polling the\n * Actor Task row; a task admitted by a previous process has no entry here,\n * which is correct — restart reconciliation already terminalized it.\n */\n private readonly applicationCodingTaskSettlements = new Map<string, { readonly promise: Promise<void>; resolve(): void }>();\n\n /**\n * The driver's reading of what a coding run's executor returned — see {@link CodingRunResult}.\n * One object for a first run and a resumed one, so the two cannot be read by different ladders.\n */\n private readonly codingRunOptions: ActorExecutionRunOptions<CodingRunResult> = CODING_RUN_OPTIONS;\n\n /**\n * Live-frame subscribers keyed by task id. Fed by the coding session's own\n * event stream and the ladder's state transitions while a run is active;\n * drained by the SSE endpoint. Best-effort throughout — a slow or throwing\n * subscriber never touches the run it observes.\n */\n private readonly codingSessionSubscribers = new Map<string, Set<(frame: CodingSessionLiveFrame) => void>>();\n\n constructor(\n @inject(SAAS_SERVICE_TYPES.Logger)\n private readonly logger: LoggerService,\n @inject(SAAS_SERVICE_TYPES.ErrorBuilderService)\n private readonly errorBuilder: ErrorBuilderBackendService,\n @inject(COMPANION_SERVICE_TYPES.CompanionContext)\n private readonly companionContext: CompanionContext,\n @inject(SAAS_SERVICE_TYPES.AgentsBackendService)\n private readonly agentsService: AgentsBackendService,\n @inject(COMPANION_SERVICE_TYPES.GitChangeSetService)\n private readonly gitChangeSetService: GitChangeSetCompanionService,\n @inject(COMPANION_SERVICE_TYPES.ExecutionsService)\n private readonly executionsService: CompanionExecutionsCompanionService,\n @inject(COMPANION_SERVICE_TYPES.TraceabilityService)\n private readonly traceabilityService: CompanionTraceabilityService,\n @inject(COMPANION_SERVICE_TYPES.IntrospectionService)\n private readonly introspectionService: CompanionIntrospectionService,\n // The engine's execution driver (#1359): it opens, suspends, resumes and settles every coding run.\n @inject(SAAS_SERVICE_TYPES.ActorsSystemBackendService)\n private readonly actorsSystem: ActorsSystemBackendService,\n // Which paths each run changed, attributed and hashed — what the workbench's `accept` commits (#1454, Step 7).\n @inject(COMPANION_SERVICE_TYPES.CodingRunWriteRegisterService)\n private readonly codingRunWriteRegister: CodingRunWriteRegisterCompanionService,\n // The commit door the workbench's `accept` uses — called from here only under the posture (#1534).\n @inject(COMPANION_SERVICE_TYPES.AcceptedChangeCommitService)\n private readonly acceptedChangeCommit: AcceptedChangeCommitCompanionService,\n /*\n * Whether this process is shutting down (#1026): a run admitted after the supervisor decided to\n * restart would be killed with it. `@optional()` because an in-process host that never registers\n * shutdown has nothing to refuse on, and test harnesses built without it admit as before.\n */\n @inject(SAAS_SERVICE_TYPES.WorkerShutdownManagerService) @optional()\n private readonly shutdownManager?: WorkerShutdownManagerBackendService,\n ) {\n this.logDebug = this.logger.debugByType('CodingAgentDispatchCompanionService');\n this.logger.setDebugTypeLogging('CodingAgentDispatchCompanionService', true);\n }\n\n /**\n * Admit one application-authored coding task onto the normal Flows/Actors\n * Claude Code path — the ONLY coding entry since the raw dispatch endpoint\n * was deleted at the first-activation hard cut. This method accepts only the\n * sealed typed task produced by application composition. The returned\n * acknowledgement is intentionally non-terminal; a completed Actor Task\n * records a working code result and its evidence, never accepted\n * application truth.\n */\n public async runApplicationCodingTask(\n rawTask: MetaWorkflow_ApplicationCodingTaskContract,\n sessionContext?: CompanionExecutionSessionContext,\n /**\n * The execution a caller opened when it SELECTED this task\n * ({@link openSelectedApplicationCodingExecution}). Admission then STARTS that execution instead\n * of opening one, so the run has one pair of ids from selection to settlement. The caller owns it\n * until this method resolves: a rejection here means the run never started, and the caller\n * settles what it opened.\n */\n selected?: OpenedActorExecution,\n /** Where the run was started from (#1454, Step 7): stamped on the row, never read by the run. */\n origin?: CodingRunOrigin,\n /**\n * CONCURRENT only from the build loop's wave (#1528), which opened `selected` in the same mode.\n * Every other door is single-flight, and single-flight refuses while any concurrent run is live.\n */\n mode: CodingRunConcurrency = CodingRunConcurrency.SINGLE_FLIGHT,\n ): Promise<ApplicationCodingTaskRunAdmission> {\n /*\n * Both admission refusals below are TYPED.\n *\n * A malformed contract surfaced as a raw `ZodError` and an unregistered\n * check ref as a plain `Error`, so the two refusals a caller can actually\n * provoke reached the transport as unclassified failures and answered 500\n * INTERNAL — indistinguishable from the host being broken. They are\n * VALIDATION: the request is refused, nothing was locked, created or run.\n */\n const task = this.admitTypedInput(\n () => MetaWorkflow_ApplicationCodingTaskContractSchema.parse(rawTask),\n 'Application coding task contract is not valid.',\n { refusesTaskContract: true },\n );\n // Resolve before acquiring the lock or creating a task. A semantic check\n // name is not a command and cannot silently fall back to an arbitrary\n // workspace typecheck.\n const verificationPlans = this.admitTypedInput(\n () => resolveApplicationCodingTaskVerificationPlans(task.verificationIntent.requiredChecks),\n 'Application coding task names an unregistered verification check.',\n { refusesTaskContract: true },\n );\n const traceStep = this.createOperationTraceStep(sessionContext, 'application-coding-task-admission');\n const renderedPrompt = renderApplicationCodingTaskAgentPrompt(task);\n await this.traceOperationStart({\n sessionContext,\n step: traceStep,\n type: 'application-coding-task-admission-start',\n summary: `Admit application coding task ${task.taskRef}`,\n payload: this.buildApplicationCodingTaskTraceSummary(task),\n artifactFileName: 'application-coding-task-input.txt',\n artifactContent: renderedPrompt,\n });\n\n // The FAST 409, read from the rows (#1361): a run holding the worktree that is not the one this\n // call was handed. The authoritative take is the driver's, at open — this only answers early,\n // with the holder named, instead of making the caller wait on the file lock to be told the same.\n await this.refuseWhileWorktreeIsHeld(selected?.executionId ?? null, sessionContext);\n if (mode === CodingRunConcurrency.SINGLE_FLIGHT) await this.refuseWhileConcurrentRunsInFlight(sessionContext);\n\n /*\n * Not into a network that just took a run away (#3236). Before the worktree lock, so a single-flight wait holds\n * nothing another run needs, and before anything is opened, so a refusal past the bound leaves no attempt.\n */\n await this.awaitCodingAgentConnectivity(task.taskRef);\n // Nor while a check cannot be asked for a host cause (#3423, #3432): every task's check would fail the same way.\n await this.refuseWhileVerificationToolIsUnavailable(task.taskRef);\n\n const admission = createDeferred<{ opened: OpenedActorExecution; baseline: GitWorktreeSnapshot }>();\n const runBody = async () => {\n let admitted: { opened: OpenedActorExecution; baseline: GitWorktreeSnapshot };\n /*\n * Not while this process is going away (#1026). The supervisor's restart HOLD reads the\n * workspace lock, so it protects a run that already holds it — but a dispatch still waiting\n * (the compile-quiet wait before admission) holds none, the supervisor restarts, and the SIGTERM\n * grace lets this process admit it anyway: measured 2026-09-25, a run was admitted at 11:18:12,\n * five seconds after the supervisor's stop began, and was SIGKILLed with the companion. Checked\n * here, under the lock and before anything is opened, so the refusal leaves no row behind and is\n * a HOST refusal (it counts against no attempt budget, #1581).\n */\n if (this.shutdownManager?.isShutdownInProgress() === true) {\n admission.reject(this.buildDispatchConflictError(\n `Coding task ${task.taskRef} was not started: the companion is shutting down. Dispatch it again once it is back.`,\n ));\n return;\n }\n // Before the baseline, never inside the run: a playbook file left uncommitted here would be\n // dirty at this run's baseline, and this run's own accept would then refuse it (#1534). A\n // concurrent run holds no lock, so it takes one for this commit only.\n await (mode === CodingRunConcurrency.CONCURRENT\n ? this.underBriefWorktreeLock(() => this.acceptPendingPlaybookRunsBeforeBaseline())\n : this.acceptPendingPlaybookRunsBeforeBaseline());\n try {\n const baseline = await this.gitChangeSetService.captureWorktreeSnapshot();\n // The run IS an actor-system execution from here on (#1359): the engine opens the\n // execution and its task, and will settle both however the run ends.\n const opened = selected\n ? await this.startSelectedApplicationCodingExecution(selected, task, baseline, sessionContext, origin)\n : await this.openApplicationCodingExecution(task, baseline, sessionContext, origin, mode);\n this.registerActiveRun({\n taskId: opened.taskId,\n startedAt: new Date().toISOString(),\n abortController: new AbortController(),\n mode,\n });\n this.openCodingRunWindow(opened.taskId, task.taskRef);\n // Started: the run has left the next-task selection's ready set, and no file says so yet.\n this.announceRunStateChanged();\n admitted = { opened, baseline };\n // Registered BEFORE the admission is resolved, so a caller that\n // awaits the settlement right after admission can never miss it.\n const settlement = createDeferred<void>();\n this.applicationCodingTaskSettlements.set(opened.taskId, { promise: settlement.promise, resolve: () => settlement.resolve(undefined) });\n admission.resolve(admitted);\n } catch (error) {\n admission.reject(this.translateWorktreeBusy(error));\n return;\n }\n\n try {\n const trace = await this.openCodingRunTrace(admitted.opened.taskId, task.taskRef);\n await this.superviseCodingRun(task.taskRef, admitted.opened.taskId, trace, (capture) =>\n this.actorsSystem.completeActorExecution(\n admitted.opened,\n async (opened) => capture(await this.executeApplicationCodingTask(task, renderedPrompt, verificationPlans, opened, admitted.baseline, trace)),\n trace.runSession,\n this.codingRunOptions,\n ));\n // Before the settlement resolves and before the worktree is released: a question the run\n // parked on is offered to the answering agent while nothing else can take the worktree (#1559).\n await this.answerParkedQuestionsHoldingLock(admitted.opened.taskId, sessionContext);\n } finally {\n this.endCodingRunWindow(admitted.opened.taskId);\n // A run cancelled while its question was handled ends here rather than staying parked (#1581). Awaited\n // only when cancelled, so a chain that was not unregisters in the same synchronous step as its check.\n if (this.isRunCancelled(admitted.opened.taskId)) await this.withdrawCancelledRunChain(admitted.opened.taskId, sessionContext);\n this.unregisterActiveRun(admitted.opened.taskId);\n this.applicationCodingTaskSettlements.get(admitted.opened.taskId)?.resolve();\n this.announceRunStateChanged();\n }\n };\n /*\n * A SINGLE-FLIGHT run holds the workspace lock for its whole life, as it always has. A CONCURRENT\n * run holds none (#1528): the tree is shared by decision, and interference is detected and\n * repaired rather than prevented. It takes the lock only around a commit.\n */\n const backgroundRun = mode === CodingRunConcurrency.CONCURRENT\n ? runBody()\n : withDedicatedFileLock(this.getWorkspaceMutationLockPath(), runBody, { retries: { retries: 0 } });\n backgroundRun.catch((error: unknown) => {\n admission.reject(this.mapLockError(error));\n this.logDebug('Application coding-task background run chain terminated with error', {\n error: describeCaughtError(error),\n taskRef: task.taskRef,\n });\n });\n\n const admitted = await admission.promise;\n const response: ApplicationCodingTaskRunAdmission = {\n taskId: admitted.opened.taskId,\n status: FlowsActors_Status.PROCESSING,\n taskRef: task.taskRef,\n baselineHeadSha: admitted.baseline.headSha,\n baselineDirtyFileCount: Object.keys(admitted.baseline.files).length,\n };\n /*\n * The run has STARTED by now, so nothing after this point may reject: a caller reads a rejection\n * from this method as \"the run never started\" and settles its execution ABORTED (#1581, second\n * review A7). The trace is evidence ABOUT the admission, never a condition of it.\n */\n try {\n await this.traceOperationSuccess({\n sessionContext,\n step: traceStep,\n type: 'application-coding-task-admission-success',\n summary: `Admitted application coding task ${task.taskRef} as Actor Task ${admitted.opened.taskId} of execution ${admitted.opened.executionId}`,\n payload: response,\n artifactFileName: 'application-coding-task-admission.json',\n artifactContent: response,\n });\n } catch (traceError) {\n this.logDebug('The admission-success trace could not be written; the run is admitted regardless', {\n taskId: admitted.opened.taskId, error: describeCaughtError(traceError),\n });\n }\n return response;\n }\n\n /**\n * The settlement of one application coding task admitted by THIS process:\n * resolves once its terminal durable result has been recorded (success or\n * failure) — the only moment a waiting episode can read a non-PROCESSING\n * row. `null` for a task this process did not admit (a previous process's\n * row, already terminalized by restart reconciliation, or an unknown id):\n * there is nothing to wait for, and a caller must not spin on it.\n */\n public awaitApplicationCodingTaskSettlement(taskId: string): Promise<void> | null {\n return this.applicationCodingTaskSettlements.get(taskId)?.promise ?? null;\n }\n\n /**\n * Read one application coding task's OUTCOME from its durable row.\n *\n * Pairs with {@link awaitApplicationCodingTaskSettlement}: wait for the settlement, then ask this\n * what the run did. The two are deliberately separate — the settlement is an in-process fact (only\n * this process holds the deferred), while the outcome is durable and survives the restart that a\n * rebuild triggers, so a caller that lost the settlement can still answer the question.\n *\n * `null` for a row that is not an application coding task, or that cannot be read at all. An\n * unreadable row is not a failed run, and a caller must not report it as one.\n */\n public async readApplicationCodingTaskOutcome(\n taskId: string,\n sessionContext?: CompanionExecutionSessionContext,\n ): Promise<ApplicationCodingTaskSettledOutcome | null> {\n let row: { _id?: string; status?: unknown; actors?: { actorRef?: string }; input?: unknown; output?: unknown };\n try {\n row = await this.executionsService.getActorTask(taskId, sessionContext);\n } catch {\n return null;\n }\n // MEMBERSHIP, as everywhere else that classifies one of these rows: a second declared coding\n // agent must not make this silently answer \"not a coding run\".\n if (!isApplicationCodingAgentRef(row.actors?.actorRef)) return null;\n const output = isRecordValue(row.output) ? row.output : {};\n const verificationRows = (Array.isArray(output.verification) ? output.verification : [])\n .filter((entry): entry is Record<string, unknown> => isRecordValue(entry))\n .map((entry) => ({\n checkRef: typeof entry.checkRef === 'string' ? entry.checkRef : 'unknown',\n success: isRecordValue(entry.outcome) && entry.outcome.success === true,\n }));\n const failedVerificationRefs = verificationRows.filter((entry) => !entry.success).map((entry) => entry.checkRef);\n return {\n taskId: typeof row._id === 'string' ? row._id : taskId,\n taskRef: isRecordValue(row.input) && typeof row.input.taskRef === 'string' ? row.input.taskRef : null,\n status: typeof row.status === 'string' ? row.status : 'UNKNOWN',\n succeeded: output.succeeded === true,\n disposition: typeof output.disposition === 'string' ? output.disposition : null,\n // The STATUS says it, since #1359: a parked run waits as `AWAITING_APPROVAL`. The output still\n // carries the question while it waits, but a withdrawn park keeps that output and is not waiting.\n awaitingAnswer: row.status === FlowsActors_Status.AWAITING_APPROVAL,\n failedVerificationRefs,\n verification: verificationRows,\n changeSetSummary: isRecordValue(output.changeSetSummary) ? output.changeSetSummary : null,\n scopeAssessment: isRecordValue(output.scopeAssessment) ? output.scopeAssessment : null,\n agentStopReason: typeof output.agentStopReason === 'string' ? output.agentStopReason : null,\n };\n }\n\n /**\n * Settle what a previous process left behind: coding runs still `PROCESSING`, and parked\n * questions a restarted host can no longer show as answerable.\n *\n * A companion restart cannot prove the previous coding subprocess is still running. Retrying\n * could duplicate a worktree mutation, while reverting would destroy evidence. The safe result is\n * therefore a terminal abort plus an explicit human-review disposition carrying what the worktree\n * looked like when the restart found it.\n *\n * Since #1359 the engine's execution driver does the settling, exactly as it does for playbook\n * runs, and this method supplies the two things only the coding lane knows:\n *\n * 1. **What an ORPHAN's task should say** — the recovery evidence. The driver lists the\n * `PROCESSING` executions of `application-coding.system` and settles each `ABORTED`.\n * 2. **Which PARKS survive a restart: every one whose session can be re-entered.** A parked run\n * is `AWAITING_APPROVAL`, never `PROCESSING`, so the orphan sweep cannot touch it — the\n * exemption this method used to carry by hand (measured 2026-09-04: the sweep terminalized a\n * parked row three seconds before the operator's answer arrived) is a property of the status.\n * What is aborted here is only a park no host could answer on its session — a non-resumable one,\n * or one whose checkpoint cannot be read ({@link isParkedCodingRunAnswerable}). A park is NOT\n * aborted for its age: that reaped every question that waited longer than fifteen minutes (#1533).\n */\n public async reconcileInterruptedApplicationCodingTasks(\n sessionContext?: CompanionExecutionSessionContext,\n options?: {\n /**\n * Told each run that was interrupted WHILE RUNNING, the moment the sweep finds it (#1805). The sweep\n * settles those runs and never recovers their writes: the caller recovers every run the restart\n * interrupted in one pass ({@link recoverWritesOfInterruptedRuns}). Told as they are found rather\n * than only returned, because the sweep can still throw afterwards — listing or aborting the parked\n * runs — and a run already settled ABORTED is found by no later boot.\n */\n readonly onInterrupted?: (run: InterruptedRun) => void;\n },\n ): Promise<{ reconciledTaskIds: string[]; interruptedWhileRunning: readonly InterruptedRun[] }> {\n const reconciledTaskIds: string[] = [];\n const interruptedWhileRunning: InterruptedRun[] = [];\n\n await this.actorsSystem.reconcileOrphanedActorExecutions(APPLICATION_CODING_SYSTEM_REF, sessionContext, {\n describeOrphan: async (orphan) => {\n reconciledTaskIds.push(...orphan.tasks.map((task) => task._id));\n /*\n * A PENDING orphan was SELECTED and never admitted — usually a restart during the compile-quiet\n * wait. It touched nothing, so it has no writes to recover and nothing to review, and it was no\n * attempt: recorded like a refused dispatch, `{ failure }` and no disposition, so the build\n * board does not count it as a started run that \"requires review\" (#1581, second review A4).\n */\n if (orphan.status === FlowsActors_Status.PENDING) {\n return { failure: { message: 'Selected, and the companion stopped before the run was admitted; nothing ran.' }, [INTERRUPTED_AT_STARTUP_OUTPUT_FIELD]: true };\n }\n // A concurrent run held only its own task, so siblings wrote in the tree beside it (#1528).\n const sharedTree = isConcurrentRunSubject(orphan.exclusiveSubject);\n for (const task of orphan.tasks) {\n const run: InterruptedRun = { taskId: task._id, sharedTree };\n interruptedWhileRunning.push(run);\n options?.onInterrupted?.(run);\n }\n return this.describeInterruptedCodingRun();\n },\n });\n\n const waiting = await this.actorsSystem.listSuspendedActorExecutions(APPLICATION_CODING_SYSTEM_REF, sessionContext);\n for (const row of waiting) {\n const checkpoint = ApplicationCodingRunCheckpointSchema.safeParse(row.checkpoint?.context);\n if (checkpoint.success && isParkedCodingRunAnswerable(checkpoint.data)) continue;\n try {\n await this.actorsSystem.abortSuspendedActorExecution(row._id, await this.describeInterruptedCodingRun(), sessionContext);\n } catch (error) {\n /*\n * A lost swap (#1586): something else moved this run out of waiting between the listing and the\n * abort — it is settled already, so there is nothing left to reconcile. Refusing the rest of the\n * sweep for it would leave every later unanswerable park in place. Anything else still throws.\n */\n if (isActorExecutionNotSuspendedError(error)) continue;\n throw error;\n }\n reconciledTaskIds.push(...row.tasks.map((task) => task._id));\n }\n\n return { reconciledTaskIds, interruptedWhileRunning };\n }\n\n /**\n * Record what the runs a restart stopped had written, and accept it under the posture (#1805).\n *\n * ## Why this exists\n *\n * A run interrupted mid-task leaves its writes in the tree and is settled\n * INTERRUPTED_REQUIRES_REVIEW. Nothing recorded WHICH files it wrote — its baseline lived in memory\n * — so nobody could accept them, and its retry could not claim them either: to the retry they were\n * already dirty at its own baseline (`baseline_dirty_ambiguous`). Measured 2026-09-24 on\n * scratch-journey: an interrupted `build-task-user-menu-placement` left `app-shell.config.ts` dirty;\n * the retry found the work done and recorded no files; a sibling task's edit to the same file was\n * refused as ambiguous; and every shell surface that file carries stopped landing, including one\n * that had landed hours earlier. The build sat at 91/95 with its work done.\n *\n * ## What it does\n *\n * The run's task input now carries its baseline's dirty files, so the change set is the same\n * capture a finished run gets, against the same baseline, recorded in the same write register.\n * Then the posture decides: under notify-and-proceed a RECOVERY CHECKPOINT (#3204) commits the tree as the restart left\n * it, with the INTERRUPTED_RUN_RECOVERY origin, naming every run no checkpoint named yet: the interrupted runs just\n * recorded, and finished runs whose checkpoint the stop cancelled. No run's writes are told apart from another's; each\n * run's record says which files it touched. Under a posture that keeps acceptance with a person, the record simply waits\n * for the workbench's Accept, which could not act on an interrupted run before because there was no record.\n *\n * A run started before its input carried `files` has no baseline to diff against and is left as\n * it was. BEST-EFFORT throughout: this runs on the boot path, and a boot path must not fail closed\n * on a repair (`continuity-drift-and-cas-basis.md`, Rule 3).\n */\n private async recoverInterruptedRunWrites(reported: readonly InterruptedRun[], sessionContext?: CompanionExecutionSessionContext): Promise<void> {\n const runs = await this.withRunsStillMarkedRunning(reported, sessionContext);\n const recovered: Array<InterruptedRun & { readonly startedAt: string }> = [];\n for (const run of runs) {\n try {\n /*\n * Already recovered on an earlier boot (#1805 review N4): a run whose abort did not persist is found\n * running again, and capturing it anew would overwrite the record that names its recovery commit.\n */\n /*\n * Every way this loop leaves a run without recording it also drops its in-flight claims (#3205 re-review F7):\n * the run is settled, no later boot reads them, and a stale file would read as a live run's claims forever.\n */\n const dropClaims = async (): Promise<void> => {\n try {\n await this.codingRunWriteRegister.clearInFlightClaims(run.taskId);\n } catch (error) {\n this.logDebug('Could not drop an interrupted run\\'s in-flight claims', { taskId: run.taskId, error: describeCaughtError(error) });\n }\n };\n if ((await this.codingRunWriteRegister.read(run.taskId))?.acceptedCommitSha !== undefined) {\n await dropClaims();\n continue;\n }\n const row = await this.executionsService.getActorTask(run.taskId, sessionContext) as { input?: unknown };\n const input = isRecordValue(row.input) ? row.input : undefined;\n const baseline = input && isRecordValue(input.baseline) ? input.baseline : undefined;\n const taskRef = input && typeof input.taskRef === 'string' ? input.taskRef : undefined;\n if (!taskRef || !baseline || !isRecordValue(baseline.files)\n || typeof baseline.headSha !== 'string' || typeof baseline.capturedAt !== 'string') {\n await dropClaims();\n continue;\n }\n const snapshot: GitWorktreeSnapshot = {\n headSha: baseline.headSha,\n capturedAt: baseline.capturedAt,\n files: baseline.files as GitWorktreeSnapshot['files'],\n };\n const changeSet = await this.gitChangeSetService.captureChangeSet(snapshot);\n if (changeSet.files.length === 0) {\n await dropClaims();\n continue;\n }\n /*\n * A run that shared the tree is recorded CONCURRENT with no claims: nothing survived the restart\n * that says which of its captured files it wrote. So even the workbench's per-run Accept refuses\n * them unless forced — the refusal the recovery commit itself is forced past, and names.\n */\n /*\n * The claims it made before the restart, from the on-disk copy a concurrent run keeps as its agent reports writes\n * (#3205 outcome 4): with them, what it wrote is committed under its name (the reconciliation's known writer,\n * #3218), and a person's per-run accept can take it. A run that left none is recorded with none, as before.\n */\n const claimedPaths = run.sharedTree\n ? collectRunClaimedPaths({ candidateRoots: applicationRootSpellings(this.companionContext.saasRoot), reportedFileLocations: await this.codingRunWriteRegister.readInFlightClaims(run.taskId) })\n : undefined;\n await this.codingRunWriteRegister.record({ taskId: run.taskId, taskRef, changeSet, ...(claimedPaths !== undefined ? { claimedPaths } : {}) });\n await dropClaims();\n recovered.push({ ...run, startedAt: baseline.capturedAt });\n } catch (error) {\n this.logger.warn('Could not recover the writes of an interrupted coding run; it stays for review', {\n taskId: run.taskId, error: describeCaughtError(error),\n });\n }\n }\n /*\n * ONE recovery checkpoint at every start (#3204, review of 4a1b1f1bf F7), whether or not a run was interrupted: it names\n * every run no checkpoint has named yet (an interrupted run just recorded, and a run whose checkpoint was folded into a\n * timer the stop cancelled), and commits nothing when there is none.\n */\n const outcome = await this.requestBuildCheckpoint({ force: true, origin: AcceptOrigin.INTERRUPTED_RUN_RECOVERY });\n if (recovered.length > 0 || outcome !== undefined) {\n this.logger.warn('Recovered the writes of coding run(s) a restart left uncommitted', {\n recoveredTaskIds: recovered.map((run) => run.taskId), commitSha: outcome?.commitSha, namedRuns: outcome?.namedTaskIds.length ?? 0,\n });\n }\n }\n\n /**\n * The reported runs, plus any coding run STILL marked running (#1805 review N4). At this point in startup\n * nothing is running, so such a row is an orphan whose abort did not persist — or one the sweep never\n * reached because it threw first. Either way its writes are in the tree, and leaving it out would put\n * them into the recovery commit without its name. Concurrent by its subject, like the sweep decides.\n */\n private async withRunsStillMarkedRunning(reported: readonly InterruptedRun[], sessionContext?: CompanionExecutionSessionContext): Promise<readonly InterruptedRun[]> {\n const byTaskId = new Map(reported.map((run) => [run.taskId, run]));\n try {\n for (const live of await this.listInFlightCodingRuns(sessionContext)) {\n const execution = await this.executionsService.getActorExecution(live.executionId, sessionContext) as { standaloneTasks?: ReadonlyArray<{ _id?: unknown }> };\n for (const task of execution.standaloneTasks ?? []) {\n const taskId = String(task._id);\n if (!byTaskId.has(taskId)) byTaskId.set(taskId, { taskId, sharedTree: isConcurrentRunSubject(live.exclusiveSubject) });\n }\n }\n } catch (error) {\n this.logger.warn('Could not list the coding runs still marked running; recovering the reported ones', { error: describeCaughtError(error) });\n }\n return [...byTaskId.values()];\n }\n\n /**\n * Write a run's baseline onto its own task, for a run whose task was opened before the baseline\n * existed: a GENERATION STEP, whose window captures it after the execution is open. A coding run\n * carries it from its start ({@link buildApplicationCodingTaskInput}). Best-effort: the step runs\n * whether or not its recovery evidence could be written.\n */\n private async recordRunBaselineOnTask(taskId: string, baseline: GitWorktreeSnapshot, sessionContext?: CompanionExecutionSessionContext): Promise<void> {\n try {\n const row = await this.executionsService.getActorTask(taskId, sessionContext) as { input?: unknown };\n const input = isRecordValue(row.input) ? row.input : {};\n await this.executionsService.updateActorTask(taskId, {\n input: {\n ...input,\n baseline: { headSha: baseline.headSha, capturedAt: baseline.capturedAt, dirtyFileCount: Object.keys(baseline.files).length, files: baseline.files },\n },\n }, sessionContext);\n } catch (error) {\n this.logger.warn('Could not record a generation step\\'s baseline; an interruption would leave its writes for review', {\n taskId, error: describeCaughtError(error),\n });\n }\n }\n\n /**\n * The build system's startup sweep (#1359), with the same recovery the coding sweep has. A\n * generation step interrupted mid-pass leaves the files it had written, and its re-dispatch SKIPS\n * them as fresh, so they never enter any later change set. Measured 2026-09-24: an interrupted\n * `i18n-labels` pass left ten label files uncommitted that no later run would ever commit.\n */\n public async reconcileInterruptedBuildGenerationSteps(\n buildSystemRef: string,\n sessionContext?: CompanionExecutionSessionContext,\n /** As on the coding sweep: told each interrupted step as it is found; the caller recovers the writes. */\n options?: { readonly onInterrupted?: (run: InterruptedRun) => void },\n ): Promise<{ aborted: readonly string[]; interrupted: readonly InterruptedRun[] }> {\n const interrupted: InterruptedRun[] = [];\n const { aborted } = await this.actorsSystem.reconcileOrphanedActorExecutions(buildSystemRef, sessionContext, {\n describeOrphan: async (orphan) => {\n /*\n * Not concurrent by its own subject. Whether it ran beside concurrent coding runs is decided at\n * recovery from the evidence: another run the same restart stopped, or a concurrent run that\n * recorded writes during the step's window (a wave runs a step inline while its runs write).\n */\n for (const task of orphan.tasks) {\n const run: InterruptedRun = { taskId: task._id, sharedTree: false };\n interrupted.push(run);\n options?.onInterrupted?.(run);\n }\n // HEAD now bounds the step's window for the build-task decisions reader (#3224 F2): it recorded no change set.\n return { failure: { message: 'The host running this generation step stopped before it concluded.' }, [INTERRUPTED_AT_STARTUP_OUTPUT_FIELD]: true, ...(await this.readSettledHeadStamp()) };\n },\n });\n return { aborted, interrupted };\n }\n\n /**\n * Recover the writes of EVERY run one restart interrupted, coding runs and generation steps alike,\n * in one pass (#1805). A build wave runs a generation step beside its coding runs, so runs of both\n * kinds share the tree; recovered by two separate sweeps, the first would commit the other kind's\n * files under its own run's name. The sweeps only settle and report; startup collects what both\n * report and calls this once with the union.\n */\n public async recoverWritesOfInterruptedRuns(runs: readonly InterruptedRun[], sessionContext?: CompanionExecutionSessionContext): Promise<void> {\n const byTaskId = new Map<string, InterruptedRun>();\n for (const run of runs) byTaskId.set(run.taskId, { taskId: run.taskId, sharedTree: run.sharedTree || byTaskId.get(run.taskId)?.sharedTree === true });\n await this.recoverInterruptedRunWrites([...byTaskId.values()], sessionContext);\n }\n\n /**\n * What the build tasks' coding runs left uncommitted that no automatic door will commit (#3267; under a committing\n * posture the next build checkpoint commits it, #3204), for Home and the feed:\n * the commit door's own reading (`listUncommittedRunLeftovers`), so the line and `wildo build tasks` cannot disagree.\n */\n public listUncommittedRunLeftovers(): ReturnType<AcceptedChangeCommitCompanionService['listUncommittedRunLeftovers']> {\n return this.acceptedChangeCommit.listUncommittedRunLeftovers();\n }\n\n /**\n * The HEAD at the moment a run settles without a change set, as the field its output carries (#3224 F2), or nothing\n * when git cannot say (the run's window then stays open, and the reader names the remedy).\n */\n private async readSettledHeadStamp(): Promise<Record<string, string>> {\n const head = typeof this.gitChangeSetService.readHeadCommitSha === 'function' ? await this.gitChangeSetService.readHeadCommitSha() : undefined;\n return head ? { [SETTLED_HEAD_OUTPUT_FIELD]: head } : {};\n }\n\n /** Bound a run's window at the HEAD it left, when it recorded no change set (#3224 F2). Best effort, and loud. */\n private async recordRunWindowBound(taskId: string, taskRef: string, baseline: GitWorktreeSnapshot): Promise<void> {\n try {\n const head = typeof this.gitChangeSetService.readHeadCommitSha === 'function' ? await this.gitChangeSetService.readHeadCommitSha() : undefined;\n if (head === undefined) return;\n await this.codingRunWriteRegister.recordWindowBound({ taskId, taskRef, baselineHeadSha: baseline.headSha, baselineCapturedAt: baseline.capturedAt, boundHeadSha: head });\n } catch (error) {\n this.logger.warn('Could not bound a generation step\\'s window; the build-task decisions reader keeps it open', { taskId, taskRef, error: describeCaughtError(error) });\n }\n }\n\n /**\n * What a reviewer needs to see on a coding run the host stopped under: where HEAD is and how\n * dirty the tree is NOW. A capture that fails is recorded as such — an interrupted run with no\n * evidence is still an interrupted run, and must not stay `PROCESSING` because git was unavailable.\n */\n private async describeInterruptedCodingRun(): Promise<Record<string, unknown>> {\n let currentSnapshot: GitWorktreeSnapshot | null = null;\n let captureError: unknown = null;\n try {\n currentSnapshot = await this.gitChangeSetService.captureWorktreeSnapshot();\n } catch (error) {\n captureError = error;\n }\n return {\n succeeded: false,\n disposition: ApplicationCodingTaskDisposition.INTERRUPTED_REQUIRES_REVIEW,\n // Settled by a later process's startup sweep (#3206): its finish instant is the restart, not when the run stopped.\n [INTERRUPTED_AT_STARTUP_OUTPUT_FIELD]: true,\n recoveryEvidence: currentSnapshot\n ? {\n headSha: currentSnapshot.headSha,\n dirtyFileCount: Object.keys(currentSnapshot.files).length,\n capturedAt: currentSnapshot.capturedAt,\n }\n : null,\n ...(captureError ? { recoveryCaptureError: buildOutputErrorPayload(captureError) } : {}),\n };\n }\n\n /**\n * Readiness snapshot for the status route. HONESTY CONTRACT: the\n * underlying `isAvailable()` checks ONLY that the provider registry\n * exposes an AGENT_CLIENT_PROTOCOL contract for anthropic — it does NOT\n * guarantee the ACP adapter is installed, spawnable, or authenticated. A\n * `true` here can still be followed by a spawn/auth failure at run time.\n */\n /**\n * The cross-process workspace-mutation lock path (P-19b) — one lock for\n * every mutating coding run against this application worktree.\n */\n public getWorkspaceMutationLockPath(): string {\n return resolveWorkspaceMutationLockPath(this.companionContext.saasRoot);\n }\n\n /**\n * Cancel the in-flight coding run, if there is one.\n *\n * Cooperative by construction: this signals the session, and the runner sends\n * `session/cancel` and waits before killing anything. The run therefore\n * TERMINALISES NORMALLY — with stop reason `cancelled` and a captured change\n * set — rather than vanishing. That distinction is the whole point: an\n * operator who stops a run still needs to know what it had already written.\n *\n * Returns the task that was asked to stop, or `null` when nothing is running.\n * Idempotent: cancelling an already-cancelled run signals an aborted\n * controller again, which is a no-op.\n */\n public cancelActiveApplicationCodingTask(): { taskId: string; startedAt: string } | null {\n // Every run this process drives: a wave is cancelled as one (#1528). The first is named, as before.\n // An entry whose park is being WITHDRAWN runs nothing: it was cancelled already (#1581).\n const active = [...this.activeRuns.values()].filter((run) => run.withdrawal === undefined);\n if (active.length === 0) {\n return null;\n }\n for (const run of active) {\n this.logDebug('Cancelling active application coding task', { taskId: run.taskId });\n run.abortController.abort();\n }\n return { taskId: active[0]!.taskId, startedAt: active[0]!.startedAt };\n }\n\n /**\n * Cancel ONE coding run, named by its task id — the parked-question row's own verb (#1581, seventh\n * review F2). {@link cancelActiveApplicationCodingTask} ends everything this process drives, so from\n * a parked row it did nothing when no chain held that run, and otherwise stopped OTHER runs while\n * leaving the row's own run parked.\n *\n * Three answers, and what each promises (#1581, seventh to eleventh reviews):\n *\n * - A run this process is still handling — a turn, or its question being offered to the answering\n * agent — is SIGNALLED, exactly as the process-wide cancel signals it: `cancelled: true` means the\n * signal was given, and its chain withdraws the park on its way out. That withdraw's outcome is\n * recorded on the entry, so a second cancel meanwhile AWAITS it and reports it; a cancel after the\n * chain has gone finds the park (if the withdraw failed) and withdraws it itself.\n * - A run no chain holds here is WAITING, and is withdrawn at once under a guard entry: `cancelled:\n * true` only once it is gone, else a 409 saying the question is still waiting or could not be read.\n * - `cancelled: false` when the task is neither — no chain, and no park after reading twice (a chain\n * ending during the first read may have left one).\n *\n * A park read that FAILS is never taken for \"nothing is waiting\": with a live chain the chain is still\n * signalled, since that needs no read; without one the answer is the UNCONFIRMED 409.\n */\n public async cancelApplicationCodingTask(\n taskId: string,\n sessionContext?: CompanionExecutionSessionContext,\n /** The signed-in person cancelling (#1751), when the door has one: the withdrawal records them as the decider. */\n options?: { readonly actingUserId?: string },\n ): Promise<{ cancelled: true; taskId: string; startedAt?: string } | { cancelled: false }> {\n // Read FIRST, then look for a chain: one that began meanwhile (a person's answer) owns the run by now.\n // A failed read stops nothing here: a live chain is signalled without one (#1581, eleventh review R11-1).\n const readPark = () => this.readParkedCodingRun(taskId, sessionContext, { strict: true })\n .then((parked) => ({ parked, failed: false as const }), (error: unknown) => {\n this.logger.warn('A per-run cancel could not read the coding run\\'s park', { taskId, error: describeCaughtError(error) });\n return { parked: null, failed: true as const };\n });\n let read = await readPark();\n let live = this.activeRuns.get(taskId);\n if (!live && !read.parked && !read.failed) {\n // A chain that ended during the read may have left the run parked: read once more (#1581, tenth review R10-7).\n read = await readPark();\n live = this.activeRuns.get(taskId);\n }\n const { parked } = read;\n if (live) {\n // Already cancelled, its park being withdrawn: answer with THAT withdraw's outcome, never a second one (R9-4, R10-4).\n if (live.withdrawal) return this.reportCancelledPark(taskId, await live.withdrawal, live.startedAt);\n // Signal the chain; it ends the run on its way out, naming the canceller when there is one.\n this.logDebug('Cancelling one application coding task', { taskId });\n if (options?.actingUserId && !this.cancellersByController.has(live.abortController)) {\n this.cancellersByController.set(live.abortController, options.actingUserId);\n }\n live.abortController.abort();\n return { cancelled: true, taskId, startedAt: live.startedAt };\n }\n if (read.failed) return this.reportCancelledPark(taskId, CancelledParkOutcome.UNCONFIRMED);\n if (!parked) return { cancelled: false };\n /*\n * No chain will end it, so this door does (#1581, eighth review R8-2). Guarded by a registration taken\n * in the same synchronous step as the check above: a person's answer arriving meanwhile is refused 409\n * by `refuseWhileRunChainIsLive` rather than racing the withdraw in the driver, which takes no lock\n * between reading a run as waiting and moving it; and a second cancel awaits this withdraw.\n */\n const guard: ActiveRunState = { taskId, startedAt: new Date().toISOString(), abortController: new AbortController(), mode: parked.mode, withdrawalGuard: true };\n guard.abortController.abort();\n this.activeRuns.set(taskId, guard);\n guard.withdrawal = this.endParkIfWaiting(taskId, sessionContext, options?.actingUserId);\n try {\n const outcome = await guard.withdrawal;\n if (outcome === CancelledParkOutcome.ENDED) this.announceRunStateChanged();\n return this.reportCancelledPark(taskId, outcome);\n } finally {\n if (this.activeRuns.get(taskId) === guard) this.activeRuns.delete(taskId);\n }\n }\n\n /** A cancel's answer from what became of the park: ended, or a 409 that says why it is not (#1581, tenth review). */\n private reportCancelledPark(taskId: string, outcome: CancelledParkOutcome, startedAt?: string): { cancelled: true; taskId: string; startedAt?: string } {\n if (outcome === CancelledParkOutcome.ENDED) return { cancelled: true, taskId, ...(startedAt !== undefined ? { startedAt } : {}) };\n throw this.buildDispatchConflictError(outcome === CancelledParkOutcome.STILL_WAITING\n ? `Coding task ${taskId} could not be cancelled: its question could not be withdrawn and is still waiting. Try again.`\n : `Coding task ${taskId} could not be confirmed cancelled: the run could not be read. Check it, and cancel it again if it is still waiting.`);\n }\n\n /**\n * The run holding the worktree right now, from the actor plane (#1361) — what the creation board's\n * coding-lane badge shows. It read this process's cancel handle until 2026-09-20, so a run driven\n * by another process, or selected and not yet admitted, showed as \"idle\". A status read does not\n * fail because the plane is unreachable: it then answers what this process is driving.\n */\n private async readActiveCodingRun(): Promise<{ taskId: string; startedAt: string } | null> {\n try {\n const holder = await this.actorsSystem.readExclusiveSubjectHolder(APPLICATION_CODING_SYSTEM_REF, APPLICATION_CODING_WORKTREE_SUBJECT);\n return holder ? { taskId: holder.tasks[0]?._id ?? holder._id, startedAt: holder.createdAt ?? new Date().toISOString() } : null;\n } catch {\n const active = [...this.activeRuns.values()].find((run) => run.withdrawal === undefined);\n return active ? { taskId: active.taskId, startedAt: active.startedAt } : null;\n }\n }\n\n /** The last login read, shared by every status poll inside {@link CODING_AGENT_LOGIN_CACHE_MS}. */\n private codingAgentLoginRead: { readonly at: number; readonly value: Promise<CompanionCodingAgentStatusResponse['codingAgentLogin']> } | null = null;\n\n /**\n * The selected agent's login on this host (#1637); `null` when the selection or its declaration is\n * unavailable.\n *\n * CACHED, because `getStatus` is polled — the creation board re-derives its watched boards every 15 s\n * and the status route is on the trace-exempt polling list — and the probe runs the agent's own status\n * command, which can take seconds. One read serves every poll inside the window, and concurrent polls\n * share the same in-flight read. Signing in shows up within the window, which is the cost.\n */\n private readSelectedCodingAgentLogin(): Promise<CompanionCodingAgentStatusResponse['codingAgentLogin']> {\n const now = Date.now();\n if (this.codingAgentLoginRead && now - this.codingAgentLoginRead.at < CODING_AGENT_LOGIN_CACHE_MS) return this.codingAgentLoginRead.value;\n const value = (async () => {\n try {\n return await this.agentsService.readCodingAgentHostLogin(resolveSelectedApplicationCodingAgentBinding().providerRef);\n } catch {\n return null;\n }\n })();\n this.codingAgentLoginRead = { at: now, value };\n return value;\n }\n\n public async getStatus(): Promise<CompanionCodingAgentStatusResponse> {\n return {\n // Reports a fact this service can actually establish: whether the coding\n // agent is registered. It deliberately does NOT claim the transport is\n // usable — that depends on the provider configuration and on an agent\n // process this service has not started, and a status field that overstates\n // its knowledge is worse than one that is narrow about it.\n // Every declared agent must resolve, not merely the default: a registry\n // missing the SELECTED agent reports healthy while dispatch refuses.\n codingAgentRegistered: APPLICATION_CODING_AGENT_REFS.every(\n (ref) => this.agentsService.getAgent(ref) !== undefined,\n ),\n codingAgentLogin: await this.readSelectedCodingAgentLogin(),\n activeRun: await this.readActiveCodingRun(),\n // The answerable set: what is parked waiting for an operator response.\n pendingQuestions: await this.listPendingCodingQuestions(),\n limits: {\n defaultTimeoutMs: DISPATCH_DEFAULT_TIMEOUT_MS,\n hardMaxTimeoutMs: DISPATCH_HARD_MAX_TIMEOUT_MS,\n defaultMaxCapturedBytes: DISPATCH_DEFAULT_MAX_CAPTURED_BYTES,\n hardMaxCapturedBytes: DISPATCH_HARD_MAX_CAPTURED_BYTES,\n },\n lockFilePath: this.getWorkspaceMutationLockPath(),\n };\n }\n\n /**\n * Persist only replayable task identity and guard evidence, never\n * prompt/context bytes, with ONE named exception: an assembly repair's row keeps\n * the failure tail it was handed (`assemblyRepair.comparedFailureTail`, #2283),\n * because the bound on repairs must compare a later failure with it and the\n * directive forbids keeping a digest instead. It is a check's output, at most the\n * captured tail, never the prompt.\n *\n * CORRELATION BACK TO THE EPISODE runs through `input.candidateRef`, which is\n * the assessment episode's working-subject identity for the iteration that\n * composed this task — the same value the private checkpoint carries as\n * `basis.episode.candidateRef`. It is recorded here deliberately so the join\n * exists in BOTH directions: the checkpoint names the taskId once the task is\n * admitted, and this row names the candidate that caused it, so an auditor\n * starting from a workspace mutation can reach the episode without scanning\n * every checkpoint.\n *\n * A dedicated `episodeRef` column is NOT added: no caller supplies one yet\n * (the coding revision owner lands later), and a field with no producer is a\n * dormant surface that later readers mistake for a guarantee. The candidate\n * ref is exact per ITERATION, which is the granularity an auditor wants.\n */\n private async openApplicationCodingExecution(\n task: MetaWorkflow_ApplicationCodingTaskContract,\n baseline: GitWorktreeSnapshot,\n sessionContext?: CompanionExecutionSessionContext,\n origin?: CodingRunOrigin,\n mode: CodingRunConcurrency = CodingRunConcurrency.SINGLE_FLIGHT,\n ): Promise<OpenedActorExecution> {\n /*\n * ONE EXECUTION PER CODING RUN (#1359), opened by the engine's driver.\n *\n * Until 2026-09-20 this created a bare task with no execution parent, so a coding run had no row\n * saying \"this is a run\" and nowhere to hold a pending question or its resume inputs. Per RUN\n * rather than per build phase, because a parked run releases the worktree lock and the\n * dispatcher moves on: several questions can stand while a sibling runs, and an execution has\n * one `suspension`.\n */\n return this.actorsSystem.openActorExecution(this.buildApplicationCodingExecutionRequest(task, baseline, sessionContext, origin, mode));\n }\n\n /**\n * Open a coding run's execution at the moment its task is SELECTED — `PENDING`, not started.\n *\n * A build dispatch selects a task and then waits: for the compile watchers to go quiet, then for\n * the worktree lock. That stretch can be minutes, and until #1359 it existed only in an in-memory\n * dispatch record — so a dispatch that failed inside it failed nowhere durable, and a companion\n * restart forgot it had been selected at all. The row says `PENDING` for exactly that stretch;\n * `runApplicationCodingTask` starts it at admission, and the caller settles it `ABORTED` if the run\n * never gets that far — the host declined to start it, which is no attempt of the task's (#1581) —\n * or `FAILED` when the task's own contract was refused as invalid.\n *\n * The input carries no baseline yet: a baseline is captured under the lock this run has not taken.\n */\n public async openSelectedApplicationCodingExecution(\n rawTask: MetaWorkflow_ApplicationCodingTaskContract,\n sessionContext?: CompanionExecutionSessionContext,\n origin?: CodingRunOrigin,\n mode: CodingRunConcurrency = CodingRunConcurrency.SINGLE_FLIGHT,\n ): Promise<OpenedActorExecution> {\n const task = this.admitTypedInput(\n () => MetaWorkflow_ApplicationCodingTaskContractSchema.parse(rawTask),\n 'Application coding task contract is not valid.',\n );\n await this.refuseWhileWorktreeIsHeld(null, sessionContext);\n if (mode === CodingRunConcurrency.SINGLE_FLIGHT) await this.refuseWhileConcurrentRunsInFlight(sessionContext);\n const opened = await this.actorsSystem\n .openActorExecution({ ...this.buildApplicationCodingExecutionRequest(task, null, sessionContext, origin, mode), deferred: true })\n .catch((error: unknown) => { throw this.translateWorktreeBusy(error); });\n // SELECTED: a PENDING execution is already in flight to the next-task selection (#1310), whichever\n // door opened it — the resource operation, `POST /build/dispatch-next`, the playbook build tier.\n this.announceRunStateChanged();\n return opened;\n }\n\n /**\n * Run `critical` holding the workspace lock BRIEFLY, waiting for it rather than refusing (#1528).\n *\n * For a concurrent run's commits: the tree is shared on purpose, but git's index admits one writer,\n * and a generation step or a CLI writer may hold the lock for its whole duration. Waiting up to about\n * ten minutes is right here, where the single-flight lane's fail-fast would drop a finished run's\n * commit; a commit that still cannot get the lock is left for the wave reconciliation.\n */\n private underBriefWorktreeLock<T>(critical: () => Promise<T>): Promise<T> {\n return withDedicatedFileLock(this.getWorkspaceMutationLockPath(), critical, {\n retries: { retries: 120, minTimeout: 500, maxTimeout: 5_000 },\n });\n }\n\n /** Whether a CONCURRENT coding run is live now (#1528): it writes in the tree without holding the workspace lock. */\n private async concurrentCodingRunsLive(sessionContext?: CompanionExecutionSessionContext): Promise<boolean> {\n if (this.concurrentRunLiveInProcess()) return true;\n // The actor plane also sees a run another process drives. Asked twice; if it cannot answer, this\n // process's own runs are the answer (#1805 review R5), never a blanket \"shared\" nothing would ever settle.\n for (let attempt = 0; attempt < 2; attempt += 1) {\n try {\n return (await this.listInFlightCodingRuns(sessionContext)).some((run) => isConcurrentRunSubject(run.exclusiveSubject));\n } catch (error) {\n if (attempt === 1) {\n this.logger.warn('Could not list the live coding runs; judging sharing by this process\\'s own runs', { error: describeCaughtError(error) });\n }\n }\n }\n return false;\n }\n\n /** Whether this process drives a CONCURRENT run now — one writing the tree without holding the workspace lock. */\n private concurrentRunLiveInProcess(exceptTaskIds: readonly string[] = []): boolean {\n return [...this.activeRuns.values()].some((run) => run.mode === CodingRunConcurrency.CONCURRENT && run.withdrawalGuard !== true && !exceptTaskIds.includes(run.taskId));\n }\n\n /**\n * When the current SHARING EPISODE began: the first instant, since the tree was last written by one run\n * at a time, that a concurrent run (or a step beside one) wrote it (#1805 review R5, R9). Process-local:\n * a restart ends every episode, and restart recovery covers what it interrupted.\n */\n private sharingEpisodeStartedAt: string | undefined;\n\n private markSharingEpisodeStarted(at: string): void {\n if (this.sharingEpisodeStartedAt === undefined || at < this.sharingEpisodeStartedAt) this.sharingEpisodeStartedAt = at;\n }\n\n /**\n * Register a run; a CONCURRENT one opens a sharing episode when none is open. One of the two doors that\n * keep the dev supervisor's view of \"a coding agent is running\" in step with this process's own\n * (see {@link CODING_RUN_HEARTBEAT_RELATIVE_PATH}).\n */\n private registerActiveRun(run: ActiveRunState): void {\n if (run.mode === CodingRunConcurrency.CONCURRENT) this.markSharingEpisodeStarted(new Date().toISOString());\n this.activeRuns.set(run.taskId, run);\n this.adjustCodingWorkDepth(run.taskId, 1);\n }\n\n /**\n * Unregister a run. When it was the last CONCURRENT run live, the sharing episode has ended and nothing\n * is writing beside anything: its runs are re-checked alone and the tree is checkpointed, as a wave's end does\n * (#1805 review R5, #3204). That is what reaches a generation step, or a resumed parked run, that shared the tree\n * outside any wave — no wave's end would ever reach them.\n */\n private unregisterActiveRun(taskId: string): void {\n const was = this.activeRuns.get(taskId);\n this.activeRuns.delete(taskId);\n this.adjustCodingWorkDepth(taskId, -1);\n if (was?.mode !== CodingRunConcurrency.CONCURRENT || this.concurrentRunLiveInProcess()) return;\n const startedAt = this.sharingEpisodeStartedAt;\n this.sharingEpisodeStartedAt = undefined;\n if (startedAt === undefined) return;\n this.sharingEpisodeReconciliation = this.reconcileSharedTree({ startedAt, taskIds: [] }).then(\n // Re-checks deferred (a run began writing meanwhile): the episode goes on, from the same start, for the next end (#1805 review 5 F3).\n ({ deferred }) => { if (deferred) this.markSharingEpisodeStarted(startedAt); },\n (error: unknown) => {\n this.markSharingEpisodeStarted(startedAt);\n this.logger.warn('Could not end a sharing episode; it is kept for the next one', { error: describeCaughtError(error) });\n },\n );\n }\n\n /** The reconciliation the last sharing episode's end started, for a caller that must see its commit. */\n public sharingEpisodeReconciliation: Promise<void> = Promise.resolve();\n\n /** When the last build checkpoint began (#3204): a settlement inside the interval folds into a scheduled one. */\n private lastBuildCheckpointAt = 0;\n /** The checkpoint scheduled for the end of the interval, if any. */\n private buildCheckpointTimer: ReturnType<typeof setTimeout> | undefined;\n /** Runs that settled while their checkpoint was folded into the scheduled one: still registered, named all the same. */\n private readonly checkpointSettlingTaskIds = new Set<string>();\n /** The checkpoint committing now: the next waits for it. */\n private buildCheckpointInFlight: Promise<BuildCheckpointOutcome | undefined> = Promise.resolve(undefined);\n\n /**\n * The build tasks of the coding runs THIS process still holds as active (#3204): from admission until the run's chain has\n * ended, its commit included. A run's row reads COMPLETED before that (the commit and the trace come after the engine\n * settles it), so the actor plane's in-flight listing drops the run while its work is not yet committed; a selection that\n * read only that listing could take the task as ready and dispatch it again. Its chain unregisters it and announces the\n * change in one synchronous step, so no reader sees neither.\n */\n public listActiveRunTaskRefs(): string[] {\n const windows = this.codingRunWindows ?? [];\n return [...(this.activeRuns?.keys() ?? [])].flatMap((taskId) => {\n const window = windows.find((candidate) => candidate.taskId === taskId);\n return window === undefined ? [] : [window.taskRef];\n });\n }\n\n /** The live coding runs — selected, admitted or running — from the actor plane; see {@link listInFlightCodingRuns}. */\n public async listInFlightCodingRuns(sessionContext?: CompanionExecutionSessionContext): Promise<InFlightCodingRun[]> {\n return listInFlightCodingRuns(this.executionsService, sessionContext);\n }\n\n /** The live run of one build task, or `null` — what the wave skips, so no task is built twice at once. */\n public async findInFlightRunForBuildTask(\n buildTaskRef: string,\n sessionContext?: CompanionExecutionSessionContext,\n ): Promise<{ readonly executionId: string } | null> {\n const live = (await this.listInFlightCodingRuns(sessionContext)).find((run) => run.taskRef === buildTaskRef);\n return live ? { executionId: live.executionId } : null;\n }\n\n /**\n * Refuse (409) a SINGLE-FLIGHT run while any concurrent run is live (#1528).\n *\n * Two reasons, and the second is why it is explicit rather than incidental. A single-flight run was\n * promised the tree to itself. And the single-flight door is the one an agent can reach from its own\n * shell: until concurrency, the global lock refused a running agent's dispatch as a SIDE EFFECT (the\n * P-35 recursion cap). A concurrent run does not hold that lock, so without this a recursing agent\n * would be admitted beside its own wave.\n */\n private async refuseWhileConcurrentRunsInFlight(sessionContext?: CompanionExecutionSessionContext): Promise<void> {\n const concurrent = (await this.listInFlightCodingRuns(sessionContext)).filter((run) => isConcurrentRunSubject(run.exclusiveSubject));\n if (concurrent.length === 0) return;\n throw this.buildDispatchConflictError(\n `${concurrent.length} coding run(s) of a parallel build wave are live (${concurrent.map((run) => run.taskRef ?? run.executionId).join(', ')}). `\n + 'A single run cannot start beside them; it runs after the wave, or as part of the next one.',\n );\n }\n\n /** Record that a run entered the tree, for the runs it will overlap (#1528). */\n private openCodingRunWindow(taskId: string, taskRef: string): void {\n const now = Date.now();\n this.codingRunWindows = this.codingRunWindows\n .filter((window) => window.taskId !== taskId && (window.endedAtMs === undefined || now - window.endedAtMs < CODING_RUN_WINDOW_RETENTION_MS));\n this.codingRunWindows.push({ taskId, taskRef, startedAtMs: now });\n }\n\n /** End a run's window if nothing closed it — a parked run, or one that ended without a result. Idempotent. */\n private endCodingRunWindow(taskId: string): void {\n const endedAtMs = Date.now();\n this.codingRunWindows = this.codingRunWindows.map((window) => window.taskId === taskId && window.endedAtMs === undefined\n ? { ...window, endedAtMs }\n : window);\n }\n\n /** Hold the lane for a usage limit; a later reset than the one held wins, so two siblings never shorten it. */\n private holdForCodingAgentUsageLimit(limit: CodingAgentUsageLimit, taskRef: string, runTaskId: string): void {\n const held = this.codingAgentUsageLimitHold;\n if (held && Date.parse(held.resumesAt) >= Date.parse(limit.resumesAt)) return;\n this.codingAgentUsageLimitHold = { ...limit, taskRef, runTaskId };\n this.logger.warn(limit.accountRefusal\n // #3204: the account refused (no credits, a limit), named, and the lane asks again after the backoff.\n ? 'The coding agent\\'s provider account refused the turn; the build wave dispatches nothing until it is asked again'\n : 'The coding agent\\'s account hit its usage limit; the build wave dispatches nothing until it resumes', {\n taskRef, runTaskId, resumesAt: limit.resumesAt, resumesAtSource: limit.resumesAtSource, ...(limit.statedReset ? { statedReset: limit.statedReset } : {}),\n ...(limit.accountRefusal ? { accountRefusal: describeModelProviderAccountRefusal(limit.accountRefusal) } : {}),\n });\n }\n\n /**\n * Release the hold on a success that proves the window is over: a run started after the limit was met. An\n * earlier sibling succeeding later proves nothing — its turn may have ended before the limit — and releasing\n * on it would refill every slot into the limit (#2388 review F4).\n */\n private releaseCodingAgentUsageLimitHoldAfterSuccess(runStartedAtMs: number): void {\n const held = this.codingAgentUsageLimitHold;\n if (held && runStartedAtMs > Date.parse(held.observedAt)) this.codingAgentUsageLimitHold = undefined;\n }\n\n /** Hold coding admissions while a check's command is absent or lacks the verb (#3423, #3432); the first observation is kept. */\n private holdForUnavailableVerificationTool(\n unavailable: UnavailableVerificationTool,\n taskRef: string,\n runTaskId: string,\n ): void {\n if (this.verificationToolUnavailableHold) return;\n this.verificationToolUnavailableHold = { ...unavailable, taskRef, runTaskId, observedAt: new Date().toISOString() };\n this.logger.warn(unavailable.hostCause === VerificationHostCause.COMMAND_LACKS_VERB\n ? 'A verification check\\'s command does not know the verb it asks; no coding turn is admitted until it does'\n : 'A verification check\\'s command could not be executed; no coding turn is admitted until it is on PATH again', {\n command: unavailable.command, checkRef: unavailable.checkRef, taskRef, runTaskId, message: unavailable.message,\n });\n }\n\n /**\n * Record the checks a run could not ask for the host's reasons (#3432), and hold when one repeats with the same message on\n * a second distinct task. Only a run that ran ALONE is counted: beside siblings, a check that cannot be asked may be a\n * sibling's half-written file (a red compile, a stale output), which the wave's isolated re-check settles (#3204).\n */\n private observeHostCheckFailures(failures: readonly { readonly checkRef: string; readonly message: string }[], taskRef: string, runTaskId: string): void {\n for (const failure of failures) {\n const key = `${failure.checkRef}\\u0000${normalizeHostCheckFailureMessage(failure.message)}`;\n const seen = this.hostCheckFailures().get(key) ?? { checkRef: failure.checkRef, message: failure.message, taskRefs: new Set<string>() };\n seen.taskRefs.add(taskRef);\n this.hostCheckFailures().set(key, seen);\n if (seen.taskRefs.size < 2 || this.verificationToolUnavailableHold) continue;\n const observedAt = new Date();\n this.verificationToolUnavailableHold = {\n hostCause: VerificationHostCause.REPEATED_HOST_FAILURE,\n checkRef: failure.checkRef,\n message: failure.message,\n taskRef,\n runTaskId,\n observedAt: observedAt.toISOString(),\n metOnTaskRefs: [...seen.taskRefs],\n reaskAfter: new Date(observedAt.getTime() + VERIFICATION_HOST_FAILURE_REASK_MS).toISOString(),\n };\n this.logger.warn('A verification check could not be asked the same way on two tasks; no coding turn is admitted until the host is asked again', {\n checkRef: failure.checkRef, taskRefs: [...seen.taskRefs], message: failure.message, reaskAfter: this.verificationToolUnavailableHold.reaskAfter,\n });\n }\n }\n\n private releaseVerificationToolUnavailableHold(why: string): void {\n const held = this.verificationToolUnavailableHold;\n if (!held) return;\n this.verificationToolUnavailableHold = undefined;\n this.logger.info('The verification tool hold ended; coding admissions resume', { command: held.command, checkRef: held.checkRef, why });\n }\n\n /**\n * A run that ASKED the held check proves its command runs again (#3423). Approximate for a check that can answer without\n * spawning its command (schema-plan drift says \"not owed\" when the application declares no PostgreSQL): such an answer\n * releases the hold too, and the next run that needs the command meets it again, which costs one run, never a lockout.\n */\n private releaseVerificationToolHoldIfAsked(askedCheckRefs: readonly string[], taskRef: string): void {\n const held = this.verificationToolUnavailableHold;\n if (held && askedCheckRefs.includes(held.checkRef)) this.releaseVerificationToolUnavailableHold(`${taskRef} ran ${held.checkRef}`);\n // The cause of a repeated host failure is gone once the check answers (#3432): it counts afresh from here.\n for (const [key, seen] of this.hostCheckFailures()) {\n if (askedCheckRefs.includes(seen.checkRef)) this.hostCheckFailures().delete(key);\n }\n }\n\n /**\n * Before a coding turn is admitted, while a check's command is held absent (#3423): look it up on the PATH the check\n * spawns with. Found, the hold ends and the turn is admitted; still absent, admission is REFUSED as a dispatch conflict,\n * the host declining to start the run, which the attempt budget never counts (#1581). Every door is held, an explicit\n * `wildo build run` included, as the network hold does and for its reason: the proof is a free lookup, made first.\n */\n private async refuseWhileVerificationToolIsUnavailable(taskRef: string): Promise<void> {\n // A command lacking the verb is asked for it NOW, not in the background: the admission waits a CLI start, never a turn (#3432).\n if (this.verificationToolUnavailableHold?.hostCause === VerificationHostCause.COMMAND_LACKS_VERB) await this.probeVerificationVerb(true);\n // The read looks the command up (an absent command) or re-asks once due (a repeated failure), and releases the hold.\n const held = this.readVerificationToolUnavailableHold();\n if (held) throw this.buildDispatchConflictError(describeVerificationToolUnavailableRefusal(taskRef, held));\n }\n\n /**\n * Ask the held command for the verb (#3432): released when it answers it ({@link verbProbeKnowsTheVerb}). At most one\n * probe at a time; a read starts one at most every {@link VERIFICATION_VERB_PROBE_INTERVAL_MS}, an admission (`now`)\n * always. Never throws: a probe that cannot run leaves the hold standing.\n */\n private probeVerificationVerb(now: boolean): Promise<void> {\n const held = this.verificationToolUnavailableHold;\n if (held?.hostCause !== VerificationHostCause.COMMAND_LACKS_VERB || held.command === undefined) return Promise.resolve();\n if (this.verbProbeInFlight) return this.verbProbeInFlight;\n if (!now && Date.now() - this.verbProbeStartedAtMs < VERIFICATION_VERB_PROBE_INTERVAL_MS) return Promise.resolve();\n this.verbProbeStartedAtMs = Date.now();\n const command = held.command;\n const args = [...(held.verbProbeArgs ?? ['--help'])];\n this.verbProbeInFlight = this.runVerification({ kind: VerificationKind.RESOURCES_REGISTRY_INIT, path: null, command, args, cwd: this.companionContext.saasRoot })\n .then((outcome) => {\n if (this.verificationToolUnavailableHold === held && verbProbeKnowsTheVerb(outcome)) {\n this.releaseVerificationToolUnavailableHold(`\\`${command} ${args.join(' ')}\\` answers the verb`);\n }\n })\n .catch(() => undefined)\n .finally(() => { this.verbProbeInFlight = undefined; });\n return this.verbProbeInFlight;\n }\n\n /**\n * The command holding coding admissions now (#3423), for the build wave's stop, the selector's guidance and Home.\n *\n * The read itself looks the command up and releases the hold once it resolves (review F1). Otherwise a reader that\n * acts on the hold before any admission happens (an unattended drive stops on the Home line, the selector is told to\n * select no build wave) would keep it standing after the person fixed PATH: nothing else would ever look again.\n */\n public readVerificationToolUnavailableHold(): VerificationToolUnavailableHold | undefined {\n const held = this.verificationToolUnavailableHold;\n if (!held) return undefined;\n switch (held.hostCause) {\n case VerificationHostCause.COMMAND_ABSENT: {\n const resolved = held.command === undefined ? null : resolveExecutableOnPath(held.command, buildVerificationEnv().PATH);\n if (resolved !== null) {\n this.releaseVerificationToolUnavailableHold(`\\`${held.command}\\` resolves to ${resolved}`);\n return undefined;\n }\n return held;\n }\n case VerificationHostCause.COMMAND_LACKS_VERB:\n // Asked in the background, so a reader that acts before any admission (the drive, the selector) sees it end (#3432).\n void this.probeVerificationVerb(false);\n return held;\n case VerificationHostCause.REPEATED_HOST_FAILURE:\n // No free probe: once due, the hold ends and the next run re-asks the host; the same failure holds again at once.\n if (held.reaskAfter !== undefined && Date.now() >= Date.parse(held.reaskAfter)) {\n this.releaseVerificationToolUnavailableHold(`its re-ask was due at ${held.reaskAfter}`);\n return undefined;\n }\n return held;\n }\n }\n\n /** Hold coding admissions for a network a turn REPORTED lost (#3236): its rejection or its own API-error report. */\n private holdForCodingAgentConnectivityLoss(networkFailureKind: NetworkEnvironmentFailureKind, failureMessage: string, taskRef: string, runTaskId: string, binding: ApplicationCodingAgentBinding | undefined): void {\n this.openCodingAgentConnectivityHold(networkFailureKind, this.resolveCodingAgentProbeRouteFor(failureMessage, binding), taskRef, runTaskId);\n }\n\n /**\n * The route a probe must take to speak for the agent of this run (#3262): decided over the environment the agent is\n * STARTED with, never this process's. `undefined` when it cannot be known (no binding, an unreadable launch\n * configuration, an agent with no known API host): the probe then speaks for nothing and the next turn is the probe.\n */\n private resolveCodingAgentProbeRouteFor(failureMessage: string, binding: ApplicationCodingAgentBinding | undefined): CodingAgentProbeRoute | undefined {\n if (binding === undefined) return undefined;\n const environment = this.readCodingAgentRouteEnvironment(binding);\n return environment === undefined ? undefined : resolveCodingAgentProbeRoute({ failureMessage, providerRef: binding.providerRef, environment });\n }\n\n /**\n * The environment the agent's network code reads (#3262): its launch environment, as the engine composes it for the\n * dispatch (the base allowlist plus the provider's and the execution profile's variables), then, for Claude Code, the\n * `env` of every settings file its session loads, which replaces an inherited value. Which settings files load is the\n * session's `settingSources`, from its resolved metadata: an application-scoped run does not read the operator's\n * `~/.claude`. A method, so a test can state the agent's environment. `undefined` when the launch configuration\n * cannot be read, so no probe claims to speak for an agent whose environment is unknown.\n */\n protected readCodingAgentRouteEnvironment(binding: ApplicationCodingAgentBinding): NodeJS.ProcessEnv | undefined {\n let launch: ReturnType<AgentsBackendService['readCodingAgentLaunchConfiguration']>;\n try {\n launch = this.agentsService.readCodingAgentLaunchConfiguration(binding.providerRef, binding.executionProfileRef);\n } catch (error) {\n this.logger.warn('Could not read the coding agent\\'s launch configuration; the connectivity probe cannot speak for it', { providerRef: binding.providerRef, error: describeCaughtError(error) });\n return undefined;\n }\n if (launch === null) return undefined;\n if (binding.providerRef !== 'anthropic') return launch.environment;\n const settings = readClaudeCodeSettingsEnvironments({\n environment: launch.environment,\n workspaceRoot: this.companionContext.saasRoot,\n settingSources: readClaudeCodeSettingSources(launch.sessionMeta),\n readFile: (path) => {\n try {\n return readFileSync(path, 'utf8');\n } catch {\n return undefined;\n }\n },\n });\n return composeCodingAgentRouteEnvironment(launch.environment, settings);\n }\n\n /**\n * Open the admission hold and RECORD the loss it stands for (#3236). Called when a turn reports the network, and when a\n * connectivity probe fails (re-review of 8038824b4, F2): a full cut that every in-flight turn meets silently is then on\n * record although no turn reports it. The first loss observed is kept, so its instant stays the earliest; a loss is\n * recorded once while it is open.\n */\n private openCodingAgentConnectivityHold(networkFailureKind: NetworkEnvironmentFailureKind, probeRoute: CodingAgentProbeRoute | undefined, taskRef: string, runTaskId: string): void {\n const now = Date.now();\n const losses = (this.connectivityLosses ?? []).filter((loss) => now - (loss.endedAtMs ?? now) < CODING_RUN_WINDOW_RETENTION_MS);\n this.connectivityLosses = losses.some((loss) => loss.endedAtMs === undefined) ? losses : [...losses, { networkFailureKind, observedAtMs: now }];\n if (this.codingAgentConnectivityHold) return;\n this.codingAgentConnectivityHold = {\n networkFailureKind,\n observedAt: new Date(now).toISOString(),\n taskRef,\n runTaskId,\n ...(probeRoute === undefined ? {} : { probeRoute }),\n };\n this.logger.warn('A coding run lost the network; no coding turn is admitted until the agent\\'s API answers a probe', {\n taskRef, runTaskId, networkFailureKind, probeRoute: probeRoute === undefined ? undefined : describeCodingAgentProbeRoute(probeRoute),\n });\n this.probeConnectivityInBackground(this.codingAgentConnectivityHold, 0);\n }\n\n /**\n * While a hold is open, probe the agent's API on the admission back-off (15 s, doubling, capped at 5 min), whether\n * or not anything is admitted (re-review of 1da455d5d, R1). Without it the loss's END was whenever someone next\n * asked: after a one-second blip with no admission, a turn silent until its own thirty-minute timeout ended the hold\n * with its OWN settle-time probe, so it settled \"within the grace\" and was charged to the network. Stops when the\n * hold is released, when another hold replaced it, or once the companion is shutting down; the timer is unref'd, so\n * it never keeps the process alive. A hold with no host to probe has none (the next admission's pause releases it).\n */\n private probeConnectivityInBackground(held: CodingAgentConnectivityHold, failedProbes: number): void {\n this.backgroundConnectivityProbe?.cancel();\n this.backgroundConnectivityProbe = undefined;\n if (held.probeRoute === undefined) return;\n const probeRoute = held.probeRoute;\n this.backgroundConnectivityProbe = this.scheduleBackgroundConnectivityProbe(async () => {\n this.backgroundConnectivityProbe = undefined;\n if (this.codingAgentConnectivityHold !== held || this.shutdownManager?.isShutdownInProgress() === true) return;\n const probe = await this.probeCodingAgentConnectivity(probeRoute).catch((): CodingAgentConnectivityProbeResult | undefined => undefined);\n /*\n * Load-bearing: the hold may have been released, and a NEWER one opened with its own prober, while this probe was\n * in flight. Rescheduling here would cancel that prober, and releasing would end a loss this probe never saw.\n */\n if (this.codingAgentConnectivityHold !== held || this.shutdownManager?.isShutdownInProgress() === true) return;\n if (probe?.reachable === true) {\n this.releaseCodingAgentConnectivityHold(held, 'the coding agent\\'s API answered the background probe');\n return;\n }\n this.probeConnectivityInBackground(held, failedProbes + 1);\n }, nextCodingAgentConnectivityProbeDelayMs(failedProbes));\n }\n\n /**\n * Stop the background probe of an open hold: the companion's stop handler calls it beside its other unref'd loops, so a\n * companion shutting down starts no probe. The hold itself stays; a process that is going away admits nothing anyway.\n */\n public stopBackgroundConnectivityProbe(): void {\n this.backgroundConnectivityProbe?.cancel();\n this.backgroundConnectivityProbe = undefined;\n }\n\n /** Schedule one background probe; a method so a test can run it on demand. Unref'd: it never holds the process. */\n protected scheduleBackgroundConnectivityProbe(run: () => Promise<void>, delayMs: number): { readonly cancel: () => void } {\n const timer = setTimeout(() => { void run(); }, delayMs);\n timer.unref?.();\n return { cancel: () => clearTimeout(timer) };\n }\n\n /**\n * Release the admission hold, when `held` is still the one holding, and record that the loss ENDED (re-review of\n * 8038824b4, F3): a silent turn settling long after this instant was not waiting on the network.\n */\n private releaseCodingAgentConnectivityHold(held: CodingAgentConnectivityHold, why: string): void {\n if (this.codingAgentConnectivityHold !== held) return;\n this.codingAgentConnectivityHold = undefined;\n this.backgroundConnectivityProbe?.cancel();\n this.backgroundConnectivityProbe = undefined;\n const now = Date.now();\n this.connectivityLosses = (this.connectivityLosses ?? []).map((loss) => (loss.endedAtMs === undefined ? { ...loss, endedAtMs: now } : loss));\n this.logger.warn(`The connectivity hold ends: ${why}`, { probeRoute: held.probeRoute === undefined ? undefined : describeCodingAgentProbeRoute(held.probeRoute) });\n }\n\n /**\n * One probe of the agent's API when a turn settles `cancelled` with no operator abort and nothing in the turn itself\n * named the network (re-review of bb5de0ee0, item 4). It decides no blame (the turn's own timeline does), it only\n * keeps the loss record and the hold true: a reachable API ends a hold, an unreachable one opens a hold and records a\n * loss (a full cut nobody reported, re-review of 8038824b4 F2). A probe that throws says nothing, and changes nothing.\n */\n private async probeConnectivityAtCancelledSettlement(binding: ApplicationCodingAgentBinding | undefined, taskRef: string, runTaskId: string): Promise<void> {\n const held = this.codingAgentConnectivityHold;\n /*\n * With NO hold, a failed probe opens one and records a loss on the probe's word alone, so the probe must speak for the\n * agent (re-review of 1da455d5d, R2). It does since #3262: it takes the agent's own route (the endpoint and the\n * proxy its launch environment and settings select), so it runs wherever that route is known. Where it is not\n * (`resolveCodingAgentProbeRoute` answers nothing), no probe runs and only a turn that itself reports the network\n * may open a hold. The interim guard that turned this probe off whenever THIS process's environment named a proxy or\n * a cloud provider (055c09bf8) is gone: it read the wrong process's environment.\n */\n const probeRoute = held !== undefined ? held.probeRoute : this.resolveCodingAgentProbeRouteFor('', binding);\n if (probeRoute === undefined) return;\n const probe = await this.probeCodingAgentConnectivity(probeRoute).catch((): CodingAgentConnectivityProbeResult | undefined => undefined);\n if (probe === undefined) return;\n if (probe.reachable) {\n if (held !== undefined) this.releaseCodingAgentConnectivityHold(held, 'the coding agent\\'s API answers again');\n return;\n }\n this.openCodingAgentConnectivityHold(networkFailureKindOfFailedProbe(probe), probeRoute, taskRef, runTaskId);\n }\n\n /** The network loss holding coding admissions now (#3236), or undefined. */\n public readCodingAgentConnectivityHold(): CodingAgentConnectivityHold | undefined {\n return this.codingAgentConnectivityHold;\n }\n\n /**\n * One probe of the agent's API along its route (#3236, #3262). A method, so a test can stand in for the network;\n * production probes DNS then HTTPS when the route is direct, and the proxy then a `CONNECT` through it when it is not\n * (`probeCodingAgentRoute`).\n */\n protected probeCodingAgentConnectivity(route: CodingAgentProbeRoute): Promise<CodingAgentConnectivityProbeResult> {\n return probeCodingAgentRoute(route);\n }\n\n /** The wait between probes. A method for the same reason as the probe. */\n protected sleepBeforeConnectivityProbe(delayMs: number): Promise<void> {\n return new Promise((resolve) => setTimeout(resolve, delayMs));\n }\n\n /**\n * Before a coding turn is admitted: while a network loss holds (#3236), wait for a probe of the agent's API to\n * succeed, with back-off, instead of starting a turn certain to fail the same way. Returns at once when nothing holds.\n *\n * Every door is held, an explicit `wildo build run` included, unlike the usage-limit hold (re-review F5, decided): a\n * usage limit's turn is certain to fail until its stated reset, so an operator's explicit try costs one turn and its\n * success is the only proof the window ended; here the proof is a free probe, made first, so an explicit run whose\n * network is back is admitted at once, and one whose network is not would start a turn certain to fail. The way past\n * a probe that is wrong is `wildo build rearm <task> --reason environment`, named in the refusal.\n *\n * Past {@link CODING_AGENT_CONNECTIVITY_WAIT_LIMIT_MS}, or once the companion begins shutting down, admission is\n * REFUSED as a dispatch conflict: the host declining to start the run, which the caller settles ABORTED and the attempt\n * budget never counts (#1581). The wave's filling ends on that refusal; a later wave meets this gate again.\n */\n private async awaitCodingAgentConnectivity(taskRef: string): Promise<void> {\n const startedAtMs = Date.now();\n let failedProbes = 0;\n for (let held = this.codingAgentConnectivityHold; held !== undefined; held = this.codingAgentConnectivityHold) {\n if (held.probeRoute === undefined) {\n // No host this agent is known to call (OpenCode, review F5): one interval's pause, then the next turn is the probe.\n await this.sleepBeforeConnectivityProbe(nextCodingAgentConnectivityProbeDelayMs(0));\n this.releaseCodingAgentConnectivityHold(held, 'no host to probe; the next turn is the probe');\n return;\n }\n const probe = await this.probeCodingAgentConnectivity(held.probeRoute);\n if (probe.reachable) {\n this.releaseCodingAgentConnectivityHold(held, `the coding agent's API answered a probe; coding admissions resume after ${Date.now() - startedAtMs} ms`);\n return;\n }\n // A failed probe is a loss on record (re-review of 8038824b4, F2); while this hold's loss is open it adds nothing.\n this.openCodingAgentConnectivityHold(networkFailureKindOfFailedProbe(probe), held.probeRoute, held.taskRef, held.runTaskId);\n const delayMs = nextCodingAgentConnectivityProbeDelayMs(failedProbes);\n failedProbes += 1;\n if (Date.now() - startedAtMs + delayMs > CODING_AGENT_CONNECTIVITY_WAIT_LIMIT_MS || this.shutdownManager?.isShutdownInProgress() === true) {\n throw this.buildDispatchConflictError(\n `Coding task ${taskRef} was not started: the coding agent's API (${describeCodingAgentProbeRoute(held.probeRoute)}) has not been reachable since ${held.observedAt} `\n + `(${held.networkFailureKind}; last probe failed at ${probe.failedStep}: ${probe.detail}). No attempt was spent. `\n + `Dispatch it again once the network is back. If the agent does reach its API and this probe is wrong, end the hold with: wildo build rearm ${taskRef} --reason environment --note \"<why>\".`,\n );\n }\n this.logDebug('Waiting for the coding agent\\'s API to answer before admitting a coding turn', {\n taskRef, probeRoute: describeCodingAgentProbeRoute(held.probeRoute), failedStep: probe.failedStep, detail: probe.detail, nextProbeInMs: delayMs,\n });\n await this.sleepBeforeConnectivityProbe(delayMs);\n }\n }\n\n /**\n * The usage limit holding the build wave now (#2388), or undefined once it has ended. Read before each slot\n * is filled; a hold past its `resumesAt` is dropped here, so the reset itself releases it.\n */\n public readCodingAgentUsageLimitHold(now: number = Date.now()): (CodingAgentUsageLimit & { readonly taskRef: string; readonly runTaskId: string }) | undefined {\n const held = this.codingAgentUsageLimitHold;\n if (held && Date.parse(held.resumesAt) <= now) {\n this.codingAgentUsageLimitHold = undefined;\n return undefined;\n }\n return held;\n }\n\n /**\n * Close a run's window with the paths it changed, and say which runs shared the tree with it and\n * which of those paths they changed too (#1528). `null` when it overlapped nothing — a run alone in\n * the tree records nothing new.\n */\n private closeCodingRunWindow(taskId: string, changedPaths: readonly string[]): CodingRunConcurrencyRecord | null {\n const window = this.codingRunWindows.find((candidate) => candidate.taskId === taskId);\n if (!window) return null;\n const endedAtMs = Date.now();\n const record = describeRunConcurrency(this.codingRunWindows, { taskId, startedAtMs: window.startedAtMs, endedAtMs }, changedPaths);\n this.codingRunWindows = this.codingRunWindows.map((candidate) => candidate.taskId === taskId\n ? { ...candidate, endedAtMs, changedPaths: [...changedPaths] }\n : candidate);\n return record.overlappingTaskRefs.length > 0 ? record : null;\n }\n\n /**\n * The END of a wave (#1528, #3204): the runs that failed verification beside their siblings are re-checked ALONE (#3220),\n * under the workspace lock, now that nothing is writing; then the tree is committed as a forced build checkpoint naming\n * every run no checkpoint named yet, failed runs included (their files are in the tree).\n *\n * Which runs are RE-CHECKED: every run the wave dispatched (`taskIds`) and every concurrent run that recorded writes\n * since the wave began (`startedAt`), which brings in a generation step the wave ran inline. Only under the posture that\n * lets the system accept.\n */\n public async reconcileWaveAcceptance(input: {\n readonly startedAt: string;\n readonly taskIds: readonly string[];\n }): Promise<Array<{ readonly taskId: string; readonly committedPaths: number; readonly error?: string }>> {\n return (await this.reconcileSharedTree(input)).results;\n }\n\n /**\n * {@link reconcileWaveAcceptance}, saying whether the re-checks DEFERRED: a concurrent run outside these runs is still\n * writing, so nothing can be checked alone (R9). The sharing episode's end keeps the episode open then, so the next end\n * re-checks it (#1805 review F5). The checkpoint runs either way.\n */\n private async reconcileSharedTree(input: {\n readonly startedAt: string;\n readonly taskIds: readonly string[];\n readonly lock?: { readonly takeLock?: boolean };\n }): Promise<{\n /** The isolated re-checks could not run: a concurrent run outside these is still writing. The checkpoint still ran. */\n readonly deferred: boolean;\n readonly results: Array<{ readonly taskId: string; readonly committedPaths: number; readonly error?: string }>;\n }> {\n let deferred = false;\n if (laneBoundaryTreatmentFor(APPLICATION_CREATION_AUTONOMY_POSTURE, PlaybookLaneBoundaryDecision.APPROVE_RESULT) === LaneBoundaryTreatment.NOTIFY_AND_PROCEED) {\n if (this.concurrentRunLiveInProcess(input.taskIds)) {\n deferred = true;\n this.logDebug('Deferred the isolated re-checks: a concurrent run outside these is still writing', { taskIds: input.taskIds });\n } else {\n /*\n * #3220: a run that failed verification while siblings were writing is re-checked ALONE, now that nothing is\n * writing. A pass is recorded on the run and lands its task (the landing reads it); it no longer decides a commit.\n */\n const during = (await this.codingRunWriteRegister.list())\n .filter((record) => record.concurrent === true && record.at >= input.startedAt)\n .map((record) => record.taskId);\n // Under the workspace lock (review of 4a1b1f1bf F10): no generation step or newly admitted run writes during the re-check.\n const recheck = () => this.recheckInterferedVerificationFailures([...new Set([...input.taskIds, ...during])]);\n if (input.lock?.takeLock === false) await recheck();\n else await this.underBriefWorktreeLock(recheck);\n }\n }\n const outcome = await this.requestBuildCheckpoint({ force: true, takeLock: input.lock?.takeLock });\n const committedPaths = outcome === undefined || outcome.alreadyCommitted ? 0 : outcome.committedPaths.length;\n return { deferred, results: (outcome?.namedTaskIds ?? []).map((taskId) => ({ taskId, committedPaths })) };\n }\n\n /**\n * Re-run, ALONE, the failed checks of each run of this reconciliation that failed verification while siblings\n * shared the tree ({@link failedVerificationBesideSiblings}: interference suspected, #3220, or checks that could not be asked\n * beside siblings, #3204). Called at a wave's end, with every run settled and accepted, so\n * nothing writes while the checks run. Each re-check is recorded on its run, where the build record shows what\n * was decided; a run whose checks pass now has a result, and its files are committed.\n *\n * A check carried red from before the run is not re-run: it was never this run's failure. Best effort: a re-check\n * that cannot run, or cannot be recorded, leaves the run failed, which refuses its files (the safe direction).\n *\n * ONE re-check per run: once one is recorded, the run's standing follows it, and a run that failed again stays failed\n * for its task's next run to fix. \"Alone\" means no coding run of this process is writing; the tree still holds what\n * failed or cancelled siblings left (their files are refused, not removed), so a re-check can fail on a sibling's\n * half-written file. That keeps the run failed, the conservative answer, and its task is re-run.\n */\n private async recheckInterferedVerificationFailures(taskIds: readonly string[]): Promise<Map<string, IsolatedVerificationRecheck>> {\n const rechecks = new Map<string, IsolatedVerificationRecheck>();\n for (const taskId of new Set(taskIds)) {\n try {\n const row = await this.executionsService.getActorTask(taskId) as { output?: unknown; memory?: unknown };\n const output = isRecordValue(row.output) ? row.output : undefined;\n // Interference suspected, or checks that could not be asked beside siblings (a sibling's red compile): #3204.\n if (output === undefined || !failedVerificationBesideSiblings(output as Parameters<typeof failedVerificationBesideSiblings>[0])) continue;\n if (readIsolatedVerificationRecheck(row.memory) !== undefined) continue;\n const carried = new Set(Array.isArray(output.carriedVerificationFailures) ? output.carriedVerificationFailures.map(String) : []);\n const checkRefs = [...new Set((Array.isArray(output.verification) ? output.verification : [])\n .filter((entry): entry is { checkRef: string; outcome: { success?: unknown } } => isRecordValue(entry) && typeof entry.checkRef === 'string' && isRecordValue(entry.outcome))\n .filter((entry) => entry.outcome.success === false && !carried.has(entry.checkRef))\n .map((entry) => entry.checkRef))];\n if (checkRefs.length === 0) continue;\n const { verification, unrunCheckRefs } = await this.executeVerificationPlans(resolveApplicationCodingTaskVerificationPlans(checkRefs));\n const unrun = new Set(unrunCheckRefs);\n const results = verification.map(({ checkRef, outcome }) => ({ checkRef, success: outcome.success && !unrun.has(checkRef), message: outcome.message }));\n const recheck: IsolatedVerificationRecheck = {\n checkRefs,\n passed: results.length === checkRefs.length && results.every((result) => result.success),\n results,\n recheckedAt: new Date().toISOString(),\n };\n rechecks.set(taskId, recheck);\n await this.serializeRunMemoryWrite(async () => {\n const current = await this.executionsService.getActorTask(taskId) as { memory?: Actors_Memory_Context };\n await this.executionsService.updateActorTask(taskId, { memory: withIsolatedVerificationRecheck(current.memory, recheck) });\n });\n this.announceRunStateChanged();\n this.logger.warn(recheck.passed\n ? 'A run that failed verification beside its siblings passed its checks alone; its task lands'\n : 'A run that failed verification beside its siblings failed its checks again alone; its task is run again', {\n taskId, taskRef: typeof (row as { input?: { taskRef?: unknown } }).input?.taskRef === 'string' ? (row as { input: { taskRef: string } }).input.taskRef : undefined, ...recheck,\n });\n } catch (error) {\n this.logger.warn('Could not re-check a run that failed verification beside its siblings; it stays failed', { taskId, error: describeCaughtError(error) });\n }\n }\n return rechecks;\n }\n\n /**\n * Commit a BUILD CHECKPOINT (#3204, {@link AcceptedChangeCommitCompanionService.commitBuildCheckpoint}): the working tree\n * as it stands, naming the runs settled since the previous one. Every automatic commit of coding-run work goes through\n * here: a run's settlement, a generation step, a wave's and a sharing episode's end, a restart's recovery.\n *\n * **Throttled, never queued twice.** A settlement asks for one; within {@link BUILD_CHECKPOINT_MIN_INTERVAL_MS} of the\n * last one the request is folded into one scheduled for the end of that interval, so ten agents settling minutes apart\n * make a handful of commits, not a commit each. `force` commits now (a wave's end, a step, a recovery), waiting for one\n * already running. A build task lands when its product is in the working tree, so no LANDING waits on a checkpoint; a\n * caller that awaits one waits for the commit only (a concurrent run's settlement does not, review of 4a1b1f1bf F6).\n *\n * Under the posture's table like every automatic door (nothing under GUIDED), inside the workspace lock unless the caller\n * holds it (`takeLock: false`). Best effort: a failure is logged and the next checkpoint carries the tree.\n */\n public async requestBuildCheckpoint(options: {\n readonly force?: boolean;\n readonly origin?: AcceptOrigin.WAVE_RECONCILIATION | AcceptOrigin.INTERRUPTED_RUN_RECOVERY;\n /** Runs settling now, still registered as active: named by this checkpoint all the same. */\n readonly settlingTaskIds?: readonly string[];\n readonly takeLock?: boolean;\n } = {}): Promise<BuildCheckpointOutcome | undefined> {\n const settling = new Set(options.settlingTaskIds ?? []);\n if (options.force !== true) {\n const sinceLast = Date.now() - this.lastBuildCheckpointAt;\n if (sinceLast < BUILD_CHECKPOINT_MIN_INTERVAL_MS) {\n for (const taskId of settling) this.checkpointSettlingTaskIds.add(taskId);\n this.buildCheckpointTimer ??= setTimeout(() => {\n this.buildCheckpointTimer = undefined;\n void this.requestBuildCheckpoint({ force: true });\n }, BUILD_CHECKPOINT_MIN_INTERVAL_MS - sinceLast);\n this.buildCheckpointTimer.unref?.();\n return undefined;\n }\n }\n for (const taskId of this.checkpointSettlingTaskIds) settling.add(taskId);\n this.checkpointSettlingTaskIds.clear();\n /*\n * One at a time: a request arriving while one commits waits for it, then commits what is left. Except a caller that\n * already HOLDS the workspace lock (a generation step's window, a single-flight run's settlement): a checkpoint queued\n * before it may be waiting for that very lock, so waiting on it would hold both until the lock's retries ran out. No\n * other checkpoint can be committing while the lock is held, so this one commits at once.\n */\n const previous = options.takeLock === false ? Promise.resolve(undefined) : this.buildCheckpointInFlight;\n const next = previous.catch(() => undefined).then(async () => {\n this.lastBuildCheckpointAt = Date.now();\n let outcome: BuildCheckpointOutcome | undefined;\n try {\n await this.underAcceptancePosture(async () => {\n const liveTaskIds = new Set([...this.activeRuns.keys()].filter((taskId) => !settling.has(taskId)));\n outcome = await this.acceptedChangeCommit.commitBuildCheckpoint({ origin: options.origin ?? AcceptOrigin.WAVE_RECONCILIATION, liveTaskIds });\n return outcome === undefined || outcome.alreadyCommitted ? [] : [{ committedPaths: outcome.committedPaths.length }];\n }, { takeLock: options.takeLock });\n if (outcome !== undefined && !outcome.alreadyCommitted) {\n this.logger.info('Committed a build checkpoint', {\n commitSha: outcome.commitSha, committedPaths: outcome.committedPaths.length, namedRuns: outcome.namedTaskIds.length, excludedPaths: outcome.excludedPaths,\n });\n }\n } catch (error) {\n this.logger.warn('Could not commit a build checkpoint; the next one carries the tree', { error: describeCaughtError(error) });\n }\n return outcome;\n });\n if (options.takeLock !== false) this.buildCheckpointInFlight = next;\n return next;\n }\n\n /**\n * What every automatic acceptance shares: nothing under a posture that keeps acceptance with a person,\n * the worktree lock while committing, and the run-accepted listeners told once something was committed.\n */\n private async underAcceptancePosture<R extends { readonly committedPaths: number }>(\n accept: () => Promise<R[]>,\n /** FALSE when the caller already holds the workspace lock, as a single-flight run's own accept does. */\n options: { readonly takeLock?: boolean } = {},\n ): Promise<R[]> {\n if (laneBoundaryTreatmentFor(APPLICATION_CREATION_AUTONOMY_POSTURE, PlaybookLaneBoundaryDecision.APPROVE_RESULT) !== LaneBoundaryTreatment.NOTIFY_AND_PROCEED) return [];\n let results: R[] = [];\n if (options.takeLock === false) results = await accept();\n else await this.underBriefWorktreeLock(async () => { results = await accept(); });\n if (results.some((result) => result.committedPaths > 0)) {\n for (const listener of this.runAcceptedListeners) {\n try { listener(); } catch (error) { this.logDebug('A run-accepted listener threw', { error: describeCaughtError(error) }); }\n }\n }\n return results;\n }\n\n /**\n * Refuse (409) while another coding run holds the worktree, NAMING it — the holder is read from the\n * actor plane, so the message is true after a restart and from a second process. `exceptExecutionId`\n * is the execution the caller itself opened at selection, which holds the subject legitimately.\n */\n private async refuseWhileWorktreeIsHeld(exceptExecutionId: string | null, sessionContext?: CompanionExecutionSessionContext): Promise<void> {\n const holder = await this.actorsSystem.readExclusiveSubjectHolder(APPLICATION_CODING_SYSTEM_REF, APPLICATION_CODING_WORKTREE_SUBJECT, sessionContext);\n if (!holder || holder._id === exceptExecutionId) return;\n throw this.buildDispatchConflictError(\n `A coding-agent run is already active (task ${holder.tasks[0]?._id ?? 'unknown'}, execution ${holder._id}, ${holder.status}`\n + `${holder.createdAt ? `, started ${holder.createdAt}` : ''}). Application coding tasks share one working tree.`,\n );\n }\n\n /** The driver's own refusal — two callers raced past the fast 409 — in this lane's 409 shape. */\n private translateWorktreeBusy(error: unknown): unknown {\n return isActorExecutionSubjectBusyError(error)\n ? this.buildDispatchConflictError('A coding-agent run took the working tree first. Application coding tasks share one working tree.')\n : error;\n }\n\n /** Admission of a run that was opened at selection: start it, completing its input with the baseline. */\n private async startSelectedApplicationCodingExecution(\n selected: OpenedActorExecution,\n task: MetaWorkflow_ApplicationCodingTaskContract,\n baseline: GitWorktreeSnapshot,\n sessionContext?: CompanionExecutionSessionContext,\n origin?: CodingRunOrigin,\n ): Promise<OpenedActorExecution> {\n await this.actorsSystem.startActorExecution(selected, { taskInput: this.buildApplicationCodingTaskInput(task, baseline, origin) }, sessionContext);\n return selected;\n }\n\n private buildApplicationCodingExecutionRequest(\n task: MetaWorkflow_ApplicationCodingTaskContract,\n baseline: GitWorktreeSnapshot | null,\n sessionContext?: CompanionExecutionSessionContext,\n origin?: CodingRunOrigin,\n mode: CodingRunConcurrency = CodingRunConcurrency.SINGLE_FLIGHT,\n ): ActorExecutionOpenRequest<CompanionExecutionSessionContext> {\n return {\n systemRef: APPLICATION_CODING_SYSTEM_REF,\n // A single-flight run holds the application's working tree while it runs (#1361); a concurrent\n // one holds only its own task, so two runs of one task can never overlap (#1528).\n exclusiveSubject: applicationCodingExclusiveSubject(mode, task.taskRef),\n // The SELECTED agent, resolved once at creation and carried on the row —\n // so a task records which agent it was addressed to, and a selection\n // changed between creation and claim cannot silently redirect it. The\n // system declares one actor per binding under the binding's own ref.\n actorRef: resolveSelectedApplicationCodingAgentBinding().ref,\n scope: sessionContext,\n task: {\n title: `Application coding task ${task.taskRef}`,\n description: `Typed application coding task for ${task.objectiveRef}; acceptance is a commit, made by the loop under the autonomy posture or by a person on the workbench.`,\n topic: Actor_Task_Topics.IMPLEMENTATION,\n input: this.buildApplicationCodingTaskInput(task, baseline, origin),\n /*\n * The cross-plane join, carried in the GENERIC correlation envelope rather than in a\n * `workbenchBuildPlanTaskId` column on the actor-task row (#1348).\n *\n * The engine owns the slot and validates only that keys and values are non-empty strings;\n * this domain owns the keys. The value is the board's row identity — sanitized, which is the\n * ref verbatim today — so the creation plane can match its build-plan row to this task\n * without the generic platform row knowing what a build-plan task is.\n */\n correlation: {\n domain: WORKBENCH_TASK_CORRELATION_DOMAIN,\n refs: {\n [WorkbenchTaskCorrelationRef.BUILD_PLAN_TASK]: sanitizeWorkbenchCreationPlaneIdentity(task.taskRef),\n // The thread the dispatch came from (#1454, Step 7), the same key a playbook run carries.\n ...(origin?.conversationId ? { [WorkbenchTaskCorrelationRef.CONVERSATION]: origin.conversationId } : {}),\n },\n },\n },\n };\n }\n\n /**\n * The task row's INPUT — replayable task identity and guard evidence, never prompt/context bytes\n * except the assembly-repair failure tail named there (see the contract above\n * `openApplicationCodingExecution`). `baseline` is `null` between\n * selection and admission, and says so rather than being absent: a reader can tell a run that has\n * not captured one from a row that forgot to record it.\n */\n private buildApplicationCodingTaskInput(\n task: MetaWorkflow_ApplicationCodingTaskContract,\n baseline: GitWorktreeSnapshot | null,\n origin?: CodingRunOrigin,\n ): Record<string, unknown> {\n return {\n taskRef: task.taskRef,\n // Read back by the dispatch projection, so the row says which conversation started it.\n ...(origin?.conversationId ? { conversationId: origin.conversationId } : {}),\n // An operator ran a task the probe called landed (#2217): the run carries why, and the build record reads it back.\n ...(origin?.landedOverride ? { landedOverride: origin.landedOverride } : {}),\n // When the wave began filling this run's slot (#3206): the start of its dispatch wait, read back by the build record.\n ...(origin?.preparationStartedAt ? { preparationStartedAt: origin.preparationStartedAt } : {}),\n // A repair of a failing assembly check records which check and what it printed (#2283): the bound on repairs reads it.\n ...assemblyRepairRunInputField(task),\n objectiveRef: task.objectiveRef,\n candidateRef: task.candidateRef,\n mutationScope: task.mutationScope,\n contextPlan: {\n planRef: task.contextPlan.planRef,\n objectiveRef: task.contextPlan.objectiveRef,\n },\n contextSelection: {\n planRef: task.contextSelection.planRef,\n selectedSourceRefs: task.contextSelection.selectedSources.map((source) => source.sourceRef),\n selectedSourceCount: task.contextSelection.selectedSources.length,\n /*\n * WHAT WAS SCREENED, per third-party source (#2846): the run's own record of which text written outside the\n * repository reached its brief, and what the classifier concluded. Outcome, provider and reason only, never the\n * text. Per-run state like the rest of this row, so it is not period evidence.\n *\n * assurance-control: WILDO.SOFTWARE.AI_PRODUCED_CHANGE_CONTROL — each run records what screening concluded per third-party source, and why a brief was built without provenance, never the text.\n */\n thirdPartyScreenings: task.contextSelection.selectedSources\n .filter((source) => source.screening !== undefined)\n .map((source) => ({ sourceRef: source.sourceRef, ...source.screening })),\n /*\n * WHY every decided element was routed as third-party, when the catalog could not say which came from web\n * research (#2846 review L1): the brief's own trusted statement, copied, so the row records the degraded run.\n */\n ...briefProvenanceUnavailableRunField(task),\n },\n verificationIntent: task.verificationIntent,\n installedSkillRefs: task.installedSkillRefs,\n baseline: baseline\n ? {\n headSha: baseline.headSha,\n dirtyFileCount: Object.keys(baseline.files).length,\n capturedAt: baseline.capturedAt,\n /*\n * The dirty files themselves, not only their count: the one record that survives a\n * restart mid-run, so the next start can tell what THIS run wrote from what was already\n * there ({@link recoverInterruptedRunWrites}). Paths and fingerprints only — no content.\n */\n files: baseline.files,\n }\n : null,\n };\n }\n\n /**\n * Open the trace half of one coding run — see {@link CodingRunTrace}. Best-effort like every\n * trace write here: a session that cannot be opened is recorded as a traceability error and the\n * run proceeds with no scope, which the actor plane accepts.\n */\n private async openCodingRunTrace(taskId: string, taskRef: string): Promise<CodingRunTrace> {\n let runSession: CompanionExecutionSessionContext | undefined;\n let runStep: ReturnType<CompanionTraceabilityService['createStep']> | undefined;\n const traceabilityErrors: unknown[] = [];\n const traceBestEffort = async (operation: string, write: () => Promise<void>): Promise<void> => {\n try {\n await write();\n } catch (error) {\n // Traceability is required evidence, but it must not become a control\n // flow escape that leaves the durable task PROCESSING after possible\n // source changes. The final task row records this failure and remains\n // visibly non-accepted for explicit follow-up.\n traceabilityErrors.push(error);\n this.logger.error('Application coding-task trace operation failed', {\n taskId,\n taskRef,\n operation,\n error: describeCaughtError(error),\n });\n }\n };\n await traceBestEffort('initialize-session', async () => {\n runSession = this.traceabilityService.createInternalSession({\n label: 'application-coding-task-run',\n metadata: { taskId, taskRef },\n });\n if (!runSession) return;\n await this.traceabilityService.registerAlias(runSession, CompanionTraceAliasKind.ACTOR_TASK, taskId);\n runStep = this.createOperationTraceStep(runSession, 'application-coding-task-run');\n });\n return { runSession, runStep, traceabilityErrors, traceBestEffort };\n }\n\n /**\n * Accept every pending PLAYBOOK run under the posture, from inside the worktree window and before a\n * baseline — the third site of #1534 (see `acceptPendingPlaybookRuns` for why exactly here).\n * Best effort by construction: it must never cost the run whose window it borrows.\n */\n private async acceptPendingPlaybookRunsBeforeBaseline(): Promise<void> {\n if (laneBoundaryTreatmentFor(APPLICATION_CREATION_AUTONOMY_POSTURE, PlaybookLaneBoundaryDecision.APPROVE_RESULT) !== LaneBoundaryTreatment.NOTIFY_AND_PROCEED) return;\n try {\n const outcome = await this.acceptedChangeCommit.acceptPendingPlaybookRuns(AcceptOrigin.AUTONOMY_POSTURE);\n if (outcome.accepted > 0) {\n for (const listener of this.runAcceptedListeners) {\n try { listener(); } catch (error) { this.logDebug('A run-accepted listener threw', { error: describeCaughtError(error) }); }\n }\n }\n } catch (error) {\n this.logger.warn('Could not accept pending playbook runs before a baseline', { error: describeCaughtError(error) });\n }\n }\n\n /**\n * The unattended creation driver's accept (#2233): commit every pending playbook run's writes when the autonomy posture\n * says the SYSTEM accepts them, the same door and origin as the accept before a baseline. Three answers:\n *\n * - `HELD_FOR_PERSON`: the posture does not notify-and-proceed on a result, so acceptance is a person's (the marked\n * critical gate armed): nothing is committed, and the driver stops and says so;\n * - `DEFERRED_RUNS_LIVE`: a coding run is writing the tree now; committing inside its window would destroy its\n * attribution, and the next baseline's accept carries these runs anyway;\n * - `ACCEPTED`: the outcome, with the run-accepted listeners told, as at a baseline.\n *\n * Under the worktree lock, like a concurrent run's accept before its baseline.\n */\n public async acceptPendingPlaybookRunsForUnattendedDrive(): Promise<\n | { readonly disposition: CreationDriveAcceptDisposition.HELD_FOR_PERSON | CreationDriveAcceptDisposition.DEFERRED_RUNS_LIVE }\n | { readonly disposition: CreationDriveAcceptDisposition.ACCEPTED; readonly accepted: number; readonly superseded: number; readonly editedOutsideRuns: number; readonly failed: number }\n > {\n if (laneBoundaryTreatmentFor(APPLICATION_CREATION_AUTONOMY_POSTURE, PlaybookLaneBoundaryDecision.APPROVE_RESULT) !== LaneBoundaryTreatment.NOTIFY_AND_PROCEED) {\n return { disposition: CreationDriveAcceptDisposition.HELD_FOR_PERSON };\n }\n const runsLive = async (): Promise<boolean> => this.activeRuns.size > 0 || await this.concurrentCodingRunsLive();\n if (await runsLive()) return { disposition: CreationDriveAcceptDisposition.DEFERRED_RUNS_LIVE };\n return this.underBriefWorktreeLock(async () => {\n // Asked again under the lock: a concurrent run holds no lock, so one may have started while this waited for it.\n if (await runsLive()) return { disposition: CreationDriveAcceptDisposition.DEFERRED_RUNS_LIVE };\n const outcome = await this.acceptedChangeCommit.acceptPendingPlaybookRuns(AcceptOrigin.AUTONOMY_POSTURE);\n if (outcome.accepted > 0) {\n for (const listener of this.runAcceptedListeners) {\n try { listener(); } catch (error) { this.logDebug('A run-accepted listener threw', { error: describeCaughtError(error) }); }\n }\n }\n return { disposition: CreationDriveAcceptDisposition.ACCEPTED, ...outcome };\n });\n }\n\n /**\n * Run a build-plan GENERATION STEP inside the coding lane's attribution window, and accept what it\n * wrote under the autonomy posture — the second site of #1534's invariant.\n *\n * **Why a generation step needs this at all.** It lands on COMMITTED paths\n * (`ApplicationBuildGenerationStepLandedKind.COMMITTED_PATHS`), exactly like a coding task's\n * product, and it is EXEMPT from the loop guard because a step such as `i18n-labels` is\n * legitimately re-runnable. So an uncommitted step does not stall visibly: it is re-selected on\n * every dispatch, does nothing new, and every task that names it as a prerequisite never becomes\n * ready. The 2026-09-23 run never met this only because an operator's shell loop committed\n * everything between dispatches.\n *\n * **Why inside THIS window rather than beside it.** A coding run's attribution is a baseline→post\n * comparison, and it collapses when anything commits inside it. Until now a generation step held\n * neither half of the lane's single-flight, so it could run while a coding run was live and land\n * its writes inside that run's window. Here it takes both: the worktree lease check first — the\n * same 409 a second coding task gets, naming the holder — then the workspace mutation lock for\n * the snapshot, the step, the capture and the accept. The two are not redundant: a coding run\n * SELECTED but not yet admitted holds the lease and not the lock while it waits for the compile\n * watchers, and a step taking the lock there would fail that run's admission. A PARKED run holds\n * neither, by design — siblings run while its question waits, and anything they commit is\n * classified `committed_during_run` and excluded from its accept; a step is one more sibling. This is the lane's EXISTING single-flight,\n * extended to the other writer it always had; it restricts no agent's edits, which is what\n * #1264's \"no serialization\" constraint is about.\n *\n * **The writes go through the same register and door as a coding run's**, so the workbench's\n * Accept works on a generation-step row too, under GUIDED, with the same refusals. The capture and\n * the accept are best effort: a step whose writes could not be registered still returns its\n * result, and stays visibly unlanded.\n */\n public async runGenerationStepInWorktreeWindow<T>(input: {\n readonly taskRef: string;\n readonly taskId: string;\n readonly execute: () => Promise<T>;\n readonly sessionContext?: CompanionExecutionSessionContext;\n /**\n * The directories only this step writes (#2240): the dispatch plan's writable roots, derived from the\n * step's own evidence paths. Read only when the window is SHARED with concurrent coding runs, where they\n * are the step's claims. Omitted, a shared step claims nothing, as before.\n */\n readonly ownedPathPrefixes?: readonly string[];\n }): Promise<T> {\n await this.refuseWhileWorktreeIsHeld(null, input.sessionContext);\n return withDedicatedFileLock(\n this.getWorkspaceMutationLockPath(),\n async () => {\n await this.acceptPendingPlaybookRunsBeforeBaseline();\n const baseline = await this.gitChangeSetService.captureWorktreeSnapshot();\n await this.recordRunBaselineOnTask(input.taskId, baseline, input.sessionContext);\n const concurrentAtStart = await this.concurrentCodingRunsLive(input.sessionContext);\n // Beside a concurrent run, the step is part of that sharing episode from its own baseline (#1805).\n if (concurrentAtStart) this.markSharingEpisodeStarted(baseline.capturedAt);\n /*\n * A step that throws, or whose capture fails, records no change set, and its window would stay OPEN to HEAD for the\n * build-task decisions reader (#3224 F2): every later decision would read as made inside it. So its window is\n * bounded at the HEAD it left.\n */\n const boundWindow = () => this.recordRunWindowBound(input.taskId, input.taskRef, baseline);\n let result: Awaited<ReturnType<typeof input.execute>>;\n try {\n result = await input.execute();\n } catch (error) {\n await boundWindow();\n throw error;\n }\n let shared = concurrentAtStart;\n let claimedPaths: readonly string[] = [];\n try {\n const changeSet = await this.gitChangeSetService.captureChangeSet(baseline);\n /*\n * A step holds the workspace lock, but a CONCURRENT coding run takes that lock only to commit, so\n * a wave's runs keep writing while the step runs inline (#1805 review N2). Its capture then holds\n * their writes too. So when concurrent runs were live at either end of its window, or one recorded\n * writes during it, the step is recorded as a sharing run and claims only what lies under the\n * directories it alone writes (#2240): its record then says which files are its own. The checkpoint\n * that follows commits the tree, its siblings' writes included (#3204).\n */\n const concurrentAtEnd = await this.concurrentCodingRunsLive(input.sessionContext);\n if (concurrentAtEnd) this.markSharingEpisodeStarted(baseline.capturedAt);\n shared = shared || concurrentAtEnd\n || (await this.codingRunWriteRegister.list()).some((record) => record.concurrent === true && record.at >= baseline.capturedAt);\n // The paths in a tree only this step writes (#2240), whether or not it shared the window: they are its claims when\n // shared, and, shared or not, a file there that was already dirty is still the step's own output (#3233).\n const stepOwnedPaths = claimGenerationStepOwnedPaths(changeSet.files.map((file) => file.path), input.ownedPathPrefixes ?? []);\n if (shared) claimedPaths = stepOwnedPaths;\n await this.codingRunWriteRegister.record({ taskId: input.taskId, taskRef: input.taskRef, changeSet, stepOwnedPaths, ...(shared ? { claimedPaths } : {}) });\n } catch (error) {\n this.logger.warn('Could not register a generation step\\'s writes; no checkpoint names it until it runs again', {\n taskId: input.taskId, taskRef: input.taskRef, error: describeCaughtError(error),\n });\n await boundWindow();\n return result;\n }\n // The step's writes, and whatever the tree holds besides, are committed by a checkpoint now (#3204), inside the lock this window holds.\n await this.requestBuildCheckpoint({ force: true, settlingTaskIds: [input.taskId], takeLock: false });\n return result;\n },\n { retries: { retries: 0 } },\n ).catch((error: unknown) => { throw this.mapLockError(error); });\n }\n\n /**\n * Run the engine-driven half of a coding run and deal with the two ways it can go wrong.\n *\n * `drive` is `completeActorExecution` or `resumeActorExecution`; `capture` hands this method the\n * executor's result, because the driver answers it only when the settle ALSO succeeded — and the\n * case that needs the result most is the one where it did not.\n *\n * - The executor returned and the SETTLE failed: not retried. The agent may already have changed\n * files and re-execution would duplicate an unclassified effect. The row is deliberately left\n * for the startup reconcile, and the trace records why it is not terminal.\n * - The executor THREW: the driver already settled `FAILED` with the message. Nothing to add\n * except a log line — the executor classifies its own failures, so a throw is a defect in it.\n */\n private async superviseCodingRun(\n taskRef: string,\n taskId: string,\n trace: CodingRunTrace,\n drive: (capture: (result: CodingRunResult) => CodingRunResult) => Promise<unknown>,\n ): Promise<void> {\n let result: CodingRunResult | null = null;\n try {\n await drive((returned) => { result = returned; return returned; });\n } catch (error) {\n this.markRunRowsChanged();\n const returned = result as CodingRunResult | null;\n if (returned === null) {\n // Two ways to get here with no result: the executor threw (the engine settled the run\n // FAILED with the message), or the engine refused to START it — a resume of an execution\n // that is no longer waiting. Neither leaves anything for this method to record. The two\n // refusals a person's late or concurrent answer meets are routine 409s, not errors (#1581, R10-2).\n const routineRefusal = isActorExecutionNotSuspendedError(error) || isActorExecutionSubjectBusyError(error);\n (routineRefusal ? this.logger.info.bind(this.logger) : this.logger.error.bind(this.logger))(\n routineRefusal ? 'Application coding run was not started or resumed: the driver refused it' : 'Application coding run ended without a result',\n { taskId, taskRef, error: describeCaughtError(error) },\n );\n return;\n }\n this.logger.error('Failed to persist application coding-task result', { taskId, taskRef, error: describeCaughtError(error) });\n await trace.traceBestEffort('record-terminal-patch-failure', () => this.traceOperationFailure({\n sessionContext: trace.runSession,\n step: trace.runStep,\n type: 'application-coding-task-terminal-patch-failure',\n summary: `Failed to persist the result of application coding task ${taskRef}`,\n error,\n payload: returned.output,\n }));\n return;\n }\n // The engine has settled the run's row: a read of the completed runs taken before this no longer holds (#3204).\n this.markRunRowsChanged();\n await (result as CodingRunResult | null)?.afterSettle();\n }\n\n /** Move the generation the shared read of the run rows is held under, without announcing to the boards (#3204). */\n private markRunRowsChanged(): void {\n this.runStateGeneration = (this.runStateGeneration ?? 0) + 1;\n }\n\n /**\n * Executes the normal Agent invocation and lands the full working-result\n * evidence. This method runs inside the worktree lock and therefore is the\n * sole typed path allowed to observe its own before/after Git boundary.\n */\n private async executeApplicationCodingTask(\n task: MetaWorkflow_ApplicationCodingTaskContract,\n renderedPrompt: string,\n verificationPlans: readonly ApplicationCodingTaskVerificationPlan[],\n opened: OpenedActorExecution,\n baseline: GitWorktreeSnapshot,\n trace: CodingRunTrace,\n /**\n * Present when this run ANSWERS a parked question rather than starting the\n * task: the agent session is resumed by id via `session/load` and the answer\n * is delivered as the next turn. The task's mutation scope, verification plan\n * and original baseline are unchanged — the resume is held to exactly the\n * bounds the first run was.\n */\n resume?: { readonly continuationOfSessionId: string; readonly answerPrompt: string; readonly priorLegsUsage?: CodingAgent_Usage },\n ): Promise<CodingRunResult> {\n const { runSession, runStep, traceabilityErrors, traceBestEffort } = trace;\n // The TASK id is this lane's handle — the live stream, the answer door and the board row all\n // key on it. The execution is the engine's; it is reached from the task.\n const taskId = opened.taskId;\n const traceContext: AgentTraceContext = {\n label: `application-coding-task:${task.taskRef}`,\n attributes: {\n taskId,\n taskRef: task.taskRef,\n objectiveRef: task.objectiveRef,\n candidateRef: task.candidateRef,\n },\n };\n\n\n const startedAtMs = Date.now();\n /*\n * Which of this task's checks were ALREADY failing before the agent ran?\n *\n * Verification decides the disposition, and it used to ask \"is any check red now?\" — a question\n * about the TREE, answered as though it were about the RUN. A check that was red before the\n * agent started says nothing about the agent, and failing the task on it burns the whole run.\n *\n * Measured on the first end-to-end journey run (#1273): `check:technical-doc-typecheck` was red\n * before anything was dispatched, because `technical-doc/src/generated/consumer-documentation/`\n * has never been produced in that application. `build-task-docs-find-context` ran for fifteen\n * minutes, established its findings, wrote its report — and was recorded\n * `VERIFICATION_FAILED` on a red it did not cause, at $19.33. Every documentation task names\n * that check, so every one of them would have failed the same way, forever, for the same money.\n * That is the unbounded-cost shape `findCompletedRunForBuildTask` exists to close, reached\n * through the one door it cannot see: a run that FAILS is not a completed run, so it is\n * re-offered on the next dispatch.\n *\n * The baseline is the tree as this run found it, so it is the honest reference for \"did THIS run\n * break it\". Costs one extra pass of the same checks — tens of seconds against a run measured in\n * quarter-hours and tens of dollars.\n *\n * A check that THREW at baseline is excluded: it produced no verdict, so it cannot license\n * forgiving the same check afterwards. See `unrunCheckRefs`.\n *\n * The cost, accepted (#3258): a foreign fault that reads possibly-stale and persists is not carried, so each task touching\n * the specifications spends up to five paid runs (two forgiven as the host's, three attributed) and retires until\n * `wildo build rearm`. Carrying it would land work no check asked about, and the same reading is what a real break\n * that only looks like a missing import gets. Runs are bounded; an unverified landing is not.\n */\n const baselineVerification = await this.executeVerificationPlans(verificationPlans);\n const unrunAtBaseline = new Set(baselineVerification.unrunCheckRefs);\n /*\n * A check's command already absent at the baseline (#3423 review F4): hold now, before this run's agent turn, so the\n * siblings a parallel wave admits while it works are refused at no cost. This run itself goes on and pays its turn:\n * declining a run already opened here would need its own settlement, and `wildo creation preflight` refuses a run\n * with no `wildo` on PATH, so the case is rare.\n */\n const baselineUnavailableTool = baselineVerification.unavailableVerificationTools[0];\n if (baselineUnavailableTool !== undefined) this.holdForUnavailableVerificationTool(baselineUnavailableTool, task.taskRef, taskId);\n const preexistingVerificationFailures = new Map(baselineVerification.verification\n .filter(({ checkRef, outcome }) => !outcome.success && !unrunAtBaseline.has(checkRef))\n .map(({ checkRef, outcome }) => [checkRef, outcome.failureFindings] as const));\n let runError: unknown = null;\n // When the agent's refusal reached the host: a usage limit's reset is read against THIS instant (#2388 review F2).\n let runErrorAt: Date | null = null;\n let agentOutput = '';\n let codingUsage: CodingAgent_Usage | undefined;\n let codingDeniedPermissionCount: number | undefined;\n let codingPermissionDecisions: CodingAgent_RunTaskOutput['permissionDecisions'];\n let codingReportedFileLocations: CodingAgent_RunTaskOutput['reportedFileLocations'];\n let agentStopReason: CodingAgent_StopReason | undefined;\n /*\n * Counted in full, RETAINED in part.\n *\n * The previous shape pushed every notification into an unbounded array and\n * then persisted only its length — so a 30-minute run grew memory the\n * process never read, and the tool-call and diff frames (the reason to\n * observe a session at all) were collected and discarded. Now the count is a\n * counter, and only the frames a reader would actually open are retained, up\n * to a fixed ceiling.\n */\n let codingSessionEventCount = 0;\n let lastAgentWorkFrameAtMs: number | undefined;\n // What the row keeps of the session, and why it is not \"the first N frames\": see the model.\n const codingSessionRetention = new CodingSessionFrameRetention();\n /** The kind of each tool call this session opened, for `writtenLocationsOfSessionEvent` (#3205 outcome 4). */\n const sessionToolCallKinds = new Map<string, string>();\n await traceBestEffort('record-start', () => this.traceOperationStart({\n sessionContext: runSession,\n step: runStep,\n type: 'application-coding-task-run-start',\n summary: `Run application coding task ${task.taskRef}`,\n payload: this.buildApplicationCodingTaskTraceSummary(task),\n artifactFileName: 'application-coding-task-input.txt',\n artifactContent: renderedPrompt,\n }));\n try {\n // Resume the agent recorded on the durable task. The host selector may\n // have changed since admission; it must not reroute an existing session.\n // The coding system declares one actor per binding under the binding's\n // own ref, so the actor the run was opened for IS the agent to invoke.\n const agentRef = opened.actorRef;\n if (typeof agentRef !== 'string' || !isApplicationCodingAgentRef(agentRef)) {\n throw this.buildDispatchConflictError('The coding task does not identify a declared application coding agent.');\n }\n const invocation: FlowsActors_Agent_Invocation<\n typeof CodingAgent_RunTaskInputSchema,\n typeof CodingAgent_RunTaskOutputSchema,\n typeof CodingAgent_OperationContext_BaseSchema\n > = {\n agentRef,\n initiator: {},\n invocationContext: [],\n // A resume delivers the operator's ANSWER as the turn and re-enters the\n // parked session; a first run delivers the rendered task.\n input: resume\n ? { prompt: resume.answerPrompt, continuationOfSessionId: resume.continuationOfSessionId }\n : { prompt: renderedPrompt },\n output: { finalMessage: '', stopReason: CodingAgent_StopReason.END_TURN },\n executionContext: { callTimestamp: new Date().toISOString() },\n artifactBindings: [],\n };\n const response = await this.agentsService.invokeAgent(\n invocation,\n traceContext,\n {\n workspaceRootPath: this.companionContext.saasRoot,\n // Hold the agent to the task's declared scope WHILE it runs, not only\n // in the change set afterwards. The post-hoc assessment stays — it is\n // the authoritative record, because an agent can write a file it never\n // asked permission for — but a refusal in the moment is the only one\n // that prevents the write rather than reporting it.\n // assurance-control: WILDO.SOFTWARE.AI_PRODUCED_CHANGE_CONTROL — the declared edits of an agent that asks before writing are held to its task's write scope while it runs; an agent that never asks, and a shell command, are held by nothing in flight.\n isPermittedCodingLocation: buildApplicationCodingTaskLocationPredicate(\n this.companionContext.saasRoot,\n task.mutationScope.allowedPathPrefixes,\n task.mutationScope.prohibitedPathPrefixes,\n ),\n onCodingSessionEvent: (event) => {\n codingSessionEventCount += 1;\n // When the agent last WORKED (#3236): what tells a turn silent through a network loss from one working through it.\n // Bookkeeping frames are not work: the pinned adapter sends a `usage_update` while settling a cancelled turn.\n if (isCodingAgentWorkFrame(event.kind)) lastAgentWorkFrameAtMs = Date.now();\n codingSessionRetention.accept(event);\n /*\n * A CONCURRENT run's claims, kept on disk as they happen (#3205 outcome 4), so a companion that dies mid-run\n * leaves its recovery the evidence of what this run wrote. Best effort: losing one append costs a claim,\n * never the run.\n */\n if (this.activeRuns.get(taskId)?.mode === CodingRunConcurrency.CONCURRENT) {\n const written = writtenLocationsOfSessionEvent(event, sessionToolCallKinds);\n if (written.length > 0) {\n void (async () => {\n try {\n await this.codingRunWriteRegister.recordInFlightClaims(taskId, written);\n } catch (error) {\n this.logDebug('Could not keep a live run\\'s claims on disk; a restart would lose them', { taskId, error: describeCaughtError(error) });\n }\n })();\n }\n }\n this.publishCodingSessionFrame(taskId, { channel: 'event', payload: event });\n },\n // The JUDGMENT half of the interactive lane: classify each end-of-turn\n // message so the engine ladder can auto-continue a self-pause and park\n // a genuine question. The engine fails OPEN if this throws, so a\n // classifier fault degrades to \"the turn is complete\" rather than\n // hanging the run — this method may therefore throw freely.\n classifyCodingTurnEnd: (input) => this.classifyCodingTurnEnd(input),\n onCodingSessionStateChange: (state) => {\n this.publishCodingSessionFrame(taskId, { channel: 'state', payload: state });\n },\n ...(this.activeRuns.get(taskId) ? { codingSessionAbortSignal: this.activeRuns.get(taskId)!.abortController.signal } : {}),\n },\n );\n const codingOutput = response.output as Partial<CodingAgent_RunTaskOutput> | undefined;\n // The agent runtime publishes provider-learned facts on `executionContext`.\n // A resume's leg reports its own tokens and the session's cumulative cost: the run is every leg together (#2232).\n codingUsage = mergeResumedLegUsage(resume?.priorLegsUsage, (response.executionContext as { usage?: CodingAgent_Usage } | undefined)?.usage);\n codingDeniedPermissionCount = codingOutput?.deniedPermissionCount;\n codingPermissionDecisions = codingOutput?.permissionDecisions;\n codingReportedFileLocations = codingOutput?.reportedFileLocations;\n const text = codingOutput?.finalMessage;\n agentStopReason = codingOutput?.stopReason;\n // A PARKED run stopped WITHOUT finishing to ask the operator a question.\n // Its `finalMessage` is the question and its partial edits are NOT a final\n // change set — so it must skip assessment, verification and the\n // terminal disposition entirely, and instead record an answerable,\n // non-terminal state. Handled here, before the CANCELLED/empty checks,\n // because a question is a non-empty END_TURN message that would otherwise\n // read as a completed working result.\n if (codingOutput?.suspension) {\n return this.buildParkedCodingRunResult({\n task,\n taskId,\n baseline,\n suspension: codingOutput.suspension,\n output: codingOutput,\n usage: codingUsage,\n codingSessionEventCount,\n retainedCodingSessionFrames: codingSessionRetention.frames(),\n codingSessionRetention: codingSessionRetention.summary(),\n startedAtMs,\n runSession,\n runStep,\n traceBestEffort,\n });\n }\n // A CANCELLED turn is not a completed one, and its partial change set must\n // not be read as a working result. Refused here rather than downstream so\n // the disposition names the actual reason.\n if (agentStopReason === CodingAgent_StopReason.CANCELLED) {\n throw new Error('Application coding Agent turn was cancelled before it completed.');\n }\n if (typeof text !== 'string' || text.trim().length === 0) {\n throw new Error('Application coding Agent returned no final message.');\n }\n agentOutput = text;\n } catch (error) {\n runError = error;\n runErrorAt = new Date();\n }\n /*\n * Whether an operator took this turn away, read the moment the turn ENDED (#1581, seventh review F8):\n * a wave cancel landing later, while the change set is captured, did not end a turn that had already\n * failed on its own — a timed-out turn is the task's.\n */\n const turnCancelledByOperator = this.activeRuns.get(taskId)?.abortController.signal.aborted === true;\n\n let changeSet: GitChangeSetCapture | null = null;\n let captureError: unknown = null;\n try {\n changeSet = await this.gitChangeSetService.captureChangeSet(baseline);\n } catch (error) {\n captureError = error;\n }\n /*\n * The register the workbench's `accept` commits from (#1454, Step 7): every path, attributed and\n * hashed, unbounded where the durable row's summary is bounded. Best effort — a register that\n * could not be written costs the ability to accept THIS run from the workbench, never the run.\n */\n if (changeSet) {\n try {\n // A run that shared the tree (#1528) records what it has evidence of writing: its capture also holds its siblings' files.\n const claimedPaths = this.activeRuns.get(taskId)?.mode === CodingRunConcurrency.CONCURRENT\n ? collectRunClaimedPaths({\n candidateRoots: applicationRootSpellings(this.companionContext.saasRoot),\n reportedFileLocations: codingReportedFileLocations,\n permissionDecisions: codingPermissionDecisions,\n })\n : undefined;\n await this.codingRunWriteRegister.record({ taskId, taskRef: task.taskRef, changeSet, ...(claimedPaths !== undefined ? { claimedPaths } : {}) });\n } catch (error) {\n this.logDebug('Could not record the coding run\\'s writes; accepting it from the workbench will refuse', { taskId, error: describeCaughtError(error) });\n }\n }\n /*\n * The run concluded: its in-flight claims existed only for a restart (#3205 outcome 4), and are dropped on every path,\n * a failed capture or record included (re-review F7), or a stale file would read as a live run's claims forever.\n */\n try {\n await this.codingRunWriteRegister.clearInFlightClaims(taskId);\n } catch (error) {\n // Best effort, like the record: dropping a stale claims file must never cost the run.\n this.logDebug('Could not drop a concluded run\\'s in-flight claims', { taskId, error: describeCaughtError(error) });\n }\n\n const scopeAssessment = changeSet\n ? assessApplicationCodingTaskMutationScope(changeSet, task.mutationScope.allowedPathPrefixes, task.mutationScope.prohibitedPathPrefixes)\n : null;\n /*\n * Did Wildo's IN-FLIGHT guards actually run for this agent?\n *\n * The permission ceiling and the task mutation scope are both enforced in\n * the client's answer to `session/request_permission`, and the scope half is\n * enforced against the `locations` that request DECLARES. So there are TWO\n * ways a run reaches the end with the mutation scope never consulted, and\n * until 2026-09-09 only the first was reported:\n *\n * 1. NO REQUEST AT ALL — the agent writes without asking. Codex's design\n * (its safety model is a sandbox) and OpenCode's default. Nothing is\n * answered, so nothing is checked.\n *\n * 2. REQUESTS RAISED, NONE CARRYING A LOCATION — the agent asks, the\n * client answers, and the scope predicate has nothing to check the\n * answer against, because `locations.some(...)` over an empty array is\n * vacuously satisfied. Under an UNRESTRICTED ceiling this is EVERY\n * shell command: `execute` is admitted by the ceiling, and a shell\n * command declares no locations because its effect is not derivable\n * from the command string. A run can therefore write outside its\n * declared scope through a shell command with a full, well-formed\n * permission-decision record showing it was allowed.\n *\n * Shape 2 is not a hole to be closed by deriving locations from a command —\n * a shell command is UNSCOPED BY NATURE, and parsing one to guess its writes\n * would be an invented, defeatable answer (`sh -c \"$CMD\"`, a redirect\n * through a substituted path). The honest treatment is to say so.\n *\n * Both shapes are ADMISSIBLE by decision (2026-09-06/09): a different agent\n * architecture is not a reason to refuse a tool, the dogfood lane authors\n * UNRESTRICTED deliberately, and the framework's directive is that\n * restrictions arrive as judge-style guards rather than refusals wired into\n * the mechanism. What is NOT acceptable is the consequence going unrecorded\n * while the configuration reads as though a gate were in place.\n *\n * Keyed on the run's OWN evidence rather than on a provider declaration: an\n * agent that changes behaviour between versions cannot silently keep an\n * old, reassuring claim. (The provider's declaration is used too, at\n * DISPATCH, where it refuses a ceiling narrower than UNRESTRICTED against an\n * agent that cannot honour one — a claim before the run and evidence after\n * it, which are different jobs.)\n */\n const raisedNoPermissionRequest = (codingPermissionDecisions?.length ?? 0) === 0;\n // An ALLOWED decision that declared no path: the ceiling admitted the act and\n // the scope predicate was handed nothing to judge it by.\n const allowedActsWithNoDeclaredLocation = (codingPermissionDecisions ?? []).filter(\n (decision) => decision.allowed && decision.locations.length === 0,\n ).length;\n const mutationScopeWentUnconsulted = raisedNoPermissionRequest || allowedActsWithNoDeclaredLocation > 0;\n const mutatedFileCount = changeSet?.files.length ?? 0;\n if (!runError && mutationScopeWentUnconsulted && mutatedFileCount > 0) {\n // Best-effort and FEATURE-DETECTED, the same posture the audit emits take:\n // this observes a run, and an observation that can fail the run it\n // observes is worse than no observation. A partially-bound logger must not\n // turn a completed coding task into an error — measured the hard way, when\n // a `warn` the test double did not implement hung fifteen runs.\n this.logger.warn?.(\n (raisedNoPermissionRequest\n ? 'Coding run mutated the workspace without raising a single permission request — '\n + \"Wildo's permission ceiling and task mutation scope were NOT enforced in flight for this agent. \"\n : `Coding run mutated the workspace after ${allowedActsWithNoDeclaredLocation} permitted act(s) that `\n + 'declared no file location — typically shell commands, which are unscoped by nature — so the task '\n + 'mutation scope had nothing to check those acts against and was NOT enforced in flight for them. ')\n + 'The change set taken after the run is the only record of what it touched'\n + (scopeAssessment && scopeAssessment.outOfScopePaths.length > 0\n ? `, and it recorded ${scopeAssessment.outOfScopePaths.length} changed path(s) outside the task's declared scope `\n + '(this run\\'s or a parallel session\\'s — the change set cannot tell which).'\n : '.'),\n {\n taskRef: task.taskRef,\n objectiveRef: task.objectiveRef,\n mutationScopeRef: task.mutationScope.scopeRef,\n mutatedFileCount,\n outOfScopePathCount: scopeAssessment?.outOfScopePaths.length ?? null,\n raisedNoPermissionRequest,\n allowedActsWithNoDeclaredLocation,\n inFlightMutationScopeConsulted: false,\n },\n );\n }\n\n // Verification is deliberately sequential. Each check has a fixed\n // semantic meaning, but several checks can still contend for the same\n // application package/cache if started together. The ordered outcomes are\n // easier to inspect and avoid turning a bounded coding task into an\n // accidental local-build fan-out.\n // Out-of-scope paths never skip verification: they are recorded, not refused.\n const shouldVerify = !runError && !captureError;\n /*\n * The checks read the application's COMPILED packages, so they wait (bounded) for the watchers to publish what the run\n * just wrote, as a playbook child's read does (#3212). Without it a check met `shared-lib/dist` or `backend-api/dist`\n * older than the run's own edits and refused (\"Cannot check the resources registry: … dist is older than its sources\"),\n * a refusal attributed to the host that, repeated, retires the task: on reference run 42713670241 two follow-up tasks\n * spent their whole attempt budget on it (#3204). Bounded and proceeding on timeout: the check that follows is the judge,\n * and a FAILED compile is not waited on, since waiting does not clear it.\n */\n if (shouldVerify) {\n const published = await waitForApplicationPackagesPublished({\n saasRoot: this.companionContext.saasRoot,\n onWait: (unpublished) => this.logDebug('Waiting for application packages to publish the run\\'s edits before verifying', {\n taskRef: task.taskRef,\n unpublished,\n }),\n });\n if (!published.published) {\n this.logger.warn('Verifying a coding run before every application package published its edits', {\n taskRef: task.taskRef,\n waitedMs: published.waitedMs,\n unpublished: published.unpublished,\n });\n }\n }\n const { verification, infrastructureError: verificationInfrastructureError, unrunCheckRefs, unavailableVerificationTools } = shouldVerify\n ? await this.executeVerificationPlans(verificationPlans)\n : {\n verification: [] as Array<{ checkRef: string; outcome: VerificationOutcome }>,\n infrastructureError: null as unknown,\n unrunCheckRefs: [] as readonly string[],\n unavailableVerificationTools: [] as readonly UnavailableVerificationTool[],\n };\n /*\n * Only a check this run BROKE fails the task. One that was already red is recorded and reported,\n * never attributed — see `preexistingVerificationFailures` above for what it cost when it was.\n *\n * The recording half is not decoration: a check red for every task is a project-level defect\n * that nothing else would surface, and forgiving it silently would replace a loud wrong answer\n * with a quiet one.\n */\n const carriedVerification = verification\n .filter(({ checkRef, outcome }) => !outcome.success && verificationFailureIsCarried(preexistingVerificationFailures, checkRef, outcome.failureFindings));\n const carriedVerificationFailures = carriedVerification.map(({ checkRef }) => checkRef);\n /*\n * And WHY it is red, captured while the output is in hand (#1529): the files the check names and\n * what generated them. A red nobody diagnoses is re-diagnosed by hand — on the first end-to-end run\n * that took an hour, for a fact the broken file's own banner stated.\n */\n const carriedVerificationDiagnoses = carriedVerification.map(({ checkRef, outcome }) => diagnoseCarriedVerificationFailure({\n checkRef,\n checkPath: outcome.path,\n message: outcome.message,\n stdoutTail: outcome.stdoutTail,\n stderrTail: outcome.stderrTail,\n readHead: (relativePath) => {\n try {\n return readFileSync(join(this.companionContext.saasRoot, relativePath), 'utf8').slice(0, 8_000);\n } catch {\n return undefined;\n }\n },\n }));\n const failedVerifications = verification.filter(({ checkRef, outcome }) => !outcome.success && !verificationFailureIsCarried(preexistingVerificationFailures, checkRef, outcome.failureFindings));\n const failedVerification = failedVerifications[0] ?? null;\n /*\n * Every check this run failed on could not ASK (#3258): a failed module that may be a stale build, a compiled tree\n * behind its source. The run still fails, because nothing proved its work, but no check judged the work, so the\n * failure is the host's, whose forgiveness is bounded: a typo that only LOOKS like a missing import costs a few\n * retries, then counts against the task.\n */\n const verificationCouldNotAsk = failedVerifications.length > 0 && failedVerifications.every(({ checkRef }) => unrunCheckRefs.includes(checkRef));\n\n if (agentOutput) {\n await traceBestEffort('write-agent-output', () =>\n this.traceOperationArtifact(runSession, runStep, 'application-coding-task-agent-output.txt', agentOutput));\n }\n if (changeSet?.fullDiffText) {\n await traceBestEffort('write-change-set', () =>\n this.traceOperationArtifact(runSession, runStep, 'application-coding-task-change-set.diff', changeSet.fullDiffText));\n }\n\n /*\n * A run started past a landing the operator called wrong exists to CHANGE something (#2409). One that wrote no file\n * of its own — files attributed to another writer (dirty at baseline, a parallel session) are not its work — has\n * repaired nothing, whatever its checks say: they passed before it ran too. Only with a captured change set: a\n * capture that failed is its own disposition, and \"no files\" cannot be read from it.\n */\n const landedOverride = readGivenLandedOverride(task);\n const overrideChangedNothing = landedOverride !== undefined && changeSet !== null\n && codingRunChangedNoFileOfItsOwn(changeSet.files, isAttributedToAnotherWriter);\n const disposition = deriveApplicationCodingTaskDisposition({\n agentFailed: Boolean(runError),\n changeSetCaptureFailed: Boolean(captureError),\n verificationFailed: failedVerification !== null,\n overrideChangedNothing,\n traceabilityFailed: traceabilityErrors.length > 0,\n });\n const succeeded = disposition === ApplicationCodingTaskDisposition.WORKING_RESULT_RECORDED;\n /*\n * Whose failure this was (#1581). An agent failure is the HOST's only when the turn was TAKEN\n * AWAY: an operator cancelled it (this run's own abort signal), or the measured classifiers name\n * the environment (a mid-turn kill, a 529/429, a lost network) or the account (quota, expired\n * login). A timed-out turn also ends `cancelled`, and it is the task's — it needed more than a turn.\n */\n const runErrorMessage = runError ? describeCaughtError(runError) : '';\n const cancelledWithoutOperator = agentStopReason === CodingAgent_StopReason.CANCELLED && !turnCancelledByOperator;\n const agentPassages = readAgentPassageTexts(codingSessionRetention.frames());\n // What the turn ITSELF says about the network (its rejection, its own API-error report): a fresh loss, which holds.\n const reportedNetworkFailure = runError ? readCodingRunNetworkReport({ runErrorMessage, agentPassages }) : undefined;\n const agentBinding = Object.values(APPLICATION_CODING_AGENT_BINDINGS).find((binding) => binding.ref === opened.actorRef);\n /*\n * BEFORE the attribution, and deciding nothing itself: a probe here keeps the loss record true (a hold ends on a\n * reachable API; an unreachable one records the loss nobody reported, re-review of 8038824b4 F2).\n */\n if (runError && cancelledWithoutOperator && reportedNetworkFailure === undefined) await this.probeConnectivityAtCancelledSettlement(agentBinding, task.taskRef, taskId);\n const networkFailureKind = runError\n ? deriveCodingRunNetworkFailure({\n runErrorMessage,\n cancelledWithoutOperator,\n agentPassages,\n // The turn's own timeline decides a cancelled turn: in flight at a loss, no WORK frame after it, settled while it held or just after.\n connectivityLosses: this.connectivityLosses ?? [],\n turnStartedAtMs: startedAtMs,\n lastAgentWorkFrameAtMs,\n settledAtMs: Date.now(),\n })\n : undefined;\n const agentTurnTakenByHost = turnCancelledByOperator\n || isInfrastructureShapedAgentFailure(runErrorMessage)\n || isProviderAccountAgentFailure(runErrorMessage)\n || networkFailureKind !== undefined;\n const failureAttribution = deriveCodingRunFailureAttribution({ disposition, agentTurnTakenByHost, verificationCouldNotAsk });\n /*\n * The turn REPORTED a network loss (#3236): no other turn is admitted until the agent's API answers again. A turn\n * charged to the network only by its timeline spanned a loss already recorded (by a report or a failed probe, at\n * admission, at a settlement or in the background), and holds nothing new.\n */\n if (reportedNetworkFailure !== undefined) {\n this.holdForCodingAgentConnectivityLoss(reportedNetworkFailure, runErrorMessage, task.taskRef, taskId, agentBinding);\n }\n else if (succeeded && this.codingAgentConnectivityHold && startedAtMs > Date.parse(this.codingAgentConnectivityHold.observedAt)) {\n // A turn STARTED after the loss completed, so the network is back (the same proof the usage-limit hold takes, #2388 review F4).\n this.releaseCodingAgentConnectivityHold(this.codingAgentConnectivityHold, `${task.taskRef}, started after the loss, completed`);\n }\n /*\n * The account's usage limit, with the instant it ends (#2388). Recorded on the row, so the attempt budget\n * counts nothing for it and the feed can say when the lane resumes; held here, so the wave starts no\n * other turn into the same window. A success is proof the window is over — but only a run STARTED after\n * the limit was met: a sibling that began earlier may have finished its agent turn before the limit and\n * be settling only now, after minutes of checks (#2388 review F4).\n */\n const codingAgentUsageLimit = runError ? readCodingAgentUsageLimit(runErrorMessage, runErrorAt ?? new Date()) : null;\n if (codingAgentUsageLimit) this.holdForCodingAgentUsageLimit(codingAgentUsageLimit, task.taskRef, taskId);\n else if (succeeded) this.releaseCodingAgentUsageLimitHoldAfterSuccess(startedAtMs);\n /*\n * A check whose command could not be executed (#3423) fails every task's check the same way, so no other turn is\n * admitted until the command is on PATH again; the next admission looks it up first. A run that ASKED the held check\n * proves the command is back.\n */\n const unavailableVerificationTool = unavailableVerificationTools[0];\n if (unavailableVerificationTool !== undefined) this.holdForUnavailableVerificationTool(unavailableVerificationTool, task.taskRef, taskId);\n else this.releaseVerificationToolHoldIfAsked(verification.map(({ checkRef }) => checkRef).filter((checkRef) => !unrunCheckRefs.includes(checkRef)), task.taskRef);\n // Which runs shared the tree with this one, and where they both wrote (#1528). Absent for a run alone.\n const concurrency = this.closeCodingRunWindow(taskId, (changeSet?.files ?? []).map((entry) => entry.path));\n /*\n * A check this run could not ask for the host's reasons, other than its command (#3432): counted only when the run was\n * ALONE, so a sibling's red compile is never read as the host's. The same cause on a second task holds admissions.\n */\n if (concurrency === null && unavailableVerificationTool === undefined) {\n this.observeHostCheckFailures(verification\n .filter(({ checkRef }) => unrunCheckRefs.includes(checkRef))\n .map(({ checkRef, outcome }) => ({ checkRef, message: outcome.message })), task.taskRef, taskId);\n }\n // No change set (the executor threw, the capture failed): stamp HEAD now, so the run's window is bounded (#3224 F2).\n const settledHead = changeSet ? undefined : await this.readSettledHeadStamp();\n const output = {\n ...settledHead,\n succeeded,\n disposition,\n ...(failureAttribution !== null ? { failureAttribution } : {}),\n // Which network condition took the turn (#3236), so a reader tells DNS from a reset without the error text.\n ...(networkFailureKind !== undefined ? { networkFailureKind } : {}),\n ...(codingAgentUsageLimit ? { codingAgentUsageLimit } : {}),\n ...(concurrency ? {\n concurrency,\n /*\n * A failure while other runs were editing the same tree MAY be theirs — only when the tree could\n * have caused it (#2389, `deriveInterferenceSuspected`). Suspected, never proven: the attempt budget\n * forgives a bounded number of these (`selectBudgetCountingFailures`).\n */\n ...(deriveInterferenceSuspected({ disposition, failureAttribution, concurrency }) ? { interferenceSuspected: true } : {}),\n } : {}),\n durationMs: Date.now() - startedAtMs,\n agentOutputTail: agentOutput.slice(-OUTPUT_TAIL_CHARS),\n /*\n * What the agent says it could NOT meet (#2496), read from its closing report's typed block over the WHOLE message,\n * not the tail. Recorded whatever the disposition: the build plan derives a follow-up task from a completed run's,\n * and a person reading any run sees what its agent left unmet. A block that does not parse is recorded as such.\n */\n ...(() => {\n const unmet = parseClosingReportUnmetRequirements(agentOutput);\n // And what it states IS met (#3227), the positive statement that alone may close a gap another run reported.\n const met = parseClosingReportMetRequirements(agentOutput);\n return {\n ...(unmet.reported.length > 0 ? { unmetRequirements: unmet.reported } : {}),\n ...(unmet.malformed !== undefined ? { unmetRequirementsMalformed: unmet.malformed } : {}),\n ...(met.met.length > 0 ? { metRequirements: met.met } : {}),\n ...(met.malformed !== undefined ? { metRequirementsMalformed: met.malformed } : {}),\n };\n })(),\n // Recorded on the durable row because it is the difference between \"the\n // agent finished\" and \"the agent stopped\": a turn that ended on\n // `max_tokens` or `refusal` leaves a partial change set that looks exactly\n // like a complete one from the diff alone.\n ...(agentStopReason ? { agentStopReason } : {}),\n ...(codingSessionEventCount > 0 ? { codingSessionEventCount } : {}),\n // Red before this run started, and still red. Not this task's failure, and not nobody's.\n ...(carriedVerificationFailures.length > 0 ? { carriedVerificationFailures, carriedVerificationDiagnoses } : {}),\n ...(codingSessionRetention.frames().length > 0\n ? { codingSessionFrames: codingSessionRetention.frames(), codingSessionRetention: codingSessionRetention.summary() }\n : {}),\n // #2: the run's real cost, recorded on the durable row.\n //\n // This is what the previous transport structurally could not report, and\n // it was captured by the runner and dropped here — so the budget still saw\n // nothing. `usage` is optional in every field by contract, so absence is\n // preserved as absence rather than written as zero.\n ...(codingUsage ? { usage: codingUsage } : {}),\n ...(codingDeniedPermissionCount !== undefined\n ? { deniedPermissionCount: codingDeniedPermissionCount }\n : {}),\n // WHY each permission was decided, beside how many were refused. A refusal an operator\n // cannot explain is a refusal they cannot act on — see the field's contract.\n ...(codingPermissionDecisions && codingPermissionDecisions.length > 0\n ? { permissionDecisions: codingPermissionDecisions }\n : {}),\n ...(runError ? { error: buildOutputErrorPayload(runError) } : {}),\n ...(disposition === ApplicationCodingTaskDisposition.OVERRIDE_NOT_REPAIRED && landedOverride ? {\n overrideNotRepaired: {\n // The agent's own account travels with the verdict (#2409 review F12): the operator weighs it, nothing else does.\n message: `Run past a wrong landing (${landedOverride.reason}: ${landedOverride.note}) changed no file, so the defect is not repaired. `\n + `The agent said: \"${agentOutput.trim().slice(-OVERRIDE_NOT_REPAIRED_AGENT_SAY_CHARS) || 'nothing'}\". `\n + 'Fix the cause, or run it again with a note the agent can act on.',\n },\n } : {}),\n ...(captureError ? { changeSetCaptureError: buildOutputErrorPayload(captureError) } : {}),\n ...(verificationInfrastructureError ? { verificationInfrastructureError: buildOutputErrorPayload(verificationInfrastructureError) } : {}),\n ...(traceabilityErrors.length > 0 ? { traceabilityErrors: traceabilityErrors.map(buildOutputErrorPayload) } : {}),\n ...(scopeAssessment ? { scopeAssessment } : {}),\n verification,\n ...(changeSet ? {\n changeSetSummary: {\n baselineHeadSha: changeSet.baselineHeadSha,\n postRunHeadSha: changeSet.postRunHeadSha,\n headMovedDuringRun: changeSet.headMovedDuringRun,\n stats: changeSet.stats,\n /*\n * WHICH files, beside how many — asked for by the judge itself.\n *\n * On 2026-09-16, the first run whose evidence the `dispatch-outcome-sound` treatment could\n * read answered INDETERMINATE on its in-scope criterion, and said exactly why: \"the artifact\n * does not identify the changed paths or their contents. It therefore cannot show that the\n * dispatched target/stage was implemented within <the declared scope>\". That criterion asks\n * whether a schema task added a persisted shape and a ui-behavior task added field displays —\n * a question about PATHS, answered with counts.\n *\n * Path and attribution class only. The class is what lets a reader separate the run's own\n * work from a file that was already dirty at baseline or that a parallel session committed\n * inside the window — the distinction the criterion's own guidance turns on, and one the\n * counts flatten. Contents stay out: the full diff is a trace artifact, and pasting a\n * change-set into a durable row would put the repository inside its own task record.\n *\n * BOUNDED, because a durable row is not a diff: a task that touches more files than this\n * carries the first `CHANGE_SET_SUMMARY_FILE_LIMIT` and says how many it left out, which is\n * a truthful summary rather than a silently truncated one.\n */\n files: changeSet.files.slice(0, CHANGE_SET_SUMMARY_FILE_LIMIT).map((entry) => ({\n path: entry.path,\n attribution: entry.attribution,\n changeKind: entry.changeKind,\n })),\n ...(changeSet.files.length > CHANGE_SET_SUMMARY_FILE_LIMIT\n ? { filesOmittedFromSummary: changeSet.files.length - CHANGE_SET_SUMMARY_FILE_LIMIT }\n : {}),\n },\n } : { changeSetSummary: null }),\n };\n\n /*\n * The run CONCLUDED, and the engine's driver records it (#1359): the status, this output and the\n * change-set artifact land on the task in the one move that settles the execution. `FAILED` is a\n * conclusion here, not a throw — see {@link CodingRunResult}.\n */\n return {\n kind: CodingRunEnding.CONCLUDED,\n conclusion: {\n status: succeeded ? FlowsActors_Status.COMPLETED : FlowsActors_Status.FAILED,\n taskOutput: output,\n ...(changeSet ? { taskArtifacts: [buildChangeSetArtifact(taskId, changeSet)] } : {}),\n },\n output,\n afterSettle: async () => {\n /*\n * A run that ANSWERED a question and then failed would otherwise keep its resume inputs:\n * the driver leaves a FAILED run's checkpoint in place, because for most hosts re-running\n * from it is how a failure is recovered. Here it holds the admitted contract — context\n * bytes the durable row deliberately never carries — and the question it answered is gone,\n * so there is nothing to continue. A failed coding run is re-DISPATCHED, not resumed.\n */\n if (!succeeded && resume) {\n await traceBestEffort('consume-checkpoint', () => this.actorsSystem.consumeActorExecutionCheckpoint(opened.executionId, runSession));\n }\n if (succeeded) {\n await traceBestEffort('record-success', () => this.traceOperationSuccess({\n sessionContext: runSession,\n step: runStep,\n type: 'application-coding-task-run-success',\n summary: `Recorded working result for application coding task ${task.taskRef}`,\n payload: output,\n }));\n /*\n * Committed by a checkpoint, never on its own (#3204): its product already counts in the working tree. A CONCURRENT\n * run does not wait for it (review of 4a1b1f1bf F6): the checkpoint may queue behind the workspace lock a long\n * generation step holds, and this settlement holds the run's slot until it returns. A single-flight run holds\n * that lock itself, so its checkpoint commits now, inside it.\n */\n const concurrentRun = this.activeRuns.get(taskId)?.mode === CodingRunConcurrency.CONCURRENT;\n const checkpoint = this.requestBuildCheckpoint({ settlingTaskIds: [taskId], takeLock: concurrentRun });\n if (!concurrentRun) await checkpoint;\n this.announceRunCompleted({ taskRef: task.taskRef, runTaskId: taskId });\n return;\n }\n await traceBestEffort('record-failure', () => this.traceOperationFailure({\n sessionContext: runSession,\n step: runStep,\n type: 'application-coding-task-run-failure',\n summary: `Application coding task ${task.taskRef} requires follow-up`,\n error: runError ?? captureError ?? verificationInfrastructureError ?? traceabilityErrors[0] ?? new Error(`Application coding task disposition: ${disposition}`),\n payload: output,\n }));\n },\n };\n }\n\n // ================================================================\n // Interactive lane — classifier, live relay, park & resume\n // ================================================================\n\n /**\n * Classify a coding agent's end-of-turn message through the dedicated\n * structured classifier agent. Throws on any fault; the ENGINE ladder wraps\n * that into `CLASSIFIER_UNAVAILABLE` and settles, so this never has to invent\n * a safe default of its own.\n */\n private async classifyCodingTurnEnd(input: {\n readonly finalMessage: string;\n readonly turnIndex: number;\n }): Promise<CodingAgent_EndOfTurnClassification> {\n /*\n * A closing report is a finished task by the worker contract (#3204, `isClosingReport`): the agent ends its report\n * with the requirement blocks and nothing else. Decided here, without the model, because the model read a report's\n * \"still open\" note as a question and parked a finished run on a decision the blocks already carry.\n */\n if (isClosingReport(input.finalMessage)) return CodingAgent_EndOfTurnClassification.TASK_COMPLETE;\n const prompt = [\n 'A coding agent ended its turn with the message below. Classify what the message means so an '\n + 'autonomous runner can decide whether to continue automatically, or to surface a question to '\n + 'the operator.',\n '',\n '# Agent end-of-turn message',\n input.finalMessage,\n ].join('\\n');\n const invocation: FlowsActors_Agent_Invocation<any, any> = {\n agentRef: APPLICATION_CODING_TURN_CLASSIFIER_AGENT_REF,\n initiator: {},\n invocationContext: [],\n input: { prompt, schema: CodingTurnEndClassificationOutputSchema },\n output: { object: {} },\n executionContext: {},\n artifactBindings: [],\n };\n const response = await this.agentsService.invokeAgent(invocation);\n const raw = (response.output as { object?: unknown } | undefined)?.object;\n const parsed = CodingTurnEndClassificationOutputSchema.safeParse(raw);\n if (!parsed.success) {\n // A malformed classifier answer is a classifier fault: let the ladder fail\n // open rather than guess which situation the model meant.\n throw new Error('Coding turn-end classifier returned an unparseable result.');\n }\n return parsed.data.classification;\n }\n\n /** Fan one live frame out to a task's SSE subscribers. Best-effort, never throws into the run. */\n private publishCodingSessionFrame(taskId: string, frame: CodingSessionLiveFrame): void {\n const listeners = this.codingSessionSubscribers.get(taskId);\n if (!listeners) return;\n for (const listener of listeners) {\n try {\n listener(frame);\n } catch {\n // A subscriber must never be able to fail the run it observes.\n }\n }\n }\n\n /**\n * Subscribe to a task's live coding frames. Returns an unsubscribe function.\n *\n * Frames flow only while a run is ACTIVE for that task; a subscriber that\n * attaches after the run parked or finished simply receives nothing further,\n * which is why the SSE endpoint sends the current pending question up front.\n */\n public subscribeToCodingSession(taskId: string, listener: (frame: CodingSessionLiveFrame) => void): () => void {\n let listeners = this.codingSessionSubscribers.get(taskId);\n if (!listeners) {\n listeners = new Set();\n this.codingSessionSubscribers.set(taskId, listeners);\n }\n listeners.add(listener);\n return () => {\n const set = this.codingSessionSubscribers.get(taskId);\n if (!set) return;\n set.delete(listener);\n if (set.size === 0) this.codingSessionSubscribers.delete(taskId);\n };\n }\n\n /**\n * The questions currently awaiting an operator answer, for status/UX.\n *\n * Read from the ACTOR PLANE since #1359: every parked coding run is an execution of\n * `application-coding.system` that is `AWAITING_APPROVAL`, carrying the decision it waits on and\n * the checkpoint an answer continues from. Until then this read an in-process map, so a companion\n * restart emptied the list while the questions still stood — the board showed nothing to answer\n * for runs that were one answer away from continuing.\n *\n * Each carries a `decision` — the same `HumanDecision_Request` an interview and a clarification are\n * rendered from — so a reader needs no knowledge of ACP suspensions to show one. It is the decision\n * STORED on the execution when the run parked, not one rebuilt here: a second producer of a shared\n * contract would drift from the first the day an option changed.\n */\n public async listPendingCodingQuestions(sessionContext?: CompanionExecutionSessionContext): Promise<Array<{\n taskId: string; taskRef: string; question: string; parkedAt: string; resumable: boolean; decision: HumanDecision_Request;\n /** Which of the run's questions this is (`actorExecutionSuspensionRef`), opaque to a reader. An answer echoes it (#1581). */\n suspensionRef: string;\n }>> {\n return (await this.listParkedCodingRuns(sessionContext)).map((parked) => ({\n taskId: parked.taskId,\n taskRef: parked.checkpoint.taskRef,\n question: parked.checkpoint.suspension.question,\n parkedAt: parked.checkpoint.parkedAt,\n resumable: parked.checkpoint.suspension.resumable,\n decision: parked.decision,\n suspensionRef: parked.suspensionRef,\n }));\n }\n\n /**\n * Every coding run waiting on an operator, as the actor plane holds it.\n *\n * ONE system's waiting executions — not the 200 most recently updated rows of every actor, which is\n * what the task-list scans this replaced read, and why a parked coding row could fall outside the\n * window on a busy application and be reported as absent.\n *\n * A waiting row whose checkpoint does not parse is SKIPPED, never reported: it has lost the thing\n * an answer would continue, so it is not a parked run anybody can answer. The startup reconcile\n * aborts such a row for review; between restarts it is simply not offered.\n */\n private async listParkedCodingRuns(sessionContext?: CompanionExecutionSessionContext): Promise<Array<{\n executionId: string; taskId: string; checkpoint: ApplicationCodingRunCheckpoint; decision: HumanDecision_Request; suspensionRef: string;\n }>> {\n const waiting = await this.actorsSystem.listSuspendedActorExecutions(APPLICATION_CODING_SYSTEM_REF, sessionContext);\n const parked: Array<{ executionId: string; taskId: string; checkpoint: ApplicationCodingRunCheckpoint; decision: HumanDecision_Request; suspensionRef: string }> = [];\n for (const row of waiting) {\n const checkpoint = ApplicationCodingRunCheckpointSchema.safeParse(row.checkpoint?.context);\n const task = row.tasks[0];\n if (!checkpoint.success || !task || !row.suspension) continue;\n parked.push({ executionId: row._id, taskId: task._id, checkpoint: checkpoint.data, decision: row.suspension.decision, suspensionRef: actorExecutionSuspensionRef(row.suspension) });\n }\n return parked;\n }\n\n /**\n * A run that parked on a question, as the engine's driver is told to record it: the run waits on\n * its execution (`AWAITING_APPROVAL`) with the decision a person owes and the inputs an answer\n * continues from, and its task shows the question and what the turn cost so far.\n *\n * Deliberately skips change-set assessment and verification: a parked run's\n * edits are partial by definition, and assessing them as a final change set is\n * exactly the \"read a suspended turn as complete\" mistake the suspension field\n * exists to prevent.\n */\n private buildParkedCodingRunResult(params: {\n task: MetaWorkflow_ApplicationCodingTaskContract;\n taskId: string;\n baseline: GitWorktreeSnapshot;\n suspension: CodingAgent_SessionSuspension;\n output: Partial<CodingAgent_RunTaskOutput>;\n usage: CodingAgent_Usage | undefined;\n codingSessionEventCount: number;\n retainedCodingSessionFrames: Array<{ readonly kind: string; readonly payload: unknown }>;\n codingSessionRetention: CodingSessionRetentionSummary;\n startedAtMs: number;\n runSession: CompanionExecutionSessionContext | undefined;\n runStep: ReturnType<CompanionTraceabilityService['createStep']> | undefined;\n traceBestEffort: (operation: string, write: () => Promise<void>) => Promise<void>;\n }): CodingRunResult {\n const { task, taskId, baseline, suspension, output } = params;\n const parkedAt = new Date().toISOString();\n\n const durableOutput = {\n succeeded: false,\n disposition: ApplicationCodingTaskDisposition.AWAITING_OPERATOR_INPUT,\n durationMs: Date.now() - params.startedAtMs,\n // The question the operator must answer, front and centre.\n pendingQuestion: suspension.question,\n suspension,\n agentOutputTail: (output.finalMessage ?? '').slice(-OUTPUT_TAIL_CHARS),\n ...(output.stopReason ? { agentStopReason: output.stopReason } : {}),\n ...(output.turnCount ? { turnCount: output.turnCount } : {}),\n ...(output.continuations && output.continuations.length > 0 ? { continuations: output.continuations } : {}),\n ...(params.codingSessionEventCount > 0 ? { codingSessionEventCount: params.codingSessionEventCount } : {}),\n ...(params.retainedCodingSessionFrames.length > 0\n ? { codingSessionFrames: params.retainedCodingSessionFrames, codingSessionRetention: params.codingSessionRetention }\n : {}),\n ...(params.usage ? { usage: params.usage } : {}),\n ...(output.deniedPermissionCount !== undefined ? { deniedPermissionCount: output.deniedPermissionCount } : {}),\n ...(output.permissionDecisions && output.permissionDecisions.length > 0 ? { permissionDecisions: output.permissionDecisions } : {}),\n };\n\n // The resume inputs — see `ApplicationCodingRunCheckpointSchema` for why the CONTRACT and the\n // ORIGINAL baseline travel here rather than being re-derived when the answer arrives.\n const checkpoint: ApplicationCodingRunCheckpoint = {\n kind: APPLICATION_CODING_RUN_CHECKPOINT_KIND,\n taskRef: task.taskRef,\n contract: task,\n baseline,\n suspension,\n parkedAt,\n // Every leg so far, so the resume's row keeps their tokens (`mergeResumedLegUsage`).\n ...(params.usage ? { priorLegsUsage: params.usage } : {}),\n };\n\n return {\n kind: CodingRunEnding.PARKED,\n /*\n * UNROUTED, deliberately (#1751). Under the notify-and-proceed posture the ANSWERING AGENT settles\n * the questions it can before a person sees them (#1559), and an OWNER route admits only its\n * requester as a signed-in person: routed, every one of those answers would be refused and every\n * question would fall to the creator. A coding question is routed only once the route model can\n * express \"the agent acting within the posture the owner chose\" — until then its door is its\n * authority, and each settle still records its answer.\n */\n suspension: {\n decision: projectParkedCodingQuestionAsDecision({ taskId, taskRef: task.taskRef, suspension, parkedAt }),\n checkpointContext: checkpoint,\n taskOutput: durableOutput,\n },\n output: durableOutput,\n afterSettle: () => params.traceBestEffort('record-awaiting-input', () => this.traceOperationStart({\n sessionContext: params.runSession,\n step: params.runStep,\n type: 'application-coding-task-awaiting-input',\n summary: `Application coding task ${task.taskRef} is awaiting an operator answer`,\n payload: { taskId, question: suspension.question, resumable: suspension.resumable },\n })),\n };\n }\n\n /**\n * Has this build task ALREADY been run to a working result?\n *\n * Asked by the build dispatcher before it selects a task, and the reason is a measured money\n * leak rather than tidiness. `dispatch-next` picks `ready[0]`, and readiness is \"not landed\";\n * a task whose declared PRODUCT is never satisfied by the work it does is therefore ready\n * again the instant it finishes. Measured 2026-09-10 on Wonder CRM, where every task in the\n * plan declares `produces: []` and so can never land (#606): three consecutive dispatches\n * selected `build-task-contact-schema`, ran a full coding agent each time, and cost roughly\n * $7.50 per iteration. Nothing failed — each run succeeded — and the loop is unbounded.\n *\n * The durable actor-task rows are the right source and the only one that survives a restart:\n * an in-memory \"last dispatched\" would forget across the respawn that a rebuild triggers, and\n * the loop would resume.\n *\n * Deliberately COMPLETED only. A failed or cancelled run is exactly what an operator SHOULD be\n * able to re-dispatch, and a parked one is answered by resuming rather than by re-running.\n *\n * And a RE-ARMED completed run does not count (#1535): once the reason a task did not land is\n * fixed, `rearmBuildTask` records that on the run, and the task is offered again.\n */\n public async findCompletedRunForBuildTask(\n buildTaskRef: string,\n sessionContext?: CompanionExecutionSessionContext,\n /** A person's door reads now; the selection shares one read (#3204, see {@link listCompletedRunsForBuildTask}). */\n options: { readonly fresh?: boolean } = {},\n ): Promise<{ taskId: string; completedAt?: string; newestStartedAt?: string } | null> {\n const counting = await this.listCountingCompletedRunsForBuildTask(buildTaskRef, sessionContext, options);\n const [first] = counting;\n if (first === undefined) return null;\n /*\n * When the NEWEST counting run started (#3460, third review F2): the instant that says which plan the task was last\n * attempted under. The list is ordered by row update, not by run, and a run's completion can follow a plan commit it\n * never saw, so neither `first` nor a completion instant answers it.\n */\n const starts = counting.map((run) => run.startedAt ?? run.completedAt).filter((at): at is string => at !== undefined).sort();\n return { taskId: first.taskId, completedAt: first.completedAt, ...(starts.length > 0 ? { newestStartedAt: starts[starts.length - 1] } : {}) };\n }\n\n /**\n * Put a build task back in the queue after the reason it did not land has been fixed (#1535).\n *\n * Every completed run the anti-loop guard still counts, and every failed run not yet re-armed (a forgiven\n * one included, #1581), gets a re-arm recorded on its own row, in its\n * long-term memory, with the reason and a note. Nothing about the run is rewritten: it still reads\n * as the run it was, and it now also reads as a run that was superseded, and why.\n *\n * Refuses when there is nothing to re-arm, naming why, because a re-arm that changes nothing would\n * let an operator believe a task was released when it was never held.\n */\n public async rearmBuildTask(\n buildTaskRef: string,\n request: { readonly reason: BuildTaskRearmReason; readonly note: string },\n sessionContext?: CompanionExecutionSessionContext,\n ): Promise<{ readonly rearmedRunTaskIds: readonly string[]; readonly rearm: BuildTaskRearm }> {\n /*\n * Completed runs hold a task through the anti-loop guard; failed ones through its attempt budget\n * (#1536). EVERY failed run not yet re-armed is re-armed, including the ones the budget currently\n * FORGIVES (a host failure, suspected interference): forgiveness is bounded per task, and a re-arm\n * that left the forgiven runs in place would leave their slots used for good, so the first host\n * failure after the re-arm would already count (#1581, third review F-1).\n */\n const failedNotRearmed = (await this.listAttributableFailedRunsForBuildTask(buildTaskRef, sessionContext, { includeRearmed: true }))\n .filter((run) => readBuildTaskRearm(run.memory) === undefined);\n const runs = [\n ...(await this.listCountingCompletedRunsForBuildTask(buildTaskRef, sessionContext, { fresh: true })),\n ...failedNotRearmed,\n ];\n if (runs.length === 0) {\n throw new NothingToRearmError(\n `Build task \"${buildTaskRef}\" has no completed coding run that still counts and no failed one not yet re-armed, so there is nothing to re-arm: `\n + 'it was never run, or every run is already re-armed. A task in that state is '\n + 'offered by the next dispatch on its own.',\n );\n }\n const rearm: BuildTaskRearm = { reason: request.reason, note: request.note, rearmedAt: new Date().toISOString() };\n /*\n * A person saying the ENVIRONMENT failed the task also says it is back (#3236): the connectivity hold ends here too, so a\n * probe that cannot reach the agent's API by the path the agent uses (a proxy, a cloud endpoint) is never a lockout.\n */\n if (request.reason === BuildTaskRearmReason.ENVIRONMENT && this.codingAgentConnectivityHold) {\n this.releaseCodingAgentConnectivityHold(this.codingAgentConnectivityHold, `a re-arm of ${buildTaskRef} for the environment`);\n }\n if (request.reason === BuildTaskRearmReason.ENVIRONMENT) this.releaseVerificationToolUnavailableHold(`a re-arm of ${buildTaskRef} for the environment`);\n try {\n await this.serializeRunMemoryWrite(async () => {\n /*\n * Each run's memory is read again inside the lane: the listing above may predate a review or an interference\n * appended since, and writing its memory back would erase that entry.\n */\n const current = new Map((await this.listCompletedRunsForBuildTask(buildTaskRef, sessionContext, { fresh: true })).map((run) => [run.taskId, run.memory]));\n for (const run of runs) {\n const memory = current.has(run.taskId) ? current.get(run.taskId) : run.memory;\n await this.executionsService.updateActorTask(run.taskId, { memory: withBuildTaskRearm(memory, rearm) }, sessionContext);\n }\n });\n } finally {\n // A re-arm is actor-plane memory only — no file moves — and it releases a task the boards held as\n // stuck. Announced even when a later update threw: the runs re-armed before it did still moved.\n this.announceRunStateChanged();\n }\n return { rearmedRunTaskIds: runs.map((run) => run.taskId), rearm };\n }\n\n /**\n * The FAILED coding runs of one build task that still count against its attempt budget (#1536) —\n * newest first, re-armed runs excluded, each with what the dispatcher needs to tell the next attempt\n * why this one failed.\n *\n * Only the task's OWN failures count. Since `703d07c3` a check that was red before the run started\n * no longer fails it (the run completes and records `carriedVerificationFailures`). A CANCELLED or\n * ABORTED run is not an attempt and is not listed — which includes a dispatch refused before\n * admission, settled ABORTED (#1581), and a FAILED row written before that which never started. A FAILED run the HOST caused (`failureAttribution`,\n * {@link deriveCodingRunFailureAttribution}) — an operator's cancel of a running turn among them — is\n * forgiven up to `MAXIMUM_HOST_FAILURE_EXCLUSIONS`, like suspected interference: past the bound it\n * counts, so a host condition that fails every attempt still retires the task. A re-arm releases the\n * forgiven runs too (`rearmBuildTask`). A row older than the field counts. A run the coding agent's usage\n * limit took (`codingAgentUsageLimit`, #2388) is excluded outright and spends no forgiveness: the build\n * pauses until the limit's reset rather than re-dispatching into it. So is one the network took\n * (`networkFailureKind`, #3236): the connectivity hold keeps the next admission waiting on a probe.\n */\n public async listAttributableFailedRunsForBuildTask(\n buildTaskRef: string,\n sessionContext?: CompanionExecutionSessionContext,\n options: { readonly includeRearmed?: boolean } = {},\n ): Promise<{ taskId: string; settledAt?: string; startedAt?: string; memory: Actors_Memory_Context | undefined; output: Record<string, unknown> }[]> {\n const failed = await this.readFailedCodingTasks(sessionContext);\n const counting: { taskId: string; settledAt?: string; startedAt?: string; memory: Actors_Memory_Context | undefined; output: Record<string, unknown>; interferenceSuspected: boolean; hostAttributed: boolean; usageLimited: boolean; networkTaken: boolean }[] = [];\n for (const task of failed) {\n // A persisted task row: its instants are dates (#2187), and this record carries the ISO form.\n const stored = task as { _id?: string; actors?: { actorRef?: string }; input?: unknown; output?: unknown; completedAt?: Date; startedAt?: Date; memory?: Actors_Memory_Context };\n const row = { ...stored, completedAt: stored.completedAt?.toISOString(), startedAt: stored.startedAt?.toISOString() };\n if (!isApplicationCodingAgentRef(row.actors?.actorRef)) continue;\n if (!isRecordValue(row.input) || row.input.taskRef !== buildTaskRef) continue;\n // A re-armed failure no longer counts against the budget; a retry may still want to READ it.\n if (options.includeRearmed !== true && readBuildTaskRearm(row.memory) !== undefined) continue;\n const output = isRecordValue(row.output) ? row.output : {};\n /*\n * A run the HOST declined to start is no attempt (#1581, seventh review F7): the build board and the\n * retry context already read it so through `deriveCodingRunStart`, and the budget is the third reader\n * of that question. Only a row written before #1581 is FAILED and never started; today it is ABORTED.\n */\n if (options.includeRearmed !== true\n && deriveCodingRunStart({ status: FlowsActors_Status.FAILED, ...(row.startedAt ? { startedAt: row.startedAt } : {}), output }) === CodingRunStart.REFUSED_BY_HOST) {\n continue;\n }\n counting.push({\n taskId: String(row._id),\n ...(row.completedAt ? { settledAt: row.completedAt } : {}),\n // Whether the run STARTED is what tells a retry that nothing ran (`deriveCodingRunStart`).\n ...(row.startedAt ? { startedAt: row.startedAt } : {}),\n memory: row.memory,\n output,\n interferenceSuspected: output.interferenceSuspected === true,\n hostAttributed: output.failureAttribution === CodingRunFailureAttribution.HOST,\n // The account's usage limit took the turn: no attempt, and no forgiveness spent (#2388).\n usageLimited: readRecordedCodingAgentUsageLimit(output) !== undefined,\n // The network took the turn: no attempt either, the connectivity hold keeps the next one waiting (#3236).\n networkTaken: output.failureAttribution === CodingRunFailureAttribution.HOST && readRecordedNetworkFailureKind(output) !== undefined,\n });\n }\n /*\n * A run that failed while other runs shared the tree may have failed for THEIR edits (#1528). The\n * budget forgives up to MAXIMUM_INTERFERENCE_RETRIES of those, so interference cannot retire a\n * task, and a task that genuinely cannot pass still does. A retry READING its history sees them all.\n */\n return (options.includeRearmed === true ? counting : selectBudgetCountingFailures(counting))\n .map(({ interferenceSuspected: _suspected, hostAttributed: _host, usageLimited: _limited, networkTaken: _network, ...run }) => run);\n }\n\n /**\n * The completed coding runs of one build task that the anti-loop guard still counts — newest first,\n * re-armed runs excluded. One reader, so the guard and the re-arm cannot disagree about which runs\n * hold a task.\n */\n private async listCountingCompletedRunsForBuildTask(\n buildTaskRef: string,\n sessionContext?: CompanionExecutionSessionContext,\n options: { readonly fresh?: boolean } = {},\n ): Promise<{ taskId: string; completedAt?: string; startedAt?: string; memory: Actors_Memory_Context | undefined }[]> {\n return (await this.listCompletedRunsForBuildTask(buildTaskRef, sessionContext, options)).filter((run) => readBuildTaskRearm(run.memory) === undefined);\n }\n\n /**\n * Every COMPLETED coding run of one build task, re-armed ones included, in the order the actor plane lists\n * them (a caller that needs the latest sorts by `completedAt`), each with the interference the build wave\n * recorded on it (#2210). The wave reads it twice: to count how many interference re-arms the task has\n * already had (`MAXIMUM_INTERFERENCE_REARMS`), and to tell the next attempt that its previous one lost its\n * product to a sibling.\n */\n public async listCompletedRunsForBuildTask(\n buildTaskRef: string,\n sessionContext?: CompanionExecutionSessionContext,\n /**\n * Read the rows now rather than share the read the selection holds (#3204). For a writer: a re-arm and a memory\n * write decide on the rows they change, and an operator's door may follow a change nothing in this service announced.\n */\n options: { readonly fresh?: boolean } = {},\n ): Promise<{ taskId: string; completedAt?: string; startedAt?: string; memory: Actors_Memory_Context | undefined; interference?: BuildTaskInterference }[]> {\n /*\n * Scoped to the CODING actors before the list is trimmed (#1359). This used to read the 200 most\n * recently updated `COMPLETED` tasks of EVERY actor, so a busy judge or labelling lane could push\n * a completed coding run out of the window — and this guard would then answer \"never ran\" and\n * reopen the loop it exists to close. A task absent from a FULL window of 200 coding runs is then\n * read by its own ref (#3204), so a completed run is found whatever its age.\n */\n const completed = await this.readCompletedCodingTasksOf(buildTaskRef, sessionContext, options.fresh === true);\n\n const runs: { taskId: string; completedAt?: string; startedAt?: string; memory: Actors_Memory_Context | undefined; interference?: BuildTaskInterference }[] = [];\n for (const task of completed) {\n // A persisted task row: its instants are dates (#2187), and this record carries the ISO form.\n const stored = task as { _id?: string; actors?: { actorRef?: string }; input?: unknown; startedAt?: Date; completedAt?: Date; memory?: Actors_Memory_Context };\n const row = { ...stored, completedAt: stored.completedAt?.toISOString(), startedAt: stored.startedAt?.toISOString() };\n // MEMBERSHIP, not equality with one constant — the same reason\n // `reconcileInterruptedApplicationCodingTasks` gives: a second declared coding agent must\n // not make this silently answer \"never ran\".\n if (!isApplicationCodingAgentRef(row.actors?.actorRef)) continue;\n if (!isRecordValue(row.input) || row.input.taskRef !== buildTaskRef) continue;\n const interference = readBuildTaskInterference(row.memory);\n runs.push({ taskId: String(row._id), completedAt: row.completedAt, ...(row.startedAt ? { startedAt: row.startedAt } : {}), memory: row.memory, ...(interference ? { interference } : {}) });\n }\n return runs;\n }\n\n /**\n * The completed coding runs' rows, ONE read shared by every build task asking until a run's state changes (#3204).\n *\n * Each build task asks for its completed runs, and each ask listed the 200 most recent completed coding runs whole:\n * brief, transcript and output, 0.3 MB a row. A build wave's selection asks for every candidate task, so on reference\n * run 42536379955 the companion read 1.1 GB from MongoDB in 30 seconds and spent half its time collecting the garbage,\n * with one or two agents running out of ten. The rows change only when a run starts, ends, is re-armed or has its\n * memory written, and every one of those calls {@link announceRunStateChanged}, which moves the generation this read\n * is held under. A read is held under the generation it STARTED at, so a change landing while it runs is never\n * hidden. A few seconds' ceiling bounds what a writer outside this service could change unannounced.\n */\n private readCompletedCodingTasks(sessionContext?: CompanionExecutionSessionContext, fresh = false): Promise<readonly Wildo_Application_Actor_Task[]> {\n const generation = this.runStateGeneration ?? 0;\n const held = this.completedCodingTasksRead;\n if (!fresh && held !== undefined && held.generation === generation && Date.now() < held.heldUntilMs) return held.rows;\n const rows = this.executionsService.listActorTasks(CompanionActorTasksListQuerySchema.parse({\n status: FlowsActors_Status.COMPLETED,\n actorRefs: [...APPLICATION_CODING_AGENT_REFS],\n limit: COMPLETED_CODING_TASKS_WINDOW,\n }), sessionContext, { omitStoredFields: CODING_RUN_LISTING_OMITTED_FIELDS });\n this.completedCodingTasksRead = { generation, heldUntilMs: Date.now() + COMPLETED_CODING_TASKS_HOLD_MS, rows };\n // A failed read is held by nobody.\n rows.catch(() => {\n if (this.completedCodingTasksRead?.rows === rows) this.completedCodingTasksRead = undefined;\n });\n return rows;\n }\n\n /**\n * The FAILED coding runs' rows, one read shared by every build task asking until a run's state changes (#3204), exactly\n * as {@link readCompletedCodingTasks} shares the completed ones.\n *\n * `listAttributableFailedRunsForBuildTask` is asked once per candidate task of a selection, and each ask listed every\n * failed coding run whole: on reference run 42813811656, 16 MB per read, repeated within seconds, beside the completed\n * read, ~430 MB in 30 seconds with the companion's event loop saturated. Held under the run-state generation it started\n * at, with the same few seconds' ceiling, so a run failing or being re-armed is seen at once.\n */\n private readFailedCodingTasks(sessionContext?: CompanionExecutionSessionContext): Promise<readonly Wildo_Application_Actor_Task[]> {\n const generation = this.runStateGeneration ?? 0;\n const held = this.failedCodingTasksRead;\n if (held !== undefined && held.generation === generation && Date.now() < held.heldUntilMs) return held.rows;\n const rows = this.executionsService.listActorTasks(CompanionActorTasksListQuerySchema.parse({\n status: FlowsActors_Status.FAILED,\n actorRefs: [...APPLICATION_CODING_AGENT_REFS],\n limit: 200,\n }), sessionContext, { omitStoredFields: CODING_RUN_LISTING_OMITTED_FIELDS });\n this.failedCodingTasksRead = { generation, heldUntilMs: Date.now() + COMPLETED_CODING_TASKS_HOLD_MS, rows };\n rows.catch(() => {\n if (this.failedCodingTasksRead?.rows === rows) this.failedCodingTasksRead = undefined;\n });\n return rows;\n }\n\n private failedCodingTasksRead?: { readonly generation: number; readonly heldUntilMs: number; readonly rows: Promise<readonly Wildo_Application_Actor_Task[]> };\n\n /**\n * The completed coding-run rows that answer for ONE build task (#3204): the shared window ({@link readCompletedCodingTasks})\n * when it can answer, and otherwise that task's own rows, read from the database by its ref.\n *\n * The window holds the 200 most recently updated completed coding runs. A task with a row in it, or a window that is not\n * full, is answered from it; a task absent from a FULL window may have run before it, and on reference run 42845651222\n * (782 completed runs) such tasks read as never having run, un-landed and were dispatched again, one of them with 204\n * newer runs ahead of its only one. The per-task read answers whatever the age. It is held per task: a completed run\n * stays completed, a newer run of the task lands in the window, and the only other change, a re-arm or an interference\n * record written to a run's memory, goes through {@link serializeRunMemoryWrite}, which drops what is held. A FRESH read\n * (a person's door, a memory write deciding on the rows) always reads the task's own rows.\n */\n private async readCompletedCodingTasksOf(\n buildTaskRef: string,\n sessionContext?: CompanionExecutionSessionContext,\n fresh = false,\n ): Promise<readonly Wildo_Application_Actor_Task[]> {\n if (fresh) return this.executionsService.listActorTasksOfBuildTask(FlowsActors_Status.COMPLETED, buildTaskRef, sessionContext, { omitStoredFields: CODING_RUN_LISTING_OMITTED_FIELDS });\n const window = await this.readCompletedCodingTasks(sessionContext);\n const answersFromWindow = window.length < COMPLETED_CODING_TASKS_WINDOW\n || window.some((row) => isRecordValue(row.input) && (row.input as { taskRef?: unknown }).taskRef === buildTaskRef);\n if (answersFromWindow) return window;\n const held = (this.completedRunsOutsideWindow ??= new Map()).get(buildTaskRef);\n if (held !== undefined) return held;\n const rows = this.executionsService.listActorTasksOfBuildTask(FlowsActors_Status.COMPLETED, buildTaskRef, sessionContext, { omitStoredFields: CODING_RUN_LISTING_OMITTED_FIELDS });\n this.completedRunsOutsideWindow.set(buildTaskRef, rows);\n rows.catch(() => {\n if (this.completedRunsOutsideWindow?.get(buildTaskRef) === rows) this.completedRunsOutsideWindow.delete(buildTaskRef);\n });\n return rows;\n }\n\n /** Per-task reads of tasks absent from the window, dropped by every run-memory write (see {@link readCompletedCodingTasksOf}). */\n private completedRunsOutsideWindow?: Map<string, Promise<readonly Wildo_Application_Actor_Task[]>>;\n\n /** Moved by every {@link announceRunStateChanged}: a held read of the run rows is good only at its own generation. */\n private runStateGeneration?: number;\n private completedCodingTasksRead?: { readonly generation: number; readonly heldUntilMs: number; readonly rows: Promise<readonly Wildo_Application_Actor_Task[]> };\n\n /**\n * Record on a COMPLETED run that the build wave found its product lost to a sibling (#2210). Appended to the\n * run's long-term memory beside any re-arm, so the run still reads as the run it was, and now also as one a\n * sibling interfered with. Refuses a run that is not a completed run of this task, because the record would\n * otherwise describe a run it was never measured on.\n */\n public async recordBuildTaskInterference(\n buildTaskRef: string,\n runTaskId: string,\n interference: BuildTaskInterference,\n sessionContext?: CompanionExecutionSessionContext,\n ): Promise<void> {\n await this.serializeRunMemoryWrite(async () => {\n const run = (await this.listCompletedRunsForBuildTask(buildTaskRef, sessionContext, { fresh: true })).find((candidate) => candidate.taskId === runTaskId);\n if (!run) throw new Error(`Run ${runTaskId} is not a completed coding run of build task \"${buildTaskRef}\"; no interference is recorded on it.`);\n try {\n await this.executionsService.updateActorTask(runTaskId, { memory: withBuildTaskInterference(run.memory, interference) }, sessionContext);\n } finally {\n // The build record shows it; a board that read the run before must read it again.\n this.announceRunStateChanged();\n }\n });\n }\n\n /**\n * Record on a COMPLETED run what the review of its website copy found (#2593), beside any re-arm or interference.\n * Refuses a run that is not a completed run of this task, for the reason {@link recordBuildTaskInterference} does.\n */\n public async recordWebsiteCopyReview(\n buildTaskRef: string,\n runTaskId: string,\n review: WebsiteCopyReview,\n sessionContext?: CompanionExecutionSessionContext,\n ): Promise<void> {\n await this.serializeRunMemoryWrite(async () => {\n const run = (await this.listCompletedRunsForBuildTask(buildTaskRef, sessionContext, { fresh: true })).find((candidate) => candidate.taskId === runTaskId);\n if (!run) throw new Error(`Run ${runTaskId} is not a completed coding run of build task \"${buildTaskRef}\"; no copy review is recorded on it.`);\n try {\n await this.executionsService.updateActorTask(runTaskId, { memory: withWebsiteCopyReview(run.memory, review) }, sessionContext);\n } finally {\n this.announceRunStateChanged();\n }\n });\n }\n\n /**\n * Record on a COMPLETED run what the review of its website drawing found (#2785), beside its copy review. Refuses a\n * run that is not a completed run of this task, as {@link recordWebsiteCopyReview} does.\n */\n public async recordWebsiteVisualReview(\n buildTaskRef: string,\n runTaskId: string,\n review: WebsiteVisualReview,\n sessionContext?: CompanionExecutionSessionContext,\n ): Promise<void> {\n await this.serializeRunMemoryWrite(async () => {\n const run = (await this.listCompletedRunsForBuildTask(buildTaskRef, sessionContext, { fresh: true })).find((candidate) => candidate.taskId === runTaskId);\n if (!run) throw new Error(`Run ${runTaskId} is not a completed coding run of build task \"${buildTaskRef}\"; no visual review is recorded on it.`);\n try {\n await this.executionsService.updateActorTask(runTaskId, { memory: withWebsiteVisualReview(run.memory, review) }, sessionContext);\n } finally {\n this.announceRunStateChanged();\n }\n });\n }\n\n /**\n * Which runs shared the tree with this one, and which paths both changed, computed NOW from every window\n * this process holds (#2210). `closeCodingRunWindow` answers the same question at the run's own settle,\n * when a sibling still running has not reported its paths yet; at the end of a wave every window is\n * closed, so this one sees every sibling. `null` for a run this process holds no window for, or one that\n * overlapped nothing.\n */\n public describeCodingRunOverlap(taskId: string): CodingRunConcurrencyRecord | null {\n const window = this.codingRunWindows.find((candidate) => candidate.taskId === taskId);\n if (!window || window.endedAtMs === undefined) return null;\n const record = describeRunConcurrency(this.codingRunWindows, { taskId, startedAtMs: window.startedAtMs, endedAtMs: window.endedAtMs }, window.changedPaths ?? []);\n return record.overlappingTaskRefs.length > 0 ? record : null;\n }\n\n /**\n * A run for this build task that is PARKED on an unanswered question.\n *\n * The sibling above answers \"has this task already run to a terminal state?\" and is what the\n * dispatcher's anti-loop guard consults. It lists `COMPLETED` tasks only, so a run that SUSPENDS is\n * invisible to it, and its task would be offered again on every dispatch, forever.\n *\n * Measured 2026-09-16 on Wonder CRM: `build-task-gdpr-data-handling-governance` suspended, and the\n * next `dispatch-next` dry run selected the same task — neither landed, nor marked, nor skipped.\n * That is the money-burning loop `buildUnlandableTaskError` was written against (#606, ~$7.50 a\n * turn), reached through the one door that guard cannot see.\n *\n * Re-dispatching a parked task is worse than re-dispatching a completed one: it starts a NEW run\n * and abandons the persisted session the operator's answer would have resumed, so the question and\n * everything the agent established are lost rather than merely repeated.\n *\n * Reads the waiting EXECUTIONS of the coding system since #1359 — see `listParkedCodingRuns` for\n * the residual that closed.\n */\n public async findParkedRunForBuildTask(\n buildTaskRef: string,\n sessionContext?: CompanionExecutionSessionContext,\n ): Promise<{ taskId: string; question: string; resumable: boolean } | null> {\n for (const parked of await this.listParkedCodingRuns(sessionContext)) {\n if (parked.checkpoint.taskRef !== buildTaskRef) continue;\n /*\n * RESUMABLE only, and matching the answer door's own predicate is the whole point. A\n * non-resumable park cannot be answered — that door refuses it — so reporting it here would\n * make the dispatcher skip the one task no operator can unblock: a dead end in both\n * directions. A non-resumable park is therefore reported as NOT parked, and a fresh dispatch\n * is the only way forward for it.\n */\n if (!parked.checkpoint.suspension.resumable) continue;\n return { taskId: parked.taskId, question: parked.checkpoint.suspension.question, resumable: true };\n }\n return null;\n }\n\n /**\n * The parked run behind one TASK id, or `null` when nothing answerable waits under it.\n *\n * The task id is the lane's handle and the execution is the engine's, so this is the join: the\n * task row names its execution, and the driver says whether that execution is waiting. Every way\n * of not being a parked coding run answers `null` — not a coding task, no execution, not waiting,\n * a checkpoint that no longer parses. A read that FAILS answers `null` too in the lenient default,\n * for the one caller that treats every miss alike (the answering-agent loop, whose miss sends the\n * question to the creator); a\n * STRICT read throws it instead, for a caller that must not tell a person \"nothing is waiting\" when\n * nothing was read (#1581, tenth and eleventh reviews).\n */\n private async readParkedCodingRun(\n taskId: string,\n sessionContext?: CompanionExecutionSessionContext,\n /**\n * STRICT: a read that FAILED throws instead of answering `null` — for a caller that must tell \"nothing\n * is waiting\" from \"could not tell\" (#1581, tenth review R10-1): every door that answers a person (the\n * answer door, the per-run cancel, a chain's withdraw) reads strictly.\n */\n options: { readonly strict?: boolean } = {},\n ): Promise<{ executionId: string; suspensionRef: string; checkpoint: ApplicationCodingRunCheckpoint; mode: CodingRunConcurrency } | null> {\n let executionId: string | undefined;\n try {\n const row = await this.executionsService.getActorTask(taskId, sessionContext);\n if (!isApplicationCodingAgentRef(row.actors?.actorRef)) return null;\n executionId = row.wildoApplicationActorSystemExecutionId;\n } catch (error) {\n if (options.strict === true && !isAbsentParkRead(error)) throw error;\n return null;\n }\n if (!executionId) return null;\n try {\n const waiting = await this.actorsSystem.readSuspendedActorExecution(executionId, sessionContext);\n const checkpoint = ApplicationCodingRunCheckpointSchema.safeParse(waiting.row.checkpoint?.context);\n // A run parked from a wave resumes as one: it holds only its task, never the tree (#1528).\n const mode = isConcurrentRunSubject(waiting.row.exclusiveSubject) ? CodingRunConcurrency.CONCURRENT : CodingRunConcurrency.SINGLE_FLIGHT;\n // The suspension it waits on NOW: a resume carries it, so an answer read against one question cannot continue the next (#1581, seventh review F9).\n return checkpoint.success ? { executionId, suspensionRef: actorExecutionSuspensionRef(waiting.suspension), checkpoint: checkpoint.data, mode } : null;\n } catch (error) {\n // `readSuspendedActorExecution` refuses an execution that is not waiting — already answered,\n // cancelled, settled. For this door that is \"nothing to answer\", not a fault; a failed read is.\n if (options.strict === true && !isAbsentParkRead(error)) throw error;\n return null;\n }\n }\n\n /**\n * (dead-plan-citation: CODING-ANSWERS.md is the file this method writes.)\n * Append one answer to `src/build-plan/CODING-ANSWERS.md` — the record of what a person told a\n * parked coding run (#1454, Step 6). Until then the answer lived only in the agent session and\n * the run log, so a reviewer accepting the change set could not see the decision it rests on.\n *\n * Best-effort: a record that cannot be written is logged and the answer still goes to the agent\n * — the person's answer is not held hostage to a file. The file lands beside the build plan as a\n * working edit; a commit accepts it like every other decision record.\n */\n private async recordCodingQuestionAnswer(\n taskRef: string,\n question: string,\n answer: string,\n source: { readonly answeredBy?: CodingQuestionAnswerer; readonly basis?: string; readonly answeredByRef?: string } = {},\n ): Promise<void> {\n const specificationsPackageRoot = this.companionContext.resolvedSpecifications?.packageRoot;\n const buildPlanPath = getFamilyPackageRelativePath(ApplicationSpecificationFamily.BUILD_PLAN);\n if (!specificationsPackageRoot || !buildPlanPath) return;\n const filePath = join(specificationsPackageRoot, dirname(buildPlanPath), CODING_ANSWERS_FILE_NAME);\n try {\n await mkdir(dirname(filePath), { recursive: true });\n const entry = renderCodingQuestionAnswerEntry({ taskRef, question, answer, answeredAt: new Date().toISOString(), ...source });\n if (existsSync(filePath)) await appendFile(filePath, entry, 'utf8');\n else await writeFile(filePath, `${renderCodingQuestionAnswersHeader()}${entry}`, 'utf8');\n } catch (error) {\n this.logDebug('Could not record the coding-question answer beside the build plan (the answer still resumes the run)', { taskRef, error: String(error) });\n }\n }\n\n /**\n * Answer a parked coding task's question, resuming the SAME agent session.\n *\n * ONE door, in-process or after a restart (#1359). The run's execution is `AWAITING_APPROVAL`\n * with the contract, the original baseline and the agent session on its checkpoint, and the\n * engine's `resumeActorExecution` continues it under the same ids: it refuses an execution that is\n * no longer waiting on the question this answer names BEFORE moving anything — so a second answer\n * to one question cannot run the work twice — moves the rows back to `PROCESSING`, and settles\n * whatever the continued run does, including parking again on a second question.\n *\n * WHICH question the answer names is the caller's to say, and it is required (`expected.suspensionRef`,\n * the value a pending question and its workbench row carry): an answer that named nothing would\n * continue whichever question the run waits on when the request lands, which is not necessarily the\n * one its person read (#1581, eighth and ninth reviews).\n *\n * A single-flight run resumes under the worktree mutation lock, exactly like a fresh dispatch (a\n * resume mutates the same worktree); a run parked from a wave resumes beside it, holding no lock, as\n * it ran (#1528). Either way it re-enters the turn ladder through `session/load`, so the agent\n * continues with its full context. The mutation scope and verification plan are the parked\n * contract's; a resume is held to the same bounds as the first run, and its change set is measured\n * from the first run's baseline.\n */\n public async respondToApplicationCodingTaskQuestion(\n taskId: string,\n answer: string,\n sessionContext: CompanionExecutionSessionContext | undefined,\n expected: {\n readonly suspensionRef: string;\n /** Who answered (#1658) — `git:<email>`, `agent:<name>`, a workbench user — written into `CODING-ANSWERS.md` (dead-plan-citation: written file). */\n readonly answeredByRef?: string;\n /** The signed-in person answering (#1751), when the door has one: the decision's recorded actor. */\n readonly actingUserId?: string;\n },\n ): Promise<ApplicationCodingTaskRunAdmission> {\n // A missing answer is a VALIDATION 400 regardless of whether a task is parked\n // — it is a malformed request, not a state conflict.\n const trimmedAnswer = this.admitTypedInput(() => {\n const value = answer.trim();\n if (value.length === 0) throw new Error('empty answer');\n return value;\n }, 'An answer is required to resume a parked coding task.');\n // Which question it answers: required, and a blank reference names none — a 400 at every door (#1581, R12-1).\n const answeredRef = this.admitTypedInput(() => {\n const value = expected.suspensionRef.trim();\n if (value.length === 0) throw new Error('empty suspensionRef');\n return value;\n }, 'An answer must name the question it answers (`suspensionRef`, as the pending question carries it).');\n // STRICT: a failed read must not tell a person their question is gone (#1581, eleventh review R11-5).\n const parked = await this.readParkedCodingRun(taskId, sessionContext, { strict: true }).catch((error: unknown) => {\n this.logger.warn('The answer door could not read the coding run\\'s park', { taskId, error: describeCaughtError(error) });\n throw this.buildDispatchConflictError(\n `Coding task ${taskId} could not be read, so your answer was not applied. Its question may still be waiting; try again.`,\n );\n });\n if (!parked) {\n throw this.buildDispatchConflictError(\n `No coding task is awaiting an answer under id ${taskId}. It was already answered, cancelled or settled, `\n + 'or it is not a coding run.',\n );\n }\n const { checkpoint, executionId, mode } = parked;\n // The fast 409: the run has asked again since the caller read its question. The driver re-checks the\n // same suspension reference when it resumes, so a question asked after this point is refused there too.\n if (answeredRef !== parked.suspensionRef) {\n throw this.buildDispatchConflictError(\n `Coding task ${taskId} has asked another question since the one you answered. Read its current question and answer that.`,\n );\n }\n // Past that check the caller's reference IS this one; the driver holds the resume to it.\n const { suspensionRef } = parked;\n if (!checkpoint.suspension.resumable) {\n throw this.buildDispatchConflictError(\n `Coding task ${taskId} parked on a question, but its agent does not support session resume, `\n + 'so the answer cannot be delivered to the same session. Re-dispatch the task with the answer folded into the objective.',\n );\n }\n // Answers are serialized behind the same worktree: refused while another run holds it. The\n // driver re-takes the subject on resume and refuses there too; this names the holder first.\n await this.refuseWhileWorktreeIsHeld(null, sessionContext);\n if (mode === CodingRunConcurrency.SINGLE_FLIGHT) await this.refuseWhileConcurrentRunsInFlight(sessionContext);\n const task = checkpoint.contract;\n const verificationPlans = this.admitTypedInput(\n () => resolveApplicationCodingTaskVerificationPlans(task.verificationIntent.requiredChecks),\n 'The parked coding task names a verification check this host no longer registers.',\n );\n\n const admission = createDeferred<ApplicationCodingTaskRunAdmission>();\n const resumeBody = async () => {\n /*\n * Refused while THIS process still runs a chain for the task (#1581, fifth review R5-1/R5-2). A\n * run that parked is still registered while its own chain offers the question to the answering\n * agent (#1559). Under single-flight the worktree lock already excludes a person's answer there;\n * a CONCURRENT run holds no lock, so without this a person's resume would take over the chain's\n * registration and settlement, and the chain's ending would delete the one and strand the other.\n * Checked HERE, where it is followed by the registration with nothing awaited in between, and\n * nowhere earlier: a second, earlier check could only ever repeat this one.\n */\n this.refuseWhileRunChainIsLive(taskId);\n // ONE settlement for the whole chain: the resumed turn, and any questions the answering agent\n // then answers under the same hold (#1559) — a caller awaiting it sees the chain's final state.\n const settlement = createDeferred<void>();\n this.applicationCodingTaskSettlements.set(taskId, { promise: settlement.promise, resolve: () => settlement.resolve(undefined) });\n /*\n * Registered for the WHOLE chain, as a dispatched run is (#1581, fourth review A-1): each resume\n * inherits this entry, so an operator's cancel reaches the resumed turn, and a cancel made while\n * the answering agent decides a follow-up question still finds the run rather than \"nothing is\n * running\". Removed when the chain settles.\n */\n this.registerActiveRun({ taskId, startedAt: new Date().toISOString(), abortController: new AbortController(), mode: mode ?? CodingRunConcurrency.SINGLE_FLIGHT });\n let resumed: ParkedRunResume | undefined;\n try {\n resumed = await this.resumeParkedRunHoldingLock({\n taskId,\n executionId,\n suspensionRef,\n checkpoint,\n answer: trimmedAnswer,\n answerSource: expected.answeredByRef?.trim() ? { answeredByRef: expected.answeredByRef.trim() } : {},\n ...(expected.actingUserId ? { actingUserId: expected.actingUserId } : {}),\n verificationPlans,\n sessionContext,\n mode,\n onAdmitted: (admitted) => admission.resolve(admitted),\n });\n // Only a resume that RAN can have parked again: a refused one left the person's question where\n // it was, and it is still theirs, not the answering agent's (#1581, seventh review F5).\n if (resumed.outcome === ParkedRunResumeOutcome.RAN) await this.answerParkedQuestionsHoldingLock(taskId, sessionContext);\n } finally {\n // Awaited ONLY when cancelled: a chain that was not checks and unregisters in one synchronous step,\n // so no cancel can land between the two and be lost (#1581, ninth review R9-4).\n const ending = this.isRunCancelled(taskId) ? await this.withdrawCancelledRunChain(taskId, sessionContext) : null;\n this.unregisterActiveRun(taskId);\n this.applicationCodingTaskSettlements.get(taskId)?.resolve();\n // A resume that never reached the executor answered nobody: the caller is told why, in its own terms.\n admission.reject(this.buildDispatchConflictError(this.describeUnresumedAnswer(taskId, resumed, ending)));\n this.announceRunStateChanged();\n }\n };\n // A run parked from a wave resumes beside it, holding no lock, as it ran (#1528).\n const resumeRun = mode === CodingRunConcurrency.CONCURRENT\n ? resumeBody()\n : withDedicatedFileLock(this.getWorkspaceMutationLockPath(), resumeBody, { retries: { retries: 0 } });\n resumeRun.catch((error: unknown) => {\n admission.reject(this.mapLockError(error));\n this.logDebug('Application coding-task resume run terminated with error', {\n taskId,\n error: describeCaughtError(error),\n });\n });\n\n return admission.promise;\n }\n\n /**\n * Why a person's answer resumed nothing (#1581, seventh review F5; eighth review R8-5), in the terms of\n * what actually happened. A cancel wins over any refusal: the run is withdrawn either way. A held subject\n * leaves the question WAITING, so the person may answer again; only the driver's NOT_SUSPENDED means the\n * question is gone; anything else is a failure to ask, and says so.\n */\n private describeUnresumedAnswer(taskId: string, resumed: ParkedRunResume | undefined, ending: CancelledParkOutcome | null): string {\n if (ending !== null || resumed?.outcome === ParkedRunResumeOutcome.CANCELLED) {\n if (ending === CancelledParkOutcome.STILL_WAITING) {\n return `Coding task ${taskId} was cancelled before your answer could resume it, but its question could not be withdrawn and is still waiting. Cancel it again.`;\n }\n if (ending === CancelledParkOutcome.UNCONFIRMED) {\n return `Coding task ${taskId} was cancelled before your answer could resume it, but the run could not be read to confirm it was withdrawn. Check it, and cancel it again if it is still waiting.`;\n }\n return `Coding task ${taskId} was cancelled before your answer could resume it; it no longer waits, and your answer ran nothing.`;\n }\n if (resumed?.outcome === ParkedRunResumeOutcome.REFUSED) {\n if (isActorExecutionSubjectBusyError(resumed.refusal)) {\n return `Coding task ${taskId} could not be resumed yet: another run holds its worktree. Its question is still waiting — answer again once that run finishes.`;\n }\n if (isActorExecutionNotSuspendedError(resumed.refusal)) {\n return `Coding task ${taskId} could not be resumed: it is no longer awaiting this answer (it was answered, cancelled, or has asked again).`;\n }\n return `Coding task ${taskId} could not be resumed (${describeCaughtError(resumed.refusal)}). Its question is still waiting; answer again.`;\n }\n return `Coding task ${taskId} could not be resumed. Its question is still waiting; answer again.`;\n }\n\n /**\n * The terminal record of a resume a cancel stopped before any turn (#1581, ninth review R9-6): its trace\n * session was opened for a turn that never ran, and must say why it holds nothing else. Best effort.\n */\n private async recordCancelledBeforeTurn(trace: CodingRunTrace, taskRef: string, taskId: string): Promise<void> {\n await trace.traceBestEffort('record-cancelled-before-turn', () => this.traceOperationStart({\n sessionContext: trace.runSession,\n step: trace.runStep,\n type: 'application-coding-task-cancelled-before-turn',\n summary: `Application coding task ${taskRef} was cancelled before its answer resumed a turn`,\n payload: { taskId },\n }));\n }\n\n /** The terminal record of a resume the DRIVER refused before any turn (#1581, tenth review R10-2). Best effort. */\n private async recordResumeRefused(trace: CodingRunTrace, taskRef: string, taskId: string, refusal: unknown): Promise<void> {\n await trace.traceBestEffort('record-resume-refused', () => this.traceOperationStart({\n sessionContext: trace.runSession,\n step: trace.runStep,\n type: 'application-coding-task-resume-refused',\n summary: `Application coding task ${taskRef} could not be resumed: ${describeCaughtError(refusal)}`,\n payload: { taskId },\n }));\n }\n\n /**\n * Refuse (409) to start a person's resume while this process still runs a chain for the task — the\n * park's own chain offering its question to the answering agent (#1559, #1581).\n */\n private refuseWhileRunChainIsLive(taskId: string): void {\n if (!this.activeRuns.has(taskId)) return;\n throw this.buildDispatchConflictError(\n `Coding task ${taskId} is still being handled here: its own run is deciding whether it can answer the question `\n + 'it parked on, or it is being cancelled. Answer once it reports the question as waiting for you.',\n );\n }\n\n /**\n * Continue one parked run with an answer. The CALLER holds the worktree mutation lock (a concurrent\n * run holds none) and owns the run's settlement — which is what lets the answering agent resume a\n * run from inside the hold of the run that parked, without a second acquire (the lock is not\n * re-entrant) and without the build loop taking the worktree in between (#1559).\n *\n * Says how it went ({@link ParkedRunResumeOutcome}); a caller must not treat a refused or cancelled\n * resume as a run that happened.\n */\n private async resumeParkedRunHoldingLock(input: {\n readonly taskId: string;\n readonly executionId: string;\n /** The suspension the answer was read against: the driver refuses a run now waiting on a later one (#1581, seventh review F9). */\n readonly suspensionRef: string;\n readonly checkpoint: ApplicationCodingRunCheckpoint;\n readonly answer: string;\n /** Who answered, for `CODING-ANSWERS.md` — nothing for a person (dead-plan-citation: a file the companion writes). */\n readonly answerSource: { readonly answeredBy?: CodingQuestionAnswerer; readonly basis?: string; readonly answeredByRef?: string };\n /** The signed-in person answering, when one is (#1751) — recorded as the decision's actor. */\n readonly actingUserId?: string;\n readonly verificationPlans: ReturnType<typeof resolveApplicationCodingTaskVerificationPlans>;\n readonly sessionContext?: CompanionExecutionSessionContext;\n readonly mode?: CodingRunConcurrency;\n readonly onAdmitted?: (admitted: ApplicationCodingTaskRunAdmission) => void;\n }): Promise<ParkedRunResume> {\n const { taskId, checkpoint } = input;\n const task = checkpoint.contract;\n const baseline = checkpoint.baseline;\n /*\n * INHERIT the run's registration when there is one (#1581, third review). Answered inside the hold of\n * the run that parked (#1559), the run is still registered, and an operator may have cancelled it\n * while the answering agent was deciding: a fresh controller dropped that cancel and ran the resumed\n * turn anyway. The entry is restored afterwards rather than deleted, so a cancel between chained\n * resumes still finds the run instead of answering \"nothing is running\".\n */\n const inherited = this.activeRuns.get(taskId);\n this.activeRuns.set(taskId, {\n taskId,\n startedAt: inherited?.startedAt ?? new Date().toISOString(),\n abortController: inherited?.abortController ?? new AbortController(),\n mode: input.mode ?? inherited?.mode ?? CodingRunConcurrency.SINGLE_FLIGHT,\n });\n // The resumed turn is coding work in its own right, registered or not around it: it holds the beat.\n this.adjustCodingWorkDepth(taskId, 1);\n this.openCodingRunWindow(taskId, task.taskRef);\n let admitted = false;\n let cancelledAfterAdmission = false;\n let refusal: unknown;\n try {\n // A cancel already made opens no trace for a turn that will not run (#1581, eighth review R8-6).\n if (this.isRunCancelled(taskId)) return { outcome: ParkedRunResumeOutcome.CANCELLED };\n const trace = await this.openCodingRunTrace(taskId, task.taskRef);\n /*\n * The cancel check before a turn starts, for both answerers (#1581, seventh review F3): after the\n * last thing this chain awaits before the driver's resume. A cancel found here starts no turn and\n * spends nothing, and the chain that owns the run withdraws the park. One landing later — inside\n * the driver's own read-and-take — is caught by the executor, which hands the question back.\n */\n if (this.isRunCancelled(taskId)) {\n await this.recordCancelledBeforeTurn(trace, task.taskRef, taskId);\n return { outcome: ParkedRunResumeOutcome.CANCELLED };\n }\n await this.superviseCodingRun(task.taskRef, taskId, trace, async (capture) => {\n try {\n return await this.actorsSystem.resumeActorExecution(\n input.executionId,\n async (opened, resumed) => {\n admitted = true;\n /*\n * A cancel landing inside the driver's own read-and-take (#1581, eighth review R8-7): the rows\n * are PROCESSING already, so the SAME question is handed back — its decision and resume\n * inputs, the task's output left as it was, under a new suspension reference as every\n * suspension gets — and the chain withdraws the park CANCELLED on its way out, like any\n * cancelled park. No answer recorded, no turn started, no attempt spent.\n */\n if (this.isRunCancelled(taskId)) {\n cancelledAfterAdmission = true;\n return capture({\n kind: CodingRunEnding.PARKED,\n suspension: { decision: resumed.suspension.decision, checkpointContext: checkpoint },\n output: undefined,\n afterSettle: () => this.recordCancelledBeforeTurn(trace, task.taskRef, taskId),\n });\n }\n // Admitted HERE, once the engine has moved the rows back to PROCESSING: a resume the\n // driver refuses (somebody answered first) rejects the admission instead of claiming it.\n input.onAdmitted?.({\n taskId,\n status: FlowsActors_Status.PROCESSING,\n taskRef: task.taskRef,\n baselineHeadSha: baseline.headSha,\n baselineDirtyFileCount: Object.keys(baseline.files).length,\n });\n // Started again, announced only NOW that the engine has moved its rows back to PROCESSING:\n // a read that re-derived before that would still see the run as parked.\n this.announceRunStateChanged();\n /*\n * The answer is a DECISION the change set will rest on: recorded beside the build plan\n * before the turn, so a turn that then fails still leaves the decision where a reviewer\n * reads (#1454, Step 6) — and only once the driver ADMITTED the resume, so an answer that\n * resumed nothing is never recorded as one that did (#1581, seventh review F5).\n */\n await this.recordCodingQuestionAnswer(task.taskRef, checkpoint.suspension.question, input.answer, input.answerSource);\n return capture(await this.executeApplicationCodingTask(\n task,\n renderApplicationCodingTaskAgentPrompt(task),\n input.verificationPlans,\n opened,\n baseline,\n trace,\n { continuationOfSessionId: checkpoint.suspension.sessionId, answerPrompt: input.answer, ...(checkpoint.priorLegsUsage ? { priorLegsUsage: checkpoint.priorLegsUsage } : {}) },\n ));\n },\n trace.runSession,\n {\n ...this.codingRunOptions,\n expectedSuspensionRef: input.suspensionRef,\n /*\n * No `restoreSuspensionOnFailure`, and the restart recovery depends on that (#1865): without it the engine\n * writes no continuation marker, so a restart during this turn settles the run ABORTED and reports it, and\n * `recoverInterruptedRunWrites` captures it from the run's original baseline, both turns' writes included.\n * Asking for it would put the run back on its question instead, outside that recovery: a writer with no\n * record whose turn's files no commit names. Pinned by \"a restart during a resumed turn aborts the run\".\n */\n /*\n * The answer, so the status change that ends the wait records its outcome (#1751), whoever\n * answered — the person, or the answering agent (#1559). A coding park is deliberately NOT\n * routed (see where it parks), so `actor` only feeds the record.\n */\n decision: {\n ...(input.actingUserId ? { actor: humanDecisionSettler(input.actingUserId) } : {}),\n answer: {\n decisionId: taskId,\n optionRef: Workbench_ParkedCodingQuestionOptionRef.ANSWER,\n values: [{ ref: WORKBENCH_PARKED_CODING_QUESTION_FIELD_REF, value: input.answer }],\n },\n },\n },\n );\n } catch (error) {\n if (!admitted) refusal = error;\n throw error;\n }\n });\n if (cancelledAfterAdmission) return { outcome: ParkedRunResumeOutcome.CANCELLED };\n if (admitted) return { outcome: ParkedRunResumeOutcome.RAN };\n // The trace opened for this resume holds no turn: it says why (#1581, tenth review R10-2).\n await this.recordResumeRefused(trace, task.taskRef, taskId, refusal);\n return { outcome: ParkedRunResumeOutcome.REFUSED, refusal };\n } finally {\n this.endCodingRunWindow(taskId);\n if (inherited) this.activeRuns.set(taskId, inherited);\n else this.activeRuns.delete(taskId);\n this.adjustCodingWorkDepth(taskId, -1);\n // NOT announced here: this runs inside a chain its CALLER settles (`resumeBody`, or a fresh run\n // answering its parked questions), and that caller announces once the whole chain has settled.\n }\n }\n\n /**\n * Offer a run's parked question to the ANSWERING AGENT before it reaches the creator (#1559), and\n * keep doing so while the run parks again on a question the agent can answer.\n *\n * Runs inside the worktree hold of the run that parked, BEFORE that run's settlement resolves: the\n * build loop waits on the settlement, so it sees the chain's final outcome, and it cannot take the\n * worktree between the park and the answer — a race that would send answerable questions to a person\n * for no reason.\n *\n * Bounded three ways, all in `decideAgentAnswerAttempt`: the posture (GUIDED keeps every question with\n * the person), one verdict per question, and {@link MAXIMUM_AGENT_ANSWERS_PER_RUN} answers per run.\n * Every verdict is written to the run's task memory BEFORE anything acts on it, so a wrong\n * self-answer can be audited and a restart cannot ask the same question twice — except a verdict the\n * agent reaches after an operator cancelled the run, which is dropped: it would record an answer\n * nothing applied.\n *\n * Never fails the run. A refusal, a failed model call, an unparseable answer or a resume the driver\n * refused leaves the park as it was, and the question reaches the creator. A CANCEL is the one\n * exception, and it is not handled here: whichever way this returns, the chain that owns the run\n * withdraws a cancelled park when it ends ({@link withdrawCancelledRunChain}).\n */\n private async answerParkedQuestionsHoldingLock(taskId: string, sessionContext?: CompanionExecutionSessionContext): Promise<void> {\n try {\n for (;;) {\n // A cancel stops the handling at once: no model call is spent on a run that is ending (#1581).\n if (this.isRunCancelled(taskId)) return;\n const parked = await this.readParkedCodingRun(taskId, sessionContext);\n if (!parked || !parked.checkpoint.suspension.resumable) return;\n const row = await this.executionsService.getActorTask(taskId, sessionContext);\n const question = parked.checkpoint.suspension.question;\n const decision = decideAgentAnswerAttempt({\n posture: APPLICATION_CREATION_AUTONOMY_POSTURE,\n question,\n priorRecords: readParkedQuestionAnswers(row.memory),\n });\n if (decision !== AgentAnswerAttemptDecision.ATTEMPT) {\n this.logDebug('Parked question left for the creator', { taskId, decision });\n return;\n }\n const task = parked.checkpoint.contract;\n const agentOutputTail = String((row.output as { agentOutputTail?: unknown } | undefined)?.agentOutputTail ?? '');\n const output = await this.askAnsweringAgent({ brief: renderApplicationCodingTaskAgentPrompt(task), question, agentOutputTail });\n if (!output) return;\n // Cancelled while the agent decided: its verdict is NOT recorded — it would describe an answer never applied.\n if (this.isRunCancelled(taskId)) return;\n const answer = output.verdict === ParkedQuestionAnswerVerdict.ANSWERED ? output.answer.trim() : '';\n const record: ParkedQuestionAnswerRecord = {\n // An `answered` with no answer is not an answer; the creator is asked.\n verdict: answer.length > 0 ? ParkedQuestionAnswerVerdict.ANSWERED : ParkedQuestionAnswerVerdict.PRODUCT_DECISION,\n question,\n answer,\n basis: output.basis.trim(),\n decidedAt: new Date().toISOString(),\n };\n await this.executionsService.updateActorTask(taskId, { memory: withParkedQuestionAnswer(row.memory, record) }, sessionContext);\n this.logger.info('The answering agent returned a verdict on a parked coding question', {\n taskId, taskRef: task.taskRef, verdict: record.verdict,\n });\n if (record.verdict !== ParkedQuestionAnswerVerdict.ANSWERED) return;\n const resumed = await this.resumeParkedRunHoldingLock({\n taskId,\n executionId: parked.executionId,\n suspensionRef: parked.suspensionRef,\n checkpoint: parked.checkpoint,\n answer,\n answerSource: { answeredBy: CodingQuestionAnswerer.ANSWERING_AGENT, basis: record.basis },\n verificationPlans: resolveApplicationCodingTaskVerificationPlans(task.verificationIntent.requiredChecks),\n sessionContext,\n mode: parked.mode,\n });\n // Only a resume that RAN can have parked again on a question worth offering.\n if (resumed.outcome !== ParkedRunResumeOutcome.RAN) return;\n }\n } catch (error) {\n this.logger.warn('The answering agent could not handle a parked coding question; it goes to the creator unless the run was cancelled', {\n taskId,\n error: describeCaughtError(error),\n });\n }\n }\n\n /** Whether an operator cancelled the run this process is handling for `taskId`. */\n private isRunCancelled(taskId: string): boolean {\n return this.activeRuns.get(taskId)?.abortController.signal.aborted === true;\n }\n\n /**\n * End a run an operator cancelled while its chain was handling it (#1581, sixth to tenth reviews): a run\n * PARKED at this point is withdrawn, `CANCELLED`, \"the person chose not to continue\". Called from each\n * chain's ONE exit path, and only when the chain was cancelled, so no way of leaving the question handling\n * (a refusal, a failed or unparseable model call, a resume the driver refused) leaves a cancelled run\n * parked. The withdraw is recorded on the entry, which stays registered until the caller deletes it, so a\n * person's answer is refused until it is done and a second cancel answers with its outcome. A\n * `CANCELLED` run is no attempt of the task's.\n */\n private withdrawCancelledRunChain(taskId: string, sessionContext?: CompanionExecutionSessionContext): Promise<CancelledParkOutcome> {\n const entry = this.activeRuns.get(taskId);\n const withdrawal = this.endParkIfWaiting(taskId, sessionContext, entry ? this.cancellersByController.get(entry.abortController) : undefined);\n if (entry) entry.withdrawal = withdrawal;\n return withdrawal;\n }\n\n /**\n * Withdraw the task's park if one is waiting — `CANCELLED` — and say what became of it. Reads STRICTLY,\n * so a store that cannot be read is reported as UNCONFIRMED rather than as \"nothing was waiting\"\n * (#1581, tenth review R10-1). Never throws: its callers run in a `finally` or answer a person.\n */\n private async endParkIfWaiting(\n taskId: string,\n sessionContext?: CompanionExecutionSessionContext,\n /** Who withdrew it (#1751), when a signed-in person did: recorded as the decider of the withdrawn question. */\n withdrawnByUserId?: string,\n ): Promise<CancelledParkOutcome> {\n try {\n const parked = await this.readParkedCodingRun(taskId, sessionContext, { strict: true });\n if (!parked) return CancelledParkOutcome.ENDED;\n await this.actorsSystem.cancelSuspendedActorExecution(parked.executionId, sessionContext,\n withdrawnByUserId ? { decision: { actor: humanDecisionSettler(withdrawnByUserId) } } : undefined);\n this.logDebug('A cancelled coding run was withdrawn from its park', { taskId, executionId: parked.executionId });\n return CancelledParkOutcome.ENDED;\n } catch (error) {\n this.logger.warn('A cancelled coding run could not be withdrawn from its park', { taskId, error: describeCaughtError(error) });\n try {\n // Refused because it is no longer waiting (withdrawn meanwhile) ends it as surely as withdrawing it.\n return (await this.readParkedCodingRun(taskId, sessionContext, { strict: true })) ? CancelledParkOutcome.STILL_WAITING : CancelledParkOutcome.ENDED;\n } catch {\n return CancelledParkOutcome.UNCONFIRMED;\n }\n }\n }\n\n /** ONE structured call to the answering agent; `null` when it produced nothing usable, which leaves the question with the creator. */\n private async askAnsweringAgent(input: { readonly brief: string; readonly question: string; readonly agentOutputTail: string }): Promise<ParkedQuestionAnswerOutput | null> {\n const invocation: FlowsActors_Agent_Invocation<any, any> = {\n agentRef: PARKED_QUESTION_ANSWERER_AGENT_REF,\n initiator: {},\n invocationContext: [],\n input: { prompt: renderParkedQuestionAnswerPrompt(input), schema: ParkedQuestionAnswerOutputSchema },\n output: { object: {} },\n executionContext: {},\n artifactBindings: [],\n };\n const response = await this.agentsService.invokeAgent(invocation);\n const parsed = ParkedQuestionAnswerOutputSchema.safeParse((response.output as { object?: unknown } | undefined)?.object);\n return parsed.success ? parsed.data : null;\n }\n\n private buildApplicationCodingTaskTraceSummary(task: MetaWorkflow_ApplicationCodingTaskContract): Record<string, unknown> {\n return {\n taskRef: task.taskRef,\n objectiveRef: task.objectiveRef,\n candidateRef: task.candidateRef,\n mutationScope: task.mutationScope,\n contextPlanRef: task.contextPlan.planRef,\n selectedSourceRefs: task.contextSelection.selectedSources.map((source) => source.sourceRef),\n verificationRef: task.verificationIntent.verificationRef,\n requiredChecks: task.verificationIntent.requiredChecks,\n installedSkillRefs: task.installedSkillRefs,\n };\n }\n\n // ================================================================\n // Verification hook (P-29c — enum vocabulary, never a command string)\n // ================================================================\n\n /**\n * An argv check (a typecheck, a test path, a package build) run by its command's bare name, `pnpm` say. A command that\n * cannot be spawned is an absent tool (#3423 review F7), never a red check: read as a failed outcome it was \"already red\n * at baseline\", so the run's own failure was carried and the task landed unverified. Thrown here, it is unrun at both\n * passes, so the failure is the host's and the verification tool hold stops every later admission.\n */\n private async runArgvVerification(kind: VerificationKind, requestedPath: string | undefined): Promise<VerificationOutcome> {\n const plan = this.buildVerificationPlan(kind, requestedPath);\n const outcome = await this.runVerification(plan);\n refuseWhenVerificationToolIsAbsent(outcome, { command: plan.command, checking: `run ${plan.command} ${plan.args.join(' ')}` });\n return outcome;\n }\n\n private buildVerificationPlan(kind: VerificationKind, requestedPath?: string): VerificationPlan {\n if (kind === VerificationKind.VITEST_PATH) {\n const sanitized = this.sanitizeRelativePath(requestedPath ?? '');\n const absoluteTestPath = join(this.companionContext.saasRoot, sanitized);\n const packageDir = this.findNearestPackageDir(dirname(absoluteTestPath));\n return {\n kind,\n path: sanitized,\n command: 'pnpm',\n args: ['exec', 'vitest', 'run', relative(packageDir, absoluteTestPath)],\n cwd: packageDir,\n };\n }\n\n // PACKAGE_BUILD — the package's own build script, in the package (#2228).\n if (kind === VerificationKind.PACKAGE_BUILD) {\n const sanitizedPackage = this.sanitizeRelativePath(requestedPath ?? '');\n return {\n kind,\n path: sanitizedPackage,\n command: 'pnpm',\n args: ['run', 'build'],\n cwd: join(this.companionContext.saasRoot, sanitizedPackage),\n };\n }\n\n // TYPECHECK — optional path points at a workspace package directory.\n const sanitized = requestedPath ? this.sanitizeRelativePath(requestedPath) : null;\n return {\n kind,\n path: sanitized,\n command: 'pnpm',\n args: ['exec', 'tsc', '--noEmit'],\n cwd: sanitized ? join(this.companionContext.saasRoot, sanitized) : this.companionContext.saasRoot,\n };\n }\n\n /**\n * The FK-resolution sweep, sourced from the `resources-registry` introspection\n * behavior — a FRESH subprocess import of the app's shared-lib, never the\n * companion's boot-time cache, so it judges exactly the bytes the mutation\n * left on disk. Fails the check when any `.isForeignKey()` field has no\n * registered relationship edge: invisible to every typecheck in the plan and\n * to the backend boot, fatal to the app's frontend at first page load\n * (`frontend_fk_resolution_failed` — wonder-crm, 2026-08-27).\n */\n private async runForeignKeyResolutionVerification(): Promise<VerificationOutcome> {\n const backendServiceKey = Object.entries(this.companionContext.servicesByKey)\n .find(([, service]) => !service.frontendType)?.[0];\n if (!backendServiceKey) {\n throw new Error('No backend service is available to run the frontend-fk-resolution verification.');\n }\n const result = await this.introspectionService.requestInfo({\n serviceKey: backendServiceKey,\n behavior: 'resources-registry',\n });\n if (!result.success) {\n throw new Error(`resources-registry introspection failed: ${JSON.stringify(result)}`);\n }\n const unresolved = (result.data as { unresolvableForeignKeyFields?: Array<{ resourceType: string; fieldName: string }> })\n .unresolvableForeignKeyFields ?? [];\n const success = unresolved.length === 0;\n return {\n kind: VerificationKind.FRONTEND_FK_RESOLUTION,\n path: null,\n success,\n message: success\n ? 'every isForeignKey() field resolves through a registered relationship'\n : `${unresolved.length} FK field(s) cannot be resolved to a resource type: `\n + unresolved.map(({ resourceType, fieldName }) => `${resourceType}.${fieldName}`).join(', ')\n + ' — declare a relationship with the corresponding foreignKeyField.',\n stdoutTail: '',\n stderrTail: '',\n };\n }\n\n /**\n * The settings-rail content sweep — the SHELL_PLACEMENT counterpart of the FK sweep,\n * and it exists for the same reason: the defect it catches is invisible to a typecheck.\n *\n * A placement naming a `destinationRef` the engine catalog does not ship is not a type\n * error. `resolveSettingsHubConfig` DROPS it, and the section silently never renders —\n * so a coding task that typo'd a ref passes `check:app-typecheck`, reports verified, and\n * leaves the application missing a settings section nobody is told about.\n *\n * WARNINGS do not fail the check. Only errors do: the verifier reports both severities,\n * and failing a coding task on an advisory would train the lane to ignore its own gate.\n */\n private async runSettingsPlacementContentVerification(): Promise<VerificationOutcome> {\n // Mirrors the FK sweep's resolution, on the other side of the same predicate: that\n // one wants a backend service, this one a FRONTEND service, because the settings rail\n // is authored in the frontend workspace and only that subprocess can import it.\n const frontendServiceKey = Object.entries(this.companionContext.servicesByKey)\n .find(([, service]) => service.frontendType)?.[0];\n if (!frontendServiceKey) {\n throw new Error('No frontend service is available to run the settings-placement-content verification.');\n }\n const result = await this.introspectionService.requestInfo({\n serviceKey: frontendServiceKey,\n behavior: 'settings-placement-content',\n });\n if (!result.success) {\n throw new Error(`settings-placement-content introspection failed: ${JSON.stringify(result)}`);\n }\n const data = result.data as {\n authored?: boolean;\n errors?: Array<{ severity: string; code: string; message: string }>;\n };\n const blocking = (data.errors ?? []).filter((error) => error.severity !== 'warning');\n /*\n * The rail the introspection judged is the one the companion export imports; the runtime receives it only as\n * `settingsHub` in `frontendBaseConfig` (#3101). A task that dropped that line passed this check, every test and the\n * typecheck, and Settings opened empty (#3100). Read as text, by the predicate `wildo local doctor` uses.\n */\n const hubPath = join(this.companionContext.saasRoot, FRONTEND_SETTINGS_HUB_CONFIG_RELATIVE_PATH);\n const registryPath = join(this.companionContext.saasRoot, FRONTEND_MODULES_REGISTRY_RELATIVE_PATH);\n const runtimeWiringRefusal = existsSync(hubPath) && existsSync(registryPath) && settingsHubConfigAuthorsRail(readFileSync(hubPath, 'utf8'))\n && !frontendRegistryPassesSettingsHub(readFileSync(registryPath, 'utf8'))\n ? `${FrontendSettingsHubWiringFindingCode.SETTINGS_HUB_NOT_PASSED_TO_RUNTIME}: ${FRONTEND_MODULES_REGISTRY_RELATIVE_PATH} does not pass the authored rail to the running frontend (\\`settingsHub: settingsHubConfig\\` in \\`frontendBaseConfig\\`), so Settings opens as an empty dialog`\n : undefined;\n const success = blocking.length === 0 && runtimeWiringRefusal === undefined;\n return {\n kind: VerificationKind.SETTINGS_PLACEMENT_CONTENT,\n path: null,\n success,\n message: success\n ? 'every authored placement names a destination the engine ships'\n // An application with no authored rail fails with `SETTINGS_HUB_EMPTY`: the engine places no hub of its own,\n // so Settings would open empty (#3100). Saying that nothing was authored names the remedy.\n : (data.authored === false ? 'no settings rail is authored, so Settings opens as an empty dialog. ' : '')\n + [\n ...(blocking.length > 0 ? [`${blocking.length} settings-placement error(s): ${blocking.map((error) => `${error.code}: ${error.message}`).join(' | ')}`] : []),\n ...(runtimeWiringRefusal !== undefined ? [runtimeWiringRefusal] : []),\n ].join(' | '),\n stdoutTail: '',\n stderrTail: '',\n };\n }\n\n /**\n * The schema-plan drift gate — `wildo db diff --check` at the application root.\n *\n * ## Why it is not simply another argv plan\n *\n * The other CLI checks answer a two-valued question about a package that always exists.\n * This one has THREE outcomes, and collapsing any of them into \"failed\" would fail runs\n * on a question nobody asked:\n *\n * 1. **No committed lockfile** — answered here, from the application's DECLARED store\n * (`ApplicationSchemaPlanObligation`, #1144), because `wildo db diff --check` exits\n * non-zero for every application without one. A MongoDB application is permanently in\n * this state (a collection exists on first write; there is no plan to drift from): a\n * pass that says it checked nothing. A PostgreSQL application in it has had no\n * migration create its tables and cannot boot: a FAILED check naming the initial\n * `wildo db generate`. A store that cannot be read is \"we could not ask\": it THROWS.\n * 2. **No `backend-api/dist`** — the model is computed by IMPORTING the compiled\n * modules registry, and the build lane only ever runs `tsc --noEmit`, which emits\n * nothing. This is \"we could not ask\", not \"the application has drifted\", so it\n * THROWS and is reported as an infrastructure error. Same distinction this playbook's\n * method already draws for the typechecks, and the same reasoning\n * `reconcileDevelopmentSchemaDrift` uses when it SKIPS on a stale model rather than\n * generating a migration for a model nobody has.\n * 3. **Both present** — the spawn decides, and its own message is carried through: it\n * names the drifted tables and the command that fixes them, which is more than this\n * layer could reconstruct.\n *\n * ## Why the check is worth having at all\n *\n * It is the only check in the catalog that can see a missing table. A resource whose\n * migration was never generated typechecks green in every package and then refuses\n * to boot with `postgresql_table_schema_mismatch` — measured 2026-09-07, when an engine\n * resource landed with migrations for two of the three PostgreSQL-backed applications\n * and the third crash-looped until a human read the log.\n */\n private async runSchemaPlanDriftVerification(): Promise<VerificationOutcome> {\n const saasRoot = this.companionContext.saasRoot;\n const assessment = await assessApplicationSchemaPlanObligation(saasRoot);\n if (assessment.obligation === ApplicationSchemaPlanObligation.NOT_OWED) {\n return {\n kind: VerificationKind.SCHEMA_PLAN_DRIFT,\n path: null,\n success: true,\n // Says it checked NOTHING rather than reporting a clean plan — the same honesty the\n // settings-placement sweep applies to an application with no authored rail.\n message: `no schema-plan lockfile, and ${assessment.declaredIn} does not declare PostgreSQL — this application has not adopted migrations, so there is no accepted plan to drift from (every MongoDB application is in this state permanently)`,\n stdoutTail: '',\n stderrTail: '',\n };\n }\n if (assessment.obligation === ApplicationSchemaPlanObligation.BASELINE_OWED) {\n /*\n * A FAILED check, not a pass (#1144). Until then no lockfile read as \"not adopted\" whatever the store,\n * so a PostgreSQL application whose initial migration was never generated verified green here — the\n * one check in the catalog that can see a missing table, answering for the one application that has\n * none of them.\n */\n return {\n kind: VerificationKind.SCHEMA_PLAN_DRIFT,\n path: null,\n success: false,\n message: `no schema-plan baseline, but ${assessment.declaredIn} declares PostgreSQL — no migration has created this application's tables, so its backend cannot boot. Generate the initial migration with \\`wildo db generate --name initial-schema\\` (it writes the baseline in the same invocation) and commit both.`,\n stdoutTail: '',\n stderrTail: '',\n };\n }\n if (assessment.obligation === ApplicationSchemaPlanObligation.UNDETERMINED) {\n // Infrastructure, not drift: nothing about the model was asked.\n throw new Error(`Cannot check schema-plan drift: there is no schema-plan lockfile and ${assessment.reason}.`);\n }\n\n const modulesRegistryPath = join(saasRoot, 'backend-api', 'dist', 'modules-registry.backend.js');\n if (!existsSync(modulesRegistryPath)) {\n // THROWN on purpose: `executeVerificationPlans` classifies a throw as an infrastructure\n // error and reports it apart from a failing check. A `success: false` here would say the\n // application has drifted, which is a claim about a model that was never computed.\n throw new Error(\n `Cannot check schema-plan drift: ${modulesRegistryPath} does not exist. The plan is computed by importing `\n + \"the compiled backend registry, and this build never emitted one (`tsc --noEmit` does not). Build backend-api, \"\n + 'or run this check under `wildo local dev`, whose watcher maintains that dist.',\n );\n }\n\n const outcome = await this.runVerification({\n kind: VerificationKind.SCHEMA_PLAN_DRIFT,\n path: null,\n command: 'wildo',\n args: ['db', 'diff', '--check'],\n cwd: saasRoot,\n });\n // The CLI is a GLOBAL install (`platform/factory/scripts/install.sh`) and is not linked\n // into an application's `node_modules/.bin` — verified on both dogfood applications. So\n // \"wildo is not on PATH\" is an absent tool, never a drifted schema.\n refuseWhenVerificationToolIsAbsent(outcome, { command: 'wildo', checking: 'check schema-plan drift', absent: /ENOENT|not found/i });\n /*\n * COULD NOT ASK is not DRIFT, and `wildo db diff --check` cannot tell them apart by exit code —\n * it answers `{ success: false }` for both (`diff.command.ts`), so the message is the only\n * discriminator, exactly as it already is for the ENOENT case above.\n *\n * `computeCurrentLockfileJson` refuses before planning whenever the compiled model is STALE —\n * \"shared-lib/dist is older than its sources … This is NOT drift: wait for the watcher to\n * rebuild\" — or when `backend-api/dist` is absent. Reported as a failing check, both read as\n * \"this application has drifted\", which is a claim about a model that was never computed. On a\n * per-task check that matters twice over: the check runs seconds after an agent wrote the very\n * sources the watcher is still compiling, so the race is the COMMON case rather than the edge.\n *\n * Thrown, like every other infrastructure absence here, so `executeVerificationPlans` reports it\n * apart from a failing check and a BASELINE pass cannot read it as \"already broken\".\n */\n if (!outcome.success && /Cannot compute the current schema plan/i.test(`${outcome.stdoutTail}\\n${outcome.stderrTail}`)) {\n throw new Error(\n 'Cannot check schema-plan drift: the CLI refused to compute the current plan, so nothing about the model was '\n + `asked. This is NOT drift. ${outcome.stderrTail.trim() || outcome.stdoutTail.trim()}`,\n );\n }\n return outcome;\n }\n\n /**\n * The specifications package EVALUATED, as the companion evaluates it (#3210, #3211). Each specification whose\n * factory refuses its definition fails the check with the validator's own message, which names the field and the\n * remedy, so the run's repair has the sentence it needs. Asked through the companion's own data door, which holds an\n * evaluation only while the tree's signature does, so the answer is about the tree the run left.\n *\n * A module that cannot be evaluated (#3258) — every other module still serves, so the package does not fail as a\n * whole — fails the check when a root cause is the module's own (`AUTHORING_ERROR`: an authored throw, a factory\n * outside the refusal capture refusing, a file that does not parse), named with its error.\n *\n * \"Could not ask\" THROWS, so the check is reported unrun rather than failed: root causes that a stale build may\n * explain (`POSSIBLY_STALE_BUILD`, `specificationModuleFaultsAreAVerdict`), and an entry that failed the same way, or\n * whose evaluation never answered at all. A refusal beside them is named but decides nothing: a factory refuses what a\n * stale build gave it as readily as what an author wrote. Those messages carry both readings and the frame to open\n * (`describeSpecificationsLoadFailure`, `describeSpecificationModuleFault`); a baseline pass must not read them as\n * \"already broken\", and a post-run pass attributes them to the host.\n */\n private async runSpecificationExportsVerification(): Promise<VerificationOutcome> {\n const findings = await readSpecificationsEvaluationFindings(this.companionContext);\n /*\n * And each documentation chapter FILE (#3204), which nothing imports, so the package's evaluation above never sees it.\n * A chapter file imports only framework packages, so a fault here is the file's own: always a verdict.\n */\n const packageRoot = this.companionContext.resolvedSpecifications?.packageRoot;\n const chapterFileFaults = packageRoot === undefined ? [] : await findApplicationDocumentationChapterFileFaults(packageRoot);\n const describeModule = (fault: (typeof findings.moduleFaults)[number]): string => describeApplicationSpecificationModuleFault(fault, this.companionContext);\n const refused = findings.faults.length === 0 ? [] : [`${findings.faults.length} specification(s) refused: ${findings.faults.map(describeSpecificationDefinitionFault).join(' | ')}`];\n const isVerdict = findings.moduleFaults.length > 0\n ? specificationModuleFaultsAreAVerdict(findings.moduleFaults)\n : findings.loadError === null || findings.loadErrorReading === SpecificationModuleFaultReading.AUTHORING_ERROR;\n if (!isVerdict) {\n throw new Error(findings.loadError !== null\n ? `Cannot evaluate the specifications package, so no specification was asked about: ${findings.loadError}`\n : `Cannot evaluate ${findings.moduleFaults.length} specifications module(s), so no specification was asked about: ${[...findings.moduleFaults.map(describeModule), ...refused].join(' | ')}`);\n }\n const success = findings.loadError === null && findings.faults.length === 0 && findings.moduleFaults.length === 0 && chapterFileFaults.length === 0;\n return {\n kind: VerificationKind.SPECIFICATION_EXPORTS,\n path: null,\n success,\n message: success\n ? 'every specification the package declares is admitted by its factory'\n : findings.loadError !== null\n ? [`the specifications package cannot be evaluated: ${findings.loadError}`, ...chapterFileFaults].join(' | ')\n : [...findings.moduleFaults.map(describeModule), ...refused, ...chapterFileFaults].join(' | '),\n ...(success ? {} : {\n failureFindings: [\n ...(findings.loadError === null ? [] : [`entry:${findings.loadError}`]),\n ...findings.moduleFaults.filter((fault) => fault.causedBy.length === 0).map((fault) => `module:${fault.modulePath}:${fault.message}`),\n ...findings.faults.map((fault) => `refused:${fault.kind}:${fault.key}:${fault.message}`),\n ...chapterFileFaults.map((fault) => `chapter-file:${fault}`),\n ],\n }),\n stdoutTail: '',\n stderrTail: '',\n };\n }\n\n /**\n * `wildo config check-resources` at the application root (#2404): the resources registry built offline, as the\n * backend's startup builds it. A refusal fails the check with the factory's own message, which names the resource.\n *\n * \"Could not ask\" — a compiled model older than its sources (the common case seconds after an agent wrote them), an\n * absent backend dist, a runner that crashed, an absent CLI — THROWS, so it is reported unrun, never as a\n * configuration the backend refuses. The CLI marks it with {@link RESOURCES_REGISTRY_COULD_NOT_ASK_MARKER}.\n */\n private async runResourcesRegistryInitVerification(): Promise<VerificationOutcome> {\n const outcome = await this.runVerification({\n kind: VerificationKind.RESOURCES_REGISTRY_INIT,\n path: null,\n command: 'wildo',\n args: ['config', 'check-resources'],\n cwd: this.companionContext.saasRoot,\n });\n refuseWhenVerificationToolIsAbsent(outcome, { command: 'wildo', checking: 'check the resources registry' });\n /*\n * A `wildo` older than this companion does not know the verb and answers \"Unknown command\" (#2404 review F9): an\n * absent tool, like ENOENT, never a configuration the backend refuses.\n */\n if (!outcome.success && /Unknown command/iu.test(`${outcome.message}\\n${outcome.stdoutTail}\\n${outcome.stderrTail}`)) {\n // A host cause that will not clear on its own (#3432): it holds admissions until the command answers the verb.\n throw new VerificationToolUnavailableError(\n 'wildo',\n `Cannot check the resources registry: the installed \\`wildo\\` CLI does not know \\`config check-resources\\` (update it). ${outcome.stderrTail.trim() || outcome.stdoutTail.trim()}`,\n { verbProbeArgs: ['config', 'check-resources', '--help'] },\n );\n }\n if (!outcome.success && `${outcome.stdoutTail}\\n${outcome.stderrTail}`.includes(RESOURCES_REGISTRY_COULD_NOT_ASK_MARKER)) {\n throw new Error(`${outcome.stderrTail.trim() || outcome.stdoutTail.trim()} This is NOT a refused configuration.`);\n }\n return outcome;\n }\n\n /**\n * `wildo config validate` at the application root (#2228): the checks the backend runs at startup, asked without\n * starting it. Errors fail the check (the backend would refuse to boot); warnings do not.\n *\n * The CLI is a global install and is not linked into an application's `node_modules/.bin`, so a missing binary is\n * thrown as \"we could not ask\" — exactly as the schema-plan drift check does — never reported as a configuration\n * that fails.\n */\n private async runConfigValidateVerification(): Promise<VerificationOutcome> {\n const outcome = await this.runVerification({\n kind: VerificationKind.CONFIG_VALIDATE,\n path: null,\n command: 'wildo',\n args: ['config', 'validate'],\n cwd: this.companionContext.saasRoot,\n });\n // ENOENT only: a configuration error can itself say \"not found\" (a referenced file, a provider), and that is a\n // failing configuration, not an absent tool.\n refuseWhenVerificationToolIsAbsent(outcome, { command: 'wildo', checking: 'validate the application configuration' });\n return outcome;\n }\n\n /**\n * `wildo design-tokens contrast <frontend>` at the application root (#2351): every colour pair the framework draws,\n * measured on the palette the design-system config paints under its theme. Its output — one finding per failing\n * pair, naming both colours, the ratio and the bar — is the outcome's tail, which reaches the coding agent verbatim.\n *\n * A missing CLI is thrown as \"we could not ask\", exactly as `config validate` does, never reported as a palette\n * that fails.\n */\n private async runDesignSystemContrastVerification(frontendPath: string): Promise<VerificationOutcome> {\n const outcome = await this.runVerification({\n kind: VerificationKind.DESIGN_SYSTEM_CONTRAST,\n path: frontendPath,\n command: 'wildo',\n args: ['design-tokens', 'contrast', frontendPath],\n cwd: this.companionContext.saasRoot,\n });\n refuseWhenVerificationToolIsAbsent(outcome, { command: 'wildo', checking: 'measure the palette\\'s contrast' });\n return outcome;\n }\n\n /**\n * `wildo design-tokens contract <frontend>` at the application root (#2359): the theme the design-system config\n * declares, checked against the theme contract after the exceptions it carries. Its output — one finding per broken\n * rule, naming the recipe — is the outcome's tail, which reaches the coding agent verbatim. A missing CLI is thrown\n * as \"we could not ask\", as for the contrast check.\n */\n private async runDesignSystemContractVerification(frontendPath: string): Promise<VerificationOutcome> {\n const outcome = await this.runVerification({\n kind: VerificationKind.DESIGN_SYSTEM_CONTRACT,\n path: frontendPath,\n command: 'wildo',\n args: ['design-tokens', 'contract', frontendPath],\n cwd: this.companionContext.saasRoot,\n });\n refuseWhenVerificationToolIsAbsent(outcome, { command: 'wildo', checking: 'check the theme contract' });\n return outcome;\n }\n\n /**\n * `wildo design-tokens brand <frontend>` at the application root (#2818): when the build generated `brand-design.ts`\n * beside the design-system config, the config's theme must be the one composed from the brand's point and its palette\n * the brand's. Its output — one finding per departure, naming the composition expected — is the outcome's tail, which\n * reaches the coding agent verbatim. An application with no `brand-design.ts` passes. A missing CLI, or a generated\n * `brand-design.ts` the CLI cannot load (which the agent cannot repair), is thrown as \"we could not ask\".\n *\n * The CLI also advises, without failing, on each axis the website's theme sets away from the brand. Those lines are\n * lifted onto `advisories` and into a passing message, because a passing check's output is read by nobody.\n */\n private async runDesignSystemBrandVerification(frontendPath: string): Promise<VerificationOutcome> {\n const outcome = await this.runVerification({\n kind: VerificationKind.DESIGN_SYSTEM_BRAND,\n path: frontendPath,\n command: 'wildo',\n args: ['design-tokens', 'brand', frontendPath],\n cwd: this.companionContext.saasRoot,\n });\n refuseWhenVerificationToolIsAbsent(outcome, { command: 'wildo', checking: 'check the brand composition' });\n const lines = `${outcome.stdoutTail}\\n${outcome.stderrTail}`.split('\\n');\n const couldNotAsk = lines.find((line) => line.includes(DESIGN_SYSTEM_BRAND_COULD_NOT_ASK_MARKER));\n if (!outcome.success && couldNotAsk !== undefined) {\n throw new Error(`Cannot check the brand composition: ${couldNotAsk.slice(couldNotAsk.indexOf(DESIGN_SYSTEM_BRAND_COULD_NOT_ASK_MARKER)).trim()}`);\n }\n const advisories = lines\n .filter((line) => line.includes(DESIGN_SYSTEM_BRAND_ADVISORY_MARKER))\n .map((line) => line.slice(line.indexOf(DESIGN_SYSTEM_BRAND_ADVISORY_MARKER)).trim());\n if (advisories.length === 0) return outcome;\n return { ...outcome, advisories, ...(outcome.success ? { message: `${outcome.message} — ${advisories.join(' ')}` } : {}) };\n }\n\n /**\n * Ask the RUNNING backend whether it is ready (#2228), at the address the frontend uses (`VITE_API_BASE_URL` in\n * `frontend/.env`, written by config sync). Bounded by {@link BACKEND_READY_TIMEOUT_MS}: an outbound request with no\n * deadline waits for a peer that never answers.\n *\n * No address, or no answer, THROWS — \"we could not ask\", reported apart from a failing check: from here a backend\n * that was never started and one crash-looping at boot are the same closed port, and neither may read as a pass.\n */\n private async runBackendReadyVerification(): Promise<VerificationOutcome> {\n const envPath = join(this.companionContext.saasRoot, 'frontend', '.env');\n const apiBase = existsSync(envPath) ? /^VITE_API_BASE_URL=(.*)$/mu.exec(readFileSync(envPath, 'utf8'))?.[1]?.trim() : undefined;\n if (apiBase === undefined || apiBase === '') {\n throw new Error(`Cannot ask whether the backend is ready: ${envPath} declares no VITE_API_BASE_URL. Run \\`wildo config sync\\`.`);\n }\n const url = `${apiBase.replace(/\\/+$/u, '')}/health/ready`;\n let response: Response;\n try {\n response = await fetch(url, { signal: AbortSignal.timeout(BACKEND_READY_TIMEOUT_MS) });\n } catch (error) {\n throw new Error(`Cannot ask whether the backend is ready: ${url} did not answer (${describeCaughtError(error)}). It is not running, or it is crash-looping at boot; its log says which.`);\n }\n const body = (await response.text().catch(() => '')).slice(-OUTPUT_TAIL_CHARS);\n return {\n kind: VerificationKind.BACKEND_READY,\n path: null,\n success: response.status === 200,\n message: response.status === 200 ? `${url} answered 200` : `${url} answered ${response.status}: the backend is up and refuses readiness`,\n stdoutTail: body,\n stderrTail: '',\n };\n }\n\n /**\n * `wildo local smoke --json` (#2228): the CLI drives a browser through the running application and prints one JSON\n * verdict. PASSED passes, FAILED fails with the CLI's summary and the broken pages; COULD_NOT_ASK, a verdict that\n * cannot be read, or a CLI that cannot be executed THROWS — \"we could not ask\", reported apart from a failing check,\n * because the application was never seen.\n */\n private async runBrowserSmokeVerification(): Promise<VerificationOutcome> {\n const outcome = await this.runVerification({\n kind: VerificationKind.BROWSER_SMOKE,\n path: null,\n command: 'wildo',\n args: ['local', 'smoke', '--json'],\n cwd: this.companionContext.saasRoot,\n });\n refuseWhenVerificationToolIsAbsent(outcome, { command: 'wildo', checking: 'run the browser smoke' });\n const lastLine = outcome.stdoutTail.trim().split('\\n').pop() ?? '';\n let verdict: { outcome?: string; summary?: string };\n try {\n verdict = JSON.parse(lastLine) as { outcome?: string; summary?: string };\n } catch {\n throw new Error(`Cannot read the browser smoke's verdict: \\`wildo local smoke --json\\` printed no JSON (${outcome.message}).`);\n }\n if (verdict.outcome === 'COULD_NOT_ASK' || (verdict.outcome !== 'PASSED' && verdict.outcome !== 'FAILED')) {\n throw new Error(`The browser smoke could not ask: ${verdict.summary ?? 'no summary'}`);\n }\n return { ...outcome, success: verdict.outcome === 'PASSED', message: `browser smoke ${verdict.outcome}: ${verdict.summary ?? ''}` };\n }\n\n /**\n * Run a resolved verification plan set and return one outcome per check.\n *\n * Extracted from the coding-task dispatch so the SAME executor serves a second caller: the\n * `DETERMINISTIC_CLI` playbook tier, which verifies an already-built application and dispatches no\n * agent (issue #147). The alternative was a second loop that re-derived which kinds branch away\n * from the argv path — and the two would drift the first time a `VerificationKind` was added,\n * silently, because a missed kind falls through to a typecheck that passes.\n *\n * A thrown error is an INFRASTRUCTURE failure, not a failing check: the subprocess could not be\n * run at all. It is recorded as a failed outcome so the caller sees which check was affected, and\n * surfaced separately so a caller can tell \"the application is broken\" from \"we could not ask\".\n */\n private async executeVerificationPlans(\n plans: readonly ApplicationCodingTaskVerificationPlan[],\n ): Promise<{\n verification: Array<{ checkRef: string; outcome: VerificationOutcome }>;\n infrastructureError: unknown;\n /**\n * Which checks did not RUN — they threw before producing a verdict.\n *\n * Reported apart from `verification` because the two answer different questions and one of them\n * must never be read as the other. A thrown check is recorded with `success: false` so a caller\n * that only looks at outcomes still fails closed, and that is right for the post-run pass. It is\n * wrong for a BASELINE pass, where `success: false` would read as \"already broken\" and forgive a\n * real regression the run introduced — `runSchemaPlanDriftVerification` throws by design when\n * `backend-api/dist` is absent, and a missing migration crash-loops the backend, so that is\n * precisely the check a baseline must not silently excuse.\n */\n unrunCheckRefs: readonly string[];\n /**\n * The unrun checks whose command could not be executed at all (#3423): a subset of `unrunCheckRefs`, with the\n * command and the check's message. The settlement holds coding admissions on it; nothing else reads it.\n */\n unavailableVerificationTools: readonly UnavailableVerificationTool[];\n }> {\n const verification: Array<{ checkRef: string; outcome: VerificationOutcome }> = [];\n const unrunCheckRefs: string[] = [];\n const unavailableVerificationTools: UnavailableVerificationTool[] = [];\n let infrastructureError: unknown = null;\n for (const plan of plans) {\n try {\n verification.push({\n checkRef: plan.checkRef,\n // The FK-resolution check is not a CLI command: it runs in the companion's\n // introspection subprocess (fresh working-tree import), so it branches before\n // the argv-plan path.\n outcome: plan.kind === VerificationKind.FRONTEND_FK_RESOLUTION\n ? await this.runForeignKeyResolutionVerification()\n : plan.kind === VerificationKind.SETTINGS_PLACEMENT_CONTENT\n ? await this.runSettingsPlacementContentVerification()\n : plan.kind === VerificationKind.SCHEMA_PLAN_DRIFT\n ? await this.runSchemaPlanDriftVerification()\n : plan.kind === VerificationKind.RESOURCES_REGISTRY_INIT\n ? await this.runResourcesRegistryInitVerification()\n : plan.kind === VerificationKind.SPECIFICATION_EXPORTS\n ? await this.runSpecificationExportsVerification()\n : plan.kind === VerificationKind.CONFIG_VALIDATE\n ? await this.runConfigValidateVerification()\n : plan.kind === VerificationKind.DESIGN_SYSTEM_CONTRAST\n ? await this.runDesignSystemContrastVerification(plan.path ?? 'frontend')\n : plan.kind === VerificationKind.DESIGN_SYSTEM_CONTRACT\n ? await this.runDesignSystemContractVerification(plan.path ?? 'frontend')\n : plan.kind === VerificationKind.DESIGN_SYSTEM_BRAND\n ? await this.runDesignSystemBrandVerification(plan.path ?? 'frontend')\n : plan.kind === VerificationKind.BACKEND_READY\n ? await this.runBackendReadyVerification()\n : plan.kind === VerificationKind.BROWSER_SMOKE\n ? await this.runBrowserSmokeVerification()\n : plan.kind === VerificationKind.WEBSITE_DEMO_FACTS\n ? await this.runWebsiteDemoFactsVerification(plan.path ?? 'website')\n : this.absentWorkspacePackageOutcome(plan)\n ?? await this.runArgvVerification(plan.kind, plan.path ?? undefined),\n });\n } catch (error) {\n infrastructureError ??= error;\n unrunCheckRefs.push(plan.checkRef);\n if (error instanceof VerificationToolUnavailableError) {\n unavailableVerificationTools.push({\n hostCause: error.hostCause,\n checkRef: plan.checkRef,\n command: error.command,\n message: error.message,\n ...(error.verbProbeArgs ? { verbProbeArgs: error.verbProbeArgs } : {}),\n });\n }\n // A check that threw out of a subprocess still carries what that subprocess printed; keep it, or\n // the record says only \"Bounded subprocess failed\" while the cause is in hand.\n const details = (error as { details?: { stdout?: string; stderr?: string } } | null | undefined)?.details;\n verification.push({\n checkRef: plan.checkRef,\n outcome: {\n kind: plan.kind,\n path: plan.path,\n success: false,\n message: describeCaughtError(error),\n stdoutTail: (details?.stdout ?? '').slice(-OUTPUT_TAIL_CHARS),\n stderrTail: (details?.stderr ?? '').slice(-OUTPUT_TAIL_CHARS),\n },\n });\n }\n }\n return { verification, infrastructureError, unrunCheckRefs, unavailableVerificationTools };\n }\n\n /**\n * Run named verification checks against the application, outside any agent dispatch.\n *\n * The public door for the `DETERMINISTIC_CLI` tier. Check refs resolve through the same closed\n * `APPLICATION_CODING_TASK_VERIFICATION_CATALOG` a coding task uses, so an unknown ref is refused\n * here rather than becoming an unrun check that reports success by absence.\n *\n * Deliberately takes NO worktree lock and captures NO change set: this reads the application, and\n * pretending otherwise would serialize verification against the single-flight coding lane for no\n * reason.\n */\n public async runApplicationVerificationChecks(\n checkRefs: readonly string[],\n ): Promise<{\n verification: Array<{ checkRef: string; outcome: VerificationOutcome }>;\n infrastructureError: unknown;\n /** The checks that threw before a verdict (#2222): recorded failed in `verification`, but never a claim about the application. */\n unrunCheckRefs: readonly string[];\n }> {\n return this.executeVerificationPlans(resolveApplicationCodingTaskVerificationPlans(checkRefs));\n }\n\n /**\n * The website's drawn demos, held to the application they draw (#2784). A website task owes it beside its typecheck,\n * because what it catches compiles: a status the resource does not have, a change drawn as an update on a field an\n * update cannot write. The scenarios are collected in a child process that imports the site fresh\n * ({@link collectWebsiteDemoScenarios}); the facts are the ones the section's brief carried\n * ({@link checkWebsiteDemoScenarios}), from a domain model checked against the source as it stands.\n *\n * Whose fault decides the answer. The SITE's (a scenario `defineWebsiteDemoScenario` refused, a module of the site\n * that throws or does not parse) fails the task, which can fix it. The HOST's (a package the site imports cannot be\n * resolved, the collecting process died, the domain model cannot be read) leaves the check unrun.\n */\n private async runWebsiteDemoFactsVerification(websitePath: string): Promise<VerificationOutcome> {\n const packageDirectory = this.sanitizeRelativePath(websitePath);\n const saasRoot = this.companionContext.saasRoot;\n const outcome = (success: boolean, message: string): VerificationOutcome => ({\n kind: VerificationKind.WEBSITE_DEMO_FACTS,\n path: websitePath,\n success,\n message,\n stdoutTail: '',\n stderrTail: '',\n });\n if (!existsSync(join(saasRoot, packageDirectory, 'package.json'))) return outcome(true, `no ${packageDirectory} package in this application — no demo to check`);\n const collection = await collectWebsiteDemoScenarios(join(saasRoot, packageDirectory, 'src'), this.companionContext.companionHome);\n if (!collection.collected) {\n if (collection.fault === WebsiteDemoScenarioCollectionFault.HOST) throw new Error(`The website's demos could not be collected: ${collection.message}`);\n return outcome(false, `the website's sections could not be imported, so its demos cannot be checked: ${collection.message.slice(0, 600)}`);\n }\n const reached = `reached from ${collection.entries.join(' and ')}`;\n if (collection.records.every((record) => record.scenario.resource === undefined)) {\n return outcome(true, `${collection.records.length} demo scenario(s) ${reached}, none bound to a resource — nothing to hold to the application`);\n }\n const backendServiceKey = Object.entries(this.companionContext.servicesByKey).find(([, service]) => !service.frontendType)?.[0];\n if (backendServiceKey === undefined) throw new Error('No backend service is declared, so the resources a website demo binds cannot be read.');\n const { index, freshness } = await readWorkspaceElements(this.introspectionService, backendServiceKey, { verifyAgainstSource: true });\n const describeSite = (definedAt: string | null) => (definedAt === null ? 'a demo scenario (its definition site is unknown)' : relative(saasRoot, definedAt));\n const result = checkWebsiteDemoScenarios(collection.records, index.resources, describeSite);\n const against = `against the domain model (${describeWorkspaceFreshness(freshness)})`;\n return result.problems.length === 0\n ? outcome(true, `${result.bound} bound demo scenario(s) of ${result.defined} ${reached} show only what their resources allow, ${against}`)\n : outcome(false, `${result.problems.length} demo value(s) untrue of the application, ${against}: ${result.problems.join(' | ')}`);\n }\n\n /**\n * A typecheck of a workspace package the application does not have answers \"nothing to check\" (#1540).\n *\n * Required checks are derived from the paths a task may write, so a provider binding that may write\n * `website/src/provider-contributions.ts` owes the website typecheck, in every application, including\n * one with no website. Running `tsc` in a directory that is not a package would fail the task over a\n * package that does not exist. The honest answer is the one the settings sweep gives when no rail is\n * authored: checked, and nothing was there to check. That is stated in the outcome, never a silent pass.\n *\n * A package is its `package.json`. A directory holding one stray file, with no manifest, is not a\n * package that any typecheck could run in.\n */\n private absentWorkspacePackageOutcome(plan: ApplicationCodingTaskVerificationPlan): VerificationOutcome | undefined {\n // A site build is asked of every optional package at the end of a build (#2228), so the same honest answer applies.\n if ((plan.kind !== VerificationKind.TYPECHECK && plan.kind !== VerificationKind.PACKAGE_BUILD) || plan.path === null) return undefined;\n const packageDirectory = this.sanitizeRelativePath(plan.path);\n if (existsSync(join(this.companionContext.saasRoot, packageDirectory, 'package.json'))) return undefined;\n return {\n kind: plan.kind,\n path: plan.path,\n success: true,\n message: `no ${packageDirectory} package in this application — nothing to ${plan.kind === VerificationKind.PACKAGE_BUILD ? 'build' : 'typecheck'}`,\n stdoutTail: '',\n stderrTail: '',\n };\n }\n\n private async runVerification(plan: VerificationPlan): Promise<VerificationOutcome> {\n try {\n const result = await executeBoundedSubprocess({\n command: plan.command,\n args: plan.args,\n cwd: plan.cwd,\n env: buildVerificationEnv(),\n timeoutMs: VERIFICATION_TIMEOUT_MS,\n maxCapturedBytes: VERIFICATION_MAX_CAPTURED_BYTES,\n });\n return {\n kind: plan.kind,\n path: plan.path,\n success: true,\n message: `${plan.command} ${plan.args.join(' ')} passed`,\n stdoutTail: result.stdout.slice(-OUTPUT_TAIL_CHARS),\n stderrTail: result.stderr.slice(-OUTPUT_TAIL_CHARS),\n };\n } catch (error) {\n const details = (error as { details?: { stdout?: string; stderr?: string } }).details;\n return {\n kind: plan.kind,\n path: plan.path,\n success: false,\n message: describeCaughtError(error),\n stdoutTail: (details?.stdout ?? '').slice(-OUTPUT_TAIL_CHARS),\n stderrTail: (details?.stderr ?? '').slice(-OUTPUT_TAIL_CHARS),\n };\n }\n }\n\n /**\n * Run one admission-time validation and convert ANY refusal into a typed\n * VALIDATION error, preserving the original message as context.\n *\n * Deliberately a wrapper rather than N rewritten throw sites: the pure\n * resolver in the models layer has no error builder and should not grow one,\n * and a future admission check gets the same classification by being placed\n * here rather than by remembering to.\n */\n /**\n * `refusesTaskContract` marks the refusal as the task's OWN (#1581): set only by admission's two checks\n * of the task contract, so a dispatcher counts it as the task's attempt rather than the host's refusal.\n * The resume path's checks (an empty answer, a check the host no longer registers) are not the task\n * being dispatched and carry no mark.\n */\n private admitTypedInput<T>(validate: () => T, message: string, options: { readonly refusesTaskContract?: boolean } = {}): T {\n try {\n return validate();\n } catch (error) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.VALIDATION,\n context: {\n message,\n validationError: describeCaughtError(error),\n // The task's own contract was refused: a dispatcher counts this as its attempt (#1581).\n ...(options.refusesTaskContract === true ? { [APPLICATION_CODING_CONTRACT_REFUSAL_MARKER]: true } : {}),\n },\n });\n }\n }\n\n /**\n * Sanitize an app-root-relative path from the wire: rejects absolute\n * paths, `..` escapes, backslashes, NUL bytes, and flag-lookalikes\n * (leading `-` would be parsed as an argv flag by the fixed commands).\n */\n private sanitizeRelativePath(requestedPath: string): string {\n const candidate = requestedPath.trim();\n const reject = (reason: string): never => {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.VALIDATION,\n context: {\n message: `Invalid verification path: ${reason}`,\n requestedPath,\n },\n });\n };\n\n if (!candidate) reject('path is empty');\n if (candidate.includes('\\0')) reject('path contains a NUL byte');\n if (candidate.includes('\\\\')) reject('use forward slashes');\n if (isAbsolute(candidate)) reject('path must be relative to the application root');\n if (candidate.startsWith('-')) reject('path must not start with a dash');\n const normalized = normalize(candidate);\n if (normalized.split(sep).includes('..')) reject('path must not escape the application root');\n\n const absolute = join(this.companionContext.saasRoot, normalized);\n const relativeFromRoot = relative(this.companionContext.saasRoot, absolute);\n if (relativeFromRoot.startsWith('..') || isAbsolute(relativeFromRoot)) {\n reject('path resolves outside the application root');\n }\n return normalized;\n }\n\n /** Nearest ancestor dir (within the app root) holding a package.json. */\n private findNearestPackageDir(startDir: string): string {\n let current = startDir;\n const root = this.companionContext.saasRoot;\n while (current.startsWith(root)) {\n if (existsSync(join(current, 'package.json'))) {\n return current;\n }\n const parent = dirname(current);\n if (parent === current) break;\n current = parent;\n }\n return root;\n }\n\n // ================================================================\n // Error + traceability helpers (service-owned wrappers, P-13 pattern)\n // ================================================================\n\n private buildDispatchConflictError(message: string): unknown {\n return this.errorBuilder.buildError(ErrorType.CONFLICT, undefined, {\n customMessageReference: ErrorCustomMessageReference.CONFLICT,\n context: { message },\n });\n }\n\n /** Map proper-lockfile ELOCKED contention onto the 409 vocabulary. */\n private mapLockError(error: unknown): unknown {\n if ((error as { code?: string })?.code === 'ELOCKED') {\n return this.buildDispatchConflictError(\n 'The workspace-mutation lock is held by another process (companion run or CLI). '\n + 'Dispatch is single-flight across processes (P-20); retry after the active run completes. '\n + 'If you are a dispatched coding-agent run: dispatching from a dispatched run is forbidden (P-35).',\n );\n }\n return error;\n }\n\n private createOperationTraceStep(\n sessionContext: CompanionExecutionSessionContext | undefined,\n label: string,\n ) {\n return sessionContext\n ? this.traceabilityService.createStep(sessionContext, {\n kind: 'coding-agent-dispatch',\n label,\n })\n : undefined;\n }\n\n private async traceOperationStart(input: {\n sessionContext?: CompanionExecutionSessionContext;\n step?: ReturnType<CompanionTraceabilityService['createStep']>;\n type: string;\n summary: string;\n payload?: unknown;\n artifactFileName?: string;\n artifactContent?: unknown;\n }): Promise<void> {\n if (!input.sessionContext) return;\n\n await this.traceabilityService.traceEvent({\n session: input.sessionContext,\n minimumLevel: CompanionTraceabilityLevel.DEBUG,\n type: input.type,\n summary: input.summary,\n ...(input.payload !== undefined ? { payload: input.payload } : {}),\n ...(input.step ? { step: input.step } : {}),\n });\n if (input.artifactFileName && input.artifactContent !== undefined) {\n await this.traceabilityService.writeArtifact({\n session: input.sessionContext,\n minimumLevel: CompanionTraceabilityLevel.DEBUG_VERBOSE,\n fileName: input.artifactFileName,\n content: input.artifactContent,\n ...(input.step ? { step: input.step } : {}),\n });\n }\n }\n\n private async traceOperationSuccess(input: {\n sessionContext?: CompanionExecutionSessionContext;\n step?: ReturnType<CompanionTraceabilityService['createStep']>;\n type: string;\n summary: string;\n payload?: unknown;\n artifactFileName?: string;\n artifactContent?: unknown;\n }): Promise<void> {\n if (!input.sessionContext) return;\n\n if (input.artifactFileName && input.artifactContent !== undefined) {\n await this.traceabilityService.writeArtifact({\n session: input.sessionContext,\n minimumLevel: CompanionTraceabilityLevel.DEBUG_VERBOSE,\n fileName: input.artifactFileName,\n content: input.artifactContent,\n ...(input.step ? { step: input.step } : {}),\n });\n }\n await this.traceabilityService.traceEvent({\n session: input.sessionContext,\n minimumLevel: CompanionTraceabilityLevel.DEBUG,\n type: input.type,\n summary: input.summary,\n ...(input.payload !== undefined ? { payload: input.payload } : {}),\n ...(input.step ? { step: input.step } : {}),\n });\n }\n\n private async traceOperationFailure(input: {\n sessionContext?: CompanionExecutionSessionContext;\n step?: ReturnType<CompanionTraceabilityService['createStep']>;\n type: string;\n summary: string;\n error: unknown;\n payload?: unknown;\n }): Promise<void> {\n if (!input.sessionContext) return;\n\n await this.traceabilityService.traceEvent({\n session: input.sessionContext,\n minimumLevel: CompanionTraceabilityLevel.DEBUG,\n type: input.type,\n summary: input.summary,\n payload: {\n ...(input.payload && typeof input.payload === 'object'\n ? input.payload as Record<string, unknown>\n : { input: input.payload }),\n error: buildOutputErrorPayload(input.error),\n },\n ...(input.step ? { step: input.step } : {}),\n });\n }\n\n private async traceOperationArtifact(\n sessionContext: CompanionExecutionSessionContext | undefined,\n step: ReturnType<CompanionTraceabilityService['createStep']> | undefined,\n fileName: string,\n content: unknown,\n ): Promise<void> {\n if (!sessionContext) return;\n await this.traceabilityService.writeArtifact({\n session: sessionContext,\n minimumLevel: CompanionTraceabilityLevel.DEBUG_VERBOSE,\n fileName,\n content,\n ...(step ? { step } : {}),\n });\n }\n}\n\ninterface VerificationPlan {\n kind: VerificationKind;\n path: string | null;\n command: string;\n args: string[];\n cwd: string;\n}\n\n/**\n * Change-set artifact persisted on the task row (P-19: file list + stats\n * + head SHAs + attribution classes). `fullDiffText` is deliberately\n * stripped — the raw diff lives in the traceability artifact only.\n *\n * Persisted as `FlowsActors_IO_PartKind.STRUCTURED` with the capture in\n * `content.data`. History: on 2026-07-03 this was temporarily JSON-encoded\n * into a TEXT artifact because the zod-to-mongoose converter flattened\n * nested discriminated unions (`artifacts[]` on the task row) onto their\n * FIRST variant, making `content.text` a required Mongoose path for every\n * artifact. The converter now merges nested union variants into an\n * all-optional superset schema, so the natural STRUCTURED shape persists\n * again (requires a saas-backend-lib dist carrying that fix).\n */\nfunction buildChangeSetArtifact(taskId: string, changeSet: GitChangeSetCapture): ArtifactInstance {\n const { fullDiffText: _fullDiffText, ...structuredCapture } = changeSet;\n return {\n ref: `coding-agent-change-set-${taskId}`,\n type: FlowsActors_IO_PartKind.STRUCTURED,\n name: 'coding-agent-change-set',\n description: 'Read-only git change-set capture with per-file attribution (P-19)',\n origin: { taskId },\n content: { data: structuredCapture },\n createdAt: new Date().toISOString(),\n };\n}\n\n/** Same minimal allowlist the CLI spawn uses (P-18). */\nfunction buildVerificationEnv(): NodeJS.ProcessEnv {\n // Same minimal identity allowlist the CLI spawn uses (P-18) — incl.\n // USER/LOGNAME so a verification hook that shells out to per-user\n // tooling behaves like the agent run. Kept in lockstep with\n // `ClaudeCliCompanionService`'s allowlist.\n const env: NodeJS.ProcessEnv = {};\n for (const key of ['PATH', 'HOME', 'USER', 'LOGNAME', 'SHELL', 'TERM']) {\n const value = process.env[key];\n if (value !== undefined) env[key] = value;\n }\n return env;\n}\n\nfunction buildOutputErrorPayload(error: unknown): unknown {\n if (isWildoBackendError(error)) return error;\n if (error instanceof Error) {\n return {\n message: error.message,\n name: error.name,\n ...(error.stack ? { stack: error.stack } : {}),\n };\n }\n return { message: String(error) };\n}\n\nfunction createDeferred<T>(): {\n promise: Promise<T>;\n resolve: (value: T) => void;\n reject: (error: unknown) => void;\n} {\n let settled = false;\n let resolveFn!: (value: T) => void;\n let rejectFn!: (error: unknown) => void;\n const promise = new Promise<T>((resolve, reject) => {\n resolveFn = resolve;\n rejectFn = reject;\n });\n return {\n promise,\n resolve: (value) => {\n if (settled) return;\n settled = true;\n resolveFn(value);\n },\n reject: (error) => {\n if (settled) return;\n settled = true;\n rejectFn(error);\n },\n };\n}\n\n/**\n * The run row's record of a brief built without a readable playbook catalog (#2846 review L1): the reading and the\n * reason the brief states, never more. Empty for every other brief.\n */\nfunction briefProvenanceUnavailableRunField(task: MetaWorkflow_ApplicationCodingTaskContract): Record<string, unknown> {\n const source = task.contextSelection.selectedSources.find((candidate) => candidate.sourceRef === BRIEF_PROVENANCE_UNAVAILABLE_SOURCE_REF);\n const content = source?.content as { reading?: unknown; reason?: unknown } | undefined;\n if (content === undefined || typeof content.reading !== 'string') return {};\n return { briefProvenanceUnavailable: { reading: content.reading, ...(typeof content.reason === 'string' ? { reason: content.reason } : {}) } };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"coding-agent-dispatch.companion.service.js","sourceRoot":"","sources":["../../../../src/claude-cli/services/coding-agent-dispatch.companion.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgFG;;;;;;;;;;;;;AAEH,OAAO,EACL,gDAAgD,GAEjD,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACL,+BAA+B,EAC/B,qCAAqC,GACtC,MAAM,sEAAsE,CAAC;AAC9E,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAChF,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,EACL,wBAAwB,EACxB,sBAAsB,EACtB,4BAA4B,EAC5B,+BAA+B,EAC/B,iCAAiC,GAClC,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,8BAA8B,EAAE,MAAM,oDAAoD,CAAC;AAClH,OAAO,EAAE,oCAAoC,EAAE,+BAA+B,EAAE,oCAAoC,EAAE,MAAM,+BAA+B,CAAC;AAC5J,OAAO,EACL,0BAA0B,EAC1B,wBAAwB,EACxB,gCAAgC,EAChC,2BAA2B,EAC3B,yBAAyB,EACzB,gCAAgC,EAChC,wBAAwB,GAGzB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,kCAAkC,EAAE,MAAM,8DAA8D,CAAC;AAClH,OAAO,EACL,iCAAiC,EACjC,8BAA8B,EAC9B,oBAAoB,EACpB,2BAA2B,EAC3B,sBAAsB,EACtB,gCAAgC,EAChC,sBAAsB,EACtB,4BAA4B,EAC5B,sBAAsB,EACtB,8BAA8B,GAG/B,MAAM,yCAA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AAI,CAAC;YACf,QAAQ,CAAC,KAAK,CAAC,CAAC;QAClB,CAAC;KACF,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,SAAS,kCAAkC,CAAC,IAAgD;IAC1F,MAAM,MAAM,GAAG,IAAI,CAAC,gBAAgB,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,SAAS,KAAK,uCAAuC,CAAC,CAAC;IAC1I,MAAM,OAAO,GAAG,MAAM,EAAE,OAA8D,CAAC;IACvF,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,OAAO,CAAC,OAAO,KAAK,QAAQ;QAAE,OAAO,EAAE,CAAC;IAC5E,OAAO,EAAE,0BAA0B,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,OAAO,OAAO,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;AACjJ,CAAC","sourcesContent":["/**\n * Application coding-task host — the typed Flows/Actors coding path.\n *\n * `runApplicationCodingTask` admits one typed `MetaWorkflow_ApplicationCodingTaskContract`\n * (the episode runtime's coding revision owner is the caller), renders its\n * prompt from the sealed contract, creates an `Actors_Task` row, spawns the\n * Claude CLI in the background against the application worktree, captures\n * a read-only git change set with per-file attribution, runs the contract's\n * registered verification checks, then PATCHes the task with status/output/\n * artifacts. One admission never spans the multi-minute run (P-16) —\n * callers await the settlement or poll `/tasks/actors/:taskId`. The raw\n * `POST /coding-agent/dispatch` endpoint (caller-composed prompt) was\n * deleted at the first-activation hard cut.\n *\n * # Locking & recursion cap (P-20 / P-19b / P-35)\n *\n * Runs are single-flight, serialized by a cross-process lock on the\n * dedicated target `<saasRoot>/.wildo-saas/state/workspace-mutation.lock`\n * (`withDedicatedFileLock` from `@wildo-ai/platform-config-lib`,\n * proper-lockfile pattern — an in-memory mutex alone is forbidden because\n * the CLI mutates the same worktree from other processes). An in-memory\n * flag fronts the lock for fast 409s. The lock is held for the WHOLE run.\n *\n * That is the SINGLE-FLIGHT mode. A CONCURRENT run (#1528, a parallel build\n * wave) holds no lock and takes it only around its commit, so the lock is\n * no longer the signal that \"a coding agent is running\" — the\n * `coding-run.heartbeat` beaten from the active-run set is (see\n * `CODING_RUN_HEARTBEAT_RELATIVE_PATH`).\n *\n * The P-35 recursion cap falls out structurally: a dispatched run that\n * calls dispatch (it has shell access and can read the machine-local\n * token) always finds the lock held by ITS OWN run and is rejected 409 —\n * a dispatched run can never dispatch. Deliberately, the lock does NOT\n * gate Paul's parallel sessions (P-19b): CLAUDE.md forbids session\n * coordination; per-file attribution is the compensation, not exclusion.\n *\n * ⚠️ **THE CAP IS A SIDE EFFECT OF THE LOCK BEING GLOBAL, AND #48 PROPOSES\n * MAKING IT PER-SCOPE.** Admission by disjoint mutation scopes deletes this\n * refusal silently: a recursing run asks for a task in ANOTHER module, is\n * found disjoint, and is admitted. Nothing throws, nothing logs, and the\n * first symptom is a fan-out nobody asked for — this repository's \"a\n * construct that refuses needs its paired path\" lesson running BACKWARDS,\n * with a refusal removed as a side effect, which is the harder direction to\n * notice.\n *\n * So the cap must become an EXPLICIT guard in the same change: a run's own\n * dispatch identity refused at admission regardless of scope disjointness.\n * Note that identity is the hard part and is not solved here — the child's\n * environment is composed by this service, but an HTTP request from the\n * agent's shell carries none of it, and the machine-local token the agent\n * reads is the same one an operator uses. Whoever scopes the lock owns\n * finding that channel; do not assume it exists.\n *\n * It is TRIPWIRED rather than left to memory. The single-flight tests below\n * dispatch the SAME scope twice, so they keep passing under scope-aware\n * admission and would let the cap vanish green. `refuses a second dispatch\n * whose mutation scope is DISJOINT — the P-35 recursion cap (#48)` varies\n * the scope on purpose and goes red instead.\n *\n * # Traceability (P-21)\n *\n * L2 runs dispatch through `AgentsBackendService.invokeAgent`, so they DO\n * reach the engine `AgentCallTraceSink` (on success and on failure, gated by\n * the agent-traceability policy and silent when no sink is bound) and they DO\n * run through the provider's Bottleneck limiter, which `executeAgentViaACP`\n * schedules the session on. The pre-ACP direct claude-cli lane bypassed both;\n * that is history, not the current shape. Two things still do not come free:\n * a NONE policy level or an unbound sink means no engine trace at all, so this\n * service also owns its companion-traceability events (DEBUG) and artifacts\n * (DEBUG_VERBOSE). The background phase runs under an INTERNAL trace session\n * (`createInternalSession`) because the HTTP request session ends at the\n * 202-style response.\n *\n * # Run limits (P-18)\n *\n * Defaults 30 min / 10 MiB; request-overridable up to hard caps\n * 60 min / 32 MiB. The byte cap REJECTS (kills the run), it does not\n * truncate. Args stay `--print` + `--model` (no extraArgs field), prompt\n * on stdin, env = `{ PATH, HOME, SHELL, TERM }` (composed inside\n * the ACP session runner).\n */\n\nimport {\n MetaWorkflow_ApplicationCodingTaskContractSchema,\n type MetaWorkflow_ApplicationCodingTaskContract,\n} from '@wildo-ai/saas-models/meta-workflows';\nimport {\n ApplicationSchemaPlanObligation,\n assessApplicationSchemaPlanObligation,\n} from '../../core/config/application-schema-plan-obligation.companion.utils';\nimport { isAbsolute, join, normalize, relative, sep, dirname } from 'node:path';\nimport { existsSync, readFileSync } from 'node:fs';\nimport { appendFile, mkdir, writeFile } from 'node:fs/promises';\nimport {\n CODING_ANSWERS_FILE_NAME,\n CodingQuestionAnswerer,\n getFamilyPackageRelativePath,\n renderCodingQuestionAnswerEntry,\n renderCodingQuestionAnswersHeader,\n} from '@wildo-ai/application-creation-runtime';\nimport { AcceptOrigin, ApplicationSpecificationFamily } from '@wildo-ai/saas-specifications/application-creation';\nimport { describeSpecificationDefinitionFault, SpecificationModuleFaultReading, specificationModuleFaultsAreAVerdict } from '@wildo-ai/saas-specifications';\nimport {\n AgentAnswerAttemptDecision,\n decideAgentAnswerAttempt,\n ParkedQuestionAnswerOutputSchema,\n ParkedQuestionAnswerVerdict,\n readParkedQuestionAnswers,\n renderParkedQuestionAnswerPrompt,\n withParkedQuestionAnswer,\n type ParkedQuestionAnswerOutput,\n type ParkedQuestionAnswerRecord,\n} from '../models/parked-question-answer.models';\nimport { PARKED_QUESTION_ANSWERER_AGENT_REF } from '../models/parked-question-answerer.actors-system.definitions';\nimport {\n applicationCodingExclusiveSubject,\n CODING_RUN_WINDOW_RETENTION_MS,\n CodingRunConcurrency,\n deriveInterferenceSuspected,\n describeRunConcurrency,\n failedVerificationBesideSiblings,\n isConcurrentRunSubject,\n selectBudgetCountingFailures,\n collectRunClaimedPaths,\n writtenLocationsOfSessionEvent,\n type CodingRunConcurrencyRecord,\n type CodingRunWindow,\n} from '../models/concurrent-coding-runs.models';\n\nimport { inject, injectable, optional } from 'inversify';\nimport {\n ActorsSystemBackendService,\n AgentsBackendService,\n ErrorBuilderBackendService,\n LoggerService,\n SAAS_SERVICE_TYPES,\n WorkerShutdownManagerBackendService,\n executeBoundedSubprocess,\n describeCaughtError,\n actorExecutionSuspensionRef,\n isActorExecutionNotSuspendedError,\n isActorExecutionSubjectBusyError,\n type ActorExecutionConclusion,\n type ActorExecutionOpenRequest,\n type ActorExecutionRunOptions,\n type ActorExecutionSuspensionRequest,\n type OpenedActorExecution,\n} from '@wildo-ai/saas-backend-lib';\nimport {\n Actor_Task_Topics,\n type AgentTraceContext,\n ErrorCustomMessageReference,\n ErrorType,\n FlowsActors_IO_PartKind,\n FlowsActors_Status,\n isWildoBackendError,\n type ArtifactInstance,\n type FlowsActors_Agent_Invocation,\n HumanDecision_FieldKind,\n HumanDecision_ResponseIntent,\n type HumanDecision_Request,\n describeModelProviderAccountRefusal,\n} from '@wildo-ai/saas-models';\nimport {\n CodingAgent_EndOfTurnClassification,\n CodingAgent_OperationContext_BaseSchema,\n CodingAgent_RunTaskInputSchema,\n CodingAgent_RunTaskOutputSchema,\n CodingAgent_SessionSuspensionSchema,\n CodingAgent_StopReason,\n type CodingAgent_RunTaskOutput,\n type CodingAgent_SessionSuspension,\n type CodingAgent_Usage,\n} from '@wildo-ai/external-connectors-models';\nimport {\n getWorkspaceMutationLockPath as resolveWorkspaceMutationLockPath,\n withDedicatedFileLock,\n} from '@wildo-ai/platform-config-lib';\n\nimport {\n CodingRunFailureAttribution,\n sanitizeWorkbenchCreationPlaneIdentity,\n Workbench_ParkedCodingQuestionOptionRef,\n WORKBENCH_PARKED_CODING_QUESTION_FIELD_REF,\n WORKBENCH_TASK_CORRELATION_DOMAIN,\n WorkbenchTaskCorrelationRef,\n FRONTEND_MODULES_REGISTRY_RELATIVE_PATH,\n FRONTEND_SETTINGS_HUB_CONFIG_RELATIVE_PATH,\n FrontendSettingsHubWiringFindingCode,\n frontendRegistryPassesSettingsHub,\n settingsHubConfigAuthorsRail,\n BuildTaskRearmReason,\n CreationDriveAcceptDisposition,\n type Wildo_Application_Actor_Task,\n} from '@wildo-ai/platform-core-shared';\nimport { COMPANION_SERVICE_TYPES } from '../../core/inject/models/service-types';\nimport type { CompanionContext } from '../../core/context/companion-context';\nimport { describeApplicationSpecificationModuleFault, readSpecificationsEvaluationFindings } from '../../core/context/companion-package-loaders.companion';\nimport { InFlightWorkHeartbeat } from '../../core/runtime/in-flight-work-heartbeat.companion';\nimport type {\n CompanionExecutionSessionContext,\n} from '../../core/traceability/companion-traceability.models';\nimport { CompanionTraceabilityLevel, CompanionTraceAliasKind } from '../../core/traceability/companion-traceability.models';\nimport { CompanionTraceabilityService } from '../../core/traceability/companion-traceability.service';\nimport { CompanionIntrospectionService } from '../../core/introspection/services/companion-introspection.companion.service';\nimport { CompanionExecutionsCompanionService } from '../../executions/services/companion-executions.companion.service';\nimport { CompanionActorTasksListQuerySchema, CompanionExecutionsListQuerySchema, type CompanionCodingAgentStatusResponse } from '../../companion-api/companion-api.schemas';\nimport { GitChangeSetCompanionService, isConcurrentHostLanePath, isOutsideApplicationRootPath } from './git-change-set.companion.service';\nimport { CodingRunWriteRegisterCompanionService, applicationRootSpellings } from './coding-run-write-register.companion.service';\nimport { PlaybookLaneBoundaryDecision } from '@wildo-ai/application-creation-runtime';\nimport {\n APPLICATION_CREATION_AUTONOMY_POSTURE,\n LaneBoundaryTreatment,\n laneBoundaryTreatmentFor,\n} from '../../meta-workflows/models/playbook-run-checkpoint.models';\nimport { AcceptedChangeCommitCompanionService, type BuildCheckpointOutcome } from './accepted-change-commit.companion.service';\nimport {\n readIsolatedVerificationRecheck,\n withIsolatedVerificationRecheck,\n type IsolatedVerificationRecheck,\n} from '../models/shared-tree-reconciliation.models';\nimport { listInFlightCodingRuns, type InFlightCodingRun } from './in-flight-coding-runs.companion';\nimport {\n APPLICATION_CODING_AGENT_BINDINGS,\n APPLICATION_CODING_TURN_CLASSIFIER_AGENT_REF,\n CodingTurnEndClassificationOutputSchema,\n APPLICATION_CODING_AGENT_REFS,\n APPLICATION_CODING_SYSTEM_REF,\n APPLICATION_CODING_WORKTREE_SUBJECT,\n isApplicationCodingAgentRef,\n resolveSelectedApplicationCodingAgentBinding,\n type ApplicationCodingAgentBinding,\n} from '../../meta-workflows/models/application-coding-agent.actors-system.definitions';\nimport { humanDecisionSettler } from '../../meta-workflows/models/human-decision-settler.models';\nimport { BRIEF_PROVENANCE_UNAVAILABLE_SOURCE_REF } from '../../meta-workflows/models/build-brief-content-trust.models';\nimport {\n ChangeSetAttributionClass,\n RESOURCES_REGISTRY_COULD_NOT_ASK_MARKER,\n DESIGN_SYSTEM_BRAND_ADVISORY_MARKER,\n DESIGN_SYSTEM_BRAND_COULD_NOT_ASK_MARKER,\n ApplicationCodingTaskDisposition,\n codingRunChangedNoFileOfItsOwn,\n deriveApplicationCodingTaskDisposition,\n CodingRunStart,\n deriveCodingRunFailureAttribution,\n verificationFailureIsCarried,\n deriveCodingRunStart,\n isAttributedToAnotherWriter,\n APPLICATION_CODING_CONTRACT_REFUSAL_MARKER,\n INTERRUPTED_AT_STARTUP_OUTPUT_FIELD,\n type ApplicationCodingTaskRunAdmission,\n type CodingRunOrigin,\n type ApplicationCodingTaskVerificationPlan,\n DISPATCH_DEFAULT_MAX_CAPTURED_BYTES,\n DISPATCH_DEFAULT_TIMEOUT_MS,\n DISPATCH_HARD_MAX_CAPTURED_BYTES,\n DISPATCH_HARD_MAX_TIMEOUT_MS,\n VerificationKind,\n renderApplicationCodingTaskAgentPrompt,\n resolveApplicationCodingTaskVerificationPlans,\n type GitChangeSetCapture,\n type GitWorktreeSnapshot,\n isClosingReport,\n parseClosingReportUnmetRequirements,\n parseClosingReportMetRequirements,\n SETTLED_HEAD_OUTPUT_FIELD,\n} from '../models/coding-agent-dispatch.models';\nimport { CodingSessionFrameRetention, type CodingSessionRetentionSummary } from '../models/coding-session-frame-retention';\nimport { isInfrastructureShapedAgentFailure, isProviderAccountAgentFailure, waitForApplicationPackagesPublished } from '../../core/runtime/dev-compile-quiet.companion';\nimport { readCodingAgentUsageLimit, readRecordedCodingAgentUsageLimit, type CodingAgentUsageLimit } from '../models/coding-agent-usage-limit.models';\nimport {\n describeVerificationToolUnavailableRefusal,\n normalizeHostCheckFailureMessage,\n refuseWhenVerificationToolIsAbsent,\n resolveExecutableOnPath,\n verbProbeKnowsTheVerb,\n VERIFICATION_HOST_FAILURE_REASK_MS,\n VerificationHostCause,\n VerificationToolUnavailableError,\n type VerificationToolUnavailableHold,\n} from '../models/verification-tool-availability.models';\nimport type { NetworkEnvironmentFailureKind } from '../../core/runtime/network-environment-failure.companion';\nimport {\n CODING_AGENT_CONNECTIVITY_WAIT_LIMIT_MS,\n nextCodingAgentConnectivityProbeDelayMs,\n deriveCodingRunNetworkFailure,\n readAgentPassageTexts,\n readCodingRunNetworkReport,\n isCodingAgentWorkFrame,\n networkFailureKindOfFailedProbe,\n type CodingAgentConnectivityLoss,\n readRecordedNetworkFailureKind,\n type CodingAgentConnectivityHold,\n type CodingAgentConnectivityProbeResult,\n} from '../models/coding-agent-connectivity.models';\nimport {\n composeCodingAgentRouteEnvironment,\n describeCodingAgentProbeRoute,\n probeCodingAgentRoute,\n readClaudeCodeSettingSources,\n readClaudeCodeSettingsEnvironments,\n resolveCodingAgentProbeRoute,\n type CodingAgentProbeRoute,\n} from '../models/coding-agent-route.models';\nimport type { Actors_Memory_Context } from '@wildo-ai/saas-models';\nimport { diagnoseCarriedVerificationFailure } from '../../meta-workflows/models/carried-verification-failure.models';\nimport { assemblyRepairRunInputField } from '../../meta-workflows/services/application-assembly-repair.companion.utils';\nimport {\n NothingToRearmError,\n readBuildTaskInterference,\n readBuildTaskRearm,\n readGivenLandedOverride,\n withBuildTaskInterference,\n withBuildTaskRearm,\n type BuildTaskInterference,\n type BuildTaskRearm,\n} from '../../meta-workflows/models/build-task-rearm.models';\nimport { withWebsiteCopyReview, type WebsiteCopyReview } from '../../meta-workflows/models/website-copy-review.models';\nimport { withWebsiteVisualReview, type WebsiteVisualReview } from '../../meta-workflows/models/website-visual-review.models';\nimport { checkWebsiteDemoScenarios } from '../../meta-workflows/services/website-demo-facts.models';\nimport { describeWorkspaceFreshness, readWorkspaceElements } from '../../core/introspection/workspace-elements.companion';\nimport { collectWebsiteDemoScenarios, WebsiteDemoScenarioCollectionFault } from '../../core/website/website-source-module.companion';\nimport {\n APPLICATION_CODING_RUN_CHECKPOINT_KIND,\n ApplicationCodingRunCheckpointSchema,\n isParkedCodingRunAnswerable,\n mergeResumedLegUsage,\n type ApplicationCodingRunCheckpoint,\n} from '../models/application-coding-run-checkpoint.models';\nimport { findApplicationDocumentationChapterFileFaults } from '../../technical-doc/services/technical-documentation-chapter-files.companion';\nimport { ACTOR_TASK_OUTPUT_FIELDS_HELD_ON_THE_TASK_ROW_ONLY } from '../../executions/models/execution-task-snapshot.models';\n\n/** The longest one read of the completed coding runs is shared, whatever else happens (#3204). */\nconst COMPLETED_CODING_TASKS_HOLD_MS = 5_000;\n\n/** How many completed coding runs the shared read holds: the most recently updated (see {@link CodingAgentDispatchCompanionService}). */\nconst COMPLETED_CODING_TASKS_WINDOW = 200;\n\n/**\n * The stored fields a listing of coding runs leaves out (#3204): the transcript, ~80% of a run's row and read only by the\n * workbench's single-row conversation, never by a listing (`ACTOR_TASK_OUTPUT_FIELDS_HELD_ON_THE_TASK_ROW_ONLY`).\n */\nconst CODING_RUN_LISTING_OMITTED_FIELDS: readonly string[] = ACTOR_TASK_OUTPUT_FIELDS_HELD_ON_THE_TASK_ROW_ONLY.map((field) => `output.${field}`);\n/**\n * The least time between two build checkpoints a settlement asks for (#3204). A minute keeps the history readable (a\n * checkpoint names the runs of its minute) and its cost negligible; a forced checkpoint (a wave's end) ignores it.\n */\nexport const BUILD_CHECKPOINT_MIN_INTERVAL_MS = 60_000;\n\n/** Fixed, non-overridable limits for the verification hook subprocess. */\nconst VERIFICATION_TIMEOUT_MS = 10 * 60_000;\n/** How often a READ of a hold whose command lacks the verb asks the command again, in the background (#3432); an admission always asks. */\nconst VERIFICATION_VERB_PROBE_INTERVAL_MS = 30_000;\n\n/** A check whose command is absent or lacks the verb (#3423, #3432), as the verification pass reports it to the hold. */\ntype UnavailableVerificationTool = Pick<VerificationToolUnavailableHold, 'hostCause' | 'command' | 'verbProbeArgs' | 'checkRef' | 'message'>;\n/** How long the running backend has to answer `/health/ready` (#2228). Readiness is a cheap probe; a backend slower than this is not serving. */\nconst BACKEND_READY_TIMEOUT_MS = 10_000;\n/** How much of the agent's final message a not-repaired verdict carries (#2409): enough for its reason, not its transcript. */\nconst OVERRIDE_NOT_REPAIRED_AGENT_SAY_CHARS = 600;\nconst VERIFICATION_MAX_CAPTURED_BYTES = 10 * 1024 * 1024;\n\n\n/** Tail size persisted on the task row; full streams go to traceability artifacts. */\nconst OUTPUT_TAIL_CHARS = 16_000;\n\ninterface ActiveRunState {\n taskId: string;\n startedAt: string;\n /** Cancels the in-flight coding session. Cooperative first, kill second. */\n abortController: AbortController;\n /** Whether it shares the tree with a wave (#1528); a concurrent run takes the workspace lock only to commit. */\n mode: CodingRunConcurrency;\n /**\n * Present once the run was CANCELLED and its park is being withdrawn — by its own chain on the way\n * out, or by a per-run cancel no chain held, whose guard entry this is (#1581, eighth to tenth reviews).\n * The entry stays registered meanwhile, so a person's answer is refused until the withdraw is done;\n * and a second cancel AWAITS this withdraw's outcome rather than starting another or guessing.\n */\n withdrawal?: Promise<CancelledParkOutcome>;\n /**\n * TRUE for the registration a per-run cancel takes while it withdraws a park no chain holds (#1581). It\n * holds the task against a concurrent answer and WRITES NOTHING, so it is never a live writer (#1805\n * review F4): counting it deferred reconciliations nothing would ever resume.\n */\n withdrawalGuard?: true;\n}\n\n/**\n * What became of a cancelled run's park (#1581, tenth review). Told apart because a person is told\n * which: a best-effort withdraw can fail, and the store can fail to answer at all.\n */\nexport enum CancelledParkOutcome {\n /** The park is gone — withdrawn now, or none was left to withdraw. */\n ENDED = 'ended',\n /** The withdraw failed and the question is still waiting. */\n STILL_WAITING = 'still-waiting',\n /** Neither could be confirmed: the run could not be read. */\n UNCONFIRMED = 'unconfirmed',\n}\n\n/**\n * A read that found NO park — the task, its execution or its wait is absent — as opposed to a read that\n * failed. The store's `NOT_FOUND` and the driver's `ACTOR_EXECUTION_NOT_SUSPENDED` are the only answers\n * that mean \"nothing is waiting here\"; anything else means \"could not tell\" (#1581, tenth review R10-1).\n */\nfunction isAbsentParkRead(error: unknown): boolean {\n return (error as { customMessageReference?: unknown } | null)?.customMessageReference === ErrorCustomMessageReference.NOT_FOUND\n || isActorExecutionNotSuspendedError(error);\n}\n\n/**\n * How a parked run's resume went (#1581, seventh review). The two answerers act on it: only a resume\n * that RAN can have parked again, and a person whose answer resumed nothing is told why.\n */\nenum ParkedRunResumeOutcome {\n /** The driver admitted the resume and the continued turn ran, however it then ended. */\n RAN = 'ran',\n /** An operator's cancel was found before any turn — before the driver moved anything, or just after, when the question is handed back — and the chain withdraws the park. */\n CANCELLED = 'cancelled',\n /** The driver refused before moving anything — the run no longer waits on this decision, or another run holds its subject. The park is as it was. */\n REFUSED = 'refused',\n}\ntype ParkedRunResume =\n | { readonly outcome: ParkedRunResumeOutcome.RAN | ParkedRunResumeOutcome.CANCELLED }\n | { readonly outcome: ParkedRunResumeOutcome.REFUSED; readonly refusal: unknown };\n\n/**\n * The trace half of one coding run: the internal session its writes are attributed to, and the\n * errors tracing itself raised — which feed the run's disposition, because required evidence that\n * could not be recorded makes a working result a `TRACEABILITY_FAILED` one.\n *\n * Opened BEFORE the engine drives the run (#1359) because the session is also the scope every actor\n * plane write of that run carries, and the driver takes its scope when the run starts.\n */\ninterface CodingRunTrace {\n readonly runSession: CompanionExecutionSessionContext | undefined;\n readonly runStep: ReturnType<CompanionTraceabilityService['createStep']> | undefined;\n readonly traceabilityErrors: unknown[];\n readonly traceBestEffort: (operation: string, write: () => Promise<void>) => Promise<void>;\n}\n\nenum CodingRunEnding {\n /** The agent stopped to ask the operator; the run waits on its execution and can be continued. */\n PARKED = 'parked',\n /** The disposition ladder classified the run — a working result or a reported failure, both terminal. */\n CONCLUDED = 'concluded',\n}\n\ntype CodingRunResult =\n | { readonly kind: CodingRunEnding.PARKED; readonly suspension: ActorExecutionSuspensionRequest; readonly output: unknown; readonly afterSettle: () => Promise<void> }\n | { readonly kind: CodingRunEnding.CONCLUDED; readonly conclusion: ActorExecutionConclusion; readonly output: unknown; readonly afterSettle: () => Promise<void> };\n\n/**\n * How many change-set file entries ride on the durable row's summary.\n *\n * A build task's change-set is a handful of files by construction — the task declares its mutation\n * scope — so this bounds the pathological case rather than the ordinary one. Chosen over \"all of\n * them\" because the row is read by a judge whose brief is assembled per run, and over \"none of them\"\n * because that is what made the judge answer INDETERMINATE about work it could not see.\n */\nconst CHANGE_SET_SUMMARY_FILE_LIMIT = 40;\n\n/**\n * Where this process says \"a coding agent is running\", app-root-relative. Beaten while ANY run is in\n * {@link CodingAgentDispatchCompanionService}'s active set — single-flight or concurrent, fresh or\n * resumed — and removed when none is.\n *\n * ## Why the lock is not enough\n *\n * The dev supervisor holds a restart while a coding run is in flight, because a restart kills the\n * agent with the companion (#1026). It used to know that from the workspace-mutation lock's heartbeat\n * alone. Since #1528 a CONCURRENT run holds no lock — it takes one only around its commit — so a\n * parallel build wave was invisible to the hold. Measured 2026-09-27 on Wonder Todos: a\n * `bottom_up.build-dispatch` ran five concurrent children, two of them edited the frontend, the\n * frontend's rebuild made the supervisor restart the companion onto it, and every child still running\n * was killed; the run ended \"the host running this execution stopped\" with no measurement.\n *\n * A COPY of `CODING_RUN_HEARTBEAT_RELATIVE_PATH` in\n * `scripts/dev-orchestrator/runtime-supervisor-lifecycle.mjs`, which cannot import this source; pinned\n * equal by `scripts/__tests__/runtime-supervisor-workspace-mutation-hold.test.mjs`.\n */\nconst CODING_RUN_HEARTBEAT_RELATIVE_PATH = '.wildo-saas/state/coding-run.heartbeat';\n\n/** How often that file's mtime is refreshed; the supervisor judges it stale at three times this (`AGENT_RUN_HEARTBEAT_STALE_MS`). */\nconst CODING_RUN_HEARTBEAT_INTERVAL_MS = 5_000;\n\n/** Local narrow: is this an indexable object (not null, not an array)? */\nfunction isRecordValue(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\n/**\n * What a settled application coding run ACTUALLY did, read back from its durable row.\n *\n * Admission and settlement are different instants, and the gap between them is the whole run. A\n * caller that reports the first as the second says a green thing about work that has not happened\n * — which is what `bottom_up.build-dispatch` did on its first playbook run: `finishedAt` equalled\n * the coding run's `startedAt` to the millisecond. So this is the shape a waiting caller reports\n * INSTEAD of its own admission.\n *\n * `succeeded` is the durable row's own verdict, never re-derived here: the disposition ladder that\n * produced it (agent failure → capture failure → verification failure → traceability failure →\n * working result) lives at the one site that can see all four, and a second opinion computed from\n * a subset would disagree with it eventually.\n */\n/**\n * A run a restart stopped while it was writing (#1805): a coding run or a generation step, as the startup\n * sweeps report it, for the one recovery over every such run.\n */\nexport interface InterruptedRun {\n /** The run's durable task id — where its baseline lives, and its write record's key. */\n readonly taskId: string;\n /**\n * TRUE when the run held only its own task, so siblings wrote in the same tree beside it (#1528). Its\n * capture then holds files that may be theirs, and nothing that survived the restart says which.\n */\n readonly sharedTree: boolean;\n}\n\nexport interface ApplicationCodingTaskSettledOutcome {\n readonly taskId: string;\n /** The build-plan task this run was dispatched for, when the row records one. */\n readonly taskRef: string | null;\n /** The durable actor-task status: COMPLETED, FAILED, ABORTED, CANCELLED — or AWAITING_APPROVAL for a parked run (#1359). */\n readonly status: string;\n readonly succeeded: boolean;\n readonly disposition: string | null;\n /**\n * The run PARKED asking the operator a question, so it is neither finished nor failed. Its row\n * WAITS (`AWAITING_APPROVAL`), and reporting that as a failure would tell an operator to\n * re-dispatch work that is one answer away from continuing. Read from the STATUS, not from the\n * question left on the output — a withdrawn park keeps its output and is waiting for nobody.\n */\n readonly awaitingAnswer: boolean;\n /** Named, not counted: a caller that must say WHY a run failed cannot do it from a number. */\n readonly failedVerificationRefs: readonly string[];\n /**\n * Every verification check the run gated on, pass or fail. The `dispatch-outcome-sound` treatment's\n * first criterion reads exactly this — \"every required verification check succeeded\" — and it cannot\n * be answered from the failures alone: a run that ran NO checks and a run that passed three are\n * indistinguishable once only the empty failure list survives.\n */\n readonly verification: ReadonlyArray<{ readonly checkRef: string; readonly success: boolean }>;\n /** The run's change-set as the host sealed it (shas, whether HEAD moved, stats), carried verbatim. */\n readonly changeSetSummary: Record<string, unknown> | null;\n /**\n * What the run changed OUTSIDE its declared scope, RECORDED rather than refused (2026-09-13). It may\n * include a parallel session's edits, which is why it is evidence for a reviewer and not a verdict.\n */\n readonly scopeAssessment: Record<string, unknown> | null;\n /**\n * Why the agent's turn ended. A turn that stopped on `max_tokens` or `refusal` leaves a partial change\n * set that looks exactly like a complete one from the diff alone.\n */\n readonly agentStopReason: string | null;\n}\n\n/** One live frame relayed to an SSE subscriber: an agent event or a ladder state change. */\nexport interface CodingSessionLiveFrame {\n readonly channel: 'event' | 'state';\n readonly payload: unknown;\n}\n\ninterface VerificationOutcome {\n kind: VerificationKind;\n path: string | null;\n success: boolean;\n message: string;\n stdoutTail: string;\n stderrTail: string;\n /**\n * What exactly failed, one identity per finding, for a check that can fail for more than one reason. A check already\n * red at baseline is forgiven only for these: a new finding in it is the run's. Absent when a check cannot say, and\n * then the check is forgiven as a whole.\n */\n failureFindings?: readonly string[];\n /**\n * Advice a check gives without failing (#2818), one sentence each. A passing check's output reaches no reader, so a\n * check with something to say on a pass lifts it here, and the commit body prints it beside \"passed\".\n */\n advisories?: readonly string[];\n}\n\n/**\n * What changed inside the run window outside the sealed task scope — RECORDED for the reviewer, never\n * a reason to fail the run. See {@link assessApplicationCodingTaskMutationScope} for why.\n */\ninterface ApplicationCodingTaskScopeAssessment {\n /**\n * Changed-during-run paths (application-relative) that fall outside `allowedPathPrefixes` or inside\n * `prohibitedPathPrefixes`. This run's work OR a parallel session's — the change set cannot tell\n * which, so this is a list to read, not a verdict.\n *\n * Never a path ABOVE the application root (#1020). Such a path is keyed `../…` and lands in the\n * change set as `OUTSIDE_APPLICATION_ROOT` — visible and counted there — but a task scope is\n * application-relative by contract and could never have admitted it, so listing it here would only\n * ever name other sessions' edits elsewhere in the repository. Measured: 38 of 39 on one run.\n */\n outOfScopePaths: string[];\n /**\n * Every changed path the scope list above DELIBERATELY drops, each with the attribution class that\n * dropped it: committed inside the window, written by a concurrent companion lane, or above the\n * application root.\n *\n * The exclusions themselves are right and unchanged — a task scope is application-relative and could\n * never have admitted a `../…` path (#1020); a commit inside the window empties the dirty set every\n * other class is computed from; a concurrent lane's writes are not this run's to answer for. What was\n * missing is that a reader could not tell a deliberate exclusion from an omission.\n *\n * The evaluation treatment's judge found that twice in one hour on 2026-09-16, about a DIFFERENT\n * class each time — first `outside_application_root` (\"the evidence therefore does not account for\n * it\"), then `committed_during_run` (\"only labeled `committed_during_run`; it is not listed in\n * `outOfScopePaths` or otherwise accounted for\"). Reporting one class and excluding three is what\n * made the second finding inevitable, so this is total over the predicate rather than a list of the\n * classes anyone has complained about so far.\n */\n excludedFromScopeAssessment: Array<{ path: string; attribution: ChangeSetAttributionClass }>;\n /**\n * A commit landed inside the run window, so this window's attribution is\n * INCOMPLETE: a commit empties the dirty set every other class here is\n * computed from, and a parallel session's commit is indistinguishable from\n * the agent's own.\n *\n * RECORDED, NOT REFUSED — decided 2026-08-19, and the reasoning is the same\n * rule the plan applies to every other strictness in this vertical: exactness\n * is retained where a protected, accepted-state or real-effect consumer needs\n * it, and nowhere else. A coding run produces a WORKING result; it mutates no\n * accepted truth. Refusing the whole run here bought no protection of\n * anything accepted, while on a shared tree with parallel sessions ANY commit\n * overlapping ANY run — including one touching nothing the agent touched —\n * failed that run, with no worktree isolation to fall back on (ruled out for\n * this application) and no remedy a single session can enforce.\n *\n * What replaces the refusal is visibility that a consumer cannot miss: the\n * committed paths are recovered into the change set as\n * `COMMITTED_DURING_RUN`, and this flag rides on the recorded result. The\n * OBLIGATION moves with it — whatever later accepts this working result must\n * treat `historyMutated` as attribution it cannot rely on, and must not\n * promote it without review. That obligation belongs to whoever reviews and\n * commits the result: no code reads `historyMutated`.\n */\n historyMutated: boolean;\n}\n\n/**\n * Which changed-during-run paths fall outside the task's declared scope. RECORDED, NOT REFUSED.\n *\n * Decided by Paul, 2026-09-13, after measuring what the refusal cost. `build-task-company-config` made\n * its two in-scope edits, stopped at `end_turn`, and was recorded failed — against three\n * `marketing/website` files a parallel Claude Code session edited inside the run window. The capture\n * compares a snapshot at dispatch with one at the end, so a file that was clean at dispatch and dirty\n * at the end is `RUN_EXCLUSIVE` whoever wrote it. On a tree where several sessions work at once, that\n * made EVERY coding run fail the moment anyone touched anything else: the intended use — hand the\n * Wildo lane a change and keep editing elsewhere meanwhile — could not work at all.\n *\n * The same reasoning was already applied twice and is now applied everywhere: a commit landing\n * mid-run (2026-08-19) and a concurrent research lane (2026-09-09) were each excluded because they\n * cannot be attributed. A parallel session's uncommitted edit is the same fact, and it cannot be\n * listed by root, so the refusal itself is what goes. This is also the application-creation\n * directive: mutation is free, git makes every change visible and reversible, and acceptance is the\n * commit — a restriction arrives later as a judge reading this list, never as a refusal in the lane.\n *\n * What stays enforced is the agent's OWN act: an edit whose permission request declares a location\n * outside the scope is still denied in flight by the runner. What this list adds is visibility for\n * what that guard cannot see — shell commands, which declare no location, and other people's edits.\n * One limit on that: for an application nested inside its repository, a NEW untracked file created\n * OUTSIDE the application is not listed, because `ls-files --others` run from the application root sees\n * only untracked files beneath it. A shell write escaping the application is visible here when it\n * modifies a tracked file, not when it creates one. Verification runs regardless.\n * assurance-control: WILDO.SOFTWARE.AI_PRODUCED_CHANGE_CONTROL — what a run changed outside its task's scope inside the application, shell writes included, is recorded on its result; a new file a shell command creates outside the application is the one change this list cannot see.\n */\nfunction assessApplicationCodingTaskMutationScope(\n changeSet: GitChangeSetCapture,\n allowedPrefixes: readonly string[],\n prohibitedPrefixes: readonly string[],\n): ApplicationCodingTaskScopeAssessment {\n const normalizedAllowed = allowedPrefixes.map(normalizeApplicationRelativePrefix);\n const normalizedProhibited = prohibitedPrefixes.map(normalizeApplicationRelativePrefix);\n /*\n * Committed paths are deliberately EXCLUDED from the scope decision. They are\n * present in `changeSet.files` (as `COMMITTED_DURING_RUN`) so nothing is\n * invisible, but nobody can attribute them: a parallel session's commit and\n * the agent's own look identical from here, so listing them would record\n * other people's work as this run's. `historyMutated` carries that fact forward\n * instead, for whoever reviews the result.\n */\n /*\n * A disappearance is only listed when the run can be held responsible for it, and a commit\n * landing inside the window is precisely when it cannot.\n *\n * `disappearedFromBaseline` is \"dirty at baseline, no longer dirty post-run\", which has two\n * causes that look identical from here: the agent reverted or deleted the file (attributable,\n * and a real boundary breach if the path is out of scope), or a commit emptied the dirty set\n * (not attributable — a parallel session's commit and the agent's own are indistinguishable,\n * which is the exact reasoning the `COMMITTED_DURING_RUN` exclusion above already applies).\n *\n * Including them unconditionally made the two treatments contradict each other: the committed\n * PATHS were excluded as unattributable while the disappearance THAT SAME COMMIT CAUSED was\n * used to fail the run. Measured 2026-08-28 on wonder-crm — a run that stopped cleanly at\n * `end_turn`, honoured every permission decision and wrote NOTHING (`runExclusive: 0`,\n * `appearedDuringRun: 0`) was recorded `mutation_scope_violation` against 13 engine paths it\n * never touched, because a human committed at 17:47:56 and 17 baseline-dirty files left the\n * set. The field's own contract already said they \"are NOT attributed change-set entries\".\n *\n * So the exclusion is conditional, not blanket: with no commit in the window a disappearance\n * IS the run's doing and is still listed. Only the case the run cannot be responsible for is\n * dropped, and it stays visible — the paths remain on `disappearedFromBaseline`, and\n * `historyMutated` tells the reviewer the window is unattributable.\n */\n const disappearancesAttributableToTheRun = changeSet.headMovedDuringRun\n ? []\n : changeSet.disappearedFromBaseline;\n\n /*\n * A CONCURRENT_HOST_LANE path is excluded for the same reason a committed one\n * is, and the exclusion is applied in the same place for the same reason: it\n * belongs to a companion lane that runs INSIDE this window and is not this\n * run's to write. The research dispatch takes no workspace-mutation lock by\n * design — it mutates nothing but its own evidence store — and that store is\n * committable and therefore fully visible here, so before this filter (2026-09-09,\n * while this check still refused) one `POST /api/companion/research` overlapping\n * a coding run failed the coding run as `MUTATION_SCOPE_VIOLATION` against files\n * it never touched. Today nothing refuses; the filter keeps another lane's\n * writes off the out-of-scope list the reviewer reads, so that list names only\n * paths that could be this run's.\n *\n * Both halves are filtered, and the second is easy to miss: an entry carries\n * an attribution class, while a DISAPPEARANCE is a bare path — so the\n * disappearance of an evidence file a research round rewrote or deleted would\n * otherwise be listed. One predicate answers both (its own contract says why it\n * is exported).\n */\n /*\n * And a path ABOVE THE APPLICATION ROOT is excluded on the same terms (#1020): the scope this list\n * is compared against is application-relative, so `../engine/…` can never be admitted by it, and on a\n * monorepo checkout such a path is another session's edit — 38 of the 39 paths one run was recorded\n * against. The entry stays in the change set as `OUTSIDE_APPLICATION_ROOT` and is counted; the bare\n * disappearance is filtered by the same predicate, for the reason given above.\n */\n /*\n * THE exclusion predicate, named once and read twice: by the scope list that drops these entries and\n * by the record that names them. Deriving both from one function is the point — the previous shape\n * excluded three classes and reported one, which is how the judge came to read an unexplained gap\n * twice in an hour, about a different class each time.\n */\n const isExcludedFromScopeAssessment = isAttributedToAnotherWriter;\n const outOfScopePaths = [\n ...changeSet.files\n .filter((entry) => !isExcludedFromScopeAssessment(entry.attribution))\n .map((entry) => entry.path),\n ...disappearancesAttributableToTheRun.filter((path) => !isConcurrentHostLanePath(path) && !isOutsideApplicationRootPath(path)),\n ]\n .filter((path) => {\n const normalizedPath = normalizeApplicationRelativePrefix(path);\n const inAllowedScope = normalizedAllowed.some((prefix) => matchesApplicationRelativePrefix(normalizedPath, prefix));\n const inProhibitedScope = normalizedProhibited.some((prefix) => matchesProhibitedPrefix(normalizedPath, prefix));\n return !inAllowedScope || inProhibitedScope;\n });\n /*\n * Everything the scope list deliberately drops, named WITH THE CLASS that dropped it, so the record\n * reconciles itself instead of leaving a reader to infer an omission. Derived from the predicate\n * above, so a class added to the exclusion tomorrow is reported here the same day.\n */\n const excludedFromScopeAssessment = changeSet.files\n .filter((entry) => isExcludedFromScopeAssessment(entry.attribution))\n .map((entry) => ({ path: entry.path, attribution: entry.attribution }));\n return {\n // No field here gates the run: all are recorded for whoever reviews and commits this result.\n outOfScopePaths,\n excludedFromScopeAssessment,\n historyMutated: changeSet.headMovedDuringRun,\n };\n}\n\n/**\n * The LIVE counterpart of {@link assessApplicationCodingTaskMutationScope}:\n * decides, while the agent is still running, whether one absolute path is\n * inside the task's declared mutation scope.\n *\n * Deliberately reuses the SAME normalisation and boundary matching as the\n * post-hoc assessment. Two predicates answering \"is this path in scope?\" with\n * different rules would make the record contradict the guard — a path the live\n * guard permitted listed as out of scope afterwards, or a refused one missing\n * from that list's reasoning. (The post-hoc assessment only records since\n * 2026-09-13; the agreement still matters, because the reviewer reads both.)\n *\n * It NARROWS and never widens: the permission ceiling still decides the KIND of\n * operation, and this only refuses a path that ceiling would otherwise allow.\n * A path outside the workspace is refused outright rather than reasoned about.\n */\n/*\n * The option refs and the field ref moved to `@wildo-ai/platform-core-shared` on 2026-09-19, beside\n * the `workbenchParkedCodingQuestions` row that carries them to a browser. They are re-exported here\n * under their old names so this file's callers are unchanged, and there is ONE declaration.\n */\nexport { Workbench_ParkedCodingQuestionOptionRef as ParkedCodingQuestionOptionRef } from '@wildo-ai/platform-core-shared';\nexport { WORKBENCH_PARKED_CODING_QUESTION_FIELD_REF as PARKED_CODING_QUESTION_FIELD_REF } from '@wildo-ai/platform-core-shared';\n\n/**\n * Exported for tests that build the service without its constructor (field initializers do not run\n * under `Object.create`), so they read the PRODUCTION classification rather than a copy of it.\n */\nexport const CODING_RUN_OPTIONS: ActorExecutionRunOptions<CodingRunResult> = {\n suspendOn: (result) => (result.kind === CodingRunEnding.PARKED ? result.suspension : null),\n concludeAs: (result) => (result.kind === CodingRunEnding.CONCLUDED ? result.conclusion : null),\n};\n\n/**\n * Project a parked coding run as a decision a person can be shown.\n *\n * ONE free-text field, because that is what ACP gives us: `CodingAgent_SessionSuspension` carries the\n * agent's end-of-turn message and nothing structured. The payload's field set is general enough to\n * carry that as its degenerate case, which is the point of modelling a question as a field set rather\n * than as \"the question\".\n *\n * `resumable: false` is surfaced in the description rather than hidden: the question is still real,\n * but answering starts a NEW session that must restate the task context — a degradation the person\n * deciding should see, not one the caller should smooth over.\n */\nfunction projectParkedCodingQuestionAsDecision(parked: {\n /** The TASK id — the lane's handle everywhere (the answer door, the live stream, the board row). */\n readonly taskId: string;\n readonly taskRef: string;\n readonly suspension: { readonly question: string; readonly resumable: boolean };\n readonly parkedAt: string;\n}): HumanDecision_Request {\n return {\n decisionId: parked.taskId,\n title: parked.taskRef,\n description: parked.suspension.resumable\n ? 'The coding agent stopped to ask. Answering resumes the same session.'\n : 'The coding agent stopped to ask. This session cannot be re-entered, so answering starts a NEW one that must restate the task context.',\n fields: [{\n ref: WORKBENCH_PARKED_CODING_QUESTION_FIELD_REF,\n question: parked.suspension.question,\n kind: HumanDecision_FieldKind.FREE_TEXT,\n }],\n options: [\n { ref: Workbench_ParkedCodingQuestionOptionRef.ANSWER, label: 'Answer and continue', intent: HumanDecision_ResponseIntent.PROCEED_WITH_VALUES },\n { ref: Workbench_ParkedCodingQuestionOptionRef.CANCEL, label: 'Cancel this run', intent: HumanDecision_ResponseIntent.ABORT },\n ],\n requestedAt: parked.parkedAt,\n };\n}\n\nexport function buildApplicationCodingTaskLocationPredicate(\n workspaceRootPath: string,\n allowedPrefixes: readonly string[],\n prohibitedPrefixes: readonly string[],\n): (absolutePath: string) => boolean {\n const normalizedAllowed = allowedPrefixes.map(normalizeApplicationRelativePrefix);\n const normalizedProhibited = prohibitedPrefixes.map(normalizeApplicationRelativePrefix);\n\n /*\n * Compare against BOTH the configured root and its physical realpath.\n *\n * Agents report CANONICAL absolute paths. Measured live on 2026-08-27: with a\n * workspace under `/var/folders/...` (a macOS symlink to `/private/var/...`),\n * the agent's permission request named the `/private/...` form while the\n * configured root was the `/var/...` form, so an IN-SCOPE edit was refused and\n * the run reported the agent declining to do its job. A scope predicate that\n * silently denies everything is worse than one that denies nothing, because\n * it looks like the agent failing rather than the guard misfiring.\n */\n const candidateRoots = applicationRootSpellings(workspaceRootPath);\n\n // assurance-control: WILDO.SOFTWARE.AI_PRODUCED_CHANGE_CONTROL — a task's write scope admits only paths inside the application that its allowed prefixes cover and its prohibited prefixes do not, under either spelling of the root.\n return (absolutePath: string): boolean => {\n if (!isAbsolute(absolutePath)) {\n return false;\n }\n const relativePath = candidateRoots\n .map((root) => relative(root, absolutePath))\n .find((candidate) => candidate && !candidate.startsWith('..') && !isAbsolute(candidate));\n if (!relativePath) {\n return false;\n }\n const normalizedPath = normalizeApplicationRelativePrefix(relativePath.split(sep).join('/'));\n const inAllowedScope = normalizedAllowed.some((prefix) => matchesApplicationRelativePrefix(normalizedPath, prefix));\n const inProhibitedScope = normalizedProhibited.some((prefix) => matchesProhibitedPrefix(normalizedPath, prefix));\n return inAllowedScope && !inProhibitedScope;\n };\n}\n\n\nfunction normalizeApplicationRelativePrefix(value: string): string {\n return value.replace(/\\\\/g, '/').replace(/^\\.\\//, '').replace(/\\/+$/, '');\n}\n\n/**\n * A PROHIBITION matches case-insensitively (#3224 review): on a case-insensitive file system (macOS by default)\n * `Build-Task-Decisions.json` and `.Wildo-Saas/` ARE the prohibited entries, so an exact compare let a case variant through.\n * The allowed side stays exact: a prohibition may be wider than written, an admission may not.\n */\nfunction matchesProhibitedPrefix(path: string, prefix: string): boolean {\n return matchesApplicationRelativePrefix(path.toLowerCase(), prefix.toLowerCase());\n}\n\n/** Prefix matches require a path boundary: `src/app` does not admit `src/application`. */\nfunction matchesApplicationRelativePrefix(path: string, prefix: string): boolean {\n return path === prefix || path.startsWith(`${prefix}/`);\n}\n\n/** How long one read of the coding agent's login serves the polled status route (#1637). */\nconst CODING_AGENT_LOGIN_CACHE_MS = 60_000;\n\n/**\n * What a generation step that SHARED the working tree with concurrent coding runs may claim as its own (#2240):\n * the captured paths under the directories only it writes. Its capture also holds its siblings' writes, so a\n * path outside those directories is not its to be named for, and the wave reconciliation commits it, writer\n * unknown.\n *\n * The directories are the dispatch plan's writable roots for the step, derived from its evidence paths (the\n * label unit trees, the brand module's directory, the published documentation index, the migrations\n * directory), never a second hand-kept list. A coding run that edited a file under one of them anyway would\n * have it committed under the step's name; that is the step's tree, and the coding policy keeps the generated\n * documentation prefix out of a coding run's scope for exactly that reason.\n *\n * An entry may also name ONE FILE: a step `GENERATION_STEP_WRITE_SCOPE` scopes to its `EVIDENCE_FILES` (the\n * `design-tokens` stylesheet #2358, the `design-system-brand` module #2353, the `engine-capabilities` step's\n * `wildo.saas.config.ts` #2497, every file of the `display-name` step #2505 review F2). Such a file is NEVER claimed\n * here: other writers share it or the directory around it (frontend coding tasks write beside the stylesheet, coding\n * tasks write the configuration, website section tasks write the label packs), so claiming it would commit a concurrent\n * run's half-written edits under this step's name. It is left for the wave-end reconciliation, which commits it with its\n * siblings. A NESTED directory written without its trailing slash still claims what lies beneath it, and `src/app` never\n * claims `src/application`; a bare root-level name cannot be told from a root-level file, so it is dropped too. Every\n * root `resolveGenerationStepWritableRoots` answers for a directory carries its slash.\n */\nexport function claimGenerationStepOwnedPaths(capturedPaths: readonly string[], ownedPathPrefixes: readonly string[]): readonly string[] {\n // A file path read as a directory (`frontend/index.html/`) prefixes nothing, and a root-level file is dropped outright,\n // so neither is ever claimed.\n const prefixes = ownedPathPrefixes\n .filter((prefix) => prefix.length > 0 && prefix !== '/' && (prefix.endsWith('/') || prefix.includes('/')))\n .map((prefix) => (prefix.endsWith('/') ? prefix : `${prefix}/`));\n return capturedPaths.filter((capturedPath) => prefixes.some((prefix) => capturedPath.startsWith(prefix)));\n}\n\n@injectable()\nexport class CodingAgentDispatchCompanionService {\n private readonly logDebug: (message: string, context?: Record<string, unknown>) => void;\n\n /**\n * The CANCEL HANDLE of the coding session this process is driving — nothing more (#1361).\n *\n * Until 2026-09-20 this was also the single-flight flag (the \"fast 409\" in front of the lockfile),\n * and the status route's answer to \"is a run active\". Both now read the actor plane: a coding run\n * holds the engine's lease on the `worktree` subject, so the refusal and the badge are as true\n * after a restart, or from a second process, as inside the one driving the run. What cannot live\n * on a row is an `AbortController`, so that is what stays here.\n */\n private readonly activeRuns = new Map<string, ActiveRunState>();\n\n /**\n * The {@link CODING_RUN_HEARTBEAT_RELATIVE_PATH} beat, in step with {@link activeRuns}. Built on first\n * use, because harnesses build this service through `Object.create` and skip field initializers.\n */\n private codingRunHeartbeat: InFlightWorkHeartbeat | undefined;\n\n /**\n * How deeply each task's coding work is in flight — what the heartbeat reads, rather than\n * {@link activeRuns}'s size.\n *\n * `activeRuns` is keyed by task and RE-ENTERED: a run that parks on a question is resumed from inside\n * its own chain (#1559), and that resume swaps its own registration in under the same key and puts the\n * run's back afterwards (#1581). The heartbeat must not follow the set's size through that swap: a\n * resume with no run registered around it would be one entry that appears and disappears unsynced, and\n * a CONCURRENT run with no sibling would have the supervisor restart under it. So the heartbeat counts\n * depth: {@link registerActiveRun} adds one, {@link unregisterActiveRun} takes one, and the resume adds\n * and takes its own. The answer chain is held whole because it is registered whole (#1581). Built\n * lazily for the same `Object.create` reason as the beat itself.\n */\n private codingWorkDepth: Map<string, number> | undefined;\n\n private adjustCodingWorkDepth(taskId: string, delta: 1 | -1): void {\n this.codingWorkDepth ??= new Map();\n const next = (this.codingWorkDepth.get(taskId) ?? 0) + delta;\n if (next > 0) this.codingWorkDepth.set(taskId, next);\n else this.codingWorkDepth.delete(taskId);\n this.syncCodingRunHeartbeat();\n }\n\n private syncCodingRunHeartbeat(): void {\n // No application root, nowhere to beat — a harness, never a running companion. The beat describes\n // the run; it must never be able to fail it.\n const saasRoot = this.companionContext?.saasRoot;\n if (typeof saasRoot !== 'string') return;\n this.codingRunHeartbeat ??= new InFlightWorkHeartbeat(\n join(saasRoot, CODING_RUN_HEARTBEAT_RELATIVE_PATH),\n CODING_RUN_HEARTBEAT_INTERVAL_MS,\n (message, error) => this.logDebug(message, { error: describeCaughtError(error) }),\n );\n this.codingRunHeartbeat.sync((this.codingWorkDepth?.size ?? 0) > 0);\n }\n\n /**\n * Who cancelled a run, keyed by its ABORT CONTROLLER (#1751 review N2). A resumed turn swaps a new\n * registration in that SHARES the run's controller and restores the old one afterwards, so a field on\n * the registration was lost when a person cancelled during that turn; the controller is the one thing\n * both registrations hold. Not the abort REASON: consumers of the signal throw its reason, and the lane\n * classifies a cancelled turn by its AbortError.\n */\n private readonly cancellersByController = new WeakMap<AbortController, string>();\n\n /**\n * Every coding run's time in the tree, kept for the runs that overlap it (#1528): a concurrent run\n * records which runs shared the tree with it and which paths they both changed. Pruned to\n * {@link CODING_RUN_WINDOW_RETENTION_MS}; in-process, because the comparison is only ever made by\n * the process that drove both runs.\n */\n private codingRunWindows: CodingRunWindow[] = [];\n\n /**\n * The coding agent's account usage limit, while it lasts (#2388): set by the run that met it, released by\n * its reset or by a success whose run STARTED after the limit was met (an earlier sibling's success proves\n * nothing, #2388 review F4). The build wave reads it before it fills a slot\n * ({@link readCodingAgentUsageLimitHold}), so no turn is started into a window certain to refuse it.\n *\n * In-process on purpose, and that is also the operator's door: a hold is only ever a reason not to START\n * a turn, so losing it costs at most one turn, which meets the limit again, records it again and is\n * counted by nothing. Restarting the companion clears it — the way past a stated reset after switching\n * the agent's account, until a console verb exists for that. An explicitly dispatched single task\n * (`wildo build run <task>`) is never held: an operator who starts one is choosing to try, and its success —\n * a run started after the limit — releases the hold.\n */\n private codingAgentUsageLimitHold: (CodingAgentUsageLimit & { readonly taskRef: string; readonly runTaskId: string }) | undefined;\n\n /**\n * The network loss holding coding admissions (#3236): set by a run whose failure names the network, and by a\n * connectivity probe that fails (at admission, or at a cancelled turn's settlement on a host whose traffic goes\n * direct). Released by a probe of the agent's API that succeeds (at admission, at a settlement, or the background\n * probe that runs while it is open), by a success whose run STARTED after the loss was met, by a person's re-arm for\n * the environment, and, for an agent with no host to probe, after one interval's pause. While it holds,\n * {@link awaitCodingAgentConnectivity} keeps every new admission waiting on a probe, so no turn is started into a\n * network certain to fail it. See `coding-agent-connectivity.models.ts` for the probe and the bound.\n *\n * In-process, like the usage-limit hold and for the same reason: a hold is only a reason not to START a turn, so\n * losing it to a restart costs at most one turn, which meets the loss again and records it again.\n */\n private codingAgentConnectivityHold: CodingAgentConnectivityHold | undefined;\n\n /**\n * A verification check that cannot be asked for a host cause that will not clear on its own (#3423, #3432), one of\n * {@link VerificationHostCause}: set by the run that met it, released by its cause's probe (a PATH lookup for an absent\n * command, asking the command for the verb, a re-ask once `reaskAfter` passes), by a run that ASKED the held check, or by\n * a person's re-arm for the environment. While it holds, every coding admission probes first and is refused, without\n * spending an attempt, while the cause stands.\n *\n * An absent command and a command lacking the verb open on the FIRST run: their probes are free, so a hold opened\n * wrongly costs one probe, while each turn admitted into them costs a whole coding turn that its check then cannot\n * judge. Any other host cause opens once it repeats on two distinct tasks each run alone ({@link hostCheckFailureLedger}).\n * In-process, like the other holds: a restart loses it and the next run meets it again.\n */\n private verificationToolUnavailableHold: VerificationToolUnavailableHold | undefined;\n\n /**\n * Host-attributed check failures seen on runs that ran ALONE (#3432), keyed by check and normalized message, with the\n * tasks each was met on: two distinct tasks open a {@link VerificationHostCause.REPEATED_HOST_FAILURE} hold. A run that\n * ASKS the check clears its entries, since the cause is then gone. Kept across a re-ask, so the same failure on the run\n * a re-ask admits holds again at once rather than after two more tasks.\n */\n private hostCheckFailureLedger: Map<string, { readonly checkRef: string; readonly message: string; readonly taskRefs: Set<string> }> | undefined;\n\n /** {@link hostCheckFailureLedger}, created on first use. */\n private hostCheckFailures(): Map<string, { readonly checkRef: string; readonly message: string; readonly taskRefs: Set<string> }> {\n return (this.hostCheckFailureLedger ??= new Map());\n }\n\n /** The verb probe of a {@link VerificationHostCause.COMMAND_LACKS_VERB} hold in flight, and when the last one started. */\n private verbProbeInFlight: Promise<void> | undefined;\n private verbProbeStartedAtMs = 0;\n\n /**\n * Every network loss this process recorded, with when it was seen and when it ended, kept for the turns in flight\n * across it (#3236): a turn settling `cancelled` is the network's when it was running at a loss, did no work after\n * it, and settled while it held or within a grace after it ended (`deriveCodingRunNetworkFailure`). A loss is\n * recorded when a turn REPORTS the network and when a connectivity probe FAILS (at admission, or at a cancelled\n * turn's settlement), and it ends when the hold it opened is released. It outlives the hold, because the measured\n * turns settled on reconnect, after a probe could already have released it. Pruned to\n * {@link CODING_RUN_WINDOW_RETENTION_MS} after it ended.\n *\n * In-process, like the hold, and losing it to a restart costs nothing it was needed for: a coding turn cannot outlive\n * the process that drove it, so every turn whose attribution would read this record dies with it, and is settled\n * through the interrupted-run path at the next start rather than by this attribution.\n */\n private connectivityLosses: CodingAgentConnectivityLoss[] | undefined;\n\n /** The background probe of an open hold (re-review of 1da455d5d, R1), or undefined while no hold is open. */\n private backgroundConnectivityProbe: { readonly cancel: () => void } | undefined;\n\n /**\n * Who wants to know that a run's writes were committed by the loop (#1534).\n *\n * A commit LANDS a task, so every derived board that reads landing is stale the moment one is made.\n * The workbench's `accept` invalidates the creation-plane projection itself; the loop cannot,\n * because the projection already depends on THIS service and injecting it back would be a cycle.\n * So the dependency points the way it already does: the projection subscribes here.\n */\n private readonly runAcceptedListeners: Array<() => void> = [];\n\n public registerRunAcceptedListener(listener: () => void): void {\n this.runAcceptedListeners.push(listener);\n }\n\n /**\n * Who wants to know that a build task's RUN STATE changed (#1310) — every trigger is listed on\n * {@link announceRunStateChanged}: selected, started (fresh or resumed), settled, refused before\n * admission, re-armed, and a generation step opening and ending.\n *\n * Wider than {@link registerRunAcceptedListener} on purpose. Each moves the creation boards through\n * actor-plane state no file signature can see: a selected or started run is in flight to the\n * next-task selection, a settled one changes its dispatch row and can LAND a task declaring no\n * product (the RAN-not-PROVEN mark), a refusal leaves a counted failure, and a re-arm releases a task\n * the loop guard or attempt budget was holding — which is what un-stucks the eligibility board's\n * all-stuck gate. Same direction as the accepted-run seam, for the same reason: the projection\n * depends on this service, so it subscribes here.\n *\n * One timing is deliberate rather than exact: a run that PARKS inside a fresh chain is announced\n * when that chain ends, after the answering agent's turn, so for about one model call a cached\n * board may still count it as in flight. Announcing at the park would re-derive the boards and\n * then again at the chain's end, for a window that closes on its own.\n */\n private readonly runStateChangedListeners: Array<() => void> = [];\n\n public registerRunStateChangedListener(listener: () => void): void {\n this.runStateChangedListeners.push(listener);\n }\n\n /**\n * Who wants to know that a build task's coding run COMPLETED (#2593): the build task and the run, announced once per\n * run after its rows have moved and its writes were accepted under the posture. Separate from\n * {@link registerRunStateChangedListener}, which carries no identity because the boards only need to re-derive: a\n * listener here acts on ONE run (the build dispatch service reviews a website task's copy and records the review on\n * that run). Same direction as the other seams: the listener's service depends on this one.\n *\n * A listener must not hold the run up: it is called synchronously, inside the run's settle (a single-flight run still\n * holds the workspace lock there), so anything slow is started and left to finish on its own.\n */\n private readonly runCompletedListeners: Array<(completed: { readonly taskRef: string; readonly runTaskId: string }) => void> = [];\n\n public registerRunCompletedListener(listener: (completed: { readonly taskRef: string; readonly runTaskId: string }) => void): void {\n this.runCompletedListeners.push(listener);\n }\n\n private announceRunCompleted(completed: { readonly taskRef: string; readonly runTaskId: string }): void {\n for (const listener of this.runCompletedListeners) {\n try { listener(completed); } catch (error) { this.logDebug('A run-completed listener threw', { error: describeCaughtError(error) }); }\n }\n }\n\n /**\n * Every read-modify-write of a coding run's MEMORY goes through this one lane (#2593): a re-arm, an interference and\n * a copy review each append to the long-term store by writing the whole memory back, so two of them interleaved on\n * one run would drop the first one's entry. They used to be sequential by accident (the wave re-armed, then recorded\n * the interference); the copy review starts when a run completes, which is not ordered against either.\n */\n private runMemoryWrites: Promise<unknown> | undefined;\n\n /** Run `write` after every memory write already queued, whether those succeeded or not; `undefined` = none queued. */\n private serializeRunMemoryWrite<T>(write: () => Promise<T>): Promise<T> {\n // A run's memory is about to change: a per-task read held for a task outside the window may describe it (#3204).\n this.completedRunsOutsideWindow?.clear();\n const next = (this.runMemoryWrites ?? Promise.resolve()).then(write, write);\n // And once it has: a read made during the write may hold the rows as they were before it.\n this.runMemoryWrites = next.catch(() => undefined).finally(() => this.completedRunsOutsideWindow?.clear());\n return next;\n }\n\n /**\n * Tell the run-state-changed listeners, each isolated from the others.\n *\n * Called at every change to a build task's run state that no file shows:\n *\n * - **SELECTED** — {@link openSelectedApplicationCodingExecution} opened a PENDING execution, which\n * the next-task selection already counts as in flight, whichever door opened it;\n * - **STARTED** — a fresh run ADMITTED (after its active-run entry exists), and a resumed run once\n * the engine has moved its rows back to PROCESSING (inside `resumeParkedRunHoldingLock`'s\n * executor, the one moment its start is true);\n * - **SETTLED** — LAST in the `finally` of each TOP-LEVEL chain, a fresh run's background body and\n * `resumeBody`, after the parked-question answering, the active-run release and the settlement\n * resolve, so a board re-derived because of it reads the chain's final state. Never from inside\n * `resumeParkedRunHoldingLock`'s own `finally`, which is a step of a chain some caller settles.\n * Every ending reaches it, including the ones that returned early;\n * - **RE-ARMED** — {@link rearmBuildTask}, even when one of its updates threw.\n *\n * Public because a GENERATION STEP's execution and a coding dispatch refused before admission are\n * opened and settled by the build dispatch service, so that service announces those.\n */\n public announceRunStateChanged(): void {\n // Every held read of the run rows describes the state before this change (#3204).\n this.markRunRowsChanged();\n for (const listener of this.runStateChangedListeners) {\n try { listener(); } catch (error) { this.logDebug('A run-state-changed listener threw', { error: describeCaughtError(error) }); }\n }\n }\n /**\n * Per-process settlement signal of every application coding task THIS\n * process admitted: resolved when the background run has recorded its\n * terminal durable result (or given up trying). This is the \"owner's\n * completion hook\" the episode driver waits on instead of polling the\n * Actor Task row; a task admitted by a previous process has no entry here,\n * which is correct — restart reconciliation already terminalized it.\n */\n private readonly applicationCodingTaskSettlements = new Map<string, { readonly promise: Promise<void>; resolve(): void }>();\n\n /**\n * The driver's reading of what a coding run's executor returned — see {@link CodingRunResult}.\n * One object for a first run and a resumed one, so the two cannot be read by different ladders.\n */\n private readonly codingRunOptions: ActorExecutionRunOptions<CodingRunResult> = CODING_RUN_OPTIONS;\n\n /**\n * Live-frame subscribers keyed by task id. Fed by the coding session's own\n * event stream and the ladder's state transitions while a run is active;\n * drained by the SSE endpoint. Best-effort throughout — a slow or throwing\n * subscriber never touches the run it observes.\n */\n private readonly codingSessionSubscribers = new Map<string, Set<(frame: CodingSessionLiveFrame) => void>>();\n\n constructor(\n @inject(SAAS_SERVICE_TYPES.Logger)\n private readonly logger: LoggerService,\n @inject(SAAS_SERVICE_TYPES.ErrorBuilderService)\n private readonly errorBuilder: ErrorBuilderBackendService,\n @inject(COMPANION_SERVICE_TYPES.CompanionContext)\n private readonly companionContext: CompanionContext,\n @inject(SAAS_SERVICE_TYPES.AgentsBackendService)\n private readonly agentsService: AgentsBackendService,\n @inject(COMPANION_SERVICE_TYPES.GitChangeSetService)\n private readonly gitChangeSetService: GitChangeSetCompanionService,\n @inject(COMPANION_SERVICE_TYPES.ExecutionsService)\n private readonly executionsService: CompanionExecutionsCompanionService,\n @inject(COMPANION_SERVICE_TYPES.TraceabilityService)\n private readonly traceabilityService: CompanionTraceabilityService,\n @inject(COMPANION_SERVICE_TYPES.IntrospectionService)\n private readonly introspectionService: CompanionIntrospectionService,\n // The engine's execution driver (#1359): it opens, suspends, resumes and settles every coding run.\n @inject(SAAS_SERVICE_TYPES.ActorsSystemBackendService)\n private readonly actorsSystem: ActorsSystemBackendService,\n // Which paths each run changed, attributed and hashed — what the workbench's `accept` commits (#1454, Step 7).\n @inject(COMPANION_SERVICE_TYPES.CodingRunWriteRegisterService)\n private readonly codingRunWriteRegister: CodingRunWriteRegisterCompanionService,\n // The commit door the workbench's `accept` uses — called from here only under the posture (#1534).\n @inject(COMPANION_SERVICE_TYPES.AcceptedChangeCommitService)\n private readonly acceptedChangeCommit: AcceptedChangeCommitCompanionService,\n /*\n * Whether this process is shutting down (#1026): a run admitted after the supervisor decided to\n * restart would be killed with it. `@optional()` because an in-process host that never registers\n * shutdown has nothing to refuse on, and test harnesses built without it admit as before.\n */\n @inject(SAAS_SERVICE_TYPES.WorkerShutdownManagerService) @optional()\n private readonly shutdownManager?: WorkerShutdownManagerBackendService,\n ) {\n this.logDebug = this.logger.debugByType('CodingAgentDispatchCompanionService');\n this.logger.setDebugTypeLogging('CodingAgentDispatchCompanionService', true);\n }\n\n /**\n * Admit one application-authored coding task onto the normal Flows/Actors\n * Claude Code path — the ONLY coding entry since the raw dispatch endpoint\n * was deleted at the first-activation hard cut. This method accepts only the\n * sealed typed task produced by application composition. The returned\n * acknowledgement is intentionally non-terminal; a completed Actor Task\n * records a working code result and its evidence, never accepted\n * application truth.\n */\n public async runApplicationCodingTask(\n rawTask: MetaWorkflow_ApplicationCodingTaskContract,\n sessionContext?: CompanionExecutionSessionContext,\n /**\n * The execution a caller opened when it SELECTED this task\n * ({@link openSelectedApplicationCodingExecution}). Admission then STARTS that execution instead\n * of opening one, so the run has one pair of ids from selection to settlement. The caller owns it\n * until this method resolves: a rejection here means the run never started, and the caller\n * settles what it opened.\n */\n selected?: OpenedActorExecution,\n /** Where the run was started from (#1454, Step 7): stamped on the row, never read by the run. */\n origin?: CodingRunOrigin,\n /**\n * CONCURRENT only from the build loop's wave (#1528), which opened `selected` in the same mode.\n * Every other door is single-flight, and single-flight refuses while any concurrent run is live.\n */\n mode: CodingRunConcurrency = CodingRunConcurrency.SINGLE_FLIGHT,\n ): Promise<ApplicationCodingTaskRunAdmission> {\n /*\n * Both admission refusals below are TYPED.\n *\n * A malformed contract surfaced as a raw `ZodError` and an unregistered\n * check ref as a plain `Error`, so the two refusals a caller can actually\n * provoke reached the transport as unclassified failures and answered 500\n * INTERNAL — indistinguishable from the host being broken. They are\n * VALIDATION: the request is refused, nothing was locked, created or run.\n */\n const task = this.admitTypedInput(\n () => MetaWorkflow_ApplicationCodingTaskContractSchema.parse(rawTask),\n 'Application coding task contract is not valid.',\n { refusesTaskContract: true },\n );\n // Resolve before acquiring the lock or creating a task. A semantic check\n // name is not a command and cannot silently fall back to an arbitrary\n // workspace typecheck.\n const verificationPlans = this.admitTypedInput(\n () => resolveApplicationCodingTaskVerificationPlans(task.verificationIntent.requiredChecks),\n 'Application coding task names an unregistered verification check.',\n { refusesTaskContract: true },\n );\n const traceStep = this.createOperationTraceStep(sessionContext, 'application-coding-task-admission');\n const renderedPrompt = renderApplicationCodingTaskAgentPrompt(task);\n await this.traceOperationStart({\n sessionContext,\n step: traceStep,\n type: 'application-coding-task-admission-start',\n summary: `Admit application coding task ${task.taskRef}`,\n payload: this.buildApplicationCodingTaskTraceSummary(task),\n artifactFileName: 'application-coding-task-input.txt',\n artifactContent: renderedPrompt,\n });\n\n // The FAST 409, read from the rows (#1361): a run holding the worktree that is not the one this\n // call was handed. The authoritative take is the driver's, at open — this only answers early,\n // with the holder named, instead of making the caller wait on the file lock to be told the same.\n await this.refuseWhileWorktreeIsHeld(selected?.executionId ?? null, sessionContext);\n if (mode === CodingRunConcurrency.SINGLE_FLIGHT) await this.refuseWhileConcurrentRunsInFlight(sessionContext);\n\n /*\n * Not into a network that just took a run away (#3236). Before the worktree lock, so a single-flight wait holds\n * nothing another run needs, and before anything is opened, so a refusal past the bound leaves no attempt.\n */\n await this.awaitCodingAgentConnectivity(task.taskRef);\n // Nor while a check cannot be asked for a host cause (#3423, #3432): every task's check would fail the same way.\n await this.refuseWhileVerificationToolIsUnavailable(task.taskRef);\n\n const admission = createDeferred<{ opened: OpenedActorExecution; baseline: GitWorktreeSnapshot }>();\n const runBody = async () => {\n let admitted: { opened: OpenedActorExecution; baseline: GitWorktreeSnapshot };\n /*\n * Not while this process is going away (#1026). The supervisor's restart HOLD reads the\n * workspace lock, so it protects a run that already holds it — but a dispatch still waiting\n * (the compile-quiet wait before admission) holds none, the supervisor restarts, and the SIGTERM\n * grace lets this process admit it anyway: measured 2026-09-25, a run was admitted at 11:18:12,\n * five seconds after the supervisor's stop began, and was SIGKILLed with the companion. Checked\n * here, under the lock and before anything is opened, so the refusal leaves no row behind and is\n * a HOST refusal (it counts against no attempt budget, #1581).\n */\n if (this.shutdownManager?.isShutdownInProgress() === true) {\n admission.reject(this.buildDispatchConflictError(\n `Coding task ${task.taskRef} was not started: the companion is shutting down. Dispatch it again once it is back.`,\n ));\n return;\n }\n // Before the baseline, never inside the run: a playbook file left uncommitted here would be\n // dirty at this run's baseline, and this run's own accept would then refuse it (#1534). A\n // concurrent run holds no lock, so it takes one for this commit only.\n await (mode === CodingRunConcurrency.CONCURRENT\n ? this.underBriefWorktreeLock(() => this.acceptPendingPlaybookRunsBeforeBaseline())\n : this.acceptPendingPlaybookRunsBeforeBaseline());\n try {\n const baseline = await this.gitChangeSetService.captureWorktreeSnapshot();\n // The run IS an actor-system execution from here on (#1359): the engine opens the\n // execution and its task, and will settle both however the run ends.\n const opened = selected\n ? await this.startSelectedApplicationCodingExecution(selected, task, baseline, sessionContext, origin)\n : await this.openApplicationCodingExecution(task, baseline, sessionContext, origin, mode);\n this.registerActiveRun({\n taskId: opened.taskId,\n startedAt: new Date().toISOString(),\n abortController: new AbortController(),\n mode,\n });\n this.openCodingRunWindow(opened.taskId, task.taskRef);\n // Started: the run has left the next-task selection's ready set, and no file says so yet.\n this.announceRunStateChanged();\n admitted = { opened, baseline };\n // Registered BEFORE the admission is resolved, so a caller that\n // awaits the settlement right after admission can never miss it.\n const settlement = createDeferred<void>();\n this.applicationCodingTaskSettlements.set(opened.taskId, { promise: settlement.promise, resolve: () => settlement.resolve(undefined) });\n admission.resolve(admitted);\n } catch (error) {\n admission.reject(this.translateWorktreeBusy(error));\n return;\n }\n\n try {\n const trace = await this.openCodingRunTrace(admitted.opened.taskId, task.taskRef);\n await this.superviseCodingRun(task.taskRef, admitted.opened.taskId, trace, (capture) =>\n this.actorsSystem.completeActorExecution(\n admitted.opened,\n async (opened) => capture(await this.executeApplicationCodingTask(task, renderedPrompt, verificationPlans, opened, admitted.baseline, trace)),\n trace.runSession,\n this.codingRunOptions,\n ));\n // Before the settlement resolves and before the worktree is released: a question the run\n // parked on is offered to the answering agent while nothing else can take the worktree (#1559).\n await this.answerParkedQuestionsHoldingLock(admitted.opened.taskId, sessionContext);\n } finally {\n this.endCodingRunWindow(admitted.opened.taskId);\n // A run cancelled while its question was handled ends here rather than staying parked (#1581). Awaited\n // only when cancelled, so a chain that was not unregisters in the same synchronous step as its check.\n if (this.isRunCancelled(admitted.opened.taskId)) await this.withdrawCancelledRunChain(admitted.opened.taskId, sessionContext);\n this.unregisterActiveRun(admitted.opened.taskId);\n this.applicationCodingTaskSettlements.get(admitted.opened.taskId)?.resolve();\n this.announceRunStateChanged();\n }\n };\n /*\n * A SINGLE-FLIGHT run holds the workspace lock for its whole life, as it always has. A CONCURRENT\n * run holds none (#1528): the tree is shared by decision, and interference is detected and\n * repaired rather than prevented. It takes the lock only around a commit.\n */\n const backgroundRun = mode === CodingRunConcurrency.CONCURRENT\n ? runBody()\n : withDedicatedFileLock(this.getWorkspaceMutationLockPath(), runBody, { retries: { retries: 0 } });\n backgroundRun.catch((error: unknown) => {\n admission.reject(this.mapLockError(error));\n this.logDebug('Application coding-task background run chain terminated with error', {\n error: describeCaughtError(error),\n taskRef: task.taskRef,\n });\n });\n\n const admitted = await admission.promise;\n const response: ApplicationCodingTaskRunAdmission = {\n taskId: admitted.opened.taskId,\n status: FlowsActors_Status.PROCESSING,\n taskRef: task.taskRef,\n baselineHeadSha: admitted.baseline.headSha,\n baselineDirtyFileCount: Object.keys(admitted.baseline.files).length,\n };\n /*\n * The run has STARTED by now, so nothing after this point may reject: a caller reads a rejection\n * from this method as \"the run never started\" and settles its execution ABORTED (#1581, second\n * review A7). The trace is evidence ABOUT the admission, never a condition of it.\n */\n try {\n await this.traceOperationSuccess({\n sessionContext,\n step: traceStep,\n type: 'application-coding-task-admission-success',\n summary: `Admitted application coding task ${task.taskRef} as Actor Task ${admitted.opened.taskId} of execution ${admitted.opened.executionId}`,\n payload: response,\n artifactFileName: 'application-coding-task-admission.json',\n artifactContent: response,\n });\n } catch (traceError) {\n this.logDebug('The admission-success trace could not be written; the run is admitted regardless', {\n taskId: admitted.opened.taskId, error: describeCaughtError(traceError),\n });\n }\n return response;\n }\n\n /**\n * The settlement of one application coding task admitted by THIS process:\n * resolves once its terminal durable result has been recorded (success or\n * failure) — the only moment a waiting episode can read a non-PROCESSING\n * row. `null` for a task this process did not admit (a previous process's\n * row, already terminalized by restart reconciliation, or an unknown id):\n * there is nothing to wait for, and a caller must not spin on it.\n */\n public awaitApplicationCodingTaskSettlement(taskId: string): Promise<void> | null {\n return this.applicationCodingTaskSettlements.get(taskId)?.promise ?? null;\n }\n\n /**\n * Read one application coding task's OUTCOME from its durable row.\n *\n * Pairs with {@link awaitApplicationCodingTaskSettlement}: wait for the settlement, then ask this\n * what the run did. The two are deliberately separate — the settlement is an in-process fact (only\n * this process holds the deferred), while the outcome is durable and survives the restart that a\n * rebuild triggers, so a caller that lost the settlement can still answer the question.\n *\n * `null` for a row that is not an application coding task, or that cannot be read at all. An\n * unreadable row is not a failed run, and a caller must not report it as one.\n */\n public async readApplicationCodingTaskOutcome(\n taskId: string,\n sessionContext?: CompanionExecutionSessionContext,\n ): Promise<ApplicationCodingTaskSettledOutcome | null> {\n let row: { _id?: string; status?: unknown; actors?: { actorRef?: string }; input?: unknown; output?: unknown };\n try {\n row = await this.executionsService.getActorTask(taskId, sessionContext);\n } catch {\n return null;\n }\n // MEMBERSHIP, as everywhere else that classifies one of these rows: a second declared coding\n // agent must not make this silently answer \"not a coding run\".\n if (!isApplicationCodingAgentRef(row.actors?.actorRef)) return null;\n const output = isRecordValue(row.output) ? row.output : {};\n const verificationRows = (Array.isArray(output.verification) ? output.verification : [])\n .filter((entry): entry is Record<string, unknown> => isRecordValue(entry))\n .map((entry) => ({\n checkRef: typeof entry.checkRef === 'string' ? entry.checkRef : 'unknown',\n success: isRecordValue(entry.outcome) && entry.outcome.success === true,\n }));\n const failedVerificationRefs = verificationRows.filter((entry) => !entry.success).map((entry) => entry.checkRef);\n return {\n taskId: typeof row._id === 'string' ? row._id : taskId,\n taskRef: isRecordValue(row.input) && typeof row.input.taskRef === 'string' ? row.input.taskRef : null,\n status: typeof row.status === 'string' ? row.status : 'UNKNOWN',\n succeeded: output.succeeded === true,\n disposition: typeof output.disposition === 'string' ? output.disposition : null,\n // The STATUS says it, since #1359: a parked run waits as `AWAITING_APPROVAL`. The output still\n // carries the question while it waits, but a withdrawn park keeps that output and is not waiting.\n awaitingAnswer: row.status === FlowsActors_Status.AWAITING_APPROVAL,\n failedVerificationRefs,\n verification: verificationRows,\n changeSetSummary: isRecordValue(output.changeSetSummary) ? output.changeSetSummary : null,\n scopeAssessment: isRecordValue(output.scopeAssessment) ? output.scopeAssessment : null,\n agentStopReason: typeof output.agentStopReason === 'string' ? output.agentStopReason : null,\n };\n }\n\n /**\n * Settle what a previous process left behind: coding runs still `PROCESSING`, and parked\n * questions a restarted host can no longer show as answerable.\n *\n * A companion restart cannot prove the previous coding subprocess is still running. Retrying\n * could duplicate a worktree mutation, while reverting would destroy evidence. The safe result is\n * therefore a terminal abort plus an explicit human-review disposition carrying what the worktree\n * looked like when the restart found it.\n *\n * Since #1359 the engine's execution driver does the settling, exactly as it does for playbook\n * runs, and this method supplies the two things only the coding lane knows:\n *\n * 1. **What an ORPHAN's task should say** — the recovery evidence. The driver lists the\n * `PROCESSING` executions of `application-coding.system` and settles each `ABORTED`.\n * 2. **Which PARKS survive a restart: every one whose session can be re-entered.** A parked run\n * is `AWAITING_APPROVAL`, never `PROCESSING`, so the orphan sweep cannot touch it — the\n * exemption this method used to carry by hand (measured 2026-09-04: the sweep terminalized a\n * parked row three seconds before the operator's answer arrived) is a property of the status.\n * What is aborted here is only a park no host could answer on its session — a non-resumable one,\n * or one whose checkpoint cannot be read ({@link isParkedCodingRunAnswerable}). A park is NOT\n * aborted for its age: that reaped every question that waited longer than fifteen minutes (#1533).\n */\n public async reconcileInterruptedApplicationCodingTasks(\n sessionContext?: CompanionExecutionSessionContext,\n options?: {\n /**\n * Told each run that was interrupted WHILE RUNNING, the moment the sweep finds it (#1805). The sweep\n * settles those runs and never recovers their writes: the caller recovers every run the restart\n * interrupted in one pass ({@link recoverWritesOfInterruptedRuns}). Told as they are found rather\n * than only returned, because the sweep can still throw afterwards — listing or aborting the parked\n * runs — and a run already settled ABORTED is found by no later boot.\n */\n readonly onInterrupted?: (run: InterruptedRun) => void;\n },\n ): Promise<{ reconciledTaskIds: string[]; interruptedWhileRunning: readonly InterruptedRun[] }> {\n const reconciledTaskIds: string[] = [];\n const interruptedWhileRunning: InterruptedRun[] = [];\n\n await this.actorsSystem.reconcileOrphanedActorExecutions(APPLICATION_CODING_SYSTEM_REF, sessionContext, {\n describeOrphan: async (orphan) => {\n reconciledTaskIds.push(...orphan.tasks.map((task) => task._id));\n /*\n * A PENDING orphan was SELECTED and never admitted — usually a restart during the compile-quiet\n * wait. It touched nothing, so it has no writes to recover and nothing to review, and it was no\n * attempt: recorded like a refused dispatch, `{ failure }` and no disposition, so the build\n * board does not count it as a started run that \"requires review\" (#1581, second review A4).\n */\n if (orphan.status === FlowsActors_Status.PENDING) {\n return { failure: { message: 'Selected, and the companion stopped before the run was admitted; nothing ran.' }, [INTERRUPTED_AT_STARTUP_OUTPUT_FIELD]: true };\n }\n // A concurrent run held only its own task, so siblings wrote in the tree beside it (#1528).\n const sharedTree = isConcurrentRunSubject(orphan.exclusiveSubject);\n for (const task of orphan.tasks) {\n const run: InterruptedRun = { taskId: task._id, sharedTree };\n interruptedWhileRunning.push(run);\n options?.onInterrupted?.(run);\n }\n return this.describeInterruptedCodingRun();\n },\n });\n\n const waiting = await this.actorsSystem.listSuspendedActorExecutions(APPLICATION_CODING_SYSTEM_REF, sessionContext);\n for (const row of waiting) {\n const checkpoint = ApplicationCodingRunCheckpointSchema.safeParse(row.checkpoint?.context);\n if (checkpoint.success && isParkedCodingRunAnswerable(checkpoint.data)) continue;\n try {\n await this.actorsSystem.abortSuspendedActorExecution(row._id, await this.describeInterruptedCodingRun(), sessionContext);\n } catch (error) {\n /*\n * A lost swap (#1586): something else moved this run out of waiting between the listing and the\n * abort — it is settled already, so there is nothing left to reconcile. Refusing the rest of the\n * sweep for it would leave every later unanswerable park in place. Anything else still throws.\n */\n if (isActorExecutionNotSuspendedError(error)) continue;\n throw error;\n }\n reconciledTaskIds.push(...row.tasks.map((task) => task._id));\n }\n\n return { reconciledTaskIds, interruptedWhileRunning };\n }\n\n /**\n * Record what the runs a restart stopped had written, and accept it under the posture (#1805).\n *\n * ## Why this exists\n *\n * A run interrupted mid-task leaves its writes in the tree and is settled\n * INTERRUPTED_REQUIRES_REVIEW. Nothing recorded WHICH files it wrote — its baseline lived in memory\n * — so nobody could accept them, and its retry could not claim them either: to the retry they were\n * already dirty at its own baseline (`baseline_dirty_ambiguous`). Measured 2026-09-24 on\n * scratch-journey: an interrupted `build-task-user-menu-placement` left `app-shell.config.ts` dirty;\n * the retry found the work done and recorded no files; a sibling task's edit to the same file was\n * refused as ambiguous; and every shell surface that file carries stopped landing, including one\n * that had landed hours earlier. The build sat at 91/95 with its work done.\n *\n * ## What it does\n *\n * The run's task input now carries its baseline's dirty files, so the change set is the same\n * capture a finished run gets, against the same baseline, recorded in the same write register.\n * Then the posture decides: under notify-and-proceed a RECOVERY CHECKPOINT (#3204) commits the tree as the restart left\n * it, with the INTERRUPTED_RUN_RECOVERY origin, naming every run no checkpoint named yet: the interrupted runs just\n * recorded, and finished runs whose checkpoint the stop cancelled. No run's writes are told apart from another's; each\n * run's record says which files it touched. Under a posture that keeps acceptance with a person, the record simply waits\n * for the workbench's Accept, which could not act on an interrupted run before because there was no record.\n *\n * A run started before its input carried `files` has no baseline to diff against and is left as\n * it was. BEST-EFFORT throughout: this runs on the boot path, and a boot path must not fail closed\n * on a repair (`continuity-drift-and-cas-basis.md`, Rule 3).\n */\n private async recoverInterruptedRunWrites(reported: readonly InterruptedRun[], sessionContext?: CompanionExecutionSessionContext): Promise<void> {\n const runs = await this.withRunsStillMarkedRunning(reported, sessionContext);\n const recovered: Array<InterruptedRun & { readonly startedAt: string }> = [];\n for (const run of runs) {\n try {\n /*\n * Already recovered on an earlier boot (#1805 review N4): a run whose abort did not persist is found\n * running again, and capturing it anew would overwrite the record that names its recovery commit.\n */\n /*\n * Every way this loop leaves a run without recording it also drops its in-flight claims (#3205 re-review F7):\n * the run is settled, no later boot reads them, and a stale file would read as a live run's claims forever.\n */\n const dropClaims = async (): Promise<void> => {\n try {\n await this.codingRunWriteRegister.clearInFlightClaims(run.taskId);\n } catch (error) {\n this.logDebug('Could not drop an interrupted run\\'s in-flight claims', { taskId: run.taskId, error: describeCaughtError(error) });\n }\n };\n if ((await this.codingRunWriteRegister.read(run.taskId))?.acceptedCommitSha !== undefined) {\n await dropClaims();\n continue;\n }\n const row = await this.executionsService.getActorTask(run.taskId, sessionContext) as { input?: unknown };\n const input = isRecordValue(row.input) ? row.input : undefined;\n const baseline = input && isRecordValue(input.baseline) ? input.baseline : undefined;\n const taskRef = input && typeof input.taskRef === 'string' ? input.taskRef : undefined;\n if (!taskRef || !baseline || !isRecordValue(baseline.files)\n || typeof baseline.headSha !== 'string' || typeof baseline.capturedAt !== 'string') {\n await dropClaims();\n continue;\n }\n const snapshot: GitWorktreeSnapshot = {\n headSha: baseline.headSha,\n capturedAt: baseline.capturedAt,\n files: baseline.files as GitWorktreeSnapshot['files'],\n };\n const changeSet = await this.gitChangeSetService.captureChangeSet(snapshot);\n if (changeSet.files.length === 0) {\n await dropClaims();\n continue;\n }\n /*\n * A run that shared the tree is recorded CONCURRENT with no claims: nothing survived the restart\n * that says which of its captured files it wrote. So even the workbench's per-run Accept refuses\n * them unless forced — the refusal the recovery commit itself is forced past, and names.\n */\n /*\n * The claims it made before the restart, from the on-disk copy a concurrent run keeps as its agent reports writes\n * (#3205 outcome 4): with them, what it wrote is committed under its name (the reconciliation's known writer,\n * #3218), and a person's per-run accept can take it. A run that left none is recorded with none, as before.\n */\n const claimedPaths = run.sharedTree\n ? collectRunClaimedPaths({ candidateRoots: applicationRootSpellings(this.companionContext.saasRoot), reportedFileLocations: await this.codingRunWriteRegister.readInFlightClaims(run.taskId) })\n : undefined;\n await this.codingRunWriteRegister.record({ taskId: run.taskId, taskRef, changeSet, ...(claimedPaths !== undefined ? { claimedPaths } : {}) });\n await dropClaims();\n recovered.push({ ...run, startedAt: baseline.capturedAt });\n } catch (error) {\n this.logger.warn('Could not recover the writes of an interrupted coding run; it stays for review', {\n taskId: run.taskId, error: describeCaughtError(error),\n });\n }\n }\n /*\n * ONE recovery checkpoint at every start (#3204, review of 4a1b1f1bf F7), whether or not a run was interrupted: it names\n * every run no checkpoint has named yet (an interrupted run just recorded, and a run whose checkpoint was folded into a\n * timer the stop cancelled), and commits nothing when there is none.\n */\n const outcome = await this.requestBuildCheckpoint({ force: true, origin: AcceptOrigin.INTERRUPTED_RUN_RECOVERY });\n if (recovered.length > 0 || outcome !== undefined) {\n this.logger.warn('Recovered the writes of coding run(s) a restart left uncommitted', {\n recoveredTaskIds: recovered.map((run) => run.taskId), commitSha: outcome?.commitSha, namedRuns: outcome?.namedTaskIds.length ?? 0,\n });\n }\n }\n\n /**\n * The reported runs, plus any coding run STILL marked running (#1805 review N4). At this point in startup\n * nothing is running, so such a row is an orphan whose abort did not persist — or one the sweep never\n * reached because it threw first. Either way its writes are in the tree, and leaving it out would put\n * them into the recovery commit without its name. Concurrent by its subject, like the sweep decides.\n */\n private async withRunsStillMarkedRunning(reported: readonly InterruptedRun[], sessionContext?: CompanionExecutionSessionContext): Promise<readonly InterruptedRun[]> {\n const byTaskId = new Map(reported.map((run) => [run.taskId, run]));\n try {\n for (const live of await this.listInFlightCodingRuns(sessionContext)) {\n const execution = await this.executionsService.getActorExecution(live.executionId, sessionContext) as { standaloneTasks?: ReadonlyArray<{ _id?: unknown }> };\n for (const task of execution.standaloneTasks ?? []) {\n const taskId = String(task._id);\n if (!byTaskId.has(taskId)) byTaskId.set(taskId, { taskId, sharedTree: isConcurrentRunSubject(live.exclusiveSubject) });\n }\n }\n } catch (error) {\n this.logger.warn('Could not list the coding runs still marked running; recovering the reported ones', { error: describeCaughtError(error) });\n }\n return [...byTaskId.values()];\n }\n\n /**\n * Write a run's baseline onto its own task, for a run whose task was opened before the baseline\n * existed: a GENERATION STEP, whose window captures it after the execution is open. A coding run\n * carries it from its start ({@link buildApplicationCodingTaskInput}). Best-effort: the step runs\n * whether or not its recovery evidence could be written.\n */\n private async recordRunBaselineOnTask(taskId: string, baseline: GitWorktreeSnapshot, sessionContext?: CompanionExecutionSessionContext): Promise<void> {\n try {\n const row = await this.executionsService.getActorTask(taskId, sessionContext) as { input?: unknown };\n const input = isRecordValue(row.input) ? row.input : {};\n await this.executionsService.updateActorTask(taskId, {\n input: {\n ...input,\n baseline: { headSha: baseline.headSha, capturedAt: baseline.capturedAt, dirtyFileCount: Object.keys(baseline.files).length, files: baseline.files },\n },\n }, sessionContext);\n } catch (error) {\n this.logger.warn('Could not record a generation step\\'s baseline; an interruption would leave its writes for review', {\n taskId, error: describeCaughtError(error),\n });\n }\n }\n\n /**\n * The build system's startup sweep (#1359), with the same recovery the coding sweep has. A\n * generation step interrupted mid-pass leaves the files it had written, and its re-dispatch SKIPS\n * them as fresh, so they never enter any later change set. Measured 2026-09-24: an interrupted\n * `i18n-labels` pass left ten label files uncommitted that no later run would ever commit.\n */\n public async reconcileInterruptedBuildGenerationSteps(\n buildSystemRef: string,\n sessionContext?: CompanionExecutionSessionContext,\n /** As on the coding sweep: told each interrupted step as it is found; the caller recovers the writes. */\n options?: { readonly onInterrupted?: (run: InterruptedRun) => void },\n ): Promise<{ aborted: readonly string[]; interrupted: readonly InterruptedRun[] }> {\n const interrupted: InterruptedRun[] = [];\n const { aborted } = await this.actorsSystem.reconcileOrphanedActorExecutions(buildSystemRef, sessionContext, {\n describeOrphan: async (orphan) => {\n /*\n * Not concurrent by its own subject. Whether it ran beside concurrent coding runs is decided at\n * recovery from the evidence: another run the same restart stopped, or a concurrent run that\n * recorded writes during the step's window (a wave runs a step inline while its runs write).\n */\n for (const task of orphan.tasks) {\n const run: InterruptedRun = { taskId: task._id, sharedTree: false };\n interrupted.push(run);\n options?.onInterrupted?.(run);\n }\n // HEAD now bounds the step's window for the build-task decisions reader (#3224 F2): it recorded no change set.\n return { failure: { message: 'The host running this generation step stopped before it concluded.' }, [INTERRUPTED_AT_STARTUP_OUTPUT_FIELD]: true, ...(await this.readSettledHeadStamp()) };\n },\n });\n return { aborted, interrupted };\n }\n\n /**\n * Recover the writes of EVERY run one restart interrupted, coding runs and generation steps alike,\n * in one pass (#1805). A build wave runs a generation step beside its coding runs, so runs of both\n * kinds share the tree; recovered by two separate sweeps, the first would commit the other kind's\n * files under its own run's name. The sweeps only settle and report; startup collects what both\n * report and calls this once with the union.\n */\n public async recoverWritesOfInterruptedRuns(runs: readonly InterruptedRun[], sessionContext?: CompanionExecutionSessionContext): Promise<void> {\n const byTaskId = new Map<string, InterruptedRun>();\n for (const run of runs) byTaskId.set(run.taskId, { taskId: run.taskId, sharedTree: run.sharedTree || byTaskId.get(run.taskId)?.sharedTree === true });\n await this.recoverInterruptedRunWrites([...byTaskId.values()], sessionContext);\n }\n\n /**\n * What the build tasks' coding runs left uncommitted that no automatic door will commit (#3267; under a committing\n * posture the next build checkpoint commits it, #3204), for Home and the feed:\n * the commit door's own reading (`listUncommittedRunLeftovers`), so the line and `wildo build tasks` cannot disagree.\n */\n public listUncommittedRunLeftovers(): ReturnType<AcceptedChangeCommitCompanionService['listUncommittedRunLeftovers']> {\n return this.acceptedChangeCommit.listUncommittedRunLeftovers();\n }\n\n /**\n * The HEAD at the moment a run settles without a change set, as the field its output carries (#3224 F2), or nothing\n * when git cannot say (the run's window then stays open, and the reader names the remedy).\n */\n private async readSettledHeadStamp(): Promise<Record<string, string>> {\n const head = typeof this.gitChangeSetService.readHeadCommitSha === 'function' ? await this.gitChangeSetService.readHeadCommitSha() : undefined;\n return head ? { [SETTLED_HEAD_OUTPUT_FIELD]: head } : {};\n }\n\n /** Bound a run's window at the HEAD it left, when it recorded no change set (#3224 F2). Best effort, and loud. */\n private async recordRunWindowBound(taskId: string, taskRef: string, baseline: GitWorktreeSnapshot): Promise<void> {\n try {\n const head = typeof this.gitChangeSetService.readHeadCommitSha === 'function' ? await this.gitChangeSetService.readHeadCommitSha() : undefined;\n if (head === undefined) return;\n await this.codingRunWriteRegister.recordWindowBound({ taskId, taskRef, baselineHeadSha: baseline.headSha, baselineCapturedAt: baseline.capturedAt, boundHeadSha: head });\n } catch (error) {\n this.logger.warn('Could not bound a generation step\\'s window; the build-task decisions reader keeps it open', { taskId, taskRef, error: describeCaughtError(error) });\n }\n }\n\n /**\n * What a reviewer needs to see on a coding run the host stopped under: where HEAD is and how\n * dirty the tree is NOW. A capture that fails is recorded as such — an interrupted run with no\n * evidence is still an interrupted run, and must not stay `PROCESSING` because git was unavailable.\n */\n private async describeInterruptedCodingRun(): Promise<Record<string, unknown>> {\n let currentSnapshot: GitWorktreeSnapshot | null = null;\n let captureError: unknown = null;\n try {\n currentSnapshot = await this.gitChangeSetService.captureWorktreeSnapshot();\n } catch (error) {\n captureError = error;\n }\n return {\n succeeded: false,\n disposition: ApplicationCodingTaskDisposition.INTERRUPTED_REQUIRES_REVIEW,\n // Settled by a later process's startup sweep (#3206): its finish instant is the restart, not when the run stopped.\n [INTERRUPTED_AT_STARTUP_OUTPUT_FIELD]: true,\n recoveryEvidence: currentSnapshot\n ? {\n headSha: currentSnapshot.headSha,\n dirtyFileCount: Object.keys(currentSnapshot.files).length,\n capturedAt: currentSnapshot.capturedAt,\n }\n : null,\n ...(captureError ? { recoveryCaptureError: buildOutputErrorPayload(captureError) } : {}),\n };\n }\n\n /**\n * Readiness snapshot for the status route. HONESTY CONTRACT: the\n * underlying `isAvailable()` checks ONLY that the provider registry\n * exposes an AGENT_CLIENT_PROTOCOL contract for anthropic — it does NOT\n * guarantee the ACP adapter is installed, spawnable, or authenticated. A\n * `true` here can still be followed by a spawn/auth failure at run time.\n */\n /**\n * The cross-process workspace-mutation lock path (P-19b) — one lock for\n * every mutating coding run against this application worktree.\n */\n public getWorkspaceMutationLockPath(): string {\n return resolveWorkspaceMutationLockPath(this.companionContext.saasRoot);\n }\n\n /**\n * Cancel the in-flight coding run, if there is one.\n *\n * Cooperative by construction: this signals the session, and the runner sends\n * `session/cancel` and waits before killing anything. The run therefore\n * TERMINALISES NORMALLY — with stop reason `cancelled` and a captured change\n * set — rather than vanishing. That distinction is the whole point: an\n * operator who stops a run still needs to know what it had already written.\n *\n * Returns the task that was asked to stop, or `null` when nothing is running.\n * Idempotent: cancelling an already-cancelled run signals an aborted\n * controller again, which is a no-op.\n */\n public cancelActiveApplicationCodingTask(): { taskId: string; startedAt: string } | null {\n // Every run this process drives: a wave is cancelled as one (#1528). The first is named, as before.\n // An entry whose park is being WITHDRAWN runs nothing: it was cancelled already (#1581).\n const active = [...this.activeRuns.values()].filter((run) => run.withdrawal === undefined);\n if (active.length === 0) {\n return null;\n }\n for (const run of active) {\n this.logDebug('Cancelling active application coding task', { taskId: run.taskId });\n run.abortController.abort();\n }\n return { taskId: active[0]!.taskId, startedAt: active[0]!.startedAt };\n }\n\n /**\n * Cancel ONE coding run, named by its task id — the parked-question row's own verb (#1581, seventh\n * review F2). {@link cancelActiveApplicationCodingTask} ends everything this process drives, so from\n * a parked row it did nothing when no chain held that run, and otherwise stopped OTHER runs while\n * leaving the row's own run parked.\n *\n * Three answers, and what each promises (#1581, seventh to eleventh reviews):\n *\n * - A run this process is still handling — a turn, or its question being offered to the answering\n * agent — is SIGNALLED, exactly as the process-wide cancel signals it: `cancelled: true` means the\n * signal was given, and its chain withdraws the park on its way out. That withdraw's outcome is\n * recorded on the entry, so a second cancel meanwhile AWAITS it and reports it; a cancel after the\n * chain has gone finds the park (if the withdraw failed) and withdraws it itself.\n * - A run no chain holds here is WAITING, and is withdrawn at once under a guard entry: `cancelled:\n * true` only once it is gone, else a 409 saying the question is still waiting or could not be read.\n * - `cancelled: false` when the task is neither — no chain, and no park after reading twice (a chain\n * ending during the first read may have left one).\n *\n * A park read that FAILS is never taken for \"nothing is waiting\": with a live chain the chain is still\n * signalled, since that needs no read; without one the answer is the UNCONFIRMED 409.\n */\n public async cancelApplicationCodingTask(\n taskId: string,\n sessionContext?: CompanionExecutionSessionContext,\n /** The signed-in person cancelling (#1751), when the door has one: the withdrawal records them as the decider. */\n options?: { readonly actingUserId?: string },\n ): Promise<{ cancelled: true; taskId: string; startedAt?: string } | { cancelled: false }> {\n // Read FIRST, then look for a chain: one that began meanwhile (a person's answer) owns the run by now.\n // A failed read stops nothing here: a live chain is signalled without one (#1581, eleventh review R11-1).\n const readPark = () => this.readParkedCodingRun(taskId, sessionContext, { strict: true })\n .then((parked) => ({ parked, failed: false as const }), (error: unknown) => {\n this.logger.warn('A per-run cancel could not read the coding run\\'s park', { taskId, error: describeCaughtError(error) });\n return { parked: null, failed: true as const };\n });\n let read = await readPark();\n let live = this.activeRuns.get(taskId);\n if (!live && !read.parked && !read.failed) {\n // A chain that ended during the read may have left the run parked: read once more (#1581, tenth review R10-7).\n read = await readPark();\n live = this.activeRuns.get(taskId);\n }\n const { parked } = read;\n if (live) {\n // Already cancelled, its park being withdrawn: answer with THAT withdraw's outcome, never a second one (R9-4, R10-4).\n if (live.withdrawal) return this.reportCancelledPark(taskId, await live.withdrawal, live.startedAt);\n // Signal the chain; it ends the run on its way out, naming the canceller when there is one.\n this.logDebug('Cancelling one application coding task', { taskId });\n if (options?.actingUserId && !this.cancellersByController.has(live.abortController)) {\n this.cancellersByController.set(live.abortController, options.actingUserId);\n }\n live.abortController.abort();\n return { cancelled: true, taskId, startedAt: live.startedAt };\n }\n if (read.failed) return this.reportCancelledPark(taskId, CancelledParkOutcome.UNCONFIRMED);\n if (!parked) return { cancelled: false };\n /*\n * No chain will end it, so this door does (#1581, eighth review R8-2). Guarded by a registration taken\n * in the same synchronous step as the check above: a person's answer arriving meanwhile is refused 409\n * by `refuseWhileRunChainIsLive` rather than racing the withdraw in the driver, which takes no lock\n * between reading a run as waiting and moving it; and a second cancel awaits this withdraw.\n */\n const guard: ActiveRunState = { taskId, startedAt: new Date().toISOString(), abortController: new AbortController(), mode: parked.mode, withdrawalGuard: true };\n guard.abortController.abort();\n this.activeRuns.set(taskId, guard);\n guard.withdrawal = this.endParkIfWaiting(taskId, sessionContext, options?.actingUserId);\n try {\n const outcome = await guard.withdrawal;\n if (outcome === CancelledParkOutcome.ENDED) this.announceRunStateChanged();\n return this.reportCancelledPark(taskId, outcome);\n } finally {\n if (this.activeRuns.get(taskId) === guard) this.activeRuns.delete(taskId);\n }\n }\n\n /** A cancel's answer from what became of the park: ended, or a 409 that says why it is not (#1581, tenth review). */\n private reportCancelledPark(taskId: string, outcome: CancelledParkOutcome, startedAt?: string): { cancelled: true; taskId: string; startedAt?: string } {\n if (outcome === CancelledParkOutcome.ENDED) return { cancelled: true, taskId, ...(startedAt !== undefined ? { startedAt } : {}) };\n throw this.buildDispatchConflictError(outcome === CancelledParkOutcome.STILL_WAITING\n ? `Coding task ${taskId} could not be cancelled: its question could not be withdrawn and is still waiting. Try again.`\n : `Coding task ${taskId} could not be confirmed cancelled: the run could not be read. Check it, and cancel it again if it is still waiting.`);\n }\n\n /**\n * The run holding the worktree right now, from the actor plane (#1361) — what the creation board's\n * coding-lane badge shows. It read this process's cancel handle until 2026-09-20, so a run driven\n * by another process, or selected and not yet admitted, showed as \"idle\". A status read does not\n * fail because the plane is unreachable: it then answers what this process is driving.\n */\n private async readActiveCodingRun(): Promise<{ taskId: string; startedAt: string } | null> {\n try {\n const holder = await this.actorsSystem.readExclusiveSubjectHolder(APPLICATION_CODING_SYSTEM_REF, APPLICATION_CODING_WORKTREE_SUBJECT);\n return holder ? { taskId: holder.tasks[0]?._id ?? holder._id, startedAt: holder.createdAt ?? new Date().toISOString() } : null;\n } catch {\n const active = [...this.activeRuns.values()].find((run) => run.withdrawal === undefined);\n return active ? { taskId: active.taskId, startedAt: active.startedAt } : null;\n }\n }\n\n /** The last login read, shared by every status poll inside {@link CODING_AGENT_LOGIN_CACHE_MS}. */\n private codingAgentLoginRead: { readonly at: number; readonly value: Promise<CompanionCodingAgentStatusResponse['codingAgentLogin']> } | null = null;\n\n /**\n * The selected agent's login on this host (#1637); `null` when the selection or its declaration is\n * unavailable.\n *\n * CACHED, because `getStatus` is polled — the creation board re-derives its watched boards every 15 s\n * and the status route is on the trace-exempt polling list — and the probe runs the agent's own status\n * command, which can take seconds. One read serves every poll inside the window, and concurrent polls\n * share the same in-flight read. Signing in shows up within the window, which is the cost.\n */\n private readSelectedCodingAgentLogin(): Promise<CompanionCodingAgentStatusResponse['codingAgentLogin']> {\n const now = Date.now();\n if (this.codingAgentLoginRead && now - this.codingAgentLoginRead.at < CODING_AGENT_LOGIN_CACHE_MS) return this.codingAgentLoginRead.value;\n const value = (async () => {\n try {\n return await this.agentsService.readCodingAgentHostLogin(resolveSelectedApplicationCodingAgentBinding().providerRef);\n } catch {\n return null;\n }\n })();\n this.codingAgentLoginRead = { at: now, value };\n return value;\n }\n\n public async getStatus(): Promise<CompanionCodingAgentStatusResponse> {\n return {\n // Reports a fact this service can actually establish: whether the coding\n // agent is registered. It deliberately does NOT claim the transport is\n // usable — that depends on the provider configuration and on an agent\n // process this service has not started, and a status field that overstates\n // its knowledge is worse than one that is narrow about it.\n // Every declared agent must resolve, not merely the default: a registry\n // missing the SELECTED agent reports healthy while dispatch refuses.\n codingAgentRegistered: APPLICATION_CODING_AGENT_REFS.every(\n (ref) => this.agentsService.getAgent(ref) !== undefined,\n ),\n codingAgentLogin: await this.readSelectedCodingAgentLogin(),\n activeRun: await this.readActiveCodingRun(),\n // The answerable set: what is parked waiting for an operator response.\n pendingQuestions: await this.listPendingCodingQuestions(),\n limits: {\n defaultTimeoutMs: DISPATCH_DEFAULT_TIMEOUT_MS,\n hardMaxTimeoutMs: DISPATCH_HARD_MAX_TIMEOUT_MS,\n defaultMaxCapturedBytes: DISPATCH_DEFAULT_MAX_CAPTURED_BYTES,\n hardMaxCapturedBytes: DISPATCH_HARD_MAX_CAPTURED_BYTES,\n },\n lockFilePath: this.getWorkspaceMutationLockPath(),\n };\n }\n\n /**\n * Persist only replayable task identity and guard evidence, never\n * prompt/context bytes, with ONE named exception: an assembly repair's row keeps\n * the failure tail it was handed (`assemblyRepair.comparedFailureTail`, #2283),\n * because the bound on repairs must compare a later failure with it and the\n * directive forbids keeping a digest instead. It is a check's output, at most the\n * captured tail, never the prompt.\n *\n * CORRELATION BACK TO THE EPISODE runs through `input.candidateRef`, which is\n * the assessment episode's working-subject identity for the iteration that\n * composed this task — the same value the private checkpoint carries as\n * `basis.episode.candidateRef`. It is recorded here deliberately so the join\n * exists in BOTH directions: the checkpoint names the taskId once the task is\n * admitted, and this row names the candidate that caused it, so an auditor\n * starting from a workspace mutation can reach the episode without scanning\n * every checkpoint.\n *\n * A dedicated `episodeRef` column is NOT added: no caller supplies one yet\n * (the coding revision owner lands later), and a field with no producer is a\n * dormant surface that later readers mistake for a guarantee. The candidate\n * ref is exact per ITERATION, which is the granularity an auditor wants.\n */\n private async openApplicationCodingExecution(\n task: MetaWorkflow_ApplicationCodingTaskContract,\n baseline: GitWorktreeSnapshot,\n sessionContext?: CompanionExecutionSessionContext,\n origin?: CodingRunOrigin,\n mode: CodingRunConcurrency = CodingRunConcurrency.SINGLE_FLIGHT,\n ): Promise<OpenedActorExecution> {\n /*\n * ONE EXECUTION PER CODING RUN (#1359), opened by the engine's driver.\n *\n * Until 2026-09-20 this created a bare task with no execution parent, so a coding run had no row\n * saying \"this is a run\" and nowhere to hold a pending question or its resume inputs. Per RUN\n * rather than per build phase, because a parked run releases the worktree lock and the\n * dispatcher moves on: several questions can stand while a sibling runs, and an execution has\n * one `suspension`.\n */\n return this.actorsSystem.openActorExecution(this.buildApplicationCodingExecutionRequest(task, baseline, sessionContext, origin, mode));\n }\n\n /**\n * Open a coding run's execution at the moment its task is SELECTED — `PENDING`, not started.\n *\n * A build dispatch selects a task and then waits: for the compile watchers to go quiet, then for\n * the worktree lock. That stretch can be minutes, and until #1359 it existed only in an in-memory\n * dispatch record — so a dispatch that failed inside it failed nowhere durable, and a companion\n * restart forgot it had been selected at all. The row says `PENDING` for exactly that stretch;\n * `runApplicationCodingTask` starts it at admission, and the caller settles it `ABORTED` if the run\n * never gets that far — the host declined to start it, which is no attempt of the task's (#1581) —\n * or `FAILED` when the task's own contract was refused as invalid.\n *\n * The input carries no baseline yet: a baseline is captured under the lock this run has not taken.\n */\n public async openSelectedApplicationCodingExecution(\n rawTask: MetaWorkflow_ApplicationCodingTaskContract,\n sessionContext?: CompanionExecutionSessionContext,\n origin?: CodingRunOrigin,\n mode: CodingRunConcurrency = CodingRunConcurrency.SINGLE_FLIGHT,\n ): Promise<OpenedActorExecution> {\n const task = this.admitTypedInput(\n () => MetaWorkflow_ApplicationCodingTaskContractSchema.parse(rawTask),\n 'Application coding task contract is not valid.',\n );\n await this.refuseWhileWorktreeIsHeld(null, sessionContext);\n if (mode === CodingRunConcurrency.SINGLE_FLIGHT) await this.refuseWhileConcurrentRunsInFlight(sessionContext);\n const opened = await this.actorsSystem\n .openActorExecution({ ...this.buildApplicationCodingExecutionRequest(task, null, sessionContext, origin, mode), deferred: true })\n .catch((error: unknown) => { throw this.translateWorktreeBusy(error); });\n // SELECTED: a PENDING execution is already in flight to the next-task selection (#1310), whichever\n // door opened it — the resource operation, `POST /build/dispatch-next`, the playbook build tier.\n this.announceRunStateChanged();\n return opened;\n }\n\n /**\n * Run `critical` holding the workspace lock BRIEFLY, waiting for it rather than refusing (#1528).\n *\n * For a concurrent run's commits: the tree is shared on purpose, but git's index admits one writer,\n * and a generation step or a CLI writer may hold the lock for its whole duration. Waiting up to about\n * ten minutes is right here, where the single-flight lane's fail-fast would drop a finished run's\n * commit; a commit that still cannot get the lock is left for the wave reconciliation.\n */\n private underBriefWorktreeLock<T>(critical: () => Promise<T>): Promise<T> {\n return withDedicatedFileLock(this.getWorkspaceMutationLockPath(), critical, {\n retries: { retries: 120, minTimeout: 500, maxTimeout: 5_000 },\n });\n }\n\n /** Whether a CONCURRENT coding run is live now (#1528): it writes in the tree without holding the workspace lock. */\n private async concurrentCodingRunsLive(sessionContext?: CompanionExecutionSessionContext): Promise<boolean> {\n if (this.concurrentRunLiveInProcess()) return true;\n // The actor plane also sees a run another process drives. Asked twice; if it cannot answer, this\n // process's own runs are the answer (#1805 review R5), never a blanket \"shared\" nothing would ever settle.\n for (let attempt = 0; attempt < 2; attempt += 1) {\n try {\n return (await this.listInFlightCodingRuns(sessionContext)).some((run) => isConcurrentRunSubject(run.exclusiveSubject));\n } catch (error) {\n if (attempt === 1) {\n this.logger.warn('Could not list the live coding runs; judging sharing by this process\\'s own runs', { error: describeCaughtError(error) });\n }\n }\n }\n return false;\n }\n\n /** Whether this process drives a CONCURRENT run now — one writing the tree without holding the workspace lock. */\n private concurrentRunLiveInProcess(exceptTaskIds: readonly string[] = []): boolean {\n return [...this.activeRuns.values()].some((run) => run.mode === CodingRunConcurrency.CONCURRENT && run.withdrawalGuard !== true && !exceptTaskIds.includes(run.taskId));\n }\n\n /**\n * When the current SHARING EPISODE began: the first instant, since the tree was last written by one run\n * at a time, that a concurrent run (or a step beside one) wrote it (#1805 review R5, R9). Process-local:\n * a restart ends every episode, and restart recovery covers what it interrupted.\n */\n private sharingEpisodeStartedAt: string | undefined;\n\n private markSharingEpisodeStarted(at: string): void {\n if (this.sharingEpisodeStartedAt === undefined || at < this.sharingEpisodeStartedAt) this.sharingEpisodeStartedAt = at;\n }\n\n /**\n * Register a run; a CONCURRENT one opens a sharing episode when none is open. One of the two doors that\n * keep the dev supervisor's view of \"a coding agent is running\" in step with this process's own\n * (see {@link CODING_RUN_HEARTBEAT_RELATIVE_PATH}).\n */\n private registerActiveRun(run: ActiveRunState): void {\n if (run.mode === CodingRunConcurrency.CONCURRENT) this.markSharingEpisodeStarted(new Date().toISOString());\n this.activeRuns.set(run.taskId, run);\n this.adjustCodingWorkDepth(run.taskId, 1);\n }\n\n /**\n * Unregister a run. When it was the last CONCURRENT run live, the sharing episode has ended and nothing\n * is writing beside anything: its runs are re-checked alone and the tree is checkpointed, as a wave's end does\n * (#1805 review R5, #3204). That is what reaches a generation step, or a resumed parked run, that shared the tree\n * outside any wave — no wave's end would ever reach them.\n */\n private unregisterActiveRun(taskId: string): void {\n const was = this.activeRuns.get(taskId);\n this.activeRuns.delete(taskId);\n this.adjustCodingWorkDepth(taskId, -1);\n if (was?.mode !== CodingRunConcurrency.CONCURRENT || this.concurrentRunLiveInProcess()) return;\n const startedAt = this.sharingEpisodeStartedAt;\n this.sharingEpisodeStartedAt = undefined;\n if (startedAt === undefined) return;\n this.sharingEpisodeReconciliation = this.reconcileSharedTree({ startedAt, taskIds: [] }).then(\n // Re-checks deferred (a run began writing meanwhile): the episode goes on, from the same start, for the next end (#1805 review 5 F3).\n ({ deferred }) => { if (deferred) this.markSharingEpisodeStarted(startedAt); },\n (error: unknown) => {\n this.markSharingEpisodeStarted(startedAt);\n this.logger.warn('Could not end a sharing episode; it is kept for the next one', { error: describeCaughtError(error) });\n },\n );\n }\n\n /** The reconciliation the last sharing episode's end started, for a caller that must see its commit. */\n public sharingEpisodeReconciliation: Promise<void> = Promise.resolve();\n\n /** When the last build checkpoint began (#3204): a settlement inside the interval folds into a scheduled one. */\n private lastBuildCheckpointAt = 0;\n /** The checkpoint scheduled for the end of the interval, if any. */\n private buildCheckpointTimer: ReturnType<typeof setTimeout> | undefined;\n /** Runs that settled while their checkpoint was folded into the scheduled one: still registered, named all the same. */\n private readonly checkpointSettlingTaskIds = new Set<string>();\n /** The checkpoint committing now: the next waits for it. */\n private buildCheckpointInFlight: Promise<BuildCheckpointOutcome | undefined> = Promise.resolve(undefined);\n\n /**\n * The build tasks of the coding runs THIS process still holds as active (#3204): from admission until the run's chain has\n * ended, its commit included. A run's row reads COMPLETED before that (the commit and the trace come after the engine\n * settles it), so the actor plane's in-flight listing drops the run while its work is not yet committed; a selection that\n * read only that listing could take the task as ready and dispatch it again. Its chain unregisters it and announces the\n * change in one synchronous step, so no reader sees neither.\n */\n public listActiveRunTaskRefs(): string[] {\n const windows = this.codingRunWindows ?? [];\n return [...(this.activeRuns?.keys() ?? [])].flatMap((taskId) => {\n const window = windows.find((candidate) => candidate.taskId === taskId);\n return window === undefined ? [] : [window.taskRef];\n });\n }\n\n /** The live coding runs — selected, admitted or running — from the actor plane; see {@link listInFlightCodingRuns}. */\n public async listInFlightCodingRuns(sessionContext?: CompanionExecutionSessionContext): Promise<InFlightCodingRun[]> {\n return listInFlightCodingRuns(this.executionsService, sessionContext);\n }\n\n /** The live run of one build task, or `null` — what the wave skips, so no task is built twice at once. */\n public async findInFlightRunForBuildTask(\n buildTaskRef: string,\n sessionContext?: CompanionExecutionSessionContext,\n ): Promise<{ readonly executionId: string } | null> {\n const live = (await this.listInFlightCodingRuns(sessionContext)).find((run) => run.taskRef === buildTaskRef);\n return live ? { executionId: live.executionId } : null;\n }\n\n /**\n * Refuse (409) a SINGLE-FLIGHT run while any concurrent run is live (#1528).\n *\n * Two reasons, and the second is why it is explicit rather than incidental. A single-flight run was\n * promised the tree to itself. And the single-flight door is the one an agent can reach from its own\n * shell: until concurrency, the global lock refused a running agent's dispatch as a SIDE EFFECT (the\n * P-35 recursion cap). A concurrent run does not hold that lock, so without this a recursing agent\n * would be admitted beside its own wave.\n */\n private async refuseWhileConcurrentRunsInFlight(sessionContext?: CompanionExecutionSessionContext): Promise<void> {\n const concurrent = (await this.listInFlightCodingRuns(sessionContext)).filter((run) => isConcurrentRunSubject(run.exclusiveSubject));\n if (concurrent.length === 0) return;\n throw this.buildDispatchConflictError(\n `${concurrent.length} coding run(s) of a parallel build wave are live (${concurrent.map((run) => run.taskRef ?? run.executionId).join(', ')}). `\n + 'A single run cannot start beside them; it runs after the wave, or as part of the next one.',\n );\n }\n\n /** Record that a run entered the tree, for the runs it will overlap (#1528). */\n private openCodingRunWindow(taskId: string, taskRef: string): void {\n const now = Date.now();\n this.codingRunWindows = this.codingRunWindows\n .filter((window) => window.taskId !== taskId && (window.endedAtMs === undefined || now - window.endedAtMs < CODING_RUN_WINDOW_RETENTION_MS));\n this.codingRunWindows.push({ taskId, taskRef, startedAtMs: now });\n }\n\n /** End a run's window if nothing closed it — a parked run, or one that ended without a result. Idempotent. */\n private endCodingRunWindow(taskId: string): void {\n const endedAtMs = Date.now();\n this.codingRunWindows = this.codingRunWindows.map((window) => window.taskId === taskId && window.endedAtMs === undefined\n ? { ...window, endedAtMs }\n : window);\n }\n\n /** Hold the lane for a usage limit; a later reset than the one held wins, so two siblings never shorten it. */\n private holdForCodingAgentUsageLimit(limit: CodingAgentUsageLimit, taskRef: string, runTaskId: string): void {\n const held = this.codingAgentUsageLimitHold;\n if (held && Date.parse(held.resumesAt) >= Date.parse(limit.resumesAt)) return;\n this.codingAgentUsageLimitHold = { ...limit, taskRef, runTaskId };\n this.logger.warn(limit.accountRefusal\n // #3204: the account refused (no credits, a limit), named, and the lane asks again after the backoff.\n ? 'The coding agent\\'s provider account refused the turn; the build wave dispatches nothing until it is asked again'\n : 'The coding agent\\'s account hit its usage limit; the build wave dispatches nothing until it resumes', {\n taskRef, runTaskId, resumesAt: limit.resumesAt, resumesAtSource: limit.resumesAtSource, ...(limit.statedReset ? { statedReset: limit.statedReset } : {}),\n ...(limit.accountRefusal ? { accountRefusal: describeModelProviderAccountRefusal(limit.accountRefusal) } : {}),\n });\n }\n\n /**\n * Release the hold on a success that proves the window is over: a run started after the limit was met. An\n * earlier sibling succeeding later proves nothing — its turn may have ended before the limit — and releasing\n * on it would refill every slot into the limit (#2388 review F4).\n */\n private releaseCodingAgentUsageLimitHoldAfterSuccess(runStartedAtMs: number): void {\n const held = this.codingAgentUsageLimitHold;\n if (held && runStartedAtMs > Date.parse(held.observedAt)) this.codingAgentUsageLimitHold = undefined;\n }\n\n /** Hold coding admissions while a check's command is absent or lacks the verb (#3423, #3432); the first observation is kept. */\n private holdForUnavailableVerificationTool(\n unavailable: UnavailableVerificationTool,\n taskRef: string,\n runTaskId: string,\n ): void {\n if (this.verificationToolUnavailableHold) return;\n this.verificationToolUnavailableHold = { ...unavailable, taskRef, runTaskId, observedAt: new Date().toISOString() };\n this.logger.warn(unavailable.hostCause === VerificationHostCause.COMMAND_LACKS_VERB\n ? 'A verification check\\'s command does not know the verb it asks; no coding turn is admitted until it does'\n : 'A verification check\\'s command could not be executed; no coding turn is admitted until it is on PATH again', {\n command: unavailable.command, checkRef: unavailable.checkRef, taskRef, runTaskId, message: unavailable.message,\n });\n }\n\n /**\n * Record the checks a run could not ask for the host's reasons (#3432), and hold when one repeats with the same message on\n * a second distinct task. Only a run that ran ALONE is counted: beside siblings, a check that cannot be asked may be a\n * sibling's half-written file (a red compile, a stale output), which the wave's isolated re-check settles (#3204).\n */\n private observeHostCheckFailures(failures: readonly { readonly checkRef: string; readonly message: string }[], taskRef: string, runTaskId: string): void {\n for (const failure of failures) {\n const key = `${failure.checkRef}\\u0000${normalizeHostCheckFailureMessage(failure.message)}`;\n const seen = this.hostCheckFailures().get(key) ?? { checkRef: failure.checkRef, message: failure.message, taskRefs: new Set<string>() };\n seen.taskRefs.add(taskRef);\n this.hostCheckFailures().set(key, seen);\n if (seen.taskRefs.size < 2 || this.verificationToolUnavailableHold) continue;\n const observedAt = new Date();\n this.verificationToolUnavailableHold = {\n hostCause: VerificationHostCause.REPEATED_HOST_FAILURE,\n checkRef: failure.checkRef,\n message: failure.message,\n taskRef,\n runTaskId,\n observedAt: observedAt.toISOString(),\n metOnTaskRefs: [...seen.taskRefs],\n reaskAfter: new Date(observedAt.getTime() + VERIFICATION_HOST_FAILURE_REASK_MS).toISOString(),\n };\n this.logger.warn('A verification check could not be asked the same way on two tasks; no coding turn is admitted until the host is asked again', {\n checkRef: failure.checkRef, taskRefs: [...seen.taskRefs], message: failure.message, reaskAfter: this.verificationToolUnavailableHold.reaskAfter,\n });\n }\n }\n\n private releaseVerificationToolUnavailableHold(why: string): void {\n const held = this.verificationToolUnavailableHold;\n if (!held) return;\n this.verificationToolUnavailableHold = undefined;\n this.logger.info('The verification tool hold ended; coding admissions resume', { command: held.command, checkRef: held.checkRef, why });\n }\n\n /**\n * A run that ASKED the held check proves its command runs again (#3423). Approximate for a check that can answer without\n * spawning its command (schema-plan drift says \"not owed\" when the application declares no PostgreSQL): such an answer\n * releases the hold too, and the next run that needs the command meets it again, which costs one run, never a lockout.\n */\n private releaseVerificationToolHoldIfAsked(askedCheckRefs: readonly string[], taskRef: string): void {\n const held = this.verificationToolUnavailableHold;\n if (held && askedCheckRefs.includes(held.checkRef)) this.releaseVerificationToolUnavailableHold(`${taskRef} ran ${held.checkRef}`);\n // The cause of a repeated host failure is gone once the check answers (#3432): it counts afresh from here.\n for (const [key, seen] of this.hostCheckFailures()) {\n if (askedCheckRefs.includes(seen.checkRef)) this.hostCheckFailures().delete(key);\n }\n }\n\n /**\n * Before a coding turn is admitted, while a check's command is held absent (#3423): look it up on the PATH the check\n * spawns with. Found, the hold ends and the turn is admitted; still absent, admission is REFUSED as a dispatch conflict,\n * the host declining to start the run, which the attempt budget never counts (#1581). Every door is held, an explicit\n * `wildo build run` included, as the network hold does and for its reason: the proof is a free lookup, made first.\n */\n private async refuseWhileVerificationToolIsUnavailable(taskRef: string): Promise<void> {\n // A command lacking the verb is asked for it NOW, not in the background: the admission waits a CLI start, never a turn (#3432).\n if (this.verificationToolUnavailableHold?.hostCause === VerificationHostCause.COMMAND_LACKS_VERB) await this.probeVerificationVerb(true);\n // The read looks the command up (an absent command) or re-asks once due (a repeated failure), and releases the hold.\n const held = this.readVerificationToolUnavailableHold();\n if (held) throw this.buildDispatchConflictError(describeVerificationToolUnavailableRefusal(taskRef, held));\n }\n\n /**\n * Ask the held command for the verb (#3432): released when it answers it ({@link verbProbeKnowsTheVerb}). At most one\n * probe at a time; a read starts one at most every {@link VERIFICATION_VERB_PROBE_INTERVAL_MS}, an admission (`now`)\n * always. Never throws: a probe that cannot run leaves the hold standing.\n */\n private probeVerificationVerb(now: boolean): Promise<void> {\n const held = this.verificationToolUnavailableHold;\n if (held?.hostCause !== VerificationHostCause.COMMAND_LACKS_VERB || held.command === undefined) return Promise.resolve();\n if (this.verbProbeInFlight) return this.verbProbeInFlight;\n if (!now && Date.now() - this.verbProbeStartedAtMs < VERIFICATION_VERB_PROBE_INTERVAL_MS) return Promise.resolve();\n this.verbProbeStartedAtMs = Date.now();\n const command = held.command;\n const args = [...(held.verbProbeArgs ?? ['--help'])];\n this.verbProbeInFlight = this.runVerification({ kind: VerificationKind.RESOURCES_REGISTRY_INIT, path: null, command, args, cwd: this.companionContext.saasRoot })\n .then((outcome) => {\n if (this.verificationToolUnavailableHold === held && verbProbeKnowsTheVerb(outcome)) {\n this.releaseVerificationToolUnavailableHold(`\\`${command} ${args.join(' ')}\\` answers the verb`);\n }\n })\n .catch(() => undefined)\n .finally(() => { this.verbProbeInFlight = undefined; });\n return this.verbProbeInFlight;\n }\n\n /**\n * The command holding coding admissions now (#3423), for the build wave's stop, the selector's guidance and Home.\n *\n * The read itself looks the command up and releases the hold once it resolves (review F1). Otherwise a reader that\n * acts on the hold before any admission happens (an unattended drive stops on the Home line, the selector is told to\n * select no build wave) would keep it standing after the person fixed PATH: nothing else would ever look again.\n */\n public readVerificationToolUnavailableHold(): VerificationToolUnavailableHold | undefined {\n const held = this.verificationToolUnavailableHold;\n if (!held) return undefined;\n switch (held.hostCause) {\n case VerificationHostCause.COMMAND_ABSENT: {\n const resolved = held.command === undefined ? null : resolveExecutableOnPath(held.command, buildVerificationEnv().PATH);\n if (resolved !== null) {\n this.releaseVerificationToolUnavailableHold(`\\`${held.command}\\` resolves to ${resolved}`);\n return undefined;\n }\n return held;\n }\n case VerificationHostCause.COMMAND_LACKS_VERB:\n // Asked in the background, so a reader that acts before any admission (the drive, the selector) sees it end (#3432).\n void this.probeVerificationVerb(false);\n return held;\n case VerificationHostCause.REPEATED_HOST_FAILURE:\n // No free probe: once due, the hold ends and the next run re-asks the host; the same failure holds again at once.\n if (held.reaskAfter !== undefined && Date.now() >= Date.parse(held.reaskAfter)) {\n this.releaseVerificationToolUnavailableHold(`its re-ask was due at ${held.reaskAfter}`);\n return undefined;\n }\n return held;\n }\n }\n\n /** Hold coding admissions for a network a turn REPORTED lost (#3236): its rejection or its own API-error report. */\n private holdForCodingAgentConnectivityLoss(networkFailureKind: NetworkEnvironmentFailureKind, failureMessage: string, taskRef: string, runTaskId: string, binding: ApplicationCodingAgentBinding | undefined): void {\n this.openCodingAgentConnectivityHold(networkFailureKind, this.resolveCodingAgentProbeRouteFor(failureMessage, binding), taskRef, runTaskId);\n }\n\n /**\n * The route a probe must take to speak for the agent of this run (#3262): decided over the environment the agent is\n * STARTED with, never this process's. `undefined` when it cannot be known (no binding, an unreadable launch\n * configuration, an agent with no known API host): the probe then speaks for nothing and the next turn is the probe.\n */\n private resolveCodingAgentProbeRouteFor(failureMessage: string, binding: ApplicationCodingAgentBinding | undefined): CodingAgentProbeRoute | undefined {\n if (binding === undefined) return undefined;\n const environment = this.readCodingAgentRouteEnvironment(binding);\n return environment === undefined ? undefined : resolveCodingAgentProbeRoute({ failureMessage, providerRef: binding.providerRef, environment });\n }\n\n /**\n * The environment the agent's network code reads (#3262): its launch environment, as the engine composes it for the\n * dispatch (the base allowlist plus the provider's and the execution profile's variables), then, for Claude Code, the\n * `env` of every settings file its session loads, which replaces an inherited value. Which settings files load is the\n * session's `settingSources`, from its resolved metadata: an application-scoped run does not read the operator's\n * `~/.claude`. A method, so a test can state the agent's environment. `undefined` when the launch configuration\n * cannot be read, so no probe claims to speak for an agent whose environment is unknown.\n */\n protected readCodingAgentRouteEnvironment(binding: ApplicationCodingAgentBinding): NodeJS.ProcessEnv | undefined {\n let launch: ReturnType<AgentsBackendService['readCodingAgentLaunchConfiguration']>;\n try {\n launch = this.agentsService.readCodingAgentLaunchConfiguration(binding.providerRef, binding.executionProfileRef);\n } catch (error) {\n this.logger.warn('Could not read the coding agent\\'s launch configuration; the connectivity probe cannot speak for it', { providerRef: binding.providerRef, error: describeCaughtError(error) });\n return undefined;\n }\n if (launch === null) return undefined;\n if (binding.providerRef !== 'anthropic') return launch.environment;\n const settings = readClaudeCodeSettingsEnvironments({\n environment: launch.environment,\n workspaceRoot: this.companionContext.saasRoot,\n settingSources: readClaudeCodeSettingSources(launch.sessionMeta),\n readFile: (path) => {\n try {\n return readFileSync(path, 'utf8');\n } catch {\n return undefined;\n }\n },\n });\n return composeCodingAgentRouteEnvironment(launch.environment, settings);\n }\n\n /**\n * Open the admission hold and RECORD the loss it stands for (#3236). Called when a turn reports the network, and when a\n * connectivity probe fails (re-review of 8038824b4, F2): a full cut that every in-flight turn meets silently is then on\n * record although no turn reports it. The first loss observed is kept, so its instant stays the earliest; a loss is\n * recorded once while it is open.\n */\n private openCodingAgentConnectivityHold(networkFailureKind: NetworkEnvironmentFailureKind, probeRoute: CodingAgentProbeRoute | undefined, taskRef: string, runTaskId: string): void {\n const now = Date.now();\n const losses = (this.connectivityLosses ?? []).filter((loss) => now - (loss.endedAtMs ?? now) < CODING_RUN_WINDOW_RETENTION_MS);\n this.connectivityLosses = losses.some((loss) => loss.endedAtMs === undefined) ? losses : [...losses, { networkFailureKind, observedAtMs: now }];\n if (this.codingAgentConnectivityHold) return;\n this.codingAgentConnectivityHold = {\n networkFailureKind,\n observedAt: new Date(now).toISOString(),\n taskRef,\n runTaskId,\n ...(probeRoute === undefined ? {} : { probeRoute }),\n };\n this.logger.warn('A coding run lost the network; no coding turn is admitted until the agent\\'s API answers a probe', {\n taskRef, runTaskId, networkFailureKind, probeRoute: probeRoute === undefined ? undefined : describeCodingAgentProbeRoute(probeRoute),\n });\n this.probeConnectivityInBackground(this.codingAgentConnectivityHold, 0);\n }\n\n /**\n * While a hold is open, probe the agent's API on the admission back-off (15 s, doubling, capped at 5 min), whether\n * or not anything is admitted (re-review of 1da455d5d, R1). Without it the loss's END was whenever someone next\n * asked: after a one-second blip with no admission, a turn silent until its own thirty-minute timeout ended the hold\n * with its OWN settle-time probe, so it settled \"within the grace\" and was charged to the network. Stops when the\n * hold is released, when another hold replaced it, or once the companion is shutting down; the timer is unref'd, so\n * it never keeps the process alive. A hold with no host to probe has none (the next admission's pause releases it).\n */\n private probeConnectivityInBackground(held: CodingAgentConnectivityHold, failedProbes: number): void {\n this.backgroundConnectivityProbe?.cancel();\n this.backgroundConnectivityProbe = undefined;\n if (held.probeRoute === undefined) return;\n const probeRoute = held.probeRoute;\n this.backgroundConnectivityProbe = this.scheduleBackgroundConnectivityProbe(async () => {\n this.backgroundConnectivityProbe = undefined;\n if (this.codingAgentConnectivityHold !== held || this.shutdownManager?.isShutdownInProgress() === true) return;\n const probe = await this.probeCodingAgentConnectivity(probeRoute).catch((): CodingAgentConnectivityProbeResult | undefined => undefined);\n /*\n * Load-bearing: the hold may have been released, and a NEWER one opened with its own prober, while this probe was\n * in flight. Rescheduling here would cancel that prober, and releasing would end a loss this probe never saw.\n */\n if (this.codingAgentConnectivityHold !== held || this.shutdownManager?.isShutdownInProgress() === true) return;\n if (probe?.reachable === true) {\n this.releaseCodingAgentConnectivityHold(held, 'the coding agent\\'s API answered the background probe');\n return;\n }\n this.probeConnectivityInBackground(held, failedProbes + 1);\n }, nextCodingAgentConnectivityProbeDelayMs(failedProbes));\n }\n\n /**\n * Stop the background probe of an open hold: the companion's stop handler calls it beside its other unref'd loops, so a\n * companion shutting down starts no probe. The hold itself stays; a process that is going away admits nothing anyway.\n */\n public stopBackgroundConnectivityProbe(): void {\n this.backgroundConnectivityProbe?.cancel();\n this.backgroundConnectivityProbe = undefined;\n }\n\n /** Schedule one background probe; a method so a test can run it on demand. Unref'd: it never holds the process. */\n protected scheduleBackgroundConnectivityProbe(run: () => Promise<void>, delayMs: number): { readonly cancel: () => void } {\n const timer = setTimeout(() => { void run(); }, delayMs);\n timer.unref?.();\n return { cancel: () => clearTimeout(timer) };\n }\n\n /**\n * Release the admission hold, when `held` is still the one holding, and record that the loss ENDED (re-review of\n * 8038824b4, F3): a silent turn settling long after this instant was not waiting on the network.\n */\n private releaseCodingAgentConnectivityHold(held: CodingAgentConnectivityHold, why: string): void {\n if (this.codingAgentConnectivityHold !== held) return;\n this.codingAgentConnectivityHold = undefined;\n this.backgroundConnectivityProbe?.cancel();\n this.backgroundConnectivityProbe = undefined;\n const now = Date.now();\n this.connectivityLosses = (this.connectivityLosses ?? []).map((loss) => (loss.endedAtMs === undefined ? { ...loss, endedAtMs: now } : loss));\n this.logger.warn(`The connectivity hold ends: ${why}`, { probeRoute: held.probeRoute === undefined ? undefined : describeCodingAgentProbeRoute(held.probeRoute) });\n }\n\n /**\n * One probe of the agent's API when a turn settles `cancelled` with no operator abort and nothing in the turn itself\n * named the network (re-review of bb5de0ee0, item 4). It decides no blame (the turn's own timeline does), it only\n * keeps the loss record and the hold true: a reachable API ends a hold, an unreachable one opens a hold and records a\n * loss (a full cut nobody reported, re-review of 8038824b4 F2). A probe that throws says nothing, and changes nothing.\n */\n private async probeConnectivityAtCancelledSettlement(binding: ApplicationCodingAgentBinding | undefined, taskRef: string, runTaskId: string): Promise<void> {\n const held = this.codingAgentConnectivityHold;\n /*\n * With NO hold, a failed probe opens one and records a loss on the probe's word alone, so the probe must speak for the\n * agent (re-review of 1da455d5d, R2). It does since #3262: it takes the agent's own route (the endpoint and the\n * proxy its launch environment and settings select), so it runs wherever that route is known. Where it is not\n * (`resolveCodingAgentProbeRoute` answers nothing), no probe runs and only a turn that itself reports the network\n * may open a hold. The interim guard that turned this probe off whenever THIS process's environment named a proxy or\n * a cloud provider (055c09bf8) is gone: it read the wrong process's environment.\n */\n const probeRoute = held !== undefined ? held.probeRoute : this.resolveCodingAgentProbeRouteFor('', binding);\n if (probeRoute === undefined) return;\n const probe = await this.probeCodingAgentConnectivity(probeRoute).catch((): CodingAgentConnectivityProbeResult | undefined => undefined);\n if (probe === undefined) return;\n if (probe.reachable) {\n if (held !== undefined) this.releaseCodingAgentConnectivityHold(held, 'the coding agent\\'s API answers again');\n return;\n }\n this.openCodingAgentConnectivityHold(networkFailureKindOfFailedProbe(probe), probeRoute, taskRef, runTaskId);\n }\n\n /** The network loss holding coding admissions now (#3236), or undefined. */\n public readCodingAgentConnectivityHold(): CodingAgentConnectivityHold | undefined {\n return this.codingAgentConnectivityHold;\n }\n\n /**\n * One probe of the agent's API along its route (#3236, #3262). A method, so a test can stand in for the network;\n * production probes DNS then HTTPS when the route is direct, and the proxy then a `CONNECT` through it when it is not\n * (`probeCodingAgentRoute`).\n */\n protected probeCodingAgentConnectivity(route: CodingAgentProbeRoute): Promise<CodingAgentConnectivityProbeResult> {\n return probeCodingAgentRoute(route);\n }\n\n /** The wait between probes. A method for the same reason as the probe. */\n protected sleepBeforeConnectivityProbe(delayMs: number): Promise<void> {\n return new Promise((resolve) => setTimeout(resolve, delayMs));\n }\n\n /**\n * Before a coding turn is admitted: while a network loss holds (#3236), wait for a probe of the agent's API to\n * succeed, with back-off, instead of starting a turn certain to fail the same way. Returns at once when nothing holds.\n *\n * Every door is held, an explicit `wildo build run` included, unlike the usage-limit hold (re-review F5, decided): a\n * usage limit's turn is certain to fail until its stated reset, so an operator's explicit try costs one turn and its\n * success is the only proof the window ended; here the proof is a free probe, made first, so an explicit run whose\n * network is back is admitted at once, and one whose network is not would start a turn certain to fail. The way past\n * a probe that is wrong is `wildo build rearm <task> --reason environment`, named in the refusal.\n *\n * Past {@link CODING_AGENT_CONNECTIVITY_WAIT_LIMIT_MS}, or once the companion begins shutting down, admission is\n * REFUSED as a dispatch conflict: the host declining to start the run, which the caller settles ABORTED and the attempt\n * budget never counts (#1581). The wave's filling ends on that refusal; a later wave meets this gate again.\n */\n private async awaitCodingAgentConnectivity(taskRef: string): Promise<void> {\n const startedAtMs = Date.now();\n let failedProbes = 0;\n for (let held = this.codingAgentConnectivityHold; held !== undefined; held = this.codingAgentConnectivityHold) {\n if (held.probeRoute === undefined) {\n // No host this agent is known to call (OpenCode, review F5): one interval's pause, then the next turn is the probe.\n await this.sleepBeforeConnectivityProbe(nextCodingAgentConnectivityProbeDelayMs(0));\n this.releaseCodingAgentConnectivityHold(held, 'no host to probe; the next turn is the probe');\n return;\n }\n const probe = await this.probeCodingAgentConnectivity(held.probeRoute);\n if (probe.reachable) {\n this.releaseCodingAgentConnectivityHold(held, `the coding agent's API answered a probe; coding admissions resume after ${Date.now() - startedAtMs} ms`);\n return;\n }\n // A failed probe is a loss on record (re-review of 8038824b4, F2); while this hold's loss is open it adds nothing.\n this.openCodingAgentConnectivityHold(networkFailureKindOfFailedProbe(probe), held.probeRoute, held.taskRef, held.runTaskId);\n const delayMs = nextCodingAgentConnectivityProbeDelayMs(failedProbes);\n failedProbes += 1;\n if (Date.now() - startedAtMs + delayMs > CODING_AGENT_CONNECTIVITY_WAIT_LIMIT_MS || this.shutdownManager?.isShutdownInProgress() === true) {\n throw this.buildDispatchConflictError(\n `Coding task ${taskRef} was not started: the coding agent's API (${describeCodingAgentProbeRoute(held.probeRoute)}) has not been reachable since ${held.observedAt} `\n + `(${held.networkFailureKind}; last probe failed at ${probe.failedStep}: ${probe.detail}). No attempt was spent. `\n + `Dispatch it again once the network is back. If the agent does reach its API and this probe is wrong, end the hold with: wildo build rearm ${taskRef} --reason environment --note \"<why>\".`,\n );\n }\n this.logDebug('Waiting for the coding agent\\'s API to answer before admitting a coding turn', {\n taskRef, probeRoute: describeCodingAgentProbeRoute(held.probeRoute), failedStep: probe.failedStep, detail: probe.detail, nextProbeInMs: delayMs,\n });\n await this.sleepBeforeConnectivityProbe(delayMs);\n }\n }\n\n /**\n * The usage limit holding the build wave now (#2388), or undefined once it has ended. Read before each slot\n * is filled; a hold past its `resumesAt` is dropped here, so the reset itself releases it.\n */\n public readCodingAgentUsageLimitHold(now: number = Date.now()): (CodingAgentUsageLimit & { readonly taskRef: string; readonly runTaskId: string }) | undefined {\n const held = this.codingAgentUsageLimitHold;\n if (held && Date.parse(held.resumesAt) <= now) {\n this.codingAgentUsageLimitHold = undefined;\n return undefined;\n }\n return held;\n }\n\n /**\n * Close a run's window with the paths it changed, and say which runs shared the tree with it and\n * which of those paths they changed too (#1528). `null` when it overlapped nothing — a run alone in\n * the tree records nothing new.\n */\n private closeCodingRunWindow(taskId: string, changedPaths: readonly string[]): CodingRunConcurrencyRecord | null {\n const window = this.codingRunWindows.find((candidate) => candidate.taskId === taskId);\n if (!window) return null;\n const endedAtMs = Date.now();\n const record = describeRunConcurrency(this.codingRunWindows, { taskId, startedAtMs: window.startedAtMs, endedAtMs }, changedPaths);\n this.codingRunWindows = this.codingRunWindows.map((candidate) => candidate.taskId === taskId\n ? { ...candidate, endedAtMs, changedPaths: [...changedPaths] }\n : candidate);\n return record.overlappingTaskRefs.length > 0 ? record : null;\n }\n\n /**\n * The END of a wave (#1528, #3204): the runs that failed verification beside their siblings are re-checked ALONE (#3220),\n * under the workspace lock, now that nothing is writing; then the tree is committed as a forced build checkpoint naming\n * every run no checkpoint named yet, failed runs included (their files are in the tree).\n *\n * Which runs are RE-CHECKED: every run the wave dispatched (`taskIds`) and every concurrent run that recorded writes\n * since the wave began (`startedAt`), which brings in a generation step the wave ran inline. Only under the posture that\n * lets the system accept.\n */\n public async reconcileWaveAcceptance(input: {\n readonly startedAt: string;\n readonly taskIds: readonly string[];\n }): Promise<Array<{ readonly taskId: string; readonly committedPaths: number; readonly error?: string }>> {\n return (await this.reconcileSharedTree(input)).results;\n }\n\n /**\n * {@link reconcileWaveAcceptance}, saying whether the re-checks DEFERRED: a concurrent run outside these runs is still\n * writing, so nothing can be checked alone (R9). The sharing episode's end keeps the episode open then, so the next end\n * re-checks it (#1805 review F5). The checkpoint runs either way.\n */\n private async reconcileSharedTree(input: {\n readonly startedAt: string;\n readonly taskIds: readonly string[];\n readonly lock?: { readonly takeLock?: boolean };\n }): Promise<{\n /** The isolated re-checks could not run: a concurrent run outside these is still writing. The checkpoint still ran. */\n readonly deferred: boolean;\n readonly results: Array<{ readonly taskId: string; readonly committedPaths: number; readonly error?: string }>;\n }> {\n let deferred = false;\n if (laneBoundaryTreatmentFor(APPLICATION_CREATION_AUTONOMY_POSTURE, PlaybookLaneBoundaryDecision.APPROVE_RESULT) === LaneBoundaryTreatment.NOTIFY_AND_PROCEED) {\n if (this.concurrentRunLiveInProcess(input.taskIds)) {\n deferred = true;\n this.logDebug('Deferred the isolated re-checks: a concurrent run outside these is still writing', { taskIds: input.taskIds });\n } else {\n /*\n * #3220: a run that failed verification while siblings were writing is re-checked ALONE, now that nothing is\n * writing. A pass is recorded on the run and lands its task (the landing reads it); it no longer decides a commit.\n */\n const during = (await this.codingRunWriteRegister.list())\n .filter((record) => record.concurrent === true && record.at >= input.startedAt)\n .map((record) => record.taskId);\n // Under the workspace lock (review of 4a1b1f1bf F10): no generation step or newly admitted run writes during the re-check.\n const recheck = () => this.recheckInterferedVerificationFailures([...new Set([...input.taskIds, ...during])]);\n if (input.lock?.takeLock === false) await recheck();\n else await this.underBriefWorktreeLock(recheck);\n }\n }\n const outcome = await this.requestBuildCheckpoint({ force: true, takeLock: input.lock?.takeLock });\n const committedPaths = outcome === undefined || outcome.alreadyCommitted ? 0 : outcome.committedPaths.length;\n return { deferred, results: (outcome?.namedTaskIds ?? []).map((taskId) => ({ taskId, committedPaths })) };\n }\n\n /**\n * Re-run, ALONE, the failed checks of each run of this reconciliation that failed verification while siblings\n * shared the tree ({@link failedVerificationBesideSiblings}: interference suspected, #3220, or checks that could not be asked\n * beside siblings, #3204). Called at a wave's end, with every run settled and accepted, so\n * nothing writes while the checks run. Each re-check is recorded on its run, where the build record shows what\n * was decided; a run whose checks pass now has a result, and its files are committed.\n *\n * A check carried red from before the run is not re-run: it was never this run's failure. Best effort: a re-check\n * that cannot run, or cannot be recorded, leaves the run failed, which refuses its files (the safe direction).\n *\n * ONE re-check per run: once one is recorded, the run's standing follows it, and a run that failed again stays failed\n * for its task's next run to fix. \"Alone\" means no coding run of this process is writing; the tree still holds what\n * failed or cancelled siblings left (their files are refused, not removed), so a re-check can fail on a sibling's\n * half-written file. That keeps the run failed, the conservative answer, and its task is re-run.\n */\n private async recheckInterferedVerificationFailures(taskIds: readonly string[]): Promise<Map<string, IsolatedVerificationRecheck>> {\n const rechecks = new Map<string, IsolatedVerificationRecheck>();\n for (const taskId of new Set(taskIds)) {\n try {\n const row = await this.executionsService.getActorTask(taskId) as { output?: unknown; memory?: unknown };\n const output = isRecordValue(row.output) ? row.output : undefined;\n // Interference suspected, or checks that could not be asked beside siblings (a sibling's red compile): #3204.\n if (output === undefined || !failedVerificationBesideSiblings(output as Parameters<typeof failedVerificationBesideSiblings>[0])) continue;\n if (readIsolatedVerificationRecheck(row.memory) !== undefined) continue;\n const carried = new Set(Array.isArray(output.carriedVerificationFailures) ? output.carriedVerificationFailures.map(String) : []);\n const checkRefs = [...new Set((Array.isArray(output.verification) ? output.verification : [])\n .filter((entry): entry is { checkRef: string; outcome: { success?: unknown } } => isRecordValue(entry) && typeof entry.checkRef === 'string' && isRecordValue(entry.outcome))\n .filter((entry) => entry.outcome.success === false && !carried.has(entry.checkRef))\n .map((entry) => entry.checkRef))];\n if (checkRefs.length === 0) continue;\n const { verification, unrunCheckRefs } = await this.executeVerificationPlans(resolveApplicationCodingTaskVerificationPlans(checkRefs));\n const unrun = new Set(unrunCheckRefs);\n const results = verification.map(({ checkRef, outcome }) => ({ checkRef, success: outcome.success && !unrun.has(checkRef), message: outcome.message }));\n const recheck: IsolatedVerificationRecheck = {\n checkRefs,\n passed: results.length === checkRefs.length && results.every((result) => result.success),\n results,\n recheckedAt: new Date().toISOString(),\n };\n rechecks.set(taskId, recheck);\n await this.serializeRunMemoryWrite(async () => {\n const current = await this.executionsService.getActorTask(taskId) as { memory?: Actors_Memory_Context };\n await this.executionsService.updateActorTask(taskId, { memory: withIsolatedVerificationRecheck(current.memory, recheck) });\n });\n this.announceRunStateChanged();\n this.logger.warn(recheck.passed\n ? 'A run that failed verification beside its siblings passed its checks alone; its task lands'\n : 'A run that failed verification beside its siblings failed its checks again alone; its task is run again', {\n taskId, taskRef: typeof (row as { input?: { taskRef?: unknown } }).input?.taskRef === 'string' ? (row as { input: { taskRef: string } }).input.taskRef : undefined, ...recheck,\n });\n } catch (error) {\n this.logger.warn('Could not re-check a run that failed verification beside its siblings; it stays failed', { taskId, error: describeCaughtError(error) });\n }\n }\n return rechecks;\n }\n\n /**\n * Commit a BUILD CHECKPOINT (#3204, {@link AcceptedChangeCommitCompanionService.commitBuildCheckpoint}): the working tree\n * as it stands, naming the runs settled since the previous one. Every automatic commit of coding-run work goes through\n * here: a run's settlement, a generation step, a wave's and a sharing episode's end, a restart's recovery.\n *\n * **Throttled, never queued twice.** A settlement asks for one; within {@link BUILD_CHECKPOINT_MIN_INTERVAL_MS} of the\n * last one the request is folded into one scheduled for the end of that interval, so ten agents settling minutes apart\n * make a handful of commits, not a commit each. `force` commits now (a wave's end, a step, a recovery), waiting for one\n * already running. A build task lands when its product is in the working tree, so no LANDING waits on a checkpoint; a\n * caller that awaits one waits for the commit only (a concurrent run's settlement does not, review of 4a1b1f1bf F6).\n *\n * Under the posture's table like every automatic door (nothing under GUIDED), inside the workspace lock unless the caller\n * holds it (`takeLock: false`). Best effort: a failure is logged and the next checkpoint carries the tree.\n */\n public async requestBuildCheckpoint(options: {\n readonly force?: boolean;\n readonly origin?: AcceptOrigin.WAVE_RECONCILIATION | AcceptOrigin.INTERRUPTED_RUN_RECOVERY;\n /** Runs settling now, still registered as active: named by this checkpoint all the same. */\n readonly settlingTaskIds?: readonly string[];\n readonly takeLock?: boolean;\n } = {}): Promise<BuildCheckpointOutcome | undefined> {\n const settling = new Set(options.settlingTaskIds ?? []);\n if (options.force !== true) {\n const sinceLast = Date.now() - this.lastBuildCheckpointAt;\n if (sinceLast < BUILD_CHECKPOINT_MIN_INTERVAL_MS) {\n for (const taskId of settling) this.checkpointSettlingTaskIds.add(taskId);\n this.buildCheckpointTimer ??= setTimeout(() => {\n this.buildCheckpointTimer = undefined;\n void this.requestBuildCheckpoint({ force: true });\n }, BUILD_CHECKPOINT_MIN_INTERVAL_MS - sinceLast);\n this.buildCheckpointTimer.unref?.();\n return undefined;\n }\n }\n for (const taskId of this.checkpointSettlingTaskIds) settling.add(taskId);\n this.checkpointSettlingTaskIds.clear();\n /*\n * One at a time: a request arriving while one commits waits for it, then commits what is left. Except a caller that\n * already HOLDS the workspace lock (a generation step's window, a single-flight run's settlement): a checkpoint queued\n * before it may be waiting for that very lock, so waiting on it would hold both until the lock's retries ran out. No\n * other checkpoint can be committing while the lock is held, so this one commits at once.\n */\n const previous = options.takeLock === false ? Promise.resolve(undefined) : this.buildCheckpointInFlight;\n const next = previous.catch(() => undefined).then(async () => {\n this.lastBuildCheckpointAt = Date.now();\n let outcome: BuildCheckpointOutcome | undefined;\n try {\n await this.underAcceptancePosture(async () => {\n const liveTaskIds = new Set([...this.activeRuns.keys()].filter((taskId) => !settling.has(taskId)));\n outcome = await this.acceptedChangeCommit.commitBuildCheckpoint({ origin: options.origin ?? AcceptOrigin.WAVE_RECONCILIATION, liveTaskIds });\n return outcome === undefined || outcome.alreadyCommitted ? [] : [{ committedPaths: outcome.committedPaths.length }];\n }, { takeLock: options.takeLock });\n if (outcome !== undefined && !outcome.alreadyCommitted) {\n this.logger.info('Committed a build checkpoint', {\n commitSha: outcome.commitSha, committedPaths: outcome.committedPaths.length, namedRuns: outcome.namedTaskIds.length, excludedPaths: outcome.excludedPaths,\n });\n }\n } catch (error) {\n this.logger.warn('Could not commit a build checkpoint; the next one carries the tree', { error: describeCaughtError(error) });\n }\n return outcome;\n });\n if (options.takeLock !== false) this.buildCheckpointInFlight = next;\n return next;\n }\n\n /**\n * What every automatic acceptance shares: nothing under a posture that keeps acceptance with a person,\n * the worktree lock while committing, and the run-accepted listeners told once something was committed.\n */\n private async underAcceptancePosture<R extends { readonly committedPaths: number }>(\n accept: () => Promise<R[]>,\n /** FALSE when the caller already holds the workspace lock, as a single-flight run's own accept does. */\n options: { readonly takeLock?: boolean } = {},\n ): Promise<R[]> {\n if (laneBoundaryTreatmentFor(APPLICATION_CREATION_AUTONOMY_POSTURE, PlaybookLaneBoundaryDecision.APPROVE_RESULT) !== LaneBoundaryTreatment.NOTIFY_AND_PROCEED) return [];\n let results: R[] = [];\n if (options.takeLock === false) results = await accept();\n else await this.underBriefWorktreeLock(async () => { results = await accept(); });\n if (results.some((result) => result.committedPaths > 0)) {\n for (const listener of this.runAcceptedListeners) {\n try { listener(); } catch (error) { this.logDebug('A run-accepted listener threw', { error: describeCaughtError(error) }); }\n }\n }\n return results;\n }\n\n /**\n * Refuse (409) while another coding run holds the worktree, NAMING it — the holder is read from the\n * actor plane, so the message is true after a restart and from a second process. `exceptExecutionId`\n * is the execution the caller itself opened at selection, which holds the subject legitimately.\n */\n private async refuseWhileWorktreeIsHeld(exceptExecutionId: string | null, sessionContext?: CompanionExecutionSessionContext): Promise<void> {\n const holder = await this.actorsSystem.readExclusiveSubjectHolder(APPLICATION_CODING_SYSTEM_REF, APPLICATION_CODING_WORKTREE_SUBJECT, sessionContext);\n if (!holder || holder._id === exceptExecutionId) return;\n throw this.buildDispatchConflictError(\n `A coding-agent run is already active (task ${holder.tasks[0]?._id ?? 'unknown'}, execution ${holder._id}, ${holder.status}`\n + `${holder.createdAt ? `, started ${holder.createdAt}` : ''}). Application coding tasks share one working tree.`,\n );\n }\n\n /** The driver's own refusal — two callers raced past the fast 409 — in this lane's 409 shape. */\n private translateWorktreeBusy(error: unknown): unknown {\n return isActorExecutionSubjectBusyError(error)\n ? this.buildDispatchConflictError('A coding-agent run took the working tree first. Application coding tasks share one working tree.')\n : error;\n }\n\n /** Admission of a run that was opened at selection: start it, completing its input with the baseline. */\n private async startSelectedApplicationCodingExecution(\n selected: OpenedActorExecution,\n task: MetaWorkflow_ApplicationCodingTaskContract,\n baseline: GitWorktreeSnapshot,\n sessionContext?: CompanionExecutionSessionContext,\n origin?: CodingRunOrigin,\n ): Promise<OpenedActorExecution> {\n await this.actorsSystem.startActorExecution(selected, { taskInput: this.buildApplicationCodingTaskInput(task, baseline, origin) }, sessionContext);\n return selected;\n }\n\n private buildApplicationCodingExecutionRequest(\n task: MetaWorkflow_ApplicationCodingTaskContract,\n baseline: GitWorktreeSnapshot | null,\n sessionContext?: CompanionExecutionSessionContext,\n origin?: CodingRunOrigin,\n mode: CodingRunConcurrency = CodingRunConcurrency.SINGLE_FLIGHT,\n ): ActorExecutionOpenRequest<CompanionExecutionSessionContext> {\n return {\n systemRef: APPLICATION_CODING_SYSTEM_REF,\n // A single-flight run holds the application's working tree while it runs (#1361); a concurrent\n // one holds only its own task, so two runs of one task can never overlap (#1528).\n exclusiveSubject: applicationCodingExclusiveSubject(mode, task.taskRef),\n // The SELECTED agent, resolved once at creation and carried on the row —\n // so a task records which agent it was addressed to, and a selection\n // changed between creation and claim cannot silently redirect it. The\n // system declares one actor per binding under the binding's own ref.\n actorRef: resolveSelectedApplicationCodingAgentBinding().ref,\n scope: sessionContext,\n task: {\n title: `Application coding task ${task.taskRef}`,\n description: `Typed application coding task for ${task.objectiveRef}; acceptance is a commit, made by the loop under the autonomy posture or by a person on the workbench.`,\n topic: Actor_Task_Topics.IMPLEMENTATION,\n input: this.buildApplicationCodingTaskInput(task, baseline, origin),\n /*\n * The cross-plane join, carried in the GENERIC correlation envelope rather than in a\n * `workbenchBuildPlanTaskId` column on the actor-task row (#1348).\n *\n * The engine owns the slot and validates only that keys and values are non-empty strings;\n * this domain owns the keys. The value is the board's row identity — sanitized, which is the\n * ref verbatim today — so the creation plane can match its build-plan row to this task\n * without the generic platform row knowing what a build-plan task is.\n */\n correlation: {\n domain: WORKBENCH_TASK_CORRELATION_DOMAIN,\n refs: {\n [WorkbenchTaskCorrelationRef.BUILD_PLAN_TASK]: sanitizeWorkbenchCreationPlaneIdentity(task.taskRef),\n // The thread the dispatch came from (#1454, Step 7), the same key a playbook run carries.\n ...(origin?.conversationId ? { [WorkbenchTaskCorrelationRef.CONVERSATION]: origin.conversationId } : {}),\n },\n },\n },\n };\n }\n\n /**\n * The task row's INPUT — replayable task identity and guard evidence, never prompt/context bytes\n * except the assembly-repair failure tail named there (see the contract above\n * `openApplicationCodingExecution`). `baseline` is `null` between\n * selection and admission, and says so rather than being absent: a reader can tell a run that has\n * not captured one from a row that forgot to record it.\n */\n private buildApplicationCodingTaskInput(\n task: MetaWorkflow_ApplicationCodingTaskContract,\n baseline: GitWorktreeSnapshot | null,\n origin?: CodingRunOrigin,\n ): Record<string, unknown> {\n return {\n taskRef: task.taskRef,\n // Read back by the dispatch projection, so the row says which conversation started it.\n ...(origin?.conversationId ? { conversationId: origin.conversationId } : {}),\n // An operator ran a task the probe called landed (#2217): the run carries why, and the build record reads it back.\n ...(origin?.landedOverride ? { landedOverride: origin.landedOverride } : {}),\n // When the wave began filling this run's slot (#3206): the start of its dispatch wait, read back by the build record.\n ...(origin?.preparationStartedAt ? { preparationStartedAt: origin.preparationStartedAt } : {}),\n // A repair of a failing assembly check records which check and what it printed (#2283): the bound on repairs reads it.\n ...assemblyRepairRunInputField(task),\n objectiveRef: task.objectiveRef,\n candidateRef: task.candidateRef,\n mutationScope: task.mutationScope,\n contextPlan: {\n planRef: task.contextPlan.planRef,\n objectiveRef: task.contextPlan.objectiveRef,\n },\n contextSelection: {\n planRef: task.contextSelection.planRef,\n selectedSourceRefs: task.contextSelection.selectedSources.map((source) => source.sourceRef),\n selectedSourceCount: task.contextSelection.selectedSources.length,\n /*\n * WHAT WAS SCREENED, per third-party source (#2846): the run's own record of which text written outside the\n * repository reached its brief, and what the classifier concluded. Outcome, provider and reason only, never the\n * text. Per-run state like the rest of this row, so it is not period evidence.\n *\n * assurance-control: WILDO.SOFTWARE.AI_PRODUCED_CHANGE_CONTROL — each run records what screening concluded per third-party source, and why a brief was built without provenance, never the text.\n */\n thirdPartyScreenings: task.contextSelection.selectedSources\n .filter((source) => source.screening !== undefined)\n .map((source) => ({ sourceRef: source.sourceRef, ...source.screening })),\n /*\n * WHY every decided element was routed as third-party, when the catalog could not say which came from web\n * research (#2846 review L1): the brief's own trusted statement, copied, so the row records the degraded run.\n */\n ...briefProvenanceUnavailableRunField(task),\n },\n verificationIntent: task.verificationIntent,\n installedSkillRefs: task.installedSkillRefs,\n baseline: baseline\n ? {\n headSha: baseline.headSha,\n dirtyFileCount: Object.keys(baseline.files).length,\n capturedAt: baseline.capturedAt,\n /*\n * The dirty files themselves, not only their count: the one record that survives a\n * restart mid-run, so the next start can tell what THIS run wrote from what was already\n * there ({@link recoverInterruptedRunWrites}). Paths and fingerprints only — no content.\n */\n files: baseline.files,\n }\n : null,\n };\n }\n\n /**\n * Open the trace half of one coding run — see {@link CodingRunTrace}. Best-effort like every\n * trace write here: a session that cannot be opened is recorded as a traceability error and the\n * run proceeds with no scope, which the actor plane accepts.\n */\n private async openCodingRunTrace(taskId: string, taskRef: string): Promise<CodingRunTrace> {\n let runSession: CompanionExecutionSessionContext | undefined;\n let runStep: ReturnType<CompanionTraceabilityService['createStep']> | undefined;\n const traceabilityErrors: unknown[] = [];\n const traceBestEffort = async (operation: string, write: () => Promise<void>): Promise<void> => {\n try {\n await write();\n } catch (error) {\n // Traceability is required evidence, but it must not become a control\n // flow escape that leaves the durable task PROCESSING after possible\n // source changes. The final task row records this failure and remains\n // visibly non-accepted for explicit follow-up.\n traceabilityErrors.push(error);\n this.logger.error('Application coding-task trace operation failed', {\n taskId,\n taskRef,\n operation,\n error: describeCaughtError(error),\n });\n }\n };\n await traceBestEffort('initialize-session', async () => {\n runSession = this.traceabilityService.createInternalSession({\n label: 'application-coding-task-run',\n metadata: { taskId, taskRef },\n });\n if (!runSession) return;\n await this.traceabilityService.registerAlias(runSession, CompanionTraceAliasKind.ACTOR_TASK, taskId);\n runStep = this.createOperationTraceStep(runSession, 'application-coding-task-run');\n });\n return { runSession, runStep, traceabilityErrors, traceBestEffort };\n }\n\n /**\n * Accept every pending PLAYBOOK run under the posture, from inside the worktree window and before a\n * baseline — the third site of #1534 (see `acceptPendingPlaybookRuns` for why exactly here).\n * Best effort by construction: it must never cost the run whose window it borrows.\n */\n private async acceptPendingPlaybookRunsBeforeBaseline(): Promise<void> {\n if (laneBoundaryTreatmentFor(APPLICATION_CREATION_AUTONOMY_POSTURE, PlaybookLaneBoundaryDecision.APPROVE_RESULT) !== LaneBoundaryTreatment.NOTIFY_AND_PROCEED) return;\n try {\n const outcome = await this.acceptedChangeCommit.acceptPendingPlaybookRuns(AcceptOrigin.AUTONOMY_POSTURE);\n if (outcome.accepted > 0) {\n for (const listener of this.runAcceptedListeners) {\n try { listener(); } catch (error) { this.logDebug('A run-accepted listener threw', { error: describeCaughtError(error) }); }\n }\n }\n } catch (error) {\n this.logger.warn('Could not accept pending playbook runs before a baseline', { error: describeCaughtError(error) });\n }\n }\n\n /**\n * The unattended creation driver's accept (#2233): commit every pending playbook run's writes when the autonomy posture\n * says the SYSTEM accepts them, the same door and origin as the accept before a baseline. Three answers:\n *\n * - `HELD_FOR_PERSON`: the posture does not notify-and-proceed on a result, so acceptance is a person's (the marked\n * critical gate armed): nothing is committed, and the driver stops and says so;\n * - `DEFERRED_RUNS_LIVE`: a coding run is writing the tree now; committing inside its window would destroy its\n * attribution, and the next baseline's accept carries these runs anyway;\n * - `ACCEPTED`: the outcome, with the run-accepted listeners told, as at a baseline.\n *\n * Under the worktree lock, like a concurrent run's accept before its baseline.\n */\n public async acceptPendingPlaybookRunsForUnattendedDrive(): Promise<\n | { readonly disposition: CreationDriveAcceptDisposition.HELD_FOR_PERSON | CreationDriveAcceptDisposition.DEFERRED_RUNS_LIVE }\n | { readonly disposition: CreationDriveAcceptDisposition.ACCEPTED; readonly accepted: number; readonly superseded: number; readonly editedOutsideRuns: number; readonly failed: number }\n > {\n if (laneBoundaryTreatmentFor(APPLICATION_CREATION_AUTONOMY_POSTURE, PlaybookLaneBoundaryDecision.APPROVE_RESULT) !== LaneBoundaryTreatment.NOTIFY_AND_PROCEED) {\n return { disposition: CreationDriveAcceptDisposition.HELD_FOR_PERSON };\n }\n const runsLive = async (): Promise<boolean> => this.activeRuns.size > 0 || await this.concurrentCodingRunsLive();\n if (await runsLive()) return { disposition: CreationDriveAcceptDisposition.DEFERRED_RUNS_LIVE };\n return this.underBriefWorktreeLock(async () => {\n // Asked again under the lock: a concurrent run holds no lock, so one may have started while this waited for it.\n if (await runsLive()) return { disposition: CreationDriveAcceptDisposition.DEFERRED_RUNS_LIVE };\n const outcome = await this.acceptedChangeCommit.acceptPendingPlaybookRuns(AcceptOrigin.AUTONOMY_POSTURE);\n if (outcome.accepted > 0) {\n for (const listener of this.runAcceptedListeners) {\n try { listener(); } catch (error) { this.logDebug('A run-accepted listener threw', { error: describeCaughtError(error) }); }\n }\n }\n return { disposition: CreationDriveAcceptDisposition.ACCEPTED, ...outcome };\n });\n }\n\n /**\n * Run a build-plan GENERATION STEP inside the coding lane's attribution window, and accept what it\n * wrote under the autonomy posture — the second site of #1534's invariant.\n *\n * **Why a generation step needs this at all.** It lands on COMMITTED paths\n * (`ApplicationBuildGenerationStepLandedKind.COMMITTED_PATHS`), exactly like a coding task's\n * product, and it is EXEMPT from the loop guard because a step such as `i18n-labels` is\n * legitimately re-runnable. So an uncommitted step does not stall visibly: it is re-selected on\n * every dispatch, does nothing new, and every task that names it as a prerequisite never becomes\n * ready. The 2026-09-23 run never met this only because an operator's shell loop committed\n * everything between dispatches.\n *\n * **Why inside THIS window rather than beside it.** A coding run's attribution is a baseline→post\n * comparison, and it collapses when anything commits inside it. Until now a generation step held\n * neither half of the lane's single-flight, so it could run while a coding run was live and land\n * its writes inside that run's window. Here it takes both: the worktree lease check first — the\n * same 409 a second coding task gets, naming the holder — then the workspace mutation lock for\n * the snapshot, the step, the capture and the accept. The two are not redundant: a coding run\n * SELECTED but not yet admitted holds the lease and not the lock while it waits for the compile\n * watchers, and a step taking the lock there would fail that run's admission. A PARKED run holds\n * neither, by design — siblings run while its question waits, and anything they commit is\n * classified `committed_during_run` and excluded from its accept; a step is one more sibling. This is the lane's EXISTING single-flight,\n * extended to the other writer it always had; it restricts no agent's edits, which is what\n * #1264's \"no serialization\" constraint is about.\n *\n * **The writes go through the same register and door as a coding run's**, so the workbench's\n * Accept works on a generation-step row too, under GUIDED, with the same refusals. The capture and\n * the accept are best effort: a step whose writes could not be registered still returns its\n * result, and stays visibly unlanded.\n */\n public async runGenerationStepInWorktreeWindow<T>(input: {\n readonly taskRef: string;\n readonly taskId: string;\n readonly execute: () => Promise<T>;\n readonly sessionContext?: CompanionExecutionSessionContext;\n /**\n * The directories only this step writes (#2240): the dispatch plan's writable roots, derived from the\n * step's own evidence paths. Read only when the window is SHARED with concurrent coding runs, where they\n * are the step's claims. Omitted, a shared step claims nothing, as before.\n */\n readonly ownedPathPrefixes?: readonly string[];\n }): Promise<T> {\n await this.refuseWhileWorktreeIsHeld(null, input.sessionContext);\n return withDedicatedFileLock(\n this.getWorkspaceMutationLockPath(),\n async () => {\n await this.acceptPendingPlaybookRunsBeforeBaseline();\n const baseline = await this.gitChangeSetService.captureWorktreeSnapshot();\n await this.recordRunBaselineOnTask(input.taskId, baseline, input.sessionContext);\n const concurrentAtStart = await this.concurrentCodingRunsLive(input.sessionContext);\n // Beside a concurrent run, the step is part of that sharing episode from its own baseline (#1805).\n if (concurrentAtStart) this.markSharingEpisodeStarted(baseline.capturedAt);\n /*\n * A step that throws, or whose capture fails, records no change set, and its window would stay OPEN to HEAD for the\n * build-task decisions reader (#3224 F2): every later decision would read as made inside it. So its window is\n * bounded at the HEAD it left.\n */\n const boundWindow = () => this.recordRunWindowBound(input.taskId, input.taskRef, baseline);\n let result: Awaited<ReturnType<typeof input.execute>>;\n try {\n result = await input.execute();\n } catch (error) {\n await boundWindow();\n throw error;\n }\n let shared = concurrentAtStart;\n let claimedPaths: readonly string[] = [];\n try {\n const changeSet = await this.gitChangeSetService.captureChangeSet(baseline);\n /*\n * A step holds the workspace lock, but a CONCURRENT coding run takes that lock only to commit, so\n * a wave's runs keep writing while the step runs inline (#1805 review N2). Its capture then holds\n * their writes too. So when concurrent runs were live at either end of its window, or one recorded\n * writes during it, the step is recorded as a sharing run and claims only what lies under the\n * directories it alone writes (#2240): its record then says which files are its own. The checkpoint\n * that follows commits the tree, its siblings' writes included (#3204).\n */\n const concurrentAtEnd = await this.concurrentCodingRunsLive(input.sessionContext);\n if (concurrentAtEnd) this.markSharingEpisodeStarted(baseline.capturedAt);\n shared = shared || concurrentAtEnd\n || (await this.codingRunWriteRegister.list()).some((record) => record.concurrent === true && record.at >= baseline.capturedAt);\n // The paths in a tree only this step writes (#2240), whether or not it shared the window: they are its claims when\n // shared, and, shared or not, a file there that was already dirty is still the step's own output (#3233).\n const stepOwnedPaths = claimGenerationStepOwnedPaths(changeSet.files.map((file) => file.path), input.ownedPathPrefixes ?? []);\n if (shared) claimedPaths = stepOwnedPaths;\n await this.codingRunWriteRegister.record({ taskId: input.taskId, taskRef: input.taskRef, changeSet, stepOwnedPaths, ...(shared ? { claimedPaths } : {}) });\n } catch (error) {\n this.logger.warn('Could not register a generation step\\'s writes; no checkpoint names it until it runs again', {\n taskId: input.taskId, taskRef: input.taskRef, error: describeCaughtError(error),\n });\n await boundWindow();\n return result;\n }\n // The step's writes, and whatever the tree holds besides, are committed by a checkpoint now (#3204), inside the lock this window holds.\n await this.requestBuildCheckpoint({ force: true, settlingTaskIds: [input.taskId], takeLock: false });\n return result;\n },\n { retries: { retries: 0 } },\n ).catch((error: unknown) => { throw this.mapLockError(error); });\n }\n\n /**\n * Run the engine-driven half of a coding run and deal with the two ways it can go wrong.\n *\n * `drive` is `completeActorExecution` or `resumeActorExecution`; `capture` hands this method the\n * executor's result, because the driver answers it only when the settle ALSO succeeded — and the\n * case that needs the result most is the one where it did not.\n *\n * - The executor returned and the SETTLE failed: not retried. The agent may already have changed\n * files and re-execution would duplicate an unclassified effect. The row is deliberately left\n * for the startup reconcile, and the trace records why it is not terminal.\n * - The executor THREW: the driver already settled `FAILED` with the message. Nothing to add\n * except a log line — the executor classifies its own failures, so a throw is a defect in it.\n */\n private async superviseCodingRun(\n taskRef: string,\n taskId: string,\n trace: CodingRunTrace,\n drive: (capture: (result: CodingRunResult) => CodingRunResult) => Promise<unknown>,\n ): Promise<void> {\n let result: CodingRunResult | null = null;\n try {\n await drive((returned) => { result = returned; return returned; });\n } catch (error) {\n this.markRunRowsChanged();\n const returned = result as CodingRunResult | null;\n if (returned === null) {\n // Two ways to get here with no result: the executor threw (the engine settled the run\n // FAILED with the message), or the engine refused to START it — a resume of an execution\n // that is no longer waiting. Neither leaves anything for this method to record. The two\n // refusals a person's late or concurrent answer meets are routine 409s, not errors (#1581, R10-2).\n const routineRefusal = isActorExecutionNotSuspendedError(error) || isActorExecutionSubjectBusyError(error);\n (routineRefusal ? this.logger.info.bind(this.logger) : this.logger.error.bind(this.logger))(\n routineRefusal ? 'Application coding run was not started or resumed: the driver refused it' : 'Application coding run ended without a result',\n { taskId, taskRef, error: describeCaughtError(error) },\n );\n return;\n }\n this.logger.error('Failed to persist application coding-task result', { taskId, taskRef, error: describeCaughtError(error) });\n await trace.traceBestEffort('record-terminal-patch-failure', () => this.traceOperationFailure({\n sessionContext: trace.runSession,\n step: trace.runStep,\n type: 'application-coding-task-terminal-patch-failure',\n summary: `Failed to persist the result of application coding task ${taskRef}`,\n error,\n payload: returned.output,\n }));\n return;\n }\n // The engine has settled the run's row: a read of the completed runs taken before this no longer holds (#3204).\n this.markRunRowsChanged();\n await (result as CodingRunResult | null)?.afterSettle();\n }\n\n /** Move the generation the shared read of the run rows is held under, without announcing to the boards (#3204). */\n private markRunRowsChanged(): void {\n this.runStateGeneration = (this.runStateGeneration ?? 0) + 1;\n }\n\n /**\n * Executes the normal Agent invocation and lands the full working-result\n * evidence. This method runs inside the worktree lock and therefore is the\n * sole typed path allowed to observe its own before/after Git boundary.\n */\n private async executeApplicationCodingTask(\n task: MetaWorkflow_ApplicationCodingTaskContract,\n renderedPrompt: string,\n verificationPlans: readonly ApplicationCodingTaskVerificationPlan[],\n opened: OpenedActorExecution,\n baseline: GitWorktreeSnapshot,\n trace: CodingRunTrace,\n /**\n * Present when this run ANSWERS a parked question rather than starting the\n * task: the agent session is resumed by id via `session/load` and the answer\n * is delivered as the next turn. The task's mutation scope, verification plan\n * and original baseline are unchanged — the resume is held to exactly the\n * bounds the first run was.\n */\n resume?: { readonly continuationOfSessionId: string; readonly answerPrompt: string; readonly priorLegsUsage?: CodingAgent_Usage },\n ): Promise<CodingRunResult> {\n const { runSession, runStep, traceabilityErrors, traceBestEffort } = trace;\n // The TASK id is this lane's handle — the live stream, the answer door and the board row all\n // key on it. The execution is the engine's; it is reached from the task.\n const taskId = opened.taskId;\n const traceContext: AgentTraceContext = {\n label: `application-coding-task:${task.taskRef}`,\n attributes: {\n taskId,\n taskRef: task.taskRef,\n objectiveRef: task.objectiveRef,\n candidateRef: task.candidateRef,\n },\n };\n\n\n const startedAtMs = Date.now();\n /*\n * Which of this task's checks were ALREADY failing before the agent ran?\n *\n * Verification decides the disposition, and it used to ask \"is any check red now?\" — a question\n * about the TREE, answered as though it were about the RUN. A check that was red before the\n * agent started says nothing about the agent, and failing the task on it burns the whole run.\n *\n * Measured on the first end-to-end journey run (#1273): `check:technical-doc-typecheck` was red\n * before anything was dispatched, because `technical-doc/src/generated/consumer-documentation/`\n * has never been produced in that application. `build-task-docs-find-context` ran for fifteen\n * minutes, established its findings, wrote its report — and was recorded\n * `VERIFICATION_FAILED` on a red it did not cause, at $19.33. Every documentation task names\n * that check, so every one of them would have failed the same way, forever, for the same money.\n * That is the unbounded-cost shape `findCompletedRunForBuildTask` exists to close, reached\n * through the one door it cannot see: a run that FAILS is not a completed run, so it is\n * re-offered on the next dispatch.\n *\n * The baseline is the tree as this run found it, so it is the honest reference for \"did THIS run\n * break it\". Costs one extra pass of the same checks — tens of seconds against a run measured in\n * quarter-hours and tens of dollars.\n *\n * A check that THREW at baseline is excluded: it produced no verdict, so it cannot license\n * forgiving the same check afterwards. See `unrunCheckRefs`.\n *\n * The cost, accepted (#3258): a foreign fault that reads possibly-stale and persists is not carried, so each task touching\n * the specifications spends up to five paid runs (two forgiven as the host's, three attributed) and retires until\n * `wildo build rearm`. Carrying it would land work no check asked about, and the same reading is what a real break\n * that only looks like a missing import gets. Runs are bounded; an unverified landing is not.\n */\n const baselineVerification = await this.executeVerificationPlans(verificationPlans);\n const unrunAtBaseline = new Set(baselineVerification.unrunCheckRefs);\n /*\n * A check's command already absent at the baseline (#3423 review F4): hold now, before this run's agent turn, so the\n * siblings a parallel wave admits while it works are refused at no cost. This run itself goes on and pays its turn:\n * declining a run already opened here would need its own settlement, and `wildo creation preflight` refuses a run\n * with no `wildo` on PATH, so the case is rare.\n */\n const baselineUnavailableTool = baselineVerification.unavailableVerificationTools[0];\n if (baselineUnavailableTool !== undefined) this.holdForUnavailableVerificationTool(baselineUnavailableTool, task.taskRef, taskId);\n const preexistingVerificationFailures = new Map(baselineVerification.verification\n .filter(({ checkRef, outcome }) => !outcome.success && !unrunAtBaseline.has(checkRef))\n .map(({ checkRef, outcome }) => [checkRef, outcome.failureFindings] as const));\n let runError: unknown = null;\n // When the agent's refusal reached the host: a usage limit's reset is read against THIS instant (#2388 review F2).\n let runErrorAt: Date | null = null;\n let agentOutput = '';\n let codingUsage: CodingAgent_Usage | undefined;\n let codingDeniedPermissionCount: number | undefined;\n let codingPermissionDecisions: CodingAgent_RunTaskOutput['permissionDecisions'];\n let codingReportedFileLocations: CodingAgent_RunTaskOutput['reportedFileLocations'];\n let agentStopReason: CodingAgent_StopReason | undefined;\n /*\n * Counted in full, RETAINED in part.\n *\n * The previous shape pushed every notification into an unbounded array and\n * then persisted only its length — so a 30-minute run grew memory the\n * process never read, and the tool-call and diff frames (the reason to\n * observe a session at all) were collected and discarded. Now the count is a\n * counter, and only the frames a reader would actually open are retained, up\n * to a fixed ceiling.\n */\n let codingSessionEventCount = 0;\n let lastAgentWorkFrameAtMs: number | undefined;\n // What the row keeps of the session, and why it is not \"the first N frames\": see the model.\n const codingSessionRetention = new CodingSessionFrameRetention();\n /** The kind of each tool call this session opened, for `writtenLocationsOfSessionEvent` (#3205 outcome 4). */\n const sessionToolCallKinds = new Map<string, string>();\n await traceBestEffort('record-start', () => this.traceOperationStart({\n sessionContext: runSession,\n step: runStep,\n type: 'application-coding-task-run-start',\n summary: `Run application coding task ${task.taskRef}`,\n payload: this.buildApplicationCodingTaskTraceSummary(task),\n artifactFileName: 'application-coding-task-input.txt',\n artifactContent: renderedPrompt,\n }));\n try {\n // Resume the agent recorded on the durable task. The host selector may\n // have changed since admission; it must not reroute an existing session.\n // The coding system declares one actor per binding under the binding's\n // own ref, so the actor the run was opened for IS the agent to invoke.\n const agentRef = opened.actorRef;\n if (typeof agentRef !== 'string' || !isApplicationCodingAgentRef(agentRef)) {\n throw this.buildDispatchConflictError('The coding task does not identify a declared application coding agent.');\n }\n const invocation: FlowsActors_Agent_Invocation<\n typeof CodingAgent_RunTaskInputSchema,\n typeof CodingAgent_RunTaskOutputSchema,\n typeof CodingAgent_OperationContext_BaseSchema\n > = {\n agentRef,\n initiator: {},\n invocationContext: [],\n // A resume delivers the operator's ANSWER as the turn and re-enters the\n // parked session; a first run delivers the rendered task.\n input: resume\n ? { prompt: resume.answerPrompt, continuationOfSessionId: resume.continuationOfSessionId }\n : { prompt: renderedPrompt },\n output: { finalMessage: '', stopReason: CodingAgent_StopReason.END_TURN },\n executionContext: { callTimestamp: new Date().toISOString() },\n artifactBindings: [],\n };\n const response = await this.agentsService.invokeAgent(\n invocation,\n traceContext,\n {\n workspaceRootPath: this.companionContext.saasRoot,\n // Hold the agent to the task's declared scope WHILE it runs, not only\n // in the change set afterwards. The post-hoc assessment stays — it is\n // the authoritative record, because an agent can write a file it never\n // asked permission for — but a refusal in the moment is the only one\n // that prevents the write rather than reporting it.\n // assurance-control: WILDO.SOFTWARE.AI_PRODUCED_CHANGE_CONTROL — the declared edits of an agent that asks before writing are held to its task's write scope while it runs; an agent that never asks, and a shell command, are held by nothing in flight.\n isPermittedCodingLocation: buildApplicationCodingTaskLocationPredicate(\n this.companionContext.saasRoot,\n task.mutationScope.allowedPathPrefixes,\n task.mutationScope.prohibitedPathPrefixes,\n ),\n onCodingSessionEvent: (event) => {\n codingSessionEventCount += 1;\n // When the agent last WORKED (#3236): what tells a turn silent through a network loss from one working through it.\n // Bookkeeping frames are not work: the pinned adapter sends a `usage_update` while settling a cancelled turn.\n if (isCodingAgentWorkFrame(event.kind)) lastAgentWorkFrameAtMs = Date.now();\n codingSessionRetention.accept(event);\n /*\n * A CONCURRENT run's claims, kept on disk as they happen (#3205 outcome 4), so a companion that dies mid-run\n * leaves its recovery the evidence of what this run wrote. Best effort: losing one append costs a claim,\n * never the run.\n */\n if (this.activeRuns.get(taskId)?.mode === CodingRunConcurrency.CONCURRENT) {\n const written = writtenLocationsOfSessionEvent(event, sessionToolCallKinds);\n if (written.length > 0) {\n void (async () => {\n try {\n await this.codingRunWriteRegister.recordInFlightClaims(taskId, written);\n } catch (error) {\n this.logDebug('Could not keep a live run\\'s claims on disk; a restart would lose them', { taskId, error: describeCaughtError(error) });\n }\n })();\n }\n }\n this.publishCodingSessionFrame(taskId, { channel: 'event', payload: event });\n },\n // The JUDGMENT half of the interactive lane: classify each end-of-turn\n // message so the engine ladder can auto-continue a pause rather than\n // settle it. It never parks the run (#3710): a question is parked only\n // when the agent asks it through the protocol, below. The engine fails\n // OPEN if this throws, so a classifier fault degrades to \"the turn is\n // complete\" rather than hanging the run — this method may therefore throw freely.\n classifyCodingTurnEnd: (input) => this.classifyCodingTurnEnd(input),\n // This host holds a parked run and resumes it with the answer, so the agent may ASK (#3710).\n parksCodingAgentQuestions: true,\n onCodingSessionStateChange: (state) => {\n this.publishCodingSessionFrame(taskId, { channel: 'state', payload: state });\n },\n ...(this.activeRuns.get(taskId) ? { codingSessionAbortSignal: this.activeRuns.get(taskId)!.abortController.signal } : {}),\n },\n );\n const codingOutput = response.output as Partial<CodingAgent_RunTaskOutput> | undefined;\n // The agent runtime publishes provider-learned facts on `executionContext`.\n // A resume's leg reports its own tokens and the session's cumulative cost: the run is every leg together (#2232).\n codingUsage = mergeResumedLegUsage(resume?.priorLegsUsage, (response.executionContext as { usage?: CodingAgent_Usage } | undefined)?.usage);\n codingDeniedPermissionCount = codingOutput?.deniedPermissionCount;\n codingPermissionDecisions = codingOutput?.permissionDecisions;\n codingReportedFileLocations = codingOutput?.reportedFileLocations;\n const text = codingOutput?.finalMessage;\n agentStopReason = codingOutput?.stopReason;\n // A PARKED run stopped WITHOUT finishing to ask the operator a question.\n // Its `finalMessage` is the question and its partial edits are NOT a final\n // change set — so it must skip assessment, verification and the\n // terminal disposition entirely, and instead record an answerable,\n // non-terminal state. Handled here, before the CANCELLED/empty checks,\n // because a question is a non-empty END_TURN message that would otherwise\n // read as a completed working result.\n if (codingOutput?.suspension) {\n return this.buildParkedCodingRunResult({\n task,\n taskId,\n baseline,\n suspension: codingOutput.suspension,\n output: codingOutput,\n usage: codingUsage,\n codingSessionEventCount,\n retainedCodingSessionFrames: codingSessionRetention.frames(),\n codingSessionRetention: codingSessionRetention.summary(),\n startedAtMs,\n runSession,\n runStep,\n traceBestEffort,\n });\n }\n // A CANCELLED turn is not a completed one, and its partial change set must\n // not be read as a working result. Refused here rather than downstream so\n // the disposition names the actual reason.\n if (agentStopReason === CodingAgent_StopReason.CANCELLED) {\n throw new Error('Application coding Agent turn was cancelled before it completed.');\n }\n if (typeof text !== 'string' || text.trim().length === 0) {\n throw new Error('Application coding Agent returned no final message.');\n }\n agentOutput = text;\n } catch (error) {\n runError = error;\n runErrorAt = new Date();\n }\n /*\n * Whether an operator took this turn away, read the moment the turn ENDED (#1581, seventh review F8):\n * a wave cancel landing later, while the change set is captured, did not end a turn that had already\n * failed on its own — a timed-out turn is the task's.\n */\n const turnCancelledByOperator = this.activeRuns.get(taskId)?.abortController.signal.aborted === true;\n\n let changeSet: GitChangeSetCapture | null = null;\n let captureError: unknown = null;\n try {\n changeSet = await this.gitChangeSetService.captureChangeSet(baseline);\n } catch (error) {\n captureError = error;\n }\n /*\n * The register the workbench's `accept` commits from (#1454, Step 7): every path, attributed and\n * hashed, unbounded where the durable row's summary is bounded. Best effort — a register that\n * could not be written costs the ability to accept THIS run from the workbench, never the run.\n */\n if (changeSet) {\n try {\n // A run that shared the tree (#1528) records what it has evidence of writing: its capture also holds its siblings' files.\n const claimedPaths = this.activeRuns.get(taskId)?.mode === CodingRunConcurrency.CONCURRENT\n ? collectRunClaimedPaths({\n candidateRoots: applicationRootSpellings(this.companionContext.saasRoot),\n reportedFileLocations: codingReportedFileLocations,\n permissionDecisions: codingPermissionDecisions,\n })\n : undefined;\n await this.codingRunWriteRegister.record({ taskId, taskRef: task.taskRef, changeSet, ...(claimedPaths !== undefined ? { claimedPaths } : {}) });\n } catch (error) {\n this.logDebug('Could not record the coding run\\'s writes; accepting it from the workbench will refuse', { taskId, error: describeCaughtError(error) });\n }\n }\n /*\n * The run concluded: its in-flight claims existed only for a restart (#3205 outcome 4), and are dropped on every path,\n * a failed capture or record included (re-review F7), or a stale file would read as a live run's claims forever.\n */\n try {\n await this.codingRunWriteRegister.clearInFlightClaims(taskId);\n } catch (error) {\n // Best effort, like the record: dropping a stale claims file must never cost the run.\n this.logDebug('Could not drop a concluded run\\'s in-flight claims', { taskId, error: describeCaughtError(error) });\n }\n\n const scopeAssessment = changeSet\n ? assessApplicationCodingTaskMutationScope(changeSet, task.mutationScope.allowedPathPrefixes, task.mutationScope.prohibitedPathPrefixes)\n : null;\n /*\n * Did Wildo's IN-FLIGHT guards actually run for this agent?\n *\n * The permission ceiling and the task mutation scope are both enforced in\n * the client's answer to `session/request_permission`, and the scope half is\n * enforced against the `locations` that request DECLARES. So there are TWO\n * ways a run reaches the end with the mutation scope never consulted, and\n * until 2026-09-09 only the first was reported:\n *\n * 1. NO REQUEST AT ALL — the agent writes without asking. Codex's design\n * (its safety model is a sandbox) and OpenCode's default. Nothing is\n * answered, so nothing is checked.\n *\n * 2. REQUESTS RAISED, NONE CARRYING A LOCATION — the agent asks, the\n * client answers, and the scope predicate has nothing to check the\n * answer against, because `locations.some(...)` over an empty array is\n * vacuously satisfied. Under an UNRESTRICTED ceiling this is EVERY\n * shell command: `execute` is admitted by the ceiling, and a shell\n * command declares no locations because its effect is not derivable\n * from the command string. A run can therefore write outside its\n * declared scope through a shell command with a full, well-formed\n * permission-decision record showing it was allowed.\n *\n * Shape 2 is not a hole to be closed by deriving locations from a command —\n * a shell command is UNSCOPED BY NATURE, and parsing one to guess its writes\n * would be an invented, defeatable answer (`sh -c \"$CMD\"`, a redirect\n * through a substituted path). The honest treatment is to say so.\n *\n * Both shapes are ADMISSIBLE by decision (2026-09-06/09): a different agent\n * architecture is not a reason to refuse a tool, the dogfood lane authors\n * UNRESTRICTED deliberately, and the framework's directive is that\n * restrictions arrive as judge-style guards rather than refusals wired into\n * the mechanism. What is NOT acceptable is the consequence going unrecorded\n * while the configuration reads as though a gate were in place.\n *\n * Keyed on the run's OWN evidence rather than on a provider declaration: an\n * agent that changes behaviour between versions cannot silently keep an\n * old, reassuring claim. (The provider's declaration is used too, at\n * DISPATCH, where it refuses a ceiling narrower than UNRESTRICTED against an\n * agent that cannot honour one — a claim before the run and evidence after\n * it, which are different jobs.)\n */\n const raisedNoPermissionRequest = (codingPermissionDecisions?.length ?? 0) === 0;\n // An ALLOWED decision that declared no path: the ceiling admitted the act and\n // the scope predicate was handed nothing to judge it by.\n const allowedActsWithNoDeclaredLocation = (codingPermissionDecisions ?? []).filter(\n (decision) => decision.allowed && decision.locations.length === 0,\n ).length;\n const mutationScopeWentUnconsulted = raisedNoPermissionRequest || allowedActsWithNoDeclaredLocation > 0;\n const mutatedFileCount = changeSet?.files.length ?? 0;\n if (!runError && mutationScopeWentUnconsulted && mutatedFileCount > 0) {\n // Best-effort and FEATURE-DETECTED, the same posture the audit emits take:\n // this observes a run, and an observation that can fail the run it\n // observes is worse than no observation. A partially-bound logger must not\n // turn a completed coding task into an error — measured the hard way, when\n // a `warn` the test double did not implement hung fifteen runs.\n this.logger.warn?.(\n (raisedNoPermissionRequest\n ? 'Coding run mutated the workspace without raising a single permission request — '\n + \"Wildo's permission ceiling and task mutation scope were NOT enforced in flight for this agent. \"\n : `Coding run mutated the workspace after ${allowedActsWithNoDeclaredLocation} permitted act(s) that `\n + 'declared no file location — typically shell commands, which are unscoped by nature — so the task '\n + 'mutation scope had nothing to check those acts against and was NOT enforced in flight for them. ')\n + 'The change set taken after the run is the only record of what it touched'\n + (scopeAssessment && scopeAssessment.outOfScopePaths.length > 0\n ? `, and it recorded ${scopeAssessment.outOfScopePaths.length} changed path(s) outside the task's declared scope `\n + '(this run\\'s or a parallel session\\'s — the change set cannot tell which).'\n : '.'),\n {\n taskRef: task.taskRef,\n objectiveRef: task.objectiveRef,\n mutationScopeRef: task.mutationScope.scopeRef,\n mutatedFileCount,\n outOfScopePathCount: scopeAssessment?.outOfScopePaths.length ?? null,\n raisedNoPermissionRequest,\n allowedActsWithNoDeclaredLocation,\n inFlightMutationScopeConsulted: false,\n },\n );\n }\n\n // Verification is deliberately sequential. Each check has a fixed\n // semantic meaning, but several checks can still contend for the same\n // application package/cache if started together. The ordered outcomes are\n // easier to inspect and avoid turning a bounded coding task into an\n // accidental local-build fan-out.\n // Out-of-scope paths never skip verification: they are recorded, not refused.\n const shouldVerify = !runError && !captureError;\n /*\n * The checks read the application's COMPILED packages, so they wait (bounded) for the watchers to publish what the run\n * just wrote, as a playbook child's read does (#3212). Without it a check met `shared-lib/dist` or `backend-api/dist`\n * older than the run's own edits and refused (\"Cannot check the resources registry: … dist is older than its sources\"),\n * a refusal attributed to the host that, repeated, retires the task: on reference run 42713670241 two follow-up tasks\n * spent their whole attempt budget on it (#3204). Bounded and proceeding on timeout: the check that follows is the judge,\n * and a FAILED compile is not waited on, since waiting does not clear it.\n */\n if (shouldVerify) {\n const published = await waitForApplicationPackagesPublished({\n saasRoot: this.companionContext.saasRoot,\n onWait: (unpublished) => this.logDebug('Waiting for application packages to publish the run\\'s edits before verifying', {\n taskRef: task.taskRef,\n unpublished,\n }),\n });\n if (!published.published) {\n this.logger.warn('Verifying a coding run before every application package published its edits', {\n taskRef: task.taskRef,\n waitedMs: published.waitedMs,\n unpublished: published.unpublished,\n });\n }\n }\n const { verification, infrastructureError: verificationInfrastructureError, unrunCheckRefs, unavailableVerificationTools } = shouldVerify\n ? await this.executeVerificationPlans(verificationPlans)\n : {\n verification: [] as Array<{ checkRef: string; outcome: VerificationOutcome }>,\n infrastructureError: null as unknown,\n unrunCheckRefs: [] as readonly string[],\n unavailableVerificationTools: [] as readonly UnavailableVerificationTool[],\n };\n /*\n * Only a check this run BROKE fails the task. One that was already red is recorded and reported,\n * never attributed — see `preexistingVerificationFailures` above for what it cost when it was.\n *\n * The recording half is not decoration: a check red for every task is a project-level defect\n * that nothing else would surface, and forgiving it silently would replace a loud wrong answer\n * with a quiet one.\n */\n const carriedVerification = verification\n .filter(({ checkRef, outcome }) => !outcome.success && verificationFailureIsCarried(preexistingVerificationFailures, checkRef, outcome.failureFindings));\n const carriedVerificationFailures = carriedVerification.map(({ checkRef }) => checkRef);\n /*\n * And WHY it is red, captured while the output is in hand (#1529): the files the check names and\n * what generated them. A red nobody diagnoses is re-diagnosed by hand — on the first end-to-end run\n * that took an hour, for a fact the broken file's own banner stated.\n */\n const carriedVerificationDiagnoses = carriedVerification.map(({ checkRef, outcome }) => diagnoseCarriedVerificationFailure({\n checkRef,\n checkPath: outcome.path,\n message: outcome.message,\n stdoutTail: outcome.stdoutTail,\n stderrTail: outcome.stderrTail,\n readHead: (relativePath) => {\n try {\n return readFileSync(join(this.companionContext.saasRoot, relativePath), 'utf8').slice(0, 8_000);\n } catch {\n return undefined;\n }\n },\n }));\n const failedVerifications = verification.filter(({ checkRef, outcome }) => !outcome.success && !verificationFailureIsCarried(preexistingVerificationFailures, checkRef, outcome.failureFindings));\n const failedVerification = failedVerifications[0] ?? null;\n /*\n * Every check this run failed on could not ASK (#3258): a failed module that may be a stale build, a compiled tree\n * behind its source. The run still fails, because nothing proved its work, but no check judged the work, so the\n * failure is the host's, whose forgiveness is bounded: a typo that only LOOKS like a missing import costs a few\n * retries, then counts against the task.\n */\n const verificationCouldNotAsk = failedVerifications.length > 0 && failedVerifications.every(({ checkRef }) => unrunCheckRefs.includes(checkRef));\n\n if (agentOutput) {\n await traceBestEffort('write-agent-output', () =>\n this.traceOperationArtifact(runSession, runStep, 'application-coding-task-agent-output.txt', agentOutput));\n }\n if (changeSet?.fullDiffText) {\n await traceBestEffort('write-change-set', () =>\n this.traceOperationArtifact(runSession, runStep, 'application-coding-task-change-set.diff', changeSet.fullDiffText));\n }\n\n /*\n * A run started past a landing the operator called wrong exists to CHANGE something (#2409). One that wrote no file\n * of its own — files attributed to another writer (dirty at baseline, a parallel session) are not its work — has\n * repaired nothing, whatever its checks say: they passed before it ran too. Only with a captured change set: a\n * capture that failed is its own disposition, and \"no files\" cannot be read from it.\n */\n const landedOverride = readGivenLandedOverride(task);\n const overrideChangedNothing = landedOverride !== undefined && changeSet !== null\n && codingRunChangedNoFileOfItsOwn(changeSet.files, isAttributedToAnotherWriter);\n const disposition = deriveApplicationCodingTaskDisposition({\n agentFailed: Boolean(runError),\n changeSetCaptureFailed: Boolean(captureError),\n verificationFailed: failedVerification !== null,\n overrideChangedNothing,\n traceabilityFailed: traceabilityErrors.length > 0,\n });\n const succeeded = disposition === ApplicationCodingTaskDisposition.WORKING_RESULT_RECORDED;\n /*\n * Whose failure this was (#1581). An agent failure is the HOST's only when the turn was TAKEN\n * AWAY: an operator cancelled it (this run's own abort signal), or the measured classifiers name\n * the environment (a mid-turn kill, a 529/429, a lost network) or the account (quota, expired\n * login). A timed-out turn also ends `cancelled`, and it is the task's — it needed more than a turn.\n */\n const runErrorMessage = runError ? describeCaughtError(runError) : '';\n const cancelledWithoutOperator = agentStopReason === CodingAgent_StopReason.CANCELLED && !turnCancelledByOperator;\n const agentPassages = readAgentPassageTexts(codingSessionRetention.frames());\n // What the turn ITSELF says about the network (its rejection, its own API-error report): a fresh loss, which holds.\n const reportedNetworkFailure = runError ? readCodingRunNetworkReport({ runErrorMessage, agentPassages }) : undefined;\n const agentBinding = Object.values(APPLICATION_CODING_AGENT_BINDINGS).find((binding) => binding.ref === opened.actorRef);\n /*\n * BEFORE the attribution, and deciding nothing itself: a probe here keeps the loss record true (a hold ends on a\n * reachable API; an unreachable one records the loss nobody reported, re-review of 8038824b4 F2).\n */\n if (runError && cancelledWithoutOperator && reportedNetworkFailure === undefined) await this.probeConnectivityAtCancelledSettlement(agentBinding, task.taskRef, taskId);\n const networkFailureKind = runError\n ? deriveCodingRunNetworkFailure({\n runErrorMessage,\n cancelledWithoutOperator,\n agentPassages,\n // The turn's own timeline decides a cancelled turn: in flight at a loss, no WORK frame after it, settled while it held or just after.\n connectivityLosses: this.connectivityLosses ?? [],\n turnStartedAtMs: startedAtMs,\n lastAgentWorkFrameAtMs,\n settledAtMs: Date.now(),\n })\n : undefined;\n const agentTurnTakenByHost = turnCancelledByOperator\n || isInfrastructureShapedAgentFailure(runErrorMessage)\n || isProviderAccountAgentFailure(runErrorMessage)\n || networkFailureKind !== undefined;\n const failureAttribution = deriveCodingRunFailureAttribution({ disposition, agentTurnTakenByHost, verificationCouldNotAsk });\n /*\n * The turn REPORTED a network loss (#3236): no other turn is admitted until the agent's API answers again. A turn\n * charged to the network only by its timeline spanned a loss already recorded (by a report or a failed probe, at\n * admission, at a settlement or in the background), and holds nothing new.\n */\n if (reportedNetworkFailure !== undefined) {\n this.holdForCodingAgentConnectivityLoss(reportedNetworkFailure, runErrorMessage, task.taskRef, taskId, agentBinding);\n }\n else if (succeeded && this.codingAgentConnectivityHold && startedAtMs > Date.parse(this.codingAgentConnectivityHold.observedAt)) {\n // A turn STARTED after the loss completed, so the network is back (the same proof the usage-limit hold takes, #2388 review F4).\n this.releaseCodingAgentConnectivityHold(this.codingAgentConnectivityHold, `${task.taskRef}, started after the loss, completed`);\n }\n /*\n * The account's usage limit, with the instant it ends (#2388). Recorded on the row, so the attempt budget\n * counts nothing for it and the feed can say when the lane resumes; held here, so the wave starts no\n * other turn into the same window. A success is proof the window is over — but only a run STARTED after\n * the limit was met: a sibling that began earlier may have finished its agent turn before the limit and\n * be settling only now, after minutes of checks (#2388 review F4).\n */\n const codingAgentUsageLimit = runError ? readCodingAgentUsageLimit(runErrorMessage, runErrorAt ?? new Date()) : null;\n if (codingAgentUsageLimit) this.holdForCodingAgentUsageLimit(codingAgentUsageLimit, task.taskRef, taskId);\n else if (succeeded) this.releaseCodingAgentUsageLimitHoldAfterSuccess(startedAtMs);\n /*\n * A check whose command could not be executed (#3423) fails every task's check the same way, so no other turn is\n * admitted until the command is on PATH again; the next admission looks it up first. A run that ASKED the held check\n * proves the command is back.\n */\n const unavailableVerificationTool = unavailableVerificationTools[0];\n if (unavailableVerificationTool !== undefined) this.holdForUnavailableVerificationTool(unavailableVerificationTool, task.taskRef, taskId);\n else this.releaseVerificationToolHoldIfAsked(verification.map(({ checkRef }) => checkRef).filter((checkRef) => !unrunCheckRefs.includes(checkRef)), task.taskRef);\n // Which runs shared the tree with this one, and where they both wrote (#1528). Absent for a run alone.\n const concurrency = this.closeCodingRunWindow(taskId, (changeSet?.files ?? []).map((entry) => entry.path));\n /*\n * A check this run could not ask for the host's reasons, other than its command (#3432): counted only when the run was\n * ALONE, so a sibling's red compile is never read as the host's. The same cause on a second task holds admissions.\n */\n if (concurrency === null && unavailableVerificationTool === undefined) {\n this.observeHostCheckFailures(verification\n .filter(({ checkRef }) => unrunCheckRefs.includes(checkRef))\n .map(({ checkRef, outcome }) => ({ checkRef, message: outcome.message })), task.taskRef, taskId);\n }\n // No change set (the executor threw, the capture failed): stamp HEAD now, so the run's window is bounded (#3224 F2).\n const settledHead = changeSet ? undefined : await this.readSettledHeadStamp();\n const output = {\n ...settledHead,\n succeeded,\n disposition,\n ...(failureAttribution !== null ? { failureAttribution } : {}),\n // Which network condition took the turn (#3236), so a reader tells DNS from a reset without the error text.\n ...(networkFailureKind !== undefined ? { networkFailureKind } : {}),\n ...(codingAgentUsageLimit ? { codingAgentUsageLimit } : {}),\n ...(concurrency ? {\n concurrency,\n /*\n * A failure while other runs were editing the same tree MAY be theirs — only when the tree could\n * have caused it (#2389, `deriveInterferenceSuspected`). Suspected, never proven: the attempt budget\n * forgives a bounded number of these (`selectBudgetCountingFailures`).\n */\n ...(deriveInterferenceSuspected({ disposition, failureAttribution, concurrency }) ? { interferenceSuspected: true } : {}),\n } : {}),\n durationMs: Date.now() - startedAtMs,\n agentOutputTail: agentOutput.slice(-OUTPUT_TAIL_CHARS),\n /*\n * What the agent says it could NOT meet (#2496), read from its closing report's typed block over the WHOLE message,\n * not the tail. Recorded whatever the disposition: the build plan derives a follow-up task from a completed run's,\n * and a person reading any run sees what its agent left unmet. A block that does not parse is recorded as such.\n */\n ...(() => {\n const unmet = parseClosingReportUnmetRequirements(agentOutput);\n // And what it states IS met (#3227), the positive statement that alone may close a gap another run reported.\n const met = parseClosingReportMetRequirements(agentOutput);\n return {\n ...(unmet.reported.length > 0 ? { unmetRequirements: unmet.reported } : {}),\n ...(unmet.malformed !== undefined ? { unmetRequirementsMalformed: unmet.malformed } : {}),\n ...(met.met.length > 0 ? { metRequirements: met.met } : {}),\n ...(met.malformed !== undefined ? { metRequirementsMalformed: met.malformed } : {}),\n };\n })(),\n // Recorded on the durable row because it is the difference between \"the\n // agent finished\" and \"the agent stopped\": a turn that ended on\n // `max_tokens` or `refusal` leaves a partial change set that looks exactly\n // like a complete one from the diff alone.\n ...(agentStopReason ? { agentStopReason } : {}),\n ...(codingSessionEventCount > 0 ? { codingSessionEventCount } : {}),\n // Red before this run started, and still red. Not this task's failure, and not nobody's.\n ...(carriedVerificationFailures.length > 0 ? { carriedVerificationFailures, carriedVerificationDiagnoses } : {}),\n ...(codingSessionRetention.frames().length > 0\n ? { codingSessionFrames: codingSessionRetention.frames(), codingSessionRetention: codingSessionRetention.summary() }\n : {}),\n // #2: the run's real cost, recorded on the durable row.\n //\n // This is what the previous transport structurally could not report, and\n // it was captured by the runner and dropped here — so the budget still saw\n // nothing. `usage` is optional in every field by contract, so absence is\n // preserved as absence rather than written as zero.\n ...(codingUsage ? { usage: codingUsage } : {}),\n ...(codingDeniedPermissionCount !== undefined\n ? { deniedPermissionCount: codingDeniedPermissionCount }\n : {}),\n // WHY each permission was decided, beside how many were refused. A refusal an operator\n // cannot explain is a refusal they cannot act on — see the field's contract.\n ...(codingPermissionDecisions && codingPermissionDecisions.length > 0\n ? { permissionDecisions: codingPermissionDecisions }\n : {}),\n ...(runError ? { error: buildOutputErrorPayload(runError) } : {}),\n ...(disposition === ApplicationCodingTaskDisposition.OVERRIDE_NOT_REPAIRED && landedOverride ? {\n overrideNotRepaired: {\n // The agent's own account travels with the verdict (#2409 review F12): the operator weighs it, nothing else does.\n message: `Run past a wrong landing (${landedOverride.reason}: ${landedOverride.note}) changed no file, so the defect is not repaired. `\n + `The agent said: \"${agentOutput.trim().slice(-OVERRIDE_NOT_REPAIRED_AGENT_SAY_CHARS) || 'nothing'}\". `\n + 'Fix the cause, or run it again with a note the agent can act on.',\n },\n } : {}),\n ...(captureError ? { changeSetCaptureError: buildOutputErrorPayload(captureError) } : {}),\n ...(verificationInfrastructureError ? { verificationInfrastructureError: buildOutputErrorPayload(verificationInfrastructureError) } : {}),\n ...(traceabilityErrors.length > 0 ? { traceabilityErrors: traceabilityErrors.map(buildOutputErrorPayload) } : {}),\n ...(scopeAssessment ? { scopeAssessment } : {}),\n verification,\n ...(changeSet ? {\n changeSetSummary: {\n baselineHeadSha: changeSet.baselineHeadSha,\n postRunHeadSha: changeSet.postRunHeadSha,\n headMovedDuringRun: changeSet.headMovedDuringRun,\n stats: changeSet.stats,\n /*\n * WHICH files, beside how many — asked for by the judge itself.\n *\n * On 2026-09-16, the first run whose evidence the `dispatch-outcome-sound` treatment could\n * read answered INDETERMINATE on its in-scope criterion, and said exactly why: \"the artifact\n * does not identify the changed paths or their contents. It therefore cannot show that the\n * dispatched target/stage was implemented within <the declared scope>\". That criterion asks\n * whether a schema task added a persisted shape and a ui-behavior task added field displays —\n * a question about PATHS, answered with counts.\n *\n * Path and attribution class only. The class is what lets a reader separate the run's own\n * work from a file that was already dirty at baseline or that a parallel session committed\n * inside the window — the distinction the criterion's own guidance turns on, and one the\n * counts flatten. Contents stay out: the full diff is a trace artifact, and pasting a\n * change-set into a durable row would put the repository inside its own task record.\n *\n * BOUNDED, because a durable row is not a diff: a task that touches more files than this\n * carries the first `CHANGE_SET_SUMMARY_FILE_LIMIT` and says how many it left out, which is\n * a truthful summary rather than a silently truncated one.\n */\n files: changeSet.files.slice(0, CHANGE_SET_SUMMARY_FILE_LIMIT).map((entry) => ({\n path: entry.path,\n attribution: entry.attribution,\n changeKind: entry.changeKind,\n })),\n ...(changeSet.files.length > CHANGE_SET_SUMMARY_FILE_LIMIT\n ? { filesOmittedFromSummary: changeSet.files.length - CHANGE_SET_SUMMARY_FILE_LIMIT }\n : {}),\n },\n } : { changeSetSummary: null }),\n };\n\n /*\n * The run CONCLUDED, and the engine's driver records it (#1359): the status, this output and the\n * change-set artifact land on the task in the one move that settles the execution. `FAILED` is a\n * conclusion here, not a throw — see {@link CodingRunResult}.\n */\n return {\n kind: CodingRunEnding.CONCLUDED,\n conclusion: {\n status: succeeded ? FlowsActors_Status.COMPLETED : FlowsActors_Status.FAILED,\n taskOutput: output,\n ...(changeSet ? { taskArtifacts: [buildChangeSetArtifact(taskId, changeSet)] } : {}),\n },\n output,\n afterSettle: async () => {\n /*\n * A run that ANSWERED a question and then failed would otherwise keep its resume inputs:\n * the driver leaves a FAILED run's checkpoint in place, because for most hosts re-running\n * from it is how a failure is recovered. Here it holds the admitted contract — context\n * bytes the durable row deliberately never carries — and the question it answered is gone,\n * so there is nothing to continue. A failed coding run is re-DISPATCHED, not resumed.\n */\n if (!succeeded && resume) {\n await traceBestEffort('consume-checkpoint', () => this.actorsSystem.consumeActorExecutionCheckpoint(opened.executionId, runSession));\n }\n if (succeeded) {\n await traceBestEffort('record-success', () => this.traceOperationSuccess({\n sessionContext: runSession,\n step: runStep,\n type: 'application-coding-task-run-success',\n summary: `Recorded working result for application coding task ${task.taskRef}`,\n payload: output,\n }));\n /*\n * Committed by a checkpoint, never on its own (#3204): its product already counts in the working tree. A CONCURRENT\n * run does not wait for it (review of 4a1b1f1bf F6): the checkpoint may queue behind the workspace lock a long\n * generation step holds, and this settlement holds the run's slot until it returns. A single-flight run holds\n * that lock itself, so its checkpoint commits now, inside it.\n */\n const concurrentRun = this.activeRuns.get(taskId)?.mode === CodingRunConcurrency.CONCURRENT;\n const checkpoint = this.requestBuildCheckpoint({ settlingTaskIds: [taskId], takeLock: concurrentRun });\n if (!concurrentRun) await checkpoint;\n this.announceRunCompleted({ taskRef: task.taskRef, runTaskId: taskId });\n return;\n }\n await traceBestEffort('record-failure', () => this.traceOperationFailure({\n sessionContext: runSession,\n step: runStep,\n type: 'application-coding-task-run-failure',\n summary: `Application coding task ${task.taskRef} requires follow-up`,\n error: runError ?? captureError ?? verificationInfrastructureError ?? traceabilityErrors[0] ?? new Error(`Application coding task disposition: ${disposition}`),\n payload: output,\n }));\n },\n };\n }\n\n // ================================================================\n // Interactive lane — classifier, live relay, park & resume\n // ================================================================\n\n /**\n * Classify a coding agent's end-of-turn message through the dedicated\n * structured classifier agent. Throws on any fault; the ENGINE ladder wraps\n * that into `CLASSIFIER_UNAVAILABLE` and settles, so this never has to invent\n * a safe default of its own.\n */\n private async classifyCodingTurnEnd(input: {\n readonly finalMessage: string;\n readonly turnIndex: number;\n }): Promise<CodingAgent_EndOfTurnClassification> {\n /*\n * A closing report is a finished task by the worker contract (#3204, `isClosingReport`): the agent ends its report\n * with the requirement blocks and nothing else. Decided here, without the model, because the model read a report's\n * \"still open\" note as a question and parked a finished run on a decision the blocks already carry.\n */\n if (isClosingReport(input.finalMessage)) return CodingAgent_EndOfTurnClassification.TASK_COMPLETE;\n const prompt = [\n 'A coding agent ended its turn with the message below. Classify what the message means so an '\n + 'autonomous runner can decide whether to continue it automatically or to settle it as finished.',\n '',\n '# Agent end-of-turn message',\n input.finalMessage,\n ].join('\\n');\n const invocation: FlowsActors_Agent_Invocation<any, any> = {\n agentRef: APPLICATION_CODING_TURN_CLASSIFIER_AGENT_REF,\n initiator: {},\n invocationContext: [],\n input: { prompt, schema: CodingTurnEndClassificationOutputSchema },\n output: { object: {} },\n executionContext: {},\n artifactBindings: [],\n };\n const response = await this.agentsService.invokeAgent(invocation);\n const raw = (response.output as { object?: unknown } | undefined)?.object;\n const parsed = CodingTurnEndClassificationOutputSchema.safeParse(raw);\n if (!parsed.success) {\n // A malformed classifier answer is a classifier fault: let the ladder fail\n // open rather than guess which situation the model meant.\n throw new Error('Coding turn-end classifier returned an unparseable result.');\n }\n return parsed.data.classification;\n }\n\n /** Fan one live frame out to a task's SSE subscribers. Best-effort, never throws into the run. */\n private publishCodingSessionFrame(taskId: string, frame: CodingSessionLiveFrame): void {\n const listeners = this.codingSessionSubscribers.get(taskId);\n if (!listeners) return;\n for (const listener of listeners) {\n try {\n listener(frame);\n } catch {\n // A subscriber must never be able to fail the run it observes.\n }\n }\n }\n\n /**\n * Subscribe to a task's live coding frames. Returns an unsubscribe function.\n *\n * Frames flow only while a run is ACTIVE for that task; a subscriber that\n * attaches after the run parked or finished simply receives nothing further,\n * which is why the SSE endpoint sends the current pending question up front.\n */\n public subscribeToCodingSession(taskId: string, listener: (frame: CodingSessionLiveFrame) => void): () => void {\n let listeners = this.codingSessionSubscribers.get(taskId);\n if (!listeners) {\n listeners = new Set();\n this.codingSessionSubscribers.set(taskId, listeners);\n }\n listeners.add(listener);\n return () => {\n const set = this.codingSessionSubscribers.get(taskId);\n if (!set) return;\n set.delete(listener);\n if (set.size === 0) this.codingSessionSubscribers.delete(taskId);\n };\n }\n\n /**\n * The questions currently awaiting an operator answer, for status/UX.\n *\n * Read from the ACTOR PLANE since #1359: every parked coding run is an execution of\n * `application-coding.system` that is `AWAITING_APPROVAL`, carrying the decision it waits on and\n * the checkpoint an answer continues from. Until then this read an in-process map, so a companion\n * restart emptied the list while the questions still stood — the board showed nothing to answer\n * for runs that were one answer away from continuing.\n *\n * Each carries a `decision` — the same `HumanDecision_Request` an interview and a clarification are\n * rendered from — so a reader needs no knowledge of ACP suspensions to show one. It is the decision\n * STORED on the execution when the run parked, not one rebuilt here: a second producer of a shared\n * contract would drift from the first the day an option changed.\n */\n public async listPendingCodingQuestions(sessionContext?: CompanionExecutionSessionContext): Promise<Array<{\n taskId: string; taskRef: string; question: string; parkedAt: string; resumable: boolean; decision: HumanDecision_Request;\n /** Which of the run's questions this is (`actorExecutionSuspensionRef`), opaque to a reader. An answer echoes it (#1581). */\n suspensionRef: string;\n }>> {\n return (await this.listParkedCodingRuns(sessionContext)).map((parked) => ({\n taskId: parked.taskId,\n taskRef: parked.checkpoint.taskRef,\n question: parked.checkpoint.suspension.question,\n parkedAt: parked.checkpoint.parkedAt,\n resumable: parked.checkpoint.suspension.resumable,\n decision: parked.decision,\n suspensionRef: parked.suspensionRef,\n }));\n }\n\n /**\n * Every coding run waiting on an operator, as the actor plane holds it.\n *\n * ONE system's waiting executions — not the 200 most recently updated rows of every actor, which is\n * what the task-list scans this replaced read, and why a parked coding row could fall outside the\n * window on a busy application and be reported as absent.\n *\n * A waiting row whose checkpoint does not parse is SKIPPED, never reported: it has lost the thing\n * an answer would continue, so it is not a parked run anybody can answer. The startup reconcile\n * aborts such a row for review; between restarts it is simply not offered.\n */\n private async listParkedCodingRuns(sessionContext?: CompanionExecutionSessionContext): Promise<Array<{\n executionId: string; taskId: string; checkpoint: ApplicationCodingRunCheckpoint; decision: HumanDecision_Request; suspensionRef: string;\n }>> {\n const waiting = await this.actorsSystem.listSuspendedActorExecutions(APPLICATION_CODING_SYSTEM_REF, sessionContext);\n const parked: Array<{ executionId: string; taskId: string; checkpoint: ApplicationCodingRunCheckpoint; decision: HumanDecision_Request; suspensionRef: string }> = [];\n for (const row of waiting) {\n const checkpoint = ApplicationCodingRunCheckpointSchema.safeParse(row.checkpoint?.context);\n const task = row.tasks[0];\n if (!checkpoint.success || !task || !row.suspension) continue;\n parked.push({ executionId: row._id, taskId: task._id, checkpoint: checkpoint.data, decision: row.suspension.decision, suspensionRef: actorExecutionSuspensionRef(row.suspension) });\n }\n return parked;\n }\n\n /**\n * A run that parked on a question, as the engine's driver is told to record it: the run waits on\n * its execution (`AWAITING_APPROVAL`) with the decision a person owes and the inputs an answer\n * continues from, and its task shows the question and what the turn cost so far.\n *\n * Deliberately skips change-set assessment and verification: a parked run's\n * edits are partial by definition, and assessing them as a final change set is\n * exactly the \"read a suspended turn as complete\" mistake the suspension field\n * exists to prevent.\n */\n private buildParkedCodingRunResult(params: {\n task: MetaWorkflow_ApplicationCodingTaskContract;\n taskId: string;\n baseline: GitWorktreeSnapshot;\n suspension: CodingAgent_SessionSuspension;\n output: Partial<CodingAgent_RunTaskOutput>;\n usage: CodingAgent_Usage | undefined;\n codingSessionEventCount: number;\n retainedCodingSessionFrames: Array<{ readonly kind: string; readonly payload: unknown }>;\n codingSessionRetention: CodingSessionRetentionSummary;\n startedAtMs: number;\n runSession: CompanionExecutionSessionContext | undefined;\n runStep: ReturnType<CompanionTraceabilityService['createStep']> | undefined;\n traceBestEffort: (operation: string, write: () => Promise<void>) => Promise<void>;\n }): CodingRunResult {\n const { task, taskId, baseline, suspension, output } = params;\n const parkedAt = new Date().toISOString();\n\n const durableOutput = {\n succeeded: false,\n disposition: ApplicationCodingTaskDisposition.AWAITING_OPERATOR_INPUT,\n durationMs: Date.now() - params.startedAtMs,\n // The question the operator must answer, front and centre.\n pendingQuestion: suspension.question,\n suspension,\n agentOutputTail: (output.finalMessage ?? '').slice(-OUTPUT_TAIL_CHARS),\n ...(output.stopReason ? { agentStopReason: output.stopReason } : {}),\n ...(output.turnCount ? { turnCount: output.turnCount } : {}),\n ...(output.continuations && output.continuations.length > 0 ? { continuations: output.continuations } : {}),\n ...(params.codingSessionEventCount > 0 ? { codingSessionEventCount: params.codingSessionEventCount } : {}),\n ...(params.retainedCodingSessionFrames.length > 0\n ? { codingSessionFrames: params.retainedCodingSessionFrames, codingSessionRetention: params.codingSessionRetention }\n : {}),\n ...(params.usage ? { usage: params.usage } : {}),\n ...(output.deniedPermissionCount !== undefined ? { deniedPermissionCount: output.deniedPermissionCount } : {}),\n ...(output.permissionDecisions && output.permissionDecisions.length > 0 ? { permissionDecisions: output.permissionDecisions } : {}),\n };\n\n // The resume inputs — see `ApplicationCodingRunCheckpointSchema` for why the CONTRACT and the\n // ORIGINAL baseline travel here rather than being re-derived when the answer arrives.\n const checkpoint: ApplicationCodingRunCheckpoint = {\n kind: APPLICATION_CODING_RUN_CHECKPOINT_KIND,\n taskRef: task.taskRef,\n contract: task,\n baseline,\n suspension,\n parkedAt,\n // Every leg so far, so the resume's row keeps their tokens (`mergeResumedLegUsage`).\n ...(params.usage ? { priorLegsUsage: params.usage } : {}),\n };\n\n return {\n kind: CodingRunEnding.PARKED,\n /*\n * UNROUTED, deliberately (#1751). Under the notify-and-proceed posture the ANSWERING AGENT settles\n * the questions it can before a person sees them (#1559), and an OWNER route admits only its\n * requester as a signed-in person: routed, every one of those answers would be refused and every\n * question would fall to the creator. A coding question is routed only once the route model can\n * express \"the agent acting within the posture the owner chose\" — until then its door is its\n * authority, and each settle still records its answer.\n */\n suspension: {\n decision: projectParkedCodingQuestionAsDecision({ taskId, taskRef: task.taskRef, suspension, parkedAt }),\n checkpointContext: checkpoint,\n taskOutput: durableOutput,\n },\n output: durableOutput,\n afterSettle: () => params.traceBestEffort('record-awaiting-input', () => this.traceOperationStart({\n sessionContext: params.runSession,\n step: params.runStep,\n type: 'application-coding-task-awaiting-input',\n summary: `Application coding task ${task.taskRef} is awaiting an operator answer`,\n payload: { taskId, question: suspension.question, resumable: suspension.resumable },\n })),\n };\n }\n\n /**\n * Has this build task ALREADY been run to a working result?\n *\n * Asked by the build dispatcher before it selects a task, and the reason is a measured money\n * leak rather than tidiness. `dispatch-next` picks `ready[0]`, and readiness is \"not landed\";\n * a task whose declared PRODUCT is never satisfied by the work it does is therefore ready\n * again the instant it finishes. Measured 2026-09-10 on Wonder CRM, where every task in the\n * plan declares `produces: []` and so can never land (#606): three consecutive dispatches\n * selected `build-task-contact-schema`, ran a full coding agent each time, and cost roughly\n * $7.50 per iteration. Nothing failed — each run succeeded — and the loop is unbounded.\n *\n * The durable actor-task rows are the right source and the only one that survives a restart:\n * an in-memory \"last dispatched\" would forget across the respawn that a rebuild triggers, and\n * the loop would resume.\n *\n * Deliberately COMPLETED only. A failed or cancelled run is exactly what an operator SHOULD be\n * able to re-dispatch, and a parked one is answered by resuming rather than by re-running.\n *\n * And a RE-ARMED completed run does not count (#1535): once the reason a task did not land is\n * fixed, `rearmBuildTask` records that on the run, and the task is offered again.\n */\n public async findCompletedRunForBuildTask(\n buildTaskRef: string,\n sessionContext?: CompanionExecutionSessionContext,\n /** A person's door reads now; the selection shares one read (#3204, see {@link listCompletedRunsForBuildTask}). */\n options: { readonly fresh?: boolean } = {},\n ): Promise<{ taskId: string; completedAt?: string; newestStartedAt?: string } | null> {\n const counting = await this.listCountingCompletedRunsForBuildTask(buildTaskRef, sessionContext, options);\n const [first] = counting;\n if (first === undefined) return null;\n /*\n * When the NEWEST counting run started (#3460, third review F2): the instant that says which plan the task was last\n * attempted under. The list is ordered by row update, not by run, and a run's completion can follow a plan commit it\n * never saw, so neither `first` nor a completion instant answers it.\n */\n const starts = counting.map((run) => run.startedAt ?? run.completedAt).filter((at): at is string => at !== undefined).sort();\n return { taskId: first.taskId, completedAt: first.completedAt, ...(starts.length > 0 ? { newestStartedAt: starts[starts.length - 1] } : {}) };\n }\n\n /**\n * Put a build task back in the queue after the reason it did not land has been fixed (#1535).\n *\n * Every completed run the anti-loop guard still counts, and every failed run not yet re-armed (a forgiven\n * one included, #1581), gets a re-arm recorded on its own row, in its\n * long-term memory, with the reason and a note. Nothing about the run is rewritten: it still reads\n * as the run it was, and it now also reads as a run that was superseded, and why.\n *\n * Refuses when there is nothing to re-arm, naming why, because a re-arm that changes nothing would\n * let an operator believe a task was released when it was never held.\n */\n public async rearmBuildTask(\n buildTaskRef: string,\n request: { readonly reason: BuildTaskRearmReason; readonly note: string },\n sessionContext?: CompanionExecutionSessionContext,\n ): Promise<{ readonly rearmedRunTaskIds: readonly string[]; readonly rearm: BuildTaskRearm }> {\n /*\n * Completed runs hold a task through the anti-loop guard; failed ones through its attempt budget\n * (#1536). EVERY failed run not yet re-armed is re-armed, including the ones the budget currently\n * FORGIVES (a host failure, suspected interference): forgiveness is bounded per task, and a re-arm\n * that left the forgiven runs in place would leave their slots used for good, so the first host\n * failure after the re-arm would already count (#1581, third review F-1).\n */\n const failedNotRearmed = (await this.listAttributableFailedRunsForBuildTask(buildTaskRef, sessionContext, { includeRearmed: true }))\n .filter((run) => readBuildTaskRearm(run.memory) === undefined);\n const runs = [\n ...(await this.listCountingCompletedRunsForBuildTask(buildTaskRef, sessionContext, { fresh: true })),\n ...failedNotRearmed,\n ];\n if (runs.length === 0) {\n throw new NothingToRearmError(\n `Build task \"${buildTaskRef}\" has no completed coding run that still counts and no failed one not yet re-armed, so there is nothing to re-arm: `\n + 'it was never run, or every run is already re-armed. A task in that state is '\n + 'offered by the next dispatch on its own.',\n );\n }\n const rearm: BuildTaskRearm = { reason: request.reason, note: request.note, rearmedAt: new Date().toISOString() };\n /*\n * A person saying the ENVIRONMENT failed the task also says it is back (#3236): the connectivity hold ends here too, so a\n * probe that cannot reach the agent's API by the path the agent uses (a proxy, a cloud endpoint) is never a lockout.\n */\n if (request.reason === BuildTaskRearmReason.ENVIRONMENT && this.codingAgentConnectivityHold) {\n this.releaseCodingAgentConnectivityHold(this.codingAgentConnectivityHold, `a re-arm of ${buildTaskRef} for the environment`);\n }\n if (request.reason === BuildTaskRearmReason.ENVIRONMENT) this.releaseVerificationToolUnavailableHold(`a re-arm of ${buildTaskRef} for the environment`);\n try {\n await this.serializeRunMemoryWrite(async () => {\n /*\n * Each run's memory is read again inside the lane: the listing above may predate a review or an interference\n * appended since, and writing its memory back would erase that entry.\n */\n const current = new Map((await this.listCompletedRunsForBuildTask(buildTaskRef, sessionContext, { fresh: true })).map((run) => [run.taskId, run.memory]));\n for (const run of runs) {\n const memory = current.has(run.taskId) ? current.get(run.taskId) : run.memory;\n await this.executionsService.updateActorTask(run.taskId, { memory: withBuildTaskRearm(memory, rearm) }, sessionContext);\n }\n });\n } finally {\n // A re-arm is actor-plane memory only — no file moves — and it releases a task the boards held as\n // stuck. Announced even when a later update threw: the runs re-armed before it did still moved.\n this.announceRunStateChanged();\n }\n return { rearmedRunTaskIds: runs.map((run) => run.taskId), rearm };\n }\n\n /**\n * The FAILED coding runs of one build task that still count against its attempt budget (#1536) —\n * newest first, re-armed runs excluded, each with what the dispatcher needs to tell the next attempt\n * why this one failed.\n *\n * Only the task's OWN failures count. Since `703d07c3` a check that was red before the run started\n * no longer fails it (the run completes and records `carriedVerificationFailures`). A CANCELLED or\n * ABORTED run is not an attempt and is not listed — which includes a dispatch refused before\n * admission, settled ABORTED (#1581), and a FAILED row written before that which never started. A FAILED run the HOST caused (`failureAttribution`,\n * {@link deriveCodingRunFailureAttribution}) — an operator's cancel of a running turn among them — is\n * forgiven up to `MAXIMUM_HOST_FAILURE_EXCLUSIONS`, like suspected interference: past the bound it\n * counts, so a host condition that fails every attempt still retires the task. A re-arm releases the\n * forgiven runs too (`rearmBuildTask`). A row older than the field counts. A run the coding agent's usage\n * limit took (`codingAgentUsageLimit`, #2388) is excluded outright and spends no forgiveness: the build\n * pauses until the limit's reset rather than re-dispatching into it. So is one the network took\n * (`networkFailureKind`, #3236): the connectivity hold keeps the next admission waiting on a probe.\n */\n public async listAttributableFailedRunsForBuildTask(\n buildTaskRef: string,\n sessionContext?: CompanionExecutionSessionContext,\n options: { readonly includeRearmed?: boolean } = {},\n ): Promise<{ taskId: string; settledAt?: string; startedAt?: string; memory: Actors_Memory_Context | undefined; output: Record<string, unknown> }[]> {\n const failed = await this.readFailedCodingTasks(sessionContext);\n const counting: { taskId: string; settledAt?: string; startedAt?: string; memory: Actors_Memory_Context | undefined; output: Record<string, unknown>; interferenceSuspected: boolean; hostAttributed: boolean; usageLimited: boolean; networkTaken: boolean }[] = [];\n for (const task of failed) {\n // A persisted task row: its instants are dates (#2187), and this record carries the ISO form.\n const stored = task as { _id?: string; actors?: { actorRef?: string }; input?: unknown; output?: unknown; completedAt?: Date; startedAt?: Date; memory?: Actors_Memory_Context };\n const row = { ...stored, completedAt: stored.completedAt?.toISOString(), startedAt: stored.startedAt?.toISOString() };\n if (!isApplicationCodingAgentRef(row.actors?.actorRef)) continue;\n if (!isRecordValue(row.input) || row.input.taskRef !== buildTaskRef) continue;\n // A re-armed failure no longer counts against the budget; a retry may still want to READ it.\n if (options.includeRearmed !== true && readBuildTaskRearm(row.memory) !== undefined) continue;\n const output = isRecordValue(row.output) ? row.output : {};\n /*\n * A run the HOST declined to start is no attempt (#1581, seventh review F7): the build board and the\n * retry context already read it so through `deriveCodingRunStart`, and the budget is the third reader\n * of that question. Only a row written before #1581 is FAILED and never started; today it is ABORTED.\n */\n if (options.includeRearmed !== true\n && deriveCodingRunStart({ status: FlowsActors_Status.FAILED, ...(row.startedAt ? { startedAt: row.startedAt } : {}), output }) === CodingRunStart.REFUSED_BY_HOST) {\n continue;\n }\n counting.push({\n taskId: String(row._id),\n ...(row.completedAt ? { settledAt: row.completedAt } : {}),\n // Whether the run STARTED is what tells a retry that nothing ran (`deriveCodingRunStart`).\n ...(row.startedAt ? { startedAt: row.startedAt } : {}),\n memory: row.memory,\n output,\n interferenceSuspected: output.interferenceSuspected === true,\n hostAttributed: output.failureAttribution === CodingRunFailureAttribution.HOST,\n // The account's usage limit took the turn: no attempt, and no forgiveness spent (#2388).\n usageLimited: readRecordedCodingAgentUsageLimit(output) !== undefined,\n // The network took the turn: no attempt either, the connectivity hold keeps the next one waiting (#3236).\n networkTaken: output.failureAttribution === CodingRunFailureAttribution.HOST && readRecordedNetworkFailureKind(output) !== undefined,\n });\n }\n /*\n * A run that failed while other runs shared the tree may have failed for THEIR edits (#1528). The\n * budget forgives up to MAXIMUM_INTERFERENCE_RETRIES of those, so interference cannot retire a\n * task, and a task that genuinely cannot pass still does. A retry READING its history sees them all.\n */\n return (options.includeRearmed === true ? counting : selectBudgetCountingFailures(counting))\n .map(({ interferenceSuspected: _suspected, hostAttributed: _host, usageLimited: _limited, networkTaken: _network, ...run }) => run);\n }\n\n /**\n * The completed coding runs of one build task that the anti-loop guard still counts — newest first,\n * re-armed runs excluded. One reader, so the guard and the re-arm cannot disagree about which runs\n * hold a task.\n */\n private async listCountingCompletedRunsForBuildTask(\n buildTaskRef: string,\n sessionContext?: CompanionExecutionSessionContext,\n options: { readonly fresh?: boolean } = {},\n ): Promise<{ taskId: string; completedAt?: string; startedAt?: string; memory: Actors_Memory_Context | undefined }[]> {\n return (await this.listCompletedRunsForBuildTask(buildTaskRef, sessionContext, options)).filter((run) => readBuildTaskRearm(run.memory) === undefined);\n }\n\n /**\n * Every COMPLETED coding run of one build task, re-armed ones included, in the order the actor plane lists\n * them (a caller that needs the latest sorts by `completedAt`), each with the interference the build wave\n * recorded on it (#2210). The wave reads it twice: to count how many interference re-arms the task has\n * already had (`MAXIMUM_INTERFERENCE_REARMS`), and to tell the next attempt that its previous one lost its\n * product to a sibling.\n */\n public async listCompletedRunsForBuildTask(\n buildTaskRef: string,\n sessionContext?: CompanionExecutionSessionContext,\n /**\n * Read the rows now rather than share the read the selection holds (#3204). For a writer: a re-arm and a memory\n * write decide on the rows they change, and an operator's door may follow a change nothing in this service announced.\n */\n options: { readonly fresh?: boolean } = {},\n ): Promise<{ taskId: string; completedAt?: string; startedAt?: string; memory: Actors_Memory_Context | undefined; interference?: BuildTaskInterference }[]> {\n /*\n * Scoped to the CODING actors before the list is trimmed (#1359). This used to read the 200 most\n * recently updated `COMPLETED` tasks of EVERY actor, so a busy judge or labelling lane could push\n * a completed coding run out of the window — and this guard would then answer \"never ran\" and\n * reopen the loop it exists to close. A task absent from a FULL window of 200 coding runs is then\n * read by its own ref (#3204), so a completed run is found whatever its age.\n */\n const completed = await this.readCompletedCodingTasksOf(buildTaskRef, sessionContext, options.fresh === true);\n\n const runs: { taskId: string; completedAt?: string; startedAt?: string; memory: Actors_Memory_Context | undefined; interference?: BuildTaskInterference }[] = [];\n for (const task of completed) {\n // A persisted task row: its instants are dates (#2187), and this record carries the ISO form.\n const stored = task as { _id?: string; actors?: { actorRef?: string }; input?: unknown; startedAt?: Date; completedAt?: Date; memory?: Actors_Memory_Context };\n const row = { ...stored, completedAt: stored.completedAt?.toISOString(), startedAt: stored.startedAt?.toISOString() };\n // MEMBERSHIP, not equality with one constant — the same reason\n // `reconcileInterruptedApplicationCodingTasks` gives: a second declared coding agent must\n // not make this silently answer \"never ran\".\n if (!isApplicationCodingAgentRef(row.actors?.actorRef)) continue;\n if (!isRecordValue(row.input) || row.input.taskRef !== buildTaskRef) continue;\n const interference = readBuildTaskInterference(row.memory);\n runs.push({ taskId: String(row._id), completedAt: row.completedAt, ...(row.startedAt ? { startedAt: row.startedAt } : {}), memory: row.memory, ...(interference ? { interference } : {}) });\n }\n return runs;\n }\n\n /**\n * The completed coding runs' rows, ONE read shared by every build task asking until a run's state changes (#3204).\n *\n * Each build task asks for its completed runs, and each ask listed the 200 most recent completed coding runs whole:\n * brief, transcript and output, 0.3 MB a row. A build wave's selection asks for every candidate task, so on reference\n * run 42536379955 the companion read 1.1 GB from MongoDB in 30 seconds and spent half its time collecting the garbage,\n * with one or two agents running out of ten. The rows change only when a run starts, ends, is re-armed or has its\n * memory written, and every one of those calls {@link announceRunStateChanged}, which moves the generation this read\n * is held under. A read is held under the generation it STARTED at, so a change landing while it runs is never\n * hidden. A few seconds' ceiling bounds what a writer outside this service could change unannounced.\n */\n private readCompletedCodingTasks(sessionContext?: CompanionExecutionSessionContext, fresh = false): Promise<readonly Wildo_Application_Actor_Task[]> {\n const generation = this.runStateGeneration ?? 0;\n const held = this.completedCodingTasksRead;\n if (!fresh && held !== undefined && held.generation === generation && Date.now() < held.heldUntilMs) return held.rows;\n const rows = this.executionsService.listActorTasks(CompanionActorTasksListQuerySchema.parse({\n status: FlowsActors_Status.COMPLETED,\n actorRefs: [...APPLICATION_CODING_AGENT_REFS],\n limit: COMPLETED_CODING_TASKS_WINDOW,\n }), sessionContext, { omitStoredFields: CODING_RUN_LISTING_OMITTED_FIELDS });\n this.completedCodingTasksRead = { generation, heldUntilMs: Date.now() + COMPLETED_CODING_TASKS_HOLD_MS, rows };\n // A failed read is held by nobody.\n rows.catch(() => {\n if (this.completedCodingTasksRead?.rows === rows) this.completedCodingTasksRead = undefined;\n });\n return rows;\n }\n\n /**\n * The FAILED coding runs' rows, one read shared by every build task asking until a run's state changes (#3204), exactly\n * as {@link readCompletedCodingTasks} shares the completed ones.\n *\n * `listAttributableFailedRunsForBuildTask` is asked once per candidate task of a selection, and each ask listed every\n * failed coding run whole: on reference run 42813811656, 16 MB per read, repeated within seconds, beside the completed\n * read, ~430 MB in 30 seconds with the companion's event loop saturated. Held under the run-state generation it started\n * at, with the same few seconds' ceiling, so a run failing or being re-armed is seen at once.\n */\n private readFailedCodingTasks(sessionContext?: CompanionExecutionSessionContext): Promise<readonly Wildo_Application_Actor_Task[]> {\n const generation = this.runStateGeneration ?? 0;\n const held = this.failedCodingTasksRead;\n if (held !== undefined && held.generation === generation && Date.now() < held.heldUntilMs) return held.rows;\n const rows = this.executionsService.listActorTasks(CompanionActorTasksListQuerySchema.parse({\n status: FlowsActors_Status.FAILED,\n actorRefs: [...APPLICATION_CODING_AGENT_REFS],\n limit: 200,\n }), sessionContext, { omitStoredFields: CODING_RUN_LISTING_OMITTED_FIELDS });\n this.failedCodingTasksRead = { generation, heldUntilMs: Date.now() + COMPLETED_CODING_TASKS_HOLD_MS, rows };\n rows.catch(() => {\n if (this.failedCodingTasksRead?.rows === rows) this.failedCodingTasksRead = undefined;\n });\n return rows;\n }\n\n private failedCodingTasksRead?: { readonly generation: number; readonly heldUntilMs: number; readonly rows: Promise<readonly Wildo_Application_Actor_Task[]> };\n\n /**\n * The completed coding-run rows that answer for ONE build task (#3204): the shared window ({@link readCompletedCodingTasks})\n * when it can answer, and otherwise that task's own rows, read from the database by its ref.\n *\n * The window holds the 200 most recently updated completed coding runs. A task with a row in it, or a window that is not\n * full, is answered from it; a task absent from a FULL window may have run before it, and on reference run 42845651222\n * (782 completed runs) such tasks read as never having run, un-landed and were dispatched again, one of them with 204\n * newer runs ahead of its only one. The per-task read answers whatever the age. It is held per task: a completed run\n * stays completed, a newer run of the task lands in the window, and the only other change, a re-arm or an interference\n * record written to a run's memory, goes through {@link serializeRunMemoryWrite}, which drops what is held. A FRESH read\n * (a person's door, a memory write deciding on the rows) always reads the task's own rows.\n */\n private async readCompletedCodingTasksOf(\n buildTaskRef: string,\n sessionContext?: CompanionExecutionSessionContext,\n fresh = false,\n ): Promise<readonly Wildo_Application_Actor_Task[]> {\n if (fresh) return this.executionsService.listActorTasksOfBuildTask(FlowsActors_Status.COMPLETED, buildTaskRef, sessionContext, { omitStoredFields: CODING_RUN_LISTING_OMITTED_FIELDS });\n const window = await this.readCompletedCodingTasks(sessionContext);\n const answersFromWindow = window.length < COMPLETED_CODING_TASKS_WINDOW\n || window.some((row) => isRecordValue(row.input) && (row.input as { taskRef?: unknown }).taskRef === buildTaskRef);\n if (answersFromWindow) return window;\n const held = (this.completedRunsOutsideWindow ??= new Map()).get(buildTaskRef);\n if (held !== undefined) return held;\n const rows = this.executionsService.listActorTasksOfBuildTask(FlowsActors_Status.COMPLETED, buildTaskRef, sessionContext, { omitStoredFields: CODING_RUN_LISTING_OMITTED_FIELDS });\n this.completedRunsOutsideWindow.set(buildTaskRef, rows);\n rows.catch(() => {\n if (this.completedRunsOutsideWindow?.get(buildTaskRef) === rows) this.completedRunsOutsideWindow.delete(buildTaskRef);\n });\n return rows;\n }\n\n /** Per-task reads of tasks absent from the window, dropped by every run-memory write (see {@link readCompletedCodingTasksOf}). */\n private completedRunsOutsideWindow?: Map<string, Promise<readonly Wildo_Application_Actor_Task[]>>;\n\n /** Moved by every {@link announceRunStateChanged}: a held read of the run rows is good only at its own generation. */\n private runStateGeneration?: number;\n private completedCodingTasksRead?: { readonly generation: number; readonly heldUntilMs: number; readonly rows: Promise<readonly Wildo_Application_Actor_Task[]> };\n\n /**\n * Record on a COMPLETED run that the build wave found its product lost to a sibling (#2210). Appended to the\n * run's long-term memory beside any re-arm, so the run still reads as the run it was, and now also as one a\n * sibling interfered with. Refuses a run that is not a completed run of this task, because the record would\n * otherwise describe a run it was never measured on.\n */\n public async recordBuildTaskInterference(\n buildTaskRef: string,\n runTaskId: string,\n interference: BuildTaskInterference,\n sessionContext?: CompanionExecutionSessionContext,\n ): Promise<void> {\n await this.serializeRunMemoryWrite(async () => {\n const run = (await this.listCompletedRunsForBuildTask(buildTaskRef, sessionContext, { fresh: true })).find((candidate) => candidate.taskId === runTaskId);\n if (!run) throw new Error(`Run ${runTaskId} is not a completed coding run of build task \"${buildTaskRef}\"; no interference is recorded on it.`);\n try {\n await this.executionsService.updateActorTask(runTaskId, { memory: withBuildTaskInterference(run.memory, interference) }, sessionContext);\n } finally {\n // The build record shows it; a board that read the run before must read it again.\n this.announceRunStateChanged();\n }\n });\n }\n\n /**\n * Record on a COMPLETED run what the review of its website copy found (#2593), beside any re-arm or interference.\n * Refuses a run that is not a completed run of this task, for the reason {@link recordBuildTaskInterference} does.\n */\n public async recordWebsiteCopyReview(\n buildTaskRef: string,\n runTaskId: string,\n review: WebsiteCopyReview,\n sessionContext?: CompanionExecutionSessionContext,\n ): Promise<void> {\n await this.serializeRunMemoryWrite(async () => {\n const run = (await this.listCompletedRunsForBuildTask(buildTaskRef, sessionContext, { fresh: true })).find((candidate) => candidate.taskId === runTaskId);\n if (!run) throw new Error(`Run ${runTaskId} is not a completed coding run of build task \"${buildTaskRef}\"; no copy review is recorded on it.`);\n try {\n await this.executionsService.updateActorTask(runTaskId, { memory: withWebsiteCopyReview(run.memory, review) }, sessionContext);\n } finally {\n this.announceRunStateChanged();\n }\n });\n }\n\n /**\n * Record on a COMPLETED run what the review of its website drawing found (#2785), beside its copy review. Refuses a\n * run that is not a completed run of this task, as {@link recordWebsiteCopyReview} does.\n */\n public async recordWebsiteVisualReview(\n buildTaskRef: string,\n runTaskId: string,\n review: WebsiteVisualReview,\n sessionContext?: CompanionExecutionSessionContext,\n ): Promise<void> {\n await this.serializeRunMemoryWrite(async () => {\n const run = (await this.listCompletedRunsForBuildTask(buildTaskRef, sessionContext, { fresh: true })).find((candidate) => candidate.taskId === runTaskId);\n if (!run) throw new Error(`Run ${runTaskId} is not a completed coding run of build task \"${buildTaskRef}\"; no visual review is recorded on it.`);\n try {\n await this.executionsService.updateActorTask(runTaskId, { memory: withWebsiteVisualReview(run.memory, review) }, sessionContext);\n } finally {\n this.announceRunStateChanged();\n }\n });\n }\n\n /**\n * Which runs shared the tree with this one, and which paths both changed, computed NOW from every window\n * this process holds (#2210). `closeCodingRunWindow` answers the same question at the run's own settle,\n * when a sibling still running has not reported its paths yet; at the end of a wave every window is\n * closed, so this one sees every sibling. `null` for a run this process holds no window for, or one that\n * overlapped nothing.\n */\n public describeCodingRunOverlap(taskId: string): CodingRunConcurrencyRecord | null {\n const window = this.codingRunWindows.find((candidate) => candidate.taskId === taskId);\n if (!window || window.endedAtMs === undefined) return null;\n const record = describeRunConcurrency(this.codingRunWindows, { taskId, startedAtMs: window.startedAtMs, endedAtMs: window.endedAtMs }, window.changedPaths ?? []);\n return record.overlappingTaskRefs.length > 0 ? record : null;\n }\n\n /**\n * A run for this build task that is PARKED on an unanswered question.\n *\n * The sibling above answers \"has this task already run to a terminal state?\" and is what the\n * dispatcher's anti-loop guard consults. It lists `COMPLETED` tasks only, so a run that SUSPENDS is\n * invisible to it, and its task would be offered again on every dispatch, forever.\n *\n * Measured 2026-09-16 on Wonder CRM: `build-task-gdpr-data-handling-governance` suspended, and the\n * next `dispatch-next` dry run selected the same task — neither landed, nor marked, nor skipped.\n * That is the money-burning loop `buildUnlandableTaskError` was written against (#606, ~$7.50 a\n * turn), reached through the one door that guard cannot see.\n *\n * Re-dispatching a parked task is worse than re-dispatching a completed one: it starts a NEW run\n * and abandons the persisted session the operator's answer would have resumed, so the question and\n * everything the agent established are lost rather than merely repeated.\n *\n * Reads the waiting EXECUTIONS of the coding system since #1359 — see `listParkedCodingRuns` for\n * the residual that closed.\n */\n public async findParkedRunForBuildTask(\n buildTaskRef: string,\n sessionContext?: CompanionExecutionSessionContext,\n ): Promise<{ taskId: string; question: string; resumable: boolean } | null> {\n for (const parked of await this.listParkedCodingRuns(sessionContext)) {\n if (parked.checkpoint.taskRef !== buildTaskRef) continue;\n /*\n * RESUMABLE only, and matching the answer door's own predicate is the whole point. A\n * non-resumable park cannot be answered — that door refuses it — so reporting it here would\n * make the dispatcher skip the one task no operator can unblock: a dead end in both\n * directions. A non-resumable park is therefore reported as NOT parked, and a fresh dispatch\n * is the only way forward for it.\n */\n if (!parked.checkpoint.suspension.resumable) continue;\n return { taskId: parked.taskId, question: parked.checkpoint.suspension.question, resumable: true };\n }\n return null;\n }\n\n /**\n * The parked run behind one TASK id, or `null` when nothing answerable waits under it.\n *\n * The task id is the lane's handle and the execution is the engine's, so this is the join: the\n * task row names its execution, and the driver says whether that execution is waiting. Every way\n * of not being a parked coding run answers `null` — not a coding task, no execution, not waiting,\n * a checkpoint that no longer parses. A read that FAILS answers `null` too in the lenient default,\n * for the one caller that treats every miss alike (the answering-agent loop, whose miss sends the\n * question to the creator); a\n * STRICT read throws it instead, for a caller that must not tell a person \"nothing is waiting\" when\n * nothing was read (#1581, tenth and eleventh reviews).\n */\n private async readParkedCodingRun(\n taskId: string,\n sessionContext?: CompanionExecutionSessionContext,\n /**\n * STRICT: a read that FAILED throws instead of answering `null` — for a caller that must tell \"nothing\n * is waiting\" from \"could not tell\" (#1581, tenth review R10-1): every door that answers a person (the\n * answer door, the per-run cancel, a chain's withdraw) reads strictly.\n */\n options: { readonly strict?: boolean } = {},\n ): Promise<{ executionId: string; suspensionRef: string; checkpoint: ApplicationCodingRunCheckpoint; mode: CodingRunConcurrency } | null> {\n let executionId: string | undefined;\n try {\n const row = await this.executionsService.getActorTask(taskId, sessionContext);\n if (!isApplicationCodingAgentRef(row.actors?.actorRef)) return null;\n executionId = row.wildoApplicationActorSystemExecutionId;\n } catch (error) {\n if (options.strict === true && !isAbsentParkRead(error)) throw error;\n return null;\n }\n if (!executionId) return null;\n try {\n const waiting = await this.actorsSystem.readSuspendedActorExecution(executionId, sessionContext);\n const checkpoint = ApplicationCodingRunCheckpointSchema.safeParse(waiting.row.checkpoint?.context);\n // A run parked from a wave resumes as one: it holds only its task, never the tree (#1528).\n const mode = isConcurrentRunSubject(waiting.row.exclusiveSubject) ? CodingRunConcurrency.CONCURRENT : CodingRunConcurrency.SINGLE_FLIGHT;\n // The suspension it waits on NOW: a resume carries it, so an answer read against one question cannot continue the next (#1581, seventh review F9).\n return checkpoint.success ? { executionId, suspensionRef: actorExecutionSuspensionRef(waiting.suspension), checkpoint: checkpoint.data, mode } : null;\n } catch (error) {\n // `readSuspendedActorExecution` refuses an execution that is not waiting — already answered,\n // cancelled, settled. For this door that is \"nothing to answer\", not a fault; a failed read is.\n if (options.strict === true && !isAbsentParkRead(error)) throw error;\n return null;\n }\n }\n\n /**\n * (dead-plan-citation: CODING-ANSWERS.md is the file this method writes.)\n * Append one answer to `src/build-plan/CODING-ANSWERS.md` — the record of what a person told a\n * parked coding run (#1454, Step 6). Until then the answer lived only in the agent session and\n * the run log, so a reviewer accepting the change set could not see the decision it rests on.\n *\n * Best-effort: a record that cannot be written is logged and the answer still goes to the agent\n * — the person's answer is not held hostage to a file. The file lands beside the build plan as a\n * working edit; a commit accepts it like every other decision record.\n */\n private async recordCodingQuestionAnswer(\n taskRef: string,\n question: string,\n answer: string,\n source: { readonly answeredBy?: CodingQuestionAnswerer; readonly basis?: string; readonly answeredByRef?: string } = {},\n ): Promise<void> {\n const specificationsPackageRoot = this.companionContext.resolvedSpecifications?.packageRoot;\n const buildPlanPath = getFamilyPackageRelativePath(ApplicationSpecificationFamily.BUILD_PLAN);\n if (!specificationsPackageRoot || !buildPlanPath) return;\n const filePath = join(specificationsPackageRoot, dirname(buildPlanPath), CODING_ANSWERS_FILE_NAME);\n try {\n await mkdir(dirname(filePath), { recursive: true });\n const entry = renderCodingQuestionAnswerEntry({ taskRef, question, answer, answeredAt: new Date().toISOString(), ...source });\n if (existsSync(filePath)) await appendFile(filePath, entry, 'utf8');\n else await writeFile(filePath, `${renderCodingQuestionAnswersHeader()}${entry}`, 'utf8');\n } catch (error) {\n this.logDebug('Could not record the coding-question answer beside the build plan (the answer still resumes the run)', { taskRef, error: String(error) });\n }\n }\n\n /**\n * Answer a parked coding task's question, resuming the SAME agent session.\n *\n * ONE door, in-process or after a restart (#1359). The run's execution is `AWAITING_APPROVAL`\n * with the contract, the original baseline and the agent session on its checkpoint, and the\n * engine's `resumeActorExecution` continues it under the same ids: it refuses an execution that is\n * no longer waiting on the question this answer names BEFORE moving anything — so a second answer\n * to one question cannot run the work twice — moves the rows back to `PROCESSING`, and settles\n * whatever the continued run does, including parking again on a second question.\n *\n * WHICH question the answer names is the caller's to say, and it is required (`expected.suspensionRef`,\n * the value a pending question and its workbench row carry): an answer that named nothing would\n * continue whichever question the run waits on when the request lands, which is not necessarily the\n * one its person read (#1581, eighth and ninth reviews).\n *\n * A single-flight run resumes under the worktree mutation lock, exactly like a fresh dispatch (a\n * resume mutates the same worktree); a run parked from a wave resumes beside it, holding no lock, as\n * it ran (#1528). Either way it re-enters the turn ladder through `session/load`, so the agent\n * continues with its full context. The mutation scope and verification plan are the parked\n * contract's; a resume is held to the same bounds as the first run, and its change set is measured\n * from the first run's baseline.\n */\n public async respondToApplicationCodingTaskQuestion(\n taskId: string,\n answer: string,\n sessionContext: CompanionExecutionSessionContext | undefined,\n expected: {\n readonly suspensionRef: string;\n /** Who answered (#1658) — `git:<email>`, `agent:<name>`, a workbench user — written into `CODING-ANSWERS.md` (dead-plan-citation: written file). */\n readonly answeredByRef?: string;\n /** The signed-in person answering (#1751), when the door has one: the decision's recorded actor. */\n readonly actingUserId?: string;\n },\n ): Promise<ApplicationCodingTaskRunAdmission> {\n // A missing answer is a VALIDATION 400 regardless of whether a task is parked\n // — it is a malformed request, not a state conflict.\n const trimmedAnswer = this.admitTypedInput(() => {\n const value = answer.trim();\n if (value.length === 0) throw new Error('empty answer');\n return value;\n }, 'An answer is required to resume a parked coding task.');\n // Which question it answers: required, and a blank reference names none — a 400 at every door (#1581, R12-1).\n const answeredRef = this.admitTypedInput(() => {\n const value = expected.suspensionRef.trim();\n if (value.length === 0) throw new Error('empty suspensionRef');\n return value;\n }, 'An answer must name the question it answers (`suspensionRef`, as the pending question carries it).');\n // STRICT: a failed read must not tell a person their question is gone (#1581, eleventh review R11-5).\n const parked = await this.readParkedCodingRun(taskId, sessionContext, { strict: true }).catch((error: unknown) => {\n this.logger.warn('The answer door could not read the coding run\\'s park', { taskId, error: describeCaughtError(error) });\n throw this.buildDispatchConflictError(\n `Coding task ${taskId} could not be read, so your answer was not applied. Its question may still be waiting; try again.`,\n );\n });\n if (!parked) {\n throw this.buildDispatchConflictError(\n `No coding task is awaiting an answer under id ${taskId}. It was already answered, cancelled or settled, `\n + 'or it is not a coding run.',\n );\n }\n const { checkpoint, executionId, mode } = parked;\n // The fast 409: the run has asked again since the caller read its question. The driver re-checks the\n // same suspension reference when it resumes, so a question asked after this point is refused there too.\n if (answeredRef !== parked.suspensionRef) {\n throw this.buildDispatchConflictError(\n `Coding task ${taskId} has asked another question since the one you answered. Read its current question and answer that.`,\n );\n }\n // Past that check the caller's reference IS this one; the driver holds the resume to it.\n const { suspensionRef } = parked;\n if (!checkpoint.suspension.resumable) {\n throw this.buildDispatchConflictError(\n `Coding task ${taskId} parked on a question, but its agent does not support session resume, `\n + 'so the answer cannot be delivered to the same session. Re-dispatch the task with the answer folded into the objective.',\n );\n }\n // Answers are serialized behind the same worktree: refused while another run holds it. The\n // driver re-takes the subject on resume and refuses there too; this names the holder first.\n await this.refuseWhileWorktreeIsHeld(null, sessionContext);\n if (mode === CodingRunConcurrency.SINGLE_FLIGHT) await this.refuseWhileConcurrentRunsInFlight(sessionContext);\n const task = checkpoint.contract;\n const verificationPlans = this.admitTypedInput(\n () => resolveApplicationCodingTaskVerificationPlans(task.verificationIntent.requiredChecks),\n 'The parked coding task names a verification check this host no longer registers.',\n );\n\n const admission = createDeferred<ApplicationCodingTaskRunAdmission>();\n const resumeBody = async () => {\n /*\n * Refused while THIS process still runs a chain for the task (#1581, fifth review R5-1/R5-2). A\n * run that parked is still registered while its own chain offers the question to the answering\n * agent (#1559). Under single-flight the worktree lock already excludes a person's answer there;\n * a CONCURRENT run holds no lock, so without this a person's resume would take over the chain's\n * registration and settlement, and the chain's ending would delete the one and strand the other.\n * Checked HERE, where it is followed by the registration with nothing awaited in between, and\n * nowhere earlier: a second, earlier check could only ever repeat this one.\n */\n this.refuseWhileRunChainIsLive(taskId);\n // ONE settlement for the whole chain: the resumed turn, and any questions the answering agent\n // then answers under the same hold (#1559) — a caller awaiting it sees the chain's final state.\n const settlement = createDeferred<void>();\n this.applicationCodingTaskSettlements.set(taskId, { promise: settlement.promise, resolve: () => settlement.resolve(undefined) });\n /*\n * Registered for the WHOLE chain, as a dispatched run is (#1581, fourth review A-1): each resume\n * inherits this entry, so an operator's cancel reaches the resumed turn, and a cancel made while\n * the answering agent decides a follow-up question still finds the run rather than \"nothing is\n * running\". Removed when the chain settles.\n */\n this.registerActiveRun({ taskId, startedAt: new Date().toISOString(), abortController: new AbortController(), mode: mode ?? CodingRunConcurrency.SINGLE_FLIGHT });\n let resumed: ParkedRunResume | undefined;\n try {\n resumed = await this.resumeParkedRunHoldingLock({\n taskId,\n executionId,\n suspensionRef,\n checkpoint,\n answer: trimmedAnswer,\n answerSource: expected.answeredByRef?.trim() ? { answeredByRef: expected.answeredByRef.trim() } : {},\n ...(expected.actingUserId ? { actingUserId: expected.actingUserId } : {}),\n verificationPlans,\n sessionContext,\n mode,\n onAdmitted: (admitted) => admission.resolve(admitted),\n });\n // Only a resume that RAN can have parked again: a refused one left the person's question where\n // it was, and it is still theirs, not the answering agent's (#1581, seventh review F5).\n if (resumed.outcome === ParkedRunResumeOutcome.RAN) await this.answerParkedQuestionsHoldingLock(taskId, sessionContext);\n } finally {\n // Awaited ONLY when cancelled: a chain that was not checks and unregisters in one synchronous step,\n // so no cancel can land between the two and be lost (#1581, ninth review R9-4).\n const ending = this.isRunCancelled(taskId) ? await this.withdrawCancelledRunChain(taskId, sessionContext) : null;\n this.unregisterActiveRun(taskId);\n this.applicationCodingTaskSettlements.get(taskId)?.resolve();\n // A resume that never reached the executor answered nobody: the caller is told why, in its own terms.\n admission.reject(this.buildDispatchConflictError(this.describeUnresumedAnswer(taskId, resumed, ending)));\n this.announceRunStateChanged();\n }\n };\n // A run parked from a wave resumes beside it, holding no lock, as it ran (#1528).\n const resumeRun = mode === CodingRunConcurrency.CONCURRENT\n ? resumeBody()\n : withDedicatedFileLock(this.getWorkspaceMutationLockPath(), resumeBody, { retries: { retries: 0 } });\n resumeRun.catch((error: unknown) => {\n admission.reject(this.mapLockError(error));\n this.logDebug('Application coding-task resume run terminated with error', {\n taskId,\n error: describeCaughtError(error),\n });\n });\n\n return admission.promise;\n }\n\n /**\n * Why a person's answer resumed nothing (#1581, seventh review F5; eighth review R8-5), in the terms of\n * what actually happened. A cancel wins over any refusal: the run is withdrawn either way. A held subject\n * leaves the question WAITING, so the person may answer again; only the driver's NOT_SUSPENDED means the\n * question is gone; anything else is a failure to ask, and says so.\n */\n private describeUnresumedAnswer(taskId: string, resumed: ParkedRunResume | undefined, ending: CancelledParkOutcome | null): string {\n if (ending !== null || resumed?.outcome === ParkedRunResumeOutcome.CANCELLED) {\n if (ending === CancelledParkOutcome.STILL_WAITING) {\n return `Coding task ${taskId} was cancelled before your answer could resume it, but its question could not be withdrawn and is still waiting. Cancel it again.`;\n }\n if (ending === CancelledParkOutcome.UNCONFIRMED) {\n return `Coding task ${taskId} was cancelled before your answer could resume it, but the run could not be read to confirm it was withdrawn. Check it, and cancel it again if it is still waiting.`;\n }\n return `Coding task ${taskId} was cancelled before your answer could resume it; it no longer waits, and your answer ran nothing.`;\n }\n if (resumed?.outcome === ParkedRunResumeOutcome.REFUSED) {\n if (isActorExecutionSubjectBusyError(resumed.refusal)) {\n return `Coding task ${taskId} could not be resumed yet: another run holds its worktree. Its question is still waiting — answer again once that run finishes.`;\n }\n if (isActorExecutionNotSuspendedError(resumed.refusal)) {\n return `Coding task ${taskId} could not be resumed: it is no longer awaiting this answer (it was answered, cancelled, or has asked again).`;\n }\n return `Coding task ${taskId} could not be resumed (${describeCaughtError(resumed.refusal)}). Its question is still waiting; answer again.`;\n }\n return `Coding task ${taskId} could not be resumed. Its question is still waiting; answer again.`;\n }\n\n /**\n * The terminal record of a resume a cancel stopped before any turn (#1581, ninth review R9-6): its trace\n * session was opened for a turn that never ran, and must say why it holds nothing else. Best effort.\n */\n private async recordCancelledBeforeTurn(trace: CodingRunTrace, taskRef: string, taskId: string): Promise<void> {\n await trace.traceBestEffort('record-cancelled-before-turn', () => this.traceOperationStart({\n sessionContext: trace.runSession,\n step: trace.runStep,\n type: 'application-coding-task-cancelled-before-turn',\n summary: `Application coding task ${taskRef} was cancelled before its answer resumed a turn`,\n payload: { taskId },\n }));\n }\n\n /** The terminal record of a resume the DRIVER refused before any turn (#1581, tenth review R10-2). Best effort. */\n private async recordResumeRefused(trace: CodingRunTrace, taskRef: string, taskId: string, refusal: unknown): Promise<void> {\n await trace.traceBestEffort('record-resume-refused', () => this.traceOperationStart({\n sessionContext: trace.runSession,\n step: trace.runStep,\n type: 'application-coding-task-resume-refused',\n summary: `Application coding task ${taskRef} could not be resumed: ${describeCaughtError(refusal)}`,\n payload: { taskId },\n }));\n }\n\n /**\n * Refuse (409) to start a person's resume while this process still runs a chain for the task — the\n * park's own chain offering its question to the answering agent (#1559, #1581).\n */\n private refuseWhileRunChainIsLive(taskId: string): void {\n if (!this.activeRuns.has(taskId)) return;\n throw this.buildDispatchConflictError(\n `Coding task ${taskId} is still being handled here: its own run is deciding whether it can answer the question `\n + 'it parked on, or it is being cancelled. Answer once it reports the question as waiting for you.',\n );\n }\n\n /**\n * Continue one parked run with an answer. The CALLER holds the worktree mutation lock (a concurrent\n * run holds none) and owns the run's settlement — which is what lets the answering agent resume a\n * run from inside the hold of the run that parked, without a second acquire (the lock is not\n * re-entrant) and without the build loop taking the worktree in between (#1559).\n *\n * Says how it went ({@link ParkedRunResumeOutcome}); a caller must not treat a refused or cancelled\n * resume as a run that happened.\n */\n private async resumeParkedRunHoldingLock(input: {\n readonly taskId: string;\n readonly executionId: string;\n /** The suspension the answer was read against: the driver refuses a run now waiting on a later one (#1581, seventh review F9). */\n readonly suspensionRef: string;\n readonly checkpoint: ApplicationCodingRunCheckpoint;\n readonly answer: string;\n /** Who answered, for `CODING-ANSWERS.md` — nothing for a person (dead-plan-citation: a file the companion writes). */\n readonly answerSource: { readonly answeredBy?: CodingQuestionAnswerer; readonly basis?: string; readonly answeredByRef?: string };\n /** The signed-in person answering, when one is (#1751) — recorded as the decision's actor. */\n readonly actingUserId?: string;\n readonly verificationPlans: ReturnType<typeof resolveApplicationCodingTaskVerificationPlans>;\n readonly sessionContext?: CompanionExecutionSessionContext;\n readonly mode?: CodingRunConcurrency;\n readonly onAdmitted?: (admitted: ApplicationCodingTaskRunAdmission) => void;\n }): Promise<ParkedRunResume> {\n const { taskId, checkpoint } = input;\n const task = checkpoint.contract;\n const baseline = checkpoint.baseline;\n /*\n * INHERIT the run's registration when there is one (#1581, third review). Answered inside the hold of\n * the run that parked (#1559), the run is still registered, and an operator may have cancelled it\n * while the answering agent was deciding: a fresh controller dropped that cancel and ran the resumed\n * turn anyway. The entry is restored afterwards rather than deleted, so a cancel between chained\n * resumes still finds the run instead of answering \"nothing is running\".\n */\n const inherited = this.activeRuns.get(taskId);\n this.activeRuns.set(taskId, {\n taskId,\n startedAt: inherited?.startedAt ?? new Date().toISOString(),\n abortController: inherited?.abortController ?? new AbortController(),\n mode: input.mode ?? inherited?.mode ?? CodingRunConcurrency.SINGLE_FLIGHT,\n });\n // The resumed turn is coding work in its own right, registered or not around it: it holds the beat.\n this.adjustCodingWorkDepth(taskId, 1);\n this.openCodingRunWindow(taskId, task.taskRef);\n let admitted = false;\n let cancelledAfterAdmission = false;\n let refusal: unknown;\n try {\n // A cancel already made opens no trace for a turn that will not run (#1581, eighth review R8-6).\n if (this.isRunCancelled(taskId)) return { outcome: ParkedRunResumeOutcome.CANCELLED };\n const trace = await this.openCodingRunTrace(taskId, task.taskRef);\n /*\n * The cancel check before a turn starts, for both answerers (#1581, seventh review F3): after the\n * last thing this chain awaits before the driver's resume. A cancel found here starts no turn and\n * spends nothing, and the chain that owns the run withdraws the park. One landing later — inside\n * the driver's own read-and-take — is caught by the executor, which hands the question back.\n */\n if (this.isRunCancelled(taskId)) {\n await this.recordCancelledBeforeTurn(trace, task.taskRef, taskId);\n return { outcome: ParkedRunResumeOutcome.CANCELLED };\n }\n await this.superviseCodingRun(task.taskRef, taskId, trace, async (capture) => {\n try {\n return await this.actorsSystem.resumeActorExecution(\n input.executionId,\n async (opened, resumed) => {\n admitted = true;\n /*\n * A cancel landing inside the driver's own read-and-take (#1581, eighth review R8-7): the rows\n * are PROCESSING already, so the SAME question is handed back — its decision and resume\n * inputs, the task's output left as it was, under a new suspension reference as every\n * suspension gets — and the chain withdraws the park CANCELLED on its way out, like any\n * cancelled park. No answer recorded, no turn started, no attempt spent.\n */\n if (this.isRunCancelled(taskId)) {\n cancelledAfterAdmission = true;\n return capture({\n kind: CodingRunEnding.PARKED,\n suspension: { decision: resumed.suspension.decision, checkpointContext: checkpoint },\n output: undefined,\n afterSettle: () => this.recordCancelledBeforeTurn(trace, task.taskRef, taskId),\n });\n }\n // Admitted HERE, once the engine has moved the rows back to PROCESSING: a resume the\n // driver refuses (somebody answered first) rejects the admission instead of claiming it.\n input.onAdmitted?.({\n taskId,\n status: FlowsActors_Status.PROCESSING,\n taskRef: task.taskRef,\n baselineHeadSha: baseline.headSha,\n baselineDirtyFileCount: Object.keys(baseline.files).length,\n });\n // Started again, announced only NOW that the engine has moved its rows back to PROCESSING:\n // a read that re-derived before that would still see the run as parked.\n this.announceRunStateChanged();\n /*\n * The answer is a DECISION the change set will rest on: recorded beside the build plan\n * before the turn, so a turn that then fails still leaves the decision where a reviewer\n * reads (#1454, Step 6) — and only once the driver ADMITTED the resume, so an answer that\n * resumed nothing is never recorded as one that did (#1581, seventh review F5).\n */\n await this.recordCodingQuestionAnswer(task.taskRef, checkpoint.suspension.question, input.answer, input.answerSource);\n return capture(await this.executeApplicationCodingTask(\n task,\n renderApplicationCodingTaskAgentPrompt(task),\n input.verificationPlans,\n opened,\n baseline,\n trace,\n { continuationOfSessionId: checkpoint.suspension.sessionId, answerPrompt: input.answer, ...(checkpoint.priorLegsUsage ? { priorLegsUsage: checkpoint.priorLegsUsage } : {}) },\n ));\n },\n trace.runSession,\n {\n ...this.codingRunOptions,\n expectedSuspensionRef: input.suspensionRef,\n /*\n * No `restoreSuspensionOnFailure`, and the restart recovery depends on that (#1865): without it the engine\n * writes no continuation marker, so a restart during this turn settles the run ABORTED and reports it, and\n * `recoverInterruptedRunWrites` captures it from the run's original baseline, both turns' writes included.\n * Asking for it would put the run back on its question instead, outside that recovery: a writer with no\n * record whose turn's files no commit names. Pinned by \"a restart during a resumed turn aborts the run\".\n */\n /*\n * The answer, so the status change that ends the wait records its outcome (#1751), whoever\n * answered — the person, or the answering agent (#1559). A coding park is deliberately NOT\n * routed (see where it parks), so `actor` only feeds the record.\n */\n decision: {\n ...(input.actingUserId ? { actor: humanDecisionSettler(input.actingUserId) } : {}),\n answer: {\n decisionId: taskId,\n optionRef: Workbench_ParkedCodingQuestionOptionRef.ANSWER,\n values: [{ ref: WORKBENCH_PARKED_CODING_QUESTION_FIELD_REF, value: input.answer }],\n },\n },\n },\n );\n } catch (error) {\n if (!admitted) refusal = error;\n throw error;\n }\n });\n if (cancelledAfterAdmission) return { outcome: ParkedRunResumeOutcome.CANCELLED };\n if (admitted) return { outcome: ParkedRunResumeOutcome.RAN };\n // The trace opened for this resume holds no turn: it says why (#1581, tenth review R10-2).\n await this.recordResumeRefused(trace, task.taskRef, taskId, refusal);\n return { outcome: ParkedRunResumeOutcome.REFUSED, refusal };\n } finally {\n this.endCodingRunWindow(taskId);\n if (inherited) this.activeRuns.set(taskId, inherited);\n else this.activeRuns.delete(taskId);\n this.adjustCodingWorkDepth(taskId, -1);\n // NOT announced here: this runs inside a chain its CALLER settles (`resumeBody`, or a fresh run\n // answering its parked questions), and that caller announces once the whole chain has settled.\n }\n }\n\n /**\n * Offer a run's parked question to the ANSWERING AGENT before it reaches the creator (#1559), and\n * keep doing so while the run parks again on a question the agent can answer.\n *\n * Runs inside the worktree hold of the run that parked, BEFORE that run's settlement resolves: the\n * build loop waits on the settlement, so it sees the chain's final outcome, and it cannot take the\n * worktree between the park and the answer — a race that would send answerable questions to a person\n * for no reason.\n *\n * Bounded three ways, all in `decideAgentAnswerAttempt`: the posture (GUIDED keeps every question with\n * the person), one verdict per question, and {@link MAXIMUM_AGENT_ANSWERS_PER_RUN} answers per run.\n * Every verdict is written to the run's task memory BEFORE anything acts on it, so a wrong\n * self-answer can be audited and a restart cannot ask the same question twice — except a verdict the\n * agent reaches after an operator cancelled the run, which is dropped: it would record an answer\n * nothing applied.\n *\n * Never fails the run. A refusal, a failed model call, an unparseable answer or a resume the driver\n * refused leaves the park as it was, and the question reaches the creator. A CANCEL is the one\n * exception, and it is not handled here: whichever way this returns, the chain that owns the run\n * withdraws a cancelled park when it ends ({@link withdrawCancelledRunChain}).\n */\n private async answerParkedQuestionsHoldingLock(taskId: string, sessionContext?: CompanionExecutionSessionContext): Promise<void> {\n try {\n for (;;) {\n // A cancel stops the handling at once: no model call is spent on a run that is ending (#1581).\n if (this.isRunCancelled(taskId)) return;\n const parked = await this.readParkedCodingRun(taskId, sessionContext);\n if (!parked || !parked.checkpoint.suspension.resumable) return;\n const row = await this.executionsService.getActorTask(taskId, sessionContext);\n const question = parked.checkpoint.suspension.question;\n const decision = decideAgentAnswerAttempt({\n posture: APPLICATION_CREATION_AUTONOMY_POSTURE,\n question,\n priorRecords: readParkedQuestionAnswers(row.memory),\n });\n if (decision !== AgentAnswerAttemptDecision.ATTEMPT) {\n this.logDebug('Parked question left for the creator', { taskId, decision });\n return;\n }\n const task = parked.checkpoint.contract;\n const agentOutputTail = String((row.output as { agentOutputTail?: unknown } | undefined)?.agentOutputTail ?? '');\n const output = await this.askAnsweringAgent({ brief: renderApplicationCodingTaskAgentPrompt(task), question, agentOutputTail });\n if (!output) return;\n // Cancelled while the agent decided: its verdict is NOT recorded — it would describe an answer never applied.\n if (this.isRunCancelled(taskId)) return;\n const answer = output.verdict === ParkedQuestionAnswerVerdict.ANSWERED ? output.answer.trim() : '';\n const record: ParkedQuestionAnswerRecord = {\n // An `answered` with no answer is not an answer; the creator is asked.\n verdict: answer.length > 0 ? ParkedQuestionAnswerVerdict.ANSWERED : ParkedQuestionAnswerVerdict.PRODUCT_DECISION,\n question,\n answer,\n basis: output.basis.trim(),\n decidedAt: new Date().toISOString(),\n };\n await this.executionsService.updateActorTask(taskId, { memory: withParkedQuestionAnswer(row.memory, record) }, sessionContext);\n this.logger.info('The answering agent returned a verdict on a parked coding question', {\n taskId, taskRef: task.taskRef, verdict: record.verdict,\n });\n if (record.verdict !== ParkedQuestionAnswerVerdict.ANSWERED) return;\n const resumed = await this.resumeParkedRunHoldingLock({\n taskId,\n executionId: parked.executionId,\n suspensionRef: parked.suspensionRef,\n checkpoint: parked.checkpoint,\n answer,\n answerSource: { answeredBy: CodingQuestionAnswerer.ANSWERING_AGENT, basis: record.basis },\n verificationPlans: resolveApplicationCodingTaskVerificationPlans(task.verificationIntent.requiredChecks),\n sessionContext,\n mode: parked.mode,\n });\n // Only a resume that RAN can have parked again on a question worth offering.\n if (resumed.outcome !== ParkedRunResumeOutcome.RAN) return;\n }\n } catch (error) {\n this.logger.warn('The answering agent could not handle a parked coding question; it goes to the creator unless the run was cancelled', {\n taskId,\n error: describeCaughtError(error),\n });\n }\n }\n\n /** Whether an operator cancelled the run this process is handling for `taskId`. */\n private isRunCancelled(taskId: string): boolean {\n return this.activeRuns.get(taskId)?.abortController.signal.aborted === true;\n }\n\n /**\n * End a run an operator cancelled while its chain was handling it (#1581, sixth to tenth reviews): a run\n * PARKED at this point is withdrawn, `CANCELLED`, \"the person chose not to continue\". Called from each\n * chain's ONE exit path, and only when the chain was cancelled, so no way of leaving the question handling\n * (a refusal, a failed or unparseable model call, a resume the driver refused) leaves a cancelled run\n * parked. The withdraw is recorded on the entry, which stays registered until the caller deletes it, so a\n * person's answer is refused until it is done and a second cancel answers with its outcome. A\n * `CANCELLED` run is no attempt of the task's.\n */\n private withdrawCancelledRunChain(taskId: string, sessionContext?: CompanionExecutionSessionContext): Promise<CancelledParkOutcome> {\n const entry = this.activeRuns.get(taskId);\n const withdrawal = this.endParkIfWaiting(taskId, sessionContext, entry ? this.cancellersByController.get(entry.abortController) : undefined);\n if (entry) entry.withdrawal = withdrawal;\n return withdrawal;\n }\n\n /**\n * Withdraw the task's park if one is waiting — `CANCELLED` — and say what became of it. Reads STRICTLY,\n * so a store that cannot be read is reported as UNCONFIRMED rather than as \"nothing was waiting\"\n * (#1581, tenth review R10-1). Never throws: its callers run in a `finally` or answer a person.\n */\n private async endParkIfWaiting(\n taskId: string,\n sessionContext?: CompanionExecutionSessionContext,\n /** Who withdrew it (#1751), when a signed-in person did: recorded as the decider of the withdrawn question. */\n withdrawnByUserId?: string,\n ): Promise<CancelledParkOutcome> {\n try {\n const parked = await this.readParkedCodingRun(taskId, sessionContext, { strict: true });\n if (!parked) return CancelledParkOutcome.ENDED;\n await this.actorsSystem.cancelSuspendedActorExecution(parked.executionId, sessionContext,\n withdrawnByUserId ? { decision: { actor: humanDecisionSettler(withdrawnByUserId) } } : undefined);\n this.logDebug('A cancelled coding run was withdrawn from its park', { taskId, executionId: parked.executionId });\n return CancelledParkOutcome.ENDED;\n } catch (error) {\n this.logger.warn('A cancelled coding run could not be withdrawn from its park', { taskId, error: describeCaughtError(error) });\n try {\n // Refused because it is no longer waiting (withdrawn meanwhile) ends it as surely as withdrawing it.\n return (await this.readParkedCodingRun(taskId, sessionContext, { strict: true })) ? CancelledParkOutcome.STILL_WAITING : CancelledParkOutcome.ENDED;\n } catch {\n return CancelledParkOutcome.UNCONFIRMED;\n }\n }\n }\n\n /** ONE structured call to the answering agent; `null` when it produced nothing usable, which leaves the question with the creator. */\n private async askAnsweringAgent(input: { readonly brief: string; readonly question: string; readonly agentOutputTail: string }): Promise<ParkedQuestionAnswerOutput | null> {\n const invocation: FlowsActors_Agent_Invocation<any, any> = {\n agentRef: PARKED_QUESTION_ANSWERER_AGENT_REF,\n initiator: {},\n invocationContext: [],\n input: { prompt: renderParkedQuestionAnswerPrompt(input), schema: ParkedQuestionAnswerOutputSchema },\n output: { object: {} },\n executionContext: {},\n artifactBindings: [],\n };\n const response = await this.agentsService.invokeAgent(invocation);\n const parsed = ParkedQuestionAnswerOutputSchema.safeParse((response.output as { object?: unknown } | undefined)?.object);\n return parsed.success ? parsed.data : null;\n }\n\n private buildApplicationCodingTaskTraceSummary(task: MetaWorkflow_ApplicationCodingTaskContract): Record<string, unknown> {\n return {\n taskRef: task.taskRef,\n objectiveRef: task.objectiveRef,\n candidateRef: task.candidateRef,\n mutationScope: task.mutationScope,\n contextPlanRef: task.contextPlan.planRef,\n selectedSourceRefs: task.contextSelection.selectedSources.map((source) => source.sourceRef),\n verificationRef: task.verificationIntent.verificationRef,\n requiredChecks: task.verificationIntent.requiredChecks,\n installedSkillRefs: task.installedSkillRefs,\n };\n }\n\n // ================================================================\n // Verification hook (P-29c — enum vocabulary, never a command string)\n // ================================================================\n\n /**\n * An argv check (a typecheck, a test path, a package build) run by its command's bare name, `pnpm` say. A command that\n * cannot be spawned is an absent tool (#3423 review F7), never a red check: read as a failed outcome it was \"already red\n * at baseline\", so the run's own failure was carried and the task landed unverified. Thrown here, it is unrun at both\n * passes, so the failure is the host's and the verification tool hold stops every later admission.\n */\n private async runArgvVerification(kind: VerificationKind, requestedPath: string | undefined): Promise<VerificationOutcome> {\n const plan = this.buildVerificationPlan(kind, requestedPath);\n const outcome = await this.runVerification(plan);\n refuseWhenVerificationToolIsAbsent(outcome, { command: plan.command, checking: `run ${plan.command} ${plan.args.join(' ')}` });\n return outcome;\n }\n\n private buildVerificationPlan(kind: VerificationKind, requestedPath?: string): VerificationPlan {\n if (kind === VerificationKind.VITEST_PATH) {\n const sanitized = this.sanitizeRelativePath(requestedPath ?? '');\n const absoluteTestPath = join(this.companionContext.saasRoot, sanitized);\n const packageDir = this.findNearestPackageDir(dirname(absoluteTestPath));\n return {\n kind,\n path: sanitized,\n command: 'pnpm',\n args: ['exec', 'vitest', 'run', relative(packageDir, absoluteTestPath)],\n cwd: packageDir,\n };\n }\n\n // PACKAGE_BUILD — the package's own build script, in the package (#2228).\n if (kind === VerificationKind.PACKAGE_BUILD) {\n const sanitizedPackage = this.sanitizeRelativePath(requestedPath ?? '');\n return {\n kind,\n path: sanitizedPackage,\n command: 'pnpm',\n args: ['run', 'build'],\n cwd: join(this.companionContext.saasRoot, sanitizedPackage),\n };\n }\n\n // TYPECHECK — optional path points at a workspace package directory.\n const sanitized = requestedPath ? this.sanitizeRelativePath(requestedPath) : null;\n return {\n kind,\n path: sanitized,\n command: 'pnpm',\n args: ['exec', 'tsc', '--noEmit'],\n cwd: sanitized ? join(this.companionContext.saasRoot, sanitized) : this.companionContext.saasRoot,\n };\n }\n\n /**\n * The FK-resolution sweep, sourced from the `resources-registry` introspection\n * behavior — a FRESH subprocess import of the app's shared-lib, never the\n * companion's boot-time cache, so it judges exactly the bytes the mutation\n * left on disk. Fails the check when any `.isForeignKey()` field has no\n * registered relationship edge: invisible to every typecheck in the plan and\n * to the backend boot, fatal to the app's frontend at first page load\n * (`frontend_fk_resolution_failed` — wonder-crm, 2026-08-27).\n */\n private async runForeignKeyResolutionVerification(): Promise<VerificationOutcome> {\n const backendServiceKey = Object.entries(this.companionContext.servicesByKey)\n .find(([, service]) => !service.frontendType)?.[0];\n if (!backendServiceKey) {\n throw new Error('No backend service is available to run the frontend-fk-resolution verification.');\n }\n const result = await this.introspectionService.requestInfo({\n serviceKey: backendServiceKey,\n behavior: 'resources-registry',\n });\n if (!result.success) {\n throw new Error(`resources-registry introspection failed: ${JSON.stringify(result)}`);\n }\n const unresolved = (result.data as { unresolvableForeignKeyFields?: Array<{ resourceType: string; fieldName: string }> })\n .unresolvableForeignKeyFields ?? [];\n const success = unresolved.length === 0;\n return {\n kind: VerificationKind.FRONTEND_FK_RESOLUTION,\n path: null,\n success,\n message: success\n ? 'every isForeignKey() field resolves through a registered relationship'\n : `${unresolved.length} FK field(s) cannot be resolved to a resource type: `\n + unresolved.map(({ resourceType, fieldName }) => `${resourceType}.${fieldName}`).join(', ')\n + ' — declare a relationship with the corresponding foreignKeyField.',\n stdoutTail: '',\n stderrTail: '',\n };\n }\n\n /**\n * The settings-rail content sweep — the SHELL_PLACEMENT counterpart of the FK sweep,\n * and it exists for the same reason: the defect it catches is invisible to a typecheck.\n *\n * A placement naming a `destinationRef` the engine catalog does not ship is not a type\n * error. `resolveSettingsHubConfig` DROPS it, and the section silently never renders —\n * so a coding task that typo'd a ref passes `check:app-typecheck`, reports verified, and\n * leaves the application missing a settings section nobody is told about.\n *\n * WARNINGS do not fail the check. Only errors do: the verifier reports both severities,\n * and failing a coding task on an advisory would train the lane to ignore its own gate.\n */\n private async runSettingsPlacementContentVerification(): Promise<VerificationOutcome> {\n // Mirrors the FK sweep's resolution, on the other side of the same predicate: that\n // one wants a backend service, this one a FRONTEND service, because the settings rail\n // is authored in the frontend workspace and only that subprocess can import it.\n const frontendServiceKey = Object.entries(this.companionContext.servicesByKey)\n .find(([, service]) => service.frontendType)?.[0];\n if (!frontendServiceKey) {\n throw new Error('No frontend service is available to run the settings-placement-content verification.');\n }\n const result = await this.introspectionService.requestInfo({\n serviceKey: frontendServiceKey,\n behavior: 'settings-placement-content',\n });\n if (!result.success) {\n throw new Error(`settings-placement-content introspection failed: ${JSON.stringify(result)}`);\n }\n const data = result.data as {\n authored?: boolean;\n errors?: Array<{ severity: string; code: string; message: string }>;\n };\n const blocking = (data.errors ?? []).filter((error) => error.severity !== 'warning');\n /*\n * The rail the introspection judged is the one the companion export imports; the runtime receives it only as\n * `settingsHub` in `frontendBaseConfig` (#3101). A task that dropped that line passed this check, every test and the\n * typecheck, and Settings opened empty (#3100). Read as text, by the predicate `wildo local doctor` uses.\n */\n const hubPath = join(this.companionContext.saasRoot, FRONTEND_SETTINGS_HUB_CONFIG_RELATIVE_PATH);\n const registryPath = join(this.companionContext.saasRoot, FRONTEND_MODULES_REGISTRY_RELATIVE_PATH);\n const runtimeWiringRefusal = existsSync(hubPath) && existsSync(registryPath) && settingsHubConfigAuthorsRail(readFileSync(hubPath, 'utf8'))\n && !frontendRegistryPassesSettingsHub(readFileSync(registryPath, 'utf8'))\n ? `${FrontendSettingsHubWiringFindingCode.SETTINGS_HUB_NOT_PASSED_TO_RUNTIME}: ${FRONTEND_MODULES_REGISTRY_RELATIVE_PATH} does not pass the authored rail to the running frontend (\\`settingsHub: settingsHubConfig\\` in \\`frontendBaseConfig\\`), so Settings opens as an empty dialog`\n : undefined;\n const success = blocking.length === 0 && runtimeWiringRefusal === undefined;\n return {\n kind: VerificationKind.SETTINGS_PLACEMENT_CONTENT,\n path: null,\n success,\n message: success\n ? 'every authored placement names a destination the engine ships'\n // An application with no authored rail fails with `SETTINGS_HUB_EMPTY`: the engine places no hub of its own,\n // so Settings would open empty (#3100). Saying that nothing was authored names the remedy.\n : (data.authored === false ? 'no settings rail is authored, so Settings opens as an empty dialog. ' : '')\n + [\n ...(blocking.length > 0 ? [`${blocking.length} settings-placement error(s): ${blocking.map((error) => `${error.code}: ${error.message}`).join(' | ')}`] : []),\n ...(runtimeWiringRefusal !== undefined ? [runtimeWiringRefusal] : []),\n ].join(' | '),\n stdoutTail: '',\n stderrTail: '',\n };\n }\n\n /**\n * The schema-plan drift gate — `wildo db diff --check` at the application root.\n *\n * ## Why it is not simply another argv plan\n *\n * The other CLI checks answer a two-valued question about a package that always exists.\n * This one has THREE outcomes, and collapsing any of them into \"failed\" would fail runs\n * on a question nobody asked:\n *\n * 1. **No committed lockfile** — answered here, from the application's DECLARED store\n * (`ApplicationSchemaPlanObligation`, #1144), because `wildo db diff --check` exits\n * non-zero for every application without one. A MongoDB application is permanently in\n * this state (a collection exists on first write; there is no plan to drift from): a\n * pass that says it checked nothing. A PostgreSQL application in it has had no\n * migration create its tables and cannot boot: a FAILED check naming the initial\n * `wildo db generate`. A store that cannot be read is \"we could not ask\": it THROWS.\n * 2. **No `backend-api/dist`** — the model is computed by IMPORTING the compiled\n * modules registry, and the build lane only ever runs `tsc --noEmit`, which emits\n * nothing. This is \"we could not ask\", not \"the application has drifted\", so it\n * THROWS and is reported as an infrastructure error. Same distinction this playbook's\n * method already draws for the typechecks, and the same reasoning\n * `reconcileDevelopmentSchemaDrift` uses when it SKIPS on a stale model rather than\n * generating a migration for a model nobody has.\n * 3. **Both present** — the spawn decides, and its own message is carried through: it\n * names the drifted tables and the command that fixes them, which is more than this\n * layer could reconstruct.\n *\n * ## Why the check is worth having at all\n *\n * It is the only check in the catalog that can see a missing table. A resource whose\n * migration was never generated typechecks green in every package and then refuses\n * to boot with `postgresql_table_schema_mismatch` — measured 2026-09-07, when an engine\n * resource landed with migrations for two of the three PostgreSQL-backed applications\n * and the third crash-looped until a human read the log.\n */\n private async runSchemaPlanDriftVerification(): Promise<VerificationOutcome> {\n const saasRoot = this.companionContext.saasRoot;\n const assessment = await assessApplicationSchemaPlanObligation(saasRoot);\n if (assessment.obligation === ApplicationSchemaPlanObligation.NOT_OWED) {\n return {\n kind: VerificationKind.SCHEMA_PLAN_DRIFT,\n path: null,\n success: true,\n // Says it checked NOTHING rather than reporting a clean plan — the same honesty the\n // settings-placement sweep applies to an application with no authored rail.\n message: `no schema-plan lockfile, and ${assessment.declaredIn} does not declare PostgreSQL — this application has not adopted migrations, so there is no accepted plan to drift from (every MongoDB application is in this state permanently)`,\n stdoutTail: '',\n stderrTail: '',\n };\n }\n if (assessment.obligation === ApplicationSchemaPlanObligation.BASELINE_OWED) {\n /*\n * A FAILED check, not a pass (#1144). Until then no lockfile read as \"not adopted\" whatever the store,\n * so a PostgreSQL application whose initial migration was never generated verified green here — the\n * one check in the catalog that can see a missing table, answering for the one application that has\n * none of them.\n */\n return {\n kind: VerificationKind.SCHEMA_PLAN_DRIFT,\n path: null,\n success: false,\n message: `no schema-plan baseline, but ${assessment.declaredIn} declares PostgreSQL — no migration has created this application's tables, so its backend cannot boot. Generate the initial migration with \\`wildo db generate --name initial-schema\\` (it writes the baseline in the same invocation) and commit both.`,\n stdoutTail: '',\n stderrTail: '',\n };\n }\n if (assessment.obligation === ApplicationSchemaPlanObligation.UNDETERMINED) {\n // Infrastructure, not drift: nothing about the model was asked.\n throw new Error(`Cannot check schema-plan drift: there is no schema-plan lockfile and ${assessment.reason}.`);\n }\n\n const modulesRegistryPath = join(saasRoot, 'backend-api', 'dist', 'modules-registry.backend.js');\n if (!existsSync(modulesRegistryPath)) {\n // THROWN on purpose: `executeVerificationPlans` classifies a throw as an infrastructure\n // error and reports it apart from a failing check. A `success: false` here would say the\n // application has drifted, which is a claim about a model that was never computed.\n throw new Error(\n `Cannot check schema-plan drift: ${modulesRegistryPath} does not exist. The plan is computed by importing `\n + \"the compiled backend registry, and this build never emitted one (`tsc --noEmit` does not). Build backend-api, \"\n + 'or run this check under `wildo local dev`, whose watcher maintains that dist.',\n );\n }\n\n const outcome = await this.runVerification({\n kind: VerificationKind.SCHEMA_PLAN_DRIFT,\n path: null,\n command: 'wildo',\n args: ['db', 'diff', '--check'],\n cwd: saasRoot,\n });\n // The CLI is a GLOBAL install (`platform/factory/scripts/install.sh`) and is not linked\n // into an application's `node_modules/.bin` — verified on both dogfood applications. So\n // \"wildo is not on PATH\" is an absent tool, never a drifted schema.\n refuseWhenVerificationToolIsAbsent(outcome, { command: 'wildo', checking: 'check schema-plan drift', absent: /ENOENT|not found/i });\n /*\n * COULD NOT ASK is not DRIFT, and `wildo db diff --check` cannot tell them apart by exit code —\n * it answers `{ success: false }` for both (`diff.command.ts`), so the message is the only\n * discriminator, exactly as it already is for the ENOENT case above.\n *\n * `computeCurrentLockfileJson` refuses before planning whenever the compiled model is STALE —\n * \"shared-lib/dist is older than its sources … This is NOT drift: wait for the watcher to\n * rebuild\" — or when `backend-api/dist` is absent. Reported as a failing check, both read as\n * \"this application has drifted\", which is a claim about a model that was never computed. On a\n * per-task check that matters twice over: the check runs seconds after an agent wrote the very\n * sources the watcher is still compiling, so the race is the COMMON case rather than the edge.\n *\n * Thrown, like every other infrastructure absence here, so `executeVerificationPlans` reports it\n * apart from a failing check and a BASELINE pass cannot read it as \"already broken\".\n */\n if (!outcome.success && /Cannot compute the current schema plan/i.test(`${outcome.stdoutTail}\\n${outcome.stderrTail}`)) {\n throw new Error(\n 'Cannot check schema-plan drift: the CLI refused to compute the current plan, so nothing about the model was '\n + `asked. This is NOT drift. ${outcome.stderrTail.trim() || outcome.stdoutTail.trim()}`,\n );\n }\n return outcome;\n }\n\n /**\n * The specifications package EVALUATED, as the companion evaluates it (#3210, #3211). Each specification whose\n * factory refuses its definition fails the check with the validator's own message, which names the field and the\n * remedy, so the run's repair has the sentence it needs. Asked through the companion's own data door, which holds an\n * evaluation only while the tree's signature does, so the answer is about the tree the run left.\n *\n * A module that cannot be evaluated (#3258) — every other module still serves, so the package does not fail as a\n * whole — fails the check when a root cause is the module's own (`AUTHORING_ERROR`: an authored throw, a factory\n * outside the refusal capture refusing, a file that does not parse), named with its error.\n *\n * \"Could not ask\" THROWS, so the check is reported unrun rather than failed: root causes that a stale build may\n * explain (`POSSIBLY_STALE_BUILD`, `specificationModuleFaultsAreAVerdict`), and an entry that failed the same way, or\n * whose evaluation never answered at all. A refusal beside them is named but decides nothing: a factory refuses what a\n * stale build gave it as readily as what an author wrote. Those messages carry both readings and the frame to open\n * (`describeSpecificationsLoadFailure`, `describeSpecificationModuleFault`); a baseline pass must not read them as\n * \"already broken\", and a post-run pass attributes them to the host.\n */\n private async runSpecificationExportsVerification(): Promise<VerificationOutcome> {\n const findings = await readSpecificationsEvaluationFindings(this.companionContext);\n /*\n * And each documentation chapter FILE (#3204), which nothing imports, so the package's evaluation above never sees it.\n * A chapter file imports only framework packages, so a fault here is the file's own: always a verdict.\n */\n const packageRoot = this.companionContext.resolvedSpecifications?.packageRoot;\n const chapterFileFaults = packageRoot === undefined ? [] : await findApplicationDocumentationChapterFileFaults(packageRoot);\n const describeModule = (fault: (typeof findings.moduleFaults)[number]): string => describeApplicationSpecificationModuleFault(fault, this.companionContext);\n const refused = findings.faults.length === 0 ? [] : [`${findings.faults.length} specification(s) refused: ${findings.faults.map(describeSpecificationDefinitionFault).join(' | ')}`];\n const isVerdict = findings.moduleFaults.length > 0\n ? specificationModuleFaultsAreAVerdict(findings.moduleFaults)\n : findings.loadError === null || findings.loadErrorReading === SpecificationModuleFaultReading.AUTHORING_ERROR;\n if (!isVerdict) {\n throw new Error(findings.loadError !== null\n ? `Cannot evaluate the specifications package, so no specification was asked about: ${findings.loadError}`\n : `Cannot evaluate ${findings.moduleFaults.length} specifications module(s), so no specification was asked about: ${[...findings.moduleFaults.map(describeModule), ...refused].join(' | ')}`);\n }\n const success = findings.loadError === null && findings.faults.length === 0 && findings.moduleFaults.length === 0 && chapterFileFaults.length === 0;\n return {\n kind: VerificationKind.SPECIFICATION_EXPORTS,\n path: null,\n success,\n message: success\n ? 'every specification the package declares is admitted by its factory'\n : findings.loadError !== null\n ? [`the specifications package cannot be evaluated: ${findings.loadError}`, ...chapterFileFaults].join(' | ')\n : [...findings.moduleFaults.map(describeModule), ...refused, ...chapterFileFaults].join(' | '),\n ...(success ? {} : {\n failureFindings: [\n ...(findings.loadError === null ? [] : [`entry:${findings.loadError}`]),\n ...findings.moduleFaults.filter((fault) => fault.causedBy.length === 0).map((fault) => `module:${fault.modulePath}:${fault.message}`),\n ...findings.faults.map((fault) => `refused:${fault.kind}:${fault.key}:${fault.message}`),\n ...chapterFileFaults.map((fault) => `chapter-file:${fault}`),\n ],\n }),\n stdoutTail: '',\n stderrTail: '',\n };\n }\n\n /**\n * `wildo config check-resources` at the application root (#2404): the resources registry built offline, as the\n * backend's startup builds it. A refusal fails the check with the factory's own message, which names the resource.\n *\n * \"Could not ask\" — a compiled model older than its sources (the common case seconds after an agent wrote them), an\n * absent backend dist, a runner that crashed, an absent CLI — THROWS, so it is reported unrun, never as a\n * configuration the backend refuses. The CLI marks it with {@link RESOURCES_REGISTRY_COULD_NOT_ASK_MARKER}.\n */\n private async runResourcesRegistryInitVerification(): Promise<VerificationOutcome> {\n const outcome = await this.runVerification({\n kind: VerificationKind.RESOURCES_REGISTRY_INIT,\n path: null,\n command: 'wildo',\n args: ['config', 'check-resources'],\n cwd: this.companionContext.saasRoot,\n });\n refuseWhenVerificationToolIsAbsent(outcome, { command: 'wildo', checking: 'check the resources registry' });\n /*\n * A `wildo` older than this companion does not know the verb and answers \"Unknown command\" (#2404 review F9): an\n * absent tool, like ENOENT, never a configuration the backend refuses.\n */\n if (!outcome.success && /Unknown command/iu.test(`${outcome.message}\\n${outcome.stdoutTail}\\n${outcome.stderrTail}`)) {\n // A host cause that will not clear on its own (#3432): it holds admissions until the command answers the verb.\n throw new VerificationToolUnavailableError(\n 'wildo',\n `Cannot check the resources registry: the installed \\`wildo\\` CLI does not know \\`config check-resources\\` (update it). ${outcome.stderrTail.trim() || outcome.stdoutTail.trim()}`,\n { verbProbeArgs: ['config', 'check-resources', '--help'] },\n );\n }\n if (!outcome.success && `${outcome.stdoutTail}\\n${outcome.stderrTail}`.includes(RESOURCES_REGISTRY_COULD_NOT_ASK_MARKER)) {\n throw new Error(`${outcome.stderrTail.trim() || outcome.stdoutTail.trim()} This is NOT a refused configuration.`);\n }\n return outcome;\n }\n\n /**\n * `wildo config validate` at the application root (#2228): the checks the backend runs at startup, asked without\n * starting it. Errors fail the check (the backend would refuse to boot); warnings do not.\n *\n * The CLI is a global install and is not linked into an application's `node_modules/.bin`, so a missing binary is\n * thrown as \"we could not ask\" — exactly as the schema-plan drift check does — never reported as a configuration\n * that fails.\n */\n private async runConfigValidateVerification(): Promise<VerificationOutcome> {\n const outcome = await this.runVerification({\n kind: VerificationKind.CONFIG_VALIDATE,\n path: null,\n command: 'wildo',\n args: ['config', 'validate'],\n cwd: this.companionContext.saasRoot,\n });\n // ENOENT only: a configuration error can itself say \"not found\" (a referenced file, a provider), and that is a\n // failing configuration, not an absent tool.\n refuseWhenVerificationToolIsAbsent(outcome, { command: 'wildo', checking: 'validate the application configuration' });\n return outcome;\n }\n\n /**\n * `wildo design-tokens contrast <frontend>` at the application root (#2351): every colour pair the framework draws,\n * measured on the palette the design-system config paints under its theme. Its output — one finding per failing\n * pair, naming both colours, the ratio and the bar — is the outcome's tail, which reaches the coding agent verbatim.\n *\n * A missing CLI is thrown as \"we could not ask\", exactly as `config validate` does, never reported as a palette\n * that fails.\n */\n private async runDesignSystemContrastVerification(frontendPath: string): Promise<VerificationOutcome> {\n const outcome = await this.runVerification({\n kind: VerificationKind.DESIGN_SYSTEM_CONTRAST,\n path: frontendPath,\n command: 'wildo',\n args: ['design-tokens', 'contrast', frontendPath],\n cwd: this.companionContext.saasRoot,\n });\n refuseWhenVerificationToolIsAbsent(outcome, { command: 'wildo', checking: 'measure the palette\\'s contrast' });\n return outcome;\n }\n\n /**\n * `wildo design-tokens contract <frontend>` at the application root (#2359): the theme the design-system config\n * declares, checked against the theme contract after the exceptions it carries. Its output — one finding per broken\n * rule, naming the recipe — is the outcome's tail, which reaches the coding agent verbatim. A missing CLI is thrown\n * as \"we could not ask\", as for the contrast check.\n */\n private async runDesignSystemContractVerification(frontendPath: string): Promise<VerificationOutcome> {\n const outcome = await this.runVerification({\n kind: VerificationKind.DESIGN_SYSTEM_CONTRACT,\n path: frontendPath,\n command: 'wildo',\n args: ['design-tokens', 'contract', frontendPath],\n cwd: this.companionContext.saasRoot,\n });\n refuseWhenVerificationToolIsAbsent(outcome, { command: 'wildo', checking: 'check the theme contract' });\n return outcome;\n }\n\n /**\n * `wildo design-tokens brand <frontend>` at the application root (#2818): when the build generated `brand-design.ts`\n * beside the design-system config, the config's theme must be the one composed from the brand's point and its palette\n * the brand's. Its output — one finding per departure, naming the composition expected — is the outcome's tail, which\n * reaches the coding agent verbatim. An application with no `brand-design.ts` passes. A missing CLI, or a generated\n * `brand-design.ts` the CLI cannot load (which the agent cannot repair), is thrown as \"we could not ask\".\n *\n * The CLI also advises, without failing, on each axis the website's theme sets away from the brand. Those lines are\n * lifted onto `advisories` and into a passing message, because a passing check's output is read by nobody.\n */\n private async runDesignSystemBrandVerification(frontendPath: string): Promise<VerificationOutcome> {\n const outcome = await this.runVerification({\n kind: VerificationKind.DESIGN_SYSTEM_BRAND,\n path: frontendPath,\n command: 'wildo',\n args: ['design-tokens', 'brand', frontendPath],\n cwd: this.companionContext.saasRoot,\n });\n refuseWhenVerificationToolIsAbsent(outcome, { command: 'wildo', checking: 'check the brand composition' });\n const lines = `${outcome.stdoutTail}\\n${outcome.stderrTail}`.split('\\n');\n const couldNotAsk = lines.find((line) => line.includes(DESIGN_SYSTEM_BRAND_COULD_NOT_ASK_MARKER));\n if (!outcome.success && couldNotAsk !== undefined) {\n throw new Error(`Cannot check the brand composition: ${couldNotAsk.slice(couldNotAsk.indexOf(DESIGN_SYSTEM_BRAND_COULD_NOT_ASK_MARKER)).trim()}`);\n }\n const advisories = lines\n .filter((line) => line.includes(DESIGN_SYSTEM_BRAND_ADVISORY_MARKER))\n .map((line) => line.slice(line.indexOf(DESIGN_SYSTEM_BRAND_ADVISORY_MARKER)).trim());\n if (advisories.length === 0) return outcome;\n return { ...outcome, advisories, ...(outcome.success ? { message: `${outcome.message} — ${advisories.join(' ')}` } : {}) };\n }\n\n /**\n * Ask the RUNNING backend whether it is ready (#2228), at the address the frontend uses (`VITE_API_BASE_URL` in\n * `frontend/.env`, written by config sync). Bounded by {@link BACKEND_READY_TIMEOUT_MS}: an outbound request with no\n * deadline waits for a peer that never answers.\n *\n * No address, or no answer, THROWS — \"we could not ask\", reported apart from a failing check: from here a backend\n * that was never started and one crash-looping at boot are the same closed port, and neither may read as a pass.\n */\n private async runBackendReadyVerification(): Promise<VerificationOutcome> {\n const envPath = join(this.companionContext.saasRoot, 'frontend', '.env');\n const apiBase = existsSync(envPath) ? /^VITE_API_BASE_URL=(.*)$/mu.exec(readFileSync(envPath, 'utf8'))?.[1]?.trim() : undefined;\n if (apiBase === undefined || apiBase === '') {\n throw new Error(`Cannot ask whether the backend is ready: ${envPath} declares no VITE_API_BASE_URL. Run \\`wildo config sync\\`.`);\n }\n const url = `${apiBase.replace(/\\/+$/u, '')}/health/ready`;\n let response: Response;\n try {\n response = await fetch(url, { signal: AbortSignal.timeout(BACKEND_READY_TIMEOUT_MS) });\n } catch (error) {\n throw new Error(`Cannot ask whether the backend is ready: ${url} did not answer (${describeCaughtError(error)}). It is not running, or it is crash-looping at boot; its log says which.`);\n }\n const body = (await response.text().catch(() => '')).slice(-OUTPUT_TAIL_CHARS);\n return {\n kind: VerificationKind.BACKEND_READY,\n path: null,\n success: response.status === 200,\n message: response.status === 200 ? `${url} answered 200` : `${url} answered ${response.status}: the backend is up and refuses readiness`,\n stdoutTail: body,\n stderrTail: '',\n };\n }\n\n /**\n * `wildo local smoke --json` (#2228): the CLI drives a browser through the running application and prints one JSON\n * verdict. PASSED passes, FAILED fails with the CLI's summary and the broken pages; COULD_NOT_ASK, a verdict that\n * cannot be read, or a CLI that cannot be executed THROWS — \"we could not ask\", reported apart from a failing check,\n * because the application was never seen.\n */\n private async runBrowserSmokeVerification(): Promise<VerificationOutcome> {\n const outcome = await this.runVerification({\n kind: VerificationKind.BROWSER_SMOKE,\n path: null,\n command: 'wildo',\n args: ['local', 'smoke', '--json'],\n cwd: this.companionContext.saasRoot,\n });\n refuseWhenVerificationToolIsAbsent(outcome, { command: 'wildo', checking: 'run the browser smoke' });\n const lastLine = outcome.stdoutTail.trim().split('\\n').pop() ?? '';\n let verdict: { outcome?: string; summary?: string };\n try {\n verdict = JSON.parse(lastLine) as { outcome?: string; summary?: string };\n } catch {\n throw new Error(`Cannot read the browser smoke's verdict: \\`wildo local smoke --json\\` printed no JSON (${outcome.message}).`);\n }\n if (verdict.outcome === 'COULD_NOT_ASK' || (verdict.outcome !== 'PASSED' && verdict.outcome !== 'FAILED')) {\n throw new Error(`The browser smoke could not ask: ${verdict.summary ?? 'no summary'}`);\n }\n return { ...outcome, success: verdict.outcome === 'PASSED', message: `browser smoke ${verdict.outcome}: ${verdict.summary ?? ''}` };\n }\n\n /**\n * Run a resolved verification plan set and return one outcome per check.\n *\n * Extracted from the coding-task dispatch so the SAME executor serves a second caller: the\n * `DETERMINISTIC_CLI` playbook tier, which verifies an already-built application and dispatches no\n * agent (issue #147). The alternative was a second loop that re-derived which kinds branch away\n * from the argv path — and the two would drift the first time a `VerificationKind` was added,\n * silently, because a missed kind falls through to a typecheck that passes.\n *\n * A thrown error is an INFRASTRUCTURE failure, not a failing check: the subprocess could not be\n * run at all. It is recorded as a failed outcome so the caller sees which check was affected, and\n * surfaced separately so a caller can tell \"the application is broken\" from \"we could not ask\".\n */\n private async executeVerificationPlans(\n plans: readonly ApplicationCodingTaskVerificationPlan[],\n ): Promise<{\n verification: Array<{ checkRef: string; outcome: VerificationOutcome }>;\n infrastructureError: unknown;\n /**\n * Which checks did not RUN — they threw before producing a verdict.\n *\n * Reported apart from `verification` because the two answer different questions and one of them\n * must never be read as the other. A thrown check is recorded with `success: false` so a caller\n * that only looks at outcomes still fails closed, and that is right for the post-run pass. It is\n * wrong for a BASELINE pass, where `success: false` would read as \"already broken\" and forgive a\n * real regression the run introduced — `runSchemaPlanDriftVerification` throws by design when\n * `backend-api/dist` is absent, and a missing migration crash-loops the backend, so that is\n * precisely the check a baseline must not silently excuse.\n */\n unrunCheckRefs: readonly string[];\n /**\n * The unrun checks whose command could not be executed at all (#3423): a subset of `unrunCheckRefs`, with the\n * command and the check's message. The settlement holds coding admissions on it; nothing else reads it.\n */\n unavailableVerificationTools: readonly UnavailableVerificationTool[];\n }> {\n const verification: Array<{ checkRef: string; outcome: VerificationOutcome }> = [];\n const unrunCheckRefs: string[] = [];\n const unavailableVerificationTools: UnavailableVerificationTool[] = [];\n let infrastructureError: unknown = null;\n for (const plan of plans) {\n try {\n verification.push({\n checkRef: plan.checkRef,\n // The FK-resolution check is not a CLI command: it runs in the companion's\n // introspection subprocess (fresh working-tree import), so it branches before\n // the argv-plan path.\n outcome: plan.kind === VerificationKind.FRONTEND_FK_RESOLUTION\n ? await this.runForeignKeyResolutionVerification()\n : plan.kind === VerificationKind.SETTINGS_PLACEMENT_CONTENT\n ? await this.runSettingsPlacementContentVerification()\n : plan.kind === VerificationKind.SCHEMA_PLAN_DRIFT\n ? await this.runSchemaPlanDriftVerification()\n : plan.kind === VerificationKind.RESOURCES_REGISTRY_INIT\n ? await this.runResourcesRegistryInitVerification()\n : plan.kind === VerificationKind.SPECIFICATION_EXPORTS\n ? await this.runSpecificationExportsVerification()\n : plan.kind === VerificationKind.CONFIG_VALIDATE\n ? await this.runConfigValidateVerification()\n : plan.kind === VerificationKind.DESIGN_SYSTEM_CONTRAST\n ? await this.runDesignSystemContrastVerification(plan.path ?? 'frontend')\n : plan.kind === VerificationKind.DESIGN_SYSTEM_CONTRACT\n ? await this.runDesignSystemContractVerification(plan.path ?? 'frontend')\n : plan.kind === VerificationKind.DESIGN_SYSTEM_BRAND\n ? await this.runDesignSystemBrandVerification(plan.path ?? 'frontend')\n : plan.kind === VerificationKind.BACKEND_READY\n ? await this.runBackendReadyVerification()\n : plan.kind === VerificationKind.BROWSER_SMOKE\n ? await this.runBrowserSmokeVerification()\n : plan.kind === VerificationKind.WEBSITE_DEMO_FACTS\n ? await this.runWebsiteDemoFactsVerification(plan.path ?? 'website')\n : this.absentWorkspacePackageOutcome(plan)\n ?? await this.runArgvVerification(plan.kind, plan.path ?? undefined),\n });\n } catch (error) {\n infrastructureError ??= error;\n unrunCheckRefs.push(plan.checkRef);\n if (error instanceof VerificationToolUnavailableError) {\n unavailableVerificationTools.push({\n hostCause: error.hostCause,\n checkRef: plan.checkRef,\n command: error.command,\n message: error.message,\n ...(error.verbProbeArgs ? { verbProbeArgs: error.verbProbeArgs } : {}),\n });\n }\n // A check that threw out of a subprocess still carries what that subprocess printed; keep it, or\n // the record says only \"Bounded subprocess failed\" while the cause is in hand.\n const details = (error as { details?: { stdout?: string; stderr?: string } } | null | undefined)?.details;\n verification.push({\n checkRef: plan.checkRef,\n outcome: {\n kind: plan.kind,\n path: plan.path,\n success: false,\n message: describeCaughtError(error),\n stdoutTail: (details?.stdout ?? '').slice(-OUTPUT_TAIL_CHARS),\n stderrTail: (details?.stderr ?? '').slice(-OUTPUT_TAIL_CHARS),\n },\n });\n }\n }\n return { verification, infrastructureError, unrunCheckRefs, unavailableVerificationTools };\n }\n\n /**\n * Run named verification checks against the application, outside any agent dispatch.\n *\n * The public door for the `DETERMINISTIC_CLI` tier. Check refs resolve through the same closed\n * `APPLICATION_CODING_TASK_VERIFICATION_CATALOG` a coding task uses, so an unknown ref is refused\n * here rather than becoming an unrun check that reports success by absence.\n *\n * Deliberately takes NO worktree lock and captures NO change set: this reads the application, and\n * pretending otherwise would serialize verification against the single-flight coding lane for no\n * reason.\n */\n public async runApplicationVerificationChecks(\n checkRefs: readonly string[],\n ): Promise<{\n verification: Array<{ checkRef: string; outcome: VerificationOutcome }>;\n infrastructureError: unknown;\n /** The checks that threw before a verdict (#2222): recorded failed in `verification`, but never a claim about the application. */\n unrunCheckRefs: readonly string[];\n }> {\n return this.executeVerificationPlans(resolveApplicationCodingTaskVerificationPlans(checkRefs));\n }\n\n /**\n * The website's drawn demos, held to the application they draw (#2784). A website task owes it beside its typecheck,\n * because what it catches compiles: a status the resource does not have, a change drawn as an update on a field an\n * update cannot write. The scenarios are collected in a child process that imports the site fresh\n * ({@link collectWebsiteDemoScenarios}); the facts are the ones the section's brief carried\n * ({@link checkWebsiteDemoScenarios}), from a domain model checked against the source as it stands.\n *\n * Whose fault decides the answer. The SITE's (a scenario `defineWebsiteDemoScenario` refused, a module of the site\n * that throws or does not parse) fails the task, which can fix it. The HOST's (a package the site imports cannot be\n * resolved, the collecting process died, the domain model cannot be read) leaves the check unrun.\n */\n private async runWebsiteDemoFactsVerification(websitePath: string): Promise<VerificationOutcome> {\n const packageDirectory = this.sanitizeRelativePath(websitePath);\n const saasRoot = this.companionContext.saasRoot;\n const outcome = (success: boolean, message: string): VerificationOutcome => ({\n kind: VerificationKind.WEBSITE_DEMO_FACTS,\n path: websitePath,\n success,\n message,\n stdoutTail: '',\n stderrTail: '',\n });\n if (!existsSync(join(saasRoot, packageDirectory, 'package.json'))) return outcome(true, `no ${packageDirectory} package in this application — no demo to check`);\n const collection = await collectWebsiteDemoScenarios(join(saasRoot, packageDirectory, 'src'), this.companionContext.companionHome);\n if (!collection.collected) {\n if (collection.fault === WebsiteDemoScenarioCollectionFault.HOST) throw new Error(`The website's demos could not be collected: ${collection.message}`);\n return outcome(false, `the website's sections could not be imported, so its demos cannot be checked: ${collection.message.slice(0, 600)}`);\n }\n const reached = `reached from ${collection.entries.join(' and ')}`;\n if (collection.records.every((record) => record.scenario.resource === undefined)) {\n return outcome(true, `${collection.records.length} demo scenario(s) ${reached}, none bound to a resource — nothing to hold to the application`);\n }\n const backendServiceKey = Object.entries(this.companionContext.servicesByKey).find(([, service]) => !service.frontendType)?.[0];\n if (backendServiceKey === undefined) throw new Error('No backend service is declared, so the resources a website demo binds cannot be read.');\n const { index, freshness } = await readWorkspaceElements(this.introspectionService, backendServiceKey, { verifyAgainstSource: true });\n const describeSite = (definedAt: string | null) => (definedAt === null ? 'a demo scenario (its definition site is unknown)' : relative(saasRoot, definedAt));\n const result = checkWebsiteDemoScenarios(collection.records, index.resources, describeSite);\n const against = `against the domain model (${describeWorkspaceFreshness(freshness)})`;\n return result.problems.length === 0\n ? outcome(true, `${result.bound} bound demo scenario(s) of ${result.defined} ${reached} show only what their resources allow, ${against}`)\n : outcome(false, `${result.problems.length} demo value(s) untrue of the application, ${against}: ${result.problems.join(' | ')}`);\n }\n\n /**\n * A typecheck of a workspace package the application does not have answers \"nothing to check\" (#1540).\n *\n * Required checks are derived from the paths a task may write, so a provider binding that may write\n * `website/src/provider-contributions.ts` owes the website typecheck, in every application, including\n * one with no website. Running `tsc` in a directory that is not a package would fail the task over a\n * package that does not exist. The honest answer is the one the settings sweep gives when no rail is\n * authored: checked, and nothing was there to check. That is stated in the outcome, never a silent pass.\n *\n * A package is its `package.json`. A directory holding one stray file, with no manifest, is not a\n * package that any typecheck could run in.\n */\n private absentWorkspacePackageOutcome(plan: ApplicationCodingTaskVerificationPlan): VerificationOutcome | undefined {\n // A site build is asked of every optional package at the end of a build (#2228), so the same honest answer applies.\n if ((plan.kind !== VerificationKind.TYPECHECK && plan.kind !== VerificationKind.PACKAGE_BUILD) || plan.path === null) return undefined;\n const packageDirectory = this.sanitizeRelativePath(plan.path);\n if (existsSync(join(this.companionContext.saasRoot, packageDirectory, 'package.json'))) return undefined;\n return {\n kind: plan.kind,\n path: plan.path,\n success: true,\n message: `no ${packageDirectory} package in this application — nothing to ${plan.kind === VerificationKind.PACKAGE_BUILD ? 'build' : 'typecheck'}`,\n stdoutTail: '',\n stderrTail: '',\n };\n }\n\n private async runVerification(plan: VerificationPlan): Promise<VerificationOutcome> {\n try {\n const result = await executeBoundedSubprocess({\n command: plan.command,\n args: plan.args,\n cwd: plan.cwd,\n env: buildVerificationEnv(),\n timeoutMs: VERIFICATION_TIMEOUT_MS,\n maxCapturedBytes: VERIFICATION_MAX_CAPTURED_BYTES,\n });\n return {\n kind: plan.kind,\n path: plan.path,\n success: true,\n message: `${plan.command} ${plan.args.join(' ')} passed`,\n stdoutTail: result.stdout.slice(-OUTPUT_TAIL_CHARS),\n stderrTail: result.stderr.slice(-OUTPUT_TAIL_CHARS),\n };\n } catch (error) {\n const details = (error as { details?: { stdout?: string; stderr?: string } }).details;\n return {\n kind: plan.kind,\n path: plan.path,\n success: false,\n message: describeCaughtError(error),\n stdoutTail: (details?.stdout ?? '').slice(-OUTPUT_TAIL_CHARS),\n stderrTail: (details?.stderr ?? '').slice(-OUTPUT_TAIL_CHARS),\n };\n }\n }\n\n /**\n * Run one admission-time validation and convert ANY refusal into a typed\n * VALIDATION error, preserving the original message as context.\n *\n * Deliberately a wrapper rather than N rewritten throw sites: the pure\n * resolver in the models layer has no error builder and should not grow one,\n * and a future admission check gets the same classification by being placed\n * here rather than by remembering to.\n */\n /**\n * `refusesTaskContract` marks the refusal as the task's OWN (#1581): set only by admission's two checks\n * of the task contract, so a dispatcher counts it as the task's attempt rather than the host's refusal.\n * The resume path's checks (an empty answer, a check the host no longer registers) are not the task\n * being dispatched and carry no mark.\n */\n private admitTypedInput<T>(validate: () => T, message: string, options: { readonly refusesTaskContract?: boolean } = {}): T {\n try {\n return validate();\n } catch (error) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.VALIDATION,\n context: {\n message,\n validationError: describeCaughtError(error),\n // The task's own contract was refused: a dispatcher counts this as its attempt (#1581).\n ...(options.refusesTaskContract === true ? { [APPLICATION_CODING_CONTRACT_REFUSAL_MARKER]: true } : {}),\n },\n });\n }\n }\n\n /**\n * Sanitize an app-root-relative path from the wire: rejects absolute\n * paths, `..` escapes, backslashes, NUL bytes, and flag-lookalikes\n * (leading `-` would be parsed as an argv flag by the fixed commands).\n */\n private sanitizeRelativePath(requestedPath: string): string {\n const candidate = requestedPath.trim();\n const reject = (reason: string): never => {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.VALIDATION,\n context: {\n message: `Invalid verification path: ${reason}`,\n requestedPath,\n },\n });\n };\n\n if (!candidate) reject('path is empty');\n if (candidate.includes('\\0')) reject('path contains a NUL byte');\n if (candidate.includes('\\\\')) reject('use forward slashes');\n if (isAbsolute(candidate)) reject('path must be relative to the application root');\n if (candidate.startsWith('-')) reject('path must not start with a dash');\n const normalized = normalize(candidate);\n if (normalized.split(sep).includes('..')) reject('path must not escape the application root');\n\n const absolute = join(this.companionContext.saasRoot, normalized);\n const relativeFromRoot = relative(this.companionContext.saasRoot, absolute);\n if (relativeFromRoot.startsWith('..') || isAbsolute(relativeFromRoot)) {\n reject('path resolves outside the application root');\n }\n return normalized;\n }\n\n /** Nearest ancestor dir (within the app root) holding a package.json. */\n private findNearestPackageDir(startDir: string): string {\n let current = startDir;\n const root = this.companionContext.saasRoot;\n while (current.startsWith(root)) {\n if (existsSync(join(current, 'package.json'))) {\n return current;\n }\n const parent = dirname(current);\n if (parent === current) break;\n current = parent;\n }\n return root;\n }\n\n // ================================================================\n // Error + traceability helpers (service-owned wrappers, P-13 pattern)\n // ================================================================\n\n private buildDispatchConflictError(message: string): unknown {\n return this.errorBuilder.buildError(ErrorType.CONFLICT, undefined, {\n customMessageReference: ErrorCustomMessageReference.CONFLICT,\n context: { message },\n });\n }\n\n /** Map proper-lockfile ELOCKED contention onto the 409 vocabulary. */\n private mapLockError(error: unknown): unknown {\n if ((error as { code?: string })?.code === 'ELOCKED') {\n return this.buildDispatchConflictError(\n 'The workspace-mutation lock is held by another process (companion run or CLI). '\n + 'Dispatch is single-flight across processes (P-20); retry after the active run completes. '\n + 'If you are a dispatched coding-agent run: dispatching from a dispatched run is forbidden (P-35).',\n );\n }\n return error;\n }\n\n private createOperationTraceStep(\n sessionContext: CompanionExecutionSessionContext | undefined,\n label: string,\n ) {\n return sessionContext\n ? this.traceabilityService.createStep(sessionContext, {\n kind: 'coding-agent-dispatch',\n label,\n })\n : undefined;\n }\n\n private async traceOperationStart(input: {\n sessionContext?: CompanionExecutionSessionContext;\n step?: ReturnType<CompanionTraceabilityService['createStep']>;\n type: string;\n summary: string;\n payload?: unknown;\n artifactFileName?: string;\n artifactContent?: unknown;\n }): Promise<void> {\n if (!input.sessionContext) return;\n\n await this.traceabilityService.traceEvent({\n session: input.sessionContext,\n minimumLevel: CompanionTraceabilityLevel.DEBUG,\n type: input.type,\n summary: input.summary,\n ...(input.payload !== undefined ? { payload: input.payload } : {}),\n ...(input.step ? { step: input.step } : {}),\n });\n if (input.artifactFileName && input.artifactContent !== undefined) {\n await this.traceabilityService.writeArtifact({\n session: input.sessionContext,\n minimumLevel: CompanionTraceabilityLevel.DEBUG_VERBOSE,\n fileName: input.artifactFileName,\n content: input.artifactContent,\n ...(input.step ? { step: input.step } : {}),\n });\n }\n }\n\n private async traceOperationSuccess(input: {\n sessionContext?: CompanionExecutionSessionContext;\n step?: ReturnType<CompanionTraceabilityService['createStep']>;\n type: string;\n summary: string;\n payload?: unknown;\n artifactFileName?: string;\n artifactContent?: unknown;\n }): Promise<void> {\n if (!input.sessionContext) return;\n\n if (input.artifactFileName && input.artifactContent !== undefined) {\n await this.traceabilityService.writeArtifact({\n session: input.sessionContext,\n minimumLevel: CompanionTraceabilityLevel.DEBUG_VERBOSE,\n fileName: input.artifactFileName,\n content: input.artifactContent,\n ...(input.step ? { step: input.step } : {}),\n });\n }\n await this.traceabilityService.traceEvent({\n session: input.sessionContext,\n minimumLevel: CompanionTraceabilityLevel.DEBUG,\n type: input.type,\n summary: input.summary,\n ...(input.payload !== undefined ? { payload: input.payload } : {}),\n ...(input.step ? { step: input.step } : {}),\n });\n }\n\n private async traceOperationFailure(input: {\n sessionContext?: CompanionExecutionSessionContext;\n step?: ReturnType<CompanionTraceabilityService['createStep']>;\n type: string;\n summary: string;\n error: unknown;\n payload?: unknown;\n }): Promise<void> {\n if (!input.sessionContext) return;\n\n await this.traceabilityService.traceEvent({\n session: input.sessionContext,\n minimumLevel: CompanionTraceabilityLevel.DEBUG,\n type: input.type,\n summary: input.summary,\n payload: {\n ...(input.payload && typeof input.payload === 'object'\n ? input.payload as Record<string, unknown>\n : { input: input.payload }),\n error: buildOutputErrorPayload(input.error),\n },\n ...(input.step ? { step: input.step } : {}),\n });\n }\n\n private async traceOperationArtifact(\n sessionContext: CompanionExecutionSessionContext | undefined,\n step: ReturnType<CompanionTraceabilityService['createStep']> | undefined,\n fileName: string,\n content: unknown,\n ): Promise<void> {\n if (!sessionContext) return;\n await this.traceabilityService.writeArtifact({\n session: sessionContext,\n minimumLevel: CompanionTraceabilityLevel.DEBUG_VERBOSE,\n fileName,\n content,\n ...(step ? { step } : {}),\n });\n }\n}\n\ninterface VerificationPlan {\n kind: VerificationKind;\n path: string | null;\n command: string;\n args: string[];\n cwd: string;\n}\n\n/**\n * Change-set artifact persisted on the task row (P-19: file list + stats\n * + head SHAs + attribution classes). `fullDiffText` is deliberately\n * stripped — the raw diff lives in the traceability artifact only.\n *\n * Persisted as `FlowsActors_IO_PartKind.STRUCTURED` with the capture in\n * `content.data`. History: on 2026-07-03 this was temporarily JSON-encoded\n * into a TEXT artifact because the zod-to-mongoose converter flattened\n * nested discriminated unions (`artifacts[]` on the task row) onto their\n * FIRST variant, making `content.text` a required Mongoose path for every\n * artifact. The converter now merges nested union variants into an\n * all-optional superset schema, so the natural STRUCTURED shape persists\n * again (requires a saas-backend-lib dist carrying that fix).\n */\nfunction buildChangeSetArtifact(taskId: string, changeSet: GitChangeSetCapture): ArtifactInstance {\n const { fullDiffText: _fullDiffText, ...structuredCapture } = changeSet;\n return {\n ref: `coding-agent-change-set-${taskId}`,\n type: FlowsActors_IO_PartKind.STRUCTURED,\n name: 'coding-agent-change-set',\n description: 'Read-only git change-set capture with per-file attribution (P-19)',\n origin: { taskId },\n content: { data: structuredCapture },\n createdAt: new Date().toISOString(),\n };\n}\n\n/** Same minimal allowlist the CLI spawn uses (P-18). */\nfunction buildVerificationEnv(): NodeJS.ProcessEnv {\n // Same minimal identity allowlist the CLI spawn uses (P-18) — incl.\n // USER/LOGNAME so a verification hook that shells out to per-user\n // tooling behaves like the agent run. Kept in lockstep with\n // `ClaudeCliCompanionService`'s allowlist.\n const env: NodeJS.ProcessEnv = {};\n for (const key of ['PATH', 'HOME', 'USER', 'LOGNAME', 'SHELL', 'TERM']) {\n const value = process.env[key];\n if (value !== undefined) env[key] = value;\n }\n return env;\n}\n\nfunction buildOutputErrorPayload(error: unknown): unknown {\n if (isWildoBackendError(error)) return error;\n if (error instanceof Error) {\n return {\n message: error.message,\n name: error.name,\n ...(error.stack ? { stack: error.stack } : {}),\n };\n }\n return { message: String(error) };\n}\n\nfunction createDeferred<T>(): {\n promise: Promise<T>;\n resolve: (value: T) => void;\n reject: (error: unknown) => void;\n} {\n let settled = false;\n let resolveFn!: (value: T) => void;\n let rejectFn!: (error: unknown) => void;\n const promise = new Promise<T>((resolve, reject) => {\n resolveFn = resolve;\n rejectFn = reject;\n });\n return {\n promise,\n resolve: (value) => {\n if (settled) return;\n settled = true;\n resolveFn(value);\n },\n reject: (error) => {\n if (settled) return;\n settled = true;\n rejectFn(error);\n },\n };\n}\n\n/**\n * The run row's record of a brief built without a readable playbook catalog (#2846 review L1): the reading and the\n * reason the brief states, never more. Empty for every other brief.\n */\nfunction briefProvenanceUnavailableRunField(task: MetaWorkflow_ApplicationCodingTaskContract): Record<string, unknown> {\n const source = task.contextSelection.selectedSources.find((candidate) => candidate.sourceRef === BRIEF_PROVENANCE_UNAVAILABLE_SOURCE_REF);\n const content = source?.content as { reading?: unknown; reason?: unknown } | undefined;\n if (content === undefined || typeof content.reading !== 'string') return {};\n return { briefProvenanceUnavailable: { reading: content.reading, ...(typeof content.reason === 'string' ? { reason: content.reason } : {}) } };\n}\n"]}
|