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

storyArc: raise season synopsis cap 4000->8000 so it isn't clipped mid-sentence

[._.]/ Adam Eivy7fdbbd73284e
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index fe2394b3a9..24d9e9cd38 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -55,3 +55,4 @@
- **The character-name dissimilarity check no longer floods an epithet cast with thousands of false "confusable name" findings.** Two bugs compounded on a cast that uses article-led epithet names ("THE CABARET SINGER", "THE CHAPTER SEVENTEEN READER", …): (1) the check compared on the raw name, so 60+ "THE …" names all read as starting with the same letter and sharing the same 3-character opening; and (2) "same first letter" and "same opening" were counted as two independent similarity signals even though a shared 3-char opening always implies a shared first letter — so any two names sharing a prefix auto-reached the default 2-signal flag threshold. On one 24-issue series this produced ~2,100 spurious naming findings (and a "44 of 69 names start with T" crowding finding that was really just the article "THE"), driving the editorial health score to 0 and hard-pausing Series Autopilot at the health gate. The check now strips a leading article (the/a/an) before comparing names and counts the first-letter/opening overlap once, so it flags names readers would genuinely confuse and an epithet cast is judged on its real distinguishing words. (`server/lib/editorial/nameSimilarity.js`, `server/lib/editorial/checkRegistry.js`)
- **Deterministic editorial checks now self-heal — corrected or resolved findings clear instead of lingering forever.** The editorial-checks pass seeded every finding in `merge` mode, which only ever *adds* findings: an open finding a deterministic check no longer produces (because the check was fixed, or the underlying canon/manuscript changed) stayed open permanently. That let stale findings accumulate and could keep Series Autopilot's editorial-health gate blocked on problems that no longer exist. Deterministic checks (pure functions of their inputs) are now seeded in `fresh` mode scoped to each check's own id, so a finding the check no longer surfaces is auto-dismissed (a sync-safe status flip, never a deletion) — including when a check finds nothing at all that pass. LLM checks stay `merge`-only, since an absent LLM finding can be sampling variance rather than a real resolution; one check's reconciliation never touches another check's or the completeness pass's open comments. (`server/services/pipeline/editorial/checkRunner.js`)
- **The name-dissimilarity check no longer flags a name against its own plural.** A role-noun cast ("THE POET" / "the poets", "a reader" / "readers", "a waiter" / "the waiters") tripped the check's edit-distance-1 rule — a single trailing "s" reads as a near-identical-spelling typo — and escalated each pair to a *high*-severity blocker, even though singular-vs-plural is a deliberate count distinction (an individual vs a crowd) a reader parses effortlessly. The check now recognizes singular/plural variants of the same noun (the three common English inflections: -s, -es, -ies) and treats the pair as inert, while two genuinely different words that merely both end in "s" still compare normally. (`server/lib/editorial/nameSimilarity.js`)
+- **A season synopsis is no longer truncated mid-sentence (which could hang Series Autopilot's arc-verify loop).** The season-synopsis cap was 4000 characters — half the arc-level summary cap (8000) — even though a season synopsis covers a whole season's worth of episodes. A full synopsis got hard-clipped mid-word, and because the arc-verify→resolve convergence loop re-flags a mid-sentence truncation while the resolver keeps regenerating an over-cap synopsis that gets re-clipped, the loop burned all its rounds and paused without ever converging. The season-synopsis cap is now 8000 (matching the arc summary), so a complete synopsis is stored intact. (`server/lib/storyArc.js`)
diff --git a/server/lib/storyArc.js b/server/lib/storyArc.js
index aae37628df..d026412338 100644
--- a/server/lib/storyArc.js
+++ b/server/lib/storyArc.js
@@ -29,7 +29,14 @@ export const ARC_LIMITS = Object.freeze({
// Season
SEASON_TITLE_MAX: 200,
SEASON_LOGLINE_MAX: 500,
- SEASON_SYNOPSIS_MAX: 4000,
+ // A season synopsis covers a whole season's worth of episodes (8+ issues on a
+ // multi-season series), so it needs the same room as the arc-level SUMMARY_MAX
+ // (8000). The old 4000 cap clipped a full synopsis mid-sentence — and because
+ // the arc-verify→resolve loop re-flags a mid-sentence truncation and the
+ // resolver regenerates a >4000 synopsis that gets re-clipped, the loop could
+ // never converge (it burned all its rounds and paused). See arc-verify
+ // "truncated mid-sentence" finding, 2026-06-21.
+ SEASON_SYNOPSIS_MAX: 8000,
SEASON_ENDING_HOOK_MAX: 1000,
SEASON_NUMBER_MAX: 99,
SEASON_EPISODE_COUNT_MAX: 999,
diff --git a/server/lib/storyArc.test.js b/server/lib/storyArc.test.js
index 2f4f4f879e..c470d6ee37 100644
--- a/server/lib/storyArc.test.js
+++ b/server/lib/storyArc.test.js
@@ -303,6 +303,19 @@ describe('storyArc — sanitizeSeason', () => {
expect(s.episodeCountTarget).toBe(ARC_LIMITS.SEASON_EPISODE_COUNT_MAX);
});
+ it('keeps a full multi-episode synopsis (cap is wide enough to not clip mid-sentence)', () => {
+ // A 4000-char cap clipped a real season synopsis mid-word, and the
+ // arc-verify→resolve loop then re-flagged the truncation forever (never
+ // converged). The cap matches the arc-level SUMMARY_MAX (8000) so a full
+ // season synopsis is stored intact. Guard the 5000-char case the old cap broke.
+ expect(ARC_LIMITS.SEASON_SYNOPSIS_MAX).toBeGreaterThanOrEqual(8000);
+ const long = `${'A complete sentence about the season. '.repeat(130)}`; // ~5000 chars
+ expect(long.length).toBeGreaterThan(4000);
+ expect(long.length).toBeLessThanOrEqual(ARC_LIMITS.SEASON_SYNOPSIS_MAX);
+ const s = sanitizeSeason({ title: 'x', synopsis: long });
+ expect(s.synopsis).toBe(long.trim()); // not clipped
+ });
+
it('refreshes timestamps when preserveTimestamps=false', async () => {
const original = sanitizeSeason({ title: 'x', createdAt: '2020-01-01T00:00:00.000Z', updatedAt: '2020-01-01T00:00:00.000Z' });
// Tick the clock forward so the new updatedAt is strictly greater