@tangle-network/agent-eval 2.0.12 → 2.0.14
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 +19 -0
- package/dist/adapters/http.d.ts +2 -2
- package/dist/{agent-profile-C0FBdYa6.d.ts → agent-profile-Iiiqim4k.d.ts} +5 -5
- package/dist/{agent-profile-C0FBdYa6.d.ts.map → agent-profile-Iiiqim4k.d.ts.map} +1 -1
- package/dist/analyst/index.d.ts +109 -11
- package/dist/analyst/index.d.ts.map +1 -1
- package/dist/analyst/index.js +2 -2
- package/dist/{analyze-runs-Izz_ZeWg.d.ts → analyze-runs-ByEuSMUT.d.ts} +2 -2
- package/dist/{analyze-runs-Izz_ZeWg.d.ts.map → analyze-runs-ByEuSMUT.d.ts.map} +1 -1
- package/dist/app-grade/index.d.ts +3 -3
- package/dist/{benchmark-command-Be5O6A2v.js → benchmark-command-BizGxhuU.js} +427 -29
- package/dist/{benchmark-command-Be5O6A2v.js.map → benchmark-command-BizGxhuU.js.map} +1 -1
- package/dist/benchmarks/index.d.ts +4 -4
- package/dist/benchmarks/index.js +2 -2
- package/dist/campaign/index.d.ts +7 -7
- package/dist/campaign/index.js +7 -7
- package/dist/{campaign-CE08mvQO.js → campaign-CaO2k8Jb.js} +7 -7
- package/dist/{campaign-CE08mvQO.js.map → campaign-CaO2k8Jb.js.map} +1 -1
- package/dist/{campaign-evidence-DRvr7lZU.d.ts → campaign-evidence-p9QJoA1P.d.ts} +3 -3
- package/dist/{campaign-evidence-DRvr7lZU.d.ts.map → campaign-evidence-p9QJoA1P.d.ts.map} +1 -1
- package/dist/cli.js +366 -24
- package/dist/cli.js.map +1 -1
- package/dist/{client-DUMIaMob.d.ts → client-3sR4_h5q.d.ts} +2 -2
- package/dist/{client-DUMIaMob.d.ts.map → client-3sR4_h5q.d.ts.map} +1 -1
- package/dist/contract/index.d.ts +11 -11
- package/dist/contract/index.js +5 -5
- package/dist/{default-registry-DFRlBniE.d.ts → default-registry-DpTVhIO5.d.ts} +6 -6
- package/dist/{default-registry-DFRlBniE.d.ts.map → default-registry-DpTVhIO5.d.ts.map} +1 -1
- package/dist/{define-agent-eval-BHn6t-DC.js → define-agent-eval-BLHr0_IP.js} +3 -3
- package/dist/{define-agent-eval-BHn6t-DC.js.map → define-agent-eval-BLHr0_IP.js.map} +1 -1
- package/dist/{define-agent-eval-n63vmQMR.d.ts → define-agent-eval-D__7N3BM.d.ts} +5 -5
- package/dist/{define-agent-eval-n63vmQMR.d.ts.map → define-agent-eval-D__7N3BM.d.ts.map} +1 -1
- package/dist/diagnosis/index.d.ts +2 -2
- package/dist/{evaluation-VbjqORBn.d.ts → evaluation-DVNNvOz5.d.ts} +4 -4
- package/dist/{evaluation-VbjqORBn.d.ts.map → evaluation-DVNNvOz5.d.ts.map} +1 -1
- package/dist/evaluation.d.ts +1 -1
- package/dist/{exact-types-BIHqYBYf.d.ts → exact-types-QwxMWchv.d.ts} +2 -2
- package/dist/{exact-types-BIHqYBYf.d.ts.map → exact-types-QwxMWchv.d.ts.map} +1 -1
- package/dist/experiment/index.d.ts +2 -2
- package/dist/{feedback-trajectory-CoQPmSJV.d.ts → feedback-trajectory-BkWAgoY0.d.ts} +3 -3
- package/dist/{feedback-trajectory-CoQPmSJV.d.ts.map → feedback-trajectory-BkWAgoY0.d.ts.map} +1 -1
- package/dist/hosted/index.d.ts +2 -2
- package/dist/hosted/index.js +1 -1
- package/dist/{index-CbzPtg7O.d.ts → index-B5FH3fgu.d.ts} +18 -18
- package/dist/{index-CbzPtg7O.d.ts.map → index-B5FH3fgu.d.ts.map} +1 -1
- package/dist/{index-BEXEYURJ.d.ts → index-DXEhnNrn.d.ts} +10 -10
- package/dist/{index-BEXEYURJ.d.ts.map → index-DXEhnNrn.d.ts.map} +1 -1
- package/dist/{index-Dt3zWlRa.d.ts → index-DkL184ja.d.ts} +5 -5
- package/dist/{index-Dt3zWlRa.d.ts.map → index-DkL184ja.d.ts.map} +1 -1
- package/dist/{index-rrPT3Pw0.d.ts → index-h7nEEV3T.d.ts} +2 -2
- package/dist/{index-rrPT3Pw0.d.ts.map → index-h7nEEV3T.d.ts.map} +1 -1
- package/dist/index.d.ts +18 -18
- package/dist/index.js +4 -4
- package/dist/{llm-judge-CgF3ZM3R.js → llm-judge-ChGnwj4s.js} +2 -2
- package/dist/{llm-judge-CgF3ZM3R.js.map → llm-judge-ChGnwj4s.js.map} +1 -1
- package/dist/{matrix-B95YsrV7.d.ts → matrix-kxgHmj2-.d.ts} +2 -2
- package/dist/{matrix-B95YsrV7.d.ts.map → matrix-kxgHmj2-.d.ts.map} +1 -1
- package/dist/multishot/golden/index.d.ts +1 -1
- package/dist/multishot/index.d.ts +7 -7
- package/dist/multishot/index.js +2 -2
- package/dist/openapi.json +1 -1
- package/dist/{optimization-method-1xzXK-B6.js → optimization-method-D2uCSc2j.js} +4 -4
- package/dist/{optimization-method-1xzXK-B6.js.map → optimization-method-D2uCSc2j.js.map} +1 -1
- package/dist/{prime-protocol-BRMk6dGI.d.ts → prime-protocol-46WvqIIt.d.ts} +2 -2
- package/dist/{prime-protocol-BRMk6dGI.d.ts.map → prime-protocol-46WvqIIt.d.ts.map} +1 -1
- package/dist/{registry-BeInzotS.d.ts → registry-Bh1M9hrf.d.ts} +3 -3
- package/dist/{registry-BeInzotS.d.ts.map → registry-Bh1M9hrf.d.ts.map} +1 -1
- package/dist/rl.d.ts +3 -3
- package/dist/rollout/index.d.ts +2 -2
- package/dist/{run-improvement-loop-BPhkYKV2.d.ts → run-improvement-loop-FsLfRyJm.d.ts} +8 -8
- package/dist/{run-improvement-loop-BPhkYKV2.d.ts.map → run-improvement-loop-FsLfRyJm.d.ts.map} +1 -1
- package/dist/search/index.d.ts +3 -3
- package/dist/search/index.js +2 -2
- package/dist/{search-kernel-BkkDo75N.js → search-kernel-B1TEQ9pa.js} +2 -2
- package/dist/{search-kernel-BkkDo75N.js.map → search-kernel-B1TEQ9pa.js.map} +1 -1
- package/dist/{search-kernel-CDSEWa2X.d.ts → search-kernel-BSYkfEg5.d.ts} +3 -3
- package/dist/{search-kernel-CDSEWa2X.d.ts.map → search-kernel-BSYkfEg5.d.ts.map} +1 -1
- package/dist/{search-ledger-sormHFLS.js → search-ledger-EjLGVZ4X.js} +9 -5
- package/dist/search-ledger-EjLGVZ4X.js.map +1 -0
- package/dist/{search-ledger-types-BhZE848w.d.ts → search-ledger-types-D4FsvPP9.d.ts} +8 -2
- package/dist/search-ledger-types-D4FsvPP9.d.ts.map +1 -0
- package/dist/{search-shipper-BJ2Bkx2q.js → search-shipper-DtSnRfOJ.js} +2 -2
- package/dist/{search-shipper-BJ2Bkx2q.js.map → search-shipper-DtSnRfOJ.js.map} +1 -1
- package/dist/{search-summary-DMckFUNY.js → search-summary-C5fewoUi.js} +2 -2
- package/dist/{search-summary-DMckFUNY.js.map → search-summary-C5fewoUi.js.map} +1 -1
- package/dist/{self-improve-D0TtJz4e.d.ts → self-improve-Bf3b6rS9.d.ts} +8 -8
- package/dist/{self-improve-D0TtJz4e.d.ts.map → self-improve-Bf3b6rS9.d.ts.map} +1 -1
- package/dist/{self-improve-CMrPmjYE.js → self-improve-CQM7hIL_.js} +3 -3
- package/dist/{self-improve-CMrPmjYE.js.map → self-improve-CQM7hIL_.js.map} +1 -1
- package/dist/{skillopt-optimization-method-D-BPMi8J.js → skillopt-optimization-method-DQ4urRij.js} +3 -3
- package/dist/{skillopt-optimization-method-D-BPMi8J.js.map → skillopt-optimization-method-DQ4urRij.js.map} +1 -1
- package/dist/{store-tool-spans-M3WxeRrG.d.ts → store-tool-spans-_hFLpBfi.d.ts} +4 -4
- package/dist/{store-tool-spans-M3WxeRrG.d.ts.map → store-tool-spans-_hFLpBfi.d.ts.map} +1 -1
- package/dist/{systemone-C26IFS-a.d.ts → systemone-CE0Rj-BQ.d.ts} +6 -6
- package/dist/{systemone-C26IFS-a.d.ts.map → systemone-CE0Rj-BQ.d.ts.map} +1 -1
- package/dist/{systemone-review-DpAXWDkL.d.ts → systemone-review-CRJ-Zdfo.d.ts} +3 -3
- package/dist/{systemone-review-DpAXWDkL.d.ts.map → systemone-review-CRJ-Zdfo.d.ts.map} +1 -1
- package/dist/systemone.d.ts +3 -3
- package/dist/{tool-groups-SlnoQNyT.d.ts → tool-groups-BHX9G_oE.d.ts} +2 -2
- package/dist/tool-groups-BHX9G_oE.d.ts.map +1 -0
- package/dist/{trace-questions-ybyF0B6N.d.ts → trace-questions-DfaIVysB.d.ts} +2 -2
- package/dist/{trace-questions-ybyF0B6N.d.ts.map → trace-questions-DfaIVysB.d.ts.map} +1 -1
- package/dist/trace-repair/index.d.ts +1 -1
- package/dist/traces.d.ts +2 -2
- package/dist/{tree-BX9ykHi3.js → tree-CljLPWVm.js} +3 -3
- package/dist/{tree-BX9ykHi3.js.map → tree-CljLPWVm.js.map} +1 -1
- package/dist/{types-CBT-XcX5.d.ts → types-BBht9lpj.d.ts} +5 -3
- package/dist/types-BBht9lpj.d.ts.map +1 -0
- package/dist/{types-CYPV2dlR.d.ts → types-CEiYR2xs.d.ts} +2 -2
- package/dist/{types-CYPV2dlR.d.ts.map → types-CEiYR2xs.d.ts.map} +1 -1
- package/dist/{types-B1W3v8dT.d.ts → types-CjrzKsOK.d.ts} +8 -8
- package/dist/{types-B1W3v8dT.d.ts.map → types-CjrzKsOK.d.ts.map} +1 -1
- package/dist/wire/index.d.ts +1 -1
- package/docs/search-ledger.md +1 -1
- package/docs/skill-eval.md +12 -3
- package/package.json +1 -1
- package/dist/search-ledger-sormHFLS.js.map +0 -1
- package/dist/search-ledger-types-BhZE848w.d.ts.map +0 -1
- package/dist/tool-groups-SlnoQNyT.d.ts.map +0 -1
- package/dist/types-CBT-XcX5.d.ts.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { a as RunRecord } from "./run-record-kuOr3BCF.js";
|
|
2
|
-
import { B as FindingTreatment } from "./types-
|
|
2
|
+
import { B as FindingTreatment } from "./types-CjrzKsOK.js";
|
|
3
3
|
import { E as PairedBootstrapResult, I as McNemarResult, R as RiskDifferenceResult, T as PairedBootstrapOptions, r as EProcessState } from "./index-Bk1XEkP7.js";
|
|
4
4
|
import { r as LedgerHash } from "./canonical-CGXS21f_.js";
|
|
5
|
-
import { R as Scenario, a as CampaignResult, b as GenerationRecord, h as GateContext, j as MutableSurface, p as Gate, v as GateResult, w as JudgeScore } from "./types-
|
|
5
|
+
import { R as Scenario, a as CampaignResult, b as GenerationRecord, h as GateContext, j as MutableSurface, p as Gate, v as GateResult, w as JudgeScore } from "./types-BBht9lpj.js";
|
|
6
6
|
import { a as PairedPromotionDecision, i as PairedMcNemarEvidence, r as PairedDecisionStatistic, t as PairedDecisionMethod } from "./paired-promotion-decision-DJlI4z_k.js";
|
|
7
7
|
import { z } from "zod";
|
|
8
8
|
declare const reservationSchema: z.ZodObject<{
|
|
@@ -999,4 +999,4 @@ declare function createCampaignEvidenceReceipt<S extends Scenario, A>(input: {
|
|
|
999
999
|
context: CampaignEvidenceContext;
|
|
1000
1000
|
}): EvidenceReceipt;
|
|
1001
1001
|
export { Objective as $, SequentialPairedGateOptions as A, signManifest as B, heldoutSignificance as C, FinalEvidenceError as Ct, SequentialGateDecision as D, FinalEvidenceRecord as Dt, SequentialDecideOptions as E, FinalEvidenceOutcome as Et, HypothesisResult as F, EvidenceVector as G, AxisEvidence as H, SignedManifest as I, PromotionObjective as J, ObjectiveSource as K, SignedManifestAlgo as L, sequentialDecide as M, sequentialPairedGate as N, SequentialObservation as O, FinalEvidenceReservation as Ot, HypothesisManifest as P, paretoSignificanceGate as Q, hashJson as R, dimensionRegressions as S, FinalEvidenceConflictError as St, SequentialDecideFn as T, FinalEvidenceMeasurement as Tt, AxisVerdict as U, verifyManifest as V, BuildEvidenceVectorOptions as W, buildEvidenceVector as X, PromotionPolicy as Y, paretoPolicy as Z, verifyAttestation as _, pairArms as _t, EvidenceAuthorityKind as a, powerPreflight as at, HeldoutSignificanceOptions as b, ArmPopulationReading as bt, EvidenceReceiptVerification as c, MatchedRunRecordPair as ct, verifyEvidenceReceipt as d, PairRunRecordsResult as dt, ParetoResult as et, ATTESTATION_ALGORITHM as f, PairedArmRow as ft, attest as g, comparePairedArms as gt, AttestedReport as h, PairedMetricDelta as ht, EvidenceAuthority as i, PowerPreflightOptions as it, SequentialStreamState as j, SequentialPairedGate as k, openFinalEvidenceLedger as kt, createEvidenceReceipt as l, PairArmsOptions as lt, AttestationVerification as m, PairedCorrectness as mt, createCampaignEvidenceReceipt as n, paretoFrontier as nt, EvidenceBinding as o, ComparePairedArmsOptions as ot, AttestationProvenance as p, PairedArmsComparison as pt, ParetoSignificanceGateOptions as q, CreateEvidenceReceiptInput as r, PowerPreflight as rt, EvidenceReceipt as s, MatchedPair as st, CampaignEvidenceContext as t, dominates as tt, isIndependentEvidence as u, PairArmsResult as ut, DimensionRegression as v, pairRunRecords as vt, pairHoldout as w, FinalEvidenceLedger as wt, PairedHoldout as x, ArmPopulationSummary as xt, HeldoutSignificance as y, ArmAssignment as yt, manifestContentDigest as z };
|
|
1002
|
-
//# sourceMappingURL=campaign-evidence-
|
|
1002
|
+
//# sourceMappingURL=campaign-evidence-p9QJoA1P.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"campaign-evidence-
|
|
1
|
+
{"version":3,"file":"campaign-evidence-p9QJoA1P.d.ts","names":["_$__evidence_receipt0.EvidenceReceipt"],"sources":["../src/experiment/final-evidence.ts","../src/arm-populations.ts","../src/paired-arms.ts","../src/campaign/gates/power-preflight.ts","../src/pareto.ts","../src/campaign/gates/promotion-policy.ts","../src/pre-registration.ts","../src/campaign/gates/sequential.ts","../src/campaign/gates/statistical-heldout.ts","../src/attestation.ts","../src/experiment/evidence-receipt.ts","../src/experiment/campaign-evidence.ts"],"mappings":";;;;;;;cASM,mBAAiB,EAAA;;;;;;;;GAUZ,EAAA,KAAA;;KAGC,2BAA2B,EAAE,aAAa;cAEhD,mBAAiB,EAAA;;;GAKZ,EAAA,KAAA;K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Message, s as ValidationError } from "./errors-DeEEV9Vx.js";
|
|
3
3
|
import { l as costForTokenPricing } from "./cost-ledger-ni6f77QJ.js";
|
|
4
|
-
import { i as replaySearchLedgerText } from "./search-ledger-
|
|
5
|
-
import { o as operatorYield, s as INSUFFICIENT_FROM } from "./search-kernel-
|
|
6
|
-
import { t as renderSearchSummary } from "./search-summary-
|
|
7
|
-
import { l as SEARCH_LEDGER_BATCH_MAX_BYTES, m as SearchRunKindSchema, r as shipSearchLedger, s as hostedTenantFromEnv, t as SearchShipConflictError } from "./search-shipper-
|
|
4
|
+
import { i as replaySearchLedgerText } from "./search-ledger-EjLGVZ4X.js";
|
|
5
|
+
import { o as operatorYield, s as INSUFFICIENT_FROM } from "./search-kernel-B1TEQ9pa.js";
|
|
6
|
+
import { t as renderSearchSummary } from "./search-summary-C5fewoUi.js";
|
|
7
|
+
import { l as SEARCH_LEDGER_BATCH_MAX_BYTES, m as SearchRunKindSchema, r as shipSearchLedger, s as hostedTenantFromEnv, t as SearchShipConflictError } from "./search-shipper-DtSnRfOJ.js";
|
|
8
8
|
import { n as createChatClient } from "./chat-client-TkNgQDLj.js";
|
|
9
9
|
import { a as privacyHit, f as appendRolloutLines, n as runRolloutReleaseCli, r as PRIVACY_RULE_NAMES, u as gateReceiptRolloutLines } from "./hf-dataset-B0s2ZAhQ.js";
|
|
10
10
|
import { i as harnessSessionRolloutLines, n as harnessSessionRefs } from "./harness-session-lines-CTh1-uOb.js";
|
|
11
|
-
import { B as renderSkillUsageTable, L as afterInvocation, R as buildSkillUsageReport,
|
|
11
|
+
import { B as renderSkillUsageTable, H as claudeCodeSkillSessions, J as withChangeLedger, L as afterInvocation, R as buildSkillUsageReport, V as codexSkillSessions, W as readSkillFile, q as readChangeLedger, t as runAnalystBenchmarkCommand, z as instant } from "./benchmark-command-BizGxhuU.js";
|
|
12
12
|
import { i as buildOpenApi, l as handleVersion, o as runRpcBatch, r as startServerAsync, s as runRpcOnce } from "./server-B-7vXS9T.js";
|
|
13
|
-
import { b as editCreditText, f as landscape, g as surfaceTextEdits, l as metaSearch, m as formatLandscape, n as taskMatrix, o as skillManifold, r as formatSkillManifold, s as renderMetaSearchText, t as tree, v as front, y as editCredit } from "./tree-
|
|
13
|
+
import { b as editCreditText, f as landscape, g as surfaceTextEdits, l as metaSearch, m as formatLandscape, n as taskMatrix, o as skillManifold, r as formatSkillManifold, s as renderMetaSearchText, t as tree, v as front, y as editCredit } from "./tree-CljLPWVm.js";
|
|
14
14
|
import { a as analyzeSupervisorRun, i as renderSupervisorRunMarkdown, r as renderSupervisorRunHeadline, t as runtimeRunRolloutLines } from "./runtime-rollouts-CE0MbQPq.js";
|
|
15
15
|
import { createHash } from "node:crypto";
|
|
16
16
|
import { existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
17
17
|
import { dirname, join, resolve } from "node:path";
|
|
18
|
-
import { fileURLToPath } from "node:url";
|
|
18
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
19
19
|
import { appendFile, open, readFile, rm, stat } from "node:fs/promises";
|
|
20
20
|
// src/cli-config.ts
|
|
21
21
|
/**
|
|
@@ -87,8 +87,9 @@ function nonEmpty(value) {
|
|
|
87
87
|
}
|
|
88
88
|
// src/skill-usage/command.ts
|
|
89
89
|
/**
|
|
90
|
-
* `agent-eval skill-usage <
|
|
91
|
-
* transcripts and prints the
|
|
90
|
+
* `agent-eval skill-usage <sessions-dir>` reads a directory of Claude Code
|
|
91
|
+
* transcripts (or, with `--harness codex`, Codex rollouts) and prints the
|
|
92
|
+
* skill-usage report.
|
|
92
93
|
*
|
|
93
94
|
* By default the JSON report goes to stdout and the short table to stderr, so
|
|
94
95
|
* `> report.json` keeps the report while the table stays on the terminal.
|
|
@@ -105,7 +106,7 @@ const FORMATS$2 = [
|
|
|
105
106
|
"json",
|
|
106
107
|
"table"
|
|
107
108
|
];
|
|
108
|
-
const USAGE$2 = "usage: agent-eval skill-usage <
|
|
109
|
+
const USAGE$2 = "usage: agent-eval skill-usage <sessions-dir> [--harness claude-code|codex] [--since <7d|36h|90m|ISO time>] [--format both|json|table] [--limit <rows>] [--pricing <rates.json>]";
|
|
109
110
|
const PROCESS_IO$2 = {
|
|
110
111
|
stdout: (text) => {
|
|
111
112
|
process.stdout.write(text);
|
|
@@ -114,6 +115,17 @@ const PROCESS_IO$2 = {
|
|
|
114
115
|
process.stderr.write(text);
|
|
115
116
|
}
|
|
116
117
|
};
|
|
118
|
+
/** The harnesses whose session stores the commands read. */
|
|
119
|
+
const SESSION_HARNESSES = ["claude-code", "codex"];
|
|
120
|
+
/** The sessions under a harness's store: Claude Code's projects directory, or Codex's sessions directory. */
|
|
121
|
+
function harnessSkillSessions(harness, directory, options) {
|
|
122
|
+
return harness === "codex" ? codexSkillSessions(directory, options) : claudeCodeSkillSessions(directory, options);
|
|
123
|
+
}
|
|
124
|
+
/** The value of `--harness`, checked. */
|
|
125
|
+
function parseHarness(raw) {
|
|
126
|
+
if (!SESSION_HARNESSES.includes(raw)) throw new Error(`--harness expects one of ${SESSION_HARNESSES.join("|")}, got ${JSON.stringify(raw)}`);
|
|
127
|
+
return raw;
|
|
128
|
+
}
|
|
117
129
|
const DURATION = /^(\d+(?:\.\d+)?)([dhm])$/;
|
|
118
130
|
const UNIT_MS = {
|
|
119
131
|
d: 864e5,
|
|
@@ -131,6 +143,7 @@ function parseSince(raw, nowMs) {
|
|
|
131
143
|
function parseArgs$3(argv) {
|
|
132
144
|
const args = {
|
|
133
145
|
directory: "",
|
|
146
|
+
harness: "claude-code",
|
|
134
147
|
since: null,
|
|
135
148
|
format: "both",
|
|
136
149
|
limit: 30,
|
|
@@ -143,7 +156,8 @@ function parseArgs$3(argv) {
|
|
|
143
156
|
};
|
|
144
157
|
for (let i = 0; i < argv.length; i++) {
|
|
145
158
|
const arg = argv[i];
|
|
146
|
-
if (arg === "--
|
|
159
|
+
if (arg === "--harness") args.harness = parseHarness(value(arg, ++i));
|
|
160
|
+
else if (arg === "--since") args.since = value(arg, ++i);
|
|
147
161
|
else if (arg === "--format") {
|
|
148
162
|
const raw = value(arg, ++i);
|
|
149
163
|
if (!FORMATS$2.includes(raw)) throw new Error(`--format expects one of ${FORMATS$2.join("|")}, got ${JSON.stringify(raw)}`);
|
|
@@ -203,7 +217,7 @@ async function runSkillUsageCommand(argv, io = PROCESS_IO$2) {
|
|
|
203
217
|
return 2;
|
|
204
218
|
}
|
|
205
219
|
try {
|
|
206
|
-
const report = await buildSkillUsageReport(
|
|
220
|
+
const report = await buildSkillUsageReport(harnessSkillSessions(args.harness, resolve(args.directory), sinceMs === void 0 ? {} : { sinceMs }), {
|
|
207
221
|
...sinceMs === void 0 ? {} : { sinceMs },
|
|
208
222
|
...rates === void 0 ? {} : { pricing: (model) => rates?.get(model) },
|
|
209
223
|
readSkillFile
|
|
@@ -220,6 +234,262 @@ async function runSkillUsageCommand(argv, io = PROCESS_IO$2) {
|
|
|
220
234
|
return 1;
|
|
221
235
|
}
|
|
222
236
|
}
|
|
237
|
+
// src/intent-record/derive.ts
|
|
238
|
+
/**
|
|
239
|
+
* Intent records from recorded sessions.
|
|
240
|
+
*
|
|
241
|
+
* A session's typed turns are cut into intents. A turn that a labeler calls a
|
|
242
|
+
* correction or a re-ask attaches to the intent already open; any other turn
|
|
243
|
+
* opens a new one and closes the open one. A turn nobody labeled opens a new
|
|
244
|
+
* intent, and the intent it closes then cannot say how many corrections it
|
|
245
|
+
* drew. The span of an intent runs from its opening turn to the turn that
|
|
246
|
+
* closes it, or to the session's end, and its cost and procedures are those of
|
|
247
|
+
* the events in that span.
|
|
248
|
+
*/
|
|
249
|
+
const sha256 = (text) => createHash("sha256").update(text).digest("hex");
|
|
250
|
+
function isCorrection(label) {
|
|
251
|
+
if (label === null) return null;
|
|
252
|
+
if (label.kind === "correction") return true;
|
|
253
|
+
return label.correction;
|
|
254
|
+
}
|
|
255
|
+
function cost(session, thread, options) {
|
|
256
|
+
const after = afterInvocation(session, thread.startEvent - 1, thread.startAt, options, {
|
|
257
|
+
eventIndex: thread.endEvent,
|
|
258
|
+
at: thread.endAt
|
|
259
|
+
});
|
|
260
|
+
return {
|
|
261
|
+
tokens: after.modelCalls > 0 && after.modelCallsWithoutUsage === 0 ? after.tokens.total : null,
|
|
262
|
+
usd: after.pricedModelCalls > 0 && after.unpricedModelCalls === 0 ? after.costUsd : null,
|
|
263
|
+
wallMs: after.wallMs,
|
|
264
|
+
modelCalls: after.modelCalls
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
function refsInSpan(session, from, to) {
|
|
268
|
+
if (session.changes === void 0) return void 0;
|
|
269
|
+
const position = /* @__PURE__ */ new Map();
|
|
270
|
+
session.events.forEach((event, index) => {
|
|
271
|
+
if (event.kind === "tool") position.set(event.id, index);
|
|
272
|
+
else if (event.kind === "skill") position.set(event.callId, index);
|
|
273
|
+
});
|
|
274
|
+
const refs = /* @__PURE__ */ new Set();
|
|
275
|
+
for (const change of session.changes) {
|
|
276
|
+
const index = position.get(change.callId);
|
|
277
|
+
if (index !== void 0 && index >= from && index < to) refs.add(change.ref);
|
|
278
|
+
}
|
|
279
|
+
return [...refs].sort();
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* Cut one session's typed turns into intents. Returns none when the reader
|
|
283
|
+
* records no typed turns, and the caller counts that session apart.
|
|
284
|
+
*/
|
|
285
|
+
async function deriveSessionIntents(session, labeler, options, ignore) {
|
|
286
|
+
if (session.turns === void 0) return null;
|
|
287
|
+
const threads = [];
|
|
288
|
+
let open = null;
|
|
289
|
+
let previousText = null;
|
|
290
|
+
const close = (thread, by, at, event) => {
|
|
291
|
+
thread.closedBy = by;
|
|
292
|
+
thread.endAt = at;
|
|
293
|
+
thread.endEvent = event;
|
|
294
|
+
};
|
|
295
|
+
for (const [index, turn] of session.turns.entries()) {
|
|
296
|
+
if (options.sinceMs !== void 0) {
|
|
297
|
+
const at = instant(turn.at);
|
|
298
|
+
if (at === null || at < options.sinceMs) continue;
|
|
299
|
+
}
|
|
300
|
+
const context = {
|
|
301
|
+
harness: session.harness,
|
|
302
|
+
sessionId: session.sessionId,
|
|
303
|
+
index,
|
|
304
|
+
at: turn.at,
|
|
305
|
+
text: turn.text,
|
|
306
|
+
previousText
|
|
307
|
+
};
|
|
308
|
+
if (ignore?.(context) === true) continue;
|
|
309
|
+
const label = labeler === void 0 ? null : await labeler(context);
|
|
310
|
+
previousText = turn.text;
|
|
311
|
+
const correction = isCorrection(label);
|
|
312
|
+
const reask = label === null ? null : label.reask;
|
|
313
|
+
const attaches = open !== null && (correction === true || reask === true);
|
|
314
|
+
if (open !== null) {
|
|
315
|
+
if (correction === null) open.correctionsKnown = false;
|
|
316
|
+
else if (correction) open.corrections += 1;
|
|
317
|
+
if (reask === null) open.reasksKnown = false;
|
|
318
|
+
else if (reask) open.reasks += 1;
|
|
319
|
+
}
|
|
320
|
+
if (attaches && open !== null) {
|
|
321
|
+
open.userTurns += 1;
|
|
322
|
+
continue;
|
|
323
|
+
}
|
|
324
|
+
if (open !== null) close(open, "next-intent", turn.at, turn.eventIndex);
|
|
325
|
+
open = {
|
|
326
|
+
openedAtIndex: index,
|
|
327
|
+
startEvent: turn.eventIndex,
|
|
328
|
+
startAt: turn.at,
|
|
329
|
+
promptSha256: sha256(turn.text),
|
|
330
|
+
promptChars: turn.text.length,
|
|
331
|
+
turnId: turn.id,
|
|
332
|
+
label,
|
|
333
|
+
userTurns: 1,
|
|
334
|
+
corrections: 0,
|
|
335
|
+
reasks: 0,
|
|
336
|
+
correctionsKnown: true,
|
|
337
|
+
reasksKnown: true,
|
|
338
|
+
endEvent: session.events.length,
|
|
339
|
+
endAt: session.endedAt,
|
|
340
|
+
closedBy: "session-end"
|
|
341
|
+
};
|
|
342
|
+
threads.push(open);
|
|
343
|
+
}
|
|
344
|
+
return threads.map((thread) => {
|
|
345
|
+
return {
|
|
346
|
+
record: {
|
|
347
|
+
intentId: sha256(`${session.harness}\u0000${session.sessionId}\u0000${thread.turnId}`),
|
|
348
|
+
harness: session.harness,
|
|
349
|
+
sessionId: session.sessionId,
|
|
350
|
+
at: thread.startAt,
|
|
351
|
+
prompt: {
|
|
352
|
+
sha256: thread.promptSha256,
|
|
353
|
+
chars: thread.promptChars
|
|
354
|
+
},
|
|
355
|
+
label: thread.label === null ? null : {
|
|
356
|
+
source: thread.label.source,
|
|
357
|
+
kind: thread.label.kind,
|
|
358
|
+
done: thread.label.done
|
|
359
|
+
},
|
|
360
|
+
cost: cost(session, thread, options),
|
|
361
|
+
end: {
|
|
362
|
+
userTurns: thread.userTurns,
|
|
363
|
+
corrections: thread.correctionsKnown ? thread.corrections : null,
|
|
364
|
+
reasks: thread.reasksKnown ? thread.reasks : null,
|
|
365
|
+
closedBy: thread.closedBy
|
|
366
|
+
}
|
|
367
|
+
},
|
|
368
|
+
span: {
|
|
369
|
+
from: thread.startEvent,
|
|
370
|
+
to: thread.endEvent
|
|
371
|
+
},
|
|
372
|
+
window: {
|
|
373
|
+
from: thread.startAt,
|
|
374
|
+
to: thread.closedBy === "next-intent" ? thread.endAt : null
|
|
375
|
+
},
|
|
376
|
+
changeRefs: refsInSpan(session, thread.startEvent, thread.endEvent)
|
|
377
|
+
};
|
|
378
|
+
});
|
|
379
|
+
}
|
|
380
|
+
/** Whether a change reading says the change reached its done line: merged and not fixed within the window. */
|
|
381
|
+
function changesReachedDone(changes) {
|
|
382
|
+
if (changes.status !== "joined" || changes.outcomes.length === 0) return {
|
|
383
|
+
reachedDone: null,
|
|
384
|
+
abandoned: null
|
|
385
|
+
};
|
|
386
|
+
const outcomes = changes.outcomes;
|
|
387
|
+
const unmerged = outcomes.some((outcome) => outcome.merged === false);
|
|
388
|
+
const fixed = outcomes.some((outcome) => outcome.merged === true && outcome.hotfixed === true);
|
|
389
|
+
const clean = outcomes.every((outcome) => outcome.merged === true && outcome.hotfixed === false);
|
|
390
|
+
return {
|
|
391
|
+
reachedDone: unmerged || fixed ? false : clean ? true : null,
|
|
392
|
+
abandoned: unmerged ? true : outcomes.every((o) => o.merged === true) ? false : null
|
|
393
|
+
};
|
|
394
|
+
}
|
|
395
|
+
// src/intent-record/contract.ts
|
|
396
|
+
const INTENT_KINDS = [
|
|
397
|
+
"task",
|
|
398
|
+
"problem",
|
|
399
|
+
"project",
|
|
400
|
+
"information",
|
|
401
|
+
"correction"
|
|
402
|
+
];
|
|
403
|
+
// src/intent-record/report.ts
|
|
404
|
+
const NOTES$1 = [
|
|
405
|
+
"Intents are cut from typed turns: a turn a labeler calls a correction or a re-ask attaches to the open intent, and any other turn, labeled or not, opens a new one. Without labels every turn is its own intent and no intent knows its corrections.",
|
|
406
|
+
"An intent joins the changes whose tool call lies in its span, in its own session only. Work and changes in subagents count toward the procedures that served it, by time, and not toward its cost or changes.",
|
|
407
|
+
"reachedDone comes from the outcome of the intent’s changes when they have one, else is true when the person moved on to another intent, else unknown. A session that ends says nothing."
|
|
408
|
+
];
|
|
409
|
+
function joinChanges(refs, outcomes) {
|
|
410
|
+
if (refs === void 0) return { status: "not-recorded" };
|
|
411
|
+
if (refs.length === 0) return { status: "none" };
|
|
412
|
+
return {
|
|
413
|
+
status: "joined",
|
|
414
|
+
refs,
|
|
415
|
+
outcomes: refs.flatMap((ref) => {
|
|
416
|
+
const reading = outcomes.byRef.get(ref);
|
|
417
|
+
return reading === void 0 ? [] : [reading];
|
|
418
|
+
})
|
|
419
|
+
};
|
|
420
|
+
}
|
|
421
|
+
function buildIntentReport(sessions, outcomes) {
|
|
422
|
+
const byId = new Map(sessions.map((session) => [session.sessionId, session]));
|
|
423
|
+
const inherited = /* @__PURE__ */ new Map();
|
|
424
|
+
for (const session of sessions) for (let parent = session.parentSessionId, hops = 0; parent !== null && hops < 64; parent = byId.get(parent)?.parentSessionId ?? null, hops++) for (const draft of byId.get(parent)?.drafts ?? []) {
|
|
425
|
+
const from = instant(draft.window.from);
|
|
426
|
+
const to = instant(draft.window.to);
|
|
427
|
+
if (from === null) continue;
|
|
428
|
+
for (const invocation of session.invocations) {
|
|
429
|
+
const at = instant(invocation.at);
|
|
430
|
+
if (at === null || at < from || to !== null && at >= to) continue;
|
|
431
|
+
const keys = inherited.get(draft) ?? /* @__PURE__ */ new Set();
|
|
432
|
+
keys.add(invocation.key);
|
|
433
|
+
inherited.set(draft, keys);
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
const intents = [];
|
|
437
|
+
let sessionsWithTurns = 0;
|
|
438
|
+
let sessionsWithoutTurns = 0;
|
|
439
|
+
for (const session of sessions) {
|
|
440
|
+
if (session.drafts === null) {
|
|
441
|
+
sessionsWithoutTurns += 1;
|
|
442
|
+
continue;
|
|
443
|
+
}
|
|
444
|
+
sessionsWithTurns += 1;
|
|
445
|
+
for (const draft of session.drafts) {
|
|
446
|
+
const keys = new Set(inherited.get(draft));
|
|
447
|
+
for (const invocation of session.invocations) if (invocation.index >= draft.span.from && invocation.index < draft.span.to) keys.add(invocation.key);
|
|
448
|
+
const changes = joinChanges(draft.changeRefs, outcomes);
|
|
449
|
+
const fromChanges = changesReachedDone(changes);
|
|
450
|
+
const movedOn = draft.record.end.closedBy === "next-intent";
|
|
451
|
+
const evidence = fromChanges.reachedDone !== null ? "change-outcome" : movedOn ? "moved-on" : "none";
|
|
452
|
+
intents.push({
|
|
453
|
+
...draft.record,
|
|
454
|
+
procedures: [...keys].sort(),
|
|
455
|
+
end: {
|
|
456
|
+
...draft.record.end,
|
|
457
|
+
reachedDone: fromChanges.reachedDone ?? (movedOn ? true : null),
|
|
458
|
+
abandoned: fromChanges.abandoned,
|
|
459
|
+
evidence
|
|
460
|
+
},
|
|
461
|
+
changes
|
|
462
|
+
});
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
const kinds = [...INTENT_KINDS, null];
|
|
466
|
+
const share = (part, whole) => whole === 0 ? null : part / whole;
|
|
467
|
+
const known = (record) => record.end.reachedDone !== null;
|
|
468
|
+
return {
|
|
469
|
+
intents,
|
|
470
|
+
summary: {
|
|
471
|
+
intents: intents.length,
|
|
472
|
+
sessionsWithTurns,
|
|
473
|
+
sessionsWithoutTurns,
|
|
474
|
+
labeled: intents.filter((record) => record.label !== null).length,
|
|
475
|
+
knownEnd: intents.filter(known).length,
|
|
476
|
+
knownEndShare: share(intents.filter(known).length, intents.length),
|
|
477
|
+
byKind: kinds.map((kind) => {
|
|
478
|
+
const of = intents.filter((record) => (record.label?.kind ?? null) === kind);
|
|
479
|
+
return {
|
|
480
|
+
kind,
|
|
481
|
+
intents: of.length,
|
|
482
|
+
knownEnd: of.filter(known).length,
|
|
483
|
+
knownEndShare: share(of.filter(known).length, of.length),
|
|
484
|
+
knownCorrections: of.filter((record) => record.end.corrections !== null).length,
|
|
485
|
+
joinedToChange: of.filter((record) => record.changes.status === "joined").length,
|
|
486
|
+
withChangeOutcome: of.filter((record) => record.changes.status === "joined" && record.changes.outcomes.length > 0).length
|
|
487
|
+
};
|
|
488
|
+
})
|
|
489
|
+
},
|
|
490
|
+
notes: [...NOTES$1]
|
|
491
|
+
};
|
|
492
|
+
}
|
|
223
493
|
/**
|
|
224
494
|
* Index outcomes by change reference. An outcome judged over another window
|
|
225
495
|
* keeps `merged` and `gateGreenFirstTry` and loses `hotfixed`: a 3-day and a
|
|
@@ -445,6 +715,7 @@ function addSearch(registry, search, keys, options) {
|
|
|
445
715
|
});
|
|
446
716
|
for (const cell of search.cells({ nodeId: node.nodeId })) {
|
|
447
717
|
if (cell.attempts === 0) continue;
|
|
718
|
+
const onSeat = cell.subscriptionAttempts === cell.attempts;
|
|
448
719
|
builder.executions.push({
|
|
449
720
|
source: "search-cell",
|
|
450
721
|
searchId: search.searchId,
|
|
@@ -455,7 +726,8 @@ function addSearch(registry, search, keys, options) {
|
|
|
455
726
|
outcome: cell.outcome,
|
|
456
727
|
score: cell.score,
|
|
457
728
|
tokens: cell.tokensKnown ? cell.tokens.inputTokens + cell.tokens.outputTokens + cell.tokens.cachedTokens : null,
|
|
458
|
-
usd: cell.costKnown ? cell.spentUsd : null,
|
|
729
|
+
usd: cell.costKnown && !onSeat ? cell.spentUsd : null,
|
|
730
|
+
costBasis: !cell.costKnown ? "unknown" : onSeat ? "subscription" : "measured",
|
|
459
731
|
wallMs: cell.wallKnown ? cell.wallMs : null
|
|
460
732
|
});
|
|
461
733
|
}
|
|
@@ -504,6 +776,7 @@ async function buildProcedureRegistry(input, options = {}) {
|
|
|
504
776
|
unreadable: 0,
|
|
505
777
|
withInvocation: 0
|
|
506
778
|
};
|
|
779
|
+
const intentSessions = [];
|
|
507
780
|
const versionDigest = (event) => {
|
|
508
781
|
if (event.version !== null) return event.version.bodySha256;
|
|
509
782
|
if (event.skillFile === null || options.readSkillFile === void 0) return null;
|
|
@@ -526,6 +799,7 @@ async function buildProcedureRegistry(input, options = {}) {
|
|
|
526
799
|
refs: session.changes?.map((change) => change.ref)
|
|
527
800
|
});
|
|
528
801
|
let counted = false;
|
|
802
|
+
const placed = [];
|
|
529
803
|
session.events.forEach((event, position) => {
|
|
530
804
|
if (event.kind !== "skill") return;
|
|
531
805
|
if (seenCalls.has(event.callId)) return;
|
|
@@ -540,6 +814,11 @@ async function buildProcedureRegistry(input, options = {}) {
|
|
|
540
814
|
const builder = registry.builder(key);
|
|
541
815
|
builder.names.add(event.skill);
|
|
542
816
|
builder.kind ??= options.kindOfSkill?.(event.skill) ?? "skill";
|
|
817
|
+
placed.push({
|
|
818
|
+
index: position,
|
|
819
|
+
at: event.at,
|
|
820
|
+
key
|
|
821
|
+
});
|
|
543
822
|
const after = afterInvocation(session, position, event.at, options);
|
|
544
823
|
pending.push({
|
|
545
824
|
builderKey: key,
|
|
@@ -554,6 +833,12 @@ async function buildProcedureRegistry(input, options = {}) {
|
|
|
554
833
|
});
|
|
555
834
|
});
|
|
556
835
|
if (counted) sessions.withInvocation += 1;
|
|
836
|
+
if (options.intents !== void 0) intentSessions.push({
|
|
837
|
+
sessionId: session.sessionId,
|
|
838
|
+
parentSessionId: session.parentSessionId,
|
|
839
|
+
drafts: await deriveSessionIntents(session, options.intents.labeler, options, options.intents.ignore),
|
|
840
|
+
invocations: placed
|
|
841
|
+
});
|
|
557
842
|
}
|
|
558
843
|
const joins = {
|
|
559
844
|
joined: 0,
|
|
@@ -590,6 +875,7 @@ async function buildProcedureRegistry(input, options = {}) {
|
|
|
590
875
|
passed: 0,
|
|
591
876
|
failed: 0,
|
|
592
877
|
errored: 0,
|
|
878
|
+
subscription: 0,
|
|
593
879
|
tokens: emptyMeasure(),
|
|
594
880
|
usd: emptyMeasure(),
|
|
595
881
|
wallMs: emptyMeasure()
|
|
@@ -607,7 +893,8 @@ async function buildProcedureRegistry(input, options = {}) {
|
|
|
607
893
|
else if (execution.outcome === "failed") cells.failed += 1;
|
|
608
894
|
else if (execution.outcome === "errored") cells.errored += 1;
|
|
609
895
|
addMeasure(cells.tokens, execution.tokens);
|
|
610
|
-
|
|
896
|
+
if (execution.costBasis === "subscription") cells.subscription += 1;
|
|
897
|
+
else addMeasure(cells.usd, execution.usd);
|
|
611
898
|
addMeasure(cells.wallMs, execution.wallMs);
|
|
612
899
|
} else {
|
|
613
900
|
sessionRuns.invocations += 1;
|
|
@@ -657,6 +944,7 @@ async function buildProcedureRegistry(input, options = {}) {
|
|
|
657
944
|
outcomesInWrongWindow: outcomes.otherWindow
|
|
658
945
|
},
|
|
659
946
|
versions,
|
|
947
|
+
intents: options.intents === void 0 ? null : buildIntentReport(intentSessions, outcomes),
|
|
660
948
|
unreadable,
|
|
661
949
|
notes: [...NOTES]
|
|
662
950
|
};
|
|
@@ -684,6 +972,7 @@ function renderProcedureRegistryTable(registry, limit = 30) {
|
|
|
684
972
|
`${registry.versions.length} procedure versions; ${registry.invocations} invocations in ${registry.sessions.read} sessions (${registry.sessions.unreadable} unreadable); ${registry.searches.read} searches`,
|
|
685
973
|
`joined to a change: ${join.joined} of ${join.invocations} invocations (${percent(join.joinedShare)}); none ${join.none}, not recorded ${join.notRecorded}`,
|
|
686
974
|
`with an outcome for a change: ${join.withOutcome} (${percent(join.withOutcomeShare)}); ${join.distinctChanges} distinct changes, ${join.outcomesSupplied} outcomes supplied (hot-fix window ${join.hotfixWindowDays} days)`,
|
|
975
|
+
`cells on a subscription seat (a known basis with no dollar figure): ${registry.versions.reduce((n, v) => n + v.cells.subscription, 0)}`,
|
|
687
976
|
"",
|
|
688
977
|
"version kind names cells runs chg-joined merged y/n/? hotfix y/n/? tokens(runs) decided"
|
|
689
978
|
];
|
|
@@ -704,13 +993,38 @@ function renderProcedureRegistryTable(registry, limit = 30) {
|
|
|
704
993
|
].join(" "));
|
|
705
994
|
}
|
|
706
995
|
if (registry.versions.length > limit) lines.push(`... ${registry.versions.length - limit} more versions in the JSON`);
|
|
996
|
+
const intents = registry.intents;
|
|
997
|
+
if (intents !== null) {
|
|
998
|
+
const summary = intents.summary;
|
|
999
|
+
lines.push("", `${summary.intents} intents in ${summary.sessionsWithTurns} sessions (${summary.sessionsWithoutTurns} record no typed turns); ${summary.labeled} labeled; known end ${summary.knownEnd} (${percent(summary.knownEndShare)})`, "kind intents known-end share corrections-known joined-to-change with-outcome");
|
|
1000
|
+
for (const row of summary.byKind) {
|
|
1001
|
+
if (row.intents === 0) continue;
|
|
1002
|
+
lines.push([
|
|
1003
|
+
(row.kind ?? "unlabeled").padEnd(12),
|
|
1004
|
+
String(row.intents).padStart(8),
|
|
1005
|
+
String(row.knownEnd).padStart(10),
|
|
1006
|
+
percent(row.knownEndShare).padStart(7),
|
|
1007
|
+
String(row.knownCorrections).padStart(18),
|
|
1008
|
+
String(row.joinedToChange).padStart(17),
|
|
1009
|
+
String(row.withChangeOutcome).padStart(13)
|
|
1010
|
+
].join(" "));
|
|
1011
|
+
}
|
|
1012
|
+
for (const note of intents.notes) lines.push("", `note: ${note}`);
|
|
1013
|
+
}
|
|
707
1014
|
for (const note of registry.notes) lines.push("", `note: ${note}`);
|
|
708
1015
|
return `${lines.join("\n")}\n`;
|
|
709
1016
|
}
|
|
710
1017
|
// src/procedure-registry/command.ts
|
|
711
1018
|
/**
|
|
712
1019
|
* `agent-eval procedure-registry <sessions-dir>` prints the procedure registry
|
|
713
|
-
* for a directory of Claude Code transcripts
|
|
1020
|
+
* for a directory of Claude Code transcripts (or, with `--harness codex`, Codex
|
|
1021
|
+
* rollouts) and any number of search ledgers.
|
|
1022
|
+
*
|
|
1023
|
+
* `--change-ledger <file>` (repeatable) names a change ledger, the harness's own
|
|
1024
|
+
* record of each commit and pull request a session made (see
|
|
1025
|
+
* `src/skill-usage/change-ledger.ts`). A session the ledger observed has exactly
|
|
1026
|
+
* the changes it lists; a session it never saw has only what its transcript
|
|
1027
|
+
* shows, and none recorded when the transcript shows none.
|
|
714
1028
|
*
|
|
715
1029
|
* `--outcomes <file>` names a JSON array of {@link ChangeOutcome}: what the
|
|
716
1030
|
* caller knows of each change the sessions produced. Without it every change is
|
|
@@ -725,7 +1039,7 @@ const FORMATS$1 = [
|
|
|
725
1039
|
"json",
|
|
726
1040
|
"table"
|
|
727
1041
|
];
|
|
728
|
-
const USAGE$1 = "usage: agent-eval procedure-registry <sessions-dir> [--ledger <search-ledger.jsonl>]... [--since <7d|36h|90m|ISO time>] [--outcomes <changes.json>] [--format both|json|table] [--limit <rows>] [--pricing <rates.json>]";
|
|
1042
|
+
const USAGE$1 = "usage: agent-eval procedure-registry <sessions-dir> [--harness claude-code|codex] [--ledger <search-ledger.jsonl>]... [--since <7d|36h|90m|ISO time>] [--outcomes <changes.json>] [--change-ledger <changes.jsonl>]... [--intents [<labeler.mjs>]] [--format both|json|table] [--limit <rows>] [--pricing <rates.json>]";
|
|
729
1043
|
const PROCESS_IO$1 = {
|
|
730
1044
|
stdout: (text) => {
|
|
731
1045
|
process.stdout.write(text);
|
|
@@ -737,9 +1051,12 @@ const PROCESS_IO$1 = {
|
|
|
737
1051
|
function parseArgs$2(argv) {
|
|
738
1052
|
const args = {
|
|
739
1053
|
directory: "",
|
|
1054
|
+
harness: "claude-code",
|
|
740
1055
|
ledgers: [],
|
|
741
1056
|
since: null,
|
|
742
1057
|
outcomes: null,
|
|
1058
|
+
changeLedgers: [],
|
|
1059
|
+
intents: null,
|
|
743
1060
|
format: "both",
|
|
744
1061
|
limit: 30,
|
|
745
1062
|
pricing: null
|
|
@@ -751,10 +1068,17 @@ function parseArgs$2(argv) {
|
|
|
751
1068
|
};
|
|
752
1069
|
for (let i = 0; i < argv.length; i++) {
|
|
753
1070
|
const arg = argv[i];
|
|
754
|
-
if (arg === "--
|
|
1071
|
+
if (arg === "--harness") args.harness = parseHarness(value(arg, ++i));
|
|
1072
|
+
else if (arg === "--ledger") args.ledgers.push(value(arg, ++i));
|
|
755
1073
|
else if (arg === "--since") args.since = value(arg, ++i);
|
|
756
1074
|
else if (arg === "--outcomes") args.outcomes = value(arg, ++i);
|
|
757
|
-
else if (arg === "--
|
|
1075
|
+
else if (arg === "--change-ledger") args.changeLedgers.push(value(arg, ++i));
|
|
1076
|
+
else if (arg === "--intents") {
|
|
1077
|
+
const next = argv[i + 1];
|
|
1078
|
+
const labeler = next !== void 0 && !next.startsWith("--") ? next : null;
|
|
1079
|
+
if (labeler !== null) i += 1;
|
|
1080
|
+
args.intents = { labeler };
|
|
1081
|
+
} else if (arg === "--pricing") args.pricing = value(arg, ++i);
|
|
758
1082
|
else if (arg === "--format") {
|
|
759
1083
|
const raw = value(arg, ++i);
|
|
760
1084
|
if (!FORMATS$1.includes(raw)) throw new Error(`--format expects one of ${FORMATS$1.join("|")}, got ${JSON.stringify(raw)}`);
|
|
@@ -792,6 +1116,15 @@ function readOutcomes(path) {
|
|
|
792
1116
|
};
|
|
793
1117
|
});
|
|
794
1118
|
}
|
|
1119
|
+
/** A labeler module: its default export is an {@link IntentLabeler}. It lives with the caller, where the labels and the words they read do. */
|
|
1120
|
+
async function loadLabeler(path) {
|
|
1121
|
+
const loaded = await import(pathToFileURL(resolve(path)).href);
|
|
1122
|
+
if (typeof loaded.default !== "function") throw new Error(`--intents ${path}: the module must export a labeler function as its default`);
|
|
1123
|
+
return {
|
|
1124
|
+
labeler: loaded.default,
|
|
1125
|
+
...typeof loaded.ignore === "function" ? { ignore: loaded.ignore } : {}
|
|
1126
|
+
};
|
|
1127
|
+
}
|
|
795
1128
|
async function readLedger(path) {
|
|
796
1129
|
const text = await readFile(path, "utf8");
|
|
797
1130
|
const first = JSON.parse(text.slice(0, Math.max(0, text.indexOf("\n"))));
|
|
@@ -817,14 +1150,20 @@ async function runProcedureRegistryCommand(argv, io = PROCESS_IO$1) {
|
|
|
817
1150
|
return 2;
|
|
818
1151
|
}
|
|
819
1152
|
try {
|
|
1153
|
+
const labeler = args.intents?.labeler == null ? void 0 : await loadLabeler(args.intents.labeler);
|
|
1154
|
+
const searches = await Promise.all(args.ledgers.map((path) => readLedger(resolve(path))));
|
|
1155
|
+
const changeLedger = args.changeLedgers.length === 0 ? void 0 : await readChangeLedger(args.changeLedgers.map((path) => resolve(path)));
|
|
1156
|
+
if (changeLedger !== void 0 && changeLedger.malformed > 0) io.stderr(`change ledger: ${changeLedger.malformed} lines are not rows and were not read\n`);
|
|
1157
|
+
const transcripts = harnessSkillSessions(args.harness, resolve(args.directory), sinceMs === void 0 ? {} : { sinceMs });
|
|
820
1158
|
const registry = await buildProcedureRegistry({
|
|
821
|
-
searches
|
|
822
|
-
sessions:
|
|
1159
|
+
searches,
|
|
1160
|
+
sessions: changeLedger === void 0 ? transcripts : withChangeLedger(transcripts, changeLedger),
|
|
823
1161
|
outcomes
|
|
824
1162
|
}, {
|
|
825
1163
|
...sinceMs === void 0 ? {} : { sinceMs },
|
|
826
1164
|
...rates === void 0 ? {} : { pricing: (model) => rates?.get(model) },
|
|
827
|
-
readSkillFile
|
|
1165
|
+
readSkillFile,
|
|
1166
|
+
...args.intents === null ? {} : { intents: { ...labeler } }
|
|
828
1167
|
});
|
|
829
1168
|
const table = renderProcedureRegistryTable(registry, args.limit);
|
|
830
1169
|
if (args.format === "table") io.stdout(table);
|
|
@@ -1462,7 +1801,7 @@ async function runSupervisorRunCommand(argv, io = PROCESS_IO) {
|
|
|
1462
1801
|
* agent-eval search ship <search-ledger.jsonl> --run-kind optimization|eval
|
|
1463
1802
|
* agent-eval search show <search-ledger.jsonl>
|
|
1464
1803
|
* agent-eval skill-usage <transcripts-dir> [--since 7d]
|
|
1465
|
-
* agent-eval procedure-registry <sessions-dir> [--ledger <path>]... [--since 30d] [--outcomes <file>]
|
|
1804
|
+
* agent-eval procedure-registry <sessions-dir> [--ledger <path>]... [--since 30d] [--outcomes <file>] [--change-ledger <file>]...
|
|
1466
1805
|
* agent-eval openapi [--out path] # write OpenAPI spec
|
|
1467
1806
|
* agent-eval version
|
|
1468
1807
|
*
|
|
@@ -1538,11 +1877,14 @@ Commands:
|
|
|
1538
1877
|
version: invocations by agent, user and harness, sessions, and the tool
|
|
1539
1878
|
calls, tool errors, tokens, wall time and cost after its first invocation.
|
|
1540
1879
|
The JSON report goes to stdout and the table to stderr.
|
|
1541
|
-
procedure-registry <sessions-dir> [--ledger <search-ledger.jsonl>]... [--since <7d|36h|90m|ISO time>] [--outcomes <changes.json>] [--format both|json|table] [--limit <rows>] [--pricing <rates.json>]
|
|
1880
|
+
procedure-registry <sessions-dir> [--ledger <search-ledger.jsonl>]... [--since <7d|36h|90m|ISO time>] [--outcomes <changes.json>] [--change-ledger <changes.jsonl>]... [--intents [<labeler.mjs>]] [--format both|json|table] [--limit <rows>] [--pricing <rates.json>]
|
|
1542
1881
|
Join search ledgers and recorded Claude Code sessions on the version digest:
|
|
1543
1882
|
per procedure version, its lineage, every execution, tokens, cost and wall
|
|
1544
1883
|
time, the outcome of the changes its sessions produced, and the decisions
|
|
1545
|
-
taken on it.
|
|
1884
|
+
taken on it. With --intents, also each typed turn's intent: the versions
|
|
1885
|
+
that served it, its cost and how it ended; the labeler module's default
|
|
1886
|
+
export labels turns, and without one no turn has a kind or a correction.
|
|
1887
|
+
The JSON registry goes to stdout and the table to stderr.
|
|
1546
1888
|
version
|
|
1547
1889
|
Print server + wire-protocol version JSON.
|
|
1548
1890
|
|