Skip to content

Sync host repo during rebuild to keep CLI in lockstep#313

Open
woltspace-jerpint[bot] wants to merge 4 commits into
mainfrom
uxw/sync-host-cli
Open

Sync host repo during rebuild to keep CLI in lockstep#313
woltspace-jerpint[bot] wants to merge 4 commits into
mainfrom
uxw/sync-host-cli

Conversation

@woltspace-jerpint
Copy link
Copy Markdown
Contributor

@woltspace-jerpint woltspace-jerpint Bot commented Apr 13, 2026

Summary

The host woltspace CLI and the container image were carrying versions behind each other's backs — the rebuild moved the image to v0.4.23, but the CLI kept polling for a tunnel URL file that no longer existed. Users' lodges came up fine, but _show_url() gave up after 30 seconds with "tunnel still digging."

This PR makes woltspace rebuild --version <tag> atomic across both surfaces: the image and the host CLI move together, or neither moves.

What changed

woltspace (host CLI) — new sync block in rebuild:

  • When --version is explicitly passed (and not --local, and the host is a git repo), check out that tag on the host before rebuilding the image
  • Abort with a clear message if the working tree is dirty — silent drift is worse than a loud stop
  • Abort on checkout failure — same reasoning
  • Skip the sync when already on the target ref (no needless fetch)
  • Plain rebuild and rebuild --branch X leave the host repo alone — in those flows the host is the source of truth

.claude/skills/woltspace-update/SKILL.md — updateWolt polish:

  • Greet first, then work — the beaver introduces itself before the commands start flying
  • Preflight split into four small parallel one-liners instead of one scary 15-line script
  • Robust to missing .version on older or local-build images (inline git fallback inside the container, graceful "unknown" handling)
  • New context note: host repo vs. container version, and the caveat that non-tag builds (--local, --branch) report the nearest ancestor tag in .version

Test plan

  • woltspace rebuild --version v0.4.23 on clean tree → host checks out v0.4.23, image rebuilds
  • Same on dirty tree → aborts with clear message, image untouched
  • woltspace rebuild (no --version) → host repo unchanged
  • woltspace rebuild --branch some-branch → host repo unchanged (sync is version-only)
  • WOLTSPACE_LOCAL=true woltspace rebuild --version X → sync skipped (local build)
  • /woltspace-update against a container missing .version → preflight falls back cleanly, no user-visible error

Closes #312

The dam's watertight now — CLI and container move in lockstep, or not at all. 🦫

woltspace rebuild now checks out the target version in the host repo
before building the Docker image. Prevents drift where the container
has new code (e.g. tunnel.json) but the host CLI still uses old paths.

Falls back gracefully if checkout fails (warning, not error).

Closes #312

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 13, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
woltspace Ready Ready Preview, Comment Apr 13, 2026 6:45pm

The previous version synced the host repo on every rebuild and silently
warned-and-proceeded if the checkout failed — which reintroduces the
exact drift bug we're trying to fix (image moves, host stays put).

New contract:

- Sync only when --version is explicitly passed. Plain 'rebuild' and
  branch builds leave the host repo alone; the host is the source of
  truth in those cases.
- Skip when already at the target ref (noop, no fetch).
- Abort with a clear message if the working tree is dirty. Silent drift
  is worse than a loud stop — user commits/stashes and retries.
- Abort on checkout failure instead of warning. Same reasoning.

This keeps the CLI ↔ container lockstep invariant without yanking devs
or tagged users off their intended version.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

woltspace update doesn't sync the host CLI script

1 participant