# Changelog - Version 3.1 (2025-10-17)
## ๐ Major Features
### โ
Multi-Agent Task Locking System
**Prevent race conditions in multi-agent workflows**
- Optimistic locking with version tracking
- Lock acquisition with configurable timeout (default 5min)
- Automatic lock expiration
- Query available (unlocked) nodes
- Batch cleanup of expired locks
**New Tools:**
- `memory_lock_node` - Acquire exclusive lock on a node
- `memory_unlock_node` - Release lock
- `memory_query_available_nodes` - Query unlocked nodes only
- `memory_cleanup_locks` - Clean up all expired locks
**Implementation:** `src/managers/GraphManager.ts` (4 new methods)
**Tests:** 20 integration tests in `testing/multi-agent-locking.test.ts`
### โ
Parallel Task Execution
**Automatic parallel execution based on task dependencies**
- Dependency-based batching algorithm
- Parallel execution within batches using `Promise.all()`
- Sequential batch execution
- Explicit parallel group support for PM control
- Diamond dependency pattern handling
- Circular dependency detection
- Intelligent failure handling
**Algorithm:** `organizeTasks()` - O(nยฒ) dependency resolution
- Automatically organizes tasks into execution batches
- Tasks with satisfied dependencies run in parallel
- PM can override with explicit `parallelGroup` markers
**Implementation:** `src/orchestrator/task-executor.ts`
**Tests:** 8 unit + 10 integration tests
**Documentation:** `docs/PARALLEL_EXECUTION_SUMMARY.md`
## ๐ Test Suite Enhancements
### Test Coverage: 123 Tests Total
- **Product tests (107):** `npm test`
- Multi-agent locking: 20 tests
- Task executor: 8 unit + 10 integration
- Graph operations: 39 tests
- File watching: 8 tests
- Gitignore: 11 tests
- Order processor v1: 11 tests
- **Benchmark tests (16):** `npm run test:benchmark`
- Order processor v2: 16 debugging exercises
- Excluded from main suite (in `testing/agentic/`)
### Test Configuration
- โ
`vitest.config.ts` - Main config (excludes benchmarks)
- โ
`vitest.config.benchmark.ts` - Benchmark-only config
- โ
Sequential test execution for isolation
- โ
Comprehensive mocking for LLM client
- โ
Integration test coverage for multi-agent scenarios
## ๐ Documentation Updates
### New Documentation
- **PARALLEL_EXECUTION_SUMMARY.md** - Complete guide to parallel execution
- **IMPLEMENTATION_SUMMARY.md** - Updated with v3.1 features
- **CHANGELOG_v3.1.md** - This file
### Updated Documentation
- **README.md** - Added multi-agent features section, updated tool count
- **AGENTS.md** - Added parallel execution guide, updated tool list
- All docs now reference 25 total tools (was 16)
## ๐ง Tool Count Update
**Total: 25 MCP Tools** (up from 16)
- TODO Management: 7 tools
- Knowledge Graph: 15 tools (was 11, +4 locking tools)
- File Indexing: 4 tools
- Utility: 1 tool
## ๐๏ธ Code Changes
### Modified Files
- `src/managers/GraphManager.ts` - Added locking methods (864 lines)
- `src/types/IGraphManager.ts` - Added locking interfaces (221 lines)
- `src/tools/graph.tools.ts` - Added 4 locking tools (441 lines)
- `src/orchestrator/task-executor.ts` - Added parallel execution (577 lines)
- `src/index.ts` - Wired up new tools (578 lines)
- `package.json` - Updated test scripts
### New Files
- `testing/multi-agent-locking.test.ts` - 20 integration tests
- `testing/task-executor.test.ts` - 8 unit tests
- `testing/task-executor-integration.test.ts` - 10 integration tests
- `vitest.config.ts` - Main test configuration
- `vitest.config.benchmark.ts` - Benchmark test configuration
- `docs/PARALLEL_EXECUTION_SUMMARY.md` - Parallel execution guide
## ๐ Performance
### Parallel Execution Benefits
**Example:** 3 tasks with diamond dependencies
- **Before (Sequential):** Task1(2s) + Task2(3s) + Task3(3s) = **8s total**
- **After (Parallel):** Task1(2s) + Parallel[Task2(3s), Task3(3s)] + Task4(2s) = **~5s total**
- **Improvement:** 37.5% faster
Real-world benefits depend on:
- Number of independent tasks
- Task duration variance
- Dependency structure
- LLM API rate limits
## ๐ Upgrade Guide
### For Developers
1. Pull latest code
2. Run `npm install && npm run build`
3. Tests should pass: `npm test` (107 tests)
4. Optional: Run benchmarks: `npm run test:benchmark` (16 tests)
### For PM Agents
Use parallel groups in chain output:
```markdown
### Task ID: task-1
**Parallel Group:** 1
...
### Task ID: task-2
**Parallel Group:** 1
...
```
### For Worker Agents
Claim tasks before executing:
```typescript
const locked = await memory_lock_node(taskId, agentId, 300000);
if (locked) {
// Execute task
await memory_unlock_node(taskId, agentId);
}
```
## ๐ฏ What's Next
### Phase 2: Advanced Multi-Agent (Q4 2025)
**See [Phase 2 Implementation Plan](docs/PHASE_2_IMPLEMENTATION_PLAN.md) for detailed roadmap**
- Worker agent context isolation (2 weeks)
- QC agent verification system (2 weeks)
- Adversarial validation loop (1 week)
- Agent performance metrics (2 weeks)
**Timeline:** 7 weeks + 3 weeks testing/deployment = 10 weeks total
### Phase 3: Advanced RAG (Q1 2026)
- Semantic code analysis
- Cross-file dependency tracking
- Intelligent code search
- Context-aware suggestions
---
**Version:** 3.1
**Release Date:** 2025-10-17
**Status:** Phase 1 Complete โ