"""Annotation cohorts add acceptance scopes without changing the released population.""" from pathlib import Path import json import unittest from test_review_scope import suite_dirs ROOT = Path(__file__).resolve().parents[1] class ContentScopesTests(unittest.TestCase): def test_annotations_reuse_population_and_preserve_both_scopes(self): tasks = json.loads((ROOT/'definitions/evaluation/content-scopes-530/tasks.json').read_text())['cases'] population = json.loads((ROOT/'definitions/populations/primary-content-20261103.json').read_text()) self.assertEqual(len(tasks), 530) self.assertEqual({c['id'] for c in tasks}, {c['suite']+'--'+c['id'] for c in population['cases']}) for task in tasks: self.assertEqual(set(task['content_scopes']) - {'version'}, {'main', 'full'}) self.assertNotIn('content-scopes-530', suite_dirs()) self.assertEqual(set(suite_dirs()), set(population['frozen_task_bindings'])) def test_annotation_registry_does_not_expand_edition(self): manifest = json.loads((ROOT/'manifest.json').read_text()) self.assertEqual(manifest['edition']['task_count'], 550) registry = json.loads((ROOT/'definitions/registry.json').read_text()) entry = next(s for s in registry['suites'] if s['id']=='content-scopes-530') self.assertEqual(entry['kind'], 'annotation_cohort') self.assertEqual(entry['source_population'], 'primary-content-20261103')