Skip to content

feat(config): introduce tuning presets (balanced, deep) - #329

Open
zizou0x wants to merge 1 commit into
zz/eng-6176-s3-config-layerfrom
zz/eng-6176-presets
Open

feat(config): introduce tuning presets (balanced, deep)#329
zizou0x wants to merge 1 commit into
zz/eng-6176-s3-config-layerfrom
zz/eng-6176-presets

Conversation

@zizou0x

@zizou0x zizou0x commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Stacked on #328 (remote config layer).

What

Adds the preset concept: a config::Preset (balanced | deep) selects which
defaults apply. Both the embedded default_config.toml and the per-chain remote
document hold one section per preset (same layout in both files); every layer above
— local config file, CLI flags, legacy worker_pools.toml — behaves unchanged on top.
The two presets currently share identical values; deep gets tuned later.

  • Selection: --preset / PRESET (default balanced); lib: get_default(chain, preset),
    Config::apply_remote(url, preset, timeout). A preset can never be set from a config file.
  • Remote URL stays one document per chain (presets/{chain}/latest.toml); the fetch
    selects the preset's section. A missing section (or empty document) is a quiet
    "nothing tuned" state — the already-published empty payloads remain valid.
  • The unknown-algorithm safety check runs only on the selected section, so a future
    preset section can use newer algorithms without breaking binaries on other presets.
  • Preset is strum-derived; parsing, listing, and --help values are generated, and a
    unit test fails if the enum and the file sections drift. Adding a preset = one
    variant + one section per file.
  • FyndBuilder::new and fynd-rpc's builtin_default() pin to balanced.

From the design review (fresh-context agent)

Applied: unknown keys in hand-written config files now warn (remote stays fully
permissive for forward compatibility, guarded by a field-list sync test); the remote
layer logs exactly which fields it overrides; the standalone router-timeout exception
is documented at the constant; layer-count doc fix; --help text cleanup.

Not applied: clap::ValueEnum for Preset (fynd-core has no clap dependency — strum
is the boundary-respecting choice); trimming get_default (deliberate convenience
API); changing legacy worker_pools.toml pools precedence (explicit
backward-compatibility decision, already warns); value-range floors in validate()
(no tuning bounds established yet — the new override logging provides visibility
instead).

🤖 Generated with Claude Code

A preset selects which defaults apply — one section per preset in the
embedded default_config.toml and in the per-chain remote document.
Local overrides behave unchanged on top. The two presets share values
until tuned. Also: warn on unknown keys in local config files and log
which fields the remote layer overrides.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@zizou0x
zizou0x marked this pull request as draft July 21, 2026 08:59
@zizou0x
zizou0x marked this pull request as ready for review July 21, 2026 12:02
@zizou0x
zizou0x requested a review from brunoguerios July 21, 2026 12:02

@brunoguerios brunoguerios left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM ✅

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.

2 participants