Skip to content

Conversation

@oswaldo
Copy link
Owner

@oswaldo oswaldo commented Dec 12, 2025

This PR implements the Context Migration & Linking feature (009-fctx-migration).

Summary

  • Global Config: Implements GlobalConfig to track context locations in ~/.first/first.conf.
  • Save to Custom Path: Adds save --to <path> to save contexts to any location.
  • Link Mode: Adds save --link and update --link to replace source files with symlinks to the artifacts.
  • Move Command: Adds mv command to move contexts and automatically update symlinks.
  • Symlink Manager: Implements safe symlink handling.

Verification

  • Automated tests added for all new components.
  • Manual verification script specs/009-fctx-migration/verify_manual.sh passes.
  • Walkthrough updated.

@oswaldo oswaldo requested a review from estelamaris as a code owner December 12, 2025 23:44
Copilot AI review requested due to automatic review settings December 12, 2025 23:44
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements the Context Migration & Linking feature, enabling users to save contexts to custom locations, create symlinks to artifacts, and move contexts while automatically updating references. The implementation adds a global configuration registry (~/.first/first.conf) to track context locations outside standard project directories.

Key changes include:

  • Global Configuration: GlobalConfig manages a central registry of context locations
  • Custom Save Location: save --to <path> allows saving contexts anywhere on the filesystem
  • Linking Support: save --link and update --link replace source files with symlinks to artifacts
  • Context Migration: mv command moves contexts and updates all workspace symlinks

Reviewed changes

Copilot reviewed 35 out of 35 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
src/main/scala/first/config/GlobalConfig.scala Implements central registry for tracking context locations
src/main/scala/first/config/ConfigWriter.scala Provides HOCON writing utilities for configuration files
src/main/scala/first/config/ConfigReader.scala Enhanced to discover contexts from GlobalConfig registry
src/main/scala/first/core/SymlinkManager.scala Handles safe symlink creation with OS-specific warnings
src/main/scala/first/core/Mv.scala Implements context moving with symlink updating logic
src/main/scala/first/core/Save.scala Extended to support custom paths and linking mode
src/main/scala/first/core/Update.scala Extended to support linking mode for added artifacts
src/main/scala/first/cli/MvCommand.scala CLI interface for mv command
src/main/scala/first/cli/SaveCommand.scala Extended with --to and --link options
src/main/scala/first/cli/UpdateCommand.scala Extended with --link option
test_output.txt Test execution results (should not be in version control)
specs/009-fctx-migration/* Complete feature specification and documentation
Comments suppressed due to low confidence (1)

src/test/scala/first/core/UpdateTests.scala:1

  • The test 'Update works for custom location context' is failing. The test expects the artifact to be created at customDir / 'artifacts' / 'custom.txt', but the assertion fails. This indicates the Update command may not be properly resolving custom context locations from GlobalConfig. Review the Update.run implementation to ensure it correctly handles contexts registered in GlobalConfig.
package first.core

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- Implement `GlobalConfig` to track context locations (`~/.first/first.conf`).
- Add `save --to <path>` to save contexts to custom locations.
- Add `save --link` and `update --link` to replace source files with symlinks.
- Add `mv` command to move contexts and update symlinks.
- Implement `SymlinkManager` for safe symlink operations.
- Update `walkthrough.md` with new features.
Copilot AI review requested due to automatic review settings December 31, 2025 00:03
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 38 out of 38 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@oswaldo oswaldo merged commit 4f67352 into main Dec 31, 2025
1 check passed
@oswaldo oswaldo deleted the 009-fctx-migration branch December 31, 2025 00:23
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.

3 participants