Skip to content

fix: vendor safety, preserve domain notes, ask/step JSON hygiene - #9

Merged
tig merged 2 commits into
mainfrom
fix/cr-vendor-ask-step-safety
Jul 13, 2026
Merged

fix: vendor safety, preserve domain notes, ask/step JSON hygiene#9
tig merged 2 commits into
mainfrom
fix/cr-vendor-ask-step-safety

Conversation

@tig

@tig tig commented Jul 13, 2026

Copy link
Copy Markdown
Owner

Summary

Ports customer-0 review fixes from tig/silico#39 (Codex + Copilot on the ask/step vendor tree).

Issue Fix
Self-vendor (source == dest or dest under source) Refuse before rmtree
init --force wipes product BEDSIDE.md Only scaffold notes when missing
Record: … choice= pending choice=pending key=value form
ask/step --json + interactive Pre-prompt / confirm cue on stderr

Test plan

  • pytest -q (35 passed)

Related

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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/bedside/vendor.py
# 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(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
@tig
tig merged commit 3cbf3a1 into main Jul 13, 2026
2 checks passed
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