diff --git a/docs/RELIABILITY-1.25.2.md b/docs/RELIABILITY-1.25.2.md index e23d4f80..37bcd46f 100644 --- a/docs/RELIABILITY-1.25.2.md +++ b/docs/RELIABILITY-1.25.2.md @@ -27,3 +27,7 @@ W六请求71044 tokens、0提案0交付是事实;末轮新增468字符、还 新observed-route-max-v3封存receiptHistory,按原Task账本恢复计算时消费前缀,不能用自报sourceIndex决定历史顺序;原v2的核验也改用原账本顺序。后续真实消费不会使早先封存失效。输入比率异常仅影响输入校准及其总量floor,已报告输出最大值继续参与预留。旧v1/v2算法单独保留,原R暂停与v2重算不重写。 专项13/13、task-context/budget-resume/engine-context/controlled-engine相关24/24通过。包含真实本机HTTP夹具和原R封存;重排最新高值/改历史/重复来源拒绝、已报9000输出保留、后来新增消费后旧证明通过。证据.qa/reliability-1.25.2/reservation.tap及reservation-related.tap。此为本地修复证据,尚不证明真实模型交付或异常计量根因。 + +### 升级兼容补漏 + +安装关联首轮13项11通过、2失败:upgrade-running的历史兼容清单截至1.25.0,编译宿主真实报告1.25.1后被拒,并非数据或Key问题。已补1.25.1并让当前APP_VERSION始终参与受支持列表,保留未知/未来版本拒绝;新增版本守卫,实际独立进程连续两次升级和0.1.0迁移3/3通过。首失败install-related.tap与复验upgrade-compat.tap均保留。没有操作正式宿主。 diff --git a/progress.md b/progress.md index 9abcd011..f95f4eee 100644 --- a/progress.md +++ b/progress.md @@ -6,6 +6,7 @@ - 已读AGENTS及复核;采用planning-with-files,session-catchup无待同步输出。首次多文件补丁上下文失败且无变化,随后按真实标题修正。 - 当前阶段:预留来源顺序修复;后续安装变化核验、混合进展及吞吐、发行验收、新真实实验,各阶段验证/回顾/本地提交。 - 预留阶段:v3原消费前缀+原账本顺序,v1/v2保持历史算法;输入异常不丢输出最大值。专项13/13、上下文/预算/引擎24/24通过,原R保持72571及原暂停。已补阶段回顾,按范围本地提交。一次读取不存在src/core/state路径的rg失败,改读真实src/server/store.mjs。 +- 安装关联首轮13项11通过2失败,确认升级兼容列表漏1.25.1;补历史版本并动态包含当前APP_VERSION,守卫及独立真实宿主升级3/3通过,首失败保留,先单独提交该修复。没有正式操作。 ## 1.25接续 diff --git a/scripts/upgrade-running.mjs b/scripts/upgrade-running.mjs index a9c22a68..4e3e219a 100644 --- a/scripts/upgrade-running.mjs +++ b/scripts/upgrade-running.mjs @@ -2,6 +2,16 @@ import fs from 'node:fs'; import path from 'node:path'; import { fileURLToPath } from 'node:url'; import { setTimeout as delay } from 'node:timers/promises'; +import { APP_VERSION } from '../src/server/diagnostics.mjs'; + +export const SUPPORTED_UPGRADE_VERSIONS = Object.freeze([ + '0.1.0', '1.0.0', '1.1.0', '1.2.0', '1.3.0', '1.4.0', '1.5.0', '1.5.1', + '1.6.0', '1.6.1', '1.6.2', '1.7.0', '1.8.0', '1.9.0', '1.10.0', '1.10.1', + '1.11.0', '1.12.0', '1.12.1', '1.13.0', '1.14.0', '1.15.0', '1.16.0', '1.17.0', + '1.18.0', '1.19.0', '1.20.0', '1.20.1', '1.20.2', '1.20.3', '1.21.0', '1.22.0', + '1.22.1', '1.23.0', '1.24.0', '1.24.1', '1.24.2', '1.24.3', '1.24.4', '1.24.5', + '1.24.6', '1.24.7', '1.24.8', '1.24.9', '1.25.0', '1.25.1', APP_VERSION, +]); function localUrl(value) { const url = new URL(value); @@ -64,7 +74,7 @@ export async function upgradeRunning({ url, pid, currentRoot, newRoot, handlerRo if (!fs.existsSync(originalScript) || !fs.existsSync(upgradeScript) || !fs.existsSync(path.join(next, 'dist-client', 'index.html'))) throw new Error('Upgrade bundles are incomplete.'); if (!Number.isInteger(pid) || pid < 1 || pid === process.pid) throw new Error('Invalid target process.'); const before = await readUpgradeJson(origin + '/api/bootstrap', 5000, 'Read original Workbench'); - if (!before.token || !['0.1.0', '1.0.0', '1.1.0', '1.2.0', '1.3.0', '1.4.0', '1.5.0', '1.5.1', '1.6.0', '1.6.1', '1.6.2', '1.7.0', '1.8.0', '1.9.0', '1.10.0', '1.10.1', '1.11.0', '1.12.0', '1.12.1', '1.13.0', '1.14.0', '1.15.0', '1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1', '1.20.2', '1.20.3', '1.21.0', '1.22.0', '1.22.1', '1.23.0', '1.24.0', '1.24.1', '1.24.2', '1.24.3', '1.24.4', '1.24.5', '1.24.6', '1.24.7', '1.24.8', '1.24.9', '1.25.0'].includes(before.version)) throw new Error('This migration accepts a supported existing Workbench.'); + if (!before.token || !SUPPORTED_UPGRADE_VERSIONS.includes(before.version)) throw new Error('This migration accepts a supported existing Workbench.'); if (before.sessions.some(session => ['running', 'awaiting_approval', 'stopping'].includes(session.status))) throw new Error('Wait for existing tasks and approvals before upgrading.'); let protocol, socket, enabledHere = false, paused = false; const breakpoints = []; diff --git a/tests/upgrade.test.mjs b/tests/upgrade.test.mjs index 5bf65c10..c2e425f5 100644 --- a/tests/upgrade.test.mjs +++ b/tests/upgrade.test.mjs @@ -4,9 +4,16 @@ import path from 'node:path'; import fs from 'node:fs'; import { spawn } from 'node:child_process'; import { fixture, compatibleFixture, until, workspace, launchWorkbench } from './helpers.mjs'; -import { upgradeRunning } from '../scripts/upgrade-running.mjs'; +import { upgradeRunning, SUPPORTED_UPGRADE_VERSIONS } from '../scripts/upgrade-running.mjs'; import { APP_VERSION } from '../src/server/diagnostics.mjs'; +test('the upgrade compatibility gate includes the served current version and the previous formal patch', () => { + assert.ok(SUPPORTED_UPGRADE_VERSIONS.includes(APP_VERSION)); + assert.ok(SUPPORTED_UPGRADE_VERSIONS.includes('1.25.1')); + assert.equal(SUPPORTED_UPGRADE_VERSIONS.includes('99.0.0'), false); + assert.equal(SUPPORTED_UPGRADE_VERSIONS.includes('1.25.1-unknown'), false); +}); + test('a directly started compiled host upgrades twice with the same PID, sessions, applied bytes and volatile provider', { timeout: 30000 }, async t => { const f = fixture(t), host = await launchWorkbench(t, f.data); const model = await compatibleFixture(t, () => ({ data: [{ id: 'direct-upgrade-fixture' }] }));