analysis

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package analysis provides analysis and reporting capabilities for PRISM documents.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CountGapsBySeverity

func CountGapsBySeverity(gaps []Gap) map[Severity]int

CountGapsBySeverity returns counts of gaps by severity.

func CountSLOsForLevelRange

func CountSLOsForLevelRange(goal *prism.Goal, enterLevel, exitLevel int) int

CountSLOsForLevelRange counts SLOs required between enter and exit levels.

Types

type Gap

type Gap struct {
	Type        GapType  `json:"type"`
	GoalID      string   `json:"goalId,omitempty"`
	Description string   `json:"description"`
	Severity    Severity `json:"severity"`
	PhaseID     string   `json:"phaseId,omitempty"`
}

Gap identifies a gap that needs to be addressed.

func FilterGapsBySeverity

func FilterGapsBySeverity(gaps []Gap, severity Severity) []Gap

FilterGapsBySeverity returns gaps of a specific severity.

func FilterGapsByType

func FilterGapsByType(gaps []Gap, gapType GapType) []Gap

FilterGapsByType returns gaps of a specific type.

func IdentifyGaps

func IdentifyGaps(analysis *Result) []Gap

IdentifyGaps analyzes the result and identifies gaps.

type GapType

type GapType string

GapType represents the type of gap identified.

const (
	GapTypeMaturity   GapType = "maturity"
	GapTypeSLO        GapType = "slo"
	GapTypeInitiative GapType = "initiative"
)

type GoalAnalysis

type GoalAnalysis struct {
	GoalID       string           `json:"goalId"`
	GoalName     string           `json:"goalName"`
	CurrentLevel int              `json:"currentLevel"`
	TargetLevel  int              `json:"targetLevel"`
	Gap          int              `json:"gap"`
	Status       string           `json:"status"`
	SLOsRequired []SLORequirement `json:"slosRequired"`
	SLOsMet      int              `json:"slosMet"`
	SLOsTotal    int              `json:"slosTotal"`
}

GoalAnalysis analyzes a single goal.

type GoalProgressSummary

type GoalProgressSummary struct {
	GoalID       string `json:"goalId"`
	GoalName     string `json:"goalName"`
	CurrentLevel int    `json:"currentLevel"`
	TargetLevel  int    `json:"targetLevel"`
	Status       string `json:"status"`
}

GoalProgressSummary holds summary progress for a goal.

type GoalTarget

type GoalTarget struct {
	GoalID     string `json:"goalId"`
	GoalName   string `json:"goalName"`
	EnterLevel int    `json:"enterLevel"`
	ExitLevel  int    `json:"exitLevel"`
	SLOsNeeded int    `json:"slosNeeded"`
}

GoalTarget shows maturity progression in a phase.

type PhaseAnalysis

type PhaseAnalysis struct {
	PhaseID     string       `json:"phaseId"`
	PhaseName   string       `json:"phaseName"`
	Period      string       `json:"period"`
	Status      string       `json:"status"`
	GoalTargets []GoalTarget `json:"goalTargets"`
	Initiatives int          `json:"initiatives"`
	Completion  float64      `json:"completion"`
}

PhaseAnalysis analyzes a single phase.

type PhaseProgressSummary

type PhaseProgressSummary struct {
	PhaseID     string  `json:"phaseId"`
	PhaseName   string  `json:"phaseName"`
	Period      string  `json:"period"`
	Status      string  `json:"status"`
	GoalSummary string  `json:"goalSummary"`
	Completion  float64 `json:"completion"`
}

PhaseProgressSummary holds summary progress for a phase.

type Recommendation

type Recommendation struct {
	Title       string   `json:"title"`
	Description string   `json:"description"`
	GoalIDs     []string `json:"goalIds"`
	PhaseID     string   `json:"phaseId"`
	Priority    string   `json:"priority"`
	SLOsEnabled []string `json:"slosEnabled"`
}

Recommendation suggests an initiative to close a gap.

type Result

type Result struct {
	Summary         Summary          `json:"summary"`
	Goals           []GoalAnalysis   `json:"goals"`
	Phases          []PhaseAnalysis  `json:"phases"`
	Gaps            []Gap            `json:"gaps"`
	Recommendations []Recommendation `json:"recommendations,omitempty"`
}

Result holds the structured analysis of a PRISM document.

func Analyze

func Analyze(doc *prism.PRISMDocument) *Result

Analyze performs a comprehensive analysis of a PRISM document.

type RoadmapProgress

type RoadmapProgress struct {
	OverallCompletion float64                `json:"overallCompletion"`
	PhaseProgress     []PhaseProgressSummary `json:"phaseProgress"`
	GoalProgress      []GoalProgressSummary  `json:"goalProgress"`
}

RoadmapProgress holds overall roadmap progress metrics.

func CalculateRoadmapProgress

func CalculateRoadmapProgress(doc *prism.PRISMDocument) *RoadmapProgress

CalculateRoadmapProgress calculates overall roadmap progress.

func (*RoadmapProgress) AchievedGoals

func (rp *RoadmapProgress) AchievedGoals() []GoalProgressSummary

AchievedGoals returns goals that have achieved their target.

func (*RoadmapProgress) CompletedPhases

func (rp *RoadmapProgress) CompletedPhases() []PhaseProgressSummary

CompletedPhases returns phases that are completed.

func (*RoadmapProgress) GetGoalByID

func (rp *RoadmapProgress) GetGoalByID(goalID string) *GoalProgressSummary

GetGoalByID returns the goal progress for a specific goal ID.

func (*RoadmapProgress) GetPhaseByID

func (rp *RoadmapProgress) GetPhaseByID(phaseID string) *PhaseProgressSummary

GetPhaseByID returns the phase progress for a specific phase ID.

type SLORequirement

type SLORequirement struct {
	MetricID   string  `json:"metricId"`
	MetricName string  `json:"metricName"`
	Level      int     `json:"level"`
	Target     string  `json:"target"`
	Current    float64 `json:"current"`
	IsMet      bool    `json:"isMet"`
}

SLORequirement captures an SLO needed for a maturity level.

type Severity

type Severity string

Severity represents the severity of a gap.

const (
	SeverityHigh   Severity = "high"
	SeverityMedium Severity = "medium"
	SeverityLow    Severity = "low"
)

type Summary

type Summary struct {
	TotalGoals     int     `json:"totalGoals"`
	TotalPhases    int     `json:"totalPhases"`
	TotalSLOs      int     `json:"totalSLOs"`
	SLOsMet        int     `json:"slosMet"`
	SLOCompliance  float64 `json:"sloCompliance"`
	AvgMaturityGap float64 `json:"avgMaturityGap"`
}

Summary provides high-level statistics.

Jump to

Keyboard shortcuts

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