Spaces:
Paused
T-004: rebrand to SpaceCities
Browse filesRenames the product's user-visible identity β page title, npm package
name, the in-game splash/version banners, the dev-server console
banner, and the README's own title β from "Stellar Frontier: RTS" to
"SpaceCities". version.js/version.json needed no change: both already
matched package.json at 1.1.0.
Deliberately narrow, per ADR-0002: only the displayed product name
moves. In-universe lore references to "Stellar Frontier" β the sibling
turn-based game this RTS shares a universe with β are left exactly as
written, since renaming those would misrepresent the fiction, not the
brand. Historical/dated docs (CHANGELOG.md, docs/code-review-2026-08.md)
and the in-game field manual (docs/player-handbook.html) are left for a
separate pass; nothing in this commit depends on them.
tools/smoke.js's title assertion moves in the same commit as
index.html's <title> β CONTRIBUTING.md's own rule about updating a
test's assertion rather than letting it silently diverge. Verified
against real Chromium: 20/20 smoke checks pass, including the title.
README gains a short pointer to docs/PRD.md, docs/adr/ and TASKS.md so
a reader lands on the multiplayer-port story immediately, without
touching the single-player description below it, which stays accurate
as written (ADR-0004: single-player is unchanged and still fully
offline).
Full suite: 2,519/2,519. typecheck clean. No engine/ file touched β
upstream/main..HEAD stays a diff of exactly this rebrand.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PzkfXsTz4hxPfuySb1GvyS
- CONTRIBUTING.md +1 -1
- README.md +12 -1
- TASKS.md +3 -3
- index.html +1 -1
- package.json +2 -2
- setup.js +1 -1
- style.css +1 -1
- tools/serve.js +1 -1
- tools/smoke.js +1 -1
- update.js +1 -1
|
@@ -1,6 +1,6 @@
|
|
| 1 |
# Contributing
|
| 2 |
|
| 3 |
-
|
| 4 |
runtime dependencies**. The files in the repo are exactly what the browser loads. That simplicity
|
| 5 |
is a feature β please keep it. A few rules are load-bearing; the test suite enforces them, so a
|
| 6 |
change that breaks one fails `npm test` rather than shipping.
|
|
|
|
| 1 |
# Contributing
|
| 2 |
|
| 3 |
+
SpaceCities is a vanilla-JavaScript, ES-module game with **no build step** and **no
|
| 4 |
runtime dependencies**. The files in the repo are exactly what the browser loads. That simplicity
|
| 5 |
is a feature β please keep it. A few rules are load-bearing; the test suite enforces them, so a
|
| 6 |
change that breaks one fails `npm test` rather than shipping.
|
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
#
|
| 2 |
|
| 3 |
A browser-based real-time strategy game set in the same universe as
|
| 4 |
[Stellar Frontier](https://github.com/alma92350/SpaceExploration) (the turn-based space
|
|
@@ -7,6 +7,17 @@ Vanilla JavaScript, ES modules, **no build step, no dependencies**. Play a 1v1 s
|
|
| 7 |
scripted AI, or an open-ended **Odyssey** that strings worlds together into a galaxy you settle,
|
| 8 |
trade across, and conquer.
|
| 9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
## Running it
|
| 11 |
|
| 12 |
The game has no build step, but it loads as ES modules, which browsers refuse to import over
|
|
|
|
| 1 |
+
# SpaceCities
|
| 2 |
|
| 3 |
A browser-based real-time strategy game set in the same universe as
|
| 4 |
[Stellar Frontier](https://github.com/alma92350/SpaceExploration) (the turn-based space
|
|
|
|
| 7 |
scripted AI, or an open-ended **Odyssey** that strings worlds together into a galaxy you settle,
|
| 8 |
trade across, and conquer.
|
| 9 |
|
| 10 |
+
This repository is a port of [Stellar Frontier: RTS](https://github.com/alma92350/SpaceExploration-RTS)
|
| 11 |
+
into a **multiplayer** RTS deployed at
|
| 12 |
+
[huggingface.co/spaces/Almaatla/SpaceCities](https://huggingface.co/spaces/Almaatla/SpaceCities),
|
| 13 |
+
adding networked matches and an MCP server so AI agents can play as ordinary seats alongside
|
| 14 |
+
humans. Everything below documents the game **as it plays today** β the single-player skirmish and
|
| 15 |
+
Odyssey described in this README are unchanged and still run entirely offline (see
|
| 16 |
+
[Architecture Decision Record 0004](docs/adr/0004-loopback-transport.md)). The multiplayer and
|
| 17 |
+
agent-play work is tracked in [`docs/PRD.md`](docs/PRD.md) (what and why),
|
| 18 |
+
[`docs/adr/`](docs/adr/) (the architecture decisions and their evolution), and
|
| 19 |
+
[`TASKS.md`](TASKS.md) (where the port is and what's left).
|
| 20 |
+
|
| 21 |
## Running it
|
| 22 |
|
| 23 |
The game has no build step, but it loads as ES modules, which browsers refuse to import over
|
|
@@ -12,7 +12,7 @@ Update this file in the same commit as the work it describes.
|
|
| 12 |
|
| 13 |
| Phase | Milestone | Tasks | Done | Status |
|
| 14 |
|---|---|---:|---:|---|
|
| 15 |
-
| **0** | Single-player game live on HF, deploying automatically | 10 |
|
| 16 |
| **1** | Single-player runs through the multiplayer code path | 7 | 0 | βͺ Not started |
|
| 17 |
| **2** | Commands are data; a match replays bit-identically | 12 | 0 | βͺ Not started |
|
| 18 |
| **3** | Two humans play a full match over the network | 10 | 0 | βͺ Not started |
|
|
@@ -20,7 +20,7 @@ Update this file in the same commit as the work it describes.
|
|
| 20 |
| **5** | 4-seat free-for-all with AI fill | 8 | 0 | βͺ Not started |
|
| 21 |
| **6** | An agent plays a human to a finish over MCP | 11 | 0 | βͺ Not started |
|
| 22 |
| **7** | Hardened, measured, launched | 7 | 0 | βͺ Not started |
|
| 23 |
-
| | | **72** | **
|
| 24 |
|
| 25 |
**Legend:** β
done Β· π‘ in progress Β· βͺ not started Β· π΄ blocked Β· βΈοΈ deferred
|
| 26 |
|
|
@@ -81,7 +81,7 @@ ships, the pipeline is already boring.
|
|
| 81 |
| **T-001** | Import upstream verbatim with full history; `upstream` remote configured | ADR-0002 | β | β
| 542 commits present; `npm test` green (2,519 tests); `git blame` reaches upstream authorship |
|
| 82 |
| **T-002** | PRD, ADR log, feasibility spikes | G4 | β | β
| `docs/PRD.md`, `docs/adr/0001β¦0011`, `docs/analysis/00` committed |
|
| 83 |
| **T-003** | Analysis dossiers: engine seams, command protocol, client coupling, HF platform, MCP | G4 | β | π‘ | Five dossiers in `docs/analysis/`; each ADR they ground cites them |
|
| 84 |
-
| **T-004** | Rebrand to SpaceCities β `package.json`, `README.md`, `
|
| 85 |
| **T-005** | CI on this repo: inherited suite (Node 20 + 22), typecheck, browser smoke | NFR-7 | T-001 | π‘ | Inherited `test.yml` has run **5Γ, all green** on this branch. Remaining: confirm all three job names, and document branch protection |
|
| 86 |
| **T-006** | `Dockerfile` for Node 22 on HF: port 7860, `/data` mount point, **no npm install**. β οΈ Do **not** copy the HF Python recipe's `RUN useradd -m -u 1000 user` β `node:*` images already ship a UID-1000 `node` user and the command fails with "UID 1000 is not unique" | G5, NFR-5 | T-004 | βͺ | Image builds; container serves the game locally on 7860 as UID 1000 |
|
| 87 |
| **T-007a** | Push a trivial commit to the Space and watch it rebuild β proving a **non-PRO account can still rebuild an existing Docker Space** | ADR-0010 B2 | β | β
| **PASS** ([run 33337999794](https://github.com/alma92350/SpaceCities/actions/runs/33337999794)). `RUNNING_BUILDING β RUNNING_APP_STARTING β RUNNING` in **41 s**; Space HEAD advanced to the pushed commit `894b2c6`; app returned 200 anonymously. **PRO is not a prerequisite.** |
|
|
|
|
| 12 |
|
| 13 |
| Phase | Milestone | Tasks | Done | Status |
|
| 14 |
|---|---|---:|---:|---|
|
| 15 |
+
| **0** | Single-player game live on HF, deploying automatically | 10 | 5 | π‘ In progress |
|
| 16 |
| **1** | Single-player runs through the multiplayer code path | 7 | 0 | βͺ Not started |
|
| 17 |
| **2** | Commands are data; a match replays bit-identically | 12 | 0 | βͺ Not started |
|
| 18 |
| **3** | Two humans play a full match over the network | 10 | 0 | βͺ Not started |
|
|
|
|
| 20 |
| **5** | 4-seat free-for-all with AI fill | 8 | 0 | βͺ Not started |
|
| 21 |
| **6** | An agent plays a human to a finish over MCP | 11 | 0 | βͺ Not started |
|
| 22 |
| **7** | Hardened, measured, launched | 7 | 0 | βͺ Not started |
|
| 23 |
+
| | | **72** | **5** | |
|
| 24 |
|
| 25 |
**Legend:** β
done Β· π‘ in progress Β· βͺ not started Β· π΄ blocked Β· βΈοΈ deferred
|
| 26 |
|
|
|
|
| 81 |
| **T-001** | Import upstream verbatim with full history; `upstream` remote configured | ADR-0002 | β | β
| 542 commits present; `npm test` green (2,519 tests); `git blame` reaches upstream authorship |
|
| 82 |
| **T-002** | PRD, ADR log, feasibility spikes | G4 | β | β
| `docs/PRD.md`, `docs/adr/0001β¦0011`, `docs/analysis/00` committed |
|
| 83 |
| **T-003** | Analysis dossiers: engine seams, command protocol, client coupling, HF platform, MCP | G4 | β | π‘ | Five dossiers in `docs/analysis/`; each ADR they ground cites them |
|
| 84 |
+
| **T-004** | Rebrand to SpaceCities β `package.json`, `README.md`, page title, and the in-game/dev-tooling name banners (`setup.js`, `update.js`, `tools/serve.js`) β **without touching engine internals**. `version.js`/`version.json` needed no change (already in sync at 1.1.0) | G5 | T-001 | β
| Suite green incl. `test/release-manifest.test.js` (22/22), `test/version.test.js`; full suite **2,519/2,519**; typecheck clean; browser smoke **20/20** (title assertion updated in lockstep in `tools/smoke.js`); `upstream/main..HEAD` diff stays semantically clean β no `engine/` file touched. In-universe lore references to "Stellar Frontier" (the sibling turn-based game) deliberately kept |
|
| 85 |
| **T-005** | CI on this repo: inherited suite (Node 20 + 22), typecheck, browser smoke | NFR-7 | T-001 | π‘ | Inherited `test.yml` has run **5Γ, all green** on this branch. Remaining: confirm all three job names, and document branch protection |
|
| 86 |
| **T-006** | `Dockerfile` for Node 22 on HF: port 7860, `/data` mount point, **no npm install**. β οΈ Do **not** copy the HF Python recipe's `RUN useradd -m -u 1000 user` β `node:*` images already ship a UID-1000 `node` user and the command fails with "UID 1000 is not unique" | G5, NFR-5 | T-004 | βͺ | Image builds; container serves the game locally on 7860 as UID 1000 |
|
| 87 |
| **T-007a** | Push a trivial commit to the Space and watch it rebuild β proving a **non-PRO account can still rebuild an existing Docker Space** | ADR-0010 B2 | β | β
| **PASS** ([run 33337999794](https://github.com/alma92350/SpaceCities/actions/runs/33337999794)). `RUNNING_BUILDING β RUNNING_APP_STARTING β RUNNING` in **41 s**; Space HEAD advanced to the pushed commit `894b2c6`; app returned 200 anonymously. **PRO is not a prerequisite.** |
|
|
@@ -3,7 +3,7 @@
|
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8" />
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
| 6 |
-
<title>
|
| 7 |
<!-- Inline SVG data URI, not a file: every browser requests /favicon.ico unprompted, and with
|
| 8 |
nothing declared here that is a guaranteed 404 on every single page load. Harmless, but it
|
| 9 |
puts a permanent error in the console, which makes "the console is clean" useless as a signal
|
|
|
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8" />
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
| 6 |
+
<title>SpaceCities</title>
|
| 7 |
<!-- Inline SVG data URI, not a file: every browser requests /favicon.ico unprompted, and with
|
| 8 |
nothing declared here that is a guaranteed 404 on every single page load. Harmless, but it
|
| 9 |
puts a permanent error in the console, which makes "the console is clean" useless as a signal
|
|
@@ -1,9 +1,9 @@
|
|
| 1 |
{
|
| 2 |
-
"name": "
|
| 3 |
"version": "1.1.0",
|
| 4 |
"private": true,
|
| 5 |
"type": "module",
|
| 6 |
-
"description": "
|
| 7 |
"scripts": {
|
| 8 |
"start": "node tools/serve.js",
|
| 9 |
"test": "node --test test/*.test.js",
|
|
|
|
| 1 |
{
|
| 2 |
+
"name": "spacecities",
|
| 3 |
"version": "1.1.0",
|
| 4 |
"private": true,
|
| 5 |
"type": "module",
|
| 6 |
+
"description": "Multiplayer real-time strategy game in the Stellar Frontier universe, with an MCP interface for AI agent players. No dependencies, no build step.",
|
| 7 |
"scripts": {
|
| 8 |
"start": "node tools/serve.js",
|
| 9 |
"test": "node --test test/*.test.js",
|
|
@@ -321,7 +321,7 @@ export function renderMapSelect() {
|
|
| 321 |
|
| 322 |
const ver = document.createElement("p");
|
| 323 |
ver.className = "setup-version";
|
| 324 |
-
ver.textContent = `
|
| 325 |
mapSelectEl.appendChild(ver);
|
| 326 |
|
| 327 |
// Mode toggle: skirmish, the open-world Odyssey, or a scripted scenario.
|
|
|
|
| 321 |
|
| 322 |
const ver = document.createElement("p");
|
| 323 |
ver.className = "setup-version";
|
| 324 |
+
ver.textContent = `SpaceCities v${APP_VERSION}`;
|
| 325 |
mapSelectEl.appendChild(ver);
|
| 326 |
|
| 327 |
// Mode toggle: skirmish, the open-world Odyssey, or a scripted scenario.
|
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
/* =====
|
| 2 |
Palette carried over from the original Stellar Frontier's style.css so
|
| 3 |
the two games read as the same universe. Everything below the :root
|
| 4 |
block is new β the original's layout was built for a turn-based tab/panel
|
|
|
|
| 1 |
+
/* ===== SpaceCities β styles =====
|
| 2 |
Palette carried over from the original Stellar Frontier's style.css so
|
| 3 |
the two games read as the same universe. Everything below the :root
|
| 4 |
block is new β the original's layout was built for a turn-based tab/panel
|
|
@@ -76,7 +76,7 @@ const server = createServer(async (req, res) => {
|
|
| 76 |
// it's imported β e.g. by a test β for `resolveSafePath`.
|
| 77 |
if (process.argv[1] && fileURLToPath(import.meta.url) === process.argv[1]) {
|
| 78 |
server.listen(PORT, () => {
|
| 79 |
-
console.log(`
|
| 80 |
console.log(` open http://localhost:${PORT}/`);
|
| 81 |
console.log(" stop Ctrl+C");
|
| 82 |
});
|
|
|
|
| 76 |
// it's imported β e.g. by a test β for `resolveSafePath`.
|
| 77 |
if (process.argv[1] && fileURLToPath(import.meta.url) === process.argv[1]) {
|
| 78 |
server.listen(PORT, () => {
|
| 79 |
+
console.log(`SpaceCities β serving ${ROOT}`);
|
| 80 |
console.log(` open http://localhost:${PORT}/`);
|
| 81 |
console.log(" stop Ctrl+C");
|
| 82 |
});
|
|
@@ -129,7 +129,7 @@ async function main() {
|
|
| 129 |
await page.goto(URL_, { waitUntil: "networkidle" });
|
| 130 |
await page.waitForTimeout(800);
|
| 131 |
|
| 132 |
-
check("the page loads and titles itself", (await page.title()) === "
|
| 133 |
check("main.js's module graph actually executed",
|
| 134 |
(await page.evaluate(() => performance.getEntriesByType("resource").filter(r => r.name.endsWith(".js")).length)) > 50);
|
| 135 |
check("the setup screen offers a game mode", await page.isVisible("text=β Skirmish"));
|
|
|
|
| 129 |
await page.goto(URL_, { waitUntil: "networkidle" });
|
| 130 |
await page.waitForTimeout(800);
|
| 131 |
|
| 132 |
+
check("the page loads and titles itself", (await page.title()) === "SpaceCities");
|
| 133 |
check("main.js's module graph actually executed",
|
| 134 |
(await page.evaluate(() => performance.getEntriesByType("resource").filter(r => r.name.endsWith(".js")).length)) > 50);
|
| 135 |
check("the setup screen offers a game mode", await page.isVisible("text=β Skirmish"));
|
|
@@ -26,7 +26,7 @@ const writeDismissed = v => { try { localStorage.setItem(DISMISS_KEY, v); } catc
|
|
| 26 |
// Show the running version in the topbar chip.
|
| 27 |
function showVersionChip() {
|
| 28 |
const el = document.getElementById("appVersion");
|
| 29 |
-
if (el) { el.textContent = "v" + APP_VERSION; el.title = `
|
| 30 |
}
|
| 31 |
|
| 32 |
// Fetch the deployed manifest and, if it's a newer release than this build, raise the banner.
|
|
|
|
| 26 |
// Show the running version in the topbar chip.
|
| 27 |
function showVersionChip() {
|
| 28 |
const el = document.getElementById("appVersion");
|
| 29 |
+
if (el) { el.textContent = "v" + APP_VERSION; el.title = `SpaceCities v${APP_VERSION}`; }
|
| 30 |
}
|
| 31 |
|
| 32 |
// Fetch the deployed manifest and, if it's a newer release than this build, raise the banner.
|