confidence

package
v0.6.0 Latest Latest
Warning

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

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

Documentation

Overview

Package confidence computes a deterministic evidence-health tier for distilled proposals (RFC-002 §6) — a leaf package, because both the distiller's surfaces and the report layer must reach one answer and neither may import the other.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Assess

func Assess(p model.Proposal, byID map[int64]model.Finding, root string, now time.Time) (Tier, Facts)

Assess computes a proposal's tier and the facts behind it. byID is the current finding table (AllFindings keyed by id); root locates the workspace for path liveness; now anchors ages so tests are exact.

Types

type Facts

type Facts struct {
	// Cited is how many findings the proposal cited when distilled;
	// Living how many still exist in the store (findings age out with
	// the mining window).
	Cited, Living int
	// Events is the distinct-event count over the LIVING citations,
	// under the same collapse rule as the recurrence bar.
	Events int
	// Sources are the distinct evidence kinds among living citations,
	// fix tiers folded ("review", "fix"), sorted.
	Sources []string
	// NewestAge is the age of the newest living citation; zero when
	// nothing lives. Meaningful only when AgeKnown.
	NewestAge time.Duration
	// AgeKnown is false when no living citation carries a usable
	// timestamp — recency is then unknown, which is not the same as
	// "brand new".
	AgeKnown bool
	// DeadPaths counts living citations whose file no longer exists in
	// the workspace — guidance about deleted code.
	DeadPaths int
}

Facts are the measured inputs behind a tier — printed next to it, so the tier is an argument, not a verdict.

func (Facts) Line

func (f Facts) Line() string

Line renders the facts for a parenthetical: "2 events, review+fix, newest 14d" (plus decay notes when they apply).

type Tier

type Tier int

Tier is a proposal's evidence-health class.

const (
	TierWeak Tier = iota
	TierFair
	TierStrong
)

The tiers, weakest first so ranking can compare numerically.

func (Tier) String

func (t Tier) String() string

String renders the tier the way every surface spells it.

Jump to

Keyboard shortcuts

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