Skip to content

Fixes #258, fixes #252 - #278

Merged
guijacquemet merged 3 commits into
mainfrom
claude/channel-reconfirm
Nov 11, 2026
Merged

guijacquemet merged 3 commits into
mainfrom
claude/channel-reconfirm

Conversation

@guijacquemet

Copy link
Copy Markdown
Contributor

Fixes #258, fixes #252. Base: main 8726cb4 (v0.5.1 release merge). There is one commit per issue: 8fe01c4 (#258) and 3dc0b50 (#252).

Summary

#258: channel re-confirmation after re-ordering a unit's channels (commit 8fe01c4)

Say the images of a saved experiment are re-exported with their channels in another order, and the user re-tags that unit to match. Experiment-v1 §10 reopens that replicate's same way? question. §4.6 (c) refuses the moved channel IDs (R_CONFIRMED_ID_CHANGED) unless a re-confirmation is recorded. Until now, the notebook recorded re-confirmations only for removals and renames.

  • channel_moves.py (pure, new): channel_moves(published, candidate, accepted) finds the confirmed channels in units the candidate still has. A channel is listed only when all of these hold:

    • publication would refuse it as R_CONFIRMED_ID_CHANGED with new_id null;
    • it lost a position;
    • it kept every header name;
    • no removal or rename answer already accepts it.

    Each channel comes with its positions, saved and now. move_confirmations turns the user's click into one Reconfirmation("channels", ID, None, <date of the click>) per channel. It does this only for the moves exactly as they were shown when the user clicked.

    • A lost header name is not offered as a move.
    • Neither is a removed folder; it keeps its own Yes, remove question.
  • Channels step (notebook_channel_moves.py, new): the question sits under the tag grid, in the same single column. It has:

    • one orange line per moved position, e.g. "DNA: ctrl/rep1 channel 1 → channel 2";
    • one question with an explicit Yes, these are the new positions button, and Undo.

    Nothing is ticked for the user. If the order changes again after the click, the question is asked again and Save is disabled until the user answers.

  • Check and save: publication and the pre-save check get the same terms: removals, renames and the confirmed moves (_publication_terms / _removal_terms). The R_CONFIRMED_ID_CHANGED reason now points to the way out: "a channel that moved is confirmed on Channels".

  • CLI describe:

    • A header-only change no longer says "repeat … must be confirmed again". It says the run stops until the headers fit, and how to fix that in the notebook.
    • --publish no longer refuses with "confirm it again". It now says "Nothing to publish: no answer is missing. The run stops until …" and exits with status 0.

    This matches the notebook since Pre-release follow-ups to #254 and #255 #257 (§10: only a change of a unit's ordered channel list, its folders or the pairing reopens a repeat).

#252: small cleanups (commit 3dc0b50)

Item Status in the 7-step app Done
1. PIXEL_CAP docstring still applies docstring fixed: at least one plane of each colour or channel is read, so an RGB 4096² picture reads 3 × 16.7 M pixels; memory stays bounded by one plane within the 64 MiB budget. The module docstring says the same. The cap's behaviour is unchanged.
2. Duplicated non-finite note duplication obsolete: already fixed in batch 34b (_with_missing names it once, and a test pins it). The plural part still applied the note uses validation.plural ("1 non-finite pixel")
3. Absolute paths in Step 1 read failures still applies (the scan's example image and the folder pictures under Images) header_preview.read_failure gives the path relative to the experiment folder. Both call sites use it.
4. replicates_detail not cleared still applies (Check and save keeps the Enlarge view) the view is closed when the replicate boxes show other folders or pictures (a new folder check, another pairing). It stays open when the same boxes are rebuilt by an answer.
5. Reader warnings not shown still applies (no screen showed them) CandidateCheck.warnings comes from read_description_bytes. Check and save lists them as "Valid, with warnings:" in plain words with their code (W_UNUSED_CHANNEL, W_REPEAT_MISSING_CONDITIONS, W_REFERENCE_UNPAIRED). They do not block.

So for #252 nothing remains. The only obsolete part is item 2's repeated note; its plural part was done. I closed nothing myself: the closing keywords take effect on merge.

_saved_status's words moved to notebook_check_view.saved_html because notebook_check_save.py is at the 600-line limit.

Decisions

  • Where the question sits: the re-confirmation is asked on Channels, where the re-order is made, not on Check and save as the issue first proposed. The task asked for this placement.
  • What gets recorded: one reconfirmation line per moved channel, with new_id: null, confirmed_on set to the date of the click, and both SHA-256 values, appended at publication (§4.6).
  • The reopened replicate's date: it gets the date of its same way? answer, as before. Every other replicate keeps its confirmed_on byte for byte.

Notes for review

  • In the issue's scenario (only ctrl/rep1 re-exported, the other folders unchanged), the saved experiment has two channel layouts. It saves, but the Stage 1 run refuses it with R_HETEROGENEOUS_LAYOUT_NOT_ENABLED, which is said beside the button (screenshot 05). A full re-export of every folder is one layout and runs. This behaviour existed before this PR and is not changed here.
  • The blocker line under the disabled Save button still reads "these answers are refused: see the red message above the button". The red message names Channels as the way out.
  • Verification: widgets were tested headless and the screens were rendered through ipywidgets embed in headless Chromium. They were not looked at in a real JupyterLab or Colab.

Evidence

  • Regression tests that fail on main (checked by running them against main's src):
    • tests/test_notebook_channel_moves.py: 4 notebook tests fail on main.

      • The swap resolved by re-ordering plus the click saves with today's date for that replicate only, keeps the other replicate's date, and writes exactly two reconfirmation lines.
      • Without the click, Save stays disabled and nothing is recorded.
      • Undo takes the click back.
      • A later re-order is asked again.
      • There is no question when nothing moved.

      There are also 2 tests of the pure list.

    • tests/test_notebook_small_cleanups.py: 5 tests, all failing on main.

    • The CLI test in tests/test_notebook_prerelease.py was updated to the new wording and exit status, and fails on main.

  • Updated tests: test_notebook_stepper.py (the Channels page now ends with the moves question) and test_preview_render.py ("1 non-finite pixel").
  • Published files are byte-identical where nothing should change. The same answers were published with main and with this branch in three scenarios: a first save, a header rename resolved through header_names, and a confirmed removal. The SHA-256 of morphobricks.toml, experiment_design.csv and morphobricks.records.jsonl is identical in all three.
  • Spec: tests/spec_fixtures/ and tests/test_spec_*.py are untouched, and all of them pass (spec_gate: skips count as failures there).

Tests

python tools/check.py on 3dc0b50 passed:

  • ruff check: all checks passed;
  • ruff format --check: 436 files already formatted;
  • pytest: 5285 passed, 4 skipped;
  • code rules: passed.

The 4 skips are environment-only:

  • test_cli_log.py:166, test_folder_rules.py:199 and test_folder_rules.py:230: "this file system tells names apart by case";
  • test_discovery.py:665: "running with permissions that ignore file modes".

Generated by Claude Code

… channels (#258)

A saved unit re-tagged in another order (its images re-exported with the
channels re-ordered) moves confirmed channel IDs to other positions, which
publication refuses as R_CONFIRMED_ID_CHANGED (experiment-v1 4.6 (c)) unless a
re-confirmation is recorded. The notebook recorded them only for removals and
renames, so Save stayed disabled with no way forward.

- channel_moves.py (pure): the confirmed channels publication would refuse
  for a lost position, inside units the candidate still has, with every header
  name kept and not already accepted by a removal or rename answer; each with
  its positions saved and now. move_confirmations turns the user's click into
  one Reconfirmation per channel (new_id None, the date of the click), only for
  the moves as they were shown when the user clicked.
- notebook_channel_moves.py: under the tag grid of the Channels step, one
  orange list of the moved channels and one explicit question ("Yes, these are
  the new positions", Undo). Nothing is ticked for the user; a move that
  changes after the click is asked again.
- Check and save gives publication and the pre-save check the same terms
  (removals, renames, and the confirmed moves); the R_CONFIRMED_ID_CHANGED
  reason names Channels as the way out.
- CLI describe: a header-only change no longer says the repeat "must be
  confirmed again", and --publish no longer refuses it (section 10, as the
  notebook since #257): it says the run stops until the headers fit.

Tests: test_notebook_channel_moves.py (the swap resolved by re-ordering and
the click saves with today's date for that replicate only, other dates byte
for byte, two reconfirmation lines; without the click Save stays disabled;
Undo; a later re-order is asked again); the CLI test updated to the new words.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G3qp9AxjpGPw9xfWAUJNqc
- Check and save lists the strict reader's warnings of the description
  (W_UNUSED_CHANNEL, W_REPEAT_MISSING_CONDITIONS, W_REFERENCE_UNPAIRED; valid,
  never blocking, experiment-v1 4.3): CandidateCheck.warnings from
  read_description_bytes, worded by description_run_text.reader_warning.
- Check and save closes an Enlarge view when its replicate boxes show other
  folders or pictures (a new folder check, another pairing); the same boxes
  rebuilt by an answer keep it open.
- A preview that cannot be read names the image relative to the experiment
  folder (header_preview.read_failure), in the folder pictures and the scan's
  example image.
- A panel's non-finite note goes through validation.plural ("1 non-finite
  pixel"); the repeated note was already fixed in batch 34b.
- The PIXEL_CAP docstring says that at least one plane of each colour or
  channel is read (an RGB picture of a 4096 x 4096 plane reads 3 x 16.7 M
  pixels; memory stays bounded by one plane within the 64 MiB read budget).
- _saved_status's words move to notebook_check_view.saved_html (the screen
  is at the 600-line limit).

No result or published file changes. Tests: test_notebook_small_cleanups.py.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G3qp9AxjpGPw9xfWAUJNqc
…move unseen (#258)

Section 4.6 keys a re-confirmation by ID, so the Yes, remove of one folder
re-confirmed every channel ID that folder held, and the move of the same
channel in another, still-present folder was published without being shown
or clicked. channel_moves now lists every lost position in a present unit
regardless of removal or rename answers; Save waits until the moves shown are
clicked; an ID already re-confirmed by a removal keeps that one record.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G3qp9AxjpGPw9xfWAUJNqc
@guijacquemet
guijacquemet merged commit b6f821a into main Nov 11, 2026
7 checks passed
@guijacquemet
guijacquemet deleted the claude/channel-reconfirm branch November 11, 2026 02: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.

Notebook: no way to record a channel re-confirmation after re-ordering a unit's channels Notebook small cleanups from the 17c and #249 reviews

2 participants