Documentation
¶
Overview ¶
Package core provides shared primitives for the PRISM ecosystem.
The PRISM ecosystem consists of three modules:
- prism-capability: What capabilities exist (capability stacks, layers)
- prism-intelligence: How we measure maturity (SLIs, SLOs, maturity models)
- prism-execution: How we improve (OKRs, V2MOM, roadmaps)
This package provides shared types used across all three modules.
Index ¶
- Constants
- func AllDomains() []string
- func AllFrameworks() []string
- func AllLayers() []string
- func AllSLITypes() []string
- func AllStages() []string
- func ComplianceFrameworks() []string
- func DomainDisplayName(domain string) string
- func FormatPeopleMarkdown(people []Person) string
- func FormatPersonMarkdown(p Person) string
- func FrameworkDisplayName(framework string) string
- func LayerDisplayName(layer string) string
- func MaturityGap(current, target int) int
- func MaturityLevelDescription(level int) string
- func MaturityLevelName(level int) string
- func MaturityLevelShortName(level int) string
- func MaturityProgress(current, target int) float64
- func MoSCoWWeight(moscow string) int
- func NISTCSFFunctionSortWeight(function string) int
- func NISTCSFFunctions() []string
- func NISTFrameworks() []string
- func OperationsFrameworks() []string
- func PrimaryDomains() []string
- func PriorityWeight(priority string) int
- func RiskScore(probability, impact string) int
- func RiskSeverity(score int) string
- func SLITypeDirection(sliType string) string
- func SLITypeDisplayName(sliType string) string
- func SecurityFrameworks() []string
- func StageDisplayName(stage string) string
- func TrendFromDelta(delta float64) string
- func TrendIcon(direction string) string
- func ValidDomain(domain string) bool
- func ValidFramework(framework string) bool
- func ValidHealthStatus(status string) bool
- func ValidLayer(layer string) bool
- func ValidMaturityLevel(level int) bool
- func ValidMoSCoW(moscow string) bool
- func ValidPriority(priority string) bool
- func ValidRiskImpact(impact string) bool
- func ValidRiskProbability(probability string) bool
- func ValidRiskStatus(status string) bool
- func ValidSLIType(sliType string) bool
- func ValidStage(stage string) bool
- func ValidTeamType(teamType string) bool
- func ValidTrend(direction string) bool
- type Approver
- type FrameworkMapping
- type LayerDef
- type MaturityLevelDef
- type Metadata
- type Person
- type Risk
- type SLITypeDef
- type Team
- type TrendInfo
Constants ¶
const ( // Primary domains DomainSecurity = "security" // Application and infrastructure security DomainOperations = "operations" // Reliability, performance, efficiency DomainQuality = "quality" // Testing, code quality, defects // Extended domains DomainPlatform = "platform" // Platform engineering DomainAI = "ai" // AI/ML capabilities DomainData = "data" // Data management DomainObservability = "observability" // Monitoring and observability DomainInfrastructure = "infrastructure" // Infrastructure management DomainProduct = "product" // Product management DomainCompliance = "compliance" // Compliance and governance )
Domain constants represent functional areas with their own standards.
const ( // NIST Frameworks FrameworkNISTCSF = "NIST_CSF" // NIST Cybersecurity Framework 1.1 FrameworkNISTCSF2 = "NIST_CSF_2" // NIST Cybersecurity Framework 2.0 FrameworkNIST80053 = "NIST_800_53" // NIST 800-53 Security Controls FrameworkNIST800171 = "NIST_800_171" FrameworkNISTRMF = "NIST_RMF" // NIST Risk Management Framework FrameworkNISTAIRMF = "NIST_AI_RMF" // NIST AI Risk Management Framework // FedRAMP Baselines FrameworkFedRAMPHigh = "FEDRAMP_HIGH" FrameworkFedRAMPMod = "FEDRAMP_MOD" FrameworkFedRAMPLow = "FEDRAMP_LOW" // Industry Standards FrameworkISO27001 = "ISO_27001" FrameworkSOC2 = "SOC_2" FrameworkCISControls = "CIS_CONTROLS" FrameworkPCIDSS = "PCI_DSS" FrameworkHIPAA = "HIPAA" FrameworkGDPR = "GDPR" // Security Frameworks FrameworkMITREATTACK = "MITRE_ATTACK" FrameworkOWASP = "OWASP" // Operations Frameworks FrameworkDORA = "DORA" // DevOps Research and Assessment FrameworkSRE = "SRE" // Site Reliability Engineering )
Framework constants for compliance and methodology mappings.
const ( NISTCSFGovern = "govern" NISTCSFIdentify = "identify" NISTCSFProtect = "protect" NISTCSFDetect = "detect" NISTCSFRespond = "respond" NISTCSFRecover = "recover" )
NIST CSF Function constants.
const ( LayerRequirements = "requirements" // Product ideation, specs, design LayerCode = "code" // Application code, libraries, dependencies LayerInfra = "infra" // Cloud resources, networking, platform LayerRuntime = "runtime" // Running services, containers, workloads LayerAdoption = "adoption" // Product analytics, user engagement LayerSupport = "support" // Customer support, incident management )
Layer constants represent value stream phases.
const ( StageDesign = "design" // Architecture, requirements, planning StageBuild = "build" // CI/CD, code quality, dependency management StageTest = "test" // Testing coverage, quality assurance StageRuntime = "runtime" // Production monitoring, availability StageResponse = "response" // Incident response, remediation, recovery )
Lifecycle stage constants for SDLC phases.
const ( MaturityLevel1 = 1 // Reactive/Ad-hoc MaturityLevel2 = 2 // Basic MaturityLevel3 = 3 // Defined MaturityLevel4 = 4 // Managed MaturityLevel5 = 5 // Optimizing )
Maturity level constants (M1-M5).
const ( MaturityNameReactive = "Reactive" MaturityNameBasic = "Basic" MaturityNameDefined = "Defined" MaturityNameManaged = "Managed" MaturityNameOptimizing = "Optimizing" )
Maturity level name constants.
const ( TeamTypeStreamAligned = "stream_aligned" TeamTypePlatform = "platform" TeamTypeEnabling = "enabling" TeamTypeOverlay = "overlay" )
Team type constants following Team Topologies.
const ( RiskProbabilityLow = "low" RiskProbabilityMedium = "medium" RiskProbabilityHigh = "high" )
Risk probability constants.
const ( RiskImpactLow = "low" RiskImpactMedium = "medium" RiskImpactHigh = "high" RiskImpactCritical = "critical" )
Risk impact constants.
const ( RiskStatusOpen = "open" RiskStatusMitigated = "mitigated" RiskStatusAccepted = "accepted" RiskStatusClosed = "closed" )
Risk status constants.
const ( SLITypeAvailability = "availability" SLITypeLatency = "latency" SLITypeThroughput = "throughput" SLITypeErrorRate = "error_rate" SLITypeFreshness = "freshness" SLITypeCorrectness = "correctness" SLITypeCoverage = "coverage" SLITypeDurability = "durability" )
SLI type constants.
const ( SLIDirectionHigherIsBetter = "higher_is_better" SLIDirectionLowerIsBetter = "lower_is_better" )
SLI comparison direction constants.
const ( SLIAggregationAverage = "average" SLIAggregationPercentile = "percentile" SLIAggregationSum = "sum" SLIAggregationMin = "min" SLIAggregationMax = "max" SLIAggregationCount = "count" )
SLI aggregation method constants.
const ( StatusDraft = "draft" StatusInReview = "in_review" StatusApproved = "approved" StatusActive = "active" StatusCompleted = "completed" StatusDeprecated = "deprecated" StatusArchived = "archived" )
Status constants for document lifecycle.
const ( HealthGreen = "green" HealthYellow = "yellow" HealthRed = "red" )
HealthStatus constants for metric health indicators.
const ( PriorityCritical = "critical" PriorityHigh = "high" PriorityMedium = "medium" PriorityLow = "low" )
Priority constants for prioritization.
const ( MoSCoWMust = "must" MoSCoWShould = "should" MoSCoWCould = "could" MoSCoWWont = "wont" )
MoSCoW prioritization constants.
const ( CapabilityStatusPlanned = "planned" CapabilityStatusInProgress = "in_progress" CapabilityStatusImplemented = "implemented" CapabilityStatusOperational = "operational" CapabilityStatusDeprecated = "deprecated" )
CapabilityStatus constants for capability lifecycle.
const ( InitiativeStatusPlanned = "planned" InitiativeStatusInProgress = "in_progress" InitiativeStatusCompleted = "completed" InitiativeStatusCancelled = "cancelled" InitiativeStatusOnHold = "on_hold" )
InitiativeStatus constants for initiative tracking.
const ( TrendUp = "up" TrendDown = "down" TrendFlat = "flat" TrendUnknown = "unknown" )
Trend direction constants.
Variables ¶
This section is empty.
Functions ¶
func AllStages ¶
func AllStages() []string
AllStages returns all lifecycle stage constants in order.
func ComplianceFrameworks ¶
func ComplianceFrameworks() []string
ComplianceFrameworks returns compliance-focused frameworks.
func DomainDisplayName ¶
DomainDisplayName returns a human-readable name for a domain.
func FormatPeopleMarkdown ¶
FormatPeopleMarkdown formats a list of people for markdown output.
func FormatPersonMarkdown ¶
FormatPersonMarkdown formats a person for markdown output.
func FrameworkDisplayName ¶
FrameworkDisplayName returns a human-readable name for a framework.
func LayerDisplayName ¶
LayerDisplayName returns a human-readable name for a layer.
func MaturityGap ¶
MaturityGap calculates the gap between current and target maturity levels.
func MaturityLevelDescription ¶
MaturityLevelDescription returns a description for a maturity level.
func MaturityLevelName ¶
MaturityLevelName returns the name for a maturity level.
func MaturityLevelShortName ¶
MaturityLevelShortName returns short name like "M1", "M2", etc.
func MaturityProgress ¶
MaturityProgress calculates progress as a percentage (0.0 to 1.0).
func MoSCoWWeight ¶
MoSCoWWeight returns a numeric weight for sorting MoSCoW priorities.
func NISTCSFFunctionSortWeight ¶
NISTCSFFunctionSortWeight returns a sort weight for NIST CSF functions. Returns the canonical order: govern=1, identify=2, protect=3, detect=4, respond=5, recover=6.
func NISTCSFFunctions ¶
func NISTCSFFunctions() []string
NISTCSFFunctions returns NIST CSF functions in canonical order.
func NISTFrameworks ¶
func NISTFrameworks() []string
NISTFrameworks returns NIST-related frameworks.
func OperationsFrameworks ¶
func OperationsFrameworks() []string
OperationsFrameworks returns operations-focused frameworks.
func PrimaryDomains ¶
func PrimaryDomains() []string
PrimaryDomains returns the three primary domains.
func PriorityWeight ¶
PriorityWeight returns a numeric weight for sorting priorities. Higher weight = higher priority.
func RiskScore ¶
RiskScore calculates a numeric score based on probability and impact. Returns a value from 1 (low/low) to 12 (high/critical).
func RiskSeverity ¶
RiskSeverity returns a severity level based on risk score.
func SLITypeDirection ¶
SLITypeDirection returns the default comparison direction for an SLI type.
func SLITypeDisplayName ¶
SLITypeDisplayName returns a human-readable name for an SLI type.
func SecurityFrameworks ¶
func SecurityFrameworks() []string
SecurityFrameworks returns security-focused frameworks.
func StageDisplayName ¶
StageDisplayName returns a human-readable name for a stage.
func TrendFromDelta ¶
TrendFromDelta returns a trend direction based on a delta value.
func ValidDomain ¶
ValidDomain checks if a domain value is valid.
func ValidFramework ¶
ValidFramework checks if a framework value is valid.
func ValidHealthStatus ¶
ValidHealthStatus checks if a health status value is valid.
func ValidMaturityLevel ¶
ValidMaturityLevel checks if a maturity level is valid (1-5).
func ValidMoSCoW ¶
ValidMoSCoW checks if a MoSCoW value is valid.
func ValidPriority ¶
ValidPriority checks if a priority value is valid.
func ValidRiskImpact ¶
ValidRiskImpact checks if a risk impact value is valid.
func ValidRiskProbability ¶
ValidRiskProbability checks if a risk probability value is valid.
func ValidRiskStatus ¶
ValidRiskStatus checks if a risk status value is valid.
func ValidSLIType ¶
ValidSLIType checks if an SLI type value is valid.
func ValidStage ¶
ValidStage checks if a lifecycle stage value is valid.
func ValidTeamType ¶
ValidTeamType checks if a team type is valid.
func ValidTrend ¶
ValidTrend checks if a trend direction value is valid.
Types ¶
type Approver ¶
type Approver struct {
Person
ApprovedAt time.Time `json:"approvedAt,omitzero"`
Approved bool `json:"approved,omitempty"`
Comments string `json:"comments,omitempty"`
}
Approver represents a person who approved something.
type FrameworkMapping ¶
type FrameworkMapping struct {
Framework string `json:"framework"`
Reference string `json:"reference,omitempty"`
Controls []string `json:"controls,omitempty"`
Description string `json:"description,omitempty"`
}
FrameworkMapping represents a mapping to an external framework.
type LayerDef ¶
type LayerDef struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
Order int `json:"order,omitempty"`
Weight float64 `json:"weight,omitempty"`
}
LayerDef defines a layer with metadata.
func DefaultLayers ¶
func DefaultLayers() []LayerDef
DefaultLayers returns default layer definitions with weights.
type MaturityLevelDef ¶
type MaturityLevelDef struct {
Level int `json:"level"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
Weight float64 `json:"weight,omitempty"`
}
MaturityLevelDef defines a maturity level with metadata.
func DefaultMaturityLevels ¶
func DefaultMaturityLevels() []MaturityLevelDef
DefaultMaturityLevels returns the standard 5-level maturity definitions.
type Metadata ¶
type Metadata struct {
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Title string `json:"title,omitempty"`
Description string `json:"description,omitempty"`
Version string `json:"version,omitempty"`
Status string `json:"status,omitempty"`
Domain string `json:"domain,omitempty"`
Owner string `json:"owner,omitempty"`
Team string `json:"team,omitempty"`
Authors []Person `json:"authors,omitempty"`
Tags []string `json:"tags,omitempty"`
CreatedAt time.Time `json:"createdAt,omitzero"`
UpdatedAt time.Time `json:"updatedAt,omitzero"`
}
Metadata contains common document metadata fields.
func NewMetadata ¶
NewMetadata creates a new Metadata with the given name and author.
type Person ¶
type Person struct {
Name string `json:"name"`
Email string `json:"email,omitempty"`
Role string `json:"role,omitempty"`
}
Person represents an individual.
type Risk ¶
type Risk struct {
ID string `json:"id,omitempty"`
Description string `json:"description"`
Impact string `json:"impact,omitempty"`
Probability string `json:"probability,omitempty"`
Mitigation string `json:"mitigation,omitempty"`
Status string `json:"status,omitempty"`
Owner string `json:"owner,omitempty"`
}
Risk represents a risk item.
type SLITypeDef ¶
type SLITypeDef struct {
Type string `json:"type"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
Direction string `json:"direction"`
Unit string `json:"unit,omitempty"`
}
SLITypeDef defines an SLI type with metadata.
func DefaultSLITypes ¶
func DefaultSLITypes() []SLITypeDef
DefaultSLITypes returns default SLI type definitions.
type Team ¶
type Team struct {
ID string `json:"id,omitempty"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
Type string `json:"type,omitempty"` // stream_aligned, platform, enabling, overlay
Domain string `json:"domain,omitempty"`
Owner string `json:"owner,omitempty"`
Email string `json:"email,omitempty"`
Slack string `json:"slack,omitempty"`
Members []Person `json:"members,omitempty"`
}
Team represents a group of people.
type TrendInfo ¶
type TrendInfo struct {
Direction string `json:"direction"`
Magnitude float64 `json:"magnitude,omitempty"`
Percentage float64 `json:"percentage,omitempty"`
}
TrendInfo represents a trend with direction and magnitude.
func NewTrendInfo ¶
NewTrendInfo creates a TrendInfo from a delta value.