Documentation
¶
Overview ¶
Package topic parses and validates current-state topic inputs.
Index ¶
- func ParseMetadata(metadataRoot, path string, data []byte) (TopicID, Metadata, error)
- func ParseSelector(selector string) (topicID, claimID string, err error)
- func RenderIndex(model IndexRenderModel) (string, error)
- func RenderTopic(model TopicRenderModel) (string, error)
- type ADRHistory
- type Backing
- type Claim
- type ClaimHistory
- type ClaimReferences
- type ClaimType
- type Corpus
- type EffectiveSelector
- type IndexRenderModel
- type MarkerIndex
- type MarkerKind
- type MarkerSite
- type Metadata
- type NavigationModel
- type QueryClaim
- type QueryCoverage
- type QueryOptions
- type QueryResult
- type ScaffoldFile
- type Topic
- type TopicCoverage
- type TopicID
- type TopicListItem
- type TopicRenderModel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseMetadata ¶
func ParseSelector ¶
func RenderIndex ¶
func RenderIndex(model IndexRenderModel) (string, error)
func RenderTopic ¶
func RenderTopic(model TopicRenderModel) (string, error)
Types ¶
type ADRHistory ¶
type ClaimHistory ¶
type ClaimHistory struct {
ClaimID string `json:"claimId"`
Origin ADRHistory `json:"origin"`
RevisedBy []ADRHistory `json:"revisedBy"`
}
type ClaimReferences ¶
type Corpus ¶
type Corpus struct {
DomainPaths map[string][]string
Markers MarkerIndex
// contains filtered or unexported fields
}
type EffectiveSelector ¶
type IndexRenderModel ¶
type IndexRenderModel struct {
Domain string
Topics []TopicListItem
}
func BuildIndexModel ¶
func BuildIndexModel(domain string, topics []Topic) IndexRenderModel
type MarkerIndex ¶
type MarkerIndex struct {
// contains filtered or unexported fields
}
func BuildMarkerIndex ¶
func BuildMarkerIndex(root string, corpus Corpus, cfg *config.CurrentStateConfig) (MarkerIndex, error)
func (MarkerIndex) All ¶
func (m MarkerIndex) All() []MarkerSite
func (MarkerIndex) ForClaim ¶
func (m MarkerIndex) ForClaim(id string) []MarkerSite
type MarkerKind ¶
type MarkerKind string
const ( StateMarker MarkerKind = "state" ProofMarker MarkerKind = "invariant" TouchesMarker MarkerKind = "touches-state" )
type MarkerSite ¶
type MarkerSite struct {
Path string `json:"path"`
Line int `json:"line"`
Kind MarkerKind `json:"kind"`
ClaimID string `json:"claimId"`
Note string `json:"note,omitempty"`
}
type NavigationModel ¶
type NavigationModel struct {
}
func BuildNavigationModel ¶
func BuildNavigationModel(domain string, topics []Topic) NavigationModel
type QueryClaim ¶
type QueryCoverage ¶
type QueryCoverage struct {
DeclaredGlobal bool `json:"declaredGlobal"`
DeclaredPaths []string `json:"declaredPaths"`
EffectiveSelectors []EffectiveSelector `json:"effectiveSelectors"`
MarkerSites []MarkerSite `json:"markerSites"`
}
type QueryOptions ¶
type QueryOptions struct {
History, References, Coverage bool
}
QueryOptions selects independent detail projections for a current-state query.
type QueryResult ¶
type QueryResult struct {
Kind string `json:"kind"`
ID string `json:"id"`
Title string `json:"title,omitempty"`
Summary string `json:"summary,omitempty"`
Claims []QueryClaim `json:"claims"`
History []ClaimHistory `json:"history,omitempty"`
References []ClaimReferences `json:"references,omitempty"`
Coverage *QueryCoverage `json:"coverage,omitempty"`
}
QueryResult is the single deterministic semantic model used by human and JSON presentation. Optional detail blocks are nil unless their corresponding flag was requested.
func Query ¶
func Query(c Corpus, adrs adr.Corpus, selector string, opts QueryOptions) (QueryResult, error)
Query resolves one active topic or claim and assembles only the requested direct detail. It never traverses references or constructs removed identities.
type ScaffoldFile ¶
ScaffoldFile is one repository-relative authored input produced for a topic.
func ScaffoldFiles ¶
ScaffoldFiles validates and allocates the paired authored inputs for a topic. It inspects both trees but performs no writes.
type Topic ¶
type TopicCoverage ¶
type TopicCoverage struct {
DeclaredGlobal bool
DeclaredPaths []string
EffectiveSelectors []EffectiveSelector
HasClaims bool
SatisfiesScopedCoverage bool
MarkerSites []MarkerSite
}
func CoverageForTopic ¶
func CoverageForTopic(t Topic, domainPaths []string, markers MarkerIndex) TopicCoverage
type TopicListItem ¶
type TopicListItem struct{ Slug, Title, Summary, Link string }
type TopicRenderModel ¶
type TopicRenderModel struct{ Title, Summary, Applicability, Part string }
func BuildTopicModel ¶
func BuildTopicModel(t Topic, domainPaths []string, markers MarkerIndex) TopicRenderModel