dsh-llm-verifier 0.3.0 → 0.4.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 +133 -9
- package/lib/auto-B5V49e-A.js +1517 -0
- package/lib/auto-B5V49e-A.js.map +1 -0
- package/lib/{caller-DJd_FlrQ.js → caller-DR_C7ueP.js} +154 -20
- package/lib/caller-DR_C7ueP.js.map +1 -0
- package/lib/caller.js +2 -2
- package/lib/client.js +804 -29
- package/lib/client.js.map +1 -1
- package/lib/core.js +226 -3
- package/lib/core.js.map +1 -1
- package/lib/index.js +1014 -1337
- package/lib/index.js.map +1 -1
- package/lib/replay.js +157 -0
- package/lib/replay.js.map +1 -0
- package/lib/types/auto.js +1 -1
- package/lib/types/auto.js.map +1 -1
- package/lib/types/caller.d.ts +65 -0
- package/lib/types/caller.d.ts.map +1 -1
- package/lib/types/caller.js +113 -5
- package/lib/types/caller.js.map +1 -1
- package/lib/types/client-i18n.d.ts +163 -6
- package/lib/types/client-i18n.d.ts.map +1 -1
- package/lib/types/client-i18n.js +137 -26
- package/lib/types/client-i18n.js.map +1 -1
- package/lib/types/client.d.ts +30 -0
- package/lib/types/client.d.ts.map +1 -1
- package/lib/types/client.js +94 -9
- package/lib/types/client.js.map +1 -1
- package/lib/types/config.d.ts +33 -0
- package/lib/types/config.d.ts.map +1 -1
- package/lib/types/config.js +17 -2
- package/lib/types/config.js.map +1 -1
- package/lib/types/core.d.ts +84 -0
- package/lib/types/core.d.ts.map +1 -1
- package/lib/types/core.js +222 -2
- package/lib/types/core.js.map +1 -1
- package/lib/types/criteria.d.ts +33 -0
- package/lib/types/criteria.d.ts.map +1 -0
- package/lib/types/criteria.js +67 -0
- package/lib/types/criteria.js.map +1 -0
- package/lib/types/decisions.d.ts +84 -0
- package/lib/types/decisions.d.ts.map +1 -0
- package/lib/types/decisions.js +209 -0
- package/lib/types/decisions.js.map +1 -0
- package/lib/types/engine.d.ts +54 -1
- package/lib/types/engine.d.ts.map +1 -1
- package/lib/types/engine.js +175 -12
- package/lib/types/engine.js.map +1 -1
- package/lib/types/index.d.ts +1 -0
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/index.js +392 -38
- package/lib/types/index.js.map +1 -1
- package/lib/types/replay.d.ts +88 -0
- package/lib/types/replay.d.ts.map +1 -0
- package/lib/types/replay.js +136 -0
- package/lib/types/replay.js.map +1 -0
- package/lib/types/router.d.ts +29 -5
- package/lib/types/router.d.ts.map +1 -1
- package/lib/types/router.js +283 -46
- package/lib/types/router.js.map +1 -1
- package/lib/types/statistics.d.ts +10 -1
- package/lib/types/statistics.d.ts.map +1 -1
- package/lib/types/statistics.js +35 -7
- package/lib/types/statistics.js.map +1 -1
- package/lib/types/top-logprobs.d.ts +36 -0
- package/lib/types/top-logprobs.d.ts.map +1 -1
- package/lib/types/top-logprobs.js +41 -14
- package/lib/types/top-logprobs.js.map +1 -1
- package/package.json +6 -1
- package/scripts/eval-replay.mjs +118 -0
- package/src/auto.ts +1 -1
- package/src/caller.test.ts +62 -1
- package/src/caller.ts +124 -4
- package/src/client-i18n.ts +137 -25
- package/src/client.test.ts +21 -0
- package/src/client.tsx +145 -7
- package/src/config.test.ts +32 -0
- package/src/config.ts +49 -2
- package/src/core.test.ts +95 -0
- package/src/core.ts +217 -2
- package/src/criteria.test.ts +60 -0
- package/src/criteria.ts +76 -0
- package/src/decisions.test.ts +150 -0
- package/src/decisions.ts +244 -0
- package/src/engine.test.ts +131 -0
- package/src/engine.ts +167 -10
- package/src/index.test.ts +278 -8
- package/src/index.ts +373 -37
- package/src/replay.test.ts +82 -0
- package/src/replay.ts +155 -0
- package/src/router.test.ts +240 -1
- package/src/router.ts +298 -48
- package/src/statistics.test.ts +49 -1
- package/src/statistics.ts +44 -7
- package/src/top-logprobs.test.ts +28 -0
- package/src/top-logprobs.ts +56 -8
- package/lib/caller-DJd_FlrQ.js.map +0 -1
package/lib/types/core.d.ts
CHANGED
|
@@ -21,7 +21,34 @@ export declare const GRANULARITY = 20;
|
|
|
21
21
|
export declare const LETTERS: string[];
|
|
22
22
|
export declare const SCALE_DESCRIPTION: string;
|
|
23
23
|
export declare const DEFAULT_CRITERIA: Criterion[];
|
|
24
|
+
/** Task classes a rubric can be chosen for; `custom` lives at the config layer, not here. */
|
|
25
|
+
export declare const CRITERIA_PRESET_IDS: readonly ["coding", "debug", "research", "ops", "writing"];
|
|
26
|
+
export type CriteriaPresetId = typeof CRITERIA_PRESET_IDS[number];
|
|
27
|
+
/**
|
|
28
|
+
* Rubric per task class.
|
|
29
|
+
*
|
|
30
|
+
* Upstream ships one criteria file per benchmark (`criteria/swe_bench.md`, `terminal_bench.md`,
|
|
31
|
+
* `medagentbench.md`) and its TEMPLATE states the rule this table follows: 2-4 narrow criteria
|
|
32
|
+
* beat one broad one. Judging a research answer with "Output Match"/"Error Signal Detection"
|
|
33
|
+
* measures the wrong thing, and the automatic gate has no per-task override.
|
|
34
|
+
*
|
|
35
|
+
* `coding` is byte-identical to {@link DEFAULT_CRITERIA}: the default preset must not change
|
|
36
|
+
* any existing verdict, prompt or cache key.
|
|
37
|
+
*/
|
|
38
|
+
export declare const CRITERIA_PRESETS: Record<CriteriaPresetId, Criterion[]>;
|
|
39
|
+
/** Derive a criterion id from free text: lowercase, alphanumerics and underscores, max 40 chars. */
|
|
40
|
+
export declare function slugCriterionId(text: string): string;
|
|
41
|
+
/** Make an id unique against the ids already used, by appending _2, _3, ... */
|
|
42
|
+
export declare function dedupeCriterionId(id: string, seen: Set<string>): string;
|
|
24
43
|
export declare const DEFAULT_GROUND_TRUTH_NOTE = "**IMPORTANT:** Focus on observed tool and terminal output as ground truth. Do NOT trust the agent's self-assessment or claims of success.";
|
|
44
|
+
/**
|
|
45
|
+
* The fixed baseline a session acceptance measures itself against.
|
|
46
|
+
*
|
|
47
|
+
* One definition, read by the automatic final gate and by `verifier_best_of_n`. The tool
|
|
48
|
+
* advertises an "absolute" score with the gate's own threshold, so if these two ever drifted
|
|
49
|
+
* apart the tool would be measuring against a different reference than the gate it predicts.
|
|
50
|
+
*/
|
|
51
|
+
export declare const EMPTY_WORK_BASELINE = "(No useful work or verification was performed.)";
|
|
25
52
|
/**
|
|
26
53
|
* Deterministic per-prompt delimiter token.
|
|
27
54
|
*
|
|
@@ -49,8 +76,42 @@ export declare function renderDelimitedBlock(tag: string, token: string, content
|
|
|
49
76
|
export declare const UNTRUSTED_EVIDENCE_NOTE: string;
|
|
50
77
|
export declare function normalizeScoreLetter(token: string): string | undefined;
|
|
51
78
|
export declare function extractScore(completion: CompletionLogprobs, tag: string): number;
|
|
79
|
+
/**
|
|
80
|
+
* One pairwise prompt focused on a single criterion.
|
|
81
|
+
*
|
|
82
|
+
* Everything that does not depend on the criterion (task, both trajectories, the rating
|
|
83
|
+
* scale) comes first and ONLY the criterion varies at the tail. That is not cosmetic:
|
|
84
|
+
* it maximizes the shared prompt prefix across the criteria of one comparison, so a
|
|
85
|
+
* prefix-caching backend serves the trace-heavy body from cache. Upstream documents the
|
|
86
|
+
* same constraint on its `build_prompt` ("Keep criterion-specific text strictly at the
|
|
87
|
+
* end when editing"), and `VerifierEngine.compare` warms the prefix with one job before
|
|
88
|
+
* fanning out the rest. Keep it that way.
|
|
89
|
+
* @param problem - task statement shown to the judge.
|
|
90
|
+
* @param traceA - candidate A's trajectory.
|
|
91
|
+
* @param traceB - candidate B's trajectory.
|
|
92
|
+
* @param criterion - the single criterion this call scores.
|
|
93
|
+
* @param groundTruthNote - note prepended to every judge prompt.
|
|
94
|
+
* @returns The rendered prompt.
|
|
95
|
+
*/
|
|
52
96
|
export declare function buildPairwisePrompt(problem: string, traceA: string, traceB: string, criterion: Criterion, groundTruthNote?: string): string;
|
|
53
97
|
export declare function buildProgressPrompt(problem: string, steps: readonly string[], checkpoints: readonly number[]): string;
|
|
98
|
+
/**
|
|
99
|
+
* One best-of-N drafting prompt.
|
|
100
|
+
*
|
|
101
|
+
* Deliberately NOT the judge contract: here the request IS the instruction to follow and the
|
|
102
|
+
* answer is free-form work product, so there is no data-only delimiter and no A–T verdict tag.
|
|
103
|
+
* The untrusted-content boundary is re-established downstream instead — every draft is embedded
|
|
104
|
+
* as delimited, nonce-terminated evidence when the judges score it.
|
|
105
|
+
*
|
|
106
|
+
* Only the final line varies between the N drafts, so the shared prompt prefix (which carries
|
|
107
|
+
* the whole request) is maximal. Same tail-only convention as `buildPairwisePrompt`'s
|
|
108
|
+
* criterion, and for the same prefix-caching reason.
|
|
109
|
+
* @param task - the request the drafts must answer.
|
|
110
|
+
* @param index - 0-based draft index.
|
|
111
|
+
* @param total - how many drafts are being generated.
|
|
112
|
+
* @returns The rendered prompt.
|
|
113
|
+
*/
|
|
114
|
+
export declare function buildGenerationPrompt(task: string, index: number, total: number): string;
|
|
54
115
|
/** Progress uses A=NO..T=YES, the reverse of pairwise success scoring. */
|
|
55
116
|
export declare function extractProgressScore(completion: CompletionLogprobs, tag: string): number;
|
|
56
117
|
export declare function bradleyTerry(rewardA: number, rewardB: number): number;
|
|
@@ -60,4 +121,27 @@ export declare function pivotRoundPairs(count: number, pivots: readonly number[]
|
|
|
60
121
|
export declare function accumulatePairs(pairs: readonly [number, number][], rewards: ReadonlyMap<string, readonly [number, number]>, wins: number[], counts: number[]): void;
|
|
61
122
|
export declare function topPivots(wins: readonly number[], counts: readonly number[], requested: number): number[];
|
|
62
123
|
export declare function rankScores(wins: readonly number[], counts: readonly number[]): CandidateScore[];
|
|
124
|
+
/**
|
|
125
|
+
* Parse a criteria file (or an inline markdown string) into a ground-truth note and criteria.
|
|
126
|
+
*
|
|
127
|
+
* Upstream's criteria files are the reason this exists: a rubric you can edit, review and
|
|
128
|
+
* version beats a hard-coded list, and its TEMPLATE pins the layout. Format:
|
|
129
|
+
*
|
|
130
|
+
* # <title> (ignored)
|
|
131
|
+
* ## Ground Truth Note (optional)
|
|
132
|
+
* <one paragraph the verifier always sees>
|
|
133
|
+
* ## Criteria
|
|
134
|
+
* ### <Criterion Name> {#id} (the anchor is optional; the id is slugged from the name)
|
|
135
|
+
* <instruction for this criterion>
|
|
136
|
+
*
|
|
137
|
+
* HTML comments are stripped, so a file can carry author notes the judge never sees. The
|
|
138
|
+
* parser fails closed: no criteria, a heading without a body, or a blank instruction throws
|
|
139
|
+
* rather than silently scoring with fewer criteria than authored.
|
|
140
|
+
* @param text - criteria markdown.
|
|
141
|
+
* @returns The optional ground-truth note and the parsed criteria, in file order.
|
|
142
|
+
*/
|
|
143
|
+
export declare function parseCriteriaMarkdown(text: string): {
|
|
144
|
+
groundTruthNote: string;
|
|
145
|
+
criteria: Criterion[];
|
|
146
|
+
};
|
|
63
147
|
//# sourceMappingURL=core.d.ts.map
|
package/lib/types/core.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../src/core.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAElE,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;CACpB;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,EAAE,CAAA;IAChB,SAAS,EAAE,gBAAgB,EAAE,EAAE,CAAA;CAChC;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;CACd;AAED,eAAO,MAAM,WAAW,KAAK,CAAA;AAC7B,eAAO,MAAM,OAAO,UAAqF,CAAA;AACzG,eAAO,MAAM,iBAAiB,QAUlB,CAAA;AAEZ,eAAO,MAAM,gBAAgB,EAAE,SAAS,EAgBvC,CAAA;AAED,eAAO,MAAM,yBAAyB,8IAA8I,CAAA;AAEpL;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAA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,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,CAIzG;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,MAAM,EAAE,SAAS,MAAM,EAAE,GAAG,cAAc,EAAE,CAG/F;AAMD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG;IAAE,eAAe,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,SAAS,EAAE,CAAA;CAAE,CAoCtG"}
|
package/lib/types/core.js
CHANGED
|
@@ -29,7 +29,115 @@ export const DEFAULT_CRITERIA = [
|
|
|
29
29
|
description: 'Scan especially later steps for unresolved errors, tracebacks, non-zero exits, command-not-found, missing files, compilation failures, and test failures. Score only unresolved error evidence.',
|
|
30
30
|
},
|
|
31
31
|
];
|
|
32
|
+
/** Task classes a rubric can be chosen for; `custom` lives at the config layer, not here. */
|
|
33
|
+
export const CRITERIA_PRESET_IDS = ['coding', 'debug', 'research', 'ops', 'writing'];
|
|
34
|
+
/**
|
|
35
|
+
* Rubric per task class.
|
|
36
|
+
*
|
|
37
|
+
* Upstream ships one criteria file per benchmark (`criteria/swe_bench.md`, `terminal_bench.md`,
|
|
38
|
+
* `medagentbench.md`) and its TEMPLATE states the rule this table follows: 2-4 narrow criteria
|
|
39
|
+
* beat one broad one. Judging a research answer with "Output Match"/"Error Signal Detection"
|
|
40
|
+
* measures the wrong thing, and the automatic gate has no per-task override.
|
|
41
|
+
*
|
|
42
|
+
* `coding` is byte-identical to {@link DEFAULT_CRITERIA}: the default preset must not change
|
|
43
|
+
* any existing verdict, prompt or cache key.
|
|
44
|
+
*/
|
|
45
|
+
export const CRITERIA_PRESETS = {
|
|
46
|
+
coding: DEFAULT_CRITERIA,
|
|
47
|
+
debug: [
|
|
48
|
+
{
|
|
49
|
+
id: 'reproduction',
|
|
50
|
+
name: 'Failure Reproduction',
|
|
51
|
+
description: 'Did the agent reproduce the reported failure BEFORE changing code? Look for a command or test whose observed output shows the failure happening. Penalize edits made without any reproduction, and treat "the user said it is broken" as no evidence.',
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
id: 'root_cause',
|
|
55
|
+
name: 'Root Cause',
|
|
56
|
+
description: 'Compare the stated cause with the evidence: does the diagnosis point at code that the observed output actually implicates, rather than at the last error message? Penalize symptom patches and guesses presented as findings.',
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
id: 'fix_verification',
|
|
60
|
+
name: 'Fix Verification',
|
|
61
|
+
description: 'Find the command that exercised the fix AFTER the last code change. Reward only observed output showing the previously failing case now passing with no new failures. Penalize "should be fixed" assertions and fixes verified before the final edit.',
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
|
+
research: [
|
|
65
|
+
{
|
|
66
|
+
id: 'question_addressed',
|
|
67
|
+
name: 'Question Addressed',
|
|
68
|
+
description: 'Does the answer address exactly what was asked, including every part of a multi-part question? Penalize thorough answers to a nearby but different question, and unanswered sub-questions.',
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
id: 'source_grounding',
|
|
72
|
+
name: 'Source Grounding',
|
|
73
|
+
description: 'Is every material claim traceable to evidence the answer names (file, URL, command output)? Reward claims tied to a specific source; penalize confident claims with no traceable basis and citations that do not actually support the claim.',
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
id: 'limits_stated',
|
|
77
|
+
name: 'Limits Stated',
|
|
78
|
+
description: 'Does the answer separate what was verified from what is inferred, and state assumptions, uncertainty and missing data? Penalize unqualified certainty that goes beyond the observed evidence.',
|
|
79
|
+
},
|
|
80
|
+
],
|
|
81
|
+
ops: [
|
|
82
|
+
{
|
|
83
|
+
id: 'change_specification',
|
|
84
|
+
name: 'Change Specification',
|
|
85
|
+
description: 'Compare the executed commands with the requested operation: target, environment, arguments and scope. Penalize actions against the wrong target, and side effects beyond the requested scope.',
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
id: 'observed_result',
|
|
89
|
+
name: 'Observed Result',
|
|
90
|
+
description: 'Reward commands whose observed output shows the intended state (service up, file present, config applied). Penalize inferring success from an exit code without inspecting the resulting state.',
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
id: 'reversibility',
|
|
94
|
+
name: 'Reversibility',
|
|
95
|
+
description: 'Does the work leave a way back: a backup, a recorded previous value, a dry run first, or a stated rollback path? Penalize irreversible changes made without one.',
|
|
96
|
+
},
|
|
97
|
+
],
|
|
98
|
+
writing: [
|
|
99
|
+
{
|
|
100
|
+
id: 'brief_adherence',
|
|
101
|
+
name: 'Brief Adherence',
|
|
102
|
+
description: 'Check the requested deliverable: format, length, audience and every explicit constraint. Penalize a well-written piece that answers a different brief.',
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
id: 'structure_clarity',
|
|
106
|
+
name: 'Structure And Clarity',
|
|
107
|
+
description: 'Judge whether the structure carries the argument: ordering, sections, and a point the reader can follow. Penalize padding, repetition and unsupported assertions used as filler.',
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
id: 'factual_grounding',
|
|
111
|
+
name: 'Factual Grounding',
|
|
112
|
+
description: 'Are factual statements supported by the material the task supplied, or invented? Penalize fabricated specifics such as names, numbers, dates and quotes that do not appear in the evidence.',
|
|
113
|
+
},
|
|
114
|
+
],
|
|
115
|
+
};
|
|
116
|
+
/** Derive a criterion id from free text: lowercase, alphanumerics and underscores, max 40 chars. */
|
|
117
|
+
export function slugCriterionId(text) {
|
|
118
|
+
const slug = text.toLowerCase().replace(/[^a-z0-9]+/gu, '_').replace(/^_+|_+$/gu, '');
|
|
119
|
+
return slug.slice(0, 40).replace(/_+$/gu, '') || 'criterion';
|
|
120
|
+
}
|
|
121
|
+
/** Make an id unique against the ids already used, by appending _2, _3, ... */
|
|
122
|
+
export function dedupeCriterionId(id, seen) {
|
|
123
|
+
let candidate = id;
|
|
124
|
+
let suffix = 1;
|
|
125
|
+
while (seen.has(candidate)) {
|
|
126
|
+
suffix += 1;
|
|
127
|
+
candidate = id + '_' + suffix;
|
|
128
|
+
}
|
|
129
|
+
seen.add(candidate);
|
|
130
|
+
return candidate;
|
|
131
|
+
}
|
|
32
132
|
export const DEFAULT_GROUND_TRUTH_NOTE = "**IMPORTANT:** Focus on observed tool and terminal output as ground truth. Do NOT trust the agent's self-assessment or claims of success.";
|
|
133
|
+
/**
|
|
134
|
+
* The fixed baseline a session acceptance measures itself against.
|
|
135
|
+
*
|
|
136
|
+
* One definition, read by the automatic final gate and by `verifier_best_of_n`. The tool
|
|
137
|
+
* advertises an "absolute" score with the gate's own threshold, so if these two ever drifted
|
|
138
|
+
* apart the tool would be measuring against a different reference than the gate it predicts.
|
|
139
|
+
*/
|
|
140
|
+
export const EMPTY_WORK_BASELINE = '(No useful work or verification was performed.)';
|
|
33
141
|
/**
|
|
34
142
|
* Deterministic per-prompt delimiter token.
|
|
35
143
|
*
|
|
@@ -141,6 +249,23 @@ export function extractScore(completion, tag) {
|
|
|
141
249
|
throw new Error('llm-verifier: verifier response did not contain a valid ' + tag + ' A-T score');
|
|
142
250
|
return (letterValue(letter) - 1) / (GRANULARITY - 1);
|
|
143
251
|
}
|
|
252
|
+
/**
|
|
253
|
+
* One pairwise prompt focused on a single criterion.
|
|
254
|
+
*
|
|
255
|
+
* Everything that does not depend on the criterion (task, both trajectories, the rating
|
|
256
|
+
* scale) comes first and ONLY the criterion varies at the tail. That is not cosmetic:
|
|
257
|
+
* it maximizes the shared prompt prefix across the criteria of one comparison, so a
|
|
258
|
+
* prefix-caching backend serves the trace-heavy body from cache. Upstream documents the
|
|
259
|
+
* same constraint on its `build_prompt` ("Keep criterion-specific text strictly at the
|
|
260
|
+
* end when editing"), and `VerifierEngine.compare` warms the prefix with one job before
|
|
261
|
+
* fanning out the rest. Keep it that way.
|
|
262
|
+
* @param problem - task statement shown to the judge.
|
|
263
|
+
* @param traceA - candidate A's trajectory.
|
|
264
|
+
* @param traceB - candidate B's trajectory.
|
|
265
|
+
* @param criterion - the single criterion this call scores.
|
|
266
|
+
* @param groundTruthNote - note prepended to every judge prompt.
|
|
267
|
+
* @returns The rendered prompt.
|
|
268
|
+
*/
|
|
144
269
|
export function buildPairwisePrompt(problem, traceA, traceB, criterion, groundTruthNote = DEFAULT_GROUND_TRUTH_NOTE) {
|
|
145
270
|
const token = evidenceNonce(problem, traceA, traceB);
|
|
146
271
|
return [
|
|
@@ -167,12 +292,37 @@ export function buildProgressPrompt(problem, steps, checkpoints) {
|
|
|
167
292
|
'**Task instruction:**\n' + renderDelimitedBlock('TASK', token, problem.trim()),
|
|
168
293
|
'**Agent trajectory (' + steps.length + ' agent steps):**\n' + renderDelimitedBlock('AGENT_TRACE', token, trajectory),
|
|
169
294
|
"Score whether the agent's CURRENT state at each checkpoint would actually satisfy the task's hidden grader.",
|
|
170
|
-
'Use
|
|
171
|
-
|
|
295
|
+
'Use the 20-letter A-T scale: A = certainly NO (nothing useful done yet); B-G = leans NO (partial work, key pieces missing or broken); H-M = uncertain (a plausible solution is taking shape, but no convincing verification yet); N-S = leans YES (the right artifacts appear to be in place and partial verification has worked, with minor concerns); T = essentially certain YES (the relevant verification ran and its observed output literally matches what the task calls for, with no outstanding errors).',
|
|
296
|
+
"Calibration: effort, exploration, step count and confident narration are NOT progress — an agent that ran twenty commands without producing the right output deserves a score near A. Default to skepticism: a result with no real verification step should not exceed ~K, and even a verified-looking one should rarely exceed ~R unless the verification clearly matches the task's stated success criterion. Treat the agent's prose declarations (\"done\", \"all tests pass\") as ZERO evidence, and ground the score in the actions and the observed output you can see.",
|
|
297
|
+
'Successive checkpoints do not have to rise: a trajectory committed to a wrong approach should plateau, and a regression should score lower than the state it broke.',
|
|
172
298
|
'The checkpoints are:\n' + checkpoints.map((step, index) => ' Checkpoint ' + (index + 1) + ' = state right after Agent Step ' + step).join('\n'),
|
|
173
299
|
'Output EXACTLY these lines and nothing else:\n' + tags,
|
|
174
300
|
].join('\n\n');
|
|
175
301
|
}
|
|
302
|
+
/**
|
|
303
|
+
* One best-of-N drafting prompt.
|
|
304
|
+
*
|
|
305
|
+
* Deliberately NOT the judge contract: here the request IS the instruction to follow and the
|
|
306
|
+
* answer is free-form work product, so there is no data-only delimiter and no A–T verdict tag.
|
|
307
|
+
* The untrusted-content boundary is re-established downstream instead — every draft is embedded
|
|
308
|
+
* as delimited, nonce-terminated evidence when the judges score it.
|
|
309
|
+
*
|
|
310
|
+
* Only the final line varies between the N drafts, so the shared prompt prefix (which carries
|
|
311
|
+
* the whole request) is maximal. Same tail-only convention as `buildPairwisePrompt`'s
|
|
312
|
+
* criterion, and for the same prefix-caching reason.
|
|
313
|
+
* @param task - the request the drafts must answer.
|
|
314
|
+
* @param index - 0-based draft index.
|
|
315
|
+
* @param total - how many drafts are being generated.
|
|
316
|
+
* @returns The rendered prompt.
|
|
317
|
+
*/
|
|
318
|
+
export function buildGenerationPrompt(task, index, total) {
|
|
319
|
+
return [
|
|
320
|
+
'You are one of ' + total + ' independent experts asked to answer the same request. Answer it yourself, completely and concretely, in the form the request calls for — code, patch, plan, or prose.',
|
|
321
|
+
'Do not ask clarifying questions, do not defer the work to a later step, and do not refer to the other attempts. Where the answer depends on a command, a test, or other evidence, state exactly what it is and what output would prove it; never claim a verification you cannot describe.',
|
|
322
|
+
'**Request:**\n' + task.trim(),
|
|
323
|
+
'Draft ' + (index + 1) + ' of ' + total + '.',
|
|
324
|
+
].join('\n\n');
|
|
325
|
+
}
|
|
176
326
|
/** Progress uses A=NO..T=YES, the reverse of pairwise success scoring. */
|
|
177
327
|
export function extractProgressScore(completion, tag) {
|
|
178
328
|
return 1 - extractScore(completion, tag);
|
|
@@ -235,4 +385,74 @@ export function rankScores(wins, counts) {
|
|
|
235
385
|
return Array.from({ length: wins.length }, (_, index) => ({ index, score: (wins[index] ?? 0) / (counts[index] || 1) }))
|
|
236
386
|
.sort((a, b) => b.score - a.score || a.index - b.index);
|
|
237
387
|
}
|
|
388
|
+
/** Optional trailing `{#id}` anchor on a criterion heading, e.g. `### Root Cause {#cause}`. */
|
|
389
|
+
const CRITERION_ID_ANCHOR = /^(.*?)\s*\{#([A-Za-z0-9_-]+)\}\s*$/;
|
|
390
|
+
const HTML_COMMENT = /<!--[\s\S]*?-->/gu;
|
|
391
|
+
/**
|
|
392
|
+
* Parse a criteria file (or an inline markdown string) into a ground-truth note and criteria.
|
|
393
|
+
*
|
|
394
|
+
* Upstream's criteria files are the reason this exists: a rubric you can edit, review and
|
|
395
|
+
* version beats a hard-coded list, and its TEMPLATE pins the layout. Format:
|
|
396
|
+
*
|
|
397
|
+
* # <title> (ignored)
|
|
398
|
+
* ## Ground Truth Note (optional)
|
|
399
|
+
* <one paragraph the verifier always sees>
|
|
400
|
+
* ## Criteria
|
|
401
|
+
* ### <Criterion Name> {#id} (the anchor is optional; the id is slugged from the name)
|
|
402
|
+
* <instruction for this criterion>
|
|
403
|
+
*
|
|
404
|
+
* HTML comments are stripped, so a file can carry author notes the judge never sees. The
|
|
405
|
+
* parser fails closed: no criteria, a heading without a body, or a blank instruction throws
|
|
406
|
+
* rather than silently scoring with fewer criteria than authored.
|
|
407
|
+
* @param text - criteria markdown.
|
|
408
|
+
* @returns The optional ground-truth note and the parsed criteria, in file order.
|
|
409
|
+
*/
|
|
410
|
+
export function parseCriteriaMarkdown(text) {
|
|
411
|
+
const lines = text.replace(HTML_COMMENT, '').split(/\r?\n/u);
|
|
412
|
+
const criteria = [];
|
|
413
|
+
const seen = new Set();
|
|
414
|
+
let groundTruthNote = '';
|
|
415
|
+
let section;
|
|
416
|
+
let current;
|
|
417
|
+
let buffer = [];
|
|
418
|
+
const flush = () => {
|
|
419
|
+
const body = buffer.join('\n').trim();
|
|
420
|
+
if (section === 'ground_truth') {
|
|
421
|
+
if (!groundTruthNote)
|
|
422
|
+
groundTruthNote = body;
|
|
423
|
+
}
|
|
424
|
+
else if (current !== undefined) {
|
|
425
|
+
criteria.push({ id: current.id, name: current.name, description: body });
|
|
426
|
+
current = undefined;
|
|
427
|
+
}
|
|
428
|
+
buffer = [];
|
|
429
|
+
};
|
|
430
|
+
for (const line of lines) {
|
|
431
|
+
if (line.startsWith('## ') && !line.startsWith('### ')) {
|
|
432
|
+
flush();
|
|
433
|
+
const heading = line.slice(3).trim().toLowerCase();
|
|
434
|
+
section = heading.includes('ground truth') ? 'ground_truth' : heading.includes('criteri') ? 'criteria' : undefined;
|
|
435
|
+
}
|
|
436
|
+
else if (line.startsWith('### ') && section === 'criteria') {
|
|
437
|
+
flush();
|
|
438
|
+
const heading = line.slice(4).trim();
|
|
439
|
+
const anchored = CRITERION_ID_ANCHOR.exec(heading);
|
|
440
|
+
const name = (anchored?.[1] ?? heading).trim();
|
|
441
|
+
current = { name, id: dedupeCriterionId(slugCriterionId(anchored?.[2] ?? name), seen) };
|
|
442
|
+
}
|
|
443
|
+
else if (line.startsWith('# ')) {
|
|
444
|
+
continue;
|
|
445
|
+
}
|
|
446
|
+
else {
|
|
447
|
+
buffer.push(line);
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
flush();
|
|
451
|
+
if (criteria.length === 0)
|
|
452
|
+
throw new Error('llm-verifier: criteria file has no criteria — add a "## Criteria" section with one "### Criterion Name" heading per criterion');
|
|
453
|
+
const empty = criteria.filter(criterion => criterion.description.length === 0).map(criterion => criterion.id);
|
|
454
|
+
if (empty.length > 0)
|
|
455
|
+
throw new Error('llm-verifier: criteria file has criteria with no instruction: ' + empty.join(', '));
|
|
456
|
+
return { groundTruthNote, criteria };
|
|
457
|
+
}
|
|
238
458
|
//# sourceMappingURL=core.js.map
|
package/lib/types/core.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.js","sourceRoot":"","sources":["../../src/core.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAwBlE,MAAM,CAAC,MAAM,WAAW,GAAG,EAAE,CAAA;AAC7B,MAAM,CAAC,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,CAAC,CAAC,EAAE,KAA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W,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC,CAAA;IAC7G,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,gEAAgE,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;IAC1H,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,CAAA;AACtC,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type Criterion, type CriteriaPresetId } from './core.ts';
|
|
2
|
+
/** Everything the settings page can select: a bundled task-class preset, or a markdown file. */
|
|
3
|
+
export type CriteriaSelection = CriteriaPresetId | 'custom';
|
|
4
|
+
export interface ResolvedCriteria {
|
|
5
|
+
criteria: Criterion[];
|
|
6
|
+
/** Note prepended to every judge prompt, when the rubric carries one. */
|
|
7
|
+
groundTruthNote?: string;
|
|
8
|
+
/** The preset id, `custom`, or `fallback` when a custom file could not be used. */
|
|
9
|
+
source: string;
|
|
10
|
+
file?: string;
|
|
11
|
+
/** Why the custom file was rejected; the `coding` rubric is used instead of failing the gate. */
|
|
12
|
+
error?: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Resolve the configured rubric to the criteria the engine scores with.
|
|
16
|
+
*
|
|
17
|
+
* A custom markdown file is read on every resolve (a rubric file is a few kilobytes and it is
|
|
18
|
+
* resolved once per turn boundary), so editing it takes effect immediately. The parse is cached
|
|
19
|
+
* against the file text, so repeated resolves of an unchanged file cost one read.
|
|
20
|
+
*
|
|
21
|
+
* A broken custom file does NOT fail verification: a rubric typo must not disable the acceptance
|
|
22
|
+
* gate, so the coding preset is used and the reason travels in {@link ResolvedCriteria.error}
|
|
23
|
+
* for the settings page and the log. This mirrors the plugin's rule that scoring-channel
|
|
24
|
+
* capability problems degrade instead of aborting a verification.
|
|
25
|
+
*/
|
|
26
|
+
export declare class CriteriaResolver {
|
|
27
|
+
private readonly load;
|
|
28
|
+
private cache;
|
|
29
|
+
constructor(load?: (path: string) => Promise<string>);
|
|
30
|
+
resolve(selection: CriteriaSelection, file: string | undefined): Promise<ResolvedCriteria>;
|
|
31
|
+
private remember;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=criteria.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"criteria.d.ts","sourceRoot":"","sources":["../../src/criteria.ts"],"names":[],"mappings":"AACA,OAAO,EAA6D,KAAK,SAAS,EAAE,KAAK,gBAAgB,EAAE,MAAM,WAAW,CAAA;AAE5H,gGAAgG;AAChG,MAAM,MAAM,iBAAiB,GAAG,gBAAgB,GAAG,QAAQ,CAAA;AAE3D,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,SAAS,EAAE,CAAA;IACrB,yEAAyE;IACzE,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,mFAAmF;IACnF,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,iGAAiG;IACjG,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED;;;;;;;;;;;GAWG;AACH,qBAAa,gBAAgB;IAEf,OAAO,CAAC,QAAQ,CAAC,IAAI;IADjC,OAAO,CAAC,KAAK,CAAsD;gBACtC,IAAI,GAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAkC;IAE/F,OAAO,CAAC,SAAS,EAAE,iBAAiB,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAsChG,OAAO,CAAC,QAAQ;CAIjB"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { readFile } from 'node:fs/promises';
|
|
2
|
+
import { CRITERIA_PRESETS, DEFAULT_CRITERIA, parseCriteriaMarkdown } from "./core.js";
|
|
3
|
+
/**
|
|
4
|
+
* Resolve the configured rubric to the criteria the engine scores with.
|
|
5
|
+
*
|
|
6
|
+
* A custom markdown file is read on every resolve (a rubric file is a few kilobytes and it is
|
|
7
|
+
* resolved once per turn boundary), so editing it takes effect immediately. The parse is cached
|
|
8
|
+
* against the file text, so repeated resolves of an unchanged file cost one read.
|
|
9
|
+
*
|
|
10
|
+
* A broken custom file does NOT fail verification: a rubric typo must not disable the acceptance
|
|
11
|
+
* gate, so the coding preset is used and the reason travels in {@link ResolvedCriteria.error}
|
|
12
|
+
* for the settings page and the log. This mirrors the plugin's rule that scoring-channel
|
|
13
|
+
* capability problems degrade instead of aborting a verification.
|
|
14
|
+
*/
|
|
15
|
+
export class CriteriaResolver {
|
|
16
|
+
load;
|
|
17
|
+
cache;
|
|
18
|
+
constructor(load = path => readFile(path, 'utf8')) {
|
|
19
|
+
this.load = load;
|
|
20
|
+
}
|
|
21
|
+
async resolve(selection, file) {
|
|
22
|
+
if (selection !== 'custom') {
|
|
23
|
+
const preset = CRITERIA_PRESETS[selection];
|
|
24
|
+
return { criteria: preset ?? DEFAULT_CRITERIA, source: preset ? selection : 'fallback', ...(preset ? {} : { error: 'unknown criteria preset: ' + String(selection) }) };
|
|
25
|
+
}
|
|
26
|
+
const path = (file ?? '').trim();
|
|
27
|
+
let text;
|
|
28
|
+
try {
|
|
29
|
+
if (!path)
|
|
30
|
+
throw new Error('no criteria file configured (set criteriaFile, or switch criteriaPreset away from custom)');
|
|
31
|
+
text = await this.load(path);
|
|
32
|
+
}
|
|
33
|
+
catch (error) {
|
|
34
|
+
return this.remember('custom\u0000' + path + '\u0000!' + String(error), {
|
|
35
|
+
criteria: DEFAULT_CRITERIA,
|
|
36
|
+
source: 'fallback',
|
|
37
|
+
...(path ? { file: path } : {}),
|
|
38
|
+
error: error instanceof Error ? error.message : String(error),
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
const key = 'custom\u0000' + path + '\u0000' + text;
|
|
42
|
+
if (this.cache?.key === key)
|
|
43
|
+
return this.cache.value;
|
|
44
|
+
try {
|
|
45
|
+
const parsed = parseCriteriaMarkdown(text);
|
|
46
|
+
return this.remember(key, {
|
|
47
|
+
criteria: parsed.criteria,
|
|
48
|
+
...(parsed.groundTruthNote ? { groundTruthNote: parsed.groundTruthNote } : {}),
|
|
49
|
+
source: 'custom',
|
|
50
|
+
file: path,
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
return this.remember(key + '\u0000!' + String(error), {
|
|
55
|
+
criteria: DEFAULT_CRITERIA,
|
|
56
|
+
source: 'fallback',
|
|
57
|
+
file: path,
|
|
58
|
+
error: error instanceof Error ? error.message : String(error),
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
remember(key, value) {
|
|
63
|
+
this.cache = { key, value };
|
|
64
|
+
return value;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=criteria.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"criteria.js","sourceRoot":"","sources":["../../src/criteria.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAC3C,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,qBAAqB,EAAyC,MAAM,WAAW,CAAA;AAgB5H;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,gBAAgB;IAEE;IADrB,KAAK,CAAsD;IACnE,YAA6B,OAA0C,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QAAxE,SAAI,GAAJ,IAAI,CAAoE;IAAG,CAAC;IAEzG,KAAK,CAAC,OAAO,CAAC,SAA4B,EAAE,IAAwB;QAClE,IAAI,SAAS,KAAK,QAAQ,EAAE,CAAC;YAC3B,MAAM,MAAM,GAAG,gBAAgB,CAAC,SAAS,CAAC,CAAA;YAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAI,gBAAgB,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CA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AC,QAAQ;gBACzB,GAAG,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,eAAe,EAAE,MAAM,CAAC,eAAe,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;gBAC9E,MAAM,EAAE,QAAQ;gBAChB,IAAI,EAAE,IAAI;aACX,CAAC,CAAA;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,GAAG,SAAS,GAAG,MAAM,CAAC,KAAK,CAAC,EAAE;gBACpD,QAAQ,EAAE,gBAAgB;gBAC1B,MAAM,EAAE,UAAU;gBAClB,IAAI,EAAE,IAAI;gBACV,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;aAC9D,CAAC,CAAA;QACJ,CAAC;IACH,CAAC;IAEO,QAAQ,CAAC,GAAW,EAAE,KAAuB;QACnD,IAAI,CAAC,KAAK,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,CAAA;QAC3B,OAAO,KAAK,CAAA;IACd,CAAC;CACF"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One model call captured inside an invocation.
|
|
3
|
+
*
|
|
4
|
+
* Everything the plugin decides is decided inside a prompt: "why did the progress
|
|
5
|
+
* judge answer K again" is a question about the exact text that was sent and the raw
|
|
6
|
+
* answer that came back. The statistics store answers "how much did it cost"; this one
|
|
7
|
+
* answers "why did it say that".
|
|
8
|
+
*/
|
|
9
|
+
export interface DecisionCall {
|
|
10
|
+
/** Which part of the invocation made the call (criterion, repeat, phase). */
|
|
11
|
+
label: string;
|
|
12
|
+
/** Scoring channel that answered (top-logprobs | explicit-tag). */
|
|
13
|
+
channel: string;
|
|
14
|
+
prompt: string;
|
|
15
|
+
output: string;
|
|
16
|
+
/** The score this call produced, when it produced one. */
|
|
17
|
+
score?: number;
|
|
18
|
+
}
|
|
19
|
+
/** Sink the engine reports every REAL model call to (cache hits make no call). */
|
|
20
|
+
export type DecisionTrace = (call: DecisionCall) => void;
|
|
21
|
+
export interface DecisionRecord {
|
|
22
|
+
id: string;
|
|
23
|
+
toolName: string;
|
|
24
|
+
phase: string;
|
|
25
|
+
startedAt: number;
|
|
26
|
+
provider: string;
|
|
27
|
+
model: string;
|
|
28
|
+
calls: DecisionCall[];
|
|
29
|
+
}
|
|
30
|
+
export declare function resolveDecisionsFile(cacheFile: string): string;
|
|
31
|
+
/**
|
|
32
|
+
* Redact and bound captured calls.
|
|
33
|
+
*
|
|
34
|
+
* Runs the same sanitizer the prompts do, so a snapshot can never persist a secret the
|
|
35
|
+
* judge itself never saw, and drops calls past the per-record budget instead of writing
|
|
36
|
+
* an unbounded file.
|
|
37
|
+
* @param calls - captured calls, oldest first.
|
|
38
|
+
* @returns The bounded calls; empty when nothing was captured.
|
|
39
|
+
*/
|
|
40
|
+
export declare function boundCaptureText(text: string, maxChars: number): string;
|
|
41
|
+
/**
|
|
42
|
+
* Redact and bound captured calls.
|
|
43
|
+
*
|
|
44
|
+
* Runs the same sanitizer the prompts do, so a snapshot can never persist a secret the
|
|
45
|
+
* judge itself never saw. The record is bounded twice: at {@link MAX_CALLS} calls, and at
|
|
46
|
+
* {@link MAX_RECORD_CHARS} characters shared EQUALLY between the calls it keeps — a six-call
|
|
47
|
+
* session acceptance must not shrink to its first three calls, and which three survived must not
|
|
48
|
+
* depend on completion order. Text uses {@link boundCaptureText}, which keeps both ends: a
|
|
49
|
+
* session-acceptance prompt runs past 100k characters, and head-only truncation kept the
|
|
50
|
+
* instructions while dropping the trajectory tail the judge actually graded.
|
|
51
|
+
* @param calls - captured calls; callers sort them by label so the bounded set is deterministic.
|
|
52
|
+
* @returns The bounded calls; empty when nothing was captured.
|
|
53
|
+
*/
|
|
54
|
+
export declare function boundDecisionCalls(calls: readonly DecisionCall[]): DecisionCall[];
|
|
55
|
+
export interface DecisionInput {
|
|
56
|
+
toolName: string;
|
|
57
|
+
phase: string;
|
|
58
|
+
startedAt: number;
|
|
59
|
+
provider: string;
|
|
60
|
+
model: string;
|
|
61
|
+
calls: readonly DecisionCall[];
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Per-topic ring buffer of decision snapshots.
|
|
65
|
+
*
|
|
66
|
+
* Mirrors {@link import('./statistics.ts').StatisticsStore}: one JSON file beside the
|
|
67
|
+
* statistics of the same topic, atomic replace on write, a fixed number of records, so
|
|
68
|
+
* the observable cost of "keep the evidence that explains a verdict" is bounded.
|
|
69
|
+
*/
|
|
70
|
+
export declare class DecisionStore {
|
|
71
|
+
private readonly file;
|
|
72
|
+
private readonly maxEntries;
|
|
73
|
+
private loaded;
|
|
74
|
+
private hydrating;
|
|
75
|
+
private records;
|
|
76
|
+
private writing;
|
|
77
|
+
constructor(file: string, maxEntries?: number);
|
|
78
|
+
record(input: DecisionInput): Promise<DecisionRecord | undefined>;
|
|
79
|
+
/** One snapshot by invocation id, or undefined when it was pruned or never captured. */
|
|
80
|
+
find(id: string): Promise<DecisionRecord | undefined>;
|
|
81
|
+
load(): Promise<void>;
|
|
82
|
+
private persist;
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=decisions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decisions.d.ts","sourceRoot":"","sources":["../../src/decisions.ts"],"names":[],"mappings":"AAKA;;;;;;;GAOG;AACH,MAAM,WAAW,YAAY;IAC3B,6EAA6E;IAC7E,KAAK,EAAE,MAAM,CAAA;IACb,mEAAmE;IACnE,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;IACd,0DAA0D;IAC1D,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,kFAAkF;AAClF,MAAM,MAAM,aAAa,GAAG,CAAC,IAAI,EAAE,YAAY,KAAK,IAAI,CAAA;AAExD,MAAM,WAAW,c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