Skip to content

Compatibility sweep (MC-1..MC-3, Q-MC-a, Q-MC-b) - #636

Merged
guijacquemet merged 2 commits into
mainfrom
claude/mc-compat-sweep
Nov 14, 2026
Merged

guijacquemet merged 2 commits into
mainfrom
claude/mc-compat-sweep

Conversation

@guijacquemet

@guijacquemet guijacquemet commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

This is the MorphoCoverage part of the approved compatibility sweep. The inventory is docs/restart/designs/compat-sweep-inventory-2026-11-13.md on MorphoFeature branch claude/restart-doc (§5, owner answers in §12). After review, the owner decided to refuse the three further old-table tolerances. Each line was checked again against origin/main at 42e1986 before anything was deleted. The scientific refusals stay, and so do the decided keeps in §11 (_repeat_alias.py, objects).

Commits: 76b4fe7 (sweep), 701d8c4 (owner decision and review fixes). No force-push.

Items

ID Status Change Tests
Sweep MC-1 Done checked_version reads coverage.json schema_version 3 only. Versions 1 and 2 are refused with coverage_version_unknown. The unreachable check for "a block in a version < 3 record" is removed. The schema-2 wording is removed from the described.py docstring, from _missing_reason and from docs/common/data_format.md. A schema-3 export without the block (MorphoFeature writes none for FOVs that do not come from preprocessing) still defaults no control (experiment_block_missing). Versions 1 and 2 are added to the unknown-version refusal test. The blockless tests now use schema 3.
Sweep MC-2 Done html_report(check_source=...) is removed. The source digest is always checked, and a report without a source is refused. _html_page.check_counts is removed too: once the opt-out was gone nothing could reach it, because the digest covers every row of both tables. The opt-out test now asserts the refusal. The size test asserts the digest refusal and a TypeError on check_source.
Sweep MC-3 Done is_uninformative and split_uninformative read uninformative directly. _warning_list and sufficiency_text (review LOW) read warning_list directly, and the joined-warnings fallback is gone. The current writers always set these fields. 5 tests in test_sufficiency.py hand-built rows in the older shape. They now carry uninformative: None.
Q-MC-a Not here redundancy (a plain pd.DataFrame from redundancy_distance, passed by optimise(..., redundancy_bins=...)) records no acquisition identity. The other 18 result types record one. This item moves to a separate follow-up PR. none
Q-MC-b Done repeat_plan raises ValueError for a table missing mean, control_mean, log_ratio_se or difference_se. Before, it planned such a table on Cohen's d without saying so. The fallback to d for non-finite values or errors stays. Each missing column is refused (×4), and a non-finite error still plans on d.
Owner decision on #636 Done repeat_plan refuses a table without d_low, d_high or between_share. Before, a table without d_low got an empty plan with no reason given, and one without between_share had its whole sampling error halved when the fields were doubled. These columns are checked before the empty-table return. across_repeats refuses a table without mean or control_mean. Before, it returned an empty table, as if no condition were compared. It is still empty without a repeat column. Missing values inside these columns are read as before. d_low, d_high and between_share are each refused, with and without rows (×3), and missing values are still read. across_repeats refuses a table without mean or control_mean (×2). The edge golden now uses an empty table instead of one without d_low.

Docs

  • CHANGELOG.md is new, with an Unreleased section. Its items are called "Sweep MC-1/2/3" so they do not clash with the Stage 2 MC-1/MC-2.
  • docs/common/data_format.md is updated.
  • AGENTS.md §7 no longer says _html_page checks the report's counts (review LOW).
  • AGENTS.md §3 (line 48), §5 (line 187) and the shared-column table (line 174) already say what the code does: repeat is refused with a ValueError naming biological_repeat (_repeat_alias.refuse_repeat_alias), and nothing is renamed. They needed no change.
  • docs/common/function_index.jsonl is regenerated.

src/ against origin/main: 10 files, 68 lines added, 74 deleted.

Gate (on 701d8c4, fresh --no-cache-dir venv, Python 3.13)

pytest -n 0 tests/test_guards.py tests/test_function_guards.py tests/test_function_tools.py
102 passed
python tools/audit.py --check-against origin/main
baselines only tightened against origin/main
python -m ruff check src tests data          -> All checks passed!
python -m ruff format --check src tests data -> 534 files already formatted

Whole suite (same tree)

4659 passed, 2 skipped, 6 xfailed in 679s
SKIPPED [2] tests/test_morphobricks_constants.py:21: morphobricks-preprocessing is not installed (MorphoCoverage does not depend on it, D-g)

The data/reference comparison was not run. This PR changes behaviour on purpose, but only for inputs the current writers do not produce.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WX6rdMV1r5jUPUR94kxV5a

MC-1: read coverage.json schema_version 3 only; versions 1 and 2 are refused
(coverage_version_unknown). The schema-2 wording and the unreachable
"block in an older record" check go.

MC-2: html_report loses check_source=False; the source digest is always
checked and a report without a source is refused. The row-count check
(check_counts), reachable only through the opt-out, goes with it.

MC-3: next_fov and final sufficiency rows are read as the current writers
write them (uninformative, warning_list); the older-table tolerance and the
joined-warnings fallback go.

Q-MC-b: repeat_plan refuses a contrast table without mean, control_mean,
log_ratio_se or difference_se instead of planning it on Cohen's d. The
fallback to d for non-finite values or errors stays.

Q-MC-a is not done: the redundancy result (a plain DataFrame from
redundancy_distance, passed by optimise with redundancy_bins) records no
acquisition identity.

Adds CHANGELOG.md (Unreleased) and regression tests for the new refusals.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WX6rdMV1r5jUPUR94kxV5a
Owner decision on #636:
- repeat_plan refuses a table without d_low, d_high or between_share
  (without d_low it returned an empty plan silently; without between_share
  twice the fields halved the whole sampling error). The columns are checked
  before the empty-table return.
- across_repeats refuses a table without mean or control_mean (it returned an
  empty table, as if nothing were compared).

Review LOWs: sufficiency_text reads final["warning_list"] directly; AGENTS.md
no longer says _html_page checks the report's counts. AGENTS.md sections 3
and 5 already describe the repeat refusal as the code does it.

CHANGELOG: the items are "Sweep MC-1/2/3", apart from the Stage 2 MC labels.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WX6rdMV1r5jUPUR94kxV5a
@guijacquemet
guijacquemet merged commit 9217840 into main Nov 14, 2026
2 checks passed
@guijacquemet
guijacquemet deleted the claude/mc-compat-sweep branch November 14, 2026 02:11
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.

2 participants