Skip to content

feat: measure Stage 12 coordinator preparation - #708

Draft
anth-volk wants to merge 3 commits into
mainfrom
feat/stage12-planning-observability
Draft

anth-volk wants to merge 3 commits into
mainfrom
feat/stage12-planning-observability

Conversation

@anth-volk

@anth-volk anth-volk commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #707

Summary

Measure the complete Stage 12 coordinator preparation interval and prevent simulation processes from publishing metrics under shared resource identities.

Existing trace data bounded a 38.7-second unmeasured interval between acquisition of report execution ownership and child-state persistence. The current telemetry cannot determine which statement consumed that time. This PR covers the complete interval and divides output preparation into nested operations so the next deployed report can identify the source.

Changes

  • Register stage12_coordinator_preparation for the complete previously unmeasured interval.
  • Register nested operations for output planning, country model loading, output configuration, output variable resolution, and child input construction.
  • Record baseline and reform input construction separately with simulation_role on logs and spans.
  • Give each Modal and Cloud Run Python process a stable unique service.instance.id.
  • Read MODAL_REGION in Modal and deploy CLOUD_RUN_REGION to the simulation entry service.
  • Require policyengine-observability 3.0.2 across simulation projects.
  • Test Stage 12 with the real observability runtime and confirm that each planning completion record retains the report's observability_id.
  • Document the stage definitions and resource identity rules for future agents.
  • Rebase the branch onto the default branch containing the Stage 12 UK local-authority boundary changes.

Testing

  • The Stage 12 operation-recording test and real-runtime identifier-propagation test pass after the rebase.
  • 37 passed in the focused Stage 12 output planning and coordinator run after rebasing onto current main.
  • 17 passed in the simulation observability and stage registry run.
  • 25 passed in the simulation entry deployment asset run.
  • All affected lockfiles are current, and Ruff formatting passes for every changed Python file.

Dependency and rollout

PolicyEngine/policyengine-observability#34 published policyengine-observability 3.0.2. This branch now locks that release in every affected project.

The branch is rebased onto simulation API main after #703. It retains the current policyengine[models]==6.2.1 dependency and corresponding lockfile while applying the observability changes.

@anth-volk
anth-volk force-pushed the feat/stage12-planning-observability branch 2 times, most recently from 4635ee9 to 293fabd Compare September 30, 2026 21:25
@anth-volk
anth-volk force-pushed the feat/stage12-planning-observability branch from 2811cac to f075d8a Compare October 1, 2026 12:21

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Measure Stage 12 coordinator preparation and separate metric producers

1 participant