Home: sign the brief save on Replace too (Codex polish)

Codex spotted the one remaining unsigned BRIEF_VIEW_KEY write — in replaceArticle.
Not a safety issue (instant-paint requires cached.sig, so an unsigned entry just
won't instant-paint), but it meant the next load after a Replace fell back to
"Gathering…" until a fresh /api/brief re-saved the signed version. Now every
brief save includes sig: briefSig() (computed after dismissed updates), so an
edited brief still instant-paints. All three save paths verified signed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
jay
2026-06-12 09:58:42 -04:00
parent 456b1a0547
commit 7ffcc0be30
+3 -1
View File
@@ -424,7 +424,9 @@
if (i >= 0) {
brief.items[i] = repl;
brief = { ...brief, items: [...brief.items] };
P.saveJSON(BRIEF_VIEW_KEY, { generated_at: brief.generated_at, items: brief.items });
// Sign the save (dismissed just changed) so the next load can still
// instant-paint this edited brief instead of falling back to "Gathering…".
P.saveJSON(BRIEF_VIEW_KEY, { generated_at: brief.generated_at, items: brief.items, sig: briefSig() });
}
} else {
const i = feed.findIndex((a) => a.id === article.id);