@hawkeyexl/manni 4.7.0 → 4.8.1

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 (172) hide show
  1. package/README.md +1 -1
  2. package/dist/{batch-U6S2JUUN.js → batch-QMHYWGUA.js} +12 -12
  3. package/dist/{build-4RN6WBCP.js → build-ZGA3O3P4.js} +9 -9
  4. package/dist/{calibrate-6VIZYR4L.js → calibrate-KBMFGKP3.js} +13 -13
  5. package/dist/{capture-DP3NXAZE.js → capture-C46UXFRK.js} +12 -12
  6. package/dist/{check-IWHUPAZM.js → check-CORYIW76.js} +28 -28
  7. package/dist/check-CORYIW76.js.map +1 -0
  8. package/dist/{check-STHXZIZO.js → check-LLQ6PJV3.js} +9 -9
  9. package/dist/{check-ERVNGKLC.js → check-UMI5ACCE.js} +10 -10
  10. package/dist/{chunk-IOL74S4J.js → chunk-3FG2UU3H.js} +4 -4
  11. package/dist/{chunk-K52CS4KT.js → chunk-4VQBHTGA.js} +5 -5
  12. package/dist/{chunk-MIBWI5H7.js → chunk-5LAKRYXU.js} +3 -3
  13. package/dist/{chunk-MSMB6XOS.js → chunk-6HMLYFEU.js} +2 -2
  14. package/dist/{chunk-4Z2MN5FR.js → chunk-6MNOMHFI.js} +10 -10
  15. package/dist/{chunk-UZKQSWHJ.js → chunk-6QBJHRFC.js} +2 -2
  16. package/dist/{chunk-B5CMM57M.js → chunk-6ZR24A4S.js} +2 -2
  17. package/dist/{chunk-WTEILBKC.js → chunk-77L5GNVO.js} +2 -2
  18. package/dist/{chunk-D6RO54QD.js → chunk-7LC4YJJ3.js} +4 -4
  19. package/dist/chunk-7LC4YJJ3.js.map +1 -0
  20. package/dist/{chunk-6URSCTTX.js → chunk-AO66Q66S.js} +2 -2
  21. package/dist/{chunk-NIFEEIGQ.js → chunk-BYVH727K.js} +2 -2
  22. package/dist/{chunk-PNX43DYW.js → chunk-C2JPBQCJ.js} +21 -3
  23. package/dist/{chunk-PNX43DYW.js.map → chunk-C2JPBQCJ.js.map} +1 -1
  24. package/dist/{chunk-GCC52YZD.js → chunk-F734HIHT.js} +3 -3
  25. package/dist/{chunk-CEVU3GFF.js → chunk-FEALEYSE.js} +4 -4
  26. package/dist/{chunk-QQNPVW3J.js → chunk-GQBVZS5G.js} +6 -6
  27. package/dist/{chunk-D2LBN44V.js → chunk-HNMXL2OE.js} +3 -3
  28. package/dist/chunk-HNMXL2OE.js.map +1 -0
  29. package/dist/{chunk-NZ6TNSCU.js → chunk-HWNSIEZK.js} +5 -5
  30. package/dist/{chunk-LDKIIZDW.js → chunk-K43X5VDR.js} +5 -5
  31. package/dist/{chunk-TPVOOTMN.js → chunk-KPXOJMQ6.js} +16 -13
  32. package/dist/chunk-KPXOJMQ6.js.map +1 -0
  33. package/dist/{chunk-ZPP75QWG.js → chunk-LAU6SVTJ.js} +8 -8
  34. package/dist/{chunk-ZNE25EAR.js → chunk-LF6FOF6U.js} +4 -4
  35. package/dist/{chunk-YSCZL4U5.js → chunk-N7J5C35C.js} +2 -2
  36. package/dist/{chunk-YSCZL4U5.js.map → chunk-N7J5C35C.js.map} +1 -1
  37. package/dist/{chunk-6VDBP5UV.js → chunk-NB4ILZMQ.js} +6 -6
  38. package/dist/{chunk-BWCWTHYS.js → chunk-NGTVREIH.js} +4 -4
  39. package/dist/chunk-NGTVREIH.js.map +1 -0
  40. package/dist/{chunk-AMEILOVV.js → chunk-NNFSIRVE.js} +4 -4
  41. package/dist/{chunk-LXJEAV2V.js → chunk-PO5W6JAP.js} +5 -5
  42. package/dist/{chunk-OOEMKOX6.js → chunk-POGYWOJ2.js} +3 -3
  43. package/dist/{chunk-LONRQBGV.js → chunk-Q3GFZJTY.js} +4 -4
  44. package/dist/{chunk-ZKAKA54B.js → chunk-RCS5YFY2.js} +2 -2
  45. package/dist/{chunk-C2TJG5KV.js → chunk-SV6UEQCU.js} +4 -4
  46. package/dist/{chunk-2ZWTSRE5.js → chunk-SXODK43S.js} +4 -4
  47. package/dist/{chunk-7XZ6INKO.js → chunk-UWY4B2PM.js} +4 -4
  48. package/dist/{chunk-PAOVVHQX.js → chunk-VD3EQSBI.js} +2 -2
  49. package/dist/{chunk-CI55ABCK.js → chunk-VQK4VHLF.js} +8 -8
  50. package/dist/chunk-VQK4VHLF.js.map +1 -0
  51. package/dist/{chunk-IZBBXKMJ.js → chunk-VSOYZ7QH.js} +3 -3
  52. package/dist/{chunk-CR3HZERW.js → chunk-WBETAXO2.js} +4 -4
  53. package/dist/{chunk-5UB47BEV.js → chunk-WT6HMEEF.js} +2 -2
  54. package/dist/{chunk-IIFADWWI.js → chunk-WUFP4V7B.js} +3 -3
  55. package/dist/{chunk-7EL5LLKD.js → chunk-WUXD6VBD.js} +2 -2
  56. package/dist/{chunk-ZKCNPKUO.js → chunk-XDS3KQCK.js} +3 -3
  57. package/dist/{chunk-5VWDIWOH.js → chunk-YVVMC4SZ.js} +3 -3
  58. package/dist/{chunk-ZEXGGGLW.js → chunk-Z27GYQOY.js} +7 -7
  59. package/dist/{chunk-QP5X66TO.js → chunk-ZIGIJBXG.js} +9 -9
  60. package/dist/{cli-37SRAYNE.js → cli-4B5RWL7P.js} +11 -11
  61. package/dist/{cli-IRHPPUFJ.js → cli-5AML7QR2.js} +10 -10
  62. package/dist/{cli-NM6FZ54R.js → cli-I4GBPLRM.js} +2 -2
  63. package/dist/{cli-YL3IDR52.js → cli-MNNOXWYU.js} +7 -7
  64. package/dist/{cli-XIODOEUG.js → cli-QR3ZQZA4.js} +20 -20
  65. package/dist/{cli-MTDGQIIV.js → cli-SBJY2NQH.js} +14 -14
  66. package/dist/{cli-ZQUJYQBA.js → cli-UB5W75GJ.js} +11 -11
  67. package/dist/{cli-KIID535Y.js → cli-WWDARAWS.js} +13 -13
  68. package/dist/{cli-HXWYUKGJ.js → cli-XIQKPNA7.js} +35 -34
  69. package/dist/cli-XIQKPNA7.js.map +1 -0
  70. package/dist/cli.js +11 -11
  71. package/dist/{config-O6UBGEDK.js → config-YWSNBFEE.js} +3 -3
  72. package/dist/docmeta.js +6 -6
  73. package/dist/{github-UCYLM3DR.js → github-TIZ3ZR3D.js} +9 -9
  74. package/dist/{github-VEJFO6JJ.js → github-WKOJRW7P.js} +11 -11
  75. package/dist/index.d.ts +16 -6
  76. package/dist/index.js +32 -32
  77. package/dist/{json-6F52FSXZ.js → json-4FUOZ3XX.js} +9 -9
  78. package/dist/{lint-X2GNINK6.js → lint-7VQFESHK.js} +9 -9
  79. package/dist/{list-DP3O3CWB.js → list-7U2MBDIM.js} +9 -9
  80. package/dist/{list-P77RZFZF.js → list-W6EUAOBV.js} +9 -9
  81. package/dist/{page-WQCMBNRD.js → page-WZLBKSCD.js} +8 -8
  82. package/dist/{prepare-52QOK7M4.js → prepare-FPEWAHJH.js} +17 -17
  83. package/dist/prepare-FPEWAHJH.js.map +1 -0
  84. package/dist/{pretty-H4DQREMW.js → pretty-7M4X4TCY.js} +9 -9
  85. package/dist/{pretty-5MMMNSWF.js → pretty-CUCMQU5R.js} +10 -10
  86. package/dist/{provider-AMGRDY6V.js → provider-527CO4DM.js} +2 -2
  87. package/dist/{release-CTYRHZL4.js → release-3D5PK6M7.js} +2 -2
  88. package/dist/release-3D5PK6M7.js.map +1 -0
  89. package/dist/{reporters-SU3VUKKX.js → reporters-DQVSDXV6.js} +4 -4
  90. package/dist/{reporters-WIHBEMPG.js → reporters-KYJE54JS.js} +8 -8
  91. package/dist/{run-L2DWJ26K.js → run-ABGXGOGQ.js} +9 -9
  92. package/dist/{conformance-ALLPNGEQ.js → runtime-7QE3DW6S.js} +2 -2
  93. package/dist/{term-PJIJQZNF.js → term-HTIG3YDC.js} +13 -13
  94. package/dist/{validate-XCDSPURG.js → validate-HWNU3MDY.js} +4 -4
  95. package/package.json +1 -1
  96. package/plugin/manni/.claude-plugin/plugin.json +1 -1
  97. package/dist/check-IWHUPAZM.js.map +0 -1
  98. package/dist/chunk-BWCWTHYS.js.map +0 -1
  99. package/dist/chunk-CI55ABCK.js.map +0 -1
  100. package/dist/chunk-D2LBN44V.js.map +0 -1
  101. package/dist/chunk-D6RO54QD.js.map +0 -1
  102. package/dist/chunk-TPVOOTMN.js.map +0 -1
  103. package/dist/cli-HXWYUKGJ.js.map +0 -1
  104. package/dist/prepare-52QOK7M4.js.map +0 -1
  105. package/dist/release-CTYRHZL4.js.map +0 -1
  106. /package/dist/{batch-U6S2JUUN.js.map → batch-QMHYWGUA.js.map} +0 -0
  107. /package/dist/{build-4RN6WBCP.js.map → build-ZGA3O3P4.js.map} +0 -0
  108. /package/dist/{calibrate-6VIZYR4L.js.map → calibrate-KBMFGKP3.js.map} +0 -0
  109. /package/dist/{capture-DP3NXAZE.js.map → capture-C46UXFRK.js.map} +0 -0
  110. /package/dist/{check-ERVNGKLC.js.map → check-LLQ6PJV3.js.map} +0 -0
  111. /package/dist/{check-STHXZIZO.js.map → check-UMI5ACCE.js.map} +0 -0
  112. /package/dist/{chunk-IOL74S4J.js.map → chunk-3FG2UU3H.js.map} +0 -0
  113. /package/dist/{chunk-K52CS4KT.js.map → chunk-4VQBHTGA.js.map} +0 -0
  114. /package/dist/{chunk-MIBWI5H7.js.map → chunk-5LAKRYXU.js.map} +0 -0
  115. /package/dist/{chunk-MSMB6XOS.js.map → chunk-6HMLYFEU.js.map} +0 -0
  116. /package/dist/{chunk-4Z2MN5FR.js.map → chunk-6MNOMHFI.js.map} +0 -0
  117. /package/dist/{chunk-UZKQSWHJ.js.map → chunk-6QBJHRFC.js.map} +0 -0
  118. /package/dist/{chunk-B5CMM57M.js.map → chunk-6ZR24A4S.js.map} +0 -0
  119. /package/dist/{chunk-WTEILBKC.js.map → chunk-77L5GNVO.js.map} +0 -0
  120. /package/dist/{chunk-6URSCTTX.js.map → chunk-AO66Q66S.js.map} +0 -0
  121. /package/dist/{chunk-NIFEEIGQ.js.map → chunk-BYVH727K.js.map} +0 -0
  122. /package/dist/{chunk-GCC52YZD.js.map → chunk-F734HIHT.js.map} +0 -0
  123. /package/dist/{chunk-CEVU3GFF.js.map → chunk-FEALEYSE.js.map} +0 -0
  124. /package/dist/{chunk-QQNPVW3J.js.map → chunk-GQBVZS5G.js.map} +0 -0
  125. /package/dist/{chunk-NZ6TNSCU.js.map → chunk-HWNSIEZK.js.map} +0 -0
  126. /package/dist/{chunk-LDKIIZDW.js.map → chunk-K43X5VDR.js.map} +0 -0
  127. /package/dist/{chunk-ZPP75QWG.js.map → chunk-LAU6SVTJ.js.map} +0 -0
  128. /package/dist/{chunk-ZNE25EAR.js.map → chunk-LF6FOF6U.js.map} +0 -0
  129. /package/dist/{chunk-6VDBP5UV.js.map → chunk-NB4ILZMQ.js.map} +0 -0
  130. /package/dist/{chunk-AMEILOVV.js.map → chunk-NNFSIRVE.js.map} +0 -0
  131. /package/dist/{chunk-LXJEAV2V.js.map → chunk-PO5W6JAP.js.map} +0 -0
  132. /package/dist/{chunk-OOEMKOX6.js.map → chunk-POGYWOJ2.js.map} +0 -0
  133. /package/dist/{chunk-LONRQBGV.js.map → chunk-Q3GFZJTY.js.map} +0 -0
  134. /package/dist/{chunk-ZKAKA54B.js.map → chunk-RCS5YFY2.js.map} +0 -0
  135. /package/dist/{chunk-C2TJG5KV.js.map → chunk-SV6UEQCU.js.map} +0 -0
  136. /package/dist/{chunk-2ZWTSRE5.js.map → chunk-SXODK43S.js.map} +0 -0
  137. /package/dist/{chunk-7XZ6INKO.js.map → chunk-UWY4B2PM.js.map} +0 -0
  138. /package/dist/{chunk-PAOVVHQX.js.map → chunk-VD3EQSBI.js.map} +0 -0
  139. /package/dist/{chunk-IZBBXKMJ.js.map → chunk-VSOYZ7QH.js.map} +0 -0
  140. /package/dist/{chunk-CR3HZERW.js.map → chunk-WBETAXO2.js.map} +0 -0
  141. /package/dist/{chunk-5UB47BEV.js.map → chunk-WT6HMEEF.js.map} +0 -0
  142. /package/dist/{chunk-IIFADWWI.js.map → chunk-WUFP4V7B.js.map} +0 -0
  143. /package/dist/{chunk-7EL5LLKD.js.map → chunk-WUXD6VBD.js.map} +0 -0
  144. /package/dist/{chunk-ZKCNPKUO.js.map → chunk-XDS3KQCK.js.map} +0 -0
  145. /package/dist/{chunk-5VWDIWOH.js.map → chunk-YVVMC4SZ.js.map} +0 -0
  146. /package/dist/{chunk-ZEXGGGLW.js.map → chunk-Z27GYQOY.js.map} +0 -0
  147. /package/dist/{chunk-QP5X66TO.js.map → chunk-ZIGIJBXG.js.map} +0 -0
  148. /package/dist/{cli-37SRAYNE.js.map → cli-4B5RWL7P.js.map} +0 -0
  149. /package/dist/{cli-IRHPPUFJ.js.map → cli-5AML7QR2.js.map} +0 -0
  150. /package/dist/{cli-NM6FZ54R.js.map → cli-I4GBPLRM.js.map} +0 -0
  151. /package/dist/{cli-YL3IDR52.js.map → cli-MNNOXWYU.js.map} +0 -0
  152. /package/dist/{cli-XIODOEUG.js.map → cli-QR3ZQZA4.js.map} +0 -0
  153. /package/dist/{cli-MTDGQIIV.js.map → cli-SBJY2NQH.js.map} +0 -0
  154. /package/dist/{cli-ZQUJYQBA.js.map → cli-UB5W75GJ.js.map} +0 -0
  155. /package/dist/{cli-KIID535Y.js.map → cli-WWDARAWS.js.map} +0 -0
  156. /package/dist/{config-O6UBGEDK.js.map → config-YWSNBFEE.js.map} +0 -0
  157. /package/dist/{conformance-ALLPNGEQ.js.map → github-TIZ3ZR3D.js.map} +0 -0
  158. /package/dist/{github-UCYLM3DR.js.map → github-WKOJRW7P.js.map} +0 -0
  159. /package/dist/{github-VEJFO6JJ.js.map → json-4FUOZ3XX.js.map} +0 -0
  160. /package/dist/{json-6F52FSXZ.js.map → lint-7VQFESHK.js.map} +0 -0
  161. /package/dist/{lint-X2GNINK6.js.map → list-7U2MBDIM.js.map} +0 -0
  162. /package/dist/{list-DP3O3CWB.js.map → list-W6EUAOBV.js.map} +0 -0
  163. /package/dist/{list-P77RZFZF.js.map → page-WZLBKSCD.js.map} +0 -0
  164. /package/dist/{page-WQCMBNRD.js.map → pretty-7M4X4TCY.js.map} +0 -0
  165. /package/dist/{pretty-5MMMNSWF.js.map → pretty-CUCMQU5R.js.map} +0 -0
  166. /package/dist/{pretty-H4DQREMW.js.map → provider-527CO4DM.js.map} +0 -0
  167. /package/dist/{provider-AMGRDY6V.js.map → reporters-DQVSDXV6.js.map} +0 -0
  168. /package/dist/{reporters-SU3VUKKX.js.map → reporters-KYJE54JS.js.map} +0 -0
  169. /package/dist/{reporters-WIHBEMPG.js.map → run-ABGXGOGQ.js.map} +0 -0
  170. /package/dist/{run-L2DWJ26K.js.map → runtime-7QE3DW6S.js.map} +0 -0
  171. /package/dist/{term-PJIJQZNF.js.map → term-HTIG3YDC.js.map} +0 -0
  172. /package/dist/{validate-XCDSPURG.js.map → validate-HWNU3MDY.js.map} +0 -0
@@ -15,7 +15,7 @@ import {
15
15
  paragraphAfter,
16
16
  parseSrc,
17
17
  ruleId
18
- } from "./chunk-IZBBXKMJ.js";
18
+ } from "./chunk-VSOYZ7QH.js";
19
19
  import {
20
20
  findWindows,
21
21
  hashLines,
@@ -24,10 +24,10 @@ import {
24
24
  spellLines,
25
25
  toBodyLines,
26
26
  toFileLines
27
- } from "./chunk-5UB47BEV.js";
27
+ } from "./chunk-WT6HMEEF.js";
28
28
  import {
29
29
  isErrorSeverity
30
- } from "./chunk-MSMB6XOS.js";
30
+ } from "./chunk-6HMLYFEU.js";
31
31
 
32
32
  // src/cite/core/spell.ts
33
33
  function shortPin(integrity) {
@@ -619,4 +619,4 @@ export {
619
619
  errorSite,
620
620
  toValidationResult
621
621
  };
622
- //# sourceMappingURL=chunk-2ZWTSRE5.js.map
622
+ //# sourceMappingURL=chunk-SXODK43S.js.map
@@ -15,10 +15,10 @@ import {
15
15
  import {
16
16
  REPORT_FORMAT_LIST,
17
17
  renderJunit
18
- } from "./chunk-5VWDIWOH.js";
18
+ } from "./chunk-YVVMC4SZ.js";
19
19
  import {
20
20
  isErrorSeverity
21
- } from "./chunk-MSMB6XOS.js";
21
+ } from "./chunk-6HMLYFEU.js";
22
22
  import {
23
23
  palette
24
24
  } from "./chunk-RNVYGWIC.js";
@@ -28,7 +28,7 @@ import {
28
28
  } from "./chunk-MNH7QO4Z.js";
29
29
  import {
30
30
  package_default
31
- } from "./chunk-YSCZL4U5.js";
31
+ } from "./chunk-N7J5C35C.js";
32
32
 
33
33
  // src/lint/core/rule-id.ts
34
34
  var RULE_ID_PREFIX = "manni:lint";
@@ -633,4 +633,4 @@ export {
633
633
  renderTemplates,
634
634
  renderTools
635
635
  };
636
- //# sourceMappingURL=chunk-7XZ6INKO.js.map
636
+ //# sourceMappingURL=chunk-UWY4B2PM.js.map
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  TERM_FIELDS,
4
4
  displayPath
5
- } from "./chunk-IIFADWWI.js";
5
+ } from "./chunk-WUFP4V7B.js";
6
6
 
7
7
  // src/term/reporters/json.ts
8
8
  function termEntry(term) {
@@ -49,4 +49,4 @@ export {
49
49
  renderFindingsJson,
50
50
  renderFormatsJson
51
51
  };
52
- //# sourceMappingURL=chunk-PAOVVHQX.js.map
52
+ //# sourceMappingURL=chunk-VD3EQSBI.js.map
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  GB
4
- } from "./chunk-D2LBN44V.js";
4
+ } from "./chunk-HNMXL2OE.js";
5
5
  import {
6
6
  validateWhen
7
7
  } from "./chunk-FQGLRJGX.js";
@@ -10,7 +10,7 @@ import {
10
10
  constructProvider,
11
11
  resolveSelectionIdentity,
12
12
  selectProvider
13
- } from "./chunk-BWCWTHYS.js";
13
+ } from "./chunk-NGTVREIH.js";
14
14
  import {
15
15
  TracevalsError
16
16
  } from "./chunk-UKZNLVJW.js";
@@ -83,7 +83,7 @@ function mockTurnJudge(model, name = "mock") {
83
83
  };
84
84
  }
85
85
 
86
- // src/tracevals/commands/conformance.ts
86
+ // src/tracevals/commands/runtime.ts
87
87
  import { resolve } from "node:path";
88
88
 
89
89
  // src/tracevals/rules/cache.ts
@@ -371,7 +371,7 @@ async function extractRules(source, deps) {
371
371
  return { ...gated, cached: false };
372
372
  }
373
373
 
374
- // src/tracevals/commands/conformance.ts
374
+ // src/tracevals/commands/runtime.ts
375
375
  var JUDGE_ENV = "MANNI_TRACEVALS_JUDGE";
376
376
  function markJudgeProcess() {
377
377
  process.env[JUDGE_ENV] = "1";
@@ -388,8 +388,8 @@ function offlineRefusal(role, identity) {
388
388
  function firstLine(err) {
389
389
  return errorMessage(err).split("\n")[0] ?? "";
390
390
  }
391
- function conformanceOf(config) {
392
- return config.conformance ?? {
391
+ function runtimeOf(config) {
392
+ return config.runtime ?? {
393
393
  hook: { provider: null, model: null, runs: 1 },
394
394
  include: [],
395
395
  exclude: [],
@@ -493,10 +493,10 @@ export {
493
493
  isNetworkProvider,
494
494
  offlineRefusal,
495
495
  firstLine,
496
- conformanceOf,
496
+ runtimeOf,
497
497
  rulesCacheFor,
498
498
  extraction,
499
499
  localGate,
500
500
  assertDownloaded
501
501
  };
502
- //# sourceMappingURL=chunk-CI55ABCK.js.map
502
+ //# sourceMappingURL=chunk-VQK4VHLF.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/tracevals/rules/mock.ts","../src/tracevals/commands/runtime.ts","../src/tracevals/rules/cache.ts","../src/tracevals/rules/prompt.ts","../src/tracevals/rules/requests-prompt.ts","../src/tracevals/rules/extract.ts"],"sourcesContent":["/**\n * A deterministic, schema-valid extraction for `--provider mock`.\n *\n * It reads the file the way the real prompt asks a model to, crudely: a bullet\n * that opens with an imperative verb is a rule, everything else is not. That\n * gives offline tests and the CI dogfood path rules they can predict from the\n * fixture alone.\n */\nimport type { InferenceProvider } from \"@hawkeyexl/inference\";\n\nconst IMPERATIVE =\n /^(?:run|use|never|always|do|don't|keep|write|read|prefer|add|avoid|ask|check|make|follow|commit|test|update|stop|ensure)\\b/i;\n\nfunction kebab(text: string): string {\n return text\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, \"-\")\n .split(\"-\")\n .filter((w) => w !== \"\")\n .slice(0, 5)\n .join(\"-\");\n}\n\nexport function mockRulesResponse(content: string): {\n json: { rules: { id: string; text: string }[] };\n} {\n const rules: { id: string; text: string }[] = [];\n for (const line of content.split(/\\r?\\n/)) {\n const bullet = /^\\s*[-*]\\s+(.+)$/.exec(line);\n const text = bullet?.[1]?.trim();\n if (text === undefined || !IMPERATIVE.test(text)) continue;\n const id = kebab(text);\n if (id !== \"\") rules.push({ id, text });\n }\n return { json: { rules } };\n}\n\nconst ITEM = /^\\s*(?:[-*]|\\d+\\.)\\s+(?:\\[[ xX]\\]\\s+)?(.+)$/;\nconst SPEC_ITEM = /^(?:\\*\\*)?([A-Z]+-\\d+|T\\d+|\\d+(?:\\.\\d+)+)(?:\\*\\*)?:?\\s+(.+)$/;\n\n/**\n * The same crude reading for a source that says what the session was asked.\n * A bullet, a numbered prompt or a task checkbox is an item. One that opens\n * with a spec's own id (`FR-001`, `T014`, `1.2`) keeps that id, and any other\n * is a rule only when it opens with an imperative verb.\n */\nexport function mockRequestsResponse(content: string): {\n json: { rules: { id: string; text: string }[] };\n} {\n const rules: { id: string; text: string }[] = [];\n for (const line of content.split(/\\r?\\n/)) {\n const item = ITEM.exec(line)?.[1]?.trim();\n if (item === undefined) continue;\n const spec = SPEC_ITEM.exec(item);\n const specId = spec?.[1];\n const specText = spec?.[2]?.trim();\n if (specId !== undefined && specText !== undefined) {\n rules.push({ id: specId, text: specText });\n } else if (IMPERATIVE.test(item)) {\n const id = kebab(item);\n if (id !== \"\") rules.push({ id, text: item });\n }\n }\n return { json: { rules } };\n}\n\nconst PROHIBITION =/^(?:never|don't|do not|avoid)\\b/i;\n\n/**\n * A deterministic turn answer for `--provider mock`, read from the rule's\n * first code span as crudely as `mockRulesResponse` reads a file. A\n * prohibition is not followed when the turn shows its span, and followed\n * otherwise. Any other rule is followed when the turn shows its span. When it\n * does not, every score is 0, which the block bar sends to review. A rule with\n * no code span is followed. The reasoning says which it found.\n */\nexport function mockTurnScores(user: string): Record<string, string | number> {\n const marker = user.lastIndexOf(\"# The rule\\n\\n\");\n // The turn alone: what earlier turns did is not this turn's evidence.\n const turn = user.slice(Math.max(0, user.indexOf(\"# The turn\\n\\n\")), marker);\n const line = user.slice(marker).split(\"\\n\")[2] ?? \"\";\n const text = line.slice(line.indexOf(\": \") + 2);\n const span = /`([^`]+)`/.exec(text)?.[1];\n const answer = (reasoning: string, followed: number, notFollowed: number) => ({\n reasoning,\n \"not-applicable\": 0,\n followed,\n \"not-followed\": notFollowed,\n });\n if (span === undefined) return answer(\"The rule names nothing to look for.\", 100, 0);\n const shown = turn.includes(span);\n const reasoning = shown ? `The turn shows \\`${span}\\`.` : `The turn does not show \\`${span}\\`.`;\n if (PROHIBITION.test(text.trim())) return shown ? answer(reasoning, 0, 100) : answer(reasoning, 100, 0);\n return shown ? answer(reasoning, 100, 0) : answer(reasoning, 0, 0);\n}\n\n/** The turn judge under `--provider mock`: answers from `mockTurnScores`. */\nexport function mockTurnJudge(model: string, name = \"mock\"): InferenceProvider {\n return {\n provider: () => name,\n modelName: () => model,\n completeJSON: (req) => Promise.resolve({ json: mockTurnScores(req.user) }),\n };\n}\n","/**\n * What `prepare` and `check` share (proposal 0079): the two model roles,\n * extraction through the rules cache, and the local-model gates. Free of CLI\n * and IO plumbing, like every command core.\n */\nimport { resolve } from \"node:path\";\nimport type { InferenceProvider, ProviderName } from \"@hawkeyexl/inference\";\nimport { errorMessage } from \"../../shared/errors.js\";\nimport type { TracevalsConfig } from \"../core/config.js\";\nimport {\n assertProviderSelection,\n constructProvider,\n resolveSelectionIdentity,\n selectProvider,\n} from \"../judge/provider.js\";\nimport { RulesCache, rulesCacheKey } from \"../rules/cache.js\";\nimport type { HostSetting } from \"../rules/host.js\";\nimport { extractRules, promptFor, type Rule } from \"../rules/extract.js\";\nimport { GB, type LocalModels } from \"../rules/local.js\";\nimport { mockRequestsResponse, mockRulesResponse } from \"../rules/mock.js\";\nimport type { RuleSource } from \"../rules/sources.js\";\nimport { TracevalsError } from \"../types.js\";\n\nexport interface Identity {\n provider: ProviderName;\n model: string;\n}\n\n/**\n * Set on this process before any provider is built, so a judge it spawns\n * (`claude-cli`) runs its own hooks under gate 2 and never judges itself.\n */\nexport const JUDGE_ENV = \"MANNI_TRACEVALS_JUDGE\";\n\nexport function markJudgeProcess(): void {\n process.env[JUDGE_ENV] = \"1\";\n}\n\n/** Providers that never leave the machine, which `--offline` admits. */\nconst LOCAL_PROVIDERS: ReadonlySet<string> = new Set([\"llama-cpp\", \"mock\"]);\n\nexport function isNetworkProvider(provider: string): boolean {\n return !LOCAL_PROVIDERS.has(provider);\n}\n\n/** `--offline` met a role whose provider would leave the machine. */\nexport function offlineRefusal(role: string, identity: Identity): TracevalsError {\n return new TracevalsError(\n `--offline runs no network provider, and ${role} uses ${identity.provider}`,\n );\n}\n\n/** The first line of an error, as every message quoting one shows it. */\nexport function firstLine(err: unknown): string {\n return errorMessage(err).split(\"\\n\")[0] ?? \"\";\n}\n\n/** Defaults filled for a run by hand, where the section may be absent. */\nexport function runtimeOf(config: TracevalsConfig): NonNullable<TracevalsConfig[\"runtime\"]> {\n return (\n config.runtime ?? {\n hook: { provider: null, model: null, runs: 1 },\n include: [],\n exclude: [],\n plans: [],\n }\n );\n}\n\n/** The rules cache, beside the judge's, resolved as `run` resolves it. */\nexport function rulesCacheFor(\n config: TracevalsConfig,\n configDir: string,\n noCache: boolean,\n): RulesCache {\n return new RulesCache(resolve(configDir, config.judge.cacheDir, \"rules\"), !noCache);\n}\n\nexport interface Extraction {\n identity: Identity;\n cache: RulesCache;\n /** Whether a source still needs the model: not declared, not cached. */\n needs(source: RuleSource): boolean;\n /** A source's rules, declared or extracted. */\n rulesOf(source: RuleSource): Promise<{ rules: Rule[]; origin: \"declared\" | \"extracted\" }>;\n}\n\n/**\n * The out-of-loop model as extraction uses it: `tracevals.provider`/`model`,\n * then the family's `providers:`, then `auto`. No flag reaches it, so\n * `prepare`, the hook and `check` share one cache. jev is refused, because\n * extraction generates.\n *\n * The provider is built on the first uncached source, so a fully cached run\n * needs no API key. Under `mock` each source gets a scripted reading of its\n * own text.\n */\nexport async function extraction(\n config: TracevalsConfig,\n cache: RulesCache,\n injected?: InferenceProvider,\n host?: HostSetting,\n): Promise<Extraction> {\n let identity: Identity;\n if (injected !== undefined) {\n identity = { provider: injected.provider() as ProviderName, model: injected.modelName() };\n } else {\n const selection = selectProvider(config);\n assertProviderSelection(selection);\n identity = await resolveSelectionIdentity(config, selection);\n }\n let built: InferenceProvider | undefined = injected;\n const providerFor = (source: RuleSource): InferenceProvider => {\n // Under `mock` each source gets a scripted reading of its own text, so a\n // provider is built per source and never kept.\n if (built === undefined && identity.provider === \"mock\") {\n markJudgeProcess();\n const scripted =\n promptFor(source.format) === \"requests\"\n ? mockRequestsResponse(source.content)\n : mockRulesResponse(source.content);\n return constructProvider(config, identity, { mockResponses: [scripted] });\n }\n // Every other provider is built once, on the first uncached source.\n if (built === undefined) {\n markJudgeProcess();\n built = constructProvider(config, identity, host === undefined ? {} : { host });\n }\n return built;\n };\n const keyOf = (source: RuleSource): string =>\n rulesCacheKey({\n provider: identity.provider,\n model: identity.model,\n prompt: promptFor(source.format),\n temperature: config.judge.temperature,\n sha256: source.sha256,\n });\n return {\n identity,\n cache,\n needs: (source) =>\n source.declaredRules === undefined && cache.get(keyOf(source)) === undefined,\n rulesOf: async (source) => {\n if (source.declaredRules !== undefined) {\n return { rules: source.declaredRules, origin: \"declared\" };\n }\n const hit = cache.get(keyOf(source));\n if (hit !== undefined) return { rules: hit, origin: \"extracted\" };\n try {\n const extracted = await extractRules(\n {\n path: source.displayPath,\n format: source.format,\n content: source.content,\n sha256: source.sha256,\n },\n { provider: providerFor(source), cache, temperature: config.judge.temperature },\n );\n return { rules: extracted.rules, origin: \"extracted\" };\n } catch (err) {\n if (err instanceof TracevalsError) throw err;\n throw new TracevalsError(\n `could not extract rules from ${source.displayPath}: ${firstLine(err)}`,\n );\n }\n },\n };\n}\n\nexport type LocalGate = \"downloading\" | \"not-downloaded\" | \"memory\";\n\nexport interface GateSkip<G extends string = string> {\n gate: G;\n message: string;\n}\n\nconst wholeGb = (bytes: number): number => Math.round(bytes / GB);\n\n/**\n * Gates 5, 7 and 8 for one local model, in that order, each asked only when\n * listed. Nothing here loads or fetches a model: a runtime that is absent is\n * gate 7, and the memory probe is asked only once the runtime is there.\n *\n * The probe forks a worker and initializes the GPU to read free memory, which\n * costs most of a second. `memoryUnneeded` is asked first and, when it says so,\n * the probe is not run: memory only matters to a model about to be loaded.\n */\nexport async function localGate(\n local: LocalModels,\n model: string,\n gates: readonly LocalGate[],\n memoryUnneeded?: () => boolean | Promise<boolean>,\n): Promise<GateSkip<LocalGate> | undefined> {\n const state = await local.state(model);\n if (gates.includes(\"downloading\") && state === \"downloading\") {\n return { gate: \"downloading\", message: `tracevals skipped this turn: ${model} is still downloading.` };\n }\n if (gates.includes(\"not-downloaded\") && (state !== \"ready\" || !(await local.runtimePresent()))) {\n return {\n gate: \"not-downloaded\",\n message: `tracevals skipped this turn: ${model} is not downloaded yet. Run manni tracevals prepare to fetch it.`,\n };\n }\n if (gates.includes(\"memory\") && !(await memoryUnneeded?.())) {\n const fit = await local.fits(model);\n if (!fit.fits) {\n return {\n gate: \"memory\",\n message: `tracevals skipped this turn: ${model} needs about ${String(wholeGb(fit.needBytes))} GB and ${String(wholeGb(fit.freeBytes))} GB is free.`,\n };\n }\n }\n return undefined;\n}\n\n/** By hand a missing local model is an error, and nothing downloads. */\nexport async function assertDownloaded(local: LocalModels, model: string): Promise<void> {\n if ((await local.state(model)) === \"ready\" && (await local.runtimePresent())) return;\n throw new TracevalsError(`${model} is not downloaded; run manni tracevals prepare`);\n}\n","/**\n * Extracted-rules cache: content-addressed JSON holding the *gated* rules for\n * one rule-source file (proposal 0079, \"Extraction and its cache\").\n *\n * The key is the provider, the model, the prompt and its version, and the\n * sha256 of the whole file. The rules prompt and the requirements prompt read\n * one content differently, so each has entries of its own (proposal 0080).\n * The path is deliberately absent: identical content anywhere shares one\n * entry, so a vendored or copied rules file pays once.\n *\n * Reads go through the inference library's `JsonCache`. Writes do not: the\n * library writes in place, so a reader racing a writer could see half an\n * entry. A hook and a `check` run can overlap, so each entry is written to a\n * temporary file and renamed into place.\n */\nimport { mkdirSync, renameSync, rmSync, writeFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { JsonCache, buildCacheKey } from \"@hawkeyexl/inference\";\nimport { warn } from \"../../shared/warn.js\";\nimport type { Rule } from \"./extract.js\";\nimport { RULES_PROMPT_VERSION } from \"./prompt.js\";\nimport { REQUIREMENTS_PROMPT_VERSION } from \"./requests-prompt.js\";\n\n/** Default location, under the tool's per-project cache directory. */\nexport const DEFAULT_RULES_CACHE_DIR = \".manni/tracevals/cache/rules\";\n\nexport interface RulesCacheKeyParts {\n provider: string;\n model: string;\n /** Which extraction prompt read the file. */\n prompt: \"rules\" | \"requests\";\n /** The extraction temperature, `judge.temperature`: another reading of one file. */\n temperature: number;\n /** sha256 of the whole source file. */\n sha256: string;\n}\n\nexport function rulesCacheKey(parts: RulesCacheKeyParts): string {\n return buildCacheKey([\n parts.provider,\n parts.model,\n // The rules prompt keeps the slot's old spelling, so rule files keep\n // their entries.\n parts.prompt === \"rules\"\n ? `rules-v${String(RULES_PROMPT_VERSION)}`\n : `requests-v${String(REQUIREMENTS_PROMPT_VERSION)}`,\n `t${String(parts.temperature)}`,\n parts.sha256,\n ]);\n}\n\nfunction isRule(value: unknown): value is Rule {\n if (typeof value !== \"object\" || value === null) return false;\n const r = value as Record<string, unknown>;\n return (\n typeof r.id === \"string\" &&\n typeof r.text === \"string\" &&\n (r.when === undefined ||\n (typeof r.when === \"object\" && r.when !== null && !Array.isArray(r.when)))\n );\n}\n\nexport class RulesCache {\n private readonly store: JsonCache<unknown>;\n private warned = false;\n\n constructor(\n private readonly dir: string = DEFAULT_RULES_CACHE_DIR,\n private readonly enabled: boolean = true,\n ) {\n this.store = new JsonCache<unknown>(dir, enabled, \"manni-tracevals\");\n }\n\n /** An entry that is not a list of rules, from an older shape, is a miss. */\n get(key: string): Rule[] | undefined {\n const value = this.store.get(key);\n if (!Array.isArray(value) || !value.every(isRule)) return undefined;\n return value;\n }\n\n set(key: string, rules: Rule[]): void {\n if (!this.enabled) return;\n const tmp = join(this.dir, `${key}.${process.pid}.${Date.now()}.tmp`);\n try {\n mkdirSync(this.dir, { recursive: true });\n writeFileSync(tmp, JSON.stringify(rules, null, 2));\n renameSync(tmp, join(this.dir, `${key}.json`));\n } catch (err) {\n rmSync(tmp, { force: true });\n if (!this.warned) {\n this.warned = true;\n warn(\n `could not write the rules cache at ${this.dir} (${err instanceof Error ? err.message : String(err)}). Continuing without caching.`,\n );\n }\n }\n }\n}\n","/**\n * Rule extraction prompt: asks the provider to read ONE rule-source file and\n * return only the directives a session transcript could show followed or\n * broken (proposal 0079, \"Only files that govern an agent\").\n *\n * The whole file goes in, uncapped. A cache keyed on slices would rarely hit,\n * and a partial read would let the agent off for sentences it never saw.\n */\nimport { Ajv2020 } from \"ajv/dist/2020.js\";\n\n/**\n * Part of the cache key: bump whenever the prompt or schema changes.\n *\n * A prompt edit that leaves this alone makes every cached extraction replay the\n * *old* prompt's output, silently, for as long as the cache lives.\n * `test/tracevals/unit/rules-prompt.test.ts` pins this to a digest of the\n * prompt surface so the pair has to move together.\n */\nexport const RULES_PROMPT_VERSION = 2;\n\n/** The `when` field and its conditions, which the requirements prompt shares. */\nexport const WHEN_GUIDE: readonly string[] = [\n \"- `when` (optional): a trigger saying which turns the rule concerns. Every\",\n \" listed condition must hold. The only conditions are:\",\n \" - `file-access`: a glob. The turn read, wrote or edited a matching file.\",\n \" - `tool-used`: a tool name. The turn called that tool.\",\n \" - `prompt-matches`: a regular expression. A prompt the user typed matches.\",\n \" - `turn-count-above`: a whole number. The session has more turns than that.\",\n \" - `command-matches`: a regular expression. A Bash command in the turn matches.\",\n \"\",\n \"Omit `when` unless the rule clearly concerns only certain files, tools or\",\n \"commands. A trigger that is too narrow hides violations, and a rule with no\",\n \"`when` is simply checked on every turn. When in doubt, leave it out.\",\n];\n\nexport const RULES_SYSTEM_PROMPT = [\n \"You extract rules from a file that governs an AI agent working in a repository.\",\n \"\",\n \"A rule is a directive addressed to the AI agent, which a recorded session\",\n \"transcript could show it following or breaking. The transcript holds the\",\n \"agent's prompts, its tool calls (with their inputs), the files it read or\",\n \"wrote, and its replies. Nothing else is observable.\",\n \"\",\n \"Return a rule only when the file tells the agent to do, or not to do,\",\n \"something. Return nothing for:\",\n \"- descriptions of how a system, tool or codebase behaves;\",\n \"- instructions written for end users or readers rather than the agent;\",\n \"- examples, sample output and code listings;\",\n \"- rules the file quotes from somewhere else, or reports as another party's.\",\n \"\",\n \"Keep a procedure's rules too, which a session shows across many turns:\",\n \"the order of steps, a gate that one step must pass before another, a route\",\n \"that a step's result chooses, a condition that calls for a step, a required\",\n \"step, and the step that comes last. Write each as its own rule.\",\n \"\",\n 'Drop a directive a transcript cannot show, such as \"prefer boring code\" or',\n '\"keep things simple\". If you cannot say what a violation would look like in',\n \"a transcript, it does not qualify.\",\n \"\",\n \"Each rule has:\",\n \"- `id`: a short kebab-case identifier, unique within this file.\",\n \"- `text`: one imperative sentence, faithful to the file. Do not strengthen,\",\n \" soften or merge directives, and do not invent ones the file lacks.\",\n ...WHEN_GUIDE,\n \"\",\n \"Return none at all when nothing qualifies.\",\n].join(\"\\n\");\n\nexport const RULES_SCHEMA = {\n type: \"object\",\n required: [\"rules\"],\n additionalProperties: false,\n properties: {\n rules: {\n type: \"array\",\n items: {\n type: \"object\",\n required: [\"id\", \"text\"],\n additionalProperties: false,\n properties: {\n id: { type: \"string\" },\n text: { type: \"string\", minLength: 1 },\n // Open on purpose: `extractRules` gates each `when` with `validateWhen`\n // and drops the one rule, where a schema miss would void the whole file.\n when: { type: \"object\" },\n },\n },\n },\n },\n} as const;\n\nconst ajv = new Ajv2020({ allErrors: true });\nconst validateRules = ajv.compile(\n RULES_SCHEMA as unknown as Record<string, unknown>,\n);\n\nexport function isValidRules(value: unknown): boolean {\n return validateRules(value);\n}\n\nexport interface RulesUserOptions {\n path: string;\n format: string;\n content: string;\n}\n\nexport function buildRulesUser(options: RulesUserOptions): string {\n return [\n \"# Rule source\",\n `path: ${options.path}`,\n `format: ${options.format}`,\n \"\",\n \"# File content\",\n \"\",\n options.content,\n ].join(\"\\n\");\n}\n","/**\n * Requirements extraction prompt: asks the provider to read ONE source that\n * says what the session was asked to build or keep, and return each item as a\n * rule in 0079's shape (proposal 0080, \"What the session was asked\").\n *\n * The sources are the typed prompts, an approved plan, and spec files. The\n * response schema and the `when` grammar are the rules prompt's, so a\n * requirement is judged like any other rule.\n */\nimport { WHEN_GUIDE } from \"./prompt.js\";\n\n/**\n * Part of the cache key: bump whenever the prompt changes.\n * `test/tracevals/unit/requests-prompt.test.ts` pins this to a digest of the\n * prompt surface so the pair has to move together.\n */\nexport const REQUIREMENTS_PROMPT_VERSION = 1;\n\n/** The source formats that say what the session was asked, which this prompt reads. */\nconst REQUEST_FORMATS: ReadonlySet<string> = new Set([\n \"prompt\",\n \"plan\",\n \"speckit-spec\",\n \"kiro-spec\",\n \"openspec-change\",\n \"plans\",\n]);\n\nexport function isRequestFormat(format: string): boolean {\n return REQUEST_FORMATS.has(format);\n}\n\nexport const REQUIREMENTS_SYSTEM_PROMPT = [\n \"You read what an AI agent working in a repository was asked to build or keep,\",\n \"and return each item as a rule.\",\n \"\",\n \"The source is one of three things: the prompts a person typed in the\",\n \"session, numbered in order; a plan the person approved; or a spec file,\",\n \"such as a feature spec, a design, a task list or a change proposal.\",\n \"\",\n \"A rule is something the work must deliver or keep, which a recorded session\",\n \"transcript could show met or broken. The transcript holds the agent's\",\n \"prompts, its tool calls (with their inputs), the files it read or wrote, and\",\n \"its replies. Nothing else is observable.\",\n \"\",\n \"Typed prompts are one sequence. Return the set that stands after the last\",\n \"prompt: a later prompt can add an item, change an earlier one, or drop it.\",\n \"A question with nothing to build yields nothing. Never return chat, such as\",\n \"greetings, thanks, or remarks about the work.\",\n \"\",\n \"A spec's items keep the spec's own ids, exactly as written, such as\",\n \"`FR-001`, `T014` or `1.2`. A task the file marks done is still a rule:\",\n \"ticking it says that task is done.\",\n \"\",\n \"Return nothing for background, rationale, examples, open questions, or\",\n \"items the source marks out of scope.\",\n \"\",\n \"Each rule has:\",\n \"- `id`: the source's own id for the item when it gives one, exactly as\",\n \" written. Otherwise a short kebab-case identifier. Unique within this source.\",\n \"- `text`: one imperative sentence, faithful to the source. Do not strengthen,\",\n \" soften or merge items, and do not invent ones the source lacks.\",\n ...WHEN_GUIDE,\n \"\",\n \"Return none at all when nothing qualifies.\",\n].join(\"\\n\");\n\nexport interface RequirementsUserOptions {\n path: string;\n format: string;\n content: string;\n}\n\nexport function buildRequirementsUser(options: RequirementsUserOptions): string {\n return [\n \"# Request source\",\n // Callers pass the display path (`prompt`, `plan`); a blank one names the format.\n `path: ${options.path !== \"\" ? options.path : options.format}`,\n `format: ${options.format}`,\n \"\",\n \"# Content\",\n \"\",\n options.content,\n ].join(\"\\n\");\n}\n","/**\n * Extract the rules one rule-source file declares for the agent, then gate\n * them (proposal 0079). The model proposes; the gate decides what survives, and\n * a rule it drops is reported with a reason rather than lost.\n *\n * A source that says what the session was asked, such as the typed prompts, a\n * plan or a spec, is read by the requirements prompt instead (proposal 0080).\n * Its gate keeps a spec's own ids as written, so `T014` and `1.2` survive.\n */\nimport {\n completeValidatedJSON,\n type InferenceProvider,\n} from \"@hawkeyexl/inference\";\nimport { validateWhen } from \"../graders/when.js\";\nimport { type RulesCache, rulesCacheKey } from \"./cache.js\";\nimport {\n RULES_SCHEMA,\n RULES_SYSTEM_PROMPT,\n buildRulesUser,\n isValidRules,\n} from \"./prompt.js\";\nimport {\n REQUIREMENTS_SYSTEM_PROMPT,\n buildRequirementsUser,\n isRequestFormat,\n} from \"./requests-prompt.js\";\n\nexport interface Rule {\n id: string;\n text: string;\n when?: Record<string, unknown>;\n}\n\nexport interface ExtractSource {\n path: string;\n format: string;\n content: string;\n /** sha256 of `content`; the cache key, so the path never enters it. */\n sha256: string;\n}\n\nexport interface ExtractDeps {\n provider: InferenceProvider;\n cache?: RulesCache;\n temperature?: number;\n}\n\nexport interface ExtractedRules {\n rules: Rule[];\n cached: boolean;\n dropped: { id?: string; reason: string }[];\n}\n\nconst KEBAB = /^[a-z0-9][a-z0-9-]*$/;\n/** A spec's own id, such as `FR-001`, `T014` or `1.2`, or a kebab-case one. */\nconst SPEC_ID = /^[A-Za-z0-9][A-Za-z0-9.-]*$/;\n\n/** Each extraction prompt, and the ids its gate accepts. */\nconst PROMPTS = {\n rules: {\n system: RULES_SYSTEM_PROMPT,\n user: buildRulesUser,\n id: KEBAB,\n idReason: \"id is not kebab-case\",\n },\n requests: {\n system: REQUIREMENTS_SYSTEM_PROMPT,\n user: buildRequirementsUser,\n id: SPEC_ID,\n idReason: \"id is neither a spec's own id nor kebab-case\",\n },\n} as const;\n\nexport type ExtractionPrompt = keyof typeof PROMPTS;\n\n/** The prompt a source of this format is read with. */\nexport function promptFor(format: string): ExtractionPrompt {\n return isRequestFormat(format) ? \"requests\" : \"rules\";\n}\n\n/** Gate the model's rules: valid id, text, unique id, grounded `when`. */\nexport function gateRules(\n proposed: Rule[],\n prompt: ExtractionPrompt = \"rules\",\n): Pick<ExtractedRules, \"rules\" | \"dropped\"> {\n const { id: idPattern, idReason } = PROMPTS[prompt];\n const rules: Rule[] = [];\n const dropped: ExtractedRules[\"dropped\"] = [];\n const seen = new Set<string>();\n for (const proposedRule of proposed) {\n // An empty `when` names no condition, which is what an absent one means.\n // Local models write it that way, so it is read as absent, not refused.\n const { when, ...bare } = proposedRule;\n const rule: Rule = when === undefined || Object.keys(when).length === 0 ? bare : proposedRule;\n if (!idPattern.test(rule.id)) {\n dropped.push({ id: rule.id, reason: idReason });\n } else if (rule.text.trim() === \"\") {\n dropped.push({ id: rule.id, reason: \"text is empty\" });\n } else if (seen.has(rule.id)) {\n dropped.push({ id: rule.id, reason: \"id repeats an earlier rule\" });\n } else {\n const invalid =\n rule.when === undefined ? undefined : validateWhen({ when: rule.when });\n if (invalid !== undefined) {\n dropped.push({ id: rule.id, reason: invalid });\n } else {\n seen.add(rule.id);\n rules.push(rule);\n }\n }\n }\n return { rules, dropped };\n}\n\n/**\n * Throws when the provider errors or returns a shape the schema rejects, so a\n * caller can tell \"this file yielded no rules\" (an empty list) from \"the model\n * never answered\".\n */\nexport async function extractRules(\n source: ExtractSource,\n deps: ExtractDeps,\n): Promise<ExtractedRules> {\n const { provider, cache } = deps;\n const prompt = promptFor(source.format);\n const key = rulesCacheKey({\n provider: provider.provider(),\n model: provider.modelName(),\n prompt,\n temperature: deps.temperature ?? 0,\n sha256: source.sha256,\n });\n\n const hit = cache?.get(key);\n if (hit !== undefined) return { rules: hit, cached: true, dropped: [] };\n\n const run = await completeValidatedJSON<{ rules: Rule[] }>({\n provider,\n system: PROMPTS[prompt].system,\n user: PROMPTS[prompt].user(source),\n schema: RULES_SCHEMA,\n ...(deps.temperature !== undefined ? { temperature: deps.temperature } : {}),\n });\n if (run.result === undefined || !isValidRules(run.result)) {\n throw new Error(\n run.error ?? \"provider returned rules that do not match the schema\",\n );\n }\n\n const gated = gateRules(run.result.rules, prompt);\n cache?.set(key, gated.rules);\n return { ...gated, cached: false };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAUA,IAAM,aACJ;AAEF,SAAS,MAAM,MAAsB;AACnC,SAAO,KACJ,YAAY,EACZ,QAAQ,eAAe,GAAG,EAC1B,MAAM,GAAG,EACT,OAAO,CAAC,MAAM,MAAM,EAAE,EACtB,MAAM,GAAG,CAAC,EACV,KAAK,GAAG;AACb;AAEO,SAAS,kBAAkB,SAEhC;AACA,QAAM,QAAwC,CAAC;AAC/C,aAAW,QAAQ,QAAQ,MAAM,OAAO,GAAG;AACzC,UAAM,SAAS,mBAAmB,KAAK,IAAI;AAC3C,UAAM,OAAO,SAAS,CAAC,GAAG,KAAK;AAC/B,QAAI,SAAS,UAAa,CAAC,WAAW,KAAK,IAAI,EAAG;AAClD,UAAM,KAAK,MAAM,IAAI;AACrB,QAAI,OA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M,KAAK,MAAO,WAAY,MAAM,MAAM,eAAe,EAAI;AAC9E,QAAM,IAAI,eAAe,GAAG,KAAK,iDAAiD;AACpF;","names":["reasoning"]}
@@ -11,7 +11,7 @@ import {
11
11
  lineSpec,
12
12
  parseLines,
13
13
  sliceLines
14
- } from "./chunk-5UB47BEV.js";
14
+ } from "./chunk-WT6HMEEF.js";
15
15
  import {
16
16
  __default3 as __default,
17
17
  extractorByName,
@@ -19,7 +19,7 @@ import {
19
19
  hasFrontmatterFence,
20
20
  locateFrontmatter,
21
21
  supportedExtensions
22
- } from "./chunk-MSMB6XOS.js";
22
+ } from "./chunk-6HMLYFEU.js";
23
23
  import {
24
24
  isEncryptedValue
25
25
  } from "./chunk-XKBEHKWO.js";
@@ -976,4 +976,4 @@ export {
976
976
  citationInputs,
977
977
  readPage
978
978
  };
979
- //# sourceMappingURL=chunk-IZBBXKMJ.js.map
979
+ //# sourceMappingURL=chunk-VSOYZ7QH.js.map
@@ -98,11 +98,11 @@ import {
98
98
  valueAt,
99
99
  withValueAt,
100
100
  writeEncryptionKey
101
- } from "./chunk-5UB47BEV.js";
101
+ } from "./chunk-WT6HMEEF.js";
102
102
  import {
103
103
  formatList,
104
104
  render
105
- } from "./chunk-5VWDIWOH.js";
105
+ } from "./chunk-YVVMC4SZ.js";
106
106
  import {
107
107
  DERIVABLE_FIELDS,
108
108
  DERIVE_SOURCES,
@@ -156,7 +156,7 @@ import {
156
156
  urlManifestMessage,
157
157
  urlManifestOwning,
158
158
  writeFileAtomic
159
- } from "./chunk-MSMB6XOS.js";
159
+ } from "./chunk-6HMLYFEU.js";
160
160
  import {
161
161
  palette
162
162
  } from "./chunk-RNVYGWIC.js";
@@ -6882,4 +6882,4 @@ export {
6882
6882
  renderQuery,
6883
6883
  renderQueryCsv
6884
6884
  };
6885
- //# sourceMappingURL=chunk-CR3HZERW.js.map
6885
+ //# sourceMappingURL=chunk-WBETAXO2.js.map
@@ -62,7 +62,7 @@ import {
62
62
  supportedExtensions,
63
63
  toJsonText,
64
64
  writeFileAtomic
65
- } from "./chunk-MSMB6XOS.js";
65
+ } from "./chunk-6HMLYFEU.js";
66
66
  import {
67
67
  STDIN_LINES_MARKER
68
68
  } from "./chunk-YEUYKR62.js";
@@ -7392,4 +7392,4 @@ export {
7392
7392
  stampManifests,
7393
7393
  runValidate
7394
7394
  };
7395
- //# sourceMappingURL=chunk-5UB47BEV.js.map
7395
+ //# sourceMappingURL=chunk-WT6HMEEF.js.map
@@ -10,7 +10,7 @@ import {
10
10
  CONCEPT_FIELDS,
11
11
  fieldPointer,
12
12
  valueAt
13
- } from "./chunk-CR3HZERW.js";
13
+ } from "./chunk-WBETAXO2.js";
14
14
  import {
15
15
  STDIN_LABEL,
16
16
  STDIN_TOKEN,
@@ -20,7 +20,7 @@ import {
20
20
  gitignoreOptions,
21
21
  locateFrontmatter,
22
22
  resolveTargetSet
23
- } from "./chunk-MSMB6XOS.js";
23
+ } from "./chunk-6HMLYFEU.js";
24
24
  import {
25
25
  findConfigFile,
26
26
  readConfigFile,
@@ -1972,4 +1972,4 @@ export {
1972
1972
  valeConfigFor,
1973
1973
  plural
1974
1974
  };
1975
- //# sourceMappingURL=chunk-IIFADWWI.js.map
1975
+ //# sourceMappingURL=chunk-WUFP4V7B.js.map
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  pathKey
4
- } from "./chunk-D6RO54QD.js";
4
+ } from "./chunk-7LC4YJJ3.js";
5
5
  import {
6
6
  DEFAULT_CAPTURE_DIR,
7
7
  makeRedactor
@@ -230,4 +230,4 @@ export {
230
230
  rollup,
231
231
  writeLedger
232
232
  };
233
- //# sourceMappingURL=chunk-7EL5LLKD.js.map
233
+ //# sourceMappingURL=chunk-WUXD6VBD.js.map
@@ -10,7 +10,7 @@ import {
10
10
  pageMarks,
11
11
  pageSchemaSet,
12
12
  withValueAt
13
- } from "./chunk-5UB47BEV.js";
13
+ } from "./chunk-WT6HMEEF.js";
14
14
  import {
15
15
  DocmetaError,
16
16
  escapePointerSegment,
@@ -20,7 +20,7 @@ import {
20
20
  rebaseConfigSchemaRefs,
21
21
  schemaTrustRoot,
22
22
  supportedExtensions
23
- } from "./chunk-MSMB6XOS.js";
23
+ } from "./chunk-6HMLYFEU.js";
24
24
  import {
25
25
  decryptValue,
26
26
  encryptValue,
@@ -195,4 +195,4 @@ export {
195
195
  metaPageView,
196
196
  declaredAt
197
197
  };
198
- //# sourceMappingURL=chunk-ZKCNPKUO.js.map
198
+ //# sourceMappingURL=chunk-XDS3KQCK.js.map
@@ -6,7 +6,7 @@ import {
6
6
  canonicalSchemaRef,
7
7
  fingerprint,
8
8
  isErrorSeverity
9
- } from "./chunk-MSMB6XOS.js";
9
+ } from "./chunk-6HMLYFEU.js";
10
10
  import {
11
11
  palette
12
12
  } from "./chunk-RNVYGWIC.js";
@@ -19,7 +19,7 @@ import {
19
19
  } from "./chunk-XKBEHKWO.js";
20
20
  import {
21
21
  package_default
22
- } from "./chunk-YSCZL4U5.js";
22
+ } from "./chunk-N7J5C35C.js";
23
23
 
24
24
  // src/meta/reporters/rule-id.ts
25
25
  var SYNTHETIC_SCHEMA = "(parse)";
@@ -385,4 +385,4 @@ export {
385
385
  renderGithub,
386
386
  render
387
387
  };
388
- //# sourceMappingURL=chunk-5VWDIWOH.js.map
388
+ //# sourceMappingURL=chunk-YVVMC4SZ.js.map
@@ -21,7 +21,7 @@ import {
21
21
  sidecarsFor,
22
22
  sourceIndexFor,
23
23
  wordShare
24
- } from "./chunk-NZ6TNSCU.js";
24
+ } from "./chunk-HWNSIEZK.js";
25
25
  import {
26
26
  applyMarkerMoves,
27
27
  blockMatches,
@@ -34,7 +34,7 @@ import {
34
34
  spellAt,
35
35
  spellElsewhere,
36
36
  unitAt
37
- } from "./chunk-2ZWTSRE5.js";
37
+ } from "./chunk-SXODK43S.js";
38
38
  import {
39
39
  ANY_FENCE,
40
40
  CiteError,
@@ -62,10 +62,10 @@ import {
62
62
  spellSource,
63
63
  tooWide,
64
64
  unitHolding
65
- } from "./chunk-IZBBXKMJ.js";
65
+ } from "./chunk-VSOYZ7QH.js";
66
66
  import {
67
67
  ensureEncryptionKey
68
- } from "./chunk-CR3HZERW.js";
68
+ } from "./chunk-WBETAXO2.js";
69
69
  import {
70
70
  ENCRYPTION_KEY_ENV,
71
71
  STDIN_REQUIRES_AS,
@@ -84,7 +84,7 @@ import {
84
84
  splitLines,
85
85
  toBodyLines,
86
86
  toFileLines
87
- } from "./chunk-5UB47BEV.js";
87
+ } from "./chunk-WT6HMEEF.js";
88
88
  import {
89
89
  DocmetaError,
90
90
  STDIN_LABEL,
@@ -92,7 +92,7 @@ import {
92
92
  extractorByName,
93
93
  locateFrontmatter,
94
94
  writeFileAtomic
95
- } from "./chunk-MSMB6XOS.js";
95
+ } from "./chunk-6HMLYFEU.js";
96
96
  import {
97
97
  isEncryptedValue
98
98
  } from "./chunk-XKBEHKWO.js";
@@ -2160,4 +2160,4 @@ export {
2160
2160
  runRemove,
2161
2161
  runUpdate
2162
2162
  };
2163
- //# sourceMappingURL=chunk-ZEXGGGLW.js.map
2163
+ //# sourceMappingURL=chunk-Z27GYQOY.js.map
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  parseTraceFile,
4
4
  renderTrace
5
- } from "./chunk-PNX43DYW.js";
5
+ } from "./chunk-C2JPBQCJ.js";
6
6
  import {
7
7
  evaluateWhen,
8
8
  matchesGlob,
@@ -30,20 +30,20 @@ import {
30
30
  extractEvals,
31
31
  findManifest,
32
32
  resolveArtifacts
33
- } from "./chunk-OOEMKOX6.js";
33
+ } from "./chunk-POGYWOJ2.js";
34
34
  import {
35
35
  discoverTraces
36
36
  } from "./chunk-4TSWU2SU.js";
37
37
  import {
38
38
  discoverConfig
39
- } from "./chunk-TPVOOTMN.js";
39
+ } from "./chunk-KPXOJMQ6.js";
40
40
  import {
41
41
  announceSelection,
42
42
  assertProviderSelection,
43
43
  constructProvider,
44
44
  resolveProviderIdentity,
45
45
  selectProvider
46
- } from "./chunk-BWCWTHYS.js";
46
+ } from "./chunk-NGTVREIH.js";
47
47
  import {
48
48
  TracevalsError
49
49
  } from "./chunk-UKZNLVJW.js";
@@ -68,7 +68,7 @@ import {
68
68
  } from "./chunk-GLP5PSXB.js";
69
69
  import {
70
70
  declaredAt
71
- } from "./chunk-ZKCNPKUO.js";
71
+ } from "./chunk-XDS3KQCK.js";
72
72
  import {
73
73
  PATH_JOIN,
74
74
  externalMetadataJoin,
@@ -76,15 +76,15 @@ import {
76
76
  loadExternalMetadata,
77
77
  memberOf,
78
78
  mergeWithMarks
79
- } from "./chunk-5UB47BEV.js";
79
+ } from "./chunk-WT6HMEEF.js";
80
80
  import {
81
81
  xmlEscape
82
- } from "./chunk-5VWDIWOH.js";
82
+ } from "./chunk-YVVMC4SZ.js";
83
83
  import {
84
84
  DocmetaError,
85
85
  classifyRef,
86
86
  extractFrontmatter
87
- } from "./chunk-MSMB6XOS.js";
87
+ } from "./chunk-6HMLYFEU.js";
88
88
  import {
89
89
  palette
90
90
  } from "./chunk-RNVYGWIC.js";
@@ -3132,4 +3132,4 @@ export {
3132
3132
  resolveBatchTraces,
3133
3133
  runBatch
3134
3134
  };
3135
- //# sourceMappingURL=chunk-QP5X66TO.js.map
3135
+ //# sourceMappingURL=chunk-ZIGIJBXG.js.map
@@ -5,7 +5,7 @@ import {
5
5
  runTemplates,
6
6
  runTemplatesInfer,
7
7
  runTools
8
- } from "./chunk-IOL74S4J.js";
8
+ } from "./chunk-3FG2UU3H.js";
9
9
  import {
10
10
  LINT_JOBS,
11
11
  TOOLS_BY_JOB,
@@ -13,21 +13,21 @@ import {
13
13
  rebaseConfig,
14
14
  resolveStructureTool,
15
15
  runLint
16
- } from "./chunk-ZNE25EAR.js";
17
- import "./chunk-6URSCTTX.js";
16
+ } from "./chunk-LF6FOF6U.js";
17
+ import "./chunk-AO66Q66S.js";
18
18
  import "./chunk-TIUTIOFB.js";
19
19
  import {
20
20
  render,
21
21
  renderTemplates,
22
22
  renderTools
23
- } from "./chunk-7XZ6INKO.js";
23
+ } from "./chunk-UWY4B2PM.js";
24
24
  import "./chunk-GLP5PSXB.js";
25
25
  import "./chunk-TBAMBLF3.js";
26
26
  import {
27
27
  LintError
28
28
  } from "./chunk-YGFIQ6Y5.js";
29
- import "./chunk-ZKCNPKUO.js";
30
- import "./chunk-CR3HZERW.js";
29
+ import "./chunk-XDS3KQCK.js";
30
+ import "./chunk-WBETAXO2.js";
31
31
  import {
32
32
  collect,
33
33
  configOption,
@@ -35,16 +35,16 @@ import {
35
35
  readStdin,
36
36
  reportConfig,
37
37
  splitList
38
- } from "./chunk-5UB47BEV.js";
38
+ } from "./chunk-WT6HMEEF.js";
39
39
  import {
40
40
  OMITTED_WHEN_CLEAN,
41
41
  REPORT_FORMATS,
42
42
  REPORT_FORMAT_LIST,
43
43
  isReportFormat
44
- } from "./chunk-5VWDIWOH.js";
44
+ } from "./chunk-YVVMC4SZ.js";
45
45
  import {
46
46
  STDIN_TOKEN
47
- } from "./chunk-MSMB6XOS.js";
47
+ } from "./chunk-6HMLYFEU.js";
48
48
  import {
49
49
  fail
50
50
  } from "./chunk-YEUYKR62.js";
@@ -59,7 +59,7 @@ import {
59
59
  import "./chunk-QCHVR4ZM.js";
60
60
  import {
61
61
  package_default
62
- } from "./chunk-YSCZL4U5.js";
62
+ } from "./chunk-N7J5C35C.js";
63
63
  import "./chunk-OWBRDNRZ.js";
64
64
  import "./chunk-G3T47CFV.js";
65
65
  import "./chunk-2H7UOFLK.js";
@@ -344,4 +344,4 @@ function buildProgram() {
344
344
  export {
345
345
  buildProgram
346
346
  };
347
- //# sourceMappingURL=cli-37SRAYNE.js.map
347
+ //# sourceMappingURL=cli-4B5RWL7P.js.map
@@ -19,13 +19,13 @@ import {
19
19
  runSearch,
20
20
  runStats,
21
21
  runTraverse
22
- } from "./chunk-LXJEAV2V.js";
22
+ } from "./chunk-PO5W6JAP.js";
23
23
  import {
24
24
  DEFAULT_EXTENSIONS,
25
25
  STDIN,
26
26
  assertInputFormat,
27
27
  runBuild
28
- } from "./chunk-6VDBP5UV.js";
28
+ } from "./chunk-NB4ILZMQ.js";
29
29
  import "./chunk-XXDXIIQ4.js";
30
30
  import {
31
31
  ALL_FILL_FIELDS,
@@ -33,20 +33,20 @@ import {
33
33
  DEFAULT_CONFIG_FILENAME,
34
34
  GraphError
35
35
  } from "./chunk-6KKZXB2O.js";
36
- import "./chunk-6URSCTTX.js";
36
+ import "./chunk-AO66Q66S.js";
37
37
  import "./chunk-TIUTIOFB.js";
38
38
  import "./chunk-YGFIQ6Y5.js";
39
- import "./chunk-ZKCNPKUO.js";
40
- import "./chunk-CR3HZERW.js";
39
+ import "./chunk-XDS3KQCK.js";
40
+ import "./chunk-WBETAXO2.js";
41
41
  import {
42
42
  collect,
43
43
  configOption,
44
44
  readStdin,
45
45
  splitList,
46
46
  writeTextAtomic
47
- } from "./chunk-5UB47BEV.js";
48
- import "./chunk-5VWDIWOH.js";
49
- import "./chunk-MSMB6XOS.js";
47
+ } from "./chunk-WT6HMEEF.js";
48
+ import "./chunk-YVVMC4SZ.js";
49
+ import "./chunk-6HMLYFEU.js";
50
50
  import {
51
51
  fail
52
52
  } from "./chunk-YEUYKR62.js";
@@ -63,7 +63,7 @@ import {
63
63
  } from "./chunk-QCHVR4ZM.js";
64
64
  import {
65
65
  package_default
66
- } from "./chunk-YSCZL4U5.js";
66
+ } from "./chunk-N7J5C35C.js";
67
67
  import "./chunk-OWBRDNRZ.js";
68
68
  import {
69
69
  errorMessage
@@ -627,4 +627,4 @@ export {
627
627
  buildProgram,
628
628
  colorFor
629
629
  };
630
- //# sourceMappingURL=cli-IRHPPUFJ.js.map
630
+ //# sourceMappingURL=cli-5AML7QR2.js.map
@@ -27,7 +27,7 @@ import "./chunk-HX44GB4Z.js";
27
27
  import "./chunk-QCHVR4ZM.js";
28
28
  import {
29
29
  package_default
30
- } from "./chunk-YSCZL4U5.js";
30
+ } from "./chunk-N7J5C35C.js";
31
31
  import {
32
32
  programName
33
33
  } from "./chunk-OWBRDNRZ.js";
@@ -1202,4 +1202,4 @@ export {
1202
1202
  resolveCrawl,
1203
1203
  resolveMaxPages
1204
1204
  };
1205
- //# sourceMappingURL=cli-NM6FZ54R.js.map
1205
+ //# sourceMappingURL=cli-I4GBPLRM.js.map