projectevidence

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClaimStatusCandidate = "candidate"
	ClaimStatusValidated = "validated"
	ClaimStatusPromoted  = "promoted"
	ClaimStatusRejected  = "rejected"

	EvidenceKindContextPack = "context_pack"
	EvidenceKindFile        = "file"
	EvidenceKindChunk       = "chunk"
	EvidenceKindSymbol      = "symbol"
	EvidenceKindVerifier    = "verifier"
	EvidenceKindClaimCheck  = "claim_check"
	EvidenceKindArtifact    = "artifact"
	EvidenceKindOther       = "other"

	DecisionStateValidated = "validated"
	DecisionStatePromoted  = "promoted"
	DecisionStateRejected  = "rejected"

	ActionKindCodeChange    = "code_change"
	ActionKindDocChange     = "doc_change"
	ActionKindVerifierRun   = "verifier_run"
	ActionKindConfigChange  = "config_change"
	ActionKindReviewComment = "review_comment"
	ActionKindOther         = "other"

	OutcomeKindTest         = "test"
	OutcomeKindBuild        = "build"
	OutcomeKindClaimCheck   = "claim_check"
	OutcomeKindManualReview = "manual_review"
	OutcomeKindPromotion    = "promotion"
	OutcomeKindFailure      = "failure"
	OutcomeKindOther        = "other"

	OutcomeStatusPassed  = "passed"
	OutcomeStatusFailed  = "failed"
	OutcomeStatusBlocked = "blocked"
	OutcomeStatusUnknown = "unknown"

	PromotionStateCandidate = "candidate"
	PromotionStateValidated = "validated"
	PromotionStatePromoted  = "promoted"
	PromotionStateRejected  = "rejected"
)

Variables

View Source
var ErrInvalidInput = errors.New("invalid input")

Functions

This section is empty.

Types

type Action

type Action struct {
	ID           string    `json:"id"`
	ProjectID    string    `json:"project_id"`
	ClaimID      string    `json:"claim_id"`
	DecisionID   string    `json:"decision_id"`
	ActionRef    string    `json:"action_ref"`
	ActionKind   string    `json:"action_kind"`
	Summary      string    `json:"summary,omitempty"`
	ChangedFiles []string  `json:"changed_files,omitempty"`
	RunID        string    `json:"run_id,omitempty"`
	CreatedAt    time.Time `json:"created_at"`
}

type AppendEvidenceInput

type AppendEvidenceInput struct {
	ProjectID    string `json:"project_id"`
	ClaimID      string `json:"claim_id"`
	EvidenceRef  string `json:"evidence_ref"`
	EvidenceKind string `json:"evidence_kind"`
	SourceRef    string `json:"source_ref,omitempty"`
	Summary      string `json:"summary,omitempty"`
}
type ArtifactLink struct {
	ProjectID    string `json:"project_id"`
	ClaimID      string `json:"claim_id"`
	ArtifactRef  string `json:"artifact_ref"`
	ArtifactKind string `json:"artifact_kind,omitempty"`
	RunID        string `json:"run_id,omitempty"`
}

type Claim

type Claim struct {
	ID        string    `json:"id"`
	ProjectID string    `json:"project_id"`
	RunID     string    `json:"run_id,omitempty"`
	TraceID   string    `json:"trace_id,omitempty"`
	ClaimRef  string    `json:"claim_ref"`
	Summary   string    `json:"summary"`
	Status    string    `json:"status"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

type ClaimFilter

type ClaimFilter struct {
	ArtifactRef    string
	PromotionState string
	OutcomeStatus  string
	RunID          string
	TraceID        string
}

type ClaimRecord

type ClaimRecord struct {
	Claim          Claim           `json:"claim"`
	Evidence       []Evidence      `json:"evidence,omitempty"`
	Decisions      []Decision      `json:"decisions,omitempty"`
	Actions        []Action        `json:"actions,omitempty"`
	Outcomes       []Outcome       `json:"outcomes,omitempty"`
	ArtifactLinks  []ArtifactLink  `json:"artifact_links,omitempty"`
	PromotionLinks []PromotionLink `json:"promotion_links,omitempty"`
}

type CreateActionInput

type CreateActionInput struct {
	ProjectID    string   `json:"project_id"`
	ClaimID      string   `json:"claim_id"`
	DecisionID   string   `json:"decision_id"`
	ActionRef    string   `json:"action_ref"`
	ActionKind   string   `json:"action_kind"`
	Summary      string   `json:"summary,omitempty"`
	ChangedFiles []string `json:"changed_files,omitempty"`
	RunID        string   `json:"run_id,omitempty"`
}

type CreateClaimInput

type CreateClaimInput struct {
	ProjectID string `json:"project_id"`
	RunID     string `json:"run_id,omitempty"`
	TraceID   string `json:"trace_id,omitempty"`
	ClaimRef  string `json:"claim_ref"`
	Summary   string `json:"summary"`
	Status    string `json:"status,omitempty"`
}

type CreateDecisionInput

type CreateDecisionInput struct {
	ProjectID   string `json:"project_id"`
	ClaimID     string `json:"claim_id"`
	DecisionRef string `json:"decision_ref"`
	State       string `json:"state"`
	VerifierRef string `json:"verifier_ref"`
	Rationale   string `json:"rationale"`
}

type CreateOutcomeInput

type CreateOutcomeInput struct {
	ProjectID   string `json:"project_id"`
	ClaimID     string `json:"claim_id"`
	ActionID    string `json:"action_id"`
	OutcomeRef  string `json:"outcome_ref"`
	OutcomeKind string `json:"outcome_kind"`
	Status      string `json:"status"`
	VerifierRef string `json:"verifier_ref,omitempty"`
	Summary     string `json:"summary,omitempty"`
}

type Decision

type Decision struct {
	ID          string    `json:"id"`
	ProjectID   string    `json:"project_id"`
	ClaimID     string    `json:"claim_id"`
	DecisionRef string    `json:"decision_ref"`
	State       string    `json:"state"`
	VerifierRef string    `json:"verifier_ref"`
	Rationale   string    `json:"rationale"`
	DecidedAt   time.Time `json:"decided_at"`
}

type Evidence

type Evidence struct {
	ID           string    `json:"id"`
	ProjectID    string    `json:"project_id"`
	ClaimID      string    `json:"claim_id"`
	EvidenceRef  string    `json:"evidence_ref"`
	EvidenceKind string    `json:"evidence_kind"`
	SourceRef    string    `json:"source_ref,omitempty"`
	Summary      string    `json:"summary,omitempty"`
	CreatedAt    time.Time `json:"created_at"`
}

type LinkArtifactInput

type LinkArtifactInput struct {
	ProjectID    string `json:"project_id"`
	ClaimID      string `json:"claim_id"`
	ArtifactRef  string `json:"artifact_ref"`
	ArtifactKind string `json:"artifact_kind,omitempty"`
	RunID        string `json:"run_id,omitempty"`
}

type LinkPromotionInput

type LinkPromotionInput struct {
	ProjectID      string `json:"project_id"`
	ClaimID        string `json:"claim_id"`
	RunID          string `json:"run_id,omitempty"`
	ArtifactRef    string `json:"artifact_ref"`
	PromotionState string `json:"promotion_state"`
	SourceRef      string `json:"source_ref"`
	VerifierRef    string `json:"verifier_ref,omitempty"`
	DecisionRef    string `json:"decision_ref,omitempty"`
	ActionRef      string `json:"action_ref,omitempty"`
	OutcomeRef     string `json:"outcome_ref,omitempty"`
}

type Outcome

type Outcome struct {
	ID          string    `json:"id"`
	ProjectID   string    `json:"project_id"`
	ClaimID     string    `json:"claim_id"`
	ActionID    string    `json:"action_id"`
	OutcomeRef  string    `json:"outcome_ref"`
	OutcomeKind string    `json:"outcome_kind"`
	Status      string    `json:"status"`
	VerifierRef string    `json:"verifier_ref,omitempty"`
	Summary     string    `json:"summary,omitempty"`
	CreatedAt   time.Time `json:"created_at"`
}
type PromotionLink struct {
	ProjectID      string    `json:"project_id"`
	ClaimID        string    `json:"claim_id"`
	RunID          string    `json:"run_id,omitempty"`
	ArtifactRef    string    `json:"artifact_ref"`
	PromotionState string    `json:"promotion_state"`
	SourceRef      string    `json:"source_ref"`
	VerifierRef    string    `json:"verifier_ref,omitempty"`
	DecisionRef    string    `json:"decision_ref,omitempty"`
	ActionRef      string    `json:"action_ref,omitempty"`
	OutcomeRef     string    `json:"outcome_ref,omitempty"`
	DecidedAt      time.Time `json:"decided_at"`
}

type Service

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

func New

func New(store Store) *Service

func (*Service) AppendEvidence

func (svc *Service) AppendEvidence(ctx context.Context, input AppendEvidenceInput) (Evidence, error)

func (*Service) CreateAction

func (svc *Service) CreateAction(ctx context.Context, input CreateActionInput) (Action, error)

func (*Service) CreateClaim

func (svc *Service) CreateClaim(ctx context.Context, input CreateClaimInput) (Claim, error)

func (*Service) CreateDecision

func (svc *Service) CreateDecision(ctx context.Context, input CreateDecisionInput) (Decision, error)

func (*Service) CreateOutcome

func (svc *Service) CreateOutcome(ctx context.Context, input CreateOutcomeInput) (Outcome, error)

func (*Service) GetClaim

func (svc *Service) GetClaim(ctx context.Context, projectID string, claimID string) (ClaimRecord, error)

func (*Service) LinkArtifact

func (svc *Service) LinkArtifact(ctx context.Context, input LinkArtifactInput) (ArtifactLink, error)

func (*Service) LinkPromotion

func (svc *Service) LinkPromotion(ctx context.Context, input LinkPromotionInput) (PromotionLink, error)

func (*Service) ListClaims

func (svc *Service) ListClaims(ctx context.Context, projectID string, filter ClaimFilter) ([]Claim, error)

type Store

type Store interface {
	CreateClaim(ctx context.Context, claim Claim) (Claim, error)
	GetClaim(ctx context.Context, projectID string, claimID string) (ClaimRecord, error)
	ListClaims(ctx context.Context, projectID string, filter ClaimFilter) ([]Claim, error)
	AppendEvidence(ctx context.Context, evidence Evidence) (Evidence, error)
	CreateDecision(ctx context.Context, decision Decision) (Decision, error)
	CreateAction(ctx context.Context, action Action) (Action, error)
	CreateOutcome(ctx context.Context, outcome Outcome) (Outcome, error)
	LinkArtifact(ctx context.Context, link ArtifactLink) (ArtifactLink, error)
	LinkPromotion(ctx context.Context, link PromotionLink) (PromotionLink, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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