Add safe run-scoped workspaces - #139
Conversation
…aces # Conflicts: # main.py # src/domain_knowledge.py # src/incremental_reasoner.py # src/opencode_trace.py # src/pipeline_setup.py # src/verification.py
…aces # Conflicts: # src/pipeline_setup.py
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c9ed2124a9
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e9f45ad5c1
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if prefix is None: | ||
| prefix = inferred_workdir_relpath(work_dir) |
There was a problem hiding this comment.
Keep domain knowledge readable in run workspaces
When --domain-knowledge is used with the new fm_agent/runs/<run-id> layout, this default now returns relpaths like fm_agent/runs/<run-id>/spec_prompts/...; however load_staged_domain_knowledge_text() still resolves those relpaths from os.path.dirname(work_dir), so it looks under .../fm_agent/runs/fm_agent/runs/<run-id>/... and silently drops the content. The verifier and incremental spec-update prompts both rely on that loader, so normal run-scoped executions omit the user-provided knowledge from reasoning even though the files were staged.
Useful? React with 👍 / 👎.
Summary
fm_agent/runs/<run-id>/directoryfm_agent/current_run.jsonfm_agent/results intoruns/legacy-*instead of deleting themWhy
A normal invocation previously deleted the target repository's entire
fm_agent/directory without confirmation. This could destroy an interrupted run or collide with an unrelated directory. Run-scoped workspaces preserve prior results by default and limit destructive behavior to the explicitly selected run after an interactive overwrite choice.Non-interactive invocations fail safely when results already exist unless
--resumeis explicitly supplied.Validation
python -m unittest discover -v— 10 tests passedpython -m compileall -q main.py dashboard.py src testsgit diff --checkhello.py:fm_agent/runs/<timestamp>/--resumeselected the same current runfm_agent/runs/<run-id>/...