Modern Apps git
git clone https://git.maproj.org/Modern-Apps.git
main ▾

Modern-Apps.git / auto / protocol / AGENTS.md

AGENTS.md3.2 KiBRenderedCodeRaw
1# AGENTS.md — auto/protocol/ (':auto:protocol')
2
3> Scoped supplement. Global rules in root `AGENTS.md` apply. Stay inside `auto/protocol/` + allowed shared modules. Do not root-scan.
4
5- Gradle: :auto:protocol / dir: auto/protocol/
6- Package roots present: (pure-Kotlin protocol library — single package, no Android roots)
7- Entry files: GalConnection.kt + GalControlSession.kt (no MainActivity/Route — library)
8- Deps: :library
9- Metadata: metadata_data/auto-protocol.md (absent — libraries have none by design)
10- Rust: no / screenshotTest: no
11
12## Overview
13**Purpose:** Pure-Kotlin GAL (head-unit) protocol library for `:auto` — framing, session control, TLS, and media/input/sensor codecs. No Android, no UI; testable as plain JVM.
14**Covers:** Frame read/write + fragmenter/assembler, version negotiation, USB/wireless sessions, transport selector, reconnect backoff, ack tracking; codecs for video, audio, input, sensors, nav status, maps guidance, messaging; TLS + credential/key handling; host-vs-mirror role policy and display routing.
15**Entry points + reading order:** `GalConnection.kt` → `GalControlSession.kt` → `FrameReader.kt`/`FrameWriter.kt` → `VersionNegotiation.kt` → the codec for your channel (`VideoCodec`, `InputCodec`, `SensorCodec`, …).
16**Gotchas:**
17- Protocol changes break car interop — version negotiation must stay backward-compatible
18- Keep it pure Kotlin (no Android imports) so it stays unit-testable without a device
19
20## Key files
21### Session + framing
22- com/vayunmathur/auto/protocol/GalConnection.kt
23- com/vayunmathur/auto/protocol/GalControlSession.kt
24- com/vayunmathur/auto/protocol/GalTransport.kt
25- com/vayunmathur/auto/protocol/StreamTransport.kt
26- com/vayunmathur/auto/protocol/FrameHeader.kt
27- com/vayunmathur/auto/protocol/FrameReader.kt
28- com/vayunmathur/auto/protocol/FrameWriter.kt
29- com/vayunmathur/auto/protocol/Fragmenter.kt
30- com/vayunmathur/auto/protocol/FrameAssembler.kt
31- com/vayunmathur/auto/protocol/FrameId.kt
32- com/vayunmathur/auto/protocol/ChannelSendQueue.kt
33- com/vayunmathur/auto/protocol/AckTracker.kt
34### Negotiation + transports
35- com/vayunmathur/auto/protocol/VersionNegotiation.kt
36- com/vayunmathur/auto/protocol/TransportKind.kt
37- com/vayunmathur/auto/protocol/TransportSelector.kt
38- com/vayunmathur/auto/protocol/UsbSession.kt
39- com/vayunmathur/auto/protocol/WirelessSession.kt
40- com/vayunmathur/auto/protocol/ReconnectBackoff.kt
41### Codecs
42- com/vayunmathur/auto/protocol/VideoCodec.kt
43- com/vayunmathur/auto/protocol/AudioCodec.kt
44- com/vayunmathur/auto/protocol/InputCodec.kt
45- com/vayunmathur/auto/protocol/SensorCodec.kt
46- com/vayunmathur/auto/protocol/NavStatusCodec.kt
47- com/vayunmathur/auto/protocol/MapsGuidance.kt
48- com/vayunmathur/auto/protocol/MessageCodec.kt
49- com/vayunmathur/auto/protocol/MessagingCodec.kt
50### Security + roles
51- com/vayunmathur/auto/protocol/TlsCodec.kt
52- com/vayunmathur/auto/protocol/GalCredential.kt
53- com/vayunmathur/auto/protocol/GalMessage.kt
54- com/vayunmathur/auto/protocol/FocusArbitration.kt
55- com/vayunmathur/auto/protocol/HostVsMirror.kt
56- com/vayunmathur/auto/protocol/MaosRole.kt
57- com/vayunmathur/auto/protocol/DisplayRoutePolicy.kt
58
59## Verify (this module only)
60```
61./gradlew :auto:protocol:compileDevKotlin
62./gradlew :auto:protocol:lint
63```