zara-memory: reject non-MemorySchema registrations at service boundary #123

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

Problem

MemoryService.register_schema() dereferences schema.name without first proving the caller supplied a MemorySchema. Arbitrary objects can therefore leak raw AttributeError/hashing errors at a public plugin registration boundary instead of failing under the memory service's structured contract.

Required behavior

  • register_schema() accepts MemorySchema instances only;
  • malformed schema objects fail deterministically with MemoryError before mutating the registry;
  • duplicate valid schema names retain the existing duplicate-registration failure;
  • no implicit coercion or parallel schema representation is introduced;
  • full compatibility/registry/plugin/Nix package gates stay green.

Advances safe plugin-defined schemas under #7.

## Problem `MemoryService.register_schema()` dereferences `schema.name` without first proving the caller supplied a `MemorySchema`. Arbitrary objects can therefore leak raw `AttributeError`/hashing errors at a public plugin registration boundary instead of failing under the memory service's structured contract. ## Required behavior - `register_schema()` accepts `MemorySchema` instances only; - malformed schema objects fail deterministically with `MemoryError` before mutating the registry; - duplicate valid schema names retain the existing duplicate-registration failure; - no implicit coercion or parallel schema representation is introduced; - full compatibility/registry/plugin/Nix package gates stay green. Advances safe plugin-defined 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#123
No description provided.