Orchestrata Ultimate › Tests › Reference › knowledge_graph › test_canonical_schema_completeness

Tests reference — tests/knowledge_graph/test_canonical_schema_completeness.py

Module of tests/knowledge_graph, split out because the directory page would be too large.

Prose pending.

tests/knowledge_graph/test_canonical_schema_completeness.py

source · 41 tests · 540 lines

Completeness tests for knowledge_graph.canonical_schema (gap #9).

Covers: knowledge_graph.canonical_schema

Kind Name Line Description
class TestFactNamespaceLabelPresent 89 Spot-check the FactNamespace label (SPEC-033 §4, B4a, ADR-0004) — the
method TestFactNamespaceLabelPresent.test_fact_namespace_keyed_on_key 95
method TestFactNamespaceLabelPresent.test_fact_namespace_constraint_name 99
class TestCanonicalLabelSetPinned 214 CANONICAL_LABELS must equal the exact ratified target — no drift.
method TestCanonicalLabelSetPinned.test_canonical_labels_equals_expected_set 217
method TestCanonicalLabelSetPinned.test_canonical_label_count_is_75 220
class TestMergeKeysConstraintNamesNoOrphans 224 Every canonical label must have exactly one merge key and one
method TestMergeKeysConstraintNamesNoOrphans.test_every_merge_key_label_has_a_constraint_name 229
method TestMergeKeysConstraintNamesNoOrphans.test_every_constraint_name_label_has_a_merge_key 235
method TestMergeKeysConstraintNamesNoOrphans.test_maps_have_identical_label_sets 241
method TestMergeKeysConstraintNamesNoOrphans.test_constraint_names_are_all_unique 244
class TestDDLOneConstraintPerLabel 251 get_all_ddl() must emit exactly one CREATE CONSTRAINT per canonical
method TestDDLOneConstraintPerLabel.test_ddl_has_exactly_one_constraint_per_label 256
method TestDDLOneConstraintPerLabel.test_every_constraint_is_if_not_exists 266
method TestDDLOneConstraintPerLabel.test_every_constraint_references_its_canonical_key 279
method TestDDLOneConstraintPerLabel.test_every_constraint_uses_its_pinned_name 285
class TestSpecificNewTypesPresent 292 Spot-check the new types the brief calls out by name.
method TestSpecificNewTypesPresent.test_tool_keyed_on_name 295
method TestSpecificNewTypesPresent.test_semantic_chunk_keyed_on_id 299
method TestSpecificNewTypesPresent.test_fact_keyed_on_id 302
method TestSpecificNewTypesPresent.test_memory_keyed_on_id 305
method TestSpecificNewTypesPresent.test_task_keyed_on_id 308
method TestSpecificNewTypesPresent.test_component_keyed_on_id 311
method TestSpecificNewTypesPresent.test_portfolio_keyed_on_name 319
method TestSpecificNewTypesPresent.test_design_layer_present 323
method TestSpecificNewTypesPresent.test_fr001_core_labels_still_present_unchanged 329
class TestThreadLabelPresent 342 Spot-check the Thread label (session-254 Option A,
method TestThreadLabelPresent.test_thread_keyed_on_id 347
method TestThreadLabelPresent.test_thread_constraint_name_is_thread_id 351
class TestArchitectureOntologyTypesPresent 355 Spot-check the Tier J architecture-ontology types (RATIFIED
method TestArchitectureOntologyTypesPresent.test_project_scoped_labels_key_on_id 362
method TestArchitectureOntologyTypesPresent.test_global_reference_labels_key_on_natural_id 386
method TestArchitectureOntologyTypesPresent.test_change_gains_its_first_canonical_key 394
method TestArchitectureOntologyTypesPresent.test_reused_labels_unchanged_by_this_wave 400
method TestArchitectureOntologyTypesPresent.test_every_new_label_has_a_constraint_name 409
class TestArchitectureOntologyIndexes 435 The 5 non-identity lookup indexes from §5 of the ratified draft.
method TestArchitectureOntologyIndexes.test_five_indexes_declared 438
method TestArchitectureOntologyIndexes.test_every_index_is_if_not_exists_and_not_a_constraint 441
method TestArchitectureOntologyIndexes.test_expected_index_targets 447
class TestCXPPacketLabelPresent 465 Spot-check CXPPacket (graduated 2026-08-06 — measured live against the
method TestCXPPacketLabelPresent.test_cxp_packet_keyed_on_message_id 471
method TestCXPPacketLabelPresent.test_cxp_packet_constraint_name_reuses_the_live_name 475
method TestCXPPacketLabelPresent.test_cxp_packet_label_literal_is_unchanged 480
class TestMethodLabelPresent 489 Spot-check Method (graduated 2026-08-06 — measured live against the
method TestMethodLabelPresent.test_method_keyed_on_id 496
method TestMethodLabelPresent.test_method_constraint_name_reuses_the_live_name 500
method TestMethodLabelPresent.test_method_still_a_derived_label 505
class TestDeadSchemaLabelsAbsent 512 ImportNode/DecoratorNode (retired 2026-08-06 — 0 nodes under either
method TestDeadSchemaLabelsAbsent.test_import_node_not_canonical 521
method TestDeadSchemaLabelsAbsent.test_decorator_node_not_canonical 526
method TestDeadSchemaLabelsAbsent.test_import_node_and_decorator_node_never_appear_in_get_all_ddl 531
method TestDeadSchemaLabelsAbsent.test_indexes_are_part_of_get_all_ddl 537