multimodel-dev-os 3.1.0 → 3.5.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.
Files changed (102) hide show
  1. package/.ai/policies/registry-policy.yaml +29 -1
  2. package/.ai/registries/trusted-keys.yaml +12 -0
  3. package/.ai/schema/registry-manifest.schema.json +31 -2
  4. package/.ai/schema/registry-policy.schema.json +37 -1
  5. package/.ai/schema/trusted-keys.schema.json +69 -0
  6. package/AGENTS.md +22 -26
  7. package/MEMORY.md +34 -11
  8. package/README.md +2 -1
  9. package/RUNBOOK.md +28 -36
  10. package/TASKS.md +15 -5
  11. package/bin/multimodel-dev-os.js +1366 -548
  12. package/docs/.vitepress/config.js +3 -1
  13. package/docs/architecture.md +3 -1
  14. package/docs/index.md +5 -5
  15. package/docs/npm-publishing.md +5 -5
  16. package/docs/package-safety.md +17 -0
  17. package/docs/public/llms-full.txt +5 -1
  18. package/docs/public/llms.txt +6 -1
  19. package/docs/public/sitemap.xml +15 -0
  20. package/docs/registry-policy.md +29 -1
  21. package/docs/registry-security.md +73 -6
  22. package/docs/registry-signing.md +70 -0
  23. package/docs/registry-sync.md +5 -2
  24. package/docs/registry-trust-store.md +66 -0
  25. package/docs/release-policy.md +6 -5
  26. package/docs/security-threat-model.md +96 -0
  27. package/docs/testing.md +25 -2
  28. package/docs/trusted-registries.md +1 -1
  29. package/docs/v3-roadmap.md +17 -6
  30. package/docs/v3.5.0-readiness.md +46 -0
  31. package/package.json +5 -2
  32. package/scripts/build-cli.js +45 -3
  33. package/scripts/check-build-fresh.js +52 -0
  34. package/scripts/install.ps1 +1 -1
  35. package/scripts/install.sh +1 -1
  36. package/scripts/verify.js +327 -14
  37. package/scripts/verify.sh +10 -0
  38. package/src/catalog/loader.js +117 -0
  39. package/src/cli/args.js +118 -0
  40. package/src/cli/help.js +60 -0
  41. package/src/cli/main.js +6263 -0
  42. package/src/core/globals.js +52 -0
  43. package/src/core/hashes.js +15 -0
  44. package/src/core/policy.js +44 -0
  45. package/src/core/security.js +61 -0
  46. package/src/core/yaml.js +136 -0
  47. package/src/plugin/manifest.js +95 -0
  48. package/src/registry/provenance.js +114 -0
  49. package/src/registry/signing.js +392 -0
  50. package/src/registry/sources.js +40 -0
  51. package/src/registry/trust-store.js +41 -0
  52. package/src/registry/validation.js +45 -0
  53. package/src/registry/verdict.js +51 -0
  54. package/tests/README.md +37 -0
  55. package/tests/fixtures/README.md +22 -0
  56. package/tests/fixtures/custom-template-example/README.md +10 -0
  57. package/tests/fixtures/proposals/approved-append-line.md +28 -0
  58. package/tests/fixtures/proposals/approved-create-file.md +29 -0
  59. package/tests/fixtures/proposals/approved-replace-text.md +30 -0
  60. package/tests/fixtures/proposals/existing-create-file-no-overwrite.md +29 -0
  61. package/tests/fixtures/proposals/no-operations.md +18 -0
  62. package/tests/fixtures/proposals/path-traversal.md +29 -0
  63. package/tests/fixtures/proposals/pending-proposal.md +29 -0
  64. package/tests/fixtures/proposals/protected-path.md +29 -0
  65. package/tests/fixtures/proposals/replace-multiple-without-allow.md +30 -0
  66. package/tests/fixtures/registry-overrides/README.md +20 -0
  67. package/tests/fixtures/signed-registries/README.md +4 -0
  68. package/tests/fixtures/signed-registries/revoked-key/catalog.yaml +8 -0
  69. package/tests/fixtures/signed-registries/revoked-key/expected-verdict.json +7 -0
  70. package/tests/fixtures/signed-registries/revoked-key/registry-manifest.yaml +14 -0
  71. package/tests/fixtures/signed-registries/tampered-manifest/catalog.yaml +8 -0
  72. package/tests/fixtures/signed-registries/tampered-manifest/expected-verdict.json +7 -0
  73. package/tests/fixtures/signed-registries/tampered-manifest/registry-manifest.yaml +14 -0
  74. package/tests/fixtures/signed-registries/trusted-keys.yaml +23 -0
  75. package/tests/fixtures/signed-registries/unsigned-remote-required/catalog.yaml +8 -0
  76. package/tests/fixtures/signed-registries/unsigned-remote-required/expected-verdict.json +7 -0
  77. package/tests/fixtures/signed-registries/unsigned-remote-required/registry-manifest.yaml +9 -0
  78. package/tests/fixtures/signed-registries/unsupported-algorithm/catalog.yaml +8 -0
  79. package/tests/fixtures/signed-registries/unsupported-algorithm/expected-verdict.json +7 -0
  80. package/tests/fixtures/signed-registries/unsupported-algorithm/registry-manifest.yaml +14 -0
  81. package/tests/fixtures/signed-registries/valid-signed-registry/catalog.yaml +8 -0
  82. package/tests/fixtures/signed-registries/valid-signed-registry/expected-verdict.json +7 -0
  83. package/tests/fixtures/signed-registries/valid-signed-registry/registry-manifest.yaml +14 -0
  84. package/tests/fixtures/signed-registries/wrong-key/catalog.yaml +8 -0
  85. package/tests/fixtures/signed-registries/wrong-key/expected-verdict.json +7 -0
  86. package/tests/fixtures/signed-registries/wrong-key/registry-manifest.yaml +14 -0
  87. package/tests/smoke/README.md +37 -0
  88. package/tests/smoke/cli-smoke.md +49 -0
  89. package/tests/unit/build-output.test.js +40 -0
  90. package/tests/unit/catalog-loader.test.js +44 -0
  91. package/tests/unit/path-safety.test.js +62 -0
  92. package/tests/unit/plugin-manifest.test.js +94 -0
  93. package/tests/unit/prepublish-guard.test.js +35 -0
  94. package/tests/unit/registry-e2e-signature-fixtures.test.js +288 -0
  95. package/tests/unit/registry-policy.test.js +52 -0
  96. package/tests/unit/registry-provenance.test.js +185 -0
  97. package/tests/unit/registry-public-signing.test.js +109 -0
  98. package/tests/unit/registry-signature-policy.test.js +100 -0
  99. package/tests/unit/registry-signing.test.js +193 -0
  100. package/tests/unit/registry-trust-store.test.js +133 -0
  101. package/tests/unit/registry-url-validation.test.js +64 -0
  102. package/tests/unit/yaml.test.js +92 -0
@@ -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.1.0',
35
+ 'softwareVersion': '3.5.0',
36
36
  'description': 'Portable, vendor-neutral AI Developer OS for multi-agent coding workflows.'
37
37
  })
38
38
  ]
@@ -184,6 +184,7 @@ export default {
184
184
  { text: 'Trusted Registries', link: '/trusted-registries' },
185
185
  { text: 'Registry Policy Engine', link: '/registry-policy' },
186
186
  { text: 'Registry Security Model', link: '/registry-security' },
187
+ { text: 'Registry Security Threat Model', link: '/security-threat-model' },
187
188
  { text: 'Remote Catalog Authoring', link: '/remote-catalog-authoring' }
188
189
  ]
189
190
  },
@@ -197,6 +198,7 @@ export default {
197
198
  { text: 'Launch & Sharing Kit', link: '/launch-kit' },
198
199
  { text: 'CLI Roadmap', link: '/cli-roadmap' },
199
200
  { text: 'v3 Roadmap', link: '/v3-roadmap' },
201
+ { text: 'v3.5.0 Release Readiness', link: '/v3.5.0-readiness' },
200
202
  { text: 'Release Policy', link: '/release-policy' },
201
203
  { text: 'Support Policy', link: '/support-policy' },
202
204
  { text: 'Pre-flight Release Testing', link: '/testing' },
@@ -38,7 +38,8 @@
38
38
  │ Layer 4: Intelligence Layer │
39
39
  │ .ai/intelligence/ (memory, handoff)│
40
40
  │ .ai/registries/ (workflows, │
41
- │ capabilities, tools, sources)
41
+ │ capabilities, tools, sources,
42
+ │ trusted-keys) │
42
43
  │ .ai/registry-cache/ (cached remote) │
43
44
  │ .ai/proposals/ (improvements) │
44
45
  │ .ai/policies/ (safety, registry│
@@ -49,6 +50,7 @@
49
50
  │ plugin list/show/validate/install │
50
51
  │ catalog list/show/recommend/install │
51
52
  │ registry list/add/sync/status/verify│
53
+ │ /keygen/lock/trust │
52
54
  │ onboard / adapter sync │
53
55
  └──────────────────────────────────────┘
54
56
  ```
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 v2.7
217
+ ### 🆕 What's New in v3.5
218
218
 
219
- - 🎬 **Demo Workflow Pages** — 5 copy-paste guided workflows for onboarding, adapter sync, improvement loops, handoffs, and release checks
220
- - 📖 **Distribution Guide** — comprehensive release, verification, and package hygiene documentation
221
- - 🖼️ **Visual Flow Diagrams** — SVG assets for onboarding and adapter sync flows
222
- - 📁 **Docs-First Examples** — 4 new example workflows with commands and expected output
219
+ - 🛡️ **Trusted Registry Signatures** — Asymmetric Ed25519 signatures verify remote publisher identity, preventing man-in-the-middle manifest modifications.
220
+ - 🔑 **Trusted Key Store** — Local keys configuration at `.ai/registries/trusted-keys.yaml` manages active publisher public keys, statuses, and scope permissions.
221
+ - 📝 **Registry Provenance Lockfile** — Records synced catalog/manifest SHA-256 hashes, sync times, and verdicts to detect post-sync local tampering.
222
+ - 📊 **Structured Verdicts** — Generates machine-readable trust verdicts covering registry manifests, catalogs, keys, and signatures for auditability.
223
223
 
224
224
  </div>
225
225
 
@@ -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.2.tgz` in your directory root.
15
+ This creates a file named like `multimodel-dev-os-3.5.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.2.tgz
21
+ tar -xzf /path/to/multimodel-dev-os-3.5.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.2 is the active stable release.** NPM publishing is live.
81
+ > **v3.5.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.2` codebase.
84
+ * **GitHub main branch (Source)**: Contains the current stable `v3.5.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.2).
91
+ 1. Ensure the version in `package.json` is a valid stable major version >= 2 (e.g., v3.5.0).
92
92
  2. Run publication with the override env variable:
93
93
  ```powershell
94
94
  # PowerShell
@@ -9,6 +9,7 @@ To prevent security compromises, credential exposure, or prompt bloating, the fo
9
9
  1. **Local Credentials & API Keys:**
10
10
  * `.npmrc` (specifically containing authentication tokens)
11
11
  * `.env` / `.env.local`
12
+ * `.ai/registry-signing-key` (project-scoped HMAC signing key)
12
13
  2. **Build and Cache Artifacts:**
13
14
  * `node_modules/`
14
15
  * `dist/` / `build/`
@@ -35,3 +36,19 @@ A security hotfix has been applied in `v3.0.2` to secure the registry synchroniz
35
36
  * **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
37
  * **Upgrade Guidance:** Users running `v3.0.0` or `v3.0.1` must upgrade to `v3.0.2` immediately.
37
38
  * **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.
39
+
40
+ ## Package Governance Policies
41
+
42
+ 1. **Zero Runtime Dependencies:**
43
+ * The runtime package is strictly zero-dependency to ensure minimal installation footprint and maximum security.
44
+ * All compilation, testing, and dev tools (e.g., `esbuild`, `vitest`, `vitepress`) are restricted to `devDependencies` only.
45
+
46
+ 2. **Open-Source Transparency:**
47
+ * 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.
48
+
49
+ 3. **Manual NPM Publishing Only:**
50
+ * Automated publishing via CI is disabled. NPM publish is performed manually by maintainers using verification guards.
51
+
52
+ 4. **Milestone-Based Releases:**
53
+ * Patch-level releases are kept internal by default for stabilization sprints (such as `v3.5.0-prep`).
54
+ * Public updates are batched into stable, fully-audited milestone releases (e.g., `v3.5.0`). Critical security hotfixes are the only exception.
@@ -1,4 +1,4 @@
1
- # MultiModel Dev OS — Comprehensive AI Assistant Discoverability Guide (v3.1.0 Stable Release)
1
+ # MultiModel Dev OS — Comprehensive AI Assistant Discoverability Guide (v3.5.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
 
@@ -97,6 +97,8 @@ All compliant MultiModel Dev OS CLIs strictly enforce the following command cont
97
97
  - `verify <name>`: Verifies SHA256 checksums of cached files against `checksums.json`.
98
98
  - `show <name>`: Shows detailed metadata and policies of a specific registry source.
99
99
  - `cache clear`: Deletes all files in `.ai/registry-cache/` (requires `--approved`).
100
+ - `trust list`: Lists trusted publisher keys.
101
+ - `trust show <key_id>`: Shows details of a specific trusted key.
100
102
  - **`verify`**: Automated release script that checks structure integrity.
101
103
  - **`templates`**: Lists built-in template profiles (supports overrides via `--registry <path>`).
102
104
  - **`validate`**: Strict Quality Gate checking the layout rules on disk (supports `--all-registries`).
@@ -140,3 +142,5 @@ npx multimodel-dev-os@latest init --caveman
140
142
  - **Release Policies**: https://rizvee.github.io/multimodel-dev-os/release-policy
141
143
  - **Upgrade Playbook**: https://rizvee.github.io/multimodel-dev-os/migration-guide
142
144
  - **Model Compatibility**: https://rizvee.github.io/multimodel-dev-os/model-compatibility
145
+ - **Security Threat Model**: https://rizvee.github.io/multimodel-dev-os/security-threat-model
146
+ - **v3.5.0 Release Readiness**: https://rizvee.github.io/multimodel-dev-os/v3.5.0-readiness
@@ -1,4 +1,4 @@
1
- # MultiModel Dev OS (v3.1.0 Stable Release)
1
+ # MultiModel Dev OS (v3.5.0 Stable Release)
2
2
 
3
3
  Portable, vendor-neutral workspace configuration standard for multi-agent AI pair-programming workflows.
4
4
 
@@ -33,6 +33,8 @@ npx multimodel-dev-os@latest registry show bundled
33
33
  npx multimodel-dev-os@latest registry add official https://example.com/catalog.yaml --approved
34
34
  npx multimodel-dev-os@latest registry sync official --approved
35
35
  npx multimodel-dev-os@latest registry cache clear --approved
36
+ npx multimodel-dev-os@latest registry trust list
37
+ npx multimodel-dev-os@latest registry trust show <key_id>
36
38
 
37
39
  # Scan codebase signals & check status
38
40
  npx multimodel-dev-os@latest scan
@@ -57,6 +59,7 @@ npx multimodel-dev-os@latest memory refresh
57
59
  # Run automated workflow cycles
58
60
  npx multimodel-dev-os@latest workflow run repo-health
59
61
  npx multimodel-dev-os@latest workflow list
62
+ npx multimodel-dev-os@latest workflow show repo-health
60
63
 
61
64
  # Compile session handoff spec
62
65
  npx multimodel-dev-os@latest handoff build
@@ -94,6 +97,8 @@ npx multimodel-dev-os@latest improve log
94
97
  - **Guided Demo Workflows**: https://rizvee.github.io/multimodel-dev-os/demos/
95
98
  - **Stable Protocol Specification**: https://rizvee.github.io/multimodel-dev-os/stable-protocol
96
99
  - **Model Compatibility & Routing Guide**: https://rizvee.github.io/multimodel-dev-os/model-compatibility
100
+ - **Security Threat Model**: https://rizvee.github.io/multimodel-dev-os/security-threat-model
101
+ - **v3.5.0 Release Readiness**: https://rizvee.github.io/multimodel-dev-os/v3.5.0-readiness
97
102
  - **Cost/Context Optimization Playbook**: https://rizvee.github.io/multimodel-dev-os/cost-optimization
98
103
 
99
104
  ## Standard Templates
@@ -250,4 +250,19 @@
250
250
  <changefreq>weekly</changefreq>
251
251
  <priority>0.7</priority>
252
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>
258
+ <url>
259
+ <loc>https://rizvee.github.io/multimodel-dev-os/security-threat-model</loc>
260
+ <changefreq>weekly</changefreq>
261
+ <priority>0.7</priority>
262
+ </url>
263
+ <url>
264
+ <loc>https://rizvee.github.io/multimodel-dev-os/v3.5.0-readiness</loc>
265
+ <changefreq>weekly</changefreq>
266
+ <priority>0.7</priority>
267
+ </url>
253
268
  </urlset>
@@ -29,7 +29,35 @@ Here is a list of all fields supported in `.ai/policies/registry-policy.yaml`:
29
29
 
30
30
  ### `require_signature` (Boolean)
31
31
  * **Default:** `false`
32
- * **Description:** Reserved for future cryptographic signature validation.
32
+ * **Description:** Requires cryptographic signature verification (HMAC-SHA256 or Ed25519) of registry manifests when syncing or verifying.
33
+
34
+ ### `allow_unsigned_local` (Boolean)
35
+ * **Default:** `true`
36
+ * **Description:** Allows unsigned local registries.
37
+
38
+ ### `allow_unsigned_bundled` (Boolean)
39
+ * **Default:** `true`
40
+ * **Description:** Allows unsigned bundled registries.
41
+
42
+ ### `allow_unsigned_remote` (Boolean)
43
+ * **Default:** `false`
44
+ * **Description:** Controls whether unsigned remote registries are permitted.
45
+
46
+ ### `trusted_keys_file` (String)
47
+ * **Default:** `".ai/registries/trusted-keys.yaml"`
48
+ * **Description:** Path to the trusted publisher key store file.
49
+
50
+ ### `allowed_signature_algorithms` (Array of Strings)
51
+ * **Default:** `['ed25519', 'hmac-sha256']`
52
+ * **Description:** List of cryptographic signature algorithms permitted for verification.
53
+
54
+ ### `require_trusted_publisher` (Boolean)
55
+ * **Default:** `false`
56
+ * **Description:** Requires that registry signatures come from a publisher registered in the trust store.
57
+
58
+ ### `provenance_required` (Boolean)
59
+ * **Default:** `true`
60
+ * **Description:** Requires local provenance verification via lockfile entries.
33
61
 
34
62
  ### `allow_untrusted_install` (Boolean)
35
63
  * **Default:** `false`
@@ -8,12 +8,7 @@ This document describes the threat model, safety boundaries, and mitigation stra
8
8
 
9
9
  ## Threat Model & Mitigations
10
10
 
11
- ```
12
- Threat: Malicious Remote Registry
13
- |--> Arbitrary Code Execution (Mitigated: Declarative-only YAML)
14
- |--> Path Traversal / Overwrite (Mitigated: Resolve path bounds + Blacklist)
15
- |--> Dependency Poisoning (Mitigated: No automated package installation)
16
- ```
11
+ For a comprehensive analysis of threat vectors (including transport compromise, command injection, path traversal, and malicious manifests) along with their corresponding architectural mitigations, please refer to the [Registry Security Threat Model](file:///F:/multimodel-dev-os/docs/security-threat-model.md).
17
12
 
18
13
  ### 1. Arbitrary Code Execution
19
14
  * **Threat:** A remote registry delivers a plugin containing malicious scripts (`shell`, `javascript`, etc.) that execute on the developer's machine.
@@ -72,3 +67,75 @@ For teams deploying MultiModel Dev OS in sensitive environments, we recommend:
72
67
  1. Keeping `allow_remote_registries: false` (the default) if no third-party plugins are needed.
73
68
  2. If remote plugins are required, set `allow_untrusted_install: false` to only permit plugins from official, signed corporate registries.
74
69
  3. Commit `.ai/policies/registry-policy.yaml` to version control to enforce uniform governance across all developer machines.
70
+
71
+ ---
72
+
73
+ ## Trusted Registry Signing & Provenance (v3.5.0-prep)
74
+
75
+ MultiModel Dev OS supports optional **HMAC-SHA256 signing** of synced registry catalogs, providing tamper-evident provenance records.
76
+
77
+ ### How it works
78
+
79
+ 1. **Key generation** — Generate a project-scoped signing key (32 random bytes):
80
+ ```sh
81
+ npx multimodel-dev-os registry keygen --approved
82
+ ```
83
+ This writes a 64-char hex key to `.ai/registry-signing-key` with `0o600` permissions. **Add this file to `.gitignore`** — it should never be committed.
84
+
85
+ 2. **Sync with signing** — When you sync a remote registry, the CLI:
86
+ - Downloads `catalog.yaml` and verifies its SHA-256 checksum
87
+ - Computes `HMAC-SHA256(key, catalog_sha256)` → `signature`
88
+ - Writes a lockfile entry to `.ai/registry-lock.json`:
89
+ ```json
90
+ {
91
+ "url": "https://...",
92
+ "synced_at": "<ISO timestamp>",
93
+ "catalog_sha256": "<hex>",
94
+ "manifest_sha256": "<hex or null>",
95
+ "signature": "<hmac-sha256 hex>",
96
+ "signature_alg": "hmac-sha256"
97
+ }
98
+ ```
99
+
100
+ 3. **Verification** — `registry verify <name>` performs three checks:
101
+ - SHA-256 file integrity (existing behavior)
102
+ - Lockfile hash match — re-hashes cached `catalog.yaml` and compares against the lockfile entry
103
+ - HMAC signature verification — if a signing key and stored signature are present, verifies using `timingSafeEqual` (timing-attack safe)
104
+
105
+ 4. **Lockfile inspection** — `registry lock` shows the current lockfile state and per-registry signature status.
106
+
107
+ ### Signing Algorithm Details
108
+
109
+ | Property | Value |
110
+ |---|---|
111
+ | Algorithm | HMAC-SHA256 |
112
+ | Key material | 32 random bytes via `crypto.randomBytes` |
113
+ | Signed payload | `catalog_sha256` (hex string) |
114
+ | Comparison | `crypto.timingSafeEqual` |
115
+ | Storage | `.ai/registry-signing-key` (mode 0o600) |
116
+ | Lockfile | `.ai/registry-lock.json` (committed to VCS) |
117
+ | Runtime deps | None — Node.js `crypto` built-in only |
118
+
119
+ ### Policy Controls
120
+
121
+ The following fields in `.ai/policies/registry-policy.yaml` control signing and trust enforcement:
122
+
123
+ | Field | Default | Effect |
124
+ |---|---|---|
125
+ | `require_signature` | `false` | When `true`, verify/sync fails if the manifest is unsigned or has an invalid signature. |
126
+ | `require_lockfile_on_verify` | `false` | When `true`, verify fails if no lockfile entry exists for the registry. |
127
+ | `allow_unsigned_local` | `true` | Permits unsigned local registries. |
128
+ | `allow_unsigned_bundled` | `true` | Permits unsigned bundled registries. |
129
+ | `allow_unsigned_remote` | `false` | Restricts unsigned remote registries (enforces signatures). |
130
+ | `require_trusted_publisher` | `false` | Fails verification if signature key_id is not in the trust store. |
131
+ | `allowed_signature_algorithms` | `['ed25519', 'hmac-sha256']` | Restricts allowed cryptographic signature algorithms. |
132
+ | `trusted_keys_file` | `".ai/registries/trusted-keys.yaml"` | Configured location of the trusted key store. |
133
+
134
+ ### Security Notes
135
+
136
+ - **HMAC Keys** are project-scoped and local. They are stored in `.ai/registry-signing-key` and must never be committed (automatically gitignored).
137
+ - **Ed25519 Public Keys** are registered in `.ai/registries/trusted-keys.yaml` to authorize public publishers.
138
+ - The **lockfile** (`.ai/registry-lock.json`) should be committed to VCS to provide verifiable tamper-evidence for the team.
139
+ - **HTTPS transport security** secures the delivery, but **signatures and trust store** secure publisher identity, protecting against server-side compromises.
140
+ - **Zero-Dependency Cryptography**: All operations rely strictly on Node's built-in `crypto` library.
141
+
@@ -0,0 +1,70 @@
1
+ # Registry Signature Verification
2
+
3
+ MultiModel Dev OS employs cryptographic signatures to verify the authenticity and integrity of remote catalog registries. This document describes the signature formats, payload canonicalization, and verification mechanisms.
4
+
5
+ ---
6
+
7
+ ## Architecture Overview
8
+
9
+ There are two primary modes of cryptographic integrity and identity checks:
10
+
11
+ 1. **Local/Internal Integrity Mode (HMAC-SHA256)**:
12
+ - Used for team or project-level locking.
13
+ - Signs the catalog checksum with a project-scoped key stored locally at `.ai/registry-signing-key`.
14
+ - Verified offline against `.ai/registry-lock.json` when running `registry verify`.
15
+
16
+ 2. **Public Publisher Trust Mode (Ed25519)**:
17
+ - Used to verify public registry catalogs using asymmetric public-key cryptography.
18
+ - The publisher signs the manifest using their Ed25519 private key.
19
+ - MultiModel Dev OS verifies the signature block against the public keys stored in the trusted key store (`.ai/registries/trusted-keys.yaml`).
20
+
21
+ ---
22
+
23
+ ## Canonical Payload Design
24
+
25
+ To prevent key insertion order differences from altering signature checks, MultiModel Dev OS constructs a **stable canonical payload** before signing or verifying.
26
+
27
+ ### Canonicalization Algorithm:
28
+ 1. Sort the fields specified in `signed_fields` alphabetically.
29
+ 2. Extract these fields from the manifest object.
30
+ 3. Sort any nested object keys alphabetically recursively.
31
+ 4. Serialize the object to a standard minified JSON string (no spaces).
32
+
33
+ Example code:
34
+ ```javascript
35
+ import { createCanonicalPayload } from './src/registry/signing.js';
36
+
37
+ const manifest = {
38
+ registry_name: "official",
39
+ version: "1.0.0",
40
+ catalog_hash: "sha256:abcd..."
41
+ };
42
+
43
+ const payload = createCanonicalPayload(manifest, ['registry_name', 'version', 'catalog_hash']);
44
+ // Output: '{"catalog_hash":"sha256:abcd...","registry_name":"official","version":"1.0.0"}'
45
+ ```
46
+
47
+ ---
48
+
49
+ ## Key Management
50
+
51
+ ### Project-Scoped HMAC Keys
52
+ To generate a local HMAC key for signing your synced catalog files:
53
+ ```bash
54
+ node bin/multimodel-dev-os.js registry keygen --approved
55
+ ```
56
+ This generates a random 32-byte key (64 hex characters) and saves it to `.ai/registry-signing-key` with `0o600` permissions. Ensure this file is gitignored.
57
+
58
+ ### Ed25519 Publisher Keys
59
+ For public registries, the publisher generates an Ed25519 keypair. The public key is published in the trust store, while the private key is kept strictly confidential and offline.
60
+ To verify signatures, the corresponding public key must be registered in `.ai/registries/trusted-keys.yaml`.
61
+
62
+ ---
63
+
64
+ ## Verification & Trust Readiness
65
+
66
+ As of the current internal development sprint, the registry signature verification pipeline is fully tested end-to-end using dedicated offline E2E fixtures:
67
+ - **Valid signatures** pass verification.
68
+ - **Tampered manifests, wrong keys, and revoked keys** are blocked, reporting precise errors and warning verdicts recorded inside the local provenance lockfile (`registry-lock.json`).
69
+
70
+ For current status and verification audits, see the [v3.5.0 Release Readiness Checklist](file:///F:/multimodel-dev-os/docs/v3.5.0-readiness.md).
@@ -23,11 +23,14 @@ The `registry` command suite provides the following operations:
23
23
  | `registry list` | Read-only | List all configured registry sources |
24
24
  | `registry status` | Read-only | View sync status, timestamps, and cache health |
25
25
  | `registry show <name>` | Read-only | View configuration details of a specific source |
26
- | `registry verify <name>` | Read-only | Audit SHA256 checksums of cached registry files |
26
+ | `registry verify <name>` | Read-only | Audit SHA256 checksums, lockfile hash, and signatures |
27
27
  | `registry add <name> <url> --approved` | Write | Add a new remote registry source |
28
- | `registry sync <name> --approved` | Network + Write | Download and cache remote catalog and manifest |
28
+ | `registry sync <name> --approved` | Network + Write | Download and cache remote catalog, manifest, and verify signature |
29
29
  | `registry remove <name> --approved` | Write | Remove a registry source and clear its cache |
30
30
  | `registry cache clear --approved` | Write | Clear all cached registry files |
31
+ | `registry keygen --approved` | Write | Generate local project-scoped HMAC key |
32
+ | `registry lock` | Read-only | Inspect registry provenance lockfile |
33
+ | `registry trust <subcmd>` | Read/Write | Inspect or verify trusted publisher store (subcmd: list, show, verify) |
31
34
 
32
35
  ---
33
36
 
@@ -0,0 +1,66 @@
1
+ # Trusted Key Store
2
+
3
+ MultiModel Dev OS uses a trusted key store to authorize public publishers of remote catalog indexes.
4
+
5
+ ---
6
+
7
+ ## Configuration Path
8
+
9
+ The trusted keys are stored in a YAML file at the path defined by the `trusted_keys_file` policy setting (default: `.ai/registries/trusted-keys.yaml`).
10
+
11
+ ---
12
+
13
+ ## File Format
14
+
15
+ Each key record in `.ai/registries/trusted-keys.yaml` consists of:
16
+
17
+ - `key_id`: A unique string identifier for the key.
18
+ - `name`: Human-readable name of the key owner.
19
+ - `algorithm`: The cryptographic algorithm (e.g. `ed25519`).
20
+ - `public_key`: SPKI public key PEM block or raw key string.
21
+ - `scopes`: Allowed operations for the key (e.g. `registry`, `catalog`).
22
+ - `status`: Key status (`active`, `disabled`, or `revoked`).
23
+
24
+ ### Example Configuration:
25
+ ```yaml
26
+ trusted_publishers:
27
+ - key_id: official-maintainer-key
28
+ name: "MultiModel Dev OS Core Team"
29
+ algorithm: ed25519
30
+ public_key: |
31
+ -----BEGIN PUBLIC KEY-----
32
+ MCowBQYDK2VwAyEA9vWwyE5+fY0dvEzl9S1UcvtoMkOAIDhDCzZAkP+CVNo=
33
+ -----END PUBLIC KEY-----
34
+ scopes:
35
+ - registry
36
+ - catalog
37
+ status: active
38
+ ```
39
+
40
+ ---
41
+
42
+ ## Policy Integration
43
+
44
+ The policy configuration in `.ai/policies/registry-policy.yaml` controls how keys in the trust store are enforced:
45
+
46
+ - `require_trusted_publisher`: If set to `true`, verification will fail if a signature uses a `key_id` not found in the trust store.
47
+ - `allowed_signature_algorithms`: Restricts the algorithms allowed for verification (e.g. only `ed25519`).
48
+
49
+ ---
50
+
51
+ ## Command Line Interface
52
+
53
+ You can manage and inspect the trust store using the `registry trust` subcommands:
54
+
55
+ - **List trusted keys**:
56
+ ```bash
57
+ node bin/multimodel-dev-os.js registry trust list
58
+ ```
59
+ - **Show key details**:
60
+ ```bash
61
+ node bin/multimodel-dev-os.js registry trust show <key_id>
62
+ ```
63
+ - **Verify key formats**:
64
+ ```bash
65
+ node bin/multimodel-dev-os.js registry trust verify
66
+ ```
@@ -34,9 +34,10 @@ No package shall be merged or released without:
34
34
 
35
35
  ---
36
36
 
37
- ## 4. Release Channel & Staging Controls
37
+ ## 4. Release Strategy & Staging Controls
38
38
 
39
- MultiModel Dev OS releases new versions directly to the public NPM registry:
40
- * **Stable Releases (`npx multimodel-dev-os`)**: Published to the public registry under semantic version categories (e.g. `2.0.0`, `2.0.1`).
41
- * **Release Candidates**: Built and validated locally via the automated verification script (`scripts/verify.js`) before tags or packaging runs.
42
- * **Staging Verification**: To test new configurations prior to publishing, package the bundle locally (`npm pack`) and run CLI checkups in clean test directories.
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.5.0`, `v3.6.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`).
@@ -0,0 +1,96 @@
1
+ # Registry Security Threat Model
2
+
3
+ This document outlines the security architecture, threat model using the STRIDE framework, mitigation strategies, and design limitations of the registry and catalog trust systems in MultiModel Dev OS (MMDO).
4
+
5
+ ---
6
+
7
+ ## 1. Threat Scenarios & Mitigations
8
+
9
+ ### Threat: Attacker Modifies Remote Registry Manifest
10
+ - **Description**: An attacker compromises the remote host or storage bucket containing the registry manifest file (`manifest.json`) and attempts to alter its contents.
11
+ - **Mitigation**:
12
+ - Every sync operation retrieves the manifest.
13
+ - The client verifies the manifest's cryptographic signature against the local trust store ([`trusted-keys.yaml`](file:///.ai/registries/trusted-keys.yaml)).
14
+ - If the manifest's contents are modified by an attacker, the signature verification check fails, halting verification and refusing cache sync.
15
+
16
+ ### Threat: Attacker Modifies Catalog Contents
17
+ - **Description**: An attacker alters the `catalog.yaml` index to point to malicious plugins or scripts, while leaving the manifest file unchanged.
18
+ - **Mitigation**:
19
+ - The `manifest.json` contains a SHA-256 integrity hash of `catalog.yaml` (`catalog_hash`).
20
+ - The client calculates the local SHA-256 hash of the downloaded `catalog.yaml` and asserts it matches the manifest's `catalog_hash`. Any discrepancy halts synchronization.
21
+
22
+ ### Threat: Attacker Compromises Transport (Man-in-the-Middle)
23
+ - **Description**: An attacker intercepts the network connection to spoof registry manifests or download files.
24
+ - **Mitigation**:
25
+ - Registry URLs are strictly validated to require secure HTTPS connections. HTTP is rejected by default.
26
+ - Transport integrity is backed by public-key Ed25519 signatures. Even if transport-level security is compromised, the client asserts the signature matches a trusted key.
27
+
28
+ ### Threat: Attacker Submits Malicious Plugin Metadata
29
+ - **Description**: An attacker registers a plugin with malicious parameters, such as directory paths designed to cause directory traversal, or shell scripts designed to run command injection.
30
+ - **Mitigation**:
31
+ - Strict path safety validation is performed on plugin installation paths to prevent path traversal outside permitted `.ai/` and `adapters/` directories.
32
+ - Slugs are validated against strict alphanumeric patterns (`/^[a-z0-9-_]+$/i`).
33
+ - Catalog synchronization is cache-only and non-executing. Synchronizing remote registries does not run any code or auto-install plugins.
34
+
35
+ ### Threat: Path Traversal
36
+ - **Description**: An attacker crafts registry source configurations or manifest files using relative directory sequences (e.g. `../../etc/passwd`) to read or write sensitive files.
37
+ - **Mitigation**:
38
+ - All file path resolutions are strictly bounded and verified using canonical paths (`path.resolve`). Access outside the approved workspace directory is rejected.
39
+
40
+ ### Threat: Command Injection via Registry URLs
41
+ - **Description**: An attacker specifies registry URLs containing shell metacharacters (e.g., quotes, backticks, semicolons) hoping to execute shell commands during sync or fetch operations.
42
+ - **Mitigation**:
43
+ - The fetch helper utilizes `execFileSync` instead of shell-based `execSync`, ensuring URL values are treated strictly as literal command arguments.
44
+ - Strict validation rejects URLs containing whitespace or shell command syntax.
45
+
46
+ ### Threat: Stale/Replay Registry Data
47
+ - **Description**: An attacker serves a valid, signed registry manifest from the past (e.g. version 1.0.0 containing an older, vulnerable plugin) to roll back updates.
48
+ - **Mitigation**:
49
+ - The local lockfile ([`registry-lock.json`](file:///.ai/registry-lock.json)) records the last synchronized manifest hash, version, and sync timestamp.
50
+ - Replays or attempts to downgrade manifest versions can be detected via local history comparison.
51
+
52
+ ### Threat: Unknown/Revoked Signing Keys
53
+ - **Description**: An attacker signs a malicious manifest using an expired, disabled, revoked, or unconfigured signing key.
54
+ - **Mitigation**:
55
+ - Key IDs are verified against active trust store records. If a key is marked `revoked` or `disabled`, verification immediately fails.
56
+ - Keys lacking the specific `scopes: ["registry"]` or `scopes: ["catalog"]` attribute are rejected.
57
+
58
+ ### Threat: Local Cache Tampering
59
+ - **Description**: An attacker with local access modifies the cache files in `.ai/registry-cache/` to bypass remote verification.
60
+ - **Mitigation**:
61
+ - Every `registry verify` run calculates the SHA-256 hashes of all cached files and compares them against the tamper-evident local provenance lockfile (`registry-lock.json`), which is committed to VCS.
62
+
63
+ ---
64
+
65
+ ## 2. Trust Model Layers
66
+
67
+ MultiModel Dev OS enforces a multi-layer defense-in-depth model:
68
+
69
+ ```mermaid
70
+ graph TD
71
+ A[1. URL Validation] --> B[2. Cache-Only Sync]
72
+ B --> C[3. Catalog Hash Verification]
73
+ C --> D[4. Lockfile Comparison]
74
+ D --> E[5. Provenance Report]
75
+ E --> F[6. Public-Key Signature Verification]
76
+ F --> G[7. Trusted Key Store]
77
+ G --> H[8. Manual Approval Gates]
78
+ ```
79
+
80
+ 1. **URL Validation**: Rejects non-HTTPS, command-injection characters, or malformed URLs.
81
+ 2. **Cache-Only Sync**: Downloads files strictly to offline cache folders. No script execution occurs.
82
+ 3. **Catalog Hash Verification**: Asserts SHA-256 integrity matches between files and manifest list.
83
+ 4. **Lockfile Comparison**: Checks current downloaded hashes against committed VCS registry lockfile.
84
+ 5. **Provenance Report**: Computes local and signature status to output detailed trust verdicts.
85
+ 6. **Public-Key Signature Verification**: Verifies cryptographic signatures using Ed25519.
86
+ 7. **Trusted Key Store**: Verifies that the signing key is configured, active, and scoped.
87
+ 8. **Manual Approval Gates**: Plugin installation requires explicit `--approved` confirmation from the operator.
88
+
89
+ ---
90
+
91
+ ## 3. Limits & Constraints
92
+
93
+ - **Local HMAC Mode Limitations**: HMAC signature mode provides project-scoped integrity verification (proving a registry was synced by a project member with the key). It does *not* prove remote publisher identity to the public.
94
+ - **Asymmetric Signature Boundaries**: Ed25519 signatures verify publisher identity only if the user's local trust store is correct. If the trust store itself is compromised or loaded with untrusted public keys, signatures cannot prevent spoofing.
95
+ - **HTTPS Limitations**: HTTPS secures transit integrity against network-level eavesdroppers. It does not establish publisher identity or code quality.
96
+ - **Operator Overrides**: No security model can protect users who manually execute command overrides (`--approved` or `--force`) without inspecting the manifest and plugins being installed.