@cat-factory/orchestration 0.25.1 → 0.27.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.d.ts +34 -0
- package/dist/container.d.ts.map +1 -1
- package/dist/container.js +64 -0
- package/dist/container.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/modules/brainstorm/BrainstormService.d.ts +57 -0
- package/dist/modules/brainstorm/BrainstormService.d.ts.map +1 -0
- package/dist/modules/brainstorm/BrainstormService.js +117 -0
- package/dist/modules/brainstorm/BrainstormService.js.map +1 -0
- package/dist/modules/brainstorm/brainstorm.logic.d.ts +38 -0
- package/dist/modules/brainstorm/brainstorm.logic.d.ts.map +1 -0
- package/dist/modules/brainstorm/brainstorm.logic.js +106 -0
- package/dist/modules/brainstorm/brainstorm.logic.js.map +1 -0
- package/dist/modules/execution/AgentContextBuilder.d.ts +18 -1
- package/dist/modules/execution/AgentContextBuilder.d.ts.map +1 -1
- package/dist/modules/execution/AgentContextBuilder.js +45 -7
- package/dist/modules/execution/AgentContextBuilder.js.map +1 -1
- package/dist/modules/execution/ExecutionService.d.ts +125 -3
- package/dist/modules/execution/ExecutionService.d.ts.map +1 -1
- package/dist/modules/execution/ExecutionService.js +388 -4
- package/dist/modules/execution/ExecutionService.js.map +1 -1
- package/dist/modules/execution/ci.logic.d.ts +12 -0
- package/dist/modules/execution/ci.logic.d.ts.map +1 -1
- package/dist/modules/execution/ci.logic.js +12 -0
- package/dist/modules/execution/ci.logic.js.map +1 -1
- package/dist/modules/execution/followUp.logic.d.ts +23 -0
- package/dist/modules/execution/followUp.logic.d.ts.map +1 -0
- package/dist/modules/execution/followUp.logic.js +69 -0
- package/dist/modules/execution/followUp.logic.js.map +1 -0
- package/dist/modules/execution/tester-infra.logic.d.ts +18 -5
- package/dist/modules/execution/tester-infra.logic.d.ts.map +1 -1
- package/dist/modules/execution/tester-infra.logic.js +17 -8
- package/dist/modules/execution/tester-infra.logic.js.map +1 -1
- package/dist/modules/notifications/NotificationService.d.ts +8 -7
- package/dist/modules/notifications/NotificationService.d.ts.map +1 -1
- package/dist/modules/notifications/NotificationService.js +20 -17
- package/dist/modules/notifications/NotificationService.js.map +1 -1
- package/dist/modules/requirements/RequirementReviewService.d.ts +8 -0
- package/dist/modules/requirements/RequirementReviewService.d.ts.map +1 -1
- package/dist/modules/requirements/RequirementReviewService.js +11 -1
- package/dist/modules/requirements/RequirementReviewService.js.map +1 -1
- package/dist/modules/settings/WorkspaceSettingsService.d.ts.map +1 -1
- package/dist/modules/settings/WorkspaceSettingsService.js +2 -0
- package/dist/modules/settings/WorkspaceSettingsService.js.map +1 -1
- package/package.json +9 -9
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { Block, BrainstormStage, RequirementReviewItem } from '@cat-factory/kernel';
|
|
2
|
+
export { coerceReviewItems, disposeReview, extractJson, hasNotesToIncorporate, type ReviewDisposition, } from '../requirements/requirements.logic.js';
|
|
3
|
+
/** Everything a brainstorm agent reasons over for one stage. */
|
|
4
|
+
export interface BrainstormContext {
|
|
5
|
+
block: Pick<Block, 'title' | 'type' | 'description'>;
|
|
6
|
+
/** Which dialogue this is — selects the seed subject + the option framing. */
|
|
7
|
+
stage: BrainstormStage;
|
|
8
|
+
/**
|
|
9
|
+
* The requirements refined in prior stages (a requirements review's incorporated doc, or a
|
|
10
|
+
* requirements-brainstorm's converged direction). Present only for the `architecture` stage;
|
|
11
|
+
* when present it is the primary seed and the raw description becomes background.
|
|
12
|
+
*/
|
|
13
|
+
refinedRequirements?: string;
|
|
14
|
+
/**
|
|
15
|
+
* The converged direction produced by a prior incorporation. When present (a re-run or a
|
|
16
|
+
* redo), it is the authoritative direction the agent reasons over. Absent on the first pass.
|
|
17
|
+
*/
|
|
18
|
+
convergedDoc?: string;
|
|
19
|
+
/** The human's freeform "do it differently" comment when redoing a merge. Absent otherwise. */
|
|
20
|
+
reworkFeedback?: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Render the subject under brainstorm as a single Markdown document — the converged
|
|
24
|
+
* direction when one exists (a later cycle), else the refined requirements (architecture)
|
|
25
|
+
* or the rough description (requirements). Used both as the agent's input and as the base
|
|
26
|
+
* the incorporate step rewrites.
|
|
27
|
+
*/
|
|
28
|
+
export declare function renderBrainstormSubject(ctx: BrainstormContext): string;
|
|
29
|
+
export declare function buildBrainstormPrompt(ctx: BrainstormContext): string;
|
|
30
|
+
/**
|
|
31
|
+
* Build the user prompt for the brainstorm-rework step: the gathered subject plus the
|
|
32
|
+
* options the human picked (folded in) and dismissed (kept out). Works with an empty item
|
|
33
|
+
* list (the "nothing to decide" path simply restates the direction in the standard
|
|
34
|
+
* structure). The stage's rework system prompt (in `@cat-factory/agents`) defines the
|
|
35
|
+
* output shape.
|
|
36
|
+
*/
|
|
37
|
+
export declare function buildBrainstormReworkPrompt(ctx: BrainstormContext, items: RequirementReviewItem[]): string;
|
|
38
|
+
//# sourceMappingURL=brainstorm.logic.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"brainstorm.logic.d.ts","sourceRoot":"","sources":["../../../src/modules/brainstorm/brainstorm.logic.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAA;AAWxF,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,WAAW,EACX,qBAAqB,EACrB,KAAK,iBAAiB,GACvB,MAAM,uCAAuC,CAAA;AAE9C,gEAAgE;AAChE,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,aAAa,CAAC,CAAA;IACpD,8EAA8E;IAC9E,KAAK,EAAE,eAAe,CAAA;IACtB;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,+FAA+F;IAC/F,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB;AAKD;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,iBAAiB,GAAG,MAAM,CAqBtE;AAED,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,iBAAiB,GAAG,MAAM,CA8BpE;AAED;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CACzC,GAAG,EAAE,iBAAiB,EACtB,KAAK,EAAE,qBAAqB,EAAE,GAC7B,MAAM,CA0CR"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
// Pure logic for the brainstorm (structured-dialogue) agent: assembling the subject the
|
|
2
|
+
// agent reasons over (the rough description for `requirements`, the refined requirements
|
|
3
|
+
// for `architecture`), and building the option-generation + rework prompts. The item
|
|
4
|
+
// parsing / disposition helpers are subject-agnostic and REUSED from the requirements
|
|
5
|
+
// logic — this file only supplies the brainstorm-specific subject + prompts.
|
|
6
|
+
//
|
|
7
|
+
// Re-export the shared helpers so the brainstorm service imports its whole logic surface
|
|
8
|
+
// from here (one import site), mirroring how `requirements.logic` / `clarity.logic` are
|
|
9
|
+
// their services' surfaces.
|
|
10
|
+
export { coerceReviewItems, disposeReview, extractJson, hasNotesToIncorporate, } from '../requirements/requirements.logic.js';
|
|
11
|
+
const stageNoun = (stage) => stage === 'architecture' ? 'technical approach' : 'requirements direction';
|
|
12
|
+
/**
|
|
13
|
+
* Render the subject under brainstorm as a single Markdown document — the converged
|
|
14
|
+
* direction when one exists (a later cycle), else the refined requirements (architecture)
|
|
15
|
+
* or the rough description (requirements). Used both as the agent's input and as the base
|
|
16
|
+
* the incorporate step rewrites.
|
|
17
|
+
*/
|
|
18
|
+
export function renderBrainstormSubject(ctx) {
|
|
19
|
+
if (ctx.convergedDoc?.trim()) {
|
|
20
|
+
return [
|
|
21
|
+
`# ${ctx.block.title} (${ctx.block.type})`,
|
|
22
|
+
'',
|
|
23
|
+
`## Current ${stageNoun(ctx.stage)} (under discussion)`,
|
|
24
|
+
ctx.convergedDoc.trim(),
|
|
25
|
+
].join('\n');
|
|
26
|
+
}
|
|
27
|
+
const lines = [`# ${ctx.block.title} (${ctx.block.type})`, ''];
|
|
28
|
+
if (ctx.stage === 'architecture' && ctx.refinedRequirements?.trim()) {
|
|
29
|
+
lines.push('## Refined requirements (the basis for the approach)', ctx.refinedRequirements.trim());
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
// For the architecture stage with no refined requirements threaded in, the raw description
|
|
33
|
+
// is the seed — the same fallback as the requirements stage.
|
|
34
|
+
lines.push('## Rough idea', ctx.block.description?.trim() || '(no description provided)');
|
|
35
|
+
}
|
|
36
|
+
return lines.join('\n');
|
|
37
|
+
}
|
|
38
|
+
export function buildBrainstormPrompt(ctx) {
|
|
39
|
+
const optionSubject = ctx.stage === 'architecture'
|
|
40
|
+
? 'open architectural / technical decisions'
|
|
41
|
+
: 'open product / requirements decisions';
|
|
42
|
+
return [
|
|
43
|
+
`Here is the ${ctx.stage === 'architecture' ? 'work to find an approach for' : 'rough idea to shape into requirements'}:`,
|
|
44
|
+
'',
|
|
45
|
+
renderBrainstormSubject(ctx),
|
|
46
|
+
'',
|
|
47
|
+
`Surface the ${optionSubject} and, for EACH, PROPOSE the realistic options with their ` +
|
|
48
|
+
'trade-offs laid out plainly. Produce a JSON object of this exact shape:',
|
|
49
|
+
'{',
|
|
50
|
+
' "items": [',
|
|
51
|
+
' {',
|
|
52
|
+
' "category": "gap|clarification|assumption|risk|question",',
|
|
53
|
+
' "severity": "low|medium|high",',
|
|
54
|
+
' "title": "the decision to make, as a short headline",',
|
|
55
|
+
' "detail": "the realistic options and their trade-offs (benefit vs cost/risk), ending with a specific question the human can answer to choose"',
|
|
56
|
+
' }',
|
|
57
|
+
' ]',
|
|
58
|
+
'}',
|
|
59
|
+
'',
|
|
60
|
+
'Assign a severity to EVERY item — no item may omit it. Use `high` for a decision that ' +
|
|
61
|
+
'shapes everything downstream, `medium` for an important-but-contained choice, and ' +
|
|
62
|
+
'`low` for a minor preference. Raise between 1 and 12 items, ordered by severity (high ' +
|
|
63
|
+
'first). Do NOT pick for the human — your job is to lay out the options and trade-offs ' +
|
|
64
|
+
'clearly. If the direction is already crisp and there is nothing left to decide, return ' +
|
|
65
|
+
'an empty items array. Output JSON only.',
|
|
66
|
+
].join('\n');
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Build the user prompt for the brainstorm-rework step: the gathered subject plus the
|
|
70
|
+
* options the human picked (folded in) and dismissed (kept out). Works with an empty item
|
|
71
|
+
* list (the "nothing to decide" path simply restates the direction in the standard
|
|
72
|
+
* structure). The stage's rework system prompt (in `@cat-factory/agents`) defines the
|
|
73
|
+
* output shape.
|
|
74
|
+
*/
|
|
75
|
+
export function buildBrainstormReworkPrompt(ctx, items) {
|
|
76
|
+
const lines = ['Current basis:', '', renderBrainstormSubject(ctx), ''];
|
|
77
|
+
const answered = items.filter((i) => (i.status === 'answered' || i.status === 'resolved') && i.reply?.trim());
|
|
78
|
+
const dismissed = items.filter((i) => i.status === 'dismissed');
|
|
79
|
+
if (answered.length) {
|
|
80
|
+
lines.push('Decisions the human made (commit to these):', '');
|
|
81
|
+
for (const i of answered) {
|
|
82
|
+
lines.push(`- Decision (${i.category}): ${i.title} — ${i.detail}`);
|
|
83
|
+
lines.push(` Chosen: ${i.reply?.trim() || '(no choice recorded)'}`);
|
|
84
|
+
}
|
|
85
|
+
lines.push('');
|
|
86
|
+
}
|
|
87
|
+
if (dismissed.length) {
|
|
88
|
+
lines.push('Options the human ruled out (do NOT include these):', '');
|
|
89
|
+
for (const i of dismissed)
|
|
90
|
+
lines.push(`- ${i.title}`);
|
|
91
|
+
lines.push('');
|
|
92
|
+
}
|
|
93
|
+
if (!answered.length && !dismissed.length) {
|
|
94
|
+
lines.push('The human made no specific choices — restate the direction cleanly in the standard ' +
|
|
95
|
+
'structure without inventing new commitments.', '');
|
|
96
|
+
}
|
|
97
|
+
if (ctx.reworkFeedback?.trim()) {
|
|
98
|
+
lines.push('', 'The human was UNHAPPY with your previous direction and asked you to redo it with this ' +
|
|
99
|
+
'specific steering — follow it closely:', '', ctx.reworkFeedback.trim(), '');
|
|
100
|
+
}
|
|
101
|
+
lines.push(`Write the ${stageNoun(ctx.stage)} as a single self-contained Markdown document in the ` +
|
|
102
|
+
'standard structure described in your instructions, committing to every decision above. ' +
|
|
103
|
+
'Output the document only.');
|
|
104
|
+
return lines.join('\n');
|
|
105
|
+
}
|
|
106
|
+
//# sourceMappingURL=brainstorm.logic.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"brainstorm.logic.js","sourceRoot":"","sources":["../../../src/modules/brainstorm/brainstorm.logic.ts"],"names":[],"mappings":"AAEA,wFAAwF;AACxF,yFAAyF;AACzF,qFAAqF;AACrF,sFAAsF;AACtF,6EAA6E;AAC7E,EAAE;AACF,yFAAyF;AACzF,wFAAwF;AACxF,4BAA4B;AAC5B,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,WAAW,EACX,qBAAqB,GAEtB,MAAM,uCAAuC,CAAA;AAsB9C,MAAM,SAAS,GAAG,CAAC,KAAsB,EAAU,EAAE,CACnD,KAAK,KAAK,cAAc,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,wBAAwB,CAAA;AAE5E;;;;;GAKG;AACH,MAAM,UAAU,uBAAuB,CAAC,GAAsB;IAC5D,IAAI,GAAG,CAAC,YAAY,EAAE,IAAI,EAAE,EAAE,CAAC;QAC7B,OAAO;YACL,KAAK,GAAG,CAAC,KAAK,CAAC,KAAK,KAAK,GAAG,CAAC,KAAK,CAAC,IAAI,GAAG;YAC1C,EAAE;YACF,cAAc,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,qBAAqB;YACvD,GAAG,CAAC,YAAY,CAAC,IAAI,EAAE;SACxB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACd,CAAC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I,CAAC,QAAQ,CAAC,MAAM,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC;QAC1C,KAAK,CAAC,IAAI,CACR,qFAAqF;YACnF,8CAA8C,EAChD,EAAE,CACH,CAAA;IACH,CAAC;IACD,IAAI,GAAG,CAAC,cAAc,EAAE,IAAI,EAAE,EAAE,CAAC;QAC/B,KAAK,CAAC,IAAI,CACR,EAAE,EACF,wFAAwF;YACtF,wCAAwC,EAC1C,EAAE,EACF,GAAG,CAAC,cAAc,CAAC,IAAI,EAAE,EACzB,EAAE,CACH,CAAA;IACH,CAAC;IACD,KAAK,CAAC,IAAI,CACR,aAAa,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,uDAAuD;QACtF,yFAAyF;QACzF,2BAA2B,CAC9B,CAAA;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACzB,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type { AccountRepository, AgentRunContext, Block, BlockRepository, ClarityReviewRepository, DocumentRepository, ExecutionInstance, PipelineStep, RequirementReviewRepository, TaskRepository, WorkspaceRepository } from '@cat-factory/kernel';
|
|
1
|
+
import type { AccountRepository, AgentRunContext, Block, BlockRepository, BrainstormSessionRepository, ClarityReviewRepository, DocumentRepository, ExecutionInstance, PipelineStep, RequirementReviewRepository, TaskRepository, WorkspaceRepository } from '@cat-factory/kernel';
|
|
2
2
|
import type { EnvironmentProvisioningService } from '@cat-factory/integrations';
|
|
3
|
+
import { type TesterEnvironment } from './tester-infra.logic.js';
|
|
3
4
|
/**
|
|
4
5
|
* The `revision` slice of an agent context when a step is being re-run with feedback
|
|
5
6
|
* — either a human's "request changes" on its approval gate, or a downstream
|
|
@@ -37,6 +38,7 @@ export interface AgentContextBuilderDeps {
|
|
|
37
38
|
tasks?: TaskRepository;
|
|
38
39
|
requirementReviews?: RequirementReviewRepository;
|
|
39
40
|
clarityReviews?: ClarityReviewRepository;
|
|
41
|
+
brainstormSessions?: BrainstormSessionRepository;
|
|
40
42
|
environmentProvisioning?: EnvironmentProvisioningService;
|
|
41
43
|
/**
|
|
42
44
|
* Optional: resolves fragment ids against the merged tenant catalog (managed +
|
|
@@ -44,6 +46,13 @@ export interface AgentContextBuilderDeps {
|
|
|
44
46
|
* pool, so curated and living-document fragments actually reach a run.
|
|
45
47
|
*/
|
|
46
48
|
fragmentResolver?: FragmentBodyResolver;
|
|
49
|
+
/**
|
|
50
|
+
* Optional: the deployment's default Tester environment when neither the task nor its
|
|
51
|
+
* service frame pins one (the floor of {@link resolveTesterEnvironment}). Absent →
|
|
52
|
+
* `ephemeral`. MUST match the resolver `ExecutionService` uses for its start-time infra
|
|
53
|
+
* gate, so the materialised value the job runs with agrees with what the gate checked.
|
|
54
|
+
*/
|
|
55
|
+
resolveTesterFallbackDefault?: (workspaceId: string) => Promise<TesterEnvironment>;
|
|
47
56
|
}
|
|
48
57
|
/**
|
|
49
58
|
* Assembles the {@link AgentRunContext} for a pipeline step from the run + block state:
|
|
@@ -89,6 +98,14 @@ export declare class AgentContextBuilder {
|
|
|
89
98
|
* clarity review yet. The clarity mirror of {@link resolveReworkedRequirements}.
|
|
90
99
|
*/
|
|
91
100
|
private resolveClarifiedBrief;
|
|
101
|
+
/**
|
|
102
|
+
* The converged architecture direction for a block — the document the
|
|
103
|
+
* `architecture-brainstorm` dialogue settled on — or `null` when the feature is unwired or
|
|
104
|
+
* the block has no settled architecture session. Surfaced additively as a prior output (it
|
|
105
|
+
* augments, never replaces, the description), the brainstorm analogue of
|
|
106
|
+
* {@link resolveReworkedRequirements}.
|
|
107
|
+
*/
|
|
108
|
+
private resolveBrainstormDirection;
|
|
92
109
|
/**
|
|
93
110
|
* Resolve the best-practice fragments to fold into a step's system prompt. Service
|
|
94
111
|
* fragments reach an agent ONLY when its kind carries the `code-aware` trait: those
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgentContextBuilder.d.ts","sourceRoot":"","sources":["../../../src/modules/execution/AgentContextBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,eAAe,EACf,KAAK,EACL,eAAe,EACf,uBAAuB,EAGvB,kBAAkB,EAClB,iBAAiB,EACjB,YAAY,EACZ,2BAA2B,EAE3B,cAAc,EACd,mBAAmB,EACpB,MAAM,qBAAqB,CAAA;AAK5B,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,2BAA2B,CAAA;
|
|
1
|
+
{"version":3,"file":"AgentContextBuilder.d.ts","sourceRoot":"","sources":["../../../src/modules/execution/AgentContextBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,eAAe,EACf,KAAK,EACL,eAAe,EACf,2BAA2B,EAC3B,uBAAuB,EAGvB,kBAAkB,EAClB,iBAAiB,EACjB,YAAY,EACZ,2BAA2B,EAE3B,cAAc,EACd,mBAAmB,EACpB,MAAM,qBAAqB,CAAA;AAK5B,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,2BAA2B,CAAA;AAC/E,OAAO,EAA4B,KAAK,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAE1F;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,YAAY,GAAG;IACxD,QAAQ,CAAC,EAAE;QACT,gBAAgB,EAAE,MAAM,CAAA;QACxB,QAAQ,EAAE,MAAM,CAAA;QAChB,QAAQ,CAAC,EAAE;YAAE,YAAY,CAAC,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE,EAAE,CAAA;KACrD,CAAA;CACF,CA6BA;AAED;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB;IACnC,mBAAmB,CAAC,WAAW,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC,CAAA;CACjG;AAED,4FAA4F;AAC5F,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C;;;;;;;;;OASG;YACW,gBAAgB;IAmC9B;;;;;OAKG;YACW,yBAAyB;IASvC;;;;;;;;;;;OAWG;YACW,oBAAoB;IAgDlC;;;;;OAKG;YACW,kBAAkB;CAIjC"}
|
|
@@ -2,6 +2,7 @@ import { buildExcerpt, CONTEXT_BUDGET } from '@cat-factory/kernel';
|
|
|
2
2
|
import { CODE_AWARE_TRAIT, hasTrait } from '@cat-factory/agents';
|
|
3
3
|
import { getFragment } from '@cat-factory/prompt-fragments';
|
|
4
4
|
import { extractReferences } from '@cat-factory/integrations';
|
|
5
|
+
import { resolveTesterEnvironment } from './tester-infra.logic.js';
|
|
5
6
|
/**
|
|
6
7
|
* The `revision` slice of an agent context when a step is being re-run with feedback
|
|
7
8
|
* — either a human's "request changes" on its approval gate, or a downstream
|
|
@@ -82,13 +83,31 @@ export class AgentContextBuilder {
|
|
|
82
83
|
// agentConfig so the Tester job body, the prompt fragment and the start-time infra
|
|
83
84
|
// gate all read the same value — the stored block is left untouched (the per-task
|
|
84
85
|
// override stays explicit).
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
86
|
+
// Resolve the effective environment (task pin > service default > deployment fallback)
|
|
87
|
+
// and materialise it when the task hasn't pinned its own, so the Tester job body, the
|
|
88
|
+
// prompt fragment and the start-time infra gate all read the SAME value. The fallback
|
|
89
|
+
// (local mode: `local` by default, `ephemeral` when delegating to a provider) is the
|
|
90
|
+
// same resolver the gate uses, so the run can't disagree with what was checked at start.
|
|
91
|
+
const agentConfig = block.agentConfig?.['tester.environment']
|
|
92
|
+
? block.agentConfig
|
|
93
|
+
: {
|
|
94
|
+
...block.agentConfig,
|
|
95
|
+
'tester.environment': resolveTesterEnvironment(undefined, service?.defaultTestEnvironment, await this.deps.resolveTesterFallbackDefault?.(workspaceId)),
|
|
96
|
+
};
|
|
97
|
+
// A finalized architecture-brainstorm direction is surfaced ADDITIVELY (it does not
|
|
98
|
+
// replace the description) as a synthetic prior output so the architect and downstream
|
|
99
|
+
// agents read it as context — the brainstorm session's converged direction feeding the
|
|
100
|
+
// next stage's prompt (reviews are task-scoped, so frames/modules skip the lookup).
|
|
101
|
+
const architectureDirection = block.level === 'task' ? await this.resolveBrainstormDirection(workspaceId, block.id) : null;
|
|
102
|
+
const priorOutputs = [
|
|
103
|
+
...(architectureDirection
|
|
104
|
+
? [{ agentKind: 'architecture-brainstorm', output: architectureDirection }]
|
|
105
|
+
: []),
|
|
106
|
+
...instance.steps
|
|
107
|
+
.slice(0, instance.currentStep)
|
|
108
|
+
.filter((s) => s.output)
|
|
109
|
+
.map((s) => ({ agentKind: s.agentKind, output: s.output })),
|
|
110
|
+
];
|
|
92
111
|
// Resolve the best-practice fragments to inject for this step. `code-aware` kinds
|
|
93
112
|
// get the running service's selected fragments unioned with the block's own pins;
|
|
94
113
|
// other kinds keep only their block pins. Recorded on the step for observability.
|
|
@@ -103,6 +122,9 @@ export class AgentContextBuilder {
|
|
|
103
122
|
...(instance.initiatedBy != null ? { initiatedByUserId: instance.initiatedBy } : {}),
|
|
104
123
|
stepIndex: instance.currentStep,
|
|
105
124
|
isFinalStep,
|
|
125
|
+
// The future-looking Follow-up companion is enabled for this (coder) step: the
|
|
126
|
+
// container executor appends the follow-up guidance + sets the harness to stream items.
|
|
127
|
+
...(step.followUps?.enabled ? { followUpCompanion: true } : {}),
|
|
106
128
|
// Consensus config for this step (copied onto the step at run start). Read only
|
|
107
129
|
// by the optional consensus executor, which decides — possibly gated on the
|
|
108
130
|
// block estimate below — whether to run the multi-model process. Absent ⇒ standard.
|
|
@@ -233,6 +255,22 @@ export class AgentContextBuilder {
|
|
|
233
255
|
}
|
|
234
256
|
return null;
|
|
235
257
|
}
|
|
258
|
+
/**
|
|
259
|
+
* The converged architecture direction for a block — the document the
|
|
260
|
+
* `architecture-brainstorm` dialogue settled on — or `null` when the feature is unwired or
|
|
261
|
+
* the block has no settled architecture session. Surfaced additively as a prior output (it
|
|
262
|
+
* augments, never replaces, the description), the brainstorm analogue of
|
|
263
|
+
* {@link resolveReworkedRequirements}.
|
|
264
|
+
*/
|
|
265
|
+
async resolveBrainstormDirection(workspaceId, blockId) {
|
|
266
|
+
if (!this.deps.brainstormSessions)
|
|
267
|
+
return null;
|
|
268
|
+
const session = await this.deps.brainstormSessions.getByBlockStage(workspaceId, blockId, 'architecture');
|
|
269
|
+
if (session?.status === 'incorporated' && session.convergedDirection) {
|
|
270
|
+
return session.convergedDirection;
|
|
271
|
+
}
|
|
272
|
+
return null;
|
|
273
|
+
}
|
|
236
274
|
/**
|
|
237
275
|
* Resolve the best-practice fragments to fold into a step's system prompt. Service
|
|
238
276
|
* fragments reach an agent ONLY when its kind carries the `code-aware` trait: those
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgentContextBuilder.js","sourceRoot":"","sources":["../../../src/modules/execution/AgentContextBuilder.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAClE,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAA;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAG7D;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAAkB;IAOrD,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM;QACxB,CAAC,CAAC;YACE,gBAAgB,EAAE,IAAI,CAAC,MAAM,CAAC,gBAAgB;YAC9C,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ;YAC9B,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ;SAC/B;QACH,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,KAAK,mBAAmB;YAC7C,CAAC,CAAC;gBACE,gBAAgB,EAAE,IAAI,CAAC,QAAQ,CAAC,Q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,SAAS,aAAa,CACpB,CAAa;IAEb,OAAO;QACL,GAAG,EAAE,CAAC,CAAC,UAAU;QACjB,GAAG,EAAE,CAAC,CAAC,GAAG;QACV,KAAK,EAAE,CAAC,CAAC,KAAK;QACd,MAAM,EAAE,CAAC,CAAC,MAAM;QAChB,IAAI,EAAE,CAAC,CAAC,IAAI;QACZ,QAAQ,EAAE,CAAC,CAAC,QAAQ;QACpB,QAAQ,EAAE,CAAC,CAAC,QAAQ;QACpB,MAAM,EAAE,CAAC,CAAC,MAAM;QAChB,WAAW,EAAE,CAAC,CAAC,WAAW;QAC1B,QAAQ,EAAE,CAAC,CAAC,QAAQ;QACpB,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,WAAW,IAAI,CAAC,CAAC,KAAK,EAAE,cAAc,CAAC,YAAY,CAAC;KAC7E,CAAA;AACH,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AgentFailureKind, Block, BlueprintService, ExecutionInstance, MergePresetRepository, PullRequestMerger, StepReviewComment, SubscriptionActivationRepository, TicketTrackerProvider, IssueWritebackProvider } from '@cat-factory/kernel';
|
|
1
|
+
import type { AgentFailureKind, Block, BlueprintService, ExecutionInstance, FollowUpsStepState, MergePresetRepository, PullRequestMerger, StepReviewComment, SubscriptionActivationRepository, TicketTrackerProvider, IssueWritebackProvider } from '@cat-factory/kernel';
|
|
2
2
|
import type { RunInitiatorScope } from '@cat-factory/kernel';
|
|
3
3
|
import { type HasPersonalSubscription } from './individualVendors.logic.js';
|
|
4
4
|
import { type ProviderCapabilities, type SubscriptionVendor } from '@cat-factory/kernel';
|
|
@@ -7,7 +7,8 @@ import type { NotificationService } from '../notifications/NotificationService.j
|
|
|
7
7
|
import type { WorkspaceSettingsService } from '../settings/WorkspaceSettingsService.js';
|
|
8
8
|
import type { RequirementReviewService } from '../requirements/RequirementReviewService.js';
|
|
9
9
|
import type { ClarityReviewService } from '../clarity/ClarityReviewService.js';
|
|
10
|
-
import type {
|
|
10
|
+
import type { BrainstormService } from '../brainstorm/BrainstormService.js';
|
|
11
|
+
import type { IterationCapChoice, RequirementReview, ClarityReview, BrainstormSession, BrainstormStage, ResolveRequirementsExceededChoice } from '@cat-factory/kernel';
|
|
11
12
|
import type { LlmObservabilityService } from '../observability/LlmObservabilityService.js';
|
|
12
13
|
import type { AccountRepository, BlockRepository, ExecutionRepository, PipelineRepository, WorkspaceRepository } from '@cat-factory/kernel';
|
|
13
14
|
import type { Clock, IdGenerator } from '@cat-factory/kernel';
|
|
@@ -18,11 +19,13 @@ import type { DocumentRepository } from '@cat-factory/kernel';
|
|
|
18
19
|
import type { TaskRepository } from '@cat-factory/kernel';
|
|
19
20
|
import type { RequirementReviewRepository } from '@cat-factory/kernel';
|
|
20
21
|
import type { ClarityReviewRepository } from '@cat-factory/kernel';
|
|
22
|
+
import type { BrainstormSessionRepository } from '@cat-factory/kernel';
|
|
21
23
|
import type { EnvironmentProvisioningService, EnvironmentTeardownService } from '@cat-factory/integrations';
|
|
22
24
|
import type { BranchUpdater } from '@cat-factory/kernel';
|
|
23
25
|
import type { BoardService } from '../board/BoardService.js';
|
|
24
26
|
import type { SpendService } from '@cat-factory/spend';
|
|
25
27
|
import type { AdvanceOptions, AdvanceResult } from './advance.js';
|
|
28
|
+
import { type TesterEnvironment } from './tester-infra.logic.js';
|
|
26
29
|
/**
|
|
27
30
|
* Structural view of the Kaizen agent's scheduler the engine calls at run completion.
|
|
28
31
|
* Kept minimal so the execution engine doesn't depend on the concrete `KaizenService`.
|
|
@@ -90,6 +93,19 @@ export interface ExecutionServiceDependencies {
|
|
|
90
93
|
* answer → incorporate → re-review loop). Absent → the gate step passes through.
|
|
91
94
|
*/
|
|
92
95
|
clarityReviewService?: ClarityReviewService;
|
|
96
|
+
/**
|
|
97
|
+
* Optional: the brainstorm (structured-dialogue) feature's services, one per stage, present
|
|
98
|
+
* when the brainstorm module is wired. Drive the special `requirements-brainstorm` /
|
|
99
|
+
* `architecture-brainstorm` gate steps (inline option-generator + the iterative propose →
|
|
100
|
+
* pick → incorporate → re-run loop). Absent → the gate steps pass through.
|
|
101
|
+
*/
|
|
102
|
+
brainstormServices?: Record<BrainstormStage, BrainstormService>;
|
|
103
|
+
/**
|
|
104
|
+
* Optional: persistence for the brainstorm feature. Read by the agent-context builder to
|
|
105
|
+
* surface a converged `architecture-brainstorm` direction to the architect (the mirror of
|
|
106
|
+
* `requirementReviewRepository`). Absent → no substitution.
|
|
107
|
+
*/
|
|
108
|
+
brainstormSessionRepository?: BrainstormSessionRepository;
|
|
93
109
|
/**
|
|
94
110
|
* Optional: resolves fragment ids against the merged tenant catalog (managed +
|
|
95
111
|
* document-backed fragments), live-resolving linked Confluence/Notion/GitHub
|
|
@@ -214,6 +230,29 @@ export interface ExecutionServiceDependencies {
|
|
|
214
230
|
* Absent (tests / GitHub not connected) → pre/post-ops are skipped.
|
|
215
231
|
*/
|
|
216
232
|
resolveRunRepoContext?: ResolveRunRepoContext;
|
|
233
|
+
/**
|
|
234
|
+
* Optional: the deployment's default Tester environment when neither the task nor its
|
|
235
|
+
* service frame pins one — the floor of {@link resolveTesterEnvironment}. Absent →
|
|
236
|
+
* `ephemeral` (Cloudflare/Node, where there is no host runtime to test on). The local
|
|
237
|
+
* facade wires it to `local` (host Docker / DinD) by default, flipping to `ephemeral`
|
|
238
|
+
* when the workspace opts into its environment provider (`delegateTestEnvToProvider`).
|
|
239
|
+
* Used identically by the start gate and the agent-context materialisation so they agree.
|
|
240
|
+
*/
|
|
241
|
+
resolveTesterFallbackDefault?: (workspaceId: string) => Promise<TesterEnvironment>;
|
|
242
|
+
/**
|
|
243
|
+
* Optional: whether the workspace REQUIRES its environment provider for the Tester (the
|
|
244
|
+
* local-mode "delegate test environments" opt-in). When it resolves true, an `ephemeral`
|
|
245
|
+
* Tester run with no provider connected is refused at start instead of failing later at
|
|
246
|
+
* provision time. Absent → false (Cloudflare/Node).
|
|
247
|
+
*/
|
|
248
|
+
resolveRequireEnvironmentProvider?: (workspaceId: string) => Promise<boolean>;
|
|
249
|
+
/**
|
|
250
|
+
* Optional: assert the workspace has a usable container-agent backend before a run
|
|
251
|
+
* starts (local mode delegating agents to a runner pool that isn't registered throws a
|
|
252
|
+
* clean {@link ConflictError} here). Absent → no start-time check (Cloudflare/Node have
|
|
253
|
+
* a fixed backend; a missing local pool still fails loudly at dispatch).
|
|
254
|
+
*/
|
|
255
|
+
assertAgentBackendConfigured?: (workspaceId: string) => Promise<void>;
|
|
217
256
|
}
|
|
218
257
|
/** Reconciles a Blueprinter step's tree onto the board in place (BoardScanService). */
|
|
219
258
|
export interface BlueprintReconciler {
|
|
@@ -245,6 +284,7 @@ export declare class ExecutionService {
|
|
|
245
284
|
private readonly requirementReviewService?;
|
|
246
285
|
private readonly kaizenScheduler?;
|
|
247
286
|
private readonly clarityReviewService?;
|
|
287
|
+
private readonly brainstormServices?;
|
|
248
288
|
private readonly environmentProvisioning?;
|
|
249
289
|
private readonly environmentTeardown?;
|
|
250
290
|
private readonly branchUpdater?;
|
|
@@ -264,6 +304,9 @@ export declare class ExecutionService {
|
|
|
264
304
|
private readonly requirementsKind;
|
|
265
305
|
/** The clarity (bug-report triage) subject for {@link reviewGate}. */
|
|
266
306
|
private readonly clarityKind;
|
|
307
|
+
/** The two brainstorm (structured-dialogue) subjects for {@link reviewGate}, by stage. */
|
|
308
|
+
private readonly requirementsBrainstormKind;
|
|
309
|
+
private readonly architectureBrainstormKind;
|
|
267
310
|
private readonly blueprintReconciler?;
|
|
268
311
|
private readonly notificationService?;
|
|
269
312
|
private readonly workspaceSettingsService?;
|
|
@@ -283,6 +326,12 @@ export declare class ExecutionService {
|
|
|
283
326
|
* without a checkout. Absent (tests / GitHub not connected) → pre/post-ops are skipped.
|
|
284
327
|
*/
|
|
285
328
|
private readonly resolveRunRepoContext?;
|
|
329
|
+
/** Local-mode floor for the Tester environment (default `ephemeral`). See deps doc. */
|
|
330
|
+
private readonly resolveTesterFallbackDefault?;
|
|
331
|
+
/** Whether the workspace requires its env provider for the Tester (local-mode opt-in). */
|
|
332
|
+
private readonly resolveRequireEnvironmentProvider?;
|
|
333
|
+
/** Start-time assertion that a container-agent backend is configured (local-mode pool). */
|
|
334
|
+
private readonly assertAgentBackendConfigured?;
|
|
286
335
|
/** Lazily-built polling-gate registry, keyed by `agentKind`. See {@link gateFor}. */
|
|
287
336
|
private gateRegistryCache?;
|
|
288
337
|
/**
|
|
@@ -290,7 +339,7 @@ export declare class ExecutionService {
|
|
|
290
339
|
* {@link stepResolverFor} and {@link StepCompletionResolver}.
|
|
291
340
|
*/
|
|
292
341
|
private stepResolverCache?;
|
|
293
|
-
constructor({ workspaceRepository, blockRepository, pipelineRepository, executionRepository, accountRepository, idGenerator, clock, agentExecutor, workRunner, executionEventPublisher, boardService, spendService, documentRepository, taskRepository, requirementReviewRepository, requirementReviewService, kaizenScheduler, clarityReviewRepository, clarityReviewService, fragmentResolver, environmentProvisioning, environmentTeardown, branchUpdater, blueprintReconciler, notificationService, workspaceSettingsService, llmObservability, pullRequestMerger, mergePresetRepository, ticketTrackerProvider, issueWriteback, subscriptionActivationRepository, resolveWorkspaceModelDefault, resolveProviderCapabilities, localTestInfraSupported, resolveRunRepoContext, runInitiatorScope, }: ExecutionServiceDependencies);
|
|
342
|
+
constructor({ workspaceRepository, blockRepository, pipelineRepository, executionRepository, accountRepository, idGenerator, clock, agentExecutor, workRunner, executionEventPublisher, boardService, spendService, documentRepository, taskRepository, requirementReviewRepository, requirementReviewService, kaizenScheduler, clarityReviewRepository, clarityReviewService, brainstormServices, brainstormSessionRepository, fragmentResolver, environmentProvisioning, environmentTeardown, branchUpdater, blueprintReconciler, notificationService, workspaceSettingsService, llmObservability, pullRequestMerger, mergePresetRepository, ticketTrackerProvider, issueWriteback, subscriptionActivationRepository, resolveWorkspaceModelDefault, resolveProviderCapabilities, localTestInfraSupported, resolveRunRepoContext, resolveTesterFallbackDefault, resolveRequireEnvironmentProvider, assertAgentBackendConfigured, runInitiatorScope, }: ExecutionServiceDependencies);
|
|
294
343
|
private requireWorkspace;
|
|
295
344
|
private requireBlock;
|
|
296
345
|
/**
|
|
@@ -729,6 +778,60 @@ export declare class ExecutionService {
|
|
|
729
778
|
* run leaves behind are untouched. Best-effort: no notification service (tests) is a no-op.
|
|
730
779
|
*/
|
|
731
780
|
private clearWaitingNotification;
|
|
781
|
+
/**
|
|
782
|
+
* Append the items the harness streamed since the last poll onto the Coder step's
|
|
783
|
+
* follow-up state as fresh `pending` items. A no-op when the companion is off or nothing
|
|
784
|
+
* was streamed. Returns whether anything was added (so the poller persists + emits).
|
|
785
|
+
*/
|
|
786
|
+
private appendStreamedFollowUps;
|
|
787
|
+
/**
|
|
788
|
+
* The Follow-up companion gate, evaluated when the Coder step completes: park the run on
|
|
789
|
+
* a durable decision while any item is undecided; else loop the Coder for the queued /
|
|
790
|
+
* answered items (within the budget); else fall through (return undefined) so the normal
|
|
791
|
+
* advance/finish logic runs. Returns an {@link AdvanceResult} only when it parks or loops.
|
|
792
|
+
*/
|
|
793
|
+
private evaluateFollowUpGate;
|
|
794
|
+
/**
|
|
795
|
+
* Reset the Coder step and fold the human's queued follow-ups / answered questions into
|
|
796
|
+
* its rework so the next pass extends the prior work. Marks those items `sentToCoder` so
|
|
797
|
+
* a later completion doesn't re-loop them, and counts the loop against the budget. Shared
|
|
798
|
+
* by the at-completion path ({@link evaluateFollowUpGate}) and the parked-resume path.
|
|
799
|
+
*/
|
|
800
|
+
private loopCoderForFollowUps;
|
|
801
|
+
/** Raise the "follow-ups need decisions" inbox card when the Coder parks on undecided items. */
|
|
802
|
+
private raiseFollowUpPending;
|
|
803
|
+
/**
|
|
804
|
+
* The run's "active" follow-up companion step for a read with no item context (the GET /
|
|
805
|
+
* the inbox-card open). A pipeline may carry MORE THAN ONE follow-up-enabled Coder step,
|
|
806
|
+
* so this must not blindly pick the first: prefer the step the run is currently on (a Coder
|
|
807
|
+
* parked on its follow-up gate), else the latest enabled step that has surfaced items, else
|
|
808
|
+
* the first enabled one.
|
|
809
|
+
*/
|
|
810
|
+
private activeFollowUpStep;
|
|
811
|
+
/** Read a run's live follow-up companion state (the active Coder step's items), or null. */
|
|
812
|
+
getFollowUps(workspaceId: string, executionId: string): Promise<FollowUpsStepState | null>;
|
|
813
|
+
/**
|
|
814
|
+
* Locate the run + the Coder step that OWNS the addressed item + the item, throwing 404
|
|
815
|
+
* when absent. Routes by item id (not "the first enabled step") so a pipeline carrying more
|
|
816
|
+
* than one follow-up-enabled Coder step decides each item on the step that surfaced it —
|
|
817
|
+
* otherwise a later Coder's items 404 and its gate can never be cleared.
|
|
818
|
+
*/
|
|
819
|
+
private loadFollowUpItem;
|
|
820
|
+
/** File a `follow_up` item as a tracker issue (GitHub / Jira), recording the ticket ref. */
|
|
821
|
+
fileFollowUp(workspaceId: string, executionId: string, itemId: string): Promise<FollowUpsStepState>;
|
|
822
|
+
/** Queue a `follow_up` item to send back to the Coder on its next pass. */
|
|
823
|
+
queueFollowUp(workspaceId: string, executionId: string, itemId: string): Promise<FollowUpsStepState>;
|
|
824
|
+
/** Answer a `question` item; the answer is folded into the Coder's next pass. */
|
|
825
|
+
answerFollowUp(workspaceId: string, executionId: string, itemId: string, answer: string): Promise<FollowUpsStepState>;
|
|
826
|
+
/** Dismiss a follow-up / question item without acting on it. */
|
|
827
|
+
dismissFollowUp(workspaceId: string, executionId: string, itemId: string): Promise<FollowUpsStepState>;
|
|
828
|
+
/**
|
|
829
|
+
* Persist an item decision and, when the run is PARKED on this step's follow-up gate and
|
|
830
|
+
* every item is now decided, drive it forward: loop the Coder for the queued / answered
|
|
831
|
+
* items (within the budget), else advance past the gate. When the run is not parked (the
|
|
832
|
+
* Coder is still running, or it already moved on) this only persists + emits the change.
|
|
833
|
+
*/
|
|
834
|
+
private driveFollowUpsAfterDecision;
|
|
732
835
|
/** Provision inputs (`{{input.*}}`) derived from the block under deployment. */
|
|
733
836
|
private deployInputs;
|
|
734
837
|
/**
|
|
@@ -792,6 +895,25 @@ export declare class ExecutionService {
|
|
|
792
895
|
* the requirements kind.
|
|
793
896
|
*/
|
|
794
897
|
private buildClarityKind;
|
|
898
|
+
/**
|
|
899
|
+
* A brainstorm (structured-dialogue) subject for {@link reviewGate}, parameterised by stage.
|
|
900
|
+
* Otherwise identical to the requirements kind — the service handles its own upstream context
|
|
901
|
+
* (the architecture stage seeds from the refined requirements). The brainstorm services
|
|
902
|
+
* resolve their model exactly like the requirements reviewer, so the cap knobs are reused.
|
|
903
|
+
*/
|
|
904
|
+
private buildBrainstormKind;
|
|
905
|
+
/** Pick the brainstorm kind for a stage (the dedicated window drives both via the same loop). */
|
|
906
|
+
private brainstormKindFor;
|
|
907
|
+
/** Run a fresh brainstorm pass over a block + stage (off-path inspector / window surface). */
|
|
908
|
+
reviewBrainstorm(workspaceId: string, blockId: string, stage: BrainstormStage): Promise<BrainstormSession>;
|
|
909
|
+
/** Incorporate the human's picks ASYNCHRONOUSLY (the brainstorm mirror of {@link incorporateRequirements}). */
|
|
910
|
+
incorporateBrainstorm(workspaceId: string, blockId: string, stage: BrainstormStage, feedback?: string): Promise<BrainstormSession>;
|
|
911
|
+
/** Re-run the brainstorm against the converged direction (one more pass). */
|
|
912
|
+
reReviewBrainstorm(workspaceId: string, blockId: string, stage: BrainstormStage): Promise<BrainstormSession>;
|
|
913
|
+
/** Proceed: settle the brainstorm (last converged direction wins downstream) and advance. */
|
|
914
|
+
proceedBrainstorm(workspaceId: string, blockId: string, stage: BrainstormStage): Promise<BrainstormSession>;
|
|
915
|
+
/** Resolve a brainstorm that hit its iteration cap (extra-round / proceed / stop-reset). */
|
|
916
|
+
resolveBrainstormExceeded(workspaceId: string, blockId: string, stage: BrainstormStage, choice: ResolveRequirementsExceededChoice): Promise<BrainstormSession>;
|
|
795
917
|
/**
|
|
796
918
|
* Run a fresh reviewer pass over a block's collected requirements, snapshotting the
|
|
797
919
|
* task's merge-preset knobs (iteration budget + tolerated severity) onto the review.
|