@cleocode/contracts 2026.5.121 → 2026.5.123

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 (128) hide show
  1. package/dist/__tests__/completion-operation-contracts.test.d.ts +8 -0
  2. package/dist/__tests__/completion-operation-contracts.test.d.ts.map +1 -0
  3. package/dist/__tests__/completion-operation-contracts.test.js +114 -0
  4. package/dist/__tests__/completion-operation-contracts.test.js.map +1 -0
  5. package/dist/__tests__/operation-envelope-validation.test.d.ts +8 -0
  6. package/dist/__tests__/operation-envelope-validation.test.d.ts.map +1 -0
  7. package/dist/__tests__/operation-envelope-validation.test.js +105 -0
  8. package/dist/__tests__/operation-envelope-validation.test.js.map +1 -0
  9. package/dist/__tests__/satisfies-atom.test.d.ts +24 -0
  10. package/dist/__tests__/satisfies-atom.test.d.ts.map +1 -0
  11. package/dist/__tests__/satisfies-atom.test.js +320 -0
  12. package/dist/__tests__/satisfies-atom.test.js.map +1 -0
  13. package/dist/__tests__/validator-types.test.d.ts +13 -0
  14. package/dist/__tests__/validator-types.test.d.ts.map +1 -0
  15. package/dist/__tests__/validator-types.test.js +293 -0
  16. package/dist/__tests__/validator-types.test.js.map +1 -0
  17. package/dist/__tests__/workgraph-context-scaffold-contracts.test.d.ts +8 -0
  18. package/dist/__tests__/workgraph-context-scaffold-contracts.test.d.ts.map +1 -0
  19. package/dist/__tests__/workgraph-context-scaffold-contracts.test.js +188 -0
  20. package/dist/__tests__/workgraph-context-scaffold-contracts.test.js.map +1 -0
  21. package/dist/__tests__/workgraph-operation-contracts.test.d.ts +8 -0
  22. package/dist/__tests__/workgraph-operation-contracts.test.d.ts.map +1 -0
  23. package/dist/__tests__/workgraph-operation-contracts.test.js +115 -0
  24. package/dist/__tests__/workgraph-operation-contracts.test.js.map +1 -0
  25. package/dist/config.d.ts +56 -0
  26. package/dist/config.d.ts.map +1 -1
  27. package/dist/data-accessor.d.ts +194 -0
  28. package/dist/data-accessor.d.ts.map +1 -1
  29. package/dist/data-accessor.js.map +1 -1
  30. package/dist/dispatch/__tests__/docs-update-registry.test.d.ts +2 -0
  31. package/dist/dispatch/__tests__/docs-update-registry.test.d.ts.map +1 -0
  32. package/dist/dispatch/__tests__/docs-update-registry.test.js +27 -0
  33. package/dist/dispatch/__tests__/docs-update-registry.test.js.map +1 -0
  34. package/dist/dispatch/__tests__/operation-envelope-snapshots.test.d.ts +2 -0
  35. package/dist/dispatch/__tests__/operation-envelope-snapshots.test.d.ts.map +1 -0
  36. package/dist/dispatch/__tests__/operation-envelope-snapshots.test.js +265 -0
  37. package/dist/dispatch/__tests__/operation-envelope-snapshots.test.js.map +1 -0
  38. package/dist/dispatch/operations-registry.d.ts.map +1 -1
  39. package/dist/dispatch/operations-registry.js +487 -7
  40. package/dist/dispatch/operations-registry.js.map +1 -1
  41. package/dist/evidence-atom-schema.d.ts +91 -0
  42. package/dist/evidence-atom-schema.d.ts.map +1 -1
  43. package/dist/evidence-atom-schema.js +162 -1
  44. package/dist/evidence-atom-schema.js.map +1 -1
  45. package/dist/exit-codes.d.ts +41 -1
  46. package/dist/exit-codes.d.ts.map +1 -1
  47. package/dist/exit-codes.js +40 -0
  48. package/dist/exit-codes.js.map +1 -1
  49. package/dist/index.d.ts +17 -9
  50. package/dist/index.d.ts.map +1 -1
  51. package/dist/index.js +12 -1
  52. package/dist/index.js.map +1 -1
  53. package/dist/operation-envelope-validation.d.ts +79 -0
  54. package/dist/operation-envelope-validation.d.ts.map +1 -0
  55. package/dist/operation-envelope-validation.js +219 -0
  56. package/dist/operation-envelope-validation.js.map +1 -0
  57. package/dist/operations/__tests__/agent-operation-contract.test.d.ts +2 -0
  58. package/dist/operations/__tests__/agent-operation-contract.test.d.ts.map +1 -0
  59. package/dist/operations/__tests__/agent-operation-contract.test.js +128 -0
  60. package/dist/operations/__tests__/agent-operation-contract.test.js.map +1 -0
  61. package/dist/operations/__tests__/tasks-input-contracts.test.js +15 -0
  62. package/dist/operations/__tests__/tasks-input-contracts.test.js.map +1 -1
  63. package/dist/operations/agent-operation-contract.d.ts +227 -0
  64. package/dist/operations/agent-operation-contract.d.ts.map +1 -0
  65. package/dist/operations/agent-operation-contract.js +38 -0
  66. package/dist/operations/agent-operation-contract.js.map +1 -0
  67. package/dist/operations/docs.d.ts +19 -1
  68. package/dist/operations/docs.d.ts.map +1 -1
  69. package/dist/operations/docs.js +20 -0
  70. package/dist/operations/docs.js.map +1 -1
  71. package/dist/operations/focus.d.ts +1 -1
  72. package/dist/operations/index.d.ts +1 -0
  73. package/dist/operations/index.d.ts.map +1 -1
  74. package/dist/operations/index.js +1 -0
  75. package/dist/operations/index.js.map +1 -1
  76. package/dist/operations/orchestrate.d.ts +66 -0
  77. package/dist/operations/orchestrate.d.ts.map +1 -1
  78. package/dist/operations/tasks.d.ts +617 -11
  79. package/dist/operations/tasks.d.ts.map +1 -1
  80. package/dist/operations/tasks.js +22 -3
  81. package/dist/operations/tasks.js.map +1 -1
  82. package/dist/task-record.d.ts +15 -0
  83. package/dist/task-record.d.ts.map +1 -1
  84. package/dist/task.d.ts +52 -5
  85. package/dist/task.d.ts.map +1 -1
  86. package/dist/task.js.map +1 -1
  87. package/dist/tasks.d.ts +944 -0
  88. package/dist/tasks.d.ts.map +1 -1
  89. package/dist/tasks.js +198 -1
  90. package/dist/tasks.js.map +1 -1
  91. package/dist/validator/index.d.ts +375 -0
  92. package/dist/validator/index.d.ts.map +1 -0
  93. package/dist/validator/index.js +162 -0
  94. package/dist/validator/index.js.map +1 -0
  95. package/dist/workgraph.d.ts +1950 -0
  96. package/dist/workgraph.d.ts.map +1 -0
  97. package/dist/workgraph.js +449 -0
  98. package/dist/workgraph.js.map +1 -0
  99. package/package.json +10 -2
  100. package/src/__tests__/__snapshots__/operations-registry.test.ts.snap +1 -1
  101. package/src/__tests__/completion-operation-contracts.test.ts +154 -0
  102. package/src/__tests__/operation-envelope-validation.test.ts +140 -0
  103. package/src/__tests__/satisfies-atom.test.ts +383 -0
  104. package/src/__tests__/validator-types.test.ts +359 -0
  105. package/src/__tests__/workgraph-context-scaffold-contracts.test.ts +232 -0
  106. package/src/__tests__/workgraph-operation-contracts.test.ts +151 -0
  107. package/src/config.ts +58 -0
  108. package/src/data-accessor.ts +213 -0
  109. package/src/dispatch/__tests__/docs-update-registry.test.ts +35 -0
  110. package/src/dispatch/__tests__/operation-envelope-snapshots.test.ts +283 -0
  111. package/src/dispatch/operations-registry.ts +502 -7
  112. package/src/evidence-atom-schema.ts +188 -1
  113. package/src/exit-codes.ts +42 -0
  114. package/src/index.ts +230 -2
  115. package/src/operation-envelope-validation.ts +319 -0
  116. package/src/operations/__tests__/agent-operation-contract.test.ts +161 -0
  117. package/src/operations/__tests__/tasks-input-contracts.test.ts +30 -0
  118. package/src/operations/agent-operation-contract.ts +253 -0
  119. package/src/operations/docs.ts +27 -7
  120. package/src/operations/focus.ts +1 -1
  121. package/src/operations/index.ts +1 -0
  122. package/src/operations/orchestrate.ts +71 -0
  123. package/src/operations/tasks.ts +662 -15
  124. package/src/task-record.ts +16 -0
  125. package/src/task.ts +54 -5
  126. package/src/tasks.ts +558 -0
  127. package/src/validator/index.ts +385 -0
  128. package/src/workgraph.ts +1153 -0
@@ -195,6 +195,117 @@ export const callsiteCoverageAtomSchema = z.object({
195
195
  .min(1, 'callsite-coverage atom requires a non-empty relativeSourcePath'),
196
196
  });
197
197
 
198
+ // ---------------------------------------------------------------------------
199
+ // ADR-079-r2: satisfies atom — cross-task AC binding
200
+ // ---------------------------------------------------------------------------
201
+
202
+ /**
203
+ * Strict AC UUID regex (lowercase, hyphenated 8-4-4-4-12 with v4/v5 major
204
+ * version nibble and `[89ab]` variant nibble). T10586 keeps legacy random
205
+ * UUIDv4 AC ids valid while allowing deterministic UUIDv5-shaped ids derived
206
+ * from task id + source key.
207
+ *
208
+ * Validators MUST reject mixed-case to prevent silent dedupe failures — the
209
+ * canonical column casing is lowercase per ADR-079-r1 §2.1.
210
+ *
211
+ * @task T10506
212
+ * @adr ADR-079-r2 §2.1
213
+ */
214
+ export const AC_UUID_REGEX =
215
+ /^[0-9a-f]{8}-[0-9a-f]{4}-[45][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/;
216
+
217
+ /**
218
+ * Positional-alias regex for `satisfies:` atom target-AC identifiers per
219
+ * ADR-079-r2 §2.1 ABNF (`ac-alias` production). Format: `AC<1-4 digits>`
220
+ * (capped at AC9999 — three orders of magnitude above realistic per-task AC
221
+ * counts).
222
+ *
223
+ * @task T10506
224
+ * @adr ADR-079-r2 §2.1
225
+ */
226
+ export const AC_ALIAS_REGEX = /^AC[0-9]{1,4}$/;
227
+
228
+ /**
229
+ * Task-id regex for `satisfies:` atom target-task identifiers per ADR-079-r2
230
+ * §2.1 ABNF (`task-id` production). Format: `T<1-7 digits>` (capped at
231
+ * T9999999 — three orders of magnitude above current CLEO task IDs as of
232
+ * 2026-05-24).
233
+ *
234
+ * @task T10506
235
+ * @adr ADR-079-r2 §2.1
236
+ */
237
+ export const SATISFIES_TASK_ID_REGEX = /^T[0-9]{1,7}$/;
238
+
239
+ /**
240
+ * Version-pin regex for `satisfies:` atom optional `@<ts>` suffix per
241
+ * ADR-079-r2 §2.1 ABNF (`version-pin` production). Format: `YYYYMMDDhhmmss`
242
+ * (ISO-8601-basic timestamp, 14 digits).
243
+ *
244
+ * @task T10506
245
+ * @adr ADR-079-r2 §2.1
246
+ */
247
+ export const SATISFIES_VERSION_PIN_REGEX = /^[0-9]{14}$/;
248
+
249
+ /**
250
+ * `satisfies:<task-id>#<ac-id>[@<version-pin>]` atom — cross-task AC binding
251
+ * per ADR-079-r2 §2.1 (full grammar) and ADR-079-r1 §2.4 (basic shape).
252
+ *
253
+ * Format:
254
+ *
255
+ * - `satisfies:T1234#a1b2c3d4-5e6f-4890-abcd-ef1234567890` — canonical
256
+ * UUID form (preferred for long-lived specs).
257
+ * - `satisfies:T1234#AC2` — positional
258
+ * alias form (preferred in fresh PRs where the target task's AC list
259
+ * is stable).
260
+ * - `satisfies:T1234#AC2@20260524223045` — alias +
261
+ * optional version-pin (Validator emissions where pin-on-mint is
262
+ * required by ADR-079-r2 §3.4).
263
+ *
264
+ * Exactly ONE of `targetAcId` (UUID form) or `targetAcAlias` (alias form)
265
+ * is populated per parsed atom. `versionPin` is always optional.
266
+ *
267
+ * ## Scope
268
+ *
269
+ * This Zod schema covers PARSING ONLY. The runtime validator semantics —
270
+ * the 5-check accept/reject pipeline (target exists, target not terminal,
271
+ * AC exists, same-saga scope rule) — ship in T10507 alongside the
272
+ * `evidence_satisfies_bindings` side-effect table.
273
+ *
274
+ * Per ADR-079-r2 §2.2 the maximum atom length is 120 chars; the schema does
275
+ * NOT enforce length here because the per-field regexes already cap the
276
+ * surface (`satisfies:` + 8-char T+digits + `#` + 36-char UUID + `@` +
277
+ * 14-char pin = 78 chars max — well under 120).
278
+ *
279
+ * @task T10506
280
+ * @adr ADR-079-r2 §2.1
281
+ * @adr ADR-079-r1 §2.4
282
+ */
283
+ export const satisfiesAtomSchema = z.object({
284
+ kind: z.literal('satisfies'),
285
+ /** Target task ID — `T<1-7 digits>` per ADR-079-r2 §2.1. */
286
+ targetTaskId: z
287
+ .string()
288
+ .regex(SATISFIES_TASK_ID_REGEX, 'satisfies atom targetTaskId must match /^T[0-9]{1,7}$/'),
289
+ /** Lowercase UUIDv4/v5 — populated for the canonical form; undefined for alias form. */
290
+ targetAcId: z
291
+ .string()
292
+ .regex(AC_UUID_REGEX, 'satisfies atom targetAcId must be a lowercase UUIDv4/v5')
293
+ .optional(),
294
+ /** Positional alias `AC<1-4 digits>` — populated for alias form; undefined for UUID form. */
295
+ targetAcAlias: z
296
+ .string()
297
+ .regex(AC_ALIAS_REGEX, 'satisfies atom targetAcAlias must match /^AC[0-9]{1,4}$/')
298
+ .optional(),
299
+ /** Optional `@<14-digit YYYYMMDDhhmmss>` pin captured at mint time. */
300
+ versionPin: z
301
+ .string()
302
+ .regex(
303
+ SATISFIES_VERSION_PIN_REGEX,
304
+ 'satisfies atom versionPin must be 14 digits (YYYYMMDDhhmmss)',
305
+ )
306
+ .optional(),
307
+ });
308
+
198
309
  // ---------------------------------------------------------------------------
199
310
  // Discriminated union
200
311
  // ---------------------------------------------------------------------------
@@ -218,6 +329,8 @@ export const callsiteCoverageAtomSchema = z.object({
218
329
  * - `pr` — merged-PR retroactive proof (T9764 / T9838)
219
330
  * - `loc-drop` — engine-migration LOC reduction (T1604)
220
331
  * - `callsite-coverage` — exported-symbol production callsite (T1605)
332
+ * - `satisfies` — cross-task AC binding (T10506 / ADR-079-r2;
333
+ * validator semantics ship in T10507)
221
334
  *
222
335
  * @task T10337
223
336
  * @adr ADR-051
@@ -233,6 +346,7 @@ export const EvidenceAtomSchema = z.discriminatedUnion('kind', [
233
346
  prAtomSchema,
234
347
  locDropAtomSchema,
235
348
  callsiteCoverageAtomSchema,
349
+ satisfiesAtomSchema,
236
350
  ]);
237
351
 
238
352
  /**
@@ -383,6 +497,7 @@ const ATOM_EXAMPLES: Readonly<Record<EvidenceAtomKind, string>> = Object.freeze(
383
497
  pr: 'pr:357',
384
498
  'loc-drop': 'loc-drop:<fromLines>:<toLines>',
385
499
  'callsite-coverage': 'callsite-coverage:<symbolName>:<relativeSourcePath>',
500
+ satisfies: 'satisfies:T1234#AC2',
386
501
  });
387
502
 
388
503
  /**
@@ -718,6 +833,78 @@ export function parseEvidenceString(raw: string): EvidenceAtom[] {
718
833
  atoms.push({ kind: 'callsite-coverage', symbolName, relativeSourcePath });
719
834
  break;
720
835
  }
836
+ case 'satisfies': {
837
+ // ADR-079-r2 §2.1 ABNF:
838
+ // satisfies-atom = "satisfies:" task-id "#" ac-id [ "@" version-pin ]
839
+ // Payload shape: <task-id>#<ac-id>[@<version-pin>]
840
+ //
841
+ // PARSING ONLY per T10506 — runtime validator semantics (5-check
842
+ // accept pipeline + same-saga scope rule) ship in T10507.
843
+ const hashIdx = payload.indexOf('#');
844
+ if (hashIdx < 1 || hashIdx === payload.length - 1) {
845
+ throw new EvidenceParseError(
846
+ `Malformed satisfies atom: "${chunk}" (expected satisfies:<task-id>#<ac-id>[@<version-pin>])`,
847
+ 'Use format: satisfies:T1234#AC2 or satisfies:T1234#<uuid> e.g. satisfies:T10506#AC1',
848
+ );
849
+ }
850
+ const targetTaskId = payload.slice(0, hashIdx).trim();
851
+ const acAndPin = payload.slice(hashIdx + 1).trim();
852
+
853
+ // task-id must match strict ABNF /^T[0-9]{1,7}$/
854
+ if (!SATISFIES_TASK_ID_REGEX.test(targetTaskId)) {
855
+ throw new EvidenceParseError(
856
+ `satisfies atom targetTaskId "${targetTaskId}" must match /^T[0-9]{1,7}$/ in "${chunk}"`,
857
+ 'Use format: satisfies:T<digits>#<ac-id> e.g. satisfies:T1234#AC2',
858
+ );
859
+ }
860
+
861
+ // Split optional version-pin (after `@`)
862
+ const atIdx = acAndPin.indexOf('@');
863
+ let acIdRaw: string;
864
+ let versionPin: string | undefined;
865
+ if (atIdx === -1) {
866
+ acIdRaw = acAndPin;
867
+ versionPin = undefined;
868
+ } else {
869
+ if (atIdx < 1 || atIdx === acAndPin.length - 1) {
870
+ throw new EvidenceParseError(
871
+ `Malformed satisfies atom version-pin in "${chunk}" (expected <ac-id>@<14-digit YYYYMMDDhhmmss>)`,
872
+ 'Use format: satisfies:T1234#AC2@20260524223045',
873
+ );
874
+ }
875
+ acIdRaw = acAndPin.slice(0, atIdx).trim();
876
+ versionPin = acAndPin.slice(atIdx + 1).trim();
877
+ if (!SATISFIES_VERSION_PIN_REGEX.test(versionPin)) {
878
+ throw new EvidenceParseError(
879
+ `satisfies atom versionPin "${versionPin}" must be 14 digits (YYYYMMDDhhmmss) in "${chunk}"`,
880
+ 'Use format: satisfies:T1234#AC2@<YYYYMMDDhhmmss> e.g. satisfies:T1234#AC2@20260524223045',
881
+ );
882
+ }
883
+ }
884
+
885
+ // ac-id is EITHER a strict UUIDv4/v5 OR an AC<digits> alias — exactly one.
886
+ let targetAcId: string | undefined;
887
+ let targetAcAlias: string | undefined;
888
+ if (AC_UUID_REGEX.test(acIdRaw)) {
889
+ targetAcId = acIdRaw;
890
+ } else if (AC_ALIAS_REGEX.test(acIdRaw)) {
891
+ targetAcAlias = acIdRaw;
892
+ } else {
893
+ throw new EvidenceParseError(
894
+ `satisfies atom ac-id "${acIdRaw}" must be either a lowercase UUIDv4/v5 or AC<1-4 digits> in "${chunk}"`,
895
+ 'Use format: satisfies:T1234#AC2 (alias) or satisfies:T1234#<lowercase-uuidv4-or-v5> (canonical)',
896
+ );
897
+ }
898
+
899
+ atoms.push({
900
+ kind: 'satisfies',
901
+ targetTaskId,
902
+ ...(targetAcId !== undefined ? { targetAcId } : {}),
903
+ ...(targetAcAlias !== undefined ? { targetAcAlias } : {}),
904
+ ...(versionPin !== undefined ? { versionPin } : {}),
905
+ });
906
+ break;
907
+ }
721
908
  case 'state': {
722
909
  // T9838: explicit-form modifier for the preceding pr: atom.
723
910
  // Format: pr:<num>;state:MERGED. The resolver always requires
@@ -743,7 +930,7 @@ export function parseEvidenceString(raw: string): EvidenceAtom[] {
743
930
  default:
744
931
  throw new EvidenceParseError(
745
932
  `Unknown evidence kind: "${kind}" in atom "${chunk}"`,
746
- 'Valid kinds: commit, files, test-run, tool, url, note, loc-drop, callsite-coverage, decision, pr, state',
933
+ 'Valid kinds: commit, files, test-run, tool, url, note, loc-drop, callsite-coverage, decision, pr, satisfies, state',
747
934
  );
748
935
  }
749
936
  }
package/src/exit-codes.ts CHANGED
@@ -224,6 +224,29 @@ export enum ExitCode {
224
224
  * @task T9230
225
225
  */
226
226
  LEAD_BYPASS_DETECTED = 107,
227
+
228
+ /**
229
+ * `cleo complete <tid>` was rejected because one or more acceptance criteria
230
+ * on the task have no `evidence_ac_bindings` rows pointing at them. The
231
+ * coverage gate is the load-bearing IVTR closure piece — every AC the task
232
+ * declared MUST be backed by a `direct`, `satisfies`, or `coverage` binding
233
+ * before completion is allowed.
234
+ *
235
+ * `error.details.unsatisfied` carries the list of offending ACs (each row
236
+ * has `acId`, `alias` (`AC<n>`), and `text`). Recovery options:
237
+ * 1. Add programmatic evidence that resolves the AC via `cleo verify` so
238
+ * a binding row is written.
239
+ * 2. Pass `--waive-ac "<csv>" --waive-reason "<text>"` on `cleo complete`
240
+ * to record an audited waiver (`.cleo/audit/ac-waiver.jsonl`).
241
+ * 3. Set `CLEO_OWNER_OVERRIDE=1` + `CLEO_OWNER_OVERRIDE_REASON=<text>` for
242
+ * a full bypass (logged to `.cleo/audit/force-bypass.jsonl`).
243
+ *
244
+ * @codeName E_AC_COVERAGE_INCOMPLETE
245
+ * @task T10509
246
+ * @saga T10377 (SG-IVTR-AC-BINDING)
247
+ * @adr ADR-079-r4
248
+ */
249
+ AC_COVERAGE_INCOMPLETE = 108,
227
250
  }
228
251
 
229
252
  // ---------------------------------------------------------------------------
@@ -362,6 +385,25 @@ export const E_INVALID_SEVERITY_VALUE = 'E_INVALID_SEVERITY_VALUE' as const;
362
385
  */
363
386
  export const E_INVALID_PIPELINE_STAGE = 'E_INVALID_PIPELINE_STAGE' as const;
364
387
 
388
+ /**
389
+ * E_AC_COVERAGE_INCOMPLETE — `cleo complete <tid>` was rejected because at
390
+ * least one acceptance criterion on the task has no `evidence_ac_bindings`
391
+ * row. The coverage gate is the load-bearing IVTR closure piece — every AC
392
+ * the task declared MUST be backed by a binding (`direct`, `satisfies`, or
393
+ * `coverage`) before completion is allowed.
394
+ *
395
+ * `error.details.unsatisfied` carries the offending ACs (each entry has
396
+ * `acId`, `alias`, and `text`). Recovery options live on the {@link ExitCode.AC_COVERAGE_INCOMPLETE}
397
+ * JSDoc.
398
+ *
399
+ * Maps to {@link ExitCode.AC_COVERAGE_INCOMPLETE} (108) at the CLI boundary.
400
+ *
401
+ * @task T10509
402
+ * @saga T10377 (SG-IVTR-AC-BINDING)
403
+ * @adr ADR-079-r4
404
+ */
405
+ export const E_AC_COVERAGE_INCOMPLETE = 'E_AC_COVERAGE_INCOMPLETE' as const;
406
+
365
407
  /** Check if an exit code represents an error (1-99). */
366
408
  export function isErrorCode(code: ExitCode): boolean {
367
409
  return code >= 1 && code < 100;
package/src/index.ts CHANGED
@@ -199,7 +199,7 @@ export {
199
199
  } from './branch-lock.js';
200
200
  export type { AdapterCapabilities } from './capabilities.js';
201
201
  // === Changesets (CLEO-native task-anchored DSL — T9738) ===
202
- export type { ChangesetEntry, ChangesetKind } from './changesets.js';
202
+ export type { ChangesetEntry, ChangesetKind, ChangesetReleaseNoteSection } from './changesets.js';
203
203
  export { CHANGESET_KINDS, ChangesetEntrySchema } from './changesets.js';
204
204
  // === CLI Category Types (help renderer grouping SSoT) ===
205
205
  export type { CliCategory } from './cli-category.js';
@@ -257,6 +257,8 @@ export type {
257
257
  DepsRequiredAt,
258
258
  EnforcementProfile,
259
259
  HierarchyConfig,
260
+ LeadRollupConfig,
261
+ LeadRollupMode,
260
262
  LifecycleConfig,
261
263
  LifecycleEnforcementMode,
262
264
  LlmConfig,
@@ -288,11 +290,19 @@ export type {
288
290
  export { parseClaudeCodeCredentials } from './credentials.js';
289
291
  // === DataAccessor Interface ===
290
292
  export type {
293
+ AcBindingRow,
294
+ AcProjectionAuditFinding,
295
+ AcProjectionAuditFindingCode,
296
+ AcProjectionAuditResult,
297
+ AcProjectionAuditStatus,
298
+ AcRow,
291
299
  ArchiveFields,
292
300
  ArchiveFile,
293
301
  DataAccessor,
294
302
  DataAccessorAgentInstance,
295
303
  QueryTasksResult,
304
+ TaskAuditLogQuery,
305
+ TaskAuditLogRow,
296
306
  TaskFieldUpdates,
297
307
  TaskQueryFilters,
298
308
  TransactionAccessor,
@@ -480,6 +490,8 @@ export type {
480
490
  GateEvidenceRequirement,
481
491
  } from './evidence-atom-schema.js';
482
492
  export {
493
+ AC_ALIAS_REGEX,
494
+ AC_UUID_REGEX,
483
495
  callsiteCoverageAtomSchema,
484
496
  commitAtomSchema,
485
497
  decisionAtomSchema,
@@ -493,6 +505,9 @@ export {
493
505
  noteAtomSchema,
494
506
  parseEvidenceString,
495
507
  prAtomSchema,
508
+ SATISFIES_TASK_ID_REGEX,
509
+ SATISFIES_VERSION_PIN_REGEX,
510
+ satisfiesAtomSchema,
496
511
  testRunAtomSchema,
497
512
  toolAtomSchema,
498
513
  urlAtomSchema,
@@ -527,6 +542,8 @@ export {
527
542
  } from './evidence-record-schema.js';
528
543
  // === Exit Codes ===
529
544
  export {
545
+ // T10509 / Saga T10377 — AC-coverage gate at cleo complete (IVTR closure)
546
+ E_AC_COVERAGE_INCOMPLETE,
530
547
  // T10105 / Saga T10099 — fail-loud changeset parse
531
548
  E_CHANGESET_YAML_INVALID,
532
549
  // SPEC-T9345 release pipeline v2 error code names (T9525)
@@ -830,6 +847,20 @@ export type {
830
847
  WikiStateFile,
831
848
  WikiSymbolRow,
832
849
  } from './nexus-wiki-ops.js';
850
+ // === Operation-aware LAFS envelope validation (T10610) ===
851
+ export type {
852
+ OperationEnvelopeName,
853
+ OperationEnvelopeValidationIssue,
854
+ OperationEnvelopeValidationOptions,
855
+ OperationEnvelopeValidationResult,
856
+ } from './operation-envelope-validation.js';
857
+ export {
858
+ E_LAFS_OPERATION_ERROR_SHAPE,
859
+ E_LAFS_OPERATION_RESULT_SCHEMA,
860
+ E_LAFS_OPERATION_UNREGISTERED,
861
+ OPERATION_RESULT_SCHEMAS,
862
+ validateOperationEnvelope,
863
+ } from './operation-envelope-validation.js';
833
864
  // Admin operation param/result types — re-exported at top level for typed-dispatch consumers
834
865
  // (T1426 Wave D · typed-narrowing migration for admin domain)
835
866
  export type {
@@ -915,6 +946,14 @@ export type {
915
946
  EvaluateDialecticParams,
916
947
  EvaluateDialecticResult,
917
948
  } from './operations/dialectic.js';
949
+ // === Docs Operation Types (T10618 — docs.update lifecycle status SSoT) ===
950
+ // Re-exported at top level so core and CLI layers can consume the same
951
+ // operation contract without relying on an unexported package subpath.
952
+ export {
953
+ DOCS_LIFECYCLE_STATUSES,
954
+ type DocsLifecycleStatus,
955
+ type DocsUpdateParams,
956
+ } from './operations/docs.js';
918
957
  // === Operations Types (API wire format, namespaced to avoid collision with domain types) ===
919
958
  export * as ops from './operations/index.js';
920
959
  // === Operation Input Contracts (T9914 / Saga T9855 / E7) ===
@@ -1192,7 +1231,12 @@ export type {
1192
1231
  UserProfileTrait,
1193
1232
  } from './operations/nexus-user-profile.js';
1194
1233
  // Commonly used ops types re-exported at top level for convenience
1195
- export type { BrainState } from './operations/orchestrate.js';
1234
+ export type {
1235
+ BrainState,
1236
+ OrchestrateReportEntry,
1237
+ OrchestrateReportGroup,
1238
+ OrchestrateReportParams,
1239
+ } from './operations/orchestrate.js';
1196
1240
  // ParamDef contract — re-exported at top level (SSoT for all operation param descriptors)
1197
1241
  export type {
1198
1242
  CittyArgDef,
@@ -1275,7 +1319,9 @@ export type {
1275
1319
  DepGraphIssue,
1276
1320
  DepsTreeEdge,
1277
1321
  DepsTreeNode,
1322
+ TaskShowAcRowEntry,
1278
1323
  TaskShowAttachmentEntry,
1324
+ TaskShowRelationsEntry,
1279
1325
  TasksAddBatchEntry,
1280
1326
  TasksAddBatchParams,
1281
1327
  TasksAddBatchResult,
@@ -1295,6 +1341,15 @@ export type {
1295
1341
  TasksCompleteQueryResult,
1296
1342
  TasksComplexityEstimateParams,
1297
1343
  TasksComplexityEstimateResult,
1344
+ // T10629 — task context pack types
1345
+ TasksContextAcceptanceEntry,
1346
+ TasksContextActivityEvent,
1347
+ TasksContextBlockerEntry,
1348
+ TasksContextBudget,
1349
+ TasksContextDocEntry,
1350
+ TasksContextOmission,
1351
+ TasksContextParams,
1352
+ TasksContextResult,
1298
1353
  TasksCurrentParams,
1299
1354
  TasksCurrentResult,
1300
1355
  TasksDeleteQueryParams,
@@ -1321,6 +1376,9 @@ export type {
1321
1376
  TasksOps,
1322
1377
  TasksPlanParams,
1323
1378
  TasksPlanResult,
1379
+ TasksRelatesAddBatchEntry,
1380
+ TasksRelatesAddBatchParams,
1381
+ TasksRelatesAddBatchResult,
1324
1382
  TasksRelatesAddParams,
1325
1383
  TasksRelatesAddResult,
1326
1384
  TasksRelatesParams,
@@ -1345,8 +1403,14 @@ export type {
1345
1403
  TasksSagaMembersResult,
1346
1404
  TasksSagaRollupParams,
1347
1405
  TasksSagaRollupResult,
1406
+ TasksScopeMember,
1407
+ TasksScopeReadyEntry,
1408
+ TasksScopeRollup,
1348
1409
  TasksShowParams,
1349
1410
  TasksShowResult,
1411
+ TasksSliceNode,
1412
+ TasksSliceParams,
1413
+ TasksSliceResult,
1350
1414
  TasksStartQueryParams,
1351
1415
  TasksStartQueryResult,
1352
1416
  TasksStopQueryParams,
@@ -1881,6 +1945,7 @@ export type {
1881
1945
  MinimalTaskRecord,
1882
1946
  TaskRecord,
1883
1947
  TaskRecordRelation,
1948
+ TaskRecordRelationCounts,
1884
1949
  ValidationHistoryEntry,
1885
1950
  } from './task-record.js';
1886
1951
  // === Task Sync Types (provider-agnostic reconciliation) ===
@@ -1911,10 +1976,40 @@ export {
1911
1976
  } from './tasks/archive.js';
1912
1977
  // === Task Domain Result Types (T1703 — canonical shapes for operations/tasks.ts stubs) ===
1913
1978
  export type {
1979
+ CompletionBlockerReason,
1980
+ CompletionContextPack,
1981
+ CompletionContextPackOptions,
1982
+ CompletionContextPackSummary,
1983
+ CompletionCriterionEvaluation,
1984
+ CompletionCriterionKind,
1985
+ CompletionCriterionReplacement,
1986
+ CompletionCriterionStatus,
1987
+ CompletionCriterionWaiver,
1988
+ CompletionEvaluateParams,
1989
+ CompletionEvaluateResult,
1990
+ CompletionEvaluation,
1991
+ CompletionExplainParams,
1992
+ CompletionExplainResult,
1993
+ CompletionExplanation,
1994
+ CompletionHistoryEvent,
1995
+ CompletionHistoryEventAction,
1996
+ CompletionHistoryEventRelation,
1997
+ CompletionListParams,
1998
+ CompletionListResult,
1999
+ CompletionProjectionRepairError,
2000
+ CompletionProjectionRepairErrorCode,
2001
+ CompletionProjectionRepairParams,
2002
+ CompletionProjectionRepairResult,
2003
+ CompletionStaleReason,
1914
2004
  TaskComplexityFactor,
1915
2005
  TaskDependsRef,
1916
2006
  TaskDependsResult,
1917
2007
  TaskLabelInfo,
2008
+ TaskMutationBucket,
2009
+ TaskMutationDryRunSummary,
2010
+ TaskMutationEnvelope,
2011
+ TaskMutationWarning,
2012
+ TaskMutationWarningSeverity,
1918
2013
  TaskPlanBlockedTask,
1919
2014
  TaskPlanInProgressEpic,
1920
2015
  TaskPlanMetrics,
@@ -1929,6 +2024,19 @@ export type {
1929
2024
  TaskViewNextAction,
1930
2025
  TaskViewPipelineStage,
1931
2026
  } from './tasks.js';
2027
+ export {
2028
+ completionCriterionEvaluationSchema,
2029
+ completionEvaluateParamsSchema,
2030
+ completionEvaluationSchema,
2031
+ completionExplainParamsSchema,
2032
+ completionExplanationSchema,
2033
+ completionListParamsSchema,
2034
+ completionListResultSchema,
2035
+ completionProjectionRepairErrorSchema,
2036
+ completionProjectionRepairParamsSchema,
2037
+ completionProjectionRepairResultSchema,
2038
+ unsatisfiedCompletionCriterionSchema,
2039
+ } from './tasks.js';
1932
2040
  // === Template Manifest (T9875 / Saga T9855) ===
1933
2041
  export type {
1934
2042
  PlaceholderSource,
@@ -1994,6 +2102,31 @@ export type {
1994
2102
  Transport,
1995
2103
  TransportConnectConfig,
1996
2104
  } from './transport.js';
2105
+ // === Validator Role Contracts (T10510 / Saga T10377 SG-IVTR-AC-BINDING) ===
2106
+ // Canonical AgentRole enum + per-AC ValidatorFinding + ValidatorAttestation /
2107
+ // ValidatorRejection envelopes + ValidatorVerdict discriminated union. Consumed
2108
+ // by SDK tools (T10511) and the Max-N runtime (T10512) under Epic T10383
2109
+ // E-VALIDATOR-ROLE.
2110
+ export type {
2111
+ AgentRole,
2112
+ ValidatorAttestation,
2113
+ ValidatorFinding,
2114
+ ValidatorFindingStatus,
2115
+ ValidatorRejection,
2116
+ ValidatorVerdict,
2117
+ } from './validator/index.js';
2118
+ export {
2119
+ AGENT_ROLES,
2120
+ isAgentRole,
2121
+ isValidatorAttestation,
2122
+ isValidatorRejection,
2123
+ isValidatorVerdict,
2124
+ VALIDATOR_ID_REGEX,
2125
+ validatorAttestationSchema,
2126
+ validatorFindingSchema,
2127
+ validatorRejectionSchema,
2128
+ validatorVerdictSchema,
2129
+ } from './validator/index.js';
1997
2130
  // === WarpChain Types ===
1998
2131
  export type {
1999
2132
  ChainShape,
@@ -2009,4 +2142,99 @@ export type {
2009
2142
  WarpLink,
2010
2143
  WarpStage,
2011
2144
  } from './warp-chain.js';
2145
+ export type {
2146
+ TasksFrontierParamsInput,
2147
+ TasksRollupParamsInput,
2148
+ TasksTraverseParamsInput,
2149
+ TasksTreeParamsInput,
2150
+ TasksWorkGraphAuditParamsInput,
2151
+ WorkGraphAudienceMode,
2152
+ WorkGraphAuditOptions,
2153
+ WorkGraphAuditResult,
2154
+ WorkGraphContainmentAncestorsResult,
2155
+ WorkGraphContainmentChildrenResult,
2156
+ WorkGraphContainmentNode,
2157
+ WorkGraphContainmentQueryService,
2158
+ WorkGraphContextBudget,
2159
+ WorkGraphContextPack,
2160
+ WorkGraphContextPackParams,
2161
+ WorkGraphDependencyEdge,
2162
+ WorkGraphDirectEdge,
2163
+ WorkGraphEdge,
2164
+ WorkGraphEdgeDirection,
2165
+ WorkGraphEdgeSource,
2166
+ WorkGraphHierarchyInputNode,
2167
+ WorkGraphHierarchyValidationOptions,
2168
+ WorkGraphHierarchyValidationResult,
2169
+ WorkGraphHierarchyViolation,
2170
+ WorkGraphNode,
2171
+ WorkGraphNodeRef,
2172
+ WorkGraphOmission,
2173
+ WorkGraphOmissionReason,
2174
+ WorkGraphPageInfo,
2175
+ WorkGraphPaginationOptions,
2176
+ WorkGraphPercentDenominator,
2177
+ WorkGraphPlanningDoc,
2178
+ WorkGraphPlanningDocParams,
2179
+ WorkGraphProjectionMismatch,
2180
+ WorkGraphReader,
2181
+ WorkGraphReadinessParams,
2182
+ WorkGraphReadinessResult,
2183
+ WorkGraphReadyFrontierBlockedBy,
2184
+ WorkGraphReadyFrontierOptions,
2185
+ WorkGraphReadyFrontierResult,
2186
+ WorkGraphReadyFrontierTask,
2187
+ WorkGraphRelationEdge,
2188
+ WorkGraphRelationEdgesOptions,
2189
+ WorkGraphRelationEdgesResult,
2190
+ WorkGraphRelationKind,
2191
+ WorkGraphRelationQueryService,
2192
+ WorkGraphRollupCounts,
2193
+ WorkGraphScaffoldApplyParams,
2194
+ WorkGraphScaffoldApplyResult,
2195
+ WorkGraphScaffoldValidateParams,
2196
+ WorkGraphScaffoldValidateResult,
2197
+ WorkGraphScaffoldValidationIssue,
2198
+ WorkGraphSlice,
2199
+ WorkGraphSliceParams,
2200
+ WorkGraphSnapshot,
2201
+ WorkGraphSubtreePercentages,
2202
+ WorkGraphSubtreeSummaryOptions,
2203
+ WorkGraphSubtreeSummaryResult,
2204
+ WorkGraphTaskRelationType,
2205
+ WorkGraphTraversalDirection,
2206
+ WorkGraphTraversalOptions,
2207
+ WorkGraphTraversalResult,
2208
+ WorkGraphTreeNode,
2209
+ WorkGraphTreeOptions,
2210
+ WorkGraphTreeResult,
2211
+ } from './workgraph.js';
2212
+ // === PM-Core V2 WorkGraph public contracts ===
2213
+ export {
2214
+ E_WORKGRAPH_PARENT_TYPE_MATRIX,
2215
+ tasksFrontierParamsSchema,
2216
+ tasksFrontierResultSchema,
2217
+ tasksRollupParamsSchema,
2218
+ tasksRollupResultSchema,
2219
+ tasksTraverseParamsSchema,
2220
+ tasksTraverseResultSchema,
2221
+ tasksTreeParamsSchema,
2222
+ tasksTreeResultSchema,
2223
+ tasksWorkGraphAuditParamsSchema,
2224
+ tasksWorkGraphAuditResultSchema,
2225
+ validateWorkGraphHierarchy,
2226
+ WorkGraphHierarchyInvariantError,
2227
+ workGraphContextPackParamsSchema,
2228
+ workGraphContextPackSchema,
2229
+ workGraphPlanningDocParamsSchema,
2230
+ workGraphPlanningDocSchema,
2231
+ workGraphReadinessParamsSchema,
2232
+ workGraphReadinessResultSchema,
2233
+ workGraphScaffoldApplyParamsSchema,
2234
+ workGraphScaffoldApplyResultSchema,
2235
+ workGraphScaffoldValidateParamsSchema,
2236
+ workGraphScaffoldValidateResultSchema,
2237
+ workGraphSliceParamsSchema,
2238
+ workGraphSliceSchema,
2239
+ } from './workgraph.js';
2012
2240
  // === WASM SDK (Rust crate bindings) ===