Question 90
A developer plans to refactor an unfamiliar monorepo. Public APIs and package dependencies are not mapped, yet an agent proposes editing the first module that matches a keyword. What should happen first?
Explanation
Correct Answer
A refactor in a monorepo can affect consumers well beyond the first matching source file. A breadth-first inventory gives the coordinator an evidence-based view of which interfaces are public, which packages depend on them, and where tests or generated contracts reside. The plan can then prioritize a change with a known blast radius and add integration checks. This reduces the risk of locally correct edits that silently break dependent services.
Incorrect Answers
A keyword match identifies a possible location, not the complete dependency graph for a public API. Other modules may import the function or rely on its behavior. Editing before mapping callers can produce regressions that a narrow local test never exercises.
Comments can be stale and do not reveal every runtime or compile-time dependency. The scenario emphasizes unknown package boundaries and public interfaces, which require code and build graph inspection. The coordinator should gather structural evidence before defining the change scope.
Without a common view of dependencies, parallel workers may make incompatible assumptions and break one another's consumers. The resulting integration conflicts would be harder to resolve than a planned change. The coordinator should establish the relevant contracts and task boundaries before authorizing broad mutations.