fix: preserve and validate encoded ECCV structured author text
Metadata integrity checks / metadata (push) Successful in 3m9s

This commit is contained in:
2026-11-17 14:19:21 +08:00
parent 8996a21e09
commit 279d6a2735
5 changed files with 44 additions and 6 deletions
Binary file not shown.
+14
View File
@@ -112,3 +112,17 @@ class ECCV2026Tests(unittest.TestCase):
for receipt in self.bundle['paper_manifest']['records']:
raw = self.bundle['paper_pages'][receipt['paper_id']].encode('utf-8')
self.assertEqual(hashlib.sha256(raw).hexdigest(), receipt['sha256'])
def test_real_double_encoded_author_requires_exact_visible_agreement(self):
import hashlib
sample = self.bundle['encoding_sample']; pid = sample['paper_id']; raw = sample['html']
self.assertEqual(hashlib.sha256(raw.encode('utf-8')).hexdigest(), sample['receipt']['sha256'])
self.assertEqual(sample['receipt']['sha256'], 'b575318fa569e83eea5e96f937dd60f078fbed482877318013f797c16a02ff09')
fields = c.parse_paper(raw, sample['receipt']['url'], self.program[pid])
self.assertEqual(fields['authors'], sample['gold']['authors'])
self.assertEqual(fields['jsonld_raw_text']['author_names'][0], 'Zi'ang Lu')
self.assertIn('jsonld_display_text_normalized_requires_review', fields['review_flags'])
# Real changes to the author or an extra encoding layer remain errors.
for replacement in ('Other Author', 'Zi'ang Lu'):
with self.assertRaisesRegex(ValueError, 'authors disagree'):
c.parse_paper(raw.replace('Zi'ang Lu', replacement), sample['receipt']['url'], self.program[pid])