@wildo-ai/dev-companion 1.1.14 → 1.1.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/.tsbuildinfo +1 -1
- package/dist/esm/claude-cli/models/coding-agent-dispatch.models.d.ts +233 -6
- package/dist/esm/claude-cli/models/coding-agent-dispatch.models.d.ts.map +1 -1
- package/dist/esm/claude-cli/models/coding-agent-dispatch.models.js +316 -13
- package/dist/esm/claude-cli/models/coding-agent-dispatch.models.js.map +1 -1
- package/dist/esm/claude-cli/models/concurrent-coding-runs.models.d.ts +48 -2
- package/dist/esm/claude-cli/models/concurrent-coding-runs.models.d.ts.map +1 -1
- package/dist/esm/claude-cli/models/concurrent-coding-runs.models.js +41 -3
- package/dist/esm/claude-cli/models/concurrent-coding-runs.models.js.map +1 -1
- package/dist/esm/claude-cli/models/isolated-recheck-interference.models.d.ts +68 -0
- package/dist/esm/claude-cli/models/isolated-recheck-interference.models.d.ts.map +1 -0
- package/dist/esm/claude-cli/models/isolated-recheck-interference.models.js +198 -0
- package/dist/esm/claude-cli/models/isolated-recheck-interference.models.js.map +1 -0
- package/dist/esm/claude-cli/models/shared-tree-reconciliation.models.d.ts +6 -0
- package/dist/esm/claude-cli/models/shared-tree-reconciliation.models.d.ts.map +1 -1
- package/dist/esm/claude-cli/models/shared-tree-reconciliation.models.js.map +1 -1
- package/dist/esm/claude-cli/models/verification-tool-availability.models.d.ts +19 -5
- package/dist/esm/claude-cli/models/verification-tool-availability.models.d.ts.map +1 -1
- package/dist/esm/claude-cli/models/verification-tool-availability.models.js +17 -5
- package/dist/esm/claude-cli/models/verification-tool-availability.models.js.map +1 -1
- package/dist/esm/claude-cli/models/workspace-path-claims.models.d.ts +138 -0
- package/dist/esm/claude-cli/models/workspace-path-claims.models.d.ts.map +1 -0
- package/dist/esm/claude-cli/models/workspace-path-claims.models.js +204 -0
- package/dist/esm/claude-cli/models/workspace-path-claims.models.js.map +1 -0
- package/dist/esm/claude-cli/services/accepted-change-commit.companion.service.d.ts +36 -1
- package/dist/esm/claude-cli/services/accepted-change-commit.companion.service.d.ts.map +1 -1
- package/dist/esm/claude-cli/services/accepted-change-commit.companion.service.js +71 -16
- package/dist/esm/claude-cli/services/accepted-change-commit.companion.service.js.map +1 -1
- package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.d.ts +234 -9
- package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.d.ts.map +1 -1
- package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.js +1073 -182
- package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.js.map +1 -1
- package/dist/esm/claude-cli/services/research-evidence-store.companion.d.ts +14 -0
- package/dist/esm/claude-cli/services/research-evidence-store.companion.d.ts.map +1 -1
- package/dist/esm/claude-cli/services/research-evidence-store.companion.js +35 -0
- package/dist/esm/claude-cli/services/research-evidence-store.companion.js.map +1 -1
- package/dist/esm/claude-cli/services/unrecorded-provider-directories.companion.d.ts +36 -0
- package/dist/esm/claude-cli/services/unrecorded-provider-directories.companion.d.ts.map +1 -0
- package/dist/esm/claude-cli/services/unrecorded-provider-directories.companion.js +134 -0
- package/dist/esm/claude-cli/services/unrecorded-provider-directories.companion.js.map +1 -0
- package/dist/esm/companion-api/controllers/companion.controller.d.ts.map +1 -1
- package/dist/esm/companion-api/controllers/companion.controller.js +7 -1
- package/dist/esm/companion-api/controllers/companion.controller.js.map +1 -1
- package/dist/esm/core/introspection/resources/creation-home-projection.companion.js +1 -1
- package/dist/esm/core/introspection/resources/creation-home-projection.companion.js.map +1 -1
- package/dist/esm/core/introspection/services/translation-placement.companion.service.d.ts +3 -2
- package/dist/esm/core/introspection/services/translation-placement.companion.service.d.ts.map +1 -1
- package/dist/esm/core/introspection/services/translation-placement.companion.service.js.map +1 -1
- package/dist/esm/core/introspection/subprocess/app-shell-placement-content.behavior.d.ts +13 -0
- package/dist/esm/core/introspection/subprocess/app-shell-placement-content.behavior.d.ts.map +1 -1
- package/dist/esm/core/introspection/subprocess/app-shell-placement-content.behavior.js +98 -16
- package/dist/esm/core/introspection/subprocess/app-shell-placement-content.behavior.js.map +1 -1
- package/dist/esm/core/introspection/subprocess/companion-introspection-behavior-handlers.d.ts.map +1 -1
- package/dist/esm/core/introspection/subprocess/companion-introspection-behavior-handlers.js +24 -14
- package/dist/esm/core/introspection/subprocess/companion-introspection-behavior-handlers.js.map +1 -1
- package/dist/esm/core/introspection/workspace-element-index.companion.d.ts +42 -0
- package/dist/esm/core/introspection/workspace-element-index.companion.d.ts.map +1 -1
- package/dist/esm/core/introspection/workspace-element-index.companion.js +42 -0
- package/dist/esm/core/introspection/workspace-element-index.companion.js.map +1 -1
- package/dist/esm/core/runtime/dev-compile-quiet.companion.d.ts +53 -0
- package/dist/esm/core/runtime/dev-compile-quiet.companion.d.ts.map +1 -1
- package/dist/esm/core/runtime/dev-compile-quiet.companion.js +119 -2
- package/dist/esm/core/runtime/dev-compile-quiet.companion.js.map +1 -1
- package/dist/esm/core/runtime/services/start-companion-application.service.d.ts.map +1 -1
- package/dist/esm/core/runtime/services/start-companion-application.service.js +13 -1
- package/dist/esm/core/runtime/services/start-companion-application.service.js.map +1 -1
- package/dist/esm/core/runtime/utils/companion-platform-config.companion.d.ts +2 -2
- package/dist/esm/core/runtime/utils/companion-platform-config.companion.d.ts.map +1 -1
- package/dist/esm/core/runtime/utils/companion-platform-config.companion.js +6 -6
- package/dist/esm/core/runtime/utils/companion-platform-config.companion.js.map +1 -1
- package/dist/esm/email/services/email-template.companion.service.d.ts +5 -0
- package/dist/esm/email/services/email-template.companion.service.d.ts.map +1 -1
- package/dist/esm/email/services/email-template.companion.service.js +44 -11
- package/dist/esm/email/services/email-template.companion.service.js.map +1 -1
- package/dist/esm/email/utils/email-template-fs-discovery.utils.d.ts +26 -2
- package/dist/esm/email/utils/email-template-fs-discovery.utils.d.ts.map +1 -1
- package/dist/esm/email/utils/email-template-fs-discovery.utils.js +41 -2
- package/dist/esm/email/utils/email-template-fs-discovery.utils.js.map +1 -1
- package/dist/esm/email/utils/email-template-scanner-calls.companion.utils.d.ts +19 -0
- package/dist/esm/email/utils/email-template-scanner-calls.companion.utils.d.ts.map +1 -0
- package/dist/esm/email/utils/email-template-scanner-calls.companion.utils.js +171 -0
- package/dist/esm/email/utils/email-template-scanner-calls.companion.utils.js.map +1 -0
- package/dist/esm/email/utils/module-email-root.companion.utils.d.ts +75 -0
- package/dist/esm/email/utils/module-email-root.companion.utils.d.ts.map +1 -0
- package/dist/esm/email/utils/module-email-root.companion.utils.js +162 -0
- package/dist/esm/email/utils/module-email-root.companion.utils.js.map +1 -0
- package/dist/esm/expert-personas/services/expert-persona.companion.service.d.ts +21 -1
- package/dist/esm/expert-personas/services/expert-persona.companion.service.d.ts.map +1 -1
- package/dist/esm/expert-personas/services/expert-persona.companion.service.js +35 -3
- package/dist/esm/expert-personas/services/expert-persona.companion.service.js.map +1 -1
- package/dist/esm/i18n/components/APP_LAYOUTS_AGENT_ACTIVITY_SETTINGS.en.d.ts +62 -0
- package/dist/esm/i18n/components/APP_LAYOUTS_AGENT_ACTIVITY_SETTINGS.en.d.ts.map +1 -0
- package/dist/esm/i18n/components/APP_LAYOUTS_AGENT_ACTIVITY_SETTINGS.en.js +62 -0
- package/dist/esm/i18n/components/APP_LAYOUTS_AGENT_ACTIVITY_SETTINGS.en.js.map +1 -0
- package/dist/esm/i18n/components/APP_LAYOUTS_AGENT_ACTIVITY_SETTINGS.fr.d.ts +62 -0
- package/dist/esm/i18n/components/APP_LAYOUTS_AGENT_ACTIVITY_SETTINGS.fr.d.ts.map +1 -0
- package/dist/esm/i18n/components/APP_LAYOUTS_AGENT_ACTIVITY_SETTINGS.fr.js +62 -0
- package/dist/esm/i18n/components/APP_LAYOUTS_AGENT_ACTIVITY_SETTINGS.fr.js.map +1 -0
- package/dist/esm/i18n/components/LOW_LEVEL_AI_AGENT_CONFIG.en.d.ts +1 -0
- package/dist/esm/i18n/components/LOW_LEVEL_AI_AGENT_CONFIG.en.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_AI_AGENT_CONFIG.en.js +1 -0
- package/dist/esm/i18n/components/LOW_LEVEL_AI_AGENT_CONFIG.en.js.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_AI_AGENT_CONFIG.fr.d.ts +1 -0
- package/dist/esm/i18n/components/LOW_LEVEL_AI_AGENT_CONFIG.fr.d.ts.map +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_AI_AGENT_CONFIG.fr.js +1 -0
- package/dist/esm/i18n/components/LOW_LEVEL_AI_AGENT_CONFIG.fr.js.map +1 -1
- package/dist/esm/i18n/resources/workbenchAspects.en.d.ts.map +1 -1
- package/dist/esm/i18n/resources/workbenchAspects.en.js +4 -0
- package/dist/esm/i18n/resources/workbenchAspects.en.js.map +1 -1
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.en.d.ts +35 -0
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.en.d.ts.map +1 -1
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.en.js +12 -0
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.en.js.map +1 -1
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.fr.d.ts +536 -531
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.fr.d.ts.map +1 -1
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.fr.js +536 -531
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.fr.js.map +1 -1
- package/dist/esm/i18n/system_enums/workbench-build.en.d.ts +3 -3
- package/dist/esm/i18n/system_enums/workbench-build.en.js +3 -3
- package/dist/esm/i18n/system_enums/workbench-build.en.js.map +1 -1
- package/dist/esm/i18n-labelling/services/email-template-labelling-units.companion.service.d.ts.map +1 -1
- package/dist/esm/i18n-labelling/services/email-template-labelling-units.companion.service.js +7 -3
- package/dist/esm/i18n-labelling/services/email-template-labelling-units.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/models/carried-verification-failure.models.d.ts +23 -0
- package/dist/esm/meta-workflows/models/carried-verification-failure.models.d.ts.map +1 -1
- package/dist/esm/meta-workflows/models/carried-verification-failure.models.js +14 -0
- package/dist/esm/meta-workflows/models/carried-verification-failure.models.js.map +1 -1
- package/dist/esm/meta-workflows/models/creation-journey-timeline.models.d.ts +21 -1
- package/dist/esm/meta-workflows/models/creation-journey-timeline.models.d.ts.map +1 -1
- package/dist/esm/meta-workflows/models/creation-journey-timeline.models.js +117 -3
- package/dist/esm/meta-workflows/models/creation-journey-timeline.models.js.map +1 -1
- package/dist/esm/meta-workflows/services/application-assembly-checks.companion.utils.d.ts +5 -0
- package/dist/esm/meta-workflows/services/application-assembly-checks.companion.utils.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/application-assembly-checks.companion.utils.js +22 -1
- package/dist/esm/meta-workflows/services/application-assembly-checks.companion.utils.js.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.d.ts +98 -24
- package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.js +439 -93
- package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-follow-up-derivation.companion.d.ts +21 -8
- package/dist/esm/meta-workflows/services/application-build-follow-up-derivation.companion.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-follow-up-derivation.companion.js +74 -12
- package/dist/esm/meta-workflows/services/application-build-follow-up-derivation.companion.js.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-generation-step.companion.service.d.ts +47 -1
- package/dist/esm/meta-workflows/services/application-build-generation-step.companion.service.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-generation-step.companion.service.js +98 -9
- package/dist/esm/meta-workflows/services/application-build-generation-step.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-task-coding-policy.companion.service.d.ts +39 -3
- package/dist/esm/meta-workflows/services/application-build-task-coding-policy.companion.service.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-task-coding-policy.companion.service.js +224 -48
- package/dist/esm/meta-workflows/services/application-build-task-coding-policy.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-website-context.companion.service.d.ts +45 -0
- package/dist/esm/meta-workflows/services/application-build-website-context.companion.service.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-website-context.companion.service.js +74 -0
- package/dist/esm/meta-workflows/services/application-build-website-context.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/services/build-task-brief-application-facts.companion.d.ts +12 -0
- package/dist/esm/meta-workflows/services/build-task-brief-application-facts.companion.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/build-task-brief-application-facts.companion.js +30 -1
- package/dist/esm/meta-workflows/services/build-task-brief-application-facts.companion.js.map +1 -1
- package/dist/esm/meta-workflows/services/creation-run-report.companion.service.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/creation-run-report.companion.service.js +21 -2
- package/dist/esm/meta-workflows/services/creation-run-report.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/services/playbook-run.companion.service.d.ts +71 -5
- package/dist/esm/meta-workflows/services/playbook-run.companion.service.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/playbook-run.companion.service.js +219 -17
- package/dist/esm/meta-workflows/services/playbook-run.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/services/provider-registry-brief.companion.utils.d.ts +55 -1
- package/dist/esm/meta-workflows/services/provider-registry-brief.companion.utils.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/provider-registry-brief.companion.utils.js +157 -10
- package/dist/esm/meta-workflows/services/provider-registry-brief.companion.utils.js.map +1 -1
- package/dist/esm/meta-workflows/services/website-demo-facts.models.d.ts +19 -1
- package/dist/esm/meta-workflows/services/website-demo-facts.models.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/website-demo-facts.models.js +7 -5
- package/dist/esm/meta-workflows/services/website-demo-facts.models.js.map +1 -1
- package/dist/esm/module-layout/module-layout-convention.companion.d.ts +158 -0
- package/dist/esm/module-layout/module-layout-convention.companion.d.ts.map +1 -0
- package/dist/esm/module-layout/module-layout-convention.companion.js +272 -0
- package/dist/esm/module-layout/module-layout-convention.companion.js.map +1 -0
- package/dist/esm/module-layout/module-layout-inspection.companion.d.ts +42 -0
- package/dist/esm/module-layout/module-layout-inspection.companion.d.ts.map +1 -0
- package/dist/esm/module-layout/module-layout-inspection.companion.js +290 -0
- package/dist/esm/module-layout/module-layout-inspection.companion.js.map +1 -0
- package/dist/esm/module-layout/module-source-files.companion.d.ts +3 -0
- package/dist/esm/module-layout/module-source-files.companion.d.ts.map +1 -0
- package/dist/esm/module-layout/module-source-files.companion.js +45 -0
- package/dist/esm/module-layout/module-source-files.companion.js.map +1 -0
- package/dist/esm/technical-doc/services/technical-documentation-pilot.companion.service.d.ts +2 -0
- package/dist/esm/technical-doc/services/technical-documentation-pilot.companion.service.d.ts.map +1 -1
- package/dist/esm/technical-doc/services/technical-documentation-pilot.companion.service.js +3 -1
- package/dist/esm/technical-doc/services/technical-documentation-pilot.companion.service.js.map +1 -1
- package/package.json +17 -17
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"concurrent-coding-runs.models.d.ts","sourceRoot":"","sources":["../../../../src/claude-cli/models/concurrent-coding-runs.models.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAE,2BAA2B,EAAE,MAAM,gCAAgC,CAAC;AAG7E,OAAO,EAAE,gCAAgC,EAAE,MAAM,gCAAgC,CAAC;AAElF,8DAA8D;AAC9D,oBAAY,oBAAoB;IAC9B,+GAA+G;IAC/G,aAAa,kBAAkB;IAC/B,6GAA6G;IAC7G,UAAU,eAAe;CAC1B;AAED,mFAAmF;AACnF,eAAO,MAAM,sCAAsC,gBAAgB,CAAC;AAEpE,8GAA8G;AAC9G,wBAAgB,iCAAiC,CAAC,IAAI,EAAE,oBAAoB,EAAE,OAAO,EA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
{"version":3,"file":"concurrent-coding-runs.models.d.ts","sourceRoot":"","sources":["../../../../src/claude-cli/models/concurrent-coding-runs.models.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAE,2BAA2B,EAAE,MAAM,gCAAgC,CAAC;AAG7E,OAAO,EAAE,gCAAgC,EAAE,MAAM,gCAAgC,CAAC;AAElF,8DAA8D;AAC9D,oBAAY,oBAAoB;IAC9B,+GAA+G;IAC/G,aAAa,kBAAkB;IAC/B,6GAA6G;IAC7G,UAAU,eAAe;CAC1B;AAED,mFAAmF;AACnF,eAAO,MAAM,sCAAsC,gBAAgB,CAAC;AAEpE,8GAA8G;AAC9G,wBAAgB,iCAAiC,CAAC,IAAI,EAAE,oBAAoB,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAErG;AAED,wEAAwE;AACxE,wBAAgB,sBAAsB,CAAC,gBAAgB,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAEpF;AAED,mGAAmG;AACnG,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC3C;AAED,mHAAmH;AACnH,MAAM,WAAW,0BAA0B;IACzC,6EAA6E;IAC7E,QAAQ,CAAC,mBAAmB,EAAE,SAAS,MAAM,EAAE,CAAC;IAChD,+GAA+G;IAC/G,QAAQ,CAAC,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3C;;;;;OAKG;IACH,QAAQ,CAAC,6BAA6B,CAAC,EAAE,OAAO,CAAC;CAClD;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,SAAS,eAAe,EAAE,EACnC,IAAI,EAAE;IAAE,QAAQ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aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,EAAE,CAExJ;AAED,qFAAqF;AACrF,MAAM,WAAW,mCAAmC;IAClD,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,0FAA0F;IAC1F,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;CACvC;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE;IAC5C,QAAQ,CAAC,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3C,QAAQ,CAAC,qBAAqB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACnD,QAAQ,CAAC,mBAAmB,CAAC,EAAE,SAAS,mCAAmC,EAAE,CAAC;CAC/E,GAAG,MAAM,EAAE,CAeX"}
|
|
@@ -97,7 +97,8 @@ export function deriveInterferenceSuspected(input) {
|
|
|
97
97
|
}
|
|
98
98
|
/**
|
|
99
99
|
* Whether a run FAILED ITS CHECKS beside siblings, so the failure may be theirs and only a re-check ALONE can say (#3204).
|
|
100
|
-
* Pure:
|
|
100
|
+
* Pure: these runs are re-checked alone, once no live run writes what their checks read or at the wave's end (#3998), and
|
|
101
|
+
* the selector holds their task until that re-check is recorded.
|
|
101
102
|
*
|
|
102
103
|
* Two shapes, and the second is why this is not {@link deriveInterferenceSuspected}:
|
|
103
104
|
* - a check FAILED while an overlapping run may have written (`interferenceSuspected`);
|
|
@@ -153,7 +154,13 @@ export const MAXIMUM_NETWORK_FAILURE_EXCLUSIONS = 4;
|
|
|
153
154
|
* (`networkFailureKind`, #3236) up to {@link MAXIMUM_NETWORK_FAILURE_EXCLUSIONS}, on a bound of its own:
|
|
154
155
|
* a connectivity hold keeps every later admission waiting until the agent's API answers a probe, so a
|
|
155
156
|
* network that is down spends nothing, and the bound stops a network that answers probes and drops
|
|
156
|
-
* every turn from re-dispatching a task forever.
|
|
157
|
+
* every turn from re-dispatching a task forever. Nor, ever, is a run that failed only because its checks could not
|
|
158
|
+
* be ASKED (`verificationUnanswered`, `failedOnlyForUnansweredVerification`, run 43961156770): no check judged the
|
|
159
|
+
* work, so it is never the task's failure. It spends no forgiveness either. Two holds bound the spend instead: a cause
|
|
160
|
+
* met on two distinct tasks holds every admission (`VerificationHostCause.REPEATED_HOST_FAILURE`), and a task meeting
|
|
161
|
+
* it on {@link MAXIMUM_CONSECUTIVE_UNANSWERED_VERIFICATION_RUNS} runs in a row is withheld on its own
|
|
162
|
+
* ({@link deriveUnansweredVerificationWithholding}). Until then a host bound of two applied, and on reference run 43961156770 a dead compile watcher retired ten
|
|
163
|
+
* tasks `attempts_exhausted` after five unanswered checks each. Two other kinds of failure may
|
|
157
164
|
* not be the task's, and each is forgiven up to its own bound, oldest first:
|
|
158
165
|
* - a run that shared the tree when it failed is suspected of interference, up to
|
|
159
166
|
* {@link MAXIMUM_INTERFERENCE_RETRIES};
|
|
@@ -162,7 +169,7 @@ export const MAXIMUM_NETWORK_FAILURE_EXCLUSIONS = 4;
|
|
|
162
169
|
* slot. Either way it is forgiven once, never twice.
|
|
163
170
|
*/
|
|
164
171
|
export function selectBudgetCountingFailures(runs) {
|
|
165
|
-
const oldestFirst = [...runs].filter((run) => run.usageLimited !== true)
|
|
172
|
+
const oldestFirst = [...runs].filter((run) => run.usageLimited !== true && run.verificationUnanswered !== true)
|
|
166
173
|
.sort((left, right) => (left.settledAt ?? '').localeCompare(right.settledAt ?? ''));
|
|
167
174
|
let forgivenInterference = 0;
|
|
168
175
|
let forgivenHost = 0;
|
|
@@ -185,6 +192,37 @@ export function selectBudgetCountingFailures(runs) {
|
|
|
185
192
|
// Callers read newest first, as the budget lookup always returned them.
|
|
186
193
|
return counting.reverse();
|
|
187
194
|
}
|
|
195
|
+
/**
|
|
196
|
+
* How many CONSECUTIVE runs of one task may fail only because their checks could not be asked before the task is withheld
|
|
197
|
+
* (run 43961156770). Such runs never count against the attempt budget ({@link selectBudgetCountingFailures}), and a cause
|
|
198
|
+
* met on two distinct tasks holds every admission; this bounds the cause only ONE task meets. Its own edit can be it (a
|
|
199
|
+
* 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
|
|
200
|
+
* bound it would be re-dispatched, and paid for, forever. Two, as the cross-task hold opens on two.
|
|
201
|
+
*/
|
|
202
|
+
export const MAXIMUM_CONSECUTIVE_UNANSWERED_VERIFICATION_RUNS = 2;
|
|
203
|
+
/**
|
|
204
|
+
* Whether ONE task is withheld because its latest runs could not have their checks asked (run 43961156770), and on which
|
|
205
|
+
* run. Pure. Withheld while all hold:
|
|
206
|
+
* - its newest {@link MAXIMUM_CONSECUTIVE_UNANSWERED_VERIFICATION_RUNS} or more runs (newest first, re-armed ones already
|
|
207
|
+
* left out by the caller) are unanswered;
|
|
208
|
+
* - the newest settled less than `reaskAfterMs` ago: past it, one run asks the host again, as the cross-task hold re-asks;
|
|
209
|
+
* - `hostAnsweredSince` says the host has not answered since that run: a check it failed on ran to a verdict for some
|
|
210
|
+
* run, or the compiled model it named caught up.
|
|
211
|
+
* Never counted, so never `attempts_exhausted`: a re-arm for the environment releases it like any failed run.
|
|
212
|
+
*/
|
|
213
|
+
export function deriveUnansweredVerificationWithholding(runsNewestFirst, input) {
|
|
214
|
+
let consecutive = 0;
|
|
215
|
+
while (consecutive < runsNewestFirst.length && runsNewestFirst[consecutive].verificationUnanswered)
|
|
216
|
+
consecutive += 1;
|
|
217
|
+
const latest = runsNewestFirst[0];
|
|
218
|
+
if (latest === undefined || consecutive < MAXIMUM_CONSECUTIVE_UNANSWERED_VERIFICATION_RUNS)
|
|
219
|
+
return undefined;
|
|
220
|
+
if (input.nowMs - latest.settledAtMs >= input.reaskAfterMs)
|
|
221
|
+
return undefined;
|
|
222
|
+
if (input.hostAnsweredSince(latest))
|
|
223
|
+
return undefined;
|
|
224
|
+
return { latest, consecutive };
|
|
225
|
+
}
|
|
188
226
|
/**
|
|
189
227
|
* The file locations ONE live session event claims as written (#3205 outcome 4), by the engine's one rule
|
|
190
228
|
* (`writtenLocationsOfAcpSessionUpdate`), which the session runner applies when it gathers `reportedFileLocations`. Kept
|
|
@@ -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,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;IAC/B,6GAA6G;IAC7G,iDAAyB,CAAA;AAC3B,CAAC,EALW,oBAAoB,KAApB,oBAAoB,QAK/B;AAED,mFAAmF;AACnF,MAAM,CAAC,MAAM,sCAAsC,GAAG,aAAa,CAAC;AAEpE,8GAA8G;AAC9G,MAAM,UAAU,iCAAiC,CAAC,IAA0B,EAAE,OAAe;IAC3F,OAAO,IAAI,KAAK,oBAAoB,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,sCAAsC,GAAG,OAAO,EAAE,CAAC,CAAC,CAAC,mCAAmC,CAAC;AAChJ,CAAC;AAED,wEAAwE;AACxE,MAAM,UAAU,sBAAsB,CAAC,gBAAoC;IACzE,OAAO,OAAO,gBAAgB,KAAK,QAAQ,IAAI,gBAAgB,CAAC,UAAU,CAAC,sCAAsC,CAAC,CAAC;AACrH,CAAC;AA0BD;;;;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AC;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;IAC/B,6GAA6G;IAC7G,iDAAyB,CAAA;AAC3B,CAAC,EALW,oBAAoB,KAApB,oBAAoB,QAK/B;AAED,mFAAmF;AACnF,MAAM,CAAC,MAAM,sCAAsC,GAAG,aAAa,CAAC;AAEpE,8GAA8G;AAC9G,MAAM,UAAU,iCAAiC,CAAC,IAA0B,EAAE,OAAe;IAC3F,OAAO,IAAI,KAAK,oBAAoB,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,sCAAsC,GAAG,OAAO,EAAE,CAAC,CAAC,CAAC,mCAAmC,CAAC;AAChJ,CAAC;AAED,wEAAwE;AACxE,MAAM,UAAU,sBAAsB,CAAC,gBAAoC;IACzE,OAAO,OAAO,gBAAgB,KAAK,QAAQ,IAAI,gBAAgB,CAAC,UAAU,CAAC,sCAAsC,CAAC,CAAC;AACrH,CAAC;AA0BD;;;;GAIG;AACH,MAAM,UAAU,sBAAsB,CACpC,OAAmC,EACnC,IAA2F,EAC3F,gBAAmC;IAEnC,MAAM,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,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C,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: these runs are re-checked alone, once no live run writes what their checks read or at the wave's end (#3998), and\n * the selector holds their task until that re-check is recorded.\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"]}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { type ApplicationCodingTaskVerificationPlan, type GitWorktreeSnapshot } from './coding-agent-dispatch.models';
|
|
2
|
+
/**
|
|
3
|
+
* Whether a failed run's isolated re-check may run while other coding runs are still live (#3998).
|
|
4
|
+
*
|
|
5
|
+
* A run that failed its checks beside siblings is re-checked ALONE (#3220), because the failure may be a sibling's
|
|
6
|
+
* half-written file rather than the run's own work. Until #3998 "alone" meant "once every run of the wave has settled",
|
|
7
|
+
* so a task waited for the slowest run of its wave whatever that run wrote: on reference run 43961156770 that left the
|
|
8
|
+
* build with nothing running and 27 tasks ready for 13.4 minutes, 44.6 minutes in all.
|
|
9
|
+
*
|
|
10
|
+
* The interference the re-check rules out comes only from runs that write what the re-run checks READ. So a re-check
|
|
11
|
+
* may run beside a live run when that run is not expected to write a package the checks read, and its verdict is kept
|
|
12
|
+
* only when nothing under those packages changed while the checks ran. This module answers both questions; it reads
|
|
13
|
+
* nothing but the application's own package manifests and the two worktree snapshots it is given.
|
|
14
|
+
*/
|
|
15
|
+
/** An application's workspace packages and what each depends on, read from their own `package.json` files. */
|
|
16
|
+
export interface ApplicationWorkspacePackageGraph {
|
|
17
|
+
/** Application-relative package directories, no trailing slash (`shared-lib`, `workers/my-node-worker`). */
|
|
18
|
+
readonly packageDirectories: readonly string[];
|
|
19
|
+
/**
|
|
20
|
+
* Per package directory, the directories of the workspace packages it depends on. A package naming a `workspace:`
|
|
21
|
+
* dependency that no discovered package carries is absent here: its read closure cannot be known, so a check reading
|
|
22
|
+
* it reads the whole application. A `file:` or `link:` dependency outside the application (the framework's own packages
|
|
23
|
+
* in framework development) is no package of it, and no coding run writes it.
|
|
24
|
+
*/
|
|
25
|
+
readonly dependsOn: ReadonlyMap<string, readonly string[]>;
|
|
26
|
+
}
|
|
27
|
+
/** What a set of verification checks reads: a closure of workspace packages, or the whole application. */
|
|
28
|
+
export type VerificationReadScope = {
|
|
29
|
+
readonly wholeApplication: true;
|
|
30
|
+
} | {
|
|
31
|
+
readonly wholeApplication: false;
|
|
32
|
+
readonly packageDirectories: ReadonlySet<string>;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Read the application's workspace packages from the tree (#3998): every directory at the application root, or one level
|
|
36
|
+
* below a root directory that is not itself a package (`workers/*`, `minions/*`, `providers/*`), holding a `package.json`.
|
|
37
|
+
* Derived from what exists rather than from a list, so a package a composition scenario adds is a package here the day it
|
|
38
|
+
* exists. `undefined` when the root cannot be listed: every check then reads the whole application.
|
|
39
|
+
*/
|
|
40
|
+
export declare function readApplicationWorkspacePackageGraph(saasRoot: string): ApplicationWorkspacePackageGraph | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* What these checks read (#3998): the union of each one's root package and every workspace package that root depends on,
|
|
43
|
+
* transitively. The whole application when any check's root is whole, unknown, absent from the graph, or depends on a
|
|
44
|
+
* workspace package that could not be resolved. Files outside every package (the root manifests, `wildo.saas.config.ts`,
|
|
45
|
+
* `infrastructure/`) are read by every check: see {@link isPathReadBy}.
|
|
46
|
+
*/
|
|
47
|
+
export declare function resolveVerificationReadScope(plans: readonly Pick<ApplicationCodingTaskVerificationPlan, 'kind' | 'path'>[], graph: ApplicationWorkspacePackageGraph | undefined): VerificationReadScope;
|
|
48
|
+
/**
|
|
49
|
+
* Whether a write at this path (a file or a prefix) can change what the checks read (#3998). A path inside a package of
|
|
50
|
+
* the read closure can; a path inside another package cannot; a path inside NO package can, because nothing says which
|
|
51
|
+
* checks read it (a root manifest, the application's config, a top-level directory that holds packages).
|
|
52
|
+
*/
|
|
53
|
+
export declare function isPathReadBy(path: string, scope: VerificationReadScope, graph: ApplicationWorkspacePackageGraph | undefined): boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Whether a live run that may write these paths could interfere with the checks (#3998). `undefined` (what the run
|
|
56
|
+
* writes is not known) and an empty list (a run with no stated scope) both interfere: unknown means it may.
|
|
57
|
+
*/
|
|
58
|
+
export declare function writeScopeMayReachReadScope(writes: readonly string[] | undefined, scope: VerificationReadScope, graph: ApplicationWorkspacePackageGraph | undefined): boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Whether anything the checks read changed between two worktree snapshots (#3998): HEAD moved, or a dirty or untracked
|
|
61
|
+
* file the checks read appeared, disappeared or changed its content. What decides whether a re-check that ran beside
|
|
62
|
+
* live runs is kept: the prediction of what each run writes said nothing would be written there, and this says whether
|
|
63
|
+
* anything was, by any writer, a shell command included, among the paths a snapshot lists. A snapshot lists tracked and
|
|
64
|
+
* untracked files, never gitignored ones, so compiled output (`dist/`) is not compared: its sources are. HEAD is compared
|
|
65
|
+
* repository-wide, so any commit during the checks counts as a change (the conservative direction).
|
|
66
|
+
*/
|
|
67
|
+
export declare function readScopeChangedBetween(before: Pick<GitWorktreeSnapshot, 'headSha' | 'files'>, after: Pick<GitWorktreeSnapshot, 'headSha' | 'files'>, scope: VerificationReadScope, graph: ApplicationWorkspacePackageGraph | undefined): boolean;
|
|
68
|
+
//# sourceMappingURL=isolated-recheck-interference.models.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isolated-recheck-interference.models.d.ts","sourceRoot":"","sources":["../../../../src/claude-cli/models/isolated-recheck-interference.models.ts"],"names":[],"mappings":"AAEA,OAAO,EAAoB,KAAK,qCAAqC,EAAE,KAAK,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAExI;;;;;;;;;;;;GAYG;AAEH,8GAA8G;AAC9G,MAAM,WAAW,gCAAgC;IAC/C,4GAA4G;IAC5G,QAAQ,CAAC,kBAAkB,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/C;;;;;OAKG;IACH,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAAC;CAC5D;AAED,0GAA0G;AAC1G,MAAM,MAAM,qBAAqB,GAC7B;IAAE,QAAQ,CAAC,gBAAgB,EAAE,IAAI,CAAA;CAAE,GACnC;IAAE,QAAQ,CAAC,gBAAgB,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,kBAAkB,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;CAAE,CAAC;AAsB3F;;;;;GAKG;AACH,wBAAgB,oCAAoC,CAAC,QAAQ,EAAE,MAAM,GAAG,gCAAgC,GAAG,SAAS,CA6CnH;AAiCD;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,SAAS,IAAI,CAAC,qCAAqC,EAAE,MAAM,GAAG,MAAM,CAAC,EAAE,EAC9E,KAAK,EAAE,gCAAgC,GAAG,SAAS,GAClD,qBAAqB,CAmBvB;AAgBD;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,qBAAqB,EAAE,KAAK,EAAE,gCAAgC,GAAG,SAAS,GAAG,OAAO,CAKrI;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,EACrC,KAAK,EAAE,qBAAqB,EAC5B,KAAK,EAAE,gCAAgC,GAAG,SAAS,GAClD,OAAO,CAGT;AAED;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,IAAI,CAAC,mBAAmB,EAAE,SAAS,GAAG,OAAO,CAAC,EACtD,KAAK,EAAE,IAAI,CAAC,mBAAmB,EAAE,SAAS,GAAG,OAAO,CAAC,EACrD,KAAK,EAAE,qBAAqB,EAC5B,KAAK,EAAE,gCAAgC,GAAG,SAAS,GAClD,OAAO,CAUT"}
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import { existsSync, readdirSync, readFileSync } from 'node:fs';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import { VerificationKind } from './coding-agent-dispatch.models.js';
|
|
4
|
+
const WHOLE_APPLICATION = { wholeApplication: true };
|
|
5
|
+
/** Directory entries that are never a package of the application: installs, git, and dotted (tool or runtime) trees. */
|
|
6
|
+
function isCandidatePackageEntry(name) {
|
|
7
|
+
return name !== 'node_modules' && !name.startsWith('.');
|
|
8
|
+
}
|
|
9
|
+
function readManifest(path) {
|
|
10
|
+
try {
|
|
11
|
+
const parsed = JSON.parse(readFileSync(path, 'utf8'));
|
|
12
|
+
return typeof parsed === 'object' && parsed !== null && !Array.isArray(parsed) ? parsed : undefined;
|
|
13
|
+
}
|
|
14
|
+
catch {
|
|
15
|
+
return undefined;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
const DEPENDENCY_FIELDS = ['dependencies', 'devDependencies', 'peerDependencies', 'optionalDependencies'];
|
|
19
|
+
/** The specifier that names a package of the same workspace, which must therefore resolve to a discovered package. */
|
|
20
|
+
const WORKSPACE_SPECIFIER = /^workspace:/u;
|
|
21
|
+
/**
|
|
22
|
+
* Read the application's workspace packages from the tree (#3998): every directory at the application root, or one level
|
|
23
|
+
* below a root directory that is not itself a package (`workers/*`, `minions/*`, `providers/*`), holding a `package.json`.
|
|
24
|
+
* Derived from what exists rather than from a list, so a package a composition scenario adds is a package here the day it
|
|
25
|
+
* exists. `undefined` when the root cannot be listed: every check then reads the whole application.
|
|
26
|
+
*/
|
|
27
|
+
export function readApplicationWorkspacePackageGraph(saasRoot) {
|
|
28
|
+
let rootEntries;
|
|
29
|
+
try {
|
|
30
|
+
rootEntries = readdirSync(saasRoot, { withFileTypes: true }).filter((entry) => entry.isDirectory() && isCandidatePackageEntry(entry.name)).map((entry) => entry.name);
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
return undefined;
|
|
34
|
+
}
|
|
35
|
+
const manifests = new Map();
|
|
36
|
+
for (const entry of rootEntries) {
|
|
37
|
+
const manifest = existsSync(join(saasRoot, entry, 'package.json')) ? readManifest(join(saasRoot, entry, 'package.json')) : undefined;
|
|
38
|
+
if (manifest !== undefined) {
|
|
39
|
+
manifests.set(entry, manifest);
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
let children;
|
|
43
|
+
try {
|
|
44
|
+
children = readdirSync(join(saasRoot, entry), { withFileTypes: true }).filter((child) => child.isDirectory() && isCandidatePackageEntry(child.name)).map((child) => child.name);
|
|
45
|
+
}
|
|
46
|
+
catch {
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
for (const child of children) {
|
|
50
|
+
const nested = readManifest(join(saasRoot, entry, child, 'package.json'));
|
|
51
|
+
if (nested !== undefined)
|
|
52
|
+
manifests.set(`${entry}/${child}`, nested);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
const directoryByName = new Map();
|
|
56
|
+
for (const [directory, manifest] of manifests) {
|
|
57
|
+
if (typeof manifest.name === 'string')
|
|
58
|
+
directoryByName.set(manifest.name, directory);
|
|
59
|
+
}
|
|
60
|
+
const dependsOn = new Map();
|
|
61
|
+
for (const [directory, manifest] of manifests) {
|
|
62
|
+
const dependencies = [];
|
|
63
|
+
let resolved = true;
|
|
64
|
+
for (const field of DEPENDENCY_FIELDS) {
|
|
65
|
+
const declared = manifest[field];
|
|
66
|
+
if (typeof declared !== 'object' || declared === null)
|
|
67
|
+
continue;
|
|
68
|
+
for (const [name, specifier] of Object.entries(declared)) {
|
|
69
|
+
const dependencyDirectory = directoryByName.get(name);
|
|
70
|
+
if (dependencyDirectory !== undefined)
|
|
71
|
+
dependencies.push(dependencyDirectory);
|
|
72
|
+
else if (typeof specifier === 'string' && WORKSPACE_SPECIFIER.test(specifier))
|
|
73
|
+
resolved = false;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
if (resolved)
|
|
77
|
+
dependsOn.set(directory, [...new Set(dependencies)]);
|
|
78
|
+
}
|
|
79
|
+
return { packageDirectories: [...manifests.keys()], dependsOn };
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* The workspace package each check reads FROM, before its dependency closure (#3998). Exhaustive over
|
|
83
|
+
* {@link VerificationKind}, so a kind added tomorrow does not compile until it says what it reads.
|
|
84
|
+
*
|
|
85
|
+
* - A check with a `path` reads that package (a typecheck, a package build, a design-system check of the frontend).
|
|
86
|
+
* - A check of the application's assembled backend (the resources registry built offline, the schema-plan drift, the FK
|
|
87
|
+
* sweep through the backend's introspection) reads `backend-api`: each of them imports its compiled modules registry,
|
|
88
|
+
* at the path those checks themselves name (`backend-api/dist/modules-registry.backend.js`).
|
|
89
|
+
* - The settings-rail sweep reads `frontend`; the specification evaluation reads `specifications`.
|
|
90
|
+
* - Everything else reads the WHOLE application: a test path can import anything, and the module layout, the config,
|
|
91
|
+
* a running backend, a browser and the website's demo facts are about every package at once.
|
|
92
|
+
*/
|
|
93
|
+
const READ_ROOT_BY_KIND = {
|
|
94
|
+
[VerificationKind.TYPECHECK]: 'PATH',
|
|
95
|
+
[VerificationKind.PACKAGE_BUILD]: 'PATH',
|
|
96
|
+
[VerificationKind.DESIGN_SYSTEM_CONTRAST]: 'PATH',
|
|
97
|
+
[VerificationKind.DESIGN_SYSTEM_CONTRACT]: 'PATH',
|
|
98
|
+
[VerificationKind.DESIGN_SYSTEM_BRAND]: 'PATH',
|
|
99
|
+
[VerificationKind.RESOURCES_REGISTRY_INIT]: 'backend-api',
|
|
100
|
+
[VerificationKind.SCHEMA_PLAN_DRIFT]: 'backend-api',
|
|
101
|
+
[VerificationKind.FRONTEND_FK_RESOLUTION]: 'backend-api',
|
|
102
|
+
[VerificationKind.SETTINGS_PLACEMENT_CONTENT]: 'frontend',
|
|
103
|
+
[VerificationKind.SPECIFICATION_EXPORTS]: 'specifications',
|
|
104
|
+
[VerificationKind.VITEST_PATH]: 'WHOLE',
|
|
105
|
+
[VerificationKind.MODULE_LAYOUT]: 'WHOLE',
|
|
106
|
+
[VerificationKind.CONFIG_VALIDATE]: 'WHOLE',
|
|
107
|
+
[VerificationKind.BACKEND_READY]: 'WHOLE',
|
|
108
|
+
[VerificationKind.BROWSER_SMOKE]: 'WHOLE',
|
|
109
|
+
[VerificationKind.WEBSITE_DEMO_FACTS]: 'WHOLE',
|
|
110
|
+
};
|
|
111
|
+
/**
|
|
112
|
+
* What these checks read (#3998): the union of each one's root package and every workspace package that root depends on,
|
|
113
|
+
* transitively. The whole application when any check's root is whole, unknown, absent from the graph, or depends on a
|
|
114
|
+
* workspace package that could not be resolved. Files outside every package (the root manifests, `wildo.saas.config.ts`,
|
|
115
|
+
* `infrastructure/`) are read by every check: see {@link isPathReadBy}.
|
|
116
|
+
*/
|
|
117
|
+
export function resolveVerificationReadScope(plans, graph) {
|
|
118
|
+
if (graph === undefined || plans.length === 0)
|
|
119
|
+
return WHOLE_APPLICATION;
|
|
120
|
+
const closure = new Set();
|
|
121
|
+
const pending = [];
|
|
122
|
+
for (const plan of plans) {
|
|
123
|
+
const declared = READ_ROOT_BY_KIND[plan.kind];
|
|
124
|
+
const root = declared === 'PATH' ? plan.path : declared === 'WHOLE' ? null : declared;
|
|
125
|
+
if (root === undefined || root === null || root === '' || !graph.packageDirectories.includes(root))
|
|
126
|
+
return WHOLE_APPLICATION;
|
|
127
|
+
pending.push(root);
|
|
128
|
+
}
|
|
129
|
+
while (pending.length > 0) {
|
|
130
|
+
const directory = pending.pop();
|
|
131
|
+
if (closure.has(directory))
|
|
132
|
+
continue;
|
|
133
|
+
const dependencies = graph.dependsOn.get(directory);
|
|
134
|
+
if (dependencies === undefined)
|
|
135
|
+
return WHOLE_APPLICATION;
|
|
136
|
+
closure.add(directory);
|
|
137
|
+
pending.push(...dependencies);
|
|
138
|
+
}
|
|
139
|
+
return { wholeApplication: false, packageDirectories: closure };
|
|
140
|
+
}
|
|
141
|
+
/** An application-relative path or prefix, without a leading `./` or `/`. */
|
|
142
|
+
function normalizeApplicationPath(path) {
|
|
143
|
+
return path.replace(/\\/gu, '/').replace(/^(?:\.\/|\/)+/u, '');
|
|
144
|
+
}
|
|
145
|
+
/** The package directory a path lies in (the longest match), or `undefined` when it lies in none. */
|
|
146
|
+
function packageContaining(path, graph) {
|
|
147
|
+
let best;
|
|
148
|
+
for (const directory of graph.packageDirectories) {
|
|
149
|
+
if ((path === directory || path.startsWith(`${directory}/`)) && (best === undefined || directory.length > best.length))
|
|
150
|
+
best = directory;
|
|
151
|
+
}
|
|
152
|
+
return best;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Whether a write at this path (a file or a prefix) can change what the checks read (#3998). A path inside a package of
|
|
156
|
+
* the read closure can; a path inside another package cannot; a path inside NO package can, because nothing says which
|
|
157
|
+
* checks read it (a root manifest, the application's config, a top-level directory that holds packages).
|
|
158
|
+
*/
|
|
159
|
+
export function isPathReadBy(path, scope, graph) {
|
|
160
|
+
if (scope.wholeApplication || graph === undefined)
|
|
161
|
+
return true;
|
|
162
|
+
const normalized = normalizeApplicationPath(path);
|
|
163
|
+
const owner = normalized === '' ? undefined : packageContaining(normalized, graph);
|
|
164
|
+
return owner === undefined || scope.packageDirectories.has(owner);
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Whether a live run that may write these paths could interfere with the checks (#3998). `undefined` (what the run
|
|
168
|
+
* writes is not known) and an empty list (a run with no stated scope) both interfere: unknown means it may.
|
|
169
|
+
*/
|
|
170
|
+
export function writeScopeMayReachReadScope(writes, scope, graph) {
|
|
171
|
+
if (writes === undefined || writes.length === 0)
|
|
172
|
+
return true;
|
|
173
|
+
return writes.some((path) => isPathReadBy(path, scope, graph));
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Whether anything the checks read changed between two worktree snapshots (#3998): HEAD moved, or a dirty or untracked
|
|
177
|
+
* file the checks read appeared, disappeared or changed its content. What decides whether a re-check that ran beside
|
|
178
|
+
* live runs is kept: the prediction of what each run writes said nothing would be written there, and this says whether
|
|
179
|
+
* anything was, by any writer, a shell command included, among the paths a snapshot lists. A snapshot lists tracked and
|
|
180
|
+
* untracked files, never gitignored ones, so compiled output (`dist/`) is not compared: its sources are. HEAD is compared
|
|
181
|
+
* repository-wide, so any commit during the checks counts as a change (the conservative direction).
|
|
182
|
+
*/
|
|
183
|
+
export function readScopeChangedBetween(before, after, scope, graph) {
|
|
184
|
+
if (before.headSha !== after.headSha)
|
|
185
|
+
return true;
|
|
186
|
+
for (const path of new Set([...Object.keys(before.files), ...Object.keys(after.files)])) {
|
|
187
|
+
if (!isPathReadBy(path, scope, graph))
|
|
188
|
+
continue;
|
|
189
|
+
const earlier = before.files[path];
|
|
190
|
+
const later = after.files[path];
|
|
191
|
+
if (earlier === undefined || later === undefined)
|
|
192
|
+
return true;
|
|
193
|
+
if (earlier.changeKind !== later.changeKind || earlier.fingerprint !== later.fingerprint || earlier.sizeBytes !== later.sizeBytes)
|
|
194
|
+
return true;
|
|
195
|
+
}
|
|
196
|
+
return false;
|
|
197
|
+
}
|
|
198
|
+
//# sourceMappingURL=isolated-recheck-interference.models.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isolated-recheck-interference.models.js","sourceRoot":"","sources":["../../../../src/claude-cli/models/isolated-recheck-interference.models.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAChE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,gBAAgB,EAAwE,MAAM,gCAAgC,CAAC;AAkCxI,MAAM,iBAAiB,GAA0B,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAC;AAE5E,wHAAwH;AACxH,SAAS,uBAAuB,CAAC,IAAY;IAC3C,OAAO,IAAI,KAAK,cAAc,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;AAC1D,CAAC;AAED,SAAS,YAAY,CAAC,IAAY;IAChC,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAY,CAAC;QACjE,OAAO,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAiC,CAAC,CAAC,CAAC,SAAS,CAAC;IACjI,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC;AAED,MAAM,iBAAiB,GAAG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, readdirSync, readFileSync } from 'node:fs';\nimport { join } from 'node:path';\nimport { VerificationKind, type ApplicationCodingTaskVerificationPlan, type GitWorktreeSnapshot } from './coding-agent-dispatch.models';\n\n/**\n * Whether a failed run's isolated re-check may run while other coding runs are still live (#3998).\n *\n * A run that failed its checks beside siblings is re-checked ALONE (#3220), because the failure may be a sibling's\n * half-written file rather than the run's own work. Until #3998 \"alone\" meant \"once every run of the wave has settled\",\n * so a task waited for the slowest run of its wave whatever that run wrote: on reference run 43961156770 that left the\n * build with nothing running and 27 tasks ready for 13.4 minutes, 44.6 minutes in all.\n *\n * The interference the re-check rules out comes only from runs that write what the re-run checks READ. So a re-check\n * may run beside a live run when that run is not expected to write a package the checks read, and its verdict is kept\n * only when nothing under those packages changed while the checks ran. This module answers both questions; it reads\n * nothing but the application's own package manifests and the two worktree snapshots it is given.\n */\n\n/** An application's workspace packages and what each depends on, read from their own `package.json` files. */\nexport interface ApplicationWorkspacePackageGraph {\n /** Application-relative package directories, no trailing slash (`shared-lib`, `workers/my-node-worker`). */\n readonly packageDirectories: readonly string[];\n /**\n * Per package directory, the directories of the workspace packages it depends on. A package naming a `workspace:`\n * dependency that no discovered package carries is absent here: its read closure cannot be known, so a check reading\n * it reads the whole application. A `file:` or `link:` dependency outside the application (the framework's own packages\n * in framework development) is no package of it, and no coding run writes it.\n */\n readonly dependsOn: ReadonlyMap<string, readonly string[]>;\n}\n\n/** What a set of verification checks reads: a closure of workspace packages, or the whole application. */\nexport type VerificationReadScope =\n | { readonly wholeApplication: true }\n | { readonly wholeApplication: false; readonly packageDirectories: ReadonlySet<string> };\n\nconst WHOLE_APPLICATION: VerificationReadScope = { wholeApplication: true };\n\n/** Directory entries that are never a package of the application: installs, git, and dotted (tool or runtime) trees. */\nfunction isCandidatePackageEntry(name: string): boolean {\n return name !== 'node_modules' && !name.startsWith('.');\n}\n\nfunction readManifest(path: string): Record<string, unknown> | undefined {\n try {\n const parsed = JSON.parse(readFileSync(path, 'utf8')) as unknown;\n return typeof parsed === 'object' && parsed !== null && !Array.isArray(parsed) ? parsed as Record<string, unknown> : undefined;\n } catch {\n return undefined;\n }\n}\n\nconst DEPENDENCY_FIELDS = ['dependencies', 'devDependencies', 'peerDependencies', 'optionalDependencies'] as const;\n/** The specifier that names a package of the same workspace, which must therefore resolve to a discovered package. */\nconst WORKSPACE_SPECIFIER = /^workspace:/u;\n\n/**\n * Read the application's workspace packages from the tree (#3998): every directory at the application root, or one level\n * below a root directory that is not itself a package (`workers/*`, `minions/*`, `providers/*`), holding a `package.json`.\n * Derived from what exists rather than from a list, so a package a composition scenario adds is a package here the day it\n * exists. `undefined` when the root cannot be listed: every check then reads the whole application.\n */\nexport function readApplicationWorkspacePackageGraph(saasRoot: string): ApplicationWorkspacePackageGraph | undefined {\n let rootEntries: string[];\n try {\n rootEntries = readdirSync(saasRoot, { withFileTypes: true }).filter((entry) => entry.isDirectory() && isCandidatePackageEntry(entry.name)).map((entry) => entry.name);\n } catch {\n return undefined;\n }\n const manifests = new Map<string, Record<string, unknown>>();\n for (const entry of rootEntries) {\n const manifest = existsSync(join(saasRoot, entry, 'package.json')) ? readManifest(join(saasRoot, entry, 'package.json')) : undefined;\n if (manifest !== undefined) {\n manifests.set(entry, manifest);\n continue;\n }\n let children: string[];\n try {\n children = readdirSync(join(saasRoot, entry), { withFileTypes: true }).filter((child) => child.isDirectory() && isCandidatePackageEntry(child.name)).map((child) => child.name);\n } catch {\n continue;\n }\n for (const child of children) {\n const nested = readManifest(join(saasRoot, entry, child, 'package.json'));\n if (nested !== undefined) manifests.set(`${entry}/${child}`, nested);\n }\n }\n const directoryByName = new Map<string, string>();\n for (const [directory, manifest] of manifests) {\n if (typeof manifest.name === 'string') directoryByName.set(manifest.name, directory);\n }\n const dependsOn = new Map<string, readonly string[]>();\n for (const [directory, manifest] of manifests) {\n const dependencies: string[] = [];\n let resolved = true;\n for (const field of DEPENDENCY_FIELDS) {\n const declared = manifest[field];\n if (typeof declared !== 'object' || declared === null) continue;\n for (const [name, specifier] of Object.entries(declared as Record<string, unknown>)) {\n const dependencyDirectory = directoryByName.get(name);\n if (dependencyDirectory !== undefined) dependencies.push(dependencyDirectory);\n else if (typeof specifier === 'string' && WORKSPACE_SPECIFIER.test(specifier)) resolved = false;\n }\n }\n if (resolved) dependsOn.set(directory, [...new Set(dependencies)]);\n }\n return { packageDirectories: [...manifests.keys()], dependsOn };\n}\n\n/**\n * The workspace package each check reads FROM, before its dependency closure (#3998). Exhaustive over\n * {@link VerificationKind}, so a kind added tomorrow does not compile until it says what it reads.\n *\n * - A check with a `path` reads that package (a typecheck, a package build, a design-system check of the frontend).\n * - A check of the application's assembled backend (the resources registry built offline, the schema-plan drift, the FK\n * sweep through the backend's introspection) reads `backend-api`: each of them imports its compiled modules registry,\n * at the path those checks themselves name (`backend-api/dist/modules-registry.backend.js`).\n * - The settings-rail sweep reads `frontend`; the specification evaluation reads `specifications`.\n * - Everything else reads the WHOLE application: a test path can import anything, and the module layout, the config,\n * a running backend, a browser and the website's demo facts are about every package at once.\n */\nconst READ_ROOT_BY_KIND: Readonly<Record<VerificationKind, 'PATH' | 'WHOLE' | string>> = {\n [VerificationKind.TYPECHECK]: 'PATH',\n [VerificationKind.PACKAGE_BUILD]: 'PATH',\n [VerificationKind.DESIGN_SYSTEM_CONTRAST]: 'PATH',\n [VerificationKind.DESIGN_SYSTEM_CONTRACT]: 'PATH',\n [VerificationKind.DESIGN_SYSTEM_BRAND]: 'PATH',\n [VerificationKind.RESOURCES_REGISTRY_INIT]: 'backend-api',\n [VerificationKind.SCHEMA_PLAN_DRIFT]: 'backend-api',\n [VerificationKind.FRONTEND_FK_RESOLUTION]: 'backend-api',\n [VerificationKind.SETTINGS_PLACEMENT_CONTENT]: 'frontend',\n [VerificationKind.SPECIFICATION_EXPORTS]: 'specifications',\n [VerificationKind.VITEST_PATH]: 'WHOLE',\n [VerificationKind.MODULE_LAYOUT]: 'WHOLE',\n [VerificationKind.CONFIG_VALIDATE]: 'WHOLE',\n [VerificationKind.BACKEND_READY]: 'WHOLE',\n [VerificationKind.BROWSER_SMOKE]: 'WHOLE',\n [VerificationKind.WEBSITE_DEMO_FACTS]: 'WHOLE',\n};\n\n/**\n * What these checks read (#3998): the union of each one's root package and every workspace package that root depends on,\n * transitively. The whole application when any check's root is whole, unknown, absent from the graph, or depends on a\n * workspace package that could not be resolved. Files outside every package (the root manifests, `wildo.saas.config.ts`,\n * `infrastructure/`) are read by every check: see {@link isPathReadBy}.\n */\nexport function resolveVerificationReadScope(\n plans: readonly Pick<ApplicationCodingTaskVerificationPlan, 'kind' | 'path'>[],\n graph: ApplicationWorkspacePackageGraph | undefined,\n): VerificationReadScope {\n if (graph === undefined || plans.length === 0) return WHOLE_APPLICATION;\n const closure = new Set<string>();\n const pending: string[] = [];\n for (const plan of plans) {\n const declared = READ_ROOT_BY_KIND[plan.kind] as string | undefined;\n const root = declared === 'PATH' ? plan.path : declared === 'WHOLE' ? null : declared;\n if (root === undefined || root === null || root === '' || !graph.packageDirectories.includes(root)) return WHOLE_APPLICATION;\n pending.push(root);\n }\n while (pending.length > 0) {\n const directory = pending.pop()!;\n if (closure.has(directory)) continue;\n const dependencies = graph.dependsOn.get(directory);\n if (dependencies === undefined) return WHOLE_APPLICATION;\n closure.add(directory);\n pending.push(...dependencies);\n }\n return { wholeApplication: false, packageDirectories: closure };\n}\n\n/** An application-relative path or prefix, without a leading `./` or `/`. */\nfunction normalizeApplicationPath(path: string): string {\n return path.replace(/\\\\/gu, '/').replace(/^(?:\\.\\/|\\/)+/u, '');\n}\n\n/** The package directory a path lies in (the longest match), or `undefined` when it lies in none. */\nfunction packageContaining(path: string, graph: ApplicationWorkspacePackageGraph): string | undefined {\n let best: string | undefined;\n for (const directory of graph.packageDirectories) {\n if ((path === directory || path.startsWith(`${directory}/`)) && (best === undefined || directory.length > best.length)) best = directory;\n }\n return best;\n}\n\n/**\n * Whether a write at this path (a file or a prefix) can change what the checks read (#3998). A path inside a package of\n * the read closure can; a path inside another package cannot; a path inside NO package can, because nothing says which\n * checks read it (a root manifest, the application's config, a top-level directory that holds packages).\n */\nexport function isPathReadBy(path: string, scope: VerificationReadScope, graph: ApplicationWorkspacePackageGraph | undefined): boolean {\n if (scope.wholeApplication || graph === undefined) return true;\n const normalized = normalizeApplicationPath(path);\n const owner = normalized === '' ? undefined : packageContaining(normalized, graph);\n return owner === undefined || scope.packageDirectories.has(owner);\n}\n\n/**\n * Whether a live run that may write these paths could interfere with the checks (#3998). `undefined` (what the run\n * writes is not known) and an empty list (a run with no stated scope) both interfere: unknown means it may.\n */\nexport function writeScopeMayReachReadScope(\n writes: readonly string[] | undefined,\n scope: VerificationReadScope,\n graph: ApplicationWorkspacePackageGraph | undefined,\n): boolean {\n if (writes === undefined || writes.length === 0) return true;\n return writes.some((path) => isPathReadBy(path, scope, graph));\n}\n\n/**\n * Whether anything the checks read changed between two worktree snapshots (#3998): HEAD moved, or a dirty or untracked\n * file the checks read appeared, disappeared or changed its content. What decides whether a re-check that ran beside\n * live runs is kept: the prediction of what each run writes said nothing would be written there, and this says whether\n * anything was, by any writer, a shell command included, among the paths a snapshot lists. A snapshot lists tracked and\n * untracked files, never gitignored ones, so compiled output (`dist/`) is not compared: its sources are. HEAD is compared\n * repository-wide, so any commit during the checks counts as a change (the conservative direction).\n */\nexport function readScopeChangedBetween(\n before: Pick<GitWorktreeSnapshot, 'headSha' | 'files'>,\n after: Pick<GitWorktreeSnapshot, 'headSha' | 'files'>,\n scope: VerificationReadScope,\n graph: ApplicationWorkspacePackageGraph | undefined,\n): boolean {\n if (before.headSha !== after.headSha) return true;\n for (const path of new Set([...Object.keys(before.files), ...Object.keys(after.files)])) {\n if (!isPathReadBy(path, scope, graph)) continue;\n const earlier = before.files[path];\n const later = after.files[path];\n if (earlier === undefined || later === undefined) return true;\n if (earlier.changeKind !== later.changeKind || earlier.fingerprint !== later.fingerprint || earlier.sizeBytes !== later.sizeBytes) return true;\n }\n return false;\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,4HAA4H;AAC5H,MAAM,WAAW,2BAA2B;IAC1C,uEAAuE;IACvE,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;IACtC,8FAA8F;IAC9F,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC;QAAE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;QAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;
|
|
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,4HAA4H;AAC5H,MAAM,WAAW,2BAA2B;IAC1C,uEAAuE;IACvE,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;IACtC,8FAA8F;IAC9F,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC;QAAE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;QAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,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;
|
|
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,u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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 /**\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"]}
|