feat(directives): add rule-statement header to 57-63 of 66 v1.md files

This commit is contained in:
ed
2026-07-03 09:45:50 -04:00
parent 17e3a37b41
commit 4d2179c38f
7 changed files with 14 additions and 0 deletions
+2
View File
@@ -1,3 +1,5 @@
# The test sandbox is enforced via four-layer rules (FR1-FR4) — see the styleguide
## The 4-Layer Model
| Layer | Mechanism | Where | Default-on? |
@@ -1,3 +1,5 @@
# All functions, methods, parameters, and class-level variables must have type hints
## 2. Type Annotations
- **All functions and methods** must have return type annotations.
@@ -1,3 +1,5 @@
# Data classes use explicit typed fields via `@dataclass(frozen=True, slots=True)` — no dict[str, Any]
### 8.5 The Python Type Promotion Mandate (added 2026-06-25)
**C11/Odin/Jai semantics in a Python runtime.** This codebase is written in Python because of practical constraints (time, dependencies, LLM codegen ability), but the convention is to make Python behave as close to a statically-typed value-typed language as the runtime allows. **LLMs default to opaque types (`dict[str, Any]`, `Any`, `Optional[T]`, `hasattr()` polymorphism) because that's what idiomatic Python training data looks like. That defaults to mediocrity; this rule overrides it.**
@@ -1,2 +1,4 @@
# Complex ImGui rendering lives in module-level render_xxx(app) functions, not App class methods
From `conductor/product-guidelines.md` §"Code Standards & Architecture":
- **UI Delegation for Hot-Reload:** All complex ImGui rendering logic must be extracted from the `App` class into module-level functions named `render_xxx(app: App)`. The `App` class should only contain thin delegation wrappers (`def _render_xxx(self): render_xxx(self)`). This architecture is mandatory for supporting state-preserving hot-reloads of the UI logic.
@@ -1,3 +1,5 @@
# The history undo/redo stack has 100-snapshot capacity with debounced change detection
## HistoryManager — the 100-snapshot undo/redo stack
`src/history.py:71 HistoryManager` is a 100-snapshot capacity stack with the following API:
@@ -1,3 +1,5 @@
# Commit messages must be 1-3 sentences — longer than 15 lines is a confession, not a commit
### 7. The Verbose-Commit-Message Pattern (kill it)
**Symptom:** Your commit message is 50 lines. It contains the root cause analysis, the alternatives you considered, the side effects you considered, the cross-references, the "what this doesn't fix", the "what to verify", and a personal essay. The commit message is longer than the diff it describes.
@@ -1,3 +1,5 @@
# Before any edit on a file you haven't touched recently: py_check_syntax, get_file_slice, check the contract
### Rule 2. Verify Before Editing
Before ANY edit to a function you haven't touched recently: