<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: shizhiliang</title>
    <description>The latest articles on DEV Community by shizhiliang (@shizhiliang).</description>
    <link>https://dev.to/shizhiliang</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4174378%2F21868323-1cf8-48a9-af44-6733246f99a6.png</url>
      <title>DEV Community: shizhiliang</title>
      <link>https://dev.to/shizhiliang</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/shizhiliang"/>
    <language>en</language>
    <item>
      <title>Treat AI Scene Rewrites as Constrained State Changes</title>
      <dc:creator>shizhiliang</dc:creator>
      <pubDate>Sun, 11 Oct 2026 03:34:12 +0000</pubDate>
      <link>https://dev.to/shizhiliang/treat-ai-scene-rewrites-as-constrained-state-changes-1e5c</link>
      <guid>https://dev.to/shizhiliang/treat-ai-scene-rewrites-as-constrained-state-changes-1e5c</guid>
      <description>&lt;p&gt;&lt;em&gt;Disclosure: I’m building &lt;a href="https://laper.ai/" rel="noopener noreferrer"&gt;Laper&lt;/a&gt;. This article was generated with AI assistance. The workflow below is a standalone design example, not a description of shipped product behavior or measured results.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;An AI rewrite can improve every sentence and still break the next scene. For developers building writing tools, that is an evaluation problem: fluency is not the same as preserving the writer’s intent.&lt;/p&gt;

&lt;p&gt;Consider an invented screenplay scene. Two sisters are clearing their late father’s apartment. The older sister has booked a viewing for tomorrow without permission. The younger sister does not yet know that. By the end, she agrees to the viewing but keeps the spare key.&lt;/p&gt;

&lt;p&gt;A polished rewrite in which she hands over the key has changed more than dialogue. Any later scene built around her control of the apartment now needs another pass.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why one “quality” score misses the failure
&lt;/h2&gt;

&lt;p&gt;A reviewer might prefer the more conciliatory version in isolation. That does not make it the right replacement in this screenplay. Separate at least two questions: does the scene read well, and does it satisfy the current revision brief?&lt;/p&gt;

&lt;p&gt;The brief is not an objective definition of good storytelling. A writer can change it. The important part is making that decision explicit instead of silently treating a different outcome as a style improvement.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Store the revision contract separately from the prose
&lt;/h2&gt;

&lt;p&gt;A small, writer-approved record is enough to start. Here is illustrative JSON, not a production schema:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"sceneId"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"apartment-07"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"revisionGoal"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Make the older sister's request less direct"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"initialFacts"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="s2"&gt;"The older sister knows the viewing is tomorrow"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="s2"&gt;"The younger sister does not know about the booking"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"requiredEndState"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="s2"&gt;"The younger sister agrees to the viewing"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="s2"&gt;"The younger sister keeps the spare key"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"forbiddenChanges"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="s2"&gt;"Add a new family secret"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="s2"&gt;"Resolve the disagreement about selling"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Keep the source scene, contract version, and candidate rewrite together. If someone later edits the contract, an earlier review should not appear to validate the new requirements.&lt;/p&gt;

&lt;p&gt;This is deliberately smaller than a complete character database. It records the facts needed for this revision, not every fact in the fictional world.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Ask for evidence, not a self-awarded pass
&lt;/h2&gt;

&lt;p&gt;A separate review step can compare the candidate against each requirement. Ask it to quote the relevant lines and return one of three statuses: supported, contradicted, or unclear.&lt;/p&gt;

&lt;p&gt;For example, “She drops the key into her sister’s palm” contradicts the required end state. “They look at the door” does not establish who keeps the key; mark it unclear rather than inventing evidence.&lt;/p&gt;

&lt;p&gt;These labels are proposed review outcomes, not benchmark results. A model-generated check can miss implication, sarcasm, or an unreliable speaker. Treat it as a queue of claims for the writer to inspect, not an automatic approval gate. If the reviewer cannot point to evidence, show that uncertainty.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Review the boundary before accepting the patch
&lt;/h2&gt;

&lt;p&gt;Show the original scene and proposed replacement side by side, followed by the beginning of the next scene. The writer should be able to accept, reject, or revise the candidate without overwriting the original first.&lt;/p&gt;

&lt;p&gt;For the apartment example, check whether the next scene assumes the younger sister still has the key. Also check when she learns about the viewing: a line mentioning tomorrow before the reveal may be a knowledge leak, unless the writer deliberately establishes another source.&lt;/p&gt;

&lt;p&gt;Keep structural checks separate from semantic ones. Software can check that an output includes required fields or a valid status value. That does not prove its interpretation of the screenplay is correct.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try a tiny evaluation set
&lt;/h2&gt;

&lt;p&gt;Before adding automation, assemble three hand-written candidates for the same scene: one that preserves the brief, one that hands over the key, and one that leaves the key’s location ambiguous. Have a human label the relevant passages, then compare the reviewer’s output against those labels.&lt;/p&gt;

&lt;p&gt;This small set can expose obvious weaknesses in your review design. It cannot establish general reliability. Add different scenes and failure types before making broader claims, and keep human review in the acceptance path.&lt;/p&gt;

&lt;p&gt;The useful question is not only “Is this rewrite better?” It is “What changed, what evidence supports that reading, and did the writer intend it?” A writing tool that exposes those questions gives its user something more useful than a confident score.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>architecture</category>
      <category>llm</category>
      <category>softwareengineering</category>
    </item>
    <item>
      <title>Why AI Script Writers Lose Track of Characters</title>
      <dc:creator>shizhiliang</dc:creator>
      <pubDate>Sat, 10 Oct 2026 03:18:41 +0000</pubDate>
      <link>https://dev.to/shizhiliang/why-ai-script-writers-lose-track-of-characters-29ib</link>
      <guid>https://dev.to/shizhiliang/why-ai-script-writers-lose-track-of-characters-29ib</guid>
      <description>&lt;p&gt;An AI writer can produce a convincing confrontation and still lose the character one scene later. A cautious investigator suddenly confesses without leverage. A son who learned about his father's debt asks about it as if it were new. Two rivals speak with the warmth of old friends because the prompt requested an "emotional conversation."&lt;/p&gt;

&lt;p&gt;The sentences may be polished. The character logic is not.&lt;/p&gt;

&lt;p&gt;An &lt;a href="https://laper.ai" rel="noopener noreferrer"&gt;AI Script Writer&lt;/a&gt; is more useful when it treats the screenplay as an evolving source of story facts rather than a collection of isolated prompts. Laper keeps screenplay scenes inside a structured project and connects planning material to the work that requested it. That structure can make continuity easier to inspect, but it cannot decide what a character should feel. The writer still owns the change.&lt;/p&gt;

&lt;h2&gt;
  
  
  Compare Prompt Memory With Story State
&lt;/h2&gt;

&lt;p&gt;Giving a model more previous text can help, but text volume is not the same as dramatic memory. A screenplay carries facts that change at different speeds.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Memory layer&lt;/th&gt;
&lt;th&gt;What it records&lt;/th&gt;
&lt;th&gt;Typical failure&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Identity&lt;/td&gt;
&lt;td&gt;Values, habits, voice and long-term fear&lt;/td&gt;
&lt;td&gt;The character behaves like a different person&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Knowledge&lt;/td&gt;
&lt;td&gt;What the character has learned or misunderstood&lt;/td&gt;
&lt;td&gt;A reveal is repeated or anticipated too early&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Objective&lt;/td&gt;
&lt;td&gt;What the character needs in the current scene&lt;/td&gt;
&lt;td&gt;Dialogue sounds good but does not pursue anything&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Relationship&lt;/td&gt;
&lt;td&gt;Trust, debt, power and concealed conflict&lt;/td&gt;
&lt;td&gt;Enemies speak like friends without a dramatic cause&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Performance&lt;/td&gt;
&lt;td&gt;What the character shows versus what they feel&lt;/td&gt;
&lt;td&gt;Subtext disappears into direct explanation&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The useful unit is not "everything written about this person." It is the state that matters now.&lt;/p&gt;

&lt;h2&gt;
  
  
  Test One Character Across One Dramatic Turn
&lt;/h2&gt;

&lt;p&gt;Do not begin by asking the system to remember an entire feature. Choose one character and one irreversible change.&lt;/p&gt;

&lt;p&gt;Imagine Maya, an observant investigator who trusts her business partner, Daniel. Halfway through the story, she finds evidence that Daniel hid a payment. She needs access to his office, so she continues performing trust while privately testing him.&lt;/p&gt;

&lt;p&gt;The next scene should preserve five facts:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Maya is controlled and reluctant to accuse without proof.&lt;/li&gt;
&lt;li&gt;She knows Daniel lied about the payment.&lt;/li&gt;
&lt;li&gt;Daniel does not know what she found.&lt;/li&gt;
&lt;li&gt;Maya needs him to leave the office unlocked.&lt;/li&gt;
&lt;li&gt;The audience should notice that her friendliness has become strategic.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now request the scene twice. In the first version, provide only Maya's biography and the latest prompt. In the second, provide the five current facts. Compare what changes.&lt;/p&gt;

&lt;p&gt;The test is not whether the second version uses more detail. It is whether every line serves the same concealed objective.&lt;/p&gt;

&lt;h2&gt;
  
  
  Separate Stable Traits From Changing Facts
&lt;/h2&gt;

&lt;p&gt;A character profile often mixes permanent description with temporary state. "Reserved, loyal, angry with Daniel, carrying a recorder" looks compact, but the four facts have different lifetimes.&lt;/p&gt;

&lt;p&gt;Keep them separate:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Stable trait:&lt;/strong&gt; Maya avoids accusations she cannot prove.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Current belief:&lt;/strong&gt; Daniel concealed the payment.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scene objective:&lt;/strong&gt; Get access to the office.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Visible behaviour:&lt;/strong&gt; Remain calm and cooperative.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hidden pressure:&lt;/strong&gt; She may lose the evidence if Daniel becomes suspicious.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This separation prevents one dramatic beat from rewriting the whole character. Anger in one scene should not become a permanent voice setting. A prop used once should not follow the character forever. A mistaken belief should be able to expire when the truth arrives.&lt;/p&gt;

&lt;h2&gt;
  
  
  Make Knowledge Unequal
&lt;/h2&gt;

&lt;p&gt;Characters rarely share the same version of the story. Suspense often depends on that inequality.&lt;/p&gt;

&lt;p&gt;For every important fact, record three positions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Who knows it?&lt;/li&gt;
&lt;li&gt;Who only suspects it?&lt;/li&gt;
&lt;li&gt;Who believes the opposite?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In Maya's scene, the audience and Maya know about the hidden payment. Daniel may suspect that she is investigating, but he does not know what she found. A colleague still believes the partnership is healthy.&lt;/p&gt;

&lt;p&gt;If the generated dialogue gives all three people the same knowledge, the scene loses its pressure even when every sentence is individually plausible.&lt;/p&gt;

&lt;p&gt;An &lt;a href="https://laper.ai" rel="noopener noreferrer"&gt;AI screenplay software&lt;/a&gt; workflow should therefore expose the context used for a scene instead of hiding it behind a general promise of memory. Writers need to see which facts entered the request, reject the wrong assumptions, and keep approved changes attached to the authoritative draft.&lt;/p&gt;

&lt;h2&gt;
  
  
  Track The Cause Of Every Character Change
&lt;/h2&gt;

&lt;p&gt;A character can contradict an earlier version of themselves. That is often the point of drama. The continuity test is not "Did this person remain the same?" It is "Did the story earn the difference?"&lt;/p&gt;

&lt;p&gt;Write a cause beside each meaningful change:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Trust becomes suspicion after Maya finds the payment record.&lt;/li&gt;
&lt;li&gt;Restraint becomes confrontation after Daniel destroys the evidence.&lt;/li&gt;
&lt;li&gt;Isolation becomes cooperation after Maya admits what she concealed.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Without the cause, development becomes random variation. With it, a surprising action can still feel inevitable in retrospect.&lt;/p&gt;

&lt;h2&gt;
  
  
  Use A Five-Part Character Consistency Check
&lt;/h2&gt;

&lt;p&gt;Review the generated scene without asking whether the prose sounds impressive.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Knowledge:&lt;/strong&gt; Does the character know only what the story has revealed to them?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Objective:&lt;/strong&gt; Does each choice pursue the current scene goal?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Relationship:&lt;/strong&gt; Does the behaviour reflect the latest balance of trust and power?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Performance:&lt;/strong&gt; Is the difference between feeling and display still visible?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Causality:&lt;/strong&gt; Can every meaningful change be traced to an event in the screenplay?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A scene can fail one category and still contain useful material. A blunt accusation may be out of character but reveal the conflict the scene needs. Keep the conflict, reject the behaviour, and rewrite the route.&lt;/p&gt;

&lt;h2&gt;
  
  
  Approve A Character Rule, Not A Favorite Line
&lt;/h2&gt;

&lt;p&gt;The most valuable result from a continuity test is not one clever exchange. It is a rule the next scene can obey.&lt;/p&gt;

&lt;p&gt;For Maya, the rule might be: &lt;em&gt;Until Daniel knows she found the payment, Maya turns suspicion into practical questions and never names the accusation directly.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;That sentence can guide dialogue, blocking and performance. It can also be revised when the story crosses the next threshold.&lt;/p&gt;

&lt;p&gt;AI should reduce the work of carrying decisions across a long project. It should not hide those decisions or make them on the writer's behalf. When identity, knowledge, objectives and relationships remain visible, generated scenes become easier to judge and easier to reject.&lt;/p&gt;

&lt;p&gt;The final test is simple: a reader should recognize the same character while feeling that the story has changed them.&lt;/p&gt;

&lt;p&gt;To explore a structured AI-assisted screenwriting workflow, visit &lt;strong&gt;&lt;a href="https://laper.ai" rel="noopener noreferrer"&gt;laper.ai&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;

</description>
      <category>productivity</category>
      <category>ai</category>
      <category>writing</category>
      <category>filmmaking</category>
    </item>
  </channel>
</rss>
