Skip to main content

Module envelope

Module envelope 

Source
Expand description

VerdictEnvelopeV1 + ReasonCode — schema-locked mirror of @cleanstart/cleanlib-sdk@0.4.1 (tarball sha-1 b5f00c160907a6ea1f490f14a9bda6f6de34b8b6).

Sister of:

  • sdk-js dist/reason-codes.js + dist/verdict-envelope.schema.json
  • sdk-py cleanlib_sdk/reason_codes.py
  • sdk-go reason_codes.go

Drift between any of the four SDK consumers is a CI failure; cleanlib-contract-fixtures v1.0.0 verifies byte-identical (status, reason_code) across all 4 implementations.

Freshness-precedence rule (ratified 2026-05-28; binding via App dispatch §4

  • Client dispatch §2.3): when the substance-driving signal’s availability == "degraded_stale", the substance-derived status tier is PRESERVED and the reason_code OVERRIDES to VERDICT_DEGRADED_STALE. Server-side VERDICT_DEGRADED_STALE is architecturally distinct from the client-side LIVE_DEGRADED cache-fallback state (extension status bar + Cli7 offline mode).

Structs§

VerdictEnvelopeV1
VerdictEnvelopeV1 — parsed shape of the verdict-envelope.v1.json schema. Top-level fields are required; rich sub-objects are sparse and #[serde(default)]-tolerant so the SDK can consume partial responses during cycle-N spec evolution without forcing a recompile.

Enums§

ReasonCode
Canonical 15-value ReasonCode registry — Rust mirror of sdk-js v0.4.1 dist/reason-codes.js. Drift = CI failure.
Status
Tri-state envelope status tier — sister of sdk-js Literal type 'ALLOW' | 'WARN' | 'DENY'.

Constants§

ALL_REASON_CODES
All 15 canonical reason-code values — consumed by drift-check CI.