@metabase/cli 0.5.0 → 0.5.2

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 (313) hide show
  1. package/dist/{add-collection-COtKcy6Y.mjs → add-collection-C0BQHjJd.mjs} +5 -5
  2. package/dist/{alert-DMlSjPEv.mjs → alert-mXHOt00T.mjs} +7 -7
  3. package/dist/{alerts-s3al16NZ.mjs → alerts-CyB1Z7AU.mjs} +6 -6
  4. package/dist/{append-CbGmdeLw.mjs → append-DeHhUAeY.mjs} +4 -4
  5. package/dist/{archive-DvbaSglr.mjs → archive-B1MA5MZp.mjs} +5 -5
  6. package/dist/{archive-CnDriekB.mjs → archive-Bi-Sfq5T.mjs} +5 -5
  7. package/dist/{archive-BFmx4B91.mjs → archive-CCKxZEuq.mjs} +5 -5
  8. package/dist/{archive-BZCYIBhQ.mjs → archive-CDSAXKKB.mjs} +5 -5
  9. package/dist/{archive-5EY9UJU_.mjs → archive-CfNLlebd.mjs} +6 -6
  10. package/dist/archive-CjVd1fJ5.mjs +32 -0
  11. package/dist/{archive-Ce4eArrs.mjs → archive-CpvpGZlz.mjs} +3 -3
  12. package/dist/{archive-DDO2XX0E.mjs → archive-DRMXvkiI.mjs} +4 -4
  13. package/dist/{archive-a05W75XH.mjs → archive-DfDqPgtk.mjs} +3 -3
  14. package/dist/{archive-DzSdJVqE.mjs → archive-DpgtAdEa.mjs} +5 -5
  15. package/dist/{archive-C_UHeanE.mjs → archive-HCVTRXI2.mjs} +3 -3
  16. package/dist/{archive-DW7x0IFB.mjs → archive-qy0CFo1s2.mjs} +5 -5
  17. package/dist/{auth-DOz7KW5E.mjs → auth-_cdypXeX.mjs} +5 -5
  18. package/dist/{body-Di7940x_.mjs → body-C0VnEiRV.mjs} +2 -2
  19. package/dist/{branch-flag-CfJ8vwgu.mjs → branch-flag-CPTQ4wXp.mjs} +1 -1
  20. package/dist/{branches-BC-vlk6i.mjs → branches-C7mNYAky.mjs} +3 -3
  21. package/dist/{breaking-ByrjsFjq.mjs → breaking-BindR3ZW.mjs} +6 -6
  22. package/dist/{broken-DLSk1T88.mjs → broken-SoXfkx7d.mjs} +8 -8
  23. package/dist/{bulk-discard-values-VKGj8c7z.mjs → bulk-discard-values-D_d5_1w5.mjs} +5 -5
  24. package/dist/{bulk-edit-CpuleeCQ.mjs → bulk-edit-Cce05vb_.mjs} +5 -5
  25. package/dist/{bulk-rescan-values-DeGwiqLS.mjs → bulk-rescan-values-DIQN4VT_.mjs} +5 -5
  26. package/dist/{bulk-sync-schema-BKVhauW1.mjs → bulk-sync-schema-DLWf5dCl.mjs} +5 -5
  27. package/dist/{cancel-qKj45001.mjs → cancel-rnd6UI-6.mjs} +3 -3
  28. package/dist/{cancel-task-nmBBd1Ky.mjs → cancel-task-acq1GT6Z.mjs} +4 -4
  29. package/dist/{card-DSrgU7lT.mjs → card-3NmUiU5F.mjs} +1 -1
  30. package/dist/card-BnL92zoT.mjs +25 -0
  31. package/dist/{card-Bv4ZN0oV.mjs → card-QR3zEu6E.mjs} +39 -26
  32. package/dist/{cards-Bq73s48q.mjs → cards-DmzPtx81.mjs} +6 -6
  33. package/dist/cli.mjs +200 -49
  34. package/dist/{client-BmURNkkW.mjs → client-D-Aw6JLk.mjs} +202 -618
  35. package/dist/{collection-C03LXnCT.mjs → collection-D5vt2IJ_.mjs} +1 -1
  36. package/dist/{collection-zrZoJfgR.mjs → collection-DNmFKALA.mjs} +12 -3
  37. package/dist/collection-DRHGwFSL.mjs +21 -0
  38. package/dist/{collection-namespace-DaDzK31i.mjs → collection-namespace-Dl8_7xII.mjs} +1 -1
  39. package/dist/{content-translation-BlG41YrA.mjs → content-translation-DxT1OMnP.mjs} +3 -3
  40. package/dist/{copy-DTiYs_a2.mjs → copy-BTdTiDQo.mjs} +6 -6
  41. package/dist/{copy-DOKlVa7H.mjs → copy-CyFf3e2Y.mjs} +6 -6
  42. package/dist/{copy-flags-BhGWC5kS.mjs → copy-flags-CTM91pxH.mjs} +2 -2
  43. package/dist/{create-DraZzrLO.mjs → create-B3QZpifA.mjs} +7 -7
  44. package/dist/{create-B5BwdPwT.mjs → create-B6dABrs7.mjs} +6 -6
  45. package/dist/create-BH6zpwKD.mjs +34 -0
  46. package/dist/{create-BpwZJZxb.mjs → create-Bg3WTMMU.mjs} +5 -5
  47. package/dist/{create-JaFhqysM.mjs → create-BwIOlpLc.mjs} +5 -5
  48. package/dist/{create-BKKNIe93.mjs → create-C3rabvE_.mjs} +5 -5
  49. package/dist/{create-Duj_2YIF.mjs → create-Ce5YVusp.mjs} +4 -4
  50. package/dist/create-Ch-NbeMr.mjs +48 -0
  51. package/dist/{create-Cob0gLsA.mjs → create-CuJJd7Rh.mjs} +5 -5
  52. package/dist/{create-1rLk8b5q.mjs → create-D6NLpIzV.mjs} +3 -3
  53. package/dist/{create-B1bX6ngX.mjs → create-DeCPAYJi.mjs} +4 -4
  54. package/dist/{create-d0trLAzB.mjs → create-DeiBnRRz.mjs} +6 -6
  55. package/dist/{create-C0kz0oYc.mjs → create-DiG165B2.mjs} +5 -5
  56. package/dist/{create-B1QDNU1x.mjs → create-Dn8V5siS.mjs} +6 -6
  57. package/dist/{create-BXX_n64u.mjs → create-DsCydgm22.mjs} +5 -5
  58. package/dist/{create-vOw8gmBU.mjs → create-GU8_GNbN.mjs} +3 -3
  59. package/dist/{create-branch-B5jB4tKk.mjs → create-branch-C4Ql9G2g.mjs} +4 -4
  60. package/dist/{create-DUytP2Y1.mjs → create-qtTB8rIE.mjs} +4 -4
  61. package/dist/{create-DPggIXfn.mjs → create-roJbQOmm.mjs} +4 -4
  62. package/dist/{csv-DfExp9H_.mjs → csv-DmuyyLdz.mjs} +4 -4
  63. package/dist/{current-task-CbXIH_RA.mjs → current-task-C2PPBVVv.mjs} +4 -4
  64. package/dist/dashboard-Bq1pae4N.mjs +35 -0
  65. package/dist/{dashboard-Phz3XpRM.mjs → dashboard-Chjy5GKR.mjs} +52 -5
  66. package/dist/{dashboard-XSTr9QCr.mjs → dashboard-D5E3fMKh.mjs} +1 -1
  67. package/dist/data-action-BZ2PvlaP.mjs +24 -0
  68. package/dist/data-action-DZxVB_hD.mjs +85 -0
  69. package/dist/data-action-R9qxJDPA.mjs +40 -0
  70. package/dist/{database-BdKkae1m.mjs → database-CxykzTAA.mjs} +14 -3
  71. package/dist/{database-DoNoZ8Yc.mjs → database-D8XzgJEz.mjs} +19 -2
  72. package/dist/{dataset-DZgJm5hP.mjs → dataset-DIQLAp2P.mjs} +5 -4
  73. package/dist/db-BgKKN1-4.mjs +25 -0
  74. package/dist/{delete-DJ7SNXiH.mjs → delete-5ZOvFr-7.mjs} +4 -4
  75. package/dist/delete-B3aylPHD.mjs +44 -0
  76. package/dist/{delete-hwPqKXeY.mjs → delete-CH32Ew4m.mjs} +4 -4
  77. package/dist/{delete-D0xFMRRq.mjs → delete-CS6hsBnd.mjs} +4 -4
  78. package/dist/{delete-hcw_4pBG.mjs → delete-DeqGTuwO.mjs} +4 -4
  79. package/dist/{delete-9xHRd2CG.mjs → delete-DiZg2wit.mjs} +4 -4
  80. package/dist/delete-DtIbkF42.mjs +44 -0
  81. package/dist/{delete-B4BfGfiJ.mjs → delete-_XC6R-Jn.mjs} +4 -4
  82. package/dist/{delete-runtime-DkgYUQ_n.mjs → delete-runtime-DRGveT8H.mjs} +1 -1
  83. package/dist/{delete-table-DhTMft7u.mjs → delete-table-BEuMlqw1.mjs} +4 -4
  84. package/dist/{dependencies-B8H2gA04.mjs → dependencies-DD48u9i3.mjs} +5 -5
  85. package/dist/dependency-6kfpR8Ga.mjs +15 -0
  86. package/dist/{dependency-tQBxYjFX.mjs → dependency-CaC6XuTY.mjs} +2 -2
  87. package/dist/{dependency-Dc33mjgd.mjs → dependency-Dxvb2Znu.mjs} +2 -2
  88. package/dist/{dependents-B2GcS5kB.mjs → dependents-ByfHs8pO.mjs} +9 -9
  89. package/dist/{dirty-Cz2rUd6S.mjs → dirty-DsrGfLit.mjs} +5 -5
  90. package/dist/{discard-values-QWuWGaVK.mjs → discard-values-BfpwwC62.mjs} +5 -5
  91. package/dist/document-C0mZEg5w.mjs +20 -0
  92. package/dist/{document-wfWbV0B_.mjs → document-DVIu3Vj4.mjs} +1 -1
  93. package/dist/{document-BDobDiap.mjs → document-UMG6me2P.mjs} +1 -1
  94. package/dist/{download-Dw15fUMy.mjs → download-kpgGtfpw.mjs} +2 -2
  95. package/dist/{eid-Ex4G-ZlN.mjs → eid-Tp-ACZ4O.mjs} +4 -5
  96. package/dist/{eid-translation-zEHtr5Oc.mjs → eid-translation-Ba92VOHe.mjs} +1 -0
  97. package/dist/{entity-DBKPaMr5.mjs → entity-DjDkaMkB.mjs} +2 -2
  98. package/dist/{entry-flags-DgY3IXFe.mjs → entry-flags-nhBrUS6p.mjs} +4 -4
  99. package/dist/{events-BibJ4ya0.mjs → events-Dm9-ofXu.mjs} +6 -6
  100. package/dist/execute-BL0dAlrp.mjs +45 -0
  101. package/dist/{export-U8MdaatW.mjs → export-CIW-dHft.mjs} +24 -12
  102. package/dist/{export-flags-BrfeyE8D.mjs → export-flags-CpukgETM.mjs} +14 -6
  103. package/dist/{export-preflight-A28L45au.mjs → export-preflight-BMlz3Hp9.mjs} +5 -5
  104. package/dist/field-BUkyWiWk.mjs +21 -0
  105. package/dist/{field-wmN6raOG.mjs → field-BVz4AS3f.mjs} +1 -1
  106. package/dist/{field-5nivEfd6.mjs → field-DoWQUl7V.mjs} +58 -45
  107. package/dist/{fields-i1TFa_th.mjs → fields-CcerFaiu.mjs} +6 -6
  108. package/dist/{filter-flags-Bm3vuSM-.mjs → filter-flags-DhE4olyf.mjs} +5 -4
  109. package/dist/{fks-Dcfn3-73.mjs → fks-CYfBesHV.mjs} +6 -6
  110. package/dist/{get-D0NZ0ZO1.mjs → get--E7UvR-v.mjs} +5 -5
  111. package/dist/{get-Dz3dNirC.mjs → get-B0RQPTV-2.mjs} +5 -5
  112. package/dist/{get-CCLWWqTD.mjs → get-BFloqjrN.mjs} +4 -4
  113. package/dist/{get-B4_3DID6.mjs → get-BLnQ2aut.mjs} +5 -5
  114. package/dist/{get-DqYn9mez.mjs → get-BaiyMem3.mjs} +4 -4
  115. package/dist/{get-CobILQ_7.mjs → get-Be7yjY9v.mjs} +6 -6
  116. package/dist/get-BvEHWLGL.mjs +32 -0
  117. package/dist/get-CEJE9Rmp.mjs +31 -0
  118. package/dist/{get-EKBYludD.mjs → get-CRfrkxqc.mjs} +3 -3
  119. package/dist/{get-DPZUIPjv.mjs → get-CZgAr8rM.mjs} +5 -5
  120. package/dist/{get-BKDTRMNU.mjs → get-Cj3-w_Nu.mjs} +5 -5
  121. package/dist/{get-BCdtCwaG.mjs → get-CmxYFUuR.mjs} +3 -3
  122. package/dist/{get-Cwj1Q-at.mjs → get-DHSuVxrH.mjs} +5 -5
  123. package/dist/{get-C3ojRVJ_.mjs → get-DKbGKa6F.mjs} +4 -4
  124. package/dist/{get-HFQSttF3.mjs → get-DRhcS76J.mjs} +5 -5
  125. package/dist/{get-BiPSePQc.mjs → get-Dp45rXRS.mjs} +3 -3
  126. package/dist/{get-DUwX-RU82.mjs → get-HzDQViDP2.mjs} +5 -5
  127. package/dist/{get-CcwRn8Y2.mjs → get-LRTRu85E.mjs} +5 -5
  128. package/dist/{get-IjoHBExI.mjs → get-RCDF-hEq.mjs} +5 -5
  129. package/dist/{get-CVpIQb8v.mjs → get-eNRULmE5.mjs} +5 -5
  130. package/dist/{get-hAoJtVCK.mjs → get-p2sZvp7v.mjs} +3 -3
  131. package/dist/{get-run-B2SnsZSY.mjs → get-run-C3AHKn3-.mjs} +4 -4
  132. package/dist/git-sync-CNTB5jvI.mjs +29 -0
  133. package/dist/{git-sync-Ch1V1fEK.mjs → git-sync-D1aKczo6.mjs} +15 -8
  134. package/dist/{git-sync-COokpYgc.mjs → git-sync-DP4wQFzm.mjs} +18 -1
  135. package/dist/glossary-B9Eo4hXc.mjs +14 -0
  136. package/dist/{glossary-wnuxoE_I.mjs → glossary-BkGmCI4X.mjs} +1 -1
  137. package/dist/{glossary-6LLpItof.mjs → glossary-QN-hHfOT.mjs} +1 -1
  138. package/dist/{graph-CHlfxVy1.mjs → graph-BGOYocJc.mjs} +6 -6
  139. package/dist/{group-B3X3LTcU.mjs → group-81zoQcEP.mjs} +1 -1
  140. package/dist/{has-remote-changes-DCMpqGgE.mjs → has-remote-changes-DxsRvZsw.mjs} +4 -4
  141. package/dist/{import-C7MZhKo6.mjs → import-izn2_OsW.mjs} +7 -7
  142. package/dist/{is-dirty-DpLyHebS.mjs → is-dirty-DHYYRl6Y.mjs} +2 -2
  143. package/dist/{items-1ME_eg27.mjs → items-mIoZBqUc.mjs} +6 -6
  144. package/dist/{key-DMtgTOwN.mjs → key-BYEv4Wgq.mjs} +2 -2
  145. package/dist/{library-D2ogEIfI.mjs → library-5I0TlXmf.mjs} +5 -5
  146. package/dist/{library-fWEv38OB.mjs → library-DKIqzyUk.mjs} +2 -2
  147. package/dist/{library-CP-9yepy.mjs → library-wUiD2jbw.mjs} +1 -1
  148. package/dist/{list-BUwDGyIu.mjs → list-B6TYzXyW.mjs} +5 -5
  149. package/dist/{list-Ud7F0XdU.mjs → list-B8FPpgct.mjs} +3 -3
  150. package/dist/{list-B0h-j1E7.mjs → list-BEBAq1xc.mjs} +5 -5
  151. package/dist/{list-OXiXtdiM.mjs → list-BKhJfFyB.mjs} +5 -5
  152. package/dist/{list-STy8UHs2.mjs → list-BxIulkp3.mjs} +6 -6
  153. package/dist/{list-CQi3AgS5.mjs → list-C-f-G-cC.mjs} +5 -5
  154. package/dist/{list-dCi6OaIE.mjs → list-C1dEh2yq.mjs} +6 -6
  155. package/dist/{list-DkCadZ2E.mjs → list-C3CXHKTW.mjs} +5 -5
  156. package/dist/{list-LMlJ4uAY.mjs → list-C6roDyBd.mjs} +6 -6
  157. package/dist/{list-CJ5FyCnL.mjs → list-CT7AOXTS.mjs} +4 -4
  158. package/dist/{list-BUZ91ctZ.mjs → list-CTlIVHeG.mjs} +5 -5
  159. package/dist/list-CmOTwt_z.mjs +35 -0
  160. package/dist/list-CpxEOoqw.mjs +48 -0
  161. package/dist/{list-DzP7YXdZ.mjs → list-CuEPFHrk.mjs} +3 -3
  162. package/dist/{list-DBAEy3Rx.mjs → list-D8jiz8YP.mjs} +3 -3
  163. package/dist/{list-NINy7ybI.mjs → list-DV4wojtv.mjs} +4 -4
  164. package/dist/{list-BXcDPU5d.mjs → list-DVnPzc5m.mjs} +6 -6
  165. package/dist/list-NeImhwLD.mjs +28 -0
  166. package/dist/{list-CVh8DHOO.mjs → list-OWPg67JC.mjs} +5 -5
  167. package/dist/{list-C9996vbS.mjs → list-O_nmgwSj.mjs} +3 -3
  168. package/dist/{list-C1oEpUZG.mjs → list-jT5ndEGr.mjs} +3 -3
  169. package/dist/{login-BMON3Fft.mjs → login-DOW1mr40.mjs} +15 -8
  170. package/dist/{logout-Cx934GzW.mjs → logout-BQ8wywf7.mjs} +2 -2
  171. package/dist/{measure-CUqJtDNm.mjs → measure-Bz-bGn-Z.mjs} +6 -6
  172. package/dist/{moderation-review-BdqEH6N1.mjs → moderation-review-Bf9bPNQI.mjs} +1 -1
  173. package/dist/{notification-CCZ9mrOw.mjs → notification-W2SVssyY.mjs} +1 -1
  174. package/dist/{parameter-Celg0wZa.mjs → parameter-DvRQMKd2.mjs} +6 -6
  175. package/dist/{parameter-values-DCrU02Az.mjs → parameter-values-B7rr6fcy.mjs} +21 -7
  176. package/dist/{parse-enum-Do5Cptbv.mjs → parse-enum-DAcTzG1q.mjs} +1 -1
  177. package/dist/{parse-id-oCbmouCn.mjs → parse-id-5BZGQ9Vd.mjs} +1 -1
  178. package/dist/{parse-ref-Df8gusl4.mjs → parse-ref-ByXc-pls.mjs} +1 -1
  179. package/dist/{parse-text-CVrP7GmZ.mjs → parse-text-FgX60vIg.mjs} +1 -1
  180. package/dist/{path-DTuSDGd6.mjs → path-CHQguAPa.mjs} +4 -4
  181. package/dist/{poll-BKo5dK0l.mjs → poll-CgtcJopL.mjs} +2 -2
  182. package/dist/{preflight-UeYuGDPr.mjs → preflight-ChTKhB8Y.mjs} +2 -2
  183. package/dist/{process-BpmZXbcw.mjs → process-aqXm5QgC.mjs} +1 -1
  184. package/dist/{publish-D3GwLC-K.mjs → publish-CaoFOucS.mjs} +4 -4
  185. package/dist/{pulse-Dz0ocv0l.mjs → pulse-CC81N2_0.mjs} +1 -1
  186. package/dist/{pulse-DzVPfb5J.mjs → pulse-JPrq6NFP.mjs} +2 -2
  187. package/dist/{query-Ct697cY-.mjs → query-0u1WR1bV.mjs} +13 -12
  188. package/dist/query-BKtMP5eH.mjs +13 -0
  189. package/dist/{query-B1Cp9EO6.mjs → query-CzDBwAZD.mjs} +17 -7
  190. package/dist/{remapping-RsoPWE7c.mjs → remapping-CodmT28F.mjs} +5 -5
  191. package/dist/{remove-collection-BJo3Wd9K.mjs → remove-collection-DfUsf6Dd.mjs} +5 -5
  192. package/dist/{render-C_ev6qoW.mjs → render-DP6UoZNT.mjs} +2 -2
  193. package/dist/{replace-BSAGp3cR.mjs → replace-qWiUOgmn.mjs} +4 -4
  194. package/dist/{requirement-check-T3bjQ0Mr.mjs → requirement-check-sfmyH2PH.mjs} +2 -2
  195. package/dist/{rescan-values-rpro4Kw2.mjs → rescan-values-BcrhdSj_.mjs} +5 -5
  196. package/dist/{rescan-values-CE62_2dc.mjs → rescan-values-BuDmeda3.mjs} +5 -5
  197. package/dist/{run-BI1QO9Kn.mjs → run-BBRnFayr.mjs} +7 -7
  198. package/dist/{run-B3BRodEp.mjs → run-BG_5lR0x.mjs} +4 -4
  199. package/dist/run-DXXD-CnS.mjs +63 -0
  200. package/dist/{runs-CUseZezf.mjs → runs-CovgMSwy.mjs} +5 -5
  201. package/dist/{runtime-C5Ha6Ou8.mjs → runtime-Cmes70jO.mjs} +63 -80
  202. package/dist/{schema-tables-C7YkyRh0.mjs → schema-tables-CjKl8jr5.mjs} +6 -6
  203. package/dist/{schemas-Bj5sJ9uB.mjs → schemas-CAGvBAD_.mjs} +4 -4
  204. package/dist/{search-BAXg-EJw.mjs → search-1et9tv_s.mjs} +22 -4
  205. package/dist/{search-BsAwK7Rk.mjs → search-DFU6FHRd.mjs} +6 -6
  206. package/dist/{search-CB1A4HWx.mjs → search-OpYS2Ub4.mjs} +21 -6
  207. package/dist/{segment-BEjaeLc5.mjs → segment-D-SKpFzF.mjs} +6 -6
  208. package/dist/{send-Dfh8d1gG.mjs → send-DNu83_3E.mjs} +3 -3
  209. package/dist/{set-DA8dKyzi.mjs → set-CGYZcLVo.mjs} +4 -4
  210. package/dist/{set-active-AyjKtBD-.mjs → set-active-32IaLx1O.mjs} +4 -4
  211. package/dist/set-data-actions-DRhgAfhE.mjs +46 -0
  212. package/dist/{set-sensitivity-D0613dHA.mjs → set-sensitivity-D_i3XEe8.mjs} +6 -6
  213. package/dist/{setting-B-bxCkC0.mjs → setting-BBn9Lv9J.mjs} +4 -4
  214. package/dist/{setup-Bvvqlz9d.mjs → setup-8d7Uplhy.mjs} +3 -3
  215. package/dist/{signal-Dm4N0Bcc.mjs → signal-D8MH3LMN.mjs} +1 -1
  216. package/dist/{skill-list-DkuCf0k4.mjs → skill-list-D2FhhYS3.mjs} +1 -1
  217. package/dist/{skills-DlDCTGVE.mjs → skills-BZGd_9d3.mjs} +2 -2
  218. package/dist/{skills-DxrO7HUz.mjs → skills-BeIDC-_H.mjs} +3 -3
  219. package/dist/snippet-CpZ5cJ_y.mjs +19 -0
  220. package/dist/{stash-j9JPv3ns.mjs → stash-Dyc1xZ8u.mjs} +6 -6
  221. package/dist/{status-DcbvbRc5.mjs → status-CQZwl1PX.mjs} +3 -3
  222. package/dist/{status-DxNcrfnI.mjs → status-lCN8unWe.mjs} +37 -16
  223. package/dist/{subscription-CSR2t-xK.mjs → subscription-CEFxmtGH.mjs} +6 -6
  224. package/dist/{subscriptions--0YvW40u.mjs → subscriptions-AU14uznL.mjs} +6 -6
  225. package/dist/{summary-Dslv78-r.mjs → summary-Do9IBOQM.mjs} +5 -5
  226. package/dist/{sync-schema-Dgij5ICd.mjs → sync-schema-B3nyoKZl.mjs} +5 -5
  227. package/dist/{sync-schema-BSJiokQf.mjs → sync-schema-_gw9RQyF.mjs} +6 -6
  228. package/dist/{sync-task-a1zyF1Qb.mjs → sync-task-DNKG9Bk4.mjs} +4 -3
  229. package/dist/{table-Uvu1roSx.mjs → table-BDsqRU7a.mjs} +3 -3
  230. package/dist/{table-zAdW5_3H.mjs → table-CF7zW9cI.mjs} +33 -20
  231. package/dist/table-Cb_Uvw8m.mjs +26 -0
  232. package/dist/{table-selector-flags-B9OiA3Z1.mjs → table-selector-flags-CHfrVpYQ.mjs} +3 -3
  233. package/dist/{text-821Rn8M9.mjs → text-C2VwKF9D.mjs} +1 -1
  234. package/dist/{timeline-uDCmwGFT.mjs → timeline-BgWz8DYK.mjs} +1 -1
  235. package/dist/{timeline-CCSU2qOS.mjs → timeline-DcsCXNUt.mjs} +5 -1
  236. package/dist/{timeline-event-CSzx8EDP.mjs → timeline-event-B-nGnoVL.mjs} +6 -6
  237. package/dist/timeline-x0s_3sfc.mjs +21 -0
  238. package/dist/{transform-BKX6tl3i.mjs → transform-CWGJB8N_.mjs} +1 -1
  239. package/dist/{transform-job-AaMZRxAq.mjs → transform-job-BBZ5L46v.mjs} +1 -1
  240. package/dist/{transform-job-CCguL6LP.mjs → transform-job-ClX8e5iO.mjs} +2 -1
  241. package/dist/transform-job-Dlx2c6II.mjs +22 -0
  242. package/dist/transform-kP11Mv9_.mjs +28 -0
  243. package/dist/{transform-tag-DHg7j15d.mjs → transform-tag-dKCqQPTd.mjs} +5 -5
  244. package/dist/transform-test-Bexa_K89.mjs +173 -0
  245. package/dist/transform-test-C49ZTK7M.mjs +32 -0
  246. package/dist/transform-test-jFuzVhlT.mjs +16 -0
  247. package/dist/{transforms-DwxPfMiG.mjs → transforms-DRAws1f4.mjs} +5 -5
  248. package/dist/transport-Ck4anhoc.mjs +416 -0
  249. package/dist/{tree-COFmA20J.mjs → tree-Ddsj298M.mjs} +3 -3
  250. package/dist/{unpublish-BQClh4U7.mjs → unpublish-BMfjQ8UV.mjs} +3 -3
  251. package/dist/{unreferenced-DKc0zZDl.mjs → unreferenced-DRQrvH5r.mjs} +6 -6
  252. package/dist/{update-CMRWXoZ2.mjs → update-0AoF6QJ_.mjs} +4 -4
  253. package/dist/{update-BVFfoopT.mjs → update-6sfqiInZ.mjs} +5 -5
  254. package/dist/{update-MxvqmZ3z.mjs → update-8eXJso_l.mjs} +6 -6
  255. package/dist/{update-BNwjjMk6.mjs → update-BCC1Igr2.mjs} +5 -5
  256. package/dist/{update-CFfr1ZdL.mjs → update-BIL0JPqm.mjs} +4 -4
  257. package/dist/{update-BVMgrMy7.mjs → update-BQLTaw3z.mjs} +6 -6
  258. package/dist/{update-CPmPnEvm.mjs → update-Bpsdi6kM.mjs} +6 -6
  259. package/dist/{update-kM3TDlEp.mjs → update-BtfUX9CN.mjs} +8 -8
  260. package/dist/{update-myfBF5qV.mjs → update-C19B1Sry.mjs} +6 -6
  261. package/dist/{update-Ca8LSZer.mjs → update-C1VwtJWu.mjs} +5 -5
  262. package/dist/update-C1x90FSH.mjs +52 -0
  263. package/dist/{update-C9HK3i8s.mjs → update-CGpiLu7N.mjs} +8 -8
  264. package/dist/{update-Dwr3n7_n.mjs → update-CnxzmPRG.mjs} +7 -7
  265. package/dist/update-D1aKeWfo.mjs +41 -0
  266. package/dist/{update-Bgy2amR0.mjs → update-DlFHoUxe.mjs} +6 -6
  267. package/dist/{update-DJwu8UT2.mjs → update-DpP1EEC0.mjs} +6 -6
  268. package/dist/{update-B-wcIl8T.mjs → update-DrT10fxQ.mjs} +6 -6
  269. package/dist/{update-B8jQTspb.mjs → update-_hHnM1Hx.mjs} +7 -8
  270. package/dist/{update-dashcard-C8QN2Qcu.mjs → update-dashcard-CDI0Tnxy.mjs} +7 -7
  271. package/dist/{update-BBLbEPEP.mjs → update-pXVhyiFo.mjs} +6 -6
  272. package/dist/{upgrade-BBOEVIRa.mjs → upgrade-Cfouv1Ii.mjs} +4 -4
  273. package/dist/upload-Cqv-In6j.mjs +13 -0
  274. package/dist/{upload-CoBd4qBp.mjs → upload-DIEcI5iM.mjs} +3 -3
  275. package/dist/{upload-CxpXpjCf.mjs → upload-DnLXgUA-.mjs} +3 -3
  276. package/dist/{uuid-DW30GY7B.mjs → uuid-D0sH5txV.mjs} +2 -2
  277. package/dist/{validate-n85yMraN.mjs → validate-BQ7vI8_x.mjs} +1 -1
  278. package/dist/{validate-query-BwXvFFYi.mjs → validate-query-YtH3d5BP.mjs} +7 -3
  279. package/dist/{values-B6eFE4K5.mjs → values-BFPO6y5o.mjs} +5 -5
  280. package/dist/{verify-DnU-wXIs.mjs → verify-7fW020r_.mjs} +3 -3
  281. package/dist/{verify-BSq7x66g.mjs → verify-C-StvB4f.mjs} +5 -5
  282. package/dist/{verify-Dp8tUbP3.mjs → verify-CuGs0X3C.mjs} +5 -5
  283. package/dist/{verify-flags-CMpRkMPa.mjs → verify-flags-DEVMB9w0.mjs} +1 -1
  284. package/dist/{wait-D6Tw4ZxO.mjs → wait-Cvt8xO0h.mjs} +6 -6
  285. package/dist/{wait-flags-BRUzMI6S.mjs → wait-flags-BnZ-dfE2.mjs} +2 -2
  286. package/dist/{window-BqMFpWMh.mjs → window-CfK_j6m1.mjs} +1 -1
  287. package/package.json +1 -1
  288. package/skill-data/core/SKILL.md +11 -5
  289. package/skill-data/data-action/SKILL.md +136 -0
  290. package/skill-data/git-sync/SKILL.md +3 -3
  291. package/skill-data/native-sql/SKILL.md +1 -1
  292. package/skill-data/transform/SKILL.md +64 -2
  293. package/skill-data/transform-test-plan/SKILL.md +82 -0
  294. package/skill-data/transform-test-plan/references/checklist.md +32 -0
  295. package/skill-data/transform-test-plan/references/checks.md +156 -0
  296. package/dist/card-Buc-X4Mh.mjs +0 -25
  297. package/dist/collection-D-sS0AFw.mjs +0 -21
  298. package/dist/dashboard-DH_soSQp.mjs +0 -35
  299. package/dist/db-C82M3Gpg.mjs +0 -24
  300. package/dist/dependency-CLznxtLE.mjs +0 -15
  301. package/dist/document-WhSEyI-3.mjs +0 -20
  302. package/dist/embedding-i-KqpefC.mjs +0 -9
  303. package/dist/field-qF1KRJYB.mjs +0 -21
  304. package/dist/git-sync-BlgB_-8-.mjs +0 -29
  305. package/dist/glossary-BvVxqjxJ.mjs +0 -14
  306. package/dist/input-sRdxNc3T.mjs +0 -61
  307. package/dist/list-BoVeF8QA.mjs +0 -38
  308. package/dist/snippet-B7Kau5U8.mjs +0 -19
  309. package/dist/table-qjgz2eek.mjs +0 -26
  310. package/dist/timeline-CNkrY3e3.mjs +0 -21
  311. package/dist/transform-Y86R7_2F.mjs +0 -28
  312. package/dist/transform-job-Cg_1jzWI.mjs +0 -22
  313. package/dist/upload-fcim1xtK.mjs +0 -13
@@ -0,0 +1,136 @@
1
+ ---
2
+ name: data-action
3
+ description: Author and run Metabase data actions with the `mb` CLI — saved, parameterized native SQL writes (INSERT, UPDATE, DELETE) filed in a collection and run with values. Covers enabling them on a database, the collection they go in, the body, mapping template tags to parameters, running, and the lifecycle. Triggers — "add a data action", "let users update a row", "a button that inserts a record", "run a write query", "a form that saves to the database", "delete rows from Metabase".
4
+ allowed-tools: Read, Write, Edit, Bash, AskUserQuestion
5
+ requires: [dataActionsWithoutModel]
6
+ ---
7
+
8
+ # Data actions
9
+
10
+ A **data action** is one native SQL statement that writes — `INSERT`, `UPDATE` or `DELETE` — with named inputs. It lives in a collection, and dashboards, apps and `mb data-action execute` run it with values.
11
+
12
+ Flag conventions and `./.scratch` are in `core`; the native query and its template tags follow `native-sql`. This skill covers what a data action adds.
13
+
14
+ ## Check the database first
15
+
16
+ Data actions are off on every database until an admin turns on **Data actions** for it ("Allow data actions that use this database to be run", Admin → Databases → the database). That toggle is the database setting `database-enable-actions`.
17
+
18
+ ```bash
19
+ mb db get <id> --full --json
20
+ ```
21
+
22
+ - `features` must contain `"actions"` — otherwise the driver cannot run writes; pick another database.
23
+ - `settings["database-enable-actions"]` must be `true`. Create and execute fail with `Actions are not enabled.` until then. An admin profile turns it on with `mb db set-data-actions <id> true`; anyone else asks an admin to. Turning it on lets anyone with access to the database's actions write to it, so confirm with the user first.
24
+
25
+ ## Pick the collection
26
+
27
+ A data action goes in a data actions collection, a data app collection, or the data actions root (omit `collection_id`). A regular collection is refused with `An action without a model can only go in a data actions or data app collection.` Make one with:
28
+
29
+ ```bash
30
+ mb collection create --namespace data-actions --body '{"name":"Order actions"}' --json
31
+ ```
32
+
33
+ ## The body
34
+
35
+ Mint one template-tag `id` per tag with `mb uuid --count <n> --format text`.
36
+
37
+ ```json
38
+ {
39
+ "name": "Set order note",
40
+ "type": "query",
41
+ "database_id": 1,
42
+ "collection_id": 12,
43
+ "dataset_query": {
44
+ "lib/type": "mbql/query",
45
+ "database": 1,
46
+ "stages": [
47
+ {
48
+ "lib/type": "mbql.stage/native",
49
+ "native": "UPDATE orders SET note = {{note}} WHERE id = {{order_id}}",
50
+ "template-tags": {
51
+ "order_id": {
52
+ "id": "6f1c9a4e-2b7d-4e0a-9c3f-1d2e3f4a5b6c",
53
+ "name": "order_id",
54
+ "display-name": "Order ID",
55
+ "type": "number",
56
+ "required": true
57
+ },
58
+ "note": {
59
+ "id": "0b8d7c6e-5f4a-4b3c-8d2e-1f0a9b8c7d6e",
60
+ "name": "note",
61
+ "display-name": "Note",
62
+ "type": "text",
63
+ "required": true
64
+ }
65
+ }
66
+ }
67
+ ]
68
+ },
69
+ "parameters": [
70
+ {
71
+ "id": "order_id",
72
+ "slug": "order_id",
73
+ "name": "Order ID",
74
+ "type": "number/=",
75
+ "target": ["variable", ["template-tag", "order_id"]],
76
+ "required": true
77
+ },
78
+ {
79
+ "id": "note",
80
+ "slug": "note",
81
+ "name": "Note",
82
+ "type": "string/=",
83
+ "target": ["variable", ["template-tag", "note"]],
84
+ "required": true
85
+ }
86
+ ]
87
+ }
88
+ ```
89
+
90
+ - `type` is always `"query"`. Never set `model_id` or `type: "implicit"`; `mb data-action create` refuses both.
91
+ - `database_id` and `dataset_query.database` are the same id (`mb db list`). `collection_id` is the data actions collection (here `12`); omit it for the data actions root.
92
+ - A template tag's `id` is a UUID, unique among the tags: the representation schema requires one.
93
+ - One statement, no `;`. `create` and `update` validate `dataset_query` as `native-sql` does.
94
+
95
+ ## Parameters: one per template tag
96
+
97
+ Each `{{name}}` needs a `template-tags` entry and a `parameters` entry, all using the same name:
98
+
99
+ | Tag `type` | Parameter `type` |
100
+ | ---------- | ---------------- |
101
+ | `number` | `number/=` |
102
+ | `text` | `string/=` |
103
+ | `date` | `date/single` |
104
+ | `boolean` | `boolean/=` |
105
+
106
+ - Parameter `id` and `slug` are the tag name (not the tag's UUID `id`); `target` is `["variable", ["template-tag", "<name>"]]`.
107
+ - Use raw variables only. A field filter (`type: "dimension"`), snippet or card reference does not work in a write — write the comparison yourself (`WHERE id = {{order_id}}`).
108
+ - Set `required: true` on every input the statement cannot run without (`WHERE` keys, `NOT NULL` columns).
109
+ - Wrap an optional input in `[[ … ]]` with `required: false`; the clause drops out when no value is given. This makes one action do partial updates: `UPDATE orders SET updated_at = now() [[, note = {{note}}]] [[, status = {{status}}]] WHERE id = {{order_id}}`.
110
+
111
+ ## Run it
112
+
113
+ ```bash
114
+ mb data-action execute <id> --body '{"parameters":{"order_id":1042,"note":"rush delivery"}}'
115
+ ```
116
+
117
+ `parameters` is keyed by parameter `id`. The result is `{"rows-affected": <n>}`. A missing required value is refused. A run cannot be undone, so confirm with the user before running against data that matters, and test a new action on a row created for the purpose.
118
+
119
+ ## Lifecycle
120
+
121
+ | Task | Command |
122
+ | ------------------------ | ---------------------------------------------------------------------------------------- |
123
+ | Find | `mb data-action list` (unarchived only), `mb search --models action <text>` |
124
+ | Inspect | `mb data-action get <id> --full --json` |
125
+ | Change SQL, inputs, name | `mb data-action update <id> --file patch.json` (changed fields only) |
126
+ | Move | `mb data-action update <id> --body '{"collection_id":<id>}'` |
127
+ | Archive / restore | `mb data-action archive <id>` / `mb data-action update <id> --body '{"archived":false}'` |
128
+ | Delete | `mb data-action delete <id> --yes` (also removes the dashboard buttons that run it) |
129
+
130
+ Archiving or deleting a collection archives or deletes its data actions. Existing model-bound or implicit data actions still list, run and archive; leave them as they are.
131
+
132
+ ## Don't
133
+
134
+ - Don't create a model for a data action.
135
+ - Don't concatenate values into the SQL; every value goes through a template tag.
136
+ - Don't run a data action on production data without the user's go-ahead.
@@ -24,7 +24,7 @@ Exporting after the remote moved on ends in a `conflict` task unless the export
24
24
  <!-- /requires -->
25
25
 
26
26
  ```bash
27
- mb git-sync status --profile <n> --json # → branch, dirty, current task
27
+ mb git-sync status --profile <n> --json # → remote configured, sync type, branch, dirty, current task
28
28
  mb git-sync is-dirty --profile <n> --json # → {is_dirty: bool}; instance has unexported changes
29
29
  mb git-sync dirty --profile <n> --json # → list the dirty objects
30
30
  mb git-sync current-task --profile <n> --json # → in-flight task (or idle)
@@ -197,7 +197,7 @@ Both verbs return `{ success: true }`, plus a `task_id` only when the toggle sta
197
197
 
198
198
  **Cascade.** A toggle on a parent cascades to every descendant by `location` prefix — `add-collection 4` flips `4` plus every collection nested under it. `remove-collection 4` is the symmetric inverse. There is no per-leaf-only mode.
199
199
 
200
- **Mode prerequisite.** The server rejects toggles while `remote-sync-type` is `:read-only` (the install default). If `mb git-sync add-collection 12` returns `Metabase returned 400 … Cannot change synced collections when remote-sync-type is read-only.`, switch first with:
200
+ **Mode prerequisite.** The server rejects toggles while `remote-sync-type` is `:read-only` (the install default; `mb git-sync status --json` reports it as `sync_type`). If `mb git-sync add-collection 12` returns `Metabase returned 400 … Cannot change synced collections when remote-sync-type is read-only.`, switch first with:
201
201
 
202
202
  ```bash
203
203
  mb setting set remote-sync-type '"read-write"' --profile <n>
@@ -256,7 +256,7 @@ Flagging the collection records it for the next export, which serializes its cur
256
256
  - Don't turn instance-side changes into hand-written repo files: export them and PR the exported branch (see the top of this skill). Files pushed behind Metabase's back race its own sync tasks.
257
257
  - Don't conclude from an empty `dirty` list that a change type isn't tracked. Dirty-tracking only records changes to _eligible_ objects; the usual cause is scope (the collection isn't flagged — see "Published table metadata"), not capability. Check `synced_collections` in `status` before concluding.
258
258
  - Don't run `git-sync import --force` or `git-sync export --force` without explicit user confirmation. Both are lossy — `--force` import discards instance-side work, `--force` export overwrites the remote branch.
259
- - Don't drive `git-sync` against a Metabase instance that doesn't have remote-sync configured — every verb returns an error pointing at the missing `remote-sync-*` settings. To check: `mb setting get remote-sync-url --profile <n> --json`.
259
+ - Don't drive `git-sync` against a Metabase instance that doesn't have remote-sync configured — every verb returns an error pointing at the missing `remote-sync-*` settings. To check: `mb git-sync status --profile <n> --json` reports `remote_configured: false` when no remote is configured.
260
260
  - Don't author content directly via `card create` / `transform create` and then assume `git-sync export` will commit it cleanly — the instance and repo can drift if you mix direct API writes with sync-tracked changes. If you do, follow direct writes immediately with `git-sync export -m "..."` to keep them in step.
261
261
  - Don't move a dashboard or question into a synced collection before what it depends on, and don't retry a `Uses content that is not remote synced.` refusal unchanged. Move the listed dependencies first, move the whole containing collection, or build the content in the synced collection to begin with (see "Moving content into or out of a synced collection").
262
262
  - Don't omit `-m` on `export` if the user wants a meaningful commit message — the default server-generated message is generic.
@@ -112,6 +112,6 @@ mb card query 12 --parameters '[{"type":"string/=","target":["dimension",["templ
112
112
 
113
113
  - Don't wrap a field filter in an operator (`WHERE col = {{ff}}`) — write it bare (`WHERE {{ff}}`).
114
114
  - Don't author the flat `{type:"native", …}` form — send the native stage above.
115
- - Don't use native SQL for DDL or multiple statements — the editor is read-only, single-statement; `CREATE`/`UPDATE`/`;`-chained SQL is unsupported. To materialize a table, use a `transform`.
115
+ - Don't use native SQL for DDL or multiple statements — the editor is read-only, single-statement; `CREATE`/`UPDATE`/`;`-chained SQL is unsupported. To materialize a table, use a `transform`; to write rows (`INSERT`/`UPDATE`/`DELETE`), use a data action (`data-action`).
116
116
  - Don't expect `[[ ]]` to save you from a case/type mismatch — `WHERE plan = {{p}}` returns zero rows on a case-sensitive engine if the value's case is off; that's a value problem, not syntax.
117
117
  - Don't reach for native when a structured query fits — you lose the engine-independence and readability of an `mbql.stage/mbql` stage.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: transform
3
- description: Author and run Metabase transforms via `mb` — body shape (native SQL or structured MBQL), create + run-with-wait, run inspection, dependencies, cancel, the `update`-vs-recreate iteration rule, the writable-keys-only PATCH contract, plus transform tags and tag-driven transform-job schedules. Load when the user touches transforms — "create a transform", "run a transform", "fix a failing transform", "list transform runs", "cancel a running transform", "manage transform tags", "run a transform job", or anything `mb transform …` / `mb transform-job …` / `mb transform-tag …`.
3
+ description: Author and run Metabase transforms via `mb` — body shape (native SQL or structured MBQL), create + run-with-wait, run inspection, dependencies, cancel, the `update`-vs-recreate iteration rule, the writable-keys-only PATCH contract, transform tests (fixtures and expectations run against temp tables), plus transform tags and tag-driven transform-job schedules. Load when the user touches transforms — "create a transform", "run a transform", "fix a failing transform", "test a transform", "list transform runs", "cancel a running transform", "manage transform tags", "run a transform job", or anything `mb transform …` / `mb transform-job …` / `mb transform-tag …` / `mb transform-test …`.
4
4
  allowed-tools: Read, Write, Edit, Bash, AskUserQuestion
5
5
  requires: [transforms]
6
6
  ---
@@ -51,7 +51,7 @@ mb transform run "$TRANSFORM_ID" --wait --profile <name> --json
51
51
  - The `--json` envelope is shape-stable: `{message, run_id, final}` (plus `target_table_id` under `--sync` — a number, or `null` if the table didn't register before the timeout). `final` is `null` when `--wait` is omitted or the run never started, otherwise a full `TransformRun` with `status` and `message`. On a failed run (`final.status` ∈ {`failed`, `timeout`, `canceled`}) the CLI exits 1 and writes a one-line `transform run <id> failed` to stderr; the failure detail lives only in `final.message` on stdout, so `jq -r '.final.message'` is where to look.
52
52
  - `transform create --json` returns the agent-facing compact projection: `{id, name, description, source_type, target: {type, database, schema, name}, target_db_id}`. Read `target.schema`/`target.name` directly off it — no follow-up `transform get`.
53
53
  - If a transform with the same `name` already has a YAML representation on disk under the configured remote-sync repo, `create` mints a `_2` suffix on the exported filename (the new transform gets a fresh `entity_id`; the prior one isn't touched). For "iterate on the same concept", prefer `transform update <id>` — see "Iterating on a failing transform".
54
- - **`collection_id` only accepts a collection in the `:transforms` namespace.** Transforms aren't filed next to cards and dashboards — a normal analytics collection id fails create/update with `collection_id: A Transform can only go in Collections in the :transforms namespace.` Omit `collection_id` to leave the transform uncollected (the common case), or provision one with `mb collection create --body '{"name":"…"}' --namespace transforms --json` (see `core`) and pass the returned `id`. Cards and dashboards you build **on top of** the output table go in ordinary collections — so "put the transform and its dashboard in collection X" means _X holds the dashboard + cards; the transform stays in the transforms namespace._
54
+ - **`collection_id` only accepts a collection in the `:transforms` namespace.** Transforms aren't filed next to cards and dashboards — a normal analytics collection id fails create/update with `collection_id: A Transform can only go in Collections in the :transforms namespace.` Omit `collection_id` to leave the transform uncollected (the common case), or reuse one from `mb collection list --namespace transforms --json`, or provision one with `mb collection create --body '{"name":"…"}' --namespace transforms --json` (see `core`) and pass the returned `id`. Cards and dashboards you build **on top of** the output table go in ordinary collections — so "put the transform and its dashboard in collection X" means _X holds the dashboard + cards; the transform stays in the transforms namespace._
55
55
 
56
56
  ## Inspect
57
57
 
@@ -173,6 +173,68 @@ mb transform run "$ID" --wait --profile <n> --json # → succeeded
173
173
 
174
174
  If you really must `create + delete` instead, do the `delete` **before** the first `git-sync export` so the failed entity never lands in git history — an export of a soft-failed state is noise that needs a follow-up cleanup commit. See `git-sync`, "Read state before mutating", for the ordering rule.
175
175
 
176
+ <!-- requires: transformTests -->
177
+
178
+ ## Transform tests
179
+
180
+ A transform test replaces every table the transform reads with a fixture, runs it into a temp table, and checks that output. The transform and the expectations read only the run's temp tables; a `format: "sql"` input runs verbatim against the transform's source database, so it may read real tables. Only query transforms (native SQL or MBQL) can be tested, and only on Postgres, MySQL, H2, ClickHouse, Redshift or SQL Server; otherwise `create`/`update`/`run` refuse with `transform-test.unsupported-transform` / `unsupported-driver` (422).
181
+
182
+ ```bash
183
+ mb transform-test list --transform-id <id> --profile <n> --json # --transform-id is optional
184
+ mb transform-test get <id> --full --profile <n> --json # --full for inputs/expectations
185
+ mb transform-test create --file ./.scratch/test.json --profile <n> --json
186
+ mb transform-test update <id> --file ./.scratch/patch.json --profile <n> --json
187
+ mb transform-test delete <id> --yes --profile <n>
188
+ mb transform-test run <id> --profile <n> --json # exits 1 unless it passes
189
+ ```
190
+
191
+ **`inputs`** — one per table the transform reads, each naming a `table` plus either `format: "sql"` with `sql`, or `format: "rows"` with `columns` (each a `name` and a `cast_type`) and `rows`.
192
+
193
+ **`cast_type` is a `CAST` target, not a column type**, and the two vocabularies differ per warehouse: MySQL casts to `SIGNED` and reports `BIGINT`; ClickHouse takes `Nullable(Int32)` for a column that is `Int64`. So a body is warehouse-specific — don't copy a `database_type` out of a run result into a `cast_type`, and don't expect one body to run everywhere.
194
+
195
+ **`expectations`** — `type: "empty"` with the `sql` that must return no rows, or `type: "equals"` with `format: "rows"` and the `columns` and `rows` the output must hold exactly. `equals` compares the rows as a multiset over the declared columns only, so an output column it does not declare is never checked. An `equals` without a `format` is refused, and one with `format: "sql"` is saved but reports `error` on every run, so its test can never pass.
196
+
197
+ **Expectation SQL may only name the transform's target table and its declared input tables.** Those are rewritten to the run's temp tables; any other table is refused with `transform-test.unremapped-reference` (400), at `create`/`update` as well as `run`. A column qualified by its table name (`people.id`) is refused the same way, in expectation SQL and in the transform's own SQL alike: qualify by an alias (`FROM people p … p.id`) or leave the column bare — for the transform's SQL that means editing the transform. Expectation names are unique within a test (refused with "expectation names must be unique within a test"), and every `rows` row carries exactly its declared columns (refused naming the missing or undeclared columns).
198
+
199
+ ```json
200
+ {
201
+ "transform_id": 1,
202
+ "name": "adults only",
203
+ "inputs": [
204
+ {
205
+ "table": { "schema": "public", "name": "people" },
206
+ "format": "rows",
207
+ "columns": [
208
+ { "name": "id", "cast_type": "INTEGER" },
209
+ { "name": "age", "cast_type": "INTEGER" }
210
+ ],
211
+ "rows": [
212
+ { "id": 1, "age": 30 },
213
+ { "id": 2, "age": 12 }
214
+ ]
215
+ }
216
+ ],
217
+ "expectations": [
218
+ {
219
+ "type": "equals",
220
+ "name": "exactly one row, id 1",
221
+ "format": "rows",
222
+ "columns": [{ "name": "id", "cast_type": "INTEGER" }],
223
+ "rows": [{ "id": 1 }]
224
+ },
225
+ {
226
+ "type": "empty",
227
+ "name": "no null ids",
228
+ "sql": "SELECT * FROM public.adults WHERE id IS NULL"
229
+ }
230
+ ]
231
+ }
232
+ ```
233
+
234
+ Create and update bodies are closed at every level (the top level is checked before sending; a stray nested key is a 400) — strip `id`, `entity_id`, `creator_id`, `created_at` and `updated_at` from a `get --full` body before sending it back.
235
+
236
+ <!-- /requires -->
237
+
176
238
  ## Drop the materialized table (keep the transform)
177
239
 
178
240
  ```bash
@@ -0,0 +1,82 @@
1
+ ---
2
+ name: transform-test-plan
3
+ description: Derive a comprehensive test plan for a transform — the fixture cast, the expectations, hand-derived expected rows, and a coverage matrix — from the model's declared design. Covers input partitioning (zero-case, multiplicity, dirty rows), grain / conservation / recomputation / conformance checks, and known-quirk conventions. Load when the user wants tests planned or written for transforms — "write tests for my transforms", "is my model right", "test plan for this pipeline", "add data quality checks" — whether the model is mid-build or already deployed. The `mb transform-test` command and body shapes live in the `transform` skill; this one decides what to test.
4
+ allowed-tools: Read, Write, Edit, Bash, AskUserQuestion
5
+ requires: [transformTests]
6
+ ---
7
+
8
+ # Planning transform tests
9
+
10
+ Turn a transform into a fixture cast that proves the logic on small known rows, expectations that state the model's invariants, and a coverage matrix showing what's checked and what's deliberately not. Mechanics — the `inputs`/`expectations` body shape and every `mb transform-test` verb — live in the `transform` skill (`mb skills get transform`); load it before authoring, and never restate it here. The two references this skill routes through, `references/checklist.md` and `references/checks.md`, come with `mb skills get transform-test-plan --full`, or read them from `mb skills path transform-test-plan`.
11
+
12
+ Every check derives from what the model **declares** — detected from its SQL, confirmed with its owner — never from conformance to a modeling doctrine. One plan serves two moments: while the model is **built**, checks pin each design decision; once **deployed**, the same SQL screens production tables for anomalies.
13
+
14
+ ## Operating rules
15
+
16
+ - **Detect, then derive.** Classify what the transform is and which conventions it uses (the checklist); derive checks only from that. Star, one-big-table, partial denormalization — all fine; never flag a style.
17
+ - **Judgment calls go through the checklist.** The session's autonomy setting governs which answers you supply yourself and which you bring to the user — it never makes the checklist a formality. Every answer you supply yourself is recorded in the plan as a stated assumption, paired with the named expectation that enforces it — reversing the decision then breaks a test, not a paragraph. And regardless of setting, when genuinely unsure, ask — a wrong-but-confident grain poisons every downstream check.
18
+ - **Expected rows are derived by hand** from the fixture story and business meaning — never captured from the transform's output, which asserts only that the transform equals itself.
19
+ - **Batteries stay off until declared structure switches them on.** No snapshot-density checks without a snapshot, no version-history checks without effective/end/current columns. An empty section beats a speculative one.
20
+
21
+ ## The procedure
22
+
23
+ 1. **Profile the real inputs**: per table, row count; per column, min/max/distinct-count/null incidence; orphan counts across declared links (`mb field summary`, `mb query`). Profiling feeds domains, bounds, null partitions, and key candidates — and every fixture edge cites the real-data condition that warrants it, with its count ("the warehouse has 67 ship-before-order rows").
24
+ 2. **Detect.** Read the transform's SQL (`mb transform get <id> --full --json`) for: grain candidates (`GROUP BY` keys, the joins' driving table), join types (orphan handling), correlated aggregates (stored aggregates), `<entity>_<attr>` naming (copies), effective/end/current columns (version history), `now()`/`current_date` (volatile columns). A transform whose grain you cannot state in one phrase is itself a finding — raise it before writing any test.
25
+ 3. **Confirm.** Walk [references/checklist.md](references/checklist.md). Three stages: classify the model, per-table declarations, per-column declarations. Each question carries its detection hint; answer autonomously where the hint resolves, ask where it doesn't. In build-along mode these are design questions — treat an undecided answer as a decision to make together, not a blocker.
26
+ 4. **Derive.** Route every output column through [references/checks.md](references/checks.md) — declared property → expectation shape, fixture implication, expected-row convention. Read it in full once per plan; it is the plan's content.
27
+ 5. **Design the fixture cast**: one small cast per transform (≈5–10 rows per table), human-named rows ("Alice Premium"), every row a named edge — zero-case entities for every outer join and aggregation, ≥2-member groups for every grouping and join, one dirty row per screenable defect, boundary dates. Document it as a table (row → attributes → purpose) in the plan.
28
+
29
+ Express the cast as literal rows rather than as a query, so the story stays legible in the test itself; a query is worth it only when the rows are mechanical to generate. A cast is written against one warehouse and does not carry to another.
30
+
31
+ 6. **Hand-derive the expected rows**, arithmetic recorded in the plan (premium: 3 orders / 350.50 / 3.0). Every fixture row's fate appears in some expected cell. Pin NULL-vs-0-vs-empty for every zero-case row — that cell is the null policy's only enforcement.
32
+ 7. **Author the test.** One test per transform, per coherent story: an `equals` pinning the output, declaring every output column, since `equals` compares only the columns it declares, and `empty` expectations stating the invariants that survive a change to the cast.
33
+
34
+ Give each expectation a name that states the invariant, because the name is what a failure leads with ("revenue never negative", not "check 3"), and open each `empty` expectation's SQL with a `--` contract comment: the invariant, and the failure modes it catches ("catches both dropped orders and join fan-out").
35
+
36
+ Where one invariant applies to several transforms, duplicate the SQL. Nothing is shared between tests, so give each copy its own name and comment rather than one that only makes sense next to its twin.
37
+
38
+ 8. **Emit the coverage matrix** in the plan: rows = output columns with the table's grain; columns = check classes (grain, conservation, recomputation, conformance, domains, referential integrity, temporal, screens); cells name the covering expectation or expected-row cell, or state `gap: <reason>`. Scan shared-attribute columns across transforms for cross-table agreement obligations. Empty cells are honest; silent gaps are not.
39
+ 9. **Prove the tests have teeth.** Once per test: corrupt one expected cell, `run`, confirm `cell-mismatches` names exactly that column; revert. Then perturb one input cell and confirm exactly the declared output cells move. An `empty` expectation that only selects output rows passes against an empty output, so a green test can still be vacuous.
40
+
41
+ ## Severity: error, or the tolerated oddity
42
+
43
+ Every expectation is pass or fail, and one failure fails the run. **error** = forbidden, and it becomes an `empty` expectation. There is no warn severity, so **never author an expectation you expect to fire**: a permanently red test trains everyone to ignore the result, and a red run gates everyone else's work.
44
+
45
+ A tolerated-but-surfaced oddity — one the owner lives with, like orphan rows or ship-before-order dates — gets encoded the two ways that hold: **pin it in the `equals` rows** (an orphan passing through with NULLs is a cell in the expected output, so reversing the tolerance breaks the test), and **record it in the plan's known-quirks list** with its real-data count, so the tolerance stays a conscious choice.
46
+
47
+ Under budget pressure cut business-rule checks first, then cross-table structure checks; never single-column screens (domains, ranges, nulls) — cheapest, and the last line.
48
+
49
+ ## When a check exposes a live bug
50
+
51
+ Non-negotiable: **never soften the test to green** — expected values state correct behavior; matching them to buggy output documents the bug as intended — and **surface the finding with its blast radius at both scales**, fixture ("1530.24 of 1600.74 fixture dollars survive") and warehouse ("908 of 2,050 orders dropped"). What happens next follows the session's terms, not a fixed protocol: propose and apply the fix now (when the user wants it or the autonomy setting covers it), or — when the fix must wait — hold the correct expectation and record the red in the plan with the minimal fix body. A stored test has no red-by-design state, so a deferred fix must be visible in the plan or the test reads as broken. Either way, once green the test stays as the regression guard.
52
+
53
+ ## When the doctrine doesn't apply
54
+
55
+ The vocabulary follows Kimball's dimensional modeling (grain, additivity, conformed attributes, slowly changing dimensions) — precise, widely understood terms. Real models are Kimball-inspired at most; no check may score adherence:
56
+
57
+ - Full calendar date dimensions are rare. Never demand one; test date _semantics_ — ranges, orderings, volatile derivations.
58
+ - Surrogate keys are doctrine, natural-key joins are practice. Test whichever key the model declares; never flag natural-key joins.
59
+ - "No NULL FKs / no NULL attributes" is doctrine routinely dropped. Null policy is three independent declarations — measures, attributes, FKs — each detected and confirmed, never presumed.
60
+ - One-big-table is legitimate: it still has a grain, its copies still need agreement checks, its functional dependencies still hold.
61
+ - A transform-level `ORDER BY` has no testable effect — output tables carry no row order and the `equals` comparison is a multiset. Flag it as probable dead weight (clustering hints aside); never write an ordering expectation.
62
+
63
+ ## One transform at a time
64
+
65
+ Each test covers one transform. When the transform under test reads another transform's output, that target table is an input like any other: declare it and fake it. Derive those rows from the base transform's own expected output, so the two tests tell one story, and note the coupling in both plans — changing the base's expected rows means changing this test's input.
66
+
67
+ ## Worked example, condensed
68
+
69
+ `orders` + `customers` → _enriched_orders_ (order grain; LEFT JOIN attaches `customer_name`, `tier`).
70
+
71
+ Cast, 7 orders: two tiers; Alice and Carol with 2 orders each (multiplicity); two never shipped (zero-case for the shipping join); order 106 shipped before ordered (real oddity, count cited); order 107's customer_id matches no customer (orphan). Two `rows` inputs, one per source table.
72
+
73
+ Derived, per catalog: grain uniqueness on `order_id`; row and amount conservation from input to output, as scalar subqueries over the target and the seeded input; `tier` domain ⊆ {standard, premium}; orphan = keep-with-NULLs → an expected row pinning the NULL pass-through; ship-before-order tolerated → the plan's known-quirks list with the warehouse count. The whole output, every column, pinned in one `equals`, hand-computed, arithmetic in the plan. The inner-vs-LEFT-join bug this cast catches — unshipped orders silently dropped from revenue — is what the zero-case rows exist for.
74
+
75
+ ## Don't
76
+
77
+ - Don't author expectations before loading the `transform` skill — the body shape, the closed create/update contract, and the verb flags live there.
78
+ - Don't capture expected rows from the transform's own output — hand-derive them or they assert nothing.
79
+ - Don't emit checks for structure the model doesn't declare (snapshot density, version history, bridge weights) — an inapplicable battery buries real findings.
80
+ - Don't let a fixture cast go all-clean — no zero-case, no orphan, no dirty row proves the happy path and nothing else; the bugs live in the edges.
81
+ - Don't write an expectation you expect to fail.
82
+ - Don't surface bare check-ids ("per C3…") to the user — name the check in plain words; the ids are for your cross-referencing, not their reading.
@@ -0,0 +1,32 @@
1
+ # Confirmation checklist
2
+
3
+ The judgment calls a plan depends on, in derivation order. Each question carries a **detect** hint — how to answer it from the SQL, the metadata, or profiling. Answer autonomously where the hint resolves cleanly; ask where it doesn't. Every answer you supply yourself goes into the emitted plan as a stated assumption, phrased so the owner can falsify it at a glance ("Assuming `discount` can never be negative — correct?").
4
+
5
+ In build-along mode these are design questions: the owner is deciding, not recalling. An undecided answer is a decision to make together — surface the options and the check each implies (the `checks.md` entry named in parentheses).
6
+
7
+ ## Stage 1 — classify the model (per transform)
8
+
9
+ 1. **Grain: one row per what?** (G1, G2) Detect: `GROUP BY` keys; otherwise the driving table of the joins. Confirm whenever detection and any written description disagree — that disagreement is itself a finding.
10
+ 2. **Fact-table type — and if periodic snapshot, dense or sparse?** (F2) Detect: event-grain with a single event date → transaction; entity×period grain → periodic snapshot (density is the one yes/no that flips its whole invariant set — always confirm); one row per pipeline occurrence with milestone-date columns → accumulating snapshot.
11
+
12
+ ## Stage 2 — per-table declarations
13
+
14
+ 3. **Conservation ties: output rows/sums tie to which input, with which declared exclusions?** (A2) Detect: `WHERE` clauses and join types name the exclusions (filtered rows, dropped duplicates). Exclusions must be declared, or conservation appears to fail.
15
+ 4. **Zero-group policy: does a group with no contributing rows appear (with zeros) or stay absent?** (A5) Detect: driving table of the rollup — grouping the detail can't produce empty groups; joining a dimension first can.
16
+ 5. **Orphan handling per join: drop / keep-with-NULLs / default row — and is an orphan tolerated or forbidden?** (C3, I5) Detect: join type. INNER = drop, LEFT = keep-with-NULLs, COALESCE to a sentinel = default row. Tolerated-vs-forbidden is the owner's call — profiling says whether orphans exist today, not whether they're acceptable. Forbidden becomes an `empty` expectation; tolerated is pinned in the expected rows and recorded in the known-quirks list.
17
+ 6. **Version history: effective/end/current columns anywhere? If not, confirm overwrite-everywhere.** (T1) Detect: column names. Absence means history is silently rewritten in rollups — state that consequence when confirming, not just the mechanism.
18
+ 7. **Does this transform read another transform's output?** (A5) Detect: another transform's target table in this one's SQL. It becomes a declared input like any other, faked from that transform's own expected output — confirm which rows, and record the coupling in both plans.
19
+
20
+ ## Stage 3 — per-column declarations
21
+
22
+ 8. **Each measure: additive, semi-additive, or non-additive?** (A1) Detect: sums and counts are additive; balances and levels are semi-additive; ratios, rates, and unit prices are non-additive. Confirm the ambiguous ones (a "score"? a "quantity on hand"?).
23
+ 9. **Legal bounds per measure?** (Q1) Detect: profiling min/max suggests, business meaning decides — can `discount` be negative? can `quantity` be zero? Derived bounds are free (a sum of non-negatives is non-negative).
24
+ 10. **Each derived measure: the exact recomputation rule?** (A3) Detect: the SELECT expression is the rule — but rounding, business-day adjustments, and NULL handling are conventions to confirm, not read.
25
+ 11. **Which columns are stored aggregates, over which detail and filter?** (A4) Detect: correlated subqueries / joined-aggregate CTEs in the SQL.
26
+ 12. **Which categorical columns have closed domains — enumerate; is NULL a member?** (C2) Detect: profiling distinct values gives today's set; the owner confirms it's closed rather than merely small so far.
27
+ 13. **Which columns are denormalized copies, of which owning attribute?** (C1) Detect: `<entity>_<attr>` naming; any column functionally dependent on a non-grain key. Every hit must be classified: copy (C1), stored aggregate (A4), or smuggled coarser-grain fact — a finding.
28
+ 14. **Which many-to-one edges hold within one output table?** (C4) Detect: hierarchy-shaped column pairs (product/category, zip/state). Applies where no owning table is in scope; otherwise C1 covers it.
29
+ 15. **Which date orderings are business-guaranteed vs. known-violated and tolerated (with real-data counts)?** (T2) Detect: profiling counts the violations that exist; the owner decides tolerated vs. bug.
30
+ 16. **Null policy per column — measures, attributes, FKs separately.** (Q2) Detect: the SQL shows what's produced (COALESCE, CASE); the owner confirms intent — "count of nothing": 0 or NULL? empty date: NULL or sentinel?
31
+ 17. **Which columns are volatile across runs?** (T3) Detect: `now()` / `current_date` / run-metadata expressions in the SQL. A volatile column is left out of the `equals` columns; its form can still be asserted with an `empty`.
32
+ 18. **Per tolerated oddity: does it stay tolerated, and what is its current count?** (Q3) Detect: can't — this is the conscious-choice question, and the plan's known-quirks list is where it survives.
@@ -0,0 +1,156 @@
1
+ # Check catalog
2
+
3
+ Every check the plan can derive, grouped by theme. Per entry: **when it applies** (the declared property that switches it on — blank means always), **assert** (the expectation shape), and **fixtures** (what the input cast must contain for the check to have teeth).
4
+
5
+ Expectation SQL names the transform's **target table** and its **declared input tables** under their real names; both are rewritten to the run's temp tables, so per-row recomputation joins against inputs are writable. Anything else you name is refused (`transform-test.unremapped-reference`), so no check can read a real table.
6
+
7
+ Ids (G1, A2, …) are for cross-referencing within the plan documents only — never surface them to the user bare.
8
+
9
+ Throughout, `<target>` stands for the transform's target table as written in the transform's own definition, and `<input>` for a declared input table.
10
+
11
+ `IS DISTINCT FROM` is the null-safe inequality; MySQL spells it `NOT (a <=> b)`, and where neither parses, `a <> b OR (a IS NULL) <> (b IS NULL)`.
12
+
13
+ ## Grain & keys
14
+
15
+ **G1 — Declared grain.** Every output table states "one row per X"; the declaration anchors every other check.
16
+
17
+ - Applies: always. Elicit or detect (GROUP BY keys; the join's driving table).
18
+ - Assert: nothing directly — G1 is the plan's opening move. A table with no statable grain, or a grain stated inconsistently between docs and SQL, is a finding before any SQL runs.
19
+ - Fixtures: the grain declaration decides the cast's row structure.
20
+
21
+ **G2 — Grain-key uniqueness.** The grain key stays a key; doubles as the fan-out guard for every enriching join.
22
+
23
+ - Applies: always — one-big-table, rollups, and stars all have a grain.
24
+ - Assert (`empty`): `SELECT <grain cols>, COUNT(*) FROM <target> GROUP BY <grain cols> HAVING COUNT(*) > 1`. NULL grain values form their own bucket.
25
+ - Fixtures: a parent with ≥2 children on every join (I4) is what makes this check able to fail.
26
+
27
+ ## Additivity & reconciliation
28
+
29
+ **A1 — Measure additivity classification.** Additive / semi-additive (balances) / non-additive (ratios, rates, unit prices) decides which aggregations are valid tests.
30
+
31
+ - Applies: every numeric measure; per-column declaration.
32
+ - Assert: routes the measure — additive → A2; semi-additive → sum across non-time slices only (a test summing a balance over time is a bug in the plan); non-additive → A3 recomputation, never reconciled by summing.
33
+ - Fixtures: none directly; one coverage-matrix axis (measure × valid aggregation set).
34
+
35
+ **A2 — Conservation reconciliation.** Row counts and additive-measure sums tie from input to output; catches dropped rows and join double-counting at once.
36
+
37
+ - Applies: per declared tie (which input, which declared exclusions).
38
+ - Assert (`empty`): independent scalar subqueries compared with `IS DISTINCT FROM`, returning the mismatched pair: `SELECT (SELECT SUM(t.m) FROM <target> t) AS output_sum, (SELECT SUM(s.m) FROM <input> s) AS input_sum WHERE (…) IS DISTINCT FROM (…)`. Never reconcile via a fact-to-fact join — cardinality is uncontrollable and wrong results are silent.
39
+ - Fixtures: amounts chosen so partial survival is visible (distinct values, odd cents).
40
+
41
+ **A3 — Derived-measure recomputation.** Averages, lags, ratios, rounded presentations recompute from their components per row.
42
+
43
+ - Applies: every derived column, with its declared rule (rounding, business-day adjustment, NULL handling).
44
+ - Assert (`empty`): `SELECT <key> FROM <target> t WHERE t.<derived> IS DISTINCT FROM <recomputation from inputs or sibling columns>`.
45
+ - Fixtures: component values whose derivation is non-trivial (a NULL in the AVG, a negative lag).
46
+
47
+ **A4 — Stored aggregates on entity tables.** Lifetime/rollup stats carried on an entity-grain table (`lifetime_orders`, `review_count`, `first_order_date`) equal recomputation from detail — per row _and_ in total.
48
+
49
+ - Applies: columns detected as correlated aggregates over a detail table.
50
+ - Assert (`empty`), two per column: per-row — `WHERE t.<agg> IS DISTINCT FROM (SELECT COUNT(*)/SUM(…)/MIN(…) FROM <detail> d WHERE d.<fk> = t.<key>)`; total — the A2 scalar-pair shape. Totals alone cancel offsetting per-row errors; the per-row form is the one that catches them.
51
+ - Fixtures: an entity with several detail rows and an entity with none (I3/I4).
52
+
53
+ **A5 — Rollup consistency.** A layered rollup always agrees with its base.
54
+
55
+ - Applies: any transform reading another transform's output. The base is a declared input like any other, faked with rows taken from the base transform's own expected output.
56
+ - Assert (`empty`): every rollup measure equals the corresponding aggregation over the base (A2 shape); group-set equality both directions — `SELECT <group> FROM <target> EXCEPT SELECT DISTINCT <group col> FROM <base>` and the reverse, filtered by the declared zero-group policy.
57
+ - Fixtures: a group with no contributing rows pins the zero-group policy.
58
+
59
+ ## Fact-table type
60
+
61
+ **F2 — Fact-table type bundle.** Transaction / periodic snapshot / accumulating snapshot each carry a distinct invariant set.
62
+
63
+ - Applies: per fact-shaped output, always classified; **transaction** needs nothing beyond G2 + A2 (sparsity is legitimate).
64
+ - Periodic snapshot, if declared _dense_: `COUNT(*) = |entities| × |periods|` (or the declared subset); per-entity gap detection in the period series; inactive-period representation (zero vs NULL) pinned in the expected rows. If sparse, density checks off — the one yes/no flips the whole set.
65
+ - Accumulating snapshot: milestone dates monotone in pipeline order where set (`WHERE <later> < <earlier>` per adjacent pair); unset-milestone default (NULL vs sentinel) pinned in the expected rows; completion flags ∈ {0,1} and consistent with their date's set-ness; lags via A3.
66
+ - Fixtures (accumulating): occurrences at every completion stage — none, some, all milestones.
67
+
68
+ ## Conformance & domains
69
+
70
+ **C1 — Denormalized-copy agreement.** Every copied attribute agrees with the owning table's value for that key.
71
+
72
+ - Applies: columns declared as copies (detect: `<entity>_<attr>` naming; any column functionally dependent on a non-grain key). Each such column must be a declared copy (this check), a stored aggregate (A4), or it's a smuggled coarser-grain fact — a finding: it double-counts under summation.
73
+ - Assert (`empty`): `SELECT t.<key>, t.<copy>, d.<attr> FROM <target> t JOIN <owning input> d ON t.<key> = d.<key> WHERE t.<copy> IS DISTINCT FROM d.<attr>`.
74
+ - Scope: in a test, the copies are produced by the very join under test, so this join-form is near- tautological — the C4 functional-dependency form plus expected-row cell pinning carries the test. The join-form against an independently materialized owning table is the _drift_ check, which belongs to whatever screens the deployed tables.
75
+ - Fixtures: copies with distinct values per entity so a crossed join is visible.
76
+
77
+ **C2 — Closed-domain screen.** A categorical column's values stay inside the declared enumeration.
78
+
79
+ - Applies: per column declared closed (detect from profiling; confirm the set and whether NULL is a member).
80
+ - Assert (`empty`): `SELECT <key>, <col> FROM <target> WHERE <col> IS NOT NULL AND <col> NOT IN (<domain>)`.
81
+ - Fixtures: every domain value represented where practical; one out-of-domain input row if the source can produce one (I5).
82
+
83
+ **C3 — Referential integrity / orphan policy.** Every FK resolves, or the declared orphan handling is pinned.
84
+
85
+ - Applies: per join, conditioned on the declared response — drop / keep-with-NULLs / default row; tolerated or forbidden.
86
+ - Assert, forbidden (`empty`): `SELECT t.<fk> FROM <target> t LEFT JOIN <dim input> d ON t.<fk> = d.<key> WHERE t.<fk> IS NOT NULL AND d.<key> IS NULL`. Tolerated: not an expectation — pin the orphan's pass-through as a row in the `equals` (NULL in the copied attributes), and record the tolerance with its warehouse count in the plan. Default-row convention adds: distinct unknown keys must not collapse into one output row.
87
+ - Fixtures: one orphan row (I5). Without it the join direction is untested — an inner join silently dropping unmatched rows is the classic bug this catches.
88
+
89
+ **C4 — Many-to-one consistency.** Each declared many-to-one edge holds within the output (product → one category; zip → one state).
90
+
91
+ - Applies: per declared edge; where an owning table is in scope, C1 subsumes it — this is the one-big-table variant with nothing to join against.
92
+ - Assert (`empty`): `SELECT t.<many>, COUNT(DISTINCT t.<one>) FROM <target> t GROUP BY t.<many> HAVING COUNT(DISTINCT t.<one>) > 1`.
93
+ - Fixtures: a violating input row if the source can produce one (I5), pinning the transform's behavior on dirty input.
94
+
95
+ ## Temporal & version history
96
+
97
+ **T1 — Change handling per attribute.** How the model treats a changed source attribute decides the temporal fixtures.
98
+
99
+ - Applies: detect effective/end/current housekeeping columns.
100
+ - Present → version-history battery (`empty` each): per durable key exactly one current row; `effective < end` per row; intervals contiguous and non-overlapping; current row's end = the declared far-future default; fact rows join the version whose interval contains the fact date.
101
+ - Absent → confirm overwrite-everywhere as a stated assumption (history is silently rewritten in rollups), and derive the propagation probe: change an attribute in an input, run, assert the output regrouped.
102
+ - Fixtures: a before/after change pair; for version history, an entity with ≥2 versions and a fact row dated inside each interval.
103
+
104
+ **T2 — Date-pair ordering.** Business-guaranteed orderings asserted; known violations recorded.
105
+
106
+ - Applies: per declared date pair (ordered ≤ shipped ≤ delivered; signup ≤ first order), each classified guaranteed vs. tolerated-violated.
107
+ - Assert: guaranteed (`empty`) — `SELECT <key>, <earlier>, <later> FROM <target> WHERE <later> < <earlier>`. Tolerated — pin the violating row's downstream arithmetic (a negative lag inside an average) in the expected rows, and record the real-data count in the plan.
108
+ - Fixtures: one violating row for every tolerated ordering.
109
+
110
+ **T3 — Volatile columns.** Values that change across runs can't be pinned.
111
+
112
+ - Applies: columns derived from `now()`/`current_date` (age), run metadata (load timestamps, batch ids).
113
+ - Assert: leave the column out of the `equals` `columns` list — an undeclared column never enters the comparison. Separately assert its form where warranted (`empty`): `WHERE age NOT BETWEEN 0 AND 120`. The stable source column (`birth_date`) stays exact in the expected rows.
114
+ - Fixtures: none special; the split is the point — omit the volatile, pin the stable.
115
+
116
+ ## Screens & severity
117
+
118
+ **Q1 — Range / sign screens.** Each measure's declared bounds hold.
119
+
120
+ - Applies: per bounded measure; bounds from business meaning plus profiling (derived bounds are free: a sum of non-negatives is non-negative).
121
+ - Assert (`empty`): `SELECT <key>, <col> FROM <target> WHERE <col> < <lo> OR <col> > <hi>` (one-sided where only one bound exists).
122
+ - Fixtures: boundary values where the bound is business-set.
123
+
124
+ **Q2 — Null policy, three ways.** Measures, descriptive attributes, and FKs carry independent null policies; never presume one from another.
125
+
126
+ - Applies: per column, asked separately — "count of nothing": 0 or NULL? empty date: NULL or sentinel? FK: see C3.
127
+ - Assert: declared non-null columns get `WHERE <col> IS NULL` (`empty`). Otherwise the policy is enforced by the expected-row cell of a zero-case fixture row — NULL vs 0 vs empty is invisible until a fixture forces the choice into a cell.
128
+ - Fixtures: the zero-case row (I3) is the enforcement mechanism.
129
+
130
+ **Q3 — Naming & the tolerated oddity.** Every expectation declares its meaning.
131
+
132
+ - Applies: always, every expectation.
133
+ - Convention: the expectation's `name` states the invariant in plain words, because a failure leads with it. Each `empty` SQL opens with 1–3 comment lines naming the invariant and the failure modes it catches. Budget cuts drop business-rule checks first, then cross-table structure checks, never single-column screens.
134
+ - A forbidden condition is an `empty` expectation. A tolerated one is pinned in the expected rows and recorded in the plan's known-quirks list with its warehouse count. Never author an expectation designed to fire.
135
+
136
+ ## Input modeling (fixture-design rules)
137
+
138
+ **I1 — Profiling-derived partitions.** Fixture edges and tolerated non-ties cite profiled reality with counts; the plan's known-quirks section carries each tolerated oddity with its reason and count.
139
+
140
+ **I2 — Shared fixture cast.** One small human-named cast per transform, every row a named edge, documented as a story table (row → attributes → purpose) in the plan. Where one transform's output is another's input, derive the faked rows from the first's expected output so the two tests tell one story.
141
+
142
+ **I3 — Zero-case partitions.** For every outer join and aggregation relation: one entity with zero matches. Its expected row pins the absence representation (Q2) and the join direction (C3) — the all-clean cast is the single most common cause of vacuous tests. When the schema distinguishes states the profiled data never exhibits (a literal zero in a source that only has NULLs and positives), fixture the missing state — nothing else forces it onto an expected cell.
143
+
144
+ **I4 — Multiplicity partitions.** Every aggregation gets a >1-member group and an exactly-1 group (the 0 case is I3); every join gets a parent with ≥2 children. Expected values then differ from any single row's, so copy-through bugs can't pass.
145
+
146
+ **I5 — Dirty-input pinning.** Per screenable defect the source can carry (orphan FK, out-of-domain value, duplicate natural key, hierarchy violation, ordering violation): one fixture row exhibiting it, an expected row pinning the transform's response (drop / pass-through / default), and — where the defect is forbidden — the matching `empty` expectation. Which duplicate survives a dedupe is invisible until a conflicting-duplicate fixture pins it.
147
+
148
+ **I6 — Mutation probes.** Run at plan-validation time, not on every run: corrupt one expected cell → `cell-mismatches` must name that exact column; perturb one input cell → exactly the declared output cells move. Both guard against vacuous tests: an `empty` expectation that only selects output rows passes against an empty output.
149
+
150
+ ## Plan-level artifacts
151
+
152
+ **P1 — Coverage matrix.** Output columns (with the table's grain) × check classes; cells name the covering expectation or expected-row cell, or state `gap: <reason>`; shared-attribute columns scanned across transforms for agreement obligations (C1).
153
+
154
+ **P2 — Hand-derived expected rows.** From the fixture story and business meaning, arithmetic recorded in the plan; never captured from output; every fixture row's fate appears in some expected cell.
155
+
156
+ **P3 — Live-bug handling.** A check failing against a deployed transform is a real finding: never soften the test to green; quantify the damage at fixture and warehouse scale. Then fix now, or record the red in the plan with the minimal fix body, per the session's terms. A stored test has no red-by-design state, so a deferred fix must be visible in the plan or the test reads as broken.
@@ -1,25 +0,0 @@
1
- import { t as defineCommandGroup } from "./group-B3X3LTcU.mjs";
2
- //#region src/commands/card/index.ts
3
- var card_default = defineCommandGroup({
4
- name: "card",
5
- description: "Manage Metabase cards (questions, models, metrics)",
6
- skills: [{
7
- skill: "mbql",
8
- purpose: "author the dataset_query"
9
- }, {
10
- skill: "visualization",
11
- purpose: "choose display and visualization_settings"
12
- }],
13
- subCommands: {
14
- list: () => import("./list-LMlJ4uAY.mjs").then((mod) => mod.default),
15
- get: () => import("./get-CobILQ_7.mjs").then((mod) => mod.default),
16
- query: () => import("./query-B1Cp9EO6.mjs").then((mod) => mod.default),
17
- alerts: () => import("./alerts-s3al16NZ.mjs").then((mod) => mod.default),
18
- create: () => import("./create-DraZzrLO.mjs").then((mod) => mod.default),
19
- update: () => import("./update-kM3TDlEp.mjs").then((mod) => mod.default),
20
- verify: () => import("./verify-BSq7x66g.mjs").then((mod) => mod.default),
21
- archive: () => import("./archive-5EY9UJU_.mjs").then((mod) => mod.default)
22
- }
23
- });
24
- //#endregion
25
- export { card_default as default };
@@ -1,21 +0,0 @@
1
- import { t as defineCommandGroup } from "./group-B3X3LTcU.mjs";
2
- //#region src/commands/collection/index.ts
3
- var collection_default = defineCommandGroup({
4
- name: "collection",
5
- description: "Manage Metabase collections",
6
- skills: [{
7
- skill: "core",
8
- purpose: "collection ref forms and the transforms namespace"
9
- }],
10
- subCommands: {
11
- list: () => import("./list-BoVeF8QA.mjs").then((mod) => mod.default),
12
- get: () => import("./get-IjoHBExI.mjs").then((mod) => mod.default),
13
- items: () => import("./items-1ME_eg27.mjs").then((mod) => mod.default),
14
- tree: () => import("./tree-COFmA20J.mjs").then((mod) => mod.default),
15
- create: () => import("./create-B1QDNU1x.mjs").then((mod) => mod.default),
16
- update: () => import("./update-B8jQTspb.mjs").then((mod) => mod.default),
17
- archive: () => import("./archive-DzSdJVqE.mjs").then((mod) => mod.default)
18
- }
19
- });
20
- //#endregion
21
- export { collection_default as default };