@cleocode/contracts 2026.6.12 → 2026.6.13

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 (136) hide show
  1. package/dist/__tests__/operation-def.test.js +2 -1
  2. package/dist/__tests__/operation-def.test.js.map +1 -1
  3. package/dist/__tests__/sealed-credential.test.d.ts +19 -0
  4. package/dist/__tests__/sealed-credential.test.d.ts.map +1 -0
  5. package/dist/__tests__/sealed-credential.test.js +74 -0
  6. package/dist/__tests__/sealed-credential.test.js.map +1 -0
  7. package/dist/__tests__/skill-executor-contract.test.js +3 -0
  8. package/dist/__tests__/skill-executor-contract.test.js.map +1 -1
  9. package/dist/acceptance-gate.d.ts +2 -3
  10. package/dist/acceptance-gate.d.ts.map +1 -1
  11. package/dist/boundary.d.ts.map +1 -1
  12. package/dist/boundary.js +1 -19
  13. package/dist/boundary.js.map +1 -1
  14. package/dist/config.d.ts +102 -0
  15. package/dist/config.d.ts.map +1 -1
  16. package/dist/data-accessor.d.ts +21 -1
  17. package/dist/data-accessor.d.ts.map +1 -1
  18. package/dist/data-accessor.js.map +1 -1
  19. package/dist/dispatch/identity.d.ts +1 -1
  20. package/dist/dispatch/identity.d.ts.map +1 -1
  21. package/dist/dispatch/identity.js +5 -0
  22. package/dist/dispatch/identity.js.map +1 -1
  23. package/dist/dispatch/operations-registry.d.ts.map +1 -1
  24. package/dist/dispatch/operations-registry.js +46 -168
  25. package/dist/dispatch/operations-registry.js.map +1 -1
  26. package/dist/docs/read.d.ts +2 -2
  27. package/dist/index.d.ts +12 -7
  28. package/dist/index.d.ts.map +1 -1
  29. package/dist/index.js +3 -0
  30. package/dist/index.js.map +1 -1
  31. package/dist/lease-ipc/__tests__/freeze.test.d.ts +15 -0
  32. package/dist/lease-ipc/__tests__/freeze.test.d.ts.map +1 -0
  33. package/dist/lease-ipc/__tests__/freeze.test.js +221 -0
  34. package/dist/lease-ipc/__tests__/freeze.test.js.map +1 -0
  35. package/dist/lease-ipc/index.d.ts +17 -0
  36. package/dist/lease-ipc/index.d.ts.map +1 -0
  37. package/dist/lease-ipc/index.js +16 -0
  38. package/dist/lease-ipc/index.js.map +1 -0
  39. package/dist/lease-ipc/messages.d.ts +754 -0
  40. package/dist/lease-ipc/messages.d.ts.map +1 -0
  41. package/dist/lease-ipc/messages.js +383 -0
  42. package/dist/lease-ipc/messages.js.map +1 -0
  43. package/dist/lease-ipc/version.d.ts +41 -0
  44. package/dist/lease-ipc/version.d.ts.map +1 -0
  45. package/dist/lease-ipc/version.js +43 -0
  46. package/dist/lease-ipc/version.js.map +1 -0
  47. package/dist/llm/interfaces.d.ts +23 -0
  48. package/dist/llm/interfaces.d.ts.map +1 -1
  49. package/dist/llm/sealed-credential.d.ts +164 -0
  50. package/dist/llm/sealed-credential.d.ts.map +1 -0
  51. package/dist/llm/sealed-credential.js +43 -0
  52. package/dist/llm/sealed-credential.js.map +1 -0
  53. package/dist/llm/system-of-use.d.ts +383 -0
  54. package/dist/llm/system-of-use.d.ts.map +1 -0
  55. package/dist/llm/system-of-use.js +238 -0
  56. package/dist/llm/system-of-use.js.map +1 -0
  57. package/dist/llm/system-resolver.d.ts +45 -11
  58. package/dist/llm/system-resolver.d.ts.map +1 -1
  59. package/dist/llm/system-resolver.js +14 -7
  60. package/dist/llm/system-resolver.js.map +1 -1
  61. package/dist/operations/__tests__/ensures-schema-registry.test.d.ts +17 -0
  62. package/dist/operations/__tests__/ensures-schema-registry.test.d.ts.map +1 -0
  63. package/dist/operations/__tests__/ensures-schema-registry.test.js +113 -0
  64. package/dist/operations/__tests__/ensures-schema-registry.test.js.map +1 -0
  65. package/dist/operations/ensures-schema-registry.d.ts +172 -0
  66. package/dist/operations/ensures-schema-registry.d.ts.map +1 -0
  67. package/dist/operations/ensures-schema-registry.js +226 -0
  68. package/dist/operations/ensures-schema-registry.js.map +1 -0
  69. package/dist/operations/llm.d.ts +101 -9
  70. package/dist/operations/llm.d.ts.map +1 -1
  71. package/dist/operations/validate.d.ts +1 -12
  72. package/dist/operations/validate.d.ts.map +1 -1
  73. package/dist/operations/validate.js +1 -1
  74. package/dist/playbook.d.ts +60 -0
  75. package/dist/playbook.d.ts.map +1 -1
  76. package/dist/session.d.ts +11 -0
  77. package/dist/session.d.ts.map +1 -1
  78. package/dist/session.js.map +1 -1
  79. package/dist/templates/manifest.d.ts +1 -1
  80. package/dist/tools/agent-tools.d.ts +231 -0
  81. package/dist/tools/agent-tools.d.ts.map +1 -0
  82. package/dist/tools/agent-tools.js +25 -0
  83. package/dist/tools/agent-tools.js.map +1 -0
  84. package/dist/tools/atomic.d.ts +19 -0
  85. package/dist/tools/atomic.d.ts.map +1 -1
  86. package/dist/tools/atomic.js +17 -0
  87. package/dist/tools/atomic.js.map +1 -1
  88. package/dist/tools/index.d.ts +2 -0
  89. package/dist/tools/index.d.ts.map +1 -1
  90. package/dist/tools/skill-executor.d.ts +7 -0
  91. package/dist/tools/skill-executor.d.ts.map +1 -1
  92. package/dist/tools/web-tools.d.ts +217 -0
  93. package/dist/tools/web-tools.d.ts.map +1 -0
  94. package/dist/tools/web-tools.js +31 -0
  95. package/dist/tools/web-tools.js.map +1 -0
  96. package/package.json +6 -2
  97. package/src/__tests__/__snapshots__/operations-registry.test.ts.snap +1 -1
  98. package/src/__tests__/operation-def.test.ts +2 -1
  99. package/src/__tests__/sealed-credential.test.ts +100 -0
  100. package/src/__tests__/skill-executor-contract.test.ts +3 -0
  101. package/src/acceptance-gate.ts +2 -3
  102. package/src/boundary.ts +1 -20
  103. package/src/config.ts +104 -0
  104. package/src/data-accessor.ts +22 -1
  105. package/src/dispatch/identity.ts +5 -0
  106. package/src/dispatch/operations-registry.ts +51 -170
  107. package/src/index.ts +103 -24
  108. package/src/lease-ipc/__tests__/freeze.test.ts +246 -0
  109. package/src/lease-ipc/index.ts +63 -0
  110. package/src/lease-ipc/messages.ts +471 -0
  111. package/src/lease-ipc/version.ts +46 -0
  112. package/src/llm/interfaces.ts +23 -0
  113. package/src/llm/sealed-credential.ts +166 -0
  114. package/src/llm/system-of-use.ts +503 -0
  115. package/src/llm/system-resolver.ts +46 -11
  116. package/src/operations/__tests__/ensures-schema-registry.test.ts +169 -0
  117. package/src/operations/ensures-schema-registry.ts +260 -0
  118. package/src/operations/llm.ts +105 -8
  119. package/src/operations/validate.ts +1 -14
  120. package/src/playbook.ts +61 -0
  121. package/src/session.ts +11 -0
  122. package/src/tools/agent-tools.ts +270 -0
  123. package/src/tools/atomic.ts +21 -0
  124. package/src/tools/index.ts +46 -0
  125. package/src/tools/skill-executor.ts +7 -0
  126. package/src/tools/web-tools.ts +247 -0
  127. package/dist/tessera.d.ts +0 -32
  128. package/dist/tessera.d.ts.map +0 -1
  129. package/dist/tessera.js +0 -11
  130. package/dist/tessera.js.map +0 -1
  131. package/dist/warp-chain.d.ts +0 -129
  132. package/dist/warp-chain.d.ts.map +0 -1
  133. package/dist/warp-chain.js +0 -13
  134. package/dist/warp-chain.js.map +0 -1
  135. package/src/tessera.ts +0 -35
  136. package/src/warp-chain.ts +0 -185
@@ -0,0 +1,238 @@
1
+ /**
2
+ * `SystemOfUse` taxonomy — the structured identity of every CLEO subsystem that
3
+ * may request an LLM through the E9 chokepoint (`resolveLLMForSystem`).
4
+ *
5
+ * ## Why a discriminated descriptor (the hermes `_AUX_TASKS` analog)
6
+ *
7
+ * The first cut of the E9 chokepoint (T11749) accepted a flat string-literal
8
+ * label ({@link SystemOfUseLabel} — `'sentient' | 'memory' | …`). That covered
9
+ * the seven role-mapped background subsystems but had no room for the OTHER
10
+ * axes CLEO routes LLMs along:
11
+ *
12
+ * - **orchestration tiers** (`frontier`/`standard`/`fast`/`local`) — the
13
+ * capability lane a delegated turn runs in, independent of any role;
14
+ * - **tools / skills** — atomic tool primitives and `ct-*` skills that each
15
+ * may pin a model (the hermes `_AUX_TASKS` registry: one entry per named
16
+ * auxiliary task, each with its own provider/model binding);
17
+ * - **cantbook nodes** — per-node model selection inside a `.cantbook` flow;
18
+ * - **spawn units** — orchestrator-spawned worker agents that resolve their
19
+ * own LLM.
20
+ *
21
+ * `SystemOfUse` is the discriminated `{ kind, id }` descriptor that unifies all
22
+ * of these axes under ONE identity type. {@link BUILTIN_SYSTEMS_OF_USE} is the
23
+ * static registry of the well-known systems (orchestration tiers + the seven
24
+ * {@link RoleName}s + the auxiliary systems); `tool:` / `skill:` / `cantbook:` /
25
+ * `spawn-unit:` keys are OPEN — any runtime id is a valid `SystemOfUse` of the
26
+ * corresponding kind without a registry edit (see {@link OPEN_SYSTEM_KEY_PREFIXES}).
27
+ *
28
+ * ## Relationship to the resolver input
29
+ *
30
+ * This descriptor is the *taxonomy / identity* layer. The E9 resolver
31
+ * (`resolveLLMForSystem`) still accepts the ergonomic flat {@link SystemOfUseLabel}
32
+ * for the seven role-mapped background subsystems (its locked contract); this
33
+ * file is the SSoT that label set is derived against ({@link AUX_SYSTEM_IDS}),
34
+ * and the home of the richer descriptor that profile-axis routing (tiers,
35
+ * tools, skills, cantbook nodes, spawn units) keys off.
36
+ *
37
+ * Contracts-purity: this module is **types + `as const` DATA + type guards**
38
+ * only — no runtime logic (Gate 10 · T11418). The runtime encode/decode for the
39
+ * open-axis string keys (`parseSystemKey` / `formatSystemKey`) is intentionally
40
+ * NOT defined here; it lives in `@cleocode/core` so this package stays type-only
41
+ * (this module exposes only the {@link OPEN_SYSTEM_KEY_PREFIXES} DATA those
42
+ * helpers read).
43
+ *
44
+ * @module llm/system-of-use
45
+ * @task T11747
46
+ * @epic T11745
47
+ */
48
+ // ---------------------------------------------------------------------------
49
+ // Closed-axis value SSoTs (the type↔value mirrors)
50
+ // ---------------------------------------------------------------------------
51
+ /**
52
+ * Value-level SSoT for the seven {@link RoleName}s.
53
+ *
54
+ * The `RoleName` *type* lives in `config.ts`; this `as const` tuple is the
55
+ * single iterable VALUE mirror used to build the registry (and any other
56
+ * `for (const role of ROLE_SYSTEM_IDS)` loop) so the role axis is enumerated
57
+ * from ONE place. A compile-time `satisfies readonly RoleName[]` keeps it
58
+ * locked to the type — adding a role to `RoleName` without extending this tuple
59
+ * is a type error.
60
+ *
61
+ * @task T11747
62
+ */
63
+ export const ROLE_SYSTEM_IDS = [
64
+ 'extraction',
65
+ 'consolidation',
66
+ 'derivation',
67
+ 'hygiene',
68
+ 'judgement',
69
+ 'plugin',
70
+ 'compression',
71
+ ];
72
+ /**
73
+ * Value-level SSoT for the user-facing, *enumerable* background {@link RoleName}s
74
+ * — the set `cleo llm whoami` reports and `cleo llm profile` accepts.
75
+ *
76
+ * This is the proper subset of {@link ROLE_SYSTEM_IDS} that excludes the two
77
+ * internal sandbox/utility roles (`plugin`, `compression`): they are resolved
78
+ * by code paths (plugin-scoped single-turn calls, context compression) rather
79
+ * than configured per-call by users, so they are intentionally NOT enumerated
80
+ * by the `whoami` / `profile` CLI surface.
81
+ *
82
+ * Sourcing the `cli-ops.ts` role list from THIS one tuple (instead of a
83
+ * duplicated inline array) is the AC3 "ALL_ROLES from one SSoT" requirement
84
+ * (T11750): the type-checker's `satisfies readonly RoleName[]` keeps every id
85
+ * locked to {@link RoleName}, so the enumerable set can never silently drift
86
+ * from the config vocabulary.
87
+ *
88
+ * @task T11750
89
+ * @epic T11745
90
+ */
91
+ export const WHOAMI_ROLE_IDS = [
92
+ 'extraction',
93
+ 'consolidation',
94
+ 'derivation',
95
+ 'hygiene',
96
+ 'judgement',
97
+ ];
98
+ /**
99
+ * Value-level SSoT for the four orchestration capability tiers. Mirrors the
100
+ * {@link ProviderTier} type, most→least capable.
101
+ *
102
+ * @task T11747
103
+ */
104
+ export const ORCHESTRATION_TIER_IDS = [
105
+ 'frontier',
106
+ 'standard',
107
+ 'fast',
108
+ 'local',
109
+ ];
110
+ /**
111
+ * Value-level SSoT for the auxiliary subsystem ids (the hermes `_AUX_TASKS`
112
+ * key set). These are the stable, code-referenced background subsystems CLEO
113
+ * resolves an LLM for outside the role/tier/tool axes.
114
+ *
115
+ * The seven role-mapped resolver labels in {@link SystemOfUseLabel} are derived
116
+ * from this set plus `default` — keeping the flat resolver vocabulary and the
117
+ * structured taxonomy in lock-step.
118
+ *
119
+ * @task T11747
120
+ */
121
+ export const AUX_SYSTEM_IDS = [
122
+ /** Dream-cycle / consolidation subsystem (BRAIN sentient layer). */
123
+ 'sentient',
124
+ /** BRAIN memory extraction subsystem. */
125
+ 'memory',
126
+ /** Task-executor judgement subsystem. */
127
+ 'task-executor',
128
+ /** BRAIN deriver subsystem. */
129
+ 'deriver',
130
+ /** Hygiene-scan subsystem. */
131
+ 'hygiene',
132
+ /** Plugin-scoped single-turn calls. */
133
+ 'plugin',
134
+ /** Context-compression / summarization subsystem. */
135
+ 'compression',
136
+ /** Decision conflict-validator (ADR write-gate). */
137
+ 'decision-validator',
138
+ /** Title / summary generation (cheap aux tier). */
139
+ 'title-generation',
140
+ /** Embedding generation for vector retrieval. */
141
+ 'embedding',
142
+ ];
143
+ // ---------------------------------------------------------------------------
144
+ // Open-axis runtime key prefixes
145
+ // ---------------------------------------------------------------------------
146
+ /**
147
+ * The four OPEN {@link SystemOfUseKind}s and the string-key prefix each is
148
+ * encoded with for transport across string-only boundaries (config keys, CLI
149
+ * args, audit logs). E.g. `{ kind: 'tool', id: 'web-search' }` ↔ `'tool:web-search'`.
150
+ *
151
+ * Declared as DATA so encode/decode never branches on a hardcoded prefix —
152
+ * `@cleocode/core` reads this map (Gate 10 keeps the runtime split out).
153
+ *
154
+ * @task T11747
155
+ */
156
+ export const OPEN_SYSTEM_KEY_PREFIXES = {
157
+ tool: 'tool:',
158
+ skill: 'skill:',
159
+ 'cantbook-node': 'cantbook:',
160
+ 'spawn-unit': 'spawn-unit:',
161
+ };
162
+ // ---------------------------------------------------------------------------
163
+ // BUILTIN_SYSTEMS_OF_USE registry
164
+ // ---------------------------------------------------------------------------
165
+ /**
166
+ * Static registry of every well-known (closed-axis) {@link SystemOfUse}: the
167
+ * four orchestration tiers, the seven {@link RoleName}s, and the ~10 auxiliary
168
+ * subsystems — the hermes `_AUX_TASKS` analog as a single typed table.
169
+ *
170
+ * Open-axis systems (`tool:`/`skill:`/`cantbook:`/`spawn-unit:`) are NOT listed
171
+ * here — they are valid without a registry edit (see {@link OPEN_SYSTEM_KEY_PREFIXES}).
172
+ *
173
+ * Built by spreading the three closed-axis value SSoTs so the registry can
174
+ * never drift from {@link ROLE_SYSTEM_IDS} / {@link ORCHESTRATION_TIER_IDS} /
175
+ * {@link AUX_SYSTEM_IDS}.
176
+ *
177
+ * @task T11747
178
+ * @epic T11745
179
+ */
180
+ export const BUILTIN_SYSTEMS_OF_USE = [
181
+ ...ORCHESTRATION_TIER_IDS.map((id) => ({ kind: 'orchestration', id })),
182
+ ...ROLE_SYSTEM_IDS.map((id) => ({ kind: 'role', id })),
183
+ ...AUX_SYSTEM_IDS.map((id) => ({ kind: 'aux', id })),
184
+ ];
185
+ // ---------------------------------------------------------------------------
186
+ // Type guards (contracts-pure — Gate 10 allows `v is T` guards)
187
+ // ---------------------------------------------------------------------------
188
+ /**
189
+ * Type guard: is `value` a {@link SystemOfUse} descriptor (a `{ kind, id }`
190
+ * object whose `kind` is a known {@link SystemOfUseKind})?
191
+ *
192
+ * Structural-only — does NOT assert that closed-axis ids are registered (use
193
+ * {@link isBuiltinSystemOfUse} for that); an open-axis or as-yet-unregistered
194
+ * id still passes.
195
+ *
196
+ * @param value - The candidate value.
197
+ * @returns `true` when `value` is shaped like a {@link SystemOfUse}.
198
+ * @task T11747
199
+ */
200
+ export function isSystemOfUse(value) {
201
+ if (typeof value !== 'object' || value === null)
202
+ return false;
203
+ const v = value;
204
+ if (typeof v.id !== 'string')
205
+ return false;
206
+ return (v.kind === 'role' ||
207
+ v.kind === 'orchestration' ||
208
+ v.kind === 'aux' ||
209
+ v.kind === 'tool' ||
210
+ v.kind === 'skill' ||
211
+ v.kind === 'cantbook-node' ||
212
+ v.kind === 'spawn-unit');
213
+ }
214
+ /**
215
+ * Type guard: is `value` a closed-axis {@link SystemOfUse} present in
216
+ * {@link BUILTIN_SYSTEMS_OF_USE} (an exact `kind`+`id` match)?
217
+ *
218
+ * @param value - The candidate value.
219
+ * @returns `true` when `value` is a registered builtin system-of-use.
220
+ * @task T11747
221
+ */
222
+ export function isBuiltinSystemOfUse(value) {
223
+ if (!isSystemOfUse(value))
224
+ return false;
225
+ return BUILTIN_SYSTEMS_OF_USE.some((s) => s.kind === value.kind && s.id === value.id);
226
+ }
227
+ /**
228
+ * Type guard: is `kind` an OPEN-axis {@link OpenSystemKind} (one whose ids are
229
+ * encoded with an {@link OPEN_SYSTEM_KEY_PREFIXES} prefix)?
230
+ *
231
+ * @param kind - The kind discriminant to test.
232
+ * @returns `true` for `tool` / `skill` / `cantbook-node` / `spawn-unit`.
233
+ * @task T11747
234
+ */
235
+ export function isOpenSystemKind(kind) {
236
+ return kind === 'tool' || kind === 'skill' || kind === 'cantbook-node' || kind === 'spawn-unit';
237
+ }
238
+ //# sourceMappingURL=system-of-use.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"system-of-use.js","sourceRoot":"","sources":["../../src/llm/system-of-use.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AAmJH,8EAA8E;AAC9E,mDAAmD;AACnD,8EAA8E;AAE9E;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,YAAY;IACZ,eAAe;IACf,YAAY;IACZ,SAAS;IACT,WAAW;IACX,QAAQ;IACR,aAAa;CACyB,CAAC;AAEzC;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,YAAY;IACZ,eAAe;IACf,YAAY;IACZ,SAAS;IACT,WAAW;CAC2B,CAAC;AAUzC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,UAAU;IACV,UAAU;IACV,MAAM;IACN,OAAO;CACmC,CAAC;AAE7C;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,o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OAAO,CAAC,CAAC,EAAE,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC3C,OAAO,CACL,CAAC,CAAC,IAAI,KAAK,MAAM;QACjB,CAAC,CAAC,IAAI,KAAK,eAAe;QAC1B,CAAC,CAAC,IAAI,KAAK,KAAK;QAChB,CAAC,CAAC,IAAI,KAAK,MAAM;QACjB,CAAC,CAAC,IAAI,KAAK,OAAO;QAClB,CAAC,CAAC,IAAI,KAAK,eAAe;QAC1B,CAAC,CAAC,IAAI,KAAK,YAAY,CACxB,CAAC;AACJ,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,oBAAoB,CAAC,KAAc;IACjD,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IACxC,OAAO,sBAAsB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,KAAK,KAAK,CAAC,EAAE,CAAC,CAAC;AACxF,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAqB;IACpD,OAAO,IAAI,KAAK,MAAM,IAAI,IAAI,KAAK,OAAO,IAAI,IAAI,KAAK,eAAe,IAAI,IAAI,KAAK,YAAY,CAAC;AAClG,CAAC"}
@@ -1,11 +1,18 @@
1
1
  /**
2
- * SystemOfUse contract types for the `resolveLLMForSystem` chokepoint (E9).
2
+ * `SystemOfUseLabel` contract types for the `resolveLLMForSystem` chokepoint (E9).
3
3
  *
4
- * A "system of use" is the semantic label for the subsystem that is requesting
5
- * an LLM client — e.g. `'sentient'`, `'memory'`, `'task-executor'`. It is
6
- * a higher-level, stable identity that CLEO maps to a {@link RoleName} for
7
- * config resolution. This indirection insulates call-sites from the config
8
- * vocabulary (roles) and from model/provider churn.
4
+ * A "system of use label" is the flat, ergonomic vocabulary the E9 resolver
5
+ * accepts for the seven role-mapped background subsystems — e.g. `'sentient'`,
6
+ * `'memory'`, `'task-executor'`. It is a higher-level, stable identity that
7
+ * CLEO maps to a {@link RoleName} for config resolution. This indirection
8
+ * insulates call-sites from the config vocabulary (roles) and from
9
+ * model/provider churn.
10
+ *
11
+ * The richer, structured `{ kind, id }` taxonomy that covers the OTHER routing
12
+ * axes (orchestration tiers, tools, skills, cantbook nodes, spawn units) lives
13
+ * in {@link import('./system-of-use.js').SystemOfUse} (T11747). This label set
14
+ * is the flat resolver-input subset; both are kept in lock-step (the label set
15
+ * mirrors the `aux` axis plus `default`).
9
16
  *
10
17
  * `resolveLLMForSystem` is the single DRY chokepoint that the 4-resolver /
11
18
  * 3-picker sprawl will collapse onto (E9 · T11745).
@@ -15,14 +22,20 @@
15
22
  * @epic T11745
16
23
  */
17
24
  import type { RoleName } from '../config.js';
25
+ import type { RoleSystem } from './system-of-use.js';
18
26
  /**
19
- * Semantic label for a CLEO subsystem that requests an LLM client.
27
+ * Flat, ergonomic label for a CLEO background subsystem that requests an LLM
28
+ * client through the E9 resolver.
20
29
  *
21
- * Each `SystemOfUse` value maps to a canonical {@link RoleName} used by
30
+ * Each `SystemOfUseLabel` value maps to a canonical {@link RoleName} used by
22
31
  * `resolveLLMForSystem` for config and credential resolution. Subsystems
23
32
  * MUST declare their identity so the resolver can apply the correct
24
33
  * per-system overrides and audit trails.
25
34
  *
35
+ * For the full structured taxonomy (tools/skills/cantbook nodes/spawn units/
36
+ * orchestration tiers), see the discriminated
37
+ * {@link import('./system-of-use.js').SystemOfUse} descriptor (T11747).
38
+ *
26
39
  * ### Role mapping (static default; overridable via config `systemRoles`)
27
40
  *
28
41
  * | System | Default role |
@@ -38,15 +51,36 @@ import type { RoleName } from '../config.js';
38
51
  *
39
52
  * @task T11749
40
53
  */
41
- export type SystemOfUse = 'sentient' | 'memory' | 'task-executor' | 'deriver' | 'hygiene' | 'plugin' | 'compression' | 'default';
54
+ export type SystemOfUseLabel = 'sentient' | 'memory' | 'task-executor' | 'deriver' | 'hygiene' | 'plugin' | 'compression' | 'default';
42
55
  /**
43
- * Static mapping from {@link SystemOfUse} to the {@link RoleName} used for
56
+ * Static mapping from {@link SystemOfUseLabel} to the {@link RoleName} used for
44
57
  * config resolution. This is the canonical default; callers may override
45
58
  * individual systems via `config.llm.systemRoles[system]`.
46
59
  *
47
60
  * @task T11749
48
61
  */
49
- export declare const SYSTEM_ROLE_MAP: Readonly<Record<SystemOfUse, RoleName | null>>;
62
+ export declare const SYSTEM_ROLE_MAP: Readonly<Record<SystemOfUseLabel, RoleName | null>>;
63
+ /**
64
+ * Input accepted by `resolveLLMForSystem()`.
65
+ *
66
+ * The chokepoint accepts EITHER:
67
+ *
68
+ * - the flat, ergonomic {@link SystemOfUseLabel} for the role-mapped background
69
+ * subsystems (`'sentient'`, `'memory'`, … — the original locked vocabulary), OR
70
+ * - a structured {@link RoleSystem} descriptor (`{ kind: 'role', id: RoleName }`)
71
+ * for a *direct* role resolution.
72
+ *
73
+ * The descriptor form makes the E9 equivalence
74
+ * `resolveLLMForRole(role) ≡ resolveLLMForSystem({ kind: 'role', id: role })`
75
+ * (T11750 · AC1) directly expressible at the chokepoint, so role callers can
76
+ * collapse onto the same single resolution path with ZERO duplicate resolution
77
+ * logic. Both forms funnel through the SAME `resolveLLMForRole` core inside
78
+ * `@cleocode/core`.
79
+ *
80
+ * @task T11750
81
+ * @epic T11745
82
+ */
83
+ export type SystemResolverInput = SystemOfUseLabel | RoleSystem;
50
84
  /**
51
85
  * Options accepted by `resolveLLMForSystem()`.
52
86
  *
@@ -1 +1 @@
1
- {"version":3,"file":"system-resolver.d.ts","sourceRoot":"","sources":["../../src/llm/system-resolver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAE7C;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,MAAM,WAAW,GACnB,UAAU,GACV,QAAQ,GACR,eAAe,GACf,SAAS,GACT,SAA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
2
- * SystemOfUse contract types for the `resolveLLMForSystem` chokepoint (E9).
2
+ * `SystemOfUseLabel` contract types for the `resolveLLMForSystem` chokepoint (E9).
3
3
  *
4
- * A "system of use" is the semantic label for the subsystem that is requesting
5
- * an LLM client — e.g. `'sentient'`, `'memory'`, `'task-executor'`. It is
6
- * a higher-level, stable identity that CLEO maps to a {@link RoleName} for
7
- * config resolution. This indirection insulates call-sites from the config
8
- * vocabulary (roles) and from model/provider churn.
4
+ * A "system of use label" is the flat, ergonomic vocabulary the E9 resolver
5
+ * accepts for the seven role-mapped background subsystems — e.g. `'sentient'`,
6
+ * `'memory'`, `'task-executor'`. It is a higher-level, stable identity that
7
+ * CLEO maps to a {@link RoleName} for config resolution. This indirection
8
+ * insulates call-sites from the config vocabulary (roles) and from
9
+ * model/provider churn.
10
+ *
11
+ * The richer, structured `{ kind, id }` taxonomy that covers the OTHER routing
12
+ * axes (orchestration tiers, tools, skills, cantbook nodes, spawn units) lives
13
+ * in {@link import('./system-of-use.js').SystemOfUse} (T11747). This label set
14
+ * is the flat resolver-input subset; both are kept in lock-step (the label set
15
+ * mirrors the `aux` axis plus `default`).
9
16
  *
10
17
  * `resolveLLMForSystem` is the single DRY chokepoint that the 4-resolver /
11
18
  * 3-picker sprawl will collapse onto (E9 · T11745).
@@ -15,7 +22,7 @@
15
22
  * @epic T11745
16
23
  */
17
24
  /**
18
- * Static mapping from {@link SystemOfUse} to the {@link RoleName} used for
25
+ * Static mapping from {@link SystemOfUseLabel} to the {@link RoleName} used for
19
26
  * config resolution. This is the canonical default; callers may override
20
27
  * individual systems via `config.llm.systemRoles[system]`.
21
28
  *
@@ -1 +1 @@
1
- {"version":3,"file":"system-resolver.js","sourceRoot":"","sources":["../../src/llm/system-resolver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAqCH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,eAAe,GAAmD;IAC7E,QAAQ,EAAE,eAAe;IACzB,MAAM,EAAE,YAAY;IACpB,eAAe,EAAE,WAAW;IAC5B,OAAO,EAAE,YAAY;IACrB,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;IAChB,WAAW,EAAE,aAAa;IAC1B,qEAAqE;IACrE,OAAO,EAAE,IAAI;CACL,CAAC"}
1
+ {"version":3,"file":"system-resolver.js","sourceRoot":"","sources":["../../src/llm/system-resolver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AA2CH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,eAAe,GAAwD;IAClF,QAAQ,EAAE,eAAe;IACzB,MAAM,EAAE,YAAY;IACpB,eAAe,EAAE,WAAW;IAC5B,OAAO,EAAE,YAAY;IACrB,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;IAChB,WAAW,EAAE,aAAa;IAC1B,qEAAqE;IACrE,OAAO,EAAE,IAAI;CACL,CAAC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Tests for the ensures-schema Zod registry (T11762 ST-1 · T11900).
3
+ *
4
+ * Behavior-parity guard: every input the deleted bespoke validators
5
+ * (`validateDecompositionTaskTree` / `validateIvtrEvidenceOutput`,
6
+ * `packages/playbooks/src/runtime.ts:794-902`) REJECTED must still be rejected
7
+ * here, with the FIRST Zod issue message equal to the SUFFIX of the original
8
+ * violation string (the part after the `ensures.schema[<name>] on <nodeId>: `
9
+ * prefix that ST-2's runtime wrapper re-applies). Every input they ACCEPTED must
10
+ * still parse. The ACs call out: empty array, missing title, empty acceptance,
11
+ * `{}` evidence, numeric evidence.
12
+ *
13
+ * @task T11900
14
+ * @epic T11762
15
+ */
16
+ export {};
17
+ //# sourceMappingURL=ensures-schema-registry.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ensures-schema-registry.test.d.ts","sourceRoot":"","sources":["../../../src/operations/__tests__/ensures-schema-registry.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG"}
@@ -0,0 +1,113 @@
1
+ /**
2
+ * Tests for the ensures-schema Zod registry (T11762 ST-1 · T11900).
3
+ *
4
+ * Behavior-parity guard: every input the deleted bespoke validators
5
+ * (`validateDecompositionTaskTree` / `validateIvtrEvidenceOutput`,
6
+ * `packages/playbooks/src/runtime.ts:794-902`) REJECTED must still be rejected
7
+ * here, with the FIRST Zod issue message equal to the SUFFIX of the original
8
+ * violation string (the part after the `ensures.schema[<name>] on <nodeId>: `
9
+ * prefix that ST-2's runtime wrapper re-applies). Every input they ACCEPTED must
10
+ * still parse. The ACs call out: empty array, missing title, empty acceptance,
11
+ * `{}` evidence, numeric evidence.
12
+ *
13
+ * @task T11900
14
+ * @epic T11762
15
+ */
16
+ import { describe, expect, it } from 'vitest';
17
+ import { ENSURES_SCHEMA_REGISTRY, evidenceSchema, LEGACY_PASSTHROUGH_SCHEMA_NAMES, passthroughSchema, taskTreeSchema, } from '../ensures-schema-registry.js';
18
+ /** First Zod issue message for a failing parse (or `undefined` if it parsed). */
19
+ function firstIssueMessage(schema, value) {
20
+ const result = schema.safeParse(value);
21
+ return result.success ? undefined : result.error.issues[0]?.message;
22
+ }
23
+ describe('ensures-schema-registry — registry DATA', () => {
24
+ it('registers the two strict schemas plus every legacy passthrough name', () => {
25
+ // T11762 ST-2 (R1): the two strict ports (`task_tree`, `evidence`) PLUS the
26
+ // legacy starter `.cantbook` schema names — registered with passthrough so
27
+ // the fail-closed flip does not regress the shipped playbooks.
28
+ expect([...ENSURES_SCHEMA_REGISTRY.keys()].sort()).toEqual(['task_tree', 'evidence', ...LEGACY_PASSTHROUGH_SCHEMA_NAMES].sort());
29
+ });
30
+ it('each strict spec carries name, contextKey (= name by default), and a schema', () => {
31
+ for (const name of ['task_tree', 'evidence']) {
32
+ const spec = ENSURES_SCHEMA_REGISTRY.get(name);
33
+ expect(spec).toBeDefined();
34
+ expect(spec.name).toBe(name);
35
+ expect(spec.contextKey).toBe(name);
36
+ expect(typeof spec.schema.safeParse).toBe('function');
37
+ }
38
+ });
39
+ it('every legacy passthrough name is registered with the passthrough schema', () => {
40
+ // R1: passthrough accepts ANY value (including `undefined`) so the historical
41
+ // "silently skipped" behavior is preserved EXACTLY.
42
+ for (const name of LEGACY_PASSTHROUGH_SCHEMA_NAMES) {
43
+ const spec = ENSURES_SCHEMA_REGISTRY.get(name);
44
+ expect(spec).toBeDefined();
45
+ expect(spec.name).toBe(name);
46
+ expect(spec.schema).toBe(passthroughSchema);
47
+ expect(spec.schema.safeParse(undefined).success).toBe(true);
48
+ expect(spec.schema.safeParse({ anything: 1 }).success).toBe(true);
49
+ expect(spec.schema.safeParse(42).success).toBe(true);
50
+ }
51
+ });
52
+ });
53
+ describe('ensures-schema-registry — task_tree (ports validateDecompositionTaskTree)', () => {
54
+ it('accepts a minimal valid task tree', () => {
55
+ expect(taskTreeSchema.safeParse([{ title: 'Build X', acceptance: ['does X'] }]).success).toBe(true);
56
+ });
57
+ it('accepts a tree with optional id/parentId/depends populated', () => {
58
+ expect(taskTreeSchema.safeParse([
59
+ { title: 'Root', acceptance: ['ac1'], id: 'T1' },
60
+ { title: 'Child', acceptance: ['ac2', 'ac3'], id: 'T2', parentId: 'T1', depends: ['T1'] },
61
+ ]).success).toBe(true);
62
+ });
63
+ it('rejects a non-array (parity: "task_tree must be a non-empty array")', () => {
64
+ expect(firstIssueMessage(taskTreeSchema, 'not-an-array')).toBe('task_tree must be a non-empty array');
65
+ });
66
+ it('rejects an EMPTY ARRAY (parity: empty-array message)', () => {
67
+ expect(firstIssueMessage(taskTreeSchema, [])).toBe('task_tree is an empty array — decomposition produced no tasks');
68
+ });
69
+ it('rejects a MISSING TITLE (parity: "title must be a non-empty string")', () => {
70
+ expect(firstIssueMessage(taskTreeSchema, [{ acceptance: ['ac1'] }])).toBe('title must be a non-empty string');
71
+ });
72
+ it('rejects a whitespace-only title (parity: same non-empty-title message)', () => {
73
+ expect(firstIssueMessage(taskTreeSchema, [{ title: ' ', acceptance: ['ac1'] }])).toBe('title must be a non-empty string');
74
+ });
75
+ it('rejects an EMPTY ACCEPTANCE array (parity: non-empty-acceptance message)', () => {
76
+ expect(firstIssueMessage(taskTreeSchema, [{ title: 'X', acceptance: [] }])).toBe('must have a non-empty acceptance array');
77
+ });
78
+ it('rejects an acceptance array with no non-empty strings (parity message)', () => {
79
+ expect(firstIssueMessage(taskTreeSchema, [{ title: 'X', acceptance: [' ', ''] }])).toBe('acceptance array contains no non-empty strings');
80
+ });
81
+ });
82
+ describe('ensures-schema-registry — evidence (ports validateIvtrEvidenceOutput)', () => {
83
+ it('accepts a non-empty string', () => {
84
+ expect(evidenceSchema.safeParse('commit:abc123').success).toBe(true);
85
+ });
86
+ it('accepts a non-empty array', () => {
87
+ expect(evidenceSchema.safeParse(['atom']).success).toBe(true);
88
+ });
89
+ it('accepts an object with at least one key', () => {
90
+ expect(evidenceSchema.safeParse({ commit: 'abc' }).success).toBe(true);
91
+ });
92
+ it('rejects null/undefined (parity: must-be-present message)', () => {
93
+ expect(firstIssueMessage(evidenceSchema, null)).toBe('evidence must be present (non-null, non-undefined)');
94
+ expect(firstIssueMessage(evidenceSchema, undefined)).toBe('evidence must be present (non-null, non-undefined)');
95
+ });
96
+ it('rejects an empty / whitespace-only string (parity message)', () => {
97
+ expect(firstIssueMessage(evidenceSchema, '')).toBe('evidence string must not be empty');
98
+ expect(firstIssueMessage(evidenceSchema, ' ')).toBe('evidence string must not be empty');
99
+ });
100
+ it('rejects an empty array (parity message)', () => {
101
+ expect(firstIssueMessage(evidenceSchema, [])).toBe('evidence array must not be empty');
102
+ });
103
+ it('rejects an EMPTY OBJECT {} (parity: at-least-one-key message)', () => {
104
+ expect(firstIssueMessage(evidenceSchema, {})).toBe('evidence object must have at least one key (got {})');
105
+ });
106
+ it('rejects NUMERIC evidence (parity: wrong-type message with typeof)', () => {
107
+ expect(firstIssueMessage(evidenceSchema, 42)).toBe('evidence must be a string, array, or object (got number)');
108
+ });
109
+ it('rejects boolean evidence (parity: wrong-type message with typeof)', () => {
110
+ expect(firstIssueMessage(evidenceSchema, true)).toBe('evidence must be a string, array, or object (got boolean)');
111
+ });
112
+ });
113
+ //# sourceMappingURL=ensures-schema-registry.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ensures-schema-registry.test.js","sourceRoot":"","sources":["../../../src/operations/__tests__/ensures-schema-registry.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EACL,uBAAuB,EAEvB,cAAc,EACd,+BAA+B,EAC/B,iBAAiB,EACjB,cAAc,GACf,MAAM,+BAA+B,CAAC;AAEvC,iFAAiF;AACjF,SAAS,iBAAiB,CAAC,MAA6B,EAAE,KAAc;IACtE,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IACvC,OAAO,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC;AACtE,CAAC;AAED,QAAQ,CAAC,yCAAyC,EAAE,GAAG,EAAE;IACvD,EAAE,CAAC,qEAAqE,EAAE,GAAG,EAAE;QAC7E,4EAA4E;QAC5E,2EAA2E;QAC3E,+DAA+D;QAC/D,MAAM,CAAC,CAAC,GAAG,uBAAuB,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,OAAO,CACxD,CAAC,WAAW,EAAE,UAAU,EAAE,GAAG,+BAA+B,CAAC,CAAC,IAAI,EAAE,CACrE,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,6EAA6E,EAAE,GAAG,EAAE;QACrF,KAAK,MAAM,IAAI,IAAI,CAAC,WAAW,EAAE,UAAU,CAAU,EAAE,CAAC;YACtD,MAAM,IAAI,GAAG,uBAAuB,CAAC,GAAG,CAAC,IAAI,CAAsB,CAAC;YACp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