Skip to content

feat: vector-resolve visibility, complexity CI gate, dead-code confidence, diagram export - #1650

Merged
Shashankss1205 merged 4 commits into
mainfrom
fix/vector-resolve-visibility
Aug 19, 2026
Merged

Shashankss1205 merged 4 commits into
mainfrom
fix/vector-resolve-visibility

Conversation

@Shashankss1205

Copy link
Copy Markdown
Collaborator

Four features/fixes, each with hermetic end-to-end tests. Unit suite 1382 passed / 7 skipped; the new integration tests (10) all pass.

Fixes #1597, fixes #1333, fixes #1332, fixes #1287

… visible (#1597)

ENABLE_VECTOR_RESOLVE=true with no embedding backend used to fail inside
swallowed excepts at log levels that are off by default — 123k functions,
0 embeddings, no error anywhere. Now:

- probe_embedding_backend() checks importability (and OPENAI_API_KEY for the
  openai spec) without loading any model
- cgc config set ENABLE_VECTOR_RESOLVE true warns at the moment of intent
- the index summary prints an always-visible '⚠ … embeddings were NOT
  generated' line, independent of the log level, and real pipeline failures
  log at ERROR instead of INFO
- the watcher probes once per handler instead of re-attempting the failed
  import on every file event

End-to-end tests use CGC_EMBEDDING_MODEL=openai without a key so the probe
fails deterministically in any environment.
…ty (#1333)

- --format json|csv emits the documented schema on a CLEAN stdout: the
  service-init chatter is rerouted to stderr before anything initializes,
  so 'cgc analyze complexity --format json | jq .' works
- --fail-on-violations exits 1 when any function exceeds the threshold;
  without it the exit code stays 0 so exploratory use and existing scripts
  keep working (the config-default threshold means most codebases have some
  violation — failing every casual invocation would break innocent chains)
- enforcement/export operate on the FULL violation set: both finders accept
  limit=None so the interactive page size cannot truncate a CI verdict
- the synthetic <module> frame is excluded from violations
- docs/CI_INTEGRATION.md documents the GitHub Actions pattern

Hermetic end-to-end tests cover json purity, csv shape, both gate outcomes
and format validation.
…ence categories (#1332)

Every dead-code row now carries confidence + reason:
- low: dunders, test hooks/prefixes, entry-point names, overrides, test-tree
  files — the categories the finder already hard-excluded are reintroduced
  as visible low-confidence rows via --show-all instead of being silently
  invisible
- medium: decorated functions (decorators often register implicit callers)
- high: no excluding signal — very likely genuinely dead

The CLI table gains a Confidence column and a 'N high, N medium, N low'
summary; find_dead_code returns confidence_counts for MCP consumers.
Verified on a real embedded graph with one function per category.
…1287)

'cgc diagram .' emits a file→module import diagram that pastes straight into
GitHub Markdown; --level call switches to the function call graph and
--format dot renders via graphviz. stdout carries only the diagram (init
chatter is rerouted to stderr), -o writes a file, and the edge cap is
reported inside the diagram as a comment — never a silent truncation.
Addressing the staleness concern raised in the issue thread, the help text
frames the output as a generated artifact to regenerate after refactors,
not documentation to commit.
@vercel

vercel Bot commented Aug 19, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
code-graph-context-pack Ready Ready Preview Aug 19, 2026 4:39am

@github-actions

Copy link
Copy Markdown
Contributor

Hi! 👋 Join our CodeGraphContext Discord channel to collaborate: https://discord.gg/dR4QY32uYQ

@Shashankss1205
Shashankss1205 merged commit 9d7daf5 into main Aug 19, 2026
13 of 16 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog tasks to Done in CGC Progress Board Aug 19, 2026
@Shashankss1205
Shashankss1205 deleted the fix/vector-resolve-visibility branch August 19, 2026 04:40
@github-actions

Copy link
Copy Markdown
Contributor

🔍 PR Code Graph Analysis

feat: vector-resolve visibility, complexity CI gate, dead-code confidence, diagram export (#1650)

📊 Interactive Visualization

View the blast radius graph: PR Reviewer Dashboard

📦 Artifacts

The graph JSON has been uploaded as a build artifact: pr-code-graph-1650


Generated by CodeGraphContext using FalkorDB Lite

Shashankss1205 pushed a commit that referenced this pull request Sep 24, 2026
)

`main.py` had a single module-level `Console(stderr=True)`, so every `analyze` command rendered its result table to stderr while init chatter went to stdout — the split was inverted for exactly the commands whose job is emitting data. `cgc analyze callers X > out.txt` captured a banner and no table.

Adds a separate `analyze_result_console = Console()` and routes the result prints across the ten `analyze_*` commands through it. Empty-result notices move with the tables (a script reading stdout still needs to see that the query ran); argument-validation errors stay on stderr.

Leaves the #1650/#1655 `_file` save/restore mechanism untouched — verified no `.file` materialization leak via the unmodified CliRunner and complexity-CI suites.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

This branch was successfully deployed

1 active deployment
Preview — c332b8f7 Deployed Aug 19, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment