← Commit history
AI Flow 0.2.94: circuit explorer released; page packages on first use
Co-Authored-By: Claude Opus 5.5 <[email protected]>
8 files changed
+45−15
Cargo.lock+10−10@@ -4,7 +4,7 @@ version = 4 [[package]] name = "adom-aiflow"-version = "0.2.93"+version = "0.2.94" dependencies = [ "aiflow-analyze", "aiflow-board",@@ -25,7 +25,7 @@ dependencies = [ [[package]] name = "aiflow-analyze"-version = "0.2.93"+version = "0.2.94" dependencies = [ "aiflow-board", "serde",@@ -35,7 +35,7 @@ dependencies = [ [[package]] name = "aiflow-board"-version = "0.2.93"+version = "0.2.94" dependencies = [ "roxmltree", "serde",@@ -44,7 +44,7 @@ dependencies = [ [[package]] name = "aiflow-bridge"-version = "0.2.93"+version = "0.2.94" dependencies = [ "aiflow-board", "serde",@@ -53,7 +53,7 @@ dependencies = [ [[package]] name = "aiflow-copper"-version = "0.2.93"+version = "0.2.94" dependencies = [ "aiflow-board", "aiflow-grid",@@ -63,7 +63,7 @@ dependencies = [ [[package]] name = "aiflow-grid"-version = "0.2.93"+version = "0.2.94" dependencies = [ "aiflow-board", "serde",@@ -72,7 +72,7 @@ dependencies = [ [[package]] name = "aiflow-place"-version = "0.2.93"+version = "0.2.94" dependencies = [ "aiflow-board", "serde",@@ -81,7 +81,7 @@ dependencies = [ [[package]] name = "aiflow-pours"-version = "0.2.93"+version = "0.2.94" dependencies = [ "aiflow-board", "aiflow-copper",@@ -91,7 +91,7 @@ dependencies = [ [[package]] name = "aiflow-router"-version = "0.2.93"+version = "0.2.94" dependencies = [ "aiflow-board", "aiflow-grid",@@ -101,7 +101,7 @@ dependencies = [ [[package]] name = "aiflow-run"-version = "0.2.93"+version = "0.2.94" dependencies = [ "serde", "serde_json",
Cargo.toml+1−1@@ -14,7 +14,7 @@ members = [ ] [workspace.package]-version = "0.2.93"+version = "0.2.94" edition = "2021" license = "MIT" repository = "https://wiki.adom.inc/adom/adom-aiflow"
bin/adom-aiflow⋯ 1 unchanged line ⋯
crates/adom-aiflow/src/main.rs+18@@ -2917,6 +2917,23 @@ fn abs_path(p: &str) -> String { std::fs::canonicalize(&pb).unwrap_or(pb).display().to_string() } +/// The page build's Python packages (board pictures, figures, part pictures), installed into AI Flow's own Python the+/// first time a page is built rather than on every install (an install is what the Hydrogen dock once timed out on).+/// A failure is a note: the build still runs and says which pictures it left out.+fn ensure_page_packages(dir: &Path) {+ let py = aiflow_python();+ let have = std::process::Command::new(&py).args(["-c", "import PIL, matplotlib, cairosvg"]).stdin(std::process::Stdio::null()).output().map(|o| o.status.success()).unwrap_or(false);+ if have { return; }+ let own = std::env::var_os("HOME").map(|h| PathBuf::from(h).join(".local/share/adom-aiflow/python/bin/python3")).filter(|p| *p == py);+ let Some(own) = own else { eprintln!("NOTE: the page build's packages (Pillow, matplotlib, cairosvg) are missing from {}: board pictures and figures are left out until they are installed", py.display()); return; };+ let req = dir.join("project-page").join("requirements-page.txt");+ let _ = std::fs::write(&req, include_str!("../../../tools/requirements-page.txt"));+ eprintln!("installing the page build's packages (Pillow, matplotlib, cairosvg) once, into AI Flow's own Python");+ let ok = std::process::Command::new("python3").args(["-m", "pip", "--python"]).arg(&own).args(["install", "--disable-pip-version-check", "-q", "-r"]).arg(&req)+ .stdin(std::process::Stdio::null()).status().map(|s| s.success()).unwrap_or(false);+ if !ok { eprintln!("NOTE: the page build's packages could not be installed (see above): board pictures and figures are left out; `python3 -m pip --python {} install -r <adom-aiflow>/tools/requirements-page.txt` adds them", own.display()); }+}+ /// The page builder: tools/page-build.py with the explorer's symbols, script and style in front of it. fn run_page_build(cfg: &Value, dir: &Path) -> Value { let assets = json!({"symbols": include_str!("../../../tools/page-explorer/symbols.json"), "js": include_str!("../../../tools/page-explorer/explorer.js"), "css": include_str!("../../../tools/page-explorer/explorer.css")});@@ -2927,6 +2944,7 @@ fn run_page_build(cfg: &Value, dir: &Path) -> Value { // written beside the config and run as a file: the script with its assets is longer than one argument may be let sp = dir.join("project-page").join("page-build.py"); if let Err(e) = std::fs::write(&sp, &script) { return json!({"ok": false, "error": format!("{}: {e}", sp.display())}); }+ ensure_page_packages(dir); match std::process::Command::new(aiflow_python()).arg(&sp).arg(&cfgp).stdin(std::process::Stdio::null()).output() { Err(e) => json!({"ok": false, "error": format!("python3: {e}")}), Ok(o) => serde_json::from_slice(&o.stdout).unwrap_or_else(|_| json!({"ok": false, "error": aiflow_run::clip_text(&format!("{}{}", String::from_utf8_lossy(&o.stdout), String::from_utf8_lossy(&o.stderr)), 900)})),
docs/release-0.2.94.mdadded+12@@ -0,0 +1,12 @@+# AI Flow 0.2.94++- **The circuit explorer and the project page build** (Noah, PR #139; issues #131, #164, #197, #198, #200).+ `project-page --molecule-bundle <folder>` builds the page people read: the board's top and bottom, its contacts, the+ circuit explorer (an interactive schematic: a flowchart of blocks, each drawn as the AI's own small drawing and+ checked against the netlist), the simulation figures and numbers, the components with prices and buy links,+ manufacturing and open items. `project-page check` checks the built page (findings, never a stop), and `finish`+ lists its findings as open items: an auto-drawn explorer block (#197), a flowchart past 15 blocks (#198). BOM lines+ with no part number (bare test pads, machine pins, contacts) cover their references (#200).+- **The page build's Python packages (Pillow, matplotlib, cairosvg) are installed the first time a page is built**,+ into AI Flow's own Python, not on every install, so installing AI Flow stays as quick as before. If they cannot be+ installed, the build still runs and says which pictures it left out.
install.sh+2−2@@ -18,8 +18,8 @@ ln -sf "$HERE/tools/silkscreen-dashboard/server.py" "$HOME/.local/bin/adom-aiflo AIFLOW_PY_ENV="$HOME/.local/share/adom-aiflow/python" python3 -m venv --without-pip "$AIFLOW_PY_ENV" python3 -m pip --python "$AIFLOW_PY_ENV/bin/python3" install --disable-pip-version-check -r "$HERE/tools/requirements-silkscreen.txt"-# the project page build (project-page --molecule-bundle): board pictures, figures and part pictures-python3 -m pip --python "$AIFLOW_PY_ENV/bin/python3" install --disable-pip-version-check -r "$HERE/tools/requirements-page.txt"+# the project page build's packages (Pillow, matplotlib, cairosvg) are installed the first time+# `project-page --molecule-bundle` runs, not here: every install stays as small and quick as it was for helper in aiflow-widget library-tour; do chmod +x "$HERE/tools/$helper.py" done
package.json+1−1@@ -1,7 +1,7 @@ { "slug": "adom-aiflow", "type": "app",- "version": "0.2.93",+ "version": "0.2.94", "title": "AI Flow", "description": "Adom's AI Flow: a tool to help the AI follow all of the steps it takes to build a board. One Rust binary with a crate per step (placement helpers, a grid router with Kelvin taps, pours with keepouts, KiCad's DRC gate, live landing through the KiCad Bridge, copper measurement, current and thermal analysis) and a finish line that refuses an unfinished board. Every command answers with hints for the AI; every turn, its thinking time and every rework loop go into run.jsonl, so Claude, Codex and any other engine are compared on the same flow. KiCad, Fusion 360 and Altium Designer today (the same steps and gates through each tool's bridge); Adom's own web apps next.", "summary": "Adom's AI Flow: a tool to help the AI follow all of the steps it takes to build a board. The AI thinks its way from placement through routing, pours, current and thermal analysis to a delivered video; the binary does the fast, deterministic parts of every step, hands back hints, and keeps a ledger of every turn, every return to an earlier step, and the clock from the prompt to done.",
page.json+1−1@@ -1,7 +1,7 @@ { "slug": "adom-aiflow", "type": "app",- "version": "0.2.93",+ "version": "0.2.94", "title": "AI Flow", "description": "Adom's AI Flow: a tool to help the AI follow all of the steps it takes to build a board. One Rust binary with a crate per step (placement helpers, a grid router with Kelvin taps, pours with keepouts, KiCad's DRC gate, live landing through the KiCad Bridge, copper measurement, current and thermal analysis) and a finish line that refuses an unfinished board. Every command answers with hints for the AI; every turn, its thinking time and every rework loop go into run.jsonl, so Claude, Codex and any other engine are compared on the same flow. KiCad, Fusion 360 and Altium Designer today (the same steps and gates through each tool's bridge); Adom's own web apps next.", "summary": "Adom's AI Flow: a tool to help the AI follow all of the steps it takes to build a board. The AI thinks its way from placement through routing, pours, current and thermal analysis to a delivered video; the binary does the fast, deterministic parts of every step, hands back hints, and keeps a ledger of every turn, every return to an earlier step, and the clock from the prompt to done.",