Skip to content

feat: native hotswap agent, multi-plugin dev server, descriptor commands/depend#44

Merged
ch99q merged 3 commits into
mainfrom
ch99q/hotswap-issues
Jul 1, 2026
Merged

feat: native hotswap agent, multi-plugin dev server, descriptor commands/depend#44
ch99q merged 3 commits into
mainfrom
ch99q/hotswap-issues

Conversation

@ch99q

@ch99q ch99q commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Replace the HotswapAgent/JBR extraClasspath approach with an embedded JVM agent (agent/ Java sources, base64-embedded via agent/build.ts) that pluggy drives over a nonce-authenticated loopback control socket; redefineClasses reports reloaded/pending/nochange.
  • pluggy dev at a workspace root now runs every shipping plugin on one server, hotswapping each independently (one agent, one root per plugin).
  • Add --debug (JDWP) bound to loopback by default, with --debug-expose opting into all-interfaces for containers/WSL2.
  • Bukkit descriptor now emits commands: and derives depend: from workspace: deps, and the platform API classpath is cached on disk keyed by (platform, version, CLI_VERSION).
  • BREAKING: a workspace with no main is now a build error — shared code must be its own plugin others depend on (Java isolates plugin classloaders, so shading a library into two plugins duplicates its state); "library" workspaces are gone.

Test plan

  • vp test (671 passed, 4 skipped — includes a real-JVM agent redefine test)
  • vp lint / vp check (clean)
  • Manual: built bun --compile binary; drove a multi-plugin suite in playground/ — core loads first via the derived depend, economy+homes enable on one server, each hotswaps independently, /balance etc. registered from generated commands:, no NoClassDefFoundError.

ch99q added 3 commits July 2, 2026 00:35
…ommands/depend

Replace the HotswapAgent/JBR extraClasspath approach with an embedded JVM
agent, and grow the dev/build pipeline to match:

- Embedded hotswap agent (agent/ Java sources compiled + base64-embedded via
  agent/build.ts) that pluggy drives over a nonce-authenticated loopback
  control socket; redefineClasses distinguishes reloaded/pending/nochange.
- Multi-plugin suite dev server: `pluggy dev` at a workspace root runs every
  shipping plugin on one server, hotswapping each independently (one agent,
  one root per plugin).
- `--debug` JDWP support, bound to loopback by default; `--debug-expose`
  opts into all-interfaces for the container/WSL2 case.
- Bukkit descriptor now emits `commands:` and derives `depend:` from
  `workspace:` deps, so a plugin that links a sibling gets correct load order
  and classloader access without shading.
- Platform API classpath disk cache keyed by (platform, version, CLI_VERSION)
  so an upgrade that changes resolution can't serve a stale classpath.

BREAKING CHANGE: a workspace with no `main` is now a build error. Shared code
must be its own plugin that others depend on (Java isolates plugin
classloaders, so shading a library into two plugins duplicates its state);
"library" workspaces are no longer supported.
Add the comments convention (default to none; keep only contract docs,
non-obvious rationale, and TODOs) and fold it into the conventions list.
CLI_VERSION moved out of src/index.ts into a leaf module; point the
release workflow's sed (and its grep guard) at the new location so tagged
builds report the real version instead of 0.0.0.
@ch99q ch99q merged commit 8b8df90 into main Jul 1, 2026
4 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