Repository navigation
feat: a stack can run shifted on this machine (#387, ADR-0082) - #401
Merged
Merged
Conversation
The last step of review card C. A stack's registry entry holds a port
shift (machine-local, never in the stack file) and the ports its daemon
claims. `devstack up` refuses to start on ports a running stack holds,
names it and offers `--shift auto|<n>`; a stopped stack's claims only
warn. The shift moves every port a lane offset moves (services and their
proxies and forwards, container host and announced ports, `urls`,
placeholders, lanes) and keeps the Compose project, containers and
volumes; it sticks until `--shift none`. New lane numbers avoid other
stacks' claims. MCP `up`, `POST /hub/stacks/{id}/up {shift}` and a
"Start with shift" button on the stack page take it too.
Closes #387
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #387. This is the third and last pull request for review card C (ADR-0082): it builds points 3–7. The card and its approval of 2026-10-30 are in #396.
What it does
shiftandclaims({main, lanes}). Both are omitted when empty, so older entries read as shift 0 with no claims. Writes read, modify and write back the entry and keep fields they do not set.lane_stack). That moves services, their proxies and dev-server fronts,main_ports, the placeholders andurls.shift + n × step.uppre-check (main tree):devstack up --shift autoor--shift <n>.--shift auto|<n>|nonesets the shift, which then sticks.devstack downfirst"), the same way a different profile is.--shiftis refused in a worktree.uptakesshift.POST /hub/stacks/{id}/up {shift}starts a stack with one./v1/stackand the hub's stack list carryshift, anddevstack statusprints it. The stack page shows "shifted +N" and a Start with shift button for a stopped stack that collides; the mock hub covers it.stack-file.mdgets a section Several stacks on one machine (including what does not follow: ports hard-coded outside placeholders). Alsodashboard-api.md, skilldevstack, the changelog, and ADR-0082 (now built in full, with the decisions below).Decided by the agent alone:
autostarts at 1000, never 0.Tests
free_numberwith other stacks' claims, the shift overlay,auto, the refuse and warn decisions, and the hub body parsing. The compat files are untouched and green.daemon_lifecyclesuite passed (20 tests), including the newa_second_stack_on_the_same_ports_runs_shifted. It checks four steps: the second stack is refused and names the first;--shift autoruns it on +1000; a restart keeps the shift;--shift nonereturns it.DEVSTACK_INTEGRATION_COMPOSE=1passed (5 tests), including the newa_shifted_stacks_containers_move_with_it. Host and announced ports move, the name stays, and--shift nonereturns them.shift + n × step, but this was not run end to end), live lanes beside a shifted main tree, and macOS beyond CI.🤖 Generated with Claude Code