fix(ql3): close adopted lineage acceptance gates

This commit is contained in:
whyour
2026-08-21 15:35:48 +08:00
parent 4f6be5bc2c
commit b714f2bf18
9 changed files with 155 additions and 18 deletions
@@ -70,6 +70,10 @@ async function main() {
root,
'packages/ql3-local-owner-cli/dist/deployment/localDeployment.js',
));
const { LOCAL_SQLITE_CONTRACT_VERSION } = require(path.join(
root,
'packages/ql3-local-sqlite/dist/readiness/readinessInspection.js',
));
const temporaryRoot = fs.realpathSync(
fs.mkdtempSync(path.join(os.tmpdir(), 'ql3-compose-preflight-')),
);
@@ -157,7 +161,7 @@ async function main() {
report.status !== 'ready' ||
report.generation !== 1 ||
report.profile !== input.profile ||
report.sqlite?.contractVersion !== 44 ||
report.sqlite?.contractVersion !== LOCAL_SQLITE_CONTRACT_VERSION ||
(report.image?.architecture !== 'amd64' &&
report.image?.architecture !== 'arm64') ||
report.service?.kind !== 'compose'
@@ -289,10 +289,17 @@ async function main() {
root,
'packages/ql3-local-owner-cli/dist/deployment/localDeployment.js',
));
const { inspectLocalSqliteRolloutBackup } = require(path.join(
const {
inspectLocalSqliteRolloutBackup,
LOCAL_SQLITE_WRITE_CONTRACT_VERSION,
} = require(path.join(
root,
'packages/ql3-local-sqlite/dist/readiness/rolloutSafety.js',
));
const { LOCAL_SQLITE_CONTRACT_VERSION } = require(path.join(
root,
'packages/ql3-local-sqlite/dist/readiness/readinessInspection.js',
));
const temporaryRoot = fs.realpathSync(
fs.mkdtempSync(path.join(os.tmpdir(), 'ql3-compose-rollout-')),
);
@@ -487,8 +494,9 @@ async function main() {
(fs.statSync(path.join(rolloutRoot, name)).mode & 0o777) !== 0o600,
) ||
(fs.statSync(backupPath).mode & 0o777) !== 0o600 ||
receipt.sqlite?.contractVersion !== 44 ||
receipt.sqlite?.writeContractVersion !== 44 ||
receipt.sqlite?.contractVersion !== LOCAL_SQLITE_CONTRACT_VERSION ||
receipt.sqlite?.writeContractVersion !==
LOCAL_SQLITE_WRITE_CONTRACT_VERSION ||
(receipt.sqlite?.writeObservation !== 'unchanged' &&
receipt.sqlite?.writeObservation !== 'changed') ||
receipt.sqlite?.backup?.sha256 !== backup.sha256 ||
@@ -959,7 +967,7 @@ async function main() {
composeMerge: true,
rolloutActive: true,
durableReceipt: true,
sqliteWriteContract: 37,
sqliteWriteContract: LOCAL_SQLITE_WRITE_CONTRACT_VERSION,
sqliteBackup: true,
sqliteWriteObservation: receipt.sqlite.writeObservation,
sqliteRestorePrepared: true,
@@ -206,7 +206,9 @@ function validateLocalReport(entry, profile, consumption, identity) {
report.composeMerge !== true ||
report.rolloutActive !== true ||
report.durableReceipt !== true ||
report.sqliteWriteContract !== 37 ||
!Number.isSafeInteger(report.sqliteWriteContract) ||
report.sqliteWriteContract < 1 ||
report.sqliteWriteContract > 65_535 ||
report.sqliteBackup !== true ||
report.sqliteRestorePrepared !== true ||
report.sqliteRestoreCommitted !== true ||
@@ -325,6 +327,9 @@ function createDeploymentReadinessReceipt(input) {
) {
fail('local profiles used different release selections');
}
if (edge.sqliteWriteContract !== standalone.sqliteWriteContract) {
fail('local profiles used different SQLite write contracts');
}
evidence.push({
family: 'local',
catalogConsumptionDigest: localConsumption.contentDigest,