Skip to content

Webgui project persistence#27

Merged
RoopsyDaisy merged 2 commits into
mainfrom
webgui-project-persistence
Jun 3, 2026
Merged

Webgui project persistence#27
RoopsyDaisy merged 2 commits into
mainfrom
webgui-project-persistence

Conversation

@RoopsyDaisy

Copy link
Copy Markdown
Owner

What & why

Checklist

  • CI is green (build + in-image smoke test + R test suite).
  • Docs updated to match any code/behaviour change (this repo has drifted before — keep prose true).
  • Tests added/updated for the change (tests/unit or tests/integration), or N/A.
  • No data, secrets, or chat history committed (inventory CSVs stay out — see data/README.md).

RoopsyDaisy and others added 2 commits June 3, 2026 04:25
fvsOL's project model is a "master" dir holding one sub-folder per project; you
run INSIDE a project, and "New Project" does setwd("..") + dir.create -- i.e. it
creates a SIBLING of the current project, and getProjectList() lists
../*/projectId.txt. The launcher ran fvsOL with /work (the bind mount) AS the
project dir, so "New Project" escaped to /work's parent -- the container's
ephemeral root (/) -- and every new project was lost when the --rm container
stopped (confirmed: a project created in the GUI landed at /<name>, not under
~/fvs-projects).

Fix: launch inside a project sub-folder of the master. webgui-app.R now treats
the master as /work (FVS_WORK override for the dev loop), resumes the
most-recently-used project under it or seeds a fresh "MyProject" (fvsOL fills an
empty project dir with its bundled training FVS_Data.db). New projects then land
beside it under /work and persist on the host. run_webgui.sh points FVS_WORK at
gitignored outputs/ so dev-loop projects stay out of the repo root.

Verified: dir-math (new project lands under master, not the parent; switcher
lists both) and a headless boot (HTTP 200, master/MyProject created).

This is container-internal directory logic -- platform-independent (the host
only supplies the writable bind mount at /work).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ersistence

Pull the project-selection logic out of webgui-app.R into webgui-launch.R as a
pure, testable function (webgui_project_dir(master)), sourced by both the real
launcher and the smoke test. webgui-app.R now sources it; the Dockerfile copies
it next to webgui-app.R into the image.

Add smoke_test.R guard "webgui/project-persistence": asserts the launcher's
invariant -- webgui_project_dir() returns a CHILD of the master -- so if anyone
regresses it to launch in the master itself (the bug this branch fixes), new
projects would escape the mount and CI goes red. Runs in a tempdir (no /work
mount needed); webgui-only (webgui-launch.R is absent in the cluster image, so
the guard self-skips).

Verified: positive (real fn returns master/MyProject) PASS, negative (simulated
return-of-master) FAIL, and a headless boot (HTTP 200, master/MyProject created)
through the sourced helper.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@RoopsyDaisy RoopsyDaisy merged commit a39de6f into main Jun 3, 2026
6 checks passed
@RoopsyDaisy RoopsyDaisy deleted the webgui-project-persistence branch June 3, 2026 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant