closure

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package closure computes the transitive closure of cleat functions, validates supported Go constructs, and verifies HostCalls threading.

Package closure computes the transitive closure of cleat workflow functions — the set of all functions that transitively reach a cleat leaf (a function calling HostCalls). It validates supported Go constructs and verifies HostCalls threading through the closure.

Key types:

  • Result — annotated functions with durability tags and validation errors

Key functions:

  • Compute — computes the cleat closure from analysis and call graph

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Result

type Result struct {
	DurableLeaves  map[string]bool
	DurableClosure map[string]bool
	Pure           map[string]bool
	Errors         map[string][]ValidationError
	Warnings       map[string][]ValidationWarning
}

Result holds the results of closure computation and validation.

func Compute

func Compute(result *analyzer.AnalysisResult, cg *callgraph.Graph) *Result

Compute computes the cleat closure: the set of all functions that transitively reach a cleat leaf. It annotates each function with its durability tag (DurableLeaf, DurableClosure, or Pure) and validates that cleat functions don't use unsupported Go constructs.

func (*Result) NumErrors

func (cr *Result) NumErrors() int

NumErrors returns the total number of validation errors.

func (*Result) NumWarnings

func (cr *Result) NumWarnings() int

NumWarnings returns the total number of warnings.

type ThreadingError

type ThreadingError struct {
	FuncName string
	Chain    []string // call chain from entry point to this function
	Line     int
	Message  string
}

ThreadingError records a function in the cleat closure that lacks access to HostCalls with the call chain that leads to it.

func VerifyThreading

func VerifyThreading(result *analyzer.AnalysisResult, cg *callgraph.Graph, cr *Result) []ThreadingError

VerifyThreading checks that every function in the cleat closure has access to cleat.HostCalls through its parameter list, through a package-level global var h, or through a caller that passes it.

type ValidationError

type ValidationError struct {
	Code       string
	FuncName   string
	Message    string
	Suggestion string
	Line       int
}

ValidationError represents a validation error with its error code.

func (ValidationError) Error

func (e ValidationError) Error() string

Error returns a string with the error code prefix and message.

type ValidationWarning

type ValidationWarning struct {
	Code       string
	FuncName   string
	Message    string
	Suggestion string
	Line       int
}

ValidationWarning represents a validation warning.

Jump to

Keyboard shortcuts

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