Skip to content

Consolidate duplicated JSON serializer options + default config-path logic (AllowedSecretsStore vs ConfigurationPersistenceService) #1261

Description

@JoshuaRowePhantom

AllowedSecretsStore (Phantom.Workspaces.Llm.Core\Secrets\AllowedSecretsStore.cs, added in #1244) duplicates two pieces of logic from ConfigurationPersistenceService (Phantom.Workspaces\Configuration\ConfigurationPersistenceService.cs):

  1. The JsonSerializerOptions (camel-case, WhenWritingNull, indented, camel-case string enums).
  2. The %APPDATA%\Phantom.Workspaces\ base directory used to locate the default file next to config.json.

The duplication exists because ConfigurationPersistenceService lives in the application project, which depends on Llm.Core; Llm.Core cannot reference it without introducing a project-reference cycle.

Proposed fix: extract the shared serializer options and the %APPDATA%\Phantom.Workspaces path helper into a lower-level project referenced by both (e.g. Phantom.Workspaces.Data.Core or a small shared configuration project), then have both consumers use it.

Non-blocking refactor; behaviour is currently identical between the two.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions