How syamchand123/glassmarble works
GlassMarble is a local-first codebase architecture graph tool. Its main workflow is gmb analyze: source files are parsed, normalized into a common representation, aggregated and semantically linked, then committed as the Architecture Knowledge Graph (AKG). Product capabilities derive diagrams, dependency and drift findings, impact answers, grounded AI responses, and living documentation from that graph; intelligence can also produce snapshots and architectural change events. The README documents the analysis stages and capabilities; sampled source supports the documentation, diagram, AI, and intelligence internals, but not every CLI handler or subsystem connection.
Main entry points: schema_v3.go Architecture graph · root.go CLI commands · engine.go Grounded AI · doc_engine.go Documentation engine
Components 21
User interfaces
- CLI commands
cmd/root.go - MCP server
internal/mcp/server.go
Graph construction
- Source ingestion
internal/code_analysis_engine/ingest/engine.go - GAST normalization
internal/code_analysis_engine/normalize/normalizer.go - Topology aggregation
internal/code_analysis_engine/aggregate/aggregator.go - Semantic linking
internal/code_analysis_engine/link/linker.go
Architecture insight
- Architecture intelligence
internal/arch_intelligence/engine.go
Graph capabilities
- Diagram pipeline
internal/product/pipeline.go - Diagram extraction and rendering
internal/visualization_engine/renderer.go - Impact analysis
internal/impact_analyzer/analyzer.go - Drift analysis
internal/drift/drift.go - Architecture lint
internal/arch_linter/engine.go - Grounded AI
internal/ai_engine/engine.go - Documentation engine
internal/doc_engine/doc_engine.go - Documentation renderer
internal/doc_engine/renderer/engine.go
Local state
- Architecture graph
internal/akg/schema_v3.go - Snapshots and timeline
internal/arch_timeline/store.go - Documentation state
internal/doc_engine/storage/store_sqlite.go
Other components
- Engineer
- LLM providers
- Source repository
Connections 24
- Engineer → CLI commands: runs commands
- Engineer → MCP server: uses tools
- Source repository → Source ingestion: reads source
- CLI commands → Source ingestion: starts analysis
- Source ingestion → GAST normalization: parsed output
- GAST normalization → Topology aggregation: normalized code
- Topology aggregation → Semantic linking: topology
- Semantic linking → Architecture graph: commits graph
- Architecture graph → Architecture intelligence: analyzes graph
- Architecture intelligence → Snapshots and timeline: builds snapshots
- Architecture graph → Diagram pipeline: supplies graph
- Diagram pipeline → Diagram extraction and rendering: builds diagrams
- Architecture graph → Impact analysis: supports analysis
- Architecture graph → Drift analysis: supports analysis
- Architecture graph → Architecture lint: checks rules
- CLI commands → Grounded AI: asks questions
- Grounded AI → Architecture graph: retrieves evidence
- Grounded AI → LLM providers: sends requests
- CLI commands → Documentation engine: runs documentation
- Documentation engine → Architecture graph: grounds documents
- Documentation engine → Documentation renderer: renders sections
- Documentation renderer → LLM providers: requests prose
- Documentation renderer → Documentation state: persists state
- MCP server → Architecture graph: exposes graph tools