Repository navigation
ML threat layer: real stand-in model leg, clear half-loaded classifier (Part of #2986) - #6129
Merged
Merged
Conversation
…er (Part of #2986) Every ML test patched XGBClassifier. Add a leg that trains a tiny synthetic model and runs load, reindex, scoring, threshold, static-asset shield, shadow patch and the recorder against it. It found that a model file that fails to load left the unloaded classifier in self.model; clear it. XGBClassifier also needs scikit-learn, which the `full` extra omits; the leg skips without it and the doc says so. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Owner
Author
|
No description provided. |
squid-protocol
marked this pull request as ready for review
October 23, 2026 02:10
squid-protocol
enabled auto-merge (squash)
October 23, 2026 02:26
Contributor
Owner
Author
|
No description provided. |
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.
Part of #2986.
What
tests/security_auditing/test_ml_real_model_2986.py: trains a tiny synthetic 5-class XGBoost model and drives the realSecurityAuditorchain (load,feature_names_in_, reindex incl. a missing feature,predict_proba,ai_threshold, static-asset shield, shadow patch, recorder to DB columns, corrupt model file). Plumbing only, not detection quality.security_auditor.py: a model file that fails to load left the unloaded classifier inself.model; now cleared (found by the corrupt-file case). Failure path only, so golden-neutral.docs/zero_dependency_mode.md: states the code path is exercised, the model is not.Class table
fullextra lacks scikit-learnCross-repo
None.
Gates
pr_gates --fast7/7,--ratchets9/9, tree-wide guards 194 passed, new tests 9 passed with scikit-learn on a scratch path (time ratchet clean); skipped without it.Lessons for agents
xgboost.XGBClassifier()raises ImportError without scikit-learn and the selfscan venv lacks it: the real-model test skips there; run it withpip install --target <scratch> scikit-learnon PYTHONPATH.🤖 Generated with Claude Code