Documentation
¶
Index ¶
- Constants
- Variables
- func ClampWeeks(w int) int
- func ConnectPool(ctx context.Context, databaseURL string) (*pgxpool.Pool, error)
- type AgentDetail
- type AgentSession
- type AgentStats
- type ApprovalGate
- type AuditEntry
- type AuditLogEntry
- type BotComment
- type DailyBucket
- type DashboardStats
- type DocReference
- type Document
- type FeedbackSignal
- type FeedbackStats
- type FindingSummary
- type GateOutcome
- type HealthAlert
- type HealthMetrics
- type Issue
- type PhaseQuerier
- type RecentAgent
- type RecentComment
- type RecentFeedback
- type RecentTriage
- type RepoEvent
- type RoundTripBucket
- type SafetyStats
- type SimilarDocument
- type SimilarIssue
- type StaleSession
- type Store
- func (s *Store) CheckAndRecordDelivery(ctx context.Context, deliveryID string) (bool, error)
- func (s *Store) CleanupOldDeliveries(ctx context.Context, olderThan time.Duration) (int64, error)
- func (s *Store) CleanupOldEvents(ctx context.Context, olderThan time.Duration) (int64, error)
- func (s *Store) CountEvents(ctx context.Context, repo string) (int64, error)
- func (s *Store) CountRecentReferencesInvolving(ctx context.Context, repo, docTitle string, since time.Time) (int, error)
- func (s *Store) CountReferencesTo(ctx context.Context, repo, targetType, targetID string) (int, error)
- func (s *Store) CreateApprovalGate(ctx context.Context, gate ApprovalGate) (int64, error)
- func (s *Store) CreateAuditEntry(ctx context.Context, entry AuditEntry) error
- func (s *Store) CreateSession(ctx context.Context, sess AgentSession) (int64, error)
- func (s *Store) CreateTriageSession(ctx context.Context, ts TriageSession) error
- func (s *Store) FindReferencesTo(ctx context.Context, repo, targetType, targetID string) ([]DocReference, error)
- func (s *Store) FindSimilarDocuments(ctx context.Context, repo string, docTypes []string, embedding []float32, ...) ([]SimilarDocument, error)
- func (s *Store) FindSimilarIssues(ctx context.Context, repo string, embedding []float32, excludeNumber int, ...) ([]SimilarIssue, error)
- func (s *Store) GetAgentSessionDetail(ctx context.Context, repo string, issueNumber int) (*AgentDetail, error)
- func (s *Store) GetDailyAgentCounts(ctx context.Context, repo string) ([]DailyBucket, error)
- func (s *Store) GetDailyFeedbackCounts(ctx context.Context, repo string) ([]DailyBucket, error)
- func (s *Store) GetDailyTriageCounts(ctx context.Context, repo string) ([]DailyBucket, error)
- func (s *Store) GetDashboardStats(ctx context.Context, repo string) (*DashboardStats, error)
- func (s *Store) GetFeedbackStats(ctx context.Context, repo string) (*FeedbackStats, error)
- func (s *Store) GetHealthMetrics(ctx context.Context, repo string) (*HealthMetrics, error)
- func (s *Store) GetPendingGate(ctx context.Context, sessionID int64) (*ApprovalGate, error)
- func (s *Store) GetRecentFindings(ctx context.Context, repo string, since time.Time) (*SynthesisFindings, error)
- func (s *Store) GetSession(ctx context.Context, repo string, issueNumber int) (*AgentSession, error)
- func (s *Store) GetSessionByShadow(ctx context.Context, shadowRepo string, shadowIssueNumber int) (*AgentSession, error)
- func (s *Store) GetTriageSessionByShadow(ctx context.Context, shadowRepo string, shadowIssueNumber int) (*TriageSession, error)
- func (s *Store) GetTriageSessionDetail(ctx context.Context, repo string, issueNumber int) (*TriageDetail, error)
- func (s *Store) GetWeeklyTrends(ctx context.Context, repo string, weeks int) (*WeeklyTrends, error)
- func (s *Store) HasBotCommented(ctx context.Context, repo string, issueNumber int) (bool, error)
- func (s *Store) HasTriageSession(ctx context.Context, repo string, issueNumber int) (bool, error)
- func (s *Store) IsPaused(ctx context.Context, repo string) (bool, error)
- func (s *Store) ListBotComments(ctx context.Context, repo string) ([]BotComment, error)
- func (s *Store) ListDocumentsByType(ctx context.Context, repo string, docTypes []string) ([]Document, error)
- func (s *Store) ListEvents(ctx context.Context, repo string, since time.Time, eventTypes []string, ...) ([]RepoEvent, error)
- func (s *Store) ListStaleSessions(ctx context.Context, staleDuration time.Duration) ([]StaleSession, error)
- func (s *Store) MarkSessionComplete(ctx context.Context, id int64) error
- func (s *Store) MarkTriageSessionClosed(ctx context.Context, id int64) error
- func (s *Store) Ping(ctx context.Context) error
- func (s *Store) Pool() *pgxpool.Pool
- func (s *Store) RecentDocumentsByType(ctx context.Context, repo string, docTypes []string, since time.Time) ([]Document, error)
- func (s *Store) RecentIssuesWithEmbeddings(ctx context.Context, repo string, since time.Time) ([]Issue, error)
- func (s *Store) RecordBotComment(ctx context.Context, comment BotComment) error
- func (s *Store) RecordEvent(ctx context.Context, event RepoEvent) error
- func (s *Store) RecordEvents(ctx context.Context, events []RepoEvent) error
- func (s *Store) RecordFeedbackSignal(ctx context.Context, sig FeedbackSignal) error
- func (s *Store) RecordReferences(ctx context.Context, repo, sourceType, sourceID string, refs []DocReference) error
- func (s *Store) ResolveApprovalGate(ctx context.Context, id int64, status string, approver string) error
- func (s *Store) SetPaused(ctx context.Context, repo string, paused bool, by string) error
- func (s *Store) UpdateReactions(ctx context.Context, repo string, issueNumber, thumbsUp, thumbsDown int) error
- func (s *Store) UpdateSessionStage(ctx context.Context, id int64, stage string, sessionCtx map[string]any, ...) error
- func (s *Store) UpsertDocument(ctx context.Context, doc Document) error
- func (s *Store) UpsertIssue(ctx context.Context, issue Issue) error
- type SynthesisFindings
- type TriageDetail
- type TriageSession
- type TriageStats
- type WeeklyAgents
- type WeeklyFeedback
- type WeeklyPhases
- type WeeklyResponse
- type WeeklySynthesis
- type WeeklyTrends
- type WeeklyTriage
Constants ¶
const ( StageNew = "new" StageClarifying = "clarifying" StageResearching = "researching" StageReviewPending = "review_pending" StageRevision = "revision" StageApproved = "approved" StageComplete = "complete" StageContextBrief = "context_brief" )
Agent session stage constants.
const ( GateClarification = "clarification_approval" GateResearch = "research_approval" GatePR = "pr_approval" GatePromotePublic = "promote_to_public" )
Approval gate type constants.
const ( ApprovalPending = "pending" ApprovalApproved = "approved" ApprovalRejected = "rejected" ApprovalRevisionRequested = "revision_requested" )
Approval status constants.
const ( ApprovalModeManual = "manual" // always require human approval (default) ApprovalModeConfidence = "confidence" // auto-approve if quality score >= threshold )
ApprovalMode controls how the agent handles the review gate.
const EmbeddingDim = 768
Variables ¶
var AllSeedableDocTypes = append( append([]string{"troubleshooting", "configuration"}, EnhancementDocTypes...), UpstreamDocTypes..., )
AllSeedableDocTypes is the union of all valid doc_type values for the seed command.
var EnhancementDocTypes = []string{"roadmap", "adr", "research"}
EnhancementDocTypes lists the document types that Phase 4a searches for enhancement context.
var UpstreamDocTypes = []string{"upstream_release", "upstream_issue"}
UpstreamDocTypes lists the document types for upstream dependency docs (e.g. Electron release notes, version-tagged issues).
Functions ¶
func ClampWeeks ¶
ClampWeeks normalises a week count to [1, 52], defaulting 0 or negative to 12.
Types ¶
type AgentDetail ¶
type AgentDetail struct {
ID int64 `json:"id"`
Repo string `json:"repo"`
IssueNumber int `json:"issue_number"`
ShadowRepo string `json:"shadow_repo"`
ShadowIssue int `json:"shadow_issue"`
Stage string `json:"stage"`
RoundTripCount int `json:"round_trip_count"`
AuditLog []AuditLogEntry `json:"audit_log"`
CreatedAt string `json:"created_at"`
}
AgentDetail holds full detail for a single agent session including its audit log.
type AgentSession ¶
type AgentSession struct {
ID int64
Repo string
IssueNumber int
ShadowRepo string
ShadowIssueNumber int
Stage string
Context map[string]any
RoundTripCount int
CreatedAt time.Time
UpdatedAt time.Time
}
AgentSession tracks an agentic issue-resolution session.
type AgentStats ¶
type AgentStats struct {
Total int `json:"total"`
StageBreakdown map[string]int `json:"stage_breakdown"`
ActionBreakdown map[string]int `json:"action_breakdown"`
Recent []RecentAgent `json:"recent"`
}
AgentStats tracks enhancement agent session outcomes.
type ApprovalGate ¶
type ApprovalGate struct {
ID int64
SessionID int64
GateType string
Status string
Approver string
CreatedAt time.Time
ResolvedAt *time.Time
}
ApprovalGate represents a human-in-the-loop checkpoint in the agent workflow.
type AuditEntry ¶
type AuditEntry struct {
ID int64
SessionID int64
ActionType string
InputHash string
OutputSummary string
SafetyCheckPassed bool
ConfidenceScore float32
QualityScore *int // holdout judge score (0-100), nil if not evaluated
CreatedAt time.Time
}
AuditEntry records a single action taken by the agent for auditability.
type AuditLogEntry ¶
type AuditLogEntry struct {
ActionType string `json:"action_type"`
OutputSummary string `json:"output_summary"`
SafetyPassed bool `json:"safety_passed"`
ConfidenceScore float64 `json:"confidence_score"`
CreatedAt string `json:"created_at"`
}
AuditLogEntry records a single action taken by the agent, for dashboard drill-down. Named AuditLogEntry to avoid collision with the AuditEntry type in models.go.
type BotComment ¶
type BotComment struct {
ID int64
Repo string
IssueNumber int
CommentID int64
PhasesRun []string
ThumbsUp int
ThumbsDown int
CreatedAt time.Time
}
BotComment tracks a bot comment on a GitHub issue.
type DailyBucket ¶
DailyBucket holds a date string and an event count for time-series charts.
type DashboardStats ¶
type DashboardStats struct {
TotalComments int `json:"total_comments"`
TotalThumbsUp int `json:"total_thumbs_up"`
TotalThumbsDown int `json:"total_thumbs_down"`
PhaseBreakdown map[string]int `json:"phase_breakdown"`
DocumentCounts map[string]int `json:"document_counts"`
IssueCount int `json:"issue_count"`
RecentComments []RecentComment `json:"recent_comments"`
TriageStats *TriageStats `json:"triage_stats"`
AgentStats *AgentStats `json:"agent_stats"`
AvgResponseSeconds *float64 `json:"avg_response_seconds,omitempty"`
ApprovalGateStats []GateOutcome `json:"approval_gate_stats"`
SafetyStats *SafetyStats `json:"safety_stats"`
RoundTripDistribution []RoundTripBucket `json:"round_trip_distribution"`
PhaseHitRate map[string]float64 `json:"phase_hit_rate"`
FeedbackStats *FeedbackStats `json:"feedback_stats"`
DailyTriageCounts []DailyBucket `json:"daily_triage_counts"`
DailyAgentCounts []DailyBucket `json:"daily_agent_counts"`
DailyFeedbackCounts []DailyBucket `json:"daily_feedback_counts"`
}
DashboardStats holds aggregated statistics for the dashboard.
type DocReference ¶
type DocReference struct {
ID int64
Repo string
SourceType string
SourceID string
TargetType string
TargetID string
Relationship string
}
DocReference represents a cross-reference between documents, issues, or PRs.
func ExtractReferences ¶
func ExtractReferences(content string) []DocReference
ExtractReferences finds issue and ADR references in text content using regex.
type Document ¶
type Document struct {
ID int64
Repo string
DocType string
Title string
Content string
Metadata map[string]any
Embedding []float32
CreatedAt time.Time
UpdatedAt time.Time
}
Document represents a documentation chunk (troubleshooting, roadmap, ADR, research).
type FeedbackSignal ¶
type FeedbackSignal struct {
ID int64
Repo string
IssueNumber int
SignalType string
Details map[string]any
CreatedAt time.Time
}
FeedbackSignal records a user feedback event (edit fill or @mention).
type FeedbackStats ¶
type FeedbackStats struct {
TotalEditSignals int `json:"total_edit_signals"`
TotalMentions int `json:"total_mentions"`
FillRate *float64 `json:"fill_rate"`
RecentFeedback []RecentFeedback `json:"recent_feedback"`
}
FeedbackStats holds aggregated feedback signal statistics.
type FindingSummary ¶
type FindingSummary struct {
Title string `json:"title"`
Severity string `json:"severity"`
Evidence []string `json:"evidence"`
Suggestion string `json:"suggestion,omitempty"`
}
FindingSummary is a condensed representation of a synthesis finding.
type GateOutcome ¶
type GateOutcome struct {
GateType string `json:"gate_type"`
Status string `json:"status"`
Count int `json:"count"`
}
GateOutcome represents an approval gate type/status combination with its count.
type HealthAlert ¶
type HealthAlert struct {
Metric string `json:"metric"`
Current float64 `json:"current"`
Threshold float64 `json:"threshold"`
Message string `json:"message"`
}
HealthAlert represents a single threshold violation detected by the health monitor.
func EvaluateThresholds ¶
func EvaluateThresholds(m *HealthMetrics) []HealthAlert
EvaluateThresholds checks health metrics against degradation thresholds and returns any alerts. This is a pure function with no side effects.
type HealthMetrics ¶
type HealthMetrics struct {
ConfidenceRecent7d *float64 `json:"confidence_recent_7d"`
ConfidenceAllTime *float64 `json:"confidence_all_time"`
StuckSessionCount int `json:"stuck_session_count"`
TotalRecentSessions int `json:"total_recent_sessions"`
OrphanedTriageCount int `json:"orphaned_triage_count"`
TotalTriageSessions int `json:"total_triage_sessions"`
CheckedAt string `json:"checked_at"`
}
HealthMetrics holds operational health metrics queried from existing tables.
type Issue ¶
type Issue struct {
ID int64
Repo string
Number int
Title string
Summary string
State string
Labels []string
Milestone *string
Embedding []float32
CreatedAt time.Time
UpdatedAt time.Time
ClosedAt *time.Time
}
Issue represents a GitHub issue with its embedding.
type PhaseQuerier ¶
type PhaseQuerier interface {
FindSimilarDocuments(ctx context.Context, repo string, docTypes []string, embedding []float32, limit int) ([]SimilarDocument, error)
FindSimilarIssues(ctx context.Context, repo string, embedding []float32, excludeNumber int, limit int) ([]SimilarIssue, error)
}
PhaseQuerier defines the database operations that triage phases require.
type RecentAgent ¶
type RecentAgent struct {
Repo string `json:"repo"`
IssueNumber int `json:"issue_number"`
ShadowRepo string `json:"shadow_repo"`
ShadowIssue int `json:"shadow_issue"`
Stage string `json:"stage"`
CreatedAt string `json:"created_at"`
}
RecentAgent represents a recent agent session for the dashboard.
type RecentComment ¶
type RecentComment struct {
Repo string `json:"repo"`
IssueNumber int `json:"issue_number"`
CommentID int64 `json:"comment_id"`
PhasesRun []string `json:"phases_run"`
ThumbsUp int `json:"thumbs_up"`
ThumbsDown int `json:"thumbs_down"`
CreatedAt string `json:"created_at"`
}
RecentComment represents a recent bot comment for the dashboard.
type RecentFeedback ¶
type RecentFeedback struct {
Repo string `json:"repo"`
IssueNumber int `json:"issue_number"`
SignalType string `json:"signal_type"`
CreatedAt string `json:"created_at"`
}
RecentFeedback represents a recent feedback signal for the dashboard.
type RecentTriage ¶
type RecentTriage struct {
Repo string `json:"repo"`
IssueNumber int `json:"issue_number"`
ShadowRepo string `json:"shadow_repo"`
ShadowIssue int `json:"shadow_issue"`
Promoted bool `json:"promoted"`
CreatedAt string `json:"created_at"`
}
RecentTriage represents a recent triage session for the dashboard.
type RepoEvent ¶
type RepoEvent struct {
ID int64
Repo string
EventType string
SourceRef string
Summary string
Areas []string
Metadata map[string]any
CreatedAt time.Time
}
RepoEvent represents a recorded repository event in the journal.
type RoundTripBucket ¶
RoundTripBucket represents a count of sessions with a given round-trip count.
type SafetyStats ¶
type SafetyStats struct {
TotalActions int `json:"total_actions"`
Passed int `json:"passed"`
AvgConfidence *float64 `json:"avg_confidence"`
}
SafetyStats holds aggregated safety check statistics.
type SimilarDocument ¶
SimilarDocument is returned from similarity search with a distance score.
type SimilarIssue ¶
SimilarIssue is returned from similarity search with a distance score.
type StaleSession ¶
type StaleSession struct {
ID int64
ShadowRepo string
ShadowIssueNumber int
SessionType string // "agent" or "triage"
}
StaleSession holds the minimum info needed to close a stale shadow issue.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store provides database operations for the triage bot.
func (*Store) CheckAndRecordDelivery ¶
CheckAndRecordDelivery atomically checks if a webhook delivery ID has been seen before and records it if not. Returns true if the delivery was already recorded (duplicate).
func (*Store) CleanupOldDeliveries ¶
CleanupOldDeliveries deletes webhook delivery records older than the given duration. Returns the number of rows deleted.
func (*Store) CleanupOldEvents ¶
CleanupOldEvents deletes events older than the given duration (retention policy).
func (*Store) CountEvents ¶
CountEvents returns the total number of events for a repo.
func (*Store) CountRecentReferencesInvolving ¶
func (s *Store) CountRecentReferencesInvolving(ctx context.Context, repo, docTitle string, since time.Time) (int, error)
CountRecentReferencesInvolving returns the count of references created since the given time where the document appears as either a source (by title) or a target (by target_id). This lets callers determine whether a document is actively being discussed in recent issues or PRs.
func (*Store) CountReferencesTo ¶
func (s *Store) CountReferencesTo(ctx context.Context, repo, targetType, targetID string) (int, error)
CountReferencesTo returns the count of references to a given target.
func (*Store) CreateApprovalGate ¶
CreateApprovalGate inserts a new approval gate and returns its ID.
func (*Store) CreateAuditEntry ¶
func (s *Store) CreateAuditEntry(ctx context.Context, entry AuditEntry) error
CreateAuditEntry inserts a new audit log entry.
func (*Store) CreateSession ¶
CreateSession inserts a new agent session and returns its ID.
func (*Store) CreateTriageSession ¶
func (s *Store) CreateTriageSession(ctx context.Context, ts TriageSession) error
CreateTriageSession inserts a new triage session record.
func (*Store) FindReferencesTo ¶
func (s *Store) FindReferencesTo(ctx context.Context, repo, targetType, targetID string) ([]DocReference, error)
FindReferencesTo returns all documents/issues that reference the given target.
func (*Store) FindSimilarDocuments ¶
func (s *Store) FindSimilarDocuments(ctx context.Context, repo string, docTypes []string, embedding []float32, limit int) ([]SimilarDocument, error)
FindSimilarDocuments returns the top-k documents closest to the given embedding, filtered by repo and doc types.
func (*Store) FindSimilarIssues ¶
func (s *Store) FindSimilarIssues(ctx context.Context, repo string, embedding []float32, excludeNumber int, limit int) ([]SimilarIssue, error)
FindSimilarIssues returns the top-k issues closest to the given embedding, excluding the specified issue number.
func (*Store) GetAgentSessionDetail ¶
func (s *Store) GetAgentSessionDetail(ctx context.Context, repo string, issueNumber int) (*AgentDetail, error)
GetAgentSessionDetail returns full detail for the agent session matching repo+issueNumber, including all audit log entries. It returns nil if no session is found.
func (*Store) GetDailyAgentCounts ¶
GetDailyAgentCounts returns a 30-day time series of agent session counts.
func (*Store) GetDailyFeedbackCounts ¶
GetDailyFeedbackCounts returns a 30-day time series of feedback signal counts.
func (*Store) GetDailyTriageCounts ¶
GetDailyTriageCounts returns a 30-day time series of triage session counts.
func (*Store) GetDashboardStats ¶
GetDashboardStats retrieves aggregated triage statistics for a given repo.
func (*Store) GetFeedbackStats ¶
GetFeedbackStats returns aggregated feedback statistics for the dashboard.
func (*Store) GetHealthMetrics ¶
GetHealthMetrics queries operational health metrics from existing tables. Each query is independent; partial results are returned if individual queries fail.
func (*Store) GetPendingGate ¶
GetPendingGate retrieves the oldest pending approval gate for a session.
func (*Store) GetRecentFindings ¶
func (s *Store) GetRecentFindings(ctx context.Context, repo string, since time.Time) (*SynthesisFindings, error)
GetRecentFindings returns classified synthesis findings from the most recent briefing_posted events for the given repo (up to the last 4 briefings).
func (*Store) GetSession ¶
func (s *Store) GetSession(ctx context.Context, repo string, issueNumber int) (*AgentSession, error)
GetSession retrieves an agent session by repo and issue number.
func (*Store) GetSessionByShadow ¶
func (s *Store) GetSessionByShadow(ctx context.Context, shadowRepo string, shadowIssueNumber int) (*AgentSession, error)
GetSessionByShadow retrieves an agent session by shadow repo and shadow issue number.
func (*Store) GetTriageSessionByShadow ¶
func (s *Store) GetTriageSessionByShadow(ctx context.Context, shadowRepo string, shadowIssueNumber int) (*TriageSession, error)
GetTriageSessionByShadow returns the triage session for a given shadow issue, or nil if not found.
func (*Store) GetTriageSessionDetail ¶
func (s *Store) GetTriageSessionDetail(ctx context.Context, repo string, issueNumber int) (*TriageDetail, error)
GetTriageSessionDetail returns full detail for the triage session matching repo+issueNumber. It returns nil if no session is found.
func (*Store) GetWeeklyTrends ¶
GetWeeklyTrends returns multi-metric weekly time-series data for the given repo. Each query is independent; partial results are returned if individual queries fail.
func (*Store) HasBotCommented ¶
HasBotCommented checks if the bot has already commented on the given issue.
func (*Store) HasTriageSession ¶
HasTriageSession returns true if a triage session already exists for the given issue.
func (*Store) ListBotComments ¶
ListBotComments returns all bot comments for a given repo.
func (*Store) ListDocumentsByType ¶
func (s *Store) ListDocumentsByType(ctx context.Context, repo string, docTypes []string) ([]Document, error)
ListDocumentsByType returns all documents of the given types for a repo.
func (*Store) ListEvents ¶
func (s *Store) ListEvents(ctx context.Context, repo string, since time.Time, eventTypes []string, limit int) ([]RepoEvent, error)
ListEvents returns events for a repo within a time window, ordered by created_at DESC.
func (*Store) ListStaleSessions ¶
func (s *Store) ListStaleSessions(ctx context.Context, staleDuration time.Duration) ([]StaleSession, error)
ListStaleSessions returns agent and triage sessions with open shadow issues that haven't been acted on within the given duration.
func (*Store) MarkSessionComplete ¶
MarkSessionComplete sets an agent session's stage to "complete".
func (*Store) MarkTriageSessionClosed ¶
MarkTriageSessionClosed sets the closed_at timestamp on a triage session.
func (*Store) Pool ¶
Pool returns the underlying connection pool. Used by integration tests for cleanup.
func (*Store) RecentDocumentsByType ¶
func (s *Store) RecentDocumentsByType(ctx context.Context, repo string, docTypes []string, since time.Time) ([]Document, error)
RecentDocumentsByType returns documents of the given types ingested since the given time.
func (*Store) RecentIssuesWithEmbeddings ¶
func (s *Store) RecentIssuesWithEmbeddings(ctx context.Context, repo string, since time.Time) ([]Issue, error)
RecentIssuesWithEmbeddings returns issues opened within the time window that have embeddings.
func (*Store) RecordBotComment ¶
func (s *Store) RecordBotComment(ctx context.Context, comment BotComment) error
RecordBotComment records that the bot commented on an issue.
func (*Store) RecordEvent ¶
RecordEvent inserts a single event into the journal.
func (*Store) RecordEvents ¶
RecordEvents inserts a batch of events into the journal.
func (*Store) RecordFeedbackSignal ¶
func (s *Store) RecordFeedbackSignal(ctx context.Context, sig FeedbackSignal) error
RecordFeedbackSignal inserts a feedback signal row.
func (*Store) RecordReferences ¶
func (s *Store) RecordReferences(ctx context.Context, repo, sourceType, sourceID string, refs []DocReference) error
RecordReferences inserts cross-references for a source document or issue.
func (*Store) ResolveApprovalGate ¶
func (s *Store) ResolveApprovalGate(ctx context.Context, id int64, status string, approver string) error
ResolveApprovalGate updates the status, approver, and resolved_at timestamp of an approval gate.
func (*Store) UpdateReactions ¶
func (s *Store) UpdateReactions(ctx context.Context, repo string, issueNumber, thumbsUp, thumbsDown int) error
UpdateReactions updates the thumbs up/down counts for a bot comment.
func (*Store) UpdateSessionStage ¶
func (s *Store) UpdateSessionStage(ctx context.Context, id int64, stage string, sessionCtx map[string]any, roundTrips int) error
UpdateSessionStage updates the stage, context, and round-trip count for a session.
func (*Store) UpsertDocument ¶
UpsertDocument inserts or updates a document and its embedding.
func (*Store) UpsertIssue ¶
UpsertIssue inserts or updates an issue and its embedding. If issue.CreatedAt is set (non-zero), it is used as the issue creation timestamp; otherwise the database default (now()) applies. On conflict, created_at is never overwritten.
type SynthesisFindings ¶
type SynthesisFindings struct {
AsOf string `json:"as_of"`
Clusters []FindingSummary `json:"clusters"`
Drift []FindingSummary `json:"drift"`
Upstream []FindingSummary `json:"upstream"`
}
SynthesisFindings holds classified findings from recent synthesis briefings.
type TriageDetail ¶
type TriageDetail struct {
ID int64 `json:"id"`
Repo string `json:"repo"`
IssueNumber int `json:"issue_number"`
ShadowRepo string `json:"shadow_repo"`
ShadowIssue int `json:"shadow_issue"`
TriageComment string `json:"triage_comment"`
PhasesRun []string `json:"phases_run"`
Promoted bool `json:"promoted"`
CreatedAt string `json:"created_at"`
}
TriageDetail holds full detail for a single triage session.
type TriageSession ¶
type TriageSession struct {
ID int64
Repo string
IssueNumber int
ShadowRepo string
ShadowIssueNumber int
TriageComment string
PhasesRun []string
CreatedAt time.Time
}
TriageSession tracks a shadow issue created for triage review.
type TriageStats ¶
type TriageStats struct {
Total int `json:"total"`
Promoted int `json:"promoted"`
Pending int `json:"pending"`
Recent []RecentTriage `json:"recent"`
}
TriageStats tracks shadow repo triage outcomes.
type WeeklyAgents ¶
type WeeklyAgents struct {
Week string `json:"week"`
Total int `json:"total"`
Approved int `json:"approved"`
Rejected int `json:"rejected"`
Pending int `json:"pending"`
Complete int `json:"complete"`
}
WeeklyAgents tracks agent session outcomes per week.
type WeeklyFeedback ¶
type WeeklyFeedback struct {
Week string `json:"week"`
EditFills int `json:"edit_fills"`
Mentions int `json:"mentions"`
}
WeeklyFeedback tracks feedback signals per week.
type WeeklyPhases ¶
type WeeklyPhases struct {
Week string `json:"week"`
MissingInfo float64 `json:"missing_info"`
DocSearch float64 `json:"doc_search"`
EnhancementContext float64 `json:"enhancement_context"`
}
WeeklyPhases tracks phase hit rates per week.
type WeeklyResponse ¶
WeeklyResponse tracks average response time per week.
type WeeklySynthesis ¶
type WeeklySynthesis struct {
Week string `json:"week"`
Briefings int `json:"briefings"`
Findings int `json:"findings"`
}
WeeklySynthesis tracks synthesis output per week.
type WeeklyTrends ¶
type WeeklyTrends struct {
Repo string `json:"repo"`
Weeks int `json:"weeks"`
Triage []WeeklyTriage `json:"triage"`
Phases []WeeklyPhases `json:"phases"`
Response []WeeklyResponse `json:"response_time"`
Agents []WeeklyAgents `json:"agents"`
Synthesis []WeeklySynthesis `json:"synthesis"`
Feedback []WeeklyFeedback `json:"feedback"`
}
WeeklyTrends holds multi-metric weekly time-series data for trend reports.