@cleocode/contracts 2026.5.61 → 2026.5.63
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/__tests__/llm-config-schema.test.d.ts +20 -0
- package/dist/__tests__/llm-config-schema.test.d.ts.map +1 -0
- package/dist/__tests__/llm-config-schema.test.js +121 -0
- package/dist/__tests__/llm-config-schema.test.js.map +1 -0
- package/dist/__tests__/nexus-scope-map.test.d.ts +8 -0
- package/dist/__tests__/nexus-scope-map.test.d.ts.map +1 -0
- package/dist/__tests__/nexus-scope-map.test.js +145 -0
- package/dist/__tests__/nexus-scope-map.test.js.map +1 -0
- package/dist/branch-lock.d.ts +11 -0
- package/dist/branch-lock.d.ts.map +1 -1
- package/dist/branch-lock.js +11 -0
- package/dist/branch-lock.js.map +1 -1
- package/dist/config.d.ts +116 -5
- package/dist/config.d.ts.map +1 -1
- package/dist/data-accessor.d.ts +2 -0
- package/dist/data-accessor.d.ts.map +1 -1
- package/dist/data-accessor.js.map +1 -1
- package/dist/engine-result.d.ts +170 -0
- package/dist/engine-result.d.ts.map +1 -0
- package/dist/engine-result.js +123 -0
- package/dist/engine-result.js.map +1 -0
- package/dist/errors.d.ts +24 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +31 -0
- package/dist/errors.js.map +1 -1
- package/dist/exit-codes.d.ts +8 -1
- package/dist/exit-codes.d.ts.map +1 -1
- package/dist/exit-codes.js +7 -0
- package/dist/exit-codes.js.map +1 -1
- package/dist/graph.d.ts +88 -0
- package/dist/graph.d.ts.map +1 -1
- package/dist/graph.js +35 -0
- package/dist/graph.js.map +1 -1
- package/dist/index.d.ts +12 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/dist/operations/llm.d.ts +380 -0
- package/dist/operations/llm.d.ts.map +1 -1
- package/dist/operations/nexus-scope-map.d.ts +540 -0
- package/dist/operations/nexus-scope-map.d.ts.map +1 -0
- package/dist/operations/nexus-scope-map.js +556 -0
- package/dist/operations/nexus-scope-map.js.map +1 -0
- package/dist/operations/nexus-scope.d.ts +185 -0
- package/dist/operations/nexus-scope.d.ts.map +1 -0
- package/dist/operations/nexus-scope.js +9 -0
- package/dist/operations/nexus-scope.js.map +1 -0
- package/dist/operations/session.d.ts +79 -0
- package/dist/operations/session.d.ts.map +1 -1
- package/dist/operations/tasks.d.ts +28 -0
- package/dist/operations/tasks.d.ts.map +1 -1
- package/dist/operations/worktree.d.ts +33 -0
- package/dist/operations/worktree.d.ts.map +1 -1
- package/dist/task.d.ts +17 -2
- package/dist/task.d.ts.map +1 -1
- package/dist/task.js +11 -1
- package/dist/task.js.map +1 -1
- package/dist/tasks.d.ts +0 -2
- package/dist/tasks.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/__tests__/llm-config-schema.test.ts +135 -0
- package/src/__tests__/nexus-scope-map.test.ts +183 -0
- package/src/branch-lock.ts +11 -0
- package/src/config.ts +122 -5
- package/src/data-accessor.ts +3 -0
- package/src/engine-result.ts +220 -0
- package/src/errors.ts +34 -0
- package/src/exit-codes.ts +8 -0
- package/src/graph.ts +112 -0
- package/src/index.ts +82 -2
- package/src/operations/llm.ts +437 -0
- package/src/operations/nexus-scope-map.ts +597 -0
- package/src/operations/nexus-scope.ts +217 -0
- package/src/operations/session.ts +87 -0
- package/src/operations/tasks.ts +30 -0
- package/src/operations/worktree.ts +33 -0
- package/src/task.ts +30 -1
- package/src/tasks.ts +0 -2
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Nexus operation scope contracts — discriminated unions and descriptor
|
|
3
|
+
* interface used by the NEXUS_SCOPE_MAP SSoT.
|
|
4
|
+
*
|
|
5
|
+
* @task T9145
|
|
6
|
+
* @module operations/nexus-scope
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
// ---------------------------------------------------------------------------
|
|
10
|
+
// NexusScope — five-state discriminated union
|
|
11
|
+
// ---------------------------------------------------------------------------
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Five-state scope classification for Nexus operations.
|
|
15
|
+
*
|
|
16
|
+
* - `project` — Operates on a single registered project graph.
|
|
17
|
+
* - `living-brain` — Reads/writes the BRAIN (memory) store.
|
|
18
|
+
* - `cross` — Spans multiple project graphs or compares them.
|
|
19
|
+
* - `hybrid` — Touches both the project graph AND BRAIN.
|
|
20
|
+
* - `global` — Operates on the global Nexus registry (all projects).
|
|
21
|
+
*/
|
|
22
|
+
export type NexusScope = 'project' | 'living-brain' | 'cross' | 'hybrid' | 'global';
|
|
23
|
+
|
|
24
|
+
// ---------------------------------------------------------------------------
|
|
25
|
+
// NexusEffect — read / write / admin axis
|
|
26
|
+
// ---------------------------------------------------------------------------
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Side-effect classification for a Nexus operation.
|
|
30
|
+
*
|
|
31
|
+
* - `read` — Pure query; no persistent state change.
|
|
32
|
+
* - `write` — Mutates the target store(s).
|
|
33
|
+
* - `admin` — Administrative operation (register/unregister/permission).
|
|
34
|
+
*/
|
|
35
|
+
export type NexusEffect = 'read' | 'write' | 'admin';
|
|
36
|
+
|
|
37
|
+
// ---------------------------------------------------------------------------
|
|
38
|
+
// NexusStore — target data stores
|
|
39
|
+
// ---------------------------------------------------------------------------
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* The persistent stores a Nexus operation may touch.
|
|
43
|
+
*
|
|
44
|
+
* - `nexus-graph` — The graph DB (nodes + relations for a project).
|
|
45
|
+
* - `nexus-registry` — The global project registry.
|
|
46
|
+
* - `brain` — The BRAIN memory / observation store.
|
|
47
|
+
* - `tasks` — The task store (nexus → task bridge operations).
|
|
48
|
+
* - `fs` — The local filesystem (scan / walk / snapshot).
|
|
49
|
+
*/
|
|
50
|
+
export type NexusStore = 'nexus-graph' | 'nexus-registry' | 'brain' | 'tasks' | 'fs';
|
|
51
|
+
|
|
52
|
+
// ---------------------------------------------------------------------------
|
|
53
|
+
// ScopeBinding — links an operation key to scope + effect metadata
|
|
54
|
+
// ---------------------------------------------------------------------------
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* A single scope binding, attaching NexusScope and NexusEffect metadata to
|
|
58
|
+
* a named Nexus operation.
|
|
59
|
+
*/
|
|
60
|
+
export interface ScopeBinding {
|
|
61
|
+
/** The operation key as declared in {@link NexusOps}. */
|
|
62
|
+
readonly op: string;
|
|
63
|
+
/** Scope classification of this operation. */
|
|
64
|
+
readonly scope: NexusScope;
|
|
65
|
+
/** Side-effect classification. */
|
|
66
|
+
readonly effect: NexusEffect;
|
|
67
|
+
/** Stores this operation reads or writes. */
|
|
68
|
+
readonly stores: ReadonlyArray<NexusStore>;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// ---------------------------------------------------------------------------
|
|
72
|
+
// NexusOperationDescriptor — full operation metadata
|
|
73
|
+
// ---------------------------------------------------------------------------
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Rich metadata descriptor for a single Nexus operation.
|
|
77
|
+
*
|
|
78
|
+
* Used by the NEXUS_SCOPE_MAP SSoT to provide compile-time exhaustiveness
|
|
79
|
+
* checking and runtime helpers (`getNexusDescriptor`, `listOpsByScope`).
|
|
80
|
+
*/
|
|
81
|
+
export interface NexusOperationDescriptor {
|
|
82
|
+
/** The operation key as declared in {@link NexusOps}. */
|
|
83
|
+
readonly op: string;
|
|
84
|
+
/** Human-readable summary of the operation. */
|
|
85
|
+
readonly description: string;
|
|
86
|
+
/** Scope classification. */
|
|
87
|
+
readonly scope: NexusScope;
|
|
88
|
+
/** Side-effect classification. */
|
|
89
|
+
readonly effect: NexusEffect;
|
|
90
|
+
/** Stores this operation reads or writes. */
|
|
91
|
+
readonly stores: ReadonlyArray<NexusStore>;
|
|
92
|
+
/**
|
|
93
|
+
* Whether this operation requires a `projectId` parameter.
|
|
94
|
+
* Operations with `scope === 'global'` typically do NOT require one.
|
|
95
|
+
* @defaultValue `true`
|
|
96
|
+
*/
|
|
97
|
+
readonly requiresProject: boolean;
|
|
98
|
+
/**
|
|
99
|
+
* When `true`, the decorator stamps `meta._nexus.indexFreshness` on the
|
|
100
|
+
* response envelope (top-level CLI invocations only; sub-calls inherit via
|
|
101
|
+
* `meta.requestId` lineage to avoid per-call git-status shell-outs).
|
|
102
|
+
*
|
|
103
|
+
* @defaultValue `false`
|
|
104
|
+
* @task T9146
|
|
105
|
+
*/
|
|
106
|
+
readonly indexSensitive?: boolean;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// ---------------------------------------------------------------------------
|
|
110
|
+
// W2: NexusScopeMeta — namespaced _nexus block stamped on every response
|
|
111
|
+
// ---------------------------------------------------------------------------
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Source of the `projectId` binding for a nexus operation.
|
|
115
|
+
*
|
|
116
|
+
* - `arg-project-id` — caller supplied `--project-id` explicitly.
|
|
117
|
+
* - `arg-path` — resolved from `--path` argument.
|
|
118
|
+
* - `cwd` — derived from current working directory.
|
|
119
|
+
* - `registry` — looked up via the global project registry.
|
|
120
|
+
* - `none` — operation does not require a project binding.
|
|
121
|
+
*
|
|
122
|
+
* @task T9146
|
|
123
|
+
*/
|
|
124
|
+
export type NexusBindingSource = 'arg-project-id' | 'arg-path' | 'cwd' | 'registry' | 'none';
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* A structured suggestion for the next action an agent should take after a
|
|
128
|
+
* Nexus operation completes.
|
|
129
|
+
*
|
|
130
|
+
* Machine-readable — display strings are derived from these fields.
|
|
131
|
+
*
|
|
132
|
+
* @task T9146
|
|
133
|
+
*/
|
|
134
|
+
export interface SuggestedNextOp {
|
|
135
|
+
/** Nexus operation key (must exist in NEXUS_SCOPE_MAP). */
|
|
136
|
+
readonly op: string;
|
|
137
|
+
/** Arguments to pass to the operation. */
|
|
138
|
+
readonly args: Readonly<Record<string, unknown>>;
|
|
139
|
+
/** Scope of the suggested operation. */
|
|
140
|
+
readonly scope: NexusScope;
|
|
141
|
+
/** Side-effect classification of the suggested operation. */
|
|
142
|
+
readonly effect: NexusEffect;
|
|
143
|
+
/** Whether the agent should confirm with the user before executing. */
|
|
144
|
+
readonly requiresConfirmation: boolean;
|
|
145
|
+
/** Human-readable rationale for why this next step is suggested. */
|
|
146
|
+
readonly reason: string;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Namespaced `_nexus` block attached to every nexus-domain dispatch response
|
|
151
|
+
* under `meta._nexus`.
|
|
152
|
+
*
|
|
153
|
+
* Consumed by agents, renderers, and downstream middleware for scope-aware
|
|
154
|
+
* routing and display.
|
|
155
|
+
*
|
|
156
|
+
* @task T9146
|
|
157
|
+
*/
|
|
158
|
+
export interface NexusScopeMeta {
|
|
159
|
+
/** Scope classification of the operation that produced this envelope. */
|
|
160
|
+
readonly scope: NexusScope;
|
|
161
|
+
/** Side-effect classification of the operation. */
|
|
162
|
+
readonly effect: NexusEffect;
|
|
163
|
+
/**
|
|
164
|
+
* Resolved project identifier (undefined for `global` / `living-brain`
|
|
165
|
+
* scope operations that do not require a project).
|
|
166
|
+
*/
|
|
167
|
+
readonly projectId?: string;
|
|
168
|
+
/** Human-readable project name from the registry (if available). */
|
|
169
|
+
readonly projectName?: string;
|
|
170
|
+
/** Absolute filesystem path to the project root. */
|
|
171
|
+
readonly projectPath?: string;
|
|
172
|
+
/** Absolute path to the nexus DB or registry file. */
|
|
173
|
+
readonly registryPath?: string;
|
|
174
|
+
/** How the `projectId` was resolved for this request. */
|
|
175
|
+
readonly bindingSource: NexusBindingSource;
|
|
176
|
+
/**
|
|
177
|
+
* For `hybrid`-scope operations: the ID of the secondary project
|
|
178
|
+
* (the one whose data is being compared or merged with the primary).
|
|
179
|
+
*/
|
|
180
|
+
readonly counterpartProjectId?: string;
|
|
181
|
+
/**
|
|
182
|
+
* Whether the nexus index was considered fresh at the time of this call.
|
|
183
|
+
* Only present when `descriptor.indexSensitive === true` AND this was a
|
|
184
|
+
* top-level CLI invocation (sub-calls inherit via `meta.requestId` lineage).
|
|
185
|
+
*/
|
|
186
|
+
readonly indexFreshness?: 'fresh' | 'stale' | 'unknown';
|
|
187
|
+
/**
|
|
188
|
+
* The canonical CLI command string for this operation (e.g. `"cleo nexus context"`).
|
|
189
|
+
*/
|
|
190
|
+
readonly canonicalCommand: string;
|
|
191
|
+
/**
|
|
192
|
+
* If this operation is a legacy alias, the canonical op key it maps to.
|
|
193
|
+
* Absent when the operation is already canonical.
|
|
194
|
+
*/
|
|
195
|
+
readonly legacyAliasFor?: string;
|
|
196
|
+
/** Non-fatal warnings surfaced from descriptor or runtime resolution. */
|
|
197
|
+
readonly warnings?: ReadonlyArray<string>;
|
|
198
|
+
/**
|
|
199
|
+
* Structured suggestions for what the agent should do next.
|
|
200
|
+
* Every entry's `.op` MUST resolve to a known NEXUS_SCOPE_MAP entry
|
|
201
|
+
* (enforced at build time by the typed-registry gate in nexus-decorator.ts).
|
|
202
|
+
*/
|
|
203
|
+
readonly suggestedNext?: ReadonlyArray<SuggestedNextOp>;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Utility type that intersects {@link NexusScopeMeta} into `meta._nexus` for
|
|
208
|
+
* nexus-domain dispatch responses.
|
|
209
|
+
*
|
|
210
|
+
* Use this to narrow the `meta` field when processing nexus responses.
|
|
211
|
+
*
|
|
212
|
+
* @task T9146
|
|
213
|
+
*/
|
|
214
|
+
export interface MetaWithNexusScope {
|
|
215
|
+
_nexus: NexusScopeMeta;
|
|
216
|
+
[key: string]: unknown;
|
|
217
|
+
}
|
|
@@ -200,6 +200,91 @@ export interface SessionHandoffShowResult {
|
|
|
200
200
|
handoff: unknown;
|
|
201
201
|
}
|
|
202
202
|
|
|
203
|
+
// ---------------------------------------------------------------------------
|
|
204
|
+
// BriefingFieldContract — per-field staleness + dedup rules (T1905 / BBTT-W1-3)
|
|
205
|
+
// ---------------------------------------------------------------------------
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* Provenance category for briefing observation exclusion.
|
|
209
|
+
*
|
|
210
|
+
* @task T1905
|
|
211
|
+
*/
|
|
212
|
+
export type BriefingExcludeProvenance = 'test-fixture' | 'synthetic' | 'imported';
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Per-field contract rule for a single briefing field.
|
|
216
|
+
*
|
|
217
|
+
* Defines staleness and deduplication constraints for one named section
|
|
218
|
+
* of the `SessionBriefingShowResult`. `assertBriefingContract` evaluates
|
|
219
|
+
* these rules and emits a `ContractViolation` for each breach.
|
|
220
|
+
*
|
|
221
|
+
* @task T1905
|
|
222
|
+
*/
|
|
223
|
+
export interface BriefingFieldRule {
|
|
224
|
+
/**
|
|
225
|
+
* Maximum acceptable age (in days) for any observation surfaced in this field.
|
|
226
|
+
* A violation is emitted when `now - capturedAt > maxAgeDays * 86_400_000`.
|
|
227
|
+
*/
|
|
228
|
+
maxAgeDays?: number;
|
|
229
|
+
/**
|
|
230
|
+
* Deduplication key — field path within each list item used to detect
|
|
231
|
+
* duplicate entries (e.g. `'id'` deduplicates by task ID).
|
|
232
|
+
* When set, the contract checker warns if two items share the same key value.
|
|
233
|
+
*/
|
|
234
|
+
dedupBy?: string;
|
|
235
|
+
/**
|
|
236
|
+
* Provenance tags whose observations must be excluded from this field.
|
|
237
|
+
* Violations are emitted when an item carries one of these provenance values.
|
|
238
|
+
*/
|
|
239
|
+
excludeProvenance?: BriefingExcludeProvenance[];
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Full briefing field contract — maps each named briefing section to its rule.
|
|
244
|
+
*
|
|
245
|
+
* Pass to `assertBriefingContract` together with the computed briefing to
|
|
246
|
+
* obtain `ContractViolation[]`.
|
|
247
|
+
*
|
|
248
|
+
* @example
|
|
249
|
+
* ```ts
|
|
250
|
+
* const contract: BriefingFieldContract = {
|
|
251
|
+
* recentObservations: { maxAgeDays: 7, excludeProvenance: ['test-fixture'] },
|
|
252
|
+
* nextTasks: { dedupBy: 'id' },
|
|
253
|
+
* };
|
|
254
|
+
* ```
|
|
255
|
+
*
|
|
256
|
+
* @task T1905
|
|
257
|
+
*/
|
|
258
|
+
export interface BriefingFieldContract {
|
|
259
|
+
recentObservations?: BriefingFieldRule;
|
|
260
|
+
nextTasks?: BriefingFieldRule;
|
|
261
|
+
openBugs?: BriefingFieldRule;
|
|
262
|
+
blockedTasks?: BriefingFieldRule;
|
|
263
|
+
activeEpics?: BriefingFieldRule;
|
|
264
|
+
[field: string]: BriefingFieldRule | undefined;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* A single contract violation emitted by `assertBriefingContract`.
|
|
269
|
+
*
|
|
270
|
+
* @task T1905
|
|
271
|
+
*/
|
|
272
|
+
export interface ContractViolation {
|
|
273
|
+
/** Name of the briefing field that violated its rule. */
|
|
274
|
+
field: string;
|
|
275
|
+
/** Human-readable description of the violation. */
|
|
276
|
+
message: string;
|
|
277
|
+
/**
|
|
278
|
+
* Violation kind for programmatic handling.
|
|
279
|
+
* - `stale` — field data exceeds `maxAgeDays`.
|
|
280
|
+
* - `duplicate` — two items share the same `dedupBy` key value.
|
|
281
|
+
* - `excluded-provenance` — item carries a banned provenance tag.
|
|
282
|
+
*/
|
|
283
|
+
kind: 'stale' | 'duplicate' | 'excluded-provenance';
|
|
284
|
+
/** Severity — P0 violations block `cleo briefing --strict`. */
|
|
285
|
+
severity: 'P0' | 'P1';
|
|
286
|
+
}
|
|
287
|
+
|
|
203
288
|
// session.briefing.show
|
|
204
289
|
/** Parameters for `session.briefing.show`. */
|
|
205
290
|
export interface SessionBriefingShowParams {
|
|
@@ -208,6 +293,8 @@ export interface SessionBriefingShowParams {
|
|
|
208
293
|
maxBlocked?: number;
|
|
209
294
|
maxEpics?: number;
|
|
210
295
|
scope?: string;
|
|
296
|
+
/** When true, exit non-zero if any contract violation is detected (T1905). */
|
|
297
|
+
strict?: boolean;
|
|
211
298
|
}
|
|
212
299
|
|
|
213
300
|
/** Compact task entry in a session briefing's next-tasks list. */
|
package/src/operations/tasks.ts
CHANGED
|
@@ -630,6 +630,29 @@ export interface TasksRelatesAddResult {
|
|
|
630
630
|
added: boolean;
|
|
631
631
|
}
|
|
632
632
|
|
|
633
|
+
// tasks.relates.remove
|
|
634
|
+
export interface TasksRelatesRemoveParams {
|
|
635
|
+
/** Source task ID. */
|
|
636
|
+
taskId: string;
|
|
637
|
+
/** Target task ID to remove the relation to. */
|
|
638
|
+
relatedId: string;
|
|
639
|
+
/** Optional relation type to narrow the deletion (omit to remove any type). */
|
|
640
|
+
type?: string;
|
|
641
|
+
}
|
|
642
|
+
/**
|
|
643
|
+
* Result of `tasks.relates.remove` — relation deletion confirmation.
|
|
644
|
+
*
|
|
645
|
+
* @task T9240
|
|
646
|
+
*/
|
|
647
|
+
export interface TasksRelatesRemoveResult {
|
|
648
|
+
/** Source task ID. */
|
|
649
|
+
from: string;
|
|
650
|
+
/** Target (related) task ID. */
|
|
651
|
+
to: string;
|
|
652
|
+
/** Whether a relation was actually deleted. */
|
|
653
|
+
removed: boolean;
|
|
654
|
+
}
|
|
655
|
+
|
|
633
656
|
// tasks.add (dispatch-level params — extends TasksCreateParams)
|
|
634
657
|
export interface TasksAddParams {
|
|
635
658
|
title: string;
|
|
@@ -708,6 +731,10 @@ export interface TasksUpdateQueryParams {
|
|
|
708
731
|
type?: string; // SSoT-EXEMPT:kind≠type — 'type' is hierarchy(epic|task|subtask), 'kind' is intent(work|bug|...) — separate axes T944
|
|
709
732
|
size?: string;
|
|
710
733
|
files?: string[];
|
|
734
|
+
/** Add files incrementally (mirrors --add-labels pattern). @task T9242 */
|
|
735
|
+
addFiles?: string[];
|
|
736
|
+
/** Remove files incrementally (mirrors --remove-labels pattern). @task T9242 */
|
|
737
|
+
removeFiles?: string[];
|
|
711
738
|
pipelineStage?: string;
|
|
712
739
|
/** Canonical wire field for task kind axis (T9072: renamed from role). */
|
|
713
740
|
kind?: string;
|
|
@@ -725,6 +752,8 @@ export interface TasksUpdateQueryParams {
|
|
|
725
752
|
reason?: string;
|
|
726
753
|
/** Dependency declaration waiver for critical-priority tasks (T1856). */
|
|
727
754
|
dependsWaiver?: string;
|
|
755
|
+
/** Clear the blockedBy free-text reason (set to undefined). @task T9241 */
|
|
756
|
+
clearBlockedBy?: boolean;
|
|
728
757
|
}
|
|
729
758
|
/**
|
|
730
759
|
* Result of `tasks.update` — the updated task record with change list.
|
|
@@ -917,6 +946,7 @@ export type TasksOps = {
|
|
|
917
946
|
readonly reparent: readonly [TasksReparentQueryParams, TasksReparentDispatchResult];
|
|
918
947
|
readonly reorder: readonly [TasksReorderQueryParams, TasksReorderDispatchResult];
|
|
919
948
|
readonly 'relates.add': readonly [TasksRelatesAddParams, TasksRelatesAddResult];
|
|
949
|
+
readonly 'relates.remove': readonly [TasksRelatesRemoveParams, TasksRelatesRemoveResult];
|
|
920
950
|
readonly start: readonly [TasksStartQueryParams, TasksStartQueryResult];
|
|
921
951
|
readonly stop: readonly [TasksStopQueryParams, TasksStopQueryResult];
|
|
922
952
|
readonly 'sync.reconcile': readonly [TasksSyncReconcileParams, TasksSyncReconcileResult];
|
|
@@ -135,6 +135,39 @@ export interface CreateWorktreeOptions {
|
|
|
135
135
|
* @default true
|
|
136
136
|
*/
|
|
137
137
|
lockWorktree?: boolean;
|
|
138
|
+
/**
|
|
139
|
+
* Glob patterns to exclude from the worktree via sparse-checkout after
|
|
140
|
+
* creation (T9226 spawn-clone-exclude filter).
|
|
141
|
+
*
|
|
142
|
+
* When set, `createWorktree` enables sparse-checkout on the new worktree
|
|
143
|
+
* and hides all files matching any pattern. Callers should also supply
|
|
144
|
+
* `spawnCloneExcludeExempt` to preserve the task-scoped file.
|
|
145
|
+
*
|
|
146
|
+
* @task T9226
|
|
147
|
+
*/
|
|
148
|
+
spawnCloneExclude?: readonly string[];
|
|
149
|
+
/**
|
|
150
|
+
* Specific file paths to re-include after the exclude filter is applied.
|
|
151
|
+
*
|
|
152
|
+
* Used to preserve the task's own verifier (`scripts/verify-<taskId>.mjs`)
|
|
153
|
+
* after the broad `scripts/verify-*.mjs` exclusion.
|
|
154
|
+
*
|
|
155
|
+
* @task T9226
|
|
156
|
+
*/
|
|
157
|
+
spawnCloneExcludeExempt?: readonly string[];
|
|
158
|
+
/**
|
|
159
|
+
* When `true`, forcibly reset an existing `task/<taskId>` branch that has
|
|
160
|
+
* orphan commits (commits not reachable from `baseRef`).
|
|
161
|
+
*
|
|
162
|
+
* Without this flag, `createWorktree` throws `E_DIRTY_BRANCH` when an orphan
|
|
163
|
+
* branch is detected so the caller can investigate before losing history.
|
|
164
|
+
* Set to `true` only when you are certain the prior branch state is stale and
|
|
165
|
+
* safe to discard (e.g. CI retry or integration-test re-runs).
|
|
166
|
+
*
|
|
167
|
+
* @default false
|
|
168
|
+
* @task T1927
|
|
169
|
+
*/
|
|
170
|
+
forceReset?: boolean;
|
|
138
171
|
}
|
|
139
172
|
|
|
140
173
|
/**
|
package/src/task.ts
CHANGED
|
@@ -87,8 +87,12 @@ export type TaskSize = 'small' | 'medium' | 'large';
|
|
|
87
87
|
/** Epic lifecycle states. */
|
|
88
88
|
export type EpicLifecycle = 'backlog' | 'planning' | 'active' | 'review' | 'released' | 'archived';
|
|
89
89
|
|
|
90
|
-
/** Task origin (provenance). */
|
|
90
|
+
/** Task origin (provenance). T1899: added production/test-fixture/imported/migrated. */
|
|
91
91
|
export type TaskOrigin =
|
|
92
|
+
| 'production'
|
|
93
|
+
| 'test-fixture'
|
|
94
|
+
| 'imported'
|
|
95
|
+
| 'migrated'
|
|
92
96
|
| 'internal'
|
|
93
97
|
| 'bug-report'
|
|
94
98
|
| 'feature-request'
|
|
@@ -97,6 +101,19 @@ export type TaskOrigin =
|
|
|
97
101
|
| 'dependency'
|
|
98
102
|
| 'regression';
|
|
99
103
|
|
|
104
|
+
/** Canonical origin values for the T1899 CHECK constraint. */
|
|
105
|
+
export const TASK_ORIGIN_CANONICAL = [
|
|
106
|
+
'production',
|
|
107
|
+
'test-fixture',
|
|
108
|
+
'imported',
|
|
109
|
+
'migrated',
|
|
110
|
+
] as const satisfies readonly TaskOrigin[];
|
|
111
|
+
|
|
112
|
+
/** Whether an origin value is a test-fixture (should be excluded from live briefing). */
|
|
113
|
+
export function isTestFixtureOrigin(origin: string | null | undefined): boolean {
|
|
114
|
+
return origin === 'test-fixture';
|
|
115
|
+
}
|
|
116
|
+
|
|
100
117
|
/** Verification agent types. */
|
|
101
118
|
export type VerificationAgent =
|
|
102
119
|
| 'planner'
|
|
@@ -463,6 +480,18 @@ export interface Task {
|
|
|
463
480
|
|
|
464
481
|
/** Agent ID that has claimed/is assigned to this task. Null when unclaimed. @defaultValue undefined */
|
|
465
482
|
assignee?: string | null;
|
|
483
|
+
|
|
484
|
+
/**
|
|
485
|
+
* Abort reason when a worker was stopped due to runaway detection (T1658).
|
|
486
|
+
*
|
|
487
|
+
* Set by the sentient monitor when a worker exceeds its size-based budget
|
|
488
|
+
* (`small` ≥ 30 min, `medium` ≥ 2 h, `large` ≥ 4 h). The field is
|
|
489
|
+
* informational — callers may surface it in `cleo sentient monitor` output.
|
|
490
|
+
*
|
|
491
|
+
* @task T1658
|
|
492
|
+
* @defaultValue undefined
|
|
493
|
+
*/
|
|
494
|
+
abortReason?: string | null;
|
|
466
495
|
}
|
|
467
496
|
|
|
468
497
|
// ---------------------------------------------------------------------------
|
package/src/tasks.ts
CHANGED
|
@@ -24,8 +24,6 @@ import type { TaskPriority, TaskStatus } from './task.js';
|
|
|
24
24
|
/**
|
|
25
25
|
* RCASD-IVTR+C pipeline stage values valid for `TaskView.pipelineStage`.
|
|
26
26
|
*
|
|
27
|
-
* Mirrors `TaskViewPipelineStage` from `packages/core/src/tasks/compute-task-view.ts`.
|
|
28
|
-
*
|
|
29
27
|
* @task T1703
|
|
30
28
|
*/
|
|
31
29
|
export type TaskViewPipelineStage =
|