L10 Call chains and trace boundaries
18 minSuggested first: L09 Tests and configuration
Outcome
Produce an ordered trace between an explicit start and stop, following the branch taken by the given input.
Learn
A direct call is one the current function makes itself. A transitive call happens further down the chain. The codebases index helps you find candidates, but a reported reference isn't proof that the call runs for this input.
Record the caller, the callee and your evidence, and stop exactly where the question says.
Worked example
Starting at serve(5), include the start and stop at the first entry to write. Which functions are entered, in order?
function serve(n) { return n > 0 ? pack(n) : empty(); }
function pack(n) { return write({ count: n }); }
function write(data) { return data.count; }
function empty() { return 0; }
Predict first, then show the worked explanation
5 > 0 is true, so serve calls pack, which calls write: the trace is
serve → pack → write. The other branch, empty, isn't taken. Returning to serve afterwards
isn't another entry to serve.
Practice and check
Common mistake
Listing every name visible in the function. Use the input, follow the branch it takes, and apply the stop rule.
Practice on a real repository
Try one of the Trace puzzles below. Each Trace prompt defines which calls count and where the trace starts and ends; read those rules on each puzzle.
- From c.redirect to the response builderTrace · Easy · honojs-hono
- From requests.get to a PreparedRequestTrace · Easy · psf-requests
Related topics: Request lifecycle
Practice is optional. Solving a puzzle doesn't complete a lesson, and lessons never change a puzzle's points.
References
- SCIP Code Intelligence Protocol (SCIP maintainers)