@cleocode/contracts 2026.4.151 → 2026.4.153
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 +149 -405
- package/dist/branch-lock.d.ts +13 -0
- package/dist/branch-lock.d.ts.map +1 -1
- package/dist/branch-lock.js +13 -0
- package/dist/branch-lock.js.map +1 -1
- package/dist/facade.d.ts +2 -0
- package/dist/facade.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/operations/admin.d.ts +0 -70
- package/dist/operations/admin.d.ts.map +1 -1
- package/dist/operations/index.d.ts +2 -0
- package/dist/operations/index.d.ts.map +1 -1
- package/dist/operations/index.js +2 -0
- package/dist/operations/index.js.map +1 -1
- package/dist/operations/nexus.d.ts +31 -1
- package/dist/operations/nexus.d.ts.map +1 -1
- package/dist/operations/pipeline.d.ts +15 -0
- package/dist/operations/pipeline.d.ts.map +1 -0
- package/dist/operations/pipeline.js +15 -0
- package/dist/operations/pipeline.js.map +1 -0
- package/dist/operations/session.d.ts +3 -0
- package/dist/operations/session.d.ts.map +1 -1
- package/dist/operations/tasks.d.ts +10 -271
- package/dist/operations/tasks.d.ts.map +1 -1
- package/dist/operations/tasks.js +10 -3
- package/dist/operations/tasks.js.map +1 -1
- package/dist/operations/validate.d.ts +7 -0
- package/dist/operations/validate.d.ts.map +1 -1
- package/package.json +9 -1
- package/src/branch-lock.ts +13 -0
- package/src/facade.ts +2 -0
- package/src/index.ts +1 -1
- package/src/operations/admin.ts +0 -88
- package/src/operations/index.ts +2 -0
- package/src/operations/nexus.ts +31 -1
- package/src/operations/pipeline.ts +13 -0
- package/src/operations/session.ts +3 -0
- package/src/operations/tasks.ts +10 -309
- package/src/operations/validate.ts +7 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cleocode/contracts",
|
|
3
|
-
"version": "2026.4.
|
|
3
|
+
"version": "2026.4.153",
|
|
4
4
|
"description": "Domain types, interfaces, and contracts for the CLEO ecosystem",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -49,6 +49,14 @@
|
|
|
49
49
|
"./nexus-tasks-bridge-ops.js": {
|
|
50
50
|
"types": "./dist/nexus-tasks-bridge-ops.d.ts",
|
|
51
51
|
"import": "./dist/nexus-tasks-bridge-ops.js"
|
|
52
|
+
},
|
|
53
|
+
"./operations/*": {
|
|
54
|
+
"types": "./dist/operations/*.d.ts",
|
|
55
|
+
"import": "./dist/operations/*.js"
|
|
56
|
+
},
|
|
57
|
+
"./operations/*.js": {
|
|
58
|
+
"types": "./dist/operations/*.d.ts",
|
|
59
|
+
"import": "./dist/operations/*.js"
|
|
52
60
|
}
|
|
53
61
|
},
|
|
54
62
|
"engines": {
|
package/src/branch-lock.ts
CHANGED
|
@@ -227,6 +227,8 @@ export interface OwnerOverrideConfig {
|
|
|
227
227
|
* Error codes emitted by the branch-lock + override-auth system.
|
|
228
228
|
*
|
|
229
229
|
* @task T1118
|
|
230
|
+
* @task T1501
|
|
231
|
+
* @task T1502
|
|
230
232
|
*/
|
|
231
233
|
export const BRANCH_LOCK_ERROR_CODES = {
|
|
232
234
|
/** L2: git shim blocked a branch-mutating operation. */
|
|
@@ -247,6 +249,17 @@ export const BRANCH_LOCK_ERROR_CODES = {
|
|
|
247
249
|
E_OVERRIDE_NEEDS_TTY: 'E_OVERRIDE_NEEDS_TTY',
|
|
248
250
|
/** L4d: session override limit exceeded. */
|
|
249
251
|
E_OVERRIDE_RATE_LIMIT: 'E_OVERRIDE_RATE_LIMIT',
|
|
252
|
+
/**
|
|
253
|
+
* T1501 / P0-5: per-session cap (default 3) exceeded without a valid waiver doc.
|
|
254
|
+
* Set CLEO_OWNER_OVERRIDE_WAIVER=<absolute path> to a file containing
|
|
255
|
+
* `cap-waiver: true` in its frontmatter to bypass the cap.
|
|
256
|
+
*/
|
|
257
|
+
E_OVERRIDE_CAP_EXCEEDED: 'E_OVERRIDE_CAP_EXCEEDED',
|
|
258
|
+
/**
|
|
259
|
+
* T1502 / P0-6: the same evidence atom was used across >3 distinct tasks and
|
|
260
|
+
* `--shared-evidence` was not passed (or CLEO_STRICT_EVIDENCE=1 is set in CI).
|
|
261
|
+
*/
|
|
262
|
+
E_SHARED_EVIDENCE_FLAG_REQUIRED: 'E_SHARED_EVIDENCE_FLAG_REQUIRED',
|
|
250
263
|
} as const;
|
|
251
264
|
|
|
252
265
|
/** Union of all branch-lock error code strings. */
|
package/src/facade.ts
CHANGED
|
@@ -276,6 +276,8 @@ export interface TasksAPI {
|
|
|
276
276
|
labels?: string[];
|
|
277
277
|
depends?: string[];
|
|
278
278
|
notes?: string;
|
|
279
|
+
/** Acceptance criteria items (free-text strings or structured gate specs). */
|
|
280
|
+
acceptance?: string[];
|
|
279
281
|
}): Promise<unknown>;
|
|
280
282
|
/** Find tasks by query, ID, status, or limit. */
|
|
281
283
|
find(params: {
|
package/src/index.ts
CHANGED
|
@@ -462,7 +462,6 @@ export type {
|
|
|
462
462
|
AdminDashParams,
|
|
463
463
|
AdminDetectParams,
|
|
464
464
|
AdminExportParams,
|
|
465
|
-
AdminHandlerOps,
|
|
466
465
|
AdminHealthMutateParams,
|
|
467
466
|
AdminHealthQueryParams,
|
|
468
467
|
AdminHelpParams,
|
|
@@ -477,6 +476,7 @@ export type {
|
|
|
477
476
|
AdminMapMutateParams,
|
|
478
477
|
AdminMapQueryParams,
|
|
479
478
|
AdminMigrateParams,
|
|
479
|
+
AdminOps,
|
|
480
480
|
AdminPathsParams,
|
|
481
481
|
AdminRoadmapParams,
|
|
482
482
|
AdminRuntimeParams,
|
package/src/operations/admin.ts
CHANGED
|
@@ -2085,91 +2085,3 @@ export type AdminOps =
|
|
|
2085
2085
|
params: AdminInstallGlobalParams;
|
|
2086
2086
|
result: AdminInstallGlobalResult;
|
|
2087
2087
|
};
|
|
2088
|
-
|
|
2089
|
-
// ============================================================================
|
|
2090
|
-
// AdminHandlerOps — TypedOpRecord for TypedDomainHandler<AdminHandlerOps>
|
|
2091
|
-
//
|
|
2092
|
-
// Maps each handler-level operation name (without the "admin." prefix used in
|
|
2093
|
-
// AdminOps) to a `[Params, Result]` tuple. This is the format consumed by
|
|
2094
|
-
// `defineTypedHandler` and `typedDispatch` in the dispatch adapter.
|
|
2095
|
-
//
|
|
2096
|
-
// Operations that support multiple result shapes (e.g. `admin.job` returns
|
|
2097
|
-
// either a status record or a list) use a union result type — callers narrow
|
|
2098
|
-
// on the `action` param they supplied.
|
|
2099
|
-
//
|
|
2100
|
-
// @task T1426 — typed-narrowing migration for admin domain
|
|
2101
|
-
// @see AdminOps (discriminated-union form, kept for facade / external callers)
|
|
2102
|
-
// ============================================================================
|
|
2103
|
-
|
|
2104
|
-
/**
|
|
2105
|
-
* TypedOpRecord for the `admin` domain handler.
|
|
2106
|
-
*
|
|
2107
|
-
* Each entry maps the bare operation name (as dispatched by the handler
|
|
2108
|
-
* switch, without the `admin.` domain prefix) to `[Params, Result]`.
|
|
2109
|
-
*
|
|
2110
|
-
* @task T1426 — Wave D typed-dispatch migration for admin domain
|
|
2111
|
-
*/
|
|
2112
|
-
export type AdminHandlerOps = {
|
|
2113
|
-
// ---- Query ops ----
|
|
2114
|
-
readonly version: readonly [AdminVersionParams, AdminVersionResult];
|
|
2115
|
-
readonly health: readonly [AdminHealthQueryParams, AdminHealthQueryResult | AdminDoctorResult];
|
|
2116
|
-
readonly 'config.show': readonly [AdminConfigShowParams, AdminConfigShowResult];
|
|
2117
|
-
readonly 'config.presets': readonly [AdminConfigPresetsParams, AdminConfigPresetsResult];
|
|
2118
|
-
readonly stats: readonly [AdminStatsParams, AdminStatsResult];
|
|
2119
|
-
readonly context: readonly [AdminContextParams, AdminContextResult];
|
|
2120
|
-
readonly 'context.pull': readonly [AdminContextPullParams, AdminContextPullResult];
|
|
2121
|
-
readonly runtime: readonly [AdminRuntimeParams, AdminRuntimeResult];
|
|
2122
|
-
readonly paths: readonly [AdminPathsParams, AdminPathsResult];
|
|
2123
|
-
readonly job: readonly [AdminJobStatusParams, AdminJobStatusResult | AdminJobListResult];
|
|
2124
|
-
readonly dash: readonly [AdminDashParams, AdminDashResult];
|
|
2125
|
-
readonly log: readonly [AdminLogParams, AdminLogResult];
|
|
2126
|
-
readonly sequence: readonly [AdminSequenceParams, AdminSequenceResult];
|
|
2127
|
-
readonly help: readonly [AdminHelpParams, AdminHelpResult];
|
|
2128
|
-
readonly token: readonly [
|
|
2129
|
-
AdminTokenQueryParams,
|
|
2130
|
-
AdminTokenSummaryResult | AdminTokenListResult | AdminTokenShowResult,
|
|
2131
|
-
];
|
|
2132
|
-
readonly 'adr.find': readonly [AdminAdrFindParams, AdminAdrFindResult];
|
|
2133
|
-
readonly 'adr.show': readonly [AdminAdrShowParams, AdminAdrShowResult];
|
|
2134
|
-
readonly backup: readonly [AdminBackupListParams, AdminBackupListResult];
|
|
2135
|
-
readonly export: readonly [
|
|
2136
|
-
AdminExportParams,
|
|
2137
|
-
AdminExportStandardResult | AdminExportSnapshotResult | AdminExportTasksPackageResult,
|
|
2138
|
-
];
|
|
2139
|
-
readonly map: readonly [AdminMapQueryParams, AdminMapResult];
|
|
2140
|
-
readonly roadmap: readonly [AdminRoadmapParams, AdminRoadmapResult];
|
|
2141
|
-
readonly smoke: readonly [AdminSmokeParams, AdminSmokeResult];
|
|
2142
|
-
readonly 'smoke.provider': readonly [AdminSmokeProviderParams, AdminSmokeProviderResult];
|
|
2143
|
-
readonly 'hooks.matrix': readonly [AdminHooksMatrixParams, AdminHooksMatrixResult];
|
|
2144
|
-
// ---- Mutate ops ----
|
|
2145
|
-
readonly init: readonly [AdminInitParams, AdminInitResult];
|
|
2146
|
-
readonly 'scaffold-hub': readonly [AdminScaffoldHubParams, AdminScaffoldHubResult];
|
|
2147
|
-
readonly 'health.mutate': readonly [
|
|
2148
|
-
AdminHealthMutateParams,
|
|
2149
|
-
AdminHealthRepairResult | AdminDoctorResult,
|
|
2150
|
-
];
|
|
2151
|
-
readonly 'config.set': readonly [AdminConfigSetParams, AdminConfigSetResult];
|
|
2152
|
-
readonly 'config.set-preset': readonly [AdminConfigSetPresetParams, AdminConfigSetPresetResult];
|
|
2153
|
-
readonly 'backup.mutate': readonly [
|
|
2154
|
-
AdminBackupMutateParams,
|
|
2155
|
-
AdminBackupCreateResult | AdminBackupRestoreByIdResult | AdminBackupRestoreFileResult,
|
|
2156
|
-
];
|
|
2157
|
-
readonly migrate: readonly [AdminMigrateParams, AdminMigrateResult];
|
|
2158
|
-
readonly cleanup: readonly [AdminCleanupParams, AdminCleanupResult];
|
|
2159
|
-
readonly 'job.cancel': readonly [AdminJobCancelParams, AdminJobCancelResult];
|
|
2160
|
-
readonly safestop: readonly [AdminSafestopParams, AdminSafestopResult];
|
|
2161
|
-
readonly 'inject.generate': readonly [AdminInjectGenerateParams, AdminInjectGenerateResult];
|
|
2162
|
-
readonly 'adr.sync': readonly [AdminAdrSyncParams, AdminAdrSyncResult | AdminAdrValidateResult];
|
|
2163
|
-
readonly import: readonly [
|
|
2164
|
-
AdminImportParams,
|
|
2165
|
-
AdminImportStandardResult | AdminImportSnapshotResult | AdminImportTasksPackageResult,
|
|
2166
|
-
];
|
|
2167
|
-
readonly detect: readonly [AdminDetectParams, AdminDetectResult];
|
|
2168
|
-
readonly 'token.mutate': readonly [
|
|
2169
|
-
AdminTokenMutateParams,
|
|
2170
|
-
AdminTokenRecordResult | AdminTokenDeleteResult | AdminTokenClearResult,
|
|
2171
|
-
];
|
|
2172
|
-
readonly 'context.inject': readonly [AdminContextInjectParams, AdminContextInjectResult];
|
|
2173
|
-
readonly 'map.mutate': readonly [AdminMapMutateParams, AdminMapMutateResult];
|
|
2174
|
-
readonly 'install.global': readonly [AdminInstallGlobalParams, AdminInstallGlobalResult];
|
|
2175
|
-
};
|
package/src/operations/index.ts
CHANGED
|
@@ -15,6 +15,8 @@ export * from './nexus.js';
|
|
|
15
15
|
export * from './nexus-user-profile.js';
|
|
16
16
|
export * from './orchestrate.js';
|
|
17
17
|
export * from './params.js';
|
|
18
|
+
export * from './pipeline.js';
|
|
19
|
+
export * from './playbook.js';
|
|
18
20
|
export * from './release.js';
|
|
19
21
|
export * from './research.js';
|
|
20
22
|
export * from './sentient.js';
|
package/src/operations/nexus.ts
CHANGED
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
22
|
// Profile types are now canonical in nexus-user-profile.ts (T1424 dedup)
|
|
23
|
+
import type { SigilCard } from './memory.js';
|
|
23
24
|
import type {
|
|
24
25
|
NexusProfileExportParams,
|
|
25
26
|
NexusProfileExportResult,
|
|
@@ -781,19 +782,43 @@ export interface NexusImpactParams {
|
|
|
781
782
|
projectId?: string;
|
|
782
783
|
/** Include "why" reasons (optional). */
|
|
783
784
|
why?: boolean;
|
|
785
|
+
/** Maximum reverse traversal depth (default 3, capped at 5). */
|
|
786
|
+
depth?: number;
|
|
784
787
|
}
|
|
785
788
|
/** Affected symbol in impact result. */
|
|
786
789
|
export interface NexusImpactAffectedNode {
|
|
790
|
+
/** Nexus node ID. */
|
|
787
791
|
nodeId: string;
|
|
792
|
+
/** Human-readable label. */
|
|
788
793
|
label: string;
|
|
794
|
+
/** Node kind. */
|
|
789
795
|
kind: string;
|
|
796
|
+
/** Source file path (nullable). */
|
|
797
|
+
filePath: string | null;
|
|
798
|
+
/** BFS depth from the target (1 = direct caller). */
|
|
799
|
+
depth: number;
|
|
800
|
+
/** Path-strings explaining why this symbol is impacted. */
|
|
790
801
|
reasons: string[];
|
|
791
802
|
}
|
|
792
803
|
/** Result of `nexus.impact`. */
|
|
793
804
|
export interface NexusImpactResult {
|
|
805
|
+
/** Original symbol query string. */
|
|
806
|
+
query: string;
|
|
807
|
+
/** Project ID the analysis ran against. */
|
|
808
|
+
projectId: string;
|
|
809
|
+
/** Resolved target node ID (or null when no match was found). */
|
|
794
810
|
targetNodeId: string | null;
|
|
811
|
+
/** Resolved target label (or null when no match was found). */
|
|
812
|
+
targetLabel: string | null;
|
|
813
|
+
/** Whether `why` reasons were requested and populated. */
|
|
795
814
|
why: boolean;
|
|
815
|
+
/** Risk tier based on totalImpact count. */
|
|
796
816
|
riskLevel: 'NONE' | 'LOW' | 'MEDIUM' | 'HIGH' | 'CRITICAL';
|
|
817
|
+
/** Total affected symbols across all depths (excludes the target itself). */
|
|
818
|
+
totalImpact: number;
|
|
819
|
+
/** Maximum traversal depth applied. */
|
|
820
|
+
maxDepth: number;
|
|
821
|
+
/** Affected symbols grouped by BFS depth. */
|
|
797
822
|
affected: NexusImpactAffectedNode[];
|
|
798
823
|
}
|
|
799
824
|
|
|
@@ -901,7 +926,12 @@ export interface NexusSigilListParams {
|
|
|
901
926
|
role?: string;
|
|
902
927
|
}
|
|
903
928
|
/** Result of `nexus.sigil.list`. */
|
|
904
|
-
export
|
|
929
|
+
export interface NexusSigilListResult {
|
|
930
|
+
/** Array of sigil records, ordered by displayName ascending. */
|
|
931
|
+
sigils: SigilCard[];
|
|
932
|
+
/** Total count of sigils returned. */
|
|
933
|
+
count: number;
|
|
934
|
+
}
|
|
905
935
|
|
|
906
936
|
/** Parameters for `nexus.sigil.sync` — none. */
|
|
907
937
|
export type NexusSigilSyncParams = Record<string, never>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pipeline Domain Operations — wire-format contracts.
|
|
3
|
+
*
|
|
4
|
+
* All pipeline *Params/*Result types were removed in T1446 (T1435-W2).
|
|
5
|
+
* The canonical source of truth is `OpsFromCore<typeof coreOps>` inside
|
|
6
|
+
* `packages/cleo/src/dispatch/domains/pipeline.ts`, which infers all
|
|
7
|
+
* operation param/result shapes directly from Core function signatures
|
|
8
|
+
* without requiring per-op type aliases in contracts.
|
|
9
|
+
*
|
|
10
|
+
* @task T1441 — OpsFromCore inference migration
|
|
11
|
+
* @task T1435 — Wave 1 dispatch refactor
|
|
12
|
+
* @task T1446 — strip redundant Params/Result aliases (T1435-W2)
|
|
13
|
+
*/
|
|
@@ -173,6 +173,9 @@ export type SessionBriefingShowResult = unknown;
|
|
|
173
173
|
// session.history (query — not in primary handler but exported for completeness)
|
|
174
174
|
/** Parameters for `session.history`. */
|
|
175
175
|
export interface SessionHistoryParams {
|
|
176
|
+
/** Specific session id to filter to. */
|
|
177
|
+
sessionId?: string;
|
|
178
|
+
/** Maximum number of sessions to return. */
|
|
176
179
|
limit?: number;
|
|
177
180
|
}
|
|
178
181
|
/** A single session history entry. */
|
package/src/operations/tasks.ts
CHANGED
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Tasks Domain Operations
|
|
2
|
+
* Tasks Domain Operations — wire-format contracts for the tasks dispatch domain.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Contains only types that appear in the `TasksOps` discriminated union (the
|
|
5
|
+
* authoritative wire-format spec) plus shared primitives (`TaskOp`,
|
|
6
|
+
* `MinimalTask`, `TaskPriority`, `TaskStatus`) used cross-domain.
|
|
7
|
+
*
|
|
8
|
+
* Legacy pre-dispatch aliases (`TasksCreateParams`, `TasksUpdateParams`, etc.)
|
|
9
|
+
* were removed in T1446 (T1435-W2). Use the dispatch-level types
|
|
10
|
+
* (`TasksAddParams`, `TasksUpdateQueryParams`, etc.) that appear in `TasksOps`.
|
|
6
11
|
*
|
|
7
12
|
* SYNC: Canonical type definitions live in the CLI package at:
|
|
8
13
|
* src/types/task.ts (TaskStatus, TaskPriority, Task, etc.)
|
|
9
14
|
* These operation types are the API contract (wire format).
|
|
10
15
|
* Internal domain types must stay aligned with CLI definitions.
|
|
16
|
+
*
|
|
17
|
+
* @task T1446 — strip redundant Params/Result aliases (T1435-W2)
|
|
11
18
|
*/
|
|
12
19
|
|
|
13
20
|
/**
|
|
@@ -44,12 +51,6 @@ export interface MinimalTask {
|
|
|
44
51
|
* Query Operations
|
|
45
52
|
*/
|
|
46
53
|
|
|
47
|
-
// tasks.get
|
|
48
|
-
export interface TasksGetParams {
|
|
49
|
-
taskId: string;
|
|
50
|
-
}
|
|
51
|
-
export type TasksGetResult = TaskOp;
|
|
52
|
-
|
|
53
54
|
// tasks.list
|
|
54
55
|
export interface TasksListParams {
|
|
55
56
|
parent?: string;
|
|
@@ -105,316 +106,16 @@ export interface TasksFindParams {
|
|
|
105
106
|
verbose?: boolean;
|
|
106
107
|
/**
|
|
107
108
|
* Filter by role axis (T944 — orthogonal axes).
|
|
108
|
-
* Accepts the same values as the `role` field on TasksCreateParams.
|
|
109
109
|
* @task T963 / T944
|
|
110
110
|
*/
|
|
111
111
|
role?: string;
|
|
112
112
|
}
|
|
113
113
|
export type TasksFindResult = MinimalTask[];
|
|
114
114
|
|
|
115
|
-
// tasks.exists
|
|
116
|
-
export interface TasksExistsParams {
|
|
117
|
-
taskId: string;
|
|
118
|
-
}
|
|
119
|
-
export interface TasksExistsResult {
|
|
120
|
-
exists: boolean;
|
|
121
|
-
taskId: string;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
// tasks.tree
|
|
125
|
-
export interface TasksTreeParams {
|
|
126
|
-
rootId?: string;
|
|
127
|
-
depth?: number;
|
|
128
|
-
}
|
|
129
|
-
export interface TaskTreeNode {
|
|
130
|
-
task: TaskOp;
|
|
131
|
-
children: TaskTreeNode[];
|
|
132
|
-
depth: number;
|
|
133
|
-
}
|
|
134
|
-
export type TasksTreeResult = TaskTreeNode[];
|
|
135
|
-
|
|
136
|
-
// tasks.blockers
|
|
137
|
-
export interface TasksBlockersParams {
|
|
138
|
-
taskId: string;
|
|
139
|
-
}
|
|
140
|
-
export interface Blocker {
|
|
141
|
-
taskId: string;
|
|
142
|
-
title: string;
|
|
143
|
-
status: TaskStatus;
|
|
144
|
-
blockType: 'dependency' | 'parent' | 'gate';
|
|
145
|
-
}
|
|
146
|
-
export type TasksBlockersResult = Blocker[];
|
|
147
|
-
|
|
148
|
-
// tasks.deps
|
|
149
|
-
export interface TasksDepsParams {
|
|
150
|
-
taskId: string;
|
|
151
|
-
direction?: 'upstream' | 'downstream' | 'both';
|
|
152
|
-
}
|
|
153
|
-
export interface TaskDependencyNode {
|
|
154
|
-
taskId: string;
|
|
155
|
-
title: string;
|
|
156
|
-
status: TaskStatus;
|
|
157
|
-
distance: number;
|
|
158
|
-
}
|
|
159
|
-
export interface TasksDepsResult {
|
|
160
|
-
taskId: string;
|
|
161
|
-
upstream: TaskDependencyNode[];
|
|
162
|
-
downstream: TaskDependencyNode[];
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
// tasks.analyze
|
|
166
|
-
export interface TasksAnalyzeParams {
|
|
167
|
-
epicId?: string;
|
|
168
|
-
}
|
|
169
|
-
export interface TriageRecommendation {
|
|
170
|
-
taskId: string;
|
|
171
|
-
title: string;
|
|
172
|
-
priority: number;
|
|
173
|
-
reason: string;
|
|
174
|
-
readiness: 'ready' | 'blocked' | 'pending';
|
|
175
|
-
}
|
|
176
|
-
export type TasksAnalyzeResult = TriageRecommendation[];
|
|
177
|
-
|
|
178
|
-
// tasks.next
|
|
179
|
-
export interface TasksNextParams {
|
|
180
|
-
epicId?: string;
|
|
181
|
-
count?: number;
|
|
182
|
-
}
|
|
183
|
-
export interface SuggestedTask {
|
|
184
|
-
taskId: string;
|
|
185
|
-
title: string;
|
|
186
|
-
score: number;
|
|
187
|
-
rationale: string;
|
|
188
|
-
}
|
|
189
|
-
export type TasksNextResult = SuggestedTask[];
|
|
190
|
-
|
|
191
115
|
/**
|
|
192
116
|
* Mutate Operations
|
|
193
117
|
*/
|
|
194
118
|
|
|
195
|
-
// tasks.create
|
|
196
|
-
/**
|
|
197
|
-
* Parameters for `tasks.create` / `tasks.add`.
|
|
198
|
-
*
|
|
199
|
-
* @remarks
|
|
200
|
-
* Re-synced to match `AddTaskOptions` in `packages/core/src/tasks/add.ts`
|
|
201
|
-
* and the dispatch handler in `packages/cleo/src/dispatch/domains/tasks.ts`.
|
|
202
|
-
* The legacy contract was missing 8 fields (`type`, `acceptance`, `phase`,
|
|
203
|
-
* `size`, `notes`, `files`, `dryRun`, `parentSearch`) — agents following
|
|
204
|
-
* the contract would omit them and fail CLEO's anti-hallucination + epic
|
|
205
|
-
* creation enforcement.
|
|
206
|
-
*
|
|
207
|
-
* @task T963 — contract↔impl drift reconciliation (T910 audit)
|
|
208
|
-
*/
|
|
209
|
-
export interface TasksCreateParams {
|
|
210
|
-
/** Task title (required, 1..200 chars). @task T963 */
|
|
211
|
-
title: string;
|
|
212
|
-
/**
|
|
213
|
-
* Task description (required by anti-hallucination rule T5698 — must
|
|
214
|
-
* differ from `title`). The legacy contract marked this required; kept
|
|
215
|
-
* required here to preserve behavior.
|
|
216
|
-
* @task T963
|
|
217
|
-
*/
|
|
218
|
-
description: string;
|
|
219
|
-
/** Parent task id (`T###`). Omit for root-level tasks (epics only). @task T963 */
|
|
220
|
-
parent?: string;
|
|
221
|
-
/** Task IDs this task depends on. @task T963 */
|
|
222
|
-
depends?: string[];
|
|
223
|
-
/** Priority (`critical`|`high`|`medium`|`low`). Defaults to `medium`. @task T963 */
|
|
224
|
-
priority?: TaskPriority;
|
|
225
|
-
/** Label tags (lowercase alphanumeric + hyphens/periods). @task T963 */
|
|
226
|
-
labels?: string[];
|
|
227
|
-
/**
|
|
228
|
-
* Task type. When omitted, inferred from parent (epic-child → `task`,
|
|
229
|
-
* task-child → `subtask`, rootless → `task`). @task T963
|
|
230
|
-
*/
|
|
231
|
-
type?: 'epic' | 'task' | 'subtask';
|
|
232
|
-
/**
|
|
233
|
-
* Acceptance criteria (pipe-separated strings). Minimum 3 required by
|
|
234
|
-
* enforcement layer; epics require minimum 5.
|
|
235
|
-
* @task T963
|
|
236
|
-
*/
|
|
237
|
-
acceptance?: string[];
|
|
238
|
-
/** Phase slug (lowercase alphanumeric + hyphens). @task T963 */
|
|
239
|
-
phase?: string;
|
|
240
|
-
/** Task size (`small`|`medium`|`large`). Defaults to `medium`. @task T963 */
|
|
241
|
-
size?: 'small' | 'medium' | 'large';
|
|
242
|
-
/** Initial note text (timestamped at insertion). @task T963 */
|
|
243
|
-
notes?: string;
|
|
244
|
-
/** File paths associated with the task. @task T963 */
|
|
245
|
-
files?: string[];
|
|
246
|
-
/**
|
|
247
|
-
* When true, validate + preview the task without allocating a task id or
|
|
248
|
-
* writing to the DB. Preview returns an `id: 'T???'` placeholder.
|
|
249
|
-
* @task T963
|
|
250
|
-
*/
|
|
251
|
-
dryRun?: boolean;
|
|
252
|
-
/**
|
|
253
|
-
* CLI helper for parent resolution via search term — when set, dispatch
|
|
254
|
-
* layer resolves the search to a parent id before calling core.
|
|
255
|
-
* @task T963
|
|
256
|
-
*/
|
|
257
|
-
parentSearch?: string;
|
|
258
|
-
}
|
|
259
|
-
export type TasksCreateResult = TaskOp;
|
|
260
|
-
|
|
261
|
-
// tasks.update
|
|
262
|
-
/**
|
|
263
|
-
* Parameters for `tasks.update`.
|
|
264
|
-
*
|
|
265
|
-
* @remarks
|
|
266
|
-
* Re-synced to match `UpdateTaskOptions` in
|
|
267
|
-
* `packages/core/src/tasks/update.ts` and the dispatch handler in
|
|
268
|
-
* `packages/cleo/src/dispatch/domains/tasks.ts`. The legacy contract was
|
|
269
|
-
* missing `acceptance`, `pipelineStage` (T834 / ADR-051 Decision 4),
|
|
270
|
-
* `files`, `blockedBy`, `phase`, `noAutoComplete`, the narrow typing of
|
|
271
|
-
* `type`/`size`, and the `addDepends`/`removeDepends` array mutators.
|
|
272
|
-
*
|
|
273
|
-
* @task T963 — contract↔impl drift reconciliation (T910 audit)
|
|
274
|
-
*/
|
|
275
|
-
export interface TasksUpdateParams {
|
|
276
|
-
/** Task ID to update (required). @task T963 */
|
|
277
|
-
taskId: string;
|
|
278
|
-
/** Replace title. @task T963 */
|
|
279
|
-
title?: string;
|
|
280
|
-
/** Replace description. @task T963 */
|
|
281
|
-
description?: string;
|
|
282
|
-
/** Target status — `done` transitions route through complete flow. @task T963 */
|
|
283
|
-
status?: TaskStatus;
|
|
284
|
-
/** Replace priority. @task T963 */
|
|
285
|
-
priority?: TaskPriority;
|
|
286
|
-
/** Append a timestamped note. @task T963 */
|
|
287
|
-
notes?: string;
|
|
288
|
-
/** Set parent ID, or null/"" to promote to root. @task T963 */
|
|
289
|
-
parent?: string | null;
|
|
290
|
-
/** Replace labels wholesale. @task T963 */
|
|
291
|
-
labels?: string[];
|
|
292
|
-
/** Additive label insert. @task T963 */
|
|
293
|
-
addLabels?: string[];
|
|
294
|
-
/** Label removal set. @task T963 */
|
|
295
|
-
removeLabels?: string[];
|
|
296
|
-
/** Replace dependency list. @task T963 */
|
|
297
|
-
depends?: string[];
|
|
298
|
-
/** Additive dependency insert. @task T963 */
|
|
299
|
-
addDepends?: string[];
|
|
300
|
-
/** Dependency removal set. @task T963 */
|
|
301
|
-
removeDepends?: string[];
|
|
302
|
-
/** Task type (`epic`|`task`|`subtask`). @task T963 */
|
|
303
|
-
type?: 'epic' | 'task' | 'subtask';
|
|
304
|
-
/** Task size (`small`|`medium`|`large`). @task T963 */
|
|
305
|
-
size?: 'small' | 'medium' | 'large';
|
|
306
|
-
/**
|
|
307
|
-
* Replace acceptance criteria. Subject to AC enforcement — min 3 for
|
|
308
|
-
* all tasks, min 5 for epics.
|
|
309
|
-
* @task T963
|
|
310
|
-
*/
|
|
311
|
-
acceptance?: string[];
|
|
312
|
-
/** Replace files attached to the task. @task T963 */
|
|
313
|
-
files?: string[];
|
|
314
|
-
/** Phase slug (lowercase alphanumeric + hyphens). @task T963 */
|
|
315
|
-
phase?: string;
|
|
316
|
-
/** Blocking reason (set when status=`blocked`). @task T963 */
|
|
317
|
-
blockedBy?: string;
|
|
318
|
-
/**
|
|
319
|
-
* When true, skip auto-complete cascading when all children complete.
|
|
320
|
-
* @task T963
|
|
321
|
-
*/
|
|
322
|
-
noAutoComplete?: boolean;
|
|
323
|
-
/**
|
|
324
|
-
* RCASD-IVTR+C pipeline stage transition target. Forward-only
|
|
325
|
-
* (validated by `validatePipelineTransition`); epic advancements are
|
|
326
|
-
* additionally gated by `validateEpicStageAdvancement`; non-epic tasks
|
|
327
|
-
* are gated by `validateChildStageCeiling` against their ancestor epic.
|
|
328
|
-
* @task T963 / T834 / ADR-051 Decision 4
|
|
329
|
-
*/
|
|
330
|
-
pipelineStage?: string;
|
|
331
|
-
}
|
|
332
|
-
export type TasksUpdateResult = TaskOp;
|
|
333
|
-
|
|
334
|
-
// tasks.complete
|
|
335
|
-
export interface TasksCompleteParams {
|
|
336
|
-
taskId: string;
|
|
337
|
-
notes?: string;
|
|
338
|
-
archive?: boolean;
|
|
339
|
-
}
|
|
340
|
-
export interface TasksCompleteResult {
|
|
341
|
-
taskId: string;
|
|
342
|
-
completed: string;
|
|
343
|
-
archived: boolean;
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
// tasks.delete
|
|
347
|
-
export interface TasksDeleteParams {
|
|
348
|
-
taskId: string;
|
|
349
|
-
force?: boolean;
|
|
350
|
-
}
|
|
351
|
-
export interface TasksDeleteResult {
|
|
352
|
-
taskId: string;
|
|
353
|
-
deleted: true;
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
// tasks.archive
|
|
357
|
-
export interface TasksArchiveParams {
|
|
358
|
-
taskId?: string;
|
|
359
|
-
before?: string;
|
|
360
|
-
}
|
|
361
|
-
export interface TasksArchiveResult {
|
|
362
|
-
archived: number;
|
|
363
|
-
taskIds: string[];
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
// tasks.unarchive
|
|
367
|
-
export interface TasksUnarchiveParams {
|
|
368
|
-
taskId: string;
|
|
369
|
-
}
|
|
370
|
-
export type TasksUnarchiveResult = TaskOp;
|
|
371
|
-
|
|
372
|
-
// tasks.reparent
|
|
373
|
-
export interface TasksReparentParams {
|
|
374
|
-
taskId: string;
|
|
375
|
-
newParent: string;
|
|
376
|
-
}
|
|
377
|
-
export type TasksReparentResult = TaskOp;
|
|
378
|
-
|
|
379
|
-
// tasks.promote
|
|
380
|
-
export interface TasksPromoteParams {
|
|
381
|
-
taskId: string;
|
|
382
|
-
}
|
|
383
|
-
export type TasksPromoteResult = TaskOp;
|
|
384
|
-
|
|
385
|
-
// tasks.reorder
|
|
386
|
-
export interface TasksReorderParams {
|
|
387
|
-
taskId: string;
|
|
388
|
-
position: number;
|
|
389
|
-
}
|
|
390
|
-
export interface TasksReorderResult {
|
|
391
|
-
taskId: string;
|
|
392
|
-
newPosition: number;
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
// tasks.restore (completed tasks) — alias: reopen
|
|
396
|
-
export interface TasksReopenParams {
|
|
397
|
-
taskId: string;
|
|
398
|
-
}
|
|
399
|
-
export type TasksReopenResult = TaskOp;
|
|
400
|
-
|
|
401
|
-
// tasks.start (begin working on a task)
|
|
402
|
-
export interface TasksStartParams {
|
|
403
|
-
taskId: string;
|
|
404
|
-
}
|
|
405
|
-
export interface TasksStartResult {
|
|
406
|
-
taskId: string;
|
|
407
|
-
sessionId: string;
|
|
408
|
-
timestamp: string;
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
// tasks.stop (stop working on current task)
|
|
412
|
-
export type TasksStopParams = Record<string, never>;
|
|
413
|
-
export interface TasksStopResult {
|
|
414
|
-
stopped: true;
|
|
415
|
-
previousTask?: string;
|
|
416
|
-
}
|
|
417
|
-
|
|
418
119
|
// tasks.current (get currently active task)
|
|
419
120
|
export type TasksCurrentParams = Record<string, never>;
|
|
420
121
|
export interface TasksCurrentResult {
|
|
@@ -195,6 +195,13 @@ export interface ValidateGateParams {
|
|
|
195
195
|
reset?: boolean;
|
|
196
196
|
evidence?: string;
|
|
197
197
|
sessionId?: string;
|
|
198
|
+
/**
|
|
199
|
+
* Acknowledge that the same evidence atom is being applied to more than 3
|
|
200
|
+
* distinct tasks in this session (T1502 / P0-6). Without this flag,
|
|
201
|
+
* such reuse triggers a warning (or a hard reject in strict mode when
|
|
202
|
+
* `CLEO_STRICT_EVIDENCE=1`).
|
|
203
|
+
*/
|
|
204
|
+
sharedEvidence?: boolean;
|
|
198
205
|
}
|
|
199
206
|
export interface ValidateGateResult {
|
|
200
207
|
taskId: string;
|