mirror of
https://github.com/Dasemu/skipredictor.git
synced 2026-11-26 07:16:15 +00:00
docs: add git worktree mandatory workflow to agents and lessons
This commit is contained in:
1 parent
c486c585d0
commit
00efa356c3
2 files changed
+44
No files matched your search
@@ -31,6 +31,17 @@ The results must be accessible through a Telegram bot.
|
||||
|
||||
This repository is designed to be developed collaboratively by AI coding agents.
|
||||
|
||||
### Mandatory Workflow: Git Worktrees
|
||||
|
||||
**CRITICAL**: Agents MUST create a new **git worktree** for every new feature, major refactor, or non-trivial task. This ensures a clean workspace, allows for parallel research/development, and prevents context contamination.
|
||||
|
||||
**Correct Workflow for Agents:**
|
||||
1. Create a worktree: `git worktree add ../feature-name -b feature-branch`
|
||||
2. Switch to the worktree: `cd ../feature-name`
|
||||
3. Implement, test, and commit inside the worktree.
|
||||
4. Merge back to `main` from the original directory.
|
||||
5. Cleanup: `git worktree remove ../feature-name` and `git branch -d feature-branch`.
|
||||
|
||||
Core System Philosophy
|
||||
|
||||
Predictions must follow a hybrid architecture.
|
||||
|
||||
+33
@@ -10,6 +10,8 @@
|
||||
|
||||
**Files affected:** `bot/telegram_bot.py`, `scripts/collect_daily_data.py`
|
||||
|
||||
---
|
||||
|
||||
## Migration Scope - 2026-03-13
|
||||
|
||||
**What went wrong:** I started a database migration while preserving compatibility fallbacks to the previous CSV/JSON storage flow.
|
||||
@@ -21,3 +23,34 @@
|
||||
**Example:** The SQLite migration must make the bot, the daily pipeline, and model training read from the database directly instead of keeping fallbacks to `data/processed/predictions_latest.json` or `data/processed/dataset_featured.csv`.
|
||||
|
||||
**Files affected:** `bot/telegram_bot.py`, `scripts/collect_daily_data.py`, `ml/train_model.py`
|
||||
|
||||
---
|
||||
|
||||
## Git - 2026-03-13
|
||||
|
||||
**What went wrong:** Worktree creation and cleanup were mismanaged, leading to confusion between the main directory and the worktree. Changes were applied to the main directory instead of the newly created worktree, and branch deletion failed because the worktree was still active.
|
||||
|
||||
**Root cause:** Lack of a strict "switch directory" step and incorrect order in the cleanup process (trying to delete the branch before removing the worktree).
|
||||
|
||||
**Prevention rule:** Before using a worktree:
|
||||
1. **Always** `cd` into the new worktree directory immediately after creation.
|
||||
2. Perform all edits and commits **inside** the worktree.
|
||||
3. To clean up:
|
||||
* Return to the main directory: `cd -`
|
||||
* Remove the worktree: `git worktree remove <path>`
|
||||
* Then, and only then, delete the branch: `git branch -d <branch>`
|
||||
|
||||
**Example:**
|
||||
```bash
|
||||
# Correct flow:
|
||||
git worktree add ../new-feature -b feature-branch
|
||||
cd ../new-feature
|
||||
# ... do work, add, commit ...
|
||||
cd -
|
||||
git merge feature-branch
|
||||
git worktree remove ../new-feature
|
||||
git branch -d feature-branch
|
||||
```
|
||||
|
||||
**Files affected:**
|
||||
- [LESSONS.md](LESSONS.md)
|
||||
Reference in new issue
Block a user