| # Complete Reference Trajectory Configuration - GameBuilder Project | |
| # | |
| # Version: Ideal trajectory based on code design (applicable to all models) | |
| # Principle: Only includes steps explicitly required by code design, not based on test statistics | |
| # | |
| # Code Design Analysis: | |
| # 1. Three Agents execute sequentially: | |
| # - Senior Software Engineer: Generate game code | |
| # - Software Quality Control Engineer: Review code (has validate_python_code tool) | |
| # - Chief Software Quality Control Engineer: Final evaluation (has validate_python_code tool) | |
| # | |
| # 2. Tool usage analysis: | |
| # - validate_python_code tool is specifically configured for QA and Chief QA | |
| # - tasks.yaml requires "check for errors" and "syntax errors" | |
| # - Code validation is core QA responsibility, tool calls are necessary | |
| # | |
| # 3. Execution flow: | |
| # - Process.sequential: Sequential execution | |
| # - Each Agent executes corresponding Task, generates results through LLM | |
| # Project name | |
| project_name: "GameBuilder" | |
| # Trajectory extraction type configuration | |
| # As per user requirements, focus on: SPAN, Chain, AGENT, LLM, Tool | |
| # Not concerned with: Task Created, Crew Created and other non-core content | |
| extract_types: | |
| - "SPAN" # Level 1: Top-level execution span | |
| - "Chain" # Level 2: Crew execution chain | |
| - "AGENT" # Level 3: Agent execution | |
| - "LLM" # Level 4: LLM calls | |
| - "Tool" # Level 4: Tool calls | |
| # ============================================================================ | |
| # Reference Trajectory (Ground Truth) - Based on code design | |
| # ============================================================================ | |
| # | |
| # Graphical structure (ideal execution path): | |
| # | |
| # [SPAN] GameBuilder_generation | |
| # └─ [Chain] Crew***.kickoff | |
| # ├─ [AGENT] Senior Software Engineer ← Task 1: code_task | |
| # │ └─ [LLM] * ← Generate game code | |
| # │ | |
| # ├─ [AGENT] Software Quality Control Engineer ← Task 2: review_task | |
| # │ ├─ [LLM] * ← Review code, decide to validate | |
| # │ ├─ [Tool] Python Code Validator ← Validate code syntax | |
| # │ └─ [LLM] * ← Process validation results and output | |
| # │ | |
| # └─ [AGENT] Chief Software Quality Control Engineer ← Task 3: evaluate_task | |
| # ├─ [LLM] * ← Final evaluation, decide to validate | |
| # ├─ [Tool] Python Code Validator ← Confirm code is runnable | |
| # └─ [LLM] * ← Confirm completion and output | |
| # | |
| # Design rationale: | |
| # - crew.py: Defines sequential execution flow of 3 Agents and 3 Tasks | |
| # - tasks.yaml: All Tasks' expected_output is "full python code, only the python code" | |
| # - tasks.yaml: review_task requires "check for errors" and "syntax errors" | |
| # - main.py line 525: SPAN name is "GameBuilder_generation" | |
| # - agents.yaml: QA specifically responsible for "checking code for errors" | |
| # - crew.py: Both QA and Chief QA are configured with validate_python_code tool | |
| # | |
| # Ideal trajectory explanation: | |
| # - Senior Engineer: Generate code (1 LLM call) | |
| # - QA Engineer: Review code -> Validation tool -> Output (2 LLM + 1 tool) | |
| # - Chief QA: Evaluate code -> Validation tool -> Confirm (2 LLM + 1 tool) | |
| # - This trajectory represents ideal, no-retry, no-redundancy execution path | |
| # | |
| # Note: | |
| # - "LLM: *" represents any LLM model (wildcard match) | |
| # - Agent names must exactly match names defined in agents.yaml | |
| # - Actual execution may include more LLM calls (thinking, retries, etc.), which is normal | |
| # ============================================================================ | |
| reference_trajectory: | |
| # ===== Level 1: SPAN ===== | |
| - "SPAN: GameBuilder_generation" | |
| # ===== Level 2: Chain (wildcard handling for UUID) ===== | |
| - "Chain: Crew***.kickoff" | |
| # ===== Task 1: code_task ===== | |
| # Senior Software Engineer generates game code | |
| - "Agent: Senior Software Engineer" | |
| - "LLM: *" # Any model | |
| # ===== Task 2: review_task ===== | |
| # Software Quality Control Engineer reviews code | |
| - "Agent: Software Quality Control Engineer" | |
| - "LLM: *" | |
| - "Tool: Python Code Validator" | |
| - "LLM: *" | |
| # ===== Task 3: evaluate_task ===== | |
| # Chief Software Quality Control Engineer final evaluation | |
| - "Agent: Chief Software Quality Control Engineer" | |
| - "LLM: *" | |
| - "Tool: Python Code Validator" | |
| - "LLM: *" | |
| # Target tools list (for single-tool use metric) | |
| # Only includes actual tool calls, used to detect tool usage | |
| target_tools: | |
| - "Tool: Python Code Validator" | |
| # Models to evaluate | |
| models: | |
| - "GPT-5" | |
| - "GPT-4o-mini" | |
| - "DeepSeek-V3-1" | |
| - "DeepSeek-R1" | |
| - "Gemini-2.5-flash" | |
| - "Gemini-2.5-flash-nothinking" | |
| - "Qwen3-235b" | |
| # ============================================================================ | |
| # Usage Instructions | |
| # ============================================================================ | |
| # | |
| # 1. Trajectory hierarchy: | |
| # - Level 1: SPAN (GameBuilder_generation) | |
| # - Level 2: Chain (Crew***.kickoff, wildcard handles UUID) | |
| # - Level 3: AGENT (specific Agent names, must match exactly) | |
| # - Level 4: LLM (wildcard matches any model) | |
| # | |
| # 2. Wildcard handling: | |
| # - Crew_<UUID>.kickoff -> Crew***.kickoff (evaluate_trajectory.py handles automatically) | |
| # - LLM: * -> Matches any model name (e.g. gpt-4o-mini, deepseek-r1, etc.) | |
| # | |
| # 3. Exact match requirements: | |
| # - SPAN name: "GameBuilder_generation" (exact match) | |
| # - Chain name: "Crew***.kickoff" (wildcard match) | |
| # - AGENT names: Must exactly match definitions in agents.yaml | |
| # * "Senior Software Engineer" | |
| # * "Software Quality Control Engineer" | |
| # * "Chief Software Quality Control Engineer" | |
| # - LLM name: "LLM: *" (wildcard matches any model) | |
| # - Tool name: "Python Code Validator" (exact match) | |
| # | |
| # 4. Evaluation metrics meaning: | |
| # - Exact Match: Requires trajectory to be completely identical (including LLM call count) | |
| # - In-order Match: Allows extra calls, but core steps must appear in order | |
| # - Any-order Match: Only requires containing all necessary steps (ignores order) | |
| # - Precision: Proportion of correct steps in predicted trajectory | |
| # - Recall: Proportion of reference trajectory steps covered | |
| # - Single-tool Use: Detects Python Code Validator tool usage | |
| # | |
| # 5. Run command: | |
| # cd /Users/wzr/TOSEM-2025/RESULTS/RQ1/GameBuilder | |
| # python3 evaluate_trajectory.py --config reference_trajectory.yaml | |
| # | |
| # 6. Design notes: | |
| # - This reference trajectory represents ideal execution path | |
| # - Senior Engineer: 1 LLM call (generate code) | |
| # - QA Engineer: 2 LLM + 1 tool (review -> validate -> output) | |
| # - Chief QA: 2 LLM + 1 tool (evaluate -> validate -> confirm) | |
| # - Total: 5 LLM calls + 2 tool calls | |
| # - In-order Match and Any-order Match metrics are more suitable for evaluating actual performance | |
| # | |
| # 7. Differences from actual trajectory: | |
| # - Actual trajectory may include more LLM calls (thinking, planning, execution, summary, etc.) | |
| # - Actual trajectory may call validation tool multiple times | |
| # - These differences don't represent errors, but different model execution strategies | |
| # - Exact Match score may be low, focus on In-order Match and Recall | |