@wildo-ai/dev-companion 1.1.14 → 1.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/.tsbuildinfo +1 -1
- package/dist/esm/claude-cli/models/coding-agent-dispatch.models.d.ts +68 -1
- package/dist/esm/claude-cli/models/coding-agent-dispatch.models.d.ts.map +1 -1
- package/dist/esm/claude-cli/models/coding-agent-dispatch.models.js +77 -5
- package/dist/esm/claude-cli/models/coding-agent-dispatch.models.js.map +1 -1
- package/dist/esm/claude-cli/models/concurrent-coding-runs.models.d.ts +46 -1
- package/dist/esm/claude-cli/models/concurrent-coding-runs.models.d.ts.map +1 -1
- package/dist/esm/claude-cli/models/concurrent-coding-runs.models.js +39 -2
- package/dist/esm/claude-cli/models/concurrent-coding-runs.models.js.map +1 -1
- package/dist/esm/claude-cli/models/shared-tree-reconciliation.models.d.ts +6 -0
- package/dist/esm/claude-cli/models/shared-tree-reconciliation.models.d.ts.map +1 -1
- package/dist/esm/claude-cli/models/shared-tree-reconciliation.models.js.map +1 -1
- package/dist/esm/claude-cli/models/verification-tool-availability.models.d.ts +19 -5
- package/dist/esm/claude-cli/models/verification-tool-availability.models.d.ts.map +1 -1
- package/dist/esm/claude-cli/models/verification-tool-availability.models.js +17 -5
- package/dist/esm/claude-cli/models/verification-tool-availability.models.js.map +1 -1
- package/dist/esm/claude-cli/services/accepted-change-commit.companion.service.d.ts +16 -1
- package/dist/esm/claude-cli/services/accepted-change-commit.companion.service.d.ts.map +1 -1
- package/dist/esm/claude-cli/services/accepted-change-commit.companion.service.js +44 -4
- package/dist/esm/claude-cli/services/accepted-change-commit.companion.service.js.map +1 -1
- package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.d.ts +79 -6
- 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 +291 -40
- package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.js.map +1 -1
- package/dist/esm/claude-cli/services/research-evidence-store.companion.d.ts +14 -0
- package/dist/esm/claude-cli/services/research-evidence-store.companion.d.ts.map +1 -1
- package/dist/esm/claude-cli/services/research-evidence-store.companion.js +35 -0
- package/dist/esm/claude-cli/services/research-evidence-store.companion.js.map +1 -1
- package/dist/esm/claude-cli/services/unrecorded-provider-directories.companion.d.ts +36 -0
- package/dist/esm/claude-cli/services/unrecorded-provider-directories.companion.d.ts.map +1 -0
- package/dist/esm/claude-cli/services/unrecorded-provider-directories.companion.js +134 -0
- package/dist/esm/claude-cli/services/unrecorded-provider-directories.companion.js.map +1 -0
- package/dist/esm/core/introspection/services/translation-placement.companion.service.d.ts +3 -2
- package/dist/esm/core/introspection/services/translation-placement.companion.service.d.ts.map +1 -1
- package/dist/esm/core/introspection/services/translation-placement.companion.service.js.map +1 -1
- package/dist/esm/core/introspection/subprocess/companion-introspection-behavior-handlers.d.ts.map +1 -1
- package/dist/esm/core/introspection/subprocess/companion-introspection-behavior-handlers.js +24 -14
- package/dist/esm/core/introspection/subprocess/companion-introspection-behavior-handlers.js.map +1 -1
- package/dist/esm/core/introspection/workspace-element-index.companion.d.ts +42 -0
- package/dist/esm/core/introspection/workspace-element-index.companion.d.ts.map +1 -1
- package/dist/esm/core/introspection/workspace-element-index.companion.js +42 -0
- package/dist/esm/core/introspection/workspace-element-index.companion.js.map +1 -1
- package/dist/esm/core/runtime/dev-compile-quiet.companion.d.ts +53 -0
- package/dist/esm/core/runtime/dev-compile-quiet.companion.d.ts.map +1 -1
- package/dist/esm/core/runtime/dev-compile-quiet.companion.js +119 -2
- package/dist/esm/core/runtime/dev-compile-quiet.companion.js.map +1 -1
- package/dist/esm/core/runtime/services/start-companion-application.service.d.ts.map +1 -1
- package/dist/esm/core/runtime/services/start-companion-application.service.js +13 -1
- package/dist/esm/core/runtime/services/start-companion-application.service.js.map +1 -1
- package/dist/esm/core/runtime/utils/companion-platform-config.companion.d.ts +2 -2
- package/dist/esm/core/runtime/utils/companion-platform-config.companion.d.ts.map +1 -1
- package/dist/esm/core/runtime/utils/companion-platform-config.companion.js +6 -6
- package/dist/esm/core/runtime/utils/companion-platform-config.companion.js.map +1 -1
- package/dist/esm/email/services/email-template.companion.service.d.ts +5 -0
- package/dist/esm/email/services/email-template.companion.service.d.ts.map +1 -1
- package/dist/esm/email/services/email-template.companion.service.js +44 -11
- package/dist/esm/email/services/email-template.companion.service.js.map +1 -1
- package/dist/esm/email/utils/email-template-fs-discovery.utils.d.ts +26 -2
- package/dist/esm/email/utils/email-template-fs-discovery.utils.d.ts.map +1 -1
- package/dist/esm/email/utils/email-template-fs-discovery.utils.js +41 -2
- package/dist/esm/email/utils/email-template-fs-discovery.utils.js.map +1 -1
- package/dist/esm/email/utils/email-template-scanner-calls.companion.utils.d.ts +19 -0
- package/dist/esm/email/utils/email-template-scanner-calls.companion.utils.d.ts.map +1 -0
- package/dist/esm/email/utils/email-template-scanner-calls.companion.utils.js +171 -0
- package/dist/esm/email/utils/email-template-scanner-calls.companion.utils.js.map +1 -0
- package/dist/esm/email/utils/module-email-root.companion.utils.d.ts +75 -0
- package/dist/esm/email/utils/module-email-root.companion.utils.d.ts.map +1 -0
- package/dist/esm/email/utils/module-email-root.companion.utils.js +162 -0
- package/dist/esm/email/utils/module-email-root.companion.utils.js.map +1 -0
- package/dist/esm/i18n/components/LOW_LEVEL_AI_AGENT_CONFIG.en.d.ts +1 -0
- package/dist/esm/i18n/components/LOW_LEVEL_AI_AGENT_CONFIG.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_AI_AGENT_CONFIG.en.js +1 -0
- package/dist/esm/i18n/components/LOW_LEVEL_AI_AGENT_CONFIG.en.js.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_AI_AGENT_CONFIG.fr.d.ts +1 -0
- package/dist/esm/i18n/components/LOW_LEVEL_AI_AGENT_CONFIG.fr.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_AI_AGENT_CONFIG.fr.js +1 -0
- package/dist/esm/i18n/components/LOW_LEVEL_AI_AGENT_CONFIG.fr.js.map +1 -1
- package/dist/esm/i18n/resources/workbenchAspects.en.d.ts.map +1 -1
- package/dist/esm/i18n/resources/workbenchAspects.en.js +4 -0
- package/dist/esm/i18n/resources/workbenchAspects.en.js.map +1 -1
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.en.d.ts +35 -0
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.en.d.ts.map +1 -1
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.en.js +12 -0
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.en.js.map +1 -1
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.fr.d.ts +536 -531
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.fr.d.ts.map +1 -1
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.fr.js +536 -531
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.fr.js.map +1 -1
- package/dist/esm/i18n/system_enums/workbench-build.en.d.ts +2 -2
- package/dist/esm/i18n/system_enums/workbench-build.en.js +2 -2
- package/dist/esm/i18n/system_enums/workbench-build.en.js.map +1 -1
- package/dist/esm/i18n-labelling/services/email-template-labelling-units.companion.service.d.ts.map +1 -1
- package/dist/esm/i18n-labelling/services/email-template-labelling-units.companion.service.js +7 -3
- package/dist/esm/i18n-labelling/services/email-template-labelling-units.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/models/creation-journey-timeline.models.d.ts +9 -0
- package/dist/esm/meta-workflows/models/creation-journey-timeline.models.d.ts.map +1 -1
- package/dist/esm/meta-workflows/models/creation-journey-timeline.models.js +18 -2
- package/dist/esm/meta-workflows/models/creation-journey-timeline.models.js.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.d.ts +33 -6
- 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 +97 -19
- 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 +21 -8
- 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 +65 -12
- package/dist/esm/meta-workflows/services/application-build-follow-up-derivation.companion.js.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-task-coding-policy.companion.service.d.ts +1 -1
- 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 +48 -26
- package/dist/esm/meta-workflows/services/application-build-task-coding-policy.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/services/build-task-brief-application-facts.companion.d.ts +12 -0
- package/dist/esm/meta-workflows/services/build-task-brief-application-facts.companion.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/build-task-brief-application-facts.companion.js +30 -1
- package/dist/esm/meta-workflows/services/build-task-brief-application-facts.companion.js.map +1 -1
- 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 +12 -1
- 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 +7 -0
- 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 +81 -4
- package/dist/esm/meta-workflows/services/playbook-run.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/services/provider-registry-brief.companion.utils.d.ts +55 -1
- package/dist/esm/meta-workflows/services/provider-registry-brief.companion.utils.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/provider-registry-brief.companion.utils.js +157 -10
- package/dist/esm/meta-workflows/services/provider-registry-brief.companion.utils.js.map +1 -1
- package/dist/esm/module-layout/module-layout-convention.companion.d.ts +158 -0
- package/dist/esm/module-layout/module-layout-convention.companion.d.ts.map +1 -0
- package/dist/esm/module-layout/module-layout-convention.companion.js +272 -0
- package/dist/esm/module-layout/module-layout-convention.companion.js.map +1 -0
- package/dist/esm/module-layout/module-layout-inspection.companion.d.ts +42 -0
- package/dist/esm/module-layout/module-layout-inspection.companion.d.ts.map +1 -0
- package/dist/esm/module-layout/module-layout-inspection.companion.js +290 -0
- package/dist/esm/module-layout/module-layout-inspection.companion.js.map +1 -0
- package/dist/esm/module-layout/module-source-files.companion.d.ts +3 -0
- package/dist/esm/module-layout/module-source-files.companion.d.ts.map +1 -0
- package/dist/esm/module-layout/module-source-files.companion.js +45 -0
- package/dist/esm/module-layout/module-source-files.companion.js.map +1 -0
- package/package.json +17 -17
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accepted-change-commit.companion.service.js","sourceRoot":"","sources":["../../../../src/claude-cli/services/accepted-change-commit.companion.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAClF,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAG/C,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACrF,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,EAAE,kBAAkB,EAAE,4BAA4B,EAAE,MAAM,wCAAwC,CAAC;AAC1G,OAAO,EACL,YAAY,EACZ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PpI,oCAAoC,CAi4ChD","sourcesContent":["import { execFile } from 'node:child_process';\nimport { mkdtemp, readFile, rm, stat, unlink, writeFile } from 'node:fs/promises';\nimport { tmpdir } from 'node:os';\nimport * as path from 'node:path';\nimport { promisify } from 'node:util';\nimport { inject, injectable } from 'inversify';\n\nimport type { LoggerService } from '@wildo-ai/saas-backend-lib';\nimport { SAAS_SERVICE_TYPES, describeCaughtError } from '@wildo-ai/saas-backend-lib';\nimport { assertHeldFileLocksIntact } from '@wildo-ai/platform-config-lib';\nimport { CandidateDropScope, getFamilyPackageRelativePath } from '@wildo-ai/application-creation-runtime';\nimport {\n AcceptOrigin,\n AcceptedChangeTrailerKey,\n ApplicationSpecificationFamily,\n COMPANION_COMMIT_AUTHOR,\n LANE_COMMIT_TRAILER_KEYS,\n isAutomaticAcceptOrigin,\n} from '@wildo-ai/saas-specifications/application-creation';\n\nimport { COMPANION_SERVICE_TYPES } from '../../core/inject/models/service-types';\nimport type { CompanionContext } from '../../core/context/companion-context';\nimport { gitReadBroker, isBrokerableGitInvocation } from '../../core/utils/git-read-broker.companion';\nimport { holdsWrittenBytes, isBinaryWrittenFile, PlaybookRunFileSuccession, PlaybookRunWriteRegisterCompanionService, researchScreeningCommitLines } from '../../meta-workflows/services/playbook-run-write-register.companion.service';\nimport { ChangeSetAttributionClass, ChangeSetFileChangeKind, isAttributedToAnotherWriter } from '../models/coding-agent-dispatch.models';\nimport { RESEARCH_EVIDENCE_RELATIVE_ROOT } from './research-evidence-store.companion';\nimport { CodingRunWriteRegisterCompanionService, sha256Hex, type CodingRunWriteRecord } from './coding-run-write-register.companion.service';\nimport { listInFlightCodingRuns } from './in-flight-coding-runs.companion';\nimport { FlowsActors_Status } from '@wildo-ai/saas-models';\nimport { CompanionExecutionsListQuerySchema } from '../../companion-api/companion-api.schemas';\nimport { APPLICATION_CODING_SYSTEM_REF } from '../../meta-workflows/models/application-coding-agent.actors-system.definitions';\nimport { APPLICATION_BUILD_SYSTEM_REF } from '../../meta-workflows/models/application-build.actors-system.definitions';\nimport type { CompanionExecutionsCompanionService } from '../../executions/services/companion-executions.companion.service';\nimport { serializeDossierWrite } from '../../meta-workflows/services/dossier-write-queue.companion.utils';\nimport { closeCommitOverRelativeImports, type UnresolvedCommitImport } from './accepted-change-import-closure.companion';\nimport { APPLICATION_CREATION_AUTONOMY_POSTURE } from '../../meta-workflows/models/playbook-run-checkpoint.models';\nimport { isBuildTaskDecisionsPath } from '../../meta-workflows/models/build-task-decisions-path.models';\n\nconst execFileAsync = promisify(execFile);\n\n/**\n * ACCEPTANCE as a commit, from the workbench (#1454, Step 7).\n *\n * # The one write door in the companion's git carve-out, and why it exists\n *\n * DD-8 (`.claude/context/dev-companion.md`) keeps git plumbing CLI-side; the companion's\n * `GitChangeSetCompanionService` is a documented READ-ONLY carve-out. This service is the second,\n * WRITE-shaped carve-out, and it is narrower than the first in every dimension that matters:\n *\n * - **Two WRITE subcommands, pathspec-bounded.** `git add -- <paths>` and `git commit -F <msg> -- <paths>`,\n * where `<paths>` is exactly what a run's write register names, taken literally. Never `add -A`, never\n * `commit -a`, never a path the register does not hold, with ONE named exception (#2332): the creator's\n * DOSSIER, carried when a committed file imports it, so a commit never leaves HEAD importing a module it\n * does not hold (see `ImportClosurePolicy`). The subcommand allow-list is a guard, not\n * documentation: `execGit` refuses anything else before spawning, as the read-only service's does; the\n * other subcommands on it only read.\n * - **On a person's word, or on the posture's.** The workbench `accept` operations (a person, per run);\n * the coding dispatch loop when a run concluded with a working\n * result AND `laneBoundaryTreatmentFor(APPLICATION_CREATION_AUTONOMY_POSTURE, APPROVE_RESULT)` says\n * notify-and-proceed — the YOLO posture `one-source-of-truth.md` D5 records: *\"the system commits,\n * the human is notified and can override.\"* Under GUIDED the loop does not call it and acceptance\n * stays the person's. Until #1534 only the first caller existed, so the decided posture was not the\n * one the lane ran under: an unattended run stopped after its first task, and the 2026-09-23 run\n * was carried by an operator's shell loop running `git add -A` between dispatches. Since #3204 the loop no\n * longer commits per run at all: it commits BUILD CHECKPOINTS (`commitBuildCheckpoint`), and this door is the\n * person's (the workbench, `wildo build accept`), under the reviewing posture.\n * - **This door never widens what is committed.** Without `force` every refusal below applies — a path it\n * cannot vouch for stays uncommitted, and the refusal is on the record.\n * The automatic origins `WAVE_RECONCILIATION` and `INTERRUPTED_RUN_RECOVERY` are the build checkpoint's (#3204): it\n * commits the tree as it stands, minus a person's decisions and an unaccepted playbook run's files (#3221), naming the\n * runs it carries, and judges no path by run.\n * - **It refuses what it cannot vouch for, by name.** A path that was already dirty at the run's\n * baseline may carry another session's hunks (`BASELINE_DIRTY_AMBIGUOUS`); a path whose bytes are\n * no longer what the run left was edited since; a path a parallel commit or another lane produced\n * is not this run's at all. The first two are refused unless `force`; the third always.\n *\n * Routing this through the CLI was considered and rejected for the reason DD-8's first carve-out\n * gives: the CLI calls the companion, never the reverse, and the browser workbench cannot reach a\n * CLI at all. The register that names the paths lives here, so the commit that accepts them does too.\n *\n * # What a commit here means\n *\n * The pathspec form (`git commit -- <paths>`) commits those paths from the WORKING TREE and leaves\n * every other staged entry exactly as its author left it — the same discipline a human session in\n * this repository follows when files carry foreign hunks. The message names the run, so\n * `git log -S` and a reader both find why the change exists.\n */\n\n/**\n * Every git subcommand this service may invoke. The WRITES (`add`, `commit`) are the only git writes in the\n * companion; the rest only read. `status` and `log` read too (#1805): which of a set of paths still differ\n * from HEAD, and which commit last changed them. Neither stages, commits or moves a ref, and `status` runs\n * with optional locks off, so it does not even refresh the index's stat cache. `ls-tree` (#2332) reads which\n * paths HEAD holds, for the import closure a commit must satisfy.\n */\n/*\n * `merge-file`, `cat-file`, `hash-object`, `read-tree`, `update-index`, `write-tree`, `commit-tree` and `update-ref` serve one\n * route only (#2418): a playbook run's share of a file a later run rewrote is MERGED onto HEAD and committed through a\n * temporary index, never the working file. `update-ref` always carries the expected old value, so it refuses a moved HEAD.\n */\nconst ACCEPT_GIT_SUBCOMMANDS: ReadonlySet<string> = new Set([\n 'add', 'commit', 'rev-parse', 'diff', 'status', 'log', 'ls-tree',\n 'merge-file', 'cat-file', 'hash-object', 'read-tree', 'update-index', 'write-tree', 'commit-tree', 'update-ref',\n]);\nconst GIT_TIMEOUT_MS = 60_000;\n/**\n * How many executions one question of the overlap test reads (the list's own ceiling). Reached, the test fails closed:\n * more than this many executions of one system overlapped ONE window (settled), or are open now, which no ordinary build\n * produces. Since #3266 the settled listing is bounded by the window itself, so later executions never count against it.\n */\nconst EXECUTION_SPAN_SCAN_LIMIT = 200;\n/**\n * Whether an execution in each status has a span that is still OPEN: it may write the tree now or later, and it has no\n * finish instant to bound it. TOTAL over the vocabulary, so a status added tomorrow is a compile error here until\n * someone decides whether it can write. A terminal row always carries `finishedAt` (every terminal write stamps it),\n * which is what lets the settled listing be bounded by finish time.\n */\nconst STATUS_SPAN_IS_OPEN: Readonly<Record<FlowsActors_Status, boolean>> = {\n [FlowsActors_Status.READY]: true,\n [FlowsActors_Status.PENDING]: true,\n [FlowsActors_Status.PROCESSING]: true,\n [FlowsActors_Status.AWAITING_APPROVAL]: true,\n [FlowsActors_Status.COMPLETED]: false,\n [FlowsActors_Status.FAILED]: false,\n [FlowsActors_Status.CANCELLED]: false,\n [FlowsActors_Status.ABORTED]: false,\n};\n/** The two systems whose executions write the application's tree: coding runs and generation steps. */\nconst TREE_WRITER_SYSTEM_REFS: readonly string[] = [APPLICATION_CODING_SYSTEM_REF, APPLICATION_BUILD_SYSTEM_REF];\n/**\n * The not-yet-settled executions that may have written the tree, asked by STATUS (re-review F1 of #3218): every open\n * status of both systems, derived from {@link STATUS_SPAN_IS_OPEN} rather than listed by hand.\n */\nconst OPEN_TREE_WRITER_QUERIES: ReadonlyArray<readonly [string, FlowsActors_Status]> = TREE_WRITER_SYSTEM_REFS.flatMap((systemRef) =>\n (Object.keys(STATUS_SPAN_IS_OPEN) as FlowsActors_Status[]).filter((status) => STATUS_SPAN_IS_OPEN[status]).map((status) => [systemRef, status] as const));\nconst GIT_MAX_BUFFER_BYTES = 64 * 1024 * 1024;\n\n/**\n * Who took a DECISION recorded in a specification file (#1609): the creator, or the agent acting in their\n * conversation. Under the automatic posture the companion AUTHORS every such commit, so this trailer is the\n * only place the difference survives.\n */\nexport enum DecisionRecordActor {\n CREATOR = 'creator',\n AGENT = 'agent',\n}\n\n/**\n * The author an accept origin commits under: the companion's own identity (`COMPANION_COMMIT_AUTHOR`, whose JSDoc\n * gives the reasons) for an origin the system makes, and `undefined` for a person's, so git's own configured identity is\n * the truthful author then. Derived from the engine's `isAutomaticAcceptOrigin`, so which origins are automatic is\n * decided in one place.\n * assurance-control: WILDO.SOFTWARE.AI_PRODUCED_CHANGE_CONTROL — an automatic acceptance is authored by the companion's own identity and a person's by theirs, so the history names who accepted each change.\n */\nfunction acceptOriginAuthor(origin: AcceptOrigin): string | undefined {\n return isAutomaticAcceptOrigin(origin) ? `${COMPANION_COMMIT_AUTHOR.name} <${COMPANION_COMMIT_AUTHOR.email}>` : undefined;\n}\n\n/** `git merge-file` exits with the number of conflicts, capped at 127; a negative value (an error) still throws. */\nconst MERGE_FILE_CONFLICT_EXIT_CODES: readonly number[] = Array.from({ length: 127 }, (_, index) => index + 1);\n\n/** `Name <email>` as git's two author variables, for `commit-tree`, which takes no `--author`. */\nfunction parseGitIdentity(identity: string | undefined): { readonly name: string; readonly email: string } | undefined {\n const match = identity === undefined ? null : /^(.*?)\\s*<([^>]+)>$/u.exec(identity);\n return match ? { name: match[1]!, email: match[2]! } : undefined;\n}\n\n/**\n * The trailers this service writes, and by which its own commits are recognised later. Every commit this\n * service makes goes through `commitPaths`, a pathspec commit of the files as they stand, and carries one of\n * these as its last paragraph: a coding run's accept or a joint commit, a playbook run's accept, a recorded\n * decision. So a commit carrying one took the whole working file, which is what lets the may-carry test end\n * a run's claim on a path (#1805 review 6 G1). Recognised by KEY, never by value (review 7 L1).\n */\nconst CODING_RUN_TRAILER = AcceptedChangeTrailerKey.CODING_RUN;\nconst PLAYBOOK_RUN_TRAILER = AcceptedChangeTrailerKey.PLAYBOOK_RUN;\nconst DECISION_PURPOSE_TRAILER = AcceptedChangeTrailerKey.PURPOSE;\n/** The dossier's own commit (#2332): the creator's recorded answers, committed on their own. */\nconst DOSSIER_TRAILER = AcceptedChangeTrailerKey.DOSSIER;\n/** A charter a person accepted by hand (#2419): `wildo creation persona accept`, outside any staffing run. */\nconst EXPERT_CHARTER_TRAILER = AcceptedChangeTrailerKey.EXPERT_CHARTER;\nconst LANE_COMMIT_TRAILERS: readonly string[] = LANE_COMMIT_TRAILER_KEYS;\n\n/**\n * The families that make up the creator's DOSSIER (#1454): their answers, and the governed-document facts\n * only a person may establish. Both are landed by a door that owns no commit (an answer, a depth, a\n * governance-fact landing), and both are wired into the specifications aggregate when they first land. So a\n * later commit of that aggregate imports them, and this is the set the import closure may carry (#2332).\n */\nconst DOSSIER_FAMILIES: readonly ApplicationSpecificationFamily[] = [\n ApplicationSpecificationFamily.CREATOR_INPUTS,\n ApplicationSpecificationFamily.DOCUMENT_FACTS_AUTHORED,\n];\n\n/**\n * What a commit door does with a committed file's relative import that the commit's tree would not resolve\n * (#2332), once the dossier modules a committed file imports have been carried (every door carries them: a\n * commit that holds the aggregate's import of the dossier must hold the dossier, whoever's commit it is).\n * Required at every call of `commitPaths`, so no door commits without having chosen.\n */\nenum ImportClosurePolicy {\n /**\n * Refuse by name. The playbook-run accept, the dossier's own commit and a recorded decision: each commits a\n * small, named set whose whole meaning is \"this is now accepted\", and a HEAD that does not compile accepts\n * nothing.\n */\n REFUSE_UNRESOLVED = 'refuse_unresolved',\n /**\n * Commit as asked and log the unresolved import. The coding-run doors only, and a deliberate narrowing of\n * \"no commit leaves an import unresolved\" recorded on #2332: a run sharing the tree with siblings leaves their\n * files for the wave reconciliation BY DESIGN (#1805), so a transiently unresolved import between two sibling\n * accepts is the expected case, and refusing would stop the build lane on it\n * (`application-creation-directive.md`). The wave's reconciliation commit closes it; the application's\n * TypeScript build stays the floor for code.\n */\n REPORT_UNRESOLVED = 'report_unresolved',\n}\n\n/** The separators the may-carry query's `--format` emits (`%x1e`, `%x1c`, `%x1d`): a commit's start, the end of its committer second, the end of its trailers. */\nconst COMMIT_MARK = '\\x1e';\nconst TIME_END = '\\x1c';\nconst TRAILERS_END = '\\x1d';\n\n/**\n * The trailers that say, in the history itself, HOW a change was accepted (#2845): its origin always, and for an\n * automatic origin the autonomy posture it ran under. Appended to the last paragraph, which every door's message ends\n * with its own trailer, so git reads them as trailers. Prose cannot carry this: the origin sentences below have changed\n * since the first automatic commits were written, so a reader matching them would misread history.\n */\nfunction withAcceptanceTrailers(message: string, origin: AcceptOrigin): string {\n return [\n message.replace(/\\n+$/u, ''),\n `${AcceptedChangeTrailerKey.ACCEPT_ORIGIN}: ${origin}`,\n ...(isAutomaticAcceptOrigin(origin) ? [`${AcceptedChangeTrailerKey.AUTONOMY_POSTURE}: ${APPLICATION_CREATION_AUTONOMY_POSTURE}`] : []),\n ].join('\\n');\n}\n\n/**\n * The message with a paragraph naming the carried dossier modules, placed just before the trailer paragraph\n * (always the last), so trailer parsing is unchanged (#2332).\n */\nfunction withCarriedParagraph(message: string, carried: readonly string[]): string {\n const paragraphs = message.split('\\n\\n');\n const trailers = paragraphs.pop() ?? '';\n return [\n ...paragraphs,\n ['Carried with it: the creator\\'s recorded answers (the dossier), which a committed file imports. No run wrote them; they are committed with the first change that reads them.', '', ...carried.map((filePath) => `- ${filePath}`)].join('\\n'),\n trailers,\n ].join('\\n\\n');\n}\n\nconst ACCEPT_ORIGIN_SENTENCE: Readonly<Record<AcceptOrigin, string>> = {\n [AcceptOrigin.OPERATOR]: 'Accepted from the Wildo workbench',\n [AcceptOrigin.AUTONOMY_POSTURE]: 'Accepted automatically under the application-creation autonomy posture (the system commits; the creator is notified and can revert)',\n [AcceptOrigin.WAVE_RECONCILIATION]: 'A build checkpoint under the autonomy posture: the working tree the build\\'s runs share is committed as it stands (the creator can revert)',\n [AcceptOrigin.INTERRUPTED_RUN_RECOVERY]: 'Recovered at companion start under the autonomy posture: work a restart interrupted is committed so its retry continues from it (the creator can revert)',\n};\n\n/**\n * What a build checkpoint a PERSON made says about its origin (#1885). Not `ACCEPT_ORIGIN_SENTENCE[OPERATOR]`, which\n * describes a per-run accept from the workbench: this commit is the whole shared tree, accepted through the CLI.\n */\nconst OPERATOR_CHECKPOINT_SENTENCE = 'A person accepted the build\\'s shared working tree (`wildo build checkpoint`)';\n\nexport enum AcceptRefusalReason {\n /** Already dirty when the run started: the file may carry another session's hunks beside the run's. */\n CARRIES_CHANGES_FROM_BEFORE_THE_RUN = 'carries_changes_from_before_the_run',\n /** The bytes are no longer what the run left. */\n EDITED_SINCE_THE_RUN = 'edited_since_the_run',\n /** A parallel commit, another companion lane, or a path outside the application: never this run's. */\n NOT_THIS_RUN = 'not_this_run',\n /**\n * The run shared the tree with others (#1528) and has no evidence of its own that it wrote this path:\n * it may be a sibling's. Left for that sibling's accept, or for the shared-tree reconciliation, which\n * commits what the runs left naming every run whose writes it may carry (#1805). Not refused when no other\n * writer may have written the path (#3215): see `unclaimedPathsNoOtherWriterMayHave`.\n */\n NOT_CLAIMED_BY_THE_RUN = 'not_claimed_by_the_run',\n /**\n * The run shared the tree with others and claims this path, but the path does not carry the product its\n * task DECLARES (#2209): a sibling overwrote it, or never left it there. Committing it under the task's\n * name would credit the task with whatever the file holds, which is other runs' work. Left for the next build\n * checkpoint, which commits the tree as it stands (#3204). No `force` passes it, because what it protects is the NAME on the commit,\n * not the bytes. Only refused when another writer MAY have written the path (#3218): a file no other run carries,\n * written while nothing else was live, holds only this run's work whatever its product probe says.\n */\n OWN_PRODUCT_ABSENT = 'own_product_absent',\n /**\n * A playbook run that has not been accepted recorded this path (#3221). It is that run's output, and the playbook\n * run's own accept (`wildo creation accept <runId>`) commits it under its name. A coding-run door never takes it,\n * or the playbook run's work is attributed to a build task and its own accept finds nothing. The refusal names\n * the run ({@link AcceptRefusal.playbookRun}).\n */\n OWNED_BY_PLAYBOOK_RUN = 'owned_by_playbook_run',\n /**\n * A file only a PERSON's door writes: the build-task decisions (`wildo build close` / `approve`, review of 8d6b95d29).\n * Every coding run is prohibited from writing it; if one did anyway, committing it under any run's name would make a\n * task read as closed, declined or approved by a person who never decided. No `force` passes it: the remedy is the\n * decision door, which commits it under the person's name. The reader would not honour it either.\n */\n PERSON_DECISION_RECORD = 'person_decision_record',\n}\n\n/** One path a door left uncommitted, and why. */\nexport interface AcceptRefusal {\n readonly path: string;\n readonly reason: AcceptRefusalReason;\n /** For {@link AcceptRefusalReason.OWNED_BY_PLAYBOOK_RUN}: the playbook run whose output the path is. */\n readonly playbookRun?: { readonly runId: string; readonly playbookRef: string };\n}\n\n/** A refusal as a commit message or an error names it: the path, the reason, and the playbook run that owns it when one does. */\nfunction describeRefusal(entry: AcceptRefusal, taskRef?: string): string {\n /*\n * A file already dirty when the run began has one door (#3267, the fifth review of #3220): a person who has read it.\n * No per-run accept takes it on an earlier run's record, since a fingerprint names bytes, not their writer; under a\n * committing posture the next build checkpoint commits it with the tree (#3204).\n */\n const door = entry.reason === AcceptRefusalReason.CARRIES_CHANGES_FROM_BEFORE_THE_RUN\n ? ` (it was already dirty when the run began: review it, then \\`wildo build accept ${taskRef ?? '<taskRef>'} --force\\` includes it, subject to the product and playbook-ownership checks every accept applies; a new run of the task meets it dirty too)`\n : entry.reason === AcceptRefusalReason.PERSON_DECISION_RECORD\n ? ' (only a person records build-task decisions, through `wildo build close` or `wildo build approve`; discard this write)'\n : '';\n return `${entry.path} — ${entry.reason}${door}${entry.playbookRun ? ` (playbook run ${entry.playbookRun.runId}, ${entry.playbookRun.playbookRef}: accept it with \\`wildo creation accept ${entry.playbookRun.runId}\\`)` : ''}`;\n}\n\n/** The not-yet-accepted playbook run that recorded each path, newest run first. See {@link AcceptRefusalReason.OWNED_BY_PLAYBOOK_RUN}. */\ntype PlaybookRunOwners = ReadonlyMap<string, { readonly runId: string; readonly playbookRef: string }>;\n\n/**\n * Move every accepted path an unaccepted playbook run recorded to the refusals (#3221). Applied by every door that\n * commits a coding run's writes, so a playbook run's output is never committed under a build task's name: it waits\n * for the playbook run's own accept, which merges its change onto HEAD (#2418).\n */\nfunction withholdPlaybookRunOutput(\n classified: { readonly accepted: readonly string[]; readonly refused: readonly AcceptRefusal[] },\n owners: PlaybookRunOwners,\n): { readonly accepted: readonly string[]; readonly refused: readonly AcceptRefusal[] } {\n const owned = classified.accepted.filter((filePath) => owners.has(filePath));\n if (owned.length === 0) return classified;\n return {\n accepted: classified.accepted.filter((filePath) => !owners.has(filePath)),\n refused: [...classified.refused, ...owned.map((filePath) => ({ path: filePath, reason: AcceptRefusalReason.OWNED_BY_PLAYBOOK_RUN, playbookRun: owners.get(filePath)! }))],\n };\n}\n\n/**\n * Whether an entry of a recorded run is that run's OWN work, on the evidence the run itself left, for a retry that\n * VOUCHES for what the run left (#3220 review H2, review of 93680738b finding A): never written elsewhere (a parallel\n * commit, another lane, outside the application); EVIDENCED as the run's (a concurrent run CLAIMED it, its agent\n * reported writing it; a single-flight run held the tree alone, so its capture is the evidence its own accept already\n * commits on, and it records no claims); and either clean at the run's baseline or in a tree only a generation step\n * writes. Never by elimination and never by a fingerprint alone.\n *\n * A file DIRTY at the run's baseline is never the run's own here, and never a retry's either: there is no LINEAGE.\n * Taking such a file because its dirt matched an earlier run's recorded output was tried (#3220 re-review F3) and\n * removed after the fifth review of it (0fc83f7f8): a fingerprint names bytes, not who wrote them, and every way of\n * proving ownership through a run of fingerprints left a case (another task's dirt edited by two runs of this task; a sibling's\n * file a run of this task only captured; a path two concurrent runs both claimed) where another writer's lines went in\n * under this task's name. The cost is accepted: a file two failed runs both touched and a retry then edits is refused\n * by the retry's own accept as `carries_changes_from_before_the_run`, and its door is a person's\n * `wildo build accept <task> --force` (#3267); under a committing posture the next build checkpoint commits it with the\n * tree (#3204).\n */\nfunction isRunsOwnEntry(record: CodingRunWriteRecord, entry: CodingRunWriteRecord['files'][number]): boolean {\n if (isAttributedToAnotherWriter(entry.attribution)) return false;\n if (record.concurrent === true && entry.claimedByRun !== true) return false;\n if (entry.inStepOwnedTree === true) return true;\n return !entry.dirtyAtBaseline && entry.attribution !== ChangeSetAttributionClass.BASELINE_DIRTY_AMBIGUOUS;\n}\n\n/**\n * The recorded runs of `record`'s task whose output the current bytes of `paths` may descend from, `record` included\n * (finding B): their baselines decide which checks were already red before those files' history began. Only a file\n * DIRTY at a run's baseline has a history before it, which for a vouched file means one in a tree only a generation\n * step writes, regenerated over an earlier generation. The walk follows, per path, EVERY earlier run of the task whose\n * entry for the path was that run's OWN ({@link isRunsOwnEntry}; a run that only captured another writer's file is\n * neither named in the commit nor stamped accepted for it) and whose recorded output the baseline matched (or, when\n * either fingerprint is unknown, every such run that recorded the path), with a visit set\n * per path (fifth review, finding 1: one set shared across paths stopped a second path's history at a run the first had\n * reached and dropped the runs before it, so a check a dropped run broke was forgiven). `other.at < from.at` bounds it.\n */\nfunction runsInTheHistoryOf(record: CodingRunWriteRecord, paths: readonly string[], records: readonly CodingRunWriteRecord[]): CodingRunWriteRecord[] {\n const found = new Map<string, CodingRunWriteRecord>([[record.taskId, record]]);\n for (const filePath of paths) {\n const visited = new Set<string>([record.taskId]);\n const pending: CodingRunWriteRecord[] = [record];\n while (pending.length > 0) {\n const from = pending.pop()!;\n const file = from.files.find((entry) => entry.path === filePath);\n if (!file?.dirtyAtBaseline) continue;\n for (const other of records) {\n if (other.taskRef !== from.taskRef || visited.has(other.taskId) || !(other.at < from.at)) continue;\n const entry = other.files.find((candidate) => candidate.path === filePath);\n if (!entry || !isRunsOwnEntry(other, entry)) continue;\n if (file.baselineFingerprint !== undefined && entry.postRunFingerprint !== undefined && entry.postRunFingerprint !== file.baselineFingerprint) continue;\n visited.add(other.taskId);\n found.set(other.taskId, other);\n pending.push(other);\n }\n }\n }\n return [...found.values()];\n}\n\n/**\n * A file a recorded coding run left in the tree, uncommitted and still exactly as that run left it, while no run of its\n * task is live (#3267). Under a reviewing posture nothing automatic is coming for it (under a committing one, the next\n * build checkpoint commits it with the tree, #3204). So it is REPORTED, on\n * `wildo build tasks`, the feed and Home, with the person's two doors: `wildo build accept <taskRef> --leftovers`\n * commits it under the runs that left it, and `discardCommand` puts HEAD back. It never stays silently uncommitted.\n */\nexport interface UncommittedRunLeftover {\n /** The build-plan task whose runs left the file. */\n readonly taskRef: string;\n /** App-root-relative path. */\n readonly path: string;\n /** Every recorded run of the task whose record holds the path exactly as it is now, newest first. */\n readonly runTaskIds: readonly string[];\n /** TRUE when HEAD holds no such path, so discarding the leftover removes the file. */\n readonly absentAtHead: boolean;\n /** The exact command a person runs from the application root to discard it instead of committing it. */\n readonly discardCommand: string;\n}\n\n/**\n * The command that discards one leftover, run from the application root. A path HEAD holds is restored from HEAD, in the\n * index and the working tree; a path HEAD does not hold is removed. Quoted for a POSIX shell.\n */\nexport function describeLeftoverDiscardCommand(applicationPath: string, absentAtHead: boolean): string {\n const quoted = `'${applicationPath.replaceAll('\\'', '\\'\\\\\\'\\'')}'`;\n return absentAtHead ? `rm -- ${quoted}` : `git restore --source=HEAD --staged --worktree -- ${quoted}`;\n}\n\n/**\n * Says which of a concurrent run's paths do NOT carry the product its build task declares (#2209), read\n * from the tree as the commit would leave it: the working text of the paths being committed, HEAD for\n * every other path. It is evaluated by the same predicate landing uses, so the accept and the landing\n * check cannot disagree about whether a commit holds the task's product.\n *\n * The build layer supplies it (`ApplicationBuildDispatchCompanionService` registers it at construction),\n * because the build plan and its landing probes live there and this service sits below that layer. The\n * dependency points the way the board listeners already point (`registerRunAcceptedListener`).\n */\nexport interface ConcurrentRunProductWitness {\n /** The subset of `candidatePaths` a probe of `taskRef` names and the prospective tree does not satisfy. Empty when the task declares nothing checkable there. */\n pathsLackingOwnProduct(taskRef: string, candidatePaths: readonly string[]): Promise<readonly string[]>;\n}\n\n/** What one door gathered about the OTHER writers of the tree (#3218, #3221); see `gatherOtherWriterEvidence`. */\ninterface OtherWriterEvidence {\n /** Every recorded coding run, newest first. */\n readonly records: readonly CodingRunWriteRecord[];\n /** The candidate paths an unaccepted playbook run still owns. */\n readonly playbookOwners: PlaybookRunOwners;\n /** TRUE when a writer that recorded nothing may have written beside the runs (see `gatherOtherWriterEvidence`): every path is contested. */\n readonly unrecordedWriterBeside: boolean;\n}\n\nexport interface AcceptedChangeCommitOutcome {\n readonly commitSha: string | undefined;\n readonly committedPaths: readonly string[];\n /**\n * Of {@link committedPaths}, the dossier modules carried because a committed file imports them (#2332). Never a\n * path a run wrote: the creator's recorded answers, committed with the first change that reads them.\n */\n readonly carriedPaths: readonly string[];\n readonly refusedPaths: readonly AcceptRefusal[];\n readonly message: string;\n /** TRUE when every acceptable path was already committed, so no new commit was made. */\n readonly alreadyCommitted: boolean;\n}\n\n/** What a build checkpoint committed ({@link AcceptedChangeCommitCompanionService.commitBuildCheckpoint}). */\nexport interface BuildCheckpointOutcome {\n readonly commitSha: string;\n readonly committedPaths: readonly string[];\n /** The runs the checkpoint names: every run settled since the previous checkpoint. */\n readonly namedTaskIds: readonly string[];\n /** Changed paths it left uncommitted: a person's decision record, or a file an unaccepted playbook run owns. */\n readonly excludedPaths: readonly string[];\n /** TRUE when the runs' writes were already committed, so no new commit was made. */\n readonly alreadyCommitted: boolean;\n}\n\n/** Nothing could be committed: no record, an empty run, or every path refused. Carries the refusals. */\nexport class NothingToAcceptError extends Error {\n public constructor(message: string, public readonly refusedPaths: readonly AcceptRefusal[] = []) {\n super(message);\n this.name = 'NothingToAcceptError';\n }\n}\n\n/**\n * A PERSON's acceptance refused because a coding worker is writing the same tree right now. 409: the\n * request is fine, the moment is not — accept again once the run settles.\n *\n * A commit inside a live run's window destroys its attribution (the run's baseline no longer matches\n * HEAD, so what it wrote can no longer be told apart from what the commit carried), and it can sweep in a\n * file the worker is halfway through. The console's commands said \"never commit while a dispatch runs\"\n * as prose only, which a model may skip and a person at the workbench never read.\n */\nexport class CodingRunWritingTheTreeError extends Error {\n public constructor(public readonly liveRuns: readonly { readonly executionId: string; readonly taskRef: string | null }[]) {\n super(`A coding run is writing the application's tree right now (${liveRuns.map((run) => run.taskRef ?? run.executionId).join(', ')}). `\n + 'Accepting now would commit around its work and break what it records as its own. Accept again once it has settled '\n + '(`wildo creation feed --follow --exit-on-change` says when).');\n this.name = 'CodingRunWritingTheTreeError';\n }\n}\n\n/**\n * A commit refused because the tree it would leave does not resolve one of its own imports (#2332): a committed\n * file imports a module no commit holds and this door may not carry. 409: the request is fine, the moment is\n * not. Accept the change that wrote the module first (its run, as `wildo creation writes` lists it), then this.\n */\nexport class AcceptWouldLeaveUnresolvedImportError extends Error {\n public constructor(public readonly unresolved: readonly UnresolvedImportWithWriter[]) {\n super('Committing now would leave the application importing a module no commit holds: '\n + `${unresolved.map(describeUnresolvedImport).join('; ')}. Then accept this again.`);\n this.name = 'AcceptWouldLeaveUnresolvedImportError';\n }\n}\n\n/** An unresolved import, with the not-yet-accepted playbook run that wrote its module when one did. */\nexport interface UnresolvedImportWithWriter extends UnresolvedCommitImport {\n readonly writtenBy?: { readonly runId: string; readonly playbookRef: string };\n}\n\n/**\n * One unresolved import, with the path to get committed and the remedy that actually applies to its writer: a run\n * is accepted, a file no run wrote (a persona or brand accept, a hand edit; #2419) is committed by the person.\n */\nfunction describeUnresolvedImport(entry: UnresolvedImportWithWriter): string {\n const head = `${entry.importer} imports '${entry.specifier}'`;\n if (entry.workingTreeModule === undefined) return `${head}, which exists nowhere (the import itself is broken: fix the file)`;\n if (entry.writtenBy) {\n return `${head}, which is ${entry.workingTreeModule}, written by playbook run ${entry.writtenBy.runId} (${entry.writtenBy.playbookRef}) and not accepted yet: `\n + `accept it first with \\`wildo creation accept ${entry.writtenBy.runId}\\``;\n }\n return `${head}, which is ${entry.workingTreeModule}, written by no playbook run (a persona or brand accept, or a hand edit; see #2419): commit that file first`;\n}\n\nexport class AcceptedChangeCommitError extends Error {\n public constructor(message: string, public readonly stderr: string) {\n super(message);\n this.name = 'AcceptedChangeCommitError';\n }\n}\n\n@injectable()\nexport class AcceptedChangeCommitCompanionService {\n private readonly logDebug: (message: string, context?: Record<string, unknown>) => void;\n\n public constructor(\n @inject(SAAS_SERVICE_TYPES.Logger) private readonly logger: LoggerService,\n @inject(COMPANION_SERVICE_TYPES.CompanionContext) private readonly companionContext: CompanionContext,\n @inject(COMPANION_SERVICE_TYPES.CodingRunWriteRegisterService) private readonly codingRunWrites: CodingRunWriteRegisterCompanionService,\n @inject(COMPANION_SERVICE_TYPES.PlaybookRunWriteRegisterService) private readonly playbookRunWrites: PlaybookRunWriteRegisterCompanionService,\n @inject(COMPANION_SERVICE_TYPES.ExecutionsService) private readonly executions: Pick<CompanionExecutionsCompanionService, 'listActorExecutions'>,\n ) {\n this.logDebug = this.logger.debugByType('AcceptedChangeCommit');\n }\n\n /** Set once, by the build layer; see {@link ConcurrentRunProductWitness}. */\n private concurrentRunProductWitness: ConcurrentRunProductWitness | undefined;\n\n public registerConcurrentRunProductWitness(witness: ConcurrentRunProductWitness): void {\n this.concurrentRunProductWitness = witness;\n }\n\n\n /**\n * A PERSON's acceptance waits for the tree to be quiet; the automatic origins do not ask. They run from\n * inside the coding dispatch's own window (at a baseline, at the end of a wave, at recovery), where the\n * run being accepted is the one holding it — refusing them would refuse the dispatch its own commit.\n * Read from the actor plane, so a run another process started is seen too.\n */\n private async refuseWhileACodingRunWrites(origin: AcceptOrigin): Promise<void> {\n if (origin !== AcceptOrigin.OPERATOR) return;\n const live = await listInFlightCodingRuns(this.executions);\n if (live.length > 0) throw new CodingRunWritingTheTreeError(live);\n }\n\n /** Accept the latest recorded coding run of a build-plan task. `subject` is the task's objective, for the message. */\n public async acceptCodingRun(input: {\n readonly taskRef: string;\n readonly subject?: string;\n readonly force?: boolean;\n /** Defaults to OPERATOR: the workbench predates the loop, and an unstated origin must not read as automatic. */\n readonly origin?: AcceptOrigin;\n }): Promise<AcceptedChangeCommitOutcome> {\n await this.refuseWhileACodingRunWrites(input.origin ?? AcceptOrigin.OPERATOR);\n const record = await this.codingRunWrites.findLatestForTaskRef(input.taskRef);\n if (!record) {\n throw new NothingToAcceptError(\n `No coding run of ${input.taskRef} has recorded its writes. A run older than the write register is accepted by committing by hand.`,\n );\n }\n /*\n * An accepted run is not accepted again — unless the caller FORCES it. A first accept can be\n * PARTIAL: it commits what it can vouch for and refuses the rest by name, and the register then\n * records the run as accepted. Returning here unconditionally made every later forced accept a\n * no-op in exactly that case — a person's force-accept from the workbench, and the end-of-wave\n * reconciliation (#1528), which exists for runs whose accept siblings made partial. Found by the\n * real-git wave test: the run's module landed, the shared index it also wrote stayed uncommitted,\n * and reconciliation answered \"already committed\". Re-classifying is safe: a path already at HEAD\n * stages nothing, and a commit is made only when something is.\n */\n const origin = input.origin ?? AcceptOrigin.OPERATOR;\n if (record.acceptedCommitSha !== undefined && input.force !== true) {\n /*\n * Already accepted, but say what that accept LEFT OUT and why (#3233 R4): a partial accept refused paths by name,\n * and answering \"already committed\" alone hid them, so a person reran `wildo build accept` and got nothing to act\n * on. The refusals are re-derived through the same pipeline the door uses, for the paths still uncommitted;\n * `--force` then takes the ones about bytes.\n */\n const stillUncommitted = await this.uncommittedAmong(record.files.map((file) => file.path));\n const { refused: leftOut } = await this.classifyForOwnAccept(record, false, origin);\n return {\n commitSha: record.acceptedCommitSha, committedPaths: [], carriedPaths: [],\n refusedPaths: leftOut.filter((entry) => stillUncommitted.has(entry.path)), message: '', alreadyCommitted: true,\n };\n }\n const { accepted, refused } = await this.classifyForOwnAccept(record, input.force === true, origin);\n if (accepted.length === 0) {\n throw new NothingToAcceptError(\n record.files.length === 0\n ? `The latest run of ${input.taskRef} changed nothing; there is nothing to accept.`\n : `Nothing of ${input.taskRef}'s run can be accepted: ${refused.map((entry) => describeRefusal(entry, input.taskRef)).join(', ')}.`,\n refused,\n );\n }\n const message = [\n `${input.taskRef}: ${input.subject ?? 'accept the coding run'}`,\n '',\n `${ACCEPT_ORIGIN_SENTENCE[origin]}: the writes of coding run ${record.taskId} on ${record.at}.`,\n /*\n * A file several runs edited is committed whole, so it carries their lines too: claims are per PATH,\n * and nothing separates one run's hunks from another's (#2209). Said, rather than left for the\n * message to over-claim.\n */\n ...(record.concurrent === true ? ['This run shared the working tree with other runs: a file listed here may also carry lines they wrote.'] : []),\n '',\n ...accepted.map((filePath) => `- ${filePath}`),\n ...(refused.length > 0 ? ['', `Not included (refused by name): ${refused.map((entry) => describeRefusal(entry, input.taskRef)).join('; ')}`] : []),\n '',\n `${CODING_RUN_TRAILER}: ${record.taskId}`,\n ].join('\\n');\n const outcome = await this.commitPaths(accepted, message, origin, ImportClosurePolicy.REPORT_UNRESOLVED);\n await this.codingRunWrites.markAccepted(record.taskId, outcome.commitSha, new Date().toISOString());\n return { ...outcome, refusedPaths: refused };\n }\n\n /**\n * The classification every per-run accept applies, in order (#3218, #3221, #3233): who else may have written beside\n * the run, its unclaimed paths that are its own by elimination, its claims and bytes, a playbook run's output, and the\n * product withhold. ONE pipeline, so the \"already committed\" answer names exactly what the accept would refuse.\n */\n private async classifyForOwnAccept(record: CodingRunWriteRecord, force: boolean, origin: AcceptOrigin): Promise<{\n readonly accepted: readonly string[];\n readonly refused: readonly AcceptRefusal[];\n readonly evidence: OtherWriterEvidence;\n }> {\n const evidence = await this.gatherOtherWriterEvidence({ besideRecords: [record], candidatePaths: record.files.map((file) => file.path) });\n const solelyWritten = await this.unclaimedPathsNoOtherWriterMayHave(record, evidence);\n const classified = withholdPlaybookRunOutput(await this.classifyCodingRunFiles(record, force, false, solelyWritten), evidence.playbookOwners);\n const { accepted, refused } = await this.withholdPathsLackingOwnProduct(record, classified, origin, evidence);\n return { accepted, refused, evidence };\n }\n\n /**\n * A BUILD CHECKPOINT (#3204): the application's working tree committed as it stands, naming every coding run that\n * settled since the previous checkpoint. The automatic build lane's only coding-run commit.\n *\n * **Why not one commit per run.** Ten agents share one working tree, so a commit under ONE run's name had to decide\n * which run wrote which bytes: claimed paths, refusals of files a run did not claim, shared files withheld while another\n * writer might hold them, a catch-up accept and a wave-end reconciliation. On reference run 42575514613 that\n * machinery held agents to 3.4 of 10 on average, committed nothing on 31 of 90 run accepts and refused 832 paths.\n * Decided by Paul (2026-11-09): progress no longer waits on a commit (a build task lands when its product is in the\n * working tree), and the commit is a checkpoint of the tree. One commit per task is not kept.\n *\n * **What a checkpoint says, for assurance.** `WILDO.SOFTWARE.AI_PRODUCED_CHANGE_CONTROL` asks that an accepted change\n * be attributed to whoever accepted it: the companion authors the commit and the origin and posture trailers say it was\n * automatic, as every automatic door does. Which runs the change carries is named by one `Wildo-Coding-Run` trailer per\n * run, and which files each run touched stays in its write record and its change-set artifact. Which run wrote which\n * LINE is not recorded, by decision.\n *\n * **What it leaves out.** The build-task decisions file (only a person's decision door commits it), every file an\n * unaccepted playbook run owns (its own accept commits it), and the research-evidence store (accepted only on a person's\n * request, #2419). Everything else\n * under the application root that git does not ignore is committed, including a sibling's file still being written and\n * a person's edit made during the build: the next checkpoint carries the rest, and a person who wants an edit kept apart\n * commits it themselves first.\n *\n * Runs still live (`liveTaskIds`) are not named; the checkpoint after they settle names them. With no settled run to\n * name nothing is committed: an uncommitted change no run made is not the build's to commit. Answers `undefined` then.\n *\n * **A person's checkpoint (`AcceptOrigin.OPERATOR`, #1885).** The automatic origins run only where the autonomy posture\n * maps a run's result to notify-and-proceed, so under a reviewing posture (GUIDED) no automatic checkpoint is made, and\n * the person's other doors (a run's accept, `--leftovers`) each name ONE task's runs: what several runs left in the\n * shared tree would stay uncommitted, and the next run would find it dirty at its baseline. `wildo build checkpoint`\n * is that person's door onto this same commit: the same tree, the same exclusions, every settled run named, authored by\n * the person's own git identity and saying a person accepted it. It is refused while a coding run is writing, as every\n * person's accept is, so it never names a run that has not settled.\n */\n public async commitBuildCheckpoint(input: {\n readonly origin: AcceptOrigin.WAVE_RECONCILIATION | AcceptOrigin.INTERRUPTED_RUN_RECOVERY | AcceptOrigin.OPERATOR;\n readonly liveTaskIds: ReadonlySet<string>;\n }): Promise<BuildCheckpointOutcome | undefined> {\n await this.refuseWhileACodingRunWrites(input.origin);\n const runs = (await this.codingRunWrites.list())\n .filter((record) => record.acceptedCommitSha === undefined && !input.liveTaskIds.has(record.taskId))\n .sort((left, right) => left.at.localeCompare(right.at));\n if (runs.length === 0) return undefined;\n const acceptedAt = new Date().toISOString();\n /*\n * Twice at most (review of 4a1b1f1bf F4): an agent or a tool can delete a short-lived untracked file between the listing\n * and `git add` (a Vite `*.timestamp-*.mjs`), and `git add` then stages nothing and fails. A vanished untracked path is\n * dropped just before staging; if one still slips through, the tree is listed again once.\n */\n for (let attempt = 1; ; attempt += 1) {\n const changed = await this.listChangedApplicationPaths();\n const playbookOwners = await this.unacceptedPlaybookRunOwners(changed.map((entry) => entry.path));\n const excludedPaths = changed.map((entry) => entry.path).filter((filePath) => isBuildTaskDecisionsPath(filePath, this.companionContext)\n || playbookOwners.has(filePath)\n // The research-evidence store is accepted only on a person's request (#2419), whether or not a run record still owns it.\n || filePath.startsWith(`${RESEARCH_EVIDENCE_RELATIVE_ROOT}/`));\n const excluded = new Set(excludedPaths);\n const stillThere = await Promise.all(changed.map(async (entry) => (!entry.untracked || await stat(path.resolve(this.companionContext.saasRoot, entry.path)).then(() => true, () => false))));\n const paths = changed.filter((entry, index) => !excluded.has(entry.path) && stillThere[index]).map((entry) => entry.path);\n if (paths.length === 0) {\n // Their writes are already committed (an earlier checkpoint carried them): each is stamped with the commit that last\n // changed its own files (F8), never merely HEAD, which may be a commit holding none of its work.\n for (const record of runs) await this.codingRunWrites.markAccepted(record.taskId, await this.lastCommitTouching(record.files.map((file) => file.path)), acceptedAt);\n return { commitSha: await this.lastCommitTouching([]), committedPaths: [], namedTaskIds: runs.map((record) => record.taskId), excludedPaths, alreadyCommitted: true };\n }\n const taskRefs = [...new Set(runs.map((record) => record.taskRef))];\n const message = [\n `build checkpoint: ${taskRefs.length === 1 ? taskRefs[0] : `${taskRefs.length} build tasks`}`,\n '',\n `${input.origin === AcceptOrigin.OPERATOR ? OPERATOR_CHECKPOINT_SENTENCE : ACCEPT_ORIGIN_SENTENCE[input.origin]}.`,\n 'The working tree the build\\'s runs share is committed as it stands. The runs named below settled since the previous checkpoint; which run wrote which file is in each run\\'s own write record.',\n '',\n ...runs.map((record) => `Run: ${record.taskRef} (run ${record.taskId}, recorded ${record.at})`),\n ...(excludedPaths.length > 0 ? ['', 'Left out (a person\\'s decision record, an unaccepted playbook run\\'s file, or research evidence):', ...excludedPaths.map((filePath) => `- ${filePath}`)] : []),\n '',\n ...runs.map((record) => `${CODING_RUN_TRAILER}: ${record.taskId}`),\n ].join('\\n');\n try {\n const outcome = await this.commitPaths(paths, message, input.origin, ImportClosurePolicy.REPORT_UNRESOLVED);\n for (const record of runs) await this.codingRunWrites.markAccepted(record.taskId, outcome.commitSha, acceptedAt);\n return { commitSha: outcome.commitSha, committedPaths: outcome.committedPaths, namedTaskIds: runs.map((record) => record.taskId), excludedPaths, alreadyCommitted: outcome.alreadyCommitted };\n } catch (error) {\n if (attempt >= 2) throw error;\n this.logDebug('A build checkpoint could not stage its paths; listing the tree again', { error: describeCaughtError(error) });\n }\n }\n }\n\n /** The commit that last changed any of these paths, or HEAD when git has no history for them (or none are given). */\n private async lastCommitTouching(paths: readonly string[]): Promise<string> {\n const lastTouching = paths.length > 0 ? (await this.execGit(['log', '-1', '--format=%H', '--', ...paths])).stdout.trim() : '';\n return lastTouching || (await this.execGit(['rev-parse', 'HEAD'])).stdout.trim();\n }\n\n /**\n * Every path under the application root that differs from HEAD and that git does not ignore, application-relative, and\n * whether git lists it as UNTRACKED (`??`): the one kind of entry that can vanish before staging with nothing to stage.\n */\n private async listChangedApplicationPaths(): Promise<Array<{ readonly path: string; readonly untracked: boolean }>> {\n // With `-z`, `git status` prints REPOSITORY-relative paths whatever `-C` says (see `uncommittedAmong`).\n const prefix = (await this.execGit(['rev-parse', '--show-prefix'])).stdout.replace(/\\r?\\n$/u, '');\n const toApplicationPath = (repositoryPath: string): string => (prefix && repositoryPath.startsWith(prefix) ? repositoryPath.slice(prefix.length) : repositoryPath);\n const status = await this.execGit(['status', '--porcelain=v1', '-z', '--untracked-files=all', '--', '.']);\n const tokens = status.stdout.split('\\0');\n const changed = new Map<string, boolean>();\n for (let index = 0; index < tokens.length; index += 1) {\n const entry = tokens[index]!;\n if (entry.length < 4) continue;\n changed.set(toApplicationPath(entry.slice(3)), entry.startsWith('??'));\n // A rename or copy is `XY new\\0old`: the original path changed too (its removal is part of the change).\n if (entry[0] === 'R' || entry[0] === 'C' || entry[1] === 'R' || entry[1] === 'C') {\n index += 1;\n if (tokens[index]) changed.set(toApplicationPath(tokens[index]!), false);\n }\n }\n return [...changed].sort(([left], [right]) => left.localeCompare(right)).map(([changedPath, untracked]) => ({ path: changedPath, untracked }));\n }\n\n /**\n * Every file a recorded coding run left uncommitted that no automatic door will commit (#3267; a stuck task's declared product aside, #3204), as\n * {@link UncommittedRunLeftover}: uncommitted now, its bytes still exactly what a run of its task recorded (so nothing\n * edited it since), and no unaccepted playbook run owning it (that run's own accept commits it, `wildo creation\n * accept`), for a task whose door has already passed: no run of it is live (a live run's accept decides it, and a\n * parked run's turn will conclude), and its LATEST recorded run is accepted, so the autonomy posture's accept of that\n * run already took everything it could (a passing retry's vouching included) and left this. A task whose latest run\n * was not accepted is still the build's: a retry may vouch for the file, or the task is reported unlanded with its\n * uncommitted paths and `wildo build accept --force`. Known limit: a task whose accepted run did not land it is\n * dispatched again, and that retry may still take the file; the line then disappears when it does.\n *\n * Two shapes reach here and this reports both the same way: an earlier FAILED run's file a retry's vouching refused\n * (`check_failed`, not vouched for) once the task landed, and a file dirty at a retry's baseline with what earlier\n * failed runs left, which the retry's own accept refuses as `carries_changes_from_before_the_run` (the cost #3267\n * records of removing lineage). Neither is committed here: the records name bytes, never who wrote them, so the door is\n * a person's (under a committing posture, the next build checkpoint commits it with the tree, #3204).\n *\n * Read-only. A run whose record holds the path but whose bytes no longer match is not named: the file moved after it.\n */\n public async listUncommittedRunLeftovers(): Promise<readonly UncommittedRunLeftover[]> {\n const records = await this.codingRunWrites.list();\n if (records.length === 0) return [];\n const liveTaskRefs = await this.taskRefsWithAnOpenRun();\n // `list()` is newest first, so the first record of a task is its latest run.\n const latestAccepted = new Set<string>();\n const seenTasks = new Set<string>();\n for (const record of records) {\n if (seenTasks.has(record.taskRef)) continue;\n seenTasks.add(record.taskRef);\n if (record.acceptedCommitSha !== undefined) latestAccepted.add(record.taskRef);\n }\n const settled = records.filter((record) => !liveTaskRefs.has(record.taskRef) && latestAccepted.has(record.taskRef));\n const uncommitted = await this.uncommittedAmong(settled.flatMap((record) => record.files.map((file) => file.path)));\n if (uncommitted.size === 0) return [];\n const owners = await this.unacceptedPlaybookRunOwners([...uncommitted]);\n const leftovers: UncommittedRunLeftover[] = [];\n for (const filePath of [...uncommitted].filter((candidate) => !owners.has(candidate)).sort()) {\n const bytes = await readFile(path.resolve(this.companionContext.saasRoot, filePath)).catch(() => undefined);\n const current = bytes === undefined ? undefined : sha256Hex(bytes);\n const byTask = new Map<string, string[]>();\n // `list()` is newest first, so each task's runs are named newest first.\n for (const record of settled) {\n const entry = record.files.find((file) => file.path === filePath);\n if (!entry) continue;\n const unchanged = current === undefined ? entry.changeKind === ChangeSetFileChangeKind.DELETED : current === entry.contentSha256;\n if (unchanged) byTask.set(record.taskRef, [...(byTask.get(record.taskRef) ?? []), record.taskId]);\n }\n if (byTask.size === 0) continue;\n const absentAtHead = (await this.execGit(['rev-parse', '--verify', '--quiet', `HEAD:./${filePath}`], { acceptExitCodes: [0, 1, 128] })).exitCode !== 0;\n for (const [taskRef, runTaskIds] of byTask) {\n leftovers.push({ taskRef, path: filePath, runTaskIds, absentAtHead, discardCommand: describeLeftoverDiscardCommand(filePath, absentAtHead) });\n }\n }\n return leftovers;\n }\n\n /**\n * A person's door for a task's leftovers (#3267): `wildo build accept <taskRef> --leftovers`. Commits, in one commit,\n * what {@link listUncommittedRunLeftovers} reports for the task, each file under the NEWEST run whose record holds it,\n * through that run's own accept classification: who else may have written beside it, its claims, its bytes, a playbook\n * run's ownership and its product. So nothing is committed under a run's name that its own accept would not commit,\n * and `force` passes exactly what it passes there, the two refusals about bytes. Every run whose record holds a\n * committed file is named. No check runs: a person reviewed the files and accepts them, as with\n * `wildo build accept --force`.\n */\n public async acceptCodingRunLeftovers(input: { readonly taskRef: string; readonly force?: boolean }): Promise<AcceptedChangeCommitOutcome> {\n const origin = AcceptOrigin.OPERATOR;\n await this.refuseWhileACodingRunWrites(origin);\n const leftovers = (await this.listUncommittedRunLeftovers()).filter((leftover) => leftover.taskRef === input.taskRef);\n if (leftovers.length === 0) {\n throw new NothingToAcceptError(`No run of ${input.taskRef} left a file uncommitted that is still as it left it; there is nothing to accept.`);\n }\n const byRun = new Map<string, string[]>();\n for (const leftover of leftovers) byRun.set(leftover.runTaskIds[0]!, [...(byRun.get(leftover.runTaskIds[0]!) ?? []), leftover.path]);\n const accepted: string[] = [];\n const refused: AcceptRefusal[] = [];\n const takenFrom: Array<{ readonly record: CodingRunWriteRecord; readonly paths: readonly string[] }> = [];\n for (const [taskId, paths] of byRun) {\n const record = await this.codingRunWrites.read(taskId);\n if (!record) continue;\n const own = new Set(paths);\n const classified = await this.classifyForOwnAccept(record, input.force === true, origin);\n const taken = classified.accepted.filter((filePath) => own.has(filePath));\n accepted.push(...taken);\n refused.push(...classified.refused.filter((entry) => own.has(entry.path)));\n if (taken.length > 0) takenFrom.push({ record, paths: taken.sort() });\n }\n if (accepted.length === 0) {\n throw new NothingToAcceptError(\n `Nothing ${input.taskRef}'s runs left uncommitted can be accepted: ${refused.map((entry) => describeRefusal(entry, input.taskRef)).join(', ')}.`,\n refused,\n );\n }\n const committed = new Set(accepted);\n /*\n * Every run whose lines a committed file may carry is named: the runs whose record holds its bytes now, and, for a\n * file that was dirty when such a run began (taken only by `force`), the earlier runs of the task its history\n * reaches ({@link runsInTheHistoryOf}).\n */\n const allRecords = await this.codingRunWrites.list();\n const historyRuns = takenFrom.flatMap((entry) => runsInTheHistoryOf(entry.record, entry.paths, allRecords).map((run) => run.taskId));\n const namedRuns = [...new Set([...leftovers.filter((leftover) => committed.has(leftover.path)).flatMap((leftover) => leftover.runTaskIds), ...historyRuns])];\n const message = [\n `${input.taskRef}: commit what its runs left uncommitted`,\n '',\n `${ACCEPT_ORIGIN_SENTENCE[origin]}: files earlier runs of this task left in the tree, still as they left them, that no automatic door had committed (#3267).`,\n ...takenFrom.flatMap((entry) => ['', `Left by coding run ${entry.record.taskId} (recorded ${entry.record.at}):`, ...entry.paths.map((filePath) => `- ${filePath}`)]),\n ...(refused.length > 0 ? ['', `Not included (refused by name): ${refused.map((entry) => describeRefusal(entry, input.taskRef)).join('; ')}`] : []),\n '',\n ...namedRuns.map((taskId) => `${CODING_RUN_TRAILER}: ${taskId}`),\n ].join('\\n');\n const outcome = await this.commitPaths(accepted, message, origin, ImportClosurePolicy.REPORT_UNRESOLVED);\n // A run is stamped accepted only once nothing it recorded is left uncommitted (re-review F8 of #3220).\n const acceptedAt = new Date().toISOString();\n for (const taskId of namedRuns) {\n const record = await this.codingRunWrites.read(taskId);\n if (!record || record.acceptedCommitSha !== undefined) continue;\n if ((await this.uncommittedAmong(record.files.map((file) => file.path))).size === 0) await this.codingRunWrites.markAccepted(taskId, outcome.commitSha, acceptedAt);\n }\n return { ...outcome, refusedPaths: refused };\n }\n\n /** The build-plan tasks a run of which is open now (selected, running or parked), read from the durable actor plane. */\n private async taskRefsWithAnOpenRun(): Promise<ReadonlySet<string>> {\n const taskRefs = new Set<string>();\n for (const [systemRef, status] of OPEN_TREE_WRITER_QUERIES) {\n for (const row of await this.executions.listActorExecutions(CompanionExecutionsListQuerySchema.parse({ systemRef, status, limit: EXECUTION_SPAN_SCAN_LIMIT }))) {\n for (const task of (row as { standaloneTasks?: ReadonlyArray<{ input?: unknown }> }).standaloneTasks ?? []) {\n const taskRef = (task.input as { taskRef?: unknown } | undefined)?.taskRef;\n if (typeof taskRef === 'string') taskRefs.add(taskRef);\n }\n }\n }\n return taskRefs;\n }\n\n /**\n * Which recorded runs may carry which paths' current changes (#1805), answered for a whole set of paths at\n * once. A run may carry a path when its capture holds the path as its OWN (never as a parallel commit's,\n * another lane's, or outside the application) and no commit THIS LANE made since that capture touched the\n * path.\n *\n * Only this lane's commits end it, because only they are known to take the WHOLE working file: every one is\n * a pathspec commit of the file as it stands, so what the run left in it is then in history, or was\n * overwritten before (#1805 review 6 G1). They are recognised by the trailer KEYS this service writes\n * (`LANE_COMMIT_TRAILERS`). Another author's commit proves nothing either way: a temporary-index commit or\n * `git add -p` can take their own hunk and leave the run's in the working tree, so the run stays \"may\", as\n * the rule says. So does a run whose version a person threw away without a commit (review 5 L3). Both\n * over-name, which is the direction the rule accepts, and the bytes test in the caller still commits a path\n * only when its current state is one a run left.\n *\n * Known limit — this can UNDER-name when a commit carrying a lane key was NOT made against the file as it\n * stood after the capture, yet sits after it in history (reviews 7 I3, 8 L1). Two shapes: a person's commit\n * that COPIES a lane trailer (`commit -c`/`-C` of a lane commit, an `--amend` of one with partial staging, a\n * squash), and a lane commit made BEFORE the capture and re-attached after it (`reset --soft` back, the run,\n * `reset --soft` forward; a stash and cherry-pick around a run). The second is closed wherever the clock\n * can tell: a lane commit whose committer second is EARLIER than the capture's second ends no claim. That\n * can only over-name, and a commit in the capture's own second still counts, so the review 5 F1 objection\n * to clocks does not arise. What remains is a copied trailer, or a re-attached commit within the capture's\n * second. `revert` copies no trailer and `cherry-pick` refuses over dirty files.\n *\n * \"Since that capture\" is HISTORY ORDER, never a clock (review 5 F1): a commit's `%ct` is whole seconds,\n * and a run's own accept usually lands within the second of its capture. And it is the DESCENDANTS of the\n * record's post-run HEAD (`--ancestry-path <postRunHeadSha>..HEAD`), not merely what that HEAD cannot reach\n * (review 7 M1): after a rebase or a branch switch that carries the dirty files across, lane commits made\n * BEFORE the capture are rewritten into the plain range with their trailers intact, and would end a claim\n * on lines still uncommitted. With the ancestry path a rewritten history counts nothing, and its runs stay\n * named. A post-run HEAD git cannot resolve is no evidence either way, so its runs are kept too. Renames\n * are not followed (`--no-renames`), so a moved file is listed under both its names.\n *\n * One `git log` per distinct post-run HEAD, over only the paths asked about (review 6 C1): the query runs\n * under the workspace lock and at every companion start, and one per path per record was minutes on a\n * register a few days old.\n */\n private async carryTest(paths: readonly string[], pool: readonly CodingRunWriteRecord[]): Promise<(record: CodingRunWriteRecord, filePath: string) => boolean> {\n const asked = new Set(paths);\n const owns = (record: CodingRunWriteRecord, filePath: string): boolean => {\n const file = record.files.find((entry) => entry.path === filePath);\n return file !== undefined && !isAttributedToAnotherWriter(file.attribution);\n };\n const pathsByHead = new Map<string, Set<string>>();\n for (const record of pool) {\n for (const file of record.files) {\n if (!asked.has(file.path) || !owns(record, file.path)) continue;\n const heads = pathsByHead.get(record.postRunHeadSha) ?? new Set<string>();\n heads.add(file.path);\n pathsByHead.set(record.postRunHeadSha, heads);\n }\n }\n /*\n * Per post-run HEAD: for each path a lane commit took since it, the LATEST committer second among those\n * commits — or `undefined` when git cannot resolve the HEAD.\n */\n const takenSince = new Map<string, ReadonlyMap<string, number> | undefined>();\n for (const [head, headPaths] of pathsByHead) {\n const log = await this.execGit([\n 'log', '-z', '--relative', '--name-only', '--no-renames', '--ancestry-path',\n `--format=%x1e%ct%x1c%(trailers:${LANE_COMMIT_TRAILERS.map((key) => `key=${key}`).join(',')},only,unfold,separator=%x1f)%x1d`,\n `${head}..HEAD`, '--', ...[...headPaths].sort(),\n ], { acceptExitCodes: [128] });\n if (log.exitCode === 128) {\n takenSince.set(head, undefined);\n continue;\n }\n const taken = new Map<string, number>();\n for (const commit of log.stdout.split(COMMIT_MARK)) {\n const end = commit.indexOf(TRAILERS_END);\n const timeEnd = commit.indexOf(TIME_END);\n if (end < 0 || timeEnd < 0 || commit.slice(timeEnd + 1, end).trim() === '') continue;\n const committedAt = Number(commit.slice(0, timeEnd));\n for (const name of commit.slice(end + 1).split('\\0')) {\n const filePath = name.replace(/^\\n+/u, '');\n if (filePath) taken.set(filePath, Math.max(taken.get(filePath) ?? Number.NEGATIVE_INFINITY, committedAt));\n }\n }\n takenSince.set(head, taken);\n }\n return (record, filePath) => {\n if (!owns(record, filePath)) return false;\n const takenAt = takenSince.get(record.postRunHeadSha)?.get(filePath);\n // Taken only by a lane commit from the capture's own second or later (review 8 L1).\n return takenAt === undefined || takenAt < Math.floor(Date.parse(record.at) / 1_000);\n };\n }\n\n /**\n * Which of these paths differ from HEAD right now — modified, deleted, or new and untracked. Read from\n * `git status` rather than from the register, because what the register recorded may since have been\n * committed by the run's own accept.\n */\n private async uncommittedAmong(paths: readonly string[]): Promise<Set<string>> {\n const unique = [...new Set(paths)];\n if (unique.length === 0) return new Set();\n /*\n * With `-z`, `git status` prints paths relative to the REPOSITORY root whatever `-C` says (#1805 review\n * R1; the same trap `GitChangeSetCompanionService.resolveApplicationRelativePathMapper` records). For an\n * application nested in its repository — every dogfood application here — nothing would ever match the\n * register's application-relative paths, so the prefix git reports for the application is stripped.\n */\n const prefix = (await this.execGit(['rev-parse', '--show-prefix'])).stdout.replace(/\\r?\\n$/u, '');\n const toApplicationPath = (repositoryPath: string): string => (prefix && repositoryPath.startsWith(prefix) ? repositoryPath.slice(prefix.length) : repositoryPath);\n const status = await this.execGit(['status', '--porcelain=v1', '-z', '--untracked-files=all', '--', ...unique]);\n const tokens = status.stdout.split('\\0');\n const dirty = new Set<string>();\n for (let index = 0; index < tokens.length; index += 1) {\n const entry = tokens[index]!;\n if (entry.length < 4) continue;\n dirty.add(toApplicationPath(entry.slice(3)));\n // A rename or copy is `XY new\\0old`: the ORIGINAL path is its own token, and it changed too.\n if (entry[0] === 'R' || entry[0] === 'C' || entry[1] === 'R' || entry[1] === 'C') {\n index += 1;\n if (tokens[index]) dirty.add(toApplicationPath(tokens[index]!));\n }\n }\n return new Set(unique.filter((filePath) => dirty.has(filePath)));\n }\n\n /**\n * Accept a playbook run's writes, from its register: the same divergence test `revert` applies.\n *\n * Inside the dossier write queue (#2332): the commit carries the dossier its aggregate imports, so an answer\n * landing between the import closure and `git add` could wire a module the closure never saw. Nothing that\n * holds the queue calls this, so it cannot deadlock.\n */\n public async acceptPlaybookRun(input: { readonly runId: string; readonly force?: boolean; readonly origin?: AcceptOrigin }): Promise<AcceptedChangeCommitOutcome> {\n await this.refuseWhileACodingRunWrites(input.origin ?? AcceptOrigin.OPERATOR);\n const specificationsPackageRoot = this.companionContext.resolvedSpecifications?.packageRoot;\n return specificationsPackageRoot\n ? serializeDossierWrite(specificationsPackageRoot, () => this.commitPlaybookRun(input))\n : this.commitPlaybookRun(input);\n }\n\n private async commitPlaybookRun(input: { readonly runId: string; readonly force?: boolean; readonly origin?: AcceptOrigin }): Promise<AcceptedChangeCommitOutcome> {\n const diff = await this.playbookRunWrites.describeRunDiff(input.runId);\n const record = (await this.playbookRunWrites.list()).find((candidate) => candidate.runId === input.runId);\n const accepted: string[] = [];\n const refused: AcceptRefusal[] = [];\n /*\n * A DIVERGED path is committed as THIS RUN'S CHANGE merged onto HEAD (#2418), never as the working file.\n *\n * Runs share aggregate files: a family's `index.ts`, `companion-exports.ts`, `src/index.ts`, `COHERENCE.md`. Once a\n * later run rewrote one, the whole-file test refused this run's copy, so the latest run's commit carried every\n * earlier run's lines and earlier runs were committed without their wiring. On app-creation-test-005 the market\n * snapshot landed under the capability map's commit, and the requirements commit did not export its family; no\n * intermediate commit compiled alone. The run's change is exactly `previousContent → writtenContent`, so a\n * three-way merge onto HEAD commits that change and nothing else: a later run's lines stay in the working tree\n * for its own accept, and a person's edit is never committed under the run's name. A merge that conflicts is\n * refused as before. `force` keeps its meaning: the whole working file.\n *\n * Only where a LATER RUN explains the divergence. A file that no later run wrote was changed by a person or a tool\n * (#1614), possibly to repair the run's output; committing the run's version there could commit what the person\n * fixed. That case is refused as before and counted as edited outside the runs.\n */\n /*\n * PARTIAL by design, unlike the charter accept: a refused path (a person's edit, or a conflict that does not merge)\n * is named in the commit message and left for a later accept, and the rest of the run commits. Refusing the whole\n * run would hold back every unrelated file over one edit a person made, and the posture's pending-run commits rely on\n * the rest landing. The cost, reviewed and accepted: when the refused path is a shared aggregate, the run's module\n * can land before its wiring (it compiles, and exports nothing until the earlier run's accept lets the wiring merge).\n */\n const committedContent = new Map<string, string>();\n const succession = diff.files.some((file) => file.diverged) && input.force !== true\n ? await this.playbookRunWrites.describeSuccession(input.runId)\n : new Map<string, PlaybookRunFileSuccession>();\n for (const file of diff.files) {\n // A person's decision record is no playbook run's to commit, forced or not (review of 8d6b95d29).\n if (isBuildTaskDecisionsPath(file.path, this.companionContext)) {\n refused.push({ path: file.path, reason: AcceptRefusalReason.PERSON_DECISION_RECORD });\n continue;\n }\n if (!file.diverged || input.force === true) {\n accepted.push(file.path);\n continue;\n }\n const writtenEntry = succession.get(file.path) === PlaybookRunFileSuccession.LATER_RUN\n ? record?.files.find((entry) => entry.path === file.path)\n : undefined;\n // A binary entry (#3264) holds no bytes to merge: a diverged binary file is refused as edited, like a conflict.\n const written = writtenEntry !== undefined && !isBinaryWrittenFile(writtenEntry) ? writtenEntry : undefined;\n const merged = written ? await this.mergeRunChangeOntoHead(file.path, written.previousContent, written.writtenContent) : undefined;\n if (merged === undefined) {\n refused.push({ path: file.path, reason: AcceptRefusalReason.EDITED_SINCE_THE_RUN });\n continue;\n }\n committedContent.set(file.path, merged);\n accepted.push(file.path);\n }\n if (accepted.length === 0) {\n throw new NothingToAcceptError(\n `Nothing of run ${input.runId} can be accepted: ${refused.map((entry) => `${entry.path} (${entry.reason})`).join(', ')}.`,\n refused,\n );\n }\n const message = [\n `${diff.playbookRef}: accept the run's writes`,\n '',\n `${ACCEPT_ORIGIN_SENTENCE[input.origin ?? AcceptOrigin.OPERATOR]}: the writes of playbook run ${diff.runId} on ${diff.at}.`,\n // A run that failed part-way (#3237): what it wrote before it stopped, said so the history does not read it as a landing.\n ...(record?.landingFailed === true ? ['', 'The run FAILED after writing these: this commit holds what it wrote before it stopped, not a completed landing.'] : []),\n // Files this run adopted from an earlier failed run of the same playbook (#3237 review F4): named, with that run.\n ...(record?.adoptedFrom !== undefined\n ? ['', 'Adopted from an earlier failed run of this playbook, which wrote them; this run still composes them:',\n ...record.adoptedFrom.map((adopted) => `- run ${adopted.runId}: ${adopted.paths.join(', ')}`)]\n : []),\n '',\n ...accepted.map((filePath) => `- ${filePath}`),\n ...(refused.length > 0 ? ['', `Not included (refused by name): ${refused.map((entry) => `${entry.path} — ${entry.reason}`).join('; ')}`] : []),\n // What the landing dropped because a ref resolved to nothing (#2556): absent from these files, named here instead.\n // An ENTRY drop (#3074) took entries of one field and kept the item, which the line says so it does not read as the item gone.\n ...((record?.droppedItems?.length ?? 0) > 0\n ? ['', 'Dropped when the run landed (a ref they carried resolves to nothing):',\n ...record!.droppedItems!.map((item) => (item.scope === CandidateDropScope.ENTRY\n ? `- ${item.family}: ${item.itemRef} kept, its ${item.field} entries naming ${item.missingRefs.join(', ')} dropped`\n : `- ${item.family}: ${item.itemRef} (${item.field} → ${item.missingRefs.join(', ')})`))]\n : []),\n // Research evidence a sibling step read only withheld or marked (#2938): what the landed artifacts were derived from.\n ...researchScreeningCommitLines(record?.researchScreenings),\n '',\n `${PLAYBOOK_RUN_TRAILER}: ${diff.runId}`,\n ].join('\\n');\n /*\n * Closed under its imports (#2332): the aggregate files a run wires into also carry the lines the dossier\n * landing added, so the dossier the run read is carried with it, and any other module the commit would\n * import without holding refuses the accept by name rather than leaving HEAD uncompilable.\n */\n const outcome = await this.commitPaths(accepted, message, input.origin ?? AcceptOrigin.OPERATOR, ImportClosurePolicy.REFUSE_UNRESOLVED, committedContent);\n await this.playbookRunWrites.markAccepted(input.runId, outcome.commitSha, new Date().toISOString());\n return { ...outcome, refusedPaths: refused };\n }\n\n /**\n * A run's change to one file (`previousContent → writtenContent`), applied to the file as HEAD holds it (#2418).\n * `undefined` when the merge conflicts: the change cannot be separated from what moved since, so it is refused.\n * A file the run created and HEAD lacks merges from empty, which yields the run's own bytes.\n */\n private async mergeRunChangeOntoHead(applicationPath: string, previousContent: string | undefined, writtenContent: string): Promise<string | undefined> {\n const atHead = await this.execGit(['cat-file', '-p', `HEAD:./${applicationPath}`], { acceptExitCodes: [128] });\n const headContent = atHead.exitCode === 0 ? atHead.stdout : '';\n const directory = await mkdtemp(path.join(tmpdir(), 'wildo-accept-merge-'));\n try {\n const ours = path.join(directory, 'head');\n const base = path.join(directory, 'base');\n const theirs = path.join(directory, 'run');\n await writeFile(ours, headContent, 'utf8');\n await writeFile(base, previousContent ?? '', 'utf8');\n await writeFile(theirs, writtenContent, 'utf8');\n // `-p` prints the result; the exit code is the number of conflicts (capped), negative on error.\n const merged = await this.execGit(['merge-file', '-p', ours, base, theirs], { acceptExitCodes: MERGE_FILE_CONFLICT_EXIT_CODES });\n /*\n * A conflict is refused, never resolved by a line-level fallback. One was tried for an insertion next to a line\n * HEAD lacks (7f378f127f, 3f9f67902c, 0431638a5e) and three independent reviews found it returning WRONG text\n * that would have been committed: dropped lines, then misplaced ones, then a middle alignment no extreme-pair\n * check sees (1,200 wrong of ~600k exhaustive small cases). Which side an identical line belongs to is not\n * decidable from content, and a commit must never be a guess. The remedy for a refusal is to accept the earlier\n * run first, after which this merge is clean.\n */\n return merged.exitCode === 0 ? merged.stdout : undefined;\n } finally {\n await rm(directory, { recursive: true, force: true }).catch(() => undefined);\n }\n }\n\n /**\n * Accept EVERY playbook run whose writes are not yet accepted — the third site of #1534's invariant,\n * run by the coding dispatch inside its worktree window, immediately before it takes a baseline.\n *\n * **Why at a baseline, and not when the playbook run ends.** A playbook run's writes do not need a\n * commit to count — the choreography reads the working tree — so nothing stalls without one. What\n * goes wrong is later: a coding run that edits a file a playbook left uncommitted finds it dirty at\n * its baseline, and this door then refuses that path as `carries_changes_from_before_the_run`. So\n * the moment that matters is the instant before a baseline. Committing when the playbook run ends\n * would instead need the worktree lock for the whole run, or land inside a live coding run's window\n * — which is what destroys its attribution. It is also exactly where the operator's shell loop\n * committed during the 2026-09-23 run, \"between dispatches\".\n *\n * **Oldest first, and each run commits its own change (#2418).** A later run that rewrote a file makes an\n * earlier run's copy `diverged`; the earlier run's change is then merged onto HEAD and committed under its\n * name, and the later run's accept commits its own change on top. A path whose change no longer merges, and a\n * run whose every path is refused, throws `NothingToAcceptError`, which is counted here, not raised. (Before\n * #2418 the earlier run was refused and the later one committed the file whole, carrying both runs' lines.)\n *\n * **Superseded is counted apart from edited (#1614).** A later RUN that rewrote the path read this\n * run's landing first, or merged into it: the landing refuses to replace a file that moved since the\n * run read it, so a later run can no longer discard an earlier one. A path no later run wrote was\n * changed by a person or a tool, and that is reported as `editedOutsideRuns`, not as superseded. Records whose paths already match HEAD are stamped with no new commit,\n * which is how the unstamped backlog of a run carried by hand is absorbed on the first pass.\n */\n public async acceptPendingPlaybookRuns(origin: AcceptOrigin): Promise<{\n readonly accepted: number;\n readonly superseded: number;\n readonly editedOutsideRuns: number;\n readonly failed: number;\n }> {\n const pending = (await this.playbookRunWrites.list())\n .filter((record) => record.acceptedCommitSha === undefined)\n // Research evidence waits for a person's accept (#2419): never carried by the automatic commit.\n .filter((record) => record.acceptOnRequestOnly !== true)\n /*\n * A run that FAILED after writing (#3237): its record makes its writes attributable and keeps them out of a\n * coding run's commit, but a half-applied composition is a person's to accept or revert, never the posture's.\n */\n .filter((record) => record.landingFailed !== true)\n .sort((left, right) => left.at.localeCompare(right.at));\n let accepted = 0;\n let superseded = 0;\n let editedOutsideRuns = 0;\n let failed = 0;\n for (const record of pending) {\n try {\n await this.acceptPlaybookRun({ runId: record.runId, origin });\n accepted += 1;\n } catch (error) {\n if (error instanceof NothingToAcceptError) {\n const succession = await this.playbookRunWrites.describeSuccession(record.runId);\n if ([...succession.values()].every((entry) => entry === PlaybookRunFileSuccession.LATER_RUN)) superseded += 1;\n else {\n editedOutsideRuns += 1;\n this.logDebug('A playbook run\\'s writes were changed outside the runs before they could be accepted', { runId: record.runId, playbookRef: record.playbookRef });\n }\n continue;\n }\n failed += 1;\n this.logger.warn('Could not accept a playbook run\\'s writes', { runId: record.runId, playbookRef: record.playbookRef, error: describeCaughtError(error) });\n }\n }\n if (pending.length > 0) this.logDebug('Accepted pending playbook runs', { pending: pending.length, accepted, superseded, editedOutsideRuns, failed });\n return { accepted, superseded, editedOutsideRuns, failed };\n }\n\n /**\n * Which of a coding run's paths this service can vouch for. Attribution decides first — a path\n * that is not the run's is never accepted, whatever `force` says — then the bytes.\n */\n private async classifyCodingRunFiles(\n record: CodingRunWriteRecord,\n force: boolean,\n /**\n * Whether FORCE also passes a concurrent run's missing CLAIM (#1805 review R4). Only the shared-tree\n * door may: it commits unattributable work as such, naming every run. Any other forced accept — a\n * person's from the workbench, `wildo build accept` — commits under ONE run's name, and a path that run\n * never claimed is not its to be named for, forced or not.\n */\n passMissingClaims = false,\n /**\n * Unclaimed paths of a concurrent run that NO OTHER WRITER may have written (#3215, #3218): no other recorded run\n * may carry them, no coding run is live beside it, and no unaccepted playbook run recorded them. Accepted as the\n * run's own by elimination (see {@link unclaimedPathsNoOtherWriterMayHave}); every other check still applies.\n */\n ownByElimination: ReadonlySet<string> = new Set(),\n ): Promise<{\n readonly accepted: readonly string[];\n readonly refused: readonly AcceptRefusal[];\n }> {\n const accepted: string[] = [];\n const refused: AcceptRefusal[] = [];\n for (const file of record.files) {\n // First, and never forced: a person's decision record is no run's to commit (review of 8d6b95d29).\n if (isBuildTaskDecisionsPath(file.path, this.companionContext)) {\n refused.push({ path: file.path, reason: AcceptRefusalReason.PERSON_DECISION_RECORD });\n continue;\n }\n if (isAttributedToAnotherWriter(file.attribution)) {\n refused.push({ path: file.path, reason: AcceptRefusalReason.NOT_THIS_RUN });\n continue;\n }\n // A concurrent run's capture holds its siblings' files too; without FORCE it commits only what it claims.\n if (record.concurrent === true && file.claimedByRun !== true && !ownByElimination.has(file.path) && !(force && passMissingClaims)) {\n refused.push({ path: file.path, reason: AcceptRefusalReason.NOT_CLAIMED_BY_THE_RUN });\n continue;\n }\n /*\n * A generation step's file in a tree only it writes was regenerated whole (#3233): what was there before the run\n * (an earlier, uncommitted generation) is not mixed into it. Measured on app-creation-test-007 (F53): the labels\n * step's own composite-view label file was refused here, the task never landed, and every wave re-ran it.\n */\n if (file.attribution === ChangeSetAttributionClass.BASELINE_DIRTY_AMBIGUOUS && !force && file.inStepOwnedTree !== true) {\n refused.push({ path: file.path, reason: AcceptRefusalReason.CARRIES_CHANGES_FROM_BEFORE_THE_RUN });\n continue;\n }\n const bytes = await readFile(path.resolve(this.companionContext.saasRoot, file.path)).catch(() => undefined);\n const current = bytes === undefined ? undefined : sha256Hex(bytes);\n if (current !== file.contentSha256 && !force) {\n refused.push({ path: file.path, reason: AcceptRefusalReason.EDITED_SINCE_THE_RUN });\n continue;\n }\n accepted.push(file.path);\n }\n return { accepted, refused };\n }\n\n /**\n * A concurrent run's accept commits under ONE task's name, so every path it takes must carry that task's\n * own declared product where the task declares one (#2209). Claims are per path: a chapters index, a\n * locale file or a barrel that several runs of a wave all edited is claimed by each of them, and whichever\n * accepts first used to commit it whole, holding a sibling's product and possibly none of its own.\n * Measured on `app-creation-test-004` (2026-10-01): `ca9d3bc`, labelled with the customer-workflow-overview\n * task, added only another task's chapter, while the overview chapter had been overwritten.\n *\n * A withheld path is not lost: it stays uncommitted for the shared-tree reconciliation, which commits it\n * naming every run it may carry: under one run's name when only that run may carry it (#3218), else as writer\n * unknown.\n *\n * Applies to every door that names ONE run: the posture's accept, the workbench's, `wildo build accept`\n * (forced or not). Not to a restart's recovery of a run that was alone in its window (its files are its\n * own, and refusing there would leave them with no committer), and never to the shared-tree door, which\n * claims no single writer. A concurrent run with no witness registered is accepted as before; the build\n * layer that creates concurrent runs registers one when it is constructed, so that is a test harness, not\n * the companion.\n *\n * The witness reads the working file, and `git add` follows it while siblings may still be writing: a write\n * landing between the two can still carry a file without the product into the commit. That is the window\n * the bytes check (`EDITED_SINCE_THE_RUN`) already has, and it is closed by the same thing, the wave's\n * end-of-run repair, not by this check.\n *\n * ## Only where another writer may be what the file holds (#3218)\n *\n * The refusal protects the NAME on the commit: a file whose product is missing may hold a sibling's work\n * instead of this run's. When no other writer can have touched the path — no other recorded run may carry\n * it, no coding run is live beside this one, and no unaccepted playbook run recorded it — the file holds\n * only what this run wrote, so naming the run is true whatever its probe says, and the path is committed.\n * Whether the task LANDED is still decided by its probe at HEAD, so a run that did not produce its product\n * stays unlanded on its own commit. Before this, such a file waited for the wave's reconciliation and was\n * committed as \"writer unknown\", and the task's own accept said it had nothing: on `app-creation-test-007`\n * a navigation-config run's only write, its own config file, went that way (F42).\n */\n private async withholdPathsLackingOwnProduct(\n record: CodingRunWriteRecord,\n classified: { readonly accepted: readonly string[]; readonly refused: readonly AcceptRefusal[] },\n origin: AcceptOrigin,\n evidence: OtherWriterEvidence,\n ): Promise<{ readonly accepted: readonly string[]; readonly refused: readonly AcceptRefusal[] }> {\n if (record.concurrent !== true || origin === AcceptOrigin.INTERRUPTED_RUN_RECOVERY || classified.accepted.length === 0) return classified;\n if (!this.concurrentRunProductWitness) {\n this.logDebug('A concurrent run was accepted without a product witness: nothing registered one', { taskRef: record.taskRef });\n return classified;\n }\n const lacking = await this.concurrentRunProductWitness.pathsLackingOwnProduct(record.taskRef, classified.accepted);\n if (lacking.length === 0) return classified;\n const contested = await this.pathsAnotherWriterMayHave(record, lacking, evidence);\n const withheld = new Set(lacking.filter((filePath) => contested.has(filePath)));\n const ownAlone = lacking.filter((filePath) => !contested.has(filePath));\n if (ownAlone.length > 0) {\n this.logDebug('A concurrent run\\'s files lack its declared product, and no other writer may have written them: committed under its name', {\n taskRef: record.taskRef, taskId: record.taskId, paths: [...ownAlone].sort(),\n });\n }\n if (withheld.size === 0) return classified;\n this.logger.warn('A concurrent run\\'s accept withheld shared files that do not carry its own product and another writer may have written; the wave reconciliation commits them', {\n taskRef: record.taskRef,\n taskId: record.taskId,\n withheldPaths: [...withheld].sort(),\n });\n return {\n accepted: classified.accepted.filter((filePath) => !withheld.has(filePath)),\n refused: [...classified.refused, ...[...withheld].sort().map((filePath) => ({ path: filePath, reason: AcceptRefusalReason.OWN_PRODUCT_ABSENT }))],\n };\n }\n\n /**\n * The paths a concurrent run captured WITHOUT claiming them that no other writer may have written (#3215, #3218):\n * its own by elimination.\n *\n * A concurrent run's capture holds every file that moved since its baseline, its siblings' included, so a missing\n * claim says nothing about who wrote a file (#1805), and the run's accept refuses an unclaimed path. But a sibling\n * that wrote a file in this run's window has that file in its OWN capture, because its baseline preceded its write\n * and its capture followed it. So when no other recorded run may carry the path, no writer without a record is\n * beside this run ({@link OtherWriterEvidence.unrecordedWriterBeside}), and no unaccepted playbook run owns it, no\n * other lane wrote it, and the run that captured it did. That is the same evidence a single-flight run's capture\n * rests on, and the same caveat: a person's edit in the window is indistinguishable from the agent's.\n *\n * Measured on `app-creation-test-007` (F32): a config task's teardown edge in `<module>.relationships.ts`, written\n * by its agent through its shell, was refused as unclaimed while the resources config that needed it was\n * committed, and HEAD did not boot until the wave's reconciliation took the edge minutes later. Known limit: when a\n * sibling's window spanned the write, the sibling's capture holds the edge too, so it is contested and still waits\n * for the reconciliation, as one change naming both runs. No record can say which of the two wrote it.\n *\n * Empty for a run that is not concurrent: its capture is its own already.\n */\n private async unclaimedPathsNoOtherWriterMayHave(record: CodingRunWriteRecord, evidence: OtherWriterEvidence): Promise<ReadonlySet<string>> {\n if (record.concurrent !== true) return new Set();\n const unclaimed = record.files\n .filter((file) => file.claimedByRun !== true && !isAttributedToAnotherWriter(file.attribution))\n .map((file) => file.path);\n if (unclaimed.length === 0) return new Set();\n const contested = await this.pathsAnotherWriterMayHave(record, unclaimed, evidence);\n return new Set(unclaimed.filter((filePath) => !contested.has(filePath)));\n }\n\n /**\n * Of `paths`, the ones a writer OTHER than `record`'s run may have written (#3218): every path while a writer\n * without a record is beside it ({@link OtherWriterEvidence.unrecordedWriterBeside}), else the paths another\n * recorded run may carry ({@link carryTest}, the test the shared-tree door names runs by) and the paths an\n * unaccepted playbook run owns.\n */\n private async pathsAnotherWriterMayHave(record: CodingRunWriteRecord, paths: readonly string[], evidence: OtherWriterEvidence): Promise<ReadonlySet<string>> {\n const unique = [...new Set(paths)];\n if (unique.length === 0) return new Set();\n if (evidence.unrecordedWriterBeside) return new Set(unique);\n const others = evidence.records.filter((candidate) => candidate.taskId !== record.taskId);\n const carries = await this.carryTest(unique, others);\n return new Set(unique.filter((filePath) => evidence.playbookOwners.has(filePath) || others.some((other) => carries(other, filePath))));\n }\n\n /**\n * What says who else may have written in the tree while `besideRecords` ran (#3218), gathered once per door.\n *\n * A writer with no record cannot be ruled out of any path, so its presence contests every path. It is read from the\n * DURABLE actor plane (#3218 re-review H1, M2), never from this process's memory, so it holds after a restart and for\n * a person's accept days later: every coding run and every generation step whose execution span overlapped one of the\n * runs' baseline→capture windows and that has no write record. That covers a run still selected, running or parked\n * (its span is open), a generation step that threw after writing or whose register write failed, a cancelled run\n * killed before its capture, and a run another process drove.\n *\n * Fails CLOSED, counting a writer that cannot be ruled out, when a record has no baseline instant (one written before\n * the field existed), when the plane cannot be listed, or when a listing reaches its ceiling: more than 200 executions\n * of one system overlapped one window, or are open now. The settled listing is bounded by each window (#3266), so a\n * window stays answerable however many executions followed it. An OPEN row that began before a window ended contests\n * every path, including an orphan whose abort never persisted: the startup sweep settles it, and the window is\n * answerable again from then on.\n */\n private async gatherOtherWriterEvidence(input: {\n readonly besideRecords: readonly CodingRunWriteRecord[];\n readonly candidatePaths: readonly string[];\n }): Promise<OtherWriterEvidence> {\n const records = await this.codingRunWrites.list();\n const playbookOwners = await this.unacceptedPlaybookRunOwners(input.candidatePaths);\n let unrecordedWriterBeside = false;\n try {\n unrecordedWriterBeside = await this.unrecordedWriterOverlapped(input.besideRecords, records);\n } catch (error) {\n this.logDebug('Could not read the coding and generation-step executions; every path counts as another writer\\'s', { error: describeCaughtError(error) });\n unrecordedWriterBeside = true;\n }\n return { records, playbookOwners, unrecordedWriterBeside };\n }\n\n /** See {@link gatherOtherWriterEvidence}: whether an execution with no write record overlapped any of the runs' windows. */\n private async unrecordedWriterOverlapped(besideRecords: readonly CodingRunWriteRecord[], records: readonly CodingRunWriteRecord[]): Promise<boolean> {\n if (besideRecords.length === 0) return false;\n const windows = besideRecords.map((record) => ({ startMs: record.baselineCapturedAt === undefined ? Number.NaN : Date.parse(record.baselineCapturedAt), endMs: Date.parse(record.at) }));\n if (windows.some((window) => Number.isNaN(window.startMs) || Number.isNaN(window.endMs))) return true;\n const recorded = new Set(records.map((record) => record.taskId));\n const own = new Set(besideRecords.map((record) => record.taskId));\n const nowMs = Date.now();\n const toMs = (value: unknown): number => (value instanceof Date ? value.getTime() : typeof value === 'string' ? Date.parse(value) : Number.NaN);\n const latestEndMs = Math.max(...windows.map((window) => window.endMs));\n /*\n * OPEN executions first, queried by STATUS (re-review F1): a parked, selected or orphaned run is not refreshed after it\n * stops moving, so a newest-updated listing can drop it behind 200 later rows while its open span still overlaps. Any\n * open row of another run that began before a window ended contests, and a capped open listing fails closed.\n */\n for (const [systemRef, status] of OPEN_TREE_WRITER_QUERIES) {\n const open = await this.executions.listActorExecutions(CompanionExecutionsListQuerySchema.parse({ systemRef, status, limit: EXECUTION_SPAN_SCAN_LIMIT }));\n if (open.length >= EXECUTION_SPAN_SCAN_LIMIT) return true;\n for (const row of open) {\n const execution = row as { createdAt?: unknown; standaloneTasks?: ReadonlyArray<{ _id?: unknown }> };\n const taskIds = (execution.standaloneTasks ?? []).map((task) => String(task._id));\n if (taskIds.length === 0 || taskIds.some((taskId) => own.has(taskId))) continue;\n const startMs = toMs(execution.createdAt);\n if (Number.isNaN(startMs) || startMs < latestEndMs) return true;\n }\n }\n /*\n * SETTLED executions, asked PER WINDOW by the window itself (#3266): created before it ended and finished after it\n * began, which is exactly the set whose span can overlap it. A newest-UPDATED listing capped at 200 rows used to\n * stop reaching an old window once 200 later executions existed, and from then on every question about that window\n * failed closed for good: a retry could never again vouch for what an earlier run of its task left. Bounded by the\n * window, the answer no longer depends on what happened after it. Only a window more than 200 executions of one\n * system overlapped still fails closed.\n */\n for (const window of windows) {\n for (const systemRef of TREE_WRITER_SYSTEM_REFS) {\n const rows = await this.executions.listActorExecutions(CompanionExecutionsListQuerySchema.parse({\n systemRef,\n createdBefore: new Date(window.endMs).toISOString(),\n finishedAfter: new Date(window.startMs).toISOString(),\n limit: EXECUTION_SPAN_SCAN_LIMIT,\n }));\n if (rows.length >= EXECUTION_SPAN_SCAN_LIMIT) return true;\n for (const row of rows) {\n const execution = row as { createdAt?: unknown; finishedAt?: unknown; standaloneTasks?: ReadonlyArray<{ _id?: unknown }> };\n const taskIds = (execution.standaloneTasks ?? []).map((task) => String(task._id));\n if (taskIds.length === 0 || taskIds.some((taskId) => own.has(taskId)) || taskIds.every((taskId) => recorded.has(taskId))) continue;\n // The bound is the store's; the span is still checked here, so a store that ignored it cannot widen the answer.\n const startMs = toMs(execution.createdAt);\n const endMs = execution.finishedAt === undefined || execution.finishedAt === null ? nowMs : toMs(execution.finishedAt);\n if (Number.isNaN(startMs)) return true;\n if (startMs < window.endMs && (Number.isNaN(endMs) || endMs > window.startMs)) return true;\n }\n }\n }\n return false;\n }\n\n /**\n * The candidate paths a playbook run that is NOT accepted yet still OWNS (#3221), with that run: the run recorded\n * the path, the working file is still exactly what it wrote, and HEAD does not hold that yet. So the run's change is\n * in the tree and uncommitted, and its own accept is the door that commits it.\n *\n * Both conditions keep the ownership from going stale (#3221 review F4). A record can stay unaccepted for good: a\n * person edited its file before the posture's accept, or committed it by hand. Ownership keyed on the record alone\n * would then refuse that path at every coding door forever, and a build task whose product sits in it would never\n * land. Once the file has moved past what the run wrote, the run's accept refuses it as edited anyway, so a coding\n * run's later edit on top is committed by the coding run, carrying the playbook's lines with it, as any shared file\n * does. Newest run first, because its accept is the one that commits the file's current change.\n */\n private async unacceptedPlaybookRunOwners(candidatePaths: readonly string[]): Promise<PlaybookRunOwners> {\n const candidates = new Set(candidatePaths);\n const owners = new Map<string, { readonly runId: string; readonly playbookRef: string }>();\n const decided = new Set<string>();\n /*\n * A landing IN FLIGHT first (#3221 residual, closed by #3237's landing window): a playbook landing that has begun\n * writing and has no record yet owns every candidate path whose bytes moved since it began. Without this, a door\n * asked in the seconds between a landing's write and its record saw no owner and could commit the playbook's file\n * under a build task. It is the latest writer, so it outranks every record.\n */\n for (const [filePath, owner] of await this.playbookRunWrites.landingsInFlightOwners([...candidates])) {\n owners.set(filePath, owner);\n decided.add(filePath);\n }\n // `list()` is newest first.\n for (const playbookRun of await this.playbookRunWrites.list()) {\n if (playbookRun.acceptedCommitSha !== undefined) continue;\n for (const file of playbookRun.files) {\n if (!candidates.has(file.path) || decided.has(file.path)) continue;\n const working = await readFile(path.resolve(this.companionContext.saasRoot, file.path)).catch(() => undefined);\n // One test for text and binary entries (#3264): a binary write is owned while the file hashes to what it wrote.\n if (!holdsWrittenBytes(file, working)) continue;\n decided.add(file.path);\n if (await this.headHoldsWorkingFile(file.path)) continue;\n owners.set(file.path, { runId: playbookRun.runId, playbookRef: playbookRun.playbookRef });\n }\n }\n return owners;\n }\n\n /**\n * Whether HEAD already holds the working file's bytes at this path: git's own blob id of the working file against\n * HEAD's. Byte-exact for text and binary files alike (#3264), where comparing `cat-file` output as text cannot be.\n */\n private async headHoldsWorkingFile(applicationPath: string): Promise<boolean> {\n const atHead = await this.execGit(['rev-parse', '--verify', '--quiet', `HEAD:./${applicationPath}`], { acceptExitCodes: [0, 1, 128] });\n if (atHead.exitCode !== 0) return false;\n const working = await this.execGit(['hash-object', '--', applicationPath], { acceptExitCodes: [0, 128] });\n return working.exitCode === 0 && working.stdout.trim() === atHead.stdout.trim();\n }\n\n /**\n * `git add -- <paths>` then `git commit -F <message> -- <paths>`. A deleted path is staged as a\n * removal by the same `add`. When the paths are already identical to HEAD there is nothing to\n * commit, and that is answered as `alreadyCommitted` with the commit that last changed those paths rather than as a failure.\n *\n * **Closed under its own imports first (#2332).** Every door commits through here, so the closure cannot be\n * skipped by a door that forgot it; `closure` is required, so each door states what it does with an import\n * its commit would not resolve. A carried dossier module joins the paths, and the message names it in a\n * paragraph of its own just before the trailers, so the history says the commit holds a file no run wrote.\n */\n private async commitPaths(\n requestedPaths: readonly string[],\n requestedMessage: string,\n origin: AcceptOrigin,\n closure: ImportClosurePolicy,\n /** Paths committed with these bytes instead of the working file (#2418). Empty: every path from the working tree. */\n committedContent: ReadonlyMap<string, string> = new Map(),\n /** Only the decision door ({@link commitDecisionRecord}) may commit a person's build-task decisions. */\n permitsPersonDecisionRecord = false,\n ): Promise<Omit<AcceptedChangeCommitOutcome, 'refusedPaths'> & { readonly commitSha: string }> {\n /*\n * The backstop behind every door's own refusal (review of 8d6b95d29): a person's decision record reaches a commit only\n * through the decision door. Any other door reaching here with it is a defect in that door, so the commit fails closed.\n */\n const decisionRecords = requestedPaths.filter((requested) => isBuildTaskDecisionsPath(requested, this.companionContext));\n if (decisionRecords.length > 0 && !permitsPersonDecisionRecord) {\n throw new AcceptedChangeCommitError(`Refusing to commit ${decisionRecords.join(', ')}: only a person records build-task decisions, through \\`wildo build close\\` or \\`wildo build approve\\`.`, '');\n }\n const closed = await this.closeOverImports(requestedPaths, closure, committedContent);\n const paths = closed.paths;\n const message = withAcceptanceTrailers(closed.carried.length === 0 ? requestedMessage : withCarriedParagraph(requestedMessage, closed.carried), origin);\n if (committedContent.size > 0) return this.commitThroughTemporaryIndex(paths, message, origin, committedContent, closed.carried);\n /*\n * Every commit here runs inside the workspace-mutation lock. If that lock was taken from this holder\n * while it ran (#2225), another writer may be in the index now, so committing \"as the exclusive\n * writer\" would attribute its work to this run. Asked before staging and again before committing,\n * because a loss can land between the two. Outside any lock this is a no-op.\n */\n assertHeldFileLocksIntact();\n await this.execGit(['add', '--', ...paths]);\n const staged = await this.execGit(['diff', '--cached', '--quiet', '--', ...paths], { acceptExitCodes: [0, 1] });\n if (staged.exitCode === 0) {\n /*\n * The commit that last changed these paths, never merely HEAD (#1805 review N6): HEAD may be any\n * later, unrelated commit, and a record marked accepted \"on\" it would name a commit holding none of\n * the run's work. Falls back to HEAD only for paths git has no history for.\n */\n const lastTouching = (await this.execGit(['log', '-1', '--format=%H', '--', ...paths])).stdout.trim();\n const commitSha = lastTouching || (await this.execGit(['rev-parse', 'HEAD'])).stdout.trim();\n this.logDebug('Nothing to commit: every accepted path already matches HEAD', { paths, commitSha });\n return { commitSha, committedPaths: [...paths], carriedPaths: closed.carried, alreadyCommitted: true, message };\n }\n const messagePath = path.join(tmpdir(), `wildo-accept-${process.pid}-${Date.now()}.txt`);\n await writeFile(messagePath, `${message}\\n`, 'utf8');\n try {\n // assurance-control: WILDO.SOFTWARE.AI_PRODUCED_CHANGE_CONTROL — the pathspec commit carries the author its accept origin names.\n const author = acceptOriginAuthor(origin);\n assertHeldFileLocksIntact();\n await this.execGit(['commit', '--quiet', ...(author ? [`--author=${author}`] : []), '-F', messagePath, '--', ...paths]);\n } finally {\n await unlink(messagePath).catch(() => undefined);\n }\n const commitSha = (await this.execGit(['rev-parse', 'HEAD'])).stdout.trim();\n this.logDebug('Accepted a run as a commit', { commitSha, paths: paths.length, carried: closed.carried });\n return { commitSha, committedPaths: [...paths], carriedPaths: closed.carried, alreadyCommitted: false, message };\n }\n\n /**\n * A commit whose tree holds some paths with bytes OTHER than the working file's (#2418): built in a temporary index\n * from HEAD, so neither the shared index nor anyone else's staging is part of it, and moved onto HEAD only if HEAD is\n * still where the commit was built from. The shared index is then pointed at what was committed for these paths\n * only, so it does not read as a staged revert of this commit; a merged path's later lines stay unstaged in the\n * working tree, where they belong to the run that wrote them.\n */\n private async commitThroughTemporaryIndex(\n paths: readonly string[],\n message: string,\n origin: AcceptOrigin,\n committedContent: ReadonlyMap<string, string>,\n carried: readonly string[],\n ): Promise<Omit<AcceptedChangeCommitOutcome, 'refusedPaths'> & { readonly commitSha: string }> {\n const base = (await this.execGit(['rev-parse', 'HEAD'])).stdout.trim();\n /*\n * `update-index --cacheinfo` takes a path from the REPOSITORY root, not from `-C`, unlike every other command here.\n * An application nested in its repository (every dogfood application) needs the prefix git reports for it.\n */\n const prefix = (await this.execGit(['rev-parse', '--show-prefix'])).stdout.replace(/\\r?\\n$/u, '');\n const directory = await mkdtemp(path.join(tmpdir(), 'wildo-accept-index-'));\n const env = { GIT_INDEX_FILE: path.join(directory, 'index') };\n try {\n assertHeldFileLocksIntact();\n await this.execGit(['read-tree', base], { env });\n const fromWorkingTree = paths.filter((applicationPath) => !committedContent.has(applicationPath));\n if (fromWorkingTree.length > 0) await this.execGit(['add', '--', ...fromWorkingTree], { env });\n for (const [applicationPath, content] of committedContent) {\n const blobFile = path.join(directory, 'blob');\n await writeFile(blobFile, content, 'utf8');\n const blob = (await this.execGit(['hash-object', '-w', blobFile])).stdout.trim();\n const listed = (await this.execGit(['ls-tree', base, '--', applicationPath])).stdout.trim();\n const mode = listed.split(/\\s+/u)[0] || '100644';\n await this.execGit(['update-index', '--add', '--cacheinfo', `${mode},${blob},${prefix}${applicationPath}`], { env });\n }\n const staged = await this.execGit(['diff', '--cached', '--quiet', base, '--', ...paths], { acceptExitCodes: [0, 1], env });\n if (staged.exitCode === 0) {\n const lastTouching = (await this.execGit(['log', '-1', '--format=%H', '--', ...paths])).stdout.trim();\n return { commitSha: lastTouching || base, committedPaths: [...paths], carriedPaths: carried, alreadyCommitted: true, message };\n }\n const tree = (await this.execGit(['write-tree'], { env })).stdout.trim();\n const messagePath = path.join(directory, 'message');\n await writeFile(messagePath, `${message}\\n`, 'utf8');\n // assurance-control: WILDO.SOFTWARE.AI_PRODUCED_CHANGE_CONTROL — the temporary-index commit carries the same author, so neither commit writer can attribute an automatic acceptance to a person.\n const author = parseGitIdentity(acceptOriginAuthor(origin));\n const commitSha = (await this.execGit(['commit-tree', tree, '-p', base, '-F', messagePath], {\n env: author ? { GIT_AUTHOR_NAME: author.name, GIT_AUTHOR_EMAIL: author.email } : {},\n })).stdout.trim();\n assertHeldFileLocksIntact();\n await this.execGit(['update-ref', '-m', 'wildo accept', 'HEAD', commitSha, base]);\n for (const applicationPath of paths) {\n const listed = (await this.execGit(['ls-tree', commitSha, '--', applicationPath])).stdout.trim();\n const [mode, , blob] = listed.split(/\\s+/u);\n if (mode && blob) await this.execGit(['update-index', '--add', '--cacheinfo', `${mode},${blob},${prefix}${applicationPath}`]);\n // Deleted by this commit: the shared index must not keep the old blob, or it reads as a staged re-add.\n else await this.execGit(['update-index', '--force-remove', '--', applicationPath]);\n }\n this.logDebug('Accepted a run as a commit with merged paths', { commitSha, paths: paths.length, merged: [...committedContent.keys()] });\n return { commitSha, committedPaths: [...paths], carriedPaths: carried, alreadyCommitted: false, message };\n } finally {\n await rm(directory, { recursive: true, force: true }).catch(() => undefined);\n }\n }\n\n /**\n * The paths a commit must hold for its tree to resolve its own relative imports (#2332), under `policy`.\n * Throws {@link AcceptWouldLeaveUnresolvedImportError} before anything is staged when the policy refuses.\n */\n private async closeOverImports(\n paths: readonly string[],\n policy: ImportClosurePolicy,\n committedContent: ReadonlyMap<string, string> = new Map(),\n ): Promise<{ readonly paths: readonly string[]; readonly carried: readonly string[] }> {\n const dossier = this.dossierModulePaths();\n const closed = await closeCommitOverRelativeImports({\n saasRoot: this.companionContext.saasRoot,\n paths,\n isCarriable: (applicationPath) => dossier.has(applicationPath),\n presentAtHead: (candidates) => this.presentAtHead(candidates),\n differingFromHead: (candidates) => this.uncommittedAmong(candidates),\n ...(committedContent.size > 0 ? { committedContent } : {}),\n });\n if (closed.unresolved.length > 0) {\n if (policy === ImportClosurePolicy.REFUSE_UNRESOLVED) throw new AcceptWouldLeaveUnresolvedImportError(await this.withWriters(closed.unresolved));\n // Debug, not warn: under this policy it is the expected transient of a wave, and the TypeScript build is the floor.\n this.logDebug('A commit leaves relative imports its tree does not resolve; a sibling run\\'s accept or the wave reconciliation is expected to commit them', {\n unresolved: closed.unresolved,\n });\n }\n return { paths: closed.paths, carried: closed.carried };\n }\n\n /** Each unresolved import with the unaccepted playbook run that wrote its module, newest first, when one did. */\n private async withWriters(unresolved: readonly UnresolvedCommitImport[]): Promise<readonly UnresolvedImportWithWriter[]> {\n const pending = (await this.playbookRunWrites.list()).filter((record) => record.acceptedCommitSha === undefined);\n return unresolved.map((entry) => {\n const writer = entry.workingTreeModule === undefined\n ? undefined\n : pending.find((record) => record.files.some((file) => file.path === entry.workingTreeModule));\n return writer ? { ...entry, writtenBy: { runId: writer.runId, playbookRef: writer.playbookRef } } : entry;\n });\n }\n\n /** The dossier families whose module is among `paths`, in {@link DOSSIER_FAMILIES} order. */\n private dossierFamiliesOf(paths: readonly string[]): readonly ApplicationSpecificationFamily[] {\n const specificationsPackageRoot = this.companionContext.resolvedSpecifications?.packageRoot;\n if (!specificationsPackageRoot) return [];\n const specificationsRelativeRoot = path.relative(this.companionContext.saasRoot, specificationsPackageRoot).split(path.sep).join('/');\n return DOSSIER_FAMILIES.filter((family) => {\n const relative = getFamilyPackageRelativePath(family);\n return relative !== undefined && paths.includes(path.posix.join(specificationsRelativeRoot, relative));\n });\n }\n\n /** The dossier's module files, application-relative; empty when the application declares no specifications package. */\n private dossierModulePaths(): Set<string> {\n const specificationsPackageRoot = this.companionContext.resolvedSpecifications?.packageRoot;\n if (!specificationsPackageRoot) return new Set();\n const specificationsRelativeRoot = path.relative(this.companionContext.saasRoot, specificationsPackageRoot).split(path.sep).join('/');\n return new Set(DOSSIER_FAMILIES\n .map((family) => getFamilyPackageRelativePath(family))\n .filter((relative): relative is string => relative !== undefined)\n .map((relative) => path.posix.join(specificationsRelativeRoot, relative)));\n }\n\n /** Which of these application-relative paths HEAD holds as files. `-r`, so a directory pathspec never answers for itself. */\n private async presentAtHead(paths: readonly string[]): Promise<ReadonlySet<string>> {\n if (paths.length === 0) return new Set();\n const listed = await this.execGit(['ls-tree', '-r', '--name-only', '-z', 'HEAD', '--', ...paths], { acceptExitCodes: [0, 128] });\n // 128: no HEAD yet (an unborn branch), which holds nothing.\n if (listed.exitCode !== 0) return new Set();\n return new Set(listed.stdout.split('\\0').filter((entry) => entry.length > 0));\n }\n\n /**\n * Commit the creator's DOSSIER on its own (#2332): `wildo creation accept --dossier`.\n *\n * An answer, an interview depth and a governance-fact landing each write the dossier and commit nothing (a\n * landed dossier is a working edit until a person accepts it, `one-source-of-truth.md` rules 2 and 3). A run\n * that reads the dossier carries it into its own accept; this is the door for answers no accepted run has read\n * yet, and the one `wildo creation depth` names.\n *\n * What it commits: every dossier module that differs from HEAD, and, when one of them is NEW at HEAD, the two\n * aggregate files that wire it (`src/companion-exports.ts`, `src/index.ts`), since a module HEAD does not hold\n * is a module HEAD's aggregate does not read yet. Those files are committed whole, so they carry any other\n * family's wiring line too: the import closure then refuses by name when such a line points at a module no\n * commit holds yet, and the fix is to accept the run that wrote it first.\n *\n * Taken inside the dossier write queue, so no answer lands between what is read and what is committed. A\n * person's accept waits for a live coding run, as every person's accept does.\n */\n public async acceptDossier(input: { readonly origin?: AcceptOrigin } = {}): Promise<AcceptedChangeCommitOutcome> {\n const origin = input.origin ?? AcceptOrigin.OPERATOR;\n await this.refuseWhileACodingRunWrites(origin);\n const specificationsPackageRoot = this.companionContext.resolvedSpecifications?.packageRoot;\n if (!specificationsPackageRoot) {\n throw new NothingToAcceptError('No specifications package is declared in wildo.saas.config.ts, so there is no dossier to commit.');\n }\n return serializeDossierWrite(specificationsPackageRoot, async () => {\n const dossier = [...this.dossierModulePaths()];\n const differing = await this.uncommittedAmong(dossier);\n const changed = dossier.filter((filePath) => differing.has(filePath));\n if (changed.length === 0) throw new NothingToAcceptError('The dossier has no uncommitted answers; there is nothing to accept.');\n const atHead = await this.presentAtHead(changed);\n const specificationsRelativeRoot = path.relative(this.companionContext.saasRoot, specificationsPackageRoot).split(path.sep).join('/');\n const aggregate = ['src/companion-exports.ts', 'src/index.ts'].map((relative) => path.posix.join(specificationsRelativeRoot, relative));\n const wiringDiffers = await this.uncommittedAmong(aggregate);\n const wiring = changed.some((filePath) => !atHead.has(filePath)) ? aggregate.filter((filePath) => wiringDiffers.has(filePath)) : [];\n const paths = [...changed, ...wiring];\n const message = [\n 'Record the creator\\'s answers (the dossier)',\n '',\n `${ACCEPT_ORIGIN_SENTENCE[origin]}: the dossier as it stands — the answers and decisions the creator recorded, which runs read their inputs from.`,\n '',\n ...paths.map((filePath) => `- ${filePath}`),\n '',\n `${DOSSIER_TRAILER}: ${this.dossierFamiliesOf(changed).join(', ')}`,\n ].join('\\n');\n const outcome = await this.commitPaths(paths, message, origin, ImportClosurePolicy.REFUSE_UNRESOLVED);\n return { ...outcome, refusedPaths: [] };\n });\n }\n\n /**\n * Commit an expert charter a person accepted by hand (#2419), as the accept's own change.\n *\n * `wildo creation persona accept <role>` IS a person accepting: acceptance is a commit (`one-source-of-truth.md`\n * rule 2), and before this the charter, its aggregator and its wiring reached git only by a hand commit, which on\n * app-creation-test-005 was made twice. Each file is committed as `previousContent → writtenContent` merged onto\n * HEAD, the route a run's shared files take since #2418, so the wiring commit carries this charter's lines and no\n * other family's. All or nothing: if any file's change conflicts with HEAD, nothing is committed and the refusal names\n * the files (a charter committed without its wiring exports nothing). A staffing run does not come here; it records\n * its writes for the run's own accept.\n */\n public async acceptExpertCharter(input: {\n readonly roleRef: string;\n readonly writes: readonly { readonly path: string; readonly previousContent?: string; readonly writtenContent: string }[];\n readonly origin?: AcceptOrigin;\n }): Promise<AcceptedChangeCommitOutcome> {\n const origin = input.origin ?? AcceptOrigin.OPERATOR;\n await this.refuseWhileACodingRunWrites(origin);\n const commit = async (): Promise<AcceptedChangeCommitOutcome> => {\n const committedContent = new Map<string, string>();\n const refused: AcceptRefusal[] = [];\n for (const write of input.writes) {\n const merged = await this.mergeRunChangeOntoHead(write.path, write.previousContent, write.writtenContent);\n if (merged === undefined) refused.push({ path: write.path, reason: AcceptRefusalReason.EDITED_SINCE_THE_RUN });\n else committedContent.set(write.path, merged);\n }\n /*\n * All or nothing. A charter committed without its wiring is the \"module without its wiring\" commit #2418 removed\n * (it compiles and exports nothing); the accept is on disk either way, and the refusal names what to commit.\n */\n if (committedContent.size === 0 || refused.length > 0) {\n throw new NothingToAcceptError(\n `The ${input.roleRef} charter accept cannot be committed as its own change: ${refused.map((entry) => entry.path).join(', ') || 'nothing changed'} `\n + 'conflicts with HEAD (usually another run\\'s uncommitted wiring next to it). Accept that run first, or commit these files by hand.',\n refused,\n );\n }\n const paths = [...committedContent.keys()];\n const message = [\n `Accept the ${input.roleRef} expert charter`,\n '',\n `${ACCEPT_ORIGIN_SENTENCE[origin]}: the charter promoted by \\`wildo creation persona accept ${input.roleRef}\\`, with the aggregator and the wiring it changed.`,\n '',\n ...paths.map((filePath) => `- ${filePath}`),\n '',\n `${EXPERT_CHARTER_TRAILER}: ${input.roleRef}`,\n ].join('\\n');\n const outcome = await this.commitPaths(paths, message, origin, ImportClosurePolicy.REFUSE_UNRESOLVED, committedContent);\n return { ...outcome, refusedPaths: [] };\n };\n const specificationsPackageRoot = this.companionContext.resolvedSpecifications?.packageRoot;\n return specificationsPackageRoot ? serializeDossierWrite(specificationsPackageRoot, commit) : commit();\n }\n\n /**\n * Commit a DECISION the creator (or their agent) just recorded in a specification file, at the moment it\n * is recorded (#1609): opening a playbook instance is a decision about product scope, and a decision that\n * lives only as a working edit is lost to a checkout and invisible to a re-clone.\n *\n * The caller holds the workspace lock around the write and this commit, so no coding run's baseline can\n * see the file half-recorded. The message carries the purpose and the actor as trailers\n * (`Wildo-Purpose:`, `Wildo-Actor:`), because the author is the companion under the automatic posture.\n */\n public async commitDecisionRecord(input: {\n readonly paths: readonly string[];\n /** One line: what was decided. */\n readonly summary: string;\n readonly purpose: string;\n readonly actor: DecisionRecordActor;\n readonly origin: AcceptOrigin;\n /**\n * Set ONLY by the build-task decision door (`wildo build close` / `approve`, #3224): the one caller that may commit a\n * person's build-task decisions. Keyed on the door, not on the actor, so another decision record a creator makes can\n * never carry that file.\n */\n readonly recordsBuildTaskDecisions?: true;\n /** The door's nonce for this decision (#3284), written as the `Wildo-Decision-Id` trailer. Door-only, with the flag above. */\n readonly decisionId?: string;\n }): Promise<Omit<AcceptedChangeCommitOutcome, 'refusedPaths'> & { readonly commitSha: string }> {\n const message = [\n input.summary,\n '',\n `${ACCEPT_ORIGIN_SENTENCE[input.origin]}: a decision recorded in the application's specifications.`,\n '',\n `${DECISION_PURPOSE_TRAILER}: ${input.purpose.replace(/\\s+/gu, ' ').trim()}`,\n `${AcceptedChangeTrailerKey.ACTOR}: ${input.actor}`,\n ...(input.recordsBuildTaskDecisions === true && input.decisionId !== undefined ? [`${AcceptedChangeTrailerKey.DECISION_ID}: ${input.decisionId}`] : []),\n ].join('\\n');\n // Only the build-task decision door may commit a person's build-task decisions (#3224, #3227).\n const outcome = await this.commitPaths(input.paths, message, input.origin, ImportClosurePolicy.REFUSE_UNRESOLVED, new Map(), input.recordsBuildTaskDecisions === true);\n return outcome;\n }\n\n /** `git -C <saasRoot> <args>` — argv array, never a shell; the subcommand MUST be in the allow-list. */\n private async execGit(\n args: readonly string[],\n options: { readonly acceptExitCodes?: readonly number[]; readonly env?: Readonly<Record<string, string>> } = {},\n ): Promise<{ stdout: string; stderr: string; exitCode: number }> {\n const subcommand = args[0];\n if (!subcommand || !ACCEPT_GIT_SUBCOMMANDS.has(subcommand)) {\n throw new AcceptedChangeCommitError(`Git subcommand '${subcommand ?? '<none>'}' is outside the companion's acceptance carve-out.`, '');\n }\n try {\n const argv = ['-C', this.companionContext.saasRoot, ...args];\n const execOptions = {\n timeout: GIT_TIMEOUT_MS,\n // `cat-file -p` and `merge-file -p` print whole files; Node's 1 MiB default would throw on a large one.\n maxBuffer: GIT_MAX_BUFFER_BYTES,\n /*\n * Literal pathspecs: every path here is a FILE the register named, and a route file such as\n * `[slug].astro` is a glob otherwise (#1805 review R8). No optional locks: `status` would refresh\n * the index's stat cache and take `index.lock` while another session commits (R7).\n */\n env: { ...process.env, GIT_TERMINAL_PROMPT: '0', GIT_LITERAL_PATHSPECS: '1', GIT_OPTIONAL_LOCKS: '0', ...(options.env ?? {}) },\n };\n /*\n * A read goes through the git read helper (#3204): forking `git` from the companion's 2 GB process blocked its event\n * loop. A WRITE (add, commit, update-ref…) stays a direct spawn, the only kind the companion's write recording sees.\n */\n const result = isBrokerableGitInvocation(argv) ? await gitReadBroker.execGit(argv, execOptions) : await execFileAsync('git', argv, execOptions);\n return { ...result, exitCode: 0 };\n } catch (error) {\n const failure = error as { code?: unknown; stdout?: string; stderr?: string };\n const exitCode = typeof failure.code === 'number' ? failure.code : -1;\n if (options.acceptExitCodes?.includes(exitCode)) {\n return { stdout: failure.stdout ?? '', stderr: failure.stderr ?? '', exitCode };\n }\n throw new AcceptedChangeCommitError(\n `git ${args.join(' ')} failed: ${describeCaughtError(error)}${failure.stderr ? ` — ${failure.stderr.slice(0, 1_000)}` : ''}`,\n failure.stderr ?? '',\n );\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"accepted-change-commit.companion.service.js","sourceRoot":"","sources":["../../../../src/claude-cli/services/accepted-change-commit.companion.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAClF,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAG/C,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACrF,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,EAAE,kBAAkB,EAAE,4BAA4B,EAAE,MAAM,wCAAwC,CAAC;AAC1G,OAAO,EACL,YAAY,EACZ,wBAAwB,EACxB,8BAA8B,EAC9B,uBAAuB,EACvB,wBAAwB,EACxB,uBAAuB,GACxB,MAAM,oDAAoD,CAAC;AAE5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AAEjF,OAAO,EAAE,aAAa,EAAE,yBAAyB,EAAE,MAAM,4CAA4C,CAAC;AACtG,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,wCAAwC,EAAE,4BAA4B,EAAE,MAAM,6EAA6E,CAAC;AACxO,O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B,CAAC,CAAA;IAC7D,WAAA,MAAM,CAAC,uBAAuB,CAAC,+BAA+B,CAAC,CAAA;IAC/D,WAAA,MAAM,CAAC,uBAAuB,CAAC,iBAAiB,CAAC,CAAA;uDAF+C,sCAAsC;QAClC,wCAAwC;GAPpI,oCAAoC,CAs5ChD","sourcesContent":["import { execFile } from 'node:child_process';\nimport { mkdtemp, readFile, rm, stat, unlink, writeFile } from 'node:fs/promises';\nimport { tmpdir } from 'node:os';\nimport * as path from 'node:path';\nimport { promisify } from 'node:util';\nimport { inject, injectable } from 'inversify';\n\nimport type { LoggerService } from '@wildo-ai/saas-backend-lib';\nimport { SAAS_SERVICE_TYPES, describeCaughtError } from '@wildo-ai/saas-backend-lib';\nimport { assertHeldFileLocksIntact } from '@wildo-ai/platform-config-lib';\nimport { CandidateDropScope, getFamilyPackageRelativePath } from '@wildo-ai/application-creation-runtime';\nimport {\n AcceptOrigin,\n AcceptedChangeTrailerKey,\n ApplicationSpecificationFamily,\n COMPANION_COMMIT_AUTHOR,\n LANE_COMMIT_TRAILER_KEYS,\n isAutomaticAcceptOrigin,\n} from '@wildo-ai/saas-specifications/application-creation';\n\nimport { COMPANION_SERVICE_TYPES } from '../../core/inject/models/service-types';\nimport type { CompanionContext } from '../../core/context/companion-context';\nimport { gitReadBroker, isBrokerableGitInvocation } from '../../core/utils/git-read-broker.companion';\nimport { holdsWrittenBytes, isBinaryWrittenFile, PlaybookRunFileSuccession, PlaybookRunWriteRegisterCompanionService, researchScreeningCommitLines } from '../../meta-workflows/services/playbook-run-write-register.companion.service';\nimport { ChangeSetAttributionClass, ChangeSetFileChangeKind, isAttributedToAnotherWriter } from '../models/coding-agent-dispatch.models';\nimport { RESEARCH_EVIDENCE_RELATIVE_ROOT } from './research-evidence-store.companion';\nimport { CodingRunWriteRegisterCompanionService, sha256Hex, type CodingRunWriteRecord } from './coding-run-write-register.companion.service';\nimport { listInFlightCodingRuns } from './in-flight-coding-runs.companion';\nimport { FlowsActors_Status } from '@wildo-ai/saas-models';\nimport { CompanionExecutionsListQuerySchema } from '../../companion-api/companion-api.schemas';\nimport { APPLICATION_CODING_SYSTEM_REF } from '../../meta-workflows/models/application-coding-agent.actors-system.definitions';\nimport { APPLICATION_BUILD_SYSTEM_REF } from '../../meta-workflows/models/application-build.actors-system.definitions';\nimport type { CompanionExecutionsCompanionService } from '../../executions/services/companion-executions.companion.service';\nimport { serializeDossierWrite } from '../../meta-workflows/services/dossier-write-queue.companion.utils';\nimport { closeCommitOverRelativeImports, type UnresolvedCommitImport } from './accepted-change-import-closure.companion';\nimport { APPLICATION_CREATION_AUTONOMY_POSTURE } from '../../meta-workflows/models/playbook-run-checkpoint.models';\nimport { isBuildTaskDecisionsPath } from '../../meta-workflows/models/build-task-decisions-path.models';\n\nconst execFileAsync = promisify(execFile);\n\n/**\n * ACCEPTANCE as a commit, from the workbench (#1454, Step 7).\n *\n * # The one write door in the companion's git carve-out, and why it exists\n *\n * DD-8 (`.claude/context/dev-companion.md`) keeps git plumbing CLI-side; the companion's\n * `GitChangeSetCompanionService` is a documented READ-ONLY carve-out. This service is the second,\n * WRITE-shaped carve-out, and it is narrower than the first in every dimension that matters:\n *\n * - **Two WRITE subcommands, pathspec-bounded.** `git add -- <paths>` and `git commit -F <msg> -- <paths>`,\n * where `<paths>` is exactly what a run's write register names, taken literally. Never `add -A`, never\n * `commit -a`, never a path the register does not hold, with ONE named exception (#2332): the creator's\n * DOSSIER, carried when a committed file imports it, so a commit never leaves HEAD importing a module it\n * does not hold (see `ImportClosurePolicy`). The subcommand allow-list is a guard, not\n * documentation: `execGit` refuses anything else before spawning, as the read-only service's does; the\n * other subcommands on it only read.\n * - **On a person's word, or on the posture's.** The workbench `accept` operations (a person, per run);\n * the coding dispatch loop when a run concluded with a working\n * result AND `laneBoundaryTreatmentFor(APPLICATION_CREATION_AUTONOMY_POSTURE, APPROVE_RESULT)` says\n * notify-and-proceed — the YOLO posture `one-source-of-truth.md` D5 records: *\"the system commits,\n * the human is notified and can override.\"* Under GUIDED the loop does not call it and acceptance\n * stays the person's. Until #1534 only the first caller existed, so the decided posture was not the\n * one the lane ran under: an unattended run stopped after its first task, and the 2026-09-23 run\n * was carried by an operator's shell loop running `git add -A` between dispatches. Since #3204 the loop no\n * longer commits per run at all: it commits BUILD CHECKPOINTS (`commitBuildCheckpoint`), and this door is the\n * person's (the workbench, `wildo build accept`), under the reviewing posture.\n * - **This door never widens what is committed.** Without `force` every refusal below applies — a path it\n * cannot vouch for stays uncommitted, and the refusal is on the record.\n * The automatic origins `WAVE_RECONCILIATION` and `INTERRUPTED_RUN_RECOVERY` are the build checkpoint's (#3204): it\n * commits the tree as it stands, minus a person's decisions and an unaccepted playbook run's files (#3221), naming the\n * runs it carries, and judges no path by run.\n * - **It refuses what it cannot vouch for, by name.** A path that was already dirty at the run's\n * baseline may carry another session's hunks (`BASELINE_DIRTY_AMBIGUOUS`); a path whose bytes are\n * no longer what the run left was edited since; a path a parallel commit or another lane produced\n * is not this run's at all. The first two are refused unless `force`; the third always.\n *\n * Routing this through the CLI was considered and rejected for the reason DD-8's first carve-out\n * gives: the CLI calls the companion, never the reverse, and the browser workbench cannot reach a\n * CLI at all. The register that names the paths lives here, so the commit that accepts them does too.\n *\n * # What a commit here means\n *\n * The pathspec form (`git commit -- <paths>`) commits those paths from the WORKING TREE and leaves\n * every other staged entry exactly as its author left it — the same discipline a human session in\n * this repository follows when files carry foreign hunks. The message names the run, so\n * `git log -S` and a reader both find why the change exists.\n */\n\n/**\n * Every git subcommand this service may invoke. The WRITES (`add`, `commit`) are the only git writes in the\n * companion; the rest only read. `status` and `log` read too (#1805): which of a set of paths still differ\n * from HEAD, and which commit last changed them. Neither stages, commits or moves a ref, and `status` runs\n * with optional locks off, so it does not even refresh the index's stat cache. `ls-tree` (#2332) reads which\n * paths HEAD holds, for the import closure a commit must satisfy.\n */\n/*\n * `merge-file`, `cat-file`, `hash-object`, `read-tree`, `update-index`, `write-tree`, `commit-tree` and `update-ref` serve one\n * route only (#2418): a playbook run's share of a file a later run rewrote is MERGED onto HEAD and committed through a\n * temporary index, never the working file. `update-ref` always carries the expected old value, so it refuses a moved HEAD.\n */\nconst ACCEPT_GIT_SUBCOMMANDS: ReadonlySet<string> = new Set([\n 'add', 'commit', 'rev-parse', 'diff', 'status', 'log', 'ls-tree',\n 'merge-file', 'cat-file', 'hash-object', 'read-tree', 'update-index', 'write-tree', 'commit-tree', 'update-ref',\n]);\nconst GIT_TIMEOUT_MS = 60_000;\n/**\n * How many executions one question of the overlap test reads (the list's own ceiling). Reached, the test fails closed:\n * more than this many executions of one system overlapped ONE window (settled), or are open now, which no ordinary build\n * produces. Since #3266 the settled listing is bounded by the window itself, so later executions never count against it.\n */\nconst EXECUTION_SPAN_SCAN_LIMIT = 200;\n/**\n * Whether an execution in each status has a span that is still OPEN: it may write the tree now or later, and it has no\n * finish instant to bound it. TOTAL over the vocabulary, so a status added tomorrow is a compile error here until\n * someone decides whether it can write. A terminal row always carries `finishedAt` (every terminal write stamps it),\n * which is what lets the settled listing be bounded by finish time.\n */\nconst STATUS_SPAN_IS_OPEN: Readonly<Record<FlowsActors_Status, boolean>> = {\n [FlowsActors_Status.READY]: true,\n [FlowsActors_Status.PENDING]: true,\n [FlowsActors_Status.PROCESSING]: true,\n [FlowsActors_Status.AWAITING_APPROVAL]: true,\n [FlowsActors_Status.COMPLETED]: false,\n [FlowsActors_Status.FAILED]: false,\n [FlowsActors_Status.CANCELLED]: false,\n [FlowsActors_Status.ABORTED]: false,\n};\n/** The two systems whose executions write the application's tree: coding runs and generation steps. */\nconst TREE_WRITER_SYSTEM_REFS: readonly string[] = [APPLICATION_CODING_SYSTEM_REF, APPLICATION_BUILD_SYSTEM_REF];\n/**\n * The not-yet-settled executions that may have written the tree, asked by STATUS (re-review F1 of #3218): every open\n * status of both systems, derived from {@link STATUS_SPAN_IS_OPEN} rather than listed by hand.\n */\nconst OPEN_TREE_WRITER_QUERIES: ReadonlyArray<readonly [string, FlowsActors_Status]> = TREE_WRITER_SYSTEM_REFS.flatMap((systemRef) =>\n (Object.keys(STATUS_SPAN_IS_OPEN) as FlowsActors_Status[]).filter((status) => STATUS_SPAN_IS_OPEN[status]).map((status) => [systemRef, status] as const));\nconst GIT_MAX_BUFFER_BYTES = 64 * 1024 * 1024;\n\n/**\n * Who took a DECISION recorded in a specification file (#1609): the creator, or the agent acting in their\n * conversation. Under the automatic posture the companion AUTHORS every such commit, so this trailer is the\n * only place the difference survives.\n */\nexport enum DecisionRecordActor {\n CREATOR = 'creator',\n AGENT = 'agent',\n}\n\n/**\n * The author an accept origin commits under: the companion's own identity (`COMPANION_COMMIT_AUTHOR`, whose JSDoc\n * gives the reasons) for an origin the system makes, and `undefined` for a person's, so git's own configured identity is\n * the truthful author then. Derived from the engine's `isAutomaticAcceptOrigin`, so which origins are automatic is\n * decided in one place.\n * assurance-control: WILDO.SOFTWARE.AI_PRODUCED_CHANGE_CONTROL — an automatic acceptance is authored by the companion's own identity and a person's by theirs, so the history names who accepted each change.\n */\nfunction acceptOriginAuthor(origin: AcceptOrigin): string | undefined {\n return isAutomaticAcceptOrigin(origin) ? `${COMPANION_COMMIT_AUTHOR.name} <${COMPANION_COMMIT_AUTHOR.email}>` : undefined;\n}\n\n/** `git merge-file` exits with the number of conflicts, capped at 127; a negative value (an error) still throws. */\nconst MERGE_FILE_CONFLICT_EXIT_CODES: readonly number[] = Array.from({ length: 127 }, (_, index) => index + 1);\n\n/** `Name <email>` as git's two author variables, for `commit-tree`, which takes no `--author`. */\nfunction parseGitIdentity(identity: string | undefined): { readonly name: string; readonly email: string } | undefined {\n const match = identity === undefined ? null : /^(.*?)\\s*<([^>]+)>$/u.exec(identity);\n return match ? { name: match[1]!, email: match[2]! } : undefined;\n}\n\n/**\n * The trailers this service writes, and by which its own commits are recognised later. Every commit this\n * service makes goes through `commitPaths`, a pathspec commit of the files as they stand, and carries one of\n * these as its last paragraph: a coding run's accept or a joint commit, a playbook run's accept, a recorded\n * decision. So a commit carrying one took the whole working file, which is what lets the may-carry test end\n * a run's claim on a path (#1805 review 6 G1). Recognised by KEY, never by value (review 7 L1).\n */\nconst CODING_RUN_TRAILER = AcceptedChangeTrailerKey.CODING_RUN;\nconst PLAYBOOK_RUN_TRAILER = AcceptedChangeTrailerKey.PLAYBOOK_RUN;\nconst DECISION_PURPOSE_TRAILER = AcceptedChangeTrailerKey.PURPOSE;\n/** The dossier's own commit (#2332): the creator's recorded answers, committed on their own. */\nconst DOSSIER_TRAILER = AcceptedChangeTrailerKey.DOSSIER;\n/** A charter a person accepted by hand (#2419): `wildo creation persona accept`, outside any staffing run. */\nconst EXPERT_CHARTER_TRAILER = AcceptedChangeTrailerKey.EXPERT_CHARTER;\nconst LANE_COMMIT_TRAILERS: readonly string[] = LANE_COMMIT_TRAILER_KEYS;\n\n/**\n * The families that make up the creator's DOSSIER (#1454): their answers, and the governed-document facts\n * only a person may establish. Both are landed by a door that owns no commit (an answer, a depth, a\n * governance-fact landing), and both are wired into the specifications aggregate when they first land. So a\n * later commit of that aggregate imports them, and this is the set the import closure may carry (#2332).\n */\nconst DOSSIER_FAMILIES: readonly ApplicationSpecificationFamily[] = [\n ApplicationSpecificationFamily.CREATOR_INPUTS,\n ApplicationSpecificationFamily.DOCUMENT_FACTS_AUTHORED,\n];\n\n/**\n * What a commit door does with a committed file's relative import that the commit's tree would not resolve\n * (#2332), once the dossier modules a committed file imports have been carried (every door carries them: a\n * commit that holds the aggregate's import of the dossier must hold the dossier, whoever's commit it is).\n * Required at every call of `commitPaths`, so no door commits without having chosen.\n */\nenum ImportClosurePolicy {\n /**\n * Refuse by name. The playbook-run accept, the dossier's own commit and a recorded decision: each commits a\n * small, named set whose whole meaning is \"this is now accepted\", and a HEAD that does not compile accepts\n * nothing.\n */\n REFUSE_UNRESOLVED = 'refuse_unresolved',\n /**\n * Commit as asked and log the unresolved import. The coding-run doors only, and a deliberate narrowing of\n * \"no commit leaves an import unresolved\" recorded on #2332: a run sharing the tree with siblings leaves their\n * files for the wave reconciliation BY DESIGN (#1805), so a transiently unresolved import between two sibling\n * accepts is the expected case, and refusing would stop the build lane on it\n * (`application-creation-directive.md`). The wave's reconciliation commit closes it; the application's\n * TypeScript build stays the floor for code.\n */\n REPORT_UNRESOLVED = 'report_unresolved',\n}\n\n/** The separators the may-carry query's `--format` emits (`%x1e`, `%x1c`, `%x1d`): a commit's start, the end of its committer second, the end of its trailers. */\nconst COMMIT_MARK = '\\x1e';\nconst TIME_END = '\\x1c';\nconst TRAILERS_END = '\\x1d';\n\n/**\n * The trailers that say, in the history itself, HOW a change was accepted (#2845): its origin always, and for an\n * automatic origin the autonomy posture it ran under. Appended to the last paragraph, which every door's message ends\n * with its own trailer, so git reads them as trailers. Prose cannot carry this: the origin sentences below have changed\n * since the first automatic commits were written, so a reader matching them would misread history.\n */\nfunction withAcceptanceTrailers(message: string, origin: AcceptOrigin): string {\n return [\n message.replace(/\\n+$/u, ''),\n `${AcceptedChangeTrailerKey.ACCEPT_ORIGIN}: ${origin}`,\n ...(isAutomaticAcceptOrigin(origin) ? [`${AcceptedChangeTrailerKey.AUTONOMY_POSTURE}: ${APPLICATION_CREATION_AUTONOMY_POSTURE}`] : []),\n ].join('\\n');\n}\n\n/**\n * The message with a paragraph naming the carried dossier modules, placed just before the trailer paragraph\n * (always the last), so trailer parsing is unchanged (#2332).\n */\nfunction withCarriedParagraph(message: string, carried: readonly string[]): string {\n const paragraphs = message.split('\\n\\n');\n const trailers = paragraphs.pop() ?? '';\n return [\n ...paragraphs,\n ['Carried with it: the creator\\'s recorded answers (the dossier), which a committed file imports. No run wrote them; they are committed with the first change that reads them.', '', ...carried.map((filePath) => `- ${filePath}`)].join('\\n'),\n trailers,\n ].join('\\n\\n');\n}\n\nconst ACCEPT_ORIGIN_SENTENCE: Readonly<Record<AcceptOrigin, string>> = {\n [AcceptOrigin.OPERATOR]: 'Accepted from the Wildo workbench',\n [AcceptOrigin.AUTONOMY_POSTURE]: 'Accepted automatically under the application-creation autonomy posture (the system commits; the creator is notified and can revert)',\n [AcceptOrigin.WAVE_RECONCILIATION]: 'A build checkpoint under the autonomy posture: the working tree the build\\'s runs share is committed as it stands (the creator can revert)',\n [AcceptOrigin.INTERRUPTED_RUN_RECOVERY]: 'Recovered at companion start under the autonomy posture: work a restart interrupted is committed so its retry continues from it (the creator can revert)',\n};\n\n/**\n * What a build checkpoint a PERSON made says about its origin (#1885). Not `ACCEPT_ORIGIN_SENTENCE[OPERATOR]`, which\n * describes a per-run accept from the workbench: this commit is the whole shared tree, accepted through the CLI.\n */\nconst OPERATOR_CHECKPOINT_SENTENCE = 'A person accepted the build\\'s shared working tree (`wildo build checkpoint`)';\n\nexport enum AcceptRefusalReason {\n /** Already dirty when the run started: the file may carry another session's hunks beside the run's. */\n CARRIES_CHANGES_FROM_BEFORE_THE_RUN = 'carries_changes_from_before_the_run',\n /** The bytes are no longer what the run left. */\n EDITED_SINCE_THE_RUN = 'edited_since_the_run',\n /** A parallel commit, another companion lane, or a path outside the application: never this run's. */\n NOT_THIS_RUN = 'not_this_run',\n /**\n * The run shared the tree with others (#1528) and has no evidence of its own that it wrote this path:\n * it may be a sibling's. Left for that sibling's accept, or for the shared-tree reconciliation, which\n * commits what the runs left naming every run whose writes it may carry (#1805). Not refused when no other\n * writer may have written the path (#3215): see `unclaimedPathsNoOtherWriterMayHave`.\n */\n NOT_CLAIMED_BY_THE_RUN = 'not_claimed_by_the_run',\n /**\n * The run shared the tree with others and claims this path, but the path does not carry the product its\n * task DECLARES (#2209): a sibling overwrote it, or never left it there. Committing it under the task's\n * name would credit the task with whatever the file holds, which is other runs' work. Left for the next build\n * checkpoint, which commits the tree as it stands (#3204). No `force` passes it, because what it protects is the NAME on the commit,\n * not the bytes. Only refused when another writer MAY have written the path (#3218): a file no other run carries,\n * written while nothing else was live, holds only this run's work whatever its product probe says.\n */\n OWN_PRODUCT_ABSENT = 'own_product_absent',\n /**\n * A playbook run that has not been accepted recorded this path (#3221). It is that run's output, and the playbook\n * run's own accept (`wildo creation accept <runId>`) commits it under its name. A coding-run door never takes it,\n * or the playbook run's work is attributed to a build task and its own accept finds nothing. The refusal names\n * the run ({@link AcceptRefusal.playbookRun}).\n */\n OWNED_BY_PLAYBOOK_RUN = 'owned_by_playbook_run',\n /**\n * A file only a PERSON's door writes: the build-task decisions (`wildo build close` / `approve`, review of 8d6b95d29).\n * Every coding run is prohibited from writing it; if one did anyway, committing it under any run's name would make a\n * task read as closed, declined or approved by a person who never decided. No `force` passes it: the remedy is the\n * decision door, which commits it under the person's name. The reader would not honour it either.\n */\n PERSON_DECISION_RECORD = 'person_decision_record',\n /**\n * The run's file imports a module this same accept left out (#4000), so committing it would leave HEAD importing a\n * module no commit holds. Left out with it, by name, and the rest of the run commits. Before this, the import\n * closure refused the whole run and named the run itself as the one to accept first, which no one could ever do: a\n * foundation run whose generated file a tool had rewritten was never committed, nor its whole scaffold.\n */\n IMPORTS_A_LEFT_OUT_PATH = 'imports_a_left_out_path',\n}\n\n/** One path a door left uncommitted, and why. */\nexport interface AcceptRefusal {\n readonly path: string;\n readonly reason: AcceptRefusalReason;\n /** For {@link AcceptRefusalReason.OWNED_BY_PLAYBOOK_RUN}: the playbook run whose output the path is. */\n readonly playbookRun?: { readonly runId: string; readonly playbookRef: string };\n}\n\n/** A refusal as a commit message or an error names it: the path, the reason, and the playbook run that owns it when one does. */\nfunction describeRefusal(entry: AcceptRefusal, taskRef?: string): string {\n /*\n * A file already dirty when the run began has one door (#3267, the fifth review of #3220): a person who has read it.\n * No per-run accept takes it on an earlier run's record, since a fingerprint names bytes, not their writer; under a\n * committing posture the next build checkpoint commits it with the tree (#3204).\n */\n const door = entry.reason === AcceptRefusalReason.CARRIES_CHANGES_FROM_BEFORE_THE_RUN\n ? ` (it was already dirty when the run began: review it, then \\`wildo build accept ${taskRef ?? '<taskRef>'} --force\\` includes it, subject to the product and playbook-ownership checks every accept applies; a new run of the task meets it dirty too)`\n : entry.reason === AcceptRefusalReason.PERSON_DECISION_RECORD\n ? ' (only a person records build-task decisions, through `wildo build close` or `wildo build approve`; discard this write)'\n : '';\n return `${entry.path} — ${entry.reason}${door}${entry.playbookRun ? ` (playbook run ${entry.playbookRun.runId}, ${entry.playbookRun.playbookRef}: accept it with \\`wildo creation accept ${entry.playbookRun.runId}\\`)` : ''}`;\n}\n\n/**\n * The files of `toCommit` whose import is a module the same accept left out (#4000): what to leave out with it. Empty\n * when no unresolved import is of a left-out module, so the refusal stands as it is.\n */\nexport function importersOfLeftOutModules(\n unresolved: readonly { readonly importer: string; readonly workingTreeModule?: string }[],\n refused: readonly AcceptRefusal[],\n toCommit: readonly string[],\n): string[] {\n const leftOut = new Set(refused.map((entry) => entry.path));\n return [...new Set(unresolved\n .filter((entry) => entry.workingTreeModule !== undefined && leftOut.has(entry.workingTreeModule))\n .map((entry) => entry.importer))]\n .filter((importer) => toCommit.includes(importer));\n}\n\n/** The not-yet-accepted playbook run that recorded each path, newest run first. See {@link AcceptRefusalReason.OWNED_BY_PLAYBOOK_RUN}. */\ntype PlaybookRunOwners = ReadonlyMap<string, { readonly runId: string; readonly playbookRef: string }>;\n\n/**\n * Move every accepted path an unaccepted playbook run recorded to the refusals (#3221). Applied by every door that\n * commits a coding run's writes, so a playbook run's output is never committed under a build task's name: it waits\n * for the playbook run's own accept, which merges its change onto HEAD (#2418).\n */\nfunction withholdPlaybookRunOutput(\n classified: { readonly accepted: readonly string[]; readonly refused: readonly AcceptRefusal[] },\n owners: PlaybookRunOwners,\n): { readonly accepted: readonly string[]; readonly refused: readonly AcceptRefusal[] } {\n const owned = classified.accepted.filter((filePath) => owners.has(filePath));\n if (owned.length === 0) return classified;\n return {\n accepted: classified.accepted.filter((filePath) => !owners.has(filePath)),\n refused: [...classified.refused, ...owned.map((filePath) => ({ path: filePath, reason: AcceptRefusalReason.OWNED_BY_PLAYBOOK_RUN, playbookRun: owners.get(filePath)! }))],\n };\n}\n\n/**\n * Whether an entry of a recorded run is that run's OWN work, on the evidence the run itself left, for a retry that\n * VOUCHES for what the run left (#3220 review H2, review of 93680738b finding A): never written elsewhere (a parallel\n * commit, another lane, outside the application); EVIDENCED as the run's (a concurrent run CLAIMED it, its agent\n * reported writing it; a single-flight run held the tree alone, so its capture is the evidence its own accept already\n * commits on, and it records no claims); and either clean at the run's baseline or in a tree only a generation step\n * writes. Never by elimination and never by a fingerprint alone.\n *\n * A file DIRTY at the run's baseline is never the run's own here, and never a retry's either: there is no LINEAGE.\n * Taking such a file because its dirt matched an earlier run's recorded output was tried (#3220 re-review F3) and\n * removed after the fifth review of it (0fc83f7f8): a fingerprint names bytes, not who wrote them, and every way of\n * proving ownership through a run of fingerprints left a case (another task's dirt edited by two runs of this task; a sibling's\n * file a run of this task only captured; a path two concurrent runs both claimed) where another writer's lines went in\n * under this task's name. The cost is accepted: a file two failed runs both touched and a retry then edits is refused\n * by the retry's own accept as `carries_changes_from_before_the_run`, and its door is a person's\n * `wildo build accept <task> --force` (#3267); under a committing posture the next build checkpoint commits it with the\n * tree (#3204).\n */\nfunction isRunsOwnEntry(record: CodingRunWriteRecord, entry: CodingRunWriteRecord['files'][number]): boolean {\n if (isAttributedToAnotherWriter(entry.attribution)) return false;\n if (record.concurrent === true && entry.claimedByRun !== true) return false;\n if (entry.inStepOwnedTree === true) return true;\n return !entry.dirtyAtBaseline && entry.attribution !== ChangeSetAttributionClass.BASELINE_DIRTY_AMBIGUOUS;\n}\n\n/**\n * The recorded runs of `record`'s task whose output the current bytes of `paths` may descend from, `record` included\n * (finding B): their baselines decide which checks were already red before those files' history began. Only a file\n * DIRTY at a run's baseline has a history before it, which for a vouched file means one in a tree only a generation\n * step writes, regenerated over an earlier generation. The walk follows, per path, EVERY earlier run of the task whose\n * entry for the path was that run's OWN ({@link isRunsOwnEntry}; a run that only captured another writer's file is\n * neither named in the commit nor stamped accepted for it) and whose recorded output the baseline matched (or, when\n * either fingerprint is unknown, every such run that recorded the path), with a visit set\n * per path (fifth review, finding 1: one set shared across paths stopped a second path's history at a run the first had\n * reached and dropped the runs before it, so a check a dropped run broke was forgiven). `other.at < from.at` bounds it.\n */\nfunction runsInTheHistoryOf(record: CodingRunWriteRecord, paths: readonly string[], records: readonly CodingRunWriteRecord[]): CodingRunWriteRecord[] {\n const found = new Map<string, CodingRunWriteRecord>([[record.taskId, record]]);\n for (const filePath of paths) {\n const visited = new Set<string>([record.taskId]);\n const pending: CodingRunWriteRecord[] = [record];\n while (pending.length > 0) {\n const from = pending.pop()!;\n const file = from.files.find((entry) => entry.path === filePath);\n if (!file?.dirtyAtBaseline) continue;\n for (const other of records) {\n if (other.taskRef !== from.taskRef || visited.has(other.taskId) || !(other.at < from.at)) continue;\n const entry = other.files.find((candidate) => candidate.path === filePath);\n if (!entry || !isRunsOwnEntry(other, entry)) continue;\n if (file.baselineFingerprint !== undefined && entry.postRunFingerprint !== undefined && entry.postRunFingerprint !== file.baselineFingerprint) continue;\n visited.add(other.taskId);\n found.set(other.taskId, other);\n pending.push(other);\n }\n }\n }\n return [...found.values()];\n}\n\n/**\n * A file a recorded coding run left in the tree, uncommitted and still exactly as that run left it, while no run of its\n * task is live (#3267). Under a reviewing posture nothing automatic is coming for it (under a committing one, the next\n * build checkpoint commits it with the tree, #3204). So it is REPORTED, on\n * `wildo build tasks`, the feed and Home, with the person's two doors: `wildo build accept <taskRef> --leftovers`\n * commits it under the runs that left it, and `discardCommand` puts HEAD back. It never stays silently uncommitted.\n */\nexport interface UncommittedRunLeftover {\n /** The build-plan task whose runs left the file. */\n readonly taskRef: string;\n /** App-root-relative path. */\n readonly path: string;\n /** Every recorded run of the task whose record holds the path exactly as it is now, newest first. */\n readonly runTaskIds: readonly string[];\n /** TRUE when HEAD holds no such path, so discarding the leftover removes the file. */\n readonly absentAtHead: boolean;\n /** The exact command a person runs from the application root to discard it instead of committing it. */\n readonly discardCommand: string;\n}\n\n/**\n * The command that discards one leftover, run from the application root. A path HEAD holds is restored from HEAD, in the\n * index and the working tree; a path HEAD does not hold is removed. Quoted for a POSIX shell.\n */\nexport function describeLeftoverDiscardCommand(applicationPath: string, absentAtHead: boolean): string {\n const quoted = `'${applicationPath.replaceAll('\\'', '\\'\\\\\\'\\'')}'`;\n return absentAtHead ? `rm -- ${quoted}` : `git restore --source=HEAD --staged --worktree -- ${quoted}`;\n}\n\n/**\n * Says which of a concurrent run's paths do NOT carry the product its build task declares (#2209), read\n * from the tree as the commit would leave it: the working text of the paths being committed, HEAD for\n * every other path. It is evaluated by the same predicate landing uses, so the accept and the landing\n * check cannot disagree about whether a commit holds the task's product.\n *\n * The build layer supplies it (`ApplicationBuildDispatchCompanionService` registers it at construction),\n * because the build plan and its landing probes live there and this service sits below that layer. The\n * dependency points the way the board listeners already point (`registerRunAcceptedListener`).\n */\nexport interface ConcurrentRunProductWitness {\n /** The subset of `candidatePaths` a probe of `taskRef` names and the prospective tree does not satisfy. Empty when the task declares nothing checkable there. */\n pathsLackingOwnProduct(taskRef: string, candidatePaths: readonly string[]): Promise<readonly string[]>;\n}\n\n/** What one door gathered about the OTHER writers of the tree (#3218, #3221); see `gatherOtherWriterEvidence`. */\ninterface OtherWriterEvidence {\n /** Every recorded coding run, newest first. */\n readonly records: readonly CodingRunWriteRecord[];\n /** The candidate paths an unaccepted playbook run still owns. */\n readonly playbookOwners: PlaybookRunOwners;\n /** TRUE when a writer that recorded nothing may have written beside the runs (see `gatherOtherWriterEvidence`): every path is contested. */\n readonly unrecordedWriterBeside: boolean;\n}\n\nexport interface AcceptedChangeCommitOutcome {\n readonly commitSha: string | undefined;\n readonly committedPaths: readonly string[];\n /**\n * Of {@link committedPaths}, the dossier modules carried because a committed file imports them (#2332). Never a\n * path a run wrote: the creator's recorded answers, committed with the first change that reads them.\n */\n readonly carriedPaths: readonly string[];\n readonly refusedPaths: readonly AcceptRefusal[];\n readonly message: string;\n /** TRUE when every acceptable path was already committed, so no new commit was made. */\n readonly alreadyCommitted: boolean;\n}\n\n/** What a build checkpoint committed ({@link AcceptedChangeCommitCompanionService.commitBuildCheckpoint}). */\nexport interface BuildCheckpointOutcome {\n readonly commitSha: string;\n readonly committedPaths: readonly string[];\n /** The runs the checkpoint names: every run settled since the previous checkpoint. */\n readonly namedTaskIds: readonly string[];\n /** Changed paths it left uncommitted: a person's decision record, or a file an unaccepted playbook run owns. */\n readonly excludedPaths: readonly string[];\n /** TRUE when the runs' writes were already committed, so no new commit was made. */\n readonly alreadyCommitted: boolean;\n}\n\n/** Nothing could be committed: no record, an empty run, or every path refused. Carries the refusals. */\nexport class NothingToAcceptError extends Error {\n public constructor(message: string, public readonly refusedPaths: readonly AcceptRefusal[] = []) {\n super(message);\n this.name = 'NothingToAcceptError';\n }\n}\n\n/**\n * A PERSON's acceptance refused because a coding worker is writing the same tree right now. 409: the\n * request is fine, the moment is not — accept again once the run settles.\n *\n * A commit inside a live run's window destroys its attribution (the run's baseline no longer matches\n * HEAD, so what it wrote can no longer be told apart from what the commit carried), and it can sweep in a\n * file the worker is halfway through. The console's commands said \"never commit while a dispatch runs\"\n * as prose only, which a model may skip and a person at the workbench never read.\n */\nexport class CodingRunWritingTheTreeError extends Error {\n public constructor(public readonly liveRuns: readonly { readonly executionId: string; readonly taskRef: string | null }[]) {\n super(`A coding run is writing the application's tree right now (${liveRuns.map((run) => run.taskRef ?? run.executionId).join(', ')}). `\n + 'Accepting now would commit around its work and break what it records as its own. Accept again once it has settled '\n + '(`wildo creation feed --follow --exit-on-change` says when).');\n this.name = 'CodingRunWritingTheTreeError';\n }\n}\n\n/**\n * A commit refused because the tree it would leave does not resolve one of its own imports (#2332): a committed\n * file imports a module no commit holds and this door may not carry. 409: the request is fine, the moment is\n * not. Accept the change that wrote the module first (its run, as `wildo creation writes` lists it), then this.\n */\nexport class AcceptWouldLeaveUnresolvedImportError extends Error {\n public constructor(public readonly unresolved: readonly UnresolvedImportWithWriter[]) {\n super('Committing now would leave the application importing a module no commit holds: '\n + `${unresolved.map(describeUnresolvedImport).join('; ')}. Then accept this again.`);\n this.name = 'AcceptWouldLeaveUnresolvedImportError';\n }\n}\n\n/** An unresolved import, with the not-yet-accepted playbook run that wrote its module when one did. */\nexport interface UnresolvedImportWithWriter extends UnresolvedCommitImport {\n readonly writtenBy?: { readonly runId: string; readonly playbookRef: string };\n}\n\n/**\n * One unresolved import, with the path to get committed and the remedy that actually applies to its writer: a run\n * is accepted, a file no run wrote (a persona or brand accept, a hand edit; #2419) is committed by the person.\n */\nfunction describeUnresolvedImport(entry: UnresolvedImportWithWriter): string {\n const head = `${entry.importer} imports '${entry.specifier}'`;\n if (entry.workingTreeModule === undefined) return `${head}, which exists nowhere (the import itself is broken: fix the file)`;\n if (entry.writtenBy) {\n return `${head}, which is ${entry.workingTreeModule}, written by playbook run ${entry.writtenBy.runId} (${entry.writtenBy.playbookRef}) and not accepted yet: `\n + `accept it first with \\`wildo creation accept ${entry.writtenBy.runId}\\``;\n }\n return `${head}, which is ${entry.workingTreeModule}, written by no playbook run (a persona or brand accept, or a hand edit; see #2419): commit that file first`;\n}\n\nexport class AcceptedChangeCommitError extends Error {\n public constructor(message: string, public readonly stderr: string) {\n super(message);\n this.name = 'AcceptedChangeCommitError';\n }\n}\n\n@injectable()\nexport class AcceptedChangeCommitCompanionService {\n private readonly logDebug: (message: string, context?: Record<string, unknown>) => void;\n\n public constructor(\n @inject(SAAS_SERVICE_TYPES.Logger) private readonly logger: LoggerService,\n @inject(COMPANION_SERVICE_TYPES.CompanionContext) private readonly companionContext: CompanionContext,\n @inject(COMPANION_SERVICE_TYPES.CodingRunWriteRegisterService) private readonly codingRunWrites: CodingRunWriteRegisterCompanionService,\n @inject(COMPANION_SERVICE_TYPES.PlaybookRunWriteRegisterService) private readonly playbookRunWrites: PlaybookRunWriteRegisterCompanionService,\n @inject(COMPANION_SERVICE_TYPES.ExecutionsService) private readonly executions: Pick<CompanionExecutionsCompanionService, 'listActorExecutions'>,\n ) {\n this.logDebug = this.logger.debugByType('AcceptedChangeCommit');\n }\n\n /** Set once, by the build layer; see {@link ConcurrentRunProductWitness}. */\n private concurrentRunProductWitness: ConcurrentRunProductWitness | undefined;\n\n public registerConcurrentRunProductWitness(witness: ConcurrentRunProductWitness): void {\n this.concurrentRunProductWitness = witness;\n }\n\n\n /**\n * A PERSON's acceptance waits for the tree to be quiet; the automatic origins do not ask. They run from\n * inside the coding dispatch's own window (at a baseline, at the end of a wave, at recovery), where the\n * run being accepted is the one holding it — refusing them would refuse the dispatch its own commit.\n * Read from the actor plane, so a run another process started is seen too.\n */\n private async refuseWhileACodingRunWrites(origin: AcceptOrigin): Promise<void> {\n if (origin !== AcceptOrigin.OPERATOR) return;\n const live = await listInFlightCodingRuns(this.executions);\n if (live.length > 0) throw new CodingRunWritingTheTreeError(live);\n }\n\n /** Accept the latest recorded coding run of a build-plan task. `subject` is the task's objective, for the message. */\n public async acceptCodingRun(input: {\n readonly taskRef: string;\n readonly subject?: string;\n readonly force?: boolean;\n /** Defaults to OPERATOR: the workbench predates the loop, and an unstated origin must not read as automatic. */\n readonly origin?: AcceptOrigin;\n }): Promise<AcceptedChangeCommitOutcome> {\n await this.refuseWhileACodingRunWrites(input.origin ?? AcceptOrigin.OPERATOR);\n const record = await this.codingRunWrites.findLatestForTaskRef(input.taskRef);\n if (!record) {\n throw new NothingToAcceptError(\n `No coding run of ${input.taskRef} has recorded its writes. A run older than the write register is accepted by committing by hand.`,\n );\n }\n /*\n * An accepted run is not accepted again — unless the caller FORCES it. A first accept can be\n * PARTIAL: it commits what it can vouch for and refuses the rest by name, and the register then\n * records the run as accepted. Returning here unconditionally made every later forced accept a\n * no-op in exactly that case — a person's force-accept from the workbench, and the end-of-wave\n * reconciliation (#1528), which exists for runs whose accept siblings made partial. Found by the\n * real-git wave test: the run's module landed, the shared index it also wrote stayed uncommitted,\n * and reconciliation answered \"already committed\". Re-classifying is safe: a path already at HEAD\n * stages nothing, and a commit is made only when something is.\n */\n const origin = input.origin ?? AcceptOrigin.OPERATOR;\n if (record.acceptedCommitSha !== undefined && input.force !== true) {\n /*\n * Already accepted, but say what that accept LEFT OUT and why (#3233 R4): a partial accept refused paths by name,\n * and answering \"already committed\" alone hid them, so a person reran `wildo build accept` and got nothing to act\n * on. The refusals are re-derived through the same pipeline the door uses, for the paths still uncommitted;\n * `--force` then takes the ones about bytes.\n */\n const stillUncommitted = await this.uncommittedAmong(record.files.map((file) => file.path));\n const { refused: leftOut } = await this.classifyForOwnAccept(record, false, origin);\n return {\n commitSha: record.acceptedCommitSha, committedPaths: [], carriedPaths: [],\n refusedPaths: leftOut.filter((entry) => stillUncommitted.has(entry.path)), message: '', alreadyCommitted: true,\n };\n }\n const { accepted, refused } = await this.classifyForOwnAccept(record, input.force === true, origin);\n if (accepted.length === 0) {\n throw new NothingToAcceptError(\n record.files.length === 0\n ? `The latest run of ${input.taskRef} changed nothing; there is nothing to accept.`\n : `Nothing of ${input.taskRef}'s run can be accepted: ${refused.map((entry) => describeRefusal(entry, input.taskRef)).join(', ')}.`,\n refused,\n );\n }\n const message = [\n `${input.taskRef}: ${input.subject ?? 'accept the coding run'}`,\n '',\n `${ACCEPT_ORIGIN_SENTENCE[origin]}: the writes of coding run ${record.taskId} on ${record.at}.`,\n /*\n * A file several runs edited is committed whole, so it carries their lines too: claims are per PATH,\n * and nothing separates one run's hunks from another's (#2209). Said, rather than left for the\n * message to over-claim.\n */\n ...(record.concurrent === true ? ['This run shared the working tree with other runs: a file listed here may also carry lines they wrote.'] : []),\n '',\n ...accepted.map((filePath) => `- ${filePath}`),\n ...(refused.length > 0 ? ['', `Not included (refused by name): ${refused.map((entry) => describeRefusal(entry, input.taskRef)).join('; ')}`] : []),\n '',\n `${CODING_RUN_TRAILER}: ${record.taskId}`,\n ].join('\\n');\n const outcome = await this.commitPaths(accepted, message, origin, ImportClosurePolicy.REPORT_UNRESOLVED);\n await this.codingRunWrites.markAccepted(record.taskId, outcome.commitSha, new Date().toISOString());\n return { ...outcome, refusedPaths: refused };\n }\n\n /**\n * The classification every per-run accept applies, in order (#3218, #3221, #3233): who else may have written beside\n * the run, its unclaimed paths that are its own by elimination, its claims and bytes, a playbook run's output, and the\n * product withhold. ONE pipeline, so the \"already committed\" answer names exactly what the accept would refuse.\n */\n private async classifyForOwnAccept(record: CodingRunWriteRecord, force: boolean, origin: AcceptOrigin): Promise<{\n readonly accepted: readonly string[];\n readonly refused: readonly AcceptRefusal[];\n readonly evidence: OtherWriterEvidence;\n }> {\n const evidence = await this.gatherOtherWriterEvidence({ besideRecords: [record], candidatePaths: record.files.map((file) => file.path) });\n const solelyWritten = await this.unclaimedPathsNoOtherWriterMayHave(record, evidence);\n const classified = withholdPlaybookRunOutput(await this.classifyCodingRunFiles(record, force, false, solelyWritten), evidence.playbookOwners);\n const { accepted, refused } = await this.withholdPathsLackingOwnProduct(record, classified, origin, evidence);\n return { accepted, refused, evidence };\n }\n\n /**\n * A BUILD CHECKPOINT (#3204): the application's working tree committed as it stands, naming every coding run that\n * settled since the previous checkpoint. The automatic build lane's only coding-run commit.\n *\n * **Why not one commit per run.** Ten agents share one working tree, so a commit under ONE run's name had to decide\n * which run wrote which bytes: claimed paths, refusals of files a run did not claim, shared files withheld while another\n * writer might hold them, a catch-up accept and a wave-end reconciliation. On reference run 42575514613 that\n * machinery held agents to 3.4 of 10 on average, committed nothing on 31 of 90 run accepts and refused 832 paths.\n * Decided by Paul (2026-11-09): progress no longer waits on a commit (a build task lands when its product is in the\n * working tree), and the commit is a checkpoint of the tree. One commit per task is not kept.\n *\n * **What a checkpoint says, for assurance.** `WILDO.SOFTWARE.AI_PRODUCED_CHANGE_CONTROL` asks that an accepted change\n * be attributed to whoever accepted it: the companion authors the commit and the origin and posture trailers say it was\n * automatic, as every automatic door does. Which runs the change carries is named by one `Wildo-Coding-Run` trailer per\n * run, and which files each run touched stays in its write record and its change-set artifact. Which run wrote which\n * LINE is not recorded, by decision.\n *\n * **What it leaves out.** The build-task decisions file (only a person's decision door commits it), every file an\n * unaccepted playbook run owns (its own accept commits it), and the research-evidence store (accepted only on a person's\n * request, #2419). Everything else\n * under the application root that git does not ignore is committed, including a sibling's file still being written and\n * a person's edit made during the build: the next checkpoint carries the rest, and a person who wants an edit kept apart\n * commits it themselves first.\n *\n * Runs still live (`liveTaskIds`) are not named; the checkpoint after they settle names them. With no settled run to\n * name nothing is committed: an uncommitted change no run made is not the build's to commit. Answers `undefined` then.\n *\n * **A person's checkpoint (`AcceptOrigin.OPERATOR`, #1885).** The automatic origins run only where the autonomy posture\n * maps a run's result to notify-and-proceed, so under a reviewing posture (GUIDED) no automatic checkpoint is made, and\n * the person's other doors (a run's accept, `--leftovers`) each name ONE task's runs: what several runs left in the\n * shared tree would stay uncommitted, and the next run would find it dirty at its baseline. `wildo build checkpoint`\n * is that person's door onto this same commit: the same tree, the same exclusions, every settled run named, authored by\n * the person's own git identity and saying a person accepted it. It is refused while a coding run is writing, as every\n * person's accept is, so it never names a run that has not settled.\n */\n public async commitBuildCheckpoint(input: {\n readonly origin: AcceptOrigin.WAVE_RECONCILIATION | AcceptOrigin.INTERRUPTED_RUN_RECOVERY | AcceptOrigin.OPERATOR;\n readonly liveTaskIds: ReadonlySet<string>;\n }): Promise<BuildCheckpointOutcome | undefined> {\n await this.refuseWhileACodingRunWrites(input.origin);\n const runs = (await this.codingRunWrites.list())\n .filter((record) => record.acceptedCommitSha === undefined && !input.liveTaskIds.has(record.taskId))\n .sort((left, right) => left.at.localeCompare(right.at));\n if (runs.length === 0) return undefined;\n const acceptedAt = new Date().toISOString();\n /*\n * Twice at most (review of 4a1b1f1bf F4): an agent or a tool can delete a short-lived untracked file between the listing\n * and `git add` (a Vite `*.timestamp-*.mjs`), and `git add` then stages nothing and fails. A vanished untracked path is\n * dropped just before staging; if one still slips through, the tree is listed again once.\n */\n for (let attempt = 1; ; attempt += 1) {\n const changed = await this.listChangedApplicationPaths();\n const playbookOwners = await this.unacceptedPlaybookRunOwners(changed.map((entry) => entry.path));\n const excludedPaths = changed.map((entry) => entry.path).filter((filePath) => isBuildTaskDecisionsPath(filePath, this.companionContext)\n || playbookOwners.has(filePath)\n // The research-evidence store is accepted only on a person's request (#2419), whether or not a run record still owns it.\n || filePath.startsWith(`${RESEARCH_EVIDENCE_RELATIVE_ROOT}/`));\n const excluded = new Set(excludedPaths);\n const stillThere = await Promise.all(changed.map(async (entry) => (!entry.untracked || await stat(path.resolve(this.companionContext.saasRoot, entry.path)).then(() => true, () => false))));\n const paths = changed.filter((entry, index) => !excluded.has(entry.path) && stillThere[index]).map((entry) => entry.path);\n if (paths.length === 0) {\n // Their writes are already committed (an earlier checkpoint carried them): each is stamped with the commit that last\n // changed its own files (F8), never merely HEAD, which may be a commit holding none of its work.\n for (const record of runs) await this.codingRunWrites.markAccepted(record.taskId, await this.lastCommitTouching(record.files.map((file) => file.path)), acceptedAt);\n return { commitSha: await this.lastCommitTouching([]), committedPaths: [], namedTaskIds: runs.map((record) => record.taskId), excludedPaths, alreadyCommitted: true };\n }\n const taskRefs = [...new Set(runs.map((record) => record.taskRef))];\n const message = [\n `build checkpoint: ${taskRefs.length === 1 ? taskRefs[0] : `${taskRefs.length} build tasks`}`,\n '',\n `${input.origin === AcceptOrigin.OPERATOR ? OPERATOR_CHECKPOINT_SENTENCE : ACCEPT_ORIGIN_SENTENCE[input.origin]}.`,\n 'The working tree the build\\'s runs share is committed as it stands. The runs named below settled since the previous checkpoint; which run wrote which file is in each run\\'s own write record.',\n '',\n ...runs.map((record) => `Run: ${record.taskRef} (run ${record.taskId}, recorded ${record.at})`),\n ...(excludedPaths.length > 0 ? ['', 'Left out (a person\\'s decision record, an unaccepted playbook run\\'s file, or research evidence):', ...excludedPaths.map((filePath) => `- ${filePath}`)] : []),\n '',\n ...runs.map((record) => `${CODING_RUN_TRAILER}: ${record.taskId}`),\n ].join('\\n');\n try {\n const outcome = await this.commitPaths(paths, message, input.origin, ImportClosurePolicy.REPORT_UNRESOLVED);\n for (const record of runs) await this.codingRunWrites.markAccepted(record.taskId, outcome.commitSha, acceptedAt);\n return { commitSha: outcome.commitSha, committedPaths: outcome.committedPaths, namedTaskIds: runs.map((record) => record.taskId), excludedPaths, alreadyCommitted: outcome.alreadyCommitted };\n } catch (error) {\n if (attempt >= 2) throw error;\n this.logDebug('A build checkpoint could not stage its paths; listing the tree again', { error: describeCaughtError(error) });\n }\n }\n }\n\n /** The commit that last changed any of these paths, or HEAD when git has no history for them (or none are given). */\n private async lastCommitTouching(paths: readonly string[]): Promise<string> {\n const lastTouching = paths.length > 0 ? (await this.execGit(['log', '-1', '--format=%H', '--', ...paths])).stdout.trim() : '';\n return lastTouching || (await this.execGit(['rev-parse', 'HEAD'])).stdout.trim();\n }\n\n /**\n * Every path under the application root that differs from HEAD and that git does not ignore, application-relative, and\n * whether git lists it as UNTRACKED (`??`): the one kind of entry that can vanish before staging with nothing to stage.\n */\n private async listChangedApplicationPaths(): Promise<Array<{ readonly path: string; readonly untracked: boolean }>> {\n // With `-z`, `git status` prints REPOSITORY-relative paths whatever `-C` says (see `uncommittedAmong`).\n const prefix = (await this.execGit(['rev-parse', '--show-prefix'])).stdout.replace(/\\r?\\n$/u, '');\n const toApplicationPath = (repositoryPath: string): string => (prefix && repositoryPath.startsWith(prefix) ? repositoryPath.slice(prefix.length) : repositoryPath);\n const status = await this.execGit(['status', '--porcelain=v1', '-z', '--untracked-files=all', '--', '.']);\n const tokens = status.stdout.split('\\0');\n const changed = new Map<string, boolean>();\n for (let index = 0; index < tokens.length; index += 1) {\n const entry = tokens[index]!;\n if (entry.length < 4) continue;\n changed.set(toApplicationPath(entry.slice(3)), entry.startsWith('??'));\n // A rename or copy is `XY new\\0old`: the original path changed too (its removal is part of the change).\n if (entry[0] === 'R' || entry[0] === 'C' || entry[1] === 'R' || entry[1] === 'C') {\n index += 1;\n if (tokens[index]) changed.set(toApplicationPath(tokens[index]!), false);\n }\n }\n return [...changed].sort(([left], [right]) => left.localeCompare(right)).map(([changedPath, untracked]) => ({ path: changedPath, untracked }));\n }\n\n /**\n * Every file a recorded coding run left uncommitted that no automatic door will commit (#3267; a stuck task's declared product aside, #3204), as\n * {@link UncommittedRunLeftover}: uncommitted now, its bytes still exactly what a run of its task recorded (so nothing\n * edited it since), and no unaccepted playbook run owning it (that run's own accept commits it, `wildo creation\n * accept`), for a task whose door has already passed: no run of it is live (a live run's accept decides it, and a\n * parked run's turn will conclude), and its LATEST recorded run is accepted, so the autonomy posture's accept of that\n * run already took everything it could (a passing retry's vouching included) and left this. A task whose latest run\n * was not accepted is still the build's: a retry may vouch for the file, or the task is reported unlanded with its\n * uncommitted paths and `wildo build accept --force`. Known limit: a task whose accepted run did not land it is\n * dispatched again, and that retry may still take the file; the line then disappears when it does.\n *\n * Two shapes reach here and this reports both the same way: an earlier FAILED run's file a retry's vouching refused\n * (`check_failed`, not vouched for) once the task landed, and a file dirty at a retry's baseline with what earlier\n * failed runs left, which the retry's own accept refuses as `carries_changes_from_before_the_run` (the cost #3267\n * records of removing lineage). Neither is committed here: the records name bytes, never who wrote them, so the door is\n * a person's (under a committing posture, the next build checkpoint commits it with the tree, #3204).\n *\n * Read-only. A run whose record holds the path but whose bytes no longer match is not named: the file moved after it.\n */\n public async listUncommittedRunLeftovers(): Promise<readonly UncommittedRunLeftover[]> {\n const records = await this.codingRunWrites.list();\n if (records.length === 0) return [];\n const liveTaskRefs = await this.taskRefsWithAnOpenRun();\n // `list()` is newest first, so the first record of a task is its latest run.\n const latestAccepted = new Set<string>();\n const seenTasks = new Set<string>();\n for (const record of records) {\n if (seenTasks.has(record.taskRef)) continue;\n seenTasks.add(record.taskRef);\n if (record.acceptedCommitSha !== undefined) latestAccepted.add(record.taskRef);\n }\n const settled = records.filter((record) => !liveTaskRefs.has(record.taskRef) && latestAccepted.has(record.taskRef));\n const uncommitted = await this.uncommittedAmong(settled.flatMap((record) => record.files.map((file) => file.path)));\n if (uncommitted.size === 0) return [];\n const owners = await this.unacceptedPlaybookRunOwners([...uncommitted]);\n const leftovers: UncommittedRunLeftover[] = [];\n for (const filePath of [...uncommitted].filter((candidate) => !owners.has(candidate)).sort()) {\n const bytes = await readFile(path.resolve(this.companionContext.saasRoot, filePath)).catch(() => undefined);\n const current = bytes === undefined ? undefined : sha256Hex(bytes);\n const byTask = new Map<string, string[]>();\n // `list()` is newest first, so each task's runs are named newest first.\n for (const record of settled) {\n const entry = record.files.find((file) => file.path === filePath);\n if (!entry) continue;\n const unchanged = current === undefined ? entry.changeKind === ChangeSetFileChangeKind.DELETED : current === entry.contentSha256;\n if (unchanged) byTask.set(record.taskRef, [...(byTask.get(record.taskRef) ?? []), record.taskId]);\n }\n if (byTask.size === 0) continue;\n const absentAtHead = (await this.execGit(['rev-parse', '--verify', '--quiet', `HEAD:./${filePath}`], { acceptExitCodes: [0, 1, 128] })).exitCode !== 0;\n for (const [taskRef, runTaskIds] of byTask) {\n leftovers.push({ taskRef, path: filePath, runTaskIds, absentAtHead, discardCommand: describeLeftoverDiscardCommand(filePath, absentAtHead) });\n }\n }\n return leftovers;\n }\n\n /**\n * A person's door for a task's leftovers (#3267): `wildo build accept <taskRef> --leftovers`. Commits, in one commit,\n * what {@link listUncommittedRunLeftovers} reports for the task, each file under the NEWEST run whose record holds it,\n * through that run's own accept classification: who else may have written beside it, its claims, its bytes, a playbook\n * run's ownership and its product. So nothing is committed under a run's name that its own accept would not commit,\n * and `force` passes exactly what it passes there, the two refusals about bytes. Every run whose record holds a\n * committed file is named. No check runs: a person reviewed the files and accepts them, as with\n * `wildo build accept --force`.\n */\n public async acceptCodingRunLeftovers(input: { readonly taskRef: string; readonly force?: boolean }): Promise<AcceptedChangeCommitOutcome> {\n const origin = AcceptOrigin.OPERATOR;\n await this.refuseWhileACodingRunWrites(origin);\n const leftovers = (await this.listUncommittedRunLeftovers()).filter((leftover) => leftover.taskRef === input.taskRef);\n if (leftovers.length === 0) {\n throw new NothingToAcceptError(`No run of ${input.taskRef} left a file uncommitted that is still as it left it; there is nothing to accept.`);\n }\n const byRun = new Map<string, string[]>();\n for (const leftover of leftovers) byRun.set(leftover.runTaskIds[0]!, [...(byRun.get(leftover.runTaskIds[0]!) ?? []), leftover.path]);\n const accepted: string[] = [];\n const refused: AcceptRefusal[] = [];\n const takenFrom: Array<{ readonly record: CodingRunWriteRecord; readonly paths: readonly string[] }> = [];\n for (const [taskId, paths] of byRun) {\n const record = await this.codingRunWrites.read(taskId);\n if (!record) continue;\n const own = new Set(paths);\n const classified = await this.classifyForOwnAccept(record, input.force === true, origin);\n const taken = classified.accepted.filter((filePath) => own.has(filePath));\n accepted.push(...taken);\n refused.push(...classified.refused.filter((entry) => own.has(entry.path)));\n if (taken.length > 0) takenFrom.push({ record, paths: taken.sort() });\n }\n if (accepted.length === 0) {\n throw new NothingToAcceptError(\n `Nothing ${input.taskRef}'s runs left uncommitted can be accepted: ${refused.map((entry) => describeRefusal(entry, input.taskRef)).join(', ')}.`,\n refused,\n );\n }\n const committed = new Set(accepted);\n /*\n * Every run whose lines a committed file may carry is named: the runs whose record holds its bytes now, and, for a\n * file that was dirty when such a run began (taken only by `force`), the earlier runs of the task its history\n * reaches ({@link runsInTheHistoryOf}).\n */\n const allRecords = await this.codingRunWrites.list();\n const historyRuns = takenFrom.flatMap((entry) => runsInTheHistoryOf(entry.record, entry.paths, allRecords).map((run) => run.taskId));\n const namedRuns = [...new Set([...leftovers.filter((leftover) => committed.has(leftover.path)).flatMap((leftover) => leftover.runTaskIds), ...historyRuns])];\n const message = [\n `${input.taskRef}: commit what its runs left uncommitted`,\n '',\n `${ACCEPT_ORIGIN_SENTENCE[origin]}: files earlier runs of this task left in the tree, still as they left them, that no automatic door had committed (#3267).`,\n ...takenFrom.flatMap((entry) => ['', `Left by coding run ${entry.record.taskId} (recorded ${entry.record.at}):`, ...entry.paths.map((filePath) => `- ${filePath}`)]),\n ...(refused.length > 0 ? ['', `Not included (refused by name): ${refused.map((entry) => describeRefusal(entry, input.taskRef)).join('; ')}`] : []),\n '',\n ...namedRuns.map((taskId) => `${CODING_RUN_TRAILER}: ${taskId}`),\n ].join('\\n');\n const outcome = await this.commitPaths(accepted, message, origin, ImportClosurePolicy.REPORT_UNRESOLVED);\n // A run is stamped accepted only once nothing it recorded is left uncommitted (re-review F8 of #3220).\n const acceptedAt = new Date().toISOString();\n for (const taskId of namedRuns) {\n const record = await this.codingRunWrites.read(taskId);\n if (!record || record.acceptedCommitSha !== undefined) continue;\n if ((await this.uncommittedAmong(record.files.map((file) => file.path))).size === 0) await this.codingRunWrites.markAccepted(taskId, outcome.commitSha, acceptedAt);\n }\n return { ...outcome, refusedPaths: refused };\n }\n\n /** The build-plan tasks a run of which is open now (selected, running or parked), read from the durable actor plane. */\n private async taskRefsWithAnOpenRun(): Promise<ReadonlySet<string>> {\n const taskRefs = new Set<string>();\n for (const [systemRef, status] of OPEN_TREE_WRITER_QUERIES) {\n for (const row of await this.executions.listActorExecutions(CompanionExecutionsListQuerySchema.parse({ systemRef, status, limit: EXECUTION_SPAN_SCAN_LIMIT }))) {\n for (const task of (row as { standaloneTasks?: ReadonlyArray<{ input?: unknown }> }).standaloneTasks ?? []) {\n const taskRef = (task.input as { taskRef?: unknown } | undefined)?.taskRef;\n if (typeof taskRef === 'string') taskRefs.add(taskRef);\n }\n }\n }\n return taskRefs;\n }\n\n /**\n * Which recorded runs may carry which paths' current changes (#1805), answered for a whole set of paths at\n * once. A run may carry a path when its capture holds the path as its OWN (never as a parallel commit's,\n * another lane's, or outside the application) and no commit THIS LANE made since that capture touched the\n * path.\n *\n * Only this lane's commits end it, because only they are known to take the WHOLE working file: every one is\n * a pathspec commit of the file as it stands, so what the run left in it is then in history, or was\n * overwritten before (#1805 review 6 G1). They are recognised by the trailer KEYS this service writes\n * (`LANE_COMMIT_TRAILERS`). Another author's commit proves nothing either way: a temporary-index commit or\n * `git add -p` can take their own hunk and leave the run's in the working tree, so the run stays \"may\", as\n * the rule says. So does a run whose version a person threw away without a commit (review 5 L3). Both\n * over-name, which is the direction the rule accepts, and the bytes test in the caller still commits a path\n * only when its current state is one a run left.\n *\n * Known limit — this can UNDER-name when a commit carrying a lane key was NOT made against the file as it\n * stood after the capture, yet sits after it in history (reviews 7 I3, 8 L1). Two shapes: a person's commit\n * that COPIES a lane trailer (`commit -c`/`-C` of a lane commit, an `--amend` of one with partial staging, a\n * squash), and a lane commit made BEFORE the capture and re-attached after it (`reset --soft` back, the run,\n * `reset --soft` forward; a stash and cherry-pick around a run). The second is closed wherever the clock\n * can tell: a lane commit whose committer second is EARLIER than the capture's second ends no claim. That\n * can only over-name, and a commit in the capture's own second still counts, so the review 5 F1 objection\n * to clocks does not arise. What remains is a copied trailer, or a re-attached commit within the capture's\n * second. `revert` copies no trailer and `cherry-pick` refuses over dirty files.\n *\n * \"Since that capture\" is HISTORY ORDER, never a clock (review 5 F1): a commit's `%ct` is whole seconds,\n * and a run's own accept usually lands within the second of its capture. And it is the DESCENDANTS of the\n * record's post-run HEAD (`--ancestry-path <postRunHeadSha>..HEAD`), not merely what that HEAD cannot reach\n * (review 7 M1): after a rebase or a branch switch that carries the dirty files across, lane commits made\n * BEFORE the capture are rewritten into the plain range with their trailers intact, and would end a claim\n * on lines still uncommitted. With the ancestry path a rewritten history counts nothing, and its runs stay\n * named. A post-run HEAD git cannot resolve is no evidence either way, so its runs are kept too. Renames\n * are not followed (`--no-renames`), so a moved file is listed under both its names.\n *\n * One `git log` per distinct post-run HEAD, over only the paths asked about (review 6 C1): the query runs\n * under the workspace lock and at every companion start, and one per path per record was minutes on a\n * register a few days old.\n */\n private async carryTest(paths: readonly string[], pool: readonly CodingRunWriteRecord[]): Promise<(record: CodingRunWriteRecord, filePath: string) => boolean> {\n const asked = new Set(paths);\n const owns = (record: CodingRunWriteRecord, filePath: string): boolean => {\n const file = record.files.find((entry) => entry.path === filePath);\n return file !== undefined && !isAttributedToAnotherWriter(file.attribution);\n };\n const pathsByHead = new Map<string, Set<string>>();\n for (const record of pool) {\n for (const file of record.files) {\n if (!asked.has(file.path) || !owns(record, file.path)) continue;\n const heads = pathsByHead.get(record.postRunHeadSha) ?? new Set<string>();\n heads.add(file.path);\n pathsByHead.set(record.postRunHeadSha, heads);\n }\n }\n /*\n * Per post-run HEAD: for each path a lane commit took since it, the LATEST committer second among those\n * commits — or `undefined` when git cannot resolve the HEAD.\n */\n const takenSince = new Map<string, ReadonlyMap<string, number> | undefined>();\n for (const [head, headPaths] of pathsByHead) {\n const log = await this.execGit([\n 'log', '-z', '--relative', '--name-only', '--no-renames', '--ancestry-path',\n `--format=%x1e%ct%x1c%(trailers:${LANE_COMMIT_TRAILERS.map((key) => `key=${key}`).join(',')},only,unfold,separator=%x1f)%x1d`,\n `${head}..HEAD`, '--', ...[...headPaths].sort(),\n ], { acceptExitCodes: [128] });\n if (log.exitCode === 128) {\n takenSince.set(head, undefined);\n continue;\n }\n const taken = new Map<string, number>();\n for (const commit of log.stdout.split(COMMIT_MARK)) {\n const end = commit.indexOf(TRAILERS_END);\n const timeEnd = commit.indexOf(TIME_END);\n if (end < 0 || timeEnd < 0 || commit.slice(timeEnd + 1, end).trim() === '') continue;\n const committedAt = Number(commit.slice(0, timeEnd));\n for (const name of commit.slice(end + 1).split('\\0')) {\n const filePath = name.replace(/^\\n+/u, '');\n if (filePath) taken.set(filePath, Math.max(taken.get(filePath) ?? Number.NEGATIVE_INFINITY, committedAt));\n }\n }\n takenSince.set(head, taken);\n }\n return (record, filePath) => {\n if (!owns(record, filePath)) return false;\n const takenAt = takenSince.get(record.postRunHeadSha)?.get(filePath);\n // Taken only by a lane commit from the capture's own second or later (review 8 L1).\n return takenAt === undefined || takenAt < Math.floor(Date.parse(record.at) / 1_000);\n };\n }\n\n /**\n * Which of these paths differ from HEAD right now — modified, deleted, or new and untracked. Read from\n * `git status` rather than from the register, because what the register recorded may since have been\n * committed by the run's own accept.\n */\n private async uncommittedAmong(paths: readonly string[]): Promise<Set<string>> {\n const unique = [...new Set(paths)];\n if (unique.length === 0) return new Set();\n /*\n * With `-z`, `git status` prints paths relative to the REPOSITORY root whatever `-C` says (#1805 review\n * R1; the same trap `GitChangeSetCompanionService.resolveApplicationRelativePathMapper` records). For an\n * application nested in its repository — every dogfood application here — nothing would ever match the\n * register's application-relative paths, so the prefix git reports for the application is stripped.\n */\n const prefix = (await this.execGit(['rev-parse', '--show-prefix'])).stdout.replace(/\\r?\\n$/u, '');\n const toApplicationPath = (repositoryPath: string): string => (prefix && repositoryPath.startsWith(prefix) ? repositoryPath.slice(prefix.length) : repositoryPath);\n const status = await this.execGit(['status', '--porcelain=v1', '-z', '--untracked-files=all', '--', ...unique]);\n const tokens = status.stdout.split('\\0');\n const dirty = new Set<string>();\n for (let index = 0; index < tokens.length; index += 1) {\n const entry = tokens[index]!;\n if (entry.length < 4) continue;\n dirty.add(toApplicationPath(entry.slice(3)));\n // A rename or copy is `XY new\\0old`: the ORIGINAL path is its own token, and it changed too.\n if (entry[0] === 'R' || entry[0] === 'C' || entry[1] === 'R' || entry[1] === 'C') {\n index += 1;\n if (tokens[index]) dirty.add(toApplicationPath(tokens[index]!));\n }\n }\n return new Set(unique.filter((filePath) => dirty.has(filePath)));\n }\n\n /**\n * Accept a playbook run's writes, from its register: the same divergence test `revert` applies.\n *\n * Inside the dossier write queue (#2332): the commit carries the dossier its aggregate imports, so an answer\n * landing between the import closure and `git add` could wire a module the closure never saw. Nothing that\n * holds the queue calls this, so it cannot deadlock.\n */\n public async acceptPlaybookRun(input: { readonly runId: string; readonly force?: boolean; readonly origin?: AcceptOrigin }): Promise<AcceptedChangeCommitOutcome> {\n await this.refuseWhileACodingRunWrites(input.origin ?? AcceptOrigin.OPERATOR);\n const specificationsPackageRoot = this.companionContext.resolvedSpecifications?.packageRoot;\n return specificationsPackageRoot\n ? serializeDossierWrite(specificationsPackageRoot, () => this.commitPlaybookRun(input))\n : this.commitPlaybookRun(input);\n }\n\n private async commitPlaybookRun(input: { readonly runId: string; readonly force?: boolean; readonly origin?: AcceptOrigin }): Promise<AcceptedChangeCommitOutcome> {\n const diff = await this.playbookRunWrites.describeRunDiff(input.runId);\n const record = (await this.playbookRunWrites.list()).find((candidate) => candidate.runId === input.runId);\n const accepted: string[] = [];\n const refused: AcceptRefusal[] = [];\n /*\n * A DIVERGED path is committed as THIS RUN'S CHANGE merged onto HEAD (#2418), never as the working file.\n *\n * Runs share aggregate files: a family's `index.ts`, `companion-exports.ts`, `src/index.ts`, `COHERENCE.md`. Once a\n * later run rewrote one, the whole-file test refused this run's copy, so the latest run's commit carried every\n * earlier run's lines and earlier runs were committed without their wiring. On app-creation-test-005 the market\n * snapshot landed under the capability map's commit, and the requirements commit did not export its family; no\n * intermediate commit compiled alone. The run's change is exactly `previousContent → writtenContent`, so a\n * three-way merge onto HEAD commits that change and nothing else: a later run's lines stay in the working tree\n * for its own accept, and a person's edit is never committed under the run's name. A merge that conflicts is\n * refused as before. `force` keeps its meaning: the whole working file.\n *\n * Only where a LATER RUN explains the divergence. A file that no later run wrote was changed by a person or a tool\n * (#1614), possibly to repair the run's output; committing the run's version there could commit what the person\n * fixed. That case is refused as before and counted as edited outside the runs.\n */\n /*\n * PARTIAL by design, unlike the charter accept: a refused path (a person's edit, or a conflict that does not merge)\n * is named in the commit message and left for a later accept, and the rest of the run commits. Refusing the whole\n * run would hold back every unrelated file over one edit a person made, and the posture's pending-run commits rely on\n * the rest landing. The cost, reviewed and accepted: when the refused path is a shared aggregate, the run's module\n * can land before its wiring (it compiles, and exports nothing until the earlier run's accept lets the wiring merge).\n */\n const committedContent = new Map<string, string>();\n const succession = diff.files.some((file) => file.diverged) && input.force !== true\n ? await this.playbookRunWrites.describeSuccession(input.runId)\n : new Map<string, PlaybookRunFileSuccession>();\n for (const file of diff.files) {\n // A person's decision record is no playbook run's to commit, forced or not (review of 8d6b95d29).\n if (isBuildTaskDecisionsPath(file.path, this.companionContext)) {\n refused.push({ path: file.path, reason: AcceptRefusalReason.PERSON_DECISION_RECORD });\n continue;\n }\n if (!file.diverged || input.force === true) {\n accepted.push(file.path);\n continue;\n }\n const writtenEntry = succession.get(file.path) === PlaybookRunFileSuccession.LATER_RUN\n ? record?.files.find((entry) => entry.path === file.path)\n : undefined;\n // A binary entry (#3264) holds no bytes to merge: a diverged binary file is refused as edited, like a conflict.\n const written = writtenEntry !== undefined && !isBinaryWrittenFile(writtenEntry) ? writtenEntry : undefined;\n const merged = written ? await this.mergeRunChangeOntoHead(file.path, written.previousContent, written.writtenContent) : undefined;\n if (merged === undefined) {\n refused.push({ path: file.path, reason: AcceptRefusalReason.EDITED_SINCE_THE_RUN });\n continue;\n }\n committedContent.set(file.path, merged);\n accepted.push(file.path);\n }\n if (accepted.length === 0) {\n throw new NothingToAcceptError(\n `Nothing of run ${input.runId} can be accepted: ${refused.map((entry) => `${entry.path} (${entry.reason})`).join(', ')}.`,\n refused,\n );\n }\n const messageFor = (accepted: readonly string[], refused: readonly AcceptRefusal[]) => [\n `${diff.playbookRef}: accept the run's writes`,\n '',\n `${ACCEPT_ORIGIN_SENTENCE[input.origin ?? AcceptOrigin.OPERATOR]}: the writes of playbook run ${diff.runId} on ${diff.at}.`,\n // A run that failed part-way (#3237): what it wrote before it stopped, said so the history does not read it as a landing.\n ...(record?.landingFailed === true ? ['', 'The run FAILED after writing these: this commit holds what it wrote before it stopped, not a completed landing.'] : []),\n // Files this run adopted from an earlier failed run of the same playbook (#3237 review F4): named, with that run.\n ...(record?.adoptedFrom !== undefined\n ? ['', 'Adopted from an earlier failed run of this playbook, which wrote them; this run still composes them:',\n ...record.adoptedFrom.map((adopted) => `- run ${adopted.runId}: ${adopted.paths.join(', ')}`)]\n : []),\n '',\n ...accepted.map((filePath) => `- ${filePath}`),\n ...(refused.length > 0 ? ['', `Not included (refused by name): ${refused.map((entry) => `${entry.path} — ${entry.reason}`).join('; ')}`] : []),\n // What the landing dropped because a ref resolved to nothing (#2556): absent from these files, named here instead.\n // An ENTRY drop (#3074) took entries of one field and kept the item, which the line says so it does not read as the item gone.\n ...((record?.droppedItems?.length ?? 0) > 0\n ? ['', 'Dropped when the run landed (a ref they carried resolves to nothing):',\n ...record!.droppedItems!.map((item) => (item.scope === CandidateDropScope.ENTRY\n ? `- ${item.family}: ${item.itemRef} kept, its ${item.field} entries naming ${item.missingRefs.join(', ')} dropped`\n : `- ${item.family}: ${item.itemRef} (${item.field} → ${item.missingRefs.join(', ')})`))]\n : []),\n // Research evidence a sibling step read only withheld or marked (#2938): what the landed artifacts were derived from.\n ...researchScreeningCommitLines(record?.researchScreenings),\n '',\n `${PLAYBOOK_RUN_TRAILER}: ${diff.runId}`,\n ].join('\\n');\n /*\n * Closed under its imports (#2332): the aggregate files a run wires into also carry the lines the dossier\n * landing added, so the dossier the run read is carried with it, and any other module the commit would\n * import without holding refuses the accept by name rather than leaving HEAD uncompilable.\n *\n * One exception, kept partial like the rest of this accept (#4000): a module THIS accept left out above (edited\n * since the run) leaves out the run's files that import it too, refused by name, until the set closes. Any other\n * unresolved import still refuses the whole accept.\n */\n let toCommit = [...accepted];\n for (;;) {\n try {\n const outcome = await this.commitPaths(toCommit, messageFor(toCommit, refused), input.origin ?? AcceptOrigin.OPERATOR, ImportClosurePolicy.REFUSE_UNRESOLVED, committedContent);\n await this.playbookRunWrites.markAccepted(input.runId, outcome.commitSha, new Date().toISOString());\n return { ...outcome, refusedPaths: refused };\n } catch (error) {\n if (!(error instanceof AcceptWouldLeaveUnresolvedImportError)) throw error;\n const importersOfLeftOut = importersOfLeftOutModules(error.unresolved, refused, toCommit);\n if (importersOfLeftOut.length === 0) throw error;\n for (const importer of importersOfLeftOut) refused.push({ path: importer, reason: AcceptRefusalReason.IMPORTS_A_LEFT_OUT_PATH });\n toCommit = toCommit.filter((filePath) => !importersOfLeftOut.includes(filePath));\n if (toCommit.length === 0) {\n throw new NothingToAcceptError(\n `Nothing of run ${input.runId} can be accepted: ${refused.map((entry) => `${entry.path} (${entry.reason})`).join(', ')}.`,\n refused,\n );\n }\n }\n }\n }\n\n /**\n * A run's change to one file (`previousContent → writtenContent`), applied to the file as HEAD holds it (#2418).\n * `undefined` when the merge conflicts: the change cannot be separated from what moved since, so it is refused.\n * A file the run created and HEAD lacks merges from empty, which yields the run's own bytes.\n */\n private async mergeRunChangeOntoHead(applicationPath: string, previousContent: string | undefined, writtenContent: string): Promise<string | undefined> {\n const atHead = await this.execGit(['cat-file', '-p', `HEAD:./${applicationPath}`], { acceptExitCodes: [128] });\n const headContent = atHead.exitCode === 0 ? atHead.stdout : '';\n const directory = await mkdtemp(path.join(tmpdir(), 'wildo-accept-merge-'));\n try {\n const ours = path.join(directory, 'head');\n const base = path.join(directory, 'base');\n const theirs = path.join(directory, 'run');\n await writeFile(ours, headContent, 'utf8');\n await writeFile(base, previousContent ?? '', 'utf8');\n await writeFile(theirs, writtenContent, 'utf8');\n // `-p` prints the result; the exit code is the number of conflicts (capped), negative on error.\n const merged = await this.execGit(['merge-file', '-p', ours, base, theirs], { acceptExitCodes: MERGE_FILE_CONFLICT_EXIT_CODES });\n /*\n * A conflict is refused, never resolved by a line-level fallback. One was tried for an insertion next to a line\n * HEAD lacks (7f378f127f, 3f9f67902c, 0431638a5e) and three independent reviews found it returning WRONG text\n * that would have been committed: dropped lines, then misplaced ones, then a middle alignment no extreme-pair\n * check sees (1,200 wrong of ~600k exhaustive small cases). Which side an identical line belongs to is not\n * decidable from content, and a commit must never be a guess. The remedy for a refusal is to accept the earlier\n * run first, after which this merge is clean.\n */\n return merged.exitCode === 0 ? merged.stdout : undefined;\n } finally {\n await rm(directory, { recursive: true, force: true }).catch(() => undefined);\n }\n }\n\n /**\n * Accept EVERY playbook run whose writes are not yet accepted — the third site of #1534's invariant,\n * run by the coding dispatch inside its worktree window, immediately before it takes a baseline.\n *\n * **Why at a baseline, and not when the playbook run ends.** A playbook run's writes do not need a\n * commit to count — the choreography reads the working tree — so nothing stalls without one. What\n * goes wrong is later: a coding run that edits a file a playbook left uncommitted finds it dirty at\n * its baseline, and this door then refuses that path as `carries_changes_from_before_the_run`. So\n * the moment that matters is the instant before a baseline. Committing when the playbook run ends\n * would instead need the worktree lock for the whole run, or land inside a live coding run's window\n * — which is what destroys its attribution. It is also exactly where the operator's shell loop\n * committed during the 2026-09-23 run, \"between dispatches\".\n *\n * **Oldest first, and each run commits its own change (#2418).** A later run that rewrote a file makes an\n * earlier run's copy `diverged`; the earlier run's change is then merged onto HEAD and committed under its\n * name, and the later run's accept commits its own change on top. A path whose change no longer merges, and a\n * run whose every path is refused, throws `NothingToAcceptError`, which is counted here, not raised. (Before\n * #2418 the earlier run was refused and the later one committed the file whole, carrying both runs' lines.)\n *\n * **Superseded is counted apart from edited (#1614).** A later RUN that rewrote the path read this\n * run's landing first, or merged into it: the landing refuses to replace a file that moved since the\n * run read it, so a later run can no longer discard an earlier one. A path no later run wrote was\n * changed by a person or a tool, and that is reported as `editedOutsideRuns`, not as superseded. Records whose paths already match HEAD are stamped with no new commit,\n * which is how the unstamped backlog of a run carried by hand is absorbed on the first pass.\n */\n public async acceptPendingPlaybookRuns(origin: AcceptOrigin): Promise<{\n readonly accepted: number;\n readonly superseded: number;\n readonly editedOutsideRuns: number;\n readonly failed: number;\n }> {\n const pending = (await this.playbookRunWrites.list())\n .filter((record) => record.acceptedCommitSha === undefined)\n // Research evidence waits for a person's accept (#2419): never carried by the automatic commit.\n .filter((record) => record.acceptOnRequestOnly !== true)\n /*\n * A run that FAILED after writing (#3237): its record makes its writes attributable and keeps them out of a\n * coding run's commit, but a half-applied composition is a person's to accept or revert, never the posture's.\n */\n .filter((record) => record.landingFailed !== true)\n .sort((left, right) => left.at.localeCompare(right.at));\n let accepted = 0;\n let superseded = 0;\n let editedOutsideRuns = 0;\n let failed = 0;\n for (const record of pending) {\n try {\n await this.acceptPlaybookRun({ runId: record.runId, origin });\n accepted += 1;\n } catch (error) {\n if (error instanceof NothingToAcceptError) {\n const succession = await this.playbookRunWrites.describeSuccession(record.runId);\n if ([...succession.values()].every((entry) => entry === PlaybookRunFileSuccession.LATER_RUN)) superseded += 1;\n else {\n editedOutsideRuns += 1;\n this.logDebug('A playbook run\\'s writes were changed outside the runs before they could be accepted', { runId: record.runId, playbookRef: record.playbookRef });\n }\n continue;\n }\n failed += 1;\n this.logger.warn('Could not accept a playbook run\\'s writes', { runId: record.runId, playbookRef: record.playbookRef, error: describeCaughtError(error) });\n }\n }\n if (pending.length > 0) this.logDebug('Accepted pending playbook runs', { pending: pending.length, accepted, superseded, editedOutsideRuns, failed });\n return { accepted, superseded, editedOutsideRuns, failed };\n }\n\n /**\n * Which of a coding run's paths this service can vouch for. Attribution decides first — a path\n * that is not the run's is never accepted, whatever `force` says — then the bytes.\n */\n private async classifyCodingRunFiles(\n record: CodingRunWriteRecord,\n force: boolean,\n /**\n * Whether FORCE also passes a concurrent run's missing CLAIM (#1805 review R4). Only the shared-tree\n * door may: it commits unattributable work as such, naming every run. Any other forced accept — a\n * person's from the workbench, `wildo build accept` — commits under ONE run's name, and a path that run\n * never claimed is not its to be named for, forced or not.\n */\n passMissingClaims = false,\n /**\n * Unclaimed paths of a concurrent run that NO OTHER WRITER may have written (#3215, #3218): no other recorded run\n * may carry them, no coding run is live beside it, and no unaccepted playbook run recorded them. Accepted as the\n * run's own by elimination (see {@link unclaimedPathsNoOtherWriterMayHave}); every other check still applies.\n */\n ownByElimination: ReadonlySet<string> = new Set(),\n ): Promise<{\n readonly accepted: readonly string[];\n readonly refused: readonly AcceptRefusal[];\n }> {\n const accepted: string[] = [];\n const refused: AcceptRefusal[] = [];\n for (const file of record.files) {\n // First, and never forced: a person's decision record is no run's to commit (review of 8d6b95d29).\n if (isBuildTaskDecisionsPath(file.path, this.companionContext)) {\n refused.push({ path: file.path, reason: AcceptRefusalReason.PERSON_DECISION_RECORD });\n continue;\n }\n if (isAttributedToAnotherWriter(file.attribution)) {\n refused.push({ path: file.path, reason: AcceptRefusalReason.NOT_THIS_RUN });\n continue;\n }\n // A concurrent run's capture holds its siblings' files too; without FORCE it commits only what it claims.\n if (record.concurrent === true && file.claimedByRun !== true && !ownByElimination.has(file.path) && !(force && passMissingClaims)) {\n refused.push({ path: file.path, reason: AcceptRefusalReason.NOT_CLAIMED_BY_THE_RUN });\n continue;\n }\n /*\n * A generation step's file in a tree only it writes was regenerated whole (#3233): what was there before the run\n * (an earlier, uncommitted generation) is not mixed into it. Measured on app-creation-test-007 (F53): the labels\n * step's own composite-view label file was refused here, the task never landed, and every wave re-ran it.\n */\n if (file.attribution === ChangeSetAttributionClass.BASELINE_DIRTY_AMBIGUOUS && !force && file.inStepOwnedTree !== true) {\n refused.push({ path: file.path, reason: AcceptRefusalReason.CARRIES_CHANGES_FROM_BEFORE_THE_RUN });\n continue;\n }\n const bytes = await readFile(path.resolve(this.companionContext.saasRoot, file.path)).catch(() => undefined);\n const current = bytes === undefined ? undefined : sha256Hex(bytes);\n if (current !== file.contentSha256 && !force) {\n refused.push({ path: file.path, reason: AcceptRefusalReason.EDITED_SINCE_THE_RUN });\n continue;\n }\n accepted.push(file.path);\n }\n return { accepted, refused };\n }\n\n /**\n * A concurrent run's accept commits under ONE task's name, so every path it takes must carry that task's\n * own declared product where the task declares one (#2209). Claims are per path: a chapters index, a\n * locale file or a barrel that several runs of a wave all edited is claimed by each of them, and whichever\n * accepts first used to commit it whole, holding a sibling's product and possibly none of its own.\n * Measured on `app-creation-test-004` (2026-10-01): `ca9d3bc`, labelled with the customer-workflow-overview\n * task, added only another task's chapter, while the overview chapter had been overwritten.\n *\n * A withheld path is not lost: it stays uncommitted for the shared-tree reconciliation, which commits it\n * naming every run it may carry: under one run's name when only that run may carry it (#3218), else as writer\n * unknown.\n *\n * Applies to every door that names ONE run: the posture's accept, the workbench's, `wildo build accept`\n * (forced or not). Not to a restart's recovery of a run that was alone in its window (its files are its\n * own, and refusing there would leave them with no committer), and never to the shared-tree door, which\n * claims no single writer. A concurrent run with no witness registered is accepted as before; the build\n * layer that creates concurrent runs registers one when it is constructed, so that is a test harness, not\n * the companion.\n *\n * The witness reads the working file, and `git add` follows it while siblings may still be writing: a write\n * landing between the two can still carry a file without the product into the commit. That is the window\n * the bytes check (`EDITED_SINCE_THE_RUN`) already has, and it is closed by the same thing, the wave's\n * end-of-run repair, not by this check.\n *\n * ## Only where another writer may be what the file holds (#3218)\n *\n * The refusal protects the NAME on the commit: a file whose product is missing may hold a sibling's work\n * instead of this run's. When no other writer can have touched the path — no other recorded run may carry\n * it, no coding run is live beside this one, and no unaccepted playbook run recorded it — the file holds\n * only what this run wrote, so naming the run is true whatever its probe says, and the path is committed.\n * Whether the task LANDED is still decided by its probe at HEAD, so a run that did not produce its product\n * stays unlanded on its own commit. Before this, such a file waited for the wave's reconciliation and was\n * committed as \"writer unknown\", and the task's own accept said it had nothing: on `app-creation-test-007`\n * a navigation-config run's only write, its own config file, went that way (F42).\n */\n private async withholdPathsLackingOwnProduct(\n record: CodingRunWriteRecord,\n classified: { readonly accepted: readonly string[]; readonly refused: readonly AcceptRefusal[] },\n origin: AcceptOrigin,\n evidence: OtherWriterEvidence,\n ): Promise<{ readonly accepted: readonly string[]; readonly refused: readonly AcceptRefusal[] }> {\n if (record.concurrent !== true || origin === AcceptOrigin.INTERRUPTED_RUN_RECOVERY || classified.accepted.length === 0) return classified;\n if (!this.concurrentRunProductWitness) {\n this.logDebug('A concurrent run was accepted without a product witness: nothing registered one', { taskRef: record.taskRef });\n return classified;\n }\n const lacking = await this.concurrentRunProductWitness.pathsLackingOwnProduct(record.taskRef, classified.accepted);\n if (lacking.length === 0) return classified;\n const contested = await this.pathsAnotherWriterMayHave(record, lacking, evidence);\n const withheld = new Set(lacking.filter((filePath) => contested.has(filePath)));\n const ownAlone = lacking.filter((filePath) => !contested.has(filePath));\n if (ownAlone.length > 0) {\n this.logDebug('A concurrent run\\'s files lack its declared product, and no other writer may have written them: committed under its name', {\n taskRef: record.taskRef, taskId: record.taskId, paths: [...ownAlone].sort(),\n });\n }\n if (withheld.size === 0) return classified;\n this.logger.warn('A concurrent run\\'s accept withheld shared files that do not carry its own product and another writer may have written; the wave reconciliation commits them', {\n taskRef: record.taskRef,\n taskId: record.taskId,\n withheldPaths: [...withheld].sort(),\n });\n return {\n accepted: classified.accepted.filter((filePath) => !withheld.has(filePath)),\n refused: [...classified.refused, ...[...withheld].sort().map((filePath) => ({ path: filePath, reason: AcceptRefusalReason.OWN_PRODUCT_ABSENT }))],\n };\n }\n\n /**\n * The paths a concurrent run captured WITHOUT claiming them that no other writer may have written (#3215, #3218):\n * its own by elimination.\n *\n * A concurrent run's capture holds every file that moved since its baseline, its siblings' included, so a missing\n * claim says nothing about who wrote a file (#1805), and the run's accept refuses an unclaimed path. But a sibling\n * that wrote a file in this run's window has that file in its OWN capture, because its baseline preceded its write\n * and its capture followed it. So when no other recorded run may carry the path, no writer without a record is\n * beside this run ({@link OtherWriterEvidence.unrecordedWriterBeside}), and no unaccepted playbook run owns it, no\n * other lane wrote it, and the run that captured it did. That is the same evidence a single-flight run's capture\n * rests on, and the same caveat: a person's edit in the window is indistinguishable from the agent's.\n *\n * Measured on `app-creation-test-007` (F32): a config task's teardown edge in `<module>.relationships.ts`, written\n * by its agent through its shell, was refused as unclaimed while the resources config that needed it was\n * committed, and HEAD did not boot until the wave's reconciliation took the edge minutes later. Known limit: when a\n * sibling's window spanned the write, the sibling's capture holds the edge too, so it is contested and still waits\n * for the reconciliation, as one change naming both runs. No record can say which of the two wrote it.\n *\n * Empty for a run that is not concurrent: its capture is its own already.\n */\n private async unclaimedPathsNoOtherWriterMayHave(record: CodingRunWriteRecord, evidence: OtherWriterEvidence): Promise<ReadonlySet<string>> {\n if (record.concurrent !== true) return new Set();\n const unclaimed = record.files\n .filter((file) => file.claimedByRun !== true && !isAttributedToAnotherWriter(file.attribution))\n .map((file) => file.path);\n if (unclaimed.length === 0) return new Set();\n const contested = await this.pathsAnotherWriterMayHave(record, unclaimed, evidence);\n return new Set(unclaimed.filter((filePath) => !contested.has(filePath)));\n }\n\n /**\n * Of `paths`, the ones a writer OTHER than `record`'s run may have written (#3218): every path while a writer\n * without a record is beside it ({@link OtherWriterEvidence.unrecordedWriterBeside}), else the paths another\n * recorded run may carry ({@link carryTest}, the test the shared-tree door names runs by) and the paths an\n * unaccepted playbook run owns.\n */\n private async pathsAnotherWriterMayHave(record: CodingRunWriteRecord, paths: readonly string[], evidence: OtherWriterEvidence): Promise<ReadonlySet<string>> {\n const unique = [...new Set(paths)];\n if (unique.length === 0) return new Set();\n if (evidence.unrecordedWriterBeside) return new Set(unique);\n const others = evidence.records.filter((candidate) => candidate.taskId !== record.taskId);\n const carries = await this.carryTest(unique, others);\n return new Set(unique.filter((filePath) => evidence.playbookOwners.has(filePath) || others.some((other) => carries(other, filePath))));\n }\n\n /**\n * What says who else may have written in the tree while `besideRecords` ran (#3218), gathered once per door.\n *\n * A writer with no record cannot be ruled out of any path, so its presence contests every path. It is read from the\n * DURABLE actor plane (#3218 re-review H1, M2), never from this process's memory, so it holds after a restart and for\n * a person's accept days later: every coding run and every generation step whose execution span overlapped one of the\n * runs' baseline→capture windows and that has no write record. That covers a run still selected, running or parked\n * (its span is open), a generation step that threw after writing or whose register write failed, a cancelled run\n * killed before its capture, and a run another process drove.\n *\n * Fails CLOSED, counting a writer that cannot be ruled out, when a record has no baseline instant (one written before\n * the field existed), when the plane cannot be listed, or when a listing reaches its ceiling: more than 200 executions\n * of one system overlapped one window, or are open now. The settled listing is bounded by each window (#3266), so a\n * window stays answerable however many executions followed it. An OPEN row that began before a window ended contests\n * every path, including an orphan whose abort never persisted: the startup sweep settles it, and the window is\n * answerable again from then on.\n */\n private async gatherOtherWriterEvidence(input: {\n readonly besideRecords: readonly CodingRunWriteRecord[];\n readonly candidatePaths: readonly string[];\n }): Promise<OtherWriterEvidence> {\n const records = await this.codingRunWrites.list();\n const playbookOwners = await this.unacceptedPlaybookRunOwners(input.candidatePaths);\n let unrecordedWriterBeside = false;\n try {\n unrecordedWriterBeside = await this.unrecordedWriterOverlapped(input.besideRecords, records);\n } catch (error) {\n this.logDebug('Could not read the coding and generation-step executions; every path counts as another writer\\'s', { error: describeCaughtError(error) });\n unrecordedWriterBeside = true;\n }\n return { records, playbookOwners, unrecordedWriterBeside };\n }\n\n /** See {@link gatherOtherWriterEvidence}: whether an execution with no write record overlapped any of the runs' windows. */\n private async unrecordedWriterOverlapped(besideRecords: readonly CodingRunWriteRecord[], records: readonly CodingRunWriteRecord[]): Promise<boolean> {\n if (besideRecords.length === 0) return false;\n const windows = besideRecords.map((record) => ({ startMs: record.baselineCapturedAt === undefined ? Number.NaN : Date.parse(record.baselineCapturedAt), endMs: Date.parse(record.at) }));\n if (windows.some((window) => Number.isNaN(window.startMs) || Number.isNaN(window.endMs))) return true;\n const recorded = new Set(records.map((record) => record.taskId));\n const own = new Set(besideRecords.map((record) => record.taskId));\n const nowMs = Date.now();\n const toMs = (value: unknown): number => (value instanceof Date ? value.getTime() : typeof value === 'string' ? Date.parse(value) : Number.NaN);\n const latestEndMs = Math.max(...windows.map((window) => window.endMs));\n /*\n * OPEN executions first, queried by STATUS (re-review F1): a parked, selected or orphaned run is not refreshed after it\n * stops moving, so a newest-updated listing can drop it behind 200 later rows while its open span still overlaps. Any\n * open row of another run that began before a window ended contests, and a capped open listing fails closed.\n */\n for (const [systemRef, status] of OPEN_TREE_WRITER_QUERIES) {\n const open = await this.executions.listActorExecutions(CompanionExecutionsListQuerySchema.parse({ systemRef, status, limit: EXECUTION_SPAN_SCAN_LIMIT }));\n if (open.length >= EXECUTION_SPAN_SCAN_LIMIT) return true;\n for (const row of open) {\n const execution = row as { createdAt?: unknown; standaloneTasks?: ReadonlyArray<{ _id?: unknown }> };\n const taskIds = (execution.standaloneTasks ?? []).map((task) => String(task._id));\n if (taskIds.length === 0 || taskIds.some((taskId) => own.has(taskId))) continue;\n const startMs = toMs(execution.createdAt);\n if (Number.isNaN(startMs) || startMs < latestEndMs) return true;\n }\n }\n /*\n * SETTLED executions, asked PER WINDOW by the window itself (#3266): created before it ended and finished after it\n * began, which is exactly the set whose span can overlap it. A newest-UPDATED listing capped at 200 rows used to\n * stop reaching an old window once 200 later executions existed, and from then on every question about that window\n * failed closed for good: a retry could never again vouch for what an earlier run of its task left. Bounded by the\n * window, the answer no longer depends on what happened after it. Only a window more than 200 executions of one\n * system overlapped still fails closed.\n */\n for (const window of windows) {\n for (const systemRef of TREE_WRITER_SYSTEM_REFS) {\n const rows = await this.executions.listActorExecutions(CompanionExecutionsListQuerySchema.parse({\n systemRef,\n createdBefore: new Date(window.endMs).toISOString(),\n finishedAfter: new Date(window.startMs).toISOString(),\n limit: EXECUTION_SPAN_SCAN_LIMIT,\n }));\n if (rows.length >= EXECUTION_SPAN_SCAN_LIMIT) return true;\n for (const row of rows) {\n const execution = row as { createdAt?: unknown; finishedAt?: unknown; standaloneTasks?: ReadonlyArray<{ _id?: unknown }> };\n const taskIds = (execution.standaloneTasks ?? []).map((task) => String(task._id));\n if (taskIds.length === 0 || taskIds.some((taskId) => own.has(taskId)) || taskIds.every((taskId) => recorded.has(taskId))) continue;\n // The bound is the store's; the span is still checked here, so a store that ignored it cannot widen the answer.\n const startMs = toMs(execution.createdAt);\n const endMs = execution.finishedAt === undefined || execution.finishedAt === null ? nowMs : toMs(execution.finishedAt);\n if (Number.isNaN(startMs)) return true;\n if (startMs < window.endMs && (Number.isNaN(endMs) || endMs > window.startMs)) return true;\n }\n }\n }\n return false;\n }\n\n /**\n * The candidate paths a playbook run that is NOT accepted yet still OWNS (#3221), with that run: the run recorded\n * the path, the working file is still exactly what it wrote, and HEAD does not hold that yet. So the run's change is\n * in the tree and uncommitted, and its own accept is the door that commits it.\n *\n * Both conditions keep the ownership from going stale (#3221 review F4). A record can stay unaccepted for good: a\n * person edited its file before the posture's accept, or committed it by hand. Ownership keyed on the record alone\n * would then refuse that path at every coding door forever, and a build task whose product sits in it would never\n * land. Once the file has moved past what the run wrote, the run's accept refuses it as edited anyway, so a coding\n * run's later edit on top is committed by the coding run, carrying the playbook's lines with it, as any shared file\n * does. Newest run first, because its accept is the one that commits the file's current change.\n */\n private async unacceptedPlaybookRunOwners(candidatePaths: readonly string[]): Promise<PlaybookRunOwners> {\n const candidates = new Set(candidatePaths);\n const owners = new Map<string, { readonly runId: string; readonly playbookRef: string }>();\n const decided = new Set<string>();\n /*\n * A landing IN FLIGHT first (#3221 residual, closed by #3237's landing window): a playbook landing that has begun\n * writing and has no record yet owns every candidate path whose bytes moved since it began. Without this, a door\n * asked in the seconds between a landing's write and its record saw no owner and could commit the playbook's file\n * under a build task. It is the latest writer, so it outranks every record.\n */\n for (const [filePath, owner] of await this.playbookRunWrites.landingsInFlightOwners([...candidates])) {\n owners.set(filePath, owner);\n decided.add(filePath);\n }\n // `list()` is newest first.\n for (const playbookRun of await this.playbookRunWrites.list()) {\n if (playbookRun.acceptedCommitSha !== undefined) continue;\n for (const file of playbookRun.files) {\n if (!candidates.has(file.path) || decided.has(file.path)) continue;\n const working = await readFile(path.resolve(this.companionContext.saasRoot, file.path)).catch(() => undefined);\n // One test for text and binary entries (#3264): a binary write is owned while the file hashes to what it wrote.\n if (!holdsWrittenBytes(file, working)) continue;\n decided.add(file.path);\n if (await this.headHoldsWorkingFile(file.path)) continue;\n owners.set(file.path, { runId: playbookRun.runId, playbookRef: playbookRun.playbookRef });\n }\n }\n return owners;\n }\n\n /**\n * Whether HEAD already holds the working file's bytes at this path: git's own blob id of the working file against\n * HEAD's. Byte-exact for text and binary files alike (#3264), where comparing `cat-file` output as text cannot be.\n */\n private async headHoldsWorkingFile(applicationPath: string): Promise<boolean> {\n const atHead = await this.execGit(['rev-parse', '--verify', '--quiet', `HEAD:./${applicationPath}`], { acceptExitCodes: [0, 1, 128] });\n if (atHead.exitCode !== 0) return false;\n const working = await this.execGit(['hash-object', '--', applicationPath], { acceptExitCodes: [0, 128] });\n return working.exitCode === 0 && working.stdout.trim() === atHead.stdout.trim();\n }\n\n /**\n * `git add -- <paths>` then `git commit -F <message> -- <paths>`. A deleted path is staged as a\n * removal by the same `add`. When the paths are already identical to HEAD there is nothing to\n * commit, and that is answered as `alreadyCommitted` with the commit that last changed those paths rather than as a failure.\n *\n * **Closed under its own imports first (#2332).** Every door commits through here, so the closure cannot be\n * skipped by a door that forgot it; `closure` is required, so each door states what it does with an import\n * its commit would not resolve. A carried dossier module joins the paths, and the message names it in a\n * paragraph of its own just before the trailers, so the history says the commit holds a file no run wrote.\n */\n private async commitPaths(\n requestedPaths: readonly string[],\n requestedMessage: string,\n origin: AcceptOrigin,\n closure: ImportClosurePolicy,\n /** Paths committed with these bytes instead of the working file (#2418). Empty: every path from the working tree. */\n committedContent: ReadonlyMap<string, string> = new Map(),\n /** Only the decision door ({@link commitDecisionRecord}) may commit a person's build-task decisions. */\n permitsPersonDecisionRecord = false,\n ): Promise<Omit<AcceptedChangeCommitOutcome, 'refusedPaths'> & { readonly commitSha: string }> {\n /*\n * The backstop behind every door's own refusal (review of 8d6b95d29): a person's decision record reaches a commit only\n * through the decision door. Any other door reaching here with it is a defect in that door, so the commit fails closed.\n */\n const decisionRecords = requestedPaths.filter((requested) => isBuildTaskDecisionsPath(requested, this.companionContext));\n if (decisionRecords.length > 0 && !permitsPersonDecisionRecord) {\n throw new AcceptedChangeCommitError(`Refusing to commit ${decisionRecords.join(', ')}: only a person records build-task decisions, through \\`wildo build close\\` or \\`wildo build approve\\`.`, '');\n }\n const closed = await this.closeOverImports(requestedPaths, closure, committedContent);\n const paths = closed.paths;\n const message = withAcceptanceTrailers(closed.carried.length === 0 ? requestedMessage : withCarriedParagraph(requestedMessage, closed.carried), origin);\n if (committedContent.size > 0) return this.commitThroughTemporaryIndex(paths, message, origin, committedContent, closed.carried);\n /*\n * Every commit here runs inside the workspace-mutation lock. If that lock was taken from this holder\n * while it ran (#2225), another writer may be in the index now, so committing \"as the exclusive\n * writer\" would attribute its work to this run. Asked before staging and again before committing,\n * because a loss can land between the two. Outside any lock this is a no-op.\n */\n assertHeldFileLocksIntact();\n await this.execGit(['add', '--', ...paths]);\n const staged = await this.execGit(['diff', '--cached', '--quiet', '--', ...paths], { acceptExitCodes: [0, 1] });\n if (staged.exitCode === 0) {\n /*\n * The commit that last changed these paths, never merely HEAD (#1805 review N6): HEAD may be any\n * later, unrelated commit, and a record marked accepted \"on\" it would name a commit holding none of\n * the run's work. Falls back to HEAD only for paths git has no history for.\n */\n const lastTouching = (await this.execGit(['log', '-1', '--format=%H', '--', ...paths])).stdout.trim();\n const commitSha = lastTouching || (await this.execGit(['rev-parse', 'HEAD'])).stdout.trim();\n this.logDebug('Nothing to commit: every accepted path already matches HEAD', { paths, commitSha });\n return { commitSha, committedPaths: [...paths], carriedPaths: closed.carried, alreadyCommitted: true, message };\n }\n const messagePath = path.join(tmpdir(), `wildo-accept-${process.pid}-${Date.now()}.txt`);\n await writeFile(messagePath, `${message}\\n`, 'utf8');\n try {\n // assurance-control: WILDO.SOFTWARE.AI_PRODUCED_CHANGE_CONTROL — the pathspec commit carries the author its accept origin names.\n const author = acceptOriginAuthor(origin);\n assertHeldFileLocksIntact();\n await this.execGit(['commit', '--quiet', ...(author ? [`--author=${author}`] : []), '-F', messagePath, '--', ...paths]);\n } finally {\n await unlink(messagePath).catch(() => undefined);\n }\n const commitSha = (await this.execGit(['rev-parse', 'HEAD'])).stdout.trim();\n this.logDebug('Accepted a run as a commit', { commitSha, paths: paths.length, carried: closed.carried });\n return { commitSha, committedPaths: [...paths], carriedPaths: closed.carried, alreadyCommitted: false, message };\n }\n\n /**\n * A commit whose tree holds some paths with bytes OTHER than the working file's (#2418): built in a temporary index\n * from HEAD, so neither the shared index nor anyone else's staging is part of it, and moved onto HEAD only if HEAD is\n * still where the commit was built from. The shared index is then pointed at what was committed for these paths\n * only, so it does not read as a staged revert of this commit; a merged path's later lines stay unstaged in the\n * working tree, where they belong to the run that wrote them.\n */\n private async commitThroughTemporaryIndex(\n paths: readonly string[],\n message: string,\n origin: AcceptOrigin,\n committedContent: ReadonlyMap<string, string>,\n carried: readonly string[],\n ): Promise<Omit<AcceptedChangeCommitOutcome, 'refusedPaths'> & { readonly commitSha: string }> {\n const base = (await this.execGit(['rev-parse', 'HEAD'])).stdout.trim();\n /*\n * `update-index --cacheinfo` takes a path from the REPOSITORY root, not from `-C`, unlike every other command here.\n * An application nested in its repository (every dogfood application) needs the prefix git reports for it.\n */\n const prefix = (await this.execGit(['rev-parse', '--show-prefix'])).stdout.replace(/\\r?\\n$/u, '');\n const directory = await mkdtemp(path.join(tmpdir(), 'wildo-accept-index-'));\n const env = { GIT_INDEX_FILE: path.join(directory, 'index') };\n try {\n assertHeldFileLocksIntact();\n await this.execGit(['read-tree', base], { env });\n const fromWorkingTree = paths.filter((applicationPath) => !committedContent.has(applicationPath));\n if (fromWorkingTree.length > 0) await this.execGit(['add', '--', ...fromWorkingTree], { env });\n for (const [applicationPath, content] of committedContent) {\n const blobFile = path.join(directory, 'blob');\n await writeFile(blobFile, content, 'utf8');\n const blob = (await this.execGit(['hash-object', '-w', blobFile])).stdout.trim();\n const listed = (await this.execGit(['ls-tree', base, '--', applicationPath])).stdout.trim();\n const mode = listed.split(/\\s+/u)[0] || '100644';\n await this.execGit(['update-index', '--add', '--cacheinfo', `${mode},${blob},${prefix}${applicationPath}`], { env });\n }\n const staged = await this.execGit(['diff', '--cached', '--quiet', base, '--', ...paths], { acceptExitCodes: [0, 1], env });\n if (staged.exitCode === 0) {\n const lastTouching = (await this.execGit(['log', '-1', '--format=%H', '--', ...paths])).stdout.trim();\n return { commitSha: lastTouching || base, committedPaths: [...paths], carriedPaths: carried, alreadyCommitted: true, message };\n }\n const tree = (await this.execGit(['write-tree'], { env })).stdout.trim();\n const messagePath = path.join(directory, 'message');\n await writeFile(messagePath, `${message}\\n`, 'utf8');\n // assurance-control: WILDO.SOFTWARE.AI_PRODUCED_CHANGE_CONTROL — the temporary-index commit carries the same author, so neither commit writer can attribute an automatic acceptance to a person.\n const author = parseGitIdentity(acceptOriginAuthor(origin));\n const commitSha = (await this.execGit(['commit-tree', tree, '-p', base, '-F', messagePath], {\n env: author ? { GIT_AUTHOR_NAME: author.name, GIT_AUTHOR_EMAIL: author.email } : {},\n })).stdout.trim();\n assertHeldFileLocksIntact();\n await this.execGit(['update-ref', '-m', 'wildo accept', 'HEAD', commitSha, base]);\n for (const applicationPath of paths) {\n const listed = (await this.execGit(['ls-tree', commitSha, '--', applicationPath])).stdout.trim();\n const [mode, , blob] = listed.split(/\\s+/u);\n if (mode && blob) await this.execGit(['update-index', '--add', '--cacheinfo', `${mode},${blob},${prefix}${applicationPath}`]);\n // Deleted by this commit: the shared index must not keep the old blob, or it reads as a staged re-add.\n else await this.execGit(['update-index', '--force-remove', '--', applicationPath]);\n }\n this.logDebug('Accepted a run as a commit with merged paths', { commitSha, paths: paths.length, merged: [...committedContent.keys()] });\n return { commitSha, committedPaths: [...paths], carriedPaths: carried, alreadyCommitted: false, message };\n } finally {\n await rm(directory, { recursive: true, force: true }).catch(() => undefined);\n }\n }\n\n /**\n * The paths a commit must hold for its tree to resolve its own relative imports (#2332), under `policy`.\n * Throws {@link AcceptWouldLeaveUnresolvedImportError} before anything is staged when the policy refuses.\n */\n private async closeOverImports(\n paths: readonly string[],\n policy: ImportClosurePolicy,\n committedContent: ReadonlyMap<string, string> = new Map(),\n ): Promise<{ readonly paths: readonly string[]; readonly carried: readonly string[] }> {\n const dossier = this.dossierModulePaths();\n const closed = await closeCommitOverRelativeImports({\n saasRoot: this.companionContext.saasRoot,\n paths,\n isCarriable: (applicationPath) => dossier.has(applicationPath),\n presentAtHead: (candidates) => this.presentAtHead(candidates),\n differingFromHead: (candidates) => this.uncommittedAmong(candidates),\n ...(committedContent.size > 0 ? { committedContent } : {}),\n });\n if (closed.unresolved.length > 0) {\n if (policy === ImportClosurePolicy.REFUSE_UNRESOLVED) throw new AcceptWouldLeaveUnresolvedImportError(await this.withWriters(closed.unresolved));\n // Debug, not warn: under this policy it is the expected transient of a wave, and the TypeScript build is the floor.\n this.logDebug('A commit leaves relative imports its tree does not resolve; a sibling run\\'s accept or the wave reconciliation is expected to commit them', {\n unresolved: closed.unresolved,\n });\n }\n return { paths: closed.paths, carried: closed.carried };\n }\n\n /** Each unresolved import with the unaccepted playbook run that wrote its module, newest first, when one did. */\n private async withWriters(unresolved: readonly UnresolvedCommitImport[]): Promise<readonly UnresolvedImportWithWriter[]> {\n const pending = (await this.playbookRunWrites.list()).filter((record) => record.acceptedCommitSha === undefined);\n return unresolved.map((entry) => {\n const writer = entry.workingTreeModule === undefined\n ? undefined\n : pending.find((record) => record.files.some((file) => file.path === entry.workingTreeModule));\n return writer ? { ...entry, writtenBy: { runId: writer.runId, playbookRef: writer.playbookRef } } : entry;\n });\n }\n\n /** The dossier families whose module is among `paths`, in {@link DOSSIER_FAMILIES} order. */\n private dossierFamiliesOf(paths: readonly string[]): readonly ApplicationSpecificationFamily[] {\n const specificationsPackageRoot = this.companionContext.resolvedSpecifications?.packageRoot;\n if (!specificationsPackageRoot) return [];\n const specificationsRelativeRoot = path.relative(this.companionContext.saasRoot, specificationsPackageRoot).split(path.sep).join('/');\n return DOSSIER_FAMILIES.filter((family) => {\n const relative = getFamilyPackageRelativePath(family);\n return relative !== undefined && paths.includes(path.posix.join(specificationsRelativeRoot, relative));\n });\n }\n\n /** The dossier's module files, application-relative; empty when the application declares no specifications package. */\n private dossierModulePaths(): Set<string> {\n const specificationsPackageRoot = this.companionContext.resolvedSpecifications?.packageRoot;\n if (!specificationsPackageRoot) return new Set();\n const specificationsRelativeRoot = path.relative(this.companionContext.saasRoot, specificationsPackageRoot).split(path.sep).join('/');\n return new Set(DOSSIER_FAMILIES\n .map((family) => getFamilyPackageRelativePath(family))\n .filter((relative): relative is string => relative !== undefined)\n .map((relative) => path.posix.join(specificationsRelativeRoot, relative)));\n }\n\n /** Which of these application-relative paths HEAD holds as files. `-r`, so a directory pathspec never answers for itself. */\n private async presentAtHead(paths: readonly string[]): Promise<ReadonlySet<string>> {\n if (paths.length === 0) return new Set();\n const listed = await this.execGit(['ls-tree', '-r', '--name-only', '-z', 'HEAD', '--', ...paths], { acceptExitCodes: [0, 128] });\n // 128: no HEAD yet (an unborn branch), which holds nothing.\n if (listed.exitCode !== 0) return new Set();\n return new Set(listed.stdout.split('\\0').filter((entry) => entry.length > 0));\n }\n\n /**\n * Commit the creator's DOSSIER on its own (#2332): `wildo creation accept --dossier`.\n *\n * An answer, an interview depth and a governance-fact landing each write the dossier and commit nothing (a\n * landed dossier is a working edit until a person accepts it, `one-source-of-truth.md` rules 2 and 3). A run\n * that reads the dossier carries it into its own accept; this is the door for answers no accepted run has read\n * yet, and the one `wildo creation depth` names.\n *\n * What it commits: every dossier module that differs from HEAD, and, when one of them is NEW at HEAD, the two\n * aggregate files that wire it (`src/companion-exports.ts`, `src/index.ts`), since a module HEAD does not hold\n * is a module HEAD's aggregate does not read yet. Those files are committed whole, so they carry any other\n * family's wiring line too: the import closure then refuses by name when such a line points at a module no\n * commit holds yet, and the fix is to accept the run that wrote it first.\n *\n * Taken inside the dossier write queue, so no answer lands between what is read and what is committed. A\n * person's accept waits for a live coding run, as every person's accept does.\n */\n public async acceptDossier(input: { readonly origin?: AcceptOrigin } = {}): Promise<AcceptedChangeCommitOutcome> {\n const origin = input.origin ?? AcceptOrigin.OPERATOR;\n await this.refuseWhileACodingRunWrites(origin);\n const specificationsPackageRoot = this.companionContext.resolvedSpecifications?.packageRoot;\n if (!specificationsPackageRoot) {\n throw new NothingToAcceptError('No specifications package is declared in wildo.saas.config.ts, so there is no dossier to commit.');\n }\n return serializeDossierWrite(specificationsPackageRoot, async () => {\n const dossier = [...this.dossierModulePaths()];\n const differing = await this.uncommittedAmong(dossier);\n const changed = dossier.filter((filePath) => differing.has(filePath));\n if (changed.length === 0) throw new NothingToAcceptError('The dossier has no uncommitted answers; there is nothing to accept.');\n const atHead = await this.presentAtHead(changed);\n const specificationsRelativeRoot = path.relative(this.companionContext.saasRoot, specificationsPackageRoot).split(path.sep).join('/');\n const aggregate = ['src/companion-exports.ts', 'src/index.ts'].map((relative) => path.posix.join(specificationsRelativeRoot, relative));\n const wiringDiffers = await this.uncommittedAmong(aggregate);\n const wiring = changed.some((filePath) => !atHead.has(filePath)) ? aggregate.filter((filePath) => wiringDiffers.has(filePath)) : [];\n const paths = [...changed, ...wiring];\n const message = [\n 'Record the creator\\'s answers (the dossier)',\n '',\n `${ACCEPT_ORIGIN_SENTENCE[origin]}: the dossier as it stands — the answers and decisions the creator recorded, which runs read their inputs from.`,\n '',\n ...paths.map((filePath) => `- ${filePath}`),\n '',\n `${DOSSIER_TRAILER}: ${this.dossierFamiliesOf(changed).join(', ')}`,\n ].join('\\n');\n const outcome = await this.commitPaths(paths, message, origin, ImportClosurePolicy.REFUSE_UNRESOLVED);\n return { ...outcome, refusedPaths: [] };\n });\n }\n\n /**\n * Commit an expert charter a person accepted by hand (#2419), as the accept's own change.\n *\n * `wildo creation persona accept <role>` IS a person accepting: acceptance is a commit (`one-source-of-truth.md`\n * rule 2), and before this the charter, its aggregator and its wiring reached git only by a hand commit, which on\n * app-creation-test-005 was made twice. Each file is committed as `previousContent → writtenContent` merged onto\n * HEAD, the route a run's shared files take since #2418, so the wiring commit carries this charter's lines and no\n * other family's. All or nothing: if any file's change conflicts with HEAD, nothing is committed and the refusal names\n * the files (a charter committed without its wiring exports nothing). A staffing run does not come here; it records\n * its writes for the run's own accept.\n */\n public async acceptExpertCharter(input: {\n readonly roleRef: string;\n readonly writes: readonly { readonly path: string; readonly previousContent?: string; readonly writtenContent: string }[];\n readonly origin?: AcceptOrigin;\n }): Promise<AcceptedChangeCommitOutcome> {\n const origin = input.origin ?? AcceptOrigin.OPERATOR;\n await this.refuseWhileACodingRunWrites(origin);\n const commit = async (): Promise<AcceptedChangeCommitOutcome> => {\n const committedContent = new Map<string, string>();\n const refused: AcceptRefusal[] = [];\n for (const write of input.writes) {\n const merged = await this.mergeRunChangeOntoHead(write.path, write.previousContent, write.writtenContent);\n if (merged === undefined) refused.push({ path: write.path, reason: AcceptRefusalReason.EDITED_SINCE_THE_RUN });\n else committedContent.set(write.path, merged);\n }\n /*\n * All or nothing. A charter committed without its wiring is the \"module without its wiring\" commit #2418 removed\n * (it compiles and exports nothing); the accept is on disk either way, and the refusal names what to commit.\n */\n if (committedContent.size === 0 || refused.length > 0) {\n throw new NothingToAcceptError(\n `The ${input.roleRef} charter accept cannot be committed as its own change: ${refused.map((entry) => entry.path).join(', ') || 'nothing changed'} `\n + 'conflicts with HEAD (usually another run\\'s uncommitted wiring next to it). Accept that run first, or commit these files by hand.',\n refused,\n );\n }\n const paths = [...committedContent.keys()];\n const message = [\n `Accept the ${input.roleRef} expert charter`,\n '',\n `${ACCEPT_ORIGIN_SENTENCE[origin]}: the charter promoted by \\`wildo creation persona accept ${input.roleRef}\\`, with the aggregator and the wiring it changed.`,\n '',\n ...paths.map((filePath) => `- ${filePath}`),\n '',\n `${EXPERT_CHARTER_TRAILER}: ${input.roleRef}`,\n ].join('\\n');\n const outcome = await this.commitPaths(paths, message, origin, ImportClosurePolicy.REFUSE_UNRESOLVED, committedContent);\n return { ...outcome, refusedPaths: [] };\n };\n const specificationsPackageRoot = this.companionContext.resolvedSpecifications?.packageRoot;\n return specificationsPackageRoot ? serializeDossierWrite(specificationsPackageRoot, commit) : commit();\n }\n\n /**\n * Commit a DECISION the creator (or their agent) just recorded in a specification file, at the moment it\n * is recorded (#1609): opening a playbook instance is a decision about product scope, and a decision that\n * lives only as a working edit is lost to a checkout and invisible to a re-clone.\n *\n * The caller holds the workspace lock around the write and this commit, so no coding run's baseline can\n * see the file half-recorded. The message carries the purpose and the actor as trailers\n * (`Wildo-Purpose:`, `Wildo-Actor:`), because the author is the companion under the automatic posture.\n */\n public async commitDecisionRecord(input: {\n readonly paths: readonly string[];\n /** One line: what was decided. */\n readonly summary: string;\n readonly purpose: string;\n readonly actor: DecisionRecordActor;\n readonly origin: AcceptOrigin;\n /**\n * Set ONLY by the build-task decision door (`wildo build close` / `approve`, #3224): the one caller that may commit a\n * person's build-task decisions. Keyed on the door, not on the actor, so another decision record a creator makes can\n * never carry that file.\n */\n readonly recordsBuildTaskDecisions?: true;\n /** The door's nonce for this decision (#3284), written as the `Wildo-Decision-Id` trailer. Door-only, with the flag above. */\n readonly decisionId?: string;\n }): Promise<Omit<AcceptedChangeCommitOutcome, 'refusedPaths'> & { readonly commitSha: string }> {\n const message = [\n input.summary,\n '',\n `${ACCEPT_ORIGIN_SENTENCE[input.origin]}: a decision recorded in the application's specifications.`,\n '',\n `${DECISION_PURPOSE_TRAILER}: ${input.purpose.replace(/\\s+/gu, ' ').trim()}`,\n `${AcceptedChangeTrailerKey.ACTOR}: ${input.actor}`,\n ...(input.recordsBuildTaskDecisions === true && input.decisionId !== undefined ? [`${AcceptedChangeTrailerKey.DECISION_ID}: ${input.decisionId}`] : []),\n ].join('\\n');\n // Only the build-task decision door may commit a person's build-task decisions (#3224, #3227).\n const outcome = await this.commitPaths(input.paths, message, input.origin, ImportClosurePolicy.REFUSE_UNRESOLVED, new Map(), input.recordsBuildTaskDecisions === true);\n return outcome;\n }\n\n /** `git -C <saasRoot> <args>` — argv array, never a shell; the subcommand MUST be in the allow-list. */\n private async execGit(\n args: readonly string[],\n options: { readonly acceptExitCodes?: readonly number[]; readonly env?: Readonly<Record<string, string>> } = {},\n ): Promise<{ stdout: string; stderr: string; exitCode: number }> {\n const subcommand = args[0];\n if (!subcommand || !ACCEPT_GIT_SUBCOMMANDS.has(subcommand)) {\n throw new AcceptedChangeCommitError(`Git subcommand '${subcommand ?? '<none>'}' is outside the companion's acceptance carve-out.`, '');\n }\n try {\n const argv = ['-C', this.companionContext.saasRoot, ...args];\n const execOptions = {\n timeout: GIT_TIMEOUT_MS,\n // `cat-file -p` and `merge-file -p` print whole files; Node's 1 MiB default would throw on a large one.\n maxBuffer: GIT_MAX_BUFFER_BYTES,\n /*\n * Literal pathspecs: every path here is a FILE the register named, and a route file such as\n * `[slug].astro` is a glob otherwise (#1805 review R8). No optional locks: `status` would refresh\n * the index's stat cache and take `index.lock` while another session commits (R7).\n */\n env: { ...process.env, GIT_TERMINAL_PROMPT: '0', GIT_LITERAL_PATHSPECS: '1', GIT_OPTIONAL_LOCKS: '0', ...(options.env ?? {}) },\n };\n /*\n * A read goes through the git read helper (#3204): forking `git` from the companion's 2 GB process blocked its event\n * loop. A WRITE (add, commit, update-ref…) stays a direct spawn, the only kind the companion's write recording sees.\n */\n const result = isBrokerableGitInvocation(argv) ? await gitReadBroker.execGit(argv, execOptions) : await execFileAsync('git', argv, execOptions);\n return { ...result, exitCode: 0 };\n } catch (error) {\n const failure = error as { code?: unknown; stdout?: string; stderr?: string };\n const exitCode = typeof failure.code === 'number' ? failure.code : -1;\n if (options.acceptExitCodes?.includes(exitCode)) {\n return { stdout: failure.stdout ?? '', stderr: failure.stderr ?? '', exitCode };\n }\n throw new AcceptedChangeCommitError(\n `git ${args.join(' ')} failed: ${describeCaughtError(error)}${failure.stderr ? ` — ${failure.stderr.slice(0, 1_000)}` : ''}`,\n failure.stderr ?? '',\n );\n }\n }\n}\n"]}
|