020 subject serialization#31
Conversation
…nd-trip capabilities
There was a problem hiding this comment.
Pull request overview
This PR implements comprehensive subject identity and serialization capabilities for the gram-hs library, enabling robust round-trip serialization of graph patterns. The feature introduces automatic identity generation for anonymous subjects using a sequential ID strategy with the #<N> format.
Key Changes:
- Stateful identity generation for anonymous subjects using
Statemonad, ensuring unique IDs within each parse operation - Enhanced serialization with escape sequence support for control characters and special handling for implicit root patterns
- Comprehensive test coverage including property-based testing for round-trip verification and collision avoidance
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
| specs/020-subject-serialization/*.md | Complete feature specification including tasks, research, data model, and API contracts |
| libs/gram/src/Gram/Transform.hs | Implements stateful ID generation using #<N> format with collision detection |
| libs/gram/src/Gram/Serialize.hs | Enhanced with control character escaping and implicit root serialization |
| libs/gram/src/Gram/Parse.hs | Minor update to handle optional comma separators between patterns |
| libs/gram/tests/Spec/Gram/SerializeSpec.hs | Added property tests and round-trip verification with QuickCheck generators |
| libs/gram/tests/Spec/Gram/ParseSpec.hs | Updated all tests to verify generated #<N> IDs for anonymous subjects |
| libs/gram/gram.cabal | Added QuickCheck dependency for property-based testing |
| TODO.md | Updated to reflect completion of Feature 20 |
| .cursor/rules/specify-rules.mdc | Added feature context to development guidelines |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@akollegger I've opened a new pull request, #32, to work on those changes. Once the pull request is ready, I'll request review from you. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Andreas Kollegger <akollegger@gmail.com>
|
@copilot open a new pull request to apply changes based on the comments in this thread |
|
@akollegger I've opened a new pull request, #33, to work on those changes. Once the pull request is ready, I'll request review from you. |
Co-authored-by: akollegger <53756+akollegger@users.noreply.github.com>
docs: align identity format spec with implementation (#<N>)
No description provided.