Skip to content

fix(lanes): a lane on a node keeps a whole node_modules while new inputs are prepared (#305) - #306

Merged
7schmiede merged 2 commits into
mainfrom
fix/node-link-two-copies
Oct 27, 2026
Merged

7schmiede merged 2 commits into
mainfrom
fix/node-link-two-copies

Conversation

@7schmiede

Copy link
Copy Markdown
Member

Fixes #305.

What happened

The daemon log of the reporting stack shows it: the lane on the node was linked from the store (61 282 files). Then the lockfile changed in its worktree, and the 15-second look (follow_node_links) ran npm ci in the copy the worktree's junction points to. npm ci empties node_modules first, then failed: EBUSY on a directory something held open, and a postinstall VirtualAlloc failed (the machine was out of memory). The worktree was left with the few packages installed so far. The log said prepare started and nothing after.

Fix (ADR-0063 addendum 2026-10-27)

  • Two copies per lane on a node: linked/src and linked/next/src, each with its own prepared/<service> marks.
  • New inputs are prepared (store or prepare) in the copy the worktree is not linked to. Its mark is removed first, so a half-made copy matches no key. The link moves once the copy is whole.
  • On failure the worktree keeps the copy it had. The path then says linked (stale) with why (dashboard: warn colour); the next look tries again.
  • Inputs that go back to the other copy's key only move the link.
  • run_prepare logs prepare_failed (exit code, cwd, log path).
  • unlink_node_lane removes links to either copy.

Tests

  • a_lane_on_a_node_gets_its_worktree_linked_to_a_copy_from_the_store extended: failing prepare → linked (stale), old content still reachable; store hit → linked/next, link moved, first copy unchanged; inputs back → link back without a run.
  • cargo test -p devstack-daemon (160), clippy clean, ui typecheck + vitest (72).

🤖 Generated with Claude Code

7schmiede and others added 2 commits October 27, 2026 12:45
…uts are prepared (#305)

When the lockfile changed in the worktree of a lane on a node, `prepare`
ran `npm ci` in the copy the worktree's junction points to. `npm ci`
empties node_modules first; when it then failed (a locked file, out of
memory) the worktree was left with a few packages and nothing in the log.

The lane now has two copies (`linked/src`, `linked/next/src`): new inputs
are prepared in the one the worktree is not linked to, its mark removed
first, and the link moves once it is whole. A failure keeps the copy it
had (`linked (stale)`, with why). A failed prepare is logged as
`prepare_failed`. ADR-0063 addendum.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…) fails all the same

Co-Authored-By: Claude Opus 5.5 <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.

A lane on a node: the linked node_modules copy holds only a few packages although the store entry is complete

1 participant