story-kit: start 253_bug_watcher_and_auto_assign_do_not_reinitialize_when_project_root_changes

This commit is contained in:
Dave
2026-03-16 23:25:33 +00:00
parent 8ff6e3963b
commit a716ca312a

View File

@@ -0,0 +1,36 @@
---
name: "Watcher and auto-assign do not reinitialize when project root changes"
merge_failure: "Squash-merge resulted in an empty diff — the feature branch has no code changes to merge into master. The feature branch appears to be fully up-to-date with master with no additional commits. The coder agent may not have committed their work, or the changes may have already been merged separately."
---
# Bug 253: Watcher and auto-assign do not reinitialize when project root changes
## Description
When the server starts, if the frontend opens the project at the wrong path (e.g. server/ subdirectory instead of project root), the filesystem watcher and auto-assign run against that wrong path. When the frontend corrects itself by calling DELETE /project then open_project with the right path, the watcher and auto-assign do not reinitialize. This means:
1. The filesystem watcher watches the wrong directory for the entire session
2. Auto-assign only runs once at startup (against the wrong root) and never re-runs
3. Stories placed in 2_current/ are never auto-assigned to coders
4. The archive sweep never fires (same watcher thread)
This is likely the root cause of bug 251 (archive sweep not working) and explains why coders are not being auto-assigned.
## How to Reproduce
1. Start the Story Kit server\n2. Open a project in the frontend — note the first open_project sets project_root to the wrong subdirectory\n3. Frontend corrects by calling DELETE /project then open_project with the correct path\n4. Move a story into 2_current/\n5. Observe that no coder is auto-assigned
## Actual Result
Watcher and auto-assign remain bound to the initial (wrong) project root. No filesystem events are detected for the correct project directory. Stories in 2_current/ are never picked up.
## Expected Result
When project_root changes via open_project, the watcher thread should be stopped and restarted against the new root, and auto_assign_available_work() should re-run.
## Acceptance Criteria
- [ ] When open_project is called with a new path, the filesystem watcher restarts watching the new project root
- [ ] auto_assign_available_work() re-runs after a project root change
- [ ] If DELETE /project is called, the watcher stops (no zombie watcher on a stale path)
- [ ] Stories in 2_current/ are auto-assigned after the project root is corrected