From d57ede8a0c8107c471589aeb2365db0915c25171 Mon Sep 17 00:00:00 2001 From: SitgesRun <169425442+SitgesRun@users.noreply.github.com> Date: Sun, 15 Nov 2026 16:49:08 -0800 Subject: [PATCH] One editable text per card: every prompt is composed when drawn, a keyframe's, storyboard's or take's prompt.md is an override the agent writes and "Use the automatic prompt" removes, and Use brings a folder back as it was The person's rule (A4): every card has one editable text, the person and Pine Computer write it as equals, and nothing rewrites it as a side effect. - An asset card edits its description only. Its Full prompt shows, read only, the prompt its last draw sent (the receipt's prompt_sent), or "Composed when drawn". The Studio's prompt editing is deleted: the 'prompt' card action, the composer's prompt editor and CanvasPrompt. - A keyframe, storyboard or take may have prompt.md, an override that drama-cli sends as written. The card says "Its own prompt is used" and offers "Use the automatic prompt", a new 'automatic' action that removes it. Generate no longer needs a text. prompt.md is read only on those cards (PROMPT_CARDS). - Use restores the object's own folder as of the result: its files then, the files it did not hold then removed, object.json current with that result's shown_file and, on a keyframe, storyboard or take, its objects_sent_by_draw_request, which its prompt's Image N names. readChangeOfObject is replaced by filesOfObjectAt. - The major-1 conversion, which every project of a released Studio goes through, writes the rule's shape: stored prompts are dropped (prompts/ folders and choices.json prompts; the backup keeps them), and a character's look and a prop's text join description.md after the person's pending text, in drama-cli's bytes (entries.prose). Its extract_json_field_to_markdown operation is deleted. - Major 2 was never released, so no project needs a one-time cleanup; a major-2 test project made before this keeps its stray prompt.md files, which drama-cli ignores on description cards. - doc/protocol.md 2.2, 3 and 5, doc/quick-start.md. Signed-off-by: SitgesRun <169425442+SitgesRun@users.noreply.github.com> --- doc/protocol.md | 12 ++- doc/quick-start.md | 5 +- extensions/pine-drama/canvas/canvas.tsx | 47 ++++++----- extensions/pine-drama/canvas/seg.tsx | 8 +- .../v2/major1-to-major2-conversion.json | 22 ++--- .../pine-drama/src/core/canvasProtocol.ts | 10 +-- .../src/core/convertMajor1ProjectToMajor2.ts | 32 +++++-- .../pine-drama/src/core/entryActions.ts | 40 +++++---- .../pine-drama/src/core/galleryProtocol.ts | 10 +-- extensions/pine-drama/src/core/major1.ts | 1 - extensions/pine-drama/src/core/project.ts | 7 +- .../pine-drama/src/core/projectHistory.ts | 22 ++--- extensions/pine-drama/src/core/protocol.ts | 4 + extensions/pine-drama/src/core/segEditor.ts | 2 +- .../pine-drama/src/core/segEditorProtocol.ts | 2 +- extensions/pine-drama/src/episodeCanvas.ts | 6 +- .../test/convertMajor1ProjectToMajor2.test.ts | 28 +++++-- .../pine-drama/src/test/entryActions.test.ts | 41 ++++++++- .../pine-drama/src/test/project.test.ts | 2 +- extensions/pine-drama/src/test/renderSmoke.ts | 83 +++++++------------ 20 files changed, 211 insertions(+), 173 deletions(-) diff --git a/doc/protocol.md b/doc/protocol.md index 8a9a91b..bb73e95 100644 --- a/doc/protocol.md +++ b/doc/protocol.md @@ -82,7 +82,10 @@ An object is a folder holding **`object.json`** (`$defs/object`): - **Pine Computer changes an object only in a turn that works on that object.** It plans, draws or rewrites that object itself: never as a side effect of another object changing, and never when it reads one. So a field the person set (`objects_sent_by_draw_request`, `relations`, `variant_of`, the text files) stays as they set it until they, or a turn that works on that object, change it. History keeps both. - **References that no longer resolve.** A listed object may be deleted later, and a reference may point back at its own object, directly or through others. Both are allowed in the data. A draw sends the shown files of the listed objects that exist, in order, and Pine Computer tells the person each one it could not send (4.4). It refuses nothing. A draw sends files, not a graph, so a cycle sends each file once, as listed. - **Who creates objects.** Either side may create an object. The client creates one when the person adds it, with `object.json` and the person's `description.md`. drama-cli derives every name a model reads from `name`, never from the id. -- **The person's text.** In an object's folder, `description.md` and `prompt.md`, when present, are the text the person and Pine Computer edit. Whoever writes last wins, and git keeps the earlier text. +- **One editable text per object.** The person and Pine Computer are equal writers of it: whoever writes last wins, and git keeps the earlier text. No side rewrites it as a side effect of drawing. + - A `character`, `scene`, `prop` or `variant` has `description.md`. Its draw composes the prompt from it, so it has no `prompt.md`; the prompt a draw sent is in its receipt (`prompt_sent`, 2.3). A character's outfit and a prop's printed words are part of the description (`Outfit: …`; `It shows the words "…".`). `entry.json` beside it keeps the asset's other story facts, which drama-cli reads and no card edits. + - A `character_face`, `scene_floor_plan` or `scene_view` has neither: it is drawn from its owner's description, and the variant's change for a variant's view. + - A `keyframe`, `storyboard` or `take` has `prompt.md` only as an override, which its draw sends as written. Without one, the draw composes the prompt. Removing it ("Use the automatic prompt") returns to that. - **Removal.** Removing an object deletes its folder; a variant is a folder below its asset's, so it goes with it. ### 2.3 Receipts @@ -113,7 +116,7 @@ Pine Computer keeps its own records of the drama in **`pine-computer-records/`** - an `object.json` field (`objects_sent_by_draw_request`, `relations`, `variant_of`, `name`); - adding an object, which writes its folder with `object.json` and `description.md`; - removing an object, which deletes its folder; - - `description.md` or `prompt.md`; + - `description.md`, or the `prompt.md` of a keyframe, storyboard or take, or its removal (2.2); - the person's own picture or video, below. - **Canvas positions** and every other view state are the client's own, per person or per profile, and are never written into the drama. - **Hand changes** (a folder client): a file changed outside the client is recorded as `client-found-changes-on-disk` at the next opening, before the next turn, or at a running turn's next collection (4.3). @@ -188,7 +191,10 @@ A turn ends as Pine reports it ([agent turns](https://console.pinecomputer.io/do ## 5. What the client shows - **The cards** show what the client holds: each object's `object.json`, its `shown_file` and its receipts. A file's history is every earlier content of it (2.1; in git, `git log` of the path). -- **"Use" on a past result** restores the files that result's change wrote inside the object's own folder, receipts with them, as a `person` change. That is the change's commit in git; for a turn's, the commit of the collection that landed it, which carries the turn's `Pine-Turn-Id`. Files of a variant or any other object folded inside it are not included, since each is an object of its own. Files the same change wrote for other objects stay as they are. The rule is the same whoever made the change: a turn, the person, or `client-found-changes-on-disk`, which may hold the whole project. The restored result's file is the shown one again: `object.json` `shown_file` names it, and a current shown file of another name is deleted with its receipt in the same change, as for the person's own picture (3). Use restores only the files that result's change wrote: a file a later result added beside them, such as a take's last frame, stays. +- **"Use" on a past result** brings the object's own folder back as it was at that result, as a `person` change: the result is the commit that first wrote that shown file (in git; for a turn's, the commit of the collection that landed it, which carries the turn's `Pine-Turn-Id`). + - Every file of the folder then comes back, receipts with them, `description.md` and `entry.json` too, and a file the folder holds now but did not then is deleted. + - `object.json` stays the current one, with that result's `shown_file`. On a keyframe, storyboard or take, that result's `objects_sent_by_draw_request` comes back too, since its `prompt.md` names its images by that list; its `prompt.md` follows the folder, present or absent. + - Files of a variant or any other object folded inside it are not included, since each is an object of its own, and nothing outside the folder changes. The rule is the same whoever made the result: a turn, the person, or `client-found-changes-on-disk`. ## 6. Majors and upgrades diff --git a/doc/quick-start.md b/doc/quick-start.md index 10cf0dc..92490b0 100644 --- a/doc/quick-start.md +++ b/doc/quick-start.md @@ -42,7 +42,7 @@ Your reply is the go: nothing at a stop asks you to approve item by item. | Stop | You look at | Your choice | |---|---|---| -| 1 | The planned asset cards, each with its prompt | Add, remove or change an asset, in one sentence | +| 1 | The planned asset cards, each with its description | Add, remove or change an asset, in one sentence | | 2 | The drawn assets, with what the agent found | The leads' looks | | 3 | The episode's shot list and its planned cards | Revise it, or go | | 4 | Storyboards, keyframes, video prompts, and the estimated video cost | Shoot everything, or hold some back | @@ -55,7 +55,7 @@ The agent also stops for a red line in the screenplay, and for a screenplay it r | Place | What's there | What you do | |---|---|---| | **Right: Chat** | The agent | Ask, answer, say go, press Stop | -| **Center: canvas** | One canvas for the assets, one per episode | Edit a card's prompt, drop your picture on it, click an old version and press **Use** | +| **Center: canvas** | One canvas for the assets, one per episode | Edit a card's description (an episode card: its prompt), drop your picture on it, click an old version and press **Use** | | **Center: galleries** | Characters, places, props | **Create New**; click a card to see it on the canvas | | **Center: seg editor** | An episode's segments and takes | Play takes; **Generate** writes the request into the Chat for you to send | | **Left: Production** | The project and each object's versions | Look and open only | @@ -95,7 +95,6 @@ How and why: [architecture](architecture.md). | You answer hours after a question | The Computer may have stopped | Send your answer; the agent starts again from your folder | | The Chat is dead after Stop | Known bug | Run **Developer: Reload Window** | | A card you made with Create New can't be drawn | Its name has a space, dash or accent (known bug) | Use a name in plain letters a–z, or ask the agent to add it | -| The redraw ignored your new description | A card is drawn from its prompt | Edit the card's prompt, or tell the agent what to change | | A turn failed | What it made still lands; Pine gives the reason | Ask the agent to go on | ## 6. FAQ diff --git a/extensions/pine-drama/canvas/canvas.tsx b/extensions/pine-drama/canvas/canvas.tsx index 460a07e..93bca31 100644 --- a/extensions/pine-drama/canvas/canvas.tsx +++ b/extensions/pine-drama/canvas/canvas.tsx @@ -283,15 +283,14 @@ const notYet = 'Not available yet'; /** * The composer: one floating dialog under the picked card, the same on both canvases (the person's design). A top row - * (Upload, + Variant, Reference, Style, Full prompt), the references, the text specific to this picture, and a bottom - * bar (model, settings, Generate). An asset's text is its description, its full prompt one click away; an episode - * card's is its prompt, the only text it has; a storyboard has none. The text is for the next draw, so a picture the - * person uploaded keeps it; how the picture on the card was made (its receipt; none for an upload) is behind "How it - * was made". The model and settings are greyed, as the Computer cannot take a choice yet. + * (Upload, + Variant, Reference, Style, Full prompt), the references, an asset's one editable text, its description, + * and a bottom bar (model, settings, Generate). Its full prompt, the one its last draw sent, is read only; a keyframe's, + * a storyboard's or a take's own prompt can only be removed here (doc/protocol.md 2.2). How the picture on the card was + * made (its receipt) is behind "How it was made". The model and settings are greyed, as the Computer cannot take a choice yet. */ function Composer({ card, reply, onGo, onClose }: { card: CanvasCard; reply: DetailMessage | undefined; onGo: (stageId: string) => void; onClose: () => void }) { const record = reply?.record ?? null; - const prompt = reply?.prompt ?? null; + const ownPrompt = reply?.ownPrompt ?? null; const [draft, setDraft] = useState<{ name: string; text: string } | null>(null); const [full, setFull] = useState(false); const [outcome, setOutcome] = useState<{ key: string; busy: boolean; error: string | null; unchanged: string | null } | null>(null); @@ -311,16 +310,12 @@ function Composer({ card, reply, onGo, onClose }: { card: CanvasCard; reply: Det }; const description = useTextEdit(`describe:${card.id}`, record?.description ?? null, busy, act, text => ({ action: 'describe', object: card.id, description: record?.description ?? '', text })); - const promptEdit = useTextEdit(`prompt:${card.id}`, prompt?.text ?? null, busy, act, text => ({ action: 'prompt', object: prompt?.object ?? card.id, text })); - // The picture shown is the person's own upload: it was made from no prompt. - // An asset's own text is its description, its full prompt behind Full prompt; an episode card's is its prompt, the only - // text it has (the person's decision). One text is edited at a time, so Save and Generate act on the one shown. - const main = record ? (full ? promptEdit : description) : prompt?.text != null ? promptEdit : null; + const fullPrompt = reply?.detail?.prompt ?? 'Composed when drawn'; // What its next draw sends, Image 1..N: the one list the draw builds its request from (objects_sent_by_draw_request). const references = reply?.nextDraw ?? []; const generate = () => { - if (!main || main.blank) { return; } - if (main.save()) { generateOnceSaved.set(main.key, card.id); } else { post({ v: CANVAS_PROTOCOL, type: 'generate', stageId: card.id }); } + if (record && description.blank) { return; } + if (record && description.save()) { generateOnceSaved.set(description.key, card.id); } else { post({ v: CANVAS_PROTOCOL, type: 'generate', stageId: card.id }); } }; const addVariant = () => record && draft && draft.name.trim() && draft.text.trim() && !busy && act({ key: `variant:${card.id}`, request: { action: 'add', type: 'variant', from: card.id, name: draft.name.trim(), text: draft.text.trim() } }); @@ -338,8 +333,8 @@ function Composer({ card, reply, onGo, onClose }: { card: CanvasCard; reply: Det {card.segment && } - {record && prompt?.text != null && } + {record && } {references.length > 0 && ( @@ -350,13 +345,22 @@ function Composer({ card, reply, onGo, onClose }: { card: CanvasCard; reply: Det {reply?.picture && } {!reply &&
Reading its record…
} {reply?.error &&
{reply.error}
} - {main && } - {main?.changed && ( + {record && (full ?