@tangle-network/agent-eval 0.110.0 → 0.110.1
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 +9 -0
- package/dist/benchmarks/index.js +2 -2
- package/dist/campaign/index.d.ts +49 -4
- package/dist/campaign/index.js +4 -2
- package/dist/{chunk-RNB2NICW.js → chunk-GBI5J5DB.js} +72 -2
- package/dist/chunk-GBI5J5DB.js.map +1 -0
- package/dist/{chunk-GTERJI6Q.js → chunk-J4AKLZEV.js} +12 -1
- package/dist/{chunk-GTERJI6Q.js.map → chunk-J4AKLZEV.js.map} +1 -1
- package/dist/contract/index.d.ts +10 -9
- package/dist/contract/index.js +1 -1
- package/dist/contract/index.js.map +1 -1
- package/dist/{gepa-BUNP3606.d.ts → gepa-T8T215nw.d.ts} +6 -4
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/openapi.json +1 -1
- package/dist/{provenance-DMvsfknv.d.ts → provenance-CyxkvEi9.d.ts} +1 -1
- package/docs/improvement-glossary.md +14 -13
- package/package.json +1 -1
- package/dist/chunk-RNB2NICW.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,15 @@ All notable changes to `@tangle-network/agent-eval` and its sibling `agent-eval-
|
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
+
## [0.110.1] — 2026-07-09 — proposer portfolio export
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- Exported the existing `compositeProposer` and `CompositeProposerOptions` from `@tangle-network/agent-eval/campaign`, so consumers can split one population budget across GEPA, SkillOpt, FAPO, memory, trace-analysis, or other proposers without copying the portfolio implementation.
|
|
12
|
+
- Added a packed-package import check for the export.
|
|
13
|
+
|
|
14
|
+
No proposer behavior changed.
|
|
15
|
+
|
|
7
16
|
## [0.108.1] — 2026-07-08 — public catalog docs patch
|
|
8
17
|
|
|
9
18
|
### Fixed
|
package/dist/benchmarks/index.js
CHANGED
|
@@ -17,8 +17,8 @@ import {
|
|
|
17
17
|
runBenchmarkAdapter,
|
|
18
18
|
summarizeBenchmarkCampaign
|
|
19
19
|
} from "../chunk-T6W5ADLG.js";
|
|
20
|
-
import "../chunk-
|
|
21
|
-
import "../chunk-
|
|
20
|
+
import "../chunk-GBI5J5DB.js";
|
|
21
|
+
import "../chunk-J4AKLZEV.js";
|
|
22
22
|
import "../chunk-VI2UW6B6.js";
|
|
23
23
|
import "../chunk-3PFZBGMR.js";
|
|
24
24
|
import "../chunk-2IY4ILP4.js";
|
package/dist/campaign/index.d.ts
CHANGED
|
@@ -3,11 +3,11 @@ export { L as LlmJudgeDimension, c as LlmJudgeOptions, l as llmJudge } from '../
|
|
|
3
3
|
import { A as AnalyzeTracesOptions, a as AnalyzeTracesInput, b as AnalyzeTracesResult } from '../analyst-C8HHvfJp.js';
|
|
4
4
|
import { S as Scenario, M as MutableSurface, D as DispatchContext, b as JudgeConfig, g as Gate, e as GenerationRecord, J as JudgeScore, L as LabeledScenarioStore, s as LabeledScenarioWrite, t as LabeledScenarioSampleArgs, u as LabeledScenarioRecord, v as LabelTrust, f as SurfaceProposer, w as ProposedCandidate, x as ProposeContext, y as LabeledScenarioSource, C as CampaignResult, m as CodeSurface } from '../types-v--ctu-b.js';
|
|
5
5
|
export { i as CampaignAggregates, j as CampaignArtifactWriter, k as CampaignCellResult, l as CampaignCostMeter, z as CampaignTokenUsage, d as CampaignTraceWriter, c as DispatchFn, n as GateContext, h as GateDecision, G as GateResult, o as GenerationCandidate, A as JudgeAggregate, a as JudgeDimension, p as Mutator, O as OptimizationProposer, q as OptimizerConfig, P as ParetoParent, R as RedactionStatus, B as ScenarioAggregate, r as SessionScript, T as TraceSpan, E as isProposedCandidate, F as labelTrustRank } from '../types-v--ctu-b.js';
|
|
6
|
-
import { C as CampaignRunPlan, P as PlanCampaignRunOptions, b as RunCampaignOptions, c as RunImprovementLoopOptions } from '../gepa-
|
|
7
|
-
export { f as CampaignRunPlanCell, h as GepaProposerConstraints, G as GepaProposerOptions, O as OpenAutoPrOptions, i as OpenAutoPrResult, a as RunImprovementLoopResult, R as RunOptimizationOptions, j as RunOptimizationResult, k as countSentenceEdits, l as defaultRenderDiff, m as extractH2Sections, g as gepaProposer, o as openAutoPr, p as planCampaignRun, r as runCampaign, d as runImprovementLoop, n as runOptimization, s as surfaceHash } from '../gepa-
|
|
6
|
+
import { C as CampaignRunPlan, P as PlanCampaignRunOptions, b as RunCampaignOptions, c as RunImprovementLoopOptions } from '../gepa-T8T215nw.js';
|
|
7
|
+
export { f as CampaignRunPlanCell, h as GepaProposerConstraints, G as GepaProposerOptions, O as OpenAutoPrOptions, i as OpenAutoPrResult, a as RunImprovementLoopResult, R as RunOptimizationOptions, j as RunOptimizationResult, k as countSentenceEdits, l as defaultRenderDiff, m as extractH2Sections, g as gepaProposer, o as openAutoPr, p as planCampaignRun, r as runCampaign, d as runImprovementLoop, n as runOptimization, s as surfaceHash } from '../gepa-T8T215nw.js';
|
|
8
8
|
import { C as CampaignStorage } from '../storage-Dw_f7WMt.js';
|
|
9
9
|
export { f as fsCampaignStorage, i as inMemoryCampaignStorage } from '../storage-Dw_f7WMt.js';
|
|
10
|
-
export { A as AxisEvidence, a as AxisVerdict, B as BuildEvidenceVectorOptions, l as BuildLoopProvenanceArgs, D as DefaultProductionGateOptions, m as EmitLoopProvenanceArgs, n as EmitLoopProvenanceResult, E as EvidenceVector, b as EvolutionaryProposerOptions, H as HeldOutGateOptions, o as LoopProvenanceBackend, q as LoopProvenanceCandidate, L as LoopProvenanceRecord, O as ObjectiveSource, c as ParetoSignificanceGateOptions, P as PowerPreflight, s as PowerPreflightOptions, d as PromotionObjective, e as PromotionPolicy, R as RunEvalOptions, f as buildEvidenceVector, t as buildLoopProvenanceRecord, g as composeGate, h as defaultProductionGate, u as emitLoopProvenance, i as evolutionaryProposer, j as heldOutGate, v as loopProvenanceSpans, p as paretoPolicy, k as paretoSignificanceGate, w as powerPreflight, x as provenanceRecordPath, y as provenanceSpansPath, r as runEval, z as surfaceContentHash } from '../provenance-
|
|
10
|
+
export { A as AxisEvidence, a as AxisVerdict, B as BuildEvidenceVectorOptions, l as BuildLoopProvenanceArgs, D as DefaultProductionGateOptions, m as EmitLoopProvenanceArgs, n as EmitLoopProvenanceResult, E as EvidenceVector, b as EvolutionaryProposerOptions, H as HeldOutGateOptions, o as LoopProvenanceBackend, q as LoopProvenanceCandidate, L as LoopProvenanceRecord, O as ObjectiveSource, c as ParetoSignificanceGateOptions, P as PowerPreflight, s as PowerPreflightOptions, d as PromotionObjective, e as PromotionPolicy, R as RunEvalOptions, f as buildEvidenceVector, t as buildLoopProvenanceRecord, g as composeGate, h as defaultProductionGate, u as emitLoopProvenance, i as evolutionaryProposer, j as heldOutGate, v as loopProvenanceSpans, p as paretoPolicy, k as paretoSignificanceGate, w as powerPreflight, x as provenanceRecordPath, y as provenanceSpansPath, r as runEval, z as surfaceContentHash } from '../provenance-CyxkvEi9.js';
|
|
11
11
|
import { E as EProcessState, a as PairedBootstrapResult } from '../statistics-D88peojY.js';
|
|
12
12
|
import { L as LlmClientOptions } from '../llm-client-DyqEH4jH.js';
|
|
13
13
|
import { AgentProfile } from '@tangle-network/agent-interface';
|
|
@@ -1836,6 +1836,51 @@ interface AceProposerOptions {
|
|
|
1836
1836
|
*/
|
|
1837
1837
|
declare function aceProposer(opts?: AceProposerOptions): SurfaceProposer;
|
|
1838
1838
|
|
|
1839
|
+
/**
|
|
1840
|
+
* `compositeProposer` — run N proposers TOGETHER on the same surface.
|
|
1841
|
+
*
|
|
1842
|
+
* The question this answers ("why can't we combine GEPA + skillOpt + ACE + a
|
|
1843
|
+
* trace-analyst?"): nothing in the loop cares where candidates come from — the
|
|
1844
|
+
* generation's population is one pool and the Pareto frontier / promotion logic
|
|
1845
|
+
* evaluates every candidate identically. The only missing piece was a proposer
|
|
1846
|
+
* that fans the population budget out across members and merges their proposals.
|
|
1847
|
+
* This is that piece.
|
|
1848
|
+
*
|
|
1849
|
+
* Semantics:
|
|
1850
|
+
* - Budget: each member is asked for a share of `populationSize`
|
|
1851
|
+
* (near-equal split by default, or explicit `weights`). Members may return
|
|
1852
|
+
* fewer; the pool is topped up round-robin from members that can offer more
|
|
1853
|
+
* is NOT attempted — proposers are not obligated to be re-entrant.
|
|
1854
|
+
* - Provenance: every candidate's `label` is prefixed with its member's kind
|
|
1855
|
+
* (`gepa:...`, `skill-opt:...`) so generation records and the promotion
|
|
1856
|
+
* provenance attribute each winner to the proposer family that made it —
|
|
1857
|
+
* the cheap, honest version of proposer-level credit assignment.
|
|
1858
|
+
* - Dedup: identical surfaces from different members collapse to the first.
|
|
1859
|
+
* - Failure isolation: one member throwing does not sink the generation; its
|
|
1860
|
+
* error is logged into the surviving candidates' generation via a warning
|
|
1861
|
+
* and the pool proceeds (a generation with zero candidates from all members
|
|
1862
|
+
* failing still throws — that is a real failure).
|
|
1863
|
+
* - Early stop: the composite stops only when EVERY member with a `decide`
|
|
1864
|
+
* votes stop (a member without `decide` never votes stop).
|
|
1865
|
+
*
|
|
1866
|
+
* This is deliberately NOT joint multi-surface mutation: every member mutates
|
|
1867
|
+
* the SAME `MutableSurface`. Joint profile-patch surfaces (prompt+skills+tools
|
|
1868
|
+
* in one candidate) require the composite-surface contract and measured
|
|
1869
|
+
* component attribution — see the experiment-optimal research brief.
|
|
1870
|
+
*/
|
|
1871
|
+
|
|
1872
|
+
interface CompositeProposerOptions<TFindings = unknown> {
|
|
1873
|
+
/** Member proposers, in priority order (earlier members get the larger share
|
|
1874
|
+
* of an uneven split). At least one required. */
|
|
1875
|
+
proposers: Array<SurfaceProposer<TFindings>>;
|
|
1876
|
+
/** Optional population-share weights, same length as `proposers`. Need not
|
|
1877
|
+
* sum to anything; shares are proportional. Default: equal. */
|
|
1878
|
+
weights?: number[];
|
|
1879
|
+
}
|
|
1880
|
+
/** Fan the population budget across N proposers and merge their candidates into
|
|
1881
|
+
* one generation pool, with per-member provenance labels. */
|
|
1882
|
+
declare function compositeProposer<TFindings = unknown>(opts: CompositeProposerOptions<TFindings>): SurfaceProposer<TFindings>;
|
|
1883
|
+
|
|
1839
1884
|
/**
|
|
1840
1885
|
* `haloProposer` — wraps the REAL halo-engine (Inference.net's hierarchical
|
|
1841
1886
|
* agentic trace analyzer, `pip install halo-engine`, repo context-labs/halo)
|
|
@@ -2216,4 +2261,4 @@ declare function gitWorktreeAdapter(opts: GitWorktreeAdapterOptions): WorktreeAd
|
|
|
2216
2261
|
* as a ref under the adapter's worktree dir. */
|
|
2217
2262
|
declare function resolveWorktreePath(surface: CodeSurface, worktreeDir?: string): string;
|
|
2218
2263
|
|
|
2219
|
-
export { type AcceptedEdit, type AceProposerOptions, type AnalystArtifact, type AnalystScenario, type ApplySkillPatchResult, type BuildAnalystSurfaceDispatchOptions, type CampaignBreakdown, CampaignResult, CampaignRunPlan, CampaignStorage, CodeSurface, type CompareProposersOptions, type DimensionRegression, type DiscriminationScore, DispatchContext, type EvalFixture, type EvalFixtureFile, type EvalFixtureLoadOptions, type EvalFixtureRunPlan, type EvalFixtureScenario, type EvalFixtureValidationMode, type FailureModeRecallJudgeOptions, type FapoAttributionSignals, type FapoEntryConfig, type FapoFailureCluster, type FapoOptimizationLevel, type FapoProposerOptions, type FapoReviewInput, type FapoReviewIssue, type FapoReviewResult, type FapoScopeContract, FsLabeledScenarioStore, type FsLabeledScenarioStoreOptions, Gate, GenerationRecord, type GitWorktreeAdapterOptions, type Governor, type GovernorContext, type GovernorOp, type HaloProposerOptions, type HeldoutSignificance, type HeldoutSignificanceOptions, type HeuristicGovernorOptions, type JsonPrimitive, type JsonValue, JudgeConfig, JudgeScore, LabelTrust, LabeledScenarioRecord, LabeledScenarioSampleArgs, LabeledScenarioSource, LabeledScenarioStore, LabeledScenarioStoreError, LabeledScenarioWrite, Lineage, type LineageEdge, type LineageGraph, type LineageNode, type LineageNodeInput, type LineageStore, type LoadEvalFixtureScenariosOptions, type MemoryCurationProposerOptions, MutableSurface, type NeutralizationGateOptions, type OptimizerEntryConfig, type PairedHoldout, type ParameterCandidate, type ParameterChange, type ParameterSweepProposerOptions, PlanCampaignRunOptions, type PlanEvalFixtureRunOptions, type PlaybackContext, type PlaybackDriver, type PlaybackStep, type PolicyEditProposerOptions, type ProfileDispatchFn, ProfileMatrixError, type ProfileSummary, ProposeContext, type ProposePatchesArgs, ProposedCandidate, type ProposerComparison, type ProposerEntry, type ProposerPairwise, type ProposerScore, type RejectedEdit, type RolloutArgumentDiff, type RolloutArgumentDiffOptions, type RolloutCall, RunCampaignOptions, RunImprovementLoopOptions, type RunLineageLoopOptions, type RunLineageLoopResult, type RunLineageLoopSeed, type RunLineageOptions, type RunLineageResult, type RunLineageSeed, type RunLineageStepResult, type RunProfileMatrixOptions, type RunProfileMatrixResult, type RunSkillOptOptions, type RunSkillOptResult, Scenario, type ScenarioRollup, type ScenarioSignal, type ScoreboardRenderOptions, type ScoreboardRow, type ScoreboardSummary, type ScoredRollout, type SequentialDecideFn, type SequentialDecideOptions, type SequentialDecision, type SequentialObservation, type SequentialPairedGate, type SequentialPairedGateOptions, type SingleRunLock, type SingleRunLockOptions, type SkillOptEpochRecord, type SkillOptEvidence, type SkillOptProposer, type SkillOptProposerOptions, type SkillPatch, type SkillPatchOp, SkillPatchParseError, type SkillPatchRejection, SurfaceProposer, type SurfaceScore, type TraceAnalystProposerOptions, type TransientFailureOptions, type UngroundedLiteralReport, type UserStory, type UserStoryVerdict, type Worktree, type WorktreeAdapter, WorktreeAdapterError, aceProposer, acquireSingleRunLock, applySkillPatch, buildAnalystSurfaceDispatch, callbackGovernor, campaignBreakdown, campaignMeanComposite, classifyUngroundedLiterals, compareProposers, detectScale, dimensionRegressions, discoverEvalFixtures, extractFapoAttributionSignals, failureModeRecallJudge, fapoEscalationEntry, fapoProposer, fsLineageStore, gepaParetoEntry, gepaReflectionEntry, gitWorktreeAdapter, haloProposer, heldoutSignificance, heuristicGovernor, isTransientTransportFailure, lineageNodeId, loadEvalFixture, loadEvalFixtureScenarios, makePlaybackDispatch, memLineageStore, memoryCurationProposer, neutralizationGate, neutralizeText, pairHoldout, parameterSweepProposer, parseSkillPatchResponse, patchEditCount, planEvalFixtureRun, policyEditProposer, renderScoreboardMarkdown, resolveRunDir, resolveWorktreePath, rolloutArgumentDiff, runLineage, runLineageLoop, runProfileMatrix, runSkillOpt, scoreDiscrimination, scoreUserStory, scoreboardSummary, selectDiscriminative, sequentialDecide, sequentialPairedGate, skillOptEntry, skillOptProposer, tangleTracesRoot, traceAnalystProposer, userStoryScoreboard };
|
|
2264
|
+
export { type AcceptedEdit, type AceProposerOptions, type AnalystArtifact, type AnalystScenario, type ApplySkillPatchResult, type BuildAnalystSurfaceDispatchOptions, type CampaignBreakdown, CampaignResult, CampaignRunPlan, CampaignStorage, CodeSurface, type CompareProposersOptions, type CompositeProposerOptions, type DimensionRegression, type DiscriminationScore, DispatchContext, type EvalFixture, type EvalFixtureFile, type EvalFixtureLoadOptions, type EvalFixtureRunPlan, type EvalFixtureScenario, type EvalFixtureValidationMode, type FailureModeRecallJudgeOptions, type FapoAttributionSignals, type FapoEntryConfig, type FapoFailureCluster, type FapoOptimizationLevel, type FapoProposerOptions, type FapoReviewInput, type FapoReviewIssue, type FapoReviewResult, type FapoScopeContract, FsLabeledScenarioStore, type FsLabeledScenarioStoreOptions, Gate, GenerationRecord, type GitWorktreeAdapterOptions, type Governor, type GovernorContext, type GovernorOp, type HaloProposerOptions, type HeldoutSignificance, type HeldoutSignificanceOptions, type HeuristicGovernorOptions, type JsonPrimitive, type JsonValue, JudgeConfig, JudgeScore, LabelTrust, LabeledScenarioRecord, LabeledScenarioSampleArgs, LabeledScenarioSource, LabeledScenarioStore, LabeledScenarioStoreError, LabeledScenarioWrite, Lineage, type LineageEdge, type LineageGraph, type LineageNode, type LineageNodeInput, type LineageStore, type LoadEvalFixtureScenariosOptions, type MemoryCurationProposerOptions, MutableSurface, type NeutralizationGateOptions, type OptimizerEntryConfig, type PairedHoldout, type ParameterCandidate, type ParameterChange, type ParameterSweepProposerOptions, PlanCampaignRunOptions, type PlanEvalFixtureRunOptions, type PlaybackContext, type PlaybackDriver, type PlaybackStep, type PolicyEditProposerOptions, type ProfileDispatchFn, ProfileMatrixError, type ProfileSummary, ProposeContext, type ProposePatchesArgs, ProposedCandidate, type ProposerComparison, type ProposerEntry, type ProposerPairwise, type ProposerScore, type RejectedEdit, type RolloutArgumentDiff, type RolloutArgumentDiffOptions, type RolloutCall, RunCampaignOptions, RunImprovementLoopOptions, type RunLineageLoopOptions, type RunLineageLoopResult, type RunLineageLoopSeed, type RunLineageOptions, type RunLineageResult, type RunLineageSeed, type RunLineageStepResult, type RunProfileMatrixOptions, type RunProfileMatrixResult, type RunSkillOptOptions, type RunSkillOptResult, Scenario, type ScenarioRollup, type ScenarioSignal, type ScoreboardRenderOptions, type ScoreboardRow, type ScoreboardSummary, type ScoredRollout, type SequentialDecideFn, type SequentialDecideOptions, type SequentialDecision, type SequentialObservation, type SequentialPairedGate, type SequentialPairedGateOptions, type SingleRunLock, type SingleRunLockOptions, type SkillOptEpochRecord, type SkillOptEvidence, type SkillOptProposer, type SkillOptProposerOptions, type SkillPatch, type SkillPatchOp, SkillPatchParseError, type SkillPatchRejection, SurfaceProposer, type SurfaceScore, type TraceAnalystProposerOptions, type TransientFailureOptions, type UngroundedLiteralReport, type UserStory, type UserStoryVerdict, type Worktree, type WorktreeAdapter, WorktreeAdapterError, aceProposer, acquireSingleRunLock, applySkillPatch, buildAnalystSurfaceDispatch, callbackGovernor, campaignBreakdown, campaignMeanComposite, classifyUngroundedLiterals, compareProposers, compositeProposer, detectScale, dimensionRegressions, discoverEvalFixtures, extractFapoAttributionSignals, failureModeRecallJudge, fapoEscalationEntry, fapoProposer, fsLineageStore, gepaParetoEntry, gepaReflectionEntry, gitWorktreeAdapter, haloProposer, heldoutSignificance, heuristicGovernor, isTransientTransportFailure, lineageNodeId, loadEvalFixture, loadEvalFixtureScenarios, makePlaybackDispatch, memLineageStore, memoryCurationProposer, neutralizationGate, neutralizeText, pairHoldout, parameterSweepProposer, parseSkillPatchResponse, patchEditCount, planEvalFixtureRun, policyEditProposer, renderScoreboardMarkdown, resolveRunDir, resolveWorktreePath, rolloutArgumentDiff, runLineage, runLineageLoop, runProfileMatrix, runSkillOpt, scoreDiscrimination, scoreUserStory, scoreboardSummary, selectDiscriminative, sequentialDecide, sequentialPairedGate, skillOptEntry, skillOptProposer, tangleTracesRoot, traceAnalystProposer, userStoryScoreboard };
|
package/dist/campaign/index.js
CHANGED
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
callbackGovernor,
|
|
13
13
|
classifyUngroundedLiterals,
|
|
14
14
|
compareProposers,
|
|
15
|
+
compositeProposer,
|
|
15
16
|
discoverEvalFixtures,
|
|
16
17
|
extractFapoAttributionSignals,
|
|
17
18
|
failureModeRecallJudge,
|
|
@@ -55,7 +56,7 @@ import {
|
|
|
55
56
|
skillOptProposer,
|
|
56
57
|
traceAnalystProposer,
|
|
57
58
|
userStoryScoreboard
|
|
58
|
-
} from "../chunk-
|
|
59
|
+
} from "../chunk-GBI5J5DB.js";
|
|
59
60
|
import {
|
|
60
61
|
buildEvidenceVector,
|
|
61
62
|
buildLoopProvenanceRecord,
|
|
@@ -88,7 +89,7 @@ import {
|
|
|
88
89
|
runOptimization,
|
|
89
90
|
surfaceContentHash,
|
|
90
91
|
surfaceHash
|
|
91
|
-
} from "../chunk-
|
|
92
|
+
} from "../chunk-J4AKLZEV.js";
|
|
92
93
|
import "../chunk-VI2UW6B6.js";
|
|
93
94
|
import {
|
|
94
95
|
fsCampaignStorage,
|
|
@@ -131,6 +132,7 @@ export {
|
|
|
131
132
|
classifyUngroundedLiterals,
|
|
132
133
|
compareProposers,
|
|
133
134
|
composeGate,
|
|
135
|
+
compositeProposer,
|
|
134
136
|
countSentenceEdits,
|
|
135
137
|
defaultProductionGate,
|
|
136
138
|
defaultRenderDiff,
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
renderAnalystEvidence,
|
|
11
11
|
runImprovementLoop,
|
|
12
12
|
surfaceHash
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-J4AKLZEV.js";
|
|
14
14
|
import {
|
|
15
15
|
estimateCost,
|
|
16
16
|
isModelPriced
|
|
@@ -3870,6 +3870,75 @@ ${block}` : block;
|
|
|
3870
3870
|
};
|
|
3871
3871
|
}
|
|
3872
3872
|
|
|
3873
|
+
// src/campaign/proposers/composite.ts
|
|
3874
|
+
function compositeProposer(opts) {
|
|
3875
|
+
const members = opts.proposers;
|
|
3876
|
+
if (members.length === 0)
|
|
3877
|
+
throw new Error("compositeProposer: at least one member proposer required");
|
|
3878
|
+
const weights = opts.weights ?? members.map(() => 1);
|
|
3879
|
+
if (weights.length !== members.length || weights.some((w) => !(w > 0))) {
|
|
3880
|
+
throw new Error("compositeProposer: weights must match proposers length and be positive");
|
|
3881
|
+
}
|
|
3882
|
+
return {
|
|
3883
|
+
kind: `composite(${members.map((m) => m.kind).join("+")})`,
|
|
3884
|
+
async propose(ctx) {
|
|
3885
|
+
const totalWeight = weights.reduce((a, b) => a + b, 0);
|
|
3886
|
+
const exact = weights.map((w) => ctx.populationSize * w / totalWeight);
|
|
3887
|
+
const shares = exact.map((e) => Math.floor(e));
|
|
3888
|
+
let remaining = ctx.populationSize - shares.reduce((a, b) => a + b, 0);
|
|
3889
|
+
const byRemainder = exact.map((e, i) => ({ i, rem: e - Math.floor(e) })).sort((a, b) => b.rem - a.rem);
|
|
3890
|
+
for (const { i } of byRemainder) {
|
|
3891
|
+
if (remaining <= 0) break;
|
|
3892
|
+
shares[i] = (shares[i] ?? 0) + 1;
|
|
3893
|
+
remaining -= 1;
|
|
3894
|
+
}
|
|
3895
|
+
const pool = [];
|
|
3896
|
+
const seen = /* @__PURE__ */ new Set();
|
|
3897
|
+
const errors = [];
|
|
3898
|
+
for (let i = 0; i < members.length; i += 1) {
|
|
3899
|
+
const member = members[i];
|
|
3900
|
+
const share = shares[i] ?? 0;
|
|
3901
|
+
if (!member || share === 0 || ctx.signal.aborted) continue;
|
|
3902
|
+
try {
|
|
3903
|
+
const proposals = await member.propose({ ...ctx, populationSize: share });
|
|
3904
|
+
for (const proposal of proposals) {
|
|
3905
|
+
const isCandidate = typeof proposal === "object" && proposal !== null && "surface" in proposal;
|
|
3906
|
+
const surface = isCandidate ? proposal.surface : proposal;
|
|
3907
|
+
const label = isCandidate ? proposal.label : "candidate";
|
|
3908
|
+
const rationale = isCandidate ? proposal.rationale : "";
|
|
3909
|
+
const key = typeof surface === "string" ? surface : JSON.stringify(surface);
|
|
3910
|
+
if (seen.has(key)) continue;
|
|
3911
|
+
seen.add(key);
|
|
3912
|
+
pool.push({ surface, label: `${member.kind}:${label}`, rationale });
|
|
3913
|
+
}
|
|
3914
|
+
} catch (err) {
|
|
3915
|
+
errors.push(`${member.kind}: ${err instanceof Error ? err.message : String(err)}`);
|
|
3916
|
+
}
|
|
3917
|
+
}
|
|
3918
|
+
if (pool.length === 0) {
|
|
3919
|
+
throw new Error(
|
|
3920
|
+
`compositeProposer: every member failed or proposed nothing${errors.length ? ` \u2014 ${errors.join("; ")}` : ""}`
|
|
3921
|
+
);
|
|
3922
|
+
}
|
|
3923
|
+
if (errors.length > 0) {
|
|
3924
|
+
console.warn(
|
|
3925
|
+
`[compositeProposer] ${errors.length} member(s) failed this generation: ${errors.join("; ")}`
|
|
3926
|
+
);
|
|
3927
|
+
}
|
|
3928
|
+
return pool.slice(0, ctx.populationSize);
|
|
3929
|
+
},
|
|
3930
|
+
decide(args) {
|
|
3931
|
+
const votes = members.filter((m) => typeof m.decide === "function").map((m) => m.decide(args));
|
|
3932
|
+
if (votes.length === 0) return { stop: false };
|
|
3933
|
+
const allStop = votes.every((v) => v.stop);
|
|
3934
|
+
return allStop ? {
|
|
3935
|
+
stop: true,
|
|
3936
|
+
reason: votes.map((v) => v.reason).filter(Boolean).join("; ") || "all members converged"
|
|
3937
|
+
} : { stop: false };
|
|
3938
|
+
}
|
|
3939
|
+
};
|
|
3940
|
+
}
|
|
3941
|
+
|
|
3873
3942
|
// src/campaign/proposers/halo.ts
|
|
3874
3943
|
import { execFile } from "child_process";
|
|
3875
3944
|
import { promisify } from "util";
|
|
@@ -4393,6 +4462,7 @@ export {
|
|
|
4393
4462
|
ProfileMatrixError,
|
|
4394
4463
|
runProfileMatrix,
|
|
4395
4464
|
aceProposer,
|
|
4465
|
+
compositeProposer,
|
|
4396
4466
|
haloProposer,
|
|
4397
4467
|
memoryCurationProposer,
|
|
4398
4468
|
policyEditProposer,
|
|
@@ -4405,4 +4475,4 @@ export {
|
|
|
4405
4475
|
gitWorktreeAdapter,
|
|
4406
4476
|
resolveWorktreePath
|
|
4407
4477
|
};
|
|
4408
|
-
//# sourceMappingURL=chunk-
|
|
4478
|
+
//# sourceMappingURL=chunk-GBI5J5DB.js.map
|