Skip to content

fix: setup runs pending migrations so git pull + ./setup works#774

Merged
garrytan merged 4 commits intomainfrom
garrytan/migration-fix
Apr 3, 2026
Merged

fix: setup runs pending migrations so git pull + ./setup works#774
garrytan merged 4 commits intomainfrom
garrytan/migration-fix

Conversation

@garrytan
Copy link
Copy Markdown
Owner

@garrytan garrytan commented Apr 3, 2026

Summary

git pull && ./setup now applies version migrations automatically. Previously, migrations only ran during /gstack-upgrade (Step 4.75 of the upgrade skill). Users who updated gstack via git pull + ./setup never got state fixes applied, leaving stale skill directory structures in place (e.g., the v0.15.2.0 migration that fixes unprefixed skill directories never ran).

What changed:

  • setup now tracks the last version it ran at in ~/.gstack/.last-setup-version
  • On each run, compares against the current VERSION and runs any pending migration scripts from gstack-upgrade/migrations/
  • Fresh installs skip migrations (they don't need state fixes from old versions)
  • Missing VERSION file doesn't poison the marker
  • Future-version migrations are skipped (prevents premature execution from dev branches)
  • Uses while read loop instead of for to handle paths with spaces

Pre-Landing Review

No issues found.

Adversarial Review

Claude adversarial subagent found 6 findings. All FIXABLE items addressed:

  • [AUTO-FIXED] Word-splitting on paths with spaces (while-read loop)
  • [AUTO-FIXED] Missing VERSION poisons state file (conditional write)
  • [AUTO-FIXED] No upper bound on migration version (added check)
  • [AUTO-FIXED] Fresh installs run all historical migrations (skip guard)
  • [ACCEPTED] Failed migrations permanently skipped (acceptable, migrations are idempotent)
  • [ACCEPTED] Downgrade + re-upgrade replays migrations (safe, migrations are idempotent)

Test plan

  • All bun tests pass (pre-existing relink timeout + eval-store test-2 unrelated)
  • Manually verified: simulated upgrade from 0.15.0.0 runs migration
  • Manually verified: second run skips migrations (idempotent)
  • Manually verified: fresh install skips migrations

🤖 Generated with Claude Code

garrytan and others added 4 commits April 2, 2026 20:41
Previously, version migrations only ran during /gstack-upgrade (Step 4.75).
Users who updated via git pull + ./setup never got migrations applied,
leaving stale skill directory structures in place. Now setup tracks the
last-run version in ~/.gstack/.last-setup-version and runs any pending
migrations automatically. Idempotent — safe to run multiple times.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Previously, version migrations only ran during /gstack-upgrade (Step 4.75).
Users who updated via git pull + ./setup never got migrations applied,
leaving stale skill directory structures in place. Now setup tracks the
last-run version in ~/.gstack/.last-setup-version and runs any pending
migrations automatically.

Addresses adversarial review findings: space-safe while-read loop,
fresh install guard, upper-bound version check, missing VERSION guard.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 3, 2026

E2E Evals: ✅ PASS

0/0 tests passed | $0 total cost | 12 parallel runners

Suite Result Status Cost

12x ubicloud-standard-2 (Docker: pre-baked toolchain + deps) | wall clock ≈ slowest suite

@garrytan garrytan merged commit c620de3 into main Apr 3, 2026
18 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