fix: unify release runtime coherence verification

This commit is contained in:
DongHyeonka
2026-08-02 03:38:49 +09:00
parent 184bd98d92
commit 990603e24a
5 changed files with 406 additions and 98 deletions
+4 -14
View File
@@ -42,33 +42,23 @@ export function compareReleaseToRuntime(
release: Readonly<{
buildId: string;
configSchemaVersion: string;
apiContractVersion?: string;
apiContractVersion: string;
assetManifestHash: string;
releaseId: string;
}>,
runtimeConfig: Readonly<{
BUILD_ID: string;
CONFIG_SCHEMA_VERSION: string;
/**
* §5.1. Removed from Runtime Config V2. When neither side declares it there
* is nothing to disagree about: contract identity is verified by the
* Release Manifest V2 `contractSet` check instead.
*/
API_CONTRACT_VERSION?: string;
API_CONTRACT_VERSION: string;
RELEASE_ID: string;
}>,
) {
const declaredContractVersion =
runtimeConfig.API_CONTRACT_VERSION ?? release.apiContractVersion ?? "0";
return verifyCompatibilityTuple({
frontend: {
...release,
apiContractVersion: release.apiContractVersion ?? declaredContractVersion,
},
frontend: release,
runtime: {
buildId: runtimeConfig.BUILD_ID,
configSchemaVersion: runtimeConfig.CONFIG_SCHEMA_VERSION,
apiContractVersion: declaredContractVersion,
apiContractVersion: runtimeConfig.API_CONTRACT_VERSION,
assetManifestHash: release.assetManifestHash,
releaseId: runtimeConfig.RELEASE_ID,
},