# lacania/receiver-state-hypothesis-selection architecture

> Architecture diagram of the GitHub repository lacania/receiver-state-hypothesis-selection, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/lacania/receiver-state-hypothesis-selection
- Repository: https://github.com/lacania/receiver-state-hypothesis-selection

## Overview

This is a source-only archive for Receiver-State Hypothesis Selection in Doppler-only LEO positioning, accompanied by manual experiment and GNSS/GVINS analysis workflows. The principal workflow prepares observations, evaluates candidate receiver-state models, selects a hypothesis using validation and evidence, then evaluates results against truth or references where the protocol permits. The graph emphasizes documented M0–M14 selection, D2, and GNSS mechanisms. Wiring is conservative: sampled excerpts establish only some calls; unsampled capabilities are represented without speculative links.

Main entry points: [`src/flagship/native_runtime.py`](https://github.com/lacania/receiver-state-hypothesis-selection/blob/main/src/flagship/native_runtime.py) (Runtime adapter), [`src/leo_positioning/solvers.py`](https://github.com/lacania/receiver-state-hypothesis-selection/blob/main/src/leo_positioning/solvers.py) (State solvers), [`manual_workflows/tree/leo-c/tmp/d2_execution_r1/stage_methods.py`](https://github.com/lacania/receiver-state-hypothesis-selection/blob/main/manual_workflows/tree/leo-c/tmp/d2_execution_r1/stage_methods.py) (D2 method stage), [`manual_workflows/tree/leo-c/_new_solver_lab/paper_draft/holdout_experiments/paper_exp01_run_holdout.py`](https://github.com/lacania/receiver-state-hypothesis-selection/blob/main/manual_workflows/tree/leo-c/_new_solver_lab/paper_draft/holdout_experiments/paper_exp01_run_holdout.py) (Holdout runner)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_positioning["Positioning runtime"]
  node_native_runtime["Runtime adapter<br/>[native_runtime.py]"]
  node_models["Candidate models<br/>[models.py]"]
  node_candidates["Candidate builders"]
  node_solvers["State solvers<br/>[solvers.py]"]
  node_trajectory["Trajectory models"]
  node_evidence["Evidence gates<br/>[model_evidence.py]"]
  node_scoring["Model scoring<br/>[model_scoring.py]"]
  node_selector["Hypothesis selector"]
  node_diagnostics["Quality diagnostics<br/>[quality.py]"]
end

subgraph group_evaluation["Experiment evaluation"]
  node_d2_methods["D2 method stage<br/>[stage_methods.py]"]
  node_d2_truth["D2 truth evaluation"]
  node_holdout["Holdout runner"]
end

subgraph group_gnss["GNSS workflows"]
  node_extract["GNSS extraction<br/>[extract_gnss.py]"]
  node_pilot["Pilot selection<br/>[scan_and_select.py]"]
  node_wrapper["GPS-L1 wrapper<br/>[wrapper.py]"]
  node_qa["Fixed-state QA<br/>[qa.py]"]
end

subgraph group_analysis["Mechanism analysis"]
  node_adequacy["Model adequacy<br/>[analyze.py]"]
  node_shortarc["Short-arc analysis<br/>[evaluate_stage.py]"]
end

node_engineer(("Researcher"))
node_observations["Observation inputs"]
node_result["Selected state and metrics"]

node_engineer -->|"runs workflow"| node_native_runtime
node_observations -->|"provides input"| node_native_runtime
node_native_runtime -->|"builds candidates"| node_candidates
node_candidates -->|"fits states"| node_solvers
node_solvers -->|"uses models"| node_models
node_solvers -->|"uses trajectories"| node_trajectory
node_native_runtime -->|"attaches evidence"| node_evidence
node_native_runtime -->|"scores candidates"| node_scoring
node_scoring -->|"supplies scores"| node_selector
node_selector -->|"selects hypothesis"| node_result
node_native_runtime -->|"computes quality"| node_diagnostics
node_engineer -->|"runs stage"| node_d2_methods
node_d2_methods -->|"runs candidates"| node_native_runtime
node_d2_methods -->|"provides method output"| node_d2_truth
node_d2_truth -->|"evaluates against truth"| node_result
node_engineer -->|"runs protocol"| node_holdout
node_holdout -->|"runs candidates"| node_native_runtime
node_holdout -->|"writes evaluation"| node_result
node_engineer -->|"requests extraction"| node_extract
node_extract -->|"provides GNSS data"| node_pilot
node_pilot -->|"provides selected interval"| node_wrapper
node_wrapper -->|"provides forward outputs"| node_qa
node_qa -->|"reports QA"| node_result
node_engineer -->|"runs analysis"| node_adequacy
node_engineer -->|"runs analysis"| node_shortarc

click node_native_runtime "https://github.com/lacania/receiver-state-hypothesis-selection/blob/main/src/flagship/native_runtime.py"
click node_models "https://github.com/lacania/receiver-state-hypothesis-selection/blob/main/src/leo_positioning/models.py"
click node_candidates "https://github.com/lacania/receiver-state-hypothesis-selection/blob/main/src/leo_positioning/model_candidates.py"
click node_solvers "https://github.com/lacania/receiver-state-hypothesis-selection/blob/main/src/leo_positioning/solvers.py"
click node_trajectory "https://github.com/lacania/receiver-state-hypothesis-selection/blob/main/src/leo_positioning/trajectory_models.py"
click node_evidence "https://github.com/lacania/receiver-state-hypothesis-selection/blob/main/src/leo_positioning/model_evidence.py"
click node_scoring "https://github.com/lacania/receiver-state-hypothesis-selection/blob/main/src/leo_positioning/model_scoring.py"
click node_selector "https://github.com/lacania/receiver-state-hypothesis-selection/blob/main/manual_workflows/tree/flagship/21_v052_identity_repair/PAPER_FLAGSHIP_V052_INFORMATION_CRITERION_SELECTOR_PUBLICATIONIZATION/selector_parity/selector_spec_replay_v052.py"
click node_diagnostics "https://github.com/lacania/receiver-state-hypothesis-selection/blob/main/src/leo_positioning/quality.py"
click node_d2_methods "https://github.com/lacania/receiver-state-hypothesis-selection/blob/main/manual_workflows/tree/leo-c/tmp/d2_execution_r1/stage_methods.py"
click node_d2_truth "https://github.com/lacania/receiver-state-hypothesis-selection/blob/main/manual_workflows/tree/flagship/d2_corrected/source_snapshot/original_scripts/evaluate_d2_truth.py"
click node_holdout "https://github.com/lacania/receiver-state-hypothesis-selection/blob/main/manual_workflows/tree/leo-c/_new_solver_lab/paper_draft/holdout_experiments/paper_exp01_run_holdout.py"
click node_extract "https://github.com/lacania/receiver-state-hypothesis-selection/blob/main/manual_workflows/tree/leo-c_new_solver_lab/GVINS_adapter/extract_gnss.py"
click node_pilot "https://github.com/lacania/receiver-state-hypothesis-selection/blob/main/manual_workflows/tree/leo-c_new_solver_lab/GVINS_adapter/sports_field_pilot/scan_and_select.py"
click node_wrapper "https://github.com/lacania/receiver-state-hypothesis-selection/blob/main/manual_workflows/tree/leo-c_new_solver_lab/GVINS_adapter/gps_l1_wrapper/wrapper.py"
click node_qa "https://github.com/lacania/receiver-state-hypothesis-selection/blob/main/manual_workflows/tree/leo-c_new_solver_lab/GVINS_adapter/gps_l1_wrapper/qa.py"
click node_adequacy "https://github.com/lacania/receiver-state-hypothesis-selection/blob/main/manual_workflows/tree/leo-c_new_solver_lab/GVINS_adapter/w120_model_adequacy_v1/analyze.py"
click node_shortarc "https://github.com/lacania/receiver-state-hypothesis-selection/blob/main/manual_workflows/tree/leo-c_new_solver_lab/GVINS_adapter/short_arc_identifiability_v1/evaluate_stage.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_native_runtime,node_models,node_candidates,node_solvers,node_trajectory,node_evidence,node_scoring,node_selector,node_diagnostics toneBlue
class node_d2_methods,node_d2_truth,node_holdout toneAmber
class node_extract,node_pilot,node_wrapper,node_qa toneMint
class node_adequacy,node_shortarc toneRose
class node_engineer,node_observations,node_result toneIndigo
```

## Components

### Positioning runtime

- [Runtime adapter](https://github.com/lacania/receiver-state-hypothesis-selection/blob/main/src/flagship/native_runtime.py): `src/flagship/native_runtime.py`
- [Candidate models](https://github.com/lacania/receiver-state-hypothesis-selection/blob/main/src/leo_positioning/models.py): `src/leo_positioning/models.py`
- [Candidate builders](https://github.com/lacania/receiver-state-hypothesis-selection/blob/main/src/leo_positioning/model_candidates.py): `src/leo_positioning/model_candidates.py`
- [State solvers](https://github.com/lacania/receiver-state-hypothesis-selection/blob/main/src/leo_positioning/solvers.py): `src/leo_positioning/solvers.py`
- [Trajectory models](https://github.com/lacania/receiver-state-hypothesis-selection/blob/main/src/leo_positioning/trajectory_models.py): `src/leo_positioning/trajectory_models.py`
- [Evidence gates](https://github.com/lacania/receiver-state-hypothesis-selection/blob/main/src/leo_positioning/model_evidence.py): `src/leo_positioning/model_evidence.py`
- [Model scoring](https://github.com/lacania/receiver-state-hypothesis-selection/blob/main/src/leo_positioning/model_scoring.py): `src/leo_positioning/model_scoring.py`
- [Hypothesis selector](https://github.com/lacania/receiver-state-hypothesis-selection/blob/main/manual_workflows/tree/flagship/21_v052_identity_repair/PAPER_FLAGSHIP_V052_INFORMATION_CRITERION_SELECTOR_PUBLICATIONIZATION/selector_parity/selector_spec_replay_v052.py): `manual_workflows/tree/flagship/21_v052_identity_repair/PAPER_FLAGSHIP_V052_INFORMATION_CRITERION_SELECTOR_PUBLICATIONIZATION/selector_parity/selector_spec_replay_v052.py`
- [Quality diagnostics](https://github.com/lacania/receiver-state-hypothesis-selection/blob/main/src/leo_positioning/quality.py): `src/leo_positioning/quality.py`

### Experiment evaluation

- [D2 method stage](https://github.com/lacania/receiver-state-hypothesis-selection/blob/main/manual_workflows/tree/leo-c/tmp/d2_execution_r1/stage_methods.py): `manual_workflows/tree/leo-c/tmp/d2_execution_r1/stage_methods.py`
- [D2 truth evaluation](https://github.com/lacania/receiver-state-hypothesis-selection/blob/main/manual_workflows/tree/flagship/d2_corrected/source_snapshot/original_scripts/evaluate_d2_truth.py): `manual_workflows/tree/flagship/d2_corrected/source_snapshot/original_scripts/evaluate_d2_truth.py`
- [Holdout runner](https://github.com/lacania/receiver-state-hypothesis-selection/blob/main/manual_workflows/tree/leo-c/_new_solver_lab/paper_draft/holdout_experiments/paper_exp01_run_holdout.py): `manual_workflows/tree/leo-c/_new_solver_lab/paper_draft/holdout_experiments/paper_exp01_run_holdout.py`

### GNSS workflows

- [GNSS extraction](https://github.com/lacania/receiver-state-hypothesis-selection/blob/main/manual_workflows/tree/leo-c_new_solver_lab/GVINS_adapter/extract_gnss.py): `manual_workflows/tree/leo-c_new_solver_lab/GVINS_adapter/extract_gnss.py`
- [Pilot selection](https://github.com/lacania/receiver-state-hypothesis-selection/blob/main/manual_workflows/tree/leo-c_new_solver_lab/GVINS_adapter/sports_field_pilot/scan_and_select.py): `manual_workflows/tree/leo-c_new_solver_lab/GVINS_adapter/sports_field_pilot/scan_and_select.py`
- [GPS-L1 wrapper](https://github.com/lacania/receiver-state-hypothesis-selection/blob/main/manual_workflows/tree/leo-c_new_solver_lab/GVINS_adapter/gps_l1_wrapper/wrapper.py): `manual_workflows/tree/leo-c_new_solver_lab/GVINS_adapter/gps_l1_wrapper/wrapper.py`
- [Fixed-state QA](https://github.com/lacania/receiver-state-hypothesis-selection/blob/main/manual_workflows/tree/leo-c_new_solver_lab/GVINS_adapter/gps_l1_wrapper/qa.py): `manual_workflows/tree/leo-c_new_solver_lab/GVINS_adapter/gps_l1_wrapper/qa.py`

### Mechanism analysis

- [Model adequacy](https://github.com/lacania/receiver-state-hypothesis-selection/blob/main/manual_workflows/tree/leo-c_new_solver_lab/GVINS_adapter/w120_model_adequacy_v1/analyze.py): `manual_workflows/tree/leo-c_new_solver_lab/GVINS_adapter/w120_model_adequacy_v1/analyze.py`
- [Short-arc analysis](https://github.com/lacania/receiver-state-hypothesis-selection/blob/main/manual_workflows/tree/leo-c_new_solver_lab/GVINS_adapter/short_arc_identifiability_v1/evaluate_stage.py): `manual_workflows/tree/leo-c_new_solver_lab/GVINS_adapter/short_arc_identifiability_v1/evaluate_stage.py`

### Other components

- **Researcher**
- **Observation inputs**
- **Selected state and metrics**

## Connections

- Researcher → Runtime adapter: runs workflow
- Observation inputs → Runtime adapter: provides input
- Runtime adapter → Candidate builders: builds candidates
- Candidate builders → State solvers: fits states
- State solvers → Candidate models: uses models
- State solvers → Trajectory models: uses trajectories
- Runtime adapter → Evidence gates: attaches evidence
- Runtime adapter → Model scoring: scores candidates
- Model scoring → Hypothesis selector: supplies scores
- Hypothesis selector → Selected state and metrics: selects hypothesis
- Runtime adapter → Quality diagnostics: computes quality
- Researcher → D2 method stage: runs stage
- D2 method stage → Runtime adapter: runs candidates
- D2 method stage → D2 truth evaluation: provides method output
- D2 truth evaluation → Selected state and metrics: evaluates against truth
- Researcher → Holdout runner: runs protocol
- Holdout runner → Runtime adapter: runs candidates
- Holdout runner → Selected state and metrics: writes evaluation
- Researcher → GNSS extraction: requests extraction
- GNSS extraction → Pilot selection: provides GNSS data
- Pilot selection → GPS-L1 wrapper: provides selected interval
- GPS-L1 wrapper → Fixed-state QA: provides forward outputs
- Fixed-state QA → Selected state and metrics: reports QA
- Researcher → Model adequacy: runs analysis
- Researcher → Short-arc analysis: runs analysis
