Testing the peoplereadme CLI
Setup
- Python 3.12+ and uv are required.
uv sync --devfrom the repo root installs everything (typer, pydantic, jsonschema, pytest, ruff) and thepeoplereadmeentrypoint. - Test in a clean clone (e.g.
git clone -b <branch> <repo> /tmp/prtest) soinitruns don't dirty the working repo —initmutatesmanifest.jsonand createspersonas/{id}/. - All testing is shell-only; no browser/recording needed.
Core commands
- Lint:
uv run ruff check src tests - Unit tests:
uv run pytest -q - Schema validation of all personas:
uv run peoplereadme validate(validatespersonas/*/persona.jsonagainstschemas/persona.schema.json; legacy packages without persona.json are skipped) - Version:
uv run peoplereadme --version
End-to-end checks worth repeating
uv run peoplereadme init <id> --class other→ expect exit 0 and "Schema validation passed."; verify skeleton dirs (context/ data/ prompts/ evals/rubrics/ evals/fidelity/ evidence/ traces/ compiled/ exports/),evidence/sources.lock,traces/splits.json, apersona.jsonwithclass=other, noconsent, novoiceinallowed_exports, non-affiliation header in README, and exactly one newmanifest.jsonentry.--class self→consentobject present,voiceinallowed_exports,evidence/.gitignoreignoring*.jsonl.- Adversarial: set
"class": "fan-fiction"in a persona.json and runvalidate <id>— must exit 1 citing the enum. If it passes, schema enforcement is broken. - Regression: after any schema change,
uv run pytest tests/test_schema.py -qproves the Riley package still validates unchanged; alsogit statusshould show no changes underpersonas/riley-walz/.
Known quirks
- Duplicate
init <id>errors with a raw typer traceback (FileExistsError) rather than a clean message — this might be improved later; nonzero exit and no duplicate manifest entry are the assertions that matter. validaterun outside a repo root fails with "Not inside a peoplereadmes repo"; run from the repo root (it walks upward looking for manifest.json + schemas/persona.schema.json).
Devin Secrets Needed
- None for CLI/schema testing (all local, no network). Later pipeline stages (compile/eval) will need LLM provider keys via env (e.g. OPENAI_API_KEY or similar litellm-compatible keys).