## KEPS C# Repository Rules ### Repository Role and Current Authority - This repository is the temporary C# WinForms implementation of an exit-poll application that was migrated from VB before the final Java migration. - Treat the running C# WinForms behavior as the current maintenance authority. Retained VB forms, modules, and related artifacts are comparison material only unless an approved task explicitly includes them. - Preserve .NET Framework 4.8, WinForms designer ownership, UI-thread behavior, existing Excel formats, and operational workflows while the current application remains in service. - Do not expand the temporary architecture or introduce a second long-lived implementation pattern. ### Data, Sampling, and Reporting Safety - Keep form event handlers from accumulating new SQL, sampling, clustering, statistics, or Excel-generation rules. Extract a narrow seam when an approved change must touch one of those concerns. - Treat sampling, cluster maintenance, calculation order, null handling, rounding, row ordering, and generated Excel layout as behavior contracts. - Before changing a calculation or query, capture representative inputs and current outputs that can serve as a golden-master comparison. - Preserve MSSQL parameter types, result shapes, ordering, and transaction behavior. Do not execute database operations during source validation without separate approval. ### Full-Stack Migration Direction - The approved destination is a Spring Boot backend and Next.js/TypeScript frontend, consolidated with the poll-recruit system through staged migration slices. - Define the shared domain, API, authentication, data, and reporting boundaries with poll-recruit before moving implementation code. - Keep the current WinForms and migrated services interoperable until an approved slice has equivalent behavior, rollout criteria, and rollback coverage. - Do not remove the C# or VB reference implementation merely because an initial Java equivalent exists. ### 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 build workflow and the narrowest safe checks. Do not connect to a real database or external service as part of validation without separate approval.