@intentius/sql-yodeler 0.0.0-stage → 0.2.0

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 (324) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +112 -2
  3. package/dist/bin.d.ts +2 -0
  4. package/dist/bin.js +29 -0
  5. package/dist/bin.js.map +1 -0
  6. package/dist/chant/apply.d.ts +59 -0
  7. package/dist/chant/apply.js +116 -0
  8. package/dist/chant/apply.js.map +1 -0
  9. package/dist/chant/build.d.ts +34 -0
  10. package/dist/chant/build.js +48 -0
  11. package/dist/chant/build.js.map +1 -0
  12. package/dist/chant/drift.d.ts +112 -0
  13. package/dist/chant/drift.js +238 -0
  14. package/dist/chant/drift.js.map +1 -0
  15. package/dist/chant/plan.d.ts +45 -0
  16. package/dist/chant/plan.js +61 -0
  17. package/dist/chant/plan.js.map +1 -0
  18. package/dist/chant/process.d.ts +41 -0
  19. package/dist/chant/process.js +87 -0
  20. package/dist/chant/process.js.map +1 -0
  21. package/dist/chant/runnable.d.ts +19 -0
  22. package/dist/chant/runnable.js +47 -0
  23. package/dist/chant/runnable.js.map +1 -0
  24. package/dist/cli.d.ts +8 -0
  25. package/dist/cli.js +99 -0
  26. package/dist/cli.js.map +1 -0
  27. package/dist/command.d.ts +23 -0
  28. package/dist/command.js +13 -0
  29. package/dist/command.js.map +1 -0
  30. package/dist/commands/apply.d.ts +3 -0
  31. package/dist/commands/apply.js +426 -0
  32. package/dist/commands/apply.js.map +1 -0
  33. package/dist/commands/approve.d.ts +5 -0
  34. package/dist/commands/approve.js +111 -0
  35. package/dist/commands/approve.js.map +1 -0
  36. package/dist/commands/drift.d.ts +14 -0
  37. package/dist/commands/drift.js +267 -0
  38. package/dist/commands/drift.js.map +1 -0
  39. package/dist/commands/index.d.ts +3 -0
  40. package/dist/commands/index.js +28 -0
  41. package/dist/commands/index.js.map +1 -0
  42. package/dist/commands/init.d.ts +6 -0
  43. package/dist/commands/init.js +139 -0
  44. package/dist/commands/init.js.map +1 -0
  45. package/dist/commands/lint.d.ts +3 -0
  46. package/dist/commands/lint.js +202 -0
  47. package/dist/commands/lint.js.map +1 -0
  48. package/dist/commands/mcp.d.ts +3 -0
  49. package/dist/commands/mcp.js +50 -0
  50. package/dist/commands/mcp.js.map +1 -0
  51. package/dist/commands/new.d.ts +5 -0
  52. package/dist/commands/new.js +292 -0
  53. package/dist/commands/new.js.map +1 -0
  54. package/dist/commands/override.d.ts +3 -0
  55. package/dist/commands/override.js +118 -0
  56. package/dist/commands/override.js.map +1 -0
  57. package/dist/commands/plan.d.ts +3 -0
  58. package/dist/commands/plan.js +183 -0
  59. package/dist/commands/plan.js.map +1 -0
  60. package/dist/commands/rebase.d.ts +3 -0
  61. package/dist/commands/rebase.js +167 -0
  62. package/dist/commands/rebase.js.map +1 -0
  63. package/dist/commands/repair.d.ts +14 -0
  64. package/dist/commands/repair.js +125 -0
  65. package/dist/commands/repair.js.map +1 -0
  66. package/dist/commands/status.d.ts +7 -0
  67. package/dist/commands/status.js +54 -0
  68. package/dist/commands/status.js.map +1 -0
  69. package/dist/config/define.d.ts +148 -0
  70. package/dist/config/define.js +20 -0
  71. package/dist/config/define.js.map +1 -0
  72. package/dist/config/index.d.ts +11 -0
  73. package/dist/config/index.js +12 -0
  74. package/dist/config/index.js.map +1 -0
  75. package/dist/config/load.d.ts +17 -0
  76. package/dist/config/load.js +162 -0
  77. package/dist/config/load.js.map +1 -0
  78. package/dist/config/settings.d.ts +53 -0
  79. package/dist/config/settings.js +116 -0
  80. package/dist/config/settings.js.map +1 -0
  81. package/dist/env-args.d.ts +24 -0
  82. package/dist/env-args.js +92 -0
  83. package/dist/env-args.js.map +1 -0
  84. package/dist/exit.d.ts +20 -0
  85. package/dist/exit.js +28 -0
  86. package/dist/exit.js.map +1 -0
  87. package/dist/history/client.d.ts +25 -0
  88. package/dist/history/client.js +42 -0
  89. package/dist/history/client.js.map +1 -0
  90. package/dist/history/ddl.d.ts +58 -0
  91. package/dist/history/ddl.js +100 -0
  92. package/dist/history/ddl.js.map +1 -0
  93. package/dist/history/index.d.ts +25 -0
  94. package/dist/history/index.js +26 -0
  95. package/dist/history/index.js.map +1 -0
  96. package/dist/history/lock.d.ts +104 -0
  97. package/dist/history/lock.js +230 -0
  98. package/dist/history/lock.js.map +1 -0
  99. package/dist/history/postgres/ddl.d.ts +22 -0
  100. package/dist/history/postgres/ddl.js +47 -0
  101. package/dist/history/postgres/ddl.js.map +1 -0
  102. package/dist/history/postgres/index.d.ts +12 -0
  103. package/dist/history/postgres/index.js +13 -0
  104. package/dist/history/postgres/index.js.map +1 -0
  105. package/dist/history/postgres/lock.d.ts +48 -0
  106. package/dist/history/postgres/lock.js +95 -0
  107. package/dist/history/postgres/lock.js.map +1 -0
  108. package/dist/history/postgres/store.d.ts +39 -0
  109. package/dist/history/postgres/store.js +68 -0
  110. package/dist/history/postgres/store.js.map +1 -0
  111. package/dist/history/rows.d.ts +96 -0
  112. package/dist/history/rows.js +73 -0
  113. package/dist/history/rows.js.map +1 -0
  114. package/dist/history/store.d.ts +72 -0
  115. package/dist/history/store.js +134 -0
  116. package/dist/history/store.js.map +1 -0
  117. package/dist/history/topology.d.ts +41 -0
  118. package/dist/history/topology.js +54 -0
  119. package/dist/history/topology.js.map +1 -0
  120. package/dist/index.d.ts +10 -0
  121. package/dist/index.js +10 -0
  122. package/dist/index.js.map +1 -0
  123. package/dist/init/adopt.d.ts +70 -0
  124. package/dist/init/adopt.js +143 -0
  125. package/dist/init/adopt.js.map +1 -0
  126. package/dist/init/baseline.d.ts +61 -0
  127. package/dist/init/baseline.js +88 -0
  128. package/dist/init/baseline.js.map +1 -0
  129. package/dist/init/files.d.ts +23 -0
  130. package/dist/init/files.js +77 -0
  131. package/dist/init/files.js.map +1 -0
  132. package/dist/init/index.d.ts +16 -0
  133. package/dist/init/index.js +17 -0
  134. package/dist/init/index.js.map +1 -0
  135. package/dist/init/live.d.ts +39 -0
  136. package/dist/init/live.js +68 -0
  137. package/dist/init/live.js.map +1 -0
  138. package/dist/lint/check.d.ts +88 -0
  139. package/dist/lint/check.js +227 -0
  140. package/dist/lint/check.js.map +1 -0
  141. package/dist/lint/config.d.ts +21 -0
  142. package/dist/lint/config.js +43 -0
  143. package/dist/lint/config.js.map +1 -0
  144. package/dist/lint/index.d.ts +31 -0
  145. package/dist/lint/index.js +43 -0
  146. package/dist/lint/index.js.map +1 -0
  147. package/dist/lint/project-rules.d.ts +19 -0
  148. package/dist/lint/project-rules.js +32 -0
  149. package/dist/lint/project-rules.js.map +1 -0
  150. package/dist/lint/report.d.ts +7 -0
  151. package/dist/lint/report.js +48 -0
  152. package/dist/lint/report.js.map +1 -0
  153. package/dist/lint/rules.d.ts +53 -0
  154. package/dist/lint/rules.js +42 -0
  155. package/dist/lint/rules.js.map +1 -0
  156. package/dist/lint/silences.d.ts +49 -0
  157. package/dist/lint/silences.js +91 -0
  158. package/dist/lint/silences.js.map +1 -0
  159. package/dist/lint/statements.d.ts +38 -0
  160. package/dist/lint/statements.js +120 -0
  161. package/dist/lint/statements.js.map +1 -0
  162. package/dist/mcp/server.d.ts +40 -0
  163. package/dist/mcp/server.js +106 -0
  164. package/dist/mcp/server.js.map +1 -0
  165. package/dist/mcp/tools.d.ts +72 -0
  166. package/dist/mcp/tools.js +178 -0
  167. package/dist/mcp/tools.js.map +1 -0
  168. package/dist/migrations/checks.d.ts +28 -0
  169. package/dist/migrations/checks.js +97 -0
  170. package/dist/migrations/checks.js.map +1 -0
  171. package/dist/migrations/checksum.d.ts +56 -0
  172. package/dist/migrations/checksum.js +72 -0
  173. package/dist/migrations/checksum.js.map +1 -0
  174. package/dist/migrations/create.d.ts +75 -0
  175. package/dist/migrations/create.js +120 -0
  176. package/dist/migrations/create.js.map +1 -0
  177. package/dist/migrations/directory.d.ts +119 -0
  178. package/dist/migrations/directory.js +229 -0
  179. package/dist/migrations/directory.js.map +1 -0
  180. package/dist/migrations/document.d.ts +106 -0
  181. package/dist/migrations/document.js +83 -0
  182. package/dist/migrations/document.js.map +1 -0
  183. package/dist/migrations/index.d.ts +21 -0
  184. package/dist/migrations/index.js +22 -0
  185. package/dist/migrations/index.js.map +1 -0
  186. package/dist/pr/comment.d.ts +32 -0
  187. package/dist/pr/comment.js +99 -0
  188. package/dist/pr/comment.js.map +1 -0
  189. package/dist/pr/forge.d.ts +54 -0
  190. package/dist/pr/forge.js +119 -0
  191. package/dist/pr/forge.js.map +1 -0
  192. package/dist/pr/issue.d.ts +68 -0
  193. package/dist/pr/issue.js +107 -0
  194. package/dist/pr/issue.js.map +1 -0
  195. package/dist/pr/model.d.ts +99 -0
  196. package/dist/pr/model.js +137 -0
  197. package/dist/pr/model.js.map +1 -0
  198. package/dist/pr/render.d.ts +29 -0
  199. package/dist/pr/render.js +279 -0
  200. package/dist/pr/render.js.map +1 -0
  201. package/dist/project.d.ts +62 -0
  202. package/dist/project.js +92 -0
  203. package/dist/project.js.map +1 -0
  204. package/dist/rebase/index.d.ts +121 -0
  205. package/dist/rebase/index.js +390 -0
  206. package/dist/rebase/index.js.map +1 -0
  207. package/dist/rebase/repair.d.ts +41 -0
  208. package/dist/rebase/repair.js +68 -0
  209. package/dist/rebase/repair.js.map +1 -0
  210. package/dist/replay/clickhouse.d.ts +33 -0
  211. package/dist/replay/clickhouse.js +106 -0
  212. package/dist/replay/clickhouse.js.map +1 -0
  213. package/dist/replay/index.d.ts +39 -0
  214. package/dist/replay/index.js +57 -0
  215. package/dist/replay/index.js.map +1 -0
  216. package/dist/replay/postgres.d.ts +31 -0
  217. package/dist/replay/postgres.js +140 -0
  218. package/dist/replay/postgres.js.map +1 -0
  219. package/dist/replay/replay.d.ts +114 -0
  220. package/dist/replay/replay.js +98 -0
  221. package/dist/replay/replay.js.map +1 -0
  222. package/dist/replay/report.d.ts +18 -0
  223. package/dist/replay/report.js +72 -0
  224. package/dist/replay/report.js.map +1 -0
  225. package/dist/replay/shared.d.ts +28 -0
  226. package/dist/replay/shared.js +77 -0
  227. package/dist/replay/shared.js.map +1 -0
  228. package/dist/schemas.d.ts +34 -0
  229. package/dist/schemas.js +38 -0
  230. package/dist/schemas.js.map +1 -0
  231. package/dist/server.d.ts +40 -0
  232. package/dist/server.js +87 -0
  233. package/dist/server.js.map +1 -0
  234. package/dist/steps/backfill.d.ts +132 -0
  235. package/dist/steps/backfill.js +307 -0
  236. package/dist/steps/backfill.js.map +1 -0
  237. package/dist/steps/index.d.ts +52 -0
  238. package/dist/steps/index.js +52 -0
  239. package/dist/steps/index.js.map +1 -0
  240. package/dist/steps/kinds.d.ts +101 -0
  241. package/dist/steps/kinds.js +143 -0
  242. package/dist/steps/kinds.js.map +1 -0
  243. package/dist/steps/postgres-migration.d.ts +95 -0
  244. package/dist/steps/postgres-migration.js +149 -0
  245. package/dist/steps/postgres-migration.js.map +1 -0
  246. package/dist/steps/rebuild.d.ts +97 -0
  247. package/dist/steps/rebuild.js +155 -0
  248. package/dist/steps/rebuild.js.map +1 -0
  249. package/dist/steps/run.d.ts +45 -0
  250. package/dist/steps/run.js +72 -0
  251. package/dist/steps/run.js.map +1 -0
  252. package/dist/topology/render.d.ts +17 -0
  253. package/dist/topology/render.js +17 -0
  254. package/dist/topology/render.js.map +1 -0
  255. package/dist/version.d.ts +2 -0
  256. package/dist/version.js +11 -0
  257. package/dist/version.js.map +1 -0
  258. package/dist/versioned/approval.d.ts +35 -0
  259. package/dist/versioned/approval.js +53 -0
  260. package/dist/versioned/approval.js.map +1 -0
  261. package/dist/versioned/checks.d.ts +29 -0
  262. package/dist/versioned/checks.js +54 -0
  263. package/dist/versioned/checks.js.map +1 -0
  264. package/dist/versioned/clickhouse.d.ts +24 -0
  265. package/dist/versioned/clickhouse.js +42 -0
  266. package/dist/versioned/clickhouse.js.map +1 -0
  267. package/dist/versioned/digest.d.ts +77 -0
  268. package/dist/versioned/digest.js +69 -0
  269. package/dist/versioned/digest.js.map +1 -0
  270. package/dist/versioned/driver.d.ts +51 -0
  271. package/dist/versioned/driver.js +13 -0
  272. package/dist/versioned/driver.js.map +1 -0
  273. package/dist/versioned/engine.d.ts +206 -0
  274. package/dist/versioned/engine.js +370 -0
  275. package/dist/versioned/engine.js.map +1 -0
  276. package/dist/versioned/explain.d.ts +123 -0
  277. package/dist/versioned/explain.js +294 -0
  278. package/dist/versioned/explain.js.map +1 -0
  279. package/dist/versioned/index.d.ts +46 -0
  280. package/dist/versioned/index.js +77 -0
  281. package/dist/versioned/index.js.map +1 -0
  282. package/dist/versioned/op.d.ts +72 -0
  283. package/dist/versioned/op.js +185 -0
  284. package/dist/versioned/op.js.map +1 -0
  285. package/dist/versioned/policy.d.ts +67 -0
  286. package/dist/versioned/policy.js +161 -0
  287. package/dist/versioned/policy.js.map +1 -0
  288. package/dist/versioned/postgres/catalog.d.ts +33 -0
  289. package/dist/versioned/postgres/catalog.js +34 -0
  290. package/dist/versioned/postgres/catalog.js.map +1 -0
  291. package/dist/versioned/postgres/driver.d.ts +71 -0
  292. package/dist/versioned/postgres/driver.js +140 -0
  293. package/dist/versioned/postgres/driver.js.map +1 -0
  294. package/dist/versioned/postgres/executor.d.ts +104 -0
  295. package/dist/versioned/postgres/executor.js +172 -0
  296. package/dist/versioned/postgres/executor.js.map +1 -0
  297. package/dist/versioned/postgres/index.d.ts +11 -0
  298. package/dist/versioned/postgres/index.js +12 -0
  299. package/dist/versioned/postgres/index.js.map +1 -0
  300. package/dist/versioned/postgres/waits.d.ts +46 -0
  301. package/dist/versioned/postgres/waits.js +78 -0
  302. package/dist/versioned/postgres/waits.js.map +1 -0
  303. package/dist/versioned/report.d.ts +25 -0
  304. package/dist/versioned/report.js +84 -0
  305. package/dist/versioned/report.js.map +1 -0
  306. package/dist/versioned/stand-down.d.ts +30 -0
  307. package/dist/versioned/stand-down.js +56 -0
  308. package/dist/versioned/stand-down.js.map +1 -0
  309. package/dist/versioned/state.d.ts +108 -0
  310. package/dist/versioned/state.js +153 -0
  311. package/dist/versioned/state.js.map +1 -0
  312. package/package.json +61 -4
  313. package/schemas/apply.schema.json +269 -0
  314. package/schemas/common.schema.json +213 -0
  315. package/schemas/drift.schema.json +36 -0
  316. package/schemas/init.schema.json +31 -0
  317. package/schemas/lint-rules.schema.json +54 -0
  318. package/schemas/lint.schema.json +290 -0
  319. package/schemas/mcp.schema.json +70 -0
  320. package/schemas/new.schema.json +71 -0
  321. package/schemas/plan.schema.json +371 -0
  322. package/schemas/rebase.schema.json +54 -0
  323. package/schemas/repair.schema.json +20 -0
  324. package/schemas/status.schema.json +310 -0
@@ -0,0 +1,290 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://intentius.io/sql-yodeler/schemas/v1/lint.schema.json",
4
+ "title": "yodel lint --json",
5
+ "description": "Version 1. The findings, the silences each migration holds, and with --replay the replay check's result. yodel lint --rules --json prints lint-rules.schema.json instead. Within a version, fields are only added; a reader ignores fields it does not know.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": [
9
+ "status",
10
+ "dialect",
11
+ "migrations",
12
+ "errors",
13
+ "warnings",
14
+ "silenced",
15
+ "findings",
16
+ "silences"
17
+ ],
18
+ "properties": {
19
+ "status": {
20
+ "description": "failed when a finding at level error is not silenced: the command exits 3.",
21
+ "enum": [
22
+ "passed",
23
+ "failed"
24
+ ]
25
+ },
26
+ "environment": {
27
+ "description": "With --env: the environment whose history the migrations were compared with.",
28
+ "type": "string"
29
+ },
30
+ "dialect": {
31
+ "oneOf": [
32
+ {
33
+ "$ref": "common.schema.json#/$defs/dialect"
34
+ },
35
+ {
36
+ "type": "null"
37
+ }
38
+ ]
39
+ },
40
+ "migrations": {
41
+ "description": "Every migration read, sorted by id.",
42
+ "$ref": "common.schema.json#/$defs/stringList"
43
+ },
44
+ "errors": {
45
+ "type": "integer",
46
+ "minimum": 0
47
+ },
48
+ "warnings": {
49
+ "type": "integer",
50
+ "minimum": 0
51
+ },
52
+ "silenced": {
53
+ "type": "integer",
54
+ "minimum": 0
55
+ },
56
+ "findings": {
57
+ "type": "array",
58
+ "items": {
59
+ "type": "object",
60
+ "additionalProperties": false,
61
+ "required": [
62
+ "rule",
63
+ "level",
64
+ "message"
65
+ ],
66
+ "properties": {
67
+ "rule": {
68
+ "type": "string"
69
+ },
70
+ "level": {
71
+ "enum": [
72
+ "error",
73
+ "warning"
74
+ ]
75
+ },
76
+ "message": {
77
+ "type": "string"
78
+ },
79
+ "migration": {
80
+ "type": "string"
81
+ },
82
+ "step": {
83
+ "type": "integer"
84
+ },
85
+ "object": {
86
+ "type": "string"
87
+ },
88
+ "line": {
89
+ "type": "integer"
90
+ },
91
+ "silenced": {
92
+ "description": "A -- yodel:allow line silenced it: the reason given. A silenced finding fails nothing.",
93
+ "type": "string"
94
+ }
95
+ }
96
+ }
97
+ },
98
+ "silences": {
99
+ "description": "The silences each migration's migration.sql holds, by migration id.",
100
+ "type": "object",
101
+ "additionalProperties": {
102
+ "type": "array",
103
+ "items": {
104
+ "type": "object",
105
+ "additionalProperties": false,
106
+ "required": [
107
+ "step",
108
+ "rule",
109
+ "reason",
110
+ "line"
111
+ ],
112
+ "properties": {
113
+ "step": {
114
+ "type": "integer"
115
+ },
116
+ "rule": {
117
+ "type": "string"
118
+ },
119
+ "reason": {
120
+ "type": "string"
121
+ },
122
+ "line": {
123
+ "type": "integer"
124
+ }
125
+ }
126
+ }
127
+ }
128
+ },
129
+ "replay": {
130
+ "$ref": "#/$defs/replay"
131
+ }
132
+ },
133
+ "$defs": {
134
+ "replayed": {
135
+ "type": "object",
136
+ "additionalProperties": false,
137
+ "required": [
138
+ "id",
139
+ "statements",
140
+ "ran",
141
+ "skipped"
142
+ ],
143
+ "properties": {
144
+ "id": {
145
+ "type": "string"
146
+ },
147
+ "statements": {
148
+ "type": "integer"
149
+ },
150
+ "ran": {
151
+ "$ref": "common.schema.json#/$defs/stringList"
152
+ },
153
+ "skipped": {
154
+ "$ref": "common.schema.json#/$defs/stringList"
155
+ }
156
+ }
157
+ },
158
+ "replay": {
159
+ "description": "With --replay: the history replayed into an empty database, migration by migration, against each one's recorded schema.",
160
+ "type": "object",
161
+ "required": [
162
+ "dialect",
163
+ "where",
164
+ "scope",
165
+ "reset",
166
+ "kept",
167
+ "matched",
168
+ "total",
169
+ "outcome",
170
+ "ok"
171
+ ],
172
+ "unevaluatedProperties": false,
173
+ "properties": {
174
+ "dialect": {
175
+ "$ref": "common.schema.json#/$defs/dialect"
176
+ },
177
+ "where": {
178
+ "type": "string"
179
+ },
180
+ "scope": {
181
+ "$ref": "common.schema.json#/$defs/stringList"
182
+ },
183
+ "reset": {
184
+ "type": "boolean"
185
+ },
186
+ "kept": {
187
+ "type": "boolean"
188
+ },
189
+ "matched": {
190
+ "type": "array",
191
+ "items": {
192
+ "$ref": "#/$defs/replayed"
193
+ }
194
+ },
195
+ "total": {
196
+ "type": "integer"
197
+ },
198
+ "outcome": {
199
+ "enum": [
200
+ "matches",
201
+ "differs",
202
+ "failed",
203
+ "unreplayable"
204
+ ]
205
+ },
206
+ "ok": {
207
+ "type": "boolean"
208
+ },
209
+ "message": {
210
+ "type": "string"
211
+ }
212
+ },
213
+ "oneOf": [
214
+ {
215
+ "properties": {
216
+ "outcome": {
217
+ "const": "matches"
218
+ }
219
+ },
220
+ "type": "object"
221
+ },
222
+ {
223
+ "required": [
224
+ "migration",
225
+ "changes"
226
+ ],
227
+ "properties": {
228
+ "outcome": {
229
+ "const": "differs"
230
+ },
231
+ "migration": {
232
+ "$ref": "#/$defs/replayed"
233
+ },
234
+ "changes": {
235
+ "type": "array",
236
+ "items": {
237
+ "$ref": "common.schema.json#/$defs/change"
238
+ }
239
+ }
240
+ },
241
+ "type": "object"
242
+ },
243
+ {
244
+ "required": [
245
+ "migration",
246
+ "step",
247
+ "error"
248
+ ],
249
+ "properties": {
250
+ "outcome": {
251
+ "const": "failed"
252
+ },
253
+ "migration": {
254
+ "type": "string"
255
+ },
256
+ "step": {
257
+ "type": "integer"
258
+ },
259
+ "error": {
260
+ "type": "string"
261
+ }
262
+ },
263
+ "type": "object"
264
+ },
265
+ {
266
+ "required": [
267
+ "migration",
268
+ "step",
269
+ "reason"
270
+ ],
271
+ "properties": {
272
+ "outcome": {
273
+ "const": "unreplayable"
274
+ },
275
+ "migration": {
276
+ "type": "string"
277
+ },
278
+ "step": {
279
+ "type": "integer"
280
+ },
281
+ "reason": {
282
+ "type": "string"
283
+ }
284
+ },
285
+ "type": "object"
286
+ }
287
+ ]
288
+ }
289
+ }
290
+ }
@@ -0,0 +1,70 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://intentius.io/sql-yodeler/schemas/v1/mcp.schema.json",
4
+ "title": "A yodel mcp tool result",
5
+ "description": "Version 1. Every tool of yodel mcp returns this envelope, as the call's structuredContent and as its text. results follows the schema resultsSchema names: the command's own (status, plan, lint, drift) or a definition here (history, explain). Within a version, fields are only added; a reader ignores fields it does not know.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": ["schema", "tool", "command", "exit", "results", "resultsSchema"],
9
+ "properties": {
10
+ "schema": { "description": "The envelope's version.", "const": 1 },
11
+ "tool": { "enum": ["status", "plan", "lint", "drift", "history", "explain"] },
12
+ "command": { "description": "The yodel command line the tool ran.", "type": "string" },
13
+ "exit": { "description": "The command's exit code, the same as on a terminal (yodel --help lists them).", "type": "integer" },
14
+ "results": { "description": "What the command printed with --json; null when it printed nothing (it failed: see error)." },
15
+ "resultsSchema": { "description": "The $id of the schema results follows.", "type": "string" },
16
+ "error": { "description": "What the command wrote to stderr: why it failed when results is null, else notices.", "type": "string" },
17
+ "forPerson": {
18
+ "description": "Steps that belong to a person, each with the command the person runs. An agent shows them and never runs them.",
19
+ "type": "array",
20
+ "items": {
21
+ "type": "object",
22
+ "additionalProperties": false,
23
+ "required": ["action", "command"],
24
+ "properties": { "action": { "type": "string" }, "command": { "type": "string" } }
25
+ }
26
+ }
27
+ },
28
+ "$defs": {
29
+ "history": {
30
+ "description": "The history tool: the migrations the environment's history records applied, from yodel status.",
31
+ "type": "object",
32
+ "additionalProperties": false,
33
+ "required": ["environment", "history", "applied"],
34
+ "properties": {
35
+ "environment": { "type": "string" },
36
+ "server": { "$ref": "common.schema.json#/$defs/server" },
37
+ "history": { "$ref": "status.schema.json#/$defs/report/properties/history" },
38
+ "applied": { "$ref": "status.schema.json#/$defs/report/properties/applied" }
39
+ }
40
+ },
41
+ "explain": {
42
+ "description": "The explain tool: a lint rule, or an exit code.",
43
+ "oneOf": [
44
+ {
45
+ "type": "object",
46
+ "additionalProperties": false,
47
+ "required": ["topic", "kind", "rule", "docs"],
48
+ "properties": {
49
+ "topic": { "type": "string" },
50
+ "kind": { "const": "lint-rule" },
51
+ "rule": { "$ref": "lint-rules.schema.json#/items" },
52
+ "docs": { "type": "string" }
53
+ }
54
+ },
55
+ {
56
+ "type": "object",
57
+ "additionalProperties": false,
58
+ "required": ["topic", "kind", "code", "meaning", "docs"],
59
+ "properties": {
60
+ "topic": { "type": "string" },
61
+ "kind": { "const": "exit-code" },
62
+ "code": { "type": "integer" },
63
+ "meaning": { "type": "string" },
64
+ "docs": { "type": "string" }
65
+ }
66
+ }
67
+ ]
68
+ }
69
+ }
70
+ }
@@ -0,0 +1,71 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://intentius.io/sql-yodeler/schemas/v1/new.schema.json",
4
+ "title": "yodel new <name> --json",
5
+ "description": "Version 1. The migration written (written true), or why none was: a backfill template to fill in, a --replace that kept the migration, or no change from the newest migration's recorded schema. Within a version, fields are only added; a reader ignores fields it does not know.",
6
+ "oneOf": [{ "$ref": "#/$defs/written" }, { "$ref": "#/$defs/template" }, { "$ref": "#/$defs/kept" }, { "$ref": "#/$defs/unchanged" }],
7
+ "$defs": {
8
+ "written": {
9
+ "type": "object",
10
+ "additionalProperties": false,
11
+ "required": ["written", "id", "path", "parent", "checksum", "dialect", "statements", "ops", "manual", "hints", "checks"],
12
+ "properties": {
13
+ "written": { "const": true },
14
+ "id": { "type": "string" },
15
+ "path": { "type": "string" },
16
+ "parent": { "type": ["string", "null"] },
17
+ "checksum": { "type": "string" },
18
+ "dialect": { "$ref": "common.schema.json#/$defs/dialect" },
19
+ "statements": { "type": "integer", "minimum": 0 },
20
+ "ops": {
21
+ "description": "The Op steps written, which yodel apply runs or refuses.",
22
+ "type": "array",
23
+ "items": {
24
+ "type": "object",
25
+ "additionalProperties": false,
26
+ "required": ["op", "object", "name", "rules"],
27
+ "properties": { "op": { "type": "string" }, "object": { "type": "string" }, "name": { "type": "string" }, "rules": { "$ref": "common.schema.json#/$defs/stringList" } }
28
+ }
29
+ },
30
+ "manual": {
31
+ "description": "The manual steps written: yodel apply refuses them.",
32
+ "type": "array",
33
+ "items": {
34
+ "type": "object",
35
+ "additionalProperties": false,
36
+ "required": ["object", "name", "rules", "detail"],
37
+ "properties": { "object": { "type": "string" }, "name": { "type": "string" }, "rules": { "$ref": "common.schema.json#/$defs/stringList" }, "detail": { "type": "string" } }
38
+ }
39
+ },
40
+ "hints": { "$ref": "common.schema.json#/$defs/stringList" },
41
+ "checks": { "type": "array", "items": { "$ref": "common.schema.json#/$defs/check" } }
42
+ }
43
+ },
44
+ "template": {
45
+ "description": "--backfill named a file that is not there: the template was written to it, and no migration.",
46
+ "type": "object",
47
+ "additionalProperties": false,
48
+ "required": ["written", "template"],
49
+ "properties": { "written": { "const": false }, "template": { "type": "string" } }
50
+ },
51
+ "kept": {
52
+ "description": "--replace: the replacement would be the same, so the migration was kept.",
53
+ "type": "object",
54
+ "additionalProperties": false,
55
+ "required": ["written", "replaced", "kept"],
56
+ "properties": { "written": { "const": false }, "replaced": { "type": "null" }, "kept": { "type": "string" } }
57
+ },
58
+ "unchanged": {
59
+ "description": "The declared schema matches the newest migration's recorded schema.",
60
+ "type": "object",
61
+ "additionalProperties": false,
62
+ "required": ["written", "parent", "dialect", "hints"],
63
+ "properties": {
64
+ "written": { "const": false },
65
+ "parent": { "type": ["string", "null"] },
66
+ "dialect": { "$ref": "common.schema.json#/$defs/dialect" },
67
+ "hints": { "$ref": "common.schema.json#/$defs/stringList" }
68
+ }
69
+ }
70
+ }
71
+ }