- TypeScript 78%
- Python 7.9%
- JavaScript 5.7%
- Lua 4%
- CSS 3.3%
- Other 1.1%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
All checks were successful
Suite tofu / scope (push) Successful in 12s
Suite web-app / scope (push) Successful in 12s
Suite tofu / check-plan (push) Has been skipped
Suite tofu / apply (push) Has been skipped
Suite tofu / reused-checks (push) Has been skipped
Suite web-app / check-image (push) Has been skipped
Suite web-app / publish (push) Has been skipped
Suite web-app / publish-static (push) Has been skipped
Suite web-app / check-test (backend) (push) Has been skipped
Suite web-app / check-test (frontend) (push) Has been skipped
Suite web-app / reused-checks (push) Has been skipped
Suite cluster-service / scope (push) Successful in 13s
Suite cluster-service / check-manifests (push) Has been skipped
Suite cluster-service / check-image (push) Has been skipped
Suite cluster-service / publish (push) Has been skipped
Suite cluster-service / reused-checks (push) Has been skipped
|
||
| .claude/skills/north-star | ||
| backend | ||
| bin | ||
| docs | ||
| frontend | ||
| k8s | ||
| romlab | ||
| tofu | ||
| tools | ||
| .dockerignore | ||
| .gitattributes | ||
| .gitignore | ||
| .nvmrc | ||
| CLAUDE.md | ||
| DELIVERY.md | ||
| DISASSEMBLY.md | ||
| Dockerfile | ||
| README.md | ||
| ROUTINES.md | ||
crenellation
Rampart (Atari, 1990), recreated. Not a lookalike: the arcade ROM, translated to TypeScript, running in a browser at rampart.romaine.life.
There are two translations of the same ROM in this repo, and the difference matters.
frontend/src/rom/dispatch.ts is the recompilation — one function per ROM
routine, each a program counter and a switch over transliterated instructions.
It was checked instruction by instruction against real silicon under MAME:
9,169 of 9,173 cases exact. It runs the game and understands none of it. Today
it is the oracle, and nothing the game runs imports it.
frontend/src/rom/decompiled.ts is the decompilation — recovered source.
Stack arguments became parameters, registers became locals, the control-flow
graph became if and for, and a jsr became a call. Every function in it is
proved against the routine at the same address in the recompilation, on random
machine states, by src/rom/decomp.test.ts.
The game runs on the decompilation. /play boots the machine from its reset
vector through decompiled routines, draws from the playfield the ROM's own code
fills in, and takes live input. /progress shows where the work stands.
That is the point of the exercise: a version of Rampart that can be changed. One rule already has been — walls no longer count the cell above them as connected — by editing the TypeScript, not by patching the ROM.
Where the work stands
- 1,064 decompiled functions: 778 ROM routines plus the entry points a decompiled function needs, since unlike a switch it has only one way in.
- 425 of them are named. The rest are
fn_0ccb2, which is uninformative and honest; a plausible name nobody checked would be neither. romlab/DECOMPILER.mdis the design and the hard-won rules.ROUTINES.mdandDISASSEMBLY.mdcover the recompilation and the overlay map.
Layout
frontend/src/rom/ |
the machine, both translations, the harnesses |
romlab/ |
Python that produced them, and the analysis |
frontend/src/ui/ |
the site around the game |
backend/, k8s/, tofu/ |
serving, deploy, infrastructure |
Binary assets are data, never source: art and music ship from storage, not the repo or the image. The ROM itself is in the repo, deliberately.
Local Dev
Use two fixed local ports with fixed meanings:
http://localhost:3000is the backend/Express preview. It serves the baked Vite build fromfrontend/distand requiresnpm run buildto reflect frontend source changes.http://localhost:5173is the Vite frontend dev server. Use it for UI, Tileset Studio, and art-workbench iteration that needs hot reload.
Do not try to make 3000 do both jobs during an agent session. If the page HTML
contains /assets/index-*.js, it is the baked preview. If it contains
/@vite/client and /src/main.tsx, it is the hot Vite dev server.
For fast frontend iteration:
cd frontend
npm install
npm run dev -- --host localhost --port 5173 --strictPort
Open http://localhost:5173.
For baked preview:
cd frontend
npm install
npm run build
cd backend
npm install
npm start
Open http://localhost:3000.
The browser app is built by Vite. Express serves frontend/dist as the baked
frontend; source files live under frontend/src, and stable public assets live
under frontend/public.
Production Links
- Main menu design portfolio: https://chess.romaine.life/design/main-menu
Agent Preview Contract
Agents and session tooling should start preview through the repo-owned launcher:
bin/agent-preview
The launcher uses $PORT when it is set by the session, otherwise 3000.
It always starts backend/supervisor.js; do not run backend/server.js
directly for preview work. The supervisor is the supported entrypoint because
it owns the hot backend and static override paths used during session edits.
When the session does not provide explicit override directories, the launcher
uses writable paths under ${XDG_RUNTIME_DIR:-/tmp}.
To check whether the expected preview is running:
bin/agent-preview-status
A direct node backend/server.js process, even on the right port, is not the
agent preview contract.
The server uses auth.romaine.life for Microsoft sign-in. Optional env:
AUTH_BASE_URLdefaults tohttps://auth.romaine.life.PUBLIC_ORIGINdefaults to the request host and can pin callback URLs.FRONTEND_DIRdefaults to the builtfrontend/distdirectory.STATIC_FRONTEND_DIRdefaults to/var/run/chess-tactics-static-override.HOT_BACKEND_DIRdefaults to/var/run/chess-tactics-hot.
The container starts backend/supervisor.js as PID 1. The supervisor prepares
the runtime server entrypoint, runs it with NODE_PATH pointed at the baked
dependencies, and reloads the child process when PID 1 receives SIGHUP.
Test-slot validation should deploy the CI-built image for the pushed ref with
Glimmung deploy_image_to_test_slot, so backend code, frontend assets, and
runtime wiring are exercised from the same image that PR CI proved.
Persistence
Durable game/design data (levels, campaigns, campaign workspaces, design
portfolios) lives in Azure Database for PostgreSQL, reached passwordless via
Entra workload identity. Art assets remain committed files under
frontend/public/assets; they are not database records. The database is
self-provisioned by this repo's tofu/. See
docs/persistence.md for the schema, auth model, backups,
failure behavior, and the one post-tofu apply value to pin.
Checks
cd backend
npm test
The backend smoke-test exercises the Postgres-backed endpoints, so it needs a
Postgres. It uses DATABASE_URL if set, otherwise self-provisions a throwaway
local Postgres from system binaries (as on the GitHub-hosted CI runners). Hosts
without Postgres binaries should set DATABASE_URL. The frontend gate runs
without a database:
cd frontend
npm run check # node checks + vitest + tsc
Deploy
The repository lives on Forgejo.
The workflows in .forgejo/workflows/ test the app and plan its infrastructure.
A passing push to main builds or reuses
romainecr.azurecr.io/crenellation:app-<content-fingerprint>, publishes the chart
and image tag to prod, and cuts a source release on Forgejo. ArgoCD reads
prod through the GitHub push mirror. Manual CI runs build and
publish the requested git_ref without changing prod. Infrastructure applies
run for tofu/ changes merged to main, or a manual run from main, when the
plan changes resources. Terraform PRs receive the readable plan as a Forgejo
comment. There is no local publish command.