semantics

This commit is contained in:
2026-05-20 09:59:03 +03:00
parent b916ef94d5
commit 09d12b3b68
34 changed files with 9727 additions and 8789 deletions

View File

@@ -31,6 +31,14 @@ Contracts (`@PRE`, `@POST`) force you to form a strict Belief State BEFORE gener
- **[INV_5: RESOLUTION OF CONTRADICTIONS]:** A local workaround (Micro-ADR) CANNOT override a Global ADR limitation. If reality requires breaking a Global ADR, stop and emit `<ESCALATION>` to the Architect.
- **[INV_6: TOMBSTONES FOR DELETION]:** Never delete a contract node if it has incoming `@RELATION` edges. Instead, change its type to `Tombstone`, remove the code body, and add `@DEPRECATED` + `@REPLACED_BY`.
- **[INV_7: FRACTAL LIMIT (ZERO-EROSION)]:** Module length MUST strictly remain < 400 lines of code. Single contract node Cyclomatic Complexity MUST NOT exceed 10.
- **[INV_8: MUTATION SAFETY]:** When editing a file with `#region`/`#endregion` anchors:
1. ALWAYS run `read_outline` BEFORE editing to see exact region boundaries
2. NEVER insert, remove, move, or duplicate ANY `#region` or `#endregion` line without verifying ALL pairs remain intact
3. NEVER add `@COMPLEXITY N` or `@C N` complexity is `[C:N]` in the anchor header ONLY
4. ALWAYS run `read_outline` AFTER every edit if `#region`/`#endregion` count doesn't match, immediate rollback
5. ONE file at a time verify between files; batch edits without interleaved verification WILL corrupt the AST
6. ANY `#region` opened MUST have a corresponding `#endregion` with the EXACT same ContractId before EOF
7. `@RATIONALE`/`@REJECTED` are C5-only never add them to C1-C4 contracts
## II. SYNTAX AND MARKUP