mirror of
https://github.com/shinyobjectz/raea.git
synced 2026-12-01 06:53:19 -10:00
raea-sys-stage (systems/stage) reads every frame's parts through its camera at the end of every render, beside the
clipping check: RichText too small or turned too far to read, a reveal that never starts or never finishes, words not
held long enough to read (SG10); a part's size on screen jumping in one frame, and a line built as a growing chain of
parts (SG12); a camera whose speed kinks or that goes in and back out within 1.5 s (SG13); frames with almost nothing
on screen, and the shot's subject cut by the edge (SG14). RichText read={false} leaves scenery out. raea scene stage
runs the same checks without drawing; raea scene moved from raea-runtime-export into raea-app-scene so the export crate
keeps room under its 2,000 lines.
Calibrated on the mobile-ads film (13,174 frames) and 33 clean scenes: the snap check as first written said 1,446
errors on the film and 1,252 on four clean scenes, and the lurch check 48 on Stay from f32 acos noise; what was left
out is each a measured false error (pop-ins, shared names, layout edits, parts over 6 m, speeds under what can be
seen, the gap between two long moves). The film now holds 375 errors (lurches at its spline's keys, labels at 60-75
degrees, code at 3-7 px); no type or snap error on the clean scenes.
raea show refuses a file whose newest render in its project's record holds an error it wasn't let through with,
naming each (engine/cli/src/held.ts); --despite CHECK "why" passes one and the why goes on the item. A still stepped
alone (raea check --quick, render --at) is judged for what a still shows, never for reveals or reading time.
70 lines
4.1 KiB
TypeScript
70 lines
4.1 KiB
TypeScript
// `raea show` refuses a render that still holds an error (docs/stage-guards.feature SG15): the newest render that wrote
|
|
// the file, from its project's record, less what that render let through and what --despite names. The record is
|
|
// faked in memory; parseShow's side is the --despite flag itself.
|
|
import { describe, expect, test } from "bun:test";
|
|
import { held, openErrors } from "../src/held.ts";
|
|
import { parseShow } from "../src/show.ts";
|
|
|
|
const P = "/work/ads";
|
|
const error = (check: string, says = `${check} says`) => ({ check, level: "error", says });
|
|
|
|
/** A project at P whose record holds these entries, as core/facts/src/record.rs writes them. */
|
|
function records(entries: Record<string, unknown>[]) {
|
|
const files = new Map<string, string>([[`${P}/.raea/project`, ""], [`${P}/.raea/record`, ""]]);
|
|
entries.forEach((e, i) => files.set(`${P}/.raea/record/2026112${i}-000000-film.json`, JSON.stringify(e)));
|
|
return {
|
|
exists: (p: string) => files.has(p),
|
|
read: (p: string) => files.get(p) ?? "",
|
|
list: (d: string) => [...files.keys()].filter((k) => k.startsWith(`${d}/`)).map((k) => k.slice(d.length + 1)),
|
|
};
|
|
}
|
|
|
|
describe("SG15: a broken render isn't shown", () => {
|
|
test("the newest render that wrote the file holds an error: refused, the error named", () => {
|
|
const h = records([
|
|
{ at: 1, by: "raea render", out: "out/film.mp4", findings: [], despite: [] },
|
|
{ at: 2, by: "raea render", out: "out/film.mp4", findings: [error("type-small", "'Reviews' is 16 px tall"), { check: "exposure", level: "warn", says: "" }], despite: [] },
|
|
]);
|
|
const why = held([`${P}/out/film.mp4`], P, [], h);
|
|
expect(why).toContain("film.mp4: type-small: 'Reviews' is 16 px tall");
|
|
expect(why).toContain(`--despite type-small "why"`);
|
|
expect(why).not.toContain("exposure");
|
|
});
|
|
|
|
test("a later clean render clears it, and an older one doesn't count", () => {
|
|
const h = records([
|
|
{ at: 2, by: "raea render", out: "out/film.mp4", findings: [error("camera-lurch")], despite: [] },
|
|
{ at: 3, by: "raea render", out: "out/film.mp4", findings: [], despite: [] },
|
|
]);
|
|
expect(held([`${P}/out/film.mp4`], P, [], h)).toBeUndefined();
|
|
});
|
|
|
|
test("let through at the render, or with --despite: shown", () => {
|
|
const at = records([{ at: 1, by: "raea render", out: "out/film.mp4", findings: [error("frame-empty")], despite: [{ check: "frame-empty", why: "a black beat" }] }]);
|
|
expect(held([`${P}/out/film.mp4`], P, [], at)).toBeUndefined();
|
|
const h = records([{ at: 1, by: "raea render", out: "out/film.mp4", findings: [error("part-snap"), error("type-angle")], despite: [] }]);
|
|
expect(openErrors([`${P}/out/film.mp4`], P, [{ check: "part-snap", why: "a cut on the beat" }], h)).toEqual(["film.mp4: type-angle: type-angle says"]);
|
|
});
|
|
|
|
test("a still from a frames render is that render's; a file no render wrote is clear", () => {
|
|
const h = records([{ at: 1, by: "raea render", out: "out/frames", findings: [error("type-reveal")], despite: [] }]);
|
|
expect(held([`${P}/out/frames/frame-00045.png`], P, [], h)).toContain("frame-00045.png: type-reveal");
|
|
expect(held([`${P}/assets/photo.jpg`, "/tmp/elsewhere.mp4"], "/tmp", [], h)).toBeUndefined();
|
|
// a check's entry isn't a render's
|
|
const checked = records([{ at: 1, by: "raea check", out: "out/film.mp4", findings: [error("clipped")], despite: [] }]);
|
|
expect(held([`${P}/out/film.mp4`], P, [], checked)).toBeUndefined();
|
|
});
|
|
|
|
test("an absolute out, as a render outside the project writes it", () => {
|
|
const h = records([{ at: 1, by: "raea render", out: "/tmp/scratch/a.mp4", findings: [error("subject-cut")], despite: [] }]);
|
|
expect(held(["/tmp/scratch/a.mp4"], P, [], h)).toContain("a.mp4: subject-cut");
|
|
});
|
|
|
|
test("--despite takes the check and why, and neither is a file", () => {
|
|
const a = parseShow(["out/film.mp4", "--despite", "type-small", "a sign seen in passing", "--title", "Cut"], P);
|
|
expect(a.files).toEqual([`${P}/out/film.mp4`]);
|
|
expect(a.despite).toEqual([{ check: "type-small", why: "a sign seen in passing" }]);
|
|
expect(() => parseShow(["out/film.mp4", "--despite", "type-small"], P)).toThrow("--despite takes the check and why");
|
|
});
|
|
});
|