/** * Spatial Constraint Validator * * Performs compile-time verification of spatial constraints declared in * HoloScript source. Analyzes spatial declarations (positions, bounds, * hierarchy) to detect constraint violations before runtime. * * Diagnostic codes: * HSP030 — spatial_adjacent violation * HSP031 — spatial_contains violation * HSP032 — spatial_reachable violation * HSP033 — spatial constraint target not found * HSP034 — spatial constraint circular reference * HSP035 — spatial constraint incompatible configuration * HSP036 — spatial_temporal_adjacent violation * HSP037 — spatial_temporal_reachable violation * HSP038 — spatial_trajectory violation * * @module spatial/SpatialConstraintValidator */ import type { Vector3 } from './SpatialTypes'; import type { SpatialConstraint, SpatialConstraintCheckResult, SpatialConstraintDiagnostic, SpatialDeclaration, SpatialAxis } from './SpatialConstraintTypes'; /** * Compile-time spatial constraint validator. * * Given a set of spatial declarations (extracted from parsed HoloScript AST), * validates all declared spatial constraints and reports diagnostics. * * @example * ```typescript * const validator = new SpatialConstraintValidator(); * const result = validator.validate(declarations); * if (!result.valid) { * for (const diag of result.diagnostics) { * console.error(`[${diag.code}] ${diag.message}`); * } * } * ``` */ export declare class SpatialConstraintValidator { private declarations; private diagnostics; private constraintMap; /** * Validate all spatial constraints across a set of declarations. */ validate(declarations: SpatialDeclaration[]): SpatialConstraintCheckResult; /** * Validate a single constraint in isolation (useful for incremental checks). */ validateSingle(source: SpatialDeclaration, constraint: SpatialConstraint, allDeclarations: SpatialDeclaration[]): SpatialConstraintDiagnostic[]; private resolveReferences; private detectCircularReferences; private validateAdjacent; private validateContains; /** * Check that a point is inside the container bounds (with margin). */ private validatePointContainment; /** * Strict containment: contained entity's full bounds must be inside container. */ private validateStrictContainment; /** * Recursively check containment for child entities. */ private validateRecursiveContainment; private validateReachable; /** * Check line-of-sight between two points through known obstacles. * Returns the ID of the first blocking obstacle, or null if clear. */ private checkLineOfSight; private validateTemporalAdjacent; private validateTemporalReachable; private validateTrajectory; private validateCrossConstraintConsistency; /** * Reset all internal state for a new validation run. */ private reset; /** * Add a diagnostic to the list. */ private addDiagnostic; /** * Resolve a target ID to a declaration, including type-based matching. */ private resolveTarget; /** * Get the target ID from any spatial constraint. */ private getTargetId; /** * Compute distance along a specific axis filter. */ computeAxisDistance(a: Vector3, b: Vector3, axis: SpatialAxis): number; /** * Convert any bounds type to a BoundingBox, optionally offset by position. */ private toBoundingBox; /** * Ray-AABB intersection test. */ private rayIntersectsBox; /** * Check if a point is within `extraRadius` of a bounding volume. */ private isPointNearBounds; /** * Find all containers that declare spatial_contains with a given entity. */ private findContainers; } //# sourceMappingURL=SpatialConstraintValidator.d.ts.map