memory

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package memory owns what Responder is allowed to remember, for how long, and who may see it.

The visibility rule is the reason this is a package rather than a file. A memory learned in a private conversation must never surface in a public one, and that check is easy to get subtly wrong in a way no ordinary test notices — it fails open, and failing open here means telling a channel something it was not meant to hear. Isolating it makes it testable on its own.

Index

Constants

View Source
const (
	DefaultTTL = 30 * 24 * time.Hour
	MaxTTL     = 365 * 24 * time.Hour
)

TTL bounds. A memory with no expiry is a memory nobody revisits, and one that never expires eventually describes a system that no longer exists.

Variables

View Source
var DedupeFillerWords = map[string]struct{}{
	"a": {}, "an": {}, "the": {}, "is": {}, "are": {}, "was": {}, "were": {},
	"be": {}, "been": {}, "being": {}, "to": {}, "of": {}, "in": {}, "on": {},
	"at": {}, "by": {}, "for": {}, "and": {}, "or": {}, "that": {}, "this": {},
	"it": {}, "its": {}, "has": {}, "have": {}, "had": {},
}

DedupeFillerWords are words whose presence or absence does not change which fact a line states.

Functions

func BoundedUnique

func BoundedUnique(values []string, limit int, maxBytes int) []string

func ContainsSecretLikeValue

func ContainsSecretLikeValue(value string) bool

func DedupeKey

func DedupeKey(value string) string

DedupeKey collapses the differences that make two statements of the same fact look distinct: case, spacing, trailing punctuation, and the filler words that carry no meaning on their own.

Without it a rollup spends its bounded slots on restatements — "payments-api is degraded" and "payments-api degraded" both survive — and the longer a channel runs, the more of its memory is the same fact said several ways.

func FormatMemoryTTL

func FormatMemoryTTL(ttl time.Duration) string

func MaxTime

func MaxTime(a, b time.Time) time.Time

func MemoryEntryIDs

func MemoryEntryIDs(entries []core.MemoryEntry) []string

func MemoryEntryVisibleForAction

func MemoryEntryVisibleForAction(
	entry core.MemoryEntry,
	input core.SlackInput,
	workspaceID string,
) bool

func MemoryRollupIDs

func MemoryRollupIDs(entries []core.MemoryRollup) []string

func MemoryScopeLabel

func MemoryScopeLabel(offer core.MemoryOffer) string

func MemoryTTLValue

func MemoryTTLValue(ttl time.Duration) string

func MergeAgentMemories

func MergeAgentMemories(states []core.AgentMemory) core.AgentMemory

func NormalizeGuidanceSubject

func NormalizeGuidanceSubject(value string) string

func ParseMemoryTTL

func ParseMemoryTTL(value string) (time.Duration, error)

func SanitizeMemory

func SanitizeMemory(memory core.AgentMemory) core.AgentMemory

func StartOfUTCWeek

func StartOfUTCWeek(value time.Time) time.Time

Types

type MemoryRollupGroup

type MemoryRollupGroup struct {
	ScopeKind  string
	ScopeKey   string
	Repository string
	Period     time.Time
	Sources    []core.ConversationMemory
}

func GroupMemoryRollups

func GroupMemoryRollups(candidates []memorystore.ConversationMemoryCandidate) []MemoryRollupGroup

Jump to

Keyboard shortcuts

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