Skip to content

Description reader: own rule vocabulary; pin path and value of five refusals - #219

Merged
guijacquemet merged 2 commits into
mainfrom
claude/description-rules-source
Nov 8, 2026
Merged

guijacquemet merged 2 commits into
mainfrom
claude/description-rules-source

Conversation

@guijacquemet

Copy link
Copy Markdown
Contributor

Fixes #204

What

  1. Single source of rules (Spec §2.7). description_identity.py imported check_identity_text from discovery.py and SINGLE from normalization. Both items reproduced on current origin/main (ea923b5). description_rules.py already existed as the reader's table of codes and fields; it now also holds MISSING_TEXT, SINGLE and label_refused, and the reader imports only from it. Behaviour is unchanged (label_refused is the same two tests as check_identity_text for text values). tests/test_description_rules_copy.py asserts the copy equals the discovery and normalization values, and that label_refused agrees with check_identity_text on a set of values. description_rules was already listed as pure in [tool.morphobricks.code-rules.layers], so pyproject is unchanged. test_spec_rules_table.py now checks the reader's own MISSING_TEXT against the Spec.
  2. Oracle granularity. tests/test_spec_reader_refusal_paths.py pins the exact path and value set (and count) for E_SOURCE_FOLDER_REUSED (two fixtures), E_SOURCE_FOLDER_CONFLICT, E_SOURCE_REPEAT_REUSED, E_MASK_SOURCE_TYPE_REUSED and E_REFERENCE_CYCLE (two fixtures), using the Spec fixtures that trigger them. It also asserts the cases cover exactly the oracle's COARSE set. The reader's paths were already correct for all five, so no reader bug was found. The new module is registered in tests/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:

Mutation Failing test
E_SOURCE_FOLDER_REUSED (conditions) path source_folder to display_name [i122_two_condition_ids_one_folder]
E_SOURCE_FOLDER_REUSED (technical) path technical_repeats to units [i123_two_technical_repeat_ids_one_folder]
E_SOURCE_FOLDER_CONFLICT path to display_name [i124_one_technical_repeat_id_two_folders]
E_SOURCE_REPEAT_REUSED path to image_count [i74_source_folder_in_two_repeats]
E_MASK_SOURCE_TYPE_REUSED path to representation [i80_mask_source_type_reused]
E_REFERENCE_CYCLE path reference to target [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 in tests/spec_gate.py and one over-long docstring line; both are fixed.


Generated by Claude Code

#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
@guijacquemet
guijacquemet merged commit 1dbb8bd into main Nov 8, 2026
7 checks passed
@guijacquemet
guijacquemet deleted the claude/description-rules-source branch November 8, 2026 04:30
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.

Description reader: rule vocabulary from outside the reader; oracle drops paths for five codes

2 participants