Skip to content

fix(skills): scan and cap trust for self-learning auto-improved skills#6619

Merged
bug-ops merged 2 commits into
mainfrom
fix/6568-skill-auto-improvement-scan
Jul 20, 2026
Merged

fix(skills): scan and cap trust for self-learning auto-improved skills#6619
bug-ops merged 2 commits into
mainfrom
fix/6568-skill-auto-improvement-scan

Conversation

@bug-ops

@bug-ops bug-ops commented Jul 20, 2026

Copy link
Copy Markdown
Owner

Summary

store_improved_version, the failure-driven self-learning path, wrote LLM-regenerated skill
bodies straight to the live SKILL.md with no injection scan, and the new "auto"-sourced
skill version silently inherited the parent skill's trust tier (including Trusted/Verified)
instead of being demoted for machine-evolved content. The same gap existed at the two other
paths that can activate a skill version: activate_version_and_write (the choke point shared
by /skill activate//skill approve//skill reset) and the success-trace-driven
arise_store_version path.

  • All three activation paths now run scan_skill_body and hard-block activation on a match —
    the version row is still saved for forensics, the previously-active body stays live.
  • A clean scan caps the newly-activated version's trust at Quarantined via min_trust,
    written before the live file write; the write fails closed (activation skipped) if the trust
    write itself errors.
  • Retroactive re-scan of pre-existing "auto" versions and per-version (rather than
    per-skill-name) trust restoration on rollback are explicitly deferred — noted inline where
    relevant.

Closes #6568

Test plan

  • cargo +nightly fmt --check
  • cargo clippy --profile ci --workspace --all-targets --features "desktop,ide,server,chat,pdf,scheduler,testing" -- -D warnings
  • cargo nextest run --config-file .github/nextest.toml --workspace --features "desktop,ide,server,chat,pdf,scheduler" --lib --bins (15020 passed)
  • RUSTFLAGS="-D warnings" RUSTDOCFLAGS="--deny rustdoc::broken_intra_doc_links" cargo doc --no-deps --workspace --features "desktop,ide,server,chat,pdf,scheduler"
  • gitleaks protect --staged
  • New unit/integration tests covering: flagged-body hard-block, trust-cap on clean activation, no-prior-trust-row case, /skill approve bypass prevention, ARISE path parity, DB-read-error fail-closed handling
  • Live agent session exercise (tracked in .local/testing/playbooks/arise-stem-erl.md, coverage row added as Untested)

@github-actions github-actions Bot added documentation Improvements or additions to documentation rust Rust code changes core zeph-core crate tests Test-related changes bug Something isn't working size/XL Extra large PR (500+ lines) labels Jul 20, 2026
@bug-ops
bug-ops force-pushed the fix/6568-skill-auto-improvement-scan branch from e9c4cc3 to 3d947cb Compare July 20, 2026 21:46
@bug-ops
bug-ops enabled auto-merge (squash) July 20, 2026 21:46
bug-ops added 2 commits July 20, 2026 23:50
store_improved_version wrote LLM-regenerated skill bodies straight to
the live SKILL.md without running scan_skill_body, and never applied a
reduced trust tier to auto-sourced versions, letting them silently
inherit the parent skill's Trusted/Verified level.

Add a shared scan_and_cap_for_activation gate that hard-blocks
activation on a scan match and caps trust at Quarantined (via
min_trust, fail-closed on a DB read error) before any live write.
Wire the gate into all three points that can activate a skill version:
store_improved_version, activate_version_and_write (the choke point
shared by /skill activate, /skill approve, /skill reset), and
arise_store_version.

Retroactive re-scan of pre-existing auto versions and per-version
(rather than per-skill-name) trust restoration on rollback are
deferred as follow-ups; both are noted inline where relevant.

Closes #6568
@bug-ops
bug-ops force-pushed the fix/6568-skill-auto-improvement-scan branch from 3d947cb to b368e35 Compare July 20, 2026 21:50
@bug-ops
bug-ops merged commit 9a9a930 into main Jul 20, 2026
43 checks passed
@bug-ops
bug-ops deleted the fix/6568-skill-auto-improvement-scan branch July 20, 2026 22:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working core zeph-core crate documentation Improvements or additions to documentation rust Rust code changes size/XL Extra large PR (500+ lines) tests Test-related changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

research(skills): self-learning auto-improvement skips injection scan and skill-trust tiering

1 participant