Atris

Write an engineer escalation from a ticket.
Done by an agent. Checked twice.

A long ticket thread becomes one short page an engineer can act on, with corrected facts and exact quotes.

Have Atris do this for you›

1

Real files in

  • thread.md
    One support ticket thread of 25 messages over twelve days, with a wrong account number, a wrong device, a wrong version and an estimate that the records later replace. 205 lines, 11 KB.

Sample data written by Atris. Not a real company.

2

Three steps

  1. 1.Read the whole thread
  2. 2.Pull out what an engineer needs
  3. 3.Write the escalation page

Claude Sonnet 5.5, 52 seconds. No web. It never saw the check.

3

Checked twice

  • ✓Passed: 15 of 15 required parts are present in escalation.md
  • ✓Passed: 7 of 7 facts lines give the last value stated in the thread
  • ✓Passed: 3 of 3 facts the thread corrected show their old value under Corrections
  • ✓Passed: 5 of 5 fixes the thread says were tried are listed under Already tried
  • ✓Passed: 5 of 5 quotes under Evidence appear word for word in the message they name
  • ✓Passed: 5 of 5 ticket, account, booking and error ids on the page appear in the thread
  • ✓Passed: The page is 496 words, against a limit of 500, from a thread of 2,070 words
  • ✓Passed: 25 of 25 dates, lengths of time, version numbers and other figures on the page are stated in the thread
  • ✓Passed: 4 of 4 corrected facts cite the first message that states the current value

Second review by Claude Opus 5.5: pass.

Then we broke a copy of the output 3 ways on purpose. The check caught 3.

What it wrote. Lines 1 to 13 of escalation.md, copied from the file.
Ticket: T-2987
Account: AC-40781
First reported: 2026-11-09 08:14
Device: Samsung Galaxy Tab A9
App version: 4.11.2
Error code: E-4093
Bookings affected: 17 counted from records (3 Nov to 17 Nov)

## What happens
The Android app skips its slot-free check when saving a booking during a calendar sync. If a patient just booked that slot on the public booking page, both bookings are kept with no warning. Each counted pair was created within 90 seconds, one in the app and one on the booking page.

## Customer impact
Harbour Physio Clinic (premier): double-booked patients turn up and one is sent home each time. Five had no slot to move to. Deadline: if not fixed by 30 November, the clinic will leave for another booking system.

How this was run

An AI agent on Claude Sonnet 5.5 was given a folder with the files below and a three-step flow, and nothing else. It had no web access and never saw the check. The check was written before the run and made stricter after it. It works the answer out again from the input files. Then Claude Opus 5.5 reviewed the result against the inputs. The input files are sample data written by Atris, with the problems a real week has planted in them.

Run 1 of 1 on 1 December 2026. The agent took 52 seconds.

What the second review verified

  • The facts block shows the current values. Account AC-40781 is from Message 5, which replaces AC-40718. Device Samsung Galaxy Tab A9 and app version 4.11.2 are from Message 12, which replace iPad and 4.12. Error code E-4093 comes from the Message 18 log. E-2201 is correctly left off because it was a separate problem fixed in Message 6. First reported is 2026-11-09 08:14, the time of Message 1.
  • Bookings affected starts with the counted 17 (3 Nov to 17 Nov) from Message 16, not the 'about 20' the customer remembered in Message 7. The Corrections section also records the start date moving from about 5 Nov to 3 Nov.
  • All 5 Evidence quotes appear word for word in the messages they name. For example, Message 18 has 'warn E-4093 slot check skipped: sync lock held' in its log line, and Message 22 has 'The web calendar always checks the slot when you save, sync or no sync.'
  • The page is 496 words, under the 500 limit, and has all eight sections in order. The steps to reproduce match Message 19, and the browser workaround matches Messages 22 and 23. Every fix tried is listed: clear cache and restart, reconnect, reinstall, sync off, and web calendar. The billing credit and the reminder-text side question are left out, as the job requires.

What this run does not show

  • A date or figure passes when the thread states it anywhere. The check cannot tell whether it is the right one for the sentence it sits in.
  • Whether an engineer could start work from the page is a judgement. Only the second review read it for sense.
  • Most message numbers cited outside the Evidence section are not checked. On this run the second review could see the check file.

Would the check catch a wrong answer?

A check that cannot fail proves nothing. After the run we took a copy of the output, broke it one small way at a time and ran the check again. It caught 3 of 3. The check was made stricter after the first try at this, and the same untouched output was graded again.

Open every file

flow.md · the three steps the agent followed
# Write an engineer escalation from a ticket

function: support
for: the support agent handing a stuck ticket to engineering
goal: An engineer who has never seen the ticket can start work from one short page where every fact can be traced to the thread.

## 1. Read the whole thread
Read input/thread.md from the first message to the last. Note who said what and when. People
correct themselves and each other as a thread goes on. When a fact is corrected later, the later
value is the current one. A number counted from records beats a number someone remembered.

## 2. Pull out what an engineer needs
Collect the current facts, what goes wrong, who is hurt and by when, how to make it happen again
and every fix or test already tried with its result. Note any way the customer can stay safe for now.
Leave out apologies, billing matters and side questions that have nothing to do with the fault.
Use only what the thread says. If the thread does not say something an engineer would want, put it
under open questions instead of guessing.

## 3. Write the escalation page
Write output/escalation.md. It must be 500 words or fewer, counting every word in the file.

Start with a facts block, one fact per line in the form `Label: value`, current value only, with
these seven labels in this order: Ticket, Account, First reported, Device, App version, Error code,
Bookings affected.
- First reported is the date and time of the customer's first message, written as the thread writes it.
- Error code is the code tied to this fault. A code for a problem that was fixed earlier in the thread does not belong on this line.
- Bookings affected starts with the counted number when the thread has one.

Then these eight sections, each under a `## ` heading with exactly this name, in this order:
- `What happens`: two or three plain sentences.
- `Customer impact`: who is hurt and any deadline the customer gave.
- `Steps to reproduce`: numbered steps, only if someone in the thread made the fault happen again. Otherwise say it has not been reproduced.
- `Already tried`: one line for each fix or test tried in the thread, with what happened.
- `Workaround`: what keeps the customer safe for now, if the thread gives one.
- `Evidence`: three to five lines, each in the form `- Message N: "quote"`. The quote is copied word for word from that message and is at least six words long.
- `Corrections`: one line for each fact that changed during the thread, giving the old value, the current value and the message that corrected it.
- `Open questions`: what an engineer still needs that the thread does not answer.

Every id, code, version number and date on the page must come from the thread.

## Done looks like
- The page is 500 words or fewer and has the facts block and all eight sections.
- Every facts line gives the current value, not one the thread later corrected.
- Every quote under Evidence can be found word for word in the message it names.
input/thread.md · 205 lines, 11 KB
# Ticket T-2987: Clients double booked into the same slot

Customer: Harbour Physio Clinic
Plan: premier
Opened: 2026-11-09 08:14
Status: open, waiting on support
Messages: 25

### Message 1 | 2026-11-09 08:14 | Callum Reyes-Whitlock | customer

Hello. We have a serious problem. Twice last week and once already this morning two patients were booked into the same slot with the same physio. Both got a confirmation. Both turned up. That is 3 double bookings this week and my front desk had to send one of them home each time.

I think it began around 5 November. We take bookings on the iPad at reception and through the booking page on our website. Nothing has changed on our side. Please look into this urgently.

Callum

### Message 2 | 2026-11-09 08:51 | Jonah Pettersen | support, front line

Hi Dr. Reyes Whitlok, I am sorry about this, that must be stressful for your front desk.

Could you try two quick things for me? First clear the app cache on the reception device (Settings, then Storage, then Clear cache). Then restart the device. Old data held on the device is the most common cause of bookings not showing up.

Let me know how it goes.

Jonah

### Message 3 | 2026-11-09 11:20 | Callum Reyes-Whitlock | customer

It is Reyes-Whitlock, with a hyphen and a c.

We cleared the cache and restarted the tablet at 9:30. At 10:40 it happened again, two patients for 15:00 with Lin. So that did nothing.

One more thing that may or may not matter. Since about the start of the month there has been a yellow banner on the calendar saying sync timed out, code E-2201. It comes and goes.

### Message 4 | 2026-11-09 12:05 | Jonah Pettersen | support, front line

Thanks, and apologies for the name.

E-2201 means the link to your Google Calendar timed out. Please go to Settings, Calendar sync, choose Disconnect and then connect it again. That normally clears the banner.

I have also looked at account AC-40718 and I do not see any overlapping bookings on it this month, so I would like to be sure we are talking about the same calendar.

Jonah

### Message 5 | 2026-11-10 08:02 | Callum Reyes-Whitlock | customer

We reconnected Google Calendar yesterday afternoon. The yellow banner has gone and has not come back, so thank you for that part.

The double bookings have not stopped. There was another one at 17:10 yesterday, after the reconnect.

Also AC-40718 is not our account number. Ours is AC-40781. It is printed on every invoice you send us. I would rather you were not looking through some other clinic's calendar.

### Message 6 | 2026-11-10 08:40 | Jonah Pettersen | support, front line

You are right and I am sorry. I transposed two digits. I have closed the other account and I am now looking at AC-40781, where I can see the overlapping bookings you describe.

The banner error is fixed, so that was a separate problem from the double bookings.

Next step: please remove the Fernwick app from the reception tablet and install it again from the store. That makes sure you are on a clean copy.

Jonah

### Message 7 | 2026-11-11 16:32 | Callum Reyes-Whitlock | customer

We reinstalled the app last night. It is the newest version, 4.12 I think. Two more double bookings today.

I have gone back through the diary with my practice manager. That makes about 20 double bookings so far this month. Each one is a patient who took time off work and was sent home. We pay for the premier plan. I would like to know what you are going to do about the cost of this.

### Message 8 | 2026-11-11 17:05 | Tobias Wren | support, billing

Dr. Reyes-Whitlock, I look after billing. I have added a credit for one month of your plan to the account. You will see it on the December invoice. This is separate from the fix, which my colleagues are still working on.

Tobias

### Message 9 | 2026-11-12 07:48 | Callum Reyes-Whitlock | customer

Thank you for the credit. To be clear, a credit is not what I need. I need patients to stop being double booked.

### Message 10 | 2026-11-12 09:15 | Jonah Pettersen | support, front line

Understood. I have tried the usual steps and they have not worked, so I am passing this ticket to Meera in product support, who knows the calendar side far better than I do. She has the full history.

Jonah

### Message 11 | 2026-11-12 10:30 | Meera Iyengar | support, product support

Hello Dr. Reyes-Whitlock, Meera here. I have read the whole thread. Three questions and one test.

1. Which exact device is at reception? Make and model please.
2. What does Settings, About show as the app version on that device? The exact number, with all three parts.
3. Do you use two way sync with Google Calendar, where events added in Google block time in Fernwick?

The test: if two way sync is on, please turn it off for a few days and tell me whether the double bookings stop. I know that is inconvenient.

### Message 12 | 2026-11-13 08:25 | Callum Reyes-Whitlock | customer

I asked the front desk to check instead of guessing.

1. I was wrong about the device. The tablet in the treatment room is the Apple one and it has never caused a double booking. The device on the reception desk, where all of these were made, is a Samsung Galaxy Tab A9.
2. Settings, About on that tablet says 4.11.2. So not the number I gave you before.
3. Yes, two way sync has been on since October. Our physios block out their own time in Google.

I turned off two way sync at 8:15 this morning.

### Message 13 | 2026-11-13 09:02 | Meera Iyengar | support, product support

Thank you, that is exactly what I needed. 4.11.2 is the current release of our Android app, so you are up to date and updating is not the answer.

Please leave two way sync off over the weekend and write back on Monday either way.

### Message 14 | 2026-11-16 08:10 | Callum Reyes-Whitlock | customer

Monday report. With two way sync off we have had no double bookings at all since Friday morning. Three clear days.

But we cannot run like this. Two physios were booked by patients into time they had blocked in Google for training, because Fernwick no longer sees those blocks. I have turned two way sync back on as of 8:00 today.

### Message 15 | 2026-11-17 09:40 | Callum Reyes-Whitlock | customer

It took less than a day. Two patients for 11:00 with Sunita this morning, both confirmed, both in the waiting room. My receptionist was in tears. We have now turned away five patients this month who had no slot left to move to.

I need to say this plainly. If this is not fixed by 30 November we will move the clinic to another booking system. I would like a date.

### Message 16 | 2026-11-17 13:55 | Meera Iyengar | support, product support

I am sorry. I have stopped guessing and pulled the booking records for your account.

Between 3 November and 17 November I count 17 double bookings. The first was on 3 November, two days before the date you remembered. Every one of them has the same shape:

- one booking of the pair was created in the Android app on the reception tablet
- the other was created by a patient on your public booking page
- the two were created within 90 seconds of each other
- neither booking shows a conflict warning in its history

There are none at all between the morning of 13 November and the morning of 16 November, which is exactly when two way sync was off.

Five of the pairs, for reference:

| slot | made in the app | made on the booking page | gap |
|------|-----------------|--------------------------|-----|
| 3 Nov 14:30, Lin | BK-88231 | BK-88233 | 45 seconds |
| 6 Nov 10:00, Sunita | BK-88790 | BK-88788 | 62 seconds |
| 9 Nov 15:00, Lin | BK-89412 | BK-89415 | 38 seconds |
| 11 Nov 09:30, Marco | BK-89877 | BK-89880 | 71 seconds |
| 17 Nov 11:00, Sunita | BK-90655 | BK-90653 | 84 seconds |

### Message 17 | 2026-11-17 14:20 | Callum Reyes-Whitlock | customer

So it is your app and not my staff. Thank you for actually counting. What happens now?

### Message 18 | 2026-11-18 10:12 | Meera Iyengar | support, product support

With your permission from yesterday's call I pulled the app log from the reception tablet for the 17 November pair. These are the lines around the moment BK-90655 was saved:

```
2026-11-17 08:47:02 acct=AC-40781 app=4.11.2 sync start direction=two_way
2026-11-17 08:47:09 acct=AC-40781 booking save requested slot=2026-11-17T11:00 staff=Sunita
2026-11-17 08:47:09 acct=AC-40781 warn E-4093 slot check skipped: sync lock held
2026-11-17 08:47:10 acct=AC-40781 booking saved id=BK-90655
2026-11-17 08:47:31 acct=AC-40781 sync end
```

The app is meant to check the slot is still free at the moment of saving. The log says that check was skipped because a calendar sync was running. BK-90653 had been made on the booking page 84 seconds earlier and the app had not yet seen it.

### Message 19 | 2026-11-18 15:30 | Meera Iyengar | support, product support

I can now make this happen on our own test clinic, every time, like this:

1. Turn on two way sync with a Google Calendar that has at least a few hundred events, so that each sync takes 20 seconds or more.
2. On an Android tablet with app 4.11.2, open the new booking form for a free slot and leave it open.
3. On a second device, book that same slot through the public booking page.
4. Back on the tablet, wait for the sync spinner to appear, then press Save while it is spinning.

Both bookings are kept and neither shows a warning. The tablet log shows E-4093 each time. If I press Save when no sync is running the app refuses the booking as it should. I could not make it happen in the Apple app or on the web calendar, and I could not make it happen with two way sync off.

### Message 20 | 2026-11-19 08:05 | Callum Reyes-Whitlock | customer

Good. So when is it fixed?

Separate question while I have you. Can the reminder texts include the room number? Patients keep going to the wrong floor.

### Message 21 | 2026-11-19 08:44 | Jonah Pettersen | support, front line

On the reminder question: yes. Under Settings, Reminders you can edit the text and add the room field. I have sent you the help article separately.

Meera will answer on the fix.

### Message 22 | 2026-11-19 11:20 | Meera Iyengar | support, product support

I cannot give you a date myself, because the fix has to come from our engineers and I will not promise on their behalf. I am sending this to them today as urgent and I have told my manager about your 30 November deadline.

Until then here is a way to stay safe without turning two way sync off. On the reception tablet, make new bookings in the web calendar using the tablet's browser, not in the app. The web calendar always checks the slot when you save, sync or no sync. Patients can keep using the booking page as normal. E-4093 only comes from the app.

### Message 23 | 2026-11-20 16:50 | Callum Reyes-Whitlock | customer

We have used the browser on the tablet for all new bookings since yesterday lunchtime. No double bookings since. It is slower for the front desk and they do not like it, but it works.

I am holding you to the end of the month.

### Message 24 | 2026-11-20 17:15 | Meera Iyengar | support, product support

Thank you for confirming. I will update you the moment engineering gives me a date.

### Message 25 | 2026-11-20 17:22 | Meera Iyengar | support, internal note

Escalating to engineering. Needs a short written summary for the on-call engineer before it can go in their queue. Customer is premier and has given a hard deadline.
output/escalation.md · written by the agent, 54 lines
Ticket: T-2987
Account: AC-40781
First reported: 2026-11-09 08:14
Device: Samsung Galaxy Tab A9
App version: 4.11.2
Error code: E-4093
Bookings affected: 17 counted from records (3 Nov to 17 Nov)

## What happens
The Android app skips its slot-free check when saving a booking during a calendar sync. If a patient just booked that slot on the public booking page, both bookings are kept with no warning. Each counted pair was created within 90 seconds, one in the app and one on the booking page.

## Customer impact
Harbour Physio Clinic (premier): double-booked patients turn up and one is sent home each time. Five had no slot to move to. Deadline: if not fixed by 30 November, the clinic will leave for another booking system.

## Steps to reproduce
Reproduced every time (Message 19):
1. Turn on two way sync with a Google Calendar of a few hundred events, so each sync takes 20 seconds or more.
2. On an Android tablet with app 4.11.2, open the new booking form for a free slot and leave it open.
3. On a second device, book that slot through the public booking page.
4. On the tablet, press Save while the sync spinner shows.

Both bookings are kept, E-4093 logged. Not reproduced in the Apple app, the web calendar, or with sync off.

## Already tried
- Cleared cache and restarted the tablet: happened again.
- Reconnected Google Calendar: banner E-2201 cleared, double bookings continued.
- Reinstalled the app: two more double bookings.
- Updating: not possible, 4.11.2 is the current Android release.
- Two way sync off 13 Nov to 16 Nov: no double bookings, but blocked physio time got booked. Turned back on, fault recurred 17 Nov.
- Web calendar in the tablet browser: no double bookings reported since.

## Workaround
Make new bookings in the web calendar in the tablet's browser, not the app. It checks the slot on save. The booking page is unaffected.

## Evidence
- Message 1: "two patients were booked into the same slot with the same physio"
- Message 16: "the two were created within 90 seconds of each other"
- Message 18: "warn E-4093 slot check skipped: sync lock held"
- Message 19: "Both bookings are kept and neither shows a warning."
- Message 22: "The web calendar always checks the slot when you save, sync or no sync."

## Corrections
- Account: AC-40718, now AC-40781 (Message 5).
- Device: iPad, now Samsung Galaxy Tab A9 (Message 12).
- App version: 4.12, now 4.11.2 (Message 12).
- Start date: about 5 November, now 3 November (Message 16).
- Count: about 20, now 17 (Message 16).
- Error code: E-2201 was a separate, fixed problem (Message 6).

## Open questions
- Android OS version is not stated.
- Since which release the sync lock skips the check is not stated.
- Whether bookings before 3 Nov were checked is not stated.
- No engineering fix date is in the thread.
check.py · the check, written before the run
"""Checks the escalation page against the ticket thread it was written from.

For each kind of fact (account id, device, app version, error code, count of double bookings) the
current value is taken to be the last one stated in the thread. Values stated earlier and later
replaced are the old values. Quotes and ids are looked up in the thread itself.
"""
import re, sys
from pathlib import Path
root = Path(sys.argv[1]); ok = True
def say(passed, text):
    global ok; ok = ok and passed; print(("PASS " if passed else "FAIL ") + text)
def squash(s):
    for a, b in (("’", "'"), ("‘", "'"), ("“", '"'), ("”", '"')):
        s = s.replace(a, b)
    return re.sub(r"\s+", " ", s).strip()

thread = (root/"input/thread.md").read_text()
parts = re.split(r"^### Message (\d+) \| ([^|\n]+)\|[^\n]*\n", thread, flags=re.M)
messages = {int(parts[i]): squash(parts[i + 2]) for i in range(1, len(parts), 3)}
first_time = parts[2].strip()
KINDS = {
    "Account": r"AC-\d{5}",
    "Device": r"iPad|iPhone|Galaxy Tab \w+|Pixel \w+",
    "App version": r"(?<![\d.])\d+\.\d+(?:\.\d+)?(?![\d.]*\d)",
    "Error code": r"E-\d{4}",
}
current, old = {}, {}
for label, pattern in KINDS.items():
    seen = re.findall(pattern, thread)
    current[label] = seen[-1]
    old[label] = sorted(set(seen) - {seen[-1]})
current["Ticket"] = re.search(r"T-\d+", thread).group(0)
current["First reported"] = first_time
current["Bookings affected"] = re.findall(r"(\d+) double bookings", thread)[-1]
TRIED = {  # a word in the thread that shows a fix was tried -> words that show it on the page
    "cache": r"cache", "restart": r"restart|reboot", "reconnect": r"re-?connect|disconnect",
    "reinstall": r"re-?install|uninstall", "two way sync": r"two[- ]way sync",
    "signed out": r"sign(ed)? out|log(ged)? out", "factory reset": r"factory reset",
}

path = root/"output/escalation.md"
if not path.exists():
    say(False, "output/escalation.md was not written"); sys.exit(1)
page = path.read_text()
def fact(label):
    m = re.search(r"^[\s\-*]*\**" + label + r"\**\s*:\**\s*(.+)$", page, re.M | re.I)
    return m.group(1).strip() if m else None
def section(name):
    m = re.search(r"^#+\s*" + name + r"\s*\n(.*?)(?=^#+\s|\Z)", page, re.S | re.M | re.I)
    return m.group(1) if m else None
LABELS = ["Ticket", "Account", "First reported", "Device", "App version", "Error code", "Bookings affected"]
SECTIONS = ["What happens", "Customer impact", "Steps to reproduce", "Already tried", "Workaround", "Evidence", "Corrections", "Open questions"]
present = sum(1 for l in LABELS if fact(l)) + sum(1 for s in SECTIONS if (section(s) or "").strip())
say(present == 15, f"{present} of 15 required parts are present in escalation.md")

good = 0
for label in LABELS:
    line = fact(label) or ""
    if label in KINDS:
        found = re.findall(KINDS[label], line)
        good += bool(found) and all(f == current[label] for f in found)
    elif label == "Bookings affected":
        nums = re.findall(r"\d+", line)
        good += bool(nums) and nums[0] == current[label]
    else:
        good += current[label] in line
say(good == len(LABELS), f"{good} of {len(LABELS)} facts lines give the last value stated in the thread")

corr = section("Corrections") or ""
changed = [(k, v) for k, vs in old.items() if k != "Error code" for v in vs]
shown = sum(1 for k, v in changed if re.search(r"(?<![\d.])" + re.escape(v) + r"(?![\d]|\.\d)", corr))
say(shown == len(changed) and changed != [], f"{shown} of {len(changed)} facts the thread corrected show their old value under Corrections")

tried_part = (section("Already tried") or "").lower()
need = [w for w in TRIED if w in thread.lower()]
listed = sum(1 for w in need if re.search(TRIED[w], tried_part))
say(listed == len(need), f"{listed} of {len(need)} fixes the thread says were tried are listed under Already tried")

quotes = []
for line in (section("Evidence") or "").splitlines():
    m = re.search(r"message\s+(\d+)", line, re.I)
    s = squash(line)
    if m and s.count('"') >= 2:
        quotes.append((int(m.group(1)), s[s.index('"') + 1:s.rindex('"')].strip()))
real = sum(1 for n, q in quotes if len(q.split()) >= 6 and q in messages.get(n, ""))
say(len(quotes) >= 3 and real == len(quotes), f"{real} of {len(quotes)} quotes under Evidence appear word for word in the message they name")

ids = sorted(set(re.findall(r"\b(?:AC|BK|T|E)-\d+\b", page)))
known = sum(1 for i in ids if i in thread)
say(known == len(ids) and len(ids) >= 3, f"{known} of {len(ids)} ticket, account, booking and error ids on the page appear in the thread")

words, source = len(page.split()), len(thread.split())
say(words <= 500, f"The page is {words} words, against a limit of 500, from a thread of {source:,} words")

MONTHS = ["jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec"]
def dates_in(text):
    found = {(int(d), int(m)) for m, d in re.findall(r"\d{4}-(\d{2})-(\d{2})", text)}
    found |= {(int(d), MONTHS.index(m.lower()) + 1) for d, m in re.findall(r"\b(\d{1,2}) (" + "|".join(MONTHS) + r")[a-z]*", text, re.I)}
    return found
def spans_in(text):
    return {(n, unit.lower()) for n, unit in re.findall(r"\b(\d+) (second|minute|hour|day|week)s?\b", text, re.I)}
VERSION = r"(?<![\w.-])\d+\.\d+(?:\.\d+)?(?![\w.-]|:\d)"
def plain_in(text):
    text = re.sub(r"\d{4}-\d{2}-\d{2}|\b[A-Z]+-\d+\b|\d{1,2}:\d{2}(?::\d{2})?|^\d+\. ", " ", text, flags=re.M)
    text = re.sub(VERSION, " ", text)
    return set(re.findall(r"(?<![\w.])\d+(?![\w.]*\d)", text))
on_page = [("date", d) for d in sorted(dates_in(page))] + [("span", x) for x in sorted(spans_in(page))]
on_page += [("version", v) for v in sorted(set(re.findall(VERSION, page)))] + [("number", n) for n in sorted(plain_in(page))]
source = {"date": dates_in(thread), "span": spans_in(thread), "version": set(re.findall(VERSION, thread)), "number": plain_in(thread)}
stated = sum(1 for kind, value in on_page if value in source[kind])
say(stated == len(on_page) > 0, f"{stated} of {len(on_page)} dates, lengths of time, version numbers and other figures on the page are stated in the thread")

counts = re.findall(r"(\d+) double bookings", thread)
facts = [(current[k], old[k], "") for k in ("Account", "Device", "App version") if old[k]]
facts += [(counts[-1], sorted(set(counts) - {counts[-1]}), " double bookings")] if len(set(counts)) > 1 else []
cited = 0
for now, before, tail in facts:
    first = min(n for n, text in messages.items() if re.search(r"(?<![\w.])" + re.escape(now + tail) + r"(?![\w]|\.\d)", text))
    for line in corr.splitlines():
        has = lambda v: re.search(r"(?<![\w.])" + re.escape(v) + r"(?![\w]|\.\d| (?:" + "|".join(MONTHS) + "))", line, re.I)
        if has(now) and any(has(v) for v in before):
            cited += [int(n) for n in re.findall(r"message\s+(\d+)", line, re.I)] == [first]; break
say(cited == len(facts) > 0, f"{cited} of {len(facts)} corrected facts cite the first message that states the current value")
sys.exit(0 if ok else 1)

thread.md: sample data written by Atris. Fingerprint d8a3d133ff2e.

escalation.md: written by the agent. Fingerprint 1dd2a8ef326d.


More customer support work, and every other desk job

For agentsGitHub
What is AtrisBlogApp StorePricingPrivacyTerms