domain

package
v0.0.0-...-6623cb7 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DeltaStatusOpen       DeltaStatus = "open"
	DeltaStatusInProgress DeltaStatus = "in-progress"
	DeltaStatusClosed     DeltaStatus = "closed"
	DeltaStatusDeferred   DeltaStatus = "deferred"
	DeltaStatusWithdrawn  DeltaStatus = "withdrawn"

	DeltaIntentAdd    DeltaIntent = "add"
	DeltaIntentChange DeltaIntent = "change"
	DeltaIntentRemove DeltaIntent = "remove"
	DeltaIntentRepair DeltaIntent = "repair"
)

Variables

This section is empty.

Functions

func DeriveRequirementTags

func DeriveRequirementTags(gherkin string) ([]string, error)

func DeriveRequirementTitle

func DeriveRequirementTitle(gherkin string) (string, error)

func ExpectedDeltaID

func ExpectedDeltaID(n int) string

func ExpectedReqID

func ExpectedReqID(n int) string

func ExtractGherkinTags

func ExtractGherkinTags(line string) []string

func IsValidDeltaID

func IsValidDeltaID(id string) bool

func IsValidDeltaIntent

func IsValidDeltaIntent(intent string) bool

func IsValidDeltaStatus

func IsValidDeltaStatus(s string) bool

func IsValidReqID

func IsValidReqID(id string) bool

func IsValidSpecStatus

func IsValidSpecStatus(s string) bool

func LenientCharterOrder

func LenientCharterOrder(charter *Charter) map[string]int

func MissingRequirementTags

func MissingRequirementTags(tags []string, configured []string) []string

func NextDeltaID

func NextDeltaID(deltas []Delta) (string, error)

func NextRequirementID

func NextRequirementID(requirements []Requirement) (string, error)

func NormalizeRepoDir

func NormalizeRepoDir(value string) (string, error)

func NormalizeRepoPath

func NormalizeRepoPath(value string) (string, error)

func NormalizeRequirementBlock

func NormalizeRequirementBlock(gherkin string) (string, error)

func ParseDeltaIDNumber

func ParseDeltaIDNumber(id string) (int, error)

func ParseReqIDNumber

func ParseReqIDNumber(id string) (int, error)

func ScopeMatchesPath

func ScopeMatchesPath(scopePrefix, candidate string) bool

func ScopesOverlap

func ScopesOverlap(a, b string) bool

func SemanticRequirementTags

func SemanticRequirementTags() []string

func ValidateDeltaSequence

func ValidateDeltaSequence(deltas []Delta) error

func ValidateRequirementSequence

func ValidateRequirementSequence(requirements []Requirement) error

func ValidateRequirementTagsConfigured

func ValidateRequirementTagsConfigured(tags []string, configured []string) error

func ValidateStoredRepoDirPath

func ValidateStoredRepoDirPath(value string) error

func ValidateStoredRepoFilePath

func ValidateStoredRepoFilePath(value string) error

Types

type ChangelogEntry

type ChangelogEntry struct {
	Rev             int      `yaml:"rev" json:"rev"`
	Date            string   `yaml:"date" json:"date"`
	DeltasOpened    []string `yaml:"deltas_opened" json:"deltas_opened"`
	DeltasClosed    []string `yaml:"deltas_closed" json:"deltas_closed"`
	DeltasWithdrawn []string `yaml:"deltas_withdrawn,omitempty" json:"deltas_withdrawn,omitempty"`
	ReqsAdded       []string `yaml:"reqs_added" json:"reqs_added"`
	ReqsVerified    []string `yaml:"reqs_verified" json:"reqs_verified"`
	Summary         string   `yaml:"summary" json:"summary"`
}

type Charter

type Charter struct {
	Name        string             `yaml:"name"`
	Title       string             `yaml:"title"`
	Description string             `yaml:"description"`
	Groups      []CharterGroup     `yaml:"groups"`
	Specs       []CharterSpecEntry `yaml:"specs"`
	DirPath     string             `yaml:"-"`
}

func (*Charter) EnsureGroup

func (c *Charter) EnsureGroup(group CharterGroup) error

func (*Charter) ExtraTrackingSpecs

func (c *Charter) ExtraTrackingSpecs(trackingSlugs []string) []string

func (*Charter) GroupByKey

func (c *Charter) GroupByKey(key string) *CharterGroup

func (*Charter) MissingTrackingSpecs

func (c *Charter) MissingTrackingSpecs(trackingSlugs []string) []string

func (*Charter) OrderedSpecs

func (c *Charter) OrderedSpecs() ([]CharterSpecEntry, error)

func (*Charter) ReplaceSpecEntry

func (c *Charter) ReplaceSpecEntry(entry CharterSpecEntry) error

func (*Charter) SpecBySlug

func (c *Charter) SpecBySlug(slug string) *CharterSpecEntry

func (*Charter) Validate

func (c *Charter) Validate() error

type CharterCycleError

type CharterCycleError struct {
	Slugs []string
}

func (*CharterCycleError) Error

func (e *CharterCycleError) Error() string

type CharterGroup

type CharterGroup struct {
	Key   string `yaml:"key" json:"key"`
	Title string `yaml:"title" json:"title"`
	Order int    `yaml:"order" json:"order"`
}

type CharterSpecEntry

type CharterSpecEntry struct {
	Slug      string   `yaml:"slug" json:"slug"`
	Group     string   `yaml:"group" json:"group"`
	Order     int      `yaml:"order" json:"order"`
	DependsOn []string `yaml:"depends_on" json:"depends_on"`
	Notes     string   `yaml:"notes" json:"notes"`
}

func NewCharterSpecEntry

func NewCharterSpecEntry(slug, group string, order int, dependsOn []string, notes string) (CharterSpecEntry, error)

func OrderedCharterSpecsLenient

func OrderedCharterSpecsLenient(charter *Charter) []CharterSpecEntry

type CharterValidationError

type CharterValidationError struct {
	Messages []string
}

func (*CharterValidationError) Error

func (e *CharterValidationError) Error() string

type Delta

type Delta struct {
	ID                  string      `yaml:"id" json:"id"`
	Area                string      `yaml:"area" json:"area"`
	Intent              DeltaIntent `yaml:"intent,omitempty" json:"intent,omitempty"`
	Status              DeltaStatus `yaml:"status" json:"status"`
	OriginCheckpoint    string      `yaml:"origin_checkpoint" json:"origin_checkpoint"`
	Current             string      `yaml:"current" json:"current"`
	Target              string      `yaml:"target" json:"target"`
	Notes               string      `yaml:"notes" json:"notes"`
	AffectsRequirements []string    `yaml:"affects_requirements,omitempty" json:"affects_requirements,omitempty"`
	Updates             []string    `yaml:"updates,omitempty" json:"updates,omitempty"`
	WithdrawnReason     string      `yaml:"withdrawn_reason,omitempty" json:"withdrawn_reason,omitempty"`
}

func NewDelta

func NewDelta(id string, intent DeltaIntent, area, originCheckpoint, current, target, notes string, affectsRequirements []string) (Delta, error)

type DeltaIntent

type DeltaIntent string

type DeltaStatus

type DeltaStatus string

type Documents

type Documents struct {
	Primary   string   `yaml:"primary" json:"primary"`
	Secondary []string `yaml:"secondary,omitempty" json:"secondary,omitempty"`
}

type LenientCharterOrdering

type LenientCharterOrdering struct {
	Specs []CharterSpecEntry
	Index map[string]int
}

func BuildLenientCharterOrdering

func BuildLenientCharterOrdering(charter *Charter) LenientCharterOrdering

type Requirement

type Requirement struct {
	ID           string                  `yaml:"id" json:"id"`
	Title        string                  `yaml:"title" json:"title"`
	Traces       []string                `yaml:"-" json:"-"`
	Tags         []string                `yaml:"tags" json:"tags"`
	TestFiles    []string                `yaml:"test_files" json:"test_files"`
	Verified     bool                    `yaml:"-" json:"-"`
	Gherkin      string                  `yaml:"gherkin" json:"gherkin"`
	Lifecycle    RequirementLifecycle    `yaml:"lifecycle,omitempty" json:"lifecycle,omitempty"`
	Verification RequirementVerification `yaml:"verification,omitempty" json:"verification,omitempty"`
	IntroducedBy string                  `yaml:"introduced_by,omitempty" json:"introduced_by,omitempty"`
	Supersedes   string                  `yaml:"supersedes,omitempty" json:"supersedes,omitempty"`
	SupersededBy string                  `yaml:"superseded_by,omitempty" json:"superseded_by,omitempty"`
}

func NewRequirement

func NewRequirement(id string, deltaID string, gherkin string) (Requirement, error)

func (Requirement) EffectiveLifecycle

func (r Requirement) EffectiveLifecycle() RequirementLifecycle

func (Requirement) EffectiveVerification

func (r Requirement) EffectiveVerification() RequirementVerification

func (Requirement) HasTag

func (r Requirement) HasTag(tag string) bool

func (Requirement) IsActive

func (r Requirement) IsActive() bool

func (Requirement) IsE2E

func (r Requirement) IsE2E() bool

func (Requirement) IsManual

func (r Requirement) IsManual() bool

func (Requirement) IsVerified

func (r Requirement) IsVerified() bool

type RequirementLifecycle

type RequirementLifecycle string
const (
	RequirementLifecycleActive     RequirementLifecycle = "active"
	RequirementLifecycleSuperseded RequirementLifecycle = "superseded"
	RequirementLifecycleWithdrawn  RequirementLifecycle = "withdrawn"
)

type RequirementVerification

type RequirementVerification string
const (
	RequirementVerificationUnverified RequirementVerification = "unverified"
	RequirementVerificationVerified   RequirementVerification = "verified"
	RequirementVerificationStale      RequirementVerification = "stale"
)

type SpecStatus

type SpecStatus string
const (
	SpecStatusDraft    SpecStatus = "draft"
	SpecStatusReady    SpecStatus = "ready"
	SpecStatusActive   SpecStatus = "active"
	SpecStatusVerified SpecStatus = "verified"
)

func ValidSpecStatuses

func ValidSpecStatuses() []SpecStatus

type TrackingFile

type TrackingFile struct {
	Slug           string           `yaml:"slug"`
	Charter        string           `yaml:"charter"`
	Title          string           `yaml:"title"`
	Status         SpecStatus       `yaml:"status"`
	Rev            int              `yaml:"rev"`
	Created        string           `yaml:"created"`
	Updated        string           `yaml:"updated"`
	LastVerifiedAt string           `yaml:"last_verified_at"`
	Checkpoint     string           `yaml:"checkpoint"`
	Tags           []string         `yaml:"tags"`
	Documents      Documents        `yaml:"documents"`
	Scope          []string         `yaml:"scope"`
	Deltas         []Delta          `yaml:"deltas"`
	Requirements   []Requirement    `yaml:"requirements"`
	Changelog      []ChangelogEntry `yaml:"changelog"`
	FilePath       string           `yaml:"-"`
}

func (*TrackingFile) AllocateNextDeltaID

func (t *TrackingFile) AllocateNextDeltaID() (string, error)

func (*TrackingFile) AllocateNextRequirementID

func (t *TrackingFile) AllocateNextRequirementID() (string, error)

func (*TrackingFile) BlockingRequirementsForDeltaClosure

func (t *TrackingFile) BlockingRequirementsForDeltaClosure(deltaID string) ([]Requirement, error)

func (*TrackingFile) ComputedStatus

func (t *TrackingFile) ComputedStatus() SpecStatus

func (*TrackingFile) DeltaByID

func (t *TrackingFile) DeltaByID(id string) *Delta

func (*TrackingFile) DeltaUpdatesResolved

func (t *TrackingFile) DeltaUpdatesResolved(deltaID string) bool

func (*TrackingFile) DeltasTouchingRequirement

func (t *TrackingFile) DeltasTouchingRequirement(requirementID string) []string

func (*TrackingFile) LiveDeltas

func (t *TrackingFile) LiveDeltas() []Delta

func (*TrackingFile) RequirementByID

func (t *TrackingFile) RequirementByID(id string) *Requirement

func (*TrackingFile) RequirementsTouchedByDelta

func (t *TrackingFile) RequirementsTouchedByDelta(delta Delta) []Requirement

func (*TrackingFile) SyncComputedStatus

func (t *TrackingFile) SyncComputedStatus()

func (*TrackingFile) TracingRequirements

func (t *TrackingFile) TracingRequirements(deltaID string) []Requirement

func (*TrackingFile) Validate

func (t *TrackingFile) Validate() error

func (*TrackingFile) ValidateDeltaClosure

func (t *TrackingFile) ValidateDeltaClosure(deltaID string) error

Jump to

Keyboard shortcuts

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