reqid

package
v0.2.5 Latest Latest
Warning

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

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

Documentation

Overview

CANARY: REQ=CBIN-139; FEATURE="AspectIDGenerator"; ASPECT=Engine; STATUS=IMPL; UPDATED=2025-10-16

CANARY: REQ=CBIN-139; FEATURE="AspectIDParser"; ASPECT=Engine; STATUS=IMPL; UPDATED=2025-10-16

CANARY: REQ-151; FEATURE="FixedPrefixes"; ASPECT=Engine; STATUS=IMPL; UPDATED=2025-11-01

CANARY: REQ=CBIN-139; FEATURE="AspectValidator"; ASPECT=Engine; STATUS=IMPL; UPDATED=2025-10-16

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateNextID

func GenerateNextID(key, aspect string) (string, error)

GenerateNextID generates the next requirement ID for a given aspect

func NormalizeAspect

func NormalizeAspect(input string) string

NormalizeAspect normalizes aspect casing to the canonical form

func SuggestAspect

func SuggestAspect(typo string) string

SuggestAspect returns fuzzy match suggestions for invalid aspects

func ValidateAspect

func ValidateAspect(aspect string) error

ValidateAspect checks if the given aspect is valid Accepts: exact canonical form, all-lowercase, or all-uppercase Rejects: partial capitalizations (e.g., "Frontend" when it should be "FrontEnd")

Types

type ID

type ID struct {
	Type   IDType // REQ, TASK, or BUG
	Number int    // Numeric identifier (e.g., 123)

	// Relationships
	ParentID string // For TASK/BUG: the REQ or TASK this relates to (optional)
}

ID represents a parsed identifier (REQ, TASK, or BUG)

func New

func New(typ IDType, number int) *ID

New creates a new ID

func NewBUG

func NewBUG(number int) *ID

NewBUG creates a new BUG identifier

func NewREQ

func NewREQ(number int) *ID

NewREQ creates a new REQ identifier

func NewTASK

func NewTASK(number int) *ID

NewTASK creates a new TASK identifier

func Parse

func Parse(id string) (*ID, error)

Parse parses an ID string into its components

func (*ID) IsBUG

func (id *ID) IsBUG() bool

IsBUG returns true if this is a BUG identifier

func (*ID) IsREQ

func (id *ID) IsREQ() bool

IsREQ returns true if this is a REQ identifier

func (*ID) IsTASK

func (id *ID) IsTASK() bool

IsTASK returns true if this is a TASK identifier

func (*ID) String

func (id *ID) String() string

String returns the string representation of the ID

func (*ID) Validate

func (id *ID) Validate() error

Validate checks if the ID is valid

type IDType

type IDType string

IDType represents the type of identifier

const (
	// TypeREQ represents a requirement specification
	TypeREQ IDType = "REQ"

	// TypeTASK represents a task within a requirement plan
	TypeTASK IDType = "TASK"

	// TypeBUG represents a bug related to a requirement or task
	TypeBUG IDType = "BUG"
)

type RequirementID

type RequirementID struct {
	Key    string // e.g., "CBIN"
	Aspect string // e.g., "CLI", "API" (empty for v1 format)
	ID     string // e.g., "001", "042"
	Format string // "v1" (CBIN-XXX) or "v2" (CBIN-SECURITY_REVIEW-XXX)
}

RequirementID represents a parsed requirement identifier

func ParseRequirementID

func ParseRequirementID(reqID string) (*RequirementID, error)

ParseRequirementID parses a requirement ID string into its components

func (*RequirementID) String

func (r *RequirementID) String() string

String returns the string representation of the RequirementID

Jump to

Keyboard shortcuts

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