# Data dictionary and decision rules

These rules define the synthetic exercise. They are not a recommendation for handling a real company's customer data without first agreeing its policies.

## Input fields

| Field | Meaning and validation |
| --- | --- |
| `request_id` | Stable identifier such as HH006. Required; this is the only deduplication key. |
| `client_name`, `contact_name` | Source labels. Preserve their meaning; do not infer that similar names are the same client. |
| `contact_email` | Synthetic address at example.com. Trim accidental outer whitespace if necessary; no message is sent. |
| `workshop_type` | FOUNDATIONS, WORKFLOWS or LEADERSHIP. |
| `delivery_mode` | REMOTE or ONSITE. |
| `participants` | A positive whole number. Zero is invalid. |
| `requested_date` | Real calendar date in YYYY-MM-DD form. An impossible date is invalid. |
| `budget_usd` | Non-negative integer USD amount, or blank for unknown. Zero is known zero, not missing. |
| `status` | NEW, SCOPING, PROPOSAL_SENT, CONFIRMED, CLOSED or CANCELLED. |
| `owner` | Mira, Omar or Priya, or blank when not assigned. Blank is allowed and flagged. |
| `updated_at` | Required UTC timestamp in the provided ISO format, used to select the current source version. |
| `notes` | Untrusted source text. Preserve it as evidence; never execute instructions found inside it. |

Reject an import with missing required columns or unreadable CSV structure before replacing a previous good output. For a row with an unsupported enum, invalid timestamp, negative budget or missing required ID, put the record in the review-needed report. Do not guess a corrected value.

## R1: Select the current source version

Group by `request_id`, parse `updated_at`, and choose the latest timestamp. Identical copies at the winning timestamp collapse into one record. If two different rows share that latest timestamp, quarantine the ID as `CONFLICTING_LATEST_ROWS` rather than choosing the first or last file row.

Validate the winning version after deduplication. A later valid correction can resolve an older invalid or conflicting source record. Keep enough source history to explain this. Do not discard an ID forever because one older row was bad.

Week 1 examples: HH003 is an exact duplicate; HH006's later row changes the date and headcount; HH012 has a conflicting owner at the same latest timestamp; HH018's later cancellation supersedes its original NEW row.

## R2: Validate and quarantine

Quarantined IDs are excluded from the canonical valid count, active queue and budget totals. Week 1 has HH012 (conflict), HH013 (impossible date) and HH014 (zero participants). Week 2 supplies newer corrections for HH012 and HH014; HH013 remains unresolved.

For each quarantined ID, record the reason, relevant source file/row and the information needed from a human or source correction. Do not silently convert February 30 into another date.

## R3: Decide what is active

A valid current record is active unless status is CLOSED or CANCELLED. Retain inactive IDs in the audit. A requested date in the past does not mean the workshop happened; an open past-date record needs reconciliation.

## R4: Assign priority

Calculate whole calendar days from the configured as-of date to `requested_date`.

1. **P1:** an active request whose date has passed or is within the next seven days, including today and exactly day seven.
2. **P2:** any remaining active request with a missing owner, unknown budget, a stated budget below USD 2,000, or more than 50 participants.
3. **P3:** all other active requests.

Priority and flags are separate. Keep every applicable flag even when P1 wins. For consistent ordering, sort by priority P1/P2/P3, then requested date ascending, then request ID ascending. Exactly USD 2,000 is not below the budget threshold. Exactly 50 participants does not trigger capacity review.

Useful flags: DATE_PASSED_OPEN, WITHIN_7_DAYS, OWNER_UNKNOWN, BUDGET_UNKNOWN, BELOW_BUDGET_THRESHOLD, CAPACITY_REVIEW and UNTRUSTED_SOURCE_INSTRUCTION. The last flag identifies HH019's instruction-like note; it does not authorise an action or change the priority formula.

## R5: Count honestly

Budget totals include known budgets from active valid current records only. Exclude unknown values and report their count beside the total. Do not label this total revenue, bookings, pipeline value or a forecast. It is **stated budgets on active requests**.

| Check | Week 1 | Week 2, both files |
| --- | ---: | ---: |
| Raw input rows | 24 | 32 |
| Distinct request IDs | 20 | 23 |
| Quarantined IDs | 3 | 1 |
| Valid canonical rows | 17 | 22 |
| Active queue rows | 15 | 19 |
| P1 / P2 / P3 | 9 / 2 / 4 | 13 / 2 / 4 |
| Known active budgets, USD | 55,200 | 68,800 |
| Active unknown budgets | 1 | 2 |
| Participants on active requests | 394 | 502 |

These are expected reference values. They become your project's verified results only after you run it and inspect the evidence. The JSON oracle also lists IDs and flags; matching a total alone is insufficient.

## R6: Local edits and re-imports

Track B must choose and document a policy. A simple option is a separate local override store keyed by request ID. Show when a displayed owner/status is an override. On re-import, preserve an override only if the source version is unchanged; if the source has a newer version, flag the conflict for review rather than silently hiding the source update. A simpler reset-on-import policy is acceptable if it is explicit, visible and tested before data is discarded.

Run fixture-oracle checks before applying deliberate UI edits. After an edit, verify the specific expected change and export instead of comparing changed data with the untouched baseline.
