# tyr7z/moodle-version-finder architecture

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

- Interactive diagram: https://gitdiagram.com/tyr7z/moodle-version-finder
- Repository: https://github.com/tyr7z/moodle-version-finder

## Overview

Moodle Version Finder estimates a site's release range by hashing publicly reachable files and comparing them with a local release-hash database. When several tags remain, the refiner probes files that differ between candidates; the scraper can populate the database from public Moodle tags. The scripts share hashing, URL, file-list, and version-ordering helpers. The sampled source shows these runtime relationships; the README documents the database update workflow. `version.txt` is named in the tree and README, but its contents were not sampled.

Main entry points: [`version_finder.py`](https://github.com/tyr7z/moodle-version-finder/blob/main/version_finder.py) (Site fingerprint), [`version_refiner.py`](https://github.com/tyr7z/moodle-version-finder/blob/main/version_refiner.py) (Candidate refiner), [`version_scraper.py`](https://github.com/tyr7z/moodle-version-finder/blob/main/version_scraper.py) (Hash scraper), [`version_common.py`](https://github.com/tyr7z/moodle-version-finder/blob/main/version_common.py) (Shared helpers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_fingerprint["Version fingerprinting"]
  node_finder["Site fingerprint<br/>[version_finder.py]"]
  node_common["Shared helpers<br/>[version_common.py]"]
end

subgraph group_refinement["Candidate refinement"]
  node_refiner["Candidate refiner<br/>[version_refiner.py]"]
end

subgraph group_reference["Release reference data"]
  node_scraper["Hash scraper<br/>[version_scraper.py]"]
  node_hash_db[("Release hash database<br/>[version.txt]")]
end

node_user(("Operator"))
node_moodle_site["Moodle site"]
node_github["GitHub Moodle repository"]

node_user -->|"runs"| node_finder
node_finder -->|"fetches files"| node_moodle_site
node_finder -->|"reads hashes"| node_hash_db
node_finder -->|"uses helpers"| node_common
node_finder -->|"reports range"| node_user
node_user -->|"runs"| node_refiner
node_refiner -->|"gets changed files and hashes"| node_github
node_refiner -->|"probes files"| node_moodle_site
node_refiner -->|"uses helpers"| node_common
node_refiner -->|"reports candidates"| node_user
node_user -->|"runs"| node_scraper
node_scraper -->|"gets tags and file hashes"| node_github
node_scraper -->|"uses helpers"| node_common
node_scraper -->|"updates hashes"| node_hash_db

click node_finder "https://github.com/tyr7z/moodle-version-finder/blob/main/version_finder.py"
click node_common "https://github.com/tyr7z/moodle-version-finder/blob/main/version_common.py"
click node_refiner "https://github.com/tyr7z/moodle-version-finder/blob/main/version_refiner.py"
click node_scraper "https://github.com/tyr7z/moodle-version-finder/blob/main/version_scraper.py"
click node_hash_db "https://github.com/tyr7z/moodle-version-finder/blob/main/version.txt"

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_finder,node_common toneBlue
class node_refiner toneAmber
class node_scraper,node_hash_db toneMint
class node_user,node_moodle_site,node_github toneIndigo
```

## Components

### Version fingerprinting

- [Site fingerprint](https://github.com/tyr7z/moodle-version-finder/blob/main/version_finder.py): `version_finder.py`
- [Shared helpers](https://github.com/tyr7z/moodle-version-finder/blob/main/version_common.py): `version_common.py`

### Candidate refinement

- [Candidate refiner](https://github.com/tyr7z/moodle-version-finder/blob/main/version_refiner.py): `version_refiner.py`

### Release reference data

- [Hash scraper](https://github.com/tyr7z/moodle-version-finder/blob/main/version_scraper.py): `version_scraper.py`
- [Release hash database](https://github.com/tyr7z/moodle-version-finder/blob/main/version.txt): `version.txt`

### Other components

- **Operator**
- **Moodle site**
- **GitHub Moodle repository**

## Connections

- Operator → Site fingerprint: runs (evidence: `README.md`)
- Site fingerprint → Moodle site: fetches files (evidence: `version_finder.py`)
- Site fingerprint → Release hash database: reads hashes (evidence: `version_finder.py`)
- Site fingerprint → Shared helpers: uses helpers (evidence: `version_finder.py`)
- Site fingerprint → Operator: reports range (evidence: `version_finder.py`)
- Operator → Candidate refiner: runs (evidence: `README.md`)
- Candidate refiner → GitHub Moodle repository: gets changed files and hashes (evidence: `version_refiner.py`)
- Candidate refiner → Moodle site: probes files (evidence: `version_refiner.py`)
- Candidate refiner → Shared helpers: uses helpers (evidence: `version_refiner.py`)
- Candidate refiner → Operator: reports candidates (evidence: `version_refiner.py`)
- Operator → Hash scraper: runs (evidence: `README.md`)
- Hash scraper → GitHub Moodle repository: gets tags and file hashes (evidence: `version_scraper.py`)
- Hash scraper → Shared helpers: uses helpers (evidence: `version_scraper.py`)
- Hash scraper → Release hash database: updates hashes (evidence: `README.md`)
