Skip to main content

cvkg_render_native/
lib.rs

1//! # CVKG Agentic Development Guidelines (v1.3)
2//!
3//! All AI agents contributing to this crate MUST follow ALL eight rules:
4//!
5//! ── Karpathy Guidelines (1–4) ────────────────────────────────────────────
6//! 1. THINK FIRST     -- State assumptions. Surface ambiguity. Push back on complexity.
7//! 2. STAY SIMPLE     -- Minimum code. No speculative features. No unasked-for abstractions.
8//! 3. BE SURGICAL     -- Touch only what's required. Own your orphans. Don't improve neighbors.
9//! 4. VERIFY GOALS    -- Turn tasks into checkable criteria. Loop until they pass. Never commit broken.
10//!
11//! ── CVKG Extended Protocols (5–8) ────────────────────────────────────────
12//! 5. TRIPLE-PASS     -- Read the target, its surrounding context, and its full call graph
13//!                      at least THREE TIMES before making any edit or revision.
14//! 6. COMMENT ALL     -- Every major pub fn, unsafe block, and non-trivial algorithm in
15//!                      every .rs/.ts/.h/.wgsl file MUST have a descriptive doc comment.
16//!                      Comments describe WHY and WHAT CONTRACT, not HOW mechanically.
17//! 7. MONITOR LOOPS   -- Check every tool call / command for progress every 30 seconds.
18//!                      After 3 consecutive identical failures, stop, write BLOCKED.md,
19//!                      and move to unblocked work. Never silently accept a broken state.
20//! 8. HARDWARE VERIFIED -- NEVER declare success based on mock data/rendering for native crates.
21//!                      Any change to input, rendering, or lifecycle MUST be verified via physical
22//!                      loopback (e.g., cargo run -p berserker) and signal path tracing.
23//!
24//! Sources:
25//! Karpathy: https://github.com/multica-ai/andrej-karpathy-skills
26//! CVKG Extended: Section 14 of the CVKG Design Specification (v1.3)
27
28#![allow(
29    unused_imports,
30    clippy::single_component_path_imports,
31    dead_code,
32    clippy::items_after_test_module,
33    clippy::field_reassign_with_default,
34    clippy::collapsible_if,
35    clippy::unnecessary_map_or,
36    clippy::needless_return
37)]
38
39//! Platform-native widget delegation using winit and AccessKit
40//!
41//! This crate provides platform-specific rendering backends for native desktop targets
42//! using winit for window/event handling and AccessKit for accessibility tree integration.
43
44pub mod asset_manager;
45pub mod audio;
46pub mod contracts;
47pub mod error;
48pub mod events;
49pub mod main_loop;
50pub mod regression;
51pub mod renderer;
52pub mod window;
53
54#[cfg(test)]
55mod tests;
56
57// Re-export public interface for backward compatibility
58pub use asset_manager::NativeAssetManager;
59pub use audio::{RodioAudioEngine, VisualHapticEngine};
60pub use contracts::{
61    RenderingMode, SemanticRoleMapping, SemanticRoleRegistry, StateSyncContract, StateSyncRegistry,
62    SyncDirection, TranslationContract, TranslationContractRegistry, WidgetVirtualizationConfig,
63};
64pub use events::{convert_ime_event, convert_keyboard_event, convert_mouse_event, load_icon};
65pub use main_loop::{AppEvent, ShieldWall};
66pub use regression::VisualRegressionTracker;
67pub use renderer::NativeRenderer;
68pub use window::{
69    MonitorConfig, MultiMonitorManager, NativeWindowWrapper, ResizeHitTest, SafeAreaInsets,
70    WindowCapabilityMatrix, WindowData, WindowManager, WindowState, WindowStateDetector,
71    WindowType,
72};