diff --git a/AGENTS.md b/AGENTS.md index 5ee5cf9d..87bdc0b8 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -59,18 +59,26 @@ commit** — the guides are user-facing API documentation, not optional docs. dispatch, lazy-save loop). - `main.cpp` — serial CLI entry (upstream + fork's buffer-hardening lines). -**Tests:** `test/test_packet_filter/` (217 behavior-level cases: matching, +**Tests:** `test/test_packet_filter/` (278 behavior-level cases: matching, content rules, limiter, persistence upgrades, CLI surface, TinyRegex, PatternMatch) and `test/test_battery_gate/`. Test-only shims: `NativeShim.h`, `NativeTestStubs.cpp`, `RegionMapStub.cpp`, `FilterTestHelpers.h`. **Build & CI:** `pio test -e native_packet_filter` / `-e -native_battery_gate` (host-native, no hardware); firmware via -`sh build.sh build-firmware ` (`sh build.sh list`), the filter fork's -flash target being `xiao_s3_wio`. `.github/workflows/filter-build.yml` builds -release channels (dev → `repeater-filter`, stable → `repeater-filter-stable`); -`sync-upstream.yml` merges upstream weekly. Upstream's own docs live in -`docs/` (MeshCore protocol/CLI generally) — not fork-filter documentation. +native_battery_gate` (host-native, no hardware), plus `-e +native_packet_filter_san` / `-e native_battery_gate_san` for ASan+UBSan; +firmware via `bash build.sh build-firmware ` (`bash build.sh list` — +`build.sh` uses bash arrays, so `sh` is not a contract), the filter fork's flash +target being `Xiao_S3_WIO_repeater`. **Compile-check every filesystem +family** before calling persistence work done: `Xiao_S3_WIO_repeater`, +`RAK_4631_repeater` (nRF52), `PicoW_repeater`, `wio-e5_repeater` — host-native +tests cannot catch a platform-specific API difference, and one did (the nRF52 +file type has no default constructor). +`.github/workflows/filter-build.yml` builds release channels (dev → +`repeater-filter`, stable → `repeater-filter-stable`); `sync-upstream.yml` merges +upstream weekly and promotes stable only on explicit dispatch. Upstream's own +docs live in `docs/` (MeshCore protocol/CLI generally) — not fork-filter +documentation. ## Branch model @@ -208,8 +216,8 @@ FILTER.md: paths, added in the same commit. The suites are behavior-level (native googletest); reach them via the same CLI/`checkPacket`/`checkContent` entry points a user or the firmware would. -- Pure refactors keep both suites green **unchanged** — the suite (217 filter - cases) is the safety net that proves no behavior slipped. +- Pure refactors keep both suites green **unchanged** — the suites (278 filter, + 44 battery) are the safety net that proves no behavior slipped. - Run both suites, then re-read the diff: ``` @@ -217,9 +225,20 @@ pio test -e native_packet_filter # filter + PatternMatch + TinyRegex + CLI + pio test -e native_battery_gate # battery gate ``` -All green, and every touched line required. Touching firmware-hook or -persistence code additionally warrants a compile check of the real target -(e.g. `pio run -e xiao_s3_wio`). +All green, and every touched line required — together with the full four-env +run, since the generic envs are where a broken selection shows up: + +``` +pio test -e native -e native_kiss_modem -e native_packet_filter -e native_battery_gate +``` + +Touching firmware-hook or persistence code additionally warrants compile checks +of `Xiao_S3_WIO_repeater`, `RAK_4631_repeater`, `PicoW_repeater` and +`wio-e5_repeater`. Note that PlatformIO does **not** track the +force-included `test/test_packet_filter/NativeShim.h` as a dependency: after +changing a struct it defines, clean the native envs (`pio run -e +native_packet_filter -t clean`) or the stale objects will silently disagree +with the new layout. ## Commit / PR discipline