@wildo-ai/dev-companion 1.1.15 → 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 +165 -5
- 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 +239 -8
- 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 +2 -1
- package/dist/esm/claude-cli/models/concurrent-coding-runs.models.d.ts.map +1 -1
- package/dist/esm/claude-cli/models/concurrent-coding-runs.models.js +2 -1
- 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/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 +20 -0
- 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 +27 -12
- 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 +155 -3
- 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 +791 -151
- package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.js.map +1 -1
- package/dist/esm/companion-api/controllers/companion.controller.d.ts.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/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/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/system_enums/workbench-build.en.d.ts +1 -1
- package/dist/esm/i18n/system_enums/workbench-build.en.js +1 -1
- package/dist/esm/i18n/system_enums/workbench-build.en.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 +12 -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 +99 -1
- 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 +67 -20
- package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.js +344 -76
- 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.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-follow-up-derivation.companion.js +9 -0
- 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 +38 -2
- 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 +176 -22
- 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/creation-run-report.companion.service.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/creation-run-report.companion.service.js +9 -1
- package/dist/esm/meta-workflows/services/creation-run-report.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/services/playbook-run.companion.service.d.ts +64 -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 +139 -14
- package/dist/esm/meta-workflows/services/playbook-run.companion.service.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/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
|
@@ -35,7 +35,7 @@ import { companionRestartDrain } from '../../core/runtime/restart-drain.companio
|
|
|
35
35
|
import { gitReadBroker } from '../../core/utils/git-read-broker.companion.js';
|
|
36
36
|
import { getFrameworkKnowledgePlaybook, listFrameworkKnowledgePlaybooks, listFrameworkKnowledgeSkillSummaries, readCompiledResearchInformedContent, readFrameworkKnowledgeSkillBody } from '@wildo-ai/framework-knowledge';
|
|
37
37
|
import { MetaWorkflow_EvaluationTreatmentDefinitionSchema, MetaWorkflow_EvaluationVerdict, MetaWorkflow_Executor, MetaWorkflow_ClarificationAction, } from '@wildo-ai/saas-models/meta-workflows';
|
|
38
|
-
import { APPLICATION_SPECIFICATION_SEMANTIC_SCHEMA_BINDINGS, composeElicitationSection, dispatchOutcomeStepRef, BUILD_DECOMPOSE_INPUT_FAMILIES, STANDARD_APPLICATION_SPECIFICATION_SEMANTIC_AUTHORITY, evaluatePlaybookCatalogEligibility, buildApplicationCoherenceReport, collectHeldDraftUndeclaredFactCitations, composeAssuranceDocumentBlueprintBrief, composeAssuranceDocumentFactObligationsBrief, renderAssuranceDocumentClaimGuardsForJudge, composeAssuranceEvidenceBrief, composeAuthoredDocumentFactsBrief, composeAssuranceProgramAuthorityBrief, composeApplicationRoleGraphBrief, deriveOneFamilyFreshness, resolveStepOutputSchema, runPlaybookChoreography, countCheckpointedRounds, describeStaleOutput, describePlaybookRerun, measureChangedAspects, PlaybookLaneBoundaryDecision, collectPlaybookLaneBoundaries, isJudgeVerdictStepRef, buildPlaybookReviewGuide, evaluatePlaybookEligibility, applicationLineRefusalOf, getFamilyPackageRelativePath, resolvePlaybookOutputLandingTarget, resolveDeclaredSetMembers, getLandableArtifactFamilies, isPlaybookGenerationSuspension, renderApplicationCoherenceReport, renderDeclaredInputFamily, composeDeclaredInputWithheldAspects, composeMarketFitScoresSection, composeRiskSignalsSection, widenDeclaredInputAspects, ARTIFACT_PRESENT_WITHOUT_VALUE, collectConvenedExpertRoles, committedCharterRoleRefs, partitionUnstaffedExpertRoles, rederivableExpertRoleRefs, renderPlaybookReviewGuide, runPlaybookGeneration, readPlaybookOutputLandingBaselines, PlaybookOutputLandingConflictError, PlaybookOutputLandingHeldError, SpecificationWriteRefusedError, writeSpecificationFileAtomicallySync, DEFAULT_MAXIMUM_CLARIFICATION_ROUNDS, accumulateClarificationRequests, validateClarificationAnswers, composeClarificationAnswersSection, runPlaybookJudge, runPlaybookLoop, PlaybookGenerationPurpose, composeBillingCommercialModelBrief, composeOperatingJurisdictionCoverageBrief, composeOperatingJurisdictionsSection, composeCreatorStatedFactsSection, projectPlaybookElicitationAsDecision, answersNoLongerOffered, materializeElicitationOptions, readAnswersForPlaybookQuestions, readNonAnswersForPlaybookQuestions, resolveElicitationAnswers, resolveElicitationNonAnswers, buildCreatorInputLatestReadAnswerByPlaybook, resolveApplicationLineScope, collectFamiliesDeactivatedByDecisions, isFamilyNotApplicable, describeApplicationActiveSet, narrowRefinementRound, refinementDependencyMaps, LANDED_SPECIFICATION_CONSTANT_PREFIX, findReadersDatedByWaitingInterviews, selectInterviewsWaitingOnThePerson, readInterviewDepthFromState, PlaybookRerunKind, } from '@wildo-ai/application-creation-runtime';
|
|
38
|
+
import { APPLICATION_SPECIFICATION_SEMANTIC_SCHEMA_BINDINGS, composeElicitationSection, dispatchOutcomeStepRef, BUILD_DECOMPOSE_INPUT_FAMILIES, STANDARD_APPLICATION_SPECIFICATION_SEMANTIC_AUTHORITY, evaluatePlaybookCatalogEligibility, buildApplicationCoherenceReport, collectHeldDraftUndeclaredFactCitations, composeAssuranceDocumentBlueprintBrief, composeAssuranceDocumentFactObligationsBrief, renderAssuranceDocumentClaimGuardsForJudge, composeAssuranceEvidenceBrief, composeAuthoredDocumentFactsBrief, composeAssuranceProgramAuthorityBrief, composeApplicationRoleGraphBrief, deriveOneFamilyFreshness, resolveStepOutputSchema, runPlaybookChoreography, countCheckpointedRounds, describeStaleOutput, describePlaybookRerun, measureChangedAspects, PlaybookLaneBoundaryDecision, collectPlaybookLaneBoundaries, isJudgeVerdictStepRef, buildPlaybookReviewGuide, evaluatePlaybookEligibility, applicationLineRefusalOf, getFamilyPackageRelativePath, resolvePlaybookOutputLandingTarget, resolveDeclaredSetMembers, getLandableArtifactFamilies, isPlaybookGenerationSuspension, renderApplicationCoherenceReport, renderDeclaredInputFamily, composeDeclaredInputWithheldAspects, composeMarketFitScoresSection, composeRiskSignalsSection, widenDeclaredInputAspects, ARTIFACT_PRESENT_WITHOUT_VALUE, collectConvenedExpertRoles, committedCharterRoleRefs, partitionUnstaffedExpertRoles, rederivableExpertRoleRefs, renderPlaybookReviewGuide, runPlaybookGeneration, readPlaybookOutputLandingBaselines, PlaybookOutputLandingConflictError, PlaybookOutputLandingHeldError, SpecificationWriteRefusedError, writeSpecificationFileAtomicallySync, DEFAULT_MAXIMUM_CLARIFICATION_ROUNDS, accumulateClarificationRequests, validateClarificationAnswers, composeClarificationAnswersSection, runPlaybookJudge, runPlaybookLoop, PlaybookGenerationPurpose, composeBillingCommercialModelBrief, composeOperatingJurisdictionCoverageBrief, composeOperatingJurisdictionsSection, composeCreatorStatedFactsSection, projectPlaybookElicitationAsDecision, answersNoLongerOffered, materializeElicitationOptions, readAnswersForPlaybookQuestions, readNonAnswersForPlaybookQuestions, resolveElicitationAnswers, resolveElicitationNonAnswers, buildCreatorInputLatestReadAnswerByPlaybook, resolveApplicationLineScope, collectFamiliesDeactivatedByDecisions, isFamilyNotApplicable, describeApplicationActiveSet, narrowRefinementRound, refinementDependencyMaps, LANDED_SPECIFICATION_CONSTANT_PREFIX, findReadersDatedByWaitingInterviews, selectInterviewsWaitingOnThePerson, readInterviewDepthFromState, PlaybookRerunKind, isBuildUnfinished, playbookRunsBuildWave, } from '@wildo-ai/application-creation-runtime';
|
|
39
39
|
// The provider REGISTRY, not the engine map: importing the package root runs its bootstrap, which
|
|
40
40
|
// registers the engine specifications, and an application's own registered provider specifications
|
|
41
41
|
// join the same registry — so one accessor covers both authorities.
|
|
@@ -1906,6 +1906,12 @@ let PlaybookRunCompanionService = class PlaybookRunCompanionService {
|
|
|
1906
1906
|
this.dossier = dossier;
|
|
1907
1907
|
this.contentSafety = contentSafety;
|
|
1908
1908
|
this.logDebug = this.logger.debugByType('PlaybookRunCompanionService');
|
|
1909
|
+
/*
|
|
1910
|
+
* A deliberation refusing stale seats reads the charters' drift without this service's state, so it asks whether the
|
|
1911
|
+
* build is unfinished through this probe (#4022): the same predicate on the same build-plan progress the board's
|
|
1912
|
+
* `buildPlanExecution` carries, so the board and the refusal agree on which inputs age a charter.
|
|
1913
|
+
*/
|
|
1914
|
+
this.expertPersonas.registerBuildUnfinishedProbe(async () => isBuildUnfinished({ buildPlanExecution: await this.buildDispatch.resolveBuildExecutionProgress() }));
|
|
1909
1915
|
}
|
|
1910
1916
|
/**
|
|
1911
1917
|
* Everything an interview proposal reads and calls (#2129), bound in ONE place so the console, the workbench,
|
|
@@ -2325,6 +2331,17 @@ let PlaybookRunCompanionService = class PlaybookRunCompanionService {
|
|
|
2325
2331
|
},
|
|
2326
2332
|
},
|
|
2327
2333
|
...(input.session ? { trace: this.buildTrace(input.session, 'playbook-choreography') } : {}),
|
|
2334
|
+
}).finally(async () => {
|
|
2335
|
+
/*
|
|
2336
|
+
* A composite that runs the build wave does not settle while the staffing repair its dispatch step started is still
|
|
2337
|
+
* running (#4022), however the choreography ended (a throw included): the repair runs beside the wave, and the
|
|
2338
|
+
* lane's write scope (which admits the staffing step) is what keeps another lane's staffing from deriving the same
|
|
2339
|
+
* charters. Ended on its iteration ceiling, a stop or its closing move, the lane would otherwise release that claim
|
|
2340
|
+
* with the repair still writing.
|
|
2341
|
+
*/
|
|
2342
|
+
if (this.staleExpertChartersRepairInFlight !== undefined && playbookRunsBuildWave(input.playbook.ref, new Map(playbooks.map((playbook) => [playbook.ref, playbook])))) {
|
|
2343
|
+
await this.staleExpertChartersRepairInFlight;
|
|
2344
|
+
}
|
|
2328
2345
|
});
|
|
2329
2346
|
/*
|
|
2330
2347
|
* The run reached its OWN conclusion, however it concluded — so the checkpoint has done its job
|
|
@@ -4079,7 +4096,10 @@ let PlaybookRunCompanionService = class PlaybookRunCompanionService {
|
|
|
4079
4096
|
* its last commit, through the same memoised register and git reads as above. Never throws: what it cannot date it
|
|
4080
4097
|
* does not report.
|
|
4081
4098
|
*/
|
|
4082
|
-
|
|
4099
|
+
// While the build is unfinished, the inputs the build writes do not age a charter (#4022): read off this state's plan.
|
|
4100
|
+
const expertCharterDrift = await this.expertPersonas.assessCharterDrift(artifactsByFamily.get(ApplicationSpecificationFamily.EXPERT_PERSONAS), {
|
|
4101
|
+
buildUnfinished: isBuildUnfinished({ buildPlanExecution }),
|
|
4102
|
+
});
|
|
4083
4103
|
/*
|
|
4084
4104
|
* The creator's answers as an IMPLICIT INPUT of the playbooks that READ them (#1454, Step 8): per
|
|
4085
4105
|
* playbook, the latest `answeredAt` among the answers it reads. Per answer rather than per file —
|
|
@@ -5401,16 +5421,20 @@ let PlaybookRunCompanionService = class PlaybookRunCompanionService {
|
|
|
5401
5421
|
/**
|
|
5402
5422
|
* Derive again the expert charters a build panel refused as stale, by running the staffing step itself (#3204).
|
|
5403
5423
|
*
|
|
5404
|
-
*
|
|
5405
|
-
* and
|
|
5406
|
-
* holds that step and goes on; this runs `top_down.expert-personas`
|
|
5407
|
-
* lane,
|
|
5408
|
-
*
|
|
5424
|
+
* An input a charter reads can move during the build (since #4022 the brand or the vision: the build's own design-system
|
|
5425
|
+
* and accepted-mark writes no longer count while it is unfinished), and the next generation step that seats that expert
|
|
5426
|
+
* is refused (#3244). The build holds that step and goes on; this runs `top_down.expert-personas` as a child of the same
|
|
5427
|
+
* lane, started the moment the step is held, beside the wave ({@link startStaleExpertChartersRepair}), so its landing
|
|
5428
|
+
* is a run of its own, recorded and committed like any other (which is why the refusal itself does not derive the
|
|
5429
|
+
* charter inline). Then the held steps it read are offered again. On reference run 42218788356 the refusal ended
|
|
5409
5430
|
* the build lane at 32 of 98 tasks, and the staffing step it named only ran 20 minutes later, in another lane.
|
|
5410
5431
|
*
|
|
5411
5432
|
* Nothing runs when nothing is held, or when every held seat was edited by a person: such a charter is never derived
|
|
5412
5433
|
* again, and its remedy is the hand edit (the step stays held until that commit). A staffing run that fails is reported
|
|
5413
5434
|
* and keeps the hold: the next round meets the same refusal and tries again.
|
|
5435
|
+
*
|
|
5436
|
+
* It releases only the holds it read when it started (#4022): it runs beside the build now
|
|
5437
|
+
* ({@link startStaleExpertChartersRepair}), and a step held while it ran may wait on a charter it did not derive.
|
|
5414
5438
|
*/
|
|
5415
5439
|
async repairStaleExpertCharters(input) {
|
|
5416
5440
|
const held = this.buildDispatch.readStaleExpertChartersHold();
|
|
@@ -5439,7 +5463,7 @@ let PlaybookRunCompanionService = class PlaybookRunCompanionService {
|
|
|
5439
5463
|
...(input.requestedByUserId ? { requestedByUserId: input.requestedByUserId } : {}),
|
|
5440
5464
|
...(input.session ? { session: input.session } : {}),
|
|
5441
5465
|
});
|
|
5442
|
-
this.buildDispatch.releaseStaleExpertChartersHold(`${EXPERT_STAFFING_PLAYBOOK_REF} derived ${derivable.join(', ')} again
|
|
5466
|
+
this.buildDispatch.releaseStaleExpertChartersHold(`${EXPERT_STAFFING_PLAYBOOK_REF} derived ${derivable.join(', ')} again`, held);
|
|
5443
5467
|
return { heldTaskRefs, ran: true, detail: `${EXPERT_STAFFING_PLAYBOOK_REF} derived ${derivable.join(', ')} again; the held steps run in the next wave.` };
|
|
5444
5468
|
}
|
|
5445
5469
|
catch (error) {
|
|
@@ -5447,6 +5471,86 @@ let PlaybookRunCompanionService = class PlaybookRunCompanionService {
|
|
|
5447
5471
|
return { heldTaskRefs, ran: false, detail: `${EXPERT_STAFFING_PLAYBOOK_REF} failed: ${describeCaughtError(error)}` };
|
|
5448
5472
|
}
|
|
5449
5473
|
}
|
|
5474
|
+
/**
|
|
5475
|
+
* The end of the queue of staffing runs in this process (#4022): each starts once the one before it settled. Both fields
|
|
5476
|
+
* start absent rather than initialised, so a service built without its constructor (the tests' `Object.create`) queues
|
|
5477
|
+
* the same way.
|
|
5478
|
+
*/
|
|
5479
|
+
expertStaffingTail;
|
|
5480
|
+
/** Staffing runs queued or running, so a run can tell it waited for another. */
|
|
5481
|
+
expertStaffingQueued;
|
|
5482
|
+
/**
|
|
5483
|
+
* Run one staffing (`top_down.expert-personas`) after any other in this process has settled (#4022).
|
|
5484
|
+
*
|
|
5485
|
+
* The build-dispatch step now starts its staffing repair beside the wave, so the lane's selector, the board, a person or
|
|
5486
|
+
* another lane can start a staffing run while it runs. Two at once would derive and accept the same charters side by
|
|
5487
|
+
* side: the accept serializes its writes (`acceptMutex`), but both derivations spend a three-pass model protocol and
|
|
5488
|
+
* the later accept overwrites the earlier from the same stale reading. In turn, the one that waited re-reads the
|
|
5489
|
+
* application (`waitedForAnother`), finds the charters the first derived current, and derives nothing. Every door that
|
|
5490
|
+
* runs the step (a direct run, a detached submission, a resume) reaches this through `executePlaybookRun`.
|
|
5491
|
+
*/
|
|
5492
|
+
runExpertStaffingInTurn(work) {
|
|
5493
|
+
const waitedForAnother = (this.expertStaffingQueued ?? 0) > 0;
|
|
5494
|
+
this.expertStaffingQueued = (this.expertStaffingQueued ?? 0) + 1;
|
|
5495
|
+
const run = (this.expertStaffingTail ?? Promise.resolve()).then(() => work(waitedForAnother));
|
|
5496
|
+
this.expertStaffingTail = run.then(() => undefined, () => undefined).finally(() => { this.expertStaffingQueued = (this.expertStaffingQueued ?? 1) - 1; });
|
|
5497
|
+
return run;
|
|
5498
|
+
}
|
|
5499
|
+
/** The staffing repair running beside the build (#4022), if one is: there is at most one at a time. */
|
|
5500
|
+
staleExpertChartersRepairInFlight;
|
|
5501
|
+
/**
|
|
5502
|
+
* Start {@link repairStaleExpertCharters} without waiting for it, unless one is already running, and return the run
|
|
5503
|
+
* in flight (`undefined` when nothing is held, so nothing started).
|
|
5504
|
+
*
|
|
5505
|
+
* Why it no longer waits for the wave (#4022): on reference run 44052185141 the logo step was held at 11:15, the staffing
|
|
5506
|
+
* run started only when that wave drained at 12:27, and the next wave started at 12:36, so ten ready tasks waited eight
|
|
5507
|
+
* minutes on a run only the logo step needed (and again from 13:03 to 13:12). Started the moment a step is held, it runs
|
|
5508
|
+
* beside the coding runs the wave keeps starting, and when it lands it releases the held step for the next slot. A
|
|
5509
|
+
* staffing landing beside live coding runs is the case the in-flight landing window exists for (#3221), as for any
|
|
5510
|
+
* other lane's landing during the build. The build-dispatch step waits for it only when the wave could start nothing
|
|
5511
|
+
* else, since then the held steps are all that is left (and the lane would otherwise spend rounds on empty waves).
|
|
5512
|
+
*/
|
|
5513
|
+
startStaleExpertChartersRepair(input) {
|
|
5514
|
+
if (this.staleExpertChartersRepairInFlight !== undefined)
|
|
5515
|
+
return this.staleExpertChartersRepairInFlight;
|
|
5516
|
+
if (this.buildDispatch.readStaleExpertChartersHold().length === 0)
|
|
5517
|
+
return undefined;
|
|
5518
|
+
const repair = this.repairStaleExpertCharters(input)
|
|
5519
|
+
.catch((error) => {
|
|
5520
|
+
this.logger.warn(`The staffing repair for stale expert charters failed; the held steps stay held: ${describeCaughtError(error)}`);
|
|
5521
|
+
return undefined;
|
|
5522
|
+
})
|
|
5523
|
+
.finally(() => {
|
|
5524
|
+
if (this.staleExpertChartersRepairInFlight === repair)
|
|
5525
|
+
this.staleExpertChartersRepairInFlight = undefined;
|
|
5526
|
+
});
|
|
5527
|
+
this.staleExpertChartersRepairInFlight = repair;
|
|
5528
|
+
return repair;
|
|
5529
|
+
}
|
|
5530
|
+
/**
|
|
5531
|
+
* What the build-dispatch step reports of the staffing repair once its wave has drained (#4022), and whether it waits.
|
|
5532
|
+
*
|
|
5533
|
+
* It waits only when the wave started nothing but steps refused on stale charters (or nothing at all): then the held
|
|
5534
|
+
* steps are all the build has left to run now, and returning would hand the lane an empty wave per round until the
|
|
5535
|
+
* staffing run lands (a held step is passed over, so the wave would find nothing either). Otherwise the staffing run
|
|
5536
|
+
* keeps running beside the next wave, and its landing releases the held steps there.
|
|
5537
|
+
*/
|
|
5538
|
+
async settleStaleExpertChartersRepairAfterWave(input, wave) {
|
|
5539
|
+
// A hold the wave set after its listener was gone (a step settling as the wave ended) starts here.
|
|
5540
|
+
const repair = this.startStaleExpertChartersRepair(input);
|
|
5541
|
+
if (repair === undefined)
|
|
5542
|
+
return undefined;
|
|
5543
|
+
const held = new Set(this.buildDispatch.readStaleExpertChartersHold().map((entry) => entry.taskRef));
|
|
5544
|
+
const startedOtherWork = wave.dispatched.some((entry) => !held.has(entry.plan.taskRef));
|
|
5545
|
+
if (!startedOtherWork)
|
|
5546
|
+
return repair;
|
|
5547
|
+
return {
|
|
5548
|
+
heldTaskRefs: [...held],
|
|
5549
|
+
ran: false,
|
|
5550
|
+
inFlight: true,
|
|
5551
|
+
detail: `${EXPERT_STAFFING_PLAYBOOK_REF} is deriving the stale charters again beside the build; the held steps run once it lands.`,
|
|
5552
|
+
};
|
|
5553
|
+
}
|
|
5450
5554
|
/**
|
|
5451
5555
|
* The single-flight subject this run holds, if any: its composite INSTANCE's (#1610), exactly when the
|
|
5452
5556
|
* playbook DECLARES a choreography and the run is not nested inside another composite — see
|
|
@@ -5885,9 +5989,20 @@ let PlaybookRunCompanionService = class PlaybookRunCompanionService {
|
|
|
5885
5989
|
*/
|
|
5886
5990
|
if (input.dryRun !== true && saasRoot !== undefined
|
|
5887
5991
|
&& (readBuildParallelism(saasRoot) > 1 || this.buildDispatch.readCodingAgentUsageLimitHold() !== undefined)) {
|
|
5888
|
-
|
|
5889
|
-
|
|
5890
|
-
|
|
5992
|
+
/*
|
|
5993
|
+
* A panel refused stale expert charters (#3204): the staffing run that derives them again starts the moment a step is
|
|
5994
|
+
* held, beside the wave (#4022), and a hold carried from an earlier wave starts it now. Only the held steps wait on it.
|
|
5995
|
+
*/
|
|
5996
|
+
const unsubscribeFromHolds = this.buildDispatch.onStaleExpertChartersHeld(() => { void this.startStaleExpertChartersRepair(input); });
|
|
5997
|
+
void this.startStaleExpertChartersRepair(input);
|
|
5998
|
+
let wave;
|
|
5999
|
+
try {
|
|
6000
|
+
wave = await this.buildDispatch.dispatchBuildWave(input.session);
|
|
6001
|
+
}
|
|
6002
|
+
finally {
|
|
6003
|
+
unsubscribeFromHolds();
|
|
6004
|
+
}
|
|
6005
|
+
const staffingRepair = await this.settleStaleExpertChartersRepairAfterWave(input, wave);
|
|
5891
6006
|
// The coding agent's account hit its usage limit: the build resumes on its own at the reset (#2388) — unless a
|
|
5892
6007
|
// person's stop holds it (#3206), read at the wave's END so a stop asked while it drained counts too. The resume
|
|
5893
6008
|
// relaunches what the limit stopped: this run's tree when it was a child of a composite, else a wave (#2463).
|
|
@@ -5907,6 +6022,11 @@ let PlaybookRunCompanionService = class PlaybookRunCompanionService {
|
|
|
5907
6022
|
const dispatch = input.dryRun === true
|
|
5908
6023
|
? { plan: await this.buildDispatch.describeNextBuildTask() }
|
|
5909
6024
|
: await this.buildDispatch.dispatchNextBuildTask(input.session);
|
|
6025
|
+
/*
|
|
6026
|
+
* A held step's staffing run starts now (#4022), beside the coding run this dispatch admitted, and is awaited after it:
|
|
6027
|
+
* a build parallelism of 1 runs one thing per round, so the round waits, but no longer for the two in turn.
|
|
6028
|
+
*/
|
|
6029
|
+
const staffingRepairStarted = input.dryRun === true ? undefined : this.startStaleExpertChartersRepair(input);
|
|
5910
6030
|
/*
|
|
5911
6031
|
* WAIT for the work, then report what it did.
|
|
5912
6032
|
*
|
|
@@ -5930,7 +6050,7 @@ let PlaybookRunCompanionService = class PlaybookRunCompanionService {
|
|
|
5930
6050
|
? await this.buildDispatch.awaitCodingRunOutcome(dispatch.admission.taskId, input.session)
|
|
5931
6051
|
: null;
|
|
5932
6052
|
// The step's panel refused stale expert charters (#3204): repaired here at a build parallelism of 1 too.
|
|
5933
|
-
const staffingRepair =
|
|
6053
|
+
const staffingRepair = await staffingRepairStarted;
|
|
5934
6054
|
// The single dispatch met the coding agent's usage limit: the build resumes on its own at the reset (#2388).
|
|
5935
6055
|
const heldAfterRun = this.buildDispatch.readCodingAgentUsageLimitHold();
|
|
5936
6056
|
// Not when a person stopped the build while the task ran (#3206 review R1): a stop holds it until they start it.
|
|
@@ -6117,8 +6237,12 @@ let PlaybookRunCompanionService = class PlaybookRunCompanionService {
|
|
|
6117
6237
|
* when it staffed none of the roles it attempted, and at the first role an environmental fault reaches (#3204).
|
|
6118
6238
|
*/
|
|
6119
6239
|
if (input.playbookRef === EXPERT_PERSONAS_PLAYBOOK_REF) {
|
|
6120
|
-
|
|
6121
|
-
|
|
6240
|
+
/*
|
|
6241
|
+
* One staffing at a time in this process (#4022); one that waited reads the state the one before it left. A dry run
|
|
6242
|
+
* writes nothing, so it does not queue behind a derivation.
|
|
6243
|
+
*/
|
|
6244
|
+
const staff = async (waitedForAnother) => this.staffExpertPanels({
|
|
6245
|
+
artifactState: waitedForAnother ? await this.readArtifactState() : artifactState,
|
|
6122
6246
|
...(input.dryRun === true ? { dryRun: true } : {}),
|
|
6123
6247
|
run: {
|
|
6124
6248
|
runId,
|
|
@@ -6127,6 +6251,7 @@ let PlaybookRunCompanionService = class PlaybookRunCompanionService {
|
|
|
6127
6251
|
...(input.session ? { traceSessionId: input.session.sessionId } : {}),
|
|
6128
6252
|
},
|
|
6129
6253
|
});
|
|
6254
|
+
return input.dryRun === true ? staff(false) : this.runExpertStaffingInTurn(staff);
|
|
6130
6255
|
}
|
|
6131
6256
|
/*
|
|
6132
6257
|
* What every DETERMINISTIC executor branch below lands under (#3237): the run's identity, for the write record
|