@ontrails/warden 1.0.0-beta.13 → 1.0.0-beta.15

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 (474) hide show
  1. package/.turbo/turbo-lint.log +1 -1
  2. package/CHANGELOG.md +30 -0
  3. package/README.md +31 -20
  4. package/dist/cli.d.ts +19 -2
  5. package/dist/cli.d.ts.map +1 -1
  6. package/dist/cli.js +261 -64
  7. package/dist/cli.js.map +1 -1
  8. package/dist/draft.d.ts +5 -0
  9. package/dist/draft.d.ts.map +1 -0
  10. package/dist/draft.js +16 -0
  11. package/dist/draft.js.map +1 -0
  12. package/dist/drift.d.ts +10 -7
  13. package/dist/drift.d.ts.map +1 -1
  14. package/dist/drift.js +50 -16
  15. package/dist/drift.js.map +1 -1
  16. package/dist/formatters.d.ts +2 -1
  17. package/dist/formatters.d.ts.map +1 -1
  18. package/dist/formatters.js +15 -4
  19. package/dist/formatters.js.map +1 -1
  20. package/dist/index.d.ts +9 -17
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.js +10 -17
  23. package/dist/index.js.map +1 -1
  24. package/dist/rules/ast.d.ts +412 -7
  25. package/dist/rules/ast.d.ts.map +1 -1
  26. package/dist/rules/ast.js +1847 -102
  27. package/dist/rules/ast.js.map +1 -1
  28. package/dist/rules/circular-refs.d.ts +6 -0
  29. package/dist/rules/circular-refs.d.ts.map +1 -0
  30. package/dist/rules/circular-refs.js +83 -0
  31. package/dist/rules/circular-refs.js.map +1 -0
  32. package/dist/rules/context-no-surface-types.d.ts.map +1 -1
  33. package/dist/rules/context-no-surface-types.js +59 -3
  34. package/dist/rules/context-no-surface-types.js.map +1 -1
  35. package/dist/rules/contour-exists.d.ts +7 -0
  36. package/dist/rules/contour-exists.d.ts.map +1 -0
  37. package/dist/rules/contour-exists.js +113 -0
  38. package/dist/rules/contour-exists.js.map +1 -0
  39. package/dist/rules/contour-ids.d.ts +10 -0
  40. package/dist/rules/contour-ids.d.ts.map +1 -0
  41. package/dist/rules/contour-ids.js +12 -0
  42. package/dist/rules/contour-ids.js.map +1 -0
  43. package/dist/rules/cross-declarations.d.ts.map +1 -1
  44. package/dist/rules/cross-declarations.js +171 -57
  45. package/dist/rules/cross-declarations.js.map +1 -1
  46. package/dist/rules/dead-internal-trail.d.ts +3 -0
  47. package/dist/rules/dead-internal-trail.d.ts.map +1 -0
  48. package/dist/rules/dead-internal-trail.js +80 -0
  49. package/dist/rules/dead-internal-trail.js.map +1 -0
  50. package/dist/rules/draft-file-marking.d.ts +6 -0
  51. package/dist/rules/draft-file-marking.d.ts.map +1 -0
  52. package/dist/rules/draft-file-marking.js +87 -0
  53. package/dist/rules/draft-file-marking.js.map +1 -0
  54. package/dist/rules/draft-visible-debt.d.ts +12 -0
  55. package/dist/rules/draft-visible-debt.d.ts.map +1 -0
  56. package/dist/rules/draft-visible-debt.js +50 -0
  57. package/dist/rules/draft-visible-debt.js.map +1 -0
  58. package/dist/rules/error-mapping-completeness.d.ts +13 -0
  59. package/dist/rules/error-mapping-completeness.d.ts.map +1 -0
  60. package/dist/rules/error-mapping-completeness.js +160 -0
  61. package/dist/rules/error-mapping-completeness.js.map +1 -0
  62. package/dist/rules/example-valid.d.ts +6 -0
  63. package/dist/rules/example-valid.d.ts.map +1 -0
  64. package/dist/rules/example-valid.js +203 -0
  65. package/dist/rules/example-valid.js.map +1 -0
  66. package/dist/rules/fires-declarations.d.ts +16 -0
  67. package/dist/rules/fires-declarations.d.ts.map +1 -0
  68. package/dist/rules/fires-declarations.js +444 -0
  69. package/dist/rules/fires-declarations.js.map +1 -0
  70. package/dist/rules/implementation-returns-result.d.ts +9 -0
  71. package/dist/rules/implementation-returns-result.d.ts.map +1 -1
  72. package/dist/rules/implementation-returns-result.js +638 -76
  73. package/dist/rules/implementation-returns-result.js.map +1 -1
  74. package/dist/rules/incomplete-accessor-for-standard-op.d.ts +30 -0
  75. package/dist/rules/incomplete-accessor-for-standard-op.d.ts.map +1 -0
  76. package/dist/rules/incomplete-accessor-for-standard-op.js +226 -0
  77. package/dist/rules/incomplete-accessor-for-standard-op.js.map +1 -0
  78. package/dist/rules/incomplete-crud.d.ts +21 -0
  79. package/dist/rules/incomplete-crud.d.ts.map +1 -0
  80. package/dist/rules/incomplete-crud.js +368 -0
  81. package/dist/rules/incomplete-crud.js.map +1 -0
  82. package/dist/rules/index.d.ts +40 -7
  83. package/dist/rules/index.d.ts.map +1 -1
  84. package/dist/rules/index.js +91 -15
  85. package/dist/rules/index.js.map +1 -1
  86. package/dist/rules/intent-propagation.d.ts +3 -0
  87. package/dist/rules/intent-propagation.d.ts.map +1 -0
  88. package/dist/rules/intent-propagation.js +57 -0
  89. package/dist/rules/intent-propagation.js.map +1 -0
  90. package/dist/rules/missing-reconcile.d.ts +3 -0
  91. package/dist/rules/missing-reconcile.d.ts.map +1 -0
  92. package/dist/rules/missing-reconcile.js +44 -0
  93. package/dist/rules/missing-reconcile.js.map +1 -0
  94. package/dist/rules/missing-visibility.d.ts +3 -0
  95. package/dist/rules/missing-visibility.d.ts.map +1 -0
  96. package/dist/rules/missing-visibility.js +63 -0
  97. package/dist/rules/missing-visibility.js.map +1 -0
  98. package/dist/rules/no-direct-impl-in-route.d.ts.map +1 -1
  99. package/dist/rules/no-direct-impl-in-route.js +0 -3
  100. package/dist/rules/no-direct-impl-in-route.js.map +1 -1
  101. package/dist/rules/no-direct-implementation-call.js +1 -1
  102. package/dist/rules/no-direct-implementation-call.js.map +1 -1
  103. package/dist/rules/no-sync-result-assumption.d.ts.map +1 -1
  104. package/dist/rules/no-sync-result-assumption.js +870 -61
  105. package/dist/rules/no-sync-result-assumption.js.map +1 -1
  106. package/dist/rules/no-throw-in-detour-recover.d.ts +3 -0
  107. package/dist/rules/no-throw-in-detour-recover.d.ts.map +1 -0
  108. package/dist/rules/no-throw-in-detour-recover.js +147 -0
  109. package/dist/rules/no-throw-in-detour-recover.js.map +1 -0
  110. package/dist/rules/no-throw-in-detour-target.d.ts +4 -1
  111. package/dist/rules/no-throw-in-detour-target.d.ts.map +1 -1
  112. package/dist/rules/no-throw-in-detour-target.js +6 -3
  113. package/dist/rules/no-throw-in-detour-target.js.map +1 -1
  114. package/dist/rules/no-throw-in-implementation.d.ts +4 -2
  115. package/dist/rules/no-throw-in-implementation.d.ts.map +1 -1
  116. package/dist/rules/no-throw-in-implementation.js +6 -4
  117. package/dist/rules/no-throw-in-implementation.js.map +1 -1
  118. package/dist/rules/on-references-exist.d.ts +14 -0
  119. package/dist/rules/on-references-exist.d.ts.map +1 -0
  120. package/dist/rules/on-references-exist.js +109 -0
  121. package/dist/rules/on-references-exist.js.map +1 -0
  122. package/dist/rules/orphaned-signal.d.ts +3 -0
  123. package/dist/rules/orphaned-signal.d.ts.map +1 -0
  124. package/dist/rules/orphaned-signal.js +67 -0
  125. package/dist/rules/orphaned-signal.js.map +1 -0
  126. package/dist/rules/permit-governance.d.ts +3 -0
  127. package/dist/rules/permit-governance.d.ts.map +1 -0
  128. package/dist/rules/permit-governance.js +15 -0
  129. package/dist/rules/permit-governance.js.map +1 -0
  130. package/dist/rules/reference-exists.d.ts +6 -0
  131. package/dist/rules/reference-exists.d.ts.map +1 -0
  132. package/dist/rules/reference-exists.js +47 -0
  133. package/dist/rules/reference-exists.js.map +1 -0
  134. package/dist/rules/registry-names.d.ts +8 -0
  135. package/dist/rules/registry-names.d.ts.map +1 -0
  136. package/dist/rules/registry-names.js +83 -0
  137. package/dist/rules/registry-names.js.map +1 -0
  138. package/dist/rules/resource-declarations.d.ts +14 -0
  139. package/dist/rules/resource-declarations.d.ts.map +1 -0
  140. package/dist/rules/resource-declarations.js +413 -0
  141. package/dist/rules/resource-declarations.js.map +1 -0
  142. package/dist/rules/resource-exists.d.ts +6 -0
  143. package/dist/rules/resource-exists.d.ts.map +1 -0
  144. package/dist/rules/resource-exists.js +90 -0
  145. package/dist/rules/resource-exists.js.map +1 -0
  146. package/dist/rules/resource-id-grammar.d.ts +3 -0
  147. package/dist/rules/resource-id-grammar.d.ts.map +1 -0
  148. package/dist/rules/resource-id-grammar.js +39 -0
  149. package/dist/rules/resource-id-grammar.js.map +1 -0
  150. package/dist/rules/specs.d.ts.map +1 -1
  151. package/dist/rules/specs.js +5 -1
  152. package/dist/rules/specs.js.map +1 -1
  153. package/dist/rules/types.d.ts +53 -4
  154. package/dist/rules/types.d.ts.map +1 -1
  155. package/dist/rules/unreachable-detour-shadowing.d.ts +3 -0
  156. package/dist/rules/unreachable-detour-shadowing.d.ts.map +1 -0
  157. package/dist/rules/unreachable-detour-shadowing.js +202 -0
  158. package/dist/rules/unreachable-detour-shadowing.js.map +1 -0
  159. package/dist/rules/valid-describe-refs.d.ts.map +1 -1
  160. package/dist/rules/valid-describe-refs.js +132 -16
  161. package/dist/rules/valid-describe-refs.js.map +1 -1
  162. package/dist/rules/valid-detour-contract.d.ts +3 -0
  163. package/dist/rules/valid-detour-contract.d.ts.map +1 -0
  164. package/dist/rules/valid-detour-contract.js +47 -0
  165. package/dist/rules/valid-detour-contract.js.map +1 -0
  166. package/dist/rules/valid-detour-refs.d.ts.map +1 -1
  167. package/dist/rules/valid-detour-refs.js +73 -82
  168. package/dist/rules/valid-detour-refs.js.map +1 -1
  169. package/dist/rules/warden-export-symmetry.d.ts +7 -0
  170. package/dist/rules/warden-export-symmetry.d.ts.map +1 -0
  171. package/dist/rules/warden-export-symmetry.js +352 -0
  172. package/dist/rules/warden-export-symmetry.js.map +1 -0
  173. package/dist/rules/warden-rules-use-ast.d.ts +17 -0
  174. package/dist/rules/warden-rules-use-ast.d.ts.map +1 -0
  175. package/dist/rules/warden-rules-use-ast.js +778 -0
  176. package/dist/rules/warden-rules-use-ast.js.map +1 -0
  177. package/dist/trails/circular-refs.trail.d.ts +24 -0
  178. package/dist/trails/circular-refs.trail.d.ts.map +1 -0
  179. package/dist/trails/circular-refs.trail.js +29 -0
  180. package/dist/trails/circular-refs.trail.js.map +1 -0
  181. package/dist/trails/context-no-surface-types.trail.d.ts +2 -2
  182. package/dist/trails/context-no-surface-types.trail.d.ts.map +1 -1
  183. package/dist/trails/context-no-trailhead-types.trail.d.ts +2 -2
  184. package/dist/trails/context-no-trailhead-types.trail.d.ts.map +1 -1
  185. package/dist/trails/contour-exists.trail.d.ts +24 -0
  186. package/dist/trails/contour-exists.trail.d.ts.map +1 -0
  187. package/dist/trails/contour-exists.trail.js +21 -0
  188. package/dist/trails/contour-exists.trail.js.map +1 -0
  189. package/dist/trails/cross-declarations.trail.d.ts +2 -2
  190. package/dist/trails/cross-declarations.trail.d.ts.map +1 -1
  191. package/dist/trails/dead-internal-trail.trail.d.ts +24 -0
  192. package/dist/trails/dead-internal-trail.trail.d.ts.map +1 -0
  193. package/dist/trails/dead-internal-trail.trail.js +26 -0
  194. package/dist/trails/dead-internal-trail.trail.js.map +1 -0
  195. package/dist/trails/{provision-declarations.trail.d.ts → draft-file-marking.trail.d.ts} +3 -3
  196. package/dist/trails/draft-file-marking.trail.d.ts.map +1 -0
  197. package/dist/trails/draft-file-marking.trail.js +16 -0
  198. package/dist/trails/draft-file-marking.trail.js.map +1 -0
  199. package/dist/trails/draft-visible-debt.trail.d.ts +13 -0
  200. package/dist/trails/draft-visible-debt.trail.d.ts.map +1 -0
  201. package/dist/trails/draft-visible-debt.trail.js +16 -0
  202. package/dist/trails/draft-visible-debt.trail.js.map +1 -0
  203. package/dist/trails/error-mapping-completeness.trail.d.ts +13 -0
  204. package/dist/trails/error-mapping-completeness.trail.d.ts.map +1 -0
  205. package/dist/trails/error-mapping-completeness.trail.js +29 -0
  206. package/dist/trails/error-mapping-completeness.trail.js.map +1 -0
  207. package/dist/trails/{follow-declarations.trail.d.ts → example-valid.trail.d.ts} +3 -3
  208. package/dist/trails/example-valid.trail.d.ts.map +1 -0
  209. package/dist/trails/example-valid.trail.js +25 -0
  210. package/dist/trails/example-valid.trail.js.map +1 -0
  211. package/dist/trails/fires-declarations.trail.d.ts +13 -0
  212. package/dist/trails/fires-declarations.trail.d.ts.map +1 -0
  213. package/dist/trails/fires-declarations.trail.js +22 -0
  214. package/dist/trails/fires-declarations.trail.js.map +1 -0
  215. package/dist/trails/implementation-returns-result.trail.d.ts +2 -2
  216. package/dist/trails/implementation-returns-result.trail.d.ts.map +1 -1
  217. package/dist/trails/incomplete-accessor-for-standard-op.trail.d.ts +12 -0
  218. package/dist/trails/incomplete-accessor-for-standard-op.trail.d.ts.map +1 -0
  219. package/dist/trails/incomplete-accessor-for-standard-op.trail.js +60 -0
  220. package/dist/trails/incomplete-accessor-for-standard-op.trail.js.map +1 -0
  221. package/dist/trails/incomplete-crud.trail.d.ts +24 -0
  222. package/dist/trails/incomplete-crud.trail.d.ts.map +1 -0
  223. package/dist/trails/incomplete-crud.trail.js +39 -0
  224. package/dist/trails/incomplete-crud.trail.js.map +1 -0
  225. package/dist/trails/index.d.ts +29 -7
  226. package/dist/trails/index.d.ts.map +1 -1
  227. package/dist/trails/index.js +28 -6
  228. package/dist/trails/index.js.map +1 -1
  229. package/dist/trails/intent-propagation.trail.d.ts +24 -0
  230. package/dist/trails/intent-propagation.trail.d.ts.map +1 -0
  231. package/dist/trails/intent-propagation.trail.js +30 -0
  232. package/dist/trails/intent-propagation.trail.js.map +1 -0
  233. package/dist/trails/missing-reconcile.trail.d.ts +24 -0
  234. package/dist/trails/missing-reconcile.trail.d.ts.map +1 -0
  235. package/dist/trails/missing-reconcile.trail.js +33 -0
  236. package/dist/trails/missing-reconcile.trail.js.map +1 -0
  237. package/dist/trails/missing-visibility.trail.d.ts +24 -0
  238. package/dist/trails/missing-visibility.trail.d.ts.map +1 -0
  239. package/dist/trails/missing-visibility.trail.js +22 -0
  240. package/dist/trails/missing-visibility.trail.js.map +1 -0
  241. package/dist/trails/no-direct-impl-in-route.trail.d.ts +2 -2
  242. package/dist/trails/no-direct-impl-in-route.trail.d.ts.map +1 -1
  243. package/dist/trails/no-direct-implementation-call.trail.d.ts +2 -2
  244. package/dist/trails/no-direct-implementation-call.trail.d.ts.map +1 -1
  245. package/dist/trails/no-sync-result-assumption.trail.d.ts +2 -2
  246. package/dist/trails/no-sync-result-assumption.trail.d.ts.map +1 -1
  247. package/dist/trails/no-throw-in-detour-recover.trail.d.ts +13 -0
  248. package/dist/trails/no-throw-in-detour-recover.trail.d.ts.map +1 -0
  249. package/dist/trails/no-throw-in-detour-recover.trail.js +24 -0
  250. package/dist/trails/no-throw-in-detour-recover.trail.js.map +1 -0
  251. package/dist/trails/no-throw-in-detour-target.trail.d.ts +13 -3
  252. package/dist/trails/no-throw-in-detour-target.trail.d.ts.map +1 -1
  253. package/dist/trails/no-throw-in-implementation.trail.d.ts +2 -2
  254. package/dist/trails/no-throw-in-implementation.trail.d.ts.map +1 -1
  255. package/dist/trails/on-references-exist.trail.d.ts +24 -0
  256. package/dist/trails/on-references-exist.trail.d.ts.map +1 -0
  257. package/dist/trails/on-references-exist.trail.js +21 -0
  258. package/dist/trails/on-references-exist.trail.js.map +1 -0
  259. package/dist/trails/orphaned-signal.trail.d.ts +24 -0
  260. package/dist/trails/orphaned-signal.trail.d.ts.map +1 -0
  261. package/dist/trails/orphaned-signal.trail.js +36 -0
  262. package/dist/trails/orphaned-signal.trail.js.map +1 -0
  263. package/dist/trails/permit-governance.trail.d.ts +12 -0
  264. package/dist/trails/permit-governance.trail.d.ts.map +1 -0
  265. package/dist/trails/permit-governance.trail.js +47 -0
  266. package/dist/trails/permit-governance.trail.js.map +1 -0
  267. package/dist/trails/prefer-schema-inference.trail.d.ts +2 -2
  268. package/dist/trails/prefer-schema-inference.trail.d.ts.map +1 -1
  269. package/dist/trails/reference-exists.trail.d.ts +24 -0
  270. package/dist/trails/reference-exists.trail.d.ts.map +1 -0
  271. package/dist/trails/reference-exists.trail.js +25 -0
  272. package/dist/trails/reference-exists.trail.js.map +1 -0
  273. package/dist/trails/resource-declarations.trail.d.ts +13 -0
  274. package/dist/trails/resource-declarations.trail.d.ts.map +1 -0
  275. package/dist/trails/{provision-declarations.trail.js → resource-declarations.trail.js} +7 -7
  276. package/dist/trails/resource-declarations.trail.js.map +1 -0
  277. package/dist/trails/resource-exists.trail.d.ts +24 -0
  278. package/dist/trails/resource-exists.trail.d.ts.map +1 -0
  279. package/dist/trails/{provision-exists.trail.js → resource-exists.trail.js} +8 -8
  280. package/dist/trails/resource-exists.trail.js.map +1 -0
  281. package/dist/trails/resource-id-grammar.trail.d.ts +13 -0
  282. package/dist/trails/resource-id-grammar.trail.d.ts.map +1 -0
  283. package/dist/trails/resource-id-grammar.trail.js +38 -0
  284. package/dist/trails/resource-id-grammar.trail.js.map +1 -0
  285. package/dist/trails/run.d.ts +25 -9
  286. package/dist/trails/run.d.ts.map +1 -1
  287. package/dist/trails/run.js +63 -19
  288. package/dist/trails/run.js.map +1 -1
  289. package/dist/trails/schema.d.ts +28 -3
  290. package/dist/trails/schema.d.ts.map +1 -1
  291. package/dist/trails/schema.js +57 -4
  292. package/dist/trails/schema.js.map +1 -1
  293. package/dist/trails/unreachable-detour-shadowing.trail.d.ts +13 -0
  294. package/dist/trails/unreachable-detour-shadowing.trail.d.ts.map +1 -0
  295. package/dist/trails/unreachable-detour-shadowing.trail.js +44 -0
  296. package/dist/trails/unreachable-detour-shadowing.trail.js.map +1 -0
  297. package/dist/trails/valid-describe-refs.trail.d.ts +12 -3
  298. package/dist/trails/valid-describe-refs.trail.d.ts.map +1 -1
  299. package/dist/trails/valid-detour-contract.trail.d.ts +12 -0
  300. package/dist/trails/valid-detour-contract.trail.d.ts.map +1 -0
  301. package/dist/trails/valid-detour-contract.trail.js +66 -0
  302. package/dist/trails/valid-detour-contract.trail.js.map +1 -0
  303. package/dist/trails/valid-detour-refs.trail.d.ts +13 -3
  304. package/dist/trails/valid-detour-refs.trail.d.ts.map +1 -1
  305. package/dist/trails/warden-export-symmetry.trail.d.ts +13 -0
  306. package/dist/trails/warden-export-symmetry.trail.d.ts.map +1 -0
  307. package/dist/trails/warden-export-symmetry.trail.js +16 -0
  308. package/dist/trails/warden-export-symmetry.trail.js.map +1 -0
  309. package/dist/trails/warden-rules-use-ast.trail.d.ts +13 -0
  310. package/dist/trails/warden-rules-use-ast.trail.d.ts.map +1 -0
  311. package/dist/trails/warden-rules-use-ast.trail.js +41 -0
  312. package/dist/trails/warden-rules-use-ast.trail.js.map +1 -0
  313. package/dist/trails/wrap-rule.d.ts +16 -2
  314. package/dist/trails/wrap-rule.d.ts.map +1 -1
  315. package/dist/trails/wrap-rule.js +71 -11
  316. package/dist/trails/wrap-rule.js.map +1 -1
  317. package/package.json +7 -4
  318. package/src/__tests__/ast.test.ts +613 -0
  319. package/src/__tests__/circular-refs.test.ts +121 -0
  320. package/src/__tests__/cli.test.ts +360 -32
  321. package/src/__tests__/contour-exists.test.ts +203 -0
  322. package/src/__tests__/cross-declarations.test.ts +245 -0
  323. package/src/__tests__/dead-internal-trail.test.ts +81 -0
  324. package/src/__tests__/draft-rules-context.test.ts +150 -0
  325. package/src/__tests__/drift.test.ts +75 -5
  326. package/src/__tests__/error-mapping-completeness.test.ts +56 -0
  327. package/src/__tests__/example-valid.test.ts +101 -0
  328. package/src/__tests__/fires-declarations-param-destructure.test.ts +54 -0
  329. package/src/__tests__/fires-declarations.test.ts +652 -0
  330. package/src/__tests__/formatters.test.ts +2 -2
  331. package/src/__tests__/implementation-returns-result.test.ts +1016 -2
  332. package/src/__tests__/incomplete-accessor-for-standard-op.test.ts +337 -0
  333. package/src/__tests__/incomplete-crud.test.ts +498 -0
  334. package/src/__tests__/intent-propagation.test.ts +116 -0
  335. package/src/__tests__/missing-reconcile.test.ts +154 -0
  336. package/src/__tests__/missing-visibility.test.ts +108 -0
  337. package/src/__tests__/no-sync-result-assumption.test.ts +870 -39
  338. package/src/__tests__/no-throw-in-detour-recover.test.ts +93 -0
  339. package/src/__tests__/no-throw-in-implementation.test.ts +88 -0
  340. package/src/__tests__/on-references-exist.test.ts +151 -0
  341. package/src/__tests__/orphaned-signal.test.ts +137 -0
  342. package/src/__tests__/permit-governance.test.ts +66 -0
  343. package/src/__tests__/reference-exists.test.ts +281 -0
  344. package/src/__tests__/resource-declarations.test.ts +448 -0
  345. package/src/__tests__/resource-exists.test.ts +122 -0
  346. package/src/__tests__/resource-id-grammar.test.ts +50 -0
  347. package/src/__tests__/rules.test.ts +17 -77
  348. package/src/__tests__/topo-aware-rule.test.ts +257 -0
  349. package/src/__tests__/trails.test.ts +2 -2
  350. package/src/__tests__/unreachable-detour-shadowing.test.ts +128 -0
  351. package/src/__tests__/valid-describe-refs.test.ts +183 -0
  352. package/src/__tests__/valid-detour-contract.test.ts +86 -0
  353. package/src/__tests__/warden-export-symmetry.test.ts +251 -0
  354. package/src/__tests__/warden-rules-use-ast.test.ts +468 -0
  355. package/src/__tests__/wrap-rule.test.ts +3 -3
  356. package/src/cli.ts +458 -91
  357. package/src/draft.ts +22 -0
  358. package/src/drift.ts +63 -21
  359. package/src/formatters.ts +15 -4
  360. package/src/index.ts +62 -23
  361. package/src/rules/ast.ts +2715 -119
  362. package/src/rules/circular-refs.ts +154 -0
  363. package/src/rules/{context-no-trailhead-types.ts → context-no-surface-types.ts} +72 -12
  364. package/src/rules/contour-exists.ts +251 -0
  365. package/src/rules/contour-ids.ts +15 -0
  366. package/src/rules/cross-declarations.ts +277 -69
  367. package/src/rules/dead-internal-trail.ts +141 -0
  368. package/src/rules/draft-file-marking.ts +160 -0
  369. package/src/rules/draft-visible-debt.ts +87 -0
  370. package/src/rules/error-mapping-completeness.ts +273 -0
  371. package/src/rules/example-valid.ts +401 -0
  372. package/src/rules/fires-declarations.ts +609 -0
  373. package/src/rules/implementation-returns-result.ts +1042 -122
  374. package/src/rules/incomplete-accessor-for-standard-op.ts +315 -0
  375. package/src/rules/incomplete-crud.ts +579 -0
  376. package/src/rules/index.ts +95 -16
  377. package/src/rules/intent-propagation.ts +142 -0
  378. package/src/rules/missing-reconcile.ts +98 -0
  379. package/src/rules/missing-visibility.ts +110 -0
  380. package/src/rules/no-direct-impl-in-route.ts +0 -4
  381. package/src/rules/no-direct-implementation-call.ts +1 -1
  382. package/src/rules/no-sync-result-assumption.ts +1134 -96
  383. package/src/rules/no-throw-in-detour-recover.ts +225 -0
  384. package/src/rules/no-throw-in-implementation.ts +6 -4
  385. package/src/rules/on-references-exist.ts +194 -0
  386. package/src/rules/orphaned-signal.ts +150 -0
  387. package/src/rules/permit-governance.ts +25 -0
  388. package/src/rules/reference-exists.ts +98 -0
  389. package/src/rules/registry-names.ts +83 -0
  390. package/src/rules/{provision-declarations.ts → resource-declarations.ts} +208 -138
  391. package/src/rules/{provision-exists.ts → resource-exists.ts} +48 -51
  392. package/src/rules/resource-id-grammar.ts +65 -0
  393. package/src/rules/specs.ts +5 -1
  394. package/src/rules/types.ts +57 -4
  395. package/src/rules/unreachable-detour-shadowing.ts +375 -0
  396. package/src/rules/valid-describe-refs.ts +160 -32
  397. package/src/rules/valid-detour-contract.ts +78 -0
  398. package/src/rules/warden-export-symmetry.ts +533 -0
  399. package/src/rules/warden-rules-use-ast.ts +996 -0
  400. package/src/trails/circular-refs.trail.ts +29 -0
  401. package/src/trails/{context-no-trailhead-types.trail.ts → context-no-surface-types.trail.ts} +4 -4
  402. package/src/trails/contour-exists.trail.ts +21 -0
  403. package/src/trails/dead-internal-trail.trail.ts +26 -0
  404. package/src/trails/draft-file-marking.trail.ts +16 -0
  405. package/src/trails/draft-visible-debt.trail.ts +16 -0
  406. package/src/trails/error-mapping-completeness.trail.ts +29 -0
  407. package/src/trails/example-valid.trail.ts +25 -0
  408. package/src/trails/fires-declarations.trail.ts +22 -0
  409. package/src/trails/incomplete-accessor-for-standard-op.trail.ts +76 -0
  410. package/src/trails/incomplete-crud.trail.ts +39 -0
  411. package/src/trails/index.ts +40 -7
  412. package/src/trails/intent-propagation.trail.ts +30 -0
  413. package/src/trails/missing-reconcile.trail.ts +33 -0
  414. package/src/trails/missing-visibility.trail.ts +22 -0
  415. package/src/trails/no-throw-in-detour-recover.trail.ts +24 -0
  416. package/src/trails/on-references-exist.trail.ts +21 -0
  417. package/src/trails/orphaned-signal.trail.ts +36 -0
  418. package/src/trails/permit-governance.trail.ts +51 -0
  419. package/src/trails/reference-exists.trail.ts +25 -0
  420. package/src/trails/{provision-declarations.trail.ts → resource-declarations.trail.ts} +6 -6
  421. package/src/trails/{provision-exists.trail.ts → resource-exists.trail.ts} +7 -7
  422. package/src/trails/resource-id-grammar.trail.ts +39 -0
  423. package/src/trails/run.ts +121 -24
  424. package/src/trails/schema.ts +66 -4
  425. package/src/trails/unreachable-detour-shadowing.trail.ts +45 -0
  426. package/src/trails/valid-detour-contract.trail.ts +71 -0
  427. package/src/trails/warden-export-symmetry.trail.ts +16 -0
  428. package/src/trails/warden-rules-use-ast.trail.ts +45 -0
  429. package/src/trails/wrap-rule.ts +104 -12
  430. package/tsconfig.tests.json +10 -0
  431. package/tsconfig.tsbuildinfo +1 -1
  432. package/dist/rules/follow-declarations.d.ts +0 -13
  433. package/dist/rules/follow-declarations.d.ts.map +0 -1
  434. package/dist/rules/follow-declarations.js +0 -264
  435. package/dist/rules/follow-declarations.js.map +0 -1
  436. package/dist/rules/provision-declarations.d.ts +0 -14
  437. package/dist/rules/provision-declarations.d.ts.map +0 -1
  438. package/dist/rules/provision-declarations.js +0 -344
  439. package/dist/rules/provision-declarations.js.map +0 -1
  440. package/dist/rules/provision-exists.d.ts +0 -6
  441. package/dist/rules/provision-exists.d.ts.map +0 -1
  442. package/dist/rules/provision-exists.js +0 -89
  443. package/dist/rules/provision-exists.js.map +0 -1
  444. package/dist/rules/service-declarations.d.ts +0 -16
  445. package/dist/rules/service-declarations.d.ts.map +0 -1
  446. package/dist/rules/service-declarations.js +0 -346
  447. package/dist/rules/service-declarations.js.map +0 -1
  448. package/dist/rules/service-exists.d.ts +0 -8
  449. package/dist/rules/service-exists.d.ts.map +0 -1
  450. package/dist/rules/service-exists.js +0 -91
  451. package/dist/rules/service-exists.js.map +0 -1
  452. package/dist/trails/follow-declarations.trail.d.ts.map +0 -1
  453. package/dist/trails/follow-declarations.trail.js +0 -22
  454. package/dist/trails/follow-declarations.trail.js.map +0 -1
  455. package/dist/trails/provision-declarations.trail.d.ts.map +0 -1
  456. package/dist/trails/provision-declarations.trail.js.map +0 -1
  457. package/dist/trails/provision-exists.trail.d.ts +0 -15
  458. package/dist/trails/provision-exists.trail.d.ts.map +0 -1
  459. package/dist/trails/provision-exists.trail.js.map +0 -1
  460. package/dist/trails/service-declarations.trail.d.ts +0 -26
  461. package/dist/trails/service-declarations.trail.d.ts.map +0 -1
  462. package/dist/trails/service-declarations.trail.js +0 -27
  463. package/dist/trails/service-declarations.trail.js.map +0 -1
  464. package/dist/trails/service-exists.trail.d.ts +0 -32
  465. package/dist/trails/service-exists.trail.d.ts.map +0 -1
  466. package/dist/trails/service-exists.trail.js +0 -29
  467. package/dist/trails/service-exists.trail.js.map +0 -1
  468. package/src/__tests__/no-throw-in-detour-target.test.ts +0 -78
  469. package/src/__tests__/provision-declarations.test.ts +0 -318
  470. package/src/__tests__/provision-exists.test.ts +0 -122
  471. package/src/rules/no-throw-in-detour-target.ts +0 -150
  472. package/src/rules/valid-detour-refs.ts +0 -187
  473. package/src/trails/no-throw-in-detour-target.trail.ts +0 -20
  474. package/src/trails/valid-detour-refs.trail.ts +0 -24
@@ -11,10 +11,14 @@ export interface AstNode {
11
11
  readonly key?: {
12
12
  readonly name?: string;
13
13
  };
14
- readonly value?: AstNode;
14
+ readonly value?: unknown;
15
15
  readonly body?: AstNode | readonly AstNode[];
16
16
  readonly [key: string]: unknown;
17
17
  }
18
+ interface StringLiteralNode extends AstNode {
19
+ readonly type: 'Literal' | 'StringLiteral';
20
+ readonly value?: unknown;
21
+ }
18
22
  /** Parse TypeScript source into an AST. Returns null on parse failure. */
19
23
  export declare const parse: (filePath: string, sourceCode: string) => AstNode | null;
20
24
  type WalkFn = (node: unknown, visit: (node: AstNode) => void) => void;
@@ -23,7 +27,7 @@ export declare const walk: WalkFn;
23
27
  /**
24
28
  * Walk an AST node tree without descending into nested function scopes.
25
29
  * The root node is always traversed; only inner function boundaries are skipped.
26
- * Useful for provision-access analysis where inner functions may shadow
30
+ * Useful for resource-access analysis where inner functions may shadow
27
31
  * the trail context parameter name.
28
32
  */
29
33
  export declare const walkScope: WalkFn;
@@ -32,17 +36,86 @@ export declare const offsetToLine: (sourceCode: string, offset: number) => numbe
32
36
  /** Get the name of an Identifier node, or null. */
33
37
  export declare const identifierName: (node: AstNode | undefined) => string | null;
34
38
  /** Check if a node is a string literal. */
35
- export declare const isStringLiteral: (node: AstNode | undefined) => node is AstNode;
39
+ export declare const isStringLiteral: (node: AstNode | undefined) => node is StringLiteralNode;
36
40
  /** Extract the string value from a string literal node. */
37
41
  export declare const getStringValue: (node: AstNode) => string | null;
42
+ /**
43
+ * Best-effort resolution of `const NAME = 'value'` declarations via regex.
44
+ *
45
+ * Returns the string value if a simple `const <name> = '...'` or `"..."` is
46
+ * found in the source. Returns null for anything more complex. Shared between
47
+ * warden rules that need to resolve identifier references to signal / trail
48
+ * IDs at lint time.
49
+ */
50
+ export declare const deriveConstString: (name: string, sourceCode: string) => string | null;
38
51
  /** Extract a string literal value, or null when the node is not a string. */
39
52
  export declare const extractStringLiteral: (node: AstNode | undefined) => string | null;
53
+ export declare const extractPlainTemplateLiteral: (node: AstNode | undefined) => string | null;
54
+ /**
55
+ * Extract a string value from either a string literal or a plain template
56
+ * literal (no `${...}` expressions). Returns null for anything else.
57
+ */
58
+ export declare const extractStringOrTemplateLiteral: (node: AstNode | undefined) => string | null;
59
+ export interface StringLiteralMatch {
60
+ readonly end: number;
61
+ readonly node: AstNode;
62
+ readonly start: number;
63
+ readonly value: string;
64
+ }
65
+ /**
66
+ * Names of framework constants whose value is a draft-marker prefix literal.
67
+ *
68
+ * String literals that initialize a `const` declaration with one of these
69
+ * names are treated as the framework's own draft-marker declarations, not as
70
+ * draft-id usage. This list is intentionally small and explicit — adding a
71
+ * new framework draft-prefix constant requires updating this set.
72
+ */
73
+ export declare const FRAMEWORK_DRAFT_PREFIX_CONSTANT_NAMES: ReadonlySet<string>;
74
+ /**
75
+ * Collect the source offsets of string literals that initialize a framework
76
+ * draft-prefix constant declaration (e.g. `export const DRAFT_ID_PREFIX =
77
+ * '_draft.'`). Used by draft-awareness rules to skip their own marker
78
+ * constants.
79
+ *
80
+ * Exemption is gated on all three of:
81
+ * 1. The file's absolute path matches one of the two framework files that
82
+ * actually define these constants.
83
+ * 2. The declaration name is `DRAFT_ID_PREFIX` or `DRAFT_FILE_PREFIX`.
84
+ * 3. The string literal value is exactly `'_draft.'`.
85
+ *
86
+ * A consumer file that reuses one of these identifier names cannot hide a
87
+ * `_draft.*` leak — the path gate rejects it outright.
88
+ */
89
+ export declare const collectFrameworkDraftPrefixConstantOffsets: (ast: AstNode, filePath: string) => ReadonlySet<number>;
90
+ /**
91
+ * Split source code into lines for pragma lookups. Callers should split once
92
+ * per `check` invocation and thread the result through to
93
+ * {@link hasIgnoreCommentOnLine} so we avoid re-splitting the full source on
94
+ * every match in files with many draft-like string literals.
95
+ */
96
+ export declare const splitSourceLines: (sourceCode: string) => readonly string[];
97
+ /**
98
+ * Check whether the line immediately preceding `line` contains a
99
+ * `// warden-ignore-next-line` pragma (leading/trailing whitespace tolerated).
100
+ * Pragma scope is strictly one line — an intervening blank line breaks it.
101
+ *
102
+ * Takes a pre-split `lines` array so callers can split the source once per
103
+ * invocation instead of re-splitting for every literal they check.
104
+ *
105
+ * @example
106
+ * ```ts
107
+ * // warden-ignore-next-line
108
+ * const x = '_draft.intentional'; // suppressed
109
+ * ```
110
+ */
111
+ export declare const hasIgnoreCommentOnLine: (lines: readonly string[], line: number) => boolean;
112
+ export declare const findStringLiterals: (ast: AstNode, predicate?: (value: string, node: AstNode) => boolean) => StringLiteralMatch[];
40
113
  /** Extract the first string argument from a CallExpression. */
41
114
  export declare const extractFirstStringArg: (node: AstNode) => string | null;
42
- /** Collect `const foo = provision('id', ...)` bindings from a parsed file. */
43
- export declare const collectNamedProvisionIds: (ast: AstNode) => ReadonlyMap<string, string>;
44
- /** Collect all inline `provision('id', ...)` definition IDs from a parsed file. */
45
- export declare const collectProvisionDefinitionIds: (ast: AstNode) => ReadonlySet<string>;
115
+ /** Collect `const foo = resource('id', ...)` bindings from a parsed file. */
116
+ export declare const collectNamedResourceIds: (ast: AstNode) => ReadonlyMap<string, string>;
117
+ /** Collect all inline `resource('id', ...)` definition IDs from a parsed file. */
118
+ export declare const collectResourceDefinitionIds: (ast: AstNode) => ReadonlySet<string>;
46
119
  /** Backward-compatible aliases while the migration is in flight. */
47
120
  export declare const collectNamedServiceIds: (ast: AstNode) => ReadonlyMap<string, string>;
48
121
  /** Backward-compatible aliases while the migration is in flight. */
@@ -59,7 +132,223 @@ export interface TrailDefinition {
59
132
  /** Start offset of the call expression */
60
133
  readonly start: number;
61
134
  }
135
+ /**
136
+ * Collect the identifier bindings introduced *directly* by a scope frame
137
+ * node. Scope frames correspond to JS lexical scopes (function bodies, blocks,
138
+ * catch clauses, for-statements, switch statements, module/script roots).
139
+ */
140
+ export declare const collectScopeFrameBindings: (node: AstNode) => ReadonlySet<string>;
141
+ export type ScopeAwareVisitor = (node: AstNode, scopes: readonly ReadonlySet<string>[]) => void;
142
+ export interface ScopeWalkOptions {
143
+ readonly initialScopes?: readonly ReadonlySet<string>[];
144
+ readonly stopAtNestedFunctions?: boolean;
145
+ }
146
+ /**
147
+ * Walk an AST subtree while threading lexical scope bindings through each
148
+ * visit. Callers can seed outer scopes and optionally stop at nested function
149
+ * boundaries when only the current implementation body should be analyzed.
150
+ */
151
+ export declare const walkWithScopes: (node: unknown, visit: ScopeAwareVisitor, options?: ScopeWalkOptions) => void;
152
+ /**
153
+ * Return `true` when `node` is a non-computed member access (`a.b` /
154
+ * `a?.b`) and `false` for anything else, including computed access
155
+ * (`a[b]`) or non-member nodes. Exported as the canonical predicate so
156
+ * rule modules do not re-implement the check.
157
+ *
158
+ * @remarks
159
+ * Declared near the top of the file so the scope walker can use it
160
+ * without hitting `no-use-before-define`. A few sibling helpers in this
161
+ * module still inline the same shape under different local names for
162
+ * historical reasons; prefer this export for new call sites.
163
+ */
164
+ export declare const isMemberAccessNonComputed: (node: AstNode) => boolean;
165
+ /**
166
+ * Resolution context for namespaced framework-primitive calls. Bundles the
167
+ * bare namespace-binding set with an optional set of proven-safe
168
+ * `CallExpression` start offsets from a scope-aware pre-pass. When the set of
169
+ * safe starts is present, a namespaced call only resolves if its start is in
170
+ * that set — so a function-local shadow of the namespace import does not
171
+ * leak through. When absent (e.g. from test helpers), the name-only gate is
172
+ * used as a backward-compatible fallback.
173
+ */
174
+ export interface FrameworkNamespaceContext {
175
+ readonly namespaces: ReadonlySet<string>;
176
+ readonly safeCallStarts?: ReadonlySet<number>;
177
+ }
178
+ /**
179
+ * Test hook: exposes {@link getTrailCalleeName} for unit tests.
180
+ *
181
+ * Kept unexported from the module's public surface (no re-export from
182
+ * `index.ts`) so internal refactors stay free.
183
+ */
184
+ export declare const __getTrailCalleeNameForTest: (node: AstNode, context?: ReadonlySet<string> | FrameworkNamespaceContext) => string | null;
185
+ /**
186
+ * Test hook: exposes {@link collectFrameworkNamespaceBindings} for unit tests.
187
+ *
188
+ * Not re-exported from `index.ts`; the double-underscore prefix marks it as an
189
+ * internal-only handle so consumer code cannot rely on it.
190
+ */
191
+ export declare const __collectFrameworkNamespaceBindingsForTest: (ast: AstNode) => ReadonlySet<string>;
62
192
  export declare const findTrailDefinitions: (ast: AstNode) => TrailDefinition[];
193
+ export interface ContourDefinition {
194
+ /** Local binding name when the contour is assigned to a variable. */
195
+ readonly bindingName?: string;
196
+ /** Contour name string, e.g. "user". */
197
+ readonly name: string;
198
+ /** Original call expression for the contour declaration. */
199
+ readonly call: AstNode;
200
+ /** Options object argument passed to contour(), when present. */
201
+ readonly options: AstNode | null;
202
+ /** Shape object argument passed to contour(). */
203
+ readonly shape: AstNode;
204
+ /** Start offset of the call expression. */
205
+ readonly start: number;
206
+ }
207
+ export interface FindContourDefinitionsOptions {
208
+ /**
209
+ * When true, skip contour calls nested inside other expressions (e.g.
210
+ * `core.contour('inner', {...}).id()` used as a field of an outer contour).
211
+ * Top-level forms are still surfaced: both `const foo = contour(...)`
212
+ * declarations and bare `contour('name', {...});` statement-form calls that
213
+ * appear directly in the program body (optionally wrapped in `export`) are
214
+ * returned.
215
+ *
216
+ * Defaults to `false`: both top-level and inline contours are returned so
217
+ * that reference-site resolution can reach anonymous inline contours.
218
+ */
219
+ readonly topLevelOnly?: boolean;
220
+ }
221
+ /**
222
+ * Return every `contour('name', ...)` definition reachable from the AST, in
223
+ * source order, deduplicated by call-expression start offset.
224
+ *
225
+ * Includes both top-level bindings (`const user = contour('user', ...)`) and
226
+ * inline contour calls nested inside other expressions (e.g.
227
+ * `contour('outer', { inner: contour('inner', ...).id() })`). Inline contours
228
+ * carry no `bindingName` because they have no local binding — this asymmetry
229
+ * is why {@link collectNamedContourIds} returns only the top-level subset
230
+ * while {@link collectContourDefinitionIds} returns the full set.
231
+ *
232
+ * Pass `{ topLevelOnly: true }` via `options` to opt out of inline discovery
233
+ * without disturbing callers that rely on the default behavior.
234
+ *
235
+ * @remarks
236
+ * Supplying a pre-built `context` skips the second full-AST traversal inside
237
+ * `buildFrameworkNamespaceContext` — useful for callers (such as
238
+ * {@link collectContourReferenceSites}) that already built one.
239
+ */
240
+ export declare const findContourDefinitions: (ast: AstNode, context?: FrameworkNamespaceContext, options?: FindContourDefinitionsOptions) => ContourDefinition[];
241
+ /**
242
+ * Collect the `name` of every contour definition in a parsed file, including
243
+ * inline contours nested inside other expressions. Returns the same set of
244
+ * names that {@link findContourDefinitions} discovers under default options.
245
+ */
246
+ export declare const collectContourDefinitionIds: (ast: AstNode) => ReadonlySet<string>;
247
+ /**
248
+ * Collect the `localBinding → contourName` map for `const foo = contour(...)`
249
+ * declarations. Inline contour calls are intentionally excluded because they
250
+ * have no local binding — use {@link collectContourDefinitionIds} when the
251
+ * full set of declared names is required.
252
+ */
253
+ export declare const collectNamedContourIds: (ast: AstNode) => ReadonlyMap<string, string>;
254
+ /**
255
+ * Collect `import { foo as bar } from '...'` and `import bar from '...'`
256
+ * specifier mappings keyed by local binding name. The value is the original
257
+ * exported name for named imports. Default imports map to themselves because
258
+ * the exported name cannot be recovered statically — callers should fall
259
+ * through to `knownContourIds` membership on the local binding name.
260
+ */
261
+ export declare const collectImportAliasMap: (ast: AstNode) => ReadonlyMap<string, string>;
262
+ /**
263
+ * Collect local binding names introduced by `import * as <name> from '<src>'`
264
+ * declarations whose source is NOT an `@ontrails/*` framework package. These
265
+ * are user-defined namespace imports of contour modules (e.g. `import * as
266
+ * contours from './contours'`), used to resolve `contours.user` member-access
267
+ * references to contour ids.
268
+ *
269
+ * Framework namespace imports (`import * as core from '@ontrails/core'`) are
270
+ * intentionally excluded — they carry framework primitives like
271
+ * `core.contour(...)` and are resolved by {@link buildFrameworkNamespaceContext}.
272
+ * Mixing them here would treat `core.contour` as a reference to a contour
273
+ * named "contour", producing false positives.
274
+ */
275
+ export declare const collectUserNamespaceImportBindings: (ast: AstNode) => ReadonlySet<string>;
276
+ /**
277
+ * Resolution context for user-namespace member access like `contours.user`.
278
+ * Bundles the set of local namespace-binding names (from `import * as x from
279
+ * './contours'`) with an optional set of proven-safe `MemberExpression` start
280
+ * offsets from a scope-aware pre-pass. When `safeMemberStarts` is present, a
281
+ * member access only resolves to a user-namespace target if its start is in
282
+ * the set — so a function-local shadow of the namespace import does not leak
283
+ * through. When absent, the name-only gate is used as a
284
+ * backward-compatible fallback for ad-hoc callers.
285
+ */
286
+ export interface UserNamespaceContext {
287
+ readonly bindings: ReadonlySet<string>;
288
+ readonly safeMemberStarts?: ReadonlySet<number>;
289
+ }
290
+ /**
291
+ * Build a {@link UserNamespaceContext} for `ast`, including the scope-aware
292
+ * `safeMemberStarts` gate. Prefer this over bare
293
+ * {@link collectUserNamespaceImportBindings} so member access like
294
+ * `contours.user` is rejected when `contours` is shadowed by a local binding.
295
+ */
296
+ export declare const buildUserNamespaceContext: (ast: AstNode) => UserNamespaceContext;
297
+ export interface ContourReferenceSite {
298
+ /** Field on the source contour that declares the reference. */
299
+ readonly field: string;
300
+ /** Source contour name. */
301
+ readonly source: string;
302
+ /** Start offset of the field declaration. */
303
+ readonly start: number;
304
+ /** Target contour name. */
305
+ readonly target: string;
306
+ }
307
+ /**
308
+ * Read a property key or member access identifier.
309
+ *
310
+ * Returns the identifier name for `Identifier` keys, or the underlying
311
+ * string literal value for computed access via `['name']` / `"name"`.
312
+ */
313
+ export declare const getPropertyName: (node: unknown) => string | null;
314
+ /**
315
+ * Resolve a local binding name to a contour ID, honoring import aliases.
316
+ *
317
+ * Strategies, in order:
318
+ * 1. Local `const foo = contour('name', ...)` binding → the contour name.
319
+ * 2. `knownContourIds` membership on the binding name itself (or the
320
+ * conventional `Contour` suffix strip).
321
+ * 3. `import { foo as bar }` → use the original exported name `foo`
322
+ * (and apply strategy 2 / suffix-stripping against it so aliased imports
323
+ * resolve correctly). If the imported name still isn't recognized, the
324
+ * imported name is returned so the caller can report it missing.
325
+ *
326
+ * Returns `null` only when the name belongs to no known resolution path —
327
+ * no local binding, no known contour ID, no import, and no suffix match.
328
+ * Returning `null` means "this identifier is not a contour reference we can
329
+ * reason about" (e.g. a bare undeclared variable), as opposed to
330
+ * "a contour reference whose target is missing".
331
+ */
332
+ export declare const deriveContourIdentifierName: (bindingName: string, namedContourIds: ReadonlyMap<string, string>, knownContourIds?: ReadonlySet<string>, importAliases?: ReadonlyMap<string, string>) => string | null;
333
+ /**
334
+ * Resolve a user-namespace member access like `contours.user` to its contour
335
+ * id. Returns the property name (e.g. `'user'`) when the receiver identifier
336
+ * is a known user-defined namespace binding AND — when the caller provides a
337
+ * {@link UserNamespaceContext} with `safeMemberStarts` — the member access
338
+ * site is in that set (i.e. the receiver is not shadowed by any enclosing
339
+ * scope). Otherwise returns `null`.
340
+ *
341
+ * The property name is taken as the contour id verbatim — we cannot statically
342
+ * resolve what `contours.user` binds to without reading the other file, so we
343
+ * treat the member name as the candidate target and let
344
+ * {@link deriveContourIdentifierName}'s downstream `knownContourIds` check
345
+ * report a missing target.
346
+ */
347
+ export declare const isUserNamespaceReceiverAllowed: (receiver: string, memberStart: number, ctx: UserNamespaceContext) => boolean;
348
+ /** Collect all contour field references declared via `.id()` in a parsed file. */
349
+ export declare const collectContourReferenceSites: (ast: AstNode, knownContourIds?: ReadonlySet<string>) => readonly ContourReferenceSite[];
350
+ /** Collect contour reference targets keyed by source contour name. */
351
+ export declare const collectContourReferenceTargetsByName: (ast: AstNode, knownContourIds?: ReadonlySet<string>) => ReadonlyMap<string, readonly string[]>;
63
352
  /**
64
353
  * Find `blaze:` property values.
65
354
  *
@@ -69,6 +358,122 @@ export declare const findTrailDefinitions: (ast: AstNode) => TrailDefinition[];
69
358
  * (e.g. `meta: { blaze: ... }`).
70
359
  */
71
360
  export declare const findBlazeBodies: (node: AstNode) => AstNode[];
361
+ /**
362
+ * Collect all `signal('id', { ... })` / `signal({ id: 'x', ... })` definition IDs.
363
+ *
364
+ * Uses `findTrailDefinitions` under the hood — it already recognizes both
365
+ * `trail` and `signal` call sites, distinguished by the `kind` field.
366
+ */
367
+ export declare const collectSignalDefinitionIds: (ast: AstNode) => ReadonlySet<string>;
368
+ /** Collect `const foo = trail('id', ...)` bindings from a parsed file. */
369
+ export declare const collectNamedTrailIds: (ast: AstNode) => ReadonlyMap<string, string>;
370
+ /** Extract the raw `crosses: [...]` array elements from a trail config. */
371
+ export declare const getCrossElements: (config: AstNode) => readonly AstNode[];
372
+ /**
373
+ * Resolve a single `crosses: [...]` element to its target trail ID.
374
+ *
375
+ * Handles string literals, identifier references (via `namedTrailIds` map or
376
+ * `const NAME = '...'` resolution), and inline `trail(...)` call expressions.
377
+ */
378
+ export declare const deriveCrossElementId: (element: AstNode, sourceCode: string, namedTrailIds: ReadonlyMap<string, string>) => string | null;
379
+ /**
380
+ * Collect all trail IDs referenced by a single trail definition's
381
+ * `crosses: [...]` array, deduplicated.
382
+ */
383
+ export declare const extractDefinitionCrossTargetIds: (config: AstNode, sourceCode: string, namedTrailIds: ReadonlyMap<string, string>) => readonly string[];
384
+ /** Collect all trail IDs referenced by declared `crosses: [...]` arrays. */
385
+ export declare const collectCrossTargetTrailIds: (ast: AstNode, sourceCode: string) => ReadonlySet<string>;
386
+ /** Collect the normalized intent for every trail definition in a parsed file. */
387
+ export declare const collectTrailIntentsById: (ast: AstNode) => ReadonlyMap<string, "destroy" | "read" | "write">;
388
+ export interface StoreTableDefinition {
389
+ /** Table name declared inside store({ ... }). */
390
+ readonly name: string;
391
+ /**
392
+ * Local binding name of the enclosing `store(...)` declaration, if the
393
+ * `store(...)` call is bound to a `const`/`let`/`var` (e.g. `db` in
394
+ * `const db = store({ ... })`). Null for anonymous stores.
395
+ */
396
+ readonly storeBinding: string | null;
397
+ /**
398
+ * Stable composite key for this table in the form `${storeBinding}:${name}`,
399
+ * falling back to the bare `name` when the store is anonymous. Use this for
400
+ * cross-rule / cross-file keying so two stores with the same table name
401
+ * never collide.
402
+ */
403
+ readonly key: string;
404
+ /** Start offset of the table property declaration. */
405
+ readonly start: number;
406
+ /** Whether the authored table opts into version tracking. */
407
+ readonly versioned: boolean;
408
+ }
409
+ /**
410
+ * Build a composite key for a store table: `${storeBinding}:${tableName}`,
411
+ * falling back to the bare `tableName` when the enclosing store has no local
412
+ * binding. Centralized so rule keying stays stable.
413
+ *
414
+ * @remarks
415
+ * The key is intentionally file-local (no module path prefix). Cross-file
416
+ * aggregation in `ProjectContext` merges keys from all files, so two files
417
+ * with `const db = store({ notes: ... })` both produce `db:notes` — this is
418
+ * the desired behavior because the warden checks for *pattern completeness*
419
+ * across the project and matching keys signals that the same logical table
420
+ * is covered. If two genuinely different tables share a binding and name,
421
+ * that is a code-level naming collision the developer should resolve.
422
+ */
423
+ export declare const makeStoreTableKey: (storeBinding: string | null, tableName: string) => string;
424
+ /**
425
+ * Check if a node is a `CallExpression` to the identifier `name`.
426
+ *
427
+ * e.g. `isNamedCall(node, 'store')` matches `store({...})` but not
428
+ * `someObj.store()` or `storeAlt()`.
429
+ */
430
+ export declare const isNamedCall: (node: AstNode | undefined, name: string) => boolean;
431
+ /**
432
+ * Narrow a member-expression node (`a.b` or `a['b']`) to its `object` /
433
+ * `property` pair, returning `null` for anything else.
434
+ */
435
+ export declare const getMemberExpression: (node: AstNode | undefined) => {
436
+ readonly object?: AstNode;
437
+ readonly property?: AstNode;
438
+ } | null;
439
+ /**
440
+ * Resolve a `<store>.tables.<name>` member expression to its store binding
441
+ * and table name.
442
+ *
443
+ * Returns `null` for anything that isn't a two-level member access ending in
444
+ * `.tables.<name>`. The store binding is the identifier of the object owning
445
+ * `.tables` — typically the local binding from `const db = store(...)`.
446
+ */
447
+ export declare const extractStoreTableFromMember: (node: AstNode | undefined) => {
448
+ readonly storeBinding: string | null;
449
+ readonly tableName: string;
450
+ } | null;
451
+ /**
452
+ * Back-compat shim for rule code that only needs the table name. Prefer
453
+ * `extractStoreTableFromMember` so the caller can build a composite key.
454
+ */
455
+ export declare const extractStoreTableIdFromMember: (node: AstNode | undefined) => string | null;
456
+ /**
457
+ * Collect `const foo = <store>.tables.<name>` bindings from a parsed file,
458
+ * keyed by the local binding name. Values are the composite table key
459
+ * (`${storeBinding}:${tableName}`) so callers can dedupe across stores that
460
+ * share a table name.
461
+ */
462
+ export declare const collectNamedStoreTableIds: (ast: AstNode) => ReadonlyMap<string, string>;
463
+ /**
464
+ * Resolve an argument node to a composite store-table key
465
+ * (`${storeBinding}:${tableName}` or bare `tableName` when anonymous).
466
+ *
467
+ * Handles the two authoring patterns:
468
+ * - direct member access: `db.tables.notes`
469
+ * - identifier reference: `const notesTable = db.tables.notes; crud(notesTable, …)`
470
+ */
471
+ export declare const deriveStoreTableId: (node: AstNode | undefined, namedStoreTableIds: ReadonlyMap<string, string>) => string | null;
472
+ export declare const findStoreTableDefinitions: (ast: AstNode) => readonly StoreTableDefinition[];
473
+ export declare const collectVersionedStoreTableIds: (ast: AstNode) => ReadonlySet<string>;
474
+ export declare const collectCrudTableIds: (ast: AstNode) => ReadonlySet<string>;
475
+ export declare const collectReconcileTableIds: (ast: AstNode) => ReadonlySet<string>;
476
+ export declare const collectOnTargetSignalIds: (ast: AstNode, sourceCode: string) => ReadonlySet<string>;
72
477
  /** Check if a node is a call to `.blaze()` on some object. */
73
478
  export declare const isBlazeCall: (node: AstNode) => boolean;
74
479
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"ast.d.ts","sourceRoot":"","sources":["../../src/rules/ast.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAQH,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,GAAG,CAAC,EAAE;QAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1C,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,GAAG,SAAS,OAAO,EAAE,CAAC;IAC7C,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACjC;AAMD,0EAA0E;AAC1E,eAAO,MAAM,KAAK,GAAI,UAAU,MAAM,EAAE,YAAY,MAAM,KAAG,OAAO,GAAG,IAOtE,CAAC;AAMF,KAAK,MAAM,GAAG,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,KAAK,IAAI,CAAC;AAkBtE,4DAA4D;AAC5D,eAAO,MAAM,IAAI,EAAE,MASlB,CAAC;AAsBF;;;;;GAKG;AACH,eAAO,MAAM,SAAS,EAAE,MASvB,CAAC;AAMF,mEAAmE;AACnE,eAAO,MAAM,YAAY,GAAI,YAAY,MAAM,EAAE,QAAQ,MAAM,KAAG,MAQjE,CAAC;AAEF,mDAAmD;AACnD,eAAO,MAAM,cAAc,GAAI,MAAM,OAAO,GAAG,SAAS,KAAG,MAAM,GAAG,IAKnE,CAAC;AAEF,2CAA2C;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