Documentation
¶
Overview ¶
Package graph defines the portable graph vocabulary shared across hawk-eco.
The package contains data contracts only. Individual repositories retain ownership of their graph storage, projections, and runtime behavior.
Graph Engineering Patterns: This package implements the foundational patterns from LangGraph, Microsoft AutoGen, and Google ADK for multi-agent orchestration as nodes, edges, and shared state.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArtifactRef ¶
type ArtifactRef struct {
URI string `json:"uri"`
Digest string `json:"digest,omitempty"`
MediaType string `json:"media_type,omitempty"`
}
ArtifactRef points to immutable evidence outside the contract payload.
type Edge ¶
type Edge struct {
ID string `json:"id"`
Kind EdgeKind `json:"kind"`
From Ref `json:"from"`
To Ref `json:"to"`
Scope Scope `json:"scope,omitempty"`
CreatedAt time.Time `json:"created_at"`
EffectiveAt time.Time `json:"effective_at,omitempty"`
Provenance Provenance `json:"provenance"`
Attributes map[string]string `json:"attributes,omitempty"`
}
Edge is a typed, temporal relationship between two graph nodes.
type EdgeCondition ¶
type EdgeCondition struct {
Expression string `json:"expression,omitempty"`
Variables map[string]string `json:"variables,omitempty"`
}
EdgeCondition represents a conditional edge in orchestration graphs. When non-empty, the edge is only followed if the condition evaluates to true.
type EdgeKind ¶
type EdgeKind string
EdgeKind identifies a portable relationship between two graph nodes.
func ParseEdgeKind ¶
ParseEdgeKind normalizes a graph edge kind.
type EdgeSpec ¶
type EdgeSpec struct {
From string `json:"from"`
To string `json:"to"`
Condition *EdgeCondition `json:"condition,omitempty"`
Weight float64 `json:"weight,omitempty"`
}
EdgeSpec describes an edge in an orchestration graph.
type Event ¶
type Event struct {
ID string `json:"id"`
Type EventType `json:"type"`
Subject Ref `json:"subject"`
Scope Scope `json:"scope,omitempty"`
OccurredAt time.Time `json:"occurred_at"`
CorrelationID string `json:"correlation_id,omitempty"`
CausationID string `json:"causation_id,omitempty"`
IdempotencyKey string `json:"idempotency_key,omitempty"`
Provenance Provenance `json:"provenance"`
}
Event records an immutable lifecycle observation for a graph subject.
type EventType ¶
type EventType string
EventType identifies a lifecycle event for a graph subject.
func ParseEventType ¶
ParseEventType normalizes a graph event type.
type GraphSpec ¶
type GraphSpec struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
Nodes []NodeSpec `json:"nodes"`
Edges []EdgeSpec `json:"edges"`
Metadata map[string]string `json:"metadata,omitempty"`
}
GraphSpec describes a complete orchestration graph.
type Node ¶
type Node struct {
ID string `json:"id"`
Kind NodeKind `json:"kind"`
Scope Scope `json:"scope,omitempty"`
CreatedAt time.Time `json:"created_at"`
EffectiveAt time.Time `json:"effective_at,omitempty"`
Provenance Provenance `json:"provenance"`
Attributes map[string]string `json:"attributes,omitempty"`
}
Node is a typed, temporal graph fact. Attributes are intentionally bounded to strings; large or sensitive data belongs in ArtifactRef evidence.
type NodeKind ¶
type NodeKind string
NodeKind classifies a node by the ecosystem view to which it belongs.
func ParseNodeKind ¶
ParseNodeKind normalizes a graph node kind.
type NodeSpec ¶
type NodeSpec struct {
ID string `json:"id"`
Type NodeType `json:"type"`
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
Config map[string]string `json:"config,omitempty"`
}
NodeSpec describes a node in an orchestration graph.
type NodeType ¶
type NodeType string
NodeType represents the specific type/behavior of a node in the graph
const ( // NodeTypeAgent represents an autonomous agent that can make decisions NodeTypeAgent NodeType = "agent" // NodeTypeTool represents a tool/function that agents can invoke NodeTypeTool NodeType = "tool" // NodeTypeFunction represents a function node (deterministic operation) NodeTypeFunction NodeType = "function" // NodeTypeStart represents the entry point of a graph NodeTypeStart NodeType = "start" // NodeTypeEnd represents the termination point of a graph NodeTypeEnd NodeType = "end" // NodeTypeRouter represents a conditional routing node NodeTypeRouter NodeType = "router" // NodeTypeQuality represents a code quality analysis node NodeTypeQuality NodeType = "quality" // NodeTypeExecution represents an execution journal node NodeTypeExecution NodeType = "execution" // NodeTypeOperations represents an operations orchestration node NodeTypeOperations NodeType = "operations" // NodeTypeSystem is an alias for NodeKindSystem for backward compatibility NodeTypeSystem NodeType = "system" )
func ParseNodeType ¶
ParseNodeType normalizes a graph node type.
type Provenance ¶
type Provenance struct {
Producer string `json:"producer"`
Version string `json:"version,omitempty"`
SourceID string `json:"source_id,omitempty"`
Evidence []ArtifactRef `json:"evidence,omitempty"`
}
Provenance identifies the producer and evidence for a graph fact.
func (Provenance) Validate ¶
func (p Provenance) Validate() error
Validate reports whether p can support an auditable graph fact.