Skip to content

🐛 [BUG] memory_type not validated against known variants #229

Closed

Description

@ajianaz

Description

remember_typed() accepts memory_type as an arbitrary &str and stores it directly without validation against the known MemoryType variants (fact, procedure, preference, decision, context).

This means invalid memory types like "foobar" can be persisted to the database, potentially causing issues downstream when the type is parsed or displayed.

Affected Code

  • crates/uteke-core/src/operations.rs line 26 — remember_typed()

Fix

Validate memory_type against MemoryType::from_str_opt() and return an error for unknown types.

Found by Cora v0.4.4 scan.

Activity

  1. added
    bug
    scope:core
    priority:low
    cora-scan
    on Jun 7, 2026
  2. ajianaz commented on Jun 7, 2026

    @ajianaz
    CollaboratorAuthor

    Fixed in v0.0.11 (PR #234)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcora-scanpriority:lowscope:core

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions