Generating hypothesis
Nemotron is searching for a distinct, executable repair strategy.
Nemotron is searching for a distinct, executable repair strategy.
${escapeHtml(candidate.thesis)}
${paintDiff(winner.diff)}`;
$("#evidence").hidden = false;
$("#run-button").disabled = false;
$("#run-button .button-copy b").textContent = "Forge again";
window.setTimeout(() => $("#evidence").scrollIntoView({ behavior: "smooth", block: "start" }), 220);
}
async function pollRun() {
try {
const record = await api(`/api/runs/${state.runId}`);
state.lastRecord = record;
if (record.status === "failed") {
throw new Error(record.error || "The experiment stopped safely.");
}
updateStages(record.status);
runningCards(record.status);
const message = record.events.at(-1)?.message || "Working";
$("#run-status").innerHTML = ` ${escapeHtml(message)}`;
if (record.branches.length) $("#branch-grid").innerHTML = record.branches.map(renderBranch).join("");
if (record.status === "complete") {
const elapsed = Date.now() - state.startedAt;
const minimumShowcaseMs = 2400;
window.clearInterval(state.poller);
window.setTimeout(() => renderComplete(record), Math.max(0, minimumShowcaseMs - elapsed));
}
} catch (error) {
window.clearInterval(state.poller);
$("#run-button").disabled = false;
$("#run-status").classList.remove("running");
$("#run-status").innerHTML = ` Run stopped safely`;
toast(error.message);
}
}
async function startRun() {
const issue = $("#issue").value.trim();
if (issue.length < 12) return toast("Add a more specific issue brief.");
$("#run-button").disabled = true;
$("#run-button .button-copy b").textContent = "Forging evidence…";
resetRunUi();
$("#run-section").scrollIntoView({ behavior: "smooth", block: "start" });
state.startedAt = Date.now();
try {
const record = await api("/api/runs", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ repository: $("#repository").value.trim(), issue, mode: "sample" })
});
state.runId = record.id;
state.poller = window.setInterval(pollRun, 420);
await pollRun();
} catch (error) {
$("#run-button").disabled = false;
toast(error.message);
}
}
$("#run-button").addEventListener("click", startRun);
$("#copy-patch").addEventListener("click", async () => {
const winner = state.lastRecord?.branches.find((branch) => branch.candidate.id === state.lastRecord.winner_id);
if (!winner) return;
await navigator.clipboard.writeText(winner.diff);
toast("Verified diff copied.");
});
boot();