Documentation
¶
Overview ¶
Package threadcontext normalizes inline review threads into prompt-safe domain context.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SanitizeBody ¶
SanitizeBody removes closed codereview marker comments and escapes any remaining marker opening so prompt-facing text cannot carry live markers.
Types ¶
type Anchor ¶
type Anchor struct {
Path string
Side review.DiffSide
Line int
SubjectType review.AnchorKind
CommitSHA string
}
Anchor identifies the review-thread location.
type Comment ¶
type Comment struct {
ID gitprovider.CommentID
ThreadID gitprovider.ThreadID
Body string
Author gitprovider.Identity
Anchor Anchor
URL string
CreatedAt time.Time
UpdatedAt time.Time
AuthoredByPostingIdentity bool
HasFindingMarker bool
HasThreadReplyMarker bool
HasThreadSummaryMarker bool
// contains filtered or unexported fields
}
Comment is one prompt-safe normalized thread comment.
type FileContext ¶
type FileContext struct {
Path string
Summaries []ThreadSummary
}
FileContext groups compact thread summaries by file path.
func FileScopedResolvedSummaries ¶
func FileScopedResolvedSummaries(threads []Thread) []FileContext
FileScopedResolvedSummaries returns provider-resolved thread summaries grouped by file path.
func FileScopedSettledSummaries ¶ added in v0.9.191
func FileScopedSettledSummaries(threads []Thread) []FileContext
FileScopedSettledSummaries returns compact provider-resolved and CR-settled thread summaries grouped by file path.
type Options ¶
type Options struct {
PostingIdentity gitprovider.Identity
}
Options controls thread normalization.
type Status ¶
type Status struct {
CRAuthoredFinding bool
HasCRSummary bool
LatestCRComment *Comment
LatestHumanReplyAfterCR *Comment
PendingHumanReply bool
}
Status summarizes lifecycle-relevant thread state.
type Thread ¶
type Thread struct {
ID gitprovider.ThreadID
Resolved bool
Anchor Anchor
Comments []Comment
Status Status
ResolvedSummary *ThreadSummary
CRSettledSummary *ThreadSummary
}
Thread is one normalized inline review thread.
func Normalize ¶
func Normalize(threads []gitprovider.InlineThread, opts Options) ([]Thread, error)
Normalize converts provider inline threads into deterministic prompt-safe domain threads.
func PendingCRAuthoredFindingThreads ¶
PendingCRAuthoredFindingThreads filters to unresolved CR-authored finding threads that have a human reply after the latest CR-authored comment.
func (Thread) EffectiveSettledSummary ¶ added in v0.9.191
func (thread Thread) EffectiveSettledSummary() (*ThreadSummary, bool)
EffectiveSettledSummary returns the compact settled context that reviewer prompts should use, preserving provider resolution as the preferred source.
type ThreadSummary ¶
type ThreadSummary struct {
ThreadID gitprovider.ThreadID
Anchor Anchor
URL string
Body string
LastCommentID gitprovider.CommentID
LastCommentAuthor gitprovider.Identity
LastCommentAuthoredByPostingIdentity bool
LastCommentHasThreadSummaryMarker bool
}
ThreadSummary is compact reviewer context for a provider-resolved or CR-settled inline thread.