@tangle-network/agent-eval 0.21.0 → 0.22.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.
Files changed (45) hide show
  1. package/CHANGELOG.md +102 -1
  2. package/README.md +4 -0
  3. package/dist/{chunk-WOK2RTWG.js → chunk-4W4NCYM2.js} +134 -109
  4. package/dist/chunk-4W4NCYM2.js.map +1 -0
  5. package/dist/{chunk-WOPGKVN4.js → chunk-6KQG5HAH.js} +2 -2
  6. package/dist/chunk-6M774GY6.js +53 -0
  7. package/dist/chunk-6M774GY6.js.map +1 -0
  8. package/dist/{chunk-3IX6QTB7.js → chunk-IOXMGMHQ.js} +418 -541
  9. package/dist/chunk-IOXMGMHQ.js.map +1 -0
  10. package/dist/{chunk-3GN6U53I.js → chunk-KAO3Q65R.js} +2 -2
  11. package/dist/chunk-QUKKGHTZ.js +121 -0
  12. package/dist/chunk-QUKKGHTZ.js.map +1 -0
  13. package/dist/{chunk-SNUHRBDL.js → chunk-SQQLHODJ.js} +10 -1
  14. package/dist/{chunk-SNUHRBDL.js.map → chunk-SQQLHODJ.js.map} +1 -1
  15. package/dist/chunk-UAND2LOT.js +738 -0
  16. package/dist/chunk-UAND2LOT.js.map +1 -0
  17. package/dist/{chunk-HRZELXCR.js → chunk-USHQBPMH.js} +283 -7
  18. package/dist/chunk-USHQBPMH.js.map +1 -0
  19. package/dist/cli.js +3 -3
  20. package/dist/index.d.ts +10 -284
  21. package/dist/index.js +39 -19
  22. package/dist/index.js.map +1 -1
  23. package/dist/integrity-K2oVlF57.d.ts +210 -0
  24. package/dist/openapi.json +1 -1
  25. package/dist/optimization-UVDNKaO6.d.ts +574 -0
  26. package/dist/optimization.d.ts +6 -144
  27. package/dist/optimization.js +9 -2
  28. package/dist/reporting-B82RSv9C.d.ts +593 -0
  29. package/dist/reporting.d.ts +2 -2
  30. package/dist/reporting.js +15 -8
  31. package/dist/{multi-shot-optimization-Bvtz294B.d.ts → summary-report-D4p7RlDu.d.ts} +381 -1
  32. package/dist/traces.d.ts +101 -181
  33. package/dist/traces.js +16 -5
  34. package/dist/wire/index.js +3 -3
  35. package/docs/research-report-methodology.md +19 -4
  36. package/docs/wire-protocol.md +1 -1
  37. package/package.json +2 -2
  38. package/dist/chunk-3IX6QTB7.js.map +0 -1
  39. package/dist/chunk-HRZELXCR.js.map +0 -1
  40. package/dist/chunk-KRR4VMH7.js +0 -423
  41. package/dist/chunk-KRR4VMH7.js.map +0 -1
  42. package/dist/chunk-WOK2RTWG.js.map +0 -1
  43. package/dist/reporting-Da2ihlcM.d.ts +0 -672
  44. /package/dist/{chunk-WOPGKVN4.js.map → chunk-6KQG5HAH.js.map} +0 -0
  45. /package/dist/{chunk-3GN6U53I.js.map → chunk-KAO3Q65R.js.map} +0 -0
@@ -1,146 +1,8 @@
1
- import { G as GateDecision } from './multi-shot-optimization-Bvtz294B.js';
2
- export { A as ActionableSideInfo, b as AsiSeverity, D as DEFAULT_MUTATION_PRIMITIVES, E as EvolvableVariant, e as GenerationReport, I as InMemoryTrialCache, h as MultiShotGateConfig, i as MultiShotGateResult, j as MultiShotMutateAdapter, k as MultiShotOptimizationConfig, l as MultiShotOptimizationResult, m as MultiShotRun, n as MultiShotRunInput, o as MultiShotRunner, p as MultiShotScore, q as MultiShotScorer, r as MultiShotSplit, s as MultiShotTrace, t as MultiShotTrialResult, u as MultiShotVariant, M as MutateAdapter, v as PromptEvolutionConfig, w as PromptEvolutionEvent, x as PromptEvolutionResult, R as ReflectionContext, y as ReflectionProposal, S as ScenarioAggregate, z as ScoreAdapter, T as TrialCache, a as TrialResult, B as TrialTrace, V as VariantAggregate, C as buildReflectionPrompt, J as defaultMultiShotObjectives, Q as parseReflectionResponse, U as runMultiShotOptimization, W as runPromptEvolution, Y as trialTraceFromMultiShotTrial } from './multi-shot-optimization-Bvtz294B.js';
3
- import { a as RunRecord } from './run-record-CX_jcAyr.js';
1
+ export { C as CallbackResearcher, a as CallbackResearcherOptions, b as CampaignFactoryParams, c as CampaignIntegrityPolicy, d as CampaignRunContext, e as CampaignRunOutcome, f as CampaignRunner, g as CampaignScenario, h as CampaignVariant, E as EvalCampaignOptions, i as EvalCampaignResult, j as ExperimentPlan, k as ExperimentResult, F as FailedRun, l as FailureMode, N as NoopResearcher, R as Researcher, S as SteeringChange, y as runEvalCampaign } from './optimization-UVDNKaO6.js';
2
+ export { A as ActionableSideInfo, b as AsiSeverity, c as DEFAULT_MUTATION_PRIMITIVES, E as EvolvableVariant, m as GenerationReport, I as InMemoryTrialCache, p as MultiShotGateConfig, q as MultiShotGateResult, r as MultiShotMutateAdapter, s as MultiShotOptimizationConfig, t as MultiShotOptimizationResult, u as MultiShotRun, v as MultiShotRunInput, w as MultiShotRunner, x as MultiShotScore, y as MultiShotScorer, z as MultiShotSplit, B as MultiShotTrace, C as MultiShotTrialResult, J as MultiShotVariant, M as MutateAdapter, N as PromptEvolutionConfig, Q as PromptEvolutionEvent, R as PromptEvolutionResult, U as ReflectionContext, W as ReflectionProposal, a1 as ScenarioAggregate, a2 as ScoreAdapter, T as TrialCache, a as TrialResult, a6 as TrialTrace, V as VariantAggregate, a7 as buildReflectionPrompt, aa as defaultMultiShotObjectives, ah as parseReflectionResponse, aj as runMultiShotOptimization, ak as runPromptEvolution, an as trialTraceFromMultiShotTrial } from './summary-report-D4p7RlDu.js';
4
3
  export { n as FeedbackArtifactType, o as FeedbackAttempt, F as FeedbackLabel, p as FeedbackLabelKind, q as FeedbackLabelSource, r as FeedbackOptimizerRow, s as FeedbackOutcome, t as FeedbackReplayAdapter, u as FeedbackReplayResult, v as FeedbackSeverity, w as FeedbackSplitPolicy, x as FeedbackTask, b as FeedbackTrajectory, y as FeedbackTrajectoryFilter, a as FeedbackTrajectoryStore, z as FileSystemFeedbackTrajectoryStore, I as InMemoryFeedbackTrajectoryStore, P as PreferenceMemoryEntry, A as ProposedSideEffect, D as assignFeedbackSplit, E as controlRunToFeedbackTrajectory, G as createFeedbackTrajectory, H as feedbackTrajectoriesToDatasetScenarios, J as feedbackTrajectoriesToOptimizerRows, K as feedbackTrajectoryToDatasetScenario, L as feedbackTrajectoryToOptimizerRow, N as parseFeedbackTrajectoriesJsonl, O as renderPreferenceMemoryMarkdown, Q as replayFeedbackTrajectories, R as replayFeedbackTrajectory, U as serializeFeedbackTrajectoriesJsonl, Y as summarizePreferenceMemory, Z as withAssignedFeedbackSplit } from './feedback-trajectory-CB0A32o3.js';
5
- import './dataset-B9qvlm_o.js';
6
- import './emitter-B2XqDKFU.js';
4
+ import './integrity-K2oVlF57.js';
7
5
  import './store-u47QaJ9G.js';
8
-
9
- /**
10
- * Researcher interface — stable hook for an external autonomous-research
11
- * agent to drive the meta-loop.
12
- *
13
- * Implementations live downstream (typically in a private repo that
14
- * runs the actual LLM). This package ships only the contract + a
15
- * `NoopResearcher` so consumers can wire the surface without being
16
- * forced to implement every method up front.
17
- *
18
- * The four methods mirror the four stages of the paper "Two Loops,
19
- * Three Roles":
20
- *
21
- * inspectFailures — given the observed runs, what failure modes
22
- * are present? (data → diagnosis)
23
- * proposeChange — given diagnosed failure modes, what
24
- * structural changes should we try?
25
- * (diagnosis → plan delta)
26
- * applyChange — fold the proposed deltas into a concrete
27
- * experiment plan against an existing baseline.
28
- * (plan delta → executable plan)
29
- * evaluateChange — run the plan, return runs + the gate verdict.
30
- * (executable plan → verdict)
31
- *
32
- * Composition is the discipline: a Researcher implementation MUST
33
- * keep these four steps separate and inspectable. Conflating
34
- * "diagnose + propose + run" into a single LLM call defeats the
35
- * point of the framework — you can't audit which step lied.
36
- *
37
- * THIS INTERFACE IS STABLE. Breaking changes require a new module
38
- * (e.g. `Researcher2`) so existing implementations keep working.
39
- */
40
-
41
- /** A diagnosed failure mode with the run-IDs that exhibit it. */
42
- interface FailureMode {
43
- /** Short machine-readable code. Must be stable across runs of the
44
- * same researcher to enable longitudinal tracking. */
45
- code: string;
46
- /** Human-readable description for the paper / dashboard. */
47
- description: string;
48
- evidence: {
49
- /** Run IDs (from `RunRecord.runId`) where this failure mode was
50
- * observed. */
51
- runIds: string[];
52
- /** Number of run samples that informed the diagnosis. */
53
- samples: number;
54
- };
55
- }
56
- /** A single steering change the researcher wants to try. */
57
- interface SteeringChange {
58
- kind: 'reviewer_prompt' | 'skill_add' | 'skill_remove' | 'threshold' | 'budget';
59
- /** Implementation-specific payload. Researcher implementations
60
- * define the schema — keep this `unknown` here to avoid coupling
61
- * the public interface to any one researcher's internal model. */
62
- payload: unknown;
63
- /** Why the researcher proposed this change. Goes into the audit
64
- * trail next to the failure-mode evidence. */
65
- rationale: string;
66
- /** Optional self-reported expected delta on the headline metric. */
67
- expectedDelta?: number;
68
- }
69
- /** A single experiment plan, mapped onto the search/holdout splits. */
70
- interface ExperimentPlan {
71
- baselineCandidateId: string;
72
- proposedCandidateId: string;
73
- changes: SteeringChange[];
74
- /** USD ceiling for the entire experiment. The runner must stop
75
- * before exceeding this and report a partial result. */
76
- evaluationBudgetUsd: number;
77
- /** Item IDs (your dataset keys) for the search vs holdout splits. */
78
- splits: {
79
- search: string[];
80
- holdout: string[];
81
- };
82
- }
83
- /** Result of running a plan: every run, plus the gate verdict. */
84
- interface ExperimentResult {
85
- plan: ExperimentPlan;
86
- runs: RunRecord[];
87
- gateDecision: GateDecision;
88
- }
89
- /**
90
- * The researcher loop. Stable, four-step, inspectable.
91
- *
92
- * ┌──────────┐ inspectFailures ┌──────────┐ proposeChange ┌──────────┐
93
- * │ runs │ ─────────────────▶│ failures │ ──────────────▶│ changes │
94
- * └──────────┘ └──────────┘ └────┬─────┘
95
- * │
96
- * ▼
97
- * ┌────────────────┐ applyChange ┌────────┐
98
- * │ ExperimentPlan │ ◀────────────│ base │
99
- * └────────┬───────┘ └────────┘
100
- * │
101
- * evaluateChange ▼
102
- * ┌────────────────┐
103
- * │ ExperimentResult│
104
- * └────────────────┘
105
- */
106
- interface Researcher {
107
- inspectFailures(runs: RunRecord[]): Promise<FailureMode[]>;
108
- proposeChange(failures: FailureMode[]): Promise<SteeringChange[]>;
109
- applyChange(changes: SteeringChange[], baseline: ExperimentPlan): Promise<ExperimentPlan>;
110
- evaluateChange(plan: ExperimentPlan): Promise<ExperimentResult>;
111
- }
112
- interface CallbackResearcherOptions {
113
- inspectFailures: Researcher['inspectFailures'];
114
- proposeChange: Researcher['proposeChange'];
115
- applyChange: Researcher['applyChange'];
116
- evaluateChange: Researcher['evaluateChange'];
117
- }
118
- /**
119
- * Minimal concrete researcher for tests, scripts, and small integrations.
120
- * Larger autonomous researchers can still implement `Researcher` directly.
121
- */
122
- declare class CallbackResearcher implements Researcher {
123
- private readonly callbacks;
124
- constructor(callbacks: CallbackResearcherOptions);
125
- inspectFailures(runs: RunRecord[]): Promise<FailureMode[]>;
126
- proposeChange(failures: FailureMode[]): Promise<SteeringChange[]>;
127
- applyChange(changes: SteeringChange[], baseline: ExperimentPlan): Promise<ExperimentPlan>;
128
- evaluateChange(plan: ExperimentPlan): Promise<ExperimentResult>;
129
- }
130
- /**
131
- * No-op researcher — fails loud on every method. Use as a placeholder
132
- * in code paths that wire the interface but don't have an implementation
133
- * yet. Importantly, this does NOT silently succeed: a no-op researcher
134
- * that returned empty arrays would muffle the loop's signal that
135
- * nobody implemented the brain.
136
- */
137
- declare class NoopResearcher implements Researcher {
138
- private readonly hint;
139
- constructor(hint?: string);
140
- inspectFailures(_runs: RunRecord[]): Promise<FailureMode[]>;
141
- proposeChange(_failures: FailureMode[]): Promise<SteeringChange[]>;
142
- applyChange(_changes: SteeringChange[], _baseline: ExperimentPlan): Promise<ExperimentPlan>;
143
- evaluateChange(_plan: ExperimentPlan): Promise<ExperimentResult>;
144
- }
145
-
146
- export { CallbackResearcher, type CallbackResearcherOptions, type ExperimentPlan, type ExperimentResult, type FailureMode, NoopResearcher, type Researcher, type SteeringChange };
6
+ import './emitter-B2XqDKFU.js';
7
+ import './run-record-CX_jcAyr.js';
8
+ import './dataset-B9qvlm_o.js';
@@ -19,15 +19,21 @@ import {
19
19
  renderPreferenceMemoryMarkdown,
20
20
  replayFeedbackTrajectories,
21
21
  replayFeedbackTrajectory,
22
+ runEvalCampaign,
22
23
  runMultiShotOptimization,
23
24
  runPromptEvolution,
24
25
  serializeFeedbackTrajectoriesJsonl,
25
26
  summarizePreferenceMemory,
26
27
  trialTraceFromMultiShotTrial,
27
28
  withAssignedFeedbackSplit
28
- } from "./chunk-HRZELXCR.js";
29
+ } from "./chunk-USHQBPMH.js";
29
30
  import "./chunk-YUFXO3TU.js";
30
- import "./chunk-KRR4VMH7.js";
31
+ import "./chunk-IOXMGMHQ.js";
32
+ import "./chunk-QUKKGHTZ.js";
33
+ import "./chunk-5IIQKMD5.js";
34
+ import "./chunk-6M774GY6.js";
35
+ import "./chunk-KAO3Q65R.js";
36
+ import "./chunk-SQQLHODJ.js";
31
37
  import "./chunk-PZ5AY32C.js";
32
38
  export {
33
39
  CallbackResearcher,
@@ -50,6 +56,7 @@ export {
50
56
  renderPreferenceMemoryMarkdown,
51
57
  replayFeedbackTrajectories,
52
58
  replayFeedbackTrajectory,
59
+ runEvalCampaign,
53
60
  runMultiShotOptimization,
54
61
  runPromptEvolution,
55
62
  serializeFeedbackTrajectoriesJsonl,