fix(pool): ignore remote peer IDs in roster logs#95
Closed
DeployFaith wants to merge 1 commit into
Closed
Conversation
Owner
Author
|
Superseded by #94. The local peer-ID trust-boundary fix and adversarial regression coverage were integrated there, the stale registry fixture was corrected to assert the secure authorization contract, and the complete CI matrix passed before merge. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
"peer_id"in daemon logs to be considered the profile's own PeerID, which lets later remote task/discovery entries poison the local roster and cause misrouting of delegated work.Description
_read_peer_idinhermes-agency/pool/roster.pyto only match explicit own-node startup markers (PEER_ID=lines oragentanycastd startedJSON lines) instead of any JSON"peer_id"occurrences.re.findallwith a pattern aligned to the existingOWN_PEER_ID_LINE_REbehavior and return the latest matching startup marker in the checked window.test_read_peer_id_ignores_later_remote_json_peer_idstohermes-agency/tests/test_agent_lifecycle.pythat ensures later remote JSON entries do not override a localPEER_ID.hermes-agency/pool/roster.pyandhermes-agency/tests/test_agent_lifecycle.pyto keep the fix minimal and focused.Testing
python -m pytest -q hermes-agency/tests/test_agent_lifecycle.py::test_read_peer_id_uses_latest_log_position_for_mixed_formats hermes-agency/tests/test_agent_lifecycle.py::test_read_peer_id_ignores_later_remote_json_peer_ids, and both tests passed.python -m pytest -q hermes-agency/tests/test_agent_lifecycle.py, and all tests in that file passed (18 passed, 1 warning).ruff checkand formatting checksruff format --checkand appliedruff formatwhere needed; afterwards the checks passed.make test-agency, which failed in this environment due to missing async pytest support (pytest.mark.asynciounknown) and is unrelated to this focused change.npm run lint/npm run typecheck/npm testwere not run because the repository root has nopackage.jsonin this environment.Codex Task