Skip to content

feat(ruvector): weight-space as a hard dependency, plus weights set-layer/perturb/learn - #1503

Merged
ruvnet merged 3 commits into
mainfrom
feat/weight-space-hard-dependency
Nov 13, 2026
Merged

ruvnet merged 3 commits into
mainfrom
feat/weight-space-hard-dependency

Conversation

@ruvnet

@ruvnet ruvnet commented Nov 13, 2026

Copy link
Copy Markdown
Owner

Makes @ruvector/weight-space a primary dependency of ruvector and adds the missing edit and fine-tune surface to the CLI and MCP server. Three commits.

Changes

  • Hard dependency. @ruvector/weight-space@0.1.0 is an exact-pinned dependencies entry and is removed from peerDependencies/peerDependenciesMeta, as @ruvector/e-means was in feat: add shared e-means clustering and ecosystem integrations #1489. It is still lazy-loaded inside the weights commands, so --help and MCP start-up are unchanged (test/startup-budget.js). The package-absent path stays as a degradation path. ADR-358 has an amendment recording this, since it reverses the "optional peer" decision.
  • Edit and fine-tune. ruvector weights set-layer|perturb|learn and MCP weights_set_layer|weights_perturb|weights_learn (new bin/weights-edit.js). Each writes a child snapshot and never changes its parent. Inputs are bounded, file inputs are confined to the working directory like save, and a fine-tune that misses its held-out check writes nothing and returns accepted: false (exit 0).
  • Guards. weight-space-cli.js now fails instead of skipping when the package is missing. rabitq-optional.js's hard-dependency list includes @ruvector/weight-space.

Behaviour change to be aware of

ruv-fann stays an optional peer but now also arrives transitively, so on a default npm install neural-q uses its MLP backend instead of falling back to tabular q-learning. pnpm's strict layout may not expose it; those users install ruv-fann@0.1.0 directly.

Write tools over MCP

The three new tools write to the registry. RUVECTOR_MCP_DENY=weights_save,weights_set_layer,weights_perturb,weights_learn hides them (verified).

Verification

  • New test/weight-space-edit.js (10 tests against the real package), wired into npm test and CI.
  • Packed the tarball and installed it into an empty directory: weights save, perturb and learn work, all seven weights_* tools are listed, learn took held-out MSE from 0.7173 to 0.0020.
  • All tests in npm test pass locally except add-extras.js, whose CLI dry-run test needs an extra that does not resolve. In my checkout every extra resolves (hoisted from a parent node_modules and installed optional deps), so it reports "every extra is pre-installed". This does not involve the weight-space change; CI should be the check here (its main job installs with --no-optional).

Not in this PR

No version bump and no publish. ruvector is still 0.3.26; releasing goes through the ruvector-publish workflow, as in #1491.

…8 amendment)

Promote @ruvector/weight-space from an exact-pinned optional peer to an exact-pinned
runtime dependency, as @ruvector/e-means was. It stays lazy-loaded, so start-up is
unchanged, and a pruned install still degrades to the install hint.

- package.json: dependencies, removed from peerDependencies(+Meta)
- tests: manifest assertion flipped; weight-space-cli fails instead of skipping
- CI: drop the pack-and-install workaround now that the package is on npm
- README/ADR-358: reword; document that ruv-fann now arrives transitively, so
  neural-q uses its MLP backend by default on npm installs
- version bump left to the release PR, as in #1491
Expose the registry's versioned edit and fine-tune operations. Each writes a child
snapshot and never changes its parent.

- ruvector weights set-layer|perturb|learn; MCP weights_set_layer|weights_perturb|weights_learn
- new bin/weights-edit.js (shared plumbing injected from weights.js, no circular import)
- bounded inputs (epochs, rows, vector/patch sizes, seeds); file inputs confined to the
  working directory like save; a fine-tune that misses its held-out check writes nothing
  and returns accepted:false rather than an error
- test/weight-space-edit.js (10 tests, real package), wired into npm test and CI
- README + ADR-358 amendment; RUVECTOR_MCP_DENY verified to hide the write tools
@ruvnet
ruvnet merged commit 523d315 into main Nov 13, 2026
57 of 60 checks passed
@ruvnet
ruvnet deleted the feat/weight-space-hard-dependency branch November 13, 2026 19:52
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