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

@@ -30,7 +30,6 @@ Every task description uses structured format for clarity:
```
TaskCreate({
subject: "<TASK-ID>",
owner: "<role>",
description: "PURPOSE: <what this task achieves> | Success: <measurable completion criteria>
TASK:
- <step 1: specific action>
@@ -46,9 +45,9 @@ EXPECTED: <deliverable path> + <quality criteria>
CONSTRAINTS: <scope limits, focus areas>
---
InnerLoop: <true|false>
<additional-metadata-fields>",
blockedBy: [<dependency-list>]
<additional-metadata-fields>"
})
TaskUpdate({ taskId: "<TASK-ID>", addBlockedBy: [<dependency-list>], owner: "<role>" })
```
### Standard Pipeline Tasks
@@ -57,7 +56,6 @@ InnerLoop: <true|false>
```
TaskCreate({
subject: "SCAN-001",
owner: "scanner",
description: "PURPOSE: Scan UI components to identify interaction issues (unresponsive buttons, missing feedback, state not refreshing) | Success: Complete issue report with file:line references and severity classification
TASK:
- Detect framework (React/Vue) from project structure
@@ -73,17 +71,15 @@ CONTEXT:
EXPECTED: artifacts/scan-report.md with structured issue list (severity: High/Medium/Low, file:line, description, category)
CONSTRAINTS: Focus on interaction issues only, exclude styling/layout problems
---
InnerLoop: false",
blockedBy: [],
status: "pending"
InnerLoop: false"
})
TaskUpdate({ taskId: "SCAN-001", owner: "scanner" })
```
**DIAG-001: Root Cause Diagnosis**
```
TaskCreate({
subject: "DIAG-001",
owner: "diagnoser",
description: "PURPOSE: Diagnose root causes of identified UI issues | Success: Complete diagnosis report with fix recommendations for each issue
TASK:
- Load scan report from artifacts/scan-report.md
@@ -100,17 +96,15 @@ CONTEXT:
EXPECTED: artifacts/diagnosis.md with root cause analysis (issue ID, root cause, pattern type, fix recommendation)
CONSTRAINTS: Focus on actionable root causes, provide specific fix strategies
---
InnerLoop: false",
blockedBy: ["SCAN-001"],
status: "pending"
InnerLoop: false"
})
TaskUpdate({ taskId: "DIAG-001", addBlockedBy: ["SCAN-001"], owner: "diagnoser" })
```
**DESIGN-001: Solution Design**
```
TaskCreate({
subject: "DESIGN-001",
owner: "designer",
description: "PURPOSE: Design feedback mechanisms and state management solutions for identified issues | Success: Complete implementation guide with code patterns and examples
TASK:
- Load diagnosis report from artifacts/diagnosis.md
@@ -128,17 +122,15 @@ CONTEXT:
EXPECTED: artifacts/design-guide.md with implementation guide (issue ID, solution design, code patterns, state management examples, UI binding templates)
CONSTRAINTS: Solutions must be framework-appropriate, provide complete working examples
---
InnerLoop: false",
blockedBy: ["DIAG-001"],
status: "pending"
InnerLoop: false"
})
TaskUpdate({ taskId: "DESIGN-001", addBlockedBy: ["DIAG-001"], owner: "designer" })
```
**IMPL-001: Code Implementation**
```
TaskCreate({
subject: "IMPL-001",
owner: "implementer",
description: "PURPOSE: Generate fix code with proper state management, event handling, and UI feedback bindings | Success: All fixes implemented and validated
TASK:
- Load design guide from artifacts/design-guide.md
@@ -158,17 +150,15 @@ CONTEXT:
EXPECTED: artifacts/fixes/ directory with all fix files, implementation summary in artifacts/fixes/README.md
CONSTRAINTS: Maintain existing code style, ensure backward compatibility, validate all changes
---
InnerLoop: true",
blockedBy: ["DESIGN-001"],
status: "pending"
InnerLoop: true"
})
TaskUpdate({ taskId: "IMPL-001", addBlockedBy: ["DESIGN-001"], owner: "implementer" })
```
**TEST-001: Test Validation**
```
TaskCreate({
subject: "TEST-001",
owner: "tester",
description: "PURPOSE: Generate and run tests to verify fixes (loading states, error handling, state updates) | Success: Pass rate >= 95%, all critical fixes validated
TASK:
- Detect test framework (Jest/Vitest) from project
@@ -187,10 +177,9 @@ CONTEXT:
EXPECTED: artifacts/test-report.md with test results (pass/fail counts, coverage metrics, fix iterations, remaining issues)
CONSTRAINTS: Pass rate threshold: 95%, max fix iterations: 5
---
InnerLoop: false",
blockedBy: ["IMPL-001"],
status: "pending"
InnerLoop: false"
})
TaskUpdate({ taskId: "TEST-001", addBlockedBy: ["IMPL-001"], owner: "tester" })
```
---