@cleocode/contracts 2026.4.141 → 2026.4.143

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.
@@ -0,0 +1,208 @@
1
+ /**
2
+ * Sentient Domain Operations (10 operations)
3
+ *
4
+ * Query operations: 2 (propose.list, allowlist.list)
5
+ * Mutate operations: 5 (propose.accept, propose.reject, propose.run, propose.enable, propose.disable)
6
+ * Allowlist mutations: 2 (allowlist.add, allowlist.remove)
7
+ *
8
+ * Operations for autonomous Tier-2 proposal management and owner allowlist control.
9
+ * All operations emit LAFS-compliant envelopes.
10
+ *
11
+ * @task T1008 — Sentient Tier 2 Proposals
12
+ * @task T1421 — Sentient domain typed narrowing (Wave D · T975 follow-on)
13
+ */
14
+
15
+ // ---------------------------------------------------------------------------
16
+ // Query Operations
17
+ // ---------------------------------------------------------------------------
18
+
19
+ /** Parameters for `propose.list` — list all pending proposals. */
20
+ export interface ProposeListParams {
21
+ /** Maximum number of proposals to return (default: 50). */
22
+ limit?: number;
23
+ }
24
+
25
+ /** Minimal proposal for wire format. */
26
+ export interface Proposal {
27
+ /** Task ID of the proposal. */
28
+ id: string;
29
+ /** Task title. */
30
+ title: string;
31
+ /** Task description. */
32
+ description: string;
33
+ /** Task status (always 'proposed' when returned). */
34
+ status: string;
35
+ /** Task priority. */
36
+ priority?: string;
37
+ /** Labels attached to the task. */
38
+ labels: string[];
39
+ /** ISO timestamp when the proposal was created. */
40
+ createdAt: string;
41
+ /** Proposal metadata (weight, reasoning, etc). */
42
+ meta?: Record<string, unknown> | null;
43
+ }
44
+
45
+ /** Result of `propose.list`. */
46
+ export interface ProposeListResult {
47
+ /** Array of proposals, sorted by weight descending. */
48
+ proposals: Proposal[];
49
+ /** Total count of proposals returned. */
50
+ total: number;
51
+ }
52
+
53
+ // propose.diff
54
+ /** Parameters for `propose.diff` — show what a proposal would change. */
55
+ export interface ProposeDiffParams {
56
+ /** Proposal task ID. */
57
+ id: string;
58
+ }
59
+
60
+ /** Result of `propose.diff` — Tier-3 stub. */
61
+ export interface ProposeDiffResult {
62
+ /** Proposal ID. */
63
+ id: string;
64
+ /** Content diff (null in Tier-2; Tier-3 feature). */
65
+ diff: null;
66
+ /** Explanation message. */
67
+ message: string;
68
+ }
69
+
70
+ // allowlist.list
71
+ /** Parameters for `allowlist.list` — no params required. */
72
+ export type AllowlistListParams = Record<string, never>;
73
+
74
+ /** Result of `allowlist.list`. */
75
+ export interface AllowlistListResult {
76
+ /** Array of base64-encoded owner public keys. */
77
+ ownerPubkeys: string[];
78
+ /** Total count of pubkeys in the allowlist. */
79
+ count: number;
80
+ }
81
+
82
+ // ---------------------------------------------------------------------------
83
+ // Mutate Operations
84
+ // ---------------------------------------------------------------------------
85
+
86
+ // propose.accept
87
+ /** Parameters for `propose.accept` — accept a proposal. */
88
+ export interface ProposeAcceptParams {
89
+ /** Proposal task ID to accept. */
90
+ id: string;
91
+ }
92
+
93
+ /** Result of `propose.accept`. */
94
+ export interface ProposeAcceptResult {
95
+ /** Task ID that was accepted. */
96
+ id: string;
97
+ /** New task status ('pending'). */
98
+ status: string;
99
+ /** ISO timestamp when accepted. */
100
+ acceptedAt: string;
101
+ }
102
+
103
+ // propose.reject
104
+ /** Parameters for `propose.reject` — reject a proposal. */
105
+ export interface ProposeRejectParams {
106
+ /** Proposal task ID to reject. */
107
+ id: string;
108
+ /** Reason for rejection. */
109
+ reason?: string;
110
+ }
111
+
112
+ /** Result of `propose.reject`. */
113
+ export interface ProposeRejectResult {
114
+ /** Task ID that was rejected. */
115
+ id: string;
116
+ /** New task status ('cancelled'). */
117
+ status: string;
118
+ /** ISO timestamp when rejected. */
119
+ rejectedAt: string;
120
+ /** Rejection reason. */
121
+ reason: string;
122
+ }
123
+
124
+ // propose.run
125
+ /** Parameters for `propose.run` — manually trigger a propose tick. */
126
+ export type ProposeRunParams = Record<string, never>;
127
+
128
+ /** Result of `propose.run`. */
129
+ export interface ProposeRunResult {
130
+ /** Outcome from the propose tick. */
131
+ outcome: unknown;
132
+ }
133
+
134
+ // propose.enable
135
+ /** Parameters for `propose.enable` — enable Tier-2 proposals. */
136
+ export type ProposeEnableParams = Record<string, never>;
137
+
138
+ /** Result of `propose.enable`. */
139
+ export interface ProposeEnableResult {
140
+ /** Whether Tier-2 is now enabled. */
141
+ tier2Enabled: boolean;
142
+ /** Confirmation message. */
143
+ message: string;
144
+ }
145
+
146
+ // propose.disable
147
+ /** Parameters for `propose.disable` — disable Tier-2 proposals. */
148
+ export type ProposeDisableParams = Record<string, never>;
149
+
150
+ /** Result of `propose.disable`. */
151
+ export interface ProposeDisableResult {
152
+ /** Whether Tier-2 is now enabled (false after disable). */
153
+ tier2Enabled: boolean;
154
+ /** Confirmation message. */
155
+ message: string;
156
+ }
157
+
158
+ // allowlist.add
159
+ /** Parameters for `allowlist.add` — add a pubkey to the allowlist. */
160
+ export interface AllowlistAddParams {
161
+ /** Base64-encoded public key to add. */
162
+ pubkey: string;
163
+ }
164
+
165
+ /** Result of `allowlist.add`. */
166
+ export interface AllowlistAddResult {
167
+ /** The pubkey that was added. */
168
+ added: string;
169
+ }
170
+
171
+ // allowlist.remove
172
+ /** Parameters for `allowlist.remove` — remove a pubkey from the allowlist. */
173
+ export interface AllowlistRemoveParams {
174
+ /** Base64-encoded public key to remove. */
175
+ pubkey: string;
176
+ }
177
+
178
+ /** Result of `allowlist.remove`. */
179
+ export interface AllowlistRemoveResult {
180
+ /** The pubkey that was removed. */
181
+ removed: string;
182
+ }
183
+
184
+ // ---------------------------------------------------------------------------
185
+ // Typed operation record (Wave D adapter — T975 follow-on)
186
+ // ---------------------------------------------------------------------------
187
+
188
+ /**
189
+ * Typed operation record for the sentient domain.
190
+ *
191
+ * Maps each operation name (as dispatched by the registry — no domain prefix)
192
+ * to its `[Params, Result]` tuple. Used by `TypedDomainHandler<SentientOps>`
193
+ * in the dispatch layer to provide compile-time narrowing of params.
194
+ *
195
+ * @task T1421 — Sentient domain typed narrowing (Wave D follow-on)
196
+ */
197
+ export type SentientOps = {
198
+ readonly 'propose.list': readonly [ProposeListParams, ProposeListResult];
199
+ readonly 'propose.diff': readonly [ProposeDiffParams, ProposeDiffResult];
200
+ readonly 'propose.accept': readonly [ProposeAcceptParams, ProposeAcceptResult];
201
+ readonly 'propose.reject': readonly [ProposeRejectParams, ProposeRejectResult];
202
+ readonly 'propose.run': readonly [ProposeRunParams, ProposeRunResult];
203
+ readonly 'propose.enable': readonly [ProposeEnableParams, ProposeEnableResult];
204
+ readonly 'propose.disable': readonly [ProposeDisableParams, ProposeDisableResult];
205
+ readonly 'allowlist.list': readonly [AllowlistListParams, AllowlistListResult];
206
+ readonly 'allowlist.add': readonly [AllowlistAddParams, AllowlistAddResult];
207
+ readonly 'allowlist.remove': readonly [AllowlistRemoveParams, AllowlistRemoveResult];
208
+ };
@@ -103,6 +103,12 @@ export interface TasksFindParams {
103
103
  fields?: string;
104
104
  /** When true, emit verbose per-match diagnostic fields. @task T963 */
105
105
  verbose?: boolean;
106
+ /**
107
+ * Filter by role axis (T944 — orthogonal axes).
108
+ * Accepts the same values as the `role` field on TasksCreateParams.
109
+ * @task T963 / T944
110
+ */
111
+ role?: string;
106
112
  }
107
113
  export type TasksFindResult = MinimalTask[];
108
114
 
@@ -416,3 +422,304 @@ export interface TasksCurrentResult {
416
422
  since?: string;
417
423
  sessionId?: string;
418
424
  }
425
+
426
+ // tasks.show (with optional history/ivtrHistory flags)
427
+ export interface TasksShowParams {
428
+ taskId: string;
429
+ /** When true, include task change history. */
430
+ history?: boolean;
431
+ /** When true, include IVTR phase history. */
432
+ ivtrHistory?: boolean;
433
+ }
434
+ export type TasksShowResult = unknown;
435
+
436
+ // tasks.tree dispatch params (with optional withBlockers flag — dispatch alias)
437
+ export interface TasksTreeDispatchParams {
438
+ taskId?: string;
439
+ withBlockers?: boolean;
440
+ }
441
+ export type TasksTreeDispatchResult = unknown;
442
+
443
+ // tasks.blockers dispatch params (with optional analyze/limit)
444
+ export interface TasksBlockersQueryParams {
445
+ analyze?: boolean;
446
+ limit?: number;
447
+ }
448
+ export type TasksBlockersQueryResult = unknown;
449
+
450
+ // tasks.depends (with action routing for overview/cycles)
451
+ export interface TasksDependsParams {
452
+ taskId?: string;
453
+ direction?: 'upstream' | 'downstream' | 'both';
454
+ tree?: boolean;
455
+ action?: 'overview' | 'cycles';
456
+ }
457
+ export type TasksDependsResult = unknown;
458
+
459
+ // tasks.analyze dispatch params (with optional taskId and tierLimit)
460
+ export interface TasksAnalyzeQueryParams {
461
+ taskId?: string;
462
+ tierLimit?: number;
463
+ }
464
+ export type TasksAnalyzeQueryResult = unknown;
465
+
466
+ // tasks.impact
467
+ export interface TasksImpactParams {
468
+ change: string;
469
+ matchLimit?: number;
470
+ }
471
+ export type TasksImpactResult = unknown;
472
+
473
+ // tasks.next dispatch params (with count and explain)
474
+ export interface TasksNextQueryParams {
475
+ count?: number;
476
+ explain?: boolean;
477
+ }
478
+ export type TasksNextQueryResult = unknown;
479
+
480
+ // tasks.plan
481
+ export type TasksPlanParams = Record<string, never>;
482
+ export type TasksPlanResult = unknown;
483
+
484
+ // tasks.relates (with mode routing for suggest/discover)
485
+ export interface TasksRelatesParams {
486
+ taskId: string;
487
+ mode?: 'suggest' | 'discover';
488
+ threshold?: number;
489
+ }
490
+ export type TasksRelatesResult = unknown;
491
+
492
+ // tasks.complexity.estimate
493
+ export interface TasksComplexityEstimateParams {
494
+ taskId: string;
495
+ }
496
+ export type TasksComplexityEstimateResult = unknown;
497
+
498
+ // tasks.history
499
+ export interface TasksHistoryParams {
500
+ taskId?: string;
501
+ limit?: number;
502
+ }
503
+ export type TasksHistoryResult = unknown;
504
+
505
+ // tasks.label.list
506
+ export type TasksLabelListParams = Record<string, never>;
507
+ export type TasksLabelListResult = unknown;
508
+
509
+ // tasks.sync.links
510
+ export interface TasksSyncLinksParams {
511
+ providerId?: string;
512
+ taskId?: string;
513
+ }
514
+ export type TasksSyncLinksResult = unknown;
515
+
516
+ // tasks.sync.reconcile
517
+ export interface TasksSyncReconcileParams {
518
+ providerId: string;
519
+ externalTasks: import('../task-sync.js').ExternalTask[];
520
+ dryRun?: boolean;
521
+ conflictPolicy?: string;
522
+ defaultPhase?: string;
523
+ defaultLabels?: string[];
524
+ }
525
+ export type TasksSyncReconcileResult = unknown;
526
+
527
+ // tasks.sync.links.remove
528
+ export interface TasksSyncLinksRemoveParams {
529
+ providerId: string;
530
+ }
531
+ export type TasksSyncLinksRemoveResult = unknown;
532
+
533
+ // tasks.cancel
534
+ export interface TasksCancelParams {
535
+ taskId: string;
536
+ reason?: string;
537
+ }
538
+ export type TasksCancelResult = unknown;
539
+
540
+ // tasks.restore (with from routing: done → reopen, archived → unarchive)
541
+ export interface TasksRestoreParams {
542
+ taskId: string;
543
+ from?: 'done' | 'archived';
544
+ status?: string;
545
+ reason?: string;
546
+ preserveStatus?: boolean;
547
+ cascade?: boolean;
548
+ notes?: string;
549
+ }
550
+ export type TasksRestoreResult = unknown;
551
+
552
+ // tasks.reparent (dispatch-level params include newParentId)
553
+ export interface TasksReparentQueryParams {
554
+ taskId: string;
555
+ /** New parent ID, or null/undefined to promote to root. */
556
+ newParentId: string | null | undefined;
557
+ }
558
+ export type TasksReparentDispatchResult = unknown;
559
+
560
+ // tasks.reorder (dispatch-level params)
561
+ export interface TasksReorderQueryParams {
562
+ taskId: string;
563
+ position: number;
564
+ }
565
+ export type TasksReorderDispatchResult = unknown;
566
+
567
+ // tasks.relates.add (accepts both relatedId and targetId aliases)
568
+ export interface TasksRelatesAddParams {
569
+ taskId: string;
570
+ relatedId?: string;
571
+ targetId?: string;
572
+ type: string;
573
+ reason?: string;
574
+ }
575
+ export type TasksRelatesAddResult = unknown;
576
+
577
+ // tasks.add (dispatch-level alias params — extends TasksCreateParams)
578
+ export interface TasksAddParams {
579
+ title: string;
580
+ description?: string;
581
+ parent?: string;
582
+ parentId?: string;
583
+ depends?: string[];
584
+ priority?: string;
585
+ labels?: string[];
586
+ type?: string;
587
+ acceptance?: string[];
588
+ phase?: string;
589
+ size?: string;
590
+ notes?: string;
591
+ files?: string[];
592
+ dryRun?: boolean;
593
+ parentSearch?: string;
594
+ role?: string;
595
+ kind?: string;
596
+ scope?: string;
597
+ severity?: string;
598
+ }
599
+ export type TasksAddResult = unknown;
600
+
601
+ // tasks.update (dispatch-level alias params — extends TasksUpdateParams)
602
+ export interface TasksUpdateQueryParams {
603
+ taskId: string;
604
+ title?: string;
605
+ description?: string;
606
+ status?: string;
607
+ priority?: string;
608
+ notes?: string;
609
+ note?: string;
610
+ labels?: string[];
611
+ addLabels?: string[];
612
+ removeLabels?: string[];
613
+ depends?: string[];
614
+ addDepends?: string[];
615
+ removeDepends?: string[];
616
+ acceptance?: string[];
617
+ parent?: string | null;
618
+ parentId?: string | null;
619
+ type?: string;
620
+ size?: string;
621
+ files?: string[];
622
+ pipelineStage?: string;
623
+ }
624
+ export type TasksUpdateQueryResult = unknown;
625
+
626
+ // tasks.complete (dispatch-level params)
627
+ export interface TasksCompleteQueryParams {
628
+ taskId: string;
629
+ notes?: string;
630
+ force?: unknown;
631
+ }
632
+ export type TasksCompleteQueryResult = unknown;
633
+
634
+ // tasks.delete (dispatch-level params)
635
+ export interface TasksDeleteQueryParams {
636
+ taskId: string;
637
+ force?: boolean;
638
+ }
639
+ export type TasksDeleteQueryResult = unknown;
640
+
641
+ // tasks.archive (dispatch-level params)
642
+ export interface TasksArchiveQueryParams {
643
+ taskId?: string;
644
+ before?: string;
645
+ taskIds?: string[];
646
+ includeCancelled?: boolean;
647
+ dryRun?: boolean;
648
+ }
649
+ export type TasksArchiveQueryResult = unknown;
650
+
651
+ // tasks.claim
652
+ export interface TasksClaimParams {
653
+ taskId: string;
654
+ agentId: string;
655
+ }
656
+ export type TasksClaimResult = unknown;
657
+
658
+ // tasks.unclaim
659
+ export interface TasksUnclaimParams {
660
+ taskId: string;
661
+ }
662
+ export type TasksUnclaimResult = unknown;
663
+
664
+ // tasks.start (dispatch-level)
665
+ export interface TasksStartQueryParams {
666
+ taskId: string;
667
+ }
668
+ export type TasksStartQueryResult = unknown;
669
+
670
+ // tasks.stop (dispatch-level)
671
+ export type TasksStopQueryParams = Record<string, never>;
672
+ export type TasksStopQueryResult = unknown;
673
+
674
+ // ---------------------------------------------------------------------------
675
+ // Typed operation record (Wave D adapter — T1425)
676
+ // ---------------------------------------------------------------------------
677
+
678
+ /**
679
+ * Typed operation record for the tasks domain.
680
+ *
681
+ * Maps each operation name (as dispatched by the registry — no domain prefix)
682
+ * to its `[Params, Result]` tuple. Used by `TypedDomainHandler<TasksOps>`
683
+ * in the dispatch layer to provide compile-time narrowing of params.
684
+ *
685
+ * @task T1425 — tasks typed-dispatch migration
686
+ */
687
+ export type TasksOps = {
688
+ // Query ops
689
+ readonly show: readonly [TasksShowParams, TasksShowResult];
690
+ readonly list: readonly [TasksListParams, TasksListResult];
691
+ readonly find: readonly [TasksFindParams, TasksFindResult];
692
+ readonly tree: readonly [TasksTreeDispatchParams, TasksTreeDispatchResult];
693
+ readonly blockers: readonly [TasksBlockersQueryParams, TasksBlockersQueryResult];
694
+ readonly depends: readonly [TasksDependsParams, TasksDependsResult];
695
+ readonly analyze: readonly [TasksAnalyzeQueryParams, TasksAnalyzeQueryResult];
696
+ readonly impact: readonly [TasksImpactParams, TasksImpactResult];
697
+ readonly next: readonly [TasksNextQueryParams, TasksNextQueryResult];
698
+ readonly plan: readonly [TasksPlanParams, TasksPlanResult];
699
+ readonly relates: readonly [TasksRelatesParams, TasksRelatesResult];
700
+ readonly 'complexity.estimate': readonly [
701
+ TasksComplexityEstimateParams,
702
+ TasksComplexityEstimateResult,
703
+ ];
704
+ readonly history: readonly [TasksHistoryParams, TasksHistoryResult];
705
+ readonly current: readonly [TasksCurrentParams, TasksCurrentResult];
706
+ readonly 'label.list': readonly [TasksLabelListParams, TasksLabelListResult];
707
+ readonly 'sync.links': readonly [TasksSyncLinksParams, TasksSyncLinksResult];
708
+ // Mutate ops
709
+ readonly add: readonly [TasksAddParams, TasksAddResult];
710
+ readonly update: readonly [TasksUpdateQueryParams, TasksUpdateQueryResult];
711
+ readonly complete: readonly [TasksCompleteQueryParams, TasksCompleteQueryResult];
712
+ readonly cancel: readonly [TasksCancelParams, TasksCancelResult];
713
+ readonly delete: readonly [TasksDeleteQueryParams, TasksDeleteQueryResult];
714
+ readonly archive: readonly [TasksArchiveQueryParams, TasksArchiveQueryResult];
715
+ readonly restore: readonly [TasksRestoreParams, TasksRestoreResult];
716
+ readonly reparent: readonly [TasksReparentQueryParams, TasksReparentDispatchResult];
717
+ readonly reorder: readonly [TasksReorderQueryParams, TasksReorderDispatchResult];
718
+ readonly 'relates.add': readonly [TasksRelatesAddParams, TasksRelatesAddResult];
719
+ readonly start: readonly [TasksStartQueryParams, TasksStartQueryResult];
720
+ readonly stop: readonly [TasksStopQueryParams, TasksStopQueryResult];
721
+ readonly 'sync.reconcile': readonly [TasksSyncReconcileParams, TasksSyncReconcileResult];
722
+ readonly 'sync.links.remove': readonly [TasksSyncLinksRemoveParams, TasksSyncLinksRemoveResult];
723
+ readonly claim: readonly [TasksClaimParams, TasksClaimResult];
724
+ readonly unclaim: readonly [TasksUnclaimParams, TasksUnclaimResult];
725
+ };
@@ -303,3 +303,49 @@ export interface ValidateComplianceSyncParams {
303
303
  force?: boolean;
304
304
  }
305
305
  export type ValidateComplianceSyncResult = Record<string, unknown>;
306
+
307
+ // ---------------------------------------------------------------------------
308
+ // Typed operation record (Wave D adapter — T975)
309
+ // ---------------------------------------------------------------------------
310
+
311
+ /**
312
+ * Typed operation record for the check domain.
313
+ *
314
+ * Maps each operation name (as dispatched by the registry — no domain prefix)
315
+ * to its `[Params, Result]` tuple. Used by `TypedDomainHandler<CheckOps>`
316
+ * in the dispatch layer to provide compile-time narrowing of params.
317
+ *
318
+ * @task T1423 — check typed narrowing (T975 follow-on)
319
+ */
320
+ export type CheckOps = {
321
+ readonly schema: readonly [ValidateSchemaParams, ValidateSchemaResult];
322
+ readonly task: readonly [ValidateTaskParams, ValidateTaskResult];
323
+ readonly manifest: readonly [ValidateManifestParams, ValidateManifestResult];
324
+ readonly output: readonly [ValidateOutputParams, ValidateOutputResult];
325
+ readonly 'compliance.summary': readonly [
326
+ ValidateComplianceSummaryParams,
327
+ ValidateComplianceSummaryResult,
328
+ ];
329
+ readonly 'compliance.record': readonly [
330
+ ValidateComplianceRecordParams,
331
+ ValidateComplianceRecordResult,
332
+ ];
333
+ readonly 'compliance.sync': readonly [ValidateComplianceSyncParams, ValidateComplianceSyncResult];
334
+ readonly test: readonly [ValidateTestStatusParams, ValidateTestStatusResult];
335
+ readonly 'test.run': readonly [ValidateTestRunParams, ValidateTestRunResult];
336
+ readonly 'test.coverage': readonly [ValidateTestCoverageParams, ValidateTestCoverageResult];
337
+ readonly coherence: readonly [ValidateCoherenceParams, ValidateCoherenceResult];
338
+ readonly 'gate.status': readonly [ValidateGateParams, ValidateGateResult];
339
+ readonly 'gate.set': readonly [ValidateGateParams, ValidateGateResult];
340
+ readonly 'verify.explain': readonly [ValidateVerifyExplainParams, ValidateVerifyExplainResult];
341
+ readonly 'archive.stats': readonly [ValidateArchiveStatsParams, ValidateArchiveStatsResult];
342
+ readonly 'chain.validate': readonly [ValidateChainParams, ValidateChainResult];
343
+ readonly grade: readonly [ValidateGradeParams, ValidateGradeResult];
344
+ readonly 'grade.list': readonly [ValidateGradeListParams, ValidateGradeListResult];
345
+ readonly canon: readonly [ValidateCanonParams, ValidateCanonResult];
346
+ readonly 'workflow.compliance': readonly [
347
+ ValidateWorkflowComplianceParams,
348
+ ValidateWorkflowComplianceResult,
349
+ ];
350
+ readonly protocol: readonly [ValidateProtocolParams, ValidateProtocolResult];
351
+ };