Skip to content

fix(graph): populate bundle metadata languages (#1516) - #1613

Merged
Shashankss1205 merged 1 commit into
mainfrom
fix/1516-bundle-languages
Aug 13, 2026
Merged

Shashankss1205 merged 1 commit into
mainfrom
fix/1516-bundle-languages

Conversation

@Shashankss1205

Copy link
Copy Markdown
Collaborator

Fixes #1516. Every exported bundle — including the published registry bundles (#1180) — advertised no languages. There turned out to be two independent defects; the issue describes the first.

1. Nothing ever set f.language

cgc_bundle.py derives the list from a language property on File nodes, but no writer set it and the Kùzu File table had no such column. The if record["language"] guard then filtered every row out.

The per-file language is already known at write time as file_data['lang'], so this persists it. Three places were needed, not one:

  • writer.py — set f.language on the File MERGE
  • database_embedded_kuzu.py:173 — add the language STRING column
  • database_embedded_kuzu.py:327 — a migration entry, so existing local databases gain the column rather than silently lacking it
  • database_embedded_kuzu.py:821 — add language to SCHEMA_MAP['File']

That last one matters: Kùzu filters node properties against that allow-list and drops unknown ones silently, so the schema column alone would not have been enough and the failure would have been invisible. One of the tests targets exactly that step.

2. Unscoped exports skipped the block entirely

Even with the property populated, bundle export foo.cgc (no --repo) still produced no languages — the whole block sat inside if repo_path and repo_path.exists():, so the key was never set at all. That's why the metadata showed None rather than [].

Moved it out of that branch with an unscoped query variant.

Verification

Real bundles, KuzuDB backend:

before:  languages: None                        (Kotlin repo, both scoped and unscoped)

after:   bundle export lang.cgc                 -> ['kotlin']
         bundle export lang2.cgc --repo ./kt    -> ['kotlin']
         README.md                              -> "- **Languages**: kotlin"

mixed repo (a.py, b.kt, c.js):
         languages -> ['javascript', 'kotlin', 'python']

Tests

Three regression tests through the real GraphWriter path, including one specifically covering the allow-list drop. Verified all three fail on main and pass with the fix.

tests/unit/         1181 passed, 7 skipped
tests/integration/    44 passed

Two defects meant every exported bundle advertised no languages.

1. Bundle export reads f.language on File nodes, but no writer ever set it
   and the Kuzu File table had no such column. The `if record["language"]`
   guard then filtered every row out. The per-file language is already known
   at write time as file_data['lang'], so persist it -- plus the schema
   column, a migration for existing databases, and the SCHEMA_MAP allow-list
   entry, without which Kuzu drops the property silently.

2. The language block sat inside `if repo_path and repo_path.exists()`, so a
   whole-graph export never set the key at all, even with the property
   present. Moved out and given an unscoped query branch.

Fixes #1516.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Aug 13, 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 13, 2026 7:14pm

@github-actions

Copy link
Copy Markdown
Contributor

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

@github-actions

Copy link
Copy Markdown
Contributor

🔍 PR Code Graph Analysis

fix(graph): populate bundle metadata languages (#1516) (#1613)

📊 Interactive Visualization

View the blast radius graph: PR Reviewer Dashboard

📦 Artifacts

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


Generated by CodeGraphContext using FalkorDB Lite

@Shashankss1205
Shashankss1205 merged commit a6efdb7 into main Aug 13, 2026
19 of 20 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog tasks to Done in CGC Progress Board Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

bug(graph): bundle metadata languages is always empty — export reads f.language, which no writer ever sets

1 participant