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
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
fix(issue-728): leave unfilled import steps pending instead of Ready
[._.]/ Adam Eivyddabecede526
diff --git a/server/services/storyBuilder.js b/server/services/storyBuilder.jsindex e4893aec5c..31b64ad8b6 100644--- a/server/services/storyBuilder.js+++ b/server/services/storyBuilder.js@@ -67,6 +67,16 @@ export const TITLE_MAX = 200;export const SEED_MAX = 4000;export const INTAKE_MODES = Object.freeze(['seed', 'import']);+// Steps the importer actually pre-fills, so they open "ready" for review on an+// import-mode session. `idea` (universe + series exist), `plotArc` (arc ++// seasons), `characters` (extracted canon), and `issues` (the issue split) are+// populated by `analyzeImport` → `commitImport`. Steps NOT listed here —+// `universeAesthetic` (logline/premise/styleNotes/influences are never written+// on import), `readerMap` (no reader-map extraction pass), and `production`+// (the downstream render step) — fall through to the default "pending" status+// so they don't show an empty step under a misleading "Ready" badge (#728).+export const IMPORT_READY_STEPS = Object.freeze(['idea', 'plotArc', 'characters', 'issues']);+// The universe aesthetic step freezes these universe lock keys.export const AESTHETIC_LOCK_FIELDS = Object.freeze(['logline', 'premise', 'styleNotes', 'influencesEmbrace', 'influencesAvoid',@@ -214,9 +224,19 @@ export async function createStorySession(input = {}) {llm: input.llm || null,createdAt: now,updatedAt: now,- // Import mode pre-fills content before review — mark every step "ready" so- // the user walks through reviewing + locking each, rather than generating.- ...(intakeMode === 'import' ? { steps: Object.fromEntries(STEP_IDS.map((id) => [id, { status: 'ready' }])) } : {}),+ // Import mode pre-fills SOME content before review — mark only the steps the+ // importer actually populates "ready" so the user reviews + locks those. The+ // importer (`analyzeImport` → `commitImport`) fills: the idea (universe ++ // series exist), the plot arc + seasons, the cast (canon characters), and the+ // issue split. It does NOT extract a universe aesthetic+ // (logline/premise/styleNotes/influences are never written) nor a reader map,+ // and production is the downstream render step. Those start "pending" so the+ // user generates them — leaving them "ready" showed an empty step under a+ // misleading "Ready" badge (issue #728). The default-pending fall-through in+ // sanitizeSteps covers every step omitted here.+ ...(intakeMode === 'import'+ ? { steps: Object.fromEntries(IMPORT_READY_STEPS.map((id) => [id, { status: 'ready' }])) }+ : {}),});await store().saveOne(created.id, created);return created;diff --git a/server/services/storyBuilder.test.js b/server/services/storyBuilder.test.jsindex f797ea5deb..9c3957748a 100644--- a/server/services/storyBuilder.test.js+++ b/server/services/storyBuilder.test.js@@ -57,7 +57,7 @@ describe('storyBuilder — CRUD', () => {expect(series.premise).toBe('a foundry city goes silent');});- it('import mode does not mint shells and marks all steps ready', async () => {+ it('import mode does not mint shells and marks only importer-filled steps ready', async () => {const universe = await universeSvc.createUniverse({ name: 'U' });const series = await seriesSvc.createSeries({ name: 'S', universeId: universe.id });const s = await sb.createStorySession({@@ -65,8 +65,17 @@ describe('storyBuilder — CRUD', () => {});expect(s.universeId).toBe(universe.id);expect(s.seriesId).toBe(series.id);- expect(s.steps.idea.status).toBe('ready');- expect(s.steps.readerMap.status).toBe('ready');+ // Steps the importer populates open "ready" for review.+ for (const id of sb.IMPORT_READY_STEPS) {+ expect(s.steps[id].status).toBe('ready');+ }+ expect(sb.IMPORT_READY_STEPS).toEqual(['idea', 'plotArc', 'characters', 'issues']);+ // The importer never extracts an aesthetic or a reader map, and production+ // is the downstream render step — they must stay pending, not show empty+ // content under a misleading "Ready" badge (#728).+ expect(s.steps.universeAesthetic.status).toBe('pending');+ expect(s.steps.readerMap.status).toBe('pending');+ expect(s.steps.production.status).toBe('pending');});it('rejects a blank title', async () => {