@tangle-network/agent-eval 0.83.0 → 0.85.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/dist/belief-state/index.d.ts +82 -2
- package/dist/belief-state/index.js +293 -4
- package/dist/belief-state/index.js.map +1 -1
- package/dist/chunk-T4SQEITX.js +95 -0
- package/dist/chunk-T4SQEITX.js.map +1 -0
- package/dist/index.d.ts +192 -1
- package/dist/index.js +235 -7
- package/dist/index.js.map +1 -1
- package/dist/openapi.json +1 -1
- package/dist/runtime-trajectory-BLRiaifm.d.ts +49 -0
- package/docs/building-doctrine.md +42 -0
- package/docs/research/belief-state-agent-eval-roadmap.md +3 -0
- package/package.json +13 -26
package/dist/openapi.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"openapi": "3.1.0",
|
|
3
3
|
"info": {
|
|
4
4
|
"title": "@tangle-network/agent-eval — wire protocol",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.85.0",
|
|
6
6
|
"description": "HTTP and stdio RPC interface to agent-eval. The TypeScript runtime is the source of truth; this spec is the contract that cross-language clients (Python, Rust, Go) generate from.\n\nWire-protocol version: 1.0.0. Bumps on breaking changes to request/response schemas.",
|
|
7
7
|
"contact": {
|
|
8
8
|
"name": "Tangle Network",
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { a as RunSplitTag } from './run-record-De9VarXR.js';
|
|
2
|
+
|
|
3
|
+
interface RuntimeTrajectoryHookEvent {
|
|
4
|
+
id: string;
|
|
5
|
+
runId: string;
|
|
6
|
+
scenarioId?: string;
|
|
7
|
+
target: string;
|
|
8
|
+
phase: string;
|
|
9
|
+
timestamp: number;
|
|
10
|
+
stepIndex?: number;
|
|
11
|
+
parentId?: string;
|
|
12
|
+
payload?: unknown;
|
|
13
|
+
metadata?: Record<string, unknown>;
|
|
14
|
+
}
|
|
15
|
+
interface RuntimeTrajectoryRecord {
|
|
16
|
+
id?: string;
|
|
17
|
+
scenarioId?: string;
|
|
18
|
+
splitTag?: RunSplitTag;
|
|
19
|
+
runtimeEvents?: unknown;
|
|
20
|
+
[key: string]: unknown;
|
|
21
|
+
}
|
|
22
|
+
interface RuntimeTrajectoryRunRecord {
|
|
23
|
+
runId: string;
|
|
24
|
+
scenarioId?: string;
|
|
25
|
+
splitTag: RunSplitTag;
|
|
26
|
+
}
|
|
27
|
+
interface RuntimeTrajectoryEvidenceSummary {
|
|
28
|
+
recordCount: number;
|
|
29
|
+
recordWithRuntimeEventsCount: number;
|
|
30
|
+
runtimeRunCount: number;
|
|
31
|
+
lifecycleEventCount: number;
|
|
32
|
+
defaultedSplitCount: number;
|
|
33
|
+
}
|
|
34
|
+
interface RuntimeTrajectoryEvidenceProjection {
|
|
35
|
+
runs: RuntimeTrajectoryRunRecord[];
|
|
36
|
+
events: RuntimeTrajectoryHookEvent[];
|
|
37
|
+
summary: RuntimeTrajectoryEvidenceSummary;
|
|
38
|
+
diagnostics: string[];
|
|
39
|
+
}
|
|
40
|
+
interface ProjectRuntimeTrajectoryEvidenceOptions<TRecord extends RuntimeTrajectoryRecord = RuntimeTrajectoryRecord> {
|
|
41
|
+
records: TRecord[];
|
|
42
|
+
defaultSplitTag?: RunSplitTag;
|
|
43
|
+
recordIdOf?: (record: TRecord, index: number) => string | undefined;
|
|
44
|
+
scenarioIdOf?: (record: TRecord, index: number) => string | undefined;
|
|
45
|
+
}
|
|
46
|
+
declare function projectRuntimeTrajectoryEvidence<TRecord extends RuntimeTrajectoryRecord>(options: ProjectRuntimeTrajectoryEvidenceOptions<TRecord>): RuntimeTrajectoryEvidenceProjection;
|
|
47
|
+
declare function parseRuntimeTrajectoryHookEvent(input: unknown): RuntimeTrajectoryHookEvent | null;
|
|
48
|
+
|
|
49
|
+
export { type ProjectRuntimeTrajectoryEvidenceOptions as P, type RuntimeTrajectoryRecord as R, type RuntimeTrajectoryEvidenceProjection as a, type RuntimeTrajectoryEvidenceSummary as b, type RuntimeTrajectoryHookEvent as c, type RuntimeTrajectoryRunRecord as d, projectRuntimeTrajectoryEvidence as e, parseRuntimeTrajectoryHookEvent as p };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Building doctrine
|
|
2
|
+
|
|
3
|
+
How every fleet agent that consumes `agent-eval` is built. Each rule is mechanical: a primitive or test makes the rule enforceable rather than aspirational. For the mental model and primitives this references, see [`concepts.md`](./concepts.md) and the [`/contract`](../src/contract/index.ts) surface.
|
|
4
|
+
|
|
5
|
+
## 1. Defaults must be provably reachable
|
|
6
|
+
|
|
7
|
+
Every hard-coded model id or endpoint default is verifiable against the live router. Membership in `{baseUrl}/models` is the free check; an optional 1-token probe per model confirms the router will actually serve it. A default the router cannot serve is a config bug caught before the run, not a runtime surprise that silently degrades into a stub. Backend ids are namespaced by binding: cli-bridge ids (`claude-code/*`, `kimi-code/*`, `opencode/*`) never appear as defaults in code reachable from production — bridge use is an explicit env opt-in, never an implicit fallback.
|
|
8
|
+
|
|
9
|
+
Enforced by: `preflightModels` (membership + optional probe) and `assertModelsServed` (gate that names every unreachable id with status + detail).
|
|
10
|
+
|
|
11
|
+
## 2. Probe the platform before peeling client layers
|
|
12
|
+
|
|
13
|
+
When a request fails, one direct call against the live endpoint bisects platform-versus-client before any code-level debugging begins. A 401 from the router on a `model_not_found` is the platform telling you the default is dead; a connection refused is the platform being unreachable. Establish which side is at fault with a probe first, then debug only the side that is actually broken.
|
|
14
|
+
|
|
15
|
+
Enforced by: `preflightModels({ probe: true })` — the probe is the platform-side bisection, carrying the router's own `error.message` back to the caller.
|
|
16
|
+
|
|
17
|
+
## 3. Agent-produced findings are hypotheses
|
|
18
|
+
|
|
19
|
+
Enumeration of candidate problems may fan out to agents, but agent output is not evidence. Truth comes from probes against ground truth, not from an agent's assertion. Every classification carries quoted evidence, and nothing unverified is merged or reported as fact. A confident-sounding agent claim with no probe behind it is a hypothesis awaiting falsification.
|
|
20
|
+
|
|
21
|
+
Enforced by: `assertRealBackend` over the resulting `RunRecord[]` — an agent that claims success while the backend was never called reads as a stub, not a pass.
|
|
22
|
+
|
|
23
|
+
## 4. Experiment integrity checklist
|
|
24
|
+
|
|
25
|
+
Any lift or benchmark claim satisfies all of the following before it is reported:
|
|
26
|
+
|
|
27
|
+
- A frozen, disjoint held-out set, spent exactly once, after candidate selection.
|
|
28
|
+
- The propose and selection steps never see held-out data.
|
|
29
|
+
- The paired bootstrap confidence interval excludes zero for a "ship" or "match" verdict.
|
|
30
|
+
- The same scorer and the same items on both sides of any comparison.
|
|
31
|
+
- A leakage check from builder inputs into the evaluation set.
|
|
32
|
+
- Cross-family judge panels, with inter-rater reliability reported and gated.
|
|
33
|
+
- Missing evidence is never scored as zero — fail loud over fabricate.
|
|
34
|
+
- No optional stopping: the stopping rule is fixed before the run.
|
|
35
|
+
|
|
36
|
+
Enforced by: `pairedBootstrap` (CI), `assertCrossFamily` (panel diversity), `interRaterReliability` (agreement), and `assertRealBackend` (no stub run masquerading as a result).
|
|
37
|
+
|
|
38
|
+
## 5. Fix the class, not the instance
|
|
39
|
+
|
|
40
|
+
A drifted default is the symptom of a missing convention. The fix ships the convention and its guard alongside the one-line correction, so the same drift cannot recur silently. Patching the single dead id without adding the preflight gate leaves the class open; the next default rots the same way.
|
|
41
|
+
|
|
42
|
+
Enforced by: `assertModelsServed` wired into the campaign preflight — the guard that turns "this one model was dead" into "no campaign spends tokens against an unreachable default."
|
|
@@ -238,6 +238,8 @@ Follow-up local smoke on 2026-06-05 over 50 recent Codex JSONL sessions under 20
|
|
|
238
238
|
|
|
239
239
|
Runtime hook bridge on 2026-06-05: `src/belief-state/runtime-hooks.ts` now converts `agent-runtime` decision hooks into outcome-blind shadow-probe inputs, attaches matching lifecycle hook events as probe evidence, and only converts them into full `BeliefDecisionPoint` rows when the observed action is supplied. This keeps `agent-eval` trace/analysis-only while letting the runtime emit producer-backed decision boundaries and context for the next experiment.
|
|
240
240
|
|
|
241
|
+
Phase 0 measurement helper on 2026-06-06: `src/belief-state/phase0-measurement.ts` now joins runtime producer decisions, lifecycle evidence, observed action/outcome labels, and `RunRecord` split metadata into completed `BeliefDecisionPoint` rows plus a `BeliefDecisionResearchEvidencePacket`. This closes the local join/packet path; it does not clear the empirical gate until the corpus has >= 200 labeled producer-backed decisions with integrity checks and a recorded baseline.
|
|
242
|
+
|
|
241
243
|
Taxonomy tightening on 2026-06-05: `src/belief-state/types.ts` now exports stable decision kinds, evidence sources, evidence quality labels, evaluation criteria, and reason codes. The intent is to make future dashboards and paper artifacts aggregate by stable IDs (`calibration`, `ope-support`, `memory-health`, `surface-attribution`, `promotion`, etc.) instead of parsing prose diagnostics.
|
|
242
244
|
|
|
243
245
|
### Q4 2026 - Phase 1: Selective Prediction and Abstention
|
|
@@ -567,6 +569,7 @@ Promotion:
|
|
|
567
569
|
| `src/belief-state/report.test.ts` | full report status: `ship`, `hold`, `need_more_data`; recommendation cannot ship on OPE alone. |
|
|
568
570
|
| `src/belief-state/code-agent-corpus.test.ts` | extracts code-agent decision corpora across Codex, Claude Code, OpenCode, Kimi Code, and Pi/PiGraph-shaped traces; inventories targets; picks failure recovery first; holds when OPE propensities are absent. |
|
|
569
571
|
| `src/belief-state/runtime-hooks.test.ts` | converts runtime decision hooks to outcome-blind shadow probes; attaches matching lifecycle hook events as evidence; requires observed action for full belief rows; collector stays structurally compatible with runtime hooks. |
|
|
572
|
+
| `tests/belief-state/phase0-measurement.test.ts` | joins runtime producer decisions, lifecycle events, observed labels, and run split metadata into completed rows and a research evidence packet without fabricating missing joins or propensities. |
|
|
570
573
|
| `src/belief-state/types.test.ts` | guards the stable decision kinds, evidence sources/qualities, evaluation criteria, and reason-code taxonomy. |
|
|
571
574
|
| `src/meta-eval/calibration.test.ts` | existing `calibrationCurve()` still works after extracting pure helper. |
|
|
572
575
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tangle-network/agent-eval",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.85.0",
|
|
4
4
|
"description": "Evaluate and improve AI agents from runs, traces, judges, and feedback. Compare candidates, cluster failures, measure lift, and gate releases.",
|
|
5
5
|
"homepage": "https://github.com/tangle-network/agent-eval#readme",
|
|
6
6
|
"repository": {
|
|
@@ -169,19 +169,6 @@
|
|
|
169
169
|
"publishConfig": {
|
|
170
170
|
"access": "public"
|
|
171
171
|
},
|
|
172
|
-
"scripts": {
|
|
173
|
-
"build": "tsup && pnpm openapi",
|
|
174
|
-
"dev": "tsup --watch",
|
|
175
|
-
"prepare": "husky",
|
|
176
|
-
"prepublishOnly": "pnpm build",
|
|
177
|
-
"test": "vitest run",
|
|
178
|
-
"test:watch": "vitest",
|
|
179
|
-
"typecheck": "tsc --noEmit",
|
|
180
|
-
"lint": "biome check src",
|
|
181
|
-
"format": "biome format --write src",
|
|
182
|
-
"openapi": "node dist/cli.js openapi --out dist/openapi.json",
|
|
183
|
-
"verify:package": "node scripts/verify-package-exports.mjs"
|
|
184
|
-
},
|
|
185
172
|
"dependencies": {
|
|
186
173
|
"@asteasolutions/zod-to-openapi": "^8.5.0",
|
|
187
174
|
"@ax-llm/ax": "^19.0.25",
|
|
@@ -209,16 +196,6 @@
|
|
|
209
196
|
"typescript": "^5.7.0",
|
|
210
197
|
"vitest": "^3.0.0"
|
|
211
198
|
},
|
|
212
|
-
"pnpm": {
|
|
213
|
-
"minimumReleaseAge": 4320,
|
|
214
|
-
"minimumReleaseAgeExclude": [
|
|
215
|
-
"@tangle-network/sandbox"
|
|
216
|
-
],
|
|
217
|
-
"overrides": {
|
|
218
|
-
"postcss@<8.5.10": "^8.5.10",
|
|
219
|
-
"ws@>=8.0.0 <8.20.1": "^8.20.1"
|
|
220
|
-
}
|
|
221
|
-
},
|
|
222
199
|
"engines": {
|
|
223
200
|
"node": ">=20"
|
|
224
201
|
},
|
|
@@ -231,5 +208,15 @@
|
|
|
231
208
|
]
|
|
232
209
|
},
|
|
233
210
|
"license": "MIT",
|
|
234
|
-
"
|
|
235
|
-
|
|
211
|
+
"scripts": {
|
|
212
|
+
"build": "tsup && pnpm openapi",
|
|
213
|
+
"dev": "tsup --watch",
|
|
214
|
+
"test": "vitest run",
|
|
215
|
+
"test:watch": "vitest",
|
|
216
|
+
"typecheck": "tsc --noEmit",
|
|
217
|
+
"lint": "biome check src",
|
|
218
|
+
"format": "biome format --write src",
|
|
219
|
+
"openapi": "node dist/cli.js openapi --out dist/openapi.json",
|
|
220
|
+
"verify:package": "node scripts/verify-package-exports.mjs"
|
|
221
|
+
}
|
|
222
|
+
}
|