@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.
Files changed (138) hide show
  1. package/dist/esm/.tsbuildinfo +1 -1
  2. package/dist/esm/claude-cli/models/coding-agent-dispatch.models.d.ts +68 -1
  3. package/dist/esm/claude-cli/models/coding-agent-dispatch.models.d.ts.map +1 -1
  4. package/dist/esm/claude-cli/models/coding-agent-dispatch.models.js +77 -5
  5. package/dist/esm/claude-cli/models/coding-agent-dispatch.models.js.map +1 -1
  6. package/dist/esm/claude-cli/models/concurrent-coding-runs.models.d.ts +46 -1
  7. package/dist/esm/claude-cli/models/concurrent-coding-runs.models.d.ts.map +1 -1
  8. package/dist/esm/claude-cli/models/concurrent-coding-runs.models.js +39 -2
  9. package/dist/esm/claude-cli/models/concurrent-coding-runs.models.js.map +1 -1
  10. package/dist/esm/claude-cli/models/shared-tree-reconciliation.models.d.ts +6 -0
  11. package/dist/esm/claude-cli/models/shared-tree-reconciliation.models.d.ts.map +1 -1
  12. package/dist/esm/claude-cli/models/shared-tree-reconciliation.models.js.map +1 -1
  13. package/dist/esm/claude-cli/models/verification-tool-availability.models.d.ts +19 -5
  14. package/dist/esm/claude-cli/models/verification-tool-availability.models.d.ts.map +1 -1
  15. package/dist/esm/claude-cli/models/verification-tool-availability.models.js +17 -5
  16. package/dist/esm/claude-cli/models/verification-tool-availability.models.js.map +1 -1
  17. package/dist/esm/claude-cli/services/accepted-change-commit.companion.service.d.ts +16 -1
  18. package/dist/esm/claude-cli/services/accepted-change-commit.companion.service.d.ts.map +1 -1
  19. package/dist/esm/claude-cli/services/accepted-change-commit.companion.service.js +44 -4
  20. package/dist/esm/claude-cli/services/accepted-change-commit.companion.service.js.map +1 -1
  21. package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.d.ts +79 -6
  22. package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.d.ts.map +1 -1
  23. package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.js +291 -40
  24. package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.js.map +1 -1
  25. package/dist/esm/claude-cli/services/research-evidence-store.companion.d.ts +14 -0
  26. package/dist/esm/claude-cli/services/research-evidence-store.companion.d.ts.map +1 -1
  27. package/dist/esm/claude-cli/services/research-evidence-store.companion.js +35 -0
  28. package/dist/esm/claude-cli/services/research-evidence-store.companion.js.map +1 -1
  29. package/dist/esm/claude-cli/services/unrecorded-provider-directories.companion.d.ts +36 -0
  30. package/dist/esm/claude-cli/services/unrecorded-provider-directories.companion.d.ts.map +1 -0
  31. package/dist/esm/claude-cli/services/unrecorded-provider-directories.companion.js +134 -0
  32. package/dist/esm/claude-cli/services/unrecorded-provider-directories.companion.js.map +1 -0
  33. package/dist/esm/core/introspection/services/translation-placement.companion.service.d.ts +3 -2
  34. package/dist/esm/core/introspection/services/translation-placement.companion.service.d.ts.map +1 -1
  35. package/dist/esm/core/introspection/services/translation-placement.companion.service.js.map +1 -1
  36. package/dist/esm/core/introspection/subprocess/companion-introspection-behavior-handlers.d.ts.map +1 -1
  37. package/dist/esm/core/introspection/subprocess/companion-introspection-behavior-handlers.js +24 -14
  38. package/dist/esm/core/introspection/subprocess/companion-introspection-behavior-handlers.js.map +1 -1
  39. package/dist/esm/core/introspection/workspace-element-index.companion.d.ts +42 -0
  40. package/dist/esm/core/introspection/workspace-element-index.companion.d.ts.map +1 -1
  41. package/dist/esm/core/introspection/workspace-element-index.companion.js +42 -0
  42. package/dist/esm/core/introspection/workspace-element-index.companion.js.map +1 -1
  43. package/dist/esm/core/runtime/dev-compile-quiet.companion.d.ts +53 -0
  44. package/dist/esm/core/runtime/dev-compile-quiet.companion.d.ts.map +1 -1
  45. package/dist/esm/core/runtime/dev-compile-quiet.companion.js +119 -2
  46. package/dist/esm/core/runtime/dev-compile-quiet.companion.js.map +1 -1
  47. package/dist/esm/core/runtime/services/start-companion-application.service.d.ts.map +1 -1
  48. package/dist/esm/core/runtime/services/start-companion-application.service.js +13 -1
  49. package/dist/esm/core/runtime/services/start-companion-application.service.js.map +1 -1
  50. package/dist/esm/core/runtime/utils/companion-platform-config.companion.d.ts +2 -2
  51. package/dist/esm/core/runtime/utils/companion-platform-config.companion.d.ts.map +1 -1
  52. package/dist/esm/core/runtime/utils/companion-platform-config.companion.js +6 -6
  53. package/dist/esm/core/runtime/utils/companion-platform-config.companion.js.map +1 -1
  54. package/dist/esm/email/services/email-template.companion.service.d.ts +5 -0
  55. package/dist/esm/email/services/email-template.companion.service.d.ts.map +1 -1
  56. package/dist/esm/email/services/email-template.companion.service.js +44 -11
  57. package/dist/esm/email/services/email-template.companion.service.js.map +1 -1
  58. package/dist/esm/email/utils/email-template-fs-discovery.utils.d.ts +26 -2
  59. package/dist/esm/email/utils/email-template-fs-discovery.utils.d.ts.map +1 -1
  60. package/dist/esm/email/utils/email-template-fs-discovery.utils.js +41 -2
  61. package/dist/esm/email/utils/email-template-fs-discovery.utils.js.map +1 -1
  62. package/dist/esm/email/utils/email-template-scanner-calls.companion.utils.d.ts +19 -0
  63. package/dist/esm/email/utils/email-template-scanner-calls.companion.utils.d.ts.map +1 -0
  64. package/dist/esm/email/utils/email-template-scanner-calls.companion.utils.js +171 -0
  65. package/dist/esm/email/utils/email-template-scanner-calls.companion.utils.js.map +1 -0
  66. package/dist/esm/email/utils/module-email-root.companion.utils.d.ts +75 -0
  67. package/dist/esm/email/utils/module-email-root.companion.utils.d.ts.map +1 -0
  68. package/dist/esm/email/utils/module-email-root.companion.utils.js +162 -0
  69. package/dist/esm/email/utils/module-email-root.companion.utils.js.map +1 -0
  70. package/dist/esm/i18n/components/LOW_LEVEL_AI_AGENT_CONFIG.en.d.ts +1 -0
  71. package/dist/esm/i18n/components/LOW_LEVEL_AI_AGENT_CONFIG.en.d.ts.map +1 -1
  72. package/dist/esm/i18n/components/LOW_LEVEL_AI_AGENT_CONFIG.en.js +1 -0
  73. package/dist/esm/i18n/components/LOW_LEVEL_AI_AGENT_CONFIG.en.js.map +1 -1
  74. package/dist/esm/i18n/components/LOW_LEVEL_AI_AGENT_CONFIG.fr.d.ts +1 -0
  75. package/dist/esm/i18n/components/LOW_LEVEL_AI_AGENT_CONFIG.fr.d.ts.map +1 -1
  76. package/dist/esm/i18n/components/LOW_LEVEL_AI_AGENT_CONFIG.fr.js +1 -0
  77. package/dist/esm/i18n/components/LOW_LEVEL_AI_AGENT_CONFIG.fr.js.map +1 -1
  78. package/dist/esm/i18n/resources/workbenchAspects.en.d.ts.map +1 -1
  79. package/dist/esm/i18n/resources/workbenchAspects.en.js +4 -0
  80. package/dist/esm/i18n/resources/workbenchAspects.en.js.map +1 -1
  81. package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.en.d.ts +35 -0
  82. package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.en.d.ts.map +1 -1
  83. package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.en.js +12 -0
  84. package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.en.js.map +1 -1
  85. package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.fr.d.ts +536 -531
  86. package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.fr.d.ts.map +1 -1
  87. package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.fr.js +536 -531
  88. package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.fr.js.map +1 -1
  89. package/dist/esm/i18n/system_enums/workbench-build.en.d.ts +2 -2
  90. package/dist/esm/i18n/system_enums/workbench-build.en.js +2 -2
  91. package/dist/esm/i18n/system_enums/workbench-build.en.js.map +1 -1
  92. package/dist/esm/i18n-labelling/services/email-template-labelling-units.companion.service.d.ts.map +1 -1
  93. package/dist/esm/i18n-labelling/services/email-template-labelling-units.companion.service.js +7 -3
  94. package/dist/esm/i18n-labelling/services/email-template-labelling-units.companion.service.js.map +1 -1
  95. package/dist/esm/meta-workflows/models/creation-journey-timeline.models.d.ts +9 -0
  96. package/dist/esm/meta-workflows/models/creation-journey-timeline.models.d.ts.map +1 -1
  97. package/dist/esm/meta-workflows/models/creation-journey-timeline.models.js +18 -2
  98. package/dist/esm/meta-workflows/models/creation-journey-timeline.models.js.map +1 -1
  99. package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.d.ts +33 -6
  100. package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.d.ts.map +1 -1
  101. package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.js +97 -19
  102. package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.js.map +1 -1
  103. package/dist/esm/meta-workflows/services/application-build-follow-up-derivation.companion.d.ts +21 -8
  104. package/dist/esm/meta-workflows/services/application-build-follow-up-derivation.companion.d.ts.map +1 -1
  105. package/dist/esm/meta-workflows/services/application-build-follow-up-derivation.companion.js +65 -12
  106. package/dist/esm/meta-workflows/services/application-build-follow-up-derivation.companion.js.map +1 -1
  107. package/dist/esm/meta-workflows/services/application-build-task-coding-policy.companion.service.d.ts +1 -1
  108. package/dist/esm/meta-workflows/services/application-build-task-coding-policy.companion.service.d.ts.map +1 -1
  109. package/dist/esm/meta-workflows/services/application-build-task-coding-policy.companion.service.js +48 -26
  110. package/dist/esm/meta-workflows/services/application-build-task-coding-policy.companion.service.js.map +1 -1
  111. package/dist/esm/meta-workflows/services/build-task-brief-application-facts.companion.d.ts +12 -0
  112. package/dist/esm/meta-workflows/services/build-task-brief-application-facts.companion.d.ts.map +1 -1
  113. package/dist/esm/meta-workflows/services/build-task-brief-application-facts.companion.js +30 -1
  114. package/dist/esm/meta-workflows/services/build-task-brief-application-facts.companion.js.map +1 -1
  115. package/dist/esm/meta-workflows/services/creation-run-report.companion.service.d.ts.map +1 -1
  116. package/dist/esm/meta-workflows/services/creation-run-report.companion.service.js +12 -1
  117. package/dist/esm/meta-workflows/services/creation-run-report.companion.service.js.map +1 -1
  118. package/dist/esm/meta-workflows/services/playbook-run.companion.service.d.ts +7 -0
  119. package/dist/esm/meta-workflows/services/playbook-run.companion.service.d.ts.map +1 -1
  120. package/dist/esm/meta-workflows/services/playbook-run.companion.service.js +81 -4
  121. package/dist/esm/meta-workflows/services/playbook-run.companion.service.js.map +1 -1
  122. package/dist/esm/meta-workflows/services/provider-registry-brief.companion.utils.d.ts +55 -1
  123. package/dist/esm/meta-workflows/services/provider-registry-brief.companion.utils.d.ts.map +1 -1
  124. package/dist/esm/meta-workflows/services/provider-registry-brief.companion.utils.js +157 -10
  125. package/dist/esm/meta-workflows/services/provider-registry-brief.companion.utils.js.map +1 -1
  126. package/dist/esm/module-layout/module-layout-convention.companion.d.ts +158 -0
  127. package/dist/esm/module-layout/module-layout-convention.companion.d.ts.map +1 -0
  128. package/dist/esm/module-layout/module-layout-convention.companion.js +272 -0
  129. package/dist/esm/module-layout/module-layout-convention.companion.js.map +1 -0
  130. package/dist/esm/module-layout/module-layout-inspection.companion.d.ts +42 -0
  131. package/dist/esm/module-layout/module-layout-inspection.companion.d.ts.map +1 -0
  132. package/dist/esm/module-layout/module-layout-inspection.companion.js +290 -0
  133. package/dist/esm/module-layout/module-layout-inspection.companion.js.map +1 -0
  134. package/dist/esm/module-layout/module-source-files.companion.d.ts +3 -0
  135. package/dist/esm/module-layout/module-source-files.companion.d.ts.map +1 -0
  136. package/dist/esm/module-layout/module-source-files.companion.js +45 -0
  137. package/dist/esm/module-layout/module-source-files.companion.js.map +1 -0
  138. package/package.json +17 -17
@@ -1 +1 @@
1
- {"version":3,"file":"concurrent-coding-runs.models.js","sourceRoot":"","sources":["../../../../src/claude-cli/models/concurrent-coding-runs.models.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAEtD,OAAO,EAAE,oBAAoB,EAAE,kCAAkC,EAAE,MAAM,sCAAsC,CAAC;AAChH,OAAO,EAAE,2BAA2B,EAAE,MAAM,gCAAgC,CAAC;AAE7E,OAAO,EAAE,mCAAmC,EAAE,MAA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AQ,CAAC,SAAS,CAAC;KACjK,CAAC;IACF,MAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;IAClC,KAAK,MAAM,QAAQ,IAAI,QAAQ,EAAE,CAAC;QAChC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC;YAAE,SAAS;QACpC,MAAM,YAAY,GAAG,KAAK,CAAC,cAAc;aACtC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;aACvC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC;QACtG,IAAI,YAAY,KAAK,SAAS;YAAE,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IACjF,CAAC;IACD,OAAO,CAAC,GAAG,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC;AAC7B,CAAC","sourcesContent":["/**\n * Several coding runs in ONE worktree at once (#1528) — the pure half: what they hold, what each one\n * records about the others, and how a failure that may be another run's doing is kept from retiring a\n * task.\n *\n * The decision this serves, in Paul's words (2026-09-24): concurrent agents editing the same tree\n * reconcile fine in practice, so the lane does not PREVENT interference — no file separation, no\n * disjoint scopes, no worktree per agent — it DETECTS it and REPAIRS it. Measured on the first\n * end-to-end run's plan: 94 tasks in six waves, wave 2 holding 45 independent tasks, run single-file.\n *\n * What is still exclusive, and why each is the only thing that is:\n * - ONE run per build task at a time: two agents building the same task are a bug, not a collision.\n * That is the engine's exclusive subject, keyed on the task instead of the worktree.\n * - A SINGLE-FLIGHT run and concurrent runs never overlap, in either direction. A single-flight run\n * was promised the tree to itself; and the single-flight door is the one a running agent can reach\n * from its own shell, so refusing it while any run is in flight keeps the P-35 recursion cap\n * EXPLICIT now that the global lock no longer provides it as a side effect.\n * - A git COMMIT takes the workspace lock briefly, because git's own index lock does not tolerate\n * two writers.\n */\nimport { isAbsolute, relative, sep } from 'node:path';\n\nimport { isWritingAcpToolKind, writtenLocationsOfAcpSessionUpdate } from '@wildo-ai/external-connectors-models';\nimport { CodingRunFailureAttribution } from '@wildo-ai/platform-core-shared';\n\nimport { APPLICATION_CODING_WORKTREE_SUBJECT } from '../../meta-workflows/models/application-coding-agent.actors-system.definitions';\nimport { ApplicationCodingTaskDisposition } from './coding-agent-dispatch.models';\n\n/** How a coding run shares the application's working tree. */\nexport enum CodingRunConcurrency {\n /** The lane as it always was: the run holds the worktree subject and the workspace lock for its whole life. */\n SINGLE_FLIGHT = 'single-flight',\n /** One of several runs in one wave: holds only its own task, and takes the workspace lock only to commit. */\n CONCURRENT = 'concurrent',\n}\n\n/** The prefix of a concurrent run's exclusive subject; the task ref follows it. */\nexport const APPLICATION_CODING_TASK_SUBJECT_PREFIX = 'build-task:';\n\n/** What a run holds exclusively: the whole worktree when single-flight, only its own task when concurrent. */\nexport function applicationCodingExclusiveSubject(mode: CodingRunConcurrency, taskRef: string): string {\n return mode === CodingRunConcurrency.CONCURRENT ? `${APPLICATION_CODING_TASK_SUBJECT_PREFIX}${taskRef}` : APPLICATION_CODING_WORKTREE_SUBJECT;\n}\n\n/** True when a live execution's subject says it is a concurrent run. */\nexport function isConcurrentRunSubject(exclusiveSubject: string | undefined): boolean {\n return typeof exclusiveSubject === 'string' && exclusiveSubject.startsWith(APPLICATION_CODING_TASK_SUBJECT_PREFIX);\n}\n\n/** One run's time in the tree, as this process saw it. `changedPaths` is known once it settled. */\nexport interface CodingRunWindow {\n readonly taskId: string;\n readonly taskRef: string;\n readonly startedAtMs: number;\n readonly endedAtMs?: number;\n readonly changedPaths?: readonly string[];\n}\n\n/** What a run records about the runs that shared the tree with it — the observability half of the repair layer. */\nexport interface CodingRunConcurrencyRecord {\n /** Build tasks whose runs were in the tree at some point during this one. */\n readonly overlappingTaskRefs: readonly string[];\n /** Paths this run changed that an overlapping run is known to have changed too: where a collision would be. */\n readonly contendedPaths: readonly string[];\n /**\n * Whether any overlapping run may have written to the tree (#2389 review F5): one still running, one that ended\n * without reporting its paths (a park), or one that settled having changed something. `false` only when every\n * overlapping run settled and changed NOTHING — runs the coding agent's usage limit refused, typically — and then\n * no sibling can have turned a shared check red. Absent on a record written before this field: read as `true`.\n */\n readonly overlappingRunsMayHaveWritten?: boolean;\n}\n\n/**\n * Which runs overlapped `self`, and which of its changed paths they touched too. Pure over the windows\n * this process holds. A sibling still running has no `changedPaths` yet, so a contention with it is\n * recorded by whichever of the two settles LATER — every pair is reported once, by one side.\n */\nexport function describeRunConcurrency(\n windows: readonly CodingRunWindow[],\n self: { readonly taskId: string; readonly startedAtMs: number; readonly endedAtMs: number },\n selfChangedPaths: readonly string[],\n): CodingRunConcurrencyRecord {\n const overlapping = windows.filter((window) => window.taskId !== self.taskId\n && window.startedAtMs < self.endedAtMs\n && (window.endedAtMs === undefined || window.endedAtMs > self.startedAtMs));\n const siblingPaths = new Set(overlapping.flatMap((window) => window.changedPaths ?? []));\n return {\n overlappingTaskRefs: [...new Set(overlapping.map((window) => window.taskRef))].sort(),\n contendedPaths: [...new Set(selfChangedPaths.filter((path) => siblingPaths.has(path)))].sort(),\n overlappingRunsMayHaveWritten: overlapping.some((window) => window.changedPaths === undefined || window.changedPaths.length > 0),\n };\n}\n\n/**\n * Whether a failed run may have failed for a SIBLING's writes (#2389) — the `interferenceSuspected` flag,\n * derived once. Overlap in time is the precondition, never the verdict: the flag also buys a forgiveness\n * from the attempt budget ({@link selectBudgetCountingFailures}), so it must name only failures the tree\n * could have caused.\n *\n * - A HOST failure never: the turn was taken away (a provider limit, a killed process, an operator's\n * cancel) or the run could not be recorded. Measured on app-creation-test-005: four tasks failed on the\n * coding agent's session limit, changed nothing, contended nothing, and every attempt read\n * `interferenceSuspected: true` because another run was in the tree — and past the host bound each one\n * drew an interference forgiveness, so the label hid two failures the budget should have seen.\n * - A failed CHECK, whenever an overlapping run may have written: a sibling's write to any file can turn a\n * shared check red (a typecheck spans the package), and a sibling still running has not reported its paths,\n * so its overlap alone is the signal. Narrowing it to `contendedPaths` would miss exactly that case. Siblings\n * that all settled having changed nothing cannot have caused it (#2389 review F5), so they do not count.\n * - The agent failing at its own work: only when a path it changed was changed by a sibling too — the one\n * way a sibling can have reached the turn itself. A run that changed nothing contended nothing.\n */\nexport function deriveInterferenceSuspected(input: {\n readonly disposition: ApplicationCodingTaskDisposition;\n readonly failureAttribution: CodingRunFailureAttribution | null;\n readonly concurrency: CodingRunConcurrencyRecord | null;\n}): boolean {\n if (input.concurrency === null || input.concurrency.overlappingTaskRefs.length === 0) return false;\n if (input.failureAttribution !== CodingRunFailureAttribution.TASK) return false;\n switch (input.disposition) {\n case ApplicationCodingTaskDisposition.VERIFICATION_FAILED:\n return input.concurrency.overlappingRunsMayHaveWritten !== false;\n case ApplicationCodingTaskDisposition.AGENT_EXECUTION_FAILED:\n return input.concurrency.contendedPaths.length > 0;\n case ApplicationCodingTaskDisposition.WORKING_RESULT_RECORDED:\n case ApplicationCodingTaskDisposition.AWAITING_OPERATOR_INPUT:\n case ApplicationCodingTaskDisposition.INTERRUPTED_REQUIRES_REVIEW:\n case ApplicationCodingTaskDisposition.CHANGE_SET_CAPTURE_FAILED:\n case ApplicationCodingTaskDisposition.TRACEABILITY_FAILED:\n // It changed nothing, so it contended nothing: a sibling cannot have caused a run to write no file.\n case ApplicationCodingTaskDisposition.OVERRIDE_NOT_REPAIRED:\n return false;\n }\n}\n\n/**\n * Whether a run FAILED ITS CHECKS beside siblings, so the failure may be theirs and only a re-check ALONE can say (#3204).\n * Pure: the wave's end re-checks exactly these runs, and the selector holds their task until it has.\n *\n * Two shapes, and the second is why this is not {@link deriveInterferenceSuspected}:\n * - a check FAILED while an overlapping run may have written (`interferenceSuspected`);\n * - a check could not be ASKED at all (the run is HOST-attributed: every failed check threw, `verificationCouldNotAsk`)\n * while other runs shared the tree. A sibling's half-written file fails a package's compile, its compiled output goes\n * stale, and the registry check refuses to read it (\"dist is older than its sources ... last compile FAILED\"). That is\n * the environment's, so the budget forgives it as a host failure; it is also the siblings', so only a check run alone\n * can tell whether this run's work passes. Measured on reference run 42621319676: every such failure of two schema\n * tasks was HOST-attributed, none was re-checked, and both spent their budget in nine minutes.\n *\n * A run alone (no overlap) is never one: a red check there is the run's, or the host's, and running it again alone is\n * exactly what the next dispatch does.\n */\nexport function failedVerificationBesideSiblings(run: {\n readonly disposition?: unknown;\n readonly interferenceSuspected?: unknown;\n readonly failureAttribution?: unknown;\n readonly concurrency?: { readonly overlappingTaskRefs?: readonly unknown[] } | null;\n}): boolean {\n if (run.disposition !== ApplicationCodingTaskDisposition.VERIFICATION_FAILED) return false;\n if (run.interferenceSuspected === true) return true;\n return run.failureAttribution === CodingRunFailureAttribution.HOST && (run.concurrency?.overlappingTaskRefs?.length ?? 0) > 0;\n}\n\n/** How long a settled run's window is kept for others to compare against — longer than any single run. */\nexport const CODING_RUN_WINDOW_RETENTION_MS = 6 * 60 * 60 * 1000;\n\n/**\n * Failed runs whose failure MAY have been another run's doing, forgiven before they count against the\n * task's attempt budget. Two, so a task that genuinely cannot pass still retires, after at most two\n * extra attempts. The first two are the ones forgiven, because interference is likeliest while the\n * wave is widest.\n */\nexport const MAXIMUM_INTERFERENCE_RETRIES = 2;\n\n/**\n * Failed runs the HOST caused — the run could not be recorded, or the turn was taken away (#1581) —\n * forgiven before they count against the task's attempt budget. Bounded like interference: a host\n * condition that fails every attempt is a task that cannot run here, and an unbounded forgiveness would\n * re-dispatch it, and pay for each turn, forever. The coding agent's usage limit is outside this bound:\n * such a run is never counted, because the build pauses until the reset (#2388).\n */\nexport const MAXIMUM_HOST_FAILURE_EXCLUSIONS = 2;\n\n/**\n * Failed runs the NETWORK took (`networkFailureKind`, #3236) forgiven before they count, on a bound of their own.\n *\n * Its own, because the generic host bound of two is spent by the first two minutes of a flaky network: on\n * app-creation-test-007 a 35-minute DNS loss failed six runs across two tasks. Bounded nonetheless (review F5): the\n * connectivity hold makes every re-dispatch wait for a probe that SUCCEEDED, so an unbounded forgiveness would only be\n * safe if the probe and the agent always agreed, and they need not (a proxy, a cloud endpoint, a classifier wrong about\n * one message). Past the bound, a network-taken run falls through to the host bound and then counts, so a task that\n * fails \"on the network\" every time still retires.\n */\nexport const MAXIMUM_NETWORK_FAILURE_EXCLUSIONS = 4;\n\n/**\n * The failed runs that COUNT against a task's attempt budget. Pure. A run the coding agent's account\n * usage limit took is never counted and spends no forgiveness (#2388): the build wave pauses until the\n * limit's reset, so nothing re-dispatches into it and no bound is needed. Nor is a run the NETWORK took\n * (`networkFailureKind`, #3236) up to {@link MAXIMUM_NETWORK_FAILURE_EXCLUSIONS}, on a bound of its own:\n * a connectivity hold keeps every later admission waiting until the agent's API answers a probe, so a\n * network that is down spends nothing, and the bound stops a network that answers probes and drops\n * every turn from re-dispatching a task forever. Two other kinds of failure may\n * not be the task's, and each is forgiven up to its own bound, oldest first:\n * - a run that shared the tree when it failed is suspected of interference, up to\n * {@link MAXIMUM_INTERFERENCE_RETRIES};\n * - a run whose failure the host caused, up to {@link MAXIMUM_HOST_FAILURE_EXCLUSIONS}.\n * A run that is both uses ONE forgiveness: the host's while a host slot is free, else an interference\n * slot. Either way it is forgiven once, never twice.\n */\nexport function selectBudgetCountingFailures<T extends {\n readonly settledAt?: string;\n readonly interferenceSuspected: boolean;\n readonly hostAttributed?: boolean;\n readonly usageLimited?: boolean;\n readonly networkTaken?: boolean;\n}>(runs: readonly T[]): T[] {\n const oldestFirst = [...runs].filter((run) => run.usageLimited !== true)\n .sort((left, right) => (left.settledAt ?? '').localeCompare(right.settledAt ?? ''));\n let forgivenInterference = 0;\n let forgivenHost = 0;\n let forgivenNetwork = 0;\n const counting = oldestFirst.filter((run) => {\n if (run.networkTaken === true && forgivenNetwork < MAXIMUM_NETWORK_FAILURE_EXCLUSIONS) {\n forgivenNetwork += 1;\n return false;\n }\n if (run.hostAttributed === true && forgivenHost < MAXIMUM_HOST_FAILURE_EXCLUSIONS) {\n forgivenHost += 1;\n return false;\n }\n if (run.interferenceSuspected && forgivenInterference < MAXIMUM_INTERFERENCE_RETRIES) {\n forgivenInterference += 1;\n return false;\n }\n return true;\n });\n // Callers read newest first, as the budget lookup always returned them.\n return counting.reverse();\n}\n\n/**\n * The file locations ONE live session event claims as written (#3205 outcome 4), by the engine's one rule\n * (`writtenLocationsOfAcpSessionUpdate`), which the session runner applies when it gathers `reportedFileLocations`. Kept\n * here as the event-shaped door the companion receives, so a run's claims can be kept on disk as they happen.\n */\nexport function writtenLocationsOfSessionEvent(event: { readonly kind: string; readonly payload: unknown }, toolCallKinds: Map<string, string>): string[] {\n return writtenLocationsOfAcpSessionUpdate(event.kind, event.payload, toolCallKinds);\n}\n\n/** The subset of a coding agent's permission decision that names what it touched. */\nexport interface CodingRunPermissionDecisionEvidence {\n readonly allowed: boolean;\n /** The ACP tool kind asked about; only a WRITING kind's locations are a claim (#1805). */\n readonly toolKind?: string;\n readonly locations: readonly string[];\n}\n\n/**\n * The application-relative paths a concurrent run has EVIDENCE of writing itself: the file locations\n * its agent reported on its own tool calls, and the locations of the edits it was ALLOWED to make.\n *\n * Why a concurrent run needs this and a single-flight run does not. A run's change set is a\n * before/after capture of the whole tree, so in a wave every sibling's files appear in it too, and\n * nothing in a capture can tell them apart. Measured on the first live wave (2026-09-24, four real\n * agents each adding a module and an export line): the first run to settle committed ALL FOUR modules\n * under its own name — \"the writes of coding run task-3\" listing alpha, beta, delta and gamma — and\n * the other three accepts were refused as already committed. The tree ended right and the history\n * said the wrong thing; and a sibling that later FAILED would have had its half-written file\n * committed under the first finisher's name, which is exactly what a failed run must not get.\n *\n * So a concurrent run's own accept commits only what it claims — the files its agent's WRITING tool calls\n * reported (#1805: a read or a search claims nothing). A path nobody claims — an agent that wrote through\n * its shell, which declares no location — is not lost: when the runs sharing the tree have settled, what\n * they left is committed naming every run whose writes it may carry, as ONE writer-unknown change unless the\n * records establish its writer (#3218). And when no other writer can have written it — no other recorded run\n * carries it and nothing without a record is beside the run — the run's own accept takes it (#3215).\n *\n * `candidateRoots` are the configured application root and its physical realpath, because an agent\n * reports CANONICAL paths (`/private/var/…` for a root configured as `/var/…`). Pure.\n */\nexport function collectRunClaimedPaths(input: {\n readonly candidateRoots: readonly string[];\n readonly reportedFileLocations?: readonly string[];\n readonly permissionDecisions?: readonly CodingRunPermissionDecisionEvidence[];\n}): string[] {\n const absolute = [\n ...(input.reportedFileLocations ?? []),\n // Allowed to WRITE, not merely to read: a permission asked for a read or a search claims nothing (#1805 review F3).\n ...(input.permissionDecisions ?? []).filter((decision) => decision.allowed && isWritingAcpToolKind(decision.toolKind)).flatMap((decision) => decision.locations),\n ];\n const claimed = new Set<string>();\n for (const location of absolute) {\n if (!isAbsolute(location)) continue;\n const relativePath = input.candidateRoots\n .map((root) => relative(root, location))\n .find((candidate) => candidate.length > 0 && !candidate.startsWith('..') && !isAbsolute(candidate));\n if (relativePath !== undefined) claimed.add(relativePath.split(sep).join('/'));\n }\n return [...claimed].sort();\n}\n"]}
1
+ {"version":3,"file":"concurrent-coding-runs.models.js","sourceRoot":"","sources":["../../../../src/claude-cli/models/concurrent-coding-runs.models.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAEtD,OAAO,EAAE,oBAAoB,EAAE,kCAAkC,EAAE,MAAM,sCAAsC,CAAC;AAChH,OAAO,EAAE,2BAA2B,EAAE,MAAM,gCAAgC,CAAC;AAE7E,OAAO,EAAE,mCAAmC,EAAE,MAAM,gFAAgF,CAAC;AACrI,OAAO,EAAE,gCAAgC,EAAE,MAAM,gCAAgC,CAAC;AAElF,8DAA8D;AAC9D,MAAM,CAAN,IAAY,oBAKX;AALD,WAAY,oBAAoB;IAC9B,+GAA+G;IAC/G,uDAA+B,CAAA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,IAAI,EAAE,CAAC;AAC7B,CAAC","sourcesContent":["/**\n * Several coding runs in ONE worktree at once (#1528) — the pure half: what they hold, what each one\n * records about the others, and how a failure that may be another run's doing is kept from retiring a\n * task.\n *\n * The decision this serves, in Paul's words (2026-09-24): concurrent agents editing the same tree\n * reconcile fine in practice, so the lane does not PREVENT interference — no file separation, no\n * disjoint scopes, no worktree per agent — it DETECTS it and REPAIRS it. Measured on the first\n * end-to-end run's plan: 94 tasks in six waves, wave 2 holding 45 independent tasks, run single-file.\n *\n * What is still exclusive, and why each is the only thing that is:\n * - ONE run per build task at a time: two agents building the same task are a bug, not a collision.\n * That is the engine's exclusive subject, keyed on the task instead of the worktree.\n * - A SINGLE-FLIGHT run and concurrent runs never overlap, in either direction. A single-flight run\n * was promised the tree to itself; and the single-flight door is the one a running agent can reach\n * from its own shell, so refusing it while any run is in flight keeps the P-35 recursion cap\n * EXPLICIT now that the global lock no longer provides it as a side effect.\n * - A git COMMIT takes the workspace lock briefly, because git's own index lock does not tolerate\n * two writers.\n */\nimport { isAbsolute, relative, sep } from 'node:path';\n\nimport { isWritingAcpToolKind, writtenLocationsOfAcpSessionUpdate } from '@wildo-ai/external-connectors-models';\nimport { CodingRunFailureAttribution } from '@wildo-ai/platform-core-shared';\n\nimport { APPLICATION_CODING_WORKTREE_SUBJECT } from '../../meta-workflows/models/application-coding-agent.actors-system.definitions';\nimport { ApplicationCodingTaskDisposition } from './coding-agent-dispatch.models';\n\n/** How a coding run shares the application's working tree. */\nexport enum CodingRunConcurrency {\n /** The lane as it always was: the run holds the worktree subject and the workspace lock for its whole life. */\n SINGLE_FLIGHT = 'single-flight',\n /** One of several runs in one wave: holds only its own task, and takes the workspace lock only to commit. */\n CONCURRENT = 'concurrent',\n}\n\n/** The prefix of a concurrent run's exclusive subject; the task ref follows it. */\nexport const APPLICATION_CODING_TASK_SUBJECT_PREFIX = 'build-task:';\n\n/** What a run holds exclusively: the whole worktree when single-flight, only its own task when concurrent. */\nexport function applicationCodingExclusiveSubject(mode: CodingRunConcurrency, taskRef: string): string {\n return mode === CodingRunConcurrency.CONCURRENT ? `${APPLICATION_CODING_TASK_SUBJECT_PREFIX}${taskRef}` : APPLICATION_CODING_WORKTREE_SUBJECT;\n}\n\n/** True when a live execution's subject says it is a concurrent run. */\nexport function isConcurrentRunSubject(exclusiveSubject: string | undefined): boolean {\n return typeof exclusiveSubject === 'string' && exclusiveSubject.startsWith(APPLICATION_CODING_TASK_SUBJECT_PREFIX);\n}\n\n/** One run's time in the tree, as this process saw it. `changedPaths` is known once it settled. */\nexport interface CodingRunWindow {\n readonly taskId: string;\n readonly taskRef: string;\n readonly startedAtMs: number;\n readonly endedAtMs?: number;\n readonly changedPaths?: readonly string[];\n}\n\n/** What a run records about the runs that shared the tree with it — the observability half of the repair layer. */\nexport interface CodingRunConcurrencyRecord {\n /** Build tasks whose runs were in the tree at some point during this one. */\n readonly overlappingTaskRefs: readonly string[];\n /** Paths this run changed that an overlapping run is known to have changed too: where a collision would be. */\n readonly contendedPaths: readonly string[];\n /**\n * Whether any overlapping run may have written to the tree (#2389 review F5): one still running, one that ended\n * without reporting its paths (a park), or one that settled having changed something. `false` only when every\n * overlapping run settled and changed NOTHING — runs the coding agent's usage limit refused, typically — and then\n * no sibling can have turned a shared check red. Absent on a record written before this field: read as `true`.\n */\n readonly overlappingRunsMayHaveWritten?: boolean;\n}\n\n/**\n * Which runs overlapped `self`, and which of its changed paths they touched too. Pure over the windows\n * this process holds. A sibling still running has no `changedPaths` yet, so a contention with it is\n * recorded by whichever of the two settles LATER — every pair is reported once, by one side.\n */\nexport function describeRunConcurrency(\n windows: readonly CodingRunWindow[],\n self: { readonly taskId: string; readonly startedAtMs: number; readonly endedAtMs: number },\n selfChangedPaths: readonly string[],\n): CodingRunConcurrencyRecord {\n const overlapping = windows.filter((window) => window.taskId !== self.taskId\n && window.startedAtMs < self.endedAtMs\n && (window.endedAtMs === undefined || window.endedAtMs > self.startedAtMs));\n const siblingPaths = new Set(overlapping.flatMap((window) => window.changedPaths ?? []));\n return {\n overlappingTaskRefs: [...new Set(overlapping.map((window) => window.taskRef))].sort(),\n contendedPaths: [...new Set(selfChangedPaths.filter((path) => siblingPaths.has(path)))].sort(),\n overlappingRunsMayHaveWritten: overlapping.some((window) => window.changedPaths === undefined || window.changedPaths.length > 0),\n };\n}\n\n/**\n * Whether a failed run may have failed for a SIBLING's writes (#2389) — the `interferenceSuspected` flag,\n * derived once. Overlap in time is the precondition, never the verdict: the flag also buys a forgiveness\n * from the attempt budget ({@link selectBudgetCountingFailures}), so it must name only failures the tree\n * could have caused.\n *\n * - A HOST failure never: the turn was taken away (a provider limit, a killed process, an operator's\n * cancel) or the run could not be recorded. Measured on app-creation-test-005: four tasks failed on the\n * coding agent's session limit, changed nothing, contended nothing, and every attempt read\n * `interferenceSuspected: true` because another run was in the tree — and past the host bound each one\n * drew an interference forgiveness, so the label hid two failures the budget should have seen.\n * - A failed CHECK, whenever an overlapping run may have written: a sibling's write to any file can turn a\n * shared check red (a typecheck spans the package), and a sibling still running has not reported its paths,\n * so its overlap alone is the signal. Narrowing it to `contendedPaths` would miss exactly that case. Siblings\n * that all settled having changed nothing cannot have caused it (#2389 review F5), so they do not count.\n * - The agent failing at its own work: only when a path it changed was changed by a sibling too — the one\n * way a sibling can have reached the turn itself. A run that changed nothing contended nothing.\n */\nexport function deriveInterferenceSuspected(input: {\n readonly disposition: ApplicationCodingTaskDisposition;\n readonly failureAttribution: CodingRunFailureAttribution | null;\n readonly concurrency: CodingRunConcurrencyRecord | null;\n}): boolean {\n if (input.concurrency === null || input.concurrency.overlappingTaskRefs.length === 0) return false;\n if (input.failureAttribution !== CodingRunFailureAttribution.TASK) return false;\n switch (input.disposition) {\n case ApplicationCodingTaskDisposition.VERIFICATION_FAILED:\n return input.concurrency.overlappingRunsMayHaveWritten !== false;\n case ApplicationCodingTaskDisposition.AGENT_EXECUTION_FAILED:\n return input.concurrency.contendedPaths.length > 0;\n case ApplicationCodingTaskDisposition.WORKING_RESULT_RECORDED:\n case ApplicationCodingTaskDisposition.AWAITING_OPERATOR_INPUT:\n case ApplicationCodingTaskDisposition.INTERRUPTED_REQUIRES_REVIEW:\n case ApplicationCodingTaskDisposition.CHANGE_SET_CAPTURE_FAILED:\n case ApplicationCodingTaskDisposition.TRACEABILITY_FAILED:\n // It changed nothing, so it contended nothing: a sibling cannot have caused a run to write no file.\n case ApplicationCodingTaskDisposition.OVERRIDE_NOT_REPAIRED:\n return false;\n }\n}\n\n/**\n * Whether a run FAILED ITS CHECKS beside siblings, so the failure may be theirs and only a re-check ALONE can say (#3204).\n * Pure: the wave's end re-checks exactly these runs, and the selector holds their task until it has.\n *\n * Two shapes, and the second is why this is not {@link deriveInterferenceSuspected}:\n * - a check FAILED while an overlapping run may have written (`interferenceSuspected`);\n * - a check could not be ASKED at all (the run is HOST-attributed: every failed check threw, `verificationCouldNotAsk`)\n * while other runs shared the tree. A sibling's half-written file fails a package's compile, its compiled output goes\n * stale, and the registry check refuses to read it (\"dist is older than its sources ... last compile FAILED\"). That is\n * the environment's, so the budget forgives it as a host failure; it is also the siblings', so only a check run alone\n * can tell whether this run's work passes. Measured on reference run 42621319676: every such failure of two schema\n * tasks was HOST-attributed, none was re-checked, and both spent their budget in nine minutes.\n *\n * A run alone (no overlap) is never one: a red check there is the run's, or the host's, and running it again alone is\n * exactly what the next dispatch does.\n */\nexport function failedVerificationBesideSiblings(run: {\n readonly disposition?: unknown;\n readonly interferenceSuspected?: unknown;\n readonly failureAttribution?: unknown;\n readonly concurrency?: { readonly overlappingTaskRefs?: readonly unknown[] } | null;\n}): boolean {\n if (run.disposition !== ApplicationCodingTaskDisposition.VERIFICATION_FAILED) return false;\n if (run.interferenceSuspected === true) return true;\n return run.failureAttribution === CodingRunFailureAttribution.HOST && (run.concurrency?.overlappingTaskRefs?.length ?? 0) > 0;\n}\n\n/** How long a settled run's window is kept for others to compare against — longer than any single run. */\nexport const CODING_RUN_WINDOW_RETENTION_MS = 6 * 60 * 60 * 1000;\n\n/**\n * Failed runs whose failure MAY have been another run's doing, forgiven before they count against the\n * task's attempt budget. Two, so a task that genuinely cannot pass still retires, after at most two\n * extra attempts. The first two are the ones forgiven, because interference is likeliest while the\n * wave is widest.\n */\nexport const MAXIMUM_INTERFERENCE_RETRIES = 2;\n\n/**\n * Failed runs the HOST caused — the run could not be recorded, or the turn was taken away (#1581) —\n * forgiven before they count against the task's attempt budget. Bounded like interference: a host\n * condition that fails every attempt is a task that cannot run here, and an unbounded forgiveness would\n * re-dispatch it, and pay for each turn, forever. The coding agent's usage limit is outside this bound:\n * such a run is never counted, because the build pauses until the reset (#2388).\n */\nexport const MAXIMUM_HOST_FAILURE_EXCLUSIONS = 2;\n\n/**\n * Failed runs the NETWORK took (`networkFailureKind`, #3236) forgiven before they count, on a bound of their own.\n *\n * Its own, because the generic host bound of two is spent by the first two minutes of a flaky network: on\n * app-creation-test-007 a 35-minute DNS loss failed six runs across two tasks. Bounded nonetheless (review F5): the\n * connectivity hold makes every re-dispatch wait for a probe that SUCCEEDED, so an unbounded forgiveness would only be\n * safe if the probe and the agent always agreed, and they need not (a proxy, a cloud endpoint, a classifier wrong about\n * one message). Past the bound, a network-taken run falls through to the host bound and then counts, so a task that\n * fails \"on the network\" every time still retires.\n */\nexport const MAXIMUM_NETWORK_FAILURE_EXCLUSIONS = 4;\n\n/**\n * The failed runs that COUNT against a task's attempt budget. Pure. A run the coding agent's account\n * usage limit took is never counted and spends no forgiveness (#2388): the build wave pauses until the\n * limit's reset, so nothing re-dispatches into it and no bound is needed. Nor is a run the NETWORK took\n * (`networkFailureKind`, #3236) up to {@link MAXIMUM_NETWORK_FAILURE_EXCLUSIONS}, on a bound of its own:\n * a connectivity hold keeps every later admission waiting until the agent's API answers a probe, so a\n * network that is down spends nothing, and the bound stops a network that answers probes and drops\n * every turn from re-dispatching a task forever. Nor, ever, is a run that failed only because its checks could not\n * be ASKED (`verificationUnanswered`, `failedOnlyForUnansweredVerification`, run 43961156770): no check judged the\n * work, so it is never the task's failure. It spends no forgiveness either. Two holds bound the spend instead: a cause\n * met on two distinct tasks holds every admission (`VerificationHostCause.REPEATED_HOST_FAILURE`), and a task meeting\n * it on {@link MAXIMUM_CONSECUTIVE_UNANSWERED_VERIFICATION_RUNS} runs in a row is withheld on its own\n * ({@link deriveUnansweredVerificationWithholding}). Until then a host bound of two applied, and on reference run 43961156770 a dead compile watcher retired ten\n * tasks `attempts_exhausted` after five unanswered checks each. Two other kinds of failure may\n * not be the task's, and each is forgiven up to its own bound, oldest first:\n * - a run that shared the tree when it failed is suspected of interference, up to\n * {@link MAXIMUM_INTERFERENCE_RETRIES};\n * - a run whose failure the host caused, up to {@link MAXIMUM_HOST_FAILURE_EXCLUSIONS}.\n * A run that is both uses ONE forgiveness: the host's while a host slot is free, else an interference\n * slot. Either way it is forgiven once, never twice.\n */\nexport function selectBudgetCountingFailures<T extends {\n readonly settledAt?: string;\n readonly interferenceSuspected: boolean;\n readonly hostAttributed?: boolean;\n readonly usageLimited?: boolean;\n readonly networkTaken?: boolean;\n readonly verificationUnanswered?: boolean;\n}>(runs: readonly T[]): T[] {\n const oldestFirst = [...runs].filter((run) => run.usageLimited !== true && run.verificationUnanswered !== true)\n .sort((left, right) => (left.settledAt ?? '').localeCompare(right.settledAt ?? ''));\n let forgivenInterference = 0;\n let forgivenHost = 0;\n let forgivenNetwork = 0;\n const counting = oldestFirst.filter((run) => {\n if (run.networkTaken === true && forgivenNetwork < MAXIMUM_NETWORK_FAILURE_EXCLUSIONS) {\n forgivenNetwork += 1;\n return false;\n }\n if (run.hostAttributed === true && forgivenHost < MAXIMUM_HOST_FAILURE_EXCLUSIONS) {\n forgivenHost += 1;\n return false;\n }\n if (run.interferenceSuspected && forgivenInterference < MAXIMUM_INTERFERENCE_RETRIES) {\n forgivenInterference += 1;\n return false;\n }\n return true;\n });\n // Callers read newest first, as the budget lookup always returned them.\n return counting.reverse();\n}\n\n/**\n * How many CONSECUTIVE runs of one task may fail only because their checks could not be asked before the task is withheld\n * (run 43961156770). Such runs never count against the attempt budget ({@link selectBudgetCountingFailures}), and a cause\n * met on two distinct tasks holds every admission; this bounds the cause only ONE task meets. Its own edit can be it (a\n * load-time error the CLI's runner reports as \"could not ask\"), and so can the last task left of a broken build: without a\n * bound it would be re-dispatched, and paid for, forever. Two, as the cross-task hold opens on two.\n */\nexport const MAXIMUM_CONSECUTIVE_UNANSWERED_VERIFICATION_RUNS = 2;\n\n/** One settled run of a task, as {@link deriveUnansweredVerificationWithholding} reads it. */\nexport interface UnansweredVerificationRunReading {\n readonly taskId: string;\n readonly settledAtMs: number;\n /** `failedOnlyForUnansweredVerification`: every check it failed on could not be asked, and no re-check saw one fail. */\n readonly verificationUnanswered: boolean;\n /** The checks it failed on (none carried from before it), each with what it said. */\n readonly failedChecks: ReadonlyArray<{ readonly checkRef: string; readonly message: string }>;\n}\n\n/**\n * Whether ONE task is withheld because its latest runs could not have their checks asked (run 43961156770), and on which\n * run. Pure. Withheld while all hold:\n * - its newest {@link MAXIMUM_CONSECUTIVE_UNANSWERED_VERIFICATION_RUNS} or more runs (newest first, re-armed ones already\n * left out by the caller) are unanswered;\n * - the newest settled less than `reaskAfterMs` ago: past it, one run asks the host again, as the cross-task hold re-asks;\n * - `hostAnsweredSince` says the host has not answered since that run: a check it failed on ran to a verdict for some\n * run, or the compiled model it named caught up.\n * Never counted, so never `attempts_exhausted`: a re-arm for the environment releases it like any failed run.\n */\nexport function deriveUnansweredVerificationWithholding<T extends UnansweredVerificationRunReading>(\n runsNewestFirst: readonly T[],\n input: { readonly nowMs: number; readonly reaskAfterMs: number; readonly hostAnsweredSince: (latest: T) => boolean },\n): { readonly latest: T; readonly consecutive: number } | undefined {\n let consecutive = 0;\n while (consecutive < runsNewestFirst.length && runsNewestFirst[consecutive]!.verificationUnanswered) consecutive += 1;\n const latest = runsNewestFirst[0];\n if (latest === undefined || consecutive < MAXIMUM_CONSECUTIVE_UNANSWERED_VERIFICATION_RUNS) return undefined;\n if (input.nowMs - latest.settledAtMs >= input.reaskAfterMs) return undefined;\n if (input.hostAnsweredSince(latest)) return undefined;\n return { latest, consecutive };\n}\n\n/**\n * The file locations ONE live session event claims as written (#3205 outcome 4), by the engine's one rule\n * (`writtenLocationsOfAcpSessionUpdate`), which the session runner applies when it gathers `reportedFileLocations`. Kept\n * here as the event-shaped door the companion receives, so a run's claims can be kept on disk as they happen.\n */\nexport function writtenLocationsOfSessionEvent(event: { readonly kind: string; readonly payload: unknown }, toolCallKinds: Map<string, string>): string[] {\n return writtenLocationsOfAcpSessionUpdate(event.kind, event.payload, toolCallKinds);\n}\n\n/** The subset of a coding agent's permission decision that names what it touched. */\nexport interface CodingRunPermissionDecisionEvidence {\n readonly allowed: boolean;\n /** The ACP tool kind asked about; only a WRITING kind's locations are a claim (#1805). */\n readonly toolKind?: string;\n readonly locations: readonly string[];\n}\n\n/**\n * The application-relative paths a concurrent run has EVIDENCE of writing itself: the file locations\n * its agent reported on its own tool calls, and the locations of the edits it was ALLOWED to make.\n *\n * Why a concurrent run needs this and a single-flight run does not. A run's change set is a\n * before/after capture of the whole tree, so in a wave every sibling's files appear in it too, and\n * nothing in a capture can tell them apart. Measured on the first live wave (2026-09-24, four real\n * agents each adding a module and an export line): the first run to settle committed ALL FOUR modules\n * under its own name — \"the writes of coding run task-3\" listing alpha, beta, delta and gamma — and\n * the other three accepts were refused as already committed. The tree ended right and the history\n * said the wrong thing; and a sibling that later FAILED would have had its half-written file\n * committed under the first finisher's name, which is exactly what a failed run must not get.\n *\n * So a concurrent run's own accept commits only what it claims — the files its agent's WRITING tool calls\n * reported (#1805: a read or a search claims nothing). A path nobody claims — an agent that wrote through\n * its shell, which declares no location — is not lost: when the runs sharing the tree have settled, what\n * they left is committed naming every run whose writes it may carry, as ONE writer-unknown change unless the\n * records establish its writer (#3218). And when no other writer can have written it — no other recorded run\n * carries it and nothing without a record is beside the run — the run's own accept takes it (#3215).\n *\n * `candidateRoots` are the configured application root and its physical realpath, because an agent\n * reports CANONICAL paths (`/private/var/…` for a root configured as `/var/…`). Pure.\n */\nexport function collectRunClaimedPaths(input: {\n readonly candidateRoots: readonly string[];\n readonly reportedFileLocations?: readonly string[];\n readonly permissionDecisions?: readonly CodingRunPermissionDecisionEvidence[];\n}): string[] {\n const absolute = [\n ...(input.reportedFileLocations ?? []),\n // Allowed to WRITE, not merely to read: a permission asked for a read or a search claims nothing (#1805 review F3).\n ...(input.permissionDecisions ?? []).filter((decision) => decision.allowed && isWritingAcpToolKind(decision.toolKind)).flatMap((decision) => decision.locations),\n ];\n const claimed = new Set<string>();\n for (const location of absolute) {\n if (!isAbsolute(location)) continue;\n const relativePath = input.candidateRoots\n .map((root) => relative(root, location))\n .find((candidate) => candidate.length > 0 && !candidate.startsWith('..') && !isAbsolute(candidate));\n if (relativePath !== undefined) claimed.add(relativePath.split(sep).join('/'));\n }\n return [...claimed].sort();\n}\n"]}
@@ -7,10 +7,16 @@ export interface IsolatedVerificationRecheck {
7
7
  readonly checkRefs: readonly string[];
8
8
  /** TRUE when every one of them passed this time. A check that could not run is not a pass. */
9
9
  readonly passed: boolean;
10
+ /**
11
+ * Each check's answer. `unanswered` is TRUE for a check that could not be ASKED this time either (it threw: a compiled
12
+ * model still behind, an absent tool): no verdict on the run's work, so it never proves the failure the run's own
13
+ * (`failedOnlyForUnansweredVerification`). Absent on a re-check recorded before the field, read as answered.
14
+ */
10
15
  readonly results: ReadonlyArray<{
11
16
  readonly checkRef: string;
12
17
  readonly success: boolean;
13
18
  readonly message: string;
19
+ readonly unanswered?: boolean;
14
20
  }>;
15
21
  readonly recheckedAt: string;
16
22
  }
@@ -1 +1 @@
1
- {"version":3,"file":"shared-tree-reconciliation.models.d.ts","sourceRoot":"","sources":["../../../../src/claude-cli/models/shared-tree-reconciliation.models.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAuB,MAAM,uBAAuB,CAAC;AAIxF,6HAA6H;AAC7H,eAAO,MAAM,wCAAwC,uDAAuD,CAAC;AAE7G,4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AC,UAAU,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;IACnJ,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAQD,kGAAkG;AAClG,wBAAgB,+BAA+B,CAAC,MAAM,EAAE,OAAO,GAAG,2BAA2B,GAAG,SAAS,CAKxG;AAID,0EAA0E;AAC1E,wBAAgB,+BAA+B,CAAC,MAAM,EAAE,qBAAqB,GAAG,SAAS,EAAE,OAAO,EAAE,2BAA2B,GAAG,qBAAqB,CAItJ"}
@@ -1 +1 @@
1
- {"version":3,"file":"shared-tree-reconciliation.models.js","sourceRoot":"","sources":["../../../../src/claude-cli/models/shared-tree-reconciliation.models.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAGhE,6HAA6H;AAC7H,MAAM,CAAC,MAAM,wCAAwC,GAAG,oDAAoD,CAAC;AAY7G,SAAS,cAAc,CAAC,KAAc;IACpC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IAC9D,MAAM,SAAS,GAAG,KAAgC,CAAC;IACnD,OAAO,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,SAAS,CAAC,IAAI,OAAO,SAAS,CAAC,MAAM,KAAK,SAAS,IAAI,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,OAAO,SAAS,CAAC,WAAW,KAAK,QAAQ,CAAC;AACtK,CAAC;AAED,kGAAkG;AAClG,MAAM,UAAU,+BAA+B,CAAC,MAAe;IAC7D,MAAM,OAAO,GAAI,MAAqD,EAAE,QAAQ,EAAE,OAAO,CAAC;IAC1F,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC;QAAE,OAAO,SAAS,CAAC;IAC9C,MAAM,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,EAAE,GAAG,KAAK,wCAAwC,IAAI,cAAc,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;IAC/I,OAAO,QAAQ,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,EAAE,KAAgD,CAAC;AACzF,CAAC;AAED,MAAM,WAAW,GAAG,EAAE,OAAO,EAAE,EAA2B,EAAE,CAAC;AAE7D,0EAA0E;AAC1E,MAAM,UAAU,+BAA+B,CAAC,MAAyC,EAAE,OAAoC;IAC7H,MAAM,IAAI,GAA0B,MAAM,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC;IACtH,MAAM,KAAK,GAAwB,EAAE,GAAG,EAAE,wCAAwC,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,uBAAuB,CAAC,IAAI,EAAE,SAAS,EAAE,OAAO,CAAC,WAAW,EAAE,CAAC;IACzK,OAAO,EAAE,GAAG,IAAI,EAAE,QAAQ,EAAE,EAAE,GAAG,IAAI,CAAC,QAAQ,EAAE,OAAO,EAAE,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC;AACjG,CAAC","sourcesContent":["import type { Actors_Memory_Context, Actors_Memory_Entry } from '@wildo-ai/saas-models';\nimport { Actors_Memory_EntryType } from '@wildo-ai/saas-models';\n\n\n/** The memory key the isolated re-check is recorded under, beside the re-arm and the interference (namespaced like them). */\nexport const ISOLATED_VERIFICATION_RECHECK_MEMORY_KEY = 'application-creation.isolated-verification-recheck';\n\n/** The failed checks of a run whose failure was suspected to be a sibling's, run again once nothing was writing (#3220). */\nexport interface IsolatedVerificationRecheck {\n /** The checks the run failed, and that were run again. Never empty. */\n readonly checkRefs: readonly string[];\n /** TRUE when every one of them passed this time. A check that could not run is not a pass. */\n readonly passed: boolean;\n readonly results: ReadonlyArray<{ readonly checkRef: string; readonly success: boolean; readonly message: string }>;\n readonly recheckedAt: string;\n}\n\nfunction isRecheckValue(value: unknown): value is IsolatedVerificationRecheck {\n if (typeof value !== 'object' || value === null) return false;\n const candidate = value as Record<string, unknown>;\n return Array.isArray(candidate.checkRefs) && typeof candidate.passed === 'boolean' && Array.isArray(candidate.results) && typeof candidate.recheckedAt === 'string';\n}\n\n/** The LATEST isolated re-check recorded on a run's memory, or `undefined` when none was made. */\nexport function readIsolatedVerificationRecheck(memory: unknown): IsolatedVerificationRecheck | undefined {\n const entries = (memory as Partial<Actors_Memory_Context> | undefined)?.longTerm?.entries;\n if (!Array.isArray(entries)) return undefined;\n const rechecks = entries.filter((candidate) => candidate?.key === ISOLATED_VERIFICATION_RECHECK_MEMORY_KEY && isRecheckValue(candidate.value));\n return rechecks[rechecks.length - 1]?.value as IsolatedVerificationRecheck | undefined;\n}\n\nconst EMPTY_STORE = { entries: [] as Actors_Memory_Entry[] };\n\n/** The run's memory with the re-check appended to its long-term store. */\nexport function withIsolatedVerificationRecheck(memory: Actors_Memory_Context | undefined, recheck: IsolatedVerificationRecheck): Actors_Memory_Context {\n const base: Actors_Memory_Context = memory ?? { shortTerm: EMPTY_STORE, longTerm: EMPTY_STORE, working: EMPTY_STORE };\n const entry: Actors_Memory_Entry = { key: ISOLATED_VERIFICATION_RECHECK_MEMORY_KEY, value: recheck, type: Actors_Memory_EntryType.JSON, timestamp: recheck.recheckedAt };\n return { ...base, longTerm: { ...base.longTerm, entries: [...base.longTerm.entries, entry] } };\n}\n"]}
1
+ {"version":3,"file":"shared-tree-reconciliation.models.js","sourceRoot":"","sources":["../../../../src/claude-cli/models/shared-tree-reconciliation.models.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAGhE,6HAA6H;AAC7H,MAAM,CAAC,MAAM,wCAAwC,GAAG,oDAAoD,CAAC;AAiB7G,SAAS,cAAc,CAAC,KAAc;IACpC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI;Q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,EAAE,OAAO,EAAE,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC;AACjG,CAAC","sourcesContent":["import type { Actors_Memory_Context, Actors_Memory_Entry } from '@wildo-ai/saas-models';\nimport { Actors_Memory_EntryType } from '@wildo-ai/saas-models';\n\n\n/** The memory key the isolated re-check is recorded under, beside the re-arm and the interference (namespaced like them). */\nexport const ISOLATED_VERIFICATION_RECHECK_MEMORY_KEY = 'application-creation.isolated-verification-recheck';\n\n/** The failed checks of a run whose failure was suspected to be a sibling's, run again once nothing was writing (#3220). */\nexport interface IsolatedVerificationRecheck {\n /** The checks the run failed, and that were run again. Never empty. */\n readonly checkRefs: readonly string[];\n /** TRUE when every one of them passed this time. A check that could not run is not a pass. */\n readonly passed: boolean;\n /**\n * Each check's answer. `unanswered` is TRUE for a check that could not be ASKED this time either (it threw: a compiled\n * model still behind, an absent tool): no verdict on the run's work, so it never proves the failure the run's own\n * (`failedOnlyForUnansweredVerification`). Absent on a re-check recorded before the field, read as answered.\n */\n readonly results: ReadonlyArray<{ readonly checkRef: string; readonly success: boolean; readonly message: string; readonly unanswered?: boolean }>;\n readonly recheckedAt: string;\n}\n\nfunction isRecheckValue(value: unknown): value is IsolatedVerificationRecheck {\n if (typeof value !== 'object' || value === null) return false;\n const candidate = value as Record<string, unknown>;\n return Array.isArray(candidate.checkRefs) && typeof candidate.passed === 'boolean' && Array.isArray(candidate.results) && typeof candidate.recheckedAt === 'string';\n}\n\n/** The LATEST isolated re-check recorded on a run's memory, or `undefined` when none was made. */\nexport function readIsolatedVerificationRecheck(memory: unknown): IsolatedVerificationRecheck | undefined {\n const entries = (memory as Partial<Actors_Memory_Context> | undefined)?.longTerm?.entries;\n if (!Array.isArray(entries)) return undefined;\n const rechecks = entries.filter((candidate) => candidate?.key === ISOLATED_VERIFICATION_RECHECK_MEMORY_KEY && isRecheckValue(candidate.value));\n return rechecks[rechecks.length - 1]?.value as IsolatedVerificationRecheck | undefined;\n}\n\nconst EMPTY_STORE = { entries: [] as Actors_Memory_Entry[] };\n\n/** The run's memory with the re-check appended to its long-term store. */\nexport function withIsolatedVerificationRecheck(memory: Actors_Memory_Context | undefined, recheck: IsolatedVerificationRecheck): Actors_Memory_Context {\n const base: Actors_Memory_Context = memory ?? { shortTerm: EMPTY_STORE, longTerm: EMPTY_STORE, working: EMPTY_STORE };\n const entry: Actors_Memory_Entry = { key: ISOLATED_VERIFICATION_RECHECK_MEMORY_KEY, value: recheck, type: Actors_Memory_EntryType.JSON, timestamp: recheck.recheckedAt };\n return { ...base, longTerm: { ...base.longTerm, entries: [...base.longTerm.entries, entry] } };\n}\n"]}
@@ -17,11 +17,17 @@ export declare enum VerificationHostCause {
17
17
  */
18
18
  COMMAND_LACKS_VERB = "command-lacks-verb",
19
19
  /**
20
- * The same check could not be asked, with the same host message, on two DISTINCT tasks each run alone (#3432): whatever
21
- * the cause, it is the host's and it repeats, so a third task would meet it too. No free probe exists, so the hold is
22
- * re-asked: an admission after {@link VerificationToolUnavailableHold.reaskAfter} is let through, and the same failure
23
- * holds again at once. Only runs ALONE count: a check that cannot be asked beside siblings may be a sibling's half-written
24
- * file (#3204), which the wave's isolated re-check settles, never a cause of the host's.
20
+ * The same check could not be asked, with the same host message, on two DISTINCT tasks (#3432): whatever the cause, it
21
+ * is the host's and it repeats, so a third task would meet it too. Mostly no free probe exists, so the hold is re-asked:
22
+ * an admission after {@link VerificationToolUnavailableHold.reaskAfter} is let through, and the same failure holds again
23
+ * at once. A compiled model behind its sources is the exception: its compile record is a free probe (below). A cause only
24
+ * ONE task meets is bounded per task instead (`MAXIMUM_CONSECUTIVE_UNANSWERED_VERIFICATION_RUNS`).
25
+ *
26
+ * Every run counts, alone or beside siblings, and so does a wave's isolated re-check (run 43961156770). Only runs alone
27
+ * counted until then, on the reasoning that beside siblings the cause may be a sibling's half-written file (#3204); at a
28
+ * parallelism of ten no run was alone, the hold never opened, and a dead compile watcher cost 89 runs. A hold opened on
29
+ * a sibling's transient cause ends as soon as any run, or the wave's re-check, ASKS the check, and one on a compiled
30
+ * model behind its sources ({@link VerificationToolUnavailableHold.stalePackage}) as soon as that package compiles.
25
31
  */
26
32
  REPEATED_HOST_FAILURE = "repeated-host-failure"
27
33
  }
@@ -98,6 +104,14 @@ export interface VerificationToolUnavailableHold {
98
104
  readonly metOnTaskRefs?: readonly string[];
99
105
  /** {@link VerificationHostCause.REPEATED_HOST_FAILURE}: from this instant the next admission re-asks the host. */
100
106
  readonly reaskAfter?: string;
107
+ /**
108
+ * {@link VerificationHostCause.REPEATED_HOST_FAILURE} whose check could not be asked because this application package's
109
+ * compiled model is behind its sources (`shared-lib`, run 43961156770). Its probe is free: a read of the hold asks the
110
+ * package's compile record (at most once per poll interval), and the hold ends as soon as the package reads compiled
111
+ * current, before `reaskAfter`. Once per successful compile: a reading the CLI still refuses releases one admission, not
112
+ * every read.
113
+ */
114
+ readonly stalePackage?: string;
101
115
  }
102
116
  /**
103
117
  * The cause in one sentence, with its remedy (#3432): the subject of the Home line, the build wave's guidance and the
@@ -1 +1 @@
1
- {"version":3,"file":"verification-tool-availability.models.d.ts","sourceRoot":"","sources":["../../../../src/claude-cli/models/verification-tool-availability.models.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,oBAAY,qBAAqB;IAC/B;;;OAGG;IACH,cAAc,mBAAmB;IACjC;;;;;OAKG;IACH,kBAAkB,uBAAuB;IACzC;;;;;;OAMG;IACH,qBAAqB,0BAA0B;CAChD;AAED,2JAA2J;AAC3J,eAAO,MAAM,kCAAkC,QAAiB,CAAC;AAEjE;;;;;;;;;GASG;AACH,qBAAa,gCAAiC,SAAQ,KAAK;IACzD,gGAAgG;IAChG,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,wFAAwF;IACxF,QAAQ,CAAC,SAAS,EAAE,qBAAqB,CAAC,cAAc,GAAG,qBAAqB,CAAC,kBAAkB,CAAC;IACpG,kIAAkI;IAClI,QAAQ,CA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,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,kHAAkH;IAClH,QAAQ,CAAC,aAAa,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3C,kHAAkH;IAClH,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED;;;GAGG;AACH,wBAAgB,6BAA6B,CAAC,IAAI,EAAE,+BAA+B,GAAG,MAAM,CAY3F;AAED;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,MAAM,EACf,SAAS,GAAE,MAAM,GAAG,SAA4B,EAChD,QAAQ,GAAE,MAAM,CAAC,QAA2B,EAC5C,cAAc,GAAE,MAAM,GAAG,SAA+B,GACvD,MAAM,GAAG,IAAI,CAyBf;AAED;;;;GAIG;AACH,wBAAgB,0CAA0C,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,+BAA+B,GAAG,MAAM,CAWzH"}
1
+ {"version":3,"file":"verification-tool-availability.models.d.ts","sourceRoot":"","sources":["../../../../src/claude-cli/models/verification-tool-availability.models.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,oBAAY,qBAAqB;IAC/B;;;OAGG;IACH,cAAc,mBAAmB;IACjC;;;;;OAKG;IACH,kBAAkB,uBAAuB;IACzC;;;;;;;;;;;;OAYG;IACH,qBAAqB,0BAA0B;CAChD;AAED,2JAA2J;AAC3J,eAAO,MAAM,kCAAkC,QAAiB,CAAC;AAEjE;;;;;;;;;GASG;AACH,qBAAa,gCAAiC,SAAQ,KAAK;IACzD,gGAAgG;IAChG,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,wFAAwF;IACxF,QAAQ,CAAC,SAAS,EAAE,qBAAqB,CAAC,cAAc,GAAG,qBAAqB,CAAC,kBAAkB,CAAC;IACpG,kIAAkI;IAClI,QAAQ,CAAC,aAAa,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;gBAE/B,OAAO,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AC;IAC5B,kHAAkH;IAClH,QAAQ,CAAC,aAAa,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3C,kHAAkH;IAClH,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B;;;;;;OAMG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;CAChC;AAED;;;GAGG;AACH,wBAAgB,6BAA6B,CAAC,IAAI,EAAE,+BAA+B,GAAG,MAAM,CAkB3F;AAED;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,MAAM,EACf,SAAS,GAAE,MAAM,GAAG,SAA4B,EAChD,QAAQ,GAAE,MAAM,CAAC,QAA2B,EAC5C,cAAc,GAAE,MAAM,GAAG,SAA+B,GACvD,MAAM,GAAG,IAAI,CAyBf;AAED;;;;GAIG;AACH,wBAAgB,0CAA0C,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,+BAA+B,GAAG,MAAM,CAWzH"}
@@ -20,11 +20,17 @@ export var VerificationHostCause;
20
20
  */
21
21
  VerificationHostCause["COMMAND_LACKS_VERB"] = "command-lacks-verb";
22
22
  /**
23
- * The same check could not be asked, with the same host message, on two DISTINCT tasks each run alone (#3432): whatever
24
- * the cause, it is the host's and it repeats, so a third task would meet it too. No free probe exists, so the hold is
25
- * re-asked: an admission after {@link VerificationToolUnavailableHold.reaskAfter} is let through, and the same failure
26
- * holds again at once. Only runs ALONE count: a check that cannot be asked beside siblings may be a sibling's half-written
27
- * file (#3204), which the wave's isolated re-check settles, never a cause of the host's.
23
+ * The same check could not be asked, with the same host message, on two DISTINCT tasks (#3432): whatever the cause, it
24
+ * is the host's and it repeats, so a third task would meet it too. Mostly no free probe exists, so the hold is re-asked:
25
+ * an admission after {@link VerificationToolUnavailableHold.reaskAfter} is let through, and the same failure holds again
26
+ * at once. A compiled model behind its sources is the exception: its compile record is a free probe (below). A cause only
27
+ * ONE task meets is bounded per task instead (`MAXIMUM_CONSECUTIVE_UNANSWERED_VERIFICATION_RUNS`).
28
+ *
29
+ * Every run counts, alone or beside siblings, and so does a wave's isolated re-check (run 43961156770). Only runs alone
30
+ * counted until then, on the reasoning that beside siblings the cause may be a sibling's half-written file (#3204); at a
31
+ * parallelism of ten no run was alone, the hold never opened, and a dead compile watcher cost 89 runs. A hold opened on
32
+ * a sibling's transient cause ends as soon as any run, or the wave's re-check, ASKS the check, and one on a compiled
33
+ * model behind its sources ({@link VerificationToolUnavailableHold.stalePackage}) as soon as that package compiles.
28
34
  */
29
35
  VerificationHostCause["REPEATED_HOST_FAILURE"] = "repeated-host-failure";
30
36
  })(VerificationHostCause || (VerificationHostCause = {}));
@@ -95,6 +101,12 @@ export function describeVerificationHostCause(held) {
95
101
  return `The installed \`${held.command ?? 'wildo'}\` does not know \`${(held.verbProbeArgs ?? []).filter((arg) => arg !== '--help').join(' ')}\`, `
96
102
  + `so ${held.checkRef} cannot run for any task. Update it to the companion's version: the hold ends as soon as it answers the verb.`;
97
103
  case VerificationHostCause.REPEATED_HOST_FAILURE:
104
+ if (held.stalePackage !== undefined) {
105
+ return `${held.checkRef} could not be asked, the same way, on ${(held.metOnTaskRefs ?? [held.taskRef]).join(' and ')}: `
106
+ + `${held.stalePackage}'s compiled output is behind its sources, so the check reads a model nobody edited. ${held.message} `
107
+ + `The build waits for ${held.stalePackage} to compile (a stopped compile watcher must be running again; a failed compile `
108
+ + `must be fixed): the hold ends as soon as it is compiled current, and the build asks again from ${held.reaskAfter ?? 'the next admission'} at the latest.`;
109
+ }
98
110
  return `${held.checkRef} could not be asked, the same way, on ${(held.metOnTaskRefs ?? [held.taskRef]).join(' and ')}: ${held.message} `
99
111
  + `Repair what the message names; the build asks again from ${held.reaskAfter ?? 'the next admission'}.`;
100
112
  }
@@ -1 +1 @@
1
- {"version":3,"file":"verification-tool-availability.models.js","sourceRoot":"","sources":["../../../../src/claude-cli/models/verification-tool-availability.models.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAA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AAG,OAAO,GAAG,MAAM,EAAE,CAAC,CAAC;YACzD,IAAI,CAAC;gBACH,UAAU,CAAC,SAAS,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC;gBACxC,OAAO,SAAS,CAAC;YACnB,CAAC;YAAC,MAAM,CAAC;gBACP,yBAAyB;YAC3B,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,0CAA0C,CAAC,OAAe,EAAE,IAAqC;IAC/G,IAAI,IAAI,CAAC,SAAS,KAAK,qBAAqB,CAAC,cAAc,EAAE,CAAC;QAC5D,OAAO,eAAe,OAAO,uBAAuB,IAAI,CAAC,OAAO,yCAAyC,IAAI,CAAC,QAAQ,2BAA2B;cAC7I,aAAa,IAAI,CAAC,OAAO,OAAO,IAAI,CAAC,UAAU,KAAK,IAAI,CAAC,OAAO,2BAA2B;cAC3F,wIAAwI;cACxI,wCAAwC;cACxC,mFAAmF,IAAI,CAAC,OAAO,uCAAuC,CAAC;IAC7I,CAAC;IACD,OAAO,eAAe,OAAO,qBAAqB,6BAA6B,CAAC,IAAI,CAAC,wBAAwB;UACzG,WAAW,IAAI,CAAC,OAAO,OAAO,IAAI,CAAC,UAAU,KAAK;UAClD,sFAAsF,IAAI,CAAC,OAAO,uCAAuC,CAAC;AAChJ,CAAC","sourcesContent":["import { accessSync, constants as fsConstants } from 'node:fs';\nimport { delimiter, join } from 'node:path';\n\n/**\n * WHY a verification check cannot be asked for a reason the HOST owns that will not clear between two runs (#3423,\n * #3432). Each cause has its own release, which a reader can trigger, because an unattended drive stops on the Home line\n * before any admission happens.\n */\nexport enum VerificationHostCause {\n /**\n * The check's command cannot be executed: absent from the PATH the check spawns with (#3423). Opened on the first run,\n * since its probe is free: a PATH lookup, made by every read of the hold.\n */\n COMMAND_ABSENT = 'command-absent',\n /**\n * The command runs and does not know the verb the check asks: an installed `wildo` older than the companion answers\n * `config check-resources` with \"Unknown command\" (#3432). A PATH lookup would find it and release at once, so its probe\n * asks the command for the verb (`--help`), in the background of a read and at once before an admission. Opened on the\n * first run, like an absent command: the probe costs a CLI start, never a coding turn.\n */\n COMMAND_LACKS_VERB = 'command-lacks-verb',\n /**\n * The same check could not be asked, with the same host message, on two DISTINCT tasks each run alone (#3432): whatever\n * the cause, it is the host's and it repeats, so a third task would meet it too. No free probe exists, so the hold is\n * re-asked: an admission after {@link VerificationToolUnavailableHold.reaskAfter} is let through, and the same failure\n * holds again at once. Only runs ALONE count: a check that cannot be asked beside siblings may be a sibling's half-written\n * file (#3204), which the wave's isolated re-check settles, never a cause of the host's.\n */\n REPEATED_HOST_FAILURE = 'repeated-host-failure',\n}\n\n/** How long a {@link VerificationHostCause.REPEATED_HOST_FAILURE} hold refuses before one admission re-asks the host, as the account-refusal hold does. */\nexport const VERIFICATION_HOST_FAILURE_REASK_MS = 30 * 60 * 1000;\n\n/**\n * A verification check could not be ASKED because the command it runs could not be executed (#3423): the\n * executable is absent from the PATH the check spawns with — or, since #3432, is there and lacks the verb the check\n * asks ({@link VerificationHostCause.COMMAND_LACKS_VERB}).\n *\n * Distinct from every other \"could not ask\" (a compiled model behind its sources, an absent backend dist, a runner\n * that crashed): those can clear on their own between two runs, and the per-task host forgiveness absorbs them. An\n * absent executable cannot, and it fails every task's check the same way. Measured on reference run 42202387917:\n * `spawn wildo ENOENT` failed nine tasks' `check:resources-registry-init`, 39 attempts in 17 minutes, about $100.\n */\nexport class VerificationToolUnavailableError extends Error {\n /** The command the check spawns, as it was named: looked up on PATH to know when it is back. */\n readonly command: string;\n /** Which of the command's two failures this is: absent, or present without the verb. */\n readonly hostCause: VerificationHostCause.COMMAND_ABSENT | VerificationHostCause.COMMAND_LACKS_VERB;\n /** {@link VerificationHostCause.COMMAND_LACKS_VERB} only: the arguments that ask the command for the verb, ending in `--help`. */\n readonly verbProbeArgs?: readonly string[];\n\n constructor(command: string, message: string, lacksVerb?: { readonly verbProbeArgs: readonly string[] }) {\n super(message);\n this.name = 'VerificationToolUnavailableError';\n this.command = command;\n this.hostCause = lacksVerb ? VerificationHostCause.COMMAND_LACKS_VERB : VerificationHostCause.COMMAND_ABSENT;\n if (lacksVerb) this.verbProbeArgs = lacksVerb.verbProbeArgs;\n }\n}\n\n/**\n * Does the command's answer to a verb probe say it KNOWS the verb (#3432)? Exit 0 and no \"Unknown command\": an older\n * `wildo` exits 1 with `Unknown command: \"config\"`. A CLI that printed general help for a verb it does not know would\n * release the hold wrongly, and the next run would hold again at once: one run, never a lockout.\n */\nexport function verbProbeKnowsTheVerb(outcome: { readonly success: boolean; readonly message: string; readonly stdoutTail: string; readonly stderrTail: string }): boolean {\n return outcome.success && !/Unknown command/iu.test(`${outcome.message}\\n${outcome.stdoutTail}\\n${outcome.stderrTail}`);\n}\n\n/**\n * A host check failure's message with what differs between two runs of the same cause taken out (#3432): numbers\n * (durations, pids, counts, ports) and whitespace. Two tasks meeting one cause print the same message but for those.\n */\nexport function normalizeHostCheckFailureMessage(message: string): string {\n return message.replace(/\\d+/gu, '#').replace(/\\s+/gu, ' ').trim().slice(0, 400);\n}\n\n/**\n * Throw a {@link VerificationToolUnavailableError} when a check's outcome says its command could not be executed.\n * One function for every check that spawns a CLI, so the classification cannot drift between them.\n *\n * `absent` matches the spawn error in the outcome's message: `ENOENT` by default (Node's \"spawn x ENOENT\").\n */\nexport function refuseWhenVerificationToolIsAbsent(\n outcome: { readonly success: boolean; readonly message: string },\n input: { readonly command: string; readonly checking: string; readonly absent?: RegExp },\n): void {\n if (outcome.success || !(input.absent ?? /\\bENOENT\\b/).test(outcome.message)) return;\n throw new VerificationToolUnavailableError(\n input.command,\n `Cannot ${input.checking}: the \\`${input.command}\\` CLI could not be executed (${outcome.message}).`,\n );\n}\n\n/**\n * What holds coding admissions while a verification check cannot be asked for a host cause that will not clear on its\n * own (#3423, #3432): which cause, which command (when the cause is one), which check met it, the check's own message,\n * and the run that met it.\n */\nexport interface VerificationToolUnavailableHold {\n readonly hostCause: VerificationHostCause;\n /** The command the check spawns, for the two command causes; absent for a repeated failure, which may spawn none. */\n readonly command?: string;\n /** {@link VerificationHostCause.COMMAND_LACKS_VERB}: the arguments that ask the command for the verb. */\n readonly verbProbeArgs?: readonly string[];\n readonly checkRef: string;\n readonly message: string;\n readonly taskRef: string;\n readonly runTaskId: string;\n readonly observedAt: string;\n /** {@link VerificationHostCause.REPEATED_HOST_FAILURE}: every task the cause was met on, `taskRef` among them. */\n readonly metOnTaskRefs?: readonly string[];\n /** {@link VerificationHostCause.REPEATED_HOST_FAILURE}: from this instant the next admission re-asks the host. */\n readonly reaskAfter?: string;\n}\n\n/**\n * The cause in one sentence, with its remedy (#3432): the subject of the Home line, the build wave's guidance and the\n * drive's stop all say this, so the three cannot disagree about what holds the build or how it ends.\n */\nexport function describeVerificationHostCause(held: VerificationToolUnavailableHold): string {\n switch (held.hostCause) {\n case VerificationHostCause.COMMAND_ABSENT:\n return `\\`${held.command ?? 'a command'}\\` is not on the companion's PATH, so ${held.checkRef} cannot run for any task. `\n + 'Install it in a directory on that PATH, or restart the companion with one: the hold ends as soon as it is found.';\n case VerificationHostCause.COMMAND_LACKS_VERB:\n return `The installed \\`${held.command ?? 'wildo'}\\` does not know \\`${(held.verbProbeArgs ?? []).filter((arg) => arg !== '--help').join(' ')}\\`, `\n + `so ${held.checkRef} cannot run for any task. Update it to the companion's version: the hold ends as soon as it answers the verb.`;\n case VerificationHostCause.REPEATED_HOST_FAILURE:\n return `${held.checkRef} could not be asked, the same way, on ${(held.metOnTaskRefs ?? [held.taskRef]).join(' and ')}: ${held.message} `\n + `Repair what the message names; the build asks again from ${held.reaskAfter ?? 'the next admission'}.`;\n }\n}\n\n/**\n * The first executable `command` on `pathValue`, as a spawn by bare name finds it (with the Windows command suffixes),\n * or `null`. The probe that ends the hold: free, and asked of the same PATH the verification subprocess receives.\n *\n * A command written as a path (`./bin/wildo`, `/usr/local/bin/wildo`) is not searched on PATH, as a spawn does not\n * search it: it is checked where it is. What the lookup cannot see: an executable that is found but still fails to spawn\n * with ENOENT (a script whose interpreter is missing). Then the hold ends at every lookup and each run meets it again,\n * which is the per-task forgiveness this hold replaces, never worse.\n */\nexport function resolveExecutableOnPath(\n command: string,\n pathValue: string | undefined = process.env.PATH,\n platform: NodeJS.Platform = process.platform,\n pathExtensions: string | undefined = process.env.PATHEXT,\n): string | null {\n const suffixes = platform === 'win32' ? (pathExtensions ?? '.EXE;.CMD;.BAT').split(';') : [''];\n if (command.includes('/') || (platform === 'win32' && command.includes('\\\\'))) {\n for (const suffix of suffixes) {\n try {\n accessSync(`${command}${suffix}`, fsConstants.X_OK);\n return `${command}${suffix}`;\n } catch {\n // Not executable with this suffix.\n }\n }\n return null;\n }\n for (const directory of (pathValue ?? '').split(platform === 'win32' ? ';' : delimiter).filter(Boolean)) {\n for (const suffix of suffixes) {\n const candidate = join(directory, `${command}${suffix}`);\n try {\n accessSync(candidate, fsConstants.X_OK);\n return candidate;\n } catch {\n // Not in this directory.\n }\n }\n }\n return null;\n}\n\n/**\n * The refusal an admission answers while the hold stands and the command is still absent. Names the cause, the\n * remedy, and the door past a lookup that is wrong: a re-arm for the environment of the task whose run MET the hold,\n * which has a failed run to re-arm (the task being admitted usually has none, and its re-arm would be refused).\n */\nexport function describeVerificationToolUnavailableRefusal(taskRef: string, held: VerificationToolUnavailableHold): string {\n if (held.hostCause === VerificationHostCause.COMMAND_ABSENT) {\n return `Coding task ${taskRef} was not started: \\`${held.command}\\` is not on the companion's PATH, so ${held.checkRef} cannot run for any task `\n + `(found by ${held.taskRef} at ${held.observedAt}: ${held.message}). No attempt was spent. `\n + `Install it into a directory already on the companion's PATH, or restart the companion with a PATH that holds it, then dispatch again: `\n + 'the next admission looks it up first. '\n + `If it is on PATH and this lookup is wrong, end the hold with: wildo build rearm ${held.taskRef} --reason environment --note \"<why>\".`;\n }\n return `Coding task ${taskRef} was not started: ${describeVerificationHostCause(held)} No attempt was spent `\n + `(met by ${held.taskRef} at ${held.observedAt}). `\n + `If the cause is gone and this does not clear, end the hold with: wildo build rearm ${held.taskRef} --reason environment --note \"<why>\".`;\n}\n"]}
1
+ {"version":3,"file":"verification-tool-availability.models.js","sourceRoot":"","sources":["../../../../src/claude-cli/models/verification-tool-availability.models.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,IAAI,WAAW,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE5C;;;;GAIG;AACH,MAAM,CAAN,IAAY,qBA2BX;AA3BD,WAAY,qBAAqB;IAC/B;;;OAGG;IACH,0DAAiC,CAAA;IACjC;;;;;OAKG;IACH,kEAAyC,CAAA;IACzC;;;;;;;;;;;;OAYG;IACH,wEAA+C,CAAA;AACjD,CAAC,EA3BW,qBAAqB,KAArB,qBAAqB,QA2BhC;AAED,2JAA2J;AAC3J,MAAM,CAAC,MAAM,kCAAkC,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAEjE;;;;;;;;;GASG;AACH,MAAM,OAAO,gCAAiC,SAAQ,KAAK;IACzD,gGAAgG;IACvF,OAAO,CAAS;IACzB,wFAAwF;IAC/E,SAAS,CAAkF;IACpG,kIAAkI;IACzH,aAAa,CAAqB;IAE3C,YAAY,OAAe,EAAE,OAAe,EAAE,SAAyD;QACrG,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,kCAAkC,CAAC;QAC/C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC,CAAC,CAAC,qBAAqB,CAAC,kBAAkB,CAAC,CAAC,CAAC,qBAAqB,CAAC,cAAc,CAAC;QAC7G,IAAI,SAAS;YAAE,IAAI,CAAC,aAAa,GAAG,SAAS,CAAC,aAAa,CAAC;IAC9D,CAAC;CACF;AAED;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,OAA0H;IAC9J,OAAO,OAAO,C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CAAC;IACD,OAAO,eAAe,OAAO,qBAAqB,6BAA6B,CAAC,IAAI,CAAC,wBAAwB;UACzG,WAAW,IAAI,CAAC,OAAO,OAAO,IAAI,CAAC,UAAU,KAAK;UAClD,sFAAsF,IAAI,CAAC,OAAO,uCAAuC,CAAC;AAChJ,CAAC","sourcesContent":["import { accessSync, constants as fsConstants } from 'node:fs';\nimport { delimiter, join } from 'node:path';\n\n/**\n * WHY a verification check cannot be asked for a reason the HOST owns that will not clear between two runs (#3423,\n * #3432). Each cause has its own release, which a reader can trigger, because an unattended drive stops on the Home line\n * before any admission happens.\n */\nexport enum VerificationHostCause {\n /**\n * The check's command cannot be executed: absent from the PATH the check spawns with (#3423). Opened on the first run,\n * since its probe is free: a PATH lookup, made by every read of the hold.\n */\n COMMAND_ABSENT = 'command-absent',\n /**\n * The command runs and does not know the verb the check asks: an installed `wildo` older than the companion answers\n * `config check-resources` with \"Unknown command\" (#3432). A PATH lookup would find it and release at once, so its probe\n * asks the command for the verb (`--help`), in the background of a read and at once before an admission. Opened on the\n * first run, like an absent command: the probe costs a CLI start, never a coding turn.\n */\n COMMAND_LACKS_VERB = 'command-lacks-verb',\n /**\n * The same check could not be asked, with the same host message, on two DISTINCT tasks (#3432): whatever the cause, it\n * is the host's and it repeats, so a third task would meet it too. Mostly no free probe exists, so the hold is re-asked:\n * an admission after {@link VerificationToolUnavailableHold.reaskAfter} is let through, and the same failure holds again\n * at once. A compiled model behind its sources is the exception: its compile record is a free probe (below). A cause only\n * ONE task meets is bounded per task instead (`MAXIMUM_CONSECUTIVE_UNANSWERED_VERIFICATION_RUNS`).\n *\n * Every run counts, alone or beside siblings, and so does a wave's isolated re-check (run 43961156770). Only runs alone\n * counted until then, on the reasoning that beside siblings the cause may be a sibling's half-written file (#3204); at a\n * parallelism of ten no run was alone, the hold never opened, and a dead compile watcher cost 89 runs. A hold opened on\n * a sibling's transient cause ends as soon as any run, or the wave's re-check, ASKS the check, and one on a compiled\n * model behind its sources ({@link VerificationToolUnavailableHold.stalePackage}) as soon as that package compiles.\n */\n REPEATED_HOST_FAILURE = 'repeated-host-failure',\n}\n\n/** How long a {@link VerificationHostCause.REPEATED_HOST_FAILURE} hold refuses before one admission re-asks the host, as the account-refusal hold does. */\nexport const VERIFICATION_HOST_FAILURE_REASK_MS = 30 * 60 * 1000;\n\n/**\n * A verification check could not be ASKED because the command it runs could not be executed (#3423): the\n * executable is absent from the PATH the check spawns with — or, since #3432, is there and lacks the verb the check\n * asks ({@link VerificationHostCause.COMMAND_LACKS_VERB}).\n *\n * Distinct from every other \"could not ask\" (a compiled model behind its sources, an absent backend dist, a runner\n * that crashed): those can clear on their own between two runs, and the per-task host forgiveness absorbs them. An\n * absent executable cannot, and it fails every task's check the same way. Measured on reference run 42202387917:\n * `spawn wildo ENOENT` failed nine tasks' `check:resources-registry-init`, 39 attempts in 17 minutes, about $100.\n */\nexport class VerificationToolUnavailableError extends Error {\n /** The command the check spawns, as it was named: looked up on PATH to know when it is back. */\n readonly command: string;\n /** Which of the command's two failures this is: absent, or present without the verb. */\n readonly hostCause: VerificationHostCause.COMMAND_ABSENT | VerificationHostCause.COMMAND_LACKS_VERB;\n /** {@link VerificationHostCause.COMMAND_LACKS_VERB} only: the arguments that ask the command for the verb, ending in `--help`. */\n readonly verbProbeArgs?: readonly string[];\n\n constructor(command: string, message: string, lacksVerb?: { readonly verbProbeArgs: readonly string[] }) {\n super(message);\n this.name = 'VerificationToolUnavailableError';\n this.command = command;\n this.hostCause = lacksVerb ? VerificationHostCause.COMMAND_LACKS_VERB : VerificationHostCause.COMMAND_ABSENT;\n if (lacksVerb) this.verbProbeArgs = lacksVerb.verbProbeArgs;\n }\n}\n\n/**\n * Does the command's answer to a verb probe say it KNOWS the verb (#3432)? Exit 0 and no \"Unknown command\": an older\n * `wildo` exits 1 with `Unknown command: \"config\"`. A CLI that printed general help for a verb it does not know would\n * release the hold wrongly, and the next run would hold again at once: one run, never a lockout.\n */\nexport function verbProbeKnowsTheVerb(outcome: { readonly success: boolean; readonly message: string; readonly stdoutTail: string; readonly stderrTail: string }): boolean {\n return outcome.success && !/Unknown command/iu.test(`${outcome.message}\\n${outcome.stdoutTail}\\n${outcome.stderrTail}`);\n}\n\n/**\n * A host check failure's message with what differs between two runs of the same cause taken out (#3432): numbers\n * (durations, pids, counts, ports) and whitespace. Two tasks meeting one cause print the same message but for those.\n */\nexport function normalizeHostCheckFailureMessage(message: string): string {\n return message.replace(/\\d+/gu, '#').replace(/\\s+/gu, ' ').trim().slice(0, 400);\n}\n\n/**\n * Throw a {@link VerificationToolUnavailableError} when a check's outcome says its command could not be executed.\n * One function for every check that spawns a CLI, so the classification cannot drift between them.\n *\n * `absent` matches the spawn error in the outcome's message: `ENOENT` by default (Node's \"spawn x ENOENT\").\n */\nexport function refuseWhenVerificationToolIsAbsent(\n outcome: { readonly success: boolean; readonly message: string },\n input: { readonly command: string; readonly checking: string; readonly absent?: RegExp },\n): void {\n if (outcome.success || !(input.absent ?? /\\bENOENT\\b/).test(outcome.message)) return;\n throw new VerificationToolUnavailableError(\n input.command,\n `Cannot ${input.checking}: the \\`${input.command}\\` CLI could not be executed (${outcome.message}).`,\n );\n}\n\n/**\n * What holds coding admissions while a verification check cannot be asked for a host cause that will not clear on its\n * own (#3423, #3432): which cause, which command (when the cause is one), which check met it, the check's own message,\n * and the run that met it.\n */\nexport interface VerificationToolUnavailableHold {\n readonly hostCause: VerificationHostCause;\n /** The command the check spawns, for the two command causes; absent for a repeated failure, which may spawn none. */\n readonly command?: string;\n /** {@link VerificationHostCause.COMMAND_LACKS_VERB}: the arguments that ask the command for the verb. */\n readonly verbProbeArgs?: readonly string[];\n readonly checkRef: string;\n readonly message: string;\n readonly taskRef: string;\n readonly runTaskId: string;\n readonly observedAt: string;\n /** {@link VerificationHostCause.REPEATED_HOST_FAILURE}: every task the cause was met on, `taskRef` among them. */\n readonly metOnTaskRefs?: readonly string[];\n /** {@link VerificationHostCause.REPEATED_HOST_FAILURE}: from this instant the next admission re-asks the host. */\n readonly reaskAfter?: string;\n /**\n * {@link VerificationHostCause.REPEATED_HOST_FAILURE} whose check could not be asked because this application package's\n * compiled model is behind its sources (`shared-lib`, run 43961156770). Its probe is free: a read of the hold asks the\n * package's compile record (at most once per poll interval), and the hold ends as soon as the package reads compiled\n * current, before `reaskAfter`. Once per successful compile: a reading the CLI still refuses releases one admission, not\n * every read.\n */\n readonly stalePackage?: string;\n}\n\n/**\n * The cause in one sentence, with its remedy (#3432): the subject of the Home line, the build wave's guidance and the\n * drive's stop all say this, so the three cannot disagree about what holds the build or how it ends.\n */\nexport function describeVerificationHostCause(held: VerificationToolUnavailableHold): string {\n switch (held.hostCause) {\n case VerificationHostCause.COMMAND_ABSENT:\n return `\\`${held.command ?? 'a command'}\\` is not on the companion's PATH, so ${held.checkRef} cannot run for any task. `\n + 'Install it in a directory on that PATH, or restart the companion with one: the hold ends as soon as it is found.';\n case VerificationHostCause.COMMAND_LACKS_VERB:\n return `The installed \\`${held.command ?? 'wildo'}\\` does not know \\`${(held.verbProbeArgs ?? []).filter((arg) => arg !== '--help').join(' ')}\\`, `\n + `so ${held.checkRef} cannot run for any task. Update it to the companion's version: the hold ends as soon as it answers the verb.`;\n case VerificationHostCause.REPEATED_HOST_FAILURE:\n if (held.stalePackage !== undefined) {\n return `${held.checkRef} could not be asked, the same way, on ${(held.metOnTaskRefs ?? [held.taskRef]).join(' and ')}: `\n + `${held.stalePackage}'s compiled output is behind its sources, so the check reads a model nobody edited. ${held.message} `\n + `The build waits for ${held.stalePackage} to compile (a stopped compile watcher must be running again; a failed compile `\n + `must be fixed): the hold ends as soon as it is compiled current, and the build asks again from ${held.reaskAfter ?? 'the next admission'} at the latest.`;\n }\n return `${held.checkRef} could not be asked, the same way, on ${(held.metOnTaskRefs ?? [held.taskRef]).join(' and ')}: ${held.message} `\n + `Repair what the message names; the build asks again from ${held.reaskAfter ?? 'the next admission'}.`;\n }\n}\n\n/**\n * The first executable `command` on `pathValue`, as a spawn by bare name finds it (with the Windows command suffixes),\n * or `null`. The probe that ends the hold: free, and asked of the same PATH the verification subprocess receives.\n *\n * A command written as a path (`./bin/wildo`, `/usr/local/bin/wildo`) is not searched on PATH, as a spawn does not\n * search it: it is checked where it is. What the lookup cannot see: an executable that is found but still fails to spawn\n * with ENOENT (a script whose interpreter is missing). Then the hold ends at every lookup and each run meets it again,\n * which is the per-task forgiveness this hold replaces, never worse.\n */\nexport function resolveExecutableOnPath(\n command: string,\n pathValue: string | undefined = process.env.PATH,\n platform: NodeJS.Platform = process.platform,\n pathExtensions: string | undefined = process.env.PATHEXT,\n): string | null {\n const suffixes = platform === 'win32' ? (pathExtensions ?? '.EXE;.CMD;.BAT').split(';') : [''];\n if (command.includes('/') || (platform === 'win32' && command.includes('\\\\'))) {\n for (const suffix of suffixes) {\n try {\n accessSync(`${command}${suffix}`, fsConstants.X_OK);\n return `${command}${suffix}`;\n } catch {\n // Not executable with this suffix.\n }\n }\n return null;\n }\n for (const directory of (pathValue ?? '').split(platform === 'win32' ? ';' : delimiter).filter(Boolean)) {\n for (const suffix of suffixes) {\n const candidate = join(directory, `${command}${suffix}`);\n try {\n accessSync(candidate, fsConstants.X_OK);\n return candidate;\n } catch {\n // Not in this directory.\n }\n }\n }\n return null;\n}\n\n/**\n * The refusal an admission answers while the hold stands and the command is still absent. Names the cause, the\n * remedy, and the door past a lookup that is wrong: a re-arm for the environment of the task whose run MET the hold,\n * which has a failed run to re-arm (the task being admitted usually has none, and its re-arm would be refused).\n */\nexport function describeVerificationToolUnavailableRefusal(taskRef: string, held: VerificationToolUnavailableHold): string {\n if (held.hostCause === VerificationHostCause.COMMAND_ABSENT) {\n return `Coding task ${taskRef} was not started: \\`${held.command}\\` is not on the companion's PATH, so ${held.checkRef} cannot run for any task `\n + `(found by ${held.taskRef} at ${held.observedAt}: ${held.message}). No attempt was spent. `\n + `Install it into a directory already on the companion's PATH, or restart the companion with a PATH that holds it, then dispatch again: `\n + 'the next admission looks it up first. '\n + `If it is on PATH and this lookup is wrong, end the hold with: wildo build rearm ${held.taskRef} --reason environment --note \"<why>\".`;\n }\n return `Coding task ${taskRef} was not started: ${describeVerificationHostCause(held)} No attempt was spent `\n + `(met by ${held.taskRef} at ${held.observedAt}). `\n + `If the cause is gone and this does not clear, end the hold with: wildo build rearm ${held.taskRef} --reason environment --note \"<why>\".`;\n}\n"]}
@@ -50,7 +50,14 @@ export declare enum AcceptRefusalReason {
50
50
  * task read as closed, declined or approved by a person who never decided. No `force` passes it: the remedy is the
51
51
  * decision door, which commits it under the person's name. The reader would not honour it either.
52
52
  */
53
- PERSON_DECISION_RECORD = "person_decision_record"
53
+ PERSON_DECISION_RECORD = "person_decision_record",
54
+ /**
55
+ * The run's file imports a module this same accept left out (#4000), so committing it would leave HEAD importing a
56
+ * module no commit holds. Left out with it, by name, and the rest of the run commits. Before this, the import
57
+ * closure refused the whole run and named the run itself as the one to accept first, which no one could ever do: a
58
+ * foundation run whose generated file a tool had rewritten was never committed, nor its whole scaffold.
59
+ */
60
+ IMPORTS_A_LEFT_OUT_PATH = "imports_a_left_out_path"
54
61
  }
55
62
  /** One path a door left uncommitted, and why. */
56
63
  export interface AcceptRefusal {
@@ -62,6 +69,14 @@ export interface AcceptRefusal {
62
69
  readonly playbookRef: string;
63
70
  };
64
71
  }
72
+ /**
73
+ * The files of `toCommit` whose import is a module the same accept left out (#4000): what to leave out with it. Empty
74
+ * when no unresolved import is of a left-out module, so the refusal stands as it is.
75
+ */
76
+ export declare function importersOfLeftOutModules(unresolved: readonly {
77
+ readonly importer: string;
78
+ readonly workingTreeModule?: string;
79
+ }[], refused: readonly AcceptRefusal[], toCommit: readonly string[]): string[];
65
80
  /**
66
81
  * A file a recorded coding run left in the tree, uncommitted and still exactly as that run left it, while no run of its
67
82
  * task is live (#3267). Under a reviewing posture nothing automatic is coming for it (under a committing one, the next
@@ -1 +1 @@
1
- {"version":3,"file":"accepted-change-commit.companion.service.d.ts","sourceRoot":"","sources":["../../../../src/claude-cli/services/accepted-change-commit.companion.service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,EAAE,IAAI,CAAC;QAC1C,8HAA8H;QAC9H,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;KAC9B,GAAG,OAAO,CAAC,IAAI,CAAC,2BAA2B,EAAE,cAAc,CAAC,GAAG;QAAE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC;IAe/F,wGAAwG;YAC1F,OAAO;CAuCtB"}
@@ -285,6 +285,13 @@ export var AcceptRefusalReason;
285
285
  * decision door, which commits it under the person's name. The reader would not honour it either.
286
286
  */
287
287
  AcceptRefusalReason["PERSON_DECISION_RECORD"] = "person_decision_record";
288
+ /**
289
+ * The run's file imports a module this same accept left out (#4000), so committing it would leave HEAD importing a
290
+ * module no commit holds. Left out with it, by name, and the rest of the run commits. Before this, the import
291
+ * closure refused the whole run and named the run itself as the one to accept first, which no one could ever do: a
292
+ * foundation run whose generated file a tool had rewritten was never committed, nor its whole scaffold.
293
+ */
294
+ AcceptRefusalReason["IMPORTS_A_LEFT_OUT_PATH"] = "imports_a_left_out_path";
288
295
  })(AcceptRefusalReason || (AcceptRefusalReason = {}));
289
296
  /** 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. */
290
297
  function describeRefusal(entry, taskRef) {
@@ -300,6 +307,17 @@ function describeRefusal(entry, taskRef) {
300
307
  : '';
301
308
  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}\`)` : ''}`;
302
309
  }
310
+ /**
311
+ * The files of `toCommit` whose import is a module the same accept left out (#4000): what to leave out with it. Empty
312
+ * when no unresolved import is of a left-out module, so the refusal stands as it is.
313
+ */
314
+ export function importersOfLeftOutModules(unresolved, refused, toCommit) {
315
+ const leftOut = new Set(refused.map((entry) => entry.path));
316
+ return [...new Set(unresolved
317
+ .filter((entry) => entry.workingTreeModule !== undefined && leftOut.has(entry.workingTreeModule))
318
+ .map((entry) => entry.importer))]
319
+ .filter((importer) => toCommit.includes(importer));
320
+ }
303
321
  /**
304
322
  * Move every accepted path an unaccepted playbook run recorded to the refusals (#3221). Applied by every door that
305
323
  * commits a coding run's writes, so a playbook run's output is never committed under a build task's name: it waits
@@ -1014,7 +1032,7 @@ let AcceptedChangeCommitCompanionService = class AcceptedChangeCommitCompanionSe
1014
1032
  if (accepted.length === 0) {
1015
1033
  throw new NothingToAcceptError(`Nothing of run ${input.runId} can be accepted: ${refused.map((entry) => `${entry.path} (${entry.reason})`).join(', ')}.`, refused);
1016
1034
  }
1017
- const message = [
1035
+ const messageFor = (accepted, refused) => [
1018
1036
  `${diff.playbookRef}: accept the run's writes`,
1019
1037
  '',
1020
1038
  `${ACCEPT_ORIGIN_SENTENCE[input.origin ?? AcceptOrigin.OPERATOR]}: the writes of playbook run ${diff.runId} on ${diff.at}.`,
@@ -1045,10 +1063,32 @@ let AcceptedChangeCommitCompanionService = class AcceptedChangeCommitCompanionSe
1045
1063
  * Closed under its imports (#2332): the aggregate files a run wires into also carry the lines the dossier
1046
1064
  * landing added, so the dossier the run read is carried with it, and any other module the commit would
1047
1065
  * import without holding refuses the accept by name rather than leaving HEAD uncompilable.
1066
+ *
1067
+ * One exception, kept partial like the rest of this accept (#4000): a module THIS accept left out above (edited
1068
+ * since the run) leaves out the run's files that import it too, refused by name, until the set closes. Any other
1069
+ * unresolved import still refuses the whole accept.
1048
1070
  */
1049
- const outcome = await this.commitPaths(accepted, message, input.origin ?? AcceptOrigin.OPERATOR, ImportClosurePolicy.REFUSE_UNRESOLVED, committedContent);
1050
- await this.playbookRunWrites.markAccepted(input.runId, outcome.commitSha, new Date().toISOString());
1051
- return { ...outcome, refusedPaths: refused };
1071
+ let toCommit = [...accepted];
1072
+ for (;;) {
1073
+ try {
1074
+ const outcome = await this.commitPaths(toCommit, messageFor(toCommit, refused), input.origin ?? AcceptOrigin.OPERATOR, ImportClosurePolicy.REFUSE_UNRESOLVED, committedContent);
1075
+ await this.playbookRunWrites.markAccepted(input.runId, outcome.commitSha, new Date().toISOString());
1076
+ return { ...outcome, refusedPaths: refused };
1077
+ }
1078
+ catch (error) {
1079
+ if (!(error instanceof AcceptWouldLeaveUnresolvedImportError))
1080
+ throw error;
1081
+ const importersOfLeftOut = importersOfLeftOutModules(error.unresolved, refused, toCommit);
1082
+ if (importersOfLeftOut.length === 0)
1083
+ throw error;
1084
+ for (const importer of importersOfLeftOut)
1085
+ refused.push({ path: importer, reason: AcceptRefusalReason.IMPORTS_A_LEFT_OUT_PATH });
1086
+ toCommit = toCommit.filter((filePath) => !importersOfLeftOut.includes(filePath));
1087
+ if (toCommit.length === 0) {
1088
+ throw new NothingToAcceptError(`Nothing of run ${input.runId} can be accepted: ${refused.map((entry) => `${entry.path} (${entry.reason})`).join(', ')}.`, refused);
1089
+ }
1090
+ }
1091
+ }
1052
1092
  }
1053
1093
  /**
1054
1094
  * A run's change to one file (`previousContent → writtenContent`), applied to the file as HEAD holds it (#2418).