Context-capturing code records a function’s argument values at the start of execution, making the call reproducible elsewhere. Copy the captured values into a REPL or unit test and replay the function without retriggering the original endpoint. section 15.2 section 15.7
A useful implementation follows a small sequence:
- Insert logging at the beginning of the function body. section 15.2
- Serialize strings or generic data structures so copied values preserve their contents. section 15.2 section 15.7
- Copy the captured arguments into a pristine REPL or test, then modify and rerun the function through a short feedback loop. section 15.3 section 15.7
Replaying a catalog search
A search function logs serialized catalogData and query when an endpoint runs. Pasting those values into the REPL reproduces the call; changing "Watch" to "Habit" exposes the old empty result and lets the improved matching logic be tested immediately. section 15.3
