Skip to content

feat: strengthen edge reporter module - #25

Open
Gavriel-lab wants to merge 1 commit into
Clawland-AI:mainfrom
Gavriel-lab:codex/edge-reporter-module
Open

feat: strengthen edge reporter module#25
Gavriel-lab wants to merge 1 commit into
Clawland-AI:mainfrom
Gavriel-lab:codex/edge-reporter-module

Conversation

@Gavriel-lab

Copy link
Copy Markdown

Summary

Implements the Edge Reporter Module bounty scope from the Clawland bounty board and closes #24.

This PR strengthens pkg/edge/reporter.go so PicClaw can act as a Fleet/MoltClaw reporting edge node with:

  • startup registration to /fleet/register
  • immediate and periodic heartbeats to /fleet/heartbeat
  • status snapshots to /fleet/status
  • event-driven reports to /fleet/events
  • bearer-token propagation for fleet auth
  • safe default heartbeat intervals when config is missing/zero
  • idempotent Stop() to avoid double-close panics during shutdown
  • endpoint joining that handles trailing slashes cleanly

I also added focused httptest coverage for registration, heartbeat, status, events, auth headers, HTTP error handling, default interval fallback, and idempotent stop behavior.

Validation

$ gofmt -w pkg/edge/reporter.go pkg/edge/reporter_test.go
$ go test ./pkg/edge
ok  	github.com/sipeed/picoclaw/pkg/edge	0.975s
$ git diff --check
# passed

I also ran go test ./.... The new edge package passed, but the full suite currently fails in the existing untouched pkg/gene package:

--- FAIL: TestSelectGenes_SortedByScore (0.00s)
    selector_test.go:175: expected highest-scoring gene first, got low
FAIL	github.com/sipeed/picoclaw/pkg/gene	0.901s

This PR only changes README.md, pkg/edge/reporter.go, and pkg/edge/reporter_test.go.

@Gavriel-lab
Gavriel-lab requested a review from Tonyfudecai as a code owner May 31, 2026 15:44
@Gavriel-lab

Copy link
Copy Markdown
Author

Follow-up on the full-suite validation note: I opened a separate minimal baseline fix for the existing pkg/gene selector ordering failure here:

#26

That PR keeps the fix isolated from this edge API work. Locally, after the gene selector tie-breaker fix, go test ./... passes on the base tree.

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.

bounty: edge reporter module

1 participant