| name | geological-logic |
| description | Standards for handling drillhole data, section interpolation, and 3-level validation. |
| trigger | when implementing geological algorithms, data validation, or drillhole processing logic. |
Geological and Domain Logic
Defines the business rules for processing mining/geological data, ensuring geometric consistency and the integrity of drillhole data.
When to use this skill
- When modifying drillhole processing services (
DrillholeService).
- When designing interpolation algorithms or section intersections.
- When implementing new geological data validation rules.
Degree of Freedom
- Strict: 3-level validation rules and PyQGIS decoupling are mandatory.
Workflow
- Modeling: Define entities using Dataclasses and strict types.
- Validation: Implement the 3 levels (Type, Schema, Business).
- Abstraction: Ensure core logic uses WKT or DTOs, not
QgsGeometry.
- Testing: Create unit tests with varied CRS contexts.
Instructions and Rules
3-Level Validation
- Level 1 (Type): Basic data types and allowed ranges.
- Level 2 (Schema): Consistency between fields (e.g.,
StartDepth < EndDepth).
- Level 3 (Business): External consistency (e.g., "Layer exists", "No overlaps in geology").
Geometry Rules
- Decoupling: Core services MUST NEVER depend on
QgsGeometry.
- WKT Standard: Operate with WKT strings; convert to PyQGIS only at the UI boundary.
- Endpoint Interpolation: Mandate interpolation at exact interval depths in
TrajectoryEngine to guarantee valid segment geometry generation for short intervals.
- Mocks: Use
MockQgsGeometry for local unit tests.
Quality Checklist