Skip to content

docs(agents): fit.toml bounds may only narrow the model, never widen#427

Open
vsbuffalo wants to merge 1 commit into
mainfrom
docs/fit-toml-bounds-narrow-only
Open

docs(agents): fit.toml bounds may only narrow the model, never widen#427
vsbuffalo wants to merge 1 commit into
mainfrom
docs/fit-toml-bounds-narrow-only

Conversation

@vsbuffalo

@vsbuffalo vsbuffalo commented Jul 11, 2026

Copy link
Copy Markdown
Owner

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] bounds override must be a subset of the model's declared p : 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 one if2_params build), and is covered by fit_bounds_outside_model_bounds_rejected (with fit_bounds_tighten_estimated_param_lower_upper pinning 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" ParamNearBound bullet, 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).

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).
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