mirror of
https://github.com/shinyobjectz/raea.git
synced 2026-12-01 12:44:11 -10:00
Compare commits
9
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1a5bedf478 | ||
|
|
b8e4b5b227 | ||
|
|
5fed89232e | ||
|
|
5d7afd0493 | ||
|
|
979fc5ada2 | ||
|
|
2be7f5998a | ||
|
|
f82bc51374 | ||
|
|
ec144efd5d | ||
|
|
bbd7369548 |
No files matched your search
@@ -68,6 +68,9 @@ jobs:
|
|||||||
run: bash tools/layers.sh
|
run: bash tools/layers.sh
|
||||||
- name: names
|
- name: names
|
||||||
run: bash tools/names.sh
|
run: bash tools/names.sh
|
||||||
|
- name: legacy names
|
||||||
|
# nothing names what raea's one loop replaced (docs/goal.feature MK41)
|
||||||
|
run: bash tools/legacy-names.sh
|
||||||
- name: size
|
- name: size
|
||||||
run: bash tools/size.sh
|
run: bash tools/size.sh
|
||||||
- name: one-version
|
- name: one-version
|
||||||
|
|||||||
Generated
+22
-19
@@ -13913,8 +13913,6 @@ dependencies = [
|
|||||||
"raea-core-facts",
|
"raea-core-facts",
|
||||||
"raea-core-review",
|
"raea-core-review",
|
||||||
"raea-io-home",
|
"raea-io-home",
|
||||||
"raea-runtime-cut-plan",
|
|
||||||
"raea-runtime-goal-plan",
|
|
||||||
"raea-runtime-lod-plan",
|
"raea-runtime-lod-plan",
|
||||||
"resvg 0.48.1",
|
"resvg 0.48.1",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
@@ -14338,6 +14336,8 @@ dependencies = [
|
|||||||
"raea-app-voice",
|
"raea-app-voice",
|
||||||
"raea-app-workspace",
|
"raea-app-workspace",
|
||||||
"raea-bevy-plugins",
|
"raea-bevy-plugins",
|
||||||
|
"raea-cli-goal",
|
||||||
|
"raea-cli-refused",
|
||||||
"raea-core-alloc",
|
"raea-core-alloc",
|
||||||
"raea-core-animate",
|
"raea-core-animate",
|
||||||
"raea-core-brief",
|
"raea-core-brief",
|
||||||
@@ -14366,6 +14366,26 @@ dependencies = [
|
|||||||
"wsx",
|
"wsx",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "raea-cli-goal"
|
||||||
|
version = "0.1.0"
|
||||||
|
dependencies = [
|
||||||
|
"raea-app-make",
|
||||||
|
"raea-core-brief",
|
||||||
|
"raea-io-home",
|
||||||
|
"raea-native",
|
||||||
|
"serde_json",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "raea-cli-refused"
|
||||||
|
version = "0.1.0"
|
||||||
|
dependencies = [
|
||||||
|
"dunce",
|
||||||
|
"raea-io-home",
|
||||||
|
"serde_json",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "raea-core-alloc"
|
name = "raea-core-alloc"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
@@ -15374,15 +15394,6 @@ dependencies = [
|
|||||||
"raea-io-home",
|
"raea-io-home",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "raea-runtime-cut-plan"
|
|
||||||
version = "0.1.0"
|
|
||||||
dependencies = [
|
|
||||||
"raea-core-brief",
|
|
||||||
"raea-io-soft",
|
|
||||||
"serde_json",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "raea-runtime-dom"
|
name = "raea-runtime-dom"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
@@ -15514,14 +15525,6 @@ dependencies = [
|
|||||||
"wgpu",
|
"wgpu",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "raea-runtime-goal-plan"
|
|
||||||
version = "0.1.0"
|
|
||||||
dependencies = [
|
|
||||||
"raea-core-brief",
|
|
||||||
"serde_json",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "raea-runtime-gpuframe"
|
name = "raea-runtime-gpuframe"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
|
|||||||
+2
-2
@@ -43,6 +43,8 @@ members = [
|
|||||||
"engine/bevy-world",
|
"engine/bevy-world",
|
||||||
"engine/bundle",
|
"engine/bundle",
|
||||||
"engine/cli",
|
"engine/cli",
|
||||||
|
"engine/cli/goal",
|
||||||
|
"engine/cli/refused",
|
||||||
"engine/neural",
|
"engine/neural",
|
||||||
"engine/light",
|
"engine/light",
|
||||||
"engine/modules",
|
"engine/modules",
|
||||||
@@ -202,8 +204,6 @@ members = [
|
|||||||
"runtime/export",
|
"runtime/export",
|
||||||
"runtime/endchecks",
|
"runtime/endchecks",
|
||||||
"runtime/lod-plan",
|
"runtime/lod-plan",
|
||||||
"runtime/cut-plan",
|
|
||||||
"runtime/goal-plan",
|
|
||||||
"runtime/live",
|
"runtime/live",
|
||||||
"runtime/page",
|
"runtime/page",
|
||||||
"runtime/appscreen",
|
"runtime/appscreen",
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ floor (`raea check hello.mp4`). `raea init` starts a project, and `raea --help`
|
|||||||
Gaussian splats, and Bevy plugins compiled into the engine. three.js work runs as it's written: a React Three Fiber
|
Gaussian splats, and Bevy plugins compiled into the engine. three.js work runs as it's written: a React Three Fiber
|
||||||
scene inside `<R3F>`, or a three.js page's script inside `<Three program>`.
|
scene inside `<R3F>`, or a three.js page's script inside `<Three program>`.
|
||||||
- **Sound.** One mixer for live play and offline render, instruments and effects, and local models for foley and
|
- **Sound.** One mixer for live play and offline render, instruments and effects, and local models for foley and
|
||||||
instrument notes (`raea sao`, `raea tokensynth`).
|
instrument notes (`raea make sao`, `raea make tokensynth`).
|
||||||
- **Built for agents.** Everything it draws stays queryable as data, so an agent can render a frame, look at it, and
|
- **Built for agents.** Everything it draws stays queryable as data, so an agent can render a frame, look at it, and
|
||||||
fix what's wrong without a person in the loop.
|
fix what's wrong without a person in the loop.
|
||||||
|
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ fn hex(digest: &[u8]) -> String {
|
|||||||
digest.iter().take(16).map(|b| format!("{b:02x}")).collect()
|
digest.iter().take(16).map(|b| format!("{b:02x}")).collect()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// What a file is, cheaply, and the size an ident names (raea-core-ask, so `raea make status` reads the same).
|
/// What a file is, cheaply, and the size an ident names (raea-core-ask, so `raea goal gates` reads the same).
|
||||||
pub use raea_core_ask::ident::{ident, ident_len};
|
pub use raea_core_ask::ident::{ident, ident_len};
|
||||||
|
|
||||||
/// One of the record's files written whole, through a temporary file, so a reader never sees half of it.
|
/// One of the record's files written whole, through a temporary file, so a reader never sees half of it.
|
||||||
|
|||||||
@@ -28,6 +28,6 @@ raea-app-check-text = { path = "text" }
|
|||||||
raea-app-check-flash = { path = "flash" }
|
raea-app-check-flash = { path = "flash" }
|
||||||
# what the person sent from the raea app, handed to the agent (split out to keep this crate small)
|
# what the person sent from the raea app, handed to the agent (split out to keep this crate small)
|
||||||
raea-app-check-inbox = { path = "inbox" }
|
raea-app-check-inbox = { path = "inbox" }
|
||||||
# the Stop gate for a `make` job (docs/make.feature MK2; split out to keep this crate small)
|
# the Stop gate for a `make` job (docs/goal.feature MK2; split out to keep this crate small)
|
||||||
raea-app-check-make = { path = "make" }
|
raea-app-check-make = { path = "make" }
|
||||||
serde_json = "1"
|
serde_json = "1"
|
||||||
@@ -4,7 +4,7 @@ version = "0.1.0"
|
|||||||
edition = "2024"
|
edition = "2024"
|
||||||
license = "FSL-1.1-ALv2"
|
license = "FSL-1.1-ALv2"
|
||||||
publish = false
|
publish = false
|
||||||
description = "`raea hook`'s Stop gate for a `make` job (docs/make.feature MK2): an agent can't end its turn until `raea make status` says the job is done"
|
description = "`raea hook`'s Stop gate for a `make` job (docs/goal.feature MK36): an agent can't end its turn until `raea goal check --at done` passes"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
serde_json = "1"
|
serde_json = "1"
|
||||||
|
|||||||
+40
-34
@@ -1,8 +1,8 @@
|
|||||||
//! raea-app-check-make: the Stop hook's half of `raea make` (docs/make.feature MK2): an agent working in a project whose brief.ts has a
|
//! raea-app-check-make: the Stop hook's moment of the loop (docs/goal.feature MK36): an agent working in a project with a
|
||||||
//! `make` job can't end its turn until `raea make status` says the job is done. Cheap when there's no job: the brief's
|
//! brief.ts can't end its turn until `raea goal check --at done` passes: every goal the brief holds (or, with none, the
|
||||||
//! words are read, and only a brief with `make:` is evaluated (by `raea make status`, a child process, so this crate
|
//! floor) and every raea file reached from the brief (`registered`). Run by `raea goal check`, a child process, so this
|
||||||
//! doesn't carry the judge). A session blocked three times with the same open items goes through: it's going in
|
//! crate carries none of the rules. A session blocked three times with the same open items goes through: it's going in
|
||||||
//! circles, and the person is better told than the agent looped (PL7's keeper stops the same way).
|
//! circles, and the person is better told than the agent looped.
|
||||||
|
|
||||||
use std::hash::{DefaultHasher, Hash, Hasher};
|
use std::hash::{DefaultHasher, Hash, Hasher};
|
||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
@@ -12,13 +12,13 @@ use serde_json::Value;
|
|||||||
/// How many times the same open items may block one session before the stop goes through.
|
/// How many times the same open items may block one session before the stop goes through.
|
||||||
pub const SAME_BLOCKS: u32 = 3;
|
pub const SAME_BLOCKS: u32 = 3;
|
||||||
|
|
||||||
/// The brief.ts with a job, at or above `cwd` inside its raea project.
|
/// The project's brief.ts, at or above `cwd` inside its raea project: every brief is held, none is an outlier.
|
||||||
pub fn brief_with_job(cwd: &Path) -> Option<PathBuf> {
|
pub fn brief_with_job(cwd: &Path) -> Option<PathBuf> {
|
||||||
let project = raea_core_facts::record::up(cwd, ".raea/project");
|
let project = raea_core_facts::record::up(cwd, ".raea/project");
|
||||||
for d in dunce::canonicalize(cwd).ok()?.ancestors() {
|
for d in dunce::canonicalize(cwd).ok()?.ancestors() {
|
||||||
let p = d.join("brief.ts");
|
let p = d.join("brief.ts");
|
||||||
if p.is_file() {
|
if p.is_file() {
|
||||||
return std::fs::read_to_string(&p).is_ok_and(|t| t.contains("make:") || t.contains("make :")).then_some(p);
|
return Some(p);
|
||||||
}
|
}
|
||||||
if project.as_deref() == Some(d) {
|
if project.as_deref() == Some(d) {
|
||||||
return None;
|
return None;
|
||||||
@@ -46,37 +46,42 @@ pub fn may_block(guard: &Path, items: &str) -> bool {
|
|||||||
next <= SAME_BLOCKS
|
next <= SAME_BLOCKS
|
||||||
}
|
}
|
||||||
|
|
||||||
/// What the agent is told when its turn may not end, or None to let it end: no job here, the job is done, the job
|
/// What the agent is told when its turn may not end, or None to let it end: no job here, the job passes, the runner
|
||||||
/// didn't load (never block on raea's own failure), or the same items have blocked it three times already.
|
/// didn't run (never block on raea's own failure), or the same items have blocked it three times already.
|
||||||
/// Each turn's status also brings the job's task in plan.org up to date (`--plan`, docs/make.feature MK3).
|
|
||||||
pub fn stop(v: &Value) -> Option<String> {
|
pub fn stop(v: &Value) -> Option<String> {
|
||||||
let cwd = PathBuf::from(v["cwd"].as_str()?);
|
let cwd = PathBuf::from(v["cwd"].as_str()?);
|
||||||
let brief = brief_with_job(&cwd)?;
|
let brief = brief_with_job(&cwd)?;
|
||||||
let exe = std::env::current_exe().ok()?;
|
let exe = std::env::current_exe().ok()?;
|
||||||
let out = std::process::Command::new(exe).args(["make", "status"]).arg(brief.parent()?).args(["--json", "--plan"]).env("RAEA_RECORD", "off").output().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 s: Value = serde_json::from_slice(&out.stdout).ok()?;
|
let r: Value = serde_json::from_slice(&out.stdout).ok()?;
|
||||||
let home = raea_io_home::user_home()?;
|
let home = raea_io_home::user_home()?;
|
||||||
let session = v["session_id"].as_str().unwrap_or("");
|
let session = v["session_id"].as_str().unwrap_or("");
|
||||||
let guard = home.join(".raea/hooks/make").join(format!("{:x}", hash(&[session, &brief.display().to_string()])));
|
let guard = home.join(".raea/hooks/goal").join(format!("{:x}", hash(&[session, &brief.display().to_string()])));
|
||||||
if s["done"] == true {
|
if r["passed"] == true {
|
||||||
let _ = std::fs::remove_file(&guard);
|
let _ = std::fs::remove_file(&guard);
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
let items = open_items(&s);
|
let items = open_items(&r);
|
||||||
if !may_block(&guard, &items) {
|
if !may_block(&guard, &items) {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
Some(format!(
|
let goals: Vec<String> = r["goals"].as_array().into_iter().flatten().filter(|g| g["passed"] != true).filter_map(|g| g["name"].as_str().map(String::from)).collect();
|
||||||
"Not done ({} job, {}): {items}. Keep going: `raea make status` lists what's open; a defect you judge wrong is answered in NOTES.md by its name.",
|
let open = if goals.is_empty() { String::new() } else { format!("goal {}, ", goals.join(", ")) };
|
||||||
s["kind"].as_str().unwrap_or("make"),
|
Some(format!("Not done ({open}{}): {items}. Keep going: `raea goal check` lists each with its fix; review/goal.json holds them all.", brief.display()))
|
||||||
brief.display()
|
|
||||||
))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The open items, one line each: what's missing, then each gate that isn't clear.
|
/// The open items, one line each: each error-level finding (its check and file), then each check that broke.
|
||||||
pub fn open_items(s: &Value) -> String {
|
pub fn open_items(r: &Value) -> String {
|
||||||
let mut items: Vec<String> = s["missing"].as_array().into_iter().flatten().filter_map(|m| m.as_str().map(String::from)).collect();
|
let mut items: Vec<String> = r["findings"]
|
||||||
items.extend(s["gates"].as_array().into_iter().flatten().filter(|g| g["clear"] != true).map(|g| format!("{}{}: {}", g["gate"].as_str().unwrap_or(""), g["of"].as_str().map(|o| format!(" {o}")).unwrap_or_default(), g["says"].as_str().unwrap_or(""))));
|
.as_array()
|
||||||
|
.into_iter()
|
||||||
|
.flatten()
|
||||||
|
.filter(|x| x["level"] == "error")
|
||||||
|
.map(|x| format!("{}{}: {}", x["check"].as_str().unwrap_or(""), x["file"].as_str().map(|f| format!(" {f}")).unwrap_or_default(), x["says"].as_str().unwrap_or("")))
|
||||||
|
.collect();
|
||||||
|
for b in r["broke"].as_array().into_iter().flatten() {
|
||||||
|
items.push(format!("{} broke: {}", b["check"].as_str().unwrap_or(""), b["says"].as_str().unwrap_or("")));
|
||||||
|
}
|
||||||
items.join("; ")
|
items.join("; ")
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -86,19 +91,18 @@ mod tests {
|
|||||||
use serde_json::json;
|
use serde_json::json;
|
||||||
|
|
||||||
fn tmp(name: &str) -> PathBuf {
|
fn tmp(name: &str) -> PathBuf {
|
||||||
let d = std::env::temp_dir().join(format!("raea-make-gate-{name}-{}", std::process::id()));
|
let d = std::env::temp_dir().join(format!("raea-goal-gate-{name}-{}", std::process::id()));
|
||||||
let _ = std::fs::remove_dir_all(&d);
|
let _ = std::fs::remove_dir_all(&d);
|
||||||
std::fs::create_dir_all(d.join("compositions")).unwrap();
|
std::fs::create_dir_all(d.join("compositions")).unwrap();
|
||||||
d
|
d
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn only_a_brief_with_a_job_is_held() {
|
fn every_brief_is_held_with_or_without_a_goal() {
|
||||||
let d = tmp("job");
|
let d = tmp("job");
|
||||||
|
assert_eq!(brief_with_job(&d.join("compositions")), None, "no brief, nothing held");
|
||||||
std::fs::write(d.join("brief.ts"), "export default brief({ title: \"x\" })").unwrap();
|
std::fs::write(d.join("brief.ts"), "export default brief({ title: \"x\" })").unwrap();
|
||||||
assert_eq!(brief_with_job(&d.join("compositions")), None, "a brief without make is never held");
|
assert_eq!(brief_with_job(&d.join("compositions")).map(|p| p.file_name().unwrap().to_owned()), Some("brief.ts".into()), "a brief without a goal is held to the floor and registered");
|
||||||
std::fs::write(d.join("brief.ts"), "export default brief({ title: \"x\", make: kit({ objects: [] }) })").unwrap();
|
|
||||||
assert_eq!(brief_with_job(&d.join("compositions")).map(|p| p.file_name().unwrap().to_owned()), Some("brief.ts".into()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -110,10 +114,12 @@ mod tests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn open_items_list_what_is_missing_then_the_gates_that_are_not_clear() {
|
fn open_items_list_each_error_then_each_broken_check() {
|
||||||
let s = json!({"missing": ["out/kit/lineup.png"], "gates": [
|
let r = json!({"findings": [
|
||||||
{"gate": "checks", "of": "scene.tsx", "clear": false, "says": "never rendered"},
|
{"check": "deliverables", "level": "error", "file": null, "says": "missing: out/kit/lineup.png"},
|
||||||
{"gate": "critic", "clear": true, "says": "ok"}]});
|
{"check": "cta", "level": "error", "file": "out/cuts/a_9x16.mp4", "says": "no CTA in its last 8 s"},
|
||||||
assert_eq!(open_items(&s), "out/kit/lineup.png; checks scene.tsx: never rendered");
|
{"check": "place", "level": "warn", "file": "out/cuts/a_9x16.mp4", "says": "a warning holds nothing"}],
|
||||||
|
"broke": [{"check": "mine", "says": "x is undefined"}]});
|
||||||
|
assert_eq!(open_items(&r), "deliverables: missing: out/kit/lineup.png; cta out/cuts/a_9x16.mp4: no CTA in its last 8 s; mine broke: x is undefined");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+22
-9
@@ -3,9 +3,10 @@
|
|||||||
//! --agent A` adds them, and they hold inside the raea app too, which leaves each agent its own shell). Before a shell
|
//! --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
|
//! 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
|
//! naming `raea show`; the same command tried again goes through, so an agent that means it says so twice. After a
|
||||||
//! file is saved: the quick check on a composition. After any tool, and as a turn ends: what the person sent from the raea
|
//! file is saved: `raea goal check --at edit` on a composition, or on a file under a brief. As a turn ends: `raea
|
||||||
//! app (inbox.rs). A stop is exit 2 with the reason on stderr, which every harness
|
//! 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
|
||||||
//! hands its agent; the quick check's findings go back in the shape each one reads.
|
//! 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.
|
||||||
use serde_json::{Value, json};
|
use serde_json::{Value, json};
|
||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
|
|
||||||
@@ -124,6 +125,12 @@ fn saved(v: &Value) -> Vec<String> {
|
|||||||
patch.lines().filter_map(|l| ["*** Add File: ", "*** Update File: "].iter().find_map(|head| l.strip_prefix(head))).map(str::trim).map(String::from).collect()
|
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
|
/// 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.
|
/// plain stdout, Claude Code's and Codex's PostToolUse context.
|
||||||
fn after(agent: &str, text: &str) -> String {
|
fn after(agent: &str, text: &str) -> String {
|
||||||
@@ -156,7 +163,7 @@ pub fn hook(args: &[String]) -> R<String> {
|
|||||||
return Ok(sent.map(|t| json!({"hookSpecificOutput": {"hookEventName": event, "additionalContext": t}}).to_string()).unwrap_or_default());
|
return Ok(sent.map(|t| json!({"hookSpecificOutput": {"hookEventName": event, "additionalContext": t}}).to_string()).unwrap_or_default());
|
||||||
}
|
}
|
||||||
if event == "Stop" {
|
if event == "Stop" {
|
||||||
// what the person sent, and a `make` job that isn't done (docs/make.feature MK2): either keeps the turn going
|
// what the person sent, and a brief whose goals don't pass at done (docs/goal.feature MK36): either keeps the turn going
|
||||||
let reasons: Vec<String> = [sent, raea_app_check_make::stop(&v)].into_iter().flatten().collect();
|
let reasons: Vec<String> = [sent, raea_app_check_make::stop(&v)].into_iter().flatten().collect();
|
||||||
return Ok(if reasons.is_empty() { String::new() } else { json!({"decision": "block", "reason": reasons.join("\n\n")}).to_string() });
|
return Ok(if reasons.is_empty() { String::new() } else { json!({"decision": "block", "reason": reasons.join("\n\n")}).to_string() });
|
||||||
}
|
}
|
||||||
@@ -171,13 +178,19 @@ pub fn hook(args: &[String]) -> R<String> {
|
|||||||
}
|
}
|
||||||
return Ok(String::new());
|
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();
|
let mut found = Vec::new();
|
||||||
for path in saved(&v).iter().filter(|p| p.ends_with(".tsx") && std::fs::read_to_string(p).is_ok_and(|t| t.contains("registerRoot"))) {
|
for path in saved(&v).iter().filter(|p| held_at_edit(Path::new(p))) {
|
||||||
let (report, _) = crate::quick::quick(std::slice::from_ref(path), Vec::new())?;
|
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(".")));
|
||||||
found.extend(report.lines().skip(1).filter(|l| !l.starts_with("ok ")).map(String::from));
|
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 quick = (!found.is_empty()).then(|| format!("raea check --quick after this save:\n{}", found.join("\n")));
|
let edit = (!found.is_empty()).then(|| format!("raea goal check --at edit after this save:\n{}", found.join("\n")));
|
||||||
let text = [sent, quick].into_iter().flatten().collect::<Vec<_>>().join("\n\n");
|
let text = [sent, edit].into_iter().flatten().collect::<Vec<_>>().join("\n\n");
|
||||||
Ok(if text.is_empty() { String::new() } else { after(agent, &text) })
|
Ok(if text.is_empty() { String::new() } else { after(agent, &text) })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -218,7 +218,7 @@ fn report(video: &str, issues: Vec<Issue>, more: Vec<Finding>, passed: Vec<Strin
|
|||||||
std::fs::write(out, serde_json::to_string_pretty(&j).unwrap()).map_err(|e| format!("{out}: {e}"))?;
|
std::fs::write(out, serde_json::to_string_pretty(&j).unwrap()).map_err(|e| format!("{out}: {e}"))?;
|
||||||
}
|
}
|
||||||
let mut s = format!("raea check {video}\n");
|
let mut s = format!("raea check {video}\n");
|
||||||
// kept in its project's record beside its renders (DR3), what `raea findings` and `raea next` read
|
// kept in its project's record beside its renders (DR3), what `raea findings` and `raea goal next` read
|
||||||
let kept = raea_core_facts::record::keep("raea check", std::path::Path::new(video), out.map(std::path::Path::new), &found, vec![], &raea_io_trace::utc(std::time::SystemTime::now()).1);
|
let kept = raea_core_facts::record::keep("raea check", std::path::Path::new(video), out.map(std::path::Path::new), &found, vec![], &raea_io_trace::utc(std::time::SystemTime::now()).1);
|
||||||
let kept = kept.map(|e| format!("raea check: kept in the project's record as {} (raea findings reads it)", e.id));
|
let kept = kept.map(|e| format!("raea check: kept in the project's record as {} (raea findings reads it)", e.id));
|
||||||
for line in found.iter().map(Finding::line).chain(passed.iter().map(|p| format!("ok {p}"))).chain(kept) {
|
for line in found.iter().map(Finding::line).chain(passed.iter().map(|p| format!("ok {p}"))).chain(kept) {
|
||||||
|
|||||||
@@ -410,7 +410,7 @@ pub fn check(args: &[String], host: &Host) -> R<(String, bool)> {
|
|||||||
// a note's ask's finding says which ask, as two asks can run one check
|
// a note's ask's finding says which ask, as two asks can run one check
|
||||||
out.extend(c.found.iter().map(|f| if f.by.starts_with("note ") { format!("{} [{}]", f.line(), f.by) } else { f.line() }));
|
out.extend(c.found.iter().map(|f| if f.by.starts_with("note ") { format!("{} [{}]", f.line(), f.by) } else { f.line() }));
|
||||||
out.extend(c.waits.iter().map(|(r, w)| format!("waits {r}: needs {w}")));
|
out.extend(c.waits.iter().map(|(r, w)| format!("waits {r}: needs {w}")));
|
||||||
// kept in its project's record (DR3), what raea findings and raea next read
|
// kept in its project's record (DR3), what raea findings and raea goal next read
|
||||||
if let Some(e) = record::keep("raea check", &c.file, None, &c.found, vec![], &stamp) {
|
if let Some(e) = record::keep("raea check", &c.file, None, &c.found, vec![], &stamp) {
|
||||||
out.push(format!("raea check: kept in the project's record as {} (raea findings reads it)", e.id));
|
out.push(format!("raea check: kept in the project's record as {} (raea findings reads it)", e.id));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ use crate::rubric::{BAR, scores};
|
|||||||
pub const BY: [&str; 2] = ["kimi", "claude"];
|
pub const BY: [&str; 2] = ["kimi", "claude"];
|
||||||
|
|
||||||
/// The judge prompt: the sheets by name, the brief's words, and the JSON to answer. A `raea make` job's kind asks its
|
/// The judge prompt: the sheets by name, the brief's words, and the JSON to answer. A `raea make` job's kind asks its
|
||||||
/// own categories and the bar (docs/make.feature MK5); none asks the rubric raea judge has always asked.
|
/// own categories and the bar (docs/goal.feature MK5); none asks the rubric raea judge has always asked.
|
||||||
pub fn prompt(kind: Option<&str>, dir: &Path, brief: &Value, target: Option<&Path>) -> String {
|
pub fn prompt(kind: Option<&str>, dir: &Path, brief: &Value, target: Option<&Path>) -> String {
|
||||||
match kind {
|
match kind {
|
||||||
None => prompt_default(dir, brief, target),
|
None => prompt_default(dir, brief, target),
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ fn home() -> PathBuf {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// A kind's calibration file: calibration.json for the default rubric, calibration.KIND.json for a `raea make` kind's
|
/// A kind's calibration file: calibration.json for the default rubric, calibration.KIND.json for a `raea make` kind's
|
||||||
/// (docs/make.feature MK6), each fitted on that kind's rounds alone.
|
/// (docs/goal.feature MK6), each fitted on that kind's rounds alone.
|
||||||
fn file_of(kind: Option<&str>) -> PathBuf {
|
fn file_of(kind: Option<&str>) -> PathBuf {
|
||||||
home().join(kind.map_or_else(|| "calibration.json".to_string(), |k| format!("calibration.{k}.json")))
|
home().join(kind.map_or_else(|| "calibration.json".to_string(), |k| format!("calibration.{k}.json")))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
//! raea judge eye DIR composition=6 form=5 ... [--pass yes|no] (or --by kimi: an agent's reading as the eye)
|
//! raea judge eye DIR composition=6 form=5 ... [--pass yes|no] (or --by kimi: an agent's reading as the eye)
|
||||||
//! raea judge calibrate [--kind scene|kit|shot] [--json]
|
//! raea judge calibrate [--kind scene|kit|shot] [--json]
|
||||||
//!
|
//!
|
||||||
//! `--kind` asks a `raea make` job's own rubric (docs/make.feature MK5): a scene's, a kit's or a shot list's categories,
|
//! `--kind` asks a `raea make` job's own rubric (docs/goal.feature MK5): a scene's, a kit's or a shot list's categories,
|
||||||
//! with the bar AnyKit's critic is given; each kind is calibrated on its own rounds (MK6).
|
//! with the bar AnyKit's critic is given; each kind is calibrated on its own rounds (MK6).
|
||||||
//!
|
//!
|
||||||
//! DIR/judge.json is the verdict; DIR's parent's judge.log.jsonl holds every round's, so "done" (two passes in a row,
|
//! DIR/judge.json is the verdict; DIR's parent's judge.log.jsonl holds every round's, so "done" (two passes in a row,
|
||||||
@@ -16,7 +16,7 @@ mod agent;
|
|||||||
mod eye;
|
mod eye;
|
||||||
|
|
||||||
/// Whether the judge's score gates a `raea make` kind's jobs: its calibration (`raea judge calibrate --kind KIND`)
|
/// Whether the judge's score gates a `raea make` kind's jobs: its calibration (`raea judge calibrate --kind KIND`)
|
||||||
/// agreed with the person's eye (docs/make.feature MK6).
|
/// agreed with the person's eye (docs/goal.feature MK6).
|
||||||
pub fn kind_gates(kind: &str) -> bool {
|
pub fn kind_gates(kind: &str) -> bool {
|
||||||
eye::calibration(Some(kind)).is_some_and(|c| c["gate"] == true)
|
eye::calibration(Some(kind)).is_some_and(|c| c["gate"] == true)
|
||||||
}
|
}
|
||||||
@@ -30,7 +30,7 @@ use raea_core_facts::{Finding, Level, finding};
|
|||||||
use raea_runtime_bundle::flag;
|
use raea_runtime_bundle::flag;
|
||||||
use serde_json::{Value, json};
|
use serde_json::{Value, json};
|
||||||
|
|
||||||
pub const USAGE: &str = "raea judge DIR [--kind scene|kit|shot] [--by clef|kimi|claude] [--brief brief.ts] [--target T.png] [--json] [--dry] | judge eye DIR (CATEGORY=SCORE ... [--pass yes|no] | --by kimi|claude) | judge calibrate [--kind scene|kit|shot] [--json] (a --review folder's sheets judged blind: clef-omni on the frozen rubric, or a fresh kimi or claude session on the judge prompt; --kind asks a raea make job's own rubric (a shot list's framing.png); the pass decided in code; clef advises until calibrated against your eye or an agent's, each kind on its own)";
|
pub const USAGE: &str = "raea judge DIR [--kind scene|kit|shot] [--by clef|kimi|claude] [--brief brief.ts] [--target T.png] [--json] [--dry] | judge eye DIR (CATEGORY=SCORE ... [--pass yes|no] | --by kimi|claude) | judge calibrate [--kind scene|kit|shot] [--json] (a --review folder's sheets judged blind: clef-omni on the frozen rubric, or a fresh kimi or claude session on the judge prompt; --kind asks a scene, kit or shot goal's own rubric (a shot list's framing.png); the pass decided in code; clef advises until calibrated against your eye or an agent's, each kind on its own)";
|
||||||
|
|
||||||
/// `--kind`, checked: one of the rubric's kinds, or none (the default rubric).
|
/// `--kind`, checked: one of the rubric's kinds, or none (the default rubric).
|
||||||
pub fn kind_of(args: &[String]) -> Result<Option<String>, String> {
|
pub fn kind_of(args: &[String]) -> Result<Option<String>, String> {
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ pub const SCORES: [Score; 7] = [
|
|||||||
("world", "colour", "World: one coherent real place matching the brief; nothing off-era, no real brands, nothing invented beyond the brief."),
|
("world", "colour", "World: one coherent real place matching the brief; nothing off-era, no real brands, nothing invented beyond the brief."),
|
||||||
];
|
];
|
||||||
|
|
||||||
/// The job kinds with a rubric of their own (docs/make.feature MK5): `raea judge DIR --kind scene|kit|shot`.
|
/// The job kinds with a rubric of their own (docs/goal.feature MK5): `raea judge DIR --kind scene|kit|shot`.
|
||||||
pub const KINDS: [&str; 3] = ["scene", "kit", "shot"];
|
pub const KINDS: [&str; 3] = ["scene", "kit", "shot"];
|
||||||
|
|
||||||
/// A scene made to a plan (AnyScene's categories): judged on the six-camera sheets.
|
/// A scene made to a plan (AnyScene's categories): judged on the six-camera sheets.
|
||||||
@@ -79,7 +79,7 @@ pub fn scores(kind: Option<&str>) -> &'static [Score] {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// What a kind's critic is told the bar is (AnyKit's own words, docs/make.feature MK5).
|
/// What a kind's critic is told the bar is (AnyKit's own words, docs/goal.feature MK5).
|
||||||
pub const BAR: &str = "The bar is a production base an artist then refines, judged at normal viewing distance: take no points off for choices that differ from the reference, don't nitpick, and name at most five fixes, most damaging first.";
|
pub const BAR: &str = "The bar is a production base an artist then refines, judged at normal viewing distance: take no points off for choices that differ from the reference, don't nitpick, and name at most five fixes, most damaging first.";
|
||||||
|
|
||||||
/// The sheets a kind is judged on: the six-camera colour and clay sheets, or a shot list's framing sheet alone.
|
/// The sheets a kind is judged on: the six-camera colour and clay sheets, or a shot list's framing sheet alone.
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ fn an_agent_verdict_is_read_from_the_end_of_its_thinking() {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn each_make_kind_has_its_own_rubric_and_the_default_is_unchanged() {
|
fn each_make_kind_has_its_own_rubric_and_the_default_is_unchanged() {
|
||||||
// docs/make.feature MK5: a kit's categories, a shot list's on the framing sheet alone, the bar said to each
|
// docs/goal.feature MK5: a kit's categories, a shot list's on the framing sheet alone, the bar said to each
|
||||||
let kit = rubric::questions_for(Some("kit"), "clay");
|
let kit = rubric::questions_for(Some("kit"), "clay");
|
||||||
for k in ["score_mesh", "score_assembly", "score_scale"] {
|
for k in ["score_mesh", "score_assembly", "score_scale"] {
|
||||||
assert!(kit.get(k).is_some(), "{k} in {kit}");
|
assert!(kit.get(k).is_some(), "{k} in {kit}");
|
||||||
@@ -117,7 +117,7 @@ fn an_agent_critic_is_asked_its_kinds_categories() {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn a_kind_is_calibrated_on_its_own_categories() {
|
fn a_kind_is_calibrated_on_its_own_categories() {
|
||||||
// docs/make.feature MK6
|
// docs/goal.feature MK6
|
||||||
let s = |j: f64| -> serde_json::Map<String, Value> { rubric::KIT.iter().map(|c| (c.0.to_string(), json!(j))).collect() };
|
let s = |j: f64| -> serde_json::Map<String, Value> { rubric::KIT.iter().map(|c| (c.0.to_string(), json!(j))).collect() };
|
||||||
let rows: Vec<Value> = (0..12).map(|i| if i % 2 == 0 { json!({"kind": "kit", "judge": s(8.0), "eye": s(5.0), "eye_pass": false, "defects": []}) } else { json!({"kind": "kit", "judge": s(9.0), "eye": s(8.0), "eye_pass": true, "defects": []}) }).collect();
|
let rows: Vec<Value> = (0..12).map(|i| if i % 2 == 0 { json!({"kind": "kit", "judge": s(8.0), "eye": s(5.0), "eye_pass": false, "defects": []}) } else { json!({"kind": "kit", "judge": s(9.0), "eye": s(8.0), "eye_pass": true, "defects": []}) }).collect();
|
||||||
let cal = eye::fit_rows_for(Some("kit"), &rows);
|
let cal = eye::fit_rows_for(Some("kit"), &rows);
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ version = "0.1.0"
|
|||||||
edition = "2024"
|
edition = "2024"
|
||||||
license = "FSL-1.1-ALv2"
|
license = "FSL-1.1-ALv2"
|
||||||
publish = false
|
publish = false
|
||||||
description = "raea bake light: bounce light baked into lightmaps on raea's own ray tracer, and the bar it is held to against Cycles (docs/bake.feature)"
|
description = "raea make bake light: bounce light baked into lightmaps on raea's own ray tracer, and the bar it is held to against Cycles (docs/bake.feature)"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
# the frames' distance in stops, as raea light check measures it (LT1)
|
# the frames' distance in stops, as raea light check measures it (LT1)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"about": "the bake's test set (docs/bake.feature BK0), for `raea bake light --compare DIR`: each set's Cycles still (blender/look.py, given the composition's own sky, tone and lens) and Cycles bake (blender/lightbake.py), and raea's frames beside them",
|
"about": "the bake's test set (docs/bake.feature BK0), for `raea make bake light --compare DIR`: each set's Cycles still (blender/look.py, given the composition's own sky, tone and lens) and Cycles bake (blender/lightbake.py), and raea's frames beside them",
|
||||||
"sets": [
|
"sets": [
|
||||||
{ "name": "table", "dir": "bench/bake", "file": "table.tsx", "composition": "table", "cycles": ["table-cycles.tsx", "table-cycles"], "bar": true, "texels": 128,
|
{ "name": "table", "dir": "bench/bake", "file": "table.tsx", "composition": "table", "cycles": ["table-cycles.tsx", "table-cycles"], "bar": true, "texels": 128,
|
||||||
"look": ["--hdri", "media/kloofendal_48d_partly_cloudy_puresky_1k.hdr", "--strength", "0.25", "--rotation", "0.6", "--tone", "agx", "--exposure", "-0.8", "--focus", "2.5", "--fstop", "2.8", "--size", "1280x720"] },
|
"look": ["--hdri", "media/kloofendal_48d_partly_cloudy_puresky_1k.hdr", "--strength", "0.25", "--rotation", "0.6", "--tone", "agx", "--exposure", "-0.8", "--focus", "2.5", "--fstop", "2.8", "--size", "1280x720"] },
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
//! `raea bake light EDIT.tsx [--composition ID] [--samples N] [--compare DIR]` (docs/bake.feature): raea's own bake of a
|
//! `raea make bake light EDIT.tsx [--composition ID] [--samples N] [--compare DIR]` (docs/bake.feature): raea's own bake of a
|
||||||
//! composition's static parts (BK1-BK5), and the bar it is held to (BK0). `--compare DIR` runs the test set (sets.json)
|
//! composition's static parts (BK1-BK5), and the bar it is held to (BK0). `--compare DIR` runs the test set (sets.json)
|
||||||
//! through Cycles (blender/look.py's still and blender/lightbake.py's bake, both at --samples, 1024 by default) and
|
//! through Cycles (blender/look.py's still and blender/lightbake.py's bake, both at --samples, 1024 by default) and
|
||||||
//! through raea, then writes DIR/report.json and a table: each frame's RMSE and stops against the Cycles still, each
|
//! through raea, then writes DIR/report.json and a table: each frame's RMSE and stops against the Cycles still, each
|
||||||
@@ -16,7 +16,7 @@ use serde_json::{json, Value};
|
|||||||
use sha2::{Digest, Sha256};
|
use sha2::{Digest, Sha256};
|
||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
|
|
||||||
pub const USAGE: &str = "raea bake light EDIT.tsx [--composition ID] [--samples N] | raea bake light --compare DIR [--sets FILE] [--set NAME] [--samples N] [--fresh] (bounce light baked into lightmaps on raea's ray tracer; --compare measures the test set against Cycles' bake and still, docs/bake.feature)";
|
pub const USAGE: &str = "raea make bake light EDIT.tsx [--composition ID] [--samples N] | raea make bake light --compare DIR [--sets FILE] [--set NAME] [--samples N] [--fresh] (bounce light baked into lightmaps on raea's ray tracer; --compare measures the test set against Cycles' bake and still, docs/bake.feature)";
|
||||||
|
|
||||||
/// One set of the test set, as sets.json lists it.
|
/// One set of the test set, as sets.json lists it.
|
||||||
pub struct Set {
|
pub struct Set {
|
||||||
@@ -136,8 +136,8 @@ pub fn cli(args: &[String]) -> R<String> {
|
|||||||
}
|
}
|
||||||
let samples: u32 = flag(args, "--samples").map(|v| v.parse().map_err(|_| format!("--samples {v}: a count of samples a texel"))).transpose()?.unwrap_or(1024);
|
let samples: u32 = flag(args, "--samples").map(|v| v.parse().map_err(|_| format!("--samples {v}: a count of samples a texel"))).transpose()?.unwrap_or(1024);
|
||||||
let Some(out) = flag(args, "--compare").map(PathBuf::from) else {
|
let Some(out) = flag(args, "--compare").map(PathBuf::from) else {
|
||||||
// rask: BK5 `raea bake light EDIT.tsx` bakes a composition's <LightBake> ahead of a render and says what it baked
|
// rask: BK5 `raea make bake light EDIT.tsx` bakes a composition's <LightBake> ahead of a render and says what it baked
|
||||||
return Err("raea's own bake isn't built yet (docs/bake.feature BK1-BK5); `raea bake light --compare DIR` measures the test set against Cycles".into());
|
return Err("raea's own bake isn't built yet (docs/bake.feature BK1-BK5); `raea make bake light --compare DIR` measures the test set against Cycles".into());
|
||||||
};
|
};
|
||||||
let list = sets(&flag(args, "--sets").map_or_else(|| raea_io_home::home().join("apps/lightbake/sets.json"), PathBuf::from))?;
|
let list = sets(&flag(args, "--sets").map_or_else(|| raea_io_home::home().join("apps/lightbake/sets.json"), PathBuf::from))?;
|
||||||
let only = flag(args, "--set");
|
let only = flag(args, "--set");
|
||||||
@@ -145,7 +145,7 @@ pub fn cli(args: &[String]) -> R<String> {
|
|||||||
std::fs::create_dir_all(&out).map_err(|e| format!("{}: {e}", out.display()))?;
|
std::fs::create_dir_all(&out).map_err(|e| format!("{}: {e}", out.display()))?;
|
||||||
let mut reports = Vec::new();
|
let mut reports = Vec::new();
|
||||||
for s in list.iter().filter(|s| only.is_none() || only.as_deref() == Some(s.name.as_str())) {
|
for s in list.iter().filter(|s| only.is_none() || only.as_deref() == Some(s.name.as_str())) {
|
||||||
eprintln!("raea bake light: {} ...", s.name);
|
eprintln!("raea make bake light: {} ...", s.name);
|
||||||
reports.push(compare::set(s, samples, &out.join(&s.name), fresh)?);
|
reports.push(compare::set(s, samples, &out.join(&s.name), fresh)?);
|
||||||
}
|
}
|
||||||
if reports.is_empty() {
|
if reports.is_empty() {
|
||||||
@@ -154,5 +154,5 @@ pub fn cli(args: &[String]) -> R<String> {
|
|||||||
let report = json!({ "samples": samples, "sets": reports });
|
let report = json!({ "samples": samples, "sets": reports });
|
||||||
let path = out.join("report.json");
|
let path = out.join("report.json");
|
||||||
std::fs::write(&path, serde_json::to_string_pretty(&report).unwrap_or_default()).map_err(|e| e.to_string())?;
|
std::fs::write(&path, serde_json::to_string_pretty(&report).unwrap_or_default()).map_err(|e| e.to_string())?;
|
||||||
Ok(format!("{}raea bake light: wrote {}", compare::table(&reports), path.display()))
|
Ok(format!("{}raea make bake light: wrote {}", compare::table(&reports), path.display()))
|
||||||
}
|
}
|
||||||
@@ -4,7 +4,7 @@ version = "0.1.0"
|
|||||||
edition = "2024"
|
edition = "2024"
|
||||||
license = "FSL-1.1-ALv2"
|
license = "FSL-1.1-ALv2"
|
||||||
publish = false
|
publish = false
|
||||||
description = "raea make: a scene, kit or shot held to its frozen plan; what's missing and whether it's done, decided in code (docs/make.feature)"
|
description = "raea make's Rust: a scene, kit or shot job's steps, and the record and critic gates raea/goal's packs read (docs/goal.feature)"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
# the plan: `make` on brief.ts
|
# the plan: `make` on brief.ts
|
||||||
@@ -13,10 +13,6 @@ raea-core-brief = { path = "../../core/brief" }
|
|||||||
raea-core-facts = { path = "../../core/facts" }
|
raea-core-facts = { path = "../../core/facts" }
|
||||||
# the parts a render showed closer than their planned detail (MK24)
|
# the parts a render showed closer than their planned detail (MK24)
|
||||||
raea-runtime-lod-plan = { path = "../../runtime/lod-plan" }
|
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" }
|
|
||||||
# a goal job's gates: its commands and a fresh critic's verdict on its words (/goal)
|
|
||||||
raea-runtime-goal-plan = { path = "../../runtime/goal-plan" }
|
|
||||||
# the judge's rounds, passes and blocking defects, read as it keeps them
|
# the judge's rounds, passes and blocking defects, read as it keeps them
|
||||||
raea-app-judge = { path = "../judge" }
|
raea-app-judge = { path = "../judge" }
|
||||||
# the make questions, their calibrations and a sheet's ident, as raea ask keeps them (MK4)
|
# the make questions, their calibrations and a sheet's ident, as raea ask keeps them (MK4)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
//! The second tier of the gate (docs/make.feature MK4): the `make` set of `raea ask` questions (core/ask
|
//! The second tier of the gate (docs/goal.feature MK4): the `make` set of `raea ask` questions (core/ask
|
||||||
//! library/make.json), asked of the job's newest sheets. A question gates once it is calibrated on the person's labels
|
//! library/make.json), asked of the job's newest sheets. A question gates once it is calibrated on the person's labels
|
||||||
//! (`raea ask calibrate`: 16 problem, 16 clean, an AUC of 0.8); until then what it says is advice in the status. An
|
//! (`raea ask calibrate`: 16 problem, 16 clean, an AUC of 0.8); until then what it says is advice in the gates. An
|
||||||
//! answer counts for a sheet only when its call was about exactly that sheet's bytes (the ledger's `ident`), so a sheet
|
//! answer counts for a sheet only when its call was about exactly that sheet's bytes (the ledger's `ident`), so a sheet
|
||||||
//! rendered again must be asked again.
|
//! rendered again must be asked again.
|
||||||
|
|
||||||
@@ -10,7 +10,7 @@ use std::path::{Path, PathBuf};
|
|||||||
use raea_core_ask::{Calibration, Question};
|
use raea_core_ask::{Calibration, Question};
|
||||||
use serde_json::{Value, json};
|
use serde_json::{Value, json};
|
||||||
|
|
||||||
/// The ledger as status reads it: every call's ident by id, every answer, and the person's calibrations.
|
/// The ledger as the gates read it: every call's ident by id, every answer, and the person's calibrations.
|
||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
pub struct Ledger {
|
pub struct Ledger {
|
||||||
pub idents: HashMap<String, String>,
|
pub idents: HashMap<String, String>,
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
//! The plan stop (docs/make.feature MK18, from AnyScene's endpoint/floorplan.py, MIT): before anything is generated,
|
//! The plan stop (docs/goal.feature MK18, from AnyScene's endpoint/floorplan.py, MIT): before anything is generated,
|
||||||
//! the plan drawn so a person can approve it. A floor plan from above (every object's footprint at its `at`, turned by
|
//! the plan drawn so a person can approve it. A floor plan from above (every object's footprint at its `at`, turned by
|
||||||
//! its `rot`, labelled; invented ones dashed, so what came from the reference and what was added are told apart), a
|
//! its `rot`, labelled; invented ones dashed, so what came from the reference and what was added are told apart), a
|
||||||
//! grey-box blockout of the same plan rendered from the entrance and through `raea render --review`, and the
|
//! grey-box blockout of the same plan rendered from the entrance and through `raea render --review`, and the
|
||||||
//! reference beside the blockout on one comparison sheet.
|
//! reference beside the blockout on one comparison sheet.
|
||||||
//!
|
//!
|
||||||
//! raea make plan [DIR] -> review/plan/floor-plan.png, blockout.tsx, blockout.png, comparison.png, colour/clay sheets
|
//! raea make blockout [DIR] -> review/plan/floor-plan.png, blockout.tsx, blockout.png, comparison.png, colour/clay sheets
|
||||||
|
|
||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
|
|
||||||
use raea_core_brief::make::{Make, Object, Origin};
|
use raea_core_brief::goal::{Goal, Object, Origin};
|
||||||
|
|
||||||
use crate::sheet::{Tile, esc, sheet, svg_png};
|
use crate::sheet::{Tile, esc, sheet, svg_png};
|
||||||
use crate::shots::raea;
|
use crate::shots::raea;
|
||||||
@@ -27,7 +27,7 @@ fn height(o: &Object) -> f64 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// The placed objects and the floor they span: (objects with an `at`, [x0, z0, x1, z1] with half a metre around).
|
/// The placed objects and the floor they span: (objects with an `at`, [x0, z0, x1, z1] with half a metre around).
|
||||||
pub fn extent(m: &Make) -> (Vec<&Object>, [f64; 4]) {
|
pub fn extent(m: &Goal) -> (Vec<&Object>, [f64; 4]) {
|
||||||
let placed: Vec<&Object> = m.objects.iter().filter(|o| o.at.is_some()).collect();
|
let placed: Vec<&Object> = m.objects.iter().filter(|o| o.at.is_some()).collect();
|
||||||
let mut b = [0.0f64, 0.0, 1.0, 1.0];
|
let mut b = [0.0f64, 0.0, 1.0, 1.0];
|
||||||
for o in &placed {
|
for o in &placed {
|
||||||
@@ -40,10 +40,10 @@ pub fn extent(m: &Make) -> (Vec<&Object>, [f64; 4]) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// The floor plan as SVG: the entrance (z = 0) at the bottom, a metre grid, each footprint turned and labelled.
|
/// The floor plan as SVG: the entrance (z = 0) at the bottom, a metre grid, each footprint turned and labelled.
|
||||||
pub fn floor_svg(m: &Make) -> Result<String, String> {
|
pub fn floor_svg(m: &Goal) -> Result<String, String> {
|
||||||
let (placed, [x0, z0, x1, z1]) = extent(m);
|
let (placed, [x0, z0, x1, z1]) = extent(m);
|
||||||
if placed.is_empty() {
|
if placed.is_empty() {
|
||||||
return Err("raea make plan: no object has an `at` (where it stands, in metres: x right, z away from the entrance)".into());
|
return Err("raea make blockout: no object has an `at` (where it stands, in metres: x right, z away from the entrance)".into());
|
||||||
}
|
}
|
||||||
let px = (1400.0 / (x1 - x0).max(z1 - z0)).min(260.0);
|
let px = (1400.0 / (x1 - x0).max(z1 - z0)).min(260.0);
|
||||||
let (w, h) = (((x1 - x0) * px).ceil() as u32 + 40, ((z1 - z0) * px).ceil() as u32 + 130);
|
let (w, h) = (((x1 - x0) * px).ceil() as u32 + 40, ((z1 - z0) * px).ceil() as u32 + 130);
|
||||||
@@ -93,7 +93,7 @@ pub fn floor_svg(m: &Make) -> Result<String, String> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// The blockout: a grey box for each placed object at its place and turn on a floor, seen from the entrance.
|
/// The blockout: a grey box for each placed object at its place and turn on a floor, seen from the entrance.
|
||||||
pub fn blockout_tsx(m: &Make) -> String {
|
pub fn blockout_tsx(m: &Goal) -> String {
|
||||||
let (placed, [x0, z0, x1, z1]) = extent(m);
|
let (placed, [x0, z0, x1, z1]) = extent(m);
|
||||||
let mut boxes = String::new();
|
let mut boxes = String::new();
|
||||||
for o in &placed {
|
for o in &placed {
|
||||||
@@ -119,7 +119,7 @@ pub fn blockout_tsx(m: &Make) -> String {
|
|||||||
let (cx, cz) = ((x0 + x1) / 2.0, (z0 + z1) / 2.0);
|
let (cx, cz) = ((x0 + x1) / 2.0, (z0 + z1) / 2.0);
|
||||||
let (fw, fd) = ((x1 - x0) / 2.0, (z1 - z0) / 2.0);
|
let (fw, fd) = ((x1 - x0) / 2.0, (z1 - z0) / 2.0);
|
||||||
format!(
|
format!(
|
||||||
"// written by raea make plan: the plan as grey boxes, seen from the entrance (approve it before anything is made)\nimport {{ AbsoluteFill, Composition, registerRoot }} from \"raea\";\nimport {{ StandardMaterial }} from \"raea/pbr\";\nimport {{ Cuboid, Mesh3d }} from \"raea/mesh\";\nimport {{ AmbientLight, DirectionalLight }} from \"raea/light\";\nimport {{ Transform }} from \"raea/transform\";\nimport {{ Camera3d }} from \"raea/camera\";\n\nfunction Blockout() {{\n return (\n <AbsoluteFill style={{{{ background: \"#cfd3d6\" }}}}>\n <Camera3d transform={{Transform.fromXyz({cx:.3}, 1.6, {ez:.3}).lookingAt([{cx:.3}, 0.9, {cz:.3}])}} projection={{{{ Perspective: {{ fov: (50 * Math.PI) / 180 }} }}}} />\n <AmbientLight brightness={{350}} />\n <DirectionalLight transform={{Transform.fromXyz({lx:.3}, 6, -2).lookingAt([{cx:.3}, 0, {cz:.3}])}} illuminance={{8000}} shadow_maps_enabled />\n <Mesh3d transform={{Transform.fromXyz({cx:.3}, -0.01, {cz:.3})}}>\n <Cuboid half_size={{[{fw:.3}, 0.01, {fd:.3}]}} />\n <StandardMaterial base_color=\"#e6e3dc\" perceptual_roughness={{0.95}} />\n </Mesh3d>\n{boxes} </AbsoluteFill>\n );\n}}\n\nregisterRoot(() => <Composition id=\"blockout\" component={{Blockout}} width={{1280}} height={{720}} fps={{30}} durationInFrames={{1}} />);\n",
|
"// written by raea make blockout: the plan as grey boxes, seen from the entrance (approve it before anything is made)\nimport {{ AbsoluteFill, Composition, registerRoot }} from \"raea\";\nimport {{ StandardMaterial }} from \"raea/pbr\";\nimport {{ Cuboid, Mesh3d }} from \"raea/mesh\";\nimport {{ AmbientLight, DirectionalLight }} from \"raea/light\";\nimport {{ Transform }} from \"raea/transform\";\nimport {{ Camera3d }} from \"raea/camera\";\n\nfunction Blockout() {{\n return (\n <AbsoluteFill style={{{{ background: \"#cfd3d6\" }}}}>\n <Camera3d transform={{Transform.fromXyz({cx:.3}, 1.6, {ez:.3}).lookingAt([{cx:.3}, 0.9, {cz:.3}])}} projection={{{{ Perspective: {{ fov: (50 * Math.PI) / 180 }} }}}} />\n <AmbientLight brightness={{350}} />\n <DirectionalLight transform={{Transform.fromXyz({lx:.3}, 6, -2).lookingAt([{cx:.3}, 0, {cz:.3}])}} illuminance={{8000}} shadow_maps_enabled />\n <Mesh3d transform={{Transform.fromXyz({cx:.3}, -0.01, {cz:.3})}}>\n <Cuboid half_size={{[{fw:.3}, 0.01, {fd:.3}]}} />\n <StandardMaterial base_color=\"#e6e3dc\" perceptual_roughness={{0.95}} />\n </Mesh3d>\n{boxes} </AbsoluteFill>\n );\n}}\n\nregisterRoot(() => <Composition id=\"blockout\" component={{Blockout}} width={{1280}} height={{720}} fps={{30}} durationInFrames={{1}} />);\n",
|
||||||
ez = z0 - 0.4,
|
ez = z0 - 0.4,
|
||||||
lx = cx + 2.0,
|
lx = cx + 2.0,
|
||||||
)
|
)
|
||||||
@@ -130,7 +130,7 @@ pub fn plan_dir(dir: &Path) -> PathBuf {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// The plan stop's pictures: floor plan, blockout (and its review sheets), and the comparison with reference 0.
|
/// The plan stop's pictures: floor plan, blockout (and its review sheets), and the comparison with reference 0.
|
||||||
pub fn draw_plan(dir: &Path, m: &Make, review: bool) -> Result<String, String> {
|
pub fn draw_plan(dir: &Path, m: &Goal, review: bool) -> Result<String, String> {
|
||||||
let out = plan_dir(dir);
|
let out = plan_dir(dir);
|
||||||
std::fs::create_dir_all(&out).map_err(|e| format!("{}: {e}", out.display()))?;
|
std::fs::create_dir_all(&out).map_err(|e| format!("{}: {e}", out.display()))?;
|
||||||
let floor = out.join("floor-plan.png");
|
let floor = out.join("floor-plan.png");
|
||||||
|
|||||||
@@ -1,18 +1,18 @@
|
|||||||
//! Whether a job is done (docs/make.feature MK1), from what's on disk and nothing the agent says: the deliverables, the
|
//! A scene, kit or shot job's record and critic gates (docs/goal.feature MK38), from what's on disk and nothing the agent
|
||||||
//! notes, the record of renders and checks, and the judge's rounds. Pure over a `Job` so it is tested on fixtures.
|
//! says: the record of renders and checks, the parts seen closer than planned, the judge's rounds on the kind's rubric
|
||||||
|
//! and the make questions asked of its sheets. `raea goal gates --json` prints them, and raea/goal's record and critic
|
||||||
|
//! packs hold the job to them (sdk/goal/src/packs/job.ts); deliverables and notes are packs of their own. Pure over a
|
||||||
|
//! `Job` so it is tested on fixtures.
|
||||||
|
|
||||||
use std::{path::{Path, PathBuf}, time::SystemTime};
|
use std::{path::{Path, PathBuf}, time::SystemTime};
|
||||||
|
|
||||||
use raea_core_brief::make::{self, Make};
|
use raea_core_brief::goal::{self, Goal};
|
||||||
use raea_core_facts::{Level, record::Entry};
|
use raea_core_facts::{Level, record::Entry};
|
||||||
use serde_json::{Value, json};
|
use serde_json::{Value, json};
|
||||||
|
|
||||||
/// The heading the notes end with, so the next job (and the skill) learns from this one.
|
/// Everything the gates read, gathered by `lib.rs` (or a test).
|
||||||
pub const SKILL_HEADING: &str = "What the skill got wrong";
|
|
||||||
|
|
||||||
/// Everything status reads, gathered by `lib.rs` (or a test).
|
|
||||||
pub struct Job<'a> {
|
pub struct Job<'a> {
|
||||||
pub make: &'a Make,
|
pub make: &'a Goal,
|
||||||
/// the brief's folder: deliverables, NOTES.md and review/ are relative to it
|
/// the brief's folder: deliverables, NOTES.md and review/ are relative to it
|
||||||
pub dir: &'a Path,
|
pub dir: &'a Path,
|
||||||
/// the project's folder (record paths are relative to it), when it is a raea project
|
/// the project's folder (record paths are relative to it), when it is a raea project
|
||||||
@@ -45,14 +45,14 @@ pub fn round_dir(dir: &Path, round: &Value) -> Option<PathBuf> {
|
|||||||
pub fn sheets(job: &Job) -> Vec<(&'static str, PathBuf)> {
|
pub fn sheets(job: &Job) -> Vec<(&'static str, PathBuf)> {
|
||||||
let mut out = Vec::new();
|
let mut out = Vec::new();
|
||||||
if let Some(r) = job.rounds.last().and_then(|r| round_dir(job.dir, r)) {
|
if let Some(r) = job.rounds.last().and_then(|r| round_dir(job.dir, r)) {
|
||||||
if job.make.kind == make::Kind::Shot {
|
if job.make.kind == goal::Kind::Shot {
|
||||||
out.push(("framing", r.join("framing.png")));
|
out.push(("framing", r.join("framing.png")));
|
||||||
} else {
|
} else {
|
||||||
out.push(("clay", r.join("clay.png")));
|
out.push(("clay", r.join("clay.png")));
|
||||||
out.push(("colour", r.join("colour.png")));
|
out.push(("colour", r.join("colour.png")));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if job.make.kind == make::Kind::Kit {
|
if job.make.kind == goal::Kind::Kit {
|
||||||
out.push(("refs", job.dir.join("review/refs.png")));
|
out.push(("refs", job.dir.join("review/refs.png")));
|
||||||
}
|
}
|
||||||
out.into_iter().filter(|(_, f)| f.is_file()).collect()
|
out.into_iter().filter(|(_, f)| f.is_file()).collect()
|
||||||
@@ -140,9 +140,9 @@ fn critic(job: &Job, newest: Option<SystemTime>, notes: &str) -> Vec<Value> {
|
|||||||
let Some(last) = job.rounds.last() else {
|
let Some(last) = job.rounds.last() else {
|
||||||
let kind = job.make.kind.name();
|
let kind = job.make.kind.name();
|
||||||
let what = match job.make.kind {
|
let what = match job.make.kind {
|
||||||
make::Kind::Kit => "raea render shared/components/KIT/lineup.tsx --review review/r1",
|
goal::Kind::Kit => "raea render shared/components/KIT/lineup.tsx --review review/r1",
|
||||||
make::Kind::Shot => "raea make framing --out review/r1",
|
goal::Kind::Shot => "raea make framing --out review/r1",
|
||||||
make::Kind::Scene | make::Kind::Cut | make::Kind::Goal => "raea render EDIT.tsx --review review/r1",
|
goal::Kind::Scene | goal::Kind::Cut | goal::Kind::Rules => "raea render EDIT.tsx --review review/r1",
|
||||||
};
|
};
|
||||||
return vec![gate("critic", None, false, format!("no round yet: {what}, then raea judge review/r1 --kind {kind} --by claude --brief brief.ts"))];
|
return vec![gate("critic", None, false, format!("no round yet: {what}, then raea judge review/r1 --kind {kind} --by claude --brief brief.ts"))];
|
||||||
};
|
};
|
||||||
@@ -171,76 +171,32 @@ fn critic(job: &Job, newest: Option<SystemTime>, notes: &str) -> Vec<Value> {
|
|||||||
out
|
out
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The job's status: what's missing, each gate, the judge's rounds, and whether the agent may stop.
|
/// The job's gates: each, whether all are clear, and why it's delivered short (out of rounds, or stalled) when it is.
|
||||||
pub fn status(job: &Job) -> Value {
|
pub fn gates(job: &Job) -> Value {
|
||||||
let mut missing = Vec::new();
|
// the newest deliverable: a round judged before it is stale (the deliverables pack says what's missing)
|
||||||
let mut newest: Option<SystemTime> = None;
|
let newest = goal::deliverables(job.make).iter().filter_map(|w| answered(job.dir, w).ok()).flatten().filter_map(|f| mtime(&f)).max();
|
||||||
for want in make::deliverables(job.make) {
|
|
||||||
match answered(job.dir, &want) {
|
|
||||||
Ok(files) => newest = files.iter().filter_map(|f| mtime(f)).chain(newest).max(),
|
|
||||||
Err(why) => missing.push(why),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
let notes = notes_text(job.dir).unwrap_or_default();
|
let notes = notes_text(job.dir).unwrap_or_default();
|
||||||
if job.make.kind != make::Kind::Goal && !notes.to_lowercase().contains(&SKILL_HEADING.to_lowercase()) {
|
|
||||||
missing.push(format!("NOTES.md with a \"{SKILL_HEADING}\" section (one line per thing that cost time; what the guide got wrong for this job)"));
|
|
||||||
}
|
|
||||||
let mut gates = checks(job);
|
let mut gates = checks(job);
|
||||||
gates.extend(lods(job, ¬es));
|
gates.extend(lods(job, ¬es));
|
||||||
// a cut job: its brief's rules over every delivered file (MK25-MK27), and the person's review its critic; a goal's
|
gates.extend(critic(job, newest, ¬es));
|
||||||
let plan = |g: make::Gate| gate(g.name, g.of.as_deref(), g.clear, g.says);
|
|
||||||
match (&job.make.cut, job.make.kind) {
|
|
||||||
(Some(c), make::Kind::Cut) => gates.extend(raea_runtime_cut_plan::gates(c, job.dir).into_iter().map(plan)),
|
|
||||||
(_, make::Kind::Goal) => gates.extend(job.make.goal.iter().flat_map(|g| raea_runtime_goal_plan::gates(g, job.dir)).map(plan)),
|
|
||||||
_ => gates.extend(critic(job, newest, ¬es)),
|
|
||||||
}
|
|
||||||
let (asks, said) = crate::asked::gates(&sheets(job), job.ledger, ¬es);
|
let (asks, said) = crate::asked::gates(&sheets(job), job.ledger, ¬es);
|
||||||
gates.extend(asks);
|
gates.extend(asks);
|
||||||
let cap = job.make.rounds.unwrap_or(make::ROUNDS) as usize;
|
let cap = job.make.rounds.unwrap_or(goal::ROUNDS) as usize;
|
||||||
let capped = job.rounds.len() >= cap;
|
let clear = gates.iter().all(|g| g["clear"] == true);
|
||||||
let stalled = stalled(job.rounds);
|
let mut short = Vec::new();
|
||||||
let clear = missing.is_empty() && gates.iter().all(|g| g["clear"] == true);
|
if job.rounds.len() >= cap && !clear {
|
||||||
let mut why = Vec::new();
|
short.push(format!("capped: {} critic rounds, the most this job gets; delivered with what's still open", job.rounds.len()));
|
||||||
if capped && !clear {
|
|
||||||
why.push(format!("capped: {} critic rounds, the most this job gets; delivered with what's still missing", job.rounds.len()));
|
|
||||||
}
|
}
|
||||||
if stalled && !clear {
|
if stalled(job.rounds) && !clear {
|
||||||
why.push("stalled: three rounds without beating the best before them; delivered with what's still missing".into());
|
short.push("stalled: three rounds without beating the best before them; delivered with what's still open".to_string());
|
||||||
}
|
}
|
||||||
let advice = raea_app_judge::progress(job.rounds);
|
let advice = raea_app_judge::progress(job.rounds);
|
||||||
json!({
|
json!({
|
||||||
"kind": job.make.kind,
|
"kind": job.make.kind,
|
||||||
"done": clear || capped || stalled,
|
"clear": clear,
|
||||||
"short": !clear && (capped || stalled),
|
"short": short,
|
||||||
"missing": missing,
|
|
||||||
"gates": gates,
|
"gates": gates,
|
||||||
"judge": {"rounds": job.rounds.len(), "cap": cap, "passesInARow": advice["passesInARow"], "changeApproach": advice["stall"], "again": advice["again"]},
|
"judge": {"rounds": job.rounds.len(), "cap": cap, "passesInARow": advice["passesInARow"], "changeApproach": advice["stall"], "again": advice["again"]},
|
||||||
"plan": make::doctor(job.make),
|
|
||||||
"files": {"deliverables": make::deliverables(job.make), "previews": make::previews(job.make)},
|
|
||||||
"advice": said,
|
"advice": said,
|
||||||
"why": why,
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The status for a person or an agent to read.
|
|
||||||
pub fn text(s: &Value) -> String {
|
|
||||||
let mut t = vec![format!("make: {} {}", s["kind"].as_str().unwrap_or("?"), if s["done"] == true { if s["short"] == true { "delivered short" } else { "done" } } else { "not done" })];
|
|
||||||
for w in s["why"].as_array().into_iter().flatten() {
|
|
||||||
t.push(format!(" {}", w.as_str().unwrap_or("")));
|
|
||||||
}
|
|
||||||
for (key, head) in [("plan", "plan:"), ("missing", "missing:"), ("advice", "advice (raea ask, not calibrated yet):")] {
|
|
||||||
let items: Vec<&str> = s[key].as_array().into_iter().flatten().filter_map(Value::as_str).collect();
|
|
||||||
if !items.is_empty() {
|
|
||||||
t.push(head.into());
|
|
||||||
t.extend(items.iter().map(|i| format!(" {i}")));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
t.push("gates:".into());
|
|
||||||
for g in s["gates"].as_array().into_iter().flatten() {
|
|
||||||
let of = g["of"].as_str().map(|o| format!(" {o}")).unwrap_or_default();
|
|
||||||
t.push(format!(" {} {}{of}: {}", if g["clear"] == true { "ok " } else { "open" }, g["gate"].as_str().unwrap_or(""), g["says"].as_str().unwrap_or("")));
|
|
||||||
}
|
|
||||||
let j = &s["judge"];
|
|
||||||
if s["kind"] != "goal" { t.push(format!("judge: {} of {} rounds, {} passes in a row{}", j["rounds"], j["cap"], j["passesInARow"], if j["changeApproach"] == true { "; the same defect keeps coming back: change the approach for that part, not the dose" } else { "" })); }
|
|
||||||
t.join("\n")
|
|
||||||
}
|
|
||||||
+11
-11
@@ -1,4 +1,4 @@
|
|||||||
//! A kit's steps (docs/make.feature MK10-MK12, from AnyKit): every object's reference made in one style from the
|
//! A kit's steps (docs/goal.feature MK10-MK12, from AnyKit): every object's reference made in one style from the
|
||||||
//! style images, checked on one sheet before any 3D; each reference to both generators (Tripo H3.1 and Meshy, on fal)
|
//! style images, checked on one sheet before any 3D; each reference to both generators (Tripo H3.1 and Meshy, on fal)
|
||||||
//! and the pick made on clay renders (kitout.rs draws the pick sheets); the pick fitted to its real size with a
|
//! and the pick made on clay renders (kitout.rs draws the pick sheets); the pick fitted to its real size with a
|
||||||
//! quarter-triangle LOD beside it, each with a sidecar saying how it was made.
|
//! quarter-triangle LOD beside it, each with a sidecar saying how it was made.
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
|
|
||||||
use raea_core_brief::make::{Make, Object};
|
use raea_core_brief::goal::{Goal, Object};
|
||||||
use serde_json::{Value, json};
|
use serde_json::{Value, json};
|
||||||
|
|
||||||
use crate::sheet::{Tile, sheet};
|
use crate::sheet::{Tile, sheet};
|
||||||
@@ -27,12 +27,12 @@ const HERO_FACES: u32 = 150_000;
|
|||||||
const PROP_FACES: u32 = 60_000;
|
const PROP_FACES: u32 = 60_000;
|
||||||
|
|
||||||
/// The objects named in `--only` (all when it's empty).
|
/// The objects named in `--only` (all when it's empty).
|
||||||
pub fn objects<'a>(m: &'a Make, only: &[String]) -> Vec<&'a Object> {
|
pub fn objects<'a>(m: &'a Goal, only: &[String]) -> Vec<&'a Object> {
|
||||||
crate::only(&m.objects, only, |o| o.id.as_str())
|
crate::only(&m.objects, only, |o| o.id.as_str())
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The prompt a reference is made from: the plan's style paragraph, the object's own words, the scan template.
|
/// The prompt a reference is made from: the plan's style paragraph, the object's own words, the scan template.
|
||||||
pub fn ref_prompt(m: &Make, o: &Object) -> String {
|
pub fn ref_prompt(m: &Goal, o: &Object) -> String {
|
||||||
let style = m.style.as_deref().unwrap_or("").trim().trim_end_matches('.');
|
let style = m.style.as_deref().unwrap_or("").trim().trim_end_matches('.');
|
||||||
let what = o.prompt.as_deref().unwrap_or(&o.label).trim().trim_end_matches('.');
|
let what = o.prompt.as_deref().unwrap_or(&o.label).trim().trim_end_matches('.');
|
||||||
format!("{style}. {what}. {SCAN}")
|
format!("{style}. {what}. {SCAN}")
|
||||||
@@ -105,7 +105,7 @@ pub fn refs_dir(dir: &Path) -> PathBuf {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Every object's reference, made from the style images (`references`) in the plan's style; then the sheet.
|
/// Every object's reference, made from the style images (`references`) in the plan's style; then the sheet.
|
||||||
pub fn refs(dir: &Path, m: &Make, only: &[String], model: Option<&str>, dry: bool) -> Result<String, String> {
|
pub fn refs(dir: &Path, m: &Goal, only: &[String], model: Option<&str>, dry: bool) -> Result<String, String> {
|
||||||
if m.references.is_empty() {
|
if m.references.is_empty() {
|
||||||
return Err("raea make refs: the plan has no `references` (the style images every reference is made from)".into());
|
return Err("raea make refs: the plan has no `references` (the style images every reference is made from)".into());
|
||||||
}
|
}
|
||||||
@@ -144,7 +144,7 @@ pub fn refs(dir: &Path, m: &Make, only: &[String], model: Option<&str>, dry: boo
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// The reference sheet: the style images first, then every object's reference, labelled with its id and size.
|
/// The reference sheet: the style images first, then every object's reference, labelled with its id and size.
|
||||||
pub fn sheet_refs(dir: &Path, m: &Make) -> Result<String, String> {
|
pub fn sheet_refs(dir: &Path, m: &Goal) -> Result<String, String> {
|
||||||
let style: Vec<Tile> = m.references.iter().enumerate().map(|(i, r)| Tile { img: dir.join(r), label: format!("style {}", i + 1) }).collect();
|
let style: Vec<Tile> = m.references.iter().enumerate().map(|(i, r)| Tile { img: dir.join(r), label: format!("style {}", i + 1) }).collect();
|
||||||
let refs: Vec<Tile> = m
|
let refs: Vec<Tile> = m
|
||||||
.objects
|
.objects
|
||||||
@@ -162,7 +162,7 @@ pub fn sheet_refs(dir: &Path, m: &Make) -> Result<String, String> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// The flow that sends one reference to both generators, each at its face limit.
|
/// The flow that sends one reference to both generators, each at its face limit.
|
||||||
pub fn gen_flow(m: &Make, o: &Object, reference: &Path, tripo: &str, meshy: &str) -> Value {
|
pub fn gen_flow(m: &Goal, o: &Object, reference: &Path, tripo: &str, meshy: &str) -> Value {
|
||||||
let faces = if o.hero == Some(true) { HERO_FACES } else { PROP_FACES };
|
let faces = if o.hero == Some(true) { HERO_FACES } else { PROP_FACES };
|
||||||
let prompt = o.prompt.clone().unwrap_or_else(|| o.label.clone());
|
let prompt = o.prompt.clone().unwrap_or_else(|| o.label.clone());
|
||||||
let _ = m;
|
let _ = m;
|
||||||
@@ -178,7 +178,7 @@ pub fn gen_dir(dir: &Path, id: &str) -> PathBuf {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Every reference to both generators: out/kit/gen/ID/tripo.glb and meshy.glb.
|
/// Every reference to both generators: out/kit/gen/ID/tripo.glb and meshy.glb.
|
||||||
pub fn generate(dir: &Path, m: &Make, only: &[String], tripo: &str, meshy: &str, dry: bool) -> Result<String, String> {
|
pub fn generate(dir: &Path, m: &Goal, only: &[String], tripo: &str, meshy: &str, dry: bool) -> Result<String, String> {
|
||||||
let mut said = Vec::new();
|
let mut said = Vec::new();
|
||||||
let mut spent = 0.0;
|
let mut spent = 0.0;
|
||||||
for o in objects(m, only) {
|
for o in objects(m, only) {
|
||||||
@@ -229,7 +229,7 @@ pub fn picks(dir: &Path) -> serde_json::Map<String, Value> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// One object's pick and why, recorded (MK11).
|
/// One object's pick and why, recorded (MK11).
|
||||||
pub fn choose(dir: &Path, m: &Make, id: &str, generator: &str, why: &str) -> Result<String, String> {
|
pub fn choose(dir: &Path, m: &Goal, id: &str, generator: &str, why: &str) -> Result<String, String> {
|
||||||
if !m.objects.iter().any(|o| o.id == id) {
|
if !m.objects.iter().any(|o| o.id == id) {
|
||||||
return Err(format!("raea make pick: no object `{id}` in the plan"));
|
return Err(format!("raea make pick: no object `{id}` in the plan"));
|
||||||
}
|
}
|
||||||
@@ -256,7 +256,7 @@ fn triangles(glb: &Path) -> Result<u64, String> {
|
|||||||
|
|
||||||
/// Each pick fitted to its real size (front -Y, bottom-centre, metres) and a quarter-triangle LOD1 beside it, each
|
/// Each pick fitted to its real size (front -Y, bottom-centre, metres) and a quarter-triangle LOD1 beside it, each
|
||||||
/// with a sidecar saying how it was made (MK12).
|
/// with a sidecar saying how it was made (MK12).
|
||||||
pub fn prep(dir: &Path, m: &Make, only: &[String]) -> Result<String, String> {
|
pub fn prep(dir: &Path, m: &Goal, only: &[String]) -> Result<String, String> {
|
||||||
let p = picks(dir);
|
let p = picks(dir);
|
||||||
let mut said = Vec::new();
|
let mut said = Vec::new();
|
||||||
for o in objects(m, only) {
|
for o in objects(m, only) {
|
||||||
@@ -284,7 +284,7 @@ pub fn prep(dir: &Path, m: &Make, only: &[String]) -> Result<String, String> {
|
|||||||
// the sidecar the Blender scripts carry along (source, licence, credit) and how it was made: ours, generated
|
// the sidecar the Blender scripts carry along (source, licence, credit) and how it was made: ours, generated
|
||||||
let made = |what: &str, tris: u64| {
|
let made = |what: &str, tris: u64| {
|
||||||
json!({"source": format!("generated by raea make: {model} from out/kit/refs/{}.png", o.id), "license": "ours (generated for this project)", "credit": "",
|
json!({"source": format!("generated by raea make: {model} from out/kit/refs/{}.png", o.id), "license": "ours (generated for this project)", "credit": "",
|
||||||
"made": {"by": "raea make (docs/make.feature)", "route": "gen", "generator": generator, "model": model, "why": pick["why"], "prompt": o.prompt, "reference": format!("out/kit/refs/{}.png", o.id),
|
"made": {"by": "raea make (docs/goal.feature)", "route": "gen", "generator": generator, "model": model, "why": pick["why"], "prompt": o.prompt, "reference": format!("out/kit/refs/{}.png", o.id),
|
||||||
"style": m.style, "what": what, "triangles": tris, "source": if o.source.is_some() { json!(o.source) } else { Value::Null }}})
|
"style": m.style, "what": what, "triangles": tris, "source": if o.source.is_some() { json!(o.source) } else { Value::Null }}})
|
||||||
};
|
};
|
||||||
std::fs::write(full.with_extension("glb.json"), serde_json::to_string_pretty(&made("fitted to its real size", tris)).unwrap_or_default()).map_err(|e| e.to_string())?;
|
std::fs::write(full.with_extension("glb.json"), serde_json::to_string_pretty(&made("fitted to its real size", tris)).unwrap_or_default()).map_err(|e| e.to_string())?;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
//! The kit's sheets and its landing (docs/make.feature MK11, MK13): the pick sheet (each object's reference beside
|
//! The kit's sheets and its landing (docs/goal.feature MK11, MK13): the pick sheet (each object's reference beside
|
||||||
//! both generators' models, each in colour and in clay, drawn in raea), and the kit landed as a component set (one
|
//! both generators' models, each in colour and in clay, drawn in raea), and the kit landed as a component set (one
|
||||||
//! component per object, its model and LOD imported beside it, so it travels as one folder), a `<Lineup>` of them all
|
//! component per object, its model and LOD imported beside it, so it travels as one folder), a `<Lineup>` of them all
|
||||||
//! with a scale bar, a thumb each, and kit.json.
|
//! with a scale bar, a thumb each, and kit.json.
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
|
|
||||||
use raea_core_brief::make::{Make, Object};
|
use raea_core_brief::goal::{Goal, Object};
|
||||||
use serde_json::{Value, json};
|
use serde_json::{Value, json};
|
||||||
|
|
||||||
use crate::kit::{gen_dir, objects, picks};
|
use crate::kit::{gen_dir, objects, picks};
|
||||||
@@ -53,7 +53,7 @@ pub fn draw(model: &Path, h: f64) -> Result<(PathBuf, PathBuf), String> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// The pick sheet: a row an object, its reference, then each generator's model fitted to size, in colour and in clay.
|
/// The pick sheet: a row an object, its reference, then each generator's model fitted to size, in colour and in clay.
|
||||||
pub fn pick_sheet(dir: &Path, m: &Make, only: &[String]) -> Result<String, String> {
|
pub fn pick_sheet(dir: &Path, m: &Goal, only: &[String]) -> Result<String, String> {
|
||||||
let mut rows = Vec::new();
|
let mut rows = Vec::new();
|
||||||
for o in objects(m, only) {
|
for o in objects(m, only) {
|
||||||
let g = gen_dir(dir, &o.id);
|
let g = gen_dir(dir, &o.id);
|
||||||
@@ -99,7 +99,7 @@ pub fn component_name(id: &str) -> String {
|
|||||||
pub fn component(o: &Object, why: &str) -> String {
|
pub fn component(o: &Object, why: &str) -> String {
|
||||||
let n = component_name(&o.id);
|
let n = component_name(&o.id);
|
||||||
format!(
|
format!(
|
||||||
"// raea component add: {label}, {h} m, from the kit's style (raea make kit; {why})\nimport {{ Model }} from \"raea/3d\";\nimport full from \"./{id}.glb\";\nimport far from \"./{id}_lod1.glb\";\n\ntype Props = {{\n position?: [number, number, number];\n rotation?: [number, number, number];\n /** the quarter-triangle model, for when it's small on screen */\n lod?: boolean;\n}};\n\n/** {label}: fitted to its real size, its bottom at the origin, its front toward +z. */\nexport default function {n}({{ position = [0, 0, 0], rotation = [0, 0, 0], lod = false }}: Props) {{\n return <Model src={{lod ? far : full}} position={{position}} rotation={{rotation}} />;\n}}\n",
|
"// raea make component add: {label}, {h} m, from the kit's style (raea make kit; {why})\nimport {{ Model }} from \"raea/3d\";\nimport full from \"./{id}.glb\";\nimport far from \"./{id}_lod1.glb\";\n\ntype Props = {{\n position?: [number, number, number];\n rotation?: [number, number, number];\n /** the quarter-triangle model, for when it's small on screen */\n lod?: boolean;\n}};\n\n/** {label}: fitted to its real size, its bottom at the origin, its front toward +z. */\nexport default function {n}({{ position = [0, 0, 0], rotation = [0, 0, 0], lod = false }}: Props) {{\n return <Model src={{lod ? far : full}} position={{position}} rotation={{rotation}} />;\n}}\n",
|
||||||
label = o.label,
|
label = o.label,
|
||||||
h = tall(o),
|
h = tall(o),
|
||||||
id = o.id,
|
id = o.id,
|
||||||
@@ -109,7 +109,7 @@ pub fn component(o: &Object, why: &str) -> String {
|
|||||||
|
|
||||||
/// The lineup: every component side by side in the plan's order, gaps between, a label each lying in front of the pieces and a
|
/// The lineup: every component side by side in the plan's order, gaps between, a label each lying in front of the pieces and a
|
||||||
/// scale bar (the longest round length the set covers), seen from a little right of centre and above.
|
/// scale bar (the longest round length the set covers), seen from a little right of centre and above.
|
||||||
pub fn lineup(m: &Make, kit: &str) -> String {
|
pub fn lineup(m: &Goal, kit: &str) -> String {
|
||||||
let mut imports = String::new();
|
let mut imports = String::new();
|
||||||
let mut parts = String::new();
|
let mut parts = String::new();
|
||||||
let mut x = 0.0;
|
let mut x = 0.0;
|
||||||
@@ -176,7 +176,7 @@ fn copy(a: &Path, b: &Path) -> Result<(), String> {
|
|||||||
|
|
||||||
/// The kit landed: each prepped object's model, LOD and sidecars, its component and thumb; the lineup and its cover
|
/// The kit landed: each prepped object's model, LOD and sidecars, its component and thumb; the lineup and its cover
|
||||||
/// render; kit.json. Objects not prepped yet are named, not skipped silently.
|
/// render; kit.json. Objects not prepped yet are named, not skipped silently.
|
||||||
pub fn land(dir: &Path, m: &Make, name: Option<&str>, to: Option<&str>) -> Result<String, String> {
|
pub fn land(dir: &Path, m: &Goal, name: Option<&str>, to: Option<&str>) -> Result<String, String> {
|
||||||
let kit = name.map(str::to_string).unwrap_or_else(|| dir.file_name().map(|f| f.to_string_lossy().to_string()).unwrap_or("kit".into()));
|
let kit = name.map(str::to_string).unwrap_or_else(|| dir.file_name().map(|f| f.to_string_lossy().to_string()).unwrap_or("kit".into()));
|
||||||
let dest = kit_dir(dir, &kit, to);
|
let dest = kit_dir(dir, &kit, to);
|
||||||
std::fs::create_dir_all(dest.join("thumbs")).map_err(|e| format!("{}: {e}", dest.display()))?;
|
std::fs::create_dir_all(dest.join("thumbs")).map_err(|e| format!("{}: {e}", dest.display()))?;
|
||||||
@@ -214,10 +214,10 @@ pub fn land(dir: &Path, m: &Make, name: Option<&str>, to: Option<&str>) -> Resul
|
|||||||
std::fs::write(&lineup_tsx, lineup(m, &kit)).map_err(|e| e.to_string())?;
|
std::fs::write(&lineup_tsx, lineup(m, &kit)).map_err(|e| e.to_string())?;
|
||||||
let cover = dest.join("cover.png");
|
let cover = dest.join("cover.png");
|
||||||
raea(&["render".into(), lineup_tsx.display().to_string(), "-o".into(), cover.display().to_string(), "--frame".into(), "0".into()], &[])?;
|
raea(&["render".into(), lineup_tsx.display().to_string(), "-o".into(), cover.display().to_string(), "--frame".into(), "0".into()], &[])?;
|
||||||
let doc = json!({"kit": kit, "style": m.style, "references": m.references, "items": items, "lineup": "lineup.tsx", "cover": "cover.png", "landed": dest.display().to_string(), "made": {"by": "raea make kit (docs/make.feature MK13)"}});
|
let doc = json!({"kit": kit, "style": m.style, "references": m.references, "items": items, "lineup": "lineup.tsx", "cover": "cover.png", "landed": dest.display().to_string(), "made": {"by": "raea make kit (docs/goal.feature MK13)"}});
|
||||||
let text = serde_json::to_string_pretty(&doc).unwrap_or_default();
|
let text = serde_json::to_string_pretty(&doc).unwrap_or_default();
|
||||||
std::fs::write(dest.join("kit.json"), &text).map_err(|e| e.to_string())?;
|
std::fs::write(dest.join("kit.json"), &text).map_err(|e| e.to_string())?;
|
||||||
// the job's own record of it, what `raea make status` counts (core/brief deliverables)
|
// the job's own record of it, what raea/goal's deliverables pack counts
|
||||||
std::fs::write(dir.join("out/kit/kit.json"), &text).map_err(|e| e.to_string())?;
|
std::fs::write(dir.join("out/kit/kit.json"), &text).map_err(|e| e.to_string())?;
|
||||||
copy(&cover, &dir.join("out/kit/lineup.png"))?;
|
copy(&cover, &dir.join("out/kit/lineup.png"))?;
|
||||||
Ok(format!("landed the {kit} kit ({} pieces) in {}: components, lineup.tsx, cover.png, thumbs/, kit.json", items.len(), dest.display()))
|
Ok(format!("landed the {kit} kit ({} pieces) in {}: components, lineup.tsx, cover.png, thumbs/, kit.json", items.len(), dest.display()))
|
||||||
|
|||||||
+60
-61
@@ -1,27 +1,27 @@
|
|||||||
//! `raea make`: a scene, kit or shot made to its frozen plan (`make` on brief.ts, core/brief make.rs) and held to the
|
//! The asset tools for a scene, kit or shot goal (docs/goal.feature): `raea make blockout|refs|...` build to the goal's
|
||||||
//! review loop (docs/make.feature). `status` decides, in code, what's missing and whether the agent may stop; the Stop
|
//! frozen plan (`goal` on brief.ts, core/brief goal.rs), and `raea goal gates` gives the record and critic gates
|
||||||
//! hook (apps/check hook.rs) asks it at the end of every turn.
|
//! raea/goal's packs read. The loop itself, every rule at its moments, is TypeScript: `raea goal check|tasks|seen|judge`
|
||||||
|
//! run sdk/goal/src/run.ts (engine/cli verbs.rs goal_ts).
|
||||||
//!
|
//!
|
||||||
//! raea make status [DIR] [--json] [--plan] (--plan: the gates as check lines in plan.org, MK3)
|
//! raea goal gates [DIR] [--goal NAME] --json (the record and critic gates of a scene, kit or shot goal)
|
||||||
//! raea make plan|refs|sheet refs|gen|pick-sheet|pick|prep|kit|framing|lenschart ... (the steps, USAGE)
|
//! raea make blockout|refs|sheet refs|gen|pick-sheet|pick|prep|kit|framing|lenschart ... (the steps, USAGE)
|
||||||
|
|
||||||
pub mod asked;
|
pub mod asked;
|
||||||
pub mod floor;
|
pub mod floor;
|
||||||
pub mod kit;
|
pub mod kit;
|
||||||
pub mod kitout;
|
pub mod kitout;
|
||||||
pub mod plan;
|
|
||||||
pub mod sheet;
|
pub mod sheet;
|
||||||
pub mod shots;
|
pub mod shots;
|
||||||
pub mod status;
|
pub mod gates;
|
||||||
|
|
||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
|
|
||||||
use raea_core_brief::make::Make;
|
use raea_core_brief::goal::Goal;
|
||||||
use serde_json::Value;
|
use serde_json::Value;
|
||||||
|
|
||||||
pub const USAGE: &str = "raea make status [DIR] [--json] [--plan] (a scene, kit, shot, cut or goal held to its plan, `make` on brief.ts: what's missing, each gate (renders and checks, raea ask's calibrated questions, the critic on the kind's rubric), the judge's rounds, and whether it's done, decided in code; --plan writes the gates as check lines under the job's task in plan.org; the agent's Stop hook holds it there)
|
pub const USAGE: &str = "raea make place FILE [--at S[,S...]] [--box WxH] (the clearest places in a shot for a text box that size, in a 1080-wide frame)
|
||||||
raea make judge [DIR] [--by claude|kimi] (a goal job: a fresh critic, which only reads, judges each `says` rule; review/goal.judge.json)
|
raea goal gates [DIR] [--goal NAME] --json (a scene, kit or shot goal's record and critic gates, as raea/goal's packs read them)
|
||||||
raea make plan [DIR] [--no-review] (the plan stop: review/plan/floor-plan.png, a grey-box blockout from the entrance and its review sheets, comparison.png beside reference 0)
|
raea make blockout [DIR] [--no-review] (a scene's blockout stop: review/plan/floor-plan.png, a grey-box blockout from the entrance and its review sheets, comparison.png beside reference 0)
|
||||||
raea make refs [DIR] [--only ID,...] [--model M] [--dry] (a kit: every object's reference from the style images, in the plan's style, then review/refs.png; --dry quotes it)
|
raea make refs [DIR] [--only ID,...] [--model M] [--dry] (a kit: every object's reference from the style images, in the plan's style, then review/refs.png; --dry quotes it)
|
||||||
raea make sheet refs [DIR] (review/refs.png again: the style images, then every reference)
|
raea make sheet refs [DIR] (review/refs.png again: the style images, then every reference)
|
||||||
raea make gen [DIR] [--only ID,...] [--tripo M] [--meshy M] [--dry] (each reference to both generators, Tripo H3.1 and Meshy on fal: out/kit/gen/ID/)
|
raea make gen [DIR] [--only ID,...] [--tripo M] [--meshy M] [--dry] (each reference to both generators, Tripo H3.1 and Meshy on fal: out/kit/gen/ID/)
|
||||||
@@ -48,23 +48,45 @@ pub fn brief_path(dir: &Path) -> Option<PathBuf> {
|
|||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Whether a brief.ts has a job at all, read from its words: cheap enough for a hook at every turn's end, so the
|
/// Whether a brief.ts has a goal at all, read from its words: cheap enough for a hook at every turn's end, so the
|
||||||
/// module is only evaluated when it can matter.
|
/// module is only evaluated when it can matter.
|
||||||
pub fn has_make(brief: &Path) -> bool {
|
pub fn has_goal(brief: &Path) -> bool {
|
||||||
std::fs::read_to_string(brief).is_ok_and(|t| t.contains("make:") || t.contains("make :"))
|
std::fs::read_to_string(brief).is_ok_and(|t| t.contains("goal:") || t.contains("goal :"))
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The plan from brief.ts, evaluated by `raea spec FILE --as brief` (the module runs; Rust checks it against core/brief).
|
/// The goals of brief.ts, evaluated by `raea spec FILE --as brief` (the module runs; Rust checks it against core/brief).
|
||||||
pub fn read_make(brief: &Path) -> Result<Option<Make>, String> {
|
pub fn read_goals(brief: &Path) -> Result<Vec<Goal>, String> {
|
||||||
let exe = std::env::current_exe().map_err(|e| e.to_string())?;
|
let exe = std::env::current_exe().map_err(|e| e.to_string())?;
|
||||||
let out = std::process::Command::new(exe).arg("spec").arg(brief).args(["--as", "brief"]).env("RAEA_RECORD", "off").output().map_err(|e| e.to_string())?;
|
let out = std::process::Command::new(exe).arg("spec").arg(brief).args(["--as", "brief"]).env("RAEA_RECORD", "off").output().map_err(|e| e.to_string())?;
|
||||||
let text = String::from_utf8_lossy(&out.stdout);
|
let text = String::from_utf8_lossy(&out.stdout);
|
||||||
let start = text.find('{').ok_or_else(|| format!("{} didn't read as a brief: {}", brief.display(), raea_app_judge::why_refused(&out)))?;
|
let start = text.find('{').ok_or_else(|| format!("{} didn't read as a brief: {}", brief.display(), raea_app_judge::why_refused(&out)))?;
|
||||||
let v: Value = serde_json::from_str(&text[start..]).map_err(|e| format!("{}: {e}", brief.display()))?;
|
let v: Value = serde_json::from_str(&text[start..]).map_err(|e| format!("{}: {e}", brief.display()))?;
|
||||||
let b = v.get("brief").cloned().unwrap_or(v);
|
let b = v.get("brief").cloned().unwrap_or(v);
|
||||||
match b.get("make") {
|
match b.get("goal") {
|
||||||
None | Some(Value::Null) => Ok(None),
|
None | Some(Value::Null) => Ok(vec![]),
|
||||||
Some(m) => serde_json::from_value(m.clone()).map(Some).map_err(|e| format!("{}: make: {e}", brief.display())),
|
Some(g) => {
|
||||||
|
let gs: raea_core_brief::goal::Goals = serde_json::from_value(g.clone()).map_err(|e| format!("{}: goal: {e}", brief.display()))?;
|
||||||
|
Ok(gs.all().into_iter().cloned().collect())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// The scene, kit or shot goal the asset tools build to: the one named, else the only one of those kinds.
|
||||||
|
pub fn read_goal(brief: &Path) -> Result<Option<Goal>, String> {
|
||||||
|
read_goal_named(brief, None)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn read_goal_named(brief: &Path, name: Option<&str>) -> Result<Option<Goal>, String> {
|
||||||
|
use raea_core_brief::goal::{name_of, Kind};
|
||||||
|
let all = read_goals(brief)?;
|
||||||
|
if let Some(n) = name {
|
||||||
|
return all.into_iter().find(|g| name_of(g) == n).map(Some).ok_or_else(|| format!("{}: no goal is named {n}", brief.display()));
|
||||||
|
}
|
||||||
|
let mut built: Vec<Goal> = all.into_iter().filter(|g| matches!(g.kind, Kind::Scene | Kind::Kit | Kind::Shot)).collect();
|
||||||
|
match built.len() {
|
||||||
|
0 => Ok(None),
|
||||||
|
1 => Ok(built.pop()),
|
||||||
|
_ => Err(format!("{}: several scene, kit or shot goals ({}): name one with --goal", brief.display(), built.iter().map(name_of).collect::<Vec<_>>().join(", "))),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -74,7 +96,7 @@ fn judged(dir: &Path) -> (Vec<Value>, Option<Value>, Option<std::time::SystemTim
|
|||||||
let log = dir.join("review").join("judge.log.jsonl");
|
let log = dir.join("review").join("judge.log.jsonl");
|
||||||
let rounds: Vec<Value> = std::fs::read_to_string(&log).unwrap_or_default().lines().filter_map(|l| serde_json::from_str(l).ok()).collect();
|
let rounds: Vec<Value> = std::fs::read_to_string(&log).unwrap_or_default().lines().filter_map(|l| serde_json::from_str(l).ok()).collect();
|
||||||
let verdict = rounds.last().and_then(|r| {
|
let verdict = rounds.last().and_then(|r| {
|
||||||
let d = status::round_dir(dir, r)?;
|
let d = gates::round_dir(dir, r)?;
|
||||||
let file = r["by"].as_str().filter(|b| *b != "clef").map_or_else(|| "judge.json".to_string(), |b| format!("judge.{b}.json"));
|
let file = r["by"].as_str().filter(|b| *b != "clef").map_or_else(|| "judge.json".to_string(), |b| format!("judge.{b}.json"));
|
||||||
serde_json::from_str(&std::fs::read_to_string(d.join(file)).ok()?).ok()
|
serde_json::from_str(&std::fs::read_to_string(d.join(file)).ok()?).ok()
|
||||||
});
|
});
|
||||||
@@ -82,28 +104,21 @@ fn judged(dir: &Path) -> (Vec<Value>, Option<Value>, Option<std::time::SystemTim
|
|||||||
(rounds, verdict, at)
|
(rounds, verdict, at)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The status of the job whose brief is at `brief`, with its plan already read.
|
/// The record and critic gates of the job whose brief is at `brief`, with its plan already read.
|
||||||
pub fn status_of(brief: &Path, make: &Make) -> Value {
|
pub fn gates_of(brief: &Path, make: &Goal) -> Value {
|
||||||
let dir = brief.parent().unwrap_or(Path::new("."));
|
let dir = brief.parent().unwrap_or(Path::new("."));
|
||||||
let project = raea_core_facts::record::up(dir, ".raea/project");
|
let project = raea_core_facts::record::up(dir, ".raea/project");
|
||||||
let record = project.as_deref().map(raea_core_facts::record::read).unwrap_or_default();
|
let record = project.as_deref().map(raea_core_facts::record::read).unwrap_or_default();
|
||||||
let (rounds, verdict, judged_at) = judged(dir);
|
let (rounds, verdict, judged_at) = judged(dir);
|
||||||
let ledger = asked::Ledger::read();
|
let ledger = asked::Ledger::read();
|
||||||
let job = status::Job { make, dir, project: project.as_deref(), record: &record, rounds: &rounds, verdict: verdict.as_ref(), judged_at, ledger: &ledger, score_gates: raea_app_judge::kind_gates(make.kind.name()) };
|
let job = gates::Job { make, dir, project: project.as_deref(), record: &record, rounds: &rounds, verdict: verdict.as_ref(), judged_at, ledger: &ledger, score_gates: raea_app_judge::kind_gates(make.kind.name()) };
|
||||||
let mut s = status::status(&job);
|
let mut s = gates::gates(&job);
|
||||||
s["brief"] = Value::String(brief.display().to_string());
|
s["brief"] = Value::String(brief.display().to_string());
|
||||||
s
|
s
|
||||||
}
|
}
|
||||||
|
|
||||||
/// For the hook: the job's status from a folder, None when there's no job there (no brief.ts, or no `make` on it).
|
|
||||||
pub fn status_in(dir: &Path) -> Result<Option<Value>, String> {
|
|
||||||
let Some(brief) = brief_path(dir).filter(|b| has_make(b)) else { return Ok(None) };
|
|
||||||
let Some(make) = read_make(&brief)? else { return Ok(None) };
|
|
||||||
Ok(Some(status_of(&brief, &make)))
|
|
||||||
}
|
|
||||||
|
|
||||||
/// The flags that take a value: what follows them isn't a positional argument.
|
/// The flags that take a value: what follows them isn't a positional argument.
|
||||||
const VALUED: [&str; 8] = ["--only", "--model", "--tripo", "--meshy", "--name", "--to", "--out", "--by"];
|
const VALUED: [&str; 9] = ["--only", "--model", "--tripo", "--meshy", "--name", "--to", "--out", "--by", "--goal"];
|
||||||
|
|
||||||
fn flag<'a>(args: &'a [String], k: &str) -> Option<&'a str> {
|
fn flag<'a>(args: &'a [String], k: &str) -> Option<&'a str> {
|
||||||
args.iter().position(|a| a == k).and_then(|i| args.get(i + 1)).map(String::as_str)
|
args.iter().position(|a| a == k).and_then(|i| args.get(i + 1)).map(String::as_str)
|
||||||
@@ -138,10 +153,10 @@ pub(crate) fn only<'a, T>(all: &'a [T], only: &[String], name: impl Fn(&T) -> &s
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// The job's brief and plan from a folder.
|
/// The job's brief and plan from a folder.
|
||||||
fn job(dir: &Path) -> Result<(PathBuf, Make), String> {
|
fn job(dir: &Path, name: Option<&str>) -> Result<(PathBuf, Goal), String> {
|
||||||
let brief = brief_path(dir).ok_or_else(|| format!("raea make: no brief.ts at or above {} in its project", dir.display()))?;
|
let brief = brief_path(dir).ok_or_else(|| format!("no brief.ts at or above {} in its project", dir.display()))?;
|
||||||
let make = read_make(&brief)?.ok_or_else(|| format!("raea make: {} has no `make` (scene(), kit() or shot() from raea/brief)", brief.display()))?;
|
let goal = read_goal_named(&brief, name)?.ok_or_else(|| format!("{} has no scene, kit or shot goal (`goal: scene({{...}})`, kit() or shot() from raea/brief)", brief.display()))?;
|
||||||
Ok((brief, make))
|
Ok((brief, goal))
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The steps: each reads the plan from DIR's brief.ts and works beside it.
|
/// The steps: each reads the plan from DIR's brief.ts and works beside it.
|
||||||
@@ -157,13 +172,13 @@ fn step(verb: &str, args: &[String]) -> Result<String, String> {
|
|||||||
return Err(USAGE.into());
|
return Err(USAGE.into());
|
||||||
}
|
}
|
||||||
let dir = pos.get(dir_at).map(PathBuf::from).unwrap_or_else(|| PathBuf::from("."));
|
let dir = pos.get(dir_at).map(PathBuf::from).unwrap_or_else(|| PathBuf::from("."));
|
||||||
let (brief, m) = job(&dir)?;
|
let (brief, m) = job(&dir, flag(args, "--goal"))?;
|
||||||
let here = brief.parent().unwrap_or(Path::new(".")).to_path_buf();
|
let here = brief.parent().unwrap_or(Path::new(".")).to_path_buf();
|
||||||
let only = list(args, "--only");
|
let only = list(args, "--only");
|
||||||
let dry = args.iter().any(|a| a == "--dry");
|
let dry = args.iter().any(|a| a == "--dry");
|
||||||
let out_or = |d: PathBuf| flag(args, "--out").map(PathBuf::from).unwrap_or(d);
|
let out_or = |d: PathBuf| flag(args, "--out").map(PathBuf::from).unwrap_or(d);
|
||||||
match verb {
|
match verb {
|
||||||
"plan" => floor::draw_plan(&here, &m, !args.iter().any(|a| a == "--no-review")),
|
"blockout" => floor::draw_plan(&here, &m, !args.iter().any(|a| a == "--no-review")),
|
||||||
"refs" => kit::refs(&here, &m, &only, flag(args, "--model"), dry),
|
"refs" => kit::refs(&here, &m, &only, flag(args, "--model"), dry),
|
||||||
"sheet" => match args.get(2).map(String::as_str) {
|
"sheet" => match args.get(2).map(String::as_str) {
|
||||||
Some("refs") => kit::sheet_refs(&here, &m),
|
Some("refs") => kit::sheet_refs(&here, &m),
|
||||||
@@ -184,30 +199,14 @@ fn step(verb: &str, args: &[String]) -> Result<String, String> {
|
|||||||
|
|
||||||
pub fn cli(args: &[String]) -> Result<String, String> {
|
pub fn cli(args: &[String]) -> Result<String, String> {
|
||||||
match args.get(1).map(String::as_str) {
|
match args.get(1).map(String::as_str) {
|
||||||
Some("status") => {}
|
Some("gates") => {
|
||||||
Some("judge") => return job(&PathBuf::from(positional(args, 2).first().map_or(".", String::as_str))).and_then(|(b, m)| raea_runtime_goal_plan::judge(m.goal.as_ref().ok_or("raea make judge: the job isn't a goal({...})")?, b.parent().unwrap_or(Path::new(".")), flag(args, "--by").unwrap_or("claude")).map(|v| serde_json::to_string_pretty(&v).unwrap_or_default())),
|
let dir = positional(args, 2).first().map(PathBuf::from).unwrap_or_else(|| PathBuf::from("."));
|
||||||
Some(v @ ("plan" | "refs" | "sheet" | "gen" | "pick-sheet" | "pick" | "prep" | "kit" | "framing" | "lenschart")) => return step(v, args),
|
let (brief, make) = job(&dir, flag(args, "--goal"))?;
|
||||||
_ => return Err(USAGE.into()),
|
Ok(serde_json::to_string_pretty(&gates_of(&brief, &make)).unwrap_or_default())
|
||||||
|
}
|
||||||
|
Some(v @ ("blockout" | "refs" | "sheet" | "gen" | "pick-sheet" | "pick" | "prep" | "kit" | "framing" | "lenschart")) => step(v, args),
|
||||||
|
_ => Err(USAGE.into()),
|
||||||
}
|
}
|
||||||
let dir = positional(args, 2).first().map(PathBuf::from).unwrap_or_else(|| PathBuf::from("."));
|
|
||||||
let (brief, make) = job(&dir)?;
|
|
||||||
let mut s = status_of(&brief, &make);
|
|
||||||
if args.iter().any(|a| a == "--plan") {
|
|
||||||
let dir = brief.parent().unwrap_or(Path::new("."));
|
|
||||||
let root = raea_core_facts::record::up(dir, ".raea/project").unwrap_or_else(|| dir.to_path_buf());
|
|
||||||
let kind = s["kind"].as_str().unwrap_or("make").to_string();
|
|
||||||
let (file, task) = plan::write(&root, &brief, &kind, &s)?;
|
|
||||||
s["planOrg"] = Value::String(file.display().to_string());
|
|
||||||
s["planTask"] = Value::String(task);
|
|
||||||
}
|
|
||||||
if args.iter().any(|a| a == "--json") {
|
|
||||||
return Ok(serde_json::to_string_pretty(&s).unwrap_or_default());
|
|
||||||
}
|
|
||||||
let mut t = status::text(&s);
|
|
||||||
if let (Some(p), Some(task)) = (s["planOrg"].as_str(), s["planTask"].as_str()) {
|
|
||||||
t.push_str(&format!("\nplan.org: the gates are check lines under task {task} in {p}"));
|
|
||||||
}
|
|
||||||
Ok(t)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
|||||||
@@ -1,95 +0,0 @@
|
|||||||
//! The job's gates in the project's plan.org (docs/make.feature MK3; docs/plan.feature PL1): one task, its :ID: from the
|
|
||||||
//! brief's path, each gate and each missing thing a check line under it with a progress cookie, so the person, the app
|
|
||||||
//! and raea cloud read the same list the Stop hook holds the agent to. MAKING while it isn't done, REVIEW once it is
|
|
||||||
//! (the person closes it); a task the person marked DONE or DROPPED keeps their mark, and their own lines under it stay.
|
|
||||||
|
|
||||||
use std::path::Path;
|
|
||||||
|
|
||||||
use serde_json::Value;
|
|
||||||
|
|
||||||
/// The task's id: t- and eight letters and digits (PL1b), the same for the same brief.
|
|
||||||
pub fn task_id(brief_rel: &str) -> String {
|
|
||||||
let h = brief_rel.bytes().fold(0xcbf2_9ce4_8422_2325u64, |h, b| (h ^ b as u64).wrapping_mul(0x0100_0000_01b3));
|
|
||||||
format!("t-mk{:06x}", h & 0xff_ffff)
|
|
||||||
}
|
|
||||||
|
|
||||||
fn is_check(line: &str) -> bool {
|
|
||||||
let t = line.trim_start();
|
|
||||||
let rest = t.strip_prefix("- ").or_else(|| t.strip_prefix("+ "));
|
|
||||||
rest.is_some_and(|r| r.starts_with("[ ]") || r.starts_with("[X]") || r.starts_with("[x]") || r.starts_with("[-]"))
|
|
||||||
}
|
|
||||||
|
|
||||||
fn short(s: &str) -> String {
|
|
||||||
let s = s.replace('\n', " ");
|
|
||||||
if s.chars().count() > 140 { format!("{}…", s.chars().take(139).collect::<String>()) } else { s }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// The check lines for a status: what's missing, then each gate.
|
|
||||||
pub fn checks(status: &Value) -> Vec<(bool, String)> {
|
|
||||||
let mut out: Vec<(bool, String)> = Vec::new();
|
|
||||||
for m in status["missing"].as_array().into_iter().flatten().filter_map(Value::as_str) {
|
|
||||||
out.push((false, format!("missing: {}", short(m))));
|
|
||||||
}
|
|
||||||
for g in status["gates"].as_array().into_iter().flatten() {
|
|
||||||
let of = g["of"].as_str().map(|o| format!(" {o}")).unwrap_or_default();
|
|
||||||
out.push((g["clear"] == true, format!("{}{of}: {}", g["gate"].as_str().unwrap_or("gate"), short(g["says"].as_str().unwrap_or("")))));
|
|
||||||
}
|
|
||||||
out
|
|
||||||
}
|
|
||||||
|
|
||||||
/// plan.org's text with the job's task brought up to date (made at the end when it isn't there).
|
|
||||||
pub fn update(text: &str, title: &str, brief_rel: &str, kind: &str, status: &Value) -> String {
|
|
||||||
let id = task_id(brief_rel);
|
|
||||||
let lines: Vec<&str> = text.lines().collect();
|
|
||||||
let done = status["done"] == true;
|
|
||||||
let cs = checks(status);
|
|
||||||
let cookie = format!("[{}/{}]", cs.iter().filter(|c| c.0).count(), cs.len());
|
|
||||||
let check_lines: Vec<String> = cs.iter().map(|(d, t)| format!("- [{}] {t}", if *d { "X" } else { " " })).collect();
|
|
||||||
let id_line = lines.iter().position(|l| l.trim() == format!(":ID: {id}") || l.trim() == format!(":ID: {id}"));
|
|
||||||
let Some(id_at) = id_line else {
|
|
||||||
let mut out = if text.trim().is_empty() { format!("#+TITLE: {title}\n#+TODO: TODO MAKING REVIEW | DONE DROPPED\n") } else { text.trim_end().to_string() + "\n" };
|
|
||||||
out.push_str(&format!("\n* {} make: {kind} ({brief_rel}) {cookie}\n:PROPERTIES:\n:ID: {id}\n:KIND: make\n:VERB: {kind}\n:END:\n", if done { "REVIEW" } else { "MAKING" }));
|
|
||||||
out.push_str(&(check_lines.join("\n") + "\n"));
|
|
||||||
return out;
|
|
||||||
};
|
|
||||||
let head = (0..id_at).rev().find(|&i| lines[i].starts_with('*')).unwrap_or(0);
|
|
||||||
let stars = lines[head].chars().take_while(|c| *c == '*').count();
|
|
||||||
let end = (id_at + 1..lines.len()).find(|&i| lines[i].starts_with('*') && lines[i].chars().take_while(|c| *c == '*').count() <= stars).unwrap_or(lines.len());
|
|
||||||
let drawer_end = (id_at..end).find(|&i| lines[i].trim() == ":END:").unwrap_or(id_at);
|
|
||||||
// the headline: its keyword brought up to date unless the person closed it, its cookie replaced
|
|
||||||
let words: Vec<&str> = lines[head][stars..].split_whitespace().collect();
|
|
||||||
let kw = words.first().copied().unwrap_or("");
|
|
||||||
let closed = kw == "DONE" || kw == "DROPPED";
|
|
||||||
let rest: Vec<&str> = words.iter().skip(if ["TODO", "MAKING", "REVIEW", "DONE", "DROPPED"].contains(&kw) { 1 } else { 0 }).copied().filter(|w| !(w.starts_with('[') && w.ends_with(']') && w.contains('/'))).collect();
|
|
||||||
let kw = if closed { kw } else if done { "REVIEW" } else { "MAKING" };
|
|
||||||
let headline = format!("{} {kw} {} {cookie}", "*".repeat(stars), rest.join(" "));
|
|
||||||
let theirs: Vec<&str> = lines[drawer_end + 1..end].iter().copied().filter(|l| !is_check(l)).collect();
|
|
||||||
let mut out: Vec<String> = lines[..head].iter().map(|l| l.to_string()).collect();
|
|
||||||
out.push(headline);
|
|
||||||
out.extend(lines[head + 1..=drawer_end].iter().map(|l| l.to_string()));
|
|
||||||
out.extend(check_lines);
|
|
||||||
out.extend(theirs.iter().map(|l| l.to_string()));
|
|
||||||
out.extend(lines[end..].iter().map(|l| l.to_string()));
|
|
||||||
out.join("\n") + "\n"
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Writes the job's task into plan.org at the top of `root` (the project's folder, else the brief's): the file and the
|
|
||||||
/// task's id.
|
|
||||||
pub fn write(root: &Path, brief: &Path, kind: &str, status: &Value) -> Result<(std::path::PathBuf, String), String> {
|
|
||||||
let file = root.join("plan.org");
|
|
||||||
let rel = brief.strip_prefix(root).unwrap_or(brief).to_string_lossy().replace('\\', "/");
|
|
||||||
let title = root.file_name().map(|n| n.to_string_lossy().to_string()).unwrap_or_else(|| "plan".into());
|
|
||||||
let text = std::fs::read_to_string(&file).unwrap_or_default();
|
|
||||||
let next = update(&text, &title, &rel, kind, status);
|
|
||||||
if next != text {
|
|
||||||
replace(&file, &next).map_err(|e| format!("{}: {e}", file.display()))?;
|
|
||||||
}
|
|
||||||
Ok((file, task_id(&rel)))
|
|
||||||
}
|
|
||||||
|
|
||||||
/// A file's text replaced: written beside it, then moved over it, so a reader never sees half a plan.
|
|
||||||
fn replace(file: &Path, text: &str) -> std::io::Result<()> {
|
|
||||||
let tmp = file.with_extension("org.tmp");
|
|
||||||
std::fs::write(&tmp, text)?;
|
|
||||||
std::fs::rename(&tmp, file)
|
|
||||||
}
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
//! The contact sheets a gate looks at (docs/make.feature MK10, MK11, MK15): pictures in rows, each labelled under it,
|
//! The contact sheets a gate looks at (docs/goal.feature MK10, MK11, MK15): pictures in rows, each labelled under it,
|
||||||
//! a title over them, on one PNG a person, `raea ask` and the critic read at once. Labels are drawn by resvg in the
|
//! a title over them, on one PNG a person, `raea ask` and the critic read at once. Labels are drawn by resvg in the
|
||||||
//! system's own fonts; an SVG drawn whole (the floor plan, MK18) goes through `svg_png`.
|
//! system's own fonts; an SVG drawn whole (the floor plan, MK18) goes through `svg_png`.
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
//! Blocking a shot list (docs/make.feature MK15): `raea make framing` renders each shot's first, middle and last
|
//! Blocking a shot list (docs/goal.feature MK15): `raea make framing` renders each shot's first, middle and last
|
||||||
//! frame and puts them on one sheet, a row a shot, each stamped with its name and time, so the person, `raea ask`
|
//! frame and puts them on one sheet, a row a shot, each stamped with its name and time, so the person, `raea ask`
|
||||||
//! (make.framing.*) and the critic (`raea judge --kind shot`) see every shot's start and end at once; `raea make
|
//! (make.framing.*) and the critic (`raea judge --kind shot`) see every shot's start and end at once; `raea make
|
||||||
//! lenschart SHOT` renders a shot's first frame at 18, 24, 35, 50, 85 and 135 mm (RAEA_LENS, core/review) to choose its
|
//! lenschart SHOT` renders a shot's first frame at 18, 24, 35, 50, 85 and 135 mm (RAEA_LENS, core/review) to choose its
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
|
|
||||||
use raea_core_brief::make::{Make, Shot};
|
use raea_core_brief::goal::{Goal, Shot};
|
||||||
|
|
||||||
use crate::sheet::{Tile, sheet};
|
use crate::sheet::{Tile, sheet};
|
||||||
|
|
||||||
@@ -62,7 +62,7 @@ fn composition(dir: &Path, s: &Shot) -> Result<PathBuf, String> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// The framing sheet of the plan's shots (or those named in `only`), written to `out` (OUT/framing.png).
|
/// The framing sheet of the plan's shots (or those named in `only`), written to `out` (OUT/framing.png).
|
||||||
pub fn framing(dir: &Path, m: &Make, only: &[String], out: &Path) -> Result<String, String> {
|
pub fn framing(dir: &Path, m: &Goal, only: &[String], out: &Path) -> Result<String, String> {
|
||||||
let shots: Vec<&Shot> = crate::only(&m.shots, only, |s| s.name.as_str());
|
let shots: Vec<&Shot> = crate::only(&m.shots, only, |s| s.name.as_str());
|
||||||
if shots.is_empty() {
|
if shots.is_empty() {
|
||||||
return Err("raea make framing: no shots in the plan (or none named)".into());
|
return Err("raea make framing: no shots in the plan (or none named)".into());
|
||||||
@@ -86,7 +86,7 @@ pub fn framing(dir: &Path, m: &Make, only: &[String], out: &Path) -> Result<Stri
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// One shot's first frame at every lens of the chart, on one sheet (OUT/lens-SHOT.png).
|
/// One shot's first frame at every lens of the chart, on one sheet (OUT/lens-SHOT.png).
|
||||||
pub fn lenschart(dir: &Path, m: &Make, name: &str, out: &Path) -> Result<String, String> {
|
pub fn lenschart(dir: &Path, m: &Goal, name: &str, out: &Path) -> Result<String, String> {
|
||||||
let s = m.shots.iter().find(|s| s.name == name).ok_or_else(|| format!("raea make lenschart: no shot `{name}` in the plan"))?;
|
let s = m.shots.iter().find(|s| s.name == name).ok_or_else(|| format!("raea make lenschart: no shot `{name}` in the plan"))?;
|
||||||
let tsx = composition(dir, s)?;
|
let tsx = composition(dir, s)?;
|
||||||
let work = out.join("lens-frames").join(name);
|
let work = out.join("lens-frames").join(name);
|
||||||
|
|||||||
+28
-70
@@ -1,12 +1,12 @@
|
|||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use std::time::{Duration, SystemTime};
|
use std::time::{Duration, SystemTime};
|
||||||
|
|
||||||
use raea_core_brief::{make::Make, read};
|
use raea_core_brief::{goal::Goal, read};
|
||||||
use raea_core_facts::record::Entry;
|
use raea_core_facts::record::Entry;
|
||||||
use serde_json::{Value, json};
|
use serde_json::{Value, json};
|
||||||
|
|
||||||
use crate::asked::Ledger;
|
use crate::asked::Ledger;
|
||||||
use crate::status::{Job, status, stalled};
|
use crate::gates::{Job, gates, stalled};
|
||||||
|
|
||||||
fn dir(name: &str) -> PathBuf {
|
fn dir(name: &str) -> PathBuf {
|
||||||
let d = std::env::temp_dir().join(format!("raea-make-{name}-{}", std::process::id()));
|
let d = std::env::temp_dir().join(format!("raea-make-{name}-{}", std::process::id()));
|
||||||
@@ -21,7 +21,7 @@ fn put(d: &PathBuf, rel: &str, text: &str) {
|
|||||||
std::fs::write(p, text).unwrap();
|
std::fs::write(p, text).unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
fn kit() -> Make {
|
fn kit() -> Goal {
|
||||||
read("make", r#"{"kind": "kit", "style": "1970s desk, maker Aurora", "objects": [{"id": "phone", "label": "Phone", "h": 0.12, "prompt": "a rotary phone"}]}"#).unwrap()
|
read("make", r#"{"kind": "kit", "style": "1970s desk, maker Aurora", "objects": [{"id": "phone", "label": "Phone", "h": 0.12, "prompt": "a rotary phone"}]}"#).unwrap()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -36,35 +36,25 @@ fn round(pass: bool, mean: f64, defects: Value) -> Value {
|
|||||||
json!({"dir": "review/r1", "kind": "kit", "pass": pass, "mean": mean, "defects": defects})
|
json!({"dir": "review/r1", "kind": "kit", "pass": pass, "mean": mean, "defects": defects})
|
||||||
}
|
}
|
||||||
|
|
||||||
fn run(make: &Make, d: &PathBuf, record: &[Entry], rounds: &[Value], judged_at: Option<SystemTime>) -> Value {
|
fn run(make: &Goal, d: &PathBuf, record: &[Entry], rounds: &[Value], judged_at: Option<SystemTime>) -> Value {
|
||||||
run_with(make, d, record, rounds, judged_at, &Ledger::default())
|
run_with(make, d, record, rounds, judged_at, &Ledger::default())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn run_with(make: &Make, d: &PathBuf, record: &[Entry], rounds: &[Value], judged_at: Option<SystemTime>, ledger: &Ledger) -> Value {
|
fn run_with(make: &Goal, d: &PathBuf, record: &[Entry], rounds: &[Value], judged_at: Option<SystemTime>, ledger: &Ledger) -> Value {
|
||||||
status(&Job { make, dir: d, project: None, record, rounds, verdict: None, judged_at, ledger, score_gates: false })
|
gates(&Job { make, dir: d, project: None, record, rounds, verdict: None, judged_at, ledger, score_gates: false })
|
||||||
}
|
}
|
||||||
|
|
||||||
fn later() -> Option<SystemTime> {
|
fn later() -> Option<SystemTime> {
|
||||||
Some(SystemTime::now() + Duration::from_secs(5))
|
Some(SystemTime::now() + Duration::from_secs(5))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn nothing_made_is_not_done_and_says_what_is_missing() {
|
|
||||||
let d = dir("empty");
|
|
||||||
let s = run(&kit(), &d, &[], &[], None);
|
|
||||||
assert_eq!(s["done"], false);
|
|
||||||
let missing = s["missing"].to_string();
|
|
||||||
assert!(missing.contains("out/kit/phone/phone_lod1.glb") && missing.contains("NOTES.md"), "{missing}");
|
|
||||||
assert!(s["gates"].as_array().unwrap().iter().any(|g| g["gate"] == "critic" && g["clear"] == false));
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn delivered_and_judged_after_is_done() {
|
fn delivered_and_judged_after_is_done() {
|
||||||
let d = dir("done");
|
let d = dir("done");
|
||||||
delivered(&d);
|
delivered(&d);
|
||||||
let s = run(&kit(), &d, &[], &[round(true, 7.5, json!([]))], later());
|
let s = run(&kit(), &d, &[], &[round(true, 7.5, json!([]))], later());
|
||||||
assert_eq!(s["done"], true, "{s:#}");
|
assert_eq!(s["clear"], true, "{s:#}");
|
||||||
assert_eq!(s["short"], false);
|
assert_eq!(s["short"], json!([]));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -72,7 +62,7 @@ fn a_round_older_than_the_newest_deliverable_is_stale() {
|
|||||||
let d = dir("stale");
|
let d = dir("stale");
|
||||||
delivered(&d);
|
delivered(&d);
|
||||||
let s = run(&kit(), &d, &[], &[round(true, 7.5, json!([]))], Some(SystemTime::UNIX_EPOCH));
|
let s = run(&kit(), &d, &[], &[round(true, 7.5, json!([]))], Some(SystemTime::UNIX_EPOCH));
|
||||||
assert_eq!(s["done"], false);
|
assert_eq!(s["clear"], false);
|
||||||
assert!(s["gates"].to_string().contains("came after the last round"), "{s:#}");
|
assert!(s["gates"].to_string().contains("came after the last round"), "{s:#}");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -82,25 +72,27 @@ fn a_blocking_defect_must_be_fixed_or_answered_in_the_notes() {
|
|||||||
delivered(&d);
|
delivered(&d);
|
||||||
let defects = json!([{"defect": "floating", "present": true, "level": "blocking"}]);
|
let defects = json!([{"defect": "floating", "present": true, "level": "blocking"}]);
|
||||||
let s = run(&kit(), &d, &[], &[round(false, 6.0, defects.clone())], later());
|
let s = run(&kit(), &d, &[], &[round(false, 6.0, defects.clone())], later());
|
||||||
assert_eq!(s["done"], false);
|
assert_eq!(s["clear"], false);
|
||||||
assert!(s["gates"].to_string().contains("floating"));
|
assert!(s["gates"].to_string().contains("floating"));
|
||||||
put(&d, "NOTES.md", "## What the skill got wrong\n- floating: the handset rests in its cradle; the judge read its shadow as a gap\n");
|
put(&d, "NOTES.md", "## What the skill got wrong\n- floating: the handset rests in its cradle; the judge read its shadow as a gap\n");
|
||||||
let s = run(&kit(), &d, &[], &[round(false, 6.0, defects.clone())], later());
|
let s = run(&kit(), &d, &[], &[round(false, 6.0, defects.clone())], later());
|
||||||
assert_eq!(s["done"], true, "{s:#}");
|
assert_eq!(s["clear"], true, "{s:#}");
|
||||||
// once the judge is calibrated for kits, its score gates too: two passes in a row (MK6)
|
// once the judge is calibrated for kits, its score gates too: two passes in a row (MK6)
|
||||||
let (rounds, ledger) = ([round(false, 6.0, defects)], Ledger::default());
|
let (rounds, ledger) = ([round(false, 6.0, defects)], Ledger::default());
|
||||||
let s = status(&Job { make: &kit(), dir: &d, project: None, record: &[], rounds: &rounds, verdict: None, judged_at: later(), ledger: &ledger, score_gates: true });
|
let s = gates(&Job { make: &kit(), dir: &d, project: None, record: &[], rounds: &rounds, verdict: None, judged_at: later(), ledger: &ledger, score_gates: true });
|
||||||
assert_eq!(s["done"], false, "{s:#}");
|
assert_eq!(s["clear"], false, "{s:#}");
|
||||||
assert!(s["gates"].to_string().contains("two needed"), "{s:#}");
|
assert!(s["gates"].to_string().contains("two needed"), "{s:#}");
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn at_the_cap_it_is_delivered_short() {
|
fn at_the_cap_it_is_delivered_short() {
|
||||||
let d = dir("cap");
|
let d = dir("cap");
|
||||||
let rounds: Vec<Value> = (0..8).map(|i| round(false, 5.0 + i as f64 * 0.5, json!([]))).collect();
|
// eight rounds, the last still blocked by a defect no one answered
|
||||||
|
let blocked = json!([{"defect": "floating", "present": true, "level": "blocking"}]);
|
||||||
|
let rounds: Vec<Value> = (0..8).map(|i| round(false, 5.0 + i as f64 * 0.5, blocked.clone())).collect();
|
||||||
let s = run(&kit(), &d, &[], &rounds, later());
|
let s = run(&kit(), &d, &[], &rounds, later());
|
||||||
assert_eq!((s["done"].clone(), s["short"].clone()), (json!(true), json!(true)), "{s:#}");
|
assert_eq!(s["clear"], false, "{s:#}");
|
||||||
assert!(s["why"].to_string().contains("capped"));
|
assert!(s["short"].to_string().contains("capped"), "{s:#}");
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -129,7 +121,7 @@ fn a_composition_needs_a_clean_check_newer_than_it() {
|
|||||||
let s = run(&make, &d, &[entry(future, "error")], &rounds, later());
|
let s = run(&make, &d, &[entry(future, "error")], &rounds, later());
|
||||||
assert!(s["gates"].to_string().contains("the mug floats"), "{s:#}");
|
assert!(s["gates"].to_string().contains("the mug floats"), "{s:#}");
|
||||||
let s = run(&make, &d, &[entry(future, "warn")], &rounds, later());
|
let s = run(&make, &d, &[entry(future, "warn")], &rounds, later());
|
||||||
assert_eq!(s["done"], true, "a warn doesn't block: {s:#}");
|
assert_eq!(s["clear"], true, "a warn doesn't block: {s:#}");
|
||||||
let s = run(&make, &d, &[entry(1, "warn")], &rounds, later());
|
let s = run(&make, &d, &[entry(1, "warn")], &rounds, later());
|
||||||
assert!(s["gates"].to_string().contains("changed since"), "{s:#}");
|
assert!(s["gates"].to_string().contains("changed since"), "{s:#}");
|
||||||
}
|
}
|
||||||
@@ -145,34 +137,25 @@ fn a_part_seen_closer_than_planned_holds_the_job() {
|
|||||||
let future = SystemTime::now().duration_since(SystemTime::UNIX_EPOCH).unwrap().as_secs() + 60;
|
let future = SystemTime::now().duration_since(SystemTime::UNIX_EPOCH).unwrap().as_secs() + 60;
|
||||||
let entry: Entry = serde_json::from_value(json!({"id": "r1", "at": future, "by": "raea render", "of": "scene.tsx", "findings": [{"check": "lod-closer", "level": "warn", "about": [{"name": "kiosk"}], "says": "'kiosk' is planned at LOD 3", "by": "raea render"}]})).unwrap();
|
let entry: Entry = serde_json::from_value(json!({"id": "r1", "at": future, "by": "raea render", "of": "scene.tsx", "findings": [{"check": "lod-closer", "level": "warn", "about": [{"name": "kiosk"}], "says": "'kiosk' is planned at LOD 3", "by": "raea render"}]})).unwrap();
|
||||||
let s = run(&make, &d, &[entry.clone()], &[round(true, 7.5, json!([]))], later());
|
let s = run(&make, &d, &[entry.clone()], &[round(true, 7.5, json!([]))], later());
|
||||||
assert!(s["done"] == false && s["gates"].to_string().contains("seen closer than planned at r1: kiosk"), "{s:#}");
|
assert!(s["clear"] == false && s["gates"].to_string().contains("seen closer than planned at r1: kiosk"), "{s:#}");
|
||||||
put(&d, "NOTES.md", "- lod kiosk: one frame at the cut, left as a box\n## What the skill got wrong\n- nothing\n");
|
put(&d, "NOTES.md", "- lod kiosk: one frame at the cut, left as a box\n## What the skill got wrong\n- nothing\n");
|
||||||
assert_eq!(run(&make, &d, &[entry], &[round(true, 7.5, json!([]))], later())["done"], true);
|
assert_eq!(run(&make, &d, &[entry], &[round(true, 7.5, json!([]))], later())["clear"], true);
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn a_scene_wants_three_stills() {
|
|
||||||
let d = dir("scene");
|
|
||||||
let make: Make = read("make", r#"{"kind": "scene", "objects": [{"id": "stool", "label": "Stool", "h": 0.45, "route": "gen", "prompt": "a red stool"}]}"#).unwrap();
|
|
||||||
put(&d, "out/stills/a.png", "x");
|
|
||||||
let s = run(&make, &d, &[], &[], None);
|
|
||||||
assert!(s["missing"].to_string().contains("holds 1 picture"), "{s:#}");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn a_round_judged_on_another_kinds_rubric_does_not_count() {
|
fn a_round_judged_on_another_kinds_rubric_does_not_count() {
|
||||||
// docs/make.feature MK5: a kit is judged on the kit's rubric
|
// docs/goal.feature MK5: a kit is judged on the kit's rubric
|
||||||
let d = dir("rubric");
|
let d = dir("rubric");
|
||||||
delivered(&d);
|
delivered(&d);
|
||||||
let old = json!({"dir": "review/r1", "pass": true, "mean": 8.0, "defects": []});
|
let old = json!({"dir": "review/r1", "pass": true, "mean": 8.0, "defects": []});
|
||||||
let s = run(&kit(), &d, &[], &[old], later());
|
let s = run(&kit(), &d, &[], &[old], later());
|
||||||
assert_eq!(s["done"], false);
|
assert_eq!(s["clear"], false);
|
||||||
assert!(s["gates"].to_string().contains("--kind kit"), "{s:#}");
|
assert!(s["gates"].to_string().contains("--kind kit"), "{s:#}");
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn a_calibrated_ask_question_gates_and_an_uncalibrated_one_advises() {
|
fn a_calibrated_ask_question_gates_and_an_uncalibrated_one_advises() {
|
||||||
// docs/make.feature MK4
|
// docs/goal.feature MK4
|
||||||
let d = dir("ask");
|
let d = dir("ask");
|
||||||
delivered(&d);
|
delivered(&d);
|
||||||
put(&d, "review/r1/clay.png", "clay sheet bytes");
|
put(&d, "review/r1/clay.png", "clay sheet bytes");
|
||||||
@@ -182,12 +165,12 @@ fn a_calibrated_ask_question_gates_and_an_uncalibrated_one_advises() {
|
|||||||
let mut ledger = Ledger::default();
|
let mut ledger = Ledger::default();
|
||||||
// nothing calibrated: every question is advice, and the job is done
|
// nothing calibrated: every question is advice, and the job is done
|
||||||
let s = run_with(&kit(), &d, &[], &rounds, later(), &ledger);
|
let s = run_with(&kit(), &d, &[], &rounds, later(), &ledger);
|
||||||
assert_eq!(s["done"], true, "{s:#}");
|
assert_eq!(s["clear"], true, "{s:#}");
|
||||||
assert!(s["gates"].to_string().contains("advice only"), "{s:#}");
|
assert!(s["gates"].to_string().contains("advice only"), "{s:#}");
|
||||||
// floating calibrated on the person's labels: it must be asked of this exact clay sheet
|
// floating calibrated on the person's labels: it must be asked of this exact clay sheet
|
||||||
ledger.calibrations.insert(floating.version(), serde_json::from_value(json!({"auc": 0.9, "n": 40, "positives": 16, "threshold": 0.4, "date": "2026-11-23", "by": "you"})).unwrap());
|
ledger.calibrations.insert(floating.version(), serde_json::from_value(json!({"auc": 0.9, "n": 40, "positives": 16, "threshold": 0.4, "date": "2026-11-23", "by": "you"})).unwrap());
|
||||||
let s = run_with(&kit(), &d, &[], &rounds, later(), &ledger);
|
let s = run_with(&kit(), &d, &[], &rounds, later(), &ledger);
|
||||||
assert_eq!(s["done"], false);
|
assert_eq!(s["clear"], false);
|
||||||
let gates = s["gates"].to_string();
|
let gates = s["gates"].to_string();
|
||||||
assert!(gates.contains("not asked of this clay sheet") && gates.contains("--std make.clay.floating"), "{gates}");
|
assert!(gates.contains("not asked of this clay sheet") && gates.contains("--std make.clay.floating"), "{gates}");
|
||||||
// asked, and it flagged: open until fixed or answered by its id in NOTES.md
|
// asked, and it flagged: open until fixed or answered by its id in NOTES.md
|
||||||
@@ -195,11 +178,11 @@ fn a_calibrated_ask_question_gates_and_an_uncalibrated_one_advises() {
|
|||||||
ledger.idents.insert("c-1".into(), ident);
|
ledger.idents.insert("c-1".into(), ident);
|
||||||
ledger.answers.push(json!({"id": "a-1", "at": "100", "call": "c-1", "question": "make.clay.floating", "flagged": true, "problem": 0.8}));
|
ledger.answers.push(json!({"id": "a-1", "at": "100", "call": "c-1", "question": "make.clay.floating", "flagged": true, "problem": 0.8}));
|
||||||
let s = run_with(&kit(), &d, &[], &rounds, later(), &ledger);
|
let s = run_with(&kit(), &d, &[], &rounds, later(), &ledger);
|
||||||
assert_eq!(s["done"], false);
|
assert_eq!(s["clear"], false);
|
||||||
assert!(s["gates"].to_string().contains("make.clay.floating flagged (p 0.80)"), "{s:#}");
|
assert!(s["gates"].to_string().contains("make.clay.floating flagged (p 0.80)"), "{s:#}");
|
||||||
put(&d, "NOTES.md", "## What the skill got wrong\n- make.clay.floating: the handset's shadow, not a gap; checked on the low tile\n");
|
put(&d, "NOTES.md", "## What the skill got wrong\n- make.clay.floating: the handset's shadow, not a gap; checked on the low tile\n");
|
||||||
let s = run_with(&kit(), &d, &[], &rounds, later(), &ledger);
|
let s = run_with(&kit(), &d, &[], &rounds, later(), &ledger);
|
||||||
assert_eq!(s["done"], true, "{s:#}");
|
assert_eq!(s["clear"], true, "{s:#}");
|
||||||
// the sheet rendered again: the old answer was about other bytes, so it's asked again
|
// the sheet rendered again: the old answer was about other bytes, so it's asked again
|
||||||
put(&d, "review/r1/clay.png", "a new clay sheet");
|
put(&d, "review/r1/clay.png", "a new clay sheet");
|
||||||
let s = run_with(&kit(), &d, &[], &rounds, later(), &ledger);
|
let s = run_with(&kit(), &d, &[], &rounds, later(), &ledger);
|
||||||
@@ -211,28 +194,3 @@ fn a_calibrated_ask_question_gates_and_an_uncalibrated_one_advises() {
|
|||||||
let s = run_with(&kit(), &d, &[], &rounds, later(), &ledger);
|
let s = run_with(&kit(), &d, &[], &rounds, later(), &ledger);
|
||||||
assert!(s["advice"].to_string().contains("make.colour.plastic says yes"), "{s:#}");
|
assert!(s["advice"].to_string().contains("make.colour.plastic says yes"), "{s:#}");
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn the_gates_are_check_lines_under_the_jobs_task_in_plan_org() {
|
|
||||||
// docs/make.feature MK3
|
|
||||||
let not_done = json!({"done": false, "missing": ["out/kit/lineup.png"], "gates": [{"gate": "critic", "clear": false, "says": "no round yet"}, {"gate": "checks", "of": "kit.tsx", "clear": true, "says": "clean"}]});
|
|
||||||
let t = crate::plan::update("", "desk", "brief.ts", "kit", ¬_done);
|
|
||||||
let id = crate::plan::task_id("brief.ts");
|
|
||||||
assert!(id.len() == 10 && id.starts_with("t-") && id[2..].chars().all(|c| c.is_ascii_alphanumeric()), "{id}");
|
|
||||||
assert!(t.starts_with("#+TITLE: desk\n#+TODO: TODO MAKING REVIEW | DONE DROPPED\n"), "{t}");
|
|
||||||
assert!(t.contains("* MAKING make: kit (brief.ts) [1/3]") && t.contains(&format!(":ID: {id}")), "{t}");
|
|
||||||
assert!(t.contains("- [ ] missing: out/kit/lineup.png") && t.contains("- [X] checks kit.tsx: clean"), "{t}");
|
|
||||||
// the person's own line under it stays; the checks are brought up to date; done is REVIEW
|
|
||||||
let mut mine = t.replace("- [X] checks kit.tsx: clean\n", "- [X] checks kit.tsx: clean\nShane: keep the phone's cord\n");
|
|
||||||
mine = format!("{mine}* TODO another task\n");
|
|
||||||
let done = json!({"done": true, "missing": [], "gates": [{"gate": "critic", "clear": true, "says": "round 2 judged"}]});
|
|
||||||
let t2 = crate::plan::update(&mine, "desk", "brief.ts", "kit", &done);
|
|
||||||
assert!(t2.contains("* REVIEW make: kit (brief.ts) [1/1]") && t2.contains("Shane: keep the phone's cord") && t2.contains("* TODO another task"), "{t2}");
|
|
||||||
assert!(!t2.contains("missing:"), "{t2}");
|
|
||||||
assert_eq!(t2.matches(":ID: ").count(), 1);
|
|
||||||
// a task the person closed keeps their mark
|
|
||||||
let closed = t2.replace("* REVIEW make", "* DONE make");
|
|
||||||
assert!(crate::plan::update(&closed, "desk", "brief.ts", "kit", ¬_done).contains("* DONE make: kit (brief.ts) [1/3]"));
|
|
||||||
// once written, writing the same again changes nothing
|
|
||||||
assert_eq!(crate::plan::update(&t2, "desk", "brief.ts", "kit", &done), t2);
|
|
||||||
}
|
|
||||||
@@ -109,7 +109,7 @@ fn the_kit_lands_as_components_and_a_lineup() {
|
|||||||
let m = kit();
|
let m = kit();
|
||||||
assert_eq!(crate::kitout::component_name("rotary_phone"), "RotaryPhone");
|
assert_eq!(crate::kitout::component_name("rotary_phone"), "RotaryPhone");
|
||||||
let c = crate::kitout::component(&m.objects[0], "sharper numerals");
|
let c = crate::kitout::component(&m.objects[0], "sharper numerals");
|
||||||
assert!(c.starts_with("// raea component add: Rotary phone, 0.12 m"), "{c}");
|
assert!(c.starts_with("// raea make component add: Rotary phone, 0.12 m"), "{c}");
|
||||||
assert!(c.contains("import full from \"./rotary_phone.glb\";") && c.contains("import far from \"./rotary_phone_lod1.glb\";"));
|
assert!(c.contains("import full from \"./rotary_phone.glb\";") && c.contains("import far from \"./rotary_phone_lod1.glb\";"));
|
||||||
assert!(c.contains("export default function RotaryPhone("));
|
assert!(c.contains("export default function RotaryPhone("));
|
||||||
let l = crate::kitout::lineup(&m, "desk");
|
let l = crate::kitout::lineup(&m, "desk");
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ version = "0.1.0"
|
|||||||
edition = "2024"
|
edition = "2024"
|
||||||
license = "FSL-1.1-ALv2"
|
license = "FSL-1.1-ALv2"
|
||||||
publish = false
|
publish = false
|
||||||
description = "`raea motion` and `raea setup motion`: body motion made by Kimodo on this machine, on MLX on a Mac, on PyTorch elsewhere"
|
description = "`raea make motion` and `raea setup motion`: body motion made by Kimodo on this machine, on MLX on a Mac, on PyTorch elsewhere"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
# a take's joints as vectors (score.rs)
|
# a take's joints as vectors (score.rs)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
//! `raea motion` without the rest of the CLI, for working on this crate while the workspace's other crates are mid-change:
|
//! `raea make motion` without the rest of the CLI, for working on this crate while the workspace's other crates are mid-change:
|
||||||
//! `lane build -- cargo run --release -p raea-app-motion --example motion -- "LINE" --seeds 4 -o CLIP.json`
|
//! `lane build -- cargo run --release -p raea-app-motion --example motion -- "LINE" --seeds 4 -o CLIP.json`
|
||||||
fn main() {
|
fn main() {
|
||||||
let args: Vec<String> = std::iter::once("motion".to_string()).chain(std::env::args().skip(1)).collect();
|
let args: Vec<String> = std::iter::once("motion".to_string()).chain(std::env::args().skip(1)).collect();
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
//! `raea motion "LINE" [--keys KEYS.json] ...`: body motion made on this machine by Kimodo (raea-sys-kimodo): a SOMA clip
|
//! `raea make motion "LINE" [--keys KEYS.json] ...`: body motion made on this machine by Kimodo (raea-sys-kimodo): a SOMA clip
|
||||||
//! from a line of words and, with --keys, Kimodo constraints (full-body keyframes, hand or foot targets, a root path:
|
//! from a line of words and, with --keys, Kimodo constraints (full-body keyframes, hand or foot targets, a root path:
|
||||||
//! what sdk/body/tools/between.ts writes). The clip is the file sdk/body/tools/fromkimodo.ts reads, the same one the
|
//! what sdk/body/tools/between.ts writes). The clip is the file sdk/body/tools/fromkimodo.ts reads, the same one the
|
||||||
//! cloud runner wrote (docs/character.feature CH15b, CH15c).
|
//! cloud runner wrote (docs/character.feature CH15b, CH15c).
|
||||||
@@ -15,11 +15,11 @@ use raea_runtime_bundle::flag;
|
|||||||
|
|
||||||
type R<T> = Result<T, String>;
|
type R<T> = Result<T, String>;
|
||||||
|
|
||||||
pub const USAGE: &str = "raea motion \"LINE\" [--keys KEYS.json] [--seconds 5 | --frames N] [--seed 1] [--seeds 1] [--steps 100] [-o CLIP.json]";
|
pub const USAGE: &str = "raea make motion \"LINE\" [--keys KEYS.json] [--seconds 5 | --frames N] [--seed 1] [--seeds 1] [--steps 100] [-o CLIP.json]";
|
||||||
pub const ABOUT: &str = "body motion made on this machine by Kimodo (NVIDIA): a SOMA clip from a line of words and, with --keys, Kimodo constraints (full-body keyframes, hand or foot targets, a root path, as sdk/body/tools/between.ts writes them), as the clip sdk/body/tools/fromkimodo.ts reads. On a Mac it runs on MLX (Apple silicon's GPU): the first use fetches the motion model (1.1 GB) into raea's models folder, and the first new line its text encoder (8.8 GB: Llama 3 8B in 8 bits with LLM2Vec's adapters). On Linux and Windows it runs upstream Kimodo on PyTorch, set up once by raea setup motion: on an NVIDIA GPU with CUDA (the text encoder, 16 GB in bf16, on the CPU unless the card has 18 GB or more), else on the CPU alone; reading a new line on the CPU takes about 18 GB of memory. A line's words are read once and kept. --seeds N makes N takes (seeds SEED to SEED+N-1) and keeps the one with the fewest faults: a foot sliding while planted, the shoulders shrugging, the hips sinking, a hand or forearm into the torso or head (a skeletal check; each take's score is printed and the kept one's written into the clip). Licences: Kimodo's weights NVIDIA's Open Model License, Meta Llama 3 the Meta Llama 3 Community License, LLM2Vec's adapters MIT, Kimodo's code Apache-2.0";
|
pub const ABOUT: &str = "body motion made on this machine by Kimodo (NVIDIA): a SOMA clip from a line of words and, with --keys, Kimodo constraints (full-body keyframes, hand or foot targets, a root path, as sdk/body/tools/between.ts writes them), as the clip sdk/body/tools/fromkimodo.ts reads. On a Mac it runs on MLX (Apple silicon's GPU): the first use fetches the motion model (1.1 GB) into raea's models folder, and the first new line its text encoder (8.8 GB: Llama 3 8B in 8 bits with LLM2Vec's adapters). On Linux and Windows it runs upstream Kimodo on PyTorch, set up once by raea setup motion: on an NVIDIA GPU with CUDA (the text encoder, 16 GB in bf16, on the CPU unless the card has 18 GB or more), else on the CPU alone; reading a new line on the CPU takes about 18 GB of memory. A line's words are read once and kept. --seeds N makes N takes (seeds SEED to SEED+N-1) and keeps the one with the fewest faults: a foot sliding while planted, the shoulders shrugging, the hips sinking, a hand or forearm into the torso or head (a skeletal check; each take's score is printed and the kept one's written into the clip). Licences: Kimodo's weights NVIDIA's Open Model License, Meta Llama 3 the Meta Llama 3 Community License, LLM2Vec's adapters MIT, Kimodo's code Apache-2.0";
|
||||||
|
|
||||||
pub const SETUP_USAGE: &str = "raea setup motion [--check]";
|
pub const SETUP_USAGE: &str = "raea setup motion [--check]";
|
||||||
pub const SETUP_ABOUT: &str = "what raea motion runs on, made where missing (--check only says): on a Mac the MLX models in raea's models folder (the motion model 1.1 GB, the text encoder 8.8 GB); on Linux and Windows, in raea's models folder's kimodo-torch, a Python 3.11 environment made by uv (which it needs on PATH: https://docs.astral.sh/uv) with PyTorch (its CUDA build where there is an NVIDIA driver, about 8 GB, else CPU only, about 2 GB) and upstream Kimodo (nv-tlabs/kimodo at e1c219c, Apache-2.0), then the weights: Kimodo-SOMA-RP-v1 (1.1 GB, NVIDIA Open Model License), LLM2Vec's two adapters (0.3 GB, MIT) and Meta Llama 3 8B Instruct in bf16 (16 GB, Meta Llama 3 Community License, from NousResearch's ungated copy, checked file by file against Meta's SHA-256); about 26 GB in all. It says what this machine has and where each network runs: the denoiser on CUDA when there is an NVIDIA GPU, else the CPU; the text encoder beside it on a GPU of 18 GB or more, else the CPU";
|
pub const SETUP_ABOUT: &str = "what raea make motion runs on, made where missing (--check only says): on a Mac the MLX models in raea's models folder (the motion model 1.1 GB, the text encoder 8.8 GB); on Linux and Windows, in raea's models folder's kimodo-torch, a Python 3.11 environment made by uv (which it needs on PATH: https://docs.astral.sh/uv) with PyTorch (its CUDA build where there is an NVIDIA driver, about 8 GB, else CPU only, about 2 GB) and upstream Kimodo (nv-tlabs/kimodo at e1c219c, Apache-2.0), then the weights: Kimodo-SOMA-RP-v1 (1.1 GB, NVIDIA Open Model License), LLM2Vec's two adapters (0.3 GB, MIT) and Meta Llama 3 8B Instruct in bf16 (16 GB, Meta Llama 3 Community License, from NousResearch's ungated copy, checked file by file against Meta's SHA-256); about 26 GB in all. It says what this machine has and where each network runs: the denoiser on CUDA when there is an NVIDIA GPU, else the CPU; the text encoder beside it on a GPU of 18 GB or more, else the CPU";
|
||||||
|
|
||||||
fn number(args: &[String], name: &str, default: f64) -> R<f64> {
|
fn number(args: &[String], name: &str, default: f64) -> R<f64> {
|
||||||
match flag(args, name) {
|
match flag(args, name) {
|
||||||
@@ -131,7 +131,7 @@ fn make(ask: Ask) -> R<String> {
|
|||||||
let missing = t.missing();
|
let missing = t.missing();
|
||||||
if !missing.is_empty() {
|
if !missing.is_empty() {
|
||||||
return Err(format!(
|
return Err(format!(
|
||||||
"raea motion runs Kimodo on PyTorch on this machine (MLX is Apple silicon's), and its {} isn't set up in {} yet: raea setup motion makes it (uv, then about 26 GB: PyTorch, Kimodo's code and weights, Llama 3 8B Instruct for the text encoder)",
|
"raea make motion runs Kimodo on PyTorch on this machine (MLX is Apple silicon's), and its {} isn't set up in {} yet: raea setup motion makes it (uv, then about 26 GB: PyTorch, Kimodo's code and weights, Llama 3 8B Instruct for the text encoder)",
|
||||||
missing.join(", the "),
|
missing.join(", the "),
|
||||||
t.dir.display()
|
t.dir.display()
|
||||||
));
|
));
|
||||||
@@ -233,7 +233,7 @@ fn disk(dir: &std::path::Path) -> String {
|
|||||||
raea_io_home::disk_use(dir, true)
|
raea_io_home::disk_use(dir, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// `raea setup motion [--check]`: what raea motion runs on here, made where missing (--check only says), and where it is.
|
/// `raea setup motion [--check]`: what raea make motion runs on here, made where missing (--check only says), and where it is.
|
||||||
pub fn setup(args: &[String]) -> R<String> {
|
pub fn setup(args: &[String]) -> R<String> {
|
||||||
let check = args.iter().any(|a| a == "--check");
|
let check = args.iter().any(|a| a == "--check");
|
||||||
if let Some(a) = args.iter().find(|a| *a != "--check") {
|
if let Some(a) = args.iter().find(|a| *a != "--check") {
|
||||||
@@ -257,7 +257,7 @@ fn setup_here(check: bool) -> R<String> {
|
|||||||
let state = match (had, has) {
|
let state = match (had, has) {
|
||||||
(true, _) => "installed",
|
(true, _) => "installed",
|
||||||
(false, true) => "installed now",
|
(false, true) => "installed now",
|
||||||
(false, false) => "not installed: raea setup motion fetches it (raea motion does too, the first time it needs it)",
|
(false, false) => "not installed: raea setup motion fetches it (raea make motion does too, the first time it needs it)",
|
||||||
};
|
};
|
||||||
lines.push(format!(" {name:<12} {state}; {what}\n {} ({})", dir.display(), if *has { disk(dir) } else { "-".into() }));
|
lines.push(format!(" {name:<12} {state}; {what}\n {} ({})", dir.display(), if *has { disk(dir) } else { "-".into() }));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
//! A take scored for the faults a body shows (sheet3d plan E3), so `raea motion --seeds N` can keep the best of N:
|
//! A take scored for the faults a body shows (sheet3d plan E3), so `raea make motion --seeds N` can keep the best of N:
|
||||||
//! a foot sliding while it's planted, the shoulders shrugging up, the hips sinking, and a hand or forearm inside the
|
//! a foot sliding while it's planted, the shoulders shrugging up, the hips sinking, and a hand or forearm inside the
|
||||||
//! torso or head. Read from the take's own joints (Kimodo's SOMA skeleton, metres, Y up) and its foot contacts.
|
//! torso or head. Read from the take's own joints (Kimodo's SOMA skeleton, metres, Y up) and its foot contacts.
|
||||||
//! Collision is a skeletal proxy: capsules round the spine and a sphere for the head, sized for SOMA's average adult;
|
//! Collision is a skeletal proxy: capsules round the spine and a sphere for the head, sized for SOMA's average adult;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
//! Camera clearance (docs/make.feature MK16, from AnyShot's clearance pass): every frame, how near the camera passes to
|
//! Camera clearance (docs/goal.feature MK16, from AnyShot's clearance pass): every frame, how near the camera passes to
|
||||||
//! each solid part, and where it comes closer than a person carrying it could (0.45 m by default). A camera that
|
//! each solid part, and where it comes closer than a person carrying it could (0.45 m by default). A camera that
|
||||||
//! grazes a door frame or pushes into a desk draws the inside of the part, or a wall filling the frame; the boxes the
|
//! grazes a door frame or pushes into a desk draws the inside of the part, or a wall filling the frame; the boxes the
|
||||||
//! stage keeps say it without drawing. Only solids count: volumes, decals, footage, 2D, see-through parts (glass) and
|
//! stage keeps say it without drawing. Only solids count: volumes, decals, footage, 2D, see-through parts (glass) and
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
//! `raea scene lint|explain|light|stage|lod`: a composition's frames stepped without drawing and handed to raea-sys-contact
|
//! `raea scene lint|explain|light|stage|lod`: a composition's frames stepped without drawing and handed to raea-sys-contact
|
||||||
//! (what each part rests on, and parts that clip), raea-sys-light-meter (the light on a subject) and raea-sys-stage (3D
|
//! (what each part rests on, and parts that clip), raea-sys-light-meter (the light on a subject) and raea-sys-stage (3D
|
||||||
//! type that can't be read, parts that snap, a camera that lurches, empty frames: docs/stage-guards.feature). `lod` is
|
//! type that can't be read, parts that snap, a camera that lurches, empty frames: docs/stage-guards.feature). `lod` is
|
||||||
//! each part's planned detail beside how large the frames show it (docs/make.feature MK23).
|
//! each part's planned detail beside how large the frames show it (docs/goal.feature MK23).
|
||||||
|
|
||||||
use serde_json::json;
|
use serde_json::json;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
//! `raea scene lod EDIT.tsx [--composition ID] [--from N] [--to N] [--json]` (docs/make.feature MK23): every part's
|
//! `raea scene lod EDIT.tsx [--composition ID] [--from N] [--to N] [--json]` (docs/goal.feature MK23): every part's
|
||||||
//! planned detail beside how large the frames show it. A part's plan is its own `lod` (0 the hero to 4 far), else its
|
//! planned detail beside how large the frames show it. A part's plan is its own `lod` (0 the hero to 4 far), else its
|
||||||
//! name's on the job's plan (`lod` on brief.ts's make objects); what a frame shows is how much of it the part's box
|
//! name's on the job's plan (`lod` on brief.ts's make objects); what a frame shows is how much of it the part's box
|
||||||
//! spans (raea-runtime-lod-plan). The table lists the planned parts first, the ones seen closer than planned on top,
|
//! spans (raea-runtime-lod-plan). The table lists the planned parts first, the ones seen closer than planned on top,
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ version = "0.1.0"
|
|||||||
edition = "2024"
|
edition = "2024"
|
||||||
license = "FSL-1.1-ALv2"
|
license = "FSL-1.1-ALv2"
|
||||||
publish = false
|
publish = false
|
||||||
description = "raea solid info and raea solid view: a solid file run, its parts measured (raea-core-solidinfo), and its review sheets in colour and clay"
|
description = "raea make solid info and raea make solid view: a solid file run, its parts measured (raea-core-solidinfo), and its review sheets in colour and clay"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
dunce = "1"
|
dunce = "1"
|
||||||
@@ -14,11 +14,11 @@ raea-core-facts = { path = "../../core/facts" }
|
|||||||
serde_json = "1"
|
serde_json = "1"
|
||||||
# --set's and the CLI's flags, read as the bundler reads them
|
# --set's and the CLI's flags, read as the bundler reads them
|
||||||
raea-runtime-bundle = { path = "../../runtime/bundle" }
|
raea-runtime-bundle = { path = "../../runtime/bundle" }
|
||||||
# `raea judge`, dispatched with `raea solid` (verb())
|
# `raea judge`, dispatched with `raea make solid` (verb())
|
||||||
raea-app-judge = { path = "../judge" }
|
raea-app-judge = { path = "../judge" }
|
||||||
raea-app-ask = { path = "../ask" }
|
raea-app-ask = { path = "../ask" }
|
||||||
# a scene, kit or shot held to its plan (docs/make.feature)
|
# a scene, kit or shot held to its plan (docs/goal.feature)
|
||||||
raea-app-make = { path = "../make" }
|
raea-app-make = { path = "../make" }
|
||||||
# `raea solid export`: the solid built, written as .glb and read back (core/shape), named and coloured (core/meshcheck)
|
# `raea make solid export`: the solid built, written as .glb and read back (core/shape), named and coloured (core/meshcheck)
|
||||||
raea-core-shape = { path = "../../core/shape" }
|
raea-core-shape = { path = "../../core/shape" }
|
||||||
raea-core-meshcheck = { path = "../../core/meshcheck" }
|
raea-core-meshcheck = { path = "../../core/meshcheck" }
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
//! `raea solid export FILE.ts -o OUT.glb [--set k=v,...] [--part NAME] [--colour #RRGGBB]` (docs/blender.feature BL1):
|
//! `raea make solid export FILE.ts -o OUT.glb [--set k=v,...] [--part NAME] [--colour #RRGGBB]` (docs/blender.feature BL1):
|
||||||
//! a solid written as one .glb, metres, y up, so a Blender step can take it (bake.py for real UVs and baked maps, a
|
//! a solid written as one .glb, metres, y up, so a Blender step can take it (bake.py for real UVs and baked maps, a
|
||||||
//! cloth to fall on). The solid stays the source: the .glb is made again from it whenever it changes. An empty solid,
|
//! cloth to fall on). The solid stays the source: the .glb is made again from it whenever it changes. An empty solid,
|
||||||
//! or one solid info finds an error in, is refused with the findings. The file is read back and measured against the
|
//! or one solid info finds an error in, is refused with the findings. The file is read back and measured against the
|
||||||
@@ -52,7 +52,7 @@ fn said(info: &Value, level: &str, part: Option<&str>) -> Vec<String> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn export(file: &Path, parts: &[(String, String)], info: &Value, args: &[String]) -> Result<String, String> {
|
pub fn export(file: &Path, parts: &[(String, String)], info: &Value, args: &[String]) -> Result<String, String> {
|
||||||
let out = flag(args, "-o").filter(|o| o.ends_with(".glb")).ok_or("raea solid export FILE.ts -o OUT.glb: give the .glb to write")?;
|
let out = flag(args, "-o").filter(|o| o.ends_with(".glb")).ok_or("raea make solid export FILE.ts -o OUT.glb: give the .glb to write")?;
|
||||||
let part = flag(args, "--part");
|
let part = flag(args, "--part");
|
||||||
let chosen: Vec<&(String, String)> = parts.iter().filter(|(n, _)| part.as_deref().is_none_or(|p| p == n)).collect();
|
let chosen: Vec<&(String, String)> = parts.iter().filter(|(n, _)| part.as_deref().is_none_or(|p| p == n)).collect();
|
||||||
if chosen.is_empty() {
|
if chosen.is_empty() {
|
||||||
@@ -79,7 +79,7 @@ pub fn export(file: &Path, parts: &[(String, String)], info: &Value, args: &[Str
|
|||||||
let name = part.clone().unwrap_or_else(|| file.file_stem().and_then(|s| s.to_str()).unwrap_or("solid").to_string());
|
let name = part.clone().unwrap_or_else(|| file.file_stem().and_then(|s| s.to_str()).unwrap_or("solid").to_string());
|
||||||
j["nodes"][0]["name"] = json!(name);
|
j["nodes"][0]["name"] = json!(name);
|
||||||
j["meshes"][0]["name"] = json!(name);
|
j["meshes"][0]["name"] = json!(name);
|
||||||
j["asset"]["generator"] = json!("raea solid export");
|
j["asset"]["generator"] = json!("raea make solid export");
|
||||||
if let Some(c) = flag(args, "--colour") {
|
if let Some(c) = flag(args, "--colour") {
|
||||||
j["materials"] = json!([{"name": name, "pbrMetallicRoughness": {"baseColorFactor": linear(&c)?, "metallicFactor": 0.0, "roughnessFactor": 0.8}}]);
|
j["materials"] = json!([{"name": name, "pbrMetallicRoughness": {"baseColorFactor": linear(&c)?, "metallicFactor": 0.0, "roughnessFactor": 0.8}}]);
|
||||||
j["meshes"][0]["primitives"][0]["material"] = json!(0);
|
j["meshes"][0]["primitives"][0]["material"] = json!(0);
|
||||||
@@ -92,7 +92,7 @@ pub fn export(file: &Path, parts: &[(String, String)], info: &Value, args: &[Str
|
|||||||
if !diff.is_empty() {
|
if !diff.is_empty() {
|
||||||
return Err(format!("solid export: {out} doesn't read back as the solid: {}", diff.join("; ")));
|
return Err(format!("solid export: {out} doesn't read back as the solid: {}", diff.join("; ")));
|
||||||
}
|
}
|
||||||
let side = json!({"source": format!("raea solid export {}{}", file.display(), part.as_ref().map(|p| format!(" --part {p}")).unwrap_or_default()), "license": "built in code for this project", "credit": ""});
|
let side = json!({"source": format!("raea make solid export {}{}", file.display(), part.as_ref().map(|p| format!(" --part {p}")).unwrap_or_default()), "license": "built in code for this project", "credit": ""});
|
||||||
std::fs::write(format!("{out}.json"), serde_json::to_string_pretty(&side).unwrap_or_default()).map_err(|e| e.to_string())?;
|
std::fs::write(format!("{out}.json"), serde_json::to_string_pretty(&side).unwrap_or_default()).map_err(|e| e.to_string())?;
|
||||||
let r = |x: f64| (x * 1e5).round() / 1e5;
|
let r = |x: f64| (x * 1e5).round() / 1e5;
|
||||||
let mut t = vec![format!(
|
let mut t = vec![format!(
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
//! `raea solid info FILE.ts [--json] [--set k=v,...] [--expect E.json] [--walk]`: the file's solid measured
|
//! `raea make solid info FILE.ts [--json] [--set k=v,...] [--expect E.json] [--walk]`: the file's solid measured
|
||||||
//! (raea-core-solidinfo). FILE.ts exports `default`: a Solid, an object of named Solids (the parts), or a function
|
//! (raea-core-solidinfo). FILE.ts exports `default`: a Solid, an object of named Solids (the parts), or a function
|
||||||
//! of the params returning either; and optionally `params`, each a number, a boolean, or `[low, high, default]`. The
|
//! of the params returning either; and optionally `params`, each a number, a boolean, or `[low, high, default]`. The
|
||||||
//! file is run by `raea run` (a wrapper that prints each part's shape expression), then measured natively. --set
|
//! file is run by `raea run` (a wrapper that prints each part's shape expression), then measured natively. --set
|
||||||
//! builds it at other params and says what moved from the defaults; --walk moves each ranged param alone to each end
|
//! builds it at other params and says what moved from the defaults; --walk moves each ranged param alone to each end
|
||||||
//! and says which break it (more pieces, empty) and which reach no geometry. FILE.expect.json beside it is read when
|
//! and says which break it (more pieces, empty) and which reach no geometry. FILE.expect.json beside it is read when
|
||||||
//! --expect isn't given. Errors exit 1, as scene lint. A part's `role` comes from the file's `roles` export ({body:
|
//! --expect isn't given. Errors exit 1, as scene lint. A part's `role` comes from the file's `roles` export ({body:
|
||||||
//! "contain"}), its `at` from the line that names it. `raea solid view` takes its pictures (view.rs); `raea solid export`
|
//! "contain"}), its `at` from the line that names it. `raea make solid view` takes its pictures (view.rs); `raea make solid export`
|
||||||
//! writes it as a .glb for a Blender step (export.rs). Its `needs` export ({textured: true}) asks for what solids can't
|
//! writes it as a .glb for a Blender step (export.rs). Its `needs` export ({textured: true}) asks for what solids can't
|
||||||
//! give yet: real UVs and baked maps name bake.py (docs/blender.feature BL14).
|
//! give yet: real UVs and baked maps name bake.py (docs/blender.feature BL14).
|
||||||
|
|
||||||
@@ -18,7 +18,7 @@ use serde_json::{Map, Value, json};
|
|||||||
mod export;
|
mod export;
|
||||||
mod view;
|
mod view;
|
||||||
|
|
||||||
pub const USAGE: &str = "raea solid info FILE.ts [--json] [--set k=v,...] [--expect E.json] [--walk] (volume, box, pieces, genus per part; joints; predictions and mutants)\n raea solid view FILE.ts -o DIR [--set k=v,...] [--json] (the solid's parts in colour and clay from fixed cameras)\n raea solid export FILE.ts -o OUT.glb [--set k=v,...] [--part NAME] [--colour #RRGGBB] (the solid as one .glb for a Blender step, read back and checked)";
|
pub const USAGE: &str = "raea make solid info FILE.ts [--json] [--set k=v,...] [--expect E.json] [--walk] (volume, box, pieces, genus per part; joints; predictions and mutants)\n raea make solid view FILE.ts -o DIR [--set k=v,...] [--json] (the solid's parts in colour and clay from fixed cameras)\n raea make solid export FILE.ts -o OUT.glb [--set k=v,...] [--part NAME] [--colour #RRGGBB] (the solid as one .glb for a Blender step, read back and checked)";
|
||||||
|
|
||||||
thread_local! {
|
thread_local! {
|
||||||
/// the last run file's `roles` and `needs` exports
|
/// the last run file's `roles` and `needs` exports
|
||||||
@@ -68,7 +68,7 @@ print("RAEA_SOLID_INFO " + JSON.stringify({{ params: p, spec, parts: exprs, role
|
|||||||
fn textured(out: &mut Value, file: &Path) {
|
fn textured(out: &mut Value, file: &Path) {
|
||||||
let stem = file.file_stem().and_then(|s| s.to_str()).unwrap_or("solid");
|
let stem = file.file_stem().and_then(|s| s.to_str()).unwrap_or("solid");
|
||||||
let f = raea_core_meshcheck::blender::fix("bake.py", &format!("media/{stem}.glb media/{stem}-baked.glb --into-colour"));
|
let f = raea_core_meshcheck::blender::fix("bake.py", &format!("media/{stem}.glb media/{stem}-baked.glb --into-colour"));
|
||||||
let run = format!("raea solid export {} -o media/{stem}.glb --colour #RRGGBB && {}", file.display(), f["run"].as_str().unwrap_or(""));
|
let run = format!("raea make solid export {} -o media/{stem}.glb --colour #RRGGBB && {}", file.display(), f["run"].as_str().unwrap_or(""));
|
||||||
let says = format!("its file asks for textures (needs.textured), and a solid's UVs are box projections: export it and bake real UVs and maps; fix: {run}");
|
let says = format!("its file asks for textures (needs.textured), and a solid's UVs are box projections: export it and bake real UVs and maps; fix: {run}");
|
||||||
if let Some(a) = out["found"].as_array_mut() {
|
if let Some(a) = out["found"].as_array_mut() {
|
||||||
a.push(json!({"check": "textures", "level": "warning", "says": says, "fix": {"blender": "bake.py", "run": run}}));
|
a.push(json!({"check": "textures", "level": "warning", "says": says, "fix": {"blender": "bake.py", "run": run}}));
|
||||||
@@ -91,7 +91,7 @@ fn parse_set(s: &str) -> Result<Map<String, Value>, String> {
|
|||||||
Ok(m)
|
Ok(m)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// `raea solid ...`, `raea judge ...`, `raea make ...` (docs/make.feature) and `raea ask ...` (docs/ask.feature AK3, which prints as it goes and exits with
|
/// `raea make solid ...`, `raea judge ...`, `raea make ...` (docs/goal.feature) and `raea ask ...` (docs/ask.feature AK3, which prints as it goes and exits with
|
||||||
/// its own code), the verbs that build and judge a piece (engine/cli hands them over), or None for another verb.
|
/// its own code), the verbs that build and judge a piece (engine/cli hands them over), or None for another verb.
|
||||||
pub fn verb(args: &[String]) -> Option<Result<String, String>> {
|
pub fn verb(args: &[String]) -> Option<Result<String, String>> {
|
||||||
match args.first().map(String::as_str) {
|
match args.first().map(String::as_str) {
|
||||||
@@ -134,7 +134,7 @@ pub fn cli(args: &[String]) -> Result<String, String> {
|
|||||||
return export::export(&file, &parts, &out, args);
|
return export::export(&file, &parts, &out, args);
|
||||||
}
|
}
|
||||||
if verb == "view" {
|
if verb == "view" {
|
||||||
let dir = crate::view::out_dir(args).ok_or("raea solid view FILE.ts -o DIR: give the folder for the sheets")?;
|
let dir = crate::view::out_dir(args).ok_or("raea make solid view FILE.ts -o DIR: give the folder for the sheets")?;
|
||||||
return crate::view::view(&file, &set, &out, &dir, json_out);
|
return crate::view::view(&file, &set, &out, &dir, json_out);
|
||||||
}
|
}
|
||||||
out["params"] = params;
|
out["params"] = params;
|
||||||
@@ -179,7 +179,7 @@ pub fn cli(args: &[String]) -> Result<String, String> {
|
|||||||
}
|
}
|
||||||
// what it found as raea's one Finding (docs/direction.feature DR3), about the part, or the solid's file
|
// what it found as raea's one Finding (docs/direction.feature DR3), about the part, or the solid's file
|
||||||
let name = file.file_name().map(|n| n.to_string_lossy().to_string()).unwrap_or_default();
|
let name = file.file_name().map(|n| n.to_string_lossy().to_string()).unwrap_or_default();
|
||||||
let found = finding::ranked(out["found"].as_array().into_iter().flatten().filter_map(|v| Finding::of_value(v, "raea solid info")).map(|f| if f.about.is_empty() { f.about(&name, None) } else { f }).collect());
|
let found = finding::ranked(out["found"].as_array().into_iter().flatten().filter_map(|v| Finding::of_value(v, "raea make solid info")).map(|f| if f.about.is_empty() { f.about(&name, None) } else { f }).collect());
|
||||||
let errors = found.iter().any(|f| f.level == Level::Error);
|
let errors = found.iter().any(|f| f.level == Level::Error);
|
||||||
if let Some(o) = out.as_object_mut() {
|
if let Some(o) = out.as_object_mut() {
|
||||||
for k in ["found", "errors", "warnings"] {
|
for k in ["found", "errors", "warnings"] {
|
||||||
@@ -200,7 +200,7 @@ pub fn cli(args: &[String]) -> Result<String, String> {
|
|||||||
t.push(format!("walk {} = {}: {}{}", w["param"].as_str().unwrap_or(""), w["value"], w["verdict"].as_str().unwrap_or(""), w["says"].as_str().map(|s| format!(" ({s})")).unwrap_or_default()));
|
t.push(format!("walk {} = {}: {}{}", w["param"].as_str().unwrap_or(""), w["value"], w["verdict"].as_str().unwrap_or(""), w["says"].as_str().map(|s| format!(" ({s})")).unwrap_or_default()));
|
||||||
}
|
}
|
||||||
t.push(format!("solid: {} m³, size {} m, {} pieces, genus {}, {} triangles", s["volume"], s["box"]["size"], s["pieces"], s["genus"], s["tris"]));
|
t.push(format!("solid: {} m³, size {} m, {} pieces, genus {}, {} triangles", s["volume"], s["box"]["size"], s["pieces"], s["genus"], s["tris"]));
|
||||||
t.push(format!("raea solid info: {}", finding::count(&found)));
|
t.push(format!("raea make solid info: {}", finding::count(&found)));
|
||||||
t.join("\n")
|
t.join("\n")
|
||||||
};
|
};
|
||||||
if errors {
|
if errors {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
//! `raea solid view FILE.ts -o DIR [--set k=v,...]`: one solid's review sheets (research note agent-tool-surface.md's
|
//! `raea make solid view FILE.ts -o DIR [--set k=v,...]`: one solid's review sheets (research note agent-tool-surface.md's
|
||||||
//! `solid view`). The file's parts are put in a small scene, each on its own clay-friendly colour, on a slab under
|
//! `solid view`). The file's parts are put in a small scene, each on its own clay-friendly colour, on a slab under
|
||||||
//! a key and fill light, with a hero camera from the front-right corner, and `raea render --review` takes the fixed
|
//! a key and fill light, with a hero camera from the front-right corner, and `raea render --review` takes the fixed
|
||||||
//! views of it in colour and clay. It prints a sidecar: the sheets, the solid's box, whether it is in more than one
|
//! views of it in colour and clay. It prints a sidecar: the sheets, the solid's box, whether it is in more than one
|
||||||
|
|||||||
@@ -17,5 +17,5 @@ serde_json = "1"
|
|||||||
# the verbs' flags read as a render reads its own
|
# the verbs' flags read as a render reads its own
|
||||||
raea-runtime-bundle = { path = "../../runtime/bundle" }
|
raea-runtime-bundle = { path = "../../runtime/bundle" }
|
||||||
raea-runtime-export = { path = "../../runtime/export" }
|
raea-runtime-export = { path = "../../runtime/export" }
|
||||||
# `raea motion` and `raea setup motion` (apps/motion), still reached as tools::motion
|
# `raea make motion` and `raea setup motion` (apps/motion), still reached as tools::motion
|
||||||
raea-app-motion = { path = "../motion" }
|
raea-app-motion = { path = "../motion" }
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
//! The verbs that run raea's local tools: sound (`raea sao`, `tokensynth`, `setup-audio`, `sounds`: foley and an
|
//! The verbs that run raea's local tools: sound (`raea make sao`, `tokensynth`, `setup-audio`, `sounds`: foley and an
|
||||||
//! instrument's notes made by local models, and the open sample libraries), `raea splat` (footage trained into a
|
//! instrument's notes made by local models, and the open sample libraries), `raea make splat` (footage trained into a
|
||||||
//! Gaussian splat), `raea song` (a song's energy map, apps/tools/src/song.rs) and `raea gen` (generation flows on
|
//! Gaussian splat), `raea song` (a song's energy map, apps/tools/src/song.rs) and `raea gen` (generation flows on
|
||||||
//! made.app, fal, Replicate, OpenRouter, Modal and ComfyUI, with sao as the local model: apps/tools/src/generate.rs).
|
//! made.app, fal, Replicate, OpenRouter, Modal and ComfyUI, with sao as the local model: apps/tools/src/generate.rs).
|
||||||
|
|
||||||
pub mod generate;
|
pub mod generate;
|
||||||
/// `raea motion` and `raea setup motion`: body motion made by Kimodo, on MLX on a Mac, on PyTorch elsewhere (apps/motion)
|
/// `raea make motion` and `raea setup motion`: body motion made by Kimodo, on MLX on a Mac, on PyTorch elsewhere (apps/motion)
|
||||||
pub use raea_app_motion as motion;
|
pub use raea_app_motion as motion;
|
||||||
pub mod song;
|
pub mod song;
|
||||||
pub mod sound;
|
pub mod sound;
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
//! raea's sound tools from the command line: the two local models (SAO for foley, TokenSynth for an instrument's notes)
|
//! raea's sound tools from the command line: the two local models (SAO for foley, TokenSynth for an instrument's notes)
|
||||||
//! and the open sample libraries a Tone.js Sampler can play.
|
//! and the open sample libraries a Tone.js Sampler can play.
|
||||||
//!
|
//!
|
||||||
//! raea sao "PROMPT" [--seconds 2] [--seed 1] [--dir EDIT_DIR] [-o OUT.wav]
|
//! raea make sao "PROMPT" [--seconds 2] [--seed 1] [--dir EDIT_DIR] [-o OUT.wav]
|
||||||
//! raea tokensynth "TIMBRE" [--notes C2,C3,C4] [--seconds 2] [--velocity 100] [--seed 1234] [--precision fp16]
|
//! raea make tokensynth "TIMBRE" [--notes C2,C3,C4] [--seconds 2] [--velocity 100] [--seed 1234] [--precision fp16]
|
||||||
//! [--dir EDIT_DIR] [-o OUT_DIR]
|
//! [--dir EDIT_DIR] [-o OUT_DIR]
|
||||||
//! raea setup-audio [--check] [sao|tokensynth]
|
//! raea setup-audio [--check] [sao|tokensynth]
|
||||||
//! raea sounds [WORDS...]
|
//! raea make sounds [WORDS...]
|
||||||
//! raea sounds get PACK/INSTRUMENT [--notes C2,C4 | --all] [--dir EDIT_DIR] [-o OUT_DIR]
|
//! raea make sounds get PACK/INSTRUMENT [--notes C2,C4 | --all] [--dir EDIT_DIR] [-o OUT_DIR]
|
||||||
//!
|
//!
|
||||||
//! sao and tokensynth make through the same asset store a composition's render does (raea_io_assets::Store beside
|
//! sao and tokensynth make through the same asset store a composition's render does (raea_io_assets::Store beside
|
||||||
//! EDIT_DIR/edit.tsx, default the working folder), with the same parameters, so a sound made here is the one
|
//! EDIT_DIR/edit.tsx, default the working folder), with the same parameters, so a sound made here is the one
|
||||||
@@ -126,9 +126,9 @@ fn deliver(from: &Path, to: &Path) -> R<()> {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub const SAO_USAGE: &str = "raea sao \"PROMPT\" [--seconds 2] [--seed 1] [--dir EDIT_DIR] [-o OUT.wav]";
|
pub const SAO_USAGE: &str = "raea make sao \"PROMPT\" [--seconds 2] [--seed 1] [--dir EDIT_DIR] [-o OUT.wav]";
|
||||||
|
|
||||||
/// `raea sao "PROMPT" [--seconds 2] [--seed 1] [--dir D] [-o OUT.wav]`: one foley sound, made once.
|
/// `raea make sao "PROMPT" [--seconds 2] [--seed 1] [--dir D] [-o OUT.wav]`: one foley sound, made once.
|
||||||
pub fn sao(args: &[String]) -> R<String> {
|
pub fn sao(args: &[String]) -> R<String> {
|
||||||
const USAGE: &str = SAO_USAGE;
|
const USAGE: &str = SAO_USAGE;
|
||||||
let prompt = positional(&args[1..], &["--seconds", "--seed", "--dir", "-o"]).join(" ");
|
let prompt = positional(&args[1..], &["--seconds", "--seed", "--dir", "-o"]).join(" ");
|
||||||
@@ -159,9 +159,9 @@ pub fn sao(args: &[String]) -> R<String> {
|
|||||||
Ok(format!("APPLIED sao {prompt:?}, {} s, seed {seed} -> {at} ({how}; asset {}){reuse}", js_num(seconds), &a.hash[..12]))
|
Ok(format!("APPLIED sao {prompt:?}, {} s, seed {seed} -> {at} ({how}; asset {}){reuse}", js_num(seconds), &a.hash[..12]))
|
||||||
}
|
}
|
||||||
|
|
||||||
pub const TOKENSYNTH_USAGE: &str = "raea tokensynth \"TIMBRE\" [--notes C2,C3,C4] [--seconds 2] [--velocity 100] [--seed 1234] [--precision fp16] [--dir EDIT_DIR] [-o OUT_DIR]";
|
pub const TOKENSYNTH_USAGE: &str = "raea make tokensynth \"TIMBRE\" [--notes C2,C3,C4] [--seconds 2] [--velocity 100] [--seed 1234] [--precision fp16] [--dir EDIT_DIR] [-o OUT_DIR]";
|
||||||
|
|
||||||
/// `raea tokensynth "TIMBRE" [--notes C2,C3,C4] ... [-o OUT_DIR]`: an instrument's root notes, one WAV each.
|
/// `raea make tokensynth "TIMBRE" [--notes C2,C3,C4] ... [-o OUT_DIR]`: an instrument's root notes, one WAV each.
|
||||||
pub fn tokensynth(args: &[String]) -> R<String> {
|
pub fn tokensynth(args: &[String]) -> R<String> {
|
||||||
const USAGE: &str = TOKENSYNTH_USAGE;
|
const USAGE: &str = TOKENSYNTH_USAGE;
|
||||||
let timbre = positional(&args[1..], &["--notes", "--seconds", "--velocity", "--seed", "--precision", "--dir", "-o"]).join(" ");
|
let timbre = positional(&args[1..], &["--notes", "--seconds", "--velocity", "--seed", "--precision", "--dir", "-o"]).join(" ");
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ pub(crate) fn synonyms(word: &str) -> Vec<&str> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// `raea sounds [WORDS...]`: the instruments whose names hold every word (all of them with no words, by pack).
|
/// `raea make sounds [WORDS...]`: the instruments whose names hold every word (all of them with no words, by pack).
|
||||||
pub fn sounds(args: &[String]) -> R<String> {
|
pub fn sounds(args: &[String]) -> R<String> {
|
||||||
if args.get(1).map(String::as_str) == Some("get") {
|
if args.get(1).map(String::as_str) == Some("get") {
|
||||||
return sounds_get(args);
|
return sounds_get(args);
|
||||||
@@ -70,7 +70,7 @@ pub fn sounds(args: &[String]) -> R<String> {
|
|||||||
if out.is_empty() {
|
if out.is_empty() {
|
||||||
return Ok(format!("no instrument in the sample libraries matches {:?}: try one word (piano, snare, strings, marimba)", words.join(" ")));
|
return Ok(format!("no instrument in the sample libraries matches {:?}: try one word (piano, snare, strings, marimba)", words.join(" ")));
|
||||||
}
|
}
|
||||||
Ok(format!("{}\n\nraea sounds get PACK/INSTRUMENT [--notes C2,C4] copies one into media/sounds/ and prints the Sampler for it", out.join("\n\n")))
|
Ok(format!("{}\n\nraea make sounds get PACK/INSTRUMENT [--notes C2,C4] copies one into media/sounds/ and prints the Sampler for it", out.join("\n\n")))
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Percent-encode a URL path (spaces, commas and `#` in VCSL's names), keeping its slashes.
|
/// Percent-encode a URL path (spaces, commas and `#` in VCSL's names), keeping its slashes.
|
||||||
@@ -106,16 +106,16 @@ pub(crate) fn static_path(p: &Path) -> String {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// `raea sounds get PACK/INSTRUMENT [--notes ..|--all] [-o DIR]`: an instrument's samples into the edit's
|
/// `raea make sounds get PACK/INSTRUMENT [--notes ..|--all] [-o DIR]`: an instrument's samples into the edit's
|
||||||
/// media (default media/sounds/PACK-INSTRUMENT/), its licence beside them, and the TSX that plays them.
|
/// media (default media/sounds/PACK-INSTRUMENT/), its licence beside them, and the TSX that plays them.
|
||||||
pub(crate) fn sounds_get(args: &[String]) -> R<String> {
|
pub(crate) fn sounds_get(args: &[String]) -> R<String> {
|
||||||
const USAGE: &str = "raea sounds get PACK/INSTRUMENT [--notes C2,C4 | --all] [--dir EDIT_DIR] [-o OUT_DIR] (raea sounds WORDS finds one)";
|
const USAGE: &str = "raea make sounds get PACK/INSTRUMENT [--notes C2,C4 | --all] [--dir EDIT_DIR] [-o OUT_DIR] (raea make sounds WORDS finds one)";
|
||||||
let id = *positional(&args[2..], &["--notes", "--dir", "-o"]).first().ok_or(USAGE)?;
|
let id = *positional(&args[2..], &["--notes", "--dir", "-o"]).first().ok_or(USAGE)?;
|
||||||
let (pid, iid) = id.split_once('/').ok_or(USAGE)?;
|
let (pid, iid) = id.split_once('/').ok_or(USAGE)?;
|
||||||
let c = catalog()?;
|
let c = catalog()?;
|
||||||
let pack = c["packs"].as_array().into_iter().flatten().find(|p| p["id"] == pid).ok_or(format!("no sample library `{pid}`: raea sounds lists them"))?;
|
let pack = c["packs"].as_array().into_iter().flatten().find(|p| p["id"] == pid).ok_or(format!("no sample library `{pid}`: raea make sounds lists them"))?;
|
||||||
let inst = pack["instruments"].as_array().into_iter().flatten().find(|i| i["id"] == iid)
|
let inst = pack["instruments"].as_array().into_iter().flatten().find(|i| i["id"] == iid)
|
||||||
.ok_or(format!("{pid} has no instrument `{iid}`: raea sounds {iid} searches for it"))?;
|
.ok_or(format!("{pid} has no instrument `{iid}`: raea make sounds {iid} searches for it"))?;
|
||||||
let files = files_of(pack, inst);
|
let files = files_of(pack, inst);
|
||||||
let pitched_files: Vec<_> = files.iter().filter(|f| f.0.is_some()).cloned().collect();
|
let pitched_files: Vec<_> = files.iter().filter(|f| f.0.is_some()).cloned().collect();
|
||||||
let pitched = pitched_files.iter().map(|f| f.0).collect::<std::collections::BTreeSet<_>>().len() >= 3;
|
let pitched = pitched_files.iter().map(|f| f.0).collect::<std::collections::BTreeSet<_>>().len() >= 3;
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
//! Splats from footage: a video (or a folder of pictures) of a real place or thing trained into a 3D Gaussian splat for
|
//! Splats from footage: a video (or a folder of pictures) of a real place or thing trained into a 3D Gaussian splat for
|
||||||
//! `<Splat src>` (raea_io_assets::Store::splat; tools/splat: frames, COLMAP, Brush on Metal).
|
//! `<Splat src>` (raea_io_assets::Store::splat; tools/splat: frames, COLMAP, Brush on Metal).
|
||||||
//!
|
//!
|
||||||
//! raea splat train VIDEO|IMAGE_DIR -o OUT.ply [--frames N] [--steps N] [--max-res PX] [--from S]
|
//! raea make splat train VIDEO|IMAGE_DIR -o OUT.ply [--frames N] [--steps N] [--max-res PX] [--from S]
|
||||||
//! [--seconds N] [--max-splats N] [--matte black] [--match sequential|exhaustive]
|
//! [--seconds N] [--max-splats N] [--matte black] [--match sequential|exhaustive]
|
||||||
//! [--credit TEXT] [--license TEXT] [--dir EDIT_DIR]
|
//! [--credit TEXT] [--license TEXT] [--dir EDIT_DIR]
|
||||||
//! raea splat setup
|
//! raea make splat setup
|
||||||
//!
|
//!
|
||||||
//! Goes through the asset store beside EDIT_DIR/edit.tsx (default the working folder), so the same footage and params
|
//! Goes through the asset store beside EDIT_DIR/edit.tsx (default the working folder), so the same footage and params
|
||||||
//! train once; OUT.ply is a copy of the store's `<hash>.ply` and OUT.ply.json of its sidecar (with --credit and
|
//! train once; OUT.ply is a copy of the store's `<hash>.ply` and OUT.ply.json of its sidecar (with --credit and
|
||||||
@@ -17,7 +17,7 @@ use raea_runtime_bundle::flag;
|
|||||||
|
|
||||||
type R<T> = Result<T, String>;
|
type R<T> = Result<T, String>;
|
||||||
|
|
||||||
pub const USAGE: &str = "raea splat train VIDEO|IMAGE_DIR -o OUT.ply [--frames 150] [--steps 20000] [--max-res 1600] [--from S] [--seconds N] [--max-splats 2000000] [--matte none|black] [--match sequential|exhaustive] [--credit TEXT] [--license TEXT] [--dir EDIT_DIR]\n raea splat setup";
|
pub const USAGE: &str = "raea make splat train VIDEO|IMAGE_DIR -o OUT.ply [--frames 150] [--steps 20000] [--max-res 1600] [--from S] [--seconds N] [--max-splats 2000000] [--matte none|black] [--match sequential|exhaustive] [--credit TEXT] [--license TEXT] [--dir EDIT_DIR]\n raea make splat setup";
|
||||||
const WITH_VALUE: [&str; 13] = ["--frames", "--steps", "--max-res", "--from", "--seconds", "--max-splats", "--matte", "--match", "--credit", "--license", "--dir", "-o", "--o"];
|
const WITH_VALUE: [&str; 13] = ["--frames", "--steps", "--max-res", "--from", "--seconds", "--max-splats", "--matte", "--match", "--credit", "--license", "--dir", "-o", "--o"];
|
||||||
|
|
||||||
/// The CLI's input and params (what Store::splat is asked), checked: (input, params JSON).
|
/// The CLI's input and params (what Store::splat is asked), checked: (input, params JSON).
|
||||||
@@ -57,7 +57,7 @@ pub fn parse(args: &[String]) -> R<(PathBuf, Value)> {
|
|||||||
Ok((input, raea_io_assets::splat_params(&Value::Object(p))?))
|
Ok((input, raea_io_assets::splat_params(&Value::Object(p))?))
|
||||||
}
|
}
|
||||||
|
|
||||||
/// `raea splat ...`
|
/// `raea make splat ...`
|
||||||
pub fn splat(args: &[String]) -> R<String> {
|
pub fn splat(args: &[String]) -> R<String> {
|
||||||
match args.get(1).map(String::as_str) {
|
match args.get(1).map(String::as_str) {
|
||||||
Some("setup") => {
|
Some("setup") => {
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ raea-io-assets = { path = "../../io/assets" }
|
|||||||
serde_json = "1"
|
serde_json = "1"
|
||||||
# a project's compositions and components read from their source (docs/projects.feature PJ8)
|
# a project's compositions and components read from their source (docs/projects.feature PJ8)
|
||||||
raea-app-registry = { path = "registry" }
|
raea-app-registry = { path = "registry" }
|
||||||
# the project's record of what renders and checks found, which raea next reads (docs/direction.feature DR3)
|
# the project's record of what renders and checks found, which raea goal next reads (docs/direction.feature DR3)
|
||||||
raea-core-facts = { path = "../../core/facts" }
|
raea-core-facts = { path = "../../core/facts" }
|
||||||
# a command's words (its arguments that aren't flags or their values), read as raea check reads them
|
# a command's words (its arguments that aren't flags or their values), read as raea check reads them
|
||||||
raea-app-check = { path = "../check" }
|
raea-app-check = { path = "../check" }
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
//! A project's compositions and components, registered by reading its files (docs/projects.feature PJ8),
|
//! A project's compositions and components, registered by reading its files (docs/projects.feature PJ8),
|
||||||
//! so the raea app, `raea project scan`, `raea doctor` and `raea next` agree on what each file is:
|
//! so the raea app, `raea project scan`, `raea doctor` and `raea goal next` agree on what each file is:
|
||||||
//! - a composition is each <Composition> a registerRoot registers (its props read from the source, not rendered), or a
|
//! - a composition is each <Composition> a registerRoot registers (its props read from the source, not rendered), or a
|
||||||
//! .tsx's default export with none that no other file imports, registered for it under its file's name (versions
|
//! .tsx's default export with none that no other file imports, registered for it under its file's name (versions
|
||||||
//! NAME-vN.tsx are one composition), sized from its newest render's manifest when it has one;
|
//! NAME-vN.tsx are one composition), sized from its newest render's manifest when it has one;
|
||||||
//! - a component is a .tsx a composition imports, directly or through another.
|
//! - a component is a .tsx a composition imports, directly or through another.
|
||||||
//! What isn't connected is linted (lint.rs), each with its file and line and the fix. raea-app-workspace runs `scan`
|
//! What isn't connected is linted (lint.rs), each with its file and line and the fix. raea-app-workspace runs `scan`
|
||||||
//! for `raea project scan`, `raea doctor`, `raea next` and `raea context`.
|
//! for `raea project scan`, `raea doctor`, `raea goal next` and `raea context`.
|
||||||
use std::collections::{BTreeMap, BTreeSet};
|
use std::collections::{BTreeMap, BTreeSet};
|
||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
|
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ pub(super) fn lint(reg: &Registry, files: &[File], used_by: &BTreeMap<String, BT
|
|||||||
format!("imports {} from outside the project", tilde(&to)),
|
format!("imports {} from outside the project", tilde(&to)),
|
||||||
&match in_shared {
|
&match in_shared {
|
||||||
Some(r) => format!("import it by the workspace's name for it: \"@shared/{}\"", r.with_extension("").to_string_lossy().replace(std::path::MAIN_SEPARATOR, "/")),
|
Some(r) => format!("import it by the workspace's name for it: \"@shared/{}\"", r.with_extension("").to_string_lossy().replace(std::path::MAIN_SEPARATOR, "/")),
|
||||||
None => "move it to the workspace's shared/ and import it as @shared/<kind>/<name>, or copy it into the project (raea component add, for raea's sets)".into(),
|
None => "move it to the workspace's shared/ and import it as @shared/<kind>/<name>, or copy it into the project (raea make component add, for raea's sets)".into(),
|
||||||
},
|
},
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -86,12 +86,12 @@ fn old_controllers(base: &Path, ws: Option<&Path>, out: &mut Vec<Finding>) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A brief.ts that still keeps tasks in `stages` (docs/plan.feature PL8a): they read, unread, and belong in plan.org.
|
/// A brief.ts that still keeps tasks in `stages` (docs/plan.feature PL8a): they read, unread, and belong in plan.ts.
|
||||||
fn briefs_with_tasks(base: &Path, out: &mut Vec<Finding>) {
|
fn briefs_with_tasks(base: &Path, out: &mut Vec<Finding>) {
|
||||||
let f = base.join("brief.ts");
|
let f = base.join("brief.ts");
|
||||||
let Ok(text) = std::fs::read_to_string(&f) else { return };
|
let Ok(text) = std::fs::read_to_string(&f) else { return };
|
||||||
if text.lines().any(|l| l.trim_start().starts_with("stages:") || l.trim_start().starts_with("\"stages\":")) {
|
if text.lines().any(|l| l.trim_start().starts_with("stages:") || l.trim_start().starts_with("\"stages\":")) {
|
||||||
let says = format!("{}: keeps tasks in `stages`, which raea no longer reads; move each to the project's plan.org (an Org heading under its stage, its mark as TODO, DONE or DROPPED), then delete `stages`", f.display());
|
let says = format!("{}: keeps tasks in `stages`, which raea no longer reads; move each to the project's plan.ts (a task under its stage, its mark as its keyword: TODO, DONE or DROPPED), then delete `stages`", f.display());
|
||||||
out.push(Finding { says, fix: Fix::No });
|
out.push(Finding { says, fix: Fix::No });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
//! `raea next` (docs/skills.feature SK10): the two or three useful next steps for a project, read from its files: the
|
//! `raea goal next` (docs/skills.feature SK10): the two or three useful next steps for a project, read from its files: the
|
||||||
//! brief (what it still needs, from the raea CLI's brief doctor), the storyboard its modes want, its compositions, and
|
//! brief (what it still needs, from the raea CLI's brief doctor), the storyboard its modes want, its compositions, and
|
||||||
//! from the project's record (docs/direction.feature DR3) its renders and their checks and what each found. A menu for
|
//! from the project's record (docs/direction.feature DR3) its renders and their checks and what each found. A menu for
|
||||||
//! the agent or the person to pick from; nothing runs.
|
//! the agent or the person to pick from; nothing runs.
|
||||||
@@ -97,10 +97,10 @@ pub fn steps(dir: &Path, brief: &Brief, stale: usize) -> Vec<String> {
|
|||||||
out
|
out
|
||||||
}
|
}
|
||||||
|
|
||||||
/// `raea next`'s text.
|
/// `raea goal next`'s text.
|
||||||
pub fn text(dir: &Path, brief: &Brief, stale: usize) -> String {
|
pub fn text(dir: &Path, brief: &Brief, stale: usize) -> String {
|
||||||
let s = steps(dir, brief, stale);
|
let s = steps(dir, brief, stale);
|
||||||
let mut t = format!("raea next: {}\n", dir.display());
|
let mut t = format!("raea goal next: {}\n", dir.display());
|
||||||
for (i, line) in s.iter().enumerate() {
|
for (i, line) in s.iter().enumerate() {
|
||||||
t.push_str(&format!("{}. {line}\n", i + 1));
|
t.push_str(&format!("{}. {line}\n", i + 1));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -91,8 +91,8 @@ fn doctor_connects_a_projects_files() {
|
|||||||
// a controller from before 11-20 is told where its parts go, and kept
|
// a controller from before 11-20 is told where its parts go, and kept
|
||||||
let out = doctor::doctor(&["--fix".into(), d.display().to_string()], &[], "0.0.1", &|_| Ok(String::new())).unwrap();
|
let out = doctor::doctor(&["--fix".into(), d.display().to_string()], &[], "0.0.1", &|_| Ok(String::new())).unwrap();
|
||||||
assert!(out.starts_with("APPLIED 2 of 5 fixed") && out.contains("controllers/pace.ts: a controller, which raea no longer reads") && out.contains("taste.ts"), "{out}");
|
assert!(out.starts_with("APPLIED 2 of 5 fixed") && out.contains("controllers/pace.ts: a controller, which raea no longer reads") && out.contains("taste.ts"), "{out}");
|
||||||
// a brief's old tasks are said to belong in plan.org (docs/plan.feature PL8a), and kept
|
// a brief's old tasks are said to belong in plan.ts (docs/plan.feature PL8a), and kept
|
||||||
assert!(out.contains("brief.ts: keeps tasks in `stages`") && out.contains("plan.org"), "{out}");
|
assert!(out.contains("brief.ts: keeps tasks in `stages`") && out.contains("plan.ts"), "{out}");
|
||||||
assert!(d.join("controllers/pace.ts").is_file() && std::fs::read_to_string(d.join("brief.ts")).unwrap().contains("stages"), "nothing of the person's is deleted");
|
assert!(d.join("controllers/pace.ts").is_file() && std::fs::read_to_string(d.join("brief.ts")).unwrap().contains("stages"), "nothing of the person's is deleted");
|
||||||
let _ = std::fs::remove_dir_all(&d);
|
let _ = std::fs::remove_dir_all(&d);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// A set as blender/lightbake.py left it (docs/bake.feature BK0): one <Model> of its meshes, each with its Cycles
|
// A set as blender/lightbake.py left it (docs/bake.feature BK0): one <Model> of its meshes, each with its Cycles
|
||||||
// lightmap and the exposure that puts the bake at raea's brightness, from the .lightmaps.json lightbake.py wrote. A
|
// lightmap and the exposure that puts the bake at raea's brightness, from the .lightmaps.json lightbake.py wrote. A
|
||||||
// mesh lightbake.py left unbaked (a metal) is drawn as raea draws it. `raea bake light --compare` makes media/baked/.
|
// mesh lightbake.py left unbaked (a metal) is drawn as raea draws it. `raea make bake light --compare` makes media/baked/.
|
||||||
import { staticFile } from "raea";
|
import { staticFile } from "raea";
|
||||||
import { Model } from "raea/3d";
|
import { Model } from "raea/3d";
|
||||||
import { Lightmap, StandardMaterial } from "raea/pbr";
|
import { Lightmap, StandardMaterial } from "raea/pbr";
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// The cornell set with Cycles' bounce light baked into its lightmaps by blender/lightbake.py, any sun left live: what raea's
|
// The cornell set with Cycles' bounce light baked into its lightmaps by blender/lightbake.py, any sun left live: what raea's
|
||||||
// own bake is measured against (docs/bake.feature BK0). `raea bake light --compare` makes media/baked/cornell/.
|
// own bake is measured against (docs/bake.feature BK0). `raea make bake light --compare` makes media/baked/cornell/.
|
||||||
import { AbsoluteFill, Composition, registerRoot } from "raea";
|
import { AbsoluteFill, Composition, registerRoot } from "raea";
|
||||||
import { Baked } from "./baked";
|
import { Baked } from "./baked";
|
||||||
import { Look } from "./parts/cornell";
|
import { Look } from "./parts/cornell";
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// The table set with Cycles' bounce light baked into its lightmaps by blender/lightbake.py, any sun left live: what raea's
|
// The table set with Cycles' bounce light baked into its lightmaps by blender/lightbake.py, any sun left live: what raea's
|
||||||
// own bake is measured against (docs/bake.feature BK0). `raea bake light --compare` makes media/baked/table/.
|
// own bake is measured against (docs/bake.feature BK0). `raea make bake light --compare` makes media/baked/table/.
|
||||||
import { AbsoluteFill, Composition, registerRoot } from "raea";
|
import { AbsoluteFill, Composition, registerRoot } from "raea";
|
||||||
import { Baked } from "./baked";
|
import { Baked } from "./baked";
|
||||||
import { Look } from "./parts/table";
|
import { Look } from "./parts/table";
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// The window set with Cycles' bounce light baked into its lightmaps by blender/lightbake.py, any sun left live: what raea's
|
// The window set with Cycles' bounce light baked into its lightmaps by blender/lightbake.py, any sun left live: what raea's
|
||||||
// own bake is measured against (docs/bake.feature BK0). `raea bake light --compare` makes media/baked/window/.
|
// own bake is measured against (docs/bake.feature BK0). `raea make bake light --compare` makes media/baked/window/.
|
||||||
import { AbsoluteFill, Composition, registerRoot } from "raea";
|
import { AbsoluteFill, Composition, registerRoot } from "raea";
|
||||||
import { Baked } from "./baked";
|
import { Baked } from "./baked";
|
||||||
import { Look } from "./parts/window";
|
import { Look } from "./parts/window";
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ run() {
|
|||||||
frames=$(ffprobe -v error -count_frames -select_streams v:0 -show_entries stream=nb_read_frames -of csv=p=0 "$out" 2>/dev/null)
|
frames=$(ffprobe -v error -count_frames -select_streams v:0 -show_entries stream=nb_read_frames -of csv=p=0 "$out" 2>/dev/null)
|
||||||
secs=$(ffprobe -v error -show_entries format=duration -of csv=p=0 "$out" 2>/dev/null)
|
secs=$(ffprobe -v error -show_entries format=duration -of csv=p=0 "$out" 2>/dev/null)
|
||||||
local bake
|
local bake
|
||||||
bake=$(grep -m1 '^raea bake:' "$log" | sed 's/^raea bake: //')
|
bake=$(grep -m1 '^raea make bake:' "$log" | sed 's/^raea make bake: //')
|
||||||
printf '%s\texit %s\t%.2f s\t%s ms a frame\t%s frames, %s s of video\tbake: %s\tstartup: %s\n' "$tag" "$rc" "$(echo "$t1 - $t0" | bc)" "${per:-?}" "${frames:-?}" "${secs:-?}" "${bake:-none}" "$marks"
|
printf '%s\texit %s\t%.2f s\t%s ms a frame\t%s frames, %s s of video\tbake: %s\tstartup: %s\n' "$tag" "$rc" "$(echo "$t1 - $t0" | bc)" "${per:-?}" "${frames:-?}" "${secs:-?}" "${bake:-none}" "$marks"
|
||||||
}
|
}
|
||||||
while IFS=$'\t' read -r path comp from to scale sign; do
|
while IFS=$'\t' read -r path comp from to scale sign; do
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
//! What a file is, cheaply: its size and a hash of its first and last MB. The ledger keeps it on every call
|
//! What a file is, cheaply: its size and a hash of its first and last MB. The ledger keeps it on every call
|
||||||
//! (apps/ask record.rs), so a render is known again by its copy in the feed, a later render to the same path isn't
|
//! (apps/ask record.rs), so a render is known again by its copy in the feed, a later render to the same path isn't
|
||||||
//! taken for it, and `raea make status` knows an answer was about exactly the sheet on disk now (docs/make.feature MK4).
|
//! taken for it, and `raea goal gates` knows an answer was about exactly the sheet on disk now (docs/goal.feature MK4).
|
||||||
|
|
||||||
use std::io::{Read as _, Seek as _, SeekFrom};
|
use std::io::{Read as _, Seek as _, SeekFrom};
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
//! The questions that come standard (docs/ask.feature AK1), each set named: `rubric` (the craft rubric's own questions,
|
//! The questions that come standard (docs/ask.feature AK1), each set named: `rubric` (the craft rubric's own questions,
|
||||||
//! read from sdk/guides/craft/rubric.md, so there's one copy), `av` (picture with sound), `defects` (the fingerprint's
|
//! read from sdk/guides/craft/rubric.md, so there's one copy), `av` (picture with sound), `defects` (the fingerprint's
|
||||||
//! axes with no labels yet), `platform` (the check packs' questions with their calibration), `decide` (picks and
|
//! axes with no labels yet), `platform` (the check packs' questions with their calibration), `decide` (picks and
|
||||||
//! comparisons) and `make` (the review loop's gate questions, asked of a job's sheets: docs/make.feature MK4; each id
|
//! comparisons) and `make` (the review loop's gate questions, asked of a job's sheets: docs/goal.feature MK4; each id
|
||||||
//! says its sheet, make.clay.*, make.colour.*, make.refs.*, make.framing.*). The JSON sets ship inside raea; the
|
//! says its sheet, make.clay.*, make.colour.*, make.refs.*, make.framing.*). The JSON sets ship inside raea; the
|
||||||
//! rubric is read from the guide the caller hands in.
|
//! rubric is read from the guide the caller hands in.
|
||||||
|
|
||||||
|
|||||||
+12
-7
@@ -1,5 +1,5 @@
|
|||||||
//! A project's brief: who it's for, the one thing they should believe and what it delivers. The facts an agent guessed
|
//! A project's brief: who it's for, the one thing they should believe and what it delivers. The facts an agent guessed
|
||||||
//! are listed in `assumed`, for the person to confirm. Its tasks are in the project's plan.org, not here
|
//! are listed in `assumed`, for the person to confirm. Its tasks are in the project's plan.ts, not here
|
||||||
//! (docs/plan.feature PL8a).
|
//! (docs/plan.feature PL8a).
|
||||||
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
@@ -48,7 +48,7 @@ pub struct Brief {
|
|||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
#[ts(as = "Option<Vec<Reference>>", optional)]
|
#[ts(as = "Option<Vec<Reference>>", optional)]
|
||||||
pub references: Vec<Reference>,
|
pub references: Vec<Reference>,
|
||||||
/// an older brief's tasks, read only so it still loads: they belong in plan.org (docs/plan.feature PL8a), and
|
/// an older brief's tasks, read only so it still loads: they belong in plan.ts (docs/plan.feature PL8a), and
|
||||||
/// `raea doctor` says so; never written, and not in the schema an agent writes to
|
/// `raea doctor` says so; never written, and not in the schema an agent writes to
|
||||||
#[serde(default, skip_serializing)]
|
#[serde(default, skip_serializing)]
|
||||||
#[ts(skip)]
|
#[ts(skip)]
|
||||||
@@ -61,11 +61,16 @@ pub struct Brief {
|
|||||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||||
#[ts(type = "unknown", optional)]
|
#[ts(type = "unknown", optional)]
|
||||||
pub story: Option<serde_json::Value>,
|
pub story: Option<serde_json::Value>,
|
||||||
/// a scene, kit or shot made to a frozen plan and held to the review loop (docs/make.feature): `scene()`, `kit()`
|
/// the project's tasks (raea/task `plan({...})`, docs/plan.feature): written inline or imported from a module, read
|
||||||
/// or `shot()` from "raea/brief"; `raea make status` decides when it's done
|
/// from the brief's run by `raea goal tasks`; kept as written, raea/task reads it
|
||||||
|
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||||
|
#[ts(type = "import(\"raea/task\").PlanFile", optional)]
|
||||||
|
pub plan: Option<serde_json::Value>,
|
||||||
|
/// what the work is held to (docs/goal.feature): one goal, or several in order (a workflow inline), each a `cut()`,
|
||||||
|
/// `shot()`, `kit()`, `scene()` or `rules()` from "raea/brief"; `raea goal check` decides when each is done
|
||||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||||
#[ts(optional)]
|
#[ts(optional)]
|
||||||
pub make: Option<crate::make::Make>,
|
pub goal: Option<crate::goal::Goals>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, TS)]
|
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, TS)]
|
||||||
@@ -129,8 +134,8 @@ pub fn doctor(b: &Brief) -> Vec<String> {
|
|||||||
for a in &b.assumed {
|
for a in &b.assumed {
|
||||||
out.push(format!("`{a}` is assumed: confirm it with the person"));
|
out.push(format!("`{a}` is assumed: confirm it with the person"));
|
||||||
}
|
}
|
||||||
if let Some(m) = &b.make {
|
if let Some(g) = &b.goal {
|
||||||
out.extend(crate::make::doctor(m).into_iter().map(|d| format!("make: {d}")));
|
out.extend(crate::goal::doctor_all(g).into_iter().map(|d| format!("goal: {d}")));
|
||||||
}
|
}
|
||||||
out
|
out
|
||||||
}
|
}
|
||||||
+52
-13
@@ -1,8 +1,8 @@
|
|||||||
//! A cut job's contract (docs/make.feature MK25): `make: cut({...})` on brief.ts, the client's brief made into rules
|
//! A cut goal's contract (docs/goal.feature MK25): `goal: cut({...})` on brief.ts, the client's brief made into rules
|
||||||
//! before anything is planned or cut. A brief read as context gets lost (11-25, Shane, on StreetTalk's street interview
|
//! before anything is planned or cut. A brief read as context gets lost (11-25, Shane, on StreetTalk's street interview
|
||||||
//! ads: "you need to make the process of ingesting the brief more direct, or else it's just context that gets lost. It
|
//! ads: "you need to make the process of ingesting the brief more direct, or else it's just context that gets lost. It
|
||||||
//! needs to be written as a brief typescript rule that is then enforced"). Every rule quotes the brief line it came
|
//! needs to be written as a brief typescript rule that is then enforced"). Every rule quotes the brief line it came
|
||||||
//! from (`from`), and `raea make status` (apps/make cut.rs) finds each quote in the brief's text, so a rule can't be
|
//! from (`from`), and raea/goal's quotes pack (sdk/goal) finds each quote in the brief's text, so a rule can't be
|
||||||
//! invented and a brief line can't drift; then it holds every delivered file to the rules, from what's on disk.
|
//! invented and a brief line can't drift; then it holds every delivered file to the rules, from what's on disk.
|
||||||
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
@@ -11,7 +11,7 @@ use ts_rs::TS;
|
|||||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, TS)]
|
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, TS)]
|
||||||
#[serde(rename_all = "camelCase", deny_unknown_fields)]
|
#[serde(rename_all = "camelCase", deny_unknown_fields)]
|
||||||
#[ts(optional_fields)]
|
#[ts(optional_fields)]
|
||||||
#[ts(rename = "MakeCut")]
|
#[ts(rename = "CutGoal")]
|
||||||
pub struct Cut {
|
pub struct Cut {
|
||||||
/// the brief as text, relative to brief.ts (`pdftotext -layout brief.pdf media/brief.txt`): every `from` is found in it
|
/// the brief as text, relative to brief.ts (`pdftotext -layout brief.pdf media/brief.txt`): every `from` is found in it
|
||||||
pub brief: String,
|
pub brief: String,
|
||||||
@@ -47,7 +47,7 @@ pub struct Cut {
|
|||||||
/// A value with the brief's words for it.
|
/// A value with the brief's words for it.
|
||||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, TS)]
|
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, TS)]
|
||||||
#[serde(deny_unknown_fields)]
|
#[serde(deny_unknown_fields)]
|
||||||
#[ts(rename = "MakeQuoted")]
|
#[ts(rename = "Quoted")]
|
||||||
pub struct Quoted<T: TS> {
|
pub struct Quoted<T: TS> {
|
||||||
pub value: T,
|
pub value: T,
|
||||||
/// the brief's own words, as they are in its text
|
/// the brief's own words, as they are in its text
|
||||||
@@ -57,7 +57,7 @@ pub struct Quoted<T: TS> {
|
|||||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, TS)]
|
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, TS)]
|
||||||
#[serde(rename_all = "camelCase", deny_unknown_fields)]
|
#[serde(rename_all = "camelCase", deny_unknown_fields)]
|
||||||
#[ts(optional_fields)]
|
#[ts(optional_fields)]
|
||||||
#[ts(rename = "MakeCutPlan")]
|
#[ts(rename = "CutPlan")]
|
||||||
pub struct CutPlan {
|
pub struct CutPlan {
|
||||||
/// [a-z0-9_], unique: each format lands as out/cuts/<id>_<W>x<H>.mp4 ("a1_s1_9x16.mp4")
|
/// [a-z0-9_], unique: each format lands as out/cuts/<id>_<W>x<H>.mp4 ("a1_s1_9x16.mp4")
|
||||||
pub id: String,
|
pub id: String,
|
||||||
@@ -72,12 +72,35 @@ pub struct CutPlan {
|
|||||||
#[ts(as = "Option<Vec<String>>", optional)]
|
#[ts(as = "Option<Vec<String>>", optional)]
|
||||||
pub formats: Vec<String>,
|
pub formats: Vec<String>,
|
||||||
pub seconds: Option<[f64; 2]>,
|
pub seconds: Option<[f64; 2]>,
|
||||||
|
/// the cut's beats in order (docs/goal.feature MK48): what each must make the viewer feel and understand, decided
|
||||||
|
/// before the cut (Murch: emotion and story weigh most), and its pace
|
||||||
|
#[serde(default)]
|
||||||
|
#[ts(as = "Option<Vec<Beat>>", optional)]
|
||||||
|
pub beats: Vec<Beat>,
|
||||||
|
}
|
||||||
|
|
||||||
|
/// One beat of a cut, from `at` seconds to the next beat's (or the end).
|
||||||
|
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, TS)]
|
||||||
|
#[serde(rename_all = "camelCase", deny_unknown_fields)]
|
||||||
|
#[ts(optional_fields)]
|
||||||
|
#[ts(rename = "Beat")]
|
||||||
|
pub struct Beat {
|
||||||
|
/// where it starts, in seconds from the cut's start (0 for the first)
|
||||||
|
pub at: f64,
|
||||||
|
/// what the viewer feels here, in the person's words ("the itch of a chore left undone")
|
||||||
|
pub feel: String,
|
||||||
|
/// what the viewer understands by its end ("the app does the reminding")
|
||||||
|
pub story: Option<String>,
|
||||||
|
/// its average shot length in seconds: the shots inside it average within a third of this
|
||||||
|
pub asl: Option<f64>,
|
||||||
|
/// how its shot lengths move: "build" (shorter as it goes), "release" (longer) or "hold" (even)
|
||||||
|
pub tempo: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, TS)]
|
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, TS)]
|
||||||
#[serde(rename_all = "camelCase", deny_unknown_fields)]
|
#[serde(rename_all = "camelCase", deny_unknown_fields)]
|
||||||
#[ts(optional_fields)]
|
#[ts(optional_fields)]
|
||||||
#[ts(rename = "MakePhrase")]
|
#[ts(rename = "Phrase")]
|
||||||
pub struct Phrase {
|
pub struct Phrase {
|
||||||
/// as it's said or shown; compared in lower case, by letters and digits ("24/7" and "24-7" are the same)
|
/// as it's said or shown; compared in lower case, by letters and digits ("24/7" and "24-7" are the same)
|
||||||
pub text: String,
|
pub text: String,
|
||||||
@@ -89,7 +112,7 @@ pub struct Phrase {
|
|||||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, TS)]
|
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, TS)]
|
||||||
#[serde(rename_all = "camelCase", deny_unknown_fields)]
|
#[serde(rename_all = "camelCase", deny_unknown_fields)]
|
||||||
#[ts(optional_fields)]
|
#[ts(optional_fields)]
|
||||||
#[ts(rename = "MakeCta")]
|
#[ts(rename = "Cta")]
|
||||||
pub struct Cta {
|
pub struct Cta {
|
||||||
pub text: String,
|
pub text: String,
|
||||||
pub from: String,
|
pub from: String,
|
||||||
@@ -104,7 +127,7 @@ pub struct Cta {
|
|||||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, TS)]
|
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, TS)]
|
||||||
#[serde(rename_all = "camelCase", deny_unknown_fields)]
|
#[serde(rename_all = "camelCase", deny_unknown_fields)]
|
||||||
#[ts(optional_fields)]
|
#[ts(optional_fields)]
|
||||||
#[ts(rename = "MakeOpen")]
|
#[ts(rename = "CutOpen")]
|
||||||
pub struct Open {
|
pub struct Open {
|
||||||
pub question: String,
|
pub question: String,
|
||||||
pub from: String,
|
pub from: String,
|
||||||
@@ -115,9 +138,6 @@ pub struct Open {
|
|||||||
pub by: Option<String>,
|
pub by: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// How near the end the CTA lands when the contract says nothing.
|
|
||||||
pub const CTA_WITHIN: f64 = 8.0;
|
|
||||||
|
|
||||||
/// A format's frame shape, "9:16" -> (9, 16).
|
/// A format's frame shape, "9:16" -> (9, 16).
|
||||||
pub fn ratio(f: &str) -> Option<(u32, u32)> {
|
pub fn ratio(f: &str) -> Option<(u32, u32)> {
|
||||||
let (w, h) = f.split_once(':')?;
|
let (w, h) = f.split_once(':')?;
|
||||||
@@ -142,7 +162,8 @@ pub fn deliverables(c: &Cut) -> Vec<String> {
|
|||||||
c.cuts.iter().flat_map(|p| formats(c, p).iter().map(move |f| file(p, f))).collect()
|
c.cuts.iter().flat_map(|p| formats(c, p).iter().map(move |f| file(p, f))).collect()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Every `from` in the contract, with what it backs: the quotes `raea make status` finds in the brief's text.
|
/// Every `from` in the contract, with what it backs: what doctor holds to have a quote (raea/goal's quotes pack finds
|
||||||
|
/// each in the brief's text).
|
||||||
pub fn quotes(c: &Cut) -> Vec<(String, &str)> {
|
pub fn quotes(c: &Cut) -> Vec<(String, &str)> {
|
||||||
let mut q: Vec<(String, &str)> = Vec::new();
|
let mut q: Vec<(String, &str)> = Vec::new();
|
||||||
if let Some(n) = &c.count {
|
if let Some(n) = &c.count {
|
||||||
@@ -185,7 +206,7 @@ pub fn doctor(c: &Cut) -> Vec<String> {
|
|||||||
if !seen.insert(p.id.as_str()) {
|
if !seen.insert(p.id.as_str()) {
|
||||||
out.push(format!("cut `{}` is listed twice", p.id));
|
out.push(format!("cut `{}` is listed twice", p.id));
|
||||||
}
|
}
|
||||||
if !crate::make::is_name(&p.id) {
|
if !crate::goal::is_name(&p.id) {
|
||||||
out.push(format!("cut `{}`: ids are [a-z0-9_], the file it lands as", p.id));
|
out.push(format!("cut `{}`: ids are [a-z0-9_], the file it lands as", p.id));
|
||||||
}
|
}
|
||||||
let fs = formats(c, p);
|
let fs = formats(c, p);
|
||||||
@@ -205,6 +226,24 @@ pub fn doctor(c: &Cut) -> Vec<String> {
|
|||||||
{
|
{
|
||||||
out.push(format!("cut `{}`: text is captions, hook or none, not `{t}`", p.id));
|
out.push(format!("cut `{}`: text is captions, hook or none, not `{t}`", p.id));
|
||||||
}
|
}
|
||||||
|
let mut last = -1.0;
|
||||||
|
for (i, b) in p.beats.iter().enumerate() {
|
||||||
|
if b.at < 0.0 || b.at <= last || (i == 0 && b.at != 0.0) {
|
||||||
|
out.push(format!("cut `{}`: beat {} at {} s: beats start at 0 and go in order", p.id, i + 1, b.at));
|
||||||
|
}
|
||||||
|
last = b.at;
|
||||||
|
if b.feel.trim().is_empty() {
|
||||||
|
out.push(format!("cut `{}`: beat {} has no `feel`: what the viewer feels there, in the person's words", p.id, i + 1));
|
||||||
|
}
|
||||||
|
if let Some(t) = &b.tempo
|
||||||
|
&& !matches!(t.as_str(), "build" | "release" | "hold")
|
||||||
|
{
|
||||||
|
out.push(format!("cut `{}`: beat {}'s tempo is build, release or hold, not `{t}`", p.id, i + 1));
|
||||||
|
}
|
||||||
|
if b.asl.is_some_and(|a| !(a > 0.0)) {
|
||||||
|
out.push(format!("cut `{}`: beat {}'s asl is seconds a shot, above 0", p.id, i + 1));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
for (what, from) in quotes(c) {
|
for (what, from) in quotes(c) {
|
||||||
if from.trim().is_empty() {
|
if from.trim().is_empty() {
|
||||||
|
|||||||
+380
-44
@@ -1,67 +1,403 @@
|
|||||||
//! A goal job's contract: `make: goal({...})` on brief.ts, the person's goal written as rules before the work starts
|
//! A goal (docs/goal.feature): one step of the work, on a project's brief.ts as `goal:` (one, or several in order: a
|
||||||
//! (11-26, Shane: "we essentially just need to make sure that it can't stop unless all the goals pass, or all the rules
|
//! workflow), written with `cut()`, `shot()`, `kit()`, `scene()` or `rules()` from "raea/brief" before anything is
|
||||||
//! in the brief"). `/goal` in raea.app and an agent's own goal are this: the goal in the person's words, then each
|
//! built, and read here. Each kind turns its packs on: a scene (a dressed, lit place), a kit (props that belong
|
||||||
//! thing that must hold, as a command that must pass, a file that must exist, or words a fresh critic must find true.
|
//! together), a shot (stills or camera moves of a built scene), a cut (ads from footage to a client's brief), and
|
||||||
//! `raea make status` (runtime/goal-plan) decides from them whether the agent may stop; the agent saying so never does.
|
//! rules (any other work: only its own rules). Any goal can carry `rules` and an `aim`. Every object carries its real
|
||||||
|
//! size and whether it came from the reference or was invented; every dial its value, where the value came from, and
|
||||||
|
//! what it meant here. `raea goal check` (sdk/goal) holds each goal to it.
|
||||||
|
|
||||||
|
use std::collections::BTreeMap;
|
||||||
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use ts_rs::TS;
|
use ts_rs::TS;
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, TS)]
|
||||||
|
#[serde(rename_all = "lowercase")]
|
||||||
|
#[ts(rename = "GoalKind")]
|
||||||
|
pub enum Kind {
|
||||||
|
/// a dressed, lit place from references or a brief
|
||||||
|
Scene,
|
||||||
|
/// a set of props in one style, at real size, to drop into any scene
|
||||||
|
Kit,
|
||||||
|
/// stills or camera moves of a built scene, from words
|
||||||
|
Shot,
|
||||||
|
/// ads cut from footage to a client's brief: its deliverables, phrases, claims and CTA as rules (cut.rs, MK25)
|
||||||
|
Cut,
|
||||||
|
/// any other work, held only to its rules: commands that must pass, files that must exist, words a critic judges
|
||||||
|
Rules,
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, TS)]
|
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, TS)]
|
||||||
#[serde(rename_all = "camelCase", deny_unknown_fields)]
|
#[serde(rename_all = "camelCase", deny_unknown_fields)]
|
||||||
#[ts(optional_fields)]
|
#[ts(optional_fields)]
|
||||||
#[ts(rename = "MakeGoal")]
|
|
||||||
pub struct Goal {
|
pub struct Goal {
|
||||||
/// the goal as the person said it
|
pub kind: Kind,
|
||||||
pub goal: String,
|
/// how the plan, the report and other goals' `after` name it ([a-z0-9_]); the kind when left out
|
||||||
/// what must hold before the agent may stop: every one, each checked in code or by a fresh critic
|
pub name: Option<String>,
|
||||||
|
/// the workflow step it serves, by the workflow's name for it (`edit`, `deliver`)
|
||||||
|
pub step: Option<String>,
|
||||||
|
/// the goals that must be done before this one starts, by name
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
#[ts(as = "Option<Vec<GoalRule>>", optional)]
|
#[ts(as = "Option<Vec<String>>", optional)]
|
||||||
pub rules: Vec<GoalRule>,
|
pub after: Vec<String>,
|
||||||
|
/// what the goal is, in the person's words
|
||||||
|
pub aim: Option<String>,
|
||||||
|
/// what must hold before the agent may stop, beside the kind's packs: each checked in code or by a fresh critic
|
||||||
|
#[serde(default)]
|
||||||
|
#[ts(as = "Option<Vec<crate::rules::Rule>>", optional)]
|
||||||
|
pub rules: Vec<crate::rules::Rule>,
|
||||||
|
/// the pictures the job answers to (paths beside the brief): what is in it and where for a scene, the style for a kit
|
||||||
|
#[serde(default)]
|
||||||
|
#[ts(as = "Option<Vec<String>>", optional)]
|
||||||
|
pub references: Vec<String>,
|
||||||
|
/// one paragraph every reference prompt carries: era, palette, materials, wear, and one fictional maker
|
||||||
|
pub style: Option<String>,
|
||||||
|
/// by name, from the kind's set (DIALS); one left out is read from the references
|
||||||
|
#[serde(default)]
|
||||||
|
#[ts(as = "Option<BTreeMap<String, Dial>>", optional)]
|
||||||
|
pub dials: BTreeMap<String, Dial>,
|
||||||
|
#[serde(default)]
|
||||||
|
#[ts(as = "Option<Vec<Object>>", optional)]
|
||||||
|
pub objects: Vec<Object>,
|
||||||
|
#[serde(default)]
|
||||||
|
#[ts(as = "Option<Vec<Shot>>", optional)]
|
||||||
|
pub shots: Vec<Shot>,
|
||||||
|
/// the compositions the job's checks hold (relative to the brief): each needs a clean render or check newer than it
|
||||||
|
#[serde(default)]
|
||||||
|
#[ts(as = "Option<Vec<String>>", optional)]
|
||||||
|
pub compositions: Vec<String>,
|
||||||
|
/// what must exist when it's done, relative to the brief; replaces the kind's own list (`deliverables`)
|
||||||
|
#[serde(default)]
|
||||||
|
#[ts(as = "Option<Vec<String>>", optional)]
|
||||||
|
pub deliverables: Vec<String>,
|
||||||
|
/// the most critic rounds the job gets; at the cap it is delivered with what's still missing (8 by default)
|
||||||
|
pub rounds: Option<u32>,
|
||||||
|
/// a cut job's contract: the brief as rules (cut.rs)
|
||||||
|
pub cut: Option<crate::cut::Cut>,
|
||||||
|
/// what the job shows but never delivers, relative to the brief (pictures, render tests, examples): each a file or a
|
||||||
|
/// `dir/` (review/ and previews/ when left out). Deliverables are what it hands over; previews are how it got there
|
||||||
|
#[serde(default)]
|
||||||
|
#[ts(as = "Option<Vec<String>>", optional)]
|
||||||
|
pub previews: Vec<String>,
|
||||||
|
/// raea's packs switched by name over the kind's defaults (`{ surprise: true, place: false }`): which of
|
||||||
|
/// raea/goal's rules hold this goal (docs/goal.feature)
|
||||||
|
#[serde(default)]
|
||||||
|
#[ts(as = "Option<BTreeMap<String, bool>>", optional)]
|
||||||
|
pub packs: BTreeMap<String, bool>,
|
||||||
|
/// the project's own checks (raea/check `check()`, imported into brief.ts), run by `raea goal check`; as data, only
|
||||||
|
/// their declarations (id, text, over, at) reach Rust
|
||||||
|
#[serde(default)]
|
||||||
|
#[ts(type = "Array<unknown>", optional)]
|
||||||
|
pub checks: Vec<serde_json::Value>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, TS)]
|
||||||
|
#[serde(rename_all = "lowercase")]
|
||||||
|
#[ts(rename = "GoalSource")]
|
||||||
|
pub enum Source {
|
||||||
|
/// set by the person who asked: an instruction, even when the reference says otherwise
|
||||||
|
Customer,
|
||||||
|
/// read from the references, because nobody set it
|
||||||
|
Reference,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, TS)]
|
||||||
|
#[serde(untagged)]
|
||||||
|
#[ts(rename = "GoalDialValue")]
|
||||||
|
pub enum DialValue {
|
||||||
|
Number(f64),
|
||||||
|
Text(String),
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, TS)]
|
||||||
|
#[serde(untagged)]
|
||||||
|
#[ts(rename = "GoalDial")]
|
||||||
|
pub enum Dial {
|
||||||
|
/// `wear: 0.4`: the value alone, set by the person
|
||||||
|
Bare(DialValue),
|
||||||
|
/// `wear: { value: 0.4, source: "reference", means: "scuffed bakelite, worn paint on the edges" }`
|
||||||
|
Full {
|
||||||
|
value: DialValue,
|
||||||
|
#[ts(optional)]
|
||||||
|
source: Option<Source>,
|
||||||
|
/// what the value meant for this job, in one line
|
||||||
|
#[ts(optional)]
|
||||||
|
means: Option<String>,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, TS)]
|
||||||
|
#[serde(rename_all = "lowercase")]
|
||||||
|
#[ts(rename = "GoalRoute")]
|
||||||
|
pub enum Route {
|
||||||
|
/// defined by numbers: Manifold solids, raea/room
|
||||||
|
Solid,
|
||||||
|
/// defined by a rule: fields, growth, instances
|
||||||
|
Rule,
|
||||||
|
/// defined by its looks: generated (raea gen)
|
||||||
|
Gen,
|
||||||
|
/// an exact asset that already exists
|
||||||
|
Library,
|
||||||
|
/// far background: a picture on a plane
|
||||||
|
Picture,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, TS)]
|
||||||
|
#[serde(rename_all = "lowercase")]
|
||||||
|
#[ts(rename = "GoalOrigin")]
|
||||||
|
pub enum Origin {
|
||||||
|
/// seen in a reference
|
||||||
|
Reference,
|
||||||
|
/// added to complete the place or the set, in the same world
|
||||||
|
Invented,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, TS)]
|
||||||
|
#[serde(deny_unknown_fields)]
|
||||||
|
#[ts(optional_fields)]
|
||||||
|
#[ts(rename = "GoalPick")]
|
||||||
|
pub struct Pick {
|
||||||
|
/// "tripo-h31", "meshy", ...
|
||||||
|
pub generator: String,
|
||||||
|
/// one line: why this one ("sharper dial numerals; Tripo fused the handset to the cradle")
|
||||||
|
pub why: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// One thing that must hold. Exactly one of `run`, `file` or `says`.
|
|
||||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, TS)]
|
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, TS)]
|
||||||
#[serde(rename_all = "camelCase", deny_unknown_fields)]
|
#[serde(rename_all = "camelCase", deny_unknown_fields)]
|
||||||
#[ts(optional_fields)]
|
#[ts(optional_fields)]
|
||||||
#[ts(rename = "MakeGoalRule")]
|
#[ts(rename = "GoalObject")]
|
||||||
pub struct GoalRule {
|
pub struct Object {
|
||||||
/// a short name: [a-z0-9_], how status, the critic and NOTES.md name it
|
/// snake_case, unique in the job
|
||||||
pub id: String,
|
pub id: String,
|
||||||
/// a command that must exit 0, run in the brief's folder (`bun test`, `raea check edit.tsx`)
|
pub label: String,
|
||||||
pub run: Option<String>,
|
/// real height in metres
|
||||||
/// the seconds `run` gets before it counts as failed (300 when left out)
|
pub h: Option<f64>,
|
||||||
pub timeout: Option<u32>,
|
/// [width, depth, height] in metres, for boxy things (generators invent depth)
|
||||||
/// a file that must exist, relative to the brief (`a|b`: either; `dir/`: three or more pictures in it)
|
pub dims: Option<[f64; 3]>,
|
||||||
pub file: Option<String>,
|
/// largest extent in metres, for things that lie flat (tools, papers)
|
||||||
/// words that must be true of the work, judged by a fresh critic (`raea make judge`), never by the agent that did it
|
pub max: Option<f64>,
|
||||||
pub says: Option<String>,
|
pub route: Option<Route>,
|
||||||
|
/// one object, its condition and its materials; never a real brand
|
||||||
|
pub prompt: Option<String>,
|
||||||
|
pub source: Option<Origin>,
|
||||||
|
/// where it is in reference 0: [x0, y0, x1, y1] in 0..1
|
||||||
|
pub crop: Option<[f64; 4]>,
|
||||||
|
/// where it stands in a scene: metres, the floor's front-left corner at the origin, rot 0 = facing the entrance
|
||||||
|
pub at: Option<[f64; 3]>,
|
||||||
|
pub rot: Option<f64>,
|
||||||
|
pub hero: Option<bool>,
|
||||||
|
/// how large it is planned to be seen, which is how much of it gets built: 0 the hero (half the frame or more),
|
||||||
|
/// 1 featured (under 50%), 2 dressing (under 20%), 3 background (under 8%: a grey box reads), 4 far (under 2%: a
|
||||||
|
/// silhouette). A render that shows it finer than this says so (`lod-closer`; `raea scene lod` lists every part)
|
||||||
|
pub lod: Option<u8>,
|
||||||
|
pub pick: Option<Pick>,
|
||||||
|
/// what was fixed by script ("glass made transmissive, label kept opaque")
|
||||||
|
#[serde(default)]
|
||||||
|
#[ts(as = "Option<Vec<String>>", optional)]
|
||||||
|
pub fixes: Vec<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// What the goal's rules still lack, each with what to do. Empty when it's ready.
|
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, TS)]
|
||||||
pub fn doctor(g: &Goal) -> Vec<String> {
|
#[serde(rename_all = "camelCase", deny_unknown_fields)]
|
||||||
let mut out = Vec::new();
|
#[ts(optional_fields)]
|
||||||
if g.goal.trim().is_empty() {
|
#[ts(rename = "GoalShot")]
|
||||||
out.push("no `goal`: the goal in the person's own words".into());
|
pub struct Shot {
|
||||||
|
/// [a-z0-9_]: the file it lands as (out/shots/<name>.png or .mp4)
|
||||||
|
pub name: String,
|
||||||
|
/// in a crew's words: "slow push along the counter, rack focus to the register"
|
||||||
|
pub description: Option<String>,
|
||||||
|
/// static, dolly, truck, pedestal, crane, pan, tilt, orbit, dollyZoom, path
|
||||||
|
#[serde(rename = "move")]
|
||||||
|
#[ts(rename = "move")]
|
||||||
|
pub move_: Option<String>,
|
||||||
|
pub seconds: Option<f64>,
|
||||||
|
pub lens: Option<f64>,
|
||||||
|
/// none, subtle, walk
|
||||||
|
pub handheld: Option<String>,
|
||||||
|
/// a still rather than a move
|
||||||
|
pub still: Option<bool>,
|
||||||
|
/// the composition that renders it (relative to the brief): `raea make shots` draws its framing sheet and lens chart
|
||||||
|
pub composition: Option<String>,
|
||||||
|
/// its frame rate, for the frames `seconds` spans (30 when left out)
|
||||||
|
pub fps: Option<f64>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Kind {
|
||||||
|
/// as brief.ts writes it, and as raea judge's rubrics are named
|
||||||
|
pub fn name(self) -> &'static str {
|
||||||
|
// in the enum's order
|
||||||
|
["scene", "kit", "shot", "cut", "rules"][self as usize]
|
||||||
}
|
}
|
||||||
if g.rules.is_empty() {
|
}
|
||||||
out.push("no `rules`: what must hold before you stop, each a `run` command, a `file` or words a critic judges (`says`)".into());
|
|
||||||
|
/// Each kind's dials: what may be set, and what an unset one is read from the references as.
|
||||||
|
pub fn dials(kind: Kind) -> &'static [&'static str] {
|
||||||
|
match kind {
|
||||||
|
Kind::Scene => &["density", "tidiness", "wear", "wetness", "time_of_day", "weather", "atmosphere", "power", "warmth", "look"],
|
||||||
|
Kind::Kit => &["count", "variety", "detail", "wear", "wetness", "warmth", "look"],
|
||||||
|
Kind::Shot => &["res", "seconds", "lens", "handheld", "look"],
|
||||||
|
Kind::Cut => &["look"],
|
||||||
|
Kind::Rules => &[],
|
||||||
}
|
}
|
||||||
let mut seen = std::collections::BTreeSet::new();
|
}
|
||||||
for r in &g.rules {
|
|
||||||
if !crate::make::is_name(&r.id) {
|
/// The round cap when the plan names none: AnyKit's and raea judge's 8.
|
||||||
out.push(format!("rule `{}`: ids are [a-z0-9_]", r.id));
|
pub const ROUNDS: u32 = 8;
|
||||||
}
|
|
||||||
if !seen.insert(r.id.as_str()) {
|
/// What must exist when the goal is done, relative to the brief's folder: its own list, else its kind's; and each of
|
||||||
out.push(format!("rule `{}` is listed twice", r.id));
|
/// its `file` rules.
|
||||||
}
|
pub fn deliverables(m: &Goal) -> Vec<String> {
|
||||||
let n = [r.run.is_some(), r.file.is_some(), r.says.is_some()].iter().filter(|x| **x).count();
|
let mut out = if m.deliverables.is_empty() { by_kind(m) } else { m.deliverables.clone() };
|
||||||
if n != 1 {
|
for f in m.rules.iter().filter_map(|r| r.file.clone()) {
|
||||||
out.push(format!("rule `{}` needs exactly one of `run`, `file` or `says` (it has {n})", r.id));
|
if !out.contains(&f) {
|
||||||
}
|
out.push(f);
|
||||||
if r.timeout.is_some() && r.run.is_none() {
|
|
||||||
out.push(format!("rule `{}` has a `timeout` but no `run`", r.id));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
out
|
out
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn by_kind(m: &Goal) -> Vec<String> {
|
||||||
|
match m.kind {
|
||||||
|
// the stills are counted (three or more), not named: apps/make checks the folder
|
||||||
|
Kind::Scene => vec!["out/stills/".into()],
|
||||||
|
Kind::Kit => {
|
||||||
|
let mut v: Vec<String> = m
|
||||||
|
.objects
|
||||||
|
.iter()
|
||||||
|
.flat_map(|o| [format!("out/kit/{0}/{0}.glb", o.id), format!("out/kit/{0}/{0}_lod1.glb", o.id), format!("out/kit/thumbs/{}.png", o.id)])
|
||||||
|
.collect();
|
||||||
|
// the reference sheet every reference was checked on before any 3D (MK10)
|
||||||
|
v.extend(["out/kit/lineup.png".into(), "out/kit/kit.json".into(), "review/refs.png".into()]);
|
||||||
|
v
|
||||||
|
}
|
||||||
|
// a shot is a still or a move, so either file answers; apps/make reads `a|b`
|
||||||
|
Kind::Shot => m.shots.iter().map(|s| format!("out/shots/{0}.png|out/shots/{0}.mp4", s.name)).collect(),
|
||||||
|
Kind::Cut => m.cut.as_ref().map(crate::cut::deliverables).unwrap_or_default(),
|
||||||
|
// only its `file` rules, added above
|
||||||
|
Kind::Rules => vec![],
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// What the job shows but doesn't deliver: the plan's own list, else review/ and previews/.
|
||||||
|
pub fn previews(m: &Goal) -> Vec<String> {
|
||||||
|
if m.previews.is_empty() { vec!["review/".into(), "previews/".into()] } else { m.previews.clone() }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 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: &Goal) -> Vec<String> {
|
||||||
|
let mut out = Vec::new();
|
||||||
|
let allowed = dials(m.kind);
|
||||||
|
for name in m.dials.keys().filter(|k| !allowed.contains(&k.as_str())) {
|
||||||
|
out.push(format!("dial `{name}` isn't one of a {:?}'s ({}): drop it or say it in `style`", m.kind, allowed.join(", ")));
|
||||||
|
}
|
||||||
|
match m.kind {
|
||||||
|
Kind::Shot if m.shots.is_empty() => out.push("no shots: list each with a name and a description".into()),
|
||||||
|
Kind::Scene | Kind::Kit if m.objects.is_empty() => out.push("no objects: list every object with its real size and route".into()),
|
||||||
|
_ => {}
|
||||||
|
}
|
||||||
|
match (&m.cut, m.kind) {
|
||||||
|
(Some(c), Kind::Cut) => out.extend(crate::cut::doctor(c)),
|
||||||
|
(None, Kind::Cut) => out.push("no `cut`: the brief as rules (count, cuts, say, never, cta, open), each quoting it".into()),
|
||||||
|
(Some(_), k) => out.push(format!("`cut` is for a cut job, not a {k:?}: drop it, or make this `cut({{...}})`")),
|
||||||
|
_ => {}
|
||||||
|
}
|
||||||
|
out.extend(crate::rules::doctor(&m.rules));
|
||||||
|
if m.kind == Kind::Rules {
|
||||||
|
if m.aim.as_deref().is_none_or(|a| a.trim().is_empty()) {
|
||||||
|
out.push("no `aim`: the goal in the person's own words".into());
|
||||||
|
}
|
||||||
|
if m.rules.is_empty() {
|
||||||
|
out.push("no `rules`: what must hold before you stop, each a `run` command, a `file` or words a critic judges (`says`)".into());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if let Some(n) = m.name.as_deref().filter(|n| !is_name(n)) {
|
||||||
|
out.push(format!("name `{n}`: names are [a-z0-9_]"));
|
||||||
|
}
|
||||||
|
if m.kind == Kind::Kit && m.style.is_none() {
|
||||||
|
out.push("no `style`: one paragraph (era, palette, materials, wear, one fictional maker) every reference carries".into());
|
||||||
|
}
|
||||||
|
let mut seen = std::collections::BTreeSet::new();
|
||||||
|
for o in &m.objects {
|
||||||
|
if !seen.insert(o.id.as_str()) {
|
||||||
|
out.push(format!("object `{}` is listed twice", o.id));
|
||||||
|
}
|
||||||
|
if o.h.is_none() && o.dims.is_none() && o.max.is_none() {
|
||||||
|
out.push(format!("object `{}` has no size: give `h` (metres), `dims` for boxy things or `max` for flat ones", o.id));
|
||||||
|
}
|
||||||
|
if o.lod.is_some_and(|l| l > 4) {
|
||||||
|
out.push(format!("object `{}` has lod {}: 0 (the hero, half the frame or more) to 4 (far, under 2% of it)", o.id, o.lod.unwrap_or(0)));
|
||||||
|
}
|
||||||
|
if o.route.is_none() && m.kind == Kind::Scene {
|
||||||
|
out.push(format!("object `{}` has no route: solid, rule, gen, library or picture", o.id));
|
||||||
|
}
|
||||||
|
if matches!(o.route, Some(Route::Gen)) || m.kind == Kind::Kit {
|
||||||
|
if o.prompt.is_none() {
|
||||||
|
out.push(format!("object `{}` is generated but has no prompt: one object, its condition and materials", o.id));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let mut names = std::collections::BTreeSet::new();
|
||||||
|
for s in &m.shots {
|
||||||
|
if !names.insert(s.name.as_str()) {
|
||||||
|
out.push(format!("shot `{}` is listed twice", s.name));
|
||||||
|
}
|
||||||
|
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() {
|
||||||
|
out.push(format!("shot `{}` has no composition: the .tsx that renders it, for its framing sheet and lens chart", s.name));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
out
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// A brief's `goal`: one goal, or several in order (a workflow inline). `after` orders them past the list's order.
|
||||||
|
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, TS)]
|
||||||
|
#[serde(untagged)]
|
||||||
|
pub enum Goals {
|
||||||
|
One(Box<Goal>),
|
||||||
|
Many(Vec<Goal>),
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Goals {
|
||||||
|
/// every goal, in the order written
|
||||||
|
pub fn all(&self) -> Vec<&Goal> {
|
||||||
|
match self {
|
||||||
|
Goals::One(g) => vec![g.as_ref()],
|
||||||
|
Goals::Many(v) => v.iter().collect(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// A goal's name: its own, else its kind's.
|
||||||
|
pub fn name_of(g: &Goal) -> String {
|
||||||
|
g.name.clone().unwrap_or_else(|| g.kind.name().to_string())
|
||||||
|
}
|
||||||
|
|
||||||
|
/// What the goals still lack together: names given twice, an `after` naming no goal.
|
||||||
|
pub fn doctor_all(gs: &Goals) -> Vec<String> {
|
||||||
|
let all = gs.all();
|
||||||
|
let mut out = Vec::new();
|
||||||
|
let names: Vec<String> = all.iter().map(|g| name_of(g)).collect();
|
||||||
|
let mut seen = std::collections::BTreeSet::new();
|
||||||
|
for n in &names {
|
||||||
|
if !seen.insert(n.as_str()) && all.len() > 1 {
|
||||||
|
out.push(format!("two goals are named `{n}`: give each its own `name`"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for g in &all {
|
||||||
|
for a in g.after.iter().filter(|a| !names.contains(a)) {
|
||||||
|
out.push(format!("goal `{}` comes after `{a}`, which no goal is named", name_of(g)));
|
||||||
|
}
|
||||||
|
let n = name_of(g);
|
||||||
|
out.extend(doctor(g).into_iter().map(|d| if all.len() > 1 { format!("{n}: {d}") } else { d }));
|
||||||
|
}
|
||||||
|
out
|
||||||
|
}
|
||||||
@@ -6,13 +6,13 @@
|
|||||||
pub mod brief;
|
pub mod brief;
|
||||||
pub mod cut;
|
pub mod cut;
|
||||||
pub mod goal;
|
pub mod goal;
|
||||||
pub mod make;
|
|
||||||
pub mod parts;
|
pub mod parts;
|
||||||
|
pub mod rules;
|
||||||
pub mod script;
|
pub mod script;
|
||||||
pub mod taste;
|
pub mod taste;
|
||||||
|
|
||||||
pub use brief::Brief;
|
pub use brief::Brief;
|
||||||
pub use make::Make;
|
pub use goal::{Goal, Goals};
|
||||||
pub use parts::Parts;
|
pub use parts::Parts;
|
||||||
pub use script::Script;
|
pub use script::Script;
|
||||||
pub use taste::Taste;
|
pub use taste::Taste;
|
||||||
@@ -40,9 +40,9 @@ pub fn declarations() -> String {
|
|||||||
script::Script, script::Scene, script::Beat, script::Line,
|
script::Script, script::Scene, script::Beat, script::Line,
|
||||||
taste::Taste, taste::TasteSection, taste::Rule, taste::RuleCheck, taste::RuleLevel, taste::Check,
|
taste::Taste, taste::TasteSection, taste::Rule, taste::RuleCheck, taste::RuleLevel, taste::Check,
|
||||||
parts::Parts, parts::Concept, parts::Level, parts::Count, parts::Part,
|
parts::Parts, parts::Concept, parts::Level, parts::Count, parts::Part,
|
||||||
make::Make, make::Kind, make::Source, make::DialValue, make::Dial, make::Route, make::Origin, make::Pick, make::Object, make::Shot,
|
goal::Goal, goal::Kind, goal::Source, goal::DialValue, goal::Dial, goal::Route, goal::Origin, goal::Pick, goal::Object, goal::Shot, goal::Goals,
|
||||||
cut::Cut, cut::Quoted<u32>, cut::CutPlan, cut::Phrase, cut::Cta, cut::Open,
|
cut::Cut, cut::Quoted<u32>, cut::CutPlan, cut::Phrase, cut::Cta, cut::Open,
|
||||||
goal::Goal, goal::GoalRule,
|
rules::Rule,
|
||||||
));
|
));
|
||||||
out.join("\n\n") + "\n"
|
out.join("\n\n") + "\n"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,330 +0,0 @@
|
|||||||
//! A job made to a frozen plan (docs/make.feature MK0): `make` on a project's brief.ts, written with `scene()`, `kit()`
|
|
||||||
//! or `shot()` from "raea/brief" before anything is built, and read here. One loop, three kinds: a scene (a dressed,
|
|
||||||
//! lit place), a kit (props that belong together) and a shot (stills or camera moves of a built scene). Every object
|
|
||||||
//! carries its real size and whether it came from the reference or was invented; every dial its value, where the value
|
|
||||||
//! came from, and what it meant here. `raea make status` (apps/make) holds the job to it.
|
|
||||||
|
|
||||||
use std::collections::BTreeMap;
|
|
||||||
|
|
||||||
use serde::{Deserialize, Serialize};
|
|
||||||
use ts_rs::TS;
|
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, TS)]
|
|
||||||
#[serde(rename_all = "lowercase")]
|
|
||||||
#[ts(rename = "MakeKind")]
|
|
||||||
pub enum Kind {
|
|
||||||
/// a dressed, lit place from references or a brief
|
|
||||||
Scene,
|
|
||||||
/// a set of props in one style, at real size, to drop into any scene
|
|
||||||
Kit,
|
|
||||||
/// stills or camera moves of a built scene, from words
|
|
||||||
Shot,
|
|
||||||
/// ads cut from footage to a client's brief: its deliverables, phrases, claims and CTA as rules (cut.rs, MK25)
|
|
||||||
Cut,
|
|
||||||
/// any other work held to a goal: commands that must pass, files that must exist, words a critic judges (goal.rs)
|
|
||||||
Goal,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, TS)]
|
|
||||||
#[serde(rename_all = "camelCase", deny_unknown_fields)]
|
|
||||||
#[ts(optional_fields)]
|
|
||||||
pub struct Make {
|
|
||||||
pub kind: Kind,
|
|
||||||
/// the pictures the job answers to (paths beside the brief): what is in it and where for a scene, the style for a kit
|
|
||||||
#[serde(default)]
|
|
||||||
#[ts(as = "Option<Vec<String>>", optional)]
|
|
||||||
pub references: Vec<String>,
|
|
||||||
/// one paragraph every reference prompt carries: era, palette, materials, wear, and one fictional maker
|
|
||||||
pub style: Option<String>,
|
|
||||||
/// by name, from the kind's set (DIALS); one left out is read from the references
|
|
||||||
#[serde(default)]
|
|
||||||
#[ts(as = "Option<BTreeMap<String, Dial>>", optional)]
|
|
||||||
pub dials: BTreeMap<String, Dial>,
|
|
||||||
#[serde(default)]
|
|
||||||
#[ts(as = "Option<Vec<Object>>", optional)]
|
|
||||||
pub objects: Vec<Object>,
|
|
||||||
#[serde(default)]
|
|
||||||
#[ts(as = "Option<Vec<Shot>>", optional)]
|
|
||||||
pub shots: Vec<Shot>,
|
|
||||||
/// the compositions the job's checks hold (relative to the brief): each needs a clean render or check newer than it
|
|
||||||
#[serde(default)]
|
|
||||||
#[ts(as = "Option<Vec<String>>", optional)]
|
|
||||||
pub compositions: Vec<String>,
|
|
||||||
/// what must exist when it's done, relative to the brief; replaces the kind's own list (`deliverables`)
|
|
||||||
#[serde(default)]
|
|
||||||
#[ts(as = "Option<Vec<String>>", optional)]
|
|
||||||
pub deliverables: Vec<String>,
|
|
||||||
/// the most critic rounds the job gets; at the cap it is delivered with what's still missing (8 by default)
|
|
||||||
pub rounds: Option<u32>,
|
|
||||||
/// a cut job's contract: the brief as rules (cut.rs)
|
|
||||||
pub cut: Option<crate::cut::Cut>,
|
|
||||||
/// a goal job's contract: the goal and its rules (goal.rs)
|
|
||||||
pub goal: Option<crate::goal::Goal>,
|
|
||||||
/// what the job shows but never delivers, relative to the brief (pictures, render tests, examples): each a file or a
|
|
||||||
/// `dir/` (review/ and previews/ when left out). Deliverables are what it hands over; previews are how it got there
|
|
||||||
#[serde(default)]
|
|
||||||
#[ts(as = "Option<Vec<String>>", optional)]
|
|
||||||
pub previews: Vec<String>,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, TS)]
|
|
||||||
#[serde(rename_all = "lowercase")]
|
|
||||||
#[ts(rename = "MakeSource")]
|
|
||||||
pub enum Source {
|
|
||||||
/// set by the person who asked: an instruction, even when the reference says otherwise
|
|
||||||
Customer,
|
|
||||||
/// read from the references, because nobody set it
|
|
||||||
Reference,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, TS)]
|
|
||||||
#[serde(untagged)]
|
|
||||||
#[ts(rename = "MakeDialValue")]
|
|
||||||
pub enum DialValue {
|
|
||||||
Number(f64),
|
|
||||||
Text(String),
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, TS)]
|
|
||||||
#[serde(untagged)]
|
|
||||||
#[ts(rename = "MakeDial")]
|
|
||||||
pub enum Dial {
|
|
||||||
/// `wear: 0.4`: the value alone, set by the person
|
|
||||||
Bare(DialValue),
|
|
||||||
/// `wear: { value: 0.4, source: "reference", means: "scuffed bakelite, worn paint on the edges" }`
|
|
||||||
Full {
|
|
||||||
value: DialValue,
|
|
||||||
#[ts(optional)]
|
|
||||||
source: Option<Source>,
|
|
||||||
/// what the value meant for this job, in one line
|
|
||||||
#[ts(optional)]
|
|
||||||
means: Option<String>,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, TS)]
|
|
||||||
#[serde(rename_all = "lowercase")]
|
|
||||||
#[ts(rename = "MakeRoute")]
|
|
||||||
pub enum Route {
|
|
||||||
/// defined by numbers: Manifold solids, raea/room
|
|
||||||
Solid,
|
|
||||||
/// defined by a rule: fields, growth, instances
|
|
||||||
Rule,
|
|
||||||
/// defined by its looks: generated (raea gen)
|
|
||||||
Gen,
|
|
||||||
/// an exact asset that already exists
|
|
||||||
Library,
|
|
||||||
/// far background: a picture on a plane
|
|
||||||
Picture,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, TS)]
|
|
||||||
#[serde(rename_all = "lowercase")]
|
|
||||||
#[ts(rename = "MakeOrigin")]
|
|
||||||
pub enum Origin {
|
|
||||||
/// seen in a reference
|
|
||||||
Reference,
|
|
||||||
/// added to complete the place or the set, in the same world
|
|
||||||
Invented,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, TS)]
|
|
||||||
#[serde(deny_unknown_fields)]
|
|
||||||
#[ts(optional_fields)]
|
|
||||||
#[ts(rename = "MakePick")]
|
|
||||||
pub struct Pick {
|
|
||||||
/// "tripo-h31", "meshy", ...
|
|
||||||
pub generator: String,
|
|
||||||
/// one line: why this one ("sharper dial numerals; Tripo fused the handset to the cradle")
|
|
||||||
pub why: String,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, TS)]
|
|
||||||
#[serde(rename_all = "camelCase", deny_unknown_fields)]
|
|
||||||
#[ts(optional_fields)]
|
|
||||||
#[ts(rename = "MakeObject")]
|
|
||||||
pub struct Object {
|
|
||||||
/// snake_case, unique in the job
|
|
||||||
pub id: String,
|
|
||||||
pub label: String,
|
|
||||||
/// real height in metres
|
|
||||||
pub h: Option<f64>,
|
|
||||||
/// [width, depth, height] in metres, for boxy things (generators invent depth)
|
|
||||||
pub dims: Option<[f64; 3]>,
|
|
||||||
/// largest extent in metres, for things that lie flat (tools, papers)
|
|
||||||
pub max: Option<f64>,
|
|
||||||
pub route: Option<Route>,
|
|
||||||
/// one object, its condition and its materials; never a real brand
|
|
||||||
pub prompt: Option<String>,
|
|
||||||
pub source: Option<Origin>,
|
|
||||||
/// where it is in reference 0: [x0, y0, x1, y1] in 0..1
|
|
||||||
pub crop: Option<[f64; 4]>,
|
|
||||||
/// where it stands in a scene: metres, the floor's front-left corner at the origin, rot 0 = facing the entrance
|
|
||||||
pub at: Option<[f64; 3]>,
|
|
||||||
pub rot: Option<f64>,
|
|
||||||
pub hero: Option<bool>,
|
|
||||||
/// how large it is planned to be seen, which is how much of it gets built: 0 the hero (half the frame or more),
|
|
||||||
/// 1 featured (under 50%), 2 dressing (under 20%), 3 background (under 8%: a grey box reads), 4 far (under 2%: a
|
|
||||||
/// silhouette). A render that shows it finer than this says so (`lod-closer`; `raea scene lod` lists every part)
|
|
||||||
pub lod: Option<u8>,
|
|
||||||
pub pick: Option<Pick>,
|
|
||||||
/// what was fixed by script ("glass made transmissive, label kept opaque")
|
|
||||||
#[serde(default)]
|
|
||||||
#[ts(as = "Option<Vec<String>>", optional)]
|
|
||||||
pub fixes: Vec<String>,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, TS)]
|
|
||||||
#[serde(rename_all = "camelCase", deny_unknown_fields)]
|
|
||||||
#[ts(optional_fields)]
|
|
||||||
#[ts(rename = "MakeShot")]
|
|
||||||
pub struct Shot {
|
|
||||||
/// [a-z0-9_]: the file it lands as (out/shots/<name>.png or .mp4)
|
|
||||||
pub name: String,
|
|
||||||
/// in a crew's words: "slow push along the counter, rack focus to the register"
|
|
||||||
pub description: Option<String>,
|
|
||||||
/// static, dolly, truck, pedestal, crane, pan, tilt, orbit, dollyZoom, path
|
|
||||||
#[serde(rename = "move")]
|
|
||||||
#[ts(rename = "move")]
|
|
||||||
pub move_: Option<String>,
|
|
||||||
pub seconds: Option<f64>,
|
|
||||||
pub lens: Option<f64>,
|
|
||||||
/// none, subtle, walk
|
|
||||||
pub handheld: Option<String>,
|
|
||||||
/// a still rather than a move
|
|
||||||
pub still: Option<bool>,
|
|
||||||
/// the composition that renders it (relative to the brief): `raea make framing` and `lenschart` draw it
|
|
||||||
pub composition: Option<String>,
|
|
||||||
/// its frame rate, for the frames `seconds` spans (30 when left out)
|
|
||||||
pub fps: Option<f64>,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Kind {
|
|
||||||
/// as brief.ts writes it, and as raea judge's rubrics are named
|
|
||||||
pub fn name(self) -> &'static str {
|
|
||||||
// in the enum's order
|
|
||||||
["scene", "kit", "shot", "cut", "goal"][self as usize]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Each kind's dials: what may be set, and what an unset one is read from the references as.
|
|
||||||
pub fn dials(kind: Kind) -> &'static [&'static str] {
|
|
||||||
match kind {
|
|
||||||
Kind::Scene => &["density", "tidiness", "wear", "wetness", "time_of_day", "weather", "atmosphere", "power", "warmth", "look"],
|
|
||||||
Kind::Kit => &["count", "variety", "detail", "wear", "wetness", "warmth", "look"],
|
|
||||||
Kind::Shot => &["res", "seconds", "lens", "handheld", "look"],
|
|
||||||
Kind::Cut => &["look"],
|
|
||||||
Kind::Goal => &[],
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// The round cap when the plan names none: AnyKit's and raea judge's 8.
|
|
||||||
pub const ROUNDS: u32 = 8;
|
|
||||||
|
|
||||||
/// What must exist when the job is done, relative to the brief's folder: the plan's own list, else the kind's.
|
|
||||||
pub fn deliverables(m: &Make) -> Vec<String> {
|
|
||||||
if !m.deliverables.is_empty() {
|
|
||||||
return m.deliverables.clone();
|
|
||||||
}
|
|
||||||
match m.kind {
|
|
||||||
// the stills are counted (three or more), not named: apps/make checks the folder
|
|
||||||
Kind::Scene => vec!["out/stills/".into()],
|
|
||||||
Kind::Kit => {
|
|
||||||
let mut v: Vec<String> = m
|
|
||||||
.objects
|
|
||||||
.iter()
|
|
||||||
.flat_map(|o| [format!("out/kit/{0}/{0}.glb", o.id), format!("out/kit/{0}/{0}_lod1.glb", o.id), format!("out/kit/thumbs/{}.png", o.id)])
|
|
||||||
.collect();
|
|
||||||
// the reference sheet every reference was checked on before any 3D (MK10)
|
|
||||||
v.extend(["out/kit/lineup.png".into(), "out/kit/kit.json".into(), "review/refs.png".into()]);
|
|
||||||
v
|
|
||||||
}
|
|
||||||
// a shot is a still or a move, so either file answers; apps/make reads `a|b`
|
|
||||||
Kind::Shot => m.shots.iter().map(|s| format!("out/shots/{0}.png|out/shots/{0}.mp4", s.name)).collect(),
|
|
||||||
Kind::Cut => m.cut.as_ref().map(crate::cut::deliverables).unwrap_or_default(),
|
|
||||||
// a goal's `file` rules
|
|
||||||
Kind::Goal => m.goal.iter().flat_map(|g| &g.rules).filter_map(|r| r.file.clone()).collect(),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// What the job shows but doesn't deliver: the plan's own list, else review/ and previews/.
|
|
||||||
pub fn previews(m: &Make) -> Vec<String> {
|
|
||||||
if m.previews.is_empty() { vec!["review/".into(), "previews/".into()] } else { m.previews.clone() }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// 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();
|
|
||||||
let allowed = dials(m.kind);
|
|
||||||
for name in m.dials.keys().filter(|k| !allowed.contains(&k.as_str())) {
|
|
||||||
out.push(format!("dial `{name}` isn't one of a {:?}'s ({}): drop it or say it in `style`", m.kind, allowed.join(", ")));
|
|
||||||
}
|
|
||||||
match m.kind {
|
|
||||||
Kind::Shot if m.shots.is_empty() => out.push("no shots: list each with a name and a description".into()),
|
|
||||||
Kind::Scene | Kind::Kit if m.objects.is_empty() => out.push("no objects: list every object with its real size and route".into()),
|
|
||||||
_ => {}
|
|
||||||
}
|
|
||||||
match (&m.cut, m.kind) {
|
|
||||||
(Some(c), Kind::Cut) => out.extend(crate::cut::doctor(c)),
|
|
||||||
(None, Kind::Cut) => out.push("no `cut`: the brief as rules (count, cuts, say, never, cta, open), each quoting it".into()),
|
|
||||||
(Some(_), k) => out.push(format!("`cut` is for a cut job, not a {k:?}: drop it, or make this `cut({{...}})`")),
|
|
||||||
_ => {}
|
|
||||||
}
|
|
||||||
match (&m.goal, m.kind) {
|
|
||||||
(Some(g), Kind::Goal) => out.extend(crate::goal::doctor(g)),
|
|
||||||
(None, Kind::Goal) => out.push("no `goal`: the goal in the person's words and its `rules`".into()),
|
|
||||||
(Some(_), k) => out.push(format!("`goal` is for a goal job, not a {k:?}: drop it, or make this `goal({{...}})`")),
|
|
||||||
_ => {}
|
|
||||||
}
|
|
||||||
if m.kind == Kind::Kit && m.style.is_none() {
|
|
||||||
out.push("no `style`: one paragraph (era, palette, materials, wear, one fictional maker) every reference carries".into());
|
|
||||||
}
|
|
||||||
let mut seen = std::collections::BTreeSet::new();
|
|
||||||
for o in &m.objects {
|
|
||||||
if !seen.insert(o.id.as_str()) {
|
|
||||||
out.push(format!("object `{}` is listed twice", o.id));
|
|
||||||
}
|
|
||||||
if o.h.is_none() && o.dims.is_none() && o.max.is_none() {
|
|
||||||
out.push(format!("object `{}` has no size: give `h` (metres), `dims` for boxy things or `max` for flat ones", o.id));
|
|
||||||
}
|
|
||||||
if o.lod.is_some_and(|l| l > 4) {
|
|
||||||
out.push(format!("object `{}` has lod {}: 0 (the hero, half the frame or more) to 4 (far, under 2% of it)", o.id, o.lod.unwrap_or(0)));
|
|
||||||
}
|
|
||||||
if o.route.is_none() && m.kind == Kind::Scene {
|
|
||||||
out.push(format!("object `{}` has no route: solid, rule, gen, library or picture", o.id));
|
|
||||||
}
|
|
||||||
if matches!(o.route, Some(Route::Gen)) || m.kind == Kind::Kit {
|
|
||||||
if o.prompt.is_none() {
|
|
||||||
out.push(format!("object `{}` is generated but has no prompt: one object, its condition and materials", o.id));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
let mut names = std::collections::BTreeSet::new();
|
|
||||||
for s in &m.shots {
|
|
||||||
if !names.insert(s.name.as_str()) {
|
|
||||||
out.push(format!("shot `{}` is listed twice", s.name));
|
|
||||||
}
|
|
||||||
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() {
|
|
||||||
out.push(format!("shot `{}` has no composition: the .tsx that renders it, for its framing sheet and lens chart", s.name));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
out
|
|
||||||
}
|
|
||||||
|
|
||||||
/// One gate as `raea make status` lists it: its name, the file, item or rule it's about, whether it's clear, and what
|
|
||||||
/// it says. A cut's gates come from raea-runtime-cut-plan, a goal's from raea-runtime-goal-plan.
|
|
||||||
#[derive(Debug, Clone, PartialEq)]
|
|
||||||
pub struct Gate {
|
|
||||||
pub name: &'static str,
|
|
||||||
pub of: Option<String>,
|
|
||||||
pub clear: bool,
|
|
||||||
pub says: String,
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
//! An object's parts (NAME.parts.ts, `parts()` from "raea/brief"), written before any geometry and frozen when
|
//! An object's parts (NAME.parts.ts, `parts()` from "raea/brief"), written before any geometry and frozen when
|
||||||
//! building starts (docs/handoff/solids.md, "The plan is the contract"; named parts since 11-20, so "plan" is only a
|
//! building starts (docs/handoff/solids.md, "The plan is the contract"; named parts since 11-20, so "plan" is only a
|
||||||
//! project's plan.org, docs/plan.feature PL8a). Generic over what's made: a crown, a feather and a rocking horse are all a concept and a tree of
|
//! project's plan.ts, docs/plan.feature PL8a). Generic over what's made: a crown, a feather and a rocking horse are all a concept and a tree of
|
||||||
//! named parts, each with a level, a count, and a material and style it has or inherits.
|
//! named parts, each with a level, a count, and a material and style it has or inherits.
|
||||||
|
|
||||||
use std::collections::BTreeMap;
|
use std::collections::BTreeMap;
|
||||||
|
|||||||
@@ -0,0 +1,49 @@
|
|||||||
|
//! A goal's rules (docs/goal.feature): what must hold before the agent may stop, on any goal of brief.ts (11-26, Shane:
|
||||||
|
//! "we essentially just need to make sure that it can't stop unless all the goals pass, or all the rules in the
|
||||||
|
//! brief"). `/goal` in raea.app and an agent's own goal are this: the goal's `aim` in the person's words, then each
|
||||||
|
//! thing that must hold, as a command that must pass, a file that must exist, or words a fresh critic must find true.
|
||||||
|
//! raea/goal's rule packs (sdk/goal/src/packs/goal.ts) decide from them whether the agent may stop; the agent saying so
|
||||||
|
//! never does.
|
||||||
|
|
||||||
|
use serde::{Deserialize, Serialize};
|
||||||
|
use ts_rs::TS;
|
||||||
|
|
||||||
|
/// One thing that must hold. Exactly one of `run`, `file` or `says`.
|
||||||
|
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, TS)]
|
||||||
|
#[serde(rename_all = "camelCase", deny_unknown_fields)]
|
||||||
|
#[ts(optional_fields)]
|
||||||
|
#[ts(rename = "GoalRule")]
|
||||||
|
pub struct Rule {
|
||||||
|
/// a short name: [a-z0-9_], how status, the critic and NOTES.md name it
|
||||||
|
pub id: String,
|
||||||
|
/// a command that must exit 0, run in the brief's folder (`bun test`, `raea check edit.tsx`)
|
||||||
|
pub run: Option<String>,
|
||||||
|
/// the seconds `run` gets before it counts as failed (300 when left out)
|
||||||
|
pub timeout: Option<u32>,
|
||||||
|
/// a file that must exist, relative to the brief (`a|b`: either; `dir/`: three or more pictures in it)
|
||||||
|
pub file: Option<String>,
|
||||||
|
/// words that must be true of the work, judged by a fresh critic (`raea goal judge`), never by the agent that did it
|
||||||
|
pub says: Option<String>,
|
||||||
|
}
|
||||||
|
|
||||||
|
/// What a goal's rules still lack, each with what to do. Empty when they're ready.
|
||||||
|
pub fn doctor(rules: &[Rule]) -> Vec<String> {
|
||||||
|
let mut out = Vec::new();
|
||||||
|
let mut seen = std::collections::BTreeSet::new();
|
||||||
|
for r in rules {
|
||||||
|
if !crate::goal::is_name(&r.id) {
|
||||||
|
out.push(format!("rule `{}`: ids are [a-z0-9_]", r.id));
|
||||||
|
}
|
||||||
|
if !seen.insert(r.id.as_str()) {
|
||||||
|
out.push(format!("rule `{}` is listed twice", r.id));
|
||||||
|
}
|
||||||
|
let n = [r.run.is_some(), r.file.is_some(), r.says.is_some()].iter().filter(|x| **x).count();
|
||||||
|
if n != 1 {
|
||||||
|
out.push(format!("rule `{}` needs exactly one of `run`, `file` or `says` (it has {n})", r.id));
|
||||||
|
}
|
||||||
|
if r.timeout.is_some() && r.run.is_none() {
|
||||||
|
out.push(format!("rule `{}` has a `timeout` but no `run`", r.id));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
out
|
||||||
|
}
|
||||||
+31
-12
@@ -99,38 +99,57 @@ fn an_older_brief_with_stages_still_reads_and_never_writes_them() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn a_make_plan_reads_and_its_doctor_names_what_it_lacks() {
|
fn a_goal_reads_and_its_doctor_names_what_it_lacks() {
|
||||||
let b: Brief = read("brief.ts", r#"{"title": "Flight desk kit", "make": {"kind": "kit",
|
let b: Brief = read("brief.ts", r#"{"title": "Flight desk kit", "goal": {"kind": "kit",
|
||||||
"dials": {"count": 2, "wear": {"value": 0.4, "source": "customer", "means": "scuffed bakelite"}, "time_of_day": "night"},
|
"dials": {"count": 2, "wear": {"value": 0.4, "source": "customer", "means": "scuffed bakelite"}, "time_of_day": "night"},
|
||||||
"objects": [{"id": "phone", "label": "Rotary phone", "h": 0.12, "prompt": "a rotary desk phone", "source": "invented"},
|
"objects": [{"id": "phone", "label": "Rotary phone", "h": 0.12, "prompt": "a rotary desk phone", "source": "invented"},
|
||||||
{"id": "ashtray", "label": "Glass ashtray"}]}}"#).unwrap();
|
{"id": "ashtray", "label": "Glass ashtray"}]}}"#).unwrap();
|
||||||
let m = b.make.as_ref().unwrap();
|
let gs = b.goal.as_ref().unwrap();
|
||||||
assert_eq!(m.kind, make::Kind::Kit);
|
let m = gs.all()[0];
|
||||||
let d = make::doctor(m);
|
assert_eq!(m.kind, goal::Kind::Kit);
|
||||||
|
let d = goal::doctor(m);
|
||||||
assert!(d.iter().any(|x| x.contains("`time_of_day`")), "a scene's dial on a kit: {d:?}");
|
assert!(d.iter().any(|x| x.contains("`time_of_day`")), "a scene's dial on a kit: {d:?}");
|
||||||
assert!(d.iter().any(|x| x.contains("no `style`")), "{d:?}");
|
assert!(d.iter().any(|x| x.contains("no `style`")), "{d:?}");
|
||||||
assert!(d.iter().any(|x| x.contains("`ashtray` has no size")), "{d:?}");
|
assert!(d.iter().any(|x| x.contains("`ashtray` has no size")), "{d:?}");
|
||||||
assert!(d.iter().any(|x| x.contains("`ashtray` is generated but has no prompt")), "{d:?}");
|
assert!(d.iter().any(|x| x.contains("`ashtray` is generated but has no prompt")), "{d:?}");
|
||||||
assert!(!d.iter().any(|x| x.contains("`phone`")), "{d:?}");
|
assert!(!d.iter().any(|x| x.contains("`phone`")), "{d:?}");
|
||||||
assert!(brief::doctor(&b).iter().any(|x| x.starts_with("make: ")));
|
assert!(brief::doctor(&b).iter().any(|x| x.starts_with("goal: ")));
|
||||||
let want = make::deliverables(m);
|
let want = goal::deliverables(m);
|
||||||
assert!(want.contains(&"out/kit/phone/phone_lod1.glb".to_string()) && want.contains(&"out/kit/kit.json".to_string()), "{want:?}");
|
assert!(want.contains(&"out/kit/phone/phone_lod1.glb".to_string()) && want.contains(&"out/kit/kit.json".to_string()), "{want:?}");
|
||||||
}
|
}
|
||||||
|
|
||||||
// MK22: an object's planned detail, 0 (the hero) to 4 (far)
|
// MK22: an object's planned detail, 0 (the hero) to 4 (far)
|
||||||
#[test]
|
#[test]
|
||||||
fn an_object_plans_its_detail_and_the_doctor_holds_it_to_five_levels() {
|
fn an_object_plans_its_detail_and_the_doctor_holds_it_to_five_levels() {
|
||||||
let m: make::Make = read("make", r#"{"kind": "scene", "objects": [
|
let m: goal::Goal = read("goal", r#"{"kind": "scene", "objects": [
|
||||||
{"id": "kiosk", "label": "Kiosk", "h": 2.4, "route": "solid", "lod": 3},
|
{"id": "kiosk", "label": "Kiosk", "h": 2.4, "route": "solid", "lod": 3},
|
||||||
{"id": "tower", "label": "Tower", "h": 40, "route": "picture", "lod": 7}]}"#).unwrap();
|
{"id": "tower", "label": "Tower", "h": 40, "route": "picture", "lod": 7}]}"#).unwrap();
|
||||||
assert_eq!(m.objects[0].lod, Some(3));
|
assert_eq!(m.objects[0].lod, Some(3));
|
||||||
let d = make::doctor(&m);
|
let d = goal::doctor(&m);
|
||||||
assert!(d.iter().any(|x| x.contains("`tower` has lod 7")) && !d.iter().any(|x| x.contains("`kiosk`")), "{d:?}");
|
assert!(d.iter().any(|x| x.contains("`tower` has lod 7")) && !d.iter().any(|x| x.contains("`kiosk`")), "{d:?}");
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn a_shot_plan_wants_a_still_or_a_move_per_shot() {
|
fn a_shot_plan_wants_a_still_or_a_move_per_shot() {
|
||||||
let m: make::Make = read("make", r#"{"kind": "shot", "shots": [{"name": "counter_push", "move": "push_in"}, {"name": "Bad Name"}]}"#).unwrap();
|
let m: goal::Goal = read("goal", r#"{"kind": "shot", "shots": [{"name": "counter_push", "move": "push_in"}, {"name": "Bad Name"}]}"#).unwrap();
|
||||||
assert_eq!(make::deliverables(&m)[0], "out/shots/counter_push.png|out/shots/counter_push.mp4");
|
assert_eq!(goal::deliverables(&m)[0], "out/shots/counter_push.png|out/shots/counter_push.mp4");
|
||||||
assert!(make::doctor(&m).iter().any(|x| x.contains("`Bad Name`")));
|
assert!(goal::doctor(&m).iter().any(|x| x.contains("`Bad Name`")));
|
||||||
|
}
|
||||||
|
|
||||||
|
// goal.feature GL2: several goals in order are a workflow inline; names, `after` and rules on any kind are held
|
||||||
|
#[test]
|
||||||
|
fn several_goals_are_a_workflow_and_each_is_held_to_its_rules() {
|
||||||
|
let b: Brief = read("brief.ts", r#"{"title": "Spring", "goal": [
|
||||||
|
{"kind": "cut", "name": "cut", "step": "edit", "rules": [{"id": "tests", "run": "bun test"}]},
|
||||||
|
{"kind": "rules", "name": "deliver", "after": ["cut", "grade"], "rules": [{"id": "Bad", "file": "out/a.mp4", "says": "x"}]}]}"#).unwrap();
|
||||||
|
let gs = b.goal.as_ref().unwrap();
|
||||||
|
assert_eq!(gs.all().len(), 2);
|
||||||
|
assert_eq!(gs.all()[0].rules[0].run.as_deref(), Some("bun test"));
|
||||||
|
let d = goal::doctor_all(gs);
|
||||||
|
assert!(d.iter().any(|x| x.contains("after `grade`, which no goal is named")), "{d:?}");
|
||||||
|
assert!(d.iter().any(|x| x.starts_with("deliver: no `aim`")), "{d:?}");
|
||||||
|
assert!(d.iter().any(|x| x.starts_with("deliver: rule `Bad`: ids are")), "{d:?}");
|
||||||
|
assert!(d.iter().any(|x| x.contains("needs exactly one of")), "{d:?}");
|
||||||
|
let one: Brief = read("brief.ts", r#"{"title": "x", "goal": {"kind": "rules", "aim": "ship it", "rules": [{"id": "ok", "run": "true"}]}}"#).unwrap();
|
||||||
|
assert!(goal::doctor_all(one.goal.as_ref().unwrap()).is_empty());
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
//! The project's record (docs/direction.feature DR3): what each render and each `raea check` found, one JSON file
|
//! The project's record (docs/direction.feature DR3): what each render and each `raea check` found, one JSON file
|
||||||
//! apiece under the project's .raea/record/, with the commit the project was at. `raea findings` reads it back across
|
//! apiece under the project's .raea/record/, with the commit the project was at. `raea findings` reads it back across
|
||||||
//! renders (what was fixed, what is new, what is carried) and `raea next` reads what stands. A file outside a raea
|
//! renders (what was fixed, what is new, what is carried) and `raea goal next` reads what stands. A file outside a raea
|
||||||
//! project (no .raea/project at or above it) has no record.
|
//! project (no .raea/project at or above it) has no record.
|
||||||
|
|
||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
@@ -64,7 +64,7 @@ fn real(p: &Path) -> PathBuf {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// A path as the record names it: relative to the project when it's in it, with '/' between its parts on Windows too (a
|
/// A path as the record names it: relative to the project when it's in it, with '/' between its parts on Windows too (a
|
||||||
/// project's record moves between machines, and `raea next` quotes it in commands).
|
/// project's record moves between machines, and `raea goal next` quotes it in commands).
|
||||||
pub fn rel(project: &Path, p: &Path) -> String {
|
pub fn rel(project: &Path, p: &Path) -> String {
|
||||||
let full = real(p);
|
let full = real(p);
|
||||||
full.strip_prefix(project).map(|r| r.to_string_lossy().replace(std::path::MAIN_SEPARATOR, "/")).unwrap_or_else(|_| full.display().to_string())
|
full.strip_prefix(project).map(|r| r.to_string_lossy().replace(std::path::MAIN_SEPARATOR, "/")).unwrap_or_else(|_| full.display().to_string())
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ fn wanted() -> Option<&'static ([f64; 3], [f64; 3], Option<f64>)> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// RAEA_LENS="mm": the scene's own camera kept where it is, with that focal length's field of view on a full-frame
|
/// RAEA_LENS="mm": the scene's own camera kept where it is, with that focal length's field of view on a full-frame
|
||||||
/// sensor (a lens chart, docs/make.feature MK15).
|
/// sensor (a lens chart, docs/goal.feature MK15).
|
||||||
fn lens() -> Option<f64> {
|
fn lens() -> Option<f64> {
|
||||||
static LENS: OnceLock<Option<f64>> = OnceLock::new();
|
static LENS: OnceLock<Option<f64>> = OnceLock::new();
|
||||||
*LENS.get_or_init(|| std::env::var("RAEA_LENS").ok()?.trim().parse::<f64>().ok().filter(|mm| *mm > 0.0).map(fov_of_lens))
|
*LENS.get_or_init(|| std::env::var("RAEA_LENS").ok()?.trim().parse::<f64>().ok().filter(|mm| *mm > 0.0).map(fov_of_lens))
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ version = "0.1.0"
|
|||||||
edition = "2024"
|
edition = "2024"
|
||||||
license = "FSL-1.1-ALv2"
|
license = "FSL-1.1-ALv2"
|
||||||
publish = false
|
publish = false
|
||||||
description = "raea solid info: a solid's parts measured (volume, area, box, centre of mass, pieces, genus), how its parts meet, an expect file's predictions checked and two mutants against them, in scene lint's found shape"
|
description = "raea make solid info: a solid's parts measured (volume, area, box, centre of mass, pieces, genus), how its parts meet, an expect file's predictions checked and two mutants against them, in scene lint's found shape"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
raea-core-shape = { path = "../shape" }
|
raea-core-shape = { path = "../shape" }
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
//! `raea solid info`: a solid measured, part by part, in scene lint's shape (docs/handoff/solids.md, Next 1; the
|
//! `raea make solid info`: a solid measured, part by part, in scene lint's shape (docs/handoff/solids.md, Next 1; the
|
||||||
//! 11-06 research: numbers before renders for geometry, and a prediction checked rather than a threshold judged). It
|
//! 11-06 research: numbers before renders for geometry, and a prediction checked rather than a threshold judged). It
|
||||||
//! takes each named part's shape expression (what a Solid knows of itself) and answers volume, area, box, centre of
|
//! takes each named part's shape expression (what a Solid knows of itself) and answers volume, area, box, centre of
|
||||||
//! mass, pieces, genus and triangles for each part and for the whole; how each pair of parts meets; and `found`, each
|
//! mass, pieces, genus and triangles for each part and for the whole; how each pair of parts meets; and `found`, each
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
//! Faces lying in one plane over each other (docs/make.feature MK8, the clip check FLOOR3 ran in Blender): two
|
//! Faces lying in one plane over each other (docs/goal.feature MK8, the clip check FLOOR3 ran in Blender): two
|
||||||
//! triangles facing the same way within about a degree, their planes within 0.2 mm, overlapping by more than a
|
//! triangles facing the same way within about a degree, their planes within 0.2 mm, overlapping by more than a
|
||||||
//! millimetre. The depth buffer can't order them, so the picture flickers between them as the camera moves
|
//! millimetre. The depth buffer can't order them, so the picture flickers between them as the camera moves
|
||||||
//! (z-fighting): between two parts (a rug's top in the floor's, two wall slabs overlapping in line) or inside one model
|
//! (z-fighting): between two parts (a rug's top in the floor's, two wall slabs overlapping in line) or inside one model
|
||||||
|
|||||||
+7
-7
@@ -47,17 +47,17 @@ Feature: Light baked by raea: bounce light into lightmaps on raea's own ray trac
|
|||||||
Scenario: BK0. The bake's test set, its references and its numbers
|
Scenario: BK0. The bake's test set, its references and its numbers
|
||||||
Given the plan
|
Given the plan
|
||||||
| crate | file | lines | job |
|
| crate | file | lines | job |
|
||||||
| raea-app-lightbake | apps/lightbake/src/lib.rs | 220 | `raea bake light EDIT.tsx [--composition ID] [--samples N] [--compare DIR]`: bake, then report |
|
| raea-app-lightbake | apps/lightbake/src/lib.rs | 220 | `raea make bake light EDIT.tsx [--composition ID] [--samples N] [--compare DIR]`: bake, then report |
|
||||||
| raea-app-lightbake | apps/lightbake/src/compare.rs | 220 | the same set's Cycles bake (lightbake.py) and Cycles still (look.py --engine cycles) beside raea's: stops and RMSE per mesh and per frame, time, memory |
|
| raea-app-lightbake | apps/lightbake/src/compare.rs | 220 | the same set's Cycles bake (lightbake.py) and Cycles still (look.py --engine cycles) beside raea's: stops and RMSE per mesh and per frame, time, memory |
|
||||||
| raea-app-lightbake | apps/lightbake/sets.json | 40 | the test set: blender-research's table set, a Cornell box, a sunlit room with one window, the atelier's static set |
|
| raea-app-lightbake | apps/lightbake/sets.json | 40 | the test set: blender-research's table set, a Cornell box, a sunlit room with one window, the atelier's static set |
|
||||||
Then each set has a Cycles reference at 1024 samples: its lightmaps and a still from a fixed camera
|
Then each set has a Cycles reference at 1024 samples: its lightmaps and a still from a fixed camera
|
||||||
And `raea bake light --compare DIR` writes DIR/report.json and a table: for each set, raea's bake against Cycles'
|
And `raea make bake light --compare DIR` writes DIR/report.json and a table: for each set, raea's bake against Cycles'
|
||||||
bake (mean and worst-tile stops per mesh) and raea's frame against the Cycles still (RMSE, as blender-research
|
bake (mean and worst-tile stops per mesh) and raea's frame against the Cycles still (RMSE, as blender-research
|
||||||
measured), bake time and peak memory
|
measured), bake time and peak memory
|
||||||
And the bar is: the frame with raea's bake within 0.045 RMSE of Cycles on the table set (lightbake.py gives
|
And the bar is: the frame with raea's bake within 0.045 RMSE of Cycles on the table set (lightbake.py gives
|
||||||
0.040), no mesh off by more than a third of a stop on average, in under a quarter of lightbake.py's time
|
0.040), no mesh off by more than a third of a stop on average, in under a quarter of lightbake.py's time
|
||||||
And the numbers before any BK step lands are recorded in this file, as LT1's are in docs/realism.feature
|
And the numbers before any BK step lands are recorded in this file, as LT1's are in docs/realism.feature
|
||||||
And built 11-23: `raea bake light --compare DIR` (apps/lightbake), the sets in apps/lightbake/sets.json, their
|
And built 11-23: `raea make bake light --compare DIR` (apps/lightbake), the sets in apps/lightbake/sets.json, their
|
||||||
compositions in bench/bake/ (each set's -cycles composition draws lightbake.py's maps from media/baked/). The
|
compositions in bench/bake/ (each set's -cycles composition draws lightbake.py's maps from media/baked/). The
|
||||||
atelier is listed but has no reference yet: its Manifold solids stop `raea blender open`, so it joins at BK5
|
atelier is listed but has no reference yet: its Manifold solids stop `raea blender open`, so it joins at BK5
|
||||||
with its own tools/bake.sh bake as the comparison
|
with its own tools/bake.sh bake as the comparison
|
||||||
@@ -99,7 +99,7 @@ Feature: Light baked by raea: bounce light into lightmaps on raea's own ray trac
|
|||||||
And one second UV set serves the lightmap and raea/wear's cause maps (Shane, 11-23: the bake works with the wear
|
And one second UV set serves the lightmap and raea/wear's cause maps (Shane, 11-23: the bake works with the wear
|
||||||
SDK): systems/weathering (docs/wear.feature WR1) already lays TEXCOORD_1 out for its cause maps and refuses a
|
SDK): systems/weathering (docs/wear.feature WR1) already lays TEXCOORD_1 out for its cause maps and refuses a
|
||||||
material that reads it, so a second atlas would collide. The light bake lays its maps over weathering's atlas,
|
material that reads it, so a second atlas would collide. The light bake lays its maps over weathering's atlas,
|
||||||
`raea_sys_atlas::layout` (in raea-sys-weathering when BK1 landed; split out at BK2), with the request `raea wear bake` takes: given the wear bake's own request, it
|
`raea_sys_atlas::layout` (in raea-sys-weathering when BK1 landed; split out at BK2), with the request `raea make wear bake` takes: given the wear bake's own request, it
|
||||||
is the wear bake's atlas byte for byte (the test says so); a light-only bake asks {env: {density: texels,
|
is the wear bake's atlas byte for byte (the test says so); a light-only bake asks {env: {density: texels,
|
||||||
max_side}}
|
max_side}}
|
||||||
And built 11-23 after measuring the two on the test set: xatlas (MIT, vendored and built through cc, a map per
|
And built 11-23 after measuring the two on the test set: xatlas (MIT, vendored and built through cc, a map per
|
||||||
@@ -122,7 +122,7 @@ Feature: Light baked by raea: bounce light into lightmaps on raea's own ray trac
|
|||||||
bar's whole 60 s four times over. xatlas is a little better on the small sets (the table's ball and vase are
|
bar's whole 60 s four times over. xatlas is a little better on the small sets (the table's ball and vase are
|
||||||
curved, the window room packs to 85%). Weathering's charts are the atlas; the xatlas vendoring went
|
curved, the window room packs to 85%). Weathering's charts are the atlas; the xatlas vendoring went
|
||||||
And a model whose material already reads TEXCOORD_1 is refused with the reason, as WR1 refuses it (a model
|
And a model whose material already reads TEXCOORD_1 is refused with the reason, as WR1 refuses it (a model
|
||||||
lightbake.py baked); keeping a model's own second UVs is BK5's question, and the bake keys of `raea wear bake`
|
lightbake.py baked); keeping a model's own second UVs is BK5's question, and the bake keys of `raea make wear bake`
|
||||||
don't change (weathering's bytes are the same)
|
don't change (weathering's bytes are the same)
|
||||||
|
|
||||||
@needs:BK1
|
@needs:BK1
|
||||||
@@ -226,7 +226,7 @@ Feature: Light baked by raea: bounce light into lightmaps on raea's own ray trac
|
|||||||
default on every OS
|
default on every OS
|
||||||
|
|
||||||
@needs:BK4
|
@needs:BK4
|
||||||
Scenario: BK5. A bake in a composition: <LightBake> and `raea bake light`
|
Scenario: BK5. A bake in a composition: <LightBake> and `raea make bake light`
|
||||||
Given the plan
|
Given the plan
|
||||||
| crate | file | lines | job |
|
| crate | file | lines | job |
|
||||||
| raea-sys-lightbake | systems/lightbake/src/lib.rs | 200 | the bake as a pure function of its request, kept in the asset store by key; the native call |
|
| raea-sys-lightbake | systems/lightbake/src/lib.rs | 200 | the bake as a pure function of its request, kept in the asset store by key; the native call |
|
||||||
@@ -238,7 +238,7 @@ Feature: Light baked by raea: bounce light into lightmaps on raea's own ray trac
|
|||||||
parts stay parts: `raea scene lint`, `raea render --review` and `raea make` see each one, not one baked model
|
parts stay parts: `raea scene lint`, `raea render --review` and `raea make` see each one, not one baked model
|
||||||
And a change to a static part, a material, the sky or a setting changes the key and bakes again; a change to
|
And a change to a static part, a material, the sky or a setting changes the key and bakes again; a change to
|
||||||
anything outside <LightBake> (the camera, a moving part, the sun's direct light) doesn't
|
anything outside <LightBake> (the camera, a moving part, the sun's direct light) doesn't
|
||||||
And `raea bake light EDIT.tsx` bakes ahead of a render and says what it baked (meshes, texels, samples, time)
|
And `raea make bake light EDIT.tsx` bakes ahead of a render and says what it baked (meshes, texels, samples, time)
|
||||||
And `raea guide bevy/lights` gets a "Baked light" section that puts <LightBake> first, with lightbake.py kept as
|
And `raea guide bevy/lights` gets a "Baked light" section that puts <LightBake> first, with lightbake.py kept as
|
||||||
the Cycles reference to compare against; the realism guide's bake step points to it once that guide lands
|
the Cycles reference to compare against; the realism guide's bake step points to it once that guide lands
|
||||||
And on BK0's test set, a composition with <LightBake> meets the bar, and the atelier's static set bakes in raea
|
And on BK0's test set, a composition with <LightBake> meets the bar, and the atelier's static set bakes in raea
|
||||||
|
|||||||
@@ -20,8 +20,8 @@ Feature: Blender as a measured workshop step: an asset passes through it on its
|
|||||||
Rule: Getting a solid out
|
Rule: Getting a solid out
|
||||||
|
|
||||||
@done
|
@done
|
||||||
Scenario: BL1. raea solid export writes a solid as one .glb
|
Scenario: BL1. raea make solid export writes a solid as one .glb
|
||||||
Given a solid file and `raea solid export FILE.ts -o OUT.glb [--set k=v,...] [--part NAME]`
|
Given a solid file and `raea make solid export FILE.ts -o OUT.glb [--set k=v,...] [--part NAME]`
|
||||||
Then the solid (or the one part) is written as a .glb, metres, y up
|
Then the solid (or the one part) is written as a .glb, metres, y up
|
||||||
And an empty or non-watertight solid is refused, with solid info's findings printed
|
And an empty or non-watertight solid is refused, with solid info's findings printed
|
||||||
And the .glb read back has the same volume, pieces and box as the solid, within 0.5%
|
And the .glb read back has the same volume, pieces and box as the solid, within 0.5%
|
||||||
|
|||||||
+12
-12
@@ -291,7 +291,7 @@ Feature: The character SDK as one system: SOMA bodies, Kimodo motion, generated
|
|||||||
# converted weights (NVIDIA's Open Model License for Kimodo, Meta's Llama 3 licence for the encoder).
|
# converted weights (NVIDIA's Open Model License for Kimodo, Meta's Llama 3 licence for the encoder).
|
||||||
# 11-16. Done in Rust, no Python: raea-sys-kimodo runs Kimodo-SOMA-RP-v1's denoiser and LLM2Vec on MLX from
|
# 11-16. Done in Rust, no Python: raea-sys-kimodo runs Kimodo-SOMA-RP-v1's denoiser and LLM2Vec on MLX from
|
||||||
# the checkpoints' own files (nothing converted: mlx-community's 8-bit Llama 3 8B Instruct, McGill-NLP's two
|
# the checkpoints' own files (nothing converted: mlx-community's 8-bit Llama 3 8B Instruct, McGill-NLP's two
|
||||||
# adapters run beside it unmerged), and `raea motion "LINE" [--keys KEYS.json]` writes the clip fromkimodo.ts
|
# adapters run beside it unmerged), and `raea make motion "LINE" [--keys KEYS.json]` writes the clip fromkimodo.ts
|
||||||
# reads. Against PyTorch: the denoiser within 2e-3; a whole 100-step generation from the same noise and text
|
# reads. Against PyTorch: the denoiser within 2e-3; a whole 100-step generation from the same noise and text
|
||||||
# within 0.002 cm on every joint; constraints become the same conditions. The stated tolerance is the 8-bit
|
# within 0.002 cm on every joint; constraints become the same conditions. The stated tolerance is the 8-bit
|
||||||
# encoder's: cosine 0.99993 to float32, which moves the joints 0.01 to 0.74 cm on average and 1.44 cm at
|
# encoder's: cosine 0.99993 to float32, which moves the joints 0.01 to 0.74 cm on average and 1.44 cm at
|
||||||
@@ -315,7 +315,7 @@ Feature: The character SDK as one system: SOMA bodies, Kimodo motion, generated
|
|||||||
And its cost is a one-off download and seconds a line
|
And its cost is a one-off download and seconds a line
|
||||||
|
|
||||||
Scenario: CH15d. Kimodo on every machine raea ships to: MLX on a Mac, PyTorch elsewhere
|
Scenario: CH15d. Kimodo on every machine raea ships to: MLX on a Mac, PyTorch elsewhere
|
||||||
# Shane, 11-17: `raea motion` picks its backend by the machine, so it is part of the system, not a Mac feature.
|
# Shane, 11-17: `raea make motion` picks its backend by the machine, so it is part of the system, not a Mac feature.
|
||||||
# On Linux and Windows it runs upstream Kimodo (nv-tlabs/kimodo at e1c219c, the commit the MLX port was checked
|
# On Linux and Windows it runs upstream Kimodo (nv-tlabs/kimodo at e1c219c, the commit the MLX port was checked
|
||||||
# against) on PyTorch, in an environment `raea setup motion [--check]` makes in raea's models folder
|
# against) on PyTorch, in an environment `raea setup motion [--check]` makes in raea's models folder
|
||||||
# (kimodo-torch): Python 3.11 by uv, PyTorch as uv picks it for the machine's driver, upstream's own pins for the
|
# (kimodo-torch): Python 3.11 by uv, PyTorch as uv picks it for the machine's driver, upstream's own pins for the
|
||||||
@@ -328,7 +328,7 @@ Feature: The character SDK as one system: SOMA bodies, Kimodo motion, generated
|
|||||||
# half checked on MLX's own features through a stand-in runner (every field of the clip equal to MLX's but
|
# half checked on MLX's own features through a stand-in runner (every field of the clip equal to MLX's but
|
||||||
# its source; fromkimodo.ts keeps both), and the code checked for Linux and Windows. Not yet run on a machine:
|
# its source; fromkimodo.ts keeps both), and the code checked for Linux and Windows. Not yet run on a machine:
|
||||||
# the CUDA box's link fell to 1.5 MB/s mid-install, so the environment, the weights and a clip there are open.
|
# the CUDA box's link fell to 1.5 MB/s mid-install, so the environment, the weights and a clip there are open.
|
||||||
Then `raea motion` makes a clip on Linux and Windows with the same line and seed options as on a Mac, after
|
Then `raea make motion` makes a clip on Linux and Windows with the same line and seed options as on a Mac, after
|
||||||
`raea setup motion`, and says what is missing and that command when it isn't set up
|
`raea setup motion`, and says what is missing and that command when it isn't set up
|
||||||
And the clip is the file fromkimodo.ts reads, in the format the MLX path writes
|
And the clip is the file fromkimodo.ts reads, in the format the MLX path writes
|
||||||
|
|
||||||
@@ -451,7 +451,7 @@ Feature: The character SDK as one system: SOMA bodies, Kimodo motion, generated
|
|||||||
# 11-15. Measured first (sheet3d compositions/seam_check.tsx: the headless body at rest with the head as a
|
# 11-15. Measured first (sheet3d compositions/seam_check.tsx: the headless body at rest with the head as a
|
||||||
# part, lit evenly, seen close from the front, both sides and the back, the collar on the middle row): the
|
# part, lit evenly, seen close from the front, both sides and the back, the collar on the middle row): the
|
||||||
# body, built in the head's neck colour, stood 8 levels of 255 lighter than the head's skin across the
|
# body, built in the head's neck colour, stood 8 levels of 255 lighter than the head's skin across the
|
||||||
# collar at the front, 1 to 3 at the sides and back, and the line showed. `raea clothes wear ... --head
|
# collar at the front, 1 to 3 at the sides and back, and the line showed. `raea make clothes wear ... --head
|
||||||
# HEAD_DIR` (engine/cli/src/grade.ts) now writes the join into the body it dresses: the skin takes the
|
# HEAD_DIR` (engine/cli/src/grade.ts) now writes the join into the body it dresses: the skin takes the
|
||||||
# head's neck colour, and each vertex under the collar takes the colour the head's own skin has above it
|
# head's neck colour, and each vertex under the collar takes the colour the head's own skin has above it
|
||||||
# (head.json's ring colours, evened over five round the ring: one texel a vertex drew streaks), easing into
|
# (head.json's ring colours, evened over five round the ring: one texel a vertex drew streaks), easing into
|
||||||
@@ -734,12 +734,12 @@ Feature: The character SDK as one system: SOMA bodies, Kimodo motion, generated
|
|||||||
@done
|
@done
|
||||||
Scenario: CH44b. A sewn garment worn over others moves on the cloth follower
|
Scenario: CH44b. A sewn garment worn over others moves on the cloth follower
|
||||||
# 11-17 (sdk/body tools/worn.ts, private). `bun sdk/body/tools/worn.ts SKELETON GARMENT.glb POSES OUT.bind.rseq
|
# 11-17 (sdk/body tools/worn.ts, private). `bun sdk/body/tools/worn.ts SKELETON GARMENT.glb POSES OUT.bind.rseq
|
||||||
# BODY.glb UNDER.glb...` reads a sewn garment from `raea clothes wear` as cloth (free by how far it hangs off what
|
# BODY.glb UNDER.glb...` reads a sewn garment from `raea make clothes wear` as cloth (free by how far it hangs off what
|
||||||
# it is worn over), follows it through the poses with SOMA's twist joints set as the engine sets them, and writes
|
# it is worn over), follows it through the poses with SOMA's twist joints set as the engine sets them, and writes
|
||||||
# it in its own bind pose for <Character parts={[{ src, cloth: { src, frame } }]}>; its trims (buttons, straps, a
|
# it in its own bind pose for <Character parts={[{ src, cloth: { src, frame } }]}>; its trims (buttons, straps, a
|
||||||
# belt, from tools/garments/trims.py) ride the cloth they were cast on. A coat's skirt is found from its sewn
|
# belt, from tools/garments/trims.py) ride the cloth they were cast on. A coat's skirt is found from its sewn
|
||||||
# weights, evened between the legs and kept outside them by capsules and by the legs' skin lifted to a smooth hull
|
# weights, evened between the legs and kept outside them by capsules and by the legs' skin lifted to a smooth hull
|
||||||
# over the trousers. `FOLLOW=NAME raea clothes wear ...` keeps the garments under a followed one whole below the
|
# over the trousers. `FOLLOW=NAME raea make clothes wear ...` keeps the garments under a followed one whole below the
|
||||||
# crotch. Run on a Landsturm greatcoat over trousers and boots through a 304-frame walk (gambit
|
# crotch. Run on a Landsturm greatcoat over trousers and boots through a 304-frame walk (gambit
|
||||||
# compositions/people-wardrobe.tsx): 217 particles inside the legs on the follower against 2,066 skinned alone,
|
# compositions/people-wardrobe.tsx): 217 particles inside the legs on the follower against 2,066 skinned alone,
|
||||||
# edges 44 per cent at the 99th percentile, 139 ms a frame. Mended on the way, each found by a picture and then
|
# edges 44 per cent at the 99th percentile, 139 ms a frame. Mended on the way, each found by a picture and then
|
||||||
@@ -769,7 +769,7 @@ Feature: The character SDK as one system: SOMA bodies, Kimodo motion, generated
|
|||||||
Then a line of words becomes a garment file with its cost said
|
Then a line of words becomes a garment file with its cost said
|
||||||
|
|
||||||
@done
|
@done
|
||||||
Scenario: CH45b. `raea clothes`: garments from words, by procedure, and worn
|
Scenario: CH45b. `raea make clothes`: garments from words, by procedure, and worn
|
||||||
# 11-15. A shell verb (engine/cli/src/clothes.ts reads the words, wardrobe.ts does the work on the native raea;
|
# 11-15. A shell verb (engine/cli/src/clothes.ts reads the words, wardrobe.ts does the work on the native raea;
|
||||||
# the Blender scripts are tools/clothes, shipped with a release). The first use fetches SOMA-X's two body files
|
# the Blender scripts are tools/clothes, shipped with a release). The first use fetches SOMA-X's two body files
|
||||||
# at a fixed commit, checked by SHA-256, into raea's models folder (soma/, with the Apache-2.0 licence), and makes
|
# at a fixed commit, checked by SHA-256, into raea's models folder (soma/, with the Apache-2.0 licence), and makes
|
||||||
@@ -796,13 +796,13 @@ Feature: The character SDK as one system: SOMA bodies, Kimodo motion, generated
|
|||||||
Then a garment is made by one command from words or by procedure, and an outfit is worn by one more
|
Then a garment is made by one command from words or by procedure, and an outfit is worn by one more
|
||||||
|
|
||||||
@done
|
@done
|
||||||
Scenario: CH45c. `raea clothes make` sews; the picture-measured garments are gone
|
Scenario: CH45c. `raea make clothes make` sews; the picture-measured garments are gone
|
||||||
# 11-15 night. `raea clothes make NAME ["WORDS"] [--plain] [--set PATH=VALUE,...] [--colour #RRGGBB]` makes a
|
# 11-15 night. `raea make clothes make NAME ["WORDS"] [--plain] [--set PATH=VALUE,...] [--colour #RRGGBB]` makes a
|
||||||
# sewn garment (CH47a's patterns, CH48c's model) in the project: assets/clothes/NAME.json (kind "sewn") and
|
# sewn garment (CH47a's patterns, CH48c's model) in the project: assets/clothes/NAME.json (kind "sewn") and
|
||||||
# assets/clothes/NAME/ (the glb, the design, the flat pattern, four pictures). The design is the garment
|
# assets/clothes/NAME/ (the glb, the design, the flat pattern, four pictures). The design is the garment
|
||||||
# model's from the words, or GarmentCode's plain base with --plain or no words; each --set changes one of its
|
# model's from the words, or GarmentCode's plain base with --plain or no words; each --set changes one of its
|
||||||
# 122 settings by path, checked against its options or range (a wrong one says what is allowed);
|
# 122 settings by path, checked against its options or range (a wrong one says what is allowed);
|
||||||
# `raea clothes settings` lists them. The first use sets up raea's models folder (garments/): GarmentCode
|
# `raea make clothes settings` lists them. The first use sets up raea's models folder (garments/): GarmentCode
|
||||||
# cloned at a fixed commit and checked by it, a Python 3.11 environment made by uv from a pinned list, SOMA's
|
# cloned at a fixed commit and checked by it, a Python 3.11 environment made by uv from a pinned list, SOMA's
|
||||||
# body as a distance grid. `wear` takes sewn garments beside ones laid on the skin: each sewn glb is copied
|
# body as a distance grid. `wear` takes sewn garments beside ones laid on the skin: each sewn glb is copied
|
||||||
# and the skin under it left out (tools/garments/hide_under.py). Measured before building: the model alone
|
# and the skin under it left out (tools/garments/hide_under.py). Measured before building: the model alone
|
||||||
@@ -844,7 +844,7 @@ Feature: The character SDK as one system: SOMA bodies, Kimodo motion, generated
|
|||||||
|
|
||||||
@done
|
@done
|
||||||
Scenario: CH47a. Garments from sewing patterns, cut to SOMA's measurements and draped by a cloth of our own
|
Scenario: CH47a. Garments from sewing patterns, cut to SOMA's measurements and draped by a cloth of our own
|
||||||
# 11-15, after the user saw `raea clothes make` on the body ("on the body it looks terrible"; "the 4 panels
|
# 11-15, after the user saw `raea make clothes make` on the body ("on the body it looks terrible"; "the 4 panels
|
||||||
# are not consistent at all") and asked whether clothes are thought of wrong. They were: a garment painted
|
# are not consistent at all") and asked whether clothes are thought of wrong. They were: a garment painted
|
||||||
# onto a shell of the skin can't show a cut, a hem or a fold, and four pictures drawn apart never agree.
|
# onto a shell of the skin can't show a cut, a hem or a fold, and four pictures drawn apart never agree.
|
||||||
# Clothes are flat pieces cut to a pattern and sewn, their shape from the cut, gravity and the body.
|
# Clothes are flat pieces cut to a pattern and sewn, their shape from the cut, gravity and the body.
|
||||||
@@ -999,7 +999,7 @@ Feature: The character SDK as one system: SOMA bodies, Kimodo motion, generated
|
|||||||
# carries the source it is attested by.
|
# carries the source it is attested by.
|
||||||
# - glbio.py: rewrites the glb so a cover or trim set made again replaces the last.
|
# - glbio.py: rewrites the glb so a cover or trim set made again replaces the last.
|
||||||
# Open:
|
# Open:
|
||||||
# - `raea clothes make --cloth/--panels/--design` (the CLI and the manual);
|
# - `raea make clothes make --cloth/--panels/--design` (the CLI and the manual);
|
||||||
# - embossed detail (a button's crown, a buckle's motto) as a normal map;
|
# - embossed detail (a button's crown, a buckle's motto) as a normal map;
|
||||||
# - a trim on cloth that folds over itself (a turn-down collar's top layer is found, the layer under it not).
|
# - a trim on cloth that folds over itself (a turn-down collar's top layer is found, the layer under it not).
|
||||||
Then a sewn garment can be covered in a named cloth whose weave and fuzz show at a close-up
|
Then a sewn garment can be covered in a named cloth whose weave and fuzz show at a close-up
|
||||||
|
|||||||
+13
-13
@@ -7,7 +7,7 @@ Written 11-23.
|
|||||||
|
|
||||||
## Where it starts
|
## Where it starts
|
||||||
|
|
||||||
- `raea component list | add NAME [--shared] [--force]` (engine/cli/src/index.ts, docs/layout.feature LY4) copies a
|
- `raea make component list | add NAME [--shared] [--force]` (engine/cli/src/index.ts, docs/layout.feature LY4) copies a
|
||||||
set or a single component from `REGISTRY`, which tools/pack.ts packs into engine/cli/src/registry.gen.ts from
|
set or a single component from `REGISTRY`, which tools/pack.ts packs into engine/cli/src/registry.gen.ts from
|
||||||
examples/parts. Two sets today, both 2D motion: `brand` (9 parts) and `reel`. Copy-in, owned by the project, never
|
examples/parts. Two sets today, both 2D motion: `brand` (9 parts) and `reel`. Copy-in, owned by the project, never
|
||||||
updated behind its back: shadcn's model already.
|
updated behind its back: shadcn's model already.
|
||||||
@@ -72,9 +72,9 @@ The mapping:
|
|||||||
|
|
||||||
Why each field exists:
|
Why each field exists:
|
||||||
|
|
||||||
- **assets**: shadcn's `content` is text. A `.glb`, a texture or a sound is fetched from its URL by `raea component add`,
|
- **assets**: shadcn's `content` is text. A `.glb`, a texture or a sound is fetched from its URL by `raea make component add`,
|
||||||
checked against its sha256, and written to its target. The shadcn CLI ignores `meta`, so an item it installs gets
|
checked against its sha256, and written to its target. The shadcn CLI ignores `meta`, so an item it installs gets
|
||||||
its code without its assets; the component's own code then fails at render naming the fix (`raea component add NAME`
|
its code without its assets; the component's own code then fails at render naming the fix (`raea make component add NAME`
|
||||||
or `raea doctor --fix` fetches what's missing). Code stays usable everywhere; assets stay out of JSON.
|
or `raea doctor --fix` fetches what's missing). Code stays usable everywhere; assets stay out of JSON.
|
||||||
- **engine**: shadcn items have no version range because React's surface is stable. raea's isn't yet (prop names,
|
- **engine**: shadcn items have no version range because React's surface is stable. raea's isn't yet (prop names,
|
||||||
Bevy versions). An item names the raea it was checked on, and `raea doctor` (SK10) reports items outside the
|
Bevy versions). An item names the raea it was checked on, and `raea doctor` (SK10) reports items outside the
|
||||||
@@ -86,9 +86,9 @@ Why each field exists:
|
|||||||
- **backends**: raea draws through wgpu on Metal (Mac), Vulkan (Linux, and Mesa's lavapipe in the release's checks)
|
- **backends**: raea draws through wgpu on Metal (Mac), Vulkan (Linux, and Mesa's lavapipe in the release's checks)
|
||||||
and DX12 (Windows). WESL that one backend's compiler accepts can be refused or drawn differently by another (a
|
and DX12 (Windows). WESL that one backend's compiler accepts can be refused or drawn differently by another (a
|
||||||
reserved word, a precision difference, a binding limit), so a shader or material item says where its fixture was
|
reserved word, a precision difference, a binding limit), so a shader or material item says where its fixture was
|
||||||
drawn, and `raea component check` on a machine adds its own backend.
|
drawn, and `raea make component check` on a machine adds its own backend.
|
||||||
- **fixture, checks, stills**: an item is published with the composition that renders it alone, the checks that pass
|
- **fixture, checks, stills**: an item is published with the composition that renders it alone, the checks that pass
|
||||||
there, and the stills it drew, so `raea component check NAME` can tell a consumer's install drew the same.
|
there, and the stills it drew, so `raea make component check NAME` can tell a consumer's install drew the same.
|
||||||
- **build**: an asset made in Blender or by a generator carries the script that makes it again, so the asset isn't a
|
- **build**: an asset made in Blender or by a generator carries the script that makes it again, so the asset isn't a
|
||||||
dead end (sdk/guides/craft/components.md, "Build it in Blender, then make it a component?").
|
dead end (sdk/guides/craft/components.md, "Build it in Blender, then make it a component?").
|
||||||
|
|
||||||
@@ -120,8 +120,8 @@ can hold `@shadcn/*`, `@raea/*` and a team's own namespace:
|
|||||||
"aliases": { "components": "./components" } }
|
"aliases": { "components": "./components" } }
|
||||||
```
|
```
|
||||||
|
|
||||||
- `raea component add @raea/kettle @shadcn/card` resolves each from its registry, with its `registryDependencies`.
|
- `raea make component add @raea/kettle @shadcn/card` resolves each from its registry, with its `registryDependencies`.
|
||||||
- A bare name (`raea component add reel`) keeps meaning raea's own, from the copy compiled into the binary, so it
|
- A bare name (`raea make component add reel`) keeps meaning raea's own, from the copy compiled into the binary, so it
|
||||||
works offline. That compiled copy is the `@raea` registry as of the release.
|
works offline. That compiled copy is the `@raea` registry as of the release.
|
||||||
- With no `components.json`, raea writes one the first time a namespaced item is added, with `@raea` in it.
|
- With no `components.json`, raea writes one the first time a namespaced item is added, with `@raea` in it.
|
||||||
|
|
||||||
@@ -150,7 +150,7 @@ for a story's beats and a check can find a beat the story marks as shown with no
|
|||||||
orbs, steam rises from the kettle) works on every piece that uses it.
|
orbs, steam rises from the kettle) works on every piece that uses it.
|
||||||
- An item's checks are raea/check systems in `checks/`, the way sdk/guides/craft/checks/ are written: values, and the
|
- An item's checks are raea/check systems in `checks/`, the way sdk/guides/craft/checks/ are written: values, and the
|
||||||
cheats each check fails.
|
cheats each check fails.
|
||||||
- `raea component check NAME` renders the fixture, runs the item's checks, and compares the stills to `meta.raea.stills`
|
- `raea make component check NAME` renders the fixture, runs the item's checks, and compares the stills to `meta.raea.stills`
|
||||||
(SSIM, as P26 does). It's the gate for publishing to `@raea`, and what a consumer runs after adapting a component.
|
(SSIM, as P26 does). It's the gate for publishing to `@raea`, and what a consumer runs after adapting a component.
|
||||||
|
|
||||||
## Where things get made
|
## Where things get made
|
||||||
@@ -171,13 +171,13 @@ Each step lands on its own and is useful alone.
|
|||||||
registry.gen.ts. A test validates every item against shadcn's published schema (vendored, pinned by sha256).
|
registry.gen.ts. A test validates every item against shadcn's published schema (vendored, pinned by sha256).
|
||||||
- **CP3. First 3D items**: a material set (four finishes, from bevy/materials' examples), one shader (the sea, from
|
- **CP3. First 3D items**: a material set (four finishes, from bevy/materials' examples), one shader (the sea, from
|
||||||
bevy/water), one object with a `.glb` asset and a `build` script, one screen showing `@shadcn/card`. Each passes
|
bevy/water), one object with a `.glb` asset and a `build` script, one screen showing `@shadcn/card`. Each passes
|
||||||
`raea component check`.
|
`raea make component check`.
|
||||||
- **CP4. `raea component add` reads `components.json`**: namespaced and URL addresses, `registryDependencies`
|
- **CP4. `raea make component add` reads `components.json`**: namespaced and URL addresses, `registryDependencies`
|
||||||
resolved, assets fetched and pinned, the shadcn CLI's file layout kept. Offline, bare names keep working.
|
resolved, assets fetched and pinned, the shadcn CLI's file layout kept. Offline, bare names keep working.
|
||||||
- **CP5. `raea component check NAME`**: fixture, checks, stills; P26 rows read from it.
|
- **CP5. `raea make component check NAME`**: fixture, checks, stills; P26 rows read from it.
|
||||||
- **CP6. Serve `@raea`**: raea.io/r/registry.json and /r/{name}.json from the release's packed files, assets on the
|
- **CP6. Serve `@raea`**: raea.io/r/registry.json and /r/{name}.json from the release's packed files, assets on the
|
||||||
public models release or R2 by sha. List it in shadcn's registry directory.
|
public models release or R2 by sha. List it in shadcn's registry directory.
|
||||||
- **CP7. `raea component publish DIR`**: a project's or workspace's components to a registry folder (static JSON), for a
|
- **CP7. `raea make component publish DIR`**: a project's or workspace's components to a registry folder (static JSON), for a
|
||||||
team's own namespace.
|
team's own namespace.
|
||||||
- **CP8. Theme both ways**: a `registry:theme` into a brand kit, and a brand kit out as one.
|
- **CP8. Theme both ways**: a `registry:theme` into a brand kit, and a brand kit out as one.
|
||||||
- **CP9. Story-sets**: `meta.raea.story.shows`, a planner that proposes components for a story's beats, and the check
|
- **CP9. Story-sets**: `meta.raea.story.shows`, a planner that proposes components for a story's beats, and the check
|
||||||
@@ -190,4 +190,4 @@ Each step lands on its own and is useful alone.
|
|||||||
- Hosting `@raea` at raea.io/r (Cloudflare, beside the site) or as a GitHub registry (`shinyobjectz/raea-components`,
|
- Hosting `@raea` at raea.io/r (Cloudflare, beside the site) or as a GitHub registry (`shinyobjectz/raea-components`,
|
||||||
addressed `owner/repo/item.TAG`, which shadcn now reads directly).
|
addressed `owner/repo/item.TAG`, which shadcn now reads directly).
|
||||||
- Whether `@raea` items may carry assets on R2 (fast, ours) or only on GitHub release assets (public, permanent).
|
- Whether `@raea` items may carry assets on R2 (fast, ours) or only on GitHub release assets (public, permanent).
|
||||||
- Whether `raea component add` should run an item's `build` script when its asset URL is gone, or only report it.
|
- Whether `raea make component add` should run an item's `build` script when its asset URL is gone, or only report it.
|
||||||
+16
-16
@@ -75,13 +75,13 @@ Feature: Direction that holds: one world of facts, findings and rules, so a pers
|
|||||||
| a person's standing rules with checks | core/brief/src/taste.rs (`Rule { text, check }`), the taste loop (docs/craft-system.md J) | six closed forms, all about an export's text and sound; a rule is proposed only when a correction repeats; nothing per project or per note |
|
| a person's standing rules with checks | core/brief/src/taste.rs (`Rule { text, check }`), the taste loop (docs/craft-system.md J) | six closed forms, all about an export's text and sound; a rule is proposed only when a correction repeats; nothing per project or per note |
|
||||||
| notes as tasks | review.feature R3 (to do, working, done), a pin's `part` | "done" is the agent's word; nothing proves it or keeps it |
|
| notes as tasks | review.feature R3 (to do, working, done), a pin's `part` | "done" is the agent's word; nothing proves it or keeps it |
|
||||||
| notes mapped to a verb | skills/skills/raea/craft/verbs | one verb a note; a note that holds several asks loses the rest |
|
| notes mapped to a verb | skills/skills/raea/craft/verbs | one verb a note; a note that holds several asks loses the rest |
|
||||||
| a plan frozen before building | core/brief/src/plan.rs (parts, levels, counts, `seen_from`), `raea solid info --expect` | one object at a time; not a place, not a project |
|
| a plan frozen before building | core/brief/src/plan.rs (parts, levels, counts, `seen_from`), `raea make solid info --expect` | one object at a time; not a place, not a project |
|
||||||
| rooms that know what things are | raea/room (`layRun` roles, `faceToward` from a model's measured front, `checkLayout`, `checkDecor`) | interiors against walls only; a set built any other way gets none of it |
|
| rooms that know what things are | raea/room (`layRun` roles, `faceToward` from a model's measured front, `checkLayout`, `checkDecor`) | interiors against walls only; a set built any other way gets none of it |
|
||||||
| placement by relation | scene.feature (`<Place on>`; surfaces by name and a contact model per asset are "next") | still next |
|
| placement by relation | scene.feature (`<Place on>`; surfaces by name and a contact model per asset are "next") | still next |
|
||||||
| a shader over a whole scene | shaders.feature SH4 (`<SurfaceShader>`) | the skill offers `<Look mode="paint">` first (3d.md); nothing says a project should have its own |
|
| a shader over a whole scene | shaders.feature SH4 (`<SurfaceShader>`) | the skill offers `<Look mode="paint">` first (3d.md); nothing says a project should have its own |
|
||||||
| every drawn thing's layer key and mask | review.feature R2, systems/layers (page built, 3D next) | made for selecting in the player; not used to mask one layer by another |
|
| every drawn thing's layer key and mask | review.feature R2, systems/layers (page built, 3D next) | made for selecting in the player; not used to mask one layer by another |
|
||||||
| text behind a subject | goal.feature Track G: "depth-based text layering (G5, measured; not rendered yet)" | not rendered |
|
| text behind a subject | standing-goal.feature Track G: "depth-based text layering (G5, measured; not rendered yet)" | not rendered |
|
||||||
| measures per frame, per cut, over time | goal.feature Track G's catalogue (previz columns) | for footage edits; reported, not enforced; not run on a 3D or React piece |
|
| measures per frame, per cut, over time | standing-goal.feature Track G's catalogue (previz columns) | for footage edits; reported, not enforced; not run on a 3D or React piece |
|
||||||
| controllers | core/brief/src/controller.rs, apps/workspace/src/controllers.rs | settings only (choice, list, agents, workflow); no rule, no check |
|
| controllers | core/brief/src/controller.rs, apps/workspace/src/controllers.rs | settings only (choice, list, agents, workflow); no rule, no check |
|
||||||
| components registered and linted | projects.feature PJ8 (`raea project scan`) | a component is "a .tsx a composition imports"; it carries no meaning |
|
| components registered and linted | projects.feature PJ8 (`raea project scan`) | a component is "a .tsx a composition imports"; it carries no meaning |
|
||||||
| the order of work | skills/skills/raea/craft/ROUTER.md | storyboard and camera map before anything is blocked; no component or blocking step |
|
| the order of work | skills/skills/raea/craft/ROUTER.md | storyboard and camera map before anything is blocked; no component or blocking step |
|
||||||
@@ -147,7 +147,7 @@ Feature: Direction that holds: one world of facts, findings and rules, so a pers
|
|||||||
And the taste file's six forms become six of raea's named checks (same names, same values), so
|
And the taste file's six forms become six of raea's named checks (same names, same values), so
|
||||||
`{ form: "text-above", value: 62 }` still reads and no taste file changes
|
`{ form: "text-above", value: 62 }` still reads and no taste file changes
|
||||||
And the stages are recorded in .raea/project (`[stage] components = passed <sha>` ...), set by the stage's
|
And the stages are recorded in .raea/project (`[stage] components = passed <sha>` ...), set by the stage's
|
||||||
review, read by `raea next` and by the refusals
|
review, read by `raea goal next` and by the refusals
|
||||||
And what the stock paint look gained on 11-10 (light as a gradient; worlds cut per pixel with styles; the
|
And what the stock paint look gained on 11-10 (light as a gradient; worlds cut per pixel with styles; the
|
||||||
camera columns it needs each frame) is taken out of systems/look into the worked example of a project look
|
camera columns it needs each frame) is taken out of systems/look into the worked example of a project look
|
||||||
(DR24), not landed as part of the stock look
|
(DR24), not landed as part of the stock look
|
||||||
@@ -259,7 +259,7 @@ Feature: Direction that holds: one world of facts, findings and rules, so a pers
|
|||||||
Then every render writes its manifest (today only with --manifest), beside its output
|
Then every render writes its manifest (today only with --manifest), beside its output
|
||||||
And the manifest is entities too, added to the frame's world when a check asks for them: the layer
|
And the manifest is entities too, added to the frame's world when a check asks for them: the layer
|
||||||
masks (review.feature R2b) as `Covers { layer, share }` between layers, each text's contrast against what is
|
masks (review.feature R2b) as `Covers { layer, share }` between layers, each text's contrast against what is
|
||||||
behind it, each shot's measured motion and luminance (goal.feature Track G's columns), the mix's loudness and
|
behind it, each shot's measured motion and luminance (standing-goal.feature Track G's columns), the mix's loudness and
|
||||||
each cue's measured onset
|
each cue's measured onset
|
||||||
And what a render adds says it needs one: a world with no render, or a frame the render didn't draw, has a
|
And what a render adds says it needs one: a world with no render, or a frame the render didn't draw, has a
|
||||||
`Waits` resource naming each component it would add and what it waits for ("a render", "a video render", "a
|
`Waits` resource naming each component it would add and what it waits for ("a render", "a video render", "a
|
||||||
@@ -273,20 +273,20 @@ Feature: Direction that holds: one world of facts, findings and rules, so a pers
|
|||||||
Scenario: DR3. One finding, for every command
|
Scenario: DR3. One finding, for every command
|
||||||
# Status 11-10: built. One Finding (core/facts finding.rs: its check; error, warn or note; the entities it is
|
# Status 11-10: built. One Finding (core/facts finding.rs: its check; error, warn or note; the entities it is
|
||||||
# about; frames; says; measure; fix; by) is all these write: the render's clipping (systems/contact found.rs) and
|
# about; frames; says; measure; fix; by) is all these write: the render's clipping (systems/contact found.rs) and
|
||||||
# exposure (light-meter), `raea scene lint|light`, `raea check` (--quick, --taste), `raea gen check`, `raea solid
|
# exposure (light-meter), `raea scene lint|light`, `raea check` (--quick, --taste), `raea gen check`, `raea make solid
|
||||||
# info --expect`, `raea project scan`, raea/room's checkLayout and checkDecor, `raea judge`. Every render (a video,
|
# info --expect`, `raea project scan`, raea/room's checkLayout and checkDecor, `raea judge`. Every render (a video,
|
||||||
# --at stills, a still, --review, a .wav) says them, writes them into its manifest and counts them on its last
|
# --at stills, a still, --review, a .wav) says them, writes them into its manifest and counts them on its last
|
||||||
# line; an error exits 1 unless `--despite CHECK WHY` (RAEA_DESPITE for harnesses that compare pixels). Each run of
|
# line; an error exits 1 unless `--despite CHECK WHY` (RAEA_DESPITE for harnesses that compare pixels). Each run of
|
||||||
# a file in a project keeps one entry in .raea/record/: what, what it wrote and its kind, the commit (+ when the
|
# a file in a project keeps one entry in .raea/record/: what, what it wrote and its kind, the commit (+ when the
|
||||||
# file had changed), the findings, what was let through. A render that is part of another (a review's tiles, a
|
# file had changed), the findings, what was let through. A render that is part of another (a review's tiles, a
|
||||||
# quick check's stills, solid view's scene) keeps none. `raea findings` sets each thing's latest run against the
|
# quick check's stills, solid view's scene) keeps none. `raea findings` sets each thing's latest run against the
|
||||||
# one before of its kind and lists new, carried (since which run), renamed, fixed and let through; `raea next`
|
# one before of its kind and lists new, carried (since which run), renamed, fixed and let through; `raea goal next`
|
||||||
# steps by it: fix what the last render found, render the video, again once the composition changed, check it,
|
# steps by it: fix what the last render found, render the video, again once the composition changed, check it,
|
||||||
# polish what the check found, show it.
|
# polish what the check found, show it.
|
||||||
# Real runs (release binary, M5 Pro, a scratch project): a crate 0.24 m into a pillar renders "error clips frames
|
# Real runs (release binary, M5 Pro, a scratch project): a crate 0.24 m into a pillar renders "error clips frames
|
||||||
# 0-29 crate, pillar", exits 1 and is kept; `raea next` says to fix it; the render's own move (+0.397 m along x)
|
# 0-29 crate, pillar", exits 1 and is kept; `raea goal next` says to fix it; the render's own move (+0.397 m along x)
|
||||||
# renders 0 errors and `raea findings` lists the clip fixed (at 9969526+); `raea next` then asks for the check,
|
# renders 0 errors and `raea findings` lists the clip fixed (at 9969526+); `raea goal next` then asks for the check,
|
||||||
# and after it to show the video. `raea solid info` on a mug that misses its volume expect: one error, exit 1.
|
# and after it to show the video. `raea make solid info` on a mug that misses its volume expect: one error, exit 1.
|
||||||
# `raea gen check` on knot.glb: a pivot warn whose fix is the command to run, and two notes. `raea project scan`:
|
# `raea gen check` on knot.glb: a pivot warn whose fix is the command to run, and two notes. `raea project scan`:
|
||||||
# its count last.
|
# its count last.
|
||||||
# DR9's cheats, run for real, each fail. --despite exits 0, and the error stays standing with its reason. With
|
# DR9's cheats, run for real, each fail. --despite exits 0, and the error stays standing with its reason. With
|
||||||
@@ -314,12 +314,12 @@ Feature: Direction that holds: one world of facts, findings and rules, so a pers
|
|||||||
# six lines in apps/check's report, which writes check.json, and its crate had the room; a second crate would
|
# six lines in apps/check's report, which writes check.json, and its crate had the room; a second crate would
|
||||||
# have converted raea check's output after the fact instead of raea check writing Findings.
|
# have converted raea check's output after the fact instead of raea check writing Findings.
|
||||||
| raea-core-facts | core/facts/src/record.rs | 220 | the project's record: findings by render and by commit, read back |
|
| raea-core-facts | core/facts/src/record.rs | 220 | the project's record: findings by render and by commit, read back |
|
||||||
# Fixed in the code (DR3): the plan put the record in apps/direction. The render, `raea check` and `raea next`
|
# Fixed in the code (DR3): the plan put the record in apps/direction. The render, `raea check` and `raea goal next`
|
||||||
# all write or read it, and apps/direction brings raea-runtime-world with it; core/facts, which each already uses
|
# all write or read it, and apps/direction brings raea-runtime-world with it; core/facts, which each already uses
|
||||||
# for Finding, holds it instead, and the registry's `up` (the nearest .raea/project) moved there with it.
|
# for Finding, holds it instead, and the registry's `up` (the nearest .raea/project) moved there with it.
|
||||||
| raea-app-direction | apps/direction/src/findings.rs | 160 | `raea findings` |
|
| raea-app-direction | apps/direction/src/findings.rs | 160 | `raea findings` |
|
||||||
Then these write Findings and nothing else: the render's clipping check, `raea scene lint|light`, `raea check`
|
Then these write Findings and nothing else: the render's clipping check, `raea scene lint|light`, `raea check`
|
||||||
(and --quick, --taste), `raea gen check`, `raea solid info --expect`, `raea project scan`, raea/room's
|
(and --quick, --taste), `raea gen check`, `raea make solid info --expect`, `raea project scan`, raea/room's
|
||||||
checkLayout and checkDecor, `raea judge`
|
checkLayout and checkDecor, `raea judge`
|
||||||
And each finding names the entities it is about (the two parts that clip, the text that is cut off), so
|
And each finding names the entities it is about (the two parts that clip, the text that is cut off), so
|
||||||
"everything found about this part" is a query
|
"everything found about this part" is a query
|
||||||
@@ -332,7 +332,7 @@ Feature: Direction that holds: one world of facts, findings and rules, so a pers
|
|||||||
# still, frames, sound, check); a finding gone under one name and new under another with the same check, frames
|
# still, frames, sound, check); a finding gone under one name and new under another with the same check, frames
|
||||||
# and measure is "renamed"; what --despite let through is listed. A clip no frame shows is said as a note, so
|
# and measure is "renamed"; what --despite let through is listed. A clip no frame shows is said as a note, so
|
||||||
# turning the camera away doesn't read as a fix.
|
# turning the camera away doesn't read as a fix.
|
||||||
And `raea next` reads from it (not from a check.json's modified time, as next.rs does now)
|
And `raea goal next` reads from it (not from a check.json's modified time, as next.rs does now)
|
||||||
|
|
||||||
@needs:DR1,DR3 @done
|
@needs:DR1,DR3 @done
|
||||||
Scenario: DR4. A check is a system; raea's own are written the same way
|
Scenario: DR4. A check is a system; raea's own are written the same way
|
||||||
@@ -626,7 +626,7 @@ Feature: Direction that holds: one world of facts, findings and rules, so a pers
|
|||||||
makes what a person looks at (a sheet for components, clips for the rest); the person's yes, or the checks
|
makes what a person looks at (a sheet for components, clips for the rest); the person's yes, or the checks
|
||||||
alone where the brief says so, records it in .raea/project
|
alone where the brief says so, records it in .raea/project
|
||||||
And `raea check --stage S` runs that stage's checks alone (moved here from DR4, which has no stages to pick)
|
And `raea check --stage S` runs that stage's checks alone (moved here from DR4, which has no stages to pick)
|
||||||
And `raea next` names the open stage and its first failing check, and no longer says "stills to look at first"
|
And `raea goal next` names the open stage and its first failing check, and no longer says "stills to look at first"
|
||||||
And starting a later stage's work on a failing earlier one is a finding at every render, not a refusal of the
|
And starting a later stage's work on a failing earlier one is a finding at every render, not a refusal of the
|
||||||
file save: a camera can be sketched early, but nothing with a camera can be posted
|
file save: a camera can be sketched early, but nothing with a camera can be posted
|
||||||
|
|
||||||
@@ -746,7 +746,7 @@ Feature: Direction that holds: one world of facts, findings and rules, so a pers
|
|||||||
|
|
||||||
@needs:DR2
|
@needs:DR2
|
||||||
Scenario: DR19. A 2D layer masked by what is in a 3D or footage layer
|
Scenario: DR19. A 2D layer masked by what is in a 3D or footage layer
|
||||||
Given systems/layers (each pixel's frontmost layer) and goal.feature's G5 (a person's matte and depth)
|
Given systems/layers (each pixel's frontmost layer) and standing-goal.feature's G5 (a person's matte and depth)
|
||||||
Then `<Layer medium="2d-type" maskedBy={["hero", "desk"]} depth={z}>` composites flat type or graphics behind
|
Then `<Layer medium="2d-type" maskedBy={["hero", "desk"]} depth={z}>` composites flat type or graphics behind
|
||||||
the named parts and in front of the rest: the mask is the engine's own, exact to the pixel, for a 3D scene
|
the named parts and in front of the rest: the mask is the engine's own, exact to the pixel, for a 3D scene
|
||||||
from its depth and for footage from its matte
|
from its depth and for footage from its matte
|
||||||
@@ -769,7 +769,7 @@ Feature: Direction that holds: one world of facts, findings and rules, so a pers
|
|||||||
single still is offered only for a thing that doesn't move
|
single still is offered only for a thing that doesn't move
|
||||||
And a still drawn alone must equal its frame in the continuous render: `raea render --at` stills are checked
|
And a still drawn alone must equal its frame in the continuous render: `raea render --at` stills are checked
|
||||||
against the same frames stepped in sequence, and a difference is a finding naming the value that held
|
against the same frames stepped in sequence, and a difference is a finding naming the value that held
|
||||||
And the measures of goal.feature Track G's catalogue run on any piece, as raea's named checks: eye trace and
|
And the measures of standing-goal.feature Track G's catalogue run on any piece, as raea's named checks: eye trace and
|
||||||
screen direction at a cut, an unmotivated jump in brightness or warmth, a subject lost from frame, a pop in a
|
screen direction at a cut, an unmotivated jump in brightness or warmth, a subject lost from frame, a pop in a
|
||||||
camera's path or lens, a hold too short to read
|
camera's path or lens, a hold too short to read
|
||||||
And the project-local scripts the film grew (motion, framing, seat, light, frame jumps) are these checks,
|
And the project-local scripts the film grew (motion, framing, seat, light, frame jumps) are these checks,
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ Feature: raea's plugin ecosystem: extending the engine and the app, made, shared
|
|||||||
|
|
||||||
What exists (11-09):
|
What exists (11-09):
|
||||||
- The engine is extended through its SDK. TypeScript (components, parts, systems on BevyApp, npm packages through
|
- The engine is extended through its SDK. TypeScript (components, parts, systems on BevyApp, npm packages through
|
||||||
`raea add`, ready parts through `raea part add`) runs on the shipped raea with no build, and a play reloads the
|
`raea add`, ready parts through `raea make component add`) runs on the shipped raea with no build, and a play reloads the
|
||||||
edit on save (runtime/live, docs/bevy-ts.feature "hot reload: partial").
|
edit on save (runtime/live, docs/bevy-ts.feature "hot reload: partial").
|
||||||
- Shader files are data: a Material's or a MaterialExtension's WGSL is compiled as written (docs/control.feature
|
- Shader files are data: a Material's or a MaterialExtension's WGSL is compiled as written (docs/control.feature
|
||||||
FC2a, FC2b), so a surface ships as a file.
|
FC2a, FC2b), so a surface ships as a file.
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ Feature: First person: his own body's hands, what they do with the world, and cu
|
|||||||
distance field in a grip chosen for its shape (graspThing), take and fetch (a thing taken from where the body
|
distance field in a grip chosen for its shape (graspThing), take and fetch (a thing taken from where the body
|
||||||
stands, or walked up to first), interact/plan/hold (beats of reach, grab, lift, carry, put, throw), hand shapes
|
stands, or walked up to first), interact/plan/hold (beats of reach, grab, lift, carry, put, throw), hand shapes
|
||||||
from SOMA-X's prior, and HG14's measured bar (tools/hands-audit) that the hands are held to.
|
from SOMA-X's prior, and HG14's measured bar (tools/hands-audit) that the hands are held to.
|
||||||
- raea motion: Kimodo on MLX on this Mac (a PyTorch backend for other machines is being built), whole-body motion
|
- raea make motion: Kimodo on MLX on this Mac (a PyTorch backend for other machines is being built), whole-body motion
|
||||||
from words with keys (full-body poses, hand and foot targets, a root path).
|
from words with keys (full-body poses, hand and foot targets, a root path).
|
||||||
- Games: useInput and useGameState, a pure step per frame, played live by raea play.
|
- Games: useInput and useGameState, a pure step per frame, played live by raea play.
|
||||||
Where the code lives: in the Gambit project's components/fp/ while it is made (so no uncommitted file of this
|
Where the code lives: in the Gambit project's components/fp/ while it is made (so no uncommitted file of this
|
||||||
|
|||||||
@@ -0,0 +1,651 @@
|
|||||||
|
@spec
|
||||||
|
Feature: Goal: the loop every piece of work runs, one goal or a workflow of them, held to rules the agent can't skip
|
||||||
|
Shane, 2026-11-29: "'raea make' should be clis/sdks that are specific to design things or actions like character
|
||||||
|
sdk, wear sdk, etc. those are really raea make tools. 'raea goal' is the /goal like oriented approach to a workflow,
|
||||||
|
planning, executing, checking etc." And on the measuring verbs: "top level. because ultimately things like
|
||||||
|
workflows would have and build out multiple goals and they must be achieved and planned for accordingly." And:
|
||||||
|
"goals can be structured in a workflow, or a plan or brief designed as one step that attributes to a certain part of
|
||||||
|
a workflow." This file was docs/make.feature until then (MK45).
|
||||||
|
|
||||||
|
Shane, 2026-11-23, after a deep dive into apekshik's AnyScene, AnyKit and AnyShot (github.com/apekshik, MIT): "lets
|
||||||
|
take all three learn form them and adopt that review loop internally wholesale. i think this is ley for us. all 11
|
||||||
|
points seem relevant to adopt or itnegrate intoexisting systems, or converting into a typescript planning and review
|
||||||
|
sdk as part of it". Decided the same day: the contract goes on brief.ts; the gate uses `raea ask`; internal and cloud
|
||||||
|
are built together. Plan: ~/.claude/plans/dreamy-floating-dijkstra-of-771a18a0-2207-4b03-80e7-ddbec117bc80.md.
|
||||||
|
|
||||||
|
What the three repos showed (their builder/CRAFT.md and agent/KIT.md say it outright): the quality came from a loop,
|
||||||
|
not a model or a setting. Render it and look; name the problem precisely; fix it in a script so a rebuild keeps it;
|
||||||
|
check the fix from a view that shows it (a camera 30 cm off the floor shows a floating chair a wide shot hides); get
|
||||||
|
an independent critic, because the builder stops seeing its own flaws. And a Stop hook that won't let the agent end
|
||||||
|
until every deliverable exists and the critic passes, with a cap and a stall rule so it can't loop forever.
|
||||||
|
|
||||||
|
The model this file sets:
|
||||||
|
1. One loop, three kinds of job: a scene (a dressed, lit place from references or a brief), a kit (a set of props
|
||||||
|
that belong together, from style references) and a shot (stills or camera moves of a built scene, from words).
|
||||||
|
2. The plan is the contract: `goal` on the project's brief.ts (core/brief goal.rs), typed from Rust, written by the
|
||||||
|
agent before it builds, and read by Rust. Every object carries its real size and whether it came from the
|
||||||
|
reference or was invented; every dial its value, where the value came from, and what it meant here.
|
||||||
|
3. Done is decided in code (`raea goal check`), never by the agent saying so, and enforced where the agent stops:
|
||||||
|
the Stop hook of every agent raea installs hooks for, locally and on raea cloud.
|
||||||
|
4. Three tiers of gate, each gating once it has earned it: measured checks always; `raea ask` questions one by one,
|
||||||
|
once each is calibrated on the person's labels; a fresh critic's fixes always (fixed or answered), its score
|
||||||
|
once `raea judge calibrate` agrees with the person's eye.
|
||||||
|
5. Every job ends with its notes, including what the skill got wrong for it, so the next job starts from them.
|
||||||
|
6. Every object is planned at a level of detail, by how large it is meant to be seen, and every render says
|
||||||
|
when a shot shows one closer than that (MK21-MK24).
|
||||||
|
|
||||||
|
Background:
|
||||||
|
Given raea's scene loop as advice (sdk/guides/craft/bevy/scenes.md, from the 11-06 research): brief, routing,
|
||||||
|
build big to small, `raea render --review` (hero, front, right, top, iso and low cameras in colour and clay;
|
||||||
|
core/review), `raea judge` (frozen rubric; clef, kimi or claude; pass, done, stall in code; apps/judge),
|
||||||
|
`raea scene lint` (raea-sys-contact) and `raea gen check`
|
||||||
|
And `raea ask` (docs/ask.feature): typed clef questions with a ledger that calibrates each question on labels
|
||||||
|
And the raea plugin's hooks (skills/skills/hooks/hooks.json -> `raea hook claude`, apps/check hook.rs), whose Stop
|
||||||
|
branch already blocks a turn's end to hand over what the person sent from the app
|
||||||
|
And the project's record (.raea/record/, core/facts record.rs): what each render and check found, and when
|
||||||
|
|
||||||
|
Rule: the plan and done (MK0-MK3)
|
||||||
|
|
||||||
|
|
||||||
|
@done
|
||||||
|
Scenario: MK0. The contract: `make` on brief.ts
|
||||||
|
Given a brief.ts whose default export has `goal: kit({...})`, `scene({...})` or `shot({...})` (raea/brief)
|
||||||
|
Then core/brief reads it as `Make`: its kind, references, style (one paragraph: era, palette, materials, wear and
|
||||||
|
one fictional maker), dials, objects, shots, deliverables and a round cap (8 by default)
|
||||||
|
And each object has an id, a label, one size (`h`, `dims` [w, d, h] or `max` for things that lie flat), a route
|
||||||
|
(solid, rule, gen, library, picture), a prompt, `source` (reference or invented), a `crop` in reference 0, a
|
||||||
|
place (x, y, z, rot) for a scene, the generator it was picked from and why, and the fixes made by script
|
||||||
|
And each dial is `{ value, source: customer | reference, means }`, from its kind's set (scene: density, tidiness,
|
||||||
|
wear, wetness, time_of_day, weather, atmosphere, power, warmth, look; kit: count, variety, detail, wear,
|
||||||
|
wetness, warmth, look; shot: res, seconds, lens, handheld, look)
|
||||||
|
And the TypeScript is generated from those types (sdk/raea/src/brief.gen.ts), so tsc checks what Rust reads
|
||||||
|
And `doctor` names what the plan still lacks: no objects, an object with no size or no route, a dial outside its
|
||||||
|
kind's set, a generated object with no prompt
|
||||||
|
|
||||||
|
@needs:MK0 @done
|
||||||
|
Scenario: MK1. `raea goal check`: what's missing, decided in code
|
||||||
|
Given a project whose brief has `make`
|
||||||
|
When `raea goal check [--at done] [--json]` runs
|
||||||
|
Then it lists what's missing for the kind:
|
||||||
|
| kind | deliverables (under out/, overridable with `deliverables`) |
|
||||||
|
| scene | stills/ with 3 or more pictures |
|
||||||
|
| kit | kit/<id>/<id>.glb, kit/<id>/<id>_lod1.glb and kit/thumbs/<id>.png per object, kit/lineup.png, kit/kit.json |
|
||||||
|
| shot | shots/<name>.png or shots/<name>.mp4 per shot |
|
||||||
|
And NOTES.md beside the brief, with a "What the skill got wrong" section
|
||||||
|
And each gate's state: the record's last render or check of every composition the plan names is newer than the
|
||||||
|
file and found no error; the critic has judged a round newer than the newest deliverable; each blocking defect
|
||||||
|
of that round is fixed (the round passed) or answered in NOTES.md by its id
|
||||||
|
And the judge's rounds, passes in a row and stall, read from review/judge.log.jsonl as `raea judge` keeps them
|
||||||
|
And `done` is true when nothing is missing and every gate is clear, and also when the job is capped (its rounds
|
||||||
|
reached the cap) or stalled; a capped or stalled job is delivered short, with what's missing listed
|
||||||
|
|
||||||
|
@needs:MK1 @done
|
||||||
|
Scenario: MK2. The Stop hook: the agent can't end a job that isn't done
|
||||||
|
Given an agent session (Claude Code, codex, gemini, kimi) with raea's hooks, in a project whose brief has `make`
|
||||||
|
When its turn is about to end and `raea goal check` isn't done
|
||||||
|
Then the hook blocks the stop with "Not done:" and what's missing, and the agent keeps going
|
||||||
|
And a session blocked three times with the same list goes through (the agent is going in circles; the status
|
||||||
|
says so), as PL7's keeper stops after asks that change nothing
|
||||||
|
And a project without `make` is never blocked, and a brief that doesn't load blocks nothing (the hook says why)
|
||||||
|
|
||||||
|
@needs:MK2 @done
|
||||||
|
Scenario: MK3. Gates in plan.org (superseded by MK40: `--plan` is gone)
|
||||||
|
Given the project's plan.org (docs/plan.feature)
|
||||||
|
Then `raea goal check`'s report (review/goal.json) writes each gate as a check line under the job's task (sdk/task `setCheck`), so
|
||||||
|
the person, the app and the cloud see the same list the hook holds the agent to
|
||||||
|
|
||||||
|
Rule: the three tiers of gate (MK4-MK6)
|
||||||
|
|
||||||
|
@needs:MK1 @done
|
||||||
|
Scenario: MK4. Defects as calibrated ask questions
|
||||||
|
Given the judge's yes/no defects (apps/judge rubric.rs: floating, intersecting, blobby, stand_in, clones,
|
||||||
|
flat_colour, plastic, ...) and the loop's own (a cohesion outlier on a reference sheet, a real brand, garbled
|
||||||
|
hero text, a disconnected assembly, opaque glass, a camera through a wall)
|
||||||
|
Then each is an ask question with versioned words (core/ask), answered on the gate's sheet and kept in the ledger
|
||||||
|
And it gates once `raea ask calibrate` passes it on the person's labels (16 problem, 16 clean, held-out AUC 0.8);
|
||||||
|
until then its answer shows in the status as advice
|
||||||
|
|
||||||
|
@needs:MK1 @done
|
||||||
|
Scenario: MK5. A rubric per kind for the fresh critic
|
||||||
|
Then `raea judge --kind scene|kit|shot` asks the kind's categories (scene: layout, props, screens and signage,
|
||||||
|
materials, light, atmosphere, plausibility, composition; kit: cohesion, reference fidelity, brief, mesh,
|
||||||
|
texture, assembly, scale, labels; shot: framing, move, focus, clearance, continuity, grade)
|
||||||
|
And the critic is told the bar is a production base an artist then refines, judged at normal viewing distance,
|
||||||
|
no points off for choices that differ from the reference, at most five fixes, most damaging first
|
||||||
|
|
||||||
|
@needs:MK5 @done
|
||||||
|
Scenario: MK6. The critic's score gates once it is calibrated
|
||||||
|
Given `raea judge calibrate` reporting agreement with the person's eye for a kind
|
||||||
|
Then that kind's jobs also need two fresh passes in a row to be done; before that, fixed-or-answered is enough
|
||||||
|
|
||||||
|
Rule: measured placement (MK7-MK9)
|
||||||
|
|
||||||
|
@done
|
||||||
|
Scenario: MK7. Grounding at contact points
|
||||||
|
Given a part whose box bottom isn't where it touches down (splayed feet, a handle, an origin offset)
|
||||||
|
Then `raea scene lint` casts rays down from its lowest vertices (its feet), ignoring itself, volumes and decals,
|
||||||
|
and reports `floats` (the gap, and a `{y, dy}` fix that settles it down) or `sunk` (a fix that raises it);
|
||||||
|
a part whose feet reach nothing reads as mounted (a wall or ceiling holds it) or as a warning in the air, so
|
||||||
|
signs, pendants and lamps on cords aren't errors; a stool whose box clips a table's edge rests by its feet
|
||||||
|
|
||||||
|
@done
|
||||||
|
Scenario: MK8. The clip check, for every level
|
||||||
|
Then `raea scene lint` (raea-sys-contact) reports clips with their depth and the move that clears them
|
||||||
|
(`{part, axis, by}`), and faces z-fighting: two parts' faces in one plane over each other (an error from
|
||||||
|
1 cm², a warning under), and doubled faces inside one model (a warning), on every lint, no flag needed
|
||||||
|
|
||||||
|
@done
|
||||||
|
Scenario: MK9. Re-drop after every move
|
||||||
|
Then a part moved sideways by a clip's fix is settled onto what's under its new place in the same pass (the fix
|
||||||
|
carries its `dy`), and a stool under a table rests on the floor by its feet, so nothing hovers at table height
|
||||||
|
|
||||||
|
Rule: kits (MK10-MK13)
|
||||||
|
|
||||||
|
@needs:MK1 @done
|
||||||
|
Scenario: MK10. References made in one style, checked on one sheet
|
||||||
|
Then `raea make refs` makes each object's reference with `raea gen image` with the style images as input, the
|
||||||
|
plan's style paragraph and the scan template (`--dry` quotes it), and writes review/refs.png (`raea make sheet
|
||||||
|
refs` again): the style images, then every reference labelled with its size, before any 3D
|
||||||
|
And outliers (another style, a real brand, cropped, two objects) are regenerated first: the cheapest place to fix
|
||||||
|
cohesion
|
||||||
|
|
||||||
|
@needs:MK10 @done
|
||||||
|
Scenario: MK11. Both generators, picked on clay
|
||||||
|
Then `raea make gen` sends every reference to Tripo H3.1 (face limit 150k heroes, 60k small) and Meshy (fal),
|
||||||
|
`raea make pick-sheet` fits both to size and renders reference | Tripo | Tripo clay | Meshy | Meshy clay under
|
||||||
|
one light (review/picks.png), and `raea make pick ID tripo|meshy "why"` records the pick and its one-line why (the earlier ~150 props: Meshy ~70%, small items and printed labels; Tripo the big
|
||||||
|
hard-surface heroes)
|
||||||
|
|
||||||
|
@needs:MK11 @done
|
||||||
|
Scenario: MK12. Prep and LOD
|
||||||
|
Then `raea make prep` fits each pick with `raea gen check -o` (front +z, real metres, bottom-centre) and writes a
|
||||||
|
quarter-triangle ID_lod1.glb (blender/decimate.py), each with its .glb.json saying how it was made
|
||||||
|
|
||||||
|
@needs:MK12 @done
|
||||||
|
Scenario: MK13. A kit is a component set
|
||||||
|
Then `raea make kit` lands it in shared/components/<kit>/ (one component per object importing its model and LOD
|
||||||
|
from beside it: compositions import .glb files as their path), with lineup.tsx (a 1 m bar, labels), cover.png,
|
||||||
|
thumbnails and kit.json, and the job's own out/kit/ record that `raea goal check` counts
|
||||||
|
|
||||||
|
Rule: shots (MK14-MK17)
|
||||||
|
|
||||||
|
@done
|
||||||
|
Scenario: MK14. Camera moves, focus and the handheld walk
|
||||||
|
Then raea/camera has static, dolly, truck, pedestal, crane, pan, tilt, orbit, dollyZoom (the lens solved per
|
||||||
|
frame to hold the subject) and path (Catmull-Rom), focus track, point and rack with holds, and
|
||||||
|
`handheld({ profile: "walk" })`: steps at 1.8 Hz, an aim on a spring, small reframes, nothing above 1.9 Hz
|
||||||
|
|
||||||
|
@needs:MK14 @done
|
||||||
|
Scenario: MK15. Blocking: framing sheets and a lens chart
|
||||||
|
Then `raea make framing` renders each shot's first, middle and last frame (`raea render --at`) onto
|
||||||
|
review/framing.png, a row a shot stamped with its name and time, and `raea make lenschart SHOT` its first frame
|
||||||
|
at 18, 24, 35, 50, 85 and 135 mm (RAEA_LENS keeps the scene's camera and sets its lens)
|
||||||
|
|
||||||
|
@needs:MK14 @done
|
||||||
|
Scenario: MK16. Clearance on every frame
|
||||||
|
Then `raea scene stage --clearance 0.45` finds every run of frames where the camera is nearer a solid than that
|
||||||
|
(a box first, a model's triangles when its box comes close; inside a part said so), leaving out volumes,
|
||||||
|
particles, decals, see-through parts (glass) and anything under 5 cm
|
||||||
|
|
||||||
|
@needs:MK14 @done
|
||||||
|
Scenario: MK17. Shots from words and from a floor plan
|
||||||
|
Then the shot-language guide (bevy/shots) maps a crew's words to moves (push in, truck, reveal, rack focus,
|
||||||
|
walkthrough at 0.4-0.6 m/s and 1.5-1.7 m); a path drawn on `raea make blockout`'s floor plan (its metres, x right,
|
||||||
|
z away from the entrance) is `walkPath(points)`: an even walking pace at eye height, corners rounded; grade looks
|
||||||
|
(clean, cinematic, gritty, vintage) are `gradeLook()` presets in raea/post_process
|
||||||
|
|
||||||
|
Rule: the plan, drawn (MK18)
|
||||||
|
|
||||||
|
@needs:MK0 @done
|
||||||
|
Scenario: MK18. `raea make blockout`: a floor plan, a grey box and a comparison
|
||||||
|
Then it draws review/plan/floor-plan.png (every placed object's footprint turned by its rot and labelled with its
|
||||||
|
height, invented ones dashed, a metre grid, the entrance the camera looks in from), renders a grey box of the
|
||||||
|
plan from the entrance (blockout.tsx, and `raea render --review` sheets of it) and puts the reference, the
|
||||||
|
blockout and the floor plan on comparison.png, for the person to approve before anything is generated
|
||||||
|
|
||||||
|
Rule: planned detail (MK21-MK24)
|
||||||
|
Shane, 2026-11-24: "define objects at an LOD level based on either us grayboxing or thinking of them as generally
|
||||||
|
distant objects and alert agents when an LOD that was at 3 or 4 for example is now appearing in frame at LOD 2
|
||||||
|
level or 1, or 0 ... helpful for planning objects as generally distant and unseen objects versus close ones and
|
||||||
|
knowing if we forgot about something over time". A level is how large a part is planned to be seen, which is how
|
||||||
|
much of it gets built; the frames are measured against it on every render, so a camera move added later, or a
|
||||||
|
box that was meant to be replaced, is said the next time anything is drawn.
|
||||||
|
|
||||||
|
@done
|
||||||
|
Scenario: MK21. A part shown closer than its planned detail is said
|
||||||
|
Given a level is how much of the frame a part's box spans through the frame's camera, the larger of its width's
|
||||||
|
and its height's share: 0 the hero (50% or more), 1 featured (20%), 2 dressing (8%), 3 background (2%), 4 far
|
||||||
|
And a part's plan is its own `lod` (Mesh3d, Model, and every part inside an Entity with a transform or a Group
|
||||||
|
that has one), else the `lod` of the plan's object of its name
|
||||||
|
When a frame shows a planned part at a finer level than its plan (raea-runtime-lod-plan)
|
||||||
|
Then the render's end checks, `raea scene stage` and `raea check --quick` say `lod-closer`: the part, its plan,
|
||||||
|
the level it is seen at, how much of the frame it spans at its largest and on which frame, how many frames it
|
||||||
|
is closer on, and the fix (build it for that level and plan it there, or keep the camera off it)
|
||||||
|
And one level finer is a warning, two or more an error, which fails the render as any error does
|
||||||
|
And a part out of the frame, behind the camera, or with another mesh's box across every line to it isn't seen;
|
||||||
|
a part the camera stands in or beside is measured at its nearest point; RAEA_LOD_CHECK=0 leaves the check out
|
||||||
|
|
||||||
|
@needs:MK21 @done
|
||||||
|
Scenario: MK22. The plan carries each object's level
|
||||||
|
Given `lod: 0..4` on an object of `make` in brief.ts (core/brief make.rs; `doctor` refuses a level past 4)
|
||||||
|
Then a render of a composition under that brief holds the parts named as the objects' ids to those levels
|
||||||
|
(runtime/lod-plan plan.rs reads the brief only when its words plan a level, once a version)
|
||||||
|
And `raea make blockout` labels each footprint with its level and writes each grey box with its object's id as its
|
||||||
|
name and its `lod`, so the blockout is held to the plan it draws
|
||||||
|
|
||||||
|
@needs:MK21 @done
|
||||||
|
Scenario: MK23. `raea scene lod`: every part's plan beside what the frames show
|
||||||
|
When `raea scene lod EDIT.tsx [--from N] [--to N] [--json]` steps the frames without drawing
|
||||||
|
Then it lists every part: its planned level, the finest level a frame shows it at, how much of the frame it
|
||||||
|
spans there, on which frame, and how many frames it is in; parts seen closer than planned first (the widest
|
||||||
|
gap on top), then the rest of the planned, then the parts with no plan by how large they get
|
||||||
|
And a planned part no frame shows as close as its plan says so (built finer than it is ever seen)
|
||||||
|
And a level the plan gives a name that no part in the frames goes by is listed, since it holds nothing
|
||||||
|
And it exits 1 when a part is seen two or more levels finer than planned
|
||||||
|
|
||||||
|
@needs:MK22 @done
|
||||||
|
Scenario: MK24. A job is held at a part seen closer than planned
|
||||||
|
Given a job whose composition's last render or check found `lod-closer`
|
||||||
|
Then `raea goal check` has a `lod` gate for that composition, open with the parts' names, until each is built
|
||||||
|
for the level it is seen at and replanned, kept out of the camera's way, or answered in NOTES.md on a line
|
||||||
|
with `lod` and its name; the Stop hook holds the agent there as at any open gate
|
||||||
|
And a job that plans a level and whose render found none shows the gate clear
|
||||||
|
|
||||||
|
Rule: cuts from a client's brief (MK25-MK27)
|
||||||
|
Shane, 11-25, on StreetTalk's street interview ads, cut by raea cloud agents from three clients' PDF briefs: "you
|
||||||
|
need to make the process of ingesting the brief more direct, or else it's just context that gets lost. It needs to
|
||||||
|
be written as a brief typescript rule that is then enforced ... I need raea make to be the standard". The agents had
|
||||||
|
read the briefs and still shipped what a contract catches: held to one written from Elfster's brief, Gemini's four
|
||||||
|
delivered solos (eight files) had "free, fun, and easy" missing from three, the CTA rewritten in one ("Download
|
||||||
|
Elfster for free in the App Store") and missing from another, no frames check on any final file, and four of the
|
||||||
|
ten cuts the brief asks for in its out/ folder.
|
||||||
|
|
||||||
|
@needs:MK0
|
||||||
|
Scenario: MK25. The brief as rules: `goal: cut({...})`
|
||||||
|
Given a client's brief as text beside brief.ts (pdftotext -layout BRIEF.pdf media/brief.txt)
|
||||||
|
When the agent writes `goal: cut({ cut: {...} })` before it plans a single cut
|
||||||
|
Then core/brief reads `cut` (cut.rs): `brief` (that text), `count` (how many cuts the brief asks for), `seconds`
|
||||||
|
and `formats`, each cut (id, angle, solo or mashup, hook, captions or a text hook, its own formats and length),
|
||||||
|
`say` (phrases every cut says or shows, or one cut with `every: false`), `never` (phrases no cut says or
|
||||||
|
shows), `cta` (the line every cut ends on, within its last 8 s; `also`: the other lines a brief rotates, any
|
||||||
|
one of which lands it, each found in the brief) and `open` (the brief's [TO CONFIRM] items)
|
||||||
|
And every rule has `from`: the brief's own words for it
|
||||||
|
And each cut lands at a fixed path, out/cuts/<id>_<W>x<H>.mp4 for each of its formats
|
||||||
|
And `doctor` names what the contract still lacks: no count, no cta, an id that isn't [a-z0-9_], a format that
|
||||||
|
isn't W:H, a cut with no length, a rule with no `from`
|
||||||
|
|
||||||
|
@needs:MK25
|
||||||
|
Scenario: MK26. Held to the brief's own words, its count and its open items
|
||||||
|
Given a cut contract
|
||||||
|
Then `raea goal check` finds every `from` in the brief's text, compared by letters and digits: a rule the brief
|
||||||
|
doesn't say, or says in other words, holds the job ("quotes")
|
||||||
|
And fewer cuts than `count` hold it, unless an `open` item about "count" has the person's answer ("count")
|
||||||
|
And every `open` item without an answer holds it, so the agent stops at a review to ask ("open")
|
||||||
|
|
||||||
|
@needs:MK25
|
||||||
|
Scenario: MK27. Every delivered file held to the rules, from what's on disk
|
||||||
|
Given a cut's file at its path
|
||||||
|
Then its shape and length are read from its own MP4 boxes, so a file re-encoded after its render is read as it is
|
||||||
|
now ("shape")
|
||||||
|
And its words must be heard after its last change (FILE.words.json, `raea words`), and in them or its render's
|
||||||
|
text (FILE.render.json): every `say` phrase ("say"), no `never` phrase, with the second it's heard ("never"),
|
||||||
|
and the CTA in its last `within` seconds, 85% of its words in order ("cta")
|
||||||
|
And its frames check must have run after its last change (FILE.frames-check.json, `raea frames check`) with no
|
||||||
|
error: no face cut by the frame or a seam, no text under the size floor ("frames")
|
||||||
|
And the cut job has no critic tier yet: the person's review is its critic
|
||||||
|
|
||||||
|
Rule: any goal, held to rules (MK28-MK29)
|
||||||
|
Shane, 11-26, asking whether raea make is just a version of /goal: "when we use these things, they should just
|
||||||
|
probably be consolidated into one workflow, because in any case we'll have a goal or a brief or something that
|
||||||
|
dictates what we need. And then we essentially just need to make sure that it can't stop unless all the goals pass,
|
||||||
|
or all the rules in the brief". /goal in raea.app's chat let the agent end the loop by writing "GOAL MET"; a goal it
|
||||||
|
can declare met is advice. So /goal and raea make are one loop: a goal is a fifth kind of job, its words become
|
||||||
|
rules in brief.ts before the work starts, and only `raea goal check` says it's met.
|
||||||
|
|
||||||
|
@needs:MK2
|
||||||
|
Scenario: MK28. A goal as rules: `goal: rules({...})`
|
||||||
|
Given work that isn't a scene, kit, shot or cut (fix a bug, write a page, ship a change)
|
||||||
|
When the agent writes `goal: rules({ aim: "the person's words", rules: [...] })` before it starts
|
||||||
|
Then core/brief reads `goal` (goal.rs): the goal as the person said it, and `rules`, each an id and exactly one of
|
||||||
|
`run` (a command that must exit 0 in the brief's folder, within `timeout` seconds, 300 by default), `file` (a
|
||||||
|
file that must exist: a deliverable) or `says` (words that must be true of the work)
|
||||||
|
And `doctor` names what it lacks: no goal, no rules, an id that isn't [a-z0-9_] or is listed twice, a rule with
|
||||||
|
none or more than one of run, file and says, a timeout with no run
|
||||||
|
And a goal job needs no NOTES.md "What the skill got wrong" section (no skill made it) and has no render critic
|
||||||
|
|
||||||
|
@needs:MK28
|
||||||
|
Scenario: MK29. Held by a command's exit and a fresh critic, never the agent's word
|
||||||
|
Given a goal job
|
||||||
|
Then `raea goal check` runs every `run` rule at every status, the Stop hook's included, and holds the job on one
|
||||||
|
that fails or outlives its timeout, with its exit code and last line ("run")
|
||||||
|
And a `says` rule is clear only when review/judge/NAME.json, written by `raea goal judge [DIR] [--by claude|kimi]`
|
||||||
|
(a fresh session that may only read: Read, Grep and Glob), found it true at a time no earlier than the work's
|
||||||
|
newest file, the job's own review/, .raea/, NOTES.md, .git and node_modules left out, compared at whole seconds
|
||||||
|
("says")
|
||||||
|
And `file` rules are its deliverables, listed under missing
|
||||||
|
And raea.app's /goal is this job: it writes the rules first, and only the status ends the loop
|
||||||
|
|
||||||
|
Rule: raea cloud (MK19-MK20)
|
||||||
|
|
||||||
|
@needs:MK2 @done
|
||||||
|
Scenario: MK19. Three skills on raea cloud
|
||||||
|
Then raea cloud has "Scene from references" (plan, spend, first cut, deliver), "Kit from style" (reference
|
||||||
|
sheet, spend, deliver) and "Shots of a scene" (framing, deliver) as skill templates (GET|POST
|
||||||
|
/v1/skills/templates), each with a workflow whose agent steps are checked by a `raea goal check` line: run as
|
||||||
|
`raea goal check --at done --json` on the box in the project's folder, "says done" holding on its done and "raea make
|
||||||
|
status: critic, review/refs.png" on each named gate and file
|
||||||
|
|
||||||
|
@needs:MK19 @done
|
||||||
|
Scenario: MK20. Retry-safe jobs and a live view
|
||||||
|
Then a project is keyed by a hash of its inputs (or the caller's Idempotency-Key; its plan's INPUTS): the same
|
||||||
|
ask from the API, the studio, a form or a webhook returns the finished project, attaches to the running one or
|
||||||
|
resumes a failed one without paying again; one a person stopped doesn't hold the ask
|
||||||
|
And every picture the agent opens goes to the live watch as a raea.seen event (its path, and a preview when the
|
||||||
|
bytes are under 600 KB), and a raea.heartbeat every 20 s repeats the milestones so far for anyone who joins late
|
||||||
|
|
||||||
|
Rule: one make, every rule in TypeScript, at four moments (MK30-MK42)
|
||||||
|
Shane, 11-29, after Dutch (StreetTalk, 7 cuts delivered by a raea cloud agent: 5-10 edit points per cut inside a
|
||||||
|
word, a guest's line 15 dB under the host's, effects 14-20 dB under the voice, a checklist laid on a woman's lap
|
||||||
|
and a caption on the dog the shot is about, contact sheets looked at for 3 of the 7 cuts): "we want everything to
|
||||||
|
be in TypeScript ... the structure of make and goal as a construct of repeating and working and iterating until
|
||||||
|
it's right, with TypeScript rules that oversee the hooks and the validation process and the ability to check
|
||||||
|
things both after a render, checking during an edit via the CLI, when submitting and completing ... just editing
|
||||||
|
from one SDK the whole time"; "be sure to completely remove any skill/cli/context that would be now dead or
|
||||||
|
misleading"; "delete anything that is now legacy".
|
||||||
|
|
||||||
|
What it replaces. Six rule systems said overlapping things in four places: `raea make status`'s gates in Rust
|
||||||
|
(cut-plan, goal-plan, apps/make status.rs), `raea check PROJECT`'s taste rules and project checks (apps/direction),
|
||||||
|
`raea notes check`'s asks (apps/notes), `raea check VIDEO`'s floor (apps/check), the box's `raea words check`,
|
||||||
|
`raea frames check` and `raea sound check` (sdk/cloud/server), and raea cloud's own gates (make-checks.ts, the
|
||||||
|
naming and count checks, the publish gate) beside five method paragraphs in every project's first message. An
|
||||||
|
agent met each with its own command, report and wording, and the prose told it what the code didn't hold.
|
||||||
|
|
||||||
|
The model this rule sets:
|
||||||
|
1. One rule type: raea/check's `check()`. A taste line's check, an ask's, raea's own packs and a project's own
|
||||||
|
are the same thing, with the same Finding (its `fix` the number or place that fixes it).
|
||||||
|
2. One contract: `make` on brief.ts. cut, goal, scene, kit and shot are presets of it: each turns its default
|
||||||
|
packs on, and the brief switches any pack and adds its own checks.
|
||||||
|
3. One runner, `raea goal check`, at four moments: edit (the hook after a save), render (every render's end,
|
||||||
|
on a Mac and on a box), publish (raea cloud's publish tool) and done (the Stop hook, raea cloud's stops and
|
||||||
|
delivery). Nothing else decides.
|
||||||
|
4. The guidance is in the rules: a pack's finding says what to change. The prose that said it before is gone.
|
||||||
|
5. What this makes legacy is deleted, not aliased (MK41).
|
||||||
|
|
||||||
|
@needs:MK29
|
||||||
|
Scenario: MK30. One rule type: `check()`, over frames, a story, a delivered file or the job
|
||||||
|
Given raea/check's `check(meta, run, after?)` (sdk/raea/src/check.ts)
|
||||||
|
Then `over` takes "file" and "job" beside "frames", "story" and "both": a job check runs once on the job (its
|
||||||
|
contract, its folder, its deliverables, every file it made); a file check runs once on a delivered file with what
|
||||||
|
is known of it (`FileFacts`: its path, kind, size and length from its own boxes, its render's manifest, its
|
||||||
|
words, its frames as the scene reader saw them, its sound levels, what was seen of it and said), and calls
|
||||||
|
`found` as a frames check does
|
||||||
|
And `at` says the moments it runs at ("edit", "render", "publish", "done"; "done" alone when unset)
|
||||||
|
And `needs` takes what a file check reads that costs: "words" (a transcript), "scene" (people, faces, things,
|
||||||
|
words in the shot), "levels" (short-term loudness), "sheet" (a contact sheet); the runner gets each once a
|
||||||
|
file, on the farm on raea cloud and on the machine elsewhere, and a check whose need can't be met waits and
|
||||||
|
says why, as a "render" need does now
|
||||||
|
And every finding carries `fix` where one is known: "move the out point to 3.45 s", "set its gainDb to 15.0",
|
||||||
|
"move it to left 43 px, top 1402 px (73% down)"
|
||||||
|
And sdk/goal/test/contract.test.ts holds it: a project's own job check, imported into brief.ts, runs at its moments
|
||||||
|
|
||||||
|
@needs:MK30
|
||||||
|
Scenario: MK31. One contract: `goal()`, its presets and its packs
|
||||||
|
Given brief.ts's default export with `goal`
|
||||||
|
Then `goal({ kind, ..., rules, packs, checks })` is the one construct; `cut()`, `rules()`, `scene()`, `kit()` and
|
||||||
|
`shot()` return it with their kind's default packs, and any of them carries `rules` (MK46)
|
||||||
|
And `packs` switches raea's packs by name (`{ surprise: true, place: false }`); a cut of footage has words,
|
||||||
|
sound, frames, place, floor, stills, seen, naming, sizes, count, quotes, open, say, never, cta and shape on,
|
||||||
|
surprise off; a rules goal has deliverables and stills on, and run and says wherever a goal has rules of
|
||||||
|
those; a scene, kit or shot has deliverables, record, critic, notes and stills on; a project with no `goal` is
|
||||||
|
held to the floor: frames, floor, seen and stills
|
||||||
|
And the presets are raea/goal's (sdk/goal, `@raea/goal`), and raea/brief hands them on, so a brief imports one
|
||||||
|
module
|
||||||
|
And `checks` adds the project's own: `checks: [clearOfButtons]`, each a `check()` imported into brief.ts
|
||||||
|
And the person's and the workspace's taste lines and a person's signed asks (raea notes) are rules of the same
|
||||||
|
contract, read where they're kept, never copied into brief.ts
|
||||||
|
And brief.ts is read by importing it (its checks are functions); `raea spec` stays the reader of its data, which
|
||||||
|
Rust still checks against core/brief (`doctor`)
|
||||||
|
And sdk/goal/test/contract.test.ts holds the defaults and the switches
|
||||||
|
|
||||||
|
@needs:MK31
|
||||||
|
Scenario: MK32. One runner: `raea goal check`
|
||||||
|
Given a project folder, with or without brief.ts
|
||||||
|
When `raea goal check [FILE...] [--at edit|render|publish|done] [--json] [--only ID,...]` runs
|
||||||
|
Then raea runs sdk/goal/src/run.ts on its own engine with Node's core (raea_native::js::run_node, which resolves
|
||||||
|
raea/* and @raea/* from sdk/tsconfig.base.json), the same file a box can run with node: it imports brief.ts,
|
||||||
|
picks the rules whose `at` has the moment, runs them over the files the moment names (the files given; at
|
||||||
|
publish and done, every deliverable and every video or still made under out/), and prints each finding with
|
||||||
|
its fix
|
||||||
|
And core/brief's doctor speaks first: Rust reads brief.ts's data as before and hands its lines to the runner
|
||||||
|
And without brief.ts the contract is the floor (frames, floor, seen, stills)
|
||||||
|
And what it found is kept beside each file (FILE.check.json: the moment, the rules run, the findings, when),
|
||||||
|
and the whole run in review/goal.json, which raea cloud and the raea app read
|
||||||
|
And it exits 1 on an error and 2 when it couldn't run (no engine, a brief that doesn't load)
|
||||||
|
And a check whose need this machine can't meet (no scene reader on a Mac without the farm) waits, says why in
|
||||||
|
the report, and holds nothing
|
||||||
|
And sdk/goal/test (cut, goal, make, sound, words, frames, place) holds it, 20 tests
|
||||||
|
|
||||||
|
@needs:MK32
|
||||||
|
Scenario: MK33. Edit: the hook after a save
|
||||||
|
Given an agent with raea's hooks (`raea hook AGENT`)
|
||||||
|
When it saves a composition, brief.ts or a check
|
||||||
|
Then the hook runs `raea goal check FILE --at edit` on a saved composition, or on any file under a brief with a
|
||||||
|
`make` job, and hands back what it found when it fails
|
||||||
|
And the quick check is the stills pack (`at: ["edit"]`), which reads apps/check's three-stills measure; the hook
|
||||||
|
has no path of its own to it
|
||||||
|
|
||||||
|
@needs:MK32
|
||||||
|
Scenario: MK34. Render: every render ends with the render moment
|
||||||
|
Given `raea render EDIT.tsx -o OUT.mp4` on a Mac, on Linux or on a raea cloud box (where the render ran on the
|
||||||
|
farm and the manifest came back whole)
|
||||||
|
When the export is written
|
||||||
|
Then `raea goal check OUT.mp4 --at render` runs on it with its manifest, and its findings end the render's
|
||||||
|
output with the line "fix every ERROR above, then render again" when there's one
|
||||||
|
And on Dutch's cut dutch_angle2_dogroast_gigi_hookb (the box's copy, not in git) it says: an edit point inside a
|
||||||
|
word with the pause to move it to, Gigi's line 15 dB under with the gainDb that evens it, each effect 18 dB
|
||||||
|
under the voice, and the caption over the dog with the clear place under it
|
||||||
|
And the box's offload.ts runs nothing of its own after a render: its words, frames and sound calls are gone
|
||||||
|
|
||||||
|
@needs:MK32
|
||||||
|
Scenario: MK35. Publish: nothing made goes out that fails, or that no one looked at
|
||||||
|
Given raea cloud's publish tool (apps/site/cloud harness/tools/video.ts) and a video the agent made (anything
|
||||||
|
outside media/, which is what it was handed)
|
||||||
|
When the agent publishes it
|
||||||
|
Then the tool runs `raea goal check FILE --at publish` on the box and refuses on an error, quoting each finding
|
||||||
|
with its fix, so a cut that fails can't reach a review
|
||||||
|
And the seen pack holds it until its contact sheet has been shown since its last render (FILE.seen.json: the
|
||||||
|
render's time and size, what the agent said it sees and would change, at least 80 characters), and the
|
||||||
|
surprise pack, when on, until it names its moment in seconds and what it is
|
||||||
|
And on a Mac the same packs hold through `raea goal seen FILE` (the sheet, shown in the raea app with
|
||||||
|
`raea show`) and `raea goal seen FILE "WHAT I SEE AND WOULD CHANGE"`, which write FILE.seen.json; raea cloud's
|
||||||
|
publish tool writes it through the same command
|
||||||
|
And tools/video.ts keeps no check of its own, and its render tool publishes nothing
|
||||||
|
|
||||||
|
@needs:MK32
|
||||||
|
Scenario: MK36. Done: the Stop hook and raea cloud's stops
|
||||||
|
Given the end of an agent's turn, or a raea cloud stop or delivery
|
||||||
|
Then the Stop hook and raea cloud (bot.ts makeIn, make-checks.ts) run `raea goal check --at done --json` and hold
|
||||||
|
on what it says, as they held on `raea make status` before (three blocks with the same list go through, MK2)
|
||||||
|
And at a stop, before the work is finished, the contract must exist and quote the brief; at delivery every rule
|
||||||
|
must pass (make-checks.ts keeps only the mapping of review/goal.json onto raea cloud's checks)
|
||||||
|
And `raea make status` is gone
|
||||||
|
|
||||||
|
@needs:MK30
|
||||||
|
Scenario: MK37. The box's checks are packs: words, sound, frames, place
|
||||||
|
Given sdk/cloud/server's words.ts compare, sound.ts, frames.ts and place.ts (raea #267)
|
||||||
|
Then they are packs in sdk/goal/src/packs/, with their tests (made-up takes; scene reads of three interview
|
||||||
|
frames, boxes only), and the box keeps only `raea words FILE` and the farm's services the runner calls for a
|
||||||
|
need (POST /v1/words, /v1/scene; through fetch under node, through curl on raea's engine)
|
||||||
|
And `raea frames place TAKE` is `raea make place TAKE`, and `raea words FILE` (a transcript, not a check) stays
|
||||||
|
And `raea words check`, `raea frames check` and `raea sound check` are gone
|
||||||
|
|
||||||
|
@needs:MK30
|
||||||
|
Scenario: MK38. Rust's gates are packs: count, quotes, open, say, never, cta, shape, run, file, says
|
||||||
|
Given runtime/cut-plan's and runtime/goal-plan's gates and their tests
|
||||||
|
Then each is a pack in TypeScript with the same tests, and Rust keeps only what reads a brief's data
|
||||||
|
(core/brief: the types, `doctor`) and the scene, kit and shot steps that make things (plan, refs, gen, kit,
|
||||||
|
framing, lenschart, judge)
|
||||||
|
And the scene, kit and shot gates are packs too: deliverables and notes in TypeScript, the record and the
|
||||||
|
critic's rounds reading `raea goal gates --json` (apps/make gates.rs: the record, the parts seen closer than
|
||||||
|
planned, the rounds on the kind's rubric, the make questions), which says when the job ran out of rounds or
|
||||||
|
stalled, and the packs then hold as warnings
|
||||||
|
And `raea goal judge` (a goal's fresh critic) is the runner's, in TypeScript
|
||||||
|
|
||||||
|
@needs:MK30
|
||||||
|
Scenario: MK39. raea cloud's gates are packs: naming, sizes, seen, surprise
|
||||||
|
Given raea cloud's naming check (client_concept_variant_v#_size), its one-size-first rule, the publish gate's look
|
||||||
|
and the surprise asked for after Dutch
|
||||||
|
Then each is a pack: naming and sizes on for a cut, seen on for a cut, surprise off unless the brief turns it on
|
||||||
|
And raea cloud's own copies of them are gone
|
||||||
|
|
||||||
|
@needs:MK31
|
||||||
|
Scenario: MK40. The plan in TypeScript, and raea cloud's queue as rows
|
||||||
|
# Shane 11-29, asked whether raea cloud's stored plans move too: "Cloud too"; then "SQLite rows, no file".
|
||||||
|
Given a project's plan.org (docs/plan.feature), its to-do list in the raea app, `raea make status --plan` (MK3) and
|
||||||
|
each raea cloud agent's stored plan.org (its projects, triggers and settings; GET|PUT /v1/agents/:id/plan.org)
|
||||||
|
Then a project's tasks are its brief's `plan` (MK44), and the raea app's to-do list shows them
|
||||||
|
And raea cloud keeps an agent's projects, triggers and settings as rows in its Account's SQLite, no file: its plan
|
||||||
|
tool answers JSON, and a project's own tasks are its brief's on the box (`raea goal tasks --json`)
|
||||||
|
And a plan.org is moved once, the first time it's read: a folder's by the raea app into plan.ts imported by
|
||||||
|
brief.ts (kept as .raea/plan.org.was), a stored one by raea cloud into rows; @raea/task/from-org is that move and
|
||||||
|
nothing else reads Org
|
||||||
|
And a goal's rule is never copied into it: the list shows each goal's rules and their state from
|
||||||
|
review/goal.json beside the plan's own tasks
|
||||||
|
And sdk/task's Org reader and writer (org.ts), Org's names in the plan spec, the skill and the tools, the
|
||||||
|
/plan.org and /plan.ts routes, raea cloud's plan serializer and MK3's `--plan` are gone
|
||||||
|
|
||||||
|
@needs:MK33 @needs:MK34 @needs:MK35 @needs:MK36 @needs:MK37 @needs:MK38 @needs:MK39 @needs:MK40
|
||||||
|
Scenario: MK41. What this made legacy is deleted, and nothing still points at it
|
||||||
|
Then these are gone, with no alias: `raea make status`, `raea notes check`, `raea words check`, `raea frames
|
||||||
|
check`, `raea sound check`, `raea frames place`, `--plan`, plan.org, the hook's quick path, runtime/cut-plan and
|
||||||
|
runtime/goal-plan, sdk/cloud/server's check code, raea cloud's make-checks logic, publish gate, naming and count
|
||||||
|
checks, and the method paragraphs (RAEA, SOUND, CRAFT, NAMING, SIZES)
|
||||||
|
And `raea check` stays a top-level instrument (MK45): its VIDEO and --quick measures are what the floor and stills
|
||||||
|
packs read, and its taste lines are held by the taste pack (MK47); it never decides done
|
||||||
|
And every project's first message carries one paragraph on the loop: write the contract, work, run
|
||||||
|
`raea goal check`, fix what it names, until it says done
|
||||||
|
And `rg` over raea, raea-platform, raea-skills and raea-feed finds none of the gone names outside this file and
|
||||||
|
the changelog: the skills (skills/raea), the guides (sdk/guides), the manual (docs/manual), the help text,
|
||||||
|
soul.ts, AGENTS.md templates and the box's instructions name only `raea goal check` and its moments
|
||||||
|
And tools/legacy-names.sh is that search, run by CI's gates
|
||||||
|
|
||||||
|
@needs:MK41
|
||||||
|
Scenario: MK42. Released, then Dutch re-cut on it
|
||||||
|
Given the release that carries MK30-MK41 (published when Shane says "publish", docs/release.feature RL5) on the
|
||||||
|
boxes and the farm
|
||||||
|
When Dutch (StreetTalk, project t-ev5errj2) is reopened with a note
|
||||||
|
Then its agent re-cuts all 7, and each passes `raea goal check --at publish` before it reaches the review
|
||||||
|
|
||||||
|
# The composable brief, the goal/make split and workflows (Shane 11-29)
|
||||||
|
|
||||||
|
@needs:MK31
|
||||||
|
Scenario: MK43. brief.ts is the one registered root: every raea file is reached from it, compiled and run
|
||||||
|
# Shane 11-29: "a registered brief file (a typescript file) that has any rules or task or anything is completely
|
||||||
|
# composable and if it is written it is compiled and run. there should be no way to make a file using the sdk and
|
||||||
|
# then it just doesn't get used." And: "make sure all other sdks like the check and story sdk are all covered".
|
||||||
|
Given a project's brief.ts and the files beside it
|
||||||
|
Then raea runs brief.ts (and taste.ts) once, and what it says is the value that run gives; nothing reads a
|
||||||
|
project's TypeScript as text to learn what it says
|
||||||
|
And a file is reached through the static imports of a reached file, or when a value the brief or the taste gives
|
||||||
|
names its path ("compositions/shots.tsx", a deliverable's script, a taste line's check, `bun test tests/` in a
|
||||||
|
rule: a folder named reaches every file in it); a folder with its own brief.ts is its own project
|
||||||
|
And every file that imports raea (raea, raea/*, @raea/*) and is reached by nothing is said by the `registered`
|
||||||
|
check at every moment, a warning at edit and render, an error at publish and done: script, story, check, parts,
|
||||||
|
task, composition and component files alike, none an outlier
|
||||||
|
And a brief that throws is said with its file and line, and nothing is edited while it does
|
||||||
|
And sdk/goal/test/tasks.test.ts holds it: a composition named in the goal and the component it imports pass; a
|
||||||
|
test composition nothing names is said; an import in a comment imports nothing
|
||||||
|
|
||||||
|
@needs:MK43
|
||||||
|
Scenario: MK44. Tasks are the brief's `plan`, read from its run and written back where each is written
|
||||||
|
# Shane 11-29: tasks "Either, composed freely"; "no drift between desktop and cloud methods or skills".
|
||||||
|
Given a brief.ts with `plan`: inline, `import plan from "./plan.ts"`, or built from modules of its own
|
||||||
|
Then `raea goal tasks [DIR] [--json]` reads the plan from the brief's run, and `--apply EDITS.json|-` applies edits
|
||||||
|
by task id (sdk/task PlanEdit) to that value and writes each into the literal that writes it (sdk/task
|
||||||
|
source.ts): the whole plan where it's plain values, else each changed task where it's written
|
||||||
|
And a task made by code (a .map, a spread, a variable) is refused, naming its file and line; nothing is written
|
||||||
|
And a project with no plan gets plan.ts, and brief.ts imports it and gives it to the brief as `plan`
|
||||||
|
And the raea app's feed host, an agent's plan tools and raea cloud's box all run `raea goal tasks`: one path
|
||||||
|
And sdk/task/test/source.test.ts and sdk/goal/test/tasks.test.ts hold it
|
||||||
|
|
||||||
|
Scenario: MK45. `raea goal` is the loop, `raea make` the asset tools, the instruments top-level
|
||||||
|
Then `raea goal check|tasks|seen|judge|gates|next` is the loop: plan, run, check, done (sdk/goal, `raea/goal`;
|
||||||
|
brief.ts's `goal`)
|
||||||
|
And `raea make` is making a finished asset: `make clothes`, `make motion`, `make solid`, `make wear`, `make splat`,
|
||||||
|
`make physics`, `make bake`, `make sao`, `make tokensynth`, `make sounds`, `make component`, and a scene, kit
|
||||||
|
or shot goal's steps (`make blockout|refs|gen|pick-sheet|pick|prep|kit|framing|lenschart|place`)
|
||||||
|
And the instruments stay top-level, shared by every goal: `check`, `world`, `ask`, `judge`, `findings`, `scene`,
|
||||||
|
`media`, `words`, `song`, `track`; they measure and never decide done
|
||||||
|
And an old name is refused with where it went (`raea make check` is now `raea goal check`; `raea clothes` is now
|
||||||
|
`raea make clothes`; `raea make plan` is now `raea make blockout`; `raea next` is now `raea goal next`; `raea
|
||||||
|
part` is gone), never run under it
|
||||||
|
And docs/make.feature is this file, and the help, the manual, the guides and the skill teach only the new names
|
||||||
|
|
||||||
|
@needs:MK31
|
||||||
|
Scenario: MK46. Goals and workflows: one goal is one step
|
||||||
|
Given brief.ts's `goal`: one goal, or a list
|
||||||
|
Then each goal has a `name` (its kind's when left out), the workflow `step` it serves, the goals it comes `after`,
|
||||||
|
an `aim` in the person's words and its own `rules`, and is checked alone: `raea goal check` reports each goal's
|
||||||
|
verdict and the whole's, `--goal NAME` checks one, and the Stop hook names the goals still open
|
||||||
|
And a list is a workflow inline; a shared one is a `workflow({ name, steps })` module the brief imports (so it's
|
||||||
|
registered and run), and a brief can be one step of a bigger workflow by naming its step
|
||||||
|
And raea cloud's workflows are the same module, read on the box, so a workflow means one thing on the desktop
|
||||||
|
and in the cloud: a workflow project's agent steps are written into its folder as workflow.ts on its first run
|
||||||
|
(each a `rules()` goal named for its step, `after` the one before, its checks `says` rules), brief.ts imports it
|
||||||
|
as its `goal`, and each stop is held to the goals of the steps it shows (raea-platform steps.ts workflowModule,
|
||||||
|
goal-checks.ts stepGoalChecks)
|
||||||
|
And core/brief's doctor says a name given twice and an `after` naming no goal
|
||||||
|
And core/brief tests and sdk/goal/test/contract.test.ts hold it
|
||||||
|
|
||||||
|
@needs:MK43 @needs:MK45
|
||||||
|
Scenario: MK47. Every rule a project registers runs inside the loop
|
||||||
|
Given taste lines (the person's, the workspace's, the project's) with checks, and a person's signed asks (raea notes)
|
||||||
|
Then the taste pack runs them through `raea check`'s rules at the moments they name, and their findings are the
|
||||||
|
goal check's, so no registered rule runs only when an agent remembers an instrument
|
||||||
|
And the story SDK's checks (raea/story `storyCheck`) are taste-line checks or a goal's `checks`, never a file of
|
||||||
|
their own that nothing runs
|
||||||
|
|
||||||
|
|
||||||
|
Rule: The cut, read as an editor reads it (Shane, 11-29: Kuleshov, Eisenstein's methods of montage, Murch's Rule of Six)
|
||||||
|
# A cut's meaning lives between its shots: Kuleshov's neutral face read as hunger, grief or desire by what it was cut
|
||||||
|
# against (the original footage is lost and the one study with data is small; Mobbs et al., 2006, found the effect
|
||||||
|
# in fMRI), Eisenstein's collision of shots, Murch's six reasons for a cut weighed emotion 51%, story 23%, rhythm
|
||||||
|
# 10%, eye trace 7%, the screen's plane 5%, its 3D space 4%, given up from the bottom. Murch's weights are his
|
||||||
|
# judgment, not measurements: raea uses them as an order, never as a score. The story SDK says what a piece is
|
||||||
|
# about; these say what each cut does to it. Status 11-29: built in raea #269 (sdk/goal packs/montage.ts,
|
||||||
|
# test/montage.test.ts; core/brief cut.rs Beat).
|
||||||
|
|
||||||
|
Scenario: MK48. A cut plan's beats say what each part must make the viewer feel and understand, before it's cut
|
||||||
|
Given a cut goal's plan (`cut({ cuts: [{ id, beats: [...] }] })`)
|
||||||
|
Then each beat has `at` (seconds from the cut's start, the first at 0, in order) and `feel` in the person's words,
|
||||||
|
and may say `story` (what the viewer understands by its end), `asl` (its average shot length in seconds) and
|
||||||
|
`tempo` ("build": shots shorter as it goes, "release": longer, "hold": even)
|
||||||
|
And core/brief's doctor says a beat out of order, one with no feel, a tempo that isn't one of the three and an asl
|
||||||
|
that isn't above 0
|
||||||
|
And Dutch's cuts fail today: none says what any of its parts should make anyone feel
|
||||||
|
|
||||||
|
Scenario: MK49. Emotion and story are judged on the cut in sequence, by a fresh critic
|
||||||
|
Given a cut goal whose plans have beats
|
||||||
|
Then each beat is a `says` rule (`beat_<cut>_<n>`, contract.ts saysOf): "in out/cuts/<cut>_<W>x<H>.mp4, from A s
|
||||||
|
to B s, watched in sequence as cut, the viewer feels <feel>, and by its end understands <story>", judged by
|
||||||
|
`raea goal judge` with the goal's own `says` rules and held by the says pack at done
|
||||||
|
And it's asked of the shots as cut, never one by one: what a shot means comes from its neighbours (Kuleshov)
|
||||||
|
And no measure stands in for them: they're Murch's top two, 74% of his weight
|
||||||
|
|
||||||
|
Scenario: MK50. Each beat's pace is its plan (Eisenstein's metric montage)
|
||||||
|
Given a delivered cut whose plan's beats say `asl` or `tempo`
|
||||||
|
Then the montage pack finds its hard cuts in its own frames (one ffmpeg pass, 48 pixels wide) and, for each beat,
|
||||||
|
its shots must average within a third of its asl, and a build's shot lengths must shorten (Kendall's tau under
|
||||||
|
-0.2), a release's lengthen (over 0.2), with three shots or more; each miss is an error naming the beat's feel,
|
||||||
|
the lengths it has and which way to go
|
||||||
|
And sdk/goal/test/montage.test.ts holds it
|
||||||
|
|
||||||
|
Scenario: MK51. Eye trace, screen direction and tone across every cut, in Murch's order
|
||||||
|
Given any delivered cut (`packs: { montage: false }` switches it off)
|
||||||
|
Then at each cut: the focal point on the two sides (the largest face the scene reader finds, else where the
|
||||||
|
frame's contrast gathers) more than 0.4 of the frame's diagonal apart is an eye-trace warning; sideways motion
|
||||||
|
on both sides (over 0.15 widths a second) in opposite directions is a screen-direction warning; a jump in
|
||||||
|
brightness over 0.25 or warmth over 0.08 where no beat starts is a tonal warning
|
||||||
|
And each finding names its Murch weight, so a fix never gives up a higher reason for a lower one
|
||||||
|
And one of them broken at more than half a file's cuts is an error: a habit of the cut, not a choice
|
||||||
|
And a cut on a word stays the sound pack's (edit-on-sound), so no rule is held twice
|
||||||
@@ -182,7 +182,7 @@ Feature: img2raea: a picture made into raea objects, props, environments and sce
|
|||||||
| layout | the ground and walls as planes, so things stand on them | planes fitted to the point map (RANSAC) |
|
| layout | the ground and walls as planes, so things stand on them | planes fitted to the point map (RANSAC) |
|
||||||
| things | a mask and a name for each thing | SAM 2.1 (Apache-2.0), OWLv2 (Apache-2.0) |
|
| things | a mask and a name for each thing | SAM 2.1 (Apache-2.0), OWLv2 (Apache-2.0) |
|
||||||
| props | each thing as a part at its depth and size | img2raea (IR8), or an image-to-3D model |
|
| props | each thing as a part at its depth and size | img2raea (IR8), or an image-to-3D model |
|
||||||
| far away | what has no depth worth building: a panorama or splat behind | <Environment>, <Splat> (raea splat) |
|
| far away | what has no depth worth building: a panorama or splat behind | <Environment>, <Splat> (raea make splat) |
|
||||||
| light | the sun's and sky's direction and colour, then exposure | the picture's shading; systems/light-meter |
|
| light | the sun's and sky's direction and colour, then exposure | the picture's shading; systems/light-meter |
|
||||||
| contact | nothing floats, sinks or clips | `raea scene lint` |
|
| contact | nothing floats, sinks or clips | `raea scene lint` |
|
||||||
And what can be made procedurally is: terrain, rocks and trees by core/grow, grass by systems/grass, floors and
|
And what can be made procedurally is: terrain, rocks and trees by core/grow, grass by systems/grass, floors and
|
||||||
|
|||||||
+6
-6
@@ -4,13 +4,13 @@ Feature: One project layout: compositions, components, assets, artifacts; and th
|
|||||||
having a library that any project can call upon from those global folders." On naming: "just make sure it doesn't
|
having a library that any project can call upon from those global folders." On naming: "just make sure it doesn't
|
||||||
get confused with our other concept of libraries" (docs/libraries.feature: indexed media, `raea library`), so the
|
get confused with our other concept of libraries" (docs/libraries.feature: indexed media, `raea library`), so the
|
||||||
workspace's folder is shared/ and its import prefix @shared/. Existing projects move with a command, reviewed
|
workspace's folder is shared/ and its import prefix @shared/. Existing projects move with a command, reviewed
|
||||||
before they land; `raea part` becomes `raea component`.
|
before they land; `raea part` becomes `raea make component`.
|
||||||
|
|
||||||
Read 11-12, before any change:
|
Read 11-12, before any change:
|
||||||
- `raea project new` (apps/workspace/src/workspace.rs new_project) makes brief.ts, AGENTS.md, media/, brand/, out/.
|
- `raea project new` (apps/workspace/src/workspace.rs new_project) makes brief.ts, AGENTS.md, media/, brand/, out/.
|
||||||
Compositions and components are loose .tsx at the project's root, told apart by `raea project scan` (PJ8).
|
Compositions and components are loose .tsx at the project's root, told apart by `raea project scan` (PJ8).
|
||||||
- Agents made parts/ by hand in stay and orientation (scene pieces); nothing scaffolds it. "Parts" is otherwise
|
- Agents made parts/ by hand in stay and orientation (scene pieces); nothing scaffolds it. "Parts" is otherwise
|
||||||
raea's own sets: `raea part add reel` copies examples/parts/reel into components/reel/ (engine/cli index.ts,
|
raea's own sets: `raea make component add reel` copies examples/parts/reel into components/reel/ (engine/cli index.ts,
|
||||||
registry.gen.ts from tools/pack.ts).
|
registry.gen.ts from tools/pack.ts).
|
||||||
- The workspace root has controllers/ (PJ2) and artifacts/; 11-07 (docs/organize.md) made controllers per project.
|
- The workspace root has controllers/ (PJ2) and artifacts/; 11-07 (docs/organize.md) made controllers per project.
|
||||||
- The engine's loader (engine/modules resolve) takes relative imports inside the space and prebuilt libraries by
|
- The engine's loader (engine/modules resolve) takes relative imports inside the space and prebuilt libraries by
|
||||||
@@ -19,7 +19,7 @@ Feature: One project layout: compositions, components, assets, artifacts; and th
|
|||||||
|
|
||||||
Built 11-12 (lane layout): LY1 (raea project new and workspace init make the folders, .gitattributes, AGENTS.md
|
Built 11-12 (lane layout): LY1 (raea project new and workspace init make the folders, .gitattributes, AGENTS.md
|
||||||
and the @shared/ tsconfig), LY2 (the loader resolves @shared/, PJ8's lint takes it), LY3's scan and lint and
|
and the @shared/ tsconfig), LY2 (the loader resolves @shared/, PJ8's lint takes it), LY3's scan and lint and
|
||||||
controllers over shared/controllers/, and LY4's `raea component` (`raea part` still answers). Still to do: LY3's
|
controllers over shared/controllers/, and LY4's `raea make component` (`raea part` still answers). Still to do: LY3's
|
||||||
app pages (Compositions, Controllers, Source), LY4's examples/components rename and the guides and skill wording,
|
app pages (Compositions, Controllers, Source), LY4's examples/components rename and the guides and skill wording,
|
||||||
LY5 (`raea project tidy`), LY6.
|
LY5 (`raea project tidy`), LY6.
|
||||||
|
|
||||||
@@ -73,11 +73,11 @@ Feature: One project layout: compositions, components, assets, artifacts; and th
|
|||||||
And Source's Assets tab lists assets/ (and shared/assets/), and its Artifacts tab artifacts/ (and shared/artifacts/)
|
And Source's Assets tab lists assets/ (and shared/assets/), and its Artifacts tab artifacts/ (and shared/artifacts/)
|
||||||
And an agent's feed_post of an artifact writes it to the project's artifacts/
|
And an agent's feed_post of an artifact writes it to the project's artifacts/
|
||||||
|
|
||||||
Scenario: LY4. `raea component` replaces `raea part`
|
Scenario: LY4. `raea make component` replaces `raea part`
|
||||||
When `raea component list` or `raea component add reel [--shared]` runs
|
When `raea make component list` or `raea make component add reel [--shared]` runs
|
||||||
Then it lists and copies raea's sets as `raea part` did, into components/<set>/ (or shared/components/<set>/)
|
Then it lists and copies raea's sets as `raea part` did, into components/<set>/ (or shared/components/<set>/)
|
||||||
And examples/parts is examples/components, and registry.gen.ts is packed from it
|
And examples/parts is examples/components, and registry.gen.ts is packed from it
|
||||||
And `raea part ...` still works for this release, saying once that it's `raea component` now
|
And `raea part ...` still works for this release, saying once that it's `raea make component` now
|
||||||
And the guides, the raea skill and AGENTS.md say components, never parts
|
And the guides, the raea skill and AGENTS.md say components, never parts
|
||||||
|
|
||||||
Scenario: LY5. An existing project moves into the layout with one command
|
Scenario: LY5. An existing project moves into the layout with one command
|
||||||
|
|||||||
@@ -1,337 +0,0 @@
|
|||||||
@spec
|
|
||||||
Feature: Make: scenes, kits and shots built to a frozen plan and held to a review loop the agent can't skip
|
|
||||||
Shane, 2026-11-23, after a deep dive into apekshik's AnyScene, AnyKit and AnyShot (github.com/apekshik, MIT): "lets
|
|
||||||
take all three learn form them and adopt that review loop internally wholesale. i think this is ley for us. all 11
|
|
||||||
points seem relevant to adopt or itnegrate intoexisting systems, or converting into a typescript planning and review
|
|
||||||
sdk as part of it". Decided the same day: the contract goes on brief.ts; the gate uses `raea ask`; internal and cloud
|
|
||||||
are built together. Plan: ~/.claude/plans/dreamy-floating-dijkstra-of-771a18a0-2207-4b03-80e7-ddbec117bc80.md.
|
|
||||||
|
|
||||||
What the three repos showed (their builder/CRAFT.md and agent/KIT.md say it outright): the quality came from a loop,
|
|
||||||
not a model or a setting. Render it and look; name the problem precisely; fix it in a script so a rebuild keeps it;
|
|
||||||
check the fix from a view that shows it (a camera 30 cm off the floor shows a floating chair a wide shot hides); get
|
|
||||||
an independent critic, because the builder stops seeing its own flaws. And a Stop hook that won't let the agent end
|
|
||||||
until every deliverable exists and the critic passes, with a cap and a stall rule so it can't loop forever.
|
|
||||||
|
|
||||||
The model this file sets:
|
|
||||||
1. One loop, three kinds of job: a scene (a dressed, lit place from references or a brief), a kit (a set of props
|
|
||||||
that belong together, from style references) and a shot (stills or camera moves of a built scene, from words).
|
|
||||||
2. The plan is the contract: `make` on the project's brief.ts (core/brief make.rs), typed from Rust, written by the
|
|
||||||
agent before it builds, and read by Rust. Every object carries its real size and whether it came from the
|
|
||||||
reference or was invented; every dial its value, where the value came from, and what it meant here.
|
|
||||||
3. Done is decided in code (`raea make status`), never by the agent saying so, and enforced where the agent stops:
|
|
||||||
the Stop hook of every agent raea installs hooks for, locally and on raea cloud.
|
|
||||||
4. Three tiers of gate, each gating once it has earned it: measured checks always; `raea ask` questions one by one,
|
|
||||||
once each is calibrated on the person's labels; a fresh critic's fixes always (fixed or answered), its score
|
|
||||||
once `raea judge calibrate` agrees with the person's eye.
|
|
||||||
5. Every job ends with its notes, including what the skill got wrong for it, so the next job starts from them.
|
|
||||||
6. Every object is planned at a level of detail, by how large it is meant to be seen, and every render says
|
|
||||||
when a shot shows one closer than that (MK21-MK24).
|
|
||||||
|
|
||||||
Background:
|
|
||||||
Given raea's scene loop as advice (sdk/guides/craft/bevy/scenes.md, from the 11-06 research): brief, routing,
|
|
||||||
build big to small, `raea render --review` (hero, front, right, top, iso and low cameras in colour and clay;
|
|
||||||
core/review), `raea judge` (frozen rubric; clef, kimi or claude; pass, done, stall in code; apps/judge),
|
|
||||||
`raea scene lint` (raea-sys-contact) and `raea gen check`
|
|
||||||
And `raea ask` (docs/ask.feature): typed clef questions with a ledger that calibrates each question on labels
|
|
||||||
And the raea plugin's hooks (skills/skills/hooks/hooks.json -> `raea hook claude`, apps/check hook.rs), whose Stop
|
|
||||||
branch already blocks a turn's end to hand over what the person sent from the app
|
|
||||||
And the project's record (.raea/record/, core/facts record.rs): what each render and check found, and when
|
|
||||||
|
|
||||||
Rule: the plan and done (MK0-MK3)
|
|
||||||
|
|
||||||
|
|
||||||
@done
|
|
||||||
Scenario: MK0. The contract: `make` on brief.ts
|
|
||||||
Given a brief.ts whose default export has `make: kit({...})`, `scene({...})` or `shot({...})` (raea/brief)
|
|
||||||
Then core/brief reads it as `Make`: its kind, references, style (one paragraph: era, palette, materials, wear and
|
|
||||||
one fictional maker), dials, objects, shots, deliverables and a round cap (8 by default)
|
|
||||||
And each object has an id, a label, one size (`h`, `dims` [w, d, h] or `max` for things that lie flat), a route
|
|
||||||
(solid, rule, gen, library, picture), a prompt, `source` (reference or invented), a `crop` in reference 0, a
|
|
||||||
place (x, y, z, rot) for a scene, the generator it was picked from and why, and the fixes made by script
|
|
||||||
And each dial is `{ value, source: customer | reference, means }`, from its kind's set (scene: density, tidiness,
|
|
||||||
wear, wetness, time_of_day, weather, atmosphere, power, warmth, look; kit: count, variety, detail, wear,
|
|
||||||
wetness, warmth, look; shot: res, seconds, lens, handheld, look)
|
|
||||||
And the TypeScript is generated from those types (sdk/raea/src/brief.gen.ts), so tsc checks what Rust reads
|
|
||||||
And `doctor` names what the plan still lacks: no objects, an object with no size or no route, a dial outside its
|
|
||||||
kind's set, a generated object with no prompt
|
|
||||||
|
|
||||||
@needs:MK0 @done
|
|
||||||
Scenario: MK1. `raea make status`: what's missing, decided in code
|
|
||||||
Given a project whose brief has `make`
|
|
||||||
When `raea make status [DIR] [--json]` runs
|
|
||||||
Then it lists what's missing for the kind:
|
|
||||||
| kind | deliverables (under out/, overridable with `deliverables`) |
|
|
||||||
| scene | stills/ with 3 or more pictures |
|
|
||||||
| kit | kit/<id>/<id>.glb, kit/<id>/<id>_lod1.glb and kit/thumbs/<id>.png per object, kit/lineup.png, kit/kit.json |
|
|
||||||
| shot | shots/<name>.png or shots/<name>.mp4 per shot |
|
|
||||||
And NOTES.md beside the brief, with a "What the skill got wrong" section
|
|
||||||
And each gate's state: the record's last render or check of every composition the plan names is newer than the
|
|
||||||
file and found no error; the critic has judged a round newer than the newest deliverable; each blocking defect
|
|
||||||
of that round is fixed (the round passed) or answered in NOTES.md by its id
|
|
||||||
And the judge's rounds, passes in a row and stall, read from review/judge.log.jsonl as `raea judge` keeps them
|
|
||||||
And `done` is true when nothing is missing and every gate is clear, and also when the job is capped (its rounds
|
|
||||||
reached the cap) or stalled; a capped or stalled job is delivered short, with what's missing listed
|
|
||||||
|
|
||||||
@needs:MK1 @done
|
|
||||||
Scenario: MK2. The Stop hook: the agent can't end a job that isn't done
|
|
||||||
Given an agent session (Claude Code, codex, gemini, kimi) with raea's hooks, in a project whose brief has `make`
|
|
||||||
When its turn is about to end and `raea make status` isn't done
|
|
||||||
Then the hook blocks the stop with "Not done:" and what's missing, and the agent keeps going
|
|
||||||
And a session blocked three times with the same list goes through (the agent is going in circles; the status
|
|
||||||
says so), as PL7's keeper stops after asks that change nothing
|
|
||||||
And a project without `make` is never blocked, and a brief that doesn't load blocks nothing (the hook says why)
|
|
||||||
|
|
||||||
@needs:MK2 @done
|
|
||||||
Scenario: MK3. Gates in plan.org
|
|
||||||
Given the project's plan.org (docs/plan.feature)
|
|
||||||
Then `raea make status --plan` writes each gate as a check line under the job's task (sdk/task `setCheck`), so
|
|
||||||
the person, the app and the cloud see the same list the hook holds the agent to
|
|
||||||
|
|
||||||
Rule: the three tiers of gate (MK4-MK6)
|
|
||||||
|
|
||||||
@needs:MK1 @done
|
|
||||||
Scenario: MK4. Defects as calibrated ask questions
|
|
||||||
Given the judge's yes/no defects (apps/judge rubric.rs: floating, intersecting, blobby, stand_in, clones,
|
|
||||||
flat_colour, plastic, ...) and the loop's own (a cohesion outlier on a reference sheet, a real brand, garbled
|
|
||||||
hero text, a disconnected assembly, opaque glass, a camera through a wall)
|
|
||||||
Then each is an ask question with versioned words (core/ask), answered on the gate's sheet and kept in the ledger
|
|
||||||
And it gates once `raea ask calibrate` passes it on the person's labels (16 problem, 16 clean, held-out AUC 0.8);
|
|
||||||
until then its answer shows in the status as advice
|
|
||||||
|
|
||||||
@needs:MK1 @done
|
|
||||||
Scenario: MK5. A rubric per kind for the fresh critic
|
|
||||||
Then `raea judge --kind scene|kit|shot` asks the kind's categories (scene: layout, props, screens and signage,
|
|
||||||
materials, light, atmosphere, plausibility, composition; kit: cohesion, reference fidelity, brief, mesh,
|
|
||||||
texture, assembly, scale, labels; shot: framing, move, focus, clearance, continuity, grade)
|
|
||||||
And the critic is told the bar is a production base an artist then refines, judged at normal viewing distance,
|
|
||||||
no points off for choices that differ from the reference, at most five fixes, most damaging first
|
|
||||||
|
|
||||||
@needs:MK5 @done
|
|
||||||
Scenario: MK6. The critic's score gates once it is calibrated
|
|
||||||
Given `raea judge calibrate` reporting agreement with the person's eye for a kind
|
|
||||||
Then that kind's jobs also need two fresh passes in a row to be done; before that, fixed-or-answered is enough
|
|
||||||
|
|
||||||
Rule: measured placement (MK7-MK9)
|
|
||||||
|
|
||||||
@done
|
|
||||||
Scenario: MK7. Grounding at contact points
|
|
||||||
Given a part whose box bottom isn't where it touches down (splayed feet, a handle, an origin offset)
|
|
||||||
Then `raea scene lint` casts rays down from its lowest vertices (its feet), ignoring itself, volumes and decals,
|
|
||||||
and reports `floats` (the gap, and a `{y, dy}` fix that settles it down) or `sunk` (a fix that raises it);
|
|
||||||
a part whose feet reach nothing reads as mounted (a wall or ceiling holds it) or as a warning in the air, so
|
|
||||||
signs, pendants and lamps on cords aren't errors; a stool whose box clips a table's edge rests by its feet
|
|
||||||
|
|
||||||
@done
|
|
||||||
Scenario: MK8. The clip check, for every level
|
|
||||||
Then `raea scene lint` (raea-sys-contact) reports clips with their depth and the move that clears them
|
|
||||||
(`{part, axis, by}`), and faces z-fighting: two parts' faces in one plane over each other (an error from
|
|
||||||
1 cm², a warning under), and doubled faces inside one model (a warning), on every lint, no flag needed
|
|
||||||
|
|
||||||
@done
|
|
||||||
Scenario: MK9. Re-drop after every move
|
|
||||||
Then a part moved sideways by a clip's fix is settled onto what's under its new place in the same pass (the fix
|
|
||||||
carries its `dy`), and a stool under a table rests on the floor by its feet, so nothing hovers at table height
|
|
||||||
|
|
||||||
Rule: kits (MK10-MK13)
|
|
||||||
|
|
||||||
@needs:MK1 @done
|
|
||||||
Scenario: MK10. References made in one style, checked on one sheet
|
|
||||||
Then `raea make refs` makes each object's reference with `raea gen image` with the style images as input, the
|
|
||||||
plan's style paragraph and the scan template (`--dry` quotes it), and writes review/refs.png (`raea make sheet
|
|
||||||
refs` again): the style images, then every reference labelled with its size, before any 3D
|
|
||||||
And outliers (another style, a real brand, cropped, two objects) are regenerated first: the cheapest place to fix
|
|
||||||
cohesion
|
|
||||||
|
|
||||||
@needs:MK10 @done
|
|
||||||
Scenario: MK11. Both generators, picked on clay
|
|
||||||
Then `raea make gen` sends every reference to Tripo H3.1 (face limit 150k heroes, 60k small) and Meshy (fal),
|
|
||||||
`raea make pick-sheet` fits both to size and renders reference | Tripo | Tripo clay | Meshy | Meshy clay under
|
|
||||||
one light (review/picks.png), and `raea make pick ID tripo|meshy "why"` records the pick and its one-line why (the earlier ~150 props: Meshy ~70%, small items and printed labels; Tripo the big
|
|
||||||
hard-surface heroes)
|
|
||||||
|
|
||||||
@needs:MK11 @done
|
|
||||||
Scenario: MK12. Prep and LOD
|
|
||||||
Then `raea make prep` fits each pick with `raea gen check -o` (front +z, real metres, bottom-centre) and writes a
|
|
||||||
quarter-triangle ID_lod1.glb (blender/decimate.py), each with its .glb.json saying how it was made
|
|
||||||
|
|
||||||
@needs:MK12 @done
|
|
||||||
Scenario: MK13. A kit is a component set
|
|
||||||
Then `raea make kit` lands it in shared/components/<kit>/ (one component per object importing its model and LOD
|
|
||||||
from beside it: compositions import .glb files as their path), with lineup.tsx (a 1 m bar, labels), cover.png,
|
|
||||||
thumbnails and kit.json, and the job's own out/kit/ record that `raea make status` counts
|
|
||||||
|
|
||||||
Rule: shots (MK14-MK17)
|
|
||||||
|
|
||||||
@done
|
|
||||||
Scenario: MK14. Camera moves, focus and the handheld walk
|
|
||||||
Then raea/camera has static, dolly, truck, pedestal, crane, pan, tilt, orbit, dollyZoom (the lens solved per
|
|
||||||
frame to hold the subject) and path (Catmull-Rom), focus track, point and rack with holds, and
|
|
||||||
`handheld({ profile: "walk" })`: steps at 1.8 Hz, an aim on a spring, small reframes, nothing above 1.9 Hz
|
|
||||||
|
|
||||||
@needs:MK14 @done
|
|
||||||
Scenario: MK15. Blocking: framing sheets and a lens chart
|
|
||||||
Then `raea make framing` renders each shot's first, middle and last frame (`raea render --at`) onto
|
|
||||||
review/framing.png, a row a shot stamped with its name and time, and `raea make lenschart SHOT` its first frame
|
|
||||||
at 18, 24, 35, 50, 85 and 135 mm (RAEA_LENS keeps the scene's camera and sets its lens)
|
|
||||||
|
|
||||||
@needs:MK14 @done
|
|
||||||
Scenario: MK16. Clearance on every frame
|
|
||||||
Then `raea scene stage --clearance 0.45` finds every run of frames where the camera is nearer a solid than that
|
|
||||||
(a box first, a model's triangles when its box comes close; inside a part said so), leaving out volumes,
|
|
||||||
particles, decals, see-through parts (glass) and anything under 5 cm
|
|
||||||
|
|
||||||
@needs:MK14 @done
|
|
||||||
Scenario: MK17. Shots from words and from a floor plan
|
|
||||||
Then the shot-language guide (bevy/shots) maps a crew's words to moves (push in, truck, reveal, rack focus,
|
|
||||||
walkthrough at 0.4-0.6 m/s and 1.5-1.7 m); a path drawn on `raea make plan`'s floor plan (its metres, x right,
|
|
||||||
z away from the entrance) is `walkPath(points)`: an even walking pace at eye height, corners rounded; grade looks
|
|
||||||
(clean, cinematic, gritty, vintage) are `gradeLook()` presets in raea/post_process
|
|
||||||
|
|
||||||
Rule: the plan, drawn (MK18)
|
|
||||||
|
|
||||||
@needs:MK0 @done
|
|
||||||
Scenario: MK18. `raea make plan`: a floor plan, a grey box and a comparison
|
|
||||||
Then it draws review/plan/floor-plan.png (every placed object's footprint turned by its rot and labelled with its
|
|
||||||
height, invented ones dashed, a metre grid, the entrance the camera looks in from), renders a grey box of the
|
|
||||||
plan from the entrance (blockout.tsx, and `raea render --review` sheets of it) and puts the reference, the
|
|
||||||
blockout and the floor plan on comparison.png, for the person to approve before anything is generated
|
|
||||||
|
|
||||||
Rule: planned detail (MK21-MK24)
|
|
||||||
Shane, 2026-11-24: "define objects at an LOD level based on either us grayboxing or thinking of them as generally
|
|
||||||
distant objects and alert agents when an LOD that was at 3 or 4 for example is now appearing in frame at LOD 2
|
|
||||||
level or 1, or 0 ... helpful for planning objects as generally distant and unseen objects versus close ones and
|
|
||||||
knowing if we forgot about something over time". A level is how large a part is planned to be seen, which is how
|
|
||||||
much of it gets built; the frames are measured against it on every render, so a camera move added later, or a
|
|
||||||
box that was meant to be replaced, is said the next time anything is drawn.
|
|
||||||
|
|
||||||
@done
|
|
||||||
Scenario: MK21. A part shown closer than its planned detail is said
|
|
||||||
Given a level is how much of the frame a part's box spans through the frame's camera, the larger of its width's
|
|
||||||
and its height's share: 0 the hero (50% or more), 1 featured (20%), 2 dressing (8%), 3 background (2%), 4 far
|
|
||||||
And a part's plan is its own `lod` (Mesh3d, Model, and every part inside an Entity with a transform or a Group
|
|
||||||
that has one), else the `lod` of the plan's object of its name
|
|
||||||
When a frame shows a planned part at a finer level than its plan (raea-runtime-lod-plan)
|
|
||||||
Then the render's end checks, `raea scene stage` and `raea check --quick` say `lod-closer`: the part, its plan,
|
|
||||||
the level it is seen at, how much of the frame it spans at its largest and on which frame, how many frames it
|
|
||||||
is closer on, and the fix (build it for that level and plan it there, or keep the camera off it)
|
|
||||||
And one level finer is a warning, two or more an error, which fails the render as any error does
|
|
||||||
And a part out of the frame, behind the camera, or with another mesh's box across every line to it isn't seen;
|
|
||||||
a part the camera stands in or beside is measured at its nearest point; RAEA_LOD_CHECK=0 leaves the check out
|
|
||||||
|
|
||||||
@needs:MK21 @done
|
|
||||||
Scenario: MK22. The plan carries each object's level
|
|
||||||
Given `lod: 0..4` on an object of `make` in brief.ts (core/brief make.rs; `doctor` refuses a level past 4)
|
|
||||||
Then a render of a composition under that brief holds the parts named as the objects' ids to those levels
|
|
||||||
(runtime/lod-plan plan.rs reads the brief only when its words plan a level, once a version)
|
|
||||||
And `raea make plan` labels each footprint with its level and writes each grey box with its object's id as its
|
|
||||||
name and its `lod`, so the blockout is held to the plan it draws
|
|
||||||
|
|
||||||
@needs:MK21 @done
|
|
||||||
Scenario: MK23. `raea scene lod`: every part's plan beside what the frames show
|
|
||||||
When `raea scene lod EDIT.tsx [--from N] [--to N] [--json]` steps the frames without drawing
|
|
||||||
Then it lists every part: its planned level, the finest level a frame shows it at, how much of the frame it
|
|
||||||
spans there, on which frame, and how many frames it is in; parts seen closer than planned first (the widest
|
|
||||||
gap on top), then the rest of the planned, then the parts with no plan by how large they get
|
|
||||||
And a planned part no frame shows as close as its plan says so (built finer than it is ever seen)
|
|
||||||
And a level the plan gives a name that no part in the frames goes by is listed, since it holds nothing
|
|
||||||
And it exits 1 when a part is seen two or more levels finer than planned
|
|
||||||
|
|
||||||
@needs:MK22 @done
|
|
||||||
Scenario: MK24. A job is held at a part seen closer than planned
|
|
||||||
Given a job whose composition's last render or check found `lod-closer`
|
|
||||||
Then `raea make status` has a `lod` gate for that composition, open with the parts' names, until each is built
|
|
||||||
for the level it is seen at and replanned, kept out of the camera's way, or answered in NOTES.md on a line
|
|
||||||
with `lod` and its name; the Stop hook holds the agent there as at any open gate
|
|
||||||
And a job that plans a level and whose render found none shows the gate clear
|
|
||||||
|
|
||||||
Rule: cuts from a client's brief (MK25-MK27)
|
|
||||||
Shane, 11-25, on StreetTalk's street interview ads, cut by raea cloud agents from three clients' PDF briefs: "you
|
|
||||||
need to make the process of ingesting the brief more direct, or else it's just context that gets lost. It needs to
|
|
||||||
be written as a brief typescript rule that is then enforced ... I need raea make to be the standard". The agents had
|
|
||||||
read the briefs and still shipped what a contract catches: held to one written from Elfster's brief, Gemini's four
|
|
||||||
delivered solos (eight files) had "free, fun, and easy" missing from three, the CTA rewritten in one ("Download
|
|
||||||
Elfster for free in the App Store") and missing from another, no frames check on any final file, and four of the
|
|
||||||
ten cuts the brief asks for in its out/ folder.
|
|
||||||
|
|
||||||
@needs:MK0
|
|
||||||
Scenario: MK25. The brief as rules: `make: cut({...})`
|
|
||||||
Given a client's brief as text beside brief.ts (pdftotext -layout BRIEF.pdf media/brief.txt)
|
|
||||||
When the agent writes `make: cut({ cut: {...} })` before it plans a single cut
|
|
||||||
Then core/brief reads `cut` (cut.rs): `brief` (that text), `count` (how many cuts the brief asks for), `seconds`
|
|
||||||
and `formats`, each cut (id, angle, solo or mashup, hook, captions or a text hook, its own formats and length),
|
|
||||||
`say` (phrases every cut says or shows, or one cut with `every: false`), `never` (phrases no cut says or
|
|
||||||
shows), `cta` (the line every cut ends on, within its last 8 s; `also`: the other lines a brief rotates, any
|
|
||||||
one of which lands it, each found in the brief) and `open` (the brief's [TO CONFIRM] items)
|
|
||||||
And every rule has `from`: the brief's own words for it
|
|
||||||
And each cut lands at a fixed path, out/cuts/<id>_<W>x<H>.mp4 for each of its formats
|
|
||||||
And `doctor` names what the contract still lacks: no count, no cta, an id that isn't [a-z0-9_], a format that
|
|
||||||
isn't W:H, a cut with no length, a rule with no `from`
|
|
||||||
|
|
||||||
@needs:MK25
|
|
||||||
Scenario: MK26. Held to the brief's own words, its count and its open items
|
|
||||||
Given a cut contract
|
|
||||||
Then `raea make status` finds every `from` in the brief's text, compared by letters and digits: a rule the brief
|
|
||||||
doesn't say, or says in other words, holds the job ("quotes")
|
|
||||||
And fewer cuts than `count` hold it, unless an `open` item about "count" has the person's answer ("count")
|
|
||||||
And every `open` item without an answer holds it, so the agent stops at a review to ask ("open")
|
|
||||||
|
|
||||||
@needs:MK25
|
|
||||||
Scenario: MK27. Every delivered file held to the rules, from what's on disk
|
|
||||||
Given a cut's file at its path
|
|
||||||
Then its shape and length are read from its own MP4 boxes, so a file re-encoded after its render is read as it is
|
|
||||||
now ("shape")
|
|
||||||
And its words must be heard after its last change (FILE.words.json, `raea words`), and in them or its render's
|
|
||||||
text (FILE.render.json): every `say` phrase ("say"), no `never` phrase, with the second it's heard ("never"),
|
|
||||||
and the CTA in its last `within` seconds, 85% of its words in order ("cta")
|
|
||||||
And its frames check must have run after its last change (FILE.frames-check.json, `raea frames check`) with no
|
|
||||||
error: no face cut by the frame or a seam, no text under the size floor ("frames")
|
|
||||||
And the cut job has no critic tier yet: the person's review is its critic
|
|
||||||
|
|
||||||
Rule: any goal, held to rules (MK28-MK29)
|
|
||||||
Shane, 11-26, asking whether raea make is just a version of /goal: "when we use these things, they should just
|
|
||||||
probably be consolidated into one workflow, because in any case we'll have a goal or a brief or something that
|
|
||||||
dictates what we need. And then we essentially just need to make sure that it can't stop unless all the goals pass,
|
|
||||||
or all the rules in the brief". /goal in raea.app's chat let the agent end the loop by writing "GOAL MET"; a goal it
|
|
||||||
can declare met is advice. So /goal and raea make are one loop: a goal is a fifth kind of job, its words become
|
|
||||||
rules in brief.ts before the work starts, and only `raea make status` says it's met.
|
|
||||||
|
|
||||||
@needs:MK2
|
|
||||||
Scenario: MK28. A goal as rules: `make: goal({...})`
|
|
||||||
Given work that isn't a scene, kit, shot or cut (fix a bug, write a page, ship a change)
|
|
||||||
When the agent writes `make: goal({ goal: "the person's words", rules: [...] })` before it starts
|
|
||||||
Then core/brief reads `goal` (goal.rs): the goal as the person said it, and `rules`, each an id and exactly one of
|
|
||||||
`run` (a command that must exit 0 in the brief's folder, within `timeout` seconds, 300 by default), `file` (a
|
|
||||||
file that must exist: a deliverable) or `says` (words that must be true of the work)
|
|
||||||
And `doctor` names what it lacks: no goal, no rules, an id that isn't [a-z0-9_] or is listed twice, a rule with
|
|
||||||
none or more than one of run, file and says, a timeout with no run
|
|
||||||
And a goal job needs no NOTES.md "What the skill got wrong" section (no skill made it) and has no render critic
|
|
||||||
|
|
||||||
@needs:MK28
|
|
||||||
Scenario: MK29. Held by a command's exit and a fresh critic, never the agent's word
|
|
||||||
Given a goal job
|
|
||||||
Then `raea make status` runs every `run` rule at every status, the Stop hook's included, and holds the job on one
|
|
||||||
that fails or outlives its timeout, with its exit code and last line ("run")
|
|
||||||
And a `says` rule is clear only when review/goal.judge.json, written by `raea make judge [DIR] [--by claude|kimi]`
|
|
||||||
(a fresh session that may only read: Read, Grep and Glob), found it true at a time no earlier than the work's
|
|
||||||
newest file, the job's own review/, .raea/, NOTES.md, .git and node_modules left out, compared at whole seconds
|
|
||||||
("says")
|
|
||||||
And `file` rules are its deliverables, listed under missing
|
|
||||||
And raea.app's /goal is this job: it writes the rules first, and only the status ends the loop
|
|
||||||
|
|
||||||
Rule: raea cloud (MK19-MK20)
|
|
||||||
|
|
||||||
@needs:MK2 @done
|
|
||||||
Scenario: MK19. Three skills on raea cloud
|
|
||||||
Then raea cloud has "Scene from references" (plan, spend, first cut, deliver), "Kit from style" (reference
|
|
||||||
sheet, spend, deliver) and "Shots of a scene" (framing, deliver) as skill templates (GET|POST
|
|
||||||
/v1/skills/templates), each with a workflow whose agent steps are checked by a `raea make status` line: run as
|
|
||||||
`raea make status --json` on the box in the project's folder, "says done" holding on its done and "raea make
|
|
||||||
status: critic, review/refs.png" on each named gate and file
|
|
||||||
|
|
||||||
@needs:MK19 @done
|
|
||||||
Scenario: MK20. Retry-safe jobs and a live view
|
|
||||||
Then a project is keyed by a hash of its inputs (or the caller's Idempotency-Key; plan.org's :INPUTS:): the same
|
|
||||||
ask from the API, the studio, a form or a webhook returns the finished project, attaches to the running one or
|
|
||||||
resumes a failed one without paying again; one a person stopped doesn't hold the ask
|
|
||||||
And every picture the agent opens goes to the live watch as a raea.seen event (its path, and a preview when the
|
|
||||||
bytes are under 600 KB), and a raea.heartbeat every 20 s repeats the milestones so far for anyone who joins late
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
title: "raea add"
|
title: "raea add"
|
||||||
summary: "Add, remove and install npm packages for a project, with no Node or npm: raea.lock and node_modules."
|
summary: "Add, remove and install npm packages for a project, with no Node or npm: raea.lock and node_modules."
|
||||||
order: 28
|
order: 26
|
||||||
sources: ["io/npm/src/lib.rs"]
|
sources: ["io/npm/src/lib.rs"]
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ sources: ["apps/ask/src/verbs.rs", "apps/ask/src/prepare.rs", "apps/ask/src/runn
|
|||||||
prints each answer in words with its probability, the window it looked at and what it cost. Ask in your own words, or
|
prints each answer in words with its probability, the window it looked at and what it cost. Ask in your own words, or
|
||||||
use the standard questions: the craft rubric's (`rubric`), picture and sound together (`av`), the defects the
|
use the standard questions: the craft rubric's (`rubric`), picture and sound together (`av`), the defects the
|
||||||
fingerprint can't judge yet (`defects`), the platform checks (`platform`), picking between versions (`decide`) and the
|
fingerprint can't judge yet (`defects`), the platform checks (`platform`), picking between versions (`decide`) and the
|
||||||
review loop's gate questions about a [`raea make`](make.md) job's sheets (`make`). `raea ask list` lists them all.
|
gate questions about the sheets [`raea make`](make.md) draws for a scene, kit or shot goal (`make`). `raea ask list` lists them all.
|
||||||
|
|
||||||
Before it spends anything it reads what it can about the piece: what the file holds, the project's brief (the nearest
|
Before it spends anything it reads what it can about the piece: what the file holds, the project's brief (the nearest
|
||||||
`brief.ts` above the file, or `--brief`) and whether anyone speaks (`--words`, `--voice`). A question that doesn't
|
`brief.ts` above the file, or `--brief`) and whether anyone speaks (`--words`, `--voice`). A question that doesn't
|
||||||
|
|||||||
@@ -1,20 +1,20 @@
|
|||||||
---
|
---
|
||||||
title: "raea bake"
|
title: "raea make bake"
|
||||||
summary: "Bake a composition's bounce light into lightmaps on raea's own ray tracer, and measure the bake against Cycles."
|
summary: "Bake a composition's bounce light into lightmaps on raea's own ray tracer, and measure the bake against Cycles."
|
||||||
order: 104
|
order: 109
|
||||||
sources: ["apps/lightbake/src/lib.rs", "apps/lightbake/src/compare.rs", "apps/lightbake/sets.json", "bench/bake/"]
|
sources: ["apps/lightbake/src/lib.rs", "apps/lightbake/src/compare.rs", "apps/lightbake/sets.json", "bench/bake/"]
|
||||||
---
|
---
|
||||||
|
|
||||||
`raea bake light` puts the light that bounces around a static set into lightmaps: the sky, emissive surfaces and
|
`raea make bake light` puts the light that bounces around a static set into lightmaps: the sky, emissive surfaces and
|
||||||
every bounce, so a shadow fills with the colour of what's around it, as in a path-traced still. The sun's direct light
|
every bounce, so a shadow fills with the colour of what's around it, as in a path-traced still. The sun's direct light
|
||||||
stays live, so anything that moves still casts its shadow. The bake runs on raea's own ray tracer, with no Blender
|
stays live, so anything that moves still casts its shadow. The bake runs on raea's own ray tracer, with no Blender
|
||||||
(docs/bake.feature).
|
(docs/bake.feature).
|
||||||
|
|
||||||
`raea bake light EDIT.tsx` bakes a composition's `<LightBake>` ahead of a render. It isn't built yet: it comes with
|
`raea make bake light EDIT.tsx` bakes a composition's `<LightBake>` ahead of a render. It isn't built yet: it comes with
|
||||||
BK1-BK5, and says so until then. Today the bake is Cycles' through `raea blender run blender/lightbake.py`
|
BK1-BK5, and says so until then. Today the bake is Cycles' through `raea blender run blender/lightbake.py`
|
||||||
(`raea guide bevy/blender`).
|
(`raea guide bevy/blender`).
|
||||||
|
|
||||||
`raea bake light --compare DIR` measures bakes against Cycles on the test set, `apps/lightbake/sets.json`: the table
|
`raea make bake light --compare DIR` measures bakes against Cycles on the test set, `apps/lightbake/sets.json`: the table
|
||||||
set from `raea guide bevy/realism`, a Cornell box lit only by an emissive panel, and a room lit through one window
|
set from `raea guide bevy/realism`, a Cornell box lit only by an emissive panel, and a room lit through one window
|
||||||
(the compositions are in `bench/bake/`). For each set it makes the Cycles references, a still from blender/look.py and
|
(the compositions are in `bench/bake/`). For each set it makes the Cycles references, a still from blender/look.py and
|
||||||
a bake from blender/lightbake.py, both at `--samples`. Then it renders the set in raea, unbaked and with Cycles' maps,
|
a bake from blender/lightbake.py, both at `--samples`. Then it renders the set in raea, unbaked and with Cycles' maps,
|
||||||
@@ -28,8 +28,8 @@ The references are kept in DIR and used again until the set's compositions, its
|
|||||||
It needs Blender (`raea setup blender`).
|
It needs Blender (`raea setup blender`).
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
raea bake light --compare out/bake/
|
raea make bake light --compare out/bake/
|
||||||
raea bake light --compare out/bake/ --set table --samples 256
|
raea make bake light --compare out/bake/ --set table --samples 256
|
||||||
```
|
```
|
||||||
|
|
||||||
<!-- generated:begin by tools/manual-ref/cli.ts from `raea help --json`; edit only the flag descriptions -->
|
<!-- generated:begin by tools/manual-ref/cli.ts from `raea help --json`; edit only the flag descriptions -->
|
||||||
@@ -37,7 +37,7 @@ raea bake light --compare out/bake/ --set table --samples 256
|
|||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
raea bake light EDIT.tsx [--composition ID] [--samples N] | raea bake light --compare DIR [--sets FILE] [--set NAME] [--samples N] [--fresh] (bounce light baked into lightmaps on raea's ray tracer; --compare measures the test set against Cycles' bake and still, docs/bake.feature)
|
raea make bake light EDIT.tsx [--composition ID] [--samples N] | raea make bake light --compare DIR [--sets FILE] [--set NAME] [--samples N] [--fresh] (bounce light baked into lightmaps on raea's ray tracer; --compare measures the test set against Cycles' bake and still, docs/bake.feature)
|
||||||
```
|
```
|
||||||
|
|
||||||
Headless: it needs nothing running and opens no window. Takes up to 2 arguments besides its flags.
|
Headless: it needs nothing running and opens no window. Takes up to 2 arguments besides its flags.
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
title: "raea blender"
|
title: "raea blender"
|
||||||
summary: "Run a Blender Python script headless, with raea's library of mesh scripts: convert, decimate, repair, split, bake, rig, cloth."
|
summary: "Run a Blender Python script headless, with raea's library of mesh scripts: convert, decimate, repair, split, bake, rig, cloth."
|
||||||
order: 108
|
order: 115
|
||||||
sources: ["apps/tools/src/blender.rs", "apps/engines/src/blender_ts.rs"]
|
sources: ["apps/tools/src/blender.rs", "apps/engines/src/blender_ts.rs"]
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
title: "raea brand"
|
title: "raea brand"
|
||||||
summary: "Read a brand kit from a website on this machine: colours, fonts and logos into brand/ and BRAND.md."
|
summary: "Read a brand kit from a website on this machine: colours, fonts and logos into brand/ and BRAND.md."
|
||||||
order: 29
|
order: 27
|
||||||
sources: ["engine/cli/src/brand.ts", "engine/cli/src/scrape.ts"]
|
sources: ["engine/cli/src/brand.ts", "engine/cli/src/scrape.ts"]
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
title: "raea check"
|
title: "raea check"
|
||||||
summary: "Check a composition's text in a second, a project against every rule it holds, or an export against the floor: text, contrast, safe areas, freezes, flashing, cues and loudness."
|
summary: "Check a composition's text in a second, a project against every rule it holds, or an export against the floor: text, contrast, safe areas, freezes, flashing, cues and loudness."
|
||||||
order: 42
|
order: 43
|
||||||
sources: ["apps/check/src/lib.rs", "apps/check/src/quick.rs", "apps/direction/src/check.rs", "sdk/raea/src/check.ts"]
|
sources: ["apps/check/src/lib.rs", "apps/check/src/quick.rs", "apps/direction/src/check.rs", "sdk/raea/src/check.ts"]
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -13,7 +13,7 @@ That takes about a second, so run it after every save. On an exported video, it
|
|||||||
of a finished piece. Each finding is an error, a warn or a note (raea's one finding, as `raea scene lint` and a
|
of a finished piece. Each finding is an error, a warn or a note (raea's one finding, as `raea scene lint` and a
|
||||||
render's manifest have it), says on which frames and how to fix it, and the command exits 1 while an error stands.
|
render's manifest have it), says on which frames and how to fix it, and the command exits 1 while an error stands.
|
||||||
A check of a file in a raea project keeps its findings in the project's record (`.raea/record/`), beside its
|
A check of a file in a raea project keeps its findings in the project's record (`.raea/record/`), beside its
|
||||||
renders', which `raea findings` and `raea next` read.
|
renders', which `raea findings` and `raea goal next` read.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
raea check piece.tsx --quick --platform tiktok
|
raea check piece.tsx --quick --platform tiktok
|
||||||
@@ -102,7 +102,7 @@ Headless: it needs nothing running and opens no window. Takes up to 1 argument b
|
|||||||
| `--taste` | `T` | The person's taste files: the rules in them that carry a `check` are applied too. |
|
| `--taste` | `T` | The person's taste files: the rules in them that carry a `check` are applied too. |
|
||||||
| `--things` | `T.json` | what `raea fingerprint things FILE --json` found in the video (a thing floating or passing through another, the camera lurching mid-move, an empty frame), as findings |
|
| `--things` | `T.json` | what `raea fingerprint things FILE --json` found in the video (a thing floating or passing through another, the camera lurching mid-move, an empty frame), as findings |
|
||||||
| `--words` | `W.json` | The transcript, to check cues against their words and the voice against the music. |
|
| `--words` | `W.json` | The transcript, to check cues against their words and the voice against the music. |
|
||||||
| `-o` | `check.json` | Write the findings as JSON, for a later review or for `raea next`. |
|
| `-o` | `check.json` | Write the findings as JSON, for a later review or for `raea goal next`. |
|
||||||
|
|
||||||
<!-- generated:end -->
|
<!-- generated:end -->
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
title: "raea clothes"
|
title: "raea make clothes"
|
||||||
summary: "Clothes for SOMA's body from words: make sews a garment from a sewing pattern (GarmentCode, MIT), cut to SOMA's measurements and draped by raea's own cloth, as assets/clothes/NAME.json and its .glb; cover lays one on the skin by procedure; wear puts garments on a body."
|
summary: "Clothes for SOMA's body from words: make sews a garment from a sewing pattern (GarmentCode, MIT), cut to SOMA's measurements and draped by raea's own cloth, as assets/clothes/NAME.json and its .glb; cover lays one on the skin by procedure; wear puts garments on a body."
|
||||||
order: 106
|
order: 105
|
||||||
sources: ["engine/cli/src/cli.rs"]
|
sources: ["engine/cli/src/cli.rs"]
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -12,7 +12,7 @@ Clothes for SOMA's body from words: make sews a garment from a sewing pattern (G
|
|||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
raea clothes [make NAME ["WHAT IT IS"] [--plain] [--set PATH=VALUE,...] [--colour #RRGGBB] | settings | cover NAME --parts PART[:SHARE],... --colour #RRGGBB [--stand MM] [--over UNDER] [--hard [--sole MM] [--sole-colour #RRGGBB] [--panels #RRGGBB,...]] | wear OUT_DIR GARMENT... [--body DIR] [--head HEAD_DIR]] (clothes for SOMA's body from words: make sews a garment: a sewing pattern (GarmentCode, MIT) from the words, or the plain base with --plain, its settings changed by --set PATH=VALUE (settings lists them and what each may be), cut to SOMA's measurements, draped by raea's own cloth and baked, as assets/clothes/NAME.json and its .glb, in --colour or the palette's next; the first make sets up GarmentCode and its Python in raea's models folder; cover makes one by procedure in the same file, no picture: the skin of the parts named (hips, waist, torso, chest, neck, head, upperArm, foreArm, hand, thigh, shin, foot, toes; a limb's SHARE is how far along it from its top), in one colour, MM off the skin (6 unless said), --over a garment already made as the one under it; wear puts garments on a body, innermost first (each GARMENT a name or its .json): OUT_DIR/NAME.glb each, with OUT_DIR/body.glb the body without the skin wholly under cloth; --body DIR another SOMA body folder (a headless one for a head part); --head HEAD_DIR the head that joins it (head.json), whose skin the body's is graded to at the collar; alone, the project's garments. The first use fetches SOMA's body (NVlabs/SOMA-X, Apache-2.0) into raea's models folder and needs Blender: raea setup blender)
|
raea make clothes [make NAME ["WHAT IT IS"] [--plain] [--set PATH=VALUE,...] [--colour #RRGGBB] | settings | cover NAME --parts PART[:SHARE],... --colour #RRGGBB [--stand MM] [--over UNDER] [--hard [--sole MM] [--sole-colour #RRGGBB] [--panels #RRGGBB,...]] | wear OUT_DIR GARMENT... [--body DIR] [--head HEAD_DIR]] (clothes for SOMA's body from words: make sews a garment: a sewing pattern (GarmentCode, MIT) from the words, or the plain base with --plain, its settings changed by --set PATH=VALUE (settings lists them and what each may be), cut to SOMA's measurements, draped by raea's own cloth and baked, as assets/clothes/NAME.json and its .glb, in --colour or the palette's next; the first make sets up GarmentCode and its Python in raea's models folder; cover makes one by procedure in the same file, no picture: the skin of the parts named (hips, waist, torso, chest, neck, head, upperArm, foreArm, hand, thigh, shin, foot, toes; a limb's SHARE is how far along it from its top), in one colour, MM off the skin (6 unless said), --over a garment already made as the one under it; wear puts garments on a body, innermost first (each GARMENT a name or its .json): OUT_DIR/NAME.glb each, with OUT_DIR/body.glb the body without the skin wholly under cloth; --body DIR another SOMA body folder (a headless one for a head part); --head HEAD_DIR the head that joins it (head.json), whose skin the body's is graded to at the collar; alone, the project's garments. The first use fetches SOMA's body (NVlabs/SOMA-X, Apache-2.0) into raea's models folder, and the first use of any step makes the Python environment the clothes run in there (by uv); no step needs Blender)
|
||||||
```
|
```
|
||||||
|
|
||||||
Headless: it needs nothing running and opens no window. Takes any number of arguments besides its flags.
|
Headless: it needs nothing running and opens no window. Takes any number of arguments besides its flags.
|
||||||
@@ -29,7 +29,7 @@ Headless: it needs nothing running and opens no window. Takes any number of argu
|
|||||||
| `--panels` | `#RRGGBB,...` | With `cover --hard`: the colours of up to three panels, in this order: a toe cap, a heel, and a band along each side. |
|
| `--panels` | `#RRGGBB,...` | With `cover --hard`: the colours of up to three panels, in this order: a toe cap, a heel, and a band along each side. |
|
||||||
| `--parts` | `PART` | With `cover`: the body's parts the garment covers, comma-separated; a limb takes a share, how far along it from its top (`foreArm:0.5` is the half nearest the elbow). |
|
| `--parts` | `PART` | With `cover`: the body's parts the garment covers, comma-separated; a limb takes a share, how far along it from its top (`foreArm:0.5` is the half nearest the elbow). |
|
||||||
| `--plain` | – | With `make`: start from the plain base (a short-sleeved top) instead of a pattern guessed from words. The default when no words are given. |
|
| `--plain` | – | With `make`: start from the plain base (a short-sleeved top) instead of a pattern guessed from words. The default when no words are given. |
|
||||||
| `--set` | `PATH=VALUE,...` | With `make`: change settings of the garment's pattern by path, comma-separated (`sleeve.length=0.9,meta.bottom=Pants`). A choice must be one of its options and a number within its range; `raea clothes settings` lists them. |
|
| `--set` | `PATH=VALUE,...` | With `make`: change settings of the garment's pattern by path, comma-separated (`sleeve.length=0.9,meta.bottom=Pants`). A choice must be one of its options and a number within its range; `raea make clothes settings` lists them. |
|
||||||
| `--sole` | `MM` | With `cover --hard`: the sole's thickness in millimetres (10 unless said, at most 60). Most of it is painted up the side; the bottom sits at most 8 mm below the bare foot, so the person does not sink into the floor. |
|
| `--sole` | `MM` | With `cover --hard`: the sole's thickness in millimetres (10 unless said, at most 60). Most of it is painted up the side; the bottom sits at most 8 mm below the bare foot, so the person does not sink into the floor. |
|
||||||
| `--sole-colour` | `#RRGGBB` | With `cover --hard`: the sole's colour (an off-white unless said). |
|
| `--sole-colour` | `#RRGGBB` | With `cover --hard`: the sole's colour (an off-white unless said). |
|
||||||
| `--stand` | `MM` | With `cover`: how far the cloth stands off the skin, in millimetres (6 unless said). |
|
| `--stand` | `MM` | With `cover`: how far the cloth stands off the skin, in millimetres (6 unless said). |
|
||||||
@@ -39,12 +39,12 @@ Headless: it needs nothing running and opens no window. Takes any number of argu
|
|||||||
## An outfit
|
## An outfit
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
raea clothes make tee --plain --set shirt.length=1.5 --colour "#e8e2d6"
|
raea make clothes make tee --plain --set shirt.length=1.5 --colour "#e8e2d6"
|
||||||
raea clothes make trousers --set meta.upper=none,meta.bottom=Pants,meta.wb=StraightWB,pants.length=0.8 --colour "#2f3b52"
|
raea make clothes make trousers --set meta.upper=none,meta.bottom=Pants,meta.wb=StraightWB,pants.length=0.8 --colour "#2f3b52"
|
||||||
raea clothes wear assets/characters/dressed trousers tee
|
raea make clothes wear assets/characters/dressed trousers tee
|
||||||
```
|
```
|
||||||
|
|
||||||
`make` sews a garment: a sewing pattern (flat pieces joined by seams) cut to SOMA's measurements, draped on the body by gravity and baked to a skinned glb. It costs nothing and takes about 20 seconds. The pattern comes from the plain base (a short-sleeved top) with `--plain` or when no words are given, and each `--set PATH=VALUE` changes one of its settings; `raea clothes settings` lists them all with what each may be. Given words (`raea clothes make hoodie "a hooded sweatshirt"`), the pattern is the garment model's first guess from them; the command says what it made, and `--set` corrects it.
|
`make` sews a garment: a sewing pattern (flat pieces joined by seams) cut to SOMA's measurements, draped on the body by gravity and baked to a skinned glb. It costs nothing and takes about 20 seconds. The pattern comes from the plain base (a short-sleeved top) with `--plain` or when no words are given, and each `--set PATH=VALUE` changes one of its settings; `raea make clothes settings` lists them all with what each may be. Given words (`raea make clothes make hoodie "a hooded sweatshirt"`), the pattern is the garment model's first guess from them; the command says what it made, and `--set` corrects it.
|
||||||
|
|
||||||
The first use sets up what sewing runs on in raea's models folder (`garments/`): GarmentCode's pattern components (MIT) at a fixed commit, a Python 3.11 environment made by `uv`, and SOMA's body as a distance grid for the drape.
|
The first use sets up what sewing runs on in raea's models folder (`garments/`): GarmentCode's pattern components (MIT) at a fixed commit, a Python 3.11 environment made by `uv`, and SOMA's body as a distance grid for the drape.
|
||||||
|
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
---
|
---
|
||||||
title: "raea component"
|
title: "raea make component"
|
||||||
summary: "Copy a ready-made component or set into the project's components/, or the workspace's shared/components/, to use and change as your own."
|
summary: "Copy a ready-made component or set into the project's components/, or the workspace's shared/components/, to use and change as your own."
|
||||||
order: 26
|
order: 103
|
||||||
sources: ["engine/cli/src/index.ts", "engine/cli/src/registry.gen.ts"]
|
sources: ["engine/cli/src/index.ts", "engine/cli/src/registry.gen.ts"]
|
||||||
---
|
---
|
||||||
|
|
||||||
Components are ready-made pieces of a composition (captions, lower thirds, end cards and the like) and sets of them.
|
Components are ready-made pieces of a composition (captions, lower thirds, end cards and the like) and sets of them.
|
||||||
`raea component list` shows them; `raea component add` copies one into `components/NAME/`, where it's yours: raea
|
`raea make component list` shows them; `raea make component add` copies one into `components/NAME/`, where it's yours: raea
|
||||||
never updates or overwrites it unasked. With `--shared` it goes into the workspace's `shared/components/` instead, for
|
never updates or overwrites it unasked. With `--shared` it goes into the workspace's `shared/components/` instead, for
|
||||||
every project to import as `@shared/components/NAME`. `raea part` is the old name and still works.
|
every project to import as `@shared/components/NAME`. `raea part` is the old name and still works.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
raea component list
|
raea make component list
|
||||||
raea component add captions end-card
|
raea make component add captions end-card
|
||||||
raea component add reel --shared
|
raea make component add reel --shared
|
||||||
```
|
```
|
||||||
|
|
||||||
<!-- generated:begin by tools/manual-ref/cli.ts from `raea help --json`; edit only the flag descriptions -->
|
<!-- generated:begin by tools/manual-ref/cli.ts from `raea help --json`; edit only the flag descriptions -->
|
||||||
@@ -21,7 +21,7 @@ raea component add reel --shared
|
|||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
raea component list | raea component add NAME ... [--shared] [--force] | raea part list | raea part add NAME ... [--shared] [--force] (a ready component or set copied into components/, or the workspace's shared/components/ with --shared, yours to change; raea part is its old name)
|
raea make component list | raea make component add NAME ... [--shared] [--force] (a ready component or set copied into components/, or the workspace's shared/components/ with --shared, yours to change)
|
||||||
```
|
```
|
||||||
|
|
||||||
Headless: it needs nothing running and opens no window. Takes any number of arguments besides its flags.
|
Headless: it needs nothing running and opens no window. Takes any number of arguments besides its flags.
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
title: "raea cut"
|
title: "raea cut"
|
||||||
summary: "Cut a take to the lines it says, transcribing it first, and write cuts.ts and words.json."
|
summary: "Cut a take to the lines it says, transcribing it first, and write cuts.ts and words.json."
|
||||||
order: 63
|
order: 64
|
||||||
sources: ["engine/cli/src/index.ts"]
|
sources: ["engine/cli/src/index.ts"]
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
title: "raea doctor"
|
title: "raea doctor"
|
||||||
summary: "Find what doesn't match this version of raea: old brief files, an older workspace format, an agent's stale skill."
|
summary: "Find what doesn't match this version of raea: old brief files, an older workspace format, an agent's stale skill."
|
||||||
order: 53
|
order: 51
|
||||||
sources: ["apps/workspace/src/doctor.rs"]
|
sources: ["apps/workspace/src/doctor.rs"]
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
@@ -52,5 +52,5 @@ Headless: it needs nothing running and opens no window. Takes up to 1 argument b
|
|||||||
|
|
||||||
## See also
|
## See also
|
||||||
|
|
||||||
- [`raea render`](render.md) and [`raea check`](check.md) write the record; [`raea next`](next.md) reads it to pick
|
- [`raea render`](render.md) and [`raea check`](check.md) write the record; [`raea goal next`](goal.md) reads it to pick
|
||||||
the next step.
|
the next step.
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
title: "raea frame"
|
title: "raea frame"
|
||||||
summary: "Say how a take fits the edit: a talking take for <FaceFrame>, a screen recording for <ScreenFit>, from where its face is."
|
summary: "Say how a take fits the edit: a talking take for <FaceFrame>, a screen recording for <ScreenFit>, from where its face is."
|
||||||
order: 64
|
order: 65
|
||||||
sources: ["engine/cli/src/index.ts"]
|
sources: ["engine/cli/src/index.ts"]
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
title: "raea gen"
|
title: "raea gen"
|
||||||
summary: "Generate images, video, music, sound, speech, 3D models and text through made.app, fal, Replicate, OpenRouter, Modal or ComfyUI."
|
summary: "Generate images, video, music, sound, speech, 3D models and text through made.app, fal, Replicate, OpenRouter, Modal or ComfyUI."
|
||||||
order: 102
|
order: 114
|
||||||
sources: ["io/gen/src", "io/gen-comfy/src"]
|
sources: ["io/gen/src", "io/gen-comfy/src"]
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,119 @@
|
|||||||
|
---
|
||||||
|
title: "raea goal"
|
||||||
|
summary: "The loop: the brief's goals, every rule each is held to, run at four moments (a save, a render's end, a hand-over, a stop) by `raea goal check`; the brief's plan by `raea goal tasks`; the next steps, the critic and a scene, kit or shot goal's gates."
|
||||||
|
order: 42
|
||||||
|
sources: ["sdk/goal/src/run.ts", "sdk/goal/src/contract.ts", "sdk/goal/src/tasks.ts", "sdk/goal/src/packs/index.ts", "core/brief/src/goal.rs", "apps/make/src/gates.rs", "apps/check/src/hook.rs", "engine/cli/src/verbs.rs"]
|
||||||
|
---
|
||||||
|
|
||||||
|
`raea goal check` holds the work to every rule it has, from what's on disk and never from what the agent says. The
|
||||||
|
rules are the brief's `goal`: one goal, or a list of them done in order (a workflow inline, or `workflow({ name,
|
||||||
|
steps })`), each a `cut({...})`, `rules({...})`, `scene({...})`, `kit({...})` or `shot({...})` from `raea/brief`. A
|
||||||
|
goal's `name` is how the report and other goals' `after` name it, and `after` holds it until those goals pass. Each kind turns its packs on, `packs` switches any by
|
||||||
|
name, and `checks` adds the project's own (`check()`s from raea/check, imported into brief.ts). With no goal, a
|
||||||
|
project is held to the floor: every made video's frames, its floor measure and its look, and every composition's
|
||||||
|
stills as it's saved.
|
||||||
|
|
||||||
|
Each check runs at its moments, and raea runs `raea goal check` at each one itself:
|
||||||
|
|
||||||
|
| Moment | When | Who runs it |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| `edit` | a composition, or any file under a goal, is saved | the agent's after-save hook (`raea hook`) |
|
||||||
|
| `render` | a render's export is written | `raea render`, on a Mac and on a raea cloud box |
|
||||||
|
| `publish` | the agent hands a video over | raea cloud's publish tool |
|
||||||
|
| `done` | the agent's turn ends; a raea cloud stop or delivery | the Stop hook; raea cloud |
|
||||||
|
|
||||||
|
The packs, and what each holds:
|
||||||
|
|
||||||
|
| Pack | On for | Holds |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| `words` | cut | every word CUT.lines.txt says is heard whole in the export, none faded under a crossfade |
|
||||||
|
| `sound` | cut | edit points in the pauses, every line within 6 dB of the others, every effect heard (from the render's manifest against each take) |
|
||||||
|
| `frames` | cut, floor | no face cut by the frame or a split screen's seam, no text under 40 px of a 1080-wide frame |
|
||||||
|
| `montage` | cut | each cut's beats kept to their pace (`asl`, `tempo`); eye trace, screen direction and tone across every cut, in Murch's order (a break at most cuts is an error) |
|
||||||
|
| `place` | cut | no text over a face, a person or what the shot is about where a clear place of its size exists |
|
||||||
|
| `floor` | cut, floor | no clipped text, low contrast, freeze, flash or loudness out of range |
|
||||||
|
| `stills` | every kind, floor | a composition's three stills as it's saved: no clipped or cramped text, nothing out of the safe areas |
|
||||||
|
| `seen` | cut, floor | its contact sheet looked at since its last render (`raea goal seen FILE`, then `raea goal seen FILE "..."`) |
|
||||||
|
| `surprise` | when a brief turns it on | one earned surprise named with its moment in seconds |
|
||||||
|
| `naming` | cut | every video and still named client_concept_variant_v#_size |
|
||||||
|
| `sizes` | cut | one size first: no other size before a person approves the first |
|
||||||
|
| `quotes`, `count`, `open` | cut | every rule quotes the brief; as many cuts as it asks for; each open item answered by a person |
|
||||||
|
| `say`, `never`, `cta`, `shape` | cut | each cut says its phrases, none it bans, ends on the CTA, in its format and length |
|
||||||
|
| `run`, `says` | rules, cut | each command rule exits 0; each `says` rule found true by a fresh critic since the work last changed (a cut's beats are `says` rules: what each part makes the viewer feel and understand, judged on the cut in sequence) |
|
||||||
|
| `deliverables` | rules, scene, kit, shot | every file the goal names exists |
|
||||||
|
| `record`, `critic`, `notes` | scene, kit, shot | every composition rendered clean since it changed; the critic's rounds; NOTES.md's "What the skill got wrong" |
|
||||||
|
|
||||||
|
A finding says what to change (the out point to move to, the gainDb that evens a line, the place a caption is clear).
|
||||||
|
`raea goal check` prints each, writes review/goal.json (and FILE.check.json beside each file named), and exits 1 on
|
||||||
|
an error. A check that needs what the machine hasn't (people and faces are read by raea cloud's farm) waits and says
|
||||||
|
so; it holds nothing. The Stop hook keeps an agent working in a project whose brief has a `goal` until `--at done`
|
||||||
|
passes; the same open items block a session three times at most. A scene, kit or shot job is delivered short at its
|
||||||
|
round cap (8 by default) or after three rounds that haven't beaten the best before them: its record and critic
|
||||||
|
findings are then warnings.
|
||||||
|
|
||||||
|
A rules goal (`rules({...})`, what raea.app's `/goal` writes) is any other work: the aim in your words and the rules
|
||||||
|
that must hold before the agent stops. A `run` rule is a command that must exit 0 in the brief's folder (300 seconds
|
||||||
|
unless its `timeout` says otherwise); a `file` rule is a deliverable; a `says` rule is words that must be true of the
|
||||||
|
work, judged by a fresh critic that may only read: `raea goal judge` asks one (`--by claude` or `kimi`) and keeps its
|
||||||
|
verdict in review/judge/NAME.json, and the rule clears only while that verdict is no older than the work's newest file.
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import { brief, rules } from "raea/brief"
|
||||||
|
import clearOfButtons from "./checks/clear.ts"
|
||||||
|
|
||||||
|
export default brief({
|
||||||
|
title: "Spring drop",
|
||||||
|
goal: rules({ aim: "the export plays and the README says how to run it",
|
||||||
|
rules: [
|
||||||
|
{ id: "tests", run: "bun test" },
|
||||||
|
{ id: "export", file: "out/final.mp4" },
|
||||||
|
{ id: "readme", says: "README.md says how to install and run it, in order" },
|
||||||
|
],
|
||||||
|
checks: [clearOfButtons],
|
||||||
|
}),
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
```sh
|
||||||
|
raea goal check # done: everything, as the Stop hook runs it
|
||||||
|
raea goal check out/cuts/acme_dog_hook1_v2_9x16.mp4 --at render
|
||||||
|
raea goal seen out/cuts/acme_dog_hook1_v2_9x16.mp4 && raea goal seen out/cuts/acme_dog_hook1_v2_9x16.mp4 "..."
|
||||||
|
raea goal tasks --json # the brief's plan, every task
|
||||||
|
raea goal next
|
||||||
|
```
|
||||||
|
|
||||||
|
The brief's plan is its `plan` (`plan({...})` from `raea/brief`, inline or in a module brief.ts imports): `raea goal
|
||||||
|
tasks` reads it from the brief's run, `--apply` makes edits by task id and writes each back where that task is
|
||||||
|
written, and `--put` writes a whole plan back only while the brief's is still the one it replaces (an app's Undo). A
|
||||||
|
goal's rules are never copied into the plan: the plan is the work, the goal is what the work is held to.
|
||||||
|
|
||||||
|
<!-- generated:begin by tools/manual-ref/cli.ts from `raea help --json`; edit only the flag descriptions -->
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
```sh
|
||||||
|
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)
|
||||||
|
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"] [--surprise "SECONDS s: what it is"] (FILE's contact sheet beside it, to look at every frame; with words, what was seen of FILE as it is now)
|
||||||
|
raea goal judge [--goal NAME] [--by claude|kimi] (a goal's `says` rules judged by a fresh critic that only reads; review/judge/NAME.json)
|
||||||
|
raea goal next [DIR] (the two or three useful next steps for the project, from its brief, its goals, compositions, renders and checks)
|
||||||
|
raea goal gates [DIR] [--goal NAME] --json (a scene, kit or shot goal's record and critic gates, as raea/goal's packs read them)
|
||||||
|
```
|
||||||
|
|
||||||
|
Headless: it needs nothing running and opens no window. Takes any number of arguments besides its flags.
|
||||||
|
|
||||||
|
## Flags
|
||||||
|
|
||||||
|
| Flag | Takes | What it does |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| `--apply` | `EDITS.json\|-` | plan edits (JSON, `-` for stdin), each written where its task is written |
|
||||||
|
| `--at` | `edit\|render\|publish\|done` | The moment `check` runs the rules of (default `done`); for `place`, the seconds to read (`S[,S...]`). |
|
||||||
|
| `--by` | `claude\|kimi` | The critic `judge` asks, a fresh session that may only read (default `claude`). |
|
||||||
|
| `--goal` | `NAME` | only this goal of the brief's (by its name) |
|
||||||
|
| `--json` | – | `check`: print the report (review/goal.json's shape). `gates`: the record and critic gates as JSON. |
|
||||||
|
| `--manifest` | `render.json` | the render's manifest, for the sound pack's takes and effects |
|
||||||
|
| `--only` | `ID,...` | `check`: only these checks. Otherwise only these objects (refs, gen, pick-sheet, prep) or shots (framing), by id or name. |
|
||||||
|
| `--put` | `PUT.json\|-` | `{plan, base}`: the whole plan written back only while the brief's is still `base` |
|
||||||
|
| `--surprise` | `"SECONDS s:` | `seen`: the one surprise and its moment, for a brief with the surprise pack on. |
|
||||||
|
|
||||||
|
<!-- generated:end -->
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
title: "raea godot"
|
title: "raea godot"
|
||||||
summary: "Run a TypeScript script against Godot's whole API in a headless Godot with GodotJS, record what it draws as frames, or open the editor on the project."
|
summary: "Run a TypeScript script against Godot's whole API in a headless Godot with GodotJS, record what it draws as frames, or open the editor on the project."
|
||||||
order: 109
|
order: 116
|
||||||
sources: ["apps/engines/src/godot.rs", "apps/engines/src/godot_run.rs"]
|
sources: ["apps/engines/src/godot.rs", "apps/engines/src/godot_run.rs"]
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
title: "raea hook"
|
title: "raea hook"
|
||||||
summary: "Every agent's tool hooks: media opened in the Mac's viewer goes to raea show, and the quick check after a composition is saved."
|
summary: "Every agent's tool hooks: media opened in the Mac's viewer goes to raea show, and the quick check after a composition is saved."
|
||||||
order: 54
|
order: 52
|
||||||
sources: ["apps/check/src/hook.rs", "apps/tools/src/agent_hooks.rs"]
|
sources: ["apps/check/src/hook.rs", "apps/tools/src/agent_hooks.rs"]
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
Loaded 100 of 335 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user