Skip to content

feat(horismos): configuration loading and validation (P2-02)#43

Merged
forkwright merged 1 commit intomainfrom
p2-02/horismos
Mar 12, 2026
Merged

feat(horismos): configuration loading and validation (P2-02)#43
forkwright merged 1 commit intomainfrom
p2-02/horismos

Conversation

@forkwright
Copy link
Owner

Summary

  • Creates crates/horismos/ with full config loading and validation implementation
  • Figment cascade: compiled defaults → harmonia.tomlsecrets.tomlHARMONIA__* env vars (double-underscore separator)
  • 11 per-subsystem config structs (ExousiaConfig, ParocheConfig, TaxisConfig, EpignosisConfig, KritikeConfig, AggeliaConfig, ZetesisConfig, ErgasiaConfig, SyntaxisConfig, ProsthekeConfig, DatabaseConfig) with sensible defaults
  • TaxisConfig includes HashMap<String, LibraryConfig> with WatcherMode and MediaType enums
  • Startup validation: JWT secret (non-empty, not "changeme", ≥32 bytes), port range (≥1024), timeout values (>0), library path warnings (non-fatal)
  • Secrets path derived as sibling to config file (secrets.toml)

Test results

17 tests, all passing:

  • Default config values correct
  • TOML overrides defaults
  • Env vars override TOML
  • secrets.toml is loaded
  • Missing config file falls back to defaults
  • JWT secret validation (empty, "changeme", too short, valid)
  • Library path warnings (inaccessible → warn, accessible → no warn)
  • Port validation rejects privileged ports
  • Serialize/Deserialize roundtrip for Config, ExousiaConfig, TaxisConfig, DatabaseConfig, AggeliaConfig

Validation

cargo fmt --all -- --check  ✓
cargo clippy -p horismos -- -D warnings  ✓
cargo test -p horismos  ✓ (17/17)

Implements the horismos crate: figment-based layered config loading
(defaults → harmonia.toml → secrets.toml → env vars), per-subsystem
config structs with sensible defaults, startup validation (JWT secret
strength, port ranges, timeouts, library path warnings), and 17 tests.
@forkwright forkwright merged commit ecf6ad5 into main Mar 12, 2026
2 checks passed
@forkwright forkwright deleted the p2-02/horismos branch March 12, 2026 03:00
This was referenced Mar 18, 2026
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