discovery

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package discovery provides functions for finding active changes and specs in a spectr intialized project.

Package discovery provides test helpers for change and spec discovery.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetActiveChangeIDs

func GetActiveChangeIDs(projectRoot string) ([]string, error)

GetActiveChangeIDs returns a list of active change IDs (directory names under spectr/changes/, excluding archive/) Returns empty slice (not error) if the directory doesn't exist Results are sorted alphabetically for consistency

func GetActiveChanges

func GetActiveChanges(projectPath string) ([]string, error)

GetActiveChanges finds all active changes in spectr/changes/, excluding archive directory

func GetSpecIDs

func GetSpecIDs(projectRoot string) ([]string, error)

GetSpecIDs returns a list of spec IDs (directory names under spectr/specs/) Returns empty slice (not error) if the directory doesn't exist Results are sorted alphabetically for consistency

func GetSpecs

func GetSpecs(projectPath string) ([]string, error)

GetSpecs finds all specs in spectr/specs/ that contain spec.md

Types

type ResolveResult

type ResolveResult struct {
	ChangeID     string
	PartialMatch bool
}

ResolveResult contains the resolved change ID and whether it was a partial match.

func ResolveChangeID

func ResolveChangeID(partialID, projectRoot string) (ResolveResult, error)

ResolveChangeID resolves a partial change ID to a full change ID. The resolution algorithm:

  1. Exact match: returns immediately if partialID exactly matches a change ID
  2. Prefix match: finds all change IDs that start with partialID (case-insensitive)
  3. Substring match: if no prefix matches, finds all change IDs containing partialID (case-insensitive)

Returns an error if: - No changes match the partial ID - Multiple changes match the partial ID (ambiguous)

Jump to

Keyboard shortcuts

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