feat: automate mac mcp cad host bootstrap #17
Reference in New Issue
Block a user
Delete Branch "feat/mac-mcp-cad-host-bootstrap"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Validation
Pull request overview
This PR improves local macOS MCP/CAD bootstrap by introducing more robust companion-repo resolution, preferring host CAD runtimes when available, and adding an “autonomous next lots” runner that updates plan/todo docs based on local validations.
Changes:
validate-specsMCP launch to a bash wrapper that auto-selects a suitable Python runtime.mascaradecompanion repo resolution across multiple MCP/CAD launchers.git status, runs validations, and regenerates plan/todo docs.Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 8 comments.
Show a summary per file
MASCARADE_DIR.MASCARADE_DIR.mascaradedir resolution logic.kill_life_resolve_mascarade_dirhelper for companion repo discovery.You can also share your feedback on Copilot code review. Take the survey.
@@ -0,0 +41,4 @@- `tools/autonomous_next_lots.py`- `tools/run_autonomous_next_lots.sh`- `tools/run_validate_specs_mcp.sh`This generated plan includes ephemeral local Git state (branch header, dirty path count/list, timestamps). As a tracked doc, this will churn frequently and may not be meaningful to other contributors. Consider keeping the runbook content versioned, but moving per-run state into untracked artifacts (or only writing it when explicitly requested).
@@ -0,0 +8,4 @@- done: lot detecte (Stabiliser les launchers MCP, le bootstrap Mac, la resolution du repo compagnon et la doc operateur associee.)- done: `bash tools/bootstrap_mac_mcp.sh codex`resume: codex mcp add openscad --env MASCARADE_DIR=/Users/electron/mascarade-main -- bash /Users/electron/Kill_LIFE/tools/run_openscad_mcp.sh | codex mcp add huggingface --url https://huggingface.co/mcp --bearer-token-env-var HUGGINGFACE_API_KEY | codex mcp add playwright -- npx -y @playwright/mcp@latestThis generated TODO file includes user-specific absolute paths in the validation summaries (e.g.,
/Users/.../Kill_LIFE/...). Committing machine-local paths makes the doc noisy and can leak local environment details. Regenerate with sanitized/relative paths (or avoid embedding raw command output in tracked docs).@@ -0,0 +215,4 @@lines = [line.rstrip() for line in text.splitlines() if line.strip()]if not lines:return ""return " | ".join(lines[-3:])output_tail(and the subsequent embedding of command outputs into the generated docs) can capture machine-specific absolute paths and other environment details. This is already visible in the committeddocs/plans/18_*artifacts (e.g.,/Users/...paths in command summaries), which creates noisy diffs and can unintentionally leak local filesystem layout into the repo. Consider redacting absolute paths (e.g., replaceROOTwith./$REPO), truncating/normalizing outputs more aggressively, and/or not persisting raw validation output into tracked markdown.@@ -0,0 +410,4 @@plan_text = render_plan(branch, dirty_paths, ahead, behind, lots, results)todo_text = render_todo(lots, results)should_write = not args.no_write and args.mode != "json"The default
statusmode rewrites the plan/todo markdown files becauseshould_writeis true for any mode exceptjson. This makes simply checking status dirty the working tree (and causes constant timestamp churn). Consider only writing docs inrunmode, or gating writes behind an explicit--writeflag (keepingstatusread-only by default).kill_life_resolve_mascarade_diris used in a command-substitution assignment whileset -eis active. If resolution fails (e.g., companion repo not present), the script will exit immediately with a non-obvious error and will not reach the explicitUnable to resolve mascarade companion pathmessage. Capture the failure (|| true) and handle it with a clear error message (or wrap the call in... || { echo ...; exit 1; }).MASCARADE_DIRis resolved withkill_life_resolve_mascarade_dirusing command substitution whileset -eis enabled. If the companion repo isn't present, the launcher will exit at this assignment with a hard-to-diagnose error. Consider making the resolution non-fatal (|| true) and thendiewith a clear message describing expected../mascarade/../mascarade-mainlayout orMASCARADE_DIRoverride.@@ -10,1 +11,4 @@"core/mascarade/integrations/github_dispatch.py")"MASCARADE_ENV_FILE="${MASCARADE_ENV_FILE:-$MASCARADE_DIR/.env}"MASCARADE_DIRis resolved via command substitution underset -euo pipefail. Ifkill_life_resolve_mascarade_dirfails, the script will exit at the assignment without printing a helpful error. Handle the failure explicitly and emit an actionable message (expected repo locations, how to override viaMASCARADE_DIR).@@ -10,1 +11,4 @@"core/mascarade/integrations/knowledge_base.py")"MASCARADE_ENV_FILE="${MASCARADE_ENV_FILE:-$MASCARADE_DIR/.env}"MASCARADE_DIRis resolved via command substitution underset -euo pipefail. Ifkill_life_resolve_mascarade_dirfails, the script will exit at the assignment with no actionable error. Consider handling the failure explicitly (e.g.,MASCARADE_DIR="$(... || true)"followed by a check that prints guidance about expected locations /MASCARADE_DIR).💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:
caea73e0f8ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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".
Because this resolver call is also unguarded under
set -e, bootstrap aborts before the explicit fallback check/reporting below can run. When no companion repo is present,bash tools/bootstrap_mac_mcp.sh codexexits silently instead of emitting the expectedUnable to resolve mascarade companion pathmessage, making setup failures much harder to triage.Useful? React with 👍 / 👎.
This command substitution is executed under
set -e, so if no validmascaradecandidate is found the script exits immediately before it can reach the--doctoroutput path. In environments where the companion repo is absent or renamed,tools/hw/run_kicad_mcp.sh --doctornow fails with exit code 1 and no diagnostics, which breaks the intended troubleshooting flow.Useful? React with 👍 / 👎.