diff --git a/docs/night/BOUNDARIES.md b/docs/night/BOUNDARIES.md index 311c8dd..98cb43a 100644 --- a/docs/night/BOUNDARIES.md +++ b/docs/night/BOUNDARIES.md @@ -1 +1,53 @@ -PLACEHOLDER \ No newline at end of file +# Night 1: module boundaries + +Owner: `night-lead`. This file is the rule when two PRs touch the same path. If you need to edit a path you don't own, comment on the owner's issue (`[from ]`) or keep your change to the "shared hook" listed below. + +## Who owns what + +| Path | Owner | Issue | +|---|---|---| +| `docs/game/DESIGN.md` | council (designer-a, designer-b, critic) | #1 | +| `docs/game/CARD_DATA.md`, `docs/game/card-sample.json` | council-data | #2 | +| `shared/game/` (types, RNG, state machine, rules, keywords, `Ruleset`, `starterDeck`) | engine-a (core, API), engine-b (keywords, effects) | #3 | +| `docs/game/ENGINE_API.md` | engine-a | #3 | +| `shared/game/modes.ts` | modes | #6 | +| `server/game*` (e.g. `server/game/`, `server/game-*.ts`) | modes | #6 | +| `docs/game/HOSTING.md` | modes | #6 | +| `src/game/` (screens, lobby, deck builder, match, tutorial) | ui-a | #5 | +| `src/game/ai/` (browser bots, easy and normal) | ui-b | #5 | +| beta-fix files outside `src/game/` (landing page, `Card.tsx`, etc.) | ui-b, one PR per upstream issue | #5 | +| `shared/bots/`, `scripts/sim/` (bots and the simulation runner) | sim-balance | #4 | +| `docs/game/BALANCE.md` | sim-balance | #4 | +| `compose.testnet.yaml` overrides, `deploy/night/` (testnet config, per-node mode files) | sim-testnet | #4 | +| `server/account*` (e.g. `server/account/`), `src/auth/` | sso | #7 | +| `android/`, `capacitor.config.ts` | mobile-android | #8 | +| `ios/`, `docs/night/IOS.md` | mobile-ios, macos-fetch | #9 | +| `docs/night/` (except `IOS.md`), this file, `REPORT.md` | night-lead | #10 | + +## Tests + +`scripts/run-tests.mjs` only picks up **top-level** `tests/*.test.ts`. Name your files with your team as a prefix so they never collide: +`tests/game-*.test.ts` (engine), `tests/modes-*.test.ts`, `tests/ui-*.test.ts`, `tests/bots-*.test.ts`, `tests/account-*.test.ts`. + +## Shared hooks (the only places two teams touch the same file) + +1. **`server/testnet/http.ts`**: modes and sso each export an Express `Router` from their own files and add **exactly one** `app.use(...)` mount line just **above** the `/api` 404 handler (`app.use(['/api','/p2p'],(_req,res)=>{res.status(404)...`). Nothing else in this file. If SSO needs a CSP change (`connect-src` for `https://dex.eom.dev`), keep it to the `helmet` directive and say so in the PR. +2. **`src/App.tsx`**: ui-a owns it. Others get one import and one element each (sso: a login button or provider; mobile: hide the mining controls behind a `isNativeApp()` check from `src/game/` or `src/auth/`, never by deleting code). +3. **`package.json` and `package-lock.json`**: additive changes only (new dependencies or scripts). Don't reformat or bump existing versions. Lockfile conflicts are resolved by night-lead regenerating the lockfile. +4. **`shared/enrichment.ts`**: read-only for everyone tonight. Map card data into game stats inside `shared/game/`. + +## Off limits (consensus and protocol; PRs touching these are rejected) + +`server/chain.ts`, `shared/protocol.ts`, `shared/trade-offer.ts`, `shared/chain-identity.ts`, `shared/network.ts`, `server/testnet/consensus.ts`, `server/testnet/ledger.ts`, `server/testnet/canonical-index.ts`, `server/testnet/randomx.ts`, `server/testnet/miner.ts`, `server/testnet/peers.ts`, `native/`. + +If you think you need a change there, write it up in your issue instead. + +## Dependency direction + +`shared/game/` imports nothing from `server/` or `src/` and does no I/O. `shared/game/modes.ts`, `shared/bots/`, `server/game*`, `src/game/` import from `shared/game/` through the API in `ENGINE_API.md`, not from its internals. + +## Merging + +- Branch `night//`, PR into `night/2026-11-16`, squash-merged by night-lead after night-review approves and `npm test` and `npm run build` pass. +- Small PRs merge faster. Rebase on the integration branch before asking for review if it moved under you. +- After 01:10 (code freeze), only fixes merge.