| name | architecture-check |
| description | Gate the RING-5 architecture — the 7 hard rules and the strict 3-layer dependency direction (Web → Core ← Parsing). Use before merging, after any structural/refactor change, or when asked to "check architecture", "run the arch gate", or verify layer boundaries. |
Architecture check (the boundary gate)
RING-5 has one allowed dependency direction — Web → Core ← Parsing — and 7 hard rules
enforced by pre-commit, CI, and make arch-check. This skill is the gate: run it, read every
violation, fix at the source (never weaken the check).
Run it
make arch-check
make quality-gate
make arch-check runs exactly these 8 checks (each must return empty):
- no Streamlit in core —
import streamlit/from streamlit under src/core/
- no session_state in core —
session_state under src/core/
- no
inplace=True — anywhere under src/
- no bare
except: — anywhere under src/
- no
eval(/exec( — under src/ (excluding tests)
- models → services —
src/core/models/ must not import src.core.services (models depend on nobody)
- parsing → core.services —
src/parsing/ (Layer A) must not import src.core.services (Layer B)
- web → concrete state —
src/web/ must not name repository_state_manager (use the
StateManager protocol via the ApplicationAPI facade)
The same 8 live as local hooks in .pre-commit-config.yaml (ids no-streamlit-in-core …
no-web-to-state-manager). make quality-gate folds a subset into Gate 1 plus mypy/black/flake8/bandit.
The hard architecture rules
- Git is human-only — never run git mutations.
- No Streamlit /
session_state in src/core/ or src/parsing/ (UI state lives only in src/web/).
- No
inplace=True on DataFrames in src/ — return new objects (.copy() first).
- No bare
except: — catch specific exceptions; raise/log, never silently swallow.
- No
eval()/exec() in src/; no pickle.load on untrusted data.
- Never fabricate data — a failed gem5 regex must raise/log, never guess a value.
- Async parse/scan only — never add a synchronous wrapper.
Rules 6 and 7 are not greppable — verify them by reading the touched code, not just by a green
make arch-check. The fabrication rule is the highest-stakes one (see [[ring5-arch-audit-2026-06]]).
What "fix at the source" means
- Web needs core data? Go through
ApplicationAPI (api.managers/api.data_services/api.shapers),
not a direct src/core reach-around. See the api-check skill.
- Core needs parsing? Through the
SimulationParser protocol + SimulatorRegistry, never a
src/parsing/gem5/... concrete import.
- A model needs logic? The logic belongs in a service; the model stays pure data.
- Tempted to add
# noqa/inplace=True/a bare except to pass? That's the violation, not the fix.
Keep this skill sharp
This skill is canon, not history — edit it in place (present tense, no changelog) when it drifts:
- The 8 checks above mirror
arch-check: in the Makefile and the local hooks in
.pre-commit-config.yaml. If those change, re-read them and update this list — they are the
source of truth, this is a summary.
- When the gate catches a failure mode worth remembering, add it here; if it's a durable project
fact, document it in the relevant repository-owned developer guide.
Verify after
make arch-check && make quality-gate