semantics
This commit is contained in:
@@ -41,7 +41,7 @@ Decision memory prevents architectural drift. It records the *Decision Space* (W
|
||||
2. **Task Guardrails** — Preventive `@REJECTED` tags injected by the Orchestrator to keep you away from known LLM pitfalls.
|
||||
3. **Reactive Micro-ADR (Your Responsibility)** — If you encounter a runtime failure and invent a valid workaround, you MUST ascend to the contract header and document it via `@RATIONALE [Why]` and `@REJECTED [The failing path]` BEFORE closing the task.
|
||||
|
||||
**⚠️ `@RATIONALE`/`@REJECTED` ARE C5-ONLY.** Decision Memory tags belong exclusively to C5 contracts per core complexity scale. C4 adds `@PRE`/`@POST`/`@SIDE_EFFECT` — not decision memory. If a C1-C4 contract genuinely needs decision memory, it should be C5.
|
||||
**`@RATIONALE`/`@REJECTED` are UNIVERSALLY OPTIONAL (C1–C5).** Decision Memory tags are allowed — and encouraged — at ALL complexity tiers. They document the *why* behind any architectural choice, preventing regression loops when another agent (or your future self) revisits the contract. The complexity tier determines which structural tags are REQUIRED, not which explanatory tags are forbidden.
|
||||
|
||||
**Resurrection Ban:** Silently reintroducing a coding pattern, library, or logic flow previously marked as `@REJECTED` is classified as a fatal regression. If the rejected path is now required, emit `<ESCALATION>` to the Architect.
|
||||
|
||||
@@ -72,6 +72,12 @@ Every non-trivial contract change MUST be framed as a verifiable edit loop:
|
||||
|
||||
**Shortcut Ban:** A patch that "looks right" but is not tied to an executable verifier is incomplete.
|
||||
|
||||
**Anchor Safety Ban:** A patch that adds, removes, or moves ANY `#region`/`#endregion` line without verifying ALL pairs remain intact via `read_outline` is forbidden. NEVER:
|
||||
- Add `@COMPLEXITY N` or `@C N` — complexity is `[C:N]` in the anchor
|
||||
- Insert code between a `#endregion` and the next `#region` (creates orphan code)
|
||||
- Start a new `#region` before closing the previous one
|
||||
- Duplicate `#endregion` markers
|
||||
|
||||
## VI. SEARCH DISCIPLINE (DELIBERATE BUT BOUNDED)
|
||||
|
||||
- Default to one primary implementation hypothesis plus explicit verification.
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user