feat: add feedback banner and an issue link on fit errors - #15
Merged
Conversation
Inference quality depends on real data shapes we cannot reproduce from synthetic draws, so the users who get a bad fit are the only ones who can tell us what their model and data looked like. A once-a-day banner on interactive load, from the shared DataZooDE/duckdb-extension-banner submodule. Silent when piped, in notebooks, in CI and under the test runner, so no existing expected output changes. The guard sits on the in-out functions, not just bind and init. The fit runs in the finalize phase (RunFit is called from BayesFitFinalize), so guarding bind/init compiled fine, passed tests, and left the footer off every error a user would actually hit. Caught by running a failing fit against the built shell rather than trusting the wiring. BayesError in the Rust core is deliberately untouched. errors.rs states that the primary caller is an agent and that variants carry machine-readable repair information -- the catalog list in the message above exists so a caller can fix its own request. Appending prose to that Display would corrupt the contract, so the link is added at the C++ boundary instead, where a human reads it. The reasoning is recorded in anofox_bayes_banner.hpp so it survives. Suite green: 681 assertions in 17 cases.
On MinGW the 'struct _stat64' tag hides the function of the same name in C++, so the banner's _stat64 call parsed as a constructor and every rtools/MinGW Windows job failed to compile. The shared library now uses plain stat() everywhere except MSVC. Caught by anofox-similarity CI, which builds windows_amd64_rtools.
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.
Inference quality depends on real data shapes we cannot reproduce from synthetic draws, so the users who get a bad fit are the only ones who can tell us what their model and data looked like.
Part of a fleet-wide rollout using the shared
DataZooDE/duckdb-extension-bannersubmodule.The bug this PR nearly shipped with
I first guarded
BayesFitBindandBayesFitInitGlobal. It compiled, the suite passed, and the footer appeared on nothing at all — because the fit runs in the finalize phase (RunFitis called fromBayesFitFinalize), so no real failure ever passed through bind or init.Only running an actually-failing fit against the built shell caught it. The guard now sits on
in_out_functionandin_out_function_final:feedback.testasserts this path specifically, with a comment recording why bind/init is not enough.BayesErroris deliberately untouchedcrates/anofox-bayes-core/src/errors.rsstates that the primary caller is an agent and that variants carry machine-readable repair information — the catalog list above exists precisely so a caller can fix its own request. Appending prose to thatDisplaywould corrupt the contract.So the link is added at the C++ boundary, where a human reads the message, and the Rust crate is not modified. Every error a person sees carries the link; every error an agent parses is byte-identical to before. The reasoning is written into
anofox_bayes_banner.hppso it survives this PR.Verified
feedback.test(5 assertions)Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.