docs(live): preserve AD compatibility errors and original-state audit

This commit is contained in:
Agent Workbench Dev
2026-11-06 12:52:01 +08:00
parent ed78f02c03
commit 3b1510f83e
2 changed files with 135 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
# AD:1.25.8 默认透传下的真实兼容与工程验证
程序来源a6e31dec,正式1.25.8/PID71628/instance37d6b536-c0dc-4cbf-9c51-095bbe779062。新契约见[LIVE-VALIDATION-AD-PLAN.md](LIVE-VALIDATION-AD-PLAN.md),驱动来源9c60c111及补充公开原状态冻结ed78f02c。没有续跑任何历史样本或用户项目,不委派、不推送、不触真实Key;现有unrestricted/full/passthrough及「高性能」池保持。
本机驱动验证:三协议×文本/工具6/6通过;独立固定Node夹具3请求,原九测试/build、实际Git及owner暂存/未暂存/未跟踪保护通过。夹具含固定实现,仅证明驱动与执行通路。首健康状态exact断言、次Responses夹具把completed误当HTTP状态的原失败均保留,不能归因真实网络。
## 真实供应商兼容
五个DNS/TLS诊断均通过,但不代表HTTP接口或目录成功。每条连接文本/工具各一个新会话、各一次真实请求,未自动重试、换线或执行echo工具;请求未包含max_tokens/max_output_tokens/max_completion_tokens,未修改原生参数或默认额度。
| 连接/协议 | 目录预览 | 文本/工具 | 本次工程前置 |
| --- | --- | --- | --- |
| DeepSeek / Chat | 完整2型号,含deepseek-flash | 2/2,完整matched、nonce正确 | 通过,按预先优先序选中 |
| jojocode / Chat | /models发生ECONNRESET,保留502及原因链 | 2/2,完整matched、nonce正确 | 未通过目录前置 |
| apikey / Chat | 完整5型号,含gpt-6.1-sol | 2/2,完整matched、nonce正确 | 通过 |
| apikey / Responses | 完整6型号,含gpt-6.1-sol | 2/2,完整matched、nonce正确 | 通过 |
| apikey-Claude / Messages | /v1/models?limit=100发生UND_ERR_SOCKET | 0/2,HTTP400:missing field max_tokens | 未通过 |
Claude两次原400响应、请求ID和完整152字节错误工件均保存;上游要求Messages必填max_tokens,这与本批“完全省略输出额度字段”的契约存在明确兼容边界。不偷偷补任意额度,不将此错误归因为历史GPT分组/返回型号混淆,本次没有获得完整模型身份。目录连接中断也不记为模型不存在。十次推理请求中八次有上游用量、两次unknown;不把HTTP400推定为零计费,也不把本地估算当实际消费。目录为规范化预览,无原HTTP响应工件,不补造。
兼容后只读对账通过:原85项目/105会话的46111原持久行逐项核对,项目位置仅因前插5个新实验项目增加5;原105导出和全部原工件字节保持,原尝试每项保持,凭据原行SHA不变。新增5项目/10会话/200事件及outbox/80执行记录/38去重工件均属于本批;原连接定义/池/选择/配置exact,health观察更新另存,configRevision仍110。审计`.qa/live-validation-ad/audits/compatibility-038b747c-c084-42fb-a63d-4849a8013a73`,窗口0/空闲/9229关闭。
## 独立工程与未验证项
Node即将按已冻结契约使用DeepSeek开展一次新工程;不会按其它线路补跑同一失败样本,也不供应实现答案或人工继续。Node通过前,React/Python/原版Purge AB/BA未执行,收益unknown。
本次短预检通过仅说明所观测协议/型号标识/文本及工具结构可用,不证明权重、长期稳定、自主工程交付、普遍重复读取改善、缓存收益或真实异常预留排除边界。所有历史失败和原有限预算样本保持。
+108
View File
@@ -0,0 +1,108 @@
import fs from 'node:fs';
import path from 'node:path';
import assert from 'node:assert/strict';
import { randomUUID } from 'node:crypto';
import { DatabaseSync } from 'node:sqlite';
import { publicSnapshot, digest, canonical } from '../retained-host-state.mjs';
import { root, origin, read, save, client, publicMetadata, compareConfig, sha } from './common.mjs';
import { inspectorClosed } from './inspector.mjs';
// Each read-only audit has a new identity; a failed audit is never overwritten.
const stage = process.argv.includes('--compatibility') ? 'compatibility' : 'node';
const prefix = 'audits/' + stage + '-' + randomUUID(), frozen = read('current.json'), compatibility = read('compatibility/result.json'), node = stage === 'compatibility' ? { executed:false, success:false, notYetRun:true } : read('node/result.json');
const { api, boot, close } = await client(); let result;
try {
await inspectorClosed(); const host = await api('/host/status'); assert.equal(host.activity.active, false); assert.equal(host.desktopWindows.count, 0);
assert.equal(host.identity.pid, frozen.host.identity.pid); assert.equal(host.identity.instanceId, frozen.host.identity.instanceId); assert.equal(boot.version, '1.25.8');
const after = await publicSnapshot(origin, host.identity.dataRoot); save(prefix + '/after.json', after);
const before = frozen.baseline, metaBefore = frozen.originalPublicMetadata, metaAfter = publicMetadata(host.identity.dataRoot);
const ownedSessionIds = new Set(compatibility.results.flatMap(row => row.preflights.map(value => value.sessionId)).concat(node.sessionId ? [node.sessionId] : []));
const ownedProjectIds = new Set(compatibility.results.map(row => row.projectId));
if (node.executed) ownedProjectIds.add(read('node/owned.json').project.id);
assert.deepEqual(new Set(boot.projects.filter(row => !frozen.originalProjects.some(value => value.id === row.id)).map(row => row.id)), ownedProjectIds);
assert.deepEqual(boot.projects.filter(row => !ownedProjectIds.has(row.id)), frozen.originalProjects);
assert.deepEqual(after.database.sessionIds.filter(id => !before.database.sessionIds.includes(id)).sort(), [...ownedSessionIds].sort());
const configComparison = compareConfig(metaBefore.config, metaAfter.config);
assert.deepEqual(metaAfter.modelAttempts.slice(0, metaBefore.modelAttempts.length), metaBefore.modelAttempts, 'Every original model attempt stays exact.');
const newAttempts = metaAfter.modelAttempts.slice(metaBefore.modelAttempts.length); assert.ok(newAttempts.every(row => ownedSessionIds.has(row.sessionId)));
assert.deepEqual(metaAfter.modelNetworkDiagnostics.slice(0, metaBefore.modelNetworkDiagnostics.length), metaBefore.modelNetworkDiagnostics);
const newDiagnostics = metaAfter.modelNetworkDiagnostics.slice(metaBefore.modelNetworkDiagnostics.length);
const knownDiagnosticIds = compatibility.results.map(row => read('compatibility/' + row.connectionId + '/network-start.json').job.id);
assert.deepEqual(new Set(newDiagnostics.map(row => row.id)), new Set(knownDiagnosticIds));
const oldRegistry = structuredClone(metaBefore.modelRegistry), currentRegistry = structuredClone(metaAfter.modelRegistry), registryChanges = {};
if (node.executed) {
const original = oldRegistry.connections.find(row => row.id === node.connectionId), actual = currentRegistry.connections.find(row => row.id === node.connectionId);
assert.ok(original && actual); assert.equal(actual.revision, original.revision + 2); assert.ok(actual.updatedAt >= original.updatedAt);
assert.equal(actual.modelIdentityPolicy, original.modelIdentityPolicy ?? 'record'); assert.deepEqual(actual.modelIdentityAliases, original.modelIdentityAliases ?? []); assert.equal(actual.modelIdentityAliasSource, original.modelIdentityAliasSource ?? '');
const normalized = { ...actual, revision: original.revision, updatedAt: original.updatedAt };
for (const key of ['modelIdentityPolicy','modelIdentityAliases','modelIdentityAliasSource']) if (!Object.hasOwn(original,key)) delete normalized[key];
assert.deepEqual(normalized, original);
assert.equal(currentRegistry.revision, oldRegistry.revision + 4);
registryChanges.connection = { id: node.connectionId, originalRevision: original.revision, currentRevision: actual.revision, originalUpdatedAt: original.updatedAt, currentUpdatedAt: actual.updatedAt,
explicitIdentityDefaults: ['modelIdentityPolicy','modelIdentityAliases','modelIdentityAliasSource'].filter(key=>!Object.hasOwn(original,key)), originalOrder: oldRegistry.connections.map(row=>row.id), currentOrder: currentRegistry.connections.map(row=>row.id) };
currentRegistry.revision = oldRegistry.revision;
currentRegistry.connections = oldRegistry.connections.map(value => value.id === original.id ? normalized : currentRegistry.connections.find(row=>row.id===value.id));
}
assert.deepEqual(currentRegistry, oldRegistry, 'Registry differs only by declared temporary policy/selection revisions, time and order.');
assert.deepEqual(after.modelCenter.selected, frozen.center.selected); assert.deepEqual(after.modelCenter.pools, frozen.center.pools);
for (const old of frozen.center.connections) {
const current = after.modelCenter.connections.find(row => row.id === old.id); assert.ok(current);
assert.equal(current.hasKey, old.hasKey); assert.equal(current.credentialRevision, old.credentialRevision);
}
const exportMap = new Map(after.exports.map(row=>[row.id,row])), artifactMap = new Map(after.persistent.artifacts.map(row=>[row.path,row]));
for (const original of before.exports) assert.deepEqual(exportMap.get(original.id), original, 'Original session export ' + original.id);
for (const original of before.persistent.artifacts) assert.deepEqual(artifactMap.get(original.path), original, 'Original artifact ' + original.path);
const db = new DatabaseSync(path.join(host.identity.dataRoot,'workbench.sqlite'), { readOnly: true });
const addedRows = {}; let checkedOriginalRows = 0;
try {
assert.deepEqual(Object.keys(after.database.tables),Object.keys(before.database.tables));
for (const [table, oldTable] of Object.entries(before.database.tables)) {
const nextTable = after.database.tables[table]; assert.equal(nextTable.schemaSha256,oldTable.schemaSha256); addedRows[table] = nextTable.count-oldTable.count;
const originals = new Set(oldTable.rows.map(row => (row.kind ?? '') + ':' + row.id)), nextRows = new Map(nextTable.rows.map(row => [(row.kind ?? '')+':'+row.id,row]));
for (const row of oldTable.rows) {
const current = nextRows.get((row.kind ?? '')+':'+row.id);
if (table === 'sqlite_sequence') {
const current = db.prepare('SELECT * FROM sqlite_sequence WHERE name=?').get('events'); assert.equal(current.seq,after.eventCursor);
assert.equal(digest({ ...current, seq:before.eventCursor }),row.sha256);
} else if (table === 'projects') {
const current = db.prepare('SELECT * FROM projects WHERE id=?').get(row.id); assert.equal(digest({...current,position:current.position-ownedProjectIds.size}),row.sha256);
} else if (table === 'metadata' && Object.hasOwn(metaBefore,row.id)) {
const original = db.prepare('SELECT * FROM metadata WHERE key=?').get(row.id);
assert.equal(digest({...original,value:JSON.stringify(metaBefore[row.id])}),row.sha256);
} else { assert.ok(current, table+': missing '+row.id); assert.equal(current.sha256,row.sha256,table+': changed '+row.id); }
checkedOriginalRows++;
}
if (['events','records','sessions'].includes(table)) {
const ownerColumns = table === 'records' ? 'id,kind,session_id,project_id' : table === 'events' ? 'id,session_id,project_id' : 'id,project_id';
for (const row of db.prepare('SELECT '+ownerColumns+' FROM '+table).all()) if (!originals.has((row.kind ?? '')+':'+row.id)) {
if (table === 'sessions') assert.ok(ownedSessionIds.has(row.id)); else assert.ok(ownedSessionIds.has(row.session_id)); assert.ok(ownedProjectIds.has(row.project_id));
}
} else if (table === 'outbox') {
for (const row of db.prepare('SELECT outbox.seq,events.session_id FROM outbox JOIN events USING(seq) WHERE outbox.seq>?').all(before.eventCursor)) assert.ok(ownedSessionIds.has(row.session_id));
} else if (table === 'metadata') assert.equal(addedRows[table],0);
else if (table === 'sqlite_sequence') assert.equal(nextTable.count,1);
}
const referencedArtifacts = new Map(db.prepare("SELECT payload FROM records WHERE kind='artifact'").all().map(row=>{const value=JSON.parse(row.payload); return [value.relative,value];}));
const oldArtifactPaths = new Set(before.persistent.artifacts.map(row=>row.path));
for (const artifact of after.persistent.artifacts) if (!oldArtifactPaths.has(artifact.path)) {
const reference = referencedArtifacts.get(artifact.path); assert.ok(reference && ownedSessionIds.has(reference.sessionId), 'New artifact must belong to this batch.');
assert.equal(reference.bytes,artifact.bytes); assert.equal(reference.sha256,artifact.sha256);
}
} finally { db.close(); }
for (const original of before.persistent.files) {
const actual = after.persistent.files.find(row=>row.path===original.path); assert.ok(actual);
if (original.path === 'config.json' && actual.sha256 !== original.sha256) {
const actualConfig = JSON.parse(fs.readFileSync(path.join(host.identity.dataRoot,original.path),'utf8'));
assert.deepEqual(actualConfig,metaAfter.config);
assert.equal(sha(JSON.stringify({...actualConfig,configRevision:metaBefore.config.configRevision},null,2)+'\n'),original.sha256,'Original config bytes reconstructed exactly after the declared revision increment.');
} else assert.equal(actual.sha256,original.sha256);
}
const newArtifactCount = after.persistent.artifacts.length-before.persistent.artifacts.length;
result = { success:true, stage, version:boot.version,pid:host.identity.pid,originalProjects:frozen.originalProjects.length,originalSessions:before.database.sessionIds.length,
addedProjects:ownedProjectIds.size,addedSessions:ownedSessionIds.size,addedRows,newArtifactCount,checkedOriginalRows, originalSessionExports:'exact',originalArtifactBytes:'exact',
originalRows:'exact except explicitly reconciled project positions, event sequence and four public metadata rows',configComparison,registryChanges,
oldCredentialRow:'exact hash, never decrypted or copied',oldModelAttempts:'every original entry exact',newModelAttempts:newAttempts.length,inspectorClosed:true,keysReadOrResaved:false,
reactPythonExecuted:false,purgeExecuted:false,nodePassed:node.success };
} catch (error) { result = {success:false,error:error.stack,keysReadOrResaved:false};process.exitCode=1; }
finally { save(prefix+'/result.json',result);await close(); }
console.log(JSON.stringify({prefix,...result}));