Skip to content

fix(regression): let CI run the confidence guard again - #28

Merged
chrisfoulon merged 1 commit into
mainfrom
fix/confidence-guard-visible-to-ci
Sep 17, 2026
Merged

chrisfoulon merged 1 commit into
mainfrom
fix/confidence-guard-visible-to-ci

Conversation

@chrisfoulon

Copy link
Copy Markdown
Owner

test_confidence_map_matches_its_baseline carried @pytest.mark.machine_specific while its own docstring argued, correctly, that it deliberately does not. The mark won, so from 2026-09-06 CI never ran it — and it is the only live check that the confidence map still varies. Flattening it again, the exact defect Step 3 removed, would have passed everything CI runs. The other guard on that path reads the baselines only and, in its own words, "cannot see a change in the code at all".

Checked before removing the mark, rather than trusting either side: none of the three asserted quantities is a per-fold argmax. n_confidence_maps counts confidence_values.npy, which is one aggregated map per target, not per fold, so a target's map goes flat only if every fold in its ensemble collapsed. The other two are a count and a sign.

Worth saying plainly: I first split this test in two, on the assumption that the flat-map count was per-fold and therefore CPU-fragile. The perturbation output — maps=1 on a one-target dataset — is what showed the assumption was wrong. That split is reverted; only the mark changes.

Perturbed: forcing every map constant fails swiss_roll with the Step-3 message, and -m "not machine_specific" now selects the test (17 selected, up from 14). Local --core green, 17/17 suites.

ADR. 2.9d gains the rule the two recent mistakes share: a CI-visible test reads the live run, never only the baselines, and asserts only on what does not depend on which Optuna trial won — scores, composites, cluster counts and per-fold estimator choices do; a config-fixed count, a sign, and "did this collapse entirely" do not. 2.13 records that EMUSES keeps the subject indexing it is given: a UMAP model pickles its training data, so it is unshareable with or without ids, and stripping them would cost a reconstruction step for no real safety. Keeping a restricted model private is the operator's job; cohort.json stays a digest unless --record_cohort_ids is passed.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DrLKJZx7PmzAsZJCUiYm5g

… decision

`test_confidence_map_matches_its_baseline` carried `machine_specific` while its
own docstring argued, correctly, that it deliberately does not. The mark won, so
from 2026-09-06 CI never ran it -- and it is the only live check that the
confidence map still varies. Flattening it again, the exact defect Step 3
removed, would have passed everything CI runs.

Checked before removing the mark rather than trusting either side: none of the
three asserted quantities is a per-fold argmax. `n_confidence_maps` counts
`confidence_values.npy`, which is one aggregated map per *target*, not per fold,
so a target's map goes flat only if every fold in its ensemble collapsed; the
other two are a count and a sign. I first split this test in two on the
assumption that the flat-map count was per-fold and therefore CPU-fragile, and
the perturbation output (`maps=1` on a one-target dataset) is what showed the
assumption was wrong. The split is reverted; only the mark changes.

Perturbed: forcing every map constant fails swiss_roll with the Step-3 message,
and `-m "not machine_specific"` now selects the test. Local `--core` green.

ADR 2.9d gains the rule the two mistakes share -- a CI-visible test reads the
live run, never only the baselines, and asserts only what does not depend on
which Optuna trial won -- and 2.13 records that EMUSES keeps the subject
indexing it is given (Chris): a UMAP model pickles its training data, so it is
unshareable with or without ids, and stripping them would cost a reconstruction
step for no real safety. Keeping a restricted model private is the operator's
job; `cohort.json` stays a digest unless `--record_cohort_ids` is passed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DrLKJZx7PmzAsZJCUiYm5g
@chrisfoulon
chrisfoulon merged commit 2e2013e into main Sep 17, 2026
1 check passed
@chrisfoulon
chrisfoulon deleted the fix/confidence-guard-visible-to-ci branch September 17, 2026 21:44
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