fix: vendor safety, preserve domain notes, ask/step JSON hygiene - #9
Conversation
Customer-0 review on tig/silico#39 found: - vendor_copy could rmtree source when --vendor-from equals dest - init --force rewrote product BEDSIDE.md on re-vendor - ask non-interactive Record had malformed choice= pending - ask/step --json interactive pre-text polluted stdout Fixes those with tests. Ported from silico vendored tree after silico PR 39 CR.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ea8bd8302c
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| # Never rmtree the source. Same path, or dest nested under source, would | ||
| # delete the only copy of contract/src before copytree runs. | ||
| if source == dest: | ||
| raise ValueError( |
There was a problem hiding this comment.
Handle rejected vendor paths as setup errors
When a user hits this new safety guard, vendor_copy now raises ValueError, but run_init only catches OSError/FileNotFoundError around the call, so bedside init --vendor-from third_party/bedside --force exits with a traceback instead of the documented setup-error result and recovery text. Please either raise an OSError subclass here or catch ValueError in run_init so the guard stays user-facing.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in the latest push. run_init now catches ValueError alongside OSError/FileNotFoundError around vendor_copy, so self-vendor and dest-under-source guards exit 30 with plain-language recovery (no traceback). Added test_init_vendor_self_path_is_setup_error.
run_init now catches ValueError from vendor_copy safety guards so bedside init --vendor-from <self> returns SETUP_ERROR with recovery text instead of a traceback.
Summary
Ports customer-0 review fixes from tig/silico#39 (Codex + Copilot on the ask/step vendor tree).
source == destor dest under source)rmtreeinit --forcewipes productBEDSIDE.mdRecord: … choice= pendingchoice=pendingkey=value formask/step --json+ interactiveTest plan
pytest -q(35 passed)Related