zara-memory: bound symbolic fact collections before normalization #125

Closed
opened 2026-09-08 02:03:01 +00:00 by nsaspy · 0 comments
Owner

Problem

MemoryService.remember() accepts an arbitrary Iterable[str] for symbolic facts and immediately materializes it. A non-iterable can leak raw TypeError; strings iterate character-by-character; an unbounded generator can consume unbounded work/memory before backend dispatch. That violates the plugin's bounded structured-input posture.

Required behavior

  • facts must be a concrete non-string sequence;
  • bound the collection to 64 entries before normalization/backend dispatch;
  • malformed/non-sequence/oversized inputs fail deterministically with MemoryError;
  • backend is not called for invalid fact collections;
  • existing predicate/schema validation remains unchanged;
  • full compatibility/registry/plugin/Nix package gates stay green.

Tracks local symbolic-memory input hardening under #7.

## Problem `MemoryService.remember()` accepts an arbitrary `Iterable[str]` for symbolic facts and immediately materializes it. A non-iterable can leak raw `TypeError`; strings iterate character-by-character; an unbounded generator can consume unbounded work/memory before backend dispatch. That violates the plugin's bounded structured-input posture. ## Required behavior - facts must be a concrete non-string sequence; - bound the collection to 64 entries before normalization/backend dispatch; - malformed/non-sequence/oversized inputs fail deterministically with `MemoryError`; - backend is not called for invalid fact collections; - existing predicate/schema validation remains unchanged; - full compatibility/registry/plugin/Nix package gates stay green. Tracks local symbolic-memory input hardening under #7.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
nsaspy/zara-plugins#125
No description provided.