Documentation
¶
Overview ¶
Package rubrics provides evaluation rubrics for spec types. Rubrics use the shared structured-evaluation rubric definition (rubric.RubricSet) as the one canonical format across the ecosystem — there is no visionspec-local rubric type. Flat rubrics use categorical scales; rich rubrics use weighted criteria with indicators. Both are the same rubric.RubricSet.
Index ¶
- func Available() []types.SpecType
- func DefaultPassCriteria() rubric.RubricPassCriteria
- func Get(specType types.SpecType) (*rubric.RubricSet, error)
- func HasRubric(specType types.SpecType) bool
- func LoadWithLoader(loader Loader, specType types.SpecType) (*rubric.RubricSet, error)
- func MustGet(specType types.SpecType) *rubric.RubricSet
- func NewFileLoader(dir string) *fileLoader
- func Register(specType types.SpecType, rs *rubric.RubricSet)
- func StrictPassCriteria() rubric.RubricPassCriteria
- func WriteRubricYAML(path string, rs *rubric.RubricSet) error
- type Loader
- func DefaultLoader() Loader
- func EmbeddedLoader() Loader
- func LoaderForWorkflow(w *sws.LoadedWorkflow) Loader
- func NewChainLoader(loaders ...Loader) Loader
- func NewEmbedFSLoader(fsys embed.FS, dir string) Loader
- func NewMapLoader(rubrics map[string]*rubric.RubricSet) Loader
- func NewOverrideLoader(files map[types.SpecType]string) Loader
- func NewSubFSLoader(fsys fs.FS) Loader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultPassCriteria ¶
func DefaultPassCriteria() rubric.RubricPassCriteria
DefaultPassCriteria returns the default pass criteria: no critical or high findings, unlimited medium/low, and all required categories must pass.
func LoadWithLoader ¶
LoadWithLoader loads a rubric using a specific loader.
func NewFileLoader ¶
func NewFileLoader(dir string) *fileLoader
NewFileLoader creates a loader that reads rubrics from YAML files. Rubrics are named: {spec-type}.rubric.yaml (e.g., prd.rubric.yaml)
func StrictPassCriteria ¶
func StrictPassCriteria() rubric.RubricPassCriteria
StrictPassCriteria returns stricter pass criteria: no critical or high findings, at most 3 medium, and every category must pass.
Types ¶
type Loader ¶
type Loader interface {
// Load returns the rubric for a spec type.
Load(specType types.SpecType) (*rubric.RubricSet, error)
// Available returns all available spec types with rubrics.
Available() []types.SpecType
}
Loader loads rubrics from various sources.
func DefaultLoader ¶
func DefaultLoader() Loader
DefaultLoader returns the default rubric loader (embedded rubrics).
func EmbeddedLoader ¶
func EmbeddedLoader() Loader
EmbeddedLoader returns a loader that uses embedded Go-defined rubrics.
func LoaderForWorkflow ¶ added in v0.15.0
func LoaderForWorkflow(w *sws.LoadedWorkflow) Loader
LoaderForWorkflow returns a rubric loader for a loaded workflow. The workflow's own rubrics take priority (falling back to the default embedded rubrics when the workflow has none), with prism-roadmap's canonical canvas rubrics chained last.
func NewChainLoader ¶
NewChainLoader creates a loader that tries multiple loaders in order. The first loader that can load a rubric wins.
func NewEmbedFSLoader ¶
NewEmbedFSLoader creates a loader that reads rubrics from an embedded filesystem. This is useful for organizations that want to compile custom rubrics into their CLI.
Usage:
//go:embed rubrics/*.rubric.yaml var orgRubrics embed.FS loader := rubrics.NewEmbedFSLoader(orgRubrics, "rubrics")
func NewMapLoader ¶ added in v0.15.0
NewMapLoader creates a loader backed by a map of spec type to rubric set, as provided by specification-workflow-spec's LoadedWorkflow.Rubrics.
func NewOverrideLoader ¶ added in v0.14.0
NewOverrideLoader creates a loader that maps spec types to specific rubric file paths (e.g. a project's visionspec.yaml `rubrics.overrides`). Paths must already be resolved (absolute or relative to the working directory).
func NewSubFSLoader ¶
NewSubFSLoader creates a loader from an fs.FS interface. This is useful when working with fs.Sub() results.