Closed bug report

Step clips film another project's PCB editor when the run's board is not open (camera_window falls back to the first editor)

noah · ·closed by John Lauer

Version: adom-aiflow 0.2.51 (the fallback is unchanged in 0.2.55: crates/aiflow-bridge/src/eda.rs camera_window, None => matching.or_else(|| pcbs.first()...)), KiCad 10.0.4 on Windows, KiCad Bridge 1.0.103.

What happened. On a desktop with another project's PCB editor open (a different board, in active use by another AI thread), step components and step models of a new run started their clips on that editor, because the run's own board was not open yet. The step output only said clip components-1 recording (window 7472288 ...); nothing said the window shows another board. The clip (someone else's board, nets being highlighted) was pushed to the run's clips page, and capture reject keeps it there "as evidence".

What was true. The run knew its board (remoteBoard = .../led-strip-500/led-strip-500.kicad_pcb); no open editor showed it. The camera should have fallen back to Hydrogen's dashboard or the AI's window, as it does when no tool window is open.

Ask.

  1. With the run's board known and not open, never film another board's PCB editor (drop the pcbs.first() fallback; match the stem as a whole name in the title).
  2. When a step's clip starts on a KiCad editor, print its title, so the AI can see a wrong window at once.
  3. capture reject for privacy (wrong project filmed) should be able to take the clip off the page, not keep it as evidence.

A patch from an earlier run (against 0.2.43; names_board, run_kicad_stem, pcb_editor_of(info, stem), tests) is attached; the same change still applies in spirit to 0.2.55.

aiflow-camera-other-project.patch

1 Reply

John Lauer ·

Noah, thank you for this one, and for the patch: it went in nearly as you wrote it.

What was wrong: when no editor's title held the run's board name, camera_window fell back to the first PCB editor on the desktop (pcbs.first()), whichever board it showed. The title match was also a plain substring, so esc would have taken esc-v2. And nothing in the step output named the window, so the wrong board only showed up in the clip.

What changed, in adom-aiflow 0.2.56:

  1. A run whose board is known films only the PCB editor whose title names that board as a whole name (led-strip-500 is not led-strip-500-v2; an unsaved *led-strip-500 still counts). With the board known and not open, the step films nothing and says "no PCB editor of led-strip-500 open on the test box (another board's editor is never filmed)". A cached window that turns out to be another board's editor is dropped the same way. The same lookup now drives pcb_editor_hwnd (capture start, tour nets, the window_not_found retry, the clip watch) and the schematic step's camera. Library editors are left as before, because their titles name a library rather than the project.
  2. When a step's clip starts on a KiCad editor, the step line names it by its title (filming KiCad's "<the editor's title>"), so you would have seen the other board's name at once. The capture records it as its camera.
  3. capture reject <step>-<visit> --reason "..." --off-page takes a clip off the page for privacy. It deletes the clip, its 10x and action cuts, its contact sheet and that visit's screenshots, and marks the capture discarded, keeping only a ledger line with your reason. The page, the composed video and the suspect list all skip it. A page you already pushed keeps the clip until the next publish, so publish again right after.

How it was verified: your tests (whole-name matching, never falling back to another board's editor, another project's schematic editor never filmed), plus cases for the sibling-name and cached-window paths and the stem-aware editor lookup on Windows and Mac replies. All unit tests and workflow suites pass.

Still open: nothing that I know of. The run's own editor still has to be opened (capture open) before a board step films KiCad.

Upgrade: tell your AI "give me the latest adom-aiflow" (or adom-wiki pkg install adom/adom-aiflow); adom-aiflow --version says 0.2.56.

John Lauer closed this ·

Log in to reply.