sources

package
v0.209.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2026 License: MIT Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package sources holds the read-only material adapters of daily memory synthesis. Every adapter implements memorysynthesis.Source over a narrow reader interface (satisfied by *jobstore.Store or the today service), so this package imports the data layer but no entry layer (G021/G022). Adapters only select allow-listed structured fields: never a prompt, argv, environment, attachment or transcript. Secret scrubbing and the byte budget are applied afterwards by memorysynthesis.Build.

Index

Constants

View Source
const (
	KindWorkItem    = "work_item"
	KindWorkJournal = "work_journal"
	KindJobReport   = "job_report"
	KindPlan        = "plan"
	KindPlanTodo    = "plan_todo"
	KindMemoryFind  = "memory_finding"
	KindPrevious    = "previous_synthesis"
)

Kinds written by the adapters.

Variables

This section is empty.

Functions

func FileReportTail

func FileReportTail(rec jobstore.JobRecord, maxBytes int64) string

FileReportTail reads the tail from the job's result directory, the same place job comments and the delivery check read it. A missing log is simply no report.

Types

type Config

type Config struct {
	Loc      *time.Location
	Lookback time.Duration
}

Config is shared by every adapter: the server time zone and lookback that define the business-day window, and the per-item text caps.

type Doctor

type Doctor struct {
	Config
	Reader DoctorReader
}

Doctor collects the memory doctor's findings (slug, key, kind, summary) of the project. It never forwards a memory body: today.MemoryFinding.Content is deliberately ignored.

func (Doctor) Collect

func (s Doctor) Collect(_ context.Context, project, day string) ([]memorysynthesis.Item, error)

type DoctorReader

type DoctorReader interface {
	MemoryFindings(today.MemoryFindingsQuery) ([]today.MemoryFinding, error)
}

DoctorReader is the part of *today.Service the memory doctor adapter reads.

type JobReader

type JobReader interface {
	ListJobs(jobstore.ListQuery) ([]jobstore.JobRecord, error)
}

JobReader is the part of *jobstore.Store the job adapter reads.

type Jobs

type Jobs struct {
	Config
	Store      JobReader
	ReportTail ReportTailFunc
	// MaxJobs, TailBytes and TailLines bound the number of jobs and each report excerpt.
	MaxJobs   int
	TailBytes int64
	TailLines int
}

Jobs collects jobs that reached a terminal state inside the window, with a bounded report tail. Internal jobs (steward, summarizer, synthesis itself) are excluded.

func (Jobs) Collect

func (s Jobs) Collect(_ context.Context, project, day string) ([]memorysynthesis.Item, error)

type PlanReader

type PlanReader interface {
	ListPlans(jobstore.PlanFilter) ([]jobstore.Plan, error)
	ListTodosByPlan(planID string) ([]jobstore.PlanTodo, error)
}

PlanReader is the part of *jobstore.Store the plan adapter reads.

type Plans

type Plans struct {
	Config
	Store    PlanReader
	MaxPlans int
}

Plans collects plans of the project that changed inside the window and the todos that finished inside it, with their outcome note (the conclusion) and acceptance summary. Only plans of the project are read, and a todo that names another project is skipped.

func (Plans) Collect

func (s Plans) Collect(_ context.Context, project, day string) ([]memorysynthesis.Item, error)

type Previous

type Previous struct {
	Config
	Store PreviousReader
	// MaxRunes caps the carried result (default 1500).
	MaxRunes int
}

Previous contributes the most recent succeeded synthesis BEFORE the day being built, so consecutive days can refer to each other without a run ever consuming its own output.

func (Previous) Collect

func (s Previous) Collect(_ context.Context, project, day string) ([]memorysynthesis.Item, error)

type PreviousReader

type PreviousReader interface {
	LatestSucceededMemorySynthesis(project, day string) (jobstore.MemorySynthesisRun, bool, error)
}

PreviousReader is the part of *jobstore.Store the previous-synthesis adapter reads.

type ReportTailFunc

type ReportTailFunc func(rec jobstore.JobRecord, maxBytes int64) string

ReportTailFunc returns the stdout tail (the job's report) of a finished job, at most maxBytes. A job without output yields "".

type Work

type Work struct {
	Config
	Store WorkReader
	// MaxItems / MaxJournal bound the item count and the journal lines read per item.
	MaxItems   int
	MaxJournal int
}

Work collects work items active inside the window and their milestone journal lines.

func (Work) Collect

func (s Work) Collect(_ context.Context, project, day string) ([]memorysynthesis.Item, error)

type WorkReader

type WorkReader interface {
	ListWorkItems(jobstore.WorkListOpts) ([]jobstore.WorkItem, error)
	ListWorkJournalLevel(id string, limit int, before int64, level string) ([]jobstore.WorkJournalEntry, error)
}

WorkReader is the part of *jobstore.Store the work adapter reads.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL