Skip to content

Reconciliation of the published description with the folder (Stage 1, PR 9) - #193

Merged
guijacquemet merged 2 commits into
mainfrom
claude/design-reconcile
Nov 7, 2026
Merged

guijacquemet merged 2 commits into
mainfrom
claude/design-reconcile

Conversation

@guijacquemet

Copy link
Copy Markdown
Contributor

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 is unchanged, new or removed, matched only by its exact source folder labels. N35 reopening (draft confirmed = false, confirmed_on copied 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 of image_count alone reopens nothing (Spec §10): it is reported as CountChange and the member's count follows the folder.
  • A renamed folder is a removed unit plus a new pending one, never paired by name. Only a FolderRename statement (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 the Reconfirmation records publish_description takes. Removed IDs stay in used_ids; a reference to a removed condition is never cleared silently (the candidate refuses).
  • reconcile_observe.observe_folders(discovery): image counts per unit from a folder walk.
  • Fix in merged code (description_transition): confirmed_on could 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. _layout is now the public repeat_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 old description_transition.py it fails (R_CONFIRMED_ON_CHANGED is 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.py on this branch: Ruff clean, code rules clean, 3849 passed, 4 skipped, 2 warnings. The 4 skips are the same ones as on origin/main (3820 passed, 4 skipped): case-sensitive file system (3) and running with permissions that ignore file modes (1).

Not done here (open points)

  • Pending new units are not in the draft: they need channels and IDs, which belong to the draft model (Draft description, proposed IDs and legacy design migration (Stage 1, PR 7) #191).
  • Image-count changes are reported but not appended to 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.
  • Removing a whole repeat (or a condition) whose IDs are not reused elsewhere produces no R_CONFIRMED_ID_CHANGED in the merged transition check, so no record is written for it. The user's "Yes, remove" is still required by candidate(), but the record only exists for IDs the transition check calls changed.
  • A condition removal that another condition references cannot complete in this module: the reference has to be changed first, which belongs to the draft model.
  • "Conflicting" units (Spec §10) are the physical R_* refusals of Physical R_* checks of an experiment description (Stage 1, PR 8) #192; they are not modelled here.

Generated by Claude Code

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
@guijacquemet
guijacquemet merged commit e7ed825 into main Nov 7, 2026
7 checks passed
@guijacquemet
guijacquemet deleted the claude/design-reconcile branch November 7, 2026 18:12
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