feat(examples): add counterfactual trace diagnosis optimization loop#170
Open
Leoluis0705 wants to merge 3 commits into
Open
feat(examples): add counterfactual trace diagnosis optimization loop#170Leoluis0705 wants to merge 3 commits into
Leoluis0705 wants to merge 3 commits into
Conversation
|
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #170 +/- ##
==========================================
Coverage ? 87.88291%
==========================================
Files ? 467
Lines ? 44103
Branches ? 0
==========================================
Hits ? 38759
Misses ? 5344
Partials ? 0 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Author
|
I have read the CLA Document and I hereby sign the CLA |
Rook1ex
added a commit
to trpc-group/cla-database
that referenced
this pull request
Jul 12, 2026
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
This PR adds a trust-aware evaluation and prompt-optimization example for Issue #91. Unlike reason-keyword or static-diff attribution, it deep-copies
actual_conversation, applies a bounded local intervention, and sends the counterfactualEvalCasethrough the same publicAgentEvaluator.Supported interventions:
Observed before/after metric deltas become attribution evidence. The same mechanism diagnoses candidate regressions.
Difference from other Issue #91 proposals
No case ID, expected-failure label, attribution hint, or hand-authored metric score participates in a decision.
Pipeline
AgentOptimizer.optimize(update_source=False)TargetPrompt.write_all()Verification
e2b_code_interpreter,mempalace,a2a, andaiofiles.trpc_agent_sdk/files are changed.Known limitation
A localized tool intervention may be structurally valid but semantically unreachable because the retained tool response came from the original tool. Every intervention records structural validity, semantic coherence, and warnings; incoherent evidence lowers confidence.
Closes #91.