Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

refactor: address codex review findings

[._.]/ Adam Eivy8912fd4f884c
diff --git a/client/src/lib/universeStylePreset.js b/client/src/lib/universeStylePreset.js
index 4e2e98a73d..1b9c873fa9 100644
--- a/client/src/lib/universeStylePreset.js
+++ b/client/src/lib/universeStylePreset.js
@@ -9,11 +9,22 @@ import { joinInfluenceList } from './joinInfluenceList';
// override when only the series has style content (orphan or failed load), so
// the client must do the same. `series` is optional; when omitted the result
// is the universe-only preset (Universe Builder canon section).
+//
+// `series.stylePromptOverrideMode` (when present) controls composition:
+// 'prepend' (default) — override leads, universe embrace trails
+// 'append' — universe embrace leads, override trails
+// 'override' — drop the universe embrace tokens entirely
+// Avoid (negative) tokens always come from the universe; the mode only
+// composes the positive embrace clause.
export const universeStylePreset = (universe, series = null) => {
const override = (series?.stylePromptOverride || '').trim();
- const embrace = universe ? joinInfluenceList(universe.influences?.embrace) : '';
+ const mode = series?.stylePromptOverrideMode || 'prepend';
+ const embrace = universe && (mode !== 'override' || !override)
+ ? joinInfluenceList(universe.influences?.embrace)
+ : '';
const avoid = universe ? joinInfluenceList(universe.influences?.avoid) : '';
- const prompt = [override, embrace].filter(Boolean).join('. ');
+ const positiveParts = mode === 'append' ? [embrace, override] : [override, embrace];
+ const prompt = positiveParts.filter(Boolean).join('. ');
if (!prompt && !avoid) return null;
return { prompt, negativePrompt: avoid };
};
diff --git a/client/src/pages/PipelineSeries.jsx b/client/src/pages/PipelineSeries.jsx
index 596fa74f65..8100377c01 100644
--- a/client/src/pages/PipelineSeries.jsx
+++ b/client/src/pages/PipelineSeries.jsx
@@ -363,6 +363,10 @@ function BibleSidebar({ series, universes, patchSeries, onSeriesUpdate, onFlushP
onChange={(e) => patchSeries({ universeId: e.target.value })}
className="flex-1 px-3 py-2 bg-port-bg border border-port-border rounded text-white"
>
+ {/* Legacy / imported series may still carry `universeId: null` —
+ offer a sentinel option so the picker doesn't auto-snap them
+ to whatever the first universe in the list happens to be. */}
+ {!series.universeId ? <option value="">— Pick a universe —</option> : null}
{universes.map((w) => <option key={w.id} value={w.id}>{w.name}</option>)}
</select>
<Link
@@ -403,15 +407,22 @@ function BibleSidebar({ series, universes, patchSeries, onSeriesUpdate, onFlushP
<div>
<h3 className="text-xs uppercase tracking-wider text-gray-500 mb-2">Canon</h3>
- {/* `#canon` scrolls to the embedded canon section (id="canon" on
- UniverseCanonSection) so users land on the folded-in canon UI
- instead of the bible at the top of the builder. */}
- <Link
- to={`/universe-builder/${encodeURIComponent(series.universeId)}#canon`}
- className="block text-xs text-port-accent hover:underline"
- >
- Manage characters, places, and objects on the linked Universe →
- </Link>
+ {series.universeId ? (
+ // `#canon` scrolls to the embedded canon section (id="canon" on
+ // UniverseCanonSection) so users land on the folded-in canon UI
+ // instead of the bible at the top of the builder.
+ <Link
+ to={`/universe-builder/${encodeURIComponent(series.universeId)}#canon`}
+ className="block text-xs text-port-accent hover:underline"
+ >
+ Manage characters, places, and objects on the linked Universe →
+ </Link>
+ ) : (
+ <p className="text-xs text-gray-600 italic">
+ Link a universe above to author characters, places, and objects shared
+ across this series' issues.
+ </p>
+ )}
</div>
</section>
);