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 P2): fire role-distribution signals on a lone speaker (#1594)
[._.]/ Adam Eivy4337de26c131
diff --git a/server/lib/editorial/checkRegistry.js b/server/lib/editorial/checkRegistry.jsindex 90127ef407..b91025b271 100644--- a/server/lib/editorial/checkRegistry.js+++ b/server/lib/editorial/checkRegistry.js@@ -2864,8 +2864,14 @@ export const EDITORIAL_CHECKS = [.filter((id) => id.matcher).map((id) => ({ key: id.key, matcher: id.matcher }));const { byOwner, attributed } = attributeDialogueByOwner(manuscript, owners);- if (attributed >= minDialogueLines && byOwner.size >= 2) {- if (wantShare) {+ if (attributed >= minDialogueLines) {+ // The top-speaker share signal compares one voice against the others, so+ // it needs 2+ speakers to mean anything. The role-relative signals do NOT:+ // a lone minor speaking every line (size 1, 100% share) or a major who+ // appears yet never speaks while a single other voice carries the scene is+ // their STRONGEST case — gating those on size >= 2 would skip exactly the+ // imbalance they exist to catch.+ if (wantShare && byOwner.size >= 2) {let topKey = null;let topCount = 0;for (const [key, count] of byOwner) {diff --git a/server/lib/editorial/checkRegistry.test.js b/server/lib/editorial/checkRegistry.test.jsindex 8a15be8b35..df9bad5767 100644--- a/server/lib/editorial/checkRegistry.test.js+++ b/server/lib/editorial/checkRegistry.test.js@@ -4694,6 +4694,32 @@ describe('cast.representation-balance — deterministic check (#1312)', () => {expect(silentMajor(findings)).toBeUndefined();});+ it('fires the role-relative signal even when one speaker holds all the dialogue (#1594)', () => {+ // The top-speaker share signal needs 2+ speakers, but a lone minor speaking+ // every line is the STRONGEST minor-dominating case — it must not be gated out.+ const canon = {+ characters: [+ { name: 'Bram', role: 'cameo' },+ { name: 'Aria', role: 'protagonist' },+ ],+ };+ const content = [+ '"One," said Bram.',+ '"Two," said Bram.',+ '"Three," said Bram.',+ '"Four," said Bram.',+ '"Five," said Bram.',+ ].join('\n');+ const findings = runRep(canon, {+ sections: [sec(1, content)],+ config: only({ maxMinorShare: 0.35, minDialogueLines: 5 }),+ });+ const f = minorDom(findings);+ expect(f).toBeTruthy();+ expect(f.problem).toMatch(/100%/);+ expect(f.severity).toBe('medium'); // 100% ≥ 50% → escalated+ });+it('flags a major-role character who appears yet is oddly silent (#1594)', () => {const canon = {characters: [