Repository navigation
Conversation
VALUES is optional on SPEC-OBJECT and the parser accepts its absence, but SpecObjectParser.unparse asserted that the parsed node had one, so 'reqif passthrough' failed with an AssertionError on such a document. The assertion is gone; VALUES is still written when the object has attributes, for example ones added after parsing. Refs strictdoc-project#233 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Hq1ACTsK85bRrY28fUQ7b3
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.
Refs #233.
The parsing side of #233 already works on main:
reqif validate --use-reqif-schemaaccepts the document from the issue, andtest_03_missing_values_elementcovers it. Writing the same document back still fails.reqif passthroughon it stops with anAssertionErrorinSpecObjectParser.unparse, which asserted that the parsed SPEC-OBJECT node had aVALUESchild.This drops that assertion. A SPEC-OBJECT without
VALUESis written back without it, so passthrough reproduces the input. If attributes were added to such an object after parsing,VALUESis written beforeTYPE, so they are not lost.Tests:
tests/integration/reqif/SPEC-OBJECTS/02_spec_object_without_values: passthrough of one SPEC-OBJECT with noVALUESand one with<VALUES/>, diffed against the input. It fails on main.test_spec_object_parser.py, one for the plain case and one for an attribute added after parsing. Both fail on main.invoke test-equivalent runs locally: 78 unit tests pass, and the integration suite has 78 passed and 2 failed. The same 2 (commands/dump/01_basic_exampleandexamples/04_convert_reqif_to_json) fail on main in my environment too. ruff check and ruff format are clean, and mypy reports the same 10 errors as main.I left the issue open with "Refs" because I'm not sure whether you consider #233 covered by the parsing change.
I used Claude to help write and test this change.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Hq1ACTsK85bRrY28fUQ7b3