Commit graph

350 commits

Author SHA1 Message Date
deba8ded6e Record Gate 2D Python equivalence status 2026-05-18 16:20:15 -07:00
a95baf9122 Add Gate 2D BLE peer session manager Python equivalence tests 2026-05-18 16:19:32 -07:00
449e4207bc Record Gate 2C Python binding status 2026-05-18 16:09:29 -07:00
aa2b5d3fcd Test issue fix, had problems on zerodev1 which ChatGPT helped me finesse. This is the fix Codex was instructed to make 2026-05-18 16:03:24 -07:00
387cd1c57d Gate 2C works on jp, TODO: test on zerodev1 2026-05-18 15:32:00 -07:00
ff6caae67a Confirmation Report on jp and zerodev1 2026-05-18 15:03:18 -07:00
764ec039ac Record Gate 2B native session manager status 2026-05-18 14:59:13 -07:00
45827c1220 Add Gate 2B BLE peer session manager native tests 2026-05-18 14:58:20 -07:00
a7b1ca02de Phase 2 Gate 2A plan and report 2026-05-18 14:44:25 -07:00
91037ea77d Freeze phase 1 BLE protocol core migration phase1-ble-protocol-core-20260517 2026-05-17 13:32:09 -07:00
097bf9e988 Identities works 2026-05-17 13:22:25 -07:00
7f0b302d00 Add C++ identity helper bindings 2026-05-17 12:49:55 -07:00
aca4ff7c95 Preserving special field test runs 2026-05-17 12:16:11 -07:00
9074217edc safety 2026-05-17 04:59:38 -07:00
2e3fedc6ce Saving run commands and keeping a journal 2026-05-17 03:58:36 -07:00
7e3f88a41c After poor performance, added more logging output
Some checks failed
Tests / Detect Changes (push) Has been cancelled
Tests / Installer Test (Raspberry Pi OS - ARM) (push) Has been cancelled
Tests / Installer Test (Raspberry Pi OS - ARM)-1 (push) Has been cancelled
Tests / Unit Tests (push) Has been cancelled
Tests / Unit Tests-1 (push) Has been cancelled
Tests / Unit Tests-2 (push) Has been cancelled
Tests / Unit Tests-3 (push) Has been cancelled
Tests / Integration Tests (push) Has been cancelled
Tests / Integration Tests-1 (push) Has been cancelled
Tests / Integration Tests-2 (push) Has been cancelled
Tests / Integration Tests-3 (push) Has been cancelled
Tests / Installer Test (Fresh System) (push) Has been cancelled
Tests / Installer Test (Fresh System)-1 (push) Has been cancelled
Tests / Installer Test (Fresh System)-2 (push) Has been cancelled
Tests / Installer Test (Fresh System)-3 (push) Has been cancelled
Tests / Installer Test (Fresh System)-4 (push) Has been cancelled
2026-05-16 20:26:17 -07:00
bf620add77 Output whether using CPP or Python so test runs are NOT ambiguous
Some checks are pending
Tests / Detect Changes (push) Waiting to run
Tests / Unit Tests (push) Blocked by required conditions
Tests / Unit Tests-1 (push) Blocked by required conditions
Tests / Unit Tests-2 (push) Blocked by required conditions
Tests / Unit Tests-3 (push) Blocked by required conditions
Tests / Integration Tests (push) Blocked by required conditions
Tests / Integration Tests-1 (push) Blocked by required conditions
Tests / Integration Tests-2 (push) Blocked by required conditions
Tests / Integration Tests-3 (push) Blocked by required conditions
Tests / Installer Test (Fresh System) (push) Blocked by required conditions
Tests / Installer Test (Fresh System)-1 (push) Blocked by required conditions
Tests / Installer Test (Fresh System)-2 (push) Blocked by required conditions
Tests / Installer Test (Fresh System)-3 (push) Blocked by required conditions
Tests / Installer Test (Fresh System)-4 (push) Blocked by required conditions
Tests / Installer Test (Raspberry Pi OS - ARM) (push) Waiting to run
Tests / Installer Test (Raspberry Pi OS - ARM)-1 (push) Waiting to run
2026-05-16 20:12:45 -07:00
0f2b07f27b Modification so that testing on the Pi Zeros can utilize their compiled CPP library
Some checks are pending
Tests / Detect Changes (push) Waiting to run
Tests / Unit Tests (push) Blocked by required conditions
Tests / Unit Tests-1 (push) Blocked by required conditions
Tests / Unit Tests-2 (push) Blocked by required conditions
Tests / Unit Tests-3 (push) Blocked by required conditions
Tests / Integration Tests (push) Blocked by required conditions
Tests / Integration Tests-1 (push) Blocked by required conditions
Tests / Integration Tests-2 (push) Blocked by required conditions
Tests / Integration Tests-3 (push) Blocked by required conditions
Tests / Installer Test (Fresh System) (push) Blocked by required conditions
Tests / Installer Test (Fresh System)-1 (push) Blocked by required conditions
Tests / Installer Test (Fresh System)-2 (push) Blocked by required conditions
Tests / Installer Test (Fresh System)-3 (push) Blocked by required conditions
Tests / Installer Test (Fresh System)-4 (push) Blocked by required conditions
Tests / Installer Test (Raspberry Pi OS - ARM) (push) Waiting to run
Tests / Installer Test (Raspberry Pi OS - ARM)-1 (push) Waiting to run
2026-05-16 19:35:48 -07:00
65a3b73014 Added shim, ready to build and test on Pi Zero 2Ws
Some checks are pending
Tests / Detect Changes (push) Waiting to run
Tests / Unit Tests (push) Blocked by required conditions
Tests / Unit Tests-1 (push) Blocked by required conditions
Tests / Unit Tests-2 (push) Blocked by required conditions
Tests / Unit Tests-3 (push) Blocked by required conditions
Tests / Integration Tests (push) Blocked by required conditions
Tests / Integration Tests-1 (push) Blocked by required conditions
Tests / Integration Tests-2 (push) Blocked by required conditions
Tests / Integration Tests-3 (push) Blocked by required conditions
Tests / Installer Test (Fresh System) (push) Blocked by required conditions
Tests / Installer Test (Fresh System)-1 (push) Blocked by required conditions
Tests / Installer Test (Fresh System)-2 (push) Blocked by required conditions
Tests / Installer Test (Fresh System)-3 (push) Blocked by required conditions
Tests / Installer Test (Fresh System)-4 (push) Blocked by required conditions
Tests / Installer Test (Raspberry Pi OS - ARM) (push) Waiting to run
Tests / Installer Test (Raspberry Pi OS - ARM)-1 (push) Waiting to run
2026-05-16 18:07:04 -07:00
36bc86baa9 Fixed 2 warnings issued, revised report 2026-05-16 17:51:16 -07:00
3f3f3668f1 First Phase -- missed including these files in the prior commit 2026-05-16 17:21:02 -07:00
67e69d5ce7 First phase success 2026-05-16 17:19:26 -07:00
41a5c86a8e safety, no data imported into sqlite yet 2026-05-16 15:46:53 -07:00
f47cc42d10 preserving samples 2026-05-16 15:18:57 -07:00
e771515b43 Starting point 2026-05-16 14:38:12 -07:00
b7232b5e1e works 2026-05-16 14:37:03 -07:00
76496efcb3 Default message chunk size is now 300, not 900.
--message-chunk-size is now treated as a requested maximum.
If the requested value is too large for the Reticulum link budget, the program caps it and logs that it did so.
The cap accounts for file metadata and send_epoch.
2026-05-16 10:59:02 -07:00
48e9aac047 Adding Perl script to analyze run results, adding feature of message file and determining if Announce needs to be repeated 2026-05-16 10:09:48 -07:00
cd7c41f898 Added sender time stamp 2026-05-16 08:31:39 -07:00
c084e23a9d Merge branch 'dual_node_echo' of https://salemdata.net/repo/jlpoole/ble-reticulum into dual_node_echo
Some checks failed
Tests / Detect Changes (push) Has been cancelled
Tests / Installer Test (Raspberry Pi OS - ARM) (push) Has been cancelled
Tests / Installer Test (Raspberry Pi OS - ARM)-1 (push) Has been cancelled
Tests / Unit Tests (push) Has been cancelled
Tests / Unit Tests-1 (push) Has been cancelled
Tests / Unit Tests-2 (push) Has been cancelled
Tests / Unit Tests-3 (push) Has been cancelled
Tests / Integration Tests (push) Has been cancelled
Tests / Integration Tests-1 (push) Has been cancelled
Tests / Integration Tests-2 (push) Has been cancelled
Tests / Integration Tests-3 (push) Has been cancelled
Tests / Installer Test (Fresh System) (push) Has been cancelled
Tests / Installer Test (Fresh System)-1 (push) Has been cancelled
Tests / Installer Test (Fresh System)-2 (push) Has been cancelled
Tests / Installer Test (Fresh System)-3 (push) Has been cancelled
Tests / Installer Test (Fresh System)-4 (push) Has been cancelled
2026-05-16 08:10:25 -07:00
561449e496 added high precision, thousandsth, time precision 2026-05-16 08:09:06 -07:00
887d3dd1e2 time helpers 2026-05-16 08:03:38 -07:00
8b82bfe9ec fixed error on zerodev1 2026-05-15 19:39:12 -07:00
8303ceb626 Resolved merges... hopefully, could not test on jp 2026-05-15 19:29:51 -07:00
cbc1a9cb8e add tmp/ to ignore 2026-05-15 18:58:10 -07:00
d7e03271a4 revised to sent reticulum enable_peripheral and enable_central, also parameter to reduce debugging output 2026-05-15 18:56:09 -07:00
df090f766b from zerodev1 2026-05-15 16:19:40 -07:00
Torlando
07d941304c
Merge pull request #38 from torlando-tech/fix/stale-identity-to-address-rejection
fix: verify connection is still alive before rejecting duplicate identity
2026-01-18 15:55:01 -05:00
torlando-tech
2a2f2d7db9 test: add coverage for identity handshake and spawn in CI-compatible tests
Add tests to test_zombie_connection_detection.py (which CI runs) to cover:
- _handle_identity_handshake: non-16-byte rejection, duplicate handling
- _pending_identity_connections cleanup after handshake
- _spawn_peer_interface zombie tracking initialization

These tests cover the same code paths as test_v2_2_identity_handshake.py
but are in a file that CI includes, achieving 100% patch coverage.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 15:14:06 -05:00
torlando-tech
1e49178c3e test: use real BLEInterface instances for coverage tracking
Replace Mock-based fixtures with real BLEInterface instances in
stale identity check tests. This ensures coverage.py properly
tracks execution of production code paths.

The Mock approach with method binding executed the production code
but coverage tracking was inconsistent. Using real instances
guarantees proper coverage attribution.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 15:04:08 -05:00
torlando-tech
b2672dc35c test: add coverage for pending identity connection cleanup path
Add test for _pending_identity_connections cleanup during successful
identity handshake (lines 1272-1275), achieving 100% patch coverage
for PR #38 changes.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 14:54:59 -05:00
torlando-tech
5c9ceb28f8 test: add coverage for stale identity check paths in _check_duplicate_identity
Add tests covering previously uncovered code paths:
- Pending detach check (Check 1) allowing reconnection
- Not-connected check (Check 2) allowing reconnection
- Exception handling when zombie disconnect fails

Improves patch coverage for PR #38 from 48.57% to full coverage
of the _check_duplicate_identity changes.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 14:46:08 -05:00
torlando-tech
b7f986388f test: add tests for duplicate identity handshake race condition fix
Tests verify that:
- Duplicate 16-byte handshake matching known identity is consumed
- Different 16-byte data is also consumed to prevent reassembler errors
- Non-16-byte data is not incorrectly consumed as handshake
- Normal handshake processing works when identity not yet known

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 13:12:00 -05:00
torlando-tech
2694192d28 fix: consume duplicate identity handshake when identity already known via Kotlin callback
When Kotlin provides the identity via callback (from the identity characteristic read),
the address_to_identity mapping gets set BEFORE the 16-byte handshake data arrives
through _data_received_callback. Previously, _handle_identity_handshake would see the
identity already exists and return False, causing the 16-byte handshake data to be
passed to the reassembler where it fails with "Invalid fragment type 0xXX".

The fix checks if received 16-byte data matches the known identity and consumes it
silently if so. This prevents the handshake data from being misinterpreted as a
fragment.

Symptoms fixed:
- BLEReassembler: Invalid fragment type 0xc9 (first byte of peer identity)
- Messages not flowing even though connections appear established

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 13:09:56 -05:00
torlando-tech
73be6d93c0 feat: add zombie connection detection to break symmetric deadlock
When BLE link degrades, 1-byte keepalives may still work while larger data
packets fail. Both sides think the connection is "alive" based on keepalives,
but data can't flow. This causes a deadlock where new connections are
rejected as "duplicates" even though the existing connection is non-functional.

This change adds zombie detection by tracking when real data (not keepalives)
was last received. If an existing connection has only exchanged keepalives
for > 30 seconds (configurable via _zombie_timeout), new connections from
the same identity are allowed and the zombie connection is disconnected.

Changes:
- Add _last_real_data dict to track last real data timestamp per identity
- Add _zombie_timeout (default 30s) for configurable zombie threshold
- Update _check_duplicate_identity with Check 3: zombie detection
- Update _handle_ble_data to track real data activity after keepalive filter
- Initialize tracking in _handle_identity_handshake and _spawn_peer_interface
- Clean up tracking in _process_pending_detaches
- Add comprehensive test suite for zombie detection

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 12:47:45 -05:00
torlando-tech
9a0a4963e8 fix: verify connection is still alive before rejecting duplicate identity
When a peer disconnects, identity_to_address is NOT cleaned up immediately -
it's only removed after a 2-second grace period. However, _check_duplicate_identity
was not checking if the existing address is still connected before rejecting.

This caused legitimate reconnections from the same identity (after MAC rotation
or reconnection) to be incorrectly rejected as "duplicates" during the grace
period or when cleanup was delayed.

The fix adds two checks before rejecting:
1. If pending_detach exists for this identity (old connection already gone)
2. If existing address is not in connected_peers or peers dict

Also adds TDD tests that demonstrate the bug and verify the fix.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 03:34:17 -05:00
Torlando
faf032aa8d
Merge pull request #37 from torlando-tech/fix/ble-architecture-review-fixes
fix: BLE architecture review fixes and documentation
2026-01-18 02:29:14 -05:00
torlando-tech
cff4dcbe9d test: add integration tests for driver duplicate identity exception handling
Add tests that exercise the actual code path in linux_bluetooth_driver.py
for duplicate identity exception handling. These tests patch BleakClient
to verify that:

- Duplicate identity exceptions are logged as WARNING, not ERROR
- on_error callback uses 'info' severity for duplicate identity errors
- Normal connection failures still use 'error' severity

This improves patch coverage for the duplicate identity handling fix
by testing the driver code directly rather than just the logic in isolation.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 01:58:15 -05:00
torlando-tech
406b30ac45 test: add coverage for duplicate identity rejection code paths
Add tests that exercise the actual code paths for:
- _handle_identity_handshake rejecting duplicate identity and calling disconnect
- _handle_identity_handshake gracefully handling disconnect exceptions
- linux_bluetooth_driver duplicate identity error handling (log levels, callbacks)

These tests cover the 15 lines that were missing coverage:
- BLEInterface.py lines 1137-1149 (duplicate identity check in peripheral mode)
- linux_bluetooth_driver.py lines 1207-1216, 1234-1240 (error handling)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 01:32:08 -05:00
torlando-tech
799b91122f fix(tests): update tests for driver callback signature and Python 3.14 compatibility
- Fix BLEInterface.handle_peripheral_data to use _compute_identity_hash
  instead of RNS.Identity.full_hash for consistent identity hash computation
- Update MockBLEDriver.on_device_connected callback to match the
  (address, peer_identity) signature in bluetooth_driver.py
- Fix test_v2_2_identity_handshake.py and test_v2_2_race_conditions.py
  to properly mock ble_reticulum.Interface without breaking the namespace
- Use BLEFragmenter/BLEReassembler directly in tests instead of
  non-existent _create_fragmenter/_create_reassembler methods
- Fix asyncio.get_event_loop() deprecation in test_ble_peer_interface.py
  for Python 3.10+ compatibility
- Update MAC address test fixtures to account for v2.2 MAC sorting logic
- Fix test_peer_address_mac_rotation to properly simulate MAC rotation
  where old connection is dropped before new one arrives

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 01:26:57 -05:00