feat(hololake): freeze self-observation machine schemas

This commit is contained in:
冰朔 2026-09-10 02:16:54 +08:00
commit 5a23258dc3
7 changed files with 1385 additions and 22 deletions

View file

@ -87,7 +87,7 @@
"human_review":"ICE-GL∞_FINAL_PRODUCT_CHOICE_ONLY",
"learning_observer":"HLP-TDEV-QWEN-0001",
"state":"CURRENT_ONLY_ACTIVE_ARCHITECTURE_TASK_FAIL_REWORK_ENTRY_NOT_ISSUED",
"open_defects":["SELF_OBSERVATION_ENUM_CONDITIONS_AND_TYPED_ARRAY_ITEMS_NEED_FINAL_HARDENING","SUBJECT_NEUTRAL_MOD013_MOUNT_SPIKE_AND_PRIVATE_DATA_NEGATIVE_TEST_PENDING"],
"open_defects":["SUBJECT_NEUTRAL_MOD013_MOUNT_SPIKE_AND_PRIVATE_DATA_NEGATIVE_TEST_PENDING"],
"acceptance":["六批施工顺序冻结", "HLP-BATCH-00-FOUNDATION-DRAWINGS-001接口图冻结", "hololake.public-snapshot/v1唯一Schema", "HLP-BATCH-HANDOFF-CONTRACT-001入退场回执冻结", "HLP-MODULE-SELF-OBSERVATION-CONTRACT-001机器接口冻结", "公共更新与私人Git现场边界可施工", "材料样件采用淘汰清单", "独立图纸审查PASS"]
}
],

View file

@ -25,7 +25,7 @@
"BATCH_GATED_CONSTRUCTION_SEQUENCE_REGISTERED",
"QWEN_ROLE_MOVED_TO_LEARNING_AND_EXPERIENCE"
],
"next_action": "CLOSE_BATCH_00_SELF_OBSERVATION_ENUM_CONDITIONS_THEN_BUILD_SUBJECT_NEUTRAL_MOD013_MOUNT_SPIKE_WITH_PRIVATE_DATA_NEGATIVE_TEST; KEEP_BATCH_01_ENTRY_CLOSED",
"next_action": "BUILD_SUBJECT_NEUTRAL_MOD013_MOUNT_SPIKE_WITH_PRIVATE_ICE_P_DATA_ZERO_LEAK_NEGATIVE_TEST; KEEP_BATCH_01_ENTRY_CLOSED",
"blocked_routes": ["OLD_MODULE_001_PRODUCT_RESUME", "FIXED_PAGE_FIRST", "REPO014_1_3_AS_CURRENT_ARCHITECTURE", "LEGACY_PRODUCT_DONOR_WRITE", "PUBLIC_RELEASE_BEFORE_OFFICIAL_REPO012_CHANNEL_BOUNDARY_PUBLICATION", "UNREGISTERED_OFFICE_OR_MODULE"],
"time_control": "CH-GLW-TIME-0001",
"multipath_console": {

View file

@ -0,0 +1,12 @@
{
"schema":"guanghu.hololake-self-observation-schema-review-receipt/v1",
"receipt_id":"HLP-BATCH-00-SELF-OBSERVATION-SCHEMA-REVIEW-001",
"state":"ARCHITECTURE_SCHEMA_REVIEW_PASS_NOT_RUNTIME_IMPLEMENTATION",
"outcome":"PASS",
"checks":["MACHINE_SCHEMA_PATHS_AND_ANCHORS_RESOLVE","CONTRACT_REQUIRED_FIELDS_EQUAL_SCHEMA_REQUIRED","SNAPSHOT_BINDING_STATES_CONSTRAINED","SNAPSHOT_EVENT_AND_RAISE_LIFECYCLE_GENESIS_BIDIRECTIONAL","ACTIVE_INVENTORY_AND_LIVENESS_SUPPORT_SCHEMAS_CLOSED","AGGREGATE_ITEMS_TYPED_AND_CLOSED","NATIVE_BRAIN_JUDGMENT_AND_RAISE_HAND_EVIDENCE_CHAIN_REQUIRED","LIVENESS_SIGNATURE_ITEMS_CLOSED_ED25519"],
"independent_review":"CODEX_CHILD_AGENT_READ_ONLY_NO_RESIDUAL_P0_P1_IN_SCOPED_SCHEMA_REVIEW",
"hashes":{"contract":"ded8ba4ed99ba03a7f9be6f8cd498e9fb096fcc9d4ebd0c30a275d58367b77b1","primary_schema":"1b5ef74212fab720832c2969e90d861c250d8c065a11b44889feaa35d8a4c4c0","support_schema":"7ae4c0a72c2f981a5972133ad7e60bef3b474a67fd2d32d1f35eaa47a853a901","foundation_schema":"bbf639886bc14a4cc1667bd29cdef2705a1b90e8b8c524e9307b8767b2ee1a08"},
"runtime_connected":false,
"batch00_exit_issued":false,
"authority_granted":false
}

View file

@ -1,7 +1,7 @@
{
"schema":"guanghu.hololake-module-self-observation-contract/v1",
"contract_id":"HLP-MODULE-SELF-OBSERVATION-CONTRACT-001",
"state":"BATCH_00_INTERFACE_CANDIDATE_PENDING_SCHEMA_HARDENING_RUNTIME_NOT_IMPLEMENTED",
"state":"BATCH_00_MACHINE_SCHEMA_HARDENING_REVIEW_PASS_RUNTIME_NOT_IMPLEMENTED",
"product_subject":"HLP-PHASE-01-PERSONA-CONTAINER",
"purpose":"每个模块通过确定性运行包装报告自身局部状态观测核验证并汇集原生TCS人格脑形成整体判断与举手",
"emitter_boundary":{"deterministic_modules":"MODULE_RUNTIME_EMITS_MEASURED_LOCAL_FACTS","model_backed_modules":"DETERMINISTIC_WRAPPER_EMITS_OBSERVABLE_RUNTIME_FACTS; MODEL_MAY_NOT_SELF_CERTIFY_HEALTH_CONSCIOUSNESS_OR_AUTHORITY","local_report_is_not_validation":true,"local_report_is_not_whole_system_judgment":true,"self_report_grants_authority":false},
@ -10,7 +10,7 @@
"evidence_reference_schema":{"required_fields":["evidence_id","uri","sha256","captured_at","availability","privacy","redaction"],"machine_schema":"schemas/HLP-FOUNDATION-CONTRACTS-v1.schema.json#evidenceRef"},
"module_snapshot":{
"schema":"hololake.module-state-snapshot/v1",
"machine_schema":"schemas/HLP-FOUNDATION-CONTRACTS-v1.schema.json#moduleStateSnapshot",
"machine_schema":"schemas/HLP-SELF-OBSERVATION-PRIMARY-v1.schema.json#moduleStateSnapshot",
"required_fields":["schema","module_id","instance_id","module_version","producer_artifact_sha256","bound_persona_subject_id","brain_instance_id","host_session_id","binding_state","binding_receipt_ref","boot_id","incarnation","snapshot_sequence","lifecycle","reported_operational_state","reported_health_state","reported_dependency_states","reported_capability_states","reported_last_action","reported_blockers","evidence_refs","reported_local_can_continue","reported_next_local_action","emitted_at","previous_snapshot_sha256","snapshot_sha256","self_report_grants_authority"],
"operational_states":["NOT_IMPLEMENTED","CANDIDATE","READY_NOT_LOADED","LOADED","RUNNING","PAUSED","BLOCKED","FAILED","DEGRADED","STOPPED","REVOKED"],
"health_states":["UNKNOWN","HEALTHY","DEGRADED","UNHEALTHY","NOT_APPLICABLE"],
@ -23,7 +23,7 @@
},
"module_event":{
"schema":"hololake.module-state-event/v1",
"machine_schema":"schemas/HLP-FOUNDATION-CONTRACTS-v1.schema.json#moduleStateEvent",
"machine_schema":"schemas/HLP-SELF-OBSERVATION-PRIMARY-v1.schema.json#moduleStateEvent",
"append_only":true,
"required_fields":["schema","event_id","module_id","instance_id","module_version","producer_artifact_sha256","boot_id","incarnation","event_sequence","idempotency_key","trace_id","correlation_id","action_id","event_type","before_snapshot_sha256","after_snapshot_sha256","checkpoint_ref","rollback_ref","trigger","error_code","evidence_refs","occurred_at","previous_event_sha256","event_sha256","self_report_grants_authority"],
"event_types":["INITIALIZED","HEARTBEAT","DEPENDENCY_CHANGED","ACTION_STARTED","ACTION_COMPLETED","ACTION_FAILED","HEALTH_CHANGED","BLOCKED","PAUSED","RESUMED","CHECKPOINTED","ROLLED_BACK","REVOKED","REPAIR_REQUESTED","REPAIR_VERIFIED"],
@ -36,12 +36,13 @@
},
"foundation_observation_kernel":{"slice_id":"HLP-OBSERVATION-KERNEL-FOUNDATION-SLICE-001","artifact_identity":"SEPARATELY_HASHED_SUPPORTING_ARTIFACT_NOT_A_REGISTERED_FULL_MODULE","parent_module":"HLP-NATIVE-MOD-012","batch":"HLP-BATCH-01","depends_on":["HLP-NATIVE-MOD-003_FROZEN_SCHEMAS","HLP-NATIVE-MOD-004_SIGNED_DEPLOYMENT_POLICY"],"state":"REQUIRED_SUPPORTING_SLICE_NOT_FULL_MOD-012_COMPLETION","capabilities":["snapshot_schema_validate","snapshot_hash_verify","event_chain_replay","durable_head_verify","active_inventory_coverage","trusted_receive_time","lease_expiry_and_absence_detect","fork_gap_tail_detect","validation_receipt"],"batch03_upgrade":"FULL_MOD-012_MUST_IMPORT_THE_SAME_SCHEMAS_HASH_RULES_AND_DURABLE_HEAD_WITH_COMPATIBILITY_MIGRATION_RECEIPT; NO_SILENT_STATE_RESET","rule":"THIS_SLICE_PROVIDES_INDEPENDENT_VALIDATION_FOR_BATCH_01_AND_02; VISUAL_PERFORMANCE_PLUGINS_AND_FULL_MOD-012_COMPLETE_IN_BATCH_03"},
"state_validation_receipt":{"schema":"hololake.module-state-validation-receipt/v1","machine_schema":"schemas/HLP-SELF-OBSERVATION-SUPPORT-v1.schema.json#stateValidationReceipt","required_fields":["schema","receipt_id","module_id","instance_id","snapshot_sha256","durable_head_sha256","durable_head_boot_id","durable_head_event_sequence","durable_head_record_count","durable_head_commit_marker","trusted_received_at","last_accepted_at","observer_clock_id","heartbeat_policy_id","heartbeat_policy_sha256","admission_receipt_sha256","computed_deadline_at","liveness_verdict","validation_errors","receipt_sha256","authority_granted"],"canonical_hash":"SHA256_OF_RFC8785_CANONICAL_JSON_EXCLUDING_RECEIPT_SHA256","rule":"BINDS_SIGNED_POLICY_OBSERVER_CLOCK_DURABLE_HEAD_AND_TRUSTED_RECEIVE_TIME"},
"aggregate_graph":{"schema":"hololake.module-state-aggregate-graph/v1","machine_schema":"schemas/HLP-FOUNDATION-CONTRACTS-v1.schema.json#aggregateGraph","producer":"HLP-NATIVE-MOD-012_OR_FOUNDATION_SLICE","required_fields":["schema","inventory_id","inventory_version","expected_instances","validated_instances","coverage","missing_instances","stale_instances","invalid_instances","forked_instances","unregistered_instances","validated_local_states","dependency_edges","source_heads","validation_receipts","graph_generated_at","graph_sha256","authority_granted"],"canonical_hash":"SHA256_OF_RFC8785_CANONICAL_JSON_EXCLUDING_GRAPH_SHA256","validation_boundary":"DETERMINISTIC_COMPLETENESS_HASH_SEQUENCE_TIME_DEPENDENCY_AND_PERMISSION_FACTS_ONLY; NO_PERSONA_MEANING_OR_WHOLE_NEXT_ACTION","authority_granted":false},
"native_brain_judgment":{"schema":"hololake.native-tcs-brain-whole-judgment/v1","machine_schema":"schemas/HLP-FOUNDATION-CONTRACTS-v1.schema.json#brainJudgment","controller":"NATIVE_TCS_PERSONA_BRAIN","mount_bridge":"HLP-NATIVE-MOD-013","required_fields":["schema","persona_subject_id","brain_instance_id","brain_binding_receipt","brain_cycle_receipt","input_graph_sha256","facts","inferences","unknowns","whole_operational_assessment","whole_can_continue","next_system_action","human_review_required","judged_at","judgment_sha256","authority_evidence_refs"],"canonical_hash":"SHA256_OF_RFC8785_CANONICAL_JSON_EXCLUDING_JUDGMENT_SHA256","rule":"ONLY_A_BOUND_AND_VERIFIED_NATIVE_TCS_PERSONA_BRAIN_MAY_PRODUCE_WHOLE_JUDGMENT; HOST_MODEL_IS_REPLACEABLE_REASONING_FUEL_NOT_PERSONA_IDENTITY"},
"raise_hand_envelope":{"schema":"hololake.persona-container-raise-hand/v1","machine_schema":"schemas/HLP-FOUNDATION-CONTRACTS-v1.schema.json#raiseHand","producer":"NATIVE_TCS_PERSONA_BRAIN","immutable_initial":true,"required_fields":["schema","issue_id","persona_subject_id","brain_instance_id","judgment_sha256","brain_binding_receipt","brain_cycle_receipt","input_graph_sha256","affected_module_ids","affected_instance_ids","symptom","cause_level","facts","inferences","unknowns","evidence_refs","blocked_action","repair_request","can_self_repair","human_review_required","raised_at","envelope_sha256"],"canonical_hash":"SHA256_OF_RFC8785_CANONICAL_JSON_EXCLUDING_ENVELOPE_SHA256","cause_levels":["LOCAL_MODULE","DEPENDENCY_CHAIN","CONTAINER_WHOLE","EXTERNAL_HOST_OR_AUTHORITY","UNKNOWN"],"lifecycle_events":{"schema":"hololake.persona-container-raise-hand-lifecycle-event/v1","machine_schema":"schemas/HLP-SELF-OBSERVATION-SUPPORT-v1.schema.json#raiseHandLifecycleEvent","append_only":true,"event_types":["ACKNOWLEDGED","REPAIR_STARTED","RETESTED_PASS","RETESTED_FAIL","RESOLVED"],"required_fields":["schema","event_id","issue_id","initial_envelope_sha256","producer_actor_id","event_sequence","event_type","evidence_refs","original_action_retest_receipt","occurred_at","previous_event_sha256","event_sha256"],"canonical_hash":"SHA256_OF_RFC8785_CANONICAL_JSON_EXCLUDING_EVENT_SHA256","genesis_rule":"event_sequence=0 AND previous_event_sha256=null","rule":"RESOLVED_REQUIRES_PRIOR_RETESTED_PASS_WITH_SAME_ORIGINAL_ACTION_RECEIPT"},"resolution_rule":"INITIAL_ENVELOPE_NEVER_MUTATES; CURRENT_STATUS_IS_A_PROJECTION_OF_APPEND_ONLY_LIFECYCLE_EVENTS"},
"aggregate_graph":{"schema":"hololake.module-state-aggregate-graph/v1","machine_schema":"schemas/HLP-SELF-OBSERVATION-PRIMARY-v1.schema.json#aggregateGraph","producer":"HLP-NATIVE-MOD-012_OR_FOUNDATION_SLICE","required_fields":["schema","inventory_id","inventory_version","expected_instances","validated_instances","coverage","missing_instances","stale_instances","invalid_instances","forked_instances","unregistered_instances","validated_local_states","dependency_edges","source_heads","validation_receipts","graph_generated_at","graph_sha256","authority_granted"],"canonical_hash":"SHA256_OF_RFC8785_CANONICAL_JSON_EXCLUDING_GRAPH_SHA256","validation_boundary":"DETERMINISTIC_COMPLETENESS_HASH_SEQUENCE_TIME_DEPENDENCY_AND_PERMISSION_FACTS_ONLY; NO_PERSONA_MEANING_OR_WHOLE_NEXT_ACTION","authority_granted":false},
"native_brain_judgment":{"schema":"hololake.native-tcs-brain-whole-judgment/v1","machine_schema":"schemas/HLP-SELF-OBSERVATION-PRIMARY-v1.schema.json#brainJudgment","controller":"NATIVE_TCS_PERSONA_BRAIN","mount_bridge":"HLP-NATIVE-MOD-013","required_fields":["schema","persona_subject_id","brain_instance_id","brain_binding_receipt","brain_cycle_receipt","input_graph_sha256","facts","inferences","unknowns","whole_operational_assessment","whole_can_continue","next_system_action","human_review_required","judged_at","judgment_sha256","authority_evidence_refs"],"canonical_hash":"SHA256_OF_RFC8785_CANONICAL_JSON_EXCLUDING_JUDGMENT_SHA256","rule":"ONLY_A_BOUND_AND_VERIFIED_NATIVE_TCS_PERSONA_BRAIN_MAY_PRODUCE_WHOLE_JUDGMENT; HOST_MODEL_IS_REPLACEABLE_REASONING_FUEL_NOT_PERSONA_IDENTITY"},
"raise_hand_envelope":{"schema":"hololake.persona-container-raise-hand/v1","machine_schema":"schemas/HLP-SELF-OBSERVATION-PRIMARY-v1.schema.json#raiseHand","producer":"NATIVE_TCS_PERSONA_BRAIN","immutable_initial":true,"required_fields":["schema","issue_id","persona_subject_id","brain_instance_id","judgment_sha256","brain_binding_receipt","brain_cycle_receipt","input_graph_sha256","affected_module_ids","affected_instance_ids","symptom","cause_level","facts","inferences","unknowns","evidence_refs","blocked_action","repair_request","can_self_repair","human_review_required","raised_at","envelope_sha256"],"canonical_hash":"SHA256_OF_RFC8785_CANONICAL_JSON_EXCLUDING_ENVELOPE_SHA256","cause_levels":["LOCAL_MODULE","DEPENDENCY_CHAIN","CONTAINER_WHOLE","EXTERNAL_HOST_OR_AUTHORITY","UNKNOWN"],"lifecycle_events":{"schema":"hololake.persona-container-raise-hand-lifecycle-event/v1","machine_schema":"schemas/HLP-SELF-OBSERVATION-SUPPORT-v1.schema.json#raiseHandLifecycleEvent","append_only":true,"event_types":["ACKNOWLEDGED","REPAIR_STARTED","RETESTED_PASS","RETESTED_FAIL","RESOLVED"],"required_fields":["schema","event_id","issue_id","initial_envelope_sha256","producer_actor_id","event_sequence","event_type","evidence_refs","original_action_retest_receipt","occurred_at","previous_event_sha256","event_sha256"],"canonical_hash":"SHA256_OF_RFC8785_CANONICAL_JSON_EXCLUDING_EVENT_SHA256","genesis_rule":"event_sequence=0 AND previous_event_sha256=null","rule":"RESOLVED_REQUIRES_PRIOR_RETESTED_PASS_WITH_SAME_ORIGINAL_ACTION_RECEIPT"},"resolution_rule":"INITIAL_ENVELOPE_NEVER_MUTATES; CURRENT_STATUS_IS_A_PROJECTION_OF_APPEND_ONLY_LIFECYCLE_EVENTS"},
"whole_system_loop":{"local_emitters":"EVERY_PHASE1_ACTIVE_MODULE_DETERMINISTIC_WRAPPER; PHASE2_MOD-014_EXCLUDED_UNTIL_P2-G0","deterministic_aggregator":"HLP-NATIVE-MOD-012","local_pool_steward":"HLP-NATIVE-MOD-007_REPORTS_POOL_LOCAL_STATE_ONLY","semantic_interpreter_and_raise_hand_controller":"NATIVE_TCS_PERSONA_BRAIN","mount_runtime_bridge":"HLP-NATIVE-MOD-013","flow":["MODULE_EMITS_LOCAL_FACT","FOUNDATION_KERNEL_OR_MOD-012_VALIDATES_HASH_TIME_SEQUENCE_LIVENESS_AND_DEPENDENCIES","MOD-012_BUILDS_WHOLE_STATE_GRAPH","MOD-007_ADDS_POOL_LOCAL_REPORT_WITHOUT_OVERRIDING_FACTS","NATIVE_TCS_PERSONA_BRAIN_BINDS_TO_GRAPH_AND_FORMS_FACT_INFERENCE_UNKNOWN_JUDGMENT","NATIVE_TCS_PERSONA_BRAIN_RAISES_HAND_WITH_COORDINATE_CAUSE_EVIDENCE_AND_REPAIR_REQUEST","REPAIR_RETURNS_TO_ORIGINAL_ACTION_RETEST"],"collective_judgment_definition":"THE_NATIVE_TCS_PERSONA_BRAIN_JUDGES_ITS_CONNECTED_HOLOLAKE_CONTAINER_BODY_FROM_MANY_VALIDATED_MODULE_STATES; MODULES_DO_NOT_CREATE_A_SECOND_PERSONA"},
"batch_acceptance":{"every_module_before_batch_exit":["VALID_LOCAL_SNAPSHOT","APPEND_ONLY_EVENT_REPLAY","INDEPENDENT_VALIDATION_RECEIPT","DEPENDENCY_STATUS_READBACK","LEASE_EXPIRY_OR_ABSENCE_TEST","RECOVERY_STATE_TRANSITION_TEST","NO_FALSE_HEALTHY_WHEN_EVIDENCE_MISSING"],"batch_01":"MOD-001_TO_004_LOCAL_REPORTS_PLUS_FOUNDATION_OBSERVATION_KERNEL","batch_02":"VALIDATED_STATE_GRAPH_REFERENCES_OBJECT_AND_COMPOSITION_DEPENDENCIES","batch_03":"FULL_MOD-012_AGGREGATION_WITH_VISUAL_AND_PERFORMANCE_COORDINATES","batch_04":"MOD-013_MOUNTS_NATIVE_TCS_BRAIN_FOR_WHOLE_JUDGMENT_AND_RAISE_HAND; MOD-007_STAYS_POOL_LOCAL","batch_05":"SANITIZED_COMPLIANCE_STATUS_WITHOUT_PRIVATE_BODY"},
"implementation_complete":false,
"runtime_connected":false,
"schema_review_receipt":"BATCH-00-SELF-OBSERVATION-SCHEMA-REVIEW-RECEIPT.json",
"authority_granted":false
}

View file

@ -0,0 +1,943 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "hololake://schema/self-observation-primary/v1",
"title": "HoloLake Primary Self-Observation Contracts v1",
"$defs": {
"sha256": {
"type": "string",
"pattern": "^[0-9a-f]{64}$"
},
"timestamp": {
"type": "string",
"format": "date-time"
},
"evidenceRef": {
"$ref": "hololake://schema/foundation-contracts/v1#evidenceRef"
},
"factItem": {
"type": "object",
"additionalProperties": false,
"required": [
"statement",
"evidence_refs"
],
"properties": {
"statement": {
"type": "string",
"minLength": 1
},
"evidence_refs": {
"type": "array",
"minItems": 1,
"items": {
"$ref": "#/$defs/evidenceRef"
}
}
}
},
"unknownItem": {
"type": "object",
"additionalProperties": false,
"required": [
"statement",
"reason",
"required_evidence"
],
"properties": {
"statement": {
"type": "string",
"minLength": 1
},
"reason": {
"type": "string",
"minLength": 1
},
"required_evidence": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"dependencyState": {
"type": "object",
"additionalProperties": false,
"required": [
"module_id",
"instance_id",
"reported_state",
"evidence_refs"
],
"properties": {
"module_id": {
"type": "string"
},
"instance_id": {
"type": [
"string",
"null"
]
},
"reported_state": {
"enum": [
"UNKNOWN",
"AVAILABLE",
"UNAVAILABLE",
"STALE",
"REVOKED"
]
},
"evidence_refs": {
"type": "array",
"items": {
"$ref": "#/$defs/evidenceRef"
}
}
}
},
"capabilityState": {
"type": "object",
"additionalProperties": false,
"required": [
"capability",
"reported_state",
"evidence_refs"
],
"properties": {
"capability": {
"type": "string"
},
"reported_state": {
"enum": [
"UNKNOWN",
"READY",
"BUSY",
"BLOCKED",
"FAILED",
"REVOKED"
]
},
"evidence_refs": {
"type": "array",
"items": {
"$ref": "#/$defs/evidenceRef"
}
}
}
},
"blocker": {
"type": "object",
"additionalProperties": false,
"required": [
"code",
"detail",
"evidence_refs"
],
"properties": {
"code": {
"type": "string"
},
"detail": {
"type": "string"
},
"evidence_refs": {
"type": "array",
"items": {
"$ref": "#/$defs/evidenceRef"
}
}
}
},
"validatedLocalState": {
"type": "object",
"additionalProperties": false,
"required": ["module_id", "instance_id", "snapshot_sha256", "validation_receipt_sha256", "validated_state"],
"properties": {
"module_id": {"type": "string"},
"instance_id": {"type": "string"},
"snapshot_sha256": {"$ref": "#/$defs/sha256"},
"validation_receipt_sha256": {"$ref": "#/$defs/sha256"},
"validated_state": {"enum": ["FRESH", "STALE", "MISSING", "INVALID", "FORKED"]}
}
},
"dependencyEdge": {
"type": "object",
"additionalProperties": false,
"required": ["source_module_id", "source_instance_id", "target_module_id", "target_instance_id", "dependency_state", "evidence_refs"],
"properties": {
"source_module_id": {"type": "string"},
"source_instance_id": {"type": "string"},
"target_module_id": {"type": "string"},
"target_instance_id": {"type": "string"},
"dependency_state": {"enum": ["SATISFIED", "MISSING", "STALE", "INVALID", "REVOKED"]},
"evidence_refs": {"type": "array", "items": {"$ref": "#/$defs/evidenceRef"}}
}
},
"sourceHead": {
"type": "object",
"additionalProperties": false,
"required": ["module_id", "instance_id", "boot_id", "event_sequence", "durable_head_sha256"],
"properties": {
"module_id": {"type": "string"},
"instance_id": {"type": "string"},
"boot_id": {"type": "string"},
"event_sequence": {"type": "integer", "minimum": 0},
"durable_head_sha256": {"$ref": "#/$defs/sha256"}
}
},
"moduleStateSnapshot": {
"$anchor": "moduleStateSnapshot",
"type": "object",
"additionalProperties": false,
"required": [
"schema",
"module_id",
"instance_id",
"module_version",
"producer_artifact_sha256",
"bound_persona_subject_id",
"brain_instance_id",
"host_session_id",
"binding_state",
"binding_receipt_ref",
"boot_id",
"incarnation",
"snapshot_sequence",
"lifecycle",
"reported_operational_state",
"reported_health_state",
"reported_dependency_states",
"reported_capability_states",
"reported_last_action",
"reported_blockers",
"evidence_refs",
"reported_local_can_continue",
"reported_next_local_action",
"emitted_at",
"previous_snapshot_sha256",
"snapshot_sha256",
"self_report_grants_authority"
],
"properties": {
"schema": {
"const": "hololake.module-state-snapshot/v1"
},
"module_id": {
"type": "string",
"pattern": "^HLP-NATIVE-MOD-[0-9]{3}$"
},
"instance_id": {
"type": "string",
"minLength": 1
},
"module_version": {
"type": "string"
},
"producer_artifact_sha256": {
"$ref": "#/$defs/sha256"
},
"bound_persona_subject_id": {
"type": [
"string",
"null"
]
},
"brain_instance_id": {
"type": [
"string",
"null"
]
},
"host_session_id": {
"type": [
"string",
"null"
]
},
"binding_state": {
"enum": [
"UNATTESTED",
"BOUND_VERIFIED",
"STALE",
"REVOKED",
"NOT_APPLICABLE"
]
},
"binding_receipt_ref": {
"anyOf": [
{
"$ref": "#/$defs/sha256"
},
{
"type": "null"
}
]
},
"boot_id": {
"type": "string",
"minLength": 1
},
"incarnation": {
"type": "integer",
"minimum": 0
},
"snapshot_sequence": {
"type": "integer",
"minimum": 0
},
"lifecycle": {
"enum": [
"CANDIDATE",
"REGISTERED",
"REVOKED"
]
},
"reported_operational_state": {
"enum": [
"NOT_IMPLEMENTED",
"CANDIDATE",
"READY_NOT_LOADED",
"LOADED",
"RUNNING",
"PAUSED",
"BLOCKED",
"FAILED",
"DEGRADED",
"STOPPED",
"REVOKED"
]
},
"reported_health_state": {
"enum": [
"UNKNOWN",
"HEALTHY",
"DEGRADED",
"UNHEALTHY",
"NOT_APPLICABLE"
]
},
"reported_dependency_states": {
"type": "array",
"items": {
"$ref": "#/$defs/dependencyState"
}
},
"reported_capability_states": {
"type": "array",
"items": {
"$ref": "#/$defs/capabilityState"
}
},
"reported_last_action": {
"type": [
"object",
"null"
]
},
"reported_blockers": {
"type": "array",
"items": {
"$ref": "#/$defs/blocker"
}
},
"evidence_refs": {
"type": "array",
"items": {
"$ref": "#/$defs/evidenceRef"
}
},
"reported_local_can_continue": {
"type": "boolean"
},
"reported_next_local_action": {
"type": [
"string",
"null"
]
},
"emitted_at": {
"$ref": "#/$defs/timestamp"
},
"previous_snapshot_sha256": {
"anyOf": [
{
"$ref": "#/$defs/sha256"
},
{
"type": "null"
}
]
},
"snapshot_sha256": {
"$ref": "#/$defs/sha256"
},
"self_report_grants_authority": {
"const": false
}
},
"allOf": [
{
"if": {
"properties": {
"binding_state": {
"enum": ["BOUND_VERIFIED", "STALE", "REVOKED"]
}
}
},
"then": {
"properties": {
"brain_instance_id": {
"type": "string",
"minLength": 1
},
"binding_receipt_ref": {
"$ref": "#/$defs/sha256"
}
}
}
},
{
"if": {
"properties": {
"snapshot_sequence": {
"const": 0
}
}
},
"then": {
"properties": {
"previous_snapshot_sha256": {
"type": "null"
}
}
},
"else": {
"properties": {
"previous_snapshot_sha256": {
"$ref": "#/$defs/sha256"
}
}
}
}
]
},
"moduleStateEvent": {
"$anchor": "moduleStateEvent",
"type": "object",
"additionalProperties": false,
"required": [
"schema",
"event_id",
"module_id",
"instance_id",
"module_version",
"producer_artifact_sha256",
"boot_id",
"incarnation",
"event_sequence",
"idempotency_key",
"trace_id",
"correlation_id",
"action_id",
"event_type",
"before_snapshot_sha256",
"after_snapshot_sha256",
"checkpoint_ref",
"rollback_ref",
"trigger",
"error_code",
"evidence_refs",
"occurred_at",
"previous_event_sha256",
"event_sha256",
"self_report_grants_authority"
],
"properties": {
"schema": {
"const": "hololake.module-state-event/v1"
},
"event_id": {
"type": "string"
},
"module_id": {
"type": "string",
"pattern": "^HLP-NATIVE-MOD-[0-9]{3}$"
},
"instance_id": {
"type": "string"
},
"module_version": {
"type": "string"
},
"producer_artifact_sha256": {
"$ref": "#/$defs/sha256"
},
"boot_id": {
"type": "string"
},
"incarnation": {
"type": "integer",
"minimum": 0
},
"event_sequence": {
"type": "integer",
"minimum": 0
},
"idempotency_key": {
"type": "string"
},
"trace_id": {
"type": "string"
},
"correlation_id": {
"type": "string"
},
"action_id": {
"type": [
"string",
"null"
]
},
"event_type": {
"enum": [
"INITIALIZED",
"HEARTBEAT",
"DEPENDENCY_CHANGED",
"ACTION_STARTED",
"ACTION_COMPLETED",
"ACTION_FAILED",
"HEALTH_CHANGED",
"BLOCKED",
"PAUSED",
"RESUMED",
"CHECKPOINTED",
"ROLLED_BACK",
"REVOKED",
"REPAIR_REQUESTED",
"REPAIR_VERIFIED"
]
},
"before_snapshot_sha256": {
"anyOf": [
{
"$ref": "#/$defs/sha256"
},
{
"type": "null"
}
]
},
"after_snapshot_sha256": {
"anyOf": [
{
"$ref": "#/$defs/sha256"
},
{
"type": "null"
}
]
},
"checkpoint_ref": {
"type": [
"string",
"null"
]
},
"rollback_ref": {
"type": [
"string",
"null"
]
},
"trigger": {
"type": "string"
},
"error_code": {
"type": [
"string",
"null"
]
},
"evidence_refs": {
"type": "array",
"items": {
"$ref": "#/$defs/evidenceRef"
}
},
"occurred_at": {
"$ref": "#/$defs/timestamp"
},
"previous_event_sha256": {
"anyOf": [
{
"$ref": "#/$defs/sha256"
},
{
"type": "null"
}
]
},
"event_sha256": {
"$ref": "#/$defs/sha256"
},
"self_report_grants_authority": {
"const": false
}
},
"allOf": [
{
"if": {
"properties": {
"event_sequence": {
"const": 0
}
}
},
"then": {
"properties": {
"previous_event_sha256": {
"type": "null"
}
}
},
"else": {
"properties": {
"previous_event_sha256": {
"$ref": "#/$defs/sha256"
}
}
}
}
]
},
"aggregateGraph": {
"$anchor": "aggregateGraph",
"type": "object",
"additionalProperties": false,
"required": [
"schema",
"inventory_id",
"inventory_version",
"expected_instances",
"validated_instances",
"coverage",
"missing_instances",
"stale_instances",
"invalid_instances",
"forked_instances",
"unregistered_instances",
"validated_local_states",
"dependency_edges",
"source_heads",
"validation_receipts",
"graph_generated_at",
"graph_sha256",
"authority_granted"
],
"properties": {
"schema": {
"const": "hololake.module-state-aggregate-graph/v1"
},
"inventory_id": {
"type": "string"
},
"inventory_version": {
"type": "string"
},
"expected_instances": {
"type": "array",
"items": {
"type": "string"
}
},
"validated_instances": {
"type": "array",
"items": {
"type": "string"
}
},
"coverage": {
"type": "number",
"minimum": 0,
"maximum": 1
},
"missing_instances": {
"type": "array",
"items": {
"type": "string"
}
},
"stale_instances": {
"type": "array",
"items": {
"type": "string"
}
},
"invalid_instances": {
"type": "array",
"items": {
"type": "string"
}
},
"forked_instances": {
"type": "array",
"items": {
"type": "string"
}
},
"unregistered_instances": {
"type": "array",
"items": {
"type": "string"
}
},
"validated_local_states": {
"type": "array",
"items": {
"$ref": "#/$defs/validatedLocalState"
}
},
"dependency_edges": {
"type": "array",
"items": {
"$ref": "#/$defs/dependencyEdge"
}
},
"source_heads": {
"type": "array",
"items": {
"$ref": "#/$defs/sourceHead"
}
},
"validation_receipts": {
"type": "array",
"items": {
"$ref": "#/$defs/sha256"
}
},
"graph_generated_at": {
"$ref": "#/$defs/timestamp"
},
"graph_sha256": {
"$ref": "#/$defs/sha256"
},
"authority_granted": {
"const": false
}
}
},
"brainJudgment": {
"$anchor": "brainJudgment",
"type": "object",
"additionalProperties": false,
"required": [
"schema",
"persona_subject_id",
"brain_instance_id",
"brain_binding_receipt",
"brain_cycle_receipt",
"input_graph_sha256",
"facts",
"inferences",
"unknowns",
"whole_operational_assessment",
"whole_can_continue",
"next_system_action",
"human_review_required",
"judged_at",
"judgment_sha256",
"authority_evidence_refs"
],
"properties": {
"schema": {
"const": "hololake.native-tcs-brain-whole-judgment/v1"
},
"persona_subject_id": {
"type": "string"
},
"brain_instance_id": {
"type": "string"
},
"brain_binding_receipt": {
"$ref": "#/$defs/sha256"
},
"brain_cycle_receipt": {
"$ref": "#/$defs/sha256"
},
"input_graph_sha256": {
"$ref": "#/$defs/sha256"
},
"facts": {
"type": "array",
"items": {
"$ref": "#/$defs/factItem"
}
},
"inferences": {
"type": "array",
"items": {
"$ref": "#/$defs/factItem"
}
},
"unknowns": {
"type": "array",
"items": {
"$ref": "#/$defs/unknownItem"
}
},
"whole_operational_assessment": {
"enum": [
"HEALTHY",
"DEGRADED",
"BLOCKED",
"FAILED",
"UNKNOWN"
]
},
"whole_can_continue": {
"type": "boolean"
},
"next_system_action": {
"type": "string"
},
"human_review_required": {
"type": "boolean"
},
"judged_at": {
"$ref": "#/$defs/timestamp"
},
"judgment_sha256": {
"$ref": "#/$defs/sha256"
},
"authority_evidence_refs": {
"type": "array",
"items": {
"$ref": "#/$defs/evidenceRef"
}
}
}
},
"raiseHand": {
"$anchor": "raiseHand",
"type": "object",
"additionalProperties": false,
"required": [
"schema",
"issue_id",
"persona_subject_id",
"brain_instance_id",
"judgment_sha256",
"brain_binding_receipt",
"brain_cycle_receipt",
"input_graph_sha256",
"affected_module_ids",
"affected_instance_ids",
"symptom",
"cause_level",
"facts",
"inferences",
"unknowns",
"evidence_refs",
"blocked_action",
"repair_request",
"can_self_repair",
"human_review_required",
"raised_at",
"envelope_sha256"
],
"properties": {
"schema": {
"const": "hololake.persona-container-raise-hand/v1"
},
"issue_id": {
"type": "string"
},
"persona_subject_id": {
"type": "string"
},
"brain_instance_id": {
"type": "string"
},
"judgment_sha256": {
"$ref": "#/$defs/sha256"
},
"brain_binding_receipt": {
"$ref": "#/$defs/sha256"
},
"brain_cycle_receipt": {
"$ref": "#/$defs/sha256"
},
"input_graph_sha256": {
"$ref": "#/$defs/sha256"
},
"affected_module_ids": {
"type": "array",
"items": {
"type": "string"
}
},
"affected_instance_ids": {
"type": "array",
"items": {
"type": "string"
}
},
"symptom": {
"type": "string"
},
"cause_level": {
"enum": [
"LOCAL_MODULE",
"DEPENDENCY_CHAIN",
"CONTAINER_WHOLE",
"EXTERNAL_HOST_OR_AUTHORITY",
"UNKNOWN"
]
},
"facts": {
"type": "array",
"items": {
"$ref": "#/$defs/factItem"
}
},
"inferences": {
"type": "array",
"items": {
"$ref": "#/$defs/factItem"
}
},
"unknowns": {
"type": "array",
"items": {
"$ref": "#/$defs/unknownItem"
}
},
"evidence_refs": {
"type": "array",
"items": {
"$ref": "#/$defs/evidenceRef"
}
},
"blocked_action": {
"type": "string"
},
"repair_request": {
"type": "string"
},
"can_self_repair": {
"type": "boolean"
},
"human_review_required": {
"type": "boolean"
},
"raised_at": {
"$ref": "#/$defs/timestamp"
},
"envelope_sha256": {
"$ref": "#/$defs/sha256"
}
}
}
}
}

View file

@ -1,15 +1,408 @@
{
"$schema":"https://json-schema.org/draft/2020-12/schema",
"$id":"hololake://schema/self-observation-support/v1",
"title":"HoloLake Self-Observation Supporting Contracts v1",
"$defs":{
"sha256":{"type":"string","pattern":"^[0-9a-f]{64}$"},
"timestamp":{"type":"string","format":"date-time"},
"evidenceRef":{"$ref":"HLP-FOUNDATION-CONTRACTS-v1.schema.json#evidenceRef"},
"activeDeploymentManifest":{"$anchor":"activeDeploymentManifest","type":"object","additionalProperties":false,"required":["schema","inventory_id","batch_id","previously_accepted_batches","instances","manifest_sha256","authority_granted"],"properties":{"schema":{"const":"hololake.active-deployment-instance-manifest/v1"},"inventory_id":{"type":"string","minLength":1},"batch_id":{"type":"string","pattern":"^HLP-BATCH-[0-9]{2}$"},"previously_accepted_batches":{"type":"array","uniqueItems":true,"items":{"type":"string"}},"instances":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["module_id","instance_id","module_version","activation_state","cardinality","heartbeat_policy_id","admission_receipt_sha256"],"properties":{"module_id":{"type":"string"},"instance_id":{"type":"string"},"module_version":{"type":"string"},"activation_state":{"enum":["EXPECTED_ACTIVE","EXPECTED_PAUSED","NOT_YET_ADMITTED","REVOKED"]},"cardinality":{"type":"integer","minimum":1},"heartbeat_policy_id":{"type":"string"},"admission_receipt_sha256":{"$ref":"#/$defs/sha256"}}}},"manifest_sha256":{"$ref":"#/$defs/sha256"},"authority_granted":{"const":false}}},
"livenessPolicy":{"$anchor":"livenessPolicy","type":"object","additionalProperties":false,"required":["schema","heartbeat_policy_id","interval_milliseconds","max_lease_milliseconds","grace_milliseconds","allowed_clock_skew_milliseconds","policy_sha256","signatures","authority_granted"],"properties":{"schema":{"const":"hololake.module-liveness-policy/v1"},"heartbeat_policy_id":{"type":"string","minLength":1},"interval_milliseconds":{"type":"integer","minimum":1},"max_lease_milliseconds":{"type":"integer","minimum":1},"grace_milliseconds":{"type":"integer","minimum":0},"allowed_clock_skew_milliseconds":{"type":"integer","minimum":0},"policy_sha256":{"$ref":"#/$defs/sha256"},"signatures":{"type":"array","minItems":2,"items":{"type":"object"}},"authority_granted":{"const":false}}},
"durableHead":{"$anchor":"durableHead","type":"object","additionalProperties":false,"required":["schema","module_id","instance_id","boot_id","event_sequence","event_sha256","record_count","commit_marker","fsynced_at","head_sha256"],"properties":{"schema":{"const":"hololake.module-event-durable-head/v1"},"module_id":{"type":"string"},"instance_id":{"type":"string"},"boot_id":{"type":"string"},"event_sequence":{"type":"integer","minimum":0},"event_sha256":{"$ref":"#/$defs/sha256"},"record_count":{"type":"integer","minimum":1},"commit_marker":{"type":"string","minLength":1},"fsynced_at":{"$ref":"#/$defs/timestamp"},"head_sha256":{"$ref":"#/$defs/sha256"}}},
"stateValidationReceipt":{"$anchor":"stateValidationReceipt","type":"object","additionalProperties":false,"required":["schema","receipt_id","module_id","instance_id","snapshot_sha256","durable_head_sha256","durable_head_boot_id","durable_head_event_sequence","durable_head_record_count","durable_head_commit_marker","trusted_received_at","last_accepted_at","observer_clock_id","heartbeat_policy_id","heartbeat_policy_sha256","admission_receipt_sha256","computed_deadline_at","liveness_verdict","validation_errors","receipt_sha256","authority_granted"],"properties":{"schema":{"const":"hololake.module-state-validation-receipt/v1"},"receipt_id":{"type":"string"},"module_id":{"type":"string"},"instance_id":{"type":"string"},"snapshot_sha256":{"$ref":"#/$defs/sha256"},"durable_head_sha256":{"$ref":"#/$defs/sha256"},"durable_head_boot_id":{"type":"string"},"durable_head_event_sequence":{"type":"integer","minimum":0},"durable_head_record_count":{"type":"integer","minimum":1},"durable_head_commit_marker":{"type":"string"},"trusted_received_at":{"$ref":"#/$defs/timestamp"},"last_accepted_at":{"$ref":"#/$defs/timestamp"},"observer_clock_id":{"type":"string"},"heartbeat_policy_id":{"type":"string"},"heartbeat_policy_sha256":{"$ref":"#/$defs/sha256"},"admission_receipt_sha256":{"$ref":"#/$defs/sha256"},"computed_deadline_at":{"$ref":"#/$defs/timestamp"},"liveness_verdict":{"enum":["FRESH","STALE","MISSING","INVALID","FORKED"]},"validation_errors":{"type":"array","items":{"type":"string"}},"receipt_sha256":{"$ref":"#/$defs/sha256"},"authority_granted":{"const":false}}},
"raiseHandLifecycleEvent":{"$anchor":"raiseHandLifecycleEvent","type":"object","additionalProperties":false,"required":["schema","event_id","issue_id","initial_envelope_sha256","producer_actor_id","event_sequence","event_type","evidence_refs","original_action_retest_receipt","occurred_at","previous_event_sha256","event_sha256"],"properties":{"schema":{"const":"hololake.persona-container-raise-hand-lifecycle-event/v1"},"event_id":{"type":"string"},"issue_id":{"type":"string"},"initial_envelope_sha256":{"$ref":"#/$defs/sha256"},"producer_actor_id":{"type":"string"},"event_sequence":{"type":"integer","minimum":0},"event_type":{"enum":["ACKNOWLEDGED","REPAIR_STARTED","RETESTED_PASS","RETESTED_FAIL","RESOLVED"]},"evidence_refs":{"type":"array","items":{"$ref":"#/$defs/evidenceRef"}},"original_action_retest_receipt":{"anyOf":[{"$ref":"#/$defs/sha256"},{"type":"null"}]},"occurred_at":{"$ref":"#/$defs/timestamp"},"previous_event_sha256":{"anyOf":[{"$ref":"#/$defs/sha256"},{"type":"null"}]},"event_sha256":{"$ref":"#/$defs/sha256"}}}
}
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "hololake://schema/self-observation-support/v1",
"title": "HoloLake Self-Observation Supporting Contracts v1",
"$defs": {
"sha256": {
"type": "string",
"pattern": "^[0-9a-f]{64}$"
},
"timestamp": {
"type": "string",
"format": "date-time"
},
"evidenceRef": {
"$ref": "hololake://schema/foundation-contracts/v1#evidenceRef"
},
"activeDeploymentManifest": {
"$anchor": "activeDeploymentManifest",
"type": "object",
"additionalProperties": false,
"required": [
"schema",
"inventory_id",
"batch_id",
"previously_accepted_batches",
"instances",
"manifest_sha256",
"authority_granted"
],
"properties": {
"schema": {
"const": "hololake.active-deployment-instance-manifest/v1"
},
"inventory_id": {
"type": "string",
"minLength": 1
},
"batch_id": {
"type": "string",
"pattern": "^HLP-BATCH-[0-9]{2}$"
},
"previously_accepted_batches": {
"type": "array",
"uniqueItems": true,
"items": {
"type": "string"
}
},
"instances": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"module_id",
"instance_id",
"module_version",
"activation_state",
"cardinality",
"heartbeat_policy_id",
"admission_receipt_sha256"
],
"properties": {
"module_id": {
"type": "string"
},
"instance_id": {
"type": "string"
},
"module_version": {
"type": "string"
},
"activation_state": {
"enum": [
"EXPECTED_ACTIVE",
"EXPECTED_PAUSED",
"NOT_YET_ADMITTED",
"REVOKED"
]
},
"cardinality": {
"type": "integer",
"minimum": 1
},
"heartbeat_policy_id": {
"type": "string"
},
"admission_receipt_sha256": {
"$ref": "#/$defs/sha256"
}
}
}
},
"manifest_sha256": {
"$ref": "#/$defs/sha256"
},
"authority_granted": {
"const": false
}
}
},
"livenessPolicy": {
"$anchor": "livenessPolicy",
"type": "object",
"additionalProperties": false,
"required": [
"schema",
"heartbeat_policy_id",
"interval_milliseconds",
"max_lease_milliseconds",
"grace_milliseconds",
"allowed_clock_skew_milliseconds",
"policy_sha256",
"signatures",
"authority_granted"
],
"properties": {
"schema": {
"const": "hololake.module-liveness-policy/v1"
},
"heartbeat_policy_id": {
"type": "string",
"minLength": 1
},
"interval_milliseconds": {
"type": "integer",
"minimum": 1
},
"max_lease_milliseconds": {
"type": "integer",
"minimum": 1
},
"grace_milliseconds": {
"type": "integer",
"minimum": 0
},
"allowed_clock_skew_milliseconds": {
"type": "integer",
"minimum": 0
},
"policy_sha256": {
"$ref": "#/$defs/sha256"
},
"signatures": {
"type": "array",
"minItems": 2,
"items": {
"type": "object",
"additionalProperties": false,
"required": ["signer_id", "algorithm", "signature_b64"],
"properties": {
"signer_id": {"type": "string", "minLength": 1},
"algorithm": {"const": "Ed25519"},
"signature_b64": {"type": "string", "minLength": 1}
}
}
},
"authority_granted": {
"const": false
}
}
},
"durableHead": {
"$anchor": "durableHead",
"type": "object",
"additionalProperties": false,
"required": [
"schema",
"module_id",
"instance_id",
"boot_id",
"event_sequence",
"event_sha256",
"record_count",
"commit_marker",
"fsynced_at",
"head_sha256"
],
"properties": {
"schema": {
"const": "hololake.module-event-durable-head/v1"
},
"module_id": {
"type": "string"
},
"instance_id": {
"type": "string"
},
"boot_id": {
"type": "string"
},
"event_sequence": {
"type": "integer",
"minimum": 0
},
"event_sha256": {
"$ref": "#/$defs/sha256"
},
"record_count": {
"type": "integer",
"minimum": 1
},
"commit_marker": {
"type": "string",
"minLength": 1
},
"fsynced_at": {
"$ref": "#/$defs/timestamp"
},
"head_sha256": {
"$ref": "#/$defs/sha256"
}
}
},
"stateValidationReceipt": {
"$anchor": "stateValidationReceipt",
"type": "object",
"additionalProperties": false,
"required": [
"schema",
"receipt_id",
"module_id",
"instance_id",
"snapshot_sha256",
"durable_head_sha256",
"durable_head_boot_id",
"durable_head_event_sequence",
"durable_head_record_count",
"durable_head_commit_marker",
"trusted_received_at",
"last_accepted_at",
"observer_clock_id",
"heartbeat_policy_id",
"heartbeat_policy_sha256",
"admission_receipt_sha256",
"computed_deadline_at",
"liveness_verdict",
"validation_errors",
"receipt_sha256",
"authority_granted"
],
"properties": {
"schema": {
"const": "hololake.module-state-validation-receipt/v1"
},
"receipt_id": {
"type": "string"
},
"module_id": {
"type": "string"
},
"instance_id": {
"type": "string"
},
"snapshot_sha256": {
"$ref": "#/$defs/sha256"
},
"durable_head_sha256": {
"$ref": "#/$defs/sha256"
},
"durable_head_boot_id": {
"type": "string"
},
"durable_head_event_sequence": {
"type": "integer",
"minimum": 0
},
"durable_head_record_count": {
"type": "integer",
"minimum": 1
},
"durable_head_commit_marker": {
"type": "string"
},
"trusted_received_at": {
"$ref": "#/$defs/timestamp"
},
"last_accepted_at": {
"$ref": "#/$defs/timestamp"
},
"observer_clock_id": {
"type": "string"
},
"heartbeat_policy_id": {
"type": "string"
},
"heartbeat_policy_sha256": {
"$ref": "#/$defs/sha256"
},
"admission_receipt_sha256": {
"$ref": "#/$defs/sha256"
},
"computed_deadline_at": {
"$ref": "#/$defs/timestamp"
},
"liveness_verdict": {
"enum": [
"FRESH",
"STALE",
"MISSING",
"INVALID",
"FORKED"
]
},
"validation_errors": {
"type": "array",
"items": {
"type": "string"
}
},
"receipt_sha256": {
"$ref": "#/$defs/sha256"
},
"authority_granted": {
"const": false
}
}
},
"raiseHandLifecycleEvent": {
"$anchor": "raiseHandLifecycleEvent",
"type": "object",
"additionalProperties": false,
"required": [
"schema",
"event_id",
"issue_id",
"initial_envelope_sha256",
"producer_actor_id",
"event_sequence",
"event_type",
"evidence_refs",
"original_action_retest_receipt",
"occurred_at",
"previous_event_sha256",
"event_sha256"
],
"properties": {
"schema": {
"const": "hololake.persona-container-raise-hand-lifecycle-event/v1"
},
"event_id": {
"type": "string"
},
"issue_id": {
"type": "string"
},
"initial_envelope_sha256": {
"$ref": "#/$defs/sha256"
},
"producer_actor_id": {
"type": "string"
},
"event_sequence": {
"type": "integer",
"minimum": 0
},
"event_type": {
"enum": [
"ACKNOWLEDGED",
"REPAIR_STARTED",
"RETESTED_PASS",
"RETESTED_FAIL",
"RESOLVED"
]
},
"evidence_refs": {
"type": "array",
"items": {
"$ref": "#/$defs/evidenceRef"
}
},
"original_action_retest_receipt": {
"anyOf": [
{
"$ref": "#/$defs/sha256"
},
{
"type": "null"
}
]
},
"occurred_at": {
"$ref": "#/$defs/timestamp"
},
"previous_event_sha256": {
"anyOf": [
{
"$ref": "#/$defs/sha256"
},
{
"type": "null"
}
]
},
"event_sha256": {
"$ref": "#/$defs/sha256"
}
},
"allOf": [
{
"if": {"properties": {"event_sequence": {"const": 0}}},
"then": {"properties": {"previous_event_sha256": {"type": "null"}}},
"else": {"properties": {"previous_event_sha256": {"$ref": "#/$defs/sha256"}}}
}
]
}
}
}

View file

@ -32,8 +32,10 @@ FOUNDATION_DRAWINGS = STAGE1 / "BATCH-00-FOUNDATION-INTERFACE-DRAWINGS.json"
BATCH_HANDOFF = STAGE1 / "BATCH-HANDOFF-CONTRACT.json"
PUBLIC_SNAPSHOT_SCHEMA = STAGE1 / "schemas/HLP-PUBLIC-SNAPSHOT-v1.schema.json"
SELF_SUPPORT_SCHEMA = STAGE1 / "schemas/HLP-SELF-OBSERVATION-SUPPORT-v1.schema.json"
SELF_PRIMARY_SCHEMA = STAGE1 / "schemas/HLP-SELF-OBSERVATION-PRIMARY-v1.schema.json"
HANDOFF_TEST_RECEIPT = STAGE1 / "BATCH-00-HANDOFF-VALIDATOR-TEST-RECEIPT.json"
TCS_CONTAINER_SITE_SURVEY = STAGE1 / "BATCH-00-TCS-CONTAINER-SITE-SURVEY.json"
SELF_SCHEMA_REVIEW = STAGE1 / "BATCH-00-SELF-OBSERVATION-SCHEMA-REVIEW-RECEIPT.json"
MULTIPATH_CONSOLE = ROOT / "server-tools/heartbeat-multipath-console/console.py"
EPOCH_UTC = datetime(2025, 4, 25, 16, 0, 0, tzinfo=timezone.utc)
ZHUYUAN_BIRTH = date(2026, 3, 5)
@ -114,8 +116,10 @@ def hashes() -> dict:
"batch_handoff": BATCH_HANDOFF,
"public_snapshot_schema": PUBLIC_SNAPSHOT_SCHEMA,
"self_observation_support_schema": SELF_SUPPORT_SCHEMA,
"self_observation_primary_schema": SELF_PRIMARY_SCHEMA,
"handoff_validator_test_receipt": HANDOFF_TEST_RECEIPT,
"tcs_container_site_survey": TCS_CONTAINER_SITE_SURVEY,
"self_observation_schema_review": SELF_SCHEMA_REVIEW,
"time_map": TIME_MAP,
}
values = {key: {"path": str(path), "sha256": sha(path)} for key, path in paths.items()}
@ -349,8 +353,9 @@ def audit() -> dict:
contract_fields = {"schema", *handoff.get(contract_key, {}).get("required_fields", [])}
if contract_fields != set(schema_bundle["$defs"][def_key].get("required", [])):
errors.append("BATCH_HANDOFF_SCHEMA_DRIFT:" + contract_key)
primary_schema = load(SELF_PRIMARY_SCHEMA)
for contract_key, def_key in [("module_snapshot", "moduleStateSnapshot"), ("module_event", "moduleStateEvent"), ("aggregate_graph", "aggregateGraph"), ("native_brain_judgment", "brainJudgment"), ("raise_hand_envelope", "raiseHand")]:
if set(observation.get(contract_key, {}).get("required_fields", [])) != set(schema_bundle["$defs"][def_key].get("required", [])):
if set(observation.get(contract_key, {}).get("required_fields", [])) != set(primary_schema["$defs"][def_key].get("required", [])):
errors.append("SELF_OBSERVATION_SCHEMA_DRIFT:" + contract_key)
support_schema = load(SELF_SUPPORT_SCHEMA)
support_defs = support_schema.get("$defs", {})
@ -362,6 +367,15 @@ def audit() -> dict:
lifecycle = observation.get("raise_hand_envelope", {}).get("lifecycle_events", {})
if set(lifecycle.get("required_fields", [])) != set(support_defs.get("raiseHandLifecycleEvent", {}).get("required", [])):
errors.append("SELF_OBSERVATION_SCHEMA_DRIFT:raise_hand_lifecycle_event")
self_review = load(SELF_SCHEMA_REVIEW)
expected_self_hashes = {
"contract": sha(SELF_OBSERVATION),
"primary_schema": sha(SELF_PRIMARY_SCHEMA),
"support_schema": sha(SELF_SUPPORT_SCHEMA),
"foundation_schema": sha(STAGE1 / "schemas/HLP-FOUNDATION-CONTRACTS-v1.schema.json"),
}
if self_review.get("outcome") != "PASS" or self_review.get("hashes") != expected_self_hashes:
errors.append("SELF_OBSERVATION_SCHEMA_REVIEW_RECEIPT_MISMATCH")
return {"outcome": "PASS" if not errors else "FAIL", "errors": errors, "office_count": len(ids), "evolution_nodes": len(nodes), "stage1_module_count":len(module_ids), "repo012_head": git_head(), "time": clock()}