fix: use skill activity in curator status

Treat skill views and edits as activity when curator reports and applies lifecycle transitions, so recently loaded or patched skills are not displayed or transitioned as never used.\n\nAdds regression tests for activity derivation, automatic transitions, and CLI status output.
This commit is contained in:
y0shualee 2026-04-30 20:23:17 +08:00 committed by Teknium
parent 564a649e6a
commit f4b76fa272
6 changed files with 193 additions and 16 deletions

View file

@ -401,6 +401,26 @@ def test_agent_created_report_excludes_bundled_and_hub(skills_home):
assert "hubbed" not in names
def test_agent_created_report_derives_activity_from_view_and_patch(skills_home, monkeypatch):
import tools.skill_usage as skill_usage
skills_dir = skills_home / "skills"
_write_skill(skills_dir, "mine")
timestamps = iter([
"2026-04-30T10:00:00+00:00",
"2026-04-30T11:00:00+00:00",
"2026-04-30T12:00:00+00:00",
"2026-04-30T13:00:00+00:00",
])
monkeypatch.setattr(skill_usage, "_now_iso", lambda: next(timestamps))
skill_usage.bump_view("mine")
skill_usage.bump_patch("mine")
row = next(r for r in skill_usage.agent_created_report() if r["name"] == "mine")
assert row["activity_count"] == 2
assert row["last_activity_at"] == "2026-04-30T12:00:00+00:00"
# ---------------------------------------------------------------------------
# Provenance guard — telemetry must not leak records for bundled/hub skills