(task: Task)
| 87 | } |
| 88 | |
| 89 | private async process(task: Task): Promise<void> { |
| 90 | const chunks = this.store.getChunksByTask(task.id); |
| 91 | |
| 92 | const { pass, skipReason } = this.evaluator.passesRuleFilter(chunks, task); |
| 93 | if (!pass) { |
| 94 | this.ctx.log.debug(`SkillEvolver: task ${task.id} skipped by rule filter: ${skipReason} (chunks=${chunks.length})`); |
| 95 | this.store.setTaskSkillMeta(task.id, { skillStatus: "skipped", skillReason: skipReason }); |
| 96 | return; |
| 97 | } |
| 98 | |
| 99 | const preferUpgrade = this.ctx.config.skillEvolution?.preferUpgradeExisting ?? DEFAULTS.skillPreferUpgrade; |
| 100 | const relatedSkill = await this.findRelatedSkill(task); |
| 101 | |
| 102 | if (relatedSkill) { |
| 103 | await this.handleExistingSkill(task, chunks, relatedSkill); |
| 104 | } else if (preferUpgrade) { |
| 105 | const nameCandidate = await this.findSkillByNameSimilarity(task); |
| 106 | if (nameCandidate) { |
| 107 | this.ctx.log.info(`SkillEvolver: preferUpgrade found name-similar skill "${nameCandidate.name}" for task "${task.title}"`); |
| 108 | await this.handleExistingSkill(task, chunks, nameCandidate); |
| 109 | } else { |
| 110 | await this.handleNewSkill(task, chunks); |
| 111 | } |
| 112 | } else { |
| 113 | await this.handleNewSkill(task, chunks); |
| 114 | } |
| 115 | } |
| 116 | |
| 117 | /** Max candidates to send to LLM for relevance judgment. */ |
| 118 | private static readonly RELATED_SKILL_CANDIDATE_TOP = 10; |
no test coverage detected