Repository navigation
Conversation
Each year of a budget window should carry report_type budget_window_year in its request, and the worker should label any other request single_year in its parameters, so its run record and its segments' records carry it. These tests fail before the change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The budget-window batch puts report_type budget_window_year on each year's request, and the worker puts report_type single_year on any request that names none, before it records and runs it. The worker records the field with the request's other fields, and a segmented run's children copy it, so the run-times summary can leave budget-window years out without reading them from segmented: false and a missing queue time. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Round 1 of the review found no bugs and noted that the guide lists the other attributes run_simulation records carry but not report_type. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
anth-volk
marked this pull request as ready for review
December 2, 2026 21:58
This branch has not been deployed
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.
Fixes #1182
What this changes
Every
run_simulationlog record now names its report type in the attributereport_type:budget_window_year: one year of a multi-year (budget-window) report.build_child_simulation_requestadds it to every year's request thatrun_budget_window_batchspawns, for every country and region, whether or not the year runs in segments.single_year: every other request._run_simulationadds it to a request that has noreport_type, before it records the operation and before it dispatches the calculation.Other details:
policyengine_simulation_contract.report_type, so API v2's records can use the same names.run_simulation_segmentrecords.budget_window_year.docs/engineering/skills/observability.mdhas a new "Annual job report type" section.Why: the weekly run-times summary identifies budget-window years by a request's
segmented: falseand a missingjob_queue_seconds. A later change runs plain US national budget-window years in segments, by no longer settingsegmented: falseon them, and the summary would then count those years as single-year runs. This label gives the summary a direct marker.Tests
The tests were added in
141bb052, before the change, and each was run on its own on both commits:141bb052)319064c2)test_budget_window_context.py::test_build_child_simulation_request_marks_every_year_as_a_budget_window_year(US national, US state, UK)test_job_progress.py::TestModalRunSimulation::test__a_request_without_a_report_type_runs_as_a_single_year_reporttest_job_progress.py::TestModalRunSimulation::test__the_calculation_never_sees_the_submission_time(changed: the dispatched parameters now includereport_type: single_year)test_job_progress.py::TestModalRunSimulation::test__a_budget_window_year_keeps_its_report_typetest_segmented_national.py::TestBuildGroupChildPayload::test__children_copy_the_parents_report_type(both values)The single-year test reads the completion record written by the real policyengine-observability runtime, so it also shows that
report_typegets through the library's attribute-name filter.Other checks, on the changed files only:
scripts/run_quality_guards.py: all six guards passed.Review
There was one round of adversarial review:
report-runtimes-reviews/policyengine-sim-api-claude-report-type-in-run-records-review-round1-2026-12-03.md, kept outside the repository. It found no bugs (high 0, medium 0, low 0), so no further rounds ran. It checked:SimulationWorker.run_simulation;It made four code-quality notes:
run_simulationattributes but notreport_type. Fixed in773201fd, which is documentation only and has not been reviewed.StrEnum, and_with_report_typekeeps any value that isn'tNone.report_type, and the branch that replacesNonehas no test.test_job_progress.pyis at 1,417 of its 1,500 allowed lines.Bugs left: none.
What the merge waits for
build_child_simulation_request) merges after this one and mergesmainin.mainrequires. Following this repository's rulesim.process.agents-never-bypass, it will not be merged with--admin.mainreleases and deploys the executor app. Records from apps deployed before this change carry noreport_type, so readers keep their older rule for those records.This builds on
mainonly. No deployment code changed.🤖 Generated with Claude Code