Skip to content

refactor: extract shared persistence helper for entity writes #241

@gaodan-fang

Description

@gaodan-fang

Context

PR #238 added store_user_facts which writes entities through EvolveClient.store_user_facts(), while the existing create_entity tool writes through EvolveClient.create_entity(). Both paths perform similar work (metadata parsing, conflict resolution gating, entity persistence) but don't share implementation.

Suggestion

Extract a shared internal helper for the common entity-write logic used by both store_user_facts and create_entity in altk_evolve/frontend/mcp/mcp_server.py. This would:

  • Reduce duplication in metadata validation and persistence calls
  • Make it easier to add new entity-writing tools with consistent behavior
  • Centralize error handling for the write path

Priority

Low — not a release blocker. Both paths work correctly today.

Ref

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions