@descryy/core 0.3.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 (362) 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 +26 -12
  14. package/dist/contracts/engine.d.ts.map +1 -1
  15. package/dist/contracts/engine.js +28 -11
  16. package/dist/contracts/engine.js.map +1 -1
  17. package/dist/contracts/index.d.ts +1 -1
  18. package/dist/contracts/index.d.ts.map +1 -1
  19. package/dist/contracts/index.js.map +1 -1
  20. package/dist/contracts/orphans.d.ts +28 -77
  21. package/dist/contracts/orphans.d.ts.map +1 -1
  22. package/dist/contracts/orphans.js +124 -94
  23. package/dist/contracts/orphans.js.map +1 -1
  24. package/dist/contracts/paths.d.ts +4 -114
  25. package/dist/contracts/paths.d.ts.map +1 -1
  26. package/dist/contracts/paths.js +7 -140
  27. package/dist/contracts/paths.js.map +1 -1
  28. package/dist/contracts/shapes.d.ts +13 -66
  29. package/dist/contracts/shapes.d.ts.map +1 -1
  30. package/dist/contracts/shapes.js +20 -91
  31. package/dist/contracts/shapes.js.map +1 -1
  32. package/dist/governance/budget.d.ts +12 -48
  33. package/dist/governance/budget.d.ts.map +1 -1
  34. package/dist/governance/budget.js +12 -48
  35. package/dist/governance/budget.js.map +1 -1
  36. package/dist/governance/candidate-boundary.d.ts +4 -32
  37. package/dist/governance/candidate-boundary.d.ts.map +1 -1
  38. package/dist/governance/candidate-boundary.js +4 -32
  39. package/dist/governance/candidate-boundary.js.map +1 -1
  40. package/dist/governance/escalation.d.ts +7 -45
  41. package/dist/governance/escalation.d.ts.map +1 -1
  42. package/dist/governance/escalation.js +7 -45
  43. package/dist/governance/escalation.js.map +1 -1
  44. package/dist/governance/fact-boundary.d.ts +7 -49
  45. package/dist/governance/fact-boundary.d.ts.map +1 -1
  46. package/dist/governance/fact-boundary.js +5 -43
  47. package/dist/governance/fact-boundary.js.map +1 -1
  48. package/dist/governance/finding-funnel.d.ts +11 -72
  49. package/dist/governance/finding-funnel.d.ts.map +1 -1
  50. package/dist/governance/finding-funnel.js +9 -68
  51. package/dist/governance/finding-funnel.js.map +1 -1
  52. package/dist/graph/build.d.ts +13 -75
  53. package/dist/graph/build.d.ts.map +1 -1
  54. package/dist/graph/build.js +0 -0
  55. package/dist/graph/build.js.map +1 -1
  56. package/dist/graph/cross-language.d.ts +4 -43
  57. package/dist/graph/cross-language.d.ts.map +1 -1
  58. package/dist/graph/cross-language.js +9 -77
  59. package/dist/graph/cross-language.js.map +1 -1
  60. package/dist/graph/index.d.ts +1 -1
  61. package/dist/graph/index.d.ts.map +1 -1
  62. package/dist/graph/merge.d.ts +8 -76
  63. package/dist/graph/merge.d.ts.map +1 -1
  64. package/dist/graph/merge.js +27 -77
  65. package/dist/graph/merge.js.map +1 -1
  66. package/dist/graph/observed-tests.d.ts +7 -68
  67. package/dist/graph/observed-tests.d.ts.map +1 -1
  68. package/dist/graph/observed-tests.js +5 -60
  69. package/dist/graph/observed-tests.js.map +1 -1
  70. package/dist/graph/persist.d.ts +2 -25
  71. package/dist/graph/persist.d.ts.map +1 -1
  72. package/dist/graph/persist.js +2 -25
  73. package/dist/graph/persist.js.map +1 -1
  74. package/dist/graph/runtime-confirmation.d.ts +14 -91
  75. package/dist/graph/runtime-confirmation.d.ts.map +1 -1
  76. package/dist/graph/runtime-confirmation.js +19 -103
  77. package/dist/graph/runtime-confirmation.js.map +1 -1
  78. package/dist/ledger/mint.d.ts +9 -43
  79. package/dist/ledger/mint.d.ts.map +1 -1
  80. package/dist/ledger/mint.js +15 -65
  81. package/dist/ledger/mint.js.map +1 -1
  82. package/dist/ledger/resolve.d.ts +13 -81
  83. package/dist/ledger/resolve.d.ts.map +1 -1
  84. package/dist/ledger/resolve.js +13 -76
  85. package/dist/ledger/resolve.js.map +1 -1
  86. package/dist/multipr/fingerprint.d.ts +5 -46
  87. package/dist/multipr/fingerprint.d.ts.map +1 -1
  88. package/dist/multipr/fingerprint.js +22 -74
  89. package/dist/multipr/fingerprint.js.map +1 -1
  90. package/dist/multipr/hidden-dependency.d.ts +13 -73
  91. package/dist/multipr/hidden-dependency.d.ts.map +1 -1
  92. package/dist/multipr/hidden-dependency.js +12 -63
  93. package/dist/multipr/hidden-dependency.js.map +1 -1
  94. package/dist/multipr/mechanical.d.ts +25 -160
  95. package/dist/multipr/mechanical.d.ts.map +1 -1
  96. package/dist/multipr/mechanical.js +21 -137
  97. package/dist/multipr/mechanical.js.map +1 -1
  98. package/dist/multipr/migration-heads.d.ts +18 -105
  99. package/dist/multipr/migration-heads.d.ts.map +1 -1
  100. package/dist/multipr/migration-heads.js +15 -84
  101. package/dist/multipr/migration-heads.js.map +1 -1
  102. package/dist/multipr/overlap.d.ts +16 -94
  103. package/dist/multipr/overlap.d.ts.map +1 -1
  104. package/dist/multipr/overlap.js +25 -105
  105. package/dist/multipr/overlap.js.map +1 -1
  106. package/dist/multipr/scope-store.d.ts +15 -80
  107. package/dist/multipr/scope-store.d.ts.map +1 -1
  108. package/dist/multipr/scope-store.js +17 -87
  109. package/dist/multipr/scope-store.js.map +1 -1
  110. package/dist/multipr/superseded.d.ts +10 -95
  111. package/dist/multipr/superseded.d.ts.map +1 -1
  112. package/dist/multipr/superseded.js +7 -60
  113. package/dist/multipr/superseded.js.map +1 -1
  114. package/dist/query/confirmed-facts.d.ts +12 -58
  115. package/dist/query/confirmed-facts.d.ts.map +1 -1
  116. package/dist/query/confirmed-facts.js +8 -47
  117. package/dist/query/confirmed-facts.js.map +1 -1
  118. package/dist/query/declared-value-closure.d.ts +13 -104
  119. package/dist/query/declared-value-closure.d.ts.map +1 -1
  120. package/dist/query/declared-value-closure.js +15 -104
  121. package/dist/query/declared-value-closure.js.map +1 -1
  122. package/dist/query/memory.d.ts +5 -9
  123. package/dist/query/memory.d.ts.map +1 -1
  124. package/dist/query/memory.js +31 -15
  125. package/dist/query/memory.js.map +1 -1
  126. package/dist/query/prominence.d.ts +6 -55
  127. package/dist/query/prominence.d.ts.map +1 -1
  128. package/dist/query/prominence.js +6 -55
  129. package/dist/query/prominence.js.map +1 -1
  130. package/dist/query/provider.d.ts +28 -81
  131. package/dist/query/provider.d.ts.map +1 -1
  132. package/dist/query/provider.js +8 -29
  133. package/dist/query/provider.js.map +1 -1
  134. package/dist/query/queries.d.ts +15 -65
  135. package/dist/query/queries.d.ts.map +1 -1
  136. package/dist/query/queries.js +43 -100
  137. package/dist/query/queries.js.map +1 -1
  138. package/dist/query/refusal-fetch.d.ts +8 -85
  139. package/dist/query/refusal-fetch.d.ts.map +1 -1
  140. package/dist/query/refusal-fetch.js +11 -93
  141. package/dist/query/refusal-fetch.js.map +1 -1
  142. package/dist/query/refusal-questions.d.ts +17 -92
  143. package/dist/query/refusal-questions.d.ts.map +1 -1
  144. package/dist/query/refusal-questions.js +14 -78
  145. package/dist/query/refusal-questions.js.map +1 -1
  146. package/dist/query/resolution-floor.d.ts +3 -23
  147. package/dist/query/resolution-floor.d.ts.map +1 -1
  148. package/dist/query/resolution-floor.js +3 -23
  149. package/dist/query/resolution-floor.js.map +1 -1
  150. package/dist/query/root-cause-score.d.ts +11 -161
  151. package/dist/query/root-cause-score.d.ts.map +1 -1
  152. package/dist/query/root-cause-score.js +6 -137
  153. package/dist/query/root-cause-score.js.map +1 -1
  154. package/dist/query/row-closure-picture.d.ts +5 -67
  155. package/dist/query/row-closure-picture.d.ts.map +1 -1
  156. package/dist/query/row-closure-picture.js +6 -67
  157. package/dist/query/row-closure-picture.js.map +1 -1
  158. package/dist/query/similar-incidents.d.ts +6 -41
  159. package/dist/query/similar-incidents.d.ts.map +1 -1
  160. package/dist/query/similar-incidents.js +15 -69
  161. package/dist/query/similar-incidents.js.map +1 -1
  162. package/dist/query/sqlite.d.ts +3 -7
  163. package/dist/query/sqlite.d.ts.map +1 -1
  164. package/dist/query/sqlite.js +13 -16
  165. package/dist/query/sqlite.js.map +1 -1
  166. package/dist/query/test-coverage.d.ts +5 -45
  167. package/dist/query/test-coverage.d.ts.map +1 -1
  168. package/dist/query/test-coverage.js +10 -53
  169. package/dist/query/test-coverage.js.map +1 -1
  170. package/dist/query/traverse.d.ts +22 -126
  171. package/dist/query/traverse.d.ts.map +1 -1
  172. package/dist/query/traverse.js +0 -0
  173. package/dist/query/traverse.js.map +1 -1
  174. package/dist/query/unresolved.d.ts +19 -164
  175. package/dist/query/unresolved.d.ts.map +1 -1
  176. package/dist/query/unresolved.js +11 -138
  177. package/dist/query/unresolved.js.map +1 -1
  178. package/dist/query/verification-status.d.ts +12 -109
  179. package/dist/query/verification-status.d.ts.map +1 -1
  180. package/dist/query/verification-status.js +9 -99
  181. package/dist/query/verification-status.js.map +1 -1
  182. package/dist/recording/migrate.d.ts +4 -10
  183. package/dist/recording/migrate.d.ts.map +1 -1
  184. package/dist/recording/migrate.js +4 -10
  185. package/dist/recording/migrate.js.map +1 -1
  186. package/dist/recording/reader.d.ts +2 -7
  187. package/dist/recording/reader.d.ts.map +1 -1
  188. package/dist/recording/reader.js +2 -7
  189. package/dist/recording/reader.js.map +1 -1
  190. package/dist/recording/redact.d.ts +6 -57
  191. package/dist/recording/redact.d.ts.map +1 -1
  192. package/dist/recording/redact.js +8 -64
  193. package/dist/recording/redact.js.map +1 -1
  194. package/dist/recording/schema.d.ts +3 -38
  195. package/dist/recording/schema.d.ts.map +1 -1
  196. package/dist/recording/schema.js +3 -38
  197. package/dist/recording/schema.js.map +1 -1
  198. package/dist/recording/writer.d.ts +11 -74
  199. package/dist/recording/writer.d.ts.map +1 -1
  200. package/dist/recording/writer.js +3 -43
  201. package/dist/recording/writer.js.map +1 -1
  202. package/dist/scoping/fanout.d.ts +6 -68
  203. package/dist/scoping/fanout.d.ts.map +1 -1
  204. package/dist/scoping/fanout.js +6 -68
  205. package/dist/scoping/fanout.js.map +1 -1
  206. package/dist/scoping/score.d.ts +20 -70
  207. package/dist/scoping/score.d.ts.map +1 -1
  208. package/dist/scoping/score.js +20 -70
  209. package/dist/scoping/score.js.map +1 -1
  210. package/dist/scoping/tiers.d.ts +4 -16
  211. package/dist/scoping/tiers.d.ts.map +1 -1
  212. package/dist/scoping/tiers.js +4 -16
  213. package/dist/scoping/tiers.js.map +1 -1
  214. package/dist/scoping/traverse.d.ts +3 -25
  215. package/dist/scoping/traverse.d.ts.map +1 -1
  216. package/dist/scoping/traverse.js +14 -49
  217. package/dist/scoping/traverse.js.map +1 -1
  218. package/dist/scoping/weights.d.ts +10 -74
  219. package/dist/scoping/weights.d.ts.map +1 -1
  220. package/dist/scoping/weights.js +14 -86
  221. package/dist/scoping/weights.js.map +1 -1
  222. package/dist/sources/confirmed/incidents.d.ts +5 -35
  223. package/dist/sources/confirmed/incidents.d.ts.map +1 -1
  224. package/dist/sources/confirmed/incidents.js +14 -48
  225. package/dist/sources/confirmed/incidents.js.map +1 -1
  226. package/dist/sources/git/diff.d.ts +71 -65
  227. package/dist/sources/git/diff.d.ts.map +1 -1
  228. package/dist/sources/git/diff.js +136 -83
  229. package/dist/sources/git/diff.js.map +1 -1
  230. package/dist/sources/git/env.d.ts +7 -0
  231. package/dist/sources/git/env.d.ts.map +1 -1
  232. package/dist/sources/git/env.js +10 -11
  233. package/dist/sources/git/env.js.map +1 -1
  234. package/dist/sources/git/history.d.ts +64 -84
  235. package/dist/sources/git/history.d.ts.map +1 -1
  236. package/dist/sources/git/history.js +141 -112
  237. package/dist/sources/git/history.js.map +1 -1
  238. package/dist/sources/git/incidents.d.ts +13 -75
  239. package/dist/sources/git/incidents.d.ts.map +1 -1
  240. package/dist/sources/git/incidents.js +21 -91
  241. package/dist/sources/git/incidents.js.map +1 -1
  242. package/dist/sources/git/index.d.ts +5 -3
  243. package/dist/sources/git/index.d.ts.map +1 -1
  244. package/dist/sources/git/index.js +3 -2
  245. package/dist/sources/git/index.js.map +1 -1
  246. package/dist/sources/git/source.d.ts +9 -79
  247. package/dist/sources/git/source.d.ts.map +1 -1
  248. package/dist/sources/git/source.js +0 -0
  249. package/dist/sources/git/source.js.map +1 -1
  250. package/dist/sources/migrations/across-change.d.ts +94 -0
  251. package/dist/sources/migrations/across-change.d.ts.map +1 -0
  252. package/dist/sources/migrations/across-change.js +278 -0
  253. package/dist/sources/migrations/across-change.js.map +1 -0
  254. package/dist/sources/migrations/dialects.d.ts +20 -36
  255. package/dist/sources/migrations/dialects.d.ts.map +1 -1
  256. package/dist/sources/migrations/dialects.js +11 -36
  257. package/dist/sources/migrations/dialects.js.map +1 -1
  258. package/dist/sources/migrations/index.d.ts +3 -1
  259. package/dist/sources/migrations/index.d.ts.map +1 -1
  260. package/dist/sources/migrations/index.js +2 -1
  261. package/dist/sources/migrations/index.js.map +1 -1
  262. package/dist/sources/migrations/read.d.ts +14 -79
  263. package/dist/sources/migrations/read.d.ts.map +1 -1
  264. package/dist/sources/migrations/read.js +14 -89
  265. package/dist/sources/migrations/read.js.map +1 -1
  266. package/dist/sources/workspace/workspace.d.ts +6 -42
  267. package/dist/sources/workspace/workspace.d.ts.map +1 -1
  268. package/dist/sources/workspace/workspace.js +10 -53
  269. package/dist/sources/workspace/workspace.js.map +1 -1
  270. package/dist/store/driver/driver.d.ts +9 -38
  271. package/dist/store/driver/driver.d.ts.map +1 -1
  272. package/dist/store/driver/driver.js +4 -22
  273. package/dist/store/driver/driver.js.map +1 -1
  274. package/dist/store/driver/node-sqlite.d.ts +3 -12
  275. package/dist/store/driver/node-sqlite.d.ts.map +1 -1
  276. package/dist/store/driver/node-sqlite.js +4 -18
  277. package/dist/store/driver/node-sqlite.js.map +1 -1
  278. package/dist/store/index.d.ts +2 -7
  279. package/dist/store/index.d.ts.map +1 -1
  280. package/dist/store/index.js +4 -10
  281. package/dist/store/index.js.map +1 -1
  282. package/dist/store/migrate.d.ts +14 -50
  283. package/dist/store/migrate.d.ts.map +1 -1
  284. package/dist/store/migrate.js +15 -52
  285. package/dist/store/migrate.js.map +1 -1
  286. package/dist/store/reader.d.ts +19 -84
  287. package/dist/store/reader.d.ts.map +1 -1
  288. package/dist/store/reader.js +25 -92
  289. package/dist/store/reader.js.map +1 -1
  290. package/dist/store/schema.d.ts +14 -76
  291. package/dist/store/schema.d.ts.map +1 -1
  292. package/dist/store/schema.js +14 -76
  293. package/dist/store/schema.js.map +1 -1
  294. package/dist/store/writer.d.ts +14 -88
  295. package/dist/store/writer.d.ts.map +1 -1
  296. package/dist/store/writer.js +29 -123
  297. package/dist/store/writer.js.map +1 -1
  298. package/dist/tiers/certify.d.ts +46 -281
  299. package/dist/tiers/certify.d.ts.map +1 -1
  300. package/dist/tiers/certify.js +46 -226
  301. package/dist/tiers/certify.js.map +1 -1
  302. package/dist/tiers/ladder.d.ts +7 -51
  303. package/dist/tiers/ladder.d.ts.map +1 -1
  304. package/dist/tiers/ladder.js +13 -89
  305. package/dist/tiers/ladder.js.map +1 -1
  306. package/dist/validation/attributes.d.ts +47 -0
  307. package/dist/validation/attributes.d.ts.map +1 -0
  308. package/dist/validation/attributes.js +130 -0
  309. package/dist/validation/attributes.js.map +1 -0
  310. package/dist/validation/config-graph.d.ts +7 -56
  311. package/dist/validation/config-graph.d.ts.map +1 -1
  312. package/dist/validation/config-graph.js +15 -61
  313. package/dist/validation/config-graph.js.map +1 -1
  314. package/dist/validation/env.d.ts +53 -2
  315. package/dist/validation/env.d.ts.map +1 -1
  316. package/dist/validation/env.js +99 -4
  317. package/dist/validation/env.js.map +1 -1
  318. package/dist/validation/index.d.ts +5 -1
  319. package/dist/validation/index.d.ts.map +1 -1
  320. package/dist/validation/index.js +3 -1
  321. package/dist/validation/index.js.map +1 -1
  322. package/dist/validation/join-substitution.d.ts +22 -120
  323. package/dist/validation/join-substitution.d.ts.map +1 -1
  324. package/dist/validation/join-substitution.js +13 -90
  325. package/dist/validation/join-substitution.js.map +1 -1
  326. package/dist/validation/migration-integrity.d.ts +72 -0
  327. package/dist/validation/migration-integrity.d.ts.map +1 -0
  328. package/dist/validation/migration-integrity.js +238 -0
  329. package/dist/validation/migration-integrity.js.map +1 -0
  330. package/dist/validation/migrations.d.ts +23 -88
  331. package/dist/validation/migrations.d.ts.map +1 -1
  332. package/dist/validation/migrations.js +20 -79
  333. package/dist/validation/migrations.js.map +1 -1
  334. package/dist/validation/nodes.d.ts +3 -1
  335. package/dist/validation/nodes.d.ts.map +1 -1
  336. package/dist/validation/nodes.js +3 -1
  337. package/dist/validation/nodes.js.map +1 -1
  338. package/dist/validation/rollback.d.ts +10 -73
  339. package/dist/validation/rollback.d.ts.map +1 -1
  340. package/dist/validation/rollback.js +23 -81
  341. package/dist/validation/rollback.js.map +1 -1
  342. package/dist/validation/route-drift.d.ts +9 -62
  343. package/dist/validation/route-drift.d.ts.map +1 -1
  344. package/dist/validation/route-drift.js +7 -52
  345. package/dist/validation/route-drift.js.map +1 -1
  346. package/dist/validation/sources.d.ts +16 -94
  347. package/dist/validation/sources.d.ts.map +1 -1
  348. package/dist/validation/sources.js +51 -147
  349. package/dist/validation/sources.js.map +1 -1
  350. package/dist/worker/pool.d.ts +6 -45
  351. package/dist/worker/pool.d.ts.map +1 -1
  352. package/dist/worker/pool.js +5 -42
  353. package/dist/worker/pool.js.map +1 -1
  354. package/dist/worker/protocol.d.ts +7 -20
  355. package/dist/worker/protocol.d.ts.map +1 -1
  356. package/dist/worker/protocol.js +3 -10
  357. package/dist/worker/protocol.js.map +1 -1
  358. package/dist/worker/traversal.worker.d.ts +2 -21
  359. package/dist/worker/traversal.worker.d.ts.map +1 -1
  360. package/dist/worker/traversal.worker.js +4 -23
  361. package/dist/worker/traversal.worker.js.map +1 -1
  362. package/package.json +11 -2
@@ -1,46 +1,7 @@
1
1
  /**
2
- * §14.8 — the historically coupled file that was **not** touched.
3
- *
4
- * `CHANGES_WITH` queried in the opposite direction from diff scoping. Scoping
5
- * asks *what else does this change reach*; this asks *what usually moves with
6
- * this and did not this time*.
7
- *
8
- * ## Why this is the first multi-PR check built
9
- *
10
- * §14.8 calls it nearly free, and the reason is worth stating rather than
11
- * assuming: **the edges already exist**, it needs no per-PR storage, and it
12
- * works at R0 in any language with no adapter beyond file paths. For a
13
- * repository whose language has no adapter at all, this is the check that
14
- * still fires. Every other check in §14 needs either a persisted per-PR
15
- * subgraph (§14.2) or a UI framework extractor (§14.7).
16
- *
17
- * ## Everything here is Class C and that is not a limitation to be fixed
18
- *
19
- * DEC-033 is explicit: co-change is evidence about **people**, not about
20
- * program structure. *"These two files usually change together"* is a hint for
21
- * a human, never a claim about what breaks. The git source emits at R0,
22
- * §11A.5 caps any finding resting on it at C, and no amount of support count
23
- * changes that — a pair that co-changed two hundred times is a stronger hint
24
- * and still a hint.
25
- *
26
- * So this module reports a *nudge* and says so in the words it hands back. A
27
- * caller that renders these as defects has broken principle 4 at the last
28
- * gate, and the note travels with the finding to make that hard.
29
- *
30
- * ## The empty answer is two different answers
31
- *
32
- * A pull request with no hidden dependencies and a graph that never read any
33
- * history produce **the same empty list**. That conflation is the single most
34
- * expensive defect this project has: an absent carrier read as an empty one
35
- * shipped three static-validation checks dead, and a shape reader that
36
- * filtered for the wrong spelling answered "no fields" for 77 of 77 nodes
37
- * that visibly declared them.
38
- *
39
- * So `analysed` is false when the graph holds no `CHANGES_WITH` edge for any
40
- * changed file, and the caller is told *the history was not read* rather than
41
- * *nothing is coupled*. A repository younger than the support floor, a graph
42
- * built without the git source, and a genuinely uncoupled change are three
43
- * different statements.
2
+ * §14.8 — the historically coupled file not touched this time. `CHANGES_WITH` queried in reverse of diff scoping. Nearly free: edges already exist, R0, no adapter needed beyond file paths.
3
+ * Always Class C (DEC-033, §11A.5): co-change is evidence about people, never program structure — a nudge, not a defect claim.
4
+ * `analysed: false` means history wasn't read; a caller must not read that as "nothing is coupled" — conflating the two was this project's costliest defect.
44
5
  */
45
6
  import type { IRNode } from "@descryy/ir";
46
7
  import type { ReliabilityClass } from "@descryy/ir";
@@ -68,14 +29,8 @@ export interface HiddenDependencyReport {
68
29
  readonly findings: readonly HiddenDependency[];
69
30
  /** The count before `limit` capped it — P27's disclosed remainder: a structured field, not only a prose note. */
70
31
  readonly findingsTotal: number;
71
- /**
72
- * False when no changed file had a single `CHANGES_WITH` edge.
73
- *
74
- * **An empty `findings` with `analysed: false` means the history was not
75
- * read, not that nothing is coupled.** The two are different answers to
76
- * different questions and collapsing them is §20.2's second category
77
- * swallowing its fourth.
78
- */
32
+ /** False when no changed file had a `CHANGES_WITH` edge — means history wasn't
33
+ * read, not that nothing is coupled (§20.2's second category vs its fourth). */
79
34
  readonly analysed: boolean;
80
35
  readonly checked: {
81
36
  /** Changed paths the caller supplied. */
@@ -87,34 +42,19 @@ export interface HiddenDependencyReport {
87
42
  /** Coupled files considered before the support floor and the cap. */
88
43
  readonly candidates: number;
89
44
  };
90
- /**
91
- * Changed paths with no `FILE` node in the graph.
92
- *
93
- * Not "these have no hidden dependencies" — nothing looked at them. A path
94
- * the graph never read is a path with no blast radius only if you conflate
95
- * the two.
96
- */
45
+ /** Changed paths with no `FILE` node — not "no hidden dependencies", nothing
46
+ * looked at them. */
97
47
  readonly unresolvedChanged: readonly string[];
98
48
  }
99
49
  export interface HiddenDependencyOptions {
100
- /**
101
- * Minimum co-change support to surface. Defaults to the edge's own floor,
102
- * because an edge that exists already cleared DEC-033's support and
103
- * confidence floors — raising it here is a second, separate judgement and
104
- * belongs to the caller.
105
- */
50
+ /** Minimum co-change support to surface. Defaults to the edge's own floor —
51
+ * raising it further is the caller's separate judgement. */
106
52
  readonly minSupport?: number;
107
- /**
108
- * Hard cap on findings, per rule 5. Truncation is reported, never silent.
109
- */
53
+ /** Hard cap on findings (rule 5). Truncation is reported, never silent. */
110
54
  readonly limit?: number;
111
55
  }
112
- /**
113
- * Files coupled to the change that the change did not touch.
114
- *
115
- * @param changedIds `FILE` node ids the pull request touched
116
- * @param unresolvedChanged paths the caller could not resolve to a node — passed
117
- * in rather than discovered, because only the caller knows what it asked for
118
- */
56
+ /** Files coupled to the change that the change did not touch.
57
+ * `unresolvedChanged` is passed in, not discovered — only the caller knows
58
+ * what it asked for. */
119
59
  export declare function findHiddenDependencies(provider: AdjacencyProvider, changedIds: readonly string[], unresolvedChanged?: readonly string[], options?: HiddenDependencyOptions): QueryResult<HiddenDependencyReport>;
120
60
  //# sourceMappingURL=hidden-dependency.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"hidden-dependency.d.ts","sourceRoot":"","sources":["../../src/multipr/hidden-dependency.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AAEH,OAAO,KAAK,EAAU,MAAM,EAAE,MAAM,aAAa,CAAC;AAElD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAG3E,iFAAiF;AACjF,MAAM,WAAW,gBAAgB;IAC/B,6CAA6C;IAC7C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,kEAAkE;IAClE,QAAQ,CAAC,SAAS,EAAE,SAAS;QAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QACtB,iDAAiD;QACjD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;QACzB,+DAA+D;QAC/D,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;KACrC,EAAE,CAAC;IACJ,wEAAwE;IACxE,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,uEAAuE;IACvE,QAAQ,CAAC,WAAW,EAAE,gBAAgB,CAAC;IACvC,sDAAsD;IACt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3E,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB;AAkCD;;yBAEyB;AACzB,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,iBAAiB,EAC3B,UAAU,EAAE,SAAS,MAAM,EAAE,EAC7B,iBAAiB,GAAE,SAAS,MAAM,EAAO,EACzC,OAAO,GAAE,uBAA4B,GACpC,WAAW,CAAC,sBAAsB,CAAC,CAsHrC"}
@@ -1,56 +1,12 @@
1
1
  /**
2
- * §14.8 — the historically coupled file that was **not** touched.
3
- *
4
- * `CHANGES_WITH` queried in the opposite direction from diff scoping. Scoping
5
- * asks *what else does this change reach*; this asks *what usually moves with
6
- * this and did not this time*.
7
- *
8
- * ## Why this is the first multi-PR check built
9
- *
10
- * §14.8 calls it nearly free, and the reason is worth stating rather than
11
- * assuming: **the edges already exist**, it needs no per-PR storage, and it
12
- * works at R0 in any language with no adapter beyond file paths. For a
13
- * repository whose language has no adapter at all, this is the check that
14
- * still fires. Every other check in §14 needs either a persisted per-PR
15
- * subgraph (§14.2) or a UI framework extractor (§14.7).
16
- *
17
- * ## Everything here is Class C and that is not a limitation to be fixed
18
- *
19
- * DEC-033 is explicit: co-change is evidence about **people**, not about
20
- * program structure. *"These two files usually change together"* is a hint for
21
- * a human, never a claim about what breaks. The git source emits at R0,
22
- * §11A.5 caps any finding resting on it at C, and no amount of support count
23
- * changes that — a pair that co-changed two hundred times is a stronger hint
24
- * and still a hint.
25
- *
26
- * So this module reports a *nudge* and says so in the words it hands back. A
27
- * caller that renders these as defects has broken principle 4 at the last
28
- * gate, and the note travels with the finding to make that hard.
29
- *
30
- * ## The empty answer is two different answers
31
- *
32
- * A pull request with no hidden dependencies and a graph that never read any
33
- * history produce **the same empty list**. That conflation is the single most
34
- * expensive defect this project has: an absent carrier read as an empty one
35
- * shipped three static-validation checks dead, and a shape reader that
36
- * filtered for the wrong spelling answered "no fields" for 77 of 77 nodes
37
- * that visibly declared them.
38
- *
39
- * So `analysed` is false when the graph holds no `CHANGES_WITH` edge for any
40
- * changed file, and the caller is told *the history was not read* rather than
41
- * *nothing is coupled*. A repository younger than the support floor, a graph
42
- * built without the git source, and a genuinely uncoupled change are three
43
- * different statements.
2
+ * §14.8 — the historically coupled file not touched this time. `CHANGES_WITH` queried in reverse of diff scoping. Nearly free: edges already exist, R0, no adapter needed beyond file paths.
3
+ * Always Class C (DEC-033, §11A.5): co-change is evidence about people, never program structure — a nudge, not a defect claim.
4
+ * `analysed: false` means history wasn't read; a caller must not read that as "nothing is coupled" — conflating the two was this project's costliest defect.
44
5
  */
45
6
  import { reliabilityCap, reliabilityNote } from "@descryy/ir";
46
7
  const DEFAULT_LIMIT = 10;
47
- /**
48
- * `CHANGES_WITH` is stored in one canonical direction (DEC-036), so both
49
- * directions must be walked. Reading only `outgoing` halves the answer and
50
- * produces no error — the same silent-halving shape as an undirected edge
51
- * traversed one way in scoping, which is why `traverse.ts` carries the same
52
- * set.
53
- */
8
+ /** `CHANGES_WITH` stores one canonical direction (DEC-036); both must be walked
9
+ * or the answer silently halves, no error. */
54
10
  function coupledNeighbours(provider, id) {
55
11
  const out = [];
56
12
  const seen = new Set();
@@ -73,13 +29,9 @@ function coupledNeighbours(provider, id) {
73
29
  walk(provider.incoming(id, options), (e) => e.from);
74
30
  return out;
75
31
  }
76
- /**
77
- * Files coupled to the change that the change did not touch.
78
- *
79
- * @param changedIds `FILE` node ids the pull request touched
80
- * @param unresolvedChanged paths the caller could not resolve to a node — passed
81
- * in rather than discovered, because only the caller knows what it asked for
82
- */
32
+ /** Files coupled to the change that the change did not touch.
33
+ * `unresolvedChanged` is passed in, not discovered — only the caller knows
34
+ * what it asked for. */
83
35
  export function findHiddenDependencies(provider, changedIds, unresolvedChanged = [], options = {}) {
84
36
  const limit = options.limit ?? DEFAULT_LIMIT;
85
37
  const minSupport = options.minSupport ?? 0;
@@ -90,7 +42,7 @@ export function findHiddenDependencies(provider, changedIds, unresolvedChanged =
90
42
  if (node !== undefined)
91
43
  changedNodes.set(id, node);
92
44
  }
93
- // candidate id -> the changed files it is coupled to
45
+ // candidate id -> changed files it is coupled to
94
46
  const candidates = new Map();
95
47
  let withHistory = 0;
96
48
  for (const [id, node] of changedNodes) {
@@ -111,10 +63,8 @@ export function findHiddenDependencies(provider, changedIds, unresolvedChanged =
111
63
  entry.links.push({ node, support: n.support, observedConfidence: n.observedConfidence });
112
64
  }
113
65
  }
114
- // R0 evidence, and the claim is name-level: this file is or is not in the
115
- // diff. §11A.5 caps it at C either way — R0's name-level row is still C, and
116
- // only R2 buys the A carve-out. Computed rather than written down so that a
117
- // change to the table cannot leave this stale.
66
+ // R0, name-level claim: §11A.5 caps this at C regardless (only R2 buys the A
67
+ // carve-out). Computed, not hardcoded, so a table change can't leave this stale.
118
68
  const reliability = reliabilityCap(0, true);
119
69
  const disclosure = `${reliabilityNote(0, true)} Co-change is evidence about how people have edited ` +
120
70
  "this repository, not about what the program does — a strongly coupled pair is a " +
@@ -139,8 +89,7 @@ export function findHiddenDependencies(provider, changedIds, unresolvedChanged =
139
89
  findings.sort((a, b) => b.strongestSupport - a.strongestSupport || a.node.file.localeCompare(b.node.file));
140
90
  const kept = findings.slice(0, limit);
141
91
  const truncated = findings.length > limit;
142
- // The baseline precondition. Nothing was read, so nothing can be concluded —
143
- // and "no hidden dependencies" is a conclusion.
92
+ // Nothing was read, so nothing can be concluded — and "no hidden deps" is a conclusion.
144
93
  const analysed = withHistory > 0;
145
94
  const notes = [];
146
95
  if (!analysed) {
@@ -1 +1 @@
1
- {"version":3,"file":"hidden-dependency.js","sourceRoot":"","sources":["../../src/multipr/hidden-dependency.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AAGH,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAwE9D,MAAM,aAAa,GAAG,EAAE,CAAC;AAEzB;;;;;;GAMG;AACH,SAAS,iBAAiB,CACxB,QAA2B,EAC3B,EA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QACT,KAAK;KACN,CAAC;AACJ,CAAC"}
@@ -1,121 +1,23 @@
1
1
  /**
2
- * §14.4 — is this overlap two people adding lines, or two people disagreeing?
3
- *
4
- * `overlap.ts` surfaces a shared node and stops, and says why it stops: *"§14.4's
5
- * mechanical-versus-semantic classification needs the actual diff lines at the
6
- * shared node, which this module never sees … Guessing 'mechanical' without
7
- * reading the lines would be the one place in this system where a wrong guess
8
- * edits somebody's branch."* This is that module, and it reads the lines.
9
- *
10
- * ## The bar here is higher than anywhere else in §14, not lower
11
- *
12
- * §14.4 is the **single documented exception** to approval-before-code-change
13
- * (§9, rule 8). Every other check in this package tells a human to look at
14
- * something. A `MECHANICAL` verdict may be **auto-applied** — it edits a branch
15
- * without asking.
16
- *
17
- * So rule 2 inverts in consequence, and the asymmetry is the whole design:
18
- *
19
- * > A missed mechanical resolution costs a human thirty seconds of `git
20
- * > mergetool`. A false one silently rewrites two people's work into something
21
- * > neither wrote and reports success.
22
- *
23
- * `MECHANICAL` is therefore claimed **only when every condition is affirmatively
24
- * established**, never when nothing contradicts it. Absent hunks, a hunk whose
25
- * shape cannot be read, a file this module cannot reason about — each produces
26
- * `UNCLASSIFIABLE` with a reason, and `UNCLASSIFIABLE` never auto-applies.
27
- * `SEMANTIC` is the answer when the lines were read and disagree; that is a
28
- * different sentence from "the lines were not read", and the two are kept apart
29
- * for the reason they are kept apart everywhere else in this package.
30
- *
31
- * ## What "only add new, non-overlapping lines" has to mean to be safe
32
- *
33
- * §14.4's diamond asks whether both changes *"only add new, non-overlapping
34
- * lines"*. Read literally that is a test on the post-image, and the post-images
35
- * of two branches are not comparable — they are two different files. The test
36
- * that means anything is on the **base**:
37
- *
38
- * 1. **Every hunk on both sides is a pure insertion** — it consumes zero base
39
- * lines (`baseLines === 0`). One modified or deleted base line anywhere at
40
- * this node makes the whole overlap `SEMANTIC`. Not "the modified hunks are
41
- * semantic and the rest are mechanical": a partially auto-applied overlap is
42
- * a merge nobody reviewed.
43
- *
44
- * 2. **No two insertion points from opposite sides fall within the context
45
- * window.** Two insertions at base lines 10 and 12 do not touch the same
46
- * line and git still refuses them, because their three-line contexts
47
- * overlap. Matching git's own margin rather than testing for exact equality
48
- * is the difference between a rule about text and a rule about what the
49
- * merge will actually do.
50
- *
51
- * The margin is `CONTEXT_LINES`, and it is deliberately the *conservative*
52
- * direction: a real mechanical case inside the margin is reported `SEMANTIC` and
53
- * a human resolves it in half a minute.
54
- *
55
- * ## Two claims, two different sources of authority — and only one of them
56
- * gates the apply
57
- *
58
- * This finding rests on two separate things and it is worth being exact about
59
- * which does what, because conflating them would either block safe applies or
60
- * permit unsafe ones:
61
- *
62
- * | claim | rests on | governs |
63
- * | --- | --- | --- |
64
- * | *both changes touch this node* | the graph | whether this is **surfaced**, and the reliability class |
65
- * | *these hunks merge without conflict* | the diff text | whether this may be **applied** |
66
- *
67
- * The reliability class follows `overlap.ts` — the weaker of the two sides'
68
- * resolutions, per DEC-058 and §11A.5 — and it describes how much to trust that
69
- * this overlap *matters*. It does not gate the apply, and that is not a
70
- * loosening: if the graph were wrong about the node, "keep both non-adjacent
71
- * pure insertions" is still exactly as safe, because the textual claim never
72
- * depended on the graph being right. Gating the apply on the graph's resolution
73
- * would be borrowing authority from the wrong evidence.
74
- *
75
- * A caller wanting the stricter rule can require class A itself. The point is
76
- * that the module states which evidence carries which claim rather than folding
77
- * both into one number.
78
- *
79
- * ## Verify-after is not a recommendation and is not expressible as one
80
- *
81
- * §14.4 makes the post-apply verification **mandatory** (§19). A `verifyAfter:
82
- * true` field on a result would be advisory, and an advisory obligation is one
83
- * `if` away from being skipped by a caller in a hurry.
84
- *
85
- * So the apply path is `applyMechanical(plan, { apply, verify })` and **both
86
- * callbacks are required by the type**. There is no overload that applies
87
- * without verifying. A `verify` returning false produces `"reverted"`, and a
88
- * `verify` that throws produces `"verification-failed"` — which is *not* the
89
- * same outcome and is not collapsed into it, because "the change broke
90
- * something" and "we could not tell whether the change broke something" are the
91
- * two categories §20.2 exists to keep apart.
2
+ * §14.4 mechanical-vs-semantic overlap check — the one documented exception to
3
+ * approval-before-code-change (§9 rule 8): MECHANICAL auto-applies only when every
4
+ * hunk on both sides is a pure insertion and insertion points sit >CONTEXT_LINES apart on the base; else UNCLASSIFIABLE/SEMANTIC. Reliability (DEC-058) never gates the apply; verify-after is mandatory (§19).
92
5
  */
93
6
  import type { ResolutionLevel } from "@descryy/ir";
94
7
  import type { ReliabilityClass } from "@descryy/ir";
95
8
  import type { GraphStamp, QueryResult } from "../query/provider.ts";
96
9
  import type { SharedNode } from "./overlap.ts";
97
- /**
98
- * git's default diff context. Two insertions closer than this on the base
99
- * produce overlapping context and git declines to merge them, so this module
100
- * declines too.
101
- */
10
+ /** git's default diff context. Two insertions closer than this on the base
11
+ * overlap and git declines to merge them, so this module declines too. */
102
12
  export declare const CONTEXT_LINES = 3;
103
- /**
104
- * One hunk of a change, described against the **base** image.
105
- *
106
- * Deliberately not a patch: this module never applies text, so it needs the
107
- * *shape* of the change and not its content. Describing the shape against the
108
- * base is what makes two branches comparable at all — their post-images are two
109
- * different files and comparing those answers nothing.
110
- */
13
+ /** One hunk of a change, described against the base image — not a patch, since
14
+ * post-images of two branches are different files and not comparable. */
111
15
  export interface DiffHunk {
112
16
  readonly file: string;
113
17
  /** First base line the hunk touches, 1-indexed. For a pure insertion, the line it follows. */
114
18
  readonly baseStart: number;
115
- /**
116
- * Base lines consumed. **Zero means a pure insertion**; anything above zero
117
- * means at least one existing line was modified or deleted.
118
- */
19
+ /** Base lines consumed. Zero means a pure insertion; above zero means an
20
+ * existing line was modified or deleted. */
119
21
  readonly baseLines: number;
120
22
  /** Lines produced. Reported, never used for classification — see the docstring. */
121
23
  readonly headLines: number;
@@ -124,10 +26,8 @@ export type MechanicalVerdict = "MECHANICAL" | "SEMANTIC" | "UNCLASSIFIABLE";
124
26
  /** The resolution a `MECHANICAL` verdict proposes. Always "keep both". */
125
27
  export interface KeepBothResolution {
126
28
  readonly kind: "keep-both";
127
- /**
128
- * The two sides' hunks in base order — the order an applier must write them
129
- * in. Deterministic so that applying twice is applying the same thing.
130
- */
29
+ /** The two sides' hunks in base order — deterministic, so applying twice
30
+ * applies the same thing. */
131
31
  readonly order: readonly {
132
32
  readonly side: "a" | "b";
133
33
  readonly hunk: DiffHunk;
@@ -136,12 +36,8 @@ export interface KeepBothResolution {
136
36
  export interface MechanicalClassification {
137
37
  readonly nodeId: string;
138
38
  readonly verdict: MechanicalVerdict;
139
- /**
140
- * Why, in one sentence, always present — including for `MECHANICAL`.
141
- *
142
- * A verdict that explains only its refusals trains a reader to skim the
143
- * approvals, which are the ones that edit a branch.
144
- */
39
+ /** Why, in one sentence, always present — including for MECHANICAL, the
40
+ * verdict that actually edits a branch. */
145
41
  readonly reason: string;
146
42
  /** Present only for `MECHANICAL`. */
147
43
  readonly resolution?: KeepBothResolution;
@@ -155,13 +51,8 @@ export interface MechanicalClassification {
155
51
  }
156
52
  export interface MechanicalReport {
157
53
  readonly classifications: readonly MechanicalClassification[];
158
- /**
159
- * False when no shared node had hunks on **both** sides.
160
- *
161
- * An empty `classifications` with `analysed: false` means the diffs were not
162
- * supplied, not that nothing was mechanical — the same distinction
163
- * `hidden-dependency.ts` draws for co-change history, and for the same reason.
164
- */
54
+ /** False when no shared node had hunks on both sides — means diffs weren't
55
+ * supplied, not that nothing was mechanical (cf. hidden-dependency.ts). */
165
56
  readonly analysed: boolean;
166
57
  readonly checked: {
167
58
  readonly shared: number;
@@ -176,24 +67,12 @@ export interface MechanicalOptions {
176
67
  readonly contextLines?: number;
177
68
  readonly stamp?: GraphStamp;
178
69
  }
179
- /**
180
- * Classify every surfaced overlap between two changes.
181
- *
182
- * @param shared the nodes `findOverlaps` surfaced — this module does not decide
183
- * what is worth looking at, only what may be done about it
184
- * @param aHunks side A's hunks, against the base both sides share
185
- * @param bHunks side B's hunks, against the same base
186
- */
70
+ /** Classify every surfaced overlap between two changes. `shared` is what
71
+ * findOverlaps surfaced; `aHunks`/`bHunks` are each side's hunks vs the same base. */
187
72
  export declare function classifyOverlaps(shared: readonly SharedNode[], aHunks: readonly DiffHunk[], bHunks: readonly DiffHunk[], options?: MechanicalOptions): QueryResult<MechanicalReport>;
188
- /**
189
- * What happened when a mechanical resolution was applied.
190
- *
191
- * `"reverted"` and `"verification-failed"` are separate on purpose. The first
192
- * means verification ran and said no; the second means verification could not
193
- * say. Collapsing them would report "the change was bad" for a case that is
194
- * actually "we do not know", which is §20.2's second category swallowing its
195
- * fourth — the most expensive defect shape in this project.
196
- */
73
+ /** What happened when a mechanical resolution was applied. "reverted" (verify
74
+ * said no) and "verification-failed" (verify could not say) stay separate —
75
+ * collapsing them would report "bad" for a "we don't know" case (§20.2). */
197
76
  export type ApplyOutcome = {
198
77
  readonly status: "applied";
199
78
  readonly verified: true;
@@ -215,25 +94,11 @@ export interface ApplyHooks {
215
94
  /** Called when `verify` says no. Absent means the caller cannot undo, which is refused up front. */
216
95
  readonly revert?: (() => void | Promise<void>) | undefined;
217
96
  }
218
- /**
219
- * Apply one mechanical resolution, then verify — in that order, always both.
220
- *
221
- * The mandatory verification of §14.4/§19 is enforced by the *type*: `verify` is
222
- * a required member of `ApplyHooks`, so a caller that wants to skip it has to
223
- * write a function that lies, which is a different and more visible act than
224
- * omitting an optional field.
225
- *
226
- * Refuses outright, before touching anything, when the verdict is not
227
- * `MECHANICAL` or when no `revert` was supplied — auto-applying a change that
228
- * cannot be undone if verification fails is the exception's precondition, not a
229
- * detail of it.
230
- */
97
+ /** Apply one mechanical resolution, then verify — always both. §14.4/§19's
98
+ * mandatory verification is enforced by the type: `verify` is required on
99
+ * `ApplyHooks`. Refuses upfront if verdict isn't MECHANICAL or no `revert` given. */
231
100
  export declare function applyMechanical(classification: MechanicalClassification, hooks: ApplyHooks): Promise<ApplyOutcome>;
232
- /**
233
- * The reliability class this module would report for a pair of resolutions.
234
- *
235
- * Exported so `overlap.ts`'s rule and this one cannot drift apart silently: both
236
- * take the weaker of the two sides, per DEC-058.
237
- */
101
+ /** Reliability class for a pair of resolutions — the weaker side, per DEC-058.
102
+ * Exported so overlap.ts's rule can't drift apart from this one. */
238
103
  export declare function pairReliability(a: ResolutionLevel, b: ResolutionLevel): ReliabilityClass;
239
104
  //# sourceMappingURL=mechanical.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"mechanical.d.ts","sourceRoot":"","sources":["../../src/multipr/mechanical.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2FG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C;;;;GAIG;AACH,eAAO,MAAM,aAAa,IAAI,CAAC;AAE/B;;;;;;;GAOG;AACH,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,8FAA8F;IAC9F,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B;;;OAGG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,mFAAmF;IACnF,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,MAAM,iBAAiB,GAAG,YAAY,GAAG,UAAU,GAAG,gBAAgB,CAAC;AAE7E,0EAA0E;AAC1E,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAE,SAAS;QAAE,QAAQ,CAAC,IAAI,EAAE,GAAG,GAAG,GAAG,CAAC;QAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAA;KAAE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