Skip to content

033 pattern graph#60

Merged
akollegger merged 5 commits intomainfrom
033-pattern-graph
Feb 18, 2026
Merged

033 pattern graph#60
akollegger merged 5 commits intomainfrom
033-pattern-graph

Conversation

@akollegger
Copy link
Copy Markdown
Contributor

This pull request introduces the new PatternGraph feature (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 core PatternGraph type, 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:

  • Added the Pattern.PatternGraph module, defining the PatternGraph type, classification system (PatternClass, GraphValue), merge and construction functions (merge, fromPatterns, etc.), reconciliation policies, and conversion to GraphLens. Unrecognized patterns are tracked and never stored.
  • Updated the libs/pattern/pattern.cabal file to export the new module and add corresponding test modules. [1] [2]

Documentation:

  • Added a usage guide (docs/guide/pattern-graph-usage.md) explaining how to construct, merge, reconcile, and round-trip PatternGraph instances, including code examples and integration notes.
  • Added a feature reference (docs/reference/features/pattern-graph.md) detailing types, operations, and related concepts.
  • Added a .graph.gram notation reference (docs/reference/graph-gram-notation.md) specifying the supported subset of gram notation and its mapping to PatternGraph.

Testing and Integration:

  • Added a round-trip integration test to libs/gram/tests/Spec/Gram/RoundtripSpec.hs to verify parsing, loading, serializing, and reparsing of graphs using the new API. [1] [2] [3]

Project Metadata and Rules:

  • Updated .cursor/rules/specify-rules.mdc to document the new feature, including language/library requirements and test coverage. [1] [2]

… to gram but _not yet_ serialization from a generic, programmatically created PatternGraph with a non-Subject value
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.PatternGraph module and exported it from libs/pattern/pattern.cabal.
  • Added pattern test coverage (unit + property) and a gram round-trip integration test using PatternGraph.
  • Added feature documentation (usage + reference + .graph.gram subset) and spec/planning artifacts under specs/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

Comment thread libs/pattern/tests/Spec/Pattern/PatternGraphProperties.hs Outdated
Comment thread libs/pattern/src/Pattern/PatternGraph.hs Outdated
Comment thread libs/pattern/src/Pattern/PatternGraph.hs Outdated
Comment thread libs/pattern/src/Pattern/PatternGraph.hs Outdated
Comment thread libs/pattern/src/Pattern/PatternGraph.hs Outdated
Comment thread libs/pattern/src/Pattern/PatternGraph.hs Outdated
Comment thread libs/pattern/src/Pattern/PatternGraph.hs Outdated
Comment thread libs/gram/tests/Spec/Gram/RoundtripSpec.hs
@akollegger akollegger merged commit 5747362 into main Feb 18, 2026
1 check passed
@akollegger akollegger deleted the 033-pattern-graph branch February 18, 2026 17:02
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.

2 participants