Skip to content

Extract StorageProtocol and JSON storage implementation #2

Closed

Description

@OkiriGabriel

Part of #1 (open-core architecture).

Goal

Replace duplicated _load_* / _save_* helpers across tools with a shared storage abstraction so the hosted product can plug in Postgres later without forking agent code.

Scope

  • Add storage/base.py with a StorageProtocol (or ABC) covering:
    • complaints (load/save/list)
    • leads
    • posts
    • emails
  • Add storage/json_storage.py — current JSON file behavior from config.py paths
  • Refactor these modules to use the abstraction:
    • tools/complaint_tools.py
    • tools/funnel_tools.py
    • tools/social_tools.py
    • tools/email_tools.py
    • tools/publisher_tools.py

Acceptance criteria

  • No behavior change for local JSON usage
  • All existing tests pass (pytest)
  • Default storage remains JSON (zero config for OSS users)
  • Tools do not import Postgres or cloud-specific code

Notes

Keep the interface minimal — only what tools actually need today.

Activity

  1. added
    enhancement
    on Jul 21, 2026
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

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions