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 (claude): document monotony floor, drop dead totalShots, note dup-id resolution

Adam Eivy2a3d934a1d96
diff --git a/server/lib/editorial/checkRegistry.js b/server/lib/editorial/checkRegistry.js
index be851a37b5..481a75da2c 100644
--- a/server/lib/editorial/checkRegistry.js
+++ b/server/lib/editorial/checkRegistry.js
@@ -1819,6 +1819,8 @@ export const EDITORIAL_CHECKS = [
// Flag a scene where every classified shot shares one framing. 0 disables
// the monotony check; otherwise it's the minimum classified-shot count
// before a single-framing scene is flagged (a sparse 2-shot tag is noise).
+ // The primitive floors this at 2 — a single classified shot is never
+ // "monotony" — so 1 behaves identically to 2.
minShotsForMonotony: z.number().int().min(0).max(16).default(3),
}),
configFields: [
@@ -1835,7 +1837,7 @@ export const EDITORIAL_CHECKS = [
min: 0,
max: 16,
step: 1,
- help: 'Flag a scene where every classified shot shares one framing (all medium, say) once at least this many shots are classified. 0 disables the monotony check.',
+ help: 'Flag a scene where every classified shot shares one framing (all medium, say) once at least this many shots are classified. 0 disables the monotony check; the minimum effective value is 2 (1 is treated as 2).',
},
],
// Needs at least one storyboard scene with shots to read.
diff --git a/server/lib/editorial/shotContinuity.js b/server/lib/editorial/shotContinuity.js
index 0a13adb474..91ff1676c3 100644
--- a/server/lib/editorial/shotContinuity.js
+++ b/server/lib/editorial/shotContinuity.js
@@ -57,6 +57,10 @@ function sceneShots(scene) {
export function findAxisReversals(scene) {
const shots = sceneShots(scene);
if (shots.length < 2) return [];
+ // Shot ids are unique on the extract path (sanitizeShot synthesizes them) but
+ // the route doesn't enforce cross-shot uniqueness, so a hand-edited scene could
+ // carry a duplicate id — last-wins here, matching how a continuity ref would
+ // resolve anyway. Acceptable under the check's high-precision / under-flag design.
const byId = new Map();
for (const s of shots) {
if (s && typeof s === 'object' && typeof s.id === 'string' && s.id) byId.set(s.id, s);
@@ -94,8 +98,9 @@ export function findAxisReversals(scene) {
* (so a 2-of-5 partial tag never trips it).
*
* @param {object} scene
- * @param {{ minClassified?: number }} [opts] minClassified default 3
- * @returns {{ shotType: string, classifiedCount: number, totalShots: number } | null}
+ * @param {{ minClassified?: number }} [opts] minClassified — floored at 2 (a
+ * single classified shot is never "monotony"); default 3.
+ * @returns {{ shotType: string, classifiedCount: number } | null}
*/
export function findShotTypeMonotony(scene, opts = {}) {
const minClassified = Math.max(2, Number.isInteger(opts.minClassified) ? opts.minClassified : 3);
@@ -107,5 +112,5 @@ export function findShotTypeMonotony(scene, opts = {}) {
if (types.length < minClassified) return null;
const first = types[0];
if (!types.every((t) => t === first)) return null;
- return { shotType: first, classifiedCount: types.length, totalShots: shots.length };
+ return { shotType: first, classifiedCount: types.length };
}
diff --git a/server/lib/editorial/shotContinuity.test.js b/server/lib/editorial/shotContinuity.test.js
index fe17963152..e44f173add 100644
--- a/server/lib/editorial/shotContinuity.test.js
+++ b/server/lib/editorial/shotContinuity.test.js
@@ -79,7 +79,7 @@ describe('findShotTypeMonotony', () => {
{ id: 'c', shotType: 'medium' },
],
};
- expect(findShotTypeMonotony(scene)).toMatchObject({ shotType: 'medium', classifiedCount: 3, totalShots: 3 });
+ expect(findShotTypeMonotony(scene)).toMatchObject({ shotType: 'medium', classifiedCount: 3 });
});
it('does NOT flag a varied scene', () => {
@@ -105,7 +105,7 @@ describe('findShotTypeMonotony', () => {
// Only 2 classified, default minClassified is 3 → not enough confidence.
expect(findShotTypeMonotony(scene)).toBe(null);
// Lowering the threshold flags the all-medium classified pair.
- expect(findShotTypeMonotony(scene, { minClassified: 2 })).toMatchObject({ shotType: 'medium', classifiedCount: 2, totalShots: 4 });
+ expect(findShotTypeMonotony(scene, { minClassified: 2 })).toMatchObject({ shotType: 'medium', classifiedCount: 2 });
});
it('ignores unclassified shots when judging monotony', () => {