id: 9e3aa3e9b60f4783a894c61030f690c1
parent_id: 9c7f99fdd0754673b5fcd1edae935fb3
item_type: 1
item_id: 6c0dcb2a567348fd9796f50c790082e4
item_updated_time: 1780925531983
title_diff: "[]"
body_diff: "[{\"diffs\":[[0,\"6.0 \"],[-1,\"— Run Deletion, Session Reopen, Feed Merging\"],[1,\"+ Track Mapping — Persistent TrackModel, Track API, PCARS Position Data\"],[0,\"** |\"]],\"start1\":512,\"start2\":512,\"length1\":52,\"length2\":79},{\"diffs\":[[0,\"ut yet |\"],[1,\"\\\n| [PCARS — UDP Protocol Spec](joplin://c6bd2c45938246fa9d61776deae9874b) | Project CARS 1 & 2 telemetry binary protocol |\\\n| [DiRT Rally — UDP Protocol Spec](joplin://877a753ad06a40e08059834d8c8fb438) | DiRT Rally 1 & 2.0 telemetry (Codemasters format) |\"],[0,\"\\\n\\\n---\\\n\\\n#\"]],\"start1\":1890,\"start2\":1890,\"length1\":16,\"length2\":270},{\"diffs\":[[0,\" V1/V2, \"],[-1,\"5\"],[1,\"7\"],[0,\" unit te\"]],\"start1\":3186,\"start2\":3186,\"length1\":17,\"length2\":17},{\"diffs\":[[0,\"ED IN v0.4.0\"],[1,\", ENHANCED 2026-06-08\"],[0,\"**\\\n  - [x] A\"]],\"start1\":3746,\"start2\":3746,\"length1\":24,\"length2\":45},{\"diffs\":[[0,\"[x] \"],[-1,\"5 unit tests for parser\"],[1,\"V1 position data: world_position (3×i16), current_lap_distance, derived spline_position\\\n  - [x] V1 lap count from viewed participant entry\\\n  - [x] `TelemetryFrame::current_lap_distance` field\\\n  - [x] 7 unit tests for parser (was 5, +2 for V1 position)\"],[0,\"\\\n\\\n- \"]],\"start1\":4169,\"start2\":4169,\"length1\":31,\"length2\":259},{\"diffs\":[[0,\" - [x] 3\"],[-1,\"2\"],[1,\"3\"],[0,\" unit te\"]],\"start1\":4878,\"start2\":4878,\"length1\":17,\"length2\":17},{\"diffs\":[[0,\"al (\"],[-1,\"14 feed_state + \"],[0,\"6 ks\"]],\"start1\":4902,\"start2\":4902,\"length1\":24,\"length2\":8},{\"diffs\":[[0,\" ksudp +\"],[1,\" 7 pcars +\"],[0,\" 7 telem\"]],\"start1\":4907,\"start2\":4907,\"length1\":16,\"length2\":26},{\"diffs\":[[0,\"l + \"],[-1,\"5 pcars\"],[1,\"14 feed_state\"],[0,\")\\\n\\\n-\"]],\"start1\":4941,\"start2\":4941,\"length1\":15,\"length2\":21},{\"diffs\":[[0,\"zation\\\n\\\n\"],[1,\"- **1.11 Track Mapping Implementation — IMPLEMENTED 2026-06-08**\\\n  - [x] **PCARS V1 position data** — Read world_position (3×i16) and current_lap_distance from viewed participant, derive spline_position, 2 new unit tests\\\n  - [x] **Dual position mode** — Auto-detect spline vs. coordinate mode (`PositionMode` enum), compute cumulative 2D distance as pseudo-spline for PCARS/future games\\\n  - [x] **Persistent TrackModel** — `track_model.rs` module with `TrackModel`, `Corner`, `Sector`, `TrackModelSource` structs, serde serialization\\\n  - [x] **TrackModelStore** — Async CRUD at `data/tracks/<game>/<track_name>.json`, path traversal protection, `TrackSummary` for listings\\\n  - [x] **Track model building algorithm** — Resample boundaries (2000 points) → center line (midpoint) → track width → heading (atan2) → curvature κ = dθ/ds → smooth (moving avg) → corner detection (|κ| > 0.005) → 3 sectors → coordinate normalization to [0,1]²\\\n  - [x] **TrackMapping use case** — New `UseCase::TrackMapping` variant with step-by-step boundary recording guidance (left lap + right lap)\\\n  - [x] **Track API endpoints** — `GET /api/tracks`, `GET/DELETE /api/tracks/{game}/{track_name}`, `GET .../corners`, `POST /api/tracks/build`\\\n  - [x] **New TelemetryFrame field** — `current_lap_distance: Option<u16>`\\\n  - [x] `Game::to_track_dir_name()` helper for filesystem-safe game identifiers\\\n  - [ ] Add track model builder unit tests\\\n  - [ ] Verify track mapping workflow with live session data\\\n\\\n\"],[0,\"---\\\n\\\n## \"]],\"start1\":8240,\"start2\":8240,\"length1\":16,\"length2\":1495},{\"diffs\":[[0,\"------|\\\n\"],[1,\"| Post-v0.6.0 | 2026-06-08 | Track mapping: persistent TrackModel, track API, PCARS V1 position, dual position mode, corner detection, boundary recording workflow |\\\n\"],[0,\"| rusty-\"]],\"start1\":11456,\"start2\":11456,\"length1\":16,\"length2\":181},{\"diffs\":[[0,\"e have (\"],[1,\"post-\"],[0,\"v0.6.0\"],[1,\" + track mapping\"],[0,\"):**\\\n- A\"]],\"start1\":12612,\"start2\":12612,\"length1\":22,\"length2\":43},{\"diffs\":[[0,\"rotocols\"],[1,\", now with PCARS V1 position data\"],[0,\"\\\n- A RES\"]],\"start1\":12855,\"start2\":12855,\"length1\":16,\"length2\":49},{\"diffs\":[[0,\"reopen),\"],[-1,\" and\"],[0,\" basic a\"]],\"start1\":12994,\"start2\":12994,\"length1\":20,\"length2\":16},{\"diffs\":[[0,\"ck maps)\"],[1,\", and track model persistence\\\n- **Persistent track models** — `TrackModel` with center line, boundaries, curvature, auto-detected corners, sectors; stored at `data/tracks/<game>/<track_name>.json`\\\n- **Dual position mode** — works with both spline-based feeds (AC/Telemetry Tool) and coordinate-based feeds (PCARS), enabling track mapping across games\\\n- **Boundary recording workflow** — deliberate 2-lap track mapping with `TrackMapping` use case\"],[0,\"\\\n- A Vue\"]],\"start1\":13036,\"start2\":13036,\"length1\":16,\"length2\":462},{\"diffs\":[[0,\"the key \"],[1,\"long-term \"],[0,\"opportun\"]],\"start1\":17323,\"start2\":17323,\"length1\":16,\"length2\":26},{\"diffs\":[[0,\"pth.\"],[-1,\" No other product offers both.\"],[1,\"\\\n\\\n**DiRT Rally 2.0** is the fastest path to rally coaching NOW. It uses the proven Codemasters UDP protocol (port 20777), includes **per-wheel surface type** (the single most important rally coaching field), and is a released, working game. See [DiRT Rally 1 & 2.0 — UDP Telemetry Protocol Specification](joplin://877a753ad06a40e08059834d8c8fb438).\\\n\\\n| Rally Game | Protocol Status | Surface Data | Availability | Our Priority |\\\n|---|---|---|---|---|\\\n| **DiRT Rally 2.0** | ✅ Proven (Codemasters UDP) | ✅ Per-wheel | Available now | HIGH — fastest path |\\\n| **DiRT Rally 1** | ✅ Proven (Codemasters UDP) | ❌ | Available now | MEDIUM |\\\n| **AC Rally** | ❌ Unknown (EA) | Unknown | Early Access | HIGH — long-term |\\\n| **EA Sports WRC** | ✅ Codemasters format | Likely | Available | LOW — not planned |\"],[0,\"\\\n\\\nSe\"]],\"start1\":17451,\"start2\":17451,\"length1\":38,\"length2\":804},{\"diffs\":[[0,\"\\\n| **A3:\"],[1,\" ~~Track mapping~~ ✅ DONE** | TrackModel persistence, corner detection, track API | Shipped 2026-06-08 |\\\n| **A4:\"],[0,\" WebSock\"]],\"start1\":19233,\"start2\":19233,\"length1\":16,\"length2\":128},{\"diffs\":[[0,\" |\\\n| **A\"],[-1,\"4\"],[1,\"5\"],[0,\": Lap de\"]],\"start1\":19447,\"start2\":19447,\"length1\":17,\"length2\":17},{\"diffs\":[[0,\" |\\\n| **A\"],[-1,\"5\"],[1,\"6\"],[0,\": Refere\"]],\"start1\":19551,\"start2\":19551,\"length1\":17,\"length2\":17},{\"diffs\":[[0,\" |\\\n| **A\"],[-1,\"6\"],[1,\"7\"],[0,\": Tyre a\"]],\"start1\":19668,\"start2\":19668,\"length1\":17,\"length2\":17},{\"diffs\":[[0,\" |\\\n| **A\"],[-1,\"7\"],[1,\"8\"],[0,\": Brake \"]],\"start1\":19767,\"start2\":19767,\"length1\":17,\"length2\":17},{\"diffs\":[[0,\"| **B3: \"],[1,\"DiRT \"],[0,\"Rally\"],[-1,\" game\"],[0,\" support\"]],\"start1\":20186,\"start2\":20186,\"length1\":26,\"length2\":26},{\"diffs\":[[0,\"* | \"],[-1,\"AC Rally, Dirt Rally 2.0, EA WRC\"],[1,\"DiRT Rally 1 & 2.0 parser (port 20777, Codemasters format)\"],[0,\" | R\"]],\"start1\":20213,\"start2\":20213,\"length1\":40,\"length2\":66},{\"diffs\":[[0,\"es captured \"],[1,\"with surface data \"],[0,\"|\\\n| **B4: Ra\"]],\"start1\":20288,\"start2\":20288,\"length1\":24,\"length2\":42},{\"diffs\":[[0,\"elemetry\"],[1,\" (same Codemasters family as DiRT Rally)\"],[0,\" | F1 se\"]],\"start1\":20492,\"start2\":20492,\"length1\":16,\"length2\":56},{\"diffs\":[[0,\"fast on \"],[-1,\"r\"],[1,\"DiRT R\"],[0,\"ally sup\"]],\"start1\":22594,\"start2\":22594,\"length1\":17,\"length2\":22},{\"diffs\":[[0,\"support \"],[1,\"— proven protocol, ship before they do \"],[0,\"|\\\n| Game\"]],\"start1\":22613,\"start2\":22613,\"length1\":16,\"length2\":55},{\"diffs\":[[0,\".1.3)\\\n2.\"],[1,\" ~~Ship track mapping~~ ✅ DONE (2026-06-08)\\\n3.\"],[0,\" **Verif\"]],\"start1\":23073,\"start2\":23073,\"length1\":16,\"length2\":62},{\"diffs\":[[0,\"-to-end\\\n\"],[-1,\"3\"],[1,\"4\"],[0,\". **Add \"]],\"start1\":23193,\"start2\":23193,\"length1\":17,\"length2\":17},{\"diffs\":[[0,\"ne data\\\n\"],[-1,\"4\"],[1,\"5\"],[0,\". **Buil\"]],\"start1\":23255,\"start2\":23255,\"length1\":17,\"length2\":17},{\"diffs\":[[0,\"feature\\\n\"],[-1,\"5\"],[1,\"6. **Purchase DiRT Rally 2.0** — cheapest path to rally telemetry (~€15 on sale)\\\n7. **Implement DiRT Rally parser** — proven protocol, 7 days estimated effort\\\n8\"],[0,\". **Rese\"]],\"start1\":23325,\"start2\":23325,\"length1\":17,\"length2\":176},{\"diffs\":[[0,\"rs work\\\n\"],[-1,\"6\"],[1,\"9\"],[0,\". **Draf\"]],\"start1\":23563,\"start2\":23563,\"length1\":17,\"length2\":17},{\"diffs\":[[0,\"oad it\\\n\\\n\"],[1,\"**Status (2026-06-08):** Steps 1–5 fully implemented in `analysis.rs` + `track_model.rs` + `api.rs`. The `TrackMapping` use case provides step-by-step guidance. The `POST /api/tracks/build` endpoint builds and persists the model from a completed session. Step 6 (auto-loading) is pending.\\\n\\\n\"],[0,\"---\\\n\\\n###\"]],\"start1\":24627,\"start2\":24627,\"length1\":16,\"length2\":306},{\"diffs\":[[0,\"ut\\\n```\\\n\\\n\"],[1,\"**Status (2026-06-08):** Steps 1–2 partially implemented. Track mapping (step 2) is done. Lap detection (step 1) is still pending but is the next priority.\\\n\\\n\"],[0,\"---\\\n\\\n###\"]],\"start1\":25136,\"start2\":25136,\"length1\":16,\"length2\":173},{\"diffs\":[[0,\"kModel\\\n\\\n\"],[1,\"**Status (2026-06-08): IMPLEMENTED.**\\\n\\\n\"],[0,\"New use \"]],\"start1\":25611,\"start2\":25611,\"length1\":16,\"length2\":55},{\"diffs\":[[0,\"k_name}`\"],[1,\", `GET .../corners`.\\\n\\\nTrack model building pipeline:\\\n1. Validate 2 boundaries (labeled \\\"left\\\" and \\\"right\\\", min 10 points each)\\\n2. Resample both boundaries to 2000 uniform points via spline interpolation\\\n3. Compute center line (midpoint of left/right at each sample)\\\n4. Compute track width (Euclidean distance left↔right at each sample)\\\n5. Compute heading (atan2 of direction vector between consecutive points)\\\n6. Compute curvature κ = dθ/ds (heading change / arc length)\\\n7. Smooth curvature with moving average\\\n8. Auto-detect corners (|κ| > 0.005 threshold, with hysteresis)\\\n9. Define 3 equal sectors\\\n10. Normalize all coordinates to [0,1]² using global bounds\\\n\\\nDual position mode: auto-detects whether frames have spline data (AC/TT) or only world coordinates (PCARS). For coordinate mode, cumulative 2D distance is used as a pseudo-spline\"],[0,\".\\\n\\\n---\\\n\\\n\"]],\"start1\":26015,\"start2\":26015,\"length1\":16,\"length2\":856},{\"diffs\":[[0,\"detection.\\\n\\\n\"],[1,\"**Status:** Track model now provides corners (entry/apex/exit spline positions, curvature peak). Analysis logic still pending.\\\n\\\n\"],[0,\"---\\\n\\\n### 17.\"]],\"start1\":27016,\"start2\":27016,\"length1\":24,\"length2\":152},{\"diffs\":[[0,\"| Priority |\"],[1,\" Status |\"],[0,\"\\\n|----------\"]],\"start1\":27913,\"start2\":27913,\"length1\":24,\"length2\":33},{\"diffs\":[[0,\"---|\"],[-1,\"\\\n| Lap detection | Spline data in TT feed | 1–2 days | P0 — blocks everything |\\\n| Track mapping | Lap detection | 3–5 days | P0 — blocks corner/grip analysis\"],[1,\"--------|\\\n| Track mapping | Spline data / position data | 3–5 days | P0 — blocks corner/grip analysis | ✅ DONE (2026-06-08) |\\\n| Lap detection | Spline data in TT feed | 1–2 days | P0 — blocks everything | Pending\"],[0,\" |\\\n|\"]],\"start1\":27984,\"start2\":27984,\"length1\":165,\"length2\":220},{\"diffs\":[[0,\"s | P1 |\"],[1,\" — |\"],[0,\"\\\n| Grip \"]],\"start1\":28244,\"start2\":28244,\"length1\":16,\"length2\":20},{\"diffs\":[[0,\" days | P1 |\"],[1,\" — |\"],[0,\"\\\n| Theoretic\"]],\"start1\":28292,\"start2\":28292,\"length1\":24,\"length2\":28},{\"diffs\":[[0,\"s | P1 |\"],[1,\" — |\"],[0,\"\\\n| Time \"]],\"start1\":28367,\"start2\":28367,\"length1\":16,\"length2\":20},{\"diffs\":[[0,\"s | P2 |\"],[1,\" — |\"],[0,\"\\\n| Coach\"]],\"start1\":28443,\"start2\":28443,\"length1\":16,\"length2\":20},{\"diffs\":[[0,\"s | P2 |\"],[1,\" — |\"],[0,\"\\\n\\\n---\\\n\\\n*\"]],\"start1\":28503,\"start2\":28503,\"length1\":16,\"length2\":20},{\"diffs\":[[0,\"06-0\"],[-1,\"6 — v0.6.0/v0.1.3: §1.9 run management complete; split API reference and client notes into separate Joplin notes\"],[1,\"8 — Track mapping implementation: persistent TrackModel, track API endpoints, PCARS V1 position data, dual position mode, corner detection, boundary recording workflow. Updated §1.4, §1.11, §16.6 Phase A, §17.1, §17.2, §17.4, §17.10.\"],[0,\"*\\\n*N\"]],\"start1\":28542,\"start2\":28542,\"length1\":120,\"length2\":241},{\"diffs\":[[0,\"on, \"],[-1,\"track mapping, reference lap overlay\"],[1,\"purchase DiRT Rally 2.0\"],[0,\"*\"]],\"start1\":28832,\"start2\":28832,\"length1\":41,\"length2\":28}]"
metadata_diff: {"new":{},"deleted":[]}
encryption_cipher_text: 
encryption_applied: 0
updated_time: 2026-06-08T13:33:34.139Z
created_time: 2026-06-08T13:33:34.139Z
type_: 13