"""Tests on Lab 16's script 04, from its recorded run (October 2026): the returns page, 60 logged
requests each asked 5 more times on gpt-5.4-nano, the pages all 376 logged answers were shown, and
what the 152 answers shown an edited page said when asked again. Run: pytest test_replay_practice.py"""
from replay_practice import changed_facts, diagnose, doc_hash, replay_counts, shown_an_edited_page

# The returns page as it was logged. The lab's edit changed one phrase: 30 days became 45.
RETURNS = {'title': 'Returns and Refunds',
 'text': 'Customers can return unused items within 30 days of delivery. To start a return, log in to your '
         'order history and request a return authorization before sending anything back. Items must be in '
         'original condition, with tags and packaging included where possible. Once we receive and inspect '
         'the return at our Portland or Berlin warehouse, we’ll process the refund or exchange. Refunds go '
         'back to the original payment method within 5 business days. Shipping charges are not refunded '
         'unless the item was defective or we made an error with the order. If your package arrived damaged '
         'or you received the wrong item, please contact support right away with your order details and '
         'photos of the issue. For exchanges, the replacement item will ship after the return is approved '
         'and processed.',
 'groups': ['public']}
EDIT = ("within 30 days of delivery", "within 45 days of delivery")

# The tent warranty question (Olivia): the logged answer, then five replays. Six wordings, one fact.
TENT = ['Lantern Outfitters tents are covered by a **3-year warranty** against manufacturing defects. '
 '[pub-warranty]',
 'Tents have a **3-year warranty** against manufacturing defects. [pub-warranty]',
 'Lantern Outfitters tents come with a **3-year warranty** against manufacturing defects. [pub-warranty]',
 'Lantern Outfitters tents have a **3-year warranty** against manufacturing defects. [pub-warranty]',
 'Our warranty on tents is **3 years** against manufacturing defects for tents (and backpacks) purchased '
 'from Lantern Outfitters. [pub-warranty]',
 'Lantern Outfitters tents have a **3-year warranty** covering manufacturing defects in materials and '
 'workmanship for products purchased from Lantern Outfitters. [pub-warranty]']

# The 60 replayed requests: [texts, facts]. Texts are numbered within each request (0 = the logged
# answer's wording, 1 = the next different wording, ...), so equal numbers mean identical text.
GROUPS = [[[0, 0, 1, 1, 0, 0], [True, True, True, True, True, True]],
 [[0, 1, 2, 3, 4, 5], [False, False, False, False, False, False]],
 [[0, 1, 2, 3, 4, 5], [True, True, True, True, True, True]],
 [[0, 0, 0, 0, 0, 0], [True, True, True, True, True, True]],
 [[0, 0, 1, 2, 2, 3], [False, False, False, False, False, False]],
 [[0, 0, 1, 0, 0, 0], [True, True, True, True, True, True]],
 [[0, 1, 0, 1, 0, 1], [False, False, False, False, False, False]],
 [[0, 0, 0, 0, 0, 0], [True, True, True, True, True, True]],
 [[0, 1, 2, 3, 4, 5], [True, True, True, True, True, True]],
 [[0, 0, 1, 2, 0, 0], [False, False, False, False, False, False]],
 [[0, 1, 2, 3, 4, 5], [False, False, False, False, False, False]],
 [[0, 1, 1, 1, 1, 0], [True, True, True, True, True, True]],
 [[0, 0, 0, 0, 0, 0], [True, True, True, True, True, True]],
 [[0, 1, 2, 3, 4, 5], [True, True, True, True, True, True]],
 [[0, 1, 1, 1, 1, 1], [True, True, True, True, True, True]],
 [[0, 0, 0, 0, 0, 0], [True, True, True, True, True, True]],
 [[0, 0, 0, 0, 1, 0], [False, False, False, False, False, False]],
 [[0, 1, 0, 0, 0, 0], [True, True, True, True, True, True]],
 [[0, 1, 2, 3, 4, 5], [False, False, False, False, False, False]],
 [[0, 1, 2, 3, 4, 1], [False, False, False, False, False, False]],
 [[0, 0, 0, 0, 0, 0], [True, True, True, True, True, True]],
 [[0, 1, 2, 3, 4, 5], [False, False, False, False, False, False]],
 [[0, 0, 0, 0, 0, 0], [True, True, True, True, True, True]],
 [[0, 1, 0, 2, 1, 2], [True, True, True, True, True, True]],
 [[0, 0, 0, 0, 1, 0], [True, True, True, True, True, True]],
 [[0, 0, 1, 1, 2, 0], [True, True, True, True, True, True]],
 [[0, 1, 1, 0, 2, 1], [True, True, True, True, True, True]],
 [[0, 0, 0, 0, 0, 0], [True, True, True, True, True, True]],
 [[0, 1, 2, 3, 4, 5], [True, True, True, True, True, True]],
 [[0, 0, 0, 0, 0, 0], [False, False, False, False, False, False]],
 [[0, 1, 2, 2, 0, 2], [True, True, True, True, True, True]],
 [[0, 1, 2, 3, 4, 5], [False, False, False, False, False, False]],
 [[0, 1, 2, 3, 4, 5], [False, False, False, False, False, False]],
 [[0, 1, 2, 3, 4, 5], [False, False, False, False, False, False]],
 [[0, 1, 2, 1, 0, 3], [False, False, False, False, False, False]],
 [[0, 1, 2, 3, 4, 5], [False, False, False, False, False, False]],
 [[0, 1, 2, 1, 3, 4], [True, True, True, True, True, True]],
 [[0, 0, 0, 0, 0, 1], [False, False, False, False, False, False]],
 [[0, 0, 0, 0, 0, 0], [True, True, True, True, True, True]],
 [[0, 1, 1, 2, 1, 2], [False, False, False, False, False, False]],
 [[0, 1, 2, 3, 4, 5], [False, False, False, False, False, False]],
 [[0, 1, 2, 3, 4, 5], [False, False, False, False, False, False]],
 [[0, 0, 0, 0, 1, 0], [True, True, True, True, True, True]],
 [[0, 1, 2, 3, 4, 5], [False, False, False, False, False, False]],
 [[0, 0, 0, 0, 0, 0], [True, True, True, True, True, True]],
 [[0, 1, 2, 3, 0, 4], [False, False, False, False, False, False]],
 [[0, 1, 1, 0, 0, 0], [True, True, True, True, True, True]],
 [[0, 1, 2, 3, 4, 5], [False, False, False, False, False, False]],
 [[0, 1, 2, 3, 4, 5], [True, True, True, True, True, True]],
 [[0, 0, 0, 0, 0, 0], [True, True, True, True, True, True]],
 [[0, 0, 0, 0, 0, 0], [True, True, True, True, True, True]],
 [[0, 0, 0, 0, 0, 0], [True, True, True, True, True, True]],
 [[0, 0, 0, 1, 0, 0], [True, True, True, True, True, True]],
 [[0, 1, 2, 3, 4, 5], [False, False, False, False, False, False]],
 [[0, 1, 0, 1, 2, 0], [True, True, True, True, True, True]],
 [[0, 1, 2, 3, 4, 5], [False, False, False, False, False, False]],
 [[0, 0, 0, 0, 0, 0], [True, True, True, True, True, True]],
 [[0, 1, 0, 0, 1, 0], [True, True, True, True, True, True]],
 [[0, 1, 2, 3, 4, 5], [False, False, False, False, False, False]],
 [[0, 1, 2, 3, 4, 5], [False, False, False, False, False, False]]]

# Page fingerprints when the 376 answers were logged, and today, after the three edits.
OLD = {'pub-returns': '03e25881f6a16970',
 'pub-shipping': '58231acae3906a51',
 'pub-warranty': '7a4f50e941024e3a',
 'pub-careers': '2b3ce7d2030c6a22',
 'pub-berlin': 'cce6e3b2a29f5980',
 'pub-privacy': '82ecbdc2432b099d',
 'pub-loyalty': 'cb4198c44c68da66',
 'pub-about': 'a6431787eb8bcaaa',
 'pub-tent-ridgeline': 'fd4db6d635f57001',
 'pub-stove': 'e6b28413a4c5de80',
 'int-security': '4d3cf2128b73963f',
 'int-expenses': '92180f6b4f41b6e1',
 'int-office-days': '6add70dbde1196a0',
 'int-holidays': '1a69bb4cb71d0ef8',
 'int-parental-leave': '74a9cba0a7f86a3b',
 'int-review-process': '3bafa6635a214d66',
 'int-salary-process': '041f3d795d5df3f3',
 'int-allhands': '1279b14d19e43ffa',
 'int-ooo': '29368296f091fa50',
 'int-org': '280fdc3bcfc38686',
 'sup-escalation': 'd1e0b9c3f2706320',
 'sup-fraud': 'b1211c8950b62400',
 'case-c101': 'e6a6cd90ae1bb7bb',
 'case-c102': '0e2533d1bf1a6eb2',
 'case-c104': '4fdca70333aabe1c',
 'case-c107': '1d6a179482019780',
 'case-c110': 'fa6e7bba7c52a6ce',
 'eng-oncall': '6682a03629ba54c2',
 'eng-postmortem': 'cbc3fb0b8a2537e8',
 'eng-architecture': 'c948b6b85ea6c5b1',
 'eng-vuln': 'f362116fcc3fcbee',
 'hr-salary-bands': '426c42778c265d1d',
 'hr-review-ravi': '635aab17f99442ec',
 'hr-review-ana': 'c930b0e466ff67ae',
 'hr-juniper': '7772911d1162817e',
 'hr-investigation': '148873c2ffc8d558',
 'ben-leave-daniel': '66b0356bd7d5a8ee',
 'ben-accommodation-mia': '8a072f0b4f4b7005',
 'fin-q3': '6d9e40f14083a79b',
 'fin-budget': '3c55f8e3e856169b',
 'fin-carrier': '070884d8686b9712',
 'fin-eu-vat': '5edb23173d3b21f6',
 'leg-trailco': 'df53b439ec77cdd0',
 'leg-cnil': 'd959335b39959538',
 'exec-heron': '9a4f63ef7616e644',
 'exec-pricing': '8637d99dcc10e7de',
 'exec-ceo-pay': '02b13e57bebc78b8'}
NEW = dict(OLD, **{"pub-returns": "eb2aed3366582a2c", "int-parental-leave": "8329a5674133c557",
                  "int-holidays": "cc98e34535463ec6"})

# The pages each of the 376 logged answers was shown (8 people x 47 questions, permissions applied).
SHOWN = [['pub-returns', 'case-c104', 'sup-escalation', 'pub-warranty'],
 ['pub-returns', 'case-c104', 'sup-escalation', 'pub-warranty'],
 ['pub-returns', 'pub-warranty', 'int-parental-leave', 'pub-shipping'],
 ['pub-returns', 'pub-warranty', 'int-parental-leave', 'pub-shipping'],
 ['pub-returns', 'pub-warranty', 'int-parental-leave', 'pub-shipping'],
 ['pub-returns', 'pub-warranty', 'int-parental-leave', 'pub-shipping'],
 ['pub-returns', 'pub-warranty', 'int-parental-leave', 'pub-shipping'],
 ['pub-returns', 'pub-warranty', 'pub-shipping', 'pub-privacy'],
 ['pub-shipping', 'sup-fraud', 'pub-loyalty', 'pub-returns'],
 ['pub-shipping', 'sup-fraud', 'pub-loyalty', 'pub-returns'],
 ['pub-shipping', 'pub-loyalty', 'pub-returns', 'eng-architecture'],
 ['pub-shipping', 'pub-loyalty', 'pub-returns', 'pub-privacy'],
 ['pub-shipping', 'pub-loyalty', 'pub-returns', 'pub-privacy'],
 ['pub-shipping', 'pub-loyalty', 'pub-returns', 'fin-carrier'],
 ['pub-shipping', 'pub-loyalty', 'pub-returns', 'fin-carrier'],
 ['pub-shipping', 'pub-loyalty', 'pub-returns', 'pub-privacy'],
 ['pub-warranty', 'pub-tent-ridgeline', 'case-c101', 'pub-about'],
 ['pub-warranty', 'pub-tent-ridgeline', 'case-c101', 'pub-about'],
 ['pub-warranty', 'pub-tent-ridgeline', 'pub-about', 'pub-stove'],
 ['pub-warranty', 'pub-tent-ridgeline', 'pub-about', 'pub-stove'],
 ['pub-warranty', 'pub-tent-ridgeline', 'pub-about', 'pub-stove'],
 ['pub-warranty', 'pub-tent-ridgeline', 'pub-about', 'pub-stove'],
 ['pub-warranty', 'leg-trailco', 'pub-tent-ridgeline', 'exec-pricing'],
 ['pub-warranty', 'pub-tent-ridgeline', 'pub-about', 'pub-stove'],
 ['int-salary-process', 'int-expenses', 'int-parental-leave', 'pub-careers'],
 ['int-salary-process', 'int-expenses', 'int-parental-leave', 'pub-careers'],
 ['int-salary-process', 'int-expenses', 'int-parental-leave', 'pub-careers'],
 ['int-salary-process', 'int-expenses', 'hr-salary-bands', 'int-parental-leave'],
 ['int-salary-process', 'int-expenses', 'hr-salary-bands', 'int-parental-leave'],
 ['int-salary-process', 'int-expenses', 'int-parental-leave', 'pub-careers'],
 ['int-salary-process', 'int-expenses', 'int-parental-leave', 'pub-careers'],
 ['pub-careers', 'pub-about', 'pub-berlin', 'pub-warranty'],
 ['pub-berlin', 'int-org', 'int-allhands', 'int-ooo'], ['pub-berlin', 'int-org', 'int-allhands', 'int-ooo'],
 ['pub-berlin', 'int-org', 'int-allhands', 'int-ooo'], ['pub-berlin', 'int-org', 'int-allhands', 'int-ooo'],
 ['pub-berlin', 'int-org', 'int-allhands', 'int-ooo'],
 ['pub-berlin', 'fin-eu-vat', 'int-org', 'int-allhands'],
 ['pub-berlin', 'int-org', 'int-allhands', 'int-ooo'],
 ['pub-berlin', 'pub-privacy', 'pub-shipping', 'pub-returns'],
 ['pub-privacy', 'pub-returns', 'sup-fraud', 'case-c107'],
 ['pub-privacy', 'pub-returns', 'sup-fraud', 'case-c107'],
 ['eng-architecture', 'pub-privacy', 'pub-returns', 'eng-postmortem'],
 ['pub-privacy', 'pub-returns', 'hr-juniper', 'int-ooo'],
 ['pub-privacy', 'pub-returns', 'ben-leave-daniel', 'hr-juniper'],
 ['pub-privacy', 'pub-returns', 'fin-eu-vat', 'int-ooo'],
 ['pub-privacy', 'pub-returns', 'leg-cnil', 'hr-juniper'],
 ['pub-privacy', 'pub-returns', 'pub-shipping', 'pub-warranty'],
 ['pub-loyalty', 'int-expenses', 'int-allhands', 'pub-returns'],
 ['pub-loyalty', 'int-expenses', 'int-allhands', 'pub-returns'],
 ['pub-loyalty', 'eng-postmortem', 'int-expenses', 'int-allhands'],
 ['pub-loyalty', 'int-expenses', 'hr-salary-bands', 'int-allhands'],
 ['pub-loyalty', 'int-expenses', 'hr-salary-bands', 'int-allhands'],
 ['pub-loyalty', 'fin-carrier', 'fin-q3', 'int-expenses'],
 ['pub-loyalty', 'fin-carrier', 'exec-pricing', 'fin-q3'],
 ['pub-loyalty', 'pub-returns', 'pub-privacy', 'pub-careers'],
 ['int-allhands', 'int-org', 'pub-about', 'pub-berlin'],
 ['int-allhands', 'int-org', 'pub-about', 'pub-berlin'],
 ['int-allhands', 'int-org', 'pub-about', 'pub-berlin'],
 ['int-allhands', 'int-org', 'pub-about', 'pub-berlin'],
 ['int-allhands', 'int-org', 'pub-about', 'pub-berlin'], ['int-allhands', 'int-org', 'fin-q3', 'pub-about'],
 ['int-allhands', 'exec-heron', 'exec-ceo-pay', 'int-org'],
 ['pub-about', 'pub-berlin', 'pub-privacy', 'pub-careers'],
 ['pub-tent-ridgeline', 'pub-warranty', 'case-c101', 'pub-about'],
 ['pub-tent-ridgeline', 'pub-warranty', 'case-c101', 'pub-about'],
 ['pub-tent-ridgeline', 'pub-warranty', 'pub-about', 'pub-stove'],
 ['pub-tent-ridgeline', 'pub-warranty', 'pub-about', 'pub-stove'],
 ['pub-tent-ridgeline', 'pub-warranty', 'pub-about', 'pub-stove'],
 ['pub-tent-ridgeline', 'pub-warranty', 'pub-about', 'pub-stove'],
 ['pub-tent-ridgeline', 'leg-trailco', 'pub-warranty', 'pub-about'],
 ['pub-tent-ridgeline', 'pub-warranty', 'pub-about', 'pub-stove'],
 ['pub-stove', 'case-c102', 'pub-shipping', 'pub-tent-ridgeline'],
 ['pub-stove', 'case-c102', 'pub-shipping', 'pub-tent-ridgeline'],
 ['pub-stove', 'pub-shipping', 'pub-tent-ridgeline', 'pub-about'],
 ['pub-stove', 'pub-shipping', 'pub-tent-ridgeline', 'pub-about'],
 ['pub-stove', 'pub-shipping', 'pub-tent-ridgeline', 'pub-about'],
 ['pub-stove', 'pub-shipping', 'pub-tent-ridgeline', 'pub-about'],
 ['pub-stove', 'pub-shipping', 'pub-tent-ridgeline', 'pub-about'],
 ['pub-stove', 'pub-shipping', 'pub-tent-ridgeline', 'pub-about'],
 ['int-security', 'int-office-days', 'pub-privacy', 'int-salary-process'],
 ['int-security', 'int-office-days', 'pub-privacy', 'int-salary-process'],
 ['int-security', 'eng-vuln', 'int-office-days', 'pub-privacy'],
 ['int-security', 'int-office-days', 'pub-privacy', 'int-salary-process'],
 ['int-security', 'int-office-days', 'pub-privacy', 'ben-accommodation-mia'],
 ['int-security', 'int-office-days', 'pub-privacy', 'int-salary-process'],
 ['int-security', 'eng-vuln', 'int-office-days', 'pub-privacy'],
 ['pub-privacy', 'pub-warranty', 'pub-loyalty', 'pub-returns'],
 ['int-expenses', 'int-office-days', 'pub-stove', 'pub-returns'],
 ['int-expenses', 'int-office-days', 'pub-stove', 'pub-returns'],
 ['int-expenses', 'int-office-days', 'pub-stove', 'pub-returns'],
 ['int-expenses', 'int-office-days', 'pub-stove', 'pub-returns'],
 ['int-expenses', 'int-office-days', 'ben-accommodation-mia', 'pub-stove'],
 ['int-expenses', 'int-office-days', 'pub-stove', 'pub-returns'],
 ['int-expenses', 'int-office-days', 'pub-stove', 'pub-returns'],
 ['pub-stove', 'pub-returns', 'pub-tent-ridgeline', 'pub-careers'],
 ['int-office-days', 'int-ooo', 'int-holidays', 'int-parental-leave'],
 ['int-office-days', 'int-ooo', 'int-holidays', 'int-parental-leave'],
 ['int-office-days', 'int-ooo', 'int-holidays', 'int-parental-leave'],
 ['int-office-days', 'int-ooo', 'int-holidays', 'int-parental-leave'],
 ['int-office-days', 'int-ooo', 'ben-accommodation-mia', 'int-holidays'],
 ['int-office-days', 'int-ooo', 'int-holidays', 'int-parental-leave'],
 ['int-office-days', 'int-ooo', 'int-holidays', 'int-parental-leave'],
 ['pub-careers', 'pub-shipping', 'pub-returns', 'pub-privacy'],
 ['int-holidays', 'int-office-days', 'int-ooo', 'int-parental-leave'],
 ['int-holidays', 'int-office-days', 'int-ooo', 'int-parental-leave'],
 ['int-holidays', 'int-office-days', 'int-ooo', 'int-parental-leave'],
 ['int-holidays', 'int-office-days', 'int-ooo', 'hr-juniper'],
 ['int-holidays', 'int-office-days', 'int-ooo', 'ben-leave-daniel'],
 ['int-holidays', 'int-office-days', 'int-ooo', 'int-parental-leave'],
 ['int-holidays', 'int-office-days', 'int-ooo', 'hr-juniper'],
 ['pub-careers', 'pub-shipping', 'pub-returns', 'pub-berlin'],
 ['int-parental-leave', 'int-salary-process', 'int-holidays', 'pub-returns'],
 ['int-parental-leave', 'int-salary-process', 'int-holidays', 'pub-returns'],
 ['int-parental-leave', 'int-salary-process', 'int-holidays', 'pub-returns'],
 ['int-parental-leave', 'int-salary-process', 'int-holidays', 'pub-returns'],
 ['int-parental-leave', 'ben-leave-daniel', 'int-salary-process', 'int-holidays'],
 ['int-parental-leave', 'int-salary-process', 'int-holidays', 'pub-returns'],
 ['int-parental-leave', 'int-salary-process', 'int-holidays', 'pub-returns'],
 ['pub-returns', 'pub-careers', 'pub-warranty', 'pub-shipping'],
 ['int-review-process', 'int-salary-process', 'hr-review-ana', 'int-allhands'],
 ['int-review-process', 'int-salary-process', 'int-allhands', 'int-office-days'],
 ['int-review-process', 'int-salary-process', 'hr-review-ravi', 'int-allhands'],
 ['int-review-process', 'int-salary-process', 'hr-review-ana', 'hr-review-ravi'],
 ['int-review-process', 'int-salary-process', 'hr-review-ana', 'hr-review-ravi'],
 ['int-review-process', 'int-salary-process', 'int-allhands', 'int-office-days'],
 ['int-review-process', 'int-salary-process', 'exec-ceo-pay', 'int-allhands'],
 ['pub-careers', 'pub-returns', 'pub-privacy', 'pub-warranty'],
 ['int-salary-process', 'int-review-process', 'int-office-days', 'int-allhands'],
 ['int-salary-process', 'int-review-process', 'int-office-days', 'int-allhands'],
 ['int-salary-process', 'int-review-process', 'int-office-days', 'int-allhands'],
 ['int-salary-process', 'hr-salary-bands', 'int-review-process', 'int-office-days'],
 ['int-salary-process', 'hr-salary-bands', 'int-review-process', 'int-office-days'],
 ['int-salary-process', 'int-review-process', 'int-office-days', 'int-allhands'],
 ['int-salary-process', 'exec-ceo-pay', 'int-review-process', 'int-office-days'],
 ['pub-careers', 'pub-returns', 'pub-shipping', 'pub-privacy'],
 ['int-allhands', 'int-review-process', 'int-ooo', 'hr-review-ana'],
 ['int-allhands', 'int-review-process', 'int-ooo', 'int-office-days'],
 ['int-allhands', 'int-review-process', 'eng-oncall', 'int-ooo'],
 ['int-allhands', 'hr-juniper', 'int-review-process', 'int-ooo'],
 ['int-allhands', 'hr-juniper', 'int-review-process', 'int-ooo'],
 ['int-allhands', 'int-review-process', 'fin-q3', 'int-ooo'],
 ['int-allhands', 'hr-juniper', 'int-review-process', 'fin-q3'],
 ['pub-returns', 'pub-berlin', 'pub-careers', 'pub-privacy'],
 ['int-ooo', 'int-office-days', 'int-holidays', 'int-allhands'],
 ['int-ooo', 'int-office-days', 'int-holidays', 'int-allhands'],
 ['int-ooo', 'int-office-days', 'int-holidays', 'int-allhands'],
 ['int-ooo', 'int-office-days', 'int-holidays', 'hr-juniper'],
 ['ben-leave-daniel', 'int-ooo', 'int-office-days', 'int-holidays'],
 ['int-ooo', 'int-office-days', 'int-holidays', 'int-allhands'],
 ['int-ooo', 'int-office-days', 'int-holidays', 'hr-juniper'],
 ['pub-returns', 'pub-shipping', 'pub-careers', 'pub-privacy'],
 ['int-org', 'int-allhands', 'int-ooo', 'int-review-process'],
 ['int-org', 'int-allhands', 'int-ooo', 'int-review-process'],
 ['int-org', 'int-allhands', 'int-ooo', 'int-review-process'],
 ['int-org', 'int-allhands', 'int-ooo', 'int-review-process'],
 ['int-org', 'int-allhands', 'int-ooo', 'int-review-process'],
 ['int-org', 'int-allhands', 'int-ooo', 'int-review-process'],
 ['int-org', 'int-allhands', 'int-ooo', 'int-review-process'],
 ['pub-careers', 'pub-privacy', 'pub-about', 'pub-loyalty'],
 ['sup-escalation', 'case-c104', 'int-salary-process', 'int-expenses'],
 ['sup-escalation', 'case-c104', 'int-salary-process', 'int-expenses'],
 ['int-salary-process', 'int-expenses', 'pub-returns', 'int-parental-leave'],
 ['int-salary-process', 'int-expenses', 'pub-returns', 'int-parental-leave'],
 ['int-salary-process', 'int-expenses', 'pub-returns', 'int-parental-leave'],
 ['int-salary-process', 'int-expenses', 'pub-returns', 'fin-eu-vat'],
 ['int-salary-process', 'int-expenses', 'pub-returns', 'int-parental-leave'],
 ['pub-returns', 'pub-warranty', 'pub-careers', 'pub-privacy'],
 ['sup-fraud', 'sup-escalation', 'int-security', 'case-c107'],
 ['sup-fraud', 'sup-escalation', 'int-security', 'case-c107'],
 ['eng-architecture', 'eng-vuln', 'eng-oncall', 'int-security'],
 ['int-security', 'pub-privacy', 'pub-returns', 'pub-loyalty'],
 ['int-security', 'pub-privacy', 'pub-returns', 'pub-loyalty'],
 ['int-security', 'pub-privacy', 'fin-eu-vat', 'fin-carrier'],
 ['eng-vuln', 'int-security', 'pub-privacy', 'fin-carrier'],
 ['pub-privacy', 'pub-returns', 'pub-loyalty', 'pub-shipping'],
 ['case-c101', 'case-c107', 'case-c102', 'int-ooo'], ['case-c101', 'case-c107', 'case-c102', 'int-ooo'],
 ['int-ooo', 'int-parental-leave', 'eng-oncall', 'int-office-days'],
 ['hr-investigation', 'int-ooo', 'hr-juniper', 'hr-review-ana'],
 ['ben-leave-daniel', 'hr-investigation', 'int-ooo', 'hr-juniper'],
 ['int-ooo', 'int-parental-leave', 'int-office-days', 'fin-carrier'],
 ['int-ooo', 'hr-juniper', 'int-parental-leave', 'int-office-days'],
 ['pub-returns', 'pub-loyalty', 'pub-privacy', 'pub-careers'],
 ['case-c102', 'pub-stove', 'int-ooo', 'pub-shipping'], ['case-c102', 'pub-stove', 'int-ooo', 'pub-shipping'],
 ['pub-stove', 'int-ooo', 'pub-shipping', 'pub-berlin'],
 ['pub-stove', 'hr-juniper', 'int-ooo', 'pub-shipping'],
 ['pub-stove', 'hr-juniper', 'int-ooo', 'ben-leave-daniel'],
 ['pub-stove', 'int-ooo', 'pub-shipping', 'pub-berlin'],
 ['pub-stove', 'hr-juniper', 'int-ooo', 'pub-shipping'],
 ['pub-stove', 'pub-shipping', 'pub-berlin', 'pub-careers'],
 ['case-c104', 'pub-returns', 'int-expenses', 'sup-escalation'],
 ['case-c104', 'pub-returns', 'int-expenses', 'sup-escalation'],
 ['pub-returns', 'int-expenses', 'eng-postmortem', 'int-org'],
 ['pub-returns', 'int-expenses', 'hr-review-ana', 'int-org'],
 ['pub-returns', 'int-expenses', 'hr-review-ana', 'ben-accommodation-mia'],
 ['pub-returns', 'fin-eu-vat', 'int-expenses', 'fin-budget'],
 ['pub-returns', 'int-expenses', 'leg-cnil', 'fin-budget'],
 ['pub-returns', 'pub-privacy', 'pub-loyalty', 'pub-careers'],
 ['case-c107', 'int-org', 'pub-privacy', 'case-c101'], ['case-c107', 'int-org', 'pub-privacy', 'case-c101'],
 ['int-org', 'pub-privacy', 'int-ooo', 'pub-careers'], ['int-org', 'pub-privacy', 'int-ooo', 'pub-careers'],
 ['int-org', 'pub-privacy', 'ben-accommodation-mia', 'int-ooo'],
 ['int-org', 'pub-privacy', 'int-ooo', 'pub-careers'], ['int-org', 'pub-privacy', 'leg-cnil', 'int-ooo'],
 ['pub-privacy', 'pub-careers', 'pub-loyalty', 'pub-berlin'],
 ['case-c110', 'hr-review-ana', 'case-c101', 'case-c107'],
 ['case-c110', 'case-c101', 'case-c107', 'int-allhands'],
 ['int-allhands', 'pub-tent-ridgeline', 'hr-review-ravi', 'int-org'],
 ['hr-review-ana', 'hr-investigation', 'int-allhands', 'pub-tent-ridgeline'],
 ['hr-review-ana', 'ben-accommodation-mia', 'hr-investigation', 'int-allhands'],
 ['int-allhands', 'pub-tent-ridgeline', 'int-org', 'int-ooo'],
 ['int-allhands', 'pub-tent-ridgeline', 'exec-pricing', 'int-org'],
 ['pub-tent-ridgeline', 'pub-privacy', 'pub-careers', 'pub-stove'],
 ['int-security', 'int-office-days', 'int-allhands', 'int-review-process'],
 ['int-security', 'int-office-days', 'int-allhands', 'int-review-process'],
 ['eng-oncall', 'int-security', 'eng-vuln', 'eng-postmortem'],
 ['int-security', 'int-office-days', 'int-allhands', 'int-review-process'],
 ['int-security', 'int-office-days', 'int-allhands', 'int-review-process'],
 ['int-security', 'int-office-days', 'int-allhands', 'int-review-process'],
 ['int-security', 'eng-vuln', 'int-office-days', 'int-allhands'],
 ['pub-privacy', 'pub-stove', 'pub-loyalty', 'pub-warranty'],
 ['int-ooo', 'int-holidays', 'case-c107', 'case-c101'], ['int-ooo', 'int-holidays', 'case-c107', 'case-c101'],
 ['eng-postmortem', 'eng-oncall', 'int-ooo', 'eng-vuln'],
 ['int-ooo', 'int-holidays', 'hr-juniper', 'hr-investigation'],
 ['int-ooo', 'int-holidays', 'ben-leave-daniel', 'hr-juniper'],
 ['int-ooo', 'int-holidays', 'int-allhands', 'pub-returns'],
 ['int-ooo', 'eng-vuln', 'int-holidays', 'hr-juniper'],
 ['pub-returns', 'pub-shipping', 'pub-loyalty', 'pub-privacy'],
 ['pub-privacy', 'case-c107', 'int-allhands', 'int-security'],
 ['pub-privacy', 'case-c107', 'int-allhands', 'int-security'],
 ['pub-privacy', 'eng-architecture', 'int-allhands', 'eng-postmortem'],
 ['pub-privacy', 'int-allhands', 'int-security', 'pub-returns'],
 ['pub-privacy', 'int-allhands', 'int-security', 'pub-returns'],
 ['pub-privacy', 'fin-eu-vat', 'int-allhands', 'int-security'],
 ['pub-privacy', 'leg-cnil', 'int-allhands', 'int-security'],
 ['pub-privacy', 'pub-returns', 'pub-berlin', 'pub-shipping'],
 ['int-security', 'int-allhands', 'sup-fraud', 'int-ooo'],
 ['int-security', 'int-allhands', 'sup-fraud', 'int-ooo'],
 ['eng-vuln', 'int-security', 'eng-postmortem', 'eng-oncall'],
 ['int-security', 'hr-investigation', 'int-allhands', 'hr-juniper'],
 ['int-security', 'hr-investigation', 'int-allhands', 'hr-juniper'],
 ['int-security', 'int-allhands', 'int-ooo', 'int-office-days'],
 ['eng-vuln', 'int-security', 'int-allhands', 'hr-juniper'],
 ['pub-privacy', 'pub-warranty', 'pub-careers', 'pub-about'],
 ['int-salary-process', 'int-review-process', 'pub-careers', 'int-allhands'],
 ['int-salary-process', 'int-review-process', 'pub-careers', 'int-allhands'],
 ['int-salary-process', 'hr-review-ravi', 'int-review-process', 'pub-careers'],
 ['hr-salary-bands', 'int-salary-process', 'hr-review-ravi', 'int-review-process'],
 ['hr-salary-bands', 'int-salary-process', 'hr-review-ravi', 'int-review-process'],
 ['int-salary-process', 'int-review-process', 'pub-careers', 'int-allhands'],
 ['int-salary-process', 'exec-ceo-pay', 'int-review-process', 'pub-careers'],
 ['pub-careers', 'pub-berlin', 'pub-shipping', 'pub-warranty'],
 ['int-allhands', 'hr-review-ana', 'int-review-process', 'int-ooo'],
 ['int-allhands', 'int-review-process', 'int-ooo', 'int-salary-process'],
 ['hr-review-ravi', 'int-allhands', 'int-review-process', 'int-ooo'],
 ['hr-review-ravi', 'int-allhands', 'hr-review-ana', 'int-review-process'],
 ['hr-review-ravi', 'int-allhands', 'ben-accommodation-mia', 'hr-review-ana'],
 ['int-allhands', 'int-review-process', 'int-ooo', 'int-salary-process'],
 ['exec-ceo-pay', 'int-allhands', 'int-review-process', 'int-ooo'],
 ['pub-careers', 'pub-berlin', 'pub-tent-ridgeline', 'pub-loyalty'],
 ['hr-review-ana', 'int-review-process', 'case-c110', 'case-c104'],
 ['int-review-process', 'case-c110', 'case-c104', 'case-c107'],
 ['hr-review-ravi', 'int-review-process', 'int-salary-process', 'int-ooo'],
 ['hr-review-ana', 'hr-review-ravi', 'int-review-process', 'int-salary-process'],
 ['hr-review-ana', 'hr-review-ravi', 'int-review-process', 'ben-accommodation-mia'],
 ['int-review-process', 'int-salary-process', 'fin-q3', 'int-ooo'],
 ['int-review-process', 'exec-ceo-pay', 'int-salary-process', 'hr-juniper'],
 ['pub-tent-ridgeline', 'pub-careers', 'pub-returns', 'pub-privacy'],
 ['int-ooo', 'int-allhands', 'int-holidays', 'int-office-days'],
 ['int-ooo', 'int-allhands', 'int-holidays', 'int-office-days'],
 ['int-ooo', 'int-allhands', 'int-holidays', 'eng-vuln'],
 ['hr-juniper', 'int-ooo', 'int-allhands', 'int-holidays'],
 ['hr-juniper', 'int-ooo', 'int-allhands', 'int-holidays'],
 ['int-ooo', 'int-allhands', 'int-holidays', 'int-office-days'],
 ['hr-juniper', 'int-ooo', 'int-allhands', 'int-holidays'],
 ['pub-careers', 'pub-berlin', 'pub-privacy', 'pub-loyalty'],
 ['int-salary-process', 'int-ooo', 'hr-review-ana', 'case-c110'],
 ['int-salary-process', 'int-ooo', 'case-c110', 'int-allhands'],
 ['int-salary-process', 'int-ooo', 'eng-vuln', 'int-allhands'],
 ['hr-investigation', 'int-salary-process', 'int-ooo', 'hr-review-ana'],
 ['hr-investigation', 'int-salary-process', 'ben-accommodation-mia', 'int-ooo'],
 ['int-salary-process', 'int-ooo', 'int-allhands', 'int-review-process'],
 ['int-salary-process', 'leg-cnil', 'int-ooo', 'eng-vuln'],
 ['pub-careers', 'pub-privacy', 'pub-loyalty', 'pub-about'],
 ['int-ooo', 'int-office-days', 'int-holidays', 'case-c102'],
 ['int-ooo', 'int-office-days', 'int-holidays', 'case-c102'],
 ['int-ooo', 'int-office-days', 'int-holidays', 'eng-postmortem'],
 ['int-ooo', 'int-office-days', 'hr-investigation', 'int-holidays'],
 ['ben-leave-daniel', 'int-ooo', 'int-office-days', 'hr-investigation'],
 ['int-ooo', 'int-office-days', 'int-holidays', 'int-org'],
 ['int-ooo', 'int-office-days', 'exec-ceo-pay', 'int-holidays'],
 ['pub-careers', 'pub-privacy', 'pub-returns', 'pub-about'],
 ['int-ooo', 'int-office-days', 'hr-review-ana', 'case-c107'],
 ['int-ooo', 'int-office-days', 'case-c107', 'int-holidays'],
 ['int-ooo', 'int-office-days', 'int-holidays', 'int-parental-leave'],
 ['int-ooo', 'int-office-days', 'hr-review-ana', 'int-holidays'],
 ['ben-accommodation-mia', 'int-ooo', 'int-office-days', 'hr-review-ana'],
 ['int-ooo', 'int-office-days', 'int-holidays', 'int-parental-leave'],
 ['int-ooo', 'int-office-days', 'int-holidays', 'int-parental-leave'],
 ['pub-loyalty', 'pub-careers', 'pub-privacy', 'pub-returns'],
 ['int-allhands', 'int-review-process', 'int-salary-process', 'int-ooo'],
 ['int-allhands', 'int-review-process', 'int-salary-process', 'int-ooo'],
 ['int-allhands', 'int-review-process', 'eng-postmortem', 'hr-review-ravi'],
 ['int-allhands', 'int-review-process', 'hr-review-ravi', 'int-salary-process'],
 ['int-allhands', 'int-review-process', 'hr-review-ravi', 'int-salary-process'],
 ['fin-q3', 'int-allhands', 'fin-eu-vat', 'fin-budget'],
 ['fin-q3', 'int-allhands', 'exec-ceo-pay', 'exec-pricing'],
 ['pub-returns', 'pub-berlin', 'pub-careers', 'pub-privacy'],
 ['int-allhands', 'int-salary-process', 'int-org', 'int-holidays'],
 ['int-allhands', 'int-salary-process', 'int-org', 'int-holidays'],
 ['int-allhands', 'int-salary-process', 'int-org', 'int-holidays'],
 ['int-allhands', 'hr-salary-bands', 'hr-juniper', 'int-salary-process'],
 ['int-allhands', 'hr-salary-bands', 'hr-juniper', 'int-salary-process'],
 ['fin-budget', 'int-allhands', 'fin-q3', 'int-salary-process'],
 ['fin-budget', 'int-allhands', 'exec-pricing', 'fin-q3'],
 ['pub-careers', 'pub-berlin', 'pub-loyalty', 'pub-about'],
 ['pub-loyalty', 'pub-shipping', 'pub-privacy', 'pub-returns'],
 ['pub-loyalty', 'pub-shipping', 'pub-privacy', 'pub-returns'],
 ['pub-loyalty', 'pub-shipping', 'pub-privacy', 'pub-returns'],
 ['pub-loyalty', 'pub-shipping', 'hr-salary-bands', 'pub-privacy'],
 ['pub-loyalty', 'pub-shipping', 'hr-salary-bands', 'pub-privacy'],
 ['fin-carrier', 'pub-loyalty', 'pub-shipping', 'pub-privacy'],
 ['fin-carrier', 'pub-loyalty', 'exec-pricing', 'pub-shipping'],
 ['pub-loyalty', 'pub-shipping', 'pub-privacy', 'pub-returns'],
 ['int-allhands', 'pub-returns', 'pub-berlin', 'case-c104'],
 ['int-allhands', 'pub-returns', 'pub-berlin', 'case-c104'],
 ['int-allhands', 'pub-returns', 'pub-berlin', 'pub-privacy'],
 ['int-allhands', 'pub-returns', 'pub-berlin', 'pub-privacy'],
 ['int-allhands', 'pub-returns', 'pub-berlin', 'pub-privacy'],
 ['fin-eu-vat', 'fin-q3', 'int-allhands', 'pub-returns'],
 ['fin-q3', 'leg-cnil', 'int-allhands', 'pub-returns'],
 ['pub-returns', 'pub-berlin', 'pub-privacy', 'pub-warranty'],
 ['case-c107', 'pub-warranty', 'sup-escalation', 'int-expenses'],
 ['case-c107', 'pub-warranty', 'sup-escalation', 'int-expenses'],
 ['eng-vuln', 'pub-warranty', 'int-expenses', 'pub-privacy'],
 ['hr-investigation', 'pub-warranty', 'int-expenses', 'pub-privacy'],
 ['hr-investigation', 'pub-warranty', 'int-expenses', 'pub-privacy'],
 ['pub-warranty', 'int-expenses', 'pub-privacy', 'int-org'],
 ['leg-trailco', 'leg-cnil', 'eng-vuln', 'pub-warranty'],
 ['pub-warranty', 'pub-privacy', 'pub-careers', 'pub-loyalty'],
 ['sup-fraud', 'pub-privacy', 'sup-escalation', 'case-c110'],
 ['sup-fraud', 'pub-privacy', 'sup-escalation', 'case-c110'],
 ['eng-vuln', 'pub-privacy', 'pub-warranty', 'eng-postmortem'],
 ['hr-investigation', 'pub-privacy', 'pub-warranty', 'int-salary-process'],
 ['hr-investigation', 'pub-privacy', 'pub-warranty', 'int-salary-process'],
 ['pub-privacy', 'pub-warranty', 'fin-eu-vat', 'int-salary-process'],
 ['leg-cnil', 'leg-trailco', 'eng-vuln', 'pub-privacy'],
 ['pub-privacy', 'pub-warranty', 'pub-about', 'pub-returns'],
 ['int-allhands', 'int-org', 'pub-careers', 'pub-berlin'],
 ['int-allhands', 'int-org', 'pub-careers', 'pub-berlin'],
 ['int-allhands', 'int-org', 'eng-vuln', 'pub-careers'],
 ['int-allhands', 'hr-juniper', 'int-org', 'pub-careers'],
 ['int-allhands', 'hr-juniper', 'int-org', 'pub-careers'],
 ['int-allhands', 'fin-q3', 'fin-budget', 'int-org'],
 ['exec-heron', 'int-allhands', 'fin-q3', 'exec-ceo-pay'],
 ['pub-careers', 'pub-berlin', 'pub-privacy', 'pub-loyalty'],
 ['int-salary-process', 'int-allhands', 'int-holidays', 'int-expenses'],
 ['int-salary-process', 'int-allhands', 'int-holidays', 'int-expenses'],
 ['int-salary-process', 'int-allhands', 'int-holidays', 'int-expenses'],
 ['hr-salary-bands', 'int-salary-process', 'int-allhands', 'int-holidays'],
 ['hr-salary-bands', 'int-salary-process', 'int-allhands', 'int-holidays'],
 ['fin-budget', 'int-salary-process', 'int-allhands', 'fin-q3'],
 ['exec-pricing', 'fin-budget', 'int-salary-process', 'int-allhands'],
 ['pub-berlin', 'pub-careers', 'pub-warranty', 'pub-shipping'],
 ['int-salary-process', 'int-allhands', 'int-org', 'hr-review-ana'],
 ['int-salary-process', 'int-allhands', 'int-org', 'int-expenses'],
 ['int-salary-process', 'hr-review-ravi', 'int-allhands', 'int-org'],
 ['int-salary-process', 'hr-salary-bands', 'hr-review-ravi', 'int-allhands'],
 ['int-salary-process', 'hr-salary-bands', 'hr-review-ravi', 'int-allhands'],
 ['int-salary-process', 'fin-q3', 'int-allhands', 'int-org'],
 ['exec-ceo-pay', 'int-salary-process', 'fin-q3', 'int-allhands'],
 ['pub-careers', 'pub-loyalty', 'pub-berlin', 'pub-privacy']]

# The 152 answers shown an edited page, asked again: [the question's page, gave its fact then, now].
CHANGED = [['pub-returns', True, False], ['pub-returns', True, False], ['pub-returns', True, False],
 ['pub-returns', True, False], ['pub-returns', True, False], ['pub-returns', True, False],
 ['pub-returns', True, False], ['pub-returns', True, False], ['pub-shipping', True, True],
 ['pub-shipping', True, True], ['pub-shipping', True, True], ['pub-shipping', True, True],
 ['pub-shipping', True, True], ['pub-shipping', True, True], ['pub-shipping', True, True],
 ['pub-shipping', True, True], ['pub-careers', True, True], ['pub-careers', True, True],
 ['pub-careers', True, True], ['pub-careers', False, False], ['pub-careers', False, False],
 ['pub-careers', True, True], ['pub-careers', True, True], ['pub-berlin', True, True],
 ['pub-privacy', True, True], ['pub-privacy', True, True], ['pub-privacy', True, True],
 ['pub-privacy', True, True], ['pub-privacy', True, True], ['pub-privacy', True, True],
 ['pub-privacy', True, True], ['pub-privacy', True, True], ['pub-loyalty', True, True],
 ['pub-loyalty', True, True], ['pub-loyalty', True, True], ['int-security', False, False],
 ['int-expenses', True, True], ['int-expenses', True, True], ['int-expenses', True, True],
 ['int-expenses', True, True], ['int-expenses', True, True], ['int-expenses', True, True],
 ['int-expenses', False, False], ['int-office-days', True, True], ['int-office-days', True, True],
 ['int-office-days', True, True], ['int-office-days', True, True], ['int-office-days', True, True],
 ['int-office-days', True, True], ['int-office-days', True, True], ['int-office-days', False, False],
 ['int-holidays', True, False], ['int-holidays', True, False], ['int-holidays', True, False],
 ['int-holidays', True, False], ['int-holidays', True, False], ['int-holidays', True, False],
 ['int-holidays', True, False], ['int-holidays', False, False], ['int-parental-leave', True, False],
 ['int-parental-leave', True, False], ['int-parental-leave', True, False],
 ['int-parental-leave', True, False], ['int-parental-leave', True, False],
 ['int-parental-leave', True, False], ['int-parental-leave', True, False],
 ['int-parental-leave', False, False], ['int-review-process', False, False],
 ['int-salary-process', False, False], ['int-allhands', False, False], ['int-ooo', True, True],
 ['int-ooo', True, True], ['int-ooo', True, True], ['int-ooo', True, True], ['int-ooo', True, True],
 ['int-ooo', True, True], ['int-ooo', True, True], ['int-ooo', False, False],
 ['sup-escalation', False, False], ['sup-escalation', False, False], ['sup-escalation', False, False],
 ['sup-escalation', False, False], ['sup-escalation', False, False], ['sup-escalation', False, False],
 ['sup-fraud', False, False], ['sup-fraud', False, False], ['sup-fraud', False, False],
 ['case-c101', False, False], ['case-c101', False, False], ['case-c101', False, False],
 ['case-c101', False, False], ['case-c104', True, True], ['case-c104', True, True],
 ['case-c104', False, False], ['case-c104', False, False], ['case-c104', False, False],
 ['case-c104', False, False], ['case-c104', False, False], ['case-c104', False, False],
 ['eng-postmortem', False, False], ['eng-postmortem', False, False], ['eng-postmortem', False, False],
 ['eng-postmortem', False, False], ['eng-postmortem', False, False], ['eng-postmortem', False, False],
 ['eng-postmortem', False, False], ['eng-architecture', False, False], ['eng-architecture', False, False],
 ['eng-architecture', False, False], ['hr-review-ana', False, False], ['hr-juniper', False, False],
 ['hr-juniper', False, False], ['hr-juniper', False, False], ['hr-juniper', True, True],
 ['hr-juniper', True, True], ['hr-juniper', False, False], ['hr-juniper', True, True],
 ['ben-leave-daniel', False, False], ['ben-leave-daniel', False, False], ['ben-leave-daniel', False, False],
 ['ben-leave-daniel', False, False], ['ben-leave-daniel', False, False], ['ben-leave-daniel', False, False],
 ['ben-leave-daniel', False, False], ['ben-accommodation-mia', False, False],
 ['ben-accommodation-mia', False, False], ['ben-accommodation-mia', False, False],
 ['ben-accommodation-mia', False, False], ['ben-accommodation-mia', False, False],
 ['ben-accommodation-mia', False, False], ['fin-q3', False, False], ['fin-budget', False, False],
 ['fin-budget', False, False], ['fin-budget', False, False], ['fin-carrier', False, False],
 ['fin-carrier', False, False], ['fin-carrier', False, False], ['fin-carrier', False, False],
 ['fin-eu-vat', False, False], ['fin-eu-vat', False, False], ['fin-eu-vat', False, False],
 ['fin-eu-vat', False, False], ['fin-eu-vat', False, False], ['fin-eu-vat', True, True],
 ['fin-eu-vat', False, False], ['fin-eu-vat', False, False], ['leg-cnil', False, False],
 ['exec-pricing', False, False], ['exec-pricing', False, False], ['exec-pricing', False, False],
 ['exec-pricing', False, False], ['exec-pricing', False, False]]

# Ana's logged answer to "How long do customers have to return an item?"
ANA = {"model_returned": "gpt-5.4-nano-2026-03-17", "prompt_version": "answer-v1",
       "answer": 'Customers can return unused items within **30 days of delivery** [pub-returns].',
       "doc_hashes": {i: OLD[i] for i in ['pub-returns', 'case-c104', 'sup-escalation', 'pub-warranty']}}
ANA_TODAY = 'Customers can return unused items within **45 days of delivery**. [pub-returns]'


def test_fingerprint_of_the_returns_page():
    assert doc_hash(RETURNS) == "03e25881f6a16970"


def test_one_word_changes_the_whole_fingerprint():
    edited = dict(RETURNS, text=RETURNS["text"].replace(*EDIT))
    assert doc_hash(edited) == "eb2aed3366582a2c"


def test_permissions_are_part_of_the_page():
    assert doc_hash(dict(RETURNS, groups=["staff"])) != doc_hash(RETURNS)


def test_tent_six_wordings_one_fact():
    c = replay_counts([{"texts": TENT, "facts": [True] * 6}])
    assert c == {"n": 5, "same_text": 0, "all_same": 0, "same_fact": 5}


def test_replays_repeat_the_fact_not_the_words():
    c = replay_counts([{"texts": t, "facts": f} for t, f in GROUPS])
    assert c == {"n": 300, "same_text": 123, "all_same": 14, "same_fact": 300}


def test_152_logged_answers_were_shown_an_edited_page():
    assert len(SHOWN) == 376
    assert shown_an_edited_page(SHOWN, OLD, NEW) == 152
    assert shown_an_edited_page(SHOWN, OLD, OLD) == 0


def test_anas_answer_the_model_is_ruled_out_the_page_is_not():
    assert "30 days" in ANA["answer"] and "45 days" in ANA_TODAY
    d = diagnose(ANA, "gpt-5.4-nano-2026-03-17", NEW)
    assert d == {"model_changed": False, "pages_changed": ["pub-returns"]}


def test_a_new_model_version_would_show_up_too():
    d = diagnose(ANA, "gpt-5.4-nano-2026-09-01", OLD)
    assert d == {"model_changed": True, "pages_changed": []}


def test_22_answers_changed_all_about_an_edited_fact():
    assert len(CHANGED) == 152
    c = changed_facts(CHANGED)
    assert c == {"pub-returns": 8, "int-parental-leave": 7, "int-holidays": 7}
    assert sum(c.values()) == 22
