Documentation
¶
Overview ¶
Package concern models low-confidence local findings before they become contribution hypotheses or public issues.
Index ¶
- Variables
- type Concern
- type Filter
- type Link
- type LinkKind
- type ListResult
- type Promotion
- type Repository
- type Service
- func (s *Service) Create(ctx context.Context, item *Concern) (*Concern, error)
- func (s *Service) Get(ctx context.Context, id string) (*Concern, error)
- func (s *Service) Link(ctx context.Context, id string, link Link) error
- func (s *Service) List(ctx context.Context, filter Filter) (*ListResult, error)
- func (s *Service) SetStatus(ctx context.Context, id string, next Status, rationale string) (*Concern, error)
- func (s *Service) Update(ctx context.Context, item *Concern) (*Concern, error)
- type Status
- type StatusChange
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNotFound indicates that a concern ID is absent. ErrNotFound = errors.New("concern not found") // ErrInvalidStatus indicates an unsupported lifecycle status. ErrInvalidStatus = errors.New("invalid concern status") // ErrInvalidTransition indicates a forbidden lifecycle transition. ErrInvalidTransition = errors.New("invalid concern status transition") // ErrInvalidLink indicates a malformed or unsupported relationship. ErrInvalidLink = errors.New("invalid concern link") // ErrConflict indicates that a caller tried to replace a revision it no // longer owns. ErrConflict = errors.New("concern changed concurrently") )
Functions ¶
This section is empty.
Types ¶
type Concern ¶
type Concern struct {
ID string
Repo domain.RepoRef
CommitSHA string
WorkspaceID string
Title string
ProblemStatement string
SuspectedOwner string
Confidence float64
Unknowns []string
SuccessCriterion string
Notes string
EvidenceIDs []string
SourceRefs []domain.SourceRef
SourceProvenance []evidence.SourceRevision
Links []Link
Status Status
AuditTrail []StatusChange
Promotion *Promotion
CreatedAt time.Time
UpdatedAt time.Time
}
Concern is a durable local intake record. WorkspaceID is an opaque corpus identity; absolute host paths are never stored here.
type Link ¶
type Link struct {
Kind LinkKind
TargetType string
TargetID string
Note string
CreatedAt time.Time
}
Link points to another local record or a credential-free repository ref.
type LinkKind ¶
type LinkKind string
LinkKind describes an explicit, non-inferred relationship.
const ( // LinkRelated is a non-causal association. LinkRelated LinkKind = "related" // LinkDuplicateCandidate records possible duplicate work. LinkDuplicateCandidate LinkKind = "duplicate_candidate" // LinkHotspot points at an affected repository area. LinkHotspot LinkKind = "hotspot" // LinkInvestigation points at a promoted or related investigation. LinkInvestigation LinkKind = "investigation" // LinkOpportunity points at a promoted or related opportunity. LinkOpportunity LinkKind = "opportunity" )
type ListResult ¶ added in v0.11.0
ListResult separates a bounded concern window from its matching population.
type Promotion ¶
type Promotion struct {
Kind string
InvestigationID string
HypothesisID string
OpportunityID string
PromotedAt time.Time
}
Promotion preserves the local concern's downstream workflow identity.
type Repository ¶
type Repository interface {
SaveConcern(context.Context, *Concern) error
UpdateConcern(context.Context, *Concern, *Concern) error
GetConcern(context.Context, string) (*Concern, error)
ListConcerns(context.Context, Filter) (*ListResult, error)
AddConcernLink(context.Context, string, Link) error
}
Repository is the narrow persistence boundary for local concerns.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service validates local concern lifecycle operations.
func NewService ¶
func NewService(repo Repository) *Service
NewService returns a concern service backed by repo.
func (*Service) Link ¶
Link records an explicit relationship. Duplicate candidates remain links; they do not silently change concern status or assert a root cause.
func (*Service) List ¶
List returns at most 100 concerns with exact population metadata and performs no external reads.
type Status ¶
type Status string
Status is the lifecycle of a local concern.
const ( // StatusUntriaged is newly recorded intake. StatusUntriaged Status = "untriaged" // StatusAccepted marks a concern as worth investigating. StatusAccepted Status = "accepted" // StatusInvestigating marks active evidence gathering. StatusInvestigating Status = "investigating" // StatusDeferred preserves a concern without active work. StatusDeferred Status = "deferred" // StatusPromoted marks an atomically created downstream workflow. StatusPromoted Status = "promoted" // StatusResolved closes a concern without active promotion. StatusResolved Status = "resolved" )