# shanhuang08/xmind_reader architecture

> Architecture diagram of the GitHub repository shanhuang08/xmind_reader, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shanhuang08/xmind_reader
- Repository: https://github.com/shanhuang08/xmind_reader

## Overview

This is a Vendor API test-knowledge management tool. Its main workflow reads XMind, Confluence-exported documents, URLs, or PDFs into vendor-detail knowledge, then builds and validates generated test cases and writes a MeterSphere-compatible XMind. The graph also preserves the separate Rovo Confluence Phase 0 spike. Connections are limited to README statements and SOURCE INDEX references; several reader internals and the Phase 0 implementation were not sampled.

Main entry points: [`main.py`](https://github.com/shanhuang08/xmind_reader/blob/main/main.py) (Unified CLI), [`src/generator_main.py`](https://github.com/shanhuang08/xmind_reader/blob/main/src/generator_main.py) (Generation entry), [`src/xmind_reader_main.py`](https://github.com/shanhuang08/xmind_reader/blob/main/src/xmind_reader_main.py) (XMind reader), [`src/doc_reader_main.py`](https://github.com/shanhuang08/xmind_reader/blob/main/src/doc_reader_main.py) (Document reader)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Knowledge ingestion"]
  node_xmind_ingest["XMind reader"]
  node_xmind_parse["XMind parser<br/>[xmind_parser.py]"]
  node_knowledge_extract["Case extraction"]
  node_chunking["Knowledge chunking"]
  node_knowledge_export["Knowledge exporters"]
end

subgraph group_vendor["Vendor documentation"]
  node_doc_reader["Document reader<br/>[doc_reader_main.py]"]
  node_doc_parse["Document parser<br/>[doc_parser.py]"]
  node_doc_extract["Vendor detail extraction<br/>[doc_extractor.py]"]
  node_parameter_dependency["Parameter dependencies"]
  node_doc_export["Vendor detail export<br/>[doc_exporter.py]"]
  node_url_reader["URL reader<br/>[url_reader_main.py]"]
  node_url_fetch["URL fetching<br/>[url_fetcher.py]"]
  node_url_processing["URL content indexing"]
  node_pdf_reader["PDF reader<br/>[pdf_reader_main.py]"]
  node_pdf_index["PDF endpoint index"]
  node_pdf_processing["PDF section processing"]
  node_vendor_orchestrator["New-vendor workflow<br/>[new_vendor_main.py]"]
end

subgraph group_generation["Test generation"]
  node_generation_cli["Generation entry<br/>[generator_main.py]"]
  node_draft["Draft builder<br/>[draft_builder.py]"]
  node_draft_schema["Draft schema<br/>[draft_schema.py]"]
  node_draft_validation["Draft validation<br/>[draft_validator.py]"]
  node_case_context["Generation context"]
  node_endpoint_analysis["Endpoint analysis"]
  node_behavior_mapping["Behavior mapping"]
  node_multi_error["Error policy"]
  node_reference_selector["Reference selection"]
  node_human_merge["Human XMind merger"]
end

subgraph group_xmindout["XMind output"]
  node_xmind_writer["MeterSphere XMind writer"]
  node_xmind_validation["XMind validation<br/>[xmind_validator.py]"]
end

subgraph group_phase0["Confluence spike"]
  node_phase0_runner["Rovo Phase 0 runner<br/>[run_rovo_phase0.py]"]
end

node_user(("Engineer"))
node_cli["Unified CLI<br/>[main.py]"]
node_confluence(("Confluence"))
node_vendor_web(("Vendor API docs"))

node_user -->|"runs command"| node_cli
node_cli -->|"dispatches XMind"| node_xmind_ingest
node_cli -->|"dispatches docs"| node_doc_reader
node_cli -->|"dispatches PDF"| node_pdf_reader
node_cli -->|"dispatches URL"| node_url_reader
node_cli -->|"dispatches generation"| node_generation_cli
node_cli -->|"dispatches vendor"| node_vendor_orchestrator
node_xmind_ingest -->|"parses maps"| node_xmind_parse
node_xmind_ingest -->|"extracts cases"| node_knowledge_extract
node_xmind_ingest -->|"creates chunks"| node_chunking
node_xmind_ingest -->|"exports knowledge"| node_knowledge_export
node_doc_reader -->|"parses documents"| node_doc_parse
node_doc_reader -->|"extracts details"| node_doc_extract
node_doc_reader -->|"exports details"| node_doc_export
node_doc_extract -->|"uses dependencies"| node_parameter_dependency
node_confluence -->|"provides exports"| node_doc_reader
node_vendor_web -->|"provides pages"| node_url_reader
node_url_reader -->|"fetches content"| node_url_fetch
node_url_reader -->|"indexes content"| node_url_processing
node_vendor_web -->|"provides PDFs"| node_pdf_reader
node_pdf_reader -->|"indexes endpoints"| node_pdf_index
node_pdf_reader -->|"processes sections"| node_pdf_processing
node_vendor_orchestrator -->|"runs document read"| node_doc_reader
node_vendor_orchestrator -->|"runs XMind read"| node_xmind_ingest
node_vendor_orchestrator -->|"runs generation"| node_generation_cli
node_generation_cli -->|"builds context"| node_case_context
node_generation_cli -->|"builds draft"| node_draft
node_generation_cli -->|"merges edits"| node_human_merge
node_generation_cli -->|"writes cases"| node_xmind_writer
node_generation_cli -->|"validates output"| node_xmind_validation
node_draft -->|"analyzes endpoints"| node_endpoint_analysis
node_draft -->|"maps behavior"| node_behavior_mapping
node_draft_validation -->|"checks schema"| node_draft_schema
node_draft_validation -->|"checks mapping"| node_behavior_mapping
node_case_context -->|"selects error policy"| node_multi_error
node_human_merge -->|"uses draft schema"| node_draft_schema
node_human_merge -->|"reads source map"| node_xmind_parse
node_xmind_writer -->|"uses case schema"| node_draft_schema
node_xmind_writer -->|"validates draft"| node_draft_validation
node_xmind_writer -->|"uses behavior mapping"| node_behavior_mapping
node_user -->|"runs isolated spike"| node_phase0_runner
node_phase0_runner -.->|"reads pages"| node_confluence

click node_cli "https://github.com/shanhuang08/xmind_reader/blob/main/main.py"
click node_xmind_ingest "https://github.com/shanhuang08/xmind_reader/blob/main/src/xmind_reader_main.py"
click node_xmind_parse "https://github.com/shanhuang08/xmind_reader/blob/main/src/xmind_reader/xmind_parser.py"
click node_knowledge_extract "https://github.com/shanhuang08/xmind_reader/blob/main/src/extractor/knowledge_extractor.py"
click node_chunking "https://github.com/shanhuang08/xmind_reader/blob/main/src/chunker/knowledge_chunker.py"
click node_knowledge_export "https://github.com/shanhuang08/xmind_reader/tree/main/src/exporters"
click node_doc_reader "https://github.com/shanhuang08/xmind_reader/blob/main/src/doc_reader_main.py"
click node_doc_parse "https://github.com/shanhuang08/xmind_reader/blob/main/src/doc_reader/doc_parser.py"
click node_doc_extract "https://github.com/shanhuang08/xmind_reader/blob/main/src/doc_reader/doc_extractor.py"
click node_parameter_dependency "https://github.com/shanhuang08/xmind_reader/blob/main/src/doc_reader/parameter_dependency.py"
click node_doc_export "https://github.com/shanhuang08/xmind_reader/blob/main/src/doc_reader/doc_exporter.py"
click node_url_reader "https://github.com/shanhuang08/xmind_reader/blob/main/src/url_reader_main.py"
click node_url_fetch "https://github.com/shanhuang08/xmind_reader/blob/main/src/url_reader/url_fetcher.py"
click node_url_processing "https://github.com/shanhuang08/xmind_reader/tree/main/src/url_reader"
click node_pdf_reader "https://github.com/shanhuang08/xmind_reader/blob/main/src/pdf_reader_main.py"
click node_pdf_index "https://github.com/shanhuang08/xmind_reader/blob/main/src/pdf_reader/pdf_endpoint_indexer.py"
click node_pdf_processing "https://github.com/shanhuang08/xmind_reader/tree/main/src/pdf_reader"
click node_vendor_orchestrator "https://github.com/shanhuang08/xmind_reader/blob/main/src/new_vendor_main.py"
click node_generation_cli "https://github.com/shanhuang08/xmind_reader/blob/main/src/generator_main.py"
click node_draft "https://github.com/shanhuang08/xmind_reader/blob/main/src/generator/draft_builder.py"
click node_draft_schema "https://github.com/shanhuang08/xmind_reader/blob/main/src/generator/draft_schema.py"
click node_draft_validation "https://github.com/shanhuang08/xmind_reader/blob/main/src/generator/draft_validator.py"
click node_case_context "https://github.com/shanhuang08/xmind_reader/blob/main/src/generator/case_generation_context.py"
click node_endpoint_analysis "https://github.com/shanhuang08/xmind_reader/blob/main/src/generator/endpoint_analyzer.py"
click node_behavior_mapping "https://github.com/shanhuang08/xmind_reader/blob/main/src/generator/user_behavior_mapping.py"
click node_multi_error "https://github.com/shanhuang08/xmind_reader/blob/main/src/generator/multi_error_policy.py"
click node_reference_selector "https://github.com/shanhuang08/xmind_reader/blob/main/src/generator/reference_selector.py"
click node_human_merge "https://github.com/shanhuang08/xmind_reader/blob/main/src/generator/human_xmind_merger.py"
click node_xmind_writer "https://github.com/shanhuang08/xmind_reader/blob/main/src/xmind_writer/metersphere_xmind_writer.py"
click node_xmind_validation "https://github.com/shanhuang08/xmind_reader/blob/main/src/xmind_writer/xmind_validator.py"
click node_phase0_runner "https://github.com/shanhuang08/xmind_reader/blob/main/scripts/run_rovo_phase0.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_xmind_ingest,node_xmind_parse,node_knowledge_extract,node_chunking,node_knowledge_export toneBlue
class node_doc_reader,node_doc_parse,node_doc_extract,node_parameter_dependency,node_doc_export,node_url_reader,node_url_fetch,node_url_processing,node_pdf_reader,node_pdf_index,node_pdf_processing,node_vendor_orchestrator toneAmber
class node_generation_cli,node_draft,node_draft_schema,node_draft_validation,node_case_context,node_endpoint_analysis,node_behavior_mapping,node_multi_error,node_reference_selector,node_human_merge,node_vendor_web toneMint
class node_xmind_writer,node_xmind_validation toneRose
class node_phase0_runner,node_user,node_confluence toneIndigo
class node_cli toneTeal
```

## Components

### Knowledge ingestion

- [XMind reader](https://github.com/shanhuang08/xmind_reader/blob/main/src/xmind_reader_main.py): `src/xmind_reader_main.py`
- [XMind parser](https://github.com/shanhuang08/xmind_reader/blob/main/src/xmind_reader/xmind_parser.py): `src/xmind_reader/xmind_parser.py`
- [Case extraction](https://github.com/shanhuang08/xmind_reader/blob/main/src/extractor/knowledge_extractor.py): `src/extractor/knowledge_extractor.py`
- [Knowledge chunking](https://github.com/shanhuang08/xmind_reader/blob/main/src/chunker/knowledge_chunker.py): `src/chunker/knowledge_chunker.py`
- [Knowledge exporters](https://github.com/shanhuang08/xmind_reader/tree/main/src/exporters): `src/exporters`

### Vendor documentation

- [Document reader](https://github.com/shanhuang08/xmind_reader/blob/main/src/doc_reader_main.py): `src/doc_reader_main.py`
- [Document parser](https://github.com/shanhuang08/xmind_reader/blob/main/src/doc_reader/doc_parser.py): `src/doc_reader/doc_parser.py`
- [Vendor detail extraction](https://github.com/shanhuang08/xmind_reader/blob/main/src/doc_reader/doc_extractor.py): `src/doc_reader/doc_extractor.py`
- [Parameter dependencies](https://github.com/shanhuang08/xmind_reader/blob/main/src/doc_reader/parameter_dependency.py): `src/doc_reader/parameter_dependency.py`
- [Vendor detail export](https://github.com/shanhuang08/xmind_reader/blob/main/src/doc_reader/doc_exporter.py): `src/doc_reader/doc_exporter.py`
- [URL reader](https://github.com/shanhuang08/xmind_reader/blob/main/src/url_reader_main.py): `src/url_reader_main.py`
- [URL fetching](https://github.com/shanhuang08/xmind_reader/blob/main/src/url_reader/url_fetcher.py): `src/url_reader/url_fetcher.py`
- [URL content indexing](https://github.com/shanhuang08/xmind_reader/tree/main/src/url_reader): `src/url_reader`
- [PDF reader](https://github.com/shanhuang08/xmind_reader/blob/main/src/pdf_reader_main.py): `src/pdf_reader_main.py`
- [PDF endpoint index](https://github.com/shanhuang08/xmind_reader/blob/main/src/pdf_reader/pdf_endpoint_indexer.py): `src/pdf_reader/pdf_endpoint_indexer.py`
- [PDF section processing](https://github.com/shanhuang08/xmind_reader/tree/main/src/pdf_reader): `src/pdf_reader`
- [New-vendor workflow](https://github.com/shanhuang08/xmind_reader/blob/main/src/new_vendor_main.py): `src/new_vendor_main.py`

### Test generation

- [Generation entry](https://github.com/shanhuang08/xmind_reader/blob/main/src/generator_main.py): `src/generator_main.py`
- [Draft builder](https://github.com/shanhuang08/xmind_reader/blob/main/src/generator/draft_builder.py): `src/generator/draft_builder.py`
- [Draft schema](https://github.com/shanhuang08/xmind_reader/blob/main/src/generator/draft_schema.py): `src/generator/draft_schema.py`
- [Draft validation](https://github.com/shanhuang08/xmind_reader/blob/main/src/generator/draft_validator.py): `src/generator/draft_validator.py`
- [Generation context](https://github.com/shanhuang08/xmind_reader/blob/main/src/generator/case_generation_context.py): `src/generator/case_generation_context.py`
- [Endpoint analysis](https://github.com/shanhuang08/xmind_reader/blob/main/src/generator/endpoint_analyzer.py): `src/generator/endpoint_analyzer.py`
- [Behavior mapping](https://github.com/shanhuang08/xmind_reader/blob/main/src/generator/user_behavior_mapping.py): `src/generator/user_behavior_mapping.py`
- [Error policy](https://github.com/shanhuang08/xmind_reader/blob/main/src/generator/multi_error_policy.py): `src/generator/multi_error_policy.py`
- [Reference selection](https://github.com/shanhuang08/xmind_reader/blob/main/src/generator/reference_selector.py): `src/generator/reference_selector.py`
- [Human XMind merger](https://github.com/shanhuang08/xmind_reader/blob/main/src/generator/human_xmind_merger.py): `src/generator/human_xmind_merger.py`

### XMind output

- [MeterSphere XMind writer](https://github.com/shanhuang08/xmind_reader/blob/main/src/xmind_writer/metersphere_xmind_writer.py): `src/xmind_writer/metersphere_xmind_writer.py`
- [XMind validation](https://github.com/shanhuang08/xmind_reader/blob/main/src/xmind_writer/xmind_validator.py): `src/xmind_writer/xmind_validator.py`

### Confluence spike

- [Rovo Phase 0 runner](https://github.com/shanhuang08/xmind_reader/blob/main/scripts/run_rovo_phase0.py): `scripts/run_rovo_phase0.py`

### Other components

- **Engineer**
- [Unified CLI](https://github.com/shanhuang08/xmind_reader/blob/main/main.py): `main.py`
- **Confluence**
- **Vendor API docs**

## Connections

- Engineer → Unified CLI: runs command
- Unified CLI → XMind reader: dispatches XMind (evidence: `main.py`)
- Unified CLI → Document reader: dispatches docs (evidence: `main.py`)
- Unified CLI → PDF reader: dispatches PDF (evidence: `main.py`)
- Unified CLI → URL reader: dispatches URL (evidence: `main.py`)
- Unified CLI → Generation entry: dispatches generation (evidence: `main.py`)
- Unified CLI → New-vendor workflow: dispatches vendor (evidence: `main.py`)
- XMind reader → XMind parser: parses maps (evidence: `src/xmind_reader_main.py`)
- XMind reader → Case extraction: extracts cases (evidence: `src/xmind_reader_main.py`)
- XMind reader → Knowledge chunking: creates chunks (evidence: `src/xmind_reader_main.py`)
- XMind reader → Knowledge exporters: exports knowledge (evidence: `src/xmind_reader_main.py`)
- Document reader → Document parser: parses documents (evidence: `src/doc_reader_main.py`)
- Document reader → Vendor detail extraction: extracts details (evidence: `src/doc_reader_main.py`)
- Document reader → Vendor detail export: exports details (evidence: `src/doc_reader_main.py`)
- Vendor detail extraction → Parameter dependencies: uses dependencies (evidence: `src/doc_reader/doc_extractor.py`)
- Confluence → Document reader: provides exports
- Vendor API docs → URL reader: provides pages
- URL reader → URL fetching: fetches content (evidence: `src/url_reader_main.py`)
- URL reader → URL content indexing: indexes content (evidence: `src/url_reader_main.py`)
- Vendor API docs → PDF reader: provides PDFs
- PDF reader → PDF endpoint index: indexes endpoints (evidence: `src/pdf_reader_main.py`)
- PDF reader → PDF section processing: processes sections (evidence: `src/pdf_reader_main.py`)
- New-vendor workflow → Document reader: runs document read (evidence: `src/new_vendor_main.py`)
- New-vendor workflow → XMind reader: runs XMind read (evidence: `src/new_vendor_main.py`)
- New-vendor workflow → Generation entry: runs generation (evidence: `src/new_vendor_main.py`)
- Generation entry → Generation context: builds context (evidence: `src/generator_main.py`)
- Generation entry → Draft builder: builds draft (evidence: `src/generator_main.py`)
- Generation entry → Human XMind merger: merges edits (evidence: `src/generator_main.py`)
- Generation entry → MeterSphere XMind writer: writes cases (evidence: `src/generator_main.py`)
- Generation entry → XMind validation: validates output (evidence: `src/generator_main.py`)
- Draft builder → Endpoint analysis: analyzes endpoints (evidence: `src/generator/draft_builder.py`)
- Draft builder → Behavior mapping: maps behavior (evidence: `src/generator/draft_builder.py`)
- Draft validation → Draft schema: checks schema (evidence: `src/generator/draft_validator.py`)
- Draft validation → Behavior mapping: checks mapping (evidence: `src/generator/draft_validator.py`)
- Generation context → Error policy: selects error policy (evidence: `src/generator/case_generation_context.py`)
- Human XMind merger → Draft schema: uses draft schema (evidence: `src/generator/human_xmind_merger.py`)
- Human XMind merger → XMind parser: reads source map (evidence: `src/generator/human_xmind_merger.py`)
- MeterSphere XMind writer → Draft schema: uses case schema (evidence: `src/xmind_writer/metersphere_xmind_writer.py`)
- MeterSphere XMind writer → Draft validation: validates draft (evidence: `src/xmind_writer/metersphere_xmind_writer.py`)
- MeterSphere XMind writer → Behavior mapping: uses behavior mapping (evidence: `src/xmind_writer/metersphere_xmind_writer.py`)
- Engineer → Rovo Phase 0 runner: runs isolated spike
- Rovo Phase 0 runner → Confluence: reads pages
