refactor(skills): extract shared MERGE_SYSTEM_PROMPT and build_merge_messages#4861
Merged
Conversation
e3d497f to
bd65fb8
Compare
…messages MERGE_SYSTEM_PROMPT and the merge_prompt format block were duplicated verbatim in miner.rs and trace_extractor.rs. Extract them into a new pub(crate) module merge_prompts with a build_merge_messages() helper that both callers now share. No behavioral change. Closes #4857
pub(crate) items are unreachable from doc-test context (external crate). Change the fence from rust to ignore to prevent CI doc-test failures.
e21a6b2 to
9c6e597
Compare
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
MERGE_SYSTEM_PROMPTand themerge_promptformat block were duplicated verbatim inminer.rs(lines 35–41, 391–397) andtrace_extractor.rs(lines 78–84, 477–483).pub(crate)modulecrates/zeph-skills/src/merge_prompts.rsprovides a singleMERGE_SYSTEM_PROMPTconstant and abuild_merge_messages()helper that both callers now share.Changes
crates/zeph-skills/src/merge_prompts.rs— new module withMERGE_SYSTEM_PROMPTconst,build_merge_messages()helper, and 3 unit tests.crates/zeph-skills/src/lib.rs—pub(crate) mod merge_prompts;added in alphabetical order.crates/zeph-skills/src/miner.rs— removed localMERGE_SYSTEM_PROMPTconst and inlineformat!+vec![]; replaced withbuild_merge_messages(...)call.crates/zeph-skills/src/trace_extractor.rs— same.Test plan
cargo +nightly fmt --check— cleancargo clippy --workspace -- -D warnings— cleancargo nextest run --workspace --lib --bins— 10504 passed, 21 skippedCloses #4857