# The Vault @ 52 — Brand Platform API

This folder is the machine-readable side of The Vault's brand platform. Plain static files — anything that can make an HTTP request (or read a file) can use it. No server code, no keys.

The interface at `../index.html` renders **100% from this data**, so changing the API changes the UI for free. That's what makes the platform evolving instead of a frozen brand PDF.

## Files

| File | What it is | Who uses it |
|---|---|---|
| `brand.json` | **Canonical source of truth.** Brand core, identity (palette / typography / logo / voice), the 11 pillars with statuses, the Destination Test, decision log, changelog. | AI agents, scripts, anything programmatic |
| `agent-reference.md` | The brand formatted as a drop-in system prompt with rules and output guidance. | Paste into any AI agent's instructions, or have the agent fetch it |
| `brand.js` | The exact same data wrapped in `window.VAULT_BRAND` so the interface works even opened straight from disk. | The module's own UI only |

**Keep-in-sync rule:** `brand.json` and `brand.js` must always carry identical data. Edit `brand.json`, then regenerate `brand.js` (asking Claude handles both automatically):

```
node -e "const fs=require('fs');const d=fs.readFileSync('brand.json','utf8').trim();fs.writeFileSync('brand.js','// The Vault @ 52 - Brand Platform data. Mirror of brand.json - keep both in sync (see README.md).\nwindow.VAULT_BRAND = '+d+';\n')"
```

Drift check — run from this folder; must print `SYNC OK`:

```
node -e "global.window={};const fs=require('fs');eval(fs.readFileSync('brand.js','utf8'));const a=window.VAULT_BRAND,b=JSON.parse(fs.readFileSync('brand.json','utf8'));console.log(JSON.stringify(a)===JSON.stringify(b)?'SYNC OK':'DRIFT DETECTED')"
```

The version in `agent-reference.md`'s header must also match `brand.json`'s `version` on every bump.

## Using it with AI agents

**Option A — paste:** Copy `agent-reference.md` into the agent's system prompt / custom instructions.

**Option B — fetch (once deployed):** Point the agent at the live URL so it always has the current version:

```
Before creating anything for The Vault at Club 52 (content, design, menus, events,
copy), fetch https://hq.club52poker.com/vault/api/brand.json and follow its identity,
voice, and pillars. Run every idea through brandFilter — starting with the north star:
"Does this make The Vault more of a destination?"
```

**Option C — code:**

```js
const brand = await fetch("https://hq.club52poker.com/vault/api/brand.json").then(r => r.json());
const crimson = brand.identity.palette.find(c => c.id === "crimson").hex; // #8B1D2E
```

Replace `https://hq.club52poker.com` with wherever the HQ deploy lives (VPS web root `/var/www/hq` → this folder serves at `/vault/api/`).

## The data model

- **`brand`** — the core: positioning, promise, north star, feeling, battle cry, and the is / is-not lists. Change these rarely and deliberately; log a decision when you do.
- **`identity`** — palette (sampled from the logo), the Vault Metal gradient, typography (Oswald + Inter), logo rules, and voice (principles + do / don't).
- **`pillars`** — the 11 pillars of the Blueprint. Each has `status`: `concept → design → build → live` (definitions in `statusKey`). Move statuses as the venue progresses; the interface's status board follows.
- **`brandFilter`** — the Destination Test: the north star pass/fail question plus four supporting checks (premium / return / unique / amplify). The interface renders it as an interactive gate.
- **`decisions`** — the decision log. Every meaningful brand call gets a dated entry: what was decided and why. This is the brand's memory.
- **`changelog`** — version history of the platform itself.

## Expanding the module

- **Pillar progresses:** change its `status` — the pillar card badge and the Evolution status board update automatically.
- **Brand decision made:** add an object to `decisions` (`date`, `title`, `detail`).
- **New pillar / feature / rule:** add it to the relevant array — the interface re-renders from data.
- **Any change:** bump `version`, set `updated`, add a `changelog` entry, and regenerate `brand.js`.

Natural next phases as the venue comes online: an asset library (logo files, templates, signage), menu & programming boards per pillar, and a token-gated write API for team decision logging (same pattern as `../marketing/api/log.php`).
