multimodel-dev-os 3.0.1 โ 3.2.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.
- package/README.md +4 -0
- package/bin/multimodel-dev-os.js +3419 -3573
- package/docs/.vitepress/config.js +2 -2
- package/docs/index.md +5 -5
- package/docs/npm-publishing.md +5 -5
- package/docs/package-safety.md +24 -0
- package/docs/public/llms-full.txt +1 -1
- package/docs/public/llms.txt +1 -1
- package/docs/public/sitemap.xml +10 -0
- package/docs/registry-policy.md +4 -0
- package/docs/registry-security.md +7 -0
- package/docs/registry-sync.md +6 -0
- package/docs/release-policy.md +6 -5
- package/docs/testing.md +133 -0
- package/docs/trusted-registries.md +4 -0
- package/docs/v3-roadmap.md +20 -2
- package/package.json +10 -3
- package/scripts/build-cli.js +59 -0
- package/scripts/check-build-fresh.js +52 -0
- package/scripts/install.ps1 +1 -1
- package/scripts/install.sh +1 -1
- package/scripts/verify.js +221 -14
- package/scripts/verify.sh +11 -1
- package/src/catalog/loader.js +117 -0
- package/src/cli/args.js +118 -0
- package/src/cli/help.js +60 -0
- package/src/cli/main.js +5718 -0
- package/src/core/globals.js +52 -0
- package/src/core/hashes.js +15 -0
- package/src/core/policy.js +36 -0
- package/src/core/security.js +61 -0
- package/src/core/yaml.js +136 -0
- package/src/plugin/manifest.js +95 -0
- package/src/registry/sources.js +40 -0
- package/src/registry/validation.js +45 -0
- package/tests/README.md +37 -0
- package/tests/fixtures/README.md +22 -0
- package/tests/fixtures/custom-template-example/README.md +10 -0
- package/tests/fixtures/proposals/approved-append-line.md +28 -0
- package/tests/fixtures/proposals/approved-create-file.md +29 -0
- package/tests/fixtures/proposals/approved-replace-text.md +30 -0
- package/tests/fixtures/proposals/existing-create-file-no-overwrite.md +29 -0
- package/tests/fixtures/proposals/no-operations.md +18 -0
- package/tests/fixtures/proposals/path-traversal.md +29 -0
- package/tests/fixtures/proposals/pending-proposal.md +29 -0
- package/tests/fixtures/proposals/protected-path.md +29 -0
- package/tests/fixtures/proposals/replace-multiple-without-allow.md +30 -0
- package/tests/fixtures/registry-overrides/README.md +20 -0
- package/tests/smoke/README.md +37 -0
- package/tests/smoke/cli-smoke.md +49 -0
- package/tests/unit/build-output.test.js +40 -0
- package/tests/unit/catalog-loader.test.js +44 -0
- package/tests/unit/path-safety.test.js +62 -0
- package/tests/unit/plugin-manifest.test.js +94 -0
- package/tests/unit/prepublish-guard.test.js +35 -0
- package/tests/unit/registry-policy.test.js +46 -0
- package/tests/unit/registry-url-validation.test.js +64 -0
- package/tests/unit/yaml.test.js +92 -0
- package/docs/testing-v0.2.md +0 -73
|
@@ -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
|
|
35
|
+
'softwareVersion': '3.2.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
|
|
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
|
]
|
package/docs/index.md
CHANGED
|
@@ -214,12 +214,12 @@ You use **Cursor** for autocomplete, **Claude Code** for terminal ops, **Gemini*
|
|
|
214
214
|
|
|
215
215
|
<div class="highlight-box">
|
|
216
216
|
|
|
217
|
-
### ๐ What's New in
|
|
217
|
+
### ๐ What's New in v3.2
|
|
218
218
|
|
|
219
|
-
-
|
|
220
|
-
-
|
|
221
|
-
-
|
|
222
|
-
-
|
|
219
|
+
- ๐๏ธ **Modular Source Layout** โ Pure ES modules under `src/` cleanly isolate core, CLI routing, catalog engines, and security systems.
|
|
220
|
+
- ๐งช **Formal Unit Testing** โ Integrated a Vitest-powered test suite executing 45 unit tests covering path safety, sandbox boundaries, and policy validation.
|
|
221
|
+
- โ๏ธ **Build Freshness Guard** โ Automated build auditing checks to ensure the generated CLI binary is always synchronized with the source modules.
|
|
222
|
+
- ๐ก๏ธ **Hardened Registry Sync** โ Strict HTTPS-only URL syntax parsing and argument-isolated sub-process executors prevent shell injection vulnerabilities.
|
|
223
223
|
|
|
224
224
|
</div>
|
|
225
225
|
|
package/docs/npm-publishing.md
CHANGED
|
@@ -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.
|
|
15
|
+
This creates a file named like `multimodel-dev-os-3.2.0.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.
|
|
21
|
+
tar -xzf /path/to/multimodel-dev-os-3.2.0.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
|
|
81
|
+
> **v3.2.0 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
|
|
84
|
+
* **GitHub main branch (Source)**: Contains the current stable `v3.2.0` 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
|
|
91
|
+
1. Ensure the version in `package.json` is a valid stable major version >= 2 (e.g., v3.2.0).
|
|
92
92
|
2. Run publication with the override env variable:
|
|
93
93
|
```powershell
|
|
94
94
|
# PowerShell
|
package/docs/package-safety.md
CHANGED
|
@@ -27,3 +27,27 @@ 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.
|
|
38
|
+
|
|
39
|
+
## Package Governance Policies
|
|
40
|
+
|
|
41
|
+
1. **Zero Runtime Dependencies:**
|
|
42
|
+
* The runtime package is strictly zero-dependency to ensure minimal installation footprint and maximum security.
|
|
43
|
+
* All compilation, testing, and dev tools (e.g., `esbuild`, `vitest`, `vitepress`) are restricted to `devDependencies` only.
|
|
44
|
+
|
|
45
|
+
2. **Open-Source Transparency:**
|
|
46
|
+
* The complete modular source files (`src/`) and testing suites (`tests/`) are intentionally included in the published NPM package, allowing for visual auditing, validation, and debugging.
|
|
47
|
+
|
|
48
|
+
3. **Manual NPM Publishing Only:**
|
|
49
|
+
* Automated publishing via CI is disabled. NPM publish is performed manually by maintainers using verification guards.
|
|
50
|
+
|
|
51
|
+
4. **Milestone-Based Releases:**
|
|
52
|
+
* Patch-level releases are kept internal by default for stabilization sprints (such as `v3.2.0-prep`).
|
|
53
|
+
* Public updates are batched into stable, fully-audited milestone releases (e.g., `v3.2.0`). Critical security hotfixes are the only exception.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# MultiModel Dev OS โ Comprehensive AI Assistant Discoverability Guide (v3.0
|
|
1
|
+
# MultiModel Dev OS โ Comprehensive AI Assistant Discoverability Guide (v3.2.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
|
|
package/docs/public/llms.txt
CHANGED
package/docs/public/sitemap.xml
CHANGED
|
@@ -245,4 +245,14 @@
|
|
|
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>
|
|
253
|
+
<url>
|
|
254
|
+
<loc>https://rizvee.github.io/multimodel-dev-os/release-policy</loc>
|
|
255
|
+
<changefreq>weekly</changefreq>
|
|
256
|
+
<priority>0.7</priority>
|
|
257
|
+
</url>
|
|
248
258
|
</urlset>
|
package/docs/registry-policy.md
CHANGED
|
@@ -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
|
package/docs/registry-sync.md
CHANGED
|
@@ -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:
|
package/docs/release-policy.md
CHANGED
|
@@ -34,9 +34,10 @@ No package shall be merged or released without:
|
|
|
34
34
|
|
|
35
35
|
---
|
|
36
36
|
|
|
37
|
-
## 4. Release
|
|
37
|
+
## 4. Release Strategy & Staging Controls
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
To ensure developer stability and avoid package version fatigue, MultiModel Dev OS enforces the following distribution strategy:
|
|
40
|
+
- **Internal Stabilization Sprints**: Patch-level work (e.g. bug fixes, refactoring, test stability, documentation formatting) is treated as internal by default and committed directly to `main` without bumping versions or publishing to npm.
|
|
41
|
+
- **Batched Milestone Releases**: Public npm and GitHub releases are batched into stable milestone releases (e.g., `v3.2.0`, `v3.3.0`, `v4.0.0`).
|
|
42
|
+
- **Security Hotfix Exceptions**: Critical security hotfixes (e.g., remote execution, command injection remediations) bypass the batching policy and are published immediately as public patch releases.
|
|
43
|
+
- **Staging Verification**: To test new configurations prior to publishing, package the bundle locally (`npm pack`) and run CLI checkups in clean test directories (`C:\mmdo-smoke`).
|
package/docs/testing.md
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
# MultiModel Dev OS โ Testing Guide (v3.2.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.2.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
|
+
```
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## 6. Maintainer Guidelines
|
|
128
|
+
|
|
129
|
+
For contributors and maintainers modifying the codebase:
|
|
130
|
+
1. **Always edit source modules** located under `src/`. Do NOT make manual edits to `bin/multimodel-dev-os.js` directly, as it will be overwritten during compilation.
|
|
131
|
+
2. **Execute the build script** via `npm run build` after completing modifications to compile the single-file binary.
|
|
132
|
+
3. **Execute Vitest unit tests** (`npm test`) to ensure all core modules pass verification gates in isolation.
|
|
133
|
+
4. **Execute release verification** (`npm run verify`) to run the strict verification pipeline (250+ assertions check compiled binary, folder layouts, sitemaps, etc.).
|
|
@@ -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.
|
package/docs/v3-roadmap.md
CHANGED
|
@@ -7,12 +7,30 @@ This document outlines the development path, completed milestones, and future pl
|
|
|
7
7
|
## 1. Current Status
|
|
8
8
|
|
|
9
9
|
> [!IMPORTANT]
|
|
10
|
-
> **v3.0
|
|
10
|
+
> **v3.2.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.2.0 โ Stable Modular Build + Package Governance โ
|
|
17
|
+
- **Build Freshness Auditing**: Integrated `check-build-fresh.js` to ensure the generated single-file CLI binary matches standard ES modules under `src/` dynamically.
|
|
18
|
+
- **Hardened Package Governance**: Configured the NPM manifest (`package.json`) to include the modular source folder (`src/`) and unit test suites (`tests/unit/`) for developer auditability, while verifying the strict exclusion of sensitive and temporary files.
|
|
19
|
+
- **Cross-Platform CI Pipeline**: Configured a complete multi-platform CI verification matrix on GitHub Actions covering Windows, Linux, and macOS across Node.js versions `20.x` and `22.x`.
|
|
20
|
+
- **Harden Build & Verification Gates**: Applied post-build validations asserting shebang count uniqueness, warning headers, and URL shell-injection safety, while expanding integration audits to 269 assertions.
|
|
21
|
+
|
|
22
|
+
### v3.1.0 โ Modular Source Layout + Formal Unit Tests โ
|
|
23
|
+
- **Modular Source Layout**: Refactored the monolithic CLI structure into isolated, clean modules under `src/` (core, registry, catalog, plugin, cli).
|
|
24
|
+
- **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.
|
|
25
|
+
- **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.
|
|
26
|
+
- **Improved Integration Verification**: Hooked the unit test runner and build step directly into the release audit `npm run verify` verification gate.
|
|
27
|
+
|
|
28
|
+
### v3.0.2 โ Registry Sync Security Hotfix โ
|
|
29
|
+
- **Registry Sync Command Injection Remediation**: Replaced shell-based URL interpolation in fetch helper with safe process arguments passed via `execFileSync`.
|
|
30
|
+
- **Strict URL Validation**: Implemented strict syntax checks using `new URL()` and HTTPS-only transport requirements.
|
|
31
|
+
- **Diagnostics Security**: Hardened URL validations on diagnostics commands (`registry show` and `registry verify`).
|
|
32
|
+
- **HTTP localhost Exception**: Added the `allow_http_localhost` policy flag to optionally support local HTTP development testing.
|
|
33
|
+
|
|
16
34
|
### v3.0.1 โ Registry UX & Policy Safety Patch โ
|
|
17
35
|
- **Registry Command UX**: Improved formatting and next-step actions for `registry status`, `registry list`, `registry show`, `registry verify`, and `registry sync`.
|
|
18
36
|
- **Policy Safety Messaging**: Clarified sandboxing, offline verification capabilities, checksum verification, and approval gates.
|
|
@@ -62,7 +80,7 @@ All releases follow this strict publishing checklist:
|
|
|
62
80
|
|
|
63
81
|
---
|
|
64
82
|
|
|
65
|
-
## 4. Upcoming: v3.
|
|
83
|
+
## 4. Upcoming: v3.3.0 stable candidate โ Asymmetric Key Signatures
|
|
66
84
|
|
|
67
85
|
* **Asymmetric Key Signatures**: Cryptographic signature validation for remote registries using public/private key pairs.
|
|
68
86
|
* **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
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"bin": {
|
|
5
5
|
"multimodel-dev-os": "bin/multimodel-dev-os.js"
|
|
6
6
|
},
|
|
@@ -35,10 +35,15 @@
|
|
|
35
35
|
"!docs/.vitepress/cache/",
|
|
36
36
|
"examples/",
|
|
37
37
|
"bin/",
|
|
38
|
+
"src/",
|
|
39
|
+
"tests/",
|
|
38
40
|
"assets/"
|
|
39
41
|
],
|
|
40
42
|
"scripts": {
|
|
41
|
-
"
|
|
43
|
+
"build": "node scripts/build-cli.js",
|
|
44
|
+
"check:build": "node scripts/check-build-fresh.js",
|
|
45
|
+
"test": "vitest run",
|
|
46
|
+
"verify": "npm run check:build && npm test && node scripts/verify.js",
|
|
42
47
|
"verify:bash": "bash scripts/verify.sh",
|
|
43
48
|
"test:cli": "node bin/multimodel-dev-os.js verify",
|
|
44
49
|
"pack:template": "bash scripts/pack-template.sh",
|
|
@@ -49,6 +54,8 @@
|
|
|
49
54
|
"prepublishOnly": "node scripts/prepublish-guard.js"
|
|
50
55
|
},
|
|
51
56
|
"devDependencies": {
|
|
52
|
-
"
|
|
57
|
+
"esbuild": "^0.20.2",
|
|
58
|
+
"vitepress": "^1.6.4",
|
|
59
|
+
"vitest": "^1.4.0"
|
|
53
60
|
}
|
|
54
61
|
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import esbuild from 'esbuild';
|
|
2
|
+
import { existsSync, chmodSync, readFileSync } from 'fs';
|
|
3
|
+
|
|
4
|
+
const entryPoint = 'src/cli/main.js';
|
|
5
|
+
const outfile = 'bin/multimodel-dev-os.js';
|
|
6
|
+
|
|
7
|
+
if (!existsSync(entryPoint)) {
|
|
8
|
+
console.error(`[ERROR] Entrypoint file not found: ${entryPoint}`);
|
|
9
|
+
process.exit(1);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
esbuild.build({
|
|
13
|
+
entryPoints: [entryPoint],
|
|
14
|
+
bundle: true,
|
|
15
|
+
platform: 'node',
|
|
16
|
+
format: 'esm',
|
|
17
|
+
outfile: outfile,
|
|
18
|
+
banner: {
|
|
19
|
+
js: `#!/usr/bin/env node\n// Generated from src/. Do not edit directly.\n`
|
|
20
|
+
}
|
|
21
|
+
}).then(() => {
|
|
22
|
+
// Post-build validation & hardening
|
|
23
|
+
try {
|
|
24
|
+
const content = readFileSync(outfile, 'utf8');
|
|
25
|
+
|
|
26
|
+
// 1. Check shebang counts
|
|
27
|
+
const shebangMatches = content.match(/^#!/g) || [];
|
|
28
|
+
const totalShebangs = (content.match(/#!/g) || []).length;
|
|
29
|
+
|
|
30
|
+
// We expect exactly one shebang at the very top
|
|
31
|
+
if (totalShebangs !== 1 || !content.startsWith('#!/usr/bin/env node')) {
|
|
32
|
+
console.error('[ERROR] Compiled output has invalid shebang configuration.');
|
|
33
|
+
process.exit(1);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// 2. Check warning header
|
|
37
|
+
if (!content.includes('// Generated from src/. Do not edit directly.')) {
|
|
38
|
+
console.error('[ERROR] Compiled output is missing the generation warning header.');
|
|
39
|
+
process.exit(1);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// 3. Check for unsafe URL interpolation patterns
|
|
43
|
+
if (content.includes("mod.get('${targetUrl}'") || (content.includes('execSync(`node -e "') && content.includes('${targetUrl}'))) {
|
|
44
|
+
console.error('[ERROR] Compiled output contains unsafe registry URL interpolation!');
|
|
45
|
+
process.exit(1);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// 4. Set execution permissions (0755)
|
|
49
|
+
chmodSync(outfile, 0o755);
|
|
50
|
+
|
|
51
|
+
console.log('Build succeeded.');
|
|
52
|
+
} catch (e) {
|
|
53
|
+
console.error('Post-build verification failed:', e.message);
|
|
54
|
+
process.exit(1);
|
|
55
|
+
}
|
|
56
|
+
}).catch((err) => {
|
|
57
|
+
console.error('Build failed:', err);
|
|
58
|
+
process.exit(1);
|
|
59
|
+
});
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import esbuild from 'esbuild';
|
|
2
|
+
import { readFileSync, unlinkSync, existsSync } from 'fs';
|
|
3
|
+
|
|
4
|
+
const entryPoint = 'src/cli/main.js';
|
|
5
|
+
const currentFile = 'bin/multimodel-dev-os.js';
|
|
6
|
+
const tempFile = 'bin/multimodel-dev-os.tmp.js';
|
|
7
|
+
|
|
8
|
+
if (!existsSync(entryPoint)) {
|
|
9
|
+
console.error(`[ERROR] Entrypoint file not found: ${entryPoint}`);
|
|
10
|
+
process.exit(1);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
if (!existsSync(currentFile)) {
|
|
14
|
+
console.error(`[ERROR] Current build file not found: ${currentFile}`);
|
|
15
|
+
console.error('Generated CLI is stale. Run npm run build and commit bin/multimodel-dev-os.js.');
|
|
16
|
+
process.exit(1);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
try {
|
|
20
|
+
await esbuild.build({
|
|
21
|
+
entryPoints: [entryPoint],
|
|
22
|
+
bundle: true,
|
|
23
|
+
platform: 'node',
|
|
24
|
+
format: 'esm',
|
|
25
|
+
outfile: tempFile,
|
|
26
|
+
banner: {
|
|
27
|
+
js: `#!/usr/bin/env node\n// Generated from src/. Do not edit directly.\n`
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
const currentContent = readFileSync(currentFile, 'utf8');
|
|
32
|
+
const tempContent = readFileSync(tempFile, 'utf8');
|
|
33
|
+
|
|
34
|
+
// Clean up temp file immediately
|
|
35
|
+
unlinkSync(tempFile);
|
|
36
|
+
|
|
37
|
+
const normalize = str => str.replace(/\r\n/g, '\n');
|
|
38
|
+
|
|
39
|
+
if (normalize(currentContent) !== normalize(tempContent)) {
|
|
40
|
+
console.error('[ERROR] Generated CLI is stale. Run npm run build and commit bin/multimodel-dev-os.js.');
|
|
41
|
+
process.exit(1);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
console.log('Generated CLI is fresh.');
|
|
45
|
+
process.exit(0);
|
|
46
|
+
} catch (err) {
|
|
47
|
+
console.error('Build freshness check failed:', err);
|
|
48
|
+
if (existsSync(tempFile)) {
|
|
49
|
+
unlinkSync(tempFile);
|
|
50
|
+
}
|
|
51
|
+
process.exit(1);
|
|
52
|
+
}
|
package/scripts/install.ps1
CHANGED
package/scripts/install.sh
CHANGED