application

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

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init() (map[string]any, error)

Init bootstraps specctl governance in the current working directory. Delegates filesystem operations to infrastructure.InitWorkspace.

func ReadSurfaceNextMode

func ReadSurfaceNextMode(state any, next []any) string

Types

type CharterAddSpecRequest

type CharterAddSpecRequest struct {
	Charter    string
	Slug       string
	Group      string
	GroupTitle *string
	GroupOrder *int
	Order      int
	DependsOn  []string
	Notes      string
}

type CharterCreateRequest

type CharterCreateRequest struct {
	Charter     string
	Title       string
	Description string
	Groups      []domain.CharterGroup
}

type CharterDiffEndpoint

type CharterDiffEndpoint struct {
	Rev        int    `json:"rev"`
	Checkpoint string `json:"checkpoint"`
}

type CharterDiffProjection

type CharterDiffProjection struct {
	Charter      string                      `json:"charter"`
	OrderedSpecs []CharterDiffSpecProjection `json:"ordered_specs"`
	Validation   ValidationProjection        `json:"validation"`
}

type CharterDiffSpecProjection

type CharterDiffSpecProjection struct {
	Slug       string               `json:"slug"`
	DependsOn  []string             `json:"depends_on"`
	From       *CharterDiffEndpoint `json:"from"`
	To         CharterDiffEndpoint  `json:"to"`
	Changed    bool                 `json:"changed"`
	Validation ValidationProjection `json:"validation"`
}

type CharterMembershipProjection

type CharterMembershipProjection struct {
	Group      string   `json:"group"`
	GroupTitle string   `json:"group_title"`
	GroupOrder int      `json:"group_order"`
	Order      int      `json:"order"`
	DependsOn  []string `json:"depends_on"`
	Notes      string   `json:"notes"`
}

type CharterProjection

type CharterProjection struct {
	Name         string                    `json:"name"`
	Title        string                    `json:"title"`
	Description  string                    `json:"description"`
	TrackingFile string                    `json:"tracking_file"`
	Groups       []domain.CharterGroup     `json:"groups"`
	OrderedSpecs []OrderedCharterSpecEntry `json:"ordered_specs"`
	Validation   ValidationProjection      `json:"validation"`
	Focus        any                       `json:"focus,omitempty"`
}

type ConfigProjection

type ConfigProjection struct {
	SemanticTags   []string                               `json:"semantic_tags"`
	GherkinTags    []string                               `json:"gherkin_tags"`
	SourcePrefixes []string                               `json:"source_prefixes"`
	Formats        map[string]infrastructure.FormatConfig `json:"formats"`
	Validation     ValidationProjection                   `json:"validation"`
	Warnings       []infrastructure.SourcePrefixWarning   `json:"warnings,omitempty"`
	Focus          any                                    `json:"focus,omitempty"`
}

type DeltaAddRequest

type DeltaAddRequest struct {
	Target              string
	Intent              domain.DeltaIntent
	Area                string
	Current             string
	CurrentPresent      bool
	Targets             string
	TargetPresent       bool
	Notes               string
	NotesPresent        bool
	AffectsRequirements []string
}

type DeltaCountsProjection

type DeltaCountsProjection struct {
	Open       int `json:"open"`
	InProgress int `json:"in_progress"`
	Closed     int `json:"closed"`
	Deferred   int `json:"deferred"`
	Withdrawn  int `json:"withdrawn"`
}

type DeltaItemProjection

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

type DeltaProjection

type DeltaProjection struct {
	Open       int                   `json:"open"`
	InProgress int                   `json:"in_progress"`
	Closed     int                   `json:"closed"`
	Deferred   int                   `json:"deferred"`
	Withdrawn  int                   `json:"withdrawn"`
	Items      []DeltaItemProjection `json:"items"`
}

type DeltaRebindRequest

type DeltaRebindRequest struct {
	Target  string
	DeltaID string
	From    string
	To      string
	Remove  bool
	Reason  string
}

type DeltaTransitionRequest

type DeltaTransitionRequest struct {
	Target  string
	DeltaID string
}

type DeltaWithdrawRequest

type DeltaWithdrawRequest struct {
	Target  string
	DeltaID string
	Reason  string
}

type DesignDocDiff

type DesignDocDiff struct {
	Path            string                 `json:"path"`
	Changed         bool                   `json:"changed"`
	SectionsChanged []DesignDocSectionDiff `json:"sections_changed"`
}

type DesignDocSectionDiff

type DesignDocSectionDiff struct {
	Heading string `json:"heading"`
	Type    string `json:"type"`
	Lines   [2]int `json:"lines"`
}

type DiffDeltaSummary

type DiffDeltaSummary struct {
	ID               string             `json:"id"`
	Area             string             `json:"area"`
	OriginCheckpoint string             `json:"origin_checkpoint"`
	Status           domain.DeltaStatus `json:"status"`
	Current          string             `json:"current"`
	Target           string             `json:"target"`
}

type DiffDocumentsModel

type DiffDocumentsModel struct {
	PrimaryFrom *string `json:"primary_from"`
	PrimaryTo   string  `json:"primary_to"`
}

type DiffEndpoint

type DiffEndpoint struct {
	Rev        int               `json:"rev"`
	Checkpoint string            `json:"checkpoint"`
	Status     domain.SpecStatus `json:"status"`
}

type DiffRequirementIssuesProjection

type DiffRequirementIssuesProjection struct {
	MatchIssues []DiffRequirementMatchIssue `json:"match_issues"`
}

type DiffRequirementMatchIssue

type DiffRequirementMatchIssue struct {
	ID     string `json:"id"`
	Status string `json:"status"`
}

type DiffRequirementSummary

type DiffRequirementSummary struct {
	ID    string   `json:"id"`
	Title string   `json:"title"`
	Tags  []string `json:"tags"`
}

type DiffSetModel

type DiffSetModel struct {
	Added   []string `json:"added"`
	Removed []string `json:"removed"`
}

type DiffStatusModel

type DiffStatusModel struct {
	From *domain.SpecStatus `json:"from"`
	To   domain.SpecStatus  `json:"to"`
}

type DocAddRequest

type DocAddRequest struct {
	Target string
	Doc    string
}

type DocRemoveRequest

type DocRemoveRequest struct {
	Target string
	Doc    string
}

type ErrCharterExists

type ErrCharterExists struct {
	Charter string
}

func (ErrCharterExists) Error

func (e ErrCharterExists) Error() string

type Failure

type Failure struct {
	Code     string
	Message  string
	State    any
	NextMode string
	Next     []any
}

func (*Failure) Error

func (f *Failure) Error() string

type FileContextProjection

type FileContextProjection struct {
	File          string                `json:"file"`
	Resolution    string                `json:"resolution"`
	MatchSource   *string               `json:"match_source"`
	GoverningSpec *FileGoverningSpec    `json:"governing_spec"`
	Matches       []FileMatchProjection `json:"matches"`
	Validation    ValidationProjection  `json:"validation"`
	Focus         any                   `json:"focus,omitempty"`
}

type FileGoverningSpec

type FileGoverningSpec struct {
	Slug         string           `json:"slug"`
	Charter      string           `json:"charter"`
	TrackingFile string           `json:"tracking_file"`
	Documents    domain.Documents `json:"documents"`
}

type FileMatchProjection

type FileMatchProjection struct {
	Slug        string `json:"slug"`
	Charter     string `json:"charter"`
	MatchSource string `json:"match_source"`
	ScopePrefix string `json:"scope_prefix,omitempty"`
}

type HookAffectedSpec

type HookAffectedSpec struct {
	Slug               string            `json:"slug"`
	Charter            string            `json:"charter"`
	Status             domain.SpecStatus `json:"status"`
	TrackingFile       string            `json:"tracking_file"`
	TrackingFileStaged bool              `json:"tracking_file_staged"`
	DesignDoc          string            `json:"design_doc"`
	DesignDocStaged    bool              `json:"design_doc_staged"`
	MatchedFiles       []string          `json:"matched_files"`
}

type HookProjection

type HookProjection struct {
	InputFiles      []string             `json:"input_files"`
	ConsideredFiles []string             `json:"considered_files"`
	IgnoredFiles    []string             `json:"ignored_files"`
	UnmatchedFiles  []string             `json:"unmatched_files"`
	AffectedSpecs   []HookAffectedSpec   `json:"affected_specs"`
	Validation      ValidationProjection `json:"validation"`
}

type MissingCharterContext

type MissingCharterContext struct {
	Charter      string `json:"charter"`
	TrackingFile any    `json:"tracking_file"`
	Focus        any    `json:"focus,omitempty"`
}

type MissingSpecContext

type MissingSpecContext struct {
	Target        string `json:"target"`
	TrackingFile  any    `json:"tracking_file"`
	CharterExists bool   `json:"charter_exists"`
	Focus         any    `json:"focus,omitempty"`
}

type OpenDeltaProjection

type OpenDeltaProjection struct {
	ID     string             `json:"id"`
	Area   string             `json:"area"`
	Status domain.DeltaStatus `json:"status"`
}

type OrderedCharterSpecEntry

type OrderedCharterSpecEntry struct {
	Slug         string               `json:"slug"`
	Group        domain.CharterGroup  `json:"group"`
	Order        int                  `json:"order"`
	DependsOn    []string             `json:"depends_on"`
	Notes        string               `json:"notes"`
	Status       domain.SpecStatus    `json:"status"`
	TrackingFile string               `json:"tracking_file"`
	Validation   ValidationProjection `json:"validation"`
}

type RegistryCharterSummary

type RegistryCharterSummary struct {
	Name       string               `json:"name"`
	Title      string               `json:"title"`
	SpecCount  int                  `json:"spec_count"`
	Validation ValidationProjection `json:"validation"`
}

type RegistryProjection

type RegistryProjection struct {
	Specs    []RegistrySpecSummary    `json:"specs"`
	Charters []RegistryCharterSummary `json:"charters"`
	Config   ValidationContainer      `json:"config"`
	Audit    ValidationProjection     `json:"audit"`
	Focus    any                      `json:"focus,omitempty"`
}

type RegistrySpecSummary

type RegistrySpecSummary struct {
	Slug         string                `json:"slug"`
	Charter      string                `json:"charter"`
	Title        string                `json:"title"`
	Status       domain.SpecStatus     `json:"status"`
	TrackingFile string                `json:"tracking_file"`
	Documents    domain.Documents      `json:"documents"`
	Scope        []string              `json:"scope"`
	Deltas       DeltaCountsProjection `json:"deltas"`
	Validation   ValidationProjection  `json:"validation"`
}

type RequirementAddRequest

type RequirementAddRequest struct {
	Target  string
	DeltaID string
	Gherkin string
}

type RequirementDeltaRequest

type RequirementDeltaRequest struct {
	Target        string
	RequirementID string
	DeltaID       string
}

type RequirementMatchProjection

type RequirementMatchProjection struct {
	Status  string  `json:"status"`
	Heading *string `json:"heading"`
}

type RequirementProjection

type RequirementProjection struct {
	ID           string                           `json:"id"`
	Title        string                           `json:"title"`
	Tags         []string                         `json:"tags"`
	Lifecycle    domain.RequirementLifecycle      `json:"lifecycle"`
	Verification domain.RequirementVerification   `json:"verification"`
	IntroducedBy string                           `json:"introduced_by"`
	Supersedes   *string                          `json:"supersedes"`
	SupersededBy *string                          `json:"superseded_by"`
	TestFiles    []string                         `json:"test_files"`
	Gherkin      string                           `json:"gherkin"`
	Match        RequirementMatchProjection       `json:"match"`
	SpecContext  RequirementSpecContextProjection `json:"spec_context"`
}

type RequirementRefreshRequest

type RequirementRefreshRequest struct {
	Target        string
	RequirementID string
	Gherkin       string
}

type RequirementReplaceRequest

type RequirementReplaceRequest struct {
	Target        string
	RequirementID string
	DeltaID       string
	Gherkin       string
}

type RequirementSpecContextProjection

type RequirementSpecContextProjection struct {
	Scenarios []string `json:"scenarios"`
}

type RequirementSummaryProjection

type RequirementSummaryProjection struct {
	ID           string                         `json:"id"`
	Title        string                         `json:"title"`
	Tags         []string                       `json:"tags"`
	Lifecycle    domain.RequirementLifecycle    `json:"lifecycle"`
	Verification domain.RequirementVerification `json:"verification"`
	IntroducedBy string                         `json:"introduced_by"`
	TestFiles    []string                       `json:"test_files"`
}

type RequirementVerifyRequest

type RequirementVerifyRequest struct {
	Target        string
	RequirementID string
	TestFiles     []string
}

type RevisionBumpRequest

type RevisionBumpRequest struct {
	Target     string
	Checkpoint string
	Summary    string
}

type ScopeCodeDiff

type ScopeCodeDiff struct {
	ChangedFiles []string `json:"changed_files"`
}

type ScopeDriftProjection

type ScopeDriftProjection struct {
	Status                      string   `json:"status"`
	Checkpoint                  string   `json:"checkpoint"`
	DriftSource                 *string  `json:"drift_source"`
	LastVerifiedAt              string   `json:"last_verified_at"`
	TrackedBy                   []string `json:"tracked_by"`
	FilesChangedSinceCheckpoint []string `json:"files_changed_since_checkpoint"`
}

type Service

type Service struct {
	// contains filtered or unexported fields
}

func OpenFromWorkingDir

func OpenFromWorkingDir() (*Service, error)

func (*Service) AddConfigPrefix

func (s *Service) AddConfigPrefix(prefix string) (ConfigProjection, map[string]any, []any, error)

func (*Service) AddConfigTag

func (s *Service) AddConfigTag(tag string) (ConfigProjection, map[string]any, []any, error)

func (*Service) AddDelta

func (s *Service) AddDelta(request DeltaAddRequest) (SpecProjection, map[string]any, []any, error)

func (*Service) AddRequirement

func (s *Service) AddRequirement(request RequirementAddRequest) (SpecProjection, map[string]any, []any, error)

func (*Service) AddSpecToCharter

func (s *Service) AddSpecToCharter(request CharterAddSpecRequest) (CharterProjection, map[string]any, []any, error)

func (*Service) BumpRevision

func (s *Service) BumpRevision(request RevisionBumpRequest) (SpecProjection, map[string]any, []any, error)

func (*Service) CloseDelta

func (s *Service) CloseDelta(request DeltaTransitionRequest) (SpecProjection, map[string]any, []any, error)

func (*Service) CreateCharter

func (s *Service) CreateCharter(request CharterCreateRequest) (CharterProjection, map[string]any, []any, error)

func (*Service) CreateSpec

func (s *Service) CreateSpec(request SpecCreateRequest) (SpecProjection, map[string]any, []any, error)

func (*Service) DeferDelta

func (s *Service) DeferDelta(request DeltaTransitionRequest) (SpecProjection, map[string]any, []any, error)

func (*Service) DocAdd

func (s *Service) DocAdd(request DocAddRequest) (SpecProjection, map[string]any, []any, error)

func (*Service) DocRemove

func (s *Service) DocRemove(request DocRemoveRequest) (SpecProjection, map[string]any, []any, error)

func (*Service) ReadConfig

func (s *Service) ReadConfig() (ConfigProjection, error)

func (*Service) ReadContext

func (s *Service) ReadContext(target, file string) (any, []any, error)

func (*Service) ReadDiff

func (s *Service) ReadDiff(target, charterName string) (any, []any, error)

func (*Service) ReadHook

func (s *Service) ReadHook(stdin string) (HookProjection, error)

func (*Service) RebindDeltaRequirements

func (s *Service) RebindDeltaRequirements(request DeltaRebindRequest) (SpecProjection, map[string]any, []any, error)

func (*Service) RefreshRequirement

func (s *Service) RefreshRequirement(request RequirementRefreshRequest) (SpecProjection, map[string]any, []any, error)

func (*Service) RemoveConfigPrefix

func (s *Service) RemoveConfigPrefix(prefix string) (ConfigProjection, map[string]any, []any, error)

func (*Service) RemoveConfigTag

func (s *Service) RemoveConfigTag(tag string) (ConfigProjection, map[string]any, []any, error)

func (*Service) RemoveSpecFromCharter

func (s *Service) RemoveSpecFromCharter(charterName, slug string) (CharterProjection, map[string]any, []any, error)

func (*Service) ReplaceRequirement

func (s *Service) ReplaceRequirement(request RequirementReplaceRequest) (SpecProjection, map[string]any, []any, error)

func (*Service) ResumeDelta

func (s *Service) ResumeDelta(request DeltaTransitionRequest) (SpecProjection, map[string]any, []any, error)

func (*Service) SpecsDir

func (s *Service) SpecsDir() string

SpecsDir returns the resolved specs directory path for this service.

func (*Service) StaleRequirement

func (s *Service) StaleRequirement(request RequirementDeltaRequest) (SpecProjection, map[string]any, []any, error)

func (*Service) StartDelta

func (s *Service) StartDelta(request DeltaTransitionRequest) (SpecProjection, map[string]any, []any, error)

func (*Service) Sync

func (s *Service) Sync(request SyncRequest) (SpecProjection, map[string]any, []any, error)

func (*Service) VerifyRequirement

func (s *Service) VerifyRequirement(request RequirementVerifyRequest) (SpecProjection, map[string]any, []any, error)

func (*Service) WithdrawDelta

func (s *Service) WithdrawDelta(request DeltaWithdrawRequest) (SpecProjection, map[string]any, []any, error)

func (*Service) WithdrawRequirement

func (s *Service) WithdrawRequirement(request RequirementDeltaRequest) (SpecProjection, map[string]any, []any, error)

type SpecContextWarningProjection

type SpecContextWarningProjection struct {
	Kind           string         `json:"kind"`
	Code           string         `json:"code"`
	Severity       string         `json:"severity"`
	Message        string         `json:"message"`
	DeltaIDs       []string       `json:"delta_ids"`
	RequirementIDs []string       `json:"requirement_ids"`
	Details        map[string]any `json:"details"`
}

type SpecCreateRequest

type SpecCreateRequest struct {
	Target       string
	Title        string
	Doc          string
	Scope        []string
	Group        string
	GroupTitle   *string
	GroupOrder   *int
	Order        int
	CharterNotes string
	DependsOn    []string
	Tags         []string
}

type SpecCreateTemplateSeed

type SpecCreateTemplateSeed struct {
	Target               string
	Group                string
	IncludeGroupField    bool
	IncludeGroupMetadata bool
	ChooseWhen           string
	Scope                string
	Priority             int
	Instructions         string
}

func (SpecCreateTemplateSeed) InstructionsOrDefault

func (s SpecCreateTemplateSeed) InstructionsOrDefault() string

func (SpecCreateTemplateSeed) PriorityOrDefault

func (s SpecCreateTemplateSeed) PriorityOrDefault() int

func (SpecCreateTemplateSeed) ScopePlaceholderOrDefault

func (s SpecCreateTemplateSeed) ScopePlaceholderOrDefault() string

type SpecDiffDeltaModel

type SpecDiffDeltaModel struct {
	Opened    []DiffDeltaSummary `json:"opened"`
	Closed    []DiffDeltaSummary `json:"closed"`
	Deferred  []DiffDeltaSummary `json:"deferred"`
	Resumed   []DiffDeltaSummary `json:"resumed"`
	Withdrawn []DiffDeltaSummary `json:"withdrawn"`
}

type SpecDiffModel

type SpecDiffModel struct {
	Status       DiffStatusModel          `json:"status"`
	SpecTags     DiffSetModel             `json:"spec_tags"`
	Documents    DiffDocumentsModel       `json:"documents"`
	Scope        DiffSetModel             `json:"scope"`
	Deltas       SpecDiffDeltaModel       `json:"deltas"`
	Requirements SpecDiffRequirementModel `json:"requirements"`
}

type SpecDiffProjection

type SpecDiffProjection struct {
	Target       string                          `json:"target"`
	Baseline     string                          `json:"baseline"`
	Comparison   string                          `json:"comparison"`
	DriftSource  *string                         `json:"drift_source"`
	From         *DiffEndpoint                   `json:"from"`
	To           DiffEndpoint                    `json:"to"`
	Model        SpecDiffModel                   `json:"model"`
	DesignDoc    DesignDocDiff                   `json:"design_doc"`
	ScopeCode    ScopeCodeDiff                   `json:"scope_code"`
	Requirements DiffRequirementIssuesProjection `json:"requirements"`
	Validation   ValidationProjection            `json:"validation"`
	Focus        any                             `json:"focus,omitempty"`
}

type SpecDiffRequirementModel

type SpecDiffRequirementModel struct {
	Added    []DiffRequirementSummary `json:"added"`
	Verified []DiffRequirementSummary `json:"verified"`
}

type SpecProjection

type SpecProjection struct {
	Slug                             string                         `json:"slug"`
	Charter                          string                         `json:"charter"`
	Title                            string                         `json:"title"`
	Status                           domain.SpecStatus              `json:"status"`
	Rev                              int                            `json:"rev"`
	Created                          string                         `json:"created"`
	Updated                          string                         `json:"updated"`
	LastVerifiedAt                   string                         `json:"last_verified_at"`
	Checkpoint                       string                         `json:"checkpoint"`
	TrackingFile                     string                         `json:"tracking_file"`
	Tags                             []string                       `json:"tags"`
	Format                           *string                        `json:"format"`
	FormatTemplate                   *string                        `json:"format_template"`
	Documents                        domain.Documents               `json:"documents"`
	CharterMembership                *CharterMembershipProjection   `json:"charter_membership"`
	Scope                            []string                       `json:"scope"`
	Deltas                           DeltaProjection                `json:"deltas"`
	OpenDeltas                       []OpenDeltaProjection          `json:"open_deltas"`
	Requirements                     []RequirementProjection        `json:"requirements"`
	ActionableUnverifiedRequirements []RequirementSummaryProjection `json:"actionable_unverified_requirements"`
	InactiveUnverifiedRequirements   []RequirementSummaryProjection `json:"inactive_unverified_requirements"`
	Changelog                        []domain.ChangelogEntry        `json:"changelog"`
	ScopeDrift                       ScopeDriftProjection           `json:"scope_drift"`
	UncommittedChanges               []string                       `json:"uncommitted_changes"`
	Warnings                         []SpecContextWarningProjection `json:"warnings,omitempty"`
	Validation                       ValidationProjection           `json:"validation"`
	Focus                            any                            `json:"focus,omitempty"`

	// OrphanGherkinBlocks is the raw list of SPEC.md gherkin blocks
	// parsed from the design doc that did not match any tracking
	// requirement by gherkin or title. Carried on the projection so
	// buildSpecContextWarnings can emit SPEC_ORPHAN_GHERKIN_BLOCK
	// advisories; not serialized directly because the user-visible
	// surface is the aggregated warning, not the raw blocks.
	OrphanGherkinBlocks []infrastructure.RequirementContext `json:"-"`
}

type SyncRequest

type SyncRequest struct {
	Target     string
	Checkpoint string
	Summary    string
}

type ValidationContainer

type ValidationContainer struct {
	Validation ValidationProjection                 `json:"validation"`
	Warnings   []infrastructure.SourcePrefixWarning `json:"warnings,omitempty"`
}

type ValidationProjection

type ValidationProjection struct {
	Valid    bool  `json:"valid"`
	Findings []any `json:"findings"`
}

Jump to

Keyboard shortcuts

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