@tangle-network/agent-eval 0.205.1 → 0.206.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/CHANGELOG.md +9 -0
- package/dist/analyst/index.d.ts +1 -1
- package/dist/analyst/index.js +1 -1
- package/dist/{benchmark-command-DuDTN5ID.js → benchmark-command-DtP94cOB.js} +2 -2
- package/dist/{benchmark-command-DuDTN5ID.js.map → benchmark-command-DtP94cOB.js.map} +1 -1
- package/dist/{claude-jsonl-DoQJBCVR.js → claude-jsonl-CG3JUbTJ.js} +8 -4
- package/dist/claude-jsonl-CG3JUbTJ.js.map +1 -0
- package/dist/cli.js +1 -1
- package/dist/{index-BoVEyQwH.d.ts → index-CbBfavbT.d.ts} +5 -3
- package/dist/{index-BoVEyQwH.d.ts.map → index-CbBfavbT.d.ts.map} +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/meta-eval/index.d.ts +6 -0
- package/dist/meta-eval/index.d.ts.map +1 -1
- package/dist/meta-eval/index.js +15 -1
- package/dist/meta-eval/index.js.map +1 -1
- package/dist/openapi.json +1 -1
- package/dist/rl.d.ts +12 -12
- package/dist/rl.d.ts.map +1 -1
- package/dist/rl.js +17 -17
- package/dist/rl.js.map +1 -1
- package/dist/rollout/index.d.ts +2 -2
- package/dist/rollout/index.js +3 -3
- package/dist/{rollout-BdCoWV9n.js → rollout-l9w3Gdvh.js} +2 -2
- package/dist/{rollout-BdCoWV9n.js.map → rollout-l9w3Gdvh.js.map} +1 -1
- package/dist/supervisor-run/index.js +1 -1
- package/dist/systemone-protocol-DKoi1NdK.d.ts +132 -0
- package/dist/systemone-protocol-DKoi1NdK.d.ts.map +1 -0
- package/dist/systemone-protocol.d.ts +2 -0
- package/dist/systemone-protocol.js +214 -0
- package/dist/systemone-protocol.js.map +1 -0
- package/dist/{jev-review-Cw06AKuF.d.ts → systemone-review-DGTKkLMG.d.ts} +16 -16
- package/dist/systemone-review-DGTKkLMG.d.ts.map +1 -0
- package/dist/{jev-review-DZEjDzlF.js → systemone-review-DTClwgmE.js} +11 -11
- package/dist/systemone-review-DTClwgmE.js.map +1 -0
- package/dist/systemone.d.ts +60 -0
- package/dist/systemone.d.ts.map +1 -0
- package/dist/{jev.js → systemone.js} +16 -16
- package/dist/systemone.js.map +1 -0
- package/docs/changes/jev-evidence-review.md +1 -1
- package/docs/changes/systemone-provider-neutral.md +36 -0
- package/docs/public-api.md +93 -68
- package/docs/rollout.md +9 -1
- package/docs/{jev-behavior-review.md → systemone-behavior-review.md} +17 -17
- package/docs/{jev-integrations.md → systemone-integrations.md} +4 -4
- package/docs/{jev-replay.md → systemone-replay.md} +6 -6
- package/docs/{jev.md → systemone.md} +84 -33
- package/package.json +9 -9
- package/dist/claude-jsonl-DoQJBCVR.js.map +0 -1
- package/dist/jev-protocol-BQLxwbqD.d.ts +0 -99
- package/dist/jev-protocol-BQLxwbqD.d.ts.map +0 -1
- package/dist/jev-protocol.d.ts +0 -2
- package/dist/jev-protocol.js +0 -114
- package/dist/jev-protocol.js.map +0 -1
- package/dist/jev-review-Cw06AKuF.d.ts.map +0 -1
- package/dist/jev-review-DZEjDzlF.js.map +0 -1
- package/dist/jev.d.ts +0 -60
- package/dist/jev.d.ts.map +0 -1
- package/dist/jev.js.map +0 -1
|
@@ -72,10 +72,14 @@ function blockText(content) {
|
|
|
72
72
|
if (!Array.isArray(content)) return "";
|
|
73
73
|
return content.filter((b) => isRecord(b) && b.type === "text" && typeof b.text === "string").map((b) => b.text).join("\n");
|
|
74
74
|
}
|
|
75
|
-
/**
|
|
75
|
+
/** Read one transcript file through the same parser used for retained source text. */
|
|
76
76
|
async function readClaudeTranscript(path, options = {}) {
|
|
77
|
+
return parseClaudeTranscript(await readFile(path, "utf8"), options);
|
|
78
|
+
}
|
|
79
|
+
/** Parse retained JSONL without another file or store; source gaps remain explicit. */
|
|
80
|
+
function parseClaudeTranscript(raw, options = {}) {
|
|
77
81
|
const gaps = [];
|
|
78
|
-
return transcriptFromEntries(parseClaudeEntries(
|
|
82
|
+
return transcriptFromEntries(parseClaudeEntries(raw, (gap) => gaps.push(gap)), {
|
|
79
83
|
...options,
|
|
80
84
|
sourceGaps: gaps
|
|
81
85
|
});
|
|
@@ -202,6 +206,6 @@ function transcriptFromEntries(entries, options = {}) {
|
|
|
202
206
|
};
|
|
203
207
|
}
|
|
204
208
|
//#endregion
|
|
205
|
-
export {
|
|
209
|
+
export { parseClaudeTranscript as a, parseClaudeEntries as i, claudeProjectSlug as n, readClaudeTranscript as o, findClaudeTranscripts as r, transcriptFromEntries as s, DEFAULT_CLAUDE_PROJECTS_DIR as t };
|
|
206
210
|
|
|
207
|
-
//# sourceMappingURL=claude-jsonl-
|
|
211
|
+
//# sourceMappingURL=claude-jsonl-CG3JUbTJ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-jsonl-CG3JUbTJ.js","names":[],"sources":["../src/rollout/readers/claude-jsonl.ts"],"sourcesContent":["/**\n * Backfill reader over Claude Code project transcripts\n * (~/.claude/projects/<cwd-slug>/<sessionId>.jsonl) → canonical\n * chat-with-tools messages plus per-session token usage.\n *\n * Transcript lines consumed: type:\"user\" (string content or content blocks —\n * text + tool_result) and type:\"assistant\" (content blocks — thinking, text,\n * tool_use; message.usage carries tokens). Sidechain lines (isSidechain=true,\n * subagent threads) are separate invocations and are excluded from the main\n * transcript. Everything else (queue-operation, attachment, last-prompt…) is\n * transport metadata, not conversation.\n */\n\nimport { readdir, readFile } from 'node:fs/promises'\nimport { homedir } from 'node:os'\nimport { join } from 'node:path'\nimport type { ChatMessage, ChatToolCall } from '../schema'\n\nexport const DEFAULT_CLAUDE_PROJECTS_DIR = join(homedir(), '.claude', 'projects')\n\n/** Claude Code's project-directory slug for a working directory. */\nexport function claudeProjectSlug(cwd: string): string {\n return cwd.replace(/[^a-zA-Z0-9-]/g, '-')\n}\n\nexport interface ClaudeTranscriptRef {\n sessionId: string\n path: string\n}\n\n/** Transcript files recorded for sessions launched from `cwd`. */\nexport async function findClaudeTranscripts(\n cwd: string,\n projectsDir: string = DEFAULT_CLAUDE_PROJECTS_DIR,\n): Promise<ClaudeTranscriptRef[]> {\n const dir = join(projectsDir, claudeProjectSlug(cwd))\n const names = await readdir(dir).catch(() => [])\n return names\n .filter((n) => n.endsWith('.jsonl'))\n .sort()\n .map((n) => ({ sessionId: n.replace(/\\.jsonl$/, ''), path: join(dir, n) }))\n}\n\nexport interface ClaudeUsageTotals {\n tokensIn: number | null\n tokensOut: number | null\n cacheRead: number | null\n cacheWrite: number | null\n}\n\nexport interface ClaudeTranscript {\n messages: ChatMessage[]\n usage: ClaudeUsageTotals\n /** Timestamp of the first conversation line; null = empty transcript. */\n startedAt: string | null\n endedAt: string | null\n model: string | null\n /** Every parse or usage gap retained beside this semantic projection. */\n gaps: string[]\n}\n\nconst isRecord = (v: unknown): v is Record<string, unknown> =>\n typeof v === 'object' && v !== null && !Array.isArray(v)\n\n/**\n * One conversation line of a transcript, still in Claude Code's own shape.\n *\n * This is the single line-level parse of the format. `readClaudeTranscript`\n * projects it to canonical messages + usage; the supervision-tree reader\n * (`src/supervisor-run/claude-code-reader.ts`) projects the SAME entries to\n * spawn/settle/steer instants. Two projections, one parser — a second\n * transcript parser is how the two views silently disagree.\n */\nexport interface ClaudeEntry {\n readonly type: 'user' | 'assistant'\n /** ISO instant of the line; null when the line carried none. */\n readonly timestamp: string | null\n /** The Anthropic message body (`role`, `content`, `model`, `usage`). */\n readonly message: Record<string, unknown>\n /** Claude Code's structured tool result, when the line carries one. */\n readonly toolUseResult: unknown\n /** True on subagent threads — a separate invocation, not this transcript's turn. */\n readonly isSidechain: boolean\n /** Subagent id Claude Code stamps on sidechain lines; null on main-thread lines. */\n readonly agentId: string | null\n}\n\n/** Parse transcript jsonl text into conversation lines. Non-conversation lines are dropped. */\nexport function parseClaudeEntries(raw: string, onGap?: (gap: string) => void): ClaudeEntry[] {\n const out: ClaudeEntry[] = []\n for (const [index, line] of raw.split('\\n').entries()) {\n if (!line.trim()) continue\n const gap = (reason: string): void => {\n const detail = `line ${index + 1}: ${reason}`\n if (onGap) onGap(detail)\n else throw new Error(`Claude transcript ${detail}`)\n }\n let parsed: unknown\n try {\n parsed = JSON.parse(line)\n } catch {\n gap('malformed JSON')\n continue\n }\n if (!isRecord(parsed)) {\n gap('JSON value is not an object')\n continue\n }\n const entry = parsed\n if (entry.type !== 'user' && entry.type !== 'assistant') continue\n const message = entry.message\n if (!isRecord(message)) {\n gap('conversation message is missing')\n continue\n }\n out.push({\n type: entry.type,\n timestamp: typeof entry.timestamp === 'string' ? entry.timestamp : null,\n message,\n toolUseResult: entry.toolUseResult,\n isSidechain: entry.isSidechain === true,\n agentId: typeof entry.agentId === 'string' ? entry.agentId : null,\n })\n }\n return out\n}\n\nexport interface ReadClaudeTranscriptOptions {\n /**\n * Read the sidechain (subagent) thread instead of skipping it. Subagent\n * transcripts under `<session>/subagents/agent-<id>.jsonl` are sidechain\n * lines end to end, so their usage is invisible without this.\n */\n readonly includeSidechain?: boolean\n /** Parser diagnostics from the retained source; used by the shared reader. */\n readonly sourceGaps?: readonly string[]\n}\n\nfunction blockText(content: unknown): string {\n if (typeof content === 'string') return content\n if (!Array.isArray(content)) return ''\n return content\n .filter(\n (b): b is Record<string, unknown> =>\n isRecord(b) && b.type === 'text' && typeof b.text === 'string',\n )\n .map((b) => b.text as string)\n .join('\\n')\n}\n\n/** Read one transcript file through the same parser used for retained source text. */\nexport async function readClaudeTranscript(\n path: string,\n options: ReadClaudeTranscriptOptions = {},\n): Promise<ClaudeTranscript> {\n return parseClaudeTranscript(await readFile(path, 'utf8'), options)\n}\n\n/** Parse retained JSONL without another file or store; source gaps remain explicit. */\nexport function parseClaudeTranscript(\n raw: string,\n options: ReadClaudeTranscriptOptions = {},\n): ClaudeTranscript {\n const gaps: string[] = []\n const entries = parseClaudeEntries(raw, (gap) => gaps.push(gap))\n return transcriptFromEntries(entries, { ...options, sourceGaps: gaps })\n}\n\n/** The messages+usage projection of already-parsed entries. */\nexport function transcriptFromEntries(\n entries: readonly ClaudeEntry[],\n options: ReadClaudeTranscriptOptions = {},\n): ClaudeTranscript {\n const wantSidechain = options.includeSidechain === true\n const messages: ChatMessage[] = []\n const usage: ClaudeUsageTotals = { tokensIn: 0, tokensOut: 0, cacheRead: 0, cacheWrite: 0 }\n const gaps = [...(options.sourceGaps ?? [])]\n let usageObserved = false\n let startedAt: string | null = null\n let endedAt: string | null = null\n let model: string | null = null\n // Claude Code writes one jsonl line PER CONTENT BLOCK of an API message,\n // repeating message.id and usage on each — merge blocks into one canonical\n // assistant turn and count usage once per API message id.\n let lastAssistantApiId: string | null = null\n let lastAssistantIndex = -1\n\n for (const entry of entries) {\n if (entry.isSidechain !== wantSidechain) continue\n const message = entry.message\n if (entry.timestamp !== null) {\n if (startedAt === null) startedAt = entry.timestamp\n endedAt = entry.timestamp\n }\n\n if (entry.type === 'user') {\n lastAssistantApiId = null\n lastAssistantIndex = -1\n const content = message.content\n if (typeof content === 'string') {\n messages.push({ role: 'user', content })\n continue\n }\n if (!Array.isArray(content)) continue\n // A user line may interleave tool_result blocks (answers to the prior\n // assistant tool_use) with plain text; preserve order.\n let userText = ''\n for (const block of content) {\n if (!isRecord(block)) continue\n if (block.type === 'tool_result' && typeof block.tool_use_id === 'string') {\n messages.push({\n role: 'tool',\n tool_call_id: block.tool_use_id,\n content:\n blockText(block.content) || (typeof block.content === 'string' ? block.content : ''),\n })\n } else if (block.type === 'text' && typeof block.text === 'string') {\n userText += (userText.length > 0 ? '\\n' : '') + block.text\n }\n }\n if (userText.length > 0) messages.push({ role: 'user', content: userText })\n continue\n }\n\n // assistant\n if (typeof message.model === 'string') model = message.model\n const apiId = typeof message.id === 'string' ? message.id : null\n const continuesTurn = apiId !== null && apiId === lastAssistantApiId && lastAssistantIndex >= 0\n const msgUsage = message.usage\n if (!continuesTurn) {\n usageObserved = true\n const fields = [\n ['tokensIn', 'input_tokens'],\n ['tokensOut', 'output_tokens'],\n ['cacheRead', 'cache_read_input_tokens'],\n ['cacheWrite', 'cache_creation_input_tokens'],\n ] as const\n for (const [target, source] of fields) {\n const value = isRecord(msgUsage) ? msgUsage[source] : undefined\n if (typeof value !== 'number' || !Number.isFinite(value) || value < 0) {\n usage[target] = null\n gaps.push(`assistant ${apiId ?? 'without id'}: ${source} unavailable`)\n } else if (usage[target] !== null) {\n usage[target] += value\n }\n }\n }\n const content = message.content\n if (!Array.isArray(content)) continue\n let reasoning = ''\n let text = ''\n const toolCalls: ChatToolCall[] = []\n for (const block of content) {\n if (!isRecord(block)) continue\n if (\n block.type === 'thinking' &&\n typeof block.thinking === 'string' &&\n block.thinking.length > 0\n ) {\n reasoning += (reasoning.length > 0 ? '\\n' : '') + block.thinking\n } else if (block.type === 'text' && typeof block.text === 'string') {\n text += (text.length > 0 ? '\\n' : '') + block.text\n } else if (block.type === 'tool_use' && typeof block.id === 'string') {\n toolCalls.push({\n id: block.id,\n type: 'function',\n function: {\n name: typeof block.name === 'string' ? block.name : 'unknown',\n arguments: JSON.stringify(block.input ?? {}),\n },\n })\n }\n }\n if (reasoning.length === 0 && text.length === 0 && toolCalls.length === 0) continue\n if (continuesTurn) {\n const prev = messages[lastAssistantIndex]!\n if (text.length > 0) prev.content = prev.content === null ? text : `${prev.content}\\n${text}`\n if (reasoning.length > 0) {\n prev.reasoning_content =\n prev.reasoning_content === undefined\n ? reasoning\n : `${prev.reasoning_content}\\n${reasoning}`\n }\n if (toolCalls.length > 0) prev.tool_calls = [...(prev.tool_calls ?? []), ...toolCalls]\n continue\n }\n messages.push({\n role: 'assistant',\n content: text.length > 0 ? text : null,\n ...(reasoning.length > 0 ? { reasoning_content: reasoning } : {}),\n ...(toolCalls.length > 0 ? { tool_calls: toolCalls } : {}),\n })\n lastAssistantApiId = apiId\n lastAssistantIndex = messages.length - 1\n }\n\n if (!usageObserved) {\n usage.tokensIn = null\n usage.tokensOut = null\n usage.cacheRead = null\n usage.cacheWrite = null\n }\n return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EACF;EACA,SAAS,KAAK;GACZ,MAAM;GACN,SAAS,KAAK,SAAS,IAAI,OAAO;GAClC,GAAI,UAAU,SAAS,IAAI,EAAE,mBAAmB,UAAU,IAAI,CAAC;GAC/D,GAAI,UAAU,SAAS,IAAI,EAAE,YAAY,UAAU,IAAI,CAAC;EAC1D,CAAC;EACD,qBAAqB;EACrB,qBAAqB,SAAS,SAAS;CACzC;CAEA,IAAI,CAAC,eAAe;EAClB,MAAM,WAAW;EACjB,MAAM,YAAY;EAClB,MAAM,YAAY;EAClB,MAAM,aAAa;CACrB;CACA,OAAO;EAAE;EAAU;EAAO;EAAW;EAAS;EAAO;CAAK;AAC5D"}
|
package/dist/cli.js
CHANGED
|
@@ -5,7 +5,7 @@ import { t as renderSearchSummary } from "./search-summary-CDURlgZR.js";
|
|
|
5
5
|
import { c as hostedTenantFromEnv, g as SearchRunKindSchema, r as shipSearchLedger, t as SearchShipConflictError, u as SEARCH_LEDGER_BATCH_MAX_BYTES } from "./search-shipper-DhhofkDX.js";
|
|
6
6
|
import { i as runRolloutReleaseCli } from "./hf-dataset-BR2yhuNn.js";
|
|
7
7
|
import { t as createChatClient } from "./chat-client-5LLl4Ctl.js";
|
|
8
|
-
import { t as runAnalystBenchmarkCommand } from "./benchmark-command-
|
|
8
|
+
import { t as runAnalystBenchmarkCommand } from "./benchmark-command-DtP94cOB.js";
|
|
9
9
|
import { a as runRpcBatch, o as runRpcOnce, p as handleVersion, r as startServerAsync, s as buildOpenApi } from "./server-CoBZO1fj.js";
|
|
10
10
|
import { A as editCreditText, E as front, f as renderMetaSearchText, h as landscape, k as editCredit, l as metaSearch, m as formatLandscape, n as taskMatrix, o as skillManifold, r as formatSkillManifold, t as tree, x as surfaceTextEdits } from "./tree-By7LtLUu.js";
|
|
11
11
|
import { t as runSupervisorRunCommand } from "./report-command-JrjiWReS.js";
|
|
@@ -398,8 +398,10 @@ interface ReadClaudeTranscriptOptions {
|
|
|
398
398
|
/** Parser diagnostics from the retained source; used by the shared reader. */
|
|
399
399
|
readonly sourceGaps?: readonly string[];
|
|
400
400
|
}
|
|
401
|
-
/**
|
|
401
|
+
/** Read one transcript file through the same parser used for retained source text. */
|
|
402
402
|
declare function readClaudeTranscript(path: string, options?: ReadClaudeTranscriptOptions): Promise<ClaudeTranscript>;
|
|
403
|
+
/** Parse retained JSONL without another file or store; source gaps remain explicit. */
|
|
404
|
+
declare function parseClaudeTranscript(raw: string, options?: ReadClaudeTranscriptOptions): ClaudeTranscript;
|
|
403
405
|
//#endregion
|
|
404
406
|
//#region src/rollout/readers/opencode-sqlite.d.ts
|
|
405
407
|
declare const DEFAULT_OPENCODE_DB: string;
|
|
@@ -668,5 +670,5 @@ declare function parseRolloutReleaseArgs(argv: string[]): RolloutReleaseCliArgs;
|
|
|
668
670
|
/** CLI driver for `agent-eval rollout-release`. Returns the process exit code. */
|
|
669
671
|
declare function runRolloutReleaseCli(argv: string[]): Promise<number>;
|
|
670
672
|
//#endregion
|
|
671
|
-
export {
|
|
672
|
-
//# sourceMappingURL=index-
|
|
673
|
+
export { HarborAgent as $, measureFormatGate as A, DEFAULT_CLAUDE_PROJECTS_DIR as B, FORMAT_GATE_DISPOSITION as C, GatePolicy as Ct, ReleaseRowRef as D, GateReport as E, openOpencodeDb as F, readClaudeTranscript as G, claudeProjectSlug as H, readOpencodeSessionMessages as I, readRolloutLedger as J, appendRolloutLines as K, ClaudeTranscript as L, DEFAULT_OPENCODE_DB as M, OpencodeSessionRow as N, assertGateReport as O, findOpencodeSessionsByDirectory as P, HARBOR_IMPORT_GAP as Q, ClaudeTranscriptRef as R, EmittedEvidence as S, GateEntryPoint as St, GateDisposition as T, gatedEvidenceOf as Tt, findClaudeTranscripts as U, ReadClaudeTranscriptOptions as V, parseClaudeTranscript as W, ATIF_SCHEMA_VERSION as X, writeRolloutLedger as Y, FromHarborOptions as Z, defaultRolloutScrubber as _, GATE_POLICIES as _t, buildHfDataset as a, HarborObservationResult as at, scrubRolloutLine as b, GateCheckId as bt, runRolloutReleaseCli as c, HarborSubagentTrajectoryRef as ct, RELEASE_FORMATS as d, fromHarborTrajectory as dt, HarborContentPart as et, ReleaseFormat as f, relabelImportedSplit as ft, addScrubCounts as g, GATE_CHECK_IDS as gt, ScrubRule as h, GATE_CHECKS as ht, ScrubReport as i, HarborObservation as it, releaseRowRefs as j, gatedRolloutIds as k, DatasetCardInputs as l, HarborToolCall as lt, ScrubCounts as m, toHarborTrajectory as mt, BuildSummary as n, HarborImageSource as nt, parseRolloutReleaseArgs as o, HarborStep as ot, buildDatasetCard as p, toHarborTrajectories as pt, readRolloutJournal as q, RolloutReleaseCliArgs as r, HarborMetrics as rt, planPushCommand as s, HarborStepSource as st, BuildOptions as t, HarborFinalMetrics as tt, FORMAT_FILES as u, HarborTrajectory as ut, emptyScrubCounts as v, GateCheck as vt, FormatGateCounts as w, gateErrors as wt, scrubText as x, GateCheckedOutcome as xt, scrubLines as y, GateCheckDisposition as yt, ClaudeUsageTotals as z };
|
|
674
|
+
//# sourceMappingURL=index-CbBfavbT.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-
|
|
1
|
+
{"version":3,"file":"index-CbBfavbT.d.ts","names":[],"sources":["../src/rollout/gate-checks.ts","../src/rollout/interchange/harbor.ts","../src/rollout/ledger.ts","../src/rollout/readers/claude-jsonl.ts","../src/rollout/readers/opencode-sqlite.ts","../src/rollout/release/gate-report.ts","../src/rollout/release/scrub.ts","../src/rollout/release/card.ts","../src/rollout/release/hf-dataset.ts"],"mappings":";;;;;;;;;;;;cA2Ca;KAOD,sBAAsB;;;;;;;;;KAUtB,qBAAqB,QAAQ,kBAAkB,SAAS;;;;;;;;;;;;;;;;;UAkBnD;EACf,SAAS;;EAET;;UAOe;EACf,IAAI;;EAEJ;;EAEA,SAAS,SAAS;;;;;;;;;;;;EAYlB,WAAW;;;;;;;;;;;;;iBA6LG,gBAAgB,SAAS,cAAc;;;;;;cA6I1C,yBAAyB,KAAK,cAAc;;;;;;;;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;;;;;;;;;iBA8BhC,iBAAiB,MAAM,mBAAmB,QAAQ,cAAc;iBAIhE,WAAW,OAAO;EAChC,OAAO;EACP,QAAQ;;;;;;;;;iBAaM,uBAAuB;;;cCrI1B;KACD,wBAAwB;;cAGvB,cAAc,OAAO;UAejB;;EAEf,OAAO;EACP,SAAS;EACT;;EAEA;EACA,aAAa;EACb;IAAY;IAAmB;;EAC/B,cAAc,QAAQ,OAAO;;;;;;;EAO7B,MAAM;;iBA4GQ,iBAAiB,QAAQ;;;UC1HxB;EACf;EACA,SAAS;EACT;;UAGe;;EAEf,OAAO,eAAe;EACtB,QAAQ;EACR;IAAY;IAAmB;;;UAGhB;EACf;EACA;EACA;EACA,OAAO;EACP,cAAc,QAAQ,OAAO;;EAE7B,MAAM;EACN;;iBAGoB,eACpB,kBACA,SAAS,eACR,QAAQ;iBAuGK,gBAAgB,cAAc;UAoB7B,8BAA8B;EAC7C;EACA;;iBAMc,wBAAwB,iBAAiB;;iBA0CnC,qBAAqB,iBAAiB"}
|
package/dist/index.d.ts
CHANGED
|
@@ -44,7 +44,7 @@ import { A as scoreTraceInsightReadiness, B as OtlpSpan, C as describeTraceInsig
|
|
|
44
44
|
import { a as RunIntegrityReport, o as assertRunCaptured, t as RunIntegrityError } from "./integrity-BWO6RPxv.js";
|
|
45
45
|
import { c as judgeSpans, f as runsForScenario, i as argHash } from "./query-DBUQhehH.js";
|
|
46
46
|
import { a as SteeringChange, c as CampaignRunContext, d as CampaignVariant, f as EvalCampaignOptions, h as runEvalCampaign, i as Researcher, l as CampaignRunOutcome, m as FailedRun, n as ExperimentResult, o as CampaignFactoryParams, p as EvalCampaignResult, r as FailureMode, s as CampaignIntegrityPolicy, t as ExperimentPlan, u as CampaignScenario } from "./researcher-zTpxNJBy.js";
|
|
47
|
-
import "./index-
|
|
47
|
+
import "./index-CbBfavbT.js";
|
|
48
48
|
import { _ as WelchTestResult, a as ToolStats, b as welchsTTest, c as computeToolUseMetrics, d as judgeAgreementView, i as toolWasteView, m as budgetBreachView, o as ToolUseMetrics, s as ToolUseOptions, v as WelchTestStatus, y as iqr } from "./tool-waste-DxlebQkx.js";
|
|
49
49
|
import { SpanKind } from "@tangle-network/agent-trace-contract";
|
|
50
50
|
//#region src/statistics/effect-sizes.d.ts
|
package/dist/index.js
CHANGED
|
@@ -49,7 +49,7 @@ import { t as packageVersion$1 } from "./package-version-D7lQHt_-.js";
|
|
|
49
49
|
import { a as classifyFailure, i as INFRA_FAILURE_BLAMES, o as classifyFailureReason, r as FAILURE_BLAME, s as failureBlame, t as DEFAULT_FAILURE_REASON_RULES } from "./failure-taxonomy-CjabTATj.js";
|
|
50
50
|
import { n as runBoundedProcess, t as DEFAULT_BOUNDED_PROCESS_TIMEOUT_MS } from "./bounded-process-Cj9YjXbE.js";
|
|
51
51
|
import { t as runEvalCampaign } from "./eval-campaign-DU_p8qVt.js";
|
|
52
|
-
import "./rollout-
|
|
52
|
+
import "./rollout-l9w3Gdvh.js";
|
|
53
53
|
import { t as mintRolloutRows } from "./mint-CWG-s2mI.js";
|
|
54
54
|
import { n as pairedEvalueSequence, t as evaluateInterimReleaseConfidence } from "./sequential-CzK5DarL.js";
|
|
55
55
|
import { n as paidJsonChat } from "./chat-json-call-Digk-pfF.js";
|
|
@@ -100,6 +100,12 @@ export interface CalibrationPair {
|
|
|
100
100
|
export declare function calibrationCurve(traceStore: TraceStore, outcomeStore: OutcomeStore, evalMetric: EvalMetricSpec, outcomeMetric: string, options?: CalibrationOptions): Promise<CalibrationReport | null>;
|
|
101
101
|
/** Measure already joined observations without constructing trace and outcome stores. */
|
|
102
102
|
export declare function calibrationFromPairs(inputPairs: readonly CalibrationPair[], evalMetric: string, outcomeMetric: string, options?: CalibrationOptions): CalibrationReport | null;
|
|
103
|
+
/**
|
|
104
|
+
* Mean squared error of probability forecasts against binary outcomes, Σ(p − y)²/N; always
|
|
105
|
+
* forecasting 0.5 scores 0.25. For the reliability table and ECE use `calibrationFromPairs`
|
|
106
|
+
* with `range: { lo: 0, hi: 1 }` (`binning: 'equal-frequency'` gives equal-mass bins).
|
|
107
|
+
*/
|
|
108
|
+
export declare function brierScore(pairs: readonly CalibrationPair[]): number;
|
|
103
109
|
//#endregion
|
|
104
110
|
//#region src/meta-eval/evaluator-admission.d.ts
|
|
105
111
|
export declare const evaluatorAdmissionPolicySchema: z.ZodObject<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/meta-eval/correlation-study.ts","../../src/meta-eval/calibration.ts","../../src/meta-eval/evaluator-admission.ts","../../src/meta-eval/plants.ts","../../src/meta-eval/sentinel.ts"],"mappings":";;;;;;;;;;iBAoBiB;EACf;;;EAGA,WAAW,KAAK,KAAK,OAAO,eAAe;;iBAG5B;EACf;EACA;;iBAGe;EACf;EACA;EACA;EACA;EACA;;EAEA;IAAe;IAAe;;;EAE9B;IAAgB;IAAe;;;EAE/B;;iBAGe;EACf,OAAO;;EAEP,eAAe,MACb;IACE;IACA;;EAGJ;EACA;;iBAGe;;EAEf;;EAEA,gBAAgB;;EAEhB;;EAEA;;;EAGA;;wBAGoB,iBACpB,YAAY,YACZ,cAAc,cACd,aAAa,kBACb,8BACA,UAAS,0BACR,QAAQ;;;iBChEM;EACf;EACA;EACA;EACA;EACA;;EAEA;;iBAGe;EACf;EACA;EACA;EACA,MAAM;;EAEN;;EAEA;;iBAGe;;EAEf;;EAEA;;EAEA;IAAU;IAAY;;;iBAGP;EACf;EACA;;wBAGoB,iBACpB,YAAY,YACZ,cAAc,cACd,YAAY,gBACZ,uBACA,UAAS,qBACR,QAAQ;;wBA0CK,qBACd,qBAAqB,mBACrB,oBACA,uBACA,UAAS,qBACR;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/meta-eval/correlation-study.ts","../../src/meta-eval/calibration.ts","../../src/meta-eval/evaluator-admission.ts","../../src/meta-eval/plants.ts","../../src/meta-eval/sentinel.ts"],"mappings":";;;;;;;;;;iBAoBiB;E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A,QAAQ,QAAQ,OAAO,WAAW;;EAElC;;EAEA;EACA,UAAU;;;;;;;;;;wBAWI,UACd,kBAAkB,gBAClB,UAAU,gBACT;;;cC/lBG;YAEM,6BAA6B;iBAExB;;EAEf;;EAEA;;EAEA;;iBAGe;;EAEf;EACA;;EAEA;;;;;;;EAOA,SAAS;;;iBAIM;EACf;EACA;EACA;;;wBAcc,yBAAyB,UAAU,kBAAkB;;;;;;wBAiCrD,wBACd,QAAQ,oBAAoB,6BAC5B,MAAM,eACL;;;;;;;;wBAmBa,sBACd,QAAQ,wBAAwB,qBAChC,MAAM,eACL;iBAYc;;EAEf;;;;;;;;;wBAUc,wBACd,QAAQ,kBACR,QAAQ,cACR,MAAM,cACN,UAAS,qBACR;iBA4Cc;EACf,OAAO,UAAU,mBAAmB;;EAEpC,QAAQ,mBAAmB,QAAQ;;wBAGrB,sBAAsB,UAAS,qBAA0B;;;;;;;wBAqBzD,kBAAkB,eAAe;iBA0ChC;;EAEf;;EAEA;;EAEA;;EAEA;;iBAGe;;EAEf;EACA,aAAa;;EAEb,cAAc;;iBAGC;EACf;EACA,QAAQ;;EAER,OAAO;;EAEP;;EAEA;;EAEA;EACA;EACA;;iBAGe;EACf,UAAU;EACV;EACA;;;;;;;EAOA;;wBAKc,oBACd,SAAS,oBACT,MAAM,uBACL;iBA6Gc;EACf;EACA;;;;;;;;;;wBAWc,gBAAgB,QAAQ,iBAAiB"}
|
package/dist/meta-eval/index.js
CHANGED
|
@@ -102,6 +102,20 @@ function calibrationFromPairs(inputPairs, evalMetric, outcomeMetric, options = {
|
|
|
102
102
|
maxGap
|
|
103
103
|
};
|
|
104
104
|
}
|
|
105
|
+
/**
|
|
106
|
+
* Mean squared error of probability forecasts against binary outcomes, Σ(p − y)²/N; always
|
|
107
|
+
* forecasting 0.5 scores 0.25. For the reliability table and ECE use `calibrationFromPairs`
|
|
108
|
+
* with `range: { lo: 0, hi: 1 }` (`binning: 'equal-frequency'` gives equal-mass bins).
|
|
109
|
+
*/
|
|
110
|
+
function brierScore(pairs) {
|
|
111
|
+
if (!pairs.length) throw new Error("Brier score requires at least one pair");
|
|
112
|
+
let total = 0;
|
|
113
|
+
for (const [index, pair] of pairs.entries()) {
|
|
114
|
+
if (pair === null || typeof pair !== "object" || !(pair.evalScore >= 0 && pair.evalScore <= 1) || pair.outcome !== 0 && pair.outcome !== 1) throw new Error(`Brier pair ${index} needs a probability in [0, 1] and an outcome of 0 or 1`);
|
|
115
|
+
total += (pair.evalScore - pair.outcome) ** 2;
|
|
116
|
+
}
|
|
117
|
+
return total / pairs.length;
|
|
118
|
+
}
|
|
105
119
|
function toBin(chunk, lower, upper) {
|
|
106
120
|
const xs = chunk.map((c) => c.evalScore);
|
|
107
121
|
const ys = chunk.map((c) => c.outcome);
|
|
@@ -1243,6 +1257,6 @@ function evalHealthStamp(report) {
|
|
|
1243
1257
|
};
|
|
1244
1258
|
}
|
|
1245
1259
|
//#endregion
|
|
1246
|
-
export { FileSystemOutcomeStore, InMemoryOutcomeStore, OutcomeStoreError, auditEvaluator, auditProbabilityPolicy, calibrateJudge, calibrateJudgeContinuous, calibrationCurve, calibrationFromPairs, catchRate, continuousAgreement, correlationStudy, definePlant, evalHealthStamp, evaluatorAdmissionPolicySchema, evaluatorAuditObservationSchema, fileSentinelStore, inMemorySentinelStore, judgeSentinelReport, perturbEvidence, planEvaluatorAudit, plantByPerturbation, positionalBias, rubricPredictiveValidity, seedPlants, selfPreference, snapshotFromAgreement, snapshotFromCalibration, snapshotFromSentinelSet, validateSentinelSnapshot, verbosityBias };
|
|
1260
|
+
export { FileSystemOutcomeStore, InMemoryOutcomeStore, OutcomeStoreError, auditEvaluator, auditProbabilityPolicy, brierScore, calibrateJudge, calibrateJudgeContinuous, calibrationCurve, calibrationFromPairs, catchRate, continuousAgreement, correlationStudy, definePlant, evalHealthStamp, evaluatorAdmissionPolicySchema, evaluatorAuditObservationSchema, fileSentinelStore, inMemorySentinelStore, judgeSentinelReport, perturbEvidence, planEvaluatorAudit, plantByPerturbation, positionalBias, rubricPredictiveValidity, seedPlants, selfPreference, snapshotFromAgreement, snapshotFromCalibration, snapshotFromSentinelSet, validateSentinelSnapshot, verbosityBias };
|
|
1247
1261
|
|
|
1248
1262
|
//# sourceMappingURL=index.js.map
|