Skip to content

018 pattern path semantics#24

Merged
akollegger merged 28 commits intomainfrom
018-pattern-path-semantics
Nov 29, 2025
Merged

018 pattern path semantics#24
akollegger merged 28 commits intomainfrom
018-pattern-path-semantics

Conversation

@akollegger
Copy link
Copy Markdown
Contributor

No description provided.

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

This PR implements semantic validation for the Gram language, introducing a new validation module that enforces pattern and path notation semantics including single definition rules, referential integrity, and consistency checks between mixed notations.

Key Changes:

  • Added Gram.Validate module with core validation logic for patterns and paths
  • Created comprehensive design documentation defining semantic rules (SEMANTICS.md and EXTENDED-SEMANTICS.md)
  • Added test suite with 12 test cases covering basic patterns, path notation, and mixed notation validation

Reviewed changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
libs/gram/src/Gram/Validate.hs New validation module implementing symbol table, error types, and two-pass validation (registration + checking)
libs/gram/tests/SemanticsSpec.hs New test suite covering basic pattern validation, path notation, and mixed notation consistency
libs/gram/src/Gram.hs Updated module exports to include Gram.Validate (missing Gram.Parse export)
libs/gram/src/Gram/CST.hs Added Ord instance to Identifier type for use in Map keys
libs/gram/src/Gram/Parse.hs Qualified imports for Value types from Subject.Value module to avoid conflicts
libs/gram/gram.cabal Added Gram.Validate module, SemanticsSpec test, and mtl dependency
design/SEMANTICS.md New comprehensive documentation of pattern semantics and fundamental rules
design/EXTENDED-SEMANTICS.md New detailed documentation of pattern-path integration and edge cases
specs/018-pattern-path-semantics/*.md Complete specification files including spec, tasks, research, plan, quickstart, data model, and contracts
cabal.project.local Configuration to enable tests
.cursor/rules/specify-rules.mdc Updated recent changes section with feature reference

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread libs/gram/src/Gram.hs
Comment thread libs/gram/src/Gram.hs
Comment thread specs/018-pattern-path-semantics/research.md Outdated
Comment thread libs/gram/src/Gram/Validate.hs Outdated
Comment thread libs/gram/tests/SemanticsSpec.hs Outdated
Comment thread libs/gram/src/Gram/Validate.hs Outdated
Comment thread libs/gram/src/Gram/Validate.hs
Comment thread libs/gram/src/Gram/Validate.hs
Comment thread specs/018-pattern-path-semantics/quickstart.md Outdated
Comment thread libs/gram/gram.cabal Outdated
Copy link
Copy Markdown
Contributor

Copilot AI commented Nov 29, 2025

@akollegger I've opened a new pull request, #25, to work on those changes. Once the pull request is ready, I'll request review from you.

akollegger and others added 7 commits November 29, 2025 13:34
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Andreas Kollegger <akollegger@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Andreas Kollegger <akollegger@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Andreas Kollegger <akollegger@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Andreas Kollegger <akollegger@gmail.com>
Co-authored-by: akollegger <53756+akollegger@users.noreply.github.com>
Update Gram.hs module documentation to include Gram.Validate
Copy link
Copy Markdown
Contributor

Copilot AI commented Nov 29, 2025

@akollegger I've opened a new pull request, #26, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 4 commits November 29, 2025 13:56
… definitions from references

Co-authored-by: akollegger <53756+akollegger@users.noreply.github.com>
Co-authored-by: akollegger <53756+akollegger@users.noreply.github.com>
Fix path-pattern mixing logic in registerRelationship
Copy link
Copy Markdown
Contributor

Copilot AI commented Nov 29, 2025

@akollegger I've opened a new pull request, #27, to work on those changes. Once the pull request is ready, I'll request review from you.

akollegger and others added 5 commits November 29, 2025 14:19
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Andreas Kollegger <akollegger@gmail.com>
… same source/target nodes

Co-authored-by: akollegger <53756+akollegger@users.noreply.github.com>
Co-authored-by: akollegger <53756+akollegger@users.noreply.github.com>
Fix relationship validation to track endpoints for duplicate detection
Copy link
Copy Markdown
Contributor

Copilot AI commented Nov 29, 2025

@akollegger I've opened a new pull request, #28, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 2 commits November 29, 2025 14:37
Co-authored-by: akollegger <53756+akollegger@users.noreply.github.com>
Fix quickstart example to use Megaparsec parse function correctly
Copy link
Copy Markdown
Contributor

Copilot AI commented Nov 29, 2025

@akollegger I've opened a new pull request, #29, to work on those changes. Once the pull request is ready, I'll request review from you.

@akollegger akollegger merged commit bda7371 into main Nov 29, 2025
1 check passed
@akollegger akollegger deleted the 018-pattern-path-semantics branch November 29, 2025 15:01
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.

3 participants