Add configuration loader for sermones-runtime #3
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Blocks
#9 Settings screen
lyssieth/sermones
#10 Provider configuration from the UI
lyssieth/sermones
Reference
lyssieth/sermones#3
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Implement the configuration loader declared in
crates/sermones-runtime/src/lib.rsanddocs/glossary.md:The runtime crate's
lib.rsdeclares "the configuration loader" among its responsibilities; the module does not exist.ErrorKind::ConfigInvalidalready lives incrates/sermones-core/src/error.rs.Checklist
docs/architecture/stack.md— pick and document)provider.base_url(overridesSERMONES_BASE_URL),provider.model(overridesSERMONES_MODEL), possiblyprovider.api_keyui.theme(system / light / dark), window state if earned — the settings screen (#9) writes these throughset_configConfigstruct (Facet-derived) on the runtime boundary; loader returnsResult<Config, SermonError>withkind = ConfigInvalidon parse failure and the offending path incontextget_config/set_config(or read-only at first) on the bridge so the UI can show the current provider/modelSERMONES_BASE_URL,SERMONES_MODEL) continue to take precedence over file values during the dev loopRefs:
docs/architecture/stack.md— TOML accepted, no YAML/JSON config,Facetfor serialisationdocs/architecture/errors.md—ConfigInvalidis the canonical error kindcrates/sermones/src/lib.rs— env-var override convention used inrun_guicrates/sermones-runtime/src/lib.rs— module docstring declares this as the runtime's jobResolution
Landed in
2315556(main):Config/ProviderConfig/UiConfig/Themeinsermones-core'ssrc/config.rs,ConfigStoreincrates/sermones-runtime/src/config/over$XDG_CONFIG_HOME/sermones/config.toml(fallback~/.config/...), atomic tmp+rename writes.ConfigInvalidon parse failure with the offending path incontext["path"]; io failures areIoErrorwith path. Bridge:get_config(synchronous, in-memory; corrupt startup config falls back to defaults and surfaces viaGetConfigResult.errors) andset_config(fire-and-forget persist, failures onerror_raised). TypedgetConfig/setConfighelpers infrontend/src/lib/bridge.ts. 9 new tempdir tests; 461/461 workspace tests passing, lint clean.Deviations (decided up front):
XDG_CONFIG_HOME), not the user-state dir the checklist mentioned — config is config, state is state.provider.*andui.themeland;provider.api_keyis reserved (nothing reads it yet).App.sveltedoes not call the new surface yet; that comes with the settings screen (#9).