curated_feed.config¶
Configuration loading.
Settings are grouped into the same sections the TOML file uses, so a value’s name in code and in the file are one and the same.
All filesystem locations come from the config file (or CLI flags), never from literals in this package: the policy, corpus and state directories belong to the deployment, not to the code.
Attributes¶
Exceptions¶
Raised when configuration is missing or malformed. |
Classes¶
Base for every settings section: strict, and immutable once loaded. |
|
Where everything lives. Relative entries resolve against the config file. |
|
Collecting candidates. These are other people's servers: stay polite. |
|
Checking whether a candidate's page can actually be read. |
|
Which scorer runs, and what it is allowed to spend. |
|
The weights of scoring specification §2.3, and their thresholds. |
|
The arithmetic the model never sees. |
|
The public surface. Deliberately bland: no name, employer or project. |
|
Where the built feed is uploaded, and by what. |
|
Resolved settings for a run. |
Functions¶
|
Locate the config file, searching start and its parents. |
|
Load settings from TOML. Paths are resolved relative to the config file. |
Module Contents¶
- curated_feed.config.DEFAULT_CONFIG_FILENAME = 'config.toml'¶
- exception curated_feed.config.ConfigError[source]¶
Bases:
ExceptionRaised when configuration is missing or malformed.
- class curated_feed.config.Section(/, **data: Any)[source]¶
Bases:
pydantic.BaseModelBase for every settings section: strict, and immutable once loaded.
- model_config¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class curated_feed.config.Paths(/, **data: Any)[source]¶
Bases:
SectionWhere everything lives. Relative entries resolve against the config file.
The scoring prompt is deliberately absent. It is the engine’s contract with its own parser rather than a runner’s choice, so it ships with the package and no configuration can name it; –scoring-prompt overrides it for the length of one command. A config that still carries a prompt key is rejected rather than ignored, which is what makes an un-migrated runner say so instead of quietly scoring against the wrong document.
- sources: pathlib.Path¶
- corpus_dir: pathlib.Path¶
- policy: pathlib.Path¶
- state_dir: pathlib.Path¶
- build_dir: pathlib.Path¶
- class curated_feed.config.FetchSettings(/, **data: Any)[source]¶
Bases:
SectionCollecting candidates. These are other people’s servers: stay polite.
- class curated_feed.config.PaywallSettings(/, **data: Any)[source]¶
Bases:
SectionChecking whether a candidate’s page can actually be read.
Off by default: turning it on makes a request per graded article to somebody else’s site, so it is a runner’s decision rather than a default. Deliberately more cautious than [fetch] — these are article pages, and there are more of them than there are feeds.
- class curated_feed.config.ScoreSettings(/, **data: Any)[source]¶
Bases:
SectionWhich scorer runs, and what it is allowed to spend.
- class curated_feed.config.Adjustments(/, **data: Any)[source]¶
Bases:
SectionThe weights of scoring specification §2.3, and their thresholds.
- class curated_feed.config.PolicySettings(/, **data: Any)[source]¶
Bases:
SectionThe arithmetic the model never sees.
- rationale_mode: Literal['none', 'minimal'] = 'minimal'¶
- adjustments: Adjustments¶
- class curated_feed.config.PublishSettings(/, **data: Any)[source]¶
Bases:
SectionThe public surface. Deliberately bland: no name, employer or project.
- class curated_feed.config.DeploySettings(/, **data: Any)[source]¶
Bases:
SectionWhere the built feed is uploaded, and by what.
No credential belongs here. The deploy tool resolves its own from the environment, exactly as the scorer does, so the repository never holds one.
- class curated_feed.config.Config(/, **data: Any)[source]¶
Bases:
SectionResolved settings for a run.
- fetch: FetchSettings¶
- paywall: PaywallSettings¶
- score: ScoreSettings¶
- policy: PolicySettings¶
- publish: PublishSettings¶
- deploy: DeploySettings¶
- curated_feed.config.find_config_file(start: pathlib.Path | None = None) pathlib.Path[source]¶
Locate the config file, searching start and its parents.
- curated_feed.config.load_config(config_path: pathlib.Path | None = None) Config[source]¶
Load settings from TOML. Paths are resolved relative to the config file.