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): project storyboard.shots fingerprint to fields the check reads

Adam Eivy46e788a4e058
diff --git a/server/services/pipeline/editorial/checkRunner.js b/server/services/pipeline/editorial/checkRunner.js
index 696f55dc80..cf278eb42d 100644
--- a/server/services/pipeline/editorial/checkRunner.js
+++ b/server/services/pipeline/editorial/checkRunner.js
@@ -82,10 +82,13 @@ const SOURCE_RESOLVERS = {
// — fingerprint the whole array so any arc/transition edit stales the findings.
'series.characterArcs': ({ series }) => canonicalStringify(series?.characterArcs ?? null),
// The per-issue storyboard shot lists the visual.shot-continuity check reads
- // (#1315). Built off the already-loaded issues (no extra I/O); fingerprint the
- // flattened `{ issueNumber, scene }` list so any shot edit (framing, direction,
- // continuity link) stales the finding. Over-eager-but-safe, like reverseOutline.
- 'storyboard.shots': ({ storyboardScenes }) => canonicalStringify(storyboardScenes ?? null),
+ // (#1315). Fingerprint ONLY the fields the check actually reads (scene
+ // heading/slugline + each shot's grammar fields) via `projectStoryboardContinuity`
+ // — NOT the whole scene object, so an unrelated render/status edit
+ // (`imageJobId`, `sceneVideoJobId`, wardrobe metadata) doesn't falsely stale a
+ // continuity finding. Mirrors `projectComicLetteringContent` for the comic check.
+ 'storyboard.shots': ({ storyboardScenes }) =>
+ canonicalStringify(projectStoryboardContinuity(storyboardScenes) ?? null),
// Every issue's AUTHORITATIVE comic lettering content, keyed by issue number
// (#1313). The lettering-density check reads the edited comic-pages split (or the
// generated script when unsplit) — NOT the prose manuscript — so it gets its own
@@ -115,6 +118,29 @@ function collectStoryboardScenes(issues) {
return out;
}
+// Project the collected storyboard scenes down to ONLY the fields the
+// visual.shot-continuity check reads (#1315), for the staleness fingerprint —
+// the scene's heading/slugline (its finding location) and each shot's grammar
+// fields (`id`, `continuityFromShotId`, `screenDirection`, `shotType`,
+// `description` — the anchorQuote source). Excludes render/status fields
+// (`imageJobId`, `sceneVideoJobId`, wardrobe, …) so a finding stales only when
+// the shot grammar it analyzed changes, not on an unrelated render. Mirrors
+// `projectComicLetteringContent`. Type-guarded throughout (scenes ride peer sync).
+function projectStoryboardContinuity(storyboardScenes) {
+ return (Array.isArray(storyboardScenes) ? storyboardScenes : []).map(({ issueNumber, scene }) => ({
+ issueNumber: Number.isInteger(issueNumber) ? issueNumber : null,
+ heading: typeof scene?.heading === 'string' ? scene.heading : '',
+ slugline: typeof scene?.slugline === 'string' ? scene.slugline : '',
+ shots: (Array.isArray(scene?.shots) ? scene.shots : []).map((s) => ({
+ id: typeof s?.id === 'string' ? s.id : '',
+ continuityFromShotId: typeof s?.continuityFromShotId === 'string' ? s.continuityFromShotId : null,
+ screenDirection: typeof s?.screenDirection === 'string' ? s.screenDirection : null,
+ shotType: typeof s?.shotType === 'string' ? s.shotType : null,
+ description: typeof s?.description === 'string' ? s.description : '',
+ })),
+ }));
+}
+
// Project the loaded issues down to the lettering-relevant comic content the check
// analyzes, via the registry's shared `comicLetteringIssues` (so the fingerprint
// can't drift from what `run` reads). Keeps ONLY caption/dialogue/SFX — the fields
diff --git a/server/services/pipeline/editorial/checkRunner.test.js b/server/services/pipeline/editorial/checkRunner.test.js
index 8791011f09..cc38574021 100644
--- a/server/services/pipeline/editorial/checkRunner.test.js
+++ b/server/services/pipeline/editorial/checkRunner.test.js
@@ -441,6 +441,38 @@ describe('getReviewWithStaleness (#1345)', () => {
expect(review.comments.find((c) => c.checkId === 'naming.dissimilar-names').stale).toBe(false);
});
+ it('keeps a storyboard-continuity finding fresh after an unrelated render edit (#1315 projection)', async () => {
+ // The fingerprint must project to only the fields the check reads (shot
+ // grammar + heading/slugline) — a render/status edit (sceneVideoJobId,
+ // imageJobId) on the same scene must NOT stale the continuity finding.
+ issuesState = [{
+ id: 'i1', seriesId: 's1', number: 1,
+ stages: { storyboards: { scenes: [{
+ heading: 'INT. THRONE ROOM',
+ shots: [
+ { id: 'shot-01', description: 'left', screenDirection: 'left' },
+ { id: 'shot-02', description: 'right', screenDirection: 'right', continuityFromShotId: 'shot-01' },
+ ],
+ }] } },
+ }];
+ await seedReviewFromRun();
+ expect(reviewState.comments.find((c) => c.checkId === 'visual.shot-continuity')).toBeTruthy();
+ // Same shot grammar; only a render artifact + per-shot job id changed.
+ issuesState = [{
+ id: 'i1', seriesId: 's1', number: 1,
+ stages: { storyboards: { scenes: [{
+ heading: 'INT. THRONE ROOM',
+ sceneVideoJobId: 'job-rendered-42',
+ shots: [
+ { id: 'shot-01', description: 'left', screenDirection: 'left', startFrameJobId: 'frame-9' },
+ { id: 'shot-02', description: 'right', screenDirection: 'right', continuityFromShotId: 'shot-01', startFrameJobId: 'frame-10' },
+ ],
+ }] } },
+ }];
+ const review = await getReviewWithStaleness('s1');
+ expect(review.comments.find((c) => c.checkId === 'visual.shot-continuity').stale).toBe(false);
+ });
+
it('keeps a scene finding fresh when the manuscript changes (reverseOutline-only source)', async () => {
outlineState = { scenes: [{ id: 'scene-001', issueNumber: 1, heading: 'Talking heads', anchorQuote: 'q', components: { narrative: false, action: false, dialogue: true } }] };
await seedReviewFromRun();