@cat-factory/orchestration 0.298.0 → 0.300.0
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/container/execution-service.d.ts.map +1 -1
- package/dist/container/execution-service.js +5 -0
- package/dist/container/execution-service.js.map +1 -1
- package/dist/modules/bootstrap/BootstrapService.d.ts +17 -8
- package/dist/modules/bootstrap/BootstrapService.d.ts.map +1 -1
- package/dist/modules/bootstrap/BootstrapService.js +114 -44
- package/dist/modules/bootstrap/BootstrapService.js.map +1 -1
- package/dist/modules/bootstrap/MonorepoBootstrapController.d.ts +0 -2
- package/dist/modules/bootstrap/MonorepoBootstrapController.d.ts.map +1 -1
- package/dist/modules/bootstrap/MonorepoBootstrapController.js +1 -5
- package/dist/modules/bootstrap/MonorepoBootstrapController.js.map +1 -1
- package/dist/modules/bootstrap/bootstrapDelivery.d.ts +20 -0
- package/dist/modules/bootstrap/bootstrapDelivery.d.ts.map +1 -0
- package/dist/modules/bootstrap/bootstrapDelivery.js +83 -0
- package/dist/modules/bootstrap/bootstrapDelivery.js.map +1 -0
- package/dist/modules/execution/BugFishingController.d.ts +277 -0
- package/dist/modules/execution/BugFishingController.d.ts.map +1 -0
- package/dist/modules/execution/BugFishingController.js +644 -0
- package/dist/modules/execution/BugFishingController.js.map +1 -0
- package/dist/modules/execution/DeployFixController.d.ts.map +1 -1
- package/dist/modules/execution/DeployFixController.js +13 -3
- package/dist/modules/execution/DeployFixController.js.map +1 -1
- package/dist/modules/execution/EnvironmentInvestigationController.d.ts.map +1 -1
- package/dist/modules/execution/EnvironmentInvestigationController.js +42 -9
- package/dist/modules/execution/EnvironmentInvestigationController.js.map +1 -1
- package/dist/modules/execution/ExecutionService.d.ts +9 -0
- package/dist/modules/execution/ExecutionService.d.ts.map +1 -1
- package/dist/modules/execution/ExecutionService.js +37 -11
- package/dist/modules/execution/ExecutionService.js.map +1 -1
- package/dist/modules/execution/ExecutionServiceDependencies.d.ts +16 -1
- package/dist/modules/execution/ExecutionServiceDependencies.d.ts.map +1 -1
- package/dist/modules/execution/PollCompletionController.d.ts +3 -0
- package/dist/modules/execution/PollCompletionController.d.ts.map +1 -1
- package/dist/modules/execution/PollCompletionController.js +16 -0
- package/dist/modules/execution/PollCompletionController.js.map +1 -1
- package/dist/modules/execution/RunDispatcher.d.ts +1 -0
- package/dist/modules/execution/RunDispatcher.d.ts.map +1 -1
- package/dist/modules/execution/RunDispatcher.js +6 -1
- package/dist/modules/execution/RunDispatcher.js.map +1 -1
- package/dist/modules/execution/RunDispatcherDependencies.d.ts +2 -0
- package/dist/modules/execution/RunDispatcherDependencies.d.ts.map +1 -1
- package/dist/modules/execution/RunDispatcherDependencies.js.map +1 -1
- package/dist/modules/execution/StepGraph.d.ts.map +1 -1
- package/dist/modules/execution/StepGraph.js +10 -6
- package/dist/modules/execution/StepGraph.js.map +1 -1
- package/dist/modules/execution/bugFishing.logic.d.ts +129 -0
- package/dist/modules/execution/bugFishing.logic.d.ts.map +1 -0
- package/dist/modules/execution/bugFishing.logic.js +284 -0
- package/dist/modules/execution/bugFishing.logic.js.map +1 -0
- package/dist/modules/execution/deployer.logic.d.ts +41 -0
- package/dist/modules/execution/deployer.logic.d.ts.map +1 -1
- package/dist/modules/execution/deployer.logic.js +86 -0
- package/dist/modules/execution/deployer.logic.js.map +1 -1
- package/dist/modules/execution/dispatcher-registries.d.ts +4 -2
- package/dist/modules/execution/dispatcher-registries.d.ts.map +1 -1
- package/dist/modules/execution/dispatcher-registries.js +69 -1
- package/dist/modules/execution/dispatcher-registries.js.map +1 -1
- package/dist/modules/execution/gate-window-controllers.d.ts +22 -1
- package/dist/modules/execution/gate-window-controllers.d.ts.map +1 -1
- package/dist/modules/execution/gate-window-controllers.js +29 -0
- package/dist/modules/execution/gate-window-controllers.js.map +1 -1
- package/dist/modules/execution/prReport.environments.d.ts +2 -1
- package/dist/modules/execution/prReport.environments.d.ts.map +1 -1
- package/dist/modules/execution/prReport.environments.js +265 -12
- package/dist/modules/execution/prReport.environments.js.map +1 -1
- package/dist/modules/execution/run-decision-surfaces.d.ts +16 -3
- package/dist/modules/execution/run-decision-surfaces.d.ts.map +1 -1
- package/dist/modules/execution/run-decision-surfaces.js +26 -2
- package/dist/modules/execution/run-decision-surfaces.js.map +1 -1
- package/dist/modules/recurring/RecurringPipelineService.d.ts.map +1 -1
- package/dist/modules/recurring/RecurringPipelineService.js +1 -0
- package/dist/modules/recurring/RecurringPipelineService.js.map +1 -1
- package/dist/modules/settings/workspaceSettingsMerge.d.ts.map +1 -1
- package/dist/modules/settings/workspaceSettingsMerge.js +6 -0
- package/dist/modules/settings/workspaceSettingsMerge.js.map +1 -1
- package/package.json +11 -11
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ConflictError, getErrorMessage,
|
|
1
|
+
import { ConflictError, getErrorMessage, NotFoundError, parseAdoptionDecisions, PR_ADOPTION_MARKERS, redactSecrets, renderAdoptionPrSection, spliceManagedSection, UnavailableError, ValidationError, } from '@cat-factory/kernel';
|
|
2
2
|
import { normalizeServiceDirectory } from '../board/serviceRepoLinkage.js';
|
|
3
3
|
import { surveyMonorepo } from './monorepoSurvey.js';
|
|
4
4
|
/**
|
|
@@ -118,10 +118,6 @@ export class MonorepoBootstrapController {
|
|
|
118
118
|
installationId: repo.installationId,
|
|
119
119
|
};
|
|
120
120
|
}
|
|
121
|
-
/** The branch the apply phase pushes; stable per run so a retry resumes rather than forks. */
|
|
122
|
-
branchFor(jobId) {
|
|
123
|
-
return monorepoBootstrapBranch(jobId);
|
|
124
|
-
}
|
|
125
121
|
/**
|
|
126
122
|
* Survey both repositories and produce the plan a human reviews. NEVER throws: every failure
|
|
127
123
|
* becomes a plan recorded `unavailable` with the cause, because the run parks either way and a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MonorepoBootstrapController.js","sourceRoot":"","sources":["../../../src/modules/bootstrap/MonorepoBootstrapController.ts"],"names":[],"mappings":"AAiBA,OAAO,EACL,aAAa,EACb,eAAe,EACf,
|
|
1
|
+
{"version":3,"file":"MonorepoBootstrapController.js","sourceRoot":"","sources":["../../../src/modules/bootstrap/MonorepoBootstrapController.ts"],"names":[],"mappings":"AAiBA,OAAO,EACL,aAAa,EACb,eAAe,EACf,aAAa,EACb,sBAAsB,EACtB,mBAAmB,EACnB,aAAa,EACb,uBAAuB,EACvB,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,GAChB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAA;AAC1E,OAAO,EAAE,cAAc,EAAmB,MAAM,qBAAqB,CAAA;AAiCrE;;;;;;;;;;;GAWG;AACH,SAAS,WAAW;IAClB,OAAO;QACL,KAAK,EAAE,EAAE;QACT,eAAe,EAAE,EAAE;QACnB,WAAW,EAAE;YACX,KAAK,EAAE,CAAC;YACR,QAAQ,EAAE,CAAC;YACX,KAAK,EAAE,CAAC;YACR,QAAQ,EAAE,CAAC;YACX,SAAS,EAAE,IAAI;YACf,cAAc,EAAE,CAAC;SAClB;KACF,CAAA;AACH,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,eAAe,CAAC,GAAW;IAClC,MAAM,KAAK,GAAG,kCAAkC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IAC1D,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAA;IACpD,OAAO,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAA;AACnE,CAAC;AASD,MAAM,OAAO,2BAA2B;IACT,IAAI;IAAjC,YAA6B,IAA2B;oBAA3B,IAAI;IAA0B,CAAC;IAE5D;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,KAAK,CAAC,aAAa,CACjB,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AAA;IAC9D,CAAC;IAED,iEAAiE;IACzD,WAAW,CAAC,MAAqC,EAAE,MAAc;QACvE,OAAO;YACL,MAAM,EAAE,aAAa;YACrB,iBAAiB,EAAE,MAAM;YACzB,iBAAiB,EAAE,MAAM;YACzB,MAAM,EAAE,WAAW,EAAE;YACrB,SAAS,EAAE,EAAE;YACb,kBAAkB,EAAE,EAAE;YACtB,KAAK,EAAE,IAAI;YACX,WAAW,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE;SACnC,CAAA;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { BootstrapDelivery, BootstrapDeliveryPlan, BootstrapJobRecord } from '@cat-factory/kernel';
|
|
2
|
+
/**
|
|
3
|
+
* The delivery a request that named none takes.
|
|
4
|
+
*
|
|
5
|
+
* The two targets want opposite answers and that is the whole reason the rule lives here rather
|
|
6
|
+
* than as a schema default: a repository this run is creating has nobody to review its first
|
|
7
|
+
* commit, and a monorepo's default branch is the branch every other service is built from.
|
|
8
|
+
*/
|
|
9
|
+
export declare function defaultDelivery(intoMonorepo: boolean): BootstrapDelivery;
|
|
10
|
+
/**
|
|
11
|
+
* Turn a run's recorded `delivery` into the plan a dispatch acts on: the work branch and
|
|
12
|
+
* pull-request text, or nothing at all.
|
|
13
|
+
*
|
|
14
|
+
* One place, read by both targets, because the two dispatch sites otherwise each decide what a
|
|
15
|
+
* `pull_request` run means and only one of them is ever exercised by the test you are writing.
|
|
16
|
+
* `resolved` is the settled adoption review, present only on a monorepo apply; without one the
|
|
17
|
+
* body is the new-repo fallback, since there is no reviewed decision to publish.
|
|
18
|
+
*/
|
|
19
|
+
export declare function deliveryPlanFor(record: BootstrapJobRecord, resolved?: NonNullable<BootstrapJobRecord['adoptionReview']>): BootstrapDeliveryPlan;
|
|
20
|
+
//# sourceMappingURL=bootstrapDelivery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bootstrapDelivery.d.ts","sourceRoot":"","sources":["../../../src/modules/bootstrap/bootstrapDelivery.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,qBAAqB,CAAA;AAoB5B;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,YAAY,EAAE,OAAO,GAAG,iBAAiB,CAExE;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,kBAAkB,EAC1B,QAAQ,CAAC,EAAE,WAAW,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,CAAC,GAC3D,qBAAqB,CA0BvB"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { bootstrapWorkBranch, hostMarkdown, redactSecrets, renderAdoptionPrSection, } from '@cat-factory/kernel';
|
|
2
|
+
import { bootstrapPrTitle } from '@cat-factory/agents';
|
|
3
|
+
// ---------------------------------------------------------------------------
|
|
4
|
+
// How a bootstrap run's work LEAVES the container: the rule for a request that named no
|
|
5
|
+
// delivery, and the plan a dispatch acts on once one is recorded.
|
|
6
|
+
//
|
|
7
|
+
// A module of its own rather than three more members on `BootstrapService`, because all of it
|
|
8
|
+
// is a pure function of the stored run: nothing here reads a repository, a clock or a port, so
|
|
9
|
+
// keeping it beside the orchestration only made the delivery rule reachable exclusively through
|
|
10
|
+
// a run that had already been started, and put a PR BODY (a host-rendered, untrusted-text
|
|
11
|
+
// surface with its own escaping and scrubbing rules) in the middle of a 1,400-line service.
|
|
12
|
+
// ---------------------------------------------------------------------------
|
|
13
|
+
/**
|
|
14
|
+
* The delivery a request that named none takes.
|
|
15
|
+
*
|
|
16
|
+
* The two targets want opposite answers and that is the whole reason the rule lives here rather
|
|
17
|
+
* than as a schema default: a repository this run is creating has nobody to review its first
|
|
18
|
+
* commit, and a monorepo's default branch is the branch every other service is built from.
|
|
19
|
+
*/
|
|
20
|
+
export function defaultDelivery(intoMonorepo) {
|
|
21
|
+
return intoMonorepo ? 'pull_request' : 'direct_push';
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Turn a run's recorded `delivery` into the plan a dispatch acts on: the work branch and
|
|
25
|
+
* pull-request text, or nothing at all.
|
|
26
|
+
*
|
|
27
|
+
* One place, read by both targets, because the two dispatch sites otherwise each decide what a
|
|
28
|
+
* `pull_request` run means and only one of them is ever exercised by the test you are writing.
|
|
29
|
+
* `resolved` is the settled adoption review, present only on a monorepo apply; without one the
|
|
30
|
+
* body is the new-repo fallback, since there is no reviewed decision to publish.
|
|
31
|
+
*/
|
|
32
|
+
export function deliveryPlanFor(record, resolved) {
|
|
33
|
+
if (record.delivery === 'direct_push')
|
|
34
|
+
return { mode: 'direct_push' };
|
|
35
|
+
const directory = record.monorepo?.directory;
|
|
36
|
+
return {
|
|
37
|
+
mode: 'pull_request',
|
|
38
|
+
// The branch the run RECORDED, which is what a retry carries forward: deriving it off
|
|
39
|
+
// `record.id` here would mint a new one per attempt (a retry is a new row), so the harness's
|
|
40
|
+
// resume would never fire and the previous attempt's pushed work would be abandoned on an
|
|
41
|
+
// orphan branch. A row written before the field existed carries none, and this attempt then
|
|
42
|
+
// claims one off its own id, exactly as that row's own dispatch did.
|
|
43
|
+
branch: record.workBranch ?? bootstrapWorkBranch(record.id),
|
|
44
|
+
pr: {
|
|
45
|
+
title: bootstrapPrTitle(record.repoName, directory),
|
|
46
|
+
// The HOST rendering (neutralised holes, scrubbed at compose time), never the agent brief:
|
|
47
|
+
// this string lands on a pull request body, where a reviewer's note reading "fixes #412"
|
|
48
|
+
// would close an unrelated issue on merge. It is the FALLBACK body; on a monorepo run the
|
|
49
|
+
// engine also publishes the same decisions as its own marker region once the pull request
|
|
50
|
+
// exists, because the harness lets an agent-authored description replace this one. BOTH
|
|
51
|
+
// bodies are scrubbed: a PR body is strictly more exposed than the telemetry DB, and a
|
|
52
|
+
// reference architecture's name is free text somebody typed.
|
|
53
|
+
body: resolved && directory
|
|
54
|
+
? (redactSecrets(renderAdoptionPrSection(resolved, directory)) ?? '')
|
|
55
|
+
: (redactSecrets(newRepoPrBody(record.repoName, record.referenceArchitectureName)) ?? ''),
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* The pull-request body a run that has no adoption review to publish opens with.
|
|
61
|
+
*
|
|
62
|
+
* Only ever the FALLBACK: the harness lets the agent's own `.cat-pr-description.md` replace it
|
|
63
|
+
* field-wise, and the PR-description guidance rides every agent pass, so a run whose agent wrote
|
|
64
|
+
* a briefing publishes that instead. What this owes is one honest sentence for the run whose
|
|
65
|
+
* agent wrote none, naming where the code came from rather than leaving a reviewer an empty body.
|
|
66
|
+
*
|
|
67
|
+
* Every hole goes through `hostMarkdown`, which is the rule for a host-rendered surface
|
|
68
|
+
* regardless of how constrained the value looks from here. Both are rendered as CODE SPANS, so
|
|
69
|
+
* they go through `inlineCode`, which sizes the backtick run around the value: hand-writing the
|
|
70
|
+
* ticks around `inline` would be wrong twice over, because `inline` skips escaping whatever it
|
|
71
|
+
* reads as an existing code span (a name holding `` `#42` `` would auto-link an issue on the new
|
|
72
|
+
* repository's first pull request) and its numeric entities are not decoded inside a span (a name
|
|
73
|
+
* holding `@ops` would reach the reader as `@ops`).
|
|
74
|
+
*/
|
|
75
|
+
function newRepoPrBody(repoName, referenceName) {
|
|
76
|
+
const from = referenceName
|
|
77
|
+
? `the ${hostMarkdown.inlineCode(referenceName)} reference architecture`
|
|
78
|
+
: 'a freeform brief';
|
|
79
|
+
return (`Bootstrapped ${hostMarkdown.inlineCode(repoName)} from ${from}.\n\n` +
|
|
80
|
+
`This is the repository's first content: review it before merging, because merging is what ` +
|
|
81
|
+
`makes it the default branch every later run builds on.`);
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=bootstrapDelivery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bootstrapDelivery.js","sourceRoot":"","sources":["../../../src/modules/bootstrap/bootstrapDelivery.ts"],"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a,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,yBAAyB,CAAC,CAAC,IAAI,EAAE,CAAC;SAC9F;KACF,CAAA;AACH,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,SAAS,aAAa,CAAC,QAAgB,EAAE,aAA4B;IACnE,MAAM,IAAI,GAAG,aAAa;QACxB,CAAC,CAAC,OAAO,YAAY,CAAC,UAAU,CAAC,aAAa,CAAC,yBAAyB;QACxE,CAAC,CAAC,kBAAkB,CAAA;IACtB,OAAO,CACL,gBAAgB,YAAY,CAAC,UAAU,CAAC,QAAQ,CAAC,SAAS,IAAI,OAAO;QACrE,4FAA4F;QAC5F,wDAAwD,CACzD,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
import type { AddressBugFishingFindingsInput, Block, BlockRepository, BugFishingAgentOutput, BugFishingStepState, Clock, ExecutionInstance, ExecutionEventPublisher, ExecutionRepository, IdGenerator, Logger, PipelineRepository, PipelineStep, ServiceRepository, WorkspaceSettingsRepository } from '@cat-factory/kernel';
|
|
2
|
+
import type { TaskTypeCreationDefaults } from '../board/taskTypeCreationDefaults.js';
|
|
3
|
+
import type { NotificationService } from '../notifications/NotificationService.js';
|
|
4
|
+
import type { AdvanceResult } from './advance.js';
|
|
5
|
+
import type { RunStateMachine } from './RunStateMachine.js';
|
|
6
|
+
import type { StepGraph } from './StepGraph.js';
|
|
7
|
+
/** The step kind the bug-fishing phase loop runs on (the read-only expedition agent). */
|
|
8
|
+
export declare const BUG_FISHING_STEP_KIND = "bug-fisher";
|
|
9
|
+
/** What the bug-fishing controller needs beyond the shared run state-machine spine. */
|
|
10
|
+
export interface BugFishingControllerDeps {
|
|
11
|
+
executionRepository: ExecutionRepository;
|
|
12
|
+
blockRepository: BlockRepository;
|
|
13
|
+
pipelineRepository: PipelineRepository;
|
|
14
|
+
/**
|
|
15
|
+
* Where a board's default fix pipeline lives. Optional for the same reason the verification
|
|
16
|
+
* report's read of it is: a deployment that wires no settings store has no configured default,
|
|
17
|
+
* which is a different fact from a store that cannot be read (see
|
|
18
|
+
* {@link BugFishingController.resolveDefaultFixPipelineId}).
|
|
19
|
+
*/
|
|
20
|
+
workspaceSettingsRepository?: WorkspaceSettingsRepository;
|
|
21
|
+
/** The async instance/block spine (park/advance/persist/emit/progress). */
|
|
22
|
+
stateMachine: RunStateMachine;
|
|
23
|
+
/** The pure step mutators (start/finish/pause a step). */
|
|
24
|
+
stepGraph: StepGraph;
|
|
25
|
+
idGenerator: IdGenerator;
|
|
26
|
+
clock: Clock;
|
|
27
|
+
/** Resolves the frame block's service row, so a spawned task lands in the right service. */
|
|
28
|
+
serviceRepository?: ServiceRepository;
|
|
29
|
+
/**
|
|
30
|
+
* The task-type creation defaults, narrowed to the one question a spawn asks: which
|
|
31
|
+
* best-practice fragments a new `bug` task under this service is created with. The SAME seam
|
|
32
|
+
* `BoardService.addTask` reads, so a spawned fix and a hand-filed one are held to one set of
|
|
33
|
+
* standards. Absent ⇒ no fragments, the answer a deployment with no fragment pool gets anyway.
|
|
34
|
+
*/
|
|
35
|
+
taskTypeDefaults?: Pick<TaskTypeCreationDefaults, 'fragmentIdsFor'>;
|
|
36
|
+
/** Bound `ExecutionService.start` — a spawned fix starts through the real entry point. */
|
|
37
|
+
start: (workspaceId: string, blockId: string, pipelineId: string, opts: {
|
|
38
|
+
initiatedBy: string | null;
|
|
39
|
+
}) => Promise<{
|
|
40
|
+
id: string;
|
|
41
|
+
} | unknown>;
|
|
42
|
+
/** Board fan-out, so a spawned task appears on open boards without a refresh. */
|
|
43
|
+
events?: ExecutionEventPublisher;
|
|
44
|
+
/** Optional inbox channel; when unwired the `bug_fishing_triage` card is skipped. */
|
|
45
|
+
notificationService?: NotificationService;
|
|
46
|
+
logger?: Logger;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Drives the BUG-FISHING EXPEDITION: the read-only `bug-fisher` agent's phase loop, the human
|
|
50
|
+
* triage that follows it, and the bug-fix tasks that triage spawns.
|
|
51
|
+
*
|
|
52
|
+
* The shape is the Ralph loop's (one step, dispatched repeatedly) joined to the PR review's
|
|
53
|
+
* (park, then let a human act on findings). {@link recordPhaseResult} runs as the completion
|
|
54
|
+
* interceptor's body: it stamps the finished pass's findings onto `step.bugFishing` and either
|
|
55
|
+
* RE-ARMS the same step for the next angle or, once every angle has settled, parks the run for
|
|
56
|
+
* triage. {@link address} spawns a bug-fix task per marked finding, and {@link resolve} finishes
|
|
57
|
+
* the parked expedition.
|
|
58
|
+
*
|
|
59
|
+
* Two properties are worth stating because they are what the design is FOR:
|
|
60
|
+
*
|
|
61
|
+
* - **Marking does not wait for the expedition.** {@link address} accepts findings while later
|
|
62
|
+
* angles are still fishing. That is the whole reason the angles run as separate dispatches
|
|
63
|
+
* rather than as one prompt: a human who reads the concurrency pass at minute six should be
|
|
64
|
+
* able to start its fix then, not after the requirements pass finishes at minute forty.
|
|
65
|
+
* - **A failed angle costs only that angle.** The passes share nothing but the checkout, so
|
|
66
|
+
* {@link recordPhaseFailure} settles the one that died with its reason on the record and moves
|
|
67
|
+
* to the next, rather than failing a run that has already caught something.
|
|
68
|
+
*
|
|
69
|
+
* All expedition state rides the run's `bug-fisher` step (`step.bugFishing`) — no side table —
|
|
70
|
+
* so it is runtime-symmetric by construction, exactly like `prReview` / `forkDecision`.
|
|
71
|
+
*/
|
|
72
|
+
export declare class BugFishingController {
|
|
73
|
+
private readonly deps;
|
|
74
|
+
private readonly log;
|
|
75
|
+
constructor(deps: BugFishingControllerDeps);
|
|
76
|
+
/**
|
|
77
|
+
* The expedition state a `bug-fisher` step should carry on THIS dispatch, seeded on first
|
|
78
|
+
* entry from the task's angle selection and the workspace's fix-pipeline default.
|
|
79
|
+
*
|
|
80
|
+
* Called by the step handler before dispatching, and idempotent: a step that already carries
|
|
81
|
+
* an expedition (every dispatch after the first, and every durable replay of the first) keeps
|
|
82
|
+
* it, because re-planning would discard the phases already fished.
|
|
83
|
+
*
|
|
84
|
+
* ALWAYS plans at least one angle, because {@link planBugFishingPhases} falls back to the whole
|
|
85
|
+
* catalog: an empty or entirely unrecognised selection means "fish everything", which is the
|
|
86
|
+
* point of an expedition, so narrowing it is the deliberate act. There is deliberately no
|
|
87
|
+
* "planned nothing" outcome for the handler to pass through — one existed, could not be
|
|
88
|
+
* reached, and would have dispatched a full container run for a step it had just marked
|
|
89
|
+
* skipped.
|
|
90
|
+
*/
|
|
91
|
+
ensurePlanned(workspaceId: string, step: PipelineStep, block: Block): Promise<BugFishingStepState>;
|
|
92
|
+
/**
|
|
93
|
+
* Record a COMPLETED pass and decide the flow. Runs as the completion interceptor's body
|
|
94
|
+
* (short-circuiting `recordStepResult` when it parks or loops).
|
|
95
|
+
*
|
|
96
|
+
* With angles left: stamp the findings, re-arm the SAME step and return `continue`, so the
|
|
97
|
+
* durable driver re-enters and dispatches the next angle (the dispatch epoch gives it a job id
|
|
98
|
+
* of its own — see `dispatchEpochFor`). With the last angle settled: park on a durable
|
|
99
|
+
* decision-wait and raise the triage card. An expedition that caught nothing at all still
|
|
100
|
+
* parks: "we looked from eight angles and found nothing" is the answer a human asked for, and
|
|
101
|
+
* advancing silently past it would present that as no answer.
|
|
102
|
+
*
|
|
103
|
+
* Idempotent against a durable replay: a step whose expedition is no longer `fishing` has
|
|
104
|
+
* already been recorded, so it falls through to whatever its status says.
|
|
105
|
+
*/
|
|
106
|
+
recordPhaseResult(workspaceId: string, instance: ExecutionInstance, step: PipelineStep, output: BugFishingAgentOutput | undefined, model: string | null | undefined, block: Block | null | undefined): Promise<AdvanceResult | null>;
|
|
107
|
+
/**
|
|
108
|
+
* Settle a pass whose container job FAILED, then carry on with the next angle.
|
|
109
|
+
*
|
|
110
|
+
* Run from the driver's failed-job path (the analogue of the PR-review challenge failure
|
|
111
|
+
* branch). The angles are independent by construction, so one crashing must not cost the
|
|
112
|
+
* expedition the passes that already landed nor the ones still to come; the failure is NAMED
|
|
113
|
+
* on the phase, because a phase that silently reported nothing is indistinguishable from a
|
|
114
|
+
* phase that honestly found nothing. Returns null when the step carries no live expedition, so
|
|
115
|
+
* an ordinary failure still fails the run.
|
|
116
|
+
*/
|
|
117
|
+
recordPhaseFailure(workspaceId: string, instance: ExecutionInstance, step: PipelineStep, reason: string | null, block: Block | null | undefined): Promise<AdvanceResult | null>;
|
|
118
|
+
/**
|
|
119
|
+
* Re-arm the `bug-fisher` step for the NEXT angle and let the driver re-enter.
|
|
120
|
+
*
|
|
121
|
+
* `resetStepForRerun` clears the job handle (which is what makes the driver dispatch again on
|
|
122
|
+
* re-entry) while deliberately leaving `bugFishing` alone — the state is the accumulated catch,
|
|
123
|
+
* and clearing it would throw away every pass before this one. The container is reclaimed
|
|
124
|
+
* first so the next angle boots a fresh context: a container-reusing transport would otherwise
|
|
125
|
+
* re-attach to the finished job and replay its result, which reads as an angle that found
|
|
126
|
+
* exactly what the previous one did.
|
|
127
|
+
*/
|
|
128
|
+
private rearmForNextPhase;
|
|
129
|
+
/**
|
|
130
|
+
* MARK findings to be addressed: spawn a bug-fix task per finding, linked to the expedition.
|
|
131
|
+
*
|
|
132
|
+
* Accepted while the expedition is still fishing later angles as well as once it has parked —
|
|
133
|
+
* see the class doc for why that is the point rather than a convenience.
|
|
134
|
+
*
|
|
135
|
+
* Order of operations per finding, and why: the spawn record is CLAIMED under the run's
|
|
136
|
+
* compare-and-swap first, with the task id it is about to create, and only then is the block
|
|
137
|
+
* inserted and its run started; the claim is settled to `spawned` or `failed` afterwards.
|
|
138
|
+
* Creating first and recording after was the first cut and it is not safe: two people marking
|
|
139
|
+
* the same finding (or one person and a retried request) both read a snapshot with no spawn on
|
|
140
|
+
* it, and both file the same bug and start a run for it. The claim is what makes exactly one
|
|
141
|
+
* of them win, and it is why a spawn record must be read through its STATUS rather than by
|
|
142
|
+
* being present: `pending` means a task is being made, not that one exists.
|
|
143
|
+
*
|
|
144
|
+
* The pipeline is resolved ONCE for the whole batch and validated against the workspace's
|
|
145
|
+
* catalog before anything is created: a caller naming a pipeline that does not exist gets a
|
|
146
|
+
* refusal naming it, rather than N tasks pinned to a pipeline nothing can run.
|
|
147
|
+
*/
|
|
148
|
+
address(workspaceId: string, executionId: string, input: AddressBugFishingFindingsInput, initiatedBy: string | null): Promise<BugFishingStepState>;
|
|
149
|
+
/**
|
|
150
|
+
* Claim ONE finding, create its fix task behind the claim, and settle the claim either way.
|
|
151
|
+
*
|
|
152
|
+
* The three writes are separate on purpose. The CLAIM is the concurrency boundary: it lands
|
|
153
|
+
* under CAS, and the caller learns whether it won by re-reading the finding and comparing the
|
|
154
|
+
* task id it minted — the initiative loop's spawn recognises its own the same way, and for the
|
|
155
|
+
* same reason (the loser's transform is a no-op, so a lost race creates nothing rather than
|
|
156
|
+
* duplicating the winner's work).
|
|
157
|
+
*
|
|
158
|
+
* The SETTLE writes cannot be skipped on either branch. On success the record becomes terminal,
|
|
159
|
+
* which is what stops the finding being marked twice. On failure it records the cause and
|
|
160
|
+
* becomes claimable again, which is what stops a finding whose fix task was never created from
|
|
161
|
+
* reading as one that is being worked on. The failure then PROPAGATES: marking is the caller's
|
|
162
|
+
* own request, so answering 200 with a finding nobody is fixing would report work the platform
|
|
163
|
+
* did not do.
|
|
164
|
+
*/
|
|
165
|
+
private spawnForFinding;
|
|
166
|
+
/**
|
|
167
|
+
* Apply a pure reduction to the run's live expedition state under CAS, and answer the result.
|
|
168
|
+
*
|
|
169
|
+
* REFUSES rather than returning when the winning snapshot carries no expedition. That case was
|
|
170
|
+
* a silent `return` and it is the worst shape available here: on the settle path the task and
|
|
171
|
+
* its run already exist, so dropping the write leaves a finding that reads as untouched beside
|
|
172
|
+
* a fix task nothing on the expedition points at, and the caller is told it all worked.
|
|
173
|
+
*/
|
|
174
|
+
private mutateExpedition;
|
|
175
|
+
/**
|
|
176
|
+
* Dismiss a finding: it stays on the expedition's record, struck through, and can no longer be
|
|
177
|
+
* marked. A curation action, not a resolution — the run stays exactly where it is, whether it
|
|
178
|
+
* is still fishing or already parked.
|
|
179
|
+
*
|
|
180
|
+
* REFUSES an id this expedition does not carry, and one whose fix task exists or is being
|
|
181
|
+
* created, with the same two reasons {@link address} uses for the same two cases. Answering 200
|
|
182
|
+
* to either was a filter that quietly matched nothing: the SPA then struck the row through on
|
|
183
|
+
* its optimistic echo and the next snapshot silently put it back, which reads as a dismissal
|
|
184
|
+
* the platform undid rather than as one it never accepted.
|
|
185
|
+
*/
|
|
186
|
+
dismissFinding(workspaceId: string, executionId: string, findingId: string): Promise<BugFishingStepState>;
|
|
187
|
+
/**
|
|
188
|
+
* Finish a parked expedition: mark it `done` and advance the run past the step.
|
|
189
|
+
*
|
|
190
|
+
* Mirrors the review gate's resolved-gate advance — the pure in-memory advance runs inside the
|
|
191
|
+
* CAS, its side effects (settle / emit) once after, on the winning snapshot. Findings left
|
|
192
|
+
* untriaged are left as they are: they stay on the run's record, and the expedition's own
|
|
193
|
+
* state is the honest account of what was decided and what was not.
|
|
194
|
+
*/
|
|
195
|
+
resolve(workspaceId: string, executionId: string): Promise<BugFishingStepState>;
|
|
196
|
+
/** The active expedition state for a run's GET, or null when no step carries one. */
|
|
197
|
+
getActive(workspaceId: string, executionId: string): Promise<BugFishingStepState | null>;
|
|
198
|
+
/**
|
|
199
|
+
* The run's "active" expedition step: prefer the step the run is currently on, else the latest
|
|
200
|
+
* `bug-fisher` step carrying expedition state. Mirrors `PrReviewController.activePrReviewStep`.
|
|
201
|
+
*/
|
|
202
|
+
private activeExpeditionStep;
|
|
203
|
+
/**
|
|
204
|
+
* The pipeline a marked finding's task runs: the caller's override, else the expedition's
|
|
205
|
+
* recorded default, else the workspace setting as it stands now, else the built-in bug-fix
|
|
206
|
+
* preset — and in every case validated against the workspace's own catalog.
|
|
207
|
+
*
|
|
208
|
+
* Validated rather than trusted because both the override and the workspace setting are bare
|
|
209
|
+
* ids a human typed or picked, and a workspace can delete the pipeline it named. Spawning onto
|
|
210
|
+
* a missing pipeline would create tasks that cannot start, so the refusal NAMES the pipeline
|
|
211
|
+
* instead: which one is missing is the whole content of the fix.
|
|
212
|
+
*/
|
|
213
|
+
private resolveSpawnPipelineId;
|
|
214
|
+
/**
|
|
215
|
+
* The workspace's configured fix pipeline, else the built-in bug-fix preset.
|
|
216
|
+
*
|
|
217
|
+
* A settings read that THROWS is deliberately NOT swallowed into the built-in default: an
|
|
218
|
+
* unreachable settings store and a workspace that configured nothing are opposite facts, and
|
|
219
|
+
* silently spawning onto the platform preset would put a team's bug work on a pipeline they
|
|
220
|
+
* moved off. An UNWIRED store is the third case and genuinely does mean "no configured
|
|
221
|
+
* default", so that one answers the built-in.
|
|
222
|
+
*/
|
|
223
|
+
private resolveDefaultFixPipelineId;
|
|
224
|
+
/**
|
|
225
|
+
* The frame a spawned fix task lives under, its service row, and the standards that frame's
|
|
226
|
+
* service holds every task under it to.
|
|
227
|
+
*
|
|
228
|
+
* The expedition's OWN parent frame, so the fix runs against the same repository the
|
|
229
|
+
* expedition fished. A task whose frame cannot be resolved has nothing to host the work and no
|
|
230
|
+
* repo to fix, so this refuses rather than dropping the task somewhere plausible.
|
|
231
|
+
*
|
|
232
|
+
* The frame is also where the service's standing standards live (`serviceFragmentIds`), which
|
|
233
|
+
* is why it is carried rather than reduced to an id: a spawned task has to be handed them
|
|
234
|
+
* EXPLICITLY, since a task-level run folds only its own `fragmentIds` and never re-unions the
|
|
235
|
+
* service's (kernel's `applicableFragmentIds`).
|
|
236
|
+
*/
|
|
237
|
+
private resolveSpawnHost;
|
|
238
|
+
/**
|
|
239
|
+
* The best-practice fragments a spawned fix task is created with.
|
|
240
|
+
*
|
|
241
|
+
* Resolved through the SAME seam the create form goes through (`BoardService.addTask`'s
|
|
242
|
+
* `fragmentIdsFor`), against the same inputs a person filing this bug by hand under this
|
|
243
|
+
* service would supply: the service's standing standards, the `bug` type's own defaults, and
|
|
244
|
+
* whichever standing-context entries hold for the fields the finding filled in. Anything less
|
|
245
|
+
* would make a spawned fix quietly weaker than the identical bug filed by hand, and the
|
|
246
|
+
* difference would only ever show up in the fix's output.
|
|
247
|
+
*
|
|
248
|
+
* Unwired (a facade that passes no defaults seam) means no fragments, which is the same answer
|
|
249
|
+
* that seam gives a deployment with no fragment pool at all.
|
|
250
|
+
*/
|
|
251
|
+
private resolveSpawnFragmentIds;
|
|
252
|
+
/**
|
|
253
|
+
* Create ONE bug-fix task for a finding and start its run, answering the run's id (or null when
|
|
254
|
+
* the start entry point reported none).
|
|
255
|
+
*
|
|
256
|
+
* The task is a `bug`-typed block carrying the finding as its description and its evidence as
|
|
257
|
+
* the reproduction field, so the bug-fix pipeline's investigator starts from what the
|
|
258
|
+
* expedition actually found rather than from a title. On a start failure the block is rolled
|
|
259
|
+
* back, exactly as the initiative loop does: a task on the board with no run and no record on
|
|
260
|
+
* either side is the one outcome nothing later reconciles.
|
|
261
|
+
*
|
|
262
|
+
* The block id is passed IN rather than minted here, because the claim that authorised this
|
|
263
|
+
* call already carries it — see {@link spawnForFinding}.
|
|
264
|
+
*
|
|
265
|
+
* A failure PROPAGATES rather than being swallowed into "this finding stays untriaged". The
|
|
266
|
+
* marking is the caller's own request, not a best-effort background pass, and the failures that
|
|
267
|
+
* reach here are exactly the ones they can act on: a pipeline that refuses a one-off task
|
|
268
|
+
* start, a per-service task limit, a board write that was denied. Answering 200 with an
|
|
269
|
+
* unchanged finding would report the request as done and leave somebody waiting for a fix task
|
|
270
|
+
* that is never going to appear. Findings spawned EARLIER in the batch are already persisted,
|
|
271
|
+
* so the error names what is left rather than undoing what worked.
|
|
272
|
+
*/
|
|
273
|
+
private spawnFixTask;
|
|
274
|
+
/** Raise the "finish triaging the catch" inbox card when the expedition parks. */
|
|
275
|
+
private raiseTriageReady;
|
|
276
|
+
}
|
|
277
|
+
//# sourceMappingURL=BugFishingController.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BugFishingController.d.ts","sourceRoot":"","sources":["../../../src/modules/execution/BugFishingController.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,8BAA8B,EAC9B,KAAK,EACL,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