@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
@@ -25,6 +25,20 @@ export interface ValidationHistoryEntry {
25
25
  timestamp: string;
26
26
  }
27
27
 
28
+ /** Compact relation/document counts surfaced on default `cleo show` MVI output. */
29
+ export interface TaskRecordRelationCounts {
30
+ /** Direct dependencies declared by the task. */
31
+ depends: number;
32
+ /** Explicit blockedBy entries on the task record. */
33
+ blockedBy: number;
34
+ /** Non-dependency task relation links. */
35
+ relates: number;
36
+ /** Direct child tasks. */
37
+ children: number;
38
+ /** Docs attachments linked to the task. */
39
+ docs: number;
40
+ }
41
+
28
42
  /** String-widened Task for JSON serialization in dispatch/LAFS layer. */
29
43
  export interface TaskRecord {
30
44
  id: string;
@@ -58,6 +72,8 @@ export interface TaskRecord {
58
72
  lifecycleState?: string | null;
59
73
  validationHistory?: ValidationHistoryEntry[];
60
74
  blockedBy?: string[];
75
+ /** Compact counts for relationships and docs, kept in default MVI projection. */
76
+ relationCounts?: TaskRecordRelationCounts;
61
77
  cancellationReason?: string;
62
78
  /** RCASD-IVTR+C pipeline stage. @task T060 */
63
79
  pipelineStage?: string | null;
package/src/task.ts CHANGED
@@ -30,7 +30,12 @@ export type { TaskStatus };
30
30
  * A single acceptance criterion — either a free-text string (legacy) or a
31
31
  * structured {@link AcceptanceGate} (machine-verifiable).
32
32
  *
33
- * Mixed arrays of these are stored as JSON in the `acceptance_json` column.
33
+ * Mixed arrays of these were historically stored as JSON in the
34
+ * `acceptance_json` column. T10574 deprecates that column for completion:
35
+ * post-migration completion/readiness/AC-coverage logic must use canonical
36
+ * `task_acceptance_criteria` rows and `evidence_ac_bindings` instead.
37
+ * `acceptance_json` remains only for legacy import/backfill compatibility
38
+ * until all display fallbacks and historical fixtures have been removed.
34
39
  *
35
40
  * @epic T760
36
41
  * @task T780
@@ -81,14 +86,16 @@ export type TaskKind = 'work' | 'research' | 'experiment' | 'bug' | 'spike' | 'r
81
86
  export type TaskScope = 'project' | 'feature' | 'unit';
82
87
 
83
88
  /**
84
- * Bug severity axis. Only meaningful when `kind='bug'`; enforced by a DB-level
85
- * CHECK constraint on the `role` column (`severity IS NULL OR (severity IN (...) AND role='bug')`).
89
+ * Severity axis. Orthogonal to {@link TaskKind}; valid severities may be set
90
+ * on work/research/experiment/bug/spike/release tasks alike. The DB CHECK
91
+ * constraint only validates membership in P0-P3.
86
92
  *
87
93
  * OWNER-WRITE-ONLY: severity is intended to be set through owner-authenticated
88
94
  * paths only. This prevents a prompt-injection exploit where a compromised
89
95
  * Tier 3 agent could downgrade a P0 bug to P3 to force-ship.
90
96
  *
91
97
  * @task T944
98
+ * @task T10089
92
99
  */
93
100
  export type TaskSeverity = 'P0' | 'P1' | 'P2' | 'P3';
94
101
 
@@ -306,6 +313,45 @@ export type EvidenceAtom =
306
313
  successCount: number;
307
314
  /** Total number of checks evaluated in the rollup. */
308
315
  totalChecks: number;
316
+ }
317
+ | {
318
+ /**
319
+ * Satisfies atom — cross-task acceptance-criterion binding per
320
+ * ADR-079-r2.
321
+ *
322
+ * Carries the parsed form (one of `targetAcId` UUID or
323
+ * `targetAcAlias` `AC<digits>` will be populated; optional
324
+ * `versionPin` captures the target AC's `updated_at` at mint time)
325
+ * plus the validator-canonical `resolvedAcUuid` populated by the
326
+ * T10507 5-check pipeline (target exists, not terminal, AC exists,
327
+ * same-saga scope). T10506 only ships the parser — the validated
328
+ * form is reserved here so consumers of `EvidenceAtom` (sentinel
329
+ * tables, gate-checkers, audit logs) can pattern-match on
330
+ * `kind === 'satisfies'` from day one.
331
+ *
332
+ * Format: `satisfies:<task-id>#<ac-id>[@<version-pin>]`
333
+ * - `satisfies:T1234#a1b2c3d4-5e6f-4890-abcd-ef1234567890` (UUID)
334
+ * - `satisfies:T1234#AC2` (alias)
335
+ * - `satisfies:T1234#AC2@20260524223045` (pin)
336
+ *
337
+ * @task T10506
338
+ * @adr ADR-079-r2
339
+ */
340
+ kind: 'satisfies';
341
+ /** Target task ID — `T<1-7 digits>` per ADR-079-r2 §2.1. */
342
+ targetTaskId: string;
343
+ /** Lowercase UUIDv4/v5 — populated for canonical form; undefined for alias form. */
344
+ targetAcId?: string;
345
+ /** `AC<1-4 digits>` alias — populated for alias form; undefined for UUID form. */
346
+ targetAcAlias?: string;
347
+ /** Optional `@<YYYYMMDDhhmmss>` pin captured at mint time. */
348
+ versionPin?: string;
349
+ /**
350
+ * Canonical UUID resolved by the T10507 validator from `targetAcId`
351
+ * (already canonical) or by looking up `(targetTaskId, alias-ordinal)`.
352
+ * Reserved here for forward compatibility; undefined under T10506.
353
+ */
354
+ resolvedAcUuid?: string;
309
355
  };
310
356
 
311
357
  /**
@@ -427,7 +473,7 @@ export interface Task {
427
473
  scope?: TaskScope;
428
474
 
429
475
  /**
430
- * Bug severity. Only valid when {@link role} is `'bug'`. OWNER-WRITE-ONLY.
476
+ * Severity axis. Valid for any {@link kind}. OWNER-WRITE-ONLY.
431
477
  * @defaultValue undefined
432
478
  * @task T944
433
479
  */
@@ -467,6 +513,9 @@ export interface Task {
467
513
  /** Related task entries (non-dependency relationships). @defaultValue undefined */
468
514
  relates?: TaskRelation[];
469
515
 
516
+ /** Gate status map (implemented/testsPassed/qaPassed). @defaultValue undefined */
517
+ gates?: Record<string, boolean>;
518
+
470
519
  /** Epic lifecycle state. Only meaningful when `type = 'epic'`. @defaultValue undefined */
471
520
  epicLifecycle?: EpicLifecycle | null;
472
521
 
@@ -599,7 +648,7 @@ export interface TaskCreate {
599
648
  scope?: TaskScope;
600
649
 
601
650
  /**
602
- * Bug severity (OWNER-WRITE-ONLY). Only valid with `kind='bug'`.
651
+ * Severity axis (OWNER-WRITE-ONLY). Valid for any `kind`.
603
652
  * @defaultValue undefined
604
653
  * @task T944
605
654
  */