Skip to content

Commit c0bedcb

Browse files
committed
docs: add AGENTS.md
1 parent 9988fea commit c0bedcb

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

‎AGENTS.md‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# FrictionLog — Agent Guide
2+
3+
## Commands
4+
```bash
5+
# Local dev (no Docker):
6+
pip install -r requirements.txt
7+
export GOOGLE_API_KEY="..." && export POCKETBASE_URL="http://127.0.0.1:8090"
8+
uvicorn api:app --reload # API (terminal 1)
9+
streamlit run ui.py # Dashboard (terminal 2)
10+
11+
# Docker (recommended):
12+
docker-compose up --build -d # starts api + dashboard
13+
docker-compose run --rm test # run tests in container
14+
15+
# Tests:
16+
pytest tests/ -v # 5 API tests (mocked PocketBase)
17+
```
18+
19+
## Critical Quirks
20+
21+
- **5 entry points**, not one: `api.py` (FastAPI), `ui.py` (Streamlit), `core.py` (orchestrator), `llm_client.py` (Gemini), `main.py` (Vercel serverless entry — empty file!). The active entry points are `api.py` and `ui.py`. **Do NOT use `main.py` for local dev.**
22+
- **PocketBase is a hard dependency** — the API communicates with it via `httpx`. Without PocketBase running at `POCKETBASE_URL`, all endpoints return errors. Tests mock it via `monkeypatch` on `httpx.AsyncClient`.
23+
- **Schema must be pre-loaded**: import `pocketbase_schema.json` in PocketBase admin panel (`http://127.0.0.1:8090/_/`), or run `python pb_setup.py` to create it programmatically.
24+
- **Google Gemini** (`gemini-1.5-flash`) requires `GOOGLE_API_KEY` env var. Without it, AI analysis endpoints (`/fricciones/{id}/analizar`, `/analizar-con-ia`) return error responses.
25+
- **`app.py` is empty** (0 lines) — legacy placeholder, not used for anything. Ignore it.
26+
- **`CHANGELOG.md` is PocketBase's changelog** (945 lines), not FrictionLog's. See `docs/BITACORA.md` for real project history.
27+
- **Tests mock both PocketBase AND Gemini** — `test_analizar_con_ia` and `test_analyze_friction_persistence` monkeypatch `api_module.core.analizar_friccion` to avoid real LLM calls.
28+
- **`descripcion` field minimum length**: 10 characters (enforced by Pydantic in `api.py`). POST with shorter text returns 422.

0 commit comments

Comments
 (0)