Documentation
¶
Index ¶
- func FormatReviewCandidateBlock(items []scored) string
- func FormatStatus(st *State, cfg Config) string
- func IngestSessions(ctx context.Context, fs filesystem.Service, sessionsDir string, store *Store, ...) (int, int, error)
- func SignalKey(text string) string
- func TopScoredCandidates(signals []Signal, cfg Config, now time.Time, topK int) []scored
- type Config
- type Diary
- type Signal
- type State
- type Store
- type SweepResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatReviewCandidateBlock ¶ added in v0.3.14
func FormatReviewCandidateBlock(items []scored) string
FormatReviewCandidateBlock formats grounded candidates for background-review digest.
func FormatStatus ¶
FormatStatus renders dreaming state for /learn dream status.
func IngestSessions ¶
func IngestSessions(ctx context.Context, fs filesystem.Service, sessionsDir string, store *Store, limit int, now time.Time) (int, int, error)
IngestSessions scans recent session JSONL files for grounded signals. sessionsDir is a filesystem.Service-relative directory.
Types ¶
type Config ¶
type Config struct {
Enabled *bool `json:"enabled"`
Frequency string `json:"frequency"` // cron, default "0 3 * * *"
// FeedReview when true, top grounded signals are appended to background-review digest.
FeedReview *bool `json:"feedReview"`
FeedReviewTopK int `json:"feedReviewTopK"`
MinScore float64 `json:"minScore"`
MinRecallCount int `json:"minRecallCount"`
MinUniqueSessions int `json:"minUniqueSessions"`
RecencyHalfLifeDays int `json:"recencyHalfLifeDays"`
MaxPromotedChars int `json:"maxPromotedChars"`
SessionScanLimit int `json:"sessionScanLimit"`
}
Config controls grounded dreaming sweeps.
func (Config) FeedReviewEnabled ¶ added in v0.3.14
FeedReviewEnabled reports whether scored signals are shown to background review.
func (Config) Normalized ¶
type Diary ¶
type Diary struct {
FS filesystem.Service
Path string
}
Diary appends human-readable phase blocks to DREAMS.md. Path is a filesystem.Service-relative path.
type Signal ¶
type Signal struct {
ID string `json:"id"`
Text string `json:"text"`
Source string `json:"source"`
SessionID string `json:"sessionId,omitempty"`
RecallCount int `json:"recallCount"`
SessionSources []string `json:"sessionSources,omitempty"`
FirstSeen time.Time `json:"firstSeen"`
LastSeen time.Time `json:"lastSeen"`
LightHits int `json:"lightHits,omitempty"`
REMHits int `json:"remHits,omitempty"`
GroundedBackfill bool `json:"groundedBackfill,omitempty"`
}
Signal is one grounded short-term memory candidate.
type State ¶
type State struct {
Enabled bool `json:"enabled"`
LastSweep time.Time `json:"lastSweep,omitempty"`
Signals []Signal `json:"signals"`
ProcessedEvents map[string]time.Time `json:"processedEvents,omitempty"`
}
State persists dreaming machine state on disk.
func (*State) PruneByText ¶ added in v0.3.14
PruneByText removes all signals matching normalized text.
type Store ¶
type Store struct {
FS filesystem.Service
Path string
}
Store reads and writes dreaming state.json. Path is a filesystem.Service-relative path.
type SweepResult ¶
type SweepResult struct {
SessionsIngested int
SignalsIngested int
Staged int
Themes []string
// Eligible is signals above Deep threshold (background review consolidates).
Eligible int
Skipped int
}
SweepResult summarizes one dreaming run.
func Run ¶
func Run(ctx context.Context, cfg Config, stateStore *Store, diary *Diary, deepReportDir string, sessionsDir string, now time.Time) (*SweepResult, error)
Run executes Light → REM → Deep and appends Dream Diary blocks. deepReportDir and sessionsDir are filesystem.Service-relative (via stateStore.FS).