@hawkeyexl/manni 4.5.0 → 4.6.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 +41 -0
- package/dist/build-Z5VOVADH.js +32 -0
- package/dist/calibrate-TZYT42DR.js +36 -0
- package/dist/capture-SL4MNDDP.js +34 -0
- package/dist/check-5OMA42Y6.js +26 -0
- package/dist/{check-ESNS7ZBC.js → check-OAJWC3WD.js} +7 -5
- package/dist/{check-RQIIIURI.js → check-PKY7KTQE.js} +13 -14
- package/dist/check-WB2QDHJQ.js +880 -0
- package/dist/check-WB2QDHJQ.js.map +1 -0
- package/dist/{chunk-F2OVHJNC.js → chunk-2JFPBZJK.js} +11 -11
- package/dist/{chunk-CP4ZM43V.js → chunk-2KRB3EG7.js} +2 -2
- package/dist/{chunk-QLUMKWQQ.js → chunk-2M6DVNI5.js} +10 -6
- package/dist/{chunk-QLUMKWQQ.js.map → chunk-2M6DVNI5.js.map} +1 -1
- package/dist/{chunk-HQFVJDEN.js → chunk-3NWX34ZI.js} +19 -19
- package/dist/{chunk-TCC737IS.js → chunk-5G53XATW.js} +4 -4
- package/dist/{chunk-B7XUEQF3.js → chunk-6KKZXB2O.js} +7 -5
- package/dist/{chunk-B7XUEQF3.js.map → chunk-6KKZXB2O.js.map} +1 -1
- package/dist/{chunk-SNEHX4VE.js → chunk-733Y2STG.js} +2 -2
- package/dist/{chunk-ELZ2IIOF.js → chunk-73TC4DYH.js} +2 -2
- package/dist/{chunk-QY3DOZMS.js → chunk-7WRP5FFP.js} +4 -4
- package/dist/{chunk-3R5Y3XOL.js → chunk-APKH2T6E.js} +29 -591
- package/dist/chunk-APKH2T6E.js.map +1 -0
- package/dist/{chunk-FLF6AECQ.js → chunk-B3TS4WRM.js} +17 -15
- package/dist/{chunk-FLF6AECQ.js.map → chunk-B3TS4WRM.js.map} +1 -1
- package/dist/chunk-BWCWTHYS.js +146 -0
- package/dist/chunk-BWCWTHYS.js.map +1 -0
- package/dist/{chunk-C6HZ6C5T.js → chunk-C3B2VJNC.js} +2 -2
- package/dist/{chunk-NN4ASVTY.js → chunk-C73RSUIC.js} +4 -4
- package/dist/chunk-CU57HT2E.js +116 -0
- package/dist/chunk-CU57HT2E.js.map +1 -0
- package/dist/chunk-CWXZ2MRT.js +222 -0
- package/dist/chunk-CWXZ2MRT.js.map +1 -0
- package/dist/{chunk-GAZFKZHM.js → chunk-DC5DDJVE.js} +6 -6
- package/dist/{chunk-52PDIZKV.js → chunk-ECVQNGTH.js} +3 -3
- package/dist/chunk-FLAO4ZS3.js +502 -0
- package/dist/chunk-FLAO4ZS3.js.map +1 -0
- package/dist/chunk-FQGLRJGX.js +174 -0
- package/dist/chunk-FQGLRJGX.js.map +1 -0
- package/dist/{chunk-XWFNO5PO.js → chunk-GAJIJKET.js} +3 -3
- package/dist/{chunk-QCBICNKC.js → chunk-GREQKO6M.js} +202 -54
- package/dist/chunk-GREQKO6M.js.map +1 -0
- package/dist/chunk-HX44GB4Z.js +30 -0
- package/dist/chunk-HX44GB4Z.js.map +1 -0
- package/dist/{chunk-7ZUCEMCY.js → chunk-IY7NYNPZ.js} +9 -11
- package/dist/{chunk-7ZUCEMCY.js.map → chunk-IY7NYNPZ.js.map} +1 -1
- package/dist/{chunk-527HHQPS.js → chunk-KCOFEWV5.js} +6 -4
- package/dist/{chunk-527HHQPS.js.map → chunk-KCOFEWV5.js.map} +1 -1
- package/dist/chunk-M2RLHZ4J.js +849 -0
- package/dist/chunk-M2RLHZ4J.js.map +1 -0
- package/dist/{chunk-K3U5F2QT.js → chunk-M6GSS72T.js} +12 -12
- package/dist/{chunk-UK2I3ACY.js → chunk-MHM4QEBV.js} +4 -4
- package/dist/{chunk-EL2BZTDL.js → chunk-MOWMCEOJ.js} +13 -11
- package/dist/{chunk-EL2BZTDL.js.map → chunk-MOWMCEOJ.js.map} +1 -1
- package/dist/{chunk-OIZ3XMKB.js → chunk-MWBJ3KTF.js} +4 -4
- package/dist/chunk-N7JSEDSC.js +233 -0
- package/dist/chunk-N7JSEDSC.js.map +1 -0
- package/dist/{chunk-MZC62HPZ.js → chunk-NBMPHD4I.js} +2 -2
- package/dist/{chunk-YA63PVWI.js → chunk-NHHOPZRA.js} +12 -10
- package/dist/{chunk-YA63PVWI.js.map → chunk-NHHOPZRA.js.map} +1 -1
- package/dist/{chunk-DX32P2DT.js → chunk-NTWW7J76.js} +2 -2
- package/dist/{chunk-6XTQDFGP.js → chunk-PCFG7E6B.js} +3 -3
- package/dist/{chunk-6XTQDFGP.js.map → chunk-PCFG7E6B.js.map} +1 -1
- package/dist/{chunk-SJO2FTPG.js → chunk-PL4UAF4S.js} +73 -1304
- package/dist/chunk-PL4UAF4S.js.map +1 -0
- package/dist/chunk-QCHVR4ZM.js +286 -0
- package/dist/chunk-QCHVR4ZM.js.map +1 -0
- package/dist/{chunk-JQU7FHYH.js → chunk-QW77LCOU.js} +10 -10
- package/dist/{chunk-IA7BMIPE.js → chunk-SM6NOMJS.js} +2 -2
- package/dist/{chunk-DE7JSWXV.js → chunk-SWSTHZBI.js} +8 -6
- package/dist/{chunk-DE7JSWXV.js.map → chunk-SWSTHZBI.js.map} +1 -1
- package/dist/{chunk-NGK3N6F2.js → chunk-T6SYGLWR.js} +3 -3
- package/dist/chunk-TH4JVQPF.js +133 -0
- package/dist/chunk-TH4JVQPF.js.map +1 -0
- package/dist/{chunk-TVIX653Q.js → chunk-TLXE7LYK.js} +4 -4
- package/dist/{chunk-HVFR66GQ.js → chunk-TUAAR3MM.js} +3280 -283
- package/dist/chunk-TUAAR3MM.js.map +1 -0
- package/dist/{chunk-TA42STP7.js → chunk-UAKNZVCD.js} +4 -4
- package/dist/{chunk-C3KI45RF.js → chunk-UJSGS2Y5.js} +4 -4
- package/dist/{chunk-ZX43SRZR.js → chunk-UWQ2UVHE.js} +8 -6
- package/dist/{chunk-ZX43SRZR.js.map → chunk-UWQ2UVHE.js.map} +1 -1
- package/dist/chunk-WQWKYAAK.js +86 -0
- package/dist/chunk-WQWKYAAK.js.map +1 -0
- package/dist/{chunk-LJ2RDH3F.js → chunk-XG6PVB5S.js} +1 -23
- package/dist/chunk-XG6PVB5S.js.map +1 -0
- package/dist/{chunk-Q35YIDBV.js → chunk-XKBEHKWO.js} +29 -264
- package/dist/chunk-XKBEHKWO.js.map +1 -0
- package/dist/chunk-XPEWUK7J.js +532 -0
- package/dist/chunk-XPEWUK7J.js.map +1 -0
- package/dist/{chunk-BOIF2XGG.js → chunk-XXDXIIQ4.js} +2 -2
- package/dist/chunk-YLK2J5YK.js +610 -0
- package/dist/chunk-YLK2J5YK.js.map +1 -0
- package/dist/{chunk-7OQAU4EA.js → chunk-Z4IZGEM3.js} +16 -12
- package/dist/{chunk-7OQAU4EA.js.map → chunk-Z4IZGEM3.js.map} +1 -1
- package/dist/{cli-E3H6ZP4I.js → cli-6EWVMEN6.js} +5 -3
- package/dist/{cli-E3H6ZP4I.js.map → cli-6EWVMEN6.js.map} +1 -1
- package/dist/{cli-MHTYPVOD.js → cli-6H7HVDMQ.js} +113 -20
- package/dist/{cli-MHTYPVOD.js.map → cli-6H7HVDMQ.js.map} +1 -1
- package/dist/{cli-HUIMNJT6.js → cli-EPVZHAZS.js} +19 -20
- package/dist/{cli-HUIMNJT6.js.map → cli-EPVZHAZS.js.map} +1 -1
- package/dist/{cli-6PGVHP7Y.js → cli-LUCSGTVI.js} +17 -19
- package/dist/{cli-6PGVHP7Y.js.map → cli-LUCSGTVI.js.map} +1 -1
- package/dist/{cli-PRZHQ3QB.js → cli-NIG4N3XM.js} +14 -15
- package/dist/{cli-PRZHQ3QB.js.map → cli-NIG4N3XM.js.map} +1 -1
- package/dist/{cli-TYGOHJOJ.js → cli-PSKNB66T.js} +225 -58
- package/dist/cli-PSKNB66T.js.map +1 -0
- package/dist/{cli-QKIJOXGW.js → cli-UO4NHIB3.js} +17 -17
- package/dist/{cli-AAG3N4NB.js → cli-UQ7A3YA2.js} +17 -18
- package/dist/{cli-AAG3N4NB.js.map → cli-UQ7A3YA2.js.map} +1 -1
- package/dist/{cli-YW6VWBHX.js → cli-YHYDLQAF.js} +10 -10
- package/dist/cli.js +11 -11
- package/dist/config-P4HDNTYD.js +26 -0
- package/dist/conformance-ZFCMKM6M.js +18 -0
- package/dist/docmeta.js +9 -9
- package/dist/github-7ZCH5PSO.js +26 -0
- package/dist/github-POT6724K.js +31 -0
- package/dist/host-6GURH5HE.js +23 -0
- package/dist/index.d.ts +72 -4
- package/dist/index.js +176 -166
- package/dist/index.js.map +1 -1
- package/dist/{json-4DCKDGUV.js → json-KT2K62L5.js} +12 -13
- package/dist/lint-5AQ5C2BV.js +29 -0
- package/dist/list-5JZKX2NK.js +28 -0
- package/dist/list-SWPFXQMU.js +30 -0
- package/dist/{page-QEDB7EVU.js → page-UPSXRP75.js} +11 -12
- package/dist/prepare-6GNEWCNH.js +155 -0
- package/dist/prepare-6GNEWCNH.js.map +1 -0
- package/dist/{pretty-SQX33UM2.js → pretty-Q6FQAOK4.js} +13 -14
- package/dist/{pretty-5DGEBZSV.js → pretty-SQRPFPSQ.js} +12 -13
- package/dist/provider-AMGRDY6V.js +34 -0
- package/dist/release-IECYCLTD.js +36 -0
- package/dist/release-IECYCLTD.js.map +1 -0
- package/dist/{reporters-OHSI3RMV.js → reporters-45MMC2ID.js} +11 -12
- package/dist/{reporters-YELDDYJD.js → reporters-XUV4MM64.js} +7 -5
- package/dist/reporters-XUV4MM64.js.map +1 -0
- package/dist/run-KMWY2IAN.js +32 -0
- package/dist/run-KMWY2IAN.js.map +1 -0
- package/dist/{term-2WMDZ4PY.js → term-PCJUCWNF.js} +16 -17
- package/dist/{term-2WMDZ4PY.js.map → term-PCJUCWNF.js.map} +1 -1
- package/dist/validate-IMNCZNWG.js +17 -0
- package/dist/validate-IMNCZNWG.js.map +1 -0
- package/package.json +2 -2
- package/plugin/manni/.claude-plugin/plugin.json +1 -1
- package/plugin/manni/hooks/hooks.json +47 -0
- package/dist/batch-GOE3UXOD.js +0 -36
- package/dist/build-M7BMEHL2.js +0 -33
- package/dist/calibrate-6RRAILUY.js +0 -31
- package/dist/capture-RJPQ6B4N.js +0 -32
- package/dist/check-BQD64X3N.js +0 -27
- package/dist/chunk-3R5Y3XOL.js.map +0 -1
- package/dist/chunk-3YHAYXBC.js +0 -164
- package/dist/chunk-3YHAYXBC.js.map +0 -1
- package/dist/chunk-HVFR66GQ.js.map +0 -1
- package/dist/chunk-LJ2RDH3F.js.map +0 -1
- package/dist/chunk-NAZRLJAK.js +0 -3090
- package/dist/chunk-NAZRLJAK.js.map +0 -1
- package/dist/chunk-Q35YIDBV.js.map +0 -1
- package/dist/chunk-QCBICNKC.js.map +0 -1
- package/dist/chunk-SJO2FTPG.js.map +0 -1
- package/dist/chunk-TU2WUBVZ.js +0 -2
- package/dist/cli-TYGOHJOJ.js.map +0 -1
- package/dist/github-3WMSTNTK.js +0 -32
- package/dist/github-OXSJQ4PS.js +0 -27
- package/dist/lint-YDHVVZHT.js +0 -30
- package/dist/list-3ZO2NIYO.js +0 -31
- package/dist/list-EJH6VAOW.js +0 -29
- package/dist/run-IP6NZHAG.js +0 -33
- package/dist/validate-G6HH3YXL.js +0 -16
- /package/dist/{batch-GOE3UXOD.js.map → batch-OZOACN4G.js.map} +0 -0
- /package/dist/{build-M7BMEHL2.js.map → build-Z5VOVADH.js.map} +0 -0
- /package/dist/{calibrate-6RRAILUY.js.map → calibrate-TZYT42DR.js.map} +0 -0
- /package/dist/{capture-RJPQ6B4N.js.map → capture-SL4MNDDP.js.map} +0 -0
- /package/dist/{check-BQD64X3N.js.map → check-5OMA42Y6.js.map} +0 -0
- /package/dist/{check-ESNS7ZBC.js.map → check-OAJWC3WD.js.map} +0 -0
- /package/dist/{check-RQIIIURI.js.map → check-PKY7KTQE.js.map} +0 -0
- /package/dist/{chunk-F2OVHJNC.js.map → chunk-2JFPBZJK.js.map} +0 -0
- /package/dist/{chunk-CP4ZM43V.js.map → chunk-2KRB3EG7.js.map} +0 -0
- /package/dist/{chunk-HQFVJDEN.js.map → chunk-3NWX34ZI.js.map} +0 -0
- /package/dist/{chunk-TCC737IS.js.map → chunk-5G53XATW.js.map} +0 -0
- /package/dist/{chunk-SNEHX4VE.js.map → chunk-733Y2STG.js.map} +0 -0
- /package/dist/{chunk-ELZ2IIOF.js.map → chunk-73TC4DYH.js.map} +0 -0
- /package/dist/{chunk-QY3DOZMS.js.map → chunk-7WRP5FFP.js.map} +0 -0
- /package/dist/{chunk-C6HZ6C5T.js.map → chunk-C3B2VJNC.js.map} +0 -0
- /package/dist/{chunk-NN4ASVTY.js.map → chunk-C73RSUIC.js.map} +0 -0
- /package/dist/{chunk-GAZFKZHM.js.map → chunk-DC5DDJVE.js.map} +0 -0
- /package/dist/{chunk-52PDIZKV.js.map → chunk-ECVQNGTH.js.map} +0 -0
- /package/dist/{chunk-XWFNO5PO.js.map → chunk-GAJIJKET.js.map} +0 -0
- /package/dist/{chunk-K3U5F2QT.js.map → chunk-M6GSS72T.js.map} +0 -0
- /package/dist/{chunk-UK2I3ACY.js.map → chunk-MHM4QEBV.js.map} +0 -0
- /package/dist/{chunk-OIZ3XMKB.js.map → chunk-MWBJ3KTF.js.map} +0 -0
- /package/dist/{chunk-MZC62HPZ.js.map → chunk-NBMPHD4I.js.map} +0 -0
- /package/dist/{chunk-DX32P2DT.js.map → chunk-NTWW7J76.js.map} +0 -0
- /package/dist/{chunk-JQU7FHYH.js.map → chunk-QW77LCOU.js.map} +0 -0
- /package/dist/{chunk-IA7BMIPE.js.map → chunk-SM6NOMJS.js.map} +0 -0
- /package/dist/{chunk-NGK3N6F2.js.map → chunk-T6SYGLWR.js.map} +0 -0
- /package/dist/{chunk-TVIX653Q.js.map → chunk-TLXE7LYK.js.map} +0 -0
- /package/dist/{chunk-TA42STP7.js.map → chunk-UAKNZVCD.js.map} +0 -0
- /package/dist/{chunk-C3KI45RF.js.map → chunk-UJSGS2Y5.js.map} +0 -0
- /package/dist/{chunk-BOIF2XGG.js.map → chunk-XXDXIIQ4.js.map} +0 -0
- /package/dist/{cli-QKIJOXGW.js.map → cli-UO4NHIB3.js.map} +0 -0
- /package/dist/{chunk-TU2WUBVZ.js.map → cli-YHYDLQAF.js.map} +0 -0
- /package/dist/{cli-YW6VWBHX.js.map → config-P4HDNTYD.js.map} +0 -0
- /package/dist/{github-3WMSTNTK.js.map → conformance-ZFCMKM6M.js.map} +0 -0
- /package/dist/{github-OXSJQ4PS.js.map → github-7ZCH5PSO.js.map} +0 -0
- /package/dist/{json-4DCKDGUV.js.map → github-POT6724K.js.map} +0 -0
- /package/dist/{lint-YDHVVZHT.js.map → host-6GURH5HE.js.map} +0 -0
- /package/dist/{list-3ZO2NIYO.js.map → json-KT2K62L5.js.map} +0 -0
- /package/dist/{list-EJH6VAOW.js.map → lint-5AQ5C2BV.js.map} +0 -0
- /package/dist/{page-QEDB7EVU.js.map → list-5JZKX2NK.js.map} +0 -0
- /package/dist/{pretty-5DGEBZSV.js.map → list-SWPFXQMU.js.map} +0 -0
- /package/dist/{pretty-SQX33UM2.js.map → page-UPSXRP75.js.map} +0 -0
- /package/dist/{reporters-OHSI3RMV.js.map → pretty-Q6FQAOK4.js.map} +0 -0
- /package/dist/{reporters-YELDDYJD.js.map → pretty-SQRPFPSQ.js.map} +0 -0
- /package/dist/{run-IP6NZHAG.js.map → provider-AMGRDY6V.js.map} +0 -0
- /package/dist/{validate-G6HH3YXL.js.map → reporters-45MMC2ID.js.map} +0 -0
|
@@ -3,573 +3,26 @@ import {
|
|
|
3
3
|
configDir
|
|
4
4
|
} from "./chunk-4TSWU2SU.js";
|
|
5
5
|
import {
|
|
6
|
-
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import {
|
|
9
|
-
EXECUTION_GRANTS,
|
|
10
|
-
configuredGrants,
|
|
11
|
-
isExecutionGrant,
|
|
12
|
-
unknownGrantsMessage
|
|
13
|
-
} from "./chunk-YNHZHSSM.js";
|
|
6
|
+
MANIFEST_VERSION
|
|
7
|
+
} from "./chunk-CU57HT2E.js";
|
|
14
8
|
import {
|
|
15
9
|
metaProvenanceEntries
|
|
16
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-GREQKO6M.js";
|
|
17
11
|
import {
|
|
18
12
|
__default4 as __default,
|
|
19
13
|
extractFrontmatter
|
|
20
|
-
} from "./chunk-
|
|
21
|
-
import {
|
|
22
|
-
FAMILY_CONFIG_NAMES,
|
|
23
|
-
assertKnownProvider,
|
|
24
|
-
findConfigFileSync,
|
|
25
|
-
readConfigFileSync
|
|
26
|
-
} from "./chunk-Q35YIDBV.js";
|
|
27
|
-
import {
|
|
28
|
-
errorMessage
|
|
29
|
-
} from "./chunk-G3T47CFV.js";
|
|
30
|
-
|
|
31
|
-
// src/tracevals/calibrate/labels.ts
|
|
32
|
-
import { readFile } from "node:fs/promises";
|
|
33
|
-
import { dirname, resolve } from "node:path";
|
|
34
|
-
import { Ajv2020 } from "ajv/dist/2020.js";
|
|
35
|
-
import { parse as parseYaml } from "yaml";
|
|
36
|
-
|
|
37
|
-
// src/tracevals/calibrate/labels-schema.json
|
|
38
|
-
var labels_schema_default = {
|
|
39
|
-
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
40
|
-
$id: "manni:tracevals:calibration-labels",
|
|
41
|
-
title: "manni tracevals calibration labels",
|
|
42
|
-
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 \u2014 and because the eval vocabulary is docmeta's, vendored byte-identical, with `inlineEval` closed to additions (ADR 01010).",
|
|
43
|
-
type: "object",
|
|
44
|
-
additionalProperties: false,
|
|
45
|
-
required: ["version", "labels"],
|
|
46
|
-
properties: {
|
|
47
|
-
version: {
|
|
48
|
-
const: 1,
|
|
49
|
-
description: "Format version. Pinned so a future shape change is an explicit migration rather than a silently-reinterpreted file."
|
|
50
|
-
},
|
|
51
|
-
labels: {
|
|
52
|
-
type: "array",
|
|
53
|
-
minItems: 1,
|
|
54
|
-
description: "One entry per (trace, artifact, eval) you have judged by hand.",
|
|
55
|
-
items: {
|
|
56
|
-
type: "object",
|
|
57
|
-
additionalProperties: false,
|
|
58
|
-
required: ["trace", "artifact", "eval", "expected"],
|
|
59
|
-
properties: {
|
|
60
|
-
trace: {
|
|
61
|
-
type: "string",
|
|
62
|
-
minLength: 1,
|
|
63
|
-
description: "Path to the trace file, resolved against this file's own directory \u2014 not the working directory."
|
|
64
|
-
},
|
|
65
|
-
artifact: {
|
|
66
|
-
type: "string",
|
|
67
|
-
minLength: 1,
|
|
68
|
-
description: "Artifact name as the report shows it: a skill name, a subagent_type, or a project-rules filename such as CLAUDE.md."
|
|
69
|
-
},
|
|
70
|
-
type: {
|
|
71
|
-
enum: ["skill", "agent", "project-rules", "slash-command"],
|
|
72
|
-
description: "Optional disambiguator, needed when one name resolves to two kinds of artifact \u2014 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."
|
|
73
|
-
},
|
|
74
|
-
eval: {
|
|
75
|
-
type: "string",
|
|
76
|
-
minLength: 1,
|
|
77
|
-
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."
|
|
78
|
-
},
|
|
79
|
-
expected: {
|
|
80
|
-
enum: ["pass", "fail", "needs-review"],
|
|
81
|
-
description: "What you decided. `needs-review` means you found it genuinely ambiguous and want the tool to defer too."
|
|
82
|
-
},
|
|
83
|
-
note: {
|
|
84
|
-
type: "string",
|
|
85
|
-
description: "Why you decided that. Carried into the disagreement report, where it is the whole reason a disagreement is actionable."
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
// src/tracevals/calibrate/labels.ts
|
|
94
|
-
var labelsSchema = labels_schema_default;
|
|
95
|
-
var DEFAULT_LABELS_FILE = "tracevals/labels.yaml";
|
|
96
|
-
var ajv = new Ajv2020({ allErrors: true });
|
|
97
|
-
var validate = ajv.compile(labelsSchema);
|
|
98
|
-
var labelKey = (traceFile, artifact, evalName, type) => `${traceFile}\0${type ?? ""}\0${artifact}\0${evalName}`;
|
|
99
|
-
function parseLabels(text, file) {
|
|
100
|
-
let raw;
|
|
101
|
-
try {
|
|
102
|
-
raw = parseYaml(text);
|
|
103
|
-
} catch (err) {
|
|
104
|
-
throw new TracevalsError(
|
|
105
|
-
`could not parse ${file}: ${errorMessage(err)}`
|
|
106
|
-
);
|
|
107
|
-
}
|
|
108
|
-
if (raw === null || raw === void 0) {
|
|
109
|
-
throw new TracevalsError(`invalid labels file ${file}: it is empty`);
|
|
110
|
-
}
|
|
111
|
-
if (!validate(raw)) {
|
|
112
|
-
const detail = (validate.errors ?? []).map((e) => `${e.instancePath || "/"} ${e.message ?? "invalid"}`).join("; ");
|
|
113
|
-
const empty2 = (validate.errors ?? []).some(
|
|
114
|
-
(e) => e.instancePath === "/labels" && e.keyword === "minItems"
|
|
115
|
-
);
|
|
116
|
-
throw new TracevalsError(
|
|
117
|
-
empty2 ? `invalid labels file ${file}: it must carry at least one label \u2014 an empty one measures nothing` : `invalid labels file ${file}: ${detail}`
|
|
118
|
-
);
|
|
119
|
-
}
|
|
120
|
-
const base = dirname(resolve(file));
|
|
121
|
-
const labels = [];
|
|
122
|
-
const seen = /* @__PURE__ */ new Set();
|
|
123
|
-
for (const entry of raw.labels) {
|
|
124
|
-
const traceFile = resolve(base, entry.trace);
|
|
125
|
-
const type = entry.type;
|
|
126
|
-
const key = labelKey(
|
|
127
|
-
traceFile,
|
|
128
|
-
entry.artifact,
|
|
129
|
-
entry.eval,
|
|
130
|
-
type
|
|
131
|
-
);
|
|
132
|
-
if (seen.has(key)) {
|
|
133
|
-
throw new TracevalsError(
|
|
134
|
-
`invalid labels file ${file}: duplicate label for ${entry.artifact ?? "?"} \u203A ${entry.eval ?? "?"} on ${entry.trace ?? "?"}`
|
|
135
|
-
);
|
|
136
|
-
}
|
|
137
|
-
seen.add(key);
|
|
138
|
-
labels.push({
|
|
139
|
-
trace: entry.trace,
|
|
140
|
-
traceFile,
|
|
141
|
-
artifact: entry.artifact,
|
|
142
|
-
...type !== void 0 ? { type } : {},
|
|
143
|
-
eval: entry.eval,
|
|
144
|
-
expected: entry.expected,
|
|
145
|
-
...entry.note !== void 0 ? { note: entry.note } : {}
|
|
146
|
-
});
|
|
147
|
-
}
|
|
148
|
-
return labels;
|
|
149
|
-
}
|
|
150
|
-
async function loadLabels(file) {
|
|
151
|
-
let text;
|
|
152
|
-
try {
|
|
153
|
-
text = await readFile(file, "utf-8");
|
|
154
|
-
} catch (err) {
|
|
155
|
-
throw new TracevalsError(
|
|
156
|
-
`could not read labels file ${file}: ${errorMessage(err)}`
|
|
157
|
-
);
|
|
158
|
-
}
|
|
159
|
-
return parseLabels(text, file);
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
// src/tracevals/core/config.ts
|
|
163
|
-
import { Ajv2020 as Ajv20202 } from "ajv/dist/2020.js";
|
|
164
|
-
|
|
165
|
-
// src/tracevals/core/config-schema.json
|
|
166
|
-
var config_schema_default = {
|
|
167
|
-
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
168
|
-
$id: "manni:tracevals:config",
|
|
169
|
-
title: "tracevals section of manni.config.yaml",
|
|
170
|
-
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.",
|
|
171
|
-
type: "object",
|
|
172
|
-
additionalProperties: false,
|
|
173
|
-
properties: {
|
|
174
|
-
provider: {
|
|
175
|
-
type: "string",
|
|
176
|
-
minLength: 1,
|
|
177
|
-
description: "Which provider judges: auto, anthropic, openai, claude-cli, or llama-cpp. 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."
|
|
178
|
-
},
|
|
179
|
-
model: {
|
|
180
|
-
type: "string",
|
|
181
|
-
minLength: 1,
|
|
182
|
-
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."
|
|
183
|
-
},
|
|
184
|
-
judge: {
|
|
185
|
-
type: "object",
|
|
186
|
-
additionalProperties: false,
|
|
187
|
-
properties: {
|
|
188
|
-
ensembleRuns: { type: "integer", minimum: 1 },
|
|
189
|
-
temperature: { type: "number", minimum: 0, maximum: 2 },
|
|
190
|
-
zones: {
|
|
191
|
-
type: "object",
|
|
192
|
-
additionalProperties: false,
|
|
193
|
-
properties: {
|
|
194
|
-
autoPass: { type: "number", minimum: 0, maximum: 1 },
|
|
195
|
-
autoFail: { type: "number", minimum: 0, maximum: 1 }
|
|
196
|
-
}
|
|
197
|
-
},
|
|
198
|
-
cacheDir: { type: "string" },
|
|
199
|
-
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." },
|
|
200
|
-
redact: {
|
|
201
|
-
type: "array",
|
|
202
|
-
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 \u2014 --deterministic-only is the only setting that guarantees nothing leaves the machine.",
|
|
203
|
-
items: { type: "string", minLength: 1 }
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
},
|
|
207
|
-
execution: {
|
|
208
|
-
type: "object",
|
|
209
|
-
additionalProperties: false,
|
|
210
|
-
description: "Operator grant for executing content-authored code.",
|
|
211
|
-
properties: {
|
|
212
|
-
allow: {
|
|
213
|
-
type: "array",
|
|
214
|
-
items: { enum: ["frontmatter-commands"] },
|
|
215
|
-
default: ["frontmatter-commands"],
|
|
216
|
-
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`."
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
},
|
|
220
|
-
render: {
|
|
221
|
-
type: "object",
|
|
222
|
-
additionalProperties: false,
|
|
223
|
-
properties: {
|
|
224
|
-
maxBlockChars: { type: "integer", minimum: 100 },
|
|
225
|
-
maxTotalChars: {
|
|
226
|
-
type: "integer",
|
|
227
|
-
minimum: 1e3,
|
|
228
|
-
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."
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
},
|
|
232
|
-
history: {
|
|
233
|
-
type: "object",
|
|
234
|
-
additionalProperties: false,
|
|
235
|
-
properties: {
|
|
236
|
-
file: { type: "string" }
|
|
237
|
-
}
|
|
238
|
-
},
|
|
239
|
-
capture: {
|
|
240
|
-
type: "object",
|
|
241
|
-
additionalProperties: false,
|
|
242
|
-
description: "Session manifests \u2014 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.",
|
|
243
|
-
properties: {
|
|
244
|
-
dir: {
|
|
245
|
-
type: "string",
|
|
246
|
-
minLength: 1,
|
|
247
|
-
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."
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
},
|
|
251
|
-
fill: {
|
|
252
|
-
type: "object",
|
|
253
|
-
additionalProperties: false,
|
|
254
|
-
properties: {
|
|
255
|
-
confidenceThreshold: { type: "number", minimum: 0, maximum: 1 },
|
|
256
|
-
maxEvalsPerArtifact: { type: "integer", minimum: 1 },
|
|
257
|
-
temperature: { type: "number", minimum: 0, maximum: 2 },
|
|
258
|
-
cacheDir: { type: "string" },
|
|
259
|
-
maxTurns: { type: "integer", minimum: 1, description: "Stop after this many inference calls, one per artifact filled. A cached artifact spends none. Unset means unbounded." }
|
|
260
|
-
}
|
|
261
|
-
},
|
|
262
|
-
calibrate: {
|
|
263
|
-
type: "object",
|
|
264
|
-
additionalProperties: false,
|
|
265
|
-
description: "Settings for `manni tracevals calibrate` \u2014 measuring the tool's verdicts against a human's answers. See ADR 01022.",
|
|
266
|
-
properties: {
|
|
267
|
-
labels: {
|
|
268
|
-
type: "string",
|
|
269
|
-
minLength: 1,
|
|
270
|
-
description: "Default labels sidecar, resolved against this config file's directory. Overridden by --labels."
|
|
271
|
-
},
|
|
272
|
-
maxFalsePass: {
|
|
273
|
-
type: "integer",
|
|
274
|
-
minimum: 0,
|
|
275
|
-
description: "Fail the calibration run (exit 1) above this many false passes \u2014 labelled fail, judged pass. Unset by default: a calibration run is a measurement, not a gate."
|
|
276
|
-
},
|
|
277
|
-
maxFalseFail: {
|
|
278
|
-
type: "integer",
|
|
279
|
-
minimum: 0,
|
|
280
|
-
description: "Fail the calibration run above this many false fails \u2014 labelled pass, judged fail."
|
|
281
|
-
},
|
|
282
|
-
maxReview: {
|
|
283
|
-
type: "integer",
|
|
284
|
-
minimum: 0,
|
|
285
|
-
description: "Fail the calibration run above this many needs-review outcomes across the whole corpus."
|
|
286
|
-
},
|
|
287
|
-
sweep: {
|
|
288
|
-
type: "object",
|
|
289
|
-
additionalProperties: false,
|
|
290
|
-
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.",
|
|
291
|
-
properties: {
|
|
292
|
-
ensembleRuns: {
|
|
293
|
-
type: "array",
|
|
294
|
-
minItems: 1,
|
|
295
|
-
items: { type: "integer", minimum: 1 }
|
|
296
|
-
},
|
|
297
|
-
autoPass: {
|
|
298
|
-
type: "array",
|
|
299
|
-
minItems: 1,
|
|
300
|
-
items: { type: "number", minimum: 0, maximum: 1 }
|
|
301
|
-
},
|
|
302
|
-
autoFail: {
|
|
303
|
-
type: "array",
|
|
304
|
-
minItems: 1,
|
|
305
|
-
items: { type: "number", minimum: 0, maximum: 1 }
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
},
|
|
311
|
-
failOnReview: { type: "boolean" },
|
|
312
|
-
plugins: {
|
|
313
|
-
type: "array",
|
|
314
|
-
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.",
|
|
315
|
-
items: { type: "string", minLength: 1 }
|
|
316
|
-
},
|
|
317
|
-
reportUnusedArtifacts: {
|
|
318
|
-
type: "boolean",
|
|
319
|
-
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."
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
};
|
|
323
|
-
|
|
324
|
-
// src/tracevals/judge/redact.ts
|
|
325
|
-
var SECRET_NAME = "(?:(?:[A-Za-z0-9]+[_\\-.])*(?:api[_\\-.]?key|access[_\\-.]?key|secret[_\\-.]?key|auth[_\\-.]?token|access[_\\-.]?token|refresh[_\\-.]?token|client[_\\-.]?secret|session[_\\-.]?token|key|token|secret|password|passwd|passphrase|credentials?|authorization)|AWS_[A-Za-z0-9_]+)";
|
|
326
|
-
var REDACTION_PATTERNS = [
|
|
327
|
-
{
|
|
328
|
-
label: "private-key",
|
|
329
|
-
pattern: /-----BEGIN [A-Z0-9 ]*PRIVATE KEY-----[\s\S]*?-----END [A-Z0-9 ]*PRIVATE KEY-----/g,
|
|
330
|
-
replacement: "[redacted:private-key]"
|
|
331
|
-
},
|
|
332
|
-
{
|
|
333
|
-
// `sk-`, `sk-ant-…`, `pk-`, `rk-`: the OpenAI/Anthropic/Stripe family.
|
|
334
|
-
label: "api-key",
|
|
335
|
-
pattern: /\b[sprk]k-(?:[A-Za-z0-9]+-)*[A-Za-z0-9_-]{16,}/g,
|
|
336
|
-
replacement: "[redacted:api-key]"
|
|
337
|
-
},
|
|
338
|
-
{
|
|
339
|
-
label: "aws-access-key-id",
|
|
340
|
-
pattern: /\b(?:AKIA|ASIA|AROA|AIDA)[0-9A-Z]{16}\b/g,
|
|
341
|
-
replacement: "[redacted:aws-access-key-id]"
|
|
342
|
-
},
|
|
343
|
-
{
|
|
344
|
-
label: "github-token",
|
|
345
|
-
pattern: /\b(?:gh[pousr]_[A-Za-z0-9]{20,}|github_pat_[A-Za-z0-9_]{20,})\b/g,
|
|
346
|
-
replacement: "[redacted:github-token]"
|
|
347
|
-
},
|
|
348
|
-
{
|
|
349
|
-
label: "slack-token",
|
|
350
|
-
pattern: /\bxox[abeoprs]-[A-Za-z0-9-]{10,}/g,
|
|
351
|
-
replacement: "[redacted:slack-token]"
|
|
352
|
-
},
|
|
353
|
-
{
|
|
354
|
-
label: "google-api-key",
|
|
355
|
-
pattern: /\bAIza[0-9A-Za-z_-]{35}\b/g,
|
|
356
|
-
replacement: "[redacted:google-api-key]"
|
|
357
|
-
},
|
|
358
|
-
{
|
|
359
|
-
label: "jwt",
|
|
360
|
-
pattern: /\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}/g,
|
|
361
|
-
replacement: "[redacted:jwt]"
|
|
362
|
-
},
|
|
363
|
-
{
|
|
364
|
-
// `Authorization: Bearer …`, `Basic …`, `Token …`. The scheme is kept so
|
|
365
|
-
// the judge can still see that authentication happened.
|
|
366
|
-
//
|
|
367
|
-
// Deliberately *not* case-insensitive as a whole: `basic` and `token` are
|
|
368
|
-
// ordinary English words, and `/i` would redact "basic configuration" as an
|
|
369
|
-
// auth header. `bearer` is not, so it gets both spellings.
|
|
370
|
-
label: "auth-token",
|
|
371
|
-
pattern: /\b([Bb]earer|Basic|Token)\s+[A-Za-z0-9\-._~+/]{12,}={0,2}/g,
|
|
372
|
-
replacement: "$1 [redacted:auth-token]"
|
|
373
|
-
},
|
|
374
|
-
{
|
|
375
|
-
// JSON member — the shape a tool input renders as.
|
|
376
|
-
label: "secret-member",
|
|
377
|
-
pattern: new RegExp(`("${SECRET_NAME}"\\s*:\\s*)"[^"]*"`, "gi"),
|
|
378
|
-
replacement: '$1"[redacted:secret-value]"'
|
|
379
|
-
},
|
|
380
|
-
{
|
|
381
|
-
// Shell / `.env` assignment. The variable name is kept: knowing that a
|
|
382
|
-
// secret was set, and which one, is often the adherence question.
|
|
383
|
-
label: "secret-assignment",
|
|
384
|
-
pattern: new RegExp(
|
|
385
|
-
`\\b(${SECRET_NAME})(\\s*=\\s*)(?:"[^"\\n]*"|'[^'\\n]*'|[^\\s"'\\n]+)`,
|
|
386
|
-
"gi"
|
|
387
|
-
),
|
|
388
|
-
replacement: "$1$2[redacted:secret-value]"
|
|
389
|
-
}
|
|
390
|
-
];
|
|
391
|
-
var CUSTOM_PLACEHOLDER = "[redacted]";
|
|
392
|
-
function makeRedactor(extra = []) {
|
|
393
|
-
const custom = compileRedactPatterns(extra).map(
|
|
394
|
-
(pattern) => [pattern, CUSTOM_PLACEHOLDER]
|
|
395
|
-
);
|
|
396
|
-
const all = [
|
|
397
|
-
...REDACTION_PATTERNS.map(
|
|
398
|
-
({ pattern, replacement }) => [pattern, replacement]
|
|
399
|
-
),
|
|
400
|
-
...custom
|
|
401
|
-
];
|
|
402
|
-
return (text) => {
|
|
403
|
-
let out = text;
|
|
404
|
-
for (const [pattern, replacement] of all) {
|
|
405
|
-
out = out.replace(pattern, replacement);
|
|
406
|
-
}
|
|
407
|
-
return out;
|
|
408
|
-
};
|
|
409
|
-
}
|
|
410
|
-
function compileRedactPatterns(sources) {
|
|
411
|
-
return sources.map((source) => {
|
|
412
|
-
try {
|
|
413
|
-
return new RegExp(source, "g");
|
|
414
|
-
} catch (err) {
|
|
415
|
-
throw new TracevalsError(
|
|
416
|
-
`invalid config: judge.redact pattern ${JSON.stringify(source)} is not a valid regular expression: ${err instanceof Error ? err.message : String(err)}`
|
|
417
|
-
);
|
|
418
|
-
}
|
|
419
|
-
});
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
// src/tracevals/capture/types.ts
|
|
423
|
-
var MANIFEST_VERSION = 1;
|
|
424
|
-
var DEFAULT_CAPTURE_DIR = ".manni/tracevals/sessions";
|
|
425
|
-
|
|
426
|
-
// src/tracevals/core/config.ts
|
|
427
|
-
var configSchema = config_schema_default;
|
|
428
|
-
var DEFAULT_CONFIG_FILENAME = FAMILY_CONFIG_NAMES[0] ?? "manni.config.yaml";
|
|
429
|
-
var CONFIG_SECTION_KEY = "tracevals";
|
|
430
|
-
var CONFIG_SECTION_KEY_PATH = `/${CONFIG_SECTION_KEY}`;
|
|
431
|
-
var CONFIG_FILE = {
|
|
432
|
-
section: CONFIG_SECTION_KEY,
|
|
433
|
-
legacyNames: [],
|
|
434
|
-
toError: (message) => new TracevalsError(message)
|
|
435
|
-
};
|
|
436
|
-
var ajv2 = new Ajv20202({ allErrors: true, verbose: true });
|
|
437
|
-
var validate2 = ajv2.compile(configSchema);
|
|
438
|
-
function camelCaseHint(key, parentSchema) {
|
|
439
|
-
const camel = key.replace(/-([a-z0-9])/g, (_, c) => c.toUpperCase());
|
|
440
|
-
if (camel === key || parentSchema === null || typeof parentSchema !== "object") {
|
|
441
|
-
return "";
|
|
442
|
-
}
|
|
443
|
-
const properties = parentSchema.properties;
|
|
444
|
-
return properties !== null && typeof properties === "object" && Object.hasOwn(properties, camel) ? `; did you mean "${camel}"?` : "";
|
|
445
|
-
}
|
|
446
|
-
function movedProviderHint(instancePath, keyword) {
|
|
447
|
-
return instancePath === "/provider" && keyword === "type" ? `; "provider" is now a provider name; per-provider settings moved to the top-level providers: map` : "";
|
|
448
|
-
}
|
|
449
|
-
function parseConfig(raw, file = {}) {
|
|
450
|
-
const source = file.source ?? DEFAULT_CONFIG_FILENAME;
|
|
451
|
-
const unknownGrants = configuredGrants(raw).filter((g) => !isExecutionGrant(g));
|
|
452
|
-
if (unknownGrants.length > 0) {
|
|
453
|
-
throw new TracevalsError(`${source}: ${unknownGrantsMessage(unknownGrants)}`);
|
|
454
|
-
}
|
|
455
|
-
if (!validate2(raw)) {
|
|
456
|
-
const detail = (validate2.errors ?? []).map((e) => {
|
|
457
|
-
const extra = e.keyword === "additionalProperties" ? e.params.additionalProperty : void 0;
|
|
458
|
-
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);
|
|
459
|
-
}).join("; ");
|
|
460
|
-
throw new TracevalsError(`${source}: ${detail}`);
|
|
461
|
-
}
|
|
462
|
-
const r = raw;
|
|
463
|
-
const provider = r.provider ?? null;
|
|
464
|
-
if (provider !== null) {
|
|
465
|
-
assertKnownProvider(provider, (message) => new TracevalsError(message));
|
|
466
|
-
}
|
|
467
|
-
const config = {
|
|
468
|
-
provider,
|
|
469
|
-
model: r.model ?? null,
|
|
470
|
-
providers: file.providers ?? {},
|
|
471
|
-
configSource: source,
|
|
472
|
-
judge: {
|
|
473
|
-
ensembleRuns: r.judge?.ensembleRuns ?? 3,
|
|
474
|
-
temperature: r.judge?.temperature ?? 0,
|
|
475
|
-
zones: {
|
|
476
|
-
autoPass: r.judge?.zones?.autoPass ?? 0.8,
|
|
477
|
-
autoFail: r.judge?.zones?.autoFail ?? 0.8
|
|
478
|
-
},
|
|
479
|
-
cacheDir: r.judge?.cacheDir ?? ".manni/tracevals/cache",
|
|
480
|
-
// `null`, not a number: unbounded is a state, and any number here would
|
|
481
|
-
// be a ceiling nobody asked for.
|
|
482
|
-
maxTurns: r.judge?.maxTurns ?? null,
|
|
483
|
-
// Always a list: the render site concatenates nothing onto it, but a
|
|
484
|
-
// hole here would be a special case in every consumer.
|
|
485
|
-
redact: [...r.judge?.redact ?? []]
|
|
486
|
-
},
|
|
487
|
-
render: {
|
|
488
|
-
maxBlockChars: r.render?.maxBlockChars ?? 2e3,
|
|
489
|
-
maxTotalChars: r.render?.maxTotalChars ?? 15e4
|
|
490
|
-
},
|
|
491
|
-
execution: { allow: [...r.execution?.allow ?? EXECUTION_GRANTS] },
|
|
492
|
-
history: {
|
|
493
|
-
file: r.history?.file ?? ".manni/tracevals/history.jsonl"
|
|
494
|
-
},
|
|
495
|
-
capture: {
|
|
496
|
-
// Beside the judge cache, under the state directory that already travels
|
|
497
|
-
// with the project — which is what puts a manifest next to its trace in
|
|
498
|
-
// the CI patterns the docs describe.
|
|
499
|
-
dir: r.capture?.dir ?? DEFAULT_CAPTURE_DIR
|
|
500
|
-
},
|
|
501
|
-
fill: {
|
|
502
|
-
// 0.7 matches the manuscript's calibration bar for judged agreement.
|
|
503
|
-
confidenceThreshold: r.fill?.confidenceThreshold ?? 0.7,
|
|
504
|
-
maxEvalsPerArtifact: r.fill?.maxEvalsPerArtifact ?? 8,
|
|
505
|
-
temperature: r.fill?.temperature ?? 0,
|
|
506
|
-
// Separate from the judge cache: different key scheme and value shape.
|
|
507
|
-
cacheDir: r.fill?.cacheDir ?? ".manni/tracevals/cache/fill",
|
|
508
|
-
maxTurns: r.fill?.maxTurns ?? null
|
|
509
|
-
},
|
|
510
|
-
calibrate: {
|
|
511
|
-
labels: r.calibrate?.labels ?? DEFAULT_LABELS_FILE,
|
|
512
|
-
sweep: {
|
|
513
|
-
// Spans the range rather than filling it: the first sweep judges the
|
|
514
|
-
// corpus at the largest value here, so a wide grid is the one part of
|
|
515
|
-
// calibration that does cost money.
|
|
516
|
-
ensembleRuns: [...r.calibrate?.sweep?.ensembleRuns ?? [1, 3, 5]],
|
|
517
|
-
autoPass: [
|
|
518
|
-
...r.calibrate?.sweep?.autoPass ?? [0.5, 0.6, 0.7, 0.8, 0.9, 0.95]
|
|
519
|
-
],
|
|
520
|
-
autoFail: [
|
|
521
|
-
...r.calibrate?.sweep?.autoFail ?? [0.5, 0.6, 0.7, 0.8, 0.9, 0.95]
|
|
522
|
-
]
|
|
523
|
-
}
|
|
524
|
-
},
|
|
525
|
-
failOnReview: r.failOnReview ?? true,
|
|
526
|
-
// Always a list, never undefined: the read site concatenates `--require`
|
|
527
|
-
// onto it, and a hole there would be a special case in every caller.
|
|
528
|
-
plugins: [...r.plugins ?? []],
|
|
529
|
-
// An observation, not a gate: listing it is opt-in because a real roster
|
|
530
|
-
// runs to hundreds of skills (ADR 01016).
|
|
531
|
-
reportUnusedArtifacts: r.reportUnusedArtifacts ?? false
|
|
532
|
-
};
|
|
533
|
-
compileRedactPatterns(config.judge.redact);
|
|
534
|
-
for (const key of ["maxFalsePass", "maxFalseFail", "maxReview"]) {
|
|
535
|
-
if (typeof r.calibrate?.[key] === "number") {
|
|
536
|
-
config.calibrate[key] = r.calibrate[key];
|
|
537
|
-
}
|
|
538
|
-
}
|
|
539
|
-
return config;
|
|
540
|
-
}
|
|
541
|
-
async function discoverConfig(dir = process.cwd(), lookup = {}) {
|
|
542
|
-
if (lookup.noConfig === true) {
|
|
543
|
-
return { config: parseConfig({}), dir, collections: [] };
|
|
544
|
-
}
|
|
545
|
-
const file = await Promise.resolve().then(
|
|
546
|
-
() => lookup.configPath === void 0 ? findConfigFileSync(dir, CONFIG_FILE) : readConfigFileSync(lookup.configPath, dir, CONFIG_FILE)
|
|
547
|
-
);
|
|
548
|
-
if (file === null) return { config: parseConfig({}), dir, collections: [] };
|
|
549
|
-
return {
|
|
550
|
-
config: parseConfig(file.value ?? {}, {
|
|
551
|
-
source: file.source,
|
|
552
|
-
...file.providers !== void 0 ? { providers: file.providers } : {}
|
|
553
|
-
}),
|
|
554
|
-
dir: file.dir,
|
|
555
|
-
collections: file.collections,
|
|
556
|
-
path: file.path
|
|
557
|
-
};
|
|
558
|
-
}
|
|
559
|
-
async function loadConfig(dir = process.cwd(), lookup = {}) {
|
|
560
|
-
return (await discoverConfig(dir, lookup)).config;
|
|
561
|
-
}
|
|
14
|
+
} from "./chunk-KCOFEWV5.js";
|
|
562
15
|
|
|
563
16
|
// src/tracevals/capture/manifest.ts
|
|
564
17
|
import { createHash } from "node:crypto";
|
|
565
|
-
import { mkdir, readFile
|
|
18
|
+
import { mkdir, readFile, writeFile } from "node:fs/promises";
|
|
566
19
|
import {
|
|
567
|
-
dirname
|
|
20
|
+
dirname,
|
|
568
21
|
extname,
|
|
569
22
|
isAbsolute,
|
|
570
23
|
join,
|
|
571
24
|
relative,
|
|
572
|
-
resolve
|
|
25
|
+
resolve,
|
|
573
26
|
sep
|
|
574
27
|
} from "node:path";
|
|
575
28
|
function sha256Hex(data) {
|
|
@@ -577,13 +30,13 @@ function sha256Hex(data) {
|
|
|
577
30
|
}
|
|
578
31
|
async function hashFile(path) {
|
|
579
32
|
try {
|
|
580
|
-
return sha256Hex(await
|
|
33
|
+
return sha256Hex(await readFile(path));
|
|
581
34
|
} catch {
|
|
582
35
|
return null;
|
|
583
36
|
}
|
|
584
37
|
}
|
|
585
38
|
function relPosix(root, path) {
|
|
586
|
-
const rel = relative(
|
|
39
|
+
const rel = relative(resolve(root), resolve(path));
|
|
587
40
|
if (rel === "" || rel.startsWith("..") || isAbsolute(rel)) return null;
|
|
588
41
|
return rel.split(sep).join("/");
|
|
589
42
|
}
|
|
@@ -600,7 +53,7 @@ function siblingManifestPath(tracePath) {
|
|
|
600
53
|
return `${stem}.manifest.json`;
|
|
601
54
|
}
|
|
602
55
|
async function writeManifest(path, manifest) {
|
|
603
|
-
await mkdir(
|
|
56
|
+
await mkdir(dirname(resolve(path)), { recursive: true });
|
|
604
57
|
await writeFile(path, `${JSON.stringify(manifest, null, 2)}
|
|
605
58
|
`, "utf-8");
|
|
606
59
|
}
|
|
@@ -614,7 +67,7 @@ function isManifestArtifact(value) {
|
|
|
614
67
|
async function readManifest(path) {
|
|
615
68
|
let raw;
|
|
616
69
|
try {
|
|
617
|
-
raw = await
|
|
70
|
+
raw = await readFile(path, "utf-8");
|
|
618
71
|
} catch {
|
|
619
72
|
return null;
|
|
620
73
|
}
|
|
@@ -648,11 +101,11 @@ async function findManifest(options) {
|
|
|
648
101
|
if (options.sessionId !== void 0) {
|
|
649
102
|
candidates.push(
|
|
650
103
|
manifestPathFor(
|
|
651
|
-
|
|
104
|
+
resolve(dirname(options.tracePath), options.captureDir),
|
|
652
105
|
options.sessionId
|
|
653
106
|
),
|
|
654
107
|
manifestPathFor(
|
|
655
|
-
|
|
108
|
+
resolve(options.projectDir, options.captureDir),
|
|
656
109
|
options.sessionId
|
|
657
110
|
)
|
|
658
111
|
);
|
|
@@ -993,8 +446,8 @@ function firstLine(description) {
|
|
|
993
446
|
}
|
|
994
447
|
|
|
995
448
|
// src/tracevals/artifacts/fs.ts
|
|
996
|
-
import { access, readdir, readFile as
|
|
997
|
-
import { dirname as
|
|
449
|
+
import { access, readdir, readFile as readFile2, stat } from "node:fs/promises";
|
|
450
|
+
import { dirname as dirname2, join as join2, resolve as resolve2, sep as sep2 } from "node:path";
|
|
998
451
|
function segments(path) {
|
|
999
452
|
return path.split(sep2).join("/").split("/");
|
|
1000
453
|
}
|
|
@@ -1010,14 +463,14 @@ var PRUNED_DIRS = /* @__PURE__ */ new Set([
|
|
|
1010
463
|
".venv"
|
|
1011
464
|
]);
|
|
1012
465
|
async function findGitRoot(start) {
|
|
1013
|
-
let current =
|
|
466
|
+
let current = resolve2(start);
|
|
1014
467
|
for (let depth = 0; depth < 64; depth += 1) {
|
|
1015
468
|
try {
|
|
1016
469
|
await access(join2(current, ".git"));
|
|
1017
470
|
return current;
|
|
1018
471
|
} catch {
|
|
1019
472
|
}
|
|
1020
|
-
const parent =
|
|
473
|
+
const parent = dirname2(current);
|
|
1021
474
|
if (parent === current) return null;
|
|
1022
475
|
current = parent;
|
|
1023
476
|
}
|
|
@@ -1025,7 +478,7 @@ async function findGitRoot(start) {
|
|
|
1025
478
|
}
|
|
1026
479
|
async function safeRead(path) {
|
|
1027
480
|
try {
|
|
1028
|
-
return await
|
|
481
|
+
return await readFile2(path, "utf-8");
|
|
1029
482
|
} catch {
|
|
1030
483
|
return null;
|
|
1031
484
|
}
|
|
@@ -1074,12 +527,12 @@ async function listInTree(root, match, options = {}) {
|
|
|
1074
527
|
}
|
|
1075
528
|
}
|
|
1076
529
|
}
|
|
1077
|
-
await walk(
|
|
530
|
+
await walk(resolve2(root), 0);
|
|
1078
531
|
return found.sort();
|
|
1079
532
|
}
|
|
1080
533
|
|
|
1081
534
|
// src/tracevals/artifacts/resolve.ts
|
|
1082
|
-
import { basename, dirname as
|
|
535
|
+
import { basename, dirname as dirname3, join as join3, resolve as resolve3 } from "node:path";
|
|
1083
536
|
var PROJECT_RULES_FILENAMES = [
|
|
1084
537
|
"CLAUDE.md",
|
|
1085
538
|
"AGENTS.md",
|
|
@@ -1094,9 +547,9 @@ var BUILTIN_AGENTS = /* @__PURE__ */ new Set([
|
|
|
1094
547
|
"fork"
|
|
1095
548
|
]);
|
|
1096
549
|
async function resolveArtifacts(trace, options = {}) {
|
|
1097
|
-
const projectDir =
|
|
550
|
+
const projectDir = resolve3(options.projectDir ?? trace.cwd);
|
|
1098
551
|
const userDir = configDir(options.env);
|
|
1099
|
-
const projectRoot =
|
|
552
|
+
const projectRoot = resolve3(
|
|
1100
553
|
options.projectRoot ?? await findGitRoot(projectDir) ?? projectDir
|
|
1101
554
|
);
|
|
1102
555
|
const artifacts = [];
|
|
@@ -1375,7 +828,7 @@ async function resolveSkill(name, projectDir, userDir) {
|
|
|
1375
828
|
tried.push(join3(pluginRoot, "**", "skills", shortName, "SKILL.md"));
|
|
1376
829
|
const found = await findInTree(
|
|
1377
830
|
pluginRoot,
|
|
1378
|
-
(path) => basename(path) === "SKILL.md" && basename(
|
|
831
|
+
(path) => basename(path) === "SKILL.md" && basename(dirname3(path)) === shortName && (pluginName === null || hasPathSegment(path, pluginName))
|
|
1379
832
|
);
|
|
1380
833
|
if (found) {
|
|
1381
834
|
const content = await safeRead(found);
|
|
@@ -1472,7 +925,7 @@ async function resolveProjectRules(projectDir, projectRoot) {
|
|
|
1472
925
|
for (let depth = 0; depth < 32; depth += 1) {
|
|
1473
926
|
dirs.push(current);
|
|
1474
927
|
if (current === projectRoot) break;
|
|
1475
|
-
const parent =
|
|
928
|
+
const parent = dirname3(current);
|
|
1476
929
|
if (parent === current) break;
|
|
1477
930
|
current = parent;
|
|
1478
931
|
}
|
|
@@ -1497,12 +950,12 @@ async function resolveProjectRules(projectDir, projectRoot) {
|
|
|
1497
950
|
}
|
|
1498
951
|
|
|
1499
952
|
// src/tracevals/evals/schema.ts
|
|
1500
|
-
import { Ajv2020
|
|
953
|
+
import { Ajv2020 } from "ajv/dist/2020.js";
|
|
1501
954
|
var artifactEvalsSchema = __default;
|
|
1502
955
|
var ARTIFACT_EVALS_SCHEMA_ID = __default.$id;
|
|
1503
|
-
var
|
|
1504
|
-
|
|
1505
|
-
var validateArtifact =
|
|
956
|
+
var ajv = new Ajv2020({ allErrors: true, allowUnionTypes: true });
|
|
957
|
+
ajv.addKeyword({ keyword: "x-manni-location" });
|
|
958
|
+
var validateArtifact = ajv.compile(artifactEvalsSchema);
|
|
1506
959
|
function subjectOf(e) {
|
|
1507
960
|
switch (e.keyword) {
|
|
1508
961
|
case "required":
|
|
@@ -1684,21 +1137,6 @@ function anchorList(raw) {
|
|
|
1684
1137
|
}
|
|
1685
1138
|
|
|
1686
1139
|
export {
|
|
1687
|
-
REDACTION_PATTERNS,
|
|
1688
|
-
CUSTOM_PLACEHOLDER,
|
|
1689
|
-
makeRedactor,
|
|
1690
|
-
compileRedactPatterns,
|
|
1691
|
-
MANIFEST_VERSION,
|
|
1692
|
-
DEFAULT_CAPTURE_DIR,
|
|
1693
|
-
DEFAULT_LABELS_FILE,
|
|
1694
|
-
labelKey,
|
|
1695
|
-
parseLabels,
|
|
1696
|
-
loadLabels,
|
|
1697
|
-
DEFAULT_CONFIG_FILENAME,
|
|
1698
|
-
CONFIG_SECTION_KEY,
|
|
1699
|
-
parseConfig,
|
|
1700
|
-
discoverConfig,
|
|
1701
|
-
loadConfig,
|
|
1702
1140
|
newAvailability,
|
|
1703
1141
|
availableAt,
|
|
1704
1142
|
offeredNames,
|
|
@@ -1730,4 +1168,4 @@ export {
|
|
|
1730
1168
|
ARTIFACT_EVALS_SCHEMA_ID,
|
|
1731
1169
|
extractEvals
|
|
1732
1170
|
};
|
|
1733
|
-
//# sourceMappingURL=chunk-
|
|
1171
|
+
//# sourceMappingURL=chunk-APKH2T6E.js.map
|