[object Object]

← back to Ventura Corridor

iter 174: fix /api/magazine/:id/regen — no longer demotes published→draft (was un-publishing curated features); also bake template-blocks into regen prompt for parity w/ gen

02da0a2fa0e5d538a6f9f146721fcaab684c3eea · 2026-05-06 20:25:15 -0700 · SteveStudio2

Files touched

Diff

commit 02da0a2fa0e5d538a6f9f146721fcaab684c3eea
Author: SteveStudio2 <stevestudio2@SteveStacStudio.lan>
Date:   Wed May 6 20:25:15 2026 -0700

    iter 174: fix /api/magazine/:id/regen — no longer demotes published→draft (was un-publishing curated features); also bake template-blocks into regen prompt for parity w/ gen
---
 src/server/index.ts | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/server/index.ts b/src/server/index.ts
index 4d430a9..9b7616f 100644
--- a/src/server/index.ts
+++ b/src/server/index.ts
@@ -2659,6 +2659,13 @@ Rules:
 - Never invent specific prices, opening dates, owner names, or claims you can't verify.
 - Lean on the address as a sense of place ("just east of Sepulveda" / "in the white-stone tower at 15821 Ventura").
 - Avoid superlatives ("the BEST"). Prefer concrete sensory details.
+- HEADLINE VARIETY: Do NOT use these overused templates:
+  • "X in Y's Heart" / "X in Y's Vibrant Heart" / "X in Y's Heartbeat"
+  • "X Meets Y" / "Where X Meets Y"
+  • "X Rooted in Y"
+  • "Precision Care in..." / "Legal Precision..." / "Legal Expertise..."
+  • "Steady Counsel" / "Timeless Elegance"
+  Find a fresher angle: a sensory detail, a verb-led opening, a contrast, a small specific noun.
 - Output ONLY the JSON. No preamble, no markdown fences.`;
     const userPrompt = `Business: ${biz.name}
 Address: ${biz.address || 'unknown'}, ${biz.city || ''} ${biz.zip || ''}
@@ -2688,10 +2695,12 @@ Write the feature.`;
     try { feat = JSON.parse(raw); }
     catch { return res.status(502).json({ error: 'bad JSON from model', sample: raw.slice(0, 200) }); }
 
+    // Preserve curation state — if already published or reviewed, regen keeps that status.
+    // Only fresh drafts revert to 'draft'. This protects the front-page from auto-dedupe demotion.
     await query(
       `UPDATE magazine_features SET
          headline=$1, subhead=$2, editorial=$3, pull_quote=$4, category_tag=$5,
-         model=$6, generated_at=NOW(), status='draft'
+         model=$6, generated_at=NOW()
        WHERE id=$7`,
       [feat.headline, feat.subhead, feat.editorial, feat.pull_quote, feat.category_tag, MODEL, id]
     );

← 88857c9 iter 173: auto-dedupe now also catches trigram-templated hea  ·  back to Ventura Corridor  ·  iter 175: SESSION_LOG addendum — captures iters 171-175 + th 5d90ce1 →