Squash Odysseus development history

This commit is contained in:
pewdiepie-archdaemon
2026-09-11 06:04:19 +00:00
parent c9dd68d890
commit 84aa9a91de
871 changed files with 265870 additions and 27854 deletions
+37
View File
@@ -42,6 +42,7 @@ def _write_skill_md(skills_root: Path, name: str, *, requires: str = "",
fm += [
"status: published",
"confidence: 0.9",
"audit_verdict: pass",
"source: learned",
"created: 2026-01-01T00:00:00Z",
"---",
@@ -66,6 +67,7 @@ def test_requires_toolsets_not_gated_when_active_set_unknown(tmp_path):
(tmp_path / "skills").mkdir()
_write_skill_md(tmp_path / "skills", "notes-lookup", requires="grep, read_file")
sm = SkillsManager(str(tmp_path))
sm.set_audit("notes-lookup", "pass")
# None = caller doesn't know the active tool set → no gating.
assert "notes-lookup" in _names(sm.index_for())
@@ -76,6 +78,7 @@ def test_requires_toolsets_gates_on_explicit_list(tmp_path):
(tmp_path / "skills").mkdir()
_write_skill_md(tmp_path / "skills", "notes-lookup", requires="grep, read_file")
sm = SkillsManager(str(tmp_path))
sm.set_audit("notes-lookup", "pass")
# Explicit list missing a required tool → hidden.
assert "notes-lookup" not in _names(sm.index_for(active_toolsets=["grep"]))
@@ -89,6 +92,7 @@ def test_fallback_for_toolsets_unaffected_by_none(tmp_path):
(tmp_path / "skills").mkdir()
_write_skill_md(tmp_path / "skills", "web-fallback", fallback="web_search")
sm = SkillsManager(str(tmp_path))
sm.set_audit("web-fallback", "pass")
# Fallback skills hide only when the toolset they substitute for is
# known to be active.
@@ -96,3 +100,36 @@ def test_fallback_for_toolsets_unaffected_by_none(tmp_path):
assert "web-fallback" in _names(sm.index_for(active_toolsets=[]))
assert "web-fallback" not in _names(
sm.index_for(active_toolsets=["web_search"]))
def test_inconclusive_audit_hides_an_unapproved_skill(tmp_path):
(tmp_path / "skills").mkdir()
_write_skill_md(tmp_path / "skills", "release-checklist")
sm = SkillsManager(str(tmp_path))
sm.set_audit("release-checklist", "inconclusive")
assert "release-checklist" not in _names(sm.index_for())
def test_failed_audit_hides_an_approved_skill(tmp_path):
(tmp_path / "skills").mkdir()
_write_skill_md(tmp_path / "skills", "release-checklist")
sm = SkillsManager(str(tmp_path))
sm.set_audit("release-checklist", "fail")
assert "release-checklist" not in _names(sm.index_for())
def test_unaudited_or_below_threshold_published_skill_is_not_injected(tmp_path):
(tmp_path / "skills").mkdir()
path = _write_skill_md(tmp_path / "skills", "premature-skill")
text = path.read_text(encoding="utf-8")
text = text.replace("audit_verdict: pass\n", "")
text = text.replace("confidence: 0.9", "confidence: 0.72")
path.write_text(text, encoding="utf-8")
sm = SkillsManager(str(tmp_path))
assert "premature-skill" not in _names(sm.index_for())
assert not sm.get_relevant_skills(
"premature skill", min_confidence=0.80,
)