executionprotection

package
v0.1.35 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CanonicalJSON

func CanonicalJSON(value interface{}) ([]byte, error)

CanonicalJSON encodes the JSON data model deterministically.

func ClaimKey

func ClaimKey(ruleID, canonicalToolName, turnID, semanticHash string) (string, error)

ClaimKey computes the length-prefixed v1 claim identity.

Types

type ClaimRecord

type ClaimRecord struct {
	ClaimKey          string
	RuleID            string
	CanonicalToolName string
	TurnID            string
	SemanticHash      string
	CreatedAt         time.Time
}

type Repository

type Repository interface {
	Claim(ctx context.Context, record ClaimRecord) (bool, error)
	Finish(ctx context.Context, claimKey string, state toolprotection.State, finishedAt time.Time) error
}

func NewDAORepository

func NewDAORepository(dao *datly.Service) Repository

NewDAORepository retains the existing DAO without opening a connector or checking schema. Missing persistence fails only when a protected call claims.

type Service

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

func (*Service) Claim

func (s *Service) Claim(ctx context.Context, name string, args map[string]interface{}) (toolprotection.Claim, error)

func (*Service) Finish

func (s *Service) Finish(ctx context.Context, claim toolprotection.Claim, state toolprotection.State)

func (*Service) IsProtected

func (s *Service) IsProtected(name string) bool

Jump to

Keyboard shortcuts

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