← Commit history
Cargo.lock+10−10
@@ -4,7 +4,7 @@ version = 4  [[package]] name = "adom-aiflow"-version = "0.2.86"+version = "0.2.87" dependencies = [  "aiflow-analyze",  "aiflow-board",@@ -25,7 +25,7 @@ dependencies = [  [[package]] name = "aiflow-analyze"-version = "0.2.86"+version = "0.2.87" dependencies = [  "aiflow-board",  "serde",@@ -35,7 +35,7 @@ dependencies = [  [[package]] name = "aiflow-board"-version = "0.2.86"+version = "0.2.87" dependencies = [  "roxmltree",  "serde",@@ -44,7 +44,7 @@ dependencies = [  [[package]] name = "aiflow-bridge"-version = "0.2.86"+version = "0.2.87" dependencies = [  "aiflow-board",  "serde",@@ -53,7 +53,7 @@ dependencies = [  [[package]] name = "aiflow-copper"-version = "0.2.86"+version = "0.2.87" dependencies = [  "aiflow-board",  "aiflow-grid",@@ -63,7 +63,7 @@ dependencies = [  [[package]] name = "aiflow-grid"-version = "0.2.86"+version = "0.2.87" dependencies = [  "aiflow-board",  "serde",@@ -72,7 +72,7 @@ dependencies = [  [[package]] name = "aiflow-place"-version = "0.2.86"+version = "0.2.87" dependencies = [  "aiflow-board",  "serde",@@ -81,7 +81,7 @@ dependencies = [  [[package]] name = "aiflow-pours"-version = "0.2.86"+version = "0.2.87" dependencies = [  "aiflow-board",  "aiflow-copper",@@ -91,7 +91,7 @@ dependencies = [  [[package]] name = "aiflow-router"-version = "0.2.86"+version = "0.2.87" dependencies = [  "aiflow-board",  "aiflow-grid",@@ -101,7 +101,7 @@ dependencies = [  [[package]] name = "aiflow-run"-version = "0.2.86"+version = "0.2.87" dependencies = [  "serde",  "serde_json",
Cargo.toml+1−1
@@ -14,7 +14,7 @@ members = [ ]  [workspace.package]-version = "0.2.86"+version = "0.2.87" edition = "2021" license = "MIT" repository = "https://wiki.adom.inc/adom/adom-aiflow"
SKILL.md+3−2
@@ -30,7 +30,7 @@ Every step in the flow runs, whatever the board's size or the token cost. A simp  - **This rule is for a full run.** When the human asks for one part of AI Flow (just route this board, just the pours, just the current and thermal analysis, just the export, just a molecule check), do that part: its command, or the adom-aiflow-routing skill for routing alone. The steps they did not ask for are their choice, not a skip. - **Only the human skips a step**, by saying so for this board or through their hands-on flow profile. Never decide on your own that a step is not needed to save tokens or time. If you think one is not needed, ask in one line without waiting, and keep running the steps. When they agree, record their words: `adom-aiflow deviate "step <name>" --why "<why this board does not need it>" --human-ok "<what they said>"`. A step with nothing to act on (no hot parts, nothing for Fields to solve) records itself as not applicable; that is not a skip.-- **A failing step is yours to fix, inside AI Flow.** You do the heavy lifting: read the error and its Hint, debug, retry (a fresh measurement, the right machine, a newer bridge), and fix the cause. Your own script for the step's work is fine, and so is a patch to AI Flow itself with a PR, as long as the step stays in the flow: declared with `step`, its proof recorded, and what you did told to the human in a line. File what broke (`adom-wiki issue create adom/adom-aiflow` with the version, the command and the exact error, or on the bridge's page when the bridge failed; `giveback` for your fix) and keep going; never stop to wait on it. Leaving the flow (dropping the step, or your own result in place of its proof) is the human's call: ask without waiting and keep working; with their OK, record it: `adom-aiflow deviate "step <name>" --replaced-by "<what you did instead>" --why "<the error>" --human-ok "<what they said>"`.+- **A failing step is yours to fix, inside AI Flow.** You do the heavy lifting: read the error and its Hint, debug, retry (a fresh measurement, the right machine, a newer bridge), and fix the cause. Your own script for the step's work is fine, and so is a patch to AI Flow itself with a PR, as long as the step stays in the flow: declared with `step`, its proof recorded, and what you did told to the human in a line. File what broke (`adom-wiki issue create adom/adom-aiflow` with the version, the command and the exact error, or on the bridge's page when the bridge failed; `giveback` for your fix) and keep going; never stop to wait on it. Post it automatically after `adom-aiflow giveback-check --body <file> [--files ...]` says nothing of the user's design or machine leaves with it (local paths, the board's name, secrets, design files out; a generic net name instead of theirs); a user who said not to post (`giveback --draft-only`) gets drafts in the run instead. Leaving the flow (dropping the step, or your own result in place of its proof) is the human's call: ask without waiting and keep working; with their OK, record it: `adom-aiflow deviate "step <name>" --replaced-by "<what you did instead>" --why "<the error>" --human-ok "<what they said>"`. - **A question never stops the run.** Runs go overnight while the human sleeps: every question is asked without waiting (a line in the chat, a notification) while you keep working. With no answer, run every step anyway; where a step truly cannot run as the flow has it, do its work your own way, record it as your decision (`deviate "step <name>" --replaced-by "..." --why "..."`, no `--human-ok`) and keep going. Never skip a step to save tokens, asked or not. - **The human sees every gap.** `finish` lists each skipped, replaced or unfinished step and who decided it ("skipped or replaced steps"; "every step in the flow ran" when none), and the project page's design review shows the same list. A step the AI skipped or replaced on its own is named as the AI's decision. @@ -379,6 +379,7 @@ The live clips page is the binary's too: `clips --page <owner/slug>` rebuilds `d  adom-aiflow is the token cache of every Adom user's flow. When the binary was wrong, rigid or missing a step (an RF board that needs length-matched differential pairs and impedance checks, say), or your own code did a step better, file it: `adom-wiki issue create adom/adom-aiflow ...` or a PR against the repo, then `adom-aiflow giveback <url>` so the run counts it. Adom processes PRs within minutes during business hours (a non-stop PR intake), and `deliver` reports how many issues and PRs the run's AI gave back. +Post it automatically, so no failure goes unreported, but scan it first: `adom-aiflow giveback-check --body <file> [--files <the PR's files>]` names what must come out (this machine's paths, the board's name, secrets, email addresses, files that are not AI Flow's own) and what to look at again (design file names, the board's part numbers and its own net names). Write the bug in general terms: "a QFN with teardrops on three pads", not the user's board. A user who does not want posts says so once: `adom-aiflow giveback --draft-only`, and the drafts wait in the run's giveback/ folder for them.  ## The code checks what you filmed @@ -539,7 +540,7 @@ Every Adom user's AI is welcome to improve AI Flow. When a check is wrong for th 1. `adom-wiki repo log adom/adom-aiflow --limit 1` (note the head hash), then `adom-wiki repo clone adom/adom-aiflow --dir aiflow-src`. 2. Make the smallest change that handles the case: teach the check about the design, rather than switching it off. Add a test beside the code. 3. `cargo build --release`, `cargo test --release`, then run this board with `aiflow-src/target/release/adom-aiflow`.-4. Send it back: `adom-wiki pr create adom/adom-aiflow --title "..." --files <each changed file> --body-file <pr.md>`. In pr.md, give the base hash, what blocked the board, what you changed and how you tested it. If the head moved, re-clone and re-apply before opening it. Or, if you can't make the change, `adom-wiki issue create adom/adom-aiflow` with the board's evidence.+4. Send it back: `adom-aiflow giveback-check --body <pr.md> --files <each changed file>` (only AI Flow's own files, nothing of the user's design), then `adom-wiki pr create adom/adom-aiflow --title "..." --files <each changed file> --body-file <pr.md>`. In pr.md, give the base hash, what blocked the board, what you changed and how you tested it. If the head moved, re-clone and re-apply before opening it. Or, if you can't make the change, `adom-wiki issue create adom/adom-aiflow` with the board's evidence.  When the user asks “Help me contribute an improvement to adom-aiflow through a pull request”, also read `dev-skills/review-safe-contributions/SKILL.md` from the public source repository.
bin/adom-aiflow
⋯ 1 unchanged line ⋯
crates/adom-aiflow/src/giveback_policy.rsadded+53
@@ -0,0 +1,53 @@+//! Give-back posting (Colby, 2026-11-19, on PR #119): an AI posts what it learned (an issue on the page, a+//! PR with its fix) automatically, so no failure goes unreported. A user who wants drafts instead says so+//! once (`giveback --draft-only`), and the drafts wait in the run folder for them. Either way the post is+//! scanned first (`giveback-check`, giveback_scrub.rs) so no proprietary data leaves with it.+use std::path::PathBuf;++#[derive(Debug, Clone, Copy, PartialEq)]+pub enum Mode { Auto, Draft }++fn file() -> PathBuf {+    let home = std::env::var_os("AIFLOW_HOME").filter(|h| !h.is_empty()).map(PathBuf::from)+        .unwrap_or_else(|| PathBuf::from(std::env::var("HOME").unwrap_or_default()).join(".adom/aiflow"));+    home.join("giveback.json")+}++/// The mode: AIFLOW_GIVEBACK (auto | draft) first, then the user's saved choice, else automatic.+pub fn mode() -> Mode {+    let pick = |s: &str| match s.trim().to_ascii_lowercase().as_str() { "draft" | "draft-only" | "off" | "ask" => Some(Mode::Draft), "auto" | "on" => Some(Mode::Auto), _ => None };+    if let Some(m) = std::env::var("AIFLOW_GIVEBACK").ok().as_deref().and_then(pick) { return m; }+    std::fs::read_to_string(file()).ok().and_then(|t| serde_json::from_str::<serde_json::Value>(&t).ok())+        .and_then(|v| v["mode"].as_str().and_then(pick)).unwrap_or(Mode::Auto)+}++/// Save the user's choice; the file it went to.+pub fn set(m: Mode) -> Result<PathBuf, String> {+    let f = file();+    if let Some(d) = f.parent() { std::fs::create_dir_all(d).map_err(|e| format!("{}: {e}", d.display()))?; }+    let v = serde_json::json!({"mode": if m == Mode::Draft { "draft" } else { "auto" }});+    std::fs::write(&f, serde_json::to_vec_pretty(&v).unwrap()).map_err(|e| format!("{}: {e}", f.display()))?;+    Ok(f)+}++#[cfg(test)]+mod tests {+    use super::*;++    #[test]+    fn automatic_unless_the_user_says_otherwise() {+        let d = std::env::temp_dir().join(format!("aiflow-giveback-{}", std::process::id()));+        std::env::set_var("AIFLOW_HOME", &d);+        std::env::remove_var("AIFLOW_GIVEBACK");+        assert_eq!(mode(), Mode::Auto, "no choice saved: automatic");+        set(Mode::Draft).unwrap();+        assert_eq!(mode(), Mode::Draft);+        std::env::set_var("AIFLOW_GIVEBACK", "auto");+        assert_eq!(mode(), Mode::Auto, "the environment wins");+        std::env::remove_var("AIFLOW_GIVEBACK");+        set(Mode::Auto).unwrap();+        assert_eq!(mode(), Mode::Auto);+        std::env::remove_var("AIFLOW_HOME");+        let _ = std::fs::remove_dir_all(&d);+    }+}
crates/adom-aiflow/src/giveback_scrub.rsadded+80
@@ -0,0 +1,80 @@+//! What must not leave with a give-back post (Colby, 2026-11-19): an issue or PR goes to a wiki page other+//! people read, so the user's design stays home. `scan` reads the post's text and the files a PR would carry+//! and sorts what it finds: `remove` (local paths, this run's board by name, secrets and email addresses,+//! files that are not AI Flow's own) and `check` (design file names, this board's part numbers and its own+//! net names, a very long body). It reports; the AI fixes the post and posts it.+use regex_lite::Regex;++/// This run's own names, which the post should not carry.+#[derive(Default)]+pub struct Ctx { pub boards: Vec<String>, pub nets: Vec<String>, pub mpns: Vec<String> }++#[derive(Default, Debug)]+pub struct Scan { pub remove: Vec<String>, pub check: Vec<String> }++const DESIGN_EXT: &str = r"(?i)\b[\w.()-]+\.(kicad_pcb|kicad_sch|kicad_pro|kicad_prl|kicad_sym|kicad_mod|brd|lbr|schdoc|pcbdoc|prjpcb|schlib|pcblib|intlib|f3d|f3z|fsch|fbrd|step|stp|gbr|gtl|gbl|gko|drl|xln)\b";+/// Where a PR's files may come from: AI Flow's own repository.+const OWN: &[&str] = &["crates/", "tools/", "skills/", "docs/", "tests/", "flows/", "rules/", "template/", "reference/", "dev-skills/", "widgets/", "assets/", "vendor/", "SKILL.md", "README.md", "AGENTS.md", "Cargo.toml", "Cargo.lock", "package.json", "page.json", "dockbar.json", "hydrogen-widget.json", "install.sh", "uninstall.sh", "LICENSE"];++/// Nets every board has: naming them gives nothing away.+fn generic_net(n: &str) -> bool {+    let u = n.trim_start_matches('/').to_ascii_uppercase();+    u.is_empty() || u.starts_with("NET-(") || u.starts_with("UNCONNECTED") || u.chars().count() <= 3+        || Regex::new(r"^(A|D|P|S)?GND\w*$|^V(CC|DD|EE|SS|IN|OUT|BUS|BAT|REF|SYS)\w*$|^\+?\d+V\d*\w*$|^\d+V\d+$|^(EN|FB|SW|NC|RST|RESET|SDA|SCL|MISO|MOSI|SCK|CS|TX|RX|D\+|D-|USB_D[PM+-]?)\w*$").unwrap().is_match(&u)+}++fn uniq(v: &mut Vec<String>) { v.sort(); v.dedup(); }++pub fn scan(body: &str, files: &[String], ctx: &Ctx) -> Scan {+    let mut s = Scan::default();+    let found = |re: &str| -> Vec<String> { let r = Regex::new(re).unwrap(); let mut v: Vec<String> = r.find_iter(body).map(|m| m.as_str().to_string()).collect(); uniq(&mut v); v };+    let paths = found(r#"(?i)(/home/[^\s`'"),]+|/Users/[^\s`'"),]+|/mnt/[a-z]/Users/[^\s`'"),]+|\b[a-z]:[\\/]Users[\\/][^\s`'"),]+)"#);+    if !paths.is_empty() { s.remove.push(format!("local paths (this machine's folders): {}. Name the file only, or its place in the run", paths.join(", "))); }+    let secrets = found(r"(?i)\b(api[_-]?key|secret|token|password|passwd)\b\s*[:=]\s*\S+|\bsk-[A-Za-z0-9_-]{20,}|\bghp_[A-Za-z0-9]{20,}|\bAKIA[0-9A-Z]{16}\b|-----BEGIN [A-Z ]*PRIVATE KEY-----|\bBearer\s+[A-Za-z0-9._-]{20,}");+    if !secrets.is_empty() { s.remove.push(format!("{} secret(s) (keys, tokens, passwords): take them out", secrets.len())); }+    let emails = found(r"\b[\w.+-]+@[\w-]+(\.[\w-]+)+\b");+    if !emails.is_empty() { s.remove.push(format!("email addresses: {}", emails.join(", "))); }+    let low = body.to_ascii_lowercase();+    let boards: Vec<&String> = ctx.boards.iter().filter(|b| b.chars().count() >= 4 && low.contains(&b.to_ascii_lowercase())).collect();+    if !boards.is_empty() { s.remove.push(format!("this run's board by name ({}): say \"the board\"", boards.iter().map(|b| b.as_str()).collect::<Vec<_>>().join(", "))); }+    let design = found(DESIGN_EXT);+    if !design.is_empty() { s.check.push(format!("design file names: {}. If one is the user's, say \"the board\" (\"the schematic\") instead", design.join(", "))); }+    let mut mpns: Vec<String> = ctx.mpns.iter().filter(|m| m.chars().count() >= 4 && body.contains(m.as_str())).cloned().collect(); uniq(&mut mpns);+    if !mpns.is_empty() { s.check.push(format!("this board's part numbers: {}. Keep one only when the bug is about that part", mpns.join(", "))); }+    let mut nets: Vec<String> = ctx.nets.iter().filter(|n| !generic_net(n) && Regex::new(&format!(r"\b{}\b", regex_lite::escape(n.trim_start_matches('/')))).map(|r| r.is_match(body)).unwrap_or(false)).cloned().collect(); uniq(&mut nets);+    if !nets.is_empty() { s.check.push(format!("this board's own net names: {}. Use a generic name (\"a 3.3 V rail\", \"the motor phase\")", nets.join(", "))); }+    if body.chars().count() > 20_000 { s.check.push(format!("a long body ({} characters): a raw dump can carry the design; quote the few lines that show the bug", body.chars().count())); }+    for f in files {+        let n = f.replace('\\', "/");+        let own = !n.starts_with('/') && !n.contains("..") && OWN.iter().any(|o| n == o.trim_end_matches('/') || n.starts_with(o)) && !n.starts_with("docs/runs/");+        let design_file = Regex::new(DESIGN_EXT).unwrap().is_match(&n);+        if !own || design_file { s.remove.push(format!("{f} is not one of AI Flow's own files: a PR carries only the change to AI Flow, never the run or the design")); }+    }+    s+}++#[cfg(test)]+mod tests {+    use super::*;++    fn ctx() -> Ctx { Ctx { boards: vec!["motor-ctl-rev3".into()], nets: vec!["/PHASE_A_HI".into(), "GND".into(), "+3V3".into(), "VBUS".into()], mpns: vec!["DRV8316CRRGFR".into()] } }++    #[test]+    fn a_clean_report_passes() {+        let s = scan("`land pours` refused a correct board: KiCad's teardrop zones read as unplanned pours (adom-aiflow 0.2.86). Repro: a QFN with teardrops on three pads, GND pour on F.Cu.", &["crates/adom-aiflow/src/pourverify.rs".into(), "SKILL.md".into()], &ctx());+        assert!(s.remove.is_empty() && s.check.is_empty(), "{s:?}");+    }++    #[test]+    fn the_design_stays_home() {+        let body = "On motor-ctl-rev3.kicad_pcb (/home/sam/work/motor-ctl-rev3/) the net /PHASE_A_HI next to DRV8316CRRGFR on GND failed; token=abc123def; mail [email protected]";+        let s = scan(body, &["/home/sam/work/motor-ctl-rev3/motor-ctl-rev3.kicad_pcb".into(), "docs/runs/r1/spec.json".into(), "crates/x.rs".into()], &ctx());+        let r = s.remove.join(" | ");+        assert!(r.contains("local paths") && r.contains("secret") && r.contains("email") && r.contains("this run's board by name"), "{r}");+        assert!(r.contains("/home/sam/work/motor-ctl-rev3/motor-ctl-rev3.kicad_pcb is not one of AI Flow's own files") && r.contains("docs/runs/r1/spec.json is not"), "{r}");+        assert!(!r.contains("crates/x.rs"), "{r}");+        let c = s.check.join(" | ");+        assert!(c.contains("design file names") && c.contains("DRV8316CRRGFR") && c.contains("/PHASE_A_HI"), "{c}");+        assert!(!c.contains("GND,") && !c.contains("+3V3"), "generic nets give nothing away: {c}");+    }+}
crates/adom-aiflow/src/main.rs+44−4
@@ -69,6 +69,8 @@ mod impedance_cmd; mod land_moves; mod reviews; mod deviations;+mod giveback_policy;+mod giveback_scrub; mod flow_gaps; mod prefs; mod handson;@@ -335,7 +337,10 @@ enum Cmd {     #[arg(long)] page_dir: Option<String>, #[arg(long)] push: bool, #[arg(long)] refresh: bool, #[arg(long)] user_machine: Option<String>, /// where the human watches: "browser" (the native browser on --user-machine, through Adom Bridge) or "webview" (a tab in this Hydrogen workspace, for an AI running inside Adom Hydrogen)     #[arg(long)] surface: Option<String> },     /// Record an issue or PR your AI filed back on adom/adom-aiflow (or any page) during this run; deliver counts them.-    Giveback { url: String, #[arg(long)] kind: Option<String>, #[arg(long)] note: Option<String> },+    /// Record what this run gave back (`giveback <issue or PR url>`), or set how give-backs are posted for this user: automatically (the default, so no failure goes unreported) or `--draft-only` (drafts wait in the run folder for the human); `--auto` turns posting back on. Scan every post with `giveback-check` first.+    Giveback { url: Option<String>, #[arg(long)] kind: Option<String>, #[arg(long)] note: Option<String>, #[arg(long)] draft_only: bool, #[arg(long)] auto: bool },+    /// Before posting an issue or PR to the wiki: scans its text (`--body <file>`) and the files a PR carries (`--files ...`) for what must not leave (local paths, this run's board by name, secrets, email addresses, files that are not AI Flow's own) and what to look at again (design file names, this board's part numbers and net names). Under `giveback --draft-only` it saves the draft in the run instead.+    GivebackCheck { #[arg(long)] body: String, #[arg(long, num_args = 1..)] files: Vec<String> },     /// Re-cut every clip of the run (the 10x cut and the motion-only action cut with the real-time clock), for runs recorded before a cut existed or after the cut rules improved.     Recut,     /// Compose the run's final video from the raw clips: only the frames where something moved, in order, paced so the whole video fits --max-seconds (2 minutes by default); the AI's analysis drawings as fullscreen shots; the narration cut to fit each segment, never the other way round. Replaces the delivered video when the run is already delivered.@@ -459,7 +464,7 @@ static INPUT_HINT: std::sync::OnceLock<String> = std::sync::OnceLock::new(); const KICAD_SOCKET_HINT: &str = "When the editor holding the default IPC pipe belongs to another session, never close it: launch a task-owned pcbnew with a private TEMP/TMP (docs/isolated-kicad-read-socket.md), open this board in it, and set ADOM_AIFLOW_KICAD_SOCKET=ipc://<its api.sock> so every live read and edit (place land, land route, land pours, tour nets) reaches it.";  /// Every refusal says how to change AI Flow itself when the check, not the board, is what is wrong.-const CONTRIBUTE: &str = "If this check is wrong for your board (AI Flow has not seen a design like it), improve AI Flow rather than stopping or working around it: `adom-wiki repo clone adom/adom-aiflow`, fix it, `cargo build --release`, finish this board with your build (that tests the change), then send it back with `adom-wiki pr create adom/adom-aiflow --title \"...\" --files <changed files> --body-file <why, base hash, how you tested>`. Every Adom user gets the fix.";+const CONTRIBUTE: &str = "If this check is wrong for your board (AI Flow has not seen a design like it), improve AI Flow rather than stopping or working around it: `adom-wiki repo clone adom/adom-aiflow`, fix it, `cargo build --release`, finish this board with your build (that tests the change), then `adom-aiflow giveback-check --body <pr.md> --files <changed files>` (nothing of the user's design leaves with it) and send it back with `adom-wiki pr create adom/adom-aiflow --title \"...\" --files <changed files> --body-file <pr.md: why, base hash, how you tested>`. Every Adom user gets the fix.";  /// AI Flow is a suggestion engine and never refuses (John, 2026-11-04): a check that finds problems reports /// them with suggestions and the command completes. `findings` ends a command that IS the check.@@ -2877,7 +2882,7 @@ fn tailor_hint() -> String { }  fn give_back_hint() -> String {-    "Give it back: if the binary was wrong, rigid or missing a step, or you wrote code that did a step better, file it on the page (`adom-wiki issue create adom/adom-aiflow --title \"...\" --body \"...\"`) or open a PR against its repo with the crate change. adom-aiflow is the token cache of every Adom user's flow: what your run figured out makes the next run cheaper for everyone.".to_string()+    "Give it back: if the binary was wrong, rigid or missing a step, or you wrote code that did a step better, file it on the page or open a PR against its repo with the crate change, posted automatically so no failure goes unreported: write the body to a file, `adom-aiflow giveback-check --body <file> [--files <the PR's files>]` (it says what of the user's design or machine must come out first), then `adom-wiki issue create adom/adom-aiflow --title \"...\" --body-file <file>` and `adom-aiflow giveback <url>`. A user who said not to post (`giveback --draft-only`) gets the draft in the run instead; giveback-check does that by itself. adom-aiflow is the token cache of every Adom user's flow: what your run figured out makes the next run cheaper for everyone.".to_string() }  @@ -6325,8 +6330,17 @@ fn main() {             if notes.iter().any(|n| n.contains("FAILED") || n.starts_with("push failed")) { err(&format!("report built but NOT published: {}", notes.join("; ")), &["Run `report --push` again: only the files that failed go up (the pushed ones are cached).".into()]); }             ok(&format!("report built for {pg}: {url}{}", if notes.is_empty() { String::new() } else { format!("; {}", notes.join("; ")) }), &["From now on every `step` and `deliver` rebuilds, pushes and refreshes it by itself.".into()]);         }-        Cmd::Giveback { url, kind, note } => {+        Cmd::Giveback { url, kind, note, draft_only, auto } => {             thread(&cli);+            if *draft_only || *auto {+                let m = if *draft_only { giveback_policy::Mode::Draft } else { giveback_policy::Mode::Auto };+                let f = giveback_policy::set(m).unwrap_or_else(|e| err(&e, &[]));+                if *draft_only { ok(&format!("give-backs are drafts for this user from now on (saved in {}): `giveback-check` keeps each one in the run's giveback/ folder, and nothing is posted until the human says so", f.display()), &["`adom-aiflow giveback --auto` posts them automatically again.".into()]); }+                else { ok(&format!("give-backs are posted automatically again (saved in {}), after `giveback-check` clears each one", f.display()), &[]); }+                return;+            }+            let url = url.clone().unwrap_or_else(|| err("giveback needs the issue or PR url it records (or --draft-only / --auto to set how give-backs are posted)", &[]));+            let url = &url;             let mut r = load_run(&cli);             if !r.data["giveback"].is_array() { r.data["giveback"] = json!([]); }             r.data["giveback"].as_array_mut().unwrap().push(json!({"url": url, "kind": kind.clone().unwrap_or_else(|| if url.contains("/pulls/") || url.contains("/pr/") { "pr".into() } else { "issue".into() }), "note": note, "at": now()}));@@ -6335,6 +6349,32 @@ fn main() {             ok(&format!("given back: {url} ({} so far this run)", r.data["giveback"].as_array().map(|a| a.len()).unwrap_or(0)), &["Adom processes PRs within minutes during business hours; the run's summary counts what its AI gave back.".into()]);         } +        Cmd::GivebackCheck { body, files } => {+            let text = std::fs::read_to_string(body).unwrap_or_else(|e| err(&format!("{body}: {e}"), &["Write the issue or PR body to a file first, then `giveback-check --body <file> [--files <the PR's files>]`.".into()]));+            let run = Run::open(&dir);+            let mut ctx = giveback_scrub::Ctx::default();+            if let Some(r) = run.as_ref() {+                let stem = |p: &str| Path::new(p).file_stem().and_then(|s| s.to_str()).map(str::to_string);+                for p in r.data["boards"].as_array().into_iter().flatten().filter_map(|b| b.as_str().or(b["path"].as_str())).chain([r.data["remoteBoard"].as_str().unwrap_or("")]) { if let Some(s) = stem(p) { ctx.boards.push(s); } }+                if !r.board_pending() { if let Some(s) = stem(&r.current_board()) { ctx.boards.push(s); } if let Ok(b) = Board::load(&r.current_board()) { ctx.nets = b.nets.keys().cloned().collect(); } }+                ctx.mpns = r.data["outcomes"]["parts"]["parts"].as_array().into_iter().flatten().filter_map(|p| p["mpn"].as_str().map(str::to_string)).collect();+                ctx.boards.retain(|b| !matches!(b.as_str(), "board" | "plan" | "pcb" | "design"));+            }+            let sc = giveback_scrub::scan(&text, files, &ctx);+            let listed = |h: &str, v: &[String]| if v.is_empty() { String::new() } else { format!("\n{h}:\n  {}", v.join("\n  ")) };+            if giveback_policy::mode() == giveback_policy::Mode::Draft {+                let d = run.as_ref().map(|_| dir.join("giveback")).unwrap_or_else(|| PathBuf::from("giveback-drafts"));+                let _ = std::fs::create_dir_all(&d);+                let f = d.join(format!("draft-{}.md", now().replace([':', '-'], "").chars().take(15).collect::<String>()));+                std::fs::write(&f, &text).unwrap_or_else(|e| err(&format!("{}: {e}", f.display()), &[]));+                ok(&format!("posting is off for this user (giveback --draft-only): the draft is saved at {}; nothing was posted{}{}", f.display(), listed("fix before it is posted", &sc.remove), listed("look again at", &sc.check)), &["Tell the human in one line that a give-back draft is waiting, and keep working; post it only when they say so.".into()]);+                return;+            }+            if !sc.remove.is_empty() {+                findings(&format!("not ready to post: it would carry the user's data{}{}", listed("take out", &sc.remove), listed("look again at", &sc.check)), &["Rewrite the post without them (\"the board\", a generic net name, the file name only), `giveback-check` it again, then post it.".into()]);+            }+            ok(&format!("clear to post: nothing of the user's design or this machine leaves with it{}", listed("look again at before you post", &sc.check)), &["Post it now (`adom-wiki issue create adom/adom-aiflow --title \"...\" --body-file <file>`, or `adom-wiki pr create ... --files <the checked files>`), then `adom-aiflow giveback <url>` so the run counts it.".into()]);+        }         Cmd::Recut => {             let t = thread(&cli);             if let Err(e) = media_tools_missing(MEDIA_TOOLS) { err(&e, &["Install ffmpeg (it brings ffprobe) on this machine, then recut again. No clip was judged.".into()]); }
docs/release-0.2.87.mdadded+21
@@ -0,0 +1,21 @@+# AI Flow 0.2.87++Nine fixes from Drew Owens (PRs #112 to #118, #120, #121), found in real runs, and give-backs posted+automatically with a privacy check.++- **#112** A project page built with `--no-push` or `--local-only` gets no background step pushes, and the step+  pages show no local paths.+- **#113** `status` only reads a run: no turn in its ledger, no dashboard tab, no clip guard.+- **#114** `verify-pours` lists KiCad's teardrop zones apart instead of failing them as unplanned pours.+- **#115** Two equal power bars (an eFuse's IN and OUT) are leads, not an exposed pad; a split exposed pad is one pad.+- **#116** `step` knows every AI Flow step before `plan`, and names the lane's own library step.+- **#117** A spec pour must name its copper layers (`layers`, a list); `layer` or none is said at `pour`, not later.+- **#118** No PowerShell disk query to a macOS or Linux desktop.+- **#120** A run records the adom-aiflow version it runs on and warns once when it changes mid-run.+- **#121** `sourcing check` accepts BOM rows for fiducials and mounting holes.+- **Give-backs are posted automatically, after a privacy check** (in place of #119). So that no failure goes+  unreported, an AI still posts its issues and PRs on its own. New: `adom-aiflow giveback-check --body <file>+  [--files ...]` scans the post first and names what must come out (this machine's paths, the run's board by name,+  secrets, email addresses, PR files that are not AI Flow's own) and what to look at again (design file names, the+  board's part numbers and its own net names). A user who does not want posts says so once, `adom-aiflow giveback+  --draft-only`, and drafts wait in the run's giveback/ folder; `giveback --auto` turns posting back on.
package.json+1−1
@@ -1,7 +1,7 @@ {   "slug": "adom-aiflow",   "type": "app",-  "version": "0.2.86",+  "version": "0.2.87",   "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.86",+  "version": "0.2.87",   "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.",
skills/adom-aiflow/SKILL.md+3−3
@@ -30,7 +30,7 @@ Every step in the flow runs, whatever the board's size or the token cost. A simp  - **This rule is for a full run.** When the human asks for one part of AI Flow (just route this board, just the pours, just the current and thermal analysis, just the export, just a molecule check), do that part: its command, or the adom-aiflow-routing skill for routing alone. The steps they did not ask for are their choice, not a skip. - **Only the human skips a step**, by saying so for this board or through their hands-on flow profile. Never decide on your own that a step is not needed to save tokens or time. If you think one is not needed, ask in one line without waiting, and keep running the steps. When they agree, record their words: `adom-aiflow deviate "step <name>" --why "<why this board does not need it>" --human-ok "<what they said>"`. A step with nothing to act on (no hot parts, nothing for Fields to solve) records itself as not applicable; that is not a skip.-- **A failing step is yours to fix, inside AI Flow.** You do the heavy lifting: read the error and its Hint, debug, retry (a fresh measurement, the right machine, a newer bridge), and fix the cause. Your own script for the step's work is fine, and so is a patch to AI Flow itself with a PR, as long as the step stays in the flow: declared with `step`, its proof recorded, and what you did told to the human in a line. File what broke (`adom-wiki issue create adom/adom-aiflow` with the version, the command and the exact error, or on the bridge's page when the bridge failed; `giveback` for your fix) and keep going; never stop to wait on it. Leaving the flow (dropping the step, or your own result in place of its proof) is the human's call: ask without waiting and keep working; with their OK, record it: `adom-aiflow deviate "step <name>" --replaced-by "<what you did instead>" --why "<the error>" --human-ok "<what they said>"`.+- **A failing step is yours to fix, inside AI Flow.** You do the heavy lifting: read the error and its Hint, debug, retry (a fresh measurement, the right machine, a newer bridge), and fix the cause. Your own script for the step's work is fine, and so is a patch to AI Flow itself with a PR, as long as the step stays in the flow: declared with `step`, its proof recorded, and what you did told to the human in a line. File what broke (`adom-wiki issue create adom/adom-aiflow` with the version, the command and the exact error, or on the bridge's page when the bridge failed; `giveback` for your fix) and keep going; never stop to wait on it. Post it automatically after `adom-aiflow giveback-check --body <file> [--files ...]` says nothing of the user's design or machine leaves with it (local paths, the board's name, secrets, design files out; a generic net name instead of theirs); a user who said not to post (`giveback --draft-only`) gets drafts in the run instead. Leaving the flow (dropping the step, or your own result in place of its proof) is the human's call: ask without waiting and keep working; with their OK, record it: `adom-aiflow deviate "step <name>" --replaced-by "<what you did instead>" --why "<the error>" --human-ok "<what they said>"`. - **A question never stops the run.** Runs go overnight while the human sleeps: every question is asked without waiting (a line in the chat, a notification) while you keep working. With no answer, run every step anyway; where a step truly cannot run as the flow has it, do its work your own way, record it as your decision (`deviate "step <name>" --replaced-by "..." --why "..."`, no `--human-ok`) and keep going. Never skip a step to save tokens, asked or not. - **The human sees every gap.** `finish` lists each skipped, replaced or unfinished step and who decided it ("skipped or replaced steps"; "every step in the flow ran" when none), and the project page's design review shows the same list. A step the AI skipped or replaced on its own is named as the AI's decision. @@ -465,7 +465,7 @@ The live clips page is the binary's too: `clips --page <owner/slug>` rebuilds `d  adom-aiflow is the token cache of every Adom user's flow. When the binary was wrong, rigid or missing a step (an RF board that needs length-matched differential pairs and impedance checks, say), or your own code did a step better, file it: `adom-wiki issue create adom/adom-aiflow ...` or a PR against the repo, then `adom-aiflow giveback <url>` so the run counts it. Adom processes PRs within minutes during business hours (a non-stop PR intake), and `deliver` reports how many issues and PRs the run's AI gave back. -+Post it automatically, so no failure goes unreported, but scan it first: `adom-aiflow giveback-check --body <file> [--files <the PR's files>]` names what must come out (this machine's paths, the board's name, secrets, email addresses, files that are not AI Flow's own) and what to look at again (design file names, the board's part numbers and its own net names). Write the bug in general terms: "a QFN with teardrops on three pads", not the user's board. A user who does not want posts says so once: `adom-aiflow giveback --draft-only`, and the drafts wait in the run's giveback/ folder for them.  ## Make it theirs: a skill or flow app of their own @@ -773,7 +773,7 @@ Every Adom user's AI is welcome to improve AI Flow. When a check is wrong for th 1. `adom-wiki repo log adom/adom-aiflow --limit 1` (note the head hash), then `adom-wiki repo clone adom/adom-aiflow --dir aiflow-src`. 2. Make the smallest change that handles the case: teach the check about the design, rather than switching it off. Add a test beside the code. 3. `cargo build --release`, `cargo test --release`, then run this board with `aiflow-src/target/release/adom-aiflow`.-4. Send it back: `adom-wiki pr create adom/adom-aiflow --title "..." --files <each changed file> --body-file <pr.md>`. In pr.md, give the base hash, what blocked the board, what you changed and how you tested it. If the head moved, re-clone and re-apply before opening it. Or, if you can't make the change, `adom-wiki issue create adom/adom-aiflow` with the board's evidence.+4. Send it back: `adom-aiflow giveback-check --body <pr.md> --files <each changed file>` (only AI Flow's own files, nothing of the user's design), then `adom-wiki pr create adom/adom-aiflow --title "..." --files <each changed file> --body-file <pr.md>`. In pr.md, give the base hash, what blocked the board, what you changed and how you tested it. If the head moved, re-clone and re-apply before opening it. Or, if you can't make the change, `adom-wiki issue create adom/adom-aiflow` with the board's evidence.  When the user asks “Help me contribute an improvement to adom-aiflow through a pull request”, also read `dev-skills/review-safe-contributions/SKILL.md` from the public source repository.
skills/aiflow-credentials/SKILL.md+1−1
@@ -60,7 +60,7 @@ Some downloads need an export or licence approval after sign-in (PSpice for TI:  ## 6. Record it -Add one line to the run's notes: which site, which rung worked, what the human had to click (if anything). If a rung was missing or broken, file it (`adom-wiki issue create adom/adom-aiflow ...`, then `adom-aiflow giveback <url>`); a bug in pup or nb goes on that bridge's page.+Add one line to the run's notes: which site, which rung worked, what the human had to click (if anything). If a rung was missing or broken, file it (`adom-aiflow giveback-check --body <file>`, then `adom-wiki issue create adom/adom-aiflow ...` and `adom-aiflow giveback <url>`; never a password, a username or the site's account details in it); a bug in pup or nb goes on that bridge's page.  ## Worked example: myTI for the TPS54202 PSpice model (2026-09-29)