Problem Statement
The docs and implementation disagree on whether project is valid in global config (~/.trop/config.yaml).
Documentation says global config excludes project (and reservations), but runtime validation currently allows project from any source. This creates ambiguity for users and makes config behavior hard to reason about.
Concrete mismatch:
- Docs:
plugins/trop/skills/trop-reference/references/tropfile-reference.md:19 says project is "trop.yaml only".
- Docs:
plugins/trop/skills/trop-reference/references/tropfile-reference.md:97 says global config uses same schema minus project and reservations.
- Impl:
trop/src/config/validator.rs:36-40 explicitly allows project from any source.
- Impl test:
trop/src/config/validator.rs:346-354 (test_validate_project_in_user_config) enforces this permissive behavior.
- Related design constraint:
trop/src/config/builder.rs:133-142 uses a coarse is_tropfile boolean, which cannot distinguish "user config provided project" vs "env/CLI provided project" after merge.
Affected Files / Lines
plugins/trop/skills/trop-reference/references/tropfile-reference.md:19
plugins/trop/skills/trop-reference/references/tropfile-reference.md:97
trop/src/config/validator.rs:36-40
trop/src/config/validator.rs:346-354
trop/src/config/builder.rs:133-142
Recommended Fix
Align implementation with documented/spec behavior by rejecting project (and reservations) specifically in user config at load time, before merged validation.
// trop/src/config/loader.rs
fn load_user_config(data_dir: Option<&Path>) -> Result<Option<ConfigSource>> {
// existing path resolution...
let config = Self::load_file(&config_path)?;
if config.project.is_some() {
return Err(Error::Validation {
field: "project".into(),
message: "project field is only valid in trop.yaml/trop.local.yaml".into(),
});
}
if config.reservations.is_some() {
return Err(Error::Validation {
field: "reservations".into(),
message: "reservations field is only valid in trop.yaml/trop.local.yaml".into(),
});
}
Ok(Some(ConfigSource { path: config_path, precedence: 1, config }))
}
Also update validator tests so user-config-specific project is rejected, while env/CLI/programmatic project remains allowed.
Validation Strategy
- Add tests:
ConfigBuilder with custom data dir config.yaml containing project should return validation error.
ConfigBuilder with custom data dir config.yaml containing reservations should return validation error.
- Existing
with_config(...) / CLI-style additional config with project should still pass.
- Env override (
TROP_PROJECT) should still pass when no tropfile exists.
- Manual verification:
- Create
~/.trop/config.yaml with project: foo; run a simple command (trop reserve .) and confirm clear validation error.
- Remove
project from global config; set TROP_PROJECT=foo; confirm command succeeds.
- Put
project in trop.yaml; confirm command succeeds.
Acceptance Criteria
- Global
config.yaml rejects project and reservations.
trop.yaml / trop.local.yaml continue to allow project and reservations as before.
- Env/CLI
project inputs continue to work.
🤖 Discovered by Codex · expanded by Codex · filed by Claude Code
Problem Statement
The docs and implementation disagree on whether
projectis valid in global config (~/.trop/config.yaml).Documentation says global config excludes
project(andreservations), but runtime validation currently allowsprojectfrom any source. This creates ambiguity for users and makes config behavior hard to reason about.Concrete mismatch:
plugins/trop/skills/trop-reference/references/tropfile-reference.md:19saysprojectis "trop.yaml only".plugins/trop/skills/trop-reference/references/tropfile-reference.md:97says global config uses same schema minusprojectandreservations.trop/src/config/validator.rs:36-40explicitly allowsprojectfrom any source.trop/src/config/validator.rs:346-354(test_validate_project_in_user_config) enforces this permissive behavior.trop/src/config/builder.rs:133-142uses a coarseis_tropfileboolean, which cannot distinguish "user config provided project" vs "env/CLI provided project" after merge.Affected Files / Lines
plugins/trop/skills/trop-reference/references/tropfile-reference.md:19plugins/trop/skills/trop-reference/references/tropfile-reference.md:97trop/src/config/validator.rs:36-40trop/src/config/validator.rs:346-354trop/src/config/builder.rs:133-142Recommended Fix
Align implementation with documented/spec behavior by rejecting
project(andreservations) specifically in user config at load time, before merged validation.Also update validator tests so user-config-specific
projectis rejected, while env/CLI/programmaticprojectremains allowed.Validation Strategy
ConfigBuilderwith custom data dirconfig.yamlcontainingprojectshould return validation error.ConfigBuilderwith custom data dirconfig.yamlcontainingreservationsshould return validation error.with_config(...)/ CLI-style additional config withprojectshould still pass.TROP_PROJECT) should still pass when no tropfile exists.~/.trop/config.yamlwithproject: foo; run a simple command (trop reserve .) and confirm clear validation error.projectfrom global config; setTROP_PROJECT=foo; confirm command succeeds.projectintrop.yaml; confirm command succeeds.Acceptance Criteria
config.yamlrejectsprojectandreservations.trop.yaml/trop.local.yamlcontinue to allowprojectandreservationsas before.projectinputs continue to work.🤖 Discovered by Codex · expanded by Codex · filed by Claude Code