The Lite Dynamic State Import/Export functionality provides a streamlined way to import and export component instance data derived from the ResponsiveResponsibilityAggregate materialized view. This system is designed to generate the minimum number of Component Instances (CIs) required to support the correct aggregated posture for UI display and analysis.
Purpose
This functionality analyzes aggregated objects and generates the minimum number of Component Instances (CIs) required to support the correct aggregated posture. For example, if you have a ResponsiveResponsibilityAggregate that represents 200 Component Instance Responsibilities (CIRs) with 190 passing and 10 failing, the system produces 1 CI, CIR, and Component Instance Responsibility Fulfillment (CIRF) for the failing state.
Use Cases
UI Display: Prepare surface-level data for UI components that need aggregated posture information
Bulk Operations: Efficiently handle large datasets (70k+ records) with optimized database operations
Data Synchronization: Keep component instance data in sync with aggregated responsibility data
Performance Optimization: Avoid the overhead of running the full orchestrator for surface-level analysis
Behavior: Skips existing records, only adds new ones
Use Case: Incremental updates, avoiding data loss
REPLACE_ALL Mode (Default)
Purpose: Replace all existing script-created records
Behavior:
Deletes all existing records created by lite-import-script
Imports new records
Use Case: Full refresh, clean state management
Performance: Optimized bulk delete operations for 70k+ records
Export Filtering
Service Name Filtering
Optional: Filter exports by specific service names
Default: Export all services if no filter provided
Performance: Filtering happens at the database layer for efficiency
Data Model
ExportedLiteDynamicStateObject
1
2
{
"responsibilitySlug": "string", // Responsibility identifier
"serviceName": "string", // Service name
"status": "PASSING|FAILING", // Status
"boundarySlug": "PRODUCTION|STAGING", // Boundary
"componentSlug": "APP|SERVICE" // Component type
}
Generated Component Instances
Name: {componentSlug}-{serviceName}-{randomHash}
Parent: Service component instance (if not SERVICE type)
Boundary: Mapped from boundarySlug
Component: Mapped from componentSlug
Created By: lite-import-script
Performance Optimizations
Bulk Operations
Database Level: Native SQL bulk delete operations
Batch Processing: 500 records per batch for imports
Memory Efficient: Avoids loading large datasets into memory
Query Optimization
Entity Graphs: Eager loading of related entities
Bulk Queries: findAllById instead of individual lookups
N+1 Prevention: Bulk fetching of related entities
Methodology
Aggregation Analysis
The system analyzes ResponsiveResponsibilityAggregate records and generates the minimum number of Component Instances required to represent the aggregated posture:
Group by Service: Each service gets analyzed independently
Status Aggregation: Combines passing/failing states per responsibility
Minimal Representation: Creates only the necessary CIs for failing states
Efficiency: Reduces data volume while maintaining accuracy