feat: Enhance search functionality with quality tiers and scoped indexing

- Updated `search_code` function to include a `quality` parameter for search quality tiers: "fast", "balanced", "thorough", and "auto".
- Introduced `search_scope` function to limit search results to a specific directory scope.
- Added `index_scope` function for indexing a specific directory without re-indexing the entire project.
- Refactored `SearchPipeline` to support quality-based routing in the `search` method.
- Implemented `Shard` and `ShardManager` classes to manage multiple index shards with LRU eviction and efficient file routing.
- Added debounce functionality in `IncrementalIndexer` to batch file events and reduce redundant processing.
- Enhanced `FileWatcher` to integrate with `IncrementalIndexer` for improved event handling.
This commit is contained in:
catlog22
2026-03-19 17:47:53 +08:00
parent 54071473fc
commit 18aff260a0
46 changed files with 1537 additions and 658 deletions

View File

@@ -1,16 +1,16 @@
# Dispatch Tasks
Create task chains from dependency graph with proper blockedBy relationships.
Create task chains from dependency graph with proper addBlockedBy relationships.
## Workflow
1. Read task-analysis.json -> extract pipeline_mode and dependency_graph
2. Read specs/pipelines.md -> get task registry for selected pipeline
3. Topological sort tasks (respect blockedBy)
3. Topological sort tasks (respect addBlockedBy)
4. Validate all owners exist in role registry (SKILL.md)
5. For each task (in order):
- TaskCreate with structured description (see template below)
- TaskUpdate with blockedBy + owner assignment
- TaskUpdate with addBlockedBy + owner assignment
6. Update session.json with pipeline.tasks_total
7. Validate chain (no orphans, no cycles, all refs valid)
@@ -38,51 +38,51 @@ RoleSpec: ~ or <project>/.claude/skills/team-quality-assurance/roles/<role>/rol
### Discovery Mode
```
SCOUT-001 (scout): Multi-perspective issue scanning
blockedBy: []
addBlockedBy: []
QASTRAT-001 (strategist): Test strategy formulation
blockedBy: [SCOUT-001]
addBlockedBy: [SCOUT-001]
QAGEN-001 (generator): L1 unit test generation
blockedBy: [QASTRAT-001], meta: layer=L1
addBlockedBy: [QASTRAT-001], meta: layer=L1
QARUN-001 (executor): L1 test execution + fix cycles
blockedBy: [QAGEN-001], inner_loop: true, meta: layer=L1
addBlockedBy: [QAGEN-001], inner_loop: true, meta: layer=L1
QAANA-001 (analyst): Quality analysis report
blockedBy: [QARUN-001]
addBlockedBy: [QARUN-001]
```
### Testing Mode
```
QASTRAT-001 (strategist): Test strategy formulation
blockedBy: []
addBlockedBy: []
QAGEN-L1-001 (generator): L1 unit test generation
blockedBy: [QASTRAT-001], meta: layer=L1
addBlockedBy: [QASTRAT-001], meta: layer=L1
QARUN-L1-001 (executor): L1 test execution + fix cycles
blockedBy: [QAGEN-L1-001], inner_loop: true, meta: layer=L1
addBlockedBy: [QAGEN-L1-001], inner_loop: true, meta: layer=L1
QAGEN-L2-001 (generator): L2 integration test generation
blockedBy: [QARUN-L1-001], meta: layer=L2
addBlockedBy: [QARUN-L1-001], meta: layer=L2
QARUN-L2-001 (executor): L2 test execution + fix cycles
blockedBy: [QAGEN-L2-001], inner_loop: true, meta: layer=L2
addBlockedBy: [QAGEN-L2-001], inner_loop: true, meta: layer=L2
QAANA-001 (analyst): Quality analysis report
blockedBy: [QARUN-L2-001]
addBlockedBy: [QARUN-L2-001]
```
### Full Mode
```
SCOUT-001 (scout): Multi-perspective issue scanning
blockedBy: []
addBlockedBy: []
QASTRAT-001 (strategist): Test strategy formulation
blockedBy: [SCOUT-001]
addBlockedBy: [SCOUT-001]
QAGEN-L1-001 (generator-1): L1 unit test generation
blockedBy: [QASTRAT-001], meta: layer=L1
addBlockedBy: [QASTRAT-001], meta: layer=L1
QAGEN-L2-001 (generator-2): L2 integration test generation
blockedBy: [QASTRAT-001], meta: layer=L2
addBlockedBy: [QASTRAT-001], meta: layer=L2
QARUN-L1-001 (executor-1): L1 test execution + fix cycles
blockedBy: [QAGEN-L1-001], inner_loop: true, meta: layer=L1
addBlockedBy: [QAGEN-L1-001], inner_loop: true, meta: layer=L1
QARUN-L2-001 (executor-2): L2 test execution + fix cycles
blockedBy: [QAGEN-L2-001], inner_loop: true, meta: layer=L2
addBlockedBy: [QAGEN-L2-001], inner_loop: true, meta: layer=L2
QAANA-001 (analyst): Quality analysis report
blockedBy: [QARUN-L1-001, QARUN-L2-001]
addBlockedBy: [QARUN-L1-001, QARUN-L2-001]
SCOUT-002 (scout): Regression scan after fixes
blockedBy: [QAANA-001]
addBlockedBy: [QAANA-001]
```
## InnerLoop Flag Rules

View File

@@ -72,9 +72,9 @@ EXPECTED: <session>/results/run-<layer>-gc-<round>.json
CONSTRAINTS: Read-only execution
---
InnerLoop: false
RoleSpec: ~ or <project>/.claude/skills/team-quality-assurance/roles/executor/role.md",
blockedBy: ["QAGEN-fix-<round>"]
RoleSpec: ~ or <project>/.claude/skills/team-quality-assurance/roles/executor/role.md"
})
TaskUpdate({ taskId: "QARUN-gc-<round>", addBlockedBy: ["QAGEN-fix-<round>"] })
```
6. -> handleSpawnNext

View File

@@ -111,13 +111,13 @@ Delegate to @commands/dispatch.md:
1. Read dependency graph from task-analysis.json
2. Read specs/pipelines.md for selected pipeline's task registry
3. Topological sort tasks
4. Create tasks via TaskCreate with blockedBy
4. Create tasks via TaskCreate, then TaskUpdate with addBlockedBy
5. Update session.json
## Phase 4: Spawn-and-Stop
Delegate to @commands/monitor.md#handleSpawnNext:
1. Find ready tasks (pending + blockedBy resolved)
1. Find ready tasks (pending + all addBlockedBy dependencies resolved)
2. Spawn team-worker agents (see SKILL.md Spawn Template)
3. Output status summary
4. STOP