Extending DriftWatch¶
DriftWatch is a study, so extensions come in two kinds. A change that only adds a capability (a loader, a selector, a monitor) must leave every existing result untouched. A change that alters what a result means is not an extension: it needs a new pre-registration before any run (CONTRIBUTING). The extension points below are the places where the first kind can be made safely.
Every extension follows the same four steps: implement the protocol, register it in the factory, add the tests that prove it cannot see what it must not see, and write down the decision.
To add |
Implement |
Register in |
Must be proven by tests |
|---|---|---|---|
A dataset |
|
|
the slicer’s constraint and mutation suites run on it; |
A selector |
|
|
it takes an |
A retraining policy |
|
|
it reads no label; a retrain with no new labels is a no-op |
A monitor |
|
|
no label or metric import ( |
A detector |
subclass |
|
it refuses to score under another window’s id ( |
A nonconformity score |
|
the E3 config |
bound to one window; calibration rows are never rows the model was fitted on |
A worked example: a new selector¶
Add
class MarginSelector(_ScoreSelector)tosim/selectors.py, choosing the handles with the smallest gap between the two class probabilities. It receivesscoresfrom the runner andpublicfor the handles; it has no way to ask for a label.Add
if name == "margin": return MarginSelector()tomake_selector.Add a test next to
tests/test_sim_selectors.py: the selection has at mostnhandles, it is the same for the same seed, and it differs from the random selection on a score vector that has structure.Run the import checks of
tests/test_sim_sealed.py; they fail if the new class imports anything that holds labels.Write the config (
selector: margin) and register the hypothesis in a pre-registration addendum before running it. A selector that is added after seeing results is exploratory and must be labelled so.
What must not be done¶
Do not read a label outside
sim/queue.py, and do not compute a delay anywhere else.Do not fit a scaler, threshold, feature selector or calibration set on anything but the current training window.
Do not weaken, skip or delete a constraint test or a guardrail to make a change pass; write an ADR and ask.
Do not add evasion tooling or adversarial-example generation. The repository describes how detectors decay, not how to defeat them (ethics).