evidence

package
v0.1.16 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func VerifyEvidence

func VerifyEvidence(evidenceType, content string, cfg *config.Config) (bool, error)

VerifyEvidence verifies evidence using the appropriate verifier

Types

type CmdExit0Verifier

type CmdExit0Verifier struct{}

CmdExit0Verifier executes a command and checks if it exits with code 0

func (*CmdExit0Verifier) GetType

func (v *CmdExit0Verifier) GetType() string

func (*CmdExit0Verifier) Verify

func (v *CmdExit0Verifier) Verify(command string, cfg *config.Config) (bool, error)

CmdExit0Verifier is potentially unsafe or nondeterministic and is disabled by default.

type FileExistsVerifier

type FileExistsVerifier struct{}

FileExistsVerifier checks if a file exists

func (*FileExistsVerifier) GetType

func (v *FileExistsVerifier) GetType() string

func (*FileExistsVerifier) Verify

func (v *FileExistsVerifier) Verify(filePath string, cfg *config.Config) (bool, error)

FileExistsVerifier is deterministic and safe (local filesystem only).

type GrepHitVerifier

type GrepHitVerifier struct{}

GrepHitVerifier checks if a pattern exists in a file

func (*GrepHitVerifier) GetType

func (v *GrepHitVerifier) GetType() string

func (*GrepHitVerifier) Verify

func (v *GrepHitVerifier) Verify(patternAndFile string, cfg *config.Config) (bool, error)

GrepHitVerifier is deterministic and safe (local filesystem only).

type Service

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

Service handles evidence operations

func NewService

func NewService(db *storage.DB, cfg *config.Config) *Service

NewService creates a new evidence service

func (*Service) AddEvidence

func (s *Service) AddEvidence(memoryID int64, evidenceType, content string) (*memory.Evidence, error)

AddEvidence adds evidence for a memory

func (*Service) GetEvidenceForMemory

func (s *Service) GetEvidenceForMemory(memoryID int64) ([]*memory.Evidence, error)

GetEvidenceForMemory retrieves all evidence for a memory

func (*Service) IsMemoryValidated

func (s *Service) IsMemoryValidated(mem *memory.Memory) (bool, error)

IsMemoryValidated checks if a memory is properly validated based on its type and evidence

func (*Service) VerifyEvidenceForMemory

func (s *Service) VerifyEvidenceForMemory(memoryID int64) (bool, error)

VerifyEvidenceForMemory verifies all evidence for a specific memory

type TestPassVerifier

type TestPassVerifier struct{}

TestPassVerifier checks if a test passes (placeholder implementation)

func (*TestPassVerifier) GetType

func (v *TestPassVerifier) GetType() string

func (*TestPassVerifier) Verify

func (v *TestPassVerifier) Verify(testIdentifier string, cfg *config.Config) (bool, error)

TestPassVerifier is potentially unsafe or nondeterministic and is disabled by default.

type Verifier

type Verifier interface {
	Verify(content string, cfg *config.Config) (bool, error)
	GetType() string
}

Verifier defines the interface for evidence verification

Jump to

Keyboard shortcuts

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