Phase 14: split kept-window filter from registry gate — defer planning stage
filterSkillsNeedingReinjectByKept tracks absent skills without registeredNames; immediate path keeps the combined filter. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+17
-7
@@ -56,17 +56,27 @@ export function skillsPresentInKeptWindow(
|
||||
return present;
|
||||
}
|
||||
|
||||
/** Tracked skills absent from kept window — defer planning stage without registry filter (Phase 14 / B-002). */
|
||||
export function filterSkillsNeedingReinjectByKept(
|
||||
tracked: readonly TrackedSkill[],
|
||||
keptPresent: ReadonlySet<string>,
|
||||
): string[] {
|
||||
const needing: string[] = [];
|
||||
for (const skill of tracked) {
|
||||
if (!keptPresent.has(skill.name)) {
|
||||
needing.push(skill.name);
|
||||
}
|
||||
}
|
||||
return needing;
|
||||
}
|
||||
|
||||
/** Tracked skills missing from kept window but still registered (SPEC §5.2, §6.4). */
|
||||
export function filterSkillsNeedingReinject(
|
||||
tracked: readonly TrackedSkill[],
|
||||
keptPresent: ReadonlySet<string>,
|
||||
registeredNames: ReadonlySet<string>,
|
||||
): string[] {
|
||||
const needing: string[] = [];
|
||||
for (const skill of tracked) {
|
||||
if (registeredNames.has(skill.name) && !keptPresent.has(skill.name)) {
|
||||
needing.push(skill.name);
|
||||
}
|
||||
}
|
||||
return needing;
|
||||
return filterSkillsNeedingReinjectByKept(tracked, keptPresent).filter((name) =>
|
||||
registeredNames.has(name),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user