@anvpx/motion-build 0.1.48 → 0.1.49

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,8 @@
1
+ import type { LintRule } from "./types.ts";
2
+ /**
3
+ * Density: a beat earns its seconds by carrying evidence, not by carrying a sentence.
4
+ * The rule measures labelled marks — every title, label, cell, step and note — and refuses
5
+ * the two-mark frame on a long-form board. An authored scene declares `props.elements`,
6
+ * because its content lives in its own files; an undeclared plate is uncountable, not dense.
7
+ */
8
+ export declare const contentDensityRule: LintRule;
@@ -0,0 +1,69 @@
1
+ import { CUSTOM_SCENE_TYPE, LONGFORM_MEAN_FLOOR, LONGFORM_SECONDS, sceneDensity, } from "@anvpx/motion-scenes";
2
+ const describe = (elements, type) => `carries ${elements} labelled mark${elements === 1 ? "" : "s"} on screen`;
3
+ /**
4
+ * Density: a beat earns its seconds by carrying evidence, not by carrying a sentence.
5
+ * The rule measures labelled marks — every title, label, cell, step and note — and refuses
6
+ * the two-mark frame on a long-form board. An authored scene declares `props.elements`,
7
+ * because its content lives in its own files; an undeclared plate is uncountable, not dense.
8
+ */
9
+ export const contentDensityRule = ({ storyboard, timeline }) => {
10
+ const findings = [];
11
+ let total = 0;
12
+ let counted = 0;
13
+ let uncounted = 0;
14
+ storyboard.scenes.forEach((scene, index) => {
15
+ if (scene.layer === "overlay")
16
+ return;
17
+ const { elements, declared, floor } = sceneDensity(scene.props ?? {}, scene.type);
18
+ if (!declared) {
19
+ uncounted += 1;
20
+ if (scene.type !== CUSTOM_SCENE_TYPE)
21
+ return;
22
+ findings.push({
23
+ severity: "warning",
24
+ path: `/scenes/${index}/props/elements`,
25
+ message: "an authored scene's frames cannot be counted; declare props.elements (the number of labelled marks it draws)",
26
+ suggestion: `add "elements": 8 to the scene props, or accept that density is unverifiable here`,
27
+ });
28
+ return;
29
+ }
30
+ // A frame with no copy at all is an image beat, not a thin one: this rule judges copy.
31
+ if (elements === 0)
32
+ return;
33
+ total += elements;
34
+ counted += 1;
35
+ // Catalog beats answer to the board mean: their copy is visible to other rules and to
36
+ // review. An authored plate has no countable copy, so its own declaration is judged here.
37
+ if (scene.type !== CUSTOM_SCENE_TYPE)
38
+ return;
39
+ if (elements >= floor)
40
+ return;
41
+ findings.push({
42
+ severity: "warning",
43
+ path: `/scenes/${index}/props`,
44
+ message: `scene "${scene.id}" ${describe(elements, scene.type)}; a ${scene.type} beat holds at least ${floor} — add evidence, not adjectives`,
45
+ suggestion: `name one more thing the viewer can see (a label, a count, a measured strip) or fold this beat into its neighbour`,
46
+ });
47
+ });
48
+ const totalSec = timeline.scenes.reduce((sum, scene) => sum + scene.duration, 0);
49
+ if (counted > 0 && totalSec >= LONGFORM_SECONDS) {
50
+ const mean = total / counted;
51
+ if (mean < LONGFORM_MEAN_FLOOR) {
52
+ findings.push({
53
+ severity: "error",
54
+ path: "/scenes",
55
+ message: `long-form board (${Math.round(totalSec)}s) averages ${mean.toFixed(1)} labelled marks per beat across ${counted} beats; ${LONGFORM_SECONDS}s or more needs >= ${LONGFORM_MEAN_FLOOR}`,
56
+ suggestion: "give each beat a second and third mark (a diagram, a count, a measured strip) or cut the runtime",
57
+ });
58
+ }
59
+ }
60
+ if (uncounted > 0 && counted === 0 && totalSec >= LONGFORM_SECONDS) {
61
+ findings.push({
62
+ severity: "error",
63
+ path: "/scenes",
64
+ message: `long-form board (${Math.round(totalSec)}s) has no countable beats: every authored scene is missing props.elements`,
65
+ suggestion: "declare props.elements on each authored scene so density can be checked",
66
+ });
67
+ }
68
+ return findings;
69
+ };
@@ -1,3 +1,4 @@
1
+ import { contentDensityRule } from "./content-density.ts";
1
2
  import { contentOverflowRule } from "./content-overflow.ts";
2
3
  import { fadeDeckRule } from "./fade-deck.ts";
3
4
  import { flowEdgeLabelRule, flowTextSizeRule, flowWordBreakRule } from "./flow.ts";
@@ -19,7 +20,7 @@ import { duplicatedEmphasisRule, lineLengthRule, offGridSpacingRule, typeDensity
19
20
  import type { LintInput, LintResult, LintRule } from "./types.ts";
20
21
  import { wordsOnScreenRule } from "./words-on-screen.ts";
21
22
  export type { LintFinding, LintInput, LintResult, LintRule, PlatformMarginLookup, PlatformMargins, } from "./types.ts";
22
- export { contentOverflowRule, duplicatedEmphasisRule, fadeDeckRule, flatMotionRule, flowEdgeLabelRule, flowTextSizeRule, flowWordBreakRule, holdAfterAccentRule, hookFirstRule, linearEaseRule, lineLengthRule, longHoldRule, minHoldRule, narrationPaceRule, offGridSpacingRule, overlayFitRule, overlayStackRule, overlayTargetRule, plateOverCaptionRule, readingTimeRule, safeZone9x16Rule, spanNeedsTwoBodiesRule, textFloorRule, transitionEaseMismatchRule, transitionImplementedRule, transitionLengthRule, typeDensityRule, unsupportedMotionRule, wordsOnScreenRule, };
23
+ export { contentDensityRule, contentOverflowRule, duplicatedEmphasisRule, fadeDeckRule, flatMotionRule, flowEdgeLabelRule, flowTextSizeRule, flowWordBreakRule, holdAfterAccentRule, hookFirstRule, linearEaseRule, lineLengthRule, longHoldRule, minHoldRule, narrationPaceRule, offGridSpacingRule, overlayFitRule, overlayStackRule, overlayTargetRule, plateOverCaptionRule, readingTimeRule, safeZone9x16Rule, spanNeedsTwoBodiesRule, textFloorRule, transitionEaseMismatchRule, transitionImplementedRule, transitionLengthRule, typeDensityRule, unsupportedMotionRule, wordsOnScreenRule, };
23
24
  /**
24
25
  * All rules, in report order. Contrast lives in theme tokens.
25
26
  * Craft rules (motion-craft, type-grid) run after the timing and layout
@@ -1,3 +1,4 @@
1
+ import { contentDensityRule } from "./content-density.js";
1
2
  import { contentOverflowRule } from "./content-overflow.js";
2
3
  import { fadeDeckRule } from "./fade-deck.js";
3
4
  import { flowEdgeLabelRule, flowTextSizeRule, flowWordBreakRule } from "./flow.js";
@@ -18,7 +19,7 @@ import { transitionImplementedRule } from "./transition-implemented.js";
18
19
  import { transitionLengthRule } from "./transition-length.js";
19
20
  import { duplicatedEmphasisRule, lineLengthRule, offGridSpacingRule, typeDensityRule, } from "./type-grid.js";
20
21
  import { wordsOnScreenRule } from "./words-on-screen.js";
21
- export { contentOverflowRule, duplicatedEmphasisRule, fadeDeckRule, flatMotionRule, flowEdgeLabelRule, flowTextSizeRule, flowWordBreakRule, holdAfterAccentRule, hookFirstRule, linearEaseRule, lineLengthRule, longHoldRule, minHoldRule, narrationPaceRule, offGridSpacingRule, overlayFitRule, overlayStackRule, overlayTargetRule, plateOverCaptionRule, readingTimeRule, safeZone9x16Rule, spanNeedsTwoBodiesRule, textFloorRule, transitionEaseMismatchRule, transitionImplementedRule, transitionLengthRule, typeDensityRule, unsupportedMotionRule, wordsOnScreenRule, };
22
+ export { contentDensityRule, contentOverflowRule, duplicatedEmphasisRule, fadeDeckRule, flatMotionRule, flowEdgeLabelRule, flowTextSizeRule, flowWordBreakRule, holdAfterAccentRule, hookFirstRule, linearEaseRule, lineLengthRule, longHoldRule, minHoldRule, narrationPaceRule, offGridSpacingRule, overlayFitRule, overlayStackRule, overlayTargetRule, plateOverCaptionRule, readingTimeRule, safeZone9x16Rule, spanNeedsTwoBodiesRule, textFloorRule, transitionEaseMismatchRule, transitionImplementedRule, transitionLengthRule, typeDensityRule, unsupportedMotionRule, wordsOnScreenRule, };
22
23
  /**
23
24
  * All rules, in report order. Contrast lives in theme tokens.
24
25
  * Craft rules (motion-craft, type-grid) run after the timing and layout
@@ -44,6 +45,7 @@ export const LINT_RULES = [
44
45
  narrationPaceRule,
45
46
  hookFirstRule,
46
47
  safeZone9x16Rule,
48
+ contentDensityRule,
47
49
  contentOverflowRule,
48
50
  plateOverCaptionRule,
49
51
  fadeDeckRule,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anvpx/motion-build",
3
- "version": "0.1.48",
3
+ "version": "0.1.49",
4
4
  "description": "Storyboard compiler for @anvpx/motion: validation, scene emission and HyperFrames project output.",
5
5
  "license": "MIT",
6
6
  "author": "anvpx",
@@ -31,9 +31,9 @@
31
31
  "@fontsource/jetbrains-mono": "5.3.0",
32
32
  "@fontsource/source-serif-4": "5.3.1",
33
33
  "@fontsource/space-grotesk": "5.3.0",
34
- "@anvpx/motion-scenes": "0.1.48",
35
- "@anvpx/motion-schema": "0.1.48",
36
- "@anvpx/motion-themes": "0.1.48",
34
+ "@anvpx/motion-scenes": "0.1.49",
35
+ "@anvpx/motion-schema": "0.1.49",
36
+ "@anvpx/motion-themes": "0.1.49",
37
37
  "postprocessing": "6.39.5",
38
38
  "three": "0.186.0"
39
39
  },