API
Documentation Map
-
API Reference
-
Channel:
latest -
Source repo:
JaddaHelpifyr/jhf-dobby
API And Endpoint Behavior
Tool / Contract Summary
This page documents the actual FastAPI routes exposed by jhf-dobby. Route ownership lives in src/jhf_dobby/api/routes.py (src/jhf_dobby/api/routes.py). The API publishes Dobby-owned state and consumes Fabric/Warp/Shuttle truth through internal service layers.
Business Value
- gives operators and other stack services a stable runtime surface for adaptive-learning state
- exposes degraded/fail-closed behavior explicitly instead of hiding failures
- keeps route documentation aligned with the code and manifest
Current Verified State
Available now:
- all routes listed in
fabric-manifest.json - live verification against the service on
<internal-runtime-redacted>:18096 - bounded degraded behavior for
/readyand/metricsunder persistence loss
Planned / not in current scope:
- route-level auth enforcement inside the app
- additional versioned API namespaces beyond
/api/v1
Public Surfaces
GET /health
- Purpose: low-cost liveness probe
- Input: none
- Output:
{"status":"ok","service":"jhf-dobby"} - Degraded behavior: none; this route stays available even when other subsystems are unhealthy
GET /ready
- Purpose: service readiness summary
- Input: none
- Output:
- overall status
- effective service mode
- Fabric alignment object
- queue-depth view
- backpressure flag
- human-readable detail
- Fail / degraded semantics:
- returns
degradedwhen Fabric is unavailable - returns
degradedand forceswarmupwhen persistence is unavailable - does not hang on bounded persistence failure
- returns
GET /version
- Purpose: expose repo runtime version and current mode
- Input: none
- Output: version string plus effective service mode
GET /fabric-manifest.json
- Purpose: publish repo/runtime metadata as shipped with the service
- Input: none
- Output: JSON manifest document from fabric-manifest.json (
fabric-manifest.json) - Note: this is Dobby metadata, not Fabric governance truth
GET /api/v1/learning/contracts
- Purpose: publish Dobby's derived contract status
- Input: none
- Output:
- service modes
- promotion states
- producer families
- consumer families
- invariants
- no-learn zones
- target types
- Important boundary:
- producer/consumer family values come from Fabric matrix consumption
- Dobby does not define family truth locally
GET /api/v1/learning/readiness
- Purpose: versioned readiness surface for internal consumers
- Input: none
- Output: same readiness model as
/ready
POST /api/v1/learning/signals/intake
- Purpose: ingest a trace into Dobby learning state
- Important inputs:
tenant_reftrace_idcorrelation_idoutcomeguardrail_decisionfamily_version_set
- Important outputs:
run_idstatesignal_emittedrun_hashpriority_scoreprovenance_hashsampled_in
- Fail / block semantics:
422on tenant inconsistency422onBLOCK422on security-critical traces
POST /api/v1/learning/replay/evaluate
- Purpose: evaluate a replay candidate against a threshold contract
- Important inputs:
- target type/id
- threshold contract
- baseline and candidate metrics
- workload similarity flag
- Important outputs:
replay_idcandidate_hashprovenance_hash- verdict
- threshold pass flag
- Fail / block semantics:
422on disabledweight_training_candidate422on replay budget exhaustion
POST /api/v1/learning/replay/propose-from-evidence
- Purpose: bind a signal-emitting run record to a deterministic replay comparison and create a governed proposal in one owner-scoped loop
- Important inputs:
run_id- target type/id
current_decisioncandidate_decision- replay metrics and threshold contract
- baseline validity window
- Important outputs:
run_idreplay_idproposal_id- replay candidate/provenance hashes
- deterministic
decision_delta_hash - resulting proposal state
- Fail / block semantics:
422when the source run is missing or did not emit a signal422when current and candidate decisions are identical422when source evidence or baseline validity is stale422when replay rejects the candidate503when persistence is unavailable
POST /api/v1/learning/promotions/propose
- Purpose: create a promotion proposal from replay evidence
- Important inputs:
- service mode
- risk class
- replay verdict
- no-learn/security flags
- target info
- Important outputs:
proposal_id- candidate/provenance hashes
- proposal state
revalidate_requiredoscillation_detected
- Fail / block semantics:
422inwarmuporobserve_only422on blocked target/risk combinations
POST /api/v1/learning/promotions/approve-check
- Purpose: bind a proposal to the canonical Warp approval lane
- Important inputs:
proposal_idapproval_id
- Important outputs:
- proposal state after Warp evaluation
- policy approval flag
- human approval flag
- stale invalidation flag
- Fail / block semantics:
422if proposal does not exist or state transition is invalid- fail-closed when Warp is missing, stale, mismatched, or unavailable
POST /api/v1/learning/promotions/activate
- Purpose: activate a Dobby-owned runtime change
- Important inputs:
proposal_id- activation idempotency key
- Important outputs:
- new proposal state
runtime_state_beforeruntime_state_after
- Fail / block semantics:
422if service mode is not effectivelypromotion_enabled422if approvals are missing422if a conflicting active candidate exists422if the promotion velocity breaker is active
POST /api/v1/learning/promotions/rollback
- Purpose: roll back an activated proposal
- Important inputs:
proposal_id- rollback idempotency key
- reason
- Important outputs:
- final state
rollback_restored
- Fail / block semantics:
422if the proposal is not currently activated
GET /api/v1/learning/runs/{run_id}
- Purpose: fetch durable run state
- Output: stored run record view
- Fail semantics:
404if not found
GET /api/v1/learning/proposals/{proposal_id}
- Purpose: fetch durable proposal state
- Output: stored proposal view
- Fail semantics:
404if not found
GET /metrics
- Purpose: export runtime counters and gauges
- Output:
- adaptive-learning counters and gauges
dobby_service_modedobby_persistence_readydobby_metrics_degradedwhen applicable
- Fail / degraded semantics:
- returns bounded degraded metrics output when persistence is unavailable
- does not invent values from any shadow truth
Contract Families
- Consumer families come from Fabric matrix consumption
- Producer families come from Fabric matrix consumption
- Route consumers should treat
/api/v1/learning/contractsas a derived view, not a source-of-truth contract registry
Known Limits
- no OpenAPI-specific handwritten guide in the repo
- no dedicated auth middleware
- no pagination or search routes for stored runs/proposals
Related Issues
jhf-dobby#30jhf-dobby#31jhf-dobby#32jhf-dobby#36jhf-dobby#48jhf-dobby#46jhf-dobby#49
License: AGPLv3. See ../LICENSE (LICENSE).
Learn more at helpifyr.com.