78 lines
4.0 KiB
JavaScript
78 lines
4.0 KiB
JavaScript
'use strict';
|
|
|
|
const assert = require('node:assert/strict');
|
|
const test = require('node:test');
|
|
const {
|
|
classifyPs5FpkgControl,
|
|
deriveInstalledContentStatus,
|
|
qualifyPs5FpkgPositiveControl,
|
|
} = require('../../src/services/ps5-fpkg-control-taxonomy');
|
|
|
|
test('R1 control taxonomy rejects historical unsupported promotion labels', () => {
|
|
assert.deepEqual(classifyPs5FpkgControl('FAKE00000'), {
|
|
titleId: 'FAKE00000', controlClass: 'structural_reference',
|
|
launchQualification: 'failed_or_unproven', positiveControl: false,
|
|
evidenceRule: 'direct-owned-hardware-launch-required',
|
|
});
|
|
const upstream = classifyPs5FpkgControl('PPSA99099');
|
|
assert.equal(upstream.controlClass, 'upstream_native_fih_reference');
|
|
assert.equal(upstream.positiveControl, 'unproven');
|
|
for (const titleId of ['CHIM00001', 'CHIM00002', 'CHIM00003']) {
|
|
const control = classifyPs5FpkgControl(titleId);
|
|
assert.equal(control.controlClass, 'chimera_synthetic_control');
|
|
assert.equal(control.positiveControl, false);
|
|
}
|
|
});
|
|
|
|
test('structural validation, installation and accepted LNC do not create a positive control', () => {
|
|
assert.throws(() => qualifyPs5FpkgPositiveControl({
|
|
titleId: 'PPSA99099',
|
|
compatibilityProfile: { id: 'P15-R1-PPSA99099', titleId: 'PPSA99099', artifactSha256: 'c'.repeat(64), fingerprint: 'a'.repeat(64) },
|
|
launchEvidence: {
|
|
compatibilityProfileFingerprint: 'a'.repeat(64), directOwnedHardware: true,
|
|
artifactSha256: 'c'.repeat(64),
|
|
requestCount: 1, clientRetryPerformed: false, lncAccepted: true,
|
|
structuralValidationAccepted: true, installedObserved: true, samples: [],
|
|
},
|
|
}), { code: 'P15_R1_POSITIVE_CONTROL_LAUNCH_UNPROVEN' });
|
|
});
|
|
|
|
test('positive control requires profile-bound BigApp and stable exact-title process evidence', () => {
|
|
const result = qualifyPs5FpkgPositiveControl({
|
|
titleId: 'PPSA99099',
|
|
compatibilityProfile: { id: 'P15-R1-PPSA99099', titleId: 'PPSA99099', artifactSha256: 'c'.repeat(64), fingerprint: 'b'.repeat(64) },
|
|
launchEvidence: {
|
|
compatibilityProfileFingerprint: 'b'.repeat(64), artifactSha256: 'c'.repeat(64), directOwnedHardware: true,
|
|
requestCount: 1, clientRetryPerformed: false, lncAccepted: true,
|
|
stableExactTitleProcess: true, preRunningBigAppId: -1,
|
|
installedContent: {
|
|
installedObserved: true, titleIdExact: true, contentIdExact: true, versionExact: true,
|
|
applicationDrmTypeExpected: true, sonyManagedInstallation: true,
|
|
manifestCoverageComplete: true, manifestMatchesReference: true,
|
|
paramJsonPresent: true, paramJsonMatchesReference: true,
|
|
ebootPresent: true, ebootMatchesReference: true, materiallyComplete: true,
|
|
},
|
|
samples: [
|
|
{ observedAfterMs: 500, runningBigAppId: 42, processCoverageComplete: true, processListTruncated: false, process: { titleId: 'PPSA99099', pid: 321 } },
|
|
{ observedAfterMs: 2000, runningBigAppId: 42, processCoverageComplete: true, processListTruncated: false, process: { titleId: 'PPSA99099', pid: 321 } },
|
|
],
|
|
},
|
|
});
|
|
assert.equal(result.positiveControl, true);
|
|
assert.equal(result.launchQualification, 'proven');
|
|
assert.equal(result.compatibilityProfileId, 'P15-R1-PPSA99099');
|
|
});
|
|
|
|
test('installed observation remains distinct from installed-content verification', () => {
|
|
assert.equal(deriveInstalledContentStatus({ installedObserved: false }), 'not_installed');
|
|
assert.equal(deriveInstalledContentStatus({ installedObserved: true }), 'installed_unproven');
|
|
assert.equal(deriveInstalledContentStatus({ installedObserved: true, manifestCoverageComplete: false }), 'installed_incomplete');
|
|
assert.equal(deriveInstalledContentStatus({
|
|
installedObserved: true, titleIdExact: true, contentIdExact: true, versionExact: true,
|
|
applicationDrmTypeExpected: true, sonyManagedInstallation: true,
|
|
manifestCoverageComplete: true, manifestMatchesReference: true,
|
|
paramJsonPresent: true, paramJsonMatchesReference: true,
|
|
ebootPresent: true, ebootMatchesReference: true, materiallyComplete: true,
|
|
}), 'installed_complete');
|
|
});
|