Don't count AP-less handshakes in the agent's coverage figure #169

Merged
aluminum-ice merged 1 commit from agent-coverage-apless into main 2026-11-03 07:08:10 +00:00
Owner

What this PR does

Stops the learning agent's coverage figure from counting an AP-less capture's rogue address as an access point.

Each decision window, the agent logs new_networks: the distinct AP BSSIDs among that window's new handshakes. kestrel agent metrics and the agent's status turn it into "new networks / hour". An AP-less handshake (a phone answering the capture tool for a network it remembers) is filed under the capture tool's rogue address, one per capture run, so a window with AP-less handshakes counted that address as one more network.

  • agent/env.py: _distinct_bssids() skips AP-less handshakes (HandshakeEvent.apless, from #161). They still count as handshakes in the reward, unchanged.
  • docs/developer/agent-interface.md: the episode-log row for new_networks says AP-less handshakes aren't counted, and that it's a reporting figure only.

No change to training or contests. new_networks feeds only the metrics summary (coverage_per_hour). The reward uses the count of new handshakes, and the trainer and the model contests never read new_networks. So the observation, the action space and SPEC_VERSION are unchanged, and existing models and logs stay valid. Windows logged before this update keep their old counts, so the figure drops a little once it applies.

This follows the AP-less work in #161 and #162, which came from a community member's patch.

Checklist

  • Lint passes — make lint (ansible --syntax-check, yamllint, shellcheck --severity=error, and the real-data check). The Lint workflow runs this on the PR.
  • Tests pass — make test: 1674 passed locally (the two off-device-only failures deselected). The new test is in test_agent_env.py, which is skipped without gymnasium. CI doesn't install it, so I ran that file with the image's pinned gymnasium==1.4.0: 12 passed.
  • Nothing real: no secrets, no personal information, no real data.
  • Consent gates intact. The agent still only drives capture through scan-override.json.
  • Docs updated in the same PR.
  • Commit messages are short and imperative.

Release impact

  • App-layer-safe — the kestrel_pi package only.
  • Reflash-class

Notes for review

  • New test_apless_handshakes_count_as_handshakes_but_not_networks: three AP-less handshakes under one rogue address plus one real AP's count as 4 handshakes and 1 network. It fails on main (2 networks).
  • CI gap, existing: test.yml installs pytest flask requests numpy pillow cryptography but not gymnasium, so all of test_agent_env.py is skipped in CI. Adding gymnasium==1.4.0 to that install line would make it run. That's a workflow-only change and doesn't affect the image; left for a separate decision.
  • For 1.0.13-beta.4, with #167.

🤖 Generated with Claude Code

## What this PR does Stops the learning agent's coverage figure from counting an AP-less capture's rogue address as an access point. Each decision window, the agent logs `new_networks`: the distinct AP BSSIDs among that window's new handshakes. `kestrel agent metrics` and the agent's status turn it into "new networks / hour". An AP-less handshake (a phone answering the capture tool for a network it remembers) is filed under the capture tool's rogue address, one per capture run, so a window with AP-less handshakes counted that address as one more network. - **`agent/env.py`**: `_distinct_bssids()` skips AP-less handshakes (`HandshakeEvent.apless`, from #161). They still count as handshakes in the reward, unchanged. - **`docs/developer/agent-interface.md`**: the episode-log row for `new_networks` says AP-less handshakes aren't counted, and that it's a reporting figure only. **No change to training or contests.** `new_networks` feeds only the metrics summary (`coverage_per_hour`). The reward uses the count of new handshakes, and the trainer and the model contests never read `new_networks`. So the observation, the action space and `SPEC_VERSION` are unchanged, and existing models and logs stay valid. Windows logged before this update keep their old counts, so the figure drops a little once it applies. This follows the AP-less work in #161 and #162, which came from a community member's patch. ## Checklist - [x] **Lint passes** — `make lint` (ansible `--syntax-check`, `yamllint`, `shellcheck --severity=error`, and the real-data check). The **Lint** workflow runs this on the PR. - [x] **Tests pass** — `make test`: 1674 passed locally (the two off-device-only failures deselected). The new test is in `test_agent_env.py`, which is skipped without `gymnasium`. CI doesn't install it, so I ran that file with the image's pinned `gymnasium==1.4.0`: 12 passed. - [x] **Nothing real: no secrets, no personal information, no real data.** - [x] **Consent gates intact.** The agent still only drives capture through `scan-override.json`. - [x] **Docs updated in the same PR.** - [x] Commit messages are short and imperative. ## Release impact - [x] **App-layer-safe** — the `kestrel_pi` package only. - [ ] **Reflash-class** ## Notes for review - New `test_apless_handshakes_count_as_handshakes_but_not_networks`: three AP-less handshakes under one rogue address plus one real AP's count as 4 handshakes and 1 network. It fails on main (2 networks). - **CI gap, existing:** `test.yml` installs `pytest flask requests numpy pillow cryptography` but not `gymnasium`, so all of `test_agent_env.py` is skipped in CI. Adding `gymnasium==1.4.0` to that install line would make it run. That's a workflow-only change and doesn't affect the image; left for a separate decision. - For 1.0.13-beta.4, with #167. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Don't count AP-less handshakes in the agent's coverage figure
All checks were successful
Test / test (pull_request) Successful in 32s
Lint / lint (pull_request) Successful in 33s
Test / test (push) Successful in 32s
Lint / lint (push) Successful in 33s
f092b8266e
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
aluminum-ice deleted branch agent-coverage-apless 2026-11-03 07:08:10 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
aluminum-ice/kestrel!169
No description provided.