Versions in this module Expand all Collapse all v0 v0.1.0 Nov 19, 2026 Changes in this version + const DefaultCommandMaxOut + const DefaultCommandTimeout + const DefaultEvidenceFile + const DefaultStaleAfter + const DefaultWindow + const DefaultWorstSteps + const EnvEvidenceFile + const SchemaVersionV1 + var ErrIO = errors.New("compliance: I/O error") + var ErrInternal = errors.New("compliance: internal error") + var ErrParse = errors.New("compliance: parse error") + var ErrUnsupportedSchema = errors.New("compliance: unsupported schema version") + var ErrValidation = errors.New("compliance: validation error") + func FormatWireTime(t time.Time) string + func MarshalV1(report V1Report) ([]byte, error) + func ParseWireTime(raw string) time.Time + func Record(ctx context.Context, repo RepoName, result RunResult) error + func RecordTo(ctx context.Context, writer EvidenceWriter, repo RepoName, result RunResult) error + type CommandSource struct + func NewBuildFlowCommandSource() *CommandSource + func NewCommandSource(command string, args ...string) *CommandSource + func (s *CommandSource) Name() SourceName + func (s *CommandSource) QueryEvidence(ctx context.Context, since time.Time, worstStepLimit int, stepFilter string) ([]RepoEvidence, error) + func (s *CommandSource) WithMaxOutput(limit int64) *CommandSource + func (s *CommandSource) WithTimeout(timeout time.Duration) *CommandSource + type Error struct + Category ErrorCategory + Cause error + Message string + func NewIOError(cause error, format string, args ...any) *Error + func NewInternalError(cause error, format string, args ...any) *Error + func NewParseError(cause error, format string, args ...any) *Error + func NewUnsupportedSchemaError(got, want int) *Error + func NewValidationError(format string, args ...any) *Error + func (e *Error) Error() string + func (e *Error) ErrorCode() string + func (e *Error) ErrorFamily() errorfamily.Family + func (e *Error) Is(target error) bool + func (e *Error) Unwrap() error + type ErrorCategory string + const ErrCategoryIO + const ErrCategoryInternal + const ErrCategoryParse + const ErrCategoryUnsupported + const ErrCategoryValidation + func (c ErrorCategory) IsValid() bool + type EvidenceWriter interface + WriteEvidence func(ctx context.Context, repo RepoName, result RunResult) error + type FileSource struct + func NewBuildFlowFileSource() *FileSource + func NewFileSource(path string) *FileSource + func (s *FileSource) Name() SourceName + func (s *FileSource) Path() string + func (s *FileSource) QueryEvidence(_ context.Context, _ time.Time, worstStepLimit int, _ string) ([]RepoEvidence, error) + func (s *FileSource) WithMissingBackoff(ttl time.Duration) *FileSource + type FileStore struct + func NewFileStore(path string) *FileStore + func (s *FileStore) Load(ctx context.Context) (V1Report, error) + func (s *FileStore) Path() string + func (s *FileStore) WriteEvidence(ctx context.Context, repo RepoName, result RunResult) error + type FoldInput struct + FindingSeverities []RepoSeverities + GateFindings []RepoFindings + LatestRuns []LatestRun + Versions []RepoVersions + WindowHealth []WindowHealth + WorstStepLimit int + WorstSteps []RepoSteps + type LatestRun struct + AnyFailed bool + HasVerdict bool + LastRunAt time.Time + Repo RepoName + RepoHash string + Version string + func (r LatestRun) Verdict() Verdict + type MemoryStore struct + func NewMemoryStore() *MemoryStore + func (m *MemoryStore) Evidence() []RepoEvidence + func (m *MemoryStore) WriteEvidence(_ context.Context, repo RepoName, result RunResult) error + type RepoBrand struct + func (RepoBrand) Name() string + type RepoEvidence struct + FailRate float64 + Failures int64 + FindingSeverities map[string]int + GateFindings map[string]int + LastRunAt time.Time + LastRunVerdict Verdict + LastRunVersion string + Repo RepoName + RepoHash string + Runs int64 + StepRows int64 + Versions []string + WorstSteps []StepEvidence + func CompleteWithDiscovery(evidence []RepoEvidence, discovered []RepoName) []RepoEvidence + func FoldEvidence(input FoldInput) []RepoEvidence + func V1ReportToEvidence(report V1Report, worstStepLimit int) []RepoEvidence + func (e RepoEvidence) HasEvidence() bool + type RepoFindings struct + Findings map[string]int + Repo RepoName + type RepoName = id.ID[RepoBrand, string] + func NewRepoName(raw string) RepoName + type RepoSeverities struct + Repo RepoName + Severities map[string]int + type RepoSteps struct + Repo RepoName + Steps []StepEvidence + type RepoVersions struct + Repo RepoName + Versions []string + type RunResult struct + At time.Time + FailRate float64 + Failures int64 + FindingSeverities map[string]int + GateFindings map[string]int + ProducerVersion string + Runs int64 + StepRows int64 + Verdict Verdict + func (r RunResult) ResolvedAt() time.Time + func (r RunResult) ResolvedRuns() int64 + type Source interface + Name func() SourceName + QueryEvidence func(ctx context.Context, since time.Time, worstStepLimit int, stepFilter string) ([]RepoEvidence, error) + type SourceBrand struct + func (SourceBrand) Name() string + type SourceFunc func(ctx context.Context, since time.Time, worstStepLimit int, stepFilter string) ([]RepoEvidence, error) + func (SourceFunc) Name() SourceName + func (f SourceFunc) QueryEvidence(ctx context.Context, since time.Time, worstStepLimit int, stepFilter string) ([]RepoEvidence, error) + type SourceName = id.ID[SourceBrand, string] + func NewSourceName(raw string) SourceName + type State string + const StateCompliant + const StateFailing + const StateNeverCovered + const StateStale + func DeriveState(evidence RepoEvidence, now time.Time, staleAfter time.Duration) State + func ParseState(raw string) (State, error) + func (s State) IsValid() bool + func (s State) Rank() int + func (s State) String() string + type StepEvidence struct + FailRate float64 + Failures int64 + Step string + TotalRuns int64 + type V1Repo struct + BuildFlowVersions []string + FailRate float64 + Failures int64 + GateFindings map[string]int + LastRunAt string + LastRunVerdict string + Repo string + Runs int64 + State string + StepRows int64 + WorstSteps []V1Step + type V1Report struct + BuildFlowVersion string + GeneratedAt string + Repos []V1Repo + SchemaVersion int + Since string + StaleAfter string + func BuildV1Report(evidence []RepoEvidence, since time.Time, staleAfter time.Duration, ...) V1Report + func DecodeV1Report(data []byte) (V1Report, error) + type V1Step struct + FailRate float64 + Failures int64 + Step string + TotalRuns int64 + type Verdict string + const VerdictFailed + const VerdictPassed + const VerdictUnknown + func (v Verdict) String() string + type WindowHealth struct + FailRate float64 + Failures int64 + Repo RepoName + Runs int64 + StepRows int64