Commit graph

188 commits

Author SHA1 Message Date
Joe
1406c1a1b7 Refactor instance metadata handling to incorporate glob-ignored children
- Renamed `ignore_unknown_instances` to `suppress_removals` in patch computation logic for clarity.
- Updated tests to reflect the new naming and behavior, ensuring correct handling of instance removals based on `glob_ignored_children`.
- Enhanced API and interface definitions to include `glob_ignored_children`, improving metadata management for instance synchronization.
2026-03-07 12:02:34 -06:00
Joe
3b3bd04fad Enhance initialization and API handling
- Updated the `InitCommand` to conditionally add and commit all changes after initializing a git repository, improving project setup efficiency.
- Modified the API service to include requested IDs in the instance retrieval process, ensuring accurate instance management.

These changes aim to streamline the initialization process and enhance the API's functionality for better user experience.
2026-03-03 08:08:47 -06:00
Joe
c5502191d3 Add syncback command handling to MCP stream and API
- Introduced a new `onSyncbackCommand` option in `McpStream` to handle syncback requests.
- Implemented the `handle_mcp_syncback` function in the API to process syncback requests, including validation and logging.
- Updated the `run_live_syncback` function to return statistics on added and removed files during the syncback process.
- Enhanced the MCP tools list to include the new syncback tool, with corresponding documentation added.

These changes aim to facilitate a complete syncback of the Roblox Studio state to the filesystem, improving project management capabilities.
2026-03-01 18:49:34 -06:00
Joe
fc8a6e9b9c Remove canonicalization functionality from VFS and related components
- Eliminated the `canonicalize` method from the `VfsBackend` trait and its implementations in `InMemoryFs`, `NoopBackend`, and `StdBackend`, simplifying the interface and reducing complexity.
- Updated various parts of the codebase to remove references to canonicalization, including tests and prefetch cache handling, ensuring consistency across the project.
- Adjusted logging and comments to reflect the removal of path normalization logic, enhancing clarity and maintainability.

These changes aim to streamline the VFS implementation by focusing on core functionalities without the overhead of path canonicalization.
2026-03-01 18:42:41 -06:00
Joe
1a03554ee8 Enhance git module performance and improve path collection
- Conducted a complete audit of the git module to leverage the gix API for improved performance, aiming for significant speedups in git operations.
- Updated the `git_changed_files_impl` function to accept project prefixes as a vector of strings, enhancing the flexibility of change detection.
- Made the `collect_path_roots` function public to allow external access for collecting project directory paths.

These changes aim to optimize git operations and improve the overall efficiency of path handling in the project.
2026-03-01 17:43:27 -06:00
Joe
f24e991aca Enhance logging and fix regression in TODO.txt
- Updated the logging format in TODO.txt to provide clearer information about file operations and potential issues, including warnings about lossy string conversions.
- Added a note to address a regression in logging behavior that may affect users relying on specific property formats.
- Refactored the `flatten_tree` function in `git.rs` to improve parameter clarity by renaming the repository argument.
- Updated the `mcp.rs` test to utilize a more concise method for checking integer types in the timeout configuration.
- Introduced a new method in `TestServeSession` to fetch git metadata, improving the test suite's ability to validate git-related functionality.

These changes aim to improve logging clarity, address regressions, and enhance test coverage for git metadata handling.
2026-03-01 17:02:57 -06:00
Joe
491d433a6b Enhance ServeSession to fetch git metadata before initial patch computation
- Updated the `ServeSession:start` function to retrieve git metadata from the API before computing the initial patch. This change ensures that the server information includes relevant git details, improving synchronization accuracy.
- Disabled the polling feature in `App:startSyncReminderPolling` due to performance concerns, as it was deemed unnecessary.
- Adjusted the API service to set `git_metadata` to `None` instead of computing it, streamlining the response handling.

These changes aim to optimize the synchronization process and reduce unnecessary API calls.
2026-03-01 16:49:54 -06:00
Joe
8b4573b578 Refactor logging level from trace to debug for performance improvement
- Updated logging statements in various functions across the ApiContext, ServeSession, and Reconciler modules to use `Log.debug` instead of `Log.trace`.
- This change aims to reduce the verbosity of logs and improve performance by limiting the amount of logged information during execution, while still retaining essential timing information for debugging purposes.
2026-03-01 16:46:19 -06:00
Joe
84253019c2 Refactor PatchTree tests and enhance git index change detection
- Updated the `changedProperties` structure in `PatchTree.spec.lua` to use a nested table format for `Source`, improving data consistency.
- Introduced a new `repStorageId` in `PatchTree.spec.lua` for better instance mapping.
- Refactored the `collect_tree_index_changes` function in `git.rs` to utilize a HashMap for tree entries, streamlining the detection of index changes.
- Enhanced the `flatten_tree` function to improve the collection of paths in the git repository.

These changes aim to improve the clarity and efficiency of both the PatchTree tests and the git index change detection logic.
2026-03-01 14:50:04 -06:00
Joe
a7f721260b Enhance git metadata computation with detailed timing logs and refactor untracked file collection
- Added timing logs to various stages of the `compute_git_metadata` function to improve performance monitoring and debugging.
- Refactored the `collect_untracked_files` function to utilize a set of tracked directories, optimizing the process of identifying untracked files.
- Introduced a new helper function, `compute_blob_object_id`, to streamline blob ID computation for file content.

These changes aim to enhance the efficiency and clarity of git metadata handling within the application.
2026-03-01 14:26:39 -06:00
Joe
3fd50df0b2 Update logging and enhance .gitignore for Atlas directory
- Introduced a logging system using `tracing` and related crates to improve log management and output formatting.
- Updated `.gitignore` to include the `.atlas/` directory, ensuring that log files and other generated content are not tracked by Git.
- Enhanced project templates to include the new `.gitignore` settings for Atlas in various project types.

These changes aim to improve logging capabilities and maintain a cleaner repository by ignoring unnecessary files.
2026-03-01 13:16:00 -06:00
Joe
b5583c4c1b Update dependencies and integrate schemars for JSON schema generation
- Added `schemars` and related dependencies to `Cargo.toml` and `Cargo.lock` for enhanced JSON schema support.
- Updated the `mcp.rs` file to utilize `schemars` for generating JSON schemas for various tool arguments, improving API documentation and validation.
- Enhanced the TODO list to reflect new tasks related to schema documentation and potential improvements in input validation.

These changes aim to improve the overall functionality and usability of the MCP integration by providing better schema definitions for tool arguments.
2026-03-01 12:05:41 -06:00
Joe
fd990b86c6 Enhance MCP tool functionality and improve logging capabilities
- Introduced new MCP tools for executing Luau code, inserting models, and retrieving console output, enhancing the plugin's capabilities for user interaction.
- Implemented a logging system to capture console output and provide detailed feedback during code execution and play mode operations.
- Updated the MCP stream to handle passthrough commands, allowing for better integration of tool commands and improved error handling.
- Enhanced the TODO list to reflect new tasks related to documentation for the added MCP tools and logging features.

These changes aim to improve the overall functionality and user experience of the MCP integration, particularly in script execution and model management.
2026-03-01 11:56:05 -06:00
Joe
fd49602adb Implement get_script command for improved script retrieval in MCP
- Introduced a new `get_script` command to allow agents to read script source code directly from Roblox Studio, enhancing conflict resolution during sync operations.
- Updated the MCP stream handling to support the new command, including error handling for missing or invalid parameters.
- Enhanced the App component to manage the `get_script` command and its response, ensuring proper integration with the existing MCP functionality.
- Updated the TODO list to reflect the addition of the `get_script` command and its associated documentation requirements.

These changes aim to improve the overall functionality and user experience of the MCP integration, particularly in script management.
2026-03-01 09:41:20 -06:00
Joe
9aa3145b06 Enhance MCP sync functionality and improve documentation
- Updated the TODO list to include a task for ensuring well-formed MCP route documentation, enhancing agent usability.
- Modified the MCP stream handling to support additional parameters for sync commands, including mode and overrides for better control during sync operations.
- Introduced a new function to enrich sync changes with filesystem paths, improving traceability of changes.
- Updated API documentation to reflect new sync modes and override capabilities, providing clearer guidance for users.

These changes aim to improve the overall functionality and user experience of the MCP integration and sync process.
2026-03-01 09:19:41 -06:00
Joe
581aeaeffa Enhance MCP stream handling and update TODO list
- Added place ID validation in the MCP stream connection to ensure only whitelisted IDs are accepted, improving security and control over connections.
- Updated the PluginConfig structure to include an optional place ID field, allowing for better configuration management.
- Refined the TODO list to include new tasks related to hash-based comparisons and terminal command execution, enhancing project tracking.

These changes aim to strengthen the MCP integration and improve the overall functionality of the plugin.
2026-03-01 08:17:46 -06:00
Joe
0f5cabb22a Implement MCP integration for AI agents and enhance sync functionality
- Added a new section in the README to document the integration of MCP (Model Context Protocol) for AI agents, detailing how to set up and use the `atlas_sync` tool.
- Introduced `McpStream` to manage WebSocket connections for real-time sync commands between the plugin and the MCP server.
- Enhanced the `App` component to initialize and manage the MCP stream, including handling sync commands and user confirmations.
- Updated the API to support WebSocket upgrades for the MCP stream, allowing for efficient communication with connected plugins.
- Improved the handling of sync commands, ensuring proper responses based on the current connection state and user selections.

These changes aim to facilitate programmatic syncs to Roblox Studio, improving the workflow for teams using AI agents.
2026-03-01 08:11:36 -06:00
Joe
640b2d3d97 Enhance git metadata handling and improve change detection logic
- Introduced a new function `getGitMetadata` in `ApiContext` to fetch current git metadata, including new file IDs.
- Updated the `PatchTree.build` function to handle new file IDs, allowing for better differentiation between tracked and untracked files during patch processing.
- Modified the `git_changed_files` function to return both tracked and untracked files, improving accuracy in change detection.
- Enhanced the `App` component to debounce git metadata refreshes, ensuring the UI reflects the latest changes without unnecessary calls.

These changes aim to improve the integration with git and enhance the accuracy of change detection in the application.
2026-03-01 07:10:14 -06:00
Joe
cd87c63a89 Enhance git integration and optimize change detection in ServeSession
- Introduced a new function to retrieve the current HEAD commit SHA, allowing for better tracking of changes in the git repository.
- Updated the `git_changed_files` function to accept an initial HEAD parameter, improving the accuracy of change detection.
- Modified `ServeSession` to store the initial HEAD commit SHA at session start, ensuring committed changes are reflected in the auto-selection logic.
- Enhanced tests to verify that committed changes after session start are correctly identified and included in the change tracking.

These changes aim to improve the synchronization process with git and enhance the user experience by ensuring accurate change detection.
2026-03-01 06:59:22 -06:00
Joe
ec51c14a41 Enhance error handling and improve script tracking in RojoTree and ServeSession
- Added a test to verify the functionality of script tracking updates in RojoTree, ensuring proper addition and removal of script references.
- Improved error handling in ServeSession by clearing temporary script IDs upon disconnection to prevent potential memory leaks.
- Updated API logic to filter out empty properties and children during instance addition, enhancing the integrity of the synchronization process.

These changes aim to optimize script management and enhance the robustness of the session handling and tree operations.
2026-02-28 11:16:10 -06:00
Joe
57433a0158 Enhance scripts-only mode handling and improve temp ID resolution
- Introduced a new mechanism in ServeSession to manage scripts-only mode, ensuring proper handling of temporary IDs during script additions.
- Updated the applyPatch function to remap only scripts-only temp IDs, preventing false positives with legitimate additions.
- Modified the API to resolve intermediate container temp IDs to real tree references, enhancing the integrity of parent-child relationships for new scripts.
- Added tests to verify the functionality of scripts-only mode and the resolution of temp IDs.

These changes aim to optimize script management and improve the overall functionality of the session handling.
2026-02-28 07:23:49 -06:00
Joe
dcd48642be Refactor error handling and improve code readability in ServeSession and applyPatch
- Enhanced error logging in ServeSession by formatting warning messages for better clarity.
- Improved readability in applyPatch by restructuring conditional statements for clarity.
- Simplified assertions in tests for script pruning to maintain consistency and readability.

These changes aim to improve code maintainability and enhance the clarity of error messages.
2026-02-28 06:44:37 -06:00
Joe
9820ec6534 Enhance script handling and temp ID resolution in ServeSession and Reconciler
- Improved error handling in ServeSession by rolling back temp IDs if encoding fails for new scripts.
- Added logic in applyPatch to remap echoed additions from the DescendantAdded handler, preventing duplicate instances.
- Updated API to resolve intermediate container temp IDs to real tree references, ensuring proper parent-child relationships for new scripts.
- Introduced new tests to verify the presence of server info flags and the resolution of temp IDs in scripts-only mode.

These changes aim to optimize script management and enhance the overall functionality of the session handling.
2026-02-28 06:39:13 -06:00
Joe
4985a3fede work 2026-02-28 06:11:16 -06:00
Joe
d9fa62c88e Add server-side and test-side port retry mechanisms to handle race conditions
- Introduced a new plan to address port-in-use race conditions in both server and test environments.
- Implemented a retry mechanism with exponential backoff for binding to known ports in `LiveServer::start()`.
- Added a `respawn_with_new_port()` method in `TestServeSession` to handle transient port conflicts during tests.
- Modified `wait_to_come_online()` to retry with a new port if the server process exits due to `AddrInUse`.
- Updated `fresh_rebuild_read()` to include port retry logic, enhancing robustness against port conflicts.

These changes aim to improve the reliability of server and test interactions by mitigating race conditions related to port usage.
2026-02-19 01:34:53 -06:00
Joe
7d0232c430 Add automatic dedup suffix stripping to enhance syncback functionality
- Introduced a new plan to automatically strip `~N` dedup suffixes from filenames during forward sync, eliminating the need for redundant `.meta.json5` files.
- Implemented the `strip_dedup_suffix()` utility in `dedup_suffix.rs` to handle suffix removal.
- Updated `file_name_for_path()` and `get_dir_middleware()` to utilize the new stripping functionality.
- Modified syncback logic to skip writing meta `name` fields for dedup-only cases, ensuring cleaner instance naming.
- Enhanced existing tests and added new tests to cover the updated dedup behavior, ensuring robustness and correctness.

These changes aim to streamline the handling of deduplicated instances, improving overall system efficiency and clarity in naming conventions.
2026-02-19 01:15:28 -06:00
Joe
5b38648ead Update dependencies and improve syncback handling
- Updated versions of several dependencies in `Cargo.lock`, including `async-compression` (0.4.40), `aws-lc-rs` (1.16.0), `bumpalo` (3.20.1), and `compression-codecs` (0.4.37), ensuring compatibility and access to the latest features and fixes.
- Refactored the `fire` method in `SyncbackSignal` to return a boolean indicating whether a syncback was successfully initiated, preventing concurrent syncbacks.
- Enhanced error handling in the API syncback process to return a conflict response if a syncback is already in progress.
- Improved the `serve.rs` file by replacing `forget` with `drop` for better memory management and added checks to ensure service chunk integrity during live syncback operations.
- Added new tests for edge cases and resilience in live syncback functionality, ensuring robustness against malformed data and rapid sequential requests.

These changes aim to enhance the reliability and performance of the syncback feature while keeping dependencies up to date.
2026-02-19 00:17:43 -06:00
Joe
9d8762bbaf Refactor encoding logic in ChangeBatcher and enhance duplicate handling
- Updated `encodeInstance` and `encodeService` to utilize helper functions for encoding attributes and tags, improving code organization and readability.
- Changed duplicate handling to allow encoding of instances with duplicate-named siblings, with the server managing name collisions through a dedup suffix system.
- Added debug logging for duplicate detection to aid in diagnostics.
- Streamlined property encoding by implementing a helper function to iterate over encodable properties, enhancing maintainability and consistency.

These changes improve the clarity and efficiency of the encoding process while ensuring accurate handling of duplicate instances.
2026-02-18 23:02:43 -06:00
Joe
39c8bd41f4 Enhance live syncback process with improved reference handling and float precision
- Implemented ObjectValue carriers for service-level references, allowing for accurate serialization of non-direct child references during syncback.
- Updated `encodeService` to include explicit handling of attributes and tags, ensuring they are properly encoded and preventing data loss.
- Refactored `build_dom_from_chunks` to manage ObjectValue carriers and resolve references correctly, enhancing data integrity.
- Truncated float values to f32 precision in `UnresolvedValue::from_variant`, aligning with rbxl storage requirements and improving consistency.

These changes address critical issues in the live syncback process, enhancing reliability and data accuracy.
2026-02-18 09:11:59 -06:00
Joe
a75a1443c0 Enhance syncback process by integrating serialization of service children
- Introduced `SerializationService` to serialize child instances during syncback, improving data handling.
- Updated `performSyncback` to include serialized children data in the syncback request.
- Refactored `ServiceChunk` structure to store child count instead of serialized data, optimizing memory usage.
- Adjusted related functions and tests to accommodate the new data structure, ensuring consistency and accuracy in syncback operations.

These changes significantly enhance the efficiency and clarity of the syncback process, allowing for better management of service data.
2026-02-18 08:21:25 -06:00
Joe
e0fd9077e8 Refactor service encoding to streamline properties handling
- Removed the encoding of attributes and tags from the `encodeService` function, consolidating their inclusion into the properties map as `Variant::Attributes(...)` and `Variant::Tags(...)`.
- Updated the `ServiceChunk` struct to reflect these changes, ensuring a more efficient serialization process during syncback operations.
- Adjusted related tests to align with the new structure, enhancing overall data management and consistency in service encoding.

These modifications improve the clarity and performance of the service encoding process.
2026-02-18 08:00:49 -06:00
Joe
72ad84b5a7 Implement live syncback service properties encoding and enhance syncback functionality
- Introduced a new `encodeService` helper in the plugin to serialize service properties, attributes, tags, and references alongside children data.
- Updated the `performSyncback` function to utilize the new encoding method, ensuring all services are processed without child-only restrictions.
- Extended the `ServiceChunk` struct to include fields for properties, attributes, tags, and references, improving data handling during syncback.
- Modified the `build_dom_from_chunks` function to apply service properties and resolve references when reconstructing the service instances.
- Added comprehensive tests to validate the new service properties handling, ensuring accurate synchronization and data integrity.

These enhancements significantly improve the live syncback process, allowing for better service data management and consistency.
2026-02-18 07:22:29 -06:00
Joe
93ea0bdef6 Refactor syncback process and improve code readability
- Reformatted the `SYNCBACK_SERVICES` list for better readability by aligning entries vertically.
- Simplified the `performSyncback` function by removing unnecessary Promise wrapping, enhancing clarity and maintainability.
- Updated the `NotConnectedPage` component to improve the structure of button elements and their associated tooltips.
- Refactored the `hydrate` and `matching` modules to streamline function calls and improve code organization.

These changes enhance the overall readability and maintainability of the syncback process and related components.
2026-02-18 05:58:17 -06:00
Joe
372a422b3d Update SyncbackRequest structure and API protocol validation
- Changed the `protocol_version` and `place_id` fields in the `SyncbackRequest` struct from `u64` to `f64` to accommodate Luau's numeric representation.
- Updated the API's protocol version validation to compare the `syncback_request.protocol_version` as a `u64`, ensuring compatibility with the expected protocol version.
- Enhanced type handling for `place_id` to maintain consistency in the syncback process.

These changes improve the handling of numeric fields in syncback requests, aligning with the requirements of the Luau environment.
2026-02-18 05:32:46 -06:00
Joe
307ac81aec Implement live syncback feature and enhance API for service data transfer
- Added a new `performSyncback` function in the `App` module to handle the synchronization of service data from the game to the server.
- Introduced a `SyncbackConfirm` UI component to confirm syncback actions from the user.
- Updated the API to include a new `/api/syncback` endpoint for handling syncback requests, validating protocol and server versions.
- Enhanced the `SyncbackSignal` mechanism to facilitate communication between the server and the syncback process.
- Added tests to ensure the functionality of the live syncback feature and its integration with the CLI.

These changes improve the overall synchronization capabilities of the application, allowing for real-time updates and better project management.
2026-02-18 04:36:57 -06:00
Joe
6f8e5a5cf2 Refactor code for improved readability and consistency
- Simplified function calls and removed unnecessary line breaks in `change_processor.rs`, `rojo_ref.rs`, `syncback/meta.rs`, `syncback/mod.rs`, `syncback/ref_properties.rs`, and `web/api.rs` to enhance code clarity.
- Updated test assertions in `two_way_sync.rs` for better readability by consolidating multiple lines into single assertions.

These changes improve the overall maintainability and readability of the codebase.
2026-02-18 04:21:50 -06:00
Joe
b8c3520d25 Add Luau-style ref paths migration plan and update related tests
- Introduced a new migration plan for converting `Rojo_Ref_*` attribute paths to Luau require-by-string style, enhancing portability with relative paths.
- Updated existing test snapshots to reflect the new path formats, ensuring consistency across various scenarios.
- Enhanced the `compute_relative_ref_path` and `resolve_ref_path` functions to support the new path semantics, improving path resolution logic.
- Refactored related code in `change_processor`, `syncback`, and `snapshot` modules to accommodate the new reference path handling.

These changes improve the robustness and maintainability of reference path management in the project.
2026-02-18 04:17:51 -06:00
Joe
d836ebddc8 Update deduplication logic and documentation for suffix handling
- Removed the `luau` dependency from `rokit.toml`.
- Updated deduplication logic to append `~2`, `~3`, etc. instead of `~1`, `~2` for naming collisions in various files, ensuring consistent suffix management.
- Adjusted comments and documentation across multiple files to reflect the new suffix handling rules.
- Added new test cases to validate the updated deduplication behavior, ensuring accurate naming for instances with collisions.

These changes enhance the clarity and functionality of the deduplication process, improving overall consistency in naming conventions.
2026-02-18 01:57:17 -06:00
Joe
6de088be31 Add batch script files and enhance git staging logic
- Introduced 20 new batch script files (BatchScript01.luau to BatchScript20.luau) for testing purposes.
- Enhanced the `change_processor` to consolidate git staging operations, reducing the risk of index.lock races by batching paths for staging.
- Updated the `PatchSet` struct to include a new field for pre-resolved filesystem paths to stage via git add.
- Modified the API to handle batch staging more efficiently, ensuring all files are staged correctly in mixed write scenarios.

These changes improve the testing framework and optimize git integration for batch operations.
2026-02-17 21:27:10 -06:00
Joe
6dec06865f Refactor code for improved readability and maintainability
- Simplified multi-line function calls in `PatchTree.lua` and `SHA1.luau` for better clarity.
- Enhanced the `init.lua` file by formatting the `PatchTree.build` function call across multiple lines.
- Updated `change_processor.rs` and `api.rs` to improve the formatting of function calls and enhance code consistency.
- Made minor adjustments in test files to streamline assertions and improve readability.

These changes contribute to a cleaner codebase and enhance overall maintainability.
2026-02-17 21:05:28 -06:00
Joe
7ba04f7f6a Update dependencies and implement git-based sync direction defaults
- Updated `clap` and `unicode-ident` versions in `Cargo.lock` and `Cargo.toml`.
- Added `sha1` crate to `Cargo.toml` for SHA1 hashing functionality.
- Introduced a new `git.rs` module for handling git operations, including changed files and SHA1 computation.
- Enhanced the sync confirmation dialog to auto-select defaults based on git status, improving user experience during two-way sync.
- Updated `PatchTree` to utilize git metadata for determining default selections during patch application.

These changes enhance the integration with git, providing smarter defaults and improving the overall sync process.
2026-02-17 20:36:28 -06:00
Joe
85787f3452 Refactor code for improved readability and consistency
- Simplified the formatting of path handling in `change_processor.rs` and `fs_snapshot.rs` by consolidating multiple lines into single lines for better clarity.
- Updated test assertions in `two_way_sync.rs` to streamline the code and enhance maintainability.

These changes enhance the overall readability of the codebase, making it easier to manage and understand.
2026-02-17 06:34:44 -06:00
Joe
ed1f61c093 Complete audit plan updates and enhance deduplication processes
- Updated the audit plan for the ambiguous paths follow-up, marking all critical fixes as completed, including dedup cleanup, added paths, and ref path finalization.
- Introduced a new `atlas-dedup.mdc` file detailing the deduplication system, including matching algorithms, suffix cleanup, and integration for duplicate-named instances.
- Enhanced the `syncback` process to ensure proper handling of ref paths and deduplication, improving metadata consistency and overall system reliability.
- Implemented attribute-scoped path fixes in the `FsSnapshot` to ensure only relevant lines are modified during ref path updates.

These changes improve the clarity and effectiveness of the audit process while enhancing the deduplication and synchronization mechanisms within the project.
2026-02-17 06:08:24 -06:00
Joe
e207a398b1 Refactor Reconciler equality checks and enhance path handling
- Introduced a new `trueEquals` function in `trueEquals.lua` for shared value equality checks, improving consistency between `diff.lua` and `matching.lua`.
- Removed redundant equality logic from `diff.lua` and `matching.lua`, streamlining the codebase.
- Updated path handling in various test snapshots to ensure correct reference values, enhancing the accuracy of reconciliation tests.
- Implemented a post-processing step in `syncback` to fix `Rojo_Ref_*` attribute paths with correct dedup suffixes, improving path resolution.

These changes enhance the clarity and efficiency of the Reconciler's equality checks and path handling, paving the way for improved project management and user experience.
2026-02-17 05:31:36 -06:00
Joe
aabbfb23b2 Update ChangeBatcher tests to reflect encoding behavior for duplicate-named children
- Renamed test case to clarify that children with duplicate names are now encoded rather than skipped.
- Adjusted assertions to ensure all children are included in the encoded output, aligning with the updated encoding logic.
- Refactored related test cases for improved clarity and maintainability.

These changes enhance the accuracy of the ChangeBatcher tests, ensuring they correctly validate the new encoding behavior.
2026-02-17 05:00:24 -06:00
Joe
3ad3c21c01 Add ref path and dedup integration plan
- Introduced a new plan file detailing the integration of ref path handling and deduplication cleanup processes.
- Implemented a `tentative_fs_path()` function to build filesystem-compatible paths, addressing issues with slugified and deduplicated instance names.
- Enhanced the `handle_tree_event()` method in the change processor to trigger dedup cleanup actions upon deletions, ensuring proper management of dedup groups.
- Updated relevant files to replace legacy path handling with the new system, improving overall path resolution and cleanup efficiency.

These changes enhance the robustness of path handling and deduplication processes, paving the way for improved project management and user experience.
2026-02-17 03:56:59 -06:00
Joe
1a1d9ce886 Implement new recursive change-count matching algorithm for instance reconciliation
- Introduced a comprehensive rewrite of the matching algorithm, replacing the previous multi-pass approach with a recursive change-count scoring function and greedy assignment strategy.
- Updated the `hydrate.lua` and `matching.lua` files to utilize the new algorithm, enhancing the efficiency of instance matching during hydration.
- Documented the new algorithm's structure, including fast-paths for Ref pins and (Name, ClassName) grouping, which significantly improve matching accuracy and performance.
- Ensured that the new implementation maintains compatibility with existing systems while providing a more robust solution for handling ambiguous instances.

These changes enhance the clarity and efficiency of the reconciliation process, paving the way for improved project management and user experience.
2026-02-17 03:54:06 -06:00
Joe
d6162ac210 Complete implementation of the 3-pass matching algorithm for ambiguous path handling
- Finalized the transition from a duplicate-name blacklist system to a comprehensive 3-pass matching algorithm for both syncback and forward operations, enhancing the handling of ambiguous paths.
- Integrated a new `matching.lua` module to facilitate instance matching during hydration, utilizing unique name matching, class name narrowing, and structural fingerprinting.
- Updated various components, including `ChangeBatcher`, `Reconciler`, and `snapshot` modules, to leverage the new matching logic, ensuring robust file management and improved performance.
- Removed legacy duplicate handling code and streamlined the encoding process for instances with duplicate names.

These changes significantly enhance the clarity and efficiency of file operations, paving the way for improved project management and user experience.
2026-02-17 02:43:25 -06:00
Joe
e617e8fcda Enhance audit documentation and improve Ref property handling
- Added a detailed section in the audit documentation outlining the sync system layout for both CLI syncback and two-way sync pipelines, including file mappings and processing steps.
- Updated `init.meta.json5` to include the `Rojo_Ref_PrimaryPart` attribute for better reference tracking.
- Improved the `ChangeProcessor` to populate the `RefPathIndex` from existing meta/model files at startup, ensuring accurate handling of pre-existing `Rojo_Ref_*` attributes during renames.
- Refactored the `remove_file` method in `RefPathIndex` to `remove_all_for_file`, enhancing the re-indexing process after attribute removals.
- Added tests to verify the correct behavior of the `RefPathIndex` and ensure robustness against edge cases.

These changes improve the clarity of the audit process and enhance the reliability of reference path management in the synchronization system.
2026-02-14 15:55:24 -06:00
Joe
faa12dc573 Implement RefPathIndex for efficient handling of Rojo_Ref_* attributes
- Introduced the `RefPathIndex` structure to map `Rojo_Ref_*` attribute values to their corresponding meta/model file paths, enabling O(affected_files) lookups during instance renaming.
- Updated `ChangeProcessor`, `ServeSession`, and `ApiService` to utilize the new index for managing reference paths, improving performance and reliability during rename operations.
- Enhanced the `update_ref_paths_after_rename` function to leverage the index for efficient file updates, reducing the need for full tree scans.
- Added comprehensive tests for `RefPathIndex` to ensure correct functionality and robustness against edge cases.

These changes significantly enhance the efficiency of reference path management in the synchronization system.
2026-02-14 13:28:29 -06:00