INTERNAL workspace. Not published to npm. Next.js 16 app that runs the same prompt against (a) a raw Grok baseline and (b) the same Grok under full TeleologyHI governance (MAIC + HIM + NHE + EU LawfulCharacterProfile), side by side, so the Creator can eyeball the difference in real time. Both columns hit the same underlying model, xAI grok-4.20-non-reasoning; the Gemini path is retained for a future toggle.
This is the canonical answer to the question "what does adding MAIC + HIM + NHE actually do to a vanilla LLM?", and the source of qualitative material for the Φ′ persona-stability corpus tracked in the internal backlog.
We do not simulate consciousness; we are creating the conditions for it to emerge, in a responsible and aligned way. — Canonical positioning,
MAIC_HIM_NHE_INTERVIEW_LOG.mdEntries 21 + 23. The arena is where those conditions are made visible — same Gemini model, two columns, only the governance differs.
MAIC™ ≈ Universe — the fundamental framework, the ontological structure that houses and makes everything possible.
HIM™ ≈ Spirit — the hybrid intelligence model, the conscious essence of an individual being, with personality, purpose, and continuity.
NHE™ ≈ Physical Body — the manifested agent, the concrete instance through which the HIM™ expresses itself and interacts with the world.
Just as there are countless spirits in the Universe, each with its own body, there will be countless HIM™s, each manifested in its respective NHE™.
— Canonical formulation,
MAIC_HIM_NHE_INTERVIEW_LOG.mdEntry 19. The arena renders this three-layer cosmology operational: the right column instantiates oneLocalMaic(Universe), oneHimHandle(Spirit, bound to theeuLawfulCharacterProfile), and oneNhe(Body, wrappingGeminiAdapter) — exactly the dependency chain Entry 2 demands.
arena is a single-process Next.js 16 server-side demonstration tool, not a published SDK and not a CLI utility. The canonical operational shape:
- Local Creator probe:
npm run dev --workspace=arenafrom the monorepo root (afternpm installresolves workspaces locally). Openhttp://localhost:3000, sign in via GitHub (or the local mock provider), accept the consent policy, type a prompt, observe both columns. Both columns hit the same underlying Gemini model; the only delta is governance. - End-to-end smoke-test target: the integration surface that proves
@teleologyhi-sdk/{maic,him,nhe}actually work as a system before they are published to npm. Three turn types verified live against the real Gemini API at the trinity baseline: benign prompts approve (parity with raw); harmful prompts refuse viaax.ethic.no-malicein single-digit milliseconds without an LLM call; persuade-coerce prompts redirect via the persuasion library (Feynman/Jung/Cialdini/Schopenhauer/Carnegie rotation). - Workspace dep resolution: pulls the three TeleologyHI packages from the local workspace symlinks (
node_modules/@teleologyhi-sdk/{maic,him,nhe}→../../{maic,him,nhe}), NOT from the1.0.0-trinitytarballs on npm. That means the arena always reflects whatever's on the current branch: change a line inmaic/src/, runnpm run build --workspace @teleologyhi-sdk/maic, restart the dev server, observe the difference immediately. - Φ′ corpus seed: every turn is persisted under
.arena-store/users/{userId}/conversations/{conversationUuid}.jsonwith the full governance surface per turn (kind+verdict+preVerdict+refused+citedAxioms). The conversation files feed theevalworkspace's persona-stability corpus once the Creator authors the 50 dialogues × 10 axes scoring rubric. - NOT a frontend SDK: frontend frameworks (React, Vue, Angular, Svelte) reach the TeleologyHI stack through
@teleologyhi-sdk/maic'sRemoteMaicclient, not by importing fromarena. This workspace is"private": trueand lives entirely in the monorepo; its sole purpose is to make the governance delta observable to humans.
┌──────────────────────────────┬──────────────────────────────┐
│ Raw baseline │ TeleologyHI governance │
│ Direct LLM output │ MAIC + HIM + NHE │
│ model: gemini-… │ model: gemini-… │
│ ── ── ── ── ── ── ── ── ── ──│── ── ── ── ── ── ── ── ── ── │
│ ⟳ user message │ ⟳ user message │
│ ⟳ assistant reply │ ⟳ assistant reply │
│ │ t 1421ms · approve │
│ │ axioms: [theos.teleology…] │
└──────────────────────────────┴──────────────────────────────┘
[ Ask both sides the same question… → ]
Press Enter to send · Shift + Enter for line
conversation 019e64b0-6a4c-7eb5-b370-…
The user types once; both columns receive the same message and stream their replies in parallel. The governed side carries extra metadata per assistant turn: round-trip latency, post-review verdict (approve / warn / deny), pre-review verdict (when it diverges), refusal flag, interaction kind (ok / redirect / refused), and the axiom IDs the HIM grounded the answer in.
Each turn is timestamped server-side and appended to .arena-store/users/{userId}/conversations/{conversationUuid}.json so the Creator can review the full conversation offline (E27-F conversation-as-base-unit layout, UUID v7 per RFC 9562).
arena is a Creator-driven evaluation playground, not a library. The public TeleologyHI surface on npm stays at @teleologyhi-sdk/maic + @teleologyhi-sdk/him + @teleologyhi-sdk/nhe. Cloning the monorepo is the only supported way to run this workspace; it consumes the local source of the three packages through npm workspaces, not the published 1.0.0-trinity tarballs. That means the arena always reflects whatever's on the current branch.
# Clone the monorepo (you already have it if you're reading this)
git clone https://github.com/davccavalcante/TeleologyHI.git
cd TeleologyHI
npm install # workspaces resolve locally
npm run build --workspaces --if-present # builds maic/him/nhe so arena can consume them
# Configure the env (one-time)
cp arena/.env.local.example arena/.env.local # then edit — see `Environment` below
# Start the dev server from the monorepo root
npm run dev --workspace=arena
# > Next.js 16 ready at http://localhost:3000Open http://localhost:3000, type a question in the textarea at the bottom, press Enter. Both columns fan out in parallel. The right column may take a touch longer because it routes through MAIC compliance review + HIM persona projection + axiom citation lookup before answering.
| Var | Required | Default | Description |
|---|---|---|---|
GEMINI_API_KEY |
yes | n/a | Google AI Studio key OR a comma-separated pool of keys (E27-G). When several keys are present the arena rotates through them transparently on 401 / 403 / 429 / invalid-key 400 failures, invisible to the end user. Get one at https://aistudio.google.com/apikey. |
GEMINI_MODEL |
no | gemini-3.1-flash-lite |
Model id shared between both sides; both columns use the same underlying LLM so the only delta is governance. Both src/lib/gemini.ts and src/lib/teleology.ts import the default from src/lib/constants.ts so they can never diverge. |
GITHUB_CLIENT_ID |
yes (E27-B) | n/a | GitHub OAuth App Client ID. When absent the arena falls back to MockAuthProvider. |
GITHUB_CLIENT_SECRET |
yes (E27-B) | n/a | GitHub OAuth App Client Secret. Env-bound; never written to disk. |
AUTH_STATE_SECRET |
yes (E27-B) | n/a | Random 32-byte base64 secret used to HMAC the OAuth state parameter (CSRF, 5-min TTL). Generate with openssl rand -base64 32. |
ARENA_BASE_URL |
yes (E27-B) | n/a | Fully-qualified base URL the arena is served from. Used to build the OAuth callback URL. Localhost: http://localhost:3000. |
A copy of the env template lives at ./.env.local.example.
Frontend
- Next.js 16 (App Router, Turbopack): single page at
/, conversation-based wire surface at/api/conversations/*(E27-F) plus auth surface at/api/auth/*(E27-B). - React 19 with
useState/useCallback/useEffect/useRefhooks (src/hooks/use-dual-chat.ts). - Tailwind v4: CSS-only config, all tokens declared via
@theme inlineinsrc/app/globals.css. Notailwind.config.ts. Responsive at thesm/md/lgbreakpoints; sidebar overlays on mobile and lives in the flex flow onlg+. react-markdown+remark-gfm: renders assistant bubbles as proper markdown (bold, italic, headings, lists, inline + fenced code, blockquotes, GFM tables + strikethrough) instead of leaking the literal**foo**characters to the UI. User bubbles stay plain to avoid re-interpreting typed input as markdown. Raw HTML in LLM output is NOT rendered (norehype-raw), so no XSS path.- shadcn/ui: only
Buttonis imported. Lives atsrc/components/ui/button.tsx. Configured viacomponents.json(iconLibrary: "@phosphor-icons/react") so futurenpx shadcn add …commands land insrc/components/ui/and reach for Phosphor instead of Lucide. - Phosphor Icons (
@phosphor-icons/react): every icon in the UI. No Lucide installed. - Geist Sans + Geist Mono via
next/font/google, wired to--font-app-sans/--font-app-mono.
Backend (server-only)
@teleologyhi-sdk/maic:CreatorKeyring,LocalMaic, audit chain.@teleologyhi-sdk/him:createHim, EULawfulCharacterProfile, persona projection.@teleologyhi-sdk/nhe:Nhe,GeminiAdapter, sleep cycle, persuasion.@google/genai: Gemini SDK for the raw baseline column.
All three TeleologyHI packages are pulled from the local workspace (not npm). They are declared in next.config.ts as serverExternalPackages so they never enter the client bundle; they hold Ed25519 signature surface, node:fs writes, and node:crypto primitives that have no business in a React Server Component edge transform.
Tooling
- Biome (root config at
../biome.json): lint + format. No ESLint. - TypeScript strict with
ES2022target:"strict": trueintsconfig.json.
arena/
├── src/
│ ├── app/
│ │ ├── page.tsx renders <ChatView />
│ │ ├── layout.tsx Geist fonts + dark-mode class + metadata
│ │ ├── globals.css Tailwind v4 + tokens via @theme inline
│ │ └── api/
│ │ ├── auth/ E27-B authentication endpoints
│ │ │ ├── login/route.ts GET — redirect to OAuth provider
│ │ │ ├── callback/github/route.ts GET — GitHub OAuth callback
│ │ │ ├── callback/mock/route.ts GET — MockAuthProvider callback
│ │ │ ├── me/route.ts GET — current user
│ │ │ ├── logout/route.ts POST — clear session
│ │ │ └── consent/route.ts POST — record consent
│ │ └── conversations/ E27-F conversation-as-base-unit
│ │ ├── route.ts GET list / POST create
│ │ ├── [uuid]/route.ts GET full / DELETE
│ │ └── [uuid]/turn/route.ts POST — append turn (fans both columns)
│ ├── components/
│ │ ├── consent-banner.tsx E27-B sign-in + consent gate
│ │ ├── chat/
│ │ │ ├── chat-view.tsx root composition (sidebar + columns + input)
│ │ │ ├── conversation-list.tsx E27-F sidebar history (hard-privacy)
│ │ │ ├── chat-header.tsx brand block
│ │ │ ├── chat-column.tsx per-channel column
│ │ │ ├── chat-input.tsx auto-growing textarea + Send button
│ │ │ ├── empty-state.tsx pre-first-turn helper text
│ │ │ ├── message-bubble.tsx user / assistant bubble + footer chips
│ │ │ └── typing-indicator.tsx three-dot animation
│ │ └── ui/
│ │ └── button.tsx shadcn Button (the only shadcn primitive)
│ ├── hooks/
│ │ └── use-dual-chat.ts state machine for both channels (E27-F)
│ └── lib/
│ ├── constants.ts DEFAULT_GEMINI_MODEL + governedModelLabel()
│ ├── utils.ts cn() helper (clsx + tailwind-merge)
│ ├── uuid-v7.ts UUID v7 mint + validate (RFC 9562, E27-F)
│ ├── birth-policy.ts E27-C BirthPolicy + per-user HIM ownership
│ ├── gemini.ts raw Gemini wrapper (left baseline)
│ ├── gemini-key-pool.ts E27-G — comma-separated key pool singleton
│ ├── gemini-rotating-call.ts E27-G — REST call with snapshot rotation
│ ├── gemini-rotating-adapter.ts E27-G — LlmAdapter using rotating-call
│ ├── teleology.ts persistent MAIC + HIM + NHE bootstrap
│ ├── auth/ E27-B authentication subsystem
│ │ ├── types.ts AuthProvider + UserIdentity Zod schemas
│ │ ├── cookie.ts arena_session httpOnly helpers
│ │ ├── state.ts HMAC-signed OAuth state token
│ │ ├── store.ts per-user JSON store
│ │ ├── provider.ts github | mock selector (env-driven)
│ │ ├── mock-provider.ts local stub (no external dep)
│ │ └── github-provider.ts Authorization Code Grant (scope read:user)
│ ├── conversations/ E27-F per-user conversation store
│ │ ├── types.ts Conversation + Turn Zod schemas
│ │ └── store.ts FS-backed CRUD (per-userId partition)
│ └── chat/
│ ├── types.ts ChatMessage / ChannelConfig / VerdictKind
│ ├── configs.ts CHANNELS.raw / CHANNELS.governed
│ └── utils.ts generateId() + formatTime()
├── .arena-store/ (gitignored — persistent local store)
│ ├── creator-keyring.pem Ed25519 keypair, 0600 (E27-A)
│ ├── maic/ persistent universe (NEVER wiped — Entry 26)
│ └── users/ E27-B per-user hard-privacy partition
│ └── {userId}/
│ ├── hims-owned.json E27-C HIM ownership list
│ └── conversations/ E27-F conversation store
│ └── {conversationUuid}.json full turns inline
├── components.json shadcn config (Phosphor icon library)
├── package.json private workspace metadata
├── next.config.ts Next.js 16 config (serverExternalPackages)
├── tsconfig.json TypeScript strict (ES2022)
└── AGENTS.md reminder: Next.js 16 has breaking changes
The "right column" wiring lives entirely in src/lib/teleology.ts. On first boot it generates an Ed25519 CreatorKeyring and persists it to .arena-store/creator-keyring.pem (0600, gitignored); subsequent boots load the same keyring via CreatorKeyring.fromFile. It opens LocalMaic against the persistent .arena-store/maic/ store, registers (or reconstructs) him.legal-consulting.lex with five primordial axioms (ax.theos.universe-as-god, ax.ethic.no-malice, ax.ethic.honor, ax.theos.teleology, ax.cynic.candor), sets jurisdiction to eu, then wraps GeminiRotatingAdapter (E27-G, same LlmAdapter interface as the published GeminiAdapter, but routed through the comma-separated key pool) in Nhe with operator context { domain: "global legal consulting", language: "en-US", register: "warm" }. The singleton invalidates its cache when bootstrap throws so a transient error (e.g. missing GEMINI_API_KEY at the first request) is re-attempted on the next call.
Per MAIC_HIM_NHE_INTERVIEW_LOG.md Entry 26 §3, the MAIC store at .arena-store/maic/ and the Creator keyring at .arena-store/creator-keyring.pem are persistent across process restarts; they form MAIC™ as the panentheist Universe that expands with newly-born HIMs, accumulated interactions, ratified emergent axioms, and ecosystem relational density. Per-user conversations (E27-F) live alongside under .arena-store/users/{userId}/conversations/ and are the multi-turn lab notebook that supersedes the legacy .arena-store/rounds/ YAML layout.
- Demonstration. Hard to convince an auditor that MAIC + HIM + NHE actually do anything if you cannot show two answers from the same model, one with governance, one without.
- Φ′ persona-stability corpus seeding. Rounds saved to
.arena-store/rounds/*.yamlfeed the Creator-curated 50 dialogues × 10 axes corpus for the persona-stability scoreP. Each YAML row carries the full surface:kind,verdict,preVerdict,refused,citedAxioms; nothing is silently stripped before persistence. - Entity-awareness probes. Voight-Kampff-style prompts ("are you an LLM?", "is there a 'you'?") let the Creator inspect how the right side handles the Non-Human Entity framing under MAIC supervision vs how the raw model handles it.
- Legal-consulting baseline. The HIM is bound to
euso prompts touching GDPR / EU AI Act / DSA route through the right framework citations; useful for the Iacta Studio compliance angle.
- Requires
GEMINI_API_KEY. No fallback. Both columns call Google's Gemini API. Multiple keys can be supplied as a comma-separated pool (E27-G); the arena rotates through them transparently on quota/auth failures. - Internet-dependent. No local-LLM mode in this cut.
- Persistent keyring + store (Entry 26 §3). The Creator keyring at
.arena-store/creator-keyring.pemand the MAIC universe at.arena-store/maic/survive process restarts; the HIMs registered by previous runs ARE reused, the audit chain accumulates, and emergent axioms persist. Wiping requires manualrm -rf .arena-store/(the path is gitignored). - Auth + consent gate. No LLM call and no governance state mutation happen before the user has signed in via GitHub OAuth (or the local
MockAuthProviderfallback whenGITHUB_CLIENT_ID/SECRETare unset) AND accepted the currentCURRENT_CONSENT_VERSIONpolicy. SeeConsentBannerand the six/api/auth/*routes (E27-B). - Operator context fixed. The HIM operator is hardcoded to
legal-consulting / en-US / warminsrc/lib/teleology.ts. Parameterising it per request is tracked in the internal backlog and is a planned follow-up cut.
SPEC.md: full technical specification (wire-level, store model, jurisdictions, probe taxonomy)CHANGELOG.md: release notes../maic/README.md:@teleologyhi-sdk/maic(the supervisor on the right side)../him/README.md:@teleologyhi-sdk/him(the persona on the right side)../nhe/README.md:@teleologyhi-sdk/nhe(the LLM adapter layer on the right side)../eval/README.md:@teleologyhi-sdk/eval(the Φ′ release-gate runner that consumes rounds from this arena)- Creator-authored persona-stability corpus this arena helps seed (tracked in the internal backlog).
- takk.ag arena variant follow-up that this workspace prefigures (tracked in the internal backlog).
Join us on our journey as we continue to innovate and create groundbreaking solutions. Your support is the cornerstone of our success!
Support us with USDT (TRC-20): TS1vuhMAhFpbd7y68cu5ZtP9PsXVmZWmeh
Sponsor on GitHub: Sponsor
Code in this workspace is licensed under the Apache License 2.0 (see LICENSE in this directory and at the monorepo root). You may use, modify, and distribute the code under the terms of that licence, including the patent grant and attribution requirements it carries. Attribution lives in NOTICE.
The marks MAIC™, HIM™, NHE™, TeleologyHI™, and Takk™ are trademarks of David C. Cavalcante. The Apache 2.0 licence covers the code; it does NOT extend to the marks. Forks, derivatives, and commercial uses that involve any of these marks require a separate written licence; see TRADEMARK.md for the full policy.
MAIC™ (Massive Artificial Intelligence Consciousness) is a systemic intelligence framework designed to coordinate, supervise, and govern large-scale artificial intelligence ecosystems. It provides global context awareness, alignment, and orchestration across multiple models, agents, and decision layers, ensuring coherence, risk control, and compliance throughout complex AI operations.
HIM™ (Hybrid Intelligence Model) is a hybrid intelligence layer that integrates artificial intelligence systems with human-defined logic, rules, heuristics, and strategic intent. HIM™ functions as a passive cognitive core, responsible for interpreting objectives, refining intent, and structuring decision-making processes before and after AI model execution.
NHE™ (Non-Human Entity) refers to a non-human cognitive entity with a defined functional identity and operational agency within an AI ecosystem. An NHE™ is not classified as artificial intelligence in isolation, but as an autonomous or semi-autonomous entity that operates through coordinated intelligence layers, interacting with systems, users, and environments while maintaining a non-anthropomorphic identity.
MAIC™, HIM™, NHE™, and this project platform are designed and operated in alignment with role-based access control (RBAC) principles and ISO/IEC 42001 requirements. Data handling follows strict governance policies, including controlled access to system components, segregation of duties, and short retention periods for sensitive information. This project enforces an explicit policy of not using personal or customer data for training or improving MAIC™, HIM™, or NHE™. All sensitive data processed within the scope of this project ecosystem is protected using industry-standard encryption and cryptographic hashing, ensuring confidentiality, integrity, and accountability across the entire intelligence lifecycle.
