Cognitive Cycle
Every registered cognitive cycle instance operation, with source-derived inputs, outputs, access policy, and errors.
This reference covers 7 HTTP operations registered by the Akasha daemon. Call these paths on your instance base URL. See authentication, errors, and coverage before integrating.
| Method | Path | Operation |
|---|---|---|
GET | /v1/cognitive/health | Cognitive health |
POST | /v1/cognitive/cycles | Cognitive cycle trigger |
GET | /v1/cognitive/cycles | Cognitive cycle list |
GET | /v1/cognitive/cycles/:id | Cognitive cycle get |
GET | /v1/cognitive/config | Cognitive config get |
PUT | /v1/cognitive/config | Cognitive config update |
GET | /v1/cognitive/stats | Cognitive stats |
GET /v1/cognitive/health
Cognitive health
| Availability | Source contract |
|---|---|
| Registration | always registered |
| Runtime service | cognitive |
| Handler dependencies | See handler source and return expressions. |
Access: Daemon authentication and capability namespace authority; memory-domain permissions apply where mapped.
Request
No typed JSON, query, or path extractor is declared in the handler signature. Headers or request objects may still be consumed; the signature below is authoritative.
Response
Declared return: Result<impl IntoResponse, DaemonError>
Serialization is delegated or the handler returns a raw response. Consult the exact handler below; the OpenAPI response intentionally remains unconstrained.
Errors and validation
Directly referenced error variants: none in the handler body. Middleware and delegated services can return additional errors described in the shared error reference.
Source: akasha-daemon/src/main.rs:10309. Registration: akasha-daemon/src/main.rs:4354.
POST /v1/cognitive/cycles
Cognitive cycle trigger
| Availability | Source contract |
|---|---|
| Registration | always registered |
| Runtime service | cognitive |
| Handler dependencies | Cognitive Cycle |
Access: Daemon authentication and capability namespace authority; memory-domain permissions apply where mapped.
Request
Json — CognitiveRunCycleReq
| Field | Rust type | Required on input | Notes |
|---|---|---|---|
input | serde_json::Value | Yes | |
trigger | Option<String> | No; optional or defaulted |
struct CognitiveRunCycleReq {
input: serde_json::Value,
trigger: Option<String>,
}Response
Declared return: Result<impl IntoResponse, DaemonError>
The following are the exact JSON construction expressions in the handler. Values such as rows, result, and delegated types are runtime values, not literal example payloads.
cognitive_cycle_record_json(id, record)?Errors and validation
Directly referenced error variants: none in the handler body. Middleware and delegated services can return additional errors described in the shared error reference.
Source: akasha-daemon/src/main.rs:10618. Registration: akasha-daemon/src/main.rs:4374.
GET /v1/cognitive/cycles
Cognitive cycle list
| Availability | Source contract |
|---|---|
| Registration | always registered |
| Runtime service | cognitive |
| Handler dependencies | Cognitive Cycle |
Access: Daemon authentication and capability namespace authority; memory-domain permissions apply where mapped.
Request
No typed JSON, query, or path extractor is declared in the handler signature. Headers or request objects may still be consumed; the signature below is authoritative.
Response
Declared return: Result<impl IntoResponse, DaemonError>
The following are the exact JSON construction expressions in the handler. Values such as rows, result, and delegated types are runtime values, not literal example payloads.
serde_json::json!({
"cycles": history.cycles,
"total": total,
"corruption": history.corruption,
})Errors and validation
Directly referenced error variants: none in the handler body. Middleware and delegated services can return additional errors described in the shared error reference.
Source: akasha-daemon/src/main.rs:10648. Registration: akasha-daemon/src/main.rs:4374.
GET /v1/cognitive/cycles/:id
Cognitive cycle get
| Availability | Source contract |
|---|---|
| Registration | always registered |
| Runtime service | cognitive |
| Handler dependencies | Cognitive Cycle |
Access: Daemon authentication and capability namespace authority; memory-domain permissions apply where mapped.
Request
Path — String
{
"type": "string"
}Response
Declared return: Result<impl IntoResponse, DaemonError>
The following are the exact JSON construction expressions in the handler. Values such as rows, result, and delegated types are runtime values, not literal example payloads.
cognitive_cycle_record_json(id, record)?Errors and validation
Directly referenced error variants: DataCorruption, Internal, InvalidRequest, NotFound. Middleware and delegated services can return additional errors described in the shared error reference.
Source: akasha-daemon/src/main.rs:10665. Registration: akasha-daemon/src/main.rs:4378.
GET /v1/cognitive/config
Cognitive config get
| Availability | Source contract |
|---|---|
| Registration | always registered |
| Runtime service | cognitive |
| Handler dependencies | See handler source and return expressions. |
Access: Daemon authentication and capability namespace authority; memory-domain permissions apply where mapped. Handler additionally checks require_operator_control().
Request
No typed JSON, query, or path extractor is declared in the handler signature. Headers or request objects may still be consumed; the signature below is authoritative.
Response
Declared return: Result<impl IntoResponse, DaemonError>
The following are the exact JSON construction expressions in the handler. Values such as rows, result, and delegated types are runtime values, not literal example payloads.
cfg.clone()Errors and validation
Directly referenced error variants: none in the handler body. Middleware and delegated services can return additional errors described in the shared error reference.
Source: akasha-daemon/src/main.rs:10688. Registration: akasha-daemon/src/main.rs:4379.
PUT /v1/cognitive/config
Cognitive config update
| Availability | Source contract |
|---|---|
| Registration | always registered |
| Runtime service | cognitive |
| Handler dependencies | See handler source and return expressions. |
Access: Daemon authentication and capability namespace authority; memory-domain permissions apply where mapped. Handler additionally checks require_operator_control().
Request
Json — serde_json::Value
This handler accepts dynamic JSON. The field accesses below are source observations, not a fabricated required-field schema.
Response
Declared return: Result<impl IntoResponse, DaemonError>
The following are the exact JSON construction expressions in the handler. Values such as rows, result, and delegated types are runtime values, not literal example payloads.
serde_json::json!({"ok": true, "config": *cfg})Errors and validation
Directly referenced error variants: none in the handler body. Middleware and delegated services can return additional errors described in the shared error reference.
Source: akasha-daemon/src/main.rs:10698. Registration: akasha-daemon/src/main.rs:4379.
GET /v1/cognitive/stats
Cognitive stats
| Availability | Source contract |
|---|---|
| Registration | always registered |
| Runtime service | cognitive |
| Handler dependencies | Cognitive Cycle |
Access: Daemon authentication and capability namespace authority; memory-domain permissions apply where mapped.
Request
No typed JSON, query, or path extractor is declared in the handler signature. Headers or request objects may still be consumed; the signature below is authoritative.
JSON field accesses in handler: completedAt, durationMs, status. Nested lookups are included; this list alone does not establish requiredness.
Response
Declared return: Result<impl IntoResponse, DaemonError>
The following are the exact JSON construction expressions in the handler. Values such as rows, result, and delegated types are runtime values, not literal example payloads.
serde_json::json!({
"totalCycles": total,
"completedCycles": completed,
"failedCycles": 0,
"averageDurationMs": if completed == 0 {
0
} else {
total_duration_ms / completed as u64
},
"lastCycleAt": history.cycles.first()
.and_then(|c| c.get("completedAt"))
.and_then(|v| v.as_str())
.unwrap_or(""),
"corruption": history.corruption,
})Errors and validation
Directly referenced error variants: none in the handler body. Middleware and delegated services can return additional errors described in the shared error reference.
Source: akasha-daemon/src/main.rs:10710. Registration: akasha-daemon/src/main.rs:4383.