Skip to content

docs: surface SQL + ANTLR across stalled pages, add PR-comment screenshot#172

Merged
tinovyatkin merged 1 commit into
mainfrom
docs/sql-antlr-audit
Jul 9, 2026
Merged

docs: surface SQL + ANTLR across stalled pages, add PR-comment screenshot#172
tinovyatkin merged 1 commit into
mainfrom
docs/sql-antlr-audit

Conversation

@tinovyatkin

Copy link
Copy Markdown
Contributor

Summary

Audits and refreshes documentation that had drifted behind two recent additions — the SQL analyzer (mehen-sql / sqruff) and the ANTLR backend (Kotlin, Java). Every claim was verified against the codebase (crates/, Cargo.toml pins, xtask targets, mehen-report, mehen-engine/src/diff.rs) before editing.

Motivation

Several pages still described a pre-SQL, pre-ANTLR mehen:

  • SQL — a genuinely differentiating feature — was barely mentioned on the landing pages.
  • Kotlin was miscredited as tree-sitter-backed after its move to ANTLR.
  • index.mdx said "nine source languages" and omitted Java and SQL entirely.
  • The "Update grammars" page listed tree-sitter-markdown-text, which the code no longer references at all.
  • Two features had shipped ahead of the prose: the GitHub Action's Documentation Metrics section (a stale <Note> claimed only source-code metrics ship) and mehen diff --fail-on doc gating (documented as "planned").

Changes

Page What changed
introduction.mdx New First-class SQL analysis section + headline SQL card + SQL in What mehen computes; fixed parser card (Kotlin/Java = ANTLR, add sqruff).
index.mdx "nine" → "eleven" languages + SQL/Markdown; added SQL card & compute block; fixed Kotlin-as-tree-sitter; added Java/sqruff.
concepts/architecture.mdx Added mehen-antlr + mehen-sql crates, Java + SQL parser rows, pipeline-diagram update, and new ANTLR-backed analyzers / SQL is its own metric family sections.
developers/update-grammars.mdx Removed dead tree-sitter-markdown-text; corrected the pinning model (inline per-crate via __grammar_language()); noted PowerShell has no grammar.rs and isn't a codegen target.
developers/overview.mdx Added mehen-java + mehen-sql to repo layout; ANTLR prereq now covers Java.
guides/github-action.mdx Replaced stale "only source-code ships" note (docs-diff is a default feature, wired at diff.rs:692); documented SQL in the diff; embedded screenshot.
guides/pr-comment-design.mdx Documented the shipped --fail-on gating; embedded screenshot.
docs/images/pr-comment-metrics.png New — real sticky-comment screenshot showing both the Source Code and Documentation Metrics tables.

Verification

  • ✅ All 43 internal links in edited files resolve to real pages.
  • ✅ MDX/JSX tag balance checked (<Frame>/<Card>/<Tabs> closed, <img> self-closed).
  • ✅ Language count reconciled to 11 across index, introduction, supported-languages.
  • ✅ Zero remaining stale references (markdown-text, "nine source", Kotlin-as-tree-sitter, stale Note).
  • ⚠️ mint validate / mint broken-links not run — the mint CLI requires an LTS Node (local env is Node 26). Substituted manual link-resolution + tag-balance checks. Worth a CI/LTS pass.

Docs-only; no code or behavior changes.

…shot

Audit and refresh docs that lagged behind the SQL (mehen-sql/sqruff) and
ANTLR (Kotlin, Java) additions.

- introduction: promote SQL to a first-class feature — headline card, a
  dedicated "First-class SQL analysis" section, and an SQL entry in
  "What mehen computes"; fix the parser card (Kotlin/Java are ANTLR, add
  sqruff) and mention SQL in the intro line.
- index: "nine" -> "eleven" source languages plus SQL and Markdown; add
  SQL card + compute block; fix Kotlin miscredited as tree-sitter; add
  Java/sqruff to the parser card.
- concepts/architecture: add mehen-antlr and mehen-sql to the crate
  table, Java + SQL rows to the parser table and pipeline diagram, and
  new "ANTLR-backed analyzers" and "SQL is its own metric family"
  sections.
- developers/update-grammars: drop the removed tree-sitter-markdown-text
  grammar; correct the pinning model (inline per-crate, xtask reaches it
  via __grammar_language()); note PowerShell has no generated grammar.rs
  and is not a codegen target.
- developers/overview: add mehen-java and mehen-sql to the repo layout;
  ANTLR regeneration prereq covers Java too.
- guides/github-action: replace the stale "only source-code metrics
  ship" note (docs-diff is a default feature and is wired into the diff
  path); document SQL in the diff; embed the sticky-comment screenshot.
- guides/pr-comment-design: document the shipped --fail-on gating
  (dmi-drop, new-broken-link, filler-high, all) instead of "planned";
  embed the screenshot.
- add docs/images/pr-comment-metrics.png.
@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

The documentation now covers ANTLR-backed analyzers, Java grammar maintenance, SQL’s dedicated metric family, and revised tree-sitter workflows. Landing and introduction pages expand product descriptions and SQL metric listings. GitHub Action and PR comment guides document sticky comment layouts, SQL diff output, Markdown metrics, and active --fail-on gating behavior.

Poem

I’m a rabbit with docs in my den,
SQL hops through the parser again.
ANTLR ears point the way,
Grammar pins keep work in array,
Sticky comments sparkle bright—
Metrics guide the review tonight!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main docs refresh around SQL, ANTLR, and the new PR-comment screenshot.
Description check ✅ Passed The description is clearly aligned with the documentation updates and matches the changeset scope.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates the documentation to reflect the addition of ANTLR-backed analyzers for Kotlin and Java, as well as a new SQL analyzer (mehen-sql) powered by sqruff. It also documents the GitHub Action sticky comment layout, --fail-on gating, and the architecture of these new components. The review feedback suggests capitalizing SQL dialect names (such as PostgreSQL, Snowflake, and BigQuery) across the documentation for consistency.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

| Rust | [`ra_ap_syntax`](https://docs.rs/ra_ap_syntax/) | The same syntax library rust-analyzer uses internally. |
| Kotlin | [ANTLR](https://www.antlr.org/) (official [Kotlin spec grammar](https://github.com/Kotlin/kotlin-spec)) | Semantically-named rules for `when` entries, elvis `?:`, safe-call `?.`, `catch` blocks, labeled jumps, and property accessors — richer than a tree-sitter CST. |
| Java | [ANTLR](https://www.antlr.org/) ([grammars-v4 Java grammar](https://github.com/antlr/grammars-v4/tree/master/java/java)) | Records, sealed types, switch expressions, text blocks, pattern matching, modules — as first-class, semantically-named rules. |
| SQL | [sqruff](https://github.com/quarylabs/sqruff) | Dialect-aware SQL CST (postgres, T-SQL, snowflake, bigquery, …) for CTE/join/subquery structure and object-touch analysis. |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

For consistency and professional presentation, capitalize the names of the SQL dialects (e.g., PostgreSQL, Snowflake, BigQuery).

| SQL | [sqruff](https://github.com/quarylabs/sqruff) | Dialect-aware SQL CST (PostgreSQL, T-SQL, Snowflake, BigQuery, …) for CTE/join/subquery structure and object-touch analysis. |

Comment thread docs/introduction.mdx
file-level **review-burden index** and **change-risk score**.

Dialect is inferred from syntax with a reported confidence (or pinned with a `-- sqlfluff:dialect:…`
directive) across postgres, T-SQL, snowflake, bigquery, and more. SQL files are picked up

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Capitalize the SQL dialect names (PostgreSQL, Snowflake, BigQuery) to ensure consistent formatting across all documentation pages.

directive) across PostgreSQL, T-SQL, Snowflake, BigQuery, and more. SQL files are picked up

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 72926def47

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +40 to +41
The Python, TypeScript / JavaScript / TSX / JSX, PHP, Ruby, Rust, Kotlin, Java, SQL, and Markdown
analyzers do **not** use tree-sitter; they have no `grammar.rs` and need no kind-enum regeneration.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Correct the Markdown grammar guidance

This new guidance says the Markdown analyzer has no grammar.rs, but crates/mehen-markdown/src/grammar.rs exists, is marked generated, and is used by the pulldown-backed syntax tree via crate::grammar::Markdown. Following this doc can mislead contributors into ignoring or hand-editing the generated Markdown kind enum; please remove Markdown from the “no grammar.rs” list or clarify that its generated enum is separate from the tree-sitter regeneration flow.

Useful? React with 👍 / 👎.

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/index.mdx`:
- Around line 67-72: Add “modularity health” to the “For SQL” metric list in
docs/index.mdx, matching the terminology used in docs/introduction.mdx and the
sql.modularity_health composite score in the report output.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 45e6349a-734f-43ed-bcca-c289c87af52d

📥 Commits

Reviewing files that changed from the base of the PR and between 33c491e and 72926de.

⛔ Files ignored due to path filters (1)
  • docs/images/pr-comment-metrics.png is excluded by !**/*.png
📒 Files selected for processing (7)
  • docs/concepts/architecture.mdx
  • docs/developers/overview.mdx
  • docs/developers/update-grammars.mdx
  • docs/guides/github-action.mdx
  • docs/guides/pr-comment-design.mdx
  • docs/index.mdx
  • docs/introduction.mdx

Comment thread docs/index.mdx
Comment on lines +67 to +72
For SQL:

- [Structural and cognitive complexity](/metrics/sql/overview) from CTE, join, subquery, `CASE`, and
window structure; a [Review Burden Index](/metrics/sql/overview) and [Change Risk
Score](/metrics/sql/overview); an [SQL Halstead](/metrics/sql/overview) and maintainability index.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Add "modularity health" to the "For SQL" metric list for consistency.

The "For SQL" section here omits modularity health, which is listed in the corresponding section in docs/introduction.mdx (Line 128) and is confirmed as a rendered composite score in crates/mehen-report/src/markdown.rs (sql.modularity_health in the "Composite scores" group). Adding it keeps the landing page accurate with both the introduction page and the actual report output.

📝 Proposed fix
 - [Structural and cognitive complexity](/metrics/sql/overview) from CTE, join, subquery, `CASE`, and
   window structure; a [Review Burden Index](/metrics/sql/overview) and [Change Risk
-  Score](/metrics/sql/overview); an [SQL Halstead](/metrics/sql/overview) and maintainability index.
+  Score](/metrics/sql/overview); an [SQL Halstead](/metrics/sql/overview), maintainability index,
+  and modularity health.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
For SQL:
- [Structural and cognitive complexity](/metrics/sql/overview) from CTE, join, subquery, `CASE`, and
window structure; a [Review Burden Index](/metrics/sql/overview) and [Change Risk
Score](/metrics/sql/overview); an [SQL Halstead](/metrics/sql/overview) and maintainability index.
For SQL:
- [Structural and cognitive complexity](/metrics/sql/overview) from CTE, join, subquery, `CASE`, and
window structure; a [Review Burden Index](/metrics/sql/overview) and [Change Risk
Score](/metrics/sql/overview); an [SQL Halstead](/metrics/sql/overview), maintainability index,
and modularity health.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/index.mdx` around lines 67 - 72, Add “modularity health” to the “For
SQL” metric list in docs/index.mdx, matching the terminology used in
docs/introduction.mdx and the sql.modularity_health composite score in the
report output.

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Binary Size Report

Measured artifact: release Linux mehen binary built from this workflow.

Size
main 30MiB
This PR 30MiB
Delta +317KiB (+1.05%)
Size history
xychart-beta
  title "Binary size (bytes)"
  x-axis ["feat(sql): SQL metrics analyze", "build(deps): bump ra_ap_syntax", "build(deps): bump gix from 0.8", "build(deps): bump log from 0.4", "build(deps): bump the ruff gro", "build(deps): bump the mago gro", "build: sync workspace crate ve", "build(deps): bump the oxc grou", "build(deps): bump tree-sitter ", "build(deps): bump camino from ", "feat: add Java analyzer and up", "build(deps): bump sqruff-lib-d", "build(deps): bump the mago gro", "build(deps): bump ra_ap_syntax", "build(deps): bump the oxc grou", "build(deps): bump mago-syntax-", "chore(main): release 1.3.0 (#1", "This PR"]
  y-axis "Bytes"
  bar [29151520, 29151560, 29154336, 29184128, 29154616, 29184664, 29184664, 29194704, 29194696, 29194704, 30767472, 30833880, 30833888, 30834016, 30811952, 30811944, 30811984, 31135680]
Loading

@tinovyatkin tinovyatkin merged commit fb39b70 into main Jul 9, 2026
9 of 10 checks passed
@tinovyatkin tinovyatkin deleted the docs/sql-antlr-audit branch July 9, 2026 23:06
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.

1 participant