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 ¶
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 ¶
Types ¶
type Config ¶
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.
type DoctorReader ¶
type DoctorReader interface {
MemoryFindings(today.MemoryFindingsQuery) ([]today.MemoryFinding, error)
}
DoctorReader is the part of *today.Service the memory doctor 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.
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.
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.
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 ¶
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.
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.