Make per-ap the default capture output mode #116

Merged
aluminum-ice merged 1 commit from feature/per-ap-default into main 2026-10-31 05:31:12 +00:00
Owner

What this PR does

Makes per-ap the default capture output mode, as planned in deferred.md: one <ssid>_<bssid>.hc22000 per access point, so unrelated APs that reuse a network name (every AndroidAP, POS or printer default) never share a file.

  • Shipped config: [capture.output] mode = "per-ap" in config.toml, with its comment reordered.
  • Code fallbacks match it: capture-collect.py (output_config), capture-launch.sh (the single check), web.py (the networks page's default view), and config_catalog.py (the Advanced page's default, with per-ap first in the list, mirrored in plugins-ctl.py for the drift test). per-ssid and single work as before.
  • Capture contract 5 → 6 (docs/developer/capture-interface.md): the shipped layout's file names change. The layouts themselves don't; a consumer that reads every *.hc22000 (the daemon, the agent and the shipped plugins all do) is unaffected. Also fixes the opening paragraph, which said the contract "stayed at version 3" across the AngryOxide v0.9.4 bump.
  • Docs: capture-setup.md (which didn't list per-ap at all), config-reference.md, working-with-captures.md, architecture.md, and GUIDE_MD. They note that devices flashed before 1.0.11 keep per-ssid after an in-place update until config.toml is changed.
  • Tests: five networks-page tests that relied on the old default view now set per-ssid explicitly, and a new test checks that an unset mode opens the by-access-point view.
  • Removes the "Make per-ap the default output mode" entry (and its now-empty section) from deferred.md.

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 (the kestrel_pi pytest suite and the real-data check's tests). The Test workflow runs this on the PR.
  • Nothing real: no secrets, no personal information, no real data. This is a public repository. The diff contains no real account passwords or hashes, Wi-Fi passphrases, private keys, API tokens, .env files, real names, personal emails, device serials, and no real captured or device data: SSIDs, MAC addresses, GPS coordinates, capture files, diagnostics bundles, logs, or screenshots of a real device — placeholders only. The real-data check catches MACs, emails, keys and capture files; real SSIDs, coordinates and screenshots are on you.
  • Consent gates intact. Capture and network plugins still ship disabled, enabling them still takes the authorized-use acknowledgment (never pre-ticked or given by code), and the capture whitelist is still enforced.
  • Docs updated in the same PR, if this changes something an operator sees or configures: the README package table, the relevant page under docs/, and the on-device operator guide (GUIDE_MD in kestrel_pi/userguide.py) where it applies.
  • Commit messages are short and imperative.

Release impact

  • App-layer-safe — changes only files the in-place update engine carries: the kestrel_pi package, plugins/*.py, systemd units, the journald drop-in, a lib script already in the engine's LIB_SCRIPTS, or the CLI.
  • Reflash-class — touches a build input the engine does not carry onto a running device: apt or pip packages, boot options / config.txt / cmdline, kernel modules, the base image or partition size, builder/config.json, builder/config.yml, the Makefile, .forgejo/workflows/, a shipped config default (config.toml / default.conf), or a brand-new lib script.

Notes for review

  • Reflash-class because the shipped config.toml default changes; update_kind=auto won't see it, and 1.0.11-beta.1 is forced to reflash anyway.
  • A device updated in place keeps per-ssid (its config.toml holds it), and the code fallbacks only apply when the key is missing, which the shipped config never leaves it.
  • The ghost-guide networks screenshot now opens on the by-access-point view, which matches its caption ("listing the access points seen during capture").
  • Lint is clean and 1438 tests pass; test_gps_serial_reader_recovers_from_a_stalled_link fails only on my machine, on main too, and passes in CI.

🤖 Generated with Claude Code

## What this PR does Makes `per-ap` the default capture output mode, as planned in `deferred.md`: one `<ssid>_<bssid>.hc22000` per access point, so unrelated APs that reuse a network name (every `AndroidAP`, POS or printer default) never share a file. - **Shipped config:** `[capture.output] mode = "per-ap"` in `config.toml`, with its comment reordered. - **Code fallbacks** match it: `capture-collect.py` (`output_config`), `capture-launch.sh` (the `single` check), `web.py` (the networks page's default view), and `config_catalog.py` (the Advanced page's default, with `per-ap` first in the list, mirrored in `plugins-ctl.py` for the drift test). `per-ssid` and `single` work as before. - **Capture contract 5 → 6** (`docs/developer/capture-interface.md`): the shipped layout's file names change. The layouts themselves don't; a consumer that reads every `*.hc22000` (the daemon, the agent and the shipped plugins all do) is unaffected. Also fixes the opening paragraph, which said the contract "stayed at version 3" across the AngryOxide v0.9.4 bump. - **Docs:** `capture-setup.md` (which didn't list `per-ap` at all), `config-reference.md`, `working-with-captures.md`, `architecture.md`, and `GUIDE_MD`. They note that devices flashed before 1.0.11 keep `per-ssid` after an in-place update until `config.toml` is changed. - **Tests:** five networks-page tests that relied on the old default view now set `per-ssid` explicitly, and a new test checks that an unset mode opens the by-access-point view. - Removes the "Make `per-ap` the default output mode" entry (and its now-empty section) from `deferred.md`. ## 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` (the `kestrel_pi` pytest suite and the real-data check's tests). The **Test** workflow runs this on the PR. - [x] **Nothing real: no secrets, no personal information, no real data.** This is a public repository. The diff contains no real account passwords or hashes, Wi-Fi passphrases, private keys, API tokens, `.env` files, real names, personal emails, device serials, and no real captured or device data: SSIDs, MAC addresses, GPS coordinates, capture files, diagnostics bundles, logs, or screenshots of a real device — placeholders only. The real-data check catches MACs, emails, keys and capture files; real SSIDs, coordinates and screenshots are on you. - [x] **Consent gates intact.** Capture and network plugins still ship disabled, enabling them still takes the authorized-use acknowledgment (never pre-ticked or given by code), and the capture whitelist is still enforced. - [x] **Docs updated in the same PR**, if this changes something an operator sees or configures: the README package table, the relevant page under `docs/`, and the on-device operator guide (`GUIDE_MD` in `kestrel_pi/userguide.py`) where it applies. - [x] Commit messages are short and imperative. ## Release impact - [ ] **App-layer-safe** — changes only files the in-place update engine carries: the `kestrel_pi` package, `plugins/*.py`, systemd units, the journald drop-in, a lib script already in the engine's `LIB_SCRIPTS`, or the CLI. - [x] **Reflash-class** — touches a build input the engine does not carry onto a running device: apt or pip packages, boot options / `config.txt` / `cmdline`, kernel modules, the base image or partition size, `builder/config.json`, `builder/config.yml`, the `Makefile`, `.forgejo/workflows/`, a shipped config default (`config.toml` / `default.conf`), or a brand-new lib script. ## Notes for review - Reflash-class because the shipped `config.toml` default changes; `update_kind=auto` won't see it, and 1.0.11-beta.1 is forced to `reflash` anyway. - A device updated in place keeps `per-ssid` (its `config.toml` holds it), and the code fallbacks only apply when the key is missing, which the shipped config never leaves it. - The ghost-guide networks screenshot now opens on the by-access-point view, which matches its caption ("listing the access points seen during capture"). - Lint is clean and 1438 tests pass; `test_gps_serial_reader_recovers_from_a_stalled_link` fails only on my machine, on `main` too, and passes in CI. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Make per-ap the default capture output mode
All checks were successful
Test / test (push) Successful in 21s
Lint / lint (push) Successful in 32s
Lint / lint (pull_request) Successful in 33s
Test / test (pull_request) Successful in 22s
ae5405e494
Ship [capture.output] mode = "per-ap" and use it as every code fallback,
so a freshly flashed device keeps unrelated APs that share a network name
in separate files. Bump the capture contract to version 6, update the docs
and the on-device guide, and pin the by-network web tests to per-ssid.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
aluminum-ice deleted branch feature/per-ap-default 2026-10-31 05:31:13 +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!116
No description provided.