Skip to content

Refactor config access around an Ecto schema#41

Merged
frantic-openai merged 2 commits intomainfrom
codex/refactor-config-typed-settings
Mar 10, 2026
Merged

Refactor config access around an Ecto schema#41
frantic-openai merged 2 commits intomainfrom
codex/refactor-config-typed-settings

Conversation

@frantic-openai
Copy link
Collaborator

Context

The config layer had grown around NimbleOptions and a large getter surface. This branch moves parsing to an Ecto schema and simplifies callers to read typed nested settings directly.

TL;DR

Replace the bespoke config access layer with an Ecto-backed schema and typed settings access.

Summary

  • Replace the old config extraction path with an Ecto embedded schema and defaults
  • Collapse Config down to settings/0, settings!/0, and a small runtime helper surface
  • Update callers and tests to read nested config structs directly instead of one-off getter wrappers
  • Keep the repo green under format, lint, coverage, and dialyzer by adding the missing schema specs and tests

Alternatives

  • Keep NimbleOptions and shrink the wrapper layer incrementally, but that would preserve the custom parser shape
  • Keep the strict refactor without extra schema tests, but that left make -C elixir all red on coverage and dialyzer

Test Plan

  • make -C elixir all
  • cd elixir && mix test test/symphony_elixir/workspace_and_config_test.exs --warnings-as-errors

frantic-openai and others added 2 commits March 9, 2026 15:58
Summary:
- replace the WORKFLOW.md config parser with nested Ecto embedded
  schemas and field-level defaults
- centralize env, path, and sandbox post-processing in a single
  schema pipeline
- update config validation tests and orchestrator logging for the new
  strict invalid_workflow_config path

Rationale:
- NimbleOptions was carrying a large amount of custom extraction and
  fallback code that duplicated schema behavior
- Ecto gives nested typed validation directly and makes the remaining
  config behavior easier to reason about
- consolidating the config flow removes silent compatibility logic and
  makes failures explicit

Tests:
- cd elixir && mix test --warnings-as-errors
- cd elixir && mix credo --strict

Co-authored-by: Codex <codex@openai.com>
Summary:
- collapse Config down to settings/settings! plus the remaining runtime
  helpers
- switch callers and tests to use nested schema structs instead of the
  field-by-field getter layer
- tighten the schema around codex.command and add the specs and tests
  needed for the full make all pipeline

Rationale:
- make the Ecto schema the source of truth for config shape and defaults
- remove the extra access hop so config reads are direct and typed
- keep the repo green under formatting, lint, coverage, and dialyzer

Tests:
- cd elixir && make all

Co-authored-by: Codex <codex@openai.com>
@frantic-openai frantic-openai merged commit e65f5ee into main Mar 10, 2026
2 checks passed
@frantic-openai frantic-openai deleted the codex/refactor-config-typed-settings branch March 10, 2026 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant