toposort

package
v0.1.0-proto2b Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2026 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package toposort is the one dependency-ordering implementation shared by the agent registry and the agent manager (review R5: centralize; R14: soft-dependency semantics). Hard edges order and cycle-reject; soft edges order when satisfiable and are dropped - never an error, never blocking - when they would form a cycle ("Wants orders, never blocks").

Index

Constants

This section is empty.

Variables

View Source
var ErrCycle = errors.New("toposort: hard dependency cycle")

ErrCycle is returned when the HARD dependency graph is cyclic. Soft cycles are broken silently by dropping soft edges.

Functions

func Sort

func Sort(hard, soft map[string][]string) ([]string, error)

Sort returns a start order for the nodes (the keys of hard). Both maps are node -> dependencies (things that must/should start first). Deps naming unknown nodes are ignored (external services). The result is deterministic: ties break lexicographically.

Types

This section is empty.

Jump to

Keyboard shortcuts

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