Skip to content

A new contributor could not have known the engine cannot import from lib/ - #234

Merged
0xward merged 3 commits into
mainfrom
claude/claude-md-documentation-7m80f1
Aug 3, 2026
Merged

A new contributor could not have known the engine cannot import from lib/#234
0xward merged 3 commits into
mainfrom
claude/claude-md-documentation-7m80f1

Conversation

@0xward

@0xward 0xward commented Aug 3, 2026

Copy link
Copy Markdown
Owner

Adds CLAUDE.md. One new file, no source changed.

The problem

Every convention in this repo that matters is written down somewhere, and no two of them are in the same place. The engine boundary is explained in the header of lib/constants/game-config.ts. The invariants are §10 of a 67KB design doc. The reason CI does not run lint is a comment in a workflow file. The reason wagmi mounts as a sibling rather than a wrapper is thirty lines of Web3Providers.tsx — and that note exists because somebody had already undone it once.

That is fine for the owner, who wrote all of it. It is not fine for an assistant opening the repo cold, which is exactly who keeps being handed these tasks: it reads the file it was pointed at, does not read the four other files explaining why that file is shaped the way it is, and helpfully simplifies something back into the bug it was written to fix.

What it collects

  • The boundary, first, because everything else follows from it. Fourteen plain <script> files under public/ that next build never touches, cannot import from lib/, and whose syntax errors ship. The duplicated marketplace list is a consequence, not an oversight, and the engine's copy wins.
  • The invariants from docs/GAME-DESIGN.md §10 verbatim, plus the two the tooling already enforces but nobody would guess: one owner for the RPC endpoint and one for the origin, and an attribution tag that cannot be backfilled — an untagged transaction is unattributed forever, including the four the backend signs.
  • What the check scripts are. Not a test suite — each one is a bug that already shipped, wearing a filename. check:cssvars exists because a primary button rendered as near-black text on a dark modal; check:copy exists because "Add Cash" reached four files and a "Connect wallet" line sat permanently on /profile. Listing them next to what they guard is what stops the next person from deleting the noisy one.
  • The MiniPay rules that live in copy and in .npmrc, which look like style preferences and are listing-review rejections.
  • The commit style, described from the log rather than prescribed: subject names the problem in the player's words, body carries symptom, mechanism, fix, and a Verified: line with real numbers.

Also covered: the three identity tiers in useWallet() and the note that none of them is a credential, the read-before-write rule on Firestore transactions that once discarded every kill for a month, the server-side replay protection pattern in marketplace/verify, and the docs map.

Verified

Against the source, not the README. The env section names FIREBASE_SERVICE_ACCOUNT, which is what firebase-config.ts actually reads — the README says FIREBASE_SERVICE_ACCOUNT_JSON, which nothing does. Route count (44), engine script count and load order, gitignored min/ output, and the audit's one-place-allowed rules for celoRpc.ts and siteUrl.ts were each read off the files.

npm run audit clean. No source file changed, so nothing else can regress.


Generated by Claude Code

…lib/

Every convention in this repo that matters is written down somewhere, and no two
of them are in the same place. The engine boundary is explained in the header of
lib/constants/game-config.ts. The invariants are §10 of a 67KB design doc. The
reason CI does not run lint is a comment in a workflow file. The reason wagmi
mounts as a sibling rather than a wrapper is thirty lines of Web3Providers.tsx —
and the note explaining it exists because somebody had already undone it once.

That is fine for the owner, who wrote all of it. It is not fine for an assistant
opening the repo cold, which is exactly who keeps being handed these tasks: it
reads the file it was pointed at, does not read the four other files that
explain why the file is shaped that way, and helpfully simplifies something back
into the bug it was written to fix.

CLAUDE.md collects the parts that are load-bearing and cheap to violate:

  THE BOUNDARY, first, because everything else follows from it. Fourteen plain
  <script> files under public/ that next build never touches, cannot import from
  lib/, and whose syntax errors ship. The duplicated marketplace list is a
  consequence, not an oversight, and the engine's copy wins.

  THE INVARIANTS from GAME-DESIGN.md §10 verbatim, plus the two the tooling
  already enforces but nobody would guess: one owner for the RPC endpoint and
  one for the origin, and an attribution tag that CANNOT be backfilled — an
  untagged transaction is unattributed forever, including the four the backend
  signs.

  WHAT THE CHECK SCRIPTS ARE. They are not a test suite. Each one is a bug that
  already shipped, wearing a filename. check:cssvars exists because a primary
  button rendered as near-black text on a dark modal; check:copy exists because
  "Add Cash" reached four files and a "Connect wallet" line sat permanently on
  /profile. Listing them next to what they guard is what stops the next person
  from deleting the noisy one.

  THE MINIPAY RULES that live in copy and in .npmrc, which look like style
  preferences and are listing-review rejections.

  THE COMMIT STYLE, described from the log rather than prescribed: the subject
  names the problem in the player's words, the body carries symptom, mechanism,
  fix and a Verified: line with real numbers.

Verified against the source, not the README: the env section names
FIREBASE_SERVICE_ACCOUNT, which is what firebase-config.ts actually reads — the
README says FIREBASE_SERVICE_ACCOUNT_JSON, which nothing does. Route count (44),
engine script count and load order, gitignored min/ output, and the audit's
one-place-allowed rules for celoRpc.ts and siteUrl.ts were each read off the
files. npm run audit clean; no source file changed.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@vercel

vercel Bot commented Aug 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nullstate Ready Ready Preview Aug 3, 2026 12:46pm

0xward added 2 commits August 3, 2026 12:25
Two reasons, and the second is the one that needed doing.

The branch was cut before #235 landed, so it was describing a repo that has
since gained lib/server/vaultChain.ts and a vault payout path that no longer
does two on-chain writes in one request. A documentation branch that is behind
main is documentation that is already wrong.

It also retriggers the preview deployment. The one for d8297cf errored with a
build log that stops dead after 'Cloning completed: 50.039s' — no install, no
next build, no error, nothing. Zero build output on a diff that adds one
markdown file, while the GitHub checks workflow passed on the same SHA and every
other deployment that day went green. That is a stall on Vercel's side, not
something in the change, and it never retried on its own.
The branch was cut before #235, so the file described a repo that no longer
exists: 44 routes (now 45), a lib/server/ list with no vaultChain or vaultSweep,
a cron that only closes seasons, and no mention of test:vaultpay.

Three conventions added to §6, because they are exactly the kind this file is
for — each one is a bug that already shipped and would have been avoided by a
sentence:

  - two on-chain writes in one player request is how a solved vault paid
    nothing; the second write was rejected at the RPC boundary before it was a
    transaction, and only the first winner of each week ever took that path
  - anything that can leave a reward unpaid needs a server-side sweep, because
    the vault's only recovery was re-clearing Bunker 5 to reach the door
  - never name a cause you did not check: the payout blamed an empty pool it had
    never read

A documentation branch that is behind main is documentation that is already
wrong, which is the failure invariant #2 in this same file exists to name.
@0xward
0xward merged commit 33ae1d2 into main Aug 3, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant