Skip to content

armgit / ruflo

Public Imported from GitHub
0

🌊 The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated

fix(release): reject missing umbrella package identities

Rudy Celekli84f1b1439097
diff --git a/scripts/audit-umbrella-version-lockstep.mjs b/scripts/audit-umbrella-version-lockstep.mjs
index 81180320d6..d7db4bbcac 100755
--- a/scripts/audit-umbrella-version-lockstep.mjs
+++ b/scripts/audit-umbrella-version-lockstep.mjs
@@ -52,6 +52,10 @@ for (const { label, path } of TARGETS) {
violations.push(`${label} (${path}) not found`);
continue;
}
+ if (typeof pkg.version !== 'string' || pkg.version.trim().length === 0) {
+ violations.push(`${label} (${path}) must declare a nonempty version string`);
+ continue;
+ }
versions[label] = pkg.version;
}
@@ -76,7 +80,9 @@ const rufloPkg = readPkg('ruflo/package.json');
const cliVersion = versions['@claude-flow/cli'];
if (rufloPkg && cliVersion) {
const range = rufloPkg.dependencies?.['@claude-flow/cli'];
- if (range) {
+ if (typeof range !== 'string' || range.length === 0) {
+ violations.push('ruflo must declare its exact @claude-flow/cli dependency');
+ } else {
if (range !== cliVersion) {
violations.push(
`ruflo "@claude-flow/cli": "${range}" must pin cli's actual version ${cliVersion}.\n` +
diff --git a/tests/umbrella-version-required-identities.test.mjs b/tests/umbrella-version-required-identities.test.mjs
new file mode 100644
index 0000000000..28e64ca305
--- /dev/null
+++ b/tests/umbrella-version-required-identities.test.mjs
@@ -0,0 +1,34 @@
+import { test } from 'node:test';
+import assert from 'node:assert/strict';
+import { mkdtempSync, mkdirSync, copyFileSync, writeFileSync, rmSync } from 'node:fs';
+import { tmpdir } from 'node:os';
+import { join } from 'node:path';
+import { spawnSync } from 'node:child_process';
+
+function audit(packages) {
+ const root = mkdtempSync(join(tmpdir(), 'ruflo-version-audit-'));
+ try {
+ mkdirSync(join(root, 'scripts'));
+ copyFileSync(new URL('../scripts/audit-umbrella-version-lockstep.mjs', import.meta.url), join(root, 'scripts/audit.mjs'));
+ for (const [path, value] of Object.entries(packages)) {
+ mkdirSync(join(root, path, '..'), { recursive: true });
+ writeFileSync(join(root, path), JSON.stringify(value));
+ }
+ return spawnSync(process.execPath, [join(root, 'scripts/audit.mjs')], { encoding: 'utf8' });
+ } finally { rmSync(root, { recursive: true, force: true }); }
+}
+const coherent = () => ({
+ 'package.json': { version: '3.1.0' },
+ 'v3/@claude-flow/cli/package.json': { version: '3.1.0' },
+ 'ruflo/package.json': { version: '3.1.0', dependencies: { '@claude-flow/cli': '3.1.0' } },
+});
+test('accepts the coherent release train', () => assert.equal(audit(coherent()).status, 0));
+test('rejects packages that all omit version identity', () => {
+ const packages = coherent();
+ for (const pkg of Object.values(packages)) delete pkg.version;
+ assert.equal(audit(packages).status, 1);
+});
+test('rejects a wrapper missing its CLI dependency', () => {
+ const packages = coherent(); delete packages['ruflo/package.json'].dependencies;
+ assert.equal(audit(packages).status, 1);
+});