feat(directives): add rule-statement header to 1-8 of 66 v1.md files
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
# Only ast.parse() is not enough — verify semantic correctness by importing and instantiating
|
||||
|
||||
### Rule 7. ast.parse() Is Not Enough
|
||||
|
||||
`py_check_syntax` only confirms `ast.parse()` succeeds. Semantic errors (wrong decorator targets, wrong base class, wrong attribute, missing `self`) are NOT caught. After any multi-line edit, ALWAYS:
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# After every edit, verify by importing and instantiating the new method
|
||||
|
||||
## Pattern: Indentation-Driven Method Visibility
|
||||
|
||||
**The bug:** A class method defined with the right intent (2-space indent) may be parsed as nested inside a previous function if indentation is off by even one space. The file passes syntactically (imports OK) but the method is **not** on the class — `hasattr(App, 'method_name')` returns `False`. Any production code that calls `app.method_name` falls through to `__getattr__`, which delegates to the controller (which also doesn't have the method), and a cryptic `AttributeError` is raised at runtime.
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# Commits must be atomic — one task = one commit
|
||||
|
||||
From `conductor/workflow.md` §"Standard Task Workflow" step 9:
|
||||
- **CRITICAL - ATOMIC PER-TASK COMMITS**: You MUST commit your changes immediately after completing and verifying a single task. Do NOT move on to the next task in the plan without committing the current one. This ensures precise tracking and safe rollback points.
|
||||
- Stage all code changes related to the task.
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# The Any type is banned; use typed field declarations
|
||||
|
||||
### 17.2 Banned: `Any`
|
||||
|
||||
```python
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# Arbitrary mocking of core infrastructure with unittest.mock.patch is banned
|
||||
|
||||
From `conductor/workflow.md` §"Structural Testing Contract":
|
||||
1. **Ban on Arbitrary Core Mocking:** Tier 3 workers are strictly forbidden from using `unittest.mock.patch` to bypass or stub core infrastructure (e.g., event queues, `ai_client` internals, threading primitives) unless explicitly authorized by the Tier 2 Tech Lead for a specific boundary test.
|
||||
2. **`live_gui` Standard:** All integration and end-to-end testing must utilize the `live_gui` fixture to interact with a real instance of the application via the Hook API. Bypassing the hook server to directly mutate GUI state in tests is prohibited.
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# Day, hour, or minute estimates are banned in track artifacts
|
||||
|
||||
From `AGENTS.md` "Critical Anti-Patterns":
|
||||
- **HARD BAN: Day estimates in track artifacts (Tier 1).** Do NOT include day / hour / minute estimates in spec.md, plan.md, metadata.json, or any other track artifact. Day estimates are inaccurate noise; Tier 2 capacity is bounded by attention, not time. Measure effort by **scope** (N files, M sites, N tasks). The user / Tier 2 agent decides the actual pacing. See `conductor/workflow.md` §"Tier 1 Track Initialization Rules" for the full rule, replacement patterns, and rationale. (Added 2026-06-16 per user feedback: "Day estimates are inaccurate. Tier-2s can only do so much in a single track and there is no way in hell its going to be 'DAYS'.")
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# The type alias dict[str, Any] is banned in non-boundary code
|
||||
|
||||
### 17.1 Banned: `dict[str, Any]`
|
||||
|
||||
```python
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# Calling .get('field', default) on dict[str, Any] for known fields is banned
|
||||
|
||||
### 17.6 Banned: `.get('field', default)` on a `dict[str, Any]`
|
||||
|
||||
```python
|
||||
|
||||
Reference in New Issue
Block a user