kernelruntime

package
v0.0.0-...-ef7711a Latest Latest
Warning

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

Go to latest
Published: May 9, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActorContext

type ActorContext struct {
	TenantID               string                 `json:"tenant_id"`
	OrgID                  string                 `json:"org_id"`
	WorkspaceID            string                 `json:"workspace_id"`
	RoleID                 string                 `json:"role_id"`
	Environment            string                 `json:"environment"` // dev|stage|prod
	Jurisdiction           string                 `json:"jurisdiction"`
	DataClassesAllowed     []string               `json:"data_classes_allowed"`
	ApprovalAuthorityScope map[string]interface{} `json:"approval_authority_scope"`
	Identity               Identity               `json:"identity"`
	SessionID              string                 `json:"session_id"`
	RequestID              string                 `json:"request_id"`
}

ActorContext v2 See helm://schemas/actor_context/v2.json

func (*ActorContext) CanonicalHash

func (c *ActorContext) CanonicalHash() (string, error)

CanonicalHash returns the deterministic hash of the ActorContext.

type Identity

type Identity struct {
	Subject      string `json:"subject"`
	Issuer       string `json:"issuer"`
	AuthTime     string `json:"auth_time"`
	AuthStrength string `json:"auth_strength"`
}

type KernelRuntime

type KernelRuntime interface {
	// SubmitIntent proposes an effect.
	// It enters the Decision Engine -> ExecutionIntent -> SafeExecutor pipeline.
	SubmitIntent(ctx context.Context, intent *SignedIntent) (*Receipt, error)

	// Query executes a read against a projection.
	// Reads are auditable and subject to policy.
	Query(ctx context.Context, query *QueryRequest) (*QueryResult, error)

	// CheckHealth returns the status of the runtime components.
	CheckHealth(ctx context.Context) error
}

KernelRuntime is the sole gateway for effecting change or reading state. All capabilities must be invoked through this interface.

type QueryRequest

type QueryRequest struct {
	Projection string
	Params     map[string]interface{}
}

QueryRequest defines a read operation.

type QueryResult

type QueryResult struct {
	Data interface{}
}

QueryResult returns data.

type Receipt

type Receipt struct {
	ID        string
	TenantID  string
	Status    string
	Timestamp int64
}

Receipt is the proof of submission (async) or execution (sync).

type Runtime

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

Runtime is the concrete implementation of the Kernel.

func NewRuntime

func NewRuntime(
	eventRepo interfaces.EventRepository,
	projEng interfaces.ProjectionEngine,
	keyring *crypto.KeyRing,
) *Runtime

func (*Runtime) CheckHealth

func (r *Runtime) CheckHealth(ctx context.Context) error

func (*Runtime) Query

func (r *Runtime) Query(ctx context.Context, query *QueryRequest) (*QueryResult, error)

func (*Runtime) SubmitIntent

func (r *Runtime) SubmitIntent(ctx context.Context, intent *SignedIntent) (*Receipt, error)

type Server

type Server struct{}

func New

func New(cfg *config.Config) *Server

func (*Server) Start

func (s *Server) Start() error

type SignedIntent

type SignedIntent struct {
	TenantID  string
	ActorID   string
	Context   *ActorContext // V2 Context
	Payload   []byte        // JSON serialized intent
	Signature []byte
}

SignedIntent is a wrapper around an intent payload, signed by an actor. This is the Node 9 (Decision & Execution) intent envelope.

Jump to

Keyboard shortcuts

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