Skip to content

feat(skills): AutoSkill A2 — dedup_threshold config + Add/Merge/Discard in miner.rs#4499

Merged
bug-ops merged 3 commits into
mainfrom
autoskill-dedup-miner
May 28, 2026
Merged

feat(skills): AutoSkill A2 — dedup_threshold config + Add/Merge/Discard in miner.rs#4499
bug-ops merged 3 commits into
mainfrom
autoskill-dedup-miner

Conversation

@bug-ops
Copy link
Copy Markdown
Owner

@bug-ops bug-ops commented May 28, 2026

Summary

Changes

crates/zeph-config/src/learning.rs

  • New field dedup_threshold: f32 (default 0.90) in the AutoSkill A2 config block
  • New LearningConfig::validate() — returns Err when merge_threshold >= dedup_threshold
  • Wired into Config::validate_llm_and_skills for startup enforcement
  • New tests: autoskill_a2_dedup_threshold_default_and_roundtrip, autoskill_a2_defaults, validate_rejects_inverted_thresholds

crates/zeph-core/src/agent/trace_extraction.rs

  • let dedup_threshold = learning_cfg.dedup_threshold; — no longer hardcoded

crates/zeph-skills/src/miner.rs

  • MiningConfig: +merge_threshold: f32 (0.75), +merge_enabled: bool (true)
  • SkillMiner: +embed_candidate(), +merge_candidate() (mirrors trace_extractor)
  • process_repo(): find_nearest()decide() → match Add/Discard/Merge
  • is_novel(): updated doc to note merge-zone divergence from process_repo()

Test plan

  • cargo nextest run -p zeph-config -p zeph-core -p zeph-skills --lib --bins — 2415 passed
  • cargo clippy --workspace -- -D warnings — clean
  • cargo +nightly fmt --check — clean
  • RUSTFLAGS="-D warnings" cargo check --workspace --all-targets --features desktop,ide,server,chat,pdf,scheduler --locked — clean
  • Full workspace: 10042 passed

Follow-up issues (not blocking)

  • Coverage for process_repo() Discard/Merge/error-recovery branches — requires more configurable mock infrastructure (noted by tester)
  • miner.rs Add path missing explicit injection scan before approve_and_save — noted by security, low severity

bug-ops added 2 commits May 28, 2026 13:52
…dation (#4474)

Add `dedup_threshold: f32` field to `LearningConfig` (default 0.90) for the
AutoSkill A2 Add/Merge/Discard pipeline. Wire the value into
`crates/zeph-core/src/agent/trace_extraction.rs`, replacing the hardcoded 0.90.

Add `LearningConfig::validate()` that enforces `merge_threshold < dedup_threshold`
and call it from `Config::validate_llm_and_skills` to catch misconfigured thresholds
at startup.

Closes #4474
…4475)

Replace the binary novel/duplicate dedup check in `SkillMiner::process_repo` with
the three-way `Add/Merge/Discard` flow via `merger::decide()`, mirroring the
pattern already used in `TraceExtractor`.

Changes:
- Add `merge_threshold: f32` (0.75) and `merge_enabled: bool` (true) to
  `MiningConfig`
- Add private `embed_candidate()` and `merge_candidate()` methods to `SkillMiner`
- Replace `is_novel()` call in `process_repo()` with `find_nearest()` + `decide()`
  + three-way match
- Update `is_novel()` doc to document merge-zone divergence from `process_repo()`
- Update all test `MiningConfig` literals with new fields

Closes #4475
@github-actions github-actions Bot added documentation Improvements or additions to documentation skills zeph-skills crate rust Rust code changes core zeph-core crate enhancement New feature or request size/L Large PR (201-500 lines) labels May 28, 2026
@bug-ops bug-ops enabled auto-merge (squash) May 28, 2026 11:53
@bug-ops bug-ops merged commit 70dec9c into main May 28, 2026
32 checks passed
@bug-ops bug-ops deleted the autoskill-dedup-miner branch May 28, 2026 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core zeph-core crate documentation Improvements or additions to documentation enhancement New feature or request rust Rust code changes size/L Large PR (201-500 lines) skills zeph-skills crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(skills): apply Add/Merge/Discard flow to miner.rs (AutoSkill A2 full integration) feat(skills): wire dedup_threshold config into trace_extractor

1 participant