## KART API NEWSSAK Repository Rules ### Repository Role and Boundaries - This .NET 8 Web API processes and aggregates NEWSSAK survey data and integrates with KART, KON, KIWI, and intranet data sources. - Treat endpoint contracts, report shapes, Excel output, calculation results, and operational behavior as current compatibility contracts. - Keep MySQL and MSSQL access paths, SQL dialects, connection selection, result shapes, and transaction assumptions separate. Do not move a query between DAL implementations merely because its result looks similar. ### DataTable and Statistics Improvement - Excessive `DataTable` and `DataSet` usage in project, report, common, and DAL services is a primary migration concern. - Do not mechanically replace a fixed schema with `Map`. Prefer a specific DTO or record and `List`; use a typed `Map` only for genuinely dynamic survey dimensions or question keys. - Separate database retrieval, row normalization, statistical calculation, report shaping, and Excel serialization before changing frameworks. - Treat weighting, respondent base, missing values, multiple responses, grouping, ordering, decimal precision, rounding, totals, and significance/statistical outputs as behavior contracts. - Establish representative golden-master inputs and outputs before replacing a DataTable or Accord-based calculation. Compare correctness and performance before removing the old path. ### Java Migration Direction - The approved destination is a Gradle-based Spring Boot backend migrated in bounded vertical slices. - Introduce typed Java boundary and domain models rather than reproducing DataTable semantics. Preserve external response compatibility while callers remain on the current contract. - Do not combine framework migration with an unapproved statistical-method or cross-database behavior change. ### Harness and Verification - `AGENTS.md` and `CLAUDE.md` are generated. Edit `.agent/profile.yml` or `.agent/project.md`, then recompose instead of editing generated files. - Use the solution's existing narrow build and test workflow. Do not connect to real databases or regenerate production reports during validation without separate approval.