[codex] Modularize chat prompts and tests#92
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Beta preview is ready.
|
vahid-ahmadi
left a comment
There was a problem hiding this comment.
Review
Solid, low-risk refactor. Extracting prompts into backend/prompts.py as composable sections, adding the neutrality/privacy rules to both the system prompt and the exposed tool metadata, wiring up PR CI, and the test cleanup all look good. Approving with a couple of things to confirm.
1. CI now hard-requires the compiled engine to import. requires_compiled skips only when CI != "true", so on GitHub Actions the compiled-dependent tests (TestCalculateHousehold, TestGetBaselineParameters, TestRunPython, etc.) are forced to run rather than skip. requirements.txt pins policyengine-uk-compiled>=0.20.0, so import should succeed — but several of these tests actually execute simulations. Please confirm they pass in the runner without a POLICYENGINE_UK_DATA_TOKEN / dataset download; otherwise the first green-looking CI run will fail on data access, not code.
2. requires_compiled is now duplicated verbatim in test_agent_tools.py (and again in test_structural_tools.py on the stacked PR). Consider hoisting it into conftest.py so the CI/skip policy lives in one place.
Minor: the old ANALYTICAL NOTES line "Stay analytically neutral" is dropped, but the new dedicated NEUTRALITY_RULES section more than covers it — net improvement, just flagging the wording moved. The good regression test here is test_system_blocks_preserve_cache_breakpoints_after_prompt_refactor, which guards the prompt-cache breakpoint after the refactor.
Prompt contract tests, the cache-breakpoint assertion, and the compute-removal coverage are all in place. Did not run the suite locally (compiled engine unavailable); author reports the focused tests pass.
Fixes #91
Summary
backend/prompts.pymodule.computecoverage.docs/engineering/skills/with thin adapters for AGENTS, Claude, and Copilot.Validation
PYTHONPATH=backend python -m pytest backend/tests/test_prompts.py backend/tests/test_agent_tools.pynpm run buildinfrontend/git diff --check --cachedbefore commitNotes
The full backend suite is intended to run in CI after installing
backend/requirements.txt. Local compiled-engine-dependent tests skipped cleanly wherepolicyengine_uk_compiledwas not installed.