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 thereason_codeOVERRIDES toVERDICT_DEGRADED_STALE. Server-sideVERDICT_DEGRADED_STALEis architecturally distinct from the client-sideLIVE_DEGRADEDcache-fallback state (extension status bar + Cli7 offline mode).
Structs§
- Verdict
Envelope V1 VerdictEnvelopeV1— parsed shape of theverdict-envelope.v1.jsonschema. 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§
- Reason
Code - Canonical 15-value
ReasonCoderegistry — Rust mirror of sdk-js v0.4.1dist/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
sourcefield — Rust mirror ofcleanlib_core::VerdictSourceSCREAMING_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 bycrate::verdict_to_envelope_v1to refine the reason_code by source while preserving the label-derived status tier.