test(integration): cover exact adoption recovery

TASK-f40126ee-2485-45c8-a67b-4279e4e8704a
This commit is contained in:
thePR0M3TH3AN committed 2026-10-03 17:30:03 -04:00
1 parent 8ea3bef13e
commit 63dd032b7f
3 files changed
+242 -1

No files matched your search

+2 -1
View File
@@ -82,7 +82,8 @@ function exactAuthority(authority, binding) {
function exactInput(record, input) {
const fields = ['adoptionId', 'candidateSha', 'baseTargetSha', 'provenanceManifestDigest',
'contributorArea', 'destinationArea', 'targetBranch', 'candidateRef', 'expectedOldRef'];
const mismatches = fields.filter((field) => input[field] !== undefined && input[field] !== record[field]);
const mismatches = fields.filter((field) => input[field] !== undefined
&& input[field] !== (field === 'adoptionId' ? record.id : record[field]));
if (input.provenance !== undefined && JSON.stringify(input.provenance) !== JSON.stringify(record.provenance)) mismatches.push('provenance');
if (mismatches.length) throw new TorchError('Lifecycle input cannot override immutable prepared adoption fields', {
code: 'ADOPTION_IMMUTABLE_BINDING_STALE', details: { adoptionId: record.id, fields: mismatches },