fix(task-tool): add task ID validation and improve lock acquisition safety

- Add task ID pattern validation (T-[A-Za-z0-9-]+) to prevent path traversal
- Refactor lock mechanism to use UUID-based IDs for reliable ownership tracking
- Implement atomic lock creation with stale lock detection and cleanup
- Add lock acquisition checks in create/update/delete handlers
- Expand task-reminder hook to track split tool names and clean up on session deletion
- Add comprehensive test coverage for validation and lock handling
This commit is contained in:
YeonGyu-Kim
2026-02-01 23:48:48 +09:00
parent 172446795c
commit f853d885fa
9 changed files with 206 additions and 54 deletions
+3 -3
View File
@@ -40,9 +40,9 @@ interface Task {
## STORAGE UTILITIES
### getTaskDir(teamName, config)
### getTaskDir(config)
Returns: `.sisyphus/tasks/{teamName}` (or custom path from config)
Returns: `.sisyphus/tasks` (or custom path from config)
### readJsonSafe(filePath, schema)
@@ -80,7 +80,7 @@ Returns: `.sisyphus/tasks/{teamName}` (or custom path from config)
```typescript
import { TaskSchema, getTaskDir, readJsonSafe, writeJsonAtomic, acquireLock } from "./features/claude-tasks"
const taskDir = getTaskDir("my-team", config)
const taskDir = getTaskDir(config)
const lock = acquireLock(taskDir)
try {