Skip to content

Add heartbeat-based local peer dispatch command - #49

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

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

Conversation

@Exohayvan

Copy link
Copy Markdown
Contributor

Objective

Add a new CLI path that dispatches manifest jobs using peers discovered from a local heartbeat message log, replacing static manifest node rosters for this dispatch flow. This moves scheduling toward local peer-driven behavior while keeping the prototype fully local and deterministic.

What changed

  • Added scheduled_nodes_from_heartbeat_log in the peer registry layer to build deterministic ScheduledNode entries from latest heartbeat-derived peer state, including status/capability validation and stable ordering.
  • Added load_job_manifest_jobs in manifest loading to read jobs independently from node rosters when needed.
  • Added a new CLI command dispatch-local-peers with required inputs for peer heartbeat log, manifest, and output dispatch log.
  • Wired dispatch execution to reuse the existing dispatch pipeline with heartbeat-derived nodes and emitted assignments, then wrote dispatch logs with source set to dispatch-local-peers.
  • Added parser/help snapshots and argument contract coverage for the new command.
  • Added CLI and peer registry tests for happy path assignment, deterministic sorting/latest-heartbeat behavior, and expected error cases that must not truncate/overwrite outputs.
  • Updated README with usage and behavior note for the new local peer dispatch command.

Validation

  • Ran targeted local validation via tests and confirmed command behavior plus safety semantics in test coverage.
  • Ran full test suite: PYTHONDONTWRITEBYTECODE=1 PYTHONPATH=src python -m unittest discover -s tests -v.
  • Result: all tests passed (303).
  • Validation details are based on repository test execution and in-repo test coverage.

Safety notes

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

@Exohayvan

Copy link
Copy Markdown
Contributor Author

Automated review did not approve this PR

Automated Hermes/GPT-5.5 review decision for PR #49: bad.

Review notes

Ad-hoc verification was run again, using an OS-safe temporary script path under:

[local temp path redacted]

Script created:
[local temp path redacted]

What the ad-hoc script verified:

  • Created temporary peer heartbeat and job manifest data using tempfile.
  • Ran dispatch-local-peers against the PR behavior.
  • Confirmed heartbeat-discovered capable peers were assigned deterministically:
    • echo-1 -> node-a
    • stats-1 -> node-b
  • Ran process-local-inbox for both assigned nodes.
  • Confirmed both assignments validated successfully.
  • Confirmed ledger total_units reached 2.

Result:
AD_HOC_VERIFICATION_OK dispatch-local-peers assigned heartbeat-discovered capable peers and both worker replays validated

Cleanup:

  • Removed the temporary hermes-verify-* script files from the requested temp directory where possible.

This is explicitly ad-hoc verification of the changed behavior, not a claim that the full canonical suite is freshly green.

Safety notes

  • Local review log path intentionally redacted.
  • No force push used by the automation.
  • No hard reset used by the automation.

@Exohayvan
Exohayvan force-pushed the ai/next-step-20260630-032012 branch from 0250a2c to 4d98407 Compare June 30, 2026 15:52
@Exohayvan

Copy link
Copy Markdown
Contributor Author

Closing during PR cleanup: #50 has merged the peer-dispatch path as , so this older heartbeat dispatch PR is superseded and now conflicts with main.

@Exohayvan Exohayvan closed this Jun 30, 2026
@Exohayvan
Exohayvan deleted the ai/next-step-20260630-032012 branch June 30, 2026 16:12
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