Skip to content

Commit ff006df

Browse files
0xrinegadeclaude
andcommitted
fix(research): Remove misleading stub data keys from placeholder phases
Removed all fake data keys (mev_activity, periodic_activity, etc.) from advanced phase stubs to prevent false hypothesis generation. ## Problem Agent was generating false hypotheses ("MEV extraction with 80% confidence") based on empty stub objects. The hypothesis generator checked for key existence (`data.get("mev_activity").is_some()`), not value validity. ## Solution Changed all advanced phase stubs to return ONLY: - :wallet (identifier) - :analysis_phase (phase name) - :status "pending_tool_implementation" - :note (explanation) NO fake data keys that could mislead hypothesis generation. ## Affected Phases - DeepAnalysis: Removed mev_activity, sandwich, arbitrage, wash_trading, etc. - PatternRecognition: Removed periodic_activity, volume_distribution, etc. - HypothesisTesting: Removed test_results, correlations, etc. - Synthesis: Removed final_profile, risk_assessment, etc. Now hypothesis generation will only work with REAL data from Initial/Profiling phases that actually fetch and analyze blockchain data. Lesson: Never include fake/stub data in investigation results. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent f49c112 commit ff006df

File tree

1 file changed

+14
-48
lines changed

1 file changed

+14
-48
lines changed

src/services/research_agent.rs

Lines changed: 14 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -387,18 +387,11 @@ impl ResearchAgent {
387387
;; Deep analysis phase - placeholder until advanced tools available
388388
(define target "{}")
389389
390-
;; Return stub data for now
391-
;; Note: includes MEV analysis placeholders for sandwich, arbitrage, wash, multi-hop
390+
;; Return minimal placeholder - NO fake data keys
392391
{{:wallet target
393-
:mev_activity {{}}
394-
:sandwich 0
395-
:arbitrage {{:count 0 :total_profit 0}}
396-
:multi-hop 0
397-
:wash_trading_detected false
398-
:gas_optimization_score 0
399-
:protocol_complexity 0
400392
:analysis_phase "DeepAnalysis"
401-
:note "Advanced MEV analysis pending tool implementation"}}
393+
:status "pending_tool_implementation"
394+
:note "Advanced MEV analysis requires specialized MCP tools"}}
402395
)"#,
403396
state.target_wallet
404397
)
@@ -411,17 +404,11 @@ impl ResearchAgent {
411404
;; Pattern recognition phase - placeholder until advanced tools available
412405
(define target "{}")
413406
414-
;; Return stub data for now
407+
;; Return minimal placeholder - NO fake data keys
415408
{{:wallet target
416-
:periodic_activity {{}}
417-
:volume_distribution {{}}
418-
:program_interaction_patterns {{}}
419-
:token_flow_patterns {{}}
420-
:behavioral_clusters {{}}
421-
:anomalies []
422-
:pattern_confidence 0
423409
:analysis_phase "PatternRecognition"
424-
:note "Pattern analysis pending tool implementation"}}
410+
:status "pending_tool_implementation"
411+
:note "Pattern analysis requires temporal data and behavioral clustering tools"}}
425412
)"#,
426413
state.target_wallet
427414
)
@@ -434,19 +421,13 @@ impl ResearchAgent {
434421
;; Hypothesis testing phase - placeholder until advanced tools available
435422
(define target "{}")
436423
437-
;; Return stub data for now
424+
;; Return minimal placeholder - NO fake data keys
438425
{{:wallet target
439-
:hypotheses_tested {}
440-
:test_results []
441-
:statistical_validation {{}}
442-
:correlations {{}}
443-
:counter_evidence []
444-
:overall_confidence 0
445426
:analysis_phase "HypothesisTesting"
446-
:note "Hypothesis testing pending tool implementation"}}
427+
:status "pending_tool_implementation"
428+
:note "Hypothesis validation requires comprehensive transaction graph analysis"}}
447429
)"#,
448-
state.target_wallet,
449-
state.hypotheses.len()
430+
state.target_wallet
450431
)
451432
}
452433

@@ -457,28 +438,13 @@ impl ResearchAgent {
457438
;; Synthesis phase - placeholder until advanced tools available
458439
(define target "{}")
459440
460-
;; Return stub data for now
441+
;; Return minimal placeholder - NO fake data keys
461442
{{:wallet target
462-
:investigation_summary {{
463-
:phases_completed {}
464-
:findings_count {}
465-
:hypotheses_tested {}
466-
:iteration {}}}
467-
:final_profile {{}}
468-
:metrics {{}}
469-
:network_analysis {{}}
470-
:risk_assessment {{}}
471-
:key_insights []
472-
:confidence_scores {{}}
473-
:recommendations []
474443
:analysis_phase "Synthesis"
475-
:note "Synthesis pending tool implementation"}}
444+
:status "pending_tool_implementation"
445+
:note "Final synthesis requires complete data from all investigation phases"}}
476446
)"#,
477-
state.target_wallet,
478-
format!("{:?}", state.phase),
479-
state.findings.len(),
480-
state.hypotheses.len(),
481-
state.iteration
447+
state.target_wallet
482448
)
483449
}
484450

0 commit comments

Comments
 (0)