LECTURE 03 · PRACTICE
Choose what your agent needs for its next decision
Illustrative simulation. Outcomes follow the exercise rules; they are not measurements of an AI model's reliability.
Runs locally in your browser. No account, API key, LLM call, or backend. Page refresh starts over; download a handover to keep a record.
← Return to the lesson and downloads01 / READ THE TASK
Two public functions, submitPayment({ reference, amount }) and previewPayment({ reference, amount }), duplicate the same checks.
Acceptance: preserve signatures, exact error messages, validation order, and successful return values. Relevant tests must pass.
Scope: change the implementation, add a helper, and extend targeted tests. Keep the caller, approved contract, and dependencies unchanged.
Next decision: For { reference: '', amount: 0 }, which error should the shared helper throw first?
02 / INSPECT SOURCES
Approved revision 2 supersedes revision 1. Check empty reference first: Reference is required. Then amount <= 0: Amount must be positive. Both-invalid input must report Reference is required.
Old specification revision 1: check amount <= 0 first, then empty reference.
03 / DIAGNOSE
Estimated size: 560 / 4000 illustrative tokens
Estimator: selected content + uncompacted action text, characters ÷ 4, rounded up. Capacity is an illustration, not a model limit. Size does not measure correctness.
No item loaded in this component.
task-brief.md · exercise assignment
Extract duplicated validation in submitPayment and previewPayment. Preserve signatures, exact errors, successful returns, and check order. Allowed: entries.mjs, a helper, targeted tests. Decision: which validation runs first?
specification.md · fixture owner approval
Old specification revision 1: check amount <= 0 first, then empty reference.
illustrative image pipeline log · unrelated task
Image batch 1: thumbnail rendered; no payment validation information. Image batch 2: thumbnail rendered; no payment validation information. Image batch 3: thumbnail rendered; no payment validation information. Image batch 4: thumbnail rendered; no payment validation information. Image batch 5: thumbnail rendered; no payment validation information. Image batch 6: thumbnail rendered; no payment validation information. Image batch 7: thumbnail rendered; no payment validation information. Image batch 8: thumbnail rendered; no payment validation information. Image batch 9: thumbnail rendered; no payment validation information. Image batch 10: thumbnail rendered; no payment validation information. Image batch 11: thumbnail rendered; no payment validation information. Image batch 12: thumbnail rendered; no payment validation information. Image batch 13: thumbnail rendered; no payment validation information. Image batch 14: thumbnail rendered; no payment validation information. Image batch 15: thumbnail rendered; no payment validation information. Image batch 16: thumbnail rendered; no payment validation information. Image batch 17: thumbnail rendered; no payment validation information. Image batch 18: thumbnail rendered; no payment validation information. Image batch 19: thumbnail rendered; no payment validation information. Image batch 20: thumbnail rendered; no payment validation information. Image batch 21: thumbnail rendered; no payment validation information. Image batch 22: thumbnail rendered; no payment validation information. Image batch 23: thumbnail rendered; no payment validation information. Image batch 24: thumbnail rendered; no payment validation information.
illustrative prior session · unverified
I think amount should be validated first, following specification revision 1. I have not checked the current implementation, approved contract, or tests. Next session should extract a helper with amount validation first. No commands were run.
No item loaded in this component.
04 / ACT ONE STEP AT A TIME
The first three controls act on Approved specification. Each action has a different purpose.
Add the selected snapshot. Availability alone does not establish authority.
Replace only the selected loaded snapshot with its current fixture revision.
Remove the selected item from future input; keep its source and history.
Shorten working history while keeping decisions, uncertainty, and references. No freshness guarantee.
Compare loaded claims, provenance, approved intent, and observations. Recency alone cannot decide.
Apply the transparent exercise rules. This is not a real model prediction.
05 / INSPECT THE CONSEQUENCE
Only the old assumption is loaded. Inspect sources, then choose one action. No checks have run.
06 / PRESERVE CONTINUITY
A note preserves claims; it does not validate them. A new session needs evidence loaded explicitly.
With nothing selected, resume loads only the task and handover. Prior verification remains historical; refresh flags and uncertainties stay visible.
A smaller context can still be wrong; a larger context can be necessary to resolve uncertainty. Try excluding the log and compacting before refreshing. Then compare the old note with approved intent and current observations.
This fixture can establish a justified reference-first decision and a simulated check for one input. A real agent run must still refactor the code, run the tests, review signatures and all error cases, inspect scope violations, and record actual results.
Reset clears this exercise only. No external files change.