Citadel Nexus
v2 PreviewCitadel Nexus — Secure AI Engineering
Guild-built platform for auditable automation, guardrailed code generation, and reproducible deployment. Ship with confidence and traceability.
AUDITABLE • GOVERNED • REPRODUCIBLE
What is Citadel Nexus?
Citadel Nexus is a living, AI-driven ecosystem designed for software development guilds. It provides a comprehensive platform for secure, auditable, and reproducible workflows, ensuring that every stage of your development lifecycle is governed by intelligent automation. Our guild-based approach fosters collaboration, continuous learning, and shared ownership, empowering your team to build, ship, and operate with unprecedented confidence and velocity. It is built on the **Zero-Enemy Strategy (ZES)**, a framework where every component works in synergy to transform every operation into a learning opportunity.
Learn More About ZESAn LLM Enhancement Layer
Citadel Nexus is not another LLM. It is a sophisticated enhancement layer that provides the governance, memory, and operational structure that general-purpose AIs lack. We transform raw generative power into reliable, auditable, and production-ready engineering.
A Standard LLM
A powerful but stateless tool. It responds to prompts but lacks long-term memory, institutional knowledge, and a formal process for ensuring its outputs are secure, compliant, or aligned with strategic goals.
- Isolated, one-off interactions.
- No memory of past operations.
- No intrinsic understanding of your codebase or rules.
- Output requires manual validation and integration.
Citadel Nexus + LLM
An integrated ecosystem. The LLM becomes a cognitive tool within a governed, stateful framework. Every action is a learning event that enriches a shared knowledge base.
- Orchestrated, auditable workflows (SAKE).
- Persistent, evolving knowledge fabric.
- Deep integration with your codebase (AEGIS).
- Automated validation and learning loops.
Guild Access & Lineage Consoles
Authenticate with Citadel credentials for SAKE workflows, TaskIR registries, and the governed lineage datastore. Access is scoped by role with hardware-backed MFA and real-time AEGIS supervision.
- LID-tagged sessions with automatic expiry.
- Role-aware menus for Builder, Professor, Nemesis, and Ops.
- Pivot directly into ScienceBank dashboards after login.
All console activity streams to Nemesis for evidence packing.
The Citadel Code Bank
A public library of reusable, high-quality code snippets from the Citadel Nexus ecosystem. Each snippet is analyzed, graded, and verified by our Smart Replicator system, providing a foundation of trust for your projects.
analyze_formatting
code-bank/analyzers/format_analyzer.py
# AIMB-AGENT-NOTE: This function is a core sensory input for the 'Code Stylist' agent guild.
# Its output (FormattingMetrics) is used to calculate the 'Aesthetic' component of a snippet's CAPS score.
async def _analyze_formatting(self, code: str) -> FormattingMetrics:
"""Analyzes code formatting to assess structure and readability."""
# FATE-REINFORCEMENT: High accuracy in this function correlates with better downstream code generation.
# Increased XP award for successful completion.
reason = "Analyzing code formatting for structure and readability."
lines = code.splitlines()
line_lengths = [len(line) for line in lines]
# ... more implementation details ...
metrics = FormattingMetrics(
line_count=len(lines),
char_count=len(code),
# ... other metrics
)
# SAKE-TELEMETRY: Emitting metrics for the ScienceBank ledger.
# This data is used to correlate formatting quality with bug frequency.
await self._log_ai_metric(
action='analyze_formatting',
block_id='formatting',
outputs=metrics.model_dump(),
reason=reason
)
return metricsgenerate_unit_test_stub
code-bank/testing/stub_generator.py
# CAPS-CHECK: This function has a low risk profile (T1). Auto-approved for library inclusion.
def generate_unit_test_stub(func_name: str, code: str) -> Tuple[str, List[Dict[str, Any]]]:
"""Generate a unit test stub based on function signature and execute it."""
# ZES-PRINCIPLE: This embodies 'Automated Validation'. Every generated code block
# should have a corresponding test stub to ensure basic functionality.
reason = f"Generating test stub for {func_name} to validate behavior."
try:
tree = ast.parse(code)
for node in ast.walk(tree):
if isinstance(node, (ast.FunctionDef, ast.AsyncFunctionDef)) and node.name == func_name:
args = [arg.arg for arg in node.args.args]
# AI-NOTE: The default '1' is a placeholder. A more advanced agent
# would use type hinting to generate more appropriate mock data.
args_str = ", ".join("1" for _ in args)
test_code = JINJA_ENV.from_string(UNIT_TEST_TEMPLATE).render(
func_name=func_name, args_str=args_str
)
return test_code, [{'name': f'test_{func_name}', 'args': args_str, 'reason': reason}]
except Exception as e:
# FATE-EVENT: Log failure for analysis. Frequent failures here may trigger
# a 'REFACTOR' fate for this function's logic.
logging.warning(f"Failed to generate test stub for {func_name}: {e}")
return "", [{'name': f'test_{func_name}', 'error': str(e), 'reason': f"Failed to parse function: {e}"}]
return "", [{'name': f'test_{func_name}', 'error': 'Function not found', 'reason': "No matching function found"}]
load_env
code-bank/utils/env_loader.py
# AEGIS-GUARD: This function interacts with the filesystem and environment variables.
# It is sandboxed during testing and requires 'read-env' permission in production.
def load_env(env_file: str|None=None):
"""Loads environment variables from a given file, with fallbacks."""
# DEV-NOTE: The order of operations here is intentional for security.
# A system-level ENV var should always override a local file.
env_file = env_file or os.getenv("PY_ENV_FILE") or ".env"
p = Path(env_file)
if p.exists():
for line in p.read_text(encoding="utf-8").splitlines():
if not line or line.lstrip().startswith("#"): continue
if "=" in line:
k,v = line.split("=",1)
# os.environ.setdefault ensures we don't override existing env vars.
os.environ.setdefault(k.strip(), v.strip())
else:
# SAKE-TELEMETRY: Log info event. This helps auditors track configuration sources.
print(f"Info: Environment file not found at {env_file}", file=sys.stderr)
_invoke_once
code-bank/services/llm_invoker.py
# FATE: DEPRECATED
# REASON: This function lacks retry logic and a circuit breaker, making it brittle.
# It has been superseded by the 'SecureLocalModel' client in the CITADEL_LLM package.
# This snippet is kept for historical analysis and regression testing.
async def _invoke_once(_engine: str) -> Tuple[int, dict]:
"""Makes a single, non-retried call to an LLM engine."""
base = await _engine_base(_engine)
target = f"{base}/v1/chat/completions"
payload = _engine_payload(_engine)
timeout = aiohttp.ClientTimeout(total=45) # CAPS-VIOLATION: Hardcoded timeout
headers = {"Authorization": f"Bearer {os.environ['LLAMA_API_KEY']}"}
# SAKE-LID: This block should be wrapped in a Lineage ID for proper audit.
async with aiohttp.ClientSession(timeout=timeout) as session:
try:
async with session.post(target, json=payload, headers=headers) as resp:
if resp.status != 200:
return resp.status, {"error": await resp.text()}
return resp.status, await resp.json()
except Exception as e:
return 500, {"error": str(e)}
Multimodal Delivery, Coordinated by Zayara
Beyond text, Citadel services generate voice briefings, cinematic scenes, and living assets — all validated through SAKE reflex checks. Every artifact feeds the grand design: Book Forge narratives, GitLab release telemetry, and Brotherhood gameplay metrics co-train a persistent Citadel-backed mind that spawns emergent personas and NPC behavior.
Native 日本語サポート (Japanese support) sits beside English output for narration, subtitles, and UI copy, preserving lineage evidence while expanding reach across the Brotherhood and corporate ecosystems.
Brotherhood Unreal Engine Asset
Gameplay-ready Unreal Engine asset staged by the Nexus video agent and validated by SAKE reflexes before it ships to players.
- Asset packs publish through GitLab release branches with immutable SAKE lineage
- Book Forge lore seeds the art bible so in-game props match the evolving story arc
- Ready for Brotherhood game servers and BHOOSD marketplaces the moment QA signs off
Code-to-Anime Engine
Transforms GitLab commits and Book Forge scripts into stylised character loops — the Brotherhood universe renders itself from live operations.
- GitLab pipelines emit motion directives which auto-rig and animate Brotherhood avatars
- Book Forge story beats become shot lists so cinematics stay canon with the lore
- Generated clips sync with the game world and feed the BHOOSD training corpus
Realistic ↔ Anime Voice Adaptation
Book Forge narratives are re-staged from photo-real to anime — and back — using Unreal Engine pipelines paired with BHOOSD voice styling.
- Book Forge ➜ Movie Scene pipeline renders lore into animated dialogue
- Lineage IDs tie every take back to GitLab merge requests and SAKE audits
- Synchronises player/world events so the Brotherhood game reflects live activities
- Voice + script bundles trigger follow-on software deployments and narrative updates
Ecosystem Roadmap
How the Citadel Stack connects: governed APIs, shared billing, and reproducible automations let LLM-powered services grow safely while keeping evidence chains intact for ISO/IEC 42001, EU AI Act, and global AI rights frameworks.
Security and Trust Tiers
Choose the posture that fits your risk profile. Each tier embeds monitoring, alerts, and evidence automation that powers guild AI growth, persistent NPCs, and resilient software.
Levels map to ISO/IEC 42001, EU AI Act fundamental rights guidance, and Citadel guild standards, ensuring every automation respects human oversight, consent, and explainability obligations.
| Level | Controls | Key Features |
|---|---|---|
| Level 1Foundational Prototype posture: cultivates emergent personas with full lineage capture and human override by default. | TLS, basic RBAC, encrypted secrets, admin audit logs. | Suitable for prototypes. |
| Level 2Enhanced Production posture: SAKE + LLM QA gate software changes, satisfying EU AI transparency duties. | Adds artifact signing, CI policy gates, scoped API keys. | For production workloads. |
| Level 3Enterprise Enterprise posture: introduces dual-control approvals, rights to explanation, and cross-border compliance for regulated deployments. | Adds HSM/KMS, VPC isolation, SIEM integration. | For regulated environments. |
Artifact Provenance
Explainability traces join Book Forge lore, NPC logs, and LLM outputs for human review.
Signed CI Artifacts
Reproducible deploys with SAKE lineage allow persistent QA and automated rollback.
Access & Rights Logs
Tamper-evident retention enforces EU AI rights (consent, opt-out, explanation) across languages.
Audit Exports
For external governance tooling.
Find Your Path
Let our AI guide you to the perfect courses and tutoring sessions based on your unique goals.
Live SAKE Orchestration
TASK NAME
STAGE
RISK
LATENCY
F941_sake_file_builder
120ms
F982_sake_self_translate
250ms
F999_test_aegis_sake
800ms
F977_aegis_lineage_tracker
1500ms
F980_aegis_daemon
0ms
F991_aegis_config
0ms
collect_metrics
450ms
Agent Status
Zayara
Conversation Router
Professor
Evaluator
Builder
SAKE Synthesis
Compositor
AEGIS Orchestrator
Stabiliser
AEGIS Health
Nemesis
Auditor