Skip to content

armgit / raea

Public Imported from GitHub
0

Render Anything Engine: tell your AI what to make. Videos, motion graphics, 3D and games as React and TypeScript, rendered on your own GPU. Rust + Bevy, macOS, Linux and Windows.

MK25: the cut gates as their own crate, runtime/cut-plan, reading shape through io/soft's probe

shinyobjectz21859a5a31f2
diff --git a/Cargo.lock b/Cargo.lock
index 287a6e78..d934db83 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -13896,6 +13896,7 @@ dependencies = [
"raea-core-facts",
"raea-core-review",
"raea-io-home",
+ "raea-runtime-cut-plan",
"raea-runtime-lod-plan",
"resvg 0.48.1",
"serde_json",
@@ -15294,6 +15295,15 @@ dependencies = [
"raea-io-home",
]
+[[package]]
+name = "raea-runtime-cut-plan"
+version = "0.1.0"
+dependencies = [
+ "raea-core-brief",
+ "raea-io-soft",
+ "serde_json",
+]
+
[[package]]
name = "raea-runtime-dom"
version = "0.1.0"
diff --git a/Cargo.toml b/Cargo.toml
index c7f183ac..7f2c5bb6 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -194,6 +194,7 @@ members = [
"runtime/export",
"runtime/endchecks",
"runtime/lod-plan",
+ "runtime/cut-plan",
"runtime/live",
"runtime/page",
"runtime/appscreen",
diff --git a/apps/make/Cargo.toml b/apps/make/Cargo.toml
index 49b604a0..089b838c 100644
--- a/apps/make/Cargo.toml
+++ b/apps/make/Cargo.toml
@@ -13,6 +13,8 @@ raea-core-brief = { path = "../../core/brief" }
raea-core-facts = { path = "../../core/facts" }
# the parts a render showed closer than their planned detail (MK24)
raea-runtime-lod-plan = { path = "../../runtime/lod-plan" }
+# a cut job's gates: its client's brief as rules, held over the delivered files (MK25-MK27)
+raea-runtime-cut-plan = { path = "../../runtime/cut-plan" }
# the judge's rounds, passes and blocking defects, read as it keeps them
raea-app-judge = { path = "../judge" }
# the make questions, their calibrations and a sheet's ident, as raea ask keeps them (MK4)
diff --git a/apps/make/src/lib.rs b/apps/make/src/lib.rs
index 66d75d7e..4f7d2761 100644
--- a/apps/make/src/lib.rs
+++ b/apps/make/src/lib.rs
@@ -6,11 +6,9 @@
//! raea make plan|refs|sheet refs|gen|pick-sheet|pick|prep|kit|framing|lenschart ... (the steps, USAGE)
pub mod asked;
-pub mod cut;
pub mod floor;
pub mod kit;
pub mod kitout;
-pub mod mp4;
pub mod plan;
pub mod sheet;
pub mod shots;
@@ -214,5 +212,3 @@ pub fn cli(args: &[String]) -> Result<String, String> {
mod tests;
#[cfg(test)]
mod tests_steps;
-#[cfg(test)]
-mod tests_cut;
diff --git a/apps/make/src/mp4.rs b/apps/make/src/mp4.rs
deleted file mode 100644
index adbcf05a..00000000
--- a/apps/make/src/mp4.rs
+++ /dev/null
@@ -1,97 +0,0 @@
-//! A delivered cut's length and frame size, read from its own MP4 or MOV boxes (moov/mvhd and the video track's
-//! tkhd), so `raea make status` holds a cut's shape with no decoder: a file re-encoded after its render (a loudness
-//! pass) is read as it is now.
-
-use std::path::Path;
-
-/// Seconds, and the video track's width and height as displayed (a rotated phone take reads upright).
-#[derive(Debug, Clone, Copy, PartialEq)]
-pub struct Shape {
- pub seconds: f64,
- pub w: u32,
- pub h: u32,
-}
-
-fn be32(b: &[u8], at: usize) -> Option<u32> {
- Some(u32::from_be_bytes(b.get(at..at + 4)?.try_into().ok()?))
-}
-fn be64(b: &[u8], at: usize) -> Option<u64> {
- Some(u64::from_be_bytes(b.get(at..at + 8)?.try_into().ok()?))
-}
-
-/// The boxes in `b`: (kind, body).
-fn boxes(b: &[u8]) -> Vec<(&[u8], &[u8])> {
- let mut out = Vec::new();
- let mut at = 0;
- while at + 8 <= b.len() {
- let Some(size) = be32(b, at) else { break };
- let kind = &b[at + 4..at + 8];
- let (head, len) = match size {
- 1 => (16, be64(b, at + 8).unwrap_or(0) as usize),
- 0 => (8, b.len() - at),
- n => (8, n as usize),
- };
- if len < head || at + len > b.len() {
- break;
- }
- out.push((kind, &b[at + head..at + len]));
- at += len;
- }
- out
-}
-
-/// The moov box's bytes: read from the file's top level, skipping mdat (the media) without reading it.
-fn moov(path: &Path) -> Option<Vec<u8>> {
- use std::io::{Read, Seek, SeekFrom};
- let mut f = std::fs::File::open(path).ok()?;
- let end = f.metadata().ok()?.len();
- let mut at = 0u64;
- while at + 8 <= end {
- let mut head = [0u8; 16];
- f.seek(SeekFrom::Start(at)).ok()?;
- f.read_exact(&mut head[..8]).ok()?;
- let size = u32::from_be_bytes(head[..4].try_into().ok()?) as u64;
- let (skip, len) = match size {
- 1 => {
- f.read_exact(&mut head[8..16]).ok()?;
- (16, u64::from_be_bytes(head[8..16].try_into().ok()?))
- }
- 0 => (8, end - at),
- n => (8, n),
- };
- if len < skip {
- return None;
- }
- if &head[4..8] == b"moov" {
- let mut body = vec![0u8; (len - skip) as usize];
- f.seek(SeekFrom::Start(at + skip)).ok()?;
- f.read_exact(&mut body).ok()?;
- return Some(body);
- }
- at += len;
- }
- None
-}
-
-/// The file's length and its video's displayed size; None when it isn't an MP4 or MOV with a video track.
-pub fn shape(path: &Path) -> Option<Shape> {
- let moov = moov(path)?;
- let top = boxes(&moov);
- let mvhd = top.iter().find(|(k, _)| *k == b"mvhd")?.1;
- // version 1 has 64-bit times: timescale at 20, duration at 24; version 0: 12 and 16
- let seconds = if mvhd.first() == Some(&1) { be64(mvhd, 24)? as f64 / be32(mvhd, 20)?.max(1) as f64 } else { be32(mvhd, 16)? as f64 / be32(mvhd, 12)?.max(1) as f64 };
- for (_, trak) in top.iter().filter(|(k, _)| *k == b"trak") {
- let inner = boxes(trak);
- let Some((_, tkhd)) = inner.iter().find(|(k, _)| *k == b"tkhd") else { continue };
- // width and height are 16.16 fixed point at the end of tkhd; the matrix before them says a turn
- let n = tkhd.len();
- let (w, h) = (be32(tkhd, n - 8)? >> 16, be32(tkhd, n - 4)? >> 16);
- if w == 0 || h == 0 {
- continue;
- }
- let a = be32(tkhd, n - 44)? as i32;
- let turned = a == 0;
- return Some(if turned { Shape { seconds, w: h, h: w } } else { Shape { seconds, w, h } });
- }
- None
-}
diff --git a/apps/make/src/status.rs b/apps/make/src/status.rs
index 58010a19..c7218537 100644
--- a/apps/make/src/status.rs
+++ b/apps/make/src/status.rs
@@ -198,7 +198,7 @@ pub fn status(job: &Job) -> Value {
let mut gates = checks(job);
if job.make.kind == make::Kind::Cut {
// the brief's rules over every delivered file (MK25-MK27); its critic is the person's review for now
- gates.extend(job.make.cut.as_ref().map(|c| crate::cut::gates(c, job.dir)).unwrap_or_default());
+ gates.extend(job.make.cut.iter().flat_map(|c| raea_runtime_cut_plan::gates(c, job.dir)).map(|g| gate(g.name, g.of.as_deref(), g.clear, g.says)));
} else {
gates.extend(lods(job, &notes));
gates.extend(critic(job, newest, &notes));
diff --git a/apps/make/src/tests_cut.rs b/apps/make/src/tests_cut.rs
deleted file mode 100644
index 011e085e..00000000
--- a/apps/make/src/tests_cut.rs
+++ /dev/null
@@ -1,206 +0,0 @@
-//! A cut job held to its brief (MK25-MK27): the contract's doctor, the quotes, the count and open items, and each
-//! delivered file's shape, words and frames, on fixtures written here (an MP4 is only its moov box).
-
-use std::path::{Path, PathBuf};
-use std::time::{Duration, SystemTime};
-
-use raea_core_brief::{cut, make::Make, read};
-use serde_json::{Value, json};
-
-use crate::asked::Ledger;
-use crate::mp4;
-use crate::status::{Job, status};
-
-fn dir(name: &str) -> PathBuf {
- let d = std::env::temp_dir().join(format!("raea-make-cut-{name}-{}", std::process::id()));
- let _ = std::fs::remove_dir_all(&d);
- std::fs::create_dir_all(&d).unwrap();
- d
-}
-
-fn put(d: &Path, rel: &str, bytes: &[u8]) -> PathBuf {
- let p = d.join(rel);
- std::fs::create_dir_all(p.parent().unwrap()).unwrap();
- std::fs::write(&p, bytes).unwrap();
- p
-}
-
-/// `p` as changed `secs` from now (a report written after its video is newer than it)
-fn touch(p: &Path, secs: i64) {
- let t = if secs >= 0 { SystemTime::now() + Duration::from_secs(secs as u64) } else { SystemTime::now() - Duration::from_secs((-secs) as u64) };
- std::fs::File::options().write(true).open(p).unwrap().set_modified(t).unwrap();
-}
-
-fn bx(kind: &[u8; 4], body: &[u8]) -> Vec<u8> {
- let mut v = ((body.len() + 8) as u32).to_be_bytes().to_vec();
- v.extend_from_slice(kind);
- v.extend_from_slice(body);
- v
-}
-
-/// An MP4 that is only its boxes: `seconds` long, a w x h video track, turned a quarter when `turned`.
-fn mp4_bytes(seconds: f64, w: u32, h: u32, turned: bool) -> Vec<u8> {
- let mut mvhd = vec![0u8; 100];
- mvhd[12..16].copy_from_slice(&1000u32.to_be_bytes());
- mvhd[16..20].copy_from_slice(&((seconds * 1000.0) as u32).to_be_bytes());
- let mut tkhd = vec![0u8; 84];
- let (a, b): (u32, u32) = if turned { (0, 0x0001_0000) } else { (0x0001_0000, 0) };
- tkhd[40..44].copy_from_slice(&a.to_be_bytes());
- tkhd[44..48].copy_from_slice(&b.to_be_bytes());
- tkhd[76..80].copy_from_slice(&(w << 16).to_be_bytes());
- tkhd[80..84].copy_from_slice(&(h << 16).to_be_bytes());
- let moov = bx(b"moov", &[bx(b"mvhd", &mvhd), bx(b"trak", &bx(b"tkhd", &tkhd))].concat());
- [bx(b"ftyp", b"isom\0\0\0\0"), bx(b"mdat", &[0u8; 64]), moov].concat()
-}
-
-const BRIEF: &str = "Deliverables: 10 total videos (4 solos / 1 mashup per angle).\nUse the phrase \"free, fun, and easy.\"\nDon't let it read as White Elephant.\nEnd on the CTA: \"Make your Wishlist and organize your Gift Exchange on Elfster. It's free.\"\nCTV specs from the client [TO CONFIRM]\n";
-
-fn contract(extra: &str) -> Make {
- read(
- "make",
- &format!(
- r#"{{"kind": "cut", "cut": {{"brief": "media/brief.txt", "count": {{"value": 2, "from": "10 total videos"}}, "seconds": [20, 30], "formats": ["9:16"],
- "cuts": [{{"id": "a1_s1", "angle": "1", "hook": "Direct Problem", "text": "captions"}}, {{"id": "a1_s2"}}],
- "say": [{{"text": "free, fun, and easy", "from": "Use the phrase \"free, fun, and easy.\""}}],
- "never": [{{"text": "white elephant", "from": "Don't let it read as White Elephant."}}],
- "cta": {{"text": "Make your Wishlist and organize your Gift Exchange on Elfster. It's free.", "from": "End on the CTA"}}{extra}}}}}"#
- ),
- )
- .unwrap()
-}
-
-fn run(make: &Make, d: &Path) -> Value {
- status(&Job { make, dir: d, project: None, record: &[], rounds: &[], verdict: None, judged_at: None, ledger: &Ledger::default(), score_gates: false })
-}
-
-fn gates<'a>(s: &'a Value, name: &str) -> Vec<&'a Value> {
- s["gates"].as_array().unwrap().iter().filter(|g| g["gate"] == name).collect()
-}
-
-/// Words said evenly from 0.5 s, one every 0.6 s, as `raea words` writes them.
-fn words(line: &str) -> String {
- let w: Vec<Value> = line.split_whitespace().enumerate().map(|(i, t)| json!({"text": t, "start": 0.5 + i as f64 * 0.6, "end": 0.8 + i as f64 * 0.6})).collect();
- serde_json::to_string(&w).unwrap()
-}
-
-/// A delivered file with its words and frames check written after it.
-fn deliver(d: &Path, id: &str, said: &str, frame_errors: &[&str]) {
- let f = put(d, &format!("out/cuts/{id}_9x16.mp4"), &mp4_bytes(said.split_whitespace().count() as f64 * 0.6 + 1.0, 1080, 1920, false));
- touch(&f, -60);
- put(d, &format!("out/cuts/{id}_9x16.words.json"), words(said).as_bytes());
- let findings: Vec<Value> = frame_errors.iter().map(|e| json!({"level": "error", "kind": "face-cut", "says": e})).collect();
- put(d, &format!("out/cuts/{id}_9x16.frames-check.json"), json!({"findings": findings}).to_string().as_bytes());
-}
-
-const GOOD: &str = "So it draws the names for you it's free fun and easy to set up and everyone makes a wishlist so nobody draws their own name ever again Make your Wishlist and organize your Gift Exchange on Elfster It's free";
-
-#[test]
-fn the_contract_is_read_and_doctored() {
- let m = contract("");
- assert_eq!(m.kind, raea_core_brief::make::Kind::Cut);
- assert_eq!(raea_core_brief::make::deliverables(&m), vec!["out/cuts/a1_s1_9x16.mp4", "out/cuts/a1_s2_9x16.mp4"]);
- assert!(raea_core_brief::make::doctor(&m).is_empty(), "{:?}", raea_core_brief::make::doctor(&m));
- let bad: Make = read("make", r#"{"kind": "cut", "cut": {"brief": "b.txt", "cuts": [{"id": "A-1", "formats": ["tall"], "text": "both"}], "say": [{"text": "x", "from": ""}]}}"#).unwrap();
- let d = raea_core_brief::make::doctor(&bad).join("\n");
- for want in ["no `count`", "no `cta`", "ids are [a-z0-9_]", "isn't W:H", "no length", "captions, hook or none", "has no `from`"] {
- assert!(d.contains(want), "{want} in\n{d}");
- }
- let none: Make = read("make", r#"{"kind": "cut"}"#).unwrap();
- assert!(raea_core_brief::make::doctor(&none).iter().any(|x| x.contains("no `cut`")));
- assert_eq!(cut::norm("24/7 Virtual Vet Care. It’s free!"), "24 7 virtual vet care its free");
-}
-
-#[test]
-fn every_rule_quotes_the_brief() {
- let d = dir("quotes");
- let s = run(&contract(""), &d);
- assert!(gates(&s, "quotes")[0]["says"].as_str().unwrap().contains("no brief text"));
- put(&d, "media/brief.txt", BRIEF.as_bytes());
- assert_eq!(gates(&run(&contract(""), &d), "quotes")[0]["clear"], true);
- // a rule the brief doesn't say, or says in other words, is held
- let invented = contract(r#", "open": [{"question": "Which code?", "from": "the offer is PETS99"}]"#);
- let s = run(&invented, &d);
- let g = gates(&s, "quotes")[0];
- assert_eq!(g["clear"], false);
- assert!(g["says"].as_str().unwrap().contains("Which code?"), "{g}");
-}
-
-#[test]
-fn the_count_and_open_items_hold_the_job() {
- let d = dir("count");
- put(&d, "media/brief.txt", BRIEF.as_bytes());
- let mut m = contract("");
- m.cut.as_mut().unwrap().count.as_mut().unwrap().value = 10;
- assert_eq!(gates(&run(&m, &d), "count")[0]["clear"], false);
- let mut asked = contract(r#", "open": [{"question": "Only 2 interviews came: cut 2?", "from": "10 total videos", "about": "count"}]"#);
- asked.cut.as_mut().unwrap().count.as_mut().unwrap().value = 10;
- let s = run(&asked, &d);
- assert_eq!(gates(&s, "count")[0]["clear"], false, "an open item without its answer doesn't excuse the count");
- assert!(gates(&s, "open")[0]["says"].as_str().unwrap().starts_with("unanswered"));
- let o = &mut asked.cut.as_mut().unwrap().open[0];
- o.answer = Some("yes, the 2 we have".into());
- o.by = Some("Shane".into());
- let s = run(&asked, &d);
- assert_eq!(gates(&s, "count")[0]["clear"], true);
- assert_eq!(gates(&s, "open")[0]["clear"], true);
-}
-
-#[test]
-fn a_delivered_cut_is_held_to_its_words_shape_and_frames() {
- let d = dir("files");
- put(&d, "media/brief.txt", BRIEF.as_bytes());
- put(&d, "NOTES.md", b"## What the skill got wrong\n- nothing\n");
- let m = contract("");
- let s = run(&m, &d);
- assert_eq!(s["done"], false);
- assert_eq!(s["missing"].as_array().unwrap().len(), 2, "{s}");
- deliver(&d, "a1_s1", GOOD, &[]);
- deliver(&d, "a1_s2", GOOD, &[]);
- let s = run(&m, &d);
- assert_eq!(s["done"], true, "{}", crate::status::text(&s));
- // a banned phrase heard, the CTA cut, a phrase missing, a face cut
- deliver(&d, "a1_s2", "we did a white elephant swap last year and it was chaos so we tried something new", &["a face is cut by the left edge from 4.0 s to 5.5 s"]);
- let s = run(&m, &d);
- assert_eq!(s["done"], false);
- let of = |name: &str| gates(&s, name).into_iter().find(|g| g["of"] == "out/cuts/a1_s2_9x16.mp4").unwrap().clone();
- assert!(of("never")["says"].as_str().unwrap().contains("\"white elephant\" heard at 2.3 s"), "{}", of("never"));
- assert_eq!(of("say")["clear"], false);
- assert_eq!(of("cta")["clear"], false);
- assert!(of("frames")["says"].as_str().unwrap().contains("left edge"));
- // the wrong shape, and a report from before the file's last change
- let f = put(&d, "out/cuts/a1_s1_9x16.mp4", &mp4_bytes(45.0, 1920, 1080, false));
- touch(&f, 60);
- let s = run(&m, &d);
- let shape = gates(&s, "shape").into_iter().find(|g| g["of"] == "out/cuts/a1_s1_9x16.mp4").unwrap().clone();
- assert!(shape["says"].as_str().unwrap().contains("1920x1080 isn't 9:16") && shape["says"].as_str().unwrap().contains("45.0 s isn't 20-30 s"), "{shape}");
- let words = gates(&s, "words").into_iter().find(|g| g["of"] == "out/cuts/a1_s1_9x16.mp4").unwrap().clone();
- assert!(words["says"].as_str().unwrap().contains("changed after it"), "{words}");
-}
-
-#[test]
-fn an_mp4_is_measured_from_its_boxes() {
- let d = dir("mp4");
- let f = put(&d, "a.mp4", &mp4_bytes(29.5, 1080, 1920, false));
- assert_eq!(mp4::shape(&f), Some(mp4::Shape { seconds: 29.5, w: 1080, h: 1920 }));
- // a phone take stored sideways and turned by its matrix reads as shown
- let f = put(&d, "b.mov", &mp4_bytes(12.0, 1920, 1080, true));
- assert_eq!(mp4::shape(&f), Some(mp4::Shape { seconds: 12.0, w: 1080, h: 1920 }));
- assert_eq!(mp4::shape(&put(&d, "c.mp4", b"not a video")), None);
-}
-
-#[test]
-fn heard_the_way_people_say_it() {
- // Gemini's Elfster A1 solo (11-25): the transcript splits "Wishlist" and the speaker fills the phrase out
- let d = dir("said");
- put(&d, "media/brief.txt", BRIEF.as_bytes());
- let m = contract("");
- let line = "so it draws the names for you and everyone gets a gift they want It's free it's fun and it's easy so set it up tonight with your whole family Make your wish list and organize your gift exchange on Elfster It's free";
- deliver(&d, "a1_s1", line, &[]);
- let s = run(&m, &d);
- let of = |s: &Value, name: &str| gates(s, name).into_iter().find(|g| g["of"] == "out/cuts/a1_s1_9x16.mp4").unwrap().clone();
- assert_eq!(of(&s, "say")["clear"], true, "{}", of(&s, "say"));
- assert_eq!(of(&s, "cta")["clear"], true, "{}", of(&s, "cta"));
- // the brief's order is the phrase: "fun, free and easy" isn't it
- deliver(&d, "a1_s1", &line.replace("It's free it's fun", "It's fun it's free"), &[]);
- assert_eq!(of(&run(&m, &d), "say")["clear"], false);
-}
diff --git a/core/brief/src/cut.rs b/core/brief/src/cut.rs
index f86f1b42..a3b6513a 100644
--- a/core/brief/src/cut.rs
+++ b/core/brief/src/cut.rs
@@ -141,15 +141,16 @@ pub fn deliverables(c: &Cut) -> Vec<String> {
/// Every `from` in the contract, with what it backs: the quotes `raea make status` finds in the brief's text.
pub fn quotes(c: &Cut) -> Vec<(String, &str)> {
let mut q: Vec<(String, &str)> = Vec::new();
- if let Some(n) = &c.count {
- q.push(("count".into(), &n.from));
+ q.extend(c.count.iter().map(|n| ("count".to_string(), n.from.as_str())));
+ for (what, list) in [("say", &c.say), ("never", &c.never)] {
+ for p in list {
+ q.push((format!("{what} \"{}\"", p.text), &p.from));
+ }
}
- q.extend(c.say.iter().map(|p| (format!("say \"{}\"", p.text), p.from.as_str())));
- q.extend(c.never.iter().map(|p| (format!("never \"{}\"", p.text), p.from.as_str())));
- if let Some(cta) = &c.cta {
- q.push(("cta".into(), &cta.from));
+ q.extend(c.cta.iter().map(|t| ("cta".to_string(), t.from.as_str())));
+ for o in &c.open {
+ q.push((format!("open \"{}\"", o.question), &o.from));
}
- q.extend(c.open.iter().map(|o| (format!("open \"{}\"", o.question), o.from.as_str())));
q
}
@@ -173,7 +174,7 @@ pub fn doctor(c: &Cut) -> Vec<String> {
if !seen.insert(p.id.as_str()) {
out.push(format!("cut `{}` is listed twice", p.id));
}
- if p.id.is_empty() || !p.id.chars().all(|ch| ch.is_ascii_lowercase() || ch.is_ascii_digit() || ch == '_') {
+ if !crate::make::is_name(&p.id) {
out.push(format!("cut `{}`: ids are [a-z0-9_], the file it lands as", p.id));
}
let fs = formats(c, p);
@@ -199,8 +200,10 @@ pub fn doctor(c: &Cut) -> Vec<String> {
out.push(format!("{what} has no `from`: the brief's own words for it"));
}
}
- for p in c.say.iter().chain(&c.never).filter(|p| norm(&p.text).is_empty()) {
- out.push(format!("phrase `{}` has no letters or digits to find", p.text));
+ for p in c.say.iter().chain(&c.never) {
+ if norm(&p.text).is_empty() {
+ out.push(format!("phrase `{}` has no letters or digits to find", p.text));
+ }
}
out
}
diff --git a/core/brief/src/make.rs b/core/brief/src/make.rs
index 11e431fc..51269389 100644
--- a/core/brief/src/make.rs
+++ b/core/brief/src/make.rs
@@ -227,6 +227,11 @@ pub fn deliverables(m: &Make) -> Vec<String> {
}
}
+/// A name a file lands as: [a-z0-9_], not empty.
+pub fn is_name(s: &str) -> bool {
+ !s.is_empty() && s.chars().all(|c| c.is_ascii_lowercase() || c.is_ascii_digit() || c == '_')
+}
+
/// What the plan still lacks before it can be built against, each with what to do. Empty when it's ready.
pub fn doctor(m: &Make) -> Vec<String> {
let mut out = Vec::new();
@@ -273,7 +278,7 @@ pub fn doctor(m: &Make) -> Vec<String> {
if !names.insert(s.name.as_str()) {
out.push(format!("shot `{}` is listed twice", s.name));
}
- if !s.name.chars().all(|c| c.is_ascii_lowercase() || c.is_ascii_digit() || c == '_') {
+ if !is_name(&s.name) {
out.push(format!("shot `{}`: names are [a-z0-9_], the file it lands as", s.name));
}
if s.composition.is_none() {
diff --git a/docs/manual/reference/sdk/brief.md b/docs/manual/reference/sdk/brief.md
index 6018bdc9..319a253e 100644
--- a/docs/manual/reference/sdk/brief.md
+++ b/docs/manual/reference/sdk/brief.md
@@ -30,10 +30,10 @@ See [Workspaces and projects](../../concepts/workspaces.md) for where each spec
<!-- generated:begin by tools/manual-ref/sdk.ts from the SDK's exports and doc comments; edit outside this block -->
```ts
-import { brief, fingerprint, kit, parts } from "raea/brief"
+import { brief, cut, fingerprint, kit } from "raea/brief"
```
-`raea/brief` exports 8 functions, 34 types. Source: [sdk/raea/src/brief.ts](https://github.com/shinyobjectz/raea/blob/main/sdk/raea/src/brief.ts).
+`raea/brief` exports 9 functions, 40 types. Source: [sdk/raea/src/brief.ts](https://github.com/shinyobjectz/raea/blob/main/sdk/raea/src/brief.ts).
## Functions
@@ -46,6 +46,14 @@ the project's plan.org.
function brief(b: Brief): Brief
```
+### `cut`
+
+ads cut from footage to a client's brief: `cut: {...}` is the brief as rules, each quoting it
+
+```ts
+function cut(m: Omit<Make, "kind">): Make
+```
+
### `fingerprint`
A fingerprint (fingerprint.ts): its axes and the encoders its heads were trained on.
@@ -205,6 +213,24 @@ type Line = { /** * a character, or "narrator" */ who: string, says: string, /**
type Make = { kind: MakeKind, /** * the pictures the job answers to (paths beside the brief): what is in it and where for a scene, the style for a kit */ references?: Array<string>, /** * one paragraph every reference prompt carries: era, palette, materials, wear, and one fictional maker */ style?: string, /…
```
+### `MakeCta`
+
+```ts
+type MakeCta = { text: string, from: string, /** * how near the end it must land, in seconds (8 when left out) */ within?: number, }
+```
+
+### `MakeCut`
+
+```ts
+type MakeCut = { /** * the brief as text, relative to brief.ts (`pdftotext -layout brief.pdf media/brief.txt`): every `from` is found in it */ brief: string, /** * how many cuts the brief asks for; fewer planned is held open until an answered `open` item about "count" says why */ count?: MakeQuoted<number>, /**…
+```
+
+### `MakeCutPlan`
+
+```ts
+type MakeCutPlan = { /** * [a-z0-9_], unique: each format lands as out/cuts/<id>_<W>x<H>.mp4 ("a1_s1_9x16.mp4") */ id: string, angle?: string, /** * solo or mashup */ kind?: string, /** * one of the brief's hook types ("Direct Problem", "Reaction") */ hook?: string, /** * captions, hook (a text hook) or none */ tex…
+```
+
### `MakeDial`
```ts
@@ -220,7 +246,7 @@ type MakeDialValue = number | string
### `MakeKind`
```ts
-type MakeKind = "scene" | "kit" | "shot"
+type MakeKind = "scene" | "kit" | "shot" | "cut"
```
### `MakeObject`
@@ -229,18 +255,36 @@ type MakeKind = "scene" | "kit" | "shot"
type MakeObject = { /** * snake_case, unique in the job */ id: string, label: string, /** * real height in metres */ h?: number, /** * [width, depth, height] in metres, for boxy things (generators invent depth) */ dims?: [number, number, number], /** * largest extent in metres, for things that lie flat (tools, pap…
```
+### `MakeOpen`
+
+```ts
+type MakeOpen = { question: string, from: string, /** * what it decides: "count", "cta", "offer", a cut's id... */ about?: string, /** * the person's answer, as they gave it, and who gave it: until then the job can't be done */ answer?: string, by?: string, }
+```
+
### `MakeOrigin`
```ts
type MakeOrigin = "reference" | "invented"
```
+### `MakePhrase`
+
+```ts
+type MakePhrase = { /** * as it's said or shown; compared in lower case, by letters and digits ("24/7" and "24-7" are the same) */ text: string, from: string, /** * `say` only: false when one cut saying it is enough */ every?: boolean, }
+```
+
### `MakePick`
```ts
type MakePick = { /** * "tripo-h31", "meshy", ... */ generator: string, /** * one line: why this one ("sharper dial numerals; Tripo fused the handset to the cradle") */ why: string, }
```
+### `MakeQuoted`
+
+```ts
+type MakeQuoted = { value: T, /** * the brief's own words, as they are in its text */ from: string, }
+```
+
### `MakeRoute`
```ts
diff --git a/docs/manual/reference/sdk/index.md b/docs/manual/reference/sdk/index.md
index ca89b1b6..d787c0da 100644
--- a/docs/manual/reference/sdk/index.md
+++ b/docs/manual/reference/sdk/index.md
@@ -33,7 +33,7 @@ The composition, the app, and the specs and notes an agent writes.
| --- | --- | --- |
| [`raea`](raea.md) | The main entry: compositions, sequences, time, interpolation, springs, footage, sound and words. | 21 components, 9 hooks, 65 functions, 11 values, 109 types |
| [`raea/app`](app.md) | The App, its plugins and schedules, and the registry a video's compositions are kept in. | 1 component, 1 hook, 5 functions, 3 classes, 17 values, 18 types |
-| [`raea/brief`](brief.md) | The specs an agent writes as data: brief, script, taste and an object's parts, checked against raea's schemas. | 8 functions, 34 types |
+| [`raea/brief`](brief.md) | The specs an agent writes as data: brief, script, taste and an object's parts, checked against raea's schemas. | 9 functions, 40 types |
| [`raea/note`](note.md) | A person's note as a file in the project: their words kept as written, and the asks the agent restates it as. | 1 function, 4 types |
## Time and motion
diff --git a/runtime/cut-plan/Cargo.toml b/runtime/cut-plan/Cargo.toml
new file mode 100644
index 00000000..0bcaa6c6
--- /dev/null
+++ b/runtime/cut-plan/Cargo.toml
@@ -0,0 +1,14 @@
+[package]
+name = "raea-runtime-cut-plan"
+version = "0.1.0"
+edition = "2024"
+license = "FSL-1.1-ALv2"
+publish = false
+description = "A cut job held to its client's brief: every rule quoting the brief, the count and open items, and each delivered file's shape, words heard, banned phrases, CTA and frames check, from what's on disk (docs/make.feature MK25-MK27)"
+
+[dependencies]
+# the contract: `make: cut({...})` on brief.ts
+raea-core-brief = { path = "../../core/brief" }
+# a delivered file's size and length from its header boxes, the media never read
+raea-io-soft = { path = "../../io/soft" }
+serde_json = "1"
diff --git a/apps/make/src/cut.rs b/runtime/cut-plan/src/lib.rs
similarity index 88%
rename from apps/make/src/cut.rs
rename to runtime/cut-plan/src/lib.rs
index 11abf515..c26d32f8 100644
--- a/apps/make/src/cut.rs
+++ b/runtime/cut-plan/src/lib.rs
@@ -6,23 +6,27 @@
//! its last change (FILE.frames-check.json, `raea frames check`), with no face cut and no text too small.
use std::path::{Path, PathBuf};
-use std::time::SystemTime;
use raea_core_brief::cut::{self, Cut, norm};
-use serde_json::{Value, json};
+use serde_json::Value;
-use crate::mp4;
+/// One gate as `raea make status` lists it: its name, the file or item it's about, whether it's clear, what it says.
+#[derive(Debug, Clone, PartialEq)]
+pub struct Gate {
+ pub name: &'static str,
+ pub of: Option<String>,
+ pub clear: bool,
+ pub says: String,
+}
-fn gate(name: &str, of: Option<&str>, clear: bool, says: String) -> Value {
- let mut g = json!({"gate": name, "clear": clear, "says": says});
- if let Some(of) = of {
- g["of"] = json!(of);
- }
- g
+fn gate(name: &'static str, of: Option<&str>, clear: bool, says: String) -> Gate {
+ Gate { name, of: of.map(str::to_string), clear, says }
}
-fn mtime(p: &Path) -> Option<SystemTime> {
- std::fs::metadata(p).ok()?.modified().ok()
+/// A delivered file's width, height and seconds, from its header boxes (io/soft's probe: the media isn't read, and a
+/// file re-encoded after its render is read as it is now).
+fn shape(f: &Path) -> Option<(u32, u32, f64)> {
+ raea_io_soft::probe(f).ok().map(|p| (p.width.round() as u32, p.height.round() as u32, p.secs))
}
/// FILE.words.json, FILE.frames-check.json, FILE.render.json beside FILE.mp4.
@@ -34,8 +38,9 @@ fn beside(f: &Path, ext: &str) -> PathBuf {
/// about it now): Ok(json), or Err(why not).
fn fresh(f: &Path, ext: &str, run: &str) -> Result<Value, String> {
let r = beside(f, ext);
- let Some(at) = mtime(&r) else { return Err(format!("never run: {run}")) };
- if mtime(f).is_some_and(|m| m > at) {
+ let changed = |p: &Path| std::fs::metadata(p).and_then(|m| m.modified()).ok();
+ let Some(at) = changed(&r) else { return Err(format!("never run: {run}")) };
+ if changed(f).is_some_and(|m| m > at) {
return Err(format!("the file changed after it: {run} again"));
}
std::fs::read_to_string(&r).ok().and_then(|s| serde_json::from_str(&s).ok()).ok_or_else(|| format!("{} isn't JSON: {run} again", r.display()))
@@ -135,23 +140,23 @@ fn in_order(want: &[&str], got: &[&str]) -> f64 {
const CTA_SHARE: f64 = 0.85;
/// One delivered file's gates: shape, words (say, never, cta) and frames.
-fn file_gates(c: &Cut, plan: &cut::CutPlan, format: &str, f: &Path, rel: &str, said: &mut Vec<(usize, String)>) -> Vec<Value> {
+fn file_gates(c: &Cut, plan: &cut::CutPlan, format: &str, f: &Path, rel: &str, said: &mut Vec<(usize, String)>) -> Vec<Gate> {
let mut out = Vec::new();
- let shape = mp4::shape(f);
+ let shape = shape(f);
match (shape, cut::ratio(format), cut::seconds(c, plan)) {
(None, ..) => out.push(gate("shape", Some(rel), false, "not an MP4 or MOV with a video track".into())),
- (Some(s), Some((rw, rh)), len) => {
+ (Some((w, h, secs)), Some((rw, rh)), len) => {
let mut wrong = Vec::new();
- let (want, got) = (rw as f64 / rh as f64, s.w as f64 / s.h as f64);
+ let (want, got) = (rw as f64 / rh as f64, w as f64 / h.max(1) as f64);
if (got / want - 1.0).abs() > 0.02 {
- wrong.push(format!("{}x{} isn't {format}", s.w, s.h));
+ wrong.push(format!("{w}x{h} isn't {format}"));
}
if let Some([a, b]) = len
- && (s.seconds + 0.05 < a || s.seconds > b + 0.05)
+ && (secs + 0.05 < a || secs > b + 0.05)
{
- wrong.push(format!("{:.1} s isn't {a}-{b} s", s.seconds));
+ wrong.push(format!("{secs:.1} s isn't {a}-{b} s"));
}
- out.push(gate("shape", Some(rel), wrong.is_empty(), if wrong.is_empty() { format!("{}x{}, {:.1} s", s.w, s.h, s.seconds) } else { wrong.join("; ") }));
+ out.push(gate("shape", Some(rel), wrong.is_empty(), if wrong.is_empty() { format!("{w}x{h}, {secs:.1} s") } else { wrong.join("; ") }));
}
_ => {}
}
@@ -181,7 +186,7 @@ fn file_gates(c: &Cut, plan: &cut::CutPlan, format: &str, f: &Path, rel: &str, s
out.push(gate("never", Some(rel), banned.is_empty(), if banned.is_empty() { "says and shows none of the banned phrases".into() } else { banned.join("; ") }));
if let Some(cta) = &c.cta {
let within = cta.within.unwrap_or(cut::CTA_WITHIN);
- let end = shape.map(|s| s.seconds).or_else(|| words.last().map(|w| w.2)).unwrap_or(0.0);
+ let end = shape.map(|s| s.2).or_else(|| words.last().map(|w| w.2)).unwrap_or(0.0);
let want_s = norm(&cta.text);
let want: Vec<&str> = want_s.split(' ').collect();
let share = |got: &[&str]| {
@@ -214,7 +219,7 @@ fn file_gates(c: &Cut, plan: &cut::CutPlan, format: &str, f: &Path, rel: &str, s
}
/// The cut job's gates over its brief folder `dir`.
-pub fn gates(c: &Cut, dir: &Path) -> Vec<Value> {
+pub fn gates(c: &Cut, dir: &Path) -> Vec<Gate> {
let mut out = Vec::new();
// the quotes: each rule is backed by the brief's own words
match std::fs::read_to_string(dir.join(&c.brief)) {
@@ -252,3 +257,6 @@ pub fn gates(c: &Cut, dir: &Path) -> Vec<Value> {
}
out
}
+
+#[cfg(test)]
+mod tests;
diff --git a/runtime/cut-plan/src/tests.rs b/runtime/cut-plan/src/tests.rs
new file mode 100644
index 00000000..dc8d9fa0
--- /dev/null
+++ b/runtime/cut-plan/src/tests.rs
@@ -0,0 +1,182 @@
+//! A cut job held to its brief (MK25-MK27): the contract's doctor, the quotes, the count and open items, and each
+//! delivered file's shape, words and frames. The delivered file is raea's 3 s 320x180 test clip.
+
+use std::path::{Path, PathBuf};
+use std::time::{Duration, SystemTime};
+
+use raea_core_brief::{cut, make::Make, read};
+use serde_json::{Value, json};
+
+use crate::{Gate, gates};
+
+const CLIP: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/../../engine/rune/media/tests/fixtures/clip.mp4");
+
+fn dir(name: &str) -> PathBuf {
+ let d = std::env::temp_dir().join(format!("raea-cut-plan-{name}-{}", std::process::id()));
+ let _ = std::fs::remove_dir_all(&d);
+ std::fs::create_dir_all(&d).unwrap();
+ d
+}
+
+fn put(d: &Path, rel: &str, bytes: &[u8]) -> PathBuf {
+ let p = d.join(rel);
+ std::fs::create_dir_all(p.parent().unwrap()).unwrap();
+ std::fs::write(&p, bytes).unwrap();
+ p
+}
+
+/// `p` as changed `secs` from now (a report written after its video is newer than it)
+fn touch(p: &Path, secs: i64) {
+ let t = if secs >= 0 { SystemTime::now() + Duration::from_secs(secs as u64) } else { SystemTime::now() - Duration::from_secs((-secs) as u64) };
+ std::fs::File::options().write(true).open(p).unwrap().set_modified(t).unwrap();
+}
+
+const BRIEF: &str = "Deliverables: 10 total videos (4 solos / 1 mashup per angle).\nUse the phrase \"free, fun, and easy.\"\nDon't let it read as White Elephant.\nEnd on the CTA: \"Make your Wishlist and organize your Gift Exchange on Elfster. It's free.\"\nCTV specs from the client [TO CONFIRM]\n";
+
+fn contract(extra: &str) -> Make {
+ read(
+ "make",
+ &format!(
+ r#"{{"kind": "cut", "cut": {{"brief": "media/brief.txt", "count": {{"value": 2, "from": "10 total videos"}}, "seconds": [2, 4], "formats": ["16:9"],
+ "cuts": [{{"id": "a1_s1", "angle": "1", "hook": "Direct Problem", "text": "captions"}}, {{"id": "a1_s2"}}],
+ "say": [{{"text": "free, fun, and easy", "from": "Use the phrase \"free, fun, and easy.\""}}],
+ "never": [{{"text": "white elephant", "from": "Don't let it read as White Elephant."}}],
+ "cta": {{"text": "Make your Wishlist and organize your Gift Exchange on Elfster. It's free.", "from": "End on the CTA"}}{extra}}}}}"#
+ ),
+ )
+ .unwrap()
+}
+
+fn run(m: &Make, d: &Path) -> Vec<Gate> {
+ gates(m.cut.as_ref().unwrap(), d)
+}
+
+fn named<'a>(g: &'a [Gate], name: &str) -> Vec<&'a Gate> {
+ g.iter().filter(|g| g.name == name).collect()
+}
+
+fn of(g: &[Gate], name: &str, file: &str) -> Gate {
+ g.iter().find(|g| g.name == name && g.of.as_deref() == Some(file)).unwrap_or_else(|| panic!("no {name} gate of {file}")).clone()
+}
+
+/// Words said evenly from 0.5 s, one every 0.6 s, as `raea words` writes them.
+fn words(line: &str) -> String {
+ let w: Vec<Value> = line.split_whitespace().enumerate().map(|(i, t)| json!({"text": t, "start": 0.5 + i as f64 * 0.6, "end": 0.8 + i as f64 * 0.6})).collect();
+ serde_json::to_string(&w).unwrap()
+}
+
+/// A delivered file (the test clip) with its words and frames check written after it.
+fn deliver(d: &Path, file: &str, said: &str, frame_errors: &[&str]) {
+ let f = put(d, file, &std::fs::read(CLIP).unwrap());
+ touch(&f, -60);
+ let stem = file.trim_end_matches(".mp4");
+ put(d, &format!("{stem}.words.json"), words(said).as_bytes());
+ let findings: Vec<Value> = frame_errors.iter().map(|e| json!({"level": "error", "kind": "face-cut", "says": e})).collect();
+ put(d, &format!("{stem}.frames-check.json"), json!({"findings": findings}).to_string().as_bytes());
+}
+
+const GOOD: &str = "So it draws the names for you it's free fun and easy to set up and everyone makes a wishlist so nobody draws their own name ever again Make your Wishlist and organize your Gift Exchange on Elfster It's free";
+const S1: &str = "out/cuts/a1_s1_16x9.mp4";
+const S2: &str = "out/cuts/a1_s2_16x9.mp4";
+
+#[test]
+fn the_contract_is_read_and_doctored() {
+ let m = contract("");
+ assert_eq!(m.kind, raea_core_brief::make::Kind::Cut);
+ assert_eq!(raea_core_brief::make::deliverables(&m), vec![S1, S2]);
+ assert!(raea_core_brief::make::doctor(&m).is_empty(), "{:?}", raea_core_brief::make::doctor(&m));
+ let bad: Make = read("make", r#"{"kind": "cut", "cut": {"brief": "b.txt", "cuts": [{"id": "A-1", "formats": ["tall"], "text": "both"}], "say": [{"text": "x", "from": ""}]}}"#).unwrap();
+ let d = raea_core_brief::make::doctor(&bad).join("\n");
+ for want in ["no `count`", "no `cta`", "ids are [a-z0-9_]", "isn't W:H", "no length", "captions, hook or none", "has no `from`"] {
+ assert!(d.contains(want), "{want} in\n{d}");
+ }
+ let none: Make = read("make", r#"{"kind": "cut"}"#).unwrap();
+ assert!(raea_core_brief::make::doctor(&none).iter().any(|x| x.contains("no `cut`")));
+ assert_eq!(cut::norm("24/7 Virtual Vet Care. It’s free!"), "24 7 virtual vet care its free");
+}
+
+#[test]
+fn every_rule_quotes_the_brief() {
+ let d = dir("quotes");
+ assert!(named(&run(&contract(""), &d), "quotes")[0].says.contains("no brief text"));
+ put(&d, "media/brief.txt", BRIEF.as_bytes());
+ assert!(named(&run(&contract(""), &d), "quotes")[0].clear);
+ // a rule the brief doesn't say, or says in other words, is held
+ let invented = contract(r#", "open": [{"question": "Which code?", "from": "the offer is PETS99"}]"#);
+ let g = run(&invented, &d);
+ assert!(!named(&g, "quotes")[0].clear);
+ assert!(named(&g, "quotes")[0].says.contains("Which code?"), "{:?}", named(&g, "quotes"));
+}
+
+#[test]
+fn the_count_and_open_items_hold_the_job() {
+ let d = dir("count");
+ put(&d, "media/brief.txt", BRIEF.as_bytes());
+ let mut m = contract("");
+ m.cut.as_mut().unwrap().count.as_mut().unwrap().value = 10;
+ assert!(!named(&run(&m, &d), "count")[0].clear);
+ let mut asked = contract(r#", "open": [{"question": "Only 2 interviews came: cut 2?", "from": "10 total videos", "about": "count"}]"#);
+ asked.cut.as_mut().unwrap().count.as_mut().unwrap().value = 10;
+ let g = run(&asked, &d);
+ assert!(!named(&g, "count")[0].clear, "an open item without its answer doesn't excuse the count");
+ assert!(named(&g, "open")[0].says.starts_with("unanswered"));
+ let o = &mut asked.cut.as_mut().unwrap().open[0];
+ o.answer = Some("yes, the 2 we have".into());
+ o.by = Some("Shane".into());
+ let g = run(&asked, &d);
+ assert!(named(&g, "count")[0].clear && named(&g, "open")[0].clear);
+}
+
+#[test]
+fn a_delivered_cut_is_held_to_its_words_shape_and_frames() {
+ let d = dir("files");
+ put(&d, "media/brief.txt", BRIEF.as_bytes());
+ let m = contract("");
+ deliver(&d, S1, GOOD, &[]);
+ deliver(&d, S2, GOOD, &[]);
+ let g = run(&m, &d);
+ assert!(g.iter().all(|g| g.clear), "{g:#?}");
+ assert_eq!(of(&g, "shape", S1).says, "320x180, 3.0 s");
+ // a banned phrase heard, the CTA cut, a phrase missing, a face cut
+ deliver(&d, S2, "we did a white elephant swap last year and it was chaos so we tried something new", &["a face is cut by the left edge from 4.0 s to 5.5 s"]);
+ let g = run(&m, &d);
+ assert!(of(&g, "never", S2).says.contains("\"white elephant\" heard at 2.3 s"), "{:?}", of(&g, "never", S2));
+ assert!(!of(&g, "say", S2).clear && !of(&g, "cta", S2).clear);
+ assert!(of(&g, "frames", S2).says.contains("left edge"));
+ // a report from before the file's last change says nothing about it now
+ touch(&d.join(S1), 60);
+ let g = run(&m, &d);
+ assert!(of(&g, "words", S1).says.contains("changed after it"), "{:?}", of(&g, "words", S1));
+ assert!(of(&g, "frames", S1).says.contains("changed after it"));
+}
+
+#[test]
+fn the_wrong_shape_is_named() {
+ let d = dir("shape");
+ put(&d, "media/brief.txt", BRIEF.as_bytes());
+ let mut m = contract("");
+ let p = &mut m.cut.as_mut().unwrap().cuts[0];
+ p.formats = vec!["9:16".into()];
+ p.seconds = Some([20.0, 30.0]);
+ deliver(&d, "out/cuts/a1_s1_9x16.mp4", GOOD, &[]);
+ let says = of(&run(&m, &d), "shape", "out/cuts/a1_s1_9x16.mp4").says;
+ assert!(says.contains("320x180 isn't 9:16") && says.contains("3.0 s isn't 20-30 s"), "{says}");
+ put(&d, "out/cuts/a1_s1_9x16.mp4", b"not a video");
+ assert!(!of(&run(&m, &d), "shape", "out/cuts/a1_s1_9x16.mp4").clear);
+}
+
+#[test]
+fn heard_the_way_people_say_it() {
+ // Gemini's Elfster A1 solo (11-25): the transcript splits "Wishlist" and the speaker fills the phrase out
+ let d = dir("said");
+ put(&d, "media/brief.txt", BRIEF.as_bytes());
+ let m = contract("");
+ let line = "so it draws the names for you and everyone gets a gift they want It's free it's fun and it's easy so set it up tonight with your whole family Make your wish list and organize your gift exchange on Elfster It's free";
+ deliver(&d, S1, line, &[]);
+ let g = run(&m, &d);
+ assert!(of(&g, "say", S1).clear, "{:?}", of(&g, "say", S1));
+ assert!(of(&g, "cta", S1).clear, "{:?}", of(&g, "cta", S1));
+ // the brief's order is the phrase: "fun, free and easy" isn't it
+ deliver(&d, S1, &line.replace("It's free it's fun", "It's fun it's free"), &[]);
+ assert!(!of(&run(&m, &d), "say", S1).clear);
+}
diff --git a/sdk/guides/craft/modes/pitch.md b/sdk/guides/craft/modes/pitch.md
index a8d2e05c..15131e5c 100644
--- a/sdk/guides/craft/modes/pitch.md
+++ b/sdk/guides/craft/modes/pitch.md
@@ -35,10 +35,11 @@ is only context, and context gets lost. Run `pdftotext -layout BRIEF.pdf media/b
Every rule carries `from`, the brief's own words for it, copied exactly. `raea make status` finds each one in
media/brief.txt, so a rule can't be made up and a line can't be paraphrased away. Then it holds every file at
-out/cuts/ID_WxH.mp4: its shape and length; its words (`raea words FILE`, run after its last change) for each `say`,
-`never` and the CTA; and its frames check (`raea frames check FILE` on raea cloud; `frames: false` where there is
-none). The job isn't done, and the Stop hook won't let you end, until every gate is clear and every `open` item has
-the person's answer, written in with who gave it.
+out/cuts/ID_WxH.mp4: its shape and length; its words (FILE.words.json, newer than the file: raea cloud writes it
+after every render) for each `say`, `never` and the CTA; and its frames check (FILE.frames-check.json, newer than
+the file: raea cloud's measured faces and text sizes; `frames: false` where there is none). The job isn't done, and
+the Stop hook won't let you end, until every gate is clear and every `open` item has the person's answer, written in
+with who gave it.
## The decisions
diff --git a/tools/layers.toml b/tools/layers.toml
index cc15699b..37d011fd 100644
--- a/tools/layers.toml
+++ b/tools/layers.toml
@@ -189,6 +189,7 @@ raea-runtime-world = "runtime"
raea-runtime-encode = "runtime"
raea-runtime-endchecks = "runtime"
raea-runtime-lod-plan = "runtime" # MK21: a part planned far or as a grey box that a shot shows closer than its plan
+raea-runtime-cut-plan = "runtime" # MK25: a cut job held to its client's brief, from the files on disk
raea-runtime-plugins = "runtime"
raea-runtime-live = "runtime"
raea-runtime-look = "runtime"