# ConceptKernel Proof Ontology
# Version: v3.6
# Date: 2026-04-06
# Purpose: OWL classes for ProofRecord, ProofCheck, ProofOutcome, and CheckType

@prefix : <https://conceptkernel.org/ontology/v3.6/> .
@prefix ckp: <https://conceptkernel.org/ontology/v3.6/> .
@prefix bfo: <http://purl.obolibrary.org/obo/BFO_> .
@prefix iao: <http://purl.obolibrary.org/obo/IAO_> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix dcterms: <http://purl.org/dc/terms/> .

<https://conceptkernel.org/ontology/v3.6/proof> a owl:Ontology ;
    dc:title "ConceptKernel Proof Ontology" ;
    dc:description "OWL classes defining proof records, proof checks, outcomes, and check types for verifiable instance integrity" ;
    dcterms:created "2026-04-06"^^xsd:date ;
    dcterms:modified "2026-04-06"^^xsd:date ;
    owl:versionInfo "v3.6" ;
    dcterms:creator "Peter Styk <peter@conceptkernel.org>" ;
    rdfs:seeAlso <https://conceptkernel.org> ;
    rdfs:seeAlso <https://github.com/ConceptKernel> ;
    rdfs:comment "Defines the proof verification structures: ProofRecord, ProofCheck, ProofOutcome, CheckType" ;
    owl:imports <https://conceptkernel.org/ontology/v3.6/> ,
                <https://conceptkernel.org/ontology/v3.6/base-instances> .

#################################################################
#    ProofRecord — verification record for a sealed instance
#################################################################

ckp:ProofRecord a owl:Class ;
    rdfs:subClassOf iao:0000027 ;  # iao:DataItem
    rdfs:label "Proof Record"@en ;
    rdfs:comment "A verification record documenting that a sealed instance has been checked for integrity, schema compliance, provenance, and structure. Stored at storage/proof/{instance_id}/proof.json."@en ;
    dc:description "Generated by TechGames.ComplianceCheck or equivalent verification kernel" .

### ProofRecord Properties

ckp:proof_id a owl:DatatypeProperty , owl:FunctionalProperty ;
    rdfs:domain ckp:ProofRecord ;
    rdfs:range xsd:string ;
    rdfs:label "proof ID"@en ;
    rdfs:comment "Unique identifier for this proof record"@en .

ckp:proofInstanceId a owl:DatatypeProperty , owl:FunctionalProperty ;
    rdfs:domain ckp:ProofRecord ;
    rdfs:range xsd:string ;
    rdfs:label "instance ID"@en ;
    rdfs:comment "The instance_id of the sealed instance that was verified"@en .

ckp:data_hash a owl:DatatypeProperty , owl:FunctionalProperty ;
    rdfs:domain ckp:ProofRecord ;
    rdfs:range xsd:string ;
    rdfs:label "data hash"@en ;
    rdfs:comment "SHA-256 hash of the instance data.json content, proving data integrity"@en .

ckp:manifest_hash a owl:DatatypeProperty , owl:FunctionalProperty ;
    rdfs:domain ckp:ProofRecord ;
    rdfs:range xsd:string ;
    rdfs:label "manifest hash"@en ;
    rdfs:comment "SHA-256 hash of the instance manifest.json content, proving manifest integrity"@en .

ckp:checks a owl:ObjectProperty ;
    rdfs:domain ckp:ProofRecord ;
    rdfs:range ckp:ProofCheck ;
    rdfs:label "checks"@en ;
    rdfs:comment "The individual proof checks that were executed as part of this proof record"@en .

ckp:outcome a owl:ObjectProperty , owl:FunctionalProperty ;
    rdfs:domain ckp:ProofRecord ;
    rdfs:range ckp:ProofOutcome ;
    rdfs:label "outcome"@en ;
    rdfs:comment "The overall outcome of the proof verification (PASS, FAIL, PARTIAL)"@en .

ckp:checked_by_kernel a owl:DatatypeProperty , owl:FunctionalProperty ;
    rdfs:domain ckp:ProofRecord ;
    rdfs:range xsd:string ;
    rdfs:label "checked by kernel"@en ;
    rdfs:comment "The kernel class name that performed the verification (e.g., TechGames.ComplianceCheck)"@en .

ckp:checked_by_identity a owl:DatatypeProperty , owl:FunctionalProperty ;
    rdfs:domain ckp:ProofRecord ;
    rdfs:range xsd:string ;
    rdfs:label "checked by identity"@en ;
    rdfs:comment "The kernel URN identity that performed the verification"@en .

ckp:checked_at a owl:DatatypeProperty , owl:FunctionalProperty ;
    rdfs:domain ckp:ProofRecord ;
    rdfs:range xsd:dateTime ;
    rdfs:label "checked at"@en ;
    rdfs:comment "ISO 8601 timestamp of when the proof verification was performed"@en .

ckp:svid a owl:DatatypeProperty , owl:FunctionalProperty ;
    rdfs:domain ckp:ProofRecord ;
    rdfs:range xsd:string ;
    rdfs:label "SVID"@en ;
    rdfs:comment "SPIFFE Verifiable Identity Document of the verifier, enabling trust chain validation. Required per spec — every ProofRecord must carry the verifier's SVID for trust chain validation."@en .

#################################################################
#    ProofCheck — individual verification check
#################################################################

ckp:ProofCheck a owl:Class ;
    rdfs:subClassOf iao:0000027 ;  # iao:DataItem
    rdfs:label "Proof Check"@en ;
    rdfs:comment "An individual verification check within a proof record. Each check validates a specific aspect of the instance (schema, SHACL, provenance, structure, integrity, operational)."@en .

### ProofCheck Properties

ckp:check_name a owl:DatatypeProperty , owl:FunctionalProperty ;
    rdfs:domain ckp:ProofCheck ;
    rdfs:range xsd:string ;
    rdfs:label "check name"@en ;
    rdfs:comment "Human-readable name of this check (e.g., 'manifest-schema', 'data-hash', 'provenance-chain')"@en .

ckp:check_type a owl:ObjectProperty , owl:FunctionalProperty ;
    rdfs:domain ckp:ProofCheck ;
    rdfs:range ckp:CheckType ;
    rdfs:label "check type"@en ;
    rdfs:comment "The category of this verification check (SCHEMA, SHACL, PROVENANCE, STRUCTURE, INTEGRITY, OPERATIONAL)"@en .

ckp:expected a owl:DatatypeProperty ;
    rdfs:domain ckp:ProofCheck ;
    rdfs:range xsd:string ;
    rdfs:label "expected"@en ;
    rdfs:comment "The expected value or condition for this check to pass"@en .

ckp:actual a owl:DatatypeProperty ;
    rdfs:domain ckp:ProofCheck ;
    rdfs:range xsd:string ;
    rdfs:label "actual"@en ;
    rdfs:comment "The actual observed value or condition during verification"@en .

ckp:passed a owl:DatatypeProperty , owl:FunctionalProperty ;
    rdfs:domain ckp:ProofCheck ;
    rdfs:range xsd:boolean ;
    rdfs:label "passed"@en ;
    rdfs:comment "Whether this individual check passed (true) or failed (false)"@en .

#################################################################
#    ProofOutcome — enumeration of verification outcomes
#################################################################

ckp:ProofOutcome a owl:Class ;
    rdfs:subClassOf bfo:0000019 ;  # bfo:Quality
    rdfs:label "Proof Outcome"@en ;
    rdfs:comment "The overall result of a proof verification. One of: PASS (all checks passed), FAIL (one or more critical checks failed), PARTIAL (some checks passed, some non-critical failed)."@en .

ckp:ProofOutcome-PASS a owl:NamedIndividual , ckp:ProofOutcome ;
    rdfs:label "PASS"@en ;
    rdfs:comment "All proof checks passed successfully"@en .

ckp:ProofOutcome-FAIL a owl:NamedIndividual , ckp:ProofOutcome ;
    rdfs:label "FAIL"@en ;
    rdfs:comment "One or more critical proof checks failed"@en .

ckp:ProofOutcome-PARTIAL a owl:NamedIndividual , ckp:ProofOutcome ;
    rdfs:label "PARTIAL"@en ;
    rdfs:comment "Some proof checks passed, some non-critical checks failed"@en .

#################################################################
#    CheckType — enumeration of verification check categories
#################################################################

ckp:CheckType a owl:Class ;
    rdfs:subClassOf bfo:0000019 ;  # bfo:Quality
    rdfs:label "Check Type"@en ;
    rdfs:comment "Category of a proof verification check. Determines what aspect of the instance is being validated."@en .

ckp:CheckType-SCHEMA a owl:NamedIndividual , ckp:CheckType ;
    rdfs:label "SCHEMA"@en ;
    rdfs:comment "JSON Schema validation of manifest.json and data.json structure"@en .

ckp:CheckType-SHACL a owl:NamedIndividual , ckp:CheckType ;
    rdfs:label "SHACL"@en ;
    rdfs:comment "SHACL shape validation against CKP ontology constraints"@en .

ckp:CheckType-PROVENANCE a owl:NamedIndividual , ckp:CheckType ;
    rdfs:label "PROVENANCE"@en ;
    rdfs:comment "PROV-O provenance chain validation (wasGeneratedBy, wasAttributedTo)"@en .

ckp:CheckType-STRUCTURE a owl:NamedIndividual , ckp:CheckType ;
    rdfs:label "STRUCTURE"@en ;
    rdfs:comment "File/folder structure validation (required files exist, naming conventions)"@en .

ckp:CheckType-INTEGRITY a owl:NamedIndividual , ckp:CheckType ;
    rdfs:label "INTEGRITY"@en ;
    rdfs:comment "Data integrity validation (SHA-256 hash verification of data and manifest)"@en .

ckp:CheckType-OPERATIONAL a owl:NamedIndividual , ckp:CheckType ;
    rdfs:label "OPERATIONAL"@en ;
    rdfs:comment "Operational validation (tool executed correctly, expected output produced)"@en .

#################################################################
#################################################################

#################################################################
#    v3.6: Additional CheckType Individuals (20 total from spec)
#################################################################

ckp:CheckType-ONTOLOGY_TYPES a owl:NamedIndividual , ckp:CheckType ;
    rdfs:label "ONTOLOGY_TYPES"@en ;
    rdfs:comment "Validates that ontology.yaml has non-empty classes: with is_a: and attributes:"@en ;
    dc:description "v3.6 addition. check.ontology_types" .

ckp:CheckType-INSTANCE_TYPING a owl:NamedIndividual , ckp:CheckType ;
    rdfs:label "INSTANCE_TYPING"@en ;
    rdfs:comment "Validates that instances in storage/ conform to ontology.yaml class definitions"@en ;
    dc:description "v3.6 addition. check.instance_typing" .

ckp:CheckType-THREE_LOOP_ISOLATION a owl:NamedIndividual , ckp:CheckType ;
    rdfs:label "THREE_LOOP_ISOLATION"@en ;
    rdfs:comment "Static analysis: tool/ code does not write to CK loop files"@en ;
    dc:description "v3.6 addition. check.three_loop_isolation" .

ckp:CheckType-EDGE_MATERIALISATION a owl:NamedIndividual , ckp:CheckType ;
    rdfs:label "EDGE_MATERIALISATION"@en ;
    rdfs:comment "Validates that edge targets exist in fleet and NATS topics resolve correctly"@en ;
    dc:description "v3.6 addition. check.edge_materialisation" .

ckp:CheckType-SHACL_VALIDITY a owl:NamedIndividual , ckp:CheckType ;
    rdfs:label "SHACL_VALIDITY"@en ;
    rdfs:comment "Validates that rules.shacl is syntactically valid SHACL"@en ;
    dc:description "v3.6 addition. check.shacl_validity" .

ckp:CheckType-CONSENSUS_PROVENANCE a owl:NamedIndividual , ckp:CheckType ;
    rdfs:label "CONSENSUS_PROVENANCE"@en ;
    rdfs:comment "Validates that AUTONOMOUS kernels have PROV-O on ontology changes"@en ;
    dc:description "v3.6 addition. check.consensus_provenance" .

ckp:CheckType-IDENTITY a owl:NamedIndividual , ckp:CheckType ;
    rdfs:label "IDENTITY"@en ;
    rdfs:comment "Validates apiVersion: conceptkernel/v3, identity fields, namespace, domain, project"@en ;
    dc:description "v3.6 addition. check.identity" .

ckp:CheckType-AWAKENING a owl:NamedIndividual , ckp:CheckType ;
    rdfs:label "AWAKENING"@en ;
    rdfs:comment "Validates that all 8 awakening files are present and non-empty"@en ;
    dc:description "v3.6 addition. check.awakening" .

ckp:CheckType-TYPES a owl:NamedIndividual , ckp:CheckType ;
    rdfs:label "TYPES"@en ;
    rdfs:comment "Validates qualities.type, governance_mode, deployment_state declared and valid"@en ;
    dc:description "v3.6 addition. check.types" .

ckp:CheckType-EDGES a owl:NamedIndividual , ckp:CheckType ;
    rdfs:label "EDGES"@en ;
    rdfs:comment "Validates that target kernel exists, predicate is valid, no duplicate edges"@en ;
    dc:description "v3.6 addition. check.edges" .

ckp:CheckType-TOOL a owl:NamedIndividual , ckp:CheckType ;
    rdfs:label "TOOL"@en ;
    rdfs:comment "Validates processor.py exists, valid Python syntax, entrypoint declared"@en ;
    dc:description "v3.6 addition. check.tool" .

ckp:CheckType-WEB a owl:NamedIndividual , ckp:CheckType ;
    rdfs:label "WEB"@en ;
    rdfs:comment "Validates index.html present if serve=true, no broken references"@en ;
    dc:description "v3.6 addition. check.web" .

ckp:CheckType-GRANTS a owl:NamedIndividual , ckp:CheckType ;
    rdfs:label "GRANTS"@en ;
    rdfs:comment "Validates grants block present with identity levels and actions declared"@en ;
    dc:description "v3.6 addition. check.grants" .

ckp:CheckType-LLM a owl:NamedIndividual , ckp:CheckType ;
    rdfs:label "LLM"@en ;
    rdfs:comment "Validates CLAUDE.md at project root (not in llm/), SKILL.md sections valid"@en ;
    dc:description "v3.6 addition. check.llm" .

#################################################################
# End of ConceptKernel Proof Ontology v3.6
#################################################################
