zara-memory: validate schema descriptor types at registration boundary #124

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

Problem

MemorySchema.__post_init__() assumes its descriptor fields already have the annotated runtime types. Malformed names/scopes/predicate collections can leak raw Python TypeError or create mutable/non-canonical schema descriptors instead of failing at the plugin's schema boundary.

Required behavior

  • schema name must be non-empty text within the existing 128-character bound;
  • allowed scopes and fact predicates must be frozenset[str] values with non-empty text entries;
  • unsupported scopes still fail deterministically;
  • malformed descriptors raise ValueError, never incidental Python type errors;
  • existing valid schemas remain unchanged;
  • full compatibility/registry/plugin/Nix package gates stay green.

Tracks safe plugin-defined memory schemas under #7.

## Problem `MemorySchema.__post_init__()` assumes its descriptor fields already have the annotated runtime types. Malformed names/scopes/predicate collections can leak raw Python `TypeError` or create mutable/non-canonical schema descriptors instead of failing at the plugin's schema boundary. ## Required behavior - schema name must be non-empty text within the existing 128-character bound; - allowed scopes and fact predicates must be `frozenset[str]` values with non-empty text entries; - unsupported scopes still fail deterministically; - malformed descriptors raise `ValueError`, never incidental Python type errors; - existing valid schemas remain unchanged; - full compatibility/registry/plugin/Nix package gates stay green. Tracks safe plugin-defined memory schemas 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#124
No description provided.