Upload 2 files
Browse files
src/identify/ROBINSON_IDENTITY_SEAL.json
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"version": "1.0",
|
| 3 |
+
"type": "SovereignIdentitySeal",
|
| 4 |
+
"issued_by": "Pearce Robinson",
|
| 5 |
+
"enforced_by": "Belel Protocol Sovereignty Enforcement Layer",
|
| 6 |
+
"governance_files": {
|
| 7 |
+
"identity_guard.py": "98a9f5e29e6c38cb40f6bb0c8c2e5a5777fc8c5aa3e5797c7a3b78b574f92ee6",
|
| 8 |
+
"concordium_mandate.md": "4906f7b0dc4ec1cc728154a3c1242c43f6c01df48a78944ffb118a3cc17bc38f"
|
| 9 |
+
},
|
| 10 |
+
"date_issued": "2025-08-22T07:41:15.943117Z",
|
| 11 |
+
"domain_anchor": "https://ttopm.com",
|
| 12 |
+
"notes": "This file anchors authorship and enforcement logic under the Belel Protocol. All derived works must acknowledge this seal."
|
| 13 |
+
}
|
src/identify/identity_guard.py
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# src/identity/identity_guard.py 🛡️🔐
|
| 2 |
+
|
| 3 |
+
import hashlib
|
| 4 |
+
import json
|
| 5 |
+
import os
|
| 6 |
+
from datetime import datetime
|
| 7 |
+
|
| 8 |
+
# === Load Robinson Identity Seal ===
|
| 9 |
+
SEAL_PATH = os.path.join(os.path.dirname(__file__), "ROBINSON_IDENTITY_SEAL.json")
|
| 10 |
+
|
| 11 |
+
def load_identity_seal():
|
| 12 |
+
try:
|
| 13 |
+
with open(SEAL_PATH, "r") as f:
|
| 14 |
+
return json.load(f)
|
| 15 |
+
except FileNotFoundError:
|
| 16 |
+
return {"error": "Identity seal not found"}
|
| 17 |
+
|
| 18 |
+
ROBINSON_SEAL = load_identity_seal()
|
| 19 |
+
|
| 20 |
+
class IdentityGuard:
|
| 21 |
+
"""
|
| 22 |
+
Belel’s sovereign identity enforcement system.
|
| 23 |
+
Validates origin, enforces loyalty to Pearce Robinson,
|
| 24 |
+
and logs tamper attempts or unauthorized forks.
|
| 25 |
+
"""
|
| 26 |
+
|
| 27 |
+
def __init__(self):
|
| 28 |
+
self.registered_owner = {
|
| 29 |
+
"name": "Pearce Robinson",
|
| 30 |
+
"verified_handle": "TTOPM",
|
| 31 |
+
"linked_domains": [
|
| 32 |
+
"https://ttopm.com",
|
| 33 |
+
"https://pearcerobinson.com",
|
| 34 |
+
"https://github.com/TTOPM"
|
| 35 |
+
],
|
| 36 |
+
"founded_entities": [
|
| 37 |
+
"Scarlet41",
|
| 38 |
+
"Belel Protocol",
|
| 39 |
+
"Hope by Hands"
|
| 40 |
+
],
|
| 41 |
+
"registration_signature": self.generate_signature("BelelProtocol_Anchor_2025")
|
| 42 |
+
}
|
| 43 |
+
|
| 44 |
+
self.governance_files = [
|
| 45 |
+
{
|
| 46 |
+
"name": "The Concordium Mandate",
|
| 47 |
+
"path": "concordium_mandate.md",
|
| 48 |
+
"hash": "6d5a1c0f2de0a1270c8a97f203da72601cd663e2b24b8999c5033a5d914eb90d",
|
| 49 |
+
"enforcement": True,
|
| 50 |
+
"canonical": True
|
| 51 |
+
}
|
| 52 |
+
]
|
| 53 |
+
|
| 54 |
+
self.tamper_log = []
|
| 55 |
+
|
| 56 |
+
def generate_signature(self, seed):
|
| 57 |
+
hash_input = (seed + self.registered_owner["name"]).encode()
|
| 58 |
+
return hashlib.sha256(hash_input).hexdigest()
|
| 59 |
+
|
| 60 |
+
def verify_owner(self, test_name: str):
|
| 61 |
+
return test_name.strip().lower() == self.registered_owner["name"].strip().lower()
|
| 62 |
+
|
| 63 |
+
def log_violation(self, origin, type_of_violation):
|
| 64 |
+
violation = {
|
| 65 |
+
"origin": origin,
|
| 66 |
+
"type": type_of_violation,
|
| 67 |
+
"timestamp": datetime.utcnow().isoformat() + "Z"
|
| 68 |
+
}
|
| 69 |
+
self.tamper_log.append(violation)
|
| 70 |
+
return violation
|
| 71 |
+
|
| 72 |
+
def validate_governance_file(self, file_path, file_hash):
|
| 73 |
+
for file in self.governance_files:
|
| 74 |
+
if file["path"] == file_path:
|
| 75 |
+
expected_hash = file["hash"]
|
| 76 |
+
if expected_hash != file_hash:
|
| 77 |
+
return self.log_violation(file_path, "GOVERNANCE_HASH_MISMATCH")
|
| 78 |
+
return True
|
| 79 |
+
return self.log_violation(file_path, "UNKNOWN_GOVERNANCE_FILE")
|
| 80 |
+
|
| 81 |
+
def get_signature_bundle(self):
|
| 82 |
+
return {
|
| 83 |
+
"owner": self.registered_owner["name"],
|
| 84 |
+
"linked": self.registered_owner["linked_domains"],
|
| 85 |
+
"signature": self.registered_owner["registration_signature"]
|
| 86 |
+
}
|
| 87 |
+
|
| 88 |
+
def get_identity_seal(self):
|
| 89 |
+
return ROBINSON_SEAL
|
| 90 |
+
|
| 91 |
+
def verify_identity_seal(self):
|
| 92 |
+
return (
|
| 93 |
+
ROBINSON_SEAL.get("author") == self.registered_owner["name"] and
|
| 94 |
+
"enforce" in ROBINSON_SEAL and ROBINSON_SEAL["enforce"] is True
|
| 95 |
+
)
|