033 pattern graph#60
Merged
akollegger merged 5 commits intomainfrom Feb 18, 2026
Merged
Conversation
… to gram but _not yet_ serialization from a generic, programmatically created PatternGraph with a non-Subject value
Contributor
There was a problem hiding this comment.
Pull request overview
Introduces Feature 33 (“PatternGraph”): a new pattern-library container for graph-shaped Pattern v data (nodes/relationships/walks/annotations) with merge-on-insert semantics, plus documentation/spec artifacts and integration/property/unit tests to support gram round-tripping.
Changes:
- Added
Pattern.PatternGraphmodule and exported it fromlibs/pattern/pattern.cabal. - Added
patterntest coverage (unit + property) and agramround-trip integration test usingPatternGraph. - Added feature documentation (usage + reference +
.graph.gramsubset) and spec/planning artifacts underspecs/033-pattern-graph/.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| specs/033-pattern-graph/tasks.md | Task breakdown for implementing PatternGraph feature |
| specs/033-pattern-graph/spec.md | Feature requirements, scenarios, and success criteria |
| specs/033-pattern-graph/research.md | Design decisions (total merge API, reconciliation reuse, GraphLens conversion) |
| specs/033-pattern-graph/quickstart.md | Quick-start workflow and examples |
| specs/033-pattern-graph/plan.md | Implementation plan and constitution checklist |
| specs/033-pattern-graph/data-model.md | Data model/invariants for PatternGraph |
| specs/033-pattern-graph/contracts/Pattern-PatternGraph.hs | Public API contract sketch for Pattern.PatternGraph |
| specs/033-pattern-graph/checklists/requirements.md | Spec quality checklist |
| libs/pattern/tests/Test.hs | Registers new PatternGraph test specs |
| libs/pattern/tests/Spec/Pattern/PatternGraphSpec.hs | Unit tests for merge/fromPatterns/classification/toGraphLens |
| libs/pattern/tests/Spec/Pattern/PatternGraphProperties.hs | QuickCheck properties for merge/fromPatterns |
| libs/pattern/src/Pattern/PatternGraph.hs | Core PatternGraph implementation (types, merge, conversion) |
| libs/pattern/pattern.cabal | Exposes Pattern.PatternGraph and adds test modules |
| libs/gram/tests/Spec/Gram/RoundtripSpec.hs | Adds PatternGraph-based gram round-trip integration test |
| docs/reference/graph-gram-notation.md | Defines .graph.gram supported subset and mapping to PatternGraph |
| docs/reference/features/pattern-graph.md | Feature reference documentation |
| docs/guide/pattern-graph-usage.md | Usage guide for constructing/merging/round-tripping |
| .cursor/rules/specify-rules.mdc | Documents new feature metadata in rules index |
…zed graph creation fromPatternsWithPolicy
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.
This pull request introduces the new
PatternGraphfeature (Feature 33), providing a robust Haskell container for graph data based on patterns, with merge-on-insert semantics and a clean workflow for parsing, manipulating, and serializing graph data. The implementation includes the corePatternGraphtype, its associated API, documentation, and integration tests, enabling round-trip workflows and compatibility with existing graph algorithms.The most important changes are:
PatternGraph Implementation and API:
Pattern.PatternGraphmodule, defining thePatternGraphtype, classification system (PatternClass,GraphValue), merge and construction functions (merge,fromPatterns, etc.), reconciliation policies, and conversion toGraphLens. Unrecognized patterns are tracked and never stored.libs/pattern/pattern.cabalfile to export the new module and add corresponding test modules. [1] [2]Documentation:
docs/guide/pattern-graph-usage.md) explaining how to construct, merge, reconcile, and round-tripPatternGraphinstances, including code examples and integration notes.docs/reference/features/pattern-graph.md) detailing types, operations, and related concepts..graph.gramnotation reference (docs/reference/graph-gram-notation.md) specifying the supported subset of gram notation and its mapping toPatternGraph.Testing and Integration:
libs/gram/tests/Spec/Gram/RoundtripSpec.hsto verify parsing, loading, serializing, and reparsing of graphs using the new API. [1] [2] [3]Project Metadata and Rules:
.cursor/rules/specify-rules.mdcto document the new feature, including language/library requirements and test coverage. [1] [2]