fix: show active passthrough capacity and separate program source publication
This commit is contained in:
@@ -7,6 +7,25 @@ export const REQUIRED_REPORTS = Object.freeze(['docs/RESEARCH.md', 'docs/researc
|
||||
const hash = bytes => createHash('sha256').update(bytes).digest('hex');
|
||||
const simple = value => value.replaceAll('\\', '/');
|
||||
|
||||
// Program publication carries readable guides, independently of historical
|
||||
// experiment archives and the data of any installed Workbench instance.
|
||||
export function createProgramGuides({ root, portableRoot, sourceCommit }) {
|
||||
const selected = fs.readdirSync(path.join(root, 'docs')).filter(name => name.endsWith('.md')).map(name => 'docs/' + name);
|
||||
for (const name of fs.readdirSync(path.join(root, 'docs/research'))) if (/\.(?:md|json)$/.test(name)) selected.push('docs/research/' + name);
|
||||
const shipped = [];
|
||||
for (const relative of selected) {
|
||||
const source = path.join(root, relative);
|
||||
if (!fs.lstatSync(source).isFile()) continue;
|
||||
const target = path.join(portableRoot, relative); fs.mkdirSync(path.dirname(target), { recursive: true });
|
||||
fs.copyFileSync(source, target);
|
||||
const bytes = fs.readFileSync(target); shipped.push({ path: relative, bytes: bytes.length, sha256: hash(bytes) });
|
||||
}
|
||||
fs.copyFileSync(path.join(root, 'README.md'), path.join(portableRoot, 'README.md'));
|
||||
const result = { schema: 1, sourceCommit, scope: 'Program and text guides only. Historical evidence stays at its original repository paths and is not required to run the program.', shipped };
|
||||
fs.writeFileSync(path.join(portableRoot, 'DOCUMENTATION.json'), JSON.stringify(result, null, 2) + '\n');
|
||||
return result;
|
||||
}
|
||||
|
||||
export function createDocumentationBundle({ root, portableRoot, evidenceRoot, archiveName, sourceCommit }) {
|
||||
if (!/^[a-f0-9]{40}$/.test(sourceCommit) || !/^[A-Za-z0-9._-]+\.zip$/.test(archiveName)) throw new Error('Documentation needs the fixed source commit and separate archive name.');
|
||||
if (fs.existsSync(evidenceRoot)) throw new Error('Historical evidence output must be a new directory.');
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
import { execFileSync } from 'node:child_process';
|
||||
import { createHash, randomUUID } from 'node:crypto';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
// Export the committed program. No running host, user data directory, installed
|
||||
// application, credentials, build output or historical evidence is consulted.
|
||||
const directories = ['src', 'public', 'scripts', 'tests', 'examples', 'benchmarks', 'research', 'licenses'];
|
||||
const files = ['package.json', 'package-lock.json', 'vite.config.ts', 'tsconfig.json', 'index.html', 'mobile.html',
|
||||
'.gitignore', '.gitattributes', 'README.md', 'CHANGELOG.md', 'DESIGN.md', 'AGENTS.md', 'THIRD_PARTY_NOTICES.txt',
|
||||
'Start-Workbench.cmd', 'Stop-Workbench.cmd', 'Start-Desktop.cmd'];
|
||||
const guide = name => /^docs\/[^/]+\.md$/.test(name) || /^docs\/research\/[^/]+\.(?:md|json)$/.test(name);
|
||||
|
||||
export function packageSource({ root = process.cwd(), outputRoot = path.join(root, 'releases') } = {}) {
|
||||
root = path.resolve(root); outputRoot = path.resolve(outputRoot);
|
||||
const git = args => execFileSync('git', args, { cwd: root, windowsHide: true, maxBuffer: 32 * 1024 * 1024 });
|
||||
const sourceCommit = git(['rev-parse', 'HEAD']).toString().trim();
|
||||
const version = JSON.parse(git(['show', sourceCommit + ':package.json'])).version;
|
||||
if (!/^\d+\.\d+\.\d+(?:-[a-z0-9.-]+)?$/i.test(version)) throw new Error('Invalid committed program version.');
|
||||
const tree = git(['ls-tree', '-r', '--long', '-z', sourceCommit]).toString('utf8').split('\0').filter(Boolean).map(line => {
|
||||
const match = /^(\d+) (\w+) ([a-f0-9]+)\s+(\d+|-)\t([\s\S]+)$/.exec(line);
|
||||
if (!match) throw new Error('Invalid committed source entry.');
|
||||
return { mode: match[1], type: match[2], gitBlob: match[3], bytes: Number(match[4]), path: match[5] };
|
||||
});
|
||||
const entries = tree.filter(row => files.includes(row.path) || directories.some(name => row.path.startsWith(name + '/')) || guide(row.path));
|
||||
if (!entries.some(row => row.path === 'package-lock.json') || !entries.some(row => row.path.startsWith('src/'))) throw new Error('Committed source and dependency lock are required.');
|
||||
if (entries.some(row => row.type !== 'blob' || !['100644', '100755'].includes(row.mode))) throw new Error('Source release requires regular committed files, without links or submodules.');
|
||||
const roots = [...directories.filter(name => entries.some(row => row.path.startsWith(name + '/'))), ...files.filter(name => entries.some(row => row.path === name)), ...entries.filter(row => guide(row.path)).map(row => row.path)];
|
||||
const name = `Agent-Workbench-${version}-source-code-${sourceCommit.slice(0, 8)}-${randomUUID()}`;
|
||||
fs.mkdirSync(outputRoot, { recursive: true });
|
||||
const archive = path.join(outputRoot, name + '.zip'), fd = fs.openSync(archive, 'wx');
|
||||
try { execFileSync('git', ['archive', '--format=zip', '--prefix=Agent-Workbench-' + version + '-source/', sourceCommit, '--', ...roots], { cwd: root, windowsHide: true, stdio: ['ignore', fd, 'pipe'] }); }
|
||||
finally { fs.closeSync(fd); }
|
||||
const result = { kind: 'source-code', version, sourceCommit, sourceTree: git(['rev-parse', sourceCommit + '^{tree}']).toString().trim(),
|
||||
path: archive, bytes: fs.statSync(archive).size, sha256: createHash('sha256').update(fs.readFileSync(archive)).digest('hex'),
|
||||
createdAt: new Date().toISOString(), files: entries.map(({ path, bytes, gitBlob }) => ({ path, bytes, gitBlob })),
|
||||
scope: 'Committed program, build scripts, tests, examples, dependency lock, licenses and text guides. No user projects, sessions, API credentials, installed runtimes or historical evidence archives. Build with Node 24, npm ci and npm run build. Historical acceptance drivers may require separately retained evidence or external engines.' };
|
||||
fs.writeFileSync(path.join(outputRoot, name + '.json'), JSON.stringify(result, null, 2) + '\n', { flag: 'wx' });
|
||||
return result;
|
||||
}
|
||||
|
||||
if (process.argv[1] && path.resolve(process.argv[1]) === fileURLToPath(import.meta.url)) {
|
||||
const args = process.argv.slice(2);
|
||||
if (args.length === 1 && args[0] === '--help') console.log('node scripts/package-source.mjs — ZIP of committed program source only; no running Workbench, build, installation or user data required.');
|
||||
else {
|
||||
if (args.length) throw new Error('Use --help.');
|
||||
const result = packageSource(); console.log(JSON.stringify({ ...result, files: result.files.length }, null, 2));
|
||||
}
|
||||
}
|
||||
+22
-18
@@ -6,13 +6,15 @@ import { planReaBundle, copyReaBundle } from './bundle-rea.mjs';
|
||||
import { planBrowserBundle, copyBrowserBundle } from './bundle-browser.mjs';
|
||||
import { planDesktopBundle, buildNativeLauncher, copyDesktopBundle } from './bundle-desktop.mjs';
|
||||
import { buildWindowsInstaller } from './build-installer.mjs';
|
||||
import { createDocumentationBundle } from './documentation-bundle.mjs';
|
||||
import { createDocumentationBundle, createProgramGuides } from './documentation-bundle.mjs';
|
||||
import { archiveWindowsDirectory } from './release-archive.mjs';
|
||||
import { copyReleaseTree } from './release-copy.mjs';
|
||||
|
||||
const args = process.argv.slice(2);
|
||||
if (args.some(value => !['--help', '--immutable'].includes(value))) throw new Error('Unsupported argument; use --help.');
|
||||
if (args.includes('--help')) { console.log('node scripts/package.mjs [--immutable] - create new portable/source releases and archives; existing release folders are never refreshed.'); process.exit(0); }
|
||||
if (args.some(value => !['--help', '--immutable', '--application-only', '--with-evidence'].includes(value))) throw new Error('Unsupported argument; use --help.');
|
||||
if (args.includes('--help')) { console.log('node scripts/package.mjs [--immutable] [--with-evidence] - publish program/installer by default; explicitly add --with-evidence for legacy source/runtime/evidence archives. For source code only use npm run package:source. No installed user data is packaged.'); process.exit(0); }
|
||||
if (args.includes('--application-only') && args.includes('--with-evidence')) throw new Error('Select program publication or legacy evidence export.');
|
||||
const applicationOnly = !args.includes('--with-evidence');
|
||||
const root = process.cwd();
|
||||
if (execFileSync('git', ['status', '--porcelain', '--untracked-files=all'], { cwd: root, encoding: 'utf8', windowsHide: true }).trim()) throw new Error('Commit the reviewed release inputs before packaging; sourceCommit must identify the actual shipped sources.');
|
||||
const meta = JSON.parse(fs.readFileSync('package.json', 'utf8'));
|
||||
@@ -25,9 +27,9 @@ fs.mkdirSync(releases, { recursive: true });
|
||||
const baseName = 'Agent-Workbench-' + meta.version;
|
||||
const buildSuffix = args.includes('--immutable') || fs.existsSync(path.join(releases, baseName + '-win-x64')) ? '-' + new Date().toISOString().replace(/[-:TZ.]/g, '') : '';
|
||||
const portableRoot = path.join(releases, baseName + '-win-x64' + buildSuffix);
|
||||
const sourceRoot = path.join(releases, baseName + '-source' + buildSuffix);
|
||||
const evidenceRoot = path.join(releases, baseName + '-evidence' + buildSuffix);
|
||||
for (const target of [portableRoot, sourceRoot]) {
|
||||
const sourceRoot = applicationOnly ? null : path.join(releases, baseName + '-source' + buildSuffix);
|
||||
const evidenceRoot = applicationOnly ? null : path.join(releases, baseName + '-evidence' + buildSuffix);
|
||||
for (const target of [portableRoot, sourceRoot].filter(Boolean)) {
|
||||
if (!path.resolve(target).startsWith(releases + path.sep) || fs.existsSync(target)) throw new Error('Release output must be a new folder under releases.');
|
||||
fs.mkdirSync(target, { recursive: true });
|
||||
}
|
||||
@@ -38,9 +40,9 @@ const copyTree = copyReleaseTree;
|
||||
for (const name of portableFiles) copyTree(path.join(root, name), path.join(portableRoot, name));
|
||||
fs.mkdirSync(path.join(portableRoot, 'scripts'), { recursive: true });
|
||||
for (const name of ['Start-Workbench.ps1', 'Stop-Workbench.ps1', 'Start-Desktop.ps1', 'upgrade-running.mjs', 'python-check-runner.py']) fs.copyFileSync(path.join(root, 'scripts', name), path.join(portableRoot, 'scripts', name));
|
||||
for (const name of sourceFiles) copyTree(path.join(root, name), path.join(sourceRoot, name));
|
||||
if (sourceRoot) for (const name of sourceFiles) copyTree(path.join(root, name), path.join(sourceRoot, name));
|
||||
const sourceCommit = execFileSync('git', ['rev-parse', 'HEAD'], { cwd: root, encoding: 'utf8', windowsHide: true }).trim();
|
||||
const documentation = createDocumentationBundle({ root, portableRoot, evidenceRoot, archiveName: path.basename(evidenceRoot) + '.zip', sourceCommit });
|
||||
const documentation = applicationOnly ? createProgramGuides({ root, portableRoot, sourceCommit }) : createDocumentationBundle({ root, portableRoot, evidenceRoot, archiveName: path.basename(evidenceRoot) + '.zip', sourceCommit });
|
||||
|
||||
const preferredNode = path.resolve(root, '..', 'tools', 'node-v24.22.1-win-x64', 'node.exe');
|
||||
const nodeBinary = process.env.AGENT_WORKBENCH_NODE_PATH || (fs.existsSync(preferredNode) ? preferredNode : process.execPath);
|
||||
@@ -56,18 +58,20 @@ const npmRoot = path.join(path.dirname(nodeBinary), 'node_modules', 'npm');
|
||||
if (!fs.existsSync(path.join(npmRoot, 'bin', 'npm-cli.js'))) throw new Error('The portable engineering runner requires the npm shipped with this Node distribution.');
|
||||
copyTree(npmRoot, path.join(portableRoot, 'runtime', 'node_modules', 'npm'));
|
||||
fs.copyFileSync(nodeLicense, path.join(portableRoot, 'runtime', 'LICENSE'));
|
||||
fs.mkdirSync(path.join(sourceRoot, 'runtime'), { recursive: true });
|
||||
fs.copyFileSync(nodeBinary, path.join(sourceRoot, 'runtime', 'node.exe'));
|
||||
fs.copyFileSync(nodeLicense, path.join(sourceRoot, 'runtime', 'LICENSE'));
|
||||
copyTree(npmRoot, path.join(sourceRoot, 'runtime', 'node_modules', 'npm'));
|
||||
if (sourceRoot) {
|
||||
fs.mkdirSync(path.join(sourceRoot, 'runtime'), { recursive: true });
|
||||
fs.copyFileSync(nodeBinary, path.join(sourceRoot, 'runtime', 'node.exe'));
|
||||
fs.copyFileSync(nodeLicense, path.join(sourceRoot, 'runtime', 'LICENSE'));
|
||||
copyTree(npmRoot, path.join(sourceRoot, 'runtime', 'node_modules', 'npm'));
|
||||
}
|
||||
const launcherPath = path.join(root, '.qa', 'native-launcher', 'AgentWorkbench.exe');
|
||||
const nativeLauncher = buildNativeLauncher(root, launcherPath);
|
||||
const desktopRuntime = copyDesktopBundle(root, portableRoot, desktopPlan, { launcher: launcherPath });
|
||||
copyDesktopBundle(root, sourceRoot, desktopPlan, { source: true });
|
||||
if (sourceRoot) copyDesktopBundle(root, sourceRoot, desktopPlan, { source: true });
|
||||
const reaRuntime = copyReaBundle(path.join(portableRoot, 'runtime'), reaPlan);
|
||||
copyReaBundle(path.join(sourceRoot, 'runtime'), reaPlan);
|
||||
if (sourceRoot) copyReaBundle(path.join(sourceRoot, 'runtime'), reaPlan);
|
||||
const browserRuntime = copyBrowserBundle(path.join(portableRoot, 'runtime'), browserPlan);
|
||||
copyBrowserBundle(path.join(sourceRoot, 'runtime'), browserPlan);
|
||||
if (sourceRoot) copyBrowserBundle(path.join(sourceRoot, 'runtime'), browserPlan);
|
||||
|
||||
const notices = ['Agent Workbench third-party notices', '',
|
||||
'Original product code is supplied for the project owner. Its redistribution terms are determined by the project owner.',
|
||||
@@ -102,7 +106,7 @@ fs.writeFileSync(path.join(licenseRoot, 'Node-' + nodeVersion + '-LICENSE.txt'),
|
||||
notices.push('='.repeat(72), 'Node.js ' + nodeVersion, '', nodeLicenseText);
|
||||
notices.push('='.repeat(72), 'npm bundled with Node.js', 'Complete package and dependency licenses are retained under runtime/node_modules/npm/.', '', fs.readFileSync(path.join(npmRoot, 'LICENSE'), 'utf8'));
|
||||
fs.writeFileSync(path.join(root, 'THIRD_PARTY_NOTICES.txt'), notices.join('\n'));
|
||||
for (const output of [portableRoot, sourceRoot]) {
|
||||
for (const output of [portableRoot, sourceRoot].filter(Boolean)) {
|
||||
fs.cpSync(licenseRoot, path.join(output, 'licenses'), { recursive: true });
|
||||
fs.copyFileSync(path.join(root, 'THIRD_PARTY_NOTICES.txt'), path.join(output, 'THIRD_PARTY_NOTICES.txt'));
|
||||
}
|
||||
@@ -124,7 +128,7 @@ function manifest(directory, kind) {
|
||||
return result;
|
||||
}
|
||||
const portableManifest = manifest(portableRoot, 'portable');
|
||||
manifest(sourceRoot, 'source');
|
||||
if (sourceRoot) manifest(sourceRoot, 'source');
|
||||
const installer = buildWindowsInstaller({ root, portableRoot, outputRoot: releases });
|
||||
function archive(directory) {
|
||||
const destination = directory + '.zip';
|
||||
@@ -132,7 +136,7 @@ function archive(directory) {
|
||||
archiveWindowsDirectory(directory, destination);
|
||||
return { path: destination, bytes: fs.statSync(destination).size, sha256: createHash('sha256').update(fs.readFileSync(destination)).digest('hex') };
|
||||
}
|
||||
const result = { portableRoot, sourceRoot, evidenceRoot, portable: archive(portableRoot), source: archive(sourceRoot), evidence: archive(evidenceRoot), documentation: { sourceCommit, originalFiles: documentation.originalFiles, originalBytes: documentation.originalBytes, shippedFiles: documentation.shipped.length, shippedBytes: documentation.shipped.reduce((sum, row) => sum + row.bytes, 0), evidenceManifestSha256: documentation.evidenceManifestSha256 }, installer, desktopRuntime, nativeLauncher, nodeVersion, reaRuntime, portableFiles: portableManifest.files.length, licenseTexts: licenseCount + 2 };
|
||||
const result = { portableRoot, ...(sourceRoot ? { sourceRoot, source: archive(sourceRoot) } : {}), ...(evidenceRoot ? { evidenceRoot, evidence: archive(evidenceRoot) } : {}), portable: archive(portableRoot), documentation: { sourceCommit, scope: documentation.scope, originalFiles: documentation.originalFiles, originalBytes: documentation.originalBytes, shippedFiles: documentation.shipped.length, shippedBytes: documentation.shipped.reduce((sum, row) => sum + row.bytes, 0), evidenceManifestSha256: documentation.evidenceManifestSha256 }, installer, desktopRuntime, nativeLauncher, nodeVersion, reaRuntime, portableFiles: portableManifest.files.length, licenseTexts: licenseCount + 2 };
|
||||
result.browserRuntime = { playwrightVersion: browserRuntime.playwrightVersion, packages: browserRuntime.packages.map(pkg => ({ name: pkg.name, version: pkg.version, files: pkg.files.length })) };
|
||||
fs.writeFileSync(path.join(releases, 'latest.json'), JSON.stringify(result, null, 2));
|
||||
console.log(JSON.stringify(result, null, 2));
|
||||
|
||||
@@ -6,12 +6,16 @@ import { spawn, execFileSync } from 'node:child_process';
|
||||
import { projectEnvironment } from '../src/core/process-environment.mjs';
|
||||
|
||||
if (process.argv.includes('--help')) {
|
||||
console.log('node scripts/verify-packaged-build.mjs — extract compile inputs from the latest source ZIP, install offline, rebuild and compare every compiled file to its portable ZIP identity. Set AGENT_WORKBENCH_TEST_PYTHON to an absolute Python path. No model calls or formal-host changes.');
|
||||
console.log('node scripts/verify-packaged-build.mjs — independently rebuild a source ZIP and compare all compiled files with the latest program. AGENT_WORKBENCH_SOURCE_RELEASE selects a standalone source-code JSON receipt; otherwise use the legacy source bundle. Set AGENT_WORKBENCH_TEST_PYTHON. No model calls or formal-host changes.');
|
||||
process.exit(0);
|
||||
}
|
||||
assert.equal(process.argv.length, 2);
|
||||
assert.match(process.version, /^v24\./);
|
||||
const release = JSON.parse(fs.readFileSync('releases/latest.json'));
|
||||
const sourceReceipt = process.env.AGENT_WORKBENCH_SOURCE_RELEASE;
|
||||
const standaloneSource = sourceReceipt ? JSON.parse(fs.readFileSync(sourceReceipt)) : null;
|
||||
if (standaloneSource) assert.equal(standaloneSource.kind, 'source-code');
|
||||
const sourceZip = standaloneSource ?? release.source;
|
||||
const manifest = JSON.parse(fs.readFileSync(path.join(release.portableRoot, 'MANIFEST.json')));
|
||||
const root = path.resolve('.qa', 'packaged-build-' + randomUUID()), destination = path.join(root, 'source');
|
||||
fs.mkdirSync(destination, { recursive: true });
|
||||
@@ -28,19 +32,24 @@ async function digestFile(file) {
|
||||
}
|
||||
const startedAt = new Date().toISOString();
|
||||
const extract = `import sys,zipfile,pathlib,json,hashlib
|
||||
archive,destination,top=sys.argv[1:]
|
||||
archive,destination,top,receipt=sys.argv[1:]
|
||||
folders={'src','public','scripts','tests','examples','benchmarks','research'}
|
||||
names={'package.json','package-lock.json','vite.config.ts','tsconfig.json','index.html','mobile.html'}
|
||||
output=pathlib.Path(destination).resolve()
|
||||
with zipfile.ZipFile(archive) as bundle:
|
||||
manifest=json.loads(bundle.read(top+'/MANIFEST.json'))
|
||||
manifest=json.loads(pathlib.Path(receipt).read_text(encoding='utf-8')) if receipt else json.loads(bundle.read(top+'/MANIFEST.json'))
|
||||
selected=[item for item in manifest['files'] if item['path'].split('/')[0] in folders or item['path'] in names]
|
||||
assert manifest['kind']=='source' and selected
|
||||
assert manifest['kind'] in {'source','source-code'} and selected
|
||||
for item in selected:
|
||||
relative=pathlib.PurePosixPath(item['path'])
|
||||
assert not relative.is_absolute() and '..' not in relative.parts
|
||||
contents=bundle.read(top+'/'+item['path'])
|
||||
assert len(contents)==item['bytes'] and hashlib.sha256(contents).hexdigest()==item['sha256']
|
||||
assert len(contents)==item['bytes']
|
||||
if manifest['kind']=='source-code':
|
||||
assert hashlib.sha1(b'blob '+str(len(contents)).encode()+b'\\0'+contents).hexdigest()==item['gitBlob']
|
||||
item['sha256']=hashlib.sha256(contents).hexdigest()
|
||||
else:
|
||||
assert hashlib.sha256(contents).hexdigest()==item['sha256']
|
||||
target=(output/str(relative)).resolve()
|
||||
assert target.is_relative_to(output)
|
||||
target.parent.mkdir(parents=True,exist_ok=True)
|
||||
@@ -62,9 +71,9 @@ async function run(args, name) {
|
||||
}
|
||||
let result, stage = 'source archive identity', inputs = [], compiled = [], mismatches = [];
|
||||
try {
|
||||
assert.equal(await digestFile(release.source.path), release.source.sha256);
|
||||
assert.equal(await digestFile(sourceZip.path), sourceZip.sha256);
|
||||
stage = 'extract fixed compile inputs';
|
||||
const extraction = JSON.parse(execFileSync(python, ['-I', '-c', extract, release.source.path, destination, path.basename(release.sourceRoot)],
|
||||
const extraction = JSON.parse(execFileSync(python, ['-I', '-c', extract, sourceZip.path, destination, standaloneSource ? 'Agent-Workbench-' + standaloneSource.version + '-source' : path.basename(release.sourceRoot), sourceReceipt || ''],
|
||||
{ env, encoding: 'utf8', windowsHide: true, maxBuffer: 8 * 1024 * 1024 }));
|
||||
assert.equal(extraction.version, manifest.version); inputs = extraction.inputs;
|
||||
stage = 'offline install'; await run(['ci', '--offline', '--ignore-scripts', '--no-audit', '--no-fund'], 'offline-install');
|
||||
@@ -85,8 +94,8 @@ try {
|
||||
assert.deepEqual(mismatches, [], 'Source ZIP rebuild differs from portable compilation.');
|
||||
result = { success: true };
|
||||
} catch (error) { result = { success: false, stage, error: error.stack }; process.exitCode = 1; }
|
||||
result = { ...result, startedAt, finishedAt: new Date().toISOString(), version: manifest.version, sourceCommit: release.documentation.sourceCommit,
|
||||
root, destination, sourceZip: release.source, portableManifestSha256: await digestFile(path.join(release.portableRoot, 'MANIFEST.json')),
|
||||
result = { ...result, startedAt, finishedAt: new Date().toISOString(), version: manifest.version, sourceCommit: standaloneSource?.sourceCommit ?? release.documentation.sourceCommit,
|
||||
root, destination, sourceZip, portableManifestSha256: await digestFile(path.join(release.portableRoot, 'MANIFEST.json')),
|
||||
node: { version: process.version, sha256: await digestFile(process.execPath) }, inputCount: inputs.length, inputs, compiled, mismatches, logs, realModelRequests: 0,
|
||||
scope: 'Independent compile-input extraction from the exact source ZIP, offline dependency installation and actual TypeScript/Vite/mobile/server/desktop rebuild. Every source input retained and every compiled file compared. Historical source tests and full archive checks keep their separate receipts.' };
|
||||
const output = path.join(root, 'result.json');
|
||||
|
||||
@@ -112,6 +112,24 @@ try {
|
||||
await expect(budgets().getByLabel('额度策略', { exact: true })).toHaveValue('unrestricted');
|
||||
for (const width of [1440,390]) { await resize(width); assert.ok(await page.evaluate(() => document.documentElement.scrollWidth <= innerWidth + 1)); await shot('open-settings-' + width); }
|
||||
mark('open defaults save as real zeros, survive reload, hide local quotas and retain model selection at 1440 and 390 pixels');
|
||||
await resize(1440); await dialog().getByRole('button', { name: '模型连接', exact: true }).click();
|
||||
const connectedCard = () => dialog().locator('.mc-connection').filter({ has: page.getByRole('heading', { name: connection.name, exact: true }) });
|
||||
await expect(connectedCard()).toContainText('默认透传 · 由上游决定');
|
||||
await connectedCard().getByRole('button', { name: '编辑', exact: true }).click();
|
||||
const connectionEditor = () => dialog().getByRole('form', { name: '编辑模型连接', exact: true });
|
||||
await expect(connectionEditor().getByLabel('上下文上限', { exact: true })).toHaveCount(0);
|
||||
await expect(connectionEditor().getByLabel('输出上限', { exact: true })).toHaveCount(0);
|
||||
await expect(connectionEditor().getByLabel('连接容量策略', { exact: true })).toContainText('默认透传 · 不设本地上限');
|
||||
await expect(connectionEditor().getByRole('button', { name: '填入开发初始值', exact: true })).toHaveCount(0);
|
||||
for (const width of [1440, 390]) { await resize(width); await connectionEditor().getByLabel('连接容量策略', { exact: true }).scrollIntoViewIfNeeded(); await shot('connection-passthrough-' + width); }
|
||||
await connectionEditor().getByRole('button', { name: '取消', exact: true }).click();
|
||||
await resize(1440); await dialog().locator('.mc-connection').filter({ has: page.getByRole('heading', { name: '原模型连接', exact: true }) }).getByRole('button', { name: '编辑', exact: true }).click();
|
||||
const legacy = page.getByRole('dialog', { name: '原连接与演示设置', exact: true });
|
||||
await expect(legacy.getByLabel('原连接容量说明', { exact: true })).toContainText('默认透传');
|
||||
await expect(legacy.getByLabel('上下文预算', { exact: true })).toHaveCount(0);
|
||||
await expect(legacy.getByLabel('输出上限', { exact: true })).toHaveCount(0);
|
||||
await legacy.getByRole('button', { name: '取消', exact: true }).click(); await open();
|
||||
mark('connection list, editor and legacy settings display active passthrough without inactive 16000/2048 ceilings');
|
||||
await resize(1440); await dialog().getByRole('button', { name: '等待时限', exact: true }).click();
|
||||
const waits = () => dialog().getByRole('form', { name: '模型等待时限', exact: true });
|
||||
await expect(waits().getByLabel('单次模型响应上限(秒)', { exact: true })).toHaveValue('0');
|
||||
@@ -197,6 +215,9 @@ try {
|
||||
await page.getByRole('button', { name: /AUTO-WRITE-FLOW/ }).first().click();
|
||||
await page.locator('.inspector-tabs').getByRole('button', { name: '改动', exact: true }).click();
|
||||
await expect(page.getByRole('button', { name: '回滚这项改动', exact: true })).toBeVisible(); await shot('automatically-applied-file');
|
||||
await expect(page.getByRole('button', { name: '应用这项改动', exact: true })).toHaveCount(0);
|
||||
await expect(page.getByRole('button', { name: '继续原任务', exact: true })).toHaveCount(0);
|
||||
await expect(page.getByText(/项改动等待审查/)).toHaveCount(0);
|
||||
await page.getByRole('button', { name: '回滚这项改动', exact: true }).click();
|
||||
await until(async () => (await host.api('/sessions/' + writeSession.id)).changes[0].status === 'rolled_back');
|
||||
assert.equal(fs.existsSync(path.join(f.projectRoot, 'ui-auto.txt')), false); await shot('rolled-back-file');
|
||||
|
||||
Reference in New Issue
Block a user