Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backend/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ uvicorn[standard]
sqlmodel
psycopg2-binary
anthropic
policyengine-uk-compiled==0.48.0
policyengine-uk-compiled==0.65.0
pandas
pyyaml
httpx
Expand Down
4 changes: 3 additions & 1 deletion backend/tests/test_agent_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -1000,7 +1000,9 @@ def test_supports_safe_imports(self):
assert result["result"] == {"ok": True}

def test_rejects_frs_row_level_microdata(self):
result = run_python("sim = Simulation(year=2025)\nresult = sim.run_microdata()")
result = run_python(
"sim = Simulation(year=2025, dataset='frs')\nresult = sim.run_microdata()"
)

assert "error" in result
assert "FRS row-level microdata" in result["error"]
Expand Down
4 changes: 3 additions & 1 deletion backend/tools/definitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,9 @@
"description": (
"Python code to execute. Must assign the final answer to `result`. "
"Use the preloaded PolicyEngine interface directly, for example: "
"`sim = Simulation(year=2025)` or `policy = Parameters.model_validate({...})`."
"`sim = Simulation(year=2025, dataset='efrs')` or "
"`policy = Parameters.model_validate({...})`. Simulation requires an "
"explicit data source (dataset= or synthetic household frames)."
),
},
},
Expand Down
5 changes: 3 additions & 2 deletions docs/engineering/skills/uk-chat-runtime.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,9 @@ tool registration.
`lookup_parameter` reads year-scoped values from
`policyengine_uk_compiled.Simulation.get_baseline_params()`.

`policyengine-uk-compiled` 0.44.0 is the minimum supported output contract for
microdata-backed tools. When reform is omitted, `run_microdata()`,
`policyengine-uk-compiled` 0.65.0 is the minimum supported output contract for
microdata-backed tools. Since 0.45, `Simulation` has no default dataset — every
construction must pass `dataset=`, `data_dir=`, or synthetic household frames. When reform is omitted, `run_microdata()`,
`calculate_household`, and `analyse_microdata` outputs use plain calculated
column names such as `income_tax`, `universal_credit`, and `net_income`. When a
reform is supplied, including an empty no-op object (`{}`), calculations use
Expand Down
Loading