fix: allow repeated platform checks and unify Alpha metric formatting
Deploy production / deploy (push) Successful in 54s

This commit is contained in:
yuxuanhui
2026-09-12 22:42:37 +08:00
parent c18960946b
commit f3eb239e1a
8 changed files with 196 additions and 17 deletions
+26 -14
View File
@@ -34,6 +34,7 @@ export function SubmissionPanel({
const [busy, setBusy] = useState("");
const [error, setError] = useState("");
const dirty = useRef(false);
const submittedJob = useRef<string | null>(null);
const mounted = useRef(true);
useEffect(() => {
mounted.current = true;
@@ -47,6 +48,16 @@ export function SubmissionPanel({
.then((value) => {
if (!active) return;
setData(value);
// Rebase only our completed writeback and its exact resulting snapshot.
// A different expression/settings/description must still require review.
if (
value.job?.id === submittedJob.current &&
value.job?.status === "completed" &&
value.job.checkpoint.review_snapshot === value.snapshot
) {
setSnapshot(value.snapshot);
submittedJob.current = null;
}
if (!dirty.current) {
setDraft(value.descriptions);
setSnapshot(value.snapshot);
@@ -89,6 +100,7 @@ export function SubmissionPanel({
if (!mounted.current) return;
// Keep the reviewed draft visible while the durable task runs.
dirty.current = true;
submittedJob.current = job.id;
setData((current) => (current ? { ...current, job } : current));
onTask();
} catch (e) {
@@ -105,14 +117,14 @@ export function SubmissionPanel({
<div className="detail-section">
<h3>Description 与提交检查</h3>
<p className="muted">
AI 一次生成完整 Description,可在下方统一修改。写回并检查会更新 BRAIN 的
AI 一次生成完整 Description,可在下方统一修改。平台检查会更新 BRAIN 的
Description,随后获取平台提交检查结果,不会正式提交 Alpha。
</p>
{error && <Banner type="danger" description={error} />}
{!data.can_check && (
<Banner
type="info"
description="写回并检查需要待提交 Alpha。有本地比较基准时,需取得有效、完整且低于阈值的自相关结果;没有本地基准时可直接继续平台检查。"
description="平台检查需要待提交 Alpha。有本地比较基准时,需取得有效、完整且低于阈值的自相关结果;没有本地基准时可直接继续平台检查。"
/>
)}
{!data.can_generate && (
@@ -121,6 +133,17 @@ export function SubmissionPanel({
</p>
)}
<div className="inline-actions">
<Button
disabled={!!busy || running}
onClick={() => {
dirty.current = false;
setDraft(data.descriptions);
setSnapshot(data.snapshot);
setError("");
}}
>
载入最新描述
</Button>
<Button
onClick={() => void generate()}
loading={busy === "generate"}
@@ -181,18 +204,7 @@ export function SubmissionPanel({
disabled={!!busy || running || conflict || !data.can_check}
onClick={() => void check()}
>
写回 Description 并检查
</Button>
<Button
disabled={!!busy || running}
onClick={() => {
dirty.current = false;
setDraft(data.descriptions);
setSnapshot(data.snapshot);
setError("");
}}
>
载入最新描述
平台检查
</Button>
</div>
{data.job && (