Calendar Day
Monday, June 22, 2026 (PR 2 of 2)
Planned Effort
3 story points — sprint item #4 (Medium)
Depends on: Monday PR 1 (export consolidation #3) — pass --base-dir through the shared engine rather than the soon-to-be-deleted inline orchestration.
Problem
In scripts/export.py, when --base-dir is provided the script mutates the process environment via os.environ["WORKSPACE_PATH"] and then calls resolve_workspace_path(), which reads that variable. This bypasses the thread-safety lock the web server uses to protect WORKSPACE_PATH reads. The workspace path should be passed as an explicit argument, not through global environment mutation.
Goal
One merged PR that replaces the os.environ mutation with an explicit override parameter threaded through resolve_workspace_path(), eliminating the thread-safety bypass with no change to CLI behavior.
Scope
Touch points
utils/workspace_path.py — add override: str | None = None to resolve_workspace_path()
scripts/export.py — pass --base-dir explicitly (via the shared engine) instead of mutating os.environ
Out of scope
Acceptance Criteria
Verification
cd C:\Users\Jasen\CppAliance\cppa-cursor-browser
.\.venv\Scripts\Activate.ps1
pytest -k "workspace_path or export or thread"
python scripts/export.py --base-dir <some-workspace>
Calendar Day
Monday, June 22, 2026 (PR 2 of 2)
Planned Effort
3 story points — sprint item #4 (Medium)
Depends on: Monday PR 1 (export consolidation #3) — pass
--base-dirthrough the shared engine rather than the soon-to-be-deleted inline orchestration.Problem
In
scripts/export.py, when--base-diris provided the script mutates the process environment viaos.environ["WORKSPACE_PATH"]and then callsresolve_workspace_path(), which reads that variable. This bypasses the thread-safety lock the web server uses to protectWORKSPACE_PATHreads. The workspace path should be passed as an explicit argument, not through global environment mutation.Goal
One merged PR that replaces the
os.environmutation with an explicit override parameter threaded throughresolve_workspace_path(), eliminating the thread-safety bypass with no change to CLI behavior.Scope
Touch points
utils/workspace_path.py— addoverride: str | None = Nonetoresolve_workspace_path()scripts/export.py— pass--base-direxplicitly (via the shared engine) instead of mutatingos.environOut of scope
WORKSPACE_PATHlock semanticsAcceptance Criteria
scripts/export.pypasses--base-diras an explicit parameter toresolve_workspace_path()instead of mutatingos.environos.environ["WORKSPACE_PATH"]mutation line is removedresolve_workspace_path()accepts an optionaloverrideparameterVerification