Skip to content

feat(core): skill curator usage ledger, lifecycle and package-aware archive (#593 part 1) - #659

Merged
ajianaz merged 2 commits into
developfrom
feat/skill-curator-core
Nov 13, 2026
Merged

ajianaz merged 2 commits into
developfrom
feat/skill-curator-core

Conversation

@ajianaz

@ajianaz ajianaz commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

What

Part 1 of #593: the deterministic core of the skill curator, tole_core::skill_curator. No command or config key yet (part 2).

Why

A growing library fills with narrow near-duplicates and skills nobody uses, which waste tokens and pollute recall (design skills-registry-design.md §4.5, §6.4; owner: on by default, can be switched off or paused). The lifecycle, the ledgers and the package moves are all LLM-free, so they come first and can be tested without a model.

Changes

  • crates/tole-core/src/skill_curator.rs (new):
    • Usage ledger skill-usage.jsonl, append-only: recalled, loaded, success and failure per skill, and a baseline for runs that loaded no skill. A recall alone is not use. Malformed lines are skipped; past 8 MiB only the newest lines are read.
    • Lifecycle, derived from the ledger and never stored: active, stale after 14 days without a load or outcome, archived after 30, 30 days of grace for a skill never used. A pinned skill, a skill a cron job names and a skill that is not agent-grown or adopted get no assessment. archive_days must exceed stale_days.
    • Underperformers: a managed skill whose success rate is at least 0.2 below the skill-less baseline, with at least 5 outcomes on each side. A proposal for the owner.
    • Package-aware archive and restore with an append-only mutation ledger (id, time, from, to, package hash before and after, reason). The whole directory moves, so references/, scripts/ and assets/ stay with SKILL.md. Restore refuses a taken place and an archived copy that changed since. A symlink, a missing directory and a bad name are refused.
    • Curator state (paused, pinned, locked, adopted) in skill-curator.json, written atomically.
  • skill_approval::read_dir_package reads a package by directory.
  • CHANGELOG.md and docs/epics.md are updated in this PR.

Testing

  • cargo fmt --all; clippy -D warnings on tole-core (also --no-default-features) and the workspace lib and bins: clean.
  • 12 new unit tests: ledger fold, malformed lines, oversized tail, the lifecycle thresholds and grace, protected and unmanaged skills, threshold validation, underperformers with too little data, archive and restore round trip with package files and hashes, refusals (taken place, changed copy, unknown name, bad name, missing dir, symlink), state round trip. cargo test -p tole-core: all pass.
  • Cora agent review: review_prepare 0 deterministic findings, review_finalize should_block: false with one info note (mutation ids assume one sweep at a time; part 2 takes a lock).

…rchive (#593 part 1)

Adds tole_core::skill_curator: an append-only usage ledger, a derived
active/stale/archived lifecycle with grace, pin and cron protection,
underperformer detection against a skill-less baseline, and archive and
restore of whole skill packages recorded in a mutation ledger.
before_hash: before.hash,
after_hash: after.hash,
reason: reason.chars().take(200).collect(),
};
@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

🔍 Cora AI Code Review

✅ No issues found. Code looks good!


Review powered by cora-code · BYOK · MIT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants