Skip to content

Commit f01edcd

Browse files
hyperpolymathclaude
andcommitted
feat: add VeriSimDB backup instance for game save metadata
Second VeriSimDB instance (port 8091) dedicated to storing: - Game save file metadata (title, timestamps, checksums) - Save snapshots as document octads - Restore point provenance chain - Config drift vs last known-good save - Server metrics at save time (tensor modality) Includes: - container/verisimdb-backup/config.a2ml with octad schema - container/verisimdb-backup/gsa-verisimdb-backup.container quadlet - Updated selur-compose.toml with backup service - Updated CLAUDE.md with dual-instance documentation Port assignments: Main: 8090 (GSA_VERISIMDB_URL) Backup: 8091 (GSA_BACKUP_VERISIMDB_URL) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent cae200e commit f01edcd

5 files changed

Lines changed: 157 additions & 5 deletions

File tree

.claude/CLAUDE.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ VeriSimDB (8-modality octads) -- container/verisimdb/
6262
- **Secrets** must be redacted as `[REDACTED]` in A2ML output and octad JSON
6363
- **Machine-readable metadata** lives in `.machine_readable/` ONLY (never root)
6464
- **Game profiles** are A2ML files in `profiles/` — support quoted AND unquoted attribute values
65-
- **VeriSimDB instance** is dedicated (port 8090) — never store GSA data in the VeriSimDB source repo
65+
- **VeriSimDB instances** are dedicated — never store GSA data in the VeriSimDB source repo
66+
- **Main** (port 8090, `GSA_VERISIMDB_URL`): server config, probe data, octads
67+
- **Backup** (port 8091, `GSA_BACKUP_VERISIMDB_URL`): game save metadata, snapshots, restore points
6668
- **Container images** use Chainguard Wolfi base, Podman, `Containerfile` (never Docker/Dockerfile)
6769

6870
## Current State (2026-03-29)
@@ -89,6 +91,8 @@ VeriSimDB (8-modality octads) -- container/verisimdb/
8991
| GUI panels | `src/gui/panels/` (7 panels) |
9092
| Panel clades | `panel-clades/` (9 base + game children) |
9193
| Ephapax core | `src/core/` (Shell, Bridge, Types, Capabilities) |
92-
| VeriSimDB container | `container/verisimdb/` |
93-
| VeriSimDB quadlet | `container/verisimdb/gsa-verisimdb.container` |
94+
| VeriSimDB (main, port 8090) | `container/verisimdb/` |
95+
| VeriSimDB (backup saves, port 8091) | `container/verisimdb-backup/` |
96+
| Main quadlet | `container/verisimdb/gsa-verisimdb.container` |
97+
| Backup quadlet | `container/verisimdb-backup/gsa-verisimdb-backup.container` |
9498
| Desktop entry | `game-server-admin.desktop` |

container/selur-compose.toml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,23 @@ environment = { VERISIM_HTTP_HOST = "[::1]", VERISIM_HTTP_PORT = "8090" }
1313
restart = "unless-stopped"
1414
healthcheck = { test = "wget --spider http://[::1]:8090/health", interval = "15s", timeout = "5s", retries = 3 }
1515

16+
[services.gsa-verisimdb-backup]
17+
image = "ghcr.io/hyperpolymath/gsa-verisimdb:latest"
18+
build = { context = "verisimdb", containerfile = "Containerfile" }
19+
ports = ["8091:8080"]
20+
volumes = ["gsa-verisimdb-backup-data:/data"]
21+
environment = { VERISIM_HTTP_HOST = "[::1]", VERISIM_HTTP_PORT = "8080", VERISIM_PERSISTENCE_DIR = "/data" }
22+
restart = "unless-stopped"
23+
healthcheck = { test = "wget --spider http://[::1]:8080/health", interval = "30s", timeout = "5s", retries = 3 }
24+
depends_on = ["gsa-verisimdb"]
25+
1626
[services.gsa-app]
1727
build = { context = "..", containerfile = "Containerfile" }
18-
depends_on = ["gsa-verisimdb"]
19-
environment = { GSA_VERISIMDB_URL = "http://gsa-verisimdb:8090", GSA_PROFILES_DIR = "/app/profiles" }
28+
depends_on = ["gsa-verisimdb", "gsa-verisimdb-backup"]
29+
environment = { GSA_VERISIMDB_URL = "http://gsa-verisimdb:8090", GSA_BACKUP_VERISIMDB_URL = "http://gsa-verisimdb-backup:8091", GSA_PROFILES_DIR = "/app/profiles" }
2030
volumes = ["../profiles:/app/profiles:ro"]
2131
network_mode = "host"
2232

2333
[volumes]
2434
gsa-verisimdb-data = {}
35+
gsa-verisimdb-backup-data = {}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# SPDX-License-Identifier: PMPL-1.0-or-later
2+
# Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath)
3+
#
4+
# Containerfile for the GSA game save backup VeriSimDB instance
5+
# Stores game save metadata, snapshots, and restore points
6+
# Reuses the same VeriSimDB image — only env vars differ
7+
8+
FROM localhost/gsa-verisimdb:latest
9+
10+
# Override for backup instance port
11+
ENV VERISIM_PORT=8091
12+
ENV VERISIM_PERSISTENCE_DIR=/data
13+
ENV RUST_LOG=info
14+
15+
EXPOSE 8091
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# SPDX-License-Identifier: PMPL-1.0-or-later
2+
# Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath)
3+
#
4+
# VeriSimDB backup instance configuration for Game Server Admin
5+
# Stores game save metadata, snapshots, and restore points.
6+
# This is a SEPARATE instance — data lives in gsa-verisimdb-backup-data volume.
7+
8+
@verisimdb-instance(name="gsa-verisimdb-backup", version="0.1.0"):
9+
@network:
10+
http_host = "[::1]"
11+
http_port = 8091
12+
max_request_body = "50MB"
13+
request_timeout_seconds = 60
14+
@end
15+
16+
@storage:
17+
mode = "persistent"
18+
persistence_dir = "/data"
19+
wal_enabled = true
20+
wal_sync_interval_ms = 500
21+
graph_backend = "redb"
22+
document_backend = "tantivy"
23+
@end
24+
25+
@drift:
26+
enabled = true
27+
check_interval_seconds = 60
28+
thresholds:
29+
semantic_vector_drift = 0.5
30+
graph_document_drift = 0.5
31+
temporal_consistency = 0.3
32+
provenance_drift = 0.1
33+
@end
34+
@end
35+
36+
@auth:
37+
mode = "local-only"
38+
public_read = false
39+
require_api_key = false
40+
@end
41+
42+
@labels:
43+
application = "game-server-admin"
44+
domain = "infrastructure/game-saves"
45+
role = "backup"
46+
clade = "ix"
47+
@end
48+
49+
@octad-schema:
50+
# Each game save is an octad:
51+
# Document: save file metadata (game, server, timestamp, size, checksum)
52+
# Semantic: save type tags (auto-save, manual, pre-update, rollback-point)
53+
# Graph: save → server, save → game-profile, save → parent-save
54+
# Temporal: save creation timestamp, TTL, retention policy
55+
# Provenance: who triggered the save, why (pre-config-change, scheduled, manual)
56+
# Spatial: (unused for saves)
57+
# Vector: config embedding for "find similar save states"
58+
# Tensor: server metrics at save time [players, tps, memory, uptime]
59+
@end
60+
@end
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# SPDX-License-Identifier: PMPL-1.0-or-later
2+
# Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath)
3+
#
4+
# Podman Quadlet unit for the GSA game save backup VeriSimDB instance
5+
#
6+
# This instance stores:
7+
# - Game save file metadata (title, timestamps, checksums)
8+
# - Save snapshots as document octads (before/after config changes)
9+
# - Restore point provenance (who backed up, when, why)
10+
# - Drift detection between live config and last known-good save
11+
#
12+
# Install to ~/.config/containers/systemd/ then:
13+
# systemctl --user daemon-reload
14+
# systemctl --user start gsa-verisimdb-backup
15+
#
16+
# Verify:
17+
# curl -sf http://[::1]:8091/health
18+
19+
[Unit]
20+
Description=VeriSimDB backup instance for Game Server Admin game saves (port 8091)
21+
After=gsa-verisimdb.service
22+
Wants=gsa-verisimdb.service
23+
24+
[Container]
25+
Image=localhost/gsa-verisimdb:latest
26+
ContainerName=gsa-verisimdb-backup
27+
AutoUpdate=local
28+
29+
# Backup instance on port 8091 (main instance is 8090)
30+
PublishPort=[::1]:8091:8080
31+
Volume=gsa-verisimdb-backup-data:/data:Z
32+
33+
Environment=VERISIM_HTTP_HOST=[::1]
34+
Environment=VERISIM_HTTP_PORT=8080
35+
Environment=VERISIM_PERSISTENCE_DIR=/data
36+
Environment=VERISIM_FEATURES=persistent
37+
Environment=RUST_LOG=info
38+
39+
# Health check
40+
HealthCmd=wget --no-verbose --tries=1 --spider http://[::1]:8080/health || exit 1
41+
HealthInterval=30s
42+
HealthTimeout=5s
43+
HealthRetries=3
44+
HealthStartPeriod=10s
45+
46+
# Resource limits — backup is lighter than primary
47+
PodmanArgs=--memory=256m --cpus=0.5
48+
49+
ReadOnly=true
50+
Tmpfs=/tmp
51+
52+
Label=dev.stapeln.app=game-server-admin
53+
Label=dev.stapeln.role=verisimdb-backup
54+
Label=dev.stapeln.clade=ix
55+
56+
[Service]
57+
Restart=on-failure
58+
RestartSec=10s
59+
TimeoutStartSec=30s
60+
61+
[Install]
62+
WantedBy=default.target

0 commit comments

Comments
 (0)