diff --git a/cmd/orchestra/main.go b/cmd/orchestra/main.go index 62893d6..77d2fc1 100644 --- a/cmd/orchestra/main.go +++ b/cmd/orchestra/main.go @@ -45,7 +45,24 @@ func main() { continue } client := herdr.New(h.Address) - adapters[h.ID] = herdr.Codex(client, 200000) + protocol := h.Protocol + if protocol == "" { + protocol = os.Getenv("ORCHESTRA_HERDR_PROTOCOL") + } + if err := client.CheckProtocol(context.Background(), protocol); err != nil { + log.Printf("herdr %s unavailable: %v", h.ID, err) + continue + } + switch h.Harness { + case "claude": + adapters[h.ID] = herdr.Claude(client, 200000) + case "opencode": + adapters[h.ID] = herdr.OpenCode(client, 200000) + case "codex", "": + adapters[h.ID] = herdr.Codex(client, 200000) + default: + log.Printf("herdr %s has unsupported harness %q", h.ID, h.Harness) + } } coordinator := &orchestrator.Coordinator{Store: s, Worktrees: orchestrator.GitWorktrees{Root: root, Repo: repo}, Adapters: orchestrator.AdapterFactory{Herdrs: adapters}} rt.OnLease = func(e domain.Event) error { return coordinator.Start(context.Background(), e) } diff --git a/internal/registry/registry.go b/internal/registry/registry.go index eae749b..1b22f28 100644 --- a/internal/registry/registry.go +++ b/internal/registry/registry.go @@ -30,6 +30,8 @@ type Herdr struct { ID string `json:"id"` MachineID string `json:"machine_id"` Address string `json:"address,omitempty"` + Harness string `json:"harness,omitempty"` + Protocol string `json:"protocol,omitempty"` Capabilities []string `json:"capabilities"` Concurrency int `json:"concurrency"` } diff --git a/progress.md b/progress.md index f521a7e..63b80bb 100644 --- a/progress.md +++ b/progress.md @@ -55,6 +55,8 @@ The lifecycle API contract pass now requires callers to provide explicit release Item 1 substrate hardening pass: newly appended events use schema envelope version 1; replay rejects unsupported versions and non-object payloads; and `TaskLeased` carries an `expected_version` guard that is checked before append. Legacy envelope events remain readable for tolerant replay. +Harness registration now uses configured `harness` and `protocol` fields, pings each configured herdr before exposing it to orchestration, selects Claude/Codex/opencode adapters accordingly, and skips unavailable or unsupported deployments at startup. This is an initial discovery/health slice; active-session discovery and ongoing heartbeats remain open. + Recommended order: 1. Add the orchestration coordinator: lease → worktree → harness session → bootstrap → lifecycle events.