Skip to main content

Sub-Phase 1.4: Failure Hardening

Handle all failure scenarios gracefully.

Objective

Must handle:

  • Ethos down, Talent up
  • Talent unauthorized, Ethos up
  • Both unavailable
  • Wallet exists in neither

Rules:

  • Never fabricate defaults
  • Never hide absence
  • Never throw on valid input

Analysis Result

The implementation from Sub-Phases 1.1-1.3 ALREADY SATISFIES Phase 1.4 requirements.

No code changes are required. This document formally verifies compliance.

Scenario Verification

Scenario 1: Ethos down, Talent up

ComponentBehaviorStatus
fetchEthosProfileHTTP failure → { availability: 'error' }
Promise.allSettledDoes not block Talent call
Output{ availability: { ethos: 'error', talent: 'available' }, talent: {...} }

Scenario 2: Talent unauthorized (401), Ethos up

ComponentBehaviorStatus
fetchTalentScore401 response → { availability: 'error' }
Promise.allSettledDoes not block Ethos call
Output{ availability: { ethos: 'available', talent: 'error' }, ethos: {...} }

Scenario 3: Both unavailable

ComponentBehaviorStatus
fetchEthosProfileReturns { availability: 'error' } independently
fetchTalentScoreReturns { availability: 'error' } independently
Output{ availability: { ethos: 'error', talent: 'error' } }

Scenario 4: Wallet exists in neither

ComponentBehaviorStatus
EthosEmpty array → { availability: 'not_found' }
TalentReturns points: 0{ availability: 'available' }
Output{ availability: { ethos: 'not_found', talent: 'available' }, talent: {...} }

Rule Compliance

RuleStatusEvidence
Never fabricate defaultsMeta fields use null when unknown
Never hide absenceAvailability always explicit
Never throw on valid inputTry/catch in repositories, Promise.allSettled in use case

Output Examples

Ethos Error, Talent Available

{
"identity": { "address": "0xabc..." },
"availability": { "ethos": "error", "talent": "available" },
"talent": {
"data": { "builderScore": 85 },
"signals": { "verifiedBuilder": true },
"meta": { "lastUpdatedAt": "2024-01-15T10:30:00Z" }
}
}

Both Error

{
"identity": { "address": "0xabc..." },
"availability": { "ethos": "error", "talent": "error" }
}

Exit Checklist

Failure Scenarios

  • Ethos down, Talent up → handled
  • Talent unauthorized (401), Ethos up → handled
  • Both unavailable → handled
  • Wallet exists in neither → handled

Rule Compliance

  • Never fabricate defaults → uses null for unknown values
  • Never hide absence → availability always explicit
  • Never throw on valid input → try/catch + Promise.allSettled

Architecture

  • Repositories return result objects, never throw
  • Use case handles all failure states gracefully
  • Parallel execution with independent failure handling