cendor-sdk 1.7.0
The SDK inherits the libraries — verified. guard is now the identical acttrace object, embeddings are governed pre-flight, the pii bridge honors per-category actions, and a new parity/identity test suite pins every re-export so drift fails the build. Floors: cendor-core>=1.6, cendor-acttrace>=1.5.
Changed
guardis the identicalcendor.acttrace.guardobject (cendor.sdk.guard is cendor.acttrace.guard). acttrace 1.5.0's return is dual-shape (a raw interceptor that is also a context manager), so the SDK's context-manager wrapper is deleted. Existingwith guard(policy, audit=…, on_block=…):code keeps working unchanged;PolicyViolation(the default block exception) is now exported fromcendor.sdkso you can catch it without a lib import.embed()/aembed()are governed pre-flight. The embeddings call now rides the instrumented client and core (≥ 1.6) captures it — so a keylessbudget(usd=…, on_exceed="block")refuses an over-budget embed before it fires and aguard(...)can redact the text before the provider sees it. The SDK's hand-built emit shim is deleted (no double emission;metadata["embedding"]and trace correlation unchanged).- Behavior fix —
rules.pii/secrets/entropyhonor per-category policy actions (via acttrace's newresolve_findings, the same resolutionguard()applies). A category the policy resolves toblocknow blocks and aredactcategory is scrubbed regardless ofaction=; the explicitaction=param applies only to findings the policy leaves at flag tier. Concretely:pii(Policy.gdpr(), action="redact")now blocks aspecial_categoryfinding instead of merely scrubbing it. To purely observe, use an all-flag policy — notaction="flag". Result.usageaggregates through core's field-completeUsagearithmetic (sum_usage) — a futureUsagefield can no longer silently vanish from the aggregate.register_model_pricewrites through core's contractualprices._registerhook — registrations now surviveprices.refresh()(they used to be dropped with the table swap).- Never-retry is
isinstance-matched on the realBudgetExceeded/PolicyViolationclasses (a lib exception rename can no longer silently turn never-retry into retry).
Added
- New re-exports:
PolicyViolation(acttrace);GuardrailDecision,Verdict(guardrails — the types ofResult.guardrail_decisions);LLMCall,ToolCall,Usage,Money(core — typing parity with@cendor/sdk);downgrades,clamps(tokenguard — see what a pre-flight downgrade/clamp rerouted). EvalCase(normalizer=…)— forwarded to cassette's replay matching, so prompts embedding timestamps/uuids still replay.ContextBudgetFallbackbus event — a failedcontext_budgetassembly still falls back silently to raw messages, but now emits a diagnostic on core's bus (from cendor.sdk.runner import ContextBudgetFallback): silent but observable.- SDK↔lib parity/identity test suite (
tests/test_lib_parity.py):is-pins every documented re-export, diffssdk.rulesagainst the library catalogue with a reviewed exclusion allowlist, pins the lib signatures the SDK forwards (a new lib kwarg fails the build instead of lagging silently), and carries the shim-expiry harness for future workarounds.