causality

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2026 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package causality derives and traverses event lineage for DevTools.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

type Engine struct{}

Engine provides causal edge linking and tracing.

func NewEngine

func NewEngine() *Engine

NewEngine constructs an Engine.

func (*Engine) Annotate

func (e *Engine) Annotate(ev bus.Event) bus.Event

Annotate returns ev unchanged in Phase D; reserved for richer derivation rules.

func (*Engine) LinkForward

func (e *Engine) LinkForward(b *bus.Bus, parent, child uint64) bool

LinkForward links parent as a cause for child on the bus.

func (*Engine) Trace

func (e *Engine) Trace(ctx context.Context, b *bus.Bus, root uint64, opts TraceOptions) Result

Trace walks parent/cause and child edges from root within opts limits.

type Node

type Node struct {
	Event bus.Event `json:"event"`
	Cold  bool      `json:"cold"`
}

Node is a single traced event node.

type Result

type Result struct {
	RootSeq uint64 `json:"root_seq"`
	Nodes   []Node `json:"nodes"`
}

Result contains a traced causal neighborhood around a root event.

type TraceOptions

type TraceOptions struct {
	Depth   int
	Breadth int
}

TraceOptions controls lineage expansion depth and breadth.

Jump to

Keyboard shortcuts

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