What Is Structural Scoping? And Why Your AI Coding Tools Need It
Every engineering team has experienced it: a feature that looked like a two-day task turns into two weeks because nobody realized the payment service shares a database model with the notification system, or that changing an API response shape would break three downstream consumers in other repositories.
The root cause is always the same. Planning happened in a document, not in the code. The scope was defined by what people remembered about the system, not by what the system actually looks like.
Structural scoping is a different approach. It means grounding every planning decision in the actual structure of your codebase — its AST, its dependency graph, its interface boundaries — so that the scope of work reflects reality, not assumptions.
The problem with ungrounded planning
Traditional project planning tools treat code as an afterthought. You write user stories in Jira or Linear, estimate complexity based on gut feeling, and hope that whoever picks up the ticket understands enough of the system to implement it correctly.
This creates a gap between what gets planned and what gets built. The gap shows up in several predictable ways:
- Missed dependencies — A story says "update the user profile endpoint" without accounting for the three services that consume that endpoint's response shape.
- Underestimated scope — A change to a shared utility function cascades through dozens of call sites nobody thought to check.
- Duplicated work — Two stories independently implement the same helper because neither author knew it already existed in a different service.
- Incorrect implementation context — AI coding tools generate code based on similarity search, which often surfaces code that looks related but isn't structurally connected to the change.
What structural scoping actually means
Structural scoping is the practice of using structural code analysis — AST parsing, symbol resolution, dependency graph traversal, and interface detection — to inform and validate engineering plans before implementation begins.
It's not a tool. It's a method. But it requires tooling that most teams don't have. Here's what's involved:
1. Parse the codebase into a structural graph
Rather than treating code as flat text, structural scoping starts by parsing every file in your codebase into its abstract syntax tree (AST). From the AST, you extract symbols — functions, classes, interfaces, type definitions, exports — and the relationships between them: what imports what, what calls what, what implements which interface.
The result is a graph. Not a flat index of files, but a connected structure where you can trace any symbol to its dependents and dependencies across your entire system.
2. Detect cross-service interfaces
In a multi-repo or multi-service architecture, dependencies don't stop at import statements. Services communicate through REST endpoints, message queues, event buses, gRPC contracts, and shared databases. Structural scoping identifies these cross-service interfaces and maps producers to consumers.
This is what makes it possible to answer questions like "if I change this Kafka topic's schema, which services need to update their consumers?" — a question that similarity search cannot answer.
3. Ground planning artifacts in the graph
When you generate a user story or scope an epic, every claim about the system is validated against the structural graph. If a story says "this change affects the user service," structural scoping can verify whether that's true and surface any additional services that are also affected.
This is where structural scoping diverges from code search. Code search finds things that look related. Structural scoping finds things that are related — because they're connected in the dependency graph.
4. Surface confidence levels
Not every dependency can be resolved statically. Dynamic dispatch, runtime configuration, and convention-based routing all create ambiguity. A good structural scoping system doesn't hide this ambiguity — it surfaces it as confidence scores, so planners know which parts of the scope are certain and which parts need human verification.
How structural scoping changes the workflow
With structural scoping, the planning workflow changes fundamentally:
- Input a brief or transcript — Describe what you want to build in natural language. A meeting recording, a product brief, a Slack thread.
- AI generates stories grounded in the codebase — Instead of generating stories from language models alone, the AI uses the structural graph to identify which files, functions, and services are actually involved.
- Dependency analysis validates the scope — Every story includes its downstream impact map: what other parts of the system are affected, what interfaces are touched, what tests need updating.
- Engineers get implementation context, not just descriptions — Each story ships with specific file paths, function signatures, and code patterns from the actual codebase. Not "update the user model" but "modify
UserProfileinsrc/models/user.ts:47and update the three consumers ofgetUserProfile()."
Why AI coding tools need structural scoping
The rise of AI coding assistants has made this problem more urgent, not less. Tools like Cursor, Copilot, and Claude Code are extraordinarily good at generating code — but they're only as good as the context they receive.
Most AI coding tools rely on similarity search (vector embeddings) to find relevant context. You describe what you want, the tool searches for similar code, and it uses that code as context for generation. This works well for isolated tasks but falls apart for anything that requires understanding how parts of a system connect.
Structural scoping gives AI tools something they currently lack: a map of the system. Not just "code that looks like what you're working on," but "code that is structurally connected to what you're changing." This is the difference between generating code that compiles and generating code that integrates correctly with the rest of the system.
Structural scoping in practice
ArcLume implements structural scoping as a core part of its planning pipeline. When you connect a repository, ArcLume parses the codebase into a structural graph, detects cross-service interfaces, and uses this graph to ground every story it generates.
Through the MCP server, your AI coding tools can query this structural graph directly — searching by dependency, tracing impact paths, and understanding how services communicate. The result is AI-assisted planning and implementation that reflects how your system actually works.
Structural scoping isn't a buzzword. It's the missing layer between product requirements and engineering execution. And it starts with treating your codebase as a structured graph, not a bag of text.
Ready to try ArcLume?
ArcLume is currently in beta. Connect your repos, build a knowledge graph, and start generating codebase-aware epics and stories.
Join the Beta