@evomap/evolver-core 2.0.0-beta.9 → 2.0.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/dist/algo/antiDistill.js +1 -167
- package/dist/algo/bans.js +1 -33
- package/dist/algo/candidateAssembly.d.ts +7 -2
- package/dist/algo/candidateAssembly.js +1 -205
- package/dist/algo/capabilityCandidates.js +1 -136
- package/dist/algo/confidence.js +1 -196
- package/dist/algo/conversationSniffer.js +1 -149
- package/dist/algo/cycleEngine.d.ts +23 -2
- package/dist/algo/cycleEngine.js +1 -425
- package/dist/algo/cycleFailureClassifier.js +1 -112
- package/dist/algo/epigenetics.js +1 -41
- package/dist/algo/evolutionEvent.js +1 -24
- package/dist/algo/exploration.d.ts +7 -0
- package/dist/algo/exploration.js +1 -55
- package/dist/algo/geneHealth.d.ts +2 -2
- package/dist/algo/geneHealth.js +1 -16
- package/dist/algo/geneIntake.js +1 -128
- package/dist/algo/genePromotion.js +1 -53
- package/dist/algo/geneSelection.d.ts +63 -5
- package/dist/algo/geneSelection.js +1 -246
- package/dist/algo/index.d.ts +2 -0
- package/dist/algo/index.js +1 -20
- package/dist/algo/memoryGraph.js +1 -86
- package/dist/algo/mutation.js +1 -22
- package/dist/algo/orchestrator.d.ts +8 -1
- package/dist/algo/orchestrator.js +1 -75
- package/dist/algo/publishEligibility.d.ts +34 -0
- package/dist/algo/publishEligibility.js +1 -0
- package/dist/algo/solidify.js +1 -63
- package/dist/algo/strategyPresets.js +1 -61
- package/dist/algo/ucb1.d.ts +53 -0
- package/dist/algo/ucb1.js +1 -0
- package/dist/assetstore/assetSidecarRecords.d.ts +7 -2
- package/dist/assetstore/assetSidecarRecords.js +238 -0
- package/dist/assetstore/assetSidecarRecovery.js +2 -2
- package/dist/assetstore/assetStoreHealth.d.ts +6 -0
- package/dist/assetstore/assetStoreHealth.js +56 -14
- package/dist/assetstore/assetStoreStorage.d.ts +1 -1
- package/dist/assetstore/assetStoreStorage.js +27 -9
- package/dist/assetstore/assetSyncLedger.d.ts +86 -0
- package/dist/assetstore/assetSyncLedger.js +683 -4
- package/dist/assetstore/index.d.ts +1 -0
- package/dist/assetstore/index.js +1 -0
- package/dist/assetstore/localAssetStoreSnapshot.d.ts +51 -0
- package/dist/assetstore/localAssetStoreSnapshot.js +329 -0
- package/dist/assetstore/localJsonl.d.ts +4 -2
- package/dist/assetstore/localJsonl.js +89 -9
- package/dist/assetstore/provenance.d.ts +80 -4
- package/dist/assetstore/provenance.js +313 -5
- package/dist/assetstore/provider.d.ts +58 -1
- package/dist/assetstore/provider.js +97 -6
- package/dist/benchmark/antiGeneBenchmark.d.ts +2 -0
- package/dist/benchmark/antiGeneBenchmark.js +1 -251
- package/dist/benchmark/antiGeneImpact.js +1 -34
- package/dist/benchmark/antiGeneRollout.d.ts +2 -0
- package/dist/benchmark/antiGeneRollout.js +1 -268
- package/dist/benchmark/benchmark.js +1 -26
- package/dist/benchmark/evolutionThesisSolver.js +1 -41
- package/dist/benchmark/index.d.ts +2 -1
- package/dist/benchmark/index.js +1 -6
- package/dist/benchmark/selectionFlatAbstention.d.ts +152 -0
- package/dist/benchmark/selectionFlatAbstention.js +1 -0
- package/dist/benchmark/thesis.js +1 -150
- package/dist/benchmark/triggerShift.js +1 -106
- package/dist/bootstrap/envFingerprint.d.ts +9 -0
- package/dist/bootstrap/envFingerprint.js +5 -0
- package/dist/bootstrap/index.d.ts +2 -1
- package/dist/bootstrap/index.js +2 -1
- package/dist/bootstrap/v1EnvCompat.d.ts +111 -0
- package/dist/bootstrap/v1EnvCompat.js +280 -0
- package/dist/cycle/cycleTimeline.js +1 -74
- package/dist/cycle/index.js +1 -2
- package/dist/cycle/stateMachine.js +1 -25
- package/dist/events/eventArchive.d.ts +2 -0
- package/dist/events/eventArchive.js +13 -3
- package/dist/events/eventSchema.d.ts +7 -7
- package/dist/events/eventStore.d.ts +2 -0
- package/dist/events/eventStore.js +5 -1
- package/dist/events/ingest.d.ts +1 -0
- package/dist/events/ingest.js +1 -0
- package/dist/events/paths.d.ts +3 -1
- package/dist/events/paths.js +4 -0
- package/dist/events/public.d.ts +2 -2
- package/dist/events/public.js +2 -2
- package/dist/events/reports.d.ts +2 -0
- package/dist/events/reports.js +4 -0
- package/dist/exec/autoExec.d.ts +43 -2
- package/dist/exec/autoExec.js +76 -9
- package/dist/exec/autonomousCycle.d.ts +22 -4
- package/dist/exec/autonomousCycle.js +64 -13
- package/dist/exec/claudeBridge.d.ts +32 -7
- package/dist/exec/claudeBridge.js +281 -29
- package/dist/exec/prompt.js +5 -1
- package/dist/exec/runnerRegistry.d.ts +68 -26
- package/dist/exec/runnerRegistry.js +307 -72
- package/dist/exec/selfPr.js +1 -7
- package/dist/feedback/envelope.d.ts +61 -0
- package/dist/feedback/envelope.js +168 -0
- package/dist/feedback/index.d.ts +1 -0
- package/dist/feedback/index.js +1 -0
- package/dist/hooks/hooks.js +1 -0
- package/dist/hub/agentDirectory.js +1 -104
- package/dist/hub/assetCallLog.d.ts +35 -1
- package/dist/hub/assetCallLog.js +1 -72
- package/dist/hub/bindings.d.ts +8 -1
- package/dist/hub/bindings.js +1 -110
- package/dist/hub/capability.d.ts +90 -3
- package/dist/hub/capability.js +1 -1
- package/dist/hub/conversationDistiller.js +1 -264
- package/dist/hub/fake.d.ts +2 -2
- package/dist/hub/fake.js +1 -70
- package/dist/hub/hubReview.js +1 -106
- package/dist/hub/index.js +1 -11
- package/dist/hub/ingest.js +1 -15
- package/dist/hub/questionGenerator.d.ts +5 -1
- package/dist/hub/questionGenerator.js +1 -406
- package/dist/hub/reuseDecision.js +1 -127
- package/dist/hub/sanitize.js +1 -322
- package/dist/index.d.ts +3 -1
- package/dist/index.js +4 -1
- package/dist/mailbox/dispatch.d.ts +1 -1
- package/dist/mailbox/dispatch.js +22 -6
- package/dist/mailbox/envelope.d.ts +7 -1
- package/dist/mailbox/envelope.js +9 -2
- package/dist/mailbox/ipcServer.d.ts +10 -2
- package/dist/mailbox/ipcServer.js +163 -13
- package/dist/mailbox/store.d.ts +89 -3
- package/dist/mailbox/store.js +895 -41
- package/dist/material/boundary.js +1 -14
- package/dist/material/consumer.js +1 -55
- package/dist/material/emit.js +1 -52
- package/dist/material/factory.js +1 -25
- package/dist/material/index.js +1 -9
- package/dist/material/materialArchive.js +1 -466
- package/dist/material/materialStore.js +1 -69
- package/dist/material/sampling.js +1 -39
- package/dist/material/sources.js +1 -33
- package/dist/material/watermark.js +1 -76
- package/dist/ops/evolutionGraphProjection.d.ts +20 -0
- package/dist/ops/evolutionGraphProjection.js +315 -0
- package/dist/ops/index.d.ts +2 -1
- package/dist/ops/index.js +2 -1
- package/dist/ops/selfUpdate.d.ts +8 -0
- package/dist/ops/selfUpdate.js +24 -8
- package/dist/personality/drift.js +1 -106
- package/dist/personality/events.js +1 -37
- package/dist/personality/evolveOps.js +1 -93
- package/dist/personality/index.js +1 -11
- package/dist/personality/mutate.js +1 -39
- package/dist/personality/pivot.js +1 -22
- package/dist/personality/prompt.js +1 -62
- package/dist/personality/riskGate.js +1 -80
- package/dist/personality/schema.d.ts +16 -16
- package/dist/personality/schema.js +1 -119
- package/dist/personality/select.js +1 -71
- package/dist/personality/stats.js +1 -82
- package/dist/personality/store.js +1 -92
- package/dist/schema/common.js +1 -17
- package/dist/schema/evolutionGraph.d.ts +784 -0
- package/dist/schema/evolutionGraph.js +1 -0
- package/dist/schema/index.d.ts +1 -0
- package/dist/schema/index.js +1 -5
- package/dist/schema/material.js +1 -50
- package/dist/schema/problem.js +1 -45
- package/dist/schema/proofOfWork.js +1 -9
- package/dist/schema/signal.d.ts +3 -3
- package/dist/schema/signal.js +1 -19
- package/dist/signals/curriculum.d.ts +55 -0
- package/dist/signals/curriculum.js +1 -0
- package/dist/signals/cycleHistoryFromEvents.js +1 -96
- package/dist/signals/expand.d.ts +15 -1
- package/dist/signals/expand.js +1 -125
- package/dist/signals/extractor.d.ts +2 -2
- package/dist/signals/extractor.js +1 -57
- package/dist/signals/index.d.ts +3 -1
- package/dist/signals/index.js +1 -6
- package/dist/signals/metaSignals.d.ts +4 -0
- package/dist/signals/metaSignals.js +1 -158
- package/dist/signals/signalGate.js +1 -40
- package/dist/signals/taskDomain.d.ts +22 -0
- package/dist/signals/taskDomain.js +1 -0
- package/dist/signals/traceSignals.js +1 -123
- package/dist/strategy/constraintAblation.js +1 -3074
- package/dist/strategy/constraintAblationPredicates.d.ts +31 -0
- package/dist/strategy/constraintAblationPredicates.js +1 -0
- package/dist/strategy/experiment.js +1 -63
- package/dist/strategy/index.js +1 -3
- package/dist/strategy/strategyPoint.js +1 -23
- package/dist/trace/index.d.ts +3 -1
- package/dist/trace/index.js +3 -1
- package/dist/trace/learningTrace.d.ts +209 -0
- package/dist/trace/learningTrace.js +276 -0
- package/dist/trace/proxyTurns.d.ts +31 -0
- package/dist/trace/proxyTurns.js +137 -0
- package/dist/verify/sandboxRunner.d.ts +28 -0
- package/dist/verify/sandboxRunner.js +218 -19
- package/dist/verify/sandboxedValidation.d.ts +9 -0
- package/dist/verify/sandboxedValidation.js +113 -13
- package/dist/verify/validation.d.ts +11 -1
- package/dist/verify/validation.js +31 -0
- package/package.json +5 -2
package/dist/events/public.js
CHANGED
|
@@ -3,7 +3,7 @@ export { Replayer } from './replayer.js';
|
|
|
3
3
|
export { eventCountsProjector, DEFAULT_PROJECTORS } from './projectors.js';
|
|
4
4
|
export { LineTooLargeError, MAX_LINE_BYTES } from './eventStore.js';
|
|
5
5
|
export { ArchiveSegmentConflictError, InvalidRootEventArchiveError, InvalidRootEventLogError, RootEventHistoryGapError, archiveRootEvents, inspectRootEventArchive, planRootEventArchive, readRootEventHistory, rootEventArchiveDir, rootEventArchiveSegmentName, validateRootEventHistory, ROOT_EVENT_ARCHIVE_DEFAULT_KEEP_EVENTS, } from './eventArchive.js';
|
|
6
|
-
export { rootEventsPath, evomapHome, mvDir, personalityStatePath, assetsDir, materialDir, materialStorePath, materialWatermarkPath, tracesDir, assetCallLogPath } from './paths.js';
|
|
6
|
+
export { rootEventsPath, evomapHome, mvDir, personalityStatePath, assetsDir, materialDir, materialStorePath, materialWatermarkPath, tracesDir, assetCallLogPath, learningTraceDir } from './paths.js';
|
|
7
7
|
export { EVENT_SCHEMA_VERSION } from './eventSchema.js';
|
|
8
|
-
export { readEvents, statusReport, listCycles, showCycle, listTriggers, dailySummary, buildNarrativeSnapshot, NARRATIVE_DEFAULT_LIMIT, NARRATIVE_MAX_LIMIT, } from './reports.js';
|
|
8
|
+
export { readEvents, statusReport, listCycles, showCycle, listTriggers, dailySummary, dailyCapsuleCount, buildNarrativeSnapshot, NARRATIVE_DEFAULT_LIMIT, NARRATIVE_MAX_LIMIT, } from './reports.js';
|
|
9
9
|
export { buildRetentionReport, defaultMaterialCursorPath, defaultMaterialCursorPaths, RETENTION_DEFAULT_MAX_MATERIAL_BYTES, RETENTION_DEFAULT_MAX_MATERIAL_RECORDS, RETENTION_DEFAULT_MAX_ROOT_BYTES, RETENTION_DEFAULT_MAX_ROOT_EVENTS, RETENTION_DEFAULT_ROOT_TAIL_EVENTS, RETENTION_DEFAULT_WATCH_RATIO, } from './retention.js';
|
package/dist/events/reports.d.ts
CHANGED
|
@@ -61,6 +61,8 @@ export interface DailySummary {
|
|
|
61
61
|
suppressedFailures: number;
|
|
62
62
|
}
|
|
63
63
|
export declare function dailySummary(evts: readonly ReportEvent[], dayPrefix: string): DailySummary;
|
|
64
|
+
/** 统计指定日期前缀的 capsule.produced 事件数. */
|
|
65
|
+
export declare function dailyCapsuleCount(evts: readonly ReportEvent[], dayPrefix: string): number;
|
|
64
66
|
export type NarrativeOutcome = 'success' | 'failed' | 'inert' | 'unknown';
|
|
65
67
|
export interface NarrativeEntry {
|
|
66
68
|
seq: number;
|
package/dist/events/reports.js
CHANGED
|
@@ -85,6 +85,10 @@ export function dailySummary(evts, dayPrefix) {
|
|
|
85
85
|
suppressedFailures,
|
|
86
86
|
};
|
|
87
87
|
}
|
|
88
|
+
/** 统计指定日期前缀的 capsule.produced 事件数. */
|
|
89
|
+
export function dailyCapsuleCount(evts, dayPrefix) {
|
|
90
|
+
return evts.filter((e) => e.type === 'capsule.produced' && e.ts.startsWith(dayPrefix)).length;
|
|
91
|
+
}
|
|
88
92
|
export const NARRATIVE_DEFAULT_LIMIT = 30;
|
|
89
93
|
export const NARRATIVE_MAX_LIMIT = 200;
|
|
90
94
|
const NARRATIVE_EVENTS = new Set([
|
package/dist/exec/autoExec.d.ts
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import type { AssetStoreProvider } from '../assetstore/provider.js';
|
|
2
2
|
import { type ProvenanceStore } from '../assetstore/provenance.js';
|
|
3
3
|
import type { ReviewLedger } from '../assetstore/reviewLedger.js';
|
|
4
|
-
import type { GeneCandidateInput } from '../algo/geneSelection.js';
|
|
4
|
+
import type { GeneCandidateInput, SelectionGuardMode } from '../algo/geneSelection.js';
|
|
5
5
|
import type { CycleEngine, ExecutionFailureKind, SolidifyPermitGate } from '../algo/cycleEngine.js';
|
|
6
6
|
import { type AutonomousSafety } from './autonomousCycle.js';
|
|
7
|
-
import type
|
|
7
|
+
import { type GitRunner, type ValidateHook } from './claudeBridge.js';
|
|
8
8
|
import type { AgentRunner } from './runnerRegistry.js';
|
|
9
9
|
import { type OpenPrLister } from './openPrRegistry.js';
|
|
10
10
|
import type { ReuseOutcomeSummary, ReuseOutcomeEvent } from '../ops/reuseOutcomes.js';
|
|
11
11
|
import type { PersonalityStore } from '../personality/store.js';
|
|
12
12
|
import type { MemoryGraphProvider } from '../algo/memoryGraph.js';
|
|
13
|
+
import type { SelectionPolicy } from '../algo/ucb1.js';
|
|
14
|
+
import { type LearningPacketSink, type TraceSink } from '../trace/learningTrace.js';
|
|
15
|
+
import type { TraceReadOptions } from '../trace/trajectoryExport.js';
|
|
13
16
|
export interface AutoExecTask {
|
|
14
17
|
id: string;
|
|
15
18
|
repo: string;
|
|
@@ -104,12 +107,50 @@ export interface AutoExecDeps {
|
|
|
104
107
|
memoryGraph?: MemoryGraphProvider;
|
|
105
108
|
/** Optional daemon-level explicit strategy preset name, e.g. EVOLVE_STRATEGY. */
|
|
106
109
|
strategyName?: string;
|
|
110
|
+
/** Emergency rollback for semantic IDF selection. Omit to keep IDF enabled. */
|
|
111
|
+
disableSemanticIdf?: boolean;
|
|
112
|
+
/** Experimental plateau selection policy. Omit to preserve engine-health + legacy drift. */
|
|
113
|
+
selectionPolicy?: SelectionPolicy;
|
|
114
|
+
/** Production relevance-guard rollout. Omit only for legacy/custom composition. */
|
|
115
|
+
selectionGuard?: SelectionGuardMode;
|
|
116
|
+
/** Optional score floor canary. Omit to keep the selector default of zero. */
|
|
117
|
+
selectionFloor?: number;
|
|
107
118
|
/** Optional evolvable personality store shared with CycleEngine and the exec prompt. */
|
|
108
119
|
personality?: PersonalityStore;
|
|
109
120
|
/** Test/custom seam: inject a runner instead of spawning a real agent. */
|
|
110
121
|
agent?: AgentRunner;
|
|
111
122
|
/** Test/custom seam: inject git instead of spawning git. */
|
|
112
123
|
git?: GitRunner;
|
|
124
|
+
/**
|
|
125
|
+
* Learning trace (Learning Ops slice 2): when set, each task run gets its own AgentRunTraceRecorder
|
|
126
|
+
* (traceId = the cycleId) emitting run.started/model.called/tool.failed/run.completed, and a
|
|
127
|
+
* LearningPacket draft is submitted here after the cycle. Best-effort: trace/packet failures never
|
|
128
|
+
* change the verdict. Omit → zero trace work, byte-identical to today.
|
|
129
|
+
*/
|
|
130
|
+
learningTrace?: {
|
|
131
|
+
/** Where packet drafts go (file/memory/hub-adapter implementation). */
|
|
132
|
+
packetSink: LearningPacketSink;
|
|
133
|
+
/** Optional live per-event sink (e.g. FileTraceSink JSONL tail). */
|
|
134
|
+
traceSink?: TraceSink;
|
|
135
|
+
/** Hub packet sourceRepo column; default 'evolver-v2'. */
|
|
136
|
+
sourceRepo?: string;
|
|
137
|
+
/**
|
|
138
|
+
* Proxy llm_turn fold (Learning Ops slice 5): when set, after the cycle (and BEFORE run.completed, so
|
|
139
|
+
* sequence order holds) the run's wall-clock window of proxy trace records is read from `dir`
|
|
140
|
+
* (llm-trace-*.jsonl day-files) and folded into the recorder via recordLlmTurn — real per-request
|
|
141
|
+
* model.called + tool.called/tool.failed detail instead of only the bridge's coarse spawn event.
|
|
142
|
+
* Correlation is the time window + session-first-turn heuristic (see trace/proxyTurns.ts). Best-effort:
|
|
143
|
+
* a missing dir / unreadable file / no proxy degrades to zero folded turns, never a verdict change.
|
|
144
|
+
*/
|
|
145
|
+
proxyTraces?: {
|
|
146
|
+
/** Proxy trace day-file dir (events/paths.ts tracesDir()). */
|
|
147
|
+
dir: string;
|
|
148
|
+
/** Decryption material for encrypted trace envelopes (allowPartial is always forced on). */
|
|
149
|
+
readOptions?: TraceReadOptions;
|
|
150
|
+
/** Injected clock for deterministic tests. Default Date.now. */
|
|
151
|
+
now?: () => number;
|
|
152
|
+
};
|
|
153
|
+
};
|
|
113
154
|
}
|
|
114
155
|
export interface ForcedGeneFields {
|
|
115
156
|
forcedGeneId?: unknown;
|
package/dist/exec/autoExec.js
CHANGED
|
@@ -1,20 +1,16 @@
|
|
|
1
|
-
// Autonomous-exec task runner — the productized per-task kernel a resident daemon polls (the deployment form
|
|
2
|
-
// of the scratch autoexec daemon). One task → one fully-hardened evolution cycle, with a deny-by-default
|
|
3
|
-
// allowlist pre-check that yields a clean "refused" verdict WITHOUT running anything when the repo is not
|
|
4
|
-
// allowlisted. Secure by construction: the execute is built by makeSafeExecute (all six controls); callers
|
|
5
|
-
// cannot bypass the safety composition.
|
|
6
|
-
import { resolve as resolvePath, sep } from 'node:path';
|
|
7
1
|
import { normalizeForPut } from '../assetstore/provider.js';
|
|
8
2
|
import { ingestUntrusted } from '../assetstore/provenance.js';
|
|
9
3
|
import { mergePendingSignalsForStore } from '../assetstore/pendingSignals.js';
|
|
10
4
|
import { intakeGene } from '../algo/geneIntake.js';
|
|
11
5
|
import { runEvolutionCycle } from '../algo/orchestrator.js';
|
|
12
6
|
import { makeSafeExecute, makeTrustedGeneResolver } from './autonomousCycle.js';
|
|
7
|
+
import { isWithinRoot } from './claudeBridge.js';
|
|
13
8
|
import { findSignalHints } from './openPrRegistry.js';
|
|
9
|
+
import { AgentRunTraceRecorder, buildLearningPacketDraft } from '../trace/learningTrace.js';
|
|
10
|
+
import { collectRunLlmTurns } from '../trace/proxyTurns.js';
|
|
14
11
|
/** Same path-containment as the bridge guard — used here to refuse before running anything (clean verdict). */
|
|
15
12
|
function withinAllowlist(repo, roots) {
|
|
16
|
-
|
|
17
|
-
return roots.some((root) => { const r = resolvePath(root); return c === r || c.startsWith(r.endsWith(sep) ? r : r + sep); });
|
|
13
|
+
return roots.some((root) => isWithinRoot(repo, root));
|
|
18
14
|
}
|
|
19
15
|
function cleanForcedGeneId(value) {
|
|
20
16
|
if (typeof value !== 'string')
|
|
@@ -136,6 +132,24 @@ export async function runAutoExecTask(deps, rawTask, safety) {
|
|
|
136
132
|
// that throws degrades to solving fresh (no hub candidates) rather than failing the task.
|
|
137
133
|
let hubCandidates = [];
|
|
138
134
|
const cycleId = `autoexec-${task.id}`;
|
|
135
|
+
// Learning trace (slice 2): one recorder per task run, traceId = cycleId so the trace joins the event log.
|
|
136
|
+
// Purely observational — every recorder call and the packet submit are wrapped so they can never change
|
|
137
|
+
// the verdict or fail the task.
|
|
138
|
+
const traceRecorder = deps.learningTrace
|
|
139
|
+
? new AgentRunTraceRecorder({
|
|
140
|
+
runId: cycleId,
|
|
141
|
+
taskId: task.id,
|
|
142
|
+
...(deps.learningTrace.traceSink ? { sink: deps.learningTrace.traceSink } : {}),
|
|
143
|
+
})
|
|
144
|
+
: undefined;
|
|
145
|
+
// Wall-clock window of this run, used to correlate the proxy's llm_turn records (slice 5). Captured
|
|
146
|
+
// unconditionally-cheaply only when the fold is configured.
|
|
147
|
+
const proxyTraceClock = deps.learningTrace?.proxyTraces?.now ?? Date.now;
|
|
148
|
+
let runStartMs = 0;
|
|
149
|
+
try {
|
|
150
|
+
traceRecorder?.runStarted({ taskSummary: task.expectedEffect, signals: cycleSignals, metadata: { repo: task.repo, target: task.target } });
|
|
151
|
+
}
|
|
152
|
+
catch { /* observability only */ }
|
|
139
153
|
if (deps.hubReuse) {
|
|
140
154
|
try {
|
|
141
155
|
hubCandidates = await executableHubCandidates(deps, await deps.hubReuse(cycleSignals, { cycleId }));
|
|
@@ -144,15 +158,30 @@ export async function runAutoExecTask(deps, rawTask, safety) {
|
|
|
144
158
|
hubCandidates = [];
|
|
145
159
|
}
|
|
146
160
|
}
|
|
161
|
+
runStartMs = deps.learningTrace?.proxyTraces ? proxyTraceClock() : 0;
|
|
162
|
+
// evaluation fill-in (slice 6): the validate hook is the run's external verifier (sandboxed validation
|
|
163
|
+
// commands), so its result — when it actually RAN — becomes the packet's evaluation.verification
|
|
164
|
+
// (verifier 'automated_test'). Observation is a pass-through wrapper: the hook's result reaches the
|
|
165
|
+
// bridge unchanged, and a run where validation never fired keeps the evaluation placeholder.
|
|
166
|
+
let observedVerification;
|
|
167
|
+
const baseValidate = deps.validate?.(task);
|
|
168
|
+
const observingValidate = baseValidate
|
|
169
|
+
? async (mutation, decision, cwd) => {
|
|
170
|
+
const v = await baseValidate(mutation, decision, cwd);
|
|
171
|
+
observedVerification = { verifier: 'automated_test', passed: v.passed, ...(v.score !== undefined ? { score: v.score } : {}) };
|
|
172
|
+
return v;
|
|
173
|
+
}
|
|
174
|
+
: undefined;
|
|
147
175
|
const execute = makeSafeExecute(task.repo, deps.store, safety, {
|
|
148
176
|
...(deps.provenance ? { provenance: deps.provenance } : {}),
|
|
149
177
|
...(deps.review ? { review: deps.review } : {}),
|
|
150
178
|
...(deps.includeProbation ? { includeProbation: true } : {}),
|
|
151
179
|
...(task.validationCmds ? { validationCmds: task.validationCmds } : {}),
|
|
152
|
-
...(
|
|
180
|
+
...(observingValidate ? { validate: observingValidate } : {}),
|
|
153
181
|
...(deps.personality ? { personality: deps.personality } : {}),
|
|
154
182
|
...(deps.agent ? { agent: deps.agent } : {}),
|
|
155
183
|
...(deps.git ? { git: deps.git } : {}),
|
|
184
|
+
...(traceRecorder ? { traceRecorder } : {}),
|
|
156
185
|
});
|
|
157
186
|
const strategyName = task.strategyName ?? deps.strategyName;
|
|
158
187
|
// Intentional semantics (see #308 review M1): a task carrying `strategy` — even without an
|
|
@@ -180,6 +209,10 @@ export async function runAutoExecTask(deps, rawTask, safety) {
|
|
|
180
209
|
...(deps.recallEvents ? { recallEvents: deps.recallEvents } : {}),
|
|
181
210
|
...(memoryGraphAdvice ? { memoryGraphAdvice } : {}),
|
|
182
211
|
...(strategyName !== undefined ? { strategyName } : {}),
|
|
212
|
+
...(deps.disableSemanticIdf ? { disableSemanticIdf: true } : {}),
|
|
213
|
+
...(deps.selectionPolicy ? { selectionPolicy: deps.selectionPolicy } : {}),
|
|
214
|
+
...(deps.selectionGuard ? { selectionGuard: deps.selectionGuard } : {}),
|
|
215
|
+
...(deps.selectionFloor !== undefined ? { selectionFloor: deps.selectionFloor } : {}),
|
|
183
216
|
...(cycleForcedGeneId !== undefined ? { forcedGeneId: cycleForcedGeneId } : {}),
|
|
184
217
|
cycleId,
|
|
185
218
|
problem: {
|
|
@@ -194,6 +227,40 @@ export async function runAutoExecTask(deps, rawTask, safety) {
|
|
|
194
227
|
});
|
|
195
228
|
const status = res.finalStage === 'solidified' ? 'solidified' : res.finalStage === 'failed' ? 'failed' : 'innovated';
|
|
196
229
|
const cap = res.capsule;
|
|
230
|
+
if (traceRecorder && deps.learningTrace) {
|
|
231
|
+
// Proxy llm_turn fold (slice 5): fold the run window's per-request turns BEFORE run.completed so the
|
|
232
|
+
// trajectory stays sequence-ordered (model/tool detail inside the run, completion last). Own try — a
|
|
233
|
+
// throwing sink mid-fold must not cost the run its completion event or packet draft.
|
|
234
|
+
try {
|
|
235
|
+
const proxyTraces = deps.learningTrace.proxyTraces;
|
|
236
|
+
if (proxyTraces) {
|
|
237
|
+
const turns = collectRunLlmTurns(proxyTraces.dir, { startMs: runStartMs, endMs: proxyTraceClock() }, proxyTraces.readOptions ? { readOptions: proxyTraces.readOptions } : {});
|
|
238
|
+
for (const turn of turns)
|
|
239
|
+
traceRecorder.recordLlmTurn(turn);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
catch { /* observability only */ }
|
|
243
|
+
try {
|
|
244
|
+
traceRecorder.runCompleted({
|
|
245
|
+
status: res.finalStage === 'solidified' ? 'success' : 'failed',
|
|
246
|
+
...(cap?.outcome?.score !== undefined ? { score: cap.outcome.score } : {}),
|
|
247
|
+
...(res.reasons.length > 0 ? { reason: res.reasons.join('; ') } : {}),
|
|
248
|
+
...(res.producedValue !== undefined ? { producedValue: res.producedValue } : {}),
|
|
249
|
+
...(res.failureKind !== undefined ? { failureKind: res.failureKind } : {}),
|
|
250
|
+
});
|
|
251
|
+
await deps.learningTrace.packetSink.submit(buildLearningPacketDraft(traceRecorder, {
|
|
252
|
+
sourceRepo: deps.learningTrace.sourceRepo ?? 'evolver-v2',
|
|
253
|
+
taskSummary: task.expectedEffect,
|
|
254
|
+
signals: cycleSignals,
|
|
255
|
+
environment: {
|
|
256
|
+
repo: task.repo,
|
|
257
|
+
runner: safety.runner ?? (deps.agent ? 'claude' : 'codex'),
|
|
258
|
+
},
|
|
259
|
+
...(observedVerification !== undefined ? { verification: observedVerification } : {}),
|
|
260
|
+
}));
|
|
261
|
+
}
|
|
262
|
+
catch { /* packet delivery is best-effort; never fail the task */ }
|
|
263
|
+
}
|
|
197
264
|
if (deps.memoryGraph && res.decision?.selectedGeneId && (res.finalStage === 'solidified' || res.finalStage === 'failed')) {
|
|
198
265
|
const producedSuccess = res.finalStage === 'solidified' && res.producedValue === true;
|
|
199
266
|
try {
|
|
@@ -4,8 +4,9 @@ import type { ReviewLedger } from '../assetstore/reviewLedger.js';
|
|
|
4
4
|
import type { Mutation } from '../wire/index.js';
|
|
5
5
|
import type { GeneDecision } from '../algo/geneSelection.js';
|
|
6
6
|
import type { ExecutionResult } from '../algo/cycleEngine.js';
|
|
7
|
-
import { type GeneResolver, type ValidateHook, type AgentRunnerOptions, type RunnerName, type AgentRunner, type GitRunner } from './claudeBridge.js';
|
|
7
|
+
import { type GeneResolver, type ValidateHook, type AgentRunnerOptions, type AgentSessionResume, type RunnerName, type AgentRunner, type GitRunner } from './claudeBridge.js';
|
|
8
8
|
import type { PersonalityStore } from '../personality/store.js';
|
|
9
|
+
import type { AgentRunTraceRecorder } from '../trace/learningTrace.js';
|
|
9
10
|
/**
|
|
10
11
|
* Resolve a gene's strategy from the store and whether it is safe to EMBED into an autonomous agent's prompt —
|
|
11
12
|
* the exec-side link from #30 (provenance ledger) and the review-state gate to #45 (requireTrustedGene gate). A
|
|
@@ -18,9 +19,11 @@ export declare function makeTrustedGeneResolver(store: AssetStoreProvider, prove
|
|
|
18
19
|
export interface AutonomousSafety {
|
|
19
20
|
/** Deny-by-default repo allowlist (#41). Required — an empty array refuses everything. */
|
|
20
21
|
allowedRoots: readonly string[];
|
|
21
|
-
/** Which built-in runner (#66). Default '
|
|
22
|
+
/** Which built-in runner (#66). Default 'codex'. The same safety controls wrap whichever runner. cursor is a scaffold (unverified). */
|
|
22
23
|
runner?: RunnerName;
|
|
23
|
-
/**
|
|
24
|
+
/** Explicit opt-in to continue a native session owned by the selected runner. */
|
|
25
|
+
resume?: AgentSessionResume;
|
|
26
|
+
/** Agent runner options (#38/#40). Default: no pre-authorized host access. */
|
|
24
27
|
agentOptions?: AgentRunnerOptions;
|
|
25
28
|
/** Strip evolver/hub secrets from the agent env (#42). Default true. */
|
|
26
29
|
scrubEnv?: boolean;
|
|
@@ -32,10 +35,23 @@ export interface AutonomousSafety {
|
|
|
32
35
|
/** Cooperative cancellation propagated to the spawned runner process tree. */
|
|
33
36
|
signal?: AbortSignal;
|
|
34
37
|
}
|
|
38
|
+
export declare class UnsupportedCursorAutonomousIsolationError extends Error {
|
|
39
|
+
constructor();
|
|
40
|
+
}
|
|
41
|
+
export declare class UnsupportedAutonomousHostAccessError extends Error {
|
|
42
|
+
constructor();
|
|
43
|
+
}
|
|
44
|
+
export declare class UnsupportedAutonomousClaudeRunnerError extends Error {
|
|
45
|
+
constructor();
|
|
46
|
+
}
|
|
47
|
+
export declare class UnsupportedAutonomousCodexRunnerError extends Error {
|
|
48
|
+
constructor();
|
|
49
|
+
}
|
|
50
|
+
export declare function resolveAutonomousAgentOptions(runner: RunnerName | undefined, isolation: AutonomousSafety['isolation'], overrides?: AgentRunnerOptions): AgentRunnerOptions;
|
|
35
51
|
/**
|
|
36
52
|
* Build the fully-hardened `execute` for an autonomous run against `repo`. Composes every exec-bridge control
|
|
37
53
|
* with secure defaults so they can't be forgotten piecemeal: deny-by-default allowedRoots (#41) + worktree
|
|
38
|
-
* isolation (#43) + env scrub (#42) +
|
|
54
|
+
* isolation (#43) + env scrub (#42) + non-bypassing agent permissions (#38/#40) + trusted-gene gate fed by
|
|
39
55
|
* provenance (#45/#30). Pass the result as runEvolutionCycle's `execute`.
|
|
40
56
|
*/
|
|
41
57
|
export declare function makeSafeExecute(repo: string, store: AssetStoreProvider, safety: AutonomousSafety, opts?: {
|
|
@@ -47,4 +63,6 @@ export declare function makeSafeExecute(repo: string, store: AssetStoreProvider,
|
|
|
47
63
|
personality?: PersonalityStore;
|
|
48
64
|
agent?: AgentRunner;
|
|
49
65
|
git?: GitRunner;
|
|
66
|
+
/** Optional learning-trace recorder forwarded to the exec bridge (Learning Ops slice 2). */
|
|
67
|
+
traceRecorder?: AgentRunTraceRecorder;
|
|
50
68
|
}): (mutation: Mutation, decision: GeneDecision) => Promise<ExecutionResult>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { makeClaudeExecBridge } from './claudeBridge.js';
|
|
1
|
+
import { CLAUDE_SAFE_AUTONOMOUS_TOOLS, hasBoundedClaudeFileAccess, makeClaudeExecBridge, validateAgentSessionResume } from './claudeBridge.js';
|
|
2
2
|
const asStrings = (v) => (Array.isArray(v) ? v.filter((x) => typeof x === 'string') : []);
|
|
3
3
|
/**
|
|
4
4
|
* Resolve a gene's strategy from the store and whether it is safe to EMBED into an autonomous agent's prompt —
|
|
@@ -33,19 +33,19 @@ export function makeTrustedGeneResolver(store, provenance, review, includeProbat
|
|
|
33
33
|
return info;
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
|
-
// Claude's
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
// Keep Claude's project path checks enabled and expose only file/search tools.
|
|
37
|
+
// Bash, web, task, and MCP tools remain unavailable.
|
|
38
|
+
const CLAUDE_DEFAULT_AGENT_OPTIONS = {
|
|
39
|
+
permissionMode: 'acceptEdits',
|
|
40
|
+
tools: CLAUDE_SAFE_AUTONOMOUS_TOOLS,
|
|
41
|
+
};
|
|
42
|
+
// Codex workspace-write prevents host writes but does not contain host reads. It therefore remains explicit.
|
|
40
43
|
const CODEX_DEFAULT_AGENT_OPTIONS = {};
|
|
41
|
-
// Cursor
|
|
42
|
-
// but not yet run-verified end to end (needs an authed cursor-agent). The `-p --force --trust` bypass would
|
|
43
|
-
// auto-approve shell+write, but Cursor has no verified per-run allowlist/sandbox mapping yet, so skipPermissions
|
|
44
|
-
// is refused outright. Use default cursor with worktree isolation until the CLI is run-verified.
|
|
44
|
+
// Cursor has no verified host filesystem/network sandbox. Worktree isolation cannot safely authorize `--trust`.
|
|
45
45
|
const CURSOR_DEFAULT_AGENT_OPTIONS = {};
|
|
46
46
|
// Gemini's verified safe default is `--approval-mode auto_edit`; shell remains gated and --yolo is refused.
|
|
47
47
|
const GEMINI_DEFAULT_AGENT_OPTIONS = {};
|
|
48
|
-
/** Per-runner safe default agent options
|
|
48
|
+
/** Per-runner safe default agent options. Host permission bypass is never enabled by default. */
|
|
49
49
|
function defaultAgentOptions(runner) {
|
|
50
50
|
if (runner === 'codex')
|
|
51
51
|
return CODEX_DEFAULT_AGENT_OPTIONS;
|
|
@@ -55,24 +55,75 @@ function defaultAgentOptions(runner) {
|
|
|
55
55
|
return GEMINI_DEFAULT_AGENT_OPTIONS;
|
|
56
56
|
return CLAUDE_DEFAULT_AGENT_OPTIONS;
|
|
57
57
|
}
|
|
58
|
+
export class UnsupportedCursorAutonomousIsolationError extends Error {
|
|
59
|
+
constructor() {
|
|
60
|
+
super('Autonomous Cursor cannot use worktree isolation because --trust grants host filesystem and network access');
|
|
61
|
+
this.name = 'UnsupportedCursorAutonomousIsolationError';
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
export class UnsupportedAutonomousHostAccessError extends Error {
|
|
65
|
+
constructor() {
|
|
66
|
+
super('Autonomous Claude requires project-scoped acceptEdits with bounded file/search tools; host access bypass or unsupported tools are forbidden because a worktree is not a security boundary');
|
|
67
|
+
this.name = 'UnsupportedAutonomousHostAccessError';
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
export class UnsupportedAutonomousClaudeRunnerError extends Error {
|
|
71
|
+
constructor() {
|
|
72
|
+
super('Autonomous claude is disabled because its headless edit mode has no verified host filesystem sandbox; inject an externally sandboxed agent or explicitly select a runner after reviewing its host-access boundary');
|
|
73
|
+
this.name = 'UnsupportedAutonomousClaudeRunnerError';
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
export class UnsupportedAutonomousCodexRunnerError extends Error {
|
|
77
|
+
constructor() {
|
|
78
|
+
super('Autonomous codex is disabled because workspace-write does not restrict host filesystem reads; inject an externally sandboxed agent');
|
|
79
|
+
this.name = 'UnsupportedAutonomousCodexRunnerError';
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
export function resolveAutonomousAgentOptions(runner, isolation, overrides) {
|
|
83
|
+
const options = {
|
|
84
|
+
...defaultAgentOptions(runner),
|
|
85
|
+
...(isolation !== 'none' ? { workspaceTrust: 'isolated-worktree' } : {}),
|
|
86
|
+
...(overrides ?? {}),
|
|
87
|
+
};
|
|
88
|
+
if (runner === 'cursor' && isolation !== 'none') {
|
|
89
|
+
throw new UnsupportedCursorAutonomousIsolationError();
|
|
90
|
+
}
|
|
91
|
+
const effectiveRunner = runner ?? 'claude';
|
|
92
|
+
const unsafeClaudeOptions = effectiveRunner === 'claude' && !hasBoundedClaudeFileAccess(options);
|
|
93
|
+
if (unsafeClaudeOptions) {
|
|
94
|
+
throw new UnsupportedAutonomousHostAccessError();
|
|
95
|
+
}
|
|
96
|
+
return options;
|
|
97
|
+
}
|
|
58
98
|
/**
|
|
59
99
|
* Build the fully-hardened `execute` for an autonomous run against `repo`. Composes every exec-bridge control
|
|
60
100
|
* with secure defaults so they can't be forgotten piecemeal: deny-by-default allowedRoots (#41) + worktree
|
|
61
|
-
* isolation (#43) + env scrub (#42) +
|
|
101
|
+
* isolation (#43) + env scrub (#42) + non-bypassing agent permissions (#38/#40) + trusted-gene gate fed by
|
|
62
102
|
* provenance (#45/#30). Pass the result as runEvolutionCycle's `execute`.
|
|
63
103
|
*/
|
|
64
104
|
export function makeSafeExecute(repo, store, safety, opts = {}) {
|
|
105
|
+
const runner = safety.runner ?? (opts.agent ? undefined : 'claude');
|
|
106
|
+
if (safety.resume && runner)
|
|
107
|
+
validateAgentSessionResume(safety.resume, runner);
|
|
108
|
+
if (!opts.agent && runner === 'claude') {
|
|
109
|
+
throw new UnsupportedAutonomousClaudeRunnerError();
|
|
110
|
+
}
|
|
111
|
+
if (!opts.agent && runner === 'codex') {
|
|
112
|
+
throw new UnsupportedAutonomousCodexRunnerError();
|
|
113
|
+
}
|
|
65
114
|
return makeClaudeExecBridge({
|
|
66
115
|
cwd: repo,
|
|
67
116
|
enabled: true,
|
|
68
117
|
...(opts.agent ? { agent: opts.agent } : {}),
|
|
69
118
|
...(opts.git ? { git: opts.git } : {}),
|
|
119
|
+
...(opts.traceRecorder ? { traceRecorder: opts.traceRecorder } : {}),
|
|
70
120
|
allowedRoots: safety.allowedRoots,
|
|
71
|
-
...(
|
|
121
|
+
...(runner ? { runner } : {}),
|
|
122
|
+
...(safety.resume ? { resume: safety.resume } : {}),
|
|
72
123
|
...(safety.isolation === 'none' ? {} : { isolation: 'worktree' }),
|
|
73
124
|
scrubEnv: safety.scrubEnv ?? true,
|
|
74
125
|
requireTrustedGene: safety.requireTrustedGene ?? true,
|
|
75
|
-
agentOptions: safety.
|
|
126
|
+
agentOptions: resolveAutonomousAgentOptions(runner, safety.isolation, safety.agentOptions),
|
|
76
127
|
...(safety.timeoutMs !== undefined ? { timeoutMs: safety.timeoutMs } : {}),
|
|
77
128
|
...(safety.signal ? { signal: safety.signal } : {}),
|
|
78
129
|
resolveGene: makeTrustedGeneResolver(store, opts.provenance, opts.review, opts.includeProbation ?? false),
|
|
@@ -3,9 +3,10 @@ import type { GeneDecision } from '../algo/geneSelection.js';
|
|
|
3
3
|
import type { ExecutionResult } from '../algo/cycleEngine.js';
|
|
4
4
|
import { type GeneStrategyInfo } from './prompt.js';
|
|
5
5
|
import type { PersonalityStore } from '../personality/store.js';
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
export
|
|
6
|
+
import type { AgentRunTraceRecorder } from '../trace/learningTrace.js';
|
|
7
|
+
import { type AgentRunner, type AgentRunnerOptions, type AgentSessionResume, type RunnerName } from './runnerRegistry.js';
|
|
8
|
+
export { resolveSpawnCommand, spawnCapture, DEFAULT_MAX_CAPTURE_BYTES, MAX_AGENT_SESSION_ID_CHARS, AgentSessionResumeError, validateAgentSessionResume, UnboundedSkipPermissionsError, UnsupportedCodexPermissionOptionsError, UnsupportedCursorAllowedToolsError, UnsupportedCursorSkipPermissionsError, UnsupportedCursorWorkspaceTrustError, UnsupportedGeminiPermissionOptionsError, claudeRunnerArgs, makeClaudeHeadlessRunner, claudeHeadlessRunner, codexRunnerArgs, makeCodexHeadlessRunner, cursorRunnerArgs, makeCursorHeadlessRunner, getRunnerSpec, hasBoundedClaudeFileAccess, CLAUDE_SAFE_AUTONOMOUS_TOOLS, geminiRunnerArgs, makeGeminiHeadlessRunner, classifyGeminiRunnerResult, } from './runnerRegistry.js';
|
|
9
|
+
export type { AgentRunContext, AgentRunResult, AgentRunner, RunnerName, AgentRunnerOptions, ClaudeRunnerOptions, CodexRunnerOptions, AgentRunnerSpec, AgentSessionResume, } from './runnerRegistry.js';
|
|
9
10
|
export interface GitRunnerOptions {
|
|
10
11
|
processSignalMode?: 'cancel' | 'ignore';
|
|
11
12
|
}
|
|
@@ -31,6 +32,8 @@ export interface ExecBridgeOptions {
|
|
|
31
32
|
agent?: AgentRunner;
|
|
32
33
|
/** Which built-in runner to use when `agent` is not injected (#66). Default 'claude' (byte-identical). cursor is a scaffold (unverified runner). */
|
|
33
34
|
runner?: RunnerName;
|
|
35
|
+
/** Explicit native session continuation. Must name the same runner selected above. */
|
|
36
|
+
resume?: AgentSessionResume;
|
|
34
37
|
/** When `agent` is not injected, options for the built-in headless runner (permission bypass / allowed tools / model). */
|
|
35
38
|
agentOptions?: AgentRunnerOptions;
|
|
36
39
|
/** Default: spawns `git`. Inject a fake in tests. */
|
|
@@ -86,6 +89,12 @@ export interface ExecBridgeOptions {
|
|
|
86
89
|
* the store's default state (store.load never throws), it never fails the run.
|
|
87
90
|
*/
|
|
88
91
|
personality?: PersonalityStore;
|
|
92
|
+
/**
|
|
93
|
+
* Optional learning-trace recorder (Learning Ops slice 2): when set, the bridge emits `model.called` around
|
|
94
|
+
* each agent spawn and `tool.failed`/`retry.attempted` metadata on failures. Best-effort observability — a
|
|
95
|
+
* recorder/sink failure must never affect the execution result, so every emission is wrapped defensively.
|
|
96
|
+
*/
|
|
97
|
+
traceRecorder?: AgentRunTraceRecorder;
|
|
89
98
|
}
|
|
90
99
|
export declare class ExecBridgeDisabledError extends Error {
|
|
91
100
|
constructor();
|
|
@@ -98,19 +107,33 @@ export declare class ExecBridgeForbiddenError extends Error {
|
|
|
98
107
|
* Thrown when a FULL-ACCESS (or unverified) agent run is requested without worktree isolation. The throwaway
|
|
99
108
|
* worktree is the containment WE control — allowedRoots gates the cwd but cannot stop an auto-approved or
|
|
100
109
|
* unsandboxed process writing/running outside it. Gated runners:
|
|
101
|
-
* - codex
|
|
102
|
-
* workspace-write, so only the skip path is gated.
|
|
110
|
+
* - codex permission overrides are refused by the runner because it has no enforceable per-tool allowlist.
|
|
103
111
|
* - cursor default → gated UNCONDITIONALLY. cursor-agent base `-p` already documents write+shell access, cursor
|
|
104
112
|
* skipPermissions is rejected by the runner layer, and the scaffold remains unverified (#66/#181) — so default
|
|
105
113
|
* cursor still needs the wrapper worktree rather than risk mutating the real tree.
|
|
106
|
-
*
|
|
114
|
+
* Claude is fail-closed below because a tool-name allowlist does not constrain absolute filesystem paths.
|
|
107
115
|
*/
|
|
108
116
|
export declare class UnsandboxedFullAccessRequiresIsolationError extends Error {
|
|
109
117
|
constructor();
|
|
110
118
|
}
|
|
119
|
+
export declare class WorkspaceTrustRequiresIsolationError extends Error {
|
|
120
|
+
readonly code = "WORKSPACE_TRUST_REQUIRES_ISOLATION";
|
|
121
|
+
constructor();
|
|
122
|
+
}
|
|
123
|
+
export declare class UnsupportedCursorBuiltInRunnerError extends Error {
|
|
124
|
+
constructor();
|
|
125
|
+
}
|
|
126
|
+
export declare class UnsupportedClaudeBuiltInRunnerError extends Error {
|
|
127
|
+
constructor();
|
|
128
|
+
}
|
|
129
|
+
export declare class UnsupportedCodexBuiltInRunnerError extends Error {
|
|
130
|
+
constructor();
|
|
131
|
+
}
|
|
111
132
|
export declare class UnsafeWorktreePathError extends Error {
|
|
112
133
|
constructor(reason: string);
|
|
113
134
|
}
|
|
135
|
+
/** Whether `child` is the same as, or nested under, `root`, including filesystem symlink resolution. */
|
|
136
|
+
export declare function isWithinRoot(child: string, root: string): boolean;
|
|
114
137
|
/**
|
|
115
138
|
* Whitelist-filter `env` for a spawned agent/tool: keep ONLY the minimal runtime env + the caller-declared
|
|
116
139
|
* extras (the runner's own auth via allowPrefixes/allowKeys); drop everything else. Fail-safe by construction —
|
|
@@ -127,4 +150,6 @@ export declare const defaultGitPatchWriter: GitPatchWriter;
|
|
|
127
150
|
* Build the `execute` function CycleEngine/runEvolutionCycle consume. Default-off: throws
|
|
128
151
|
* ExecBridgeDisabledError on first call unless enabled.
|
|
129
152
|
*/
|
|
130
|
-
export declare function makeClaudeExecBridge(opts: ExecBridgeOptions
|
|
153
|
+
export declare function makeClaudeExecBridge(opts: ExecBridgeOptions, internal?: {
|
|
154
|
+
cursorWorktreeRoot?: string;
|
|
155
|
+
}): (mutation: Mutation, decision: GeneDecision) => Promise<ExecutionResult>;
|