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

docs([importer-screenplay-teleplay-seed]): refresh seed-stage comments for screenplay→teleplay

[._.]/ Adam Eivyf65cf61ba99a
diff --git a/server/lib/validation.js b/server/lib/validation.js
index cdef4d1cc5..d3dbadb571 100644
--- a/server/lib/validation.js
+++ b/server/lib/validation.js
@@ -1692,7 +1692,8 @@ export const IMPORTER_CONTENT_TYPES = Object.freeze([
// active provider's context window.
const importerSourceField = z.string().min(1).max(5_000_000);
-// Per-issue verbatim-excerpt ceiling (seeds stages.prose / stages.comicScript).
+// Per-issue verbatim-excerpt ceiling (seeds stages.prose / stages.comicScript /
+// stages.teleplay).
// MUST stay ≤ `STAGE_OUTPUT_MAX` in server/services/pipeline/issues.js (400_000)
// — createIssue trims stage output to that, so a larger excerpt would be
// SILENTLY TRUNCATED on commit despite the import being advertised as verbatim.
@@ -1817,11 +1818,12 @@ export const importerCommitSchema = z.object({
arc: importerArcShape.nullable().optional(),
seasons: z.array(importerSeasonEntry).max(50).default([]),
issues: z.array(importerIssueEntry).min(1).max(50),
- // Drives which stage each issue's verbatim excerpt seeds: a `comic-script`
- // import is already script-form, so its excerpt seeds `stages.comicScript`
- // (ready) and the pipeline never regenerates — every other type seeds
- // `stages.prose`. Optional + defaulting to prose-seed keeps older clients
- // (which don't send it) on the prior behavior.
+ // Drives which stage each issue's verbatim excerpt seeds: a script-form
+ // import seeds its matching script stage (ready) and the pipeline never
+ // regenerates — `comic-script` → `stages.comicScript`, `screenplay` →
+ // `stages.teleplay`; prose-like types seed `stages.prose`. Optional +
+ // defaulting to prose-seed keeps older clients (which don't send it) on the
+ // prior behavior.
contentType: z.enum(IMPORTER_CONTENT_TYPES).optional(),
// Replace-mode flag — when true, every existing issue on the series is
// deleted before the incoming `issues` are created, and `series.arc` +
diff --git a/server/services/importer.js b/server/services/importer.js
index b4473a0ff5..c4f8b7f148 100644
--- a/server/services/importer.js
+++ b/server/services/importer.js
@@ -1295,9 +1295,10 @@ export async function commitImport({
const stages = {};
if (proposal.proseExcerpt) {
// Route the verbatim excerpt to the stage that matches the source form
- // (see CONTENT_TYPE_SEED_STAGE): a comic-script seeds stages.comicScript
- // (ready) so the pipeline renders the user's verbatim script instead of
- // regenerating it; everything else seeds stages.prose.
+ // (see CONTENT_TYPE_SEED_STAGE): a script-form type seeds its script
+ // stage ready (comic-script → comicScript, screenplay → teleplay) so the
+ // pipeline renders the user's verbatim script instead of regenerating
+ // it; prose-like types seed stages.prose.
stages[seedStageFor(contentType)] = { status: 'ready', output: proposal.proseExcerpt };
}
const ideaSeed = [
diff --git a/server/services/importer.test.js b/server/services/importer.test.js
index 9cfc75cdab..afada15c1d 100644
--- a/server/services/importer.test.js
+++ b/server/services/importer.test.js
@@ -926,6 +926,7 @@ describe('commitImport', () => {
const issue = await issuesSvc.getIssue(result.createdIssueIds[0]);
expect(issue.stages.prose.output).toBe('Plain prose.');
expect(issue.stages.comicScript?.output).toBeFalsy();
+ expect(issue.stages.teleplay?.output).toBeFalsy();
});
it('replace mode overwrites the bible, clearing stale fields when the new arc lacks them', async () => {