Skip to content

docs(architecture): expand diagrams with data-flow and check pipeline detail #265

@Alberto-Codes

Description

@Alberto-Codes

Problem

The architecture page has one Mermaid flowchart showing the high-level CLI/LSP paths converging on the shared checks layer. While correct, it omits several important paths that contributors and power users need to understand:

  • Configuration loading from pyproject.toml
  • File discovery mechanisms (git diff, --staged, --all, positional args, --files)
  • The exit code / output pipeline (findings → reporting → exit code 0/1/2)
  • How freshness diff mode maps git hunks to AST symbols

Mermaid support is already enabled in mkdocs.yml via pymdownx.superfences — we're just underusing it.

Proposed changes

1. Enhance existing high-level flowchart

Add nodes for:

  • pyproject.toml config loading
  • File discovery (with mode labels: diff/staged/all/positional)
  • Reporting output (text/markdown/JSON)
  • Exit code determination

2. Add data-flow diagram

A second Mermaid diagram showing the complete data flow:

pyproject.toml → Config → CLI args merge → Discovery mode selection
  → File list → Per-file: AST parse → Check dispatch
  → Findings collection → Reporting format → Exit code

3. Optional: Add freshness-specific diagram

Show the diff-mode pipeline:

git diff → hunks → line ranges → AST symbol mapping → severity classification → findings

This is the most complex check and the one contributors most often need to understand.

Not in scope

  • Diagrams on other pages (check pages, rule pages) — keep it on architecture
  • Interactive or animated diagrams
  • Diagram freshness tracking automation (future docfresh territory)

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions