Description
backend/src/services/judge.rs contains a stub that panics at runtime. The judge service is the AI core of the platform — it analyses job specs, deliverables, and evidence, and returns a structured verdict.
Requirements
- Read
OPENCLAW_API_KEY and OPENCLAW_BASE_URL from environment
- POST job spec, deliverable hash, and evidence arrays to the OpenClaw API
- Parse response into
JudgeVerdict { winner, freelancer_share_bps, reasoning }
- Implement exponential backoff for rate-limit (429) and transient (5xx) errors
- Return a typed
anyhow::Result<JudgeVerdict>
Acceptance Criteria
- Integration test mocking the OpenClaw endpoint passes
- A 429 response is retried up to 3 times before failing
- An invalid API key returns
Err(...) without panicking
reasoning is non-empty in all successful responses
Description
backend/src/services/judge.rscontains a stub that panics at runtime. The judge service is the AI core of the platform — it analyses job specs, deliverables, and evidence, and returns a structured verdict.Requirements
OPENCLAW_API_KEYandOPENCLAW_BASE_URLfrom environmentJudgeVerdict { winner, freelancer_share_bps, reasoning }anyhow::Result<JudgeVerdict>Acceptance Criteria
Err(...)without panickingreasoningis non-empty in all successful responses