SPB Git

Repository Public BSD-3-Clause

CONVENTIONS.md 4.0 KB 54 lines markdown

1# ORIX Maps — engineering conventions23Read this before touching the repository. It applies to people and to coding agents.45## Layout67- `Apps/ORIXMaps/` — the iOS / iPadOS application (XcodeGen, SwiftUI).8- `Packages/<Module>/` — one SwiftPM package per module (`Package.swift`, `Sources/<Module>/`, `Tests/<Module>Tests/`).9  Modules depend on each other with `.package(path: "../<Other>")`. `ORIXGeoCore` has no dependency and is the base of everything.10- `Infrastructure/` — build-time tools that run on macOS only (never linked into the app): OSM ingestion, tile, geocoder,11  routing and package builders, distribution.12- `data/` — local geodata, git-ignored. Never commit `.osm.pbf`, `.pmtiles`, `.orixmap`, `.orixgraph`, databases or keys.13- `docs/` — architecture, format specifications, ADRs (`docs/adr/NNNN-title.md`).1415## Swift1617- `swift-tools-version: 6.0`, `swiftLanguageModes: [.v6]`, platforms `.iOS(.v18), .macOS(.v15)` for app modules,18  `.macOS(.v15)` only for build tools. Every app module must compile and pass its tests on macOS with `swift test`19  (UIKit / CoreLocation specifics behind `#if canImport`).20- Tests use Swift Testing (`import Testing`), not XCTest.21- No third-party dependency without an ADR (licence, maturity, memory cost, iOS compatibility). System frameworks are fine:22  Foundation, SQLite3, CryptoKit, Compression, os.23- Concurrency: Swift Concurrency; `actor` for caches and stores that are shared; value types `Sendable`. No global singleton,24  no `static var shared`. Dependencies are passed in initializers behind protocols.25- Errors are typed (`enum …Error: Error`) and carry what the user or the caller needs; never `fatalError` on input data.26  Every parser of external bytes (files, downloads, imports) is bounds-checked and has a test with corrupted input.27- On-disk binary formats: little-endian, versioned magic header, explicit sizes and limits, documented in `docs/`.28- Coordinates are `ORIXGeoCore.Coordinate` (WGS 84 degrees); integer storage is E7 (`Int32`, 1e-7 degree).29- Code, comments, identifiers and documentation are in English. User-facing strings are localized in English and French30  (fr-CA) by the app; packages return typed values or keys, not hard-coded sentences, unless the module's job is text31  (for example instruction generation, which must then support `en` and `fr`).32- Do not write file headers by hand: the repository header tool is applied once at the end.33- Privacy: no network call outside `ORIXMapPackage` (catalog and package download). No logging of precise coordinates,34  search text or identifiers. No analytics.35- Honesty: never fabricate data (addresses, speeds, elevations). When data is missing, return an explicit "unknown" value.36  Never claim a result that was not measured; write the command and the numbers in the module README.3738## Data and licences3940- OpenStreetMap data © OpenStreetMap contributors, ODbL 1.0. Everything derived from it (tiles, search index, routing graph)41  is a derivative database: keep the attribution and the data date in every artefact's metadata.42- Local extracts available for development (git-ignored): `data/quebec-latest.osm.pbf` (province of Québec, 1.17 GB,43  139 M nodes, 9.9 M ways, 195 k relations, data timestamp 2026-11-24), `data/montreal.osm.pbf` (Greater Montréal,44  bbox -74.35,45.15,-73.15,45.95, 97 MB), `data/quebec-city.osm.pbf` (bbox -71.75,46.60,-70.85,47.10, 22 MB).45- `Infrastructure/ingestion/ORIXOSM` reads PBF files (`OSMPBFReader`): blocks decoded in parallel, delivered serially in46  file order (nodes, then ways, then relations). Use it; do not write another PBF parser.4748## Working rules4950- Stay inside the directories you own. Do not edit another module; if its API is missing something, say so in your report.51- Do not run `git commit`, `git add`, `git stash` or any command that rewrites the work tree: the lead integrates.52- Each module has a `README.md`: purpose, public API overview, formats, measured numbers with the exact commands, known limits.53- A feature is done when it is implemented, compiled, tested and measured. Anything else is listed under "Not done".54
Files main
Menu

Theme