Files
Agent-Workbench/docs/working-memory-u-evidence/drivers/working-memory-u-freeze.mjs.txt
T
2026-11-04 08:39:17 +08:00

16 lines
1.5 KiB
Plaintext

import fs from 'node:fs';
import path from 'node:path';
import assert from 'node:assert/strict';
import { execFileSync } from 'node:child_process';
import { createHash } from 'node:crypto';
const root = '.qa/working-memory-u/release'; fs.mkdirSync(root, { recursive: true });
assert.equal(execFileSync('git', ['status', '--porcelain'], { encoding: 'utf8' }).trim(), '');
const names = execFileSync('git', ['ls-files', '-z', '--', 'src', 'public', 'scripts', 'tests', 'examples', 'benchmarks', 'research', 'package.json', 'package-lock.json', 'vite.config.ts', 'tsconfig.json', 'index.html', 'mobile.html'], { encoding: 'utf8' }).split('\0').filter(Boolean);
const record = file => { const bytes = fs.readFileSync(file); return { path: file.replaceAll('\\', '/'), bytes: bytes.length, sha256: createHash('sha256').update(bytes).digest('hex') }; };
const walk = folder => fs.readdirSync(folder, { withFileTypes: true }).flatMap(entry => entry.isDirectory() ? walk(path.join(folder, entry.name)) : [path.join(folder, entry.name)]);
const value = { sourceCommit: execFileSync('git', ['rev-parse', 'HEAD'], { encoding: 'utf8' }).trim(), version: '1.24.8',
files: names.sort().map(record), compiled: ['dist-client', 'dist-server', 'dist-desktop'].flatMap(walk).sort().map(record),
createdAt: new Date().toISOString(), realModelRequests: 0 };
fs.writeFileSync(path.join(root, 'product-freeze.json'), JSON.stringify(value, null, 2) + '\n', { flag: 'wx' });
console.log(JSON.stringify({ sourceCommit: value.sourceCommit, sourceInputs: value.files.length, compiled: value.compiled.length }));