docs(agents): fit.toml bounds may only narrow the model, never widen#427
Open
vsbuffalo wants to merge 1 commit into
Open
docs(agents): fit.toml bounds may only narrow the model, never widen#427vsbuffalo wants to merge 1 commit into
vsbuffalo wants to merge 1 commit into
Conversation
Surface, in the agent-facing idioms, a rule the runtime already enforces but that was undocumented where agents author fit.toml: a `[estimate.p]` `bounds` override must be a subset of the model's declared `p : kind in [lo, hi]` range. `build_if2_params_from_specs` (rust/crates/cli/src/fit/runner.rs) already rejects a widening override — "fit.toml bounds … lie outside model bounds …; a fit can tighten bounds but not loosen them" — on every fit/survey/profile path (the shared `if2_params` build), covered by `fit_bounds_outside_model_bounds_rejected`. The idiom names that error and the fix: to search wider, widen the declared bounds in the model, where the change is visible, travels with the model, and re-keys the run identity. Also reconcile the "safe to do autonomously" ParamNearBound bullet, which read as "widen bounds in the fit.toml": relax a narrowed fit.toml bound back toward the model's range, or widen the model's declared bounds — never widen the fit.toml past the model. Refs gh#369 (which asked for this guardrail; the widen direction already errors — narrowing stays silent by design, as the intended use).
05621a1 to
1a63b0b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Documents, in the agent-facing idioms (
docs/agents.md), a rule the runtime already enforces but that was undocumented where agents actually author fit.toml: a[estimate.p]boundsoverride must be a subset of the model's declaredp : kind in [lo, hi]range.The enforcement lives in
build_if2_params_from_specs(rust/crates/cli/src/fit/runner.rs): a widening override is rejected with "fit.toml bounds … lie outside model bounds …; a fit can tighten bounds but not loosen them." It fires on every fit/survey/profile path (they share the oneif2_paramsbuild), and is covered byfit_bounds_outside_model_bounds_rejected(withfit_bounds_tighten_estimated_param_lower_upperpinning that narrowing is allowed). This PR adds no code — it makes the existing behaviour discoverable.The idiom names that error and the fix: to search wider, widen the declared bounds in the model (visible, travels with the model, re-keys the run identity), never loosen it in the config.
Also reconciles the "safe to do autonomously"
ParamNearBoundbullet, which previously read as "widen bounds in the fit.toml": relax a narrowed fit.toml bound back toward the model's range, or widen the model's declared bounds.Refs gh#369 — which asked for this guardrail; the widen direction already errors, and narrowing stays silent by design (it's the intended use).