Repository navigation
Reconciliation of the published description with the folder (Stage 1, PR 9) - #193
Merged
Merged
Conversation
Units are unchanged, new or removed by exact folder labels; N35 reopening keeps confirmed_on; renamed folders resolve only by an explicit statement; removals come back as one grouped question per condition. Fixes the condition-folder layout in the transition date check (P33 b). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Scma6W3LC11s3qjXHZuGDm
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Scma6W3LC11s3qjXHZuGDm # Conflicts: # CHANGELOG.md
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.
What changed
Stage 1 design PR 9 (§5 row 9): reconciliation, conformance P07, P08, P15, P33. Built on the merged publication code (
publish_description,description_transition,morphobricks.records.jsonl); it does not depend on the open PRs #190, #191, #192.description_reconcile.reconcile(published, observed, renames=()): each unit isunchanged,neworremoved, matched only by its exact source folder labels. N35 reopening (draftconfirmed = false,confirmed_oncopied from the published file) only for a new unit beside a confirmed member, a removed unit, channel evidence that no longer fits the declared list, or a folder the user stated was renamed. A change ofimage_countalone reopens nothing (Spec §10): it is reported asCountChangeand the member's count follows the folder.FolderRenamestatement (with the user's date) ties the new folder to the old entity, and only when the old folder is gone and the new one is there. A new folder is proposed only for an existing repeat ID equal to its label.description_removal:candidate()is the draft;removal_questions()returns one grouped question per condition with every re-confirmation its removal needs (lost repeat, technical repeats, channels), so the notebook shows one question;reconfirmations()turns the user's answers into theReconfirmationrecordspublish_descriptiontakes. Removed IDs stay inused_ids; areferenceto a removed condition is never cleared silently (the candidate refuses).reconcile_observe.observe_folders(discovery): image counts per unit from a folder walk.description_transition):confirmed_oncould not move with the user's new confirmation after a condition ID got another folder (P33 b: "N35 reopened for the affected repeats"), because the compared layout left out the condition's source folder._layoutis now the publicrepeat_layout(description, key)and includes it.Part of the Stage 1 design (no issue of its own). Not used by any run, notebook or CLI command yet.
Regression test
tests/test_condition_folder_reopens.py::test_a_new_confirmation_date_is_accepted_after_a_condition_folder_changed. On the olddescription_transition.pyit fails (R_CONFIRMED_ON_CHANGEDis reported); on the new code it passes. The rest of the new tests (tests/test_spec_reconcile.py, 25 tests, named by scenario P07, P08, P15, P33;tests/test_reconcile_observe.py, 2 tests) cover new modules, so they have no old-code behaviour to fail on.Checks
python tools/check.pyon this branch: Ruff clean, code rules clean, 3849 passed, 4 skipped, 2 warnings. The 4 skips are the same ones as onorigin/main(3820 passed, 4 skipped): case-sensitive file system (3) and running with permissions that ignore file modes (1).Not done here (open points)
morphobricks.records.jsonl: Spec §10 says "reported and recorded", but §4.6 defines records only for re-confirmations. Needs an owner decision on the record type.R_CONFIRMED_ID_CHANGEDin the merged transition check, so no record is written for it. The user's "Yes, remove" is still required bycandidate(), but the record only exists for IDs the transition check calls changed.R_*refusals of Physical R_* checks of an experiment description (Stage 1, PR 8) #192; they are not modelled here.Generated by Claude Code