multimodel-dev-os 3.0.1 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -32,7 +32,7 @@ export default {
32
32
  'license': 'https://opensource.org/licenses/MIT',
33
33
  'url': 'https://github.com/rizvee/multimodel-dev-os',
34
34
  'downloadUrl': 'https://www.npmjs.com/package/multimodel-dev-os',
35
- 'softwareVersion': '3.0.1',
35
+ 'softwareVersion': '3.1.0',
36
36
  'description': 'Portable, vendor-neutral AI Developer OS for multi-agent coding workflows.'
37
37
  })
38
38
  ]
@@ -199,7 +199,7 @@ export default {
199
199
  { text: 'v3 Roadmap', link: '/v3-roadmap' },
200
200
  { text: 'Release Policy', link: '/release-policy' },
201
201
  { text: 'Support Policy', link: '/support-policy' },
202
- { text: 'Pre-flight Release Testing', link: '/testing-v0.2' },
202
+ { text: 'Pre-flight Release Testing', link: '/testing' },
203
203
  { text: 'Final Launch Guidelines', link: '/final-launch' },
204
204
  { text: 'v1.0.0 Release Checklist', link: '/v1-checklist' }
205
205
  ]
@@ -12,13 +12,13 @@ Before publishing, always test the built package locally by compiling a compress
12
12
  ```bash
13
13
  npm pack
14
14
  ```
15
- This creates a file named like `multimodel-dev-os-3.0.1.tgz` in your directory root.
15
+ This creates a file named like `multimodel-dev-os-3.0.2.tgz` in your directory root.
16
16
 
17
17
  2. **Verify bundle contents:**
18
18
  Create an empty temporary workspace, extract the tarball, and confirm that only required scaffold folders are included (no `.github/`, test configurations, or local system files):
19
19
  ```bash
20
20
  mkdir -p /tmp/package-test && cd /tmp/package-test
21
- tar -xzf /path/to/multimodel-dev-os-3.0.1.tgz
21
+ tar -xzf /path/to/multimodel-dev-os-3.0.2.tgz
22
22
  ls -la package/
23
23
  ```
24
24
 
@@ -78,17 +78,17 @@ Execute these validation actions strictly in sequence before triggering a releas
78
78
  ## 4. Prepublish Safety Guard
79
79
 
80
80
  > [!IMPORTANT]
81
- > **v3.0.1 is the active stable release.** NPM publishing is live.
81
+ > **v3.0.2 is the active stable release.** NPM publishing is live.
82
82
 
83
83
  ### Source vs. Registry Strategy
84
- * **GitHub main branch (Source)**: Contains the current stable `v3.0.1` codebase.
84
+ * **GitHub main branch (Source)**: Contains the current stable `v3.0.2` codebase.
85
85
  * **npm latest (Registry)**: Pulled and installed globally or via npx.
86
86
 
87
87
  ### Prepublish Safety Guard
88
88
  To prevent accidental `npm publish` executions on developer environments, a local validation script has been added to package hooks. If you run `npm publish`, it is blocked by default.
89
89
 
90
90
  To bypass this check during approved release windows:
91
- 1. Ensure the version in `package.json` is a valid stable major version >= 2 (e.g., v3.0.1).
91
+ 1. Ensure the version in `package.json` is a valid stable major version >= 2 (e.g., v3.0.2).
92
92
  2. Run publication with the override env variable:
93
93
  ```powershell
94
94
  # PowerShell
@@ -27,3 +27,11 @@ The project release audit scripts strictly enforce these checks:
27
27
  npm run verify
28
28
  ```
29
29
  Any violation will cause verification and build pipelines to fail immediately.
30
+
31
+ ## Registry Security Update (v3.0.2)
32
+
33
+ A security hotfix has been applied in `v3.0.2` to secure the registry synchronization and validation channels:
34
+ * **Remediation of Command Injection Risk:** Removed shell-based url interpolation. Sub-process fetches now use safe, argument-based `execFileSync` invocations, isolating URL arguments from evaluated code context.
35
+ * **Registry URL Sanitization:** Enforces strict validation of remote registry URLs using Node's `URL` parser. URLs must use HTTPS by default. Control characters, credentials, spaces, quotes, and shell metacharacters are strictly rejected.
36
+ * **Upgrade Guidance:** Users running `v3.0.0` or `v3.0.1` must upgrade to `v3.0.2` immediately.
37
+ * **Safety Boundaries Preserved:** Remote registries remain disabled by default, sync operations are cache-only (never installing or running plugins), and conflict checks on sensitive files (`.env`, `.npmrc`, package configuration files) are strictly enforced.
@@ -1,4 +1,4 @@
1
- # MultiModel Dev OS — Comprehensive AI Assistant Discoverability Guide (v3.0.1 Stable Release)
1
+ # MultiModel Dev OS — Comprehensive AI Assistant Discoverability Guide (v3.1.0 Stable Release)
2
2
 
3
3
  MultiModel Dev OS is a repository-level porting specification designed to align context and instructions across diverse developer tools and AI models.
4
4
 
@@ -1,4 +1,4 @@
1
- # MultiModel Dev OS (v3.0.1 Stable Release)
1
+ # MultiModel Dev OS (v3.1.0 Stable Release)
2
2
 
3
3
  Portable, vendor-neutral workspace configuration standard for multi-agent AI pair-programming workflows.
4
4
 
@@ -245,4 +245,9 @@
245
245
  <changefreq>weekly</changefreq>
246
246
  <priority>0.7</priority>
247
247
  </url>
248
+ <url>
249
+ <loc>https://rizvee.github.io/multimodel-dev-os/testing</loc>
250
+ <changefreq>weekly</changefreq>
251
+ <priority>0.7</priority>
252
+ </url>
248
253
  </urlset>
@@ -35,6 +35,10 @@ Here is a list of all fields supported in `.ai/policies/registry-policy.yaml`:
35
35
  * **Default:** `false`
36
36
  * **Description:** When `false`, blocks installation of plugins originating from registries with `trust_level` set to `community` or `untrusted`.
37
37
 
38
+ ### `allow_http_localhost` (Boolean)
39
+ * **Default:** `false`
40
+ * **Description:** (Added in `v3.0.2`) When `true`, optionally permits remote registry URLs to use unencrypted `http://localhost` or `http://127.0.0.1` endpoints. Intended strictly for local development and testing.
41
+
38
42
  ### `allowed_write_roots` (Array of Strings)
39
43
  * **Default:** `['.ai/', 'adapters/']`
40
44
  * **Description:** A whitelist of directory paths relative to the project root. Plugins are only permitted to write files into these directories.
@@ -41,6 +41,13 @@ Threat: Malicious Remote Registry
41
41
  * **In-process verification:** The `registry verify` command performs SHA256 checksum checks against the manifest.
42
42
  * **ReadOnly Dashboard:** The interactive TUI Dashboard is completely read-only for registry and plugin operations, preventing UI-driven privilege escalation.
43
43
 
44
+ ### 5. Sync Command Injection & URL Validation (Patched in v3.0.2)
45
+ * **Threat:** A compromised or malicious remote registry URL is pre-configured in `.ai/registries/sources.yaml` to execute command injection payloads (e.g. via quotes or shell metacharacters) during sync.
46
+ * **Mitigation:**
47
+ * **No Shell Execution:** Remote synchronization (`registry sync`) does not invoke shell interpreters. It spawns the Node sub-process using the safe `execFileSync` API, passing the target URL as arguments (`process.argv[1]`) rather than string-interpolating it into evaluated code.
48
+ * **Strict URL Sanitization:** URLs are validated using the native `URL` class. Remote registry URLs must use HTTPS by default. Credentials, quotes (`'`, `"`, `` ` ``), spaces, and shell metacharacters (`$`, `;`, `&`, `|`, `<`, `>`, `(`, `)`, `*`) are strictly blocked.
49
+ * **HTTP Localhost Exception:** The `allow_http_localhost` policy flag (defaulting to `false`) optionally allows local development registries using `http://localhost` or `http://127.0.0.1`.
50
+
44
51
  ---
45
52
 
46
53
  ## Safety Boundaries Matrix
@@ -51,6 +51,12 @@ Run the `registry add` command with the `--approved` flag to define a new regist
51
51
  npx multimodel-dev-os registry add partner-registry https://registry.example.com/catalog.yaml --approved
52
52
  ```
53
53
 
54
+ > [!IMPORTANT]
55
+ > **Strict URL Constraints (v3.0.2+)**
56
+ > * All remote registry URLs must be valid and must use HTTPS by default to prevent sniffing and tampering.
57
+ > * URLs containing quotes (`'`, `"`, `` ` ``), spaces, or shell metacharacters (`$`, `;`, etc.) are rejected to eliminate command injection risks.
58
+ > * Local testing via HTTP localhost can be enabled if `allow_http_localhost` is set to `true` inside `registry-policy.yaml`.
59
+
54
60
  ### 3. Synchronize Registry Data
55
61
 
56
62
  To fetch the remote catalog, run `registry sync`. Executing without the approval flag displays a safety audit preview:
@@ -0,0 +1,123 @@
1
+ # MultiModel Dev OS — Testing Guide (v3.1.0+)
2
+
3
+ This document outlines the testing strategy, tools, and execution processes for MultiModel Dev OS.
4
+
5
+ ---
6
+
7
+ ## 1. Testing Architecture
8
+
9
+ MultiModel Dev OS implements a two-tier testing strategy to ensure safety, correctness, and compatibility:
10
+
11
+ ```
12
+ ┌──────────────────────────────────────────────────────────┐
13
+ │ Tier 1: Unit Tests (Vitest) │
14
+ │ Validates parser logic, URL rules, path safety, and │
15
+ │ manifest schemas in isolation. │
16
+ └────────────────────────────┬─────────────────────────────┘
17
+
18
+ ┌────────────────────────────▼─────────────────────────────┐
19
+ │ Tier 2: Release Verification (Verify.js) │
20
+ │ Executes integration checks, CLI commands, packaging │
21
+ │ pre-flights, and repository structure audits. │
22
+ └──────────────────────────────────────────────────────────┘
23
+ ```
24
+
25
+ ---
26
+
27
+ ## 2. Tier 1: Unit Testing (Vitest)
28
+
29
+ Unit tests target pure logic and utility functions to verify behavior under edge cases. The test suite is powered by **Vitest** and located under `tests/unit/`.
30
+
31
+ ### Run Unit Tests
32
+ ```bash
33
+ npm test
34
+ ```
35
+
36
+ ### Coverage Areas
37
+
38
+ 1. **YAML Parser Flow (`tests/unit/yaml.test.js`)**
39
+ - Stripping comments outside quotes.
40
+ - Flow arrays (`["item1", "item2"]`).
41
+ - Quoted booleans/numbers type preservation.
42
+ - Malformed YAML error handling.
43
+
44
+ 2. **Registry URL Validation (`tests/unit/registry-url-validation.test.js`)**
45
+ - Rejects non-HTTPS protocols (except localhost/127.0.0.1 under policy).
46
+ - Rejects URLs containing quotes, backticks, or shell injection characters.
47
+ - Rejects credential embedding in URLs.
48
+
49
+ 3. **Registry Policy Rules (`tests/unit/registry-policy.test.js`)**
50
+ - Correct default policy initialization.
51
+ - Verification of `allow_remote_registries`, `allowed_write_roots`, and `blocked_paths`.
52
+
53
+ 4. **Path & Sandbox Safety (`tests/unit/path-safety.test.js`)**
54
+ - Rejects path traversal (`../`).
55
+ - Rejects blocked files (`.env`, `package.json`).
56
+ - Ensures writes are restricted to whitelisted boundaries.
57
+
58
+ 5. **Plugin Manifest Validation (`tests/unit/plugin-manifest.test.js`)**
59
+ - Asserts required keys (`name`, `slug`, `version`, `author`, `description`).
60
+ - Validates alphanumeric slugs.
61
+ - Verifies sandboxed path prefixes (`.ai/` and `adapters/`).
62
+
63
+ 6. **Prepublish Guard Logic (`tests/unit/prepublish-guard.test.js`)**
64
+ - Asserts that publishing blocks without `MMDO_ALLOW_PUBLISH=true`.
65
+ - Permits stable major versions >= 2.
66
+
67
+ ---
68
+
69
+ ## 3. Tier 2: Release Verification Audit
70
+
71
+ The release verification script (`scripts/verify.js`) checks that the codebase matches packaging rules, CLI commands execute cleanly, and no temporary development artifacts are committed.
72
+
73
+ ### Run Verification Audit
74
+ ```bash
75
+ # Deploys build step, executes unit tests, and runs integration verification
76
+ npm run verify
77
+ ```
78
+
79
+ ### Key Audit Gates
80
+ - **Structure Check**: Verifies presence of all required configuration, documentation, templates, and adapter files.
81
+ - **CLI Help**: Asserts that `node bin/multimodel-dev-os.js --help` outputs the correct version and all available commands.
82
+ - **TUI Dashboard Dry-Run**: Validates that `--dry-run` and `--list-actions` flags execute without TTY dependencies.
83
+ - **Catalog Integrities**: Scans and validates all bundled catalog plugin manifests.
84
+ - **Security Hotfix Verifications**: Bypasses and checks that registry sync url checks prevent shell escapes.
85
+
86
+ ---
87
+
88
+ ## 4. Build System Testing
89
+
90
+ Since version `v3.1.0` introduces a modular source layout under `src/`, development happens in modules and is compiled into a single executable `bin/multimodel-dev-os.js`.
91
+
92
+ ### Run Build Step
93
+ ```bash
94
+ npm run build
95
+ ```
96
+
97
+ The build runner uses `scripts/build-cli.js` (powered by `esbuild` in devDependencies) to bundle source modules programmatically while preserving shebang, execution permissions, and adding a warning header.
98
+
99
+ ---
100
+
101
+ ## 5. Tarball Smoke Testing
102
+
103
+ To ensure the npm package functions flawlessly after installation, we run a local tarball smoke test:
104
+
105
+ 1. **Pack the release package**:
106
+ ```bash
107
+ npm pack
108
+ ```
109
+ 2. **Setup a clean test directory**:
110
+ ```bash
111
+ mkdir C:\mmdo-smoke-test
112
+ cd C:\mmdo-smoke-test
113
+ npm init -y
114
+ ```
115
+ 3. **Install the generated tarball locally**:
116
+ ```bash
117
+ npm install F:\multimodel-dev-os\multimodel-dev-os-3.1.0.tgz --no-audit --no-fund
118
+ ```
119
+ 4. **Validate npx invocation**:
120
+ ```bash
121
+ npx multimodel-dev-os --help
122
+ npx multimodel-dev-os doctor
123
+ ```
@@ -31,6 +31,10 @@ graph TD
31
31
  * **Safety:** Sandboxed logic, restricted file paths.
32
32
  * **Installation:** Refused unless `allow_untrusted_install: true` is configured in `.ai/policies/registry-policy.yaml`.
33
33
 
34
+ > [!IMPORTANT]
35
+ > **HTTPS Transport Enforcement (v3.0.2+)**
36
+ > All remote community or verified registries must use secure `https:` transport URLs. URLs are validated strictly against injection risks. Unencrypted `http:` transport is strictly rejected, except for localhost testing if `allow_http_localhost` is enabled.
37
+
34
38
  ### 4. Untrusted
35
39
  * **Source:** Unknown or flagged endpoints.
36
40
  * **Verification:** None.
@@ -7,12 +7,24 @@ This document outlines the development path, completed milestones, and future pl
7
7
  ## 1. Current Status
8
8
 
9
9
  > [!IMPORTANT]
10
- > **v3.0.1 is the active stable release** on the public npm registry. All features below marked ✅ are shipped and production-ready.
10
+ > **v3.1.0 is the active stable release** on the public npm registry. All features below marked ✅ are shipped and production-ready.
11
11
 
12
12
  ---
13
13
 
14
14
  ## 2. Completed Milestones
15
15
 
16
+ ### v3.1.0 — Modular Source Layout + Formal Unit Tests ✅
17
+ - **Modular Source Layout**: Refactored the monolithic CLI structure into isolated, clean modules under `src/` (core, registry, catalog, plugin, cli).
18
+ - **Programmatic Compiler**: Programmed `scripts/build-cli.js` using `esbuild` to compile modules into a single zero-dependency executable (`bin/multimodel-dev-os.js`) with shebang preservation.
19
+ - **Formal Unit Testing**: Integrated `vitest` unit test suites covering isolated YAML parsing, registry URL validation, policy checks, path safety boundaries, plugin manifest validations, and prepublish guard checks.
20
+ - **Improved Integration Verification**: Hooked the unit test runner and build step directly into the release audit `npm run verify` verification gate.
21
+
22
+ ### v3.0.2 — Registry Sync Security Hotfix ✅
23
+ - **Registry Sync Command Injection Remediation**: Replaced shell-based URL interpolation in fetch helper with safe process arguments passed via `execFileSync`.
24
+ - **Strict URL Validation**: Implemented strict syntax checks using `new URL()` and HTTPS-only transport requirements.
25
+ - **Diagnostics Security**: Hardened URL validations on diagnostics commands (`registry show` and `registry verify`).
26
+ - **HTTP localhost Exception**: Added the `allow_http_localhost` policy flag to optionally support local HTTP development testing.
27
+
16
28
  ### v3.0.1 — Registry UX & Policy Safety Patch ✅
17
29
  - **Registry Command UX**: Improved formatting and next-step actions for `registry status`, `registry list`, `registry show`, `registry verify`, and `registry sync`.
18
30
  - **Policy Safety Messaging**: Clarified sandboxing, offline verification capabilities, checksum verification, and approval gates.
@@ -62,7 +74,7 @@ All releases follow this strict publishing checklist:
62
74
 
63
75
  ---
64
76
 
65
- ## 4. Upcoming: v3.1.0 — Cryptographic Catalog Signing
77
+ ## 4. Upcoming: v3.2.0 — Cryptographic Catalog Signing
66
78
 
67
79
  * **Asymmetric Key Signatures**: Cryptographic signature validation for remote registries using public/private key pairs.
68
80
  * **Decentralized Trust Anchors**: Trust anchors configuration allowing teams to pin public keys of verified catalog authors.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "multimodel-dev-os",
3
- "version": "3.0.1",
3
+ "version": "3.1.0",
4
4
  "bin": {
5
5
  "multimodel-dev-os": "bin/multimodel-dev-os.js"
6
6
  },
@@ -38,7 +38,9 @@
38
38
  "assets/"
39
39
  ],
40
40
  "scripts": {
41
- "verify": "node scripts/verify.js",
41
+ "build": "node scripts/build-cli.js",
42
+ "test": "vitest run",
43
+ "verify": "npm run build && npm test && node scripts/verify.js",
42
44
  "verify:bash": "bash scripts/verify.sh",
43
45
  "test:cli": "node bin/multimodel-dev-os.js verify",
44
46
  "pack:template": "bash scripts/pack-template.sh",
@@ -49,6 +51,8 @@
49
51
  "prepublishOnly": "node scripts/prepublish-guard.js"
50
52
  },
51
53
  "devDependencies": {
52
- "vitepress": "^1.6.4"
54
+ "esbuild": "^0.20.2",
55
+ "vitepress": "^1.6.4",
56
+ "vitest": "^1.4.0"
53
57
  }
54
58
  }
@@ -0,0 +1,17 @@
1
+ import esbuild from 'esbuild';
2
+
3
+ esbuild.build({
4
+ entryPoints: ['src/cli/main.js'],
5
+ bundle: true,
6
+ platform: 'node',
7
+ format: 'esm',
8
+ outfile: 'bin/multimodel-dev-os.js',
9
+ banner: {
10
+ js: `#!/usr/bin/env node\n// Generated from src/. Do not edit directly.\n`
11
+ }
12
+ }).then(() => {
13
+ console.log('Build succeeded.');
14
+ }).catch((err) => {
15
+ console.error('Build failed:', err);
16
+ process.exit(1);
17
+ });
@@ -11,7 +11,7 @@ param(
11
11
  [switch]$Help
12
12
  )
13
13
 
14
- $Version = "3.0.1"
14
+ $Version = "3.1.0"
15
15
  $RepoUrl = "https://raw.githubusercontent.com/rizvee/multimodel-dev-os/main"
16
16
 
17
17
  if ($Help) {
@@ -7,7 +7,7 @@ set -euo pipefail
7
7
  # --all (install all adapters)
8
8
  # --dry-run (show what would be created without creating)
9
9
 
10
- VERSION="3.0.1"
10
+ VERSION="3.1.0"
11
11
  REPO_URL="https://raw.githubusercontent.com/rizvee/multimodel-dev-os/main"
12
12
  CAVEMAN=false
13
13
  DRY_RUN=false
package/scripts/verify.js CHANGED
@@ -6,7 +6,7 @@
6
6
  * Runs on Windows, macOS, and Linux with zero external dependencies.
7
7
  */
8
8
 
9
- import { existsSync, readFileSync, statSync, readdirSync } from 'fs';
9
+ import { existsSync, readFileSync, statSync, readdirSync, mkdirSync, writeFileSync, rmSync } from 'fs';
10
10
  import { join, resolve, dirname } from 'path';
11
11
  import { fileURLToPath } from 'url';
12
12
  import { execSync } from 'child_process';
@@ -203,7 +203,7 @@ checkFile('docs/adapters.md');
203
203
  checkFile('docs/installers.md');
204
204
  checkFile('docs/cli-roadmap.md');
205
205
  checkFile('docs/faq.md');
206
- checkFile('docs/testing-v0.2.md');
206
+ checkFile('docs/testing.md');
207
207
  checkFile('docs/npm-publishing.md');
208
208
  checkFile('docs/templates-guide.md');
209
209
  checkFile('docs/protocol.md');
@@ -549,7 +549,7 @@ try {
549
549
  }
550
550
  }
551
551
 
552
- // Test 2: Allows version 3.0.1 with MMDO_ALLOW_PUBLISH=true
552
+ // Test 2: Allows version 3.1.0 with MMDO_ALLOW_PUBLISH=true
553
553
  try {
554
554
  const output = execSync('node scripts/prepublish-guard.js', {
555
555
  cwd: projectRoot,
@@ -557,7 +557,7 @@ try {
557
557
  encoding: 'utf8'
558
558
  });
559
559
  if (output.includes('Prepublish guard passed')) {
560
- console.log(` ${GREEN}✓${NC} prepublish guard allows version 3.0.1 when MMDO_ALLOW_PUBLISH=true`);
560
+ console.log(` ${GREEN}✓${NC} prepublish guard allows version 3.1.0 when MMDO_ALLOW_PUBLISH=true`);
561
561
  pass++;
562
562
  } else {
563
563
  console.error(` ${RED}✗${NC} prepublish guard passed but stdout missing success indicator`);
@@ -565,7 +565,7 @@ try {
565
565
  }
566
566
  } catch (err) {
567
567
  const errText = err.stderr ? err.stderr.toString() : '';
568
- console.error(` ${RED}✗${NC} prepublish guard blocked version 3.0.1: ${errText || err.message}`);
568
+ console.error(` ${RED}✗${NC} prepublish guard blocked version 3.1.0: ${errText || err.message}`);
569
569
  fail++;
570
570
  }
571
571
 
@@ -579,12 +579,12 @@ try {
579
579
  pass++;
580
580
  }
581
581
 
582
- // Test 4: Package.json version is exactly 3.0.1
583
- if (expectedVersion === '3.0.1') {
584
- console.log(` ${GREEN}✓${NC} package.json version is exactly 3.0.1`);
582
+ // Test 4: Package.json version is exactly 3.1.0
583
+ if (expectedVersion === '3.1.0') {
584
+ console.log(` ${GREEN}✓${NC} package.json version is exactly 3.1.0`);
585
585
  pass++;
586
586
  } else {
587
- console.error(` ${RED}✗${NC} package.json version is not 3.0.1 (found ${expectedVersion})`);
587
+ console.error(` ${RED}✗${NC} package.json version is not 3.1.0 (found ${expectedVersion})`);
588
588
  fail++;
589
589
  }
590
590
  } catch (e) {
@@ -1127,6 +1127,97 @@ try {
1127
1127
  fail++;
1128
1128
  }
1129
1129
 
1130
+ // Security Hotfix v3.0.2 Regression checks
1131
+ console.log('\nSecurity Hotfix v3.0.2 Regression checks:');
1132
+
1133
+ const tempPolicyDir = join(projectRoot, 'temp-verify-policy');
1134
+ const tempPolicySubdir = join(tempPolicyDir, '.ai', 'policies');
1135
+ const tempPolicyFile = join(tempPolicySubdir, 'registry-policy.yaml');
1136
+
1137
+ try {
1138
+ // Create temporary policy directory and file
1139
+ mkdirSync(tempPolicySubdir, { recursive: true });
1140
+ writeFileSync(tempPolicyFile, 'allow_remote_registries: true\n', 'utf8');
1141
+
1142
+ // 1. registry add rejects malformed URL
1143
+ try {
1144
+ execSync(`node bin/multimodel-dev-os.js registry add testmalformed not-a-url --approved --target "${tempPolicyDir}"`, { cwd: projectRoot, stdio: 'pipe' });
1145
+ console.error(` ${RED}✗${NC} registry add should have rejected malformed URL`);
1146
+ fail++;
1147
+ } catch (err) {
1148
+ const errText = err.stderr ? err.stderr.toString() : '';
1149
+ if (errText.includes('invalid') || errText.includes('malformed')) {
1150
+ console.log(` ${GREEN}✓${NC} registry add rejects malformed URL`);
1151
+ pass++;
1152
+ } else {
1153
+ console.error(` ${RED}✗${NC} registry add malformed URL failed with unexpected error: ${errText}`);
1154
+ fail++;
1155
+ }
1156
+ }
1157
+
1158
+ // 2. registry add rejects URL containing quote/shell-injection characters
1159
+ try {
1160
+ execSync(`node bin/multimodel-dev-os.js registry add testinjection "https://example.com'console.log(1)" --approved --target "${tempPolicyDir}"`, { cwd: projectRoot, stdio: 'pipe' });
1161
+ console.error(` ${RED}✗${NC} registry add should have rejected URL containing single quote`);
1162
+ fail++;
1163
+ } catch (err) {
1164
+ const errText = err.stderr ? err.stderr.toString() : '';
1165
+ if (errText.includes('quote') || errText.includes('invalid') || errText.includes('metacharacter')) {
1166
+ console.log(` ${GREEN}✓${NC} registry add rejects URL containing quote/shell-injection characters`);
1167
+ pass++;
1168
+ } else {
1169
+ console.error(` ${RED}✗${NC} registry add URL with quotes failed with unexpected error: ${errText}`);
1170
+ fail++;
1171
+ }
1172
+ }
1173
+
1174
+ // 3. registry add rejects non-HTTPS remote URL
1175
+ try {
1176
+ execSync(`node bin/multimodel-dev-os.js registry add testnonhttps http://example.com/catalog.yaml --approved --target "${tempPolicyDir}"`, { cwd: projectRoot, stdio: 'pipe' });
1177
+ console.error(` ${RED}✗${NC} registry add should have rejected non-HTTPS URL`);
1178
+ fail++;
1179
+ } catch (err) {
1180
+ const errText = err.stderr ? err.stderr.toString() : '';
1181
+ if (errText.includes('Only HTTPS is permitted') || errText.includes('protocol') || errText.includes('invalid')) {
1182
+ console.log(` ${GREEN}✓${NC} registry add rejects non-HTTPS remote URL`);
1183
+ pass++;
1184
+ } else {
1185
+ console.error(` ${RED}✗${NC} registry add non-HTTPS URL failed with unexpected error: ${errText}`);
1186
+ fail++;
1187
+ }
1188
+ }
1189
+ } catch (tempErr) {
1190
+ console.error(` ${RED}✗${NC} Setting up temporary policy folder failed: ${tempErr.message}`);
1191
+ fail++;
1192
+ } finally {
1193
+ // Clean up temporary policy directory
1194
+ try {
1195
+ if (existsSync(tempPolicyDir)) {
1196
+ rmSync(tempPolicyDir, { recursive: true, force: true });
1197
+ }
1198
+ } catch (e) {}
1199
+ }
1200
+
1201
+ // 4. Codebase structural checks for shell-based fetch URL interpolation
1202
+ try {
1203
+ const cliCode = readFileSync(join(projectRoot, 'bin', 'multimodel-dev-os.js'), 'utf8');
1204
+
1205
+ // Check for mod.get('${targetUrl}') or similar interpolation in node -e
1206
+ const hasUnsafeSync = cliCode.includes("mod.get('${targetUrl}'") || (cliCode.includes('execSync(`node -e "') && cliCode.includes('${targetUrl}'));
1207
+ const usesExecFileSync = cliCode.includes('execFileSync(process.execPath');
1208
+
1209
+ if (!hasUnsafeSync && usesExecFileSync) {
1210
+ console.log(` ${GREEN}✓${NC} fetch helper uses execFileSync and does not use shell-based URL interpolation`);
1211
+ pass++;
1212
+ } else {
1213
+ console.error(` ${RED}✗${NC} codebase security check failed. Unsafe shell execution or URL interpolation detected.`);
1214
+ fail++;
1215
+ }
1216
+ } catch (e) {
1217
+ console.error(` ${RED}✗${NC} codebase structural check failed: ${e.message}`);
1218
+ fail++;
1219
+ }
1220
+
1130
1221
  // Backward compatibility catalog checks
1131
1222
  try {
1132
1223
  const catList = execSync('node bin/multimodel-dev-os.js catalog list', { cwd: projectRoot, encoding: 'utf8' });
package/scripts/verify.sh CHANGED
@@ -190,7 +190,7 @@ check_file "docs/adapters.md"
190
190
  check_file "docs/installers.md"
191
191
  check_file "docs/cli-roadmap.md"
192
192
  check_file "docs/faq.md"
193
- check_file "docs/testing-v0.2.md"
193
+ check_file "docs/testing.md"
194
194
  check_file "docs/npm-publishing.md"
195
195
 
196
196
  # --- CLI & Packaging Pre-Flight Tests ---
@@ -1,73 +0,0 @@
1
- # multimodel-dev-os v0.2.0 Testing Documentation
2
-
3
- This document describes how to execute local test cases to verify the `bin/multimodel-dev-os.js` CLI tool and installer scripts.
4
-
5
- ---
6
-
7
- ## 1. Platform Requirements
8
- * **Node.js:** v18.0.0 or higher.
9
- * **Unix-like Shell (Git Bash, macOS Terminal, Linux Bash):** Required for executing `.sh` scripts.
10
- * **Windows PowerShell:** Required for executing `.ps1` scripts.
11
-
12
- ---
13
-
14
- ## 2. CLI Validation Tests
15
-
16
- ### Test Case A: Help Command
17
- Ensures the argument parser and help outputs render correctly.
18
- ```bash
19
- # Git Bash / macOS / Linux / PowerShell
20
- node bin/multimodel-dev-os.js --help
21
- ```
22
- * **Expected Output:** Displays correct option flags, commands (`init`, `verify`), and versions.
23
-
24
- ### Test Case B: Structural Verification Check
25
- Verifies structural presence of 20 critical files inside the repository.
26
- ```bash
27
- # Git Bash / macOS / Linux / PowerShell
28
- node bin/multimodel-dev-os.js verify
29
- ```
30
- * **Expected Output:** Outputs `✓` indicators for each file and returns a `PASSED` status with exit code `0`.
31
-
32
- ### Test Case C: Dry-Run Scaffolding Check
33
- Validates loading of custom templates (e.g. `nextjs-saas`) and adapter boundaries without actual writes.
34
- ```bash
35
- # Git Bash / macOS / Linux / PowerShell
36
- node bin/multimodel-dev-os.js init --target ./test-project --template nextjs-saas --adapter cursor --dry-run
37
- ```
38
- * **Expected Output:** Outputs 61 `[DRY-RUN] WOULD CREATE` operation logs and a final `Project initialized successfully!` success message.
39
-
40
- ### Test Case D: Conflict Prevention Check
41
- Verifies that the CLI protects existing files from overwrites.
42
- ```bash
43
- # 1. Create a dummy file
44
- mkdir -p test-conflict && touch test-conflict/AGENTS.md
45
-
46
- # 2. Run init without force
47
- node bin/multimodel-dev-os.js init --target ./test-conflict
48
- ```
49
- * **Expected Output:** Safely aborts, prints a red `CONFLICT` warning, and exits with code `1`.
50
-
51
- ### Test Case E: Overwrite Override Check
52
- Verifies that `--force` successfully bypasses conflict protection.
53
- ```bash
54
- # Run init with force
55
- node bin/multimodel-dev-os.js init --target ./test-conflict --force
56
- ```
57
- * **Expected Output:** Overwrites conflicting files and completes successfully.
58
-
59
- ---
60
-
61
- ## 3. Script Installer Validation Tests
62
-
63
- ### macOS / Linux / WSL (bash):
64
- ```bash
65
- # Run dry-run installation
66
- bash scripts/install.sh --dry-run
67
- ```
68
-
69
- ### Windows (PowerShell):
70
- ```powershell
71
- # Run dry-run installation
72
- .\scripts\install.ps1 -DryRun
73
- ```