@cleocode/contracts 2026.9.8 → 2026.9.10

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 (158) 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 +133 -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 +713 -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 +8 -7
  45. package/dist/index.d.ts.map +1 -1
  46. package/dist/index.js +1 -1
  47. package/dist/index.js.map +1 -1
  48. package/dist/invariants/adr-070-orchestration.d.ts.map +1 -1
  49. package/dist/invariants/adr-070-orchestration.js +1 -1
  50. package/dist/invariants/adr-070-orchestration.js.map +1 -1
  51. package/dist/invariants/adr-073-saga.js +2 -2
  52. package/dist/invariants/adr-073-saga.js.map +1 -1
  53. package/dist/jobs.d.ts +329 -3
  54. package/dist/jobs.d.ts.map +1 -1
  55. package/dist/knowledge-health.d.ts +695 -0
  56. package/dist/knowledge-health.d.ts.map +1 -0
  57. package/dist/knowledge-health.js +8 -0
  58. package/dist/knowledge-health.js.map +1 -0
  59. package/dist/llm/catalog-schema.d.ts +4 -4
  60. package/dist/memory/observe.d.ts +4 -2
  61. package/dist/memory/observe.d.ts.map +1 -1
  62. package/dist/memory/search.d.ts +4 -0
  63. package/dist/memory/search.d.ts.map +1 -1
  64. package/dist/nexus-living-brain-ops.d.ts +28 -3
  65. package/dist/nexus-living-brain-ops.d.ts.map +1 -1
  66. package/dist/nexus-tasks-bridge-ops.d.ts +11 -0
  67. package/dist/nexus-tasks-bridge-ops.d.ts.map +1 -1
  68. package/dist/operations/admin.d.ts +10 -4
  69. package/dist/operations/admin.d.ts.map +1 -1
  70. package/dist/operations/docs.d.ts +138 -0
  71. package/dist/operations/docs.d.ts.map +1 -1
  72. package/dist/operations/docs.js +47 -0
  73. package/dist/operations/docs.js.map +1 -1
  74. package/dist/operations/focus.d.ts +7 -0
  75. package/dist/operations/focus.d.ts.map +1 -1
  76. package/dist/operations/nexus.d.ts +7 -2
  77. package/dist/operations/nexus.d.ts.map +1 -1
  78. package/dist/operations/output-contracts-data.d.ts.map +1 -1
  79. package/dist/operations/output-contracts-data.js +31 -3
  80. package/dist/operations/output-contracts-data.js.map +1 -1
  81. package/dist/operations/research.d.ts +33 -0
  82. package/dist/operations/research.d.ts.map +1 -1
  83. package/dist/operations/tasks.d.ts +107 -4
  84. package/dist/operations/tasks.d.ts.map +1 -1
  85. package/dist/operations/tasks.js +5 -0
  86. package/dist/operations/tasks.js.map +1 -1
  87. package/dist/operations/validate.d.ts +23 -0
  88. package/dist/operations/validate.d.ts.map +1 -1
  89. package/dist/package-artifact.d.ts +112 -0
  90. package/dist/package-artifact.d.ts.map +1 -0
  91. package/dist/package-artifact.js +8 -0
  92. package/dist/package-artifact.js.map +1 -0
  93. package/dist/project-context.d.ts +18 -0
  94. package/dist/project-context.d.ts.map +1 -1
  95. package/dist/release/evidence-atoms.d.ts +10 -0
  96. package/dist/release/evidence-atoms.d.ts.map +1 -1
  97. package/dist/release/evidence-atoms.js +6 -0
  98. package/dist/release/evidence-atoms.js.map +1 -1
  99. package/dist/release/plan.d.ts +6 -6
  100. package/dist/resource-governor.d.ts +114 -0
  101. package/dist/resource-governor.d.ts.map +1 -1
  102. package/dist/resource-governor.js.map +1 -1
  103. package/dist/supervisor-ipc/messages.d.ts +6 -6
  104. package/dist/task-record.d.ts +25 -4
  105. package/dist/task-record.d.ts.map +1 -1
  106. package/dist/task.d.ts +55 -36
  107. package/dist/task.d.ts.map +1 -1
  108. package/dist/task.js.map +1 -1
  109. package/dist/tasks/archive.d.ts +3 -3
  110. package/dist/templates/manifest.d.ts +1 -1
  111. package/dist/workgraph.d.ts +5 -3
  112. package/dist/workgraph.d.ts.map +1 -1
  113. package/dist/workgraph.js +19 -0
  114. package/dist/workgraph.js.map +1 -1
  115. package/package.json +2 -2
  116. package/schemas/gate-result.schema.json +350 -1
  117. package/src/__tests__/__snapshots__/operations-registry.test.ts.snap +1 -1
  118. package/src/__tests__/acceptance-gate.test.ts +282 -1
  119. package/src/__tests__/evidence-atom-schema.test.ts +17 -14
  120. package/src/__tests__/memory-wire-shapes.test.ts +2 -0
  121. package/src/__tests__/operations-registry.test.ts +26 -0
  122. package/src/acceptance-gate-schema.ts +320 -14
  123. package/src/acceptance-gate.ts +144 -11
  124. package/src/audit.ts +72 -2
  125. package/src/backup-manifest.ts +88 -0
  126. package/src/caamp-markers.ts +22 -0
  127. package/src/capabilities.ts +311 -0
  128. package/src/code-symbol.ts +37 -0
  129. package/src/data-accessor.ts +16 -0
  130. package/src/dispatch/__tests__/tasks-gateway-crud-ops.test.ts +31 -1
  131. package/src/dispatch/operations-registry.ts +719 -3
  132. package/src/docs-taxonomy.ts +26 -0
  133. package/src/evidence-atom-schema.ts +10 -9
  134. package/src/graph.ts +326 -2
  135. package/src/index.ts +45 -1
  136. package/src/invariants/adr-070-orchestration.ts +2 -1
  137. package/src/invariants/adr-073-saga.ts +2 -2
  138. package/src/jobs.ts +382 -3
  139. package/src/knowledge-health.ts +748 -0
  140. package/src/memory/observe.ts +4 -2
  141. package/src/memory/search.ts +4 -0
  142. package/src/nexus-living-brain-ops.ts +34 -3
  143. package/src/nexus-tasks-bridge-ops.ts +12 -0
  144. package/src/operations/admin.ts +11 -4
  145. package/src/operations/docs.ts +153 -0
  146. package/src/operations/focus.ts +11 -0
  147. package/src/operations/nexus.ts +7 -1
  148. package/src/operations/output-contracts-data.ts +33 -3
  149. package/src/operations/research.ts +36 -0
  150. package/src/operations/tasks.ts +116 -4
  151. package/src/operations/validate.ts +24 -0
  152. package/src/package-artifact.ts +127 -0
  153. package/src/project-context.ts +19 -0
  154. package/src/release/evidence-atoms.ts +6 -0
  155. package/src/resource-governor.ts +132 -0
  156. package/src/task-record.ts +27 -4
  157. package/src/task.ts +58 -36
  158. package/src/workgraph.ts +19 -0
@@ -39,8 +39,137 @@ export function defineDomain(_domain, ops) {
39
39
  // ---------------------------------------------------------------------------
40
40
  // OPERATIONS — the authoritative registry data
41
41
  // ---------------------------------------------------------------------------
42
+ // Requirement commands carry JSON on the wire; the SDK validates the typed gate.
43
+ const requirementTaskParam = {
44
+ name: 'taskId',
45
+ type: 'string',
46
+ required: true,
47
+ description: 'Task that owns the requirement gates',
48
+ cli: { positional: true },
49
+ };
42
50
  /** The single source of truth for all operations in CLEO. */
43
51
  export const OPERATIONS = [
52
+ {
53
+ gateway: 'mutate',
54
+ domain: 'tasks',
55
+ operation: 'req.add',
56
+ description: 'Add a validated typed requirement gate without executing it',
57
+ tier: 1,
58
+ idempotent: false,
59
+ sessionRequired: true,
60
+ requiredParams: ['taskId', 'gate'],
61
+ params: [
62
+ requirementTaskParam,
63
+ {
64
+ name: 'gate',
65
+ type: 'string',
66
+ required: true,
67
+ description: 'AcceptanceGate JSON; must include kind, description and kind-specific fields',
68
+ cli: { flag: 'gate' },
69
+ },
70
+ ],
71
+ inputSchema: {
72
+ operation: 'tasks.req.add',
73
+ schema: {
74
+ type: 'object',
75
+ required: ['taskId', 'gate'],
76
+ additionalProperties: false,
77
+ properties: {
78
+ taskId: { type: 'string', minLength: 1 },
79
+ gate: { type: 'string', minLength: 1 },
80
+ },
81
+ },
82
+ examples: [
83
+ {
84
+ name: 'test',
85
+ value: {
86
+ taskId: 'T121',
87
+ gate: '{"kind":"test","command":"node","args":["verify.mjs"],"expect":"exit0","description":"Task harness passes","req":"PARTNER-121"}',
88
+ },
89
+ },
90
+ ],
91
+ },
92
+ },
93
+ {
94
+ gateway: 'query',
95
+ domain: 'tasks',
96
+ operation: 'req.list',
97
+ description: 'List named typed requirement gates without executing them',
98
+ tier: 1,
99
+ idempotent: true,
100
+ sessionRequired: false,
101
+ requiredParams: ['taskId'],
102
+ params: [requirementTaskParam],
103
+ inputSchema: {
104
+ operation: 'tasks.req.list',
105
+ schema: {
106
+ type: 'object',
107
+ required: ['taskId'],
108
+ additionalProperties: false,
109
+ properties: { taskId: { type: 'string', minLength: 1 } },
110
+ },
111
+ examples: [{ name: 'task', value: { taskId: 'T121' } }],
112
+ },
113
+ },
114
+ {
115
+ gateway: 'query',
116
+ domain: 'tasks',
117
+ operation: 'req.migrate.preview',
118
+ description: 'Preview typed-gate migration proposals without writing',
119
+ tier: 1,
120
+ idempotent: true,
121
+ sessionRequired: false,
122
+ requiredParams: ['taskId'],
123
+ params: [
124
+ requirementTaskParam,
125
+ {
126
+ name: 'apply',
127
+ type: 'boolean',
128
+ required: false,
129
+ description: 'Must be absent or false for preview',
130
+ },
131
+ ],
132
+ inputSchema: {
133
+ operation: 'tasks.req.migrate.preview',
134
+ schema: {
135
+ type: 'object',
136
+ required: ['taskId'],
137
+ additionalProperties: false,
138
+ properties: { taskId: { type: 'string', minLength: 1 }, apply: { const: false } },
139
+ },
140
+ examples: [{ name: 'preview', value: { taskId: 'T121', apply: false } }],
141
+ },
142
+ },
143
+ {
144
+ gateway: 'mutate',
145
+ domain: 'tasks',
146
+ operation: 'req.migrate',
147
+ description: 'Explicitly apply validated typed-gate migration proposals',
148
+ tier: 1,
149
+ idempotent: false,
150
+ sessionRequired: true,
151
+ requiredParams: ['taskId', 'apply'],
152
+ params: [
153
+ requirementTaskParam,
154
+ {
155
+ name: 'apply',
156
+ type: 'boolean',
157
+ required: true,
158
+ description: 'Must be true to apply proposals',
159
+ cli: { flag: 'apply' },
160
+ },
161
+ ],
162
+ inputSchema: {
163
+ operation: 'tasks.req.migrate',
164
+ schema: {
165
+ type: 'object',
166
+ required: ['taskId', 'apply'],
167
+ additionalProperties: false,
168
+ properties: { taskId: { type: 'string', minLength: 1 }, apply: { const: true } },
169
+ },
170
+ examples: [{ name: 'apply', value: { taskId: 'T121', apply: true } }],
171
+ },
172
+ },
44
173
  {
45
174
  gateway: 'query',
46
175
  domain: 'tasks',
@@ -275,6 +404,13 @@ export const OPERATIONS = [
275
404
  sessionRequired: false,
276
405
  requiredParams: [],
277
406
  params: [
407
+ {
408
+ name: 'includeArchive',
409
+ type: 'boolean',
410
+ required: false,
411
+ description: 'Include archived rows under the same filters',
412
+ cli: { flag: 'include-archive' },
413
+ },
278
414
  { name: 'parent', type: 'string', required: false, description: 'Filter by parent task ID' },
279
415
  { name: 'status', type: 'string', required: false, description: 'Filter by task status' },
280
416
  { name: 'priority', type: 'string', required: false, description: 'Filter by task priority' },
@@ -303,7 +439,7 @@ export const OPERATIONS = [
303
439
  name: 'limit',
304
440
  type: 'number',
305
441
  required: false,
306
- description: '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.)',
442
+ description: 'Maximum number of tasks to return (default 10). --all or --limit 0 returns every match.',
307
443
  },
308
444
  {
309
445
  name: 'offset',
@@ -1632,6 +1768,35 @@ export const OPERATIONS = [
1632
1768
  },
1633
1769
  ],
1634
1770
  },
1771
+ // T12308: the typed-gate runner `cleo verify <id> --run`. A query — it
1772
+ // executes the gates and reports them, and records nothing. Documented as
1773
+ // the canonical driver since T768 and emitted into every validation-stage
1774
+ // spawn prompt, but the flag had been dropped from the command.
1775
+ {
1776
+ gateway: 'query',
1777
+ domain: 'check',
1778
+ operation: 'gate.run',
1779
+ description: "check.gate.run (query) — execute a task's typed acceptance gates and report results; persists nothing (T12308)",
1780
+ tier: 1,
1781
+ idempotent: false,
1782
+ sessionRequired: false,
1783
+ requiredParams: ['taskId'],
1784
+ params: [
1785
+ {
1786
+ name: 'taskId',
1787
+ type: 'string',
1788
+ required: true,
1789
+ description: 'Task whose typed gates should run',
1790
+ cli: { positional: true },
1791
+ },
1792
+ {
1793
+ name: 'agent',
1794
+ type: 'string',
1795
+ required: false,
1796
+ description: 'Actor attribution recorded on each gate result',
1797
+ },
1798
+ ],
1799
+ },
1635
1800
  // check.archive.stats incoming from admin (T5615)
1636
1801
  {
1637
1802
  gateway: 'query',
@@ -2435,7 +2600,7 @@ export const OPERATIONS = [
2435
2600
  type: 'string',
2436
2601
  required: false,
2437
2602
  description: 'Task type',
2438
- enum: ['epic', 'task', 'subtask'],
2603
+ enum: ['saga', 'epic', 'task', 'subtask'],
2439
2604
  cli: { flag: 'type', short: '-t' },
2440
2605
  },
2441
2606
  {
@@ -2488,6 +2653,72 @@ export const OPERATIONS = [
2488
2653
  description: 'Initial note entry for the task',
2489
2654
  cli: { flag: 'notes' },
2490
2655
  },
2656
+ {
2657
+ name: 'dependsWaiver',
2658
+ type: 'string',
2659
+ required: false,
2660
+ description: 'Nonempty reason waiving dependencies for explicit critical priority',
2661
+ cli: { flag: 'depends-waiver' },
2662
+ },
2663
+ {
2664
+ name: 'files',
2665
+ type: 'array',
2666
+ required: false,
2667
+ description: 'Associated repository file paths',
2668
+ cli: { flag: 'files' },
2669
+ },
2670
+ {
2671
+ name: 'dryRun',
2672
+ type: 'boolean',
2673
+ required: false,
2674
+ description: 'Preview creation without task or committed audit writes',
2675
+ cli: { flag: 'dry-run' },
2676
+ },
2677
+ {
2678
+ name: 'parentSearch',
2679
+ type: 'string',
2680
+ required: false,
2681
+ description: 'Search term for resolving the parent task',
2682
+ cli: { flag: 'parent-search' },
2683
+ },
2684
+ {
2685
+ name: 'kind',
2686
+ type: 'string',
2687
+ required: false,
2688
+ description: 'Task intent, independent of hierarchy',
2689
+ enum: ['work', 'research', 'experiment', 'bug', 'spike', 'release'],
2690
+ cli: { flag: 'kind' },
2691
+ },
2692
+ {
2693
+ name: 'scope',
2694
+ type: 'string',
2695
+ required: false,
2696
+ description: 'Task granularity',
2697
+ enum: ['project', 'feature', 'unit'],
2698
+ cli: { flag: 'scope' },
2699
+ },
2700
+ {
2701
+ name: 'severity',
2702
+ type: 'string',
2703
+ required: false,
2704
+ description: 'Project-authorized severity with transactional signed evidence',
2705
+ enum: ['P0', 'P1', 'P2', 'P3'],
2706
+ cli: { flag: 'severity' },
2707
+ },
2708
+ {
2709
+ name: 'forceDuplicate',
2710
+ type: 'boolean',
2711
+ required: false,
2712
+ description: 'Bypass duplicate rejection with committed decision provenance',
2713
+ cli: { flag: 'force-duplicate' },
2714
+ },
2715
+ {
2716
+ name: 'autoDecompose',
2717
+ type: 'boolean',
2718
+ required: false,
2719
+ description: "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)",
2720
+ cli: { flag: 'auto-decompose' },
2721
+ },
2491
2722
  ],
2492
2723
  },
2493
2724
  {
@@ -2722,6 +2953,20 @@ export const OPERATIONS = [
2722
2953
  required: false,
2723
2954
  description: 'Remove related-task edges by taskId',
2724
2955
  },
2956
+ {
2957
+ name: 'phase',
2958
+ type: 'string',
2959
+ required: false,
2960
+ description: 'Project-defined phase, independent of pipeline stage',
2961
+ cli: { flag: 'phase' },
2962
+ },
2963
+ {
2964
+ name: 'noAutoComplete',
2965
+ type: 'boolean',
2966
+ required: false,
2967
+ description: 'Disable automatic parent completion',
2968
+ cli: { flag: 'no-auto-complete' },
2969
+ },
2725
2970
  ],
2726
2971
  inputSchema: tasksUpdateInputContract,
2727
2972
  outputSchema: OUTPUT_CONTRACTS['tasks.update'],
@@ -2792,6 +3037,88 @@ export const OPERATIONS = [
2792
3037
  description: 'taskId parameter',
2793
3038
  cli: { positional: true },
2794
3039
  },
3040
+ {
3041
+ name: 'force',
3042
+ type: 'boolean',
3043
+ required: false,
3044
+ description: 'Allow dependents and orphan children unless cascade is enabled',
3045
+ },
3046
+ {
3047
+ name: 'cascade',
3048
+ type: 'boolean',
3049
+ required: false,
3050
+ description: 'Archive all descendants with the selected task',
3051
+ },
3052
+ ],
3053
+ },
3054
+ {
3055
+ gateway: 'mutate',
3056
+ domain: 'tasks',
3057
+ operation: 'reconcile-scope',
3058
+ description: 'tasks.reconcile-scope (mutate) — sweep a saga/epic subtree for tasks whose scope overlaps and propose merge/absorb/split/link; read-only unless --apply',
3059
+ tier: 1,
3060
+ idempotent: true,
3061
+ sessionRequired: false,
3062
+ requiredParams: ['rootId'],
3063
+ params: [
3064
+ {
3065
+ name: 'rootId',
3066
+ type: 'string',
3067
+ required: true,
3068
+ description: 'Saga, epic or other container to sweep (its whole subtree is considered)',
3069
+ cli: { positional: true },
3070
+ },
3071
+ {
3072
+ name: 'apply',
3073
+ type: 'boolean',
3074
+ required: false,
3075
+ description: 'Write the proposed `relates` edges (read-only without it)',
3076
+ cli: { flag: 'apply' },
3077
+ },
3078
+ {
3079
+ name: 'threshold',
3080
+ type: 'number',
3081
+ required: false,
3082
+ description: 'Report pairs at or above this similarity score, 0-1 (default 0.55)',
3083
+ cli: { flag: 'threshold' },
3084
+ },
3085
+ ],
3086
+ },
3087
+ {
3088
+ gateway: 'mutate',
3089
+ domain: 'tasks',
3090
+ operation: 'decompose',
3091
+ description: '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)',
3092
+ tier: 1,
3093
+ idempotent: false,
3094
+ sessionRequired: false,
3095
+ requiredParams: ['taskId'],
3096
+ params: [
3097
+ {
3098
+ name: 'taskId',
3099
+ type: 'string',
3100
+ required: true,
3101
+ description: 'Task whose text acceptance criteria move to a new child',
3102
+ cli: { positional: true },
3103
+ },
3104
+ {
3105
+ name: 'childTitle',
3106
+ type: 'string',
3107
+ required: false,
3108
+ description: 'Title for the child that inherits the criteria (default: the parent’s)',
3109
+ },
3110
+ {
3111
+ name: 'childDescription',
3112
+ type: 'string',
3113
+ required: false,
3114
+ description: 'Description for the child (default: the parent’s)',
3115
+ },
3116
+ {
3117
+ name: 'dryRun',
3118
+ type: 'boolean',
3119
+ required: false,
3120
+ description: 'Preview the move without writing',
3121
+ },
2795
3122
  ],
2796
3123
  },
2797
3124
  {
@@ -4299,7 +4626,27 @@ export const OPERATIONS = [
4299
4626
  idempotent: false,
4300
4627
  sessionRequired: false,
4301
4628
  requiredParams: [],
4302
- params: [],
4629
+ params: [
4630
+ {
4631
+ name: 'source',
4632
+ type: 'string',
4633
+ required: false,
4634
+ description: 'Source of the reviewed backfill request.',
4635
+ },
4636
+ { name: 'kind', type: 'string', required: false, description: 'Backfill classification.' },
4637
+ {
4638
+ name: 'targetTable',
4639
+ type: 'string',
4640
+ required: false,
4641
+ description: 'Derived brain_page_nodes target only.',
4642
+ },
4643
+ {
4644
+ name: 'nodeIds',
4645
+ type: 'array',
4646
+ required: false,
4647
+ description: 'Exact qualified graph node IDs to stage; all must resolve to missing, eligible typed sources.',
4648
+ },
4649
+ ],
4303
4650
  },
4304
4651
  {
4305
4652
  gateway: 'mutate',
@@ -7337,6 +7684,369 @@ export const OPERATIONS = [
7337
7684
  },
7338
7685
  ],
7339
7686
  },
7687
+ {
7688
+ gateway: 'query',
7689
+ domain: 'docs',
7690
+ operation: 'status',
7691
+ description: 'docs.status (query) — inspect published documentation drift',
7692
+ tier: 1,
7693
+ idempotent: true,
7694
+ sessionRequired: false,
7695
+ requiredParams: [],
7696
+ params: [],
7697
+ },
7698
+ {
7699
+ gateway: 'query',
7700
+ domain: 'docs',
7701
+ operation: 'export',
7702
+ description: 'docs.export (query) — Export a task document',
7703
+ tier: 1,
7704
+ idempotent: true,
7705
+ sessionRequired: false,
7706
+ requiredParams: ['taskId'],
7707
+ params: [
7708
+ {
7709
+ name: 'taskId',
7710
+ type: 'string',
7711
+ required: true,
7712
+ description: 'Task whose document to export',
7713
+ },
7714
+ {
7715
+ name: 'includeAttachments',
7716
+ type: 'boolean',
7717
+ required: false,
7718
+ description: 'Include attachment manifest',
7719
+ },
7720
+ {
7721
+ name: 'includeMemoryRefs',
7722
+ type: 'boolean',
7723
+ required: false,
7724
+ description: 'Include memory references',
7725
+ },
7726
+ ],
7727
+ },
7728
+ {
7729
+ gateway: 'query',
7730
+ domain: 'docs',
7731
+ operation: 'search',
7732
+ description: 'docs.search (query) — Search document content',
7733
+ tier: 1,
7734
+ idempotent: true,
7735
+ sessionRequired: false,
7736
+ requiredParams: ['query'],
7737
+ params: [
7738
+ {
7739
+ name: 'query',
7740
+ type: 'string',
7741
+ required: true,
7742
+ description: 'Document search text',
7743
+ },
7744
+ {
7745
+ name: 'ownerId',
7746
+ type: 'string',
7747
+ required: false,
7748
+ description: 'Optional owner scope',
7749
+ },
7750
+ { name: 'limit', type: 'number', required: false, description: 'Maximum matches' },
7751
+ {
7752
+ name: 'type',
7753
+ type: 'string',
7754
+ required: false,
7755
+ description: 'Document kind filter',
7756
+ },
7757
+ ],
7758
+ },
7759
+ {
7760
+ gateway: 'query',
7761
+ domain: 'docs',
7762
+ operation: 'find',
7763
+ description: 'docs.find (query) — Find similar documents',
7764
+ tier: 1,
7765
+ idempotent: true,
7766
+ sessionRequired: false,
7767
+ requiredParams: ['similarSlug'],
7768
+ params: [
7769
+ {
7770
+ name: 'similarSlug',
7771
+ type: 'string',
7772
+ required: true,
7773
+ description: 'Existing document slug to compare',
7774
+ },
7775
+ { name: 'limit', type: 'number', required: false, description: 'Maximum matches' },
7776
+ {
7777
+ name: 'threshold',
7778
+ type: 'number',
7779
+ required: false,
7780
+ description: 'Minimum similarity',
7781
+ },
7782
+ {
7783
+ name: 'allKinds',
7784
+ type: 'boolean',
7785
+ required: false,
7786
+ description: 'Compare all document kinds',
7787
+ },
7788
+ ],
7789
+ },
7790
+ {
7791
+ gateway: 'query',
7792
+ domain: 'docs',
7793
+ operation: 'merge',
7794
+ description: 'docs.merge (query) — Preview a document merge',
7795
+ tier: 1,
7796
+ idempotent: true,
7797
+ sessionRequired: false,
7798
+ requiredParams: ['attA', 'attB'],
7799
+ params: [
7800
+ {
7801
+ name: 'attA',
7802
+ type: 'string',
7803
+ required: true,
7804
+ description: 'First attachment reference',
7805
+ },
7806
+ {
7807
+ name: 'attB',
7808
+ type: 'string',
7809
+ required: true,
7810
+ description: 'Second attachment reference',
7811
+ },
7812
+ {
7813
+ name: 'strategy',
7814
+ type: 'string',
7815
+ required: false,
7816
+ description: 'three-way, cherry-pick, or multi-diff',
7817
+ },
7818
+ {
7819
+ name: 'base',
7820
+ type: 'string',
7821
+ required: false,
7822
+ description: 'Common ancestor attachment reference',
7823
+ },
7824
+ ],
7825
+ },
7826
+ {
7827
+ gateway: 'query',
7828
+ domain: 'docs',
7829
+ operation: 'rank',
7830
+ description: 'docs.rank (query) — Rank owner documents',
7831
+ tier: 1,
7832
+ idempotent: true,
7833
+ sessionRequired: false,
7834
+ requiredParams: ['ownerId'],
7835
+ params: [
7836
+ {
7837
+ name: 'ownerId',
7838
+ type: 'string',
7839
+ required: true,
7840
+ description: 'Owner whose documents to rank',
7841
+ },
7842
+ {
7843
+ name: 'query',
7844
+ type: 'string',
7845
+ required: false,
7846
+ description: 'Optional ranking query',
7847
+ },
7848
+ ],
7849
+ },
7850
+ {
7851
+ gateway: 'query',
7852
+ domain: 'docs',
7853
+ operation: 'versions',
7854
+ description: 'docs.versions (query) — List document versions',
7855
+ tier: 1,
7856
+ idempotent: true,
7857
+ sessionRequired: false,
7858
+ requiredParams: ['ownerId'],
7859
+ params: [
7860
+ { name: 'ownerId', type: 'string', required: true, description: 'Document owner' },
7861
+ {
7862
+ name: 'name',
7863
+ type: 'string',
7864
+ required: false,
7865
+ description: 'Optional document name',
7866
+ },
7867
+ ],
7868
+ },
7869
+ {
7870
+ gateway: 'mutate',
7871
+ domain: 'docs',
7872
+ operation: 'publish',
7873
+ description: 'docs.publish (mutate) — Publish a document to a file or pull request',
7874
+ tier: 1,
7875
+ idempotent: false,
7876
+ sessionRequired: false,
7877
+ requiredParams: [],
7878
+ params: [
7879
+ {
7880
+ name: 'target',
7881
+ type: 'string',
7882
+ required: false,
7883
+ description: 'Publication target: file or pr',
7884
+ },
7885
+ {
7886
+ name: 'ownerId',
7887
+ type: 'string',
7888
+ required: false,
7889
+ description: 'Required for file publication',
7890
+ },
7891
+ {
7892
+ name: 'toPath',
7893
+ type: 'string',
7894
+ required: false,
7895
+ description: 'Required destination for file publication',
7896
+ },
7897
+ {
7898
+ name: 'attachmentId',
7899
+ type: 'string',
7900
+ required: false,
7901
+ description: 'Attachment to publish',
7902
+ },
7903
+ {
7904
+ name: 'slugOrId',
7905
+ type: 'string',
7906
+ required: false,
7907
+ description: 'Required document reference for PR publication',
7908
+ },
7909
+ {
7910
+ name: 'slug',
7911
+ type: 'string',
7912
+ required: false,
7913
+ description: 'Override document slug',
7914
+ },
7915
+ {
7916
+ name: 'type',
7917
+ type: 'string',
7918
+ required: false,
7919
+ description: 'Override document kind',
7920
+ },
7921
+ { name: 'title', type: 'string', required: false, description: 'Override PR title' },
7922
+ { name: 'body', type: 'string', required: false, description: 'Override PR body' },
7923
+ { name: 'base', type: 'string', required: false, description: 'PR base branch' },
7924
+ ],
7925
+ },
7926
+ {
7927
+ gateway: 'mutate',
7928
+ domain: 'docs',
7929
+ operation: 'publish-pr',
7930
+ description: 'docs.publish-pr (mutate) — Legacy alias for PR publication',
7931
+ tier: 1,
7932
+ idempotent: false,
7933
+ sessionRequired: false,
7934
+ requiredParams: ['slugOrId'],
7935
+ params: [
7936
+ {
7937
+ name: 'slugOrId',
7938
+ type: 'string',
7939
+ required: true,
7940
+ description: 'Document reference to publish',
7941
+ },
7942
+ {
7943
+ name: 'slug',
7944
+ type: 'string',
7945
+ required: false,
7946
+ description: 'Override document slug',
7947
+ },
7948
+ {
7949
+ name: 'type',
7950
+ type: 'string',
7951
+ required: false,
7952
+ description: 'Override document kind',
7953
+ },
7954
+ { name: 'title', type: 'string', required: false, description: 'Override PR title' },
7955
+ { name: 'body', type: 'string', required: false, description: 'Override PR body' },
7956
+ { name: 'base', type: 'string', required: false, description: 'PR base branch' },
7957
+ ],
7958
+ },
7959
+ {
7960
+ gateway: 'mutate',
7961
+ domain: 'docs',
7962
+ operation: 'sync',
7963
+ description: 'docs.sync (mutate) — Sync document content from a file',
7964
+ tier: 1,
7965
+ idempotent: false,
7966
+ sessionRequired: false,
7967
+ requiredParams: ['ownerId', 'fromPath'],
7968
+ params: [
7969
+ { name: 'ownerId', type: 'string', required: true, description: 'Document owner' },
7970
+ {
7971
+ name: 'fromPath',
7972
+ type: 'string',
7973
+ required: true,
7974
+ description: 'Source file path',
7975
+ },
7976
+ {
7977
+ name: 'blobName',
7978
+ type: 'string',
7979
+ required: false,
7980
+ description: 'Document blob name',
7981
+ },
7982
+ {
7983
+ name: 'contentType',
7984
+ type: 'string',
7985
+ required: false,
7986
+ description: 'Document media type',
7987
+ },
7988
+ ],
7989
+ },
7990
+ {
7991
+ gateway: 'mutate',
7992
+ domain: 'docs',
7993
+ operation: 'import',
7994
+ description: 'docs.import (mutate) — Import classified project documents',
7995
+ tier: 1,
7996
+ idempotent: false,
7997
+ sessionRequired: false,
7998
+ requiredParams: ['scanRoot'],
7999
+ params: [
8000
+ {
8001
+ name: 'scanRoot',
8002
+ type: 'string',
8003
+ required: true,
8004
+ description: 'Root directory to scan',
8005
+ },
8006
+ {
8007
+ name: 'dryRun',
8008
+ type: 'boolean',
8009
+ required: false,
8010
+ description: 'Preview without writing',
8011
+ },
8012
+ {
8013
+ name: 'force',
8014
+ type: 'boolean',
8015
+ required: false,
8016
+ description: 'Replace conflicting import mappings',
8017
+ },
8018
+ {
8019
+ name: 'manifestPath',
8020
+ type: 'string',
8021
+ required: false,
8022
+ description: 'Import manifest path',
8023
+ },
8024
+ ],
8025
+ },
8026
+ {
8027
+ gateway: 'query',
8028
+ domain: 'docs',
8029
+ operation: 'audit',
8030
+ description: 'docs.audit (query) — inspect document history or verify audit chain integrity',
8031
+ tier: 1,
8032
+ idempotent: true,
8033
+ sessionRequired: false,
8034
+ requiredParams: [],
8035
+ params: [
8036
+ {
8037
+ name: 'slug',
8038
+ type: 'string',
8039
+ required: false,
8040
+ description: 'Document slug whose history to inspect',
8041
+ },
8042
+ {
8043
+ name: 'verify',
8044
+ type: 'boolean',
8045
+ required: false,
8046
+ description: 'Verify the full audit chain',
8047
+ },
8048
+ ],
8049
+ },
7340
8050
  // ── docs.generate (T798) ─────────────────────────────────────────────────
7341
8051
  {
7342
8052
  gateway: 'query',