enigma-memory 0.1.13 → 0.1.14
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 +36 -17
- package/apps/cli/bin/enigma.mjs +320 -42
- package/deploy/docker-compose.local-production-simulation.yml +10 -11
- package/docs/benchmark-attestation-network.md +487 -487
- package/docs/benchmark-reproducibility.md +10 -9
- package/docs/demo-proof-network.md +275 -275
- package/docs/developer-ecosystem.md +223 -223
- package/docs/developer-proof-quickstart.md +325 -325
- package/docs/enigma-memory-ready-conformance.md +376 -376
- package/docs/hosted-cloud-product.md +10 -0
- package/docs/install-anywhere.md +34 -17
- package/docs/installers-and-desktop.md +9 -7
- package/docs/proof-network-build-notes.md +240 -240
- package/docs/proof-network.md +257 -257
- package/docs/sdk-api.md +324 -324
- package/docs/solana-devnet-acceptance.md +48 -0
- package/docs/solana-proof-rail.md +453 -453
- package/examples/ci/github-actions.yml +6 -8
- package/package.json +8 -1
- package/packages/mcp-server/src/index.js +1 -1
- package/packages/passport/src/index.js +9 -5
- package/scripts/build-benchmark-proof-release.mjs +391 -0
- package/scripts/build-goal-completion-audit.mjs +11 -5
- package/scripts/build-hosted-api-key-lifecycle.mjs +1 -1
- package/scripts/build-hosted-customer-lifecycle.mjs +1 -1
- package/scripts/build-installer-assets.mjs +126 -10
- package/scripts/build-production-handoff-packet.mjs +7 -6
- package/scripts/build-production-unblocker.mjs +409 -0
- package/scripts/build-proof-network-packet.mjs +1 -1
- package/scripts/release-audit.mjs +71 -2
- package/scripts/run-standard-memory-benchmarks.mjs +1 -1
- package/scripts/wait-for-backend-ready.mjs +4 -2
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
validateProofNetworkPacket,
|
|
16
16
|
} from '../packages/proof-network/src/index.js';
|
|
17
17
|
|
|
18
|
-
export const PROOF_NETWORK_PACKET_RELEASE_TARGET = '0.1.
|
|
18
|
+
export const PROOF_NETWORK_PACKET_RELEASE_TARGET = '0.1.14';
|
|
19
19
|
|
|
20
20
|
const HASH_RE = /^(?:sha256:)?[a-f0-9]{64}$/iu;
|
|
21
21
|
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}|\b(?:raw[\s_-]*memory|plaintext[\s_-]*prompts?|plain[\s_-]*text[\s_-]*prompts?|private[\s_-]*prompts?|provider[\s_-]*responses?|full[\s_-]*transcript|decrypted[\s_-]*memory|credentials?|secrets?|passwords?|private[\s_-]*keys?|api[\s_-]*key[\s_-]*(?:secret|material|value)|api[\s_-]*secrets?|access[\s_-]*tokens?|refresh[\s_-]*tokens?|token[\s_-]*values?|credential[\s_-]*material|tenant[\s_-]*names?)\b)/iu;
|
|
@@ -136,6 +136,10 @@ const KUBERNETES_BACKEND_MANIFEST = resolve(PROJECT_ROOT, 'deploy', 'kubernetes'
|
|
|
136
136
|
const ENIGMA_INFRASTRUCTURE_READINESS_MANIFEST = 'ENIGMA_INFRASTRUCTURE_READINESS_MANIFEST';
|
|
137
137
|
const ENIGMA_INFRASTRUCTURE_READINESS_LIVE = 'ENIGMA_INFRASTRUCTURE_READINESS_LIVE';
|
|
138
138
|
const SECRET_LOOKING_OUTPUT = /(?:Authorization:\s*Bearer\s+[A-Za-z0-9._~+/=-]{8,}|-----BEGIN [A-Z ]*PRIVATE KEY-----|["']?(?:api[_-]?key|access[_-]?token|refresh[_-]?token|secret|password|private[_-]?key)["']?\s*[:=]\s*["']?[A-Za-z0-9._~+/=-]{16,})/i;
|
|
139
|
+
const TEST_FAILURE_SUMMARY_LIMIT = 8;
|
|
140
|
+
const TEST_OUTPUT_TAIL_LINE_LIMIT = 18;
|
|
141
|
+
const TEST_OUTPUT_TAIL_CHAR_LIMIT = 280;
|
|
142
|
+
const REDACTED_DIAGNOSTIC_LINE = '<redacted secret-looking output>';
|
|
139
143
|
|
|
140
144
|
function npmInvocation(args) {
|
|
141
145
|
const label = commandLabel('npm', args);
|
|
@@ -235,6 +239,68 @@ function tapCounts(output) {
|
|
|
235
239
|
return counts;
|
|
236
240
|
}
|
|
237
241
|
|
|
242
|
+
function sanitizeDiagnosticLine(value) {
|
|
243
|
+
const scrubbed = scrubLocalPathText(value)
|
|
244
|
+
.replace(/file:\/\/(?=<(?:project-root|public-site-package|temp|user-home|home)>)/g, '')
|
|
245
|
+
.replace(/[A-Za-z]:\/[^\s'"`),]+/g, '<path>')
|
|
246
|
+
.replace(/(?:file:\/\/)?\/(?:Users|home|tmp|private\/var|var\/folders)\/[^\s'"`),]+/g, '<path>')
|
|
247
|
+
.replace(/[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}/gi, '<email>')
|
|
248
|
+
.replace(/\s+/g, ' ')
|
|
249
|
+
.trim();
|
|
250
|
+
if (!scrubbed) return '';
|
|
251
|
+
if (
|
|
252
|
+
SECRET_LOOKING_OUTPUT.test(scrubbed)
|
|
253
|
+
|| RAW_MEMORY_EXAMPLE_FIELD.test(scrubbed)
|
|
254
|
+
|| scrubbed.includes(RAW_MEMORY_SENTINEL)
|
|
255
|
+
) return REDACTED_DIAGNOSTIC_LINE;
|
|
256
|
+
return scrubbed.length > TEST_OUTPUT_TAIL_CHAR_LIMIT
|
|
257
|
+
? `${scrubbed.slice(0, TEST_OUTPUT_TAIL_CHAR_LIMIT - 1)}…`
|
|
258
|
+
: scrubbed;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
function diagnosticLines(value) {
|
|
262
|
+
return String(value).split(/\r?\n/).map(sanitizeDiagnosticLine).filter(Boolean);
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
function diagnosticMessage(value) {
|
|
266
|
+
return diagnosticLines(value)[0] ?? 'Command failed.';
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
function failingTestNames(output) {
|
|
270
|
+
const names = [];
|
|
271
|
+
for (const line of diagnosticLines(output)) {
|
|
272
|
+
const tapMatch = line.match(/^not ok \d+ - (.+)$/);
|
|
273
|
+
const prettyMatch = line.match(/^✖\s+(.+?)(?:\s+\(\d+(?:\.\d+)?ms\))?$/u);
|
|
274
|
+
const name = tapMatch?.[1] ?? prettyMatch?.[1] ?? null;
|
|
275
|
+
if (!name || names.includes(name)) continue;
|
|
276
|
+
names.push(name);
|
|
277
|
+
if (names.length >= TEST_FAILURE_SUMMARY_LIMIT) break;
|
|
278
|
+
}
|
|
279
|
+
return names;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
function diagnosticTail(stdout, stderr) {
|
|
283
|
+
const stdoutLines = diagnosticLines(stdout);
|
|
284
|
+
if (stdoutLines.length > 0) {
|
|
285
|
+
return { key: 'stdout_tail', lines: stdoutLines.slice(-TEST_OUTPUT_TAIL_LINE_LIMIT) };
|
|
286
|
+
}
|
|
287
|
+
const stderrLines = diagnosticLines(stderr);
|
|
288
|
+
if (stderrLines.length > 0) {
|
|
289
|
+
return { key: 'stderr_tail', lines: stderrLines.slice(-TEST_OUTPUT_TAIL_LINE_LIMIT) };
|
|
290
|
+
}
|
|
291
|
+
return null;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
export function summarizeNpmTestFailure(stdout, stderr) {
|
|
295
|
+
const combined = `${stdout}\n${stderr}`;
|
|
296
|
+
const summary = { tap: tapCounts(combined) };
|
|
297
|
+
const failed = failingTestNames(combined);
|
|
298
|
+
const tail = diagnosticTail(stdout, stderr);
|
|
299
|
+
if (failed.length > 0) summary.failing_tests = failed;
|
|
300
|
+
if (tail) summary[tail.key] = tail.lines;
|
|
301
|
+
return summary;
|
|
302
|
+
}
|
|
303
|
+
|
|
238
304
|
function summarizeCheck(stdout) {
|
|
239
305
|
const line = lines(stdout).find((item) => item.includes('enigma check ok')) ?? lines(stdout).at(-1) ?? '';
|
|
240
306
|
return { message: line };
|
|
@@ -490,9 +556,12 @@ async function runCommandGate(name, command, args, options = {}) {
|
|
|
490
556
|
gate.signal = error.signal ?? null;
|
|
491
557
|
gate.stderr_bytes = Buffer.byteLength(error.stderr ?? '');
|
|
492
558
|
gate.stdout_bytes = Buffer.byteLength(error.stdout ?? '');
|
|
559
|
+
if (options.summarizeFailure) {
|
|
560
|
+
gate.evidence = await options.summarizeFailure(error.stdout ?? '', error.stderr ?? '');
|
|
561
|
+
}
|
|
493
562
|
gate.error = {
|
|
494
563
|
code: error.killed ? 'COMMAND_TIMEOUT' : (error.code ?? 'COMMAND_FAILED'),
|
|
495
|
-
message: error.message,
|
|
564
|
+
message: options.summarizeFailure ? diagnosticMessage(error.message) : error.message,
|
|
496
565
|
};
|
|
497
566
|
if (gate.status === 0) {
|
|
498
567
|
gate.error.code = 'OUTPUT_VALIDATION_FAILED';
|
|
@@ -5484,7 +5553,7 @@ export async function runReleaseAudit() {
|
|
|
5484
5553
|
const test = await nodeTestInvocation();
|
|
5485
5554
|
const pack = npmInvocation(['pack', '--dry-run']);
|
|
5486
5555
|
gates.push(await runCommandGate('npm-check', check.command, check.args, { label: check.label, summarize: summarizeCheck }));
|
|
5487
|
-
gates.push(await runCommandGate('npm-test', test.command, test.args, { label: test.label, timeoutMs: TEST_TIMEOUT_MS, summarize: summarizeTests }));
|
|
5556
|
+
gates.push(await runCommandGate('npm-test', test.command, test.args, { label: test.label, timeoutMs: TEST_TIMEOUT_MS, summarize: summarizeTests, summarizeFailure: summarizeNpmTestFailure }));
|
|
5488
5557
|
gates.push(await runCommandGate('npm-pack-dry-run', pack.command, pack.args, { label: pack.label, summarize: summarizePack }));
|
|
5489
5558
|
gates.push(await runDirectBinSmokes());
|
|
5490
5559
|
gates.push(await runNativeHostInstallPlanGate());
|
|
@@ -995,7 +995,7 @@ function buildSuiteReport(datasetRows, topK, options) {
|
|
|
995
995
|
generated_at: options.generated_at ?? new Date().toISOString(),
|
|
996
996
|
package: {
|
|
997
997
|
name: 'enigma-memory',
|
|
998
|
-
version: '0.1.
|
|
998
|
+
version: '0.1.14',
|
|
999
999
|
},
|
|
1000
1000
|
public_safe: true,
|
|
1001
1001
|
top_k: topK,
|
|
@@ -5,9 +5,11 @@
|
|
|
5
5
|
import https from 'node:https'
|
|
6
6
|
import { parseArgs } from 'node:util'
|
|
7
7
|
|
|
8
|
+
const RELAY_PORT = process.env.ENIGMA_SIM_RELAY_PORT || '8443'
|
|
9
|
+
const GATEWAY_PORT = process.env.ENIGMA_SIM_GATEWAY_PORT || '9443'
|
|
8
10
|
const ENDPOINTS = [
|
|
9
|
-
{ name: 'relay', url:
|
|
10
|
-
{ name: 'gateway', url:
|
|
11
|
+
{ name: 'relay', url: `https://localhost:${RELAY_PORT}/readyz` },
|
|
12
|
+
{ name: 'gateway', url: `https://localhost:${GATEWAY_PORT}/readyz` },
|
|
11
13
|
]
|
|
12
14
|
|
|
13
15
|
function parseCliArgs(argv) {
|