Skip to content

Commit c008918

Browse files
fix: finalize v4 remediation closure
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
1 parent ed5d1a9 commit c008918

File tree

18 files changed

+60
-39
lines changed

18 files changed

+60
-39
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"run_id": "run-crash",
3+
"checkpoint_path": "checkpoints/latest.ckpt",
4+
"parent_run_id": "run-parent"
5+
}

scripts/docker/scientific-task-smoke.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ import {
1313
} from "../../src/tools";
1414
import { pathExists, readJsonl } from "../../src/utils/fs";
1515
import {
16-
getCompatAttemptsPath,
17-
getCompatBestPath,
1816
getCompatGoalPath,
19-
getCompatProposalCardsPath,
20-
getCompatSessionPath,
17+
getBestPath,
2118
getOrchestrationSummaryPath,
2219
getOrchestrationTracePath,
20+
getProposalCardsPath,
21+
getRunsPath,
22+
getSessionPath,
2323
} from "../../src/utils/paths";
2424

2525
async function writeToyResearchWorkspace(workspaceRoot: string): Promise<void> {
@@ -97,13 +97,13 @@ async function main() {
9797
const acceptance = JSON.parse(await experiment_acceptance_review.execute({ workspace_root: workspaceRoot }));
9898

9999
const trace = await readJsonl<{ actor: string }>(getOrchestrationTracePath(workspaceRoot));
100-
const attempts = await readJsonl<{ run_id: string; current_metric: number; status: string }>(getCompatAttemptsPath(workspaceRoot));
101-
const proposalCards = await readJsonl(getCompatProposalCardsPath(workspaceRoot));
100+
const attempts = await readJsonl<{ run_id: string; current_metric: number; status: string }>(getRunsPath(workspaceRoot));
101+
const proposalCards = await readJsonl(getProposalCardsPath(workspaceRoot));
102102

103103
const artifactPresence = {
104104
compat_goal: await pathExists(getCompatGoalPath(workspaceRoot)),
105-
compat_session: await pathExists(getCompatSessionPath(workspaceRoot)),
106-
compat_best: await pathExists(getCompatBestPath(workspaceRoot)),
105+
session: await pathExists(getSessionPath(workspaceRoot)),
106+
best: await pathExists(getBestPath(workspaceRoot)),
107107
orchestration_summary: await pathExists(getOrchestrationSummaryPath(workspaceRoot)),
108108
};
109109

@@ -125,7 +125,7 @@ async function main() {
125125
throw new Error(`missing orchestration actor: ${expectedActor}`);
126126
}
127127
}
128-
if (!artifactPresence.compat_goal || !artifactPresence.compat_session || !artifactPresence.compat_best || !artifactPresence.orchestration_summary) {
128+
if (!artifactPresence.compat_goal || !artifactPresence.session || !artifactPresence.best || !artifactPresence.orchestration_summary) {
129129
throw new Error(`artifact presence check failed: ${JSON.stringify(artifactPresence)}`);
130130
}
131131

scripts/kb/run_inference_cycle.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,6 @@ def main() -> None:
3939
best = workspace_root / "experiments" / "best.json"
4040
attempts = workspace_root / "experiments" / "attempts.jsonl"
4141
result_packet = workspace_root / "experiments" / "result_packet.json"
42-
if not result_packet.exists():
43-
fallback_result_packet = workspace_root / "experiments" / "result-packet.json"
44-
result_packet = (
45-
fallback_result_packet if fallback_result_packet.exists() else result_packet
46-
)
4742
if not (session.exists() and best.exists() and attempts.exists()):
4843
emit_json(
4944
{

scripts/run_candidate.py

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
run_dir,
2222
run_stage,
2323
restore_parent_snapshot,
24+
read_json,
2425
save_parent_snapshot,
2526
save_run_manifest,
2627
save_pending_result,
@@ -144,6 +145,23 @@ def main() -> None:
144145
"parent_run_id": current_best_exp_ref(workspace) or "baseline",
145146
},
146147
)
148+
parent_snapshot = read_json(
149+
workspace / "experiments" / "runs" / run_id / "parent_snapshot.json", {}
150+
)
151+
created_files = [
152+
relative
153+
for relative, entry in parent_snapshot.items()
154+
if isinstance(entry, dict)
155+
and not entry.get("exists", False)
156+
and (workspace / relative).exists()
157+
]
158+
deleted_files = [
159+
relative
160+
for relative, entry in parent_snapshot.items()
161+
if isinstance(entry, dict)
162+
and entry.get("exists", False)
163+
and not (workspace / relative).exists()
164+
]
147165
save_run_manifest(
148166
workspace,
149167
run_id,
@@ -152,8 +170,8 @@ def main() -> None:
152170
"proposal_id": mutation.get("proposal_id"),
153171
"family": mutation.get("family"),
154172
"touched_files": touched_files,
155-
"created_files": [],
156-
"deleted_files": [],
173+
"created_files": created_files,
174+
"deleted_files": deleted_files,
157175
"checkpoint_path": str(checkpoint),
158176
"dvc_exp_ref": run_id,
159177
"resume_from": args.resume_from,

src/agents/prometheus-bootstrap-planner.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
export const prometheusBootstrapPlannerAgent = {
22
mode: "primary",
3-
model: "openai/gpt-5.4",
43
color: "#FF5722",
54
description: "Prometheus override used only for bootstrap and review-blocked replanning.",
65
permission: {

src/agents/sisyphus-experiment-orchestrator.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
export const sisyphusExperimentOrchestratorAgent = {
22
mode: "primary",
3-
model: "openai/gpt-5.4",
43
color: "#00CED1",
54
description: "Sisyphus override for the fixed experiment loop orchestrator.",
65
permission: {

src/experiment/session.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import type { infer as ZodInfer } from "zod";
2-
import { syncSessionArtifact } from "../compat/artifacts";
32
import { controllerSessionSchema } from "../controller/schema";
43
import { readJson, writeJson } from "../utils/fs";
54
import { createId } from "../utils/ids";
@@ -41,5 +40,4 @@ export async function loadSession(workspaceRoot: string): Promise<ExperimentSess
4140
export async function saveSession(workspaceRoot: string, session: ExperimentSession): Promise<void> {
4241
const parsed = experimentSessionSchema.parse(session);
4342
await writeJson(getSessionPath(workspaceRoot), parsed);
44-
await syncSessionArtifact(workspaceRoot, parsed);
4543
}

src/loop/execute-iteration.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { syncAttemptArtifact, syncBestArtifact, syncRunEventArtifact } from "../compat/artifacts";
21
import { appendJsonl, writeJson } from "../utils/fs";
32
import { getBestPath, getResultPacketPath, getRunEventsPath, getRunsPath } from "../utils/paths";
43
import { nowIso } from "../utils/time";
@@ -36,7 +35,6 @@ async function writeRunEvent(
3635
payload,
3736
};
3837
await appendJsonl(getRunEventsPath(workspaceRoot, runId), event);
39-
await syncRunEventArtifact(workspaceRoot, runId, event);
4038
}
4139

4240
export async function executeIteration(input: {
@@ -97,7 +95,6 @@ export async function executeIteration(input: {
9795
status: decision.status,
9896
};
9997
await appendJsonl(getRunsPath(input.workspaceRoot), record);
100-
await syncAttemptArtifact(input.workspaceRoot, record);
10198
if (decision.status === "keep") {
10299
const best = {
103100
current_best: { run_id: runId, metric: currentMetric, commit: "local", checkpoint: null },
@@ -106,7 +103,6 @@ export async function executeIteration(input: {
106103
updated_at: nowIso(),
107104
};
108105
await writeJson(getBestPath(input.workspaceRoot), best);
109-
await syncBestArtifact(input.workspaceRoot, best);
110106
}
111107
return {
112108
run_id: runId,

src/recovery/resume.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import path from "node:path";
21
import { readJson, writeJson } from "../utils/fs";
32
import { getRecoveryCheckpointPath } from "../utils/paths";
43

@@ -13,10 +12,7 @@ export async function saveRecoveryCheckpoint(workspaceRoot: string, checkpoint:
1312
}
1413

1514
export async function resumeExperiment(workspaceRoot: string): Promise<{ resumed: boolean; source: string | null }> {
16-
let checkpoint = await readJson<RecoveryCheckpoint | null>(getRecoveryCheckpointPath(workspaceRoot), null);
17-
if (!checkpoint) {
18-
checkpoint = await readJson<RecoveryCheckpoint | null>(path.join(workspaceRoot, ".opencode", "auto-experiment", "recovery-checkpoint.json"), null);
19-
}
15+
const checkpoint = await readJson<RecoveryCheckpoint | null>(getRecoveryCheckpointPath(workspaceRoot), null);
2016
if (!checkpoint) {
2117
return { resumed: false, source: null };
2218
}

0 commit comments

Comments
 (0)