Documentation
¶
Overview ¶
Package summary builds rule-based session summaries from a session's events. No LLM is involved; every claim is backed by an event, and a test is reported as passing only when an event shows it succeeded.
Index ¶
- Constants
- Variables
- func Enqueue(ctx context.Context, x jobs.Execer, sessionID string, ended bool) error
- func Handler(db *sql.DB) jobs.Handler
- func Memories(sessionID, projectID string, s *Summary) []memory.Memory
- type Event
- type Fix
- type Issue
- type Summary
- func Build(events []Event, now time.Time) Summary
- func Compute(ctx context.Context, db *sql.DB, sessionID string) (*Summary, string, error)
- func Generate(ctx context.Context, db *sql.DB, sessionID string) (*Summary, error)
- func Load(ctx context.Context, db *sql.DB, sessionID string) (*Summary, bool, error)
- type TestResult
Constants ¶
const Disclaimer = "Auto-generated from recorded events; may be incomplete."
Disclaimer accompanies every rendered summary.
const Generator = "rules-v1"
Generator identifies the summarizer version stored with each summary.
const JobKind = "session.summarize"
JobKind is the job queue kind for summarization.
Variables ¶
var ( IdleDelay = 3 * time.Minute MaxDelay = 10 * time.Minute )
Debounce: summarize once a session has been quiet for IdleDelay, but at least every MaxDelay while it stays busy.
var ErrNoSession = errors.New("summary: no such session")
ErrNoSession means the session does not exist.
Functions ¶
Types ¶
type Fix ¶
type Fix struct {
Title string `json:"title"`
Error string `json:"error"`
Files []string `json:"files"`
FailedEventID string `json:"failed_event_id"`
FixedEventID string `json:"fixed_event_id"`
FileEventIDs []string `json:"file_event_ids"`
At time.Time `json:"at"`
}
Fix is a failure that was resolved by changing files: the operation failed, files were modified, and the same operation then succeeded. A retry that succeeds without changes is not a fix (flaky, or transient).
type Issue ¶
type Issue struct {
Title string `json:"title"`
Error string `json:"error"`
At time.Time `json:"at"`
EventID string `json:"event_id"`
}
Issue is a failure that was not followed by a successful retry.
type Summary ¶
type Summary struct {
Status string `json:"status"` // active | ended | interrupted
Objective string `json:"objective"`
LatestRequest string `json:"latest_request"`
CompletedWork string `json:"completed_work"`
ChangedFiles []string `json:"changed_files"`
TestResults []TestResult `json:"test_results"`
Unresolved []Issue `json:"unresolved_issues"`
NextSteps []string `json:"next_steps"`
Evidence []string `json:"evidence"`
Fixes []Fix `json:"fixes,omitempty"`
EventCount int `json:"event_count"`
FirstEventAt time.Time `json:"first_event_at"`
LastEventAt time.Time `json:"last_event_at"`
Generator string `json:"generator"`
GeneratedAt time.Time `json:"generated_at"`
Disclaimer string `json:"disclaimer"`
}
Summary of one session.