orchestrator

package
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 29, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package orchestrator implements the Task Orchestrator — Feature 4 of synapses-intelligence.

When two or more agents try to claim overlapping code scopes, the orchestrator uses the LLM to suggest an intelligent work distribution: it tells the new agent what alternative scope to focus on instead of conflicting with the existing agent.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Orchestrator

type Orchestrator struct {
	// contains filtered or unexported fields
}

Orchestrator suggests work distribution when agents conflict.

func New

func New(client llm.LLMClient, timeout time.Duration) *Orchestrator

New creates an Orchestrator.

func (*Orchestrator) Coordinate

func (o *Orchestrator) Coordinate(ctx context.Context, req Request) (Response, error)

Coordinate suggests how to resolve conflicting work claims. If only a single conflict exists, the suggestion is specific and actionable. Results are NOT cached since agent states change rapidly.

type Request

type Request struct {
	NewAgentID        string
	NewScope          string
	ConflictingClaims []WorkClaim
}

Request describes the conflict to resolve.

type Response

type Response struct {
	Suggestion       string
	AlternativeScope string
}

Response suggests how the new agent should proceed.

func DeterministicCoordinate

func DeterministicCoordinate(req Request) Response

DeterministicCoordinate returns a rule-based conflict resolution response without calling any LLM. Used by brain_impl.go when the orchestrate circuit is open — guarantees a non-empty, always-correct response even when all LLM tiers are unavailable. No external dependencies; cannot fail.

type WorkClaim

type WorkClaim struct {
	AgentID   string
	Scope     string
	ScopeType string
}

WorkClaim is an existing agent's active work claim.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL