77 Commits

Author SHA1 Message Date
bdc6958b49
more progress 2025-06-25 13:37:35 -05:00
880affad1c
progress 2025-06-25 13:37:16 -05:00
9957dccddd
fix: improve resolver dependency handling and logging
- Fixed AggregationResolver to properly accumulate values for sum/average/count operations
- Enhanced CustomResolver with detailed debug logging for dependency resolution
- Added execution order logging for better debugging
- Improved error messages and graph visualization in dependency resolution
- Moved valueFromCollapsedDelta to lossless.ts for better code organization
2025-06-25 12:25:40 -05:00
d0941f417e
refactor: optimize lossless view and improve code quality
- Optimize pointer handling and entity reference tracking in Lossless view
- Improve type safety with proper TypeScript types
- Add debug logging for better troubleshooting
- Clean up imports and unused variables
- Update test cases for DeltaBuilder
2025-06-25 11:18:52 -05:00
d7c4fda93e
refactor(resolver): overhaul plugin system and dependency handling
Core Changes:
- Completely rewrote CustomResolver reducer with dependency-ordered processing
- Enhanced plugin initialization with proper dependency injection
- Improved delta processing and property value tracking
- Added robust error handling for duplicate property IDs

Resolver Improvements:
- Updated to use new accumulator structure
- Implemented execution order processing for plugins
- Enhanced debug logging and error reporting
- Simplified TimestampResolver by removing unused initializer

Configuration Updates:
- Added TypeScript path aliases for test helpers
- Improved module resolution paths

Key Benefits:
- More robust plugin dependency management
- More efficient state updates
- Enhanced type safety
- Better error messages and debugging
- More consistent plugin initialization

This refactoring focuses on improving the robustness of the resolver,
especially around plugin lifecycle management and dependency handling.
The changes ensure better separation of concerns and more predictable
behavior when dealing with complex plugin dependencies.
2025-06-25 06:10:34 -05:00
ceb9d9a0cf
Module alias for @src 2025-06-23 03:01:44 -05:00
f6790bf90d
Separated custom-resolver.ts into separate files 2025-06-23 00:16:26 -05:00
cf29338c9b
feat: add plugin dependency support to CustomResolver
- Added  property to ResolverPlugin interface
- Implemented topological sorting for plugin execution order
- Added circular dependency detection
- Updated built-in plugins with dependency declarations
- Added comprehensive tests for plugin dependencies
- Updated documentation with examples and best practices
2025-06-22 23:47:35 -05:00
8de512cd5b
feat: add inter-plugin dependencies to CustomResolver
- Update ResolverPlugin interface with allStates parameter
- Modify CustomResolver to pass all plugin states
- Update built-in plugins for compatibility
- Add comprehensive tests for inter-plugin dependencies
- Add detailed documentation with examples
2025-06-22 23:18:37 -05:00
fa739d047f
remove useless test 2025-06-22 22:59:24 -05:00
65a6230959
Revert changes to CustomResolver 2025-06-22 22:31:22 -05:00
07c8da3cea
removed prior attempt at relationship graph 2025-06-22 22:17:10 -05:00
5afd3232cb
feat: enable inter-plugin state sharing in CustomResolver
- Update ResolverPlugin interface to include context in update and resolve methods
- Modify CustomResolver to pass entity state and resolved values to plugins
- Update built-in plugins to accept and use the new context parameter
- Add comprehensive test for inter-plugin communication
- Add documentation for the new view composition patterns

This change enables plugins to access each other's states during both update and resolve phases, allowing for more powerful and flexible resolver compositions.
2025-06-22 20:42:05 -05:00
a248f1d1a8
minor housekeeping 2025-06-22 20:39:43 -05:00
73d2bf23f5
refactor: simplify relationship graph implementation
- Implement RelationshipGraphResolver extending Lossy
- Add type-safe accumulator for relationship graph state
- Update tests and documentation
2025-06-22 18:39:53 -05:00
76e00f38af
stabilized in prep for continuing on lossy relationship resolver 2025-06-22 14:02:21 -05:00
c04439713c
relationships as domain entities 2025-06-22 02:44:31 -05:00
f4ea2eca39
refactor: replace NegationHelper.createNegation with DeltaBuilder.negate
- Remove NegationHelper.createNegation in favor of using DeltaBuilder's fluent API
- Update all test cases to use createDelta().negate().buildV1() pattern
- Update documentation to reflect the preferred way to create negation deltas
- Remove unused isNegationDeltaById helper method
2025-06-21 22:45:27 -05:00
9f27912c4a
JSON AST first cut 2025-06-21 22:13:20 -05:00
a8d8e71885
removing stale comments 2025-06-21 21:54:20 -05:00
0b58c4cd0e
Minor adjustments to test setup 2025-06-21 18:42:49 -05:00
795551c623
refactor: migrate all delta creation to use DeltaBuilder
- Replace all direct  instantiations with
- Implement proper transaction handling in DeltaBuilder
- Update negation system to work with the builder pattern
- Fix type issues with null values in pointers
- Update all tests to work with the new implementation
- Ensure all tests pass with the refactored code

This change improves code consistency and maintainability by using
a single, fluent API for all delta creation throughout the codebase.
2025-06-20 22:45:10 -05:00
60ad920b30
refactor: update test files to use DeltaBuilder fluent API
- Refactored delta creation in test files to use createDelta() pattern
- Replaced direct Delta instantiations with fluent builder API
- Updated relationship deltas to use setProperty with proper entity context
- Ensured all tests pass with the new delta creation approach

This is part of the ongoing effort to standardize on the DeltaBuilder
API across the codebase for better consistency and maintainability.
2025-06-20 21:40:51 -05:00
5c1c8a23b8
refactor: update delta declarations to use DeltaBuilder in lossless tests
- Refactored delta declarations in __tests__/lossless.ts to use DeltaBuilder
- Added declareTransaction method to DeltaBuilder for better transaction handling
- Updated transaction pointer structure in DeltaBuilder to match expected format
- Fixed related tests to work with the new DeltaBuilder implementation
2025-06-20 11:04:55 -05:00
8043b67258 refactor: simplify DeltaBuilder and update tests
- Removed V1-specific code paths in favor of V2 with toV1() conversion
- Simplified pointer handling to use a single internal representation
- Made entityLabel configurable in setProperty()
- Updated tests to use buildV1() and buildV2() explicitly
- Removed unused time utility module
- Added more comprehensive test coverage for entity properties

This change makes the DeltaBuilder more maintainable by reducing code duplication and following the pattern of building V2 deltas first, then converting to V1 when needed.
2025-06-20 10:40:31 -05:00
3ca8249510 feat: add DeltaBuilder for fluent delta creation
- Implemented DeltaBuilder class with support for both V1 and V2 delta formats
- Added comprehensive test coverage for all builder functionality
- Included utility function for microsecond-precision timestamps
- Added support for transactions and negation via special pointer contexts
- Provides type-safe API for creating deltas with proper validation
2025-06-20 09:24:41 -05:00
c173f3475e
feat(views): add DeltaV2 support to Lossless view
- Update Lossless.ingestDelta to accept both Delta and DeltaV2
- Add conversion from DeltaV2 to DeltaV1 during ingestion
- Add test case for DeltaV2 ingestion
- Ensure backward compatibility with existing DeltaV1 code
2025-06-19 20:57:16 -05:00
87699dd1af
refactor: simplify node startup and improve test reliability
- Remove waitForReady option from RhizomeNode.start() and always wait for readiness
- Update test files to use simplified start() method
- Clean up debug logging in lossless view
- Rename docker orchestrator test file to remove version suffix
2025-06-19 16:58:09 -05:00
be0f0659b9
Remove empty test 2025-06-19 16:58:08 -05:00
c8d38a4af2
refactor: remove dockerOptions and fix resource limits
- Removed unused dockerOptions from DockerOrchestrator and all manager classes
- Updated container-manager to use NanoCpus for CPU limits instead of CpuQuota/CpuPeriod
- Fixed resource limit enforcement in container configuration
- Improved test reliability and error handling
- Cleaned up test files and removed unused code
2025-06-19 16:58:08 -05:00
b5c0c010a9
feat: Refactor Docker orchestrator and enhance test utilities
This commit includes a major refactoring of the Docker orchestrator implementation
along with improvements to the testing infrastructure:

- Refactored Docker orchestrator to handle dynamic port assignment
- Added comprehensive test utilities in docker-test-utils.ts
- Improved error handling and resource cleanup in test environments
- Enhanced NodeStatus interface with containerId and networkId
- Added support for different storage types in NodeConfig
- Fixed request port handling in TestOrchestrator
- Added proper cleanup method to NodeOrchestrator interface

The changes ensure more reliable container management and better test isolation
while maintaining backward compatibility with existing implementations.

BREAKING CHANGE: The NodeOrchestrator interface now requires a cleanup() method.
2025-06-19 16:58:07 -05:00
feb7639978
docker orchestrator is working 2025-06-19 16:58:07 -05:00
b78985779b
Implement Docker orchestrator and fix test infrastructure
- Add DockerOrchestrator implementation with container management
- Refactor InMemoryOrchestrator to use RhizomeNode directly
- Fix orchestrated test files for single and two-node scenarios
- Update package.json with dockerode dependency
- Clean up old test files and imports
2025-06-19 16:58:06 -05:00
6c13f46714
fix(negation): improve negation chain handling and clean up logging
- Refactored isDeltaNegated to properly handle complex negation chains
- Added recursive negation detection to account for negations of negations
- Replaced console.log with debug statements in tests
- Improved test coverage and documentation
- Fixed TypeScript type issues
2025-06-15 14:15:49 -05:00
4b750c593d
feat(query): validate JSON Logic operators and improve error handling
- Add validation for JSON Logic operators in query filters
- Throw InvalidQueryOperatorError for invalid operators
- Improve error handling and logging in applyJsonLogicFilter
- Update tests to verify new error handling behavior
- Fix TypeScript linting issues and improve code style
2025-06-15 14:15:49 -05:00
51d336b88b
feat: handle undefined values in custom resolvers
- Update ResolverPlugin interface to allow resolve() to return undefined
- Modify CustomResolver to skip properties with undefined values
- Add test case for resolvers that return undefined
- Update existing tests to handle cases where no properties are resolved

This change makes the behavior more explicit when resolvers don't return a value,
which is particularly important for numeric aggregations where 0 might be a valid result.
2025-06-15 14:15:48 -05:00
d5cc436bcb
chore: remove unused _RhizomeImports from test files
- Removed unused _RhizomeImports from:
  - __tests__/compose-decompose.ts
  - __tests__/transactions.ts
  - __tests__/negation.ts
- All tests continue to pass after removal
2025-06-15 14:15:48 -05:00
dd8987563a
Fix recursion depth test validity
Previosly a failure to correctly limit the depth might not be detected
2025-06-15 14:15:47 -05:00
885630f4d9
refactor: move CommonSchemas to test-utils
- Moved CommonSchemas from src/schema/schema.ts to src/test-utils/schemas.ts
- Updated all test files to import CommonSchemas from the new location
- Fixed the Document schema to match test expectations by making the author field required
- Added additional fields to the Document schema to match the original implementation
- Ensured all tests pass with the new implementation

Addresses PR feedback that CommonSchemas is only used in tests and should be moved to test files.
2025-06-15 14:15:47 -05:00
08fb5778ba
fix: update comment about LastWriteWins tie-breaking algorithm
Addresses PR feedback about the outdated comment in concurrent-writes.ts. The comment now accurately reflects that the resolution uses the LastWriteWins resolver's tie-breaking algorithm rather than delta processing order.
2025-06-15 14:15:46 -05:00
1c55e95a7b cleanup and levelDB integration 2025-06-09 22:37:51 -04:00
c8488843d2 refactored file structure, added levelDB (needs work) 2025-06-09 21:53:28 -04:00
9a7bd7d3b0 implemented initial query engine and exposed HTTP endpoints 2025-06-09 21:23:18 -04:00
c2f1f537f7 major refactor to shore up some misalignments, ready for phase 3 2025-06-09 20:50:33 -04:00
2dbf9a420a Conflict Resolution strategies completed 2025-06-09 15:01:09 -04:00
c2aae9cfe6 support for negations complete 2025-06-09 13:39:25 -04:00
dc59dcc778 schema foundation support complete 2025-06-09 13:21:52 -04:00
33d4f92f8d transaction support done, deferred rollback 2025-06-09 12:55:15 -04:00
ba9cbc220d delta validation and error handling done 2025-06-09 12:47:37 -04:00
Ladd
c6f6ece504 refactoring in preparation for adding more resolvers 2025-01-02 20:29:26 -06:00