@renseiai/agentfactory 0.8.5 → 0.8.7
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/README.md +2 -2
- package/dist/src/governor/decision-engine.d.ts +7 -0
- package/dist/src/governor/decision-engine.d.ts.map +1 -1
- package/dist/src/governor/decision-engine.js +59 -1
- package/dist/src/governor/governor.d.ts +5 -1
- package/dist/src/governor/governor.d.ts.map +1 -1
- package/dist/src/governor/governor.js +6 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +1 -0
- package/dist/src/orchestrator/activity-emitter.d.ts +3 -3
- package/dist/src/orchestrator/activity-emitter.d.ts.map +1 -1
- package/dist/src/orchestrator/activity-emitter.js +1 -1
- package/dist/src/orchestrator/detect-work-type.test.js +25 -16
- package/dist/src/orchestrator/index.d.ts +4 -0
- package/dist/src/orchestrator/index.d.ts.map +1 -1
- package/dist/src/orchestrator/index.js +1 -0
- package/dist/src/orchestrator/issue-tracker-client.d.ts +103 -0
- package/dist/src/orchestrator/issue-tracker-client.d.ts.map +1 -0
- package/dist/src/orchestrator/issue-tracker-client.js +8 -0
- package/dist/src/orchestrator/log-analyzer.d.ts +19 -4
- package/dist/src/orchestrator/log-analyzer.d.ts.map +1 -1
- package/dist/src/orchestrator/log-analyzer.js +26 -50
- package/dist/src/orchestrator/orchestrator-utils.test.js +3 -0
- package/dist/src/orchestrator/orchestrator.d.ts +4 -2
- package/dist/src/orchestrator/orchestrator.d.ts.map +1 -1
- package/dist/src/orchestrator/orchestrator.js +193 -115
- package/dist/src/orchestrator/parse-work-result.d.ts +1 -1
- package/dist/src/orchestrator/parse-work-result.d.ts.map +1 -1
- package/dist/src/orchestrator/parse-work-result.js +3 -1
- package/dist/src/orchestrator/parse-work-result.test.js +9 -0
- package/dist/src/orchestrator/session-logger.d.ts +1 -1
- package/dist/src/orchestrator/session-logger.d.ts.map +1 -1
- package/dist/src/orchestrator/state-recovery.d.ts +1 -1
- package/dist/src/orchestrator/state-recovery.d.ts.map +1 -1
- package/dist/src/orchestrator/state-recovery.js +1 -0
- package/dist/src/orchestrator/state-types.d.ts +1 -1
- package/dist/src/orchestrator/state-types.d.ts.map +1 -1
- package/dist/src/orchestrator/types.d.ts +22 -2
- package/dist/src/orchestrator/types.d.ts.map +1 -1
- package/dist/src/orchestrator/work-types.d.ts +50 -0
- package/dist/src/orchestrator/work-types.d.ts.map +1 -0
- package/dist/src/orchestrator/work-types.js +20 -0
- package/dist/src/templates/registry.d.ts +1 -1
- package/dist/src/templates/registry.test.js +2 -2
- package/dist/src/templates/renderer.d.ts +1 -1
- package/dist/src/templates/types.d.ts +4 -2
- package/dist/src/templates/types.d.ts.map +1 -1
- package/dist/src/templates/types.js +1 -0
- package/dist/src/templates/types.test.js +4 -3
- package/dist/src/tools/index.d.ts +0 -3
- package/dist/src/tools/index.d.ts.map +1 -1
- package/dist/src/tools/index.js +0 -2
- package/dist/src/workflow/index.d.ts +14 -0
- package/dist/src/workflow/index.d.ts.map +1 -0
- package/dist/src/workflow/index.js +10 -0
- package/dist/src/workflow/transition-engine.d.ts +44 -0
- package/dist/src/workflow/transition-engine.d.ts.map +1 -0
- package/dist/src/workflow/transition-engine.js +106 -0
- package/dist/src/workflow/transition-engine.test.d.ts +2 -0
- package/dist/src/workflow/transition-engine.test.d.ts.map +1 -0
- package/dist/src/workflow/transition-engine.test.js +313 -0
- package/dist/src/workflow/workflow-loader.d.ts +21 -0
- package/dist/src/workflow/workflow-loader.d.ts.map +1 -0
- package/dist/src/workflow/workflow-loader.js +40 -0
- package/dist/src/workflow/workflow-loader.test.d.ts +2 -0
- package/dist/src/workflow/workflow-loader.test.d.ts.map +1 -0
- package/dist/src/workflow/workflow-loader.test.js +134 -0
- package/dist/src/workflow/workflow-registry.d.ts +56 -0
- package/dist/src/workflow/workflow-registry.d.ts.map +1 -0
- package/dist/src/workflow/workflow-registry.js +107 -0
- package/dist/src/workflow/workflow-registry.test.d.ts +2 -0
- package/dist/src/workflow/workflow-registry.test.d.ts.map +1 -0
- package/dist/src/workflow/workflow-registry.test.js +201 -0
- package/dist/src/workflow/workflow-types.d.ts +269 -0
- package/dist/src/workflow/workflow-types.d.ts.map +1 -0
- package/dist/src/workflow/workflow-types.js +88 -0
- package/dist/src/workflow/workflow-types.test.d.ts +2 -0
- package/dist/src/workflow/workflow-types.test.d.ts.map +1 -0
- package/dist/src/workflow/workflow-types.test.js +440 -0
- package/package.json +3 -4
- package/dist/src/linear-cli.d.ts +0 -38
- package/dist/src/linear-cli.d.ts.map +0 -1
- package/dist/src/linear-cli.js +0 -674
- package/dist/src/tools/linear-runner.d.ts +0 -34
- package/dist/src/tools/linear-runner.d.ts.map +0 -1
- package/dist/src/tools/linear-runner.js +0 -700
- package/dist/src/tools/plugins/linear.d.ts +0 -9
- package/dist/src/tools/plugins/linear.d.ts.map +0 -1
- package/dist/src/tools/plugins/linear.js +0 -138
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-work-result.d.ts","sourceRoot":"","sources":["../../../src/orchestrator/parse-work-result.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM
|
|
1
|
+
{"version":3,"file":"parse-work-result.d.ts","sourceRoot":"","sources":["../../../src/orchestrator/parse-work-result.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AACpD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAuGjD;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAC7B,aAAa,EAAE,MAAM,GAAG,SAAS,EACjC,QAAQ,EAAE,aAAa,GACtB,eAAe,CAyCjB"}
|
|
@@ -28,6 +28,8 @@ const QA_PASS_PATTERNS = [
|
|
|
28
28
|
/\bAPPROVED\s+FOR\s+MERGE\b/i,
|
|
29
29
|
// "all checks passed" — agent confirmed all checks passed
|
|
30
30
|
/\ball\s+checks\s+passed\b/i,
|
|
31
|
+
// "QA Coordination Complete" / "QA Complete" — inline text (not heading)
|
|
32
|
+
/\bQA\s+(?:Coordination\s+)?Complete\b/i,
|
|
31
33
|
];
|
|
32
34
|
const QA_FAIL_PATTERNS = [
|
|
33
35
|
// Heading patterns
|
|
@@ -128,7 +130,7 @@ export function parseWorkResult(resultMessage, workType) {
|
|
|
128
130
|
return 'passed';
|
|
129
131
|
}
|
|
130
132
|
}
|
|
131
|
-
if (workType === 'coordination') {
|
|
133
|
+
if (workType === 'coordination' || workType === 'inflight-coordination') {
|
|
132
134
|
if (COORDINATION_FAIL_PATTERNS.some((p) => p.test(resultMessage))) {
|
|
133
135
|
return 'failed';
|
|
134
136
|
}
|
|
@@ -118,6 +118,15 @@ describe('parseWorkResult', () => {
|
|
|
118
118
|
it('detects "all checks passed" as pass', () => {
|
|
119
119
|
expect(parseWorkResult('The report was posted to Linear and all checks passed.', 'qa')).toBe('passed');
|
|
120
120
|
});
|
|
121
|
+
it('detects "QA Coordination Complete" inline text as pass', () => {
|
|
122
|
+
expect(parseWorkResult('QA Coordination Complete for SUP-1145\n\nFound and fixed 2 blocking rework issues.', 'qa-coordination')).toBe('passed');
|
|
123
|
+
});
|
|
124
|
+
it('detects "QA Complete" inline text as pass', () => {
|
|
125
|
+
expect(parseWorkResult('QA Complete — all sub-issues verified.', 'qa')).toBe('passed');
|
|
126
|
+
});
|
|
127
|
+
it('fail patterns take precedence over "QA Complete" when fail indicators present', () => {
|
|
128
|
+
expect(parseWorkResult('## QA Complete\n\nStatus: 3 Issues Found\n\nQA Coordination Complete', 'qa-coordination')).toBe('failed');
|
|
129
|
+
});
|
|
121
130
|
});
|
|
122
131
|
// Acceptance heuristic pattern tests
|
|
123
132
|
describe('acceptance heuristic patterns', () => {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* - metadata.json: Session metadata
|
|
9
9
|
* - events.jsonl: Event log (JSON Lines)
|
|
10
10
|
*/
|
|
11
|
-
import type { AgentWorkType } from '
|
|
11
|
+
import type { AgentWorkType } from './work-types.js';
|
|
12
12
|
/**
|
|
13
13
|
* Session event types for categorization
|
|
14
14
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-logger.d.ts","sourceRoot":"","sources":["../../../src/orchestrator/session-logger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAUH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM
|
|
1
|
+
{"version":3,"file":"session-logger.d.ts","sourceRoot":"","sources":["../../../src/orchestrator/session-logger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAUH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAEpD;;GAEG;AACH,MAAM,MAAM,gBAAgB,GACxB,MAAM,GACN,UAAU,GACV,aAAa,GACb,WAAW,GACX,MAAM,GACN,OAAO,GACP,SAAS,GACT,QAAQ,GACR,UAAU,GACV,MAAM,CAAA;AAEV;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,oCAAoC;IACpC,SAAS,EAAE,MAAM,CAAA;IACjB,oCAAoC;IACpC,IAAI,EAAE,gBAAgB,CAAA;IACtB,kDAAkD;IAClD,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,4BAA4B;IAC5B,OAAO,EAAE,MAAM,GAAG,MAAM,CAAA;IACxB,gCAAgC;IAChC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,0BAA0B;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACnC;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,wBAAwB;IACxB,SAAS,EAAE,MAAM,CAAA;IACjB,sBAAsB;IACtB,OAAO,EAAE,MAAM,CAAA;IACf,sCAAsC;IACtC,eAAe,EAAE,MAAM,CAAA;IACvB,mCAAmC;IACnC,QAAQ,EAAE,aAAa,CAAA;IACvB,qBAAqB;IACrB,MAAM,EAAE,MAAM,CAAA;I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
|
* Enables crash recovery and duplicate agent prevention.
|
|
6
6
|
*/
|
|
7
7
|
import type { WorktreeState, HeartbeatState, TodosState, RecoveryCheckResult } from './state-types.js';
|
|
8
|
-
import type { AgentWorkType } from '
|
|
8
|
+
import type { AgentWorkType } from './work-types.js';
|
|
9
9
|
/**
|
|
10
10
|
* Get the .agent directory path for a worktree
|
|
11
11
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state-recovery.d.ts","sourceRoot":"","sources":["../../../src/orchestrator/state-recovery.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EACV,aAAa,EACb,cAAc,EACd,UAAU,EACV,mBAAmB,EAEpB,MAAM,kBAAkB,CAAA;AACzB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM
|
|
1
|
+
{"version":3,"file":"state-recovery.d.ts","sourceRoot":"","sources":["../../../src/orchestrator/state-recovery.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EACV,aAAa,EACb,cAAc,EACd,UAAU,EACV,mBAAmB,EAEpB,MAAM,kBAAkB,CAAA;AACzB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAQpD;;GAEG;AACH,wBAAgB,WAAW,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAExD;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAE7D;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAEzD;AAeD;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,cAAc,GAAG,IAAI,EAChC,SAAS,GAAE,MAAqC,GAC/C,OAAO,CAIT;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,MAAM,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;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,aAAa,EACpB,KAAK,CAAC,EAAE,UAAU,GACjB,MAAM,CA6CR;AAED;;GAEG;AACH,wBAAgB,0BAA0B,IAAI,MAAM,CASnD;AAED;;GAEG;AACH,wBAAgB,6BAA6B,IAAI,MAAM,CAStD"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Types for persisting agent state to the .agent/ directory within each worktree.
|
|
5
5
|
* This enables crash recovery, heartbeat monitoring, and progress tracking.
|
|
6
6
|
*/
|
|
7
|
-
import type { AgentWorkType } from '
|
|
7
|
+
import type { AgentWorkType } from './work-types.js';
|
|
8
8
|
/**
|
|
9
9
|
* Status of the agent's work in the worktree
|
|
10
10
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state-types.d.ts","sourceRoot":"","sources":["../../../src/orchestrator/state-types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM
|
|
1
|
+
{"version":3,"file":"state-types.d.ts","sourceRoot":"","sources":["../../../src/orchestrator/state-types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAEpD;;GAEG;AACH,MAAM,MAAM,cAAc,GACtB,cAAc,GACd,SAAS,GACT,YAAY,GACZ,WAAW,GACX,QAAQ,GACR,SAAS,CAAA;AAEb;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,6BAA6B;IAC7B,OAAO,EAAE,MAAM,CAAA;IACf,sDAAsD;IACtD,eAAe,EAAE,MAAM,CAAA;IACvB,4CAA4C;IAC5C,eAAe,EAAE,MAAM,GAAG,IAAI,CAAA;IAC9B,0DAA0D;IAC1D,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAA;IAChC,mCAAmC;IACnC,QAAQ,EAAE,aAAa,CAAA;IACvB,6CAA6C;IAC7C,MAAM,E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AAE,MAAM,CAAA;IAChB,oEAAoE;IACpE,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Agent Orchestrator Types
|
|
3
3
|
*/
|
|
4
|
-
import type { AgentWorkType } from '
|
|
4
|
+
import type { AgentWorkType, WorkTypeStatusMappings } from './work-types.js';
|
|
5
5
|
import type { AgentProvider, AgentProviderName } from '../providers/types.js';
|
|
6
|
+
import type { IssueTrackerClient } from './issue-tracker-client.js';
|
|
7
|
+
import type { ToolPlugin } from '../tools/types.js';
|
|
6
8
|
/**
|
|
7
9
|
* Result of parsing an agent's output to determine pass/fail
|
|
8
10
|
* Used for QA and acceptance work types to decide status transitions
|
|
@@ -26,8 +28,26 @@ export interface OrchestratorConfig {
|
|
|
26
28
|
project?: string;
|
|
27
29
|
/** Base path for git worktrees (default: .worktrees) */
|
|
28
30
|
worktreePath?: string;
|
|
29
|
-
/**
|
|
31
|
+
/**
|
|
32
|
+
* Linear API key (defaults to LINEAR_API_KEY env var).
|
|
33
|
+
* @deprecated Use issueTrackerClient instead. Kept for backwards compatibility.
|
|
34
|
+
*/
|
|
30
35
|
linearApiKey?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Platform-agnostic issue tracker client.
|
|
38
|
+
* When provided, the orchestrator uses this instead of creating a Linear client from linearApiKey.
|
|
39
|
+
*/
|
|
40
|
+
issueTrackerClient?: IssueTrackerClient;
|
|
41
|
+
/**
|
|
42
|
+
* Status mapping configuration for the issue tracker.
|
|
43
|
+
* Required when using issueTrackerClient. Defines how statuses map to work types.
|
|
44
|
+
*/
|
|
45
|
+
statusMappings?: WorkTypeStatusMappings;
|
|
46
|
+
/**
|
|
47
|
+
* Tool plugins to register with the orchestrator.
|
|
48
|
+
* These are registered in addition to any built-in plugins.
|
|
49
|
+
*/
|
|
50
|
+
toolPlugins?: ToolPlugin[];
|
|
31
51
|
/** Whether to auto-transition issue status (default: true) */
|
|
32
52
|
autoTransition?: boolean;
|
|
33
53
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/orchestrator/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/orchestrator/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAA;AAC5E,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AAC7E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AACnE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAEnD;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAA;AAE7D;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,4DAA4D;IAC5D,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,kEAAkE;IAClE,mBAAmB,CAAC,EAAE,MAAM,CAAA;CAC7B;AAED,MAAM,WAAW,kBAAkB;IACjC,sGAAsG;IACtG,QAAQ,CAAC,EAAE,aAAa,CAAA;IACxB,6CAA6C;IAC7C,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,4CAA4C;IAC5C,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,wDAAwD;IACxD,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB;;;OAGG;IACH,kBAAkB,CAAC,EAAE,kBAAkB,CAAA;IACvC;;;OAGG;IACH,cAAc,CAAC,EAAE,sBAAsB,CAAA;IACvC;;;OAGG;IACH,WAAW,CAAC,EAAE,UAAU,EAAE,CAAA;IAC1B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AA6D;IAC7D,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,iDAAiD;IACjD,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,+EAA+E;IAC/E,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;IACjB,+FAA+F;IAC/F,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Platform-Agnostic Work Types
|
|
3
|
+
*
|
|
4
|
+
* Core-owned types for agent work type routing, status mappings,
|
|
5
|
+
* and environment issue tracking. These replace direct imports from
|
|
6
|
+
* the Linear package, enabling core to remain platform-independent.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Agent work type — determines prompt template, status transitions,
|
|
10
|
+
* and whether a git worktree is needed.
|
|
11
|
+
*/
|
|
12
|
+
export type AgentWorkType = 'research' | 'backlog-creation' | 'development' | 'inflight' | 'inflight-coordination' | 'qa' | 'acceptance' | 'refinement' | 'refinement-coordination' | 'coordination' | 'qa-coordination' | 'acceptance-coordination';
|
|
13
|
+
/**
|
|
14
|
+
* Workflow status — platform-agnostic string (e.g., 'Started', 'Finished').
|
|
15
|
+
* Concrete values are defined by the issue tracker plugin.
|
|
16
|
+
*/
|
|
17
|
+
export type WorkflowStatus = string;
|
|
18
|
+
/**
|
|
19
|
+
* Status mapping configuration injected by the issue tracker plugin.
|
|
20
|
+
* Maps between issue statuses and agent work types.
|
|
21
|
+
*/
|
|
22
|
+
export interface WorkTypeStatusMappings {
|
|
23
|
+
/** Map issue status name → work type (e.g., 'Backlog' → 'development') */
|
|
24
|
+
statusToWorkType: Record<string, AgentWorkType>;
|
|
25
|
+
/** Map work type → status to set when agent starts (null = no transition) */
|
|
26
|
+
workTypeStartStatus: Record<AgentWorkType, string | null>;
|
|
27
|
+
/** Map work type → status to set when agent completes successfully */
|
|
28
|
+
workTypeCompleteStatus: Record<AgentWorkType, string | null>;
|
|
29
|
+
/** Map work type → status to set when agent fails */
|
|
30
|
+
workTypeFailStatus: Record<AgentWorkType, string | null>;
|
|
31
|
+
/** Statuses that indicate an issue is terminal (no further work) */
|
|
32
|
+
terminalStatuses: readonly string[];
|
|
33
|
+
/** Work types that require a git worktree */
|
|
34
|
+
workTypesRequiringWorktree: ReadonlySet<AgentWorkType>;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Environment issue type constants for categorizing agent environment problems.
|
|
38
|
+
*/
|
|
39
|
+
export declare const ENVIRONMENT_ISSUE_TYPES: {
|
|
40
|
+
readonly PERMISSION: "permission";
|
|
41
|
+
readonly NETWORK: "network";
|
|
42
|
+
readonly SANDBOX: "sandbox";
|
|
43
|
+
readonly LINEAR_CLI: "linear-cli";
|
|
44
|
+
readonly DEPENDENCY: "dependency";
|
|
45
|
+
readonly TIMEOUT: "timeout";
|
|
46
|
+
readonly TOOL: "tool";
|
|
47
|
+
readonly HUMAN_BLOCKER: "human-blocker";
|
|
48
|
+
};
|
|
49
|
+
export type EnvironmentIssueType = (typeof ENVIRONMENT_ISSUE_TYPES)[keyof typeof ENVIRONMENT_ISSUE_TYPES];
|
|
50
|
+
//# sourceMappingURL=work-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"work-types.d.ts","sourceRoot":"","sources":["../../../src/orchestrator/work-types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;GAGG;AACH,MAAM,MAAM,aAAa,GACrB,UAAU,GACV,kBAAkB,GAClB,aAAa,GACb,UAAU,GACV,uBAAuB,GACvB,IAAI,GACJ,YAAY,GACZ,YAAY,GACZ,yBAAyB,GACzB,cAAc,GACd,iBAAiB,GACjB,yBAAyB,CAAA;AAE7B;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,CAAA;AAEnC;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,0EAA0E;IAC1E,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAA;IAC/C,6EAA6E;IAC7E,mBAAmB,EAAE,MAAM,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC,CAAA;IACzD,sEAAsE;IACtE,sBAAsB,EAAE,MAAM,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC,CAAA;IAC5D,qDAAqD;IACrD,kBAAkB,EAAE,MAAM,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC,CAAA;IACxD,oEAAoE;IACpE,gBAAgB,EAAE,SAAS,MAAM,EAAE,CAAA;IACnC,6CAA6C;IAC7C,0BAA0B,EAAE,WAAW,CAAC,aAAa,CAAC,CAAA;CACvD;AAED;;GAEG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;CAS1B,CAAA;AAEV,MAAM,MAAM,oBAAoB,GAC9B,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,OAAO,uBAAuB,CAAC,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Platform-Agnostic Work Types
|
|
3
|
+
*
|
|
4
|
+
* Core-owned types for agent work type routing, status mappings,
|
|
5
|
+
* and environment issue tracking. These replace direct imports from
|
|
6
|
+
* the Linear package, enabling core to remain platform-independent.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Environment issue type constants for categorizing agent environment problems.
|
|
10
|
+
*/
|
|
11
|
+
export const ENVIRONMENT_ISSUE_TYPES = {
|
|
12
|
+
PERMISSION: 'permission',
|
|
13
|
+
NETWORK: 'network',
|
|
14
|
+
SANDBOX: 'sandbox',
|
|
15
|
+
LINEAR_CLI: 'linear-cli',
|
|
16
|
+
DEPENDENCY: 'dependency',
|
|
17
|
+
TIMEOUT: 'timeout',
|
|
18
|
+
TOOL: 'tool',
|
|
19
|
+
HUMAN_BLOCKER: 'human-blocker',
|
|
20
|
+
};
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Supports layered resolution with built-in defaults, project overrides,
|
|
6
6
|
* and inline config overrides.
|
|
7
7
|
*/
|
|
8
|
-
import type { AgentWorkType } from '
|
|
8
|
+
import type { AgentWorkType } from '../orchestrator/work-types.js';
|
|
9
9
|
import type { WorkflowTemplate, TemplateContext, TemplateRegistryConfig, ToolPermission, ToolPermissionAdapter } from './types.js';
|
|
10
10
|
/**
|
|
11
11
|
* Template Registry manages workflow templates and renders prompts.
|
|
@@ -127,9 +127,9 @@ describe('TemplateRegistry', () => {
|
|
|
127
127
|
describe('built-in defaults', () => {
|
|
128
128
|
it('loads built-in default templates when useBuiltinDefaults is true', () => {
|
|
129
129
|
const fullRegistry = TemplateRegistry.create({ useBuiltinDefaults: true });
|
|
130
|
-
// Should have loaded templates for all
|
|
130
|
+
// Should have loaded templates for all 12 base work types + 5 strategy templates
|
|
131
131
|
const workTypes = fullRegistry.getRegisteredWorkTypes();
|
|
132
|
-
expect(workTypes.length).toBe(
|
|
132
|
+
expect(workTypes.length).toBe(17);
|
|
133
133
|
expect(workTypes).toContain('development');
|
|
134
134
|
expect(workTypes).toContain('qa');
|
|
135
135
|
expect(workTypes).toContain('coordination');
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* functions. Provides a drop-in replacement for generatePromptForWorkType
|
|
6
6
|
* that uses templates when available and falls back to hardcoded prompts.
|
|
7
7
|
*/
|
|
8
|
-
import type { AgentWorkType } from '
|
|
8
|
+
import type { AgentWorkType } from '../orchestrator/work-types.js';
|
|
9
9
|
import type { TemplateContext } from './types.js';
|
|
10
10
|
import type { TemplateRegistry } from './registry.js';
|
|
11
11
|
/**
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
* - Frontend-specific content in partials only
|
|
14
14
|
*/
|
|
15
15
|
import { z } from 'zod';
|
|
16
|
-
import type { AgentWorkType } from '
|
|
17
|
-
export type { AgentWorkType } from '
|
|
16
|
+
import type { AgentWorkType } from '../orchestrator/work-types.js';
|
|
17
|
+
export type { AgentWorkType } from '../orchestrator/work-types.js';
|
|
18
18
|
/**
|
|
19
19
|
* Provider-agnostic tool permission.
|
|
20
20
|
*
|
|
@@ -144,6 +144,7 @@ export declare const AgentWorkTypeSchema: z.ZodEnum<{
|
|
|
144
144
|
"backlog-creation": "backlog-creation";
|
|
145
145
|
development: "development";
|
|
146
146
|
inflight: "inflight";
|
|
147
|
+
"inflight-coordination": "inflight-coordination";
|
|
147
148
|
qa: "qa";
|
|
148
149
|
acceptance: "acceptance";
|
|
149
150
|
refinement: "refinement";
|
|
@@ -166,6 +167,7 @@ export declare const WorkflowTemplateSchema: z.ZodObject<{
|
|
|
166
167
|
"backlog-creation": "backlog-creation";
|
|
167
168
|
development: "development";
|
|
168
169
|
inflight: "inflight";
|
|
170
|
+
"inflight-coordination": "inflight-coordination";
|
|
169
171
|
qa: "qa";
|
|
170
172
|
acceptance: "acceptance";
|
|
171
173
|
refinement: "refinement";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/templates/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAGlE,YAAY,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAMlE;;;;;;;GAOG;AACH,MAAM,MAAM,cAAc,GACtB;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GACjB,YAAY,GACZ,MAAM,CAAA;AAMV;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,IAAI,CAAA;IAChB,IAAI,EAAE,kBAAkB,CAAA;IACxB,QAAQ,EAAE;QACR,IAAI,EAAE,MAAM,CAAA;QACZ,WAAW,CAAC,EAAE,MAAM,CAAA;QACpB,QAAQ,EAAE,aAAa,CAAA;KACxB,CAAA;IACD,KAAK,CAAC,EAAE;QACN,KAAK,CAAC,EAAE,cAAc,EAAE,CAAA;QACxB,QAAQ,CAAC,EAAE,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,EAAE,MAAM,CAAA;IACjB,6DAA6D;IAC7D,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAsBD,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;EAAqB,CAAA;AAErD,eAAO,MAAM,oBAAoB;;4DAI/B,CAAA;AAEF,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAajC,CAAA;AAEF,eAAO,MAAM,qBAAqB;;;;;;;;;iBAShC,CAAA;AAEF,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;iBA+BhC,CAAA;AAMF;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,gBAAgB,CAS3F;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,eAAe,CASzF"}
|
|
@@ -105,11 +105,12 @@ describe('PartialTemplateSchema', () => {
|
|
|
105
105
|
});
|
|
106
106
|
});
|
|
107
107
|
describe('AgentWorkTypeSchema', () => {
|
|
108
|
-
it('accepts all
|
|
108
|
+
it('accepts all 12 work types', () => {
|
|
109
109
|
const workTypes = [
|
|
110
110
|
'research', 'backlog-creation', 'development', 'inflight',
|
|
111
|
-
'
|
|
112
|
-
'qa-coordination', 'acceptance-coordination',
|
|
111
|
+
'inflight-coordination', 'qa', 'acceptance', 'refinement',
|
|
112
|
+
'coordination', 'qa-coordination', 'acceptance-coordination',
|
|
113
|
+
'refinement-coordination',
|
|
113
114
|
];
|
|
114
115
|
for (const wt of workTypes) {
|
|
115
116
|
expect(AgentWorkTypeSchema.parse(wt)).toBe(wt);
|
|
@@ -1,6 +1,3 @@
|
|
|
1
1
|
export { ToolRegistry } from './registry.js';
|
|
2
2
|
export type { ToolPlugin, ToolPluginContext } from './types.js';
|
|
3
|
-
export { linearPlugin } from './plugins/linear.js';
|
|
4
|
-
export { runLinear, parseLinearArgs } from './linear-runner.js';
|
|
5
|
-
export type { LinearRunnerConfig, LinearRunnerResult } from './linear-runner.js';
|
|
6
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAC5C,YAAY,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAC5C,YAAY,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA"}
|
package/dist/src/tools/index.js
CHANGED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workflow Definition System
|
|
3
|
+
*
|
|
4
|
+
* Declarative workflow graph definitions using YAML (v1.1 schema extension).
|
|
5
|
+
* Defines phases, transitions, escalation ladder, gates, and parallelism.
|
|
6
|
+
*/
|
|
7
|
+
export type { EscalationStrategy, PhaseDefinition, TransitionDefinition, EscalationLadderRung, EscalationConfig, GateDefinition, ParallelismGroupDefinition, WorkflowDefinition, } from './workflow-types.js';
|
|
8
|
+
export { PhaseDefinitionSchema, TransitionDefinitionSchema, EscalationLadderRungSchema, EscalationConfigSchema, GateDefinitionSchema, ParallelismGroupDefinitionSchema, WorkflowDefinitionSchema, validateWorkflowDefinition, } from './workflow-types.js';
|
|
9
|
+
export { loadWorkflowDefinitionFile, getBuiltinWorkflowDir, getBuiltinWorkflowPath, } from './workflow-loader.js';
|
|
10
|
+
export type { WorkflowRegistryConfig } from './workflow-registry.js';
|
|
11
|
+
export { WorkflowRegistry } from './workflow-registry.js';
|
|
12
|
+
export type { TransitionContext, TransitionResult } from './transition-engine.js';
|
|
13
|
+
export { evaluateTransitions } from './transition-engine.js';
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/workflow/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,YAAY,EACV,kBAAkB,EAClB,eAAe,EACf,oBAAoB,EACpB,oBAAoB,EACpB,gBAAgB,EAChB,cAAc,EACd,0BAA0B,EAC1B,kBAAkB,GACnB,MAAM,qBAAqB,CAAA;AAE5B,OAAO,EACL,qBAAqB,EACrB,0BAA0B,EAC1B,0BAA0B,EAC1B,sBAAsB,EACtB,oBAAoB,EACpB,gCAAgC,EAChC,wBAAwB,EACxB,0BAA0B,GAC3B,MAAM,qBAAqB,CAAA;AAE5B,OAAO,EACL,0BAA0B,EAC1B,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,sBAAsB,CAAA;AAE7B,YAAY,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAA;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAEzD,YAAY,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AACjF,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workflow Definition System
|
|
3
|
+
*
|
|
4
|
+
* Declarative workflow graph definitions using YAML (v1.1 schema extension).
|
|
5
|
+
* Defines phases, transitions, escalation ladder, gates, and parallelism.
|
|
6
|
+
*/
|
|
7
|
+
export { PhaseDefinitionSchema, TransitionDefinitionSchema, EscalationLadderRungSchema, EscalationConfigSchema, GateDefinitionSchema, ParallelismGroupDefinitionSchema, WorkflowDefinitionSchema, validateWorkflowDefinition, } from './workflow-types.js';
|
|
8
|
+
export { loadWorkflowDefinitionFile, getBuiltinWorkflowDir, getBuiltinWorkflowPath, } from './workflow-loader.js';
|
|
9
|
+
export { WorkflowRegistry } from './workflow-registry.js';
|
|
10
|
+
export { evaluateTransitions } from './transition-engine.js';
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Transition Engine
|
|
3
|
+
*
|
|
4
|
+
* Pure function that evaluates the WorkflowDefinition's transition table
|
|
5
|
+
* against the current issue status and context to determine which phase
|
|
6
|
+
* (and therefore which GovernorAction) should fire.
|
|
7
|
+
*
|
|
8
|
+
* This replaces the hard-coded switch statement in decision-engine.ts.
|
|
9
|
+
* Like decideAction(), the transition engine performs no I/O.
|
|
10
|
+
*/
|
|
11
|
+
import type { GovernorAction, GovernorIssue } from '../governor/governor-types.js';
|
|
12
|
+
import type { WorkflowRegistry } from './workflow-registry.js';
|
|
13
|
+
/**
|
|
14
|
+
* Runtime context passed to the transition engine alongside the issue
|
|
15
|
+
* and workflow definition. Includes all the external state needed
|
|
16
|
+
* for escalation and conditional routing.
|
|
17
|
+
*/
|
|
18
|
+
export interface TransitionContext {
|
|
19
|
+
issue: GovernorIssue;
|
|
20
|
+
registry: WorkflowRegistry;
|
|
21
|
+
/** Current escalation strategy from WorkflowState */
|
|
22
|
+
workflowStrategy?: string;
|
|
23
|
+
/** Whether the issue is a parent (has sub-issues) */
|
|
24
|
+
isParentIssue: boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface TransitionResult {
|
|
27
|
+
/** The GovernorAction to take, or 'none' if no transition matched */
|
|
28
|
+
action: GovernorAction;
|
|
29
|
+
/** Human-readable reason for the decision */
|
|
30
|
+
reason: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Evaluate the workflow definition's transition table for the given
|
|
34
|
+
* issue and context. Returns the action and reason.
|
|
35
|
+
*
|
|
36
|
+
* The evaluation order is:
|
|
37
|
+
* 1. Filter transitions whose `from` matches the issue status
|
|
38
|
+
* 2. Sort by priority (higher first), then by definition order
|
|
39
|
+
* 3. Pick the first matching transition (conditions are Phase 3)
|
|
40
|
+
* 4. Check escalation strategy for override actions (decompose, escalate-human)
|
|
41
|
+
* 5. Map the target phase name to a GovernorAction
|
|
42
|
+
*/
|
|
43
|
+
export declare function evaluateTransitions(ctx: TransitionContext): TransitionResult;
|
|
44
|
+
//# sourceMappingURL=transition-engine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transition-engine.d.ts","sourceRoot":"","sources":["../../../src/workflow/transition-engine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAElF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAM9D;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,aAAa,CAAA;IACpB,QAAQ,EAAE,gBAAgB,CAAA;IAC1B,qDAAqD;IACrD,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,qDAAqD;IACrD,aAAa,EAAE,OAAO,CAAA;CACvB;AAMD,MAAM,WAAW,gBAAgB;IAC/B,qEAAqE;IACrE,MAAM,EAAE,cAAc,CAAA;IACtB,6CAA6C;IAC7C,MAAM,EAAE,MAAM,CAAA;CACf;AAmCD;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,iBAAiB,GAAG,gBAAgB,CAkE5E"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Transition Engine
|
|
3
|
+
*
|
|
4
|
+
* Pure function that evaluates the WorkflowDefinition's transition table
|
|
5
|
+
* against the current issue status and context to determine which phase
|
|
6
|
+
* (and therefore which GovernorAction) should fire.
|
|
7
|
+
*
|
|
8
|
+
* This replaces the hard-coded switch statement in decision-engine.ts.
|
|
9
|
+
* Like decideAction(), the transition engine performs no I/O.
|
|
10
|
+
*/
|
|
11
|
+
// ---------------------------------------------------------------------------
|
|
12
|
+
// Phase-to-action mapping
|
|
13
|
+
// ---------------------------------------------------------------------------
|
|
14
|
+
/**
|
|
15
|
+
* Map a workflow phase name to a GovernorAction.
|
|
16
|
+
*
|
|
17
|
+
* Phase names in the YAML correspond to work types which have a
|
|
18
|
+
* conventional "trigger-{phase}" action form.
|
|
19
|
+
*/
|
|
20
|
+
const PHASE_ACTION_MAP = {
|
|
21
|
+
'research': 'trigger-research',
|
|
22
|
+
'backlog-creation': 'trigger-backlog-creation',
|
|
23
|
+
'development': 'trigger-development',
|
|
24
|
+
'qa': 'trigger-qa',
|
|
25
|
+
'acceptance': 'trigger-acceptance',
|
|
26
|
+
'refinement': 'trigger-refinement',
|
|
27
|
+
// Coordination phases still map to the same trigger action;
|
|
28
|
+
// the orchestrator resolves the coordination template via isParentIssue.
|
|
29
|
+
'coordination': 'trigger-development',
|
|
30
|
+
'qa-coordination': 'trigger-qa',
|
|
31
|
+
'acceptance-coordination': 'trigger-acceptance',
|
|
32
|
+
'refinement-coordination': 'trigger-refinement',
|
|
33
|
+
};
|
|
34
|
+
function phaseToAction(phaseName) {
|
|
35
|
+
return PHASE_ACTION_MAP[phaseName];
|
|
36
|
+
}
|
|
37
|
+
// ---------------------------------------------------------------------------
|
|
38
|
+
// Transition Engine
|
|
39
|
+
// ---------------------------------------------------------------------------
|
|
40
|
+
/**
|
|
41
|
+
* Evaluate the workflow definition's transition table for the given
|
|
42
|
+
* issue and context. Returns the action and reason.
|
|
43
|
+
*
|
|
44
|
+
* The evaluation order is:
|
|
45
|
+
* 1. Filter transitions whose `from` matches the issue status
|
|
46
|
+
* 2. Sort by priority (higher first), then by definition order
|
|
47
|
+
* 3. Pick the first matching transition (conditions are Phase 3)
|
|
48
|
+
* 4. Check escalation strategy for override actions (decompose, escalate-human)
|
|
49
|
+
* 5. Map the target phase name to a GovernorAction
|
|
50
|
+
*/
|
|
51
|
+
export function evaluateTransitions(ctx) {
|
|
52
|
+
const { issue, registry, workflowStrategy, isParentIssue } = ctx;
|
|
53
|
+
const workflow = registry.getWorkflow();
|
|
54
|
+
if (!workflow) {
|
|
55
|
+
return { action: 'none', reason: 'No workflow definition loaded' };
|
|
56
|
+
}
|
|
57
|
+
// Find transitions matching current status, sorted by priority (desc)
|
|
58
|
+
const candidates = workflow.transitions
|
|
59
|
+
.filter((t) => t.from === issue.status)
|
|
60
|
+
.sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0));
|
|
61
|
+
if (candidates.length === 0) {
|
|
62
|
+
return {
|
|
63
|
+
action: 'none',
|
|
64
|
+
reason: `No transitions defined for status '${issue.status}' in workflow '${workflow.metadata.name}'`,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
// Phase 2: Pick the first unconditional transition, or the first
|
|
68
|
+
// transition that has a condition (conditions are not evaluated until Phase 3;
|
|
69
|
+
// for now, transitions with conditions are skipped).
|
|
70
|
+
const match = candidates.find((t) => !t.condition) ?? null;
|
|
71
|
+
if (!match) {
|
|
72
|
+
return {
|
|
73
|
+
action: 'none',
|
|
74
|
+
reason: `All transitions for status '${issue.status}' have conditions (evaluation deferred to Phase 3)`,
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
// Check escalation strategy overrides.
|
|
78
|
+
// When strategy is 'escalate-human' or 'decompose', these take priority
|
|
79
|
+
// over the normal phase transition — matching the current behavior in
|
|
80
|
+
// decideFinished() and decideRejected().
|
|
81
|
+
if (workflowStrategy === 'escalate-human') {
|
|
82
|
+
return {
|
|
83
|
+
action: 'escalate-human',
|
|
84
|
+
reason: `Issue ${issue.identifier} in '${issue.status}' with escalate-human strategy — needs human intervention`,
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
if (workflowStrategy === 'decompose') {
|
|
88
|
+
return {
|
|
89
|
+
action: 'decompose',
|
|
90
|
+
reason: `Issue ${issue.identifier} in '${issue.status}' with decompose strategy — triggering decomposition`,
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
// Map phase name to action
|
|
94
|
+
const action = phaseToAction(match.to);
|
|
95
|
+
if (!action) {
|
|
96
|
+
return {
|
|
97
|
+
action: 'none',
|
|
98
|
+
reason: `Phase '${match.to}' does not map to a known GovernorAction`,
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
const parentSuffix = isParentIssue ? ' (parent — uses coordination template)' : '';
|
|
102
|
+
return {
|
|
103
|
+
action,
|
|
104
|
+
reason: `Issue ${issue.identifier} in '${issue.status}' → phase '${match.to}'${parentSuffix}`,
|
|
105
|
+
};
|
|
106
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transition-engine.test.d.ts","sourceRoot":"","sources":["../../../src/workflow/transition-engine.test.ts"],"names":[],"mappings":""}
|