Skip to content

Emit the Stage 12 runtime's log fields and INFO records - #1094

Draft
anth-volk wants to merge 5 commits into
v2plan/c1-34-v2-telemetry-record-idsfrom
v2plan/c1-34-plain-extra-log-fields
Draft

anth-volk wants to merge 5 commits into
v2plan/c1-34-v2-telemetry-record-idsfrom
v2plan/c1-34-plain-extra-log-fields

Conversation

@anth-volk

Copy link
Copy Markdown
Contributor

Fixes #1093

Stacked on #1092 (v2plan/c1-34-v2-telemetry-record-ids), which added log_extra and used it for every Simulation Entrypoint log call. This PR does the same for Stage 12.

What changes

  • Four Stage 12 log calls pass their fields through log_extra, so the observability runtime's handler emits them:

    • stage12_result_comparison_completed: evaluation_id, production_job_id, comparison_status, difference_count, production_result_sha256, stage12_result_sha256;
    • stage12_result_comparison_state_update_failed: evaluation_id, production_job_id;
    • stage12_result_comparison_failed: evaluation_id, production_job_id, error_type;
    • a child simulation's failed state update or cancellation (coordinated_simulations._log_child_operation_failure): evaluation_id, simulation_execution_id, simulation_role, error_type.

    All are IDs, a role, a status, a count, SHA-256 digests or an exception class name.

  • The stage12_runtime logger is set to INFO when the package is imported. The root logger stays at WARNING, which discarded the package's three INFO records: stage12_result_comparison_completed, the budget-window advance message, and the stuck-run sweep's "no longer exists" message. Importing the v1 Modal app and its worker modules doesn't load the package, so v1 logging doesn't change.

  • Rule sim.observability.log-fields-through-log-extra now covers Stage 12: the executor's stage12_* modules and packages, and the Stage 12 and v2 Modal applications. The static check counts the Entrypoint's and Stage 12's calls separately, so it notices if a Stage 12 package moves.

Left as they are

The v1 code's two plain-extra= log calls stay unchanged, because v1 telemetry stays as it is:

  • log_and_redact_exception in the shared observability library. Its fields also reach telemetry as its gateway_error_redacted event.
  • The contract library's budget_window_state warning.

No Stage 12 or Entrypoint code calls either one.

A related point that predates this PR: stage12_result_comparison_state_update_failed uses logger.exception, so the runtime emits the store error's message and stack through exc_info, although the next call's comment says Stage 12 failure logs carry only the error type. This PR doesn't change that.

No image contents, secrets or environment variables change.

Tests

Test-first: b3068ce adds the failing tests. Only the new and affected tests were run, by node ID:

  • the shared assert_log_identifies_child assertion and the seven tests that use it;
  • the two comparison log tests;
  • the new INFO-level test;
  • the widened static check and its rule proof.

One read-only review round found no bugs; its quality findings are fixed in 1ab7c3f.

🤖 Generated with Claude Code

anth-volk and others added 5 commits November 17, 2026 14:20
…ted (failing)

Four Stage 12 log calls, three in `comparison` and one in
`coordinated_simulations`, pass their fields only as plain `extra=` keys,
which the observability runtime's log handler never emits; and the root
logger's WARNING level discards the Stage 12 runtime's INFO records. The
static log-fields check now also reads `stage12_runtime` and `v2_app.py`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The result comparison's three logs and a child simulation's failed state
update or cancellation now pass their fields through `log_extra`, so the
observability runtime emits them. The Stage 12 runtime's logger is set to
INFO when the package is imported, since the root logger's WARNING level
discarded its INFO records; v1 code never imports the package. Rule
`sim.observability.log-fields-through-log-extra` now covers
`stage12_runtime` and `v2_app.py`. The v1 code's two plain-`extra=` logs
are left as they are.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The static check reads every executor `stage12_*` module and package and
the Stage 12 and v2 Modal applications, and counts the Entrypoint's and
Stage 12's calls apart, so a moved Stage 12 package is noticed. The INFO
test also checks the package logger's own level, not only the effective
one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… Stage 12 log fields branch

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… Stage 12 log fields branch

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

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.

1 participant