@cleocode/contracts 2026.9.8 → 2026.9.9

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 (151) hide show
  1. package/dist/__tests__/acceptance-gate.test.js +242 -1
  2. package/dist/__tests__/acceptance-gate.test.js.map +1 -1
  3. package/dist/__tests__/evidence-atom-schema.test.js +17 -14
  4. package/dist/__tests__/evidence-atom-schema.test.js.map +1 -1
  5. package/dist/__tests__/memory-wire-shapes.test.js.map +1 -1
  6. package/dist/__tests__/operations-registry.test.js +18 -0
  7. package/dist/__tests__/operations-registry.test.js.map +1 -1
  8. package/dist/acceptance-gate-schema.d.ts +60 -2
  9. package/dist/acceptance-gate-schema.d.ts.map +1 -1
  10. package/dist/acceptance-gate-schema.js +273 -1
  11. package/dist/acceptance-gate-schema.js.map +1 -1
  12. package/dist/acceptance-gate.d.ts +122 -11
  13. package/dist/acceptance-gate.d.ts.map +1 -1
  14. package/dist/acceptance-gate.js +3 -3
  15. package/dist/audit.d.ts +71 -2
  16. package/dist/audit.d.ts.map +1 -1
  17. package/dist/backup-manifest.d.ts +80 -0
  18. package/dist/backup-manifest.d.ts.map +1 -1
  19. package/dist/caamp-markers.d.ts +20 -0
  20. package/dist/caamp-markers.d.ts.map +1 -1
  21. package/dist/capabilities.d.ts +282 -0
  22. package/dist/capabilities.d.ts.map +1 -1
  23. package/dist/changesets.d.ts +4 -4
  24. package/dist/code-symbol.d.ts +33 -0
  25. package/dist/code-symbol.d.ts.map +1 -1
  26. package/dist/daemon/health.d.ts +3 -3
  27. package/dist/data-accessor.d.ts +15 -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__/tasks-gateway-crud-ops.test.js +19 -1
  31. package/dist/dispatch/__tests__/tasks-gateway-crud-ops.test.js.map +1 -1
  32. package/dist/dispatch/operations-registry.d.ts.map +1 -1
  33. package/dist/dispatch/operations-registry.js +684 -3
  34. package/dist/dispatch/operations-registry.js.map +1 -1
  35. package/dist/docs-taxonomy.d.ts +25 -0
  36. package/dist/docs-taxonomy.d.ts.map +1 -1
  37. package/dist/docs-taxonomy.js.map +1 -1
  38. package/dist/evidence-atom-schema.d.ts +7 -6
  39. package/dist/evidence-atom-schema.d.ts.map +1 -1
  40. package/dist/evidence-atom-schema.js +10 -9
  41. package/dist/evidence-atom-schema.js.map +1 -1
  42. package/dist/graph.d.ts +283 -2
  43. package/dist/graph.d.ts.map +1 -1
  44. package/dist/index.d.ts +6 -5
  45. package/dist/index.d.ts.map +1 -1
  46. package/dist/index.js.map +1 -1
  47. package/dist/invariants/adr-070-orchestration.d.ts.map +1 -1
  48. package/dist/invariants/adr-070-orchestration.js +1 -1
  49. package/dist/invariants/adr-070-orchestration.js.map +1 -1
  50. package/dist/invariants/adr-073-saga.js +2 -2
  51. package/dist/invariants/adr-073-saga.js.map +1 -1
  52. package/dist/jobs.d.ts +329 -3
  53. package/dist/jobs.d.ts.map +1 -1
  54. package/dist/knowledge-health.d.ts +695 -0
  55. package/dist/knowledge-health.d.ts.map +1 -0
  56. package/dist/knowledge-health.js +8 -0
  57. package/dist/knowledge-health.js.map +1 -0
  58. package/dist/llm/catalog-schema.d.ts +4 -4
  59. package/dist/memory/observe.d.ts +4 -2
  60. package/dist/memory/observe.d.ts.map +1 -1
  61. package/dist/memory/search.d.ts +4 -0
  62. package/dist/memory/search.d.ts.map +1 -1
  63. package/dist/nexus-living-brain-ops.d.ts +28 -3
  64. package/dist/nexus-living-brain-ops.d.ts.map +1 -1
  65. package/dist/nexus-tasks-bridge-ops.d.ts +11 -0
  66. package/dist/nexus-tasks-bridge-ops.d.ts.map +1 -1
  67. package/dist/operations/admin.d.ts +10 -4
  68. package/dist/operations/admin.d.ts.map +1 -1
  69. package/dist/operations/docs.d.ts +138 -0
  70. package/dist/operations/docs.d.ts.map +1 -1
  71. package/dist/operations/docs.js +47 -0
  72. package/dist/operations/docs.js.map +1 -1
  73. package/dist/operations/focus.d.ts +7 -0
  74. package/dist/operations/focus.d.ts.map +1 -1
  75. package/dist/operations/nexus.d.ts +7 -2
  76. package/dist/operations/nexus.d.ts.map +1 -1
  77. package/dist/operations/output-contracts-data.d.ts.map +1 -1
  78. package/dist/operations/output-contracts-data.js +31 -3
  79. package/dist/operations/output-contracts-data.js.map +1 -1
  80. package/dist/operations/research.d.ts +33 -0
  81. package/dist/operations/research.d.ts.map +1 -1
  82. package/dist/operations/tasks.d.ts +107 -4
  83. package/dist/operations/tasks.d.ts.map +1 -1
  84. package/dist/operations/tasks.js +5 -0
  85. package/dist/operations/tasks.js.map +1 -1
  86. package/dist/package-artifact.d.ts +112 -0
  87. package/dist/package-artifact.d.ts.map +1 -0
  88. package/dist/package-artifact.js +8 -0
  89. package/dist/package-artifact.js.map +1 -0
  90. package/dist/release/evidence-atoms.d.ts +10 -0
  91. package/dist/release/evidence-atoms.d.ts.map +1 -1
  92. package/dist/release/evidence-atoms.js +6 -0
  93. package/dist/release/evidence-atoms.js.map +1 -1
  94. package/dist/release/plan.d.ts +6 -6
  95. package/dist/resource-governor.d.ts +114 -0
  96. package/dist/resource-governor.d.ts.map +1 -1
  97. package/dist/resource-governor.js.map +1 -1
  98. package/dist/supervisor-ipc/messages.d.ts +6 -6
  99. package/dist/task-record.d.ts +25 -4
  100. package/dist/task-record.d.ts.map +1 -1
  101. package/dist/task.d.ts +55 -36
  102. package/dist/task.d.ts.map +1 -1
  103. package/dist/task.js.map +1 -1
  104. package/dist/tasks/archive.d.ts +3 -3
  105. package/dist/templates/manifest.d.ts +1 -1
  106. package/dist/workgraph.d.ts +5 -3
  107. package/dist/workgraph.d.ts.map +1 -1
  108. package/dist/workgraph.js +19 -0
  109. package/dist/workgraph.js.map +1 -1
  110. package/package.json +2 -2
  111. package/schemas/gate-result.schema.json +350 -1
  112. package/src/__tests__/__snapshots__/operations-registry.test.ts.snap +1 -1
  113. package/src/__tests__/acceptance-gate.test.ts +282 -1
  114. package/src/__tests__/evidence-atom-schema.test.ts +17 -14
  115. package/src/__tests__/memory-wire-shapes.test.ts +2 -0
  116. package/src/__tests__/operations-registry.test.ts +26 -0
  117. package/src/acceptance-gate-schema.ts +320 -14
  118. package/src/acceptance-gate.ts +133 -11
  119. package/src/audit.ts +72 -2
  120. package/src/backup-manifest.ts +88 -0
  121. package/src/caamp-markers.ts +22 -0
  122. package/src/capabilities.ts +311 -0
  123. package/src/code-symbol.ts +37 -0
  124. package/src/data-accessor.ts +16 -0
  125. package/src/dispatch/__tests__/tasks-gateway-crud-ops.test.ts +31 -1
  126. package/src/dispatch/operations-registry.ts +689 -3
  127. package/src/docs-taxonomy.ts +26 -0
  128. package/src/evidence-atom-schema.ts +10 -9
  129. package/src/graph.ts +326 -2
  130. package/src/index.ts +43 -1
  131. package/src/invariants/adr-070-orchestration.ts +2 -1
  132. package/src/invariants/adr-073-saga.ts +2 -2
  133. package/src/jobs.ts +382 -3
  134. package/src/knowledge-health.ts +748 -0
  135. package/src/memory/observe.ts +4 -2
  136. package/src/memory/search.ts +4 -0
  137. package/src/nexus-living-brain-ops.ts +34 -3
  138. package/src/nexus-tasks-bridge-ops.ts +12 -0
  139. package/src/operations/admin.ts +11 -4
  140. package/src/operations/docs.ts +153 -0
  141. package/src/operations/focus.ts +11 -0
  142. package/src/operations/nexus.ts +7 -1
  143. package/src/operations/output-contracts-data.ts +33 -3
  144. package/src/operations/research.ts +36 -0
  145. package/src/operations/tasks.ts +116 -4
  146. package/src/package-artifact.ts +127 -0
  147. package/src/release/evidence-atoms.ts +6 -0
  148. package/src/resource-governor.ts +132 -0
  149. package/src/task-record.ts +27 -4
  150. package/src/task.ts +58 -36
  151. package/src/workgraph.ts +19 -0
@@ -48,8 +48,138 @@ export function defineDomain(_domain: CanonicalDomain, ops: OperationDef[]): Ope
48
48
  // OPERATIONS — the authoritative registry data
49
49
  // ---------------------------------------------------------------------------
50
50
 
51
+ // Requirement commands carry JSON on the wire; the SDK validates the typed gate.
52
+ const requirementTaskParam: ParamDef = {
53
+ name: 'taskId',
54
+ type: 'string',
55
+ required: true,
56
+ description: 'Task that owns the requirement gates',
57
+ cli: { positional: true },
58
+ };
59
+
51
60
  /** The single source of truth for all operations in CLEO. */
52
61
  export const OPERATIONS: OperationDef[] = [
62
+ {
63
+ gateway: 'mutate',
64
+ domain: 'tasks',
65
+ operation: 'req.add',
66
+ description: 'Add a validated typed requirement gate without executing it',
67
+ tier: 1,
68
+ idempotent: false,
69
+ sessionRequired: true,
70
+ requiredParams: ['taskId', 'gate'],
71
+ params: [
72
+ requirementTaskParam,
73
+ {
74
+ name: 'gate',
75
+ type: 'string',
76
+ required: true,
77
+ description: 'AcceptanceGate JSON; must include kind, description and kind-specific fields',
78
+ cli: { flag: 'gate' },
79
+ },
80
+ ],
81
+ inputSchema: {
82
+ operation: 'tasks.req.add',
83
+ schema: {
84
+ type: 'object',
85
+ required: ['taskId', 'gate'],
86
+ additionalProperties: false,
87
+ properties: {
88
+ taskId: { type: 'string', minLength: 1 },
89
+ gate: { type: 'string', minLength: 1 },
90
+ },
91
+ },
92
+ examples: [
93
+ {
94
+ name: 'test',
95
+ value: {
96
+ taskId: 'T121',
97
+ gate: '{"kind":"test","command":"node","args":["verify.mjs"],"expect":"exit0","description":"Task harness passes","req":"PARTNER-121"}',
98
+ },
99
+ },
100
+ ],
101
+ },
102
+ },
103
+ {
104
+ gateway: 'query',
105
+ domain: 'tasks',
106
+ operation: 'req.list',
107
+ description: 'List named typed requirement gates without executing them',
108
+ tier: 1,
109
+ idempotent: true,
110
+ sessionRequired: false,
111
+ requiredParams: ['taskId'],
112
+ params: [requirementTaskParam],
113
+ inputSchema: {
114
+ operation: 'tasks.req.list',
115
+ schema: {
116
+ type: 'object',
117
+ required: ['taskId'],
118
+ additionalProperties: false,
119
+ properties: { taskId: { type: 'string', minLength: 1 } },
120
+ },
121
+ examples: [{ name: 'task', value: { taskId: 'T121' } }],
122
+ },
123
+ },
124
+ {
125
+ gateway: 'query',
126
+ domain: 'tasks',
127
+ operation: 'req.migrate.preview',
128
+ description: 'Preview typed-gate migration proposals without writing',
129
+ tier: 1,
130
+ idempotent: true,
131
+ sessionRequired: false,
132
+ requiredParams: ['taskId'],
133
+ params: [
134
+ requirementTaskParam,
135
+ {
136
+ name: 'apply',
137
+ type: 'boolean',
138
+ required: false,
139
+ description: 'Must be absent or false for preview',
140
+ },
141
+ ],
142
+ inputSchema: {
143
+ operation: 'tasks.req.migrate.preview',
144
+ schema: {
145
+ type: 'object',
146
+ required: ['taskId'],
147
+ additionalProperties: false,
148
+ properties: { taskId: { type: 'string', minLength: 1 }, apply: { const: false } },
149
+ },
150
+ examples: [{ name: 'preview', value: { taskId: 'T121', apply: false } }],
151
+ },
152
+ },
153
+ {
154
+ gateway: 'mutate',
155
+ domain: 'tasks',
156
+ operation: 'req.migrate',
157
+ description: 'Explicitly apply validated typed-gate migration proposals',
158
+ tier: 1,
159
+ idempotent: false,
160
+ sessionRequired: true,
161
+ requiredParams: ['taskId', 'apply'],
162
+ params: [
163
+ requirementTaskParam,
164
+ {
165
+ name: 'apply',
166
+ type: 'boolean',
167
+ required: true,
168
+ description: 'Must be true to apply proposals',
169
+ cli: { flag: 'apply' },
170
+ },
171
+ ],
172
+ inputSchema: {
173
+ operation: 'tasks.req.migrate',
174
+ schema: {
175
+ type: 'object',
176
+ required: ['taskId', 'apply'],
177
+ additionalProperties: false,
178
+ properties: { taskId: { type: 'string', minLength: 1 }, apply: { const: true } },
179
+ },
180
+ examples: [{ name: 'apply', value: { taskId: 'T121', apply: true } }],
181
+ },
182
+ },
53
183
  {
54
184
  gateway: 'query',
55
185
  domain: 'tasks',
@@ -288,6 +418,13 @@ export const OPERATIONS: OperationDef[] = [
288
418
  sessionRequired: false,
289
419
  requiredParams: [],
290
420
  params: [
421
+ {
422
+ name: 'includeArchive',
423
+ type: 'boolean',
424
+ required: false,
425
+ description: 'Include archived rows under the same filters',
426
+ cli: { flag: 'include-archive' },
427
+ },
291
428
  { name: 'parent', type: 'string', required: false, description: 'Filter by parent task ID' },
292
429
  { name: 'status', type: 'string', required: false, description: 'Filter by task status' },
293
430
  { name: 'priority', type: 'string', required: false, description: 'Filter by task priority' },
@@ -319,7 +456,7 @@ export const OPERATIONS: OperationDef[] = [
319
456
  type: 'number',
320
457
  required: false,
321
458
  description:
322
- 'Maximum number of tasks to return (default 10). Use --all to return every match. (--limit 0 also returns every match, but only on this command — prefer --all.)',
459
+ 'Maximum number of tasks to return (default 10). --all or --limit 0 returns every match.',
323
460
  },
324
461
  {
325
462
  name: 'offset',
@@ -2497,7 +2634,7 @@ export const OPERATIONS: OperationDef[] = [
2497
2634
  type: 'string',
2498
2635
  required: false,
2499
2636
  description: 'Task type',
2500
- enum: ['epic', 'task', 'subtask'] as const,
2637
+ enum: ['saga', 'epic', 'task', 'subtask'] as const,
2501
2638
  cli: { flag: 'type', short: '-t' },
2502
2639
  },
2503
2640
  {
@@ -2550,6 +2687,73 @@ export const OPERATIONS: OperationDef[] = [
2550
2687
  description: 'Initial note entry for the task',
2551
2688
  cli: { flag: 'notes' },
2552
2689
  },
2690
+ {
2691
+ name: 'dependsWaiver',
2692
+ type: 'string',
2693
+ required: false,
2694
+ description: 'Nonempty reason waiving dependencies for explicit critical priority',
2695
+ cli: { flag: 'depends-waiver' },
2696
+ },
2697
+ {
2698
+ name: 'files',
2699
+ type: 'array',
2700
+ required: false,
2701
+ description: 'Associated repository file paths',
2702
+ cli: { flag: 'files' },
2703
+ },
2704
+ {
2705
+ name: 'dryRun',
2706
+ type: 'boolean',
2707
+ required: false,
2708
+ description: 'Preview creation without task or committed audit writes',
2709
+ cli: { flag: 'dry-run' },
2710
+ },
2711
+ {
2712
+ name: 'parentSearch',
2713
+ type: 'string',
2714
+ required: false,
2715
+ description: 'Search term for resolving the parent task',
2716
+ cli: { flag: 'parent-search' },
2717
+ },
2718
+ {
2719
+ name: 'kind',
2720
+ type: 'string',
2721
+ required: false,
2722
+ description: 'Task intent, independent of hierarchy',
2723
+ enum: ['work', 'research', 'experiment', 'bug', 'spike', 'release'] as const,
2724
+ cli: { flag: 'kind' },
2725
+ },
2726
+ {
2727
+ name: 'scope',
2728
+ type: 'string',
2729
+ required: false,
2730
+ description: 'Task granularity',
2731
+ enum: ['project', 'feature', 'unit'] as const,
2732
+ cli: { flag: 'scope' },
2733
+ },
2734
+ {
2735
+ name: 'severity',
2736
+ type: 'string',
2737
+ required: false,
2738
+ description: 'Project-authorized severity with transactional signed evidence',
2739
+ enum: ['P0', 'P1', 'P2', 'P3'] as const,
2740
+ cli: { flag: 'severity' },
2741
+ },
2742
+ {
2743
+ name: 'forceDuplicate',
2744
+ type: 'boolean',
2745
+ required: false,
2746
+ description: 'Bypass duplicate rejection with committed decision provenance',
2747
+ cli: { flag: 'force-duplicate' },
2748
+ },
2749
+ {
2750
+ name: 'autoDecompose',
2751
+ type: 'boolean',
2752
+ required: false,
2753
+ description:
2754
+ "Move the parent's text acceptance criteria onto a new first subtask when they would otherwise block this add (PM-Core V2 design-point 3) (T12298)",
2755
+ cli: { flag: 'auto-decompose' },
2756
+ },
2553
2757
  ] satisfies ParamDef[],
2554
2758
  },
2555
2759
  {
@@ -2785,6 +2989,20 @@ export const OPERATIONS: OperationDef[] = [
2785
2989
  required: false,
2786
2990
  description: 'Remove related-task edges by taskId',
2787
2991
  },
2992
+ {
2993
+ name: 'phase',
2994
+ type: 'string',
2995
+ required: false,
2996
+ description: 'Project-defined phase, independent of pipeline stage',
2997
+ cli: { flag: 'phase' },
2998
+ },
2999
+ {
3000
+ name: 'noAutoComplete',
3001
+ type: 'boolean',
3002
+ required: false,
3003
+ description: 'Disable automatic parent completion',
3004
+ cli: { flag: 'no-auto-complete' },
3005
+ },
2788
3006
  ] satisfies ParamDef[],
2789
3007
  inputSchema: tasksUpdateInputContract,
2790
3008
  outputSchema: OUTPUT_CONTRACTS['tasks.update'],
@@ -2856,6 +3074,90 @@ export const OPERATIONS: OperationDef[] = [
2856
3074
  description: 'taskId parameter',
2857
3075
  cli: { positional: true },
2858
3076
  },
3077
+ {
3078
+ name: 'force',
3079
+ type: 'boolean',
3080
+ required: false,
3081
+ description: 'Allow dependents and orphan children unless cascade is enabled',
3082
+ },
3083
+ {
3084
+ name: 'cascade',
3085
+ type: 'boolean',
3086
+ required: false,
3087
+ description: 'Archive all descendants with the selected task',
3088
+ },
3089
+ ] satisfies ParamDef[],
3090
+ },
3091
+ {
3092
+ gateway: 'mutate',
3093
+ domain: 'tasks',
3094
+ operation: 'reconcile-scope',
3095
+ description:
3096
+ 'tasks.reconcile-scope (mutate) — sweep a saga/epic subtree for tasks whose scope overlaps and propose merge/absorb/split/link; read-only unless --apply',
3097
+ tier: 1,
3098
+ idempotent: true,
3099
+ sessionRequired: false,
3100
+ requiredParams: ['rootId'],
3101
+ params: [
3102
+ {
3103
+ name: 'rootId',
3104
+ type: 'string',
3105
+ required: true,
3106
+ description: 'Saga, epic or other container to sweep (its whole subtree is considered)',
3107
+ cli: { positional: true },
3108
+ },
3109
+ {
3110
+ name: 'apply',
3111
+ type: 'boolean',
3112
+ required: false,
3113
+ description: 'Write the proposed `relates` edges (read-only without it)',
3114
+ cli: { flag: 'apply' },
3115
+ },
3116
+ {
3117
+ name: 'threshold',
3118
+ type: 'number',
3119
+ required: false,
3120
+ description: 'Report pairs at or above this similarity score, 0-1 (default 0.55)',
3121
+ cli: { flag: 'threshold' },
3122
+ },
3123
+ ] satisfies ParamDef[],
3124
+ },
3125
+ {
3126
+ gateway: 'mutate',
3127
+ domain: 'tasks',
3128
+ operation: 'decompose',
3129
+ description:
3130
+ 'tasks.decompose (mutate) — move a task’s free-text acceptance criteria onto a new first child, turning the leaf into a container (PM-Core V2 design-point 3)',
3131
+ tier: 1,
3132
+ idempotent: false,
3133
+ sessionRequired: false,
3134
+ requiredParams: ['taskId'],
3135
+ params: [
3136
+ {
3137
+ name: 'taskId',
3138
+ type: 'string',
3139
+ required: true,
3140
+ description: 'Task whose text acceptance criteria move to a new child',
3141
+ cli: { positional: true },
3142
+ },
3143
+ {
3144
+ name: 'childTitle',
3145
+ type: 'string',
3146
+ required: false,
3147
+ description: 'Title for the child that inherits the criteria (default: the parent’s)',
3148
+ },
3149
+ {
3150
+ name: 'childDescription',
3151
+ type: 'string',
3152
+ required: false,
3153
+ description: 'Description for the child (default: the parent’s)',
3154
+ },
3155
+ {
3156
+ name: 'dryRun',
3157
+ type: 'boolean',
3158
+ required: false,
3159
+ description: 'Preview the move without writing',
3160
+ },
2859
3161
  ] satisfies ParamDef[],
2860
3162
  },
2861
3163
  {
@@ -4402,7 +4704,28 @@ export const OPERATIONS: OperationDef[] = [
4402
4704
  idempotent: false,
4403
4705
  sessionRequired: false,
4404
4706
  requiredParams: [],
4405
- params: [],
4707
+ params: [
4708
+ {
4709
+ name: 'source',
4710
+ type: 'string',
4711
+ required: false,
4712
+ description: 'Source of the reviewed backfill request.',
4713
+ },
4714
+ { name: 'kind', type: 'string', required: false, description: 'Backfill classification.' },
4715
+ {
4716
+ name: 'targetTable',
4717
+ type: 'string',
4718
+ required: false,
4719
+ description: 'Derived brain_page_nodes target only.',
4720
+ },
4721
+ {
4722
+ name: 'nodeIds',
4723
+ type: 'array',
4724
+ required: false,
4725
+ description:
4726
+ 'Exact qualified graph node IDs to stage; all must resolve to missing, eligible typed sources.',
4727
+ },
4728
+ ],
4406
4729
  },
4407
4730
  {
4408
4731
  gateway: 'mutate',
@@ -7555,6 +7878,369 @@ export const OPERATIONS: OperationDef[] = [
7555
7878
  },
7556
7879
  ],
7557
7880
  },
7881
+ {
7882
+ gateway: 'query',
7883
+ domain: 'docs',
7884
+ operation: 'status',
7885
+ description: 'docs.status (query) — inspect published documentation drift',
7886
+ tier: 1,
7887
+ idempotent: true,
7888
+ sessionRequired: false,
7889
+ requiredParams: [],
7890
+ params: [],
7891
+ },
7892
+ {
7893
+ gateway: 'query',
7894
+ domain: 'docs',
7895
+ operation: 'export',
7896
+ description: 'docs.export (query) — Export a task document',
7897
+ tier: 1,
7898
+ idempotent: true,
7899
+ sessionRequired: false,
7900
+ requiredParams: ['taskId'],
7901
+ params: [
7902
+ {
7903
+ name: 'taskId',
7904
+ type: 'string' as const,
7905
+ required: true,
7906
+ description: 'Task whose document to export',
7907
+ },
7908
+ {
7909
+ name: 'includeAttachments',
7910
+ type: 'boolean' as const,
7911
+ required: false,
7912
+ description: 'Include attachment manifest',
7913
+ },
7914
+ {
7915
+ name: 'includeMemoryRefs',
7916
+ type: 'boolean' as const,
7917
+ required: false,
7918
+ description: 'Include memory references',
7919
+ },
7920
+ ],
7921
+ },
7922
+ {
7923
+ gateway: 'query',
7924
+ domain: 'docs',
7925
+ operation: 'search',
7926
+ description: 'docs.search (query) — Search document content',
7927
+ tier: 1,
7928
+ idempotent: true,
7929
+ sessionRequired: false,
7930
+ requiredParams: ['query'],
7931
+ params: [
7932
+ {
7933
+ name: 'query',
7934
+ type: 'string' as const,
7935
+ required: true,
7936
+ description: 'Document search text',
7937
+ },
7938
+ {
7939
+ name: 'ownerId',
7940
+ type: 'string' as const,
7941
+ required: false,
7942
+ description: 'Optional owner scope',
7943
+ },
7944
+ { name: 'limit', type: 'number' as const, required: false, description: 'Maximum matches' },
7945
+ {
7946
+ name: 'type',
7947
+ type: 'string' as const,
7948
+ required: false,
7949
+ description: 'Document kind filter',
7950
+ },
7951
+ ],
7952
+ },
7953
+ {
7954
+ gateway: 'query',
7955
+ domain: 'docs',
7956
+ operation: 'find',
7957
+ description: 'docs.find (query) — Find similar documents',
7958
+ tier: 1,
7959
+ idempotent: true,
7960
+ sessionRequired: false,
7961
+ requiredParams: ['similarSlug'],
7962
+ params: [
7963
+ {
7964
+ name: 'similarSlug',
7965
+ type: 'string' as const,
7966
+ required: true,
7967
+ description: 'Existing document slug to compare',
7968
+ },
7969
+ { name: 'limit', type: 'number' as const, required: false, description: 'Maximum matches' },
7970
+ {
7971
+ name: 'threshold',
7972
+ type: 'number' as const,
7973
+ required: false,
7974
+ description: 'Minimum similarity',
7975
+ },
7976
+ {
7977
+ name: 'allKinds',
7978
+ type: 'boolean' as const,
7979
+ required: false,
7980
+ description: 'Compare all document kinds',
7981
+ },
7982
+ ],
7983
+ },
7984
+ {
7985
+ gateway: 'query',
7986
+ domain: 'docs',
7987
+ operation: 'merge',
7988
+ description: 'docs.merge (query) — Preview a document merge',
7989
+ tier: 1,
7990
+ idempotent: true,
7991
+ sessionRequired: false,
7992
+ requiredParams: ['attA', 'attB'],
7993
+ params: [
7994
+ {
7995
+ name: 'attA',
7996
+ type: 'string' as const,
7997
+ required: true,
7998
+ description: 'First attachment reference',
7999
+ },
8000
+ {
8001
+ name: 'attB',
8002
+ type: 'string' as const,
8003
+ required: true,
8004
+ description: 'Second attachment reference',
8005
+ },
8006
+ {
8007
+ name: 'strategy',
8008
+ type: 'string' as const,
8009
+ required: false,
8010
+ description: 'three-way, cherry-pick, or multi-diff',
8011
+ },
8012
+ {
8013
+ name: 'base',
8014
+ type: 'string' as const,
8015
+ required: false,
8016
+ description: 'Common ancestor attachment reference',
8017
+ },
8018
+ ],
8019
+ },
8020
+ {
8021
+ gateway: 'query',
8022
+ domain: 'docs',
8023
+ operation: 'rank',
8024
+ description: 'docs.rank (query) — Rank owner documents',
8025
+ tier: 1,
8026
+ idempotent: true,
8027
+ sessionRequired: false,
8028
+ requiredParams: ['ownerId'],
8029
+ params: [
8030
+ {
8031
+ name: 'ownerId',
8032
+ type: 'string' as const,
8033
+ required: true,
8034
+ description: 'Owner whose documents to rank',
8035
+ },
8036
+ {
8037
+ name: 'query',
8038
+ type: 'string' as const,
8039
+ required: false,
8040
+ description: 'Optional ranking query',
8041
+ },
8042
+ ],
8043
+ },
8044
+ {
8045
+ gateway: 'query',
8046
+ domain: 'docs',
8047
+ operation: 'versions',
8048
+ description: 'docs.versions (query) — List document versions',
8049
+ tier: 1,
8050
+ idempotent: true,
8051
+ sessionRequired: false,
8052
+ requiredParams: ['ownerId'],
8053
+ params: [
8054
+ { name: 'ownerId', type: 'string' as const, required: true, description: 'Document owner' },
8055
+ {
8056
+ name: 'name',
8057
+ type: 'string' as const,
8058
+ required: false,
8059
+ description: 'Optional document name',
8060
+ },
8061
+ ],
8062
+ },
8063
+ {
8064
+ gateway: 'mutate',
8065
+ domain: 'docs',
8066
+ operation: 'publish',
8067
+ description: 'docs.publish (mutate) — Publish a document to a file or pull request',
8068
+ tier: 1,
8069
+ idempotent: false,
8070
+ sessionRequired: false,
8071
+ requiredParams: [],
8072
+ params: [
8073
+ {
8074
+ name: 'target',
8075
+ type: 'string' as const,
8076
+ required: false,
8077
+ description: 'Publication target: file or pr',
8078
+ },
8079
+ {
8080
+ name: 'ownerId',
8081
+ type: 'string' as const,
8082
+ required: false,
8083
+ description: 'Required for file publication',
8084
+ },
8085
+ {
8086
+ name: 'toPath',
8087
+ type: 'string' as const,
8088
+ required: false,
8089
+ description: 'Required destination for file publication',
8090
+ },
8091
+ {
8092
+ name: 'attachmentId',
8093
+ type: 'string' as const,
8094
+ required: false,
8095
+ description: 'Attachment to publish',
8096
+ },
8097
+ {
8098
+ name: 'slugOrId',
8099
+ type: 'string' as const,
8100
+ required: false,
8101
+ description: 'Required document reference for PR publication',
8102
+ },
8103
+ {
8104
+ name: 'slug',
8105
+ type: 'string' as const,
8106
+ required: false,
8107
+ description: 'Override document slug',
8108
+ },
8109
+ {
8110
+ name: 'type',
8111
+ type: 'string' as const,
8112
+ required: false,
8113
+ description: 'Override document kind',
8114
+ },
8115
+ { name: 'title', type: 'string' as const, required: false, description: 'Override PR title' },
8116
+ { name: 'body', type: 'string' as const, required: false, description: 'Override PR body' },
8117
+ { name: 'base', type: 'string' as const, required: false, description: 'PR base branch' },
8118
+ ],
8119
+ },
8120
+ {
8121
+ gateway: 'mutate',
8122
+ domain: 'docs',
8123
+ operation: 'publish-pr',
8124
+ description: 'docs.publish-pr (mutate) — Legacy alias for PR publication',
8125
+ tier: 1,
8126
+ idempotent: false,
8127
+ sessionRequired: false,
8128
+ requiredParams: ['slugOrId'],
8129
+ params: [
8130
+ {
8131
+ name: 'slugOrId',
8132
+ type: 'string' as const,
8133
+ required: true,
8134
+ description: 'Document reference to publish',
8135
+ },
8136
+ {
8137
+ name: 'slug',
8138
+ type: 'string' as const,
8139
+ required: false,
8140
+ description: 'Override document slug',
8141
+ },
8142
+ {
8143
+ name: 'type',
8144
+ type: 'string' as const,
8145
+ required: false,
8146
+ description: 'Override document kind',
8147
+ },
8148
+ { name: 'title', type: 'string' as const, required: false, description: 'Override PR title' },
8149
+ { name: 'body', type: 'string' as const, required: false, description: 'Override PR body' },
8150
+ { name: 'base', type: 'string' as const, required: false, description: 'PR base branch' },
8151
+ ],
8152
+ },
8153
+ {
8154
+ gateway: 'mutate',
8155
+ domain: 'docs',
8156
+ operation: 'sync',
8157
+ description: 'docs.sync (mutate) — Sync document content from a file',
8158
+ tier: 1,
8159
+ idempotent: false,
8160
+ sessionRequired: false,
8161
+ requiredParams: ['ownerId', 'fromPath'],
8162
+ params: [
8163
+ { name: 'ownerId', type: 'string' as const, required: true, description: 'Document owner' },
8164
+ {
8165
+ name: 'fromPath',
8166
+ type: 'string' as const,
8167
+ required: true,
8168
+ description: 'Source file path',
8169
+ },
8170
+ {
8171
+ name: 'blobName',
8172
+ type: 'string' as const,
8173
+ required: false,
8174
+ description: 'Document blob name',
8175
+ },
8176
+ {
8177
+ name: 'contentType',
8178
+ type: 'string' as const,
8179
+ required: false,
8180
+ description: 'Document media type',
8181
+ },
8182
+ ],
8183
+ },
8184
+ {
8185
+ gateway: 'mutate',
8186
+ domain: 'docs',
8187
+ operation: 'import',
8188
+ description: 'docs.import (mutate) — Import classified project documents',
8189
+ tier: 1,
8190
+ idempotent: false,
8191
+ sessionRequired: false,
8192
+ requiredParams: ['scanRoot'],
8193
+ params: [
8194
+ {
8195
+ name: 'scanRoot',
8196
+ type: 'string' as const,
8197
+ required: true,
8198
+ description: 'Root directory to scan',
8199
+ },
8200
+ {
8201
+ name: 'dryRun',
8202
+ type: 'boolean' as const,
8203
+ required: false,
8204
+ description: 'Preview without writing',
8205
+ },
8206
+ {
8207
+ name: 'force',
8208
+ type: 'boolean' as const,
8209
+ required: false,
8210
+ description: 'Replace conflicting import mappings',
8211
+ },
8212
+ {
8213
+ name: 'manifestPath',
8214
+ type: 'string' as const,
8215
+ required: false,
8216
+ description: 'Import manifest path',
8217
+ },
8218
+ ],
8219
+ },
8220
+ {
8221
+ gateway: 'query',
8222
+ domain: 'docs',
8223
+ operation: 'audit',
8224
+ description: 'docs.audit (query) — inspect document history or verify audit chain integrity',
8225
+ tier: 1,
8226
+ idempotent: true,
8227
+ sessionRequired: false,
8228
+ requiredParams: [],
8229
+ params: [
8230
+ {
8231
+ name: 'slug',
8232
+ type: 'string' as const,
8233
+ required: false,
8234
+ description: 'Document slug whose history to inspect',
8235
+ },
8236
+ {
8237
+ name: 'verify',
8238
+ type: 'boolean' as const,
8239
+ required: false,
8240
+ description: 'Verify the full audit chain',
8241
+ },
8242
+ ],
8243
+ },
7558
8244
  // ── docs.generate (T798) ─────────────────────────────────────────────────
7559
8245
  {
7560
8246
  gateway: 'query',