Skip to content

Implement persistent transformation triggers#55

Merged
konard merged 4 commits intomainfrom
issue-3-af35a436
May 8, 2026
Merged

Implement persistent transformation triggers#55
konard merged 4 commits intomainfrom
issue-3-af35a436

Conversation

@konard
Copy link
Copy Markdown
Member

@konard konard commented Sep 10, 2025

Summary

This PR implements issue #3 as optional persistent transformation triggers backed by links storage rather than JSON files.

  • Adds PersistentTransformationDecorator to store and apply Once and Always triggers.
  • Stores trigger metadata as binary links using the schema Type -> Trigger, Trigger -> Once, Trigger -> Always, Type -> Condition, and Type -> Substitution.
  • Supports trigger roots shaped as (Once ((Condition ...) (Substitution ...))) and (Always ((Condition ...) (Substitution ...))).
  • Adds CLI options --always, --once, --never, --triggers, --triggers-file, and --embed-triggers.
  • Uses a companion <database-name>.triggers.links file by default, while --embed-triggers stores triggers in the main .links database.
  • Applies stored triggers after write operations and deletes Once triggers after their first successful application.
  • Updates named-link lookup so external schema names can coexist with internal Unicode string storage names.

Test Plan

  • dotnet test from csharp/
  • dotnet build --configuration Release from csharp/
  • bash examples/test_storable_patterns.sh

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 <noreply@anthropic.com>
@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
@konard
Copy link
Copy Markdown
Member Author

konard commented May 8, 2026

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
Trigger -> Once
Trigger -> Always
Type -> Condition
Type -> Substituion

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.

@konard konard marked this pull request as draft May 8, 2026 13:20
@konard
Copy link
Copy Markdown
Member Author

konard commented May 8, 2026

🤖 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.

@konard konard changed the title Implement storable transformation patterns Implement persistent transformation triggers May 8, 2026
@konard konard marked this pull request as ready for review May 8, 2026 13:43
@konard
Copy link
Copy Markdown
Member Author

konard commented May 8, 2026

Working session summary

Implemented and pushed the replacement for the stale JSON approach.

PR #55 is ready for review and clean to merge:
#55

What changed:

  • Added PersistentTransformationDecorator with binary links-backed Once and Always triggers.
  • Added CLI options: --always, --once, --never, --triggers, --triggers-file, --embed-triggers.
  • Updated docs, example script, and C# changeset.
  • Added unit and CLI integration tests.

Verification:

  • dotnet test from csharp/: passed, 184 tests.
  • dotnet build --configuration Release from csharp/: passed.
  • bash examples/test_storable_patterns.sh: passed.
  • Fresh GitHub CI on commit fb13256: C# CI/CD and WebAssembly CI both passed.
  • PR merge state is now CLEAN, draft disabled.

This summary was automatically extracted from the AI working session output.

@konard
Copy link
Copy Markdown
Member Author

konard commented May 8, 2026

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Model: GPT-5.5
  • Provider: OpenAI
  • Public pricing estimate: $16.830530

📊 Context and tokens usage:

  • 347.4K / 1.1M (33%) input tokens, 47.7K / 128K (37%) output tokens

Total: (347.4K + 11.2M cached) input tokens, 47.7K output tokens, $16.830530 cost

🤖 Models used:

  • Tool: OpenAI Codex
  • Requested: gpt-5.5
  • Model: GPT-5.5 (gpt-5.5)

📎 Log file uploaded as Repository (52550KB)


Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard
Copy link
Copy Markdown
Member Author

konard commented May 8, 2026

✅ Ready to merge

This pull request is now ready to be merged:

  • All CI checks have passed
  • No merge conflicts
  • No pending changes

Monitored by hive-mind with --auto-restart-until-mergeable flag

@konard konard merged commit b5e1f0f into main May 8, 2026
11 checks passed
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

1 participant