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.
- package/README.md +76 -24
- package/apps/cli/bin/enigma-desktop.mjs +140 -0
- package/apps/cli/bin/enigma-terminal.mjs +78 -0
- package/apps/cli/bin/enigma.mjs +1923 -285
- package/apps/desktop/electron-main.cjs +217 -0
- package/apps/desktop/package.json +12 -0
- package/apps/desktop/src/app.js +264 -7
- package/apps/desktop/src/index.html +3514 -1373
- package/apps/desktop/src/launch-electron.mjs +51 -0
- package/apps/desktop/src/server.mjs +2914 -0
- package/apps/desktop/src/styles.css +2972 -260
- package/apps/desktop/src/zk-browser-prove.mjs +53 -0
- package/apps/desktop/src/zk-state.mjs +1789 -0
- package/apps/gateway/bin/enigma-gateway.mjs +102 -5
- package/apps/gateway/src/server.mjs +271 -8
- package/apps/ios/EnigmaCore/Package.swift +12 -0
- package/apps/ios/EnigmaCore/Sources/EnigmaCore/EnigmaAPIClient.swift +227 -0
- package/apps/ios/EnigmaCore/Sources/EnigmaCore/Models.swift +278 -0
- package/apps/ios/EnigmaCore/Sources/EnigmaCore/PKCE.swift +96 -0
- package/apps/ios/EnigmaCore/Sources/EnigmaCore/PrivacyMinimizer.swift +187 -0
- package/apps/ios/EnigmaCore/Sources/EnigmaCore/ToolModels.swift +129 -0
- package/apps/ios/EnigmaCore/Tests/EnigmaCoreTests/EnigmaCoreTests.swift +42 -0
- package/apps/ios/EnigmaIOS/Enigma/AppModel.swift +346 -0
- package/apps/ios/EnigmaIOS/Enigma/Assets.xcassets/AccentColor.colorset/Contents.json +12 -0
- package/apps/ios/EnigmaIOS/Enigma/Assets.xcassets/AppIcon.appiconset/Contents.json +11 -0
- package/apps/ios/EnigmaIOS/Enigma/Assets.xcassets/AppIcon.appiconset/EnigmaAppIcon.png +0 -0
- package/apps/ios/EnigmaIOS/Enigma/Assets.xcassets/Contents.json +3 -0
- package/apps/ios/EnigmaIOS/Enigma/Assets.xcassets/LaunchBackground.colorset/Contents.json +12 -0
- package/apps/ios/EnigmaIOS/Enigma/ChatView.swift +181 -0
- package/apps/ios/EnigmaIOS/Enigma/CouncilView.swift +78 -0
- package/apps/ios/EnigmaIOS/Enigma/CreateView.swift +152 -0
- package/apps/ios/EnigmaIOS/Enigma/EnigmaApp.swift +52 -0
- package/apps/ios/EnigmaIOS/Enigma/Info.plist +52 -0
- package/apps/ios/EnigmaIOS/Enigma/NaturalLanguagePrivacyTagger.swift +26 -0
- package/apps/ios/EnigmaIOS/Enigma/OAuthClient.swift +321 -0
- package/apps/ios/EnigmaIOS/Enigma/OnboardingView.swift +105 -0
- package/apps/ios/EnigmaIOS/Enigma/PrivateVaultView.swift +275 -0
- package/apps/ios/EnigmaIOS/Enigma/SecureStore.swift +76 -0
- package/apps/ios/EnigmaIOS/Enigma/SettingsView.swift +60 -0
- package/apps/ios/EnigmaIOS/Enigma/Theme.swift +80 -0
- package/apps/ios/EnigmaIOS/EnigmaIOS.xcodeproj/project.pbxproj +211 -0
- package/apps/ios/EnigmaIOS/EnigmaIOS.xcodeproj/xcshareddata/xcschemes/Enigma.xcscheme +23 -0
- package/apps/native-host/README.md +19 -8
- package/apps/native-host/bin/enigma-native-host.mjs +229 -13
- package/apps/relay/bin/enigma-relay.mjs +103 -5
- package/apps/relay/src/federation-runtime.mjs +618 -0
- package/apps/relay/src/server.mjs +310 -9
- package/apps/verifier/bin/enigma-verify.mjs +327 -11
- package/cortex-v3/circuits/build/intent_vk_bytes.json +35 -0
- package/cortex-v3/circuits/build/sale_vk_bytes.json +35 -0
- package/cortex-v3/circuits/build/vk_bytes.json +32 -0
- package/cortex-v3/proving-assets.json +64 -0
- package/cortex-v3/zk/BUILD-CONTRACT.md +87 -0
- package/cortex-v3/zk/action-transition-vk.json +119 -0
- package/cortex-v3/zk/alias-adversarial.test.mjs +220 -0
- package/cortex-v3/zk/groth16-verify-child.mjs +17 -0
- package/cortex-v3/zk/intent-witness.mjs +365 -0
- package/cortex-v3/zk/intent-witness.test.mjs +485 -0
- package/cortex-v3/zk/proving-assets.mjs +203 -0
- package/cortex-v3/zk/sale-witness.mjs +783 -0
- package/cortex-v3/zk/sale-witness.test.mjs +784 -0
- package/cortex-v3/zk/sealed-sale-release-vk.json +119 -0
- package/cortex-v3/zk/settlement-evidence.mjs +722 -0
- package/cortex-v3/zk/setup-intent.mjs +688 -0
- package/cortex-v3/zk/setup-sale.mjs +666 -0
- package/cortex-v3/zk/setup.mjs +594 -0
- package/cortex-v3/zk/witness.mjs +184 -0
- package/cortex-v3/zk/zk-codec.mjs +232 -0
- package/cortex-v3/zk/zk-codec.test.mjs +293 -0
- package/cortex-v3/zk/zk-settle.mjs +370 -0
- package/cortex-v3/zk/zk-tree.mjs +256 -0
- package/cortex-v3/zk/zk-tree.test.mjs +419 -0
- package/deploy/docker-compose.local-production-simulation.yml +36 -0
- package/docs/browser-extension-install.md +8 -6
- package/docs/client-connectors.md +15 -11
- package/docs/developer-ecosystem.md +15 -13
- package/docs/enigma-memory-ready-conformance.md +11 -9
- package/docs/install-anywhere.md +61 -28
- package/docs/installers-and-desktop.md +8 -7
- package/docs/novelty-invention-candidates.md +161 -161
- package/docs/proof-network-claim-boundaries.md +320 -318
- package/examples/01-quickstart-agent/index.mjs +49 -0
- package/examples/01_agent_memory_quickstart.mjs +57 -0
- package/examples/02-multi-agent-swarm/index.mjs +57 -0
- package/examples/02_cross_model_passport.mjs +64 -0
- package/examples/03-langchain-memory/index.mjs +41 -0
- package/examples/03_poseidon_commitment_verification.mjs +71 -0
- package/examples/04-python-trading-agent/trader.py +49 -0
- package/examples/README.md +27 -0
- package/examples/ci/github-actions.yml +7 -2
- package/package.json +142 -11
- package/packages/adapters/PACKAGE_CONTRACT.md +1 -1
- package/packages/connectors/src/index.js +196 -4
- package/packages/connectors/swarm-router.mjs +168 -0
- package/packages/core/src/index.js +248 -1
- package/packages/core/src/version.mjs +7 -0
- package/packages/dev-tools/package.json +19 -0
- package/packages/dev-tools/src/index.js +4 -0
- package/packages/dev-tools/src/memory-benchmark-suite.js +112 -0
- package/packages/dev-tools/src/swarm-simulator.js +101 -0
- package/packages/dev-tools/src/vault-inspector.js +114 -0
- package/packages/dev-tools/src/vector-benchmark.js +100 -0
- package/packages/developer-platform/src/access-credentials.js +341 -0
- package/packages/developer-platform/src/http.js +132 -0
- package/packages/developer-platform/src/index.js +4 -0
- package/packages/developer-platform/src/usage-http.js +60 -0
- package/packages/developer-platform/src/usage.js +295 -0
- package/packages/enclave-runtime/attestation.mjs +159 -0
- package/packages/enclave-runtime/index.mjs +47 -0
- package/packages/enclave-runtime/session-manager.mjs +253 -0
- package/packages/enclave-runtime/zeroization-proof.mjs +227 -0
- package/packages/enigma-reflex/package.json +14 -0
- package/packages/enigma-reflex/src/index.js +204 -0
- package/packages/enigma-reflex/training/generate-dataset.mjs +40 -0
- package/packages/enigma-reflex/training/requirements.txt +8 -0
- package/packages/enigma-reflex/training/train.py +314 -0
- package/packages/enigma-weave/LICENSE +22 -0
- package/packages/enigma-weave/UPSTREAM.json +21 -0
- package/packages/enigma-weave/package.json +14 -0
- package/packages/enigma-weave/src/index.js +286 -0
- package/packages/hosted-cloud/src/index.js +80 -5
- package/packages/importers/src/index.js +432 -0
- package/packages/inference-runtime/src/browser.js +401 -0
- package/packages/inference-runtime/src/chat.js +265 -0
- package/packages/inference-runtime/src/code.js +407 -0
- package/packages/inference-runtime/src/contracts.js +162 -0
- package/packages/inference-runtime/src/http.js +232 -0
- package/packages/inference-runtime/src/image.js +186 -0
- package/packages/inference-runtime/src/index.js +10 -0
- package/packages/inference-runtime/src/model-router.js +320 -0
- package/packages/inference-runtime/src/platform.js +125 -0
- package/packages/inference-runtime/src/privacy.js +400 -0
- package/packages/inference-runtime/src/video.js +253 -0
- package/packages/mcp-server/README.md +22 -6
- package/packages/mcp-server/bin/enigma-mcp.mjs +2 -1
- package/packages/mcp-server/src/index.js +1418 -105
- package/packages/mcp-server/src/oauth.js +561 -0
- package/packages/mcp-server/src/private-handoff.js +84 -0
- package/packages/mcp-server/src/remote-http.js +273 -0
- package/packages/mcp-server/src/remote-policy.js +72 -0
- package/packages/mcp-server/swarm-bridge.mjs +361 -0
- package/packages/mesh/index.d.ts +283 -0
- package/packages/mesh/package.json +23 -0
- package/packages/mesh/src/crypto.js +189 -0
- package/packages/mesh/src/federation-packets.js +353 -0
- package/packages/mesh/src/gossip.js +311 -0
- package/packages/mesh/src/index.js +6 -0
- package/packages/mesh/src/protocol.js +255 -0
- package/packages/mesh/src/router.js +279 -0
- package/packages/mesh/src/transport.js +306 -0
- package/packages/passport/src/index.js +426 -1
- package/packages/private-economy/src/credits-http.js +100 -0
- package/packages/private-economy/src/credits.js +447 -0
- package/packages/private-economy/src/index.js +5 -0
- package/packages/private-economy/src/payments-http.js +120 -0
- package/packages/private-economy/src/payments.js +509 -0
- package/packages/private-economy/src/x402.js +346 -0
- package/packages/proof-network/PACKAGE_CONTRACT.md +21 -0
- package/packages/rag/index.d.ts +182 -0
- package/packages/rag/models/Xenova/all-MiniLM-L6-v2/THIRD_PARTY_LICENSES.txt +207 -0
- package/packages/rag/models/Xenova/all-MiniLM-L6-v2/config.json +25 -0
- package/packages/rag/models/Xenova/all-MiniLM-L6-v2/onnx/model_quantized.onnx +0 -0
- package/packages/rag/models/Xenova/all-MiniLM-L6-v2/sha256-manifest.json +28 -0
- package/packages/rag/models/Xenova/all-MiniLM-L6-v2/tokenizer.json +30686 -0
- package/packages/rag/models/Xenova/all-MiniLM-L6-v2/tokenizer_config.json +15 -0
- package/packages/rag/package.json +27 -0
- package/packages/rag/src/blinded-search.js +109 -0
- package/packages/rag/src/bm25.js +169 -0
- package/packages/rag/src/embeddings.js +459 -0
- package/packages/rag/src/hybrid.js +76 -0
- package/packages/rag/src/index.js +38 -0
- package/packages/rag/src/reranker.js +61 -0
- package/packages/rag/src/research.js +107 -0
- package/packages/rag/src/vector-store.js +430 -0
- package/packages/rag/src/verify-model-artifacts.mjs +4 -0
- package/packages/sdk/index.d.ts +760 -0
- package/packages/sdk/package.json +33 -0
- package/packages/sdk/python/README.md +24 -0
- package/packages/sdk/python/enigma_sdk.py +250 -0
- package/packages/sdk/python/pyproject.toml +34 -0
- package/packages/sdk/python/requirements.txt +1 -0
- package/packages/sdk/python/setup.py +20 -0
- package/packages/sdk/src/federation/capability-grant.js +389 -0
- package/packages/sdk/src/federation/federation-router.js +360 -0
- package/packages/sdk/src/federation/ghostmesh-bridge.js +497 -0
- package/packages/sdk/src/federation/index.js +3 -0
- package/packages/sdk/src/index.js +1796 -0
- package/packages/sdk/src/intelligence/contradiction.js +337 -0
- package/packages/sdk/src/intelligence/decision-engine.js +155 -0
- package/packages/sdk/src/intelligence/index.js +4 -0
- package/packages/sdk/src/intelligence/ontology.js +122 -0
- package/packages/sdk/src/intelligence/temporal.js +123 -0
- package/packages/sdk/src/market-client.js +142 -0
- package/packages/sdk/src/mesh-client.js +110 -0
- package/packages/sdk/src/middleware/index.js +3 -0
- package/packages/sdk/src/middleware/langchain.js +159 -0
- package/packages/sdk/src/middleware/llamaindex.js +101 -0
- package/packages/sdk/src/middleware/vercel-ai.js +112 -0
- package/packages/sdk/src/rag-client.js +85 -0
- package/packages/sdk/src/swarm-orchestrator.js +260 -0
- package/packages/settlement/PACKAGE_CONTRACT.md +1 -1
- package/packages/snapcompact/THIRD_PARTY_LICENSES.txt +40 -0
- package/packages/snapcompact/assets/8x13-latin1.bdf +3837 -0
- package/packages/snapcompact/index.d.ts +284 -0
- package/packages/snapcompact/package.json +25 -0
- package/packages/snapcompact/src/index.js +716 -0
- package/packages/storage/PACKAGE_CONTRACT.md +1 -1
- package/packages/terminal-console/animations.mjs +240 -0
- package/packages/terminal-console/auto-anchor.mjs +220 -0
- package/packages/terminal-console/banner.mjs +91 -0
- package/packages/terminal-console/commands.mjs +459 -0
- package/packages/terminal-console/delegation.mjs +152 -0
- package/packages/terminal-console/index.mjs +5 -0
- package/packages/terminal-console/outbox.mjs +143 -0
- package/packages/terminal-console/phantom-bridge.mjs +637 -0
- package/packages/terminal-console/repl.mjs +136 -0
- package/packages/terminal-console/signer-store.mjs +130 -0
- package/packages/terminal-console/solana-rpc.mjs +214 -0
- package/packages/terminal-console/solana-transport.mjs +189 -0
- package/packages/terminal-tui/dashboard.mjs +214 -0
- package/packages/terminal-tui/index.mjs +28 -0
- package/packages/terminal-tui/merkle-tree-renderer.mjs +268 -0
- package/packages/terminal-tui/telemetry-hud.mjs +137 -0
- package/packages/vault/index.d.ts +449 -0
- package/packages/vault/package.json +27 -0
- package/packages/vault/src/e2ee.mjs +393 -0
- package/packages/vault/src/enclave.js +481 -0
- package/packages/vault/src/erasure.js +207 -0
- package/packages/vault/src/index.js +1018 -155
- package/packages/vault/src/persistence.js +307 -0
- package/packages/vault/src/poseidon.js +354 -0
- package/packages/vault/src/receipt.js +459 -0
- package/scripts/benchmark-optical-context.mjs +166 -0
- package/scripts/bootstrap-enigma.mjs +502 -0
- package/scripts/build-edge-backend-workers.mjs +20 -5
- package/scripts/build-goal-completion-audit.mjs +72 -25
- package/scripts/build-hosted-api-key-lifecycle.mjs +26 -8
- package/scripts/build-hosted-customer-lifecycle.mjs +20 -3
- package/scripts/build-hosted-probe-worker.mjs +19 -4
- package/scripts/build-installer-assets.mjs +41 -21
- package/scripts/build-operator-evidence-starter.mjs +59 -1
- package/scripts/build-production-backend-env-kit.mjs +2 -0
- package/scripts/build-production-unblocker.mjs +3 -0
- package/scripts/check.mjs +17 -3
- package/scripts/collect-hosted-backend-live-evidence.mjs +49 -12
- package/scripts/install-enigma-local.mjs +18 -5
- package/scripts/release-audit.mjs +65 -109
- package/scripts/release-provenance.mjs +6 -0
- package/scripts/run-backend-readiness-smoke.mjs +112 -10
- package/scripts/scan-secrets.mjs +1 -0
- package/scripts/simulate-production-env.mjs +7 -2
- package/scripts/validate-hosted-backend-live.mjs +112 -1
- package/specs/antibody-pack-v1.schema.json +95 -0
- package/specs/antigen-envelope-v1.schema.json +81 -0
- package/specs/boundary-manifest-v1.schema.json +35 -35
- package/specs/capsule-v1.schema.json +55 -55
- package/specs/claim-boundary-manifest-v1.schema.json +22 -22
- package/specs/claim-ledger-v1.schema.json +291 -0
- package/specs/context-passport-v1.schema.json +59 -0
- package/specs/deletion-tombstone-v1.schema.json +26 -26
- package/specs/evidence-packet-v1.schema.json +177 -0
- package/specs/hosted-backend-live-evidence-v1.schema.json +72 -3
- package/specs/immune-scan-report-v1.schema.json +112 -0
- package/specs/lifecycle-receipt-log-v1.schema.json +67 -0
- package/specs/memory-atom-v1.schema.json +59 -0
- package/specs/memory-event-v1.schema.json +42 -42
- package/specs/passport-v1.schema.json +50 -50
- package/specs/proof-of-non-use-v1.schema.json +65 -0
- package/specs/quarantine-record-v1.schema.json +126 -0
- package/specs/receipt-v1.schema.json +61 -61
- package/specs/state-checkpoint-v1.schema.json +37 -37
- package/specs/trust-bundle-v1.schema.json +56 -56
- package/specs/trust-card-v1.schema.json +119 -0
- package/docs/proof-network-launch-plan.md +0 -421
- package/packages/metering/PACKAGE_CONTRACT.md +0 -20
- package/scripts/build-ai-orchestration-plan.mjs +0 -248
|
@@ -5,7 +5,12 @@ import { pathToFileURL } from 'node:url';
|
|
|
5
5
|
import { buildProductionHandoffPacket } from './build-production-handoff-packet.mjs';
|
|
6
6
|
import { buildCloudflareTokenPolicy } from './build-cloudflare-token-policy.mjs';
|
|
7
7
|
import { runBackendReadinessSmoke } from './run-backend-readiness-smoke.mjs';
|
|
8
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
HOSTED_BACKEND_LIVE_EVIDENCE_SCHEMA,
|
|
10
|
+
HOSTED_BACKEND_LIVE_RESULT_SCHEMA,
|
|
11
|
+
REQUIRED_REF_KEYS,
|
|
12
|
+
validateHostedBackendLiveEvidence,
|
|
13
|
+
} from './validate-hosted-backend-live.mjs';
|
|
9
14
|
import { validateProductionManifestFiles } from './validate-production-manifests.mjs';
|
|
10
15
|
import { applyCloudflareSecretEnvFile } from './cloudflare-secret-env.mjs';
|
|
11
16
|
|
|
@@ -29,7 +34,7 @@ function assertNoUnsafeOutput(name, value, path = name) {
|
|
|
29
34
|
}
|
|
30
35
|
}
|
|
31
36
|
|
|
32
|
-
const DEFAULT_OBJECTIVE = 'Build Enigma Memory into a production-grade project with backend infrastructure, tests, professional math/diagram whitepaper, secure public site, deployment/handoff plan,
|
|
37
|
+
const DEFAULT_OBJECTIVE = 'Build Enigma Memory into a production-grade project with backend infrastructure, tests, professional math/diagram whitepaper, secure public site, and a deployment/handoff plan, without unsupported claims.';
|
|
33
38
|
|
|
34
39
|
class UsageError extends Error {
|
|
35
40
|
constructor(message) {
|
|
@@ -67,6 +72,45 @@ function expandHostedBackendBlockers(infra) {
|
|
|
67
72
|
}
|
|
68
73
|
return blockers;
|
|
69
74
|
}
|
|
75
|
+
async function hostedBackendLiveSummary(input, generatedAt) {
|
|
76
|
+
const supplied = input && typeof input === 'object'
|
|
77
|
+
? input
|
|
78
|
+
: await readJsonPath(input, 'hosted backend live evidence');
|
|
79
|
+
if (supplied === null) {
|
|
80
|
+
return {
|
|
81
|
+
ok: false,
|
|
82
|
+
status: 'missing',
|
|
83
|
+
blocker_paths: ['hosted_backend_live_evidence'],
|
|
84
|
+
checked: null,
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
const result = supplied.schema === HOSTED_BACKEND_LIVE_EVIDENCE_SCHEMA
|
|
88
|
+
? validateHostedBackendLiveEvidence(supplied, { generated_at: generatedAt })
|
|
89
|
+
: supplied;
|
|
90
|
+
if (result.schema !== HOSTED_BACKEND_LIVE_RESULT_SCHEMA) {
|
|
91
|
+
throw new UsageError(`hosted backend live input must use schema ${HOSTED_BACKEND_LIVE_EVIDENCE_SCHEMA} or ${HOSTED_BACKEND_LIVE_RESULT_SCHEMA}`);
|
|
92
|
+
}
|
|
93
|
+
const blockerPaths = Array.isArray(result.blockers)
|
|
94
|
+
? result.blockers.map((entry) => entry?.path).filter((path) => typeof path === 'string')
|
|
95
|
+
: ['blockers'];
|
|
96
|
+
if (result.checked?.refs_missing !== 0) blockerPaths.push('checked.refs_missing');
|
|
97
|
+
if (result.checked?.probes_covered !== 4) blockerPaths.push('checked.probes_covered');
|
|
98
|
+
if (result.checked?.runtime_services_covered !== 2) blockerPaths.push('checked.runtime_services_covered');
|
|
99
|
+
if (result.checked?.authenticated_data_plane_proofs_covered !== 2) blockerPaths.push('checked.authenticated_data_plane_proofs_covered');
|
|
100
|
+
if (result.ok !== true || result.status !== 'accepted') blockerPaths.push('status');
|
|
101
|
+
return {
|
|
102
|
+
ok: blockerPaths.length === 0,
|
|
103
|
+
status: result.status,
|
|
104
|
+
blocker_paths: [...new Set(blockerPaths)],
|
|
105
|
+
checked: {
|
|
106
|
+
refs_missing: result.checked?.refs_missing ?? null,
|
|
107
|
+
probes_covered: result.checked?.probes_covered ?? null,
|
|
108
|
+
runtime_services_covered: result.checked?.runtime_services_covered ?? null,
|
|
109
|
+
authenticated_data_plane_proofs_covered: result.checked?.authenticated_data_plane_proofs_covered ?? null,
|
|
110
|
+
},
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
|
|
70
114
|
|
|
71
115
|
function parseArgs(argv) {
|
|
72
116
|
const out = {
|
|
@@ -82,6 +126,7 @@ function parseArgs(argv) {
|
|
|
82
126
|
operatorAcceptancePacket: null,
|
|
83
127
|
infrastructureReadiness: null,
|
|
84
128
|
releaseAudit: null,
|
|
129
|
+
hostedBackendLive: null,
|
|
85
130
|
workerInspect: null,
|
|
86
131
|
};
|
|
87
132
|
for (let index = 0; index < argv.length;) {
|
|
@@ -103,6 +148,7 @@ function parseArgs(argv) {
|
|
|
103
148
|
else if (token === '--cloudflare-env-file') out.envFile = readValue(token);
|
|
104
149
|
else if (token === '--operator-acceptance-packet' || token === '--operatorAcceptancePacket') out.operatorAcceptancePacket = readValue(token);
|
|
105
150
|
else if (token === '--infrastructure-readiness' || token === '--infrastructureReadiness') out.infrastructureReadiness = readValue(token);
|
|
151
|
+
else if (token === '--hosted-backend-live' || token === '--hostedBackendLive') out.hostedBackendLive = readValue(token);
|
|
106
152
|
else if (token === '--release-audit' || token === '--releaseAudit') out.releaseAudit = readValue(token);
|
|
107
153
|
else if (token === '--worker-inspect' || token === '--workerInspect') out.workerInspect = readValue(token);
|
|
108
154
|
else if (token === '--out') out.out = readValue(token);
|
|
@@ -112,7 +158,7 @@ function parseArgs(argv) {
|
|
|
112
158
|
}
|
|
113
159
|
|
|
114
160
|
function usage() {
|
|
115
|
-
return `Usage: node scripts/build-goal-completion-audit.mjs --site <dir> [options]\n\nOptions:\n --project-name <name> Cloudflare Pages project. Default: enigma-memory.\n --domain <host> Public domain. Default: enigmamemory.com.\n --live-url <url> Current public URL to observe. Default: https://enigmamemory.com/.\n --expect-title <text> Expected live title fragment. Default: Enigma.\n --account-id <id> Cloudflare account id or placeholder for token-policy evidence.\n --infrastructure-readiness <file> Completed infrastructure readiness JSON to summarize.\n --operator-acceptance-packet <file> Completed operator packet JSON to validate and summarize.\n --release-audit <file> Current release audit JSON to summarize.\n --worker-inspect <file> Optional Worker inspection result; ready evidence suppresses the standalone probe action.\n --cloudflare-env-file <file> Load local Cloudflare env values without printing the path or values.\n --objective <text> Override objective text.\n --out <file> Write audit JSON.\n --help Show this help.\n`;
|
|
161
|
+
return `Usage: node scripts/build-goal-completion-audit.mjs --site <dir> [options]\n\nOptions:\n --project-name <name> Cloudflare Pages project. Default: enigma-memory.\n --domain <host> Public domain. Default: enigmamemory.com.\n --live-url <url> Current public URL to observe. Default: https://enigmamemory.com/.\n --expect-title <text> Expected live title fragment. Default: Enigma.\n --account-id <id> Cloudflare account id or placeholder for token-policy evidence.\n --infrastructure-readiness <file> Completed infrastructure readiness JSON to summarize.\n --hosted-backend-live <file> Strict hosted evidence/result with runtime and authenticated data-plane proofs.\n --operator-acceptance-packet <file> Completed operator packet JSON to validate and summarize.\n --release-audit <file> Current release audit JSON to summarize.\n --worker-inspect <file> Optional Worker inspection result; ready evidence suppresses the standalone probe action.\n --cloudflare-env-file <file> Load local Cloudflare env values without printing the path or values.\n --objective <text> Override objective text.\n --out <file> Write audit JSON.\n --help Show this help.\n`;
|
|
116
162
|
}
|
|
117
163
|
|
|
118
164
|
async function readText(path) {
|
|
@@ -148,31 +194,23 @@ function blockerBreakdownLines(prefix, breakdown) {
|
|
|
148
194
|
}
|
|
149
195
|
|
|
150
196
|
async function inspectDocs() {
|
|
151
|
-
const masterPlan = await readText(resolve('docs/overnight-build-master-plan.md'));
|
|
152
197
|
const whitepaper = await readText(resolve('docs/enigma-memory-technical-whitepaper.md'));
|
|
153
198
|
const evidence = await readText(resolve('docs/release-evidence-2026-06-23.md'));
|
|
199
|
+
const claimBoundaries = await readText(resolve('docs/proof-network-claim-boundaries.md'));
|
|
154
200
|
return {
|
|
155
|
-
masterPlan,
|
|
156
201
|
whitepaper,
|
|
157
202
|
evidence,
|
|
203
|
+
claimBoundaries,
|
|
158
204
|
};
|
|
159
205
|
}
|
|
160
206
|
|
|
161
|
-
function deliverablesFromEvidence({ docs, handoff, tokenPolicy, backendSmoke, productionManifests }) {
|
|
207
|
+
function deliverablesFromEvidence({ docs, handoff, tokenPolicy, backendSmoke, productionManifests, hostedBackendLive }) {
|
|
162
208
|
const pages = handoff.pages ?? {};
|
|
163
209
|
const infra = handoff.infrastructure ?? {};
|
|
164
210
|
const operator = handoff.operator_acceptance ?? {};
|
|
165
211
|
const releaseAudit = handoff.release_audit ?? {};
|
|
166
212
|
const releaseGateNames = new Set(Array.isArray(releaseAudit.gate_names) ? releaseAudit.gate_names : []);
|
|
167
213
|
const deliverables = [];
|
|
168
|
-
deliverables.push({
|
|
169
|
-
id: 'orchestration-master-plan',
|
|
170
|
-
requirement: 'Architecture/review owner and implementation-owner plan exists with claim boundaries and handoff cadence.',
|
|
171
|
-
...boolEvidence(
|
|
172
|
-
/GPT-5\.5 owns architecture, design, and review/.test(docs.masterPlan) && /Kimi Code owns implementation/.test(docs.masterPlan),
|
|
173
|
-
['docs/overnight-build-master-plan.md'],
|
|
174
|
-
),
|
|
175
|
-
});
|
|
176
214
|
deliverables.push({
|
|
177
215
|
id: 'whitepaper-math-diagrams',
|
|
178
216
|
requirement: 'Professional whitepaper contains math and diagrams for the memory layer and its evidence-bounded comparison framework.',
|
|
@@ -211,9 +249,9 @@ function deliverablesFromEvidence({ docs, handoff, tokenPolicy, backendSmoke, pr
|
|
|
211
249
|
backendSmoke.ok === true
|
|
212
250
|
&& backendSmoke.check_count === 4
|
|
213
251
|
&& backendSmoke.checks?.filter((check) => check.mode === 'production-fail-closed' && check.readyz_status === 503).length === 2
|
|
214
|
-
&& backendSmoke.checks?.filter((check) => check.mode === 'production-
|
|
252
|
+
&& backendSmoke.checks?.filter((check) => check.mode === 'production-operational-fixture' && check.readyz_status === 200 && check.readyz_missing_evidence_ref_count === 0 && check.readyz_all_checks_ok === true).length === 2,
|
|
215
253
|
['npm run production:backend-smoke', `${backendSmoke.check_count} checks`],
|
|
216
|
-
['backend readiness smoke did not prove fail-closed and
|
|
254
|
+
['backend readiness smoke did not prove fail-closed and explicit operational local runtime fixtures'],
|
|
217
255
|
),
|
|
218
256
|
});
|
|
219
257
|
deliverables.push({
|
|
@@ -231,7 +269,7 @@ function deliverablesFromEvidence({ docs, handoff, tokenPolicy, backendSmoke, pr
|
|
|
231
269
|
});
|
|
232
270
|
deliverables.push({
|
|
233
271
|
id: 'hosted-live-evidence-contract',
|
|
234
|
-
requirement: 'Hosted backend live evidence has a formal validator/schema requiring public HTTPS relay/gateway
|
|
272
|
+
requirement: 'Hosted backend live evidence has a formal validator/schema requiring public HTTPS health probes, explicit operational runtime capability, authenticated relay/gateway private data-plane proofs, all hosted refs, and operator acceptance go.',
|
|
235
273
|
...boolEvidence(
|
|
236
274
|
HOSTED_BACKEND_LIVE_EVIDENCE_SCHEMA === 'enigma.hosted_backend_live_evidence.v1'
|
|
237
275
|
&& HOSTED_BACKEND_LIVE_RESULT_SCHEMA === 'enigma.hosted_backend_live_result.v1'
|
|
@@ -280,11 +318,17 @@ function deliverablesFromEvidence({ docs, handoff, tokenPolicy, backendSmoke, pr
|
|
|
280
318
|
});
|
|
281
319
|
deliverables.push({
|
|
282
320
|
id: 'hosted-backend-live',
|
|
283
|
-
requirement: 'Hosted relay/gateway/storage/KMS/SIEM/backup/operator infrastructure is live and
|
|
321
|
+
requirement: 'Hosted relay/gateway/storage/KMS/SIEM/backup/operator infrastructure is live with explicit operational runtime capability and authenticated private data-plane proofs.',
|
|
284
322
|
...boolEvidence(
|
|
285
|
-
infra.hosted_live_ready === true,
|
|
286
|
-
[
|
|
287
|
-
|
|
323
|
+
infra.hosted_live_ready === true && hostedBackendLive.ok === true,
|
|
324
|
+
[
|
|
325
|
+
'npm run infrastructure:readiness -- --manifest <completed> --live --cloudflare-live required',
|
|
326
|
+
'npm run production:hosted-live -- --evidence <completed-hosted-evidence.json>',
|
|
327
|
+
],
|
|
328
|
+
[
|
|
329
|
+
...expandHostedBackendBlockers(infra),
|
|
330
|
+
...hostedBackendLive.blocker_paths.map((path) => `hosted evidence blocker path: ${path}`),
|
|
331
|
+
],
|
|
288
332
|
),
|
|
289
333
|
});
|
|
290
334
|
deliverables.push({
|
|
@@ -300,8 +344,9 @@ function deliverablesFromEvidence({ docs, handoff, tokenPolicy, backendSmoke, pr
|
|
|
300
344
|
id: 'unsupported-claims-blocked',
|
|
301
345
|
requirement: '$100B/best-in-world ambition is treated as ambition; collateral does not convert it into unsupported proof, ROI, compliance, or hosted-live claims.',
|
|
302
346
|
...boolEvidence(
|
|
303
|
-
/unsupported_market_superlative/.test(docs.evidence) || /unsupported superlatives/.test(docs.evidence)
|
|
304
|
-
|
|
347
|
+
/unsupported_market_superlative/.test(docs.evidence) || /unsupported superlatives/.test(docs.evidence)
|
|
348
|
+
|| /market leadership/i.test(docs.claimBoundaries ?? '') || /unsupported superlatives/i.test(docs.claimBoundaries ?? ''),
|
|
349
|
+
['docs/release-evidence-2026-06-23.md', 'docs/proof-network-claim-boundaries.md'],
|
|
305
350
|
['claim-boundary evidence missing unsupported-superlative controls'],
|
|
306
351
|
),
|
|
307
352
|
});
|
|
@@ -318,6 +363,7 @@ export async function buildGoalCompletionAudit(input = {}, options = {}) {
|
|
|
318
363
|
const expectTitle = optionalText(input.expectTitle, 'Enigma');
|
|
319
364
|
const accountId = optionalText(input.accountId, '<cloudflare-account-id>');
|
|
320
365
|
const workerInspect = await readJsonPath(input.workerInspect, 'worker inspection');
|
|
366
|
+
const hostedBackendLive = await hostedBackendLiveSummary(input.hostedBackendLive, generatedAt);
|
|
321
367
|
const docs = await inspectDocs();
|
|
322
368
|
const handoff = await buildProductionHandoffPacket({ site, projectName, domain, liveUrl, expectTitle, infrastructureReadiness: input.infrastructureReadiness, operatorAcceptancePacket: input.operatorAcceptancePacket, releaseAudit: input.releaseAudit }, {
|
|
323
369
|
env,
|
|
@@ -335,7 +381,7 @@ export async function buildGoalCompletionAudit(input = {}, options = {}) {
|
|
|
335
381
|
generated_at: generatedAt,
|
|
336
382
|
});
|
|
337
383
|
const productionManifests = await validateProductionManifestFiles({ generated_at: generatedAt });
|
|
338
|
-
const deliverables = deliverablesFromEvidence({ docs, handoff, tokenPolicy, backendSmoke, productionManifests });
|
|
384
|
+
const deliverables = deliverablesFromEvidence({ docs, handoff, tokenPolicy, backendSmoke, productionManifests, hostedBackendLive });
|
|
339
385
|
const blockers = deliverables.flatMap((item) => item.ok ? [] : item.blockers.map((blocker) => `${item.id}: ${blocker}`));
|
|
340
386
|
const deliverableById = new Map(deliverables.map((item) => [item.id, item]));
|
|
341
387
|
const staticSiteLive = deliverableById.get('secure-static-site-artifact')?.ok === true
|
|
@@ -357,6 +403,7 @@ export async function buildGoalCompletionAudit(input = {}, options = {}) {
|
|
|
357
403
|
check_count: backendSmoke.check_count,
|
|
358
404
|
loopback_only: backendSmoke.loopback_only,
|
|
359
405
|
},
|
|
406
|
+
hosted_backend_live_evidence: hostedBackendLive,
|
|
360
407
|
production_manifest_validation: {
|
|
361
408
|
ok: productionManifests.ok,
|
|
362
409
|
status: productionManifests.status,
|
|
@@ -367,7 +414,7 @@ export async function buildGoalCompletionAudit(input = {}, options = {}) {
|
|
|
367
414
|
next_actions: nextActionsForGoalAudit(handoff.next_actions, workerInspect),
|
|
368
415
|
claim_boundary: [
|
|
369
416
|
'This audit preserves the original objective and maps it to current direct evidence.',
|
|
370
|
-
'complete:false remains expected until hosted backend, operator acceptance, and provider evidence exist; static Cloudflare Pages deploy alone
|
|
417
|
+
'complete:false remains expected until hosted backend runtime capability, authenticated relay/gateway private data-plane proofs, operator acceptance, and provider evidence exist; health probes or static Cloudflare Pages deploy alone are not enough.',
|
|
371
418
|
'Ambition language is not treated as proof of market value, ROI, compliance status, benchmark leadership, hosted-live readiness, provider deletion, or model forgetting.',
|
|
372
419
|
],
|
|
373
420
|
};
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
} from '../packages/hosted-cloud/src/index.js';
|
|
14
14
|
|
|
15
15
|
export const HOSTED_API_KEY_LIFECYCLE_PACKET_SCHEMA = HOSTED_CLOUD_API_KEY_LIFECYCLE_PACKET_SCHEMA;
|
|
16
|
-
export const HOSTED_API_KEY_LIFECYCLE_RELEASE_TARGET = '0.1.
|
|
16
|
+
export const HOSTED_API_KEY_LIFECYCLE_RELEASE_TARGET = '0.1.20';
|
|
17
17
|
|
|
18
18
|
const PROVIDED = 'provided';
|
|
19
19
|
const BLOCKED = 'blocked_external_dependency';
|
|
@@ -148,6 +148,22 @@ function keyInputsFor({ operation, tenantId, subjectRef, scopes, generatedAt, ev
|
|
|
148
148
|
return inputs;
|
|
149
149
|
}
|
|
150
150
|
|
|
151
|
+
function canonicalize(value) {
|
|
152
|
+
if (Array.isArray(value)) return value.map(canonicalize);
|
|
153
|
+
if (value !== null && typeof value === 'object') {
|
|
154
|
+
return Object.fromEntries(Object.keys(value).sort().map((key) => [key, canonicalize(value[key])]));
|
|
155
|
+
}
|
|
156
|
+
return value;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
function withCanonicalContractHash(value) {
|
|
160
|
+
const { contract_hash: _staleHash, ...canonicalFields } = value;
|
|
161
|
+
return {
|
|
162
|
+
...canonicalFields,
|
|
163
|
+
contract_hash: `sha256:${createHash('sha256').update(JSON.stringify(canonicalize(canonicalFields))).digest('hex')}`,
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
|
|
151
167
|
function scriptBoundary() {
|
|
152
168
|
return {
|
|
153
169
|
public_safe_packet_only: true,
|
|
@@ -182,13 +198,15 @@ export function buildHostedApiKeyLifecyclePacket(options = {}) {
|
|
|
182
198
|
});
|
|
183
199
|
validateApiKeyLifecyclePacket(packet);
|
|
184
200
|
return {
|
|
185
|
-
...
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
201
|
+
...withCanonicalContractHash({
|
|
202
|
+
...packet,
|
|
203
|
+
schema: HOSTED_CLOUD_API_KEY_LIFECYCLE_PACKET_SCHEMA,
|
|
204
|
+
release_target: HOSTED_API_KEY_LIFECYCLE_RELEASE_TARGET,
|
|
205
|
+
tenant_id: tenantId,
|
|
206
|
+
subject_ref: subjectRef,
|
|
207
|
+
operation,
|
|
208
|
+
scopes,
|
|
209
|
+
}),
|
|
192
210
|
boundary: scriptBoundary(),
|
|
193
211
|
};
|
|
194
212
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { writeFile } from 'node:fs/promises';
|
|
3
|
+
import { createHash } from 'node:crypto';
|
|
3
4
|
import { fileURLToPath } from 'node:url';
|
|
4
5
|
import { resolve } from 'node:path';
|
|
5
6
|
|
|
@@ -30,7 +31,7 @@ import {
|
|
|
30
31
|
} from 'enigma-memory/hosted-cloud';
|
|
31
32
|
|
|
32
33
|
export const HOSTED_CUSTOMER_LIFECYCLE_PACKET_SCHEMA = HOSTED_CLOUD_CUSTOMER_LIFECYCLE_PACKET_SCHEMA;
|
|
33
|
-
export const HOSTED_CUSTOMER_LIFECYCLE_RELEASE_TARGET = '0.1.
|
|
34
|
+
export const HOSTED_CUSTOMER_LIFECYCLE_RELEASE_TARGET = '0.1.20';
|
|
34
35
|
export const HOSTED_CLOUD_READINESS_RELEASE_SCHEMA = HOSTED_CLOUD_READINESS_PACKET_SCHEMA;
|
|
35
36
|
|
|
36
37
|
const PROVIDED = 'provided';
|
|
@@ -342,6 +343,22 @@ function coreRequiredEvidenceRefs(evidenceRefs) {
|
|
|
342
343
|
.map((phase) => [phase, refs[phase]]));
|
|
343
344
|
}
|
|
344
345
|
|
|
346
|
+
function canonicalize(value) {
|
|
347
|
+
if (Array.isArray(value)) return value.map(canonicalize);
|
|
348
|
+
if (value !== null && typeof value === 'object') {
|
|
349
|
+
return Object.fromEntries(Object.keys(value).sort().map((key) => [key, canonicalize(value[key])]));
|
|
350
|
+
}
|
|
351
|
+
return value;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
function withCanonicalContractHash(value) {
|
|
355
|
+
const { contract_hash: _staleHash, ...canonicalFields } = value;
|
|
356
|
+
return {
|
|
357
|
+
...canonicalFields,
|
|
358
|
+
contract_hash: `sha256:${createHash('sha256').update(JSON.stringify(canonicalize(canonicalFields))).digest('hex')}`,
|
|
359
|
+
};
|
|
360
|
+
}
|
|
361
|
+
|
|
345
362
|
function scriptBoundary() {
|
|
346
363
|
return {
|
|
347
364
|
public_safe_packet_only: true,
|
|
@@ -370,7 +387,7 @@ export function buildHostedCustomerLifecyclePacket(options = {}) {
|
|
|
370
387
|
operator_go_live_ref: operatorGoLiveRef,
|
|
371
388
|
});
|
|
372
389
|
validateCustomerLifecyclePacket(packet);
|
|
373
|
-
return {
|
|
390
|
+
return withCanonicalContractHash({
|
|
374
391
|
...packet,
|
|
375
392
|
release_target: HOSTED_CUSTOMER_LIFECYCLE_RELEASE_TARGET,
|
|
376
393
|
tenant_id: tenantId,
|
|
@@ -379,7 +396,7 @@ export function buildHostedCustomerLifecyclePacket(options = {}) {
|
|
|
379
396
|
evidence_refs: Object.fromEntries(Object.entries(evidenceRefs).map(([key, value]) => [key, { ...value }])),
|
|
380
397
|
operator_external_evidence_refs: operatorEvidenceRefsFrom(evidenceRefs),
|
|
381
398
|
boundary: scriptBoundary(),
|
|
382
|
-
};
|
|
399
|
+
});
|
|
383
400
|
}
|
|
384
401
|
|
|
385
402
|
export function buildHostedCloudReadinessPacketFromArgs(options = {}) {
|
|
@@ -27,9 +27,9 @@ export const REQUIRED_WORKER_ENV_REFS = Object.freeze([
|
|
|
27
27
|
]);
|
|
28
28
|
|
|
29
29
|
const WORKER_CLAIM_BOUNDARY = Object.freeze([
|
|
30
|
-
'This Worker is a hosted public HTTPS probe harness, not the relay/gateway data plane.',
|
|
31
|
-
'
|
|
32
|
-
'It must not be used as hosted backend live evidence
|
|
30
|
+
'This Worker is a hosted public HTTPS probe harness, not the relay/gateway data plane; hosted_backend_live is always false.',
|
|
31
|
+
'Its private data plane is closed and non-operational even when /readyz returns 200 after reference checks.',
|
|
32
|
+
'It must not be used as hosted backend live evidence; operational runtime markers and successful authenticated relay/gateway data-plane proofs must come from the real runtime.',
|
|
33
33
|
]);
|
|
34
34
|
|
|
35
35
|
const SECRET_VALUE_RE = /(?:Bearer\s+[A-Za-z0-9._~+/=-]{12,}|Basic\s+[A-Za-z0-9+/=-]{12,}|-----BEGIN [A-Z ]*PRIVATE KEY-----|https?:\/\/[^\s/@]+:[^\s/@]+@|sk-[A-Za-z0-9_-]{16,}|AKIA[0-9A-Z]{16}|raw memory|private prompt|full transcript|decrypted capsule)/iu;
|
|
@@ -45,6 +45,12 @@ export function hostedProbeWorkerSource(options = {}) {
|
|
|
45
45
|
return `const SERVICE_NAME = ${JSON.stringify(serviceName)};
|
|
46
46
|
const REQUIRED_REFS = ${requiredRefs};
|
|
47
47
|
const CLAIM_BOUNDARY = ${boundary};
|
|
48
|
+
const RUNTIME_CAPABILITY = Object.freeze({
|
|
49
|
+
marker: 'enigma.private_data_plane.runtime.v1',
|
|
50
|
+
bootstrap_worker: true,
|
|
51
|
+
private_data_plane_operational: false,
|
|
52
|
+
authenticated_data_plane_supported: false
|
|
53
|
+
});
|
|
48
54
|
|
|
49
55
|
function json(body, status = 200) {
|
|
50
56
|
return new Response(JSON.stringify(body, null, 2), {
|
|
@@ -70,6 +76,9 @@ function readiness(env) {
|
|
|
70
76
|
ok: missing.length === 0 && decisionOk,
|
|
71
77
|
service: SERVICE_NAME,
|
|
72
78
|
hosted_probe_only: true,
|
|
79
|
+
hosted_backend_live: false,
|
|
80
|
+
private_data_plane_operational: false,
|
|
81
|
+
runtime_capability: RUNTIME_CAPABILITY,
|
|
73
82
|
missing_evidence_refs: missing,
|
|
74
83
|
checks: [
|
|
75
84
|
{ id: 'required_refs', ok: missing.length === 0, missing_count: missing.length, required_count: REQUIRED_REFS.length },
|
|
@@ -84,7 +93,7 @@ export default {
|
|
|
84
93
|
const url = new URL(request.url);
|
|
85
94
|
if (request.method !== 'GET' && request.method !== 'HEAD') return json({ ok: false, error: 'method_not_allowed' }, 405);
|
|
86
95
|
if (url.pathname === '/livez') {
|
|
87
|
-
return json({ ok: true, service: SERVICE_NAME, hosted_probe_only: true, claim_boundary: CLAIM_BOUNDARY });
|
|
96
|
+
return json({ ok: true, service: SERVICE_NAME, hosted_probe_only: true, hosted_backend_live: false, private_data_plane_operational: false, runtime_capability: RUNTIME_CAPABILITY, claim_boundary: CLAIM_BOUNDARY });
|
|
88
97
|
}
|
|
89
98
|
if (url.pathname === '/readyz') {
|
|
90
99
|
const body = readiness(env);
|
|
@@ -103,6 +112,10 @@ export function validateHostedProbeWorkerSource(source) {
|
|
|
103
112
|
if (!text.includes("url.pathname === '/readyz'")) blockers.push({ path: 'source', message: 'worker must route /readyz' });
|
|
104
113
|
if (!text.includes('missing_evidence_refs')) blockers.push({ path: 'source', message: 'worker must expose missing evidence refs on /readyz' });
|
|
105
114
|
if (!text.includes('hosted_probe_only: true')) blockers.push({ path: 'source', message: 'worker must mark hosted_probe_only true' });
|
|
115
|
+
if (!text.includes('hosted_backend_live: false')) blockers.push({ path: 'source', message: 'worker must explicitly declare hosted_backend_live false' });
|
|
116
|
+
if (!text.includes('private_data_plane_operational: false')) blockers.push({ path: 'source', message: 'worker must explicitly declare the private data plane non-operational' });
|
|
117
|
+
if (!text.includes('authenticated_data_plane_supported: false')) blockers.push({ path: 'source', message: 'worker must explicitly declare authenticated data-plane support unavailable' });
|
|
118
|
+
if (/hosted_backend_live\s*:\s*true/u.test(text)) blockers.push({ path: 'source', message: 'probe worker must never declare hosted_backend_live true' });
|
|
106
119
|
if (!text.includes('status,') || !text.includes('body.ok ? 200 : 503')) blockers.push({ path: 'source', message: 'worker readyz must fail closed with 503 until complete' });
|
|
107
120
|
if (SECRET_VALUE_RE.test(text)) blockers.push({ path: 'source', message: 'worker source contains secret-looking literal' });
|
|
108
121
|
for (const ref of REQUIRED_WORKER_ENV_REFS) if (!text.includes(ref)) blockers.push({ path: `source.${ref}`, message: `worker missing required ref ${ref}` });
|
|
@@ -129,6 +142,8 @@ export function buildHostedProbeWorkerBundle(options = {}) {
|
|
|
129
142
|
runtime: 'cloudflare-workers',
|
|
130
143
|
entrypoint: 'worker.mjs',
|
|
131
144
|
default_routes: ['/livez', '/readyz'],
|
|
145
|
+
hosted_backend_live: false,
|
|
146
|
+
private_data_plane_operational: false,
|
|
132
147
|
mutates_cloudflare: false,
|
|
133
148
|
command_hint: 'wrangler deploy worker.mjs --name enigma-hosted-probe',
|
|
134
149
|
},
|
|
@@ -6,7 +6,7 @@ import { fileURLToPath } from 'node:url';
|
|
|
6
6
|
|
|
7
7
|
export const INSTALLER_ASSET_SCHEMA = 'enigma.installer_assets.v1';
|
|
8
8
|
export const INSTALLER_ASSET_PACKAGE = 'enigma-memory';
|
|
9
|
-
export const INSTALLER_ASSET_VERSION = '0.1.
|
|
9
|
+
export const INSTALLER_ASSET_VERSION = '0.1.20';
|
|
10
10
|
export const INSTALLER_ASSET_GENERATED_AT = '1970-01-01T00:00:00.000Z';
|
|
11
11
|
|
|
12
12
|
const SCRIPT_PATH = fileURLToPath(import.meta.url);
|
|
@@ -98,7 +98,8 @@ function windowsInstallerScript() {
|
|
|
98
98
|
# Dry-run is the default; pass -Execute to mutate global npm state and create local setup files.
|
|
99
99
|
param(
|
|
100
100
|
[switch]$Execute,
|
|
101
|
-
[string]$Bundle = '.\\.enigma\\bundle.json'
|
|
101
|
+
[string]$Bundle = '.\\.enigma\\bundle.json',
|
|
102
|
+
[string]$PassphraseFile = '.\\.enigma\\passphrase'
|
|
102
103
|
)
|
|
103
104
|
$ErrorActionPreference = 'Stop'
|
|
104
105
|
$PackageName = '${INSTALLER_ASSET_PACKAGE}'
|
|
@@ -108,11 +109,12 @@ Write-Output 'Enigma Memory Windows installer source asset'
|
|
|
108
109
|
Write-Output 'Default mode: dry-run. No native .exe, code-signing, tokens, or hosted credentials are included.'
|
|
109
110
|
Write-Output "Package: $PackageName"
|
|
110
111
|
Write-Output "Bundle: $Bundle"
|
|
112
|
+
Write-Output "Passphrase file: $PassphraseFile"
|
|
111
113
|
|
|
112
114
|
$steps = @(
|
|
113
115
|
'npm install -g enigma-memory',
|
|
114
|
-
'enigma test-drive --dry-run',
|
|
115
|
-
'enigma setup --bundle <bundle> --overwrite',
|
|
116
|
+
'enigma test-drive --dry-run --insecure-dev # INSECURE, EVALUATION ONLY',
|
|
117
|
+
'enigma setup --bundle <bundle> --passphrase-file <passphrase-file> --overwrite',
|
|
116
118
|
'enigma doctor',
|
|
117
119
|
"Next client-connect preview: $NextClientConnect"
|
|
118
120
|
)
|
|
@@ -122,10 +124,17 @@ if (-not $Execute) {
|
|
|
122
124
|
$steps | ForEach-Object { Write-Output "DRY-RUN: $_" }
|
|
123
125
|
exit 0
|
|
124
126
|
}
|
|
127
|
+
if (-not (Test-Path -LiteralPath $PassphraseFile -PathType Leaf)) {
|
|
128
|
+
throw 'Encrypted setup requires -PassphraseFile pointing to a non-empty file created through an approved secret manager or secure editor.'
|
|
129
|
+
}
|
|
130
|
+
if ((Get-Item -LiteralPath $PassphraseFile).Length -eq 0) {
|
|
131
|
+
throw 'Encrypted setup passphrase file must not be empty.'
|
|
132
|
+
}
|
|
133
|
+
|
|
125
134
|
|
|
126
135
|
npm install -g $PackageName
|
|
127
|
-
enigma test-drive --dry-run
|
|
128
|
-
enigma setup --bundle $Bundle --overwrite
|
|
136
|
+
enigma test-drive --dry-run --insecure-dev # INSECURE, EVALUATION ONLY
|
|
137
|
+
enigma setup --bundle $Bundle --passphrase-file $PassphraseFile --overwrite
|
|
129
138
|
enigma doctor
|
|
130
139
|
Write-Output "Next client-connect preview: $NextClientConnect"
|
|
131
140
|
`;
|
|
@@ -140,13 +149,15 @@ function linuxInstallerScript() {
|
|
|
140
149
|
'',
|
|
141
150
|
'execute=0',
|
|
142
151
|
"bundle='./.enigma/bundle.json'",
|
|
152
|
+
"passphrase_file='./.enigma/passphrase'",
|
|
143
153
|
'while [ "$#" -gt 0 ]; do',
|
|
144
154
|
' case "$1" in',
|
|
145
155
|
' --execute) execute=1 ;;',
|
|
146
156
|
' --dry-run) execute=0 ;;',
|
|
147
157
|
' --bundle) shift; bundle="${1:-}" ;;',
|
|
158
|
+
' --passphrase-file) shift; passphrase_file="${1:-}" ;;',
|
|
148
159
|
' --help|-h)',
|
|
149
|
-
" printf '%s\\n' 'Usage: ./install-linux.sh [--execute|--dry-run] [--bundle ./.enigma/bundle.json]'",
|
|
160
|
+
" printf '%s\\n' 'Usage: ./install-linux.sh [--execute|--dry-run] [--bundle ./.enigma/bundle.json] [--passphrase-file ./.enigma/passphrase]'",
|
|
150
161
|
' exit 0',
|
|
151
162
|
' ;;',
|
|
152
163
|
' *)',
|
|
@@ -163,20 +174,26 @@ function linuxInstallerScript() {
|
|
|
163
174
|
"printf '%s\\n' 'Default mode: dry-run. No native package, signing key, tokens, or hosted credentials are included.'",
|
|
164
175
|
'printf \'%s\\n\' "Package: $package"',
|
|
165
176
|
'printf \'%s\\n\' "Bundle: $bundle"',
|
|
177
|
+
'printf \'%s\\n\' "Passphrase file: $passphrase_file"',
|
|
166
178
|
'',
|
|
167
179
|
'if [ "$execute" -ne 1 ]; then',
|
|
168
180
|
" printf '%s\\n' 'Preview only. Re-run with --execute after reviewing these steps.'",
|
|
169
181
|
" printf '%s\\n' 'DRY-RUN: npm install -g enigma-memory'",
|
|
170
|
-
" printf '%s\\n' 'DRY-RUN: enigma test-drive --dry-run'",
|
|
171
|
-
" printf '%s\\n' 'DRY-RUN: enigma setup --bundle <bundle> --overwrite'",
|
|
182
|
+
" printf '%s\\n' 'DRY-RUN: enigma test-drive --dry-run --insecure-dev # INSECURE, EVALUATION ONLY'",
|
|
183
|
+
" printf '%s\\n' 'DRY-RUN: enigma setup --bundle <bundle> --passphrase-file <passphrase-file> --overwrite'",
|
|
172
184
|
" printf '%s\\n' 'DRY-RUN: enigma doctor'",
|
|
173
185
|
' printf \'%s\\n\' "DRY-RUN: Next client-connect preview: $next_client_connect"',
|
|
174
186
|
' exit 0',
|
|
175
187
|
'fi',
|
|
188
|
+
'if [ ! -s "$passphrase_file" ]; then',
|
|
189
|
+
" printf '%s\\n' 'Encrypted setup requires --passphrase-file pointing to a non-empty file created through an approved secret manager or secure editor.' >&2",
|
|
190
|
+
' exit 2',
|
|
191
|
+
'fi',
|
|
192
|
+
'',
|
|
176
193
|
'',
|
|
177
194
|
'npm install -g "$package"',
|
|
178
|
-
'enigma test-drive --dry-run',
|
|
179
|
-
'enigma setup --bundle "$bundle" --overwrite',
|
|
195
|
+
'enigma test-drive --dry-run --insecure-dev # INSECURE, EVALUATION ONLY',
|
|
196
|
+
'enigma setup --bundle "$bundle" --passphrase-file "$passphrase_file" --overwrite',
|
|
180
197
|
'enigma doctor',
|
|
181
198
|
'printf \'%s\\n\' "Next client-connect preview: $next_client_connect"',
|
|
182
199
|
'',
|
|
@@ -187,8 +204,8 @@ function homebrewFormulaDraft() {
|
|
|
187
204
|
return `# Draft only. This formula is not submitted to a Homebrew tap by this generator.
|
|
188
205
|
# Release engineering must replace the tarball URL and sha256 after a real source archive exists.
|
|
189
206
|
# Post-install smoke path:
|
|
190
|
-
# enigma test-drive --dry-run
|
|
191
|
-
# enigma setup --overwrite
|
|
207
|
+
# enigma test-drive --dry-run --insecure-dev # INSECURE, EVALUATION ONLY
|
|
208
|
+
# enigma setup --passphrase-file "$HOME/.enigma/passphrase" --overwrite
|
|
192
209
|
# enigma doctor
|
|
193
210
|
# enigma connect <client> --dry-run
|
|
194
211
|
class EnigmaMemory < Formula
|
|
@@ -212,8 +229,8 @@ class EnigmaMemory < Formula
|
|
|
212
229
|
|
|
213
230
|
test do
|
|
214
231
|
assert_match "enigma", shell_output("#{bin}/enigma --help")
|
|
215
|
-
assert_match "enigma.test_drive.v1", shell_output("#{bin}/enigma test-drive --dry-run")
|
|
216
|
-
assert_match "enigma.setup.v1", shell_output("#{bin}/enigma setup --dry-run")
|
|
232
|
+
assert_match "enigma.test_drive.v1", shell_output("#{bin}/enigma test-drive --dry-run --insecure-dev") # INSECURE, EVALUATION ONLY
|
|
233
|
+
assert_match "enigma.setup.v1", shell_output("#{bin}/enigma setup --dry-run --insecure-dev") # INSECURE, EVALUATION ONLY
|
|
217
234
|
shell_output("#{bin}/enigma doctor")
|
|
218
235
|
puts "Next client-connect preview: enigma connect <client> --dry-run"
|
|
219
236
|
end
|
|
@@ -230,8 +247,9 @@ Current supported path:
|
|
|
230
247
|
|
|
231
248
|
\`\`\`sh
|
|
232
249
|
npm install -g ${INSTALLER_ASSET_PACKAGE}
|
|
233
|
-
enigma test-drive --dry-run
|
|
234
|
-
enigma
|
|
250
|
+
enigma test-drive --dry-run --insecure-dev # INSECURE, EVALUATION ONLY
|
|
251
|
+
test -s "$HOME/.enigma/passphrase" || { printf '%s\n' 'Create $HOME/.enigma/passphrase with an approved secret manager or secure editor, then restrict it to the current user.' >&2; exit 1; }
|
|
252
|
+
enigma setup --passphrase-file "$HOME/.enigma/passphrase" --overwrite
|
|
235
253
|
enigma doctor
|
|
236
254
|
enigma connect <client> --dry-run
|
|
237
255
|
\`\`\`
|
|
@@ -260,8 +278,8 @@ function macosPkgManifest() {
|
|
|
260
278
|
install_prefix: '<homebrew-or-npm-managed-prefix>',
|
|
261
279
|
commands: [
|
|
262
280
|
['npm', 'install', '-g', INSTALLER_ASSET_PACKAGE],
|
|
263
|
-
['enigma', 'test-drive', '--dry-run'],
|
|
264
|
-
['enigma', 'setup', '--overwrite'],
|
|
281
|
+
['enigma', 'test-drive', '--dry-run', '--insecure-dev'],
|
|
282
|
+
['enigma', 'setup', '--passphrase-file', '<passphrase-file>', '--overwrite'],
|
|
265
283
|
['enigma', 'doctor'],
|
|
266
284
|
],
|
|
267
285
|
next_client_connect: ['enigma', 'connect', '<client>', '--dry-run'],
|
|
@@ -321,8 +339,8 @@ export function buildInstallerAssets(options = {}, runtime = {}) {
|
|
|
321
339
|
installer_smoke: {
|
|
322
340
|
default_preview_commands: [
|
|
323
341
|
'npm install -g enigma-memory',
|
|
324
|
-
'enigma test-drive --dry-run',
|
|
325
|
-
'enigma setup --overwrite',
|
|
342
|
+
'enigma test-drive --dry-run --insecure-dev # INSECURE, EVALUATION ONLY',
|
|
343
|
+
'enigma setup --passphrase-file <passphrase-file> --overwrite',
|
|
326
344
|
'enigma doctor',
|
|
327
345
|
],
|
|
328
346
|
next_client_connect: 'enigma connect <client> --dry-run',
|
|
@@ -336,6 +354,8 @@ export function buildInstallerAssets(options = {}, runtime = {}) {
|
|
|
336
354
|
embeds_provider_responses: false,
|
|
337
355
|
embeds_private_keys: false,
|
|
338
356
|
default_dry_run: true,
|
|
357
|
+
setup_encrypted_by_default: true,
|
|
358
|
+
insecure_mode_evaluation_only: true,
|
|
339
359
|
requires_write_flag_for_filesystem_mutation: true,
|
|
340
360
|
},
|
|
341
361
|
};
|
|
@@ -4,7 +4,13 @@ import { join, resolve } from 'node:path';
|
|
|
4
4
|
import { fileURLToPath } from 'node:url';
|
|
5
5
|
import { buildOperatorAcceptancePacket } from './build-operator-acceptance-packet.mjs';
|
|
6
6
|
import { buildProductionReadinessManifest } from './build-production-readiness-manifest.mjs';
|
|
7
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
HOSTED_BACKEND_AUTHENTICATED_DATA_PLANE_SCHEMA,
|
|
9
|
+
HOSTED_BACKEND_LIVE_EVIDENCE_SCHEMA,
|
|
10
|
+
HOSTED_BACKEND_RUNTIME_CAPABILITY_SCHEMA,
|
|
11
|
+
PRIVATE_DATA_PLANE_RUNTIME_MARKER,
|
|
12
|
+
REQUIRED_REF_KEYS,
|
|
13
|
+
} from './validate-hosted-backend-live.mjs';
|
|
8
14
|
import { REQUIRED_EVIDENCE_ITEMS, REQUIRED_OWNER_ROLES, REQUIRED_PACKET_METADATA } from './validate-operator-acceptance.mjs';
|
|
9
15
|
import { groupHostedRefsByWorkstream } from './hosted-ref-workstreams.mjs';
|
|
10
16
|
|
|
@@ -97,6 +103,7 @@ function buildHostedBackendLiveEvidenceTemplate({ domain }) {
|
|
|
97
103
|
region: '<public-region-code>',
|
|
98
104
|
owner: '<operator-team-or-role>',
|
|
99
105
|
status: 'observed',
|
|
106
|
+
local_simulation: false,
|
|
100
107
|
},
|
|
101
108
|
refs: Object.fromEntries(HOSTED_REF_KEYS.map((key) => [key, `<operator-provided-${key}-evidence-ref>`])),
|
|
102
109
|
probes: {
|
|
@@ -105,6 +112,57 @@ function buildHostedBackendLiveEvidenceTemplate({ domain }) {
|
|
|
105
112
|
gateway_livez: hostedProbeTemplate('gateway', 'livez', domain),
|
|
106
113
|
gateway_readyz: hostedProbeTemplate('gateway', 'readyz', domain),
|
|
107
114
|
},
|
|
115
|
+
runtime_capability: {
|
|
116
|
+
schema: HOSTED_BACKEND_RUNTIME_CAPABILITY_SCHEMA,
|
|
117
|
+
marker: PRIVATE_DATA_PLANE_RUNTIME_MARKER,
|
|
118
|
+
observed_at: '<runtime-capability-observed-at-iso8601>',
|
|
119
|
+
services: {
|
|
120
|
+
relay: {
|
|
121
|
+
service: 'enigma-relay',
|
|
122
|
+
private_data_plane_operational: true,
|
|
123
|
+
authentication_enforced: true,
|
|
124
|
+
bootstrap_worker: false,
|
|
125
|
+
evidence_ref: '<operator-provided-relay-runtime-capability-ref>',
|
|
126
|
+
},
|
|
127
|
+
gateway: {
|
|
128
|
+
service: 'enigma-gateway',
|
|
129
|
+
private_data_plane_operational: true,
|
|
130
|
+
authentication_enforced: true,
|
|
131
|
+
bootstrap_worker: false,
|
|
132
|
+
evidence_ref: '<operator-provided-gateway-runtime-capability-ref>',
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
},
|
|
136
|
+
authenticated_data_plane: {
|
|
137
|
+
schema: HOSTED_BACKEND_AUTHENTICATED_DATA_PLANE_SCHEMA,
|
|
138
|
+
observed_at: '<authenticated-data-plane-observed-at-iso8601>',
|
|
139
|
+
proofs: {
|
|
140
|
+
relay: {
|
|
141
|
+
service: 'enigma-relay',
|
|
142
|
+
url: `https://relay.${domain}/pairing/complete`,
|
|
143
|
+
method: 'POST',
|
|
144
|
+
status_code: 200,
|
|
145
|
+
authenticated: true,
|
|
146
|
+
authorization_result: 'allowed',
|
|
147
|
+
observed_at: '<relay-data-plane-observed-at-iso8601>',
|
|
148
|
+
request_hash: 'sha256:<operator-provided-relay-request-sha256-hex>',
|
|
149
|
+
response_hash: 'sha256:<operator-provided-relay-response-sha256-hex>',
|
|
150
|
+
evidence_ref: '<operator-provided-relay-authenticated-data-plane-ref>',
|
|
151
|
+
},
|
|
152
|
+
gateway: {
|
|
153
|
+
service: 'enigma-gateway',
|
|
154
|
+
url: `https://gateway.${domain}/gateway/decision`,
|
|
155
|
+
method: 'POST',
|
|
156
|
+
status_code: 200,
|
|
157
|
+
authenticated: true,
|
|
158
|
+
authorization_result: 'allowed',
|
|
159
|
+
observed_at: '<gateway-data-plane-observed-at-iso8601>',
|
|
160
|
+
request_hash: 'sha256:<operator-provided-gateway-request-sha256-hex>',
|
|
161
|
+
response_hash: 'sha256:<operator-provided-gateway-response-sha256-hex>',
|
|
162
|
+
evidence_ref: '<operator-provided-gateway-authenticated-data-plane-ref>',
|
|
163
|
+
},
|
|
164
|
+
},
|
|
165
|
+
},
|
|
108
166
|
operator_acceptance: {
|
|
109
167
|
decision: 'go',
|
|
110
168
|
packet_ref: '<operator-acceptance-packet-ref>',
|