batched upload resave: --resave-batch CLI + one staging pass per bulk upload (tasks-runner 0004)

kicad_tools --resave-batch <outdir> <file>...: N resaves in one process
(one WASM init — marginal resave is ~50ms vs ~0.3s/process). Outputs in
<outdir>/<index>/, per-file "RESAVE-BATCH <index> <exit-code>" stderr
verdicts with the single-file 0/4/5 contract; exit 0 = loop completed, so
an invalid file mid-batch can't mask its neighbors.

loadSchematicHeadless now binds each schematic to ITS project via
SETTINGS_MANAGER::GetProject, never Prj(): with aSetActive=false projects
accumulate across batch entries and Prj() keeps returning the first one —
the writer then stamped a wrong/empty project name into saved
symbol-instance data. (UnloadProject is no fix: unloading the active
project immediately reloads a null "" project.)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AH2iPekUGsEAYnMUD5BmAi
This commit is contained in:
Gergő Törcsvári 2026-08-24 14:46:43 +02:00
commit 90bc4e0222
No known key found for this signature in database
GPG key ID: 8E75F2CDE64E5322
3 changed files with 108 additions and 3 deletions

View file

@ -25,6 +25,12 @@
* pcbToolsResaveBoard callback, .kicad_sch one file per
* sheet, .kicad_sym/.lib via ConvertLibrary. Exit 4 =
* input invalid, 5 = write failed)
* kicad_tools --resave-batch <outdir> <file> [<file>...]
* (N resaves, one runtime init — bulk-upload
* normalization. Outputs in <outdir>/<index>/; per-file
* verdicts as "RESAVE-BATCH <index> <exit-code>" stderr
* lines with the single-file code contract; exit 0 when
* the loop completed)
* kicad_tools --erc [--json] [--strict] <file.kicad_sch> [<out>]
* kicad_tools --netlist [--xml] <file.kicad_sch> [<out>]
* kicad_tools --bom <file.kicad_sch> [<out>]