From a3210fa55926da3ff5567c48aab3380b16350e2b Mon Sep 17 00:00:00 2001 From: Agent Workbench Dev Date: Wed, 4 Nov 2026 20:21:33 +0800 Subject: [PATCH] fix(qa): freeze live sample against the installed source commit --- docs/LIVE-DELIVERY-X-PLAN.md | 2 ++ scripts/live-x/initial.mjs | 11 +++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/docs/LIVE-DELIVERY-X-PLAN.md b/docs/LIVE-DELIVERY-X-PLAN.md index 75754efa..ab7e45c5 100644 --- a/docs/LIVE-DELIVERY-X-PLAN.md +++ b/docs/LIVE-DELIVERY-X-PLAN.md @@ -8,6 +8,8 @@ 按顺序只执行一次:所属DNS/TCP/TLS诊断(0HTTP/模型)→无工具身份预检(1请求/256输出/16000报告tokens上限)→Node。诊断仅记录不阻断,预检失败则不发工程请求;未知消费不重试、不切池。 +初始冻结逐字节核对正式安装清单与已验候选,sourceCommit记录该候选的真实源码提交;验收文档补交后的仓库HEAD另记reviewedHead,不将文档提交混为已部署代码来源。 + Node沿用原费用工程、三模块、九测试、build、11文件及owner staged/unstaged/untracked保护,目标原文与W一致。16K上下文、2048输出、1600安全余量、累计8请求/90000tokens/600000ms不提高。先保存真实失败基线,再让模型读取和实现;监督只批准原检查、审查应用模型完整变更集及确认模型Git计划,不提供实现或催写提示。审查后同Task续接按剩余请求数,失败/预算/无进展即封存,不自动重放。 ## 验收与后续 diff --git a/scripts/live-x/initial.mjs b/scripts/live-x/initial.mjs index ae41d2fa..33af0509 100644 --- a/scripts/live-x/initial.mjs +++ b/scripts/live-x/initial.mjs @@ -3,7 +3,7 @@ import path from 'node:path'; import assert from 'node:assert/strict'; import { execFileSync } from 'node:child_process'; import { publicSnapshot } from './state.mjs'; -import { root, origin, connectionId } from './common.mjs'; +import { root, origin, connectionId, sha } from './common.mjs'; // Read-only freeze of the formal 1.25.2 state before sample X. 0 model requests. assert.equal(fs.existsSync(root), false, 'Sample X is frozen once; never overwrite.'); assert.equal(execFileSync('git', ['status', '--porcelain'], { encoding: 'utf8', windowsHide: true }).trim(), '', 'Freeze from a committed tree.'); @@ -19,9 +19,16 @@ assert.equal(connection.modelIdentityPolicy ?? 'record', 'record'); assert.equal(center.connections.find(c => c.id === '09b0293b-faad-45c3-832d-7c8b615813aa').enabled, false); assert.deepEqual(center.selected, { type: 'pool', id: '68e30376-b799-445b-a858-db2dba9920a0' }); const baseline = await publicSnapshot(origin, host.identity.dataRoot); assert.deepEqual(baseline.active, []); +const candidate = JSON.parse(fs.readFileSync('releases/latest.json', 'utf8')); +const runtimeManifest = fs.readFileSync(path.join(boot.runtimeRoot, 'MANIFEST.json')); +assert.equal(JSON.parse(runtimeManifest).version, '1.25.2'); +assert.equal(sha(runtimeManifest), sha(fs.readFileSync(path.join(candidate.portableRoot, 'MANIFEST.json'))), 'Freeze the actual accepted installed candidate.'); +const sourceCommit = candidate.documentation.sourceCommit; +assert.match(sourceCommit, /^[a-f0-9]{40}$/); +const reviewedHead = execFileSync('git', ['rev-parse', 'HEAD'], { encoding: 'utf8', windowsHide: true }).trim(); fs.mkdirSync(root, { recursive: true }); fs.writeFileSync(path.join(root, 'current.json'), JSON.stringify({ host, config: boot.config, projects: boot.projects, center, baseline, - connectionRevision: connection.revision, sourceCommit: execFileSync('git', ['rev-parse', 'HEAD'], { encoding: 'utf8' }).trim(), + connectionRevision: connection.revision, sourceCommit, reviewedHead, runtimeManifestSha256: sha(runtimeManifest), observedAt: new Date().toISOString() }, null, 2), { flag: 'wx' }); console.log(JSON.stringify({ success: true, version: boot.version, pid: host.identity.pid, projects: baseline.projects, sessions: baseline.exports.length, connectionId, connectionRevision: connection.revision, modelRequests: 0 }));