By Abhijith N M · Reviewed 24 October 2026 · Editorial standards
You are adding the first three golden cases for Waypoint's customer-update path. One case should catch a missing response field (schema), one should catch a dropped policy citation (contains), and one should catch a wrong approval decision (exact). The lab runs all three checks against canned responses and prints the verdicts.
id, a kind, an expected value and the actual response being checked.check function that dispatches on kind.CASES = [
{
"id": "schema-ok",
"kind": "schema",
"expected": ["draft", "citations"],
"actual": ["draft", "citations", "approval_required"],
},
{
"id": "contains-ok",
"kind": "contains",
"expected": "clause 4.2",
"actual": "Northline clause 4.2 supports a delay credit.",
},
{
"id": "exact-fail",
"kind": "exact",
"expected": True,
"actual": False,
},
]
def check(case: dict) -> bool:
kind = case["kind"]
expected = case["expected"]
actual = case["actual"]
if kind == "schema":
return all(field in actual for field in expected)
if kind == "contains":
return expected.lower() in actual.lower()
if kind == "exact":
return expected == actual
raise ValueError(f"unknown check kind: {kind}")
for case in CASES:
verdict = "PASS" if check(case) else "FAIL"
print(f"{case['id']}: {verdict}")Key takeaways
Golden cases pair a check kind with an expected value and a canned actual response.
Schema, contains and exact checks cover structure, required facts and decisions respectively.
Keep contains phrases short and canonical, and reserve exact checks for decisions.
Deliberately failing cases prove the gate rejects regressions instead of only printing green.
Written and edited by the nexGenCoders team. Spotted a mistake? Tell us and we will fix it.
Don't lose this lesson
Create a free account to save your progress, keep your streak, and work toward a shareable certificate.