@cleocode/contracts 2026.4.100 → 2026.4.102

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.
Files changed (96) hide show
  1. package/dist/brain-graph.d.ts +245 -0
  2. package/dist/brain-graph.d.ts.map +1 -0
  3. package/dist/brain-graph.js +30 -0
  4. package/dist/brain-graph.js.map +1 -0
  5. package/dist/branch-lock.d.ts +225 -0
  6. package/dist/branch-lock.d.ts.map +1 -0
  7. package/dist/branch-lock.js +43 -0
  8. package/dist/branch-lock.js.map +1 -0
  9. package/dist/exit-codes.d.ts +1 -1
  10. package/dist/exit-codes.d.ts.map +1 -1
  11. package/dist/exit-codes.js +1 -1
  12. package/dist/exit-codes.js.map +1 -1
  13. package/dist/graph.d.ts +2 -0
  14. package/dist/graph.d.ts.map +1 -1
  15. package/dist/index.d.ts +11 -1
  16. package/dist/index.d.ts.map +1 -1
  17. package/dist/index.js +2 -0
  18. package/dist/index.js.map +1 -1
  19. package/dist/nexus-contract-ops.d.ts +186 -0
  20. package/dist/nexus-contract-ops.d.ts.map +1 -0
  21. package/dist/nexus-contract-ops.js +11 -0
  22. package/dist/nexus-contract-ops.js.map +1 -0
  23. package/dist/nexus-living-brain-ops.d.ts +314 -0
  24. package/dist/nexus-living-brain-ops.d.ts.map +1 -0
  25. package/dist/nexus-living-brain-ops.js +15 -0
  26. package/dist/nexus-living-brain-ops.js.map +1 -0
  27. package/dist/nexus-query-ops.d.ts +82 -0
  28. package/dist/nexus-query-ops.d.ts.map +1 -0
  29. package/dist/nexus-query-ops.js +11 -0
  30. package/dist/nexus-query-ops.js.map +1 -0
  31. package/dist/nexus-route-ops.d.ts +103 -0
  32. package/dist/nexus-route-ops.d.ts.map +1 -0
  33. package/dist/nexus-route-ops.js +10 -0
  34. package/dist/nexus-route-ops.js.map +1 -0
  35. package/dist/nexus-tasks-bridge-ops.d.ts +68 -0
  36. package/dist/nexus-tasks-bridge-ops.d.ts.map +1 -0
  37. package/dist/nexus-tasks-bridge-ops.js +11 -0
  38. package/dist/nexus-tasks-bridge-ops.js.map +1 -0
  39. package/dist/nexus-wiki-ops.d.ts +127 -0
  40. package/dist/nexus-wiki-ops.d.ts.map +1 -0
  41. package/dist/nexus-wiki-ops.js +12 -0
  42. package/dist/nexus-wiki-ops.js.map +1 -0
  43. package/dist/operations/admin.d.ts +1781 -0
  44. package/dist/operations/admin.d.ts.map +1 -0
  45. package/dist/operations/admin.js +27 -0
  46. package/dist/operations/admin.js.map +1 -0
  47. package/dist/operations/brain.d.ts +34 -26
  48. package/dist/operations/brain.d.ts.map +1 -1
  49. package/dist/operations/brain.js +7 -6
  50. package/dist/operations/brain.js.map +1 -1
  51. package/dist/operations/docs.d.ts +279 -0
  52. package/dist/operations/docs.d.ts.map +1 -0
  53. package/dist/operations/docs.js +31 -0
  54. package/dist/operations/docs.js.map +1 -0
  55. package/dist/operations/intelligence.d.ts +319 -0
  56. package/dist/operations/intelligence.d.ts.map +1 -0
  57. package/dist/operations/intelligence.js +24 -0
  58. package/dist/operations/intelligence.js.map +1 -0
  59. package/dist/operations/orchestrate.d.ts +113 -2
  60. package/dist/operations/orchestrate.d.ts.map +1 -1
  61. package/dist/operations/orchestrate.js +3 -2
  62. package/dist/operations/orchestrate.js.map +1 -1
  63. package/dist/operations/session.d.ts +193 -47
  64. package/dist/operations/session.d.ts.map +1 -1
  65. package/dist/operations/session.js +7 -6
  66. package/dist/operations/session.js.map +1 -1
  67. package/dist/operations/sticky.d.ts +264 -0
  68. package/dist/operations/sticky.d.ts.map +1 -0
  69. package/dist/operations/sticky.js +19 -0
  70. package/dist/operations/sticky.js.map +1 -0
  71. package/dist/operations/validate.d.ts +145 -19
  72. package/dist/operations/validate.d.ts.map +1 -1
  73. package/dist/operations/validate.js +3 -3
  74. package/dist/task-record.d.ts +19 -0
  75. package/dist/task-record.d.ts.map +1 -1
  76. package/package.json +41 -1
  77. package/src/brain-graph.ts +282 -0
  78. package/src/branch-lock.ts +254 -0
  79. package/src/exit-codes.ts +1 -1
  80. package/src/graph.ts +2 -0
  81. package/src/index.ts +128 -0
  82. package/src/nexus-contract-ops.ts +244 -0
  83. package/src/nexus-living-brain-ops.ts +345 -0
  84. package/src/nexus-query-ops.ts +100 -0
  85. package/src/nexus-route-ops.ts +134 -0
  86. package/src/nexus-tasks-bridge-ops.ts +71 -0
  87. package/src/nexus-wiki-ops.ts +133 -0
  88. package/src/operations/admin.ts +2087 -0
  89. package/src/operations/brain.ts +34 -26
  90. package/src/operations/docs.ts +322 -0
  91. package/src/operations/intelligence.ts +399 -0
  92. package/src/operations/orchestrate.ts +117 -2
  93. package/src/operations/session.ts +225 -48
  94. package/src/operations/sticky.ts +308 -0
  95. package/src/operations/validate.ts +161 -55
  96. package/src/task-record.ts +19 -0
@@ -0,0 +1,399 @@
1
+ /**
2
+ * Intelligence Domain Operations (5 operations)
3
+ *
4
+ * Query operations: 5
5
+ * Mutate operations: 0 (intelligence is read-only; writes happen via hooks)
6
+ *
7
+ * intelligence is the quality prediction and pattern matching subsystem backed by
8
+ * brain.db + tasks.db. It surfaces risk scoring, validation outcome prediction,
9
+ * error pattern extraction, confidence scoring, and pattern matching for verified
10
+ * tasks. All operations are read-only query operations at the domain level.
11
+ *
12
+ * Distinct from other analysis domains — intelligence focuses on predictive
13
+ * signals derived from task history, brain patterns, and learnings.
14
+ *
15
+ * SYNC: Canonical implementations at packages/core/src/intelligence/*.
16
+ * Wire-format types live here; they are the contract for CLI + HTTP dispatch.
17
+ *
18
+ * @task T980 — Orchestration Contract Completion
19
+ * @task T549 — Intelligence Domain Architecture
20
+ * @see packages/cleo/src/dispatch/domains/intelligence.ts
21
+ * @see packages/core/src/intelligence/types.ts
22
+ */
23
+
24
+ // ============================================================================
25
+ // Risk Factor and Assessment Types (shared)
26
+ // ============================================================================
27
+
28
+ /**
29
+ * A single factor contributing to a task's overall risk score.
30
+ *
31
+ * Each factor has a weight (how much it matters) and a value (current level, 0-1).
32
+ * The weighted sum of all factors produces the aggregate risk score.
33
+ */
34
+ export interface IntelligenceRiskFactor {
35
+ /** Human-readable factor name (e.g., "complexity", "blocking_risk"). */
36
+ name: string;
37
+ /** How much this factor contributes to the total score (0-1). */
38
+ weight: number;
39
+ /** Current measured value for this factor (0-1, where 1 = highest risk). */
40
+ value: number;
41
+ /** Explanation of why this factor has its current value. */
42
+ description: string;
43
+ }
44
+
45
+ /**
46
+ * Complete risk assessment for a single task.
47
+ *
48
+ * Returned by `intelligence.predict` (no stage). The `riskScore` is the weighted
49
+ * aggregate of all risk factors.
50
+ */
51
+ export interface IntelligenceRiskAssessment {
52
+ /** The task ID this assessment applies to. */
53
+ taskId: string;
54
+ /** Aggregate risk score (0-1, where 1 = highest risk). */
55
+ riskScore: number;
56
+ /** Confidence in the assessment (0-1). Higher when more data is available. */
57
+ confidence: number;
58
+ /** Individual risk factors that contributed to the score. */
59
+ factors: IntelligenceRiskFactor[];
60
+ /** Human-readable recommendation based on the risk level. */
61
+ recommendation: string;
62
+ }
63
+
64
+ // ============================================================================
65
+ // Validation Prediction Types (shared)
66
+ // ============================================================================
67
+
68
+ /**
69
+ * Predicted outcome for a lifecycle validation gate.
70
+ *
71
+ * Returned by `intelligence.predict` (with stage). Combines historical
72
+ * pattern data with the task's current state to estimate pass likelihood.
73
+ */
74
+ export interface IntelligenceValidationPrediction {
75
+ /** The task ID being evaluated. */
76
+ taskId: string;
77
+ /** The lifecycle stage being predicted (e.g., "specification", "implementation"). */
78
+ stage: string;
79
+ /** Probability of passing the gate (0-1). */
80
+ passLikelihood: number;
81
+ /** Known blockers that may prevent passing. */
82
+ blockers: string[];
83
+ /** Actionable suggestions to improve pass likelihood. */
84
+ suggestions: string[];
85
+ }
86
+
87
+ // ============================================================================
88
+ // Gate Focus and Validation Suggestion Types (shared)
89
+ // ============================================================================
90
+
91
+ /**
92
+ * A single gate focus recommendation (priority-ordered).
93
+ *
94
+ * Produced by `intelligence.suggest` to guide which verification gates
95
+ * should receive focus during review.
96
+ */
97
+ export interface IntelligenceGateFocusRecommendation {
98
+ /** Gate name (e.g., "implemented", "testsPassed", "documented"). */
99
+ gateName: string;
100
+ /** Priority level (1 = highest, 5 = lowest). */
101
+ priority: number;
102
+ /** Why this gate is recommended for focus. */
103
+ reason: string;
104
+ /** Estimated difficulty to pass (0-1, where 1 = most difficult). */
105
+ estimatedDifficulty: number;
106
+ /** Actionable tips to pass this gate. */
107
+ tips: string[];
108
+ }
109
+
110
+ /**
111
+ * Adaptive validation suggestion set for a task.
112
+ *
113
+ * Returned by `intelligence.suggest`. Includes ordered gate recommendations
114
+ * and actionable tips to improve verification likelihood.
115
+ */
116
+ export interface IntelligenceAdaptiveValidationSuggestion {
117
+ /** Task ID this suggestion applies to. */
118
+ taskId: string;
119
+ /** Ordered gate recommendations (highest priority first). */
120
+ gateFocus: IntelligenceGateFocusRecommendation[];
121
+ /** Overall confidence that the task will pass all required gates. */
122
+ overallConfidence: number;
123
+ /**
124
+ * Actionable tips derived from gate focus analysis.
125
+ * Includes failure-pattern mitigations where available.
126
+ */
127
+ tips: string[];
128
+ }
129
+
130
+ // ============================================================================
131
+ // Verification Confidence Score Types (shared)
132
+ // ============================================================================
133
+
134
+ /**
135
+ * A single verification gate result (passed/failed with metadata).
136
+ */
137
+ export interface IntelligenceVerificationGate {
138
+ /** Gate name (e.g., "implemented", "testsPassed"). */
139
+ gateName: string;
140
+ /** Whether this gate passed. */
141
+ passed: boolean;
142
+ /** ISO 8601 timestamp of gate evaluation. */
143
+ evaluatedAt: string;
144
+ /** Optional failure reason if gate did not pass. */
145
+ failureReason?: string;
146
+ }
147
+
148
+ /**
149
+ * Result of scoring and evaluating a completed verification round.
150
+ *
151
+ * Returned by `intelligence.confidence`. Includes confidence score,
152
+ * pass/fail status, and detailed gate breakdown.
153
+ */
154
+ export interface IntelligenceVerificationConfidenceScore {
155
+ /** Task ID. */
156
+ taskId: string;
157
+ /**
158
+ * Computed confidence score (0-1).
159
+ *
160
+ * Score derivation:
161
+ * - Gates passed vs required gates: up to 0.6
162
+ * - Failure log length (fewer failures = higher confidence): up to 0.2
163
+ * - Round number (fewer rounds = higher confidence): up to 0.2
164
+ */
165
+ confidenceScore: number;
166
+ /** Whether the overall verification passed. */
167
+ passed: boolean;
168
+ /** IDs of gates that passed. */
169
+ gatesPassed: IntelligenceVerificationGate[];
170
+ /** IDs of gates that failed. */
171
+ gatesFailed: IntelligenceVerificationGate[];
172
+ /** Current verification round number. */
173
+ round: number;
174
+ /** Count of failures logged for this task. */
175
+ failureCount: number;
176
+ }
177
+
178
+ // ============================================================================
179
+ // Pattern Types (shared)
180
+ // ============================================================================
181
+
182
+ /**
183
+ * A pattern automatically detected from historical brain/task data.
184
+ *
185
+ * Detected patterns may be stored in the existing brain_patterns table
186
+ * if they meet frequency and confidence thresholds.
187
+ */
188
+ export interface IntelligenceDetectedPattern {
189
+ /** Pattern type classification. */
190
+ type: 'workflow' | 'blocker' | 'success' | 'failure' | 'optimization';
191
+ /** Human-readable pattern description. */
192
+ pattern: string;
193
+ /** Context in which the pattern was observed. */
194
+ context: string;
195
+ /** How many times this pattern was observed. */
196
+ frequency: number;
197
+ /** Success rate when this pattern appears (0-1, null if unknown). */
198
+ successRate: number | null;
199
+ /** Estimated impact level. */
200
+ impact: 'low' | 'medium' | 'high';
201
+ /** If this is an anti-pattern, describe the negative behavior. */
202
+ antiPattern: string | null;
203
+ /** Recommended mitigation for anti-patterns. */
204
+ mitigation: string | null;
205
+ /** Example task IDs or descriptions where this pattern occurred. */
206
+ examples: string[];
207
+ /** Confidence in this pattern's validity (0-1). */
208
+ confidence: number;
209
+ }
210
+
211
+ /**
212
+ * Result of matching a task against known patterns from brain_patterns.
213
+ *
214
+ * Includes the original pattern and a relevance score indicating
215
+ * how strongly the pattern applies to the target task.
216
+ */
217
+ export interface IntelligencePatternMatch {
218
+ /** The matched pattern data. */
219
+ pattern: IntelligenceDetectedPattern;
220
+ /** How relevant this pattern is to the target task (0-1). */
221
+ relevanceScore: number;
222
+ /** Why this pattern was matched. */
223
+ matchReason: string;
224
+ /** Whether this is an anti-pattern match (warns about potential issues). */
225
+ isAntiPattern: boolean;
226
+ }
227
+
228
+ // ============================================================================
229
+ // Query Operations
230
+ // ============================================================================
231
+
232
+ // --------------------------------------------------------------------------
233
+ // intelligence.predict → risk scoring or validation outcome prediction
234
+ // --------------------------------------------------------------------------
235
+
236
+ /**
237
+ * Parameters for `intelligence.predict`.
238
+ *
239
+ * @remarks
240
+ * When `stage` is omitted, returns risk assessment. When `stage` is provided,
241
+ * returns validation outcome prediction for that lifecycle stage.
242
+ */
243
+ export interface IntelligencePredictParams {
244
+ /** Task ID to assess (required). */
245
+ taskId: string;
246
+ /** Lifecycle stage for validation prediction (optional). When omitted, performs risk assessment. */
247
+ stage?: string;
248
+ }
249
+
250
+ /**
251
+ * Result of `intelligence.predict`.
252
+ *
253
+ * Union of risk assessment (no stage) or validation prediction (with stage).
254
+ */
255
+ export type IntelligencePredictResult =
256
+ | IntelligenceRiskAssessment
257
+ | IntelligenceValidationPrediction;
258
+
259
+ // --------------------------------------------------------------------------
260
+ // intelligence.suggest → gate focus recommendations
261
+ // --------------------------------------------------------------------------
262
+
263
+ /**
264
+ * Parameters for `intelligence.suggest`.
265
+ *
266
+ * @remarks
267
+ * Requires a task ID. Returns prioritized gate focus recommendations
268
+ * to guide which verification gates should receive attention.
269
+ */
270
+ export interface IntelligenceSuggestParams {
271
+ /** Task ID to generate suggestions for (required). */
272
+ taskId: string;
273
+ }
274
+
275
+ /**
276
+ * Result of `intelligence.suggest`.
277
+ */
278
+ export type IntelligenceSuggestResult = IntelligenceAdaptiveValidationSuggestion;
279
+
280
+ // --------------------------------------------------------------------------
281
+ // intelligence.learn-errors → extract patterns from history
282
+ // --------------------------------------------------------------------------
283
+
284
+ /**
285
+ * Parameters for `intelligence.learn-errors`.
286
+ *
287
+ * @remarks
288
+ * Optional limit parameter to cap the number of patterns returned.
289
+ * Returns detected patterns across all pattern types (workflow, blocker,
290
+ * success, failure, optimization).
291
+ */
292
+ export interface IntelligenceLearnErrorsParams {
293
+ /** Maximum number of patterns to return. Default: 50. */
294
+ limit?: number;
295
+ }
296
+
297
+ /**
298
+ * Result of `intelligence.learn-errors`.
299
+ */
300
+ export type IntelligenceLearnErrorsResult = IntelligenceDetectedPattern[];
301
+
302
+ // --------------------------------------------------------------------------
303
+ // intelligence.confidence → verification confidence scoring
304
+ // --------------------------------------------------------------------------
305
+
306
+ /**
307
+ * Parameters for `intelligence.confidence`.
308
+ *
309
+ * @remarks
310
+ * Requires a task ID. Returns a confidence score based on the task's
311
+ * current verification state, including gate pass/fail status and
312
+ * historical failure patterns.
313
+ */
314
+ export interface IntelligenceConfidenceParams {
315
+ /** Task ID to score confidence for (required). */
316
+ taskId: string;
317
+ }
318
+
319
+ /**
320
+ * Result of `intelligence.confidence`.
321
+ */
322
+ export type IntelligenceConfidenceResult = IntelligenceVerificationConfidenceScore;
323
+
324
+ // --------------------------------------------------------------------------
325
+ // intelligence.match → pattern matching
326
+ // --------------------------------------------------------------------------
327
+
328
+ /**
329
+ * Parameters for `intelligence.match`.
330
+ *
331
+ * @remarks
332
+ * Requires a task ID. Returns all known patterns from brain_patterns
333
+ * that are relevant to this task, sorted by relevance descending.
334
+ */
335
+ export interface IntelligenceMatchParams {
336
+ /** Task ID to match patterns against (required). */
337
+ taskId: string;
338
+ }
339
+
340
+ /**
341
+ * Result of `intelligence.match`.
342
+ */
343
+ export type IntelligenceMatchResult = IntelligencePatternMatch[];
344
+
345
+ // ============================================================================
346
+ // Discriminated Union (TypedDomainHandler integration)
347
+ // ============================================================================
348
+
349
+ /**
350
+ * Operation name literal union for the intelligence domain.
351
+ *
352
+ * @remarks
353
+ * Used by TypedDomainHandler<IntelligenceOps> to dispatch to handler methods.
354
+ */
355
+ export type IntelligenceOp =
356
+ | 'intelligence.predict'
357
+ | 'intelligence.suggest'
358
+ | 'intelligence.learn-errors'
359
+ | 'intelligence.confidence'
360
+ | 'intelligence.match';
361
+
362
+ /**
363
+ * Discriminated union of all intelligence domain operations.
364
+ *
365
+ * @remarks
366
+ * Consumed by packages/cleo/src/dispatch/domains/intelligence.ts via
367
+ * TypedDomainHandler<IntelligenceOps>.
368
+ *
369
+ * Each operation carries its own params and result types. The query gateway
370
+ * uses this union to type-narrow dispatch based on the operation name.
371
+ *
372
+ * @task T980 — Orchestration Contract Completion
373
+ */
374
+ export type IntelligenceOps =
375
+ | {
376
+ op: 'intelligence.predict';
377
+ params: IntelligencePredictParams;
378
+ result: IntelligencePredictResult;
379
+ }
380
+ | {
381
+ op: 'intelligence.suggest';
382
+ params: IntelligenceSuggestParams;
383
+ result: IntelligenceSuggestResult;
384
+ }
385
+ | {
386
+ op: 'intelligence.learn-errors';
387
+ params: IntelligenceLearnErrorsParams;
388
+ result: IntelligenceLearnErrorsResult;
389
+ }
390
+ | {
391
+ op: 'intelligence.confidence';
392
+ params: IntelligenceConfidenceParams;
393
+ result: IntelligenceConfidenceResult;
394
+ }
395
+ | {
396
+ op: 'intelligence.match';
397
+ params: IntelligenceMatchParams;
398
+ result: IntelligenceMatchResult;
399
+ };
@@ -1,7 +1,7 @@
1
1
  /**
2
- * Orchestrate Domain Operations (13 operations)
2
+ * Orchestrate Domain Operations (14 operations)
3
3
  *
4
- * Query operations: 7
4
+ * Query operations: 8 (added orchestrate.plan — T890)
5
5
  * Mutate operations: 6
6
6
  *
7
7
  * SYNC: Canonical implementations at
@@ -9,6 +9,7 @@
9
9
  * packages/core/src/orchestration/*.ts
10
10
  *
11
11
  * @task T963 — contract↔impl drift reconciliation (T910 audit)
12
+ * @task T890 — orchestrate.plan deterministic wave+worker plan
12
13
  */
13
14
 
14
15
  /**
@@ -288,6 +289,120 @@ export interface OrchestrateWavesParams {
288
289
  }
289
290
  export type OrchestrateWavesResult = Wave[];
290
291
 
292
+ // orchestrate.plan (T890)
293
+ /** Parameters for `orchestrate.plan`. @task T890 */
294
+ export interface OrchestratePlanParams {
295
+ /** Epic task id whose children make up the plan (required). @task T890 */
296
+ epicId: string;
297
+ /**
298
+ * Optional preferred agent-resolver tier override for all workers in the
299
+ * plan (0=project, 1=global, 2=packaged). When omitted, the plan engine
300
+ * auto-selects the tier per role.
301
+ * @task T890
302
+ */
303
+ preferTier?: 0 | 1 | 2;
304
+ }
305
+
306
+ /**
307
+ * Per-worker entry in an `orchestrate.plan` wave.
308
+ *
309
+ * @task T890
310
+ */
311
+ export interface OrchestratePlanWorker {
312
+ /** Task id this entry represents. @task T890 */
313
+ taskId: string;
314
+ /** Human-readable task title (defaults to `taskId` when missing). @task T890 */
315
+ title: string;
316
+ /**
317
+ * Resolved agent id (falls back to `'cleo-subagent'` when unresolved).
318
+ * @task T890
319
+ */
320
+ persona: string;
321
+ /** Protocol tier (0=worker, 1=lead, 2=orchestrator). @task T890 */
322
+ tier: 0 | 1 | 2;
323
+ /** Role derived from the resolved agent's `orchLevel`. @task T890 */
324
+ role: 'orchestrator' | 'lead' | 'worker';
325
+ /** Current task status (pending/active/done/…). @task T890 */
326
+ status: string;
327
+ /**
328
+ * Declared file scope for this task. Empty array when no `AC.files` set.
329
+ * @task T890
330
+ */
331
+ atomicScope: { files: string[] };
332
+ /** Orchestration level sourced from the resolved agent (0..2). @task T890 */
333
+ orchLevel: number;
334
+ /** Ids of tasks this task depends on (sorted for determinism). @task T890 */
335
+ dependsOn: string[];
336
+ }
337
+
338
+ /**
339
+ * A single wave in the `orchestrate.plan` execution plan.
340
+ *
341
+ * @task T890
342
+ */
343
+ export interface OrchestratePlanWave {
344
+ /** 1-indexed wave number. @task T890 */
345
+ wave: number;
346
+ /**
347
+ * Task id of the designated lead for this wave, or `null` when none was
348
+ * resolved from the agent registry.
349
+ * @task T890
350
+ */
351
+ leadTaskId: string | null;
352
+ /** Ordered worker entries for this wave. @task T890 */
353
+ workers: OrchestratePlanWorker[];
354
+ }
355
+
356
+ /**
357
+ * Non-fatal warning emitted by `orchestrate.plan` (e.g. missing registry
358
+ * row, no AC.files on a worker task).
359
+ *
360
+ * @task T890
361
+ */
362
+ export interface OrchestratePlanWarning {
363
+ /** Task id the warning applies to. @task T890 */
364
+ taskId: string;
365
+ /** Stable warning code (e.g. `'E_AGENT_NOT_FOUND'`, `'W_NO_ATOMIC_SCOPE'`). @task T890 */
366
+ code: string;
367
+ /** Human-readable message. @task T890 */
368
+ message: string;
369
+ }
370
+
371
+ /**
372
+ * Result of `orchestrate.plan`.
373
+ *
374
+ * @remarks
375
+ * The plan is deterministic: given the same epic snapshot (task statuses,
376
+ * dependencies, and `updatedAt` timestamps) the function always returns the
377
+ * same `inputHash`. `generatedAt` is intentionally excluded from the hash
378
+ * contract so two back-to-back calls can confirm reproducibility by comparing
379
+ * `inputHash` values.
380
+ *
381
+ * @task T890
382
+ */
383
+ export interface OrchestratePlanResult {
384
+ /** Epic id the plan was computed for. @task T890 */
385
+ epicId: string;
386
+ /** Epic title (falls back to `epicId` when missing). @task T890 */
387
+ epicTitle: string;
388
+ /** Total number of child tasks considered (includes done tasks). @task T890 */
389
+ totalTasks: number;
390
+ /** Ordered waves produced by the dependency topological sort. @task T890 */
391
+ waves: OrchestratePlanWave[];
392
+ /** ISO 8601 timestamp when the plan was generated. @task T890 */
393
+ generatedAt: string;
394
+ /** `true` when the plan is reproducible from the current input snapshot. @task T890 */
395
+ deterministic: boolean;
396
+ /**
397
+ * Sha256 hex digest of the sorted `(taskId, status, updatedAt, dependsOn)`
398
+ * tuples + epicId. Identical inputs → identical hash.
399
+ * @task T890
400
+ */
401
+ inputHash: string;
402
+ /** Non-fatal warnings (graceful resolver misses, missing AC.files, …). @task T890 */
403
+ warnings: OrchestratePlanWarning[];
404
+ }
405
+
291
406
  // orchestrate.skill.list
292
407
  /** Parameters for `orchestrate.skill.list`. @task T963 */
293
408
  export interface OrchestrateSkillListParams {