Force-build runs left RANGE at HEAD, so the curated 'Filter changes in
this build' section had no lower bound and listed every filter commit
ever made instead of only commits since the channel's previous tag.
Set RANGE to <prev-tag>..HEAD in the forced path when a previous tag
exists; the skip gate is unaffected (forced builds still always build).
All radd() reply writers were bounded to MAX_PACKET_PAYLOAD (184), but the
actual CLI reply buffers are 160 B (serial/ethernet reply[160]) and 161 B
(mesh path: &temp[5] of temp[166]). With 9+ channels, 'filter chan'/'filter
chan list' wrote ~23 bytes past temp[166] and rebooted the repeater; the
same class of bug existed in the token echoes 'Err - expected key=value'
and 'Err - unknown param', reachable via a long mesh admin command.
- CliUtil.h: add CLI_REPLY_MAX (160); bound all radd() callers to it
(PacketFilter.cpp x5, BatteryGate.cpp x1)
- PacketFilter.cpp: snprintf-bound the two user-token error echoes
- chan list format trimmed to '<idx>:<name>:<hash>' so a full 16-slot
store fits in one reply
- filter stats reordered (globals first, per-rule hits last) with
shortened labels so tail truncation sacrifices hits detail, not the
summary counters
- tests: pin replies to the real buffer for chan list and token-echo
errors; update stats/chan-list format assertions
A rule with throttle=N lets at most one matching packet every N seconds
slip past untouched (fall-through, exactly like a failed prob roll); every
other match inside those N seconds triggers the rule's action (default:
drop). Over-rate drops do not extend the window, so a matching stream
sustains exactly one pass per N seconds however hard it is pushed (the
advert rate limiter's model, per rule). One budget per rule: scope the
rule with sender=/chan= to scope the budget.
- FilterRule: u16 throttle (config field) + RAM-only rate state after
air_ms (travels with the rule on move/del, like hits)
- config v6: the record grows 4 B (u16 throttle + 2 reserved bytes); the
v4/v5 record is a byte-identical prefix ending at offsetof(throttle) and
reads back with throttle == 0 (= no limit). The v3 region-wipe and the
prob-zeroing fixup are now record-exact so migrated v4/v5 rules keep
their region= list and (from v5) their prob byte. load() accepts v3..v6
— every version for which record-layout code exists.
- CLI: throttle=1..65535 (integer seconds); filter get echoes
throttle=N pass=M (pass = within-budget deliveries)
- resetStats() clears pass= but never the rate clock (no free pass)
- Downgrade: pre-throttle firmware reading a v6 file fails the version
guard and starts with an empty rule/channel set (same as v1/v2 had on
upgrade)
- FILTER.md: throttle section, slowing-one-sender recipe, shadow-mode note
- FILTER.md claimed a shadow forward probe's hits come with an airtime-saved
estimate; only DROP decisions bill air_ms, so a probe reads air=0. Say so.
- static_assert that prob fits in the tail padding before hits: a
FILTER_REGION_LIST_LEN override with a 4-aligned regions end would shift
hits, change the record size, and silently corrupt v4 config upgrades.
Every DROP decision bills the packet's estimated time-on-air into the
airtime telemetry: a new RAM-only air_saved_ms counter on FilterRules
(rule drops + rate-limiter drops) and a per-rule air_ms field placed
after hits, where the persist bytes already end - zero persisted bytes,
no version churn.
The estimate comes from the same source mainline bills airtime with:
the hook lines pass _radio->getEstAirtimeFor(packet->getRawLength())
into checkPacket()/checkContent() as a new est_air_ms parameter
(default 0 = unknown, nothing billed). Forward/allow verdicts bill
nothing; a stashed content verdict is billed once, where it decides.
filter stats gains '; air:<ms>' and filter get <idx> shows ' air=<ms>'
after the hit count - the same key on both surfaces - so a drop rule's
worth is visible in RF terms.
A rule field prob=1..100 makes the rule decide only that percentage of the
packets its predicates match; on a failed roll evaluation falls through to
the next rule exactly as if the predicates had not matched. Unset (default)
behaves as 100%, so existing rules and configs are unchanged.
The roll is deterministic per (packet, rule) - FNV-1a over the packet hash
salted with the rule digest - because rand() is never seeded and the
checkContent verdict stash must not re-roll on the packet-level rescan.
Persistence: prob slots into the tail padding after regions, so the persisted
record size is unchanged; the config version bumps to 5 to mark configs that
carry the field, and v4/v3 configs still load (their prob byte is zeroed).
Config fields sit before hits, so prob is included in the filter list digest.
hits now counts enforced decisions, not predicate matches (a packet passed
on a failed roll is not counted).
First-match-wins means a broad early drop rule can silence the operator's
own remote-admin traffic (login replies ride the flood path). Add a note
under Limits and good-to-knows: admit your own traffic with an earlier
forward rule, and test it while serial access is still available.
filter move N N rejects the no-op, but both indices are valid rules, so
the error message was misleading. Reply that source and target are the
same rule instead.
On schedule events the workflow_dispatch 'inputs' context is empty, so
${{ inputs.force_build }} evaluated to an empty string. Passing '' into
the reusable workflow's boolean input failed at job creation: the run
went red after the sync job with no build jobs created. Compare against
true instead so the expression always yields a concrete boolean.
Drop BLE_TX_POWER=0 from the companion envs so they use the default of
4 dBm, like most other variants. The lower power was carried over from
the original Base Duo PR and real-world range is better at the default.
- rename the board class and files to MuziBaseBoard
- uppercase the build flags (MUZI_BASE, MUZI_BASE_SUPERIO)
- name the superIO envs muzi_base_{duo,uno}_superIO_companion_radio_ble so
build.sh picks them up
- set MAX_CONTACTS to 350 like the other variants
- move the pin setup from initVariant() into MuziBaseBoard::begin()
The content-verdict stash keyed a packet by raw pointer plus a 500ms age
tag. A lingering drop verdict (checkPacket is never called for dropped
packets) could pointer-match a pool-reused buffer within the window and
serve its stale verdict to an unrelated packet.
Tag the stash with the packet's content hash (calculatePacketHash, the
same primitive core uses for seen-dedup) and consume only on pointer AND
hash match. Identity is now exact instead of heuristic; any mismatch
clears the stash and runs the normal packet-level scan.
- rename the logonly action to forward (same stored byte value, so persisted
configs load identically in both directions; CLI accepts only drop|forward)
- single-pass whole-rule evaluation: for decrypted group packets the entire
rule list runs once, in listed order, at content time (checkContent);
checkPacket consumes a pointer+age-tagged verdict stash instead of running
an independent second scan (fixes the two-pass ordering surprises)
- new 'filter move <from> <to>' CLI command (rule ends up AT the target
index, hits travel with it); usage line updated
- CLI surface: list digest letters D/F, get prints forward
- FILTER.md: evaluation-order explanation, shadow-mode probe placement,
allowlist-within-a-channel setup, behavior-change and downgrade notes
- 28 new native tests (159 total, all green)
The major rev from 19.x to 20.x breaks Radiolab, so pin it for now. This should fix the failing wio-e5-mini_repeater builds.
ltoa is removed upstream, so it was replaced with snprintf. The p[] buffer is always 16 bytes. Copy/paste for why claude thinks this is fine below, but also if this is broken it wouldn't be new.
```
exp2 in [23, 30] (int_part = mantissa << (exp2 - 23)): this is where int_part can reach its true max, up to 2,147,483,520 — 10 digits. That's what the snprintf bound of 11 (10 digits + NUL) is sized for. But in this branch frac_part is never assigned anything other than its initial 0, so only *p++ = '0' runs for the fraction — 1 char, not 7.
exp2 in [0, 22] (int_part = mantissa >> (23 - exp2)): this is the only branch where frac_part can also be nonzero and enter the 7-digit loop. Here int_part < 2^23 by construction, so it's capped at 7 digits, never 10.
```
Today if a user builds firmware with an incorrect WiFi SSID or password,
they get a generic `WiFi disconnected.` error message.
Extend logging to descirbe the reason that WiFi was disconnected.
I gathered the updated logs for the 3 scenarios below.
```
WiFi: Attempting manual WiFi reconnect...
WiFi: WiFi disconnected (reason=ASSOC_LEAVE). Flagging for reconnect...
WiFi: WiFi disconnected (reason=4WAY_HANDSHAKE_TIMEOUT). Flagging for reconnect...
WiFi: WiFi disconnected (reason=4WAY_HANDSHAKE_TIMEOUT). Flagging for reconnect...
WiFi: WiFi disconnected (reason=4WAY_HANDSHAKE_TIMEOUT). Flagging for reconnect...
```
```
WiFi: WiFi disconnected (reason=NO_AP_FOUND). Flagging for reconnect...
```
```
WiFi: WiFi connected successfully!
WiFi: Got connection
```
- State that rule commands take a 0-based index (printed by filter add)
and that the short code shown by filter list is display-only
- Decode the filter/filter list status line formats
- Note 0-based numbering in Quick start; give a delete re-indexing example
- Add a contains/starts-with/exactly mini-table to the sender/text section
Replace numbered headings and § cross-references with named headings
and intra-document links, and replace the multi-region drop recipe with
an exclude-one-region-from-one-channel example (keeping the unscoped
example).
Restructure for operators who don't need code internals: lead with a
quick start and common setups, move per-condition examples and the
pattern-language reference behind them, and compress implementation
detail (evaluation phases, byte/symbol budgets, storage internals) into
short good-to-know notes. Examples now use the default drop action;
logonly is documented once in a dedicated shadow-mode section.
- Section 2: make AND-within-rule vs comma-list OR vs separate-rules
semantics explicit, with a worked match/non-match table and notes on
first-match ordering within each evaluation phase
- Section 7: add example tables for every predicate key (type, route,
hops, len, snr, path, hsize, chan, chanhash, region, sender, text)
plus action/enable/stats controls, boundary cases, and common pitfalls
- Section 11 (new): TinyRegex reference - supported syntax, unsupported
constructs vs JavaScript/Python/PCRE/POSIX, migration recipes, CLI
quoting and host-language escaping, UTF-8 byte semantics, limits,
fail-open behavior, and troubleshooting
- Correct limit documentation: usable pattern lengths (23/47 bytes),
29-symbol compile budget, class-buffer limit, and \s semantics