🛡️ Architecture Guard

The Architecture Guard is the enforcement engine that turns Nexus Graph from a “nice to have” into a “must-have”.

The Problem

In standard Unity development, it is too easy to create bad dependencies:

  • A PlayerController referencing MainMenuUI (Core -> UI).
  • A GameManager referencing Editor scripts (Build Breaker).
  • A 5KB Prefab referencing a 4K Texture (Memory Bloat).

The Solution: Active Protection

Nexus Graph includes a SaveGuard system that intercepts your work efficiently.

How SaveGuard Works (Internals)

Unlike other tools that require a “Full Project Scan” (taking minutes), SaveGuard runs locally on the specific asset you are modifying.

  1. Trigger: You press Ctrl + S.
  2. Scan: SaveGuard extracts the dependencies of the dirty asset in memory.
  3. Validate: It compares these dependencies against your Active Rule Set.
  4. Enforce:
    • Warning Mode: Logs a warning but allows the save.
    • Strict Mode: BLOCKS THE SAVE and shows a dialog explaining the violation.

“It’s like having a Senior Architect pair-programming with you 24/7.”

Configuration

You can toggle modes directly from the toolbar: Tools > Nexus Graph > Guard > [Toggle Strict Mode]

Rule Examples

| Source | Target | Reason | | :— | :— | :— | | .*Core.* | .*UI.* | Separation of Concerns. Core logic should be testable without UI. | | .* | .*Resources.* | Memory Safety. Prevents usage of the inefficient Resources folder. | | .*Game.* | .*Editor.* | Build Safety. Ensures no editor-only scripts leak into runtime code. |

Passive Validation

You can also run a full project audit at any time:

  1. Open the Graph Window.
  2. Click Check Rules.
  3. Receive a detailed report of all 100+ violations in legacy projects.

This site uses Just the Docs, a documentation theme for Jekyll.