Documentation
¶
Overview ¶
Package registry is L2 of the SigComply CLI: in-process catalogs of the things that can be referenced by ID — frameworks, source plugins, rules, evidence types, and policies. Populated at process startup from the in-binary specs plus any project-local extensions under .sigcomply/, then immutable for the run.
See docs/architecture/02-layers.md for the full layer contract.
Index ¶
- type Registry
- func New[T any](keyFn func(T) string) *Registry[T]
- func NewEvidenceTypeRegistry() *Registry[core.EvidenceType]
- func NewFrameworkRegistry() *Registry[core.Framework]
- func NewPolicyRegistry() *Registry[core.Policy]
- func NewRuleRegistry() *Registry[core.Rule]
- func NewSourceRegistry() *Registry[core.SourcePlugin]
- type Set
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Registry ¶
type Registry[T any] struct { // contains filtered or unexported fields }
Registry is a generic, populated-once-at-startup catalog keyed by ID. The CLI's loading sequence is: load in-binary specs → load project- local extensions → validate cross-references → freeze. Nothing mutates a Registry after that freeze; there is no hot-reload, no mid-run discovery, no runtime mutation.
keyFn extracts the ID used as the lookup key. Different item types expose their ID differently (a method on an interface, a field on a struct); keyFn abstracts that so a single Registry implementation serves all five concrete registries in this package.
func New ¶
New constructs an empty Registry. The keyFn extracts the lookup key from each item registered.
func NewEvidenceTypeRegistry ¶
func NewEvidenceTypeRegistry() *Registry[core.EvidenceType]
NewEvidenceTypeRegistry returns an empty registry of core.EvidenceType keyed by ID. Evidence type schemas are append-only: a breaking schema change requires a new ID (e.g. user_record.v2 registered alongside user_record.v1).
func NewFrameworkRegistry ¶
NewFrameworkRegistry returns an empty registry of core.Framework keyed by Framework.ID().
func NewPolicyRegistry ¶
NewPolicyRegistry returns an empty registry of core.Policy keyed by Policy.ID. Framework-shipped policies and project-local custom policies share this registry; the loader at L0/L2 is responsible for merging both into the single namespace.
func NewRuleRegistry ¶
NewRuleRegistry returns an empty registry of core.Rule keyed by Rule.ID() — the dotted-with-version reference (rules.<name>.v<n>) that policy specs declare via their `rule:` field.
func NewSourceRegistry ¶
func NewSourceRegistry() *Registry[core.SourcePlugin]
NewSourceRegistry returns an empty registry of core.SourcePlugin keyed by SourcePlugin.ID().
func (*Registry[T]) All ¶
func (r *Registry[T]) All() []T
All returns every registered item. Order is unspecified — callers that need deterministic order must sort the result themselves.
type Set ¶
type Set struct {
Frameworks *Registry[core.Framework]
Sources *Registry[core.SourcePlugin]
Rules *Registry[core.Rule]
EvidenceTypes *Registry[core.EvidenceType]
Policies *Registry[core.Policy]
}
Set is the bundle of all five registries the orchestrator passes through the stack. Constructed empty by NewSet, populated by the spec loaders (L0) and any project-local extension discovery, then treated as immutable.