Documentation
¶
Overview ¶
Package reviewapp provides the transport-independent application boundary for reading a validated Change Saga and its source comparison.
Index ¶
- Constants
- type AssetSummary
- type Attribution
- type ChapterSummary
- type ChildrenPage
- type ChildrenQuery
- type ClaimEvidence
- type ClaimPage
- type ClaimQuery
- type ClaimRecord
- type Committer
- type CompactDiffs
- type CompactReview
- type CoverageSummary
- type DiffOwner
- type DiffOwnerQuery
- type DiffOwnership
- type Error
- type ErrorCode
- type FragmentChunk
- type FragmentContent
- type FragmentDiffQuery
- type FragmentDiffs
- type FragmentQuery
- type Gap
- type GapPage
- type GapQuery
- type LandmarkValue
- type MappingAssessment
- type MappingPage
- type MappingQuery
- type MappingReason
- type MappingSignal
- type Node
- type OpenOptions
- type OverlapGap
- type Overview
- type OverviewQuery
- type OwnedAtom
- type Page
- type ResolvedSelector
- type ReviewEvent
- type ReviewFragment
- type ReviewItem
- type ReviewMessage
- type ReviewPage
- type ReviewQuery
- type ReviewThread
- type SagaIdentity
- type SemanticLandmark
- type Session
- type SourceSnapshot
- type StaleSelector
- type UncoveredGap
- type VerificationPage
- type VerificationQuery
- type VerificationRecord
Constants ¶
const ( DefaultPageLimit = 100 MaxPageLimit = 1000 DefaultFragmentLimit = 256 << 10 MaxFragmentLimit = 1 << 20 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AssetSummary ¶
type Attribution ¶
type ChapterSummary ¶
type ChildrenPage ¶
type ChildrenQuery ¶
type ClaimEvidence ¶ added in v0.0.2
type ClaimPage ¶ added in v0.0.2
type ClaimPage struct {
Claims []ClaimRecord `json:"claims"`
Page Page `json:"-"`
}
type ClaimQuery ¶ added in v0.0.2
type ClaimRecord ¶ added in v0.0.2
type ClaimRecord struct {
ID string `json:"id"`
Target string `json:"target"`
Kind string `json:"kind"`
Statement string `json:"statement"`
CreatedAt time.Time `json:"created_at"`
Attribution Attribution `json:"attribution"`
Evidence []ClaimEvidence `json:"evidence"`
VerificationStatus string `json:"verification_status"`
LatestVerification *VerificationRecord `json:"latest_verification,omitempty"`
}
type CompactDiffs ¶
type CompactReview ¶
type CompactReview struct {
// LatestState is retained as a wire-compatible name for the aggregate of
// every reviewer's current decision.
LatestState string `json:"latest_state,omitempty"`
HumanApprovals int `json:"human_approvals"`
AIApprovals int `json:"ai_approvals"`
Rejections int `json:"rejections"`
Unspecified int `json:"unspecified_decisions"`
OpenThreads int `json:"open_threads"`
}
type CoverageSummary ¶
type DiffOwner ¶
type DiffOwner struct {
Target string `json:"target"`
Selector string `json:"selector"`
Note string `json:"note,omitempty"`
EvidenceFile string `json:"evidence_file,omitempty"`
Mapping *MappingSignal `json:"mapping,omitempty"`
}
type DiffOwnerQuery ¶
type DiffOwnership ¶
type Error ¶
type Error struct {
Code ErrorCode `json:"code"`
Message string `json:"message"`
Retryable bool `json:"retryable"`
Details map[string]any `json:"details,omitempty"`
// contains filtered or unexported fields
}
Error is a stable domain error. Cause is retained for logs but intentionally excluded from serialized output because it can contain local absolute paths.
type ErrorCode ¶
type ErrorCode string
const ( CodeInvalidArgument ErrorCode = "invalid_argument" CodeNotFound ErrorCode = "not_found" CodeInvalidSaga ErrorCode = "invalid_saga" CodeStaleSnapshot ErrorCode = "stale_snapshot" CodeConflict ErrorCode = "conflict" CodeUnsafePath ErrorCode = "unsafe_path" CodeUnsupportedMedia ErrorCode = "unsupported_media" CodeTooLarge ErrorCode = "too_large" CodeInternal ErrorCode = "internal" )
func ErrorCodeOf ¶
ErrorCodeOf returns the stable code for a domain error. Unexpected errors deliberately collapse to internal rather than exposing implementation text.
type FragmentChunk ¶
type FragmentContent ¶
type FragmentContent struct {
Target string `json:"target"`
ID string `json:"id"`
Title string `json:"title"`
MediaType string `json:"media_type"`
Content FragmentChunk `json:"content"`
Assets []AssetSummary `json:"assets"`
Landmarks []SemanticLandmark `json:"landmarks"`
Intent string `json:"intent,omitempty"`
Layout string `json:"layout,omitempty"`
Takeaway string `json:"takeaway,omitempty"`
ReadingOrder []string `json:"reading_order,omitempty"`
}
type FragmentDiffQuery ¶
type FragmentDiffs ¶
type FragmentDiffs struct {
Target string `json:"target"`
Selectors []ResolvedSelector `json:"selectors"`
Atoms []gitdiff.Atom `json:"atoms"`
Stale []StaleSelector `json:"stale"`
Page Page `json:"-"`
}
type FragmentQuery ¶
type Gap ¶
type Gap struct {
Kind string `json:"kind"`
Uncovered *UncoveredGap `json:"uncovered,omitempty"`
Stale *StaleSelector `json:"stale,omitempty"`
Overlap *OverlapGap `json:"overlap,omitempty"`
}
type LandmarkValue ¶
type LandmarkValue struct {
Type string `json:"type"`
ElementID string `json:"element_id,omitempty"`
HeadingID string `json:"heading_id,omitempty"`
Exact string `json:"exact,omitempty"`
Prefix string `json:"prefix,omitempty"`
Suffix string `json:"suffix,omitempty"`
X float64 `json:"x,omitempty"`
Y float64 `json:"y,omitempty"`
Width float64 `json:"width,omitempty"`
Height float64 `json:"height,omitempty"`
}
type MappingAssessment ¶ added in v0.0.2
type MappingAssessment struct {
Target string `json:"target"`
TargetKind string `json:"target_kind"`
EvidenceFile string `json:"evidence_file,omitempty"`
Notes []string `json:"notes"`
SelectorCount int `json:"selector_count"`
StaleSelectorCount int `json:"stale_selector_count"`
AtomCount int `json:"atom_count"`
AtomsPerNote float64 `json:"atoms_per_note"`
FileCount int `json:"file_count"`
TargetAtomCount int `json:"target_atom_count"`
TargetFileCount int `json:"target_file_count"`
ScrutinyScore int `json:"scrutiny_score"`
Reasons []MappingReason `json:"reasons"`
}
type MappingPage ¶ added in v0.0.2
type MappingPage struct {
Mappings []MappingAssessment `json:"mappings"`
Page Page `json:"-"`
}
type MappingQuery ¶ added in v0.0.2
type MappingReason ¶ added in v0.0.2
type MappingSignal ¶ added in v0.0.2
type MappingSignal struct {
ScrutinyScore int `json:"scrutiny_score"`
AtomCount int `json:"atom_count"`
AtomsPerNote float64 `json:"atoms_per_note"`
FileCount int `json:"file_count"`
TargetAtomCount int `json:"target_atom_count"`
TargetFileCount int `json:"target_file_count"`
StaleSelectorCount int `json:"stale_selector_count"`
Reasons []MappingReason `json:"reasons"`
}
MappingSignal deliberately describes breadth and justification risk, not correctness. A high score tells an AI where to scrutinize first; it never turns a narrow mapping into proof that the explanation is true.
type Node ¶
type Node struct {
Kind string `json:"kind"`
Target string `json:"target"`
Parent string `json:"parent,omitempty"`
ID string `json:"id"`
Title string `json:"title"`
Description string `json:"description,omitempty"`
Order int `json:"order,omitempty"`
HasChildren bool `json:"has_children"`
Review CompactReview `json:"review"`
Diffs CompactDiffs `json:"diffs"`
MediaType string `json:"media_type,omitempty"`
Bytes int64 `json:"bytes,omitempty"`
Selector *LandmarkValue `json:"selector,omitempty"`
ItemKind string `json:"item_kind,omitempty"`
About string `json:"about,omitempty"`
Body string `json:"body,omitempty"`
Placement string `json:"placement,omitempty"`
Leader string `json:"leader,omitempty"`
}
type OpenOptions ¶
type OverlapGap ¶
type Overview ¶
type Overview struct {
Saga SagaIdentity `json:"saga"`
Source SourceSnapshot `json:"source"`
Root Node `json:"root"`
OverviewFragments []Node `json:"overview_fragments"`
Chapters []ChapterSummary `json:"chapters"`
Decks []ChapterSummary `json:"decks,omitempty"`
Coverage CoverageSummary `json:"coverage"`
}
type OverviewQuery ¶
type OverviewQuery struct{}
type OwnedAtom ¶
type OwnedAtom struct {
Atom gitdiff.Atom `json:"atom"`
Owners []DiffOwner `json:"owners"`
Threads []ReviewThread `json:"threads"`
}
type ResolvedSelector ¶
type ReviewEvent ¶
type ReviewEvent struct {
ID string `json:"id"`
Kind string `json:"kind"`
Target string `json:"target,omitempty"`
Diff string `json:"diff,omitempty"`
State string `json:"state,omitempty"`
Body string `json:"body,omitempty"`
Anchor *saga.Anchor `json:"anchor,omitempty"`
CreatedAt time.Time `json:"created_at"`
Attribution Attribution `json:"attribution"`
LegacyClaimedAuthor string `json:"legacy_claimed_author,omitempty"`
Reviewer *saga.ReviewerIdentity `json:"reviewer,omitempty"`
}
type ReviewFragment ¶
type ReviewItem ¶
type ReviewItem struct {
Kind string `json:"kind"`
Thread *ReviewThread `json:"thread,omitempty"`
Event *ReviewEvent `json:"event,omitempty"`
}
type ReviewMessage ¶
type ReviewMessage struct {
ID string `json:"id"`
CreatedAt time.Time `json:"created_at"`
Attribution Attribution `json:"attribution"`
LegacyClaimedAuthor string `json:"legacy_claimed_author,omitempty"`
Fragments []ReviewFragment `json:"fragments"`
}
type ReviewPage ¶
type ReviewPage struct {
Items []ReviewItem `json:"items"`
Page Page `json:"-"`
}
type ReviewQuery ¶
type ReviewThread ¶
type ReviewThread struct {
ID string `json:"id"`
Kind string `json:"kind"`
Target string `json:"target"`
Anchor saga.Anchor `json:"anchor"`
Suggestion *saga.Suggestion `json:"suggestion,omitempty"`
State string `json:"state"`
CreatedAt time.Time `json:"created_at"`
Attribution Attribution `json:"attribution"`
LegacyClaimedAuthor string `json:"legacy_claimed_author,omitempty"`
Messages []ReviewMessage `json:"messages"`
Events []ReviewEvent `json:"events"`
}
type SagaIdentity ¶
type SemanticLandmark ¶ added in v0.0.2
type SemanticLandmark struct {
Target string `json:"target"`
ID string `json:"id"`
Label string `json:"label"`
Description string `json:"description,omitempty"`
Selector *LandmarkValue `json:"selector"`
Diffs CompactDiffs `json:"diffs"`
Kind string `json:"kind,omitempty"`
About string `json:"about,omitempty"`
Body string `json:"body,omitempty"`
Placement string `json:"placement,omitempty"`
Leader string `json:"leader,omitempty"`
}
type Session ¶
type Session interface {
Snapshot() string
Overview(context.Context, OverviewQuery) (Overview, error)
Children(context.Context, ChildrenQuery) (ChildrenPage, error)
ReadFragment(context.Context, FragmentQuery) (FragmentContent, error)
FragmentDiffs(context.Context, FragmentDiffQuery) (FragmentDiffs, error)
DiffOwners(context.Context, DiffOwnerQuery) (DiffOwnership, error)
Reviews(context.Context, ReviewQuery) (ReviewPage, error)
Gaps(context.Context, GapQuery) (GapPage, error)
Mappings(context.Context, MappingQuery) (MappingPage, error)
Claims(context.Context, ClaimQuery) (ClaimPage, error)
Verifications(context.Context, VerificationQuery) (VerificationPage, error)
}
type SourceSnapshot ¶
type StaleSelector ¶
type UncoveredGap ¶
type VerificationPage ¶ added in v0.0.2
type VerificationPage struct {
Verifications []VerificationRecord `json:"verifications"`
Page Page `json:"-"`
}
type VerificationQuery ¶ added in v0.0.2
type VerificationRecord ¶ added in v0.0.2
type VerificationRecord struct {
ID string `json:"id"`
Claim string `json:"claim"`
Status string `json:"status"`
Method string `json:"method,omitempty"`
Summary string `json:"summary"`
Command string `json:"command,omitempty"`
CreatedAt time.Time `json:"created_at"`
Attribution Attribution `json:"attribution"`
}