Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions bindings/napi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"files": ["index.cjs", "index.mjs", "index.d.ts", "ruv_fann.node", "build-info.json", "README.md", "LICENSE-MIT", "LICENSE-APACHE"],
"engines": { "node": ">=22.13.0" },
"license": "MIT OR Apache-2.0",
"homepage": "https://ruv.io",
"repository": { "type": "git", "url": "https://github.com/ruvnet/ruv-FANN.git", "directory": "bindings/napi" },
"scripts": {
"build": "node scripts/build.mjs",
Expand Down
6 changes: 6 additions & 0 deletions cuda-wasm/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.0.1] - Unreleased

### Package metadata

- Set `homepage` to https://ruv.io. No code or dependency change.

## [2.0.0] - Unreleased

### Breaking changes
Expand Down
2 changes: 1 addition & 1 deletion cuda-wasm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

`cuda-rust-wasm` is an experimental Rust toolkit for reading a subset of CUDA C++, generating Rust or WGSL text, and experimenting with CPU reference kernels. CUDA is an NVIDIA trademark; this project is independent of NVIDIA.

The Rust library and `cuda2rust` command have a staged 0.2.0 release. The `cuda-wasm` npm package has a staged 2.0.0 release with a smaller, working contract: a Node.js wrapper around that command, returning Rust or WGSL **source text**. These versions are prepared in this checkout; registry publication is a separate step.
The Rust library and `cuda2rust` command have a staged 0.2.0 release. The `cuda-wasm` npm package has a staged 2.0.1 release with a smaller, working contract: a Node.js wrapper around that command, returning Rust or WGSL **source text**. These versions are prepared in this checkout; registry publication is a separate step.

![CUDA source passes through the Node wrapper to a trusted cuda2rust executable, which returns Rust or WGSL source for separate validation.](docs/assets/source-flow.svg)

Expand Down
4 changes: 2 additions & 2 deletions cuda-wasm/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions cuda-wasm/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cuda-wasm",
"version": "2.0.0",
"version": "2.0.1",
"description": "Node.js wrapper for cuda2rust: generate Rust or WGSL source from a subset of CUDA C++",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
Expand Down Expand Up @@ -52,7 +52,7 @@
"bugs": {
"url": "https://github.com/ruvnet/ruv-FANN/issues"
},
"homepage": "https://github.com/ruvnet/ruv-FANN/tree/main/cuda-wasm#readme",
"homepage": "https://ruv.io",
"funding": {
"type": "github",
"url": "https://github.com/sponsors/ruvnet"
Expand Down
2 changes: 1 addition & 1 deletion cuda-wasm/tests/node-wrapper.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function rejectsCode(promise, code) {

test('CJS, ESM and package version expose only the documented source API', async () => {
const esm = await import(pathToFileURL(path.resolve(__dirname, '../dist/index.mjs')).href);
assert.equal(api.getVersion(), '2.0.0');
assert.equal(api.getVersion(), '2.0.1');
assert.equal(api.getVersion(), pkg.version);
assert.equal(esm.transpileCuda, api.transpileCuda);
assert.equal(esm.default.transpileFile, api.transpileFile);
Expand Down
1 change: 1 addition & 0 deletions integrations/ruv-fann/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"files": ["src/", "README.md", "LICENSE-MIT", "LICENSE-APACHE"],
"engines": { "node": ">=22.13.0" },
"license": "MIT OR Apache-2.0",
"homepage": "https://ruv.io",
"repository": { "type": "git", "url": "https://github.com/ruvnet/ruv-FANN.git", "directory": "integrations/ruv-fann" },
"publishConfig": { "access": "public" },
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions ruv-swarm/npm/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## [2.0.2] - Unreleased

### Package metadata

- Set `homepage` to https://ruv.io. No code, dependency or WASM change.

## [2.0.1] - 2026-11-10

### Release pipeline
Expand Down
2 changes: 1 addition & 1 deletion ruv-swarm/npm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ Version 2.0 narrows the public API to working capabilities. Use `RuvSwarm.initia

MCP clients should refresh `tools/list`: unsupported autonomous, training and invented telemetry tools have been removed. Assignment replies return actual task IDs, `assigned` or `unassigned`, and `assignedAgents`; they contain no estimated completion or fabricated model accuracy. SQLite records survive process restarts. State defaults to `.ruv-swarm/state.sqlite` in the working project; `RUV_SWARM_DB_PATH` selects an explicit location. To use an older database, back it up and point that variable at the existing file.

The npm package is 2.0.1; its bundled core Rust WASM crate has its own version, 1.0.6. See the [changelog](./CHANGELOG.md) for the compatibility changes.
The npm package is 2.0.2; its bundled core Rust WASM crate has its own version, 1.0.6. See the [changelog](./CHANGELOG.md) for the compatibility changes.

## License

Expand Down
4 changes: 2 additions & 2 deletions ruv-swarm/npm/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions ruv-swarm/npm/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ruv-swarm",
"version": "2.0.1",
"version": "2.0.2",
"description": "Node.js swarm metadata, SQLite persistence, and checked WebAssembly inference",
"main": "src/index.js",
"module": "src/index.js",
Expand Down Expand Up @@ -166,7 +166,7 @@
"bugs": {
"url": "https://github.com/ruvnet/ruv-FANN/issues"
},
"homepage": "https://github.com/ruvnet/ruv-FANN#readme",
"homepage": "https://ruv.io",
"dependencies": {
"better-sqlite3": "12.11.1",
"node-gyp": "12.4.0",
Expand Down
8 changes: 4 additions & 4 deletions ruv-swarm/npm/test-npm-install-v106/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ruv-swarm/npm/test-npm-install-v106/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
"test": "node smoke.mjs"
},
"dependencies": {
"ruv-swarm": "file:../ruv-swarm-2.0.1.tgz"
"ruv-swarm": "file:../ruv-swarm-2.0.2.tgz"
}
}
2 changes: 1 addition & 1 deletion ruv-swarm/npm/test-npm-install-v106/smoke.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const Database = apiRequire('better-sqlite3');
const database = new Database(':memory:');
try { assert.equal(database.prepare('SELECT 2 + 3 AS result').get().result, 5); }
finally { database.close(); }
assert.equal(RuvSwarm.getVersion(), '2.0.1');
assert.equal(RuvSwarm.getVersion(), '2.0.2');
const runtime = await RuvSwarm.initialize();
const network = runtime.createNeuralNetwork([2, 1], 'Linear');
try {
Expand Down
2 changes: 1 addition & 1 deletion ruv-swarm/npm/wasm/build-info.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"schemaVersion": 2,
"sourceSha256": "a7a4c4c7467b543e2266e72b474cd088e3e82d4aaa3042b251f358752d58feb4",
"sourceSha256": "5a896c96cff597f89ab174786d44b6fa3a1a70db0b3df423c7c1f87db39c4fd4",
"toolchain": {
"rustc": "rustc 1.88.0 (6b00bc388 2025-06-23)",
"wasmPack": "wasm-pack 0.15.1"
Expand Down
47 changes: 38 additions & 9 deletions scripts/create-github-release.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import hashlib
import json
import os
import re
from pathlib import Path
import shutil
import subprocess
Expand All @@ -17,6 +18,13 @@ def digest(path):
return hashlib.sha256(path.read_bytes()).hexdigest()


ARCHIVE_SUFFIXES = ('.crate', '.tgz')


def write_receipt(base, source, repo, tag, status, manifest):
(base / 'github-release.json').write_text(json.dumps({'sourceSha': source, 'tag': tag, 'status': status, 'url': f'https://github.com/{repo}/releases/tag/{tag}', 'assets': manifest}, indent=2))


def main():
base = Path(sys.argv[1]).resolve()
source = os.environ['GITHUB_SHA']
Expand Down Expand Up @@ -53,27 +61,48 @@ def main():
manifest = {p.name: digest(p) for p in assets.iterdir()}
(assets / 'SHA256SUMS').write_text(''.join(f'{value} {name}\n' for name, value in sorted(manifest.items())))
manifest['SHA256SUMS'] = digest(assets / 'SHA256SUMS')
versions = {r['name']: r.get('version') for r in packages}
swarm = versions.get('ruv-swarm')
if not isinstance(swarm, str) or not re.fullmatch(r'\d+\.\d+\.\d+', swarm):
raise ValueError('Release tag requires the published ruv-swarm npm version')
# One release per ruv-swarm npm version. The npm byte check already
# forces a new ruv-swarm version whenever its packaged bytes change.
repo, tag = 'ruvnet/ruv-FANN', f'ruv-fann-registry-v{swarm}'
archives = {name: value for name, value in manifest.items() if name.endswith(ARCHIVE_SUFFIXES)}
# Never overwrite an existing release or move a tag. A rerun of the same
# version with identical package archives is already released; receipts
# are excluded from the comparison because they embed the source commit.
release = subprocess.run(['gh', 'release', 'view', tag, '--repo', repo, '--json', 'isDraft'], capture_output=True, text=True)
ref = subprocess.run(['gh', 'api', f'repos/{repo}/git/ref/tags/{tag}'], capture_output=True)
if release.returncode == 0 or ref.returncode == 0:
if release.returncode != 0 or json.loads(release.stdout).get('isDraft') is not False:
raise ValueError(f'Tag {tag} exists without a published release; inspect before retrying')
existing = base / 'github-existing-download'
run('release', 'download', tag, '--repo', repo, '--dir', str(existing))
published = {p.name: digest(p) for p in existing.iterdir() if p.name.endswith(ARCHIVE_SUFFIXES)}
if published != archives:
raise ValueError(f'Release {tag} exists with different package archives; bump the ruv-swarm npm version')
write_receipt(base, source, repo, tag, 'already-released', manifest)
return
published_now = [r for r in crates if r['status'] == 'published-and-byte-verified']
listing = ', '.join(f"`{r['name']}@{r.get('version', '?')}`" for r in packages)
new_crates = ', '.join(f"`{r['name']} {r.get('version', '?')}`" for r in published_now) or 'none (all already on crates.io)'
notes = base / 'release-notes.md'
notes.write_text(f'''Coordinated release from PR #202, commit `{source}`.
notes.write_text(f'''Coordinated registry release from commit `{source}`.

Includes dense autograd training, the Candle adapter, WASM training, and SQLite/MCP fixes. Publishes 27 verified Cargo crates, `ruv-swarm@2.0.0` and `cuda-wasm@2.0.0`. The native Node addon remains a local platform build.
npm packages: {listing}. Cargo crates verified: {len(crates)}; newly published: {new_crates}.

All attached package archives are the exact bytes verified from the public registries. Fresh public installs passed core/SIMD training, persistent CLI, CUDA compiler and Rust dense training checks. See the attached publication receipts and SHA256SUMS.
''')
repo, tag = 'ruvnet/ruv-FANN', 'v0.2.2'
# Never overwrite an existing release or move a tag.
exists = subprocess.run(['gh', 'api', f'repos/{repo}/git/ref/tags/{tag}'], capture_output=True)
if exists.returncode == 0:
raise ValueError('Release tag already exists; inspect before retrying')
run('release', 'create', tag, '--repo', repo, '--target', source, '--draft', '--title', 'ruv-FANN 0.2.2 — dense training and coordinated packages', '--notes-file', str(notes), *[str(p) for p in sorted(assets.iterdir())])
run('release', 'create', tag, '--repo', repo, '--target', source, '--draft', '--title', f'ruv-FANN registry release (ruv-swarm {swarm})', '--notes-file', str(notes), *[str(p) for p in sorted(assets.iterdir())])
def verify(folder):
run('release', 'download', tag, '--repo', repo, '--dir', str(folder))
if {p.name: digest(p) for p in folder.iterdir()} != manifest:
raise ValueError('GitHub release asset byte mismatch')
verify(base / 'github-draft-download')
run('release', 'edit', tag, '--repo', repo, '--draft=false')
verify(base / 'github-public-download')
(base / 'github-release.json').write_text(json.dumps({'sourceSha': source, 'tag': tag, 'status': 'published-and-byte-verified', 'url': f'https://github.com/{repo}/releases/tag/{tag}', 'assets': manifest}, indent=2))
write_receipt(base, source, repo, tag, 'published-and-byte-verified', manifest)


if __name__ == '__main__':
Expand Down
44 changes: 32 additions & 12 deletions scripts/publish-npm-candidates.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,26 @@
import urllib.request

ROOT = Path(__file__).resolve().parents[1]
# npm can take several minutes before a new tarball is served publicly.
VISIBILITY_TIMEOUT = 600
VISIBILITY_DELAYS = (5, 10, 20, 30, 60)


def wait_public(url, timeout=VISIBILITY_TIMEOUT, sleep=time.sleep, clock=time.monotonic):
"""Return the public tarball bytes, or None if it stays 404 past the deadline."""
deadline = clock() + timeout
attempt = 0
while True:
try:
return urllib.request.urlopen(url, timeout=60).read()
except urllib.error.HTTPError as error:
if error.code != 404:
raise
remaining = deadline - clock()
if remaining <= 0:
return None
sleep(min(VISIBILITY_DELAYS[min(attempt, len(VISIBILITY_DELAYS) - 1)], remaining))
attempt += 1


def sha(path):
Expand All @@ -31,13 +51,17 @@ def head():
return subprocess.check_output(['git', 'rev-parse', 'HEAD'], cwd=ROOT, text=True).strip()


def consumer(directory, specs, compiler=None):
def consumer(directory, specs, packages, compiler=None):
directory.mkdir()
(directory / 'package.json').write_text('{"private":true,"type":"module"}')
# Consumer lifecycle code never inherits registry publishing credentials.
env = {k: v for k, v in os.environ.items() if k not in ('NODE_AUTH_TOKEN', 'NPM_TOKEN', 'CARGO_REGISTRY_TOKEN', 'GH_TOKEN', 'GITHUB_TOKEN')}
(directory / '.npmrc').write_text('registry=https://registry.npmjs.org\n')
env['NPM_CONFIG_USERCONFIG'] = str(directory / '.npmrc')
cuda = [r['version'] for r in packages if r['name'] == 'cuda-wasm']
if len(cuda) != 1: raise ValueError('Expected one cuda-wasm candidate')
# The consumer checks the exact version that this release candidate carries.
env['CUDA_WASM_VERSION'] = cuda[0]
run(['npm', 'install', '--registry=https://registry.npmjs.org', '--no-audit', '--no-fund', *specs], directory, env)
script = r'''
import assert from 'node:assert/strict';
Expand All @@ -58,7 +82,7 @@ def consumer(directory, specs, compiler=None):
const cli=new URL('./node_modules/ruv-swarm/bin/ruv-swarm-secure.js',import.meta.url);
const call=args=>JSON.parse(execFileSync(process.execPath,[cli.pathname,...args],{encoding:'utf8',env:{...process.env,RUV_SWARM_DB_PATH:new URL('./state.sqlite',import.meta.url).pathname}}));
call(['init','mesh','2']);call(['spawn','coder','Registry consumer']);assert.equal(call(['status']).total_agents,1);
const cjs=require('cuda-wasm');const esm=await import('cuda-wasm');assert.equal(cjs.getVersion(),'2.0.0');assert.equal(esm.getVersion(),'2.0.0');
const cjs=require('cuda-wasm');const esm=await import('cuda-wasm');assert.equal(cjs.getVersion(),process.env.CUDA_WASM_VERSION);assert.equal(esm.getVersion(),process.env.CUDA_WASM_VERSION);
if(process.env.CUDA2RUST_BINARY){
const source='__global__ void copy(float* a, float* b) { int i = threadIdx.x; b[i] = a[i]; }';
assert.match((await cjs.transpileCuda(source)).code,/fn copy/);
Expand Down Expand Up @@ -101,7 +125,7 @@ def main():
training_archive = list((base / 'npm-training').glob('*.tgz'))
if len(training_archive) != 1 or sha(training_archive[0]) != candidates[0]['sha256']:
raise ValueError('Training-tested archive differs')
consumer(base / 'npm-local-consumer', [r['archive'] for r in candidates])
consumer(base / 'npm-local-consumer', [r['archive'] for r in candidates], candidates)
save(seal, {'sourceSha': head(), 'packages': candidates})
return
record = json.loads(seal.read_text())
Expand All @@ -122,21 +146,17 @@ def main():
except urllib.error.HTTPError as error:
if error.code != 404: raise
run(['npm','publish',row['archive'],'--ignore-scripts','--access','public','--provenance','--registry=https://registry.npmjs.org'],ROOT)
public = None
for _ in range(24):
try:
public = urllib.request.urlopen(url, timeout=60).read(); break
except urllib.error.HTTPError as retry:
if retry.code != 404: raise
time.sleep(5)
if public is None or hashlib.sha256(public).hexdigest() != row['sha256']:
public = wait_public(url)
if public is None:
raise RuntimeError(f'Published, but {url} was not publicly downloadable within {VISIBILITY_TIMEOUT}s; rerun the failed job to verify the bytes')
if hashlib.sha256(public).hexdigest() != row['sha256']:
raise ValueError('Published npm bytes do not match candidate: '+row['name'])
published.append({**row, 'status':'published-and-byte-verified'})
stream.seek(0);json.dump({'sourceSha':head(),'packages':published},stream,indent=2);stream.truncate();stream.flush()
return
# Install the Cargo compiler and dense example from public crates.io too.
run(['cargo','install','cuda-rust-wasm','--version','=0.2.0','--locked','--bin','cuda2rust','--root',str(base/'public-compiler')],base)
consumer(base/'npm-public-consumer',[r['name']+'@'+r['version'] for r in record['packages']],base/'public-compiler/bin/cuda2rust')
consumer(base/'npm-public-consumer',[r['name']+'@'+r['version'] for r in record['packages']],record['packages'],base/'public-compiler/bin/cuda2rust')
rust = base/'rust-public-consumer';(rust/'src').mkdir(parents=True)
(rust/'Cargo.toml').write_text('[package]\nname="release-consumer"\nversion="0.0.0"\nedition="2021"\n[dependencies]\nruv-fann={version="=0.2.2",default-features=false,features=["std","serde"]}\nruv-fann-candle="=0.1.0"\n')
(rust/'src/main.rs').write_text((ROOT/'examples/dense_autograd.rs').read_text())
Expand Down
Loading
Loading