@cleocode/contracts 2026.8.2 → 2026.8.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/collection-keys.d.ts +44 -0
- package/dist/collection-keys.d.ts.map +1 -0
- package/dist/collection-keys.js +42 -0
- package/dist/collection-keys.js.map +1 -0
- package/dist/dispatch/operations-registry.d.ts.map +1 -1
- package/dist/dispatch/operations-registry.js +21 -0
- package/dist/dispatch/operations-registry.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/llm/system-resolver.d.ts +10 -0
- package/dist/llm/system-resolver.d.ts.map +1 -1
- package/dist/operations/llm.d.ts +32 -1
- package/dist/operations/llm.d.ts.map +1 -1
- package/dist/spawn-types.d.ts +19 -0
- package/dist/spawn-types.d.ts.map +1 -1
- package/dist/task.d.ts +12 -1
- package/dist/task.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/__tests__/__snapshots__/operations-registry.test.ts.snap +1 -1
- package/src/collection-keys.ts +45 -0
- package/src/dispatch/operations-registry.ts +22 -0
- package/src/index.ts +2 -0
- package/src/llm/system-resolver.ts +10 -0
- package/src/operations/llm.ts +32 -1
- package/src/spawn-types.ts +20 -0
- package/src/task.ts +17 -1
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The keys under which CLEO payloads carry a list of records.
|
|
3
|
+
*
|
|
4
|
+
* ## Why this is a shared constant (T12077)
|
|
5
|
+
*
|
|
6
|
+
* Different operations name their collection differently — `tasks.list` emits
|
|
7
|
+
* `tasks`, the SDK's generic list emits `items`, `tasks.find` emits `results`,
|
|
8
|
+
* and `tasks.next` emits `suggestions`. Each consumer that wants "the rows"
|
|
9
|
+
* has historically inlined its own guess, and each wrong guess fails SILENTLY,
|
|
10
|
+
* because an absent key is indistinguishable from an empty result set.
|
|
11
|
+
*
|
|
12
|
+
* Three separate outages traced to exactly this:
|
|
13
|
+
*
|
|
14
|
+
* 1. **T12067** — `output-mode.ts` knew only `tasks`/`items`, in three
|
|
15
|
+
* separately-inlined lists. `cleo find … --output count` reported 1626
|
|
16
|
+
* while `--output id` reported `No ids.` against the same payload.
|
|
17
|
+
* 2. **T12077 (this)** — `cleo next --output id` / `--output count` reported
|
|
18
|
+
* nothing and zero while the envelope held 836 candidates, because
|
|
19
|
+
* `suggestions` was in nobody's list.
|
|
20
|
+
* 3. **T12077 (the severe one)** — `defaultPickTask` in the sentient loop read
|
|
21
|
+
* `response.data.tasks` from `cleo.tasks.find()`, which returns
|
|
22
|
+
* `{results, total}` *unwrapped*. The key was wrong AND the `data` envelope
|
|
23
|
+
* it was reaching through does not exist on the SDK surface, so
|
|
24
|
+
* `allCandidates` was **always `[]`**. The autonomous loop therefore
|
|
25
|
+
* returned `no-task` on every tick it had ever run — 24 ticks, 0 tasks
|
|
26
|
+
* picked, across three months — and looked exactly like "there is no work
|
|
27
|
+
* to do" rather than like a bug.
|
|
28
|
+
*
|
|
29
|
+
* The lesson those three share is that this list must exist in ONE place that
|
|
30
|
+
* both the render layer and the SDK consumers import. Adding an operation with
|
|
31
|
+
* a new collection key now means adding it here, once.
|
|
32
|
+
*
|
|
33
|
+
* @task T12077
|
|
34
|
+
*/
|
|
35
|
+
/**
|
|
36
|
+
* Collection keys in resolution order.
|
|
37
|
+
*
|
|
38
|
+
* Order matters only when a payload carries more than one (it should not);
|
|
39
|
+
* earlier keys win, which keeps the canonical `tasks` shape authoritative.
|
|
40
|
+
*/
|
|
41
|
+
export declare const COLLECTION_KEYS: readonly ["tasks", "items", "results", "suggestions"];
|
|
42
|
+
/** A key under which a payload may carry its rows. */
|
|
43
|
+
export type CollectionKey = (typeof COLLECTION_KEYS)[number];
|
|
44
|
+
//# sourceMappingURL=collection-keys.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collection-keys.d.ts","sourceRoot":"","sources":["../src/collection-keys.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH;;;;;GAKG;AACH,eAAO,MAAM,eAAe,uDAAwD,CAAC;AAErF,sDAAsD;AACtD,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The keys under which CLEO payloads carry a list of records.
|
|
3
|
+
*
|
|
4
|
+
* ## Why this is a shared constant (T12077)
|
|
5
|
+
*
|
|
6
|
+
* Different operations name their collection differently — `tasks.list` emits
|
|
7
|
+
* `tasks`, the SDK's generic list emits `items`, `tasks.find` emits `results`,
|
|
8
|
+
* and `tasks.next` emits `suggestions`. Each consumer that wants "the rows"
|
|
9
|
+
* has historically inlined its own guess, and each wrong guess fails SILENTLY,
|
|
10
|
+
* because an absent key is indistinguishable from an empty result set.
|
|
11
|
+
*
|
|
12
|
+
* Three separate outages traced to exactly this:
|
|
13
|
+
*
|
|
14
|
+
* 1. **T12067** — `output-mode.ts` knew only `tasks`/`items`, in three
|
|
15
|
+
* separately-inlined lists. `cleo find … --output count` reported 1626
|
|
16
|
+
* while `--output id` reported `No ids.` against the same payload.
|
|
17
|
+
* 2. **T12077 (this)** — `cleo next --output id` / `--output count` reported
|
|
18
|
+
* nothing and zero while the envelope held 836 candidates, because
|
|
19
|
+
* `suggestions` was in nobody's list.
|
|
20
|
+
* 3. **T12077 (the severe one)** — `defaultPickTask` in the sentient loop read
|
|
21
|
+
* `response.data.tasks` from `cleo.tasks.find()`, which returns
|
|
22
|
+
* `{results, total}` *unwrapped*. The key was wrong AND the `data` envelope
|
|
23
|
+
* it was reaching through does not exist on the SDK surface, so
|
|
24
|
+
* `allCandidates` was **always `[]`**. The autonomous loop therefore
|
|
25
|
+
* returned `no-task` on every tick it had ever run — 24 ticks, 0 tasks
|
|
26
|
+
* picked, across three months — and looked exactly like "there is no work
|
|
27
|
+
* to do" rather than like a bug.
|
|
28
|
+
*
|
|
29
|
+
* The lesson those three share is that this list must exist in ONE place that
|
|
30
|
+
* both the render layer and the SDK consumers import. Adding an operation with
|
|
31
|
+
* a new collection key now means adding it here, once.
|
|
32
|
+
*
|
|
33
|
+
* @task T12077
|
|
34
|
+
*/
|
|
35
|
+
/**
|
|
36
|
+
* Collection keys in resolution order.
|
|
37
|
+
*
|
|
38
|
+
* Order matters only when a payload carries more than one (it should not);
|
|
39
|
+
* earlier keys win, which keeps the canonical `tasks` shape authoritative.
|
|
40
|
+
*/
|
|
41
|
+
export const COLLECTION_KEYS = ['tasks', 'items', 'results', 'suggestions'];
|
|
42
|
+
//# sourceMappingURL=collection-keys.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collection-keys.js","sourceRoot":"","sources":["../src/collection-keys.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,aAAa,CAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operations-registry.d.ts","sourceRoot":"","sources":["../../src/dispatch/operations-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAKH,OAAO,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAEjG,YAAY,EAAE,eAAe,EAAE,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAMvE;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,YAAY,GAAG,YAAY,CAExD;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,eAAe,EAAE,GAAG,EAAE,YAAY,EAAE,GAAG,YAAY,EAAE,CAE1F;AAMD,6DAA6D;AAC7D,eAAO,MAAM,UAAU,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"operations-registry.d.ts","sourceRoot":"","sources":["../../src/dispatch/operations-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAKH,OAAO,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAEjG,YAAY,EAAE,eAAe,EAAE,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAMvE;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,YAAY,GAAG,YAAY,CAExD;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,eAAe,EAAE,GAAG,EAAE,YAAY,EAAE,GAAG,YAAY,EAAE,CAE1F;AAMD,6DAA6D;AAC7D,eAAO,MAAM,UAAU,EAAE,YAAY,EA+pTpC,CAAC"}
|
|
@@ -8120,6 +8120,27 @@ export const OPERATIONS = [
|
|
|
8120
8120
|
required: false,
|
|
8121
8121
|
description: 'Commit plan file before dispatching',
|
|
8122
8122
|
},
|
|
8123
|
+
// T12089: the plan SCOPE. The workflow regenerates the plan when no
|
|
8124
|
+
// committed plan is supplied, and `cleo release plan` requires
|
|
8125
|
+
// `--saga | --epic | --tasks` — so without one of these the dispatched
|
|
8126
|
+
// run dies at "Prepare bump-PR" after a fully green preflight.
|
|
8127
|
+
//
|
|
8128
|
+
// A param absent from this registry is STRIPPED before the domain handler
|
|
8129
|
+
// sees it, silently. `--tasks` was accepted by the CLI, forwarded by the
|
|
8130
|
+
// handler and by `releaseOpen`, and still arrived empty at the workflow
|
|
8131
|
+
// because this declaration was the fourth hop in the chain.
|
|
8132
|
+
{
|
|
8133
|
+
name: 'epic',
|
|
8134
|
+
type: 'string',
|
|
8135
|
+
required: false,
|
|
8136
|
+
description: 'Epic task ID forwarded as the plan scope (e.g. T9999)',
|
|
8137
|
+
},
|
|
8138
|
+
{
|
|
8139
|
+
name: 'tasks',
|
|
8140
|
+
type: 'string',
|
|
8141
|
+
required: false,
|
|
8142
|
+
description: 'Comma-separated task IDs forwarded as the plan scope for a task-scoped release',
|
|
8143
|
+
},
|
|
8123
8144
|
],
|
|
8124
8145
|
},
|
|
8125
8146
|
// release mutate: reconcile (T9526 / SPEC-T9345 §4.4 — v2 reconcile verb)
|