AyCode.Core/.github/copilot-instructions.md

1.5 KiB

AyCode.Core — Domain Rules

This is the single source of truth for domain rules. Do not duplicate these elsewhere. For detailed docs see: README.mddocs/

Key Abstractions

  1. IId is the foundation interface — almost every entity implements it. Always preserve ID integrity.
  2. Generic entity hierarchy: Interfaces (AyCode.Interfaces) → Entities (AyCode.Entities) → Models (AyCode.Models). Entities are abstract generics; concrete types live in consuming projects.
  3. TrackingState enum (Added/Modified/Deleted/Unchanged) drives client-side change tracking, not EF Core.

Serialization

  1. Toon (Token-Oriented Object Notation) — primary goal is LLM accuracy. @meta/@data sections.
  2. AcBinary — primary goal is speed. Two-phase scan+serialize, reference tracking, string interning.
  3. AcJson — Newtonsoft.Json wrapper with $id/$ref, IId-based reference resolution, and chain API.

Critical Warnings

  1. PasswordHasher — PBKDF2-HMAC-SHA512. Do NOT modify the salt logic or iteration count — existing passwords become unverifiable.
  2. MeasuringStatus.Finnished — intentional legacy typo in consuming projects. Do NOT fix the spelling.
  3. LogLevel enum values — synchronized with database. Do NOT renumber.

Conventions

  1. Do not suggest removal/rollback as a solution — find a fix for the problem.
  2. Extension methods over instance methods for CRUD operations (see DbSets pattern).
  3. Session pattern for reads, Transaction pattern for writes (see DataLayers).