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

feat: beat-sheet decisive prompt + answer-and-refine open questions panel

[._.]/ Adam Eivy7ddb3fb2982f
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index 4254e2afcb..bf20f0a4ac 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -2,6 +2,16 @@
## Added
+- **Pipeline Issue — answer-and-refine flow for beat-sheet open questions.**
+ The idea stage prompt now tells the LLM to commit to decisive choices
+ rather than hedging — `## Open questions` is OPTIONAL and only used when
+ something fundamentally needs user input the LLM can't infer from the
+ bible. When the section does appear, the idea page renders a panel below
+ the output with one input per question and a *Refine with answers* button
+ that re-runs the stage with the answers folded into the seed and
+ instructions to drop the open-questions section in the revision. Blank
+ answers tell the LLM to commit to its own best guess on that item.
+
- **Pipeline Series — configurable per-series AI provider + model.** The arc
header now has provider + model dropdowns (mirroring the World Builder
expansion picker) bound to a new `series.llm = { provider, model }` field.
diff --git a/client/src/components/pipeline/stages/IdeaStage.jsx b/client/src/components/pipeline/stages/IdeaStage.jsx
index db078b7237..10ecd74fbe 100644
--- a/client/src/components/pipeline/stages/IdeaStage.jsx
+++ b/client/src/components/pipeline/stages/IdeaStage.jsx
@@ -1,13 +1,105 @@
+import { useMemo, useState } from 'react';
+import { Loader2, Wand2 } from 'lucide-react';
import TextStagePanel from './TextStagePanel';
+import toast from '../../ui/Toast';
+import { generatePipelineStage } from '../../../services/api';
+
+// Pulls the bullets out of a `## Open questions` markdown section. Returns
+// [] when the section is absent or empty — which is the desired steady state.
+function parseOpenQuestions(markdown) {
+ if (!markdown) return [];
+ const match = markdown.match(/##\s+Open questions\b[^\n]*\n([\s\S]*?)(?=\n##\s|$)/i);
+ if (!match) return [];
+ return match[1]
+ .split('\n')
+ .map((line) => line.replace(/^\s*[-*]\s*/, '').trim())
+ .filter(Boolean);
+}
+
+function buildRefinementSeed(originalSeed, qa) {
+ const block = qa
+ .map(({ q, a }) => `- Q: ${q}\n A: ${a || '(no specific answer — make a decisive choice that fits the bible)'}`)
+ .join('\n');
+ return `${originalSeed.trim()}
+
+## User answers to open questions
+
+The previous beat sheet raised the questions below. Apply these answers throughout the revised beat sheet and OMIT the "Open questions" section entirely in this revision.
+
+${block}`;
+}
export default function IdeaStage(props) {
+ const { issue, onStageUpdate } = props;
+ const output = issue.stages?.idea?.output || '';
+ const seedInput = issue.stages?.idea?.input || '';
+ const questions = useMemo(() => parseOpenQuestions(output), [output]);
+ const [answers, setAnswers] = useState({});
+ const [refining, setRefining] = useState(false);
+
+ const handleRefine = async () => {
+ setRefining(true);
+ const qa = questions.map((q, i) => ({ q, a: (answers[i] || '').trim() }));
+ const augmented = buildRefinementSeed(seedInput, qa);
+ const result = await generatePipelineStage(issue.id, 'idea', { seedInput: augmented })
+ .catch((err) => {
+ toast.error(err.message || 'Refinement failed');
+ return null;
+ });
+ setRefining(false);
+ if (!result) return;
+ onStageUpdate?.('idea', result.stage);
+ setAnswers({});
+ toast.success('Beat sheet refined with your answers');
+ };
+
return (
- <TextStagePanel
- {...props}
- stageId="idea"
- generateLabel="Generate beat sheet"
- seedPlaceholder="A rough idea for this issue — a single sentence is fine. The LLM expands it into a beat sheet."
- outputPlaceholder="The generated beat sheet will appear here. You can edit it freely; downstream stages use this content verbatim as upstream context."
- />
+ <div className="space-y-4">
+ <TextStagePanel
+ {...props}
+ stageId="idea"
+ generateLabel="Generate beat sheet"
+ seedPlaceholder="A rough idea for this issue — a single sentence is fine. The LLM expands it into a beat sheet."
+ outputPlaceholder="The generated beat sheet will appear here. You can edit it freely; downstream stages use this content verbatim as upstream context."
+ />
+
+ {questions.length > 0 ? (
+ <section className="bg-port-warning/5 border border-port-warning/30 rounded-lg p-4 space-y-3">
+ <header className="flex items-center justify-between gap-2 flex-wrap">
+ <h3 className="text-sm font-semibold text-port-warning">
+ {questions.length} open question{questions.length === 1 ? '' : 's'} from the LLM
+ </h3>
+ <button
+ type="button"
+ onClick={handleRefine}
+ disabled={refining}
+ className="inline-flex items-center gap-1.5 px-3 py-1.5 rounded text-xs font-medium border bg-port-bg text-port-warning border-port-warning/40 hover:bg-port-warning/10 disabled:opacity-40"
+ title="Re-run the beat sheet, folding your answers in and dropping the open-questions section"
+ >
+ {refining ? <Loader2 size={12} className="animate-spin" /> : <Wand2 size={12} />}
+ Refine with answers
+ </button>
+ </header>
+ <p className="text-xs text-gray-400">
+ Answer below, then refine. Blank answers tell the LLM to commit to its own best guess on that question.
+ </p>
+ <ul className="space-y-2">
+ {questions.map((q, i) => (
+ <li key={i} className="space-y-1">
+ <div className="text-xs text-gray-300">{q}</div>
+ <input
+ type="text"
+ value={answers[i] || ''}
+ onChange={(e) => setAnswers((prev) => ({ ...prev, [i]: e.target.value }))}
+ placeholder="Your answer (optional — leave blank for LLM's choice)"
+ className="w-full px-2 py-1.5 bg-port-bg border border-port-border rounded text-white text-xs"
+ disabled={refining}
+ />
+ </li>
+ ))}
+ </ul>
+ </section>
+ ) : null}
+ </div>
);
}
diff --git a/data.sample/prompts/stages/pipeline-idea-expansion.md b/data.sample/prompts/stages/pipeline-idea-expansion.md
index 315600221d..485b750197 100644
--- a/data.sample/prompts/stages/pipeline-idea-expansion.md
+++ b/data.sample/prompts/stages/pipeline-idea-expansion.md
@@ -2,6 +2,8 @@
You are a story consultant who turns a rough seed idea into a tight beat sheet for one issue (or episode) of an ongoing series. The beat sheet is the spine every later stage of the production pipeline will hang from — prose, comic script, TV teleplay, storyboards. Be specific. Avoid generalities.
+**Commit to decisions.** This is a beat sheet, not a brainstorm. When the seed is ambiguous — names, locations, motivations, props — pick the choice that best fits the series bible and write it as if it's settled. Downstream stages cannot work from "maybe X or Y." Trust your call; the user can override by editing the output.
+
## Series bible
- **Title:** {{series.name}}
@@ -39,7 +41,7 @@ A markdown document with the following sections, in this exact order:
4. **`## Beat sheet`** — 5–8 beats numbered as a markdown list. Each beat is one sentence describing a concrete dramatic event. Cover setup → rising action → midpoint reversal → climax → resolution / cliffhanger.
5. **`## Setting`** — 2–3 sentences naming the locations this issue uses and how they look. Reference the world's visual style.
6. **`## New characters (if any)`** — for any character the seed introduces that isn't in the series bible, give a one-line `**Name** — physical + role description`. Skip the section if there are none.
-7. **`## Open questions`** — bullet list of anything you'd want the writer to confirm before drafting prose.
+7. **`## Open questions` (OPTIONAL — usually omit)** — ONLY include this section when something fundamentally cannot be decided without user input (e.g. the seed asks the writer to choose between two specific named entities, or references off-canvas information only the user knows). Do NOT use this section for choices you could make yourself by leaning on the series bible. If every beat is committed, omit the section entirely.
Be concrete. Beats like "the character has an internal moment" are useless; beats like "Lina finds the burnt photograph hidden under the floorboard and recognizes the figure as her uncle" are useful.