Document Acquire publishing and agent workflow
This commit is contained in:
parent
2c7b26a927
commit
124936d460
5 changed files with 283 additions and 158 deletions
89
AGENTS.md
Normal file
89
AGENTS.md
Normal file
|
|
@ -0,0 +1,89 @@
|
|||
# Acquire — agent instructions
|
||||
|
||||
## Repository and live status
|
||||
|
||||
- This is **Acquire**, in `boardgamers/mergers-game`; the BGS game id is `acquire`, version **1**.
|
||||
- **The BGS game is public**, verified 27 October 2026. Preserve the live visibility and
|
||||
unrelated metadata on updates. Fetch fresh metadata before publishing; this file is not a
|
||||
substitute for checking the live configuration.
|
||||
- `docs/admin/gameinfo.json` is a bootstrap template. Its `public: false` and blank artifact
|
||||
URLs are intentional for initial registration. Never PUT that whole file over the live game.
|
||||
- `packages/engine/` contains deterministic rules and the BGS adapter (`wrapper.ts`).
|
||||
`packages/viewer/` contains the Svelte UI, local harness, translations and tutorials.
|
||||
- `rules.md` is the engine rules reference. `docs/admin/rules.md` is the reader-facing CMS copy.
|
||||
[docs/registering.md](docs/registering.md) is the detailed publishing procedure;
|
||||
[docs/admin/release-check.md](docs/admin/release-check.md) records validation and remaining gaps.
|
||||
|
||||
## Development and checks
|
||||
|
||||
Use Node 24 and pnpm 11. Inspect the working tree before editing and preserve unrelated work.
|
||||
|
||||
- `pnpm install` installs dependencies when needed.
|
||||
- `pnpm check` checks formatting, lint, TypeScript/Svelte, tests, and builds both packages.
|
||||
It does **not** fix formatting; use `pnpm fmt` or format only the edited files first.
|
||||
- For UI or interaction changes, also run `pnpm test:browser`. It builds and exercises the
|
||||
shipped IIFE/CSS, including mobile, both themes, translations and tutorials. Inspect the
|
||||
relevant screenshots in ignored `release/qa/` rather than relying only on assertions.
|
||||
- Do not rebuild or pack while browser checks are running: engine rebuilds can trigger Vite
|
||||
reloads during the checks. Pack the engine afterward.
|
||||
- Documentation-only changes need formatting, link/command checks and `git diff --check`;
|
||||
they do not require a game rebuild, package-version bump or BGS artifact deployment.
|
||||
- Local play: `pnpm build && pnpm dev`. Use `?bundle=1` to inspect the built viewer.
|
||||
Useful parameters include `players=4`, `publicHoldings=1`, `stockSwap=3`, `locale=fr`,
|
||||
`theme=dark`, and `tutorial=founding|mergers|scoring`.
|
||||
|
||||
## Behavior to preserve
|
||||
|
||||
- Saved games and replay logs must remain compatible. New options default to existing
|
||||
behavior; changes to normalized init options can break exact historical replay comparisons.
|
||||
- Keep opponents' private cash, shares, hands and future draws out of public views, scores
|
||||
and inferred UI behavior. Public net worth is an estimate; two-player bank bonuses are
|
||||
unknown until payout and are excluded from forecasts.
|
||||
- Undo uses private turn drafts: `type: "turn"`, `from`, `moves`. Reversible previews return
|
||||
`toSave: undefined`; only the acting player receives the stripped preview. Revisions must
|
||||
not append saved history or award time. Commit boundaries include another player's
|
||||
decision, hidden information being revealed, draws and game end. Keep atomic moves working
|
||||
for older viewers, tutorials and analysis.
|
||||
- Preserve two-player bank mode, four hands, team play and dropped-player behavior when changing rules.
|
||||
- Put new UI/log/tutorial text in all 17 catalogs under `packages/viewer/src/lib/locales/`.
|
||||
Keep chain names and tile coordinates unchanged. CMS text and setup labels have separate
|
||||
translations; do not claim they are translated merely because viewer catalogs are complete.
|
||||
- Honor BGS theme, sound, chat, replay and supporter player colors. Chain letters already
|
||||
identify chains independently of color. Ongoing hidden-information analysis is not enabled.
|
||||
- Stock swaps are an optional house rule: Off / 3 / 5 / 7 / Unlimited. The per-turn limit is
|
||||
shared across exchanges, separate from the three-share purchase allowance; prices apply
|
||||
after all merger resolution. Keep the default Off.
|
||||
|
||||
## Publishing
|
||||
|
||||
A Git push does not publish to BGS. Follow the user's delivery scope, including any request
|
||||
for local review before publication. For an authorized release:
|
||||
|
||||
1. Bump the package version for each changed artifact, update the release notes, and run the
|
||||
applicable checks above. Commit/push the intended changes. No npm registry publication is needed.
|
||||
2. Read and save the current `GET https://admin.boardgamers.space/api/admin/gameinfo/acquire/1`.
|
||||
Authenticate with an **admin token issued by BGS**, granted access to Acquire. The local
|
||||
token file is normally `~/.bgs`; never print, commit or embed the token in docs.
|
||||
Keep deployment records and tarballs in an ignored directory such as `release/publish/`.
|
||||
3. For an engine change, run `pnpm --filter acquire-engine pack --pack-destination <release-dir>`.
|
||||
POST the raw tarball to `/api/admin/gameinfo/acquire/1/engine` with bearer authentication
|
||||
and `Content-Type: application/octet-stream`. Keep `engine.entryPoint` as `dist/wrapper.js`.
|
||||
Upload the engine before the viewer when they change together.
|
||||
4. For a viewer change, use the platform repository's `scripts/publish-viewer.mjs` (normally
|
||||
`../boardgamers-mono/scripts/publish-viewer.mjs`), with `--game acquire --version 1`, the
|
||||
built viewer directory, entry `acquire-viewer.iife.js`, style `acquire-viewer.css`, token
|
||||
file and a fresh record file. `--apply --activate` uploads and activates. It verifies hosted
|
||||
bytes, checks for concurrent viewer changes, and preserves other viewer settings. Exact
|
||||
commands are in [docs/registering.md](docs/registering.md).
|
||||
5. Update options, preferences, tutorials or CMS content only when the change requires it.
|
||||
Merge targeted changes into freshly fetched values; preserve other fields. The rules page
|
||||
is `/api/admin/page/acquire:rules/en`. Sound and stock-swap declarations already exist.
|
||||
6. Verify hosted artifacts and the final metadata. Engine installation is asynchronous,
|
||||
normally around a minute; a successful upload alone does not prove server activation.
|
||||
Check live behavior when practical without making moves in someone else's ongoing game.
|
||||
Keep BGS version integer **1** for compatible updates so ongoing games receive fixes.
|
||||
Treat changing that integer as a deliberate migration, not a routine package-version bump.
|
||||
|
||||
Report the commit, checks and actual deployment result accurately. Keep `AGENTS.md`, the
|
||||
publishing guide and relevant admin docs updated when the workflow or live status changes;
|
||||
avoid copying version numbers and option lists into multiple instructions.
|
||||
|
|
@ -4,6 +4,7 @@ An unofficial implementation of Sid Sackson's Acquire for [boardgamers.space](ht
|
|||
for 2 to 6 players. Not affiliated with or endorsed by Hasbro, Avalon Hill, Renegade Game
|
||||
Studios or any other publisher of Acquire.
|
||||
|
||||
- [AGENTS.md](AGENTS.md): agent instructions, current BGS status and publishing workflow.
|
||||
- `packages/engine`: the rules engine. `wrapper.ts` implements the BGS Engine API.
|
||||
- `packages/viewer`: the Svelte viewer, built as one IIFE bundle for the BGS iframe.
|
||||
- `rules.md`: the rules the engine follows. Tests cite its section numbers.
|
||||
|
|
@ -19,7 +20,7 @@ pnpm install
|
|||
pnpm check
|
||||
```
|
||||
|
||||
`pnpm check` formats, lints, type-checks, runs the tests and builds both packages. To run it
|
||||
`pnpm check` checks formatting, lints, type-checks, runs the tests and builds both packages. To run it
|
||||
before every commit, enable the hook with `git config core.hooksPath .githooks`.
|
||||
|
||||
## Playing locally
|
||||
|
|
@ -35,7 +36,7 @@ play every seat. The toolbar plays random moves, jumps to the next merger, and s
|
|||
player, theme and language.
|
||||
|
||||
URL parameters: `players=2..6`, `seed=...`, `publicHoldings=1`, `teamPlay=1`, `autoEnd=1`,
|
||||
`endSize=31`, `twoPlayerMode=fourHands`, `theme=light|dark`, `locale=de`, `moves=50` (random
|
||||
`endSize=31`, `twoPlayerMode=fourHands`, `stockSwap=3` (or `5`, `7`, `unlimited`), `theme=light|dark`, `locale=de`, `moves=50` (random
|
||||
moves on load), `merger=1` (continue to the next merger).
|
||||
|
||||
## What ships
|
||||
|
|
|
|||
|
|
@ -42,9 +42,16 @@ pixels wide and include the complete decision, board and hand. Do not use full-p
|
|||
screenshots: the supporting tables and expanded history make an unreadably tall gallery image.
|
||||
The browser checks enforce maximum capture heights and verify the desktop panel arrangement.
|
||||
|
||||
## Private beta configuration
|
||||
## Live configuration and updates
|
||||
|
||||
`gameinfo.json` records the initial private registration, including all three tutorial
|
||||
chapters. The engine and viewer URLs are supplied by the upload tools. Keep `public` false.
|
||||
Acquire is **public** on BGS as `acquire`, version `1` (verified 27 October 2026).
|
||||
Preserve its current visibility when updating.
|
||||
|
||||
See [release-check.md](release-check.md) for validation and remaining public-release gaps.
|
||||
`gameinfo.json` is the initial-registration template and the source for individual option,
|
||||
preference and tutorial declarations. Its `public: false` and empty engine/viewer URLs are
|
||||
intentional bootstrap defaults, not instructions for the live game. Never upload the whole
|
||||
file over the current configuration. Fetch live metadata and merge only the intended changes.
|
||||
|
||||
Follow [the publishing guide](../registering.md) for engine and viewer uploads, CMS updates,
|
||||
verification and deployment records. See [release-check.md](release-check.md) for validation
|
||||
and remaining work, and [AGENTS.md](../../AGENTS.md) for agent instructions.
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ Source: <https://github.com/boardgamers/mergers-game>. The live game is now publ
|
|||
checked 12 historical move boundaries across 2/4/6 players and four hands, playing
|
||||
up to 20 hypothetical moves at each without changing the source.
|
||||
|
||||
## Still required before a public release
|
||||
## Remaining work after public release
|
||||
|
||||
- Translate the English CMS rules, description, credits and BGS setup/preference
|
||||
labels, including the tutorial launcher cards. The in-game UI, journal and
|
||||
|
|
@ -126,7 +126,7 @@ Source: <https://github.com/boardgamers/mergers-game>. The live game is now publ
|
|||
custom `createAnalysis` / `analysisMove` hooks.
|
||||
- Implement hidden-information scenarios before enabling ongoing-game analysis.
|
||||
Opponent hands and future draws must be simulated, never copied from the live game.
|
||||
- Human playtesting of the private beta, including two-player bank mode, four
|
||||
- Continued human playtesting, including two-player bank mode, four
|
||||
hands, team play, long games and translation quality. Automated coverage is not
|
||||
a claim of a complete human rules review.
|
||||
|
||||
|
|
@ -140,5 +140,5 @@ Source: <https://github.com/boardgamers/mergers-game>. The live game is now publ
|
|||
- Upload the original transparent `pictogram.svg`, English rules as the CMS page
|
||||
`acquire:rules`, and `gameinfo.json` for the initial version/configuration.
|
||||
- Tags: `economic`, `tile-placement` and `stock-holding`.
|
||||
- Intended beta accounts: not2cool, Spock and AlphaZero. GitHub collaborator:
|
||||
- Initial beta accounts: not2cool, Spock and AlphaZero. GitHub collaborator:
|
||||
MikeIsom, write permission (requires accepting GitHub's invitation).
|
||||
|
|
|
|||
|
|
@ -1,172 +1,200 @@
|
|||
# Registering Acquire on boardgamers.space
|
||||
# Publishing Acquire on boardgamers.space
|
||||
|
||||
How to publish the engine and viewer to BGS, following the BGS guide
|
||||
(<https://docs.boardgamers.space/guide/adding-a-game.md>). You need BGS admin access, or an
|
||||
admin token with the `gameinfo` grant for the command-line route.
|
||||
Acquire is already registered as game **`acquire`**, BGS version **`1`**, and is **public**
|
||||
(verified 27 October 2026). Routine updates must preserve that visibility and the existing
|
||||
configuration. Start with [AGENTS.md](../AGENTS.md) for repository checks and compatibility
|
||||
requirements, and [admin/release-check.md](admin/release-check.md) for the latest release record.
|
||||
|
||||
Save the game private first (`public: false`) and play-test it there.
|
||||
The bootstrap file [admin/gameinfo.json](admin/gameinfo.json) intentionally has
|
||||
`public: false` and blank artifact URLs. Use it as a source for individual declarations or
|
||||
initial registration only; never upload it wholesale over the live game.
|
||||
|
||||
## 1. Build the two artifacts
|
||||
## 1. Prepare the release
|
||||
|
||||
Each GitHub Release has both attached. To build them yourself:
|
||||
Use Node 24 and pnpm 11. Bump the version in the engine and/or viewer `package.json` for the
|
||||
artifacts being changed. Keep the BGS version integer at **1** for compatible updates to
|
||||
ongoing games. Changing it is a migration affecting which games use the new code.
|
||||
|
||||
From this repository's root:
|
||||
|
||||
```bash
|
||||
pnpm install
|
||||
pnpm check
|
||||
cd packages/engine && pnpm pack
|
||||
# Also required for UI/interaction changes; includes a fresh production build.
|
||||
pnpm test:browser
|
||||
```
|
||||
|
||||
| Artifact | File(s) | BGS field |
|
||||
| -------- | ---------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
|
||||
| Engine | `packages/engine/acquire-engine-<version>.tgz` (contains `dist/` and `package.json` only) | `engine.package` (set by the upload), `engine.entryPoint: "dist/wrapper.js"` |
|
||||
| Viewer | `packages/viewer/dist/acquire-viewer.iife.js`, `acquire-viewer.css`, optional `acquire-viewer.iife.js.map` | `viewer.url`, `viewer.dependencies.stylesheets`, `viewer.topLevelVariable: "acquire"` |
|
||||
Inspect the relevant screenshots in `release/qa/`. Finish browser checks before packing
|
||||
or rebuilding again; a rebuild during a browser run can cause Vite to reload its modules.
|
||||
Documentation-only changes require formatting and link/command checks, not artifact publishing.
|
||||
|
||||
`pnpm check` rebuilds `packages/viewer/dist` from scratch, so upload that folder straight
|
||||
after it. The engine's only runtime dependency is `seedrandom`, which BGS installs.
|
||||
|
||||
## 2. Register the game (admin panel)
|
||||
|
||||
In Boardgames, choose + New game and fill in:
|
||||
|
||||
- **Game id:** `acquire`; **version:** `1`.
|
||||
- **Label:** `Acquire`.
|
||||
- **Players:** `[2, 3, 4, 5, 6]`. Player counts are not a game option.
|
||||
- **Options:** paste the declarations below.
|
||||
- **Preferences:** none (`[]`). Chain letters and player names identify everything without relying on color.
|
||||
- **Settings:** none.
|
||||
- **Public:** off.
|
||||
|
||||
Save.
|
||||
|
||||
### Game options
|
||||
|
||||
These match rules.md §15 and the engine's option reader. Unticked checkboxes are not sent,
|
||||
and selects are always sent as strings; the engine handles both, never rejects an option, and
|
||||
logs any option that does not apply to the player count.
|
||||
|
||||
```json
|
||||
[
|
||||
{
|
||||
"name": "publicHoldings",
|
||||
"label": "Public holdings (everyone sees all stock and cash)",
|
||||
"type": "checkbox",
|
||||
"default": false
|
||||
},
|
||||
{ "name": "teamPlay", "label": "Team play (4 players: seats 1+3 against 2+4)", "type": "checkbox", "default": false },
|
||||
{
|
||||
"name": "twoPlayerMode",
|
||||
"label": "Two-player mode",
|
||||
"type": "select",
|
||||
"default": "bank",
|
||||
"items": [
|
||||
{ "name": "bank", "label": "Bank as third shareholder" },
|
||||
{ "name": "fourHands", "label": "Four hands (each player controls two seats)" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "autoEnd",
|
||||
"label": "End automatically when an end condition is met",
|
||||
"type": "checkbox",
|
||||
"default": false
|
||||
},
|
||||
{
|
||||
"name": "endSize",
|
||||
"label": "Chain size that ends the game",
|
||||
"type": "select",
|
||||
"default": "41",
|
||||
"items": [
|
||||
{ "name": "41", "label": "41 tiles (standard)" },
|
||||
{ "name": "31", "label": "31 tiles (shorter game)" }
|
||||
]
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
## 3. Upload the engine
|
||||
|
||||
In the version form, choose Upload .tgz… and pick `acquire-engine-<version>.tgz`. BGS reads the
|
||||
package name and version from the tarball and sets `engine.package` itself. Then set
|
||||
**entry point** to `dist/wrapper.js` and save.
|
||||
|
||||
BGS installs the engine within about a minute. `meta.replay` is set because the engine
|
||||
exports `replay`; `meta.bots` stays off, as there is no bot.
|
||||
|
||||
## 4. Upload the viewer
|
||||
|
||||
Choose Upload bundle… and select `acquire-viewer.iife.js`, `acquire-viewer.css` and, if you want
|
||||
source maps in devtools, `acquire-viewer.iife.js.map`, together. Then set:
|
||||
|
||||
- Top-level variable: `acquire` (the global `registerViewer` creates).
|
||||
- Chat: on, with in-game controls always accessible (`integratedControls: ["chat"]`). The
|
||||
chat panel sits beside the log and is hidden in analysis mode.
|
||||
- Replayable: on.
|
||||
- Full screen on mobile: off. The layout is width-based and works at content height.
|
||||
- Tutorials: copy `tutorial` from `docs/admin/gameinfo.json` (founding, mergers and scoring).
|
||||
All three are interactive and translated into the 17 viewer locales: 5 founding steps,
|
||||
7 merger steps and 3 scoring steps.
|
||||
|
||||
Save, open the game page, create a private game, and play.
|
||||
|
||||
## Command-line alternative
|
||||
|
||||
The same steps against the admin API, with a token from a platform admin (never commit it):
|
||||
Commit and push the intended changes. A Git push or GitHub Release alone does not update BGS.
|
||||
Create a fresh ignored record directory for this deployment:
|
||||
|
||||
```bash
|
||||
AUTH="Authorization: Bearer $BGS_ADMIN_TOKEN"
|
||||
BASE=https://admin.boardgamers.space/api/admin/gameinfo/acquire
|
||||
|
||||
# Engine: the raw npm-pack tarball; this sets engine.package on version 1.
|
||||
curl -X POST "$BASE/1/engine" -H "$AUTH" -H "Content-Type: application/octet-stream" \
|
||||
--data-binary @packages/engine/acquire-engine-0.0.2.tgz
|
||||
|
||||
# Viewer files: one POST each with a shared bundle id; each returns the hosted URL.
|
||||
BUNDLE=acquire-$(git rev-parse --short HEAD)
|
||||
JS_URL=$(curl -X POST "$BASE/1/viewer/file?filename=acquire-viewer.iife.js&bundle=$BUNDLE" -H "$AUTH" \
|
||||
-H "Content-Type: application/octet-stream" --data-binary @packages/viewer/dist/acquire-viewer.iife.js | jq -r .url)
|
||||
CSS_URL=$(curl -X POST "$BASE/1/viewer/file?filename=acquire-viewer.css&bundle=$BUNDLE" -H "$AUTH" \
|
||||
-H "Content-Type: application/octet-stream" --data-binary @packages/viewer/dist/acquire-viewer.css | jq -r .url)
|
||||
|
||||
# Save the URLs, entry point and global name into the version doc.
|
||||
curl "$BASE/1" -H "$AUTH" |
|
||||
jq --arg js "$JS_URL" --arg css "$CSS_URL" \
|
||||
'.viewer.url = $js | .viewer.dependencies.stylesheets = [$css] | .viewer.topLevelVariable = "acquire" | .engine.entryPoint = "dist/wrapper.js"' |
|
||||
curl -X PUT "$BASE/1" -H "$AUTH" -H "Content-Type: application/json" --data-binary @-
|
||||
export ACQUIRE_RELEASE_DIR="$(pwd)/release/publish/$(date +%Y%m%d-%H%M%S)-$(git rev-parse --short HEAD)"
|
||||
export BGS_TOKEN_FILE="$HOME/.bgs"
|
||||
mkdir -p "$ACQUIRE_RELEASE_DIR"
|
||||
```
|
||||
|
||||
## Updating later
|
||||
`BGS_TOKEN_FILE` must contain an **admin token issued by BGS**, with access to manage Acquire.
|
||||
Publishing authenticates to the BGS admin API using `Authorization: Bearer <token>`. It is a local secret:
|
||||
never print it, add it to Git, or include it in release records. On another machine, set the
|
||||
path to its authorized token file. Preserve a snapshot of the live metadata before changes.
|
||||
|
||||
Bump `packages/engine/package.json`'s version and upload the new tarball to the **same**
|
||||
version integer: ongoing games pick up the new engine within about a minute. A new version
|
||||
integer only affects new games. Upload the engine and viewer together whenever the move or
|
||||
state format changes, since they are coupled.
|
||||
| Artifact | Source | Destination |
|
||||
| -------- | ---------------------------------------------------------------------- | -------------------------------------------------- |
|
||||
| Engine | `packages/engine/` → `acquire-engine-<package-version>.tgz` | `engine.package`; entry point `dist/wrapper.js` |
|
||||
| Viewer | `packages/viewer/dist/acquire-viewer.iife.js` and `acquire-viewer.css` | `viewer.url` and `viewer.dependencies.stylesheets` |
|
||||
| Rules | `docs/admin/rules.md` | CMS page `acquire:rules`, language `en` |
|
||||
|
||||
From engine 0.0.2 / viewer 0.0.11, live moves use a private turn draft (`type: "turn"`,
|
||||
`from: <saved log length>`, `moves: [...]`). The engine validates the complete sequence
|
||||
from the saved position. It returns `toSave: undefined` while choices remain reversible,
|
||||
and sends the acting player a stripped `preview` inside the log response. The viewer
|
||||
undoes by dropping one cached action/view; it never rewrites published log entries.
|
||||
The complete sequence commits when a decision passes to another player, tiles are drawn,
|
||||
bonuses reveal information or the game ends. Refreshing the page discards unfinished choices.
|
||||
`timeIncrements` counts completed turns and other players' merger disposal decisions;
|
||||
revising a private draft earns no time. Publish the engine first: its capability flag
|
||||
allows the viewer to keep using atomic moves with older engines. Older viewers, tutorials
|
||||
and analysis retain the original atomic protocol.
|
||||
The engine package contains compiled `dist/`, package metadata and license. BGS installs its
|
||||
runtime dependency `seedrandom`. The viewer bundles its dependencies; its dev harness does
|
||||
not ship. Keep source maps out of the upload unless deliberately requested.
|
||||
|
||||
## Before making a version public
|
||||
## 2. Upload the engine, if changed
|
||||
|
||||
BGS's release checklist, and where this repo stands:
|
||||
Publish the engine before its matching viewer. After the checks have finished:
|
||||
|
||||
- Protocol: core, chat, replay, preferences and avatar handlers are implemented.
|
||||
- Replays and analysis: the engine exports `replay`, and the viewer's replay controls rebuild
|
||||
each position from the public log. BGS’s default adapters support finished-game
|
||||
analysis at move boundaries. Ongoing-game analysis stays off until hidden-information
|
||||
scenarios are implemented.
|
||||
- Mobile: phone portrait and landscape, tablet and desktop, both themes, 44px touch targets.
|
||||
- History: no tentative or revisable moves.
|
||||
- Color accessibility: chain letters and player names are always visible; no separate mode is needed.
|
||||
- Languages: the viewer is translated into all 17 BGS locales. The game list's last-move text
|
||||
comes from the English `simple` line that `logSlice` adds to each log entry.
|
||||
- Admin panel content (rules page, pictogram, credits, description, links, screenshots) is in
|
||||
`docs/admin/`; its README says where each file goes.
|
||||
```bash
|
||||
pnpm --filter acquire-engine pack --pack-destination "$ACQUIRE_RELEASE_DIR"
|
||||
```
|
||||
|
||||
The October 2026 private-beta audit is in [admin/release-check.md](admin/release-check.md).
|
||||
The raw tarball goes to
|
||||
`POST https://admin.boardgamers.space/api/admin/gameinfo/acquire/1/engine`, with bearer
|
||||
authentication and `Content-Type: application/octet-stream`. BGS reads the name and version
|
||||
from the archive and updates `engine.package`. It preserves the entry point.
|
||||
|
||||
This example reads the version from the package, saves before/after metadata, uploads, and
|
||||
compares the hosted archive with the local file. It performs a live deployment when run:
|
||||
|
||||
```bash
|
||||
node --input-type=module <<'JS'
|
||||
import assert from 'node:assert/strict';
|
||||
import { readFile, writeFile } from 'node:fs/promises';
|
||||
import { join } from 'node:path';
|
||||
import { createHash } from 'node:crypto';
|
||||
|
||||
const dir = process.env.ACQUIRE_RELEASE_DIR;
|
||||
const token = (await readFile(process.env.BGS_TOKEN_FILE, 'utf8')).trim();
|
||||
const base = 'https://admin.boardgamers.space/api/admin/gameinfo/acquire/1';
|
||||
const pkg = JSON.parse(await readFile('packages/engine/package.json', 'utf8'));
|
||||
const bytes = await readFile(join(dir, `${pkg.name}-${pkg.version}.tgz`));
|
||||
async function api(path = '', body) {
|
||||
const response = await fetch(base + path, {
|
||||
method: body ? 'POST' : 'GET',
|
||||
headers: { Authorization: `Bearer ${token}`, ...(body ? { 'Content-Type': 'application/octet-stream' } : {}) },
|
||||
body, signal: AbortSignal.timeout(60000),
|
||||
});
|
||||
assert(response.ok, `BGS returned HTTP ${response.status}`);
|
||||
return response.json();
|
||||
}
|
||||
const before = await api();
|
||||
await writeFile(join(dir, 'engine-before.json'), JSON.stringify(before, null, 2));
|
||||
assert.equal(before.engine.entryPoint, 'dist/wrapper.js');
|
||||
assert.notEqual(before.engine.package.version, pkg.version, 'Bump the engine package version first');
|
||||
const after = await api('/engine', bytes);
|
||||
await writeFile(join(dir, 'engine-after.json'), JSON.stringify(after, null, 2));
|
||||
assert.equal(after.engine.package.name, pkg.name);
|
||||
assert.equal(after.engine.package.version, pkg.version);
|
||||
assert.equal(after.engine.entryPoint, before.engine.entryPoint);
|
||||
assert.equal(after.public, before.public);
|
||||
const hosted = await fetch(after.engine.package.url, { signal: AbortSignal.timeout(60000) });
|
||||
assert(hosted.ok, `Hosted archive returned HTTP ${hosted.status}`);
|
||||
const sha = (value) => createHash('sha256').update(value).digest('hex');
|
||||
assert.equal(sha(Buffer.from(await hosted.arrayBuffer())), sha(bytes));
|
||||
console.log(`Uploaded and verified ${pkg.name}@${pkg.version}`);
|
||||
JS
|
||||
```
|
||||
|
||||
The game server checks for new engines about once a minute, installs and validates them,
|
||||
then activates them. The previous engine remains active if installation fails. Uploaded
|
||||
metadata and matching hosted bytes confirm publication, **not** successful server activation;
|
||||
verify activation through server status or live behavior when accessible. In particular,
|
||||
coordinate new setup options with availability of the engine that understands them.
|
||||
|
||||
## 3. Upload and activate the viewer, if changed
|
||||
|
||||
Use the platform repository's publisher. On the usual workstation it is in
|
||||
`~/code/boardgamers-mono`; adjust the path for another checkout. Run this from the Acquire root:
|
||||
|
||||
```bash
|
||||
node ../boardgamers-mono/scripts/publish-viewer.mjs \
|
||||
--game acquire --version 1 \
|
||||
--dir "$(pwd)/packages/viewer/dist" \
|
||||
--entry acquire-viewer.iife.js --style acquire-viewer.css \
|
||||
--token "$BGS_TOKEN_FILE" \
|
||||
--record "$ACQUIRE_RELEASE_DIR/viewer-release.json" \
|
||||
--apply --activate
|
||||
```
|
||||
|
||||
Omit `--apply --activate` for a dry run. The publisher uploads to a content-addressed bundle,
|
||||
verifies public JS/CSS bytes, records the previous viewer, detects concurrent viewer changes,
|
||||
and activates the new URLs while preserving the other viewer settings. Use a new record file
|
||||
for every deployment. This tool lives in the platform repository, not the Acquire repository.
|
||||
|
||||
If that checkout is unavailable, use the BGS admin version form's **Upload bundle…** action
|
||||
with the JS and CSS together. Preserve the existing top-level variable `acquire`, chat,
|
||||
integrated controls, replay, tutorials and other settings. Uploading files without saving or
|
||||
activating their URLs is not a viewer release.
|
||||
|
||||
## 4. Update declarations or CMS text only when needed
|
||||
|
||||
Fetch `GET /api/admin/gameinfo/acquire/1` immediately before changing settings and save a
|
||||
snapshot. PUT a minimal body to that same route, containing only the changed field. For
|
||||
array fields such as `options`, merge the intended entry into the freshly fetched array;
|
||||
do not replace other declarations from an old local snapshot.
|
||||
|
||||
Current declaration sources are in [admin/gameinfo.json](admin/gameinfo.json):
|
||||
|
||||
- Six options: public holdings, team play, two-player mode, automatic ending, end size,
|
||||
and **Stock swap: Off / 3 / 5 / 7 / Unlimited**, default Off.
|
||||
- The **sound** preference, default on, also honoring BGS's global sound setting.
|
||||
- Three interactive tutorial chapters: founding, mergers and scoring.
|
||||
|
||||
Unticked checkboxes are omitted by BGS; select values arrive as strings. Engine normalization
|
||||
must keep old games and replay logs compatible. Setup-option changes apply to new games;
|
||||
do not rewrite options inside ongoing games.
|
||||
|
||||
English rules are read and updated at
|
||||
`https://admin.boardgamers.space/api/admin/page/acquire:rules/en` using GET and PUT.
|
||||
Compare the current content with the saved baseline, then PUT `{ "content": "..." }` only.
|
||||
Preserve title, visibility and other page fields. See [admin/README.md](admin/README.md) for
|
||||
credits, descriptions and gallery assets. CMS translations and setup labels are separate from
|
||||
the 17 viewer catalogs; do not use automated translation APIs as part of routine publishing.
|
||||
|
||||
## 5. Verify and record the result
|
||||
|
||||
- Fetch the final metadata: check engine name/version/entry point, viewer URLs, intended
|
||||
declaration changes, and preservation of visibility, tutorials, preferences and other fields.
|
||||
- Confirm hosted JS/CSS/tarball bytes match the built files. The viewer publisher and engine
|
||||
example above do these comparisons. Verify the rules page separately if it changed.
|
||||
- Inspect the relevant UI in a refreshed browser and exercise behavior locally or in an
|
||||
appropriate test game. Do not make test moves in someone else's ongoing game.
|
||||
- Record the source commit, package versions, validation and any remaining limitations in
|
||||
[admin/release-check.md](admin/release-check.md). Keep deployment snapshots outside Git.
|
||||
- To recover from a bad upload, use the recorded previous artifact references and update only
|
||||
the affected fields after checking the current metadata. Check saved-state compatibility
|
||||
before reverting an engine; newer moves may require the newer engine.
|
||||
|
||||
## Compatibility notes
|
||||
|
||||
Live moves support private turn drafts (`type: "turn"`, `from: <saved log length>`,
|
||||
`moves: [...]`). The engine validates the entire sequence against the saved state.
|
||||
Reversible choices return `toSave: undefined`; the acting player receives a stripped
|
||||
`preview` in the log response. Undo drops cached actions/views, not published log entries.
|
||||
A draft commits when a decision passes to another player, information is revealed, tiles
|
||||
are drawn or the game ends. Refreshing discards unfinished choices. `timeIncrements` counts
|
||||
completed turns and other players' merger disposal decisions, never individual revisions.
|
||||
Atomic moves remain supported for older viewers, tutorials and analysis.
|
||||
|
||||
Finished-game analysis uses BGS's default adapters at move boundaries. Ongoing analysis
|
||||
remains disabled until hidden-information scenarios are implemented. See the release record
|
||||
for outstanding analysis, translation and playtesting work; public availability does not
|
||||
mean those gaps are resolved.
|
||||
|
||||
## Initial registration only
|
||||
|
||||
If setting up a separate new registration, begin private, use the individual fields from
|
||||
[admin/gameinfo.json](admin/gameinfo.json), and upload its own artifacts. The live Acquire
|
||||
registration described above already exists and is public; do not recreate or privatize it
|
||||
as part of an ordinary update.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue