Replace CONSTRAINTS.md with frontend-specific constraints - Next.js, SSR boundaries, UI philosophy, forbidden patterns

This commit is contained in:
jester 2025-12-27 23:33:19 +00:00
parent a2fc3fc78a
commit 5ba386b1c8

View File

@ -1,43 +1,43 @@
# Constraints zlh-grind # ZeroLagHub Frontend Constraints (ZLH Grind)
This repository is strictly for *decision tracking*, *constraints*, and *ground rules*. These constraints are **non-negotiable**.
It is not an implementation repo. They exist to prevent architectural drift, instability, and "demo-ware" UI patterns.
--- ## Runtime & Framework
- Node.js **22 LTS**
- Next.js **App Router**
- React 18
- TypeScript
- Build once → run many
- No runtime builds
- No PM2 during active development
## Execution model constraints ## SSR & Client Boundaries
- zlh-agent executes installer logic as **embedded scripts**. - Any file that touches:
- Embedded scripts must not rely on filesystem-relative paths (`$0`, `dirname`, etc.). - `window`
- Any shared logic must be executed in the **same shell session** as its callers. - `document`
- `location`
- WebSockets
- xterm / DOM refs
**MUST** be a client component with `"use client"` as the first line.
- No browser globals at module scope in server components.
- Prefer `useEffect` for browser-only logic.
--- ## UI Philosophy
- Control-plane first, not marketing gimmicks.
- Flat UI by default.
- Subtlety beats spectacle.
- Readability > novelty.
## Installer contract constraints ## Explicitly Forbidden
- Installers must be: - Neon / RGB accent colors outside error states
- deterministic - Scanline / CRT / HUD overlays
- artifact-driven - Persistent 3D transforms or perspective UI
- idempotent - Excessive glow stacking
- strict (`set -euo pipefail`) - Clip-path bevel frames
- All runtime installers require explicit environment projection: - Continuous decorative animations
- `RUNTIME_VERSION` is mandatory
- artifact naming may be customized via `ARCHIVE_PREFIX`
- Installers must not parse JSON or agent state files.
--- ## Branding
- Brand: **ZeroLagHub**
## Responsibility boundaries - Shorthand: **ZLH**
- API declares *intent* (runtime, version, container type). - Gaming heritage is acceptable, esports aesthetic is not.
- Agent translates intent into:
- environment variables
- filesystem operations
- installer execution order
- Installers perform no orchestration or decision-making.
---
## Anti-patterns (explicitly forbidden)
- Mega-installers that handle multiple runtimes via branching logic
- Package-managerbased installs (apt, nvm, pyenv, sdkman)
- Weakening installer strictness to accommodate agent bugs
---