Skip to content

Interface: DiagnosisCertificate

@kortexya/reasoninglayer


@kortexya/reasoninglayer / DiagnosisCertificate

Defined in: src/types/inference.ts:1214

A sealed diagnosis: compact, deterministic, and re-verifiable against its evidence.

Wire encoding, verbatim. Unlike the other SDK types, the keys are the engine’s snake_case keys: a third party re-verifies the certificate by deserializing exactly these bytes. Hashes are lowercase hex SHA-256.

Two certificates are “the same” when they seal the same derivation: compare id (content-derived), not the whole object — metadata is annotation and signature is a detached attestation.

candidate_count: number

Defined in: src/types/inference.ts:1228

How many candidates the differential returned.


derivation_root: string | null

Defined in: src/types/inference.ts:1232

Merkle root over the per-candidate derivations; null only for an empty differential.


differential_hash: string

Defined in: src/types/inference.ts:1226

Hash of the ranked differential (order-sensitive).


id: string

Defined in: src/types/inference.ts:1218

Content-derived identity (UUID): re-sealing identical evidence yields the same id.


issued_at: number

Defined in: src/types/inference.ts:1220

Issue time, Unix seconds.


kb_data_version: string

Defined in: src/types/inference.ts:1242

Ontology-data identity, in the clear (the request’s kbDataVersion, or "unattested").


knowledge_hash: string

Defined in: src/types/inference.ts:1238

Hash that binds the rule-program and ontology-data identities.


matched_count: number

Defined in: src/types/inference.ts:1234

Total antecedents witnessed across all candidates.


metadata: Record<string, string>

Defined in: src/types/inference.ts:1244

Free-form provenance (for example tenant_id, goal_sort).


observation_count: number

Defined in: src/types/inference.ts:1224

How many distinct observations were asserted.


observations_hash: string

Defined in: src/types/inference.ts:1222

Hash of the sorted, de-duplicated observations.


residuated_count: number

Defined in: src/types/inference.ts:1236

Total antecedents that residuated across all candidates.


rule_program_version: string

Defined in: src/types/inference.ts:1240

Rule-program identity, in the clear.


signature: DiagnosisCertificateSignature | null

Defined in: src/types/inference.ts:1246

Optional detached signature over the certificate’s content hash.


top_candidate: string | null

Defined in: src/types/inference.ts:1230

The rank-1 candidate, in the clear, or null for an empty differential.


version: string

Defined in: src/types/inference.ts:1216

Canonical-encoding version (currently "1.0"). It governs this encoding.