|
| 1 | +# omnican — Agent Governance |
| 2 | + |
| 3 | +## Project Summary |
| 4 | +- **Name**: OmniCAN v0.1.0 |
| 5 | +- **Owner**: BitConcepts, LLC |
| 6 | +- **License**: Apache-2.0 |
| 7 | +- **Language**: C (Zephyr RTOS west module) |
| 8 | +- **Build system**: CMake via `west build` |
| 9 | +- **Test framework**: Zephyr `ztest` (via `west twister`); `clang-format` for lint |
| 10 | +- **Verification tools**: `clang-format`, `west build`, `west twister` |
| 11 | + |
| 12 | +OmniCAN is a unified, multi-protocol CAN stack for Zephyr RTOS. All protocols share |
| 13 | +a common node context (`struct omnican_node`) and frame router. Protocols are |
| 14 | +independently enabled via Kconfig; unused modules compile to zero. |
| 15 | + |
| 16 | +## Repository Layout |
| 17 | +``` |
| 18 | +omnican/ |
| 19 | + include/omnican/ — Public C headers (one per module + top-level omnican.h) |
| 20 | + src/core/ — Frame router (auto-enabled when any protocol is active) |
| 21 | + src/canopen/ — CANopen CiA 301 (NMT, SDO, PDO, Emergency, Heartbeat) |
| 22 | + src/canopen_fd/ — CANopen FD CiA 1301 extensions |
| 23 | + src/j1939/ — SAE J1939 (address claiming, PGN routing, TP/ETP) |
| 24 | + src/uds/ — ISO 14229 UDS server+client (via Zephyr ISO-TP) |
| 25 | + src/obd2/ — SAE J1979 OBD-II client (via Zephyr ISO-TP) |
| 26 | + src/isotp_patch/ — Workaround for Zephyr ISOTP issue #86025 |
| 27 | + docs/ — Architecture, requirements, test spec, governance |
| 28 | + CMakeLists.txt — Module CMake entry; guards each src/ dir behind Kconfig |
| 29 | + Kconfig — All CONFIG_OMNICAN_* symbols defined here |
| 30 | + west.yml — West manifest: Zephyr v3.7.0 + CANopenNode (optional ref) |
| 31 | + zephyr/module.yml — Registers omnican as a Zephyr west module |
| 32 | + scaffold.yml — specsmith project metadata |
| 33 | +``` |
| 34 | + |
| 35 | +## Kconfig Flags |
| 36 | +| Symbol | Default | Depends on | |
| 37 | +|---|---|---| |
| 38 | +| `CONFIG_OMNICAN` | n | `CAN`, selects `NET_BUF` | |
| 39 | +| `CONFIG_OMNICAN_CANOPEN` | n | `OMNICAN` | |
| 40 | +| `CONFIG_OMNICAN_CANOPEN_FD` | n | `OMNICAN_CANOPEN`, `CAN_FD_MODE` | |
| 41 | +| `CONFIG_OMNICAN_J1939` | n | `OMNICAN`, selects `CAN_ACCEPT_RTR` | |
| 42 | +| `CONFIG_OMNICAN_UDS` | n | `OMNICAN`, `ISOTP` | |
| 43 | +| `CONFIG_OMNICAN_OBD2` | n | `OMNICAN`, `ISOTP` | |
| 44 | +| `CONFIG_OMNICAN_FRAME_ROUTER` | auto | enabled when any protocol is on | |
| 45 | +| `CONFIG_OMNICAN_ISOTP_PATCH` | auto | `ISOTP` + UDS or OBD2 | |
| 46 | + |
| 47 | +## Core API Surface |
| 48 | +- `omnican_node_init()` — initialize shared node context (CAN device, bitrate, FD mode) |
| 49 | +- **CANopen**: `omnican_canopen_init/start/stop/process()` |
| 50 | +- **J1939**: `omnican_j1939_init()`, `omnican_j1939_claim_address()`, `omnican_j1939_send()`, `omnican_j1939_register_pgn()` |
| 51 | +- **UDS**: `omnican_uds_server_init()`, `omnican_uds_register_service()` |
| 52 | +- **OBD-II**: `omnican_obd2_client_init()`, `omnican_obd2_request_pid()` |
| 53 | +- All functions return `omnican_err_t` (0 = OK, negative = error code) |
| 54 | + |
| 55 | +## Build & Verify |
| 56 | +```sh |
| 57 | +# Configure for a target app that enables OmniCAN |
| 58 | +west build -b <board> app/ |
| 59 | + |
| 60 | +# Run Zephyr unit tests |
| 61 | +west twister -T tests/ --integration |
| 62 | + |
| 63 | +# Lint / format check |
| 64 | +clang-format --dry-run --Werror include/omnican/*.h src/**/*.c |
| 65 | +``` |
| 66 | + |
| 67 | +> **CI note**: `.github/workflows/ci.yml` currently contains Python-centric steps |
| 68 | +> (ruff, mypy, pytest) that do not match this embedded-C project and should be |
| 69 | +> replaced with a west/twister + clang-format pipeline. |
| 70 | + |
| 71 | +## Governance Rules |
| 72 | +1. Read AGENTS.md fully before starting any task. |
| 73 | +2. Log all changes in LEDGER.md (append-only). |
| 74 | +3. Map changes to requirements in docs/REQUIREMENTS.md. |
| 75 | +4. Verify against docs/TESTS.md. |
| 76 | +5. Never modify governance files (`docs/governance/`) without a proposal and human approval. |
| 77 | +6. All proposals follow: propose → approve → execute → verify → record. |
| 78 | +7. All code changes must keep `CMakeLists.txt` and `Kconfig` in sync. |
| 79 | + |
| 80 | +## Governance References |
| 81 | +- `docs/governance/RULES.md` — hard rules (H1–H3) |
| 82 | +- `docs/governance/ROLES.md` — human approves, agent proposes/executes |
| 83 | +- `docs/governance/SESSION-PROTOCOL.md` — propose → approve → execute → verify → record |
| 84 | +- `docs/governance/VERIFICATION.md` — run verification before marking complete |
| 85 | +- `docs/governance/LIFECYCLE.md` — specsmith phase/lifecycle |
| 86 | +- `docs/ARCHITECTURE.md` — architecture (stub; enrich as modules are implemented) |
| 87 | +- `docs/REQUIREMENTS.md` — requirements (stub; enrich as features are defined) |
| 88 | +- `docs/TESTS.md` — test spec (stub; enrich as tests are written) |
0 commit comments