Skip to content

refactor: extract JSON pointer operations from config.rs #952

@chubes4

Description

@chubes4

Problem

src/core/config.rs is 1,532 lines and serves as the central persistence layer. It contains several distinct concerns mixed together:

  1. Config entity trait + macro — the entity_crud! macro and trait system
  2. JSON pointer operationsget_pointer, set_pointer, delete_pointer, path resolution (~200 lines)
  3. JSON parsing utilities — type detection, merging, diffing
  4. File I/O — read/write JSON config files
  5. Entity search — fuzzy matching, array field collection
  6. Tests — ~300 lines

Proposed Change

Extract the JSON pointer operations into src/core/json_pointer.rs:

  • get_pointer() / set_pointer() / delete_pointer()
  • Path segment parsing and resolution
  • Related helper functions

This is a self-contained, reusable piece of infrastructure that has no config-specific dependencies.

Benefits

  • config.rs drops to ~1,300 lines (still large but more focused)
  • JSON pointer ops become independently testable and reusable
  • Clearer separation: config = entity persistence, json_pointer = generic JSON path operations

Constraints

  • No behavioral changes
  • All existing callers continue to work (re-export from config if needed during transition)

Metadata

Metadata

Assignees

No one assigned

    Labels

    cleanupDead code removal and cleanup

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions