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 20 canonical reason-code values — consumed by drift-check CI. CLEANLIB-176 added VERDICT_RANSOMWARE_LISTED + VERDICT_MALICIOUS (15→17); S1 (cycle-22) added VERDICT_NOT_YET_ASSESSED (17→18); CLEANLIB-511(B2)/503 added VERDICT_CVE_FOUND (18→19); CLEANLIB-518(§3) added VERDICT_RANGE_NOT_RESOLVED (19→20). The three external SDKs (js/py/go) land these in coordinated follow-on PRs.
ALL_VERDICT_SOURCES
Canonical wire-strings for the verdict source field — Rust mirror of cleanlib_core::VerdictSource SCREAMING_SNAKE serde output. The first four are the cycle-≤16 originals; the last four are the CLEANLIB-176 projection variants that let customers separate “has CVEs” (upgrade) from “actively exploited” (KEV) / “ransomware-linked” / “malicious” (remove+audit+rotate). Used by crate::verdict_to_envelope_v1 to refine the reason_code by source while preserving the label-derived status tier.