Skip to main content

qualia_vision/capability/
registry.rs

1//! Machine-readable vision excellence capability registry (D1–D9 spine).
2
3use super::entry::CapabilityEntry;
4use super::status::CapabilityStatus;
5
6/// Full registry snapshot for ledger / Studio / swarm progress.
7pub fn all_capabilities() -> &'static [CapabilityEntry] {
8    REGISTRY
9}
10
11/// `by` ID.
12pub fn by_id(id: &str) -> Option<&'static CapabilityEntry> {
13    REGISTRY.iter().find(|e| e.id == id)
14}
15
16/// `count-by` status.
17pub fn count_by_status(status: CapabilityStatus) -> usize {
18    REGISTRY.iter().filter(|e| e.status == status).count()
19}
20
21macro_rules! cap {
22    ($id:expr, $dom:expr, $name:expr, $st:ident, $hon:expr) => {
23        CapabilityEntry::new($id, $dom, $name, CapabilityStatus::$st, $hon)
24    };
25}
26
27static REGISTRY: &[CapabilityEntry] = &[
28    // D1 classical
29    cap!("D1.01", "D1", "buffer_roi_channels", Present, "cv/buffer"),
30    cap!("D1.02", "D1", "colour_hist", Present, "cv/color + cv/hist"),
31    cap!("D1.03", "D1", "filters", Present, "cv/filter gaussian/median/box"),
32    cap!("D1.04", "D1", "morphology", Present, "cv/morph erode/dilate"),
33    cap!("D1.05", "D1", "edges", Present, "cv/edges sobel/canny"),
34    cap!("D1.06", "D1", "contours", Present, "cv/contours find_external"),
35    cap!("D1.07", "D1", "warps", Present, "cv/transform affine/perspective"),
36    cap!("D1.08", "D1", "features_orb_match", Present, "cv/features ORB-class + match"),
37    cap!("D1.09", "D1", "optical_flow", Present, "cv/flow lucas_kanade_sparse"),
38    cap!("D1.10", "D1", "codecs_png_jpeg", Present, "computer_vision::cv::codecs — PNG encode+decode (png crate) byte-exact round-trip; baseline JPEG decode (jpeg-decoder); fail-closed on garbage"),
39    cap!("D1.11", "D1", "video_file_io", Present, "cv::video::demux_mp4 — real MP4 container demux (track metadata + encoded packets w/ timestamps/keyframes, mp4 crate) + FrameSequence ring; RGB codec decode is codec-gated (separate)"),
40    cap!("D1.12", "D1", "camera_capture", Partial, "desktop intent pattern; vision hooks"),
41    cap!("D1.13", "D1", "drawing_overlay", Present, "cv/draw + overlay"),
42    cap!("D1.14", "D1", "photo_denoise", Present, "cv/photo bilateral_denoise"),
43    cap!("D1.15", "D1", "stitch", Missing, "optional vertical"),
44    cap!(
45        "D1.16",
46        "D1",
47        "classical_sr",
48        Present,
49        "specialized_libs::computer_vision::sr; nearest+bicubic on shared_gpu when Cool; lanczos + edge-directed-lite CPU; MCP computer_vision"
50    ),
51    // D2 learned
52    cap!("D2.01", "D2", "detector_tracker", Partial, "ByteTrack MOT Present; YuNet decode+optional --features ort infer; default FeatureDisabled"),
53    cap!("D2.02", "D2", "semantic_quins", Beyond, "epistemic observations"),
54    cap!("D2.03", "D2", "qvwt_load", Present, "QVWT seed load Present; YOLO-NAS Apache AdapterMissing until ONNX"),
55    cap!("D2.04", "D2", "segmentation", Missing, "AdapterMissing/weights TBD — not commercial-licence"),
56    cap!("D2.05", "D2", "depth_mono", Missing, "AdapterMissing/weights TBD"),
57    cap!("D2.06", "D2", "body_pose", Partial, "pose/hand pack xy + vendor weights; ORT/TFLite session AdapterMissing"),
58    cap!("D2.07", "D2", "ocr", Missing, "product demand"),
59    cap!("D2.08", "D2", "generative_image", Partial, "reference generator"),
60    cap!(
61        "D2.09",
62        "D2",
63        "local_cbir_proxy_embed",
64        Present,
65        "aHash/dHash + RGB hist L2 (embeddings/); not CLIP — ONNX CLIP later under vendor/vision/embeddings/"
66    ),
67    cap!("D2.10", "D2", "sr_cnn_light", Missing, "sr/cnn_light_session ort adapter BUILT (fail-closed); drop-in on FSRCNN/ESPCN Apache weights + --features vision-onnx (WeightAbsent). See gated-av-jobs-2026.md"),
68    cap!("D2.11", "D2", "sr_esrgan_edge", Missing, "sr/esrgan_session ort adapter BUILT (fail-closed, generative flag); drop-in on Real-ESRGAN MIT ONNX + --features vision-onnx (WeightAbsent); tile+feather-blend Present"),
69    cap!("D2.12", "D2", "sr_swin_heavy", Missing, "sr/swin_session ort adapter BUILT (fail-closed); drop-in on SwinIR MIT ONNX + --features vision-onnx (WeightAbsent)"),
70    cap!("D2.13", "D2", "sr_tiling_runtime", Present, "computer_vision::sr tile_plan/extract/blend; feather blend + max_tiles fail-closed; tested"),
71    // D3 biosense
72    cap!("D3.01", "D3", "face_landmarks", Partial, "MP buffer→LandmarkFrame+PAD wire Present; .task runtime AdapterMissing"),
73    cap!("D3.02", "D3", "frame_quality", Present, "biosense/quality"),
74    cap!("D3.03", "D3", "rppg_hr", Present, "POS+CHROM ensemble + SNR"),
75    cap!("D3.04", "D3", "hrv_proxy", Partial, "window/SNR gated RMSSD-class"),
76    cap!(
77        "D3.05",
78        "D3",
79        "respiration_video",
80        Present,
81        "motion spectral RR + rPPG low-freq harmonic + ensemble (SNR abstain)"
82    ),
83    cap!("D3.06", "D3", "eulerian_color_mag", Present, "YIQ chroma EVM + IIR band + SNR abstain (TODO-EVM1)"),
84    cap!("D3.07", "D3", "eulerian_motion_mag", Present, "Laplacian multi-scale × temporal band × α + SNR (TODO-EVM1)"),
85    cap!("D3.08", "D3", "lagrangian_mag", Partial, "track-amplify lite; after TODO-EVM1"),
86    cap!("D3.09", "D3", "liveness_pad", Present, "pure-landmark PAD: TTS/TTC + PnP + PAR(2D x, no model Z) + jitter"),
87    cap!("D3.10", "D3", "face_template_vault", Partial, "SFace embed tensor + optional --features ort infer; sanctuary path"),
88    cap!("D3.11", "D3", "voice_biometric", Partial, "qualia-audio speech path + policy"),
89    cap!("D3.12", "D3", "multimodal_bio_fusion", Partial, "recipes fuse when consented"),
90    cap!("D3.13", "D3", "affect_proposals", Present, "blendshape heuristic Path A; optional OMZ emotion Path B gated"),
91    cap!("D3.14", "D3", "au_lite", Partial, "blendshape temporal events when mesh wired"),
92    cap!(
93        "D3.15",
94        "D3",
95        "biosignal_graph",
96        Present,
97        "compile_hr_observation_quins + hashes/confidence; deontic Rppg gate (E1)"
98    ),
99    cap!("D3.16", "D3", "contact_ppg_harness", CompleteWithGate, "principal device corpus"),
100    // D4 policy
101    cap!("D4.01", "D4", "biosense_consent", Present, "purpose-bound consent"),
102    cap!("D4.02", "D4", "deontic_biometric", Present, "evaluate_processing_act permit/deny"),
103    cap!("D4.03", "D4", "sparql_mm_obs", Present, "recipes::faces_in_zone_time — spatial+temporal query over observation quins (count + instance hashes, never template bytes)"),
104    cap!("D4.04", "D4", "sparql_fed_policy", Present, "biosense::policy_permit_check — local permit/deny + reason composing evaluate_processing_act (fail-closed); FED transport is future"),
105    cap!("D4.05", "D4", "cctv_compliance_mode", Present, "stage filter by policy"),
106    cap!("D4.06", "D4", "multi_camera_graph", Missing, "federation depth"),
107    cap!("D4.07", "D4", "jurisdiction_tags", Partial, "policy context field"),
108    cap!("D4.08", "D4", "duress_sanctuary", Partial, "platform sanctuary"),
109    cap!("D4.09", "D4", "mindware_biometric_bind", Partial, "consent co-gate"),
110    cap!("D4.10", "D4", "rights_audit", Present, "biosense audit log lines"),
111    // D5 3D
112    cap!(
113        "D5.01",
114        "D5",
115        "mesh_ir_validate",
116        Present,
117        "spatial/validate + mesh_ir_quality cleanup (C2 weld/degen)"
118    ),
119    cap!("D5.02", "D5", "obj_export", Present, "spatial/export_obj"),
120    cap!("D5.03", "D5", "stl_export", Present, "spatial/export_stl"),
121    cap!("D5.04", "D5", "3mf_export", Present, "computer_vision::spatial::mesh_ir_to_3mf — valid OPC/3MF package (hand-rolled stored-ZIP + CRC-32, 3 parts); fail-closed"),
122    cap!("D5.05", "D5", "gltf_handoff", Present, "computer_vision::spatial::mesh_ir_to_glb — valid binary glTF 2.0 (GLB) from MeshIR; positions+indices accessors, min/max, fail-closed"),
123    cap!("D5.06", "D5", "image_to_3d_heightfield", Present, "spatial/image_to_3d"),
124    cap!("D5.07", "D5", "image_to_3d_multiview", Missing, "recon depth"),
125    cap!("D5.08", "D5", "photogrammetry", Missing, "recon depth"),
126    cap!("D5.09", "D5", "print_readiness", Present, "spatial/print_readiness"),
127    cap!("D5.10", "D5", "printer_envelope", Present, "print_readiness envelope"),
128    cap!("D5.11", "D5", "synthetic_train_scenes", Present, "synthetic module"),
129    cap!("D5.12", "D5", "synthetic_3d_corpora", Partial, "heightfield meshes"),
130    cap!(
131        "D5.13",
132        "D5",
133        "10d_handoff",
134        Present,
135        "vision seal mesh+nodes+topo+spatial+provenance; load/scrub/barrier; browse (C1–C3/D1–D4/F1–F4). MIG-V2 specialized_libs still open"
136    ),
137    cap!("D5.14", "D5", "twin_a1_preview", Present, "twin_bridge A1"),
138    // D6 engineering wire
139    cap!("D6.01", "D6", "comp_geom_ingest", Beyond, "computational_geometry crate"),
140    cap!("D6.02", "D6", "fem_preview_link", Partial, "A1 bar stretch only"),
141    cap!("D6.03", "D6", "cfd_optional", Partial, "engineering_analysis"),
142    cap!("D6.04", "D6", "physics_sim", Beyond, "physics_simulation"),
143    cap!("D6.05", "D6", "linalg_numerics", Beyond, "linear_algebra"),
144    cap!("D6.06", "D6", "symbolic_math", Beyond, "symbolic_*"),
145    cap!("D6.07", "D6", "assurance_a0_a4", Present, "honesty labels twin/FEA"),
146    // D7 biology
147    cap!("D7.01", "D7", "medical_imaging_path", Partial, "bio/medical HU+MIP+resample+unmix; dicom_lite tags/SUV/PHI"),
148    cap!("D7.02", "D7", "anatomy_mesh_graph", Partial, "Anatomy QApp"),
149    cap!("D7.03", "D7", "microscopy", Present, "bio/: Reinhard/Macenko/watershed/Voronoi-Otsu/GLCM — deep models gated"),
150    cap!("D7.04", "D7", "cell_track", Present, "bio/tracking crocker_grier + particle_features"),
151    cap!("D7.05", "D7", "biomarker_graph", Partial, "Anatomy knowledge"),
152    cap!("D7.06", "D7", "cheminformatics", Beyond, "medical_computing"),
153    cap!("D7.07", "D7", "clinical_formulas", Beyond, "non-vision"),
154    cap!("D7.08", "D7", "hipaa_process_notes", Partial, "compliance module"),
155    cap!("D7.09", "D7", "bio_twin_viz", Present, "viz-only default"),
156    // D8 multimodal
157    cap!("D8.01", "D8", "shared_media_clock", Present, "qualia-audio"),
158    cap!("D8.02", "D8", "av_correlation", Present, "non-causal"),
159    cap!("D8.03", "D8", "joint_biosense", Partial, "recipe-level"),
160    cap!("D8.04", "D8", "cross_modal_train_export", Missing, "later"),
161    // D9 surfaces
162    cap!("D9.01", "D9", "studio_vision_workbench", Partial, "workbench + live Enhance panel (vision_super_resolve cmd, tier/device picker, honesty chip); biosense panels pending"),
163    cap!("D9.02", "D9", "wellfair_handoff", Partial, "optional export"),
164    cap!("D9.03", "D9", "library_catalogue", Present, "perception_catalog"),
165    cap!("D9.04", "D9", "wasm_edge_profile", Partial, "capability subset"),
166    cap!("D9.05", "D9", "desktop_camera_ux", Partial, "consent UX"),
167];
168
169#[cfg(test)]
170mod tests {
171    use super::*;
172
173    #[test]
174    fn registry_nonempty_unique_ids() {
175        assert!(REGISTRY.len() >= 40);
176        for (i, a) in REGISTRY.iter().enumerate() {
177            for (j, b) in REGISTRY.iter().enumerate() {
178                if i != j {
179                    assert_ne!(a.id, b.id);
180                }
181            }
182        }
183    }
184
185    #[test]
186    fn present_count_positive() {
187        assert!(count_by_status(CapabilityStatus::Present) >= 15);
188    }
189}