Files
VoiceStudio/scripts
Palash DebnathandClaude Opus 4.8 f555fe0720 fix(bootstrap): surface setuptools-repair failures + verify pkg_resources (follow-up to #253) (#254)
* fix(bootstrap): surface setuptools-repair failures + verify pkg_resources (follow-up to #253)

Three gaps flagged by review bots on PR #253 are addressed:

1. **Layer-2 repair result captured** (`bootstrap.rs` ~line 481): the
   `let _ = run_streaming(...)` that silently discarded network/permission
   failures from the targeted `uv pip install setuptools>=75,<80` is replaced
   with a `match` block that logs `log::info!` on success and `log::error!`
   on failure (consistent with the Layer-3 path).

2. **Post-repair re-verification added** (`bootstrap.rs`): after the targeted
   install in Layer 2, a second `import pkg_resources` check is run. If
   pkg_resources is *still* absent, a `log::error!` with an actionable
   remediation message is emitted before returning. This closes the gap where
   bootstrap handed back a known-bad venv that caused the dubbing crash (#248)
   with no clear signal in the log.

3. **Test strengthened** (`bootstrap.rs` `setuptools_repair_uses_correct_specifier`):
   the test now mirrors the exact `&[&str]` slice used in both repair branches
   and asserts `repair_args[2] == "setuptools>=75,<80"` as a single positional
   argument. This catches the split-arg regression the review bot identified
   (e.g. `["setuptools>=75", ",<80"]`) which would silently install the latest
   setuptools and leave pkg_resources absent.

4. **Smoke-test INST-01/02 hardened** (`scripts/smoke-test.sh`): exports
   `UV_PYTHON_PREFERENCE=only-system`, `UV_HTTP_TIMEOUT=120`, and
   `UV_HTTP_RETRIES=5` before the `uv run` import checks so that failures
   reflect real bootstrap regressions, not harness-network timeouts.

`cargo test bootstrap` → 5 passed, 0 failed.

Closes review findings on #253. Related: #248.

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

* fix(bootstrap): fail clearly when pkg_resources repair fails (PR #254 review)

- ensure_venv_ready now returns None (via fail()) when pkg_resources is still
  missing after the targeted setuptools repair, instead of returning a venv that
  crashes on the first ASR/dub call. The 'pkg_resources' message routes to the
  PKG_RESOURCES_MISSING failure mapping for a clear, doc-linked remediation.
- smoke-test.sh: correct the comment (timeout+retry vars, not a non-existent index var).

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-02 22:50:37 +05:30
..