mirror of
https://github.com/kvcache-ai/AgentENV.git
synced 2026-11-05 01:17:36 +00:00
[PR #373] [MERGED] test(config): fail when the reference or bundled config drifts from cfg.rs #383
Labels
No labels
bug
documentation
enhancement
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
kvcache-ai/AgentENV#383
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?
📋 Pull Request Information
Original PR: https://github.com/kvcache-ai/AgentENV/pull/373
Author: @yingdi-shan
Created: 10/12/2026
Status: ✅ Merged
Merged: 10/13/2026
Merged by: @yingdi-shan
Base:
main← Head:refactor/config-reference-check📝 Commits (1)
f0f102btest(config): fail when the reference or bundled config drifts from cfg.rs📊 Changes
2 files changed (+158 additions, -0 deletions)
View changed files
📝
docs/src/configuration/reference.md(+28 -0)📝
src/cfg.rs(+130 -0)📄 Description
What
Two tests in
src/cfg.rswalk the confique schema (AppConfig::META):configuration_reference_documents_every_key: every config key must appear indocs/src/configuration/reference.md, and every key the reference lists must exist in the schema.bundled_default_config_sets_only_known_keys:config/default.tomlmay only set keys that the schema reads.The first test found 11 undocumented keys. This PR documents them.
Why
Each config key is defined in
src/cfg.rsand repeated by hand inconfig/default.tomland the reference doc. Seven of the 15 largest recent PRs edited all three. The only existing check was that the bundled file parses. confique ignores unknown keys, so a misspelled or removed key indefault.tomlloads without complaint, and a key missing from the reference goes unnoticed.Related issue
N/A. Follow-up to the review behind #367.
Scope and non-goals
cfg.rs. Many fields have no doc comments, and the reference holds richer prose (validation rules, examples, cross-links). Generating it would rewrite the whole document. With the tests in place, drift fails CI instead.pool.network.startup_prewarmis never read.pool.block.maintenance_enabledis ignored, because the block pool always refills at request time. Both are documented as they behave; removing them is a separate decision.Design and behavior changes
Newly documented keys:
[image.resolver]convert_standard_oci[machine.disk_rate_limit](new section)enabled,bandwidth_bytes_per_sec,bandwidth_burst_bytes,iops,iops_burst[pool.network]enabled,startup_prewarm[pool.block]maintenance_enabled[ublk.overlaybd]remote_io_workers[overlaybd](new section)version,package_url,urlHow the reference parser reads the doc:
## `[section]`heading sets the key prefix, and## Global Settingsmeans top-level keys.[pool]component table does.[protoc]is skipped, because it documentsconfig/deps_manifest.toml.backend.oss,backend.posix_fs,overlaybd) counts as documented through its subkeys.Compatibility and operations
Validation
make fmtmake clippymake test-unitmake -C services test(required whenservices/changes)maketargetCommands and results:
Checks that the new tests catch drift:
remote_io_workersrow from the reference fails withmissing keys: ["ublk.overlaybd.remote_io_workers"].remote_io_workerinconfig/default.tomlfails withconfig/default.toml sets keys that src/cfg.rs does not read: ["ublk.overlaybd.remote_io_worker"].bundled_default_config_loadsstill passes in that case.Skipped checks and reasons:
make test-unitcapability tests (--ignored) and integration suites: tests and docs only.Risks and reviewer notes
[overlaybd](fromsrc/setup/overlaybd.rs) and[machine.disk_rate_limit](from its field docs andvalidate_disk_rate_limit).Checklist
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.