This document is the working contract for contributors and coding agents in this repository. Follow it as the default behavior unless a task-specific instruction says otherwise.
PaperBot is a mixed Python + Next.js project.
src/- Python backend package (agents, workflows, API)tests/- pytest suite (unit + integration)alembic/+alembic.ini- SQLAlchemy/Alembic migrationsweb/- Next.js dashboard (DeepCode Studio + UI)cli/- CLI and terminal toolingdocs/- design notes and plans (docs/PLAN.md)asset/,public/- static assets for docs/UI
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python -m uvicorn src.paperbot.api.main:app --reload --port 8000cd web
npm install
npm run devOpen http://localhost:3000 for the web app.
pytest
# or
pytest -q
python -m black .
python -m isort .
pyrightcd web
npm run lint
npm run buildNotes:
- Integration tests live under
tests/integration/. - Prefer deterministic tests and mock external APIs when possible.
- Black formatting,
line-length = 100 - isort with Black profile
- Naming:
snake_casefor functions/variables,PascalCasefor classes
- Follow established patterns in
web/src/ - Keep Tailwind usage consistent with nearby components
Do not edit generated/vendor directories:
web/.next/web/node_modules/
Use Conventional Commits:
feat: ...fix: ...refactor: ...docs: ...
Each PR should include:
- What changed and why
- Any config/environment impact
- Linked issue (if available)
- Validation evidence (for example:
pytest,npm run build) - Screenshots or clips for UI changes under
web/
Bootstrap local env:
cp env.example .envThen fill required keys (for example OPENAI_API_KEY).
- Make the smallest safe change that satisfies the request.
- Keep edits local and avoid unrelated refactors.
- Prefer fast, targeted checks before broad test runs.
- If behavior changes, add or update tests.
- When uncertain, document assumptions explicitly in the final note.