Skip to content

chore: add AGENTS.md, extract ALLOWED_ORIGINS, wire e2e config, add inline comments - #1

Open
liorsbg wants to merge 1 commit into
mainfrom
chore/agents-and-code-improvements
Open

chore: add AGENTS.md, extract ALLOWED_ORIGINS, wire e2e config, add inline comments#1
liorsbg wants to merge 1 commit into
mainfrom
chore/agents-and-code-improvements

Conversation

@liorsbg

@liorsbg liorsbg commented May 31, 2026

Copy link
Copy Markdown
Owner

What

Adds agent guidance and applies four code improvements identified during an AGENTS.md audit.

Changes

New files

  • AGENTS.md — agent guidance covering architecture decisions, testing conventions, code style rules, boardgame.io import paths, and a "do not do" list. Includes non-obvious constraints like the p-queue footgun, the intentional RemoteStorage.listMatches [] return, and the dual ALLOWED_ORIGINS arrays.
  • AGENTS-IMPROVEMENT-SPEC.md — audit record: what was good, what was missing, what was wrong, and the prioritised list of remaining work.

Code changes

  • src/cors.ts — new shared ALLOWED_ORIGINS constant. Removes the duplicate definitions that existed independently in server.ts and lobby.ts.
  • src/remote-storage.ts — comment on listMatches explaining the intentional [] return (lobby DO owns the match list).
  • src/match-room.ts — comment on SimpleQueue explaining why p-queue cannot be used in the Miniflare Workers environment.
  • package.jsonpnpm e2e:local now runs vitest run --config vitest.e2e.config.ts instead of the legacy curl-based scripts/e2e-local.mjs. The E2E test files already manage the dev server lifecycle internally.

Verification

pnpm typecheck  # clean
pnpm lint       # 0 errors, 57 pre-existing any warnings (unchanged)
pnpm test       # 93/93 passed

…nline comments

- Add AGENTS.md with architecture decisions, testing conventions, code style
  rules, and a 'do not do' list for agents working in this repo
- Add AGENTS-IMPROVEMENT-SPEC.md recording the audit findings and rationale
- Extract ALLOWED_ORIGINS to src/cors.ts; remove duplicate definitions from
  server.ts and lobby.ts
- Add comment to RemoteStorage.listMatches explaining the intentional [] return
- Add comment to the SimpleQueue in match-room.ts explaining why p-queue cannot
  be used in the Miniflare Workers environment
- Wire vitest.e2e.config.ts into pnpm e2e:local, replacing the curl-based
  scripts/e2e-local.mjs runner

Co-authored-by: Ona <no-reply@ona.com>
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