Remove the AI analysis feature - #3801
Merged
Merged
Conversation
Nothing live calls the simulation-analysis, tracer-analysis or ai-prompts endpoints (policyengine-app-v2 has no references; only the archived v1 app did), and the model they pinned is retired. Remove the routes, services, prompts, cache family, validators, the Anthropic dependency and its deployment secret plumbing, and the migration-contract entries. The analysis table and the /calculate household-trace storage are left for separate follow-ups. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3801 +/- ##
==========================================
+ Coverage 85.16% 85.48% +0.32%
==========================================
Files 110 95 -15
Lines 6309 5897 -412
Branches 1096 1030 -66
==========================================
- Hits 5373 5041 -332
+ Misses 630 559 -71
+ Partials 306 297 -9 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Nothing has imported policyengine_api/services/run_sync_utils.py since the report services stopped sharing it; it carried 44 uncovered statements and no tests. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
MaxGhenis
marked this pull request as ready for review
August 23, 2026 13:13
This was referenced Aug 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #3800.
Removes the AI analysis feature from API v1 rather than patching it. Nothing live calls it — policyengine-app-v2 has no references to
/simulation-analysis,/tracer-analysisor/ai-prompts(only the archived v1 app did) — and the model it pinned (claude-sonnet-4-20250514) is retired (Models API returns 404). The feature will be rebuilt properly during the Axiom migration.Removed
simulation_analysis_routes,tracer_analysis_routes,ai_prompt_routesand their registrations inapi.py; the matching OpenAPI paths/schemas and migration-contract entries (migration_registry.py,docs/generated/migration_contracts.json).ai_analysis_service,ai_prompt_service,simulation_analysis_service,tracer_analysis_service; theai_prompts/andai_templates/packages; theai-analysisruntime-cache family; the tracer-analysis payload validator.anthropicdependency (pyproject + lock) and everyANTHROPIC_API_KEYdeployment hook: Cloud Run env/secret mapping, secret sync, App Engineapp.yaml/export, the deploy-env validators, and the PR/Push workflow env. The GCP secret itself is untouched (manual cleanup whenever).66 files, +26 / −2,840 (includes removing
services/run_sync_utils.py, orphaned since May's Stage 7 refactors — no importers, no tests).Deliberately kept (separate follow-ups)
analysistable and itsAnalysisORM model — dropping it is a schema change and the repo's rule is autogenerated Alembic revisions against a live MySQL, so it gets its own migration PR./calculate's household-trace storage (runtime_cache/household_traces.py,household_calculation_service.py) — its only consumer was tracer-analysis, so it's now dead weight per calculation, but it touches the most important endpoint and deserves its own review.Verification
tests/unit: 1,040 passed (only the pre-existing local-onlytest_gcp_logging.pycollection artifact excluded);tests/contract: 36 passed; migration-artifact tests pass;import policyengine_api.asgi_factory, policyengine_api.migration_registryok; ruff format/check clean.git grep -i anthropicnow hits onlyCHANGELOG.md,docs/migration/history/and the changelog fragment.🤖 Generated with Claude Code