v0.16.1 — Phase-1+ action_digest wire-shape fix - #92
Merged
Conversation
pyproject.toml was bumped to 0.16.1 in v0.16.1 prep but __version__.py was left at 0.15.2, causing source-of-truth drift. Align __version__ to 0.16.1 so downstream tools that grep __version__ see the same value as pyproject.
Phase-1+ SDKs (proto>=3) MUST populate action_digest on every /gate call (backend v3.62.1 / ADR-023 P1-6, gate.rs:56) — the gate fail-CLOSED-rejects any client that omits the digest. This release: - Adds BusinessImpact.no_impact() sentinel + compute_action_digest for Phase-1+ SDKs to compute a deterministic NoImpact digest. - Wires action_digest into check_workflow_budget so @Protect calls always emit a digest, even when no typed business impact is extracted. - Adds test_business_impact.py covering canonical JSON, digest computation, and the NoImpact digest pinning (sha256 hex literal). - Bumps pyproject.toml to 0.16.1. Ref: ADR-023 P1-6, backend/src/proxy/http/gate/gate.rs:56 Ref: backend/src/proxy/http/gate/internal.rs:2687-2715 (digest re-check)
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
CI on PR #92 failed on ruff I001 (import-block ordering) in src/nullrun/runtime.py:1852. Ruff wants business_impact imports before context AND a separate from-import statement per aliased name when a block contains more than one alias. Pre-fix the file had a single block that combined two as-aliased names from the same module; ruff's stricter rule requires one import statement per aliased name. Behaviour is identical — both names are still imported as the same locals. 1575/7skipped pass locally before and after the change.
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.
Summary
SDK v0.16.1 closes the Phase-1+
action_digestwire-shape gap on every/gatecall. Behavior change for every@protect-decorated LLM call and any other path that goes throughruntime.check_workflow_budget— those calls previously omittedaction_digestand were fail-CLOSED-rejected by the backend's proto>=3 version-gate.What changed
BusinessImpact.no_impact()sentinel +NoImpactPayloademitting canonical{"kind":"none"}— lets the SDK compute a deterministic NoImpact digest without inventing a fake typed impact.runtime.check_workflow_budgetnow populatesaction_digeston every/gatecall (was previously only forwarded on/executeviatransport.execute). Perbackend/src/proxy/http/gate/gate.rs:56(v3.62.1, ADR-023 P1-6), the gate fail-CLOSED-rejects any proto>=3 client that omits the digest.transport.checkforwardsaction_digestonly when truthy, so Phase-0 callers that still omit the field continue to flow through unchanged.tests/test_business_impact.py::test_no_impact_digest_pins_hexpins the literal SHA-256 hex ofnullrun/v1/business_impact:{"kind":"none"}— a canonicalisation drift between SDK and backend is caught at unit-test time.__version__realigned to 0.16.1 (was left at 0.15.2 after the pyproject bump in v0.16.1 prep).Migration
Callers do not need to change anything. Every
/gatesite that goes throughruntime.check_workflow_budget(i.e. every@protect-decorated LLM call, every explicitcheck_workflow_budget()call, and everywith workflow(...)block) now succeeds against Phase-1+ backends.Tests
tests/test_business_impact.py:test_no_impact_digest_pins_hex— pinned hex literal.test_no_impact_is_deterministic— two constructions produce the same digest (sentinel is a bind token).test_no_impact_differs_from_money— collision-resistance against real Money digests (a collision would let a "no impact" call reuse an existing approval row's grant).test_no_impact_payload_direct— pins the no-opNoImpactPayload.validate()+ single-keyto_wire_dict().Compatibility
action_digestis a new optional field).action_digestonly when truthy).Files
Note on commit history
The two commits (
fc926b2version bump,16940c1Phase-1+ fix) were cherry-picked fromfix/remove-flaky-approval-timeout-test(the branch the v0.16.0 PR #91 was developed on) onto a freshrelease/0.16.1fromorigin/master(6978117, post-#91-merge) — keeping master as the single integration point.