refactor: migrate datastore from data/ to .data/ hidden directory#83
Conversation
- Migrate swamp's internal data directory from `/data/` to `/.data/` (hidden directory) - This change improves repository cleanliness by hiding internal storage from casual browsing - All symlinks in logical views (`/models/`, `/workflows/`) now point to `/.data/` paths ## Changes - **Domain layer**: Updated `repo_service.ts` to create `.data/` directory structure on init - **Infrastructure layer**: Updated all YAML repository implementations to use `.data/` paths: - `yaml_input_repository.ts` - `yaml_resource_repository.ts` - `yaml_data_repository.ts` - `yaml_output_repository.ts` - `yaml_workflow_repository.ts` - `yaml_workflow_run_repository.ts` - `yaml_evaluated_input_repository.ts` - `yaml_evaluated_workflow_repository.ts` - `streaming_log_repository.ts` - `fs_file_repository.ts` - **Symlink service**: Updated `symlink_repo_index_service.ts` to create symlinks pointing to `.data/` - **Documentation**: Updated skill docs and design docs to reflect new paths - **Configuration**: Updated `.gitignore` to ignore `.data/` subdirectories ## Breaking Change This is a **breaking change** for existing repositories. Users will need to either: - Run `swamp repo init --force` to reinitialize (losing existing data) - Manually rename their `data/` directory to `.data/` ## Test plan - [x] `deno check` - Type checking passes - [x] `deno lint` - Linting passes - [x] `deno fmt` - Formatting passes - [x] `deno run test` - All 1178 tests pass - [x] `deno run compile` - Binary compiles successfully 🤖 Generated with [Claude Code](https://claude.com/claude-code)
There was a problem hiding this comment.
Review: Approve with Suggestions
This is a well-executed mechanical rename from data/ to .data/ for hiding internal storage. The core implementation is correct - all actual path construction uses .data/ and tests have been updated appropriately.
No Blocking Issues
The PR passes all tests (1178 tests as noted), type checking, linting, and compilation. The functional code is correct.
Suggestions (non-blocking)
For completeness, consider updating these in a follow-up:
-
Test fixture data -
src/presentation/output/workflow_delete_output_test.tsxlines 17-18 and 25-26 still usedata/workflows/...in test data. This doesn't affect functionality (it's just fixture data that gets passed through), but updating it would maintain consistency. -
JSDoc comments - Several files still document the old path in comments:
yaml_data_repository.ts:18fs_file_repository.ts:24-25yaml_input_repository.ts:24yaml_resource_repository.ts:18yaml_output_repository.ts:20yaml_workflow_repository.ts:24yaml_workflow_run_repository.ts:25streaming_log_repository.ts:27-28yaml_evaluated_input_repository.ts:15yaml_evaluated_workflow_repository.ts:13
These are documentation-only and don't affect runtime behavior, but updating them would prevent future confusion.
Verification
- ✅ All repository implementations correctly use
.data/paths - ✅ Symlink service creates symlinks pointing to
.data/ - ✅
.gitignoreproperly updated - ✅ Design docs and skill docs updated
- ✅ Integration tests updated
- ✅ Breaking change documented in PR description
There was a problem hiding this comment.
Review: Approve with Suggestions
This is a well-executed mechanical rename from data/ to .data/ for hiding internal storage. The core implementation is correct - all actual path construction uses .data/ and tests have been updated appropriately.
No Blocking Issues
The PR passes all tests (1178 tests as noted), type checking, linting, and compilation. The functional code is correct.
Suggestions (non-blocking)
For completeness, consider updating these in a follow-up:
-
Test fixture data -
src/presentation/output/workflow_delete_output_test.tsxlines 17-18 and 25-26 still usedata/workflows/...in test data. This doesn't affect functionality (it's just fixture data that gets passed through), but updating it would maintain consistency. -
JSDoc comments - Several files still document the old path in comments:
yaml_data_repository.ts:18fs_file_repository.ts:24-25yaml_input_repository.ts:24yaml_resource_repository.ts:18yaml_output_repository.ts:20yaml_workflow_repository.ts:24yaml_workflow_run_repository.ts:25streaming_log_repository.ts:27-28yaml_evaluated_input_repository.ts:15yaml_evaluated_workflow_repository.ts:13
These are documentation-only and don't affect runtime behavior, but updating them would prevent future confusion.
Verification
- ✅ All repository implementations correctly use
.data/paths - ✅ Symlink service creates symlinks pointing to
.data/ - ✅
.gitignoreproperly updated - ✅ Design docs and skill docs updated
- ✅ Integration tests updated
- ✅ Breaking change documented in PR description
/data/to/.data/(hidden directory)/models/,/workflows/) now point to/.data/pathsChanges
repo_service.tsto create.data/directory structure on init.data/paths:yaml_input_repository.tsyaml_resource_repository.tsyaml_data_repository.tsyaml_output_repository.tsyaml_workflow_repository.tsyaml_workflow_run_repository.tsyaml_evaluated_input_repository.tsyaml_evaluated_workflow_repository.tsstreaming_log_repository.tsfs_file_repository.tssymlink_repo_index_service.tsto create symlinks pointing to.data/.gitignoreto ignore.data/subdirectoriesBreaking Change
This is a breaking change for existing repositories. Users will need to either:
swamp repo init --forceto reinitialize (losing existing data)data/directory to.data/Test plan
deno check- Type checking passesdeno lint- Linting passesdeno fmt- Formatting passesdeno run test- All 1178 tests passdeno run compile- Binary compiles successfully🤖 Generated with Claude Code