@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,49 +1,16 @@
1
- /**
2
- * `applyReplySizeBudget` — the same discipline as `size.ts`, applied to the
3
- * *whole* serialized reply rather than to one field inside it.
4
- *
5
- * `applySerializedSizeBudget` bounds the sum of the payloads it is pointed at
6
- * and nothing else. That is what shipped as the fix for `get_git_diff`'s
7
- * missing aggregate cap, and re-running the same real 48-file branch diff
8
- * against it is what showed the fix was necessary but not sufficient: the
9
- * patch budget *was* enforced (13 files carried patch text where 44 had
10
- * before) and the call still failed outright, at 84,516 characters, because
11
- * the per-file status/additions/deletions rows for all 48 files, plus the
12
- * reply's own disclosures and envelope, sit outside that budget entirely.
13
- *
14
- * The lesson is the same one `size.ts` records one level down, and it has now
15
- * been learned twice: **a cap over one part of a reply bounds nothing about
16
- * the reply.** So this budget takes everything it does not own as
17
- * `overheadBytes` and shrinks in two stages, most-destructive last:
18
- *
19
- * 1. **Withhold payloads.** Prefix rule, exactly as `size.ts`: leading items
20
- * keep theirs, later ones are withheld carrying a named reason.
21
- * 2. **Drop trailing items** — only when the fully-withheld list *still* does
22
- * not fit, i.e. the metadata alone is over budget. Reported as a count, so
23
- * a caller re-requests narrowed rather than reading a silently short list
24
- * as a complete one.
25
- *
26
- * **Breadth before depth**: if stage 2 had to fire, no payload is restored for
27
- * the survivors even when bytes remain. Spending the last of a budget on patch
28
- * text while files are being dropped from the list is the wrong trade, and a
29
- * reply that is both short *and* deep is harder to act on than one that is
30
- * short and says so.
31
- */
1
+ /** `applyReplySizeBudget` bounds the whole serialized reply, not one field
2
+ * (unlike `size.ts`): `get_git_diff` still failed at 84,516 chars with
3
+ * patches capped, since per-file metadata sat outside that budget. Shrinks
4
+ * in stages — withhold payloads (prefix rule), then drop trailing items
5
+ * (reported as a count) — and never restores a payload once items drop. */
32
6
  export interface ReplySizeBudgetOptions<T> {
33
7
  /** The cap on `overheadBytes` plus the serialized size of every kept item. */
34
8
  readonly maxTotalBytes: number;
35
- /**
36
- * What the rest of the reply costs — envelope, headline, disclosures,
37
- * everything this budget does not own. Measured by the caller, not guessed:
38
- * an under-stated overhead is exactly how the first fix came in over the
39
- * ceiling anyway.
40
- */
9
+ /** What the rest of the reply costs (envelope, headline, disclosures) —
10
+ * measured by the caller, not guessed; under-stating it is how the first fix still failed. */
41
11
  readonly overheadBytes: number;
42
- /**
43
- * This item's own serialized cost in bytes, **including** whatever separator
44
- * it carries in the encoded list (a comma, for JSON). Called on both the
45
- * full and the withheld form of an item.
46
- */
12
+ /** This item's serialized cost in bytes, including its list separator
13
+ * (e.g. a JSON comma). Called on both the full and withheld form. */
47
14
  readonly sizeOf: (item: T) => number;
48
15
  /** True while this item still carries a payload the budget could withhold. */
49
16
  readonly hasPayload: (item: T) => boolean;
@@ -51,10 +18,8 @@ export interface ReplySizeBudgetOptions<T> {
51
18
  readonly withhold: (item: T, spentBytes: number) => T;
52
19
  }
53
20
  export interface ReplySizeBudgetResult<T> {
54
- /**
55
- * Order preserved. Shorter than the input exactly when `droppedCount > 0` —
56
- * see that field, and never without it being reported.
57
- */
21
+ /** Order preserved; shorter than input exactly when `droppedCount > 0`,
22
+ * never silently. */
58
23
  readonly items: readonly T[];
59
24
  /** How many kept items had a payload withheld by this budget. */
60
25
  readonly withheldCount: number;
@@ -1 +1 @@
1
- {"version":3,"file":"reply.d.ts","sourceRoot":"","sources":["../../src/budget/reply.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,MAAM,WAAW,sBAAsB,CAAC,CAAC;IACvC,8EAA8E;IAC9E,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B;;;;;OAKG;IACH,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B;;;;OAIG;IACH,QAAQ,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,CAAC;IACrC,8EAA8E;IAC9E,QAAQ,CAAC,UAAU,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,OAAO,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,iEAAiE;IACjE,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,gEAAgE;IAChE,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,mFAAmF;IACnF,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED,wBAAgB,oBAAoB,CAAC,CAAC,EACpC,KAAK,EAAE,SAAS,CAAC,EAAE,EACnB,OAAO,EAAE,sBAAsB,CAAC,CAAC,CAAC,GACjC,qBAAqB,CAAC,CAAC,CAAC,CA4C1B"}
@@ -1,41 +1,13 @@
1
- /**
2
- * `applyReplySizeBudget` — the same discipline as `size.ts`, applied to the
3
- * *whole* serialized reply rather than to one field inside it.
4
- *
5
- * `applySerializedSizeBudget` bounds the sum of the payloads it is pointed at
6
- * and nothing else. That is what shipped as the fix for `get_git_diff`'s
7
- * missing aggregate cap, and re-running the same real 48-file branch diff
8
- * against it is what showed the fix was necessary but not sufficient: the
9
- * patch budget *was* enforced (13 files carried patch text where 44 had
10
- * before) and the call still failed outright, at 84,516 characters, because
11
- * the per-file status/additions/deletions rows for all 48 files, plus the
12
- * reply's own disclosures and envelope, sit outside that budget entirely.
13
- *
14
- * The lesson is the same one `size.ts` records one level down, and it has now
15
- * been learned twice: **a cap over one part of a reply bounds nothing about
16
- * the reply.** So this budget takes everything it does not own as
17
- * `overheadBytes` and shrinks in two stages, most-destructive last:
18
- *
19
- * 1. **Withhold payloads.** Prefix rule, exactly as `size.ts`: leading items
20
- * keep theirs, later ones are withheld carrying a named reason.
21
- * 2. **Drop trailing items** — only when the fully-withheld list *still* does
22
- * not fit, i.e. the metadata alone is over budget. Reported as a count, so
23
- * a caller re-requests narrowed rather than reading a silently short list
24
- * as a complete one.
25
- *
26
- * **Breadth before depth**: if stage 2 had to fire, no payload is restored for
27
- * the survivors even when bytes remain. Spending the last of a budget on patch
28
- * text while files are being dropped from the list is the wrong trade, and a
29
- * reply that is both short *and* deep is harder to act on than one that is
30
- * short and says so.
31
- */
1
+ /** `applyReplySizeBudget` bounds the whole serialized reply, not one field
2
+ * (unlike `size.ts`): `get_git_diff` still failed at 84,516 chars with
3
+ * patches capped, since per-file metadata sat outside that budget. Shrinks
4
+ * in stages — withhold payloads (prefix rule), then drop trailing items
5
+ * (reported as a count) — and never restores a payload once items drop. */
32
6
  export function applyReplySizeBudget(items, options) {
33
7
  const { maxTotalBytes, overheadBytes, sizeOf, hasPayload, withhold } = options;
34
- // The withheld form's size is measured with `maxTotalBytes` as the spent
35
- // figure because the reason text carries that number and no figure this
36
- // budget can report is wider than the cap itself. Measuring with the widest
37
- // possible number can only over-estimate, and over-estimating is the safe
38
- // direction: the fitted reply lands under the ceiling, never over it.
8
+ // Withheld size measured with `maxTotalBytes` as the spent figure (the
9
+ // widest number this budget can report) — over-estimates, which is safe:
10
+ // the fitted reply lands under the ceiling, never over.
39
11
  const bare = items.map((item) => (hasPayload(item) ? withhold(item, maxTotalBytes) : item));
40
12
  const bareBytes = bare.map(sizeOf);
41
13
  let total = overheadBytes;
@@ -67,9 +39,8 @@ export function applyReplySizeBudget(items, options) {
67
39
  withheldCount -= 1;
68
40
  }
69
41
  }
70
- // Every item still withheld is rebuilt with the figure actually spent rather
71
- // than the cap-width estimate above. `total <= maxTotalBytes` here, so the
72
- // rebuilt reason is never wider than what was measured — the bound holds.
42
+ // Withheld items rebuilt with the actual spent figure, not the cap-width
43
+ // estimate — `total <= maxTotalBytes` here, so the bound holds.
73
44
  const finalItems = out.map((item, i) => item === items[i] || !hasPayload(items[i]) ? item : withhold(items[i], total));
74
45
  return { items: finalItems, withheldCount, droppedCount, totalBytes: total };
75
46
  }
@@ -1 +1 @@
1
- {"version":3,"file":"reply.js","sourceRoot":"","sources":["../../src/budget/reply.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAsCH,MAAM,UAAU,oBAAoB,CAClC,KAAmB,EACnB,OAAkC;IAElC,MAAM,EAAE,aAAa,EAAE,aAAa,EAAE,M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,CAAC,+BAA+B;YACzE,KAAK,IAAI,KAAK,CAAC;YACf,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;YACd,aAAa,IAAI,CAAC,CAAC;QACrB,CAAC;IACH,CAAC;IAED,yEAAyE;IACzE,gEAAgE;IAChE,MAAM,UAAU,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CACrC,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAE,EAAE,KAAK,CAAC,CAChF,CAAC;IAEF,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,YAAY,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC;AAC/E,CAAC"}
@@ -1,25 +1,6 @@
1
1
  /**
2
- * `applySerializedSizeBudget` — a total-bytes cap over a list of items whose
3
- * payloads dominate a reply's size.
4
- *
5
- * Written for `gitDiff`, which had two size controls and neither bounded the
6
- * sum: a per-file `maxPatchBytes` cap and a file-count `limit`. A real 48-file
7
- * branch diff, with 44 patches each *under* the 20,000-byte per-file cap,
8
- * summed to 229KB and hard-failed the call outright — the reply never reached
9
- * the caller at all. A per-item cap says nothing about a total, and a tool
10
- * that has only the first has no bound on its reply.
11
- *
12
- * Two deliberate shapes:
13
- *
14
- * - **Withhold, never drop.** An over-budget item stays in the list with its
15
- * stats and a named reason; only the payload goes. §4's empty-denominator
16
- * rule: a caller must never be unable to tell "this file did not change"
17
- * from "this file's patch did not fit."
18
- * - **Prefix, not greedy backfill.** Once the budget is exhausted, every
19
- * later item is withheld even if a small one would still fit. "The first N
20
- * kept their payloads" is a rule a caller can act on — re-request the rest
21
- * narrowed. A hole-filling subset is a rule no caller can predict, and it
22
- * makes the reply's contents depend on the sizes of unrelated items.
2
+ * Total-bytes cap over item payloads. Written for `gitDiff`: per-file caps alone let a real 48-file diff (44 patches each under the per-file cap) sum to 229KB and hard-fail outright.
3
+ * Withholds, never drops (§4 empty-denominator rule — "unchanged" vs "didn't fit" must stay distinguishable); prefix order, not greedy backfill, so results stay predictable.
23
4
  */
24
5
  export interface SerializedSizeBudgetOptions<T> {
25
6
  /** The cap on the sum of `sizeOf` across kept items. */
@@ -1 +1 @@
1
- {"version":3,"file":"size.d.ts","sourceRoot":"","sources":["../../src/budget/size.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,MAAM,WAAW,2BAA2B,CAAC,CAAC;IAC5C,wDAAwD;IACxD,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,mFAAmF;IACnF,QAAQ,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,CAAC;IACrC,oFAAoF;IACpF,QAAQ,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC,CAAC;CACvD;AAED,MAAM,WAAW,0BAA0B,CAAC,CAAC;IAC3C,wFAAwF;IACxF,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC,EAAE,CAAC;IAC7B,iDAAiD;IACjD,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,oFAAoF;IACpF,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,uFAAuF;IACvF,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;CAChC;AAED,wBAAgB,yBAAyB,CAAC,CAAC,EACzC,KAAK,EAAE,SAAS,CAAC,EAAE,EACnB,OAAO,EAAE,2BAA2B,CAAC,CAAC,CAAC,GACtC,0BAA0B,CAAC,CAAC,CAAC,CAiC/B"}
1
+ {"version":3,"file":"size.d.ts","sourceRoot":"","sources":["../../src/budget/size.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,2BAA2B,CAAC,CAAC;IAC5C,wDAAwD;IACxD,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,mFAAmF;IACnF,QAAQ,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,CAAC;IACrC,oFAAoF;IACpF,QAAQ,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC,CAAC;CACvD;AAED,MAAM,WAAW,0BAA0B,CAAC,CAAC;IAC3C,wFAAwF;IACxF,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC,EAAE,CAAC;IAC7B,iDAAiD;IACjD,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,oFAAoF;IACpF,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,uFAAuF;IACvF,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;CAChC;AAED,wBAAgB,yBAAyB,CAAC,CAAC,EACzC,KAAK,EAAE,SAAS,CAAC,EAAE,EACnB,OAAO,EAAE,2BAA2B,CAAC,CAAC,CAAC,GACtC,0BAA0B,CAAC,CAAC,CAAC,CA+B/B"}
@@ -1,25 +1,6 @@
1
1
  /**
2
- * `applySerializedSizeBudget` — a total-bytes cap over a list of items whose
3
- * payloads dominate a reply's size.
4
- *
5
- * Written for `gitDiff`, which had two size controls and neither bounded the
6
- * sum: a per-file `maxPatchBytes` cap and a file-count `limit`. A real 48-file
7
- * branch diff, with 44 patches each *under* the 20,000-byte per-file cap,
8
- * summed to 229KB and hard-failed the call outright — the reply never reached
9
- * the caller at all. A per-item cap says nothing about a total, and a tool
10
- * that has only the first has no bound on its reply.
11
- *
12
- * Two deliberate shapes:
13
- *
14
- * - **Withhold, never drop.** An over-budget item stays in the list with its
15
- * stats and a named reason; only the payload goes. §4's empty-denominator
16
- * rule: a caller must never be unable to tell "this file did not change"
17
- * from "this file's patch did not fit."
18
- * - **Prefix, not greedy backfill.** Once the budget is exhausted, every
19
- * later item is withheld even if a small one would still fit. "The first N
20
- * kept their payloads" is a rule a caller can act on — re-request the rest
21
- * narrowed. A hole-filling subset is a rule no caller can predict, and it
22
- * makes the reply's contents depend on the sizes of unrelated items.
2
+ * Total-bytes cap over item payloads. Written for `gitDiff`: per-file caps alone let a real 48-file diff (44 patches each under the per-file cap) sum to 229KB and hard-fail outright.
3
+ * Withholds, never drops (§4 empty-denominator rule — "unchanged" vs "didn't fit" must stay distinguishable); prefix order, not greedy backfill, so results stay predictable.
23
4
  */
24
5
  export function applySerializedSizeBudget(items, options) {
25
6
  const { maxTotalBytes, sizeOf, withhold } = options;
@@ -31,9 +12,7 @@ export function applySerializedSizeBudget(items, options) {
31
12
  for (const item of items) {
32
13
  const size = sizeOf(item);
33
14
  requestedBytes += size;
34
- // An item with no payload of its own costs nothing and is not this
35
- // budget's doing — its existing reason (binary, over the per-item cap)
36
- // must survive untouched.
15
+ // No payload: costs nothing, not this budget's doing — existing reason survives.
37
16
  if (size === 0) {
38
17
  out.push(item);
39
18
  continue;
@@ -1 +1 @@
1
- {"version":3,"file":"size.js","sourceRoot":"","sources":["../../src/budget/size.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAsBH,MAAM,UAAU,yBAAyB,CACvC,KAAmB,EACnB,OAAuC;IAEvC,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC;IAEpD,MAAM,GAAG,GAAQ,EAAE,CAAC;IACpB,IAAI,UAAU,GAAG,CAAC,CAAC;IACnB,IAAI,cAAc,GAAG,CAAC,CAAC;IACvB,IAAI,aAAa,GAAG,CAAC,CAAC;IACtB,IAAI,SAAS,GAAG,KAAK,CAAC;IAEtB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;QAC1B,cAAc,IAAI,IAAI,CAAC;QAEvB,mEAAmE;QACnE,uEAAuE;QACvE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AG,aAAa,EAAE,CAAC;YACnD,SAAS,GAAG,IAAI,CAAC;YACjB,aAAa,IAAI,CAAC,CAAC;YACnB,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC;YACrC,SAAS;QACX,CAAC;QAED,UAAU,IAAI,IAAI,CAAC;QACnB,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjB,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,UAAU,EAAE,cAAc,EAAE,aAAa,EAAE,CAAC;AACnE,CAAC"}
@@ -1,47 +1,7 @@
1
1
  /**
2
- * A check declares what it needs; the engine refuses to run it if no loaded
3
- * producer can supply that. DEC-112's implementation.
4
- *
5
- * ## The defect this makes impossible
6
- *
7
- * Three static checks read their graph side with `nodesOfType("FILE")`. **No
8
- * shipped adapter emits a `FILE` node** — all nine use `MODULE`. So the graph
9
- * half of every one of them was dead on every real repository, and 48 tests and
10
- * three precision gates stayed green throughout, because all four instruments
11
- * minted the node type the check wanted.
12
- *
13
- * The fact was *already known*. `packages/core/src/tiers/ladder.ts` records it in
14
- * a comment, written after the tier ladder required `FILE` and failed every
15
- * adapter at Tier C. A comment is not reachable from the place the next person
16
- * writes a check.
17
- *
18
- * **`capabilities()` has declared `nodeTypes` since the adapter contract was
19
- * written** (`packages/ir/src/contracts.ts`). Nobody asked it. This module is
20
- * the asking.
21
- *
22
- * ## Declared, not emitted — and the distinction is the whole design
23
- *
24
- * The precondition is checked against what loaded producers **declare**, never
25
- * against what a particular run emitted. Those are different failures and only
26
- * one of them is a bug:
27
- *
28
- * | situation | verdict | why |
29
- * | --- | --- | --- |
30
- * | no loaded producer *declares* the type | **refuse** | the check can never work here; running it produces an empty result indistinguishable from a clean repository |
31
- * | a producer declares it, this run emitted none | **run** | a legitimately empty answer, disclosed by the check in the ordinary way |
32
- *
33
- * Conflating them would make every quiet repository look like a wiring bug, and
34
- * DEC-070 already machine-checks that a declaration matches what the adapter
35
- * emitted, so a declaration is evidence rather than a promise.
36
- *
37
- * ## Refusal is `not_analysable`, not a crash
38
- *
39
- * §20.2's four categories are the point: *"we found nothing"* and *"we cannot
40
- * look"* are different sentences. A refusal names the missing type and the
41
- * producers that were loaded, so the answer a user sees is the second sentence
42
- * rather than an empty list. It does not throw, because a repository analysed
43
- * with only a Ruby adapter legitimately lacks most types — that is degradation,
44
- * which is disclosed, not a defect.
2
+ * DEC-112: a check declares what it needs; refused unless a loaded producer *declares* that
3
+ * (`capabilities()`), never what a run emitted (DEC-070). Motivated by three checks reading
4
+ * `nodesOfType("FILE")` though no adapter emits it (all nine use `MODULE`) — dead on every real repo.
45
5
  */
46
6
  import type { CapabilityMatrix, EdgeType, NodeType } from "@descryy/ir";
47
7
  export interface CapabilityRequirement {
@@ -49,17 +9,7 @@ export interface CapabilityRequirement {
49
9
  readonly check: string;
50
10
  readonly nodeTypes?: readonly NodeType[];
51
11
  readonly edgeTypes?: readonly EdgeType[];
52
- /**
53
- * `attrs` keys the check reads, such as `envReads`.
54
- *
55
- * **Declared for the reader, never enforced**, and that asymmetry is
56
- * deliberate: `capabilities()` describes node and edge types and says nothing
57
- * about `attrs`, because nothing above the IR may read `attrs` (rule 9). So
58
- * this cannot be machine-checked without extending the contract, and claiming
59
- * to check it would be worse than not checking it. It is carried so a refusal
60
- * can say *which attribute* is missing when the type is present and the data
61
- * is not.
62
- */
12
+ /** `attrs` keys the check reads. Declared for the reader, never enforced — nothing above the IR may read `attrs` (rule 9). */
63
13
  readonly attrKeys?: readonly string[];
64
14
  }
65
15
  export interface ProducerCapabilities {
@@ -75,22 +25,11 @@ export type PreconditionVerdict = {
75
25
  /** One sentence, in §20.2's *not analysable* voice. */
76
26
  readonly reason: string;
77
27
  };
78
- /**
79
- * Can this check run against the producers that are loaded?
80
- *
81
- * **An empty producer list refuses everything**, which is correct rather than
82
- * pedantic: a check run with no producers loaded returns an empty result, and an
83
- * empty result from no data reads exactly like an empty result from clean code.
84
- */
28
+ /** Can this check run against the loaded producers? An empty producer list refuses everything — deliberate, not pedantic. */
85
29
  export declare function checkPreconditions(requirement: CapabilityRequirement, producers: readonly ProducerCapabilities[]): PreconditionVerdict;
86
30
  /**
87
- * The same question asked the other way, for an audit rather than for a run:
88
- * **which declared requirements can no loaded producer satisfy?**
89
- *
90
- * DEC-112's rule is that at least one gate per capability must consume what a
91
- * shipped producer actually emits. This is how you find the ones that do not,
92
- * on purpose rather than by accident — five instances were found by accident,
93
- * and that is only the count so far.
31
+ * Same question the other way, for an audit: which requirements can no loaded producer satisfy?
32
+ * DEC-112 requires at least one gate per capability to consume what a producer actually emits.
94
33
  */
95
34
  export declare function auditRequirements(requirements: readonly CapabilityRequirement[], producers: readonly ProducerCapabilities[]): readonly {
96
35
  readonly requirement: CapabilityRequirement;
@@ -1 +1 @@
1
- {"version":3,"file":"preconditions.d.ts","sourceRoot":"","sources":["../../src/capabilities/preconditions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAExE,MAAM,WAAW,qBAAqB;IACpC,gFAAgF;IAChF,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,QAAQ,EAAE,CAAC;IACzC,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,QAAQ,EAAE,CAAC;IACzC;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACvC;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,YAAY,EAAE,gBAAgB,CAAC;CACzC;AAED,MAAM,MAAM,mBAAmB,GAC3B;IAAE,QAAQ,CAAC,SAAS,EAAE,IAAI,CAA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BAAmB,GAC3B;IAAE,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAA;CAAE,GAC5B;IACE,QAAQ,CAAC,SAAS,EAAE,KAAK,CAAC;IAC1B,QAAQ,CAAC,gBAAgB,EAAE,SAAS,QAAQ,EAAE,CAAC;IAC/C,QAAQ,CAAC,gBAAgB,EAAE,SAAS,QAAQ,EAAE,CAAC;IAC/C,uDAAuD;IACvD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB,CAAC;AAEN,6HAA6H;AAC7H,wBAAgB,kBAAkB,CAChC,WAAW,EAAE,qBAAqB,EAClC,SAAS,EAAE,SAAS,oBAAoB,EAAE,GACzC,mBAAmB,CA2BrB;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,YAAY,EAAE,SAAS,qBAAqB,EAAE,EAC9C,SAAS,EAAE,SAAS,oBAAoB,EAAE,GACzC,SAAS;IAAE,QAAQ,CAAC,WAAW,EAAE,qBAAqB,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,mBAAmB,CAAA;CAAE,EAAE,CAKnG"}
@@ -1,55 +1,9 @@
1
1
  /**
2
- * A check declares what it needs; the engine refuses to run it if no loaded
3
- * producer can supply that. DEC-112's implementation.
4
- *
5
- * ## The defect this makes impossible
6
- *
7
- * Three static checks read their graph side with `nodesOfType("FILE")`. **No
8
- * shipped adapter emits a `FILE` node** — all nine use `MODULE`. So the graph
9
- * half of every one of them was dead on every real repository, and 48 tests and
10
- * three precision gates stayed green throughout, because all four instruments
11
- * minted the node type the check wanted.
12
- *
13
- * The fact was *already known*. `packages/core/src/tiers/ladder.ts` records it in
14
- * a comment, written after the tier ladder required `FILE` and failed every
15
- * adapter at Tier C. A comment is not reachable from the place the next person
16
- * writes a check.
17
- *
18
- * **`capabilities()` has declared `nodeTypes` since the adapter contract was
19
- * written** (`packages/ir/src/contracts.ts`). Nobody asked it. This module is
20
- * the asking.
21
- *
22
- * ## Declared, not emitted — and the distinction is the whole design
23
- *
24
- * The precondition is checked against what loaded producers **declare**, never
25
- * against what a particular run emitted. Those are different failures and only
26
- * one of them is a bug:
27
- *
28
- * | situation | verdict | why |
29
- * | --- | --- | --- |
30
- * | no loaded producer *declares* the type | **refuse** | the check can never work here; running it produces an empty result indistinguishable from a clean repository |
31
- * | a producer declares it, this run emitted none | **run** | a legitimately empty answer, disclosed by the check in the ordinary way |
32
- *
33
- * Conflating them would make every quiet repository look like a wiring bug, and
34
- * DEC-070 already machine-checks that a declaration matches what the adapter
35
- * emitted, so a declaration is evidence rather than a promise.
36
- *
37
- * ## Refusal is `not_analysable`, not a crash
38
- *
39
- * §20.2's four categories are the point: *"we found nothing"* and *"we cannot
40
- * look"* are different sentences. A refusal names the missing type and the
41
- * producers that were loaded, so the answer a user sees is the second sentence
42
- * rather than an empty list. It does not throw, because a repository analysed
43
- * with only a Ruby adapter legitimately lacks most types — that is degradation,
44
- * which is disclosed, not a defect.
45
- */
46
- /**
47
- * Can this check run against the producers that are loaded?
48
- *
49
- * **An empty producer list refuses everything**, which is correct rather than
50
- * pedantic: a check run with no producers loaded returns an empty result, and an
51
- * empty result from no data reads exactly like an empty result from clean code.
2
+ * DEC-112: a check declares what it needs; refused unless a loaded producer *declares* that
3
+ * (`capabilities()`), never what a run emitted (DEC-070). Motivated by three checks reading
4
+ * `nodesOfType("FILE")` though no adapter emits it (all nine use `MODULE`) — dead on every real repo.
52
5
  */
6
+ /** Can this check run against the loaded producers? An empty producer list refuses everything — deliberate, not pedantic. */
53
7
  export function checkPreconditions(requirement, producers) {
54
8
  const declaredNodes = new Set();
55
9
  const declaredEdges = new Set();
@@ -77,13 +31,8 @@ export function checkPreconditions(requirement, producers) {
77
31
  };
78
32
  }
79
33
  /**
80
- * The same question asked the other way, for an audit rather than for a run:
81
- * **which declared requirements can no loaded producer satisfy?**
82
- *
83
- * DEC-112's rule is that at least one gate per capability must consume what a
84
- * shipped producer actually emits. This is how you find the ones that do not,
85
- * on purpose rather than by accident — five instances were found by accident,
86
- * and that is only the count so far.
34
+ * Same question the other way, for an audit: which requirements can no loaded producer satisfy?
35
+ * DEC-112 requires at least one gate per capability to consume what a producer actually emits.
87
36
  */
88
37
  export function auditRequirements(requirements, producers) {
89
38
  return requirements.map((requirement) => ({
@@ -1 +1 @@
1
- {"version":3,"file":"preconditions.js","sourceRoot":"","sources":["../../src/capabilities/preconditions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAsCH;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAChC,WAAkC,EAClC,SAA0C;IAE1C,MAAM,aAAa,GAAG,IAAI,GAAG,EAAY,CAAC;IAC1C,MAAM,aAAa,GAAG,IAAI,GAAG,EAAY,CAAC;IAC1C,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE,CAAC;QACjC,KAAK,MAAM,IAAI,IAAI,QAAQ,CAAC,YAAY,CAAC,SAAS;YAAE,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAC5E,KAAK,MAAM,IAAI,IAAI,QAAQ,CAAC,YAAY,CAAC,SAAS;YAAE,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC9E,CAAC;IAED,MAAM,gBAAgB,GAAG,CAAC,WAAW,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5F,MAAM,gBAAgB,GAAG,CAAC,WAAW,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5F,IAAI,gBAAgB,CAAC,MAAM,KAAK,CAAC,IAAI,gBAAgB,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;IAE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ACxC,WAAW;QACX,OAAO,EAAE,kBAAkB,CAAC,WAAW,EAAE,SAAS,CAAC;KACpD,CAAC,CAAC,CAAC;AACN,CAAC"}
@@ -29,22 +29,34 @@
29
29
  * | consumer | the `USES_API` edge | `attrs.requestType` / `attrs.responseType` — a node id — or `attrs.requestFields` / `attrs.responseFields`, a list of names |
30
30
  * | provider | the route's `USES_TYPE` edge | `attrs.roles`: a list containing `"request"`, `"response"`, or both |
31
31
  *
32
- * **The consumer half does not exist in any adapter yet**, and the report says so
33
- * by name rather than reporting "no mismatches" — the attribute and the edge, so
34
- * it reads as a task rather than a shrug:
32
+ * **Both halves are supplied now, and this paragraph said otherwise for longer
33
+ * than it was true.** It read *"the consumer half does not exist in any
34
+ * adapter yet"* while a language adapter was already attaching
35
+ * `attrs.requestType` / `attrs.responseType` to `USES_API` from a type checker,
36
+ * and an audit reading this file concluded the whole shape check was unfed. A blocker written in prose that no test checks goes stale silently and
37
+ * is then quoted back as a reason not to build on what already works.
35
38
  *
36
- * 1. `USES_API` currently carries `attrs.client` and nothing about shape.
37
- * 2. A route's `USES_TYPE` edges carry no direction, so a request DTO and a
38
- * response DTO are indistinguishable. Comparing a caller's response
39
- * expectation against a request schema would produce confident nonsense, so
40
- * an unroled DTO is refused rather than assumed — even when a route names
41
- * exactly one, because "one schema" does not say which direction it travels.
42
- * **`adapter-openapi` now supplies `attrs.roles`**, so the provider half of
43
- * this is closed; the consumer half is not.
39
+ * What each producer supplies today:
40
+ *
41
+ * 1. The consumer half is written at R3 wherever a producer has a type checker,
42
+ * with `attrs.shapeResolution` alongside it so a shape claim is not capped
43
+ * by the weaker path-matching evidence on the same edge.
44
+ * 2. The provider half is written by a contract-format producer. A route's
45
+ * `USES_TYPE` edges
46
+ * carry no direction without it, so a request DTO and a response DTO are
47
+ * indistinguishable. Comparing a caller's response expectation against a
48
+ * request schema would produce confident nonsense, so an unroled DTO is
49
+ * still refused rather than assumed — even when a route names exactly one,
50
+ * because "one schema" does not say which direction it travels.
51
+ *
52
+ * That is one producer on each side, not every adapter. The blockers this
53
+ * check reports name the attribute and the edge, so a gap in a third producer
54
+ * reads as a task rather than a shrug — and the count in `shapes.blockers` is
55
+ * what to trust about coverage, not this comment.
44
56
  */
45
57
  import type { IRNode, ResolutionLevel } from "@descryy/ir";
46
58
  import type { AdjacencyProvider, QueryResult } from "../query/provider.ts";
47
- import { type ContractReport, type OrphanOptions } from "./orphans.ts";
59
+ import { type ContractClaim, type ContractReport, type OrphanOptions } from "./orphans.ts";
48
60
  import { type ShapeDifference } from "./shapes.ts";
49
61
  export type ShapeDirection = "request" | "response";
50
62
  export interface ShapeMismatch {
@@ -56,6 +68,8 @@ export interface ShapeMismatch {
56
68
  readonly writer: IRNode;
57
69
  readonly differences: readonly ShapeDifference[];
58
70
  readonly resolution: ResolutionLevel;
71
+ /** Always `"defect"` — see `ContractClaim`. Carried on the finding rather than assumed by its caller. */
72
+ readonly claim: ContractClaim;
59
73
  }
60
74
  export interface ShapeCheck {
61
75
  /** True when at least one endpoint had a comparable shape on both sides. */
@@ -1 +1 @@
1
- {"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../../src/contracts/engine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE3D,OAAO,KAAK,EAAE,iBAAiB,EAAc,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEvF,OAAO,EAGL,KAAK,cAAc,EACnB,KAAK,aAAa,EACnB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAwC,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC;AAEzF,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,UAAU,CAAC;AAEpD,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,cAAc,C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AAK,EAAE,cAAc,CAAC;IAC/B,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;CAC7B;AAED,MAAM,WAAW,eAAgB,SAAQ,aAAa;IACpD,8DAA8D;IAC9D,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;CAC9B;AAqGD,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,iBAAiB,EAC3B,OAAO,GAAE,eAAoB,GAC5B,WAAW,CAAC,aAAa,CAAC,CA6L5B"}
@@ -29,18 +29,30 @@
29
29
  * | consumer | the `USES_API` edge | `attrs.requestType` / `attrs.responseType` — a node id — or `attrs.requestFields` / `attrs.responseFields`, a list of names |
30
30
  * | provider | the route's `USES_TYPE` edge | `attrs.roles`: a list containing `"request"`, `"response"`, or both |
31
31
  *
32
- * **The consumer half does not exist in any adapter yet**, and the report says so
33
- * by name rather than reporting "no mismatches" — the attribute and the edge, so
34
- * it reads as a task rather than a shrug:
32
+ * **Both halves are supplied now, and this paragraph said otherwise for longer
33
+ * than it was true.** It read *"the consumer half does not exist in any
34
+ * adapter yet"* while a language adapter was already attaching
35
+ * `attrs.requestType` / `attrs.responseType` to `USES_API` from a type checker,
36
+ * and an audit reading this file concluded the whole shape check was unfed. A blocker written in prose that no test checks goes stale silently and
37
+ * is then quoted back as a reason not to build on what already works.
35
38
  *
36
- * 1. `USES_API` currently carries `attrs.client` and nothing about shape.
37
- * 2. A route's `USES_TYPE` edges carry no direction, so a request DTO and a
38
- * response DTO are indistinguishable. Comparing a caller's response
39
- * expectation against a request schema would produce confident nonsense, so
40
- * an unroled DTO is refused rather than assumed — even when a route names
41
- * exactly one, because "one schema" does not say which direction it travels.
42
- * **`adapter-openapi` now supplies `attrs.roles`**, so the provider half of
43
- * this is closed; the consumer half is not.
39
+ * What each producer supplies today:
40
+ *
41
+ * 1. The consumer half is written at R3 wherever a producer has a type checker,
42
+ * with `attrs.shapeResolution` alongside it so a shape claim is not capped
43
+ * by the weaker path-matching evidence on the same edge.
44
+ * 2. The provider half is written by a contract-format producer. A route's
45
+ * `USES_TYPE` edges
46
+ * carry no direction without it, so a request DTO and a response DTO are
47
+ * indistinguishable. Comparing a caller's response expectation against a
48
+ * request schema would produce confident nonsense, so an unroled DTO is
49
+ * still refused rather than assumed — even when a route names exactly one,
50
+ * because "one schema" does not say which direction it travels.
51
+ *
52
+ * That is one producer on each side, not every adapter. The blockers this
53
+ * check reports name the attribute and the edge, so a gap in a third producer
54
+ * reads as a task rather than a shrug — and the count in `shapes.blockers` is
55
+ * what to trust about coverage, not this comment.
44
56
  */
45
57
  import { createResolutionFloor } from "../query/resolution-floor.js";
46
58
  import { findContractOrphans, PATH_LEVEL_ONLY_NOTE, } from "./orphans.js";
@@ -218,6 +230,11 @@ export function checkContracts(provider, options = {}) {
218
230
  writer: writer.source,
219
231
  differences: comparison.differences,
220
232
  resolution,
233
+ // Always a defect (UAT round 3, Suggestion 6 — see ContractClaim): a
234
+ // field one side reads that the other's declared shape does not
235
+ // send is provable from this graph and a type checker alone, with
236
+ // no external system that could explain it away.
237
+ claim: "defect",
221
238
  });
222
239
  }
223
240
  }
@@ -1 +1 @@
1
- {"version":3,"file":"engine.js","sourceRoot":"","sources":["../../src/contracts/engine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AAKH,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EACL,mBAAmB,EACnB,oBAAoB,GAGrB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,aAAa,EAAE,SAAS,EAAoC,MAAM,aAAa,CAAC;AA+CzF,qEAAqE;AACrE,SAAS,cAAc,CACrB,QAA2B,EAC3B,MAAc,EACd,SAAkC;IAElC,MAAM,GAAG,GAA2C,EAAE,CAAC;IAEvD,KAAK,MAAM,SAAS,IAAI,CAAC,SAAS,EAAE,UAAU,CAAU,EAAE,CAAC;QACzD,MAAM,KAAK,GAAG,GAAG,SAAS,MAA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CAAC,KAAK,CAAC,eAAe,EAChC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CACT,CAAC;IACrB,MAAM,KAAK,GAAe,EAAE,GAAG,QAAQ,CAAC,SAAS,EAAE,EAAE,eAAe,EAAE,CAAC;IACvE,OAAO;QACL,IAAI,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE;QACvB,KAAK;QACL,SAAS,EAAE,UAAU,CAAC,SAAS;QAC/B,KAAK,EAAE,CAAC,GAAG,KAAK,CAAC;KAClB,CAAC;AACJ,CAAC"}
@@ -3,7 +3,7 @@ export type { EndpointKey, NearMiss, NearMissKind } from "./paths.ts";
3
3
  export { readShape, compareShapes } from "./shapes.ts";
4
4
  export type { Shape, ShapeField, ShapeComparison, ShapeDifference, ShapeDifferenceKind, } from "./shapes.ts";
5
5
  export { findContractOrphans } from "./orphans.ts";
6
- export type { ContractFinding, ContractFindingKind, ContractReport, OrphanOptions, } from "./orphans.ts";
6
+ export type { ContractClaim, ContractFinding, ContractFindingKind, ContractReport, OrphanOptions, } from "./orphans.ts";
7
7
  export { checkContracts } from "./engine.ts";
8
8
  export type { ContractCheck, ContractOptions, ShapeCheck, ShapeDirection, ShapeMismatch, } from "./engine.ts";
9
9
  //# sourceMappingURL=index.d.ts.map