Question 470
A large monorepo contains three functions named authorize in unrelated packages. How should an agent trace a failing authorization path?
Explanation
Correct Answer
Three functions with the same name may enforce unrelated policies in different packages. Start from the failing request or test, identify its runtime entry point, resolve imports and package selection under the active build configuration, and follow the call chain to the invoked authorize implementation. Confirm with a targeted trace or reproducible test before editing, then scope the patch to the actual code path and rerun authorization checks. This evidence-based resolution avoids modifying a similarly named but unused function and keeps the investigation tied to the deployed revision rather than directory-name guesses.
Incorrect Answers
Imports are resolved by the project’s actual language, module loader, build configuration and dependency graph, not necessarily by physical proximity of files. The nearest authorize definition might belong to an unrelated package and never execute for the failing request. The agent should locate the true entry point and follow the import or symbol references that the deployed build uses, with tests or runtime traces when ambiguity remains. An incorrect path assumption could lead to patching an inert function while leaving the access-control defect untouched.
A directory-name match is a useful search lead but cannot identify the actual function invoked at runtime. Imports, package aliases, generated bindings, or deployment configuration may route the failing call to a different definition. The agent should start from the observed entry point and trace call sites and package resolution for the active build, then inspect the exact implementation. Editing a plausible-looking neighbor risks changing dead or unrelated code while leaving the real defect unchanged.
Editing all three authorization functions at once is not a conservative fix: it broadens the mutation to unrelated packages and can silently change access policy for other services. The observed failure may involve only one implementation selected by imports or runtime configuration. Determine which function is actually called, reproduce the defect on its route and change that path under appropriate review. Other definitions should remain untouched unless independent evidence shows they share the same fault. More edits create more risk without improving the causal diagnosis.



Claude Certified Architect - Foundations (CCA-F) Practice Tests