@tangle-network/agent-eval 0.124.0 → 0.125.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/benchmarks/index.js +1 -1
- package/dist/campaign/index.d.ts +9 -1
- package/dist/campaign/index.js +1 -1
- package/dist/{chunk-5PVZVCZB.js → chunk-A62YMFWA.js} +83 -4
- package/dist/{chunk-5PVZVCZB.js.map → chunk-A62YMFWA.js.map} +1 -1
- package/dist/{chunk-4Y7AAATF.js → chunk-LKKT3IVV.js} +574 -81
- package/dist/chunk-LKKT3IVV.js.map +1 -0
- package/dist/chunk-M7AH34KV.js +155 -0
- package/dist/chunk-M7AH34KV.js.map +1 -0
- package/dist/chunk-VBQ3CRKH.js +291 -0
- package/dist/chunk-VBQ3CRKH.js.map +1 -0
- package/dist/index.d.ts +138 -4
- package/dist/index.js +8 -4
- package/dist/index.js.map +1 -1
- package/dist/openapi.json +1 -1
- package/dist/rollout/index.d.ts +9 -1
- package/dist/rollout/index.js +6 -6
- package/dist/supervisor-run/index.d.ts +156 -4
- package/dist/supervisor-run/index.js +14 -2
- package/package.json +1 -1
- package/dist/chunk-4Y7AAATF.js.map +0 -1
- package/dist/chunk-MGGFVCJ7.js +0 -288
- package/dist/chunk-MGGFVCJ7.js.map +0 -1
- package/dist/chunk-R7ZRE2KV.js +0 -138
- package/dist/chunk-R7ZRE2KV.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -50,6 +50,18 @@ All notable changes to `@tangle-network/agent-eval` and its sibling `agent-eval-
|
|
|
50
50
|
- `runSkillOpt({ holdoutScenarios })` fails closed because those rows are adaptively reused.
|
|
51
51
|
Pass `selectionScenarios`; selection result fields now use `Selection` instead of `Holdout`, and `lift` is now `selectionLift`.
|
|
52
52
|
|
|
53
|
+
## [0.125.0] — 2026-07-24 — Claude Code supervision reader and path-bound policy edits
|
|
54
|
+
|
|
55
|
+
### Added
|
|
56
|
+
|
|
57
|
+
- `claudeCodeSupervisorRunReader()` reads Claude Code root and subagent transcripts into the existing supervision-tree report and rollout formats, while declaring source limits instead of fabricating unavailable spend, verdict, or deliverable data.
|
|
58
|
+
- `llmPolicyEditProposer({ valueSchemaByJsonPath })` binds each allowed edit path to an exact JSON Schema in both the provider response contract and local admission.
|
|
59
|
+
|
|
60
|
+
### Fixed
|
|
61
|
+
|
|
62
|
+
- Deduplicate repeated Claude Code worker cancellation events and preserve available worker cache-token counts.
|
|
63
|
+
- Reject policy-edit values that do not match their target path before a candidate can enter a campaign.
|
|
64
|
+
|
|
53
65
|
## [0.124.0] — 2026-07-24 — rollout and supervisor-run subpaths
|
|
54
66
|
|
|
55
67
|
### Added
|
package/dist/benchmarks/index.js
CHANGED
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
runBenchmarkAdapter,
|
|
18
18
|
summarizeBenchmarkCampaign
|
|
19
19
|
} from "../chunk-JKDNAOF5.js";
|
|
20
|
-
import "../chunk-
|
|
20
|
+
import "../chunk-A62YMFWA.js";
|
|
21
21
|
import "../chunk-PMITBABE.js";
|
|
22
22
|
import "../chunk-D5JZ7UDZ.js";
|
|
23
23
|
import "../chunk-DT7OXY3C.js";
|
package/dist/campaign/index.d.ts
CHANGED
|
@@ -5841,6 +5841,8 @@ type PolicyEditFindingSource = {
|
|
|
5841
5841
|
kind: 'global';
|
|
5842
5842
|
label: string;
|
|
5843
5843
|
};
|
|
5844
|
+
/** Exact JSON Schema applied to authored `change.value` for one allowed path. */
|
|
5845
|
+
type PolicyEditJsonValueSchema = Readonly<Record<string, unknown>>;
|
|
5844
5846
|
/** Trace-derived findings must name the measured profile that produced them.
|
|
5845
5847
|
* Cross-run doctrine can be explicitly global; an unwrapped finding is rejected. */
|
|
5846
5848
|
interface PolicyEditFindingInput {
|
|
@@ -5936,6 +5938,12 @@ interface LlmPolicyEditProposerOptions {
|
|
|
5936
5938
|
targetSurface: JsonPolicyEditTargetSurface;
|
|
5937
5939
|
/** Exact JSON paths the author may change. Prefix or fuzzy matches are not accepted. */
|
|
5938
5940
|
allowedJsonPaths: readonly string[];
|
|
5941
|
+
/**
|
|
5942
|
+
* Optional exact JSON Schema for `change.value` at every allowed path.
|
|
5943
|
+
* When present, keys must exactly match `allowedJsonPaths`; both the provider
|
|
5944
|
+
* response schema and local validation bind each path to its own value shape.
|
|
5945
|
+
*/
|
|
5946
|
+
valueSchemaByJsonPath?: Readonly<Record<string, PolicyEditJsonValueSchema>>;
|
|
5939
5947
|
/** Caller-owned search objective bound into every authored forecast. */
|
|
5940
5948
|
objectives: readonly PolicyEditObjective[];
|
|
5941
5949
|
/** Default: evidence-only, so uncertain edits are measured rather than
|
|
@@ -7765,4 +7773,4 @@ declare function verifyCodeSurface(surface: CodeSurface, worktreeDir?: string):
|
|
|
7765
7773
|
* identity against the checkout at `worktreeRef`. */
|
|
7766
7774
|
declare function resolveWorktreePath(surface: CodeSurface, worktreeDir?: string): string;
|
|
7767
7775
|
|
|
7768
|
-
export { type AcceptedEdit, type AceProposerOptions, type AnalystArtifact, type AnalystScenario, type AnalyzeCrossSurfaceInteractionsInput, type AnalyzeOtlpTraceFileOptions, type ApplySkillPatchResult, type AxisEvidence, type AxisVerdict, type BuildAnalystSurfaceDispatchOptions, type BuildEvidenceVectorOptions, type BuildLoopProvenanceArgs, type BuiltinOptimizationMethodConfig, 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 CompareOptimizationMethodsOptions, type ComparisonCost, 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 FapoFailureCluster, type FapoOptimizationLevel, type FapoOptimizationMethodConfig, 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 GepaEngineRun, type GepaOptimizationMethodConfig, type GepaOptimizationRecipe, type GepaProposerConstraints, type GepaProposerOptions, type GepaRunnerCommand, 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 OptimizationMethod, type OptimizationMethodComparison, type OptimizationMethodInput, type OptimizationMethodPairwise, type OptimizationMethodResult, type OptimizationMethodRunOptions, type OptimizationMethodScore, type OptimizationProposer, type OptimizerConfig, 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 PolicyEditAuthorScenarioOrder, 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 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, analyzeOtlpTraceFile, applySkillPatch, assertCampaignDesign, assertCampaignSplitIdentity, assertCodeSurfaceIdentity, assertPolicyEditAuthorContextBudget, buildAnalystSurfaceDispatch, buildEvidenceVector, buildLoopProvenanceRecord, callbackGovernor, campaignBreakdown, campaignLineageStore, campaignMeanComposite, campaignMeasurementDigest, campaignScenarioIdentity, campaignSplitDigest, campaignSplitDigestFromIdentities, canonicalDigest, classifyUngroundedLiterals, codeSurfaceIdentityMaterial, compareOptimizationMethods, composeGate, compositeProposer, costFromLedgerSummary, countSentenceEdits, createReferenceEquivalenceJudge, createRunCostLedger, defaultProductionGate, detectScale, dimensionRegressions, discoverEvalFixtures, emitLoopProvenance, evolutionaryProposer, extractFapoAttributionSignals, extractH2Sections, failureModeRecallJudge, fapoEscalationMethod, fapoProposer, fsCampaignStorage, fsLineageStore, gepaOptimizationMethod, gepaParetoMethod, gepaProposer, gepaReflectionMethod, 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, skillOptMethod, skillOptProposer, surfaceContentHash, surfaceHash, tangleTracesRoot, traceAnalystProposer, userStoryScoreboard, validatePolicyEditCandidateRecord, validateSearchLedgerEvent, verifyCodeSurface, verifyLoopProvenanceRecord };
|
|
7776
|
+
export { type AcceptedEdit, type AceProposerOptions, type AnalystArtifact, type AnalystScenario, type AnalyzeCrossSurfaceInteractionsInput, type AnalyzeOtlpTraceFileOptions, type ApplySkillPatchResult, type AxisEvidence, type AxisVerdict, type BuildAnalystSurfaceDispatchOptions, type BuildEvidenceVectorOptions, type BuildLoopProvenanceArgs, type BuiltinOptimizationMethodConfig, 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 CompareOptimizationMethodsOptions, type ComparisonCost, 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 FapoFailureCluster, type FapoOptimizationLevel, type FapoOptimizationMethodConfig, 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 GepaEngineRun, type GepaOptimizationMethodConfig, type GepaOptimizationRecipe, type GepaProposerConstraints, type GepaProposerOptions, type GepaRunnerCommand, 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 OptimizationMethod, type OptimizationMethodComparison, type OptimizationMethodInput, type OptimizationMethodPairwise, type OptimizationMethodResult, type OptimizationMethodRunOptions, type OptimizationMethodScore, type OptimizationProposer, type OptimizerConfig, 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 PolicyEditAuthorScenarioOrder, type PolicyEditAuthorScenarioRow, type PolicyEditCandidateRecord, type PolicyEditCandidateSummary, type PolicyEditFindingInput, type PolicyEditFindingSource, type PolicyEditHistoryCandidateContext, type PolicyEditHistoryGenerationContext, type PolicyEditHistoryProjectionOptions, type PolicyEditJsonValueSchema, 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 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, analyzeOtlpTraceFile, applySkillPatch, assertCampaignDesign, assertCampaignSplitIdentity, assertCodeSurfaceIdentity, assertPolicyEditAuthorContextBudget, buildAnalystSurfaceDispatch, buildEvidenceVector, buildLoopProvenanceRecord, callbackGovernor, campaignBreakdown, campaignLineageStore, campaignMeanComposite, campaignMeasurementDigest, campaignScenarioIdentity, campaignSplitDigest, campaignSplitDigestFromIdentities, canonicalDigest, classifyUngroundedLiterals, codeSurfaceIdentityMaterial, compareOptimizationMethods, composeGate, compositeProposer, costFromLedgerSummary, countSentenceEdits, createReferenceEquivalenceJudge, createRunCostLedger, defaultProductionGate, detectScale, dimensionRegressions, discoverEvalFixtures, emitLoopProvenance, evolutionaryProposer, extractFapoAttributionSignals, extractH2Sections, failureModeRecallJudge, fapoEscalationMethod, fapoProposer, fsCampaignStorage, fsLineageStore, gepaOptimizationMethod, gepaParetoMethod, gepaProposer, gepaReflectionMethod, 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, skillOptMethod, skillOptProposer, surfaceContentHash, surfaceHash, tangleTracesRoot, traceAnalystProposer, userStoryScoreboard, validatePolicyEditCandidateRecord, validateSearchLedgerEvent, verifyCodeSurface, verifyLoopProvenanceRecord };
|
package/dist/campaign/index.js
CHANGED
|
@@ -6329,7 +6329,7 @@ var POLICY_EDIT_AUTHOR_JSON_SCHEMA = {
|
|
|
6329
6329
|
}
|
|
6330
6330
|
}
|
|
6331
6331
|
};
|
|
6332
|
-
function policyEditAuthorJsonSchema(maxItems, allowedJsonPaths) {
|
|
6332
|
+
function policyEditAuthorJsonSchema(maxItems, allowedJsonPaths, valueSchemaByJsonPath) {
|
|
6333
6333
|
const schema = JSON.parse(JSON.stringify(POLICY_EDIT_AUTHOR_JSON_SCHEMA));
|
|
6334
6334
|
const properties = schema.properties;
|
|
6335
6335
|
const edits = properties.edits;
|
|
@@ -6339,8 +6339,32 @@ function policyEditAuthorJsonSchema(maxItems, allowedJsonPaths) {
|
|
|
6339
6339
|
const target = itemProperties.target;
|
|
6340
6340
|
const targetProperties = target.properties;
|
|
6341
6341
|
targetProperties.path = { type: "string", enum: [...allowedJsonPaths] };
|
|
6342
|
+
if (valueSchemaByJsonPath) {
|
|
6343
|
+
edits.items = {
|
|
6344
|
+
anyOf: allowedJsonPaths.map(
|
|
6345
|
+
(path) => policyEditAuthorItemJsonSchema(item, path, valueSchemaByJsonPath.get(path))
|
|
6346
|
+
)
|
|
6347
|
+
};
|
|
6348
|
+
}
|
|
6342
6349
|
return schema;
|
|
6343
6350
|
}
|
|
6351
|
+
function policyEditAuthorItemJsonSchema(item, path, valueSchema) {
|
|
6352
|
+
const branch = structuredClone(item);
|
|
6353
|
+
const properties = branch.properties;
|
|
6354
|
+
const target = properties.target;
|
|
6355
|
+
const targetProperties = target.properties;
|
|
6356
|
+
targetProperties.path = { const: path };
|
|
6357
|
+
const change = properties.change;
|
|
6358
|
+
const changeBranches = change.anyOf;
|
|
6359
|
+
for (const changeBranch of changeBranches) {
|
|
6360
|
+
const changeProperties = changeBranch.properties;
|
|
6361
|
+
const mode = changeProperties.mode;
|
|
6362
|
+
if (mode.const !== "remove") {
|
|
6363
|
+
changeProperties.value = structuredClone(valueSchema);
|
|
6364
|
+
}
|
|
6365
|
+
}
|
|
6366
|
+
return branch;
|
|
6367
|
+
}
|
|
6344
6368
|
var DEFAULT_POLICY_EDIT_HISTORY_LIMITS = Object.freeze({
|
|
6345
6369
|
generations: 4,
|
|
6346
6370
|
candidatesPerGeneration: 16,
|
|
@@ -6370,6 +6394,7 @@ function policyEditAuthorSystem(responseSchema) {
|
|
|
6370
6394
|
function llmPolicyEditProposer(opts) {
|
|
6371
6395
|
const allowedJsonPaths = validateAllowedJsonPaths(opts.allowedJsonPaths);
|
|
6372
6396
|
const allowedPathSet = new Set(allowedJsonPaths);
|
|
6397
|
+
const pathValueSchemas = validatePathValueSchemas(opts.valueSchemaByJsonPath, allowedJsonPaths);
|
|
6373
6398
|
const objectives = validateObjectives(opts.objectives);
|
|
6374
6399
|
const objectiveByKey = new Map(objectives.map((objective) => [objective.key, objective]));
|
|
6375
6400
|
requireNonEmpty(opts.model, "model");
|
|
@@ -6464,7 +6489,11 @@ function llmPolicyEditProposer(opts) {
|
|
|
6464
6489
|
objectiveByKey
|
|
6465
6490
|
)
|
|
6466
6491
|
};
|
|
6467
|
-
const responseSchema = policyEditAuthorJsonSchema(
|
|
6492
|
+
const responseSchema = policyEditAuthorJsonSchema(
|
|
6493
|
+
limit,
|
|
6494
|
+
allowedJsonPaths,
|
|
6495
|
+
pathValueSchemas?.schemas
|
|
6496
|
+
);
|
|
6468
6497
|
const system = policyEditAuthorSystem(responseSchema);
|
|
6469
6498
|
assertPolicyEditAuthorContextBudget(
|
|
6470
6499
|
{ system, authorContext, responseSchema },
|
|
@@ -6517,6 +6546,7 @@ function llmPolicyEditProposer(opts) {
|
|
|
6517
6546
|
findingByKey,
|
|
6518
6547
|
opts.targetSurface,
|
|
6519
6548
|
allowedPathSet,
|
|
6549
|
+
pathValueSchemas?.validators,
|
|
6520
6550
|
objectives[0],
|
|
6521
6551
|
ctx.incumbentOutcome?.composite ?? ctx.baselineOutcome?.composite
|
|
6522
6552
|
)
|
|
@@ -6963,12 +6993,23 @@ function parseAuthorResponse(value) {
|
|
|
6963
6993
|
const issues = parsed.error.issues.map((issue) => `${issue.path.join(".") || "<root>"}: ${issue.message}`).join("; ");
|
|
6964
6994
|
throw new Error(`llmPolicyEditProposer: invalid PolicyEdit response: ${issues}`);
|
|
6965
6995
|
}
|
|
6966
|
-
function bindAuthoredEdit(draft, findingByKey, targetSurface, allowedPaths, objective, currentComposite) {
|
|
6996
|
+
function bindAuthoredEdit(draft, findingByKey, targetSurface, allowedPaths, valueValidatorByJsonPath, objective, currentComposite) {
|
|
6967
6997
|
if (!allowedPaths.has(draft.target.path)) {
|
|
6968
6998
|
throw new Error(
|
|
6969
6999
|
`llmPolicyEditProposer: JSON path '${draft.target.path}' is outside allowedJsonPaths`
|
|
6970
7000
|
);
|
|
6971
7001
|
}
|
|
7002
|
+
if (draft.change.mode !== "remove") {
|
|
7003
|
+
const valueValidator = valueValidatorByJsonPath?.get(draft.target.path);
|
|
7004
|
+
if (valueValidator) {
|
|
7005
|
+
const parsedValue = valueValidator.safeParse(draft.change.value);
|
|
7006
|
+
if (!parsedValue.success) {
|
|
7007
|
+
throw new Error(
|
|
7008
|
+
`llmPolicyEditProposer: change.value for JSON path '${draft.target.path}' does not match valueSchemaByJsonPath (${formatJsonValidationError(parsedValue.error)})`
|
|
7009
|
+
);
|
|
7010
|
+
}
|
|
7011
|
+
}
|
|
7012
|
+
}
|
|
6972
7013
|
const cited = draft.source.findingKeys.map((findingKey) => {
|
|
6973
7014
|
const finding = findingByKey.get(findingKey);
|
|
6974
7015
|
if (!finding) {
|
|
@@ -7221,6 +7262,44 @@ function validateAllowedJsonPaths(paths) {
|
|
|
7221
7262
|
}
|
|
7222
7263
|
return [...paths];
|
|
7223
7264
|
}
|
|
7265
|
+
function validatePathValueSchemas(input, allowedJsonPaths) {
|
|
7266
|
+
if (input === void 0) return void 0;
|
|
7267
|
+
if (!input || typeof input !== "object" || Array.isArray(input)) {
|
|
7268
|
+
throw new Error("llmPolicyEditProposer: valueSchemaByJsonPath must be a JSON object");
|
|
7269
|
+
}
|
|
7270
|
+
const allowed = new Set(allowedJsonPaths);
|
|
7271
|
+
const suppliedPaths = Object.keys(input);
|
|
7272
|
+
const missing = allowedJsonPaths.filter((path) => !Object.hasOwn(input, path));
|
|
7273
|
+
const unexpected = suppliedPaths.filter((path) => !allowed.has(path));
|
|
7274
|
+
if (missing.length > 0 || unexpected.length > 0) {
|
|
7275
|
+
throw new Error(
|
|
7276
|
+
`llmPolicyEditProposer: valueSchemaByJsonPath keys must exactly match allowedJsonPaths (missing: ${missing.join(", ") || "none"}; unexpected: ${unexpected.join(", ") || "none"})`
|
|
7277
|
+
);
|
|
7278
|
+
}
|
|
7279
|
+
const schemas = /* @__PURE__ */ new Map();
|
|
7280
|
+
const validators = /* @__PURE__ */ new Map();
|
|
7281
|
+
for (const path of allowedJsonPaths) {
|
|
7282
|
+
const parsed = JsonValueSchema.safeParse(input[path]);
|
|
7283
|
+
if (!parsed.success || !parsed.data || typeof parsed.data !== "object" || Array.isArray(parsed.data)) {
|
|
7284
|
+
const detail = parsed.success ? "expected a JSON object" : formatJsonValidationError(parsed.error);
|
|
7285
|
+
throw new Error(
|
|
7286
|
+
`llmPolicyEditProposer: valueSchemaByJsonPath['${path}'] must be a valid JSON Schema object (${detail})`
|
|
7287
|
+
);
|
|
7288
|
+
}
|
|
7289
|
+
const schema = parsed.data;
|
|
7290
|
+
let validator;
|
|
7291
|
+
try {
|
|
7292
|
+
validator = z.fromJSONSchema(schema);
|
|
7293
|
+
} catch (error) {
|
|
7294
|
+
throw new Error(
|
|
7295
|
+
`llmPolicyEditProposer: valueSchemaByJsonPath['${path}'] is unsupported (${error instanceof Error ? error.message : String(error)})`
|
|
7296
|
+
);
|
|
7297
|
+
}
|
|
7298
|
+
schemas.set(path, schema);
|
|
7299
|
+
validators.set(path, validator);
|
|
7300
|
+
}
|
|
7301
|
+
return { schemas, validators };
|
|
7302
|
+
}
|
|
7224
7303
|
function requireNonEmpty(value, field) {
|
|
7225
7304
|
if (!value || value.trim() !== value) {
|
|
7226
7305
|
throw new Error(`llmPolicyEditProposer: ${field} must be a trimmed non-empty string`);
|
|
@@ -9187,4 +9266,4 @@ export {
|
|
|
9187
9266
|
verifyCodeSurface,
|
|
9188
9267
|
resolveWorktreePath
|
|
9189
9268
|
};
|
|
9190
|
-
//# sourceMappingURL=chunk-
|
|
9269
|
+
//# sourceMappingURL=chunk-A62YMFWA.js.map
|