@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.
- package/dist/__tests__/completion-operation-contracts.test.d.ts +8 -0
- package/dist/__tests__/completion-operation-contracts.test.d.ts.map +1 -0
- package/dist/__tests__/completion-operation-contracts.test.js +114 -0
- package/dist/__tests__/completion-operation-contracts.test.js.map +1 -0
- package/dist/__tests__/operation-envelope-validation.test.d.ts +8 -0
- package/dist/__tests__/operation-envelope-validation.test.d.ts.map +1 -0
- package/dist/__tests__/operation-envelope-validation.test.js +105 -0
- package/dist/__tests__/operation-envelope-validation.test.js.map +1 -0
- package/dist/__tests__/satisfies-atom.test.d.ts +24 -0
- package/dist/__tests__/satisfies-atom.test.d.ts.map +1 -0
- package/dist/__tests__/satisfies-atom.test.js +320 -0
- package/dist/__tests__/satisfies-atom.test.js.map +1 -0
- package/dist/__tests__/validator-types.test.d.ts +13 -0
- package/dist/__tests__/validator-types.test.d.ts.map +1 -0
- package/dist/__tests__/validator-types.test.js +293 -0
- package/dist/__tests__/validator-types.test.js.map +1 -0
- package/dist/__tests__/workgraph-context-scaffold-contracts.test.d.ts +8 -0
- package/dist/__tests__/workgraph-context-scaffold-contracts.test.d.ts.map +1 -0
- package/dist/__tests__/workgraph-context-scaffold-contracts.test.js +188 -0
- package/dist/__tests__/workgraph-context-scaffold-contracts.test.js.map +1 -0
- package/dist/__tests__/workgraph-operation-contracts.test.d.ts +8 -0
- package/dist/__tests__/workgraph-operation-contracts.test.d.ts.map +1 -0
- package/dist/__tests__/workgraph-operation-contracts.test.js +115 -0
- package/dist/__tests__/workgraph-operation-contracts.test.js.map +1 -0
- package/dist/config.d.ts +56 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/data-accessor.d.ts +194 -0
- package/dist/data-accessor.d.ts.map +1 -1
- package/dist/data-accessor.js.map +1 -1
- package/dist/dispatch/__tests__/docs-update-registry.test.d.ts +2 -0
- package/dist/dispatch/__tests__/docs-update-registry.test.d.ts.map +1 -0
- package/dist/dispatch/__tests__/docs-update-registry.test.js +27 -0
- package/dist/dispatch/__tests__/docs-update-registry.test.js.map +1 -0
- package/dist/dispatch/__tests__/operation-envelope-snapshots.test.d.ts +2 -0
- package/dist/dispatch/__tests__/operation-envelope-snapshots.test.d.ts.map +1 -0
- package/dist/dispatch/__tests__/operation-envelope-snapshots.test.js +265 -0
- package/dist/dispatch/__tests__/operation-envelope-snapshots.test.js.map +1 -0
- package/dist/dispatch/operations-registry.d.ts.map +1 -1
- package/dist/dispatch/operations-registry.js +487 -7
- package/dist/dispatch/operations-registry.js.map +1 -1
- package/dist/evidence-atom-schema.d.ts +91 -0
- package/dist/evidence-atom-schema.d.ts.map +1 -1
- package/dist/evidence-atom-schema.js +162 -1
- package/dist/evidence-atom-schema.js.map +1 -1
- package/dist/exit-codes.d.ts +41 -1
- package/dist/exit-codes.d.ts.map +1 -1
- package/dist/exit-codes.js +40 -0
- package/dist/exit-codes.js.map +1 -1
- package/dist/index.d.ts +17 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -1
- package/dist/index.js.map +1 -1
- package/dist/operation-envelope-validation.d.ts +79 -0
- package/dist/operation-envelope-validation.d.ts.map +1 -0
- package/dist/operation-envelope-validation.js +219 -0
- package/dist/operation-envelope-validation.js.map +1 -0
- package/dist/operations/__tests__/agent-operation-contract.test.d.ts +2 -0
- package/dist/operations/__tests__/agent-operation-contract.test.d.ts.map +1 -0
- package/dist/operations/__tests__/agent-operation-contract.test.js +128 -0
- package/dist/operations/__tests__/agent-operation-contract.test.js.map +1 -0
- package/dist/operations/__tests__/tasks-input-contracts.test.js +15 -0
- package/dist/operations/__tests__/tasks-input-contracts.test.js.map +1 -1
- package/dist/operations/agent-operation-contract.d.ts +227 -0
- package/dist/operations/agent-operation-contract.d.ts.map +1 -0
- package/dist/operations/agent-operation-contract.js +38 -0
- package/dist/operations/agent-operation-contract.js.map +1 -0
- package/dist/operations/docs.d.ts +19 -1
- package/dist/operations/docs.d.ts.map +1 -1
- package/dist/operations/docs.js +20 -0
- package/dist/operations/docs.js.map +1 -1
- package/dist/operations/focus.d.ts +1 -1
- package/dist/operations/index.d.ts +1 -0
- package/dist/operations/index.d.ts.map +1 -1
- package/dist/operations/index.js +1 -0
- package/dist/operations/index.js.map +1 -1
- package/dist/operations/orchestrate.d.ts +66 -0
- package/dist/operations/orchestrate.d.ts.map +1 -1
- package/dist/operations/tasks.d.ts +617 -11
- package/dist/operations/tasks.d.ts.map +1 -1
- package/dist/operations/tasks.js +22 -3
- package/dist/operations/tasks.js.map +1 -1
- package/dist/task-record.d.ts +15 -0
- package/dist/task-record.d.ts.map +1 -1
- package/dist/task.d.ts +52 -5
- package/dist/task.d.ts.map +1 -1
- package/dist/task.js.map +1 -1
- package/dist/tasks.d.ts +944 -0
- package/dist/tasks.d.ts.map +1 -1
- package/dist/tasks.js +198 -1
- package/dist/tasks.js.map +1 -1
- package/dist/validator/index.d.ts +375 -0
- package/dist/validator/index.d.ts.map +1 -0
- package/dist/validator/index.js +162 -0
- package/dist/validator/index.js.map +1 -0
- package/dist/workgraph.d.ts +1950 -0
- package/dist/workgraph.d.ts.map +1 -0
- package/dist/workgraph.js +449 -0
- package/dist/workgraph.js.map +1 -0
- package/package.json +10 -2
- package/src/__tests__/__snapshots__/operations-registry.test.ts.snap +1 -1
- package/src/__tests__/completion-operation-contracts.test.ts +154 -0
- package/src/__tests__/operation-envelope-validation.test.ts +140 -0
- package/src/__tests__/satisfies-atom.test.ts +383 -0
- package/src/__tests__/validator-types.test.ts +359 -0
- package/src/__tests__/workgraph-context-scaffold-contracts.test.ts +232 -0
- package/src/__tests__/workgraph-operation-contracts.test.ts +151 -0
- package/src/config.ts +58 -0
- package/src/data-accessor.ts +213 -0
- package/src/dispatch/__tests__/docs-update-registry.test.ts +35 -0
- package/src/dispatch/__tests__/operation-envelope-snapshots.test.ts +283 -0
- package/src/dispatch/operations-registry.ts +502 -7
- package/src/evidence-atom-schema.ts +188 -1
- package/src/exit-codes.ts +42 -0
- package/src/index.ts +230 -2
- package/src/operation-envelope-validation.ts +319 -0
- package/src/operations/__tests__/agent-operation-contract.test.ts +161 -0
- package/src/operations/__tests__/tasks-input-contracts.test.ts +30 -0
- package/src/operations/agent-operation-contract.ts +253 -0
- package/src/operations/docs.ts +27 -7
- package/src/operations/focus.ts +1 -1
- package/src/operations/index.ts +1 -0
- package/src/operations/orchestrate.ts +71 -0
- package/src/operations/tasks.ts +662 -15
- package/src/task-record.ts +16 -0
- package/src/task.ts +54 -5
- package/src/tasks.ts +558 -0
- package/src/validator/index.ts +385 -0
- package/src/workgraph.ts +1153 -0
package/src/task-record.ts
CHANGED
|
@@ -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
|
|
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
|
-
*
|
|
85
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
651
|
+
* Severity axis (OWNER-WRITE-ONLY). Valid for any `kind`.
|
|
603
652
|
* @defaultValue undefined
|
|
604
653
|
* @task T944
|
|
605
654
|
*/
|