AINativeBench / data /processed /RQ1 /RecruitmentAssistant-A2A /reference_trajectory.yaml
王子睿
restructure + add files
8c10cf2
Raw
History Blame Contribute Delete
17.4 kB
# Full reference trajectory configuration - RecruitmentAssistant-A2A project
#
# Version: ideal trajectory ported from the MCP version and adapted to the A2A architecture (applies to all models)
# Principle: only include steps explicitly required by the code design; do not rely on test statistics
#
# Migration notes:
# - This file is based on RecruitmentAssistant-MCP/reference_trajectory.yaml
# - It preserves the same business roles, Agent names, LLM/Tool names, and the dynamic 3x/4x reference trajectory design
# - Only the trajectory hierarchy is adapted to match the actual execution path under A2A:
# * Top-level SPAN: recruitment_orchestrator
# * Second-level SPAN: crew_execution
# * Inside each business stage (analyze_job / evaluate_candidates / prepare_interviews)
# add A2A-specific multi-layer SPANs: a2a_call_xxx → xxx_server_execution → Crew***.kickoff
#
# Code design + A2A architecture analysis (based on trace samples execution_path.md):
# 1. The top-level orchestrator runs 3 stages sequentially:
# - JobAnalysisCrew: Senior Job Requirements Analyst uses unified_web_search for market research
# - CandidateEvaluationCrew: Senior Candidate Evaluator uses candidate_evaluator_pro to evaluate candidates
# - InterviewCommunicationCrew: Senior Interview Materials Coordinator uses tools to generate interview materials and email templates
#
# 2. Tool usage (business design is consistent with the MCP version):
# - Job Analysis: unified_web_search (web search for market research; recommended 3-4 calls)
# - Candidate Evaluation: candidate_evaluator_pro (core scoring tool)
# - Interview Communication: comprehensive_interview_material_generator + email_template_generator
#
# 3. A2A execution flow (adds two extra server-related SPAN layers compared to MCP):
# - orchestrator creates the top-level SPAN: recruitment_orchestrator
# - orchestrator creates crew_execution SPAN, then runs 3 business stages in order:
# * analyze_job
# * evaluate_candidates
# * prepare_interviews
# - Within each stage, introduce the A2A-specific 3-level nesting:
# * Business method SPAN: analyze_job / evaluate_candidates / prepare_interviews
# * A2A call SPAN: a2a_call_job_analysis / a2a_call_candidate_evaluation / a2a_call_interview_communication
# * Server execution SPAN: job_analysis_server_execution / candidate_evaluation_server_execution / interview_communication_server_execution
# * Then enter the Crew chain inside the server: Chain: Crew***.kickoff → Agent → LLM/Tool
#
# 4. SPAN hierarchy under A2A (abstracted from execution_path.md):
# - [SPAN] recruitment_orchestrator
# └─ [SPAN] crew_execution
# ├─ [SPAN] analyze_job
# │ └─ [SPAN] a2a_call_job_analysis
# │ └─ [SPAN] job_analysis_server_execution
# │ └─ [Chain] Crew***.kickoff
# │ └─ [AGENT] Senior Job Requirements Analyst
# ├─ [SPAN] evaluate_candidates
# │ └─ [SPAN] a2a_call_candidate_evaluation
# │ └─ [SPAN] candidate_evaluation_server_execution
# │ └─ [Chain] Crew***.kickoff
# │ └─ [AGENT] Senior Candidate Evaluator
# └─ [SPAN] prepare_interviews
# └─ [SPAN] a2a_call_interview_communication
# └─ [SPAN] interview_communication_server_execution
# └─ [Chain] Crew***.kickoff
# └─ [AGENT] Senior Interview Materials Coordinator
#
# 5. The dynamic reference trajectory design remains unchanged (choose 3x/4x by unified_web_search count):
# - If unified_web_search under analyze_job SPAN ≤ 3, use reference_trajectory_3x
# - If unified_web_search under analyze_job SPAN ≥ 4, use reference_trajectory_4x
#
# 6. Important conventions:
# - Agent role names must match the role fields in each self-hosted server's agents.yaml
# - Tool names must match the actual invoked tool names: unified_web_search, candidate_evaluator_pro,
# comprehensive_interview_material_generator, email_template_generator
# - For [LLM], use "LLM: *" as a wildcard for any concrete model name
#
# Project name (used to match RESULTS/<model>/<project_name>/test_results)
project_name: "RecruitmentAssistant-A2A"
# Trajectory extraction type configuration
extract_types:
- "SPAN" # Multi-level SPAN structure (including A2A framework SPANs)
- "Chain" # Kickoff chain for each Crew
- "AGENT" # Agent for each Crew
- "LLM" # LLM calls
- "Tool" # Tool calls
# ============================================================================
# Reference trajectory (Ground Truth) - based on code design + A2A trace structure
# ============================================================================
#
# Diagram (ideal execution path; shows 3x version; 4x adds one extra search in Job Analysis):
#
# [SPAN] recruitment_orchestrator
# └─ [SPAN] crew_execution
# ├─ [SPAN] analyze_job
# │ └─ [SPAN] a2a_call_job_analysis
# │ └─ [SPAN] job_analysis_server_execution
# │ └─ [Chain] Crew***.kickoff
# │ └─ [AGENT] Senior Job Requirements Analyst
# │ ├─ [LLM] *
# │ ├─ [Tool] unified_web_search (1st search)
# │ ├─ [LLM] *
# │ ├─ [Tool] unified_web_search (2nd search)
# │ ├─ [LLM] *
# │ ├─ [Tool] unified_web_search (3rd/4th search)
# │ └─ [LLM] *
# ├─ [SPAN] evaluate_candidates
# │ └─ [SPAN] a2a_call_candidate_evaluation
# │ └─ [SPAN] candidate_evaluation_server_execution
# │ └─ [Chain] Crew***.kickoff
# │ └─ [AGENT] Senior Candidate Evaluator
# │ ├─ [LLM] *
# │ ├─ [Tool] candidate_profile_analyzer
# │ ├─ [LLM] *
# │ ├─ [Tool] candidate_evaluator_pro
# │ └─ [LLM] *
# └─ [SPAN] prepare_interviews
# └─ [SPAN] a2a_call_interview_communication
# └─ [SPAN] interview_communication_server_execution
# └─ [Chain] Crew***.kickoff
# └─ [AGENT] Senior Interview Materials Coordinator
# ├─ [LLM] *
# ├─ [Tool] comprehensive_interview_material_generator
# ├─ [LLM] *
# ├─ [Tool] email_template_generator
# └─ [LLM] *
#
# Notes:
# - Real traces may include extra LLM calls and auxiliary tools (e.g., candidate_profile_analyzer).
# They are not written into the reference trajectory, but are allowed in the In-order / Any-order / Precision / Recall metrics.
# - The reference trajectory captures only the key steps that should appear at minimum, and their required order.
# ============================================================================
# [Compatibility] Default reference trajectory (kept as the 3x version for older scripts and Markdown output)
reference_trajectory:
# ===== Top-level SPAN =====
- "SPAN: recruitment_orchestrator"
# ===== Second-level SPAN (contains 3 stages) =====
- "SPAN: crew_execution"
# ===== Crew 1: Job Analysis (3 searches; A2A multi-layer SPAN) =====
- "SPAN: analyze_job"
- "SPAN: a2a_call_job_analysis"
- "SPAN: job_analysis_server_execution"
- "Chain: Crew***.kickoff"
- "Agent: Senior Job Requirements Analyst"
- "LLM: *"
- "Tool: unified_web_search"
- "LLM: *"
- "Tool: unified_web_search"
- "LLM: *"
- "Tool: unified_web_search"
- "LLM: *"
# ===== Crew 2: Candidate Evaluation =====
- "SPAN: evaluate_candidates"
- "SPAN: a2a_call_candidate_evaluation"
- "SPAN: candidate_evaluation_server_execution"
- "Chain: Crew***.kickoff"
- "Agent: Senior Candidate Evaluator"
- "LLM: *"
- "Tool: candidate_profile_analyzer"
- "LLM: *"
- "Tool: candidate_evaluator_pro"
- "LLM: *"
# ===== Crew 3: Interview Communication =====
- "SPAN: prepare_interviews"
- "SPAN: a2a_call_interview_communication"
- "SPAN: interview_communication_server_execution"
- "Chain: Crew***.kickoff"
- "Agent: Senior Interview Materials Coordinator"
- "LLM: *"
- "Tool: comprehensive_interview_material_generator"
- "LLM: *"
- "Tool: email_template_generator"
- "LLM: *"
# ============================================================================
# Dynamic reference trajectory - Version 1: 3x unified_web_search
# ============================================================================
# Applies when unified_web_search count under analyze_job SPAN ≤ 3
reference_trajectory_3x:
# ===== Top-level SPAN =====
- "SPAN: recruitment_orchestrator"
# ===== Second-level SPAN (contains 3 stages) =====
- "SPAN: crew_execution"
# ===== Crew 1: Job Analysis (3 searches; A2A multi-layer SPAN) =====
- "SPAN: analyze_job"
- "SPAN: a2a_call_job_analysis"
- "SPAN: job_analysis_server_execution"
- "Chain: Crew***.kickoff"
- "Agent: Senior Job Requirements Analyst"
- "LLM: *" # Decide to call tools
- "Tool: unified_web_search" # Market research - search #1
- "LLM: *" # Analyze results and decide to continue searching
- "Tool: unified_web_search" # Market research - search #2
- "LLM: *" # Analyze results and decide to continue searching
- "Tool: unified_web_search" # Market research - search #3
- "LLM: *" # Produce the final job analysis report
# ===== Crew 2: Candidate Evaluation (A2A multi-layer SPAN) =====
- "SPAN: evaluate_candidates"
- "SPAN: a2a_call_candidate_evaluation"
- "SPAN: candidate_evaluation_server_execution"
- "Chain: Crew***.kickoff"
- "Agent: Senior Candidate Evaluator"
- "LLM: *" # Decide to call the auxiliary analysis tool
- "Tool: candidate_profile_analyzer" # Analyze candidate profiles and background
- "LLM: *" # Decide to call the scoring tool
- "Tool: candidate_evaluator_pro" # Evaluate all candidates (scoring, ranking, grading)
- "LLM: *" # Produce the final evaluation report
# ===== Crew 3: Interview Communication (A2A multi-layer SPAN) =====
- "SPAN: prepare_interviews"
- "SPAN: a2a_call_interview_communication"
- "SPAN: interview_communication_server_execution"
- "Chain: Crew***.kickoff"
- "Agent: Senior Interview Materials Coordinator"
- "LLM: *" # Decide to generate interview materials
- "Tool: comprehensive_interview_material_generator" # Generate interview questions for all stages
- "LLM: *" # Review materials and decide to generate email templates
- "Tool: email_template_generator" # Generate all types of email templates
- "LLM: *" # Final merge to produce a complete interview materials package
# ============================================================================
# Dynamic reference trajectory - Version 2: 4x unified_web_search
# ============================================================================
# Applies when unified_web_search count under analyze_job SPAN ≥ 4
reference_trajectory_4x:
# ===== Top-level SPAN =====
- "SPAN: recruitment_orchestrator"
# ===== Second-level SPAN (contains 3 stages) =====
- "SPAN: crew_execution"
# ===== Crew 1: Job Analysis (4 searches; A2A multi-layer SPAN) =====
- "SPAN: analyze_job"
- "SPAN: a2a_call_job_analysis"
- "SPAN: job_analysis_server_execution"
- "Chain: Crew***.kickoff"
- "Agent: Senior Job Requirements Analyst"
- "LLM: *" # Decide to call tools
- "Tool: unified_web_search" # Market research - search #1
- "LLM: *" # Analyze results and decide to continue searching
- "Tool: unified_web_search" # Market research - search #2
- "LLM: *" # Analyze results and decide to continue searching
- "Tool: unified_web_search" # Market research - search #3
- "LLM: *" # Analyze results and decide to continue searching
- "Tool: unified_web_search" # Market research - search #4
- "LLM: *" # Produce the final job analysis report
# ===== Crew 2: Candidate Evaluation (A2A multi-layer SPAN) =====
- "SPAN: evaluate_candidates"
- "SPAN: a2a_call_candidate_evaluation"
- "SPAN: candidate_evaluation_server_execution"
- "Chain: Crew***.kickoff"
- "Agent: Senior Candidate Evaluator"
- "LLM: *" # Decide to call the auxiliary analysis tool
- "Tool: candidate_profile_analyzer" # Analyze candidate profiles and background
- "LLM: *" # Decide to call the scoring tool
- "Tool: candidate_evaluator_pro" # Evaluate all candidates (scoring, ranking, grading)
- "LLM: *" # Produce the final evaluation report
# ===== Crew 3: Interview Communication (A2A multi-layer SPAN) =====
- "SPAN: prepare_interviews"
- "SPAN: a2a_call_interview_communication"
- "SPAN: interview_communication_server_execution"
- "Chain: Crew***.kickoff"
- "Agent: Senior Interview Materials Coordinator"
- "LLM: *" # Decide to generate interview materials
- "Tool: comprehensive_interview_material_generator" # Generate interview questions for all stages
- "LLM: *" # Review materials and decide to generate email templates
- "Tool: email_template_generator" # Generate all types of email templates
- "LLM: *" # Final merge to produce a complete interview materials package
# Target tool list (used by the single-tool use metric)
target_tools:
- "Tool: unified_web_search"
- "Tool: candidate_profile_analyzer"
- "Tool: candidate_evaluator_pro"
- "Tool: comprehensive_interview_material_generator"
- "Tool: email_template_generator"
# Models to evaluate (kept consistent with the MCP version)
models:
- "GPT-5"
- "GPT-4o-mini"
- "DeepSeek-V3-1"
- "DeepSeek-R1"
- "Gemini-2.5-flash"
- "Gemini-2.5-flash-nothinking"
- "Qwen3-235b"
# Permutable tool group configuration (for dynamic tool-order optimization)
permutable_tool_groups:
# Tools in the Candidate Evaluation stage can be in any order
candidate_evaluation_tools:
- "Tool: candidate_profile_analyzer"
- "Tool: candidate_evaluator_pro"
# Tools in the Interview Communication stage can be in any order
interview_communication_tools:
- "Tool: comprehensive_interview_material_generator"
- "Tool: email_template_generator"
# ============================================================================
# Usage - A2A architecture version
# ============================================================================
#
# 1. Trajectory hierarchy (tiered by type):
# - Level 1: SPAN (recruitment_orchestrator)
# - Level 2: SPAN (crew_execution)
# - Level 3: SPAN (analyze_job / evaluate_candidates / prepare_interviews)
# - Level 4: SPAN (a2a_call_job_analysis / a2a_call_candidate_evaluation /
# a2a_call_interview_communication)
# - Level 5: SPAN (job_analysis_server_execution /
# candidate_evaluation_server_execution /
# interview_communication_server_execution)
# - Level 6: Chain (Crew***.kickoff)
# - Level 7: AGENT (Senior roles for each stage)
# - Level 8: LLM / Tool (alternating)
#
# 2. Wildcards and exact matching:
# - SPAN names: must exactly match the names in this file
# - Chain name: "Crew***.kickoff"; evaluate_trajectory.py will automatically normalize
# the actual Crew_<UUID>.kickoff into this form
# - AGENT names: exact match the role fields in agents.yaml (e.g.,
# "Senior Job Requirements Analyst")
# - LLM: use "LLM: *" as a wildcard to match any model (gpt-5-chat-latest,
# deepseek-reasoner, gemini-2.5-flash, qwen3-235b-a22b, etc.)
# - Tool names: exact match tool names
#
# 3. Metric meanings (consistent with the MCP version):
# - Exact Match: Predicted trajectory exactly matches the reference trajectory in length and every step
# - In-order Match: Reference trajectory is a subsequence of the predicted trajectory, allowing extra steps
# - Any-order Match: Only requires the presence of all necessary steps, ignoring order
# - Precision: Proportion of steps in the predicted trajectory that are considered correct
# - Recall: Proportion of steps in the reference trajectory that are covered
# - Single-tool Use: Average usage of each tool in target_tools
# - unique_path_ratio: Number of unique complete trajectories / total samples
# - path_entropy: Shannon entropy based on trajectory frequencies, normalized to 0-1
#
# 4. How to use dynamic reference trajectories:
# - evaluate_trajectory.py automatically counts unified_web_search calls under analyze_job SPAN
# for each sample:
# * ≤ 3 → use reference_trajectory_3x
# * ≥ 4 → use reference_trajectory_4x
# - This treats models with fewer/more searches more fairly.
#
# 5. Run example:
# - Run in the RecruitmentAssistant-A2A directory:
# python3 evaluate_trajectory.py --config reference_trajectory.yaml
#
# 6. Possible differences vs. real A2A traces:
# - Real traces may include:
# * More LLM calls (thinking / planning / self-reflection)
# * Extra tools (e.g., multiple calls to candidate_profile_analyzer)
# * Orchestrator-level retries or business retries
# - These are not written into the reference trajectory, but will naturally be reflected in Precision/Recall;
# when analyzing results, focus on In-order Match, Recall, and path diversity metrics.