197 lines
23 KiB
JavaScript
197 lines
23 KiB
JavaScript
// Explicit new synthetic-host verification. Never discovers a credential or
|
|
// production service; no real model or engineering task is used.
|
|
import fs from 'node:fs';
|
|
import path from 'node:path';
|
|
import assert from 'node:assert/strict';
|
|
import { randomUUID, createHash } from 'node:crypto';
|
|
import { Store } from '../src/server/store.mjs';
|
|
import { Provider } from '../src/server/provider.mjs';
|
|
import { Runtime } from '../src/server/runtime.mjs';
|
|
import { MnemoBridge } from '../src/core/memory/mnemo-bridge.mjs';
|
|
import { MnemoClient, digest, contextDigest, entryRef } from '../src/core/memory/mnemo-protocol.mjs';
|
|
import { verifyPlanEvidence } from '../src/core/context/request-plan.mjs';
|
|
|
|
const args = process.argv.slice(2), option = name => args[args.indexOf(name) + 1];
|
|
const requestedCases = args.includes('--cases') ? new Set(option('--cases').split(',')) : null;
|
|
if (!args.includes('--connection') || !args.includes('--output')) throw new Error('Use --connection <new synthetic connection.private.json> --output <new evidence directory>.');
|
|
const connectionPath = path.resolve(option('--connection')), output = path.resolve(option('--output'));
|
|
const c = JSON.parse(fs.readFileSync(connectionPath, 'utf8'));
|
|
assert.equal(c.syntheticOnly, true); assert.equal(new URL(c.origin).hostname, '127.0.0.1'); assert.ok(c.directory && connectionPath === path.join(c.directory, 'connection.private.json'));
|
|
fs.mkdirSync(output, { recursive: false });
|
|
const sha = b => createHash('sha256').update(b).digest('hex');
|
|
const redact = value => typeof value === 'string' ? value.split(c.fixtureToken).join('[SYNTHETIC_TOKEN]') : Array.isArray(value) ? value.map(redact)
|
|
: value && typeof value === 'object' ? Object.fromEntries(Object.entries(value).filter(([k]) => !['token', 'fixtureToken', 'providerToken'].includes(k)).map(([k, v]) => [k, redact(v)])) : value;
|
|
const write = (name, value) => fs.writeFileSync(path.join(output, name), JSON.stringify(redact(value), null, 2));
|
|
const store = new Store(path.join(output, 'data')), provider = new Provider(); provider.setKey('');
|
|
const runtime = new Runtime(store, provider), hub = provider.modelHub(store), bridge = runtime.mnemoBridge();
|
|
const member = hub.upsert({ name: 'Mnemo 本机合成接收器', model: 'mnemo-joint-fixture', baseUrl: c.providerBaseUrl + '/v1', protocol: 'chat-completions', requiresKey: true, apiKey: c.providerToken, streaming: false });
|
|
hub.select({ type: 'connection', id: member.id });
|
|
const controls = [], cases = [], runs = [], originalArtifacts = new Map();
|
|
async function control(route, body) {
|
|
const response = await fetch(c.origin + '/__fixture/control/' + route, { method: body === undefined ? 'GET' : 'POST',
|
|
headers: { Authorization: 'Bearer ' + c.fixtureToken, 'Content-Type': 'application/json' }, ...(body === undefined ? {} : { body: JSON.stringify(body) }), redirect: 'error' });
|
|
const result = await response.json(); controls.push({ route, request: body ?? null, status: response.status, result: redact(result) });
|
|
assert.ok(response.ok, 'Synthetic control ' + route + ': ' + JSON.stringify(redact(result))); return result;
|
|
}
|
|
async function fixture(label, { enabled = true, content = '合成项目约定:保存中文与换行。\n只用于本机联合验收。', expiresAt = null } = {}) {
|
|
const projectRoot = path.join(output, 'projects', label + '-' + randomUUID()); fs.mkdirSync(projectRoot, { recursive: true });
|
|
fs.writeFileSync(path.join(projectRoot, 'README.md'), '# New synthetic project ' + label + '\n');
|
|
const project = store.addProject(projectRoot), sourceSession = store.createSession(project.id, label + ' 来源');
|
|
const memory = await runtime.memoryManager().create(sourceSession, { title: label + ' 来源', content, ...(expiresAt ? { expiresAt } : {}) });
|
|
let auth = null;
|
|
if (enabled) {
|
|
const view = await bridge.view(project.id);
|
|
auth = await control('bind', { producerId: view.producerId, projectId: project.id, projectName: label, requestKey: randomUUID(), confirmed: true });
|
|
await bridge.configure(project.id, { enabled: true, baseUrl: c.origin, bindingId: auth.binding.id, token: auth.token, expectedRevision: 0 });
|
|
}
|
|
return { project, projectRoot, sourceSession, memory, auth };
|
|
}
|
|
async function action(f, value, memory = f.memory) {
|
|
const view = await bridge.view(f.project.id), source = view.sources.find(s => s.memoryId === memory.id);
|
|
return bridge.changeSource(f.project.id, memory.id, { action: value, confirmed: true, expectedDigest: source.confirmationDigest });
|
|
}
|
|
async function execute(f, label, query = f.memory.title) {
|
|
const session = store.createSession(f.project.id, label + ' 新会话'); runtime.start(session.id, query);
|
|
const active = runtime.active.get(session.id); if (active) await active.promise;
|
|
const run = store.core.run.get(session.runId), plans = [...store.core.context_plan.values()].filter(p => p.runId === run.id);
|
|
for (const plan of plans) verifyPlanEvidence(store, session, plan);
|
|
const attempts = hub.ledger.page({ limit: 10000 }).items.filter(a => a.runId === run.id);
|
|
const observations = await control('observations');
|
|
const physical = observations.physical.filter(row => attempts.some(a => a.status !== 'rejected' && (a.upstreamResponse?.requestId === row.physicalRequestId
|
|
|| !a.upstreamResponse?.requestId && a.requestSha256 === row.bodySha256 && row.receivedAt >= a.startedAt && row.receivedAt <= (a.finishedAt ?? '9999'))));
|
|
// A negative selection alone is insufficient: the original task must really
|
|
// reach the controlled receiver, including its failed/unknown responses.
|
|
assert.ok(observations.physical.some(row => row.captureStatus === 'captured' && row.receivedAt >= run.startedAt), 'No physical receiver observation for this Run');
|
|
for (const row of physical) {
|
|
assert.equal(row.captureStatus, 'captured');
|
|
const filename = row.bodyFile ?? row.artifactPath ?? row.path;
|
|
const candidates = [filename, path.join(c.directory, 'physical-' + String(row.sequence).padStart(4, '0') + '.body.json')].filter(Boolean);
|
|
const source = candidates.map(v => path.resolve(c.directory, v)).find(v => v.startsWith(path.resolve(c.directory) + path.sep) && fs.existsSync(v));
|
|
assert.ok(source, 'Actual physical bytes are missing');
|
|
const bytes = fs.readFileSync(source); assert.equal(sha(bytes), row.bodySha256);
|
|
fs.copyFileSync(source, path.join(output, path.basename(source))); row.capturedBody = JSON.parse(bytes); row.localBodyFile = path.basename(source);
|
|
const matches = attempts.filter(a => a.status !== 'rejected' && (a.upstreamResponse?.requestId === row.physicalRequestId
|
|
|| !a.upstreamResponse?.requestId && a.requestSha256 === row.bodySha256 && row.receivedAt >= a.startedAt && row.receivedAt <= (a.finishedAt ?? '9999')));
|
|
assert.equal(matches.length, 1); const attempt = matches[0]; assert.equal(attempt.requestSha256, row.bodySha256);
|
|
const plan = plans.find(p => p.id === attempt.requestId); assert.ok(plan);
|
|
const dispatch = plan.mnemoDispatches?.find(d => d.wireAttemptId === attempt.wireAttemptId);
|
|
if (plan.mnemoMemoryArtifactId) { assert.ok(dispatch); assert.equal(dispatch.wireRequestSha256, row.bodySha256); }
|
|
}
|
|
assert.equal([...store.core.tool.values()].filter(t => t.runId === run.id).length, 0);
|
|
const result = { label, projectId: f.project.id, sessionId: session.id, taskId: session.taskId, runId: run.id, sessionStatus: session.status, plans: structuredClone(plans), attempts, physical: structuredClone(physical) };
|
|
runs.push(result); write('runs.json', runs);
|
|
for (const artifact of store.core.artifact.values()) if (!originalArtifacts.has(artifact.id)) originalArtifacts.set(artifact.id, { artifact: structuredClone(artifact), sha256: sha(store.artifactStore.readBytes(artifact)) });
|
|
return result;
|
|
}
|
|
function selected(result) { return result.plans.at(-1)?.mnemoSelectedRefs ?? []; }
|
|
function hasRemote(result) { return result.physical.some(p => JSON.stringify(p.capturedBody).includes('mnemo_project_memory')); }
|
|
async function sample(id, action) {
|
|
if (requestedCases && !requestedCases.has(id)) return;
|
|
const startedAt = new Date().toISOString();
|
|
try { const evidence = await action(); cases.push({ id, status: 'passed', startedAt, finishedAt: new Date().toISOString(), evidence }); console.log(id + ' passed'); }
|
|
catch (cause) { cases.push({ id, status: 'failed', startedAt, finishedAt: new Date().toISOString(), error: cause.stack }); console.log(id + ' failed: ' + cause.message); }
|
|
write('cases.json', cases); write('controls.json', controls);
|
|
if (args.includes('--fail-fast') && cases.at(-1).status === 'failed') throw new Error(id + ' failed; preserving this immutable run.');
|
|
}
|
|
try {
|
|
await sample('N01', async () => { const f = await fixture('N01', { enabled: false }), before = await control('observations'), r = await execute(f, 'N01');
|
|
const after = await control('observations'); assert.equal(before.bridge.length, after.bridge.length); assert.equal(hasRemote(r), false); assert.equal(r.physical.length, 1); return r.runId; });
|
|
await sample('N02', async () => { const f = await fixture('N02'); await action(f, 'confirm'); const r = await execute(f, 'N02'); assert.equal(selected(r).length, 1); assert.equal(hasRemote(r), true); return r.runId; });
|
|
await sample('N03', async () => { const f = await fixture('N03'), r = await execute(f, 'N03'); assert.equal(selected(r).length, 0); assert.equal(hasRemote(r), false); return r.runId; });
|
|
await sample('N04', async () => { const f = await fixture('N04'); await action(f, 'candidate'); const r = await execute(f, 'N04'); assert.equal(selected(r).length, 0); assert.equal(hasRemote(r), false); return r.runId; });
|
|
await sample('N05', async () => { const f = await fixture('N05'); await action(f, 'confirm'); const a = await execute(f, 'N05-old');
|
|
const m = store.core.memory.get(f.memory.id); m.content = '已明确更正的新合成约定。'; m.updatedAt = new Date().toISOString(); store.putRecord('memory', f.sourceSession, m, 'memory.synthetic_revision');
|
|
await action(f, 'confirm'); const b = await execute(f, 'N05-new'); assert.ok(selected(b)[0].sequence > selected(a)[0].sequence); assert.ok(JSON.stringify(b.physical[0].capturedBody).includes(m.content)); return [a.runId, b.runId]; });
|
|
await sample('N06', async () => { const f = await fixture('N06'); await action(f, 'confirm'); await execute(f, 'N06-before'); runtime.memoryManager().archive(f.sourceSession, f.memory.id);
|
|
const r = await execute(f, 'N06-after'); assert.equal(hasRemote(r), false); assert.equal((await bridge.view(f.project.id)).sources[0].state, 'archived'); return r.runId; });
|
|
await sample('N07', async () => { const expiresAt = new Date(Date.now() + 20000).toISOString(), f = await fixture('N07', { expiresAt }); await action(f, 'confirm');
|
|
const r = await execute(f, 'N07'), p = r.plans.at(-1), doc = JSON.parse(store.artifactStore.read(store.core.artifact.get(p.mnemoRecallArtifactId)));
|
|
assert.equal(selected(r).length, 1); assert.ok(Date.parse(doc.snapshot.expiresAt) <= Date.parse(expiresAt)); return r.runId; });
|
|
await sample('N08', async () => { const f = await fixture('N08'); await action(f, 'confirm'); const old = await execute(f, 'N08-old'); await action(f, 'delete');
|
|
const state = store.storage.meta('mnemoProjectMemoryBridge').projects[f.project.id]; assert.ok(state.events.every(e => e.input.memory === null && e.attempts.every(a => !a.request?.memory)));
|
|
const renewal = await control('renew', { bindingId: f.auth.binding.id, requestKey: randomUUID(), confirmed: true }), view = await bridge.view(f.project.id);
|
|
await bridge.configure(f.project.id, { enabled: true, expectedRevision: view.connection.revision, token: renewal.token }); await assert.rejects(action(f, 'confirm'), { code: 'PROJECT_SOURCE_DELETED' });
|
|
const r = await execute(f, 'N08-deleted'); assert.equal(hasRemote(r), false); return [old.runId, r.runId]; });
|
|
await sample('N09', async () => { const f = await fixture('N09'); await action(f, 'confirm'); const deletion = await control('delete-source', { bindingId: f.auth.binding.id, sourceId: f.memory.id, confirmed: true });
|
|
assert.equal(deletion.externalDeleted, false); await bridge.lookupSource(f.project.id, f.memory.id); assert.equal((await bridge.view(f.project.id)).sources[0].state, 'deleted'); const r = await execute(f, 'N09'); assert.equal(hasRemote(r), false); return r.runId; });
|
|
await sample('N10', async () => { const f = await fixture('N10'); await action(f, 'confirm'); await control('fault', { target: 'recall', mode: 'revoke_after_recall' });
|
|
const r = await execute(f, 'N10'); assert.equal(r.plans.length, 2); assert.equal(r.plans[0].mnemoDispatches[0].status, 'not_dispatched'); assert.equal(hasRemote(r), false); assert.equal(r.physical.length, 1); return r.runId; });
|
|
await sample('N11', async () => { const f = await fixture('N11'); await action(f, 'confirm'); const old = await bridge.context(f.sourceSession, '项目');
|
|
const oldClient = bridge.client(bridge.state(), f.project.id), renewal = await control('renew', { bindingId: f.auth.binding.id, requestKey: randomUUID(), confirmed: true });
|
|
await assert.rejects(oldClient.validate(old.snapshot, old.manifest)); const view = await bridge.view(f.project.id);
|
|
await bridge.configure(f.project.id, { enabled: true, expectedRevision: view.connection.revision, token: renewal.token }); const r = await execute(f, 'N11'); assert.equal(selected(r).length, 1);
|
|
const doc = JSON.parse(store.artifactStore.read(store.core.artifact.get(r.plans.at(-1).mnemoRecallArtifactId))); assert.notEqual(doc.snapshot.grantId, old.snapshot.grantId); return r.runId; });
|
|
await sample('N12', async () => { const f = await fixture('N12'); await action(f, 'confirm'); const original = bridge.beforePhysical.bind(bridge); let once = true;
|
|
bridge.beforePhysical = async (...a) => { if (once) { once = false; await new Promise(resolve => setTimeout(resolve, 31000)); } return original(...a); };
|
|
try { const r = await execute(f, 'N12'); assert.equal(r.plans.length, 2); assert.equal(hasRemote(r), false); return r.runId; } finally { bridge.beforePhysical = original; } });
|
|
for (const [id, mutation] of [['N13', f => { const m = store.core.memory.get(f.memory.id); m.content += '\n召回后改版。'; m.updatedAt = new Date().toISOString(); store.putRecord('memory', f.sourceSession, m, 'memory.synthetic_revision'); }],
|
|
['N14', f => fs.appendFileSync(path.join(f.projectRoot, 'README.md'), '\nSource changed after recall.\n')]]) {
|
|
await sample(id, async () => { const f = await fixture(id); await action(f, 'confirm'); const original = bridge.beforePhysical.bind(bridge); let once = true;
|
|
bridge.beforePhysical = async (...a) => { if (once) { once = false; mutation(f); } return original(...a); };
|
|
try { const r = await execute(f, id); assert.equal(hasRemote(r), false); assert.equal(r.plans.length, 2); return r.runId; } finally { bridge.beforePhysical = original; } });
|
|
}
|
|
await sample('N15', async () => { const a = await fixture('N15-a'), b = await fixture('N15-b', { enabled: false }); await action(a, 'confirm'); const view = await bridge.view(b.project.id);
|
|
await assert.rejects(bridge.configure(b.project.id, { enabled: true, baseUrl: c.origin, bindingId: a.auth.binding.id, token: a.auth.token, expectedRevision: view.connection.revision }));
|
|
const r = await execute(b, 'N15'); assert.equal(hasRemote(r), false); return r.runId; });
|
|
await sample('N16', async () => { const f = await fixture('N16'); await control('fault', { target: 'sync', mode: 'drop_after_commit' }); const before = await control('observations');
|
|
const v = await action(f, 'confirm'), source = v.sources[0]; assert.equal(source.syncStatus, 'unknown');
|
|
const saved = structuredClone(store.storage.meta('mnemoProjectMemoryBridge').projects[f.project.id].sources[f.memory.id].event);
|
|
assert.equal(saved.input.memory.content, f.memory.content); assert.equal(saved.requestKey, source.requestKey); write('N16-original-unknown.json', saved);
|
|
await bridge.lookupSource(f.project.id, f.memory.id); const restored = await bridge.view(f.project.id); assert.equal(restored.sources[0].syncStatus, 'committed'); assert.equal(restored.sources[0].requestKey, source.requestKey);
|
|
const after = await control('observations'); const syncs = values => values.filter(v => String(v.path ?? v.route ?? '').split('?')[0].endsWith('/sync') || v.operation === 'sync');
|
|
assert.equal(syncs(after.bridge).length - syncs(before.bridge).length, 1);
|
|
const r = await execute(f, 'N16'); assert.equal(selected(r).length, 1); return r.runId; });
|
|
await sample('N17', async () => { const f = await fixture('N17'); await action(f, 'confirm'); const state = bridge.state(), e = state.projects[f.project.id].sources[f.memory.id].event, client = bridge.client(state, f.project.id);
|
|
const altered = structuredClone(e.input); altered.memory.content += ' changed'; await assert.rejects(client.sync(altered));
|
|
const lower = structuredClone(e.input); lower.requestKey = randomUUID(); await assert.rejects(client.sync(lower)); const r = await execute(f, 'N17'); assert.equal(selected(r).length, 1); return r.runId; });
|
|
await sample('N18', async () => { const ids = [];
|
|
for (const [target, mode] of [['recall', 'content_corruption'], ['validate', 'invalid_json'], ['validate', 'wrong_validation']]) {
|
|
const f = await fixture('N18-' + mode); await action(f, 'confirm'); await control('fault', { target, mode }); const r = await execute(f, 'N18-' + mode); assert.equal(hasRemote(r), false); assert.equal(r.physical.length, 1); ids.push(r.runId);
|
|
} return ids; });
|
|
await sample('N19', async () => { const f = await fixture('记忆子集A');
|
|
const second = await runtime.memoryManager().create(f.sourceSession, { title: '记忆子集B', content: '第二条合成约定,供规划器整条选择。' });
|
|
await action(f, 'confirm'); await action(f, 'confirm', second); const view = await bridge.view(f.project.id);
|
|
await bridge.configure(f.project.id, { enabled: true, expectedRevision: view.connection.revision, selectionLimit: 1 });
|
|
const r = await execute(f, 'N19', '记忆子集'), p = r.plans.at(-1), recall = JSON.parse(store.artifactStore.read(store.core.artifact.get(p.mnemoRecallArtifactId))), doc = JSON.parse(store.artifactStore.read(store.core.artifact.get(p.mnemoMemoryArtifactId)));
|
|
assert.equal(recall.entries.length, 2); assert.equal(doc.entries.length, 1); assert.notEqual(p.mnemoRecallContextDigest, p.mnemoSelectedContextDigest);
|
|
assert.equal(p.mnemoSelectedContextDigest, contextDigest(doc.entries)); assert.deepEqual(p.mnemoSelectedRefs, doc.entries.map(entryRef));
|
|
assert.ok(JSON.stringify(r.physical[0].capturedBody).includes('mnemo_project_memory')); return r.runId; });
|
|
await sample('N20', async () => { const f = await fixture('N20', { content: '完整本地正文。'.repeat(1900) }), original = f.memory.content; await assert.rejects(action(f, 'confirm'));
|
|
const r = await execute(f, 'N20'); assert.equal(hasRemote(r), false); assert.ok(JSON.stringify(r.physical[0].capturedBody).includes(original)); assert.equal(store.core.memory.get(f.memory.id).content, original);
|
|
assert.equal(r.physical[0].capturedBody.max_tokens, undefined); return r.runId; });
|
|
await sample('N21', async () => { const f = await fixture('N21'); await action(f, 'confirm'); await control('fault', { target: 'provider', mode: 'drop_after_receipt' });
|
|
const r = await execute(f, 'N21'); assert.equal(r.attempts.length, 1); assert.equal(r.attempts[0].status, 'unknown'); assert.equal(r.plans.at(-1).mnemoDispatches[0].status, 'unknown'); return r.runId; });
|
|
await sample('N22', async () => { const f = await fixture('N22'); await action(f, 'confirm');
|
|
const originalConfig = structuredClone(store.config), second = hub.upsert({ name: '本机SSE变体', model: 'mnemo-joint-fixture-sse', baseUrl: c.providerBaseUrl + '/v1', protocol: 'chat-completions', requiresKey: true, apiKey: c.providerToken, streaming: true });
|
|
const pool = hub.pool({ name: '显式合成两尝试', members: [{ connectionId: member.id }, { connectionId: second.id }], strategy: 'round-robin', maxAttempts: 2, sticky: false });
|
|
hub.select({ type: 'pool', id: pool.id }); store.saveConfig({ capacityMode: 'model' });
|
|
try {
|
|
await control('fault', { target: 'provider', mode: 'http_error' }); const r = await execute(f, 'N22');
|
|
assert.equal(r.attempts.length, 2); assert.equal(r.physical.length, 2); assert.deepEqual(r.attempts.map(a => a.status).sort(), ['completed', 'failed']);
|
|
assert.equal(r.plans.at(-1).mnemoDispatches.length, 2); assert.notEqual(r.attempts[0].wireAttemptId, r.attempts[1].wireAttemptId);
|
|
assert.ok(r.plans.at(-1).mnemoDispatches.every(d => d.validationArtifactId && d.wireRequestSha256));
|
|
assert.equal(r.attempts.filter(a => a.usageStatus === 'reported').length, 1); return r.runId;
|
|
} finally { store.saveConfig(originalConfig); hub.select({ type: 'connection', id: member.id }); }
|
|
});
|
|
await sample('N23', async () => { const f = await fixture('N23'); await action(f, 'confirm'); const oldState = structuredClone(store.storage.meta('mnemoProjectMemoryBridge')); await action(f, 'delete');
|
|
store.storage.transaction(() => store.storage.setMeta('mnemoProjectMemoryBridge', oldState)); const restored = new MnemoBridge(store), view = await restored.view(f.project.id);
|
|
assert.equal(view.connection.hasToken, false); assert.equal(view.sources[0].state, 'deleted'); assert.ok(store.storage.meta('mnemoProjectMemoryBridge').projects[f.project.id].events.every(e => e.input.memory === null));
|
|
const renewal = await control('renew', { bindingId: f.auth.binding.id, requestKey: randomUUID(), confirmed: true }); await restored.configure(f.project.id, { enabled: true, expectedRevision: view.connection.revision, token: renewal.token });
|
|
await assert.rejects(restored.changeSource(f.project.id, f.memory.id, { action: 'confirm', confirmed: true, expectedDigest: view.sources[0].confirmationDigest }), { code: 'PROJECT_SOURCE_DELETED' });
|
|
// Runtime retains its own old credential revision; it cannot reuse it after restore.
|
|
const r = await execute(f, 'N23'); assert.equal(hasRemote(r), false); return r.runId; });
|
|
await sample('N24', async () => { const f = await fixture('N24'); await action(f, 'candidate'); const a = await execute(f, 'N24-candidate'); await action(f, 'confirm');
|
|
const b = await execute(f, 'N24-confirmed'); assert.equal(hasRemote(a), false); assert.equal(selected(b)[0].sequence, 2); return [a.runId, b.runId]; });
|
|
} finally {
|
|
try {
|
|
for (const value of originalArtifacts.values()) assert.equal(sha(store.artifactStore.readBytes(value.artifact)), value.sha256, 'Original request/artifact drift');
|
|
write('original-artifacts.json', [...originalArtifacts.entries()].map(([id, value]) => ({ id, sha256: value.sha256, kind: value.artifact.kind })));
|
|
write('final-observations.json', await control('observations')); write('controls.json', controls);
|
|
write('result.json', { at: new Date().toISOString(), instanceId: c.instanceId, connectionFileRead: connectionPath, cases, runs: runs.map(r => ({ label: r.label, runId: r.runId })),
|
|
artifactCount: originalArtifacts.size, sourceVersion: store.config.version ?? null, realModelCalls: 0, productionAccessed: false,
|
|
notClaimed: ['real model quality', 'autonomous delivery', 'Purge benefit', 'global provider compatibility', 'long-term validation'], pending: ['N25'] });
|
|
} finally { await runtime.stopAll(); store.close(); }
|
|
}
|
|
if (cases.some(c => c.status !== 'passed')) process.exitCode = 1;
|
|
console.log(JSON.stringify({ output, passed: cases.filter(c => c.status === 'passed').length, failed: cases.filter(c => c.status === 'failed').length }));
|