Verification and tests
The test suite
tests/ — 133 tests, all runnable offline with fake agents and fake LLMs (no network,
no models, no mail servers):
cd /path/to/this-repo
pip install -r ralph_orchestrator/requirements.txt pytest
/opt/homebrew/opt/python@3.11/bin/python3.11 -m pytest tests/ -q # or: python3 -m pytest tests/ -q
Verified on this repository: 133 passed (Python 3.11).
| File | Covers |
|---|---|
|
the run loop end-to-end with a fake shell agent: parallel waves and dependency visibility, scope-overlap serialisation, regression-failure merge undo, resume skipping merged tickets, blocked ticket stopping its dependents, in-run IMAP polling (silent no-op when unconfigured, sender-account fallback, mid-run reply → feedback, one-shot |
|
|
|
|
|
bus post/inbox/cursors; change requests (approved → fix ticket created and dependents rewired, rejected, |
|
the planner repair loop: an invalid plan (unknown dependency, vacuous |
|
Message-ID stability per run; |
|
the |
|
reason-keyed sign-offs, the attachment policy (final/manual mail carries HTML and PDF, periodic stays plain text, one-shot |
|
snapshot building (counts, completion %, distinct statuses, stale heartbeat, real dependencies only, hierarchical overlap-free layout), state events and old-format backfill, self-contained report/dashboard HTML (no CDN), the dashboard HTTP server, the Timeline view, the watch badge, the plugins box, empty-state and large-task-set rendering, script-injection safety |
|
PDF rendering of a real report via Playwright Chromium (skipped when the browser is not installed), |
|
|
|
|
|
|
Test fixtures use temporary git repositories (real git init/commit in tmp_path), fake
agents as shell case scripts, and a make_llm factory substitute returning scripted
verdicts — so the orchestration logic is tested exactly as it runs in production, without
any external system.
End-to-end checks (reproducible)
-
The showcase — a full real run of the orchestrator against the dummy agent, 4 tickets, parallel wave, no LLM: 2-minute offline showcase (verified output:
4/4 merged,peak agents: 2,reason: DONE). -
The dashboard — after any run:
python3 ralph_orchestrator/orch.py dashboard --port 8471 &
curl -s http://127.0.0.1:8471/api/run | python3 -m json.tool | head # snapshot JSON
curl -s -o /dev/null -w "%{http_code}\n" http://127.0.0.1:8471/ # 200
-
The kit install —
./install.sh /path/to/a/git/repointo a scratch repository: the kit appears,.venv-ralphis created,.ralph/and.venv-ralph/are ininfo/exclude, andorch.py checkruns against a hand-writtentickets.yaml.
Known limitations
-
The consensus/planner/contracts paths are tested with fake LLMs; live gateway behavior (key rotation, model outages) is covered by
preflight --pingand the wizard’s reachability probe at setup time. -
The PDF step requires Playwright Chromium; without it the run degrades to HTML only by design (tested).
-
IMAP fetching is tested with canned RFC822 payloads and header parsing; no live mail server is exercised in the suite — verify with
orch.py mail-check.