Skip to content

Commit 135b49f

Browse files
refactor: hide legacy analysis behind internal surfaces
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
1 parent c008918 commit 135b49f

File tree

4 files changed

+16
-10
lines changed

4 files changed

+16
-10
lines changed

scripts/docker/scientific-task-smoke.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,20 @@ import {
66
experiment_init,
77
experiment_plan_or_resume,
88
experiment_prepare_sandbox,
9-
experiment_run_analysis,
109
experiment_run_governed_workflow,
1110
experiment_status,
1211
experiment_validate_spec,
1312
} from "../../src/tools";
14-
import { pathExists, readJsonl } from "../../src/utils/fs";
13+
import { aggregateProposals } from "../../src/analysis/aggregator";
14+
import { resultPacketSchema } from "../../src/analysis/result-packet";
15+
import { runTriModelAnalysis } from "../../src/analysis/tri-model";
16+
import { pathExists, readJson, readJsonl } from "../../src/utils/fs";
1517
import {
1618
getCompatGoalPath,
1719
getBestPath,
1820
getOrchestrationSummaryPath,
1921
getOrchestrationTracePath,
22+
getResultPacketPath,
2023
getProposalCardsPath,
2124
getRunsPath,
2225
getSessionPath,
@@ -92,7 +95,8 @@ async function main() {
9295
);
9396
const planned = JSON.parse(await experiment_plan_or_resume.execute({ workspace_root: workspaceRoot }));
9497
const workflow = JSON.parse(await experiment_run_governed_workflow.execute({ workspace_root: workspaceRoot }));
95-
const analysis = JSON.parse(await experiment_run_analysis.execute({ workspace_root: workspaceRoot }));
98+
const packet = resultPacketSchema.parse(await readJson(getResultPacketPath(workspaceRoot), null));
99+
const analysis = aggregateProposals(runTriModelAnalysis(packet));
96100
const status = JSON.parse(await experiment_status.execute({ workspace_root: workspaceRoot }));
97101
const acceptance = JSON.parse(await experiment_acceptance_review.execute({ workspace_root: workspaceRoot }));
98102

src/agents/sisyphus-experiment-orchestrator.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ Output contract:
5353
experiment_decide_iteration: true,
5454
experiment_status: true,
5555
experiment_acceptance_review: true,
56-
experiment_run_analysis: true,
5756
experiment_controller_bootstrap: true,
5857
experiment_controller_start: true,
5958
experiment_controller_tick: true,

src/tools/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ export const experiment_acceptance_review: ToolDefinition = tool({
200200
});
201201

202202
export const experiment_run_analysis: ToolDefinition = tool({
203-
description: "Run legacy tri-model placeholder analysis for the current result packet and persist compatibility proposal cards.",
203+
description: "Internal/test-only legacy tri-model placeholder analysis for the current result packet.",
204204
args: {
205205
workspace_root: tool.schema.string().optional(),
206206
},
@@ -436,7 +436,6 @@ export function createExperimentTools(runtime?: PluginInput): Record<string, Too
436436
experiment_decide_iteration,
437437
experiment_status,
438438
experiment_acceptance_review,
439-
experiment_run_analysis,
440439
experiment_controller_apply_mutation,
441440
experiment_controller_bootstrap,
442441
experiment_controller_start,

tests/e2e/e2e.test.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@ import fs from "node:fs/promises";
22
import os from "node:os";
33
import path from "node:path";
44
import { afterEach, describe, expect, it } from "vitest";
5-
import { experiment_execute_iteration, experiment_init, experiment_run_analysis, experiment_run_governed_workflow, experiment_status } from "../../src/tools";
6-
import { readJsonl } from "../../src/utils/fs";
7-
import { getOrchestrationTracePath, getRecoveryCheckpointPath } from "../../src/utils/paths";
5+
import { aggregateProposals } from "../../src/analysis/aggregator";
6+
import { resultPacketSchema } from "../../src/analysis/result-packet";
7+
import { runTriModelAnalysis } from "../../src/analysis/tri-model";
8+
import { experiment_execute_iteration, experiment_init, experiment_run_governed_workflow, experiment_status } from "../../src/tools";
9+
import { readJson, readJsonl } from "../../src/utils/fs";
10+
import { getOrchestrationTracePath, getRecoveryCheckpointPath, getResultPacketPath } from "../../src/utils/paths";
811

912
const tempDirs: string[] = [];
1013

@@ -49,7 +52,8 @@ describe("local e2e", () => {
4952
params: { key: "learning_rate", value: 0.9 },
5053
},
5154
});
52-
const analysis = JSON.parse(await experiment_run_analysis.execute({ workspace_root: workspace }));
55+
const packet = resultPacketSchema.parse(await readJson(getResultPacketPath(workspace), null));
56+
const analysis = aggregateProposals(runTriModelAnalysis(packet));
5357
await fs.mkdir(path.dirname(getRecoveryCheckpointPath(workspace)), { recursive: true });
5458
await fs.writeFile(
5559
getRecoveryCheckpointPath(workspace),

0 commit comments

Comments
 (0)