Customer emails reach training data
Kept rows go to the datasets with every address as written.
Impact: Legal will not sign off on the December 8 retrain.
FDE interview labData & Systems
Add email masking to a working export pipeline.
Your mission · Extend a codebase
Marlow Desk's EU customers signed a data addendum that bans customer email addresses in model training data from December 1. The weekly export still copies them into the training set, so the December 8 retrain cannot start. The model team also needs the split unchanged, or this month's quality scores cannot be compared with last month's.
Kept rows go to the datasets with every address as written.
Impact: Legal will not sign off on the December 8 retrain.
The report always says masked_emails 0.
Impact: The data audit cannot prove addresses were removed.
Edit the components marked “Your work”. The other components show where your changes fit.
| Field | Type | Notes |
|---|---|---|
id | string | Unique. US rows start with c-, EU rows with e-. |
text | string | The customer's message as written. Masked in the output when mask_emails is true. |
timestamp | string | "11/14/2026 08:12" (US, UTC) or "2026-11-14T11:05:00+01:00" (EU). |
store_id, region | string | Extra fields. Kept unchanged on the kept row. |
| Field | Type | Notes |
|---|---|---|
eval_percent | integer 0 to 100 | Default 20. |
mask_emails | boolean | New. Default false. |
| Field | Type | Notes |
|---|---|---|
input | integer | Every row given. |
unique | integer | Rows kept, in train or eval. |
duplicates | integer | Valid rows discarded as duplicates. |
invalid_timestamps | string[] | Ids with a timestamp that does not parse, sorted. |
masked_emails | integer | Addresses replaced in kept rows. Always 0 today. |
samples/export-2026-11-14.json Nine rows from both regions: one message exported three ways with the same address, a full-width letter, an impossible date (November 31), and rows with one, two or no addresses.[
{"id": "c-10482", "text": "Where is my order #55120? It said 3 days. Email me at dana.k@shopmail.com", "timestamp": "11/14/2026 08:12", "store_id": "st-311", "region": "us"},
{"id": "c-10517", "text": "where is my order #55120? it said 3 days. email me at dana.k@shopmail.com", "timestamp": "2026-11-14T09:40:00-05:00", "store_id": "st-311", "region": "us"},
{"id": "e-20031", "text": "WHERE IS MY ORDER #55120? IT SAID 3 DAYS. EMAIL ME AT DANA.K@SHOPMAIL.COM", "timestamp": "2026-11-14T14:40:00Z", "store_id": "st-311", "region": "eu"},
{"id": "c-10533", "text": "Can I change the size on my exchange?", "timestamp": "11/14/2026 10:05", "store_id": "st-042", "region": "us"},
{"id": "e-20044", "text": "Can I change the size on my exchange?", "timestamp": "2026-11-14T11:05:00+01:00", "store_id": "st-042", "region": "eu"},
{"id": "c-10540", "text": "The discount code SAVE15 does not work. Reach me at lee@north-trail.com", "timestamp": "11/31/2026 12:30", "store_id": "st-118", "region": "us"},
{"id": "e-20052", "text": "Do you ship to Norway? Write to ola+orders@post.no", "timestamp": "2026-11-14T16:20:00+01:00", "store_id": "st-207", "region": "eu"},
{"id": "e-20058", "text": "Do you ship to Sweden?", "timestamp": "2026-11-14T16:45:00+01:00", "store_id": "st-207", "region": "eu"},
{"id": "c-10561", "text": "I was charged twice for one order. Contact sam@example.com or sam.b@example.com", "timestamp": "2026-11-14T17:02:00Z", "store_id": "st-118", "region": "us"}
]samples/export-2026-11-14-expected.json What the contract says those rows produce with eval_percent 20 and mask_emails true. The same rows land in train and eval as without masking.{
"train": [
{"id": "c-10517", "text": "where is my order #55120? it said 3 days. email me at [EMAIL]", "timestamp": "2026-11-14T09:40:00-05:00", "store_id": "st-311", "region": "us"},
{"id": "c-10533", "text": "Can I change the size on my exchange?", "timestamp": "11/14/2026 10:05", "store_id": "st-042", "region": "us"},
{"id": "c-10561", "text": "I was charged twice for one order. Contact [EMAIL] or [EMAIL]", "timestamp": "2026-11-14T17:02:00Z", "store_id": "st-118", "region": "us"},
{"id": "e-20052", "text": "Do you ship to Norway? Write to [EMAIL]", "timestamp": "2026-11-14T16:20:00+01:00", "store_id": "st-207", "region": "eu"}
],
"eval": [
{"id": "e-20058", "text": "Do you ship to Sweden?", "timestamp": "2026-11-14T16:45:00+01:00", "store_id": "st-207", "region": "eu"}
],
"report": {"input": 9, "unique": 5, "duplicates": 3, "invalid_timestamps": ["c-10540"], "masked_emails": 4}
}config/weekly-export.yaml The two sources, the split percentage, the new mask_emails option, and the job's memory and time limits.# Suggested Replies weekly export (runs Sundays 02:00 UTC).
sources:
- name: us-helpdesk
timestamp_format: "MM/DD/YYYY HH:MM (UTC, no zone)"
- name: eu-helpdesk
timestamp_format: "ISO 8601 with Z or offset"
options:
eval_percent: 20
mask_emails: true # required from 2026-12-01 (data addendum)
limits:
worker_memory_gb: 8
slot_minutes: 30metrics/email-exposure-2026-11.csv Three weekly exports: kept rows that contain an address, how many addresses they hold, and the masked_emails the report gave (always 0).export_week,input_rows,kept_rows,kept_rows_with_email,email_addresses_in_kept_rows,masked_emails_reported 2026-10-25,1386204,1229911,36120,39874,0 2026-11-01,1402877,1244420,36988,40812,0 2026-11-08,1419530,1259386,37540,41377,0
TASK-201 Mask email addresses in the kept rows Reported by Ines (ML data)
Expected c-10517 reads "...email me at [EMAIL]", c-10561 reads "Contact [EMAIL] or [EMAIL]", e-20052 reads "Write to [EMAIL]", and the report says masked_emails 4.
Actual mask_emails is ignored: every address is still in the output and the report says masked_emails 0.
TASK-202 Keep duplicate groups and the split as they are Reported by Tomas (model quality)
Expected The same ids in the same sets both times: train c-10517, c-10533, c-10561, e-20052 and eval e-20058. Masking before bucketing would send c-10561 to eval (its masked key falls in bucket 2), which this must not do.
Actual Both runs give the same ids today only because nothing is masked.
TASK-203 Validate the option and count only kept rows Reported by Ines (ML data)
Expected mask_emails 1 raises ValueError mentioning mask_emails. The addresses in c-10540, c-10482 and e-20031 are not counted, so masked_emails is 4, not 7.
Actual mask_emails 1 is accepted without an error, and masked_emails is always 0.
Scores use evidence from your session. A short or incomplete session may not provide enough evidence for every skill. See a sample scorecard
This export pipeline already deduplicates and splits support conversations, and its checks pass. Your job is to add email masking without moving a single row between train and eval. Use the AI assistant, but first show me how the pipeline is split into modules and run the checks: they should all pass. I will ask how you know the existing behavior still holds.