From 563f49a9783fea46bd231608ff39df0c5149c9e2 Mon Sep 17 00:00:00 2001 From: shane Date: Sat, 5 Dec 2026 08:49:49 -0800 Subject: [PATCH] One check: raea check is the only way any agent's work is checked (#335) * One check: raea check is the only way any agent's work is checked docs/check.feature (CK0-CK6). Every rule lives in one of three places: a check, a component or the SDK, or a skill or retrievable context; a rule that fits none is dropped. - raea check runs a project's goal at a moment (--at edit|render|publish|done); raea goal check still runs as its alias for older tools. raea ask, raea judge, goal seen, goal judge, goal gates and check --taste/--quick are refused, naming raea check. raea floor is raea's measures for files outside a goal. - a render's check runs once as it ends and is kept as OUT.check.json; publish and done reuse it while it is no older than the file and its manifest, and every rule says at most one line per file - the goal SDK has no seen, says, critic, record, notes, stills or surprise packs and no taste or look checks; a says rule is reported as unchecked; brief.ts holds only what the brief asks - the edit-moment hook check is gone; the Stop hook reads the kept check - (raea/video, exported from raea): words in, the brand's caption style, inside the safe area - the craft guides and AGENTS.md lose judge tiers, ask, Tone.js and framing="face" text * raea cut keeps a take's jump cuts: the second cut on a take doesn't decode it again raea media cuts decodes every frame of a take (43 s for a 4-minute take on a box), and every raea cut ran it again, so three cut lists on one take in a step ran past a box step's 3 minutes and the run stopped with nothing made. The cuts are kept in raea's cache by the take's path, size and time: a second cut on the take took 0.5 s. * The reading check reads the render's own texts from its manifest (Unrender J2) What raea drew is checked from the render manifest, never by reading frames (docs/check.feature): the reading pack takes each text's ink box from the manifest at the captions pack's step, a multi-line card sized by one line, and reads the export's frames only when no manifest is beside it. * raea/goal typechecks: a dead helper gone, shapeOf takes FileFacts' sizes, the montage test's beats are CutBeats * raea goal check takes check's flags again: the old name runs, as CK0 says The help lists check's flags under check alone, so a verb's flags read from it refused `raea goal check OUT --at render` (raea cloud's render tool) for --at. goal check's arguments are now checked as check's. * Farm: a volume reload goes next, shared and limited, so a busy farm never loses a finished render With a dozen cuts in flight, blob uploads and other requests kept the farm API's volume in use without a break. A reload waited for none of them to be in it, and GET out sat behind it past Modal's 150 s web limit (408), losing a finished cut. Now a waiting reload holds new users back, a reload that starts after a request asked serves it too, and the wait is held to 100 s and answered with a 503 the box asks again on. test/farm_gate.py runs the class from farm.py: the old gate never reloads behind a stream of users; this one does in 0.16 s. * Floor: blocky darks are an error only when the encode is measured to have added them 12-04, one-check proof: Body Shop's cut (17 Mbps) got an ERROR for blocky dark patches that its frame doesn't show at full size; the check couldn't tell the encode from the footage's own compression. Untraced, it's now a warning; the picture's own, no line. * CTA and must-say read a frame's texts together 12-04, Elfster run 4: the end card drew the CTA as two texts ("Make your Wishlist and organize your Gift Exchange on Elfster." over "It's free."), each alone under the CTA's 85% share, and a cut ending on its CTA was failed for having none. A frame's texts are now read together, in the order drawn. * Sound: a word timed longer than 2.5 s is a transcriber's slip, not a word cut in two 12-04, Elfster run 5: "secret" was timed 143.28-166.96 s, and a clip starting 15 s into it got an ERROR for cutting the word. * One line a rule a file across levels, and no lines.txt note 12-05, run 5: a cut's ERROR and WARN from the same check each took a line, and Dutch's cuts listed 11-12 lines. The worst finding of a rule now leads its one line and the rest are counted under it. The "no lines.txt beside it" note is gone: a hint, not a fault in the cut. * Farm: a composition's bundle cached on each container's own disk 12-05, run 6: a job's 32 CPU parts missed the shared bundle cache on the volume at once, each wrote the same file and committed it, and parts that read it mid-commit got zeros ("bundle.js: String contained internal null bytes"). Up to 23 of a cut's 32 parts went back to the 10 GPUs, and other jobs' frame-0 probes waited behind them. * Words: Hear on up to 4 GPUs and Align on 3 12-05, run 8: three projects' transcriptions, 8 at a time each, queued on 2 of each class. Elfster's 51 takes took 6.5 minutes and its wait for them ran past the fetch step's 4. Seven of the account's 10 GPUs at a run's start leave 3 for the cuts' first frames; the cuts themselves draw on CPUs. * Check: quotes cut by whole characters, and numbers said in words match digits 12-05, Dutch run 9: a caption quoted to 40 UTF-16 units split an emoji, and printing the report broke the check ("Conversion from string failed: invalid utf-8 sequence"). Quotes now cut by code point, and every finding is made well-formed before it's printed or saved. The same cut's caption "24-7" was called a word not said, against "twenty four seven" in the words file: the captions pack now reads numbers in words as digits on both sides. * AGENTS.md: a take cropped to another shape goes through components/Framed.tsx, never a guessed objectPosition 12-05: agents guessed each 9:16 crop and cut the speaker off at the frame's edge. * AGENTS.md: the brand paragraph in five lines A box agent starts with at most 2,500 words (docs/check.feature); this paragraph was 150 of them. * Check: a CTA said in part and shown in part lands; numbers said in words match the brief's digits Dutch run 10: the host said "use code PETS60 for sixty dollars off your first" as the end card showed "Code PETS60: $60 off your first year". Heard alone was 79% of the line and shown alone 58%, so 5 of 6 cuts got a false CTA ERROR. The heard words now take numbers in digits (as the captions check does) and the CTA counts what is heard and shown together at the end. * Check: "$60" reads as "60 dollars" in what's heard and what's captioned Dutch run 10: the transcript wrote "sixty dollars" as "$60", the caption wrote it out, and the captions check called "dollars" a word the host never said. * Captions check: the takes' own words where the edit placed them count as said The check heard the export a second time, while captions are built from the takes' own transcripts. Run 11: a second hearing wrote the take's "he heard his label paw" as "he sleep with Paul", and "That's" and "take" otherwise, so right captions read as retyped or as dropping words (4 false ERRORs over Dutch's 6 cuts). A caption's letters now count as said when either hearing has them, and words heard but uncaptioned are a fault only when the take's own words there aren't captioned either. A retyped caption is still caught. * One UI zone table for Region and the check; ERRORs only for the faults a cut's rules name - sdk/video zones.ts: the app's UI zones, the same table as the floor's zones(). Region's edges and sides keep them, so a title or caption it places is never in the zone the check holds it to (Region kept 8% at the top against the check's 220 px, and every hook title it placed was an error). - The right zone is the app's buttons, from 45% down the frame (RAIL), in the Rust floor and in the goal's floor pack for a raea from before it: a centred end card above the buttons is clear. - place: an error over a face or a sign (words in the shot); over another thing the detector names, a warning with the clear place said. - sound: a cut on sound more than 0.6 s from any word is a warning (a laugh, a noise, a missed word), not a word cut. * Sound check: a clip with no well-timed word in it isn't a line held to the others' level A take whose transcript has broken timing (a word 90 s long) made a 0.6 s pause read as a line 51 dB under the rest. * Captions take a cut's own words; AGENTS.md: captions and titles through Captions and Region, never a typed top An edit holding several cuts has one words.json, so Captions had no words for each cut and agents wrote their own captions at a typed top, in the app's UI zones. * AGENTS.md: shorter placement and Framed lines, back under the start-text limit * Composition ids take underscores: a deliverable's name is its id The naming rule names cuts client_concept_variant_v1, and registerRoot refused that id, so an agent that used the deliverable's name lost a render pass (7 minutes in one run). * Farm: the box image's SDK overlay on the release, so a render's Region keeps out of the app's zones The farm bundles each composition with its own SDK; rc4's has no zones.ts, and titles placed by Region landed at y=154, inside the top 220 px. Deployed (raea-farm, RAEA_VERSION=0.1.17-rc4). * Farm: frame 0's run commits the work folder, so a render's parts don't each rewrite styles.gen.ts at once Uncommitted, every part's container found styles.gen.ts older than the code and rewrote it on the shared volume, truncating it under the others: 14 of one cut's parts refused with "couldn't bundle edit.tsx: Unterminated string" and the cut was lost. Deployed (raea-farm, RAEA_VERSION=0.1.17-rc4). * Farm: a piece whose runs draw only stills (a game's capture) is drawn as stills and encoded on the run's GPU Every run of a playable's capture refused: the file extension .mp4 was not recognized as an image format. * check.feature: name the retired frames command without its old name (the legacy-names gate) * goal: the batch critic's test goes with the critic (one check removes raea ask) * taxonomy: Captions is raea's own name (the one-line captions component) --------- Co-authored-by: shinyobjectz --- apps/check/make/src/lib.rs | 4 +- apps/check/src/hook.rs | 43 +--- apps/check/text/src/lib.rs | 21 +- docs/check.feature | 60 +++++ engine/cli/goal/src/lib.rs | 30 ++- engine/cli/src/cli.rs | 25 +- engine/cli/src/index.ts | 41 ++- engine/cli/src/lib.rs | 5 +- engine/cli/src/native.ts | 32 ++- engine/cli/src/spec.rs | 5 - engine/cli/src/tests.rs | 3 + engine/cli/src/usage.rs | 5 + engine/cli/src/verbs.rs | 2 +- sdk/cloud/deploy/modal/farm.py | 100 +++++++- sdk/cloud/deploy/modal/words.py | 7 +- sdk/cloud/test/farm_gate.py | 104 ++++++++ sdk/goal/src/contract.ts | 61 ++--- sdk/goal/src/facts.ts | 14 -- sdk/goal/src/index.ts | 2 +- sdk/goal/src/packs/captions.ts | 94 +++++-- sdk/goal/src/packs/cut.ts | 38 ++- sdk/goal/src/packs/floor.ts | 35 ++- sdk/goal/src/packs/frames.ts | 3 +- sdk/goal/src/packs/goal.ts | 305 +---------------------- sdk/goal/src/packs/index.ts | 16 +- sdk/goal/src/packs/job.ts | 64 +---- sdk/goal/src/packs/look.ts | 86 ------- sdk/goal/src/packs/numbers.ts | 93 +++++++ sdk/goal/src/packs/place.ts | 8 +- sdk/goal/src/packs/reading.ts | 38 ++- sdk/goal/src/packs/render.ts | 34 +++ sdk/goal/src/packs/sizes.ts | 2 +- sdk/goal/src/packs/sound.ts | 19 +- sdk/goal/src/packs/taste.ts | 35 --- sdk/goal/src/packs/voice.ts | 3 +- sdk/goal/src/packs/words.ts | 2 - sdk/goal/src/run.ts | 150 +++++------ sdk/goal/src/text.ts | 15 ++ sdk/goal/test/ask-many.test.ts | 25 -- sdk/goal/test/captions.test.ts | 19 ++ sdk/goal/test/check.test.ts | 46 ++++ sdk/goal/test/contract.test.ts | 14 +- sdk/goal/test/cut.test.ts | 29 ++- sdk/goal/test/fixtures/fake-ask/raea | 5 - sdk/goal/test/floor.test.ts | 21 +- sdk/goal/test/goal.test.ts | 136 +--------- sdk/goal/test/look.test.ts | 40 --- sdk/goal/test/montage.test.ts | 11 +- sdk/goal/test/numbers.test.ts | 31 +++ sdk/goal/test/place.test.ts | 5 +- sdk/goal/test/reading.test.ts | 21 ++ sdk/goal/test/sound.test.ts | 17 ++ sdk/goal/test/tasks.test.ts | 14 +- sdk/goal/test/text.test.ts | 15 ++ sdk/guides/craft/ROUTER.md | 2 +- sdk/guides/craft/bevy/kits.md | 9 +- sdk/guides/craft/bevy/prompts.md | 113 ++------- sdk/guides/craft/bevy/scenes.md | 65 ++--- sdk/guides/craft/bevy/shots.md | 5 +- sdk/guides/craft/floor.md | 5 +- sdk/guides/craft/modes/pitch.md | 12 +- sdk/guides/craft/motion/brief.md | 32 +-- sdk/guides/craft/motion/compositions.md | 3 +- sdk/guides/craft/motion/rendering.md | 13 +- sdk/guides/craft/motion/sound.md | 8 +- sdk/guides/craft/story/montage.md | 9 +- sdk/guides/craft/verbs/critique.md | 5 +- sdk/raea/conformance/extensions.test.tsx | 39 ++- sdk/raea/conformance/registry.test.tsx | 4 + sdk/raea/spec/motion.feature | 2 +- sdk/raea/src/index.tsx | 1 + sdk/video/package.json | 1 + sdk/video/src/captions.tsx | 101 ++++++++ sdk/video/src/index.ts | 1 + sdk/video/src/region.tsx | 13 +- sdk/video/src/registry.tsx | 6 +- sdk/video/src/zones.ts | 39 +++ sdk/video/test/captions.test.ts | 21 ++ tools/taxonomy.list | 1 + 79 files changed, 1349 insertions(+), 1214 deletions(-) create mode 100644 docs/check.feature create mode 100644 sdk/cloud/test/farm_gate.py delete mode 100644 sdk/goal/src/packs/look.ts create mode 100644 sdk/goal/src/packs/numbers.ts create mode 100644 sdk/goal/src/packs/render.ts delete mode 100644 sdk/goal/src/packs/taste.ts delete mode 100644 sdk/goal/test/ask-many.test.ts create mode 100644 sdk/goal/test/check.test.ts delete mode 100644 sdk/goal/test/fixtures/fake-ask/raea delete mode 100644 sdk/goal/test/look.test.ts create mode 100644 sdk/goal/test/numbers.test.ts create mode 100644 sdk/goal/test/text.test.ts create mode 100644 sdk/video/src/captions.tsx create mode 100644 sdk/video/src/zones.ts create mode 100644 sdk/video/test/captions.test.ts diff --git a/apps/check/make/src/lib.rs b/apps/check/make/src/lib.rs index 27b1f2de..0221997d 100644 --- a/apps/check/make/src/lib.rs +++ b/apps/check/make/src/lib.rs @@ -52,7 +52,7 @@ pub fn stop(v: &Value) -> Option { let cwd = PathBuf::from(v["cwd"].as_str()?); let brief = brief_with_job(&cwd)?; let exe = std::env::current_exe().ok()?; - let out = std::process::Command::new(exe).args(["goal", "check", "--at", "done", "--json"]).current_dir(brief.parent()?).env("RAEA_RECORD", "off").output().ok()?; + let out = std::process::Command::new(exe).args(["check", "--at", "done", "--json"]).current_dir(brief.parent()?).env("RAEA_RECORD", "off").output().ok()?; let r: Value = serde_json::from_slice(&out.stdout).ok()?; let home = raea_io_home::user_home()?; let session = v["session_id"].as_str().unwrap_or(""); @@ -67,7 +67,7 @@ pub fn stop(v: &Value) -> Option { } let goals: Vec = r["goals"].as_array().into_iter().flatten().filter(|g| g["passed"] != true).filter_map(|g| g["name"].as_str().map(String::from)).collect(); let open = if goals.is_empty() { String::new() } else { format!("goal {}, ", goals.join(", ")) }; - Some(format!("Not done ({open}{}): {items}. Keep going: `raea goal check` lists each with its fix; review/goal.json holds them all.", brief.display())) + Some(format!("Not done ({open}{}): {items}. Fix each in its composition and render it again (its check runs at the render's end): `raea check --at done` lists them with their fixes, and review/goal.json holds them all.", brief.display())) } /// The open items, one line each: each error-level finding (its check and file), then each check that broke. diff --git a/apps/check/src/hook.rs b/apps/check/src/hook.rs index 74a0dd4a..8223257f 100644 --- a/apps/check/src/hook.rs +++ b/apps/check/src/hook.rs @@ -3,10 +3,10 @@ //! --agent A` adds them, and they hold inside the raea app too, which leaves each agent its own shell). Before a shell //! command: media opened in the Mac's viewer or a browser is stopped once while the raea app is installed, the reason //! naming `raea show`; the same command tried again goes through, so an agent that means it says so twice. After a -//! file is saved: `raea goal check --at edit` on a composition, or on a file under a brief. As a turn ends: `raea -//! goal check --at done` on the brief's goals (apps/check/make). After any tool, and as a turn ends: what the person sent from -//! the raea app (inbox.rs). A stop is exit 2 with the reason on stderr, which every harness hands its agent; the edit -//! moment's findings go back in the shape each one reads. +//! file is saved: nothing (docs/check.feature: a render checks its own output at its end). As a turn ends: `raea check +//! --at done` on the brief's goals (apps/check/make), which reads each deliverable's kept check. After any tool, and as +//! a turn ends: what the person sent from the raea app (inbox.rs). A stop is exit 2 with the reason on stderr, which +//! every harness hands its agent; what was sent goes back in the shape each one reads. use serde_json::{Value, json}; use std::path::{Path, PathBuf}; @@ -114,23 +114,6 @@ pub fn steer(files: &[String]) -> String { format!("raea: the raea app is installed here, so show this in it, not the Mac's viewer: `raea show {list}` (several stills make a storyboard; add --ask \"what you want from the person\"; inside the raea app, feed_post does the same). It brings the app's window up on it as an item the person can answer, and their answer comes to the inbox file it prints. If the Mac's viewer really is what's wanted (the person asked for it, or raea show can't), run the same command again and it goes through.") } -/// The files a tool call saved: `file_path` or `path` (Claude Code, Kimi Code, Gemini CLI), or the files an apply_patch -/// adds or updates (Codex). -fn saved(v: &Value) -> Vec { - let i = &v["tool_input"]; - if let Some(p) = i["file_path"].as_str().or(i["path"].as_str()).or(i["absolute_path"].as_str()) { - return vec![p.to_string()]; - } - let patch = i["command"].as_str().or(i["input"].as_str()).unwrap_or(""); - patch.lines().filter_map(|l| ["*** Add File: ", "*** Update File: "].iter().find_map(|head| l.strip_prefix(head))).map(str::trim).map(String::from).collect() -} - -/// Whether a saved file is held at the edit moment: a composition (a .tsx that registers a root), or any file under a -/// brief.ts -fn held_at_edit(p: &Path) -> bool { - (p.extension().is_some_and(|e| e == "tsx") && std::fs::read_to_string(p).is_ok_and(|t| t.contains("registerRoot"))) || p.parent().is_some_and(|d| raea_app_check_make::brief_with_job(d).is_some()) -} - /// Findings for the agent in the shape its harness reads after a tool: Gemini CLI's AfterTool context, Kimi Code's /// plain stdout, Claude Code's and Codex's PostToolUse context. fn after(agent: &str, text: &str) -> String { @@ -178,20 +161,8 @@ pub fn hook(args: &[String]) -> R { } return Ok(String::new()); } - // the edit moment of the loop (docs/goal.feature MK33): `raea goal check FILE --at edit` on a saved composition, or - // on any file under a brief; a save that passes says nothing - let me = std::env::current_exe().map_err(|e| e.to_string())?; - let mut found = Vec::new(); - for path in saved(&v).iter().filter(|p| held_at_edit(Path::new(p))) { - let dir = Path::new(path).parent().filter(|d| d.is_dir()).map(Path::to_path_buf).unwrap_or_else(|| PathBuf::from(v["cwd"].as_str().unwrap_or("."))); - let Ok(out) = std::process::Command::new(&me).args(["goal", "check", "--at", "edit"]).arg(path).current_dir(dir).env("RAEA_RECORD", "off").output() else { continue }; - if out.status.code() == Some(1) { - found.extend(String::from_utf8_lossy(&out.stdout).lines().filter(|l| !l.starts_with("PASSED")).map(String::from)); - } - } - let edit = (!found.is_empty()).then(|| format!("raea goal check --at edit after this save:\n{}", found.join("\n"))); - let text = [sent, edit].into_iter().flatten().collect::>().join("\n\n"); - Ok(if text.is_empty() { String::new() } else { after(agent, &text) }) + // no check after a save (docs/check.feature CK1): a render checks its own output at its end, once + Ok(sent.map(|t| after(agent, &t)).unwrap_or_default()) } #[cfg(test)] @@ -217,8 +188,6 @@ mod tests { assert_eq!(agent_of(&json!({"hook_event_name": "PreToolUse", "tool_name": "Bash"})), "claude"); assert_eq!(shell_command(&json!({"tool_name": "shell_command", "tool_input": {"command": "open a.png"}})), Some("open a.png")); assert_eq!(shell_command(&json!({"tool_name": "apply_patch", "tool_input": {"command": "*** Begin Patch\n"}})), None); - assert_eq!(saved(&json!({"tool_input": {"command": "*** Begin Patch\n*** Update File: a/E.tsx\n@@\n*** Add File: b.ts\n"}})), ["a/E.tsx", "b.ts"]); - assert_eq!(saved(&json!({"tool_input": {"path": "E.tsx"}})), ["E.tsx"]); assert_eq!(after("kimi", "x"), "x"); assert!(after("gemini", "x").contains("AfterTool") && after("codex", "x").contains("PostToolUse")); assert!(steer(&["a b.png".into()]).contains("`raea show \"a b.png\"`")); diff --git a/apps/check/text/src/lib.rs b/apps/check/text/src/lib.rs index dc6b3175..05c39e9e 100644 --- a/apps/check/text/src/lib.rs +++ b/apps/check/text/src/lib.rs @@ -192,6 +192,10 @@ pub fn face_cover(runs: &[Run], faces: &[(f64, f64, [f64; 4])], issues: &mut Vec } } +/// The app's right-hand buttons start this far down the frame (sdk/video/src/zones.ts RAIL): the right zone is under it. +/// 12-05: a centred end card at 35% down was an error for the right zone, where no app draws anything. +pub const RAIL: f64 = 0.45; + /// the zones where text can't go, as [top, right, bottom, left] at 1080 wide (sdk/guides/craft/floor.md) pub fn zones(w: f64, h: f64, shape: Option<&str>, platform: Option<&str>) -> [f64; 4] { let r = w / h; @@ -224,7 +228,8 @@ pub fn text_rules(runs: &[Run], heard: Option<&[Word]>, w: f64, h: f64, shape: O let [x, y, bw, bh] = r.box_; let q = quote(&r.text); let off = |&[x, y, bw, bh]: &[f64; 4]| x < -1.0 || y < -1.0 || x + bw > w + 1.0 || y + bh > h + 1.0; - let zoned = |&[x, y, bw, bh]: &[f64; 4]| y < zt || x + bw > w - zr || y + bh > h - zb || x < zl; + // the right zone is the app's buttons, which start RAIL down the frame: above them the right edge is clear + let zoned = |&[x, y, bw, bh]: &[f64; 4]| y < zt || (x + bw > w - zr && y + bh > RAIL * h) || y + bh > h - zb || x < zl; if r.boxes.iter().all(off) { clipped += 1; issues.push(Issue { rule: "clipped", p: 0, at: Some(r.from), says: format!("{q} runs off the frame (box {x:.0},{y:.0} {bw:.0}x{bh:.0} in {w:.0}x{h:.0}); fit it or break the line") }); @@ -313,6 +318,20 @@ pub fn cues(runs: &[Run], words: &[Word], issues: &mut Vec, passed: &mut #[cfg(test)] mod tests { + /// The right zone is the app's buttons, from RAIL down: a centred end card above them is clear (12-05, an end card 35% + /// down was an error); the same card over the buttons isn't. + #[test] + fn the_right_zone_starts_where_the_apps_buttons_do() { + let right = |y: f64| { + let m = serde_json::json!({"fps": 1.0, "frames": [{"frame": 0, "text": [{"text": "THE BODY SHOP", "box": [134.0, y, 812.0, 112.0]}]}]}); + let (mut issues, mut passed) = (vec![], vec![]); + text_rules(&text_runs(&m), None, 1080.0, 1920.0, None, None, &mut issues, &mut passed); + issues.into_iter().filter(|i| i.rule == "safe-area").map(|i| i.says).collect::() + }; + assert_eq!(right(682.0), ""); + assert!(right(1290.0).contains("at the right (keep 140 px clear)"), "{}", right(1290.0)); + } + use super::*; use serde_json::json; diff --git a/docs/check.feature b/docs/check.feature new file mode 100644 index 00000000..b31466c0 --- /dev/null +++ b/docs/check.feature @@ -0,0 +1,60 @@ +Feature: one check (12-04, Shane: "fix how every agent checks its work ... removing ask and judge completely and all + that exists is check as the overarching method") + + Round 26's agents met about nine ways to check their work (raea goal check, goal seen, goal judge, raea ask, raea + check's taste, the old frames command, a lines.txt words check, raea cloud's stop critic and run eval, and the render and + publish tools' own copies), two of them broken on the boxes, and 183 findings on 10 cuts of which about 10 were real + faults. Every agent, on raea cloud, in the desktop app or with the raea skill, now has one: `raea check`. + + Rule: every rule lives in one of three places, or nowhere (12-04, Shane) + Built in: a component or an SDK default that can't produce the fault (captions from the words file, in the safe area; + a Region that keeps text off faces and the app's buttons; raea cut, which cuts only in pauses). Its check is a + backstop that shouldn't fire. + A check, hard or soft: hard is an error (a fault in the deliverable), soft a warning (a note for the person, never a + reason to render again). + Context the agent retrieves while it makes the work: craft and taste (how captions read, pacing, a hook, a brand's + fingerprint, the person's past notes) live in the skill, the guides and memory. Nothing grades the work against them. + A rule that fits none of these isn't a rule: no ritual (the agent saying it looked: `seen`) and no model's opinion + of the work (taste, a critic, a judge, an ask). + + Scenario: CK0 one verb + Given any project + When an agent or a person runs `raea check [FILE...] [--at edit|render|publish|done]` + Then it runs every rule the project's goal holds at that moment, and nothing else checks the work + And `raea goal check` still runs as `raea check`, for boxes and tools on an older raea + And `raea ask`, `raea goal judge`, `raea judge` and `raea goal seen` are gone: raea says so, and names `raea check` + + Scenario: CK1 run once, after the render + Given a render that wrote OUT.mp4 (on this machine, or on raea cloud's farm and checked by the box that sent it) + When it ends + Then `raea check OUT.mp4 --at render` runs once and keeps OUT.check.json beside it + And publish and done read OUT.check.json while it's no older than OUT.mp4 or its manifest, and never run its rules again + + Scenario: CK2 only real faults, one line a rule + Given a cut + Then it is held to: a word clipped or missing (words, sound), a face cut by the frame edge (frames), text over a face, + a sign or the app's buttons (place, floor), captions over talking (captions), the brief's must-say, never-say and + CTA (say, never, cta), its size, length and name (shape, sizes, naming), the brief's count and open items, and what + the render itself found (render) + And a 3D scene, kit or shot is held to its deliverables and what its render found: clipping, a part out of place or + under its detail, light that jumps + And each rule says at most one line a file: its first finding and how many more like it + + Scenario: CK3 our own text from the manifest + Given a render manifest beside a video + Then captions, placement and size read the texts raea drew from it, never by reading the frames + And text in the source footage (a sign, a phone's screen) is never counted as the edit's + + Scenario: CK4 no critic, no ritual in the loop + Then no check asks a model to judge the work, and no check waits for the agent to say it looked + And a check that can't run on a machine (Mac, Linux, Windows, a raea cloud box) is removed, not left waiting + + Scenario: CK5 a brief that can't break the check + Given brief.ts with `goal: [steps, cut({...})]`, `goal: steps` or `goal: cut({...})` + Then `raea check` reads every goal in it, and never crashes on what an agent wrote + And a cut's beats are the agent's plan, never a rule it is checked against + + Scenario: CK6 one set of instructions + Then raea's skill, its guides, `raea help`, the AGENTS.md raea writes, raea cloud's method, workflows and skills, and + the desktop app all name `raea check` as the one way to check, and none names ask, judge, seen, frames check or a + lines.txt words check diff --git a/engine/cli/goal/src/lib.rs b/engine/cli/goal/src/lib.rs index 4a9ed472..561c6a01 100644 --- a/engine/cli/goal/src/lib.rs +++ b/engine/cli/goal/src/lib.rs @@ -9,13 +9,27 @@ use std::path::Path; /// `raea goal`'s verbs (docs/goal.feature): the loop's runner, sdk/goal/src/run.ts, run here on raea's JavaScriptCore /// with Node's core. `goal gates` (the record and critic gates the packs read) is apps/make's, and `goal next` this /// binary's own (next()). -pub const GOAL_TS: &[&str] = &["check", "tasks", "seen", "judge"]; +pub const GOAL_TS: &[&str] = &["check", "tasks"]; + +/// Verbs that asked a model for its opinion of the work, or the agent to say it looked (docs/check.feature): gone, and +/// said so with where their part went, so an old skill or AGENTS.md that names one is set right at once. +pub fn gone(args: &[String]) -> Option { + let v = |i: usize| args.get(i).map(String::as_str); + let what = match (v(0), v(1)) { + (Some("ask"), _) => "raea ask", + (Some("judge"), _) => "raea judge", + (Some("goal"), Some("seen")) => "raea goal seen", + (Some("goal"), Some("judge")) => "raea goal judge", + (Some("goal"), Some("gates")) => "raea goal gates", + (Some("check"), _) if args.iter().any(|a| a == "--taste" || a == "--quick") => "raea check --taste", + _ => return None, + }; + Some(format!("{what} is gone (docs/check.feature): `raea check` is the one check, and a render checks its own output at its end. How the work should look and sound is the raea skill's and its guides', read while you make it; nothing grades it after.")) +} /// The goal verbs' usage, under the help's (usage.rs reads each verb's flags from it). -pub const GOAL_USAGE: &str = "raea goal check [FILE...] [--at edit|render|publish|done] [--goal NAME] [--only ID,...] [--manifest render.json] [--json] (every rule each goal of brief.ts is held to at that moment: its kind's packs, its rules and its own checks; with no goal, the floor; every project is also held to `registered`, every raea file reached from brief.ts; review/goal.json; exit 1 on an error. The hook runs it at every save (edit) and stop (done), a render at its end, raea cloud at publish) +pub const GOAL_USAGE: &str = "raea check [FILE...] [--at edit|render|publish|done] [--goal NAME] [--only ID,...] [--manifest render.json] [--json] (the one check (docs/check.feature): every rule each goal of brief.ts holds at that moment, real faults only, one line a rule a file; with no goal, the floor. A render runs it on its output at its end and keeps OUT.check.json beside it; publish and done read that and never run it again. review/goal.json; exit 1 on an error. `raea goal check` is its old name) raea goal tasks [DIR] [--json] | raea goal tasks [DIR] --apply EDITS.json|- | raea goal tasks [DIR] --put PUT.json|- (the brief's plan as the brief's run gives it: open tasks by id, or all as JSON; --apply writes edits by task id back where each task is written, refusing one made by code; a project with no plan gets plan.ts, imported by brief.ts; --put {plan, base} writes the whole plan back only while the brief's is still base) - raea goal seen FILE [\"what you see and would change\" --look \"its design at full size, beside a reference\"] [--surprise \"SECONDS s: what it is\"] (FILE's contact sheet beside it, and its frames at full size in FILE.looks/, to look at; with words, what was seen of FILE as it is now, and --look how a video's type, captions and cards look at full size) - raea goal judge [--goal NAME] (a goal's `says` rules judged now, as `raea goal check` judges them itself: a rule with a piece to watch or hear (a file it names, else the videos under out/) by clef-omni, any other by a fresh session of the agent this project runs on, which only reads; review/judge/NAME.json. Who judges is raea's to settle, never yours) raea goal next [DIR] (the two or three useful next steps for the project, from its brief, its goals, compositions, renders and checks)"; /// One of GOAL_TS's verbs (or `make place`): printed as it says, and the process exits with its code (1 on an @@ -42,14 +56,12 @@ pub fn render_moment(args: &[String]) -> i32 { a.extend(["--manifest".into(), m]); } match goal_run(&a) { - Ok(1) => { - println!("fix every ERROR above, then render again"); - 1 - } + // an ERROR is a fault in the deliverable: fix its cause in the composition before this render is handed over + Ok(1) => 1, Ok(_) => 0, // no runner (an install without the SDK): the render stands, and says so Err(e) => { - println!("raea goal check: {e}"); + println!("raea check: {e}"); 0 } } diff --git a/engine/cli/src/cli.rs b/engine/cli/src/cli.rs index 871be073..cf6e6a66 100644 --- a/engine/cli/src/cli.rs +++ b/engine/cli/src/cli.rs @@ -204,17 +204,17 @@ pub fn run(args: &[String]) -> R { if args[0] == "spec" { return spec::spec_cli(&args[1..]); } - // `check VIDEO --taste taste.ts|DIR`: the taste's .ts files evaluated here, then the check (main.rs takes the rest) - if args[0] == "check" && args.iter().any(|a| a == "--quick") { - let (report, bad) = raea_app_check::quick::quick(&args[1..], spec::tastes_ts(args)?)?; - println!("{report}"); - std::process::exit(i32::from(bad)); - } // `hook [AGENT]`: every agent harness's tool hooks (A5d): raea show over Preview, the quick check after a save (SK10) if args[0] == "hook" { return raea_app_check::hook::hook(&args[1..]); } - // `check PROJECT|EDIT.tsx`: every rule's check over the compositions' worlds (DR4); a video is the floor alone - if args[0] == "check" && !raea_app_direction::check::of_video(&args[1..]) { std::process::exit(raea_app_direction::check::cli(&args[1..], &CHECK)); } - if args[0] == "check" { std::process::exit(raea_app_check::cli_with(&args[1..], spec::tastes_ts(args)?)); } + // `check [FILE...] [--at MOMENT]`: the one check (docs/check.feature), sdk/goal/src/run.ts; a model's opinion + // (`--taste`, `ask`, `judge`, `goal seen|judge`) is no check, and refused with where its part went + if let Some(why) = gone(args) { return Err(why); } + // `check EDIT.tsx|NAME.story.ts`: a project's own checks over a composition's frames or a story (DR4), before a + // render; the deliverables' check is the runner's + if args[0] == "check" && args[1..].iter().find(|a| !a.starts_with('-')).is_some_and(|a| a.ends_with(".tsx") || a.ends_with(".ts")) { + std::process::exit(raea_app_direction::check::cli(&args[1..], &CHECK)); + } + if args[0] == "check" { return goal_ts(&[&["goal".to_string()], args].concat()); } if args[0] == "world" { std::process::exit(raea_app_direction::cli(&args[1..])); } // a frame as one world of facts (docs/direction.feature DR1) if args[0] == "findings" { return raea_app_direction::findings::cli(args); } // the project's record read back (DR3) if args[0] == "notes" { std::process::exit(raea_app_notes::cli(&args[1..], spec::spec_json, notes_run)); } // a person's notes as files, restated as asks, each with a check (DR5, DR6) @@ -280,13 +280,12 @@ pub fn run(args: &[String]) -> R { Some("gen") => return raea_app_tools::generate::generate(args), // the agent shell's own verbs ported here (`init`, `cut`, `frame`): engine/cli's handler, run by its native.ts (shell()) Some(v) if SHELL.contains(&v) => return shell(args), - // `goal check|tasks|seen|judge` and `make place`: the loop's runner, sdk/goal/src/run.ts (goal_ts()); `goal gates` - // apps/make's; `goal next` this binary's + // `goal check|tasks` and `make place`: the loop's runner, sdk/goal/src/run.ts (goal_ts()); `goal check` is `raea + // check`'s old name; `goal next` this binary's Some("goal") if args.get(1).is_some_and(|v| GOAL_TS.contains(&v.as_str())) => return goal_ts(args), Some("make") if args.get(1).map(String::as_str) == Some("place") => return goal_ts(&[&["goal".to_string()], &args[1..]].concat()), - Some("goal") if args.get(1).map(String::as_str) == Some("gates") => return raea_app_make::cli(args), Some("goal") if args.get(1).map(String::as_str) == Some("next") => return next(&args[2..]), - Some("goal") => return Err(format!("raea goal check|tasks|seen|judge|gates|next\n {GOAL_USAGE}")), + Some("goal") => return Err(format!("raea goal tasks|next (raea check checks the work)\n {GOAL_USAGE}")), _ => if let Some(r) = raea_app_solid::verb(args) { return r }, // `solid info|view FILE.ts`, `judge DIR`, `ask FILE` (apps/solid) } // `master-gain BUNDLE.js DIR`: the gain and ceiling a composition's render masters its sound with, as JSON (live diff --git a/engine/cli/src/index.ts b/engine/cli/src/index.ts index ceada39f..fd97057c 100644 --- a/engine/cli/src/index.ts +++ b/engine/cli/src/index.ts @@ -79,19 +79,15 @@ A video edit as a React + TypeScript project, rendered by raea. - edit.tsx: the composition. Change anything: layout, timing, which component plays when. - cuts.ts: the clips (\`raea cut\` writes it, with cuts.json and words.json beside it; re-run it rather than editing by hand, or captions and checks lose their timing). components/: components you added (\`raea make component add\`), yours to change. -- brand/brand.css: the brand's tokens (\`raea brand DOMAIN\` reads them from the brand's site). edit.tsx loads them with the project's - Tailwind: \`\`, css from "./styles.gen" (raea render writes it). The brand's colours and - faces are the palette, as classes: colour text-brand-accent, bg-brand-accent, bg-brand-surface (bg-brand-bg), - text-brand-on-surface, text-brand-on-accent, text-brand-ink, brand-1/2/3; face font-brand, font-brand-body (where - the brand's face is missing, install a free face close to it, never a system fallback); the --brand-* variables - where a class can't reach. Never a colour from outside the brand. The design is yours: size, weight, shape, layout - and motion are chosen for this piece, against how the brand's own best work looks, not from a default. The sizes - text-display, text-title, text-caption, text-body, text-label (scaled for a 1080-wide frame) and rounded-brand are - a start, not a limit. -- \`raea render edit.tsx -o final.mp4 --manifest render.json\`, then \`raea check final.mp4 --manifest render.json - --words words.json --perception perception.json\` says what's wrong; \`raea render edit.tsx --at 105 -o stills/\` - gives frame 105 to look at. \`raea guide\` has the craft (\`raea guide motion\` for writing the TSX); - \`raea help\` lists the rest. +- brand/brand.css: the brand's tokens (\`raea brand DOMAIN\` reads them from its site), loaded with the project's + Tailwind: \`\`, css from "./styles.gen". Its colours and faces are the palette, as classes + (text-brand-accent, bg-brand-surface, text-brand-on-accent, text-brand-ink, brand-1/2/3, font-brand, + font-brand-body) or --brand-* variables; never a colour from outside it. Size, weight, layout and motion are yours, + chosen against the brand's own best work. +- \`raea render edit.tsx -o final.mp4 --manifest render.json\` renders, then checks the export once as it ends + (\`raea check\`: real faults only, each ERROR with its fix, kept as final.check.json; nothing runs it again). Fix the + ERRORs; a warning is a note for the person. \`raea render edit.tsx --at 105 -o review/stills/\` gives frame 105 to + look at. \`raea guide\` has the craft (\`raea guide motion\` for writing the TSX); \`raea help\` lists the rest. ## raea (everything there is; import from "raea") @@ -99,19 +95,18 @@ Time: useCurrentFrame() (frames, from 0 inside the nearest Sequence), useVideoCo durationInFrames}, interpolate(frame, [in...], [out...], {extrapolateLeft, extrapolateRight: "clamp", easing}), spring({frame, fps, config}), Easing.bezier(a, b, c, d) / Easing.inOut(...). Layout: , , , , . -Media: