Home / Docs-Technical WhitePaper / 26-EFT.WP.STG.Lensing v1.0
Appendix B — Contract Library & Strategy Cards (C71 Suite)
One-sentence goal: Provide executable C71-* contracts and strategy cards that enforce consistency and safety across learning / physics / spectral / runtime domains, thereby supporting lens release, monitoring, and rollback.
I. Scope & Objects
- Objects: graph, K (kernel/lens layer), K_eff (composed lens), vis (visibility), M (energy metric), manifest.
- Inputs: offline evaluations, runtime telemetry, dual-form comparisons, physical calibration, dashboard metrics.
- Outputs: contracts.* assertion records, strategy.card.* action recommendations, guardband.*.
- Constraints: contracts must be persistable and replay-verifiable; thresholds use intervals and tolerances tol_*; every metric declares unit(•) and dim(•).
II. Naming, Severity, and Common Fields
- Naming: C71-xy, where x denotes the domain (1 = view, 2 = spectral kernel, 3 = dual forms, 4 = physics, 5 = learning/inversion, 6 = runtime, 7 = safety/explainability, 8 = manifest).
- Severity: sev ∈ { blocker, high, medium, low }; action: action ∈ { fail, warn, degrade, bypass }.
- Common fields: { rule_id, sev, metric, threshold, window, samples, RefCond, evidence_uri, pass, msg, ts }.
III. View / Occlusion Contracts (C71-1) (see Chapter 4)
- C71-11 VisibilityRange: metric = mean(vis); threshold: [v_min, 1]; assert mean(vis) ≥ v_min.
- C71-12 LOSConsistency: metric = || vis_{t+1} − vis_t ||_1 / |V|; threshold ≤ tol_vis.
- C71-13 OcclusionPenaltyBound: metric = occlusion_penalty(x, vis); threshold ≤ pen_max.
- C71-14 ShadowContinuity: metric = TV(shadow_map); threshold ≤ tv_max.
- Breach strategy: degrade → enable gate_by_visibility; bypass → skip K on NLOS subgraphs.
IV. Kernel / Spectral Stability Contracts (C71-2) (see Chapter 5)
- C71-21 SpectralGainBound: metric = sup_λ | g(λ) |; threshold ≤ 1 + eps_gain.
- C71-22 StopbandLeakage: metric = mean_{λ∈S_stop} | g(λ) |; threshold ≤ leak_max.
- C71-23 PassbandRipple: metric = max(| g(λ) − 1 |) on S_pass; threshold ≤ ripple_max.
- C71-24 AnisotropyPSD: metric = κ(A) (condition number of anisotropy tensor); threshold ≤ kappa_max.
- C71-25 EnergyMonotone: metric = E(Kx; M) − E(x; M); threshold ≥ − tol_energy (or enforce non-amplifying ≤ amp_max).
- Strategy card: card.spectral_stabilize → tune theta / stabilizer; reduce order' ≤ order to ensure rho_bound.
V. Dual-Form Consistency Contracts (C71-3) (see Chapters 7 & 11)
- C71-31 TwoFormDelta: metric = || y_spec − y_var ||_2 / || y_spec ||_2; threshold ≤ tol_form.
- C71-32 FormLatencyGap: metric = | latency_spec − latency_var |; threshold ≤ tol_latency.
- C71-33 ApproxErrorBound: metric = eps_bound (derived from approximation order); threshold ≤ tol_approx.
- Strategy: if delta_form exceeds threshold → fail offline; at runtime → degrade to the more stable of spec or var.
VI. Physical Consistency & Conservation Contracts (C71-4) (see Chapter 10)
- C71-41 TransmissionBalance: metric = T_trans = E(y; M) / E(x; M); threshold ∈ [ t_min, t_max ].
- C71-42 BoundaryRespect: metric = || B y ||; threshold ≤ tol_bnd (with boundary operator B).
- C71-43 NonNegativity (for probability/energy fields): metric = min(y); threshold ≥ − tol_nn.
- C71-44 ConservationResidual: metric = || div(Flux(y)) − s ||_2; threshold ≤ tol_cons.
- Strategy: invoke regularize_physical; if still failing → bypass this layer or switch to a conservative kernel.
VII. Learning / De-Lensing & Inversion Contracts (C71-5) (see Chapters 7 & 9)
- C71-51 TrainValGeneralizationGap: metric = | L_val − L_train |; threshold ≤ tol_gen.
- C71-52 CausalInvariance: metric = Δ_inv (cross-environment invariance loss gap) ≤ tol_inv.
- C71-53 InversionResidual: metric = || K x_hat − y ||_2 / || y ||_2 ≤ tol_invres.
- C71-54 SparsityBudget: metric = nnz(K_eff) / DoF ≤ budget_max.
- C71-55 CalibrationCurve: metric = ECE(y_hat, y); threshold ≤ tol_ece.
- Strategy: switch regularization via deconvolve_primal_dual; distill_to_kernel to cap capacity.
VIII. Runtime & Panel SLO Contracts (C71-6) (see Chapter 11)
- C71-61 LatencyP99: metric = P99(latency); threshold ≤ L_p99_max.
- C71-62 CPU/MemBudget: metric = max(cpu_pct, mem_pct); threshold ≤ rsrc_max.
- C71-63 CacheHit: metric = cache_hit_ratio; threshold ≥ hit_min.
- C71-64 ErrorRate: metric = err_rate; threshold ≤ err_max.
- C71-65 DriftScore: metric = drift(x; refs); threshold ≤ drift_max.
- Strategy: fallback_plan → bypass / lower-order / damping; throttle_policy for rate control; snapshot_panel for forensics.
IX. Safety / Explainability / Compliance Contracts (C71-7) (see Chapter 12)
- C71-71 ExplanationCompleteness: metric = cov(TopK attribution, y); threshold ≥ cov_min.
- C71-72 AdversarialRobustness: metric = min_ε s.t. fail; threshold ≥ eps_min.
- C71-73 BiasGap (if applicable): metric = | metric_group_a − metric_group_b | ≤ tol_bias.
- C71-74 InputSanity: metric = rate(|x| > x_max or NaN); threshold ≤ tol_sanity.
- Strategy: trigger robustness_sweep and redact_manifest; fail release if necessary.
X. Manifest / Traceability Contracts (C71-8) (see Chapter 15)
- C71-81 ManifestCompleteness: mandatory keys present: graph, kernel, compose, contracts, uncertainty, signature.
- C71-82 SignatureValid: metric = verify(signature); must pass.
- C71-83 ReproducibilityHash: metric = hash(manifest.bytes) matches replay.
- C71-84 VersionCompat: metric = semver_check(manifest, runtime); must pass.
XI. Strategy Card Templates (Executable Playbooks)
- Template fields: { card_id, triggers:[rule_id], decide:{ if … then … }, act:{ api, params }, verify:{ metric, window }, rollback:{ plan }, notes }.
- Examples:
- card.spectral_stabilize
triggers: [C71-21, C71-23];
decide: sup_λ | g(λ) | > 1 + eps_gain or ripple > ripple_max;
act: I71-11/12 with reduced order & stabilizer;
verify: C71-21/23 within 1 window;
rollback: restore K_prev. - card.visibility_gate
triggers: [C71-11, C71-12];
act: I71-34 gate_by_visibility(vis, rule); bypass on NLOS. - card.form_degrade
triggers: [C71-31];
act: switch to spec/var with lower error;
verify: delta_form ≤ tol_form. - card.runtime_fallback
triggers: [C71-61 … 65];
act: I71-67 fallback_plan → lower-order kernels & throttling;
verify: SLO recovery. - card.physical_regularize
triggers: [C71-41 … 44];
act: I71-47 regularize_physical; if not passing, bypass.
- card.spectral_stabilize
XII. Threshold Suggestions & Calibration
- View: v_min ∈ [0.3, 0.7]; tol_vis ∈ [0.02, 0.1].
- Spectral kernel: eps_gain ∈ [0.0, 0.1]; leak_max ∈ [0.01, 0.05]; ripple_max ∈ [0.02, 0.08].
- Dual forms: tol_form ∈ [1e−3, 5e−2]; tol_latency ∈ [0.5, 5] ms.
- Physics: t_min, t_max scenario-specific (e.g., [0.8, 1.2]); tol_cons ∈ [1e−3, 1e−1].
- Runtime: L_p99_max by SLO; hit_min ≥ 0.7; err_max ≤ 1e−3.
- Learning: tol_gen ≤ 0.05; tol_invres ≤ 0.05; budget_max ≤ 0.3.
Defaults must be offline-calibrated and A/B-validated, then pinned to manifest.contracts.thresholds.
XIII. Persistence & Audit (Manifest Fields)
- contracts.rules[]: status and evidence_uri for each C71-*.
- contracts.thresholds: environment-specific thresholds with version stamp.
- contracts.strategy.cards[]: armed strategy cards and trigger conditions.
- contracts.slo: { latency_p99, err_rate, cache_hit, drift }.
- contracts.audit: { who, when, tool, signature }.
XIV. Cross-References
- View & occlusion: Chapter 4. Spectral kernels & realization: Chapter 5. Learning & inversion: Chapters 7/9.
- Physical consistency: Chapter 10. Runtime: Chapter 11. Manifest & release: Chapter 15. Interfaces: Appendix A (I71-*).
Summary
- The C71-* library spans eight domains—view, spectral kernels, dual forms, physics, learning, runtime, safety, and manifest.
- Strategy cards standardize detect → decide → act → verify → rollback.
- All assertions and remediations are persistable and reproducible, with dashboards and telemetry providing continuous audit.
Copyright & License (CC BY 4.0)
Copyright: Unless otherwise noted, the copyright of “Energy Filament Theory” (text, charts, illustrations, symbols, and formulas) belongs to the author “Guanglin Tu”.
License: This work is licensed under the Creative Commons Attribution 4.0 International (CC BY 4.0). You may copy, redistribute, excerpt, adapt, and share for commercial or non‑commercial purposes with proper attribution.
Suggested attribution: Author: “Guanglin Tu”; Work: “Energy Filament Theory”; Source: energyfilament.org; License: CC BY 4.0.
First published: 2025-11-11|Current version:v5.1
License link:https://creativecommons.org/licenses/by/4.0/