How martinzsir/investigation works
孙武侦查官 is a single-machine investigative analysis application: it ingests and standardizes case data, aligns people and organizations, generates and checks hypotheses, runs specialist analyses, and produces traceable clues for human review and disposition. Its documented skills cover scenario planning, bidirectional inventory, anomaly scanning, task division, and cross-source intelligence. DuckDB and Parquet form the primary storage path; Redis and LadybugDB are documented optional layers. The graph uses README claims where implementation excerpts were unavailable, so some subsystem links are intentionally omitted.
Main entry points: run_all.py Case Workflow · registry.py Skill Registry · store.py Storage Interface · xu_shi.py Anomaly Scanning
Components 25
Intake & Identity
- Case Workflow
run_all.py - Data Adapters
data_ingest.py - Entity Resolution
entity_resolution.py - Organization Alignment
core/entity.py
Investigation Analysis
- Hypothesis Engine
core/hypotheses.py - Sampling Preflight
core/sampling.py - Schema & Redlines
core/validate.py - Scenario Planning
skills/miaosuan.py - Bidirectional Inventory
skills/zhi_ji_zhi_bi.py - Anomaly Scanning
skills/xu_shi.py - Task Division
skills/qi_zheng.py - Cross-Source Intelligence
skills/yong_jian.py
Clues & Review
- Merge Review
core/review.py - Skill Registry
core/registry.py - Skill Adapters
skills/registry_bootstrap.py - Clue Lineage
core/lineage.py - Clue Disposition
core/disposal.py
Storage & Graph
- Storage Interface
core/store.py - DuckDB
- Case Partitions
data - Redis L1
- LadybugDB
- Partition Updates
scripts/incremental.py - Graph Export
scripts/export_ladybug.py
Other components
- Investigator
Connections 29
- Investigator → Case Workflow: starts workflow
- Case Workflow → Data Adapters: ingests files
- Data Adapters → Storage Interface: writes tables
- Case Workflow → Entity Resolution: aligns entities
- Entity Resolution → Organization Alignment: builds org alignment
- Case Workflow → Merge Review: requests decisions
- Case Workflow → Sampling Preflight: preflights hypotheses
- Case Workflow → Hypothesis Engine: builds hypotheses
- Hypothesis Engine → Schema & Redlines: checks constraints
- Case Workflow → Scenario Planning: runs planning
- Case Workflow → Bidirectional Inventory: runs inventory
- Case Workflow → Anomaly Scanning: runs scans
- Case Workflow → Task Division: runs task division
- Case Workflow → Cross-Source Intelligence: runs cross-check
- Anomaly Scanning → Case Partitions: queries partitions
- Anomaly Scanning → Storage Interface: executes queries
- Storage Interface → DuckDB: reads and writes
- Skill Adapters → Skill Registry: registers handlers
- Skill Registry → Anomaly Scanning: dispatches skill
- Skill Registry → Task Division: dispatches skill
- Skill Registry → Cross-Source Intelligence: dispatches skill
- Skill Registry → Clue Lineage: returns traced clues
- Case Workflow → Clue Lineage: merges and prioritizes
- Clue Lineage → Clue Disposition: tracks disposition
- Clue Disposition → Storage Interface: persists status
- Partition Updates → DuckDB: updates aggregates
- Graph Export → DuckDB: reads edge data
- Graph Export → LadybugDB: materializes edges
- Storage Interface → Redis L1: optional hot cache