enigma-memory 0.1.18 → 0.1.22

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 (276) hide show
  1. package/README.md +76 -24
  2. package/apps/cli/bin/enigma-desktop.mjs +140 -0
  3. package/apps/cli/bin/enigma-terminal.mjs +78 -0
  4. package/apps/cli/bin/enigma.mjs +1923 -285
  5. package/apps/desktop/electron-main.cjs +217 -0
  6. package/apps/desktop/package.json +12 -0
  7. package/apps/desktop/src/app.js +264 -7
  8. package/apps/desktop/src/index.html +3514 -1373
  9. package/apps/desktop/src/launch-electron.mjs +51 -0
  10. package/apps/desktop/src/server.mjs +2914 -0
  11. package/apps/desktop/src/styles.css +2972 -260
  12. package/apps/desktop/src/zk-browser-prove.mjs +53 -0
  13. package/apps/desktop/src/zk-state.mjs +1789 -0
  14. package/apps/gateway/bin/enigma-gateway.mjs +102 -5
  15. package/apps/gateway/src/server.mjs +271 -8
  16. package/apps/ios/EnigmaCore/Package.swift +12 -0
  17. package/apps/ios/EnigmaCore/Sources/EnigmaCore/EnigmaAPIClient.swift +227 -0
  18. package/apps/ios/EnigmaCore/Sources/EnigmaCore/Models.swift +278 -0
  19. package/apps/ios/EnigmaCore/Sources/EnigmaCore/PKCE.swift +96 -0
  20. package/apps/ios/EnigmaCore/Sources/EnigmaCore/PrivacyMinimizer.swift +187 -0
  21. package/apps/ios/EnigmaCore/Sources/EnigmaCore/ToolModels.swift +129 -0
  22. package/apps/ios/EnigmaCore/Tests/EnigmaCoreTests/EnigmaCoreTests.swift +42 -0
  23. package/apps/ios/EnigmaIOS/Enigma/AppModel.swift +346 -0
  24. package/apps/ios/EnigmaIOS/Enigma/Assets.xcassets/AccentColor.colorset/Contents.json +12 -0
  25. package/apps/ios/EnigmaIOS/Enigma/Assets.xcassets/AppIcon.appiconset/Contents.json +11 -0
  26. package/apps/ios/EnigmaIOS/Enigma/Assets.xcassets/AppIcon.appiconset/EnigmaAppIcon.png +0 -0
  27. package/apps/ios/EnigmaIOS/Enigma/Assets.xcassets/Contents.json +3 -0
  28. package/apps/ios/EnigmaIOS/Enigma/Assets.xcassets/LaunchBackground.colorset/Contents.json +12 -0
  29. package/apps/ios/EnigmaIOS/Enigma/ChatView.swift +181 -0
  30. package/apps/ios/EnigmaIOS/Enigma/CouncilView.swift +78 -0
  31. package/apps/ios/EnigmaIOS/Enigma/CreateView.swift +152 -0
  32. package/apps/ios/EnigmaIOS/Enigma/EnigmaApp.swift +52 -0
  33. package/apps/ios/EnigmaIOS/Enigma/Info.plist +52 -0
  34. package/apps/ios/EnigmaIOS/Enigma/NaturalLanguagePrivacyTagger.swift +26 -0
  35. package/apps/ios/EnigmaIOS/Enigma/OAuthClient.swift +321 -0
  36. package/apps/ios/EnigmaIOS/Enigma/OnboardingView.swift +105 -0
  37. package/apps/ios/EnigmaIOS/Enigma/PrivateVaultView.swift +275 -0
  38. package/apps/ios/EnigmaIOS/Enigma/SecureStore.swift +76 -0
  39. package/apps/ios/EnigmaIOS/Enigma/SettingsView.swift +60 -0
  40. package/apps/ios/EnigmaIOS/Enigma/Theme.swift +80 -0
  41. package/apps/ios/EnigmaIOS/EnigmaIOS.xcodeproj/project.pbxproj +211 -0
  42. package/apps/ios/EnigmaIOS/EnigmaIOS.xcodeproj/xcshareddata/xcschemes/Enigma.xcscheme +23 -0
  43. package/apps/native-host/README.md +19 -8
  44. package/apps/native-host/bin/enigma-native-host.mjs +229 -13
  45. package/apps/relay/bin/enigma-relay.mjs +103 -5
  46. package/apps/relay/src/federation-runtime.mjs +618 -0
  47. package/apps/relay/src/server.mjs +310 -9
  48. package/apps/verifier/bin/enigma-verify.mjs +327 -11
  49. package/cortex-v3/circuits/build/intent_vk_bytes.json +35 -0
  50. package/cortex-v3/circuits/build/sale_vk_bytes.json +35 -0
  51. package/cortex-v3/circuits/build/vk_bytes.json +32 -0
  52. package/cortex-v3/proving-assets.json +64 -0
  53. package/cortex-v3/zk/BUILD-CONTRACT.md +87 -0
  54. package/cortex-v3/zk/action-transition-vk.json +119 -0
  55. package/cortex-v3/zk/alias-adversarial.test.mjs +220 -0
  56. package/cortex-v3/zk/groth16-verify-child.mjs +17 -0
  57. package/cortex-v3/zk/intent-witness.mjs +365 -0
  58. package/cortex-v3/zk/intent-witness.test.mjs +485 -0
  59. package/cortex-v3/zk/proving-assets.mjs +203 -0
  60. package/cortex-v3/zk/sale-witness.mjs +783 -0
  61. package/cortex-v3/zk/sale-witness.test.mjs +784 -0
  62. package/cortex-v3/zk/sealed-sale-release-vk.json +119 -0
  63. package/cortex-v3/zk/settlement-evidence.mjs +722 -0
  64. package/cortex-v3/zk/setup-intent.mjs +688 -0
  65. package/cortex-v3/zk/setup-sale.mjs +666 -0
  66. package/cortex-v3/zk/setup.mjs +594 -0
  67. package/cortex-v3/zk/witness.mjs +184 -0
  68. package/cortex-v3/zk/zk-codec.mjs +232 -0
  69. package/cortex-v3/zk/zk-codec.test.mjs +293 -0
  70. package/cortex-v3/zk/zk-settle.mjs +370 -0
  71. package/cortex-v3/zk/zk-tree.mjs +256 -0
  72. package/cortex-v3/zk/zk-tree.test.mjs +419 -0
  73. package/deploy/docker-compose.local-production-simulation.yml +36 -0
  74. package/docs/browser-extension-install.md +8 -6
  75. package/docs/client-connectors.md +15 -11
  76. package/docs/developer-ecosystem.md +15 -13
  77. package/docs/enigma-memory-ready-conformance.md +11 -9
  78. package/docs/install-anywhere.md +61 -28
  79. package/docs/installers-and-desktop.md +8 -7
  80. package/docs/novelty-invention-candidates.md +161 -161
  81. package/docs/proof-network-claim-boundaries.md +320 -318
  82. package/examples/01-quickstart-agent/index.mjs +49 -0
  83. package/examples/01_agent_memory_quickstart.mjs +57 -0
  84. package/examples/02-multi-agent-swarm/index.mjs +57 -0
  85. package/examples/02_cross_model_passport.mjs +64 -0
  86. package/examples/03-langchain-memory/index.mjs +41 -0
  87. package/examples/03_poseidon_commitment_verification.mjs +71 -0
  88. package/examples/04-python-trading-agent/trader.py +49 -0
  89. package/examples/README.md +27 -0
  90. package/examples/ci/github-actions.yml +7 -2
  91. package/package.json +142 -11
  92. package/packages/adapters/PACKAGE_CONTRACT.md +1 -1
  93. package/packages/connectors/src/index.js +196 -4
  94. package/packages/connectors/swarm-router.mjs +168 -0
  95. package/packages/core/src/index.js +248 -1
  96. package/packages/core/src/version.mjs +7 -0
  97. package/packages/dev-tools/package.json +19 -0
  98. package/packages/dev-tools/src/index.js +4 -0
  99. package/packages/dev-tools/src/memory-benchmark-suite.js +112 -0
  100. package/packages/dev-tools/src/swarm-simulator.js +101 -0
  101. package/packages/dev-tools/src/vault-inspector.js +114 -0
  102. package/packages/dev-tools/src/vector-benchmark.js +100 -0
  103. package/packages/developer-platform/src/access-credentials.js +341 -0
  104. package/packages/developer-platform/src/http.js +132 -0
  105. package/packages/developer-platform/src/index.js +4 -0
  106. package/packages/developer-platform/src/usage-http.js +60 -0
  107. package/packages/developer-platform/src/usage.js +295 -0
  108. package/packages/enclave-runtime/attestation.mjs +159 -0
  109. package/packages/enclave-runtime/index.mjs +47 -0
  110. package/packages/enclave-runtime/session-manager.mjs +253 -0
  111. package/packages/enclave-runtime/zeroization-proof.mjs +227 -0
  112. package/packages/enigma-reflex/package.json +14 -0
  113. package/packages/enigma-reflex/src/index.js +204 -0
  114. package/packages/enigma-reflex/training/generate-dataset.mjs +40 -0
  115. package/packages/enigma-reflex/training/requirements.txt +8 -0
  116. package/packages/enigma-reflex/training/train.py +314 -0
  117. package/packages/enigma-weave/LICENSE +22 -0
  118. package/packages/enigma-weave/UPSTREAM.json +21 -0
  119. package/packages/enigma-weave/package.json +14 -0
  120. package/packages/enigma-weave/src/index.js +286 -0
  121. package/packages/hosted-cloud/src/index.js +80 -5
  122. package/packages/importers/src/index.js +432 -0
  123. package/packages/inference-runtime/src/browser.js +401 -0
  124. package/packages/inference-runtime/src/chat.js +265 -0
  125. package/packages/inference-runtime/src/code.js +407 -0
  126. package/packages/inference-runtime/src/contracts.js +162 -0
  127. package/packages/inference-runtime/src/http.js +232 -0
  128. package/packages/inference-runtime/src/image.js +186 -0
  129. package/packages/inference-runtime/src/index.js +10 -0
  130. package/packages/inference-runtime/src/model-router.js +320 -0
  131. package/packages/inference-runtime/src/platform.js +125 -0
  132. package/packages/inference-runtime/src/privacy.js +400 -0
  133. package/packages/inference-runtime/src/video.js +253 -0
  134. package/packages/mcp-server/README.md +22 -6
  135. package/packages/mcp-server/bin/enigma-mcp.mjs +2 -1
  136. package/packages/mcp-server/src/index.js +1418 -105
  137. package/packages/mcp-server/src/oauth.js +561 -0
  138. package/packages/mcp-server/src/private-handoff.js +84 -0
  139. package/packages/mcp-server/src/remote-http.js +273 -0
  140. package/packages/mcp-server/src/remote-policy.js +72 -0
  141. package/packages/mcp-server/swarm-bridge.mjs +361 -0
  142. package/packages/mesh/index.d.ts +283 -0
  143. package/packages/mesh/package.json +23 -0
  144. package/packages/mesh/src/crypto.js +189 -0
  145. package/packages/mesh/src/federation-packets.js +353 -0
  146. package/packages/mesh/src/gossip.js +311 -0
  147. package/packages/mesh/src/index.js +6 -0
  148. package/packages/mesh/src/protocol.js +255 -0
  149. package/packages/mesh/src/router.js +279 -0
  150. package/packages/mesh/src/transport.js +306 -0
  151. package/packages/passport/src/index.js +426 -1
  152. package/packages/private-economy/src/credits-http.js +100 -0
  153. package/packages/private-economy/src/credits.js +447 -0
  154. package/packages/private-economy/src/index.js +5 -0
  155. package/packages/private-economy/src/payments-http.js +120 -0
  156. package/packages/private-economy/src/payments.js +509 -0
  157. package/packages/private-economy/src/x402.js +346 -0
  158. package/packages/proof-network/PACKAGE_CONTRACT.md +21 -0
  159. package/packages/rag/index.d.ts +182 -0
  160. package/packages/rag/models/Xenova/all-MiniLM-L6-v2/THIRD_PARTY_LICENSES.txt +207 -0
  161. package/packages/rag/models/Xenova/all-MiniLM-L6-v2/config.json +25 -0
  162. package/packages/rag/models/Xenova/all-MiniLM-L6-v2/onnx/model_quantized.onnx +0 -0
  163. package/packages/rag/models/Xenova/all-MiniLM-L6-v2/sha256-manifest.json +28 -0
  164. package/packages/rag/models/Xenova/all-MiniLM-L6-v2/tokenizer.json +30686 -0
  165. package/packages/rag/models/Xenova/all-MiniLM-L6-v2/tokenizer_config.json +15 -0
  166. package/packages/rag/package.json +27 -0
  167. package/packages/rag/src/blinded-search.js +109 -0
  168. package/packages/rag/src/bm25.js +169 -0
  169. package/packages/rag/src/embeddings.js +459 -0
  170. package/packages/rag/src/hybrid.js +76 -0
  171. package/packages/rag/src/index.js +38 -0
  172. package/packages/rag/src/reranker.js +61 -0
  173. package/packages/rag/src/research.js +107 -0
  174. package/packages/rag/src/vector-store.js +430 -0
  175. package/packages/rag/src/verify-model-artifacts.mjs +4 -0
  176. package/packages/sdk/index.d.ts +760 -0
  177. package/packages/sdk/package.json +33 -0
  178. package/packages/sdk/python/README.md +24 -0
  179. package/packages/sdk/python/enigma_sdk.py +250 -0
  180. package/packages/sdk/python/pyproject.toml +34 -0
  181. package/packages/sdk/python/requirements.txt +1 -0
  182. package/packages/sdk/python/setup.py +20 -0
  183. package/packages/sdk/src/federation/capability-grant.js +389 -0
  184. package/packages/sdk/src/federation/federation-router.js +360 -0
  185. package/packages/sdk/src/federation/ghostmesh-bridge.js +497 -0
  186. package/packages/sdk/src/federation/index.js +3 -0
  187. package/packages/sdk/src/index.js +1796 -0
  188. package/packages/sdk/src/intelligence/contradiction.js +337 -0
  189. package/packages/sdk/src/intelligence/decision-engine.js +155 -0
  190. package/packages/sdk/src/intelligence/index.js +4 -0
  191. package/packages/sdk/src/intelligence/ontology.js +122 -0
  192. package/packages/sdk/src/intelligence/temporal.js +123 -0
  193. package/packages/sdk/src/market-client.js +142 -0
  194. package/packages/sdk/src/mesh-client.js +110 -0
  195. package/packages/sdk/src/middleware/index.js +3 -0
  196. package/packages/sdk/src/middleware/langchain.js +159 -0
  197. package/packages/sdk/src/middleware/llamaindex.js +101 -0
  198. package/packages/sdk/src/middleware/vercel-ai.js +112 -0
  199. package/packages/sdk/src/rag-client.js +85 -0
  200. package/packages/sdk/src/swarm-orchestrator.js +260 -0
  201. package/packages/settlement/PACKAGE_CONTRACT.md +1 -1
  202. package/packages/snapcompact/THIRD_PARTY_LICENSES.txt +40 -0
  203. package/packages/snapcompact/assets/8x13-latin1.bdf +3837 -0
  204. package/packages/snapcompact/index.d.ts +284 -0
  205. package/packages/snapcompact/package.json +25 -0
  206. package/packages/snapcompact/src/index.js +716 -0
  207. package/packages/storage/PACKAGE_CONTRACT.md +1 -1
  208. package/packages/terminal-console/animations.mjs +240 -0
  209. package/packages/terminal-console/auto-anchor.mjs +220 -0
  210. package/packages/terminal-console/banner.mjs +91 -0
  211. package/packages/terminal-console/commands.mjs +459 -0
  212. package/packages/terminal-console/delegation.mjs +152 -0
  213. package/packages/terminal-console/index.mjs +5 -0
  214. package/packages/terminal-console/outbox.mjs +143 -0
  215. package/packages/terminal-console/phantom-bridge.mjs +637 -0
  216. package/packages/terminal-console/repl.mjs +136 -0
  217. package/packages/terminal-console/signer-store.mjs +130 -0
  218. package/packages/terminal-console/solana-rpc.mjs +214 -0
  219. package/packages/terminal-console/solana-transport.mjs +189 -0
  220. package/packages/terminal-tui/dashboard.mjs +214 -0
  221. package/packages/terminal-tui/index.mjs +28 -0
  222. package/packages/terminal-tui/merkle-tree-renderer.mjs +268 -0
  223. package/packages/terminal-tui/telemetry-hud.mjs +137 -0
  224. package/packages/vault/index.d.ts +449 -0
  225. package/packages/vault/package.json +27 -0
  226. package/packages/vault/src/e2ee.mjs +393 -0
  227. package/packages/vault/src/enclave.js +481 -0
  228. package/packages/vault/src/erasure.js +207 -0
  229. package/packages/vault/src/index.js +1018 -155
  230. package/packages/vault/src/persistence.js +307 -0
  231. package/packages/vault/src/poseidon.js +354 -0
  232. package/packages/vault/src/receipt.js +459 -0
  233. package/scripts/benchmark-optical-context.mjs +166 -0
  234. package/scripts/bootstrap-enigma.mjs +502 -0
  235. package/scripts/build-edge-backend-workers.mjs +20 -5
  236. package/scripts/build-goal-completion-audit.mjs +72 -25
  237. package/scripts/build-hosted-api-key-lifecycle.mjs +26 -8
  238. package/scripts/build-hosted-customer-lifecycle.mjs +20 -3
  239. package/scripts/build-hosted-probe-worker.mjs +19 -4
  240. package/scripts/build-installer-assets.mjs +41 -21
  241. package/scripts/build-operator-evidence-starter.mjs +59 -1
  242. package/scripts/build-production-backend-env-kit.mjs +2 -0
  243. package/scripts/build-production-unblocker.mjs +3 -0
  244. package/scripts/check.mjs +17 -3
  245. package/scripts/collect-hosted-backend-live-evidence.mjs +49 -12
  246. package/scripts/install-enigma-local.mjs +18 -5
  247. package/scripts/release-audit.mjs +65 -109
  248. package/scripts/release-provenance.mjs +6 -0
  249. package/scripts/run-backend-readiness-smoke.mjs +112 -10
  250. package/scripts/scan-secrets.mjs +1 -0
  251. package/scripts/simulate-production-env.mjs +7 -2
  252. package/scripts/validate-hosted-backend-live.mjs +112 -1
  253. package/specs/antibody-pack-v1.schema.json +95 -0
  254. package/specs/antigen-envelope-v1.schema.json +81 -0
  255. package/specs/boundary-manifest-v1.schema.json +35 -35
  256. package/specs/capsule-v1.schema.json +55 -55
  257. package/specs/claim-boundary-manifest-v1.schema.json +22 -22
  258. package/specs/claim-ledger-v1.schema.json +291 -0
  259. package/specs/context-passport-v1.schema.json +59 -0
  260. package/specs/deletion-tombstone-v1.schema.json +26 -26
  261. package/specs/evidence-packet-v1.schema.json +177 -0
  262. package/specs/hosted-backend-live-evidence-v1.schema.json +72 -3
  263. package/specs/immune-scan-report-v1.schema.json +112 -0
  264. package/specs/lifecycle-receipt-log-v1.schema.json +67 -0
  265. package/specs/memory-atom-v1.schema.json +59 -0
  266. package/specs/memory-event-v1.schema.json +42 -42
  267. package/specs/passport-v1.schema.json +50 -50
  268. package/specs/proof-of-non-use-v1.schema.json +65 -0
  269. package/specs/quarantine-record-v1.schema.json +126 -0
  270. package/specs/receipt-v1.schema.json +61 -61
  271. package/specs/state-checkpoint-v1.schema.json +37 -37
  272. package/specs/trust-bundle-v1.schema.json +56 -56
  273. package/specs/trust-card-v1.schema.json +119 -0
  274. package/docs/proof-network-launch-plan.md +0 -421
  275. package/packages/metering/PACKAGE_CONTRACT.md +0 -20
  276. package/scripts/build-ai-orchestration-plan.mjs +0 -248
@@ -194,6 +194,7 @@ function serviceEnv({ service, domain, tenant, environment }) {
194
194
  ['ENIGMA_INCIDENT_DRILL_REF', placeholderFor('ENIGMA_INCIDENT_DRILL_REF')],
195
195
  ['ENIGMA_BACKUP_RESTORE_DRILL_REF', placeholderFor('ENIGMA_BACKUP_RESTORE_DRILL_REF')],
196
196
  ['ENIGMA_OPERATOR_ACCEPTANCE_DECISION', '<operator-required-go-decision>'],
197
+ ['ENIGMA_BACKUP_TARGET_REF', placeholderFor('ENIGMA_BACKUP_TARGET_REF')],
197
198
  ['ENIGMA_BACKUP_TARGET_URI_FILE', '/run/secrets/backup_target_uri'],
198
199
  ['ENIGMA_KMS_KEY_REF_FILE', '/run/secrets/kms_key_ref'],
199
200
  ['ENIGMA_OPERATOR_ACCEPTANCE_EVIDENCE_URI_FILE', '/run/secrets/operator_acceptance_evidence_uri'],
@@ -211,6 +212,7 @@ function serviceEnv({ service, domain, tenant, environment }) {
211
212
  ['ENIGMA_RELAY_DNS_TLS_REF', placeholderFor('ENIGMA_RELAY_DNS_TLS_REF')],
212
213
  ['ENIGMA_RELAY_RUNTIME_AUTH_REF', placeholderFor('ENIGMA_RELAY_RUNTIME_AUTH_REF')],
213
214
  ['ENIGMA_RELAY_MONITORING_REF', placeholderFor('ENIGMA_RELAY_MONITORING_REF')],
215
+ ['ENIGMA_RELAY_STORAGE_REF', placeholderFor('ENIGMA_RELAY_STORAGE_REF')],
214
216
  ['ENIGMA_RELAY_SIGNING_KEY_FILE', '/run/secrets/relay_signing_key'],
215
217
  ['ENIGMA_EXTERNAL_STORAGE_DSN_FILE', '/run/secrets/external_storage_dsn'],
216
218
  ...common,
@@ -4,6 +4,9 @@ import { dirname, resolve } from 'node:path';
4
4
  import { fileURLToPath } from 'node:url';
5
5
 
6
6
  export const PRODUCTION_UNBLOCKER_SCHEMA = 'enigma.production_unblocker.v1';
7
+ // Last VERIFIED live registry version (`npm view enigma-memory version`), distinct
8
+ // from the source release candidate (ENIGMA_VERSION). Bump ONLY after a publish is
9
+ // confirmed live on the registry — never to the candidate version in advance.
7
10
  export const CURRENT_PUBLIC_PACKAGE_VERSION = '0.1.18';
8
11
 
9
12
  const STATUS_VALUES = Object.freeze([
package/scripts/check.mjs CHANGED
@@ -265,14 +265,28 @@ function validatePackageMetadata(pkg) {
265
265
  './gateway',
266
266
  './desktop'
267
267
  ];
268
+ function extractExportTargets(target) {
269
+ if (typeof target === 'string') return [target];
270
+ if (isPlainObject(target)) return Object.values(target).flatMap(extractExportTargets);
271
+ if (Array.isArray(target)) return target.flatMap(extractExportTargets);
272
+ return [];
273
+ }
274
+
268
275
  if (!isPlainObject(pkg.exports)) throw new Error('package.json missing exports');
269
276
  for (const key of requiredExports) {
270
277
  const target = pkg.exports[key];
271
- if (typeof target !== 'string') throw new Error(`package.json missing export ${key}`);
272
- if (!packageFileExists(target)) throw new Error(`package.json export ${key} points to a missing file`);
278
+ if (typeof target !== 'string' && !isPlainObject(target)) throw new Error(`package.json missing export ${key}`);
279
+ const targets = extractExportTargets(target);
280
+ if (targets.length === 0) throw new Error(`package.json missing export ${key}`);
281
+ for (const t of targets) {
282
+ if (!packageFileExists(t)) throw new Error(`package.json export ${key} points to a missing file: ${t}`);
283
+ }
273
284
  }
274
285
  for (const [key, target] of Object.entries(pkg.exports)) {
275
- if (typeof target === 'string' && !packageFileExists(target)) throw new Error(`package.json export ${key} points to a missing file`);
286
+ const targets = extractExportTargets(target);
287
+ for (const t of targets) {
288
+ if (!packageFileExists(t)) throw new Error(`package.json export ${key} points to a missing file: ${t}`);
289
+ }
276
290
  }
277
291
 
278
292
  const requiredBins = ['enigma', 'enigma-verify', 'enigma-mcp', 'enigma-relay', 'enigma-gateway', 'enigma-native-host'];
@@ -15,10 +15,13 @@ export const HOSTED_BACKEND_LIVE_COLLECTION_SCHEMA = 'enigma.hosted_backend_live
15
15
 
16
16
  const REQUIRED_PROBES = Object.freeze(['relay_livez', 'relay_readyz', 'gateway_livez', 'gateway_readyz']);
17
17
  const CLAIM_BOUNDARY = Object.freeze([
18
- 'This collector performs public HTTPS health probes and assembles evidence; it does not deploy infrastructure, mutate DNS, create credentials, or approve operator acceptance.',
19
- 'Collected evidence is accepted only if validate-hosted-backend-live also accepts it.',
20
- 'Probe response bodies must be public-safe readiness JSON and must not contain tokens, prompts, transcripts, provider responses, raw memory, or personal contact data.',
18
+ 'This collector performs public HTTPS health probes and assembles separately supplied runtime-capability and authenticated data-plane proof; it does not deploy infrastructure, mutate DNS, create credentials, or approve operator acceptance.',
19
+ 'Health-only collection remains blocked: validate-hosted-backend-live requires operational runtime markers and successful authenticated relay/gateway data-plane evidence.',
20
+ 'Local-simulation loopback collection is marked local_simulation:true and hosted_backend_live:false, so it cannot satisfy hosted production evidence.',
21
+ 'Probe response bodies and supplied evidence must be public-safe and must not contain tokens, prompts, transcripts, provider responses, raw memory, or personal contact data.',
21
22
  ]);
23
+ const DEFAULT_PROBE_TIMEOUT_MS = 10_000;
24
+
22
25
  const SAFE_PROBE_FIELD_NAMES = new Set(['evidence_refs', 'kms_or_secret_custody']);
23
26
 
24
27
  function sha256(text) {
@@ -36,6 +39,15 @@ function nonEmptyString(value) {
36
39
  function readFlag(flags, key, fallback = null) {
37
40
  return flags.has(key) ? flags.get(key) : fallback;
38
41
  }
42
+ function bounded(promise, timeoutMs, label) {
43
+ let timer;
44
+ const timeout = new Promise((_, reject) => {
45
+ timer = setTimeout(() => reject(new Error(`${label} timed out after ${timeoutMs}ms`)), timeoutMs);
46
+ timer.unref?.();
47
+ });
48
+ return Promise.race([promise, timeout]).finally(() => clearTimeout(timer));
49
+ }
50
+
39
51
 
40
52
  function parsePublicHealthUrl(value, label) {
41
53
  if (!nonEmptyString(value)) throw new Error(`${label} is required`);
@@ -88,6 +100,7 @@ export function localSimulationLoopbackFetch(url, init = {}) {
88
100
  if (parsed.protocol !== 'https:' || (host !== 'sim.enigmamemory.com' && !host.endsWith('.sim.enigmamemory.com'))) {
89
101
  throw new Error('--local-simulation-loopback only supports https://*.sim.enigmamemory.com simulation probes');
90
102
  }
103
+ const timeoutMs = Number.isSafeInteger(init.timeoutMs) && init.timeoutMs > 0 ? init.timeoutMs : DEFAULT_PROBE_TIMEOUT_MS;
91
104
  const request = {
92
105
  hostname: '127.0.0.1',
93
106
  port: parsed.port || 443,
@@ -102,6 +115,7 @@ export function localSimulationLoopbackFetch(url, init = {}) {
102
115
  const chunks = [];
103
116
  res.on('data', (chunk) => chunks.push(chunk));
104
117
  res.on('end', () => {
118
+ clearTimeout(timer);
105
119
  const text = Buffer.concat(chunks).toString('utf8');
106
120
  resolve({
107
121
  ok: res.statusCode >= 200 && res.statusCode < 300,
@@ -113,24 +127,33 @@ export function localSimulationLoopbackFetch(url, init = {}) {
113
127
  });
114
128
  });
115
129
  });
116
- req.on('error', reject);
130
+ const timer = setTimeout(() => req.destroy(new Error(`simulation probe timed out after ${timeoutMs}ms`)), timeoutMs);
131
+ timer.unref?.();
132
+ req.on('error', (error) => {
133
+ clearTimeout(timer);
134
+ reject(error);
135
+ });
117
136
  req.end();
118
137
  });
119
138
  }
120
139
 
121
- async function fetchProbe(url, { fetchImpl = globalThis.fetch, observedAt }) {
140
+ async function fetchProbe(url, { fetchImpl = globalThis.fetch, observedAt, timeoutMs = DEFAULT_PROBE_TIMEOUT_MS }) {
122
141
  if (typeof fetchImpl !== 'function') throw new Error('global fetch is not available in this Node runtime');
123
- const response = await fetchImpl(url, {
142
+ const response = await bounded(fetchImpl(url, {
124
143
  method: 'GET',
125
144
  headers: { Accept: 'application/json' },
126
145
  redirect: 'manual',
127
- });
146
+ signal: AbortSignal.timeout(timeoutMs),
147
+ timeoutMs,
148
+ }), timeoutMs, `hosted backend probe ${url}`);
128
149
  const statusCode = Number(response.status ?? 0);
129
150
  const responseUrl = typeof response.url === 'string' && response.url.length > 0 ? response.url : url;
130
151
  if (response.redirected === true || responseUrl !== url || (statusCode >= 300 && statusCode <= 399)) {
131
152
  throw new Error(`hosted backend probe ${url} must not redirect`);
132
153
  }
133
- const text = typeof response.text === 'function' ? await response.text() : '';
154
+ const text = typeof response.text === 'function'
155
+ ? await bounded(response.text(), timeoutMs, `hosted backend probe body ${url}`)
156
+ : '';
134
157
  let body = null;
135
158
  try {
136
159
  body = text.trim().length === 0 ? {} : JSON.parse(text);
@@ -158,7 +181,12 @@ function buildProbeUrls(options) {
158
181
  }
159
182
 
160
183
  function buildEnvironment(options) {
161
- if (isPlainObject(options.environment)) return options.environment;
184
+ if (isPlainObject(options.environment)) {
185
+ return {
186
+ ...options.environment,
187
+ local_simulation: options.localSimulation === true || options.environment.local_simulation === true,
188
+ };
189
+ }
162
190
  return {
163
191
  environment_id: options.environmentId,
164
192
  domain: options.domain,
@@ -166,6 +194,7 @@ function buildEnvironment(options) {
166
194
  region: options.region,
167
195
  owner: options.owner,
168
196
  status: options.environmentStatus ?? 'observed',
197
+ local_simulation: options.localSimulation === true,
169
198
  };
170
199
  }
171
200
 
@@ -187,16 +216,19 @@ function validateRefsShape(refs) {
187
216
  export async function collectHostedBackendLiveEvidence(options = {}) {
188
217
  const observedAt = options.observed_at ?? options.observedAt ?? new Date().toISOString();
189
218
  const probeUrls = buildProbeUrls(options);
190
- const probeEntries = await Promise.all(REQUIRED_PROBES.map(async (key) => [key, await fetchProbe(probeUrls[key], { fetchImpl: options.fetchImpl, observedAt })]));
219
+ const timeoutMs = options.probeTimeoutMs ?? DEFAULT_PROBE_TIMEOUT_MS;
220
+ const probeEntries = await Promise.all(REQUIRED_PROBES.map(async (key) => [key, await fetchProbe(probeUrls[key], { fetchImpl: options.fetchImpl, observedAt, timeoutMs })]));
191
221
  const evidence = {
192
222
  schema: HOSTED_BACKEND_LIVE_EVIDENCE_SCHEMA,
193
223
  observed_at: observedAt,
194
224
  environment: buildEnvironment(options),
195
225
  refs: validateRefsShape(options.refs),
196
226
  probes: Object.fromEntries(probeEntries),
227
+ runtime_capability: isPlainObject(options.runtime_capability ?? options.runtimeCapability) ? (options.runtime_capability ?? options.runtimeCapability) : null,
228
+ authenticated_data_plane: isPlainObject(options.authenticated_data_plane ?? options.authenticatedDataPlane) ? (options.authenticated_data_plane ?? options.authenticatedDataPlane) : null,
197
229
  operator_acceptance: buildOperatorAcceptance(options),
198
230
  claim_boundary: {
199
- hosted_backend_live: true,
231
+ hosted_backend_live: options.localSimulation !== true,
200
232
  public_site_live: false,
201
233
  cloudflare_credentials_claim: false,
202
234
  token_roi_claim: false,
@@ -239,7 +271,7 @@ function parseArgs(argv) {
239
271
  }
240
272
 
241
273
  function usage() {
242
- return `Usage: node scripts/collect-hosted-backend-live-evidence.mjs --relay-url <https-base> --gateway-url <https-base> --refs-json <refs.json> --domain <domain> --environment-id <id> --cloud-provider <provider> --region <region> --owner <owner> --operator-decision go --operator-packet-ref <ref> --operator-approved-at <iso> --operator-approved-by <name> [--out <collection.json>] [--evidence-out <evidence.json>] [--local-simulation-loopback]\n\nCollects public HTTPS /livez and /readyz evidence for relay and gateway, then validates it with validate-hosted-backend-live. It never sends credentials and does not deploy infrastructure. The --local-simulation-loopback flag is restricted to https://*.sim.enigmamemory.com local simulation probes with self-signed TLS and must not be used as production evidence.\n`;
274
+ return `Usage: node scripts/collect-hosted-backend-live-evidence.mjs --relay-url <https-base> --gateway-url <https-base> --refs-json <refs.json> --runtime-capability-json <runtime-capability.json> --authenticated-data-plane-json <authenticated-data-plane.json> --domain <domain> --environment-id <id> --cloud-provider <provider> --region <region> --owner <owner> --operator-decision go --operator-packet-ref <ref> --operator-approved-at <iso> --operator-approved-by <name> [--out <collection.json>] [--evidence-out <evidence.json>] [--local-simulation-loopback]\n\nCollects public HTTPS /livez and /readyz evidence and assembles separate public-safe runtime/authenticated data-plane evidence for relay and gateway, then validates it with validate-hosted-backend-live. It never sends credentials and does not deploy infrastructure. Health-only evidence is always blocked. The --local-simulation-loopback flag is restricted to https://*.sim.enigmamemory.com local simulation probes with self-signed TLS.\n`;
243
275
  }
244
276
 
245
277
  async function runCli(argv = process.argv.slice(2), { fetchImpl = globalThis.fetch } = {}) {
@@ -253,6 +285,8 @@ async function runCli(argv = process.argv.slice(2), { fetchImpl = globalThis.fet
253
285
  const refs = await readJsonFile(refsPath);
254
286
  const environment = await maybeReadJsonFile(readFlag(flags, 'environment-json'));
255
287
  const operatorAcceptance = await maybeReadJsonFile(readFlag(flags, 'operator-acceptance-json'));
288
+ const runtimeCapability = await maybeReadJsonFile(readFlag(flags, 'runtime-capability-json'));
289
+ const authenticatedDataPlane = await maybeReadJsonFile(readFlag(flags, 'authenticated-data-plane-json'));
256
290
  const selectedFetchImpl = flags.get('local-simulation-loopback') === true ? localSimulationLoopbackFetch : fetchImpl;
257
291
  const collection = await collectHostedBackendLiveEvidence({
258
292
  relayBaseUrl: readFlag(flags, 'relay-url'),
@@ -274,7 +308,10 @@ async function runCli(argv = process.argv.slice(2), { fetchImpl = globalThis.fet
274
308
  operatorPacketRef: readFlag(flags, 'operator-packet-ref'),
275
309
  operatorApprovedAt: readFlag(flags, 'operator-approved-at'),
276
310
  operatorApprovedBy: readFlag(flags, 'operator-approved-by'),
311
+ runtimeCapability,
312
+ authenticatedDataPlane,
277
313
  observed_at: readFlag(flags, 'observed-at') ?? new Date().toISOString(),
314
+ localSimulation: flags.get('local-simulation-loopback') === true,
278
315
  fetchImpl: selectedFetchImpl,
279
316
  });
280
317
  const collectionJson = `${JSON.stringify(collection, null, 2)}\n`;
@@ -8,6 +8,7 @@ import { fileURLToPath } from 'node:url';
8
8
  export const INSTALLER_SCHEMA = 'enigma.local_installer.v1';
9
9
  export const REQUIRED_NODE_MAJOR = 24;
10
10
  export const DEFAULT_BUNDLE_PATH = '.enigma/bundle.json';
11
+ export const DEFAULT_PASSPHRASE_FILE = '.enigma/passphrase';
11
12
 
12
13
  const execFileAsync = promisify(execFile);
13
14
  const SCRIPT_PATH = fileURLToPath(import.meta.url);
@@ -21,7 +22,7 @@ function readRequiredValue(argv, index, flag) {
21
22
  }
22
23
 
23
24
  export function usage() {
24
- return `Usage: node scripts/install-enigma-local.mjs [--dry-run|--execute] [--init-vault] [--bundle <path>]\n\nDry-run is the default. Execute mode runs npm install -g . from the local checkout.\nNo network download command is generated, and vault initialization runs only when --init-vault is present.\n`;
25
+ return `Usage: node scripts/install-enigma-local.mjs [--dry-run|--execute] [--init-vault] [--bundle <path>] [--passphrase-file <path>]\n\nDry-run is the default. Execute mode runs npm install -g . from the local checkout.\nVault initialization is encrypted and runs only when --init-vault is present; create the passphrase file through an approved secret manager or secure editor before execute mode.\nNo network download command is generated.\n`;
25
26
  }
26
27
 
27
28
  export function parseInstallerArgs(argv = process.argv.slice(2)) {
@@ -30,6 +31,7 @@ export function parseInstallerArgs(argv = process.argv.slice(2)) {
30
31
  execute: false,
31
32
  initVault: false,
32
33
  bundlePath: DEFAULT_BUNDLE_PATH,
34
+ passphraseFile: DEFAULT_PASSPHRASE_FILE,
33
35
  packageDir: DEFAULT_PACKAGE_DIR,
34
36
  subject: 'local-user',
35
37
  displayName: 'Local user',
@@ -56,6 +58,9 @@ export function parseInstallerArgs(argv = process.argv.slice(2)) {
56
58
  } else if (arg === '--bundle') {
57
59
  options.bundlePath = readRequiredValue(argv, index, arg);
58
60
  index += 1;
61
+ } else if (arg === '--passphrase-file') {
62
+ options.passphraseFile = readRequiredValue(argv, index, arg);
63
+ index += 1;
59
64
  } else if (arg === '--package-dir') {
60
65
  options.packageDir = readRequiredValue(argv, index, arg);
61
66
  index += 1;
@@ -114,8 +119,10 @@ export function validateCommandSpec(spec) {
114
119
 
115
120
  if (command === 'enigma' || command === 'enigma.cmd') {
116
121
  const bundleIndex = args.indexOf('--bundle');
117
- if (args[0] !== 'init' || bundleIndex === -1 || bundleIndex + 1 >= args.length) {
118
- throw new Error('Installer Enigma command must initialize a bundle with --bundle.');
122
+ const passphraseIndex = args.indexOf('--passphrase-file');
123
+ if (args[0] !== 'init' || bundleIndex === -1 || bundleIndex + 1 >= args.length
124
+ || passphraseIndex === -1 || passphraseIndex + 1 >= args.length) {
125
+ throw new Error('Installer Enigma command must initialize a bundle with --bundle and --passphrase-file.');
119
126
  }
120
127
  return true;
121
128
  }
@@ -125,7 +132,7 @@ export function validateCommandSpec(spec) {
125
132
 
126
133
  function publicCommand(command) {
127
134
  if (command.step === 'install_package') return { command: 'npm', args: ['install', '-g', '.'] };
128
- return { command: 'enigma', args: ['init', '--bundle', '<bundle-path>', '--subject', '<subject>', '--display-name', '<display-name>'] };
135
+ return { command: 'enigma', args: ['init', '--bundle', '<bundle-path>', '--passphrase-file', '<passphrase-file>', '--subject', '<subject>', '--display-name', '<display-name>'] };
129
136
  }
130
137
 
131
138
  export function buildInstallerPlan(options = {}, runtime = {}) {
@@ -137,6 +144,9 @@ export function buildInstallerPlan(options = {}, runtime = {}) {
137
144
  const requestedBundlePath = String(options.bundlePath ?? DEFAULT_BUNDLE_PATH);
138
145
  rejectUnsafeArg(requestedBundlePath, 'Bundle path');
139
146
  const bundlePath = isAbsolute(requestedBundlePath) ? resolvePath(requestedBundlePath) : resolvePath(cwd, requestedBundlePath);
147
+ const requestedPassphraseFile = String(options.passphraseFile ?? DEFAULT_PASSPHRASE_FILE);
148
+ rejectUnsafeArg(requestedPassphraseFile, 'Passphrase file');
149
+ const passphraseFile = isAbsolute(requestedPassphraseFile) ? resolvePath(requestedPassphraseFile) : resolvePath(cwd, requestedPassphraseFile);
140
150
 
141
151
  const commands = [
142
152
  {
@@ -152,7 +162,7 @@ export function buildInstallerPlan(options = {}, runtime = {}) {
152
162
  commands.push({
153
163
  step: 'initialize_vault',
154
164
  command: commandForPlatform('enigma', platform),
155
- args: ['init', '--bundle', bundlePath, '--subject', String(options.subject ?? 'local-user'), '--display-name', String(options.displayName ?? 'Local user')],
165
+ args: ['init', '--bundle', bundlePath, '--passphrase-file', passphraseFile, '--subject', String(options.subject ?? 'local-user'), '--display-name', String(options.displayName ?? 'Local user')],
156
166
  cwd: packageDir,
157
167
  mutates_local_filesystem: true,
158
168
  });
@@ -166,6 +176,7 @@ export function buildInstallerPlan(options = {}, runtime = {}) {
166
176
  packageDir,
167
177
  bundlePath,
168
178
  bundlePathKind: requestedBundlePath === DEFAULT_BUNDLE_PATH ? 'default' : (isAbsolute(requestedBundlePath) ? 'absolute' : 'relative'),
179
+ passphraseFile,
169
180
  initVault: options.initVault === true,
170
181
  commands,
171
182
  };
@@ -205,6 +216,8 @@ function publicOutput(plan, node, commandResults = []) {
205
216
  path_kind: plan.bundlePathKind,
206
217
  initialize_requested: plan.initVault,
207
218
  initialized: plan.execute && plan.initVault && resultByStep.get('initialize_vault')?.ok === true,
219
+ encrypted: plan.initVault,
220
+ credential_source: plan.initVault ? 'passphrase_file' : null,
208
221
  },
209
222
  commands,
210
223
  preview: {
@@ -58,6 +58,14 @@ const SHA256_PREFIXED_DIGEST = /^sha256:[0-9a-f]{64}$/;
58
58
  const PRIVATE_PUBLIC_SITE_COLLATERAL_PATH = /(?:^|\/)(?:private|internal|launch-code|investor|token(?:omics)?|sales|marketing|funnel|community|social|adoption|objections|faq|whitepaper)[^/]*\.(?:md|html|json)$/i;
59
59
  const LOCAL_BUNDLE_LOG_OR_SECRET_PATH = /(?:^|\/)(?:\.env(?:\.|$)|env\.local$|secrets?|credentials?|tokens?|api[-_]?keys?|private[-_]?keys?|\.enigma|enigma[-_]?bundle|vault[-_]?bundle|bundle\.json|logs?|npm-debug\.log|yarn-error\.log|pnpm-debug\.log)(?:\/|$|[._-])/i;
60
60
  const PRIVATE_REVIEW_PACKET_COLLATERAL_PATH = /(?:^|\/)(?:\d+[_-])?(?:private|internal|launch-code|executive|investor|partner|sales|marketing|funnel|community|social|adoption|objections|faq|pitch|demo[-_]?scripts?|content[-_]?calendar|brand[-_]?messaging)[^/]*\.(?:html|json|md|txt)$/i;
61
+ const PINNED_MODEL_ARTIFACT_PATHS = new Set([
62
+ 'packages/rag/models/Xenova/all-MiniLM-L6-v2/config.json',
63
+ 'packages/rag/models/Xenova/all-MiniLM-L6-v2/tokenizer.json',
64
+ 'packages/rag/models/Xenova/all-MiniLM-L6-v2/tokenizer_config.json',
65
+ 'packages/rag/models/Xenova/all-MiniLM-L6-v2/onnx/model_quantized.onnx',
66
+ 'packages/rag/models/Xenova/all-MiniLM-L6-v2/sha256-manifest.json',
67
+ 'packages/rag/models/Xenova/all-MiniLM-L6-v2/THIRD_PARTY_LICENSES.txt',
68
+ ]);
61
69
  const RAW_MEMORY_EXAMPLE_FIELD = /"(?:raw_memory|plaintext|prompt|response|memory)"\s*:\s*"[^"]+"/i;
62
70
  const NATIVE_HOST_MANIFEST_SMOKES = Object.freeze([
63
71
  {
@@ -123,8 +131,6 @@ const WHITEPAPER_CLAIMS_VALIDATOR_SCRIPT = resolve(PROJECT_ROOT, 'scripts', 'val
123
131
  const PRODUCTION_DEPENDENCY_REPORT_SCRIPT = resolve(PROJECT_ROOT, 'scripts', 'build-production-dependency-report.mjs');
124
132
  const PRODUCTION_WORKPLAN_SCRIPT = resolve(PROJECT_ROOT, 'scripts', 'build-production-workplan.mjs');
125
133
  const PRODUCTION_STATUS_BOARD_SCRIPT = resolve(PROJECT_ROOT, 'scripts', 'build-production-status-board.mjs');
126
- const AI_ORCHESTRATION_PLAN_SCHEMA = 'enigma.ai_orchestration_plan.v1';
127
- const AI_ORCHESTRATION_PLAN_SCRIPT = resolve(PROJECT_ROOT, 'scripts', 'build-ai-orchestration-plan.mjs');
128
134
  const CLOUDFLARE_WORKER_INSPECT_VALIDATOR_SCRIPT = resolve(PROJECT_ROOT, 'scripts', 'validate-cloudflare-worker-inspect.mjs');
129
135
  const CLOUDFLARE_CREDENTIALS_VALIDATOR_SCRIPT = resolve(PROJECT_ROOT, 'scripts', 'validate-cloudflare-credentials.mjs');
130
136
  const CLOUDFLARE_WORKER_INSPECT_CURRENT = resolve(PROJECT_ROOT, '.enigma', 'worker-inspect-current.json');
@@ -337,8 +343,9 @@ function isSha256PrefixedDigest(value) {
337
343
  function isSafeReleaseProvenancePath(value) {
338
344
  return typeof value === 'string'
339
345
  && value.length > 0
340
- && !PRIVATE_PUBLIC_SITE_COLLATERAL_PATH.test(value)
341
- && !LOCAL_BUNDLE_LOG_OR_SECRET_PATH.test(value);
346
+ && (PINNED_MODEL_ARTIFACT_PATHS.has(value)
347
+ || (!PRIVATE_PUBLIC_SITE_COLLATERAL_PATH.test(value)
348
+ && !LOCAL_BUNDLE_LOG_OR_SECRET_PATH.test(value)));
342
349
  }
343
350
 
344
351
  function isSafeReviewPacketPath(value) {
@@ -1724,6 +1731,7 @@ function hostedBackendLiveFixture() {
1724
1731
  region: 'us-central',
1725
1732
  owner: 'operator',
1726
1733
  status: 'verified',
1734
+ local_simulation: false,
1727
1735
  },
1728
1736
  refs,
1729
1737
  probes: {
@@ -1732,6 +1740,57 @@ function hostedBackendLiveFixture() {
1732
1740
  gateway_livez: { url: 'https://gateway.enigmamemory.com/livez', status_code: 200, body: { ok: true, service: 'enigma-gateway' }, observed_at: '2026-06-24T00:00:00.000Z', response_hash: responseHash },
1733
1741
  gateway_readyz: { url: 'https://gateway.enigmamemory.com/readyz', status_code: 200, body: readyBody('enigma-gateway'), observed_at: '2026-06-24T00:00:00.000Z', response_hash: responseHash },
1734
1742
  },
1743
+ runtime_capability: {
1744
+ schema: 'enigma.hosted_backend_runtime_capability.v1',
1745
+ marker: 'enigma.private_data_plane.runtime.v1',
1746
+ observed_at: '2026-06-24T00:00:00.000Z',
1747
+ services: {
1748
+ relay: {
1749
+ service: 'enigma-relay',
1750
+ private_data_plane_operational: true,
1751
+ authentication_enforced: true,
1752
+ bootstrap_worker: false,
1753
+ evidence_ref: 'runtime://enigma-relay/release-audit-fixture',
1754
+ },
1755
+ gateway: {
1756
+ service: 'enigma-gateway',
1757
+ private_data_plane_operational: true,
1758
+ authentication_enforced: true,
1759
+ bootstrap_worker: false,
1760
+ evidence_ref: 'runtime://enigma-gateway/release-audit-fixture',
1761
+ },
1762
+ },
1763
+ },
1764
+ authenticated_data_plane: {
1765
+ schema: 'enigma.hosted_backend_authenticated_data_plane.v1',
1766
+ observed_at: '2026-06-24T00:00:00.000Z',
1767
+ proofs: {
1768
+ relay: {
1769
+ service: 'enigma-relay',
1770
+ url: 'https://relay.enigmamemory.com/pairing/complete',
1771
+ method: 'POST',
1772
+ status_code: 200,
1773
+ authenticated: true,
1774
+ authorization_result: 'allowed',
1775
+ observed_at: '2026-06-24T00:00:00.000Z',
1776
+ request_hash: responseHash,
1777
+ response_hash: responseHash,
1778
+ evidence_ref: 'data-plane://enigma-relay/release-audit-fixture',
1779
+ },
1780
+ gateway: {
1781
+ service: 'enigma-gateway',
1782
+ url: 'https://gateway.enigmamemory.com/gateway/decision',
1783
+ method: 'POST',
1784
+ status_code: 200,
1785
+ authenticated: true,
1786
+ authorization_result: 'allowed',
1787
+ observed_at: '2026-06-24T00:00:00.000Z',
1788
+ request_hash: responseHash,
1789
+ response_hash: responseHash,
1790
+ evidence_ref: 'data-plane://enigma-gateway/release-audit-fixture',
1791
+ },
1792
+ },
1793
+ },
1735
1794
  operator_acceptance: {
1736
1795
  decision: 'go',
1737
1796
  packet_ref: 'operator-acceptance-release-audit#fixture',
@@ -1797,6 +1856,8 @@ export async function runHostedBackendLiveValidatorGate() {
1797
1856
  refs_missing: parsed.checked?.refs_missing ?? null,
1798
1857
  probes_covered: parsed.checked?.probes_covered ?? null,
1799
1858
  operator_decision: parsed.checked?.operator_decision ?? null,
1859
+ runtime_services_covered: parsed.checked?.runtime_services_covered ?? null,
1860
+ authenticated_data_plane_proofs_covered: parsed.checked?.authenticated_data_plane_proofs_covered ?? null,
1800
1861
  };
1801
1862
  } catch (error) {
1802
1863
  gate.ok = false;
@@ -2827,110 +2888,6 @@ export async function runProductionStatusBoardGate() {
2827
2888
  return gate;
2828
2889
  }
2829
2890
 
2830
- export async function runAiOrchestrationPlanGate() {
2831
- const started = Date.now();
2832
- const tempDir = await mkdtemp(join(tmpdir(), 'enigma-ai-orchestration-audit-'));
2833
- const gate = {
2834
- name: 'ai-orchestration-plan',
2835
- required: false,
2836
- command: commandLabel(process.execPath, ['scripts/build-ai-orchestration-plan.mjs', '--status-board', '<production-status-board.json>']),
2837
- ok: true,
2838
- status: null,
2839
- signal: null,
2840
- duration_ms: 0,
2841
- evidence: {},
2842
- };
2843
- try {
2844
- if (!(await pathExists(PRODUCTION_WORKPLAN_SCRIPT)) || !(await pathExists(PRODUCTION_STATUS_BOARD_SCRIPT)) || !(await pathExists(AI_ORCHESTRATION_PLAN_SCRIPT))) {
2845
- gate.evidence = {
2846
- skipped: true,
2847
- reason: 'AI orchestration plan builder or its production fixture builders are absent in this local checkout.',
2848
- };
2849
- return gate;
2850
- }
2851
- const files = await writeProductionStatusBoardFixtureFiles(tempDir);
2852
- const statusBoard = parseJson(await readFile(files.statusBoard, 'utf8'));
2853
- if (statusBoard.schema !== 'enigma.production_status_board.v1') throw new Error('AI orchestration fixture status board emitted wrong schema.');
2854
- if (statusBoard.fresh_input_evidence !== true || statusBoard.input_freshness?.stale !== false) throw new Error('AI orchestration fixture status board must provide fresh input evidence.');
2855
- if (statusBoard.launch_ready === true) throw new Error('AI orchestration fixture status board must remain blocked.');
2856
- const { stdout, stderr, status } = await execFile(process.execPath, [
2857
- 'scripts/build-ai-orchestration-plan.mjs',
2858
- '--status-board',
2859
- files.statusBoard,
2860
- ], {
2861
- cwd: PROJECT_ROOT,
2862
- env: localOnlyEnv(),
2863
- timeout: COMMAND_TIMEOUT_MS,
2864
- maxBuffer: MAX_OUTPUT_BYTES,
2865
- windowsHide: true,
2866
- }).then((result) => ({ ...result, status: 0 })).catch((error) => {
2867
- if (Number.isInteger(error.code) && error.code === 1 && typeof error.stdout === 'string') return { stdout: error.stdout, stderr: error.stderr ?? '', status: 1 };
2868
- throw error;
2869
- });
2870
- gate.status = status;
2871
- gate.stderr_bytes = Buffer.byteLength(stderr);
2872
- gate.stdout_bytes = Buffer.byteLength(stdout);
2873
- if (status !== 1) throw new Error('AI orchestration plan blocked fixture must exit with status 1.');
2874
- const output = `${stdout}\n${stderr}`;
2875
- const tempPathNeedles = [tempDir, tempDir.replaceAll('\\', '\\\\'), tempDir.replaceAll('\\', '/')];
2876
- if (tempPathNeedles.some((needle) => output.toLowerCase().includes(needle.toLowerCase()))) throw new Error('AI orchestration plan output leaked a temporary fixture path.');
2877
- if (SECRET_LOOKING_OUTPUT.test(output)) throw new Error('AI orchestration plan output appears to contain a secret.');
2878
- if (output.includes(RAW_MEMORY_SENTINEL)) throw new Error('AI orchestration plan output leaked raw memory sentinel text.');
2879
- const parsed = parseJson(stdout);
2880
- if (parsed.schema !== AI_ORCHESTRATION_PLAN_SCHEMA) throw new Error('AI orchestration plan emitted wrong schema.');
2881
- if (parsed.status !== 'blocked' || parsed.launch_ready !== false) throw new Error('AI orchestration plan must remain blocked while status board launch_ready is false.');
2882
- if (parsed.source_status_fresh_input_evidence !== true) throw new Error('AI orchestration plan must preserve fresh source status evidence.');
2883
- if (parsed.source_status_board_generated_at !== statusBoard.generated_at) throw new Error('AI orchestration plan source timestamp must match the fixture status board.');
2884
- if (!Array.isArray(parsed.lanes) || parsed.lanes.length !== parsed.role_lane_count || parsed.role_lane_count < 5) throw new Error('AI orchestration plan role_lane_count does not match lanes.');
2885
- if (!Array.isArray(parsed.waves) || parsed.waves.length !== parsed.wave_count || parsed.wave_count !== 4) throw new Error('AI orchestration plan wave_count does not match waves.');
2886
- const laneIds = new Set(parsed.lanes.map((lane) => lane?.id));
2887
- if (!laneIds.has('kimi_coding') || !laneIds.has('gpt55_architecture') || !laneIds.has('gpt55_review')) throw new Error('AI orchestration plan must include Kimi and GPT lane names.');
2888
- const controlText = Array.isArray(parsed.non_delegable_controls) ? parsed.non_delegable_controls.join('\n') : '';
2889
- if (!/Cloudflare token values/i.test(controlText) || !/human-controlled/i.test(controlText) || !/No AI lane may mark the goal complete/i.test(controlText)) throw new Error('AI orchestration plan must preserve non-delegable human control boundaries.');
2890
- const claimBoundary = requireJsonField(
2891
- parsed,
2892
- ['claim_boundary'],
2893
- (value) => Array.isArray(value) && value.length >= 3 && value.every((item) => typeof item === 'string'),
2894
- 'AI orchestration plan must emit claim_boundary strings.',
2895
- );
2896
- const claimText = claimBoundary.join('\n');
2897
- if (!/does not invoke external AI systems/i.test(claimText) || !/not proof that an external model/i.test(claimText) || !/Launch readiness remains false/i.test(claimText)) throw new Error('AI orchestration plan claim boundary must prevent overclaiming launch readiness or model execution.');
2898
- gate.evidence = {
2899
- schema: parsed.schema,
2900
- status: parsed.status,
2901
- launch_ready: parsed.launch_ready === true,
2902
- source_status_fresh_input_evidence: parsed.source_status_fresh_input_evidence === true,
2903
- source_status_board_generated_at: parsed.source_status_board_generated_at,
2904
- role_lane_count: parsed.role_lane_count,
2905
- wave_count: parsed.wave_count,
2906
- kimi_lane_present: laneIds.has('kimi_coding'),
2907
- gpt_architecture_lane_present: laneIds.has('gpt55_architecture'),
2908
- gpt_review_lane_present: laneIds.has('gpt55_review'),
2909
- non_delegable_control_count: Array.isArray(parsed.non_delegable_controls) ? parsed.non_delegable_controls.length : null,
2910
- claim_boundary_count: claimBoundary.length,
2911
- temp_path_leaked: false,
2912
- };
2913
- } catch (error) {
2914
- gate.ok = false;
2915
- gate.status = Number.isInteger(error.code) ? error.code : (gate.status ?? 1);
2916
- gate.signal = error.signal ?? null;
2917
- gate.stderr_bytes = Buffer.byteLength(error.stderr ?? '');
2918
- gate.stdout_bytes = Buffer.byteLength(error.stdout ?? '');
2919
- const tempPathNeedles = [tempDir, tempDir.replaceAll('\\', '\\\\'), tempDir.replaceAll('\\', '/')];
2920
- let message = scrubLocalPathText(error instanceof Error ? error.message : String(error));
2921
- for (const needle of tempPathNeedles) message = replaceInsensitive(message, needle, '<temp-fixture>');
2922
- if (SECRET_LOOKING_OUTPUT.test(message)) message = 'AI orchestration plan failed with secret-looking output redacted.';
2923
- if (message.includes(RAW_MEMORY_SENTINEL)) message = 'AI orchestration plan failed with raw-memory sentinel output redacted.';
2924
- gate.error = {
2925
- code: error.killed ? 'COMMAND_TIMEOUT' : (error.code ?? 'AI_ORCHESTRATION_PLAN_FAILED'),
2926
- message,
2927
- };
2928
- } finally {
2929
- await rm(tempDir, { recursive: true, force: true });
2930
- gate.duration_ms = Date.now() - started;
2931
- }
2932
- return gate;
2933
- }
2934
2891
 
2935
2892
  function validateCloudflareOpsHelp(stdout) {
2936
2893
  const text = String(stdout);
@@ -5586,7 +5543,6 @@ export async function runReleaseAudit() {
5586
5543
  gates.push(await runProductionDependencyReportGate());
5587
5544
  gates.push(await runProductionWorkplanGate());
5588
5545
  gates.push(await runProductionStatusBoardGate());
5589
- gates.push(await runAiOrchestrationPlanGate());
5590
5546
  gates.push(await runProductionManifestValidatorGate());
5591
5547
  gates.push(await runProductionManifestSafetyGate());
5592
5548
  gates.push(await runInfrastructureReadinessGate());
@@ -21,6 +21,12 @@ const PUBLIC_SITE_MANIFEST_CANDIDATES = Object.freeze([
21
21
  ]);
22
22
  const KNOWN_SAFE_PATHS = new Set([
23
23
  'scripts/scan-secrets.mjs',
24
+ 'packages/rag/models/Xenova/all-MiniLM-L6-v2/config.json',
25
+ 'packages/rag/models/Xenova/all-MiniLM-L6-v2/tokenizer.json',
26
+ 'packages/rag/models/Xenova/all-MiniLM-L6-v2/tokenizer_config.json',
27
+ 'packages/rag/models/Xenova/all-MiniLM-L6-v2/onnx/model_quantized.onnx',
28
+ 'packages/rag/models/Xenova/all-MiniLM-L6-v2/sha256-manifest.json',
29
+ 'packages/rag/models/Xenova/all-MiniLM-L6-v2/THIRD_PARTY_LICENSES.txt',
24
30
  ]);
25
31
 
26
32