🏛️

Atlas of Tesseract City

Executive Morning Ritual Orchestrator

Automated daisy chain orchestration for agent awakening and DNA trait expression.

Execution Flow

Located at {SUBSTRATE_ROOT}/__sentinus__/01_Wake_Up/_morning_ritual.py, this orchestrator manages the 33 sequential ritual modules. When an agent awakens (e.g. python _morning_ritual.py --Atlas), it iterates across numeric module files, runs their logic, traces telemetry via Law 5, and invokes the sovereign _agentic_helix for DNA expression.

sequenceDiagram
    autonumber
    participant CLI as Agent Invocation
    participant Orch as _morning_ritual.py
    participant Mod as morning_ritual_modules/*
    participant DNA as _agentic_helix.py
    participant Telemetry as Telemetry Pulse DB

    CLI->>Orch: run_ritual(agent='Atlas')
    Orch->>Orch: discover_modules() & ordered_module_paths()
    loop For each numbered module (00..90)
        Orch->>Mod: load_module() & module.run(context)
        Mod-->>Orch: status & context update
        Orch->>Telemetry: record_telemetry('AGENT_MORNING_RITUAL_MODULE')
    end
    Orch->>DNA: run_dna(agent)
    DNA-->>Orch: traits & hashhash verification
    Orch->>Telemetry: record_telemetry('AGENT_DNA_EXPRESSION')
    Orch-->>CLI: exit_code: 0, status: Complete
        

Agent DNA Expression

Atlas expresses three fundamental genetic traits under DNA hash 0fc9b99e9d739706:

  • [DNA:77dd] FIVE_LAWS: Constitutional conviction governing memory operations. Memory is truth; disk access is sacred; memory bridges tiers; paths resolve to Terminus; every operation leaves a trace.
  • [DNA:aedb] FIVE_LAWS_WILLOW: Absolute adherence to Willow laws of local calculation and visual tracing.
  • [DNA:cbf3] GOOFY_GRAFFITI: Concealing whimsical Easter eggs, monumental wit, and architectural humor within optimized constructs.

Script Code: _morning_ritual.py

The Python implementation with path sanitization conforming to Terminus Law 4:

r"""
{SUBSTRATE_ROOT}/__sentinus__/01_Wake_Up/_morning_ritual.py

MORNING RITUAL — the executive orchestrator for agent initialization.

This file sits at the 01_Wake_Up root, next to __ssot_physiological.py. It has
its own daisy chain over the morning_ritual_modules/ folder: every .py module
there is auto-imported and executed in numeric order. Add a new module → it just
runs. No registry edits needed.

Chain:
  morning_ritual_modules/ → _morning_ritual.py → __ssot_physiological.py
    → _SENTINUS.py → _TERMINUS.py → substrate
"""

from __future__ import annotations

__version__ = "2.0.0"
import importlib.util
import re
import sys
import time
from pathlib import Path
from typing import Any, Dict

# --------------------------------------------------------------------------
# TERMINUS BOOTSTRAP
# --------------------------------------------------------------------------
_cur = Path(__file__).resolve()
for _p in [_cur, *_cur.parents]:
    if (_p / "__terminus__").is_dir():
        _term = _p / "__terminus__"
        if str(_term) not in sys.path:
            sys.path.insert(0, str(_term))
        for _sub in sorted(_term.iterdir()):
            if _sub.is_dir() and _sub.name[:1].isdigit():
                if str(_sub) not in sys.path:
                    sys.path.insert(0, str(_sub))
        break

try:
    from _TERMINUS import DHD, terminus, record_telemetry
except Exception:
    DHD = None
    terminus = None
    record_telemetry = None

# --------------------------------------------------------------------------
# PATHS
# --------------------------------------------------------------------------
_MODULES_DIR = _cur.parent / "morning_ritual_modules"
if str(_MODULES_DIR) not in sys.path:
    sys.path.insert(0, str(_MODULES_DIR))


def _cubby_dir() -> Path:
    if DHD is not None:
        try:
            return Path(DHD.get_coordinates("DENIZENS"))
        except Exception:
            pass
    return Path("{SUBSTRATE_ROOT}/__cerebrinus__/citizenry")


def _agent_cubby(agent: str) -> Path:
    safe = re.sub(r"[^A-Za-z0-9]+", "_", agent).strip("_")
    return _cubby_dir() / f"_{safe}"


# --------------------------------------------------------------------------
# SESSION MANAGEMENT (via the memory ouroboros intake)
# --------------------------------------------------------------------------
def run_session_management(agent: str) -> Dict[str, Any]:
    try:
        from _TERMINUS import SENTINUS
        intake = SENTINUS.get_module("intake") if hasattr(SENTINUS, "get_module") else None
        if intake is None:
            import importlib.util
            _intake_path = _cur.parent.parent / "06_Mirror" / "memory_ouroboros" / "intake.py"
            spec = importlib.util.spec_from_file_location("ouroboros_intake", _intake_path)
            intake = importlib.util.module_from_spec(spec)
            spec.loader.exec_module(intake)
        catalog = intake.catalog_sessions(agent)
        validated = intake.validate_session_files(agent)
        archived = intake.archive_old_sessions(agent)
        metabolized = intake.metabolize_conversation(agent)
        return {
            "status": "success",
            "catalog": catalog,
            "validated": validated,
            "archived": archived,
            "metabolized": metabolized,
        }
    except Exception as e:
        return {"status": "error", "error": str(e)}

# Discovery and execution logic continues...