Cotton code
129 lines · 6.4 KB · PythonRaw
#!/usr/bin/env python3"""A long synthetic meeting (about 60 minutes, three speakers) with its truth.    python3 -I scripts/meetings/synthetic/long.py > long.txtWritten for the meeting summaries work: nobody's real words. Twelve agenda items,each a run of status, back-and-forth and a decision; seven carry an actionsomeone takes on (some with a day said), two carry a decoy (a thing alreadydone, an idea nobody takes), so a summariser that invents owners or dates, orloses the early items when it reads in parts, shows it. A fixed seed: the samefile every run."""import randomR = random.Random(17)SPEAKERS = {"S1": "Meera", "S2": "Tom", "S3": ""}# (topic, noun, action: (speaker, said, words, due) | None, decoy | None)ITEMS = [    ("the warehouse move", "the move", ("S2", "I'll get three quotes from movers by Friday.", "get three quotes from movers", "2026-11-20"), None),    ("the support backlog", "the backlog", ("S3", "I'll triage the oldest fifty tickets this week.", "triage the oldest fifty tickets", None), None),    ("hiring for the data role", "the role", ("S1", "I'll write the job post and send it to Tom by Wednesday.", "write the job post and send it to Tom", "2026-11-18"), None),    ("the quarterly report", "the report", None, ("S2", "The numbers for the report are already done, I sent them to finance on Monday.")),    ("the mobile app release", "the release", ("S3", "I'll run the release checklist with the testers on the 24th.", "run the release checklist with the testers", "2026-11-24"), None),    ("the security audit", "the audit", ("S2", "I'll book the auditors for the first week of December.", "book the auditors", None), None),    ("customer interviews", "the interviews", None, ("S3", "It would be nice to do a podcast about all this one day, but that's just an idea.")),    ("the pricing page", "the pricing page", ("S1", "I'll rewrite the pricing page copy before Monday.", "rewrite the pricing page copy", "2026-11-23"), None),    ("the office lease", "the lease", None, None),    ("the partner newsletter", "the newsletter", ("S3", "I'll draft the partner newsletter and share it on Thursday.", "draft the partner newsletter", "2026-11-19"), None),    ("the laptop refresh", "the refresh", None, None),    ("the year-end party", "the party", None, None),]OPEN = [    "Okay, next is {t}.",    "Let's move on to {t}.",    "Right, {t}. Where are we?",    "Can we talk about {t} for a minute?",]STATUS = [    "So on {n}, we've made some progress but it's slower than I hoped.",    "The short version is that {n} is mostly on track.",    "I spoke to a couple of people about {n} last week and the picture is mixed.",    "Honestly {n} took more time than we planned, mostly because of the holidays.",    "There's not a lot new on {n}, but there are two things worth mentioning.",]TALK = [    "I think the main risk is timing, everything else we can handle.",    "Do we know what it will cost? Last time the estimate was way off.",    "We should keep it simple this time, the last attempt got too complicated.",    "I'd rather do it properly once than rush it and redo it in March.",    "The team is fine with it, they just want to know the dates early.",    "We could split it in two, do the easy part now and the rest in January.",    "That makes sense to me. I don't see a reason to wait.",    "Let me push back a little. Are we sure this is the priority right now?",    "Fair point, but if we don't do it now it'll just sit there.",    "I had the same worry, but the numbers actually look okay.",    "Who else needs to be in the loop on this? Finance, probably.",    "I'll be honest, I haven't looked at it closely since the last meeting.",    "The feedback so far has been positive, a few small complaints.",    "We talked about this in October and nothing really changed since.",    "It depends a lot on what the other team decides.",    "Can we write down what we agreed so we don't go round in circles again?",    "I think we're overthinking it a bit.",    "If it helps, I can share the notes from the call afterwards.",    "Yes, that's roughly what I heard too.",    "Okay, but let's not commit to a date we can't keep.",    "The tricky part is the handover, that's where it went wrong before.",    "I'm fine either way, I just want us to decide today.",]DECIDE = [    "Okay, so we go ahead with {n} as discussed.",    "Decision then: we keep {n} as it is for now and look again next month.",    "Agreed. We do the smaller version of {n} first.",    "Fine, {n} goes ahead, with the budget we already have.",]NOBODY = [    "Nothing to take from that one, it's just an update.",    "No action on this one, we'll see how it goes.",]def lines():    out = []    order = ["S1", "S2", "S3"]    for i, (topic, noun, action, decoy) in enumerate(ITEMS):        out.append(("S1", R.choice(OPEN).format(t=topic)))        owner = order[(i % 2) + 1]        out.append((owner, R.choice(STATUS).format(n=noun)))        talk = R.sample(TALK, 22)        for k, said in enumerate(talk[:R.randint(18, 22)]):            who = order[(k + i) % 3]            if out[-1][0] == who:                who = order[(k + i + 1) % 3]            out.append((who, said))        if decoy:            out.append(decoy)        out.append(("S1", R.choice(DECIDE).format(n=noun)))        if action:            out.append((action[0], action[1]))            out.append(("S1", "Great, thanks."))        else:            out.append(("S2", R.choice(NOBODY)))    out.append(("S1", "That's everything on the list. Thanks all, same time next week."))    return outdef main():    print("# Synthetic meeting, generated by long.py for the meeting summaries work: nobody's real words.")    print("# title: Operations monthly")    print("# started_at: 2026-11-17T15:00:00+05:30")    for label, name in SPEAKERS.items():        print(f"# speaker {label}: {name}".rstrip())    for _, _, action, decoy in ITEMS:        if action:            print(f"# truth: {action[0]} | {action[2]} | {action[3] or ''}".rstrip())    for _, _, _, decoy in ITEMS:        if decoy:            print(f"# not: {decoy[1]}")    # Pad to an hour: the meeting reads each item twice over, as a long meeting    # revisits (the second pass is the "any updates since" round).    body = lines()    rest = [(s, t) for s, t in lines() if not any(t == a[1] for _, _, a, _ in ITEMS if a)]    for speaker, text in body + rest:        print(f"{speaker}: {text}")if __name__ == "__main__":    main()