migrate

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

CANARY: REQ=CP-251; FEATURE="MigrateFrom"; ASPECT=CLI; STATUS=IMPL; OWNER=canary; UPDATED=2025-10-16

Index

Constants

View Source
const (
	ConfidenceLow    = "LOW"
	ConfidenceMedium = "MEDIUM"
	ConfidenceHigh   = "HIGH"
)

Confidence levels for orphan detection

Variables

This section is empty.

Functions

func CalculateConfidence

func CalculateConfidence(orphan *OrphanedRequirement) string

CalculateConfidence determines confidence level based on orphan characteristics

func ExecuteMigration

func ExecuteMigration(rootDir string, plan *MigrationPlan, dryRun bool) error

ExecuteMigration performs the migration

func GeneratePlan

func GeneratePlan(orphan *OrphanedRequirement) (string, error)

GeneratePlan creates an implementation plan from an orphaned requirement

func GenerateSpec

func GenerateSpec(orphan *OrphanedRequirement) (string, error)

GenerateSpec creates a specification from an orphaned requirement

func GetMigrationSummary

func GetMigrationSummary(plan *MigrationPlan) string

GetMigrationSummary returns a human-readable summary

Types

type FileCopy

type FileCopy struct {
	Source string
	Dest   string
}

FileCopy represents a file to be copied

type FileMerge

type FileMerge struct {
	Source      string
	Dest        string
	Description string
}

FileMerge represents a file that needs merging

type MigrationPlan

type MigrationPlan struct {
	SystemType    SystemType
	FilesToCopy   []FileCopy
	FilesToMerge  []FileMerge
	FilesToCreate []string
	Warnings      []string
}

MigrationPlan describes what will be migrated

func PlanMigration

func PlanMigration(rootDir string, systemType SystemType, dryRun bool) (*MigrationPlan, error)

PlanMigration creates a migration plan

type OrphanPlan

type OrphanPlan struct {
	Orphans      []*OrphanedRequirement
	TotalOrphans int
	Excluded     []string
}

OrphanPlan represents the plan for migrating orphaned requirements

func DryRun

func DryRun(db *storage.DB, rootDir string, excludePaths []string) (*OrphanPlan, error)

DryRun simulates migration without creating files

type OrphanedRequirement

type OrphanedRequirement struct {
	ReqID        string
	Features     []*storage.Token
	FeatureCount int
	Confidence   string
}

OrphanedRequirement represents a requirement with tokens but no specification

func DetectOrphans

func DetectOrphans(db *storage.DB, rootDir string, excludePaths []string) ([]*OrphanedRequirement, error)

DetectOrphans finds all requirements with tokens but no specification

type SystemType

type SystemType string

SystemType represents the type of system being migrated from

const (
	SystemTypeSpecKit      SystemType = "spec-kit"
	SystemTypeLegacyCanary SystemType = "legacy-canary"
	SystemTypeMigrated     SystemType = "migrated"
	SystemTypeUnknown      SystemType = "unknown"
)

func DetectSystemType

func DetectSystemType(rootDir string) (SystemType, string)

DetectSystemType identifies what type of system exists in a directory

Jump to

Keyboard shortcuts

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