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

address review (codex): include slugline-only places in the generate prompt context

[._.]/ Adam Eivy6e9f072462c8
diff --git a/server/services/pipeline/seriesGenerate.js b/server/services/pipeline/seriesGenerate.js
index 0657a53d1a..780955497a 100644
--- a/server/services/pipeline/seriesGenerate.js
+++ b/server/services/pipeline/seriesGenerate.js
@@ -25,17 +25,20 @@ const CANON_LIST_MAX = 24; // cap per canon kind in the brief — keeps the prom
const EXISTING_SERIES_MAX = 30;
// Render a universe canon list (characters / places / objects) as a compact
-// "Name — role; Name — role" string the LLM can scan. Empty / nameless entries
-// drop out; an empty (or all-nameless) list becomes an explicit "(none)" so the
-// prompt never renders a dangling label.
+// "Name — role; Name — role" string the LLM can scan. Entries with no
+// identifier drop out; an empty (or all-unidentified) list becomes an explicit
+// "(none)" so the prompt never renders a dangling label.
function renderCanonList(entries) {
const rendered = (Array.isArray(entries) ? entries : [])
.slice(0, CANON_LIST_MAX)
.map((e) => {
- const name = (e?.name || '').trim();
- if (!name) return null;
+ // Places may carry only a `slugline` and no `name` — the bible sanitizer
+ // accepts either as the identifier (storyBible.js), so fall back to it.
+ // Characters/objects always have a name, so the fallback is a no-op there.
+ const label = (e?.name || e?.slugline || '').trim();
+ if (!label) return null;
const role = (e?.role || '').trim();
- return role ? `${name} — ${role}` : name;
+ return role ? `${label} — ${role}` : label;
})
.filter(Boolean)
.join('; ');
diff --git a/server/services/pipeline/seriesGenerate.test.js b/server/services/pipeline/seriesGenerate.test.js
index bae931c21c..202f5a78ce 100644
--- a/server/services/pipeline/seriesGenerate.test.js
+++ b/server/services/pipeline/seriesGenerate.test.js
@@ -103,6 +103,18 @@ describe('generateSeriesConcept', () => {
});
});
+ it('renders slugline-only places (no name) into the canon context', async () => {
+ getUniverse.mockResolvedValue({
+ ...baseUniverse,
+ places: [{ slugline: 'INT. FOUNDRY — NIGHT' }, { name: 'The Docks', role: 'port' }],
+ });
+ mockLLM({ name: 'X', logline: 'l', premise: 'p', shape: 'tragedy' });
+ await generateSeriesConcept('uni-1');
+ const call = runPromptRefineRaw.mock.calls[0][0];
+ expect(call.variables.places).toContain('INT. FOUNDRY — NIGHT');
+ expect(call.variables.places).toContain('The Docks — port');
+ });
+
it('maps a missing universe to a 404 (not a 500)', async () => {
getUniverse.mockRejectedValue(Object.assign(new Error('Universe not found: uni-x'), { code: 'NOT_FOUND' }));
await expect(generateSeriesConcept('uni-x')).rejects.toMatchObject({
@@ -131,6 +143,7 @@ describe('generateSeriesConcept', () => {
expect(call.templateName).toBe('pipeline-series-generate');
expect(call.variables.universe.name).toBe('Saltworks');
expect(call.variables.characters).toContain('Ash — survivor');
+ expect(call.variables.places).toContain('The Foundry');
// Only the same-universe series is listed; the other-universe one is excluded.
expect(call.variables.existingSeries).toContain('First Tale');
expect(call.variables.existingSeries).not.toContain('Elsewhere');