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

address review (codex): gate POV no-arc finding on complete arc coverage

[._.]/ Adam Eivy4039577a07e4
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index 42c9a4ec8c..6a5a765de6 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -2,7 +2,7 @@
## Added
-- **[issue-1295] Editorial check flags point-of-view characters who don't earn their viewpoint.** A new **POV justification** editorial check (Create → Editorial Checks) reads your reverse-outline scene segmentation — which already tags who holds POV in each scene — and surfaces two viewpoint problems. First, a **POV without an arc**: a character we spend scenes inside who has no detected character arc (their arc reads flat, or they don't show up in the story's detected arcs at all) — a viewpoint that exists only to deliver information, with no arc and no stakes, should be cut or folded into another POV. Second, the inverse — a **drive-by POV**: a character who holds the viewpoint in only a single scene, a one-off head-hop that reads as a structural seam. Each finding names the character and anchors to the scene where their viewpoint begins. The drive-by threshold and whether to run the no-arc check are configurable, and the no-arc check **degrades gracefully** — when there's no arc information yet (no analysis has run), it stays silent rather than guessing, while the structural drive-by check keeps working. Requires a generated reverse outline. (#1295)
+- **[issue-1295] Editorial check flags point-of-view characters who don't earn their viewpoint.** A new **POV justification** editorial check (Create → Editorial Checks) reads your reverse-outline scene segmentation — which already tags who holds POV in each scene — and surfaces two viewpoint problems. First, a **POV without an arc**: a character we spend scenes inside who has no detected character arc (their arc reads flat, or they don't show up in the story's detected arcs at all) — a viewpoint that exists only to deliver information, with no arc and no stakes, should be cut or folded into another POV. Second, the inverse — a **drive-by POV**: a character who holds the viewpoint in only a single scene, a one-off head-hop that reads as a structural seam. Each finding names the character and anchors to the scene where their viewpoint begins. The drive-by threshold and whether to run the no-arc check are configurable, and the no-arc check **degrades gracefully** — when there's no arc information yet (no analysis has run, or the series is only partially analyzed), it stays silent rather than guessing, while the structural drive-by check keeps working. Requires a generated reverse outline. (#1295)
- **[issue-1296] Editorial check flags flat, single-mode scenes.** A new **Scene component balance** editorial check (Create → Editorial Checks) reads your reverse-outline scene segmentation and flags scenes that lean on a single mode — a wall of narration, talking heads with no action, or pure action with no interiority or voice. The craft rule is that a scene should mix at least two of **narrative, action, and dialogue**; the check names exactly which modes a flagged scene is missing and suggests how to ground it, anchoring to the issue the scene belongs to. The minimum (default 2 of 3, up to all 3) is configurable, and scenes the outline hasn't classified are left alone rather than false-flagged. Requires a generated reverse outline. (#1296)
diff --git a/server/lib/editorial/README.md b/server/lib/editorial/README.md
index fc8319831c..76682b5616 100644
--- a/server/lib/editorial/README.md
+++ b/server/lib/editorial/README.md
@@ -66,7 +66,10 @@ inject `ctx.reverseOutline` (the scenes array). `editorialArcs` (#1295) makes th
runner fetch the series editorial aggregate and inject `ctx.editorialArcs` (the
detected per-character `{ name, arcDirection, issueCount, isProtagonist }`
projection — the graceful-degradation fallback for the dedicated arc model until
-`#arc-transitions` lands). When a new check reads a
+`#arc-transitions` lands) plus a derived `ctx.editorialArcsComplete` boolean (true
+only when every analyzable issue is analyzed and fresh), so a check can tell
+"absent because arc-less" from "absent because not-yet-analyzed" under a partial
+coverage batch. When a new check reads a
`ctx.series` field (or another artifact) that isn't yet a token, add the token to
`EDITORIAL_SOURCES` and a matching resolver in the runner's `SOURCE_RESOLVERS`.
diff --git a/server/lib/editorial/checkRegistry.js b/server/lib/editorial/checkRegistry.js
index 5bd07339e8..4d59d0c92f 100644
--- a/server/lib/editorial/checkRegistry.js
+++ b/server/lib/editorial/checkRegistry.js
@@ -1223,6 +1223,14 @@ export const EDITORIAL_CHECKS = [
arcs.map((a) => [normalizeName(a?.name), a]).filter(([k]) => k)
);
const haveArcModel = arcByName.size > 0;
+ // Whether every analyzable issue has been analyzed and is fresh (set by the
+ // runner from the editorial-analysis coverage). It gates only the
+ // *absent-from-arcs* finding: under partial coverage a POV holder can be
+ // missing from `arcByName` simply because their issue was never analyzed
+ // (a canceled/early-stopped batch), NOT because they lack an arc — flagging
+ // that absence would be a false positive. A character who IS present but
+ // reads flat was definitively analyzed, so that finding stands regardless.
+ const arcsComplete = ctx.editorialArcsComplete === true;
const findings = [];
const flag = ({ severity, location, problem, suggestion, anchorQuote = '', issueNumber = null }) =>
@@ -1236,11 +1244,15 @@ export const EDITORIAL_CHECKS = [
const anchorQuote = typeof first?.anchorQuote === 'string' ? first.anchorQuote : '';
// 1) Unjustified POV — narrates a viewpoint but has no detected arc. Only
- // when an arc model exists to judge against (else we can't tell).
+ // when an arc model exists to judge against (else we can't tell). The
+ // absent-from-arcs sub-case additionally requires complete coverage so
+ // a not-yet-analyzed POV holder isn't mistaken for an arc-less one.
if (flagUnjustified && haveArcModel) {
const arc = arcByName.get(holder.key) || null;
- const hasArc = !!arc && typeof arc.arcDirection === 'string' && arc.arcDirection !== 'flat';
- if (!hasArc) {
+ const arcIsFlat = !arc || typeof arc.arcDirection !== 'string' || arc.arcDirection === 'flat';
+ // A present-but-flat character was definitively analyzed → real "no arc".
+ // An absent character is only "no arc" once coverage is complete.
+ if (arcIsFlat && (arc || arcsComplete)) {
flag({
severity: ctx.severityDefault,
location: where,
diff --git a/server/lib/editorial/checkRegistry.test.js b/server/lib/editorial/checkRegistry.test.js
index 2c234de226..5d727d898f 100644
--- a/server/lib/editorial/checkRegistry.test.js
+++ b/server/lib/editorial/checkRegistry.test.js
@@ -712,8 +712,14 @@ describe('pov.justified — deterministic check', () => {
const scene = (pov, over = {}) => ({
heading: `${pov || 'no'}-pov scene`, issueNumber: 1, anchorQuote: 'q', povCharacter: pov, ...over,
});
- const runPov = (scenes, { config = {}, arcs = [] } = {}) =>
- getCheck(POV).run({ reverseOutline: scenes, editorialArcs: arcs, config, severityDefault: 'low' });
+ const runPov = (scenes, { config = {}, arcs = [], arcsComplete = true } = {}) =>
+ getCheck(POV).run({
+ reverseOutline: scenes,
+ editorialArcs: arcs,
+ editorialArcsComplete: arcsComplete,
+ config,
+ severityDefault: 'low',
+ });
it('declares both reverseOutline and editorialArcs sources', () => {
const c = getCheck(POV);
@@ -753,6 +759,29 @@ describe('pov.justified — deterministic check', () => {
expect(findings[0].problem).toMatch(/not present in the detected arcs/);
});
+ it('under partial coverage, suppresses the absent-from-arcs finding but keeps present-but-flat', () => {
+ // Arc analysis only partially complete: Flat was analyzed (reads flat), Ghost's
+ // issue was never analyzed (absent). Absent ≠ no-arc here, so Ghost must NOT be
+ // flagged unjustified; Flat (definitively analyzed) still is.
+ const findings = runPov(
+ [scene('Flat'), scene('Flat'), scene('Ghost'), scene('Ghost')],
+ { config: { driveByMaxScenes: 0 }, arcs: [{ name: 'Flat', arcDirection: 'flat', issueCount: 2 }], arcsComplete: false },
+ );
+ const unjustified = findings.filter((f) => /no detected character arc/.test(f.problem));
+ expect(unjustified).toHaveLength(1);
+ expect(unjustified[0].problem).toMatch(/"Flat"/);
+ expect(findings.some((f) => /"Ghost"/.test(f.problem))).toBe(false);
+ });
+
+ it('once coverage is complete, the same absent POV holder IS flagged', () => {
+ const findings = runPov(
+ [scene('Ghost'), scene('Ghost')],
+ { config: { driveByMaxScenes: 0 }, arcs: [{ name: 'Flat', arcDirection: 'flat', issueCount: 2 }], arcsComplete: true },
+ );
+ expect(findings).toHaveLength(1);
+ expect(findings[0].problem).toMatch(/not present in the detected arcs/);
+ });
+
it('flags a drive-by (single-scene) POV via the inverse-imbalance check', () => {
const findings = runPov(
[scene('Aria'), scene('Aria'), scene('Cameo')],
diff --git a/server/services/pipeline/editorial/checkRunner.js b/server/services/pipeline/editorial/checkRunner.js
index 620a80cd72..6c40e9ba6a 100644
--- a/server/services/pipeline/editorial/checkRunner.js
+++ b/server/services/pipeline/editorial/checkRunner.js
@@ -178,6 +178,16 @@ export async function runEditorialChecks(seriesId, options = {}) {
const manuscript = sectionsCorpus(sections);
const reverseOutline = Array.isArray(outline?.scenes) ? outline.scenes : [];
const editorialArcs = projectEditorialArcs(editorial);
+ // Whether every analyzable issue has been analyzed and is fresh — gates the
+ // pov.justified "absent from detected arcs" finding so a partially-analyzed
+ // series (canceled/early-stopped batch) doesn't flag a not-yet-analyzed POV
+ // holder as arc-less (#1295). Derived, not fingerprinted: it moves in lockstep
+ // with the editorialArcs projection that already drives staleness.
+ const cov = editorial?.coverage;
+ const editorialArcsComplete = !!cov
+ && cov.withContent > 0
+ && cov.analyzed >= cov.withContent
+ && (cov.stale || 0) === 0;
// Resolve every source token once — each finding's fingerprint reads from this
// so the editor flags it `stale` when the content that check actually read (its
// declared `sources`) drifts (#1345, #1387).
@@ -190,6 +200,7 @@ export async function runEditorialChecks(seriesId, options = {}) {
manuscript,
reverseOutline,
editorialArcs,
+ editorialArcsComplete,
canon,
providerOverride,
modelOverride,