Skip to content

feat(cli): tole skills drafts promote and revoke (#592 part 3) - #658

Merged
ajianaz merged 3 commits into
developfrom
feat/skill-promote
Nov 13, 2026
Merged

ajianaz merged 3 commits into
developfrom
feat/skill-promote

Conversation

@ajianaz

@ajianaz ajianaz commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

What

Part 3 of #592, which closes it: tole skills drafts promote turns a draft into an approved skill, and tole skills drafts revoke takes back what grew from a poisoned source. It also fixes a clap panic in tole skills approve|list --workspace.

Why

Parts 1 and 2 (#656, #657) produce drafts that nothing can load. The owner needs the last step: promote exact bytes after reviewing them, and the design's revocation promise (§4.4: "revoke derived skills when a source turns out poisoned").

Changes

  • promote <id> shows the draft, then asks; without a terminal --hash (the content hash show printed) is required. It refuses: a decided draft, a SKILL.md that no longer matches the proposed hash, a name that fails the gate's name rule (the record is a file on disk, so it is re-checked), a name already in use, a tainted draft without --accept-taint, and a draft close to an existing skill unless its verdict is new (conflict is never promoted; patch and reference mean fold it in by hand, then reject). The approvals file is read before anything is written. It writes the bytes exactly as proposed into <workspace>/skills/<name> or the user-global skills dir, approves the package hash, records the promotion on the draft and indexes the skill when a uteke index is configured.
  • Hardening from an automated security review of this PR: the package approved is checked to be exactly the one SKILL.md the owner confirmed (its hash must equal that of [SKILL.md]), so a file that appears in the new directory meanwhile is never approved; a skills dir that is a symlink is refused.
  • revoke <session-or-draft-id> rejects the source's pending drafts and withdraws the approval of each promoted skill whose approval is still the promoted one; a skill the owner re-approved since is left alone and reported. The skill stays on disk.
  • Core: DraftStatus::Revoked, Promotion on the draft record (old records still load), DraftStore::promote, revoke and by_session; decide now only rejects.
  • Fix: skills approve --workspace and skills list --workspace panicked on develop ("Mismatch between definition and access of workspace") because the subcommand declared a path while the global --workspace is a string. They take a string now; the new end-to-end test covers it.
  • CHANGELOG.md, docs/epics.md (feat(skills): skill_propose drafts with provenance, taint, gate and meaning dedup #592 done) and the README status are updated in this PR.

Testing

  • cargo fmt --all; clippy -D warnings on tole-core (also --no-default-features) and on tole-cli lib, bins and every test target except tui_e2e: clean.
  • 12 skill_drafts unit tests in the CLI (happy path, consent, taint, dedup verdicts, name in use, changed draft, revoke, re-approved skill, tampered record and broken approvals file) and 3 end-to-end tests with the real binary (list, show, reject, promote, list approved, revoke, list not approved). Core tests all pass.
  • Not caused by this PR, reproduced on clean develop on macOS: tui_e2e does not compile (libc::openpty), 3 delegate:: tests and compaction_e2e::doctor_warns_non_fatally_about_a_missing_window fail; serve_images and setup_cora_e2e are flaky locally. CI runs on Linux.
  • Cora agent review: review_prepare 0 deterministic findings, review_finalize should_block: false.

promote writes the proposed bytes as a skill and approves them after the
owner confirms the exact hash; tainted and near-duplicate drafts are gated.
revoke withdraws what grew from a poisoned source. Also fixes a clap panic
on skills approve|list --workspace.
@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

@ajianaz
ajianaz merged commit ec05166 into develop Nov 13, 2026
15 checks passed
@ajianaz
ajianaz deleted the feat/skill-promote branch November 13, 2026 05:58
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.

1 participant