Repository navigation
Description reader: own rule vocabulary; pin path and value of five refusals - #219
Merged
Merged
Conversation
#204) description_identity no longer imports check_identity_text from discovery or SINGLE from normalization (Spec 2.7): description_rules holds MISSING_TEXT, SINGLE and label_refused, and a test keeps them equal to the shared values. Direct reader tests pin the path and value of E_SOURCE_FOLDER_REUSED, E_SOURCE_FOLDER_CONFLICT, E_SOURCE_REPEAT_REUSED, E_MASK_SOURCE_TYPE_REUSED and E_REFERENCE_CYCLE. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Scma6W3LC11s3qjXHZuGDm
…les-source # 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.
Fixes #204
What
description_identity.pyimportedcheck_identity_textfromdiscovery.pyandSINGLEfrom normalization. Both items reproduced on currentorigin/main(ea923b5).description_rules.pyalready existed as the reader's table of codes and fields; it now also holdsMISSING_TEXT,SINGLEandlabel_refused, and the reader imports only from it. Behaviour is unchanged (label_refusedis the same two tests ascheck_identity_textfor text values).tests/test_description_rules_copy.pyasserts the copy equals the discovery and normalization values, and thatlabel_refusedagrees withcheck_identity_texton a set of values.description_ruleswas already listed aspurein[tool.morphobricks.code-rules.layers], so pyproject is unchanged.test_spec_rules_table.pynow checks the reader's ownMISSING_TEXTagainst the Spec.tests/test_spec_reader_refusal_paths.pypins the exact path and value set (and count) forE_SOURCE_FOLDER_REUSED(two fixtures),E_SOURCE_FOLDER_CONFLICT,E_SOURCE_REPEAT_REUSED,E_MASK_SOURCE_TYPE_REUSEDandE_REFERENCE_CYCLE(two fixtures), using the Spec fixtures that trigger them. It also asserts the cases cover exactly the oracle'sCOARSEset. The reader's paths were already correct for all five, so no reader bug was found. The new module is registered intests/spec_gate.py.Guard evidence
Each of the five refusals was temporarily attached to a wrong field in
description_semantics.py(not committed), and the new test failed each time:E_SOURCE_FOLDER_REUSED(conditions) pathsource_foldertodisplay_name[i122_two_condition_ids_one_folder]E_SOURCE_FOLDER_REUSED(technical) pathtechnical_repeatstounits[i123_two_technical_repeat_ids_one_folder]E_SOURCE_FOLDER_CONFLICTpath todisplay_name[i124_one_technical_repeat_id_two_folders]E_SOURCE_REPEAT_REUSEDpath toimage_count[i74_source_folder_in_two_repeats]E_MASK_SOURCE_TYPE_REUSEDpath torepresentation[i80_mask_source_type_reused]E_REFERENCE_CYCLEpathreferencetotarget[i64_reference_cycle]Checks
python tools/check.py: ruff check and format clean,4249 passed, 4 skipped(skips are pre-existing case-sensitivity and file-mode skips), code rules pass. Every Spec fixture is still exact (test_spec_reader,test_spec_refval_crosscheck). An earlier run caught that the new Spec module had to be listed intests/spec_gate.pyand one over-long docstring line; both are fixed.Generated by Claude Code