Skip to content

Conversation

@konard
Copy link
Member

@konard konard commented Sep 10, 2025

Summary

This PR implements storable transformation patterns as requested in issue #3. The feature allows users to store LiNo queries as transformation patterns that are automatically executed whenever data store changes occur.

Key Features

  • --always option: Store a query as a transformation pattern
  • --never option: Remove a stored transformation pattern
  • --patterns-file option: Specify custom patterns file location (defaults to patterns.json)
  • Automatic execution: Stored patterns are applied on any data store changes
  • JSON persistence: Patterns stored with metadata (ID, description, timestamp, active status)
  • Separate storage: Patterns can be stored in separate files to avoid making the links network dynamically programmable

Usage Examples

Store a transformation pattern

clink '((1 1)) ((1 2))' --always --changes

Remove a transformation pattern

clink '((1 1)) ((1 2))' --never

Use custom patterns file

clink '((2 2)) ((2 3))' --always --patterns-file my_patterns.json

Implementation Details

  • Created StorablePatternManager class for pattern management
  • Updated Program.cs to handle new command-line options
  • Added comprehensive test coverage with StorablePatternManagerTests
  • Patterns automatically applied via ChangesHandler callback
  • Version bumped to 2.3.0 for this feature release

Test Plan

  • Pattern storage and retrieval functionality
  • Automatic pattern execution on data changes
  • Pattern removal functionality
  • Custom patterns file support
  • Error handling for corrupted pattern files
  • Persistence across application instances
  • Integration with existing CLI functionality
  • Manual testing with example scripts

🤖 Generated with Claude Code


Resolves #3

Adding CLAUDE.md with task information for AI processing.
This file will be removed when the task is complete.

Issue: #3
@konard konard self-assigned this Sep 10, 2025
konard and others added 2 commits September 10, 2025 17:50
- Add --always option to store queries as transformation patterns
- Add --never option to remove stored transformation patterns
- Add --patterns-file option to specify custom patterns file location
- Create StorablePatternManager class for managing pattern persistence
- Patterns are automatically applied on any data store changes
- Support for JSON-based pattern storage with metadata
- Add comprehensive tests for pattern storage functionality
- Add example scripts demonstrating pattern usage
- Update documentation with new features and examples
- Bump version to 2.3.0 for new feature release

Resolves #3: Support storable transformation patterns

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@konard konard changed the title [WIP] Support storable transformation patterns Implement storable transformation patterns Sep 10, 2025
@konard konard marked this pull request as ready for review September 10, 2025 15:03
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.

Support storable transformation patterns

2 participants