Repository navigation
Publication writes the removed and image_count_changed records (RR2, RR1) - #216
Merged
Merged
Conversation
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
…75e0e Owner decision RR3 (Spec PR 13): image_count_changed is written for every confirmed member whose image_count changed, also when the same publication changes other things. Members are matched through the confirmed ID corrections; a member the candidate no longer holds is covered by its removed records. Vendored Spec re-pinned to 2975e0e. 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.
What changed
publish_descriptionnow writes the two Spec record types that it did not write before (experiment-v1 §4.6, §10, vendored at 2975e0e), in the same single atomic append as thereconfirmationrecords (all or nothing with the TOML, rollback unchanged).New parameters:
removals: tuple[Removal, ...] = ()(the user's confirmations with their dates, the existingdescription_removal.Removal) andrecorded_on: str | None = None, onpublish_descriptionand onpublish_locked(added to main by the draft-file PR; the merge of main keeps both). New pure modulerun/description_records.pyderives the lines by comparing the candidate with the published file. No code reads the clock.removed(RR2).unitline with all six keys, labels exactly as in the published file.null). Entity lines come first (condition, repeat, technical repeat, each by ID), then unit lines once each, by (condition ID, repeat ID, technical repeat ID).confirmed_onis the date of the first removal answer that names one of its units.ValueErrorbefore anything is written. Refusals (R_*) still take priority.image_count_changed(RR1, RR3). One line per member of a confirmed repeat whoseimage_countchanged, whether or not the same publication changes anything else (a removal, a new member, an ID correction, a reopening). Members are matched through the confirmed ID corrections; a member the candidate no longer holds has no new count and is covered by itsremovedlines. Lines carry the published IDs and labels, ordered by (condition ID, repeat ID);technical_repeatsis[{"id","source_folder"}]sorted by ID. A count change alone still reopens nothing and needs no confirmation.recorded_onis required when any line is due and must be a realYYYY-MM-DDdate (ValueErrorotherwise, nothing written); it is never copied intoconfirmed_on.Order in the appended block: reconfirmations, removed, image_count_changed.
Vendored Spec re-pinned to 2975e0e
Done as in #208:
tests/spec_fixtures/PIN.toml(commit,fixtures_tree, blob ofdocs/experiment-v1.md;tools/audit/refval.pyblob is unchanged), the copieddocs/experiment-v1.mdandfixtures/README.md(the only fixture-side file that differs; no fixture or validator changed), andSPEC_COMMITindraft_format.pywithdocs/conformance.md. Every fixture is exact; the cross-check against the reference validator has 0 differences (37 valid, 135 invalid, 13 transitions, round trip on 50 files).Existing tests changed
test_p15_new_fovs...(now expects theimage_count_changedrecord, and the missing-date error),test_p08_...,test_removing_a_condition_...andtest_p20_removing_the_last_member...now passremovals=(without it a dropped unit has no confirmation date, which the Spec requires).test_a_removed_technical_repeat_...removes a unit of a member, so that member's count falls with it: it used to publish with no count line and now passesrecorded_onand asserts the count line is written (RR3). The new moduletests/test_spec_records.pyis added toEXPECTED_MODULES.run/description_recordsis registered as apurelayer.Regression tests
tests/test_spec_records.py(14 tests): removed unit, repeat, condition and technical repeat with exact lines; canonical JSON text withnullkeys andread_records; the user's date, not the clock; unconfirmed or foreign removal refused; nothing written on refusal; rollback when the records write fails; image-count line (old/new counts,recorded_on, noconfirmed_on), date required, multi-member order; and the RR3 testtest_a_removal_and_a_count_change_in_one_publication_write_both_in_order(a removal and count changes of two members in one publication write theremovedlines then theimage_count_changedlines, in order, and they passread_records).image_count_changedline written beside the removal). The original RR1/RR2 regression run against the old source (e1d7c18) was 17 failed, 42 passed.python tools/check.py: ruff check and format clean, 4569 passed, 4 skipped (the 4 skips are file-system-case and file-mode tests, pre-existing), code rules clean. The PR was previously reported at 4233 passed, 4 skipped; the difference is the tests main gained in the meantime plus the one new test here.Other open preprocessing PRs will conflict on CHANGELOG; both entries were kept in the merge of main.
Owner decisions (2026-11-08)
2975e0e):image_count_changedis written for every confirmed member whoseimage_countchanged at a publication, even when the same publication changes other things. A count change alone still reopens nothing and needs no confirmation. Implemented here; before this change the line was written only when nothing else in the file differed.🤖 Generated with Claude Code
https://claude.ai/code/session_01Scma6W3LC11s3qjXHZuGDm