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
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
address review (codex): treat a complete-but-empty arc analysis as a usable model
[._.]/ Adam Eivy048ea20bb157
diff --git a/server/lib/editorial/checkRegistry.js b/server/lib/editorial/checkRegistry.jsindex 4d59d0c92f..efce5b426a 100644--- a/server/lib/editorial/checkRegistry.js+++ b/server/lib/editorial/checkRegistry.js@@ -1231,6 +1231,11 @@ export const EDITORIAL_CHECKS = [// 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;+ // We can judge POV justification when there are detected arcs to compare+ // against OR when analysis is verified complete — a complete pass that+ // detected zero arcs still means every POV holder genuinely lacks one, so+ // an empty-but-complete model must not silently suppress the no-arc finding.+ const canJudgeArcs = haveArcModel || arcsComplete;const findings = [];const flag = ({ severity, location, problem, suggestion, anchorQuote = '', issueNumber = null }) =>@@ -1244,10 +1249,10 @@ 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). 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) {+ // when we can judge arcs at all (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 && canJudgeArcs) {const arc = arcByName.get(holder.key) || null;const arcIsFlat = !arc || typeof arc.arcDirection !== 'string' || arc.arcDirection === 'flat';// A present-but-flat character was definitively analyzed → real "no arc".diff --git a/server/lib/editorial/checkRegistry.test.js b/server/lib/editorial/checkRegistry.test.jsindex 5d727d898f..d44ba5fe30 100644--- a/server/lib/editorial/checkRegistry.test.js+++ b/server/lib/editorial/checkRegistry.test.js@@ -794,15 +794,36 @@ describe('pov.justified — deterministic check', () => {expect(driveBy[0].problem).toMatch(/only 1 scene/);});- it('degrades gracefully with no arc model: only the structural drive-by check runs', () => {- const findings = runPov([scene('Aria'), scene('Aria'), scene('Solo')]); // no arcs passed- // No arc data → no "unjustified" findings, but Solo (1 scene) is still a drive-by.+ it('degrades gracefully when analysis has not run: only the structural drive-by check runs', () => {+ // No arcs AND not complete (no analysis yet) → can't tell justified from not.+ const findings = runPov([scene('Aria'), scene('Aria'), scene('Solo')], { arcs: [], arcsComplete: false });expect(findings.every((f) => !/no detected character arc/.test(f.problem))).toBe(true);const driveBy = findings.filter((f) => /drive-by viewpoint/.test(f.problem));expect(driveBy).toHaveLength(1);expect(driveBy[0].problem).toMatch(/"Solo"/);});+ it('treats a complete-but-empty analysis as a usable model: every POV holder is flagged arc-less', () => {+ // Analysis completed and detected zero characters → every POV holder genuinely+ // has no arc, so the no-arc finding must still fire (not silently suppressed).+ const findings = runPov(+ [scene('Aria'), scene('Aria'), scene('Bram'), scene('Bram')],+ { config: { driveByMaxScenes: 0 }, arcs: [], arcsComplete: true },+ );+ const unjustified = findings.filter((f) => /not present in the detected arcs/.test(f.problem));+ expect(unjustified).toHaveLength(2);+ expect(unjustified.map((f) => f.problem).join(' ')).toMatch(/"Aria".*"Bram"|"Bram".*"Aria"/s);+ });++ it('stays silent on an empty analysis that is NOT complete (can\'t tell)', () => {+ // Zero arcs and incomplete → indistinguishable from "not analyzed yet".+ const findings = runPov(+ [scene('Aria'), scene('Aria')],+ { config: { driveByMaxScenes: 0 }, arcs: [], arcsComplete: false },+ );+ expect(findings).toEqual([]);+ });+it('collapses casing/spacing variants of a POV name into one holder', () => {const findings = runPov([scene('Aria'), scene(' aria '), scene('ARIA')],