Skip to content

armgit / raea

Public Imported from GitHub
0

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

raea fix: a problem looked up before it's guessed at

shinyobjectzcb8b06ff7b8b
diff --git a/Cargo.lock b/Cargo.lock
index 6f6b2f1b..af6c14fc 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -14258,6 +14258,7 @@ dependencies = [
"raea-runtime-react",
"raea-runtime-sound",
"raea-runtime-wear",
+ "raea-sys-fixes",
"raea-sys-index",
"regex",
"serde",
@@ -15924,6 +15925,14 @@ dependencies = [
"serde_json",
]
+[[package]]
+name = "raea-sys-fixes"
+version = "0.1.0"
+dependencies = [
+ "raea-io-home",
+ "rusqlite",
+]
+
[[package]]
name = "raea-sys-fog"
version = "0.1.0"
diff --git a/Cargo.toml b/Cargo.toml
index 0298d0bc..70f73eed 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -91,6 +91,7 @@ members = [
"systems/vision",
"systems/columns",
"systems/index",
+ "systems/fixes",
"systems/fingerprint",
"systems/fingerprint-use",
"systems/fingerprint-things",
diff --git a/docs/manual/reference/cli/ask.md b/docs/manual/reference/cli/ask.md
index b7c88f80..1235ceef 100644
--- a/docs/manual/reference/cli/ask.md
+++ b/docs/manual/reference/cli/ask.md
@@ -1,7 +1,7 @@
---
title: "raea ask"
summary: "Ask about a piece's picture and sound: clef-omni answers in words and a probability, paid from your raea plan, and every answer is kept so a question can be calibrated."
-order: 130
+order: 131
sources: ["apps/ask/src/verbs.rs", "apps/ask/src/prepare.rs", "apps/ask/src/runner.rs", "apps/ask/src/labels.rs", "apps/ask/src/calibrate.rs", "io/clef/src/route.rs", "core/ask/src/library.rs"]
---
diff --git a/docs/manual/reference/cli/bug.md b/docs/manual/reference/cli/bug.md
index 08583907..48cad2f0 100644
--- a/docs/manual/reference/cli/bug.md
+++ b/docs/manual/reference/cli/bug.md
@@ -1,7 +1,7 @@
---
title: "raea bug"
summary: "Report a bug in raea itself to raea's server: a line saying what's wrong and what happened, with raea's version and the OS added, no account needed."
-order: 129
+order: 130
sources: ["engine/cli/src/bug.ts", "engine/cli/src/cli.rs"]
---
diff --git a/docs/manual/reference/cli/context.md b/docs/manual/reference/cli/context.md
index 37eca973..1d4ae4d0 100644
--- a/docs/manual/reference/cli/context.md
+++ b/docs/manual/reference/cli/context.md
@@ -1,7 +1,7 @@
---
title: "raea context"
summary: "Print what to read before working on a project: its taste, brief and look, the floor and its modes' guides."
-order: 123
+order: 124
sources: ["engine/cli/src/guide.rs", "apps/workspace/src/doctor.rs"]
---
diff --git a/docs/manual/reference/cli/fix.md b/docs/manual/reference/cli/fix.md
new file mode 100644
index 00000000..0ef5b137
--- /dev/null
+++ b/docs/manual/reference/cli/fix.md
@@ -0,0 +1,46 @@
+---
+title: "raea fix"
+summary: "A problem looked up before you guess: what you see or the error text, \"quoted\" for an exact phrase."
+order: 123
+sources: ["systems/fixes/src/lib.rs", "sdk/guides/fixes/raea.tsv", "engine/cli/src/cli.rs"]
+---
+
+A problem looked up before you guess: what you see or the error text, "quoted" for an exact phrase.
+
+<!-- generated:begin by tools/manual-ref/cli.ts from `raea help --json`; edit only the flag descriptions -->
+
+## Usage
+
+```sh
+raea fix SYMPTOM... [--domain DOMAIN] [--limit N] [--sources] [--notice] (a problem looked up before you guess: what you see or the error text, "quoted" for an exact phrase; raea's own fixes first, then community skills' and docs')
+```
+
+Headless: it needs nothing running and opens no window. Takes any number of arguments besides its flags.
+
+## Flags
+
+| Flag | Takes | What it does |
+| --- | --- | --- |
+| `--domain` | `DOMAIN` | Only entries of one domain: `bevy`, `blender`, `threejs`, `r3f`, `shaders`, `ffmpeg`, `video`, `audio`, `godot`, `raea` and so on. A domain word in the query itself ranks that domain first without leaving the rest out. |
+| `--limit` | `N` | How many library entries to show (6 unless said). raea's own entries, at most three, come above them. |
+| `--notice` | – | Print the library's sources and their licences instead of searching. |
+| `--sources` | – | Name the sources (repositories, ClawHub skills) each library entry comes from. |
+
+<!-- generated:end -->
+
+`raea fix` is what an agent runs when a frame looks wrong or a command prints an error, before it guesses at a cause.
+Say what you see in plain words (`raea fix "shadows cut off"`, `raea fix "glow missing at night"`), or give the error
+text inside double quotes, which matches that exact phrase in problems and error text.
+
+It searches two sources, both on this machine, in about a twentieth of a second:
+
+- **raea's own entries** (marked `raea`): problems found and fixed in raea work, each with where and when it was found.
+ They live in `sdk/guides/fixes/raea.tsv`, so a new one ships with the next release; an entry shows when it matches
+ at least half of the query's words.
+- **The library** (numbered): about 46,500 problem → fix entries taken from community skills and docs whose licences
+ allow it (MIT, Apache-2.0, BSD, CC0, and every ClawHub skill, which is MIT-0), merged where several say the same
+ thing. The number is how many sources state the fix. These weren't checked in raea, and many name another engine's
+ API (three.js, Godot, Blender), so translate the idea and confirm the fix on a frame.
+
+The library is a file the release installs (`models/fixes/fixes-library.db` beside raea's other files);
+`RAEA_FIXES` names another copy.
diff --git a/docs/manual/reference/cli/index.md b/docs/manual/reference/cli/index.md
index c27cffed..94bc0eec 100644
--- a/docs/manual/reference/cli/index.md
+++ b/docs/manual/reference/cli/index.md
@@ -123,6 +123,7 @@ What an agent reads and shows the person, and the tools raea installs.
| Verb | What it does |
| --- | --- |
| [`raea guide`](guide.md) | Print raea's craft guides: the floor read before any edit, the modes, the notes and the 3D guides. |
+| [`raea fix`](fix.md) | A problem looked up before you guess: what you see or the error text, "quoted" for an exact phrase. |
| [`raea context`](context.md) | Print what to read before working on a project: its taste, brief and look, the floor and its modes' guides. |
| [`raea notes`](notes.md) | A person's notes as files the work is held to: each taken word for word, then restated as asks before anything changes. |
| [`raea show`](show.md) | Show the person something in the raea app, as an item they can use and answer: stills, a video, a sound, a script, an interactive .tsx or a question. |
diff --git a/docs/manual/reference/cli/notes.md b/docs/manual/reference/cli/notes.md
index e1974a4e..b53103e5 100644
--- a/docs/manual/reference/cli/notes.md
+++ b/docs/manual/reference/cli/notes.md
@@ -1,7 +1,7 @@
---
title: "raea notes"
summary: "A person's notes as files the work is held to: each taken word for word, then restated as asks before anything changes."
-order: 124
+order: 125
sources: ["apps/notes/src/lib.rs", "apps/notes/src/take.rs", "apps/notes/src/post.rs", "apps/notes/src/check.rs", "apps/notes/src/state.rs", "core/facts/src/note.rs", "sdk/raea/src/note.ts"]
---
diff --git a/docs/manual/reference/cli/setup.md b/docs/manual/reference/cli/setup.md
index c8520b71..efbedc93 100644
--- a/docs/manual/reference/cli/setup.md
+++ b/docs/manual/reference/cli/setup.md
@@ -1,7 +1,7 @@
---
title: "raea setup"
summary: "Find Blender, or download its current LTS, and install raea's add-on and the MCP add-on."
-order: 128
+order: 129
sources: ["apps/tools/src/blender.rs"]
---
diff --git a/docs/manual/reference/cli/show.md b/docs/manual/reference/cli/show.md
index eb03a9a8..fa394b41 100644
--- a/docs/manual/reference/cli/show.md
+++ b/docs/manual/reference/cli/show.md
@@ -1,7 +1,7 @@
---
title: "raea show"
summary: "Show the person something in the raea app, as an item they can use and answer: stills, a video, a sound, a script, an interactive .tsx or a question."
-order: 125
+order: 126
sources: ["engine/cli/src/show.ts", "engine/cli/src/held.ts"]
---
diff --git a/docs/manual/reference/cli/skill.md b/docs/manual/reference/cli/skill.md
index b6eaf88a..e96515cf 100644
--- a/docs/manual/reference/cli/skill.md
+++ b/docs/manual/reference/cli/skill.md
@@ -1,7 +1,7 @@
---
title: "raea skill"
summary: "Print the agent skill this raea ships, matched to its version, or one of its references."
-order: 126
+order: 127
sources: ["engine/cli/src/skill.rs"]
---
diff --git a/docs/manual/reference/cli/skills.md b/docs/manual/reference/cli/skills.md
index a71b5a73..9f5c610e 100644
--- a/docs/manual/reference/cli/skills.md
+++ b/docs/manual/reference/cli/skills.md
@@ -1,7 +1,7 @@
---
title: "raea skills"
summary: "Install raea's agent skill where Claude Code, Codex, Kimi or Gemini read skills, with its MCP server and hook."
-order: 127
+order: 128
sources: ["engine/cli/src/skill.rs"]
---
diff --git a/engine/cli/Cargo.toml b/engine/cli/Cargo.toml
index ea04c0f3..378f183e 100644
--- a/engine/cli/Cargo.toml
+++ b/engine/cli/Cargo.toml
@@ -52,6 +52,8 @@ serde_json = "1"
raea-neural = { path = "../neural" }
# `raea light check` (docs/realism.feature LT1)
raea-light = { path = "../light" }
+# `raea fix`: a problem looked up in raea's own fixes and the library of community ones the release ships
+raea-sys-fixes = { path = "../../systems/fixes" }
regex = "1"
# the app crates' verbs: `raea check`, `raea ci`, and the local tools' (sao, tokensynth, setup-audio, sounds, splat)
raea-app-check = { path = "../../apps/check" }
diff --git a/engine/cli/src/cli.rs b/engine/cli/src/cli.rs
index eb052ef4..7f06f9e7 100644
--- a/engine/cli/src/cli.rs
+++ b/engine/cli/src/cli.rs
@@ -142,6 +142,8 @@ pub fn run(args: &[String]) -> R<String> {
let usage = format!("{usage}\n {} ({})", tools::motion::USAGE, tools::motion::ABOUT);
// an agent's report of a bug in raea itself, to raea's server (engine/cli/src/bug.ts; Shane 11-16)
let usage = format!("{usage}\n raea bug TITLE... --text TEXT [--command CMD] [--error TEXT] [--agent NAME] [--dry-run] (a bug in raea itself, not in your own composition, sent to raea's server with raea's version and the OS, no account needed: words only, paths, emails and keys taken out before it goes; five a day from a machine, the same bug again counted on the first report; --dry-run prints what would go and sends nothing)");
+ // a problem looked up before it's guessed at (systems/fixes)
+ let usage = format!("{usage}\n {} ({})", raea_sys_fixes::USAGE, raea_sys_fixes::ABOUT);
// a workspace's files and specs (docs/projects.feature), listed under render's usage like library
let usage = format!("{usage}\n raea spec FILE.ts [--as brief|script|taste|parts] (a spec's default export as JSON, checked against its schema: brief.ts, script.ts, taste.ts, NAME.parts.ts)\n raea workspace init [NAME] [--layout LAYOUT] | raea workspace adopt DIR [--name NAME] | raea workspace [--json] (a workspace: a git repo of projects under raea.root, ~/Documents/raea unless git config says)\n raea project new NAME [--storage inline|submodule] | raea project split NAME [--remote URL] | raea project join NAME | raea project [--json] (a project in the workspace: its folder, brief.ts, media/, out/; split and join keep its history)\n raea check EDIT.tsx --quick [--shape S] [--platform P] [--taste T] [-o check.json] (three stills of a composition checked for text: clipped, cramped, safe areas, sizes; about a second)\n raea hook [claude|codex|gemini|kimi] (every agent's tool hooks, which raea skills install adds: before a shell command, media opened in the Mac's viewer while the raea app is installed is stopped once for raea show (the same command again goes through); after a save, the quick check on a composition)\n raea next [DIR] (the two or three useful next steps for the project, from its brief, compositions, renders and checks)\n raea doctor [--fix] [DIR] (what doesn't match this raea: old brief files, an older workspace format, an agent's skill from another version)\n raea app run|check|bundle APP.tsx [--target web|native] [--size WxH] [--script steps.json] [--png DIR] [-o App.app] (a TSX app on @raea/ui: its window, the headless check, a Mac app; web is Blitz on Bevy, native is Rune; the app's `export const app` sets the target, web when it doesn't; raea rune ... is --target native)\n {}\n {}\n {} ({})\n {}\n {}\n {}", skill::USAGE, tools::blender::USAGE, tools::motion::SETUP_USAGE, tools::motion::SETUP_ABOUT, raea_app_engines::godot::USAGE, raea_app_engines::shot::USAGE, raea_app_engines::round::USAGE);
let (export_game, capcut, layers, xml, scene, physics, splat, wear) = (raea_app_game::USAGE, raea_app_capcut::USAGE, raea_app_layers::USAGE, raea_app_layers::USAGE_XML, raea_app_scene::USAGE, motion::physics::USAGE, tools::splat::USAGE, raea_runtime_wear::USAGE);
@@ -163,6 +165,10 @@ pub fn run(args: &[String]) -> R<String> {
if matches!(args[0].as_str(), "guide" | "craft") {
return guide(args.get(1).map(String::as_str));
}
+ // `fix SYMPTOM...`: a problem looked up in raea's own fixes, then the library of community ones (systems/fixes)
+ if args[0] == "fix" {
+ return raea_sys_fixes::cli(&args[1..]);
+ }
// `context PROJECT`: what an agent reads before any work on a project (docs/craft-system.md, A)
if args[0] == "context" {
return context(args.get(1).map(String::as_str));
diff --git a/sdk/guides/fixes/raea.tsv b/sdk/guides/fixes/raea.tsv
new file mode 100644
index 00000000..f1412a36
--- /dev/null
+++ b/sdk/guides/fixes/raea.tsv
@@ -0,0 +1,34 @@
+# raea fix's own entries (read by systems/fixes, raea-sys-fixes): problems found and fixed in raea work,
+# searched before the library and shown first. Columns: problem, cause, fix, error text, domains, where and when found.
+# Add one when a fix was confirmed on a frame; remove one when the engine fixes its cause.
+Additive glow draws nothing `unlit` shows only `base_color`, so an emissive on an unlit material is dropped Leave `unlit` off an additive glow (`base_color="#000000" alpha_mode="Add" emissive=...`) and use `perceptual_roughness={1} reflectance={0}` instead. raea 3d bevy launch film, 11-09
+Emissive texture draws nothing, the surface stays black A 1-channel (greyscale) or palettised PNG as `emissive_texture` Save it as RGB (`magick in.png -type TrueColor PNG24:out.png`), or draw it with `base_color_texture` on an `unlit` white material. Confirm on a frame. raea 3d bevy launch film, 11-09/11-10
+Radial stripes across additive cone or beam layers Additive layers pick up the lights' specular highlights Give additive layers `reflectance={0}`. raea 3d bevy launch film, 11-09
+A simulated or per-frame BufferMesh stands still The engine keeps the first geometry it saw under a name Give a `BufferMesh` whose positions change a per-frame `name` and key, e.g. ``name={`sheet-${Math.round(t * 30)}`}``. raea 3d launch film, 11-09
+Text3D words sit half a word left of where they were placed A `Text3D`'s origin is the word's middle, not its left edge Lay words out by their centres (add half the word's width when placing from a left edge). raea 3d text launch film, 11-10
+Sky, horizon or distant city cut off a short way out The camera's far plane is nearer than the scene (200 m in some looks, while a sky dome was 188 m across) Raise the camera's `far` above the scene's extent. raea 3d bevy launch film, 11-10
+Emissive type or glow vanishes in a night scene Emissive on a lit material is multiplied by the view's exposure, which a dark scene raises Make white type in the dark `unlit` (its `base_color` draws at full strength). raea 3d bevy lighting launch film, 11-10
+Paint look: a shot from far away is greyed out The paint look's haze is one colour for the whole frame Set `hazeMost={0}` for shots from a distance (a long lens standing in for an orthographic camera). raea 3d look launch film, 11-10
+Solari: a sun added after the first frame lights nothing A `DirectionalLight` spawned after a render's first frame isn't traced; one present from frame 0 keeps its frame-0 strength (its direction follows) Keep one sun from frame 0 at full strength and vary only its direction (aim it up from under the floor where there should be none). raea 3d solari lighting bevy 0.1.1 showcase, 11-10
+Solari: frames rendered with --at far apart lose the sun and fog shadows A jump of more than about 4.5 s between two drawn frames leaves stale ray-tracing data for every later frame Render stills one per render, and a film a shot per render (a `<Composition>` per shot), joined with a re-encode. raea 3d solari render 0.1.1 showcase, 11-10
+A temporal effect looks wrong on an --at still but right in the video `raea render --at` draws none of the frames between the listed ones, so Solari, the denoiser and TAA have almost no history For anything temporal, render every frame to a directory (`-o dir/`, no `--at`) and pick frames from it. `--at` output files are numbered from 0 in list order. raea render solari lightbench, 11-19
+Solari: dark arcs or patches drift on walls after a light jumps MetalFX's temporal denoiser carries history across the jump; `reset: true` also resets the denoiser and makes it worse Change no light faster than about 0.2 of its level a frame: ramp strikes (about 40 frames, eased), ease flicker dips, fade blow-outs over about 12 frames. raea 3d solari lighting FLOOR3, 11-14
+A ShaderExtension's animation is frozen on its first frame A `ShaderExtension`'s uniforms are the first frame's, and `globals.time` doesn't advance in stills Carry time through an animated material value: `animate={{ emissive: track(KEYS) }}` with a key every frame on the base StandardMaterial, read in the shader as `material.emissive.r`. raea 3d shaders wgsl Fingerprint films, 11-13
+Splats draw each other's data or garbage slabs when one mounts or unmounts Splats swap data when one unmounts and another mounts Keep every `<Splat>` in the tree from the first frame and park the unused ones off stage (far `position`, `opacity={0}`). raea 3d splat Fingerprint films, 11-13
+A splat prop keeps an old value A splat prop left out of a frame keeps its last value Give every animated splat prop on every frame. raea 3d splat Fingerprint films, 11-13
+--w, --h or --frames are ignored by raea render The file has a `<Composition>`, whose size and length win Set `width`, `height` and `durationInFrames` on the `<Composition>`. raea render Fingerprint films, 11-13
+mix-blend-mode on a child draws blocky rectangles that move `mixBlendMode` on a child inside an `overflow: hidden`, `clipPath` or rotated box is drawn in mismatched rectangles (an engine gap) Use `backgroundImage` + `backgroundBlendMode` + `backgroundColor` on the card's own element, or bake the colour into the texture (ffmpeg `lutrgb`). raea css motion Fingerprint explainer, 11-12
+A long MP4 render is refused at the end after rendering everything Past 4 GB the MP4 writer has no 64-bit mdat (grain or noise at `--quality high` on a long film) Pass an explicit bitrate, e.g. `--kbps 40000`, instead of `--quality high`. MP4 MDAT box size exceeds u32::MAX raea render video essay, 11-21
+raea run prints nothing: no console.log, no result `raea run` shows neither console output nor the default export's value; a thrown error prints only its stack, which leaves the message out Throw what you want to read as the stack: `throw Object.assign(new Error(m), { stack: m })`. raea run gambit, 11-18
+raea run stops a script after two minutes `raea run` stops a script after 120 s by default Pass `--timeout SECONDS` (e.g. `--timeout 400`). didn't finish in 120 s raea run gambit, 11-18
+A WGSL pass silently does nothing although the render reports 0 errors A reserved WGSL word used as a name: `shared` (as a module file name), `filter` (as an entry point); also `common`, `smooth`, `target`, `module`, `meta`, `set`. Bevy logs the error once Rename it, and search the log for the shader error rather than trusting the error count. raea shaders wgsl bevy raea GI, 11-18
+Poly Haven glTF plants render every leaf card as a solid quad The base colour is a JPEG named diff-alpha, but JPEG carries no alpha Fetch the set's Alpha map, composite it into the diffuse as an RGBA PNG (`magick diff ( alpha -colorspace gray ) -alpha off -compose CopyOpacity -composite PNG32:out.png`) and set the material's alpha to MASK (BLEND isn't instanced by `<Instances>`). raea 3d blender Stay forest, 11-12
+raea show says the running app is older than raea show, but it isn't ~/.raea/app-host.json, which names the app's host, went missing Find the host's port (`pgrep -fl host.mjs`, its `--port N`) and run `RAEA_FEED_HOST=http://127.0.0.1:N raea show ...`; no restart needed. is older than raea show raea show app 11-18
+Bevy: a glTF's animation compiles and plays but the bones don't move A fresh entity with `AnimationPlayer` and `AnimationGraphHandle` isn't the player the glTF's bones are bound to Spawn the scene with `WorldAssetRoot`, observe `On<WorldInstanceReady>`, find the loader's `AnimationPlayer` among the scene's descendants, insert the `AnimationGraphHandle` there and play (Bevy's `examples/animation/animated_mesh.rs`). raea bevy 3d Bevy 0.20 trial, 11-23
+A GLB from Blender's web export doesn't load in Bevy Bevy 0.20's glTF loader doesn't support `EXT_meshopt_compression`, which Blender's web export marks required Export without meshopt (`export_meshopt_compression_enable=false`) for anything but three.js. EXT_meshopt_compression raea bevy blender 3d Bevy 0.20 trial, 11-23
+Bevy can't load assets outside assets/ The asset server reads only under `assets/` by default Set `AssetPlugin { file_path, .. }` (or `unapproved_path_mode`). raea bevy Bevy 0.20 trial, 11-23
+Blender clips start a frame late, and a loop holds its first pose at every seam The glTF export keeps the action's start frame Export with `export_anim_slide_to_zero=true`. raea blender 3d Blender 5.2 trial, 11-23
+A looping Blender animation dips or flattens at its ends Auto-clamped handles flatten at the first and last keys Add a `CYCLES` F-curve modifier before baking; `bake_action` and the glTF exporter read the evaluated curve. raea blender 3d Blender 5.2 trial, 11-23
+Blender turntable renders overexposed by about two stops under AgX The skill's `turntable.py` studio rig scales the key with distance squared Lower `view_settings.exposure` (about -2) or the lights' power, and check the 18% grey backdrop reads grey. It also resets the frame range to 1-120. raea blender lighting Blender 5.2 trial, 11-23
+three.js can't find a bone by its Blender name GLTFLoader strips `.` from node names: `hand.R` arrives as `handR` Look bones up by the stripped name (remove dots from Blender's). raea threejs blender three.js r187 trial, 11-23
+three.js: a skinned mesh's limb pops out of view when animated Skinned meshes are culled by their bind-pose bounds Set `frustumCulled = false` on skinned meshes, or grow their bounds to the clip's. raea threejs three.js r187 trial, 11-23
diff --git a/systems/fixes/Cargo.toml b/systems/fixes/Cargo.toml
new file mode 100644
index 00000000..732e3ab6
--- /dev/null
+++ b/systems/fixes/Cargo.toml
@@ -0,0 +1,12 @@
+[package]
+name = "raea-sys-fixes"
+version = "0.1.0"
+edition = "2024"
+license = "FSL-1.1-ALv2"
+publish = false
+description = "`raea fix`: a problem looked up in raea's own fixes (sdk/guides/fixes/raea.tsv) and a library of problem -> fix entries from permissively licensed skills and docs (a SQLite FTS5 file the release ships)"
+
+[dependencies]
+rusqlite = { version = "0.37", features = ["bundled"] }
+# where an install keeps its files (share/raea) and its models
+raea-io-home = { path = "../../io/home" }
diff --git a/systems/fixes/src/lib.rs b/systems/fixes/src/lib.rs
new file mode 100644
index 00000000..1e348695
--- /dev/null
+++ b/systems/fixes/src/lib.rs
@@ -0,0 +1,301 @@
+//! `raea fix SYMPTOM...`: a problem looked up before it's guessed at. Two sources, searched in this order:
+//!
+//! - raea's own entries, sdk/guides/fixes/raea.tsv in the checkout or an install's share/raea: problems found and fixed
+//! in raea work, each with where and when. Read whole into an in-memory FTS5 table on each call (a few dozen rows), so
+//! an edit to the file is live with no rebuild. An entry shows when it matches at least half the query's words.
+//! - the library, models/fixes/fixes-library.db (RAEA_FIXES names another file): about 46,000 problem -> fix entries
+//! taken from community skills and docs whose licences allow it (MIT, Apache-2.0, BSD, CC0, and every ClawHub skill,
+//! which is MIT-0), merged where several sources say the same. Built outside this repository by skillbase's
+//! `troubles.sh release`, pinned in tools/release/models.tsv, packed by tools/release.sh. Read-only SQLite; its
+//! sources and their licences are in meta 'notice' (`raea fix --notice`).
+//!
+//! The query: "quoted text" is a phrase searched in problems and error text; other words are searched one by one, ORed,
+//! after dropping stopwords and words found in more than 4% of the library's entries (they don't tell entries apart).
+//! A word naming a domain (bevy, blender, three, ffmpeg, ...) doesn't match on its own but ranks that domain's entries
+//! 2.5x. Ranking is BM25 over problem (x8), error text (x6), identifiers (x3), cause (x1.5), fix (x1) and other sources'
+//! fixes (x0.5), nudged by support (how many sources state the fix).
+use rusqlite::{Connection, OpenFlags, params};
+use std::path::PathBuf;
+
+#[cfg(test)]
+mod tests;
+
+pub const USAGE: &str = "raea fix SYMPTOM... [--domain DOMAIN] [--limit N] [--sources] [--notice]";
+pub const ABOUT: &str = "a problem looked up before you guess: what you see or the error text, \"quoted\" for an exact phrase; raea's own fixes first, then community skills' and docs'";
+
+const STOP: &[&str] = &[
+ "a", "an", "the", "and", "or", "of", "to", "in", "on", "for", "with", "by", "is", "are", "be", "it", "its", "this", "that", "my", "i", "me", "we",
+ "you", "how", "why", "what", "when", "does", "doesnt", "dont", "do", "not", "no", "but", "can", "cant", "cannot", "get", "gets", "got", "after",
+ "before", "while", "from", "into", "at", "as", "have", "has", "had", "was", "were", "will", "would", "should", "could", "any", "some", "all",
+ "just", "also", "so", "then", "than", "there", "their", "them", "they", "which",
+];
+/// query words that name a domain, and the domain tag they rank
+const DOMAINS: &[(&str, &str)] = &[
+ ("three", "threejs"), ("three.js", "threejs"), ("threejs", "threejs"), ("r3f", "r3f"), ("fiber", "r3f"), ("bevy", "bevy"), ("blender", "blender"), ("godot", "godot"),
+ ("unity", "unity"), ("unreal", "unreal"), ("webgpu", "webgpu"), ("ffmpeg", "ffmpeg"), ("shaders", "shaders"),
+ ("shader", "shaders"), ("glsl", "shaders"), ("wgsl", "shaders"), ("video", "video"), ("audio", "audio"), ("motion", "motion"),
+ ("solari", "solari"), ("raea", "raea"),
+];
+
+/// A query: its quoted phrases and its other words, lowercased, stopwords out
+#[derive(Debug, Default)]
+pub struct Query {
+ pub phrases: Vec<String>,
+ pub words: Vec<String>,
+}
+
+pub fn parse(q: &str) -> Query {
+ let mut out = Query::default();
+ let mut rest = String::new();
+ for (i, part) in q.split('"').enumerate() {
+ if i % 2 == 1 && !part.trim().is_empty() {
+ out.phrases.push(part.trim().to_string());
+ } else {
+ rest.push_str(part);
+ rest.push(' ');
+ }
+ }
+ for w in rest.to_lowercase().split(|c: char| !(c.is_alphanumeric() || matches!(c, '_' | '.' | ':'))) {
+ let w = w.trim_matches(|c| c == '.' || c == ':');
+ if w.chars().count() >= 2 && !STOP.contains(&w) && !out.words.iter().any(|x| x == w) {
+ out.words.push(w.to_string());
+ }
+ }
+ out
+}
+
+fn domain_of(w: &str) -> Option<&'static str> {
+ DOMAINS.iter().find(|(k, _)| *k == w).map(|(_, d)| *d)
+}
+
+/// The words that match: domain words only rank, unless they're all there is
+fn matching(words: &[String]) -> Vec<String> {
+ let plain: Vec<String> = words.iter().filter(|w| domain_of(w).is_none()).cloned().collect();
+ if plain.is_empty() { words.to_vec() } else { plain }
+}
+
+/// One entry found. `support` is None for raea's own (then `sources` says where and when it was found)
+#[derive(Debug)]
+pub struct Hit {
+ pub support: Option<i64>,
+ pub problem: String,
+ pub cause: String,
+ pub fix: String,
+ pub also: Vec<String>,
+ pub domains: String,
+ pub sources: String,
+}
+
+/// The library's file: RAEA_FIXES, else the install's (share/raea/models/fixes), else the models folder's (a checkout,
+/// where tools/release/models.tsv's download puts it)
+pub fn library_path() -> Option<PathBuf> {
+ let name = "fixes/fixes-library.db";
+ std::env::var_os("RAEA_FIXES")
+ .filter(|v| !v.is_empty())
+ .map(PathBuf::from)
+ .into_iter()
+ .chain([raea_io_home::home().join("models").join(name), raea_io_home::models().join(name)])
+ .find(|p| p.is_file())
+}
+
+pub fn open_library(path: &std::path::Path) -> Result<Connection, String> {
+ Connection::open_with_flags(path, OpenFlags::SQLITE_OPEN_READ_ONLY | OpenFlags::SQLITE_OPEN_NO_MUTEX).map_err(|e| format!("{}: {e}", path.display()))
+}
+
+fn quoted(t: &str) -> String {
+ format!("\"{}\"", t.replace('"', ""))
+}
+
+/// The library's entries for `q`, best first
+pub fn search_library(db: &Connection, q: &Query, domain: Option<&str>, n: usize) -> Result<Vec<Hit>, String> {
+ let e = |e: rusqlite::Error| format!("raea fix: the library: {e}");
+ let total: i64 = db
+ .query_row("SELECT v FROM meta WHERE k = 'fixes'", [], |r| r.get::<_, String>(0))
+ .ok()
+ .and_then(|v| v.parse().ok())
+ .map_or_else(|| db.query_row("SELECT count(*) FROM fixes", [], |r| r.get(0)).map_err(e), Ok)?;
+ let cap = total / 25 + 1;
+ // words too common to tell entries apart go; if every word is that common, keep them all
+ let mut count = db.prepare("SELECT count(*) FROM (SELECT 1 FROM fixes_fts WHERE fixes_fts MATCH ?1 LIMIT ?2)").map_err(e)?;
+ let mut keep = Vec::new();
+ for w in &q.words {
+ let c: i64 = count.query_row(params![quoted(w), cap], |r| r.get(0)).map_err(e)?;
+ if c > 0 && c < cap {
+ keep.push(w.clone());
+ }
+ }
+ if keep.is_empty() && q.phrases.is_empty() {
+ keep = q.words.clone();
+ }
+ let terms: Vec<String> = q
+ .phrases
+ .iter()
+ .map(|p| format!("{{problem errors}}: {}", quoted(p)))
+ .chain(matching(&keep).iter().map(|w| quoted(w)))
+ .collect();
+ if terms.is_empty() {
+ return Ok(Vec::new());
+ }
+ // the boosts name only domains from DOMAINS, so they're written into the SQL; the rest are parameters
+ let boost: String = q.words.iter().filter_map(|w| domain_of(w)).map(|d| format!(" * (CASE WHEN (' ' || f.domains || ' ') LIKE '% {d} %' THEN 2.5 ELSE 1.0 END)")).collect();
+ let sql = format!(
+ "SELECT f.support, f.problem, coalesce(f.cause, ''), f.fix, coalesce(f.also, ''), coalesce(f.domains, ''), coalesce(f.sources, '')
+ FROM fixes_fts JOIN fixes f ON f.id = fixes_fts.rowid
+ WHERE fixes_fts MATCH ?1 AND (?2 = '' OR (' ' || f.domains || ' ') LIKE '% ' || ?2 || ' %')
+ ORDER BY bm25(fixes_fts, 8.0, 6.0, 3.0, 1.5, 1.0, 0.5) * (1.0 + 0.06 * min(f.support, 10)){boost} LIMIT ?3"
+ );
+ let mut st = db.prepare(&sql).map_err(e)?;
+ let rows = st
+ .query_map(params![terms.join(" OR "), domain.unwrap_or(""), n as i64], |r| {
+ Ok(Hit {
+ support: Some(r.get(0)?),
+ problem: r.get(1)?,
+ cause: r.get(2)?,
+ fix: r.get(3)?,
+ also: r.get::<_, String>(4)?.lines().filter(|l| !l.trim().is_empty()).map(str::to_string).collect(),
+ domains: r.get(5)?,
+ sources: r.get(6)?,
+ })
+ })
+ .map_err(e)?;
+ rows.collect::<Result<_, _>>().map_err(e)
+}
+
+/// raea's own entries, one a line: problem, cause, fix, error text, domains, where found (tab-separated; # comments)
+pub fn own_entries(text: &str) -> Vec<[String; 6]> {
+ text.lines()
+ .filter(|l| !l.starts_with('#') && !l.trim().is_empty())
+ .filter_map(|l| {
+ let p: Vec<&str> = l.split('\t').collect();
+ (p.len() == 6).then(|| std::array::from_fn(|i| p[i].trim().to_string()))
+ })
+ .collect()
+}
+
+/// raea's own entries for `q`: those matching at least half its words (or a phrase), most words matched first
+pub fn search_own(rows: &[[String; 6]], q: &Query, domain: Option<&str>, n: usize) -> Result<Vec<Hit>, String> {
+ let e = |e: rusqlite::Error| format!("raea fix: raea's own entries: {e}");
+ let db = Connection::open_in_memory().map_err(e)?;
+ db.execute_batch("CREATE VIRTUAL TABLE own USING fts5(problem, errors, cause, fix, domains UNINDEXED, found UNINDEXED, tokenize='porter unicode61 remove_diacritics 2');")
+ .map_err(e)?;
+ let mut ins = db.prepare("INSERT INTO own(rowid, problem, cause, fix, errors, domains, found) VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7)").map_err(e)?;
+ for (i, r) in rows.iter().enumerate() {
+ ins.execute(params![i as i64, r[0], r[1], r[2], r[3], r[4], r[5]]).map_err(e)?;
+ }
+ let words = matching(&q.words);
+ let need = words.len().div_ceil(2).max(1);
+ let mut st = db.prepare("SELECT rowid, bm25(own, 8.0, 6.0, 1.5, 1.0) FROM own WHERE own MATCH ?1").map_err(e)?;
+ // rowid -> (words matched, best bm25)
+ let mut score: std::collections::HashMap<i64, (usize, f64)> = Default::default();
+ let mut tally = |m: String, weight: usize| -> Result<(), String> {
+ for hit in st.query_map([m], |r| Ok((r.get::<_, i64>(0)?, r.get::<_, f64>(1)?))).map_err(e)? {
+ let (id, b) = hit.map_err(e)?;
+ let s = score.entry(id).or_insert((0, 0.0));
+ s.0 += weight;
+ s.1 = s.1.min(b);
+ }
+ Ok(())
+ };
+ for p in &q.phrases {
+ tally(format!("{{problem errors}}: {}", quoted(p)), need)?;
+ }
+ for w in &words {
+ tally(quoted(w), 1)?;
+ }
+ let mut ids: Vec<(i64, (usize, f64))> = score.into_iter().filter(|(_, s)| s.0 >= need).collect();
+ ids.retain(|(id, _)| domain.is_none_or(|d| rows[*id as usize][4].split_whitespace().any(|x| x == d)));
+ ids.sort_by(|a, b| b.1.0.cmp(&a.1.0).then(a.1.1.total_cmp(&b.1.1)));
+ Ok(ids
+ .into_iter()
+ .take(n)
+ .map(|(id, _)| {
+ let r = &rows[id as usize];
+ Hit { support: None, problem: r[0].clone(), cause: r[1].clone(), fix: r[2].clone(), also: Vec::new(), domains: r[4].clone(), sources: r[5].clone() }
+ })
+ .collect())
+}
+
+fn wrap(t: &str, indent: &str) -> String {
+ let (mut out, mut line) = (String::new(), String::new());
+ for w in t.split_whitespace() {
+ if !line.is_empty() && line.chars().count() + w.chars().count() > 104 {
+ out.push_str(&line);
+ out.push('\n');
+ out.push_str(indent);
+ line.clear();
+ }
+ if !line.is_empty() {
+ line.push(' ');
+ }
+ line.push_str(w);
+ }
+ out + &line
+}
+
+fn cut(t: &str, n: usize) -> String {
+ if t.chars().count() <= n { t.to_string() } else { t.chars().take(n).collect::<String>() + " ..." }
+}
+
+/// Hits as raea fix prints them
+pub fn render(hits: &[Hit], sources: bool) -> String {
+ let mut out = String::new();
+ for h in hits {
+ let head = h.support.map_or_else(|| "raea".to_string(), |s| format!("{s:>4}"));
+ out += &format!("{head} {}\n", wrap(&h.problem, " "));
+ if !h.cause.is_empty() {
+ out += &format!(" cause: {}\n", wrap(&h.cause, " "));
+ }
+ out += &format!(" fix: {}\n", wrap(&cut(&h.fix, 600), " "));
+ for a in h.also.iter().take(2) {
+ out += &format!(" also: {}\n", wrap(&cut(a, 240), " "));
+ }
+ match (h.support, sources) {
+ (None, _) => out += &format!(" [{}] found in raea work: {}\n\n", h.domains, h.sources),
+ (Some(_), true) => out += &format!(" [{}] from {}\n\n", h.domains, h.sources.replace(',', ", ")),
+ (Some(_), false) => out += &format!(" [{}]\n\n", h.domains),
+ }
+ }
+ out
+}
+
+/// `raea fix SYMPTOM... [--domain DOMAIN] [--limit N] [--sources] [--notice]`
+pub fn cli(args: &[String]) -> Result<String, String> {
+ let (mut words, mut domain, mut limit, mut sources, mut notice) = (Vec::new(), None::<String>, 6usize, false, false);
+ let mut it = args.iter();
+ while let Some(a) = it.next() {
+ match a.as_str() {
+ "--domain" => domain = Some(it.next().ok_or("raea fix: --domain takes a domain (bevy, blender, threejs, shaders, ffmpeg, ...)")?.to_lowercase()),
+ "--limit" => limit = it.next().and_then(|n| n.parse().ok()).filter(|n| *n > 0).ok_or("raea fix: --limit takes a count")?,
+ "--sources" => sources = true,
+ "--notice" => notice = true,
+ w => words.push(w.to_string()),
+ }
+ }
+ let library = library_path();
+ if notice {
+ let path = library.ok_or("raea fix: the library isn't installed here (reinstall raea: curl -fsSL https://raea.io/install | sh)")?;
+ return open_library(&path)?.query_row("SELECT v FROM meta WHERE k = 'notice'", [], |r| r.get(0)).map_err(|e| format!("raea fix: {e}"));
+ }
+ let text = words.join(" ");
+ let q = parse(&text);
+ if q.words.is_empty() && q.phrases.is_empty() {
+ return Err(format!("usage: {USAGE}\n describe what you see (\"shadows cut off\", \"mesh renders black\") or give the error text in quotes"));
+ }
+ let own_file = raea_io_home::home().join("sdk/guides/fixes/raea.tsv");
+ let own_rows = own_entries(&std::fs::read_to_string(&own_file).unwrap_or_default());
+ let mut hits = search_own(&own_rows, &q, domain.as_deref(), 3)?;
+ let mut note = String::new();
+ match &library {
+ Some(path) => hits.extend(search_library(&open_library(path)?, &q, domain.as_deref(), limit)?),
+ None => note = "raea fix: the library of community fixes isn't installed here; raea's own entries only (reinstall raea for it)\n".into(),
+ }
+ if hits.is_empty() {
+ return Err(format!("{note}raea fix: nothing matches \"{text}\": say what you see in other words, or quote the exact error text"));
+ }
+ let community = hits.iter().any(|h| h.support.is_some());
+ let mut out = render(&hits, sources);
+ if community {
+ out += "Numbered entries come from community skills and docs (the number: how many sources state it), not checked in raea;\nconfirm a fix on a frame. raea fix --sources names them, --notice their licences.\n";
+ }
+ Ok(note + &out)
+}
diff --git a/systems/fixes/src/tests.rs b/systems/fixes/src/tests.rs
new file mode 100644
index 00000000..cc0a71b5
--- /dev/null
+++ b/systems/fixes/src/tests.rs
@@ -0,0 +1,127 @@
+use super::*;
+
+/// A library with skillbase fixes.py's schema, in memory
+fn library(rows: &[(i64, &str, &str, &str, &str, &str)]) -> Connection {
+ let db = Connection::open_in_memory().unwrap();
+ db.execute_batch(
+ "CREATE TABLE fixes(id INTEGER PRIMARY KEY, support INTEGER, problem TEXT, cause TEXT, fix TEXT, also TEXT, errors TEXT,
+ idents TEXT, domains TEXT, how TEXT, sources TEXT);
+ CREATE TABLE meta(k TEXT PRIMARY KEY, v TEXT);",
+ )
+ .unwrap();
+ for (support, problem, cause, fix, errors, domains) in rows {
+ db.execute(
+ "INSERT INTO fixes(support, problem, cause, fix, also, errors, idents, domains, how, sources) VALUES (?1, ?2, ?3, ?4, '', ?5, '', ?6, 'table', 'a/b')",
+ params![support, problem, cause, fix, errors, domains],
+ )
+ .unwrap();
+ }
+ db.execute_batch(
+ "CREATE VIRTUAL TABLE fixes_fts USING fts5(problem, errors, idents, cause, fix, also, content='fixes', content_rowid='id',
+ tokenize='porter unicode61 remove_diacritics 2');
+ INSERT INTO fixes_fts(rowid, problem, errors, idents, cause, fix, also) SELECT id, problem, errors, idents, cause, fix, also FROM fixes;",
+ )
+ .unwrap();
+ db
+}
+
+fn sample() -> Connection {
+ let mut rows = vec![
+ (2, "Shadows cut off or blocky", "the shadow camera doesn't cover the scene", "Fit the orthographic shadow camera and raise mapSize", "", "threejs 3d"),
+ (1, "Shadow acne on lit surfaces", "bias too small", "Raise shadow.bias a little", "", "threejs"),
+ (1, "Shadows missing in the game", "the light doesn't cast", "Enable shadows on the DirectionalLight", "", "bevy 3d"),
+ (1, "Weights all zero after binding", "", "Count weighted vertices after binding", "Bone Heat Weighting: failed to find solution for one or more bones", "blender"),
+ ];
+ // filler, so "shadows" stays under the 4%-of-entries cut
+ for i in 0..200 {
+ rows.push((1, "Unrelated problem", "", "Something else entirely", "", if i % 2 == 0 { "ffmpeg" } else { "video" }));
+ }
+ library(&rows)
+}
+
+#[test]
+fn parse_keeps_phrases_and_drops_stopwords() {
+ let q = parse(r#"why is my "Bone Heat Weighting: failed" mesh black in three.js"#);
+ assert_eq!(q.phrases, vec!["Bone Heat Weighting: failed"]);
+ assert_eq!(q.words, vec!["mesh", "black", "three.js"]);
+}
+
+#[test]
+fn library_ranks_the_problem_match_first() {
+ let hits = search_library(&sample(), &parse("shadows look blocky, cut off"), None, 3).unwrap();
+ assert_eq!(hits[0].problem, "Shadows cut off or blocky");
+}
+
+#[test]
+fn a_domain_word_ranks_without_matching() {
+ let hits = search_library(&sample(), &parse("bevy shadows missing"), None, 3).unwrap();
+ assert_eq!(hits[0].domains, "bevy 3d");
+ // "bevy" alone matches nothing extra: every hit still matches a plain word
+ assert!(hits.iter().all(|h| h.problem.to_lowercase().contains("shadow")));
+}
+
+#[test]
+fn a_quoted_error_matches_the_error_text() {
+ let hits = search_library(&sample(), &parse(r#""failed to find solution""#), None, 3).unwrap();
+ assert_eq!(hits.len(), 1);
+ assert_eq!(hits[0].problem, "Weights all zero after binding");
+}
+
+#[test]
+fn domain_filters() {
+ let hits = search_library(&sample(), &parse("shadows"), Some("bevy"), 5).unwrap();
+ assert_eq!(hits.len(), 1);
+ assert_eq!(hits[0].domains, "bevy 3d");
+}
+
+#[test]
+fn own_entries_need_half_the_words() {
+ let rows = own_entries("# c\nText3D words sit left\tcentred origin\tlay out by centres\t\traea 3d\tfilm, 11-10\nSky cut off\tfar plane\traise far\t\traea 3d\tfilm, 11-10\n");
+ assert_eq!(rows.len(), 2);
+ let hits = search_own(&rows, &parse("my Text3D words are placed too far left"), None, 3).unwrap();
+ assert_eq!(hits.len(), 1);
+ assert_eq!(hits[0].problem, "Text3D words sit left");
+ // one word of five isn't enough
+ assert!(search_own(&rows, &parse("sky colour wrong under fog at dusk"), None, 3).unwrap().is_empty());
+}
+
+#[test]
+fn the_shipped_own_entries_parse() {
+ let text = include_str!("../../../sdk/guides/fixes/raea.tsv");
+ let lines = text.lines().filter(|l| !l.starts_with('#') && !l.trim().is_empty()).count();
+ let rows = own_entries(text);
+ assert_eq!(rows.len(), lines, "every entry in raea.tsv has six tab-separated columns");
+ assert!(rows.iter().all(|r| !r[0].is_empty() && !r[2].is_empty() && r[4].split_whitespace().any(|d| d == "raea") && !r[5].is_empty()));
+}
+
+#[test]
+fn render_marks_raea_entries() {
+ let rows = own_entries("Sky cut off\tfar plane\traise far\t\traea 3d\tfilm, 11-10\n");
+ let out = render(&search_own(&rows, &parse("sky cut off"), None, 3).unwrap(), false);
+ assert!(out.starts_with("raea Sky cut off\n"));
+ assert!(out.contains("found in raea work: film, 11-10"));
+}
+
+/// Against a real library: `RAEA_FIXES=PATH cargo test -p raea-sys-fixes --release -- --ignored --nocapture`. Prints each
+/// query's hits and time, and fails if a known problem's fix isn't in its top three.
+#[test]
+#[ignore]
+fn real_library() {
+ let db = open_library(&library_path().expect("RAEA_FIXES names no file")).unwrap();
+ let cases = [
+ ("shadows look blocky or cut off", "shadow"),
+ ("blender render fireflies", "clamp"),
+ ("three.js colors washed out", "colorspace"),
+ (r#""failed to find solution for one or more bones""#, "weight"),
+ ("ffmpeg audio out of sync", "sync"),
+ ("mesh renders black", "normal"),
+ ];
+ for (q, want) in cases {
+ let t = std::time::Instant::now();
+ let hits = search_library(&db, &parse(q), None, 3).unwrap();
+ let ms = t.elapsed().as_secs_f64() * 1000.0;
+ println!("--- {q} ({ms:.1} ms)\n{}", render(&hits, false));
+ let top = hits.iter().map(|h| format!("{} {} {}", h.problem, h.cause, h.fix).to_lowercase().replace([' ', '_'], "")).collect::<Vec<_>>();
+ assert!(top.iter().any(|t| t.contains(want)), "{q}: no top-3 hit mentions {want}");
+ }
+}
diff --git a/tools/manual-ref/cli.ts b/tools/manual-ref/cli.ts
index 95f2e6ec..853df2d0 100644
--- a/tools/manual-ref/cli.ts
+++ b/tools/manual-ref/cli.ts
@@ -31,7 +31,7 @@ const GROUPS: [string, string, string[]][] = [
["Footage", "Takes, cuts and the camera, from your own media.", ["media", "cut", "frame", "track", "splat", "mezz", "neural"]],
["Sound", "Music read, foley and instruments made on this machine.", ["song", "sounds", "sao", "tokensynth", "setup-audio"]],
["Generate and 3D tools", "Generated media, physics and weathering bakes, clothes and motion for SOMA's body, Blender and Godot.", ["gen", "physics", "wear", "clothes", "motion", "blender", "godot"]],
- ["Agents and setup", "What an agent reads and shows the person, and the tools raea installs.", ["guide", "context", "notes", "show", "skill", "skills", "setup", "bug", "ask"]],
+ ["Agents and setup", "What an agent reads and shows the person, and the tools raea installs.", ["guide", "fix", "context", "notes", "show", "skill", "skills", "setup", "bug", "ask"]],
]
/** A verb's page: VERB.md, but index.md is this section's own page, so raea index's is indexer.md */
const pageOf = (verb: string) => (verb === "index" ? "indexer.md" : `${verb}.md`)
diff --git a/tools/release.sh b/tools/release.sh
index efe1ece9..6000e2ee 100755
--- a/tools/release.sh
+++ b/tools/release.sh
@@ -171,7 +171,7 @@ done
# (@raea/ui, the page's DOM every render goes through, isn't an @raea/<name> path, so it's named here)
git archive "$ref" sdk/tsconfig.base.json sdk/ui/src sdk/ui/package.json sdk/ui/bevy sdk/raea/src sdk/raea/library sdk/raea/package.json sdk/react/js/src sdk/react/js/lite sdk/react/js/shims sdk/react/js/package.json sdk/react/js/tsconfig.json sdk/shell/src \
"${pkgs[@]}" \
- tools/tokensynth tools/sao tools/goo tools/splat tools/matchmove tools/local_setup.py tools/clothes tools/garments tools/ensure.sh sdk/guides/craft docs/sdk-coverage.md engine/cli/template/theme.css ':(glob)engine/cli/src/*.ts' \
+ tools/tokensynth tools/sao tools/goo tools/splat tools/matchmove tools/local_setup.py tools/clothes tools/garments tools/ensure.sh sdk/guides/craft sdk/guides/fixes docs/sdk-coverage.md engine/cli/template/theme.css ':(glob)engine/cli/src/*.ts' \
| tar -x -C "$stage/share/raea"
# a folder copied as it is here (links kept, as rsync -a; tar, since Git's bash on Windows has no rsync)
copy() { mkdir -p "$2" && tar -C "$(dirname "$1")" --exclude .cache -cf - "$(basename "$1")" | tar -C "$2" -xf -; }
@@ -181,6 +181,9 @@ copy sdk/react/tw/node_modules/tailwindcss "$stage/share/raea/sdk/react/tw/node_
# (raea_io_home::models: ~/.local/share/raea-models, %LOCALAPPDATA%\raea\models on Windows); every platform since #43
mkdir -p "$stage/share/raea/models/beat-this"
cp ~/.local/share/raea-models/beat-this/beat_this_small0.onnx "$stage/share/raea/models/beat-this/"
+# `raea fix`'s library (systems/fixes reads it here, read-only): pinned in tools/release/models.tsv like the models
+mkdir -p "$stage/share/raea/models/fixes"
+cp ~/.local/share/raea-models/fixes/fixes-library.db "$stage/share/raea/models/fixes/"
# the agent skill (raea: raea-skills at the commit REF pins), which the installer copies into
# ~/.claude/skills; raea-work (sdk/skills, work.raea.io's showcase pages) is internal and stays out. Only the skill
# folders (each with its SKILL.md) ship: raea-skills' skills/ is also its Claude plugin, whose manifest, hooks, README
diff --git a/tools/release/models.tsv b/tools/release/models.tsv
index 2a615478..c980f661 100644
--- a/tools/release/models.tsv
+++ b/tools/release/models.tsv
@@ -3,3 +3,6 @@
# (docs/public-first.feature PF5); the sha256 is of the copy tools/release.sh packs on the release Mac.
# Beat This! small0 (MIT, github.com/CPJKU/beat_this), converted to ONNX for raea song
beat-this/beat_this_small0.onnx https://github.com/shinyobjectz/raea/releases/download/models-1/beat_this_small0.onnx 3f650a9f36d708d575808220a2874b0b84cf402db645b7eac2d9069a53642d4b
+# raea fix's library (systems/fixes): ~46,500 problem -> fix entries from MIT, Apache-2.0, BSD, CC0 and ClawHub (MIT-0)
+# skills and docs, built by skillbase's troubles.sh release; its sources and licences are in its meta 'notice' (raea fix --notice)
+fixes/fixes-library.db https://github.com/shinyobjectz/raea/releases/download/models-1/fixes-library-202b3fec.db 202b3feca549731844ccfd2486d39068488cd8481944931873ebf645229ec751