Commit graph

734 commits

Author SHA1 Message Date
Joe
4ddc4a3e31 feat: add .gitignore for logs and refactor ServeSession to include path_roots in init_tree return
- Introduced a new .gitignore file to exclude log files from version control.
- Modified the `init_tree` function in `ServeSession` to return `path_roots`, enhancing the function's utility.
- Cleaned up commented-out code in `sourcemap.rs`, `patch_apply.rs`, and `tree.rs` for better readability and maintainability.
2026-03-12 16:35:44 -05:00
Joe
b1e2bee52a feat: add asynchronous log compression with thread priority adjustment
Implemented asynchronous log compression in the logging initialization process. A new function, `lower_thread_priority`, adjusts the thread priority to below normal for the compression task, improving overall application performance during logging operations.
2026-03-08 15:55:45 -05:00
Joe
c3af985026 refactor: change logging level from info to debug for orphan scan performance metrics
Updated logging levels in the syncback loop to debug for orphan scan performance metrics, reducing verbosity and improving performance during normal operations.
2026-03-07 21:30:12 -06:00
Joe
b3732acae5 fix: push pad-cost row for None snapshots in match_forward 2026-03-07 18:15:04 -06:00
Joe
372e6bc739 feat: implement Hungarian algorithm for optimal instance pairing in reconciler
- Replaced the previous greedy matching approach with the Hungarian (Kuhn-Munkres) algorithm for improved accuracy in instance pairing, especially in ambiguous groups with multiple same-named instances.
- Introduced a new Hungarian.lua module to encapsulate the algorithm's logic.
- Updated the reconciler to utilize the new optimal assignment function, enhancing overall matching performance.
- Documented changes in the CHANGELOG for clarity on the new implementation.
2026-03-07 18:13:19 -06:00
Joe
d26f82b4f2 feat: implement optimal assignment using Hungarian algorithm in matching process
- Added a new function for minimum-cost bipartite matching via the Hungarian algorithm to improve the efficiency of the matching process.
- Refactored existing matching logic to utilize the new algorithm, replacing the previous greedy assignment approach.
- Updated relevant documentation to reflect changes in the matching strategy.
- Enhanced performance in ambiguous group matching scenarios.
2026-03-07 17:55:50 -06:00
Joe
e06e9f7594 fix: extract orphan helpers so pre-walked path reuses them without duplication
Bugbot flagged that the pre-walked fast path bypassed collect_alternate_files
and instigating_source checks. Fixed by extracting both into shared helpers
called before the if/else branch, so both paths use the same logic.
2026-03-07 16:56:24 -06:00
Joe
a2c7968c60 refactor: update git index refresh to a no-op and change logging level to debug
The `refresh_git_index` function is now a no-op, as the previous implementation added unnecessary latency without meaningful benefits. Additionally, logging levels for performance metrics have been changed from info to debug across various modules to reduce verbosity and improve performance during normal operations.
2026-03-07 16:55:20 -06:00
Joe
3666c2a5e1 fix: scope pre-walked paths to $path roots and apply syncback filters
Bugbot flagged two issues with the pre-walked orphan paths:
1. cache.is_file.keys() included shallow project-folder entries (README.md,
   rokit.toml, etc.) that would be incorrectly flagged as orphans.
   Fixed by filtering to only paths under walked $path roots.
2. syncbackRules.ignorePaths was not applied to pre-walked paths.
   Fixed by running is_valid_path() on the pre-walked set before use.
2026-03-07 16:35:47 -06:00
Joe
cd465a90a2 Optimize syncback performance for large projects (~42% faster)
Syncback on a 132K-file project dropped from ~32s to ~18s by:
- Skipping hash_tree computation in clean (non-incremental) mode,
  since hashes are only consulted when incremental=true (-6s)
- Reusing prefetch walkdir results for orphan detection instead of
  walking the filesystem a second time (-1.7s)
- Rewriting collect_all_paths from O(n*d) bottom-up ancestor walks
  to O(n) top-down BFS (-0.7s)
- Adding file-size-first comparison in write_to_vfs_parallel to
  avoid reading files that differ in size
- Scoping git ls-files --stage to project directory prefix
- Adding [PERF] instrumentation at info level for every pipeline phase
2026-03-07 16:01:51 -06:00
Joe
345d36cda5 Refactor VFS event logging and streamline ServeSession watch setup
- Changed VFS event logging from INFO to DEBUG level for better performance and reduced verbosity during normal operations.
- Removed unnecessary project folder variable and redundant watch calls in ServeSession, enhancing clarity and efficiency in the watch setup process.
2026-03-07 14:41:17 -06:00
Joe
dad5320aaf Enhance patch computation to support glob-ignored children
- Introduced `glob_ignore_rules` to manage instance removal based on glob patterns, allowing for more granular control over which instances are retained.
- Updated the logic in `compute_patch_set_internal` and `compute_children_patches` to check against these rules before removing unmatched instances.
- Refactored related tests to ensure correct behavior when instances are matched or ignored based on their paths, improving the robustness of instance synchronization.
2026-03-07 13:25:49 -06:00
Joe
73ac94c67c Stop setting ignore_unknown_instances from glob filtering to prevent meta file leak 2026-03-07 12:20:54 -06:00
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
12bccf91c5 Enhance instance metadata and reconciliation logic for glob-ignored children
- Added `globIgnoredChildren` to `ApiInstanceMetadata` to manage child deletion behavior based on glob patterns.
- Updated `shouldDeleteChild` function to suppress deletions when `globIgnoredChildren` is true, differentiating from scripts-only mode.
- Enhanced tests to verify correct behavior of instance deletion based on the new metadata, ensuring robust handling of unknown scripts.
- Refactored snapshot handling to incorporate `globIgnoredChildren` in metadata, improving clarity and maintainability.
2026-03-07 11:44:07 -06:00
Joe
4b38c070fb Refactor VFS watch logic for macOS and Linux/Windows compatibility
- Enhanced the VFS watch setup in ServeSession to differentiate between macOS and other platforms, ensuring proper handling of file and directory watches.
- Improved clarity by restructuring the logic for watching paths, addressing platform-specific requirements and optimizing resource usage.
- Maintained non-recursive watching for ignored directories while ensuring all relevant files are monitored effectively.
2026-03-07 10:40:32 -06:00
Joe
c19b249657 Update TODO.txt and refine VFS watch logic in ServeSession
- Added a new entry in TODO.txt to follow up with Coelho on outstanding tasks.
- Simplified VFS watch logic to ensure both files and directories are monitored, addressing potential conflicts on macOS and improving overall watch reliability.
2026-03-07 10:30:09 -06:00
Joe
372b605fb5 Enhance snapshot handling to account for glob-ignored children
- Updated snapshot_dir_no_meta to set ignore_unknown_instances based on the presence of glob-ignored children.
- Added tests to verify that directories with glob-ignored children correctly flag ignore_unknown_instances as true, while those without do not.
- Improved clarity and maintainability of the snapshot logic by incorporating child filtering rules.
2026-03-06 23:50:12 -06:00
Joe
1ab347f498 Refactor VFS watch logic in ServeSession
- Simplified the VFS watch setup by removing the directory type check, allowing all entries to be watched directly.
- Improved code clarity and reduced complexity in the watching mechanism for project files.
2026-03-06 23:43:06 -06:00
Joe
e79691012e Update TODO.txt with new entries for luau-lsp sourcemap fix and two-way sync issue
- Added a task to address the luau-lsp sourcemap generator command configuration.
- Documented a problem with the plugin not respecting two-way sync for glob ignored scripts, highlighting the need for a fix.
2026-03-06 23:27:14 -06:00
Joe
8acbfc0cf8 Refactor notify dependency configuration and enhance VFS watch setup
- Updated Cargo.toml to conditionally configure the notify dependency for macOS and other platforms.
- Improved ServeSession's VFS watch logic to filter out ignored directories based on glob patterns, optimizing resource usage and watch handle count.
- Introduced PathIgnoreRule handling to streamline directory watching, enhancing overall performance and maintainability.
2026-03-06 23:22:54 -06:00
Joe
0243181731 Refactor path ignore rule handling in Project and ServeSession
- Introduced a new method `path_ignore_rules` in the Project struct to streamline the creation of PathIgnoreRule instances.
- Updated ServeSession and snapshot middleware to utilize the new method, improving code clarity and reducing duplication.
- Removed redundant PathIgnoreRule mapping from multiple locations, enhancing maintainability.
2026-03-06 23:12:28 -06:00
Joe
6fcb1b9cf2 Update dependencies and enhance path ignore functionality
- Updated various dependencies in Cargo.lock and Cargo.toml, including aws-lc-rs, aws-lc-sys, tokio, and uuid to their latest versions.
- Refactored the memofs crate to simplify the notify dependency configuration.
- Introduced path ignore rules in ChangeProcessor and ServeSession to filter VFS events based on glob patterns, improving event handling efficiency.
2026-03-06 23:01:20 -06:00
Joe
093e62af8e Enhance project cloning and initialization process
- Updated CloneCommand to support multiple place IDs, allowing the creation of multi-place projects with individual project files for each place.
- Refactored the initialization logic in InitCommand to streamline project setup and ensure proper handling of project templates.
- Added a new function to fetch place names from the Roblox API, improving the user experience during project creation.
- Updated TODO.txt with a new entry for fixing the luau-lsp sourcemap generator command.
2026-03-06 22:49:32 -06:00
Joe
cf31e9b914 Update TODO.txt and init.rs to manage atlas-project.mdc
- Added a new entry in TODO.txt to remove atlas-project.mdc from shared agent rules and migrate it to manual cloning for new projects.
- Updated init.rs to include atlas-project.mdc in the project initialization process, ensuring it is created in the appropriate rules directory.
2026-03-06 22:17:16 -06:00
Joe
5275d45adc Add is_watch_enabled method to VFS and enhance prefetch cache tests
- Introduced `is_watch_enabled` method to check the status of automatic file watching in the VFS.
- Added a new test for prefetch cache to validate metadata retrieval and error handling for walked roots and external paths.
- Updated the `watch` method in `StdBackend` for cleaner logic.
- Enhanced the `dir_init` field in `PrefetchCache` to store resolved init-file information for directories, improving prefetch operations.
2026-03-06 21:51:22 -06:00
Joe
8b18dc451a Add guard test for INIT_FILE_PRIORITY vs DEFAULT_PROJECT_NAMES sync 2026-03-06 21:23:14 -06:00
Joe
e86ebdadbc Fix walked_roots to store raw paths, not canonical 2026-03-06 21:07:35 -06:00
Joe
dc788711c7 Fix walked_roots to only include recursively walked directories 2026-03-06 20:53:28 -06:00
Joe
4e9e676cf2 Refactor prefetch_project_files and VFS watch setup for improved efficiency
- Updated the `prefetch_project_files` function to perform a shallow walk of the project folder, limiting the depth to enhance performance and avoid unnecessary recursion into specific directories.
- Improved the logic for handling $path roots, ensuring correct canonicalization and efficient traversal based on the relationship to the project folder.
- Adjusted the VFS watch setup to watch the project folder non-recursively while allowing recursive watching for $path roots, optimizing resource usage during file monitoring.

These changes enhance the accuracy and performance of file prefetching and watching in the VFS.
2026-03-06 20:39:27 -06:00
Joe
df773eab71 Improve project file prefetching by canonicalizing paths
- Updated the `prefetch_project_files` function to canonicalize folder paths before checking if roots start with the folder, preventing false positives with relative paths.
- Enhanced the logic to skip non-existent roots early, improving efficiency during the prefetching process.

These changes enhance the accuracy and performance of the file prefetching mechanism in the VFS.
2026-03-06 20:05:22 -06:00
Joe
6168597acb Enhance PrefetchCache with directory init-file resolution
- Added a new field `dir_init` to `PrefetchCache` to store pre-resolved init-file information for directories, allowing for efficient retrieval during prefetch operations.
- Introduced the `prefetch_dir_init` method in the `Vfs` struct to look up init-file info from the prefetch cache.
- Updated the `prefetch_project_files` function to populate the `dir_init` map based on the defined `INIT_FILE_PRIORITY`.
- Adjusted related tests to ensure proper initialization of the `dir_init` field in various scenarios.

These changes improve the performance of directory handling in the VFS by reducing the need for repeated metadata probes.
2026-03-06 19:58:07 -06:00
Joe
14d4bc134d Update instance context in ServeSession for script synchronization
- Modified the `check_tree_freshness` method to set `sync_scripts_only` in the `InstanceContext`, ensuring that the correct synchronization behavior is applied during tree freshness checks.
- This change enhances the functionality of the `ServeSession` by allowing for more precise control over script synchronization.
2026-03-06 18:32:13 -06:00
Joe
0fb5c8776e Refactor VFS watching mechanism for improved performance
- Replaced the selective watching logic with a more efficient recursive watching setup in the `ServeSession` implementation.
- Enhanced logging to include the number of recursive watches set up and the elapsed time for the setup process, providing better insights into performance.
- Removed the previous recorded paths logic to streamline the watching process.

These changes aim to optimize the VFS's directory watching capabilities and improve monitoring during the setup phase.
2026-03-06 18:25:21 -06:00
Joe
a1b65dbb52 Enhance logging for VFS directory watching
- Added timing measurement for the selective watching process in the `ServeSession` implementation, improving visibility into performance during directory watching.
- Updated the debug log message to include the elapsed time for better monitoring of the watching behavior.

These changes aim to provide more detailed insights into the VFS's directory watching performance.
2026-03-06 17:56:04 -06:00
Joe
2ea1d49316 Enhance VFS watch functionality and introduce recording mode
- Updated the `watch` method in `VfsBackend` to accept a `recursive` parameter, allowing for more flexible directory watching.
- Implemented a recording mode in the `Vfs` struct to track accessed paths without immediately watching them, improving performance during read operations.
- Added tests to verify the behavior of the new recording mode and ensure correct path tracking.
- Enhanced the `StdBackend` and `NoopBackend` implementations to support the updated watch functionality.

These changes aim to improve the VFS's ability to manage file system events and enhance user control over watching behavior.
2026-03-06 17:25:38 -06:00
Joe
bfb5815f5e Update TODO and enhance git configuration
- Removed outdated git configuration command from TODO.txt for clarity.
- Added a command to set the `core.longpaths` configuration in the `git_init_repo` function, improving support for long file paths in the repository initialization process.

These changes aim to streamline the TODO list and enhance the git initialization workflow.
2026-03-06 17:01:01 -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
cb3036a5d0 Add atlas-push skill documentation and enhance git submodule management
- Introduced a new `SKILL.md` file for the `atlas-push` skill, detailing the automated workflow for pushing filesystem changes into Roblox Studio, including prerequisites, workflow steps, and conflict resolution strategies.
- Implemented `git_submodule_add` and `git_config_set` functions to manage git submodules and configuration settings, enhancing the git integration within the project.
- Updated the `InitCommand` to add agent submodules in parallel, improving the efficiency of the initialization process.

These changes aim to improve user guidance for the `atlas-push` skill and streamline git submodule handling in the project.
2026-03-02 09:31:34 -06:00
Joe
9934094dbc Enhance Roblox API integration and refactor CLI commands
- Updated the `clap` dependency in `Cargo.toml` to include the "env" feature for improved command-line argument handling.
- Introduced a new `roblox_api` module to encapsulate Roblox API interactions, including authentication and asset downloading.
- Refactored the `CloneCommand` and `StudioCommand` to utilize the new `roblox_api` functions for fetching experience names and universe IDs, enhancing code clarity and reducing duplication.
- Removed obsolete functions related to Roblox API calls from the CLI commands, streamlining the codebase.
- Added error handling for authentication failures, ensuring better user feedback when required credentials are missing.

These changes aim to improve the overall structure and functionality of the CLI while enhancing the integration with the Roblox API.
2026-03-01 20:03:40 -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
65f10f111c Refactor git_changed_files_impl for improved performance and clarity
- Replaced the previous implementation of tracking changes with a more efficient approach using `git status` and `git diff`, reducing the number of command calls and enhancing performance.
- Consolidated the handling of tracked and untracked files, improving code readability and maintainability.
- Updated logging to provide more detailed timing information for git operations, aiding in performance monitoring.

These changes aim to streamline git interactions and enhance the overall efficiency of the git module.
2026-03-01 18:36:45 -06:00
Joe
4846fc1f59 Refactor git module to utilize command-line git for repository operations
- Replaced the use of the gix API with direct command-line calls to `git` for retrieving the repository root and current HEAD commit SHA, improving compatibility and reducing dependency on the gix library.
- Updated the `git_changed_files_impl` function to use command-line `git diff` and `git ls-files` for tracking changes, enhancing performance and flexibility in detecting file modifications.
- Improved error handling and logging for git operations, ensuring better feedback during execution.

These changes aim to streamline git interactions and enhance the overall efficiency of the git module.
2026-03-01 18:22:24 -06:00
Joe
170e0dfc39 Update logging configuration to enable target logging
- Changed the logging initialization to enable target logging, improving the detail and context of log messages. This adjustment enhances the overall logging output, making it more informative for debugging and monitoring purposes.
2026-03-01 18:22:01 -06:00
Joe
76b5d8bc75 Implement tree reconciliation toggle and enhance git functionality
- Introduced a constant to enable or disable periodic tree reconciliation after VFS events, addressing a persistent drift bug that caused infinite re-snapshot loops on large projects.
- Updated the `ChangeProcessor` to conditionally execute tree reconciliation based on the new constant, improving performance during file modifications.
- Enhanced the git module by adding new functions for shallow cloning and checking if files are staged, streamlining git operations.
- Refactored the `InitCommand` to utilize the new git functions for repository initialization and cloning, improving clarity and reducing redundancy.

These changes aim to optimize file change handling and enhance git integration within the project.
2026-03-01 18:16:03 -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
8d54fff7df Refactor ServeCommand to improve session management and error handling
- Removed the direct initialization of the Project within the ServeCommand's run method, replacing it with a more streamlined session management approach using ServeSession.
- Enhanced error handling by creating a new Vfs instance with error tracking for each session, ensuring better management of critical errors during server operation.
- Improved the overall flow of the run method by reducing redundancy in session creation and enhancing clarity.

These changes aim to optimize the server's session handling and improve error management during execution.
2026-03-01 17:15:32 -06:00
Joe
a506b97e71 Refactor git repository initialization and enhance logging levels
- Updated the `flatten_tree` function in `git.rs` to clarify the repository parameter name.
- Changed logging level from `debug` to `trace` in `finalize_patch_application` for more detailed output.
- Modified the `TestServeSession` initialization to persist git configuration to disk, ensuring user identity is accessible for subsequent operations.

These changes aim to improve code clarity, enhance logging detail, and ensure proper git configuration handling in tests.
2026-03-01 17:09:35 -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