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
- Variables
- func BoundedUnique(values []string, limit int, maxBytes int) []string
- func ContainsSecretLikeValue(value string) bool
- func DedupeKey(value string) string
- func FormatMemoryTTL(ttl time.Duration) string
- func MaxTime(a, b time.Time) time.Time
- func MemoryEntryIDs(entries []core.MemoryEntry) []string
- func MemoryEntryVisibleForAction(entry core.MemoryEntry, input core.SlackInput, workspaceID string) bool
- func MemoryRollupIDs(entries []core.MemoryRollup) []string
- func MemoryScopeLabel(offer core.MemoryOffer) string
- func MemoryTTLValue(ttl time.Duration) string
- func MergeAgentMemories(states []core.AgentMemory) core.AgentMemory
- func NormalizeGuidanceSubject(value string) string
- func ParseMemoryTTL(value string) (time.Duration, error)
- func SanitizeMemory(memory core.AgentMemory) core.AgentMemory
- func StartOfUTCWeek(value time.Time) time.Time
- type MemoryRollupGroup
Constants ¶
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 ¶
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 ContainsSecretLikeValue ¶
func DedupeKey ¶
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 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 MergeAgentMemories ¶
func MergeAgentMemories(states []core.AgentMemory) core.AgentMemory
func SanitizeMemory ¶
func SanitizeMemory(memory core.AgentMemory) core.AgentMemory
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