Skip to content

release(0.11.0): handle/guarded/init_or_die + v3 wire contract#48

Merged
maltsev-dev merged 1 commit into
masterfrom
0.11.0
Jul 3, 2026
Merged

release(0.11.0): handle/guarded/init_or_die + v3 wire contract#48
maltsev-dev merged 1 commit into
masterfrom
0.11.0

Conversation

@maltsev-dev

Copy link
Copy Markdown
Member

User-facing error handling (Layer 3 of the 'give the user a chance' design): zero-boilerplate helpers in src/nullrun/_handle.py that translate any NullRunError into format_user_message(exc) on stderr + sys.exit(1):

  • nullrun.handle() - context manager
  • @nullrun.guarded - decorator
  • nullrun.init_or_die() - wraps init() so NR-C001 'no api_key'
    exits cleanly instead of traceback

All three propagate WorkflowKilledInterrupt (BaseException) unchanged and let non-NullRun exceptions surface as honest tracebacks. The handle/guarded/init_or_die symbols are added to _LAZY_EXPORTS and all in src/nullrun/init.py; the module name is _handle.py (underscore prefix) so it does not collide with the public nullrun.handle context manager under pytest's test discovery import path.

v3 wire contract updates (transport.py + runtime.py + exceptions.py + context.py) and CHANGELOG entries for the 0.10 / 0.11 cycle.

New tests:

  • tests/test_handle.py - handle / guarded / init_or_die
    including WorkflowKilledInterrupt
    bypass and custom exit_code
  • tests/test_v3_wire_contract.py - v3 wire ping/heartbeat contract

Bumps:

  • pyproject.toml: 0.9.0 -> 0.11.0
  • src/nullrun/version.py: 0.8.0 -> 0.11.0

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

@codecov

codecov Bot commented Jul 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 78.57143% with 54 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/nullrun/transport.py 72.90% 32 Missing and 10 partials ⚠️
src/nullrun/runtime.py 73.17% 8 Missing and 3 partials ⚠️
src/nullrun/context.py 95.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

User-facing error handling (Layer 3 of the 'give the user a chance'
design): zero-boilerplate helpers in src/nullrun/_handle.py that
translate any NullRunError into format_user_message(exc) on stderr +
sys.exit(1):

* nullrun.handle()         - context manager
* @nullrun.guarded         - decorator
* nullrun.init_or_die()    - wraps init() so NR-C001 'no api_key'
                             exits cleanly instead of traceback

All three propagate WorkflowKilledInterrupt (BaseException) unchanged
and let non-NullRun exceptions surface as honest tracebacks. The
handle/guarded/init_or_die symbols are added to _LAZY_EXPORTS and
__all__ in src/nullrun/__init__.py; the module name is _handle.py
(underscore prefix) so it does not collide with the public
nullrun.handle context manager under pytest's test discovery import
path.

v3 wire contract updates (transport.py + runtime.py + exceptions.py +
context.py) and CHANGELOG entries for the 0.10 / 0.11 cycle.

New tests:
* tests/test_handle.py        - handle / guarded / init_or_die
                                including WorkflowKilledInterrupt
                                bypass and custom exit_code
* tests/test_v3_wire_contract.py - v3 wire ping/heartbeat contract

Bumps:
* pyproject.toml: 0.9.0 -> 0.11.0
* src/nullrun/__version__.py: 0.8.0 -> 0.11.0
@maltsev-dev maltsev-dev merged commit 18a91e2 into master Jul 3, 2026
5 checks passed
@maltsev-dev maltsev-dev deleted the 0.11.0 branch July 3, 2026 07:34
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