test: preserve concurrent client work during frozen native validation

This commit is contained in:
Agent Workbench Dev
2026-11-06 13:41:30 +08:00
parent e3fbf034f1
commit 01e64f3fcf
3 changed files with 14 additions and 2 deletions
+8 -2
View File
@@ -14,7 +14,13 @@ const fixturePath = process.argv[2]; assert.ok(fixturePath, 'The completed open
const fixture = JSON.parse(fs.readFileSync(fixturePath)); assert.equal(fixture.success, true); assert.equal(fixture.realModelRequests, 0);
assert.equal(fixture.completeSamples, 4); assert.equal(fixture.originalStateAuditPassed, true); assert.equal(fixture.actualBatchDriverExecuted, true);
purgeEvidence(); assert.equal(fs.existsSync(root), false, 'Never refreeze AF after observing any real result.');
assert.equal(execFileSync('git', ['status', '--porcelain'], { encoding: 'utf8', windowsHide: true }).trim(), '');
const git = args => execFileSync('git', args, { encoding: 'utf8', windowsHide: true });
const workingChanges = { tracked: git(['diff', '--name-only', 'HEAD', '-z']).split('\0').filter(Boolean),
untracked: git(['ls-files', '--others', '--exclude-standard', '-z']).split('\0').filter(Boolean) };
for (const name of [...workingChanges.tracked, ...workingChanges.untracked])
assert.ok(['src/client/', 'docs/orven/', 'output/'].some(prefix => name.startsWith(prefix)), 'An uncommitted effective input may affect AF: ' + name);
// Concurrent client-only design work does not enter the installed Node engine,
// this driver or the isolated benchmark. Preserve it and record paths only.
const { api, boot, close } = await client();
try {
await inspectorClosed(); const host = await api('/host/status'), center = await api('/model-center');
@@ -28,7 +34,7 @@ try {
assert.equal(installation.controlledStatus, 'available'); assert.equal(source.status, 'available');
const baseline = await publicSnapshot('http://127.0.0.1:4318', host.identity.dataRoot);
save('current.json', { host, config: boot.config, center, connection, originalProjects: boot.projects, originalPublicMetadata: publicMetadata(host.identity.dataRoot),
baseline, installation, source, order, allowed, goal, purgePrompt, observations, fixturePath, fixture,
baseline, installation, source, order, allowed, goal, purgePrompt, observations, fixturePath, fixture, workingChanges,
driverCommit: execFileSync('git', ['rev-parse', 'HEAD'], { encoding: 'utf8', windowsHide: true }).trim() });
console.log(JSON.stringify({ frozen: true, requests: 0, driverCommit: JSON.parse(fs.readFileSync(root + '/current.json')).driverCommit,
version: boot.version, pid: host.identity.pid, projects: baseline.projects, sessions: baseline.database.sessionIds.length,
+4
View File
@@ -85,6 +85,10 @@ try {
assert.equal(installation.controlledSha256, frozen.installation.controlledSha256);
assert.equal(source.sourceSha256, frozen.source.sourceSha256); assert.equal(source.runtimeSha256, frozen.source.runtimeSha256);
const current = await api('/model-center');
const currentHost = await api('/host/status'), currentBoot = await api('/bootstrap');
assert.equal(currentHost.identity.pid, frozen.host.identity.pid); assert.equal(currentHost.identity.instanceId, frozen.host.identity.instanceId);
assert.equal(currentHost.identity.runtimeRoot, frozen.host.identity.runtimeRoot); assert.equal(currentBoot.version, '1.25.8');
compareConfig(read('active-model.json').config, currentBoot.config);
assert.deepEqual(connectionDefinition(current.connections.find(row => row.id === original.id)), connectionDefinition(configured));
assert.deepEqual(current.selected, { type: 'connection', id: original.id });
own = prepareNode(path.join(root, prefix), store);