Skip to content

fix: register Section in NODE_TABLES and NODE_SCHEMA_QUERIES#401

Merged
abhigyanpatwari merged 6 commits into
mainfrom
feat/markdown-indexing
Mar 20, 2026
Merged

fix: register Section in NODE_TABLES and NODE_SCHEMA_QUERIES#401
abhigyanpatwari merged 6 commits into
mainfrom
feat/markdown-indexing

Conversation

@abhigyanpatwari

Copy link
Copy Markdown
Owner

Summary

  • Fixes CI failure from feat: add markdown file indexing (headings + cross-links) #399Section schema was defined but never registered, so the table was never created in the database
  • Adds 'Section' to NODE_TABLES array
  • Adds SECTION_SCHEMA to NODE_SCHEMA_QUERIES array
  • Adds missing FROM File TO Section relation entry

Error was: Binder exception: Table Section does not exist

Test plan

  • CI passes on all 3 platforms (ubuntu, macos, windows)

🤖 Generated with Claude Code

abhigyanpatwari and others added 3 commits March 21, 2026 03:09
Parse .md/.mdx files using regex (no tree-sitter dependency) to extract:
- Section nodes from headings (h1-h6) with hierarchy via CONTAINS edges
- Cross-file IMPORTS edges from markdown links to other repo files

Ported from #286 to resolve conflicts with kuzu→lbug rename.

Co-Authored-By: Dennis Palatov <dp-web4@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The Section schema was defined but not registered in NODE_TABLES or
NODE_SCHEMA_QUERIES, so the table was never created in the database.
Also adds missing FROM File TO Section relation entry.

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

vercel Bot commented Mar 20, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
gitnexus Ready Ready Preview, Comment Mar 20, 2026 10:20pm

Request Review

@github-actions

github-actions Bot commented Mar 20, 2026

Copy link
Copy Markdown
Contributor

CI Report

All checks passeda34669b

Pipeline

Stage Status Ubuntu Windows macOS
Typecheck success
Tests success

Tests

Metric Value
Total 3459
Passed 3439
Skipped 20
Files 998
Duration 1m 49s

✅ All 3439 tests passed across 998 files

20 test(s) skipped
  • buildTypeEnv > known limitations (documented skip tests) > Ruby block parameter: users.each { |user| } — closure param inference, different feature
  • Python match/case as-pattern type binding > resolves u.save() to User#save via match/case as-pattern binding
  • Python match/case as-pattern type binding > does NOT resolve u.save() to Repo#save (negative disambiguation)
  • Swift constructor-inferred type resolution > detects User and Repo classes, both with save methods
  • Swift constructor-inferred type resolution > resolves user.save() to Models/User.swift via constructor-inferred type
  • Swift constructor-inferred type resolution > resolves repo.save() to Models/Repo.swift via constructor-inferred type
  • Swift constructor-inferred type resolution > emits exactly 2 save() CALLS edges (one per receiver type)
  • Swift self resolution > detects User and Repo classes, each with a save function
  • Swift self resolution > resolves self.save() inside User.process to User.save, not Repo.save
  • Swift parent resolution > detects BaseModel and User classes plus Serializable protocol
  • Swift parent resolution > emits EXTENDS edge: User → BaseModel
  • Swift parent resolution > emits IMPLEMENTS edge: User → Serializable (protocol conformance)
  • Swift cross-file User.init() inference > resolves user.save() via User.init(name:) inference
  • Swift cross-file User.init() inference > resolves user.greet() via User.init(name:) inference
  • Swift return type inference > detects User class and getUser function
  • Swift return type inference > detects save function on User (Swift class methods are Function nodes)
  • Swift return type inference > resolves user.save() to User#save via return type of getUser() -> User
  • Swift return-type inference via function return type > resolves user.save() to User#save via return type of getUser()
  • Swift return-type inference via function return type > user.save() does NOT resolve to Repo#save
  • Swift return-type inference via function return type > resolves repo.save() to Repo#save via return type of getRepo()

Coverage

Metric Coverage Covered Base (main) Delta
Statements 68.14% 8703/12772 68.16%
Branches 59.46% 5949/10004 59.66% 📉 -0.2%
Functions 70.27% 754/1073 70.13% 📈 +0.1%
Lines 70.46% 7779/11039 70.49%

📋 Full run · Coverage from Ubuntu · Generated by CI

NODE_TABLES: 27→28, NODE_SCHEMA_QUERIES: 27→28, SCHEMA_QUERIES: 29→30

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Show stdout/stderr in assertion message so CI failures reveal
why the second analyze --skills run exits with code 1.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Section table has 8 columns (includes level) but getCopyQuery fell
through to the default 7-column multi-language path. Adds explicit
Section cases to getCopyQuery and insertNodeToLbug/upsertNodeToLbug.

Error was: COPY failed for Section: Number of columns mismatch. Expected 7 but got 8.

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

@xkonjin xkonjin left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review: Registers Section as a first-class node type for Markdown indexing support.

What looks good:

  • Complete coverage: NODE_TABLES, NODE_SCHEMA_QUERIES, getCopyQuery, insertNodeToLbug, batchInsertNodesToLbug, and the File-to-Section relationship edge are all wired up.
  • Section schema fields (level, content, startLine/endLine, description) are well chosen for Markdown heading hierarchy.
  • Test updates for count assertions are correct (27->28 nodes, 29->30 total schemas).
  • Better error diagnostics in skills-e2e.test.ts (stdout/stderr in assertion messages) is a nice improvement.

Suggestions:

  1. The comment in schema.test.ts still says '9 core + 18 multi-language = 27' but the count is now 28. The arithmetic comment should be updated to '9 core + 18 multi-language + 1 markdown = 28' for accuracy.
  2. Section only has a relationship FROM File TO Section. Consider whether Section-to-Section edges would be useful for representing heading nesting (h1 -> h2 -> h3). This could be a follow-up.
  3. No migration path mentioned. If existing indexed repos upgrade GitNexus, they will have the old 27-table schema. Will queries against Section fail gracefully, or does this require a re-analyze? Worth a note in the PR description.
  4. The COPY query column ordering must exactly match the CSV output from the analyzer. Verify the markdown parser emits columns in the same order (id, name, filePath, startLine, endLine, level, content, description).

@abhigyanpatwari abhigyanpatwari merged commit 1f7764c into main Mar 20, 2026
9 checks passed
abhigyanpatwari pushed a commit that referenced this pull request Mar 21, 2026
Release includes markdown indexing (#399) and the Section table
registration fix (#401), making PR #403 unnecessary.

https://claude.ai/code/session_015WxcTDYrGi4sWY8iY8gDZP
icodebuster pushed a commit to icodebuster/GitNexus that referenced this pull request Mar 22, 2026
* main: (67 commits)
  fix(server): allow private/LAN network origins in CORS (abhigyanpatwari#390)
  fix(ingestion): calculate confidence per resolution tier for heritage/MRO edges (abhigyanpatwari#412)
  fix(lbug): retry on DB lock with session-safe cleanup (abhigyanpatwari#325)
  fix(analyze): address review — rename --no-git to --skip-git, fix stale cache
  fix(analyze): address Copilot review — ESM import, CLI option, .gitignore guard
  docs(schema): add Community and Process node properties to cypher tool description (abhigyanpatwari#411)
  fix(analyze): allow indexing folders without a .git directory (abhigyanpatwari#384)
  token trunking
  updated mahalanobis threshold to be multi-dim aware
  fix: clarify that ORT CUDA binaries are linux/x64 only
  updating workflow verbage
  fixed prop cutoff issue for pr/issue filtering
  fix: update symbol and relationship counts in documentation
  fix: address PR abhigyanpatwari#409 review findings (P0-P3) and simplify import resolution API
  refactor: unify language dispatch with compile-time exhaustive tables
  feat: implement cross-file binding propagation for multiple languages
  fix: hydrate worker DB in server mode + fix LadybugDB getAll API mismatch (abhigyanpatwari#398) (abhigyanpatwari#404)
  docs: add gitnexus-stable-ops to community integrations
  fix: register Section in NODE_TABLES and NODE_SCHEMA_QUERIES (abhigyanpatwari#401)
  feat: add markdown file indexing (headings + cross-links) (abhigyanpatwari#399)
  ...
motolese pushed a commit to motolese/datamoto-gitnexus that referenced this pull request Apr 23, 2026
…npatwari#401)

* feat: add markdown file indexing (headings + cross-links)

Parse .md/.mdx files using regex (no tree-sitter dependency) to extract:
- Section nodes from headings (h1-h6) with hierarchy via CONTAINS edges
- Cross-file IMPORTS edges from markdown links to other repo files

Ported from abhigyanpatwari#286 to resolve conflicts with kuzu→lbug rename.

Co-Authored-By: Dennis Palatov <dp-web4@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: add Section to NODE_TABLES and NODE_SCHEMA_QUERIES

The Section schema was defined but not registered in NODE_TABLES or
NODE_SCHEMA_QUERIES, so the table was never created in the database.
Also adds missing FROM File TO Section relation entry.

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

* fix: update schema test counts for Section node type

NODE_TABLES: 27→28, NODE_SCHEMA_QUERIES: 27→28, SCHEMA_QUERIES: 29→30

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

* test: add diagnostic output to skills-e2e idempotency test

Show stdout/stderr in assertion message so CI failures reveal
why the second analyze --skills run exits with code 1.

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

* fix: add Section COPY query with level column in lbug-adapter

Section table has 8 columns (includes level) but getCopyQuery fell
through to the default 7-column multi-language path. Adds explicit
Section cases to getCopyQuery and insertNodeToLbug/upsertNodeToLbug.

Error was: COPY failed for Section: Number of columns mismatch. Expected 7 but got 8.

---------

Co-authored-by: Dennis Palatov <dp-web4@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants