API Reference
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/agent-platform-feedback-contract
- Purpose: publish the bounded Dobby-owned recommendation-only feedback and iteration-loop contract
- Input: none
- Output: JSON from ../contracts/agent_platform_feedback_iteration_lane_v1.json (
contracts/agent_platform_feedback_iteration_lane_v1.json) - Important boundary:
- Fabric remains canonical owner of maturity posture
- Dobby publishes only its own advisory/materialization contract
GET /api/v1/learning/agent-platform-feedback-readback
- Purpose: materialize advisory-only feedback and iteration-loop posture from Fabric-owned maturity truth
- Input: none
- Output:
availablestateservice_modesignal_posturetarget_layer_keyopen_readbacksstale_projection_statusfabric_maturity_payload
- Fail / degraded semantics:
- returns
missing_contextwithfabric_agent_platform_feedback_truth_unavailableif canonical Fabric truth cannot be resolved
- returns
- may return
degradedwhen Fabric alignment drift is visible - never upgrades Dobby into gate, approval, or closeout authority
GET /api/v1/learning/weft-classification-feedback-contract
- Purpose: publish the bounded Dobby-owned recommendation-only contract for human-corrected Weft classification and candidate-binding outcomes
- Input: none
- Output: JSON from
../contracts/weft_classification_feedback_contract_v1.json (
contracts/weft_classification_feedback_contract_v1.json) - Important boundary:
- Weft remains the source of candidate and correction-signal posture
- Fabric remains the source of data-classification posture
- Dobby publishes only its own advisory learning contract
GET /api/v1/learning/weft-classification-feedback-readback
- Purpose: materialize advisory-only learning posture for bounded Weft classification feedback
- Input: none
- Output:
availablestateservice_modesignal_posturefeedback_eventsrequired_fieldssource_truth_payloadopen_readbacksstale_projection_status
- Fail / degraded semantics:
- returns
missing_contextwithweft_classification_feedback_truth_unavailableif canonical Weft or Fabric truth cannot be resolved - may return
degradedwhen Fabric alignment drift is visible - never upgrades Dobby into business-truth, closeout, or record authority
- returns
GET /api/v1/learning/crm-recommendation-signal-contract
- Purpose: publish the bounded Dobby-owned recommendation-only contract for CRM signal consumption and customization exception advisories
- Input: none
- Output: JSON from
../contracts/crm_recommendation_signal_contract_v1.json (
contracts/crm_recommendation_signal_contract_v1.json)
GET /api/v1/learning/crm-recommendation-signal-readback
- Purpose: materialize advisory-only learning posture for bounded CRM recommendation signals and repeated customization exception patterns
- Input: none
- Output:
availablestateservice_modesignal_postureallowed_inputsrequired_fieldssource_truth_payloadopen_readbacksstale_projection_status
- Fail / degraded semantics:
- returns
missing_contextwithcrm_recommendation_signal_truth_unavailableif canonical Spindle or Fabric truth cannot be resolved - may return
degradedwhen Fabric alignment drift is visible - never upgrades Dobby into CRM, ERP, approval, or customization truth authority
- returns
GET /api/v1/learning/semantic-context-knowledge-contract
- Purpose: publish the bounded Dobby-owned recommendation-only contract for semantic context, source, budget, ontology, and knowledge-pack improvement proposals
- Input: none
- Output: JSON from
../contracts/semantic_context_knowledge_improvement_contract_v1.json (
contracts/semantic_context_knowledge_improvement_contract_v1.json) - Important boundary:
- Fabric remains the source of admission, activation, and semantic-plan truth
- Bobbin remains the source of semantic projection and context-assembly truth
- Dobby publishes only its own advisory improvement contract
GET /api/v1/learning/semantic-context-knowledge-readback
- Purpose: materialize advisory-only learning posture for bounded semantic context and knowledge-improvement proposals
- Input: none
- Output:
availablestateservice_modesignal_postureproposal_classesrequired_controlsforbidden_authoritiesowner_boundariessource_truth_payloadopen_readbacksstale_projection_status
- Fail / degraded semantics:
- returns
missing_contextwithsemantic_context_knowledge_improvement_truth_unavailableif canonical Fabric semantic-plan truth cannot be resolved - may return
degradedwhen Fabric alignment drift is visible - never upgrades Dobby into truth, admission, activation, or context-delivery authority
- returns
GET /api/v1/learning/readiness
- Purpose: versioned readiness surface for internal consumers
- Input: none
- Output: same readiness model as
/ready
GET /api/v1/learning/promotion-state-machine-contract
- Purpose: publish the Dobby-owned promotion state machine as a versioned contract for Fabric, Warp, and Pattern consumers
- Output:
contracts/promotion_state_machine_contract_v1.json - Authority semantics:
- Dobby owns proposal lifecycle state and recommendation-only learning posture
- Fabric remains contract-family admission and gate truth
- Warp remains approval truth owner
- Pattern remains work-item and wave truth owner
- Fail / degraded semantics:
- consumers must fail closed when this contract is missing or does not validate
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 as Prometheus text exposition
- Media type:
text/plain - Format: one sample per line as
metric_name valueormetric_name{label="value"} value - Output:
- adaptive-learning counters and gauges
dobby_service_modedobby_persistence_readydobby_metrics_degradedwhen applicable- logical queue gauges such as
dobby_queue_depth_intake,dobby_queue_depth_replay, anddobby_queue_depth_promotion - budget gauges such as
dobby_replay_budget_remaininganddobby_promotion_velocity_remaining
- Fail / degraded semantics:
- Persistence unavailable still returns HTTP
200with bounded degraded metrics - degraded output includes
dobby_persistence_ready 0anddobby_metrics_degraded 1 - does not invent values from any shadow truth
- queue depth metrics are logical runtime indicators, not a broker queue view
- Persistence unavailable still returns HTTP
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.