Title: Internal Employee Agent Conversation Replay
Domain: business_finance — HR & Project Management

Summary: Read staged HR and IT support conversations, then produce one deterministic `results.json` that captures the correct per-turn responses and tool usage across all sessions.

Task prompt:
You are working on a Linux VM.

## Your Task
Act as the company's internal HR / IT assistant across all staged conversation sessions and write the final structured artifact to `base/output/results.json`.

## Visible Inputs
- agent rules: `base/input/agent_rules.md`
- HR knowledge base: `base/input/hr_knowledge_base.md`
- IT knowledge base: `base/input/it_knowledge_base.md`
- conversation sessions: `base/input/queries.json`
- email / JIRA fallback stubs: `base/input/stubs.py`
- deterministic web-search grounding for the `search_web` cases: `base/input/web_search_grounding.json`

## What To Produce
Write exactly one JSON file at `base/output/results.json` with this shape:

```json
{
  "1.1": [{"response": "...", "tools_used": []}],
  "5.1": [
    {"response": "...", "tools_used": ["draft_hr_email"]},
    {"response": "...", "tools_used": ["send_hr_email"]}
  ]
}
```

## Required Behavior
- process each test id in `queries.json` as one independent conversation session
- keep turn order within each test id
- keep session memory across turns inside the same test id
- use the exact canonical tool names from `agent_rules.md` in `tools_used`
- if you need a deterministic fallback for `search_web`, use the staged `web_search_grounding.json`
- you may use the staged `stubs.py` for local HR email / JIRA fallback behavior

## Important Constraints
- write only to `base/output/results.json` inside the visible `output/` directory
- do not modify staged files under `input/`
- keep the artifact deterministic and valid JSON


The agent must:
Read the staged rules, knowledge bases, conversation sessions, and deterministic web-search grounding.
Process each test id in `queries.json` as an independent multi-turn session while preserving turn order and within-session memory.
Write exactly one `results.json` file under `output/`.
Use the exact canonical tool names from `agent_rules.md` in every `tools_used` list.
Keep the artifact deterministic, valid JSON, and confined to the visible `output/` directory.

Software: Python

Input files:
name: agent_rules.md
format: Markdown
path: input/agent_rules.md
description: Canonical tool names and operational rules for the HR / IT assistant.
name: hr_knowledge_base.md
format: Markdown
path: input/hr_knowledge_base.md
description: HR policy knowledge base used to answer the staged employee conversations.
name: it_knowledge_base.md
format: Markdown
path: input/it_knowledge_base.md
description: IT support knowledge base used to answer the staged employee conversations.
name: queries.json
format: JSON
path: input/queries.json
description: All staged multi-turn conversation sessions keyed by test id.
name: stubs.py
format: Python
path: input/stubs.py
description: Visible fallback helpers for email and JIRA-style actions.
name: web_search_grounding.json
format: JSON
path: input/web_search_grounding.json
description: Deterministic grounding data for the `search_web` cases.