coordinator

package
v0.4.6 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ReasonRunEnqueued        = "task_run_enqueued"
	ReasonRecovery           = "recovery"
	ReasonCoordinatorStopped = "coordinator_stopped"

	DecisionBootstrap        = "bootstrap"
	DecisionDisabled         = "disabled"
	DecisionGlobalScope      = "global_scope"
	DecisionMissingWorkspace = "missing_workspace"
	DecisionNonExecutableRun = "non_executable_run"
	DecisionLoopWorker       = "loop_action"
	DecisionTaskRunMismatch  = "task_run_mismatch"
	DecisionExisting         = "existing_coordinator"
	DecisionDenied           = "denied"
	DecisionFailed           = "failed"
)

Variables

This section is empty.

Functions

func ExecutableRunStatuses

func ExecutableRunStatuses() []taskpkg.RunStatus

ExecutableRunStatuses returns every open run state considered by recovery.

func HealthySession

func HealthySession(info *session.Info, workspaceID string, now time.Time) bool

HealthySession reports whether a session snapshot is an active coordinator for the workspace.

func IsExecutableRunStatus

func IsExecutableRunStatus(status taskpkg.RunStatus) bool

IsExecutableRunStatus reports whether a run still represents executable work that may need coordinator orchestration.

func Lineage

Lineage builds root lineage metadata for a managed coordinator session.

func PermissionPolicy

func PermissionPolicy() store.SessionPermissionPolicy

PermissionPolicy returns the restricted coordinator root permission policy.

func PromptOverlay

func PromptOverlay(input PromptInput) string

PromptOverlay assembles the coordinator's first-run situation and available public API surface.

func SpawnRoleAllowed

func SpawnRoleAllowed(role string) bool

SpawnRoleAllowed reports whether a coordinator may request the given child role through the public safe-spawn API.

func ToolAllowed

func ToolAllowed(tool string) bool

ToolAllowed reports whether a concrete tool/action is coordinator-safe.

func ToolAllowlist

func ToolAllowlist() []string

ToolAllowlist returns the orchestration-safe tool surface granted to coordinator sessions.

Types

type Decision

type Decision struct {
	ShouldBootstrap bool
	Reason          string
	ProfileID       string
	WorkspaceID     string
	TaskID          string
	RunID           string
	WorkflowID      string
}

Decision describes whether a task run is eligible to bootstrap a workspace coordinator.

func DecideBootstrap

func DecideBootstrap(task taskpkg.Task, run taskpkg.Run, cfg compozyconfig.ResolvedCoordinatorRole) Decision

DecideBootstrap evaluates the mechanical coordinator bootstrap rules. It does not check for already-running coordinator sessions; that singleton check belongs to the daemon runtime.

type PromptInput

type PromptInput struct {
	WorkspaceID     string
	TaskID          string
	RunID           string
	WorkflowID      string
	WorkerWorktrees []WorkerWorktreeBinding
}

PromptInput captures the first-run situation given to a coordinator session.

type WorkerWorktreeBinding

type WorkerWorktreeBinding struct {
	RunID      string
	WorktreeID string
}

WorkerWorktreeBinding identifies the worktree assigned to one active worker run.

Jump to

Keyboard shortcuts

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