@hawkeyexl/manni 4.6.0 → 4.8.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.
- package/README.md +1 -1
- package/dist/{batch-OZOACN4G.js → batch-6LJJZTT7.js} +12 -12
- package/dist/{build-Z5VOVADH.js → build-QKFXKAXT.js} +9 -9
- package/dist/{calibrate-TZYT42DR.js → calibrate-UQJR3WCU.js} +13 -13
- package/dist/{capture-SL4MNDDP.js → capture-HQ2PGM5Z.js} +12 -12
- package/dist/{check-PKY7KTQE.js → check-3DZOMJ7R.js} +10 -10
- package/dist/{check-5OMA42Y6.js → check-BF56QRWL.js} +9 -9
- package/dist/{check-WB2QDHJQ.js → check-NSDC5LSE.js} +39 -33
- package/dist/check-NSDC5LSE.js.map +1 -0
- package/dist/{chunk-TLXE7LYK.js → chunk-22G33NL2.js} +3 -3
- package/dist/{chunk-2KRB3EG7.js → chunk-2QEHLWYM.js} +2 -2
- package/dist/{chunk-QW77LCOU.js → chunk-426TGC2Q.js} +5 -5
- package/dist/{chunk-Z4IZGEM3.js → chunk-77WI6LJW.js} +5 -5
- package/dist/{chunk-KCOFEWV5.js → chunk-A36QDIXZ.js} +2 -2
- package/dist/{chunk-73TC4DYH.js → chunk-ALAH6HNY.js} +2 -2
- package/dist/{chunk-GREQKO6M.js → chunk-AZXCL5WH.js} +4 -4
- package/dist/{chunk-MHM4QEBV.js → chunk-BMRZFTAD.js} +3 -3
- package/dist/{chunk-IY7NYNPZ.js → chunk-BP7LGVF3.js} +7 -7
- package/dist/{chunk-PCFG7E6B.js → chunk-CGO5MNRD.js} +2 -2
- package/dist/{chunk-PCFG7E6B.js.map → chunk-CGO5MNRD.js.map} +1 -1
- package/dist/{chunk-7WRP5FFP.js → chunk-CHDADR7F.js} +4 -4
- package/dist/{chunk-NBMPHD4I.js → chunk-EOGF6VCA.js} +2 -2
- package/dist/{chunk-SM6NOMJS.js → chunk-G4T6SF3C.js} +2 -2
- package/dist/{chunk-733Y2STG.js → chunk-GEX2HDAT.js} +2 -2
- package/dist/{chunk-NHHOPZRA.js → chunk-GWGR7BDP.js} +5 -5
- package/dist/{chunk-UAKNZVCD.js → chunk-H3LM7D6K.js} +4 -4
- package/dist/{chunk-TH4JVQPF.js → chunk-HNMXL2OE.js} +6 -5
- package/dist/chunk-HNMXL2OE.js.map +1 -0
- package/dist/{chunk-C73RSUIC.js → chunk-HOE2C42K.js} +3 -3
- package/dist/{chunk-B3TS4WRM.js → chunk-HYT242KI.js} +8 -8
- package/dist/{chunk-C3B2VJNC.js → chunk-J3IK5IGO.js} +2 -2
- package/dist/{chunk-M6GSS72T.js → chunk-JUN4DUHG.js} +6 -6
- package/dist/{chunk-XPEWUK7J.js → chunk-KPXOJMQ6.js} +17 -14
- package/dist/chunk-KPXOJMQ6.js.map +1 -0
- package/dist/{chunk-TUAAR3MM.js → chunk-KRSLDZ7N.js} +2 -2
- package/dist/{chunk-UJSGS2Y5.js → chunk-KWAXJCKS.js} +4 -4
- package/dist/{chunk-2M6DVNI5.js → chunk-LRU5BK3L.js} +4 -4
- package/dist/{chunk-T6SYGLWR.js → chunk-LXFY64QR.js} +3 -3
- package/dist/{chunk-BWCWTHYS.js → chunk-NGTVREIH.js} +4 -4
- package/dist/chunk-NGTVREIH.js.map +1 -0
- package/dist/{chunk-NTWW7J76.js → chunk-OA2GKJVM.js} +2 -2
- package/dist/{chunk-DC5DDJVE.js → chunk-QRAKST62.js} +4 -4
- package/dist/{chunk-YLK2J5YK.js → chunk-RGB7WBFD.js} +73 -9
- package/dist/chunk-RGB7WBFD.js.map +1 -0
- package/dist/{chunk-APKH2T6E.js → chunk-TKVGEFMH.js} +3 -3
- package/dist/{chunk-2JFPBZJK.js → chunk-TVKYNKB3.js} +10 -10
- package/dist/{chunk-GAJIJKET.js → chunk-UMGAACCP.js} +3 -3
- package/dist/{chunk-MWBJ3KTF.js → chunk-UZGSFQLT.js} +4 -4
- package/dist/{chunk-SWSTHZBI.js → chunk-VCQOUFTZ.js} +4 -4
- package/dist/{chunk-FLAO4ZS3.js → chunk-VQK4VHLF.js} +8 -8
- package/dist/chunk-VQK4VHLF.js.map +1 -0
- package/dist/{chunk-N7JSEDSC.js → chunk-W6AZHTGB.js} +2 -2
- package/dist/{chunk-M2RLHZ4J.js → chunk-W7RSTW55.js} +2 -2
- package/dist/{chunk-3NWX34ZI.js → chunk-WZFA33SD.js} +6 -6
- package/dist/{chunk-5G53XATW.js → chunk-ZDYW7XTS.js} +3 -3
- package/dist/{chunk-PL4UAF4S.js → chunk-ZH3VTIBL.js} +9 -9
- package/dist/{chunk-UWQ2UVHE.js → chunk-ZJNE4BKG.js} +4 -4
- package/dist/{chunk-MOWMCEOJ.js → chunk-ZYRHDBVS.js} +5 -5
- package/dist/{cli-PSKNB66T.js → cli-7OIV7UXF.js} +35 -34
- package/dist/cli-7OIV7UXF.js.map +1 -0
- package/dist/{cli-UQ7A3YA2.js → cli-CSXPJZVM.js} +14 -14
- package/dist/{cli-EPVZHAZS.js → cli-EOSY3WVX.js} +10 -10
- package/dist/{cli-6EWVMEN6.js → cli-IX3WSFV4.js} +2 -2
- package/dist/{cli-LUCSGTVI.js → cli-IYC7F5OJ.js} +13 -13
- package/dist/{cli-6H7HVDMQ.js → cli-JER6KIUJ.js} +20 -20
- package/dist/{cli-UO4NHIB3.js → cli-PNK2HTIC.js} +11 -11
- package/dist/{cli-YHYDLQAF.js → cli-WGONI6PJ.js} +7 -7
- package/dist/{cli-NIG4N3XM.js → cli-X24QGW6Y.js} +11 -11
- package/dist/cli.js +11 -11
- package/dist/{config-P4HDNTYD.js → config-YWSNBFEE.js} +3 -3
- package/dist/docmeta.js +6 -6
- package/dist/{github-7ZCH5PSO.js → github-GFTLEZ3D.js} +9 -9
- package/dist/{github-POT6724K.js → github-LL5LHQFG.js} +11 -11
- package/dist/index.d.ts +5 -5
- package/dist/index.js +32 -32
- package/dist/{json-KT2K62L5.js → json-XDV4CZEU.js} +9 -9
- package/dist/{lint-5AQ5C2BV.js → lint-NO4GIR3Z.js} +9 -9
- package/dist/{list-5JZKX2NK.js → list-4G6F5BX2.js} +9 -9
- package/dist/{list-SWPFXQMU.js → list-4GJ6KI4U.js} +9 -9
- package/dist/{page-UPSXRP75.js → page-4VJQELH5.js} +8 -8
- package/dist/{prepare-6GNEWCNH.js → prepare-TGHFPUYE.js} +17 -17
- package/dist/prepare-TGHFPUYE.js.map +1 -0
- package/dist/{pretty-Q6FQAOK4.js → pretty-HFA6ITJY.js} +10 -10
- package/dist/{pretty-SQRPFPSQ.js → pretty-ZMKG3AJR.js} +9 -9
- package/dist/{provider-AMGRDY6V.js → provider-527CO4DM.js} +2 -2
- package/dist/{release-IECYCLTD.js → release-3D5PK6M7.js} +2 -2
- package/dist/release-3D5PK6M7.js.map +1 -0
- package/dist/{reporters-45MMC2ID.js → reporters-DZTHBJEA.js} +8 -8
- package/dist/{reporters-XUV4MM64.js → reporters-FRM5BHPL.js} +4 -4
- package/dist/{run-KMWY2IAN.js → run-BRC64Y7B.js} +9 -9
- package/dist/{conformance-ZFCMKM6M.js → runtime-7QE3DW6S.js} +2 -2
- package/dist/{term-PCJUCWNF.js → term-PNWS7F5B.js} +13 -13
- package/dist/{validate-IMNCZNWG.js → validate-ULPJI4GQ.js} +4 -4
- package/package.json +1 -1
- package/plugin/manni/.claude-plugin/plugin.json +1 -1
- package/dist/check-WB2QDHJQ.js.map +0 -1
- package/dist/chunk-BWCWTHYS.js.map +0 -1
- package/dist/chunk-FLAO4ZS3.js.map +0 -1
- package/dist/chunk-TH4JVQPF.js.map +0 -1
- package/dist/chunk-XPEWUK7J.js.map +0 -1
- package/dist/chunk-YLK2J5YK.js.map +0 -1
- package/dist/cli-PSKNB66T.js.map +0 -1
- package/dist/prepare-6GNEWCNH.js.map +0 -1
- package/dist/release-IECYCLTD.js.map +0 -1
- /package/dist/{batch-OZOACN4G.js.map → batch-6LJJZTT7.js.map} +0 -0
- /package/dist/{build-Z5VOVADH.js.map → build-QKFXKAXT.js.map} +0 -0
- /package/dist/{calibrate-TZYT42DR.js.map → calibrate-UQJR3WCU.js.map} +0 -0
- /package/dist/{capture-SL4MNDDP.js.map → capture-HQ2PGM5Z.js.map} +0 -0
- /package/dist/{check-5OMA42Y6.js.map → check-3DZOMJ7R.js.map} +0 -0
- /package/dist/{check-PKY7KTQE.js.map → check-BF56QRWL.js.map} +0 -0
- /package/dist/{chunk-TLXE7LYK.js.map → chunk-22G33NL2.js.map} +0 -0
- /package/dist/{chunk-2KRB3EG7.js.map → chunk-2QEHLWYM.js.map} +0 -0
- /package/dist/{chunk-QW77LCOU.js.map → chunk-426TGC2Q.js.map} +0 -0
- /package/dist/{chunk-Z4IZGEM3.js.map → chunk-77WI6LJW.js.map} +0 -0
- /package/dist/{chunk-KCOFEWV5.js.map → chunk-A36QDIXZ.js.map} +0 -0
- /package/dist/{chunk-73TC4DYH.js.map → chunk-ALAH6HNY.js.map} +0 -0
- /package/dist/{chunk-GREQKO6M.js.map → chunk-AZXCL5WH.js.map} +0 -0
- /package/dist/{chunk-MHM4QEBV.js.map → chunk-BMRZFTAD.js.map} +0 -0
- /package/dist/{chunk-IY7NYNPZ.js.map → chunk-BP7LGVF3.js.map} +0 -0
- /package/dist/{chunk-7WRP5FFP.js.map → chunk-CHDADR7F.js.map} +0 -0
- /package/dist/{chunk-NBMPHD4I.js.map → chunk-EOGF6VCA.js.map} +0 -0
- /package/dist/{chunk-SM6NOMJS.js.map → chunk-G4T6SF3C.js.map} +0 -0
- /package/dist/{chunk-733Y2STG.js.map → chunk-GEX2HDAT.js.map} +0 -0
- /package/dist/{chunk-NHHOPZRA.js.map → chunk-GWGR7BDP.js.map} +0 -0
- /package/dist/{chunk-UAKNZVCD.js.map → chunk-H3LM7D6K.js.map} +0 -0
- /package/dist/{chunk-C73RSUIC.js.map → chunk-HOE2C42K.js.map} +0 -0
- /package/dist/{chunk-B3TS4WRM.js.map → chunk-HYT242KI.js.map} +0 -0
- /package/dist/{chunk-C3B2VJNC.js.map → chunk-J3IK5IGO.js.map} +0 -0
- /package/dist/{chunk-M6GSS72T.js.map → chunk-JUN4DUHG.js.map} +0 -0
- /package/dist/{chunk-TUAAR3MM.js.map → chunk-KRSLDZ7N.js.map} +0 -0
- /package/dist/{chunk-UJSGS2Y5.js.map → chunk-KWAXJCKS.js.map} +0 -0
- /package/dist/{chunk-2M6DVNI5.js.map → chunk-LRU5BK3L.js.map} +0 -0
- /package/dist/{chunk-T6SYGLWR.js.map → chunk-LXFY64QR.js.map} +0 -0
- /package/dist/{chunk-NTWW7J76.js.map → chunk-OA2GKJVM.js.map} +0 -0
- /package/dist/{chunk-DC5DDJVE.js.map → chunk-QRAKST62.js.map} +0 -0
- /package/dist/{chunk-APKH2T6E.js.map → chunk-TKVGEFMH.js.map} +0 -0
- /package/dist/{chunk-2JFPBZJK.js.map → chunk-TVKYNKB3.js.map} +0 -0
- /package/dist/{chunk-GAJIJKET.js.map → chunk-UMGAACCP.js.map} +0 -0
- /package/dist/{chunk-MWBJ3KTF.js.map → chunk-UZGSFQLT.js.map} +0 -0
- /package/dist/{chunk-SWSTHZBI.js.map → chunk-VCQOUFTZ.js.map} +0 -0
- /package/dist/{chunk-N7JSEDSC.js.map → chunk-W6AZHTGB.js.map} +0 -0
- /package/dist/{chunk-M2RLHZ4J.js.map → chunk-W7RSTW55.js.map} +0 -0
- /package/dist/{chunk-3NWX34ZI.js.map → chunk-WZFA33SD.js.map} +0 -0
- /package/dist/{chunk-5G53XATW.js.map → chunk-ZDYW7XTS.js.map} +0 -0
- /package/dist/{chunk-PL4UAF4S.js.map → chunk-ZH3VTIBL.js.map} +0 -0
- /package/dist/{chunk-UWQ2UVHE.js.map → chunk-ZJNE4BKG.js.map} +0 -0
- /package/dist/{chunk-MOWMCEOJ.js.map → chunk-ZYRHDBVS.js.map} +0 -0
- /package/dist/{cli-UQ7A3YA2.js.map → cli-CSXPJZVM.js.map} +0 -0
- /package/dist/{cli-EPVZHAZS.js.map → cli-EOSY3WVX.js.map} +0 -0
- /package/dist/{cli-6EWVMEN6.js.map → cli-IX3WSFV4.js.map} +0 -0
- /package/dist/{cli-LUCSGTVI.js.map → cli-IYC7F5OJ.js.map} +0 -0
- /package/dist/{cli-6H7HVDMQ.js.map → cli-JER6KIUJ.js.map} +0 -0
- /package/dist/{cli-UO4NHIB3.js.map → cli-PNK2HTIC.js.map} +0 -0
- /package/dist/{cli-YHYDLQAF.js.map → cli-WGONI6PJ.js.map} +0 -0
- /package/dist/{cli-NIG4N3XM.js.map → cli-X24QGW6Y.js.map} +0 -0
- /package/dist/{config-P4HDNTYD.js.map → config-YWSNBFEE.js.map} +0 -0
- /package/dist/{conformance-ZFCMKM6M.js.map → github-GFTLEZ3D.js.map} +0 -0
- /package/dist/{github-7ZCH5PSO.js.map → github-LL5LHQFG.js.map} +0 -0
- /package/dist/{github-POT6724K.js.map → json-XDV4CZEU.js.map} +0 -0
- /package/dist/{json-KT2K62L5.js.map → lint-NO4GIR3Z.js.map} +0 -0
- /package/dist/{lint-5AQ5C2BV.js.map → list-4G6F5BX2.js.map} +0 -0
- /package/dist/{list-5JZKX2NK.js.map → list-4GJ6KI4U.js.map} +0 -0
- /package/dist/{list-SWPFXQMU.js.map → page-4VJQELH5.js.map} +0 -0
- /package/dist/{page-UPSXRP75.js.map → pretty-HFA6ITJY.js.map} +0 -0
- /package/dist/{pretty-Q6FQAOK4.js.map → pretty-ZMKG3AJR.js.map} +0 -0
- /package/dist/{pretty-SQRPFPSQ.js.map → provider-527CO4DM.js.map} +0 -0
- /package/dist/{provider-AMGRDY6V.js.map → reporters-DZTHBJEA.js.map} +0 -0
- /package/dist/{reporters-45MMC2ID.js.map → reporters-FRM5BHPL.js.map} +0 -0
- /package/dist/{reporters-XUV4MM64.js.map → run-BRC64Y7B.js.map} +0 -0
- /package/dist/{run-KMWY2IAN.js.map → runtime-7QE3DW6S.js.map} +0 -0
- /package/dist/{term-PCJUCWNF.js.map → term-PNWS7F5B.js.map} +0 -0
- /package/dist/{validate-IMNCZNWG.js.map → validate-ULPJI4GQ.js.map} +0 -0
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
paragraphAfter,
|
|
16
16
|
parseSrc,
|
|
17
17
|
ruleId
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-BMRZFTAD.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-
|
|
27
|
+
} from "./chunk-KRSLDZ7N.js";
|
|
28
28
|
import {
|
|
29
29
|
isErrorSeverity
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-A36QDIXZ.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-
|
|
622
|
+
//# sourceMappingURL=chunk-H3LM7D6K.js.map
|
|
@@ -22,7 +22,7 @@ function libraryLocalModels(connections) {
|
|
|
22
22
|
}
|
|
23
23
|
var GB = 1024 ** 3;
|
|
24
24
|
|
|
25
|
-
// src/tracevals/reporters/
|
|
25
|
+
// src/tracevals/reporters/runtime.ts
|
|
26
26
|
var count = (n, one, many) => `${String(n)} ${n === 1 ? one : many}`;
|
|
27
27
|
function renderCheck(report, opts = {}) {
|
|
28
28
|
const pc = palette(opts.color === true);
|
|
@@ -32,7 +32,7 @@ function renderCheck(report, opts = {}) {
|
|
|
32
32
|
if (findings.length === 0) continue;
|
|
33
33
|
lines.push(source.path);
|
|
34
34
|
for (const f of findings) {
|
|
35
|
-
const mark = f.outcome
|
|
35
|
+
const mark = f.outcome !== "fail" ? pc.yellow("?") : f.severity === "error" ? pc.red("\u2716") : pc.yellow("!");
|
|
36
36
|
lines.push(` ${mark} ${f.rule} ${f.text}`);
|
|
37
37
|
lines.push(` ${pc.dim(`${f.observed} (${f.confidence.toFixed(2)})`)}`);
|
|
38
38
|
}
|
|
@@ -77,11 +77,12 @@ function closing(report) {
|
|
|
77
77
|
case null: {
|
|
78
78
|
const broken = summary.fail > 0 ? `${String(summary.fail)} broken` : "None broken";
|
|
79
79
|
const review = summary.needsReview > 0 ? `, ${String(summary.needsReview)} needs review` : "";
|
|
80
|
-
|
|
80
|
+
const reported = summary.reported > 0 ? `, ${String(summary.reported)} reported` : "";
|
|
81
|
+
return `${head} ${scope}. ${broken}${review}${reported}.`;
|
|
81
82
|
}
|
|
82
83
|
}
|
|
83
84
|
}
|
|
84
|
-
var NOT_SET_UP = "tracevals
|
|
85
|
+
var NOT_SET_UP = "tracevals runtime evals are not set up; nothing to prepare.";
|
|
85
86
|
function renderPrepare(report) {
|
|
86
87
|
const lines = [];
|
|
87
88
|
const said = /* @__PURE__ */ new Set();
|
|
@@ -130,4 +131,4 @@ export {
|
|
|
130
131
|
NO_HOST,
|
|
131
132
|
renderRelease
|
|
132
133
|
};
|
|
133
|
-
//# sourceMappingURL=chunk-
|
|
134
|
+
//# sourceMappingURL=chunk-HNMXL2OE.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/tracevals/rules/local.ts","../src/tracevals/reporters/runtime.ts"],"sourcesContent":["/**\n * What tracevals asks of a local model without loading it (proposal 0079,\n * gates 5, 8 and 9, and `prepare`). The inference library owns every answer;\n * this is the one seam, so a test can say \"downloading\" without a runtime.\n */\nimport {\n ensureModel,\n fits,\n modelState,\n nodeLlamaCppStatus,\n type EnsureModelResult,\n type FitsResult,\n type LlamaModelState,\n} from \"@hawkeyexl/inference\";\nimport type { ProviderConnections } from \"../../shared/providers.js\";\n\nexport interface LocalModels {\n /** Whether the llama.cpp binding is importable now, installing nothing. */\n runtimePresent(): Promise<boolean>;\n /** `ready`, `downloading` or `missing`, read without loading or fetching. */\n state(model: string): Promise<LlamaModelState>;\n /** The memory probe `auto` tiering uses. */\n fits(model: string): Promise<FitsResult>;\n /** Fetch the runtime and the weights, without loading either. */\n ensure(model: string): Promise<EnsureModelResult>;\n}\n\n/** The library's lifecycle calls, pointed at the family's models directory. */\nexport function libraryLocalModels(connections: ProviderConnections): LocalModels {\n const modelsDir = connections[\"llama-cpp\"]?.modelsDir;\n const options = modelsDir === undefined ? {} : { modelsDirectory: modelsDir };\n return {\n runtimePresent: async () => (await nodeLlamaCppStatus()).state === \"present\",\n state: (model) => modelState(model, options),\n fits: (model) => fits(model, options),\n ensure: (model) => ensureModel(model, options),\n };\n}\n\n/** Bytes in a gigabyte as the messages count them. */\nexport const GB = 1024 ** 3;\n","/**\n * Pretty output for `check`, `prepare` and `release` (proposal 0079). JSON is\n * each report as it stands, so only prose lives here. Colour is the caller's\n * decision, made once by `colorFor`.\n */\nimport { palette } from \"../../shared/color.js\";\nimport type { CheckReport } from \"../commands/check.js\";\nimport type { PrepareReport } from \"../commands/prepare.js\";\nimport type { ReleaseReport } from \"../commands/release.js\";\nimport { GB } from \"../rules/local.js\";\n\nconst count = (n: number, one: string, many: string): string =>\n `${String(n)} ${n === 1 ? one : many}`;\n\n/** Findings grouped under their source, then the closing line. */\nexport function renderCheck(report: CheckReport, opts: { color?: boolean } = {}): string {\n const pc = palette(opts.color === true);\n const lines: string[] = [];\n for (const source of report.sources) {\n const findings = report.findings.filter((f) => f.source === source.path);\n if (findings.length === 0) continue;\n lines.push(source.path);\n for (const f of findings) {\n const mark =\n f.outcome !== \"fail\" ? pc.yellow(\"?\") : f.severity === \"error\" ? pc.red(\"✖\") : pc.yellow(\"!\");\n lines.push(` ${mark} ${f.rule} ${f.text}`);\n lines.push(` ${pc.dim(`${f.observed} (${f.confidence.toFixed(2)})`)}`);\n }\n }\n lines.push(...sessionSoFar(report));\n for (const warning of report.warnings) lines.push(`${pc.yellow(\"!\")} ${warning}`);\n if (lines.length > 0) lines.push(\"\");\n lines.push(closing(report));\n return lines.join(\"\\n\");\n}\n\n/** The ledger's rules that were ever broken or sent to review, and a count of the rest. */\nfunction sessionSoFar(report: CheckReport): string[] {\n const rules = report.session?.rules ?? [];\n if (rules.length === 0) return [];\n const flagged = rules.filter((r) => r.broken > 0 || r.needsReview > 0);\n const lines = flagged.map((r) => {\n const counts = [\n [\"broken\", r.broken],\n [\"repaired\", r.repaired],\n [\"needs review\", r.needsReview],\n [\"followed\", r.followed],\n ] as const;\n const said = counts.filter(([, n]) => n > 0).map(([word, n]) => `${word} ${String(n)}`);\n return ` ${r.source}#${r.rule} ${said.join(\", \")}`;\n });\n const held = rules.length - flagged.length;\n if (held > 0) {\n lines.push(` ${count(held, \"rule\", \"rules\")} held every turn ${held === 1 ? \"it\" : \"they\"} applied to.`);\n }\n return [\"Session so far\", ...lines];\n}\n\nfunction closing(report: CheckReport): string {\n const head = `Last turn of ${report.sessionId.slice(0, 8)}:`;\n const { summary } = report;\n // \"sources\", because a typed prompt is not a file (proposal 0080).\n const scope = `${count(summary.rules, \"rule\", \"rules\")} from ${count(summary.sources, \"source\", \"sources\")}`;\n switch (report.skipped) {\n case \"empty-turn\":\n return `${head} nothing happened after the last prompt.`;\n case \"no-sources\":\n return `${head} no rule sources governed it.`;\n case \"not-applicable\":\n return `${head} ${scope}, none apply to this turn.`;\n case null: {\n const broken = summary.fail > 0 ? `${String(summary.fail)} broken` : \"None broken\";\n const review = summary.needsReview > 0 ? `, ${String(summary.needsReview)} needs review` : \"\";\n const reported = summary.reported > 0 ? `, ${String(summary.reported)} reported` : \"\";\n return `${head} ${scope}. ${broken}${review}${reported}.`;\n }\n }\n}\n\nexport const NOT_SET_UP = \"tracevals runtime evals are not set up; nothing to prepare.\";\n\nexport function renderPrepare(report: PrepareReport): string {\n const lines: string[] = [];\n const said = new Set<string>();\n for (const m of report.models) {\n if (m.state === \"hosted\" || said.has(m.model)) continue;\n said.add(m.model);\n const name = `${m.model} (${m.provider})`;\n lines.push(\n m.state === \"downloaded\"\n ? `${name} downloaded, ${((m.bytes ?? 0) / GB).toFixed(2)} GB.`\n : `${name} is ${m.state}.`,\n );\n }\n const ex = report.extraction;\n if (ex !== null) {\n const files = (n: number): string =>\n `${count(n, \"file\", \"files\")} that ${n === 1 ? \"applies\" : \"apply\"} to every session`;\n if (ex.extracted > 0) {\n lines.push(\n `Extracted ${count(ex.rules, \"rule\", \"rules\")} from ${files(ex.extracted)}.` +\n (ex.cached > 0 ? ` ${String(ex.cached)} more ${ex.cached === 1 ? \"was\" : \"were\"} cached.` : \"\"),\n );\n } else if (ex.cached > 0) {\n lines.push(`${files(ex.cached)} ${ex.cached === 1 ? \"is\" : \"are\"} cached. Nothing to extract.`);\n } else {\n lines.push(\"No file applies to every session. Nothing to extract.\");\n }\n }\n for (const warning of report.warnings) lines.push(warning);\n return lines.join(\"\\n\");\n}\n\nexport const NO_HOST = \"No model host is running.\";\n\nexport function renderRelease(report: ReleaseReport): string {\n if (!report.hostStopped && report.released.length === 0 && report.unloaded.length === 0) {\n return NO_HOST;\n }\n const unloaded = report.unloaded.length > 0 ? `Unloaded ${report.unloaded.join(\", \")}` : \"\";\n const stopped = report.hostStopped ? \"stopped the model host\" : \"\";\n const action = [unloaded, stopped].filter((s) => s !== \"\").join(\" and \");\n const held = count(report.released.length, \"session\", \"sessions\");\n return `${action === \"\" ? \"Released the lease\" : action}. ${held} held it.`;\n}\n"],"mappings":";;;;;;AAKA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAIK;AAeA,SAAS,mBAAmB,aAA+C;AAChF,QAAM,YAAY,YAAY,WAAW,GAAG;AAC5C,QAAM,UAAU,cAAc,SAAY,CAAC,IAAI,EAAE,iBAAiB,UAAU;AAC5E,SAAO;AAAA,IACL,gBAAgB,aAAa,MAAM,mBAAmB,GAAG,UAAU;AAAA,IACnE,OAAO,CAAC,UAAU,WAAW,OAAO,OAAO;AAAA,IAC3C,MAAM,CAAC,UAAU,KAAK,OAAO,OAAO;AAAA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AA,IACpE;AAAA,EACF;AACA,aAAW,WAAW,OAAO,SAAU,OAAM,KAAK,OAAO;AACzD,SAAO,MAAM,KAAK,IAAI;AACxB;AAEO,IAAM,UAAU;AAEhB,SAAS,cAAc,QAA+B;AAC3D,MAAI,CAAC,OAAO,eAAe,OAAO,SAAS,WAAW,KAAK,OAAO,SAAS,WAAW,GAAG;AACvF,WAAO;AAAA,EACT;AACA,QAAM,WAAW,OAAO,SAAS,SAAS,IAAI,YAAY,OAAO,SAAS,KAAK,IAAI,CAAC,KAAK;AACzF,QAAM,UAAU,OAAO,cAAc,2BAA2B;AAChE,QAAM,SAAS,CAAC,UAAU,OAAO,EAAE,OAAO,CAAC,MAAM,MAAM,EAAE,EAAE,KAAK,OAAO;AACvE,QAAM,OAAO,MAAM,OAAO,SAAS,QAAQ,WAAW,UAAU;AAChE,SAAO,GAAG,WAAW,KAAK,uBAAuB,MAAM,KAAK,IAAI;AAClE;","names":[]}
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
CONCEPT_FIELDS,
|
|
11
11
|
fieldPointer,
|
|
12
12
|
valueAt
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-AZXCL5WH.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-
|
|
23
|
+
} from "./chunk-A36QDIXZ.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-
|
|
1975
|
+
//# sourceMappingURL=chunk-HOE2C42K.js.map
|
|
@@ -7,22 +7,22 @@ import {
|
|
|
7
7
|
loadGraderPlugins,
|
|
8
8
|
parseNewerThan,
|
|
9
9
|
urlManifestRefusal
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-ZH3VTIBL.js";
|
|
11
11
|
import {
|
|
12
12
|
discoverArtifacts
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-2QEHLWYM.js";
|
|
14
14
|
import {
|
|
15
15
|
discoverTraces
|
|
16
16
|
} from "./chunk-4TSWU2SU.js";
|
|
17
17
|
import {
|
|
18
18
|
discoverConfig
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-KPXOJMQ6.js";
|
|
20
20
|
import {
|
|
21
21
|
assertProviderSelection,
|
|
22
22
|
constructProvider,
|
|
23
23
|
resolveProviderIdentity,
|
|
24
24
|
selectProvider
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-NGTVREIH.js";
|
|
26
26
|
import {
|
|
27
27
|
TracevalsError
|
|
28
28
|
} from "./chunk-UKZNLVJW.js";
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
externalWriteWarnings,
|
|
37
37
|
mergeMetaProvenance,
|
|
38
38
|
offerExternalHomes
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-AZXCL5WH.js";
|
|
40
40
|
import {
|
|
41
41
|
keyHome,
|
|
42
42
|
marksValidator,
|
|
@@ -44,12 +44,12 @@ import {
|
|
|
44
44
|
readManifestOrEmpty,
|
|
45
45
|
readManifestValue,
|
|
46
46
|
spliceManifestValue
|
|
47
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-KRSLDZ7N.js";
|
|
48
48
|
import {
|
|
49
49
|
DocmetaError,
|
|
50
50
|
extractFrontmatter,
|
|
51
51
|
writeFileAtomic
|
|
52
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-A36QDIXZ.js";
|
|
53
53
|
import {
|
|
54
54
|
palette
|
|
55
55
|
} from "./chunk-RNVYGWIC.js";
|
|
@@ -1191,4 +1191,4 @@ export {
|
|
|
1191
1191
|
runFill,
|
|
1192
1192
|
renderFill
|
|
1193
1193
|
};
|
|
1194
|
-
//# sourceMappingURL=chunk-
|
|
1194
|
+
//# sourceMappingURL=chunk-HYT242KI.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
displayPath
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-HOE2C42K.js";
|
|
5
5
|
import {
|
|
6
6
|
escapeWorkflowCommandMessage,
|
|
7
7
|
escapeWorkflowCommandProperty
|
|
@@ -20,4 +20,4 @@ function renderFindingsGithub(report) {
|
|
|
20
20
|
export {
|
|
21
21
|
renderFindingsGithub
|
|
22
22
|
};
|
|
23
|
-
//# sourceMappingURL=chunk-
|
|
23
|
+
//# sourceMappingURL=chunk-J3IK5IGO.js.map
|
|
@@ -40,18 +40,18 @@ import {
|
|
|
40
40
|
parserForExtension,
|
|
41
41
|
supportedExtensions,
|
|
42
42
|
unsupportedFormatMessage
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-ALAH6HNY.js";
|
|
44
44
|
import {
|
|
45
45
|
metaPageView
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-22G33NL2.js";
|
|
47
47
|
import {
|
|
48
48
|
STDIN_REQUIRES_AS,
|
|
49
49
|
writeTextAtomic
|
|
50
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-KRSLDZ7N.js";
|
|
51
51
|
import {
|
|
52
52
|
extractFrontmatter,
|
|
53
53
|
extractorForExtension
|
|
54
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-A36QDIXZ.js";
|
|
55
55
|
import {
|
|
56
56
|
selectCollections
|
|
57
57
|
} from "./chunk-XKBEHKWO.js";
|
|
@@ -60,7 +60,7 @@ import {
|
|
|
60
60
|
} from "./chunk-HX44GB4Z.js";
|
|
61
61
|
import {
|
|
62
62
|
package_default
|
|
63
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-CGO5MNRD.js";
|
|
64
64
|
import {
|
|
65
65
|
errorMessage
|
|
66
66
|
} from "./chunk-G3T47CFV.js";
|
|
@@ -1810,4 +1810,4 @@ export {
|
|
|
1810
1810
|
runBuild,
|
|
1811
1811
|
buildGraph
|
|
1812
1812
|
};
|
|
1813
|
-
//# sourceMappingURL=chunk-
|
|
1813
|
+
//# sourceMappingURL=chunk-JUN4DUHG.js.map
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
import {
|
|
7
7
|
JEV,
|
|
8
8
|
JEV_OUT_OF_LOOP
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-NGTVREIH.js";
|
|
10
10
|
import {
|
|
11
11
|
TracevalsError
|
|
12
12
|
} from "./chunk-UKZNLVJW.js";
|
|
@@ -43,7 +43,7 @@ var config_schema_default = {
|
|
|
43
43
|
provider: {
|
|
44
44
|
type: "string",
|
|
45
45
|
minLength: 1,
|
|
46
|
-
description: "Which provider judges out of the loop, and extracts rules: auto, anthropic, openai, claude-cli, or llama-cpp. jev only decides, so it is refused here; name it as
|
|
46
|
+
description: "Which provider judges out of the loop, and extracts rules: auto, anthropic, openai, claude-cli, or llama-cpp. jev only decides, so it is refused here; name it as runtime.hook.provider. Overrides the family's top-level `providers.provider` for tracevals only. Connection settings \u2014 an endpoint, an API key's environment variable, the Claude CLI command \u2014 live in that top-level `providers:` map, never here."
|
|
47
47
|
},
|
|
48
48
|
model: {
|
|
49
49
|
type: "string",
|
|
@@ -177,10 +177,10 @@ var config_schema_default = {
|
|
|
177
177
|
}
|
|
178
178
|
}
|
|
179
179
|
},
|
|
180
|
-
|
|
180
|
+
runtime: {
|
|
181
181
|
type: "object",
|
|
182
182
|
additionalProperties: false,
|
|
183
|
-
description: "
|
|
183
|
+
description: "Runtime evals: each turn checked against the rules the files that govern the agent declare. Present, even as {}, it puts tracevals in play under Claude Code hooks; absent, tracevals stays out of them.",
|
|
184
184
|
properties: {
|
|
185
185
|
hook: {
|
|
186
186
|
type: "object",
|
|
@@ -211,7 +211,7 @@ var config_schema_default = {
|
|
|
211
211
|
},
|
|
212
212
|
exclude: {
|
|
213
213
|
type: "array",
|
|
214
|
-
description: "Globs, relative to the project root, naming files never treated as rule sources, in any format. It removes plan and
|
|
214
|
+
description: "Globs, relative to the project root, naming files never treated as rule sources, in any format. It removes plan, spec and output style files too. It also matches the sources `prompt`, `plan` and `system-prompt` by name.",
|
|
215
215
|
items: { type: "string", minLength: 1 }
|
|
216
216
|
},
|
|
217
217
|
plans: {
|
|
@@ -386,6 +386,9 @@ function camelCaseHint(key, parentSchema) {
|
|
|
386
386
|
const properties = parentSchema.properties;
|
|
387
387
|
return properties !== null && typeof properties === "object" && Object.hasOwn(properties, camel) ? `; did you mean "${camel}"?` : "";
|
|
388
388
|
}
|
|
389
|
+
function renamedRuntimeHint(instancePath, key) {
|
|
390
|
+
return instancePath === "" && key === "conformance" ? `; it is now "runtime"` : "";
|
|
391
|
+
}
|
|
389
392
|
function movedProviderHint(instancePath, keyword) {
|
|
390
393
|
return instancePath === "/provider" && keyword === "type" ? `; "provider" is now a provider name; per-provider settings moved to the top-level providers: map` : "";
|
|
391
394
|
}
|
|
@@ -398,7 +401,7 @@ function parseConfig(raw, file = {}) {
|
|
|
398
401
|
if (!validate2(raw)) {
|
|
399
402
|
const detail = (validate2.errors ?? []).map((e) => {
|
|
400
403
|
const extra = e.keyword === "additionalProperties" ? e.params.additionalProperty : void 0;
|
|
401
|
-
return extra !== void 0 ? `unknown key "${extra}"${camelCaseHint(extra, e.parentSchema)}` : `${CONFIG_SECTION_KEY_PATH}${e.instancePath} ${e.message ?? "is invalid"}` + movedProviderHint(e.instancePath, e.keyword);
|
|
404
|
+
return extra !== void 0 ? `unknown key "${extra}"${camelCaseHint(extra, e.parentSchema)}${renamedRuntimeHint(e.instancePath, extra)}` : `${CONFIG_SECTION_KEY_PATH}${e.instancePath} ${e.message ?? "is invalid"}` + movedProviderHint(e.instancePath, e.keyword);
|
|
402
405
|
}).join("; ");
|
|
403
406
|
throw new TracevalsError(`${source}: ${detail}`);
|
|
404
407
|
}
|
|
@@ -408,7 +411,7 @@ function parseConfig(raw, file = {}) {
|
|
|
408
411
|
if (provider === JEV) throw new TracevalsError(JEV_OUT_OF_LOOP);
|
|
409
412
|
assertKnownProvider(provider, (message) => new TracevalsError(message));
|
|
410
413
|
}
|
|
411
|
-
const hookProvider = r.
|
|
414
|
+
const hookProvider = r.runtime?.hook?.provider ?? null;
|
|
412
415
|
if (hookProvider !== null) {
|
|
413
416
|
assertKnownProvider(hookProvider, (message) => new TracevalsError(message), { decisions: true });
|
|
414
417
|
}
|
|
@@ -477,15 +480,15 @@ function parseConfig(raw, file = {}) {
|
|
|
477
480
|
// An observation, not a gate: listing it is opt-in because a real roster
|
|
478
481
|
// runs to hundreds of skills (ADR 01016).
|
|
479
482
|
reportUnusedArtifacts: r.reportUnusedArtifacts ?? false,
|
|
480
|
-
|
|
483
|
+
runtime: r.runtime === void 0 ? null : {
|
|
481
484
|
hook: {
|
|
482
485
|
provider: hookProvider,
|
|
483
|
-
model: r.
|
|
484
|
-
runs: r.
|
|
486
|
+
model: r.runtime.hook?.model ?? null,
|
|
487
|
+
runs: r.runtime.hook?.runs ?? 1
|
|
485
488
|
},
|
|
486
|
-
include: [...r.
|
|
487
|
-
exclude: [...r.
|
|
488
|
-
plans: [...r.
|
|
489
|
+
include: [...r.runtime.include ?? []],
|
|
490
|
+
exclude: [...r.runtime.exclude ?? []],
|
|
491
|
+
plans: [...r.runtime.plans ?? []]
|
|
489
492
|
}
|
|
490
493
|
};
|
|
491
494
|
compileRedactPatterns(config.judge.redact);
|
|
@@ -529,4 +532,4 @@ export {
|
|
|
529
532
|
discoverConfig,
|
|
530
533
|
loadConfig
|
|
531
534
|
};
|
|
532
|
-
//# sourceMappingURL=chunk-
|
|
535
|
+
//# sourceMappingURL=chunk-KPXOJMQ6.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/tracevals/core/config.ts","../src/tracevals/core/config-schema.json","../src/tracevals/calibrate/labels.ts","../src/tracevals/calibrate/labels-schema.json"],"sourcesContent":["/**\n * Config loading. Every knob flows config → Ajv validate → defaults → CLI\n * override (`??` at the read site) → runtime; parseConfig() fills every\n * default so downstream code never re-applies one.\n *\n * Settings live under a `tracevals:` key in `manni.config.yaml`, one file\n * shared by the whole manni family. Sibling keys belong to other tools and are\n * ignored here, so parseConfig() validates the section — never the file root.\n * Finding the file is the shared loader's job (`src/shared/config-file.ts`).\n */\nimport { Ajv2020 } from \"ajv/dist/2020.js\";\nimport configSchemaJson from \"./config-schema.json\" with { type: \"json\" };\nimport {\n FAMILY_CONFIG_NAMES,\n findConfigFileSync,\n readConfigFileSync,\n type ConfigFileOptions,\n} from \"../../shared/config-file.js\";\nimport type { CollectionConfig } from \"../../shared/collections.js\";\nimport {\n assertKnownProvider,\n type ProvidersConfig,\n} from \"../../shared/providers.js\";\nimport { compileRedactPatterns } from \"../judge/redact.js\";\nimport { JEV, JEV_OUT_OF_LOOP } from \"../judge/provider.js\";\nimport { DEFAULT_CAPTURE_DIR } from \"../capture/types.js\";\nimport { DEFAULT_LABELS_FILE } from \"../calibrate/labels.js\";\nimport { TracevalsError } from \"../types.js\";\nimport {\n configuredGrants,\n EXECUTION_GRANTS,\n isExecutionGrant,\n unknownGrantsMessage,\n type ExecutionGrant,\n} from \"../../shared/execution.js\";\n\nconst configSchema = configSchemaJson as Record<string, unknown>;\n\nexport const DEFAULT_CONFIG_FILENAME =\n FAMILY_CONFIG_NAMES[0] ?? \"manni.config.yaml\";\n\n/**\n * Top-level key holding this tool's settings inside the shared family config.\n * Sibling tools (meta, docevals) own their own keys in the same file.\n */\nexport const CONFIG_SECTION_KEY = \"tracevals\";\n\n/**\n * The section key as an error's instance path spells it. The schema describes\n * the section rather than the file, so Ajv's own paths start below it; a\n * message that said `/provider` would name a key nobody writes at the root.\n */\nconst CONFIG_SECTION_KEY_PATH = `/${CONFIG_SECTION_KEY}`;\n\n/**\n * No legacy filename. The family file is the only one read, so a file named\n * for the tool is not config however it is spelled, and nothing warns about\n * one because nothing looks for it.\n */\nconst CONFIG_FILE: ConfigFileOptions = {\n section: CONFIG_SECTION_KEY,\n legacyNames: [],\n toError: (message) => new TracevalsError(message),\n};\n\nexport interface TracevalsConfig {\n /**\n * Which provider judges, as `tracevals.provider` names it. `null` when the\n * key is absent, which defers to the family's `providers.provider`. The\n * connection settings are never here: they are `providers` below.\n */\n provider: string | null;\n /** The model within `provider`; `null` when unset. manni pins none. */\n model: string | null;\n /** The family's top-level `providers:` map, parsed by the shared loader. */\n providers: ProvidersConfig;\n /** The file as the user would name it, for messages. */\n configSource: string;\n judge: {\n ensembleRuns: number;\n temperature: number;\n zones: { autoPass: number; autoFail: number };\n cacheDir: string;\n /**\n * Ensemble runs this invocation may spend, or `null` for unbounded. A\n * cached ensemble spends none, and an eval the budget cannot cover is\n * `skipped` with the `turn budget` reason rather than dropped.\n */\n maxTurns: number | null;\n /**\n * Extra patterns scrubbed from the session digest before it reaches a\n * provider, applied *on top of* the built-in secret shapes (ADR 01020).\n * Always a list; validated for compilability at load time.\n */\n redact: string[];\n };\n render: {\n maxBlockChars: number;\n maxTotalChars: number;\n };\n /**\n * What content-authored code a run may execute: the grants it holds, every\n * one unless the operator narrows it (proposal 0075). A `command` eval runs\n * only under `frontmatter-commands`; `[]` runs none and reports them\n * `skipped`.\n */\n execution: { allow: ExecutionGrant[] };\n history: {\n file: string;\n };\n /**\n * Session manifests (ADR 01024). `capture` writes one here; `run` looks here\n * for the trace's own, and reports a `skipped` hash check when there is none.\n */\n capture: {\n /** Resolved against the project root, not the working directory. */\n dir: string;\n };\n fill: {\n /** Minimum self-reported confidence a proposal needs to be written. */\n confidenceThreshold: number;\n maxEvalsPerArtifact: number;\n temperature: number;\n cacheDir: string;\n /** Inference calls this invocation may spend, or `null` for unbounded. */\n maxTurns: number | null;\n };\n /**\n * `calibrate` — measuring the judge against a human's answers (ADR 01022).\n * The sweep grid lives here rather than behind flags because the useful\n * range is a property of a corpus, and a corpus outlives an invocation.\n */\n calibrate: {\n /** Labels sidecar, resolved against the config file's directory. */\n labels: string;\n /** Thresholds. Unset means the run measures without gating. */\n maxFalsePass?: number;\n maxFalseFail?: number;\n maxReview?: number;\n sweep: {\n ensembleRuns: number[];\n autoPass: number[];\n autoFail: number[];\n };\n };\n failOnReview: boolean;\n /**\n * Module specifiers imported before evals are planned, so a `registerGrader`\n * call from outside this package lands in time (ADR 01017). Resolved against\n * the config file's directory, in order — a later entry wins a colliding\n * kind. `--require` appends to this list rather than replacing it.\n */\n plugins: string[];\n /** List offered-but-unused artifacts in coverage, not just count them. */\n reportUnusedArtifacts: boolean;\n /**\n * Runtime evals, each turn checked against its rule sources (proposals 0079\n * and 0083). `null` when the section is absent, which keeps tracevals out of\n * every hook; `{}` puts it in play with these defaults.\n */\n runtime: RuntimeConfig | null;\n}\n\nexport interface RuntimeConfig {\n /** The in-loop judge. `null` falls back to `tracevals.provider` / `model`. */\n hook: { provider: string | null; model: string | null; runs: number };\n /** Globs of designated rule sources, in scope once read. */\n include: string[];\n /** Globs never treated as rule sources. */\n exclude: string[];\n /** Globs of files that say what to build, in scope once touched (proposal 0080). */\n plans: string[];\n}\n\n// `verbose` puts the parent schema on each error, so an unknown key can be\n// checked against the keys its section does have.\nconst ajv = new Ajv2020({ allErrors: true, verbose: true });\nconst validate = ajv.compile(configSchema);\n\n/**\n * `; did you mean \"ensembleRuns\"?` when `key` is the kebab spelling of a key\n * its section has. Only the exact counterpart: a guess at a near miss is\n * advice that can be wrong, and the kebab spelling is the one mistake a\n * reader of the frontmatter vocabulary is likely to make here.\n */\nfunction camelCaseHint(key: string, parentSchema: unknown): string {\n const camel = key.replace(/-([a-z0-9])/g, (_, c: string) => c.toUpperCase());\n if (camel === key || parentSchema === null || typeof parentSchema !== \"object\") {\n return \"\";\n }\n const properties = (parentSchema as { properties?: unknown }).properties;\n return properties !== null &&\n typeof properties === \"object\" &&\n Object.hasOwn(properties, camel)\n ? `; did you mean \"${camel}\"?`\n : \"\";\n}\n\n/**\n * The hint on the old `conformance:` section, renamed `runtime:` (proposal\n * 0083). Nothing reads the old key, so it stays an unknown key; the hint says\n * where its settings went. Only at the section root: a `conformance` key\n * nested anywhere else, as under `runtime:`, was never the old section.\n */\nfunction renamedRuntimeHint(instancePath: string, key: string): string {\n return instancePath === \"\" && key === \"conformance\" ? `; it is now \"runtime\"` : \"\";\n}\n\n/**\n * The hint on an old `provider:` object. The key used to hold a `default` and\n * a section per provider; it is now the provider's name, as `docevals.provider`\n * and `fill.provider` are, and the connection settings moved to the family's\n * top-level `providers:` map, which every tool reads. Ajv's own message says\n * it must be a string, which is true and leaves the reader to find out where\n * the settings went.\n */\nfunction movedProviderHint(instancePath: string, keyword: string): string {\n return instancePath === \"/provider\" && keyword === \"type\"\n ? `; \"provider\" is now a provider name; per-provider settings moved to the top-level providers: map`\n : \"\";\n}\n\n/**\n * The section as the schema admits it: every key optional, because\n * `parseConfig` supplies the defaults. Ajv has checked the document against\n * `config-schema.json` before it is read as this, so the one cast below is\n * where the validated document becomes a typed one.\n */\ninterface RawConfig {\n provider?: string;\n model?: string;\n judge?: {\n ensembleRuns?: number;\n temperature?: number;\n zones?: { autoPass?: number; autoFail?: number };\n cacheDir?: string;\n maxTurns?: number;\n redact?: string[];\n };\n render?: { maxBlockChars?: number; maxTotalChars?: number };\n execution?: { allow?: ExecutionGrant[] };\n history?: { file?: string };\n capture?: { dir?: string };\n fill?: {\n confidenceThreshold?: number;\n maxEvalsPerArtifact?: number;\n temperature?: number;\n cacheDir?: string;\n maxTurns?: number;\n };\n calibrate?: {\n labels?: string;\n maxFalsePass?: number;\n maxFalseFail?: number;\n maxReview?: number;\n sweep?: { ensembleRuns?: number[]; autoPass?: number[]; autoFail?: number[] };\n };\n failOnReview?: boolean;\n plugins?: string[];\n reportUnusedArtifacts?: boolean;\n runtime?: {\n hook?: { provider?: string; model?: string; runs?: number };\n include?: string[];\n exclude?: string[];\n plans?: string[];\n };\n}\n\n/** What the file the section came from carries beside it. */\nexport interface ConfigFileContext {\n /** The file as the user would name it, for messages. */\n source?: string;\n /** The file's top-level `providers:`; `{}` when it declares none. */\n providers?: ProvidersConfig;\n}\n\nexport function parseConfig(\n raw: unknown,\n file: ConfigFileContext = {},\n): TracevalsConfig {\n const source = file.source ?? DEFAULT_CONFIG_FILENAME;\n // Before the schema: Ajv's enum error names neither the value nor the\n // grants that exist, and a grant is the key where a misreading costs most.\n const unknownGrants = configuredGrants(raw).filter((g) => !isExecutionGrant(g));\n if (unknownGrants.length > 0) {\n throw new TracevalsError(`${source}: ${unknownGrantsMessage(unknownGrants)}`);\n }\n if (!validate(raw)) {\n const detail = (validate.errors ?? [])\n .map((e) => {\n // Ajv reports an unknown key against the *parent* object, so the bare\n // message (\"must NOT have additional properties\") leaves the reader to\n // diff their file against the schema to find which key it meant. Name\n // it: the common case is a removed key in an unmigrated config —\n // `judge.maxCostUsd` after the turn budget landed, say — and a\n // migration error that makes you guess is one people work around.\n const extra =\n e.keyword === \"additionalProperties\"\n ? (e.params as { additionalProperty?: string }).additionalProperty\n : undefined;\n return extra !== undefined\n ? `unknown key \"${extra}\"${camelCaseHint(extra, e.parentSchema)}${renamedRuntimeHint(e.instancePath, extra)}`\n : `${CONFIG_SECTION_KEY_PATH}${e.instancePath} ${e.message ?? \"is invalid\"}` +\n movedProviderHint(e.instancePath, e.keyword);\n })\n .join(\"; \");\n throw new TracevalsError(`${source}: ${detail}`);\n }\n const r = raw as RawConfig;\n // Checked here, with the message every other tool in the family gives, so a\n // typo is caught by every verb and not only the ones that reach a model.\n // Whether a model has a provider to own it waits for the flags: a\n // `--provider`, or the family's `providers.provider`, can supply the\n // provider a configured model needs.\n const provider = r.provider ?? null;\n if (provider !== null) {\n // jev only decides. Out of the loop a provider extracts rules and writes\n // verdicts, which are generations.\n if (provider === JEV) throw new TracevalsError(JEV_OUT_OF_LOOP);\n assertKnownProvider(provider, (message) => new TracevalsError(message));\n }\n const hookProvider = r.runtime?.hook?.provider ?? null;\n if (hookProvider !== null) {\n assertKnownProvider(hookProvider, (message) => new TracevalsError(message), { decisions: true });\n }\n const config: TracevalsConfig = {\n provider,\n model: r.model ?? null,\n providers: file.providers ?? {},\n configSource: source,\n judge: {\n ensembleRuns: r.judge?.ensembleRuns ?? 3,\n temperature: r.judge?.temperature ?? 0,\n zones: {\n autoPass: r.judge?.zones?.autoPass ?? 0.8,\n autoFail: r.judge?.zones?.autoFail ?? 0.8,\n },\n cacheDir: r.judge?.cacheDir ?? \".manni/tracevals/cache\",\n // `null`, not a number: unbounded is a state, and any number here would\n // be a ceiling nobody asked for.\n maxTurns: r.judge?.maxTurns ?? null,\n // Always a list: the render site concatenates nothing onto it, but a\n // hole here would be a special case in every consumer.\n redact: [...(r.judge?.redact ?? [])],\n },\n render: {\n maxBlockChars: r.render?.maxBlockChars ?? 2000,\n maxTotalChars: r.render?.maxTotalChars ?? 150000,\n },\n execution: { allow: [...(r.execution?.allow ?? EXECUTION_GRANTS)] },\n history: {\n file: r.history?.file ?? \".manni/tracevals/history.jsonl\",\n },\n capture: {\n // Beside the judge cache, under the state directory that already travels\n // with the project — which is what puts a manifest next to its trace in\n // the CI patterns the docs describe.\n dir: r.capture?.dir ?? DEFAULT_CAPTURE_DIR,\n },\n fill: {\n // 0.7 matches the manuscript's calibration bar for judged agreement.\n confidenceThreshold: r.fill?.confidenceThreshold ?? 0.7,\n maxEvalsPerArtifact: r.fill?.maxEvalsPerArtifact ?? 8,\n temperature: r.fill?.temperature ?? 0,\n // Separate from the judge cache: different key scheme and value shape.\n cacheDir: r.fill?.cacheDir ?? \".manni/tracevals/cache/fill\",\n maxTurns: r.fill?.maxTurns ?? null,\n },\n calibrate: {\n labels: r.calibrate?.labels ?? DEFAULT_LABELS_FILE,\n sweep: {\n // Spans the range rather than filling it: the first sweep judges the\n // corpus at the largest value here, so a wide grid is the one part of\n // calibration that does cost money.\n ensembleRuns: [...(r.calibrate?.sweep?.ensembleRuns ?? [1, 3, 5])],\n autoPass: [\n ...(r.calibrate?.sweep?.autoPass ?? [0.5, 0.6, 0.7, 0.8, 0.9, 0.95]),\n ],\n autoFail: [\n ...(r.calibrate?.sweep?.autoFail ?? [0.5, 0.6, 0.7, 0.8, 0.9, 0.95]),\n ],\n },\n },\n failOnReview: r.failOnReview ?? true,\n // Always a list, never undefined: the read site concatenates `--require`\n // onto it, and a hole there would be a special case in every caller.\n plugins: [...(r.plugins ?? [])],\n // An observation, not a gate: listing it is opt-in because a real roster\n // runs to hundreds of skills (ADR 01016).\n reportUnusedArtifacts: r.reportUnusedArtifacts ?? false,\n runtime:\n r.runtime === undefined\n ? null\n : {\n hook: {\n provider: hookProvider,\n model: r.runtime.hook?.model ?? null,\n runs: r.runtime.hook?.runs ?? 1,\n },\n include: [...(r.runtime.include ?? [])],\n exclude: [...(r.runtime.exclude ?? [])],\n plans: [...(r.runtime.plans ?? [])],\n },\n };\n // Compilability is not expressible in JSON Schema, and a pattern that cannot\n // compile must fail here rather than at the moment a digest is about to be\n // sent — a dropped redaction pattern is a silent leak.\n compileRedactPatterns(config.judge.redact);\n // Left absent rather than defaulted to a number: `0` is a meaningful limit\n // (\"no false pass at all\"), so it cannot double as \"unset\".\n for (const key of [\"maxFalsePass\", \"maxFalseFail\", \"maxReview\"] as const) {\n if (typeof r.calibrate?.[key] === \"number\") {\n config.calibrate[key] = r.calibrate[key];\n }\n }\n return config;\n}\n\n/** This tool's config, and the directory its relative paths resolve from. */\nexport interface LoadedConfig {\n config: TracevalsConfig;\n /**\n * The directory holding the config file, or `dir` when none was found.\n * Plugin specifiers and the labels default resolve against it, so a\n * committed config means the same thing from any working directory.\n */\n dir: string;\n /**\n * The file's top-level `collections:` (proposal 0041); `[]` with no config.\n *\n * Collections never choose tracevals' inputs — `run` and `calibrate` take\n * traces, `fill` detects artifacts under `--project` — and there is no\n * `--collection`. What they say is *where a relocated `metadata` block\n * lives*, so a declared manifest is read for the evals an artifact no longer\n * carries inline (proposals 0047 and 0049 §1).\n */\n collections: CollectionConfig[];\n /**\n * The config file's absolute path; absent when there is none. A keyless\n * manifest owns what an artifact's schemas mark external (proposal 0068),\n * and those schemas are read from meta's section of this same file.\n */\n path?: string;\n}\n\n/** How a command was told to find its config: `-c` and `--no-config`. */\nexport interface ConfigLookup {\n /** `-c/--config`: read this file instead of discovering one. */\n configPath?: string;\n /** `--no-config`: skip discovery and run on the built-in defaults. */\n noConfig?: boolean;\n}\n\n/**\n * Discover the family config from `dir` (cwd by default) upward to the\n * repository root and return this tool's section (`src/shared/config-file.ts`:\n * `manni.config.yaml` read at its `tracevals:` key, with the family's\n * top-level `providers:` beside it). An absent file — or one that carries only\n * other tools' sections — yields defaults.\n *\n * `-c` names a file and skips the walk; `--no-config` skips the file\n * altogether and runs on the built-in defaults, with `dir` still anchoring\n * whatever the config would otherwise have anchored.\n */\nexport async function discoverConfig(\n dir = process.cwd(),\n lookup: ConfigLookup = {},\n): Promise<LoadedConfig> {\n if (lookup.noConfig === true) {\n // No config means no collections, so no manifest owns anything and every\n // artifact's evals are its own front matter's — the same rule cite states.\n return { config: parseConfig({}), dir, collections: [] };\n }\n const file = await Promise.resolve().then(() =>\n lookup.configPath === undefined\n ? findConfigFileSync(dir, CONFIG_FILE)\n : readConfigFileSync(lookup.configPath, dir, CONFIG_FILE),\n );\n if (file === null) return { config: parseConfig({}), dir, collections: [] };\n return {\n config: parseConfig(file.value ?? {}, {\n source: file.source,\n ...(file.providers !== undefined ? { providers: file.providers } : {}),\n }),\n dir: file.dir,\n collections: file.collections,\n path: file.path,\n };\n}\n\n/** `discoverConfig`, for callers that only want the settings. */\nexport async function loadConfig(\n dir = process.cwd(),\n lookup: ConfigLookup = {},\n): Promise<TracevalsConfig> {\n return (await discoverConfig(dir, lookup)).config;\n}\n","{\n \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n \"$id\": \"manni:tracevals:config\",\n \"title\": \"tracevals section of manni.config.yaml\",\n \"description\": \"Settings for manni tracevals, held under the `tracevals` key of the config file shared by the manni family of tools. Sibling keys belong to other tools and are not validated here.\",\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"properties\": {\n \"provider\": {\n \"type\": \"string\",\n \"minLength\": 1,\n \"description\": \"Which provider judges out of the loop, and extracts rules: auto, anthropic, openai, claude-cli, or llama-cpp. jev only decides, so it is refused here; name it as runtime.hook.provider. Overrides the family's top-level `providers.provider` for tracevals only. Connection settings — an endpoint, an API key's environment variable, the Claude CLI command — live in that top-level `providers:` map, never here.\"\n },\n \"model\": {\n \"type\": \"string\",\n \"minLength\": 1,\n \"description\": \"The model within `provider`, which must be named at this level. Unset, the inference library's default for the winning provider is used; manni pins no model id of its own.\"\n },\n \"judge\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"properties\": {\n \"ensembleRuns\": { \"type\": \"integer\", \"minimum\": 1 },\n \"temperature\": { \"type\": \"number\", \"minimum\": 0, \"maximum\": 2 },\n \"zones\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"properties\": {\n \"autoPass\": { \"type\": \"number\", \"minimum\": 0, \"maximum\": 1 },\n \"autoFail\": { \"type\": \"number\", \"minimum\": 0, \"maximum\": 1 }\n }\n },\n \"cacheDir\": { \"type\": \"string\" },\n \"maxTurns\": { \"type\": \"integer\", \"minimum\": 1, \"description\": \"Stop after this many ensemble runs. A cached ensemble spends none. Unset means unbounded; the remaining evals report `skipped` with the reason `turn budget` rather than aborting the run.\" },\n \"redact\": {\n \"type\": \"array\",\n \"description\": \"Extra regular expressions scrubbed from the session digest before it is sent to a judge provider. Applied on top of the built-in secret shapes, never instead of them; each source is compiled with the `g` flag, and a match is replaced with `[redacted]`. Pattern matching is best-effort — --deterministic-only is the only setting that guarantees nothing leaves the machine.\",\n \"items\": { \"type\": \"string\", \"minLength\": 1 }\n }\n }\n },\n \"execution\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"description\": \"Operator grant for executing content-authored code.\",\n \"properties\": {\n \"allow\": {\n \"type\": \"array\",\n \"items\": { \"enum\": [\"frontmatter-commands\"] },\n \"default\": [\"frontmatter-commands\"],\n \"description\": \"Which content-authored code a run may execute. Absent, every grant holds; list fewer to narrow it, or write [] to run none. frontmatter-commands lets `command` evals declared in an artifact's front matter run; without it they report `skipped` with a reason, never `pass`.\"\n }\n }\n },\n \"render\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"properties\": {\n \"maxBlockChars\": { \"type\": \"integer\", \"minimum\": 100 },\n \"maxTotalChars\": {\n \"type\": \"integer\",\n \"minimum\": 1000,\n \"description\": \"Upper bound on the rendered digest, in characters. The timeline always keeps at least 200 characters, so a very long header can push the digest past this bound by up to 200.\"\n }\n }\n },\n \"history\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"properties\": {\n \"file\": { \"type\": \"string\" }\n }\n },\n \"capture\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"description\": \"Session manifests — sha256 of every instruction artifact plus the git SHA, recorded at session start by `manni tracevals capture` and read back by `run` to make staleness exact instead of an mtime guess. See ADR 01024.\",\n \"properties\": {\n \"dir\": {\n \"type\": \"string\",\n \"minLength\": 1,\n \"description\": \"Directory manifests are written to and looked for, resolved against the project root. `run` also accepts one placed beside the trace as `<trace>.manifest.json`, and --manifest names one outright.\"\n }\n }\n },\n \"fill\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"properties\": {\n \"confidenceThreshold\": { \"type\": \"number\", \"minimum\": 0, \"maximum\": 1 },\n \"maxEvalsPerArtifact\": { \"type\": \"integer\", \"minimum\": 1 },\n \"temperature\": { \"type\": \"number\", \"minimum\": 0, \"maximum\": 2 },\n \"cacheDir\": { \"type\": \"string\" },\n \"maxTurns\": { \"type\": \"integer\", \"minimum\": 1, \"description\": \"Stop after this many inference calls, one per artifact filled. A cached artifact spends none. Unset means unbounded.\" }\n }\n },\n \"calibrate\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"description\": \"Settings for `manni tracevals calibrate` — measuring the tool's verdicts against a human's answers. See ADR 01022.\",\n \"properties\": {\n \"labels\": {\n \"type\": \"string\",\n \"minLength\": 1,\n \"description\": \"Default labels sidecar, resolved against this config file's directory. Overridden by --labels.\"\n },\n \"maxFalsePass\": {\n \"type\": \"integer\",\n \"minimum\": 0,\n \"description\": \"Fail the calibration run (exit 1) above this many false passes — labelled fail, judged pass. Unset by default: a calibration run is a measurement, not a gate.\"\n },\n \"maxFalseFail\": {\n \"type\": \"integer\",\n \"minimum\": 0,\n \"description\": \"Fail the calibration run above this many false fails — labelled pass, judged fail.\"\n },\n \"maxReview\": {\n \"type\": \"integer\",\n \"minimum\": 0,\n \"description\": \"Fail the calibration run above this many needs-review outcomes across the whole corpus.\"\n },\n \"sweep\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"description\": \"Values --sweep tries on each axis, one axis at a time with the others held at their configured value. The corpus is judged once at the largest ensembleRuns here and every cell is re-scored from those cached runs, so the grid costs nothing beyond that one run.\",\n \"properties\": {\n \"ensembleRuns\": {\n \"type\": \"array\",\n \"minItems\": 1,\n \"items\": { \"type\": \"integer\", \"minimum\": 1 }\n },\n \"autoPass\": {\n \"type\": \"array\",\n \"minItems\": 1,\n \"items\": { \"type\": \"number\", \"minimum\": 0, \"maximum\": 1 }\n },\n \"autoFail\": {\n \"type\": \"array\",\n \"minItems\": 1,\n \"items\": { \"type\": \"number\", \"minimum\": 0, \"maximum\": 1 }\n }\n }\n }\n }\n },\n \"runtime\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"description\": \"Runtime evals: each turn checked against the rules the files that govern the agent declare. Present, even as {}, it puts tracevals in play under Claude Code hooks; absent, tracevals stays out of them.\",\n \"properties\": {\n \"hook\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"description\": \"The judge inside a Stop or SubagentStop hook. Each key falls back to the top-level one of the same name.\",\n \"properties\": {\n \"provider\": {\n \"type\": \"string\",\n \"minLength\": 1,\n \"description\": \"The provider that judges inside a hook. Default: tracevals.provider. jev is accepted here, and only here.\"\n },\n \"model\": {\n \"type\": \"string\",\n \"minLength\": 1,\n \"description\": \"The model that judges inside a hook. Default: tracevals.model.\"\n },\n \"runs\": {\n \"type\": \"integer\",\n \"minimum\": 1,\n \"description\": \"Judge calls per rule inside a hook. A rule blocks only when every run scores it not followed at the bar. jev makes one call and ignores it. Default 1.\"\n }\n }\n },\n \"include\": {\n \"type\": \"array\",\n \"description\": \"Globs, relative to the project root, naming files that govern agents beyond the known formats. Each applies to every turn.\",\n \"items\": { \"type\": \"string\", \"minLength\": 1 }\n },\n \"exclude\": {\n \"type\": \"array\",\n \"description\": \"Globs, relative to the project root, naming files never treated as rule sources, in any format. It removes plan, spec and output style files too. It also matches the sources `prompt`, `plan` and `system-prompt` by name.\",\n \"items\": { \"type\": \"string\", \"minLength\": 1 }\n },\n \"plans\": {\n \"type\": \"array\",\n \"default\": [],\n \"description\": \"Globs, relative to the project root, naming files that say what to build, beyond the known spec formats. Each is a rule source once the session touches it.\",\n \"items\": { \"type\": \"string\", \"minLength\": 1 }\n }\n }\n },\n \"failOnReview\": { \"type\": \"boolean\" },\n \"plugins\": {\n \"type\": \"array\",\n \"description\": \"Modules imported before evals are planned, so one calling registerGrader() can add a grader kind the built-ins do not cover. A relative or absolute path resolves against this file's directory, not the working directory; a bare package name resolves the way an import from this file's directory would. Load order is significant: a later entry wins a colliding kind.\",\n \"items\": { \"type\": \"string\", \"minLength\": 1 }\n },\n \"reportUnusedArtifacts\": {\n \"type\": \"boolean\",\n \"description\": \"List every skill and agent the session was offered and never used, rather than only counting them. Off by default: a real roster runs to hundreds of skills.\"\n }\n }\n}\n","/**\n * The calibration labels sidecar (ADR 01022).\n *\n * A label is a human's answer for one `(trace, artifact, eval)`. It lives in\n * its own file rather than in the eval entry for two reasons: the vendored\n * `artifact-evals` vocabulary is docmeta's and `inlineEval` is closed to\n * additions (ADR 01010), and — more importantly — a label is a property of a\n * *corpus and a reviewer*, not of the artifact. Two teams calibrating the same\n * skill against different sessions hold different ground truth, and neither\n * belongs in the SKILL.md.\n */\nimport { readFile } from \"node:fs/promises\";\nimport { dirname, resolve } from \"node:path\";\nimport { Ajv2020 } from \"ajv/dist/2020.js\";\nimport { parse as parseYaml } from \"yaml\";\nimport labelsSchemaJson from \"./labels-schema.json\" with { type: \"json\" };\nimport { errorMessage } from \"../../shared/errors.js\";\nimport { TracevalsError } from \"../types.js\";\nimport type { ArtifactType } from \"../artifacts/types.js\";\n\nconst labelsSchema = labelsSchemaJson as Record<string, unknown>;\n\n/** Conventional location inside a project; overridable with `--labels`. */\nexport const DEFAULT_LABELS_FILE = \"tracevals/labels.yaml\";\n\n/**\n * What a human decided. `needs-review` is a legitimate label, not a cop-out:\n * an eval you found genuinely ambiguous is the one that tells you whether the\n * review band is set sensibly, and the docs have always asked for a couple.\n */\nexport type LabelOutcome = \"pass\" | \"fail\" | \"needs-review\";\n\nexport interface EvalLabel {\n /** Path exactly as written in the file, for error messages. */\n trace: string;\n /** Resolved absolute path — the join key against the batch corpus. */\n traceFile: string;\n artifact: string;\n /** Only when the file disambiguates a name shared by two artifact kinds. */\n type?: ArtifactType;\n eval: string;\n expected: LabelOutcome;\n note?: string;\n}\n\nconst ajv = new Ajv2020({ allErrors: true });\nconst validate = ajv.compile(labelsSchema);\n\n/**\n * Stable identity for one label, and the duplicate-detection key.\n *\n * The separator is written as a backslash-u escape, never as a literal NUL:\n * the runtime value is identical, but a literal one makes git call the file\n * binary — its diff renders as `Bin 0 -> N bytes` and cannot be reviewed or\n * three-way merged, and `grep` answers `Binary file … matches` and stops.\n * `test/unit/source-text-safety.test.ts` holds the whole tree to this.\n */\nexport const labelKey = (\n traceFile: string,\n artifact: string,\n evalName: string,\n type?: ArtifactType,\n): string => `${traceFile}\\u0000${type ?? \"\"}\\u0000${artifact}\\u0000${evalName}`;\n\n/**\n * Validate a labels document and resolve its trace paths.\n *\n * `file` is the path the text came from; trace paths resolve against **its**\n * directory rather than the working directory, matching how `plugins` resolves\n * against the config file that names them. A labels file travels with its\n * corpus, so it must mean the same thing from any cwd.\n */\nexport function parseLabels(text: string, file: string): EvalLabel[] {\n let raw: unknown;\n try {\n raw = parseYaml(text);\n } catch (err) {\n throw new TracevalsError(\n `could not parse ${file}: ${errorMessage(err)}`,\n );\n }\n if (raw === null || raw === undefined) {\n throw new TracevalsError(`invalid labels file ${file}: it is empty`);\n }\n if (!validate(raw)) {\n const detail = (validate.errors ?? [])\n .map((e) => `${e.instancePath || \"/\"} ${e.message ?? \"invalid\"}`)\n .join(\"; \");\n // The empty-list case gets its own wording: \"must NOT have fewer than 1\n // items\" describes the schema, not the mistake.\n const empty = (validate.errors ?? []).some(\n (e) => e.instancePath === \"/labels\" && e.keyword === \"minItems\",\n );\n throw new TracevalsError(\n empty\n ? `invalid labels file ${file}: it must carry at least one label — an empty one measures nothing`\n : `invalid labels file ${file}: ${detail}`,\n );\n }\n\n const base = dirname(resolve(file));\n const labels: EvalLabel[] = [];\n const seen = new Set<string>();\n for (const entry of (raw as { labels: Record<string, string>[] }).labels) {\n const traceFile = resolve(base, entry.trace as string);\n const type = entry.type as ArtifactType | undefined;\n const key = labelKey(\n traceFile,\n entry.artifact as string,\n entry.eval as string,\n type,\n );\n if (seen.has(key)) {\n // Two answers for one question is not a merge problem to resolve at run\n // time — whichever won would silently decide the measurement.\n throw new TracevalsError(\n `invalid labels file ${file}: duplicate label for ${entry.artifact ?? \"?\"} › ${entry.eval ?? \"?\"} on ${entry.trace ?? \"?\"}`,\n );\n }\n seen.add(key);\n labels.push({\n trace: entry.trace as string,\n traceFile,\n artifact: entry.artifact as string,\n ...(type !== undefined ? { type } : {}),\n eval: entry.eval as string,\n expected: entry.expected as LabelOutcome,\n ...(entry.note !== undefined ? { note: entry.note } : {}),\n });\n }\n return labels;\n}\n\nexport async function loadLabels(file: string): Promise<EvalLabel[]> {\n let text: string;\n try {\n text = await readFile(file, \"utf-8\");\n } catch (err) {\n throw new TracevalsError(\n `could not read labels file ${file}: ${errorMessage(err)}`,\n );\n }\n return parseLabels(text, file);\n}\n","{\n \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n \"$id\": \"manni:tracevals:calibration-labels\",\n \"title\": \"manni tracevals calibration labels\",\n \"description\": \"Ground truth for `manni tracevals calibrate`: what a human decided a given eval should have produced on a given trace. A sidecar rather than an eval field, because a label belongs to a corpus and a reviewer, not to the artifact — and because the eval vocabulary is docmeta's, vendored byte-identical, with `inlineEval` closed to additions (ADR 01010).\",\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"required\": [\"version\", \"labels\"],\n \"properties\": {\n \"version\": {\n \"const\": 1,\n \"description\": \"Format version. Pinned so a future shape change is an explicit migration rather than a silently-reinterpreted file.\"\n },\n \"labels\": {\n \"type\": \"array\",\n \"minItems\": 1,\n \"description\": \"One entry per (trace, artifact, eval) you have judged by hand.\",\n \"items\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"required\": [\"trace\", \"artifact\", \"eval\", \"expected\"],\n \"properties\": {\n \"trace\": {\n \"type\": \"string\",\n \"minLength\": 1,\n \"description\": \"Path to the trace file, resolved against this file's own directory — not the working directory.\"\n },\n \"artifact\": {\n \"type\": \"string\",\n \"minLength\": 1,\n \"description\": \"Artifact name as the report shows it: a skill name, a subagent_type, or a project-rules filename such as CLAUDE.md.\"\n },\n \"type\": {\n \"enum\": [\"skill\", \"agent\", \"project-rules\", \"slash-command\"],\n \"description\": \"Optional disambiguator, needed when one name resolves to two kinds of artifact — a skill and an agent, or a skill and the slash command that types it. Every `ArtifactType` the resolver can produce belongs here: a label whose type this rejects has no way to name the artifact it means.\"\n },\n \"eval\": {\n \"type\": \"string\",\n \"minLength\": 1,\n \"description\": \"The eval's id. Shorthand entries with no declared id get a positional one (eval-1, eval-2, ...), so labelling those is only as stable as the order they are written in.\"\n },\n \"expected\": {\n \"enum\": [\"pass\", \"fail\", \"needs-review\"],\n \"description\": \"What you decided. `needs-review` means you found it genuinely ambiguous and want the tool to defer too.\"\n },\n \"note\": {\n \"type\": \"string\",\n \"description\": \"Why you decided that. Carried into the disagreement report, where it is the whole reason a disagreement is actionable.\"\n }\n }\n }\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUA,SAAS,WAAAA,gBAAe;;;ACVxB;AAAA,EACE,SAAW;AAAA,EACX,KAAO;AAAA,EACP,OAAS;AAAA,EACT,aAAe;AAAA,EACf,MAAQ;AAAA,EACR,sBAAwB;AAAA,EACxB,YAAc;AAAA,IACZ,UAAY;AAAA,MACV,MAAQ;AAAA,MACR,WAAa;AAAA,MACb,aAAe;AAAA,IACjB;AAAA,IACA,OAAS;AAAA,MACP,MAAQ;AAAA,MACR,WAAa;AAAA,MACb,aAAe;AAAA,IACjB;AAAA,IACA,OAAS;AAAA,MACP,MAAQ;AAAA,MACR,sBAAwB;AAAA,MACxB,YAAc;AAAA,QACZ,cAAgB,EAAE,MAAQ,WAAW,SAAW,EAAE;AAAA,QAClD,aAAe,EAAE,MAAQ,UAAU,SAAW,GAAG,SAAW,EAAE;AAAA,QAC9D,OAAS;AAAA,UACP,MAAQ;AAAA,UACR,sBAAwB;AAAA,UACxB,YAAc;AAAA,YACZ,UAAY,EAAE,MAAQ,UAAU,SAAW,GAAG,SAAW,EAAE;AAAA,YAC3D,UAAY,EAAE,MAAQ,UAAU,SAAW,GAAG,SAAW,EAAE;AAAA,UAC7D;AAAA,QACF;AAAA,QACA,UAAY,EAAE,MAAQ,SAAS;AAAA,QAC/B,UAAY,EAAE,MAAQ,WAAW,SAAW,GAAG,aAAe,6LAA6L;AAAA,QAC3P,QAAU;AAAA,UACR,MAAQ;AAAA,UACR,aAAe;AAAA,UACf,OAAS,EAAE,MAAQ,UAAU,WAAa,EAAE;AAAA,QAC9C;AAAA,MACF;AAAA,IACF;AAAA,IACA,WAAa;AAAA,MACX,MAAQ;AAAA,MACR,sBAAwB;AAAA,MACxB,aAAe;AAAA,MACf,YAAc;AAAA,QACZ,OAAS;AAAA,UAC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|
62
62
|
supportedExtensions,
|
|
63
63
|
toJsonText,
|
|
64
64
|
writeFileAtomic
|
|
65
|
-
} from "./chunk-
|
|
65
|
+
} from "./chunk-A36QDIXZ.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-
|
|
7395
|
+
//# sourceMappingURL=chunk-KRSLDZ7N.js.map
|
|
@@ -15,10 +15,10 @@ import {
|
|
|
15
15
|
import {
|
|
16
16
|
REPORT_FORMAT_LIST,
|
|
17
17
|
renderJunit
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-ZDYW7XTS.js";
|
|
19
19
|
import {
|
|
20
20
|
isErrorSeverity
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-A36QDIXZ.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-
|
|
31
|
+
} from "./chunk-CGO5MNRD.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-
|
|
636
|
+
//# sourceMappingURL=chunk-KWAXJCKS.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
discoverArtifacts
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-2QEHLWYM.js";
|
|
5
5
|
import {
|
|
6
6
|
parseHookPayload,
|
|
7
7
|
readStdin
|
|
@@ -12,10 +12,10 @@ import {
|
|
|
12
12
|
relPosix,
|
|
13
13
|
sha256Hex,
|
|
14
14
|
writeManifest
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-TKVGEFMH.js";
|
|
16
16
|
import {
|
|
17
17
|
loadConfig
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-KPXOJMQ6.js";
|
|
19
19
|
import {
|
|
20
20
|
MANIFEST_VERSION,
|
|
21
21
|
makeRedactor
|
|
@@ -212,4 +212,4 @@ export {
|
|
|
212
212
|
runCapture,
|
|
213
213
|
renderCapture
|
|
214
214
|
};
|
|
215
|
-
//# sourceMappingURL=chunk-
|
|
215
|
+
//# sourceMappingURL=chunk-LRU5BK3L.js.map
|
|
@@ -6,10 +6,10 @@ import {
|
|
|
6
6
|
shortPin,
|
|
7
7
|
shortSrc,
|
|
8
8
|
spellAt
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-H3LM7D6K.js";
|
|
10
10
|
import {
|
|
11
11
|
parseSrc
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-BMRZFTAD.js";
|
|
13
13
|
import {
|
|
14
14
|
palette
|
|
15
15
|
} from "./chunk-RNVYGWIC.js";
|
|
@@ -452,4 +452,4 @@ export {
|
|
|
452
452
|
removalLine,
|
|
453
453
|
renderRemovePretty
|
|
454
454
|
};
|
|
455
|
-
//# sourceMappingURL=chunk-
|
|
455
|
+
//# sourceMappingURL=chunk-LXFY64QR.js.map
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
mockVerdict
|
|
25
25
|
} from "@hawkeyexl/inference";
|
|
26
26
|
var JEV = "jev";
|
|
27
|
-
var JEV_OUT_OF_LOOP = "jev answers decisions only, so it cannot extract rules or write verdicts. Use it as tracevals.
|
|
27
|
+
var JEV_OUT_OF_LOOP = "jev answers decisions only, so it cannot extract rules or write verdicts. Use it as tracevals.runtime.hook.provider.";
|
|
28
28
|
var CONFIG_KEY = "tracevals.provider";
|
|
29
29
|
var toTracevalsError = (message) => new TracevalsError(message);
|
|
30
30
|
function selectProvider2(config, flags = {}, ev = {}) {
|
|
@@ -39,12 +39,12 @@ function selectProvider2(config, flags = {}, ev = {}) {
|
|
|
39
39
|
]);
|
|
40
40
|
}
|
|
41
41
|
function selectHookProvider(config) {
|
|
42
|
-
const hook = config.
|
|
42
|
+
const hook = config.runtime?.hook;
|
|
43
43
|
return selectProvider({}, [
|
|
44
44
|
{
|
|
45
45
|
...hook?.provider != null ? { provider: hook.provider } : {},
|
|
46
46
|
...hook?.model != null ? { model: hook.model } : {},
|
|
47
|
-
origin: "tracevals.
|
|
47
|
+
origin: "tracevals.runtime.hook.provider"
|
|
48
48
|
},
|
|
49
49
|
...configLevels(config)
|
|
50
50
|
]);
|
|
@@ -143,4 +143,4 @@ export {
|
|
|
143
143
|
constructProvider,
|
|
144
144
|
makeJudgeProvider
|
|
145
145
|
};
|
|
146
|
-
//# sourceMappingURL=chunk-
|
|
146
|
+
//# sourceMappingURL=chunk-NGTVREIH.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/tracevals/judge/provider.ts"],"sourcesContent":["/**\n * Choosing the provider and model, and building the shared inference\n * library's `ProviderSpec` for it.\n *\n * The providers themselves live in `@hawkeyexl/inference` (ADR 01006). The\n * names a provider may have, the two refusals, `--local`, the detection call,\n * the level-bound precedence and the mapping of the family's `providers:`\n * connection settings are `src/shared/providers.ts`, the same code\n * `manni meta fill` and `manni docevals` run. What stays here is what only\n * manni tracevals can decide: which levels it reads (a flag, an eval's own\n * `provider:`/`model:`, `tracevals.provider`/`model`, then the family's\n * `providers:`), and the judge-shaped options a verdict call wants.\n *\n * No model id is named in this file. A model the tool pinned would go stale\n * the week the provider shipped a better one, and would override the default\n * the library keeps current.\n */\nimport {\n makeProvider as makeInferenceProvider,\n mockVerdict,\n type InferenceProvider,\n type MockResponse,\n type ProviderName as ConcreteProvider,\n type ProviderSelector,\n type ProviderSpec,\n} from \"@hawkeyexl/inference\";\nimport { TracevalsError } from \"../types.js\";\nimport type { HostSetting } from \"../rules/host.js\";\nimport type { TracevalsConfig } from \"../core/config.js\";\nimport {\n assertKnownProvider,\n assertLocalFlag,\n assertModelHasProvider,\n localNotice,\n providerSpecFor as sharedProviderSpecFor,\n resolveIdentity,\n selectProvider as selectFromLevels,\n type ProviderChoice,\n type ProviderFlags,\n type ProviderSelection,\n} from \"../../shared/providers.js\";\nimport { errorMessage } from \"../../shared/errors.js\";\nimport { noticeOnce } from \"../../shared/warn.js\";\n\nexport type { MockResponse, ProviderChoice, ProviderFlags, ProviderSelection };\n\n/** The decide-only provider (proposal 0079). */\nexport const JEV = \"jev\";\n\n/** Why jev cannot serve out of the loop, and where it goes instead. */\nexport const JEV_OUT_OF_LOOP =\n \"jev answers decisions only, so it cannot extract rules or write verdicts. Use it as tracevals.runtime.hook.provider.\";\n\n/** The key a tracevals user writes, named by the refusal a bare model gets. */\nconst CONFIG_KEY = \"tracevals.provider\";\n\nconst toTracevalsError = (message: string): Error => new TracevalsError(message);\n\n/** What a caller wants of the provider beyond which one it is. */\nexport interface JudgeProviderOptions {\n /**\n * Responses for the `mock` seam. The default is verdict-shaped, which suits\n * judging; callers with a different response schema (criteria proposals,\n * say) must supply their own. `mock` is accepted when named but never\n * offered, so nothing that lists providers mentions it.\n */\n mockResponses?: MockResponse[];\n /**\n * How a `llama-cpp` provider reaches the model host. Unset, it connects to\n * a running host and never starts one, which is every run by hand.\n */\n host?: HostSetting;\n}\n\n/**\n * The provider and model in force: a flag, then the eval's own choice, then\n * `tracevals.provider`/`model`, then the family's `providers.provider`/`model`,\n * then `auto`. A model is carried only to the provider its own level names, so\n * an eval that names a different provider takes that provider's default\n * instead of a model it cannot run (`selectProvider` in the shared module).\n *\n * `--local` runs llama-cpp over all of them. A `--provider` it contradicts is\n * refused here, so no path selects past it. `ev.origin` names the eval in the\n * notice for a provider `--local` replaced; the caller knows its artifact.\n */\nexport function selectProvider(\n config: TracevalsConfig,\n flags: ProviderFlags = {},\n ev: ProviderChoice = {},\n): ProviderSelection {\n assertLocalFlag(flags, toTracevalsError);\n return selectFromLevels(flags, [\n {\n ...(ev.provider !== undefined ? { provider: ev.provider } : {}),\n ...(ev.model !== undefined ? { model: ev.model } : {}),\n ...(ev.origin !== undefined ? { origin: ev.origin } : {}),\n },\n ...configLevels(config),\n ]);\n}\n\n/**\n * The judge inside a hook (proposal 0079, \"Two model roles\"):\n * `runtime.hook.provider`/`model`, then `tracevals.provider`/`model`, then\n * the family's `providers:`, then `auto`. No flag reaches it, because a hook\n * has no command line. A hook level naming only a model lends it to whichever\n * provider wins, as every level does.\n */\nexport function selectHookProvider(config: TracevalsConfig): ProviderSelection {\n const hook = config.runtime?.hook;\n return selectFromLevels({}, [\n {\n ...(hook?.provider != null ? { provider: hook.provider } : {}),\n ...(hook?.model != null ? { model: hook.model } : {}),\n origin: \"tracevals.runtime.hook.provider\",\n },\n ...configLevels(config),\n ]);\n}\n\n/** `tracevals.provider`/`model`, then the family's `providers:`. */\nfunction configLevels(config: TracevalsConfig): ProviderChoice[] {\n return [\n {\n ...(config.provider !== null ? { provider: config.provider } : {}),\n ...(config.model !== null ? { model: config.model } : {}),\n origin: CONFIG_KEY,\n },\n {\n ...(config.providers.provider !== undefined\n ? { provider: config.providers.provider }\n : {}),\n ...(config.providers.model !== undefined ? { model: config.providers.model } : {}),\n origin: \"providers.provider\",\n },\n ];\n}\n\n/**\n * Say what `--local` set aside, once per source. Called where a selection is\n * about to be used, never where it is only checked, so a run that sends\n * nothing to a model says nothing.\n */\nexport function announceSelection(selection: ProviderSelection): void {\n const message = localNotice(selection);\n if (message !== undefined) noticeOnce(message);\n}\n\n/**\n * Refuse a selection that cannot be right, with `manni meta fill`'s messages:\n * an unknown name, or a model under `auto`. Both are `TracevalsError`s, which\n * is what maps them to exit 2.\n */\nexport function assertProviderSelection(selection: ProviderSelection): void {\n // Every caller of this check generates: `run`'s and `calibrate`'s verdicts,\n // `fill`'s proposals, and rule extraction. Only the turn judge may decide.\n if (selection.provider === JEV) throw new TracevalsError(JEV_OUT_OF_LOOP);\n assertKnownProvider(selection.provider, toTracevalsError);\n assertModelHasProvider(selection.provider, selection.model, CONFIG_KEY, toTracevalsError);\n}\n\n/**\n * The spec for a selection, with the family's connection settings for the\n * provider it names, and under `auto` the settings detection reads.\n */\nexport function providerSpecFor(\n config: TracevalsConfig,\n selection: { provider: ProviderSelector; model: string | null },\n options: JudgeProviderOptions = {},\n): ProviderSpec {\n const spec = sharedProviderSpecFor(config.providers, selection);\n switch (selection.provider) {\n case \"anthropic\":\n // A verdict-shaped tool name steers the model better than a generic\n // one, and it is free to keep.\n return { ...spec, anthropic: { toolName: \"record_verdict\" } };\n case \"openai\":\n return { ...spec, openai: { schemaName: \"verdict\" } };\n case \"llama-cpp\":\n return {\n ...spec,\n llamaCpp: { ...spec.llamaCpp, ...(options.host ?? { host: \"connect\" }) },\n };\n case \"mock\":\n return {\n ...spec,\n mockResponses: options.mockResponses ?? [mockVerdict(\"pass\", 0.95)],\n };\n default:\n return spec;\n }\n}\n\n/**\n * The concrete provider and model, WITHOUT constructing the provider: cache\n * keys need it, and a fully cached run must not require an API key.\n *\n * Under `auto` this is where detection runs, exactly as `manni meta fill` runs\n * it, seeing the same connection settings. The model is the RESOLVED one (the\n * provider's default when none was named, a llama-cpp tier's concrete\n * weights), so a library default that changes changes every cache key built\n * from it.\n */\nexport async function resolveProviderIdentity(\n config: TracevalsConfig,\n flags: ProviderFlags = {},\n ev: ProviderChoice = {},\n): Promise<{ provider: ConcreteProvider; model: string }> {\n // Every caller of this generates, so jev is refused here as well as where\n // a command checks its selection up front.\n const selection = selectProvider(config, flags, ev);\n assertProviderSelection(selection);\n return resolveSelectionIdentity(config, selection);\n}\n\n/** `resolveProviderIdentity` for a selection already made. */\nexport async function resolveSelectionIdentity(\n config: TracevalsConfig,\n selection: ProviderSelection,\n): Promise<{ provider: ConcreteProvider; model: string }> {\n const { provider, model } = selection;\n // Generating callers refused jev in assertProviderSelection; reaching here\n // with it means the turn judge, which decides.\n assertKnownProvider(provider, toTracevalsError, { decisions: true });\n assertModelHasProvider(provider, model, CONFIG_KEY, toTracevalsError);\n announceSelection(selection);\n return resolveIdentity(\n providerSpecFor(config, { provider, model: model ?? null }),\n toTracevalsError,\n );\n}\n\n/** Construct a provider for an identity already resolved. */\nexport function constructProvider(\n config: TracevalsConfig,\n identity: { provider: ConcreteProvider; model: string },\n options: JudgeProviderOptions = {},\n): InferenceProvider {\n if (identity.provider === JEV) {\n // Checked here, so the message names the variable a user sets rather than\n // the library's wording for it.\n const keyEnv = config.providers.jev?.apiKeyEnv ?? \"TYPESAFE_API_KEY\";\n const key = process.env[keyEnv];\n if (key === undefined || key === \"\") {\n throw new TracevalsError(`jev needs an API key in ${keyEnv}`);\n }\n }\n try {\n return makeInferenceProvider(providerSpecFor(config, identity, options));\n } catch (e) {\n // The library raises its own InferenceError (a missing API key). It must\n // surface as a TracevalsError: `cli.ts`'s fail() maps only that to exit 2,\n // and letting a foreign error type through turns \"no API key configured\"\n // into an unhandled stack trace.\n throw new TracevalsError(errorMessage(e));\n }\n}\n\n/** Select, check, detect and construct: the provider a verb judges with. */\nexport async function makeJudgeProvider(\n config: TracevalsConfig,\n flags: ProviderFlags = {},\n ev: ProviderChoice = {},\n options: JudgeProviderOptions = {},\n): Promise<InferenceProvider> {\n return constructProvider(\n config,\n await resolveProviderIdentity(config, flags, ev),\n options,\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAiBA;AAAA,EACE,gBAAgB;AAAA,EAChB;AAAA,OAMK;AAsBA,IAAM,MAAM;AAGZ,IAAM,kBACX;AAGF,IAAM,aAAa;AAEnB,IAAM,mBAAmB,CAAC,YAA2B,IAAI,eAAe,OAAO;AA6BxE,SAASA,gBACd,QACA,QAAuB,CAAC,GACxB,KA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SAAS,kBACd,QACA,UACA,UAAgC,CAAC,GACd;AACnB,MAAI,SAAS,aAAa,KAAK;AAG7B,UAAM,SAAS,OAAO,UAAU,KAAK,aAAa;AAClD,UAAM,MAAM,QAAQ,IAAI,MAAM;AAC9B,QAAI,QAAQ,UAAa,QAAQ,IAAI;AACnC,YAAM,IAAI,eAAe,2BAA2B,MAAM,EAAE;AAAA,IAC9D;AAAA,EACF;AACA,MAAI;AACF,WAAO,sBAAsBA,iBAAgB,QAAQ,UAAU,OAAO,CAAC;AAAA,EACzE,SAAS,GAAG;AAKV,UAAM,IAAI,eAAe,aAAa,CAAC,CAAC;AAAA,EAC1C;AACF;AAGA,eAAsB,kBACpB,QACA,QAAuB,CAAC,GACxB,KAAqB,CAAC,GACtB,UAAgC,CAAC,GACL;AAC5B,SAAO;AAAA,IACL;AAAA,IACA,MAAM,wBAAwB,QAAQ,OAAO,EAAE;AAAA,IAC/C;AAAA,EACF;AACF;","names":["selectProvider","providerSpecFor"]}
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
resolvePages,
|
|
9
9
|
runConfigOptions,
|
|
10
10
|
withExternalMetadata
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-77WI6LJW.js";
|
|
12
12
|
import {
|
|
13
13
|
SUMMARY_FORMATS,
|
|
14
14
|
parseFormat
|
|
@@ -93,4 +93,4 @@ export {
|
|
|
93
93
|
runList,
|
|
94
94
|
renderList
|
|
95
95
|
};
|
|
96
|
-
//# sourceMappingURL=chunk-
|
|
96
|
+
//# sourceMappingURL=chunk-OA2GKJVM.js.map
|