Skip to content

fix: trust-only kodo.toml causes spurious warning on build#60

Merged
rfunix merged 2 commits intomainfrom
fix/trust-only-kodo-toml
Apr 7, 2026
Merged

fix: trust-only kodo.toml causes spurious warning on build#60
rfunix merged 2 commits intomainfrom
fix/trust-only-kodo-toml

Conversation

@rfunix
Copy link
Copy Markdown
Owner

@rfunix rfunix commented Apr 7, 2026

Problem

After #59, a kodo.toml containing only a [trust] section (without module/version) caused two issues:

  1. load_trust_config used read_manifest which requires the full Manifest struct — parse failed silently but the trust config was not loaded
  2. run_build called read_manifest separately for dependency resolution and printed a noisy warning: error: could not parse kodo.toml to stderr

Fix

manifest.rs

Introduced a TrustOnlyManifest struct (only trust: Option<TrustSection>) used exclusively by load_trust_config. A minimal kodo.toml like this now works correctly:

[trust]
known_agents    = ["claude", "gpt-4", "copilot", "gemini"]
human_reviewers = ["alice", "bob"]

commands/build.rs

Changed the dependency-loading path to silently return Vec::new() when read_manifest fails — a trust-only config has no deps, so skipping dep resolution is the correct behaviour with no need for a warning.

Test plan

  • cargo check --workspace — clean
  • cargo test --workspace — all pass
  • A project with only [trust] in kodo.toml now compiles with no warnings and trust enforcement active

🤖 Generated with Claude Code

rfunix and others added 2 commits April 7, 2026 10:53
…uired)

load_trust_config now uses a dedicated TrustOnlyManifest struct that
does not require the module and version fields. This prevents a spurious
warning when a project has a minimal kodo.toml containing only [trust].

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… config)

build.rs was printing a warning when read_manifest failed on a kodo.toml
that contains only [trust] (without the required module/version fields).
A trust-only config has no deps, so silently returning an empty list is
the correct behaviour.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@rfunix rfunix merged commit f239fc2 into main Apr 7, 2026
12 checks passed
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.

1 participant