Expand description
derive_status — canonical algorithm per App dispatch §4 binding contract.
Each CleanLibrary SDK (sdk-js, sdk-py, sdk-go, cleanlib-client Rust)
implements this algorithm INDEPENDENTLY from the spec; the cross-SDK
contract test (tests/contract.rs) verifies byte-identical
(status, reason_code) across all 4 implementations on every fixture
in cleanlib-contract-fixtures v1.0.0.
Precedence:
-
Substance (signals top-to-bottom;
unavailablesubstrate falls through):exploitability.exploitation_likelihood == "CRITICAL"→ DENY +VERDICT_EXPLOITATION_CRITICALexploitability.in_kevANDavailability.kev == "available"ANDexploitability.exploit_risk_score >= 70→ DENY +VERDICT_KEV_LISTEDrich_data.has_obfuscation→ DENY +VERDICT_OBFUSCATEDremediation.fixORremediation.recommended_versionpresent → WARN +VERDICT_HAS_REMEDIATIONrich_data.abandonment_score >= 0.7→ WARN +VERDICT_ABANDONEDrich_data.recommended_versionpresent (underrich_data, notremediation) → ALLOW +VERDICT_RECOMMENDED_VERSION_NEWER- default
→ ALLOW +
VERDICT_CLEAN
-
Freshness override: when the substance-driving signal’s
availability == "degraded_stale", the substance-derived status tier is PRESERVED and thereason_codeoverrides toVERDICT_DEGRADED_STALE. -
Block tie-break in remediation:
fix>recommended_versionother blocks.
Structs§
- Derived
Status - Return value pair — sister of sdk-py
StatusResult+ sdk-goStatusResult.
Functions§
- derive_
status - Apply the substance-precedence + freshness-override rule to a parsed
VerdictEnvelopeV1. Returns(status, reason_code)pair.