@descryy/core 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (353) hide show
  1. package/dist/budget/reply.d.ts +11 -46
  2. package/dist/budget/reply.d.ts.map +1 -1
  3. package/dist/budget/reply.js +10 -39
  4. package/dist/budget/reply.js.map +1 -1
  5. package/dist/budget/size.d.ts +2 -21
  6. package/dist/budget/size.d.ts.map +1 -1
  7. package/dist/budget/size.js +3 -24
  8. package/dist/budget/size.js.map +1 -1
  9. package/dist/capabilities/preconditions.d.ts +7 -68
  10. package/dist/capabilities/preconditions.d.ts.map +1 -1
  11. package/dist/capabilities/preconditions.js +6 -57
  12. package/dist/capabilities/preconditions.js.map +1 -1
  13. package/dist/contracts/engine.d.ts +23 -11
  14. package/dist/contracts/engine.d.ts.map +1 -1
  15. package/dist/contracts/engine.js +23 -11
  16. package/dist/contracts/engine.js.map +1 -1
  17. package/dist/contracts/orphans.d.ts +18 -122
  18. package/dist/contracts/orphans.d.ts.map +1 -1
  19. package/dist/contracts/orphans.js +36 -134
  20. package/dist/contracts/orphans.js.map +1 -1
  21. package/dist/contracts/paths.d.ts +4 -114
  22. package/dist/contracts/paths.d.ts.map +1 -1
  23. package/dist/contracts/paths.js +7 -140
  24. package/dist/contracts/paths.js.map +1 -1
  25. package/dist/contracts/shapes.d.ts +13 -66
  26. package/dist/contracts/shapes.d.ts.map +1 -1
  27. package/dist/contracts/shapes.js +20 -91
  28. package/dist/contracts/shapes.js.map +1 -1
  29. package/dist/governance/budget.d.ts +12 -48
  30. package/dist/governance/budget.d.ts.map +1 -1
  31. package/dist/governance/budget.js +12 -48
  32. package/dist/governance/budget.js.map +1 -1
  33. package/dist/governance/candidate-boundary.d.ts +4 -32
  34. package/dist/governance/candidate-boundary.d.ts.map +1 -1
  35. package/dist/governance/candidate-boundary.js +4 -32
  36. package/dist/governance/candidate-boundary.js.map +1 -1
  37. package/dist/governance/escalation.d.ts +7 -45
  38. package/dist/governance/escalation.d.ts.map +1 -1
  39. package/dist/governance/escalation.js +7 -45
  40. package/dist/governance/escalation.js.map +1 -1
  41. package/dist/governance/fact-boundary.d.ts +7 -49
  42. package/dist/governance/fact-boundary.d.ts.map +1 -1
  43. package/dist/governance/fact-boundary.js +5 -43
  44. package/dist/governance/fact-boundary.js.map +1 -1
  45. package/dist/governance/finding-funnel.d.ts +11 -72
  46. package/dist/governance/finding-funnel.d.ts.map +1 -1
  47. package/dist/governance/finding-funnel.js +9 -68
  48. package/dist/governance/finding-funnel.js.map +1 -1
  49. package/dist/graph/build.d.ts +9 -90
  50. package/dist/graph/build.d.ts.map +1 -1
  51. package/dist/graph/build.js +15 -62
  52. package/dist/graph/build.js.map +1 -1
  53. package/dist/graph/cross-language.d.ts +4 -43
  54. package/dist/graph/cross-language.d.ts.map +1 -1
  55. package/dist/graph/cross-language.js +9 -77
  56. package/dist/graph/cross-language.js.map +1 -1
  57. package/dist/graph/merge.d.ts +8 -88
  58. package/dist/graph/merge.d.ts.map +1 -1
  59. package/dist/graph/merge.js +9 -93
  60. package/dist/graph/merge.js.map +1 -1
  61. package/dist/graph/observed-tests.d.ts +7 -68
  62. package/dist/graph/observed-tests.d.ts.map +1 -1
  63. package/dist/graph/observed-tests.js +5 -60
  64. package/dist/graph/observed-tests.js.map +1 -1
  65. package/dist/graph/persist.d.ts +2 -25
  66. package/dist/graph/persist.d.ts.map +1 -1
  67. package/dist/graph/persist.js +2 -25
  68. package/dist/graph/persist.js.map +1 -1
  69. package/dist/graph/runtime-confirmation.d.ts +14 -91
  70. package/dist/graph/runtime-confirmation.d.ts.map +1 -1
  71. package/dist/graph/runtime-confirmation.js +19 -103
  72. package/dist/graph/runtime-confirmation.js.map +1 -1
  73. package/dist/ledger/mint.d.ts +9 -43
  74. package/dist/ledger/mint.d.ts.map +1 -1
  75. package/dist/ledger/mint.js +15 -65
  76. package/dist/ledger/mint.js.map +1 -1
  77. package/dist/ledger/resolve.d.ts +13 -81
  78. package/dist/ledger/resolve.d.ts.map +1 -1
  79. package/dist/ledger/resolve.js +13 -76
  80. package/dist/ledger/resolve.js.map +1 -1
  81. package/dist/multipr/fingerprint.d.ts +5 -46
  82. package/dist/multipr/fingerprint.d.ts.map +1 -1
  83. package/dist/multipr/fingerprint.js +22 -74
  84. package/dist/multipr/fingerprint.js.map +1 -1
  85. package/dist/multipr/hidden-dependency.d.ts +13 -73
  86. package/dist/multipr/hidden-dependency.d.ts.map +1 -1
  87. package/dist/multipr/hidden-dependency.js +12 -63
  88. package/dist/multipr/hidden-dependency.js.map +1 -1
  89. package/dist/multipr/mechanical.d.ts +25 -160
  90. package/dist/multipr/mechanical.d.ts.map +1 -1
  91. package/dist/multipr/mechanical.js +21 -137
  92. package/dist/multipr/mechanical.js.map +1 -1
  93. package/dist/multipr/migration-heads.d.ts +18 -105
  94. package/dist/multipr/migration-heads.d.ts.map +1 -1
  95. package/dist/multipr/migration-heads.js +15 -84
  96. package/dist/multipr/migration-heads.js.map +1 -1
  97. package/dist/multipr/overlap.d.ts +16 -94
  98. package/dist/multipr/overlap.d.ts.map +1 -1
  99. package/dist/multipr/overlap.js +25 -105
  100. package/dist/multipr/overlap.js.map +1 -1
  101. package/dist/multipr/scope-store.d.ts +15 -80
  102. package/dist/multipr/scope-store.d.ts.map +1 -1
  103. package/dist/multipr/scope-store.js +17 -87
  104. package/dist/multipr/scope-store.js.map +1 -1
  105. package/dist/multipr/superseded.d.ts +10 -95
  106. package/dist/multipr/superseded.d.ts.map +1 -1
  107. package/dist/multipr/superseded.js +7 -60
  108. package/dist/multipr/superseded.js.map +1 -1
  109. package/dist/query/confirmed-facts.d.ts +12 -58
  110. package/dist/query/confirmed-facts.d.ts.map +1 -1
  111. package/dist/query/confirmed-facts.js +8 -47
  112. package/dist/query/confirmed-facts.js.map +1 -1
  113. package/dist/query/declared-value-closure.d.ts +13 -104
  114. package/dist/query/declared-value-closure.d.ts.map +1 -1
  115. package/dist/query/declared-value-closure.js +15 -104
  116. package/dist/query/declared-value-closure.js.map +1 -1
  117. package/dist/query/memory.d.ts +4 -16
  118. package/dist/query/memory.d.ts.map +1 -1
  119. package/dist/query/memory.js +9 -22
  120. package/dist/query/memory.js.map +1 -1
  121. package/dist/query/prominence.d.ts +6 -55
  122. package/dist/query/prominence.d.ts.map +1 -1
  123. package/dist/query/prominence.js +6 -55
  124. package/dist/query/prominence.js.map +1 -1
  125. package/dist/query/provider.d.ts +27 -93
  126. package/dist/query/provider.d.ts.map +1 -1
  127. package/dist/query/provider.js +8 -29
  128. package/dist/query/provider.js.map +1 -1
  129. package/dist/query/queries.d.ts +15 -65
  130. package/dist/query/queries.d.ts.map +1 -1
  131. package/dist/query/queries.js +30 -104
  132. package/dist/query/queries.js.map +1 -1
  133. package/dist/query/refusal-fetch.d.ts +8 -85
  134. package/dist/query/refusal-fetch.d.ts.map +1 -1
  135. package/dist/query/refusal-fetch.js +11 -93
  136. package/dist/query/refusal-fetch.js.map +1 -1
  137. package/dist/query/refusal-questions.d.ts +17 -92
  138. package/dist/query/refusal-questions.d.ts.map +1 -1
  139. package/dist/query/refusal-questions.js +14 -78
  140. package/dist/query/refusal-questions.js.map +1 -1
  141. package/dist/query/resolution-floor.d.ts +3 -23
  142. package/dist/query/resolution-floor.d.ts.map +1 -1
  143. package/dist/query/resolution-floor.js +3 -23
  144. package/dist/query/resolution-floor.js.map +1 -1
  145. package/dist/query/root-cause-score.d.ts +11 -161
  146. package/dist/query/root-cause-score.d.ts.map +1 -1
  147. package/dist/query/root-cause-score.js +6 -137
  148. package/dist/query/root-cause-score.js.map +1 -1
  149. package/dist/query/row-closure-picture.d.ts +5 -67
  150. package/dist/query/row-closure-picture.d.ts.map +1 -1
  151. package/dist/query/row-closure-picture.js +6 -67
  152. package/dist/query/row-closure-picture.js.map +1 -1
  153. package/dist/query/similar-incidents.d.ts +6 -41
  154. package/dist/query/similar-incidents.d.ts.map +1 -1
  155. package/dist/query/similar-incidents.js +15 -69
  156. package/dist/query/similar-incidents.js.map +1 -1
  157. package/dist/query/sqlite.d.ts +3 -7
  158. package/dist/query/sqlite.d.ts.map +1 -1
  159. package/dist/query/sqlite.js +9 -19
  160. package/dist/query/sqlite.js.map +1 -1
  161. package/dist/query/test-coverage.d.ts +5 -45
  162. package/dist/query/test-coverage.d.ts.map +1 -1
  163. package/dist/query/test-coverage.js +10 -53
  164. package/dist/query/test-coverage.js.map +1 -1
  165. package/dist/query/traverse.d.ts +22 -126
  166. package/dist/query/traverse.d.ts.map +1 -1
  167. package/dist/query/traverse.js +25 -126
  168. package/dist/query/traverse.js.map +1 -1
  169. package/dist/query/unresolved.d.ts +19 -164
  170. package/dist/query/unresolved.d.ts.map +1 -1
  171. package/dist/query/unresolved.js +11 -138
  172. package/dist/query/unresolved.js.map +1 -1
  173. package/dist/query/verification-status.d.ts +12 -109
  174. package/dist/query/verification-status.d.ts.map +1 -1
  175. package/dist/query/verification-status.js +9 -99
  176. package/dist/query/verification-status.js.map +1 -1
  177. package/dist/recording/migrate.d.ts +4 -10
  178. package/dist/recording/migrate.d.ts.map +1 -1
  179. package/dist/recording/migrate.js +4 -10
  180. package/dist/recording/migrate.js.map +1 -1
  181. package/dist/recording/reader.d.ts +2 -7
  182. package/dist/recording/reader.d.ts.map +1 -1
  183. package/dist/recording/reader.js +2 -7
  184. package/dist/recording/reader.js.map +1 -1
  185. package/dist/recording/redact.d.ts +6 -57
  186. package/dist/recording/redact.d.ts.map +1 -1
  187. package/dist/recording/redact.js +8 -64
  188. package/dist/recording/redact.js.map +1 -1
  189. package/dist/recording/schema.d.ts +3 -38
  190. package/dist/recording/schema.d.ts.map +1 -1
  191. package/dist/recording/schema.js +3 -38
  192. package/dist/recording/schema.js.map +1 -1
  193. package/dist/recording/writer.d.ts +11 -74
  194. package/dist/recording/writer.d.ts.map +1 -1
  195. package/dist/recording/writer.js +3 -43
  196. package/dist/recording/writer.js.map +1 -1
  197. package/dist/scoping/fanout.d.ts +6 -68
  198. package/dist/scoping/fanout.d.ts.map +1 -1
  199. package/dist/scoping/fanout.js +6 -68
  200. package/dist/scoping/fanout.js.map +1 -1
  201. package/dist/scoping/score.d.ts +20 -70
  202. package/dist/scoping/score.d.ts.map +1 -1
  203. package/dist/scoping/score.js +20 -70
  204. package/dist/scoping/score.js.map +1 -1
  205. package/dist/scoping/tiers.d.ts +4 -16
  206. package/dist/scoping/tiers.d.ts.map +1 -1
  207. package/dist/scoping/tiers.js +4 -16
  208. package/dist/scoping/tiers.js.map +1 -1
  209. package/dist/scoping/traverse.d.ts +3 -25
  210. package/dist/scoping/traverse.d.ts.map +1 -1
  211. package/dist/scoping/traverse.js +14 -49
  212. package/dist/scoping/traverse.js.map +1 -1
  213. package/dist/scoping/weights.d.ts +10 -74
  214. package/dist/scoping/weights.d.ts.map +1 -1
  215. package/dist/scoping/weights.js +14 -86
  216. package/dist/scoping/weights.js.map +1 -1
  217. package/dist/sources/confirmed/incidents.d.ts +5 -35
  218. package/dist/sources/confirmed/incidents.d.ts.map +1 -1
  219. package/dist/sources/confirmed/incidents.js +14 -48
  220. package/dist/sources/confirmed/incidents.js.map +1 -1
  221. package/dist/sources/git/diff.d.ts +71 -65
  222. package/dist/sources/git/diff.d.ts.map +1 -1
  223. package/dist/sources/git/diff.js +136 -83
  224. package/dist/sources/git/diff.js.map +1 -1
  225. package/dist/sources/git/env.d.ts +7 -0
  226. package/dist/sources/git/env.d.ts.map +1 -1
  227. package/dist/sources/git/env.js +10 -11
  228. package/dist/sources/git/env.js.map +1 -1
  229. package/dist/sources/git/history.d.ts +64 -84
  230. package/dist/sources/git/history.d.ts.map +1 -1
  231. package/dist/sources/git/history.js +141 -112
  232. package/dist/sources/git/history.js.map +1 -1
  233. package/dist/sources/git/incidents.d.ts +13 -75
  234. package/dist/sources/git/incidents.d.ts.map +1 -1
  235. package/dist/sources/git/incidents.js +21 -91
  236. package/dist/sources/git/incidents.js.map +1 -1
  237. package/dist/sources/git/index.d.ts +5 -3
  238. package/dist/sources/git/index.d.ts.map +1 -1
  239. package/dist/sources/git/index.js +3 -2
  240. package/dist/sources/git/index.js.map +1 -1
  241. package/dist/sources/git/source.d.ts +9 -79
  242. package/dist/sources/git/source.d.ts.map +1 -1
  243. package/dist/sources/git/source.js +33 -133
  244. package/dist/sources/git/source.js.map +1 -1
  245. package/dist/sources/migrations/across-change.d.ts +94 -0
  246. package/dist/sources/migrations/across-change.d.ts.map +1 -0
  247. package/dist/sources/migrations/across-change.js +278 -0
  248. package/dist/sources/migrations/across-change.js.map +1 -0
  249. package/dist/sources/migrations/dialects.d.ts +20 -36
  250. package/dist/sources/migrations/dialects.d.ts.map +1 -1
  251. package/dist/sources/migrations/dialects.js +11 -36
  252. package/dist/sources/migrations/dialects.js.map +1 -1
  253. package/dist/sources/migrations/index.d.ts +3 -1
  254. package/dist/sources/migrations/index.d.ts.map +1 -1
  255. package/dist/sources/migrations/index.js +2 -1
  256. package/dist/sources/migrations/index.js.map +1 -1
  257. package/dist/sources/migrations/read.d.ts +14 -79
  258. package/dist/sources/migrations/read.d.ts.map +1 -1
  259. package/dist/sources/migrations/read.js +14 -89
  260. package/dist/sources/migrations/read.js.map +1 -1
  261. package/dist/sources/workspace/workspace.d.ts +6 -42
  262. package/dist/sources/workspace/workspace.d.ts.map +1 -1
  263. package/dist/sources/workspace/workspace.js +10 -53
  264. package/dist/sources/workspace/workspace.js.map +1 -1
  265. package/dist/store/driver/driver.d.ts +9 -38
  266. package/dist/store/driver/driver.d.ts.map +1 -1
  267. package/dist/store/driver/driver.js +4 -22
  268. package/dist/store/driver/driver.js.map +1 -1
  269. package/dist/store/driver/node-sqlite.d.ts +3 -12
  270. package/dist/store/driver/node-sqlite.d.ts.map +1 -1
  271. package/dist/store/driver/node-sqlite.js +4 -18
  272. package/dist/store/driver/node-sqlite.js.map +1 -1
  273. package/dist/store/index.d.ts +2 -7
  274. package/dist/store/index.d.ts.map +1 -1
  275. package/dist/store/index.js +4 -10
  276. package/dist/store/index.js.map +1 -1
  277. package/dist/store/migrate.d.ts +14 -50
  278. package/dist/store/migrate.d.ts.map +1 -1
  279. package/dist/store/migrate.js +15 -52
  280. package/dist/store/migrate.js.map +1 -1
  281. package/dist/store/reader.d.ts +19 -84
  282. package/dist/store/reader.d.ts.map +1 -1
  283. package/dist/store/reader.js +25 -92
  284. package/dist/store/reader.js.map +1 -1
  285. package/dist/store/schema.d.ts +14 -76
  286. package/dist/store/schema.d.ts.map +1 -1
  287. package/dist/store/schema.js +14 -76
  288. package/dist/store/schema.js.map +1 -1
  289. package/dist/store/writer.d.ts +14 -88
  290. package/dist/store/writer.d.ts.map +1 -1
  291. package/dist/store/writer.js +29 -123
  292. package/dist/store/writer.js.map +1 -1
  293. package/dist/tiers/certify.d.ts +46 -281
  294. package/dist/tiers/certify.d.ts.map +1 -1
  295. package/dist/tiers/certify.js +46 -226
  296. package/dist/tiers/certify.js.map +1 -1
  297. package/dist/tiers/ladder.d.ts +7 -51
  298. package/dist/tiers/ladder.d.ts.map +1 -1
  299. package/dist/tiers/ladder.js +13 -89
  300. package/dist/tiers/ladder.js.map +1 -1
  301. package/dist/validation/attributes.d.ts +6 -55
  302. package/dist/validation/attributes.d.ts.map +1 -1
  303. package/dist/validation/attributes.js +6 -55
  304. package/dist/validation/attributes.js.map +1 -1
  305. package/dist/validation/config-graph.d.ts +7 -56
  306. package/dist/validation/config-graph.d.ts.map +1 -1
  307. package/dist/validation/config-graph.js +15 -61
  308. package/dist/validation/config-graph.js.map +1 -1
  309. package/dist/validation/env.d.ts +7 -1
  310. package/dist/validation/env.d.ts.map +1 -1
  311. package/dist/validation/env.js +3 -1
  312. package/dist/validation/env.js.map +1 -1
  313. package/dist/validation/join-substitution.d.ts +22 -120
  314. package/dist/validation/join-substitution.d.ts.map +1 -1
  315. package/dist/validation/join-substitution.js +13 -90
  316. package/dist/validation/join-substitution.js.map +1 -1
  317. package/dist/validation/migration-integrity.d.ts +11 -72
  318. package/dist/validation/migration-integrity.d.ts.map +1 -1
  319. package/dist/validation/migration-integrity.js +16 -79
  320. package/dist/validation/migration-integrity.js.map +1 -1
  321. package/dist/validation/migrations.d.ts +22 -101
  322. package/dist/validation/migrations.d.ts.map +1 -1
  323. package/dist/validation/migrations.js +19 -83
  324. package/dist/validation/migrations.js.map +1 -1
  325. package/dist/validation/nodes.d.ts +3 -1
  326. package/dist/validation/nodes.d.ts.map +1 -1
  327. package/dist/validation/nodes.js +3 -1
  328. package/dist/validation/nodes.js.map +1 -1
  329. package/dist/validation/rollback.d.ts +10 -73
  330. package/dist/validation/rollback.d.ts.map +1 -1
  331. package/dist/validation/rollback.js +15 -82
  332. package/dist/validation/rollback.js.map +1 -1
  333. package/dist/validation/route-drift.d.ts +9 -62
  334. package/dist/validation/route-drift.d.ts.map +1 -1
  335. package/dist/validation/route-drift.js +7 -52
  336. package/dist/validation/route-drift.js.map +1 -1
  337. package/dist/validation/sources.d.ts +16 -94
  338. package/dist/validation/sources.d.ts.map +1 -1
  339. package/dist/validation/sources.js +51 -147
  340. package/dist/validation/sources.js.map +1 -1
  341. package/dist/worker/pool.d.ts +6 -45
  342. package/dist/worker/pool.d.ts.map +1 -1
  343. package/dist/worker/pool.js +5 -42
  344. package/dist/worker/pool.js.map +1 -1
  345. package/dist/worker/protocol.d.ts +7 -20
  346. package/dist/worker/protocol.d.ts.map +1 -1
  347. package/dist/worker/protocol.js +3 -10
  348. package/dist/worker/protocol.js.map +1 -1
  349. package/dist/worker/traversal.worker.d.ts +2 -21
  350. package/dist/worker/traversal.worker.d.ts.map +1 -1
  351. package/dist/worker/traversal.worker.js +4 -23
  352. package/dist/worker/traversal.worker.js.map +1 -1
  353. package/package.json +11 -2
@@ -1,106 +1,25 @@
1
- /**
2
- * The contract engine's R2 half: who calls what, and who serves it.
3
- *
4
- * §13's mechanism is shape comparison at R3. This is the part that works
5
- * **below** it, and the architecture is explicit that it should exist: at R2,
6
- * report path-level orphans only, and say so. Splitting the engine this way
7
- * means half the value lands on graphs no type checker has touched, and the R3
8
- * half does not hold it hostage.
9
- *
10
- * ## Three findings about the join, and a fourth about a route that never reaches it
11
- *
12
- * ```
13
- * API_ROUTE ──SERVES_API──▶ API_ENDPOINT ◀──USES_API── caller
14
- * ```
15
- *
16
- * An `API_ENDPOINT` is the join. Every one of the first three questions here is
17
- * about which of its two sides is present:
18
- *
19
- * | both sides | one side | finding |
20
- * | --- | --- | --- |
21
- * | caller + route | — | the contract holds at path level |
22
- * | — | caller only | **the call reaches nothing that is served** |
23
- * | — | route only | **nothing in this graph calls the route** |
24
- *
25
- * The fourth, `ROUTE_NOT_MOUNTED`, is about a route that never reaches the join
26
- * at all — UAT round 3's real-feature test (`reviews.py`): a decorator this
27
- * graph read as a route, on a router nothing registers with the running
28
- * application. No `API_ENDPOINT` exists for it and no `SERVES_API` edge was
29
- * ever a candidate, so the three questions above have nothing to ask; the
30
- * `API_ROUTE` node's own `attrs.mounted: false` (`descry-adapters`,
31
- * `DEC-NEXT-route-declared-but-not-mounted-modelling`) is the whole fact.
32
- * Unlike `ROUTE_NOT_CALLED`, this needs no external-consumer caveat — a route
33
- * with no `SERVES_API` edge 404s for *every* caller, not only the ones this
34
- * graph can see — so it is a `defect`, counted in `checked` against
35
- * `API_ROUTE`, not `API_ENDPOINT`, findings.
36
- *
37
- * **Precision guard.** `attrs.mounted` is a fact only `adapter-python` states
38
- * today. A route from any other producer carries no such attribute, and its
39
- * absence means "this producer does not report mounting" — not "not mounted".
40
- * Reporting a finding for an absent attribute would be exactly the false
41
- * positive rule 2 exists to forbid, so a route with `attrs.mounted !==
42
- * true|false` produces no finding at all, counted separately and disclosed
43
- * rather than silently dropped.
44
- *
45
- * ## The trap, and it is the whole design
46
- *
47
- * On two real repositories: **117 callers, 24 routes, 16 joined.** The other 101
48
- * callers are, overwhelmingly, calls to services that are not in the graph at
49
- * all — a third-party API, a backend nobody analysed. Reporting them as "no
50
- * route serves this" would be 101 confident wrong statements that bury the
51
- * handful that are real.
52
- *
53
- * So an unmatched caller is a **finding** only when a served route exists that
54
- * it nearly matches (see `paths.ts`, where every rule is a specific mechanical
55
- * mistake rather than a similarity threshold). Everything else is counted and
56
- * disclosed as *not analysable*, because the honest description of it is "the
57
- * provider side of this call was never read", not "the provider side is wrong".
58
- *
59
- * Two more refusals in the same spirit:
60
- *
61
- * - **No routes at all in the graph → no caller findings, at all.** With nothing
62
- * on the provider side, every caller is unmatched by construction and the
63
- * comparison has no content. Reported as not analysable, with the reason.
64
- * - **`ROUTE_NOT_CALLED` is stated weakly on purpose.** A route nothing calls is
65
- * usually a route called by something outside this graph — a mobile client,
66
- * another service, curl. It is a lead, not a defect, and the wording says so.
67
- */
1
+ /** Contract engine's R2 half: reports path-level orphans only (§13 is the R3 shape half, not this).
2
+ * A caller is a finding only with a near-miss served route — measured 117 callers/24 routes/16
3
+ * joined; the other 101 are unrelated services, disclosed as not analysable, not false positives. */
68
4
  import type { IRNode, ResolutionLevel } from "@descryy/ir";
69
5
  import type { AdjacencyProvider, QueryResult } from "../query/provider.ts";
70
6
  import { type NearMiss } from "./paths.ts";
71
7
  export type ContractFindingKind = "CALL_NOT_SERVED" | "ROUTE_NOT_CALLED" | "ROUTE_NOT_MOUNTED";
72
- /**
73
- * Provable from the graph alone, or dependent on knowledge outside it.
74
- *
75
- * UAT round 3, Suggestion 6, following `EnvClaim`'s precedent
76
- * (`validation/env.ts`) rather than inventing a second name for the same
77
- * axis. `CALL_NOT_SERVED` is a `defect`: a call and a near-miss route both
78
- * sit in this graph, and the mismatch between them is provable without
79
- * knowing anything this graph does not already hold. `ROUTE_NOT_CALLED` is a
80
- * `lead`, and was already worded as one (`orphans.ts`'s own module doc) — a
81
- * mobile client, another service, or an external consumer would not appear
82
- * in this graph at all, so "nothing calls it" is never provable, only
83
- * suggestive. This is orthogonal to `prominence`/evidence-strength ranking:
84
- * a `lead` and a `defect` can each rest on strong or weak evidence.
85
- */
8
+ /** Provable from the graph alone ("defect") vs dependent on outside knowledge ("lead") — following
9
+ * `EnvClaim`'s precedent. CALL_NOT_SERVED is a defect (miss + call both in graph); ROUTE_NOT_CALLED
10
+ * is a lead (an external caller wouldn't appear here, so "nothing calls it" is only suggestive). */
86
11
  export type ContractClaim = "defect" | "lead";
87
12
  export interface ContractFinding {
88
13
  readonly kind: ContractFindingKind;
89
14
  readonly claim: ContractClaim;
90
- /**
91
- * The join node this finding is about. Null for `ROUTE_NOT_MOUNTED` — an
92
- * unmounted route has no `API_ENDPOINT` at all; that absence is the finding,
93
- * not a property of one.
94
- */
15
+ /** The join node. Null for ROUTE_NOT_MOUNTED — an unmounted route has no API_ENDPOINT at all;
16
+ * that absence IS the finding. */
95
17
  readonly endpoint: IRNode | null;
96
18
  readonly method: string;
97
19
  readonly pathTemplate: string;
98
20
  /** Callers reaching this endpoint. Populated for `CALL_NOT_SERVED`. */
99
21
  readonly callers: readonly IRNode[];
100
- /**
101
- * Routes serving it (`ROUTE_NOT_CALLED`), or the single declared-but-unmounted
102
- * route this finding is about (`ROUTE_NOT_MOUNTED`).
103
- */
22
+ /** Routes serving it (ROUTE_NOT_CALLED), or the single unmounted route (ROUTE_NOT_MOUNTED). */
104
23
  readonly routes: readonly IRNode[];
105
24
  /** Why this is reportable rather than merely unmatched. Null for `ROUTE_NOT_CALLED` and `ROUTE_NOT_MOUNTED`. */
106
25
  readonly nearMiss: NearMiss | null;
@@ -118,50 +37,27 @@ export interface ContractReport {
118
37
  readonly withCallers: number;
119
38
  readonly withRoutes: number;
120
39
  readonly joined: number;
121
- /**
122
- * `API_ROUTE` nodes that stated `attrs.mounted` as a real boolean — the
123
- * only ones `ROUTE_NOT_MOUNTED` can speak about at all. A route from a
124
- * producer that does not emit the attribute is in neither this count nor
125
- * `routesUnmounted`; see the module header's precision guard.
126
- */
40
+ /** API_ROUTE nodes with attrs.mounted as a real boolean — the only ones ROUTE_NOT_MOUNTED can
41
+ * speak about. A route with no such attribute is in neither this count nor `routesUnmounted`. */
127
42
  readonly routesWithMountInfo: number;
128
43
  /** Of those, how many declared `attrs.mounted === false` — before `maxFindings` capped the list. */
129
44
  readonly routesUnmounted: number;
130
45
  };
131
- /**
132
- * Unmatched callers with nothing on the provider side that resembles them.
133
- *
134
- * Not findings, and the number matters: it is the size of the region this
135
- * analysis could not speak about.
136
- */
46
+ /** Unmatched callers with nothing resembling them on the provider side. Not findings — the
47
+ * number is the size of the region this analysis couldn't speak about. */
137
48
  readonly unmatchedWithoutNearMiss: number;
138
49
  /** True when the R3 shape comparison did not run. Always true in this half. */
139
50
  readonly shapesCompared: boolean;
140
51
  }
141
- /**
142
- * The path half's own coverage disclosure, exported so the shape half can retract
143
- * it rather than restate it.
144
- *
145
- * This function is the path half and cannot know whether a shape comparison
146
- * followed, so it always says one did not. That was true for as long as the path
147
- * half was the only half that ran, and it stopped being true the moment a
148
- * producer attached direction to a route's DTOs — leaving `contracts` reporting
149
- * a shape mismatch above a disclosure denying any shape was compared. Measured
150
- * against the real binary, UAT phase 2.
151
- *
152
- * A caller that runs the shape half removes this note when a comparison actually
153
- * happened. It is a constant rather than a regex on the caller's side because a
154
- * disclosure matched by pattern is a disclosure that silently stops being
155
- * retracted the day someone rewords it.
156
- */
52
+ /** Path-half coverage disclosure, exported so the shape half can retract it rather than restate
53
+ * it (UAT phase 2: a producer attaching DTO direction once left this standing beside a real shape
54
+ * mismatch). A constant, not a regex — regex-matched text silently stops being retracted when reworded. */
157
55
  export declare const PATH_LEVEL_ONLY_NOTE: string;
158
56
  export interface OrphanOptions {
159
57
  /** Cap on endpoints enumerated. Truncation is reported, never silent. */
160
58
  readonly limit?: number;
161
- /**
162
- * Cap on findings returned — rule 5's "a few high-confidence findings, never
163
- * an exhaustive maybe-list". Overflow is disclosed, not dropped quietly.
164
- */
59
+ /** Cap on findings — rule 5's "a few high-confidence findings, never an exhaustive maybe-list".
60
+ * Overflow is disclosed, not dropped quietly. */
165
61
  readonly maxFindings?: number;
166
62
  }
167
63
  export declare function findContractOrphans(provider: AdjacencyProvider, options?: OrphanOptions): QueryResult<ContractReport>;
@@ -1 +1 @@
1
- {"version":3,"file":"orphans.d.ts","source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AC;CAClC;AAED;;4GAE4G;AAC5G,eAAO,MAAM,oBAAoB,QAEuB,CAAC;AAEzD,MAAM,WAAW,aAAa;IAC5B,yEAAyE;IACzE,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB;sDACkD;IAClD,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC/B;AA+ED,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,iBAAiB,EAC3B,OAAO,GAAE,aAAkB,GAC1B,WAAW,CAAC,cAAc,CAAC,CAgP7B"}
@@ -1,87 +1,10 @@
1
- /**
2
- * The contract engine's R2 half: who calls what, and who serves it.
3
- *
4
- * §13's mechanism is shape comparison at R3. This is the part that works
5
- * **below** it, and the architecture is explicit that it should exist: at R2,
6
- * report path-level orphans only, and say so. Splitting the engine this way
7
- * means half the value lands on graphs no type checker has touched, and the R3
8
- * half does not hold it hostage.
9
- *
10
- * ## Three findings about the join, and a fourth about a route that never reaches it
11
- *
12
- * ```
13
- * API_ROUTE ──SERVES_API──▶ API_ENDPOINT ◀──USES_API── caller
14
- * ```
15
- *
16
- * An `API_ENDPOINT` is the join. Every one of the first three questions here is
17
- * about which of its two sides is present:
18
- *
19
- * | both sides | one side | finding |
20
- * | --- | --- | --- |
21
- * | caller + route | — | the contract holds at path level |
22
- * | — | caller only | **the call reaches nothing that is served** |
23
- * | — | route only | **nothing in this graph calls the route** |
24
- *
25
- * The fourth, `ROUTE_NOT_MOUNTED`, is about a route that never reaches the join
26
- * at all — UAT round 3's real-feature test (`reviews.py`): a decorator this
27
- * graph read as a route, on a router nothing registers with the running
28
- * application. No `API_ENDPOINT` exists for it and no `SERVES_API` edge was
29
- * ever a candidate, so the three questions above have nothing to ask; the
30
- * `API_ROUTE` node's own `attrs.mounted: false` (`descry-adapters`,
31
- * `DEC-NEXT-route-declared-but-not-mounted-modelling`) is the whole fact.
32
- * Unlike `ROUTE_NOT_CALLED`, this needs no external-consumer caveat — a route
33
- * with no `SERVES_API` edge 404s for *every* caller, not only the ones this
34
- * graph can see — so it is a `defect`, counted in `checked` against
35
- * `API_ROUTE`, not `API_ENDPOINT`, findings.
36
- *
37
- * **Precision guard.** `attrs.mounted` is a fact only `adapter-python` states
38
- * today. A route from any other producer carries no such attribute, and its
39
- * absence means "this producer does not report mounting" — not "not mounted".
40
- * Reporting a finding for an absent attribute would be exactly the false
41
- * positive rule 2 exists to forbid, so a route with `attrs.mounted !==
42
- * true|false` produces no finding at all, counted separately and disclosed
43
- * rather than silently dropped.
44
- *
45
- * ## The trap, and it is the whole design
46
- *
47
- * On two real repositories: **117 callers, 24 routes, 16 joined.** The other 101
48
- * callers are, overwhelmingly, calls to services that are not in the graph at
49
- * all — a third-party API, a backend nobody analysed. Reporting them as "no
50
- * route serves this" would be 101 confident wrong statements that bury the
51
- * handful that are real.
52
- *
53
- * So an unmatched caller is a **finding** only when a served route exists that
54
- * it nearly matches (see `paths.ts`, where every rule is a specific mechanical
55
- * mistake rather than a similarity threshold). Everything else is counted and
56
- * disclosed as *not analysable*, because the honest description of it is "the
57
- * provider side of this call was never read", not "the provider side is wrong".
58
- *
59
- * Two more refusals in the same spirit:
60
- *
61
- * - **No routes at all in the graph → no caller findings, at all.** With nothing
62
- * on the provider side, every caller is unmatched by construction and the
63
- * comparison has no content. Reported as not analysable, with the reason.
64
- * - **`ROUTE_NOT_CALLED` is stated weakly on purpose.** A route nothing calls is
65
- * usually a route called by something outside this graph — a mobile client,
66
- * another service, curl. It is a lead, not a defect, and the wording says so.
67
- */
1
+ /** Contract engine's R2 half: reports path-level orphans only (§13 is the R3 shape half, not this).
2
+ * A caller is a finding only with a near-miss served route — measured 117 callers/24 routes/16
3
+ * joined; the other 101 are unrelated services, disclosed as not analysable, not false positives. */
68
4
  import { nearestMiss } from "./paths.js";
69
- /**
70
- * The path half's own coverage disclosure, exported so the shape half can retract
71
- * it rather than restate it.
72
- *
73
- * This function is the path half and cannot know whether a shape comparison
74
- * followed, so it always says one did not. That was true for as long as the path
75
- * half was the only half that ran, and it stopped being true the moment a
76
- * producer attached direction to a route's DTOs — leaving `contracts` reporting
77
- * a shape mismatch above a disclosure denying any shape was compared. Measured
78
- * against the real binary, UAT phase 2.
79
- *
80
- * A caller that runs the shape half removes this note when a comparison actually
81
- * happened. It is a constant rather than a regex on the caller's side because a
82
- * disclosure matched by pattern is a disclosure that silently stops being
83
- * retracted the day someone rewords it.
84
- */
5
+ /** Path-half coverage disclosure, exported so the shape half can retract it rather than restate
6
+ * it (UAT phase 2: a producer attaching DTO direction once left this standing beside a real shape
7
+ * mismatch). A constant, not a regex — regex-matched text silently stops being retracted when reworded. */
85
8
  export const PATH_LEVEL_ONLY_NOTE = "Path level only. Request and response shapes were not compared — that requires R3 on both " +
86
9
  "sides, because it compares shapes rather than names.";
87
10
  const DEFAULT_MAX_FINDINGS = 25;
@@ -92,14 +15,9 @@ function keyOf(endpoint) {
92
15
  ? { method, pathTemplate }
93
16
  : null;
94
17
  }
95
- /**
96
- * `ROUTE_NOT_MOUNTED` — a route declared on a router nothing registers with the
97
- * running application, read generically off `API_ROUTE.attrs.mounted`. No
98
- * language, framework or adapter name appears here: any producer that states
99
- * this fact the way `DEC-NEXT-route-declared-but-not-mounted-modelling`
100
- * describes lights this up, and one that says nothing about mounting produces
101
- * nothing here at all — rule 2, applied to a boolean rather than an edge.
102
- */
18
+ /** ROUTE_NOT_MOUNTED: a route declared but never registered, read generically off
19
+ * `API_ROUTE.attrs.mounted` (`DEC-NEXT-route-declared-but-not-mounted-modelling`). No language/
20
+ * adapter name here — a producer silent on mounting produces nothing, same as rule 2 for an edge. */
103
21
  function unmountedRouteFindings(provider) {
104
22
  const set = provider.nodesOfType("API_ROUTE");
105
23
  const findings = [];
@@ -109,10 +27,8 @@ function unmountedRouteFindings(provider) {
109
27
  for (const route of set.nodes) {
110
28
  const mounted = route.attrs["mounted"];
111
29
  if (typeof mounted !== "boolean") {
112
- // This producer never states whether the route is mounted. Absence is
113
- // "unknown", not "not mounted" — reporting a finding here would be
114
- // exactly the false positive rule 2 forbids, so this route is silently
115
- // (but countedly) skipped rather than assumed either way.
30
+ // Absence is "unknown," not "not mounted" — a finding here would be exactly the false
31
+ // positive rule 2 forbids, so this route is counted but produces no finding.
116
32
  routesWithoutMountInfo += 1;
117
33
  continue;
118
34
  }
@@ -152,19 +68,16 @@ export function findContractOrphans(provider, options = {}) {
152
68
  const maxFindings = options.maxFindings ?? DEFAULT_MAX_FINDINGS;
153
69
  const set = provider.nodesOfType("API_ENDPOINT", ...(options.limit === undefined ? [] : [options.limit]));
154
70
  const notes = [];
155
- // Independent of the endpoint-join checks below: a route that never mounts
156
- // has no `API_ENDPOINT` and was never a candidate for one, so it must be
157
- // found before — and reported regardless of — whether any endpoint exists
158
- // at all. See the module header and `unmountedRouteFindings`.
71
+ // A route that never mounts has no API_ENDPOINT and was never a candidate for one, so this
72
+ // runs (and reports) independent of whether any endpoint exists.
159
73
  const mount = unmountedRouteFindings(provider);
160
74
  const sided = [];
161
75
  let unkeyed = 0;
162
76
  for (const endpoint of set.nodes) {
163
77
  const key = keyOf(endpoint);
164
78
  if (key === null) {
165
- // An endpoint with no method or path template cannot be compared to
166
- // anything. Counted rather than skipped: it means a producer emitted a
167
- // join node without the two attributes the join is made of.
79
+ // No method/path template means nothing to compare against — counted (a producer emitted
80
+ // a join node missing the attributes the join is made of), not silently skipped.
168
81
  unkeyed += 1;
169
82
  continue;
170
83
  }
@@ -185,10 +98,8 @@ export function findContractOrphans(provider, options = {}) {
185
98
  const withRoutes = sided.filter((s) => s.routes.length > 0);
186
99
  const joined = sided.filter((s) => s.callers.length > 0 && s.routes.length > 0);
187
100
  const servedKeys = withRoutes.map((s) => s.key);
188
- // --- the refusals --------------------------------------------------------
189
- // Nothing exists at the endpoint join at all, and this run's mount check
190
- // agrees there is nothing else to say either — the genuinely empty case,
191
- // unchanged from before this check existed.
101
+ // The genuinely empty case: nothing at the endpoint join, and the mount check agrees there's
102
+ // nothing else to say.
192
103
  if (sided.length === 0 && mount.findings.length === 0) {
193
104
  notes.push("No API endpoints are in the graph, so there is no contract to check. Either no adapter " +
194
105
  "read a route or a client call, or none of the configured adapters produces them. This " +
@@ -198,12 +109,9 @@ export function findContractOrphans(provider, options = {}) {
198
109
  }
199
110
  return report(provider, emptyReport(sided.length, 0, 0, 0, mount.routesWithMountInfo, mount.routesUnmounted), 0, mount.truncated, notes);
200
111
  }
201
- // Still true when there ARE unmounted-route findings below: the endpoint
202
- // join has nothing to compare, so the endpoint-side refusals just below are
203
- // skipped in favour of this one sentence rather than restating the same
204
- // fact from two empty sets ("0 endpoint(s) are called and no route..." and
205
- // its mirror) — the reviews.py shape reduced to a repo with no other route
206
- // mounted at all.
112
+ // Still true even with unmounted-route findings below: the endpoint join has nothing to
113
+ // compare, so this one sentence replaces the two mirror-image refusals below (measured against
114
+ // reviews.py: a repo with no other route mounted at all).
207
115
  const noEndpointsAtAll = sided.length === 0;
208
116
  if (noEndpointsAtAll) {
209
117
  notes.push("No API endpoints are in the graph, so the endpoint-join checks below have nothing to " +
@@ -213,12 +121,10 @@ export function findContractOrphans(provider, options = {}) {
213
121
  const findings = [...mount.findings];
214
122
  let unmatchedWithoutNearMiss = 0;
215
123
  if (noEndpointsAtAll) {
216
- // Handled by the note above; the two mirror-image refusals immediately
217
- // below would otherwise restate it twice from two empty sets.
124
+ // Handled by the note above — the refusals below would otherwise restate this from two empty sets.
218
125
  }
219
126
  else if (withRoutes.length === 0) {
220
- // Every caller is unmatched by construction. Comparing against an empty
221
- // provider side produces one finding per call site and means nothing.
127
+ // Every caller is unmatched by construction — comparing against an empty provider side means nothing.
222
128
  unmatchedWithoutNearMiss = withCallers.length;
223
129
  notes.push(`${withCallers.length} endpoint(s) are called and no route is in the graph at all, so no ` +
224
130
  "comparison was possible. Every call would be reported as unserved for the same reason, " +
@@ -231,14 +137,16 @@ export function findContractOrphans(provider, options = {}) {
231
137
  continue;
232
138
  const miss = nearestMiss(entry.key, servedKeys);
233
139
  if (miss === null) {
234
- // Nothing on the provider side resembles it. Far more likely an external
235
- // service than a defect, and stating otherwise would be 101 confident
236
- // wrong sentences on the repositories this was measured against.
140
+ // Nothing resembles it on the provider side — far more likely an external service than
141
+ // a defect (101 confident wrong sentences on the repos this was measured against).
237
142
  unmatchedWithoutNearMiss += 1;
238
143
  continue;
239
144
  }
240
145
  findings.push({
241
146
  kind: "CALL_NOT_SERVED",
147
+ // A near miss is what makes this a fault claim rather than a lead: the
148
+ // provider side has something one segment or one method away, so the
149
+ // call is wrong about a route this repository really serves.
242
150
  claim: "defect",
243
151
  endpoint: entry.endpoint,
244
152
  method: entry.key.method,
@@ -256,17 +164,9 @@ export function findContractOrphans(provider, options = {}) {
256
164
  // Handled by the single note pushed above.
257
165
  }
258
166
  else if (withCallers.length === 0) {
259
- // The mirror of the refusal above, and it was missing until a per-source
260
- // ablation on `bench/contracts-real.mjs` removed the consumer side: the
261
- // engine reported 24 ROUTE_NOT_CALLED findings and no disclosure, about a
262
- // graph containing no callers at all.
263
- //
264
- // "Nothing in this graph calls this route" is literally true there — and so
265
- // is the sentence this engine declines to say in the other direction.
266
- // Whichever side is empty, the cause is ONE fact about what was analysed,
267
- // not N facts about the artefacts. It is not only an ablation state either:
268
- // a workspace where only the backend has been indexed is the normal first
269
- // day of a deployment.
167
+ // Mirror of the refusal above — missing until an ablation on bench/contracts-real.mjs found
168
+ // 24 ROUTE_NOT_CALLED findings with no disclosure on a graph with zero callers. Not just an
169
+ // ablation case: a workspace with only the backend indexed is a normal first day of deployment.
270
170
  notes.push(`${withRoutes.length} route(s) are served and no call site is in the graph at all, so no ` +
271
171
  "comparison was possible. Every route would be reported as uncalled for the same reason, " +
272
172
  "which is a property of what was analysed rather than of the code. Add the client that " +
@@ -278,6 +178,10 @@ export function findContractOrphans(provider, options = {}) {
278
178
  continue;
279
179
  findings.push({
280
180
  kind: "ROUTE_NOT_CALLED",
181
+ // Nothing in *this graph* calls it. A mobile client, another service or
182
+ // an external consumer would not appear here, so the absence is not
183
+ // evidence of a fault. Said in the detail since it was written; now
184
+ // said in a field something can count.
281
185
  claim: "lead",
282
186
  endpoint: entry.endpoint,
283
187
  method: entry.key.method,
@@ -293,10 +197,8 @@ export function findContractOrphans(provider, options = {}) {
293
197
  });
294
198
  }
295
199
  }
296
- // Findings that rest on better evidence first, then defects before leads
297
- // (a route nothing calls needs external knowledge to condemn; the other two
298
- // kinds do not), then by kind name and path so the order is identical
299
- // between runs.
200
+ // Better evidence first, then defects before leads (a route nothing calls needs external
201
+ // knowledge to condemn), then kind/path so ordering is identical between runs.
300
202
  findings.sort((a, b) => b.resolution - a.resolution ||
301
203
  (a.claim === b.claim ? 0 : a.claim === "defect" ? -1 : 1) ||
302
204
  (a.kind === b.kind ? 0 : a.kind.localeCompare(b.kind)) ||
@@ -1 +1 @@
1
- {"version":3,"file":"orphans.js","sourceRoot":"","sources":["../../src/contracts/orphans.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkEG;AAKH,OAAO,EAAE,WAAW,EAAmC,MAAM,YAAY,CAAC;AA4E1E;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAC/B,4FAA4F;IAC5F,sDAAsD,CAAC;AAYzD,MAAM,oBAAoB,GAAG,EAAE,CAAC;AAEhC,SAAS,KAAK,CAAC,QAAgB;IAC7B,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IACxC,MAAM,YAAY,GAAG,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;IACpD,OAAO,OAAO,MAAM,KAAK,QAAQ,IAAI,OAAO,YAAY,KAAK,QAAQ;QACnE,CAAC,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE;QAC1B,CAAC,CAAC,IAAI,CAAC;AACX,CAAC;AAaD;;;;;;;GAOG;AACH,SAAS,sBAAsB,CAAC,QAA2B;IACzD,MAAM,GA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AAa,EAAE,CAAC;QAChB,OAAO,EAAE,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,mBAAmB,EAAE,eAAe,EAAE;QAC7F,wBAAwB,EAAE,CAAC;QAC3B,cAAc,EAAE,KAAK;KACtB,CAAC;AACJ,CAAC;AAED,SAAS,MAAM,CACb,QAA2B,EAC3B,IAAoB,EACpB,eAAgC,EAChC,SAAkB,EAClB,KAAe;IAEf,MAAM,KAAK,GAAe,EAAE,GAAG,QAAQ,CAAC,SAAS,EAAE,EAAE,eAAe,EAAE,CAAC;IACvE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;AAC3C,CAAC"}
@@ -1,110 +1,7 @@
1
1
  /**
2
- * Comparing two endpoint paths, and knowing when not to.
3
- *
4
- * This file is small and is the most dangerous part of the contract engine, so
5
- * it is separate and tested on its own.
6
- *
7
- * ## The problem it exists to solve
8
- *
9
- * A caller reaching an endpoint no route serves is *sometimes* a bug and
10
- * *usually* not. Measured on two real repositories: 117 callers, 24 routes, 16
11
- * joined. The other 101 are overwhelmingly calls to services that are simply not
12
- * in this graph — a third-party API, a backend nobody has analysed. Reporting
13
- * all 101 as "no route serves this" would be 101 confident wrong statements, and
14
- * would bury the handful that are real.
15
- *
16
- * So an unmatched caller is only a **finding** when a served route exists that
17
- * it nearly matches. Nothing similar on the provider side means the provider was
18
- * probably never analysed, which belongs in §20.2's *not analysable* category
19
- * and is disclosed as a count rather than enumerated as defects.
20
- *
21
- * ## The near-miss rules are deliberately narrow
22
- *
23
- * Each one describes a specific, common, *mechanical* mistake. None of them is a
24
- * similarity score, because a threshold on a score is a knob that turns "is this
25
- * a bug" into "how high did we set it".
26
- *
27
- * | rule | example | why it is a real mistake |
28
- * | --- | --- | --- |
29
- * | method differs, path identical | `POST /orders` vs `GET /orders` | someone changed the verb on one side |
30
- * | exactly one **literal** segment differs, **and the two differ by a typo's worth of characters** | `/order/{param}/items` vs `/orders/{param}/items` | a typo or a rename applied on one side |
31
- *
32
- * ## Rule 2's similarity floor, and the measurement that set it
33
- *
34
- * That second clause was missing for the whole life of this file, and its
35
- * absence was not a small thing. "Exactly one segment differs" says nothing at
36
- * all about *how* it differs: `/api/hmac` and `/api/novu-agent` differ in
37
- * exactly one segment, share a method and share arity. Precision came only
38
- * incidentally, from `{param}` segments happening to sit where the paths
39
- * diverge.
40
- *
41
- * `DEC-317` found this from the GraphQL side — every operation path is arity-2
42
- * with no `{param}` and a first segment drawn from a set of size three, so the
43
- * whole GraphQL surface of a repository collapsed into three buckets in which
44
- * every member near-missed every other — and gated it rather than fixing it,
45
- * because a threshold chosen carelessly costs the near-typo detections this
46
- * rule exists for, and costs them invisibly.
47
- *
48
- * So it was measured, against 3,524 routes from 27 real repositories, by
49
- * `bench/near-miss-similarity.mjs` — which pre-registers the metric, the
50
- * candidate thresholds and the decision rule in its header, and was committed
51
- * before it was run. What it found:
52
- *
53
- * - **The rule was not a precision rule.** Treating each real route as an
54
- * unmatched caller against the rest of its own application's table, it
55
- * reported a `ONE_SEGMENT` near miss for **1,796 of 3,524 routes — 51%.**
56
- * Every one is a false positive by construction: both sides are real,
57
- * deliberately distinct routes of the same service.
58
- * - **On the genuinely reachable population it was worse.** Across every
59
- * unmatched `USES_API` caller in the corpus, the rule emitted **18 findings,
60
- * and all 18 were nonsense** — 15 of them naming the same `/api/novu-agent`
61
- * route from callers like `/api/hmac` and `/api/send-email`. There were no
62
- * true positives to lose.
63
- *
64
- * The floor is `1 - distance / max(len) >= 0.4`, with any distance of 1 or less
65
- * admitted outright so that a one-character mistake in a short segment (`/v1`
66
- * against `/v2`) is not scored away. It rejects **87.4%** of those 1,796 and
67
- * retains **100%** of a seeded near-typo population of 49,405 — real route
68
- * segments mutated by transposition, deletion, insertion, substitution,
69
- * singular/plural and separator variance. Not one seeded typo is lost, in any
70
- * class.
71
- *
72
- * **The distance counts an adjacent transposition as one edit, not two, and
73
- * that is load-bearing.** With plain Levenshtein a swap costs two, so `api` →
74
- * `aip` scores `1 - 2/3 = 0.33` and every candidate threshold silently deleted
75
- * the entire transposition class — 2,916 real detections, all on segments of
76
- * three characters. The first measurement pass rejected every threshold for
77
- * exactly this reason, and the reason was a defect in the metric rather than a
78
- * fact about the corpus.
79
- *
80
- * **What the floor is not.** It is a similarity test, not an oracle. `activate`
81
- * and `deactivate` are two real routes in one API and score 0.80, so they are
82
- * still reported. Nothing here can distinguish a two-character prefix from a
83
- * typo, and this does not claim to — it buys precision against *unrelated*
84
- * words, which is what the corpus says the problem was.
85
- *
86
- * **A trailing-slash rule was written and then deleted, and the reason is worth
87
- * keeping.** `/orders/` and `/orders` look like the classic contract mismatch,
88
- * but `normaliseEndpointPath` strips the trailing slash *before hashing*, so the
89
- * two sides mint the **same `API_ENDPOINT` id** and join correctly. The rule
90
- * could never fire. It was caught by a test that asserted it would.
91
- *
92
- * That unification is the right default — the two paths mean the same endpoint
93
- * to everyone who writes them — but it does make one real class of bug
94
- * invisible here: a framework configured for strict routing genuinely serves
95
- * only one of them. Whether it does depends on router configuration this graph
96
- * does not read, so the limit is stated rather than papered over with a rule
97
- * that fires on nothing.
98
- *
99
- * **Deliberately not a rule: a parameter where the other side has a literal.**
100
- * `/orders/{param}` and `/orders/recent` legitimately coexist in every routing
101
- * framework on earth — the literal is matched first and the parameter catches
102
- * the rest. Treating that as a near miss would report the single most common
103
- * correct pattern in REST routing as a defect.
104
- *
105
- * Segment counts must be equal for the segment rule. `/orders` and
106
- * `/orders/{param}` are two different endpoints, not a near miss, and a rule
107
- * that ignored length would pair every collection route with its item route.
2
+ * A near-miss caller is a finding only when genuinely close to a served route (DEC-317: "one segment
3
+ * differs" alone was 51% false positives on 3,524 routes). Floor `1 - distance/max(len) >= 0.4` (transposition
4
+ * = 1 edit not 2) rejects 87.4% of those, keeps 100% of a 49,405-case seeded typo set. Not an oracle.
108
5
  */
109
6
  export interface EndpointKey {
110
7
  readonly method: string;
@@ -120,13 +17,6 @@ export interface NearMiss {
120
17
  readonly detail: string;
121
18
  }
122
19
  export declare function sameEndpoint(a: EndpointKey, b: EndpointKey): boolean;
123
- /**
124
- * The closest served endpoint to `wanted`, or null if nothing is close enough.
125
- *
126
- * Rules are tried in order of how certain they are, and the first hit wins —
127
- * a method mismatch on an otherwise identical path is a better explanation than
128
- * a one-segment difference somewhere else, and reporting both would be reporting
129
- * one mistake twice.
130
- */
20
+ /** Closest served endpoint to `wanted`, or null. Rules tried in order of certainty; first hit wins. */
131
21
  export declare function nearestMiss(wanted: EndpointKey, served: readonly EndpointKey[]): NearMiss | null;
132
22
  //# sourceMappingURL=paths.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/contracts/paths.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2GG;AAkEH,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,0EAA0E;IAC1E,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,aAAa,CAAC;AAEpD,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAC5B,mDAAmD;IACnD,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC;IAC9B,+EAA+E;IAC/E,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAWD,wBAAgB,YAAY,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,WAAW,GAAG,OAAO,CAEpE;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CACzB,MAAM,EAAE,WAAW,EACnB,MAAM,EAAE,SAAS,WAAW,EAAE,GAC7B,QAAQ,GAAG,IAAI,CA0DjB"}
1
+ {"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