Skip to content

feat: add feedback banner and an issue link on fit errors - #15

Merged
jrosskopf merged 2 commits into
mainfrom
feat/feedback-banner
Aug 7, 2026
Merged

feat: add feedback banner and an issue link on fit errors#15
jrosskopf merged 2 commits into
mainfrom
feat/feedback-banner

Conversation

@jrosskopf

@jrosskopf jrosskopf commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

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-banner submodule.

The bug this PR nearly shipped with

I first guarded BayesFitBind and BayesFitInitGlobal. It compiled, the suite passed, and the footer appeared on nothing at all — because the fit runs in the finalize phase (RunFit is called from BayesFitFinalize), 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_function and in_out_function_final:

Invalid Input Error: anofox_bayes_fit: unknown model family 'not_a_family'
  (catalog: hier_negbin, censored_aft, pooled_gaussian, payment_delay, payer_alive,
   hier_elasticity, conjugate_anomaly, varying_variance_gaussian)
-> Unexpected? Please report it: https://github.com/DataZooDE/anofox-bayes/issues

feedback.test asserts this path specifically, with a comment recording why bind/init is not enough.

BayesError is deliberately untouched

crates/anofox-bayes-core/src/errors.rs states 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 that Display would 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.hpp so it survives this PR.

Verified

  • Banner once interactively, silent on repeat, silent when piped
  • Footer present with the core's diagnostic intact
  • 681 assertions in 17 cases pass, plus the new feedback.test (5 assertions)

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

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.
@jrosskopf
jrosskopf merged commit f616a44 into main Aug 7, 2026
62 checks passed
@jrosskopf
jrosskopf deleted the feat/feedback-banner branch August 7, 2026 13:53
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