why

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package why wraps the internal run-level causal explainer (data-plane-memory A3) for use by the REST controller. It mirrors the thin service pattern used by the lineage and run services: a context + a run.Store, with a WithDatabase override for tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

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

Service explains why a task in a run executed / hit cache / re-ran.

func New

func New(ctx context.Context) *Service

New creates a Service backed by the default run store.

func (*Service) Why

func (s *Service) Why(runID uuid.UUID, taskRef string) (*runstorage.WhyExplanation, error)

Why returns the causal explanation for taskRef (a task UUID or name) in run runID. A fanned step is answered as a group summary; use WhyPartition to select one instance.

func (*Service) WhyPartition

func (s *Service) WhyPartition(runID uuid.UUID, taskRef, partition string) (*runstorage.WhyExplanation, error)

WhyPartition returns the causal explanation for ONE fan-out instance of taskRef, selected by its partition value. An empty partition is identical to Why. runstorage.ErrPartitionNotFound (whose message lists the available values) when the group holds no such partition.

func (*Service) WithDatabase

func (s *Service) WithDatabase(conn *gorm.DB) *Service

WithDatabase returns a copy of the Service whose run store is backed by the given connection; used in tests to inject an in-memory database.

Jump to

Keyboard shortcuts

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