{{ message }}
feat: add composite audit command (Backlog #27)#219
Merged
Conversation
Single `codegraph audit <file-or-function>` call replaces 3-4 separate invocations (explain, fn-impact, complexity) for AI agent workflows. - `auditData()` composes explainData + DB enrichment for full Halstead metrics, LOC/SLOC, BFS impact analysis, and manifesto threshold breach detection - CLI command with --depth, -f, -k, -T, -j options - MCP tool registered in BASE_TOOLS with handler - Programmatic API exported from index.js - Phase 4.4 fields (risk_score, complexity_notes, side_effects) read gracefully with null fallback until those columns are added - 16 integration tests covering function/file targets, filters, health metrics, threshold breaches, impact levels, and edge cases Impact: 12 functions changed, 8 affected
Contributor
Greptile SummaryThis PR implements a composite Key Changes:
Implementation Quality:
Confidence Score: 5/5
Important Files ChangedFlowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[auditData target, opts] --> B{explainData with depth=0}
B --> C{Target type?}
C -->|file| D[Get publicApi + internal symbols]
C -->|function| E[Get function results]
D --> F{Apply filters}
E --> F
F --> G[Open DB for enrichment]
G --> H{For each symbol/function}
H --> I[Query node ID by name/file/line]
I --> J[buildHealth: Query function_complexity table]
I --> K[computeImpact: BFS traversal of callers]
I --> L[readPhase44: Query risk_score, complexity_notes, side_effects]
I --> M{File target only?}
M -->|Yes| N[Query callers/callees edges]
N --> O[Merge all enrichments]
M -->|No| O
J --> O
K --> O
L --> O
O --> P[Return enriched function object]
P --> H
H --> Q[Close DB]
Q --> R[Return target, kind, functions array]
Last reviewed commit: 142c282 |
Zeeeepa
pushed a commit
to Zeeeepa/codegraph
that referenced
this pull request
Jun 22, 2026
…th (optave#219) Single `codegraph audit <file-or-function>` call replaces 3-4 separate invocations (explain, fn-impact, complexity) for AI agent workflows. - `auditData()` composes explainData + DB enrichment for full Halstead metrics, LOC/SLOC, BFS impact analysis, and manifesto threshold breach detection - CLI command with --depth, -f, -k, -T, -j options - MCP tool registered in BASE_TOOLS with handler - Programmatic API exported from index.js - Phase 4.4 fields (risk_score, complexity_notes, side_effects) read gracefully with null fallback until those columns are added - 16 integration tests covering function/file targets, filters, health metrics, threshold breaches, impact levels, and edge cases Impact: 12 functions changed, 8 affected
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
codegraph audit <file-or-function>combining explain + fn-impact + health metrics into a single call, reducing AI agent round-trips from 3-4 to 1auditData()composesexplainData+ one supplementary DB open for full Halstead metrics, LOC/SLOC, BFS impact analysis, and manifesto threshold breach detection--depth,-f,-k,-T,-joptions; MCP tool registered; programmatic API exportedrisk_score,complexity_notes,side_effects) read gracefully with null fallback until those columns are addedTest plan
audit(27 tools total)node src/cli.js audit buildGraph -Tnode src/cli.js audit src/queries.jsnode src/cli.js audit explainData -j -TCloses #207