fix(skills): persist quarantined trust row for AutoSkill drafts at generation time - #6705
Merged
Merged
Conversation
…neration time SkillGenerator::write_quarantined wrote an AutoSkill draft's SKILL.md but never persisted a skill_trust DB row, so its first hot-reload had no existing row to preserve and fell through to skills.trust.default_level, silently trusting an unreviewed draft whenever an operator set default_level = "trusted". The _quarantine/ directory naming had no effect on the loader and never actually enforced quarantine. log_and_persist now eagerly writes a Quarantined skill_trust row right after generation, keyed on the name actually written to disk, with a guard that skips (and warns on) writing over an unrelated skill's trust row when a merge targets an existing Bundled or Trusted skill under a different path. The native-tool-ID collision warning is extracted into a shared helper so it fires at startup as well as on hot-reload, and no longer depends on SemanticMemory being configured. Closes #6702
bug-ops
enabled auto-merge (squash)
July 28, 2026 18:04
7 tasks
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.
Summary
SkillGenerator::write_quarantinedwrote an AutoSkill trace-extraction draft'sSKILL.mdto_quarantine/<name>/but never persisted askill_trustDB row. The doc comment claimed the_quarantinedirectory prefix kept the registry from ever loading these drafts, but the loader applies no directory-name filtering at all — quarantine was never actually enforced at the trust layer. Because no DB row existed yet, the draft's first hot-reload had no existing row to preserve and fell through to[skills.trust] default_level, silently trusting an unreviewed draft whenever an operator setdefault_level = "trusted". Separately, AutoSkill-generated names had no collision check against native tool IDs.trace_extraction::log_and_persistnow eagerly writes aQuarantinedskill_trustrow right after generation, keyed on the name actually written to disk (bothAddandMergebranches), before the skill can ever reach a hot-reload.SemanticMemorybeing configured and fires at startup rather than only after the first post-startup file change._quarantine"security boundary" doc comment onwrite_quarantined.Closes #6702
Test plan
cargo nextest -p zeph-skills: 590/590 passedcargo nextest -p zeph-core: 2232/2232 passed (2 skipped)cargo nextest --workspace --lib --bins(CI feature set): 15269/15269 passedcargo +nightly fmt --check,cargo clippy --profile ci --workspace --all-targets --features "desktop,ide,server,chat,pdf,scheduler,testing" -- -D warnings, rustdoc gate,gitleaks protect --stagedall cleandefault_level = trusted; merge into an already-Trusted skill resets toQuarantined; merge/add against a differently-pathed Bundled/Trusted skill leaves its trust row untouched and warns instead; native-tool-ID collision warning fires with and withoutSemanticMemoryconfigured, from both the startup and hot-reload call sites.local/testing/playbooks/autoskill-a1-a2.mdupdated with 3 new live-session scenarios (not yet run live this cycle) and a corrected "Known Edge Cases" note;.local/testing/coverage-status.mdrow updated in place