ExAthena.Compactor.Config (ExAthena v0.19.0)

Copy Markdown View Source

Single resolution path for compaction settings.

Every compaction stage resolves its knobs through the same cascade:

  1. state.meta[key] — per-run override, set by the host via loop options.
  2. Application.get_env(:ex_athena, :compactor) — global config, accepted as a keyword list or a map.
  3. The caller-supplied default.

Extracted here because the cascade was copy-pasted across five stage modules and had already started to drift (issue #148).

Summary

Functions

Resolve key from the :compactor app env alone (no per-run meta override). For settings that are deliberately global, like the summary system prompt.

Resolve key through the meta → app env → default cascade.

Functions

app_env(key, default)

@spec app_env(atom(), term()) :: term()

Resolve key from the :compactor app env alone (no per-run meta override). For settings that are deliberately global, like the summary system prompt.

get(state, key, default)

@spec get(ExAthena.Loop.State.t(), atom(), term()) :: term()

Resolve key through the meta → app env → default cascade.

Matches the || semantics every stage used before extraction: a falsy meta value falls through to the app env, then the default.