Skip to content

feat!: implement vine forwarding core + all five transports (e2e) - #2

Open
cldmv-bot[bot] wants to merge 3 commits into
nextfrom
feat/forwarding
Open

feat!: implement vine forwarding core + all five transports (e2e)#2
cldmv-bot[bot] wants to merge 3 commits into
nextfrom
feat/forwarding

Conversation

@cldmv-bot

@cldmv-bot cldmv-bot Bot commented Aug 24, 2026

Copy link
Copy Markdown

🚀 What's Changed

💥 Breaking Changes

✨ Features

🐛 Bug Fixes

No bug fixes

📦 Dependencies

No dependency updates

🔧 Other Changes

👥 Contributors

@cldmv-bot cldmv-bot Bot added ! feature → next v4 flow: contributor PR targeting the next integration branch type: feature Implements new functionality — a PR or issue that adds a feature labels Aug 24, 2026
@Shinrai Shinrai changed the title feat: implement vine forwarding core + all five transports (e2e) feat!: implement vine forwarding core + all five transports (e2e) Aug 24, 2026
The package is now functional end to end, not a scaffold. Implements the
docs/DESIGN.md v1 contract: per-leaf forwarding stubs mounted at identical paths
(permission-gated by slothlet itself), async callId correlation, settle-once,
per-call budget timers, and remote-death force-settle — over an injected Channel
seam the core never imports a transport for.

Core:
- src/lib/{errors,frame,link}.mjs — VineError/VineRemoteError taxonomy (remote
  VINE_* codes remapped to VINE_REMOTE so a far side cannot spoof link-state),
  total junk-tolerant frame parsing with prototype-pollution-safe path guards,
  and the settle-once correlation table.
- src/serve.mjs / src/grow.mjs — serve exposes an instance's leaves (hard-excludes
  slothlet.**, filters by paths, reports excluded); grow mounts one stub per leaf,
  ownership-scoped teardown, handshake deadline so a silent peer can't hang.

Transports (each self-contained, drop-in, conformance-harnessed + full 6-point
e2e over its REAL boundary):
- loopback (in-process pair), post-message (Worker/MessagePort surface),
  worker-threads (real Worker, death via terminate), process (real fork,
  serialization:advanced, death via kill), websocket (real ws server, ephemeral
  port, death via socket close). ws is an optional peer dep imported only by its
  module.

Uniform send-failure policy across all transports: a medium-refused frame
rethrows -> that one call settles VINE_BAD_FRAME (link survives); a dead channel
fires onClose -> VINE_GONE; a close race is a no-op. Locked in by
tests/regression-send-failure.test.vitest.mjs across all four real transports.

Reusable Channel conformance harness at @cldmv/slothlet-vine/testing so consumer
transports self-verify. 330 tests, 97.6% stmts / 93.6% branch, lint clean.

Adversarially reviewed twice (core, then cross-transport); all findings fixed.
Three genuine slothlet bugs found and filed upstream (CLDMV/slothlet#302 proto
pollution via add() path, #303 colon-moduleID ownership, #304 .apply record
corruption); vine defends against all three internally.

BREAKING CHANGE: establishes the stable v1 public API. grow/serve, the
Channel transport contract, the wire frame protocol, and the VineError/
VineRemoteError taxonomy are now the committed 1.0 surface. The pre-release
stubs that threw NOT_IMPLEMENTED are replaced by working implementations, so
any code written against the throwing scaffold now behaves entirely differently.
Without a files field npm would ship all 64 repo files (tests, fixtures, .github,
.configs, docs — 417kB) as the 1.0.0 debut. Restrict to src + schemas + README +
LICENSE: 16 files, 150kB unpacked.
… keepers

The three slothlet bugs found while building vine now have fix PRs
(CLDMV/slothlet#305/#306/#307 for issues #302/#303/#304). Update the code comments
to reference them — but the guards STAY, and the comments now say why:
- frame.mjs UNSAFE_SEGMENTS is security (validating untrusted REMOTE surface paths
  at vine's boundary), not a bug workaround — independent of the slothlet version.
- grow.mjs hyphen moduleID is zero-cost and works on patched + unpatched slothlet.
- serve.mjs Reflect.apply is idiomatic and shadow-proof — better than leaf.apply
  even once #307 lands.
No behavior change; 330 tests green.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

! feature → next v4 flow: contributor PR targeting the next integration branch type: feature Implements new functionality — a PR or issue that adds a feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant