What this file does: Refreshes an existing SIN-Code Tool Suite installation
without going through a full uninstall+reinstall cycle. Pulls the bundle repo,
upgrades the Python bundle and 8 subsystems via pip install --upgrade,
rebuilds the 7 Go tools (with optional mtime-bypass via --force-rebuild),
and re-registers MCP servers in opencode.json.
Docs: update.sh (source of truth — this file is the "what and why")
-
Refresh bundle repo —
git pull --ff-onlyin$BUNDLE_DIR(or in$REPOS_DIR/SIN-Code-Bundleas fallback). Skipped if the script is in a non-git checkout. Use--skip-pullto test local changes. -
Upgrade sin-code-bundle —
pip install -e .[mcp,dev] --upgrade(oruv pip install --python <venv> -e .[mcp,dev] --upgradewhen uv is available). Always uses editable install mode. -
Upgrade 8 Python subsystems — for each of the 8 sibling repos (sckg, ibd, poc, efsm, adw, oracle, orchestration, review-interface):
- Skipped if
$REPOS_DIR/<repo>doesn't exist - Skipped if
<repo>/pyproject.tomlis missing - Otherwise:
pip install -e <path> --upgrade(oruv pip install)
- Skipped if
-
Rebuild 7 Go tools — for each of
discover,execute,map,grasp,scout,harvest,orchestrate:- Skipped if
$REPOS_DIR/SIN-Code-X-Tooldoesn't exist - Skipped if
cmd/<binary>/is missing in the repo - Mtime-aware: skips rebuild if binary is newer than newest
.gosource (use--force-rebuildto bypass) - Otherwise:
go build -trimpath -ldflags='-s -w' -o $BIN_DIR/<bin> ./cmd/<bin>
- Skipped if
-
Re-register MCP servers in opencode.json — adds any missing entries under the
mcpblock. Idempotent: existing keys are untouched. Always writes a timestamped.bak-<YYYYmmdd-HHMMSS>-updatebackup before mutating.sin-discover,sin-execute, ...,sin-orchestrate(7 Go tool entries)sin-code-bundle(the unifiedsin serveMCP server)- gitnexus and simone-mcp are NOT re-registered by update.sh — they
belong to install.sh's external-bridges flow. To register them too,
run
bash install.sh --skip-go --skip-external=falseafter update.sh.
-
Verify final state — runs
sin status(prefers$BUNDLE_DIR/.venv/bin/sin, falls back to PATH). A non-zero exit is downgraded to a warning because partial installs (e.g. some subsystems not yet pulled) are still useful.
update.sh is a subset of install.sh — it re-runs the same commands
but skips platform/prereq detection and external-bridge setup. Use the
following table to choose between the two:
| Use case | install.sh | update.sh |
|---|---|---|
| Bootstrap a brand new machine | YES | NO |
| First-time install (fresh clone) | YES | NO |
| Daily/weekly refresh | NO | YES |
After a bundle git pull of breaking changes |
NO | YES |
| Switch Python environment (uv venv → system) | YES (recreates) | NO |
After go version upgrade |
NO | YES (--force-rebuild) |
| Recover from broken install | YES (--force) |
NO (install.sh is safer) |
When in doubt: run update.sh first (fast), then install.sh --force if
something is still wrong (rebuilds everything from scratch).
| Flag | Behaviour |
|---|---|
--help / -h |
Show usage text, exit 2 |
--dry-run |
Print all actions, skip all mutations |
--verbose |
Echo every command via printf logging |
--force-rebuild |
Force go build even if mtime says "up to date" |
--skip-go |
Skip Go tool build (only refresh Python + MCP) |
--skip-external |
Skip gitnexus + simone-mcp checks (no-op for update.sh, kept for flag symmetry) |
--skip-pull |
Don't git pull the bundle repo (test local changes) |
--subsystems-dir=PATH |
Override SIN_CODE_REPOS_DIR for subsystem discovery |
git pull --ff-only: refuses to merge if local commits exist (usegit pull --rebaseorgit stashmanually if your branch has diverged). Errors are downgraded to warnings — update.sh continues with the current working tree.pip install --upgrade: pip itself is idempotent (no-op if version unchanged).go build: mtime-aware (skips if binary is newer than source). With--force-rebuild, every tool is rebuilt unconditionally.- opencode.json patch: existing keys are untouched; only missing keys are added.
| Variable | Purpose | Default |
|---|---|---|
SIN_CODE_BIN_DIR |
Go binary install dir | ~/.local/bin |
SIN_CODE_REPOS_DIR |
Parent dir of the 7 Go tool repos + 8 subsystems | ~/dev |
SIN_CODE_OPENCODE_CONFIG |
Path to opencode.json | ~/.config/opencode/opencode.json |
| Code | Meaning |
|---|---|
| 0 | Success (every step completed; skips are fine) |
| 1 | Unrecoverable error (e.g. go build failure, opencode.json patch failure) |
| 2 | --help requested |
cd ~/dev/SIN-Code-Bundle
bash update.shbash update.sh --force-rebuild# Make changes to src/, then:
bash update.sh --skip-pull --dry-run # preview
bash update.sh --skip-pull # applycd ~/dev/SIN-Code-Bundle
uv venv .venv
source .venv/bin/activate
bash update.sh # uv will pick up the venv automaticallybash update.sh --force-rebuild # always rebuild Go in CIuv pip install --upgrademay fail if the previous install was performed with a different Python interpreter (e.g. you switched from system pip to uv venv). Workaround:pip uninstall -y sin-code-bundlefirst, thenbash update.sh. Or usebash install.sh --forcefor a clean slate.- Go tool rebuilds touch the mtime of
$BIN_DIR/<binary>. If you have other tools depending on the exact binary timestamp (rare), use--skip-go. update.shdoes not refresh gitnexus / simone-mcp because those are external bridges (npm install / git clone). If you need to refresh them too, runbash install.sh --skip-goafterupdate.sh.- The
sin-code-bundleMCP entry is added under the keymcp.sin-code-bundle(matches install.sh's existing key). If a previous install registered it under a different key (e.g.sin-bundle), it will not be deduplicated — clean it up manually.