test(handoff): preserve native results in bounded attachment projections
This commit is contained in:
@@ -133,6 +133,12 @@ export function validatePackage(base = directory) {
|
||||
const bytes = readPackage(item.path);
|
||||
return item.path.endsWith('.gz') ? zlib.gunzipSync(bytes, { maxOutputLength: 8 * 1024 * 1024 }) : bytes;
|
||||
};
|
||||
for (const item of evidence.artifacts.filter(entry => entry.projection)) {
|
||||
const audit = JSON.parse(artifact(item.projectionAuditArtifactId).toString('utf8'));
|
||||
const bytes = artifact(item.id);
|
||||
demand(audit.sourceSha256 === item.sourceSha256 && audit.projectedSha256 === digest(bytes) && audit.removedBodies.length === item.externalizedAttachmentCount, 'Attachment-body export audit differs');
|
||||
demand(JSON.stringify(audit.sourceStats) === JSON.stringify(JSON.parse(bytes.toString('utf8')).stats), 'Native browser statistics changed during export');
|
||||
}
|
||||
for (const report of evidence.reports) {
|
||||
const expectedCommit = report.bindingScope === 'HANDOFF_VERIFIER' ? evidence.verifierCommit : evidence.testedCommit;
|
||||
demand(report.sourceCommit === expectedCommit, 'Report source correspondence missing');
|
||||
|
||||
Reference in New Issue
Block a user