R21
What to build¶
Default binary ROC configuration scores valid normalized two-class evidence.
Source and evidence¶
Repository scientific/architectural review, snapshot 86c8517, item R21.
Classification: confirmed defect; medium severity.
The adapter defaults to average="binary" for all classification metrics and
accepts that setting for ROC AUC. It forwards it to roc_auc_score(), whose
accepted averaging modes exclude binary. On otherwise valid two-class input,
the dependency raises InvalidParameterError; the evaluator returns no ROC score.
The current ROC contract tests use only empty, single-class, malformed-shape and
non-finite inputs, which fail before the dependency's finite scoring path.
The first scenario in the retained class-order probe uses the default averaging
argument with valid normalized probabilities. It records InvalidParameterError.
Changing only the averaging setting to macro permits scoring in the subsequent
scenarios. The dependency API's averaging contract
also documents the supported values.
Acceptance criteria¶
- [ ] Default finite binary ROC succeeds and returns the expected score rather than InvalidParameterError.
- [ ] Unsupported metric/averaging combinations reject at construction before candidate/scorer side effects.
- [ ] Single-class/empty evidence remains reason-coded unavailable, and valid multiclass modes remain supported.
- [ ] Declared measurement identity captures the effective averaging policy and compatibility changes.
- [ ] Preserve Consumer-owned meaning, payload-free evidence, disabled optional-import isolation, safe diagnostics and the non-relaxable Safety Floor.
- [ ] Run the narrowest observable contract, then applicable committed Make gates. Record every command and outcome; update specifications/compatibility evidence for changed public or wire contracts. Run native Collector verification for changed Collector assets and build for packaging changes.
Design guidance¶
Use accepted ROC-specific defaults or translate irrelevant binary averaging before delegation. Validate configuration per metric rather than forwarding one universal classification setting.
Keep prefactoring narrow and verifiable in this slice. Reuse established owners and structural interfaces; introduce a pattern only when it clarifies a real responsibility or variation point. Do not add consumer vocabulary or private payloads to platform code or evidence. Mocked/local results must not claim hosted, production, accelerator or release qualification.
Blocked by¶
None (can start immediately). Shared-area coordination is useful, but no other review fix is a genuine prerequisite for this slice.
Verification scope¶
Convert the described counterexample or investigation oracle into an observable test at the lowest suitable public boundary. Prefer bounded operation-count or deterministic interleaving evidence to flaky timing assertions; timing guarantees need a declared tolerance and independently owned cleanup. This ticket authorizes remediation/research, not publication or deployment.