16 lines
2.7 KiB
JavaScript
16 lines
2.7 KiB
JavaScript
import fs from 'node:fs';
|
||
import path from 'node:path';
|
||
import assert from 'node:assert/strict';
|
||
import { createHash } from 'node:crypto';
|
||
import { execFileSync } from 'node:child_process';
|
||
const hash=bytes=>createHash('sha256').update(bytes).digest('hex');
|
||
const identity=JSON.parse(fs.readFileSync('docs/model-protocols-release-identity.json'));
|
||
assert.equal(identity.success,true);assert.equal(execFileSync('git',['status','--porcelain'],{encoding:'utf8',windowsHide:true}).trim(),'');
|
||
const commit=execFileSync('git',['rev-parse','HEAD'],{encoding:'utf8',windowsHide:true}).trim();
|
||
const base=path.join('releases',path.basename(identity.release.portableRoot)),markdown=base+'-ACCEPTANCE.md',json=base+'-ACCEPTANCE.json';
|
||
for(const file of [markdown,json])assert.equal(fs.existsSync(file),false);
|
||
const artifacts=['installer','portable','source'].map(kind=>{const item=identity.release[kind],bytes=fs.readFileSync(item.path);assert.equal(hash(bytes),item.sha256);assert.equal(bytes.length,item.bytes);return {kind,filename:path.basename(item.path),bytes:item.bytes,sha256:item.sha256};});
|
||
const text='# Agent Workbench 1.17.0 本地发行验收\n\nChat/Responses实际协议、有界SSE、能力路由及原请求证据已完整交付。独立源码558/558、25类191组历史UI、实际原生窗口/工程、两协议三工程、同载荷安装与保留原PID36552/Provider/全部数据升级通过。原失败单独保留,协议夹具不代替模型推理能力。\n\n视觉/语音仍为后续能力;真实模型工程/Purge收益独立待验。本轮没有新增iPhone实机流式结论,实际TLS/Edge伴随端与1.16用户实机记录分别保存。正式手机网关继续关闭,无QA证书/设备迁入。\n\n原安装包/ZIP不回写,包内说明为构建时快照。最终记录见[验收](../docs/QA-1.17.md)、[回顾](../docs/RETROSPECTIVE-1.17.md)、[身份](../docs/model-protocols-release-identity.json)与[下一阶段](../docs/PLAN-1.18.md)。\n\n本地Git:`'+commit+'`;产品/QA输入来源:`'+identity.codeCommit+'`。\n\n| 工件 | 字节 | SHA-256 |\n| --- | ---: | --- |\n'+artifacts.map(x=>'| '+x.filename+' | '+x.bytes+' | `'+x.sha256+'` |').join('\n')+'\n';
|
||
fs.writeFileSync(markdown,text,{flag:'wx'});fs.writeFileSync(json,JSON.stringify({success:true,at:new Date().toISOString(),localGitCommit:commit,identityPath:'docs/model-protocols-release-identity.json',identitySha256:hash(fs.readFileSync('docs/model-protocols-release-identity.json')),artifacts,notes:{path:markdown,sha256:hash(Buffer.from(text))},identity,scope:'Detached final acceptance; immutable executable and archives remain exact.'},null,2)+'\n',{flag:'wx'});
|
||
console.log(JSON.stringify({success:true,commit,markdown,json}));
|