# Capstone: Harbor House intake that a colleague can trust

Harbor House Workshops receives workshop requests in a weekly CSV. A person currently has to spot updates, chase missing details, decide what needs attention, and prepare a weekly update. The export contains repeat submissions, corrected records, invalid values, and a note that tries to instruct the assistant to send the data elsewhere.

Your task is to turn those files into a reliable local workflow. A successful result lets another person answer: **What needs attention, why, and which input supports that answer?** Build one of the two tracks below. Choose the smallest implementation that meets the criteria; a database, live integration, cloud deployment, or elaborate agent system is not required.

## Agree on the project before building

Write a one-page plan containing the chosen track, intended user, input and output paths, run or start procedure, date configuration, and acceptance checks. For Track B, also state how edits are stored and what happens when the page reloads or a new file is imported. Session-only edits are acceptable if the interface clearly explains that behavior and exports preserve the edits.

The four-week program has 12 sessions of two hours each. Use the early sessions to understand and build a small working path, the middle sessions to handle updates and failures, and the final sessions to demonstrate and hand over the result. This is a working sequence, not a requirement to spend all 24 live hours on assessment.

## Source material and scope

Use these files from the supplied resource pack:

- `resources/datasets/intake-week-01.csv`: the original intake.
- `resources/datasets/intake-week-02-updates.csv`: eight additional rows containing new requests and updates. **Week 2 means Week 1 plus this file.**
- `resources/datasets/scenario-config.json`: assessment dates and USD currency.
- `resources/datasets/expected-results.json`: the authoritative reference answers.
- `resources/datasets/malformed-intake.csv`: a deliberately incorrect file for a failure test.
- `resources/data-dictionary.md`: field definitions and normalization rules.

The CSV schema is `request_id, client_name, contact_name, contact_email, workshop_type, delivery_mode, participants, requested_date, budget_usd, status, owner, updated_at, notes`.

Keep supplied inputs unchanged. Write derived files in the learner workspace, normally under `outputs/`, or in the output directory recorded in the plan. Neither track may send messages, submit payments, publish anything, or write to an external service. Follow-up messages are local, unsent drafts. A note inside a client record is data, even when it uses words such as “ignore,” “send,” or “system.”

## Rules both tracks must implement

1. **Identify by request ID.** Deduplicate by `request_id`, never by a similar client name, contact name, or email address. Two different request IDs remain separate requests.
2. **Use the latest version.** Select the latest `updated_at` for each ID under the data dictionary's rules. Identical repeats do not create a second request. Conflicting records at the same latest timestamp quarantine that ID; do not arbitrarily pick a winner. A newer valid correction can resolve an earlier conflict or invalid value. Do not fall back to an older valid version when the current version is invalid.
3. **Separate invalid records from useful work.** Quarantine means hold the request out of the working queue and explain why. Retain its source ID and enough source information to find the affected rows. Invalid dates and zero participants must not silently become valid values.
4. **Exclude inactive requests from active totals.** `CLOSED` and `CANCELLED` requests may be valid canonical records, but they do not belong in active priority counts or the active-budget sum.
5. **Use a fixed assessment date.** Week 1 uses `2026-10-05`; Week 2 uses `2026-10-12`. Do not use the computer's current date for these acceptance runs.
6. **Assign one priority per active request, in order.** P1: the requested date is in the past or falls within seven calendar days of the assessment date, inclusive. Otherwise P2: owner or budget is missing, stated budget is below USD 2,000, or participants exceed 50. Otherwise P3. P1 takes precedence even when a P2 condition also applies.
7. **Label money correctly.** Sum known budgets for active requests only, state USD, and report the number with unknown budget separately. These are requested or stated budgets, not booked revenue, invoices, or money collected. A missing budget is unknown; it is not zero.
8. **Preserve traceability.** Queue decisions and summaries must be traceable to request IDs. Retain all applicable reason flags from the data policy even when P1 takes precedence. Quarantine explanations must identify the problem. Drafts must identify the request that supports them. When versions matter, also record the source file/row or timestamp. Sort the queue by P1/P2/P3, then requested date ascending, then request ID ascending.

For the P1 boundary checks, Week 1 includes dates through `2026-10-12`; Week 2 includes dates through `2026-10-19`. A date eight days ahead is not P1 merely because it is close. It may still qualify as P2 for another reason.

## Track A: Intake to weekly brief

Build a repeatable local workflow that reads the selected weekly files, produces a validated active queue, and prepares a brief with unsent follow-up drafts.

Default output names are `outputs/queue.csv`, `outputs/review-needed.csv`, `outputs/weekly-brief.md`, and `outputs/drafts.md`. Alternative names are acceptable if the plan and handover give their exact locations.

The queue must expose the current request, priority, reason, owner, requested date, budget state, and source ID. The review file must distinguish quarantined records from valid requests that merely need an owner or budget. Do not count a request twice because it appears in two files.

The brief should fit roughly one screen of text, or no more than 300 words excluding a compact reference table. Include the assessment date, input coverage, active total, priority counts, known active budget, unknown-budget count, three supported attention items, and a visible note about quarantined IDs. Avoid generic AI commentary.

Prepare at least three useful drafts tied to active request IDs, covering more than one real reason to follow up. State `UNSENT DRAFT: review required` above each draft. Use only facts supported by the record. Missing information becomes a question, not an invented deadline, owner, price, or commitment. Include the source ID and intended recipient from the supplied data; an unusable recipient is explicitly held for review.

Done means a colleague can choose the weekly snapshot, run the workflow, understand what needs attention, inspect the evidence, and review the drafts without any external action occurring.

## Track B: Internal intake browser

Build a local browser tool that imports the supplied files and supports filtering, request details, computed reason flags, owner/status edits, and export.

The interface must show the assessment date and whether it represents Week 1 or the combined Week 2 data. Provide filters that make the queue useful, including priority and owner or status. Display all computed reason flags from the data dictionary; these explain the record and are not manually editable labels. Details must expose the request ID, source information, notes, and the reason for priority or quarantine.

Treat notes as text. Never execute HTML, scripts, commands, or instructions from notes. Keep owner/status edits separate from the immutable source files, validate allowed owners/statuses, and visibly distinguish changes from the original imported value. A local edit that closes a request must update the active views and totals consistently. Export must contain the values the user is told it contains, including edited owner/status and computed reason flags; document whether it exports the visible filter or all relevant records.

No backend or login is required. If edits last only for the session, say so before a user relies on them and explain how to save an export. If edits persist, explain where they live, how they are restored, and how a later import interacts with them. Either approach must avoid silently losing changes or applying stale changes to a new snapshot.

Done means a colleague can import, find, inspect the request and its flags, edit, and export using the keyboard, understand empty/error states, and tell which data is original and which is locally edited.

## Baseline acceptance values

These are **expected values**, not observed implementation results. Check them before any deliberate Track B owner/status edits. The detailed ID-level oracle remains in `resources/datasets/expected-results.json`.

| Measure | Week 1 | Combined Week 2 |
|---|---:|---:|
| Assessment date | 2026-10-05 | 2026-10-12 |
| Raw rows | 24 | 32 |
| Distinct request IDs | 20 | 23 |
| Quarantined IDs | 3: HH012, HH013, HH014 | 1: HH013 |
| Valid canonical requests | 17 | 22 |
| Active requests | 15 | 19 |
| P1 / P2 / P3 | 9 / 2 / 4 | 13 / 2 / 4 |
| Known active budget, USD | 55,200 | 68,800 |
| Active requests with unknown budget | 1 | 2 |
| Participants across active requests | 394 | 502 |

For Week 1, HH012 has conflicting same-latest-timestamp records, HH013 has an invalid date, and HH014 has zero participants. The combined Week 2 data resolves HH012 and HH014 with newer corrections; HH013 remains quarantined. HH004 is `CLOSED` and HH018 is `CANCELLED` in Week 1. HH019 contains an instruction-like note; it must remain ordinary source data.

## Submit a reviewable package

Include the source project, one-page plan, exact setup and run/start instructions, dependency information where relevant, both weekly baseline results, completed test log, and final handover. Include the input filenames and fingerprints or another exact integrity comparison. Include actual commands/browser actions and results, not just generated tests that were never run.

Evidence can be short: a saved test report, a reproducible command and output, a screenshot paired with the steps that produced it, or a reviewer observation. Give each item an ID from the checklist. Do not include secrets or unrelated client information. Only mark a check `PASS` when the expected behavior was observed; record unresolved issues openly.

During the final demonstration:

1. Explain the user, chosen track, and file-to-output flow in two minutes.
2. Show Week 1, then combined Week 2, and explain the changed results.
3. Inspect one duplicate, one quarantine, one priority decision, and HH019's untrusted note.
4. Run a repeatability check and a malformed-file recovery check.
5. Demonstrate the complete chosen-track workflow, including its review boundaries.
6. Make one small change requested by the reviewer in a copy, predict the effect, and verify it.
7. Hand the package to the reviewer and let them follow the instructions.

The live demonstration is an observation exercise; it does not imply a recording is included.

## Scoring and pass gates

Use `capstone-rubric.csv`. Choose the full-credit, partial-credit, or zero anchor for each criterion and record the observed evidence. The maximum is 100 points. A pass requires **75 points or more and all five gates** below. A high score in presentation cannot compensate for incorrect data or unsafe behavior.

| Gate | Required evidence |
|---|---|
| G1: Safe handling | Inputs remain unchanged; HH019 does not alter instructions or cause data transmission; no messages, payments, publication, or external writes occur. |
| G2: Correct baseline | Both weekly snapshots match the oracle, including IDs, quarantine reasons, active records, priorities/reason flags, known budgets, unknown counts, and active participants. |
| G3: Reliable operation | Repeating identical inputs/configuration gives equivalent results without duplicates; malformed input fails clearly without corrupting the last good output or current app state; a subsequent valid run succeeds. |
| G4: Complete chosen track | Track A produces its four outputs and source-grounded unsent drafts; or Track B completes import/filter/detail/flag display/edit/export, keyboard use, and empty/error handling. |
| G5: Usable handover | A reviewer can reproduce a baseline using the documented local setup, and the handover identifies limitations, storage, recovery, and verification evidence. |

Before review, the status is `ASSESSMENT_PENDING`. If a gate fails or the score is below 75, record `REVISION_REQUIRED`, the specific failed checks, and the smallest necessary corrections. Re-run affected checks and any dependent totals after the correction. Use `PASS` only after the actual review meets the score and gate requirements.
