Sample - Claims Validation
Up: HVE Sample Labs · Audience: Learner Personas · Evaluation: Competency and Evaluation Goals
Goal and Scenario
A fictional insurer receives malformed claims. Implement validate_claim(claim) in HVE Samples/claims-validation/starter.py. Use this to practice bounded planning, implementation, edge cases, and acceptance. Proposed time: 30–45 minutes, untested with learners.
Contract
Input is a dictionary; handling arbitrary nondictionary inputs is out of scope. Return a list of error codes in this order, accumulating all applicable errors:
claim_id_required: claim_id is absent, not a string, or blank after trimming. Do not normalize or mutate the input.amount_invalid: amount is absent, not a Python int/float, boolean, nonfinite, zero, or negative. Numeric strings are invalid.status_invalid: status is not exactlynew,review, orclosed.
Unknown keys are allowed. Valid claims return []. No policy-limit logic, persistence, API server, or external services are required.
Learner Workflow
Read the starter and checks. Explain whether existing evidence is sufficient; research only a concrete gap. Create a bounded plan, have a partner approve it, implement, and run the acceptance checks. Add or explain an edge case beyond the obvious valid input. Use a review to distinguish executed work from accepted behavior.
Suggested prompt: “Plan a bounded implementation of the claims-validation contract. Inspect starter.py and checks.py, identify any unresolved evidence gaps, and do not change source during planning.” Then invoke the appropriate installed HVE phase entry points. See HVE RPI Workflow.
Run and Success Check
From HVE Samples/claims-validation/, run python3 checks.py starter.py. The starter fails deliberately; after implementation the checks should pass. Confirm that requirements are covered and input remains unchanged. Checks alone do not establish production readiness.
Submit a plan, diff, actual validation result, and short acceptance/handoff note. Instructor reference: instructor_solution.py; exclude it from learner packaging.
Variations
Guided: pair on one invalid-input case. Independent: implement the full contract. Adaptive: propose a policy-limit extension and identify the decision/data requirements before coding it.