Repository navigation
feat(cli): tole skills drafts promote and revoke (#592 part 3) - #658
Merged
Merged
Conversation
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.
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-code · BYOK · MIT |
1 task done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Part 3 of #592, which closes it:
tole skills drafts promoteturns a draft into an approved skill, andtole skills drafts revoketakes back what grew from a poisoned source. It also fixes a clap panic intole 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 hashshowprinted) 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 isnew(conflictis never promoted;patchandreferencemean 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.SKILL.mdthe 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.DraftStatus::Revoked,Promotionon the draft record (old records still load),DraftStore::promote,revokeandby_session;decidenow only rejects.skills approve --workspaceandskills list --workspacepanicked on develop ("Mismatch between definition and access ofworkspace") because the subcommand declared a path while the global--workspaceis 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 warningsontole-core(also--no-default-features) and ontole-clilib, bins and every test target excepttui_e2e: clean.skill_draftsunit 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.developon macOS:tui_e2edoes not compile (libc::openpty), 3delegate::tests andcompaction_e2e::doctor_warns_non_fatally_about_a_missing_windowfail;serve_imagesandsetup_cora_e2eare flaky locally. CI runs on Linux.review_prepare0 deterministic findings,review_finalizeshould_block: false.