StackCreator::fromFile/AStack::loadWeights now append "/prj/<name>"
themselves (the prj/<name>/ restructure), expecting dir to be the repo
root -- which poet.cpp and the GUI's startup auto-load already pass.
But the Load button's file chooser used the picked file's own parent
folder (e.g. prj/prims/) as dir, so after the refactor it looked for
prj/prims/prj/prims/prims.prj, threw an uncaught Json::RuntimeError, and
took the whole process down.
Reproduced by actually launching the GUI, clicking Load, and picking
prj/prims/prims.prj -- confirmed the crash, then confirmed the fix with
the identical click sequence (project loads, weight visualizations
render correctly).
Fix: recover the repo root by going up three levels from the picked
file (file -> its project folder -> "prj" folder -> root) and store it
in m_dir, instead of using the file's immediate parent. This also fixes
a separate dormant bug: m_dir was never updated after loading a
different project through this dialog, so Save/Save Training would have
silently written to whatever m_dir happened to be (always "."),
regardless of which project was actually loaded.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016K8Gu7Qejd11JbdiHZqYAs