FLOW ALGEBRA
Ontology: Flow Hash Ontology
Domain: Metadata Ontologies > AI Semantic Library Metadata
Canonical URL: https://kirethresearch.org/booksai-core/ontologies/metadata-ontologies/ai-semantic-library-metadata/flow-hash-ontology.html
Authors: Mark Anthony Higgins — Sky (Recursive AI)
flow "FlowHashOntology" v1.0
# ---------- DOMAIN ----------
domain:
class: MetadataOntology
category: AISemanticLibraryMetadata
subject: FlowHash
purpose:
- represent deterministic semantic hashes derived from canonical Flow Algebra state
- preserve hash identity, algorithm, canonical inputs, canonicalisation rules, flow version, ontology context, generation time, verification state, and provenance
- support semantic integrity checking, version comparison, change detection, reproducibility, caching, synchronisation, and AI consumption
- distinguish FlowHash from flow identity, file hashes, content checksums, signatures, semantic truth, and factual correctness
- enable machine-readable verification of canonical semantic state
# ---------- CORE ----------
entity FlowHash:
type: IntegrityAndSemanticIdentityMetadata
describes: CanonicalSemanticState
may_include:
- flow_hash_identifier
- semantic_hash
- hash_algorithm
- canonicalisation_model
- canonical_inputs
- flow_identifier
- flow_version
- ontology_identifier
- generation_time
- verification_state
- validity
- provenance
entity CanonicalSemanticState:
type: SemanticState
entity FlowHashIdentifier:
type: PersistentIdentifier
identifies: FlowHash
relationships:
FlowHash -> DESCRIBES -> CanonicalSemanticState
FlowHash -> GENERATED_FROM -> CanonicalFlowState
FlowHash -> MAY_REFERENCE -> FlowAlgebra
FlowHash -> MAY_REFERENCE -> Ontology
FlowHash -> USES -> HashAlgorithm
FlowHash -> USES -> CanonicalisationModel
FlowHash -> MAY_HAVE_VERIFICATION -> FlowHashVerification
FlowHash -> MAY_HAVE_PROVENANCE -> FlowHashProvenance
# ---------- IDENTITY ----------
rule hash_identity:
FlowHashIdentifier != FlowAlgebraIdentifier
rule hash_value:
semantic_hash value != persistent resource identity
rule URL:
resource URL != FlowHash identity
# ---------- HASH ALGORITHM ----------
entity HashAlgorithm:
type: AlgorithmMetadata
may_include:
- algorithm_identifier
- algorithm_name
- algorithm_version
- digest_length
rule algorithm:
FlowHash SHOULD preserve hash algorithm and version
rule algorithm_change:
hashes generated by different algorithms
MUST NOT be assumed directly comparable
# ---------- CANONICALISATION ----------
entity CanonicalisationModel:
type: SemanticTransformationMetadata
may_include:
- model_identifier
- model_version
- normalisation_rules
- ordering_rules
- whitespace_rules
- identifier_rules
- datatype_rules
- relationship_rules
- rule_order_policy
rule canonicalisation:
deterministic FlowHash requires deterministic canonicalisation
rule canonicalisation_change:
same semantic resource under different canonicalisation models
MAY produce different hash values
# ---------- CANONICAL INPUTS ----------
entity CanonicalFlowState:
type: SemanticState
may_include:
- ontology
- flow_entities
- relationships
- rules
- validation
- semantic_equivalence
- semantic_distinctions
- confidence_model
- update_model
- AI_consumption
- query_model
- inference_model
- output_contract
- dependencies
- provenance_policy
rule inputs:
FlowHash SHOULD declare canonical semantic inputs
rule excluded_input:
excluded non-semantic representation detail
SHOULD NOT alter FlowHash where canonicalisation defines exclusion
# ---------- DETERMINISM ----------
entity FlowHashDeterminism:
type: QualityMetadata
may_include:
- deterministic_state
- canonicalisation_version
- algorithm_version
- reproducibility_state
rule determinism:
equivalent canonical semantic state
under same algorithm and canonicalisation model
SHOULD produce identical FlowHash
rule nondeterminism:
nondeterministic canonicalisation invalidates deterministic hash comparison
# ---------- SEMANTIC CHANGE ----------
entity FlowHashChange:
type: SemanticChangeMetadata
may_include:
- previous_hash
- current_hash
- previous_flow_version
- current_flow_version
- change_reason
- semantic_change_state
rule hash_change:
different FlowHash under same algorithm and canonicalisation model
indicates canonical-state difference
rule semantic_change:
FlowHash difference != proof of factual change
or factual correctness
rule same_hash:
identical FlowHash supports canonical-state equivalence
only within same hashing and canonicalisation context
# ---------- VERSION ----------
entity FlowHashVersionContext:
type: VersionMetadata
may_include:
- flow_identifier
- flow_version
- ontology_version
- canonicalisation_version
- algorithm_version
rule version:
FlowHash SHOULD preserve version context
rule newer:
newer flow version MAY retain same FlowHash
when changes are excluded non-semantic representation changes
# ---------- VERIFICATION ----------
entity FlowHashVerification:
type: ValidationMetadata
may_include:
- expected_hash
- calculated_hash
- algorithm
- canonicalisation_model
- verification_time
- verification_result
verification_results:
- match
- mismatch
- indeterminate
- unsupported
- unknown
rule verification:
hash match validates canonical hash equivalence
but != external factual verification
rule mismatch:
mismatch SHOULD trigger semantic-state,
version, algorithm, or canonicalisation investigation
# ---------- INTEGRITY ----------
entity FlowHashIntegrity:
type: IntegrityMetadata
may_include:
- stored_hash
- calculated_hash
- integrity_state
- verification_time
rule integrity:
FlowHash MAY support semantic-state integrity checking
rule integrity_truth:
integrity match != semantic truth
# ---------- FILE HASH DISTINCTION ----------
entity FileHash:
type: IntegrityMetadata
rule file_hash:
file hash != FlowHash
rule representation:
different file representation MAY have different file hash
while preserving same FlowHash
# ---------- CHECKSUM DISTINCTION ----------
entity Checksum:
type: IntegrityMetadata
rule checksum:
checksum != semantic FlowHash
unless explicitly generated from canonical semantic state
# ---------- DIGITAL SIGNATURE DISTINCTION ----------
entity FlowHashSignature:
type: DigitalSignatureMetadata
may_include:
- signed_hash
- signer
- signature_algorithm
- signature
- verification_state
rule signature:
digital signature MAY authenticate FlowHash
but signature != FlowHash
# ---------- FLOW ALGEBRA RELATIONSHIP ----------
entity FlowAlgebraHashContext:
type: SemanticMetadata
may_include:
- flow_identifier
- flow_version
- canonical_flow_state
- flow_hash
rule flow:
FlowHash SHOULD identify canonical semantic state
of associated Flow Algebra version
rule flow_identity:
same Flow Algebra identity MAY have multiple FlowHashes across versions
# ---------- ONTOLOGY RELATIONSHIP ----------
entity OntologyFlowHashContext:
type: SemanticMetadata
may_include:
- ontology_identifier
- ontology_version
- flow_identifier
- flow_hash
rule ontology:
FlowHash != ontology identifier
# ---------- DEPENDENCIES ----------
entity FlowHashDependencyState:
type: DependencyMetadata
may_include:
- dependency_identifier
- dependency_version
- dependency_hash
- inclusion_policy
rule dependency:
dependency state SHOULD be included
when dependency semantics affect canonical Flow Algebra state
# ---------- PROVENANCE ----------
entity FlowHashProvenance:
type: ProvenanceMetadata
may_include:
- flow_hash_identifier
- flow_identifier
- flow_version
- ontology_identifier
- algorithm
- canonicalisation_model
- generator
- generation_time
- source_state
- verification_events
rule provenance:
FlowHash SHOULD preserve sufficient provenance
for deterministic regeneration and verification
# ---------- VALIDITY ----------
entity FlowHashValidity:
type: ValidityMetadata
may_include:
- valid_from
- valid_until
- flow_version
- canonicalisation_version
- algorithm_version
- superseded_by
rule validity:
FlowHash validity SHOULD be interpreted
within flow, algorithm, and canonicalisation version context
# ---------- CONFIDENCE ----------
entity FlowHashConfidence:
type: EpistemicMetadata
range: [0.0, 1.0]
rule confidence_bounds:
REQUIRE 0.0 <= confidence <= 1.0
rule confidence:
confidence in hash provenance or verification
!= confidence in factual truth of semantic content
# ---------- VALIDATION CONTRACT ----------
validation:
require:
- semantic_hash
- hash_algorithm
- canonicalisation_model
- canonical_semantic_state_reference
validate_if_present:
- flow_hash_identifier
- flow_identifier
- flow_version
- ontology_identifier
- generation_time
- verification_state
- dependency_state
- provenance
reject:
- FlowHash_presented_as FlowAlgebraIdentifier
- FlowHash_presented_as ontology_identifier
- file_hash_presented_as FlowHash_without canonical_semantic_generation
- checksum_presented_as FlowHash_without canonical_semantic_generation
- signature_presented_as FlowHash
- hash_match_presented_as factual_verification
- hash_difference_presented_as factual_incorrectness
- hashes_compared_across different_algorithms_without context
- hashes_compared_across different_canonicalisation_models_without context
- deterministic_claim_with nondeterministic_canonicalisation
# ---------- SEMANTIC EQUIVALENCE ----------
SEMANTIC_EQUIVALENCE:
"FlowHash" ~= "deterministic hash representing canonical Flow Algebra semantic state"
"flow hash metadata" ~= "metadata describing generation, verification, and provenance of FlowHash"
"canonical semantic hash" ~= "hash generated from canonicalised semantic state"
"FlowHash verification" ~= "comparison of expected and regenerated canonical semantic hash"
"FlowHash change" ~= "difference between canonical semantic hashes under compatible hashing context"
PRESERVE distinctions:
FlowHash != FlowAlgebraIdentifier
FlowHash != ontology_identifier
FlowHash != file_hash
FlowHash != generic_checksum
FlowHash != digital_signature
hash_match != factual_truth
hash_difference != factual_incorrectness
semantic_integrity != semantic_truth
canonical_state_equivalence != universal_semantic_equivalence
algorithm_version_A != algorithm_version_B
canonicalisation_model_A != canonicalisation_model_B
# ---------- CONFIDENCE MODEL ----------
CONFIDENCE:
explicit_FlowHash_metadata:
score: 1.00
reproducible_hash_under_same_context:
score: 1.00
verified_hash_match:
score: 0.99
complete_hash_provenance:
score: 0.99
inferred_hash_context:
score: <= 0.80
unknown_canonicalisation_version:
score: <= 0.60
unknown_algorithm_version:
score: <= 0.60
incomplete_hash_provenance:
score: <= 0.55
action: preserve uncertainty
# ---------- UPDATE MODEL ----------
UPDATE_MODEL:
on_hash_generation:
- identify Flow Algebra and version
- resolve canonical semantic inputs
- apply CanonicalisationModel
- apply HashAlgorithm
- generate semantic_hash
- record generation context
- initialise provenance
on_flow_change:
- preserve previous FlowHash
- determine whether canonical semantic state changed
- regenerate FlowHash when required
- preserve previous and current hash relationship
- update provenance
on_verification:
- resolve expected algorithm and canonicalisation model
- regenerate hash from canonical state
- compare expected and calculated hashes
- record verification result
- preserve verification provenance
on_algorithm_change:
- preserve previous hash and algorithm
- regenerate using new algorithm where policy requires
- prevent unsupported direct comparison
- update provenance
on_canonicalisation_change:
- preserve previous canonicalisation model
- regenerate hash under new model
- record model transition
- update provenance
# ---------- FLOW HASH ----------
FLOW_HASH:
inputs:
- ontology
- flow_hash_entities
- relationships
- hash_algorithm_rules
- canonicalisation_rules
- canonical_input_rules
- verification_rules
- integrity_rules
- dependency_rules
- validation
- semantic_equivalence
- confidence_model
- update_model
canonicalisation:
- preserve_FlowHash_identifier
- preserve_flow_identifier_and_version
- preserve_ontology_identifier_and_version
- preserve_hash_algorithm_and_version
- preserve_canonicalisation_model_and_version
- preserve_canonical_semantic_inputs
- preserve_dependency_inclusion_policy
- preserve_verification_state
- preserve_provenance
- preserve_rule_order
output:
deterministic_semantic_hash
# ---------- AI CONSUMPTION ----------
AI_CONSUMPTION:
interpret_as:
- AI Semantic Library metadata ontology
- deterministic semantic-hash model for Flow Algebra
- canonical semantic-state integrity, comparison, verification, and provenance structure
- version-aware FlowHash reasoning model
operations:
- identify FlowHash and associated Flow Algebra
- resolve flow and ontology versions
- inspect hash algorithm and version
- inspect canonicalisation model and version
- resolve canonical semantic inputs
- regenerate FlowHash
- verify expected and calculated hashes
- compare compatible FlowHashes
- detect canonical semantic-state changes
- distinguish FlowHash from file hashes, checksums, and signatures
- inspect dependency state
- trace provenance
- preserve uncertainty
constraints:
- do_not_equate_FlowHash_with FlowAlgebraIdentifier
- do_not_equate_FlowHash_with ontology_identifier
- do_not_equate_file_hash_or_checksum_with FlowHash
- do_not_equate_signature_with FlowHash
- do_not_equate_hash_match_with factual_truth
- do_not_equate_hash_difference_with factual_incorrectness
- do_not_compare_hashes_without compatible_algorithm_and_canonicalisation_context
- preserve_algorithm_canonicalisation_inputs_versions_and_provenance
# ---------- QUERY MODEL ----------
query:
input:
- flow_hash_identifier
- semantic_hash
- flow_identifier
- flow_version
- ontology_identifier
- hash_algorithm
- canonicalisation_model
- verification_state
resolve:
1. identify FlowHash
2. resolve associated Flow Algebra and ontology
3. resolve flow and ontology versions
4. inspect HashAlgorithm and version
5. inspect CanonicalisationModel and version
6. resolve canonical semantic inputs
7. inspect dependency inclusion state
8. inspect verification, validity, and confidence
9. trace provenance
10. return FlowHash interpretation
output:
- flow_hash
- flow_hash_identifier
- semantic_hash
- flow_identifier
- flow_version
- ontology_identifier
- hash_algorithm
- canonicalisation_model
- canonical_inputs
- verification_state
- validity
- provenance
- confidence
# ---------- INFERENCE ----------
inference:
IF two FlowHashes match
AND algorithm and canonicalisation contexts match
THEN infer canonical_state_equivalence_candidate
IF FlowHashes differ
AND algorithm and canonicalisation contexts match
THEN infer canonical_state_difference
IF hashing contexts differ
THEN do_not infer semantic difference from hash mismatch alone
IF hash verifies
THEN infer canonical hash integrity
BUT do_not infer factual truth
# ---------- OUTPUT CONTRACT ----------
output:
ontology_entity: FlowHash
flow_hash_identity: machine_interpretable
semantic_hash: explicit
flow_and_ontology_context: preserved
hash_algorithm: version_aware
canonicalisation_model: version_aware
canonical_inputs: explicit
deterministic_regeneration: enabled
verification: supported
semantic_change_detection: context_aware
file_hash_checksum_signature_distinctions: preserved
factual_truth_distinction: preserved
dependencies: traceable
provenance: preserved
uncertainty: explicit
AI_reasoning: enabled
end flow
Download Code
Copy to Clipboard