governance

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: Apache-2.0 Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package governance turns explicit retrieval outcomes into conservative evidence reliability estimates. It does not rank results itself; keeping measurement separate from policy lets the estimates be evaluated before they influence retrieval.

Index

Constants

View Source
const (
	// Sparse observations are too easy to overinterpret. Until this many
	// outcomes exist, evidence remains neutral in any downstream policy.
	MinCredibleObservations = 3
	// CredibilityK controls how quickly evidence-specific experience earns
	// weight. At n=5, individual experience receives half the weight.
	CredibilityK = 5.0
)

Variables

This section is empty.

Functions

func AssessMany

func AssessMany(ctx context.Context, db *sql.DB, projectID int64, evidenceKeys []string) (map[string]Assessment, error)

AssessMany evaluates a result set in bounded batches, avoiding one query and one busy-timeout window per candidate. Keys without observations are returned as explicitly neutral assessments.

Types

type Assessment

type Assessment struct {
	EvidenceKey  string
	Observations int
	Positive     int
	Negative     int
	Credibility  float64
	Reliability  float64
	Neutral      bool
}

func Assess

func Assess(db *sql.DB, projectID int64, evidenceKey string) (Assessment, error)

Assess estimates reliability with beta smoothing and actuarial credibility. The portfolio prior is deliberately 1.0: without enough evidence, this observer cannot penalize an otherwise relevant memory.

func AssessContext

func AssessContext(ctx context.Context, db *sql.DB, projectID int64, evidenceKey string) (Assessment, error)

Jump to

Keyboard shortcuts

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