Framework and Language Coverage
Framework and Language Coverage
Section titled “Framework and Language Coverage”agent_architecture detects common agent orchestration patterns and applies configurable language filtering.
Framework Detection Coverage
Section titled “Framework Detection Coverage”The detector family covers these framework patterns:
| Framework | Typical Anchors |
|---|---|
| LangGraph | StateGraph, .compile() |
| CrewAI | Agent(, Crew( |
| LangChain Agents | AgentExecutor, .run(, .call(, .invoke( |
| AutoGen | AssistantAgent(, GroupChat(, GroupChatManager(, initiate_chat( |
| OpenAI Agents SDK | Runner.run(, Runner.run_sync(, Runner.run_streamed( |
| Pydantic AI | pydantic_ai.Agent(, .run_sync(, .iter( |
Call sites are deduplicated by (file, line) to avoid overcounting.
Generic invoke/compile patterns are counted only when a framework anchor exists in the same file.
Language Filtering Behavior
Section titled “Language Filtering Behavior”The optional metrics[].config.languages filter is extension-based.
- If
languagesis empty, no language filter is applied. - If set, only call sites in matching extensions are kept.
Supported language values and mapped extensions:
languages value | Extensions |
|---|---|
python | .py |
typescript, ts, javascript, js | .ts, .tsx, .js, .jsx, .mjs, .cjs |
rust | .rs |
Example:
metrics: - id: agent_architecture config: languages: ["python", "typescript"]AST vs Pattern Fallback
Section titled “AST vs Pattern Fallback”At a high level:
- Python and TypeScript call-site detection uses AST parsing when parse succeeds.
- If parsing fails, detection falls back to pattern-based matching.
- Rust is currently pattern-based for these agent patterns.
For loop-guard checks, Python can use same-function AST context to improve guard detection confidence.
Known Limitations and FP/FN Caveats
Section titled “Known Limitations and FP/FN Caveats”- Heuristic pattern matching may produce false positives in unrelated helper code with similar naming.
- Framework wrappers and internal abstraction layers can hide call sites and cause false negatives.
- Extension-based filtering depends on file names; non-standard extensions can be excluded unintentionally.
- Schema validation detection focuses on common conventions (Pydantic/Zod/JSON-like patterns) and may miss custom validators.
- Confidence can vary by detector mode (AST-backed vs line/pattern heuristics).
Practical Recommendations
Section titled “Practical Recommendations”- Start without a
languagesfilter to establish baseline visibility. - Add
languagesonly if you need to scope CI runtime or ownership boundaries. - Pair policy thresholds with finding review before strict enforcement.