@odla-ai/harness 0.11.12 → 0.11.14
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/{chunk-INL642J5.js → chunk-6T26HEWI.js} +7 -3
- package/dist/chunk-6T26HEWI.js.map +1 -0
- package/dist/{chunk-6QILNLBY.js → chunk-ZXUN2STV.js} +36 -29
- package/dist/chunk-ZXUN2STV.js.map +1 -0
- package/dist/code-runtime-cli.cjs +51 -41
- package/dist/code-runtime-cli.cjs.map +1 -1
- package/dist/code-runtime-cli.js +2 -2
- package/dist/index.cjs +6 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/node.cjs +53 -41
- package/dist/node.cjs.map +1 -1
- package/dist/node.d.cts +5 -1
- package/dist/node.d.ts +5 -1
- package/dist/node.js +4 -2
- package/dist/node.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-6QILNLBY.js.map +0 -1
- package/dist/chunk-INL642J5.js.map +0 -1
package/dist/node.d.cts
CHANGED
|
@@ -1686,6 +1686,10 @@ declare function createContainerRecipeExecutor(engine: ContainerEngine, options?
|
|
|
1686
1686
|
}): CodeRecipeExecutor;
|
|
1687
1687
|
/** Validate immutable recipe identity, digest image, command, and resource bounds. */
|
|
1688
1688
|
declare function assertCodeBuildRecipe(recipe: CodeBuildRecipe): void;
|
|
1689
|
+
/** The command's own output: the Apple engine prefixes stderr with its image and kernel progress
|
|
1690
|
+
* (`[1/6] Fetching image …`), which is the engine's, not the recipe's, and it was all a bounded
|
|
1691
|
+
* failure reason ever showed of a red test run (bug eff741ee). */
|
|
1692
|
+
declare function recipeOutput(engine: ContainerEngine, stderr: string): string;
|
|
1689
1693
|
/** Run one container command to completion under an output cap and a timeout, never through a shell. */
|
|
1690
1694
|
declare function runContainerCommand(engine: ContainerEngine, args: string[], name: string, recipe: {
|
|
1691
1695
|
timeoutMs: number;
|
|
@@ -1705,4 +1709,4 @@ declare function lendDependencies(dependencies: RecipeDependencies | null, runId
|
|
|
1705
1709
|
/** Copy the host's build output into the workspace wherever its package exists there and it has no copy of its own. Returns what was lent. */
|
|
1706
1710
|
declare function lendBuildProducts(products: readonly LentDirectory[], workspaceDir: string): Promise<string[]>;
|
|
1707
1711
|
|
|
1708
|
-
export { CODE_PATCH_PATH, CODE_RUNTIME_PROTOCOL_VERSION, type CodeAgentAttemptOptions, type CodeAgentAttemptResult, type CodeAgentRun, type CodeBuildRecipe, type CodeExpectedArtifact, type CodeLocalSourceDescriptor, type CodeMemory, type CodeMemoryEvidence, type CodeMemoryKind, type CodeMemoryStore, type CodeRecipeExecutor, type CodeRecipeResult, type CodeRuntimeAgentControlPlane, type CodeRuntimeBinding, type CodeRuntimeCandidateResponse, type CodeRuntimeCapabilities, CodeRuntimeCheckpointManager, type CodeRuntimeClientOptions, type CodeRuntimeCollaborationSkillManifest, type CodeRuntimeCollaborationToolManifest, type CodeRuntimeCollaborationToolRequest, type CodeRuntimeCommand, type CodeRuntimeCommandEngine, type CodeRuntimeCommandKind, type CodeRuntimeCommandResult, CodeRuntimeControlError, type CodeRuntimeControlPlane, type CodeRuntimeInferenceOptions, type CodeRuntimeLoopOptions, type CodeRuntimeMemory, type CodeRuntimeNewMemory, CodeRuntimeReconciler, type CodeRuntimeReviewRequest, type CodeRuntimeReviewResponse, type CodeRuntimeSnapshot, type CodeRuntimeSourceArchive, type CodeRuntimeSourceSnapshot, type CodeSkillOpts, type CodeSurface, type CodeToolBrokerOptions, type CodeToolCallRecord, type CodeToolDecision, type CodeVerificationEvidence, type CodeVerificationLog, type CodeVerificationPolicy, type ContainerEngine, type ContainerEngineSelectionOptions, type ContainerEngineVerificationOptions, type ContainerLimits, type ContainerRunOptions, type ContainerRunResult, type CreateCodeWorkspaceCheckpointInput, DEPENDENCY_INSTALL_TIMEOUT_MS, type DecomposedRun, DecompositionError, type DependencyCacheInput, type GoalAttempt, type GoalAttemptInput, type GoalAttemptOutcome, type GoalAttemptRecord, type GoalBudget, type GoalEvent, type GoalOutcome, type GoalRun, type GoalRunSpec, type GoalStoppedReason, type GoalStrategy, type HarnessRunnerOptions, type IntegrateOptions, type IntegrationStep, type LentDependencies, type LentDirectory, MAX_MEMORY_BODY, MEASURED_PREMIUM, type MaterializedCodeSource, type MaterializedGitTree, type NewCodeMemory, PROOF_RECIPE_PREFIX, type PrepareRuntimeCheckpointInput, type PreparedRuntimeCheckpoint, REPOSITORY_RECIPES_FILE, type RacedAttemptOptions, type RacedOutcome, type RecallOptions, type RecipeDependencies, type RepositoryRecipeEnvelope, type ResolvedCodeRecipes, type RestoreCodeWorkspaceCheckpointInput, type RestoredCodeWorkspaceCheckpoint, type RunCodeAgentOptions, type RuntimeCheckpointSession, SYSTEM_PROMPT_FOR, type StageWorkspaceOptions, type StagedWorkspace, type StrategyChoice, type StrategySignals, type SubGoal, type SubGoalResult, TheseusRuntimeEngine, type TheseusRuntimeEngineOptions, V1_SYSTEM_PROMPT, V2_SYSTEM_PROMPT, V3_SYSTEM_PROMPT, type VerifyCodeCandidateInput, applyCodePatch, applyPatchDialectToDiff, assertCodeBuildRecipe, assertDisjointPlan, assertLentPath, assertPinnedImage, assertReservedMount, attachCodeRuntimeReferences, buildContainerRunArgs, buildRecipeContainerArgs, chooseStrategy, cloneTree, codeSkill, createCodeRuntimeControlClient, createCodeRuntimeInference, createCodeRuntimeSessionSkillLoader, createCodeToolBroker, createCodeWorkspaceCheckpoint, createContainerRecipeExecutor, dependencyCacheKey, dependencyInstallArgs, describeCodeRecipes, describeGateFailure, describePatchFailure, digestStagedWorkspace, feedbackIsActionable, hasContextFreeHunk, hazardFromAttempt, hostBuildProducts, installedDependencies, integrateSubGoals, isCheckpointEffectCompleted, lendBuildProducts, lendDependencies, lentDirectories, materializeCodeRuntimeArchive, materializeCodeRuntimeSource, materializeCommandWorkspace, materializeGitTree, npmFailureSummary, outcomeCloses, outcomeMemory, parseRepositoryRecipes, patchPaths, pinnedNpmVersion, planReachCollisions, prepareContainerDependencies, prepareRuntimeCheckpoint, racedAttempt, readOnlyNotice, readRepositoryRecipes, recallAbout, registeredFiles, renderMemories, renderOutcome, resolveCodePath, resolveCodeRecipes, restoreCodeWorkspaceCheckpoint, runCodeAgent, runCodeAgentAttempt, runCodeRuntimeHeartbeatLoop, runContainerAttempt, runContainerCommand, runGoal, runHarnessRunner, runLeasedAttempt, runtimeMemoryStore, safeWorkspaceLabel, selectContainerEngine, selectWinner, sessionRecipesFor, sessionSkillsFor, stageManifests, stageWorkspace, stageWorkspacePair, straySubGoalFiles, stripPatchEnvelope, validateCodePatch, validateMemory, validateRelativePath, verifyCodeCandidate, verifyContainerEngineBoundary, withProofRecipes, withRecipeDependencies, workspaceDirs };
|
|
1712
|
+
export { CODE_PATCH_PATH, CODE_RUNTIME_PROTOCOL_VERSION, type CodeAgentAttemptOptions, type CodeAgentAttemptResult, type CodeAgentRun, type CodeBuildRecipe, type CodeExpectedArtifact, type CodeLocalSourceDescriptor, type CodeMemory, type CodeMemoryEvidence, type CodeMemoryKind, type CodeMemoryStore, type CodeRecipeExecutor, type CodeRecipeResult, type CodeRuntimeAgentControlPlane, type CodeRuntimeBinding, type CodeRuntimeCandidateResponse, type CodeRuntimeCapabilities, CodeRuntimeCheckpointManager, type CodeRuntimeClientOptions, type CodeRuntimeCollaborationSkillManifest, type CodeRuntimeCollaborationToolManifest, type CodeRuntimeCollaborationToolRequest, type CodeRuntimeCommand, type CodeRuntimeCommandEngine, type CodeRuntimeCommandKind, type CodeRuntimeCommandResult, CodeRuntimeControlError, type CodeRuntimeControlPlane, type CodeRuntimeInferenceOptions, type CodeRuntimeLoopOptions, type CodeRuntimeMemory, type CodeRuntimeNewMemory, CodeRuntimeReconciler, type CodeRuntimeReviewRequest, type CodeRuntimeReviewResponse, type CodeRuntimeSnapshot, type CodeRuntimeSourceArchive, type CodeRuntimeSourceSnapshot, type CodeSkillOpts, type CodeSurface, type CodeToolBrokerOptions, type CodeToolCallRecord, type CodeToolDecision, type CodeVerificationEvidence, type CodeVerificationLog, type CodeVerificationPolicy, type ContainerEngine, type ContainerEngineSelectionOptions, type ContainerEngineVerificationOptions, type ContainerLimits, type ContainerRunOptions, type ContainerRunResult, type CreateCodeWorkspaceCheckpointInput, DEPENDENCY_INSTALL_TIMEOUT_MS, type DecomposedRun, DecompositionError, type DependencyCacheInput, type GoalAttempt, type GoalAttemptInput, type GoalAttemptOutcome, type GoalAttemptRecord, type GoalBudget, type GoalEvent, type GoalOutcome, type GoalRun, type GoalRunSpec, type GoalStoppedReason, type GoalStrategy, type HarnessRunnerOptions, type IntegrateOptions, type IntegrationStep, type LentDependencies, type LentDirectory, MAX_MEMORY_BODY, MEASURED_PREMIUM, type MaterializedCodeSource, type MaterializedGitTree, type NewCodeMemory, PROOF_RECIPE_PREFIX, type PrepareRuntimeCheckpointInput, type PreparedRuntimeCheckpoint, REPOSITORY_RECIPES_FILE, type RacedAttemptOptions, type RacedOutcome, type RecallOptions, type RecipeDependencies, type RepositoryRecipeEnvelope, type ResolvedCodeRecipes, type RestoreCodeWorkspaceCheckpointInput, type RestoredCodeWorkspaceCheckpoint, type RunCodeAgentOptions, type RuntimeCheckpointSession, SYSTEM_PROMPT_FOR, type StageWorkspaceOptions, type StagedWorkspace, type StrategyChoice, type StrategySignals, type SubGoal, type SubGoalResult, TheseusRuntimeEngine, type TheseusRuntimeEngineOptions, V1_SYSTEM_PROMPT, V2_SYSTEM_PROMPT, V3_SYSTEM_PROMPT, type VerifyCodeCandidateInput, applyCodePatch, applyPatchDialectToDiff, assertCodeBuildRecipe, assertDisjointPlan, assertLentPath, assertPinnedImage, assertReservedMount, attachCodeRuntimeReferences, buildContainerRunArgs, buildRecipeContainerArgs, chooseStrategy, cloneTree, codeSkill, createCodeRuntimeControlClient, createCodeRuntimeInference, createCodeRuntimeSessionSkillLoader, createCodeToolBroker, createCodeWorkspaceCheckpoint, createContainerRecipeExecutor, dependencyCacheKey, dependencyInstallArgs, describeCodeRecipes, describeGateFailure, describePatchFailure, digestStagedWorkspace, feedbackIsActionable, hasContextFreeHunk, hazardFromAttempt, hostBuildProducts, installedDependencies, integrateSubGoals, isCheckpointEffectCompleted, lendBuildProducts, lendDependencies, lentDirectories, materializeCodeRuntimeArchive, materializeCodeRuntimeSource, materializeCommandWorkspace, materializeGitTree, npmFailureSummary, outcomeCloses, outcomeMemory, parseRepositoryRecipes, patchPaths, pinnedNpmVersion, planReachCollisions, prepareContainerDependencies, prepareRuntimeCheckpoint, racedAttempt, readOnlyNotice, readRepositoryRecipes, recallAbout, recipeOutput, registeredFiles, renderMemories, renderOutcome, resolveCodePath, resolveCodeRecipes, restoreCodeWorkspaceCheckpoint, runCodeAgent, runCodeAgentAttempt, runCodeRuntimeHeartbeatLoop, runContainerAttempt, runContainerCommand, runGoal, runHarnessRunner, runLeasedAttempt, runtimeMemoryStore, safeWorkspaceLabel, selectContainerEngine, selectWinner, sessionRecipesFor, sessionSkillsFor, stageManifests, stageWorkspace, stageWorkspacePair, straySubGoalFiles, stripPatchEnvelope, validateCodePatch, validateMemory, validateRelativePath, verifyCodeCandidate, verifyContainerEngineBoundary, withProofRecipes, withRecipeDependencies, workspaceDirs };
|
package/dist/node.d.ts
CHANGED
|
@@ -1686,6 +1686,10 @@ declare function createContainerRecipeExecutor(engine: ContainerEngine, options?
|
|
|
1686
1686
|
}): CodeRecipeExecutor;
|
|
1687
1687
|
/** Validate immutable recipe identity, digest image, command, and resource bounds. */
|
|
1688
1688
|
declare function assertCodeBuildRecipe(recipe: CodeBuildRecipe): void;
|
|
1689
|
+
/** The command's own output: the Apple engine prefixes stderr with its image and kernel progress
|
|
1690
|
+
* (`[1/6] Fetching image …`), which is the engine's, not the recipe's, and it was all a bounded
|
|
1691
|
+
* failure reason ever showed of a red test run (bug eff741ee). */
|
|
1692
|
+
declare function recipeOutput(engine: ContainerEngine, stderr: string): string;
|
|
1689
1693
|
/** Run one container command to completion under an output cap and a timeout, never through a shell. */
|
|
1690
1694
|
declare function runContainerCommand(engine: ContainerEngine, args: string[], name: string, recipe: {
|
|
1691
1695
|
timeoutMs: number;
|
|
@@ -1705,4 +1709,4 @@ declare function lendDependencies(dependencies: RecipeDependencies | null, runId
|
|
|
1705
1709
|
/** Copy the host's build output into the workspace wherever its package exists there and it has no copy of its own. Returns what was lent. */
|
|
1706
1710
|
declare function lendBuildProducts(products: readonly LentDirectory[], workspaceDir: string): Promise<string[]>;
|
|
1707
1711
|
|
|
1708
|
-
export { CODE_PATCH_PATH, CODE_RUNTIME_PROTOCOL_VERSION, type CodeAgentAttemptOptions, type CodeAgentAttemptResult, type CodeAgentRun, type CodeBuildRecipe, type CodeExpectedArtifact, type CodeLocalSourceDescriptor, type CodeMemory, type CodeMemoryEvidence, type CodeMemoryKind, type CodeMemoryStore, type CodeRecipeExecutor, type CodeRecipeResult, type CodeRuntimeAgentControlPlane, type CodeRuntimeBinding, type CodeRuntimeCandidateResponse, type CodeRuntimeCapabilities, CodeRuntimeCheckpointManager, type CodeRuntimeClientOptions, type CodeRuntimeCollaborationSkillManifest, type CodeRuntimeCollaborationToolManifest, type CodeRuntimeCollaborationToolRequest, type CodeRuntimeCommand, type CodeRuntimeCommandEngine, type CodeRuntimeCommandKind, type CodeRuntimeCommandResult, CodeRuntimeControlError, type CodeRuntimeControlPlane, type CodeRuntimeInferenceOptions, type CodeRuntimeLoopOptions, type CodeRuntimeMemory, type CodeRuntimeNewMemory, CodeRuntimeReconciler, type CodeRuntimeReviewRequest, type CodeRuntimeReviewResponse, type CodeRuntimeSnapshot, type CodeRuntimeSourceArchive, type CodeRuntimeSourceSnapshot, type CodeSkillOpts, type CodeSurface, type CodeToolBrokerOptions, type CodeToolCallRecord, type CodeToolDecision, type CodeVerificationEvidence, type CodeVerificationLog, type CodeVerificationPolicy, type ContainerEngine, type ContainerEngineSelectionOptions, type ContainerEngineVerificationOptions, type ContainerLimits, type ContainerRunOptions, type ContainerRunResult, type CreateCodeWorkspaceCheckpointInput, DEPENDENCY_INSTALL_TIMEOUT_MS, type DecomposedRun, DecompositionError, type DependencyCacheInput, type GoalAttempt, type GoalAttemptInput, type GoalAttemptOutcome, type GoalAttemptRecord, type GoalBudget, type GoalEvent, type GoalOutcome, type GoalRun, type GoalRunSpec, type GoalStoppedReason, type GoalStrategy, type HarnessRunnerOptions, type IntegrateOptions, type IntegrationStep, type LentDependencies, type LentDirectory, MAX_MEMORY_BODY, MEASURED_PREMIUM, type MaterializedCodeSource, type MaterializedGitTree, type NewCodeMemory, PROOF_RECIPE_PREFIX, type PrepareRuntimeCheckpointInput, type PreparedRuntimeCheckpoint, REPOSITORY_RECIPES_FILE, type RacedAttemptOptions, type RacedOutcome, type RecallOptions, type RecipeDependencies, type RepositoryRecipeEnvelope, type ResolvedCodeRecipes, type RestoreCodeWorkspaceCheckpointInput, type RestoredCodeWorkspaceCheckpoint, type RunCodeAgentOptions, type RuntimeCheckpointSession, SYSTEM_PROMPT_FOR, type StageWorkspaceOptions, type StagedWorkspace, type StrategyChoice, type StrategySignals, type SubGoal, type SubGoalResult, TheseusRuntimeEngine, type TheseusRuntimeEngineOptions, V1_SYSTEM_PROMPT, V2_SYSTEM_PROMPT, V3_SYSTEM_PROMPT, type VerifyCodeCandidateInput, applyCodePatch, applyPatchDialectToDiff, assertCodeBuildRecipe, assertDisjointPlan, assertLentPath, assertPinnedImage, assertReservedMount, attachCodeRuntimeReferences, buildContainerRunArgs, buildRecipeContainerArgs, chooseStrategy, cloneTree, codeSkill, createCodeRuntimeControlClient, createCodeRuntimeInference, createCodeRuntimeSessionSkillLoader, createCodeToolBroker, createCodeWorkspaceCheckpoint, createContainerRecipeExecutor, dependencyCacheKey, dependencyInstallArgs, describeCodeRecipes, describeGateFailure, describePatchFailure, digestStagedWorkspace, feedbackIsActionable, hasContextFreeHunk, hazardFromAttempt, hostBuildProducts, installedDependencies, integrateSubGoals, isCheckpointEffectCompleted, lendBuildProducts, lendDependencies, lentDirectories, materializeCodeRuntimeArchive, materializeCodeRuntimeSource, materializeCommandWorkspace, materializeGitTree, npmFailureSummary, outcomeCloses, outcomeMemory, parseRepositoryRecipes, patchPaths, pinnedNpmVersion, planReachCollisions, prepareContainerDependencies, prepareRuntimeCheckpoint, racedAttempt, readOnlyNotice, readRepositoryRecipes, recallAbout, registeredFiles, renderMemories, renderOutcome, resolveCodePath, resolveCodeRecipes, restoreCodeWorkspaceCheckpoint, runCodeAgent, runCodeAgentAttempt, runCodeRuntimeHeartbeatLoop, runContainerAttempt, runContainerCommand, runGoal, runHarnessRunner, runLeasedAttempt, runtimeMemoryStore, safeWorkspaceLabel, selectContainerEngine, selectWinner, sessionRecipesFor, sessionSkillsFor, stageManifests, stageWorkspace, stageWorkspacePair, straySubGoalFiles, stripPatchEnvelope, validateCodePatch, validateMemory, validateRelativePath, verifyCodeCandidate, verifyContainerEngineBoundary, withProofRecipes, withRecipeDependencies, workspaceDirs };
|
|
1712
|
+
export { CODE_PATCH_PATH, CODE_RUNTIME_PROTOCOL_VERSION, type CodeAgentAttemptOptions, type CodeAgentAttemptResult, type CodeAgentRun, type CodeBuildRecipe, type CodeExpectedArtifact, type CodeLocalSourceDescriptor, type CodeMemory, type CodeMemoryEvidence, type CodeMemoryKind, type CodeMemoryStore, type CodeRecipeExecutor, type CodeRecipeResult, type CodeRuntimeAgentControlPlane, type CodeRuntimeBinding, type CodeRuntimeCandidateResponse, type CodeRuntimeCapabilities, CodeRuntimeCheckpointManager, type CodeRuntimeClientOptions, type CodeRuntimeCollaborationSkillManifest, type CodeRuntimeCollaborationToolManifest, type CodeRuntimeCollaborationToolRequest, type CodeRuntimeCommand, type CodeRuntimeCommandEngine, type CodeRuntimeCommandKind, type CodeRuntimeCommandResult, CodeRuntimeControlError, type CodeRuntimeControlPlane, type CodeRuntimeInferenceOptions, type CodeRuntimeLoopOptions, type CodeRuntimeMemory, type CodeRuntimeNewMemory, CodeRuntimeReconciler, type CodeRuntimeReviewRequest, type CodeRuntimeReviewResponse, type CodeRuntimeSnapshot, type CodeRuntimeSourceArchive, type CodeRuntimeSourceSnapshot, type CodeSkillOpts, type CodeSurface, type CodeToolBrokerOptions, type CodeToolCallRecord, type CodeToolDecision, type CodeVerificationEvidence, type CodeVerificationLog, type CodeVerificationPolicy, type ContainerEngine, type ContainerEngineSelectionOptions, type ContainerEngineVerificationOptions, type ContainerLimits, type ContainerRunOptions, type ContainerRunResult, type CreateCodeWorkspaceCheckpointInput, DEPENDENCY_INSTALL_TIMEOUT_MS, type DecomposedRun, DecompositionError, type DependencyCacheInput, type GoalAttempt, type GoalAttemptInput, type GoalAttemptOutcome, type GoalAttemptRecord, type GoalBudget, type GoalEvent, type GoalOutcome, type GoalRun, type GoalRunSpec, type GoalStoppedReason, type GoalStrategy, type HarnessRunnerOptions, type IntegrateOptions, type IntegrationStep, type LentDependencies, type LentDirectory, MAX_MEMORY_BODY, MEASURED_PREMIUM, type MaterializedCodeSource, type MaterializedGitTree, type NewCodeMemory, PROOF_RECIPE_PREFIX, type PrepareRuntimeCheckpointInput, type PreparedRuntimeCheckpoint, REPOSITORY_RECIPES_FILE, type RacedAttemptOptions, type RacedOutcome, type RecallOptions, type RecipeDependencies, type RepositoryRecipeEnvelope, type ResolvedCodeRecipes, type RestoreCodeWorkspaceCheckpointInput, type RestoredCodeWorkspaceCheckpoint, type RunCodeAgentOptions, type RuntimeCheckpointSession, SYSTEM_PROMPT_FOR, type StageWorkspaceOptions, type StagedWorkspace, type StrategyChoice, type StrategySignals, type SubGoal, type SubGoalResult, TheseusRuntimeEngine, type TheseusRuntimeEngineOptions, V1_SYSTEM_PROMPT, V2_SYSTEM_PROMPT, V3_SYSTEM_PROMPT, type VerifyCodeCandidateInput, applyCodePatch, applyPatchDialectToDiff, assertCodeBuildRecipe, assertDisjointPlan, assertLentPath, assertPinnedImage, assertReservedMount, attachCodeRuntimeReferences, buildContainerRunArgs, buildRecipeContainerArgs, chooseStrategy, cloneTree, codeSkill, createCodeRuntimeControlClient, createCodeRuntimeInference, createCodeRuntimeSessionSkillLoader, createCodeToolBroker, createCodeWorkspaceCheckpoint, createContainerRecipeExecutor, dependencyCacheKey, dependencyInstallArgs, describeCodeRecipes, describeGateFailure, describePatchFailure, digestStagedWorkspace, feedbackIsActionable, hasContextFreeHunk, hazardFromAttempt, hostBuildProducts, installedDependencies, integrateSubGoals, isCheckpointEffectCompleted, lendBuildProducts, lendDependencies, lentDirectories, materializeCodeRuntimeArchive, materializeCodeRuntimeSource, materializeCommandWorkspace, materializeGitTree, npmFailureSummary, outcomeCloses, outcomeMemory, parseRepositoryRecipes, patchPaths, pinnedNpmVersion, planReachCollisions, prepareContainerDependencies, prepareRuntimeCheckpoint, racedAttempt, readOnlyNotice, readRepositoryRecipes, recallAbout, recipeOutput, registeredFiles, renderMemories, renderOutcome, resolveCodePath, resolveCodeRecipes, restoreCodeWorkspaceCheckpoint, runCodeAgent, runCodeAgentAttempt, runCodeRuntimeHeartbeatLoop, runContainerAttempt, runContainerCommand, runGoal, runHarnessRunner, runLeasedAttempt, runtimeMemoryStore, safeWorkspaceLabel, selectContainerEngine, selectWinner, sessionRecipesFor, sessionSkillsFor, stageManifests, stageWorkspace, stageWorkspacePair, straySubGoalFiles, stripPatchEnvelope, validateCodePatch, validateMemory, validateRelativePath, verifyCodeCandidate, verifyContainerEngineBoundary, withProofRecipes, withRecipeDependencies, workspaceDirs };
|
package/dist/node.js
CHANGED
|
@@ -50,6 +50,7 @@ import {
|
|
|
50
50
|
readOnlyNotice,
|
|
51
51
|
readRepositoryRecipes,
|
|
52
52
|
recallAbout,
|
|
53
|
+
recipeOutput,
|
|
53
54
|
registeredFiles,
|
|
54
55
|
renderMemories,
|
|
55
56
|
resolveCodePath,
|
|
@@ -69,8 +70,8 @@ import {
|
|
|
69
70
|
verifyCodeCandidate,
|
|
70
71
|
withProofRecipes,
|
|
71
72
|
withRecipeDependencies
|
|
72
|
-
} from "./chunk-
|
|
73
|
-
import "./chunk-
|
|
73
|
+
} from "./chunk-ZXUN2STV.js";
|
|
74
|
+
import "./chunk-6T26HEWI.js";
|
|
74
75
|
import {
|
|
75
76
|
allowedWorkspacePath,
|
|
76
77
|
assertPinnedImage,
|
|
@@ -565,6 +566,7 @@ export {
|
|
|
565
566
|
readOnlyNotice,
|
|
566
567
|
readRepositoryRecipes,
|
|
567
568
|
recallAbout,
|
|
569
|
+
recipeOutput,
|
|
568
570
|
registeredFiles,
|
|
569
571
|
renderMemories,
|
|
570
572
|
renderOutcome,
|
package/dist/node.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/code-runtime-memory.ts","../src/code-goal-outcome.ts","../src/code-goal-race.ts","../src/code-goal-decompose.ts","../src/code-goal-strategy.ts","../src/code-recipe-dependency-cache.ts","../src/code-recipe-build-products.ts"],"sourcesContent":["// The brokered control plane, presented as the memory store the runner wants.\n//\n// The Goal Runner takes a CodeMemoryStore; the runtime has a control plane that\n// speaks HTTP over a host credential. This is the few lines between them, and it\n// exists so neither side learns about the other: the runner never knows memory\n// crosses a network, and the control plane never learns what a hazard is.\n\nimport type { CodeMemory, CodeMemoryStore, NewCodeMemory } from \"./code-memory\";\nimport type { CodeRuntimeAgentControlPlane } from \"./code-runtime\";\n\n/**\n * A key derived from the memory itself, so a retry writes once.\n *\n * Content-derived rather than random: the retry that matters is the one after a\n * timeout, where the caller cannot know whether the first write landed — and a\n * fresh random key would guarantee a duplicate exactly then.\n */\nasync function mutationId(memory: NewCodeMemory): Promise<string> {\n const source = `${memory.subject} ${memory.kind} ${memory.body}`;\n const bytes = await crypto.subtle.digest(\"SHA-256\", new TextEncoder().encode(source));\n return Array.from(new Uint8Array(bytes), (byte) => byte.toString(16).padStart(2, \"0\"))\n .join(\"\").slice(0, 40);\n}\n\n/**\n * Present a session's brokered memory as a store, or null when the control\n * plane does not offer one.\n *\n * Null rather than a throwing stub: a Code host talking to a registry that\n * predates memory should quietly lose the feature, not fail every goal that\n * would have recorded something.\n */\nexport function runtimeMemoryStore(\n control: CodeRuntimeAgentControlPlane, sessionId: string,\n): CodeMemoryStore | null {\n const recall = control.recallMemories;\n const remember = control.rememberMemory;\n if (!recall || !remember) return null;\n return {\n recall: async (subjects, limit) =>\n (await recall.call(control, sessionId, subjects, limit)) as CodeMemory[],\n remember: async (memory: NewCodeMemory) => {\n await remember.call(control, sessionId, {\n subject: memory.subject,\n kind: memory.kind,\n body: memory.body,\n ...(memory.evidence ? { evidence: memory.evidence } : {}),\n mutationId: await mutationId(memory),\n });\n // The control plane owns the id and the author — attribution a writer\n // chooses is not attribution — so what comes back here is only enough to\n // satisfy the interface the runner holds.\n return { ...memory, id: \"\", createdAt: Date.now() };\n },\n };\n}\n","// Comparing what a goal achieved to what it was for.\n//\n// A PM goal already carries a `proof` — the sentence that says how you would\n// know it was met. The Goal Runner already produces a signed verification\n// receipt for every attempt. Nothing connected them, so a goal moved to met\n// because an agent said it was.\n//\n// That is precisely the edit the PM audit trail now flags as self-serving: the\n// principal doing the work moving its own goalposts. I did it myself half a\n// dozen times this session, by hand, and the board has no way to tell those\n// apart from a real completion.\n//\n// So an outcome is a THIRD thing, produced by neither the goal's author nor its\n// executor: the verifier's verdict, recorded against the goal, with the receipt\n// that backs it. A goal reaches met because evidence exists, or it does not\n// reach met.\n\nimport type { CodeMemoryEvidence, NewCodeMemory } from \"./code-memory\";\n\n/** What a run actually did, judged rather than claimed. */\nexport interface GoalOutcome {\n /** The PM entity this goal came from, when it came from one. */\n pmEntityId?: string;\n goal: string;\n /** How the goal said it would be judged. */\n proof: string;\n /** Whether the clean verifier agreed. */\n met: boolean;\n /** Why it stopped — `proof_passed`, or the budget that ran out. */\n stoppedReason: string;\n attempts: number;\n tokens: number;\n costUsd?: number;\n /** The receipt that backs a met verdict. Absent means nothing backs it. */\n evidence?: CodeMemoryEvidence;\n}\n\n/**\n * Whether an outcome may move a PM item to done.\n *\n * Two conditions, and the second is the one that matters: the verifier agreed,\n * AND it left a receipt. A `met` with no evidence is an agent's assertion\n * wearing a verdict's clothes, and admitting it would make the whole audit\n * trail decorative.\n */\nexport function outcomeCloses(outcome: GoalOutcome): boolean {\n return outcome.met && outcome.evidence !== undefined;\n}\n\n/**\n * Say plainly what happened, for the PM comment that records it.\n *\n * Written for a human deciding whether to trust the result, so the numbers that\n * bound the claim — attempts, tokens, cost — are in the sentence rather than in\n * a linked artifact nobody opens. Unknown cost is said as unknown; reporting\n * $0.00 for a run whose pricing was unavailable would be a lie in the direction\n * that flatters the agent.\n */\nexport function renderOutcome(outcome: GoalOutcome): string {\n const spend = outcome.costUsd === undefined\n ? \"cost unknown\"\n : `$${outcome.costUsd.toFixed(4)}`;\n const scale = `${outcome.attempts} attempt(s), ${outcome.tokens.toLocaleString()} tokens, ${spend}`;\n if (!outcome.met) {\n return `Goal not met (${outcome.stoppedReason}) after ${scale}. Proof: ${outcome.proof}`;\n }\n if (!outcome.evidence) {\n // Deliberately not phrased as success. A verdict with nothing behind it is\n // the exact shape of a self-certifying agent, and it should read as one.\n return `Goal reported met after ${scale}, but no verification receipt was produced. ` +\n `Treat as unverified. Proof: ${outcome.proof}`;\n }\n return `Goal met after ${scale}. Verified by ${outcome.evidence.kind}:${outcome.evidence.ref}. ` +\n `Proof: ${outcome.proof}`;\n}\n\n/**\n * Record the outcome as a memory, so the next run knows what this one settled.\n *\n * Filed against the goal's subject rather than a file: an outcome is about an\n * intention, and the useful question later is \"has anyone tried this before\",\n * not \"what happened to line 40\".\n */\nexport function outcomeMemory(\n outcome: GoalOutcome,\n subject: string,\n authorId: string,\n): NewCodeMemory {\n return {\n subject,\n kind: \"outcome\",\n body: renderOutcome(outcome),\n ...(outcome.evidence ? { evidence: outcome.evidence } : {}),\n authorId,\n };\n}\n","// Racing: N attempts at the same goal, in parallel, winner picked by receipt.\n//\n// This is an ATTEMPT STRATEGY, not a second runner. `racedAttempt` returns a\n// GoalAttempt, so runGoal is unchanged and racing composes with everything it\n// already does — budgets, deadlines, re-prompting on the winner's feedback.\n//\n// It answers a different failure than re-prompting does. Re-prompting helps when\n// the gate said something actionable; racing helps when attempts fail\n// DIFFERENTLY each time and there is nothing to act on, only variance to sample\n// out. Measured on this corpus: gpt-5.6-terra failed two-stage-gate once in a\n// single-attempt run, then passed it twice.\n\nimport type { GoalAttempt, GoalAttemptInput, GoalAttemptOutcome } from \"./code-goal-runner\";\n\n/** One racer's result, tagged with which racer produced it. */\nexport interface RacedOutcome extends GoalAttemptOutcome {\n racer: number;\n}\n\n/**\n * One race: N independent attempts at the same goal, cheapest winner taken.\n *\n * The run is charged for every racer, not just the winner. Racing answers\n * variance, not size; at equal budget, depth beat it on every axis measured.\n */\nexport interface RacedAttemptOptions {\n /** How many attempts run per round. */\n racers: number;\n /** Runs one racer. Each MUST get an isolated workspace — racers edit in\n * parallel, and a shared tree would have them overwrite each other. */\n attempt(input: GoalAttemptInput & { racer: number }): Promise<GoalAttemptOutcome>;\n /** Override the ranking. Default: {@link selectWinner}. */\n select?(outcomes: RacedOutcome[]): RacedOutcome;\n /** Observe the whole field, for reporting what racing cost and bought. */\n onRound?(outcomes: RacedOutcome[], winner: RacedOutcome): void;\n}\n\n/**\n * Rank a field of racers.\n *\n * Passing candidates first — that is the only thing that decides the goal. Then\n * fewest steps, then cheapest, then smallest patch: three tie-breaks that all\n * prefer the attempt which did LESS to get there, on the view that a smaller\n * change reaching the same verified state is the better one to keep.\n *\n * Unknown cost ranks LAST among passing candidates rather than cheapest. An\n * unpriced racer must not win a cost comparison it never entered.\n */\nexport function selectWinner(outcomes: RacedOutcome[]): RacedOutcome {\n const ranked = [...outcomes].sort((left, right) => {\n if (left.gatePassed !== right.gatePassed) return left.gatePassed ? -1 : 1;\n // An attempt that could not run is worse than one that ran and failed: it\n // produced no evidence at all.\n const leftBroken = left.error ? 1 : 0;\n const rightBroken = right.error ? 1 : 0;\n if (leftBroken !== rightBroken) return leftBroken - rightBroken;\n const steps = (left.steps ?? Number.MAX_SAFE_INTEGER) - (right.steps ?? Number.MAX_SAFE_INTEGER);\n if (steps !== 0) return steps;\n // Unknown cost is not a number to compare, so handle it as its own case:\n // both unknown is a tie, one unknown loses to any known value. Subtracting\n // sentinels here quietly produced Infinity for the one-unknown case, which a\n // finite-check then skipped — leaving the unpriced racer to win by position.\n const leftPriced = left.costUsd !== undefined;\n const rightPriced = right.costUsd !== undefined;\n if (leftPriced !== rightPriced) return leftPriced ? -1 : 1;\n if (leftPriced && rightPriced && left.costUsd !== right.costUsd) {\n return left.costUsd! - right.costUsd!;\n }\n return (left.patchBytes ?? Number.MAX_SAFE_INTEGER) - (right.patchBytes ?? Number.MAX_SAFE_INTEGER);\n });\n return ranked[0]!;\n}\n\n/**\n * Build a GoalAttempt that races `racers` attempts and returns the winner.\n *\n * The returned outcome reports the round's TOTAL tokens and cost, not the\n * winner's. The runner charges its budget from what an attempt reports, and\n * charging only the winner would make racing look free — three racers would\n * cost what one did, and every budget in the system would be wrong by a factor\n * of N. Racing trades depth for breadth at honest spend, or it is not a trade.\n */\nexport function racedAttempt(options: RacedAttemptOptions): GoalAttempt {\n if (!Number.isSafeInteger(options.racers) || options.racers < 1) {\n throw new TypeError(\"racers must be a positive integer\");\n }\n const select = options.select ?? selectWinner;\n return async (input) => {\n const outcomes = await Promise.all(\n Array.from({ length: options.racers }, async (_unused, index): Promise<RacedOutcome> => {\n const racer = index + 1;\n try {\n return { ...(await options.attempt({ ...input, racer })), racer };\n } catch (cause) {\n return {\n racer, gatePassed: false, feedback: \"\", tokens: 0,\n error: (cause instanceof Error ? cause.message : String(cause)).slice(0, 500),\n };\n }\n }),\n );\n const winner = select(outcomes);\n options.onRound?.(outcomes, winner);\n\n const tokens = outcomes.reduce((total, outcome) => total + outcome.tokens, 0);\n const priced = outcomes.filter((outcome) => outcome.costUsd !== undefined);\n // Only report a cost when EVERY racer priced. A partial sum would understate\n // the round and let an unpriced racer hide spend inside a budget check.\n const costUsd = priced.length === outcomes.length\n ? priced.reduce((total, outcome) => total + (outcome.costUsd ?? 0), 0)\n : undefined;\n\n return {\n gatePassed: winner.gatePassed,\n feedback: winner.feedback,\n tokens,\n ...(costUsd === undefined ? {} : { costUsd }),\n ...(winner.steps === undefined ? {} : { steps: winner.steps }),\n ...(winner.patchBytes === undefined ? {} : { patchBytes: winner.patchBytes }),\n // The round only failed to RUN if every racer did. One survivor is a round.\n ...(outcomes.every((outcome) => outcome.error) ? { error: winner.error } : {}),\n };\n };\n}\n","// Decomposition: split a goal into sub-goals that cannot collide, work them in\n// parallel, integrate them one at a time.\n//\n// The obstacle is specific. The workspace model is single-candidate: every\n// attempt owns one staged tree, and the verifier's contract is \"one patch, from\n// one trusted base, re-applied clean\". It cannot tell you that three partial\n// patches compose. So decomposition here does NOT merge.\n//\n// Instead the partition is made CHECKABLE. A plan declares, per sub-goal, the\n// files it will touch; overlapping declarations are rejected before any agent\n// starts; sub-agents work in isolated trees from the same base; and integration\n// applies each sub-patch to an accumulating tree, gating after each. Parallel\n// exploration, sequential application — no merge algorithm anywhere, and a\n// sub-agent that strays outside its declared files fails its own integration.\n\nimport { validateCodePatch } from \"./code-patch\";\nimport { partition, type PartitionVerdict } from \"@odla-ai/graph\";\nimport { buildCodeGraph, FILE, IMPORTS, READS, WRITES } from \"@odla-ai/graph/code\";\n\n/** One independent slice of a goal, scoped to the files it may touch. */\nexport interface SubGoal {\n id: string;\n /** What this sub-agent is asked to do. */\n goal: string;\n /** The files it declares it will touch. Its patch is rejected if it strays. */\n files: string[];\n}\n\n/** A plan that cannot be run in parallel — overlapping files, or a stray edit. */\nexport class DecompositionError extends Error {\n constructor(message: string) {\n super(message);\n this.name = \"DecompositionError\";\n }\n}\n\n/**\n * Reject a plan that cannot be worked in parallel, BEFORE any agent starts.\n *\n * Two sub-goals declaring the same file is the whole failure mode: they would\n * produce patches against the same lines and one of them could not be applied.\n * Catching it here costs nothing; catching it at integration costs every token\n * both sub-agents spent.\n */\nexport function assertDisjointPlan(plan: readonly SubGoal[]): void {\n if (plan.length === 0) throw new DecompositionError(\"a plan needs at least one sub-goal\");\n const ids = new Set<string>();\n const owner = new Map<string, string>();\n for (const sub of plan) {\n if (!sub.id.trim()) throw new DecompositionError(\"every sub-goal needs an id\");\n if (ids.has(sub.id)) throw new DecompositionError(`duplicate sub-goal id \"${sub.id}\"`);\n ids.add(sub.id);\n if (!sub.goal.trim()) throw new DecompositionError(`sub-goal \"${sub.id}\" has no instruction`);\n if (sub.files.length === 0) {\n throw new DecompositionError(`sub-goal \"${sub.id}\" declares no files; it cannot be checked for collisions`);\n }\n for (const file of sub.files) {\n const claimed = owner.get(file);\n if (claimed !== undefined) {\n throw new DecompositionError(\n `sub-goals \"${claimed}\" and \"${sub.id}\" both declare \"${file}\"; a plan must partition the files it touches`,\n );\n }\n owner.set(file, sub.id);\n }\n }\n}\n\n/** Files a patch actually touches, or null when it is not a valid patch. */\nexport function patchPaths(patch: string, maxBytes = 256 * 1024): string[] | null {\n try { return validateCodePatch(patch, maxBytes); }\n catch { return null; }\n}\n\n/**\n * Check a sub-agent stayed inside what it declared.\n *\n * This is what makes the partition a guarantee rather than a hope: the plan is\n * checked up front, and each patch is checked against the plan. A sub-agent that\n * wandered into a neighbour's file is refused even if its patch would have\n * applied cleanly, because the NEXT sub-patch was written against a tree where\n * that edit does not exist.\n */\nexport function straySubGoalFiles(sub: SubGoal, patch: string): string[] {\n const declared = new Set(sub.files);\n return (patchPaths(patch) ?? []).filter((path) => !declared.has(path));\n}\n\n/** What one sub-goal produced: its patch, its cost, and whether it worked. */\nexport interface SubGoalResult {\n sub: SubGoal;\n /** The candidate patch, or empty when the sub-agent changed nothing. */\n patch: string;\n tokens: number;\n costUsd?: number;\n error?: string;\n}\n\n/** Applying one sub-goal's patch to the accumulating tree, and the verdict. */\nexport interface IntegrationStep {\n subGoalId: string;\n /** Did the accumulated tree still satisfy the proof after applying this one? */\n gatePassed: boolean;\n applied: boolean;\n reason?: \"stray_files\" | \"did_not_apply\" | \"gate_failed\" | \"sub_goal_failed\" | \"no_changes\";\n detail?: string;\n}\n\n/**\n * A decomposed pursuit end to end.\n *\n * Measured at 1.68x the tokens of straight depth for 0.88x the wall clock, so\n * this buys latency, not efficiency — see chooseStrategy for when that trade\n * is worth making.\n */\nexport interface DecomposedRun {\n met: boolean;\n steps: IntegrationStep[];\n tokens: number;\n costUsd?: number;\n}\n\n/** The plan, its results, and the two callbacks that apply and judge them. */\nexport interface IntegrateOptions {\n plan: readonly SubGoal[];\n results: readonly SubGoalResult[];\n /** Apply one patch to the accumulating tree; reject means it did not apply. */\n apply(patch: string): Promise<boolean>;\n /** Run the proof against the accumulating tree. */\n gate(): Promise<boolean>;\n}\n\n/**\n * Integrate sub-results one at a time, gating after each.\n *\n * Order follows the plan, and the first failure stops integration. Continuing\n * past one would mean gating a tree whose earlier layer is already known bad,\n * so every later verdict would describe a state nobody intends to ship.\n */\nexport async function integrateSubGoals(options: IntegrateOptions): Promise<DecomposedRun> {\n const steps: IntegrationStep[] = [];\n let tokens = 0;\n let costUsd = 0;\n let priced = true;\n let met = false;\n\n for (const sub of options.plan) {\n const result = options.results.find((entry) => entry.sub.id === sub.id);\n if (!result) {\n steps.push({ subGoalId: sub.id, gatePassed: false, applied: false, reason: \"sub_goal_failed\", detail: \"no result\" });\n break;\n }\n tokens += result.tokens;\n if (result.costUsd === undefined) priced = false;\n else costUsd += result.costUsd;\n\n if (result.error) {\n steps.push({ subGoalId: sub.id, gatePassed: false, applied: false, reason: \"sub_goal_failed\", detail: result.error });\n break;\n }\n if (!result.patch.trim()) {\n steps.push({ subGoalId: sub.id, gatePassed: false, applied: false, reason: \"no_changes\" });\n break;\n }\n const stray = straySubGoalFiles(sub, result.patch);\n if (stray.length > 0) {\n steps.push({\n subGoalId: sub.id, gatePassed: false, applied: false, reason: \"stray_files\",\n detail: `touched undeclared files: ${stray.join(\", \")}`,\n });\n break;\n }\n if (!(await options.apply(result.patch))) {\n steps.push({ subGoalId: sub.id, gatePassed: false, applied: false, reason: \"did_not_apply\" });\n break;\n }\n const gatePassed = await options.gate();\n steps.push({ subGoalId: sub.id, gatePassed, applied: true, ...(gatePassed ? {} : { reason: \"gate_failed\" as const }) });\n met = gatePassed;\n // A mid-plan gate failure is expected — the goal is only whole once every\n // sub-goal has landed — so integration continues. What stops it is a patch\n // that could not be applied at all, above.\n }\n\n return { met, steps, tokens, ...(priced && options.results.length > 0 ? { costUsd } : {}) };\n}\n\n/**\n * The check `assertDisjointPlan` cannot make: do the sub-goals collide through\n * what they *reach*, not merely through what they declare?\n *\n * Collision ids are graph ids (`file:src/a.ts`, `table:orders`), because the\n * answer is no longer only about files — a shared table is a real collision and\n * naming it as a bare path would be a lie about what it is.\n *\n * Declared files being disjoint is necessary and not sufficient. Two sub-goals\n * can own different modules and still both depend on a third; a change either\n * one makes to that shared module lands in one patch and is invisible to the\n * other's verification. The import graph is the only thing that can see this,\n * and it is cheap — the graph over 3,400 files builds in ~400ms, against the\n * cost of running two agents to completion and discovering it at integration.\n *\n * Reported rather than thrown, because a shared dependency is sometimes fine:\n * two sub-goals may both READ a types module neither intends to touch. The\n * caller decides whether the overlap is one it can live with.\n */\nexport async function planReachCollisions(\n plan: readonly SubGoal[],\n workspace: { paths: readonly string[]; read(path: string): Promise<string> },\n): Promise<PartitionVerdict> {\n const graph = await buildCodeGraph({ paths: workspace.paths, read: workspace.read });\n // Imports AND data, in one traversal. Two sub-goals that never import each\n // other can still both write the same table, and that collision is the one\n // structural analysis alone can never see.\n return partition(graph, plan.map((sub) => sub.files.map((file) => `${FILE}:${file}`)), {\n kinds: [IMPORTS, READS, WRITES], direction: \"out\",\n });\n}\n","// Choosing how to pursue a goal: sequentially, by racing, or by decomposing.\n//\n// The plan that produced this file assumed fan-out would usually win. Measured,\n// it usually loses. On every fixture tried, depth beat breadth on $/solve:\n//\n// racing, equal budget of 6 agent runs (two-stage-gate, gpt-5.6-terra)\n// 1 racer x 6 attempts 7,936 tokens/solve 16.9 s/solve\n// 2 racers x 3 attempts 14,055 tokens/solve 16.8 s/solve\n// 3 racers x 2 attempts 21,044 tokens/solve 19.7 s/solve\n//\n// decomposition (three-modules, gpt-5.6-terra)\n// sequential 6,474 tokens/solve 9.7 s/solve\n// decomposed x3 10,897 tokens/solve 8.5 s/solve\n//\n// One cause explains both: every parallel worker re-pays the orientation cost —\n// reading the project, taking the system prompt, finding its feet — while a\n// sequential run amortizes that across one conversation. Breadth buys wall\n// clock and nothing else.\n//\n// So this chooser is deliberately biased toward sequential, and every fan-out\n// branch has to justify itself against a measured premium.\n\n/** What is known about a goal before choosing how to pursue it. */\nexport interface StrategySignals {\n /** Prior attempts, oldest first. Empty on the first pass. */\n priorAttempts?: Array<{ gatePassed: boolean; feedback: string; error?: string }>;\n /** True when wall clock is the binding constraint — a human is waiting, or a\n * deadline is close — and paying more per solve to finish sooner is correct. */\n latencyBound?: boolean;\n /** Estimated tokens needed to hold the whole goal at once. */\n estimatedContextTokens?: number;\n /** What one agent can actually hold. */\n contextLimit?: number;\n /** A checked disjoint partition, when the planner produced one. */\n partitionable?: boolean;\n /** Racers/sub-agents available if fanning out. */\n width?: number;\n}\n\n/** How to spend a goal's budget: straight depth, N racers, or a split plan. */\nexport type GoalStrategy = \"sequential\" | \"race\" | \"decompose\";\n\n/** The chosen strategy, why, and what it is expected to cost against depth. */\nexport interface StrategyChoice {\n strategy: GoalStrategy;\n /** Why, in terms a human reviewing a run can check. */\n reason: string;\n /** Expected cost multiplier vs sequential, from the measurements above.\n * 1 for sequential; fan-out is charged what it was observed to cost. */\n expectedCostMultiplier: number;\n /** False when the branch rests on something not yet measured. */\n measured: boolean;\n}\n\n/** Observed premiums. Update these from the bench, not from expectation. */\nexport const MEASURED_PREMIUM = Object.freeze({\n /** 3 racers vs pure depth at equal budget: 21,044 / 7,936. */\n racePerRacer: 0.55,\n /** Decomposition across 3 sub-agents: 10,897 / 6,474. */\n decomposePerSubGoal: 0.23,\n});\n\nconst actionable = (feedback: string): boolean => {\n const text = feedback.trim();\n if (text.length < 12) return false;\n // Something the next attempt can act on names a place or an expectation. A\n // bare \"it failed\" leaves depth nothing to build on, which is the one case\n // where sampling another attempt beats trying again.\n return /\\b(expected|assert|error|fail(?:ed|ure)?|exit|line \\d+|\\.[a-z]{1,4}:\\d+)\\b/i.test(text)\n || /\\.(js|ts|tsx|jsx|mjs|cjs|py|go|rs|java|rb)\\b/i.test(text);\n};\n\n/**\n * Choose a strategy.\n *\n * Order matters and encodes the evidence: depth first, because it won every\n * measured comparison; fan-out only where depth demonstrably cannot help.\n */\nexport function chooseStrategy(signals: StrategySignals = {}): StrategyChoice {\n const width = Math.max(1, signals.width ?? 3);\n const prior = signals.priorAttempts ?? [];\n\n // 1. The goal does not fit. Depth cannot help — every attempt starts from the\n // same too-large problem — so this is the one case where decomposition is\n // not a premium but the only option.\n const overflows = signals.estimatedContextTokens !== undefined\n && signals.contextLimit !== undefined\n && signals.estimatedContextTokens > signals.contextLimit;\n if (overflows && signals.partitionable) {\n return {\n strategy: \"decompose\",\n reason: `the goal needs ~${signals.estimatedContextTokens} tokens against a ${signals.contextLimit} limit, and the plan partitions`,\n expectedCostMultiplier: 1 + MEASURED_PREMIUM.decomposePerSubGoal * (width - 1),\n // No fixture this large has been measured. This branch is reasoned, not\n // observed, and says so rather than borrowing the others' credibility.\n measured: false,\n };\n }\n if (overflows) {\n return {\n strategy: \"sequential\",\n reason: \"the goal exceeds one context but no disjoint partition was produced; decomposing without one would collide\",\n expectedCostMultiplier: 1,\n measured: true,\n };\n }\n\n // 2. Attempts are failing with nothing to act on. Re-prompting repeats itself;\n // another sample is the only thing that changes.\n const unhelpful = prior.length >= 2\n && prior.slice(-2).every((attempt) => !attempt.gatePassed && !attempt.error && !actionable(attempt.feedback));\n if (unhelpful) {\n return {\n strategy: \"race\",\n reason: `the last ${Math.min(2, prior.length)} gate failures carried nothing actionable, so depth has nothing to build on`,\n expectedCostMultiplier: 1 + MEASURED_PREMIUM.racePerRacer * (width - 1),\n measured: true,\n };\n }\n\n // 3. Latency is the constraint and the caller has accepted the premium.\n if (signals.latencyBound) {\n const strategy = signals.partitionable ? \"decompose\" : \"race\";\n const premium = strategy === \"decompose\"\n ? MEASURED_PREMIUM.decomposePerSubGoal\n : MEASURED_PREMIUM.racePerRacer;\n return {\n strategy,\n reason: `wall clock is the binding constraint; ${strategy} finishes sooner at a measured premium per solve`,\n expectedCostMultiplier: 1 + premium * (width - 1),\n measured: true,\n };\n }\n\n // 4. Everything else. Depth won every comparison run so far, so it is not a\n // fallback — it is the answer unless something above overrides it.\n return {\n strategy: \"sequential\",\n reason: prior.length === 0\n ? \"no evidence yet favours paying a fan-out premium\"\n : \"the gate is still saying something the next attempt can act on\",\n expectedCostMultiplier: 1,\n measured: true,\n };\n}\n\n/** Whether the gate's output gives the next attempt something to work with. */\nexport const feedbackIsActionable = actionable;\n","// A Linux dependency tree for the offline recipe container, prepared once per\n// lockfile and lent to every recipe run.\n//\n// Lending the host's own node_modules (0.11.9) served pure-JS packages and\n// nothing native: the host is macOS, the container is Linux, and vitest died\n// on \"Cannot find module @rolldown/binding-linux…\" (card 880bb33a,\n// 2026-09-05). The container cannot install anything itself, because it has\n// no network by design. So the host prepares the tree: a helper container with\n// network, given only the manifests (package.json tree, lockfile, .npmrc),\n// runs npm ci with scripts disabled into a cache keyed by the lockfile, the\n// image, the architecture and the npm that installs; the networkless recipe\n// container then mounts that tree. The helper never sees source, credentials,\n// or the workspace.\n//\n// Two lessons from the first live installs, both now pinned by tests:\n// - the npm must be the one the lockfile was generated with. The image's own\n// npm (11.16) rejected a lock npm 11.6.2 had written as out of sync\n// (\"Missing: @emnapi/runtime@1.11.3 from lock file\"), so the helper runs\n// the exact `engines.npm` when the repository pins one.\n// - the whole install is the tree, not just the root node_modules. npm nests\n// a package's own node_modules under it when a version cannot hoist, and\n// the first cache kept the root and deleted ten of those with the stage.\nimport { createHash } from \"node:crypto\";\nimport { copyFile, mkdir, readFile, readdir, rename, rm, stat, writeFile } from \"node:fs/promises\";\nimport { getgid, getuid } from \"node:process\";\nimport { join } from \"node:path\";\nimport type { ContainerEngine } from \"./container\";\nimport type { CodeRecipeResult } from \"./code-tool-types\";\nimport type { LentDirectory, RecipeDependencies } from \"./code-recipe-dependencies\";\nimport { runContainerCommand } from \"./recipe-container\";\n\n/** How long one npm ci may take before the cache gives up on it. */\nexport const DEPENDENCY_INSTALL_TIMEOUT_MS = 20 * 60_000;\nconst OUTPUT_CAP = 4 * 1024 * 1024;\nconst EXACT_VERSION = /^\\d+\\.\\d+\\.\\d+$/;\n\n/** What preparing a tree needs: the engine and pinned image, the repository, and the cache root; `run` is injectable for tests. */\nexport interface DependencyCacheInput {\n engine: ContainerEngine;\n /** The pinned recipe image; its node installs the tree. */\n image: string;\n repoRoot: string;\n /** Where trees live: `<cacheRoot>/<key>/tree/node_modules`, with per-run clones under `<cacheRoot>/<key>/runs`. */\n cacheRoot: string;\n run?: (engine: ContainerEngine, args: string[], name: string, limits: { timeoutMs: number; maxOutputBytes: number }) => Promise<CodeRecipeResult>;\n log?: (line: string) => void;\n}\n\nconst exists = async (path: string): Promise<boolean> => Boolean(await stat(path).catch(() => null));\n\n/** The npm the repository generates its lockfile with: an exact `engines.npm`, or null when it pins none. */\nexport async function pinnedNpmVersion(repoRoot: string): Promise<string | null> {\n const manifest = await readFile(join(repoRoot, \"package.json\"), \"utf8\").catch(() => null);\n if (!manifest) return null;\n const engines = (JSON.parse(manifest) as { engines?: { npm?: unknown } }).engines;\n return typeof engines?.npm === \"string\" && EXACT_VERSION.test(engines.npm) ? engines.npm : null;\n}\n\n/** The cache key: the lockfile's bytes, the image, the architecture the container runs, and the npm that installs. Null without a lockfile. */\nexport async function dependencyCacheKey(repoRoot: string, image: string, arch = process.arch, npmVersion: string | null = null): Promise<string | null> {\n const lock = await readFile(join(repoRoot, \"package-lock.json\")).catch(() => null);\n if (!lock) return null;\n return createHash(\"sha256\").update(lock).update(\"\\n\").update(image).update(\"\\n\").update(arch)\n .update(\"\\n\").update(npmVersion ?? \"image\").digest(\"hex\").slice(0, 32);\n}\n\n/** Every workspace directory the root manifest declares that has a package.json, repository-relative, in declaration order. */\nexport async function workspaceDirs(repoRoot: string): Promise<string[]> {\n const root = JSON.parse(await readFile(join(repoRoot, \"package.json\"), \"utf8\")) as { workspaces?: string[] | { packages?: string[] } };\n const globs = Array.isArray(root.workspaces) ? root.workspaces : root.workspaces?.packages ?? [];\n const dirs: string[] = [];\n for (const glob of globs) {\n const found = glob.endsWith(\"/*\")\n ? (await readdir(join(repoRoot, glob.slice(0, -2)), { withFileTypes: true }).catch(() => []))\n .filter((entry) => entry.isDirectory()).map((entry) => `${glob.slice(0, -2)}/${entry.name}`)\n : [glob];\n for (const dir of found) if (await exists(join(repoRoot, dir, \"package.json\"))) dirs.push(dir);\n }\n return dirs;\n}\n\n/** Copy only what npm ci needs: the root manifests and every workspace's package.json. Returns what was staged. */\nexport async function stageManifests(repoRoot: string, stageDir: string): Promise<string[]> {\n await mkdir(stageDir, { recursive: true });\n const staged: string[] = [];\n for (const name of [\"package.json\", \"package-lock.json\", \".npmrc\"]) {\n if (!(await exists(join(repoRoot, name)))) continue;\n await copyFile(join(repoRoot, name), join(stageDir, name)); staged.push(name);\n }\n for (const dir of await workspaceDirs(repoRoot)) {\n await mkdir(join(stageDir, dir), { recursive: true });\n await copyFile(join(repoRoot, dir, \"package.json\"), join(stageDir, dir, \"package.json\")); staged.push(`${dir}/package.json`);\n }\n return staged;\n}\n\n/** The helper's command: networked, writable stage, scripts disabled, nothing else of the host mounted; the repository's npm when it pins one. */\nexport function dependencyInstallArgs(engine: ContainerEngine, image: string, stageDir: string, name: string, npmVersion: string | null = null): string[] {\n if (/[,\\r\\n]/.test(stageDir)) throw new TypeError(\"stage path contains unsupported mount characters\");\n const uid = typeof getuid === \"function\" ? getuid() : 1000; const gid = typeof getgid === \"function\" ? getgid() : 1000;\n const mount = engine === \"container\"\n ? `--mount=type=bind,source=${stageDir},target=/workspace` : `--mount=type=bind,src=${stageDir},dst=/workspace`;\n // engine-strict is the repository's rule for the machine that generates its\n // lockfile (an exact node and npm); the helper installs that lockfile with\n // whatever node the pinned image carries, and npm refused it as\n // \"notsup Required node 24.13.0, Actual v24.18.0\" on the first live run.\n const install = [\"ci\", \"--no-audit\", \"--no-fund\", \"--ignore-scripts\", \"--engine-strict=false\"];\n const npm = npmVersion ? [\"npx\", \"--yes\", `npm@${npmVersion}`, ...install] : [\"npm\", ...install];\n return [\n \"run\", \"--rm\", `--name=${name}`, \"--cap-drop=ALL\", \"--memory=2g\", \"--cpus=2\", `--user=${uid}:${gid}`, \"--tmpfs=/tmp\",\n mount, \"--workdir=/workspace\", \"--env=CI=1\", \"--env=npm_config_cache=/tmp/npm-cache\", \"--env=HOME=/tmp\", image, ...npm,\n ];\n}\n\n/** The lines of an npm failure worth reading: from `npm error code` on, never the usage boilerplate npm ends with. */\nexport function npmFailureSummary(stderr: string): string {\n const lines = stderr.split(\"\\n\").map((line) => line.trim()).filter((line) => line && line !== \"npm error\");\n const at = lines.findIndex((line) => /^npm error code /.test(line));\n return (at >= 0 ? lines.slice(at, at + 3) : lines.slice(-3)).join(\" | \").slice(0, 400);\n}\n\n/** The nested trees an install produced: one per workspace package npm could not hoist into the root. */\nasync function nestedTrees(treeRoot: string, dirs: string[]): Promise<LentDirectory[]> {\n const nested: LentDirectory[] = [];\n for (const dir of dirs) {\n if (await exists(join(treeRoot, dir, \"node_modules\"))) nested.push({ source: join(treeRoot, dir, \"node_modules\"), mountAs: `${dir}/node_modules` });\n }\n return nested;\n}\n\n/** The tree for this repository's lockfile, from the cache or freshly installed; null when there is no lockfile or the install failed. */\nexport async function prepareContainerDependencies(input: DependencyCacheInput): Promise<RecipeDependencies | null> {\n const npmVersion = await pinnedNpmVersion(input.repoRoot);\n const key = await dependencyCacheKey(input.repoRoot, input.image, process.arch, npmVersion);\n if (!key) return null;\n const dir = join(input.cacheRoot, key); const tree = join(dir, \"tree\"); const stage = join(dir, \"stage\"); const runsDir = join(dir, \"runs\");\n // Clones of runs that died with the previous host are garbage: no run is active while a host prepares.\n await rm(runsDir, { recursive: true, force: true });\n const dirs = await workspaceDirs(input.repoRoot);\n const lend = async (): Promise<RecipeDependencies> => ({ source: join(tree, \"node_modules\"), nested: await nestedTrees(tree, dirs), runsDir });\n if (await exists(join(tree, \"node_modules\"))) return lend();\n const run = input.run ?? runContainerCommand;\n await rm(stage, { recursive: true, force: true });\n const staged = await stageManifests(input.repoRoot, stage);\n input.log?.(`installing ${key.slice(0, 12)}: ${staged.length} manifests, npm${npmVersion ? `@${npmVersion}` : \"\"} ci in ${input.image}`);\n const name = `odla-deps-${key.slice(0, 12)}`;\n const result = await run(input.engine, dependencyInstallArgs(input.engine, input.image, stage, name, npmVersion), name,\n { timeoutMs: DEPENDENCY_INSTALL_TIMEOUT_MS, maxOutputBytes: OUTPUT_CAP });\n if (result.exitCode !== 0 || result.timedOut || !(await exists(join(stage, \"node_modules\")))) {\n input.log?.(`install failed (exit ${result.exitCode}${result.timedOut ? \", timed out\" : \"\"}): ${npmFailureSummary(result.stderr)}`);\n await rm(stage, { recursive: true, force: true });\n return null;\n }\n await rm(tree, { recursive: true, force: true });\n await rename(stage, tree);\n await writeFile(join(dir, \"manifest.json\"), JSON.stringify({ image: input.image, key, npmVersion, createdAt: Date.now() }, null, 2));\n const lent = await lend();\n input.log?.(`installed ${key.slice(0, 12)} in ${Math.round(result.durationMs / 1000)}s, ${lent.nested?.length ?? 0} nested tree(s)`);\n return lent;\n}\n","// What a test imports from a sibling package is its build output: npm resolves\n// `@odla-ai/apps` through the workspace link to packages/apps/package.json,\n// whose exports point at dist/. A run's workspace is a source snapshot with\n// none of that in it: the workspace policy skips dist, so it never enters a\n// patch or a digest, and a verification workspace is the Git tree itself, so\n// the generated sources the build writes next to the tracked ones (an\n// `updates.generated.ts`, a tsbuildinfo) are not there either. The first\n// offline proofs to reach that far died on esbuild's \"Could not resolve\n// @odla-ai/apps\" and on \"Cannot find module './updates.generated'\".\n//\n// The host has just built the same commit, so its build output is lent in:\n// each workspace package's dist, and every file Git ignores that the workspace\n// policy does not reserve, each only where the workspace has the package and\n// no copy of its own. A proof that changes a package other packages consume\n// still has to rebuild it, exactly as a developer would.\nimport { spawn } from \"node:child_process\";\nimport { stat } from \"node:fs/promises\";\nimport { join } from \"node:path\";\nimport type { LentDirectory } from \"./code-recipe-dependencies\";\nimport { workspaceDirs } from \"./code-recipe-dependency-cache\";\nimport { allowedWorkspacePath } from \"./workspace-policy\";\n\nfunction gitIgnoredFiles(repoRoot: string): Promise<string[]> {\n return new Promise((accept) => {\n const child = spawn(\"git\", [\"-C\", repoRoot, \"ls-files\", \"--others\", \"--ignored\", \"--exclude-standard\", \"-z\"], { shell: false, stdio: [\"ignore\", \"pipe\", \"ignore\"] });\n const chunks: Buffer[] = [];\n child.stdout.on(\"data\", (chunk: Buffer) => chunks.push(chunk));\n child.once(\"error\", () => accept([]));\n child.once(\"exit\", (code) => accept(code === 0 ? Buffer.concat(chunks).toString(\"utf8\").split(\"\\0\").filter(Boolean) : []));\n });\n}\n\n/** The host checkout's build output to lend into a run's workspace: each package's `dist`, then every ignored file the policy allows. */\nexport async function hostBuildProducts(repoRoot: string): Promise<LentDirectory[]> {\n const dirs = await workspaceDirs(repoRoot);\n const within = (path: string): string => dirs.find((dir) => path.startsWith(`${dir}/`)) ?? \".\";\n const products: LentDirectory[] = [];\n for (const dir of dirs) {\n const source = join(repoRoot, dir, \"dist\");\n if ((await stat(source).catch(() => null))?.isDirectory()) products.push({ source, mountAs: `${dir}/dist`, within: dir });\n }\n for (const path of await gitIgnoredFiles(repoRoot)) {\n if (allowedWorkspacePath(path)) products.push({ source: join(repoRoot, path), mountAs: path, within: within(path) });\n }\n return products;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,eAAe,WAAW,QAAwC;AAChE,QAAM,SAAS,GAAG,OAAO,OAAO,IAAI,OAAO,IAAI,IAAI,OAAO,IAAI;AAC9D,QAAM,QAAQ,MAAM,OAAO,OAAO,OAAO,WAAW,IAAI,YAAY,EAAE,OAAO,MAAM,CAAC;AACpF,SAAO,MAAM,KAAK,IAAI,WAAW,K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1
|
+
{"version":3,"sources":["../src/code-runtime-memory.ts","../src/code-goal-outcome.ts","../src/code-goal-race.ts","../src/code-goal-decompose.ts","../src/code-goal-strategy.ts","../src/code-recipe-dependency-cache.ts","../src/code-recipe-build-products.ts"],"sourcesContent":["// The brokered control plane, presented as the memory store the runner wants.\n//\n// The Goal Runner takes a CodeMemoryStore; the runtime has a control plane that\n// speaks HTTP over a host credential. This is the few lines between them, and it\n// exists so neither side learns about the other: the runner never knows memory\n// crosses a network, and the control plane never learns what a hazard is.\n\nimport type { CodeMemory, CodeMemoryStore, NewCodeMemory } from \"./code-memory\";\nimport type { CodeRuntimeAgentControlPlane } from \"./code-runtime\";\n\n/**\n * A key derived from the memory itself, so a retry writes once.\n *\n * Content-derived rather than random: the retry that matters is the one after a\n * timeout, where the caller cannot know whether the first write landed — and a\n * fresh random key would guarantee a duplicate exactly then.\n */\nasync function mutationId(memory: NewCodeMemory): Promise<string> {\n const source = `${memory.subject} ${memory.kind} ${memory.body}`;\n const bytes = await crypto.subtle.digest(\"SHA-256\", new TextEncoder().encode(source));\n return Array.from(new Uint8Array(bytes), (byte) => byte.toString(16).padStart(2, \"0\"))\n .join(\"\").slice(0, 40);\n}\n\n/**\n * Present a session's brokered memory as a store, or null when the control\n * plane does not offer one.\n *\n * Null rather than a throwing stub: a Code host talking to a registry that\n * predates memory should quietly lose the feature, not fail every goal that\n * would have recorded something.\n */\nexport function runtimeMemoryStore(\n control: CodeRuntimeAgentControlPlane, sessionId: string,\n): CodeMemoryStore | null {\n const recall = control.recallMemories;\n const remember = control.rememberMemory;\n if (!recall || !remember) return null;\n return {\n recall: async (subjects, limit) =>\n (await recall.call(control, sessionId, subjects, limit)) as CodeMemory[],\n remember: async (memory: NewCodeMemory) => {\n await remember.call(control, sessionId, {\n subject: memory.subject,\n kind: memory.kind,\n body: memory.body,\n ...(memory.evidence ? { evidence: memory.evidence } : {}),\n mutationId: await mutationId(memory),\n });\n // The control plane owns the id and the author — attribution a writer\n // chooses is not attribution — so what comes back here is only enough to\n // satisfy the interface the runner holds.\n return { ...memory, id: \"\", createdAt: Date.now() };\n },\n };\n}\n","// Comparing what a goal achieved to what it was for.\n//\n// A PM goal already carries a `proof` — the sentence that says how you would\n// know it was met. The Goal Runner already produces a signed verification\n// receipt for every attempt. Nothing connected them, so a goal moved to met\n// because an agent said it was.\n//\n// That is precisely the edit the PM audit trail now flags as self-serving: the\n// principal doing the work moving its own goalposts. I did it myself half a\n// dozen times this session, by hand, and the board has no way to tell those\n// apart from a real completion.\n//\n// So an outcome is a THIRD thing, produced by neither the goal's author nor its\n// executor: the verifier's verdict, recorded against the goal, with the receipt\n// that backs it. A goal reaches met because evidence exists, or it does not\n// reach met.\n\nimport type { CodeMemoryEvidence, NewCodeMemory } from \"./code-memory\";\n\n/** What a run actually did, judged rather than claimed. */\nexport interface GoalOutcome {\n /** The PM entity this goal came from, when it came from one. */\n pmEntityId?: string;\n goal: string;\n /** How the goal said it would be judged. */\n proof: string;\n /** Whether the clean verifier agreed. */\n met: boolean;\n /** Why it stopped — `proof_passed`, or the budget that ran out. */\n stoppedReason: string;\n attempts: number;\n tokens: number;\n costUsd?: number;\n /** The receipt that backs a met verdict. Absent means nothing backs it. */\n evidence?: CodeMemoryEvidence;\n}\n\n/**\n * Whether an outcome may move a PM item to done.\n *\n * Two conditions, and the second is the one that matters: the verifier agreed,\n * AND it left a receipt. A `met` with no evidence is an agent's assertion\n * wearing a verdict's clothes, and admitting it would make the whole audit\n * trail decorative.\n */\nexport function outcomeCloses(outcome: GoalOutcome): boolean {\n return outcome.met && outcome.evidence !== undefined;\n}\n\n/**\n * Say plainly what happened, for the PM comment that records it.\n *\n * Written for a human deciding whether to trust the result, so the numbers that\n * bound the claim — attempts, tokens, cost — are in the sentence rather than in\n * a linked artifact nobody opens. Unknown cost is said as unknown; reporting\n * $0.00 for a run whose pricing was unavailable would be a lie in the direction\n * that flatters the agent.\n */\nexport function renderOutcome(outcome: GoalOutcome): string {\n const spend = outcome.costUsd === undefined\n ? \"cost unknown\"\n : `$${outcome.costUsd.toFixed(4)}`;\n const scale = `${outcome.attempts} attempt(s), ${outcome.tokens.toLocaleString()} tokens, ${spend}`;\n if (!outcome.met) {\n return `Goal not met (${outcome.stoppedReason}) after ${scale}. Proof: ${outcome.proof}`;\n }\n if (!outcome.evidence) {\n // Deliberately not phrased as success. A verdict with nothing behind it is\n // the exact shape of a self-certifying agent, and it should read as one.\n return `Goal reported met after ${scale}, but no verification receipt was produced. ` +\n `Treat as unverified. Proof: ${outcome.proof}`;\n }\n return `Goal met after ${scale}. Verified by ${outcome.evidence.kind}:${outcome.evidence.ref}. ` +\n `Proof: ${outcome.proof}`;\n}\n\n/**\n * Record the outcome as a memory, so the next run knows what this one settled.\n *\n * Filed against the goal's subject rather than a file: an outcome is about an\n * intention, and the useful question later is \"has anyone tried this before\",\n * not \"what happened to line 40\".\n */\nexport function outcomeMemory(\n outcome: GoalOutcome,\n subject: string,\n authorId: string,\n): NewCodeMemory {\n return {\n subject,\n kind: \"outcome\",\n body: renderOutcome(outcome),\n ...(outcome.evidence ? { evidence: outcome.evidence } : {}),\n authorId,\n };\n}\n","// Racing: N attempts at the same goal, in parallel, winner picked by receipt.\n//\n// This is an ATTEMPT STRATEGY, not a second runner. `racedAttempt` returns a\n// GoalAttempt, so runGoal is unchanged and racing composes with everything it\n// already does — budgets, deadlines, re-prompting on the winner's feedback.\n//\n// It answers a different failure than re-prompting does. Re-prompting helps when\n// the gate said something actionable; racing helps when attempts fail\n// DIFFERENTLY each time and there is nothing to act on, only variance to sample\n// out. Measured on this corpus: gpt-5.6-terra failed two-stage-gate once in a\n// single-attempt run, then passed it twice.\n\nimport type { GoalAttempt, GoalAttemptInput, GoalAttemptOutcome } from \"./code-goal-runner\";\n\n/** One racer's result, tagged with which racer produced it. */\nexport interface RacedOutcome extends GoalAttemptOutcome {\n racer: number;\n}\n\n/**\n * One race: N independent attempts at the same goal, cheapest winner taken.\n *\n * The run is charged for every racer, not just the winner. Racing answers\n * variance, not size; at equal budget, depth beat it on every axis measured.\n */\nexport interface RacedAttemptOptions {\n /** How many attempts run per round. */\n racers: number;\n /** Runs one racer. Each MUST get an isolated workspace — racers edit in\n * parallel, and a shared tree would have them overwrite each other. */\n attempt(input: GoalAttemptInput & { racer: number }): Promise<GoalAttemptOutcome>;\n /** Override the ranking. Default: {@link selectWinner}. */\n select?(outcomes: RacedOutcome[]): RacedOutcome;\n /** Observe the whole field, for reporting what racing cost and bought. */\n onRound?(outcomes: RacedOutcome[], winner: RacedOutcome): void;\n}\n\n/**\n * Rank a field of racers.\n *\n * Passing candidates first — that is the only thing that decides the goal. Then\n * fewest steps, then cheapest, then smallest patch: three tie-breaks that all\n * prefer the attempt which did LESS to get there, on the view that a smaller\n * change reaching the same verified state is the better one to keep.\n *\n * Unknown cost ranks LAST among passing candidates rather than cheapest. An\n * unpriced racer must not win a cost comparison it never entered.\n */\nexport function selectWinner(outcomes: RacedOutcome[]): RacedOutcome {\n const ranked = [...outcomes].sort((left, right) => {\n if (left.gatePassed !== right.gatePassed) return left.gatePassed ? -1 : 1;\n // An attempt that could not run is worse than one that ran and failed: it\n // produced no evidence at all.\n const leftBroken = left.error ? 1 : 0;\n const rightBroken = right.error ? 1 : 0;\n if (leftBroken !== rightBroken) return leftBroken - rightBroken;\n const steps = (left.steps ?? Number.MAX_SAFE_INTEGER) - (right.steps ?? Number.MAX_SAFE_INTEGER);\n if (steps !== 0) return steps;\n // Unknown cost is not a number to compare, so handle it as its own case:\n // both unknown is a tie, one unknown loses to any known value. Subtracting\n // sentinels here quietly produced Infinity for the one-unknown case, which a\n // finite-check then skipped — leaving the unpriced racer to win by position.\n const leftPriced = left.costUsd !== undefined;\n const rightPriced = right.costUsd !== undefined;\n if (leftPriced !== rightPriced) return leftPriced ? -1 : 1;\n if (leftPriced && rightPriced && left.costUsd !== right.costUsd) {\n return left.costUsd! - right.costUsd!;\n }\n return (left.patchBytes ?? Number.MAX_SAFE_INTEGER) - (right.patchBytes ?? Number.MAX_SAFE_INTEGER);\n });\n return ranked[0]!;\n}\n\n/**\n * Build a GoalAttempt that races `racers` attempts and returns the winner.\n *\n * The returned outcome reports the round's TOTAL tokens and cost, not the\n * winner's. The runner charges its budget from what an attempt reports, and\n * charging only the winner would make racing look free — three racers would\n * cost what one did, and every budget in the system would be wrong by a factor\n * of N. Racing trades depth for breadth at honest spend, or it is not a trade.\n */\nexport function racedAttempt(options: RacedAttemptOptions): GoalAttempt {\n if (!Number.isSafeInteger(options.racers) || options.racers < 1) {\n throw new TypeError(\"racers must be a positive integer\");\n }\n const select = options.select ?? selectWinner;\n return async (input) => {\n const outcomes = await Promise.all(\n Array.from({ length: options.racers }, async (_unused, index): Promise<RacedOutcome> => {\n const racer = index + 1;\n try {\n return { ...(await options.attempt({ ...input, racer })), racer };\n } catch (cause) {\n return {\n racer, gatePassed: false, feedback: \"\", tokens: 0,\n error: (cause instanceof Error ? cause.message : String(cause)).slice(0, 500),\n };\n }\n }),\n );\n const winner = select(outcomes);\n options.onRound?.(outcomes, winner);\n\n const tokens = outcomes.reduce((total, outcome) => total + outcome.tokens, 0);\n const priced = outcomes.filter((outcome) => outcome.costUsd !== undefined);\n // Only report a cost when EVERY racer priced. A partial sum would understate\n // the round and let an unpriced racer hide spend inside a budget check.\n const costUsd = priced.length === outcomes.length\n ? priced.reduce((total, outcome) => total + (outcome.costUsd ?? 0), 0)\n : undefined;\n\n return {\n gatePassed: winner.gatePassed,\n feedback: winner.feedback,\n tokens,\n ...(costUsd === undefined ? {} : { costUsd }),\n ...(winner.steps === undefined ? {} : { steps: winner.steps }),\n ...(winner.patchBytes === undefined ? {} : { patchBytes: winner.patchBytes }),\n // The round only failed to RUN if every racer did. One survivor is a round.\n ...(outcomes.every((outcome) => outcome.error) ? { error: winner.error } : {}),\n };\n };\n}\n","// Decomposition: split a goal into sub-goals that cannot collide, work them in\n// parallel, integrate them one at a time.\n//\n// The obstacle is specific. The workspace model is single-candidate: every\n// attempt owns one staged tree, and the verifier's contract is \"one patch, from\n// one trusted base, re-applied clean\". It cannot tell you that three partial\n// patches compose. So decomposition here does NOT merge.\n//\n// Instead the partition is made CHECKABLE. A plan declares, per sub-goal, the\n// files it will touch; overlapping declarations are rejected before any agent\n// starts; sub-agents work in isolated trees from the same base; and integration\n// applies each sub-patch to an accumulating tree, gating after each. Parallel\n// exploration, sequential application — no merge algorithm anywhere, and a\n// sub-agent that strays outside its declared files fails its own integration.\n\nimport { validateCodePatch } from \"./code-patch\";\nimport { partition, type PartitionVerdict } from \"@odla-ai/graph\";\nimport { buildCodeGraph, FILE, IMPORTS, READS, WRITES } from \"@odla-ai/graph/code\";\n\n/** One independent slice of a goal, scoped to the files it may touch. */\nexport interface SubGoal {\n id: string;\n /** What this sub-agent is asked to do. */\n goal: string;\n /** The files it declares it will touch. Its patch is rejected if it strays. */\n files: string[];\n}\n\n/** A plan that cannot be run in parallel — overlapping files, or a stray edit. */\nexport class DecompositionError extends Error {\n constructor(message: string) {\n super(message);\n this.name = \"DecompositionError\";\n }\n}\n\n/**\n * Reject a plan that cannot be worked in parallel, BEFORE any agent starts.\n *\n * Two sub-goals declaring the same file is the whole failure mode: they would\n * produce patches against the same lines and one of them could not be applied.\n * Catching it here costs nothing; catching it at integration costs every token\n * both sub-agents spent.\n */\nexport function assertDisjointPlan(plan: readonly SubGoal[]): void {\n if (plan.length === 0) throw new DecompositionError(\"a plan needs at least one sub-goal\");\n const ids = new Set<string>();\n const owner = new Map<string, string>();\n for (const sub of plan) {\n if (!sub.id.trim()) throw new DecompositionError(\"every sub-goal needs an id\");\n if (ids.has(sub.id)) throw new DecompositionError(`duplicate sub-goal id \"${sub.id}\"`);\n ids.add(sub.id);\n if (!sub.goal.trim()) throw new DecompositionError(`sub-goal \"${sub.id}\" has no instruction`);\n if (sub.files.length === 0) {\n throw new DecompositionError(`sub-goal \"${sub.id}\" declares no files; it cannot be checked for collisions`);\n }\n for (const file of sub.files) {\n const claimed = owner.get(file);\n if (claimed !== undefined) {\n throw new DecompositionError(\n `sub-goals \"${claimed}\" and \"${sub.id}\" both declare \"${file}\"; a plan must partition the files it touches`,\n );\n }\n owner.set(file, sub.id);\n }\n }\n}\n\n/** Files a patch actually touches, or null when it is not a valid patch. */\nexport function patchPaths(patch: string, maxBytes = 256 * 1024): string[] | null {\n try { return validateCodePatch(patch, maxBytes); }\n catch { return null; }\n}\n\n/**\n * Check a sub-agent stayed inside what it declared.\n *\n * This is what makes the partition a guarantee rather than a hope: the plan is\n * checked up front, and each patch is checked against the plan. A sub-agent that\n * wandered into a neighbour's file is refused even if its patch would have\n * applied cleanly, because the NEXT sub-patch was written against a tree where\n * that edit does not exist.\n */\nexport function straySubGoalFiles(sub: SubGoal, patch: string): string[] {\n const declared = new Set(sub.files);\n return (patchPaths(patch) ?? []).filter((path) => !declared.has(path));\n}\n\n/** What one sub-goal produced: its patch, its cost, and whether it worked. */\nexport interface SubGoalResult {\n sub: SubGoal;\n /** The candidate patch, or empty when the sub-agent changed nothing. */\n patch: string;\n tokens: number;\n costUsd?: number;\n error?: string;\n}\n\n/** Applying one sub-goal's patch to the accumulating tree, and the verdict. */\nexport interface IntegrationStep {\n subGoalId: string;\n /** Did the accumulated tree still satisfy the proof after applying this one? */\n gatePassed: boolean;\n applied: boolean;\n reason?: \"stray_files\" | \"did_not_apply\" | \"gate_failed\" | \"sub_goal_failed\" | \"no_changes\";\n detail?: string;\n}\n\n/**\n * A decomposed pursuit end to end.\n *\n * Measured at 1.68x the tokens of straight depth for 0.88x the wall clock, so\n * this buys latency, not efficiency — see chooseStrategy for when that trade\n * is worth making.\n */\nexport interface DecomposedRun {\n met: boolean;\n steps: IntegrationStep[];\n tokens: number;\n costUsd?: number;\n}\n\n/** The plan, its results, and the two callbacks that apply and judge them. */\nexport interface IntegrateOptions {\n plan: readonly SubGoal[];\n results: readonly SubGoalResult[];\n /** Apply one patch to the accumulating tree; reject means it did not apply. */\n apply(patch: string): Promise<boolean>;\n /** Run the proof against the accumulating tree. */\n gate(): Promise<boolean>;\n}\n\n/**\n * Integrate sub-results one at a time, gating after each.\n *\n * Order follows the plan, and the first failure stops integration. Continuing\n * past one would mean gating a tree whose earlier layer is already known bad,\n * so every later verdict would describe a state nobody intends to ship.\n */\nexport async function integrateSubGoals(options: IntegrateOptions): Promise<DecomposedRun> {\n const steps: IntegrationStep[] = [];\n let tokens = 0;\n let costUsd = 0;\n let priced = true;\n let met = false;\n\n for (const sub of options.plan) {\n const result = options.results.find((entry) => entry.sub.id === sub.id);\n if (!result) {\n steps.push({ subGoalId: sub.id, gatePassed: false, applied: false, reason: \"sub_goal_failed\", detail: \"no result\" });\n break;\n }\n tokens += result.tokens;\n if (result.costUsd === undefined) priced = false;\n else costUsd += result.costUsd;\n\n if (result.error) {\n steps.push({ subGoalId: sub.id, gatePassed: false, applied: false, reason: \"sub_goal_failed\", detail: result.error });\n break;\n }\n if (!result.patch.trim()) {\n steps.push({ subGoalId: sub.id, gatePassed: false, applied: false, reason: \"no_changes\" });\n break;\n }\n const stray = straySubGoalFiles(sub, result.patch);\n if (stray.length > 0) {\n steps.push({\n subGoalId: sub.id, gatePassed: false, applied: false, reason: \"stray_files\",\n detail: `touched undeclared files: ${stray.join(\", \")}`,\n });\n break;\n }\n if (!(await options.apply(result.patch))) {\n steps.push({ subGoalId: sub.id, gatePassed: false, applied: false, reason: \"did_not_apply\" });\n break;\n }\n const gatePassed = await options.gate();\n steps.push({ subGoalId: sub.id, gatePassed, applied: true, ...(gatePassed ? {} : { reason: \"gate_failed\" as const }) });\n met = gatePassed;\n // A mid-plan gate failure is expected — the goal is only whole once every\n // sub-goal has landed — so integration continues. What stops it is a patch\n // that could not be applied at all, above.\n }\n\n return { met, steps, tokens, ...(priced && options.results.length > 0 ? { costUsd } : {}) };\n}\n\n/**\n * The check `assertDisjointPlan` cannot make: do the sub-goals collide through\n * what they *reach*, not merely through what they declare?\n *\n * Collision ids are graph ids (`file:src/a.ts`, `table:orders`), because the\n * answer is no longer only about files — a shared table is a real collision and\n * naming it as a bare path would be a lie about what it is.\n *\n * Declared files being disjoint is necessary and not sufficient. Two sub-goals\n * can own different modules and still both depend on a third; a change either\n * one makes to that shared module lands in one patch and is invisible to the\n * other's verification. The import graph is the only thing that can see this,\n * and it is cheap — the graph over 3,400 files builds in ~400ms, against the\n * cost of running two agents to completion and discovering it at integration.\n *\n * Reported rather than thrown, because a shared dependency is sometimes fine:\n * two sub-goals may both READ a types module neither intends to touch. The\n * caller decides whether the overlap is one it can live with.\n */\nexport async function planReachCollisions(\n plan: readonly SubGoal[],\n workspace: { paths: readonly string[]; read(path: string): Promise<string> },\n): Promise<PartitionVerdict> {\n const graph = await buildCodeGraph({ paths: workspace.paths, read: workspace.read });\n // Imports AND data, in one traversal. Two sub-goals that never import each\n // other can still both write the same table, and that collision is the one\n // structural analysis alone can never see.\n return partition(graph, plan.map((sub) => sub.files.map((file) => `${FILE}:${file}`)), {\n kinds: [IMPORTS, READS, WRITES], direction: \"out\",\n });\n}\n","// Choosing how to pursue a goal: sequentially, by racing, or by decomposing.\n//\n// The plan that produced this file assumed fan-out would usually win. Measured,\n// it usually loses. On every fixture tried, depth beat breadth on $/solve:\n//\n// racing, equal budget of 6 agent runs (two-stage-gate, gpt-5.6-terra)\n// 1 racer x 6 attempts 7,936 tokens/solve 16.9 s/solve\n// 2 racers x 3 attempts 14,055 tokens/solve 16.8 s/solve\n// 3 racers x 2 attempts 21,044 tokens/solve 19.7 s/solve\n//\n// decomposition (three-modules, gpt-5.6-terra)\n// sequential 6,474 tokens/solve 9.7 s/solve\n// decomposed x3 10,897 tokens/solve 8.5 s/solve\n//\n// One cause explains both: every parallel worker re-pays the orientation cost —\n// reading the project, taking the system prompt, finding its feet — while a\n// sequential run amortizes that across one conversation. Breadth buys wall\n// clock and nothing else.\n//\n// So this chooser is deliberately biased toward sequential, and every fan-out\n// branch has to justify itself against a measured premium.\n\n/** What is known about a goal before choosing how to pursue it. */\nexport interface StrategySignals {\n /** Prior attempts, oldest first. Empty on the first pass. */\n priorAttempts?: Array<{ gatePassed: boolean; feedback: string; error?: string }>;\n /** True when wall clock is the binding constraint — a human is waiting, or a\n * deadline is close — and paying more per solve to finish sooner is correct. */\n latencyBound?: boolean;\n /** Estimated tokens needed to hold the whole goal at once. */\n estimatedContextTokens?: number;\n /** What one agent can actually hold. */\n contextLimit?: number;\n /** A checked disjoint partition, when the planner produced one. */\n partitionable?: boolean;\n /** Racers/sub-agents available if fanning out. */\n width?: number;\n}\n\n/** How to spend a goal's budget: straight depth, N racers, or a split plan. */\nexport type GoalStrategy = \"sequential\" | \"race\" | \"decompose\";\n\n/** The chosen strategy, why, and what it is expected to cost against depth. */\nexport interface StrategyChoice {\n strategy: GoalStrategy;\n /** Why, in terms a human reviewing a run can check. */\n reason: string;\n /** Expected cost multiplier vs sequential, from the measurements above.\n * 1 for sequential; fan-out is charged what it was observed to cost. */\n expectedCostMultiplier: number;\n /** False when the branch rests on something not yet measured. */\n measured: boolean;\n}\n\n/** Observed premiums. Update these from the bench, not from expectation. */\nexport const MEASURED_PREMIUM = Object.freeze({\n /** 3 racers vs pure depth at equal budget: 21,044 / 7,936. */\n racePerRacer: 0.55,\n /** Decomposition across 3 sub-agents: 10,897 / 6,474. */\n decomposePerSubGoal: 0.23,\n});\n\nconst actionable = (feedback: string): boolean => {\n const text = feedback.trim();\n if (text.length < 12) return false;\n // Something the next attempt can act on names a place or an expectation. A\n // bare \"it failed\" leaves depth nothing to build on, which is the one case\n // where sampling another attempt beats trying again.\n return /\\b(expected|assert|error|fail(?:ed|ure)?|exit|line \\d+|\\.[a-z]{1,4}:\\d+)\\b/i.test(text)\n || /\\.(js|ts|tsx|jsx|mjs|cjs|py|go|rs|java|rb)\\b/i.test(text);\n};\n\n/**\n * Choose a strategy.\n *\n * Order matters and encodes the evidence: depth first, because it won every\n * measured comparison; fan-out only where depth demonstrably cannot help.\n */\nexport function chooseStrategy(signals: StrategySignals = {}): StrategyChoice {\n const width = Math.max(1, signals.width ?? 3);\n const prior = signals.priorAttempts ?? [];\n\n // 1. The goal does not fit. Depth cannot help — every attempt starts from the\n // same too-large problem — so this is the one case where decomposition is\n // not a premium but the only option.\n const overflows = signals.estimatedContextTokens !== undefined\n && signals.contextLimit !== undefined\n && signals.estimatedContextTokens > signals.contextLimit;\n if (overflows && signals.partitionable) {\n return {\n strategy: \"decompose\",\n reason: `the goal needs ~${signals.estimatedContextTokens} tokens against a ${signals.contextLimit} limit, and the plan partitions`,\n expectedCostMultiplier: 1 + MEASURED_PREMIUM.decomposePerSubGoal * (width - 1),\n // No fixture this large has been measured. This branch is reasoned, not\n // observed, and says so rather than borrowing the others' credibility.\n measured: false,\n };\n }\n if (overflows) {\n return {\n strategy: \"sequential\",\n reason: \"the goal exceeds one context but no disjoint partition was produced; decomposing without one would collide\",\n expectedCostMultiplier: 1,\n measured: true,\n };\n }\n\n // 2. Attempts are failing with nothing to act on. Re-prompting repeats itself;\n // another sample is the only thing that changes.\n const unhelpful = prior.length >= 2\n && prior.slice(-2).every((attempt) => !attempt.gatePassed && !attempt.error && !actionable(attempt.feedback));\n if (unhelpful) {\n return {\n strategy: \"race\",\n reason: `the last ${Math.min(2, prior.length)} gate failures carried nothing actionable, so depth has nothing to build on`,\n expectedCostMultiplier: 1 + MEASURED_PREMIUM.racePerRacer * (width - 1),\n measured: true,\n };\n }\n\n // 3. Latency is the constraint and the caller has accepted the premium.\n if (signals.latencyBound) {\n const strategy = signals.partitionable ? \"decompose\" : \"race\";\n const premium = strategy === \"decompose\"\n ? MEASURED_PREMIUM.decomposePerSubGoal\n : MEASURED_PREMIUM.racePerRacer;\n return {\n strategy,\n reason: `wall clock is the binding constraint; ${strategy} finishes sooner at a measured premium per solve`,\n expectedCostMultiplier: 1 + premium * (width - 1),\n measured: true,\n };\n }\n\n // 4. Everything else. Depth won every comparison run so far, so it is not a\n // fallback — it is the answer unless something above overrides it.\n return {\n strategy: \"sequential\",\n reason: prior.length === 0\n ? \"no evidence yet favours paying a fan-out premium\"\n : \"the gate is still saying something the next attempt can act on\",\n expectedCostMultiplier: 1,\n measured: true,\n };\n}\n\n/** Whether the gate's output gives the next attempt something to work with. */\nexport const feedbackIsActionable = actionable;\n","// A Linux dependency tree for the offline recipe container, prepared once per\n// lockfile and lent to every recipe run.\n//\n// Lending the host's own node_modules (0.11.9) served pure-JS packages and\n// nothing native: the host is macOS, the container is Linux, and vitest died\n// on \"Cannot find module @rolldown/binding-linux…\" (card 880bb33a,\n// 2026-09-05). The container cannot install anything itself, because it has\n// no network by design. So the host prepares the tree: a helper container with\n// network, given only the manifests (package.json tree, lockfile, .npmrc),\n// runs npm ci with scripts disabled into a cache keyed by the lockfile, the\n// image, the architecture and the npm that installs; the networkless recipe\n// container then mounts that tree. The helper never sees source, credentials,\n// or the workspace.\n//\n// Two lessons from the first live installs, both now pinned by tests:\n// - the npm must be the one the lockfile was generated with. The image's own\n// npm (11.16) rejected a lock npm 11.6.2 had written as out of sync\n// (\"Missing: @emnapi/runtime@1.11.3 from lock file\"), so the helper runs\n// the exact `engines.npm` when the repository pins one.\n// - the whole install is the tree, not just the root node_modules. npm nests\n// a package's own node_modules under it when a version cannot hoist, and\n// the first cache kept the root and deleted ten of those with the stage.\nimport { createHash } from \"node:crypto\";\nimport { copyFile, mkdir, readFile, readdir, rename, rm, stat, writeFile } from \"node:fs/promises\";\nimport { getgid, getuid } from \"node:process\";\nimport { join } from \"node:path\";\nimport type { ContainerEngine } from \"./container\";\nimport type { CodeRecipeResult } from \"./code-tool-types\";\nimport type { LentDirectory, RecipeDependencies } from \"./code-recipe-dependencies\";\nimport { runContainerCommand } from \"./recipe-container\";\n\n/** How long one npm ci may take before the cache gives up on it. */\nexport const DEPENDENCY_INSTALL_TIMEOUT_MS = 20 * 60_000;\nconst OUTPUT_CAP = 4 * 1024 * 1024;\nconst EXACT_VERSION = /^\\d+\\.\\d+\\.\\d+$/;\n\n/** What preparing a tree needs: the engine and pinned image, the repository, and the cache root; `run` is injectable for tests. */\nexport interface DependencyCacheInput {\n engine: ContainerEngine;\n /** The pinned recipe image; its node installs the tree. */\n image: string;\n repoRoot: string;\n /** Where trees live: `<cacheRoot>/<key>/tree/node_modules`, with per-run clones under `<cacheRoot>/<key>/runs`. */\n cacheRoot: string;\n run?: (engine: ContainerEngine, args: string[], name: string, limits: { timeoutMs: number; maxOutputBytes: number }) => Promise<CodeRecipeResult>;\n log?: (line: string) => void;\n}\n\nconst exists = async (path: string): Promise<boolean> => Boolean(await stat(path).catch(() => null));\n\n/** The npm the repository generates its lockfile with: an exact `engines.npm`, or null when it pins none. */\nexport async function pinnedNpmVersion(repoRoot: string): Promise<string | null> {\n const manifest = await readFile(join(repoRoot, \"package.json\"), \"utf8\").catch(() => null);\n if (!manifest) return null;\n const engines = (JSON.parse(manifest) as { engines?: { npm?: unknown } }).engines;\n return typeof engines?.npm === \"string\" && EXACT_VERSION.test(engines.npm) ? engines.npm : null;\n}\n\n/** The cache key: the lockfile's bytes, the image, the architecture the container runs, and the npm that installs. Null without a lockfile. */\nexport async function dependencyCacheKey(repoRoot: string, image: string, arch = process.arch, npmVersion: string | null = null): Promise<string | null> {\n const lock = await readFile(join(repoRoot, \"package-lock.json\")).catch(() => null);\n if (!lock) return null;\n return createHash(\"sha256\").update(lock).update(\"\\n\").update(image).update(\"\\n\").update(arch)\n .update(\"\\n\").update(npmVersion ?? \"image\").digest(\"hex\").slice(0, 32);\n}\n\n/** Every workspace directory the root manifest declares that has a package.json, repository-relative, in declaration order. */\nexport async function workspaceDirs(repoRoot: string): Promise<string[]> {\n const root = JSON.parse(await readFile(join(repoRoot, \"package.json\"), \"utf8\")) as { workspaces?: string[] | { packages?: string[] } };\n const globs = Array.isArray(root.workspaces) ? root.workspaces : root.workspaces?.packages ?? [];\n const dirs: string[] = [];\n for (const glob of globs) {\n const found = glob.endsWith(\"/*\")\n ? (await readdir(join(repoRoot, glob.slice(0, -2)), { withFileTypes: true }).catch(() => []))\n .filter((entry) => entry.isDirectory()).map((entry) => `${glob.slice(0, -2)}/${entry.name}`)\n : [glob];\n for (const dir of found) if (await exists(join(repoRoot, dir, \"package.json\"))) dirs.push(dir);\n }\n return dirs;\n}\n\n/** Copy only what npm ci needs: the root manifests and every workspace's package.json. Returns what was staged. */\nexport async function stageManifests(repoRoot: string, stageDir: string): Promise<string[]> {\n await mkdir(stageDir, { recursive: true });\n const staged: string[] = [];\n for (const name of [\"package.json\", \"package-lock.json\", \".npmrc\"]) {\n if (!(await exists(join(repoRoot, name)))) continue;\n await copyFile(join(repoRoot, name), join(stageDir, name)); staged.push(name);\n }\n for (const dir of await workspaceDirs(repoRoot)) {\n await mkdir(join(stageDir, dir), { recursive: true });\n await copyFile(join(repoRoot, dir, \"package.json\"), join(stageDir, dir, \"package.json\")); staged.push(`${dir}/package.json`);\n }\n return staged;\n}\n\n/** The helper's command: networked, writable stage, scripts disabled, nothing else of the host mounted; the repository's npm when it pins one. */\nexport function dependencyInstallArgs(engine: ContainerEngine, image: string, stageDir: string, name: string, npmVersion: string | null = null): string[] {\n if (/[,\\r\\n]/.test(stageDir)) throw new TypeError(\"stage path contains unsupported mount characters\");\n const uid = typeof getuid === \"function\" ? getuid() : 1000; const gid = typeof getgid === \"function\" ? getgid() : 1000;\n const mount = engine === \"container\"\n ? `--mount=type=bind,source=${stageDir},target=/workspace` : `--mount=type=bind,src=${stageDir},dst=/workspace`;\n // engine-strict is the repository's rule for the machine that generates its\n // lockfile (an exact node and npm); the helper installs that lockfile with\n // whatever node the pinned image carries, and npm refused it as\n // \"notsup Required node 24.13.0, Actual v24.18.0\" on the first live run.\n const install = [\"ci\", \"--no-audit\", \"--no-fund\", \"--ignore-scripts\", \"--engine-strict=false\"];\n const npm = npmVersion ? [\"npx\", \"--yes\", `npm@${npmVersion}`, ...install] : [\"npm\", ...install];\n return [\n \"run\", \"--rm\", `--name=${name}`, \"--cap-drop=ALL\", \"--memory=2g\", \"--cpus=2\", `--user=${uid}:${gid}`, \"--tmpfs=/tmp\",\n mount, \"--workdir=/workspace\", \"--env=CI=1\", \"--env=npm_config_cache=/tmp/npm-cache\", \"--env=HOME=/tmp\", image, ...npm,\n ];\n}\n\n/** The lines of an npm failure worth reading: from `npm error code` on, never the usage boilerplate npm ends with. */\nexport function npmFailureSummary(stderr: string): string {\n const lines = stderr.split(\"\\n\").map((line) => line.trim()).filter((line) => line && line !== \"npm error\");\n const at = lines.findIndex((line) => /^npm error code /.test(line));\n return (at >= 0 ? lines.slice(at, at + 3) : lines.slice(-3)).join(\" | \").slice(0, 400);\n}\n\n/** The nested trees an install produced: one per workspace package npm could not hoist into the root. */\nasync function nestedTrees(treeRoot: string, dirs: string[]): Promise<LentDirectory[]> {\n const nested: LentDirectory[] = [];\n for (const dir of dirs) {\n if (await exists(join(treeRoot, dir, \"node_modules\"))) nested.push({ source: join(treeRoot, dir, \"node_modules\"), mountAs: `${dir}/node_modules` });\n }\n return nested;\n}\n\n/** The tree for this repository's lockfile, from the cache or freshly installed; null when there is no lockfile or the install failed. */\nexport async function prepareContainerDependencies(input: DependencyCacheInput): Promise<RecipeDependencies | null> {\n const npmVersion = await pinnedNpmVersion(input.repoRoot);\n const key = await dependencyCacheKey(input.repoRoot, input.image, process.arch, npmVersion);\n if (!key) return null;\n const dir = join(input.cacheRoot, key); const tree = join(dir, \"tree\"); const stage = join(dir, \"stage\"); const runsDir = join(dir, \"runs\");\n // Clones of runs that died with the previous host are garbage: no run is active while a host prepares.\n await rm(runsDir, { recursive: true, force: true });\n const dirs = await workspaceDirs(input.repoRoot);\n const lend = async (): Promise<RecipeDependencies> => ({ source: join(tree, \"node_modules\"), nested: await nestedTrees(tree, dirs), runsDir });\n if (await exists(join(tree, \"node_modules\"))) return lend();\n const run = input.run ?? runContainerCommand;\n await rm(stage, { recursive: true, force: true });\n const staged = await stageManifests(input.repoRoot, stage);\n input.log?.(`installing ${key.slice(0, 12)}: ${staged.length} manifests, npm${npmVersion ? `@${npmVersion}` : \"\"} ci in ${input.image}`);\n const name = `odla-deps-${key.slice(0, 12)}`;\n const result = await run(input.engine, dependencyInstallArgs(input.engine, input.image, stage, name, npmVersion), name,\n { timeoutMs: DEPENDENCY_INSTALL_TIMEOUT_MS, maxOutputBytes: OUTPUT_CAP });\n if (result.exitCode !== 0 || result.timedOut || !(await exists(join(stage, \"node_modules\")))) {\n input.log?.(`install failed (exit ${result.exitCode}${result.timedOut ? \", timed out\" : \"\"}): ${npmFailureSummary(result.stderr)}`);\n await rm(stage, { recursive: true, force: true });\n return null;\n }\n await rm(tree, { recursive: true, force: true });\n await rename(stage, tree);\n await writeFile(join(dir, \"manifest.json\"), JSON.stringify({ image: input.image, key, npmVersion, createdAt: Date.now() }, null, 2));\n const lent = await lend();\n input.log?.(`installed ${key.slice(0, 12)} in ${Math.round(result.durationMs / 1000)}s, ${lent.nested?.length ?? 0} nested tree(s)`);\n return lent;\n}\n","// What a test imports from a sibling package is its build output: npm resolves\n// `@odla-ai/apps` through the workspace link to packages/apps/package.json,\n// whose exports point at dist/. A run's workspace is a source snapshot with\n// none of that in it: the workspace policy skips dist, so it never enters a\n// patch or a digest, and a verification workspace is the Git tree itself, so\n// the generated sources the build writes next to the tracked ones (an\n// `updates.generated.ts`, a tsbuildinfo) are not there either. The first\n// offline proofs to reach that far died on esbuild's \"Could not resolve\n// @odla-ai/apps\" and on \"Cannot find module './updates.generated'\".\n//\n// The host has just built the same commit, so its build output is lent in:\n// each workspace package's dist, and every file Git ignores that the workspace\n// policy does not reserve, each only where the workspace has the package and\n// no copy of its own. A proof that changes a package other packages consume\n// still has to rebuild it, exactly as a developer would.\nimport { spawn } from \"node:child_process\";\nimport { stat } from \"node:fs/promises\";\nimport { join } from \"node:path\";\nimport type { LentDirectory } from \"./code-recipe-dependencies\";\nimport { workspaceDirs } from \"./code-recipe-dependency-cache\";\nimport { allowedWorkspacePath } from \"./workspace-policy\";\n\nfunction gitIgnoredFiles(repoRoot: string): Promise<string[]> {\n return new Promise((accept) => {\n const child = spawn(\"git\", [\"-C\", repoRoot, \"ls-files\", \"--others\", \"--ignored\", \"--exclude-standard\", \"-z\"], { shell: false, stdio: [\"ignore\", \"pipe\", \"ignore\"] });\n const chunks: Buffer[] = [];\n child.stdout.on(\"data\", (chunk: Buffer) => chunks.push(chunk));\n child.once(\"error\", () => accept([]));\n child.once(\"exit\", (code) => accept(code === 0 ? Buffer.concat(chunks).toString(\"utf8\").split(\"\\0\").filter(Boolean) : []));\n });\n}\n\n/** The host checkout's build output to lend into a run's workspace: each package's `dist`, then every ignored file the policy allows. */\nexport async function hostBuildProducts(repoRoot: string): Promise<LentDirectory[]> {\n const dirs = await workspaceDirs(repoRoot);\n const within = (path: string): string => dirs.find((dir) => path.startsWith(`${dir}/`)) ?? \".\";\n const products: LentDirectory[] = [];\n for (const dir of dirs) {\n const source = join(repoRoot, dir, \"dist\");\n if ((await stat(source).catch(() => null))?.isDirectory()) products.push({ source, mountAs: `${dir}/dist`, within: dir });\n }\n for (const path of await gitIgnoredFiles(repoRoot)) {\n if (allowedWorkspacePath(path)) products.push({ source: join(repoRoot, path), mountAs: path, within: within(path) });\n }\n return products;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,eAAe,WAAW,QAAwC;AAChE,QAAM,SAAS,GAAG,OAAO,OAAO,IAAI,OAAO,IAAI,IAAI,OAAO,IAAI;AAC9D,QAAM,QAAQ,MAAM,OAAO,OAAO,OAAO,WAAW,IAAI,YAAY,EAAE,OAAO,MAAM,CAAC;AACpF,SAAO,MAAM,KAAK,IAAI,WAAW,KAAK,GAAG,CAAC,SAAS,KAAK,SAAS,EAAE,EAAE,SAAS,GAAG,GAAG,CAAC,EAClF,KAAK,EAAE,EAAE,MAAM,GAAG,EAAE;AACzB;AAUO,SAAS,mBACd,SAAuC,WACf;AACxB,QAAM,SAAS,QAAQ;AACvB,QAAM,WAAW,QAAQ;AACzB,MAAI,CAAC,UAAU,CAAC,SAAU,QAAO;AACjC,SAAO;AAAA,IACL,QA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