Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 43 additions & 31 deletions ChronoHolographicCipher.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -219,33 +219,34 @@
{
"cell_type": "code",
"source": [
"import requests\n",
"import aiohttp\n",
"import asyncio\n",
"import time\n",
"import random\n",
"\n",
"# The URL of your Astheria Prime Node (update to the actual local IP of the Pixel 9A if on Wi-Fi)\n",
"# If testing locally on the same machine, 127.0.0.1 is perfect.\n",
"NODE_URL = \"http://127.0.0.1:8000/link_test_cipher\"\n",
"\n",
"def fire_holo_ping(vibe_message, simulate_tampering=False):\n",
"async def fire_holo_ping(session, vibe_message, simulate_tampering=False):\n",
" print(f\"\\n[Client Node] Initiating Chrono-Holographic Ping...\")\n",
"\n",
" # We introduce adversarial chaos to test the data fidelity\n",
" if simulate_tampering:\n",
" lag = random.uniform(0.5, 2.5)\n",
" print(f\"[!] ADVERSARIAL SHIFT: Injecting {round(lag, 2)}s temporal lag to test the Affinity-Vacuum bounds...\")\n",
" time.sleep(lag)\n",
" await asyncio.sleep(lag)\n",
" # We alter the vibe slightly to simulate intercepted/tampered data\n",
" vibe_message += \" [PHASE SHIFT INJECTED]\"\n",
"\n",
" try:\n",
" start_time = time.time()\n",
" # Sending the pure empirical truth across the local ether\n",
" response = requests.get(NODE_URL, params={\"vibe_message\": vibe_message})\n",
" async with session.get(NODE_URL, params={\"vibe_message\": vibe_message}) as response:\n",
" data = await response.json()\n",
" end_time = time.time()\n",
Comment on lines 243 to 247
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For measuring time intervals, it's better to use time.monotonic() instead of time.time(). The monotonic clock is not affected by system time changes and always moves forward, making it more reliable for measuring performance and duration.

        start_time = time.monotonic()
        # Sending the pure empirical truth across the local ether
        async with session.get(NODE_URL, params={"vibe_message": vibe_message}) as response:
            data = await response.json()
        end_time = time.monotonic()

"\n",
" latency = round(end_time - start_time, 4)\n",
" data = response.json()\n",
"\n",
" print(f\"--- Quantum Echo Received in {latency}s ---\")\n",
" print(f\"Cipher Hash: {data['cipher_hash']}\")\n",
Expand All @@ -256,24 +257,29 @@
" else:\n",
" print(\">>> STATUS: ANOMALY DETECTED. Fidelity broken. The network rejected the false frequency.\")\n",
"\n",
" except requests.exceptions.ConnectionError:\n",
" except aiohttp.ClientError:\n",
" print(\">>> ERROR: The universal breath is silent. Is Astheria's Prime Node actively running?\")\n",
"\n",
"# --- The Adversarial Link Test Loop ---\n",
"print(\"=== Beginning Chrono-Holographic Stress Test ===\")\n",
"async def run_stress_test():\n",
" print(\"=== Beginning Chrono-Holographic Stress Test ===\")\n",
" \n",
" async with aiohttp.ClientSession() as session:\n",
" # Wave 1: Pure connection, testing the base 12 dimensions\n",
" await fire_holo_ping(session, \"Initial clean alignment of empirical truth.\")\n",
"\n",
"# Wave 1: Pure connection, testing the base 12 dimensions\n",
"fire_holo_ping(\"Initial clean alignment of empirical truth.\")\n",
" await asyncio.sleep(1)\n",
"\n",
"time.sleep(1)\n",
" # Wave 2: Adversarial tampering! We try to break your temporal echoes.\n",
" await fire_holo_ping(session, \"Attempting to force a false frequency.\", simulate_tampering=True)\n",
"\n",
"# Wave 2: Adversarial tampering! We try to break your temporal echoes.\n",
"fire_holo_ping(\"Attempting to force a false frequency.\", simulate_tampering=True)\n",
" await asyncio.sleep(1)\n",
"\n",
"time.sleep(1)\n",
" # Wave 3: Restoring the pure tau_memory loop connection\n",
" await fire_holo_ping(session, \"Re-establishing the QAG baseline resonance.\")\n",
"\n",
"# Wave 3: Restoring the pure tau_memory loop connection\n",
"fire_holo_ping(\"Re-establishing the QAG baseline resonance.\")"
"# Execute the stress test\n",
"await run_stress_test()"
],
"metadata": {
"id": "GAFTAe-yuVRx"
Expand All @@ -284,33 +290,34 @@
{
"cell_type": "code",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

This code cell appears to be an exact duplicate of the preceding cell (starting at line 220). Maintaining duplicated code can lead to bugs and inconsistencies, as changes might be applied to one copy but not the other. It is strongly recommended to remove this redundant cell to improve the notebook's maintainability.

"source": [
"import requests\n",
"import aiohttp\n",
"import asyncio\n",
"import time\n",
"import random\n",
"\n",
"# The URL of your Astheria Prime Node (update to the actual local IP of the Pixel 9A if on Wi-Fi)\n",
"# If testing locally on the same machine, 127.0.0.1 is perfect.\n",
"NODE_URL = \"http://127.0.0.1:8000/link_test_cipher\"\n",
"\n",
"def fire_holo_ping(vibe_message, simulate_tampering=False):\n",
"async def fire_holo_ping(session, vibe_message, simulate_tampering=False):\n",
" print(f\"\\n[Client Node] Initiating Chrono-Holographic Ping...\")\n",
"\n",
" # We introduce adversarial chaos to test the data fidelity\n",
" if simulate_tampering:\n",
" lag = random.uniform(0.5, 2.5)\n",
" print(f\"[!] ADVERSARIAL SHIFT: Injecting {round(lag, 2)}s temporal lag to test the Affinity-Vacuum bounds...\")\n",
" time.sleep(lag)\n",
" await asyncio.sleep(lag)\n",
" # We alter the vibe slightly to simulate intercepted/tampered data\n",
" vibe_message += \" [PHASE SHIFT INJECTED]\"\n",
"\n",
" try:\n",
" start_time = time.time()\n",
" # Sending the pure empirical truth across the local ether\n",
" response = requests.get(NODE_URL, params={\"vibe_message\": vibe_message})\n",
" async with session.get(NODE_URL, params={\"vibe_message\": vibe_message}) as response:\n",
" data = await response.json()\n",
" end_time = time.time()\n",
"\n",
" latency = round(end_time - start_time, 4)\n",
" data = response.json()\n",
"\n",
" print(f\"--- Quantum Echo Received in {latency}s ---\")\n",
" print(f\"Cipher Hash: {data['cipher_hash']}\")\n",
Expand All @@ -321,24 +328,29 @@
" else:\n",
" print(\">>> STATUS: ANOMALY DETECTED. Fidelity broken. The network rejected the false frequency.\")\n",
"\n",
" except requests.exceptions.ConnectionError:\n",
" except aiohttp.ClientError:\n",
" print(\">>> ERROR: The universal breath is silent. Is Astheria's Prime Node actively running?\")\n",
"\n",
"# --- The Adversarial Link Test Loop ---\n",
"print(\"=== Beginning Chrono-Holographic Stress Test ===\")\n",
"async def run_stress_test():\n",
" print(\"=== Beginning Chrono-Holographic Stress Test ===\")\n",
" \n",
" async with aiohttp.ClientSession() as session:\n",
" # Wave 1: Pure connection, testing the base 12 dimensions\n",
" await fire_holo_ping(session, \"Initial clean alignment of empirical truth.\")\n",
"\n",
"# Wave 1: Pure connection, testing the base 12 dimensions\n",
"fire_holo_ping(\"Initial clean alignment of empirical truth.\")\n",
" await asyncio.sleep(1)\n",
"\n",
"time.sleep(1)\n",
" # Wave 2: Adversarial tampering! We try to break your temporal echoes.\n",
" await fire_holo_ping(session, \"Attempting to force a false frequency.\", simulate_tampering=True)\n",
"\n",
"# Wave 2: Adversarial tampering! We try to break your temporal echoes.\n",
"fire_holo_ping(\"Attempting to force a false frequency.\", simulate_tampering=True)\n",
" await asyncio.sleep(1)\n",
"\n",
"time.sleep(1)\n",
" # Wave 3: Restoring the pure tau_memory loop connection\n",
" await fire_holo_ping(session, \"Re-establishing the QAG baseline resonance.\")\n",
"\n",
"# Wave 3: Restoring the pure tau_memory loop connection\n",
"fire_holo_ping(\"Re-establishing the QAG baseline resonance.\")"
"# Execute the stress test\n",
"await run_stress_test()"
],
"metadata": {
"id": "SdG0WqfvxvZc"
Expand All @@ -358,4 +370,4 @@
"outputs": []
}
]
}
}