@tangle-network/agent-eval 0.122.8 → 0.122.9

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 CHANGED
@@ -9,9 +9,11 @@ All notable changes to `@tangle-network/agent-eval` and its sibling `agent-eval-
9
9
  ### Added
10
10
 
11
11
  - `CostLedger.listPending()` exposes immutable pending paid calls and distinguishes calls that are active, late after cancellation, or interrupted by a prior process so durable workflows can reconcile exact reservations before resuming.
12
+ - `traceAnalystProposer()` accepts an opt-in `resolvePriorFindings` callback that forwards canonical prior findings into the existing analyst registry.
12
13
 
13
14
  ### Changed
14
15
 
16
+ - Trace-analysis actors are instructed to emit one executable JavaScript program per turn, report named turn-limit exhaustion, and preserve per-analyst failure details when a proposer produces no findings.
15
17
  - Keep one live tip per lineage track when another track branches or merges from it, and compare those track tips when building the frontier.
16
18
  - Pass track identity, operation, vision, ancestry, and proposer choice to candidate generation so independent tracks can pursue distinct strategies.
17
19
  - Route named tracks to caller-supplied proposers, with the default proposer as fallback, and make heuristic branches inherit their parent track's proposer.
@@ -9,13 +9,13 @@ import {
9
9
  diffFindings,
10
10
  emitSkillUsageFindings,
11
11
  runSemanticConceptJudge
12
- } from "../chunk-MI2H23RV.js";
12
+ } from "../chunk-G2GPNLSX.js";
13
13
  import {
14
14
  behavioralAnalyst,
15
15
  buildDefaultAnalystRegistry,
16
16
  createChatClient,
17
17
  deriveEfficiencyFindings
18
- } from "../chunk-BVMWQDC5.js";
18
+ } from "../chunk-VJ7T5WIO.js";
19
19
  import "../chunk-HHWE3POT.js";
20
20
  import {
21
21
  ANALYST_SEVERITIES,
@@ -71,13 +71,13 @@ import {
71
71
  validatePolicyEdit,
72
72
  validatePolicyEditCandidateRecord,
73
73
  validateUsageSettlementTimeout
74
- } from "../chunk-MUS5DOH7.js";
74
+ } from "../chunk-FC5NDO3E.js";
75
75
  import "../chunk-NJC7U437.js";
76
76
  import {
77
77
  CostLedger
78
78
  } from "../chunk-BGVTIE2C.js";
79
79
  import "../chunk-VI2UW6B6.js";
80
- import "../chunk-PXD6ZFNY.js";
80
+ import "../chunk-IR3KBHOY.js";
81
81
  import "../chunk-PC4UYEBM.js";
82
82
  import "../chunk-XJYR7XFV.js";
83
83
  import "../chunk-VSMTAMNK.js";
@@ -17,18 +17,18 @@ import {
17
17
  runBenchmarkAdapter,
18
18
  summarizeBenchmarkCampaign
19
19
  } from "../chunk-FHFTYX2Q.js";
20
- import "../chunk-ZDAKRZG5.js";
21
- import "../chunk-S6IL3R5I.js";
20
+ import "../chunk-CWF6SCBK.js";
21
+ import "../chunk-4EDDIK77.js";
22
22
  import "../chunk-3FCG7FBV.js";
23
- import "../chunk-MUS5DOH7.js";
23
+ import "../chunk-FC5NDO3E.js";
24
24
  import "../chunk-ARU2PZFM.js";
25
25
  import "../chunk-NJC7U437.js";
26
26
  import "../chunk-PJQFMIOX.js";
27
27
  import "../chunk-BGVTIE2C.js";
28
28
  import "../chunk-VI2UW6B6.js";
29
- import "../chunk-WW2A73HW.js";
29
+ import "../chunk-NUKSVU3W.js";
30
30
  import "../chunk-GGE4NNQT.js";
31
- import "../chunk-PXD6ZFNY.js";
31
+ import "../chunk-IR3KBHOY.js";
32
32
  import "../chunk-PC4UYEBM.js";
33
33
  import "../chunk-S3UZOQ5Y.js";
34
34
  import "../chunk-MA6HLL3S.js";
@@ -1348,6 +1348,13 @@ interface EvidenceRef {
1348
1348
  uri: string;
1349
1349
  excerpt?: string;
1350
1350
  }
1351
+ /**
1352
+ * The discriminator the registry uses to pass the right input.
1353
+ * `custom` is the escape hatch — analysts that need something else
1354
+ * (e.g. an embedding cache, a partner SDK handle) read it from
1355
+ * `AnalystRunInputs.custom[<analyst id>]`.
1356
+ */
1357
+ type AnalystInputKind = 'trace-store' | 'artifact-dir' | 'run-record' | 'judge-input' | 'custom';
1351
1358
  interface AnalystCost {
1352
1359
  /** `deterministic` analysts MUST NOT call the LLM. */
1353
1360
  kind: 'deterministic' | 'llm';
@@ -1358,6 +1365,12 @@ interface AnalystCost {
1358
1365
  /** Maximum post-cancellation wait for provider usage. Model analysts default to 5 seconds. */
1359
1366
  settlement_timeout_ms?: number;
1360
1367
  }
1368
+ interface AnalystRequirements {
1369
+ /** Min number of shots / samples the analyst needs to produce signal. */
1370
+ min_shots?: number;
1371
+ /** Capabilities the runtime must supply (e.g. ['network', 'gpu']). */
1372
+ capabilities?: string[];
1373
+ }
1361
1374
  interface AnalystContext {
1362
1375
  runId: string;
1363
1376
  /** Stable correlation id so logs from a single registry.run() share a tag. */
@@ -1406,6 +1419,24 @@ interface AnalystContext {
1406
1419
  /** Optional abort signal. Analysts SHOULD pass it through to LLM calls. */
1407
1420
  signal?: AbortSignal;
1408
1421
  }
1422
+ /**
1423
+ * The minimal contract. Concrete analysts can refine `TInput` so
1424
+ * implementations stay type-safe (e.g. a trace analyst's `TInput` is
1425
+ * `TraceAnalysisStore`); the registry passes the right field from
1426
+ * `AnalystRunInputs` based on `inputKind`.
1427
+ */
1428
+ interface Analyst<TInput = unknown> {
1429
+ /** Stable identifier — appears in finding_id, telemetry, and registry exclusion lists. */
1430
+ readonly id: string;
1431
+ /** Human-readable. One sentence. */
1432
+ readonly description: string;
1433
+ readonly inputKind: AnalystInputKind;
1434
+ readonly cost: AnalystCost;
1435
+ readonly requires?: AnalystRequirements;
1436
+ /** Bump on breaking changes to claim wording or area so old finding_ids don't collide. */
1437
+ readonly version: string;
1438
+ analyze(input: TInput, ctx: AnalystContext): Promise<AnalystFinding[]>;
1439
+ }
1409
1440
  /** Metered work performed by one analyst call. */
1410
1441
  interface AnalystUsageReceipt {
1411
1442
  /** Number of model-usage records observed at the provider boundary. */
@@ -6061,6 +6092,76 @@ interface TraceAnalystGolden {
6061
6092
  expected: ReadonlyArray<Omit<CanonicalRawAnalystFinding, 'confidence'>>;
6062
6093
  }
6063
6094
 
6095
+ /**
6096
+ * AnalystRegistry — orchestrate N analysts against one run.
6097
+ *
6098
+ * Owns three responsibilities and only three:
6099
+ * 1. Registration — ids must be unique; bad registrations fail loudly
6100
+ * at register-time, not run-time.
6101
+ * 2. Routing — each analyst declares its `inputKind`; the registry
6102
+ * picks the matching field from AnalystRunInputs and skips the
6103
+ * analyst with a logged reason if it's missing.
6104
+ * 3. Isolation — one analyst's exception MUST NOT stop other analysts.
6105
+ * Failed analysts produce zero findings + a 'failed' summary row.
6106
+ *
6107
+ * Cross-cutting concerns (telemetry, error → finding conversion, cost
6108
+ * ingestion, storage rotation) live in `AnalystHooks`. Budget shaping
6109
+ * (equal split vs weighted vs custom) lives in `BudgetPolicy`. Both
6110
+ * have sensible defaults; consumers override only what they need.
6111
+ */
6112
+
6113
+ interface BudgetPolicy {
6114
+ /** Overall USD cap across the registry.run(). */
6115
+ totalUsd?: number;
6116
+ /** Per-analyst weight for the default allocator. Missing ids get weight 1. */
6117
+ weights?: Record<string, number>;
6118
+ /**
6119
+ * Custom allocator — receives the analyst, remaining/total budget, and
6120
+ * the count of analysts that will run. Returns the per-analyst budget
6121
+ * (or undefined only when the run has no overall cap). Overrides weights
6122
+ * when set.
6123
+ */
6124
+ allocate?: (args: {
6125
+ analyst: Analyst;
6126
+ totalUsd: number | undefined;
6127
+ remainingUsd: number | undefined;
6128
+ runningCount: number;
6129
+ }) => number | undefined;
6130
+ }
6131
+ interface RegistryRunOpts {
6132
+ /** Restrict to a subset of registered analysts by id. */
6133
+ only?: string[];
6134
+ /** Skip these analysts even if registered. Useful for cheap iteration. */
6135
+ skip?: string[];
6136
+ /** Budget policy — totalUsd + optional weights/allocator. Falls back to options.defaultBudget. */
6137
+ budget?: BudgetPolicy;
6138
+ /** Active-work cap for the complete registry run. Model receipt settlement may follow. */
6139
+ timeoutMs?: number;
6140
+ /** Abort signal — forwarded into every analyst's context. */
6141
+ signal?: AbortSignal;
6142
+ /** Shared paid-call account forwarded to every analyst. */
6143
+ costLedger?: CostLedgerHandle;
6144
+ /** Attribution phase for calls written to `costLedger`. */
6145
+ costPhase?: string;
6146
+ /** Tags echoed into AnalystContext.tags — useful for tracking environment/version in findings. */
6147
+ tags?: Record<string, string>;
6148
+ /**
6149
+ * Prior-run findings made available as retrieval context to every
6150
+ * analyst via `ctx.priorFindings`. The registry forwards the slice
6151
+ * whose `analyst_id` matches each registered analyst so a kind sees
6152
+ * only its own history. Pass `{ '*': findings }` to broadcast to
6153
+ * every analyst (useful when several kinds share the same historical
6154
+ * context). For findings from this run, use `chainFindings` instead.
6155
+ */
6156
+ priorFindings?: ReadonlyArray<AnalystFinding> | Record<string, ReadonlyArray<AnalystFinding>>;
6157
+ /**
6158
+ * Pass findings produced earlier in this registry run to each later analyst
6159
+ * via `ctx.upstreamFindings`. Registration order is dependency order.
6160
+ * Disabled by default because independent analyst suites must opt in.
6161
+ */
6162
+ chainFindings?: boolean;
6163
+ }
6164
+
6064
6165
  /**
6065
6166
  * `traceAnalystProposer` — wraps agent-eval's OWN trace-analyst engine
6066
6167
  * (`AnalystRegistry` over the agentic OTLP reader) as a `SurfaceProposer`.
@@ -6078,7 +6179,8 @@ interface TraceAnalystGolden {
6078
6179
  * throw. Never fabricate a candidate.
6079
6180
  */
6080
6181
 
6081
- interface TraceAnalystProposerOptions {
6182
+ type TraceAnalystPriorFindings = NonNullable<RegistryRunOpts['priorFindings']>;
6183
+ interface TraceAnalystProposerOptions<TFindings = unknown> {
6082
6184
  /** OpenAI-compatible base URL for BOTH the analyst's agentic reads and the
6083
6185
  * apply step (e.g. `https://api.deepseek.com/v1` or the Tangle router). */
6084
6186
  baseUrl: string;
@@ -6101,15 +6203,19 @@ interface TraceAnalystProposerOptions {
6101
6203
  kinds?: readonly TraceAnalystKindSpec[];
6102
6204
  /** Resolve the OTLP traces (JSONL string) the analyst should read for THIS
6103
6205
  * generation — identical contract to `haloProposer.resolveTraces`. */
6104
- resolveTraces: (ctx: ProposeContext) => string | Promise<string>;
6206
+ resolveTraces: (ctx: ProposeContext<TFindings>) => string | Promise<string>;
6207
+ /** Opt in to forwarding historical findings into every registered analyst.
6208
+ * Return an array to route by analyst id or `{ '*': findings }` to broadcast.
6209
+ * No findings are forwarded when this resolver is absent. */
6210
+ resolvePriorFindings?: (ctx: ProposeContext<TFindings>) => TraceAnalystPriorFindings | undefined | Promise<TraceAnalystPriorFindings | undefined>;
6105
6211
  /** Override the findings producer. Default: the shipped `AnalystRegistry`
6106
6212
  * over `kinds`. The unit suite injects canned findings here. */
6107
- analyze?: (tracePath: string, ctx: ProposeContext) => Promise<ReadonlyArray<AnalystFinding>>;
6213
+ analyze?: (tracePath: string, ctx: ProposeContext<TFindings>) => Promise<ReadonlyArray<AnalystFinding>>;
6108
6214
  /** Test seam: inject a fetch for the apply-step `callLlm`. */
6109
6215
  fetchImpl?: LlmClientOptions['fetch'];
6110
6216
  }
6111
6217
  /** Wrap agent-eval's trace-analyst registry as a SurfaceProposer (prompt-tier). */
6112
- declare function traceAnalystProposer(opts: TraceAnalystProposerOptions): SurfaceProposer;
6218
+ declare function traceAnalystProposer<TFindings = unknown>(opts: TraceAnalystProposerOptions<TFindings>): SurfaceProposer<TFindings>;
6113
6219
 
6114
6220
  /**
6115
6221
  * Reporting helpers — production summaries and paper-quality figures — sit alongside `reporter.ts` rather
@@ -7533,4 +7639,4 @@ declare function verifyCodeSurface(surface: CodeSurface, worktreeDir?: string):
7533
7639
  * identity against the checkout at `worktreeRef`. */
7534
7640
  declare function resolveWorktreePath(surface: CodeSurface, worktreeDir?: string): string;
7535
7641
 
7536
- export { type AcceptedEdit, type AceProposerOptions, type AnalystArtifact, type AnalystScenario, type AnalyzeCrossSurfaceInteractionsInput, type ApplySkillPatchResult, type AxisEvidence, type AxisVerdict, type BuildAnalystSurfaceDispatchOptions, type BuildEvidenceVectorOptions, type BuildLoopProvenanceArgs, type CampaignAggregates, type CampaignArtifactWriter, type CampaignBreakdown, type CampaignCellResult, type CampaignCostMeter, type CampaignResult, type CampaignRunPlan, type CampaignRunPlanCell, type CampaignScenarioIdentity, type CampaignStorage, type CampaignTokenUsage, type CampaignTraceWriter, type CodeSurface, type CodeSurfaceVerification, type CompareProposersOptions, type CompositeProposerOptions, type CostLedgerHandle, type CrossSurfaceAdditionDecision, type CrossSurfaceAdditionRejectionReason, type CrossSurfaceAttemptCompleteness, type CrossSurfaceBestSingleSelection, type CrossSurfaceBootstrapPolicy, type CrossSurfaceCandidate, type CrossSurfaceCandidateComparison, type CrossSurfaceCandidateEvidence, type CrossSurfaceCandidateOutcome, type CrossSurfaceCandidateSummary, type CrossSurfaceComponent, type CrossSurfaceComponentEvidence, type CrossSurfaceCompositionStep, type CrossSurfaceDistribution, type CrossSurfaceEligibility, type CrossSurfaceEvidenceBreakdown, type CrossSurfaceIneligibilityReason, type CrossSurfaceInteractionAwareSelection, type CrossSurfaceInteractionEffect, type CrossSurfaceInteractionPath, type CrossSurfaceInteractionReport, type CrossSurfaceInteractionTask, type CrossSurfaceNaiveStackSelection, type CrossSurfacePairCompatibility, type CrossSurfacePairEvidence, type CrossSurfacePairIncompatibilityReason, type CrossSurfacePairwiseEntry, type CrossSurfaceRankedSingle, type CrossSurfaceRelativeCost, type CrossSurfaceSelectionPolicy, type CrossSurfaceSelections, type CrossSurfaceTaskRow, DEFAULT_POLICY_EDIT_HISTORY_LIMITS, type DefaultProductionGateOptions, type DimensionRegression, type DiscriminationScore, type DispatchContext, type DispatchFn, type EmitLoopProvenanceArgs, type EmitLoopProvenanceResult, type EvalFixture, type EvalFixtureFile, type EvalFixtureLoadOptions, type EvalFixtureRunPlan, type EvalFixtureScenario, type EvalFixtureValidationMode, type EvidenceVector, type EvolutionaryProposerOptions, type FailureModeRecallJudgeOptions, type FapoAttributionSignals, type FapoEntryConfig, type FapoFailureCluster, type FapoOptimizationLevel, type FapoProposerOptions, type FapoReviewInput, type FapoReviewIssue, type FapoReviewResult, type FapoScopeContract, FileSearchLedger, FsLabeledScenarioStore, type FsLabeledScenarioStoreOptions, type Gate, type GateContext, type GateDecision, type GateResult, type GenerationCandidate, type GenerationRecord, type GepaProposerConstraints, type GepaProposerOptions, type GitWorktreeAdapterOptions, type Governor, type GovernorContext, type GovernorOp, type HaloProposerOptions, type HeldOutGateOptions, type HeldoutSignificance, type HeldoutSignificanceOptions, type HeuristicGovernorOptions, type JsonPolicyEditTargetSurface, type JsonPrimitive, type JsonValue, type JudgeAggregate, type JudgeConfig, type JudgeDimension, type JudgeScore, type LabelTrust, type LabeledScenarioRecord, type LabeledScenarioSampleArgs, type LabeledScenarioSource, type LabeledScenarioStore, LabeledScenarioStoreError, type LabeledScenarioWrite, Lineage, type LineageEdge, type LineageGraph, type LineageNode, type LineageNodeInput, type LineageStore, LineageStoreConflictError, type LlmJudgeDimension, type LlmJudgeOptions, type LlmPolicyEditProposerOptions, type LoadEvalFixtureScenariosOptions, type LoopProvenanceArgsFromResult, type LoopProvenanceBackend, type LoopProvenanceCandidate, type LoopProvenanceEvidence, type LoopProvenanceRecord, type MemoryCurationProposerOptions, type MutableSurface, type Mutator, type NeutralizationGateOptions, type ObjectiveSource, type OpenAutoPrOptions, type OpenAutoPrResult, type OpenSearchLedgerOptions, type OptimizationProposer, type OptimizerConfig, type OptimizerEntryConfig, POLICY_EDIT_CANDIDATE_RECORD_SCHEMA, type PairedHoldout, type ParameterCandidate, type ParameterChange, type ParameterSweepProposerOptions, type ParetoParent, type ParetoSignificanceGateOptions, type PendingCostCallView, type PlanCampaignRunOptions, type PlanEvalFixtureRunOptions, type PlaybackContext, type PlaybackDriver, type PlaybackStep, type PolicyEditAuthorScenarioRow, type PolicyEditCandidateRecord, type PolicyEditCandidateSummary, type PolicyEditFindingInput, type PolicyEditFindingSource, type PolicyEditHistoryCandidateContext, type PolicyEditHistoryGenerationContext, type PolicyEditHistoryProjectionOptions, type PolicyEditObjective, type PolicyEditOutcomeContext, type PolicyEditProposerOptions, type PowerPreflight, type PowerPreflightOptions, type PremeasuredOptimizationBaseline, type ProfileDispatchFn, ProfileMatrixError, type ProfileSummary, type PromotionObjective, type PromotionPolicy, type ProposalTrackContext, type ProposeContext, type ProposePatchesArgs, type ProposedCandidate, type ProposerComparison, type ProposerEntry, type ProposerPairwise, type ProposerScore, type RedactionStatus, type ReferenceEquivalenceJudgeOptions, type ReferenceEquivalenceScenario, type RejectedEdit, type RolloutArgumentDiff, type RolloutArgumentDiffOptions, type RolloutCall, type RunCampaignOptions, type RunEvalOptions, type RunImprovementLoopOptions, type RunImprovementLoopResult, type RunLineageLoopOptions, type RunLineageLoopResult, type RunLineageLoopSeed, type RunLineageOptions, type RunLineageResult, type RunLineageSeed, type RunLineageStepResult, type RunOptimizationOptions, type RunOptimizationResult, type RunProfileMatrixOptions, type RunProfileMatrixResult, type RunSkillOptOptions, type RunSkillOptResult, SEARCH_LEDGER_SCHEMA, type Scenario, type ScenarioAggregate, type ScenarioRollup, type ScenarioSignal, type ScoreboardRenderOptions, type ScoreboardRow, type ScoreboardSummary, type ScoredRollout, type ScoredSurfaceOutcome, type SearchAccountingAudit, type SearchArtifactRef, type SearchAttemptAccounting, type SearchCandidateDecidedEvent, type SearchCandidateLineage, type SearchCandidateRegisteredEvent, type SearchCandidateSlot, type SearchCandidateSlotClosedEvent, type SearchCandidateSurface, type SearchCompletedEvent, type SearchCostAccounting, type SearchFailureReason, type SearchLedger, type SearchLedgerAppendResult, SearchLedgerConflictError, type SearchLedgerEntry, SearchLedgerError, type SearchLedgerEvent, type SearchLedgerHash, SearchLedgerIntegrityError, type SearchLedgerReplay, type SearchModelIdentity, type SearchOperationKind, type SearchOperationRecordedEvent, type SearchPlan, type SearchPlannedEvent, type SearchPlannedOperation, type SearchPlannedTask, type SearchSourceRef, type SearchSurfaceEffect, type SearchSurfaceEvidence, type SearchSurfaceKind, type SearchTaskAttemptedEvent, type SearchTaskOutcome, type SearchTokenAccounting, type SelectPolicyEditAuthorRowsOptions, type SequentialDecideFn, type SequentialDecideOptions, type SequentialDecision, type SequentialObservation, type SequentialPairedGate, type SequentialPairedGateOptions, type SerializedJsonBudget, type SessionScript, type SingleRunLock, type SingleRunLockOptions, type SkillOptEpochRecord, type SkillOptEvidence, type SkillOptProposer, type SkillOptProposerOptions, type SkillPatch, type SkillPatchOp, SkillPatchParseError, type SkillPatchRejection, type SurfaceProposer, type SurfaceScore, type TraceAnalystProposerOptions, type TraceSpan, type TransientFailureOptions, type UngroundedLiteralReport, type UserStory, type UserStoryVerdict, type Worktree, type WorktreeAdapter, WorktreeAdapterError, aceProposer, acquireSingleRunLock, analyzeCrossSurfaceInteractions, applySkillPatch, assertCampaignDesign, assertCampaignSplitIdentity, assertCodeSurfaceIdentity, assertPolicyEditAuthorContextBudget, buildAnalystSurfaceDispatch, buildEvidenceVector, buildLoopProvenanceRecord, callbackGovernor, campaignBreakdown, campaignLineageStore, campaignMeanComposite, campaignMeasurementDigest, campaignScenarioIdentity, campaignSplitDigest, campaignSplitDigestFromIdentities, canonicalDigest, classifyUngroundedLiterals, codeSurfaceIdentityMaterial, compareProposers, composeGate, compositeProposer, countSentenceEdits, createReferenceEquivalenceJudge, createRunCostLedger, defaultProductionGate, detectScale, dimensionRegressions, discoverEvalFixtures, emitLoopProvenance, evolutionaryProposer, extractFapoAttributionSignals, extractH2Sections, failureModeRecallJudge, fapoEscalationEntry, fapoProposer, fsCampaignStorage, fsLineageStore, gepaParetoEntry, gepaProposer, gepaReflectionEntry, gitWorktreeAdapter, haloProposer, heldOutGate, heldoutSignificance, heuristicGovernor, inMemoryCampaignStorage, isProposedCandidate, isTransientTransportFailure, labelTrustRank, lineageNodeId, llmJudge, llmPolicyEditProposer, loadEvalFixture, loadEvalFixtureScenarios, loopProvenanceArgsFromResult, loopProvenanceSpans, makePlaybackDispatch, memLineageStore, memoryCurationProposer, neutralizationGate, neutralizeText, openAutoPr, openSearchLedger, pairHoldout, parameterSweepProposer, paretoPolicy, paretoSignificanceGate, parseSkillPatchResponse, patchEditCount, planCampaignRun, planEvalFixtureRun, policyEditProposer, powerPreflight, projectPolicyEditHistory, provenanceRecordPath, provenanceSpansPath, renderScoreboardMarkdown, renderSurfaceDiff, resolveRunDir, resolveWorktreePath, rolloutArgumentDiff, runCampaign, runEval, runImprovementLoop, runLineage, runLineageLoop, runOptimization, runProfileMatrix, runSkillOpt, scoreDiscrimination, scoreUserStory, scoreboardSummary, selectDiscriminative, selectPolicyEditAuthorRows, sequentialDecide, sequentialPairedGate, skillOptEntry, skillOptProposer, surfaceContentHash, surfaceHash, tangleTracesRoot, traceAnalystProposer, userStoryScoreboard, validatePolicyEditCandidateRecord, validateSearchLedgerEvent, verifyCodeSurface, verifyLoopProvenanceRecord };
7642
+ export { type AcceptedEdit, type AceProposerOptions, type AnalystArtifact, type AnalystScenario, type AnalyzeCrossSurfaceInteractionsInput, type ApplySkillPatchResult, type AxisEvidence, type AxisVerdict, type BuildAnalystSurfaceDispatchOptions, type BuildEvidenceVectorOptions, type BuildLoopProvenanceArgs, type CampaignAggregates, type CampaignArtifactWriter, type CampaignBreakdown, type CampaignCellResult, type CampaignCostMeter, type CampaignResult, type CampaignRunPlan, type CampaignRunPlanCell, type CampaignScenarioIdentity, type CampaignStorage, type CampaignTokenUsage, type CampaignTraceWriter, type CodeSurface, type CodeSurfaceVerification, type CompareProposersOptions, type CompositeProposerOptions, type CostLedgerHandle, type CrossSurfaceAdditionDecision, type CrossSurfaceAdditionRejectionReason, type CrossSurfaceAttemptCompleteness, type CrossSurfaceBestSingleSelection, type CrossSurfaceBootstrapPolicy, type CrossSurfaceCandidate, type CrossSurfaceCandidateComparison, type CrossSurfaceCandidateEvidence, type CrossSurfaceCandidateOutcome, type CrossSurfaceCandidateSummary, type CrossSurfaceComponent, type CrossSurfaceComponentEvidence, type CrossSurfaceCompositionStep, type CrossSurfaceDistribution, type CrossSurfaceEligibility, type CrossSurfaceEvidenceBreakdown, type CrossSurfaceIneligibilityReason, type CrossSurfaceInteractionAwareSelection, type CrossSurfaceInteractionEffect, type CrossSurfaceInteractionPath, type CrossSurfaceInteractionReport, type CrossSurfaceInteractionTask, type CrossSurfaceNaiveStackSelection, type CrossSurfacePairCompatibility, type CrossSurfacePairEvidence, type CrossSurfacePairIncompatibilityReason, type CrossSurfacePairwiseEntry, type CrossSurfaceRankedSingle, type CrossSurfaceRelativeCost, type CrossSurfaceSelectionPolicy, type CrossSurfaceSelections, type CrossSurfaceTaskRow, DEFAULT_POLICY_EDIT_HISTORY_LIMITS, type DefaultProductionGateOptions, type DimensionRegression, type DiscriminationScore, type DispatchContext, type DispatchFn, type EmitLoopProvenanceArgs, type EmitLoopProvenanceResult, type EvalFixture, type EvalFixtureFile, type EvalFixtureLoadOptions, type EvalFixtureRunPlan, type EvalFixtureScenario, type EvalFixtureValidationMode, type EvidenceVector, type EvolutionaryProposerOptions, type FailureModeRecallJudgeOptions, type FapoAttributionSignals, type FapoEntryConfig, type FapoFailureCluster, type FapoOptimizationLevel, type FapoProposerOptions, type FapoReviewInput, type FapoReviewIssue, type FapoReviewResult, type FapoScopeContract, FileSearchLedger, FsLabeledScenarioStore, type FsLabeledScenarioStoreOptions, type Gate, type GateContext, type GateDecision, type GateResult, type GenerationCandidate, type GenerationRecord, type GepaProposerConstraints, type GepaProposerOptions, type GitWorktreeAdapterOptions, type Governor, type GovernorContext, type GovernorOp, type HaloProposerOptions, type HeldOutGateOptions, type HeldoutSignificance, type HeldoutSignificanceOptions, type HeuristicGovernorOptions, type JsonPolicyEditTargetSurface, type JsonPrimitive, type JsonValue, type JudgeAggregate, type JudgeConfig, type JudgeDimension, type JudgeScore, type LabelTrust, type LabeledScenarioRecord, type LabeledScenarioSampleArgs, type LabeledScenarioSource, type LabeledScenarioStore, LabeledScenarioStoreError, type LabeledScenarioWrite, Lineage, type LineageEdge, type LineageGraph, type LineageNode, type LineageNodeInput, type LineageStore, LineageStoreConflictError, type LlmJudgeDimension, type LlmJudgeOptions, type LlmPolicyEditProposerOptions, type LoadEvalFixtureScenariosOptions, type LoopProvenanceArgsFromResult, type LoopProvenanceBackend, type LoopProvenanceCandidate, type LoopProvenanceEvidence, type LoopProvenanceRecord, type MemoryCurationProposerOptions, type MutableSurface, type Mutator, type NeutralizationGateOptions, type ObjectiveSource, type OpenAutoPrOptions, type OpenAutoPrResult, type OpenSearchLedgerOptions, type OptimizationProposer, type OptimizerConfig, type OptimizerEntryConfig, POLICY_EDIT_CANDIDATE_RECORD_SCHEMA, type PairedHoldout, type ParameterCandidate, type ParameterChange, type ParameterSweepProposerOptions, type ParetoParent, type ParetoSignificanceGateOptions, type PendingCostCallView, type PlanCampaignRunOptions, type PlanEvalFixtureRunOptions, type PlaybackContext, type PlaybackDriver, type PlaybackStep, type PolicyEditAuthorScenarioRow, type PolicyEditCandidateRecord, type PolicyEditCandidateSummary, type PolicyEditFindingInput, type PolicyEditFindingSource, type PolicyEditHistoryCandidateContext, type PolicyEditHistoryGenerationContext, type PolicyEditHistoryProjectionOptions, type PolicyEditObjective, type PolicyEditOutcomeContext, type PolicyEditProposerOptions, type PowerPreflight, type PowerPreflightOptions, type PremeasuredOptimizationBaseline, type ProfileDispatchFn, ProfileMatrixError, type ProfileSummary, type PromotionObjective, type PromotionPolicy, type ProposalTrackContext, type ProposeContext, type ProposePatchesArgs, type ProposedCandidate, type ProposerComparison, type ProposerEntry, type ProposerPairwise, type ProposerScore, type RedactionStatus, type ReferenceEquivalenceJudgeOptions, type ReferenceEquivalenceScenario, type RejectedEdit, type RolloutArgumentDiff, type RolloutArgumentDiffOptions, type RolloutCall, type RunCampaignOptions, type RunEvalOptions, type RunImprovementLoopOptions, type RunImprovementLoopResult, type RunLineageLoopOptions, type RunLineageLoopResult, type RunLineageLoopSeed, type RunLineageOptions, type RunLineageResult, type RunLineageSeed, type RunLineageStepResult, type RunOptimizationOptions, type RunOptimizationResult, type RunProfileMatrixOptions, type RunProfileMatrixResult, type RunSkillOptOptions, type RunSkillOptResult, SEARCH_LEDGER_SCHEMA, type Scenario, type ScenarioAggregate, type ScenarioRollup, type ScenarioSignal, type ScoreboardRenderOptions, type ScoreboardRow, type ScoreboardSummary, type ScoredRollout, type ScoredSurfaceOutcome, type SearchAccountingAudit, type SearchArtifactRef, type SearchAttemptAccounting, type SearchCandidateDecidedEvent, type SearchCandidateLineage, type SearchCandidateRegisteredEvent, type SearchCandidateSlot, type SearchCandidateSlotClosedEvent, type SearchCandidateSurface, type SearchCompletedEvent, type SearchCostAccounting, type SearchFailureReason, type SearchLedger, type SearchLedgerAppendResult, SearchLedgerConflictError, type SearchLedgerEntry, SearchLedgerError, type SearchLedgerEvent, type SearchLedgerHash, SearchLedgerIntegrityError, type SearchLedgerReplay, type SearchModelIdentity, type SearchOperationKind, type SearchOperationRecordedEvent, type SearchPlan, type SearchPlannedEvent, type SearchPlannedOperation, type SearchPlannedTask, type SearchSourceRef, type SearchSurfaceEffect, type SearchSurfaceEvidence, type SearchSurfaceKind, type SearchTaskAttemptedEvent, type SearchTaskOutcome, type SearchTokenAccounting, type SelectPolicyEditAuthorRowsOptions, type SequentialDecideFn, type SequentialDecideOptions, type SequentialDecision, type SequentialObservation, type SequentialPairedGate, type SequentialPairedGateOptions, type SerializedJsonBudget, type SessionScript, type SingleRunLock, type SingleRunLockOptions, type SkillOptEpochRecord, type SkillOptEvidence, type SkillOptProposer, type SkillOptProposerOptions, type SkillPatch, type SkillPatchOp, SkillPatchParseError, type SkillPatchRejection, type SurfaceProposer, type SurfaceScore, type TraceAnalystPriorFindings, type TraceAnalystProposerOptions, type TraceSpan, type TransientFailureOptions, type UngroundedLiteralReport, type UserStory, type UserStoryVerdict, type Worktree, type WorktreeAdapter, WorktreeAdapterError, aceProposer, acquireSingleRunLock, analyzeCrossSurfaceInteractions, applySkillPatch, assertCampaignDesign, assertCampaignSplitIdentity, assertCodeSurfaceIdentity, assertPolicyEditAuthorContextBudget, buildAnalystSurfaceDispatch, buildEvidenceVector, buildLoopProvenanceRecord, callbackGovernor, campaignBreakdown, campaignLineageStore, campaignMeanComposite, campaignMeasurementDigest, campaignScenarioIdentity, campaignSplitDigest, campaignSplitDigestFromIdentities, canonicalDigest, classifyUngroundedLiterals, codeSurfaceIdentityMaterial, compareProposers, composeGate, compositeProposer, countSentenceEdits, createReferenceEquivalenceJudge, createRunCostLedger, defaultProductionGate, detectScale, dimensionRegressions, discoverEvalFixtures, emitLoopProvenance, evolutionaryProposer, extractFapoAttributionSignals, extractH2Sections, failureModeRecallJudge, fapoEscalationEntry, fapoProposer, fsCampaignStorage, fsLineageStore, gepaParetoEntry, gepaProposer, gepaReflectionEntry, gitWorktreeAdapter, haloProposer, heldOutGate, heldoutSignificance, heuristicGovernor, inMemoryCampaignStorage, isProposedCandidate, isTransientTransportFailure, labelTrustRank, lineageNodeId, llmJudge, llmPolicyEditProposer, loadEvalFixture, loadEvalFixtureScenarios, loopProvenanceArgsFromResult, loopProvenanceSpans, makePlaybackDispatch, memLineageStore, memoryCurationProposer, neutralizationGate, neutralizeText, openAutoPr, openSearchLedger, pairHoldout, parameterSweepProposer, paretoPolicy, paretoSignificanceGate, parseSkillPatchResponse, patchEditCount, planCampaignRun, planEvalFixtureRun, policyEditProposer, powerPreflight, projectPolicyEditHistory, provenanceRecordPath, provenanceSpansPath, renderScoreboardMarkdown, renderSurfaceDiff, resolveRunDir, resolveWorktreePath, rolloutArgumentDiff, runCampaign, runEval, runImprovementLoop, runLineage, runLineageLoop, runOptimization, runProfileMatrix, runSkillOpt, scoreDiscrimination, scoreUserStory, scoreboardSummary, selectDiscriminative, selectPolicyEditAuthorRows, sequentialDecide, sequentialPairedGate, skillOptEntry, skillOptProposer, surfaceContentHash, surfaceHash, tangleTracesRoot, traceAnalystProposer, userStoryScoreboard, validatePolicyEditCandidateRecord, validateSearchLedgerEvent, verifyCodeSurface, verifyLoopProvenanceRecord };
@@ -68,7 +68,7 @@ import {
68
68
  userStoryScoreboard,
69
69
  validateSearchLedgerEvent,
70
70
  verifyCodeSurface
71
- } from "../chunk-ZDAKRZG5.js";
71
+ } from "../chunk-CWF6SCBK.js";
72
72
  import {
73
73
  assertCodeSurfaceIdentity,
74
74
  buildEvidenceVector,
@@ -109,7 +109,7 @@ import {
109
109
  surfaceContentHash,
110
110
  surfaceHash,
111
111
  verifyLoopProvenanceRecord
112
- } from "../chunk-S6IL3R5I.js";
112
+ } from "../chunk-4EDDIK77.js";
113
113
  import {
114
114
  SearchLedgerConflictError,
115
115
  SearchLedgerError,
@@ -130,15 +130,15 @@ import {
130
130
  import {
131
131
  POLICY_EDIT_CANDIDATE_RECORD_SCHEMA,
132
132
  validatePolicyEditCandidateRecord
133
- } from "../chunk-MUS5DOH7.js";
133
+ } from "../chunk-FC5NDO3E.js";
134
134
  import "../chunk-ARU2PZFM.js";
135
135
  import "../chunk-NJC7U437.js";
136
136
  import "../chunk-PJQFMIOX.js";
137
137
  import "../chunk-BGVTIE2C.js";
138
138
  import "../chunk-VI2UW6B6.js";
139
- import "../chunk-WW2A73HW.js";
139
+ import "../chunk-NUKSVU3W.js";
140
140
  import "../chunk-GGE4NNQT.js";
141
- import "../chunk-PXD6ZFNY.js";
141
+ import "../chunk-IR3KBHOY.js";
142
142
  import "../chunk-PC4UYEBM.js";
143
143
  import "../chunk-S3UZOQ5Y.js";
144
144
  import "../chunk-MA6HLL3S.js";
@@ -15,7 +15,7 @@ import {
15
15
  clamp01,
16
16
  mapConcurrent,
17
17
  validatePolicyEditCandidateRecord
18
- } from "./chunk-MUS5DOH7.js";
18
+ } from "./chunk-FC5NDO3E.js";
19
19
  import {
20
20
  detectRewardHacking
21
21
  } from "./chunk-ARU2PZFM.js";
@@ -3797,4 +3797,4 @@ export {
3797
3797
  provenanceSpansPath,
3798
3798
  emitLoopProvenance
3799
3799
  };
3800
- //# sourceMappingURL=chunk-S6IL3R5I.js.map
3800
+ //# sourceMappingURL=chunk-4EDDIK77.js.map
@@ -8,7 +8,7 @@ import {
8
8
  } from "./chunk-PXE2VKMX.js";
9
9
  import {
10
10
  analyzeTraces
11
- } from "./chunk-WW2A73HW.js";
11
+ } from "./chunk-NUKSVU3W.js";
12
12
  import {
13
13
  applyToolSpanOtlpAttributes,
14
14
  compareSpanTime,
@@ -16,7 +16,7 @@ import {
16
16
  projectOtlpFlatLine,
17
17
  spanEpochMillis,
18
18
  traceSpanKindToOpenInferenceKind
19
- } from "./chunk-PXD6ZFNY.js";
19
+ } from "./chunk-IR3KBHOY.js";
20
20
  import {
21
21
  defaultProviderRedactor,
22
22
  providerFromBaseUrl
@@ -1934,4 +1934,4 @@ export {
1934
1934
  createReplayFetch,
1935
1935
  iterateRawCalls
1936
1936
  };
1937
- //# sourceMappingURL=chunk-ULOKLHIQ.js.map
1937
+ //# sourceMappingURL=chunk-A5S77LSE.js.map
@@ -15,7 +15,7 @@ import {
15
15
  runImprovementLoop,
16
16
  surfaceContentHash,
17
17
  surfaceHash
18
- } from "./chunk-S6IL3R5I.js";
18
+ } from "./chunk-4EDDIK77.js";
19
19
  import {
20
20
  SearchLedgerConflictError,
21
21
  SearchLedgerError,
@@ -51,7 +51,7 @@ import {
51
51
  mapConcurrent,
52
52
  policyEditsFromFindings,
53
53
  validatePolicyEditCandidateRecord
54
- } from "./chunk-MUS5DOH7.js";
54
+ } from "./chunk-FC5NDO3E.js";
55
55
  import {
56
56
  callLlm,
57
57
  callLlmJson,
@@ -73,10 +73,10 @@ import {
73
73
  } from "./chunk-BGVTIE2C.js";
74
74
  import {
75
75
  analyzeTraces
76
- } from "./chunk-WW2A73HW.js";
76
+ } from "./chunk-NUKSVU3W.js";
77
77
  import {
78
78
  OtlpFileTraceStore
79
- } from "./chunk-PXD6ZFNY.js";
79
+ } from "./chunk-IR3KBHOY.js";
80
80
  import {
81
81
  modelHasSnapshot,
82
82
  validateRunRecord
@@ -6449,6 +6449,11 @@ function renderFindings(findings) {
6449
6449
  function traceAnalystProposer(opts) {
6450
6450
  if (!opts.apiKey) throw new Error("traceAnalystProposer: apiKey is required");
6451
6451
  if (!opts.model) throw new Error("traceAnalystProposer: model is required");
6452
+ if (opts.analyze && opts.resolvePriorFindings) {
6453
+ throw new TypeError(
6454
+ "traceAnalystProposer: resolvePriorFindings only applies to the default registry; custom analyze callbacks must consume ctx.findings directly"
6455
+ );
6456
+ }
6452
6457
  const kinds = opts.kinds ?? DEFAULT_TRACE_ANALYST_KINDS;
6453
6458
  const produceFindings = opts.analyze ?? (async (path, c) => {
6454
6459
  const aiService = createAnalystAi({
@@ -6461,6 +6466,7 @@ function traceAnalystProposer(opts) {
6461
6466
  for (const spec of kinds) {
6462
6467
  registry.register(createTraceAnalystKind(spec, { ai: aiService, model: opts.model }));
6463
6468
  }
6469
+ const priorFindings = await opts.resolvePriorFindings?.(c);
6464
6470
  const result = await registry.run(
6465
6471
  `trace-analyst-gen-${c.generation}`,
6466
6472
  { traceStore: new OtlpFileTraceStore({ path }) },
@@ -6468,9 +6474,11 @@ function traceAnalystProposer(opts) {
6468
6474
  signal: c.signal,
6469
6475
  chainFindings: true,
6470
6476
  costLedger: c.costLedger,
6471
- costPhase: c.costPhase
6477
+ costPhase: c.costPhase,
6478
+ ...priorFindings === void 0 ? {} : { priorFindings }
6472
6479
  }
6473
6480
  );
6481
+ if (result.findings.length === 0) throw noFindingsError(result);
6474
6482
  return result.findings;
6475
6483
  });
6476
6484
  return analysisEditProposer({
@@ -6506,6 +6514,17 @@ ${report.slice(0, 800)}`,
6506
6514
  }
6507
6515
  });
6508
6516
  }
6517
+ function noFindingsError(result) {
6518
+ const failed = result.per_analyst.filter((summary) => summary.status === "failed");
6519
+ const details = failed.map((summary) => {
6520
+ const error = summary.error;
6521
+ return error ? `${summary.analyst_id} [${error.class}: ${error.message}]` : `${summary.analyst_id} [error details unavailable]`;
6522
+ }).join("; ");
6523
+ const suffix = details ? `; failures: ${details}` : "";
6524
+ return new Error(
6525
+ `traceAnalystProposer: analyst engine produced no findings \u2014 ${failed.length}/${result.per_analyst.length} analysts failed${suffix}`
6526
+ );
6527
+ }
6509
6528
 
6510
6529
  // src/campaign/scenario-selection.ts
6511
6530
  var DEFAULT_SATURATION_CEILING = 0.999;
@@ -8260,4 +8279,4 @@ export {
8260
8279
  verifyCodeSurface,
8261
8280
  resolveWorktreePath
8262
8281
  };
8263
- //# sourceMappingURL=chunk-ZDAKRZG5.js.map
8282
+ //# sourceMappingURL=chunk-CWF6SCBK.js.map