@cat-factory/orchestration 0.174.0 → 0.176.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/dependencies.d.ts +9 -1
- package/dist/container/dependencies.d.ts.map +1 -1
- package/dist/container/module-shapes.d.ts +5 -0
- package/dist/container/module-shapes.d.ts.map +1 -1
- package/dist/container/modules.d.ts +8 -20
- package/dist/container/modules.d.ts.map +1 -1
- package/dist/container/modules.js +20 -174
- package/dist/container/modules.js.map +1 -1
- package/dist/container/review-modules.d.ts +21 -0
- package/dist/container/review-modules.d.ts.map +1 -0
- package/dist/container/review-modules.js +203 -0
- package/dist/container/review-modules.js.map +1 -0
- package/dist/container.d.ts +3 -2
- package/dist/container.d.ts.map +1 -1
- package/dist/container.js +2 -1
- package/dist/container.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/modules/agentSettings/WorkspaceAgentSettingsService.d.ts +33 -0
- package/dist/modules/agentSettings/WorkspaceAgentSettingsService.d.ts.map +1 -0
- package/dist/modules/agentSettings/WorkspaceAgentSettingsService.js +54 -0
- package/dist/modules/agentSettings/WorkspaceAgentSettingsService.js.map +1 -0
- package/dist/modules/board/BoardService.d.ts +22 -22
- package/dist/modules/board/BoardService.d.ts.map +1 -1
- package/dist/modules/board/BoardService.js +42 -47
- package/dist/modules/board/BoardService.js.map +1 -1
- package/dist/modules/board/board.logic.d.ts +7 -0
- package/dist/modules/board/board.logic.d.ts.map +1 -1
- package/dist/modules/board/layoutWrites.d.ts +35 -0
- package/dist/modules/board/layoutWrites.d.ts.map +1 -0
- package/dist/modules/board/layoutWrites.js +74 -0
- package/dist/modules/board/layoutWrites.js.map +1 -0
- package/dist/modules/board/mountProjection.d.ts +21 -0
- package/dist/modules/board/mountProjection.d.ts.map +1 -0
- package/dist/modules/board/mountProjection.js +49 -0
- package/dist/modules/board/mountProjection.js.map +1 -0
- package/dist/modules/brainstorm/BrainstormService.d.ts +3 -2
- package/dist/modules/brainstorm/BrainstormService.d.ts.map +1 -1
- package/dist/modules/brainstorm/BrainstormService.js +14 -10
- package/dist/modules/brainstorm/BrainstormService.js.map +1 -1
- package/dist/modules/brainstorm/brainstorm.logic.d.ts +9 -1
- package/dist/modules/brainstorm/brainstorm.logic.d.ts.map +1 -1
- package/dist/modules/brainstorm/brainstorm.logic.js +15 -9
- package/dist/modules/brainstorm/brainstorm.logic.js.map +1 -1
- package/dist/modules/clarity/ClarityReviewService.d.ts +3 -3
- package/dist/modules/clarity/ClarityReviewService.d.ts.map +1 -1
- package/dist/modules/clarity/ClarityReviewService.js +5 -4
- package/dist/modules/clarity/ClarityReviewService.js.map +1 -1
- package/dist/modules/clarity/clarity.logic.d.ts +8 -1
- package/dist/modules/clarity/clarity.logic.d.ts.map +1 -1
- package/dist/modules/clarity/clarity.logic.js +14 -7
- package/dist/modules/clarity/clarity.logic.js.map +1 -1
- package/dist/modules/execution/AgentContextBuilder.d.ts +23 -1
- package/dist/modules/execution/AgentContextBuilder.d.ts.map +1 -1
- package/dist/modules/execution/AgentContextBuilder.js +36 -1
- package/dist/modules/execution/AgentContextBuilder.js.map +1 -1
- package/dist/modules/execution/ExecutionServiceDependencies.d.ts +8 -1
- package/dist/modules/execution/ExecutionServiceDependencies.d.ts.map +1 -1
- package/dist/modules/execution/gate-window-controllers.d.ts +1 -0
- package/dist/modules/execution/gate-window-controllers.d.ts.map +1 -1
- package/dist/modules/execution/run-context-admission.d.ts +1 -1
- package/dist/modules/execution/run-context-admission.d.ts.map +1 -1
- package/dist/modules/execution/run-context-admission.js +1 -0
- package/dist/modules/execution/run-context-admission.js.map +1 -1
- package/dist/modules/requirements/RequirementReviewService.d.ts +9 -2
- package/dist/modules/requirements/RequirementReviewService.d.ts.map +1 -1
- package/dist/modules/requirements/RequirementReviewService.js +77 -16
- package/dist/modules/requirements/RequirementReviewService.js.map +1 -1
- package/dist/modules/requirements/requirements.logic.d.ts +61 -21
- package/dist/modules/requirements/requirements.logic.d.ts.map +1 -1
- package/dist/modules/requirements/requirements.logic.js +109 -20
- package/dist/modules/requirements/requirements.logic.js.map +1 -1
- package/dist/modules/review/IterativeReviewService.d.ts +42 -3
- package/dist/modules/review/IterativeReviewService.d.ts.map +1 -1
- package/dist/modules/review/IterativeReviewService.js +31 -4
- package/dist/modules/review/IterativeReviewService.js.map +1 -1
- package/dist/modules/review/product-context.d.ts +23 -0
- package/dist/modules/review/product-context.d.ts.map +1 -0
- package/dist/modules/review/product-context.js +47 -0
- package/dist/modules/review/product-context.js.map +1 -0
- package/package.json +11 -11
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { applyMountLayout } from '@cat-factory/kernel';
|
|
2
|
+
export function createMountProjection(deps) {
|
|
3
|
+
/**
|
|
4
|
+
* THIS workspace's mount for `block` when it is a service frame mounted here, else null (a
|
|
5
|
+
* non-frame, a legacy/unregistered frame, or in-org sharing not wired). The mount carries the
|
|
6
|
+
* frame's per-workspace layout override, so it is both what a frame move/resize WRITES and what
|
|
7
|
+
* every frame-returning read must project through. Costs no query for a non-frame.
|
|
8
|
+
*/
|
|
9
|
+
async function frameMount(workspaceId, block) {
|
|
10
|
+
if (block.level !== 'frame')
|
|
11
|
+
return null;
|
|
12
|
+
const services = deps.serviceRepository;
|
|
13
|
+
const mounts = deps.workspaceMountRepository;
|
|
14
|
+
if (!services || !mounts)
|
|
15
|
+
return null;
|
|
16
|
+
// A frame block id does NOT uniquely identify a service: every seeded board carries the same
|
|
17
|
+
// ids (`blk_auth`, …), so `getByFrameBlock` answers with an arbitrary one of them. Paired with
|
|
18
|
+
// `mounts.get(thisWorkspace, thatServiceId)` that reads as "this frame has no mount here" on a
|
|
19
|
+
// deployment with two seeded boards — and then a frame write lands on the block row that every
|
|
20
|
+
// READ overrides with this board's mount (`WorkspaceService.composeBoard`), silently, in the
|
|
21
|
+
// one direction that loses the write. So resolve the candidates for this frame id and keep the
|
|
22
|
+
// one mounted HERE: two batched queries, no per-candidate round-trip.
|
|
23
|
+
const candidates = await services.listByFrameBlocks([block.id]);
|
|
24
|
+
if (candidates.length === 0)
|
|
25
|
+
return null;
|
|
26
|
+
const candidateIds = new Set(candidates.map((s) => s.id));
|
|
27
|
+
// Intersect from THIS board's mounts rather than from the candidates' mounts. Both name the
|
|
28
|
+
// same row, but `listByFrameBlocks` is not account-scoped — a colliding seeded id in another
|
|
29
|
+
// org rides the candidate list — so asking for those services' mounts would hand a
|
|
30
|
+
// mothership-mode node a service id its token does not hold, and the persistence RPC refuses
|
|
31
|
+
// such a call CLOSED: every frame edit on the board would 404 rather than degrade. Keyed on
|
|
32
|
+
// the acting workspace, this read is scoped by construction and bounded by this board.
|
|
33
|
+
const mounted = await mounts.listByWorkspace(workspaceId);
|
|
34
|
+
return mounted.find((m) => candidateIds.has(m.serviceId)) ?? null;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Project a block onto THIS workspace's board before returning it from a mutation. A service
|
|
38
|
+
* frame's position/size are the mount's per-workspace layout override rather than fields of the
|
|
39
|
+
* shared block (see {@link applyMountLayout}), so a response built from the block row alone
|
|
40
|
+
* reports the coordinates the row happened to be created with — and the SPA, which upserts the
|
|
41
|
+
* authoritative block a mutation returns, would jump the frame to that spot on every edit.
|
|
42
|
+
* Pass-through for a non-frame.
|
|
43
|
+
*/
|
|
44
|
+
async function projectForWorkspace(workspaceId, block) {
|
|
45
|
+
return applyMountLayout(block, await frameMount(workspaceId, block));
|
|
46
|
+
}
|
|
47
|
+
return { frameMount, projectForWorkspace };
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=mountProjection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mountProjection.js","sourceRoot":"","sources":["../../../src/modules/board/mountProjection.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAkBtD,MAAM,UAAU,qBAAqB,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U,EAAE,mBAAmB,EAAE,CAAA;AAC5C,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Block, BrainstormSession, BrainstormStage, RequirementReviewItem } from '@cat-factory/kernel';
|
|
2
2
|
import type { BrainstormSessionRepository } from '@cat-factory/kernel';
|
|
3
|
+
import { type BespokeSystemPrompt } from '@cat-factory/agents';
|
|
3
4
|
import { type IterativeReviewDeps, IterativeReviewService, type ReviewCommon, type ReviewRepository } from '../review/IterativeReviewService.js';
|
|
4
5
|
import { type BrainstormContext } from './brainstorm.logic.js';
|
|
5
6
|
export interface BrainstormServiceDependencies extends IterativeReviewDeps {
|
|
@@ -35,8 +36,8 @@ export declare class BrainstormService extends IterativeReviewService<Brainstorm
|
|
|
35
36
|
protected get reviewerLabel(): string;
|
|
36
37
|
protected get reviewAgentKind(): string;
|
|
37
38
|
protected get reworkAgentKind(): string;
|
|
38
|
-
protected get
|
|
39
|
-
protected get
|
|
39
|
+
protected get reviewPrompt(): BespokeSystemPrompt;
|
|
40
|
+
protected get reworkPrompt(): BespokeSystemPrompt;
|
|
40
41
|
protected get reviewIdPrefix(): string;
|
|
41
42
|
protected get itemIdPrefix(): string;
|
|
42
43
|
protected get revisedNoun(): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BrainstormService.d.ts","sourceRoot":"","sources":["../../../src/modules/brainstorm/BrainstormService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,KAAK,EACL,iBAAiB,EACjB,eAAe,EACf,qBAAqB,EACtB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"BrainstormService.d.ts","sourceRoot":"","sources":["../../../src/modules/brainstorm/BrainstormService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,KAAK,EACL,iBAAiB,EACjB,eAAe,EACf,qBAAqB,EACtB,MAAM,qBAAqB,CAAA;A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IAAI,MAAM,CAElC;IACD,SAAS,KAAK,iBAAiB,IAAI,MAAM,CAKxC;IACD,SAAS,CAAC,QAAQ,CAAC,gBAAgB,EAAG,oBAAoB,CAAS;IACnE,SAAS,KAAK,mBAAmB,IAAI,MAAM,CAI1C;IAED,SAAS,CAAC,iBAAiB,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CAIhD;IAED,SAAS,CAAC,iBAAiB,CAAC,GAAG,EAAE,iBAAiB,GAAG,MAAM,CAE1D;IAED,SAAS,CAAC,iBAAiB,CAAC,GAAG,EAAE,iBAAiB,EAAE,KAAK,EAAE,qBAAqB,EAAE,GAAG,MAAM,CAE1F;IAED,SAAS,CAAC,oBAAoB,CAAC,GAAG,EAAE,iBAAiB,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAExE;IAED,SAAS,CAAC,aAAa,CAAC,GAAG,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAEtE;IAED,SAAS,CAAC,OAAO,CAAC,OAAO,EAAE,iBAAiB,GAAG,MAAM,GAAG,IAAI,CAE3D;IAED,SAAS,CAAC,OAAO,CAAC,OAAO,EAAE,iBAAiB,EAAE,GAAG,EAAE,MAAM,GAAG,iBAAiB,CAE5E;IAED,SAAS,CAAC,SAAS,CAAC,MAAM,EAAE,YAAY,GAAG,iBAAiB,CAE3D;IAED,oGAAoG;IACpG,UAAgB,aAAa,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAa3F;CACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ARCHITECTURE_BRAINSTORM_PROMPT, ARCHITECTURE_BRAINSTORM_REWORK_PROMPT, REQUIREMENTS_BRAINSTORM_PROMPT, REQUIREMENTS_BRAINSTORM_REWORK_PROMPT, } from '@cat-factory/agents';
|
|
2
2
|
import { IterativeReviewService, } from '../review/IterativeReviewService.js';
|
|
3
3
|
import { buildBrainstormPrompt, buildBrainstormReworkPrompt, } from './brainstorm.logic.js';
|
|
4
4
|
/**
|
|
@@ -49,15 +49,15 @@ export class BrainstormService extends IterativeReviewService {
|
|
|
49
49
|
? 'architecture-brainstorm-rework'
|
|
50
50
|
: 'requirements-brainstorm-rework';
|
|
51
51
|
}
|
|
52
|
-
get
|
|
52
|
+
get reviewPrompt() {
|
|
53
53
|
return this.stage === 'architecture'
|
|
54
|
-
?
|
|
55
|
-
:
|
|
54
|
+
? ARCHITECTURE_BRAINSTORM_PROMPT
|
|
55
|
+
: REQUIREMENTS_BRAINSTORM_PROMPT;
|
|
56
56
|
}
|
|
57
|
-
get
|
|
57
|
+
get reworkPrompt() {
|
|
58
58
|
return this.stage === 'architecture'
|
|
59
|
-
?
|
|
60
|
-
:
|
|
59
|
+
? ARCHITECTURE_BRAINSTORM_REWORK_PROMPT
|
|
60
|
+
: REQUIREMENTS_BRAINSTORM_REWORK_PROMPT;
|
|
61
61
|
}
|
|
62
62
|
get reviewIdPrefix() {
|
|
63
63
|
return this.stage === 'architecture' ? 'abs' : 'rbs';
|
|
@@ -105,12 +105,16 @@ export class BrainstormService extends IterativeReviewService {
|
|
|
105
105
|
}
|
|
106
106
|
/** Assemble the brainstorm subject for this stage (+ the refined requirements for architecture). */
|
|
107
107
|
async gatherContext(workspaceId, block) {
|
|
108
|
-
const refinedRequirements =
|
|
109
|
-
|
|
110
|
-
|
|
108
|
+
const [refinedRequirements, service] = await Promise.all([
|
|
109
|
+
this.stage === 'architecture'
|
|
110
|
+
? this.resolveRefinedRequirements?.(workspaceId, block.id)
|
|
111
|
+
: undefined,
|
|
112
|
+
this.resolveOwnService(workspaceId, block),
|
|
113
|
+
]);
|
|
111
114
|
return {
|
|
112
115
|
block: { title: block.title, type: block.type, description: block.description },
|
|
113
116
|
stage: this.stage,
|
|
117
|
+
service,
|
|
114
118
|
...(refinedRequirements ? { refinedRequirements } : {}),
|
|
115
119
|
};
|
|
116
120
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BrainstormService.js","sourceRoot":"","sources":["../../../src/modules/brainstorm/BrainstormService.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"BrainstormService.js","sourceRoot":"","sources":["../../../src/modules/brainstorm/BrainstormService.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,8BAA8B,EAC9B,qCAAqC,EAErC,8BAA8B,EAC9B,qCAAqC,GACtC,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAEL,sBAAsB,GAGvB,MAAM,qCAAqC,CAAA;AAC5C,OAAO,EAEL,qBAAqB,EACrB,2BAA2B,GAC5B,MAAM,uBAAuB,CAAA;AAe9B;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,iBAAkB,SAAQ,sBAGtC;IACoB,UAAU,CAAqC;IACjD,KAAK,CAAiB;IACtB,0BAA0B,CAGX;IAEhC,YAAY,IAAmC;QAC7C,KAAK,CAAC,IAAI,CAAC,CAAA;QACX,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACvB,IAAI,CAAC,0BAA0B,GAAG,IAAI,CAAC,0BAA0B,CAAA;QACjE,MAAM,IAAI,GAAG,IAAI,CAAC,2BAA2B,CAAA;QAC7C,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,yFAAyF;QACzF,uEAAuE;QACvE,IAAI,CAAC,UAAU,GAAG;YAChB,UAAU,EAAE,CAAC,EAAE,EAAE,OAAO,EAAE,EAAE,CAAC,IAAI,CAAC,eAAe,CAAC,EAAE,EAAE,OAAO,EAAE,KAAK,CAAC;YACrE,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC;YACjC,cAAc,EAAE,CAAC,EAAE,EAAE,OAAO,EAAE,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,EAAE,EAAE,OAAO,CAAC;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K,EAAE,kBAAkB,EAAE,IAAI,EAAE,CAAA;IACnE,CAAC;IAED,oGAAoG;IAC1F,KAAK,CAAC,aAAa,CAAC,WAAmB,EAAE,KAAY;QAC7D,MAAM,CAAC,mBAAmB,EAAE,OAAO,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;YACvD,IAAI,CAAC,KAAK,KAAK,cAAc;gBAC3B,CAAC,CAAC,IAAI,CAAC,0BAA0B,EAAE,CAAC,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC;gBAC1D,CAAC,CAAC,SAAS;YACb,IAAI,CAAC,iBAAiB,CAAC,WAAW,EAAE,KAAK,CAAC;SAC3C,CAAC,CAAA;QACF,OAAO;YACL,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,WAAW,EAAE,KAAK,CAAC,WAAW,EAAE;YAC/E,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,OAAO;YACP,GAAG,CAAC,mBAAmB,CAAC,CAAC,CAAC,EAAE,mBAAmB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACxD,CAAA;IACH,CAAC;CACF"}
|
|
@@ -1,10 +1,18 @@
|
|
|
1
|
-
import type { Block, BrainstormStage, RequirementReviewItem } from '@cat-factory/kernel';
|
|
1
|
+
import type { Block, BrainstormStage, OwnServiceContext, RequirementReviewItem } from '@cat-factory/kernel';
|
|
2
2
|
export { coerceReviewItems, disposeReview, extractJson, hasNotesToIncorporate, type ReviewDisposition, } from '../requirements/requirements.logic.js';
|
|
3
3
|
/** Everything a brainstorm agent reasons over for one stage. */
|
|
4
4
|
export interface BrainstormContext {
|
|
5
5
|
block: Pick<Block, 'title' | 'type' | 'description'>;
|
|
6
6
|
/** Which dialogue this is — selects the seed subject + the option framing. */
|
|
7
7
|
stage: BrainstormStage;
|
|
8
|
+
/**
|
|
9
|
+
* Which system this work belongs to — the enclosing service frame, or the positive reason there
|
|
10
|
+
* is none. A brainstorm runs INLINE with no checkout, so this is its only means of knowing what
|
|
11
|
+
* software the idea is FOR; the unresolved case is stated rather than omitted, because an agent
|
|
12
|
+
* asked to propose options for an unidentified system will otherwise pick one itself and propose
|
|
13
|
+
* options for that. Absent for a caller that resolves nothing (a test fake).
|
|
14
|
+
*/
|
|
15
|
+
service?: OwnServiceContext;
|
|
8
16
|
/**
|
|
9
17
|
* The requirements refined in prior stages (a requirements review's incorporated doc, or a
|
|
10
18
|
* requirements-brainstorm's converged direction). Present only for the `architecture` stage;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"brainstorm.logic.d.ts","sourceRoot":"","sources":["../../../src/modules/brainstorm/brainstorm.logic.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"brainstorm.logic.d.ts","sourceRoot":"","sources":["../../../src/modules/brainstorm/brainstorm.logic.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,KAAK,EACL,eAAe,EACf,iBAAiB,EACjB,qBAAqB,EACtB,MAAM,qBAAqB,CAAA;AAW5B,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,WAAW,EACX,qBAAqB,EACrB,KAAK,iBAAiB,GACvB,MAAM,uCAAuC,CAAA;AAG9C,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;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,iBAAiB,CAAA;IAC3B;;;;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,CAyBtE;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"}
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
// from here (one import site), mirroring how `requirements.logic` / `clarity.logic` are
|
|
9
9
|
// their services' surfaces.
|
|
10
10
|
export { coerceReviewItems, disposeReview, extractJson, hasNotesToIncorporate, } from '../requirements/requirements.logic.js';
|
|
11
|
+
import { renderProductContextLines } from '../review/product-context.js';
|
|
11
12
|
const stageNoun = (stage) => stage === 'architecture' ? 'technical approach' : 'requirements direction';
|
|
12
13
|
/**
|
|
13
14
|
* Render the subject under brainstorm as a single Markdown document — the converged
|
|
@@ -16,23 +17,28 @@ const stageNoun = (stage) => stage === 'architecture' ? 'technical approach' : '
|
|
|
16
17
|
* the incorporate step rewrites.
|
|
17
18
|
*/
|
|
18
19
|
export function renderBrainstormSubject(ctx) {
|
|
20
|
+
const lines = [
|
|
21
|
+
`# ${ctx.block.title} (${ctx.block.type})`,
|
|
22
|
+
...renderProductContextLines(ctx.service, 'propose'),
|
|
23
|
+
'',
|
|
24
|
+
];
|
|
25
|
+
const original = ctx.block.description?.trim() || '(no description provided)';
|
|
19
26
|
if (ctx.convergedDoc?.trim()) {
|
|
20
|
-
|
|
21
|
-
`# ${ctx.block.title} (${ctx.block.type})`,
|
|
22
|
-
'',
|
|
23
|
-
`## Current ${stageNoun(ctx.stage)} (under discussion)`,
|
|
24
|
-
ctx.convergedDoc.trim(),
|
|
25
|
-
].join('\n');
|
|
27
|
+
lines.push(`## Current ${stageNoun(ctx.stage)} (under discussion)`, ctx.convergedDoc.trim());
|
|
26
28
|
}
|
|
27
|
-
|
|
28
|
-
if (ctx.stage === 'architecture' && ctx.refinedRequirements?.trim()) {
|
|
29
|
+
else if (ctx.stage === 'architecture' && ctx.refinedRequirements?.trim()) {
|
|
29
30
|
lines.push('## Refined requirements (the basis for the approach)', ctx.refinedRequirements.trim());
|
|
30
31
|
}
|
|
31
32
|
else {
|
|
32
33
|
// For the architecture stage with no refined requirements threaded in, the raw description
|
|
33
34
|
// is the seed — the same fallback as the requirements stage.
|
|
34
|
-
lines.push('## Rough idea',
|
|
35
|
+
lines.push('## Rough idea', original);
|
|
36
|
+
return lines.join('\n');
|
|
35
37
|
}
|
|
38
|
+
// A derived subject never DISPLACES the requester's own words — it is layered above them. The
|
|
39
|
+
// dialogue is where an idea gets shaped, so the shaping is exactly what has to stay checkable
|
|
40
|
+
// against what was actually asked for.
|
|
41
|
+
lines.push('', '## Original request (as written by the requester)', original);
|
|
36
42
|
return lines.join('\n');
|
|
37
43
|
}
|
|
38
44
|
export function buildBrainstormPrompt(ctx) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"brainstorm.logic.js","sourceRoot":"","sources":["../../../src/modules/brainstorm/brainstorm.logic.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"brainstorm.logic.js","sourceRoot":"","sources":["../../../src/modules/brainstorm/brainstorm.logic.ts"],"names":[],"mappings":"AAOA,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;AAC9C,OAAO,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAA;AA8BxE,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;IA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AAC,MAAM,EAAE,CAAC,CAAA;YAClE,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,sBAAsB,EAAE,CAAC,CAAA;QACtE,CAAC;QACD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;IAChB,CAAC;IACD,IAAI,SAAS,CAAC,MAAM,EAAE,CAAC;QACrB,KAAK,CAAC,IAAI,CAAC,qDAAqD,EAAE,EAAE,CAAC,CAAA;QACrE,KAAK,MAAM,CAAC,IAAI,SAAS;YAAE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,CAAC,CAAA;QACrD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;IAChB,CAAC;IACD,IAAI,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"}
|
|
@@ -25,8 +25,8 @@ export declare class ClarityReviewService extends IterativeReviewService<Clarity
|
|
|
25
25
|
protected readonly reviewerLabel = "clarity reviewer";
|
|
26
26
|
protected readonly reviewAgentKind = "clarity-review";
|
|
27
27
|
protected readonly reworkAgentKind = "clarity-rework";
|
|
28
|
-
protected readonly
|
|
29
|
-
protected readonly
|
|
28
|
+
protected readonly reviewPrompt: import("@cat-factory/agents").BespokeSystemPrompt;
|
|
29
|
+
protected readonly reworkPrompt: import("@cat-factory/agents").BespokeSystemPrompt;
|
|
30
30
|
protected readonly reviewIdPrefix = "clr";
|
|
31
31
|
protected readonly itemIdPrefix = "clri";
|
|
32
32
|
protected readonly revisedNoun = "revised bug report";
|
|
@@ -62,7 +62,7 @@ export declare class ClarityReviewService extends IterativeReviewService<Clarity
|
|
|
62
62
|
concernThreshold?: RequirementConcernLevel;
|
|
63
63
|
}): Promise<ClarityReview>;
|
|
64
64
|
/** Assemble the bug report under review (block + optional investigation). */
|
|
65
|
-
protected gatherContext(
|
|
65
|
+
protected gatherContext(workspaceId: string, block: Block, input: ClarityContextInput): Promise<ClarityContext>;
|
|
66
66
|
}
|
|
67
67
|
export {};
|
|
68
68
|
//# sourceMappingURL=ClarityReviewService.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClarityReviewService.d.ts","sourceRoot":"","sources":["../../../src/modules/clarity/ClarityReviewService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,KAAK,EACL,aAAa,EACb,uBAAuB,EACvB,qBAAqB,EACtB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAA;AAGlE,OAAO,EACL,KAAK,mBAAmB,EACxB,sBAAsB,EACtB,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACtB,MAAM,qCAAqC,CAAA;AAC5C,OAAO,EACL,KAAK,cAAc,EAIpB,MAAM,oBAAoB,CAAA;AAE3B,MAAM,WAAW,gCAAiC,SAAQ,mBAAmB;IAC3E,uBAAuB,EAAE,uBAAuB,CAAA;CACjD;AAED,8EAA8E;AAC9E,UAAU,mBAAmB;IAC3B,gGAAgG;IAChG,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB;AAED;;;;;;;GAOG;AACH,qBAAa,o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AU,CACd,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE;QACJ,OAAO,EAAE,OAAO,GAAG,qBAAqB,CAAA;QACxC,SAAS,EAAE,MAAM,EAAE,CAAA;QACnB,aAAa,CAAC,EAAE,MAAM,CAAA;QACtB,gBAAgB,CAAC,EAAE,uBAAuB,CAAA;KAC3C,GACA,OAAO,CAAC,aAAa,CAAC,CAexB;IAED,6EAA6E;IAC7E,UAAgB,aAAa,CAC3B,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,mBAAmB,GACzB,OAAO,CAAC,cAAc,CAAC,CAMzB;CACF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { assertFound, DEFAULT_MAX_REQUIREMENT_ITERATIONS } from '@cat-factory/kernel';
|
|
2
|
-
import {
|
|
2
|
+
import { CLARITY_REVIEW_PROMPT, CLARITY_REWORK_PROMPT } from '@cat-factory/agents';
|
|
3
3
|
import { IterativeReviewService, } from '../review/IterativeReviewService.js';
|
|
4
4
|
import { buildClarityPrompt, buildClarityReworkPrompt, buildSeededClarityItems, } from './clarity.logic.js';
|
|
5
5
|
/**
|
|
@@ -20,8 +20,8 @@ export class ClarityReviewService extends IterativeReviewService {
|
|
|
20
20
|
reviewerLabel = 'clarity reviewer';
|
|
21
21
|
reviewAgentKind = 'clarity-review';
|
|
22
22
|
reworkAgentKind = 'clarity-rework';
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
reviewPrompt = CLARITY_REVIEW_PROMPT;
|
|
24
|
+
reworkPrompt = CLARITY_REWORK_PROMPT;
|
|
25
25
|
reviewIdPrefix = 'clr';
|
|
26
26
|
itemIdPrefix = 'clri';
|
|
27
27
|
revisedNoun = 'revised bug report';
|
|
@@ -79,9 +79,10 @@ export class ClarityReviewService extends IterativeReviewService {
|
|
|
79
79
|
});
|
|
80
80
|
}
|
|
81
81
|
/** Assemble the bug report under review (block + optional investigation). */
|
|
82
|
-
async gatherContext(
|
|
82
|
+
async gatherContext(workspaceId, block, input) {
|
|
83
83
|
return {
|
|
84
84
|
block: { title: block.title, type: block.type, description: block.description },
|
|
85
|
+
service: await this.resolveOwnService(workspaceId, block),
|
|
85
86
|
investigation: input.investigation,
|
|
86
87
|
};
|
|
87
88
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClarityReviewService.js","sourceRoot":"","sources":["../../../src/modules/clarity/ClarityReviewService.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,WAAW,EAAE,kCAAkC,EAAE,MAAM,qBAAqB,CAAA;AACrF,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"ClarityReviewService.js","sourceRoot":"","sources":["../../../src/modules/clarity/ClarityReviewService.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,WAAW,EAAE,kCAAkC,EAAE,MAAM,qBAAqB,CAAA;AACrF,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAA;AAClF,OAAO,EAEL,sBAAsB,GAGvB,MAAM,qCAAqC,CAAA;AAC5C,OAAO,EAEL,kBAAkB,EAClB,wBAAwB,EACxB,uBAAuB,GACxB,MAAM,oBAAoB,CAAA;AAY3B;;;;;;;GAOG;AACH,MAAM,OAAO,oBAAqB,SAAQ,sBAIzC;IACoB,UAAU,CAAiC;IAE9D,YAAY,IAAsC;QAChD,KAAK,CAAC,IAAI,CAAC,CAAA;QACX,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,uBAAuB,CAAA;IAChD,CAAC;IAEkB,UAAU,GAAG,gBAAgB,CAAA;IAC7B,aAAa,GAAG,kBAAkB,CAAA;IAClC,eAAe,GAAG,gBAAgB,CAAA;IAClC,eAAe,GAAG,gBAAgB,CAAA;IAClC,YAAY,GAAG,qBAAqB,CAAA;IACpC,YAAY,GAAG,qBAAqB,CAAA;IACpC,cAAc,GAAG,KAAK,CAAA;IACtB,YAAY,GAAG,MAAM,CAAA;IACrB,WA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AAK,GACT,IAAI,CAAC,OAAO,KAAK,qBAAqB;YACpC,CAAC,CAAC,uBAAuB,CAAC,IAAI,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,GAAG,CAAC;YACxF,CAAC,CAAC,EAAE,CAAA;QACR,OAAO,IAAI,CAAC,oBAAoB,CAAC,WAAW,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE;YAChE,aAAa,EAAE,IAAI,CAAC,aAAa,IAAI,kCAAkC;YACvE,gBAAgB,EAAE,IAAI,CAAC,gBAAgB,IAAI,MAAM;SAClD,CAAC,CAAA;IACJ,CAAC;IAED,6EAA6E;IACnE,KAAK,CAAC,aAAa,CAC3B,WAAmB,EACnB,KAAY,EACZ,KAA0B;QAE1B,OAAO;YACL,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,WAAW,EAAE,KAAK,CAAC,WAAW,EAAE;YAC/E,OAAO,EAAE,MAAM,IAAI,CAAC,iBAAiB,CAAC,WAAW,EAAE,KAAK,CAAC;YACzD,aAAa,EAAE,KAAK,CAAC,aAAa;SACnC,CAAA;IACH,CAAC;CACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Block, RequirementReviewItem } from '@cat-factory/kernel';
|
|
1
|
+
import type { Block, OwnServiceContext, RequirementReviewItem } from '@cat-factory/kernel';
|
|
2
2
|
export { coerceReviewItems, disposeReview, extractJson, hasNotesToIncorporate, type ReviewDisposition, } from '../requirements/requirements.logic.js';
|
|
3
3
|
/**
|
|
4
4
|
* Turn a bug investigator's structured `questions` into clarity-review findings WITHOUT an LLM
|
|
@@ -11,6 +11,13 @@ export declare function buildSeededClarityItems(questions: string[], nextId: ()
|
|
|
11
11
|
/** Everything the clarity reviewer reasons over: the bug report plus any investigation. */
|
|
12
12
|
export interface ClarityContext {
|
|
13
13
|
block: Pick<Block, 'title' | 'type' | 'description'>;
|
|
14
|
+
/**
|
|
15
|
+
* Which system the defect is in — the enclosing service frame, or the positive reason there is
|
|
16
|
+
* none. Triage runs INLINE with no checkout, so this is its only means of knowing what software
|
|
17
|
+
* the report is about; the unresolved case is stated rather than omitted (see
|
|
18
|
+
* `review/product-context.ts`). Absent for a caller that resolves nothing (a test fake).
|
|
19
|
+
*/
|
|
20
|
+
service?: OwnServiceContext;
|
|
14
21
|
/**
|
|
15
22
|
* The prose report an upstream `bug-investigator` step produced (enriched bug report +
|
|
16
23
|
* optional working hypothesis). When present it is the primary triage subject — the raw
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clarity.logic.d.ts","sourceRoot":"","sources":["../../../src/modules/clarity/clarity.logic.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"clarity.logic.d.ts","sourceRoot":"","sources":["../../../src/modules/clarity/clarity.logic.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAA;AAY1F,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,WAAW,EACX,qBAAqB,EACrB,KAAK,iBAAiB,GACvB,MAAM,uCAAuC,CAAA;AAE9C;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACrC,SAAS,EAAE,MAAM,EAAE,EACnB,MAAM,EAAE,MAAM,MAAM,EACpB,GAAG,EAAE,MAAM,GACV,qBAAqB,EAAE,CAezB;AAED,2FAA2F;AAC3F,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,aAAa,CAAC,CAAA;IACpD;;;;;OAKG;IACH,OAAO,CAAC,EAAE,iBAAiB,CAAA;IAC3B;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,+FAA+F;IAC/F,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,cAAc,GAAG,MAAM,CA4B3D;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,cAAc,GAAG,MAAM,CAwB9D;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CACtC,GAAG,EAAE,cAAc,EACnB,KAAK,EAAE,qBAAqB,EAAE,GAC7B,MAAM,CA0CR"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { renderProductContextLines } from '../review/product-context.js';
|
|
1
2
|
// Pure logic for the clarity-review (bug-report triage) agent: assembling the bug
|
|
2
3
|
// report under review (the block description, optionally enriched by an upstream
|
|
3
4
|
// `bug-investigator` step's prose report), and building the triage + rework prompts.
|
|
@@ -38,19 +39,25 @@ export function buildSeededClarityItems(questions, nextId, now) {
|
|
|
38
39
|
* incorporate step rewrites.
|
|
39
40
|
*/
|
|
40
41
|
export function renderBugReport(ctx) {
|
|
42
|
+
const heading = [
|
|
43
|
+
`# ${ctx.block.title} (${ctx.block.type})`,
|
|
44
|
+
...renderProductContextLines(ctx.service, 'reason'),
|
|
45
|
+
];
|
|
46
|
+
const reported = ctx.block.description?.trim() || '(no description provided)';
|
|
47
|
+
// A clarified report is layered ABOVE the original, never in place of it: the reporter's own
|
|
48
|
+
// words are the only fixed point a later pass can check the clarification against, and dropping
|
|
49
|
+
// them let one pass's assumption become the permanent subject.
|
|
41
50
|
const lines = ctx.clarifiedDoc?.trim()
|
|
42
51
|
? [
|
|
43
|
-
|
|
52
|
+
...heading,
|
|
44
53
|
'',
|
|
45
54
|
'## Current standardized bug report (under review)',
|
|
46
55
|
ctx.clarifiedDoc.trim(),
|
|
47
|
-
]
|
|
48
|
-
: [
|
|
49
|
-
`# ${ctx.block.title} (${ctx.block.type})`,
|
|
50
56
|
'',
|
|
51
|
-
'##
|
|
52
|
-
|
|
53
|
-
]
|
|
57
|
+
'## Originally reported (as written by the reporter)',
|
|
58
|
+
reported,
|
|
59
|
+
]
|
|
60
|
+
: [...heading, '', '## Reported bug', reported];
|
|
54
61
|
if (!ctx.clarifiedDoc?.trim() && ctx.investigation?.trim()) {
|
|
55
62
|
lines.push('', '## Investigation (read-only findings from the codebase)', ctx.investigation.trim());
|
|
56
63
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clarity.logic.js","sourceRoot":"","sources":["../../../src/modules/clarity/clarity.logic.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"clarity.logic.js","sourceRoot":"","sources":["../../../src/modules/clarity/clarity.logic.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAA;AAExE,kFAAkF;AAClF,iFAAiF;AACjF,qFAAqF;AACrF,kFAAkF;AAClF,uFAAuF;AACvF,EAAE;AACF,sFAAsF;AACtF,sFAAsF;AACtF,qBAAqB;AACrB,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,WAAW,EACX,qBAAqB,GAEtB,MAAM,uCAAuC,CAAA;AAE9C;;;;;;GAMG;AACH,MAAM,UAAU,uBAAuB,CACrC,SAAmB,EACnB,MAAoB,EACpB,GAAW;IAEX,OAAO,SAAS;SACb,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;SACpB,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;SAC3B,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACX,EAAE,EAAE,MAAM,EAAE;QACZ,QAAQ,EAAE,UAAmB;QAC7B,QAAQ,EAAE,MAAe;QACzB,KAAK,EAAE,CAAC,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC,CAA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AAE,CAAC,CAAA;QACjE,CAAC;QACD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;IAChB,CAAC;IACD,IAAI,SAAS,CAAC,MAAM,EAAE,CAAC;QACrB,KAAK,CAAC,IAAI,CAAC,kEAAkE,EAAE,EAAE,CAAC,CAAA;QAClF,KAAK,MAAM,CAAC,IAAI,SAAS;YAAE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,CAAC,CAAA;QACrD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;IAChB,CAAC;IACD,IAAI,CAAC,QAAQ,CAAC,MAAM,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC;QAC1C,KAAK,CAAC,IAAI,CACR,gFAAgF;YAC9E,iDAAiD,EACnD,EAAE,CACH,CAAA;IACH,CAAC;IACD,IAAI,GAAG,CAAC,cAAc,EAAE,IAAI,EAAE,EAAE,CAAC;QAC/B,KAAK,CAAC,IAAI,CACR,EAAE,EACF,uFAAuF;YACrF,mDAAmD,EACrD,EAAE,EACF,GAAG,CAAC,cAAc,CAAC,IAAI,EAAE,EACzB,EAAE,CACH,CAAA;IACH,CAAC;IACD,KAAK,CAAC,IAAI,CACR,sFAAsF;QACpF,sFAAsF;QACtF,0BAA0B,CAC7B,CAAA;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACzB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AccountRepository, AgentPromptRepository, AgentRunContext, Block, BlockRepository, BrainstormSessionRepository, ClarityReviewRepository, ConsensusGroupRepository, DocInterviewRepository, DocumentRepository, ExecutionInstance, InitiativePresetRegistry, InitiativeRepository, Logger, PipelineStep, RequirementReviewRepository, ResolvedSkill, SkillVersionPin, TaskRepository, TestSecretRef, WorkspaceRepository } from '@cat-factory/kernel';
|
|
1
|
+
import type { AccountRepository, AgentPromptRepository, WorkspaceAgentSettingsRepository, AgentRunContext, Block, BlockRepository, BrainstormSessionRepository, ClarityReviewRepository, ConsensusGroupRepository, DocInterviewRepository, DocumentRepository, ExecutionInstance, InitiativePresetRegistry, InitiativeRepository, Logger, PipelineStep, RequirementReviewRepository, ResolvedSkill, SkillVersionPin, TaskRepository, TestSecretRef, WorkspaceRepository } from '@cat-factory/kernel';
|
|
2
2
|
import type { AgentKindRegistry } from '@cat-factory/agents';
|
|
3
3
|
import { type ResolvedFrontendBinding } from './frontend-infra.logic.js';
|
|
4
4
|
import type { ResolvedValidationChecks } from '@cat-factory/contracts';
|
|
@@ -86,6 +86,13 @@ export interface AgentContextBuilderDeps {
|
|
|
86
86
|
* no revision for the kind) ⇒ the shipped prompt, unchanged.
|
|
87
87
|
*/
|
|
88
88
|
agentPrompts?: AgentPromptRepository;
|
|
89
|
+
/**
|
|
90
|
+
* Optional: the workspace's per-agent-kind generation settings. When wired, each dispatch
|
|
91
|
+
* resolves the kind's configured output-token ceiling, which the step's own
|
|
92
|
+
* `stepOptions.maxOutputTokens` still overrides. Absent (or no row for the kind) ⇒ the
|
|
93
|
+
* deployment routing ceiling, unchanged.
|
|
94
|
+
*/
|
|
95
|
+
agentSettings?: WorkspaceAgentSettingsRepository;
|
|
89
96
|
/**
|
|
90
97
|
* Optional: the workspace's consensus-GROUP library. When wired, a consensus step naming a
|
|
91
98
|
* tier set (`consensus.groupIds`) resolves it here — ONE batched read per dispatch — and the
|
|
@@ -418,6 +425,21 @@ export declare class AgentContextBuilder {
|
|
|
418
425
|
* not about what this step actually ran.
|
|
419
426
|
*/
|
|
420
427
|
private resolveSystemPromptOverride;
|
|
428
|
+
/**
|
|
429
|
+
* The output-token ceiling this dispatch runs under, or undefined to run the deployment
|
|
430
|
+
* routing default. Resolved HERE, once per dispatch, for the same reason the prompt override
|
|
431
|
+
* is: the precedence is decided in one place, so the container, inline and consensus paths
|
|
432
|
+
* cannot disagree about the budget a step ran under.
|
|
433
|
+
*
|
|
434
|
+
* NARROWEST TIER WINS: the step's own `stepOptions.maxOutputTokens` beats the workspace's
|
|
435
|
+
* per-kind setting, which beats the deployment routing ceiling. The step value is read
|
|
436
|
+
* WITHOUT touching the repository, so a pipeline that pins its own budget costs no query.
|
|
437
|
+
*
|
|
438
|
+
* Keyed on the EFFECTIVE dispatched kind (like the prompt override), so a helper dispatched
|
|
439
|
+
* off another step — a gate's fixer, the fork proposer — gets the ceiling configured for the
|
|
440
|
+
* kind actually running rather than inheriting the parent step's.
|
|
441
|
+
*/
|
|
442
|
+
private resolveMaxOutputTokens;
|
|
421
443
|
/**
|
|
422
444
|
* Resolve the consensus config this dispatch runs under, applying the step's TIER SET when
|
|
423
445
|
* it names one.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgentContextBuilder.d.ts","sourceRoot":"","sources":["../../../src/modules/execution/AgentContextBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,qBAAqB,EACrB,eAAe,EACf,KAAK,EACL,eAAe,EACf,2BAA2B,EAC3B,uBAAuB,EAEvB,wBAAwB,EAExB,sBAAsB,EAEtB,kBAAkB,EAClB,iBAAiB,EAGjB,wBAAwB,EACxB,oBAAoB,EAEpB,MAAM,EACN,YAAY,EACZ,2BAA2B,EAC3B,aAAa,EACb,eAAe,EACf,cAAc,EACd,aAAa,EACb,mBAAmB,EACpB,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"AgentContextBuilder.d.ts","sourceRoot":"","sources":["../../../src/modules/execution/AgentContextBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,qBAAqB,EACrB,gCAAgC,EAChC,eAAe,EACf,KAAK,EACL,eAAe,EACf,2BAA2B,EAC3B,uBAAuB,EAEvB,wBAAwB,EAExB,sBAAsB,EAEtB,kBAAkB,EAClB,iBAAiB,EAGjB,wBAAwB,EACxB,oBAAoB,EAEpB,MAAM,EACN,YAAY,EACZ,2BAA2B,EAC3B,aAAa,EACb,eAAe,EACf,c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S,CAAC,CAElD;IAED;;;OAGG;YACW,kBAAkB;IAUhC;;;;;;;;;OASG;IACG,sBAAsB,CAC1B,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,KAAK,GACX,OAAO,CAAC;QAAE,QAAQ,EAAE,uBAAuB,EAAE,CAAC;QAAC,KAAK,EAAE,MAAM,EAAE,CAAA;KAAE,GAAG,SAAS,CAAC,CAQ/E;IAED;;;;;;OAMG;YACW,sBAAsB;IAqBpC;;;;;;;OAOG;YACW,yBAAyB;IAOvC;;;OAGG;YACW,6BAA6B;IAS3C;;;;;;;OAOG;IACG,2BAA2B,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,CAEpF;IAED;;;;;OAKG;YACW,2BAA2B;IAYzC;;;;OAIG;YACW,qBAAqB;IAYnC;;;;;;OAMG;YACW,0BAA0B;IAgBxC;;;;;;;;;;;;;;OAcG;YACW,gBAAgB;IAqE9B;;;;;;;;;;;;;OAaG;YACW,2BAA2B;IAczC;;;;;;;;;;;;;OAaG;YACW,sBAAsB;IAepC;;;;;;;;;;;;;;;;;;OAkBG;YACW,sBAAsB;IAuBpC;;;;;;OAMG;IACH,OAAO,CAAC,oBAAoB;IAe5B;;;;;;;OAOG;YACW,0BAA0B;IA8CxC,8FAA8F;YAChF,wBAAwB;IActC;;;;;OAKG;IACH,OAAO,CAAC,oBAAoB;IAsB5B;;;;;OAKG;YACW,kBAAkB;IAUhC;;;;;;;;;OASG;YACW,uBAAuB;CA+BtC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { applicableFragmentIds, applyConsensusGroup, buildExcerpt, CONTEXT_BUDGET, resolveServiceFrameBlock, selectConsensusGroup, } from '@cat-factory/kernel';
|
|
1
|
+
import { applicableFragmentIds, applyConsensusGroup, buildExcerpt, CONTEXT_BUDGET, describeOwnService, resolveServiceFrameBlock, selectConsensusGroup, } from '@cat-factory/kernel';
|
|
2
2
|
import { CODE_AWARE_TRAIT, DOC_AWARE_TRAIT, DOC_FINALIZER_KIND, DOC_WRITER_KIND, hasTrait, PR_PRIOR_REVIEW_CONTEXT_FILE, PR_REVIEWER_KIND, renderPriorReviewContext, standardsVerbosityFor, } from '@cat-factory/agents';
|
|
3
3
|
import { boundServiceFrameIds, buildFrontendRunNotes, indexLiveServiceEnvUrls, resolveFrontendBindings, } from './frontend-infra.logic.js';
|
|
4
4
|
import { connectionDescription } from '@cat-factory/contracts';
|
|
@@ -209,6 +209,9 @@ export class AgentContextBuilder {
|
|
|
209
209
|
// than in each executor, so the container / inline / consensus paths cannot disagree
|
|
210
210
|
// about which prompt a step ran under.
|
|
211
211
|
systemPromptOverride,
|
|
212
|
+
// The output-token ceiling this dispatch runs under: the step's own option, else the
|
|
213
|
+
// workspace's per-kind setting, else nothing (⇒ the deployment routing ceiling stands).
|
|
214
|
+
maxOutputTokens,
|
|
212
215
|
// The consensus config this dispatch actually runs under: the step's own config when it
|
|
213
216
|
// authored inline participants, the workspace group its estimate earned when it named a
|
|
214
217
|
// tier set, or nothing at all when no tier cleared (⇒ the standard single-actor agent).
|
|
@@ -233,6 +236,7 @@ export class AgentContextBuilder {
|
|
|
233
236
|
this.resolveDocAuthoringContext(workspaceId, agentKind, block),
|
|
234
237
|
this.resolveSkillsForStep(workspaceId, agentKind, step),
|
|
235
238
|
this.resolveSystemPromptOverride(workspaceId, agentKind, step),
|
|
239
|
+
this.resolveMaxOutputTokens(workspaceId, agentKind, step),
|
|
236
240
|
// A consensus step's TIER SET: resolve the named groups and materialise the one this
|
|
237
241
|
// task's estimate earns. In the same read wave as the rest of the context, so a tiered
|
|
238
242
|
// step costs one extra batched query and nothing else.
|
|
@@ -267,6 +271,7 @@ export class AgentContextBuilder {
|
|
|
267
271
|
...(dispatchEpochFor(step) > 0 ? { dispatchEpoch: dispatchEpochFor(step) } : {}),
|
|
268
272
|
isFinalStep,
|
|
269
273
|
...systemPromptOverride,
|
|
274
|
+
...maxOutputTokens,
|
|
270
275
|
// The future-looking Follow-up companion is enabled for this (coder) step: the
|
|
271
276
|
// container executor appends the follow-up guidance + sets the harness to stream items.
|
|
272
277
|
// Gated on the EFFECTIVE dispatched kind matching the step's own kind, so a HELPER
|
|
@@ -317,6 +322,11 @@ export class AgentContextBuilder {
|
|
|
317
322
|
...(service ? { service } : {}),
|
|
318
323
|
...(frontend ? { frontend } : {}),
|
|
319
324
|
...(involvedServices?.length ? { involvedServices } : {}),
|
|
325
|
+
// WHICH SYSTEM this work belongs to — the enclosing service frame, or the positive reason
|
|
326
|
+
// there is none. Always set (never conditionally spread): the "not under a service" case is
|
|
327
|
+
// the one the prompt has to STATE, so leaving it out would be the silent gap this exists to
|
|
328
|
+
// close. Derived from the `serviceFrame` already resolved above, so it costs no extra read.
|
|
329
|
+
ownService: describeOwnService(block, serviceFrame),
|
|
320
330
|
...(testSecrets.length ? { testSecrets } : {}),
|
|
321
331
|
// Spreads BOTH the pre-PR checks and the dependency-prepopulation install — one frame-chain
|
|
322
332
|
// read, two independently-gated context fields (see `validationChecksFor`).
|
|
@@ -884,6 +894,31 @@ export class AgentContextBuilder {
|
|
|
884
894
|
// so the context literal stays a flat spread instead of gaining another conditional.
|
|
885
895
|
return head?.text ? { systemPromptOverride: head.text } : {};
|
|
886
896
|
}
|
|
897
|
+
/**
|
|
898
|
+
* The output-token ceiling this dispatch runs under, or undefined to run the deployment
|
|
899
|
+
* routing default. Resolved HERE, once per dispatch, for the same reason the prompt override
|
|
900
|
+
* is: the precedence is decided in one place, so the container, inline and consensus paths
|
|
901
|
+
* cannot disagree about the budget a step ran under.
|
|
902
|
+
*
|
|
903
|
+
* NARROWEST TIER WINS: the step's own `stepOptions.maxOutputTokens` beats the workspace's
|
|
904
|
+
* per-kind setting, which beats the deployment routing ceiling. The step value is read
|
|
905
|
+
* WITHOUT touching the repository, so a pipeline that pins its own budget costs no query.
|
|
906
|
+
*
|
|
907
|
+
* Keyed on the EFFECTIVE dispatched kind (like the prompt override), so a helper dispatched
|
|
908
|
+
* off another step — a gate's fixer, the fork proposer — gets the ceiling configured for the
|
|
909
|
+
* kind actually running rather than inheriting the parent step's.
|
|
910
|
+
*/
|
|
911
|
+
async resolveMaxOutputTokens(workspaceId, agentKind, step) {
|
|
912
|
+
const fromStep = step.stepOptions?.maxOutputTokens;
|
|
913
|
+
if (fromStep != null)
|
|
914
|
+
return { maxOutputTokens: fromStep };
|
|
915
|
+
const configured = await this.deps.agentSettings?.get(workspaceId, agentKind);
|
|
916
|
+
// Returns the SPREAD-READY slice rather than a nullable value, so the context literal stays
|
|
917
|
+
// a flat spread instead of gaining another conditional.
|
|
918
|
+
return configured?.maxOutputTokens != null
|
|
919
|
+
? { maxOutputTokens: configured.maxOutputTokens }
|
|
920
|
+
: {};
|
|
921
|
+
}
|
|
887
922
|
/**
|
|
888
923
|
* Resolve the consensus config this dispatch runs under, applying the step's TIER SET when
|
|
889
924
|
* it names one.
|