@kognai/orchestrator-core 0.1.2 → 0.1.4
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/index.d.ts +3 -0
- package/dist/index.js +6 -0
- package/dist/lib/build-triage.d.ts +27 -0
- package/dist/lib/build-triage.js +202 -0
- package/dist/lib/did-resolver-registry.d.ts +15 -0
- package/dist/lib/did-resolver-registry.js +9 -0
- package/dist/lib/engine-agents.d.ts +71 -0
- package/dist/lib/engine-agents.js +835 -0
- package/dist/lib/engine-coding-agent.d.ts +17 -0
- package/dist/lib/engine-coding-agent.js +890 -0
- package/dist/lib/engine-helpers.d.ts +10 -0
- package/dist/lib/engine-helpers.js +319 -0
- package/dist/lib/engine-loaders.d.ts +5 -0
- package/dist/lib/engine-loaders.js +241 -0
- package/dist/lib/engine-orchestrator.d.ts +48 -0
- package/dist/lib/engine-orchestrator.js +1567 -0
- package/dist/lib/engine-primitives.d.ts +141 -0
- package/dist/lib/engine-primitives.js +748 -0
- package/dist/lib/orchestrate-engine.d.ts +8 -17
- package/dist/lib/orchestrate-engine.js +25 -4357
- package/dist/lib/plumber/extractor.d.ts +18 -0
- package/dist/lib/plumber/extractor.js +213 -0
- package/dist/lib/plumber/fixer.d.ts +75 -0
- package/dist/lib/plumber/fixer.js +165 -0
- package/dist/lib/plumber/index.d.ts +3 -0
- package/dist/lib/plumber/index.js +3 -0
- package/dist/lib/plumber/patcher.d.ts +44 -0
- package/dist/lib/plumber/patcher.js +210 -0
- package/dist/lib/preamble-provider-registry.d.ts +12 -0
- package/dist/lib/preamble-provider-registry.js +7 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -23,6 +23,7 @@ export * from './lib/trust-score-updater';
|
|
|
23
23
|
export * from './lib/citizenship';
|
|
24
24
|
export * from './lib/agent-registry';
|
|
25
25
|
export * from './lib/sprint-state';
|
|
26
|
+
export * from './lib/build-triage';
|
|
26
27
|
export * as ksl from './lib/ksl';
|
|
27
28
|
export * from './lib/wallet-state';
|
|
28
29
|
export * from './lib/ceo-wallet';
|
|
@@ -60,6 +61,8 @@ export { CTOApprovalResult, requestCTOApproval, batchCTOReview } from './lib/cto
|
|
|
60
61
|
export * from './lib/citizen-score-contract';
|
|
61
62
|
export * from './lib/citizen-score-registry';
|
|
62
63
|
export * from './lib/sovereign-agent-factory';
|
|
64
|
+
export * from './lib/did-resolver-registry';
|
|
65
|
+
export * from './lib/preamble-provider-registry';
|
|
63
66
|
export { runOrchestrator } from './lib/orchestrate-engine';
|
|
64
67
|
export type { OrchestratorConfig, SpawnGate, SpawnGateResult, AgentSpawnSpec, } from './lib/orchestrate-engine';
|
|
65
68
|
export { runSprintCycle, SprintRunnerOpts } from './lib/sprint-runner-engine';
|
package/dist/index.js
CHANGED
|
@@ -82,6 +82,9 @@ __exportStar(require("./lib/citizenship"), exports);
|
|
|
82
82
|
__exportStar(require("./lib/agent-registry"), exports);
|
|
83
83
|
// TICKET-098 sprint runtime-state split (committed defs vs gitignored status).
|
|
84
84
|
__exportStar(require("./lib/sprint-state"), exports);
|
|
85
|
+
// TICKET-234 build triage seam — classifyBuildPath (ceremony-depth axis) +
|
|
86
|
+
// logBuildTriage. Consumed by the orchestrator run loop AND by kognai-build.
|
|
87
|
+
__exportStar(require("./lib/build-triage"), exports);
|
|
85
88
|
// Phase 3b-3 Wave B: KSL capture cluster (session records + error log + tap).
|
|
86
89
|
// Namespaced ('ksl.tapAttempt', 'ksl.writeRecord', 'ksl.record', …) to keep the
|
|
87
90
|
// generic 'record' export off the package's flat public surface.
|
|
@@ -173,6 +176,9 @@ __exportStar(require("./lib/citizen-score-registry"), exports);
|
|
|
173
176
|
__exportStar(require("./lib/sovereign-agent-factory"), exports);
|
|
174
177
|
// TICKET-215 Wave D split step 2: engine + sprint-runner entry points.
|
|
175
178
|
// Inject seams via kognai-bootstrap (side-effect import) before calling.
|
|
179
|
+
// TICKET-226 A1: template-carried polity seams (DID resolution + constitutional preamble).
|
|
180
|
+
__exportStar(require("./lib/did-resolver-registry"), exports);
|
|
181
|
+
__exportStar(require("./lib/preamble-provider-registry"), exports);
|
|
176
182
|
var orchestrate_engine_1 = require("./lib/orchestrate-engine");
|
|
177
183
|
Object.defineProperty(exports, "runOrchestrator", { enumerable: true, get: function () { return orchestrate_engine_1.runOrchestrator; } });
|
|
178
184
|
var sprint_runner_engine_1 = require("./lib/sprint-runner-engine");
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export type BuildPath = 'regulated' | 'fast';
|
|
2
|
+
export interface BuildTriageResult {
|
|
3
|
+
path: BuildPath;
|
|
4
|
+
reason: string;
|
|
5
|
+
triggers: string[];
|
|
6
|
+
sensitive: boolean;
|
|
7
|
+
sovereign: boolean;
|
|
8
|
+
complexity: 'low' | 'medium' | 'high';
|
|
9
|
+
taskCount: number;
|
|
10
|
+
codeFileCount: number;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Classify a build into a ceremony-depth path. Pure + synchronous: it only reads
|
|
14
|
+
* the sprint JSON + task list, so it adds negligible cost relative to the
|
|
15
|
+
* ceremony it gates. Default-to-regulated on uncertainty.
|
|
16
|
+
*
|
|
17
|
+
* @param sprint the raw sprint object (may carry regulated/strict/fast_track/sovereign flags)
|
|
18
|
+
* @param tasks the loaded task list (each with deliverables/context/type)
|
|
19
|
+
*/
|
|
20
|
+
export declare function classifyBuildPath(sprint: any, tasks: any[]): BuildTriageResult;
|
|
21
|
+
/**
|
|
22
|
+
* Append the triage decision to logs/routing/triage.jsonl (location-independent
|
|
23
|
+
* via engine-paths). Best-effort: never throws into the run loop. This is the
|
|
24
|
+
* audit trail required by the ticket — evidence that triage routes correctly and
|
|
25
|
+
* the means to audit any fast-tracked build later.
|
|
26
|
+
*/
|
|
27
|
+
export declare function logBuildTriage(sprintId: string, result: BuildTriageResult): void;
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.classifyBuildPath = classifyBuildPath;
|
|
4
|
+
exports.logBuildTriage = logBuildTriage;
|
|
5
|
+
/**
|
|
6
|
+
* build-triage.ts — TICKET-234: pre-orchestrator build triage (ceremony-depth axis).
|
|
7
|
+
*
|
|
8
|
+
* The orchestrator historically ran the SAME full ceremony for every build
|
|
9
|
+
* regardless of complexity or sensitivity (CEO assessment → execution →
|
|
10
|
+
* dual-supervisor review → CTO data analysis → CEO proposal cycle → post-sprint
|
|
11
|
+
* + agent minting). A 3-line `addTwo` cost 171s + the entire ceremony.
|
|
12
|
+
*
|
|
13
|
+
* This module adds a cheap classifier that runs BEFORE the orchestrator hands
|
|
14
|
+
* off to the swarm and routes the build to one of two execution paths:
|
|
15
|
+
*
|
|
16
|
+
* - REGULATED (full ceremony) — CEO · CTO governance gate · dual-supervisor
|
|
17
|
+
* review · reconciliation · the full CTO/CEO proposal cycle. Templates apply
|
|
18
|
+
* on this path only. For sensitive / sovereign / complex builds.
|
|
19
|
+
*
|
|
20
|
+
* - FAST — coder → single-supervisor review → the minimum safety/security/
|
|
21
|
+
* quality gate (QA gate: typecheck/compile/no-secrets, always on). No
|
|
22
|
+
* dual-supervisor, no CTO/CEO post-sprint ceremony, no templates. For
|
|
23
|
+
* simple, low-stakes, single-file, non-sensitive builds.
|
|
24
|
+
*
|
|
25
|
+
* It is the CEREMONY-DEPTH axis. It composes WITH `assessTaskComplexity`
|
|
26
|
+
* (engine-helpers), which scores the MODEL-ROUTING axis — they are orthogonal:
|
|
27
|
+
* a fast-tracked build can still route to a cloud model, and a regulated build
|
|
28
|
+
* can still run local. This stays a PURE HEURISTIC (no LLM call) so the triage
|
|
29
|
+
* never reintroduces the overhead it removes.
|
|
30
|
+
*
|
|
31
|
+
* Safety invariant: DEFAULT TO REGULATED on any uncertainty. `fast` is returned
|
|
32
|
+
* only when the build is provably simple AND non-sensitive AND non-sovereign.
|
|
33
|
+
* A `fast_track` opt-in never lowers the safety floor — sensitivity/complexity
|
|
34
|
+
* still force REGULATED.
|
|
35
|
+
*/
|
|
36
|
+
const fs_1 = require("fs");
|
|
37
|
+
const path_1 = require("path");
|
|
38
|
+
const engine_paths_1 = require("./engine-paths");
|
|
39
|
+
// Sensitivity keywords — PHI/PII, payments/financial, auth/secrets/credentials,
|
|
40
|
+
// crypto/on-chain/contracts, destructive or privileged operations. A match in a
|
|
41
|
+
// deliverable path, task context, or sprint goal forces REGULATED.
|
|
42
|
+
const SENSITIVE_KEYWORDS = [
|
|
43
|
+
// auth / secrets / credentials
|
|
44
|
+
'auth', 'secret', 'credential', 'password', 'passwd', 'api[_-]?key', 'apikey',
|
|
45
|
+
'access[_-]?token', 'private[_-]?key', 'privatekey', 'seed[_-]?phrase', 'mnemonic',
|
|
46
|
+
'oauth', 'jwt', 'session[_-]?token', 'vault',
|
|
47
|
+
// payments / financial
|
|
48
|
+
'payment', 'billing', 'invoice', 'payout', 'stripe', 'paypal', 'charge', 'refund',
|
|
49
|
+
'kyc', 'ledger', 'wallet', 'pricing',
|
|
50
|
+
// crypto / on-chain / contracts
|
|
51
|
+
'x402', 'crypto', 'on[_-]?chain', 'onchain', 'blockchain', 'smart[_-]?contract',
|
|
52
|
+
'erc20', 'erc-20', 'usdc', '\\$kog', 'viem', 'web3',
|
|
53
|
+
// PHI / PII / regulated data
|
|
54
|
+
'\\bphi\\b', '\\bpii\\b', 'gdpr', 'hipaa', 'personal[_-]?data', 'health[_-]?record',
|
|
55
|
+
// schema / data migrations (high-blast-radius, hard to roll back)
|
|
56
|
+
'migration', 'prisma/migrations', 'drop[_-]?table', 'alter[_-]?table',
|
|
57
|
+
];
|
|
58
|
+
// Destructive / privileged operations — context-level matches force REGULATED.
|
|
59
|
+
const DESTRUCTIVE_KEYWORDS = [
|
|
60
|
+
'rm\\s+-rf', 'drop\\s+table', 'delete\\s+from', 'truncate\\s+table',
|
|
61
|
+
'force[_-]?push', '--force', 'chmod\\s+777', 'sudo\\b', 'kill\\s+-9',
|
|
62
|
+
];
|
|
63
|
+
// Sensitive directories — a deliverable under one of these forces REGULATED.
|
|
64
|
+
const SENSITIVE_DIRS = [
|
|
65
|
+
'banks/', 'wallet', 'ceo-wallet', 'gates/', 'policy/', 'contracts/', 'omel/',
|
|
66
|
+
'x402-base/', 'prisma/', 'credential', '.env', 'auth/', 'secrets/',
|
|
67
|
+
];
|
|
68
|
+
// Architectural / cross-cutting keywords — a match means the change is not a
|
|
69
|
+
// simple single-concern build → REGULATED.
|
|
70
|
+
const ARCHITECTURAL_KEYWORDS = [
|
|
71
|
+
'architect', 'refactor', 'migrate', 'cross[_-]?cutting', 'system[_-]?wide',
|
|
72
|
+
'redesign', 'database', 'schema', 'infrastructure', 'orchestrat', 'pipeline',
|
|
73
|
+
'framework', 'breaking[_-]?change', 'rewrite',
|
|
74
|
+
];
|
|
75
|
+
function compile(words) {
|
|
76
|
+
return new RegExp(`(${words.join('|')})`, 'i');
|
|
77
|
+
}
|
|
78
|
+
const SENSITIVE_RE = compile(SENSITIVE_KEYWORDS);
|
|
79
|
+
const DESTRUCTIVE_RE = compile(DESTRUCTIVE_KEYWORDS);
|
|
80
|
+
const ARCH_RE = compile(ARCHITECTURAL_KEYWORDS);
|
|
81
|
+
function asBool(v) {
|
|
82
|
+
return v === true || v === 'true' || v === 1 || v === '1';
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Classify a build into a ceremony-depth path. Pure + synchronous: it only reads
|
|
86
|
+
* the sprint JSON + task list, so it adds negligible cost relative to the
|
|
87
|
+
* ceremony it gates. Default-to-regulated on uncertainty.
|
|
88
|
+
*
|
|
89
|
+
* @param sprint the raw sprint object (may carry regulated/strict/fast_track/sovereign flags)
|
|
90
|
+
* @param tasks the loaded task list (each with deliverables/context/type)
|
|
91
|
+
*/
|
|
92
|
+
function classifyBuildPath(sprint, tasks) {
|
|
93
|
+
const triggers = [];
|
|
94
|
+
const taskList = Array.isArray(tasks) ? tasks : [];
|
|
95
|
+
const taskCount = taskList.length;
|
|
96
|
+
// Gather all the text we scan for sensitivity/architecture signals.
|
|
97
|
+
const deliverablePaths = [];
|
|
98
|
+
const codeFiles = [];
|
|
99
|
+
for (const t of taskList) {
|
|
100
|
+
const d = (t && t.deliverables) || {};
|
|
101
|
+
const code = Array.isArray(d.code) ? d.code : [];
|
|
102
|
+
const tests = Array.isArray(d.tests) ? d.tests : [];
|
|
103
|
+
const docs = Array.isArray(d.docs) ? d.docs : [];
|
|
104
|
+
codeFiles.push(...code);
|
|
105
|
+
deliverablePaths.push(...code, ...tests, ...docs);
|
|
106
|
+
}
|
|
107
|
+
const codeFileCount = new Set(codeFiles).size;
|
|
108
|
+
const contextText = taskList
|
|
109
|
+
.map((t) => `${(t && (t.context || t.title || t.id)) || ''} ${(t && (t.type || t.task_type)) || ''}`)
|
|
110
|
+
.join(' ');
|
|
111
|
+
const goalText = `${sprint?.name || sprint?.title || ''} ${sprint?.goal || sprint?.description || ''}`;
|
|
112
|
+
const pathText = deliverablePaths.join(' ');
|
|
113
|
+
const haystack = `${goalText} ${contextText} ${pathText}`;
|
|
114
|
+
// ── Explicit flags ────────────────────────────────────────────────────────
|
|
115
|
+
const forcedRegulated = asBool(sprint?.regulated) || asBool(sprint?.strict) || asBool(process.env.KOGNAI_FORCE_REGULATED);
|
|
116
|
+
const requestedFast = asBool(sprint?.fast_track) || asBool(sprint?.fast);
|
|
117
|
+
if (forcedRegulated)
|
|
118
|
+
triggers.push('explicit:regulated');
|
|
119
|
+
// ── Sensitivity ───────────────────────────────────────────────────────────
|
|
120
|
+
let sensitive = false;
|
|
121
|
+
if (SENSITIVE_RE.test(haystack)) {
|
|
122
|
+
sensitive = true;
|
|
123
|
+
triggers.push(`sensitive:keyword(${(haystack.match(SENSITIVE_RE) || [])[1]})`);
|
|
124
|
+
}
|
|
125
|
+
if (DESTRUCTIVE_RE.test(haystack)) {
|
|
126
|
+
sensitive = true;
|
|
127
|
+
triggers.push(`sensitive:destructive(${(haystack.match(DESTRUCTIVE_RE) || [])[1]})`);
|
|
128
|
+
}
|
|
129
|
+
const dirHit = SENSITIVE_DIRS.find((dir) => pathText.toLowerCase().includes(dir.toLowerCase()));
|
|
130
|
+
if (dirHit) {
|
|
131
|
+
sensitive = true;
|
|
132
|
+
triggers.push(`sensitive:path(${dirHit})`);
|
|
133
|
+
}
|
|
134
|
+
// ── Sovereign / regulated domain ──────────────────────────────────────────
|
|
135
|
+
const sovereign = asBool(sprint?.sovereign) || asBool(sprint?.regulated_domain);
|
|
136
|
+
if (sovereign)
|
|
137
|
+
triggers.push('sovereign');
|
|
138
|
+
// ── Complexity (ceremony-depth, NOT model routing) ────────────────────────
|
|
139
|
+
const estimated = String(sprint?.estimated_complexity || '').toLowerCase();
|
|
140
|
+
const archHit = ARCH_RE.test(haystack);
|
|
141
|
+
if (archHit)
|
|
142
|
+
triggers.push(`complex:architectural(${(haystack.match(ARCH_RE) || [])[1]})`);
|
|
143
|
+
if (taskCount > 1)
|
|
144
|
+
triggers.push(`complex:multi-task(${taskCount})`);
|
|
145
|
+
if (codeFileCount > 1)
|
|
146
|
+
triggers.push(`complex:multi-file(${codeFileCount})`);
|
|
147
|
+
if (estimated === 'high')
|
|
148
|
+
triggers.push('complex:estimated-high');
|
|
149
|
+
let complexity = 'low';
|
|
150
|
+
if (archHit || taskCount > 2 || codeFileCount > 2 || estimated === 'high')
|
|
151
|
+
complexity = 'high';
|
|
152
|
+
else if (taskCount > 1 || codeFileCount > 1 || estimated === 'medium')
|
|
153
|
+
complexity = 'medium';
|
|
154
|
+
// ── Decision (default-to-regulated) ───────────────────────────────────────
|
|
155
|
+
// A build is FAST-eligible only if it is provably simple AND nothing sensitive
|
|
156
|
+
// / sovereign / forced fired. Anything ambiguous → REGULATED.
|
|
157
|
+
const isSimple = taskCount === 1 && codeFileCount <= 1 && !archHit && estimated !== 'high';
|
|
158
|
+
const blockFast = forcedRegulated || sensitive || sovereign || !isSimple;
|
|
159
|
+
let path;
|
|
160
|
+
let reason;
|
|
161
|
+
if (blockFast) {
|
|
162
|
+
path = 'regulated';
|
|
163
|
+
reason =
|
|
164
|
+
forcedRegulated ? 'explicit --regulated/--strict flag'
|
|
165
|
+
: sensitive ? `sensitive build (${triggers.filter((t) => t.startsWith('sensitive')).join(', ')})`
|
|
166
|
+
: sovereign ? 'sovereign / regulated-domain build'
|
|
167
|
+
: `complexity above fast-track threshold (${triggers.filter((t) => t.startsWith('complex')).join(', ') || 'multi-concern'})`;
|
|
168
|
+
}
|
|
169
|
+
else {
|
|
170
|
+
path = 'fast';
|
|
171
|
+
reason = requestedFast
|
|
172
|
+
? 'fast-track opt-in; simple non-sensitive single-file build'
|
|
173
|
+
: 'simple non-sensitive single-file build → fast track';
|
|
174
|
+
}
|
|
175
|
+
return { path, reason, triggers, sensitive, sovereign, complexity, taskCount, codeFileCount };
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Append the triage decision to logs/routing/triage.jsonl (location-independent
|
|
179
|
+
* via engine-paths). Best-effort: never throws into the run loop. This is the
|
|
180
|
+
* audit trail required by the ticket — evidence that triage routes correctly and
|
|
181
|
+
* the means to audit any fast-tracked build later.
|
|
182
|
+
*/
|
|
183
|
+
function logBuildTriage(sprintId, result) {
|
|
184
|
+
try {
|
|
185
|
+
const file = (0, path_1.join)((0, engine_paths_1.resolveEnginePaths)().logs, 'routing', 'triage.jsonl');
|
|
186
|
+
(0, fs_1.mkdirSync)((0, path_1.dirname)(file), { recursive: true });
|
|
187
|
+
const row = {
|
|
188
|
+
sprint_id: sprintId,
|
|
189
|
+
path: result.path,
|
|
190
|
+
reason: result.reason,
|
|
191
|
+
triggers: result.triggers,
|
|
192
|
+
sensitive: result.sensitive,
|
|
193
|
+
sovereign: result.sovereign,
|
|
194
|
+
complexity: result.complexity,
|
|
195
|
+
task_count: result.taskCount,
|
|
196
|
+
code_file_count: result.codeFileCount,
|
|
197
|
+
logged_at: new Date().toISOString(),
|
|
198
|
+
};
|
|
199
|
+
(0, fs_1.appendFileSync)(file, JSON.stringify(row) + '\n');
|
|
200
|
+
}
|
|
201
|
+
catch { /* non-fatal — audit log must never break a run */ }
|
|
202
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DID resolver seam — TICKET-226 Phase A1 (template-carried polity extraction).
|
|
3
|
+
*
|
|
4
|
+
* How an agent ROLE maps to a DID is a product concern, not an engine concern
|
|
5
|
+
* (the core is template-agnostic — TICKET-215). This seam lets a consuming
|
|
6
|
+
* template override DID resolution. OPTIONAL override: if no resolver is set the
|
|
7
|
+
* engine keeps its existing inline behavior, so adding this is NON-BREAKING.
|
|
8
|
+
* Phase A2 injects Kognai's citizenship-backed resolver; Phase A3 removes the
|
|
9
|
+
* engine's inline default.
|
|
10
|
+
*/
|
|
11
|
+
export type DidResolver = (role: string) => string;
|
|
12
|
+
/** Inject a product-specific DID resolver (e.g. Kognai citizenship → did:kognai). */
|
|
13
|
+
export declare function setDidResolver(fn: DidResolver): void;
|
|
14
|
+
/** The injected resolver, or null if the engine should use its inline default. */
|
|
15
|
+
export declare function getDidResolver(): DidResolver | null;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setDidResolver = setDidResolver;
|
|
4
|
+
exports.getDidResolver = getDidResolver;
|
|
5
|
+
let _resolver = null;
|
|
6
|
+
/** Inject a product-specific DID resolver (e.g. Kognai citizenship → did:kognai). */
|
|
7
|
+
function setDidResolver(fn) { _resolver = fn; }
|
|
8
|
+
/** The injected resolver, or null if the engine should use its inline default. */
|
|
9
|
+
function getDidResolver() { return _resolver; }
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { AgentTask, ReviewResult, CTOProposal, CTOReport } from './orchestrate-engine';
|
|
2
|
+
export declare class SupervisorAgent {
|
|
3
|
+
private systemPrompt;
|
|
4
|
+
constructor();
|
|
5
|
+
reviewTask(task: AgentTask, files: string[]): Promise<ReviewResult>;
|
|
6
|
+
}
|
|
7
|
+
export declare class Supervisor2Agent {
|
|
8
|
+
private systemPrompt;
|
|
9
|
+
constructor();
|
|
10
|
+
reviewTask(task: AgentTask, files: string[]): Promise<ReviewResult>;
|
|
11
|
+
}
|
|
12
|
+
export interface DualReviewResult {
|
|
13
|
+
finalReview: ReviewResult;
|
|
14
|
+
review1: ReviewResult;
|
|
15
|
+
review2: ReviewResult;
|
|
16
|
+
consensus: boolean;
|
|
17
|
+
escalatedToCEO: boolean;
|
|
18
|
+
ceoDecision?: string;
|
|
19
|
+
}
|
|
20
|
+
export declare function reconcileSupervisorReviews(review1: ReviewResult, review2: ReviewResult, task: AgentTask, ceo: CEOAgent): Promise<DualReviewResult>;
|
|
21
|
+
export declare class CEOAgent {
|
|
22
|
+
private systemPrompt;
|
|
23
|
+
constructor();
|
|
24
|
+
reviewSprintProgress(tasks: AgentTask[]): Promise<string>;
|
|
25
|
+
resolveReviewConflict(task: AgentTask, approvalReview: ReviewResult, rejectionReview: ReviewResult, approver: string, rejecter: string): Promise<string>;
|
|
26
|
+
reviewCTOProposals(ctoReport: CTOReport): Promise<string>;
|
|
27
|
+
generateDailyReport(tasks: AgentTask[], stats: {
|
|
28
|
+
tasksExecuted: number;
|
|
29
|
+
approved: number;
|
|
30
|
+
rejected: number;
|
|
31
|
+
conflicts?: number;
|
|
32
|
+
escalations?: number;
|
|
33
|
+
}, ctoReport: string, ctoDecisions: string): Promise<void>;
|
|
34
|
+
}
|
|
35
|
+
export declare class CTODataCollector {
|
|
36
|
+
collect(): string;
|
|
37
|
+
}
|
|
38
|
+
export declare class CTOAgent {
|
|
39
|
+
private systemPrompt;
|
|
40
|
+
private dataCollector;
|
|
41
|
+
constructor();
|
|
42
|
+
analyze(): Promise<CTOReport>;
|
|
43
|
+
/**
|
|
44
|
+
* Post-sprint analysis: autonomous retrospective that runs after every sprint.
|
|
45
|
+
* Analyzes sprint results, detects failure patterns, and saves a report.
|
|
46
|
+
* This runs the CTO techwatch `post-sprint-analysis` watch type.
|
|
47
|
+
*/
|
|
48
|
+
postSprintAnalysis(tasks: any[], stats: any): Promise<string>;
|
|
49
|
+
}
|
|
50
|
+
export interface AgentSpawnSpec {
|
|
51
|
+
name: string;
|
|
52
|
+
role: string;
|
|
53
|
+
llm: 'minimax' | 'anthropic';
|
|
54
|
+
trigger: string;
|
|
55
|
+
prompt_summary: string;
|
|
56
|
+
}
|
|
57
|
+
export interface SpawnGateResult {
|
|
58
|
+
approved: boolean;
|
|
59
|
+
/** Human-readable reason when not approved (rejected or pending). */
|
|
60
|
+
rejection_reason?: string;
|
|
61
|
+
/** True when the spawn is suspended awaiting an out-of-band (e.g. human) approval. */
|
|
62
|
+
pending_approval?: boolean;
|
|
63
|
+
/** Optional one-line audit string logged on an approved decision. */
|
|
64
|
+
audit?: string;
|
|
65
|
+
}
|
|
66
|
+
export type SpawnGate = (spec: AgentSpawnSpec) => SpawnGateResult;
|
|
67
|
+
export declare class AgentCreator {
|
|
68
|
+
private readonly spawnGate?;
|
|
69
|
+
constructor(spawnGate?: SpawnGate | undefined);
|
|
70
|
+
createAgent(spec: NonNullable<CTOProposal['agent_spec']>): string;
|
|
71
|
+
}
|