Files
devvm/testdata/script
w3cjandClaude Opus 5.5 2a99183ea4 feat(vm): devvm update reads a changed devcontainer.json again
devvm update now makes the folder's VM again from its devcontainer.json
as it is now when the file changed, is gone or appeared since the VM was
made, as well as when its image is outdated. devcontainer_changed and
devcontainer_new name devvm update instead of devvm rm, then devvm. A
file's forwardPorts now join the VM's ports as devvm ports add adds them,
for a new VM and when devvm update reads the file again.

- vm.json's devcontainer section records what of the VM is the file's:
  image (the file's image, when the base starts from it), from_flag
  (--from won), parts (what its features mapped to), gave (those the VM
  got from the file alone, not from --tools/--layers, setup's layers,
  the folder's other files, nor unchecked), ports (its forwardPorts) and
  ports_gave (those it added to the VM's ports).
- devcontainer.Reread (pure) drops what the file gave that it no longer
  lists and adds what it lists anew that the VM lacks; the user's stay,
  and what the user took out stays out. It applies to parts
  (rereadParts) and to ports (filePorts, through AddPorts and
  RemovePorts, as devvm ports add and rm). devcontainers.reread
  re-pins a new image (or falls back to $DEVVM_FROM's), keeps --from's,
  and replaces variables and commands.
- The remake section carries reread (the new from, shared tools, ports
  and devcontainer section; tools built for the new base after the
  image) and was (what the VM had, kept when the new machine is made),
  which the undo gives back, for every remake.
- Messages: devcontainer_changed/new reworded, devcontainer_reread and
  devcontainer_gone added, devcontainer_ports_not_forwarded removed; the
  docs link points at the new "Updating a VM from the file" section.
- Tests: TestReread, TestRereadParts, TestFilePorts, TestFileParts,
  TestUpdateDevcontainer (undo and finish), TestUpDevcontainer and
  TestPlanDevcontainerFrom (the file's ports added), devcontainer.txtar
  (a new VM's ports, update after a change with the user's port added
  and the file's removed, --from winning, the file removed, a file that
  appeared), e2e's devcontainer section (the file's port reaches this
  machine; devvm update, the home kept, the new port in place of the
  old one).
- Docs: using/devcontainer (its ports, the security note), images,
  toolchains, commands, the internals overview's remake section and
  state table, the design note, the security model, attack vectors.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-05 10:56:32 -07:00
..