sdd-agent-platform 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +405 -0
- package/dist/packages/cli/src/main.d.ts +2 -0
- package/dist/packages/cli/src/main.js +1499 -0
- package/dist/packages/cli/src/main.js.map +1 -0
- package/dist/packages/core/src/ai-tools.d.ts +50 -0
- package/dist/packages/core/src/ai-tools.js +223 -0
- package/dist/packages/core/src/ai-tools.js.map +1 -0
- package/dist/packages/core/src/index.d.ts +1016 -0
- package/dist/packages/core/src/index.js +4824 -0
- package/dist/packages/core/src/index.js.map +1 -0
- package/dist/packages/core/src/instructions.d.ts +14 -0
- package/dist/packages/core/src/instructions.js +117 -0
- package/dist/packages/core/src/instructions.js.map +1 -0
- package/package.json +52 -0
- package/tsconfig.build.json +6 -0
|
@@ -0,0 +1,1016 @@
|
|
|
1
|
+
import { type AiProjectionResult, type AiToolSelection } from './ai-tools.js';
|
|
2
|
+
export * from './ai-tools.js';
|
|
3
|
+
export * from './instructions.js';
|
|
4
|
+
export declare const RUNTIME_VERSION = "phase-1.2-runtime-skeleton";
|
|
5
|
+
export declare const PROJECT_CONFIG_CONTRACT = "phase-1.2-project-contract";
|
|
6
|
+
export declare const RUN_STATE_CONTRACT = "phase-1.2-run-state-contract";
|
|
7
|
+
export declare const EVENT_LOG_CONTRACT = "phase-1.2-event-log-contract";
|
|
8
|
+
export declare const ARTIFACT_PATH_CONTRACT = "phase-1.2-artifact-path-contract";
|
|
9
|
+
export declare const LEGACY_LIFECYCLE_DECISION_CONTRACT = "phase-1.2-lifecycle-decision-contract";
|
|
10
|
+
export declare const LIFECYCLE_DECISION_CONTRACT = "sdd-lifecycle-decision-v1";
|
|
11
|
+
export declare const LIFECYCLE_DECISION_VERSION = "1.3.0";
|
|
12
|
+
export declare const SDD_RESULT_CONTRACT = "sdd-result-v1";
|
|
13
|
+
export declare const SDD_RESULT_VERSION = "1.3.0";
|
|
14
|
+
export declare const DELEGATION_LIVENESS_CONTRACT = "sdd-delegation-liveness-v1";
|
|
15
|
+
export declare const DELEGATION_LIVENESS_VERSION = "1.3.0";
|
|
16
|
+
export declare const ARTIFACT_RESULT_INGESTION_CONTRACT_VERSION = "phase-3.6-artifact-result-ingestion-v1";
|
|
17
|
+
export declare const TASK_GRAPH_PLANNER_CONTRACT_VERSION = "phase-3.9-task-graph-planner-v1";
|
|
18
|
+
export declare const WAVE_PLANNER_CONTRACT_VERSION = "phase-3.10-wave-planner-v1";
|
|
19
|
+
export declare const BACKGROUND_EXECUTOR_CONTRACT_VERSION = "phase-3.11-background-executor-v1";
|
|
20
|
+
export declare const WAVE_EXECUTOR_CONTRACT_VERSION = "phase-3.12-wave-executor-v1";
|
|
21
|
+
export declare const LOCAL_RUN_INDEX_CONTRACT_VERSION = "phase-3.13-local-run-index-v1";
|
|
22
|
+
export declare const GOVERNANCE_POLICY_CONTRACT_VERSION = "phase-3.14-governance-policy-v1";
|
|
23
|
+
export type DoctorLevel = 'PASS' | 'WARN' | 'FAIL';
|
|
24
|
+
export type RunStatus = 'created' | 'running' | 'completed' | 'blocked' | 'failed' | 'archived';
|
|
25
|
+
export type LifecycleProfile = 'direct' | 'compact' | 'full' | 'research';
|
|
26
|
+
export type LifecycleConfidence = 'high' | 'medium' | 'low';
|
|
27
|
+
export type SddResultStatus = 'PASS' | 'PASS_WITH_GAPS' | 'FAIL' | 'BLOCKED' | 'TIMED_OUT' | 'CANCELLED';
|
|
28
|
+
export type DelegationRunMode = 'foreground' | 'background';
|
|
29
|
+
export type DelegationStatus = 'PENDING' | 'RUNNING' | 'COMPLETED' | 'FAILED' | 'TIMED_OUT' | 'CANCELLED' | 'RECOVERABLE' | 'STALE';
|
|
30
|
+
export type GoalVerifyStatus = 'PASS' | 'PASS_WITH_GAPS' | 'FAIL' | 'BLOCKED';
|
|
31
|
+
export type ArtifactResultIngestionStatus = 'accepted' | 'rejected';
|
|
32
|
+
export type DetectionConfidence = 'high' | 'medium' | 'low';
|
|
33
|
+
export interface DetectionEvidence {
|
|
34
|
+
kind: string;
|
|
35
|
+
detail: string;
|
|
36
|
+
weight: number;
|
|
37
|
+
}
|
|
38
|
+
export interface ProjectDetectionCandidate {
|
|
39
|
+
id: string;
|
|
40
|
+
language: string;
|
|
41
|
+
framework: string;
|
|
42
|
+
score: number;
|
|
43
|
+
confidence: DetectionConfidence;
|
|
44
|
+
evidence: DetectionEvidence[];
|
|
45
|
+
validationDefault: string[];
|
|
46
|
+
}
|
|
47
|
+
export interface ProjectDetection {
|
|
48
|
+
primary: ProjectDetectionCandidate;
|
|
49
|
+
candidates: ProjectDetectionCandidate[];
|
|
50
|
+
mixed_stack: boolean;
|
|
51
|
+
}
|
|
52
|
+
export interface ProjectConfig {
|
|
53
|
+
contract: typeof PROJECT_CONFIG_CONTRACT;
|
|
54
|
+
project: {
|
|
55
|
+
name: string;
|
|
56
|
+
language: string;
|
|
57
|
+
framework: string;
|
|
58
|
+
};
|
|
59
|
+
detection?: {
|
|
60
|
+
confidence: DetectionConfidence;
|
|
61
|
+
mixed_stack: boolean;
|
|
62
|
+
primary: string;
|
|
63
|
+
candidates: Array<{
|
|
64
|
+
id: string;
|
|
65
|
+
confidence: DetectionConfidence;
|
|
66
|
+
score: number;
|
|
67
|
+
}>;
|
|
68
|
+
};
|
|
69
|
+
sdd: {
|
|
70
|
+
spec_dir: string;
|
|
71
|
+
docs_language: string;
|
|
72
|
+
compatible_with: string;
|
|
73
|
+
};
|
|
74
|
+
validation: {
|
|
75
|
+
default: string[];
|
|
76
|
+
};
|
|
77
|
+
editing: {
|
|
78
|
+
prefer_hashline: boolean;
|
|
79
|
+
native_edit_fallback: boolean;
|
|
80
|
+
};
|
|
81
|
+
runtime: {
|
|
82
|
+
background_write: boolean;
|
|
83
|
+
worktree_isolation: boolean;
|
|
84
|
+
sync_back_mode: 'proposal';
|
|
85
|
+
};
|
|
86
|
+
lifecycle: {
|
|
87
|
+
decision_required: boolean;
|
|
88
|
+
profiles: LifecycleProfile[];
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
export type ToolCapabilityCategory = 'runtime' | 'editing' | 'git' | 'validation' | 'browser' | 'artifact' | 'governance';
|
|
92
|
+
export type ToolCapabilitySideEffect = 'read_only' | 'local_write' | 'command_execution' | 'external_interaction';
|
|
93
|
+
export interface ToolCapability {
|
|
94
|
+
id: string;
|
|
95
|
+
title: string;
|
|
96
|
+
category: ToolCapabilityCategory;
|
|
97
|
+
summary: string;
|
|
98
|
+
sideEffect: ToolCapabilitySideEffect;
|
|
99
|
+
defaultAvailable: boolean;
|
|
100
|
+
allowedStages: string[];
|
|
101
|
+
requiredEvidence: string[];
|
|
102
|
+
forbiddenUses: string[];
|
|
103
|
+
}
|
|
104
|
+
export interface ToolCapabilityRegistry {
|
|
105
|
+
version: string;
|
|
106
|
+
capabilities: ToolCapability[];
|
|
107
|
+
}
|
|
108
|
+
export type ToolPluginEntryKind = 'cli' | 'adapter' | 'command' | 'manual';
|
|
109
|
+
export type ToolPluginLoadMode = 'static_manifest' | 'readonly_asset';
|
|
110
|
+
export interface ToolPluginContract {
|
|
111
|
+
id: string;
|
|
112
|
+
title: string;
|
|
113
|
+
version: string;
|
|
114
|
+
capabilityId: string;
|
|
115
|
+
entryKind: ToolPluginEntryKind;
|
|
116
|
+
assetPath: string;
|
|
117
|
+
loadMode: ToolPluginLoadMode;
|
|
118
|
+
checksum: string | null;
|
|
119
|
+
requiredEvidence: string[];
|
|
120
|
+
forbiddenUses: string[];
|
|
121
|
+
}
|
|
122
|
+
export interface ToolPluginContractRegistry {
|
|
123
|
+
version: string;
|
|
124
|
+
contracts: ToolPluginContract[];
|
|
125
|
+
}
|
|
126
|
+
export type DelegationQueueStatusSource = 'run_state_delegation';
|
|
127
|
+
export interface DelegationQueueItem {
|
|
128
|
+
id: string;
|
|
129
|
+
runId: string;
|
|
130
|
+
delegationId: string;
|
|
131
|
+
taskId: string;
|
|
132
|
+
agent: string;
|
|
133
|
+
requestedCapabilityId: string;
|
|
134
|
+
dedupeKey: string;
|
|
135
|
+
status: DelegationStatus;
|
|
136
|
+
statusSource: DelegationQueueStatusSource;
|
|
137
|
+
runMode: DelegationRunMode;
|
|
138
|
+
expectedArtifact: string;
|
|
139
|
+
requiredEvidence: string[];
|
|
140
|
+
createdAt: string;
|
|
141
|
+
updatedAt: string;
|
|
142
|
+
}
|
|
143
|
+
export interface DelegationQueueSnapshot {
|
|
144
|
+
version: string;
|
|
145
|
+
items: DelegationQueueItem[];
|
|
146
|
+
}
|
|
147
|
+
export interface DelegationStateTransition {
|
|
148
|
+
from: DelegationStatus;
|
|
149
|
+
to: DelegationStatus;
|
|
150
|
+
event: string;
|
|
151
|
+
terminal: boolean;
|
|
152
|
+
}
|
|
153
|
+
export interface DelegationStateMachine {
|
|
154
|
+
version: string;
|
|
155
|
+
statuses: DelegationStatus[];
|
|
156
|
+
terminalStatuses: DelegationStatus[];
|
|
157
|
+
transitions: DelegationStateTransition[];
|
|
158
|
+
}
|
|
159
|
+
export interface DelegationStateTransitionValidation {
|
|
160
|
+
valid: boolean;
|
|
161
|
+
from: DelegationStatus;
|
|
162
|
+
to: DelegationStatus;
|
|
163
|
+
event: string | null;
|
|
164
|
+
issues: ContractValidationIssue[];
|
|
165
|
+
}
|
|
166
|
+
export type WorkerAdapterKind = 'claude_code_subagent' | 'sdd_cli_task' | 'manual_handoff';
|
|
167
|
+
export type WorkerAdapterExitStatus = 'completed' | 'failed' | 'cancelled' | 'timed_out' | 'blocked';
|
|
168
|
+
export interface WorkerAdapterPayloadContract {
|
|
169
|
+
queueItemId: string;
|
|
170
|
+
runId: string;
|
|
171
|
+
taskId: string;
|
|
172
|
+
delegationId: string;
|
|
173
|
+
stateMachineVersion: string;
|
|
174
|
+
}
|
|
175
|
+
export interface WorkerAdapterOutputContract {
|
|
176
|
+
artifactReference: string;
|
|
177
|
+
terminalStatus: DelegationStatus[];
|
|
178
|
+
exitStatuses: WorkerAdapterExitStatus[];
|
|
179
|
+
requiredEvents: string[];
|
|
180
|
+
}
|
|
181
|
+
export interface WorkerAdapterContract {
|
|
182
|
+
id: string;
|
|
183
|
+
title: string;
|
|
184
|
+
version: string;
|
|
185
|
+
kind: WorkerAdapterKind;
|
|
186
|
+
capabilityId: string;
|
|
187
|
+
pluginContractId: string;
|
|
188
|
+
input: WorkerAdapterPayloadContract;
|
|
189
|
+
output: WorkerAdapterOutputContract;
|
|
190
|
+
sideEffect: ToolCapabilitySideEffect;
|
|
191
|
+
permissionPrompt: string;
|
|
192
|
+
requiredEvidence: string[];
|
|
193
|
+
forbiddenUses: string[];
|
|
194
|
+
}
|
|
195
|
+
export interface WorkerAdapterContractRegistry {
|
|
196
|
+
version: string;
|
|
197
|
+
adapters: WorkerAdapterContract[];
|
|
198
|
+
}
|
|
199
|
+
export type WorktreeIsolationMode = 'none' | 'required' | 'blocked' | 'manual';
|
|
200
|
+
export interface WorktreeIsolationPeer {
|
|
201
|
+
taskId: string;
|
|
202
|
+
affectedFiles: string[];
|
|
203
|
+
risk: string[];
|
|
204
|
+
}
|
|
205
|
+
export interface WorktreeIsolationGate {
|
|
206
|
+
name: string;
|
|
207
|
+
passed: boolean;
|
|
208
|
+
message: string;
|
|
209
|
+
}
|
|
210
|
+
export interface WorktreeIsolationDecision {
|
|
211
|
+
version: string;
|
|
212
|
+
taskId: string;
|
|
213
|
+
mode: WorktreeIsolationMode;
|
|
214
|
+
safeConcurrency: boolean;
|
|
215
|
+
capabilityId: string;
|
|
216
|
+
capabilitySideEffect: ToolCapabilitySideEffect;
|
|
217
|
+
affectedFiles: string[];
|
|
218
|
+
risk: string[];
|
|
219
|
+
peers: WorktreeIsolationPeer[];
|
|
220
|
+
overlaps: Array<{
|
|
221
|
+
peerTaskId: string;
|
|
222
|
+
files: string[];
|
|
223
|
+
}>;
|
|
224
|
+
gates: WorktreeIsolationGate[];
|
|
225
|
+
reasons: string[];
|
|
226
|
+
}
|
|
227
|
+
export type WorktreeLifecycleStatus = 'created' | 'kept' | 'removed';
|
|
228
|
+
export interface WorktreeLifecycleRecord {
|
|
229
|
+
contract: typeof WORKTREE_LIFECYCLE_CONTRACT_VERSION;
|
|
230
|
+
runId: string;
|
|
231
|
+
taskId: string;
|
|
232
|
+
worktreeId: string;
|
|
233
|
+
status: WorktreeLifecycleStatus;
|
|
234
|
+
branchName: string;
|
|
235
|
+
worktreePath: string;
|
|
236
|
+
baseRef: string;
|
|
237
|
+
createdAt: string;
|
|
238
|
+
updatedAt: string;
|
|
239
|
+
removedAt: string | null;
|
|
240
|
+
keepReason: string | null;
|
|
241
|
+
dirty: boolean;
|
|
242
|
+
}
|
|
243
|
+
export interface WorktreeLifecycleInspection {
|
|
244
|
+
runId: string;
|
|
245
|
+
contract: typeof WORKTREE_LIFECYCLE_CONTRACT_VERSION;
|
|
246
|
+
records: WorktreeLifecycleRecord[];
|
|
247
|
+
valid: boolean;
|
|
248
|
+
issues: ContractValidationIssue[];
|
|
249
|
+
}
|
|
250
|
+
export interface ArtifactResultIngestionRecord {
|
|
251
|
+
contract: typeof ARTIFACT_RESULT_INGESTION_CONTRACT_VERSION;
|
|
252
|
+
runId: string;
|
|
253
|
+
delegationId: string;
|
|
254
|
+
task: string;
|
|
255
|
+
agent: string;
|
|
256
|
+
artifactPath: string;
|
|
257
|
+
status: ArtifactResultIngestionStatus;
|
|
258
|
+
resultStatus: SddResultStatus | null;
|
|
259
|
+
delegationStatus: DelegationStatus | null;
|
|
260
|
+
ingestedAt: string;
|
|
261
|
+
issues: ContractValidationIssue[];
|
|
262
|
+
gaps: SddTaskGap[];
|
|
263
|
+
}
|
|
264
|
+
export interface ArtifactResultIngestionResult {
|
|
265
|
+
valid: boolean;
|
|
266
|
+
duplicate: boolean;
|
|
267
|
+
record: ArtifactResultIngestionRecord;
|
|
268
|
+
delegation: DelegationRecord | null;
|
|
269
|
+
}
|
|
270
|
+
export interface ArtifactResultIngestionInspection {
|
|
271
|
+
runId: string;
|
|
272
|
+
contract: typeof ARTIFACT_RESULT_INGESTION_CONTRACT_VERSION;
|
|
273
|
+
records: ArtifactResultIngestionRecord[];
|
|
274
|
+
valid: boolean;
|
|
275
|
+
issues: ContractValidationIssue[];
|
|
276
|
+
}
|
|
277
|
+
export interface LifecycleDecisionRecord {
|
|
278
|
+
contract: typeof LIFECYCLE_DECISION_CONTRACT | typeof LEGACY_LIFECYCLE_DECISION_CONTRACT;
|
|
279
|
+
version?: typeof LIFECYCLE_DECISION_VERSION;
|
|
280
|
+
model_version: string;
|
|
281
|
+
input_summary: Record<string, unknown>;
|
|
282
|
+
decision: {
|
|
283
|
+
profile: LifecycleProfile | null;
|
|
284
|
+
confidence: LifecycleConfidence | null;
|
|
285
|
+
hard_gate_hits: string[];
|
|
286
|
+
required_stages: string[];
|
|
287
|
+
skipped_stages: string[];
|
|
288
|
+
human_checkpoint_required: boolean;
|
|
289
|
+
};
|
|
290
|
+
reasons: string[];
|
|
291
|
+
escalation_triggers: string[];
|
|
292
|
+
downgrade_reason: string | null;
|
|
293
|
+
audit: {
|
|
294
|
+
decided_at: string | null;
|
|
295
|
+
decided_by: 'command' | 'runtime' | 'user_override' | null;
|
|
296
|
+
policy_version: string;
|
|
297
|
+
source_artifacts: string[];
|
|
298
|
+
};
|
|
299
|
+
}
|
|
300
|
+
export type SignalClarity = 'high' | 'medium' | 'low';
|
|
301
|
+
export type EstimatedChangeSize = 'tiny' | 'small' | 'medium' | 'large';
|
|
302
|
+
export type ImpactConfidence = 'high' | 'medium' | 'low';
|
|
303
|
+
export type ValidationClarity = 'clear' | 'partial' | 'unclear';
|
|
304
|
+
export type OrchestrationUncertainty = 'low' | 'medium' | 'high';
|
|
305
|
+
export type Reversibility = 'reversible' | 'irreversible' | 'unknown';
|
|
306
|
+
export interface LifecycleDecisionSignals {
|
|
307
|
+
intent_clarity: SignalClarity;
|
|
308
|
+
acceptance_clarity: SignalClarity;
|
|
309
|
+
estimated_change_size: EstimatedChangeSize;
|
|
310
|
+
task_count_estimate: number;
|
|
311
|
+
file_count_estimate: number;
|
|
312
|
+
affected_layers: string[];
|
|
313
|
+
affected_contracts: string[];
|
|
314
|
+
dependency_fanout: 'none' | 'local' | 'multi_component' | 'unknown';
|
|
315
|
+
impact_confidence: ImpactConfidence;
|
|
316
|
+
risk_tags: string[];
|
|
317
|
+
reversibility: Reversibility;
|
|
318
|
+
validation_clarity: ValidationClarity;
|
|
319
|
+
validation_available: boolean;
|
|
320
|
+
validation_cost: 'cheap' | 'moderate' | 'expensive' | 'unknown';
|
|
321
|
+
policy_hits: string[];
|
|
322
|
+
permission_required: string[];
|
|
323
|
+
requires_agents: boolean;
|
|
324
|
+
handoff_count: number;
|
|
325
|
+
artifact_dependency: boolean;
|
|
326
|
+
runtime_recovery_need: boolean;
|
|
327
|
+
orchestration_uncertainty: OrchestrationUncertainty;
|
|
328
|
+
human_checkpoint_required: boolean;
|
|
329
|
+
approval_reason: string[];
|
|
330
|
+
source_artifacts: string[];
|
|
331
|
+
can_scout_impact: boolean;
|
|
332
|
+
architecture_decision_required: boolean;
|
|
333
|
+
external_unknown: boolean;
|
|
334
|
+
}
|
|
335
|
+
export interface LifecycleDecisionGateResult {
|
|
336
|
+
record: LifecycleDecisionRecord;
|
|
337
|
+
checkpointRequired: boolean;
|
|
338
|
+
boundaries: string[];
|
|
339
|
+
}
|
|
340
|
+
export interface ArtifactIndexEntry {
|
|
341
|
+
path: string;
|
|
342
|
+
kind: string;
|
|
343
|
+
task: string | null;
|
|
344
|
+
agent: string | null;
|
|
345
|
+
createdAt: string;
|
|
346
|
+
}
|
|
347
|
+
export interface RunState {
|
|
348
|
+
contract: typeof RUN_STATE_CONTRACT;
|
|
349
|
+
runtimeVersion: typeof RUNTIME_VERSION;
|
|
350
|
+
runId: string;
|
|
351
|
+
status: RunStatus;
|
|
352
|
+
phase: string | null;
|
|
353
|
+
currentTask: string | null;
|
|
354
|
+
createdAt: string;
|
|
355
|
+
updatedAt: string;
|
|
356
|
+
projectRoot: string;
|
|
357
|
+
projectConfigPath: string;
|
|
358
|
+
eventLogPath: string;
|
|
359
|
+
artifactRoot: string;
|
|
360
|
+
lifecycleDecision: LifecycleDecisionRecord | null;
|
|
361
|
+
tasks: Record<string, unknown>;
|
|
362
|
+
agents: Record<string, unknown>;
|
|
363
|
+
delegations: Record<string, DelegationRecord>;
|
|
364
|
+
artifacts: ArtifactIndexEntry[];
|
|
365
|
+
artifactIngestions: Record<string, ArtifactResultIngestionRecord>;
|
|
366
|
+
worktrees: Record<string, WorktreeLifecycleRecord>;
|
|
367
|
+
validation: {
|
|
368
|
+
status: 'not_run' | 'pass' | 'pass_with_gaps' | 'fail' | 'blocked';
|
|
369
|
+
commands: string[];
|
|
370
|
+
evidence: string[];
|
|
371
|
+
};
|
|
372
|
+
syncBack: {
|
|
373
|
+
mode: 'proposal';
|
|
374
|
+
proposalPath: string | null;
|
|
375
|
+
status: 'not_created' | 'proposed' | 'applied';
|
|
376
|
+
};
|
|
377
|
+
}
|
|
378
|
+
export interface RuntimeEvent {
|
|
379
|
+
contract: typeof EVENT_LOG_CONTRACT;
|
|
380
|
+
time: string;
|
|
381
|
+
event: string;
|
|
382
|
+
runId: string;
|
|
383
|
+
summary?: string;
|
|
384
|
+
data?: Record<string, unknown>;
|
|
385
|
+
}
|
|
386
|
+
export interface DoctorCheck {
|
|
387
|
+
level: DoctorLevel;
|
|
388
|
+
check: string;
|
|
389
|
+
message: string;
|
|
390
|
+
action?: string;
|
|
391
|
+
}
|
|
392
|
+
export interface DoctorReport {
|
|
393
|
+
status: DoctorLevel;
|
|
394
|
+
checks: DoctorCheck[];
|
|
395
|
+
}
|
|
396
|
+
export type SddTaskStatus = 'pending' | 'in_progress' | 'completed' | 'blocked' | 'deferred' | 'unknown';
|
|
397
|
+
export type SddGapSeverity = 'blocking' | 'warning';
|
|
398
|
+
export type SddGapType = 'Document Gap' | 'Task Gap' | 'Dependency Gap';
|
|
399
|
+
export interface SddTaskSourceLocation {
|
|
400
|
+
filePath: string;
|
|
401
|
+
heading: string | null;
|
|
402
|
+
lineStart: number;
|
|
403
|
+
lineEnd: number;
|
|
404
|
+
}
|
|
405
|
+
export interface SddTask {
|
|
406
|
+
id: string;
|
|
407
|
+
title: string | null;
|
|
408
|
+
status: SddTaskStatus;
|
|
409
|
+
wave: number | null;
|
|
410
|
+
dependsOn: string[];
|
|
411
|
+
affectedFiles: string[];
|
|
412
|
+
validation: string[];
|
|
413
|
+
risk: string[];
|
|
414
|
+
boundary: string | null;
|
|
415
|
+
acceptance: string[];
|
|
416
|
+
implementationNotes: string | null;
|
|
417
|
+
rawMetadata: Record<string, string | string[]>;
|
|
418
|
+
source: SddTaskSourceLocation;
|
|
419
|
+
}
|
|
420
|
+
export interface SddTaskGap {
|
|
421
|
+
type: SddGapType;
|
|
422
|
+
severity: SddGapSeverity;
|
|
423
|
+
taskId: string | null;
|
|
424
|
+
field: string;
|
|
425
|
+
message: string;
|
|
426
|
+
recommendation: string;
|
|
427
|
+
}
|
|
428
|
+
export interface SddTaskModel {
|
|
429
|
+
branch: string;
|
|
430
|
+
specPath: string;
|
|
431
|
+
planPath: string;
|
|
432
|
+
tasksPath: string;
|
|
433
|
+
documents: {
|
|
434
|
+
specExists: boolean;
|
|
435
|
+
planExists: boolean;
|
|
436
|
+
tasksExists: boolean;
|
|
437
|
+
};
|
|
438
|
+
tasks: SddTask[];
|
|
439
|
+
gaps: SddTaskGap[];
|
|
440
|
+
}
|
|
441
|
+
export type TaskGraphEdgeType = 'depends_on' | 'file_overlap';
|
|
442
|
+
export interface TaskGraphNode {
|
|
443
|
+
taskId: string;
|
|
444
|
+
title: string | null;
|
|
445
|
+
status: SddTaskStatus;
|
|
446
|
+
wave: number | null;
|
|
447
|
+
dependsOn: string[];
|
|
448
|
+
affectedFiles: string[];
|
|
449
|
+
risk: string[];
|
|
450
|
+
validation: string[];
|
|
451
|
+
source: SddTaskSourceLocation;
|
|
452
|
+
}
|
|
453
|
+
export interface TaskGraphEdge {
|
|
454
|
+
from: string;
|
|
455
|
+
to: string;
|
|
456
|
+
type: TaskGraphEdgeType;
|
|
457
|
+
files: string[];
|
|
458
|
+
}
|
|
459
|
+
export interface TaskGraphDiagnostic {
|
|
460
|
+
severity: SddGapSeverity;
|
|
461
|
+
taskId: string | null;
|
|
462
|
+
field: string;
|
|
463
|
+
message: string;
|
|
464
|
+
recommendation: string;
|
|
465
|
+
}
|
|
466
|
+
export interface TaskGraphPlan {
|
|
467
|
+
version: typeof TASK_GRAPH_PLANNER_CONTRACT_VERSION;
|
|
468
|
+
branch: string;
|
|
469
|
+
valid: boolean;
|
|
470
|
+
nodes: TaskGraphNode[];
|
|
471
|
+
dependencyEdges: TaskGraphEdge[];
|
|
472
|
+
fileOverlapEdges: TaskGraphEdge[];
|
|
473
|
+
diagnostics: TaskGraphDiagnostic[];
|
|
474
|
+
summary: {
|
|
475
|
+
tasks: number;
|
|
476
|
+
dependencies: number;
|
|
477
|
+
fileOverlaps: number;
|
|
478
|
+
highRiskTasks: string[];
|
|
479
|
+
validationCommands: string[];
|
|
480
|
+
};
|
|
481
|
+
}
|
|
482
|
+
export interface WavePlanTask {
|
|
483
|
+
taskId: string;
|
|
484
|
+
isolationMode: WorktreeIsolationMode;
|
|
485
|
+
reasons: string[];
|
|
486
|
+
}
|
|
487
|
+
export interface WavePlanWave {
|
|
488
|
+
index: number;
|
|
489
|
+
tasks: WavePlanTask[];
|
|
490
|
+
}
|
|
491
|
+
export interface WavePlanGate {
|
|
492
|
+
taskId: string;
|
|
493
|
+
gate: 'manual' | 'blocked';
|
|
494
|
+
reasons: string[];
|
|
495
|
+
}
|
|
496
|
+
export interface WavePlan {
|
|
497
|
+
version: typeof WAVE_PLANNER_CONTRACT_VERSION;
|
|
498
|
+
branch: string;
|
|
499
|
+
valid: boolean;
|
|
500
|
+
waves: WavePlanWave[];
|
|
501
|
+
manualGates: WavePlanGate[];
|
|
502
|
+
blockedTasks: WavePlanGate[];
|
|
503
|
+
diagnostics: TaskGraphDiagnostic[];
|
|
504
|
+
summary: {
|
|
505
|
+
tasks: number;
|
|
506
|
+
waves: number;
|
|
507
|
+
plannedTasks: number;
|
|
508
|
+
manualTasks: number;
|
|
509
|
+
blockedTasks: number;
|
|
510
|
+
};
|
|
511
|
+
}
|
|
512
|
+
export type BackgroundExecutorStatus = 'claimed' | 'completed' | 'failed' | 'blocked';
|
|
513
|
+
export interface BackgroundExecutorRunOptions {
|
|
514
|
+
branch?: string;
|
|
515
|
+
runId?: string;
|
|
516
|
+
taskId: string;
|
|
517
|
+
agent?: string;
|
|
518
|
+
workerAdapterId?: string;
|
|
519
|
+
artifactPath?: string;
|
|
520
|
+
delegationId?: string;
|
|
521
|
+
timeoutSeconds?: number;
|
|
522
|
+
}
|
|
523
|
+
export interface BackgroundExecutorResult {
|
|
524
|
+
version: typeof BACKGROUND_EXECUTOR_CONTRACT_VERSION;
|
|
525
|
+
runId: string;
|
|
526
|
+
taskId: string;
|
|
527
|
+
delegationId: string | null;
|
|
528
|
+
queueItemId: string | null;
|
|
529
|
+
workerAdapterId: string;
|
|
530
|
+
status: BackgroundExecutorStatus;
|
|
531
|
+
artifactPath: string | null;
|
|
532
|
+
ingestion: ArtifactResultIngestionRecord | null;
|
|
533
|
+
issues: ContractValidationIssue[];
|
|
534
|
+
message: string;
|
|
535
|
+
}
|
|
536
|
+
export interface BackgroundExecutorInspection {
|
|
537
|
+
version: typeof BACKGROUND_EXECUTOR_CONTRACT_VERSION;
|
|
538
|
+
runId: string;
|
|
539
|
+
delegations: DelegationQueueItem[];
|
|
540
|
+
artifactIngestions: ArtifactResultIngestionRecord[];
|
|
541
|
+
runningDelegations: number;
|
|
542
|
+
terminalDelegations: number;
|
|
543
|
+
valid: boolean;
|
|
544
|
+
issues: ContractValidationIssue[];
|
|
545
|
+
}
|
|
546
|
+
export type WaveExecutorStrategy = 'fast-stop' | 'safe-continue';
|
|
547
|
+
export type WaveExecutorStatus = 'claimed' | 'completed' | 'failed' | 'blocked';
|
|
548
|
+
export interface WaveExecutorRunOptions {
|
|
549
|
+
branch?: string;
|
|
550
|
+
runId?: string;
|
|
551
|
+
capabilityId?: string;
|
|
552
|
+
agent?: string;
|
|
553
|
+
workerAdapterId?: string;
|
|
554
|
+
strategy?: WaveExecutorStrategy;
|
|
555
|
+
artifactPaths?: Record<string, string>;
|
|
556
|
+
}
|
|
557
|
+
export interface WaveExecutorTaskResult {
|
|
558
|
+
waveIndex: number;
|
|
559
|
+
taskId: string;
|
|
560
|
+
result: BackgroundExecutorResult;
|
|
561
|
+
}
|
|
562
|
+
export interface WaveExecutorResult {
|
|
563
|
+
version: typeof WAVE_EXECUTOR_CONTRACT_VERSION;
|
|
564
|
+
runId: string;
|
|
565
|
+
branch: string;
|
|
566
|
+
strategy: WaveExecutorStrategy;
|
|
567
|
+
status: WaveExecutorStatus;
|
|
568
|
+
plannedWaves: number;
|
|
569
|
+
executedWaves: number;
|
|
570
|
+
taskResults: WaveExecutorTaskResult[];
|
|
571
|
+
manualGates: WavePlanGate[];
|
|
572
|
+
blockedTasks: WavePlanGate[];
|
|
573
|
+
issues: ContractValidationIssue[];
|
|
574
|
+
message: string;
|
|
575
|
+
}
|
|
576
|
+
export interface WaveExecutorInspection {
|
|
577
|
+
version: typeof WAVE_EXECUTOR_CONTRACT_VERSION;
|
|
578
|
+
runId: string;
|
|
579
|
+
background: BackgroundExecutorInspection;
|
|
580
|
+
waveEvents: RuntimeEvent[];
|
|
581
|
+
valid: boolean;
|
|
582
|
+
issues: ContractValidationIssue[];
|
|
583
|
+
}
|
|
584
|
+
export type GovernancePolicyOperation = 'background_executor' | 'wave_executor' | 'sync_back_apply' | 'destructive_git' | 'external_interaction' | 'cleanup';
|
|
585
|
+
export type GovernancePolicyDecisionStatus = 'allow' | 'block' | 'confirm';
|
|
586
|
+
export interface GovernancePolicy {
|
|
587
|
+
version: typeof GOVERNANCE_POLICY_CONTRACT_VERSION;
|
|
588
|
+
concurrency: {
|
|
589
|
+
maxBackgroundDelegations: number;
|
|
590
|
+
maxWaveExecutors: number;
|
|
591
|
+
};
|
|
592
|
+
manualConfirmation: {
|
|
593
|
+
operations: GovernancePolicyOperation[];
|
|
594
|
+
workerAdapters: string[];
|
|
595
|
+
riskTags: string[];
|
|
596
|
+
};
|
|
597
|
+
cleanup: {
|
|
598
|
+
archiveOnly: true;
|
|
599
|
+
deleteRunHistory: false;
|
|
600
|
+
};
|
|
601
|
+
retry: {
|
|
602
|
+
reopenTerminalDelegation: false;
|
|
603
|
+
maxAttemptsPerDelegation: number;
|
|
604
|
+
};
|
|
605
|
+
stopConditions: string[];
|
|
606
|
+
audit: {
|
|
607
|
+
requiredEvents: string[];
|
|
608
|
+
requiredEvidence: string[];
|
|
609
|
+
};
|
|
610
|
+
}
|
|
611
|
+
export interface GovernancePolicyDecisionInput {
|
|
612
|
+
operation: GovernancePolicyOperation;
|
|
613
|
+
runId?: string;
|
|
614
|
+
taskId?: string;
|
|
615
|
+
workerAdapterId?: string;
|
|
616
|
+
riskTags?: string[];
|
|
617
|
+
approved?: boolean;
|
|
618
|
+
excludeQueueItemId?: string;
|
|
619
|
+
}
|
|
620
|
+
export interface GovernancePolicyDecision {
|
|
621
|
+
version: typeof GOVERNANCE_POLICY_CONTRACT_VERSION;
|
|
622
|
+
operation: GovernancePolicyOperation;
|
|
623
|
+
status: GovernancePolicyDecisionStatus;
|
|
624
|
+
allowed: boolean;
|
|
625
|
+
reasons: string[];
|
|
626
|
+
issues: ContractValidationIssue[];
|
|
627
|
+
policy: GovernancePolicy;
|
|
628
|
+
}
|
|
629
|
+
export interface SddResult {
|
|
630
|
+
contract: typeof SDD_RESULT_CONTRACT;
|
|
631
|
+
version: typeof SDD_RESULT_VERSION;
|
|
632
|
+
agent: string;
|
|
633
|
+
task: string;
|
|
634
|
+
status: SddResultStatus;
|
|
635
|
+
artifacts: string[];
|
|
636
|
+
rawMetadata: Record<string, string | string[]>;
|
|
637
|
+
}
|
|
638
|
+
export interface ContractValidationIssue {
|
|
639
|
+
field: string;
|
|
640
|
+
message: string;
|
|
641
|
+
recommendation: string;
|
|
642
|
+
}
|
|
643
|
+
export interface SddResultValidationReport {
|
|
644
|
+
valid: boolean;
|
|
645
|
+
result: SddResult | null;
|
|
646
|
+
issues: ContractValidationIssue[];
|
|
647
|
+
}
|
|
648
|
+
export interface SddResultArtifactTemplateOptions {
|
|
649
|
+
branch?: string;
|
|
650
|
+
taskId: string;
|
|
651
|
+
agent: string;
|
|
652
|
+
artifactPath: string;
|
|
653
|
+
status?: SddResultStatus;
|
|
654
|
+
}
|
|
655
|
+
export interface DelegationRecord {
|
|
656
|
+
contract: typeof DELEGATION_LIVENESS_CONTRACT;
|
|
657
|
+
version: typeof DELEGATION_LIVENESS_VERSION;
|
|
658
|
+
delegationId: string;
|
|
659
|
+
task: string;
|
|
660
|
+
agent: string;
|
|
661
|
+
runMode: DelegationRunMode;
|
|
662
|
+
blocking: boolean;
|
|
663
|
+
requiredForPhaseExit: boolean;
|
|
664
|
+
status: DelegationStatus;
|
|
665
|
+
startedAt: string;
|
|
666
|
+
lastHeartbeatAt: string | null;
|
|
667
|
+
timeoutSeconds: number;
|
|
668
|
+
expectedArtifact: string;
|
|
669
|
+
terminalEventRequired: boolean;
|
|
670
|
+
terminalEventAt?: string | null;
|
|
671
|
+
}
|
|
672
|
+
export interface DelegationValidationReport {
|
|
673
|
+
valid: boolean;
|
|
674
|
+
delegation: DelegationRecord;
|
|
675
|
+
terminal: boolean;
|
|
676
|
+
stale: boolean;
|
|
677
|
+
issues: ContractValidationIssue[];
|
|
678
|
+
}
|
|
679
|
+
export type SingleTaskLoopStatus = 'completed' | 'blocked' | 'failed';
|
|
680
|
+
export interface SingleTaskLoopOptions {
|
|
681
|
+
branch?: string;
|
|
682
|
+
taskId: string;
|
|
683
|
+
runId?: string;
|
|
684
|
+
implementArtifact?: string;
|
|
685
|
+
reviewArtifact?: string;
|
|
686
|
+
validationArtifact?: string;
|
|
687
|
+
debugArtifact?: string;
|
|
688
|
+
}
|
|
689
|
+
export interface SingleTaskLoopResult {
|
|
690
|
+
runId: string;
|
|
691
|
+
taskId: string;
|
|
692
|
+
status: SingleTaskLoopStatus;
|
|
693
|
+
task: SddTask | null;
|
|
694
|
+
gaps: SddTaskGap[];
|
|
695
|
+
requiredArtifacts: string[];
|
|
696
|
+
acceptedArtifacts: string[];
|
|
697
|
+
syncBackProposalPath: string;
|
|
698
|
+
message: string;
|
|
699
|
+
}
|
|
700
|
+
export interface GoalVerifyOptions {
|
|
701
|
+
branch?: string;
|
|
702
|
+
taskId: string;
|
|
703
|
+
runId: string;
|
|
704
|
+
reviewArtifact?: string;
|
|
705
|
+
validationArtifact?: string;
|
|
706
|
+
}
|
|
707
|
+
export interface AcceptanceCoverageItem {
|
|
708
|
+
acceptance: string;
|
|
709
|
+
status: GoalVerifyStatus | 'GAP';
|
|
710
|
+
evidence: string;
|
|
711
|
+
}
|
|
712
|
+
export interface GoalVerifyResult {
|
|
713
|
+
runId: string;
|
|
714
|
+
taskId: string;
|
|
715
|
+
status: GoalVerifyStatus;
|
|
716
|
+
task: SddTask | null;
|
|
717
|
+
reviewArtifact: string | null;
|
|
718
|
+
validationArtifact: string | null;
|
|
719
|
+
coverageArtifactPath: string;
|
|
720
|
+
syncBackProposalPath: string;
|
|
721
|
+
acceptanceCoverage: AcceptanceCoverageItem[];
|
|
722
|
+
gaps: SddTaskGap[];
|
|
723
|
+
commands: string[];
|
|
724
|
+
message: string;
|
|
725
|
+
}
|
|
726
|
+
export interface RunSummary {
|
|
727
|
+
runId: string;
|
|
728
|
+
status: RunStatus;
|
|
729
|
+
phase: string | null;
|
|
730
|
+
currentTask: string | null;
|
|
731
|
+
createdAt: string;
|
|
732
|
+
updatedAt: string;
|
|
733
|
+
validationStatus: RunState['validation']['status'];
|
|
734
|
+
syncBackStatus: RunState['syncBack']['status'];
|
|
735
|
+
taskIds: string[];
|
|
736
|
+
artifactCount: number;
|
|
737
|
+
}
|
|
738
|
+
export interface LocalRunIndexTaskEntry {
|
|
739
|
+
taskId: string;
|
|
740
|
+
status: string | null;
|
|
741
|
+
runId: string;
|
|
742
|
+
runStatus: RunStatus;
|
|
743
|
+
updatedAt: string;
|
|
744
|
+
}
|
|
745
|
+
export interface LocalRunIndexArtifactEntry {
|
|
746
|
+
path: string;
|
|
747
|
+
kind: string;
|
|
748
|
+
task: string | null;
|
|
749
|
+
agent: string | null;
|
|
750
|
+
runId: string;
|
|
751
|
+
createdAt: string;
|
|
752
|
+
}
|
|
753
|
+
export interface LocalRunIndexWaveSummary {
|
|
754
|
+
runId: string;
|
|
755
|
+
eventCount: number;
|
|
756
|
+
lastEvent: string | null;
|
|
757
|
+
}
|
|
758
|
+
export interface LocalRunIndexQuery {
|
|
759
|
+
runId?: string;
|
|
760
|
+
taskId?: string;
|
|
761
|
+
status?: RunStatus;
|
|
762
|
+
artifact?: string;
|
|
763
|
+
}
|
|
764
|
+
export interface LocalRunIndex {
|
|
765
|
+
contract: typeof LOCAL_RUN_INDEX_CONTRACT_VERSION;
|
|
766
|
+
generatedAt: string;
|
|
767
|
+
runs: RunSummary[];
|
|
768
|
+
tasks: LocalRunIndexTaskEntry[];
|
|
769
|
+
delegations: DelegationQueueItem[];
|
|
770
|
+
artifacts: LocalRunIndexArtifactEntry[];
|
|
771
|
+
waves: LocalRunIndexWaveSummary[];
|
|
772
|
+
}
|
|
773
|
+
export interface LocalRunIndexInspection {
|
|
774
|
+
valid: boolean;
|
|
775
|
+
exists: boolean;
|
|
776
|
+
indexPath: string;
|
|
777
|
+
index: LocalRunIndex | null;
|
|
778
|
+
issues: ContractValidationIssue[];
|
|
779
|
+
}
|
|
780
|
+
export interface RunInspection {
|
|
781
|
+
summary: RunSummary;
|
|
782
|
+
state: RunState;
|
|
783
|
+
events: RuntimeEvent[];
|
|
784
|
+
eventCount: number;
|
|
785
|
+
recentEvents: RuntimeEvent[];
|
|
786
|
+
artifacts: ArtifactIndexEntry[];
|
|
787
|
+
artifactIngestions: ArtifactResultIngestionRecord[];
|
|
788
|
+
worktrees: WorktreeLifecycleRecord[];
|
|
789
|
+
validation: RunState['validation'];
|
|
790
|
+
syncBack: RunState['syncBack'];
|
|
791
|
+
tasks: Record<string, unknown>;
|
|
792
|
+
}
|
|
793
|
+
export interface ProjectStatus {
|
|
794
|
+
branch: string;
|
|
795
|
+
documents: SddTaskModel['documents'];
|
|
796
|
+
tasks: {
|
|
797
|
+
total: number;
|
|
798
|
+
pending: number;
|
|
799
|
+
inProgress: number;
|
|
800
|
+
completed: number;
|
|
801
|
+
blocked: number;
|
|
802
|
+
deferred: number;
|
|
803
|
+
unknown: number;
|
|
804
|
+
gaps: number;
|
|
805
|
+
};
|
|
806
|
+
latestRun: RunSummary | null;
|
|
807
|
+
recommendedNextCommand: string;
|
|
808
|
+
gaps: SddTaskGap[];
|
|
809
|
+
}
|
|
810
|
+
export interface SyncBackApplyPolicy {
|
|
811
|
+
mode: 'direct' | 'confirm';
|
|
812
|
+
requiresApproval: boolean;
|
|
813
|
+
reasons: string[];
|
|
814
|
+
}
|
|
815
|
+
export interface SyncBackInspection {
|
|
816
|
+
runId: string;
|
|
817
|
+
branch: string;
|
|
818
|
+
taskId: string | null;
|
|
819
|
+
status: 'ready' | 'blocked' | 'applied';
|
|
820
|
+
reasons: string[];
|
|
821
|
+
proposalPath: string | null;
|
|
822
|
+
proposal: string | null;
|
|
823
|
+
runTaskStatus: string | null;
|
|
824
|
+
markdownTask: SddTask | null;
|
|
825
|
+
markdownStatus: SddTaskStatus | null;
|
|
826
|
+
targetTasksPath: string;
|
|
827
|
+
artifacts: string[];
|
|
828
|
+
gaps: SddTaskGap[];
|
|
829
|
+
applyPolicy: SyncBackApplyPolicy;
|
|
830
|
+
}
|
|
831
|
+
export interface SyncBackApplyResult {
|
|
832
|
+
runId: string;
|
|
833
|
+
taskId: string;
|
|
834
|
+
applied: boolean;
|
|
835
|
+
tasksPath: string;
|
|
836
|
+
inspection: SyncBackInspection;
|
|
837
|
+
message: string;
|
|
838
|
+
}
|
|
839
|
+
export declare function getWorktreesDir(projectRoot: string): string;
|
|
840
|
+
export declare function getSddDir(projectRoot: string): string;
|
|
841
|
+
export declare function getProjectConfigPath(projectRoot: string): string;
|
|
842
|
+
export declare function getRunsDir(projectRoot: string): string;
|
|
843
|
+
export declare function getLocalRunIndexPath(projectRoot: string): string;
|
|
844
|
+
export declare function getRunDir(projectRoot: string, runId: string): string;
|
|
845
|
+
export declare function getArtifactsDir(projectRoot: string, runId: string): string;
|
|
846
|
+
export declare function getArtifactPath(projectRoot: string, runId: string, relativeArtifactPath: string): string;
|
|
847
|
+
export declare function getRunRelativeArtifactPath(artifactRootRelativePath: string): string;
|
|
848
|
+
export declare function toArtifactRootRelativePath(runRelativeArtifactPath: string): string;
|
|
849
|
+
export declare function writeArtifact(projectRoot: string, runId: string, artifactRootRelativePath: string, content: string): Promise<{
|
|
850
|
+
absolutePath: string;
|
|
851
|
+
runRelativePath: string;
|
|
852
|
+
}>;
|
|
853
|
+
export declare function readArtifact(projectRoot: string, runId: string, artifactRootRelativePath: string): Promise<string>;
|
|
854
|
+
export type InitDocumentStatus = 'created' | 'unchanged' | 'overwritten' | 'skipped';
|
|
855
|
+
export interface InitDocumentReport {
|
|
856
|
+
branch: string;
|
|
857
|
+
relativePath: string;
|
|
858
|
+
status: InitDocumentStatus;
|
|
859
|
+
message: string;
|
|
860
|
+
}
|
|
861
|
+
export interface InitDocumentsResult {
|
|
862
|
+
branch: string;
|
|
863
|
+
root: string;
|
|
864
|
+
documents: InitDocumentReport[];
|
|
865
|
+
}
|
|
866
|
+
export interface InitProjectResult {
|
|
867
|
+
configPath: string;
|
|
868
|
+
created: boolean;
|
|
869
|
+
documents: InitDocumentsResult;
|
|
870
|
+
aiTools: AiProjectionResult[];
|
|
871
|
+
}
|
|
872
|
+
export declare function initProject(projectRoot: string, options?: {
|
|
873
|
+
force?: boolean;
|
|
874
|
+
aiTool?: AiToolSelection;
|
|
875
|
+
branch?: string;
|
|
876
|
+
scaffoldDocuments?: boolean;
|
|
877
|
+
}): Promise<InitProjectResult>;
|
|
878
|
+
export declare function readProjectConfig(projectRoot: string): Promise<ProjectConfig>;
|
|
879
|
+
export declare function createRun(projectRoot: string, options?: {
|
|
880
|
+
runId?: string;
|
|
881
|
+
lifecycleDecision?: LifecycleDecisionRecord;
|
|
882
|
+
}): Promise<RunState>;
|
|
883
|
+
export declare function readRunState(projectRoot: string, runId: string): Promise<RunState>;
|
|
884
|
+
export declare function writeRunState(projectRoot: string, state: RunState): Promise<void>;
|
|
885
|
+
export declare function appendEvent(projectRoot: string, runId: string, event: Omit<RuntimeEvent, 'contract' | 'time'>): Promise<RuntimeEvent>;
|
|
886
|
+
export declare function archiveRun(projectRoot: string, runId: string, options?: {
|
|
887
|
+
reason?: string;
|
|
888
|
+
}): Promise<RunState>;
|
|
889
|
+
export declare function listRuns(projectRoot: string): Promise<RunSummary[]>;
|
|
890
|
+
export declare function rebuildLocalRunIndex(projectRoot: string): Promise<LocalRunIndex>;
|
|
891
|
+
export declare function readLocalRunIndex(projectRoot: string): Promise<LocalRunIndex>;
|
|
892
|
+
export declare function queryLocalRunIndex(projectRoot: string, query?: LocalRunIndexQuery): Promise<LocalRunIndex>;
|
|
893
|
+
export declare function inspectLocalRunIndex(projectRoot: string): Promise<LocalRunIndexInspection>;
|
|
894
|
+
export declare function inspectRun(projectRoot: string, runId: string): Promise<RunInspection>;
|
|
895
|
+
export declare function getProjectStatus(projectRoot: string, options?: {
|
|
896
|
+
branch?: string;
|
|
897
|
+
}): Promise<ProjectStatus>;
|
|
898
|
+
export declare function inspectSyncBack(projectRoot: string, options: {
|
|
899
|
+
runId: string;
|
|
900
|
+
branch?: string;
|
|
901
|
+
taskId?: string;
|
|
902
|
+
}): Promise<SyncBackInspection>;
|
|
903
|
+
export declare function applySyncBack(projectRoot: string, options: {
|
|
904
|
+
runId: string;
|
|
905
|
+
branch?: string;
|
|
906
|
+
taskId?: string;
|
|
907
|
+
approved?: boolean;
|
|
908
|
+
}): Promise<SyncBackApplyResult>;
|
|
909
|
+
export declare function doctor(projectRoot: string, options?: {
|
|
910
|
+
allRuns?: boolean;
|
|
911
|
+
latestOnly?: boolean;
|
|
912
|
+
}): Promise<DoctorReport>;
|
|
913
|
+
export declare function parseSddBranch(projectRoot: string, branch?: string): Promise<SddTaskModel>;
|
|
914
|
+
export declare function parseSddTasksMarkdown(raw: string, options?: {
|
|
915
|
+
branch?: string;
|
|
916
|
+
tasksPath?: string;
|
|
917
|
+
validateDependencies?: boolean;
|
|
918
|
+
}): Pick<SddTaskModel, 'tasks' | 'gaps'>;
|
|
919
|
+
export declare function renderSddResultArtifactTemplate(projectRoot: string, options: SddResultArtifactTemplateOptions): Promise<string>;
|
|
920
|
+
export declare function validateSddResultArtifact(projectRoot: string, runId: string, runRelativeArtifactPath: string, options?: {
|
|
921
|
+
expectedTask?: string;
|
|
922
|
+
expectedAgent?: string;
|
|
923
|
+
}): Promise<SddResultValidationReport>;
|
|
924
|
+
export declare function parseSddResultMarkdown(raw: string): SddResultValidationReport;
|
|
925
|
+
export declare function validateSddResult(result: SddResult, options?: {
|
|
926
|
+
expectedTask?: string;
|
|
927
|
+
expectedAgent?: string;
|
|
928
|
+
runRelativeArtifactPath?: string;
|
|
929
|
+
}): ContractValidationIssue[];
|
|
930
|
+
export declare function createDelegationRecord(input: {
|
|
931
|
+
delegationId: string;
|
|
932
|
+
task: string;
|
|
933
|
+
agent: string;
|
|
934
|
+
expectedArtifact: string;
|
|
935
|
+
runMode?: DelegationRunMode;
|
|
936
|
+
blocking?: boolean;
|
|
937
|
+
requiredForPhaseExit?: boolean;
|
|
938
|
+
startedAt?: string;
|
|
939
|
+
timeoutSeconds?: number;
|
|
940
|
+
status?: DelegationStatus;
|
|
941
|
+
}): DelegationRecord;
|
|
942
|
+
export declare function isDelegationTerminal(status: DelegationStatus): boolean;
|
|
943
|
+
export declare function isDelegationStale(delegation: DelegationRecord, now?: Date): boolean;
|
|
944
|
+
export declare function validateDelegationRecord(projectRoot: string, runId: string, delegation: DelegationRecord, now?: Date): Promise<DelegationValidationReport>;
|
|
945
|
+
export declare function ingestArtifactResult(projectRoot: string, runId: string, input: {
|
|
946
|
+
delegationId: string;
|
|
947
|
+
artifactPath: string;
|
|
948
|
+
}): Promise<ArtifactResultIngestionResult>;
|
|
949
|
+
export declare function inspectArtifactResultIngestions(projectRoot: string, runId: string): Promise<ArtifactResultIngestionInspection>;
|
|
950
|
+
export declare function evaluateLifecycleDecisionGate(input?: Partial<LifecycleDecisionSignals>, decidedAt?: Date): LifecycleDecisionGateResult;
|
|
951
|
+
export declare function recordLifecycleDecision(projectRoot: string, runId: string, record: LifecycleDecisionRecord): Promise<RunState>;
|
|
952
|
+
export declare function runSingleTaskLoop(projectRoot: string, options: SingleTaskLoopOptions): Promise<SingleTaskLoopResult>;
|
|
953
|
+
export declare function runGoalVerify(projectRoot: string, options: GoalVerifyOptions): Promise<GoalVerifyResult>;
|
|
954
|
+
export declare function renderGoalVerifyResult(result: GoalVerifyResult): string;
|
|
955
|
+
export declare function renderSingleTaskLoopResult(result: SingleTaskLoopResult): string;
|
|
956
|
+
export declare function renderLifecycleDecisionGate(result: LifecycleDecisionGateResult): string;
|
|
957
|
+
export declare function inspectSddTask(model: SddTaskModel, taskId: string): {
|
|
958
|
+
task: SddTask | null;
|
|
959
|
+
gaps: SddTaskGap[];
|
|
960
|
+
};
|
|
961
|
+
export declare function renderTaskList(model: SddTaskModel): string;
|
|
962
|
+
export declare function renderTaskInspect(task: SddTask | null, gaps?: SddTaskGap[]): string;
|
|
963
|
+
export declare function renderTaskGapReport(model: SddTaskModel): string;
|
|
964
|
+
export declare function inspectTaskGraph(projectRoot: string, options?: {
|
|
965
|
+
branch?: string;
|
|
966
|
+
}): Promise<TaskGraphPlan>;
|
|
967
|
+
export declare function inspectWavePlan(projectRoot: string, options?: {
|
|
968
|
+
branch?: string;
|
|
969
|
+
capabilityId?: string;
|
|
970
|
+
}): Promise<WavePlan>;
|
|
971
|
+
export declare function runBackgroundExecutor(projectRoot: string, options: BackgroundExecutorRunOptions): Promise<BackgroundExecutorResult>;
|
|
972
|
+
export declare function inspectBackgroundExecutor(projectRoot: string, runId: string): Promise<BackgroundExecutorInspection>;
|
|
973
|
+
export declare function runWaveExecutor(projectRoot: string, options?: WaveExecutorRunOptions): Promise<WaveExecutorResult>;
|
|
974
|
+
export declare function inspectWaveExecutor(projectRoot: string, runId: string): Promise<WaveExecutorInspection>;
|
|
975
|
+
export declare function renderDoctorReport(report: DoctorReport): string;
|
|
976
|
+
export declare function defaultProjectConfig(projectName: string): ProjectConfig;
|
|
977
|
+
export declare const TOOL_CAPABILITY_REGISTRY_VERSION = "phase-3.1-tool-capability-registry-v1";
|
|
978
|
+
export declare const TOOL_PLUGIN_CONTRACT_REGISTRY_VERSION = "phase-3.2-tool-plugin-loading-contract-v1";
|
|
979
|
+
export declare const DELEGATION_QUEUE_CONTRACT_VERSION = "phase-3.3-delegation-queue-contract-v1";
|
|
980
|
+
export declare const DELEGATION_STATE_MACHINE_VERSION = "phase-3.4-delegation-state-machine-v1";
|
|
981
|
+
export declare const WORKER_ADAPTER_CONTRACT_REGISTRY_VERSION = "phase-3.5-worker-adapter-contract-v1";
|
|
982
|
+
export declare const ARTIFACT_RESULT_INGESTION_REGISTRY_VERSION = "phase-3.6-artifact-result-ingestion-v1";
|
|
983
|
+
export declare const WORKTREE_ISOLATION_CONTRACT_VERSION = "phase-3.7-worktree-isolation-contract-v1";
|
|
984
|
+
export declare const WORKTREE_LIFECYCLE_CONTRACT_VERSION = "phase-3.8-worktree-lifecycle-v1";
|
|
985
|
+
export declare function listToolCapabilities(projectRoot: string): Promise<ToolCapabilityRegistry>;
|
|
986
|
+
export declare function inspectToolCapability(projectRoot: string, capabilityId: string): Promise<ToolCapability | null>;
|
|
987
|
+
export declare function inspectWorktreeIsolation(projectRoot: string, options: {
|
|
988
|
+
branch?: string;
|
|
989
|
+
taskId: string;
|
|
990
|
+
capabilityId?: string;
|
|
991
|
+
peerTaskIds?: string[];
|
|
992
|
+
}): Promise<WorktreeIsolationDecision>;
|
|
993
|
+
export declare function createWorktreeLifecycle(projectRoot: string, runId: string, options: {
|
|
994
|
+
taskId: string;
|
|
995
|
+
baseRef?: string;
|
|
996
|
+
worktreeId?: string;
|
|
997
|
+
}): Promise<WorktreeLifecycleRecord>;
|
|
998
|
+
export declare function inspectWorktreeLifecycle(projectRoot: string, runId: string): Promise<WorktreeLifecycleInspection>;
|
|
999
|
+
export declare function keepWorktreeLifecycle(projectRoot: string, runId: string, worktreeId: string, options?: {
|
|
1000
|
+
reason?: string;
|
|
1001
|
+
}): Promise<WorktreeLifecycleRecord>;
|
|
1002
|
+
export declare function removeWorktreeLifecycle(projectRoot: string, runId: string, worktreeId: string): Promise<WorktreeLifecycleRecord>;
|
|
1003
|
+
export declare function listToolPluginContracts(projectRoot: string): Promise<ToolPluginContractRegistry>;
|
|
1004
|
+
export declare function inspectToolPluginContract(projectRoot: string, pluginId: string): Promise<ToolPluginContract | null>;
|
|
1005
|
+
export declare function listWorkerAdapterContracts(projectRoot: string): Promise<WorkerAdapterContractRegistry>;
|
|
1006
|
+
export declare function inspectWorkerAdapterContract(projectRoot: string, adapterId: string): Promise<WorkerAdapterContract | null>;
|
|
1007
|
+
export declare function inspectGovernancePolicy(projectRoot: string): Promise<GovernancePolicy>;
|
|
1008
|
+
export declare function evaluateGovernancePolicy(projectRoot: string, input: GovernancePolicyDecisionInput): Promise<GovernancePolicyDecision>;
|
|
1009
|
+
export declare function listDelegationQueueItems(projectRoot: string, options?: {
|
|
1010
|
+
runId?: string;
|
|
1011
|
+
}): Promise<DelegationQueueSnapshot>;
|
|
1012
|
+
export declare function inspectDelegationQueueItem(projectRoot: string, queueItemId: string): Promise<DelegationQueueItem | null>;
|
|
1013
|
+
export declare function getDelegationStateMachine(): DelegationStateMachine;
|
|
1014
|
+
export declare function validateDelegationStateTransition(from: DelegationStatus, to: DelegationStatus, event?: string | null): DelegationStateTransitionValidation;
|
|
1015
|
+
export declare function emptyLifecycleDecisionRecord(): LifecycleDecisionRecord;
|
|
1016
|
+
export declare function readRunEvents(projectRoot: string, runId: string): Promise<RuntimeEvent[]>;
|