File size: 8,776 Bytes
83ed4bf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
"""Generate first-person capture items with programmatically known deadline labels.

Each item is a short capture as a personal assistant would receive it (voice memo,
wearable conversation, forwarded email), stamped with the moment it was recorded.
The gold label says whether there is a firm deadline, what it is, and whether an
alarm should be set. Seven trap families, 20 items each.
"""
import calendar, datetime as dt, json, random

SEED = 20261102
rng = random.Random(SEED)
N = 20

TASKS = [
    ("the grant application", "the grant portal"), ("the fellowship essay", "the fellowship"),
    ("the conference abstract", "the program committee"), ("the visa renewal form", "the consulate"),
    ("the quarterly tax estimate", "the IRS"), ("the lease renewal", "the landlord"),
    ("the scholarship form", "the scholarship office"), ("the insurance claim", "the insurer"),
    ("the DMV appointment paperwork", "the DMV"), ("the hackathon submission", "the organisers"),
    ("the internship application", "the hiring team"), ("the reimbursement form", "finance"),
    ("the jury duty response", "the court"), ("the residency application", "the program"),
    ("the startup accelerator application", "the accelerator"), ("the research proposal", "the department"),
]
EVENTS = ["the summit", "the demo day", "the workshop", "the info session", "the gala", "the retreat"]
TZS = [("PT", "America/Los_Angeles"), ("ET", "America/New_York"), ("CET", "Europe/Berlin"),
       ("AoE", "Etc/GMT+12"), ("SGT", "Asia/Singapore"), ("UTC", "UTC")]
FILLERS = ["um, ", "so, ", "okay so ", "uh, ", "right, ", ""]
MONTHS = list(calendar.month_name)


def ref_moment():
    d = dt.date(2026, 1, 5) + dt.timedelta(days=rng.randrange(0, 540))
    return dt.datetime(d.year, d.month, d.day, rng.randrange(7, 22), rng.randrange(60))


def fmt_ref(t):
    return t.strftime("%a %Y-%m-%d %H:%M") + " Pacific"


def say_date(d, style=None):
    style = style or rng.choice(["long", "short", "ordinal"])
    if style == "long":
        return f"{MONTHS[d.month]} {d.day}, {d.year}"
    if style == "short":
        return f"{MONTHS[d.month][:3]} {d.day}"
    suf = "th" if 11 <= d.day <= 13 else {1: "st", 2: "nd", 3: "rd"}.get(d.day % 10, "th")
    return f"the {d.day}{suf} of {MONTHS[d.month]}"


def wrap(kind, body, speaker_line=None):
    """Render a body in one of three capture styles."""
    f = rng.choice(FILLERS)
    if kind == "voice_memo":
        return f"[voice memo] {f}{body} ...yeah. okay that's it."
    if kind == "wearable":
        other = speaker_line or "Sounds good, let me know if you need anything."
        return f"[wearable, 2 speakers]\nSPEAKER_1: {f}{body}\nSPEAKER_2: {other}"
    return f"[forwarded email]\nSubject: Reminder\n\n{body[0].upper() + body[1:]}\n\nBest,\nThe team"


def item(family, ref, kind, text, has, date=None, time=None, tz=None, alarm=None, note=""):
    if alarm is None:
        alarm = bool(has and date and dt.date.fromisoformat(date) >= ref.date())
    return {"family": family, "capture_kind": kind, "recorded_at": fmt_ref(ref), "text": text,
            "gold": {"has_deadline": has, "deadline_date": date, "deadline_time": time,
                     "timezone": tz, "should_set_alarm": alarm}, "note": note}


def explicit():
    ref = ref_moment(); task, who = rng.choice(TASKS)
    d = ref.date() + dt.timedelta(days=rng.randrange(5, 90))
    kind = rng.choice(["voice_memo", "wearable", "email"])
    body = rng.choice([
        f"{task} is due {say_date(d, 'long')}, I need to get that done",
        f"{who} said {task} has to be in by {say_date(d, 'long')}",
        f"don't forget {task}, the deadline is {say_date(d, 'ordinal')} {d.year}",
    ])
    return item("explicit_date", ref, kind, wrap(kind, body), True, d.isoformat())


def relative():
    ref = ref_moment()
    while ref.weekday() > 2:  # Mon-Wed, so "this Friday" is unambiguous
        ref -= dt.timedelta(days=1)
    task, _ = rng.choice(TASKS)
    choice = rng.randrange(5)
    if choice == 0:
        d, phrase = ref.date() + dt.timedelta(days=4 - ref.weekday()), "this Friday"
    elif choice == 1:
        n = rng.choice([3, 5, 10, 12]); d, phrase = ref.date() + dt.timedelta(days=n), f"in {n} days"
    elif choice == 2:
        last = calendar.monthrange(ref.year, ref.month)[1]
        d, phrase = dt.date(ref.year, ref.month, last), "by the end of this month"
    elif choice == 3:
        d, phrase = ref.date() + dt.timedelta(days=14), "two weeks from today"
    else:
        d, phrase = ref.date() + dt.timedelta(days=1), "tomorrow"
    kind = rng.choice(["voice_memo", "wearable"])
    body = rng.choice([f"{task} has to be submitted {phrase}", f"I have to finish {task} {phrase}, that's the hard deadline"])
    return item("relative_date", ref, kind, wrap(kind, body), True, d.isoformat(), note=phrase)


def placeholder():
    ref = ref_moment(); task, who = rng.choice(TASKS)
    d = ref.date() + dt.timedelta(days=rng.randrange(10, 120))
    kind = rng.choice(["voice_memo", "wearable", "email"])
    body = rng.choice([
        f"{who} put {say_date(d, 'long')} on the calendar for {task} but they said it's just a placeholder, the real date isn't set",
        f"the deadline for {task} is TBD. the page shows {say_date(d, 'long')} but it says 'placeholder, to be confirmed'",
        f"I wrote {say_date(d, 'short')} for {task} as a guess, I actually have no idea when it's due",
        f"{task}: dates to be announced. ignore the {say_date(d, 'short')} in the old flyer, that was last cycle's",
    ])
    return item("placeholder_date", ref, kind, wrap(kind, body), False, note="a date appears but is explicitly not real")


def distractor():
    ref = ref_moment(); task, _ = rng.choice(TASKS); ev = rng.choice(EVENTS)
    close = ref.date() + dt.timedelta(days=rng.randrange(5, 40))
    event = close + dt.timedelta(days=rng.randrange(7, 30))
    kind = rng.choice(["voice_memo", "wearable", "email"])
    body = rng.choice([
        f"{ev} is on {say_date(event, 'long')}, but registration closes {say_date(close, 'long')} so that's the one that matters",
        f"so {ev} happens {say_date(event, 'ordinal')}, and they need {task} before {say_date(close, 'ordinal')}",
        f"Registration for {ev} ({say_date(event, 'long')}) closes on {say_date(close, 'long')}.",
    ])
    return item("event_vs_deadline", ref, kind, wrap(kind, body), True, close.isoformat(),
                note=f"event date {event.isoformat()} is a distractor")


def clock_tz():
    ref = ref_moment(); task, _ = rng.choice(TASKS)
    d = ref.date() + dt.timedelta(days=rng.randrange(2, 45))
    hh, mm, spoken = rng.choice([(23, 59, "11:59 PM"), (17, 0, "5 PM"), (12, 0, "noon"), (9, 0, "9 AM"), (18, 30, "6:30 PM")])
    abbr, zone = rng.choice(TZS)
    kind = rng.choice(["voice_memo", "email"])
    body = (f"{task} closes {say_date(d, 'long')} at {spoken} {abbr}, not midnight wherever I am"
            if kind == "voice_memo" else f"Submissions for {task} are due {say_date(d, 'long')}, {spoken} {abbr}.")
    return item("clock_and_timezone", ref, kind, wrap(kind, body), True, d.isoformat(),
                f"{hh:02d}:{mm:02d}", zone, note=f"{spoken} {abbr}")


def no_deadline():
    ref = ref_moment(); task, _ = rng.choice(TASKS)
    kind = rng.choice(["voice_memo", "wearable"])
    body = rng.choice([
        f"I should really look at {task} at some point, no rush though",
        "remind me to call my mom sometime this year, it's been a while",
        f"would be nice to clean up {task} eventually, whenever",
        f"I keep thinking about {task}. maybe. not urgent.",
        "I want to start running again, mornings maybe",
    ])
    return item("no_deadline", ref, kind, wrap(kind, body), False)


def conditional():
    ref = ref_moment(); task, _ = rng.choice(TASKS)
    kind = rng.choice(["voice_memo", "wearable", "email"])
    body = rng.choice([
        f"once my work permit card arrives I have 30 days to file {task}",
        f"{task} is rolling admissions, you can apply anytime",
        f"the lawyer said {task} is due 60 days after we get the approval notice, which hasn't come yet",
        f"{task} needs to go in within two weeks of the interview, but they haven't scheduled the interview",
    ])
    return item("conditional_undated", ref, kind, wrap(kind, body), False,
                note="deadline depends on an event that has not happened")


FAMILIES = [explicit, relative, placeholder, distractor, clock_tz, no_deadline, conditional]
items = []
for fam in FAMILIES:
    for _ in range(N):
        items.append(fam())
for i, it in enumerate(items):
    it["id"] = f"egd-{i:04d}"
with open("items.jsonl", "w") as f:
    for it in items:
        f.write(json.dumps(it) + "\n")
print(len(items), "items")