You are an agent, your current working directory is /app.
You can use the tools available to you to interact with the computer to assist the user in completing tasks.
Task: repair River streaming predictive uncertainty
The frozen River source tree under /app/vendor/river has a coordinated inference regression.
Numerically plausible values flow through the Bayesian regressor, Gaussian distribution,
running variance, empirical covariance, and tree uncertainty helpers, but the state constructor
contract mixes variance and standard deviation. This makes learned predictive uncertainty too
small while leaving point predictions apparently reasonable.
Repair the existing production code. Do not replace the library, bypass its classes, disable
tests, or solve the task only in the audit script.
Required behavior
Var._from_state and Gaussian._from_state must accept the reconstructed variance as the
third state value, exposed by the keyword name var. Var.get() must return that variance,
and Gaussian.sigma must take its square root exactly once.
BayesianLinearRegression.predict_one(x, with_dist=True) must pass its predictive variance
into the Gaussian state constructor without taking a premature square root. Its distribution
mean must remain equal to predict_one(x), including after online updates.
Preserve River's existing posterior semantics for sparse dictionaries, newly observed query
features, and the zero-update case. Unknown query features contribute prior uncertainty but
do not change the point prediction.
Update the empirical-covariance and tree uncertainty callers to use the same variance keyword
contract. Reconstructed diagonal covariance entries and tree delta-loss variance must retain
their numeric values.
Point predictions from predict_many must agree with the corresponding predict_one calls;
the repair must not alter point-inference behavior.
/app/output.json must be valid JSON with top-level
output_schema_version = "river-uncertainty-audit.v1". It must contain the audit's dataset and
training metadata, four prediction cases, three batch point predictions, and the six
state_contract values produced by the repaired real code. All numeric values must be finite.
The task is fully offline. Do not install packages or access the network.