@cleocode/contracts 2026.8.1 → 2026.8.3
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/caamp-markers.d.ts +99 -0
- package/dist/caamp-markers.d.ts.map +1 -0
- package/dist/caamp-markers.js +121 -0
- package/dist/caamp-markers.js.map +1 -0
- package/dist/changesets.d.ts +2 -2
- 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 +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- 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/caamp-markers.ts +149 -0
- package/src/collection-keys.ts +45 -0
- package/src/dispatch/operations-registry.ts +22 -0
- package/src/index.ts +14 -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,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CAAMP instruction-block marker grammar — the single source of truth.
|
|
3
|
+
*
|
|
4
|
+
* CAAMP delimits the region it owns inside an agent instruction file
|
|
5
|
+
* (`AGENTS.md`, `CLAUDE.md`, `GEMINI.md`, …) with a pair of HTML comments:
|
|
6
|
+
*
|
|
7
|
+
* ```markdown
|
|
8
|
+
* <!-- CAAMP:START -->
|
|
9
|
+
* @~/.cleo/templates/CLEO-INJECTION.md
|
|
10
|
+
* <!-- CAAMP:END -->
|
|
11
|
+
* ```
|
|
12
|
+
*
|
|
13
|
+
* Before T12051 this grammar was re-declared as inline string and regex
|
|
14
|
+
* literals in at least five places — `caamp/core/instructions/injector.ts`,
|
|
15
|
+
* `caamp/core/harness/pi.ts`, `core/injection.ts`, `core/bootstrap.ts` and
|
|
16
|
+
* `core/validation/doctor/checks.ts`. Each copy recognised a slightly
|
|
17
|
+
* different dialect, so a file that one module considered healthy another
|
|
18
|
+
* considered corrupt.
|
|
19
|
+
*
|
|
20
|
+
* The grammar lives here, in the leaf package, because `@cleocode/core` and
|
|
21
|
+
* `@cleocode/caamp` depend on each other and therefore cannot import the
|
|
22
|
+
* grammar from one another without a cycle.
|
|
23
|
+
*
|
|
24
|
+
* This module is **const data only** — no runtime helpers — so it satisfies
|
|
25
|
+
* the contracts-purity gate (`scripts/lint-no-runtime-in-contracts.mjs`).
|
|
26
|
+
* The engine that consumes these patterns lives in
|
|
27
|
+
* `packages/caamp/src/core/instructions/markers.ts`.
|
|
28
|
+
*
|
|
29
|
+
* @task T12051
|
|
30
|
+
* @see {@link https://github.com/kryptobaseddev/cleo} ADR-064 (CAAMP↔Adapters boundary)
|
|
31
|
+
*/
|
|
32
|
+
/** Canonical opening marker of a CAAMP-managed block. */
|
|
33
|
+
export declare const CAAMP_MARKER_START = "<!-- CAAMP:START -->";
|
|
34
|
+
/** Canonical closing marker of a CAAMP-managed block. */
|
|
35
|
+
export declare const CAAMP_MARKER_END = "<!-- CAAMP:END -->";
|
|
36
|
+
/**
|
|
37
|
+
* Source of the strict, canonical block pattern.
|
|
38
|
+
*
|
|
39
|
+
* Capture group 1 is the block's inner content. Build a fresh `RegExp` from
|
|
40
|
+
* this string at every use site — a module-level `RegExp` carrying the `g`
|
|
41
|
+
* flag keeps a mutable `lastIndex`, which silently skips matches when the
|
|
42
|
+
* same object is reused across `.test()` / `.exec()` calls.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```typescript
|
|
46
|
+
* const pattern = new RegExp(CAAMP_BLOCK_PATTERN_SOURCE, 'g');
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
export declare const CAAMP_BLOCK_PATTERN_SOURCE = "<!-- CAAMP:START -->([\\s\\S]*?)<!-- CAAMP:END -->";
|
|
50
|
+
/**
|
|
51
|
+
* Source of the damage-tolerant pattern matching an opening marker line.
|
|
52
|
+
*
|
|
53
|
+
* Use with the `gmi` flags. Matches all of:
|
|
54
|
+
*
|
|
55
|
+
* | Form | Damage |
|
|
56
|
+
* | ------------------------ | -------------------------- |
|
|
57
|
+
* | `<!-- CAAMP:START -->` | none (canonical) |
|
|
58
|
+
* | `!-- CAAMP:START -->` | leading `<` lost |
|
|
59
|
+
* | `<!-- CAAMP:START --` | trailing `>` lost |
|
|
60
|
+
* | `<!--CAAMP:START-->` | spaces collapsed |
|
|
61
|
+
* | `<!-- caamp:start -->` | case folded |
|
|
62
|
+
*
|
|
63
|
+
* A bare `CAAMP:START` with no comment punctuation at all is deliberately NOT
|
|
64
|
+
* matched — see {@link damagedMarkerSource}.
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```typescript
|
|
68
|
+
* const damaged = new RegExp(CAAMP_DAMAGED_START_PATTERN_SOURCE, 'gmi');
|
|
69
|
+
* const healed = content.replace(damaged, CAAMP_MARKER_START);
|
|
70
|
+
* ```
|
|
71
|
+
*/
|
|
72
|
+
export declare const CAAMP_DAMAGED_START_PATTERN_SOURCE: string;
|
|
73
|
+
/**
|
|
74
|
+
* Source of the damage-tolerant pattern matching a closing marker line.
|
|
75
|
+
*
|
|
76
|
+
* Mirrors {@link CAAMP_DAMAGED_START_PATTERN_SOURCE} for `CAAMP:END`. Use
|
|
77
|
+
* with the `gmi` flags.
|
|
78
|
+
*/
|
|
79
|
+
export declare const CAAMP_DAMAGED_END_PATTERN_SOURCE: string;
|
|
80
|
+
/**
|
|
81
|
+
* The outcome of writing a CAAMP block into an instruction file.
|
|
82
|
+
*
|
|
83
|
+
* Previously re-declared as an inline union in eight separate locations.
|
|
84
|
+
*
|
|
85
|
+
* - `created` — the file did not exist and was written from scratch.
|
|
86
|
+
* - `added` — the file existed with no CAAMP block; one was prepended.
|
|
87
|
+
* - `repaired` — at least one damaged marker was healed back to canonical form.
|
|
88
|
+
* - `consolidated` — several blocks were merged down to exactly one.
|
|
89
|
+
* - `updated` — a single block existed and its content changed.
|
|
90
|
+
* - `intact` — the file already had exactly the desired content; no write.
|
|
91
|
+
*/
|
|
92
|
+
export type CaampInjectionAction = 'created' | 'added' | 'repaired' | 'consolidated' | 'updated' | 'intact';
|
|
93
|
+
/**
|
|
94
|
+
* Every {@link CaampInjectionAction} value, ordered from most to least
|
|
95
|
+
* invasive. Useful for reporting the single most significant action taken
|
|
96
|
+
* across a batch of files.
|
|
97
|
+
*/
|
|
98
|
+
export declare const CAAMP_INJECTION_ACTIONS: readonly ["created", "added", "repaired", "consolidated", "updated", "intact"];
|
|
99
|
+
//# sourceMappingURL=caamp-markers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"caamp-markers.d.ts","sourceRoot":"","sources":["../src/caamp-markers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,yDAAyD;AACzD,eAAO,MAAM,kBAAkB,yBAAyB,CAAC;AAEzD,yDAAyD;AACzD,eAAO,MAAM,gBAAgB,uBAAuB,CAAC;AAErD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,0BAA0B,uDAAuD,CAAC;AAiC/F;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,kCAAkC,QAA+B,CAAC;AAE/E;;;;;GAKG;AACH,eAAO,MAAM,gCAAgC,QAA6B,CAAC;AAE3E;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,oBAAoB,GAC5B,SAAS,GACT,OAAO,GACP,UAAU,GACV,cAAc,GACd,SAAS,GACT,QAAQ,CAAC;AAEb;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,gFAO1B,CAAC"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CAAMP instruction-block marker grammar — the single source of truth.
|
|
3
|
+
*
|
|
4
|
+
* CAAMP delimits the region it owns inside an agent instruction file
|
|
5
|
+
* (`AGENTS.md`, `CLAUDE.md`, `GEMINI.md`, …) with a pair of HTML comments:
|
|
6
|
+
*
|
|
7
|
+
* ```markdown
|
|
8
|
+
* <!-- CAAMP:START -->
|
|
9
|
+
* @~/.cleo/templates/CLEO-INJECTION.md
|
|
10
|
+
* <!-- CAAMP:END -->
|
|
11
|
+
* ```
|
|
12
|
+
*
|
|
13
|
+
* Before T12051 this grammar was re-declared as inline string and regex
|
|
14
|
+
* literals in at least five places — `caamp/core/instructions/injector.ts`,
|
|
15
|
+
* `caamp/core/harness/pi.ts`, `core/injection.ts`, `core/bootstrap.ts` and
|
|
16
|
+
* `core/validation/doctor/checks.ts`. Each copy recognised a slightly
|
|
17
|
+
* different dialect, so a file that one module considered healthy another
|
|
18
|
+
* considered corrupt.
|
|
19
|
+
*
|
|
20
|
+
* The grammar lives here, in the leaf package, because `@cleocode/core` and
|
|
21
|
+
* `@cleocode/caamp` depend on each other and therefore cannot import the
|
|
22
|
+
* grammar from one another without a cycle.
|
|
23
|
+
*
|
|
24
|
+
* This module is **const data only** — no runtime helpers — so it satisfies
|
|
25
|
+
* the contracts-purity gate (`scripts/lint-no-runtime-in-contracts.mjs`).
|
|
26
|
+
* The engine that consumes these patterns lives in
|
|
27
|
+
* `packages/caamp/src/core/instructions/markers.ts`.
|
|
28
|
+
*
|
|
29
|
+
* @task T12051
|
|
30
|
+
* @see {@link https://github.com/kryptobaseddev/cleo} ADR-064 (CAAMP↔Adapters boundary)
|
|
31
|
+
*/
|
|
32
|
+
/** Canonical opening marker of a CAAMP-managed block. */
|
|
33
|
+
export const CAAMP_MARKER_START = '<!-- CAAMP:START -->';
|
|
34
|
+
/** Canonical closing marker of a CAAMP-managed block. */
|
|
35
|
+
export const CAAMP_MARKER_END = '<!-- CAAMP:END -->';
|
|
36
|
+
/**
|
|
37
|
+
* Source of the strict, canonical block pattern.
|
|
38
|
+
*
|
|
39
|
+
* Capture group 1 is the block's inner content. Build a fresh `RegExp` from
|
|
40
|
+
* this string at every use site — a module-level `RegExp` carrying the `g`
|
|
41
|
+
* flag keeps a mutable `lastIndex`, which silently skips matches when the
|
|
42
|
+
* same object is reused across `.test()` / `.exec()` calls.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```typescript
|
|
46
|
+
* const pattern = new RegExp(CAAMP_BLOCK_PATTERN_SOURCE, 'g');
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
export const CAAMP_BLOCK_PATTERN_SOURCE = '<!-- CAAMP:START -->([\\s\\S]*?)<!-- CAAMP:END -->';
|
|
50
|
+
/**
|
|
51
|
+
* Horizontal-whitespace class used by the damage-tolerant marker patterns.
|
|
52
|
+
*
|
|
53
|
+
* Deliberately excludes `\n` so the patterns stay anchored to a single line
|
|
54
|
+
* and cannot swallow surrounding content.
|
|
55
|
+
*/
|
|
56
|
+
const H = '[ \\t\\r]';
|
|
57
|
+
/**
|
|
58
|
+
* Build the source of a damage-tolerant, whole-line marker pattern.
|
|
59
|
+
*
|
|
60
|
+
* Recognises the canonical marker plus the near-miss forms produced when a
|
|
61
|
+
* delimiter character is lost or mangled — a truncated write, an editor that
|
|
62
|
+
* reflows HTML comments, a shell heredoc, a careless hand edit.
|
|
63
|
+
*
|
|
64
|
+
* Two constraints keep this from over-matching, both learned from an
|
|
65
|
+
* adversarial review that demonstrated content loss with a looser pattern:
|
|
66
|
+
*
|
|
67
|
+
* 1. The `CAAMP:<KEYWORD>` token must be the *entire* line, modulo comment
|
|
68
|
+
* punctuation and horizontal whitespace. Prose such as "the CAAMP:START
|
|
69
|
+
* marker is written by …" is therefore never matched.
|
|
70
|
+
* 2. Comment punctuation must be present on **both** sides — at least one of
|
|
71
|
+
* `< ! -` before the token and at least one of `- >` after it. A bare
|
|
72
|
+
* `CAAMP:START` line is deliberately NOT treated as a damaged marker: it is
|
|
73
|
+
* not a plausible outcome of losing one delimiter character, and accepting
|
|
74
|
+
* it caused a documentation fence that merely *mentioned* CAAMP to be
|
|
75
|
+
* rewritten into a real marker, silently swallowing the fenced body.
|
|
76
|
+
*/
|
|
77
|
+
const damagedMarkerSource = (keyword) => `^${H}*[<!-]{1,4}${H}*CAAMP${H}*:${H}*${keyword}${H}*[->]{1,3}${H}*$`;
|
|
78
|
+
/**
|
|
79
|
+
* Source of the damage-tolerant pattern matching an opening marker line.
|
|
80
|
+
*
|
|
81
|
+
* Use with the `gmi` flags. Matches all of:
|
|
82
|
+
*
|
|
83
|
+
* | Form | Damage |
|
|
84
|
+
* | ------------------------ | -------------------------- |
|
|
85
|
+
* | `<!-- CAAMP:START -->` | none (canonical) |
|
|
86
|
+
* | `!-- CAAMP:START -->` | leading `<` lost |
|
|
87
|
+
* | `<!-- CAAMP:START --` | trailing `>` lost |
|
|
88
|
+
* | `<!--CAAMP:START-->` | spaces collapsed |
|
|
89
|
+
* | `<!-- caamp:start -->` | case folded |
|
|
90
|
+
*
|
|
91
|
+
* A bare `CAAMP:START` with no comment punctuation at all is deliberately NOT
|
|
92
|
+
* matched — see {@link damagedMarkerSource}.
|
|
93
|
+
*
|
|
94
|
+
* @example
|
|
95
|
+
* ```typescript
|
|
96
|
+
* const damaged = new RegExp(CAAMP_DAMAGED_START_PATTERN_SOURCE, 'gmi');
|
|
97
|
+
* const healed = content.replace(damaged, CAAMP_MARKER_START);
|
|
98
|
+
* ```
|
|
99
|
+
*/
|
|
100
|
+
export const CAAMP_DAMAGED_START_PATTERN_SOURCE = damagedMarkerSource('START');
|
|
101
|
+
/**
|
|
102
|
+
* Source of the damage-tolerant pattern matching a closing marker line.
|
|
103
|
+
*
|
|
104
|
+
* Mirrors {@link CAAMP_DAMAGED_START_PATTERN_SOURCE} for `CAAMP:END`. Use
|
|
105
|
+
* with the `gmi` flags.
|
|
106
|
+
*/
|
|
107
|
+
export const CAAMP_DAMAGED_END_PATTERN_SOURCE = damagedMarkerSource('END');
|
|
108
|
+
/**
|
|
109
|
+
* Every {@link CaampInjectionAction} value, ordered from most to least
|
|
110
|
+
* invasive. Useful for reporting the single most significant action taken
|
|
111
|
+
* across a batch of files.
|
|
112
|
+
*/
|
|
113
|
+
export const CAAMP_INJECTION_ACTIONS = [
|
|
114
|
+
'created',
|
|
115
|
+
'added',
|
|
116
|
+
'repaired',
|
|
117
|
+
'consolidated',
|
|
118
|
+
'updated',
|
|
119
|
+
'intact',
|
|
120
|
+
];
|
|
121
|
+
//# sourceMappingURL=caamp-markers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"caamp-markers.js","sourceRoot":"","sources":["../src/caamp-markers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,yDAAyD;AACzD,MAAM,CAAC,MAAM,kBAAkB,GAAG,sBAAsB,CAAC;AAEzD,yDAAyD;AACzD,MAAM,CAAC,MAAM,gBAAgB,GAAG,oBAAoB,CAAC;AAErD;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,oDAAoD,CAAC;AAE/F;;;;;GAKG;AACH,MAAM,CAAC,GAAG,WAAW,CAAC;AAEtB;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,mBAAmB,GAAG,CAAC,OAAwB,EAAU,EAAE,CAC/D,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,OAAO,GAAG,CAAC,aAAa,CAAC,IAAI,CAAC;AAExE;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAAG,mBAAmB,CAAC,OAAO,CAAC,CAAC;AAE/E;;;;;GAKG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAAG,mBAAmB,CAAC,KAAK,CAAC,CAAC;AAsB3E;;;;GAIG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,SAAS;IACT,OAAO;IACP,UAAU;IACV,cAAc;IACd,SAAS;IACT,QAAQ;CACA,CAAC"}
|
package/dist/changesets.d.ts
CHANGED
|
@@ -82,8 +82,8 @@ export declare const ChangesetReleaseNotesMetadataSchema: z.ZodObject<{
|
|
|
82
82
|
deprecated: "deprecated";
|
|
83
83
|
security: "security";
|
|
84
84
|
fixed: "fixed";
|
|
85
|
-
breaking: "breaking";
|
|
86
85
|
added: "added";
|
|
86
|
+
breaking: "breaking";
|
|
87
87
|
changed: "changed";
|
|
88
88
|
}>>;
|
|
89
89
|
audience: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
@@ -149,8 +149,8 @@ export declare const ChangesetEntrySchema: z.ZodObject<{
|
|
|
149
149
|
deprecated: "deprecated";
|
|
150
150
|
security: "security";
|
|
151
151
|
fixed: "fixed";
|
|
152
|
-
breaking: "breaking";
|
|
153
152
|
added: "added";
|
|
153
|
+
breaking: "breaking";
|
|
154
154
|
changed: "changed";
|
|
155
155
|
}>>;
|
|
156
156
|
audience: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
@@ -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)
|