Implement persistent transformation triggers#55
Conversation
Adding CLAUDE.md with task information for AI processing. This file will be removed when the task is complete. Issue: #3
- 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 <noreply@anthropic.com>
|
This function should be implemented in numbered only mode on top of types decorator, and in named mode on top of named decorator that is on top of typed decorator, in any case this feature should be implemented as decorator, that will be able to monitor all create/update/delete/each operations, and if any operations match them in persistent operations, these persistent operations should be applied. We should have types: Type -> Trigger With numbers in number only mode, and names in named mode. So we should have Once and Always triggers with such structure: (Once ((Condition ...) (Substitution ...))) or (Always ((Condition ...) (Substitution ...))) Once trigger should be itself deleted when triggered. Always trigger just does substitution, if codition matched globally after create/update/delete operations. As it is decorator it should be optional to use it, so we need some options to make sure our links database file will have persistent transformations enabled. And yes we should have option to triggers.links file or use triggers directly embeded in the main .links file, that it should be binary links storage file, not json. |
|
🤖 AI Work Session Started Starting automated work session at 2026-05-08T13:20:06.899Z The PR has been converted to draft mode while work is in progress. This comment marks the beginning of an AI work session. Please wait for the session to finish, and provide your feedback. |
Working session summaryImplemented and pushed the replacement for the stale JSON approach. PR #55 is ready for review and clean to merge: What changed:
Verification:
This summary was automatically extracted from the AI working session output. |
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
📊 Context and tokens usage:
Total: (347.4K + 11.2M cached) input tokens, 47.7K output tokens, $16.830530 cost 🤖 Models used:
📎 Log file uploaded as Repository (52550KB)Now working session is ended, feel free to review and add any feedback on the solution draft. |
✅ Ready to mergeThis pull request is now ready to be merged:
Monitored by hive-mind with --auto-restart-until-mergeable flag |
Summary
This PR implements issue #3 as optional persistent transformation triggers backed by links storage rather than JSON files.
PersistentTransformationDecoratorto store and applyOnceandAlwaystriggers.Type -> Trigger,Trigger -> Once,Trigger -> Always,Type -> Condition, andType -> Substitution.(Once ((Condition ...) (Substitution ...)))and(Always ((Condition ...) (Substitution ...))).--always,--once,--never,--triggers,--triggers-file, and--embed-triggers.<database-name>.triggers.linksfile by default, while--embed-triggersstores triggers in the main.linksdatabase.Oncetriggers after their first successful application.Test Plan
dotnet testfromcsharp/dotnet build --configuration Releasefromcsharp/bash examples/test_storable_patterns.shResolves #3