@renseiai/agentfactory 0.8.12 → 0.8.14
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/src/config/repository-config.d.ts +24 -0
- package/dist/src/config/repository-config.d.ts.map +1 -1
- package/dist/src/config/repository-config.js +21 -0
- package/dist/src/config/repository-config.test.js +202 -0
- package/dist/src/governor/decision-engine.d.ts +2 -0
- package/dist/src/governor/decision-engine.d.ts.map +1 -1
- package/dist/src/governor/decision-engine.js +7 -0
- package/dist/src/governor/decision-engine.test.js +63 -0
- package/dist/src/governor/governor-types.d.ts +2 -1
- package/dist/src/governor/governor-types.d.ts.map +1 -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/merge-queue/conflict-resolver.d.ts +62 -0
- package/dist/src/merge-queue/conflict-resolver.d.ts.map +1 -0
- package/dist/src/merge-queue/conflict-resolver.js +168 -0
- package/dist/src/merge-queue/conflict-resolver.test.d.ts +2 -0
- package/dist/src/merge-queue/conflict-resolver.test.d.ts.map +1 -0
- package/dist/src/merge-queue/conflict-resolver.test.js +405 -0
- package/dist/src/merge-queue/lock-file-regeneration.d.ts +14 -0
- package/dist/src/merge-queue/lock-file-regeneration.d.ts.map +1 -0
- package/dist/src/merge-queue/lock-file-regeneration.js +82 -0
- package/dist/src/merge-queue/lock-file-regeneration.test.d.ts +2 -0
- package/dist/src/merge-queue/lock-file-regeneration.test.d.ts.map +1 -0
- package/dist/src/merge-queue/lock-file-regeneration.test.js +236 -0
- package/dist/src/merge-queue/merge-worker.d.ts +79 -0
- package/dist/src/merge-queue/merge-worker.d.ts.map +1 -0
- package/dist/src/merge-queue/merge-worker.js +221 -0
- package/dist/src/merge-queue/merge-worker.test.d.ts +2 -0
- package/dist/src/merge-queue/merge-worker.test.d.ts.map +1 -0
- package/dist/src/merge-queue/merge-worker.test.js +883 -0
- package/dist/src/merge-queue/strategies/index.d.ts +19 -0
- package/dist/src/merge-queue/strategies/index.d.ts.map +1 -0
- package/dist/src/merge-queue/strategies/index.js +30 -0
- package/dist/src/merge-queue/strategies/merge-commit-strategy.d.ts +14 -0
- package/dist/src/merge-queue/strategies/merge-commit-strategy.d.ts.map +1 -0
- package/dist/src/merge-queue/strategies/merge-commit-strategy.js +58 -0
- package/dist/src/merge-queue/strategies/rebase-strategy.d.ts +14 -0
- package/dist/src/merge-queue/strategies/rebase-strategy.d.ts.map +1 -0
- package/dist/src/merge-queue/strategies/rebase-strategy.js +62 -0
- package/dist/src/merge-queue/strategies/squash-strategy.d.ts +14 -0
- package/dist/src/merge-queue/strategies/squash-strategy.d.ts.map +1 -0
- package/dist/src/merge-queue/strategies/squash-strategy.js +59 -0
- package/dist/src/merge-queue/strategies/strategies.test.d.ts +2 -0
- package/dist/src/merge-queue/strategies/strategies.test.d.ts.map +1 -0
- package/dist/src/merge-queue/strategies/strategies.test.js +354 -0
- package/dist/src/merge-queue/strategies/types.d.ts +62 -0
- package/dist/src/merge-queue/strategies/types.d.ts.map +1 -0
- package/dist/src/merge-queue/strategies/types.js +7 -0
- package/dist/src/orchestrator/completion-contracts.d.ts +89 -0
- package/dist/src/orchestrator/completion-contracts.d.ts.map +1 -0
- package/dist/src/orchestrator/completion-contracts.js +228 -0
- package/dist/src/orchestrator/completion-contracts.test.d.ts +2 -0
- package/dist/src/orchestrator/completion-contracts.test.d.ts.map +1 -0
- package/dist/src/orchestrator/completion-contracts.test.js +195 -0
- 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 +3 -0
- package/dist/src/orchestrator/orchestrator.d.ts +32 -0
- package/dist/src/orchestrator/orchestrator.d.ts.map +1 -1
- package/dist/src/orchestrator/orchestrator.js +157 -26
- package/dist/src/orchestrator/parse-work-result.d.ts.map +1 -1
- package/dist/src/orchestrator/parse-work-result.js +22 -0
- package/dist/src/orchestrator/parse-work-result.test.js +49 -0
- package/dist/src/orchestrator/session-backstop.d.ts +67 -0
- package/dist/src/orchestrator/session-backstop.d.ts.map +1 -0
- package/dist/src/orchestrator/session-backstop.js +394 -0
- package/dist/src/orchestrator/session-backstop.test.d.ts +2 -0
- package/dist/src/orchestrator/session-backstop.test.d.ts.map +1 -0
- package/dist/src/orchestrator/session-backstop.test.js +245 -0
- package/dist/src/orchestrator/worktree-checks.test.d.ts +2 -0
- package/dist/src/orchestrator/worktree-checks.test.d.ts.map +1 -0
- package/dist/src/orchestrator/worktree-checks.test.js +159 -0
- package/dist/src/providers/a2a-provider.d.ts +4 -0
- package/dist/src/providers/a2a-provider.d.ts.map +1 -1
- package/dist/src/providers/a2a-provider.js +4 -0
- package/dist/src/providers/amp-provider.d.ts +4 -0
- package/dist/src/providers/amp-provider.d.ts.map +1 -1
- package/dist/src/providers/amp-provider.js +4 -0
- package/dist/src/providers/claude-provider.d.ts +4 -0
- package/dist/src/providers/claude-provider.d.ts.map +1 -1
- package/dist/src/providers/claude-provider.js +6 -0
- package/dist/src/providers/codex-provider.d.ts +4 -0
- package/dist/src/providers/codex-provider.d.ts.map +1 -1
- package/dist/src/providers/codex-provider.js +4 -0
- package/dist/src/providers/index.d.ts +2 -1
- package/dist/src/providers/index.d.ts.map +1 -1
- package/dist/src/providers/plugin-types.d.ts +177 -0
- package/dist/src/providers/plugin-types.d.ts.map +1 -0
- package/dist/src/providers/plugin-types.js +10 -0
- package/dist/src/providers/plugin-types.test.d.ts +2 -0
- package/dist/src/providers/plugin-types.test.d.ts.map +1 -0
- package/dist/src/providers/plugin-types.test.js +810 -0
- package/dist/src/providers/spring-ai-provider.d.ts +4 -0
- package/dist/src/providers/spring-ai-provider.d.ts.map +1 -1
- package/dist/src/providers/spring-ai-provider.js +4 -0
- package/dist/src/providers/types.d.ts +22 -0
- package/dist/src/providers/types.d.ts.map +1 -1
- package/dist/src/registry/index.d.ts +4 -0
- package/dist/src/registry/index.d.ts.map +1 -0
- package/dist/src/registry/index.js +2 -0
- package/dist/src/registry/loader.d.ts +25 -0
- package/dist/src/registry/loader.d.ts.map +1 -0
- package/dist/src/registry/loader.js +88 -0
- package/dist/src/registry/node-type-registry.d.ts +52 -0
- package/dist/src/registry/node-type-registry.d.ts.map +1 -0
- package/dist/src/registry/node-type-registry.js +130 -0
- package/dist/src/registry/types.d.ts +65 -0
- package/dist/src/registry/types.d.ts.map +1 -0
- package/dist/src/registry/types.js +10 -0
- package/dist/src/templates/types.d.ts +3 -0
- package/dist/src/templates/types.d.ts.map +1 -1
- package/dist/src/templates/types.js +2 -0
- package/dist/src/tools/index.d.ts +1 -0
- package/dist/src/tools/index.d.ts.map +1 -1
- package/dist/src/tools/registry.d.ts +6 -1
- package/dist/src/tools/registry.d.ts.map +1 -1
- package/dist/src/tools/registry.js +5 -1
- package/dist/src/workflow/expression/ast.d.ts +1 -1
- package/dist/src/workflow/expression/ast.d.ts.map +1 -1
- package/dist/src/workflow/expression/context.d.ts +4 -0
- package/dist/src/workflow/expression/context.d.ts.map +1 -1
- package/dist/src/workflow/expression/context.js +5 -1
- package/dist/src/workflow/expression/evaluator.d.ts.map +1 -1
- package/dist/src/workflow/expression/evaluator.js +24 -1
- package/dist/src/workflow/expression/evaluator.test.js +174 -0
- package/dist/src/workflow/expression/expression.test.js +140 -1
- package/dist/src/workflow/expression/helpers.d.ts +4 -0
- package/dist/src/workflow/expression/helpers.d.ts.map +1 -1
- package/dist/src/workflow/expression/helpers.js +51 -0
- package/dist/src/workflow/expression/index.d.ts +14 -0
- package/dist/src/workflow/expression/index.d.ts.map +1 -1
- package/dist/src/workflow/expression/index.js +28 -1
- package/dist/src/workflow/expression/lexer.d.ts.map +1 -1
- package/dist/src/workflow/expression/lexer.js +43 -0
- package/dist/src/workflow/expression/parser.js +1 -1
- package/dist/src/workflow/index.d.ts +3 -3
- package/dist/src/workflow/index.d.ts.map +1 -1
- package/dist/src/workflow/index.js +4 -2
- package/dist/src/workflow/workflow-loader.d.ts +8 -2
- package/dist/src/workflow/workflow-loader.d.ts.map +1 -1
- package/dist/src/workflow/workflow-loader.js +21 -2
- package/dist/src/workflow/workflow-types.d.ts +781 -12
- package/dist/src/workflow/workflow-types.d.ts.map +1 -1
- package/dist/src/workflow/workflow-types.js +248 -3
- package/dist/src/workflow/workflow-types.test.js +621 -1
- package/package.json +3 -2
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Merge Strategy Types
|
|
3
|
+
*
|
|
4
|
+
* Pluggable interface for merge strategies (rebase, merge, squash).
|
|
5
|
+
* Each strategy encapsulates how a PR branch is integrated into the target branch.
|
|
6
|
+
*/
|
|
7
|
+
/** Context passed to every merge strategy operation */
|
|
8
|
+
export interface MergeContext {
|
|
9
|
+
/** Path to the bare repository */
|
|
10
|
+
repoPath: string;
|
|
11
|
+
/** Path to the worktree used for merge operations */
|
|
12
|
+
worktreePath: string;
|
|
13
|
+
/** Branch being merged (PR branch) */
|
|
14
|
+
sourceBranch: string;
|
|
15
|
+
/** Branch being merged into (e.g. main) */
|
|
16
|
+
targetBranch: string;
|
|
17
|
+
/** Pull request number */
|
|
18
|
+
prNumber: number;
|
|
19
|
+
/** Git remote name (default 'origin') */
|
|
20
|
+
remote: string;
|
|
21
|
+
}
|
|
22
|
+
/** Result of the prepare step */
|
|
23
|
+
export interface PrepareResult {
|
|
24
|
+
/** Whether preparation succeeded */
|
|
25
|
+
success: boolean;
|
|
26
|
+
/** Error message if preparation failed */
|
|
27
|
+
error?: string;
|
|
28
|
+
/** HEAD SHA after preparation */
|
|
29
|
+
headSha?: string;
|
|
30
|
+
}
|
|
31
|
+
/** Result of the execute (merge) step */
|
|
32
|
+
export interface MergeResult {
|
|
33
|
+
/** Outcome of the merge attempt */
|
|
34
|
+
status: 'success' | 'conflict' | 'error';
|
|
35
|
+
/** SHA of the merge result commit */
|
|
36
|
+
mergedSha?: string;
|
|
37
|
+
/** List of files with conflicts (when status is 'conflict') */
|
|
38
|
+
conflictFiles?: string[];
|
|
39
|
+
/** Human-readable conflict details */
|
|
40
|
+
conflictDetails?: string;
|
|
41
|
+
/** Error message (when status is 'error') */
|
|
42
|
+
error?: string;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Pluggable merge strategy interface.
|
|
46
|
+
*
|
|
47
|
+
* Lifecycle:
|
|
48
|
+
* 1. prepare() — fetch latest refs and check out the working branch
|
|
49
|
+
* 2. execute() — perform the merge/rebase/squash operation
|
|
50
|
+
* 3. finalize() — push the result to the remote
|
|
51
|
+
*/
|
|
52
|
+
export interface MergeStrategy {
|
|
53
|
+
/** Strategy identifier */
|
|
54
|
+
readonly name: 'rebase' | 'merge' | 'squash';
|
|
55
|
+
/** Fetch latest refs and check out the working branch */
|
|
56
|
+
prepare(ctx: MergeContext): Promise<PrepareResult>;
|
|
57
|
+
/** Perform the merge operation */
|
|
58
|
+
execute(ctx: MergeContext): Promise<MergeResult>;
|
|
59
|
+
/** Push the result to the remote */
|
|
60
|
+
finalize(ctx: MergeContext): Promise<void>;
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/merge-queue/strategies/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,uDAAuD;AACvD,MAAM,WAAW,YAAY;IAC3B,kCAAkC;IAClC,QAAQ,EAAE,MAAM,CAAA;IAChB,qDAAqD;IACrD,YAAY,EAAE,MAAM,CAAA;IACpB,sCAAsC;IACtC,YAAY,EAAE,MAAM,CAAA;IACpB,2CAA2C;IAC3C,YAAY,EAAE,MAAM,CAAA;IACpB,0BAA0B;IAC1B,QAAQ,EAAE,MAAM,CAAA;IAChB,yCAAyC;IACzC,MAAM,EAAE,MAAM,CAAA;CACf;AAED,iCAAiC;AACjC,MAAM,WAAW,aAAa;IAC5B,oCAAoC;IACpC,OAAO,EAAE,OAAO,CAAA;IAChB,0CAA0C;IAC1C,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,iCAAiC;IACjC,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,yCAAyC;AACzC,MAAM,WAAW,WAAW;IAC1B,mCAAmC;IACnC,MAAM,EAAE,SAAS,GAAG,UAAU,GAAG,OAAO,CAAA;IACxC,qCAAqC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,+DAA+D;IAC/D,aAAa,CAAC,EAAE,MAAM,EAAE,CAAA;IACxB,sCAAsC;IACtC,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,6CAA6C;IAC7C,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,aAAa;IAC5B,0BAA0B;IAC1B,QAAQ,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,GAAG,QAAQ,CAAA;IAC5C,yDAAyD;IACzD,OAAO,CAAC,GAAG,EAAE,YAAY,GAAG,OAAO,CAAC,aAAa,CAAC,CAAA;IAClD,kCAAkC;IAClC,OAAO,CAAC,GAAG,EAAE,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC,CAAA;IAChD,oCAAoC;IACpC,QAAQ,CAAC,GAAG,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAC3C"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Completion Contracts
|
|
3
|
+
*
|
|
4
|
+
* Typed definitions of what each work type must produce before a session
|
|
5
|
+
* is considered successful. The orchestrator validates these after the
|
|
6
|
+
* agent session ends and runs deterministic backstop actions for any
|
|
7
|
+
* missing fields that can be recovered programmatically.
|
|
8
|
+
*
|
|
9
|
+
* Design principles:
|
|
10
|
+
* - Contracts are provider-agnostic (same expectations regardless of LLM)
|
|
11
|
+
* - Fields marked `backstopCapable` can be filled by deterministic code
|
|
12
|
+
* - Fields not backstop-capable require agent judgment (flagged for follow-up)
|
|
13
|
+
* - Contracts drive both validation AND recovery
|
|
14
|
+
*/
|
|
15
|
+
import type { AgentWorkType } from './work-types.js';
|
|
16
|
+
/** A field the agent session should produce */
|
|
17
|
+
export type CompletionFieldType = 'pr_url' | 'branch_pushed' | 'commits_present' | 'work_result' | 'issue_updated' | 'comment_posted' | 'sub_issues_created' | 'pr_merged';
|
|
18
|
+
/** A single required or optional field in a completion contract */
|
|
19
|
+
export interface CompletionField {
|
|
20
|
+
type: CompletionFieldType;
|
|
21
|
+
/** Human-readable description for diagnostic messages */
|
|
22
|
+
label: string;
|
|
23
|
+
/**
|
|
24
|
+
* Whether the orchestrator can fill this field deterministically
|
|
25
|
+
* after the session ends (e.g., push a branch, create a PR).
|
|
26
|
+
* Fields that require agent judgment (work_result) are NOT backstop-capable.
|
|
27
|
+
*/
|
|
28
|
+
backstopCapable: boolean;
|
|
29
|
+
}
|
|
30
|
+
export interface CompletionContract {
|
|
31
|
+
workType: AgentWorkType;
|
|
32
|
+
/** Fields that MUST be present for the session to be considered complete */
|
|
33
|
+
required: CompletionField[];
|
|
34
|
+
/** Fields that SHOULD be present but won't block completion */
|
|
35
|
+
optional: CompletionField[];
|
|
36
|
+
}
|
|
37
|
+
export interface CompletionValidationResult {
|
|
38
|
+
/** Whether all required fields are satisfied */
|
|
39
|
+
satisfied: boolean;
|
|
40
|
+
/** Required fields that are present */
|
|
41
|
+
presentFields: CompletionFieldType[];
|
|
42
|
+
/** Required fields that are missing */
|
|
43
|
+
missingFields: CompletionFieldType[];
|
|
44
|
+
/** Missing fields that the backstop can fill deterministically */
|
|
45
|
+
backstopRecoverable: CompletionFieldType[];
|
|
46
|
+
/** Missing fields that require agent judgment or manual intervention */
|
|
47
|
+
manualRequired: CompletionFieldType[];
|
|
48
|
+
}
|
|
49
|
+
/** Structured data extracted from the agent session */
|
|
50
|
+
export interface SessionOutputs {
|
|
51
|
+
prUrl?: string;
|
|
52
|
+
branchPushed?: boolean;
|
|
53
|
+
commitsPresent?: boolean;
|
|
54
|
+
workResult?: 'passed' | 'failed' | 'unknown';
|
|
55
|
+
issueUpdated?: boolean;
|
|
56
|
+
commentPosted?: boolean;
|
|
57
|
+
subIssuesCreated?: boolean;
|
|
58
|
+
prMerged?: boolean;
|
|
59
|
+
}
|
|
60
|
+
/** Record of a deterministic action taken by the backstop */
|
|
61
|
+
export interface BackstopAction {
|
|
62
|
+
field: CompletionFieldType;
|
|
63
|
+
action: string;
|
|
64
|
+
success: boolean;
|
|
65
|
+
detail?: string;
|
|
66
|
+
}
|
|
67
|
+
/** Result of running the backstop */
|
|
68
|
+
export interface BackstopResult {
|
|
69
|
+
/** Actions the backstop attempted */
|
|
70
|
+
actions: BackstopAction[];
|
|
71
|
+
/** Whether all required fields are now satisfied */
|
|
72
|
+
fullyRecovered: boolean;
|
|
73
|
+
/** Fields that still need manual intervention */
|
|
74
|
+
remainingGaps: CompletionFieldType[];
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Get the completion contract for a work type.
|
|
78
|
+
* Returns undefined for unknown work types (caller should treat as no contract).
|
|
79
|
+
*/
|
|
80
|
+
export declare function getCompletionContract(workType: AgentWorkType): CompletionContract | undefined;
|
|
81
|
+
/**
|
|
82
|
+
* Validate session outputs against a completion contract.
|
|
83
|
+
*/
|
|
84
|
+
export declare function validateCompletion(contract: CompletionContract, outputs: SessionOutputs): CompletionValidationResult;
|
|
85
|
+
/**
|
|
86
|
+
* Format missing fields into a human-readable diagnostic message.
|
|
87
|
+
*/
|
|
88
|
+
export declare function formatMissingFields(contract: CompletionContract, validation: CompletionValidationResult): string;
|
|
89
|
+
//# sourceMappingURL=completion-contracts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"completion-contracts.d.ts","sourceRoot":"","sources":["../../../src/orchestrator/completion-contracts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAMpD,+CAA+C;AAC/C,MAAM,MAAM,mBAAmB,GAC3B,QA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,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,qCAAqC;AACrC,MAAM,WAAW,cAAc;IAC7B,qCAAqC;IACrC,OAAO,EAAE,cAAc,EAAE,CAAA;IACzB,oDAAoD;IACpD,cAAc,EAAE,OAAO,CAAA;IACvB,iDAAiD;IACjD,aAAa,EAAE,mBAAmB,EAAE,CAAA;CACrC;AAwID;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,aAAa,GAAG,kBAAkB,GAAG,SAAS,CAE7F;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,kBAAkB,EAC5B,OAAO,EAAE,cAAc,GACtB,0BAA0B,CA0B5B;AA4BD;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,kBAAkB,EAC5B,UAAU,EAAE,0BAA0B,GACrC,MAAM,CA6BR"}
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Completion Contracts
|
|
3
|
+
*
|
|
4
|
+
* Typed definitions of what each work type must produce before a session
|
|
5
|
+
* is considered successful. The orchestrator validates these after the
|
|
6
|
+
* agent session ends and runs deterministic backstop actions for any
|
|
7
|
+
* missing fields that can be recovered programmatically.
|
|
8
|
+
*
|
|
9
|
+
* Design principles:
|
|
10
|
+
* - Contracts are provider-agnostic (same expectations regardless of LLM)
|
|
11
|
+
* - Fields marked `backstopCapable` can be filled by deterministic code
|
|
12
|
+
* - Fields not backstop-capable require agent judgment (flagged for follow-up)
|
|
13
|
+
* - Contracts drive both validation AND recovery
|
|
14
|
+
*/
|
|
15
|
+
// ---------------------------------------------------------------------------
|
|
16
|
+
// Shared field definitions (DRY)
|
|
17
|
+
// ---------------------------------------------------------------------------
|
|
18
|
+
const FIELD = {
|
|
19
|
+
prUrl: {
|
|
20
|
+
type: 'pr_url',
|
|
21
|
+
label: 'Pull request URL',
|
|
22
|
+
backstopCapable: true,
|
|
23
|
+
},
|
|
24
|
+
branchPushed: {
|
|
25
|
+
type: 'branch_pushed',
|
|
26
|
+
label: 'Branch pushed to remote',
|
|
27
|
+
backstopCapable: true,
|
|
28
|
+
},
|
|
29
|
+
commitsPresent: {
|
|
30
|
+
type: 'commits_present',
|
|
31
|
+
label: 'Commits on branch',
|
|
32
|
+
backstopCapable: false,
|
|
33
|
+
},
|
|
34
|
+
workResult: {
|
|
35
|
+
type: 'work_result',
|
|
36
|
+
label: 'Structured work result (passed/failed)',
|
|
37
|
+
backstopCapable: false,
|
|
38
|
+
},
|
|
39
|
+
issueUpdated: {
|
|
40
|
+
type: 'issue_updated',
|
|
41
|
+
label: 'Issue description updated',
|
|
42
|
+
backstopCapable: false,
|
|
43
|
+
},
|
|
44
|
+
commentPosted: {
|
|
45
|
+
type: 'comment_posted',
|
|
46
|
+
label: 'Comment posted to issue',
|
|
47
|
+
backstopCapable: false,
|
|
48
|
+
},
|
|
49
|
+
subIssuesCreated: {
|
|
50
|
+
type: 'sub_issues_created',
|
|
51
|
+
label: 'Sub-issues created',
|
|
52
|
+
backstopCapable: false,
|
|
53
|
+
},
|
|
54
|
+
prMerged: {
|
|
55
|
+
type: 'pr_merged',
|
|
56
|
+
label: 'Pull request merged',
|
|
57
|
+
backstopCapable: false,
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
// ---------------------------------------------------------------------------
|
|
61
|
+
// Per-work-type contract definitions
|
|
62
|
+
// ---------------------------------------------------------------------------
|
|
63
|
+
const CONTRACTS = {
|
|
64
|
+
// --- Code-producing work types ---
|
|
65
|
+
development: {
|
|
66
|
+
workType: 'development',
|
|
67
|
+
required: [FIELD.commitsPresent, FIELD.branchPushed, FIELD.prUrl],
|
|
68
|
+
optional: [],
|
|
69
|
+
},
|
|
70
|
+
inflight: {
|
|
71
|
+
workType: 'inflight',
|
|
72
|
+
required: [FIELD.commitsPresent, FIELD.branchPushed, FIELD.prUrl],
|
|
73
|
+
optional: [],
|
|
74
|
+
},
|
|
75
|
+
// --- Result-sensitive work types ---
|
|
76
|
+
qa: {
|
|
77
|
+
workType: 'qa',
|
|
78
|
+
required: [FIELD.workResult, FIELD.commentPosted],
|
|
79
|
+
optional: [],
|
|
80
|
+
},
|
|
81
|
+
'qa-coordination': {
|
|
82
|
+
workType: 'qa-coordination',
|
|
83
|
+
required: [FIELD.workResult, FIELD.commentPosted],
|
|
84
|
+
optional: [],
|
|
85
|
+
},
|
|
86
|
+
acceptance: {
|
|
87
|
+
workType: 'acceptance',
|
|
88
|
+
required: [FIELD.workResult],
|
|
89
|
+
optional: [FIELD.prMerged],
|
|
90
|
+
},
|
|
91
|
+
'acceptance-coordination': {
|
|
92
|
+
workType: 'acceptance-coordination',
|
|
93
|
+
required: [FIELD.workResult],
|
|
94
|
+
optional: [FIELD.prMerged],
|
|
95
|
+
},
|
|
96
|
+
// --- Coordination work types ---
|
|
97
|
+
coordination: {
|
|
98
|
+
workType: 'coordination',
|
|
99
|
+
required: [FIELD.commitsPresent, FIELD.branchPushed, FIELD.prUrl, FIELD.workResult],
|
|
100
|
+
optional: [],
|
|
101
|
+
},
|
|
102
|
+
'inflight-coordination': {
|
|
103
|
+
workType: 'inflight-coordination',
|
|
104
|
+
required: [FIELD.commitsPresent, FIELD.branchPushed, FIELD.prUrl, FIELD.workResult],
|
|
105
|
+
optional: [],
|
|
106
|
+
},
|
|
107
|
+
// --- Triage/analysis work types ---
|
|
108
|
+
refinement: {
|
|
109
|
+
workType: 'refinement',
|
|
110
|
+
required: [FIELD.commentPosted],
|
|
111
|
+
optional: [FIELD.issueUpdated],
|
|
112
|
+
},
|
|
113
|
+
'refinement-coordination': {
|
|
114
|
+
workType: 'refinement-coordination',
|
|
115
|
+
required: [FIELD.commentPosted],
|
|
116
|
+
optional: [],
|
|
117
|
+
},
|
|
118
|
+
research: {
|
|
119
|
+
workType: 'research',
|
|
120
|
+
required: [FIELD.issueUpdated],
|
|
121
|
+
optional: [FIELD.commentPosted],
|
|
122
|
+
},
|
|
123
|
+
// --- Issue creation work types ---
|
|
124
|
+
'backlog-creation': {
|
|
125
|
+
workType: 'backlog-creation',
|
|
126
|
+
required: [FIELD.subIssuesCreated],
|
|
127
|
+
optional: [FIELD.commentPosted],
|
|
128
|
+
},
|
|
129
|
+
// --- Merge work types ---
|
|
130
|
+
merge: {
|
|
131
|
+
workType: 'merge',
|
|
132
|
+
required: [FIELD.prMerged],
|
|
133
|
+
optional: [],
|
|
134
|
+
},
|
|
135
|
+
};
|
|
136
|
+
// ---------------------------------------------------------------------------
|
|
137
|
+
// Public API
|
|
138
|
+
// ---------------------------------------------------------------------------
|
|
139
|
+
/**
|
|
140
|
+
* Get the completion contract for a work type.
|
|
141
|
+
* Returns undefined for unknown work types (caller should treat as no contract).
|
|
142
|
+
*/
|
|
143
|
+
export function getCompletionContract(workType) {
|
|
144
|
+
return CONTRACTS[workType];
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Validate session outputs against a completion contract.
|
|
148
|
+
*/
|
|
149
|
+
export function validateCompletion(contract, outputs) {
|
|
150
|
+
const presentFields = [];
|
|
151
|
+
const missingFields = [];
|
|
152
|
+
const backstopRecoverable = [];
|
|
153
|
+
const manualRequired = [];
|
|
154
|
+
for (const field of contract.required) {
|
|
155
|
+
if (isFieldPresent(field.type, outputs)) {
|
|
156
|
+
presentFields.push(field.type);
|
|
157
|
+
}
|
|
158
|
+
else {
|
|
159
|
+
missingFields.push(field.type);
|
|
160
|
+
if (field.backstopCapable) {
|
|
161
|
+
backstopRecoverable.push(field.type);
|
|
162
|
+
}
|
|
163
|
+
else {
|
|
164
|
+
manualRequired.push(field.type);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
return {
|
|
169
|
+
satisfied: missingFields.length === 0,
|
|
170
|
+
presentFields,
|
|
171
|
+
missingFields,
|
|
172
|
+
backstopRecoverable,
|
|
173
|
+
manualRequired,
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Check whether a specific field is present in the session outputs.
|
|
178
|
+
*/
|
|
179
|
+
function isFieldPresent(fieldType, outputs) {
|
|
180
|
+
switch (fieldType) {
|
|
181
|
+
case 'pr_url':
|
|
182
|
+
return !!outputs.prUrl;
|
|
183
|
+
case 'branch_pushed':
|
|
184
|
+
return !!outputs.branchPushed;
|
|
185
|
+
case 'commits_present':
|
|
186
|
+
return !!outputs.commitsPresent;
|
|
187
|
+
case 'work_result':
|
|
188
|
+
return outputs.workResult === 'passed' || outputs.workResult === 'failed';
|
|
189
|
+
case 'issue_updated':
|
|
190
|
+
return !!outputs.issueUpdated;
|
|
191
|
+
case 'comment_posted':
|
|
192
|
+
return !!outputs.commentPosted;
|
|
193
|
+
case 'sub_issues_created':
|
|
194
|
+
return !!outputs.subIssuesCreated;
|
|
195
|
+
case 'pr_merged':
|
|
196
|
+
return !!outputs.prMerged;
|
|
197
|
+
default:
|
|
198
|
+
return false;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Format missing fields into a human-readable diagnostic message.
|
|
203
|
+
*/
|
|
204
|
+
export function formatMissingFields(contract, validation) {
|
|
205
|
+
const lines = [
|
|
206
|
+
`Session completion check for ${contract.workType}:`,
|
|
207
|
+
];
|
|
208
|
+
if (validation.satisfied) {
|
|
209
|
+
lines.push('All required outputs are present.');
|
|
210
|
+
return lines.join('\n');
|
|
211
|
+
}
|
|
212
|
+
lines.push('');
|
|
213
|
+
lines.push('Missing required outputs:');
|
|
214
|
+
for (const fieldType of validation.missingFields) {
|
|
215
|
+
const field = contract.required.find(f => f.type === fieldType);
|
|
216
|
+
const recoverable = validation.backstopRecoverable.includes(fieldType);
|
|
217
|
+
lines.push(` - ${field?.label ?? fieldType}${recoverable ? ' (auto-recoverable)' : ' (requires manual action)'}`);
|
|
218
|
+
}
|
|
219
|
+
if (validation.backstopRecoverable.length > 0) {
|
|
220
|
+
lines.push('');
|
|
221
|
+
lines.push(`The orchestrator will attempt to recover ${validation.backstopRecoverable.length} field(s) automatically.`);
|
|
222
|
+
}
|
|
223
|
+
if (validation.manualRequired.length > 0) {
|
|
224
|
+
lines.push('');
|
|
225
|
+
lines.push(`${validation.manualRequired.length} field(s) require manual intervention or re-triggering the agent.`);
|
|
226
|
+
}
|
|
227
|
+
return lines.join('\n');
|
|
228
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"completion-contracts.test.d.ts","sourceRoot":"","sources":["../../../src/orchestrator/completion-contracts.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { getCompletionContract, validateCompletion, formatMissingFields, } from './completion-contracts.js';
|
|
3
|
+
describe('getCompletionContract', () => {
|
|
4
|
+
it('returns a contract for development work type', () => {
|
|
5
|
+
const contract = getCompletionContract('development');
|
|
6
|
+
expect(contract).toBeDefined();
|
|
7
|
+
expect(contract.workType).toBe('development');
|
|
8
|
+
expect(contract.required.map(f => f.type)).toContain('pr_url');
|
|
9
|
+
expect(contract.required.map(f => f.type)).toContain('branch_pushed');
|
|
10
|
+
expect(contract.required.map(f => f.type)).toContain('commits_present');
|
|
11
|
+
});
|
|
12
|
+
it('returns a contract for qa work type', () => {
|
|
13
|
+
const contract = getCompletionContract('qa');
|
|
14
|
+
expect(contract).toBeDefined();
|
|
15
|
+
expect(contract.required.map(f => f.type)).toContain('work_result');
|
|
16
|
+
expect(contract.required.map(f => f.type)).toContain('comment_posted');
|
|
17
|
+
});
|
|
18
|
+
it('returns a contract for acceptance work type', () => {
|
|
19
|
+
const contract = getCompletionContract('acceptance');
|
|
20
|
+
expect(contract).toBeDefined();
|
|
21
|
+
expect(contract.required.map(f => f.type)).toContain('work_result');
|
|
22
|
+
});
|
|
23
|
+
it('returns a contract for refinement work type', () => {
|
|
24
|
+
const contract = getCompletionContract('refinement');
|
|
25
|
+
expect(contract).toBeDefined();
|
|
26
|
+
expect(contract.required.map(f => f.type)).toContain('comment_posted');
|
|
27
|
+
});
|
|
28
|
+
it('returns a contract for research work type', () => {
|
|
29
|
+
const contract = getCompletionContract('research');
|
|
30
|
+
expect(contract).toBeDefined();
|
|
31
|
+
expect(contract.required.map(f => f.type)).toContain('issue_updated');
|
|
32
|
+
});
|
|
33
|
+
it('returns a contract for backlog-creation work type', () => {
|
|
34
|
+
const contract = getCompletionContract('backlog-creation');
|
|
35
|
+
expect(contract).toBeDefined();
|
|
36
|
+
expect(contract.required.map(f => f.type)).toContain('sub_issues_created');
|
|
37
|
+
});
|
|
38
|
+
it('returns a contract for coordination work type', () => {
|
|
39
|
+
const contract = getCompletionContract('coordination');
|
|
40
|
+
expect(contract).toBeDefined();
|
|
41
|
+
const required = contract.required.map(f => f.type);
|
|
42
|
+
expect(required).toContain('pr_url');
|
|
43
|
+
expect(required).toContain('work_result');
|
|
44
|
+
});
|
|
45
|
+
it('returns a contract for merge work type', () => {
|
|
46
|
+
const contract = getCompletionContract('merge');
|
|
47
|
+
expect(contract).toBeDefined();
|
|
48
|
+
expect(contract.required.map(f => f.type)).toContain('pr_merged');
|
|
49
|
+
});
|
|
50
|
+
it('returns contracts for all coordination variants', () => {
|
|
51
|
+
expect(getCompletionContract('qa-coordination')).toBeDefined();
|
|
52
|
+
expect(getCompletionContract('acceptance-coordination')).toBeDefined();
|
|
53
|
+
expect(getCompletionContract('inflight-coordination')).toBeDefined();
|
|
54
|
+
expect(getCompletionContract('refinement-coordination')).toBeDefined();
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
describe('validateCompletion', () => {
|
|
58
|
+
it('marks satisfied when all required fields present (development)', () => {
|
|
59
|
+
const contract = getCompletionContract('development');
|
|
60
|
+
const outputs = {
|
|
61
|
+
prUrl: 'https://github.com/org/repo/pull/1',
|
|
62
|
+
branchPushed: true,
|
|
63
|
+
commitsPresent: true,
|
|
64
|
+
};
|
|
65
|
+
const result = validateCompletion(contract, outputs);
|
|
66
|
+
expect(result.satisfied).toBe(true);
|
|
67
|
+
expect(result.missingFields).toHaveLength(0);
|
|
68
|
+
});
|
|
69
|
+
it('detects missing PR URL (development)', () => {
|
|
70
|
+
const contract = getCompletionContract('development');
|
|
71
|
+
const outputs = {
|
|
72
|
+
branchPushed: true,
|
|
73
|
+
commitsPresent: true,
|
|
74
|
+
};
|
|
75
|
+
const result = validateCompletion(contract, outputs);
|
|
76
|
+
expect(result.satisfied).toBe(false);
|
|
77
|
+
expect(result.missingFields).toContain('pr_url');
|
|
78
|
+
expect(result.backstopRecoverable).toContain('pr_url');
|
|
79
|
+
});
|
|
80
|
+
it('detects missing branch push (development)', () => {
|
|
81
|
+
const contract = getCompletionContract('development');
|
|
82
|
+
const outputs = {
|
|
83
|
+
prUrl: 'https://github.com/org/repo/pull/1',
|
|
84
|
+
branchPushed: false,
|
|
85
|
+
commitsPresent: true,
|
|
86
|
+
};
|
|
87
|
+
const result = validateCompletion(contract, outputs);
|
|
88
|
+
expect(result.satisfied).toBe(false);
|
|
89
|
+
expect(result.missingFields).toContain('branch_pushed');
|
|
90
|
+
expect(result.backstopRecoverable).toContain('branch_pushed');
|
|
91
|
+
});
|
|
92
|
+
it('marks commits_present as not backstop-capable', () => {
|
|
93
|
+
const contract = getCompletionContract('development');
|
|
94
|
+
const outputs = {
|
|
95
|
+
prUrl: 'https://github.com/org/repo/pull/1',
|
|
96
|
+
branchPushed: true,
|
|
97
|
+
commitsPresent: false,
|
|
98
|
+
};
|
|
99
|
+
const result = validateCompletion(contract, outputs);
|
|
100
|
+
expect(result.satisfied).toBe(false);
|
|
101
|
+
expect(result.manualRequired).toContain('commits_present');
|
|
102
|
+
expect(result.backstopRecoverable).not.toContain('commits_present');
|
|
103
|
+
});
|
|
104
|
+
it('marks satisfied for QA with work result passed', () => {
|
|
105
|
+
const contract = getCompletionContract('qa');
|
|
106
|
+
const outputs = {
|
|
107
|
+
workResult: 'passed',
|
|
108
|
+
commentPosted: true,
|
|
109
|
+
};
|
|
110
|
+
const result = validateCompletion(contract, outputs);
|
|
111
|
+
expect(result.satisfied).toBe(true);
|
|
112
|
+
});
|
|
113
|
+
it('marks satisfied for QA with work result failed', () => {
|
|
114
|
+
const contract = getCompletionContract('qa');
|
|
115
|
+
const outputs = {
|
|
116
|
+
workResult: 'failed',
|
|
117
|
+
commentPosted: true,
|
|
118
|
+
};
|
|
119
|
+
const result = validateCompletion(contract, outputs);
|
|
120
|
+
expect(result.satisfied).toBe(true);
|
|
121
|
+
});
|
|
122
|
+
it('marks unsatisfied for QA with unknown work result', () => {
|
|
123
|
+
const contract = getCompletionContract('qa');
|
|
124
|
+
const outputs = {
|
|
125
|
+
workResult: 'unknown',
|
|
126
|
+
commentPosted: true,
|
|
127
|
+
};
|
|
128
|
+
const result = validateCompletion(contract, outputs);
|
|
129
|
+
expect(result.satisfied).toBe(false);
|
|
130
|
+
expect(result.missingFields).toContain('work_result');
|
|
131
|
+
expect(result.manualRequired).toContain('work_result');
|
|
132
|
+
});
|
|
133
|
+
it('marks unsatisfied for QA without comment', () => {
|
|
134
|
+
const contract = getCompletionContract('qa');
|
|
135
|
+
const outputs = {
|
|
136
|
+
workResult: 'passed',
|
|
137
|
+
commentPosted: false,
|
|
138
|
+
};
|
|
139
|
+
const result = validateCompletion(contract, outputs);
|
|
140
|
+
expect(result.satisfied).toBe(false);
|
|
141
|
+
expect(result.missingFields).toContain('comment_posted');
|
|
142
|
+
});
|
|
143
|
+
it('marks satisfied for refinement with comment posted', () => {
|
|
144
|
+
const contract = getCompletionContract('refinement');
|
|
145
|
+
const outputs = {
|
|
146
|
+
commentPosted: true,
|
|
147
|
+
};
|
|
148
|
+
const result = validateCompletion(contract, outputs);
|
|
149
|
+
expect(result.satisfied).toBe(true);
|
|
150
|
+
});
|
|
151
|
+
it('marks satisfied for backlog-creation with sub-issues', () => {
|
|
152
|
+
const contract = getCompletionContract('backlog-creation');
|
|
153
|
+
const outputs = {
|
|
154
|
+
subIssuesCreated: true,
|
|
155
|
+
};
|
|
156
|
+
const result = validateCompletion(contract, outputs);
|
|
157
|
+
expect(result.satisfied).toBe(true);
|
|
158
|
+
});
|
|
159
|
+
it('handles empty outputs gracefully', () => {
|
|
160
|
+
const contract = getCompletionContract('development');
|
|
161
|
+
const outputs = {};
|
|
162
|
+
const result = validateCompletion(contract, outputs);
|
|
163
|
+
expect(result.satisfied).toBe(false);
|
|
164
|
+
expect(result.missingFields).toHaveLength(3);
|
|
165
|
+
});
|
|
166
|
+
});
|
|
167
|
+
describe('formatMissingFields', () => {
|
|
168
|
+
it('formats satisfied contract', () => {
|
|
169
|
+
const contract = getCompletionContract('development');
|
|
170
|
+
const validation = validateCompletion(contract, {
|
|
171
|
+
prUrl: 'https://github.com/org/repo/pull/1',
|
|
172
|
+
branchPushed: true,
|
|
173
|
+
commitsPresent: true,
|
|
174
|
+
});
|
|
175
|
+
const message = formatMissingFields(contract, validation);
|
|
176
|
+
expect(message).toContain('All required outputs are present');
|
|
177
|
+
});
|
|
178
|
+
it('formats missing fields with recovery info', () => {
|
|
179
|
+
const contract = getCompletionContract('development');
|
|
180
|
+
const validation = validateCompletion(contract, {
|
|
181
|
+
commitsPresent: true,
|
|
182
|
+
});
|
|
183
|
+
const message = formatMissingFields(contract, validation);
|
|
184
|
+
expect(message).toContain('Missing required outputs');
|
|
185
|
+
expect(message).toContain('auto-recoverable');
|
|
186
|
+
expect(message).toContain('Pull request URL');
|
|
187
|
+
expect(message).toContain('Branch pushed to remote');
|
|
188
|
+
});
|
|
189
|
+
it('formats manual-required fields', () => {
|
|
190
|
+
const contract = getCompletionContract('qa');
|
|
191
|
+
const validation = validateCompletion(contract, {});
|
|
192
|
+
const message = formatMissingFields(contract, validation);
|
|
193
|
+
expect(message).toContain('requires manual action');
|
|
194
|
+
});
|
|
195
|
+
});
|
|
@@ -21,6 +21,10 @@ export { getAgentDir, getStatePath, getHeartbeatPath, getTodosPath, isHeartbeatF
|
|
|
21
21
|
export { getLogAnalysisConfig, isSessionLoggingEnabled, isAutoAnalyzeEnabled, } from './log-config.js';
|
|
22
22
|
export { SessionLogger, createSessionLogger, readSessionMetadata, readSessionEvents, } from './session-logger.js';
|
|
23
23
|
export { parseWorkResult } from './parse-work-result.js';
|
|
24
|
+
export { getCompletionContract, validateCompletion, formatMissingFields, } from './completion-contracts.js';
|
|
25
|
+
export type { CompletionContract, CompletionField, CompletionFieldType, CompletionValidationResult, SessionOutputs, BackstopAction, BackstopResult, } from './completion-contracts.js';
|
|
26
|
+
export { runBackstop, collectSessionOutputs, formatBackstopComment, } from './session-backstop.js';
|
|
27
|
+
export type { SessionContext, BackstopOptions, BackstopRunResult, } from './session-backstop.js';
|
|
24
28
|
export { LogAnalyzer, createLogAnalyzer } from './log-analyzer.js';
|
|
25
29
|
export { ArtifactTracker, } from './artifact-tracker.js';
|
|
26
30
|
export type { TrackedFileAction, TrackedFile, ArtifactIndex, } from './artifact-tracker.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/orchestrator/index.ts"],"names":[],"mappings":"AACA,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AAClH,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAA;AAGzD,YAAY,EACV,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,EACnB,aAAa,EACb,YAAY,GACb,MAAM,2BAA2B,CAAA;AAGlC,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAGrD,YAAY,EACV,kBAAkB,EAClB,iBAAiB,EACjB,YAAY,EACZ,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,wBAAwB,EACxB,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,2BAA2B,EAC3B,qBAAqB,EACrB,eAAe,GAChB,MAAM,YAAY,CAAA;AAGnB,YAAY,EACV,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EACjB,oBAAoB,EACpB,kBAAkB,EAClB,qBAAqB,EACrB,iBAAiB,EAC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3E,OAAO,EACL,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,EACjB,aAAa,EACb,SAAS,EACT,aAAa,EACb,kBAAkB,EAClB,UAAU,EACV,WAAW,EACX,UAAU,EACV,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,0BAA0B,EAC1B,6BAA6B,EAC7B,aAAa,EACb,cAAc,EACd,WAAW,EACX,YAAY,GACb,MAAM,qBAAqB,CAAA;AAG5B,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,iBAAiB,CAAA;AAGxB,OAAO,EACL,aAAa,EACb,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,qBAAqB,CAAA;AAG5B,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAGxD,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAGlE,OAAO,EACL,eAAe,GAChB,MAAM,uBAAuB,CAAA;AAC9B,YAAY,EACV,iBAAiB,EACjB,WAAW,EACX,aAAa,GACd,MAAM,uBAAuB,CAAA;AAG9B,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAGrD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACrD,YAAY,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/orchestrator/index.ts"],"names":[],"mappings":"AACA,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AAClH,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAA;AAGzD,YAAY,EACV,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,EACnB,aAAa,EACb,YAAY,GACb,MAAM,2BAA2B,CAAA;AAGlC,YAAY,EAA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GAClB,MAAM,uBAAuB,CAAA;AAG9B,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAGlE,OAAO,EACL,eAAe,GAChB,MAAM,uBAAuB,CAAA;AAC9B,YAAY,EACV,iBAAiB,EACjB,WAAW,EACX,aAAa,GACd,MAAM,uBAAuB,CAAA;AAG9B,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAGrD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACrD,YAAY,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA"}
|
|
@@ -20,6 +20,9 @@ export { getLogAnalysisConfig, isSessionLoggingEnabled, isAutoAnalyzeEnabled, }
|
|
|
20
20
|
export { SessionLogger, createSessionLogger, readSessionMetadata, readSessionEvents, } from './session-logger.js';
|
|
21
21
|
// Work Result Parser (for QA/acceptance pass/fail detection)
|
|
22
22
|
export { parseWorkResult } from './parse-work-result.js';
|
|
23
|
+
// Completion Contracts & Session Backstop
|
|
24
|
+
export { getCompletionContract, validateCompletion, formatMissingFields, } from './completion-contracts.js';
|
|
25
|
+
export { runBackstop, collectSessionOutputs, formatBackstopComment, } from './session-backstop.js';
|
|
23
26
|
// Log Analyzer
|
|
24
27
|
export { LogAnalyzer, createLogAnalyzer } from './log-analyzer.js';
|
|
25
28
|
// Artifact Tracker (for context window management)
|