API referenceInstance API
GUIDE & REFERENCE

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.

MethodPathOperation
GET/v1/cognitive/healthCognitive health
POST/v1/cognitive/cyclesCognitive cycle trigger
GET/v1/cognitive/cyclesCognitive cycle list
GET/v1/cognitive/cycles/:idCognitive cycle get
GET/v1/cognitive/configCognitive config get
PUT/v1/cognitive/configCognitive config update
GET/v1/cognitive/statsCognitive stats

GET /v1/cognitive/health

Cognitive health

AvailabilitySource contract
Registrationalways registered
Runtime servicecognitive
Handler dependenciesSee 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

AvailabilitySource contract
Registrationalways registered
Runtime servicecognitive
Handler dependenciesCognitive Cycle

Access: Daemon authentication and capability namespace authority; memory-domain permissions apply where mapped.

Request

JsonCognitiveRunCycleReq

FieldRust typeRequired on inputNotes
inputserde_json::ValueYes
triggerOption<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

AvailabilitySource contract
Registrationalways registered
Runtime servicecognitive
Handler dependenciesCognitive 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

AvailabilitySource contract
Registrationalways registered
Runtime servicecognitive
Handler dependenciesCognitive Cycle

Access: Daemon authentication and capability namespace authority; memory-domain permissions apply where mapped.

Request

PathString

{
  "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

AvailabilitySource contract
Registrationalways registered
Runtime servicecognitive
Handler dependenciesSee 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

AvailabilitySource contract
Registrationalways registered
Runtime servicecognitive
Handler dependenciesSee 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

Jsonserde_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

AvailabilitySource contract
Registrationalways registered
Runtime servicecognitive
Handler dependenciesCognitive 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.

On this page