feat(ql3): apply legacy data transformation

This commit is contained in:
whyour
2026-08-21 12:06:41 +08:00
parent 69c322fa8d
commit d4813e48a4
32 changed files with 3877 additions and 64 deletions
@@ -148,9 +148,11 @@ test('creates a reviewed edge database and opens runtime only after readiness',
'0096-capability-v48',
'0097-plugin-package-secret-binding-transition-receipts',
'0098-capability-v49',
'0099-legacy-data-directory-adoptions',
'0100-capability-v50',
]);
assert.equal(migrated.readiness.contractName, 'local-control-core');
assert.equal(migrated.readiness.contractVersion, 49);
assert.equal(migrated.readiness.contractVersion, 50);
assert.equal(migrated.readiness.journalMode, 'delete');
assert.equal(fs.statSync(databasePath).mode & 0o777, 0o600);
@@ -596,8 +598,8 @@ test('backfills v14 execution revisions with a verified independent digest', asy
.get(),
},
{
contract_version: 49,
migration_id: '0097-plugin-package-secret-binding-transition-receipts',
contract_version: 50,
migration_id: '0099-legacy-data-directory-adoptions',
},
);
} finally {
@@ -784,19 +786,19 @@ test('excludes reviewed optional feature tables while preserving unknown table d
const options = { databasePath, profile: 'edge' };
await migrateLocalSqlitePath(options);
const client = new DatabaseSync(databasePath);
assert.equal((await auditLocalSqlitePath(options)).tableCount, 81);
assert.equal((await auditLocalSqlitePath(options)).tableCount, 83);
client.exec(
'CREATE TABLE "ModelInvocationFeatureHead" (feature_id TEXT PRIMARY KEY)',
);
client.close();
assert.equal((await auditLocalSqlitePath(options)).tableCount, 81);
assert.equal((await auditLocalSqlitePath(options)).tableCount, 83);
const unknownClient = new DatabaseSync(databasePath);
unknownClient.exec('CREATE TABLE "UserExtensionData" (id TEXT PRIMARY KEY)');
unknownClient.close();
assert.equal((await auditLocalSqlitePath(options)).tableCount, 82);
assert.equal((await auditLocalSqlitePath(options)).tableCount, 84);
const triggerClient = new DatabaseSync(databasePath);
triggerClient.exec(`
@@ -156,7 +156,7 @@ test('atomically admits one generation-bound Workflow Run and exactly replays it
},
{ runs: 1, steps: 2, events: 3, mutations: 2, admissions: 1 },
);
assert.equal((await auditLocalSqliteReadiness(client)).contractVersion, 49);
assert.equal((await auditLocalSqliteReadiness(client)).contractVersion, 50);
});
test('runs an optional authorization guard inside new and replay transactions', async (t) => {
@@ -288,7 +288,7 @@ test('exactly replays immutable admission after the Workflow StepRun advances',
},
{ status: 'running', version: 5, eventSequence: 5 },
);
assert.equal((await auditLocalSqliteReadiness(client)).contractVersion, 49);
assert.equal((await auditLocalSqliteReadiness(client)).contractVersion, 50);
});
test('fails closed before writing when the exact installation is not active', async (t) => {
@@ -231,7 +231,7 @@ test('atomically admits the exact reconciled local Task revision and replays it'
stepAttemptCount: 0,
},
);
assert.equal((await auditLocalSqliteReadiness(client)).contractVersion, 49);
assert.equal((await auditLocalSqliteReadiness(client)).contractVersion, 50);
});
test('bounds candidate paging before SQL and fences cancellation', async (t) => {
@@ -40,9 +40,9 @@ test('creates and exactly replays a reviewed rollout backup', async (t) => {
await migrateLocalSqlitePath(state);
const prepared = await createLocalSqliteRolloutBackup(state);
assert.equal(prepared.status, 'prepared');
assert.equal(prepared.contractVersion, 49);
assert.equal(prepared.writeContractVersion, 49);
assert.equal(LOCAL_SQLITE_WRITE_CONTRACT_VERSION, 49);
assert.equal(prepared.contractVersion, 50);
assert.equal(prepared.writeContractVersion, 50);
assert.equal(LOCAL_SQLITE_WRITE_CONTRACT_VERSION, 50);
assert.match(prepared.sha256, /^[0-9a-f]{64}$/);
assert.equal(prepared.bytes > 0, true);
assert.equal(prepared.pageCount > 0, true);