/* SPDX-License-Identifier: Apache-2.0 * (c) 2026 Lutar, Stephen P. - SZL Holdings - ORCID 0009-0001-0110-4173 * ============================================================================ * szl_label_engine.js - SHARED MODULE (byte-identical across a11oy + killinchu) * ---------------------------------------------------------------------------- * The single honest-label primitive for the SZL estate. Renders the canonical * doctrine badges. NO build step, NO CDN, vanilla ES5-safe JS, browser + Node. * * Doctrine gate G7 (honest labels) + G8 (the half-state is the only * unacceptable outcome). Every demo surface labels what is real; this module is * the one place the badge vocabulary, colors and semantics live so the two apps * never drift. Importing tabs MUST NOT invent their own pills. * * Canonical badge vocabulary (the ONLY allowed honest labels): * LIVE - real backend wired, data is genuinely live, honest * SAMPLE - honest sample / illustrative fixture (not live) * FORECAST - model-produced forward estimate (e.g. seismic pulse) * OSINT - open-source intelligence (sensed, unauthenticated claims) * MODELED - deterministic model output, labeled (e.g. RUL, ent. forecast) * SIMULATED - effector / decision simulation, human-on-the-loop (G6) * CONNECT-READY - real schema, awaits OAuth; sample until connected * EXPERIMENTAL - CI-green Lean wave, not locked-8 * HEURISTIC - rule/heuristic advisory, not proven * PQC-ROADMAP - post-quantum signing is roadmap, never shown deployed (G4) * ILLUSTRATIVE - explicitly illustrative (e.g. wow ROI) * * Public API (window.SZLLabels / module.exports): * SCHEMES - frozen registry {KEY:{label,cls,title,...}} * badge(key, opts?) - returns an HTMLElement * badgeHTML(key, opts?) - returns a sanitized HTML string * isHonestLabel(key) - boolean: is this a canonical honest label? * normalize(key) - canonicalizes aliases ("connect_ready" -> "CONNECT-READY") * auditText(str) - returns [] of forbidden raw claims (e.g. "100%", "tamper-proof") * ensureStyle(doc?) - injects the