Skip to content

release(0.12.1): wire server-minted execution_id through /check -> /t…#51

Merged
maltsev-dev merged 2 commits into
masterfrom
release/0.12.1
Jul 4, 2026
Merged

release(0.12.1): wire server-minted execution_id through /check -> /t…#51
maltsev-dev merged 2 commits into
masterfrom
release/0.12.1

Conversation

@maltsev-dev

Copy link
Copy Markdown
Member

…rack

Bug-fix release. The 0.12.0 changelog claimed the SDK propagates the server-minted execution_id from /check to /track but the wiring was never shipped -- the SDK still sent client-supplied ids on /track/batch and ignored reservation_id on /check responses.

Closes the four gaps documented in docs/sdk-v3-migration-gaps.md:

  • check_workflow_budget() now reads response["reservation_id"] into a contextvar (nullrun.context._server_minted_execution_id_var).
  • New helpers set_/get_/reset_/clear_server_minted_execution_id plus a paired _server_minted_reservation_at timestamp for the 295s TTL guard.
  • _enrich_event stamps execution_id on the /track payload while the captured reservation is fresh; past the 295s safety window it drops and clears the capture so a doomed id never ships to /track (which would 503 RESERVATION_NOT_FOUND -- CLAUDE.md section 33).
  • _route_track dispatches llm_call events to the v3 /api/v1/track single-event endpoint via Transport.track_single() so backend gate_consume_v3 validates the consume-vs-reserve + epsilon invariant (CLAUDE.md section 25). Span / tool events keep using the legacy /api/v1/track/batch. NULLRUN_V3_TRACK_DISABLE=1 forces everything through the legacy batch path (backends still on v1/v2).

Adds 27 contract tests in tests/test_v3_server_minted.py covering contextvar hygiene, capture defence-in-depth, _enrich_event age threshold, _route_track dispatch, and end-to-end /gate -> /track round trip.

What

Why

How

Test plan

  • Unit tests pass (per-repo, e.g. cd backend && cargo test, cd frontend && npm test)
  • Lint passes (per-repo, e.g. cd frontend && npm run lint)
  • Type-check passes (per-repo, e.g. cd frontend && npm run type-check)
  • Manually verified in dev / staging

Risk

Checklist

  • I have read the repo's CONTRIBUTING.md (if present)
  • My change does not introduce new lint warnings
  • I have updated the CHANGELOG (if user-visible)
  • I have considered backwards compatibility

…rack

Bug-fix release. The 0.12.0 changelog claimed the SDK propagates the
server-minted execution_id from /check to /track but the wiring was
never shipped -- the SDK still sent client-supplied ids on
/track/batch and ignored reservation_id on /check responses.

Closes the four gaps documented in docs/sdk-v3-migration-gaps.md:

* check_workflow_budget() now reads response["reservation_id"] into
  a contextvar (nullrun.context._server_minted_execution_id_var).
* New helpers set_/get_/reset_/clear_server_minted_execution_id plus
  a paired _server_minted_reservation_at timestamp for the 295s TTL
  guard.
* _enrich_event stamps execution_id on the /track payload while the
  captured reservation is fresh; past the 295s safety window it
  drops and clears the capture so a doomed id never ships to /track
  (which would 503 RESERVATION_NOT_FOUND -- CLAUDE.md section 33).
* _route_track dispatches llm_call events to the v3 /api/v1/track
  single-event endpoint via Transport.track_single() so backend
  gate_consume_v3 validates the consume-vs-reserve + epsilon
  invariant (CLAUDE.md section 25). Span / tool events keep using
  the legacy /api/v1/track/batch. NULLRUN_V3_TRACK_DISABLE=1 forces
  everything through the legacy batch path (backends still on
  v1/v2).

Adds 27 contract tests in tests/test_v3_server_minted.py covering
contextvar hygiene, capture defence-in-depth, _enrich_event age
threshold, _route_track dispatch, and end-to-end /gate -> /track
round trip.
…-> 0.12.1)

Same drift pattern as #50: the runtime commit bumped
src/nullrun/__version__.py to 0.12.1 but missed this field. Without
the sync-up `python -m build` would publish a `nullrun-0.12.0-*`
wheel that PyPI Trusted Publishing rejects with HTTP 400 "File
already exists", blocking the publish workflow that fires on
`v*` tags.

Refreshes the inline comment to point at the current bump and
explains why the fix had to be applied again.
@codecov

codecov Bot commented Jul 4, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.39623% with 7 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/nullrun/runtime.py 91.95% 6 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@maltsev-dev maltsev-dev merged commit 8836b50 into master Jul 4, 2026
5 checks passed
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