Commit graph

11 commits

Author SHA1 Message Date
xlrrrr
67e83260bf fix(search): harden SkillRanker embedding cache
Avoid promoting unverifiable legacy embeddings into content-addressed cache entries, persist empty invalidations, and make cache writes safer for shared search usage.
2026-05-13 03:06:25 +08:00
Fabio Scarsi
37083593d6 fix(search): content-addressed SkillRanker cache key
The embedding cache was keyed by skill_id alone, so any edit to a
SKILL.md body or description produced stale embeddings that
get_or_compute_embedding kept serving until a manual invalidate_cache
call or a file deletion. Previously this was mostly invisible because
select_skills_with_llm was the only caller exercising the cache; after
the preceding commit wires search_skills through the same path the
staleness becomes observable on every MCP query.

Use "{skill_id}:{sha256(embedding_text)[:16]}" as the cache key, so
any change to the text produced by _build_embedding_text (name +
description + body, truncated to SKILL_EMBEDDING_MAX_CHARS) causes
an automatic cache miss and a fresh embedding. Both
get_or_compute_embedding and _embedding_rank are updated.

Bounded growth: on each successful new compute, older entries with
the same "{skill_id}:" prefix are pruned in the same write. Net
result: at most one cached embedding per skill_id at any time, aside
from transient migration state.

Backward compatibility: existing pickle files keyed by skill_id alone
are migrated in place on first lookup (no API call needed); the old
key is dropped after migration.

invalidate_cache(skill_id) now removes every content-addressed entry
and any legacy entry for that skill_id, so historical versions do
not leak across evolutions.

Functional benchmark on a 28-skill local registry with
text-embedding-3-small via OpenRouter: top-1 match identity preserved
on all test queries, score drift below 0.001, warm latency
~260-400ms/query (unchanged from the previous commit).
2026-04-18 12:44:47 +02:00
xlrrrr
020a879944 feat: track evolution candidate processing lifecycle 2026-04-16 22:04:22 +08:00
xlrrrr
79a98abda7 fix: CAPTURED skills write to correct host agent skill dir 2026-04-10 20:57:17 +08:00
Dennis-yxchen
a23792a66b fix: tighten pr-60 review follow-ups 2026-04-06 20:13:42 +08:00
yc111233
f3a064df1c fix: address 8 runtime bugs found during code review
1. Race condition on _addressed_degradations (evolver.py) — add asyncio.Lock
2. Silent exception swallowing in wait_background (evolver.py) — log failures
3. Workspace cleanup could delete user files (tool_layer.py) — add mtime guard
4. WAL cleanup without lock check (store.py) — probe for DB lock first
5. Edit distance threshold too loose (analyzer.py) — adaptive threshold + ambiguity rejection
6. Message truncation drops context (grounding_agent.py) — add truncation notice
7. Whitespace-only empty response not detected (grounding_agent.py) — strip before check
8. Tool name reverse parsing with __ (client.py, manager.py) — use rsplit
2026-04-06 01:02:35 +08:00
Dennis-yxchen
aa16419e46 docs: update register_skill_dir docstring to reflect idempotent return 2026-03-31 14:58:01 +08:00
d 🔹
c8fb895feb fix: register_skill_dir returns existing SkillMeta for already-registered skills
Fixes #29. When a skill is already registered, register_skill_dir()
returned None, which caused fix_skill() to incorrectly report a failure.

Now returns the existing SkillMeta instead of None when the skill_id
is already present in the registry, making register_skill_dir() truly
idempotent as its callers (fix_skill, _auto_register_skill_dirs) expect.
2026-03-28 19:06:42 +00:00
warren618
1257f4cfee fix(evolver): use stem-style matching for confirm/reject/skip keywords
Per reviewer feedback: keep strict \byes\b / \bno\b word boundaries to
prevent false positives, but widen confirm/reject/skip to stem-style
\bconfirm\w*\b etc. so common LLM variants like "confirmed", "rejected",
"skipping" still parse correctly instead of falling through to the
default False path.
2026-03-27 13:34:20 +08:00
warren618
9333eaed42 fix(evolver): use word-boundary matching in _parse_confirmation to prevent false positives 2026-03-26 12:06:11 +08:00
spidercatfly
6ff4861f88 initial commit 2026-03-24 16:03:22 +08:00