Skip to content

feat: add discover-local-peers multi-log heartbeat aggregation CLI - #52

Closed
Exohayvan wants to merge 2 commits into
mainfrom
ai/next-step-20260630-044153
Closed

Exohayvan wants to merge 2 commits into
mainfrom
ai/next-step-20260630-044153

Conversation

@Exohayvan

Copy link
Copy Markdown
Contributor

Objective

Add a read-only CLI command that builds a single local peer roster from multiple heartbeat announcement logs.

This is important because it lets operators combine discovered local nodes from separate announcement files into one deterministic view before introducing any real networking, while keeping discovery file-backed and local-only.

What changed

  • Added discover_local_peers_document in peer_registry to aggregate heartbeat peers across one or more local message-log inputs using existing message validation/parsing.
  • Refactored peer_summary_document to delegate to the shared multi-log helper so single-log and multi-log behavior stays aligned.
  • Added deterministic merge behavior for duplicate node IDs: highest heartbeat_sequence controls visible state, equal sequences keep first-seen visible values, and heartbeat_count counts all valid heartbeats across inputs.
  • Added CLI discover-local-peers subcommand with repeatable --message-log-path arguments, read-only output-only behavior, and existing PeerRegistryError handling.
  • Extended parser help and command registration snapshots to include the new command.
  • Added peer-registry and CLI tests for multi-log aggregation, duplicate merges, equal-sequence ties, malformed input errors, non-creation/immutability on failure, and expected usage/help behavior.
  • Updated README with an example showing two announce-local-node calls followed by discover-local-peers.

Validation

  • Executed: PYTHONDONTWRITEBYTECODE=1 PYTHONPATH=src python -m unittest discover -s tests -v
  • Result: all tests passed (306 tests, OK) including the new peer discovery unit and CLI coverage.
  • Validation evidence is from the locally run test command/output for this branch.

Safety notes

  • No force push used.
  • No hard reset used.
  • Local automation paths are not published in this PR body.

@Exohayvan
Exohayvan force-pushed the ai/next-step-20260630-044153 branch from 251a729 to 03801a7 Compare June 30, 2026 15:51
@Exohayvan

Copy link
Copy Markdown
Contributor Author

Closing during PR cleanup: this peer discovery/roster helper now conflicts with main after #50 merged . The merged command covers the active peer-log dispatch path, so this older overlapping PR is not being kept alive.

@Exohayvan Exohayvan closed this Jun 30, 2026
@Exohayvan
Exohayvan deleted the ai/next-step-20260630-044153 branch June 30, 2026 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant