Repository navigation
Tag by repeat: override a listed unit from the row's tags, confirmed by the user - #376
Draft
guijacquemet wants to merge 6 commits into
Draft
guijacquemet wants to merge 6 commits into
guijacquemet wants to merge 6 commits into
Conversation
…by the user A unit whose header disagrees with its repeat's row can be overridden from the list: the editor starts from the row's tags, highlights the header disagreements, and the unit counts as tagged only after Confirm. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Scma6W3LC11s3qjXHZuGDm
…; one-click confirm Aliases saved by confirming or tagging another refused unit no longer clear its refusal, tag it in fast mode, or change its highlights and refusal text: the refusal keeps the aliases of its time (Refusal.channels), fast mode skips units whose refusal stands (RepeatRows.standing), and a row re-click reads them against that snapshot (repeat_fill frozen). The confirmation record is the unit's tags and own header names, read before the save (Override.names). A listed unit with the same header names as a confirmed unit offers "Confirm the same tags" and, for several, "Confirm all N like it", through the editor's own validation and save (all or none). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Scma6W3LC11s3qjXHZuGDm
…ad the current reference A refused unit counts only when that unit is confirmed, in every session: - refusals and confirmations are kept in the draft file (optional tag_review, version still 4, read strictly) and restored on opening before headers are trusted, so a kernel restart no longer lets aliases saved for one confirmed unit tag another refused one; - a label renamed or removed after a refusal opens the override cell blank instead of raising (and wedging every later redraw); one-click never offers a label that is gone; - standing() reads the row's current reference unit, as reconcile does; - "Confirm all N" buttons keep the order of the listed units; - docs: a unit tagged by hand is not a source of "Confirm the same tags". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Scma6W3LC11s3qjXHZuGDm
The refusals and confirmations in memory outlived the draft they came from: a notebook pointed at another folder or output kept them, so they blocked the new draft's saved review, tagged its refused unit from aliases and were written over its file. The review now remembers the draft (experiment folder and draft file); another draft drops it and restores its own, before headers are trusted, and nothing is persisted into a draft it did not come from. A failed save of the review shows a line on the grid and is retried at the next change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Scma6W3LC11s3qjXHZuGDm
…raft before Pointing only the output folder at another draft of the same experiment kept the channel grid open with the first draft's tag review in memory, so the statement toggle tagged the second draft's refused unit and the save gate read an empty list. - The channel screen's reopening key includes the draft, so the grid reopens and restores that draft's own record. - trust_headers restores first when the memory is another draft's. - The save stays refused while the memory belongs to another draft. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Scma6W3LC11s3qjXHZuGDm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Owner requirement
A unit (condition / biological repeat / technical repeat) whose image headers disagree with its repeat's row is listed. From the listed unit the user can override that unit, starting from the row's tags (prefilled), with header disagreements highlighted, so that only what is different is changed. The unit counts as tagged only after the user confirms. Channels are never guessed and no unit is counted without confirmation.
Owner decision (22 Nov): a refused unit is never counted until the user confirms THAT unit; a listed unit with the same header names as a confirmed one offers one-click confirmation.
Design
repeat_tags.py(pure):Override(tags, names)andoverride_holds(override, layout, tags): the confirmation holds while the unit's tags and its own header names are unchanged (the names are read before the save). Later aliases neither void nor replace it.repeat_fill(..., frozen=)reads an already refused unit against the aliases of its refusal.notebook_channels_repeat.py:Refusal.channelsis the labels/aliases snapshot at the first refusal.contradictions()(one rule,differences, on that snapshot) is used byreconcile(), so a refusal keeps its text and is never dropped because another unit's aliases were saved.standing()returns the refused units whose refusal still stands.apply()keeps the first snapshot, so re-clicking the row does not fill a refused unit either._row_error/_commit_userare shared.notebook_channels_matrix.trust_headers(the only caller oftrusted()with the grid) leaves outRepeatRows.standing(). Fast mode's trust of headers for every other unit, and hand-tagging, are unchanged. A refusal clears only by the unit's removal, by a change of the images' headers that resolves it (as before), or by confirming that unit.notebook_channels_override.py: highlights and refusal text come fromRefusal.channels(the editor keeps its orange boxes)._confirm()is the one path (validate all, one_commit_user, recordOverridefrom the unit's header names) for Confirm these tags, Confirm the same tags and Confirm all N like it (offered when several listed units share the headers; all or none). The one-click sentence is "same headers as , which you confirmed as "; it is offered only when every header name is present, the confirmation still holds, and the confirmed units with those names agree on the tags.Tests
tests/test_notebook_tag_by_repeat_oneclick.py(9 tests, new) and the override tests: fast mode GONE confirmed (editor or by hand) then re-check: OTHER stays listed, untagged, grid incomplete, save refused, row re-click does not fill it; one-click counts OTHER with the confirmed tags and saves; confirm all with three units; confirm-all refused with none confirmed (validation and failed save); strict mode OTHER keeps its header-detail text and highlights; a refused unit whose own header changes to match its row still clears through the row; non-refused behaviour unchanged. 8 of the 9 new tests fail on 2bffeb5 (the 9th, the header-change regression guard, passes on both). Focused run (test_notebook_tag_by_repeat*.py, matrix, shadow, untick, dataset,test_notebook_channels*.py): 139 passed, none skipped.tools/check.py --rulesand ruff pass. The fulltools/check.pywas not run.Review fixes (893264d)
notebook_channels_override.py): the editor opens a cell whose label is gone blank (_known), also when the label changes while the editor is open; the one-click offer already skipped tags that are no longer labels. Before, the dropdown raised and every later redraw raised too.tag_review(repeat_review.py, pure; read and written indraft_format.py;docs/contract.mdsection 18). Draft version stays 4, a draft without it opens as before, an empty review writes nothing, and a malformed section is refused with the file, never dropped.RepeatRows.restoreruns on the first opening, beforetrust_headers;reconcilethen runs as usual.RepeatRows.persistsaves it after a row click, a confirmation and a reconcile, only when it changed.standing()reads the row's current reference unit, asreconciledoes (shared_placed).Tests:
tests/test_notebook_tag_by_repeat_review.pyandtests/test_draft_tag_review.py(new). All but the one-click label guard and the draft-format cases that need the new module fail on 4bdb64e. Focused run (tag-by-repeat, matrix, shadow, untick, channels, dataset, all draft tests and the notebook draft readers): 510 passed.tools/check.py --rulesand ruff pass; the fulltools/check.pywas not run.Review fixes (76ea216)
TagGrid/RepeatRowslive for the whole notebook, so refusals and confirmations from folder A blocked B's savedtag_review, lettrust_headerstag B's refused unit from aliases, and were written over B's file.RepeatRowsnow remembers the draft it holds (_NotebookStore.draft_id(): resolved experiment folder and draft file path).TagGrid.opensees another draft (other_draft()),restoredropsrefused/confirmed/editor/row state and reads the new draft's own review (empty without one), beforetrust_headers.persistnever writes while memory is another draft's;listed/standingignore it until the grid reopens.persist()returns False and the tagging grid shows "Not saved" until a later persist succeeds.Tests:
tests/test_notebook_tag_by_repeat_drafts.py(5 new; 4 fail on 893264d). Focused run (tag-by-repeat, channels, dataset, draft tests, matrix/shadow/untick, masks screen): 500 passed.tools/check.py --rulesand ruff pass; the fulltools/check.pywas not run here.Review fix (3ac71c8): output-only switch
Pointing only the output folder at another draft of the same experiment kept the grid open with the first draft's memory (the channel screen's reopening key had no draft), so the statement toggle tagged the second draft's refused unit and the save gate read an empty list. Fixes: the draft is part of the reopening key (the grid reopens and restores);
MatrixView.trust_headersrestores first whenother_draft(); the save is refused while the memory is another draft's.Tests: 4 new in
tests/test_notebook_tag_by_repeat_drafts.py, all fail on 76ea216. Focused run (tag-by-repeat, draft tag review, channels, check-save): 138 passed.tools/check.py --rulesand ruff pass; the fulltools/check.pywas not run.Generated by Claude Code