Skip to content

fix(markdown): fold commands and table rows into their section - #613

Merged
bompus merged 1 commit into
fork/consolidatedfrom
perf/md-model
Nov 1, 2026
Merged

bompus merged 1 commit into
fork/consolidatedfrom
perf/md-model

Conversation

@bompus

@bompus bompus commented Nov 1, 2026 •

Copy link
Copy Markdown
Owner

Why

A Markdown table row, list item or fenced command minted a constant or function node plus a contains edge even though its text already lived in the section's docstring and searchable text. On supabase that was 6,222 of 27,380 Markdown nodes.

Change

  • Rows and list items contribute their references to the owning section; commands keep their script calls reference from the section.
  • Each section gets a short commands: summary (8 per owner, 240 characters) for display. Text the 600-character section preview drops stays searchable on the owning node's new search_text column (indexed in nodes_fts, not displayed, no file-wide cap): late rows, table headers, every recognized command even past the 8-command summary, and unrecognized unlabeled fence lines.
  • An unlabeled fence only contributes a command when the line looks like one (prompt, relative executable, assignment or a known command head), and every interpreter extractScriptPath supports is recognized (node, powershell, ...), so output, trees and JSON fragments stop becoming commands while a Node.js example keeps its script edge; a labeled shell fence keeps every line.
  • New __tests__/markdown-section-model.test.ts; extraction and full-pipeline tests updated to the section model.
  • README, the languages reference and the MCP instructions now describe the section-text model.

Results

Supabase, base 422b1f81 vs this branch:

base probe
nodes 141,880 135,658
edges 317,743 311,496
Markdown command/constant nodes 6,222 0
resolved Markdown edges 3,058 3,033
failed Markdown refs 11,368 11,393

The 25 lost resolved edges pointed at a removed row/command node; those references now fail instead of pointing at it. Another 112 resolved edges re-source from a row/command to its section with the same target. Everything else (non-Markdown nodes, Markdown file/module/import ids) is unchanged.

Index time shows no clear change: supabase median 15.969 s against 16.047 s (Hyperfine 2.0.0, 8 runs per build across two ABBA rounds; ranges overlap). The value is the 6,222-node graph reduction with the search text retained. n8n drops 3,719 nodes and discourse 869 from the same command/table removal.

Checks

  • Full suite: 960 files / 11,359 tests passed, 46 skipped, including the v24 migration on an existing database.
  • Golden: payroll-go.dump loses 20 command/table nodes and their contains edges; the section docstrings gain the command summary.
  • README rows checked: the Markdown indexing row and the Markdown language row are updated to the section-text model; the "About this fork" supabase graph counts move to 135,658 nodes / 311,496 edges, and the batch re-measure stays tracked in the plan.

Re-index Markdown-heavy projects after upgrading.

@bompus bompus added the author:deepseek Pull request written by a deepseek model label Nov 1, 2026

@bompus-ai-review bompus-ai-review Bot 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.

Bompus AI Review (GPT-6.1 Terra, max reasoning): 3 finding(s).

Comment thread src/extraction/markdown-extractor.ts Resolved
Comment thread src/extraction/markdown-extractor.ts Resolved
Comment thread src/extraction/markdown-extractor.ts Resolved

@bompus-ai-review bompus-ai-review Bot 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.

Bompus AI Review (GPT-6.1 Terra, max reasoning): 5 finding(s).

Comment thread src/extraction/markdown-extractor.ts Resolved
Comment thread src/extraction/markdown-extractor.ts Resolved
Comment thread src/extraction/markdown-extractor.ts Resolved
Comment thread src/extraction/markdown-extractor.ts Resolved
Comment thread src/extraction/markdown-extractor.ts Resolved
A Markdown table row, list item or fenced command minted a constant or
function node plus a contains edge even though the text already lived in
the section docstring. On supabase that was 6,222 of 27,380 Markdown nodes.

Rows/items now contribute their references to the owning section and
commands keep their script calls reference from the section. Text the
600-character preview drops stays searchable on the owning node's new
search_text column, indexed in nodes_fts but not displayed: late rows,
table headers, every recognized command past the 8-command summary, and
unrecognized fence lines. Token-boundary dedupe keeps a later CG-713 from
being treated as a substring of XCG-713. Unlabeled fences recognize every
interpreter extractScriptPath supports (node, powershell, ...).

Supabase vs the merged #612 base: 141,880 -> 135,658 nodes, 317,743 ->
311,496 edges; 25 references that pointed at a removed row/command node now
fail and 112 re-source to their section. Index time shows no clear change
(15.969 vs 16.047 s median, two ABBA rounds, ranges overlapping).

Schema v24 adds nodes.search_text and indexes it in nodes_fts; the golden
dumps re-baseline only for nodes that carry the field. Full suite 960 files
/ 11,359 passed.
@bompus bompus changed the title perf(markdown): keep commands and table rows in their section fix(markdown): fold commands and table rows into their section Nov 1, 2026

@bompus-ai-review bompus-ai-review Bot 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.

Bompus AI Review (GPT-6.1 Terra, max reasoning): 0 finding(s).

Review 3: only high findings and above are posted from here on.

@bompus
bompus merged commit 8313e9a into fork/consolidated Nov 1, 2026
3 checks passed
@bompus
bompus deleted the perf/md-model branch November 1, 2026 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author:deepseek Pull request written by a deepseek model

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant