Skip to content

feat(skills): recall skills per session through the uteke index - #616

Merged
ajianaz merged 1 commit into
developfrom
feat/skill-recall-wiring
Nov 11, 2026
Merged

ajianaz merged 1 commit into
developfrom
feat/skill-recall-wiring

Conversation

@ajianaz

@ajianaz ajianaz commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

What

Part 2 of #590: sessions can now use the skill index that #613 added. With TOLE_SKILL_INDEX=uteke, tole run lists a pinned core plus the skills recalled for its prompt, every session gets the skill_search tool, and a new tole skills index|retire|search command maintains the uteke index. The default (local) is unchanged.

Why

Closes #590 (epic #589). #613 added the SkillIndex seam, the uteke adapter and the selection logic, but no session used them. This PR connects them to sessions, as decided in docs/skills-registry-design.md §4 and §7.

Changes

  • crates/tole-cli/src/skill_recall.rs (new):
    • Settings, from the environment:
      • TOLE_SKILL_INDEX is local (the default) or uteke.
      • TOLE_SKILLS_PINNED is a comma-separated list, at most 5.
      • TOLE_SKILL_RECALL_K is 0 to 10 (default 5).
      • TOLE_SKILL_FLOOR is 0.0 to 1.0 (default 0.35). That default is a documented starting value, not a calibrated one.
      • Any other value fails startup. A blank value counts as unset.
    • skills_section: builds the skills part of the system prompt.
      • local keeps today's full listing exactly.
      • uteke shows the pinned core plus the top K recalled for the brief, and registers skill_search.
      • uteke without the binary falls back to local with a note.
    • Profile scope: the active --profile name (feat(config): profiles with model tiers, allowlist, memory room and skills #584) is the SkillFilter scope, so skills indexed for other profiles are not recalled. Profiles have no role field yet, so the recall query's role is None.
    • RedactingIndex: every query is redacted against the process secrets (provider_chain::process_secrets) before it reaches the index, because uteke doc search may send it to a cloud store. That covers the recall brief, a model-written skill_search query and a tole skills search query. Upsert and retire pass through unchanged.
    • tole skills (shell-tools builds):
      • index upserts every discovered skill with its name, description, status approved and the SKILL.md content hash. The body is never sent.
      • retire <name> keeps the skill on disk but stops it being recalled.
      • search <query> shows what a brief would recall. It uses the floor, --profile (default: the active profile), and descriptions read from the local files.
  • main.rs:
    • run passes its prompt as the brief.
    • chat, resume, the TUI and the server faces pass None, so they get the pinned core plus skill_search.
    • Adds the Skills subcommand (the config trust gate is skipped for it, like other maintenance commands).
  • config_apply.rs: ProviderFill.profile_name, set by fill_with_profile, with a profile_name() accessor.
  • Docs: the four variables in the README, a threat-model update (only names come from the index, the brief is the query, redaction, profile scope), the design doc status and the floor note, epics, and CHANGELOG.

Testing

All run locally on head 997bdfa (one commit on develop ae21fc6):

  • cargo test --workspace passes: 1420 passed, 0 failed (79 suites).
  • cargo test -p tole-cli --no-default-features passes: 420 passed, 0 failed. The e2e file is gated on shell-tools, because without it there is no uteke adapter.
  • cargo test -p tole-core --no-default-features passes: 481 passed, 0 failed.
  • cargo fmt --all -- --check passes.
  • cargo clippy --workspace --all-targets -- -D warnings passes, and so does cargo clippy -p tole-cli --no-default-features --features shell-tools -- -D warnings.
  • cora review --no-llm --base origin/develop (cora v0.20.0): "No issues found". The LLM review is CI Cora Review.
  • Smoke test: tests/skill_index_e2e.rs runs the real tole binary with a fake uteke on PATH and a mock provider that echoes the system message back. No real uteke store is available here; the 0.35 floor still needs checking with tole skills search on a real store.

New tests:

  • skill_recall::tests:
    • settings_default_to_local_and_reject_bad_values
    • local_mode_lists_everything_like_before
    • uteke_mode_shows_pinned_plus_recalled_and_registers_skill_search
    • index_all_upserts_each_discovered_skill_with_its_file_hash
    • queries_reach_the_index_redacted_and_profile_scoped
    • uteke_mode_without_the_binary_falls_back_with_a_note
  • tests/skill_index_e2e.rs:
    • uteke_index_lists_pinned_plus_recalled_for_the_run_prompt
    • default_index_lists_every_skill_and_never_calls_uteke_for_skills
    • an_invalid_setting_fails_startup
  • config_apply_tests::fill_with_profile_carries_the_profile_model_and_persona now also checks profile_name.

Red/green: each behavior was broken on purpose, the named test was seen failing, the file was restored, and the test passed again. All 8 mutants were killed:

Broken variant Test that failed
local mode no longer the full listing local_mode_lists_everything…
brief not used as the recall query uteke_mode_shows_pinned…
K above 10 accepted settings_default_to_local…
run does not pass its prompt uteke_index_lists_pinned_plus_recalled… (e2e)
index hashes something other than the SKILL.md bytes index_all_upserts…
query not redacted queries_reach_the_index_redacted…
profile dropped from the filter queries_reach_the_index_redacted…
profile name not carried in the fill fill_with_profile_carries…

Related Issues

Closes #590. Epic #589. Follows #613 (part 1). Next: #591 (approved-hash loading). A follow-up will add a [skills] config table and per-profile pinned skills.

Checklist

  • Branch name follows convention (feat/skill-recall-wiring)
  • Branch is from develop
  • Commit messages follow Conventional Commits
  • No secrets or credentials committed
  • One logical change per PR

Sessions opt in with TOLE_SKILL_INDEX=uteke (TOLE_SKILLS_PINNED,
TOLE_SKILL_RECALL_K, TOLE_SKILL_FLOOR; invalid values fail startup).
run lists the pinned core plus the skills recalled for its prompt; chat,
resume and the TUI list the pinned core; all get skill_search. The
default local keeps the full listing, and uteke without the binary falls
back to it with a note. New tole skills index|retire|search maintains
the index; index sends name, description, status and hash, never the
body.

The active --profile name scopes the recall. Every query sent to the
index (the recall brief, a skill_search query, a tole skills search
query) is redacted against the process secrets first, because uteke may
forward it to a cloud store.

Closes #590.
@github-actions

Copy link
Copy Markdown

🔍 Cora AI Code Review

✅ No issues found. Code looks good!


Review powered by cora-code · BYOK · MIT

@ajianaz
ajianaz merged commit 46901a3 into develop Nov 11, 2026
18 of 20 checks passed
@ajianaz
ajianaz deleted the feat/skill-recall-wiring branch November 20, 2026 08:37
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.

feat(skills): SkillIndex seam with a uteke doc adapter, pinned core and top-K recall

2 participants