VetsLearn focused Builder lab — revision 2026-10-03

Requirements: Python 3.10+; a local folder you control. Standard library only.
No install, network, API key, purchase or live model is required.
Extract this ZIP into its own folder. Open a terminal in that folder.
Run: python check.py
On Windows, py check.py may also work if Python's launcher is installed.

The starter is intentionally incomplete. Initial errors are expected, not a
broken download. Implement one function at a time in starter.py:
01: Read the contract and identify requirements; no code is needed yet.
02: parse_request(value): dict with exactly id, a non-empty string; else None.
03: validate_answer(envelope, source): bool; status ok; exact id/time string
    fields; both must match source. Other status/payload combinations fail.
04: lookup(caller, request, records): status invalid/missing/denied/ok.
    Public records allow guest; staff-only records require caller == 'staff'.
    Ok includes a copied record; other results contain only status.
05: once(operation_id, operation, cache): return cached result if present;
    otherwise call once, cache and return. In-memory teaching behavior only.
06: run(caller, request, records, operation_id, cache): use lookup; non-ok returns only status.
    An ok lookup supplies source for a deterministic id/time envelope.
    Validate it; produce status ok + artifact with id/time, or unsupported.
    Reauthorize before cache reuse. Bind operation identity to caller, request,
    source time and scope; changed intent under the same key is key_conflict.
    Use once for artifact construction; return a copy so callers cannot mutate
    the cached artifact. A new operation ID permits a new valid source result.

Feedback after an attempt: inspect reference.py, then run:
python check.py --reference
The reference demonstrates six test groups, including integrated cache reuse,
changed-intent rejection, permission revocation and new N at 14:15.
Passing it is not your work.
Add an independent case to check.py and inspect an artifact yourself.
Preserve your diff, command output, failed case, correction and limitations.

Limitations: caller strings and scope metadata are trusted teaching fixtures,
not production authentication. Cache is not durable or concurrency-safe.
The generator is deterministic: no live model behavior is measured. Tests
cover supplied cases, not every input or production security requirement.
Do not use real credentials, personal information or production services.
