consolidation pass: replace README with current architecture state

This commit is contained in:
jester 2026-03-01 23:29:04 +00:00
parent e615d09b68
commit 160cecd2a8

View File

@ -11,15 +11,13 @@ It is the authoritative design + operational alignment layer between:
--- ---
## Current System Overview # Current System Overview
### Runtime Model ## Runtime Model
Each game container has a single runtime root: Each game container has a single runtime root:
```
/opt/zlh/minecraft/<runtime>/<world>/ /opt/zlh/minecraft/<runtime>/<world>/
```
All file operations are resolved relative to this root. All file operations are resolved relative to this root.
@ -27,16 +25,18 @@ The agent is the only authority allowed to mutate the filesystem.
--- ---
## File System Capabilities (Current State) # File System Capabilities (Current State)
## Read
### Read
- List - List
- Stat - Stat
- Read text files - Read text files
- Download - Download
- Hidden internal paths blocked (`.zlh_metadata.json`, `.zlh-shadow`) - Hidden internal paths blocked
## Write
### Write
- Full overwrite for: - Full overwrite for:
- `server.properties` - `server.properties`
- `config/*.toml` - `config/*.toml`
@ -44,25 +44,30 @@ The agent is the only authority allowed to mutate the filesystem.
- `config/*.properties` - `config/*.properties`
- Shadow backup created on first modification - Shadow backup created on first modification
- Manual revert supported - Manual revert supported
- No automated rollback for user writes - No automated rollback
## Delete (Constrained)
### Delete (Constrained)
Allowed only for: Allowed only for:
- `mods-removed/<file>` - `mods-removed/<file>`
- `mods-uploaded/<file>` - `mods-uploaded/<file>`
- `logs/<file>.log` - `logs/<file>.log`
- `logs/<file>.log.gz` - `logs/<file>.log.gz`
No directory deletes. No recursive deletes. No directory deletes.
No recursive deletes.
## Upload
### Upload
Allowed only for: Allowed only for:
- `mods/<file>.jar` - `mods/<file>.jar`
- `world/datapacks/<file>.zip` - `world/datapacks/<file>.zip`
Uploads: Uploads:
- Are streamed (raw `http.request` piping in API) - Are streamed
- Written atomically via `os.Rename()` - Written atomically
- Enforced by strict allowlist - Enforced by strict allowlist
- Do not create directories - Do not create directories
- Do not use staging - Do not use staging
@ -70,9 +75,13 @@ Uploads:
--- ---
## Provenance Model # Provenance Model
User uploads write to `.zlh_metadata.json` at runtime root. User uploads write to:
.zlh_metadata.json
Example:
```json ```json
{ {
@ -83,58 +92,61 @@ User uploads write to `.zlh_metadata.json` at runtime root.
} }
``` ```
`stat` returns `"source": "user" | null` stat returns:
`"source": "user" | null`
No curated inference currently implemented. No curated inference currently implemented.
--- ---
## Upload Transport # Upload Transport
```
Browser → API → Agent Browser → API → Agent
API uses raw Node http.request piping:
``` ```
API uses raw Node `http.request` piping:
```js
req.pipe(proxyReq) req.pipe(proxyReq)
proxyRes.pipe(res) proxyRes.pipe(res)
``` ```
No `fetch()` streaming for uploads. Upload timeout must be significantly larger than normal file operations. No fetch() streaming for uploads.
Upload timeout must be significantly larger than normal file operations.
--- ---
## Console Model # Console Model
`TerminalView` owns WebSocket lifecycle. `ServerConsole` owns policy + session gating. TerminalView owns websocket lifecycle. ServerConsole owns policy + session gating.
Console reconnect is automatic. File panel does not interrupt console lifecycle. Console reconnect is automatic. File panel does not interrupt console lifecycle.
--- ---
## Repo Usage # Repo Usage
This repo is used to: This repo is used to:
- Prevent architecture drift - Prevent architecture drift
- Track decisions - Track decisions
- Record sessions - Record sessions
- Track open threads - Track open threads
- Keep portal/API/agent alignment clean - Keep frontend/API/agent alignment clean
--- ---
## Update Instructions # Update Instructions
When updating this repo: When updating this repo:
1. Update `SESSION_LOG.md` with date-stamped entry 1. Update SESSION_LOG with date-stamped entry.
2. Update `OPEN_THREADS.md` if decisions were resolved 2. Update OPEN_THREADS if decisions were resolved.
3. Update `CONSTRAINTS.md` if guardrails changed 3. Update CONSTRAINTS if guardrails changed.
4. Keep architecture docs consistent with real code behavior 4. Keep architecture docs consistent with real code behavior.
5. Do not document future features as implemented 5. Do not speculate future features as implemented.
--- ---
**System posture: Stable, controlled expansion phase.** System posture: Stable, controlled expansion phase.