Enforce strict AI agent protocol, doc sync, and glossary
- Added "AI AGENT CORE PROTOCOL" to all copilot-instructions.md files: mandates [LOADED_DOCS] prefix, hard-gates tool usage, enforces no-re-read of .md files, and requires user consent for doc/code changes. - Updated CLAUDE.md to require reading copilot-instructions.md first. - Added topic-based doc separation and folder navigation rules. - Changed doc sync: agent now passively detects discrepancies and asks before updating docs. - Every code-modifying response must end with a [DOCUMENTATION CHECK] section. - Centralized measurement system and domain traps in new FruitBank.Common/docs/GLOSSARY.md; updated references in FruitBankHybridApp GLOSSARY.md. - Clarified schema and doc locations in FruitBankHybridApp README.md. - Added hybrid execution model section to AyCode.Core BINARY_FEATURES.md. - Removed unnecessary BeginUpdate/EndUpdate calls in MgGridBase.cs for layout persistence. - Removed full Toon schema from plugin SCHEMA.md to avoid duplication.
This commit is contained in:
parent
4a33872b9d
commit
75974bf238
File diff suppressed because one or more lines are too long
|
|
@ -66,6 +66,24 @@ Wire output (Compact mode, ReferenceHandling=All):
|
|||
[ObjectRef(65)] [VarUInt(0)] ← userA, 2nd (2 bytes only)
|
||||
```
|
||||
|
||||
## Hybrid Execution Model (Runtime vs Source Generated)
|
||||
|
||||
The serializer employs a "frictionless" hybrid execution model to balance ease of use with maximum performance.
|
||||
|
||||
**Zero-Configuration (Runtime Fallback)**
|
||||
By default, any class or record can be serialized without attributes. The serializer discovers properties via reflection, computes the deterministic base→derived order, and falls back to compiled delegates (`GetValue`) for property access. This provides a no-friction start and easy integration with 3rd-party types.
|
||||
|
||||
**Source Generator (SGen)**
|
||||
When a type is decorated with `[AcBinarySerializable]`, the Source Generator emits highly optimized, reflection-free serialization code (inlining property writes, avoiding dictionary lookups).
|
||||
|
||||
**Seamless Interoperability**
|
||||
When `UseGeneratedCode = true` (default), the framework seamlessly mixes both approaches during a single serialization run:
|
||||
- When the runtime encounters a type with a generated writer (`wrapper.GeneratedWriter != null`), it directly invokes it.
|
||||
- If the generated code encounters a nested type that *lacks* a generated writer, it seamlessly calls back into the runtime pipeline (`ScanValueGenerated` / `WriteValueGenerated`).
|
||||
- If `UseGeneratedCode = false`, the serializer ignores all SGen outputs and strictly uses the runtime fallback (useful for fallback testing or specific isolation needs).
|
||||
|
||||
This allows developers to iteratively optimize performance bottlenecks (by adding attributes to hot-path classes) without breaking compatibility or requiring a total rewrite.
|
||||
|
||||
## Property Ordering
|
||||
|
||||
Properties are serialized in a deterministic order defined by `TypeMetadataBase.GetUnfilteredProperties()`:
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Always read `.github/copilot-instructions.md` first — it is the single source of truth for this repo.
|
||||
CRITICAL: Your FIRST action in every session MUST be reading `.github/copilot-instructions.md`. Execute ALL session-start instructions found there before responding to any user query. It is the single source of truth for this repo.
|
||||
|
|
|
|||
Loading…
Reference in New Issue