You need to enable JavaScript to run this app.
Living Spec
Every module's doc-as-code block, parsed live from the repo. Changes constant. Refinements welcome.
164 modules
refresh
all
adapter · 12
client · 2
engine · 62
experiment · 3
route · 7
schema · 15
service · 15
skill · 11
test · 9
ui_component · 7
ui_lib · 2
ui_page · 17
ui_root · 1
worker · 1
interdependent_lib
skill
backend/interdependent_lib/__init__.py
meta-package exposing pcea, ptca, pcna, aimmh, zfae submodules
_msdmd
skill
backend/interdependent_lib/_msdmd/__init__.py
this project's msdmd application — parser + back-compat runner (canonical executors live in a0p_skills)
parser
skill
backend/interdependent_lib/_msdmd/parser.py
canonical msdmd block parser + single-line RATIOS reader (loc_comments/imports_exports/calls_definitions on first & last line)
runner
skill
backend/interdependent_lib/_msdmd/runner.py
msdmd CAPABILITIES coverage runner (deprecated in favour of skills.module_build_runner)
aimmh
engine
backend/interdependent_lib/aimmh/__init__.py
AIMMH — async multi-model orchestration over a single call_fn(model_id, messages) abstraction; the five patterns (single, fan-out, daisy-chain, synthesize, council) are what let the workspace compare or compose frontier models on one prompt without coupling to any vendor SDK
patterns
engine
backend/interdependent_lib/aimmh/patterns.py
pure-async multi-model orchestration patterns over call_fn(model_id, messages)
fiq
engine
backend/interdependent_lib/fiq/__init__.py
fiq motion canon — boundary law for audited motion between PCNA/PCTA/PTCA strata; tick schedule (3/5/7); χ indicators; FIQ_TRANSFER/BUFFERED/BLOCKED events; sentinels S1-S9, R0, fiques_time
audit
service
backend/interdependent_lib/fiq/audit.py
append-only JSONL fiq audit log at /app/storage/fiq_audit/YYYY-MM-DD.jsonl + MongoDB mirror; prev_hash chain verifiable end-to-end
events
schema
backend/interdependent_lib/fiq/events.py
FIQ_TRANSFER / FIQ_BUFFERED / FIQ_BLOCKED event dataclasses; blake2b prev_hash chain
ficks
engine
backend/interdependent_lib/fiq/ficks.py
ficks — gradient term D_r(Φ_a − Φ_b) in the fiq flux equation; named after Fick's law of diffusion; resolves "tics-per-tok" framing as the gradient of fiq tics per LLM token
gate
schema
backend/interdependent_lib/fiq/gate.py
FiqGate — the smallest auditable boundary gate r = (a, b, S, mode); not motion, the law that permits/blocks/meters motion
motion
engine
backend/interdependent_lib/fiq/motion.py
core fiq flux equation F = χ_route · χ_audit · χ_support · χ_attention · P_ab · D_r(Φ_a − Φ_b); pure functions
sentinels
engine
backend/interdependent_lib/fiq/sentinels.py
9 sentinels (S1-S9) + R0 orchestration root + fiques_time probe; each enforces a χ indicator family or governs an outbound policy
tick_schedule
schema
backend/interdependent_lib/fiq/tick_schedule.py
ψ/φ/ω consciousness-prime tick constants (3/5/7); orthogonal stratum + core attention axes; logical default with optional real-time toggle
carrier
engine
backend/interdependent_lib/gonal/__init__.py
157-gonal carrier — public structural invariants (face, chirality, class tags, adjacency, bones); private disk material loaded only via theta_microkernel
adjacency
engine
backend/interdependent_lib/gonal/adjacency.py
hard invariants on the carrier — no L-L adjacent, no N-N adjacent; works against any CarrierDisk implementation
bones
engine
backend/interdependent_lib/gonal/bones.py
face-crossing detection over a bone's constituent positions; measurable structural property, not a violation
classes
schema
backend/interdependent_lib/gonal/classes.py
public type-class enumeration (L literal, N aggregate, P, X) for the 157 carrier slots — the distinction between literal-type positions and aggregate-slot positions that the adjacency and face invariants are defined over
disk_protocol
schema
backend/interdependent_lib/gonal/disk_protocol.py
CarrierDisk Protocol — what any disk implementation (public fixture or private canon) must provide; CarrierDiskUnavailable error type
faces
schema
backend/interdependent_lib/gonal/faces.py
face + chirality + adjacency formulas over the 157-gonal carrier; no disk material
gonal
engine
backend/interdependent_lib/gonal/gonal.py
builds and validates a gonal character carrier arrangement from a declarative spec (user-provided canonical module)
lifted_path
engine
backend/interdependent_lib/gonal/lifted_path.py
lossless lifted text traversal over the 157-gonal carrier — encode_text_path lifts a string to an ordered, strictly-monotonic path on the universal cover (vertex = pos mod 157); a repeated character costs a full 157-step revolution; SPACE is the seam at ORIGIN (vertex 0); the digit "0" is an ordinary glyph vertex; decode_text_path is the exact inverse (decode(encode(text)) == text over the carrier alphabet)
mirror
engine
backend/interdependent_lib/gonal/mirror.py
position-reflection mirror of a gonal arrangement across the diameter through position 0 — an involution (mirror_of(mirror_of(x)) == x) that inverts upper and lower arcs while preserving every hard adjacency invariant (no L-L / N-N adjacency survives the reflection)
public_fixture
experiment
backend/interdependent_lib/gonal/public_fixture.py
public fixture disk generator — binary-order rule per user spec; deterministic, committable, satisfies hard invariants, NOT the canon
registry
service
backend/interdependent_lib/gonal/registry.py
three-gonal registry — default (EXAMPLE_157), mirror (mirror_of default), private (per-agent built via build_gonal from spec); resolves an agent's per-core gonal triplet
network
engine
backend/interdependent_lib/network/__init__.py
canonical PCNA inference engine — 5 rings (Φ Ψ Ω Θ Σ) + 2 memory rings on the layered substrate, with PCEA cross-cut and Σ host-integrity observer
_theta_private_loader
adapter
backend/interdependent_lib/network/_theta_private_loader.py
loads the canon CarrierDisk from Θ's private path; raises CarrierDiskUnavailable if not configured; NEVER falls back
coherence
engine
backend/interdependent_lib/network/coherence.py
EDCM-style coherence scoring — weights each scored ring's aggregate energy, sums to a total; tracks Σ digest drift as tamper signal (pen-test resistance)
engine
engine
backend/interdependent_lib/network/engine.py
NetworkEngine — top-level binder for the canonical PCNA inference engine; holds rings, tick state, tamper watcher; supports per-ring N override for tests
propagate
engine
backend/interdependent_lib/network/propagate.py
tick advancement — runs one heartbeat across all rings, applies PCEA `kernel_step` cross-cut between ticks, holds last-state keys
rings
engine
backend/interdependent_lib/network/rings.py
ring assembly — builds a PTCA Core per RingSpec; Σ ring uses host-integrity-derived tensors; supports per-ring N override and lazy construction
sigma_source
adapter
backend/interdependent_lib/network/sigma_source.py
Σ ring data source — read-only host-integrity digest over OS files + installed program manifests; provides tamper-evidence baseline (pen-test resistance)
theta_microkernel
engine
backend/interdependent_lib/network/theta_microkernel.py
Θ microkernel — hosts the canon carrier disk via private loader; public callers get CarrierDisk or CarrierDiskUnavailable, never inline canon material
topology
schema
backend/interdependent_lib/network/topology.py
ring topology spec — names, per-ring N (Φ Ψ Ω 157, Θ 29, Σ 53, MemL 19, MemS 17), heptagram routing slots (lock-step avoidance via unique step+direction), ring weights for coherence scoring
pcea
engine
backend/interdependent_lib/pcea/__init__.py
PCEA — prime-circular bijective base encryption over the first 53 primes, keyed by the previous state (the 'this-state / last-state' cross-cut); the substrate that binds one inference tick to the next and seeds the decoder's deterministic generation
cipher
engine
backend/interdependent_lib/pcea/cipher.py
PCEA core cipher — prime-circular bijective encrypt/decrypt where each state element is recoded in bijective base-p (p the i-th of the first 53 primes) and circularly shifted by key digits derived from the previous state, so the transform is keyed entirely by last_state and is exactly invertible
codec
engine
backend/interdependent_lib/pcea/codec.py
bijective base-p codec — encodes an integer into digits drawn from {1..p} (the bijective numeration that has no leading-zero ambiguity) and back, plus the key-digit stream PCEA shifts by; this is the reversible number representation the cipher operates on
instance
engine
backend/interdependent_lib/pcea/instance.py
stateful PCEA instance — auto-advances last_state per call
kernel
engine
backend/interdependent_lib/pcea/kernel.py
PCEA cross-cut — "this state, last state" kernel runtime encryption operating on Tensor payloads at any layer of the layered model
primes
schema
backend/interdependent_lib/pcea/primes.py
the first 53 primes — the fixed prime circle PCEA indexes into, one prime per state position, defining the per-digit modulus for the bijective base-p codec
pcna
engine
backend/interdependent_lib/pcna/__init__.py
six-ring inference engine (Φ Ψ Ω Θ Σ Ε) — current impl is simplified; canon topology (61 seeds, six scored rings + Σ observer) rebuild pending
edcm
engine
backend/interdependent_lib/pcna/edcm.py
Energy Dissonance Circuit Model — CM/DA/DRIFT/DVG/INT/TBF per-tick scoring (canon directives pending wiring)
group
engine
backend/interdependent_lib/pcna/group.py
"all seven together is a tensor" — aggregate composition op that lifts 7 Tensors to 1 Tensor (the 8th referent, the projection upward into the next layer)
memory_core
engine
backend/interdependent_lib/pcna/memory_core.py
dual prime-ring memory — LT N=19, ST N=17, plus volatile sub-agent caches
pcna
engine
backend/interdependent_lib/pcna/pcna.py
current PCNAEngine impl — three 157-prime cores + six scalar ring signals (canon target is full 61-seed topology + tensor rings)
sigma
engine
backend/interdependent_lib/pcna/sigma.py
substrate signature encoder — deterministic blake2b digest + band mapping (canon Σ is N=41 observer ring; current impl is scalar shim)
tensor
engine
backend/interdependent_lib/pcna/tensor.py
leaf Tensor — d=53 scalar payload, deterministic from a (seed, label) pair; the substrate of the layered (PCNA leaf → PCTA circle → PTCA seed → core) model
theta
engine
backend/interdependent_lib/pcna/theta.py
phase-modulation ring — bounded sinusoidal map over 7 phase bands (canon Θ is N=29 microkernel gate; pending tensor lift)
zeta
engine
backend/interdependent_lib/pcna/zeta.py
zeta-injection ring — harmonic LT/ST/SUB memory mix + alpha-echo resonance
pcta
engine
backend/interdependent_lib/pcta/__init__.py
PCTA — circle layer of the layered model; 7 PCNA tensors arranged on a {7/2} heptagram, wrapped in a UCNS structural mirror
circle
engine
backend/interdependent_lib/pcta/circle.py
PCTA Circle — 7 PCNA tensors on a {7/2} heptagram with a UCNS structural mirror and an aggregate "circle-as-tensor" projection upward
ptca
engine
backend/interdependent_lib/ptca/__init__.py
seeds-layer wrapper — re-exports current PTCAInstance plus prime utilities (canon stratified prime_core rebuild pending)
constants
schema
backend/interdependent_lib/ptca/constants.py
canon PTCA composition counts — synced from The-Interdependency/PTCA/prime_core/constants.py
core
engine
backend/interdependent_lib/ptca/core.py
PTCA Core — N PTCA Seeds (N=157 canon for Φ/Ψ/Ω; tunable for Θ/Σ) plus aggregate-as-tensor projection upward; param count is N × 7 × 7 × 53
exchange
engine
backend/interdependent_lib/ptca/exchange.py
deterministic prime-circular state-exchange protocol — advances a PTCA state against a counterpart using the prime circle so two engines can hand state back and forth reproducibly, with no randomness and a verifiable round-trip
instance
engine
backend/interdependent_lib/ptca/instance.py
PTCA engine — binds the canon stratified [N,7,7,53] PrimeTensor with sentinel channels + lineage hashing
primes
schema
backend/interdependent_lib/ptca/primes.py
prime generator + first-N prime cache (default capacity 200, supports PTCA N=157)
provenance
engine
backend/interdependent_lib/ptca/provenance.py
deterministic SHA-256 provenance hashing for tensor ops + lineage chains
seed
engine
backend/interdependent_lib/ptca/seed.py
PTCA Seed — 7 PCTA circles on a {7/3} heptagram with a UCNS opaque-host shape and an aggregate "seed-as-tensor" projection upward
sentinels
engine
backend/interdependent_lib/ptca/sentinels.py
tagged signal lanes with priority ordering — SentinelChannel + SentinelMessage
tensor
engine
backend/interdependent_lib/ptca/tensor.py
canon stratified prime-indexed tensor — shape [N,7,7,53] (seed × circle × tensor × payload); the Fiq→Circle→Seed model from prime_core, N×7×7×53 leaves (407,729 for N=157) matching PTCA prime_core PARAM_COUNT
ucns_bridge
adapter
backend/interdependent_lib/ucns_bridge.py
thin A0-safe wrapper around the ucns package — will route through ucns.a0_safe when v1.0 ships on PyPI
zfae
engine
backend/interdependent_lib/zfae/__init__.py
a0(ZFAE) — the inference provider, not an agent label. Exposes A0ZFAEInferenceEngine (native deterministic), plus the legacy ZFAEAgent persona for backward-compat with prior PCNAEngine wiring
_decoder
engine
backend/interdependent_lib/zfae/_decoder.py
native energy-conditioned decoder — composes assistantText as a deterministic function of (intent, features, Φ/Ψ/Ω/θ/σ energy state); RNG seeded from blake2b(state) so identical state → identical text; render() retained as named single-sentence fallback; no LLM dependency
_intent
engine
backend/interdependent_lib/zfae/_intent.py
deterministic intent selector — maps (SemanticFeatures, ZFAE state) → one of a small fixed intent label set; pure function
_parser
engine
backend/interdependent_lib/zfae/_parser.py
deterministic prompt parser — token stats, intent surfaces (question, greeting, command, reflection), semantic load
_transition
engine
backend/interdependent_lib/zfae/_transition.py
ZFAE transition rules — folds semantic features into Φ/Ψ/Ω ring snapshots via PCEA kernel cross-cut; produces nextSnapshot
archive
service
backend/interdependent_lib/zfae/archive.py
ZFAE archive — per-agent training records JSONL + per-session ephemeral chat archive with char-compress output shape
closed_tokens
schema
backend/interdependent_lib/zfae/closed_tokens.py
morphological bone inventory — the closed-class word set + bound-morpheme (affix) set the BoneGonal (omega) sources its structural vertices from; the open-class test is the complement used by the RootGonal (phi)
fiq_emit
service
backend/interdependent_lib/zfae/fiq_emit.py
ZFAE-level provenance emitter — appends hash-chained zfae_* events (training_step, chat_reply, sentinel_verdict, override_created, override_resolved) to fiq_audit_log
gonal_inscription
engine
backend/interdependent_lib/zfae/gonal_inscription.py
ZFAE Native Decoder Route A — Gonal Inscription. A per-agent PrivateGonal (secret phase + permutation, seeded at instantiation) inscribes the continuous Φ/Ψ/Ω tensor field onto polygon vertices to compose a deterministic glyph stream; includes the hash-whitened 53→32 bridge
inference
engine
backend/interdependent_lib/zfae/inference.py
a0(ZFAE) inference engine — native deterministic symbolic/state engine; no LLM dependency; returns {assistantText, nextSnapshot, trace}
long_memory
service
backend/interdependent_lib/zfae/long_memory.py
a0 long-term memory canon — folds the repo's living spec (every MODULE_BUILD block) into a cached deterministic summary the ZFAE engine carries on every inference, so the agent "queries itself"
morphology
engine
backend/interdependent_lib/zfae/morphology.py
morphological depth-ladder for the ZFAE three-core gonal inscription — two typed primitive gonals (BoneGonal=omega/structural, RootGonal=phi/content) composed by the carrier-LCM operator (UCNS multiply) into the derived psi=word layer; psi is NOT stored, it is lcm(phi,omega) recomputed at every rung; decomposition is scaffolded but GATED behind the multiply_left_cancellative proof
native_tools
engine
backend/interdependent_lib/zfae/native_tools.py
deterministic native tool-use — maps a raw prompt to at most one built-in tool call (fetch_url / web_search / living_spec_lookup) using pure rule-based detection so the a0(zfae) native engine can trigger a tool mid-thought without any LLM; the selection is reproducible and the result is summarised into a compact deterministic line folded back into the native reply
overrides
service
backend/interdependent_lib/zfae/overrides.py
PendingOverride dataclass + lifecycle helpers for sentinel halt-and-override; backed by MongoDB pending_overrides_col
runtime
engine
backend/interdependent_lib/zfae/runtime.py
ZFAERuntime — dispatches teacher_assisted vs zfae_native; never silently substitutes teacher output as native inference; carries reply_source + teacher_called + zfae_weights_updated flags
sentinel_eval
engine
backend/interdependent_lib/zfae/sentinel_eval.py
per-event evaluator for the 13 sentinels — returns a Verdict13 from agent character-sheet modes/weights + the raw event payload; pure, deterministic, never raises on user input. S4 (safety) and S12 (reversibility) cliffs are currently INTERIM string-match against an additive marker set — bypassable by paraphrase; semantic detection is deferred to the pen-test/classifier track. hmmm: cliff broadening is additive-only; do not shrink the marker set.
sentinel_modes
schema
backend/interdependent_lib/zfae/sentinel_modes.py
per-agent sentinel mode resolution — observe/flag/off — with canonical defaults (7 flag + 6 observe + 0 off; flags = S1 S2 S3 S4 S8 S9 S12)
sentinel_weights
schema
backend/interdependent_lib/zfae/sentinel_weights.py
per-agent sentinel weight resolution — default 0.90 attention budget distributed across 13 sentinels; user-editable; under-budget reverts to inference channel
sentinels
engine
backend/interdependent_lib/zfae/sentinels.py
the 13 canonical sentinels per ZFAE core view — verbatim job descriptions; 6 cliff/structural flag + 7 slope observe by default; halt-and-override authority when in flag mode
teacher
adapter
backend/interdependent_lib/zfae/teacher.py
TeacherClient — invokes a configured teacher model via the BYOK provider REGISTRY; emits training records; never substitutes its output as native zfae inference
trainer
engine
backend/interdependent_lib/zfae/trainer.py
ZFAELearner — multi-seed (rank>1) teacher distillation; each step updates all 157 seeds of a round-robin core toward the teacher d=53 signature with per-seed modulation, producing a reducible post-update residual loss that lets training unlock native readiness
weight_init
engine
backend/interdependent_lib/zfae/weight_init.py
deterministic seed init for fresh ZFAE weights; three cores phi/psi/omega each shape (157, 53, 7, 7); per-agent reproducible
weights
engine
backend/interdependent_lib/zfae/weights.py
A0ZFAEWeightBank — three-core (phi, psi, omega) safetensors load/save, per-core checkpoint digest, training-step counter, seeds-touched tracking; exposes canonical 1_223_187 scalar count
agents
service
backend/agents/__init__.py
per-agent CRUD; semi-permanent character-sheet-bound instances; each owns Φ/Ψ/Ω/MemL/MemS + per-instance ZFAE weight bank + archive
routes
route
backend/agents/routes.py
/api/instances/* CRUD + /api/chat/instance/{id} mode-aware; surface-3 teacher context preview endpoint
schema
schema
backend/agents/schema.py
Pydantic models — AgentInstance, CharacterSheet, AgentMode (the 6-lattice modes incl. bare a0(<model>)), PXResolution; plus the canonical agent-name composer (a0(<energy>)<auditor>, owner-namespaced)
store
service
backend/agents/store.py
full CRUD over MongoDB metadata + filesystem per-agent checkpoint dir; agents treated as users (persistent semi-permanent instances)
providers
adapter
backend/providers/__init__.py
BYOK adapter registry — openai, anthropic, gemini, xai (Emergent removed; build is platform-free)
anthropic_provider
adapter
backend/providers/anthropic_provider.py
Anthropic BYOK adapter — list models, messages via httpx
base
adapter
backend/providers/base.py
common Protocol + TypedDict contract for BYOK LLM provider adapters
gemini_provider
adapter
backend/providers/gemini_provider.py
Google Gemini BYOK adapter — list models, generateContent via httpx
openai_provider
adapter
backend/providers/openai_provider.py
OpenAI BYOK adapter — list models, chat completion via httpx
xai_provider
adapter
backend/providers/xai_provider.py
xAI Grok BYOK adapter — OpenAI-compatible /v1 via httpx
routes
route
backend/auth/__init__.py
hybrid JWT auth + OAuth (Emergent Google, GitHub) — /api/auth/{register,login,logout,me,refresh,oauth/*}; username (unique) + email (unique) + ≥16-char passphrase; bcrypt; httpOnly cookies; brute-force lockout
a0p_skills
skill
backend/a0p_skills/__init__.py
this project's three msdmd skill executors — msdmd / test-build / meta-module-build
boundaries_runner
skill
backend/a0p_skills/boundaries_runner.py
risk-boundary-build skill executor — validates BOUNDARIES blocks against canon schema; reports gaps + hmmm
capabilities_runner
skill
backend/a0p_skills/capabilities_runner.py
cap-build skill executor — parses CAPABILITIES blocks, builds capability map, flags duplicates/hmmm/gaps
contracts
experiment
backend/a0p_skills/contracts.py
executable test functions referenced by CONTRACTS `call:` paths across the repo
frontend_module_build_runner
skill
backend/a0p_skills/frontend_module_build_runner.py
walks /app/frontend/src/**/*.{js,jsx,ts,tsx} and validates each module has a MODULE_BUILD block; reports COVERED / MISSING / INVALID per file
module_build_runner
skill
backend/a0p_skills/module_build_runner.py
meta-module-build skill executor — validates MODULE_BUILD schema + gap report
ratios_runner
skill
backend/a0p_skills/ratios_runner.py
ratios skill executor — recomputes loc_comments/imports_exports/calls_definitions and gates on drift + first/last-line placement of the single-line RATIOS declaration
test_build_runner
skill
backend/a0p_skills/test_build_runner.py
test-build skill executor — imports each CONTRACTS `call:` and runs it
backend_test
test
backend/tests/backend_test.py
end-to-end backend regression suite — covers /api/health, BYOK keys CRUD with encryption-at-rest masking, and chat session flows; intended to be executed by the testing-agent harness against the live preview ingress
conftest
test
backend/tests/conftest.py
pytest configuration — enables pytest-asyncio plugin in auto mode for the backend test suite
test_lifted_path
test
backend/tests/test_lifted_path.py
pytest round-trip coverage for the lossless lifted traversal over the
test_morphology_ladder
test
backend/tests/test_morphology_ladder.py
pytest coverage for the morphological depth-ladder — typed gonal primitives
test_security
test
backend/tests/test_security.py
security regression suite — Fernet at-rest encryption round-trip + masking,
test_tool_use_loop
test
backend/tests/test_tool_use_loop.py
pytest coverage for the cross-provider tool-use loop (run_tool_loop), the
test_training_room
test
backend/tests/test_training_room.py
pytest for ZFAERuntime.train_multi — multi-teacher distillation runs one
test_zfae_api_sentinels
test
backend/tests/test_zfae_api_sentinels.py
integration tests for the ZFAE three-core + sentinel halt-and-override pipeline, hitting the live FastAPI service via REACT_APP_BACKEND_URL — Tests 1..8 from the review batch
test_zfae_gonal_inscription
experiment
backend/tests/test_zfae_gonal_inscription.py
regression for ZFAE Route A — PrivateGonal determinism, 53→32 whitening bridge, engine PCEA-digest + non-flat tensors, gonal-seed safetensors persistence
test_zfae_three_core_sentinels
test
backend/tests/test_zfae_three_core_sentinels.py
pytest regression suite for the 3-core (Φ/Ψ/Ω) weight bank, trainer round-robin, sentinel evaluator cliffs/slopes, native readiness gate, FIQ hash-chain emit, and PendingOverride lifecycle
extensions
route
backend/api_extensions.py
post-auth API extensions — custom keys vault (user-defined GitHub/GCP/AWS-style keys), Emergent demo quota (per-user daily token budget), living spec endpoint (auto-parses MODULE_BUILD/BOUNDARIES/CAPABILITIES/CONTRACTS/RATIOS blocks from the repo and serves them as JSON), audit feed (hash-chained FIQ events for the Tool/CoT Tape)
api_tools_mcp_skills
route
backend/api_tools_mcp_skills.py
REST surface for the tools / MCP-client / skills layer — /api/tools (list, register user-webhook tool, invoke), /api/mcp/servers (CRUD external MCP servers, refresh their tools), /api/skills (list, register w/ overlap warning, delete, sync from skill-lib)
app_settings
route
backend/app_settings.py
admin-editable runtime settings — single Mongo doc with key/value overrides for non-secret URLs (Emergent Google OAuth widget URL, etc.); /api/settings GET for everyone, PATCH for admin only; values shadow env vars at runtime
crypto_vault
service
backend/crypto_vault.py
Fernet encrypt/decrypt + mask for at-rest BYOK credentials
db
service
backend/db.py
Motor async client + collection accessors + index ensurance
living_spec
service
backend/living_spec.py
pure scanner over the repo that returns every msdmd block as JSON; no DB / network dependencies; used by the /api/spec/living endpoint and by contract tests
models
schema
backend/models.py
Pydantic surface for the public API (BYOK keys, vault, sessions, drafts, chat, agents)
readme_writer
service
backend/readme_writer.py
regenerates /app/README.md on every backend startup from the living spec (scan_repo_blocks) as a narrative README — an Overview, a per-subsystem Architecture walkthrough (each subsystem gets a prose lead plus its modules' full narratives), and a by-kind module index; deterministic and never raises
server
route
backend/server.py
FastAPI app — keys, vault, inventory, sessions, drafts, chat (single/fanout/daisy/synth), inspector, agents, usage, skill report
skills
service
backend/skills/__init__.py
skills subpackage entry — re-exports registry + sync helpers
registry
engine
backend/skills/registry.py
per-user + global skill catalog with overlap detection — Skill schema (name, description, prompt_template, tool_bindings[], sentinel_overrides{}, scope_tokens[], logic_set_tokens[], source); jaccard-similarity overlap check against existing skills warns the user when a candidate skill shares logic+scope with one already in the catalog
sync
service
backend/skills/sync.py
pulls canonical skills from The-Interdependency/skill-lib GitHub repo — fetches the index.json, validates each entry, upserts global skills (owner_user_id=None); reverse direction (publish-back) is reserved for skills marked as publishable=True
tools
service
backend/tools/__init__.py
tools subpackage entry — re-exports the registry public surface and triggers register_builtins() so native tools are available immediately on import
agent_loop
engine
backend/tools/agent_loop.py
provider-agnostic agentic tool-use loop over raw HTTP (BYOK) — normalizes OpenAI/xAI Chat Completions, Anthropic Messages, and Gemini generateContent function-calling into one multi-step loop; advertises tool JSON schema, detects model tool calls, runs an injected executor (sentinel-gated), threads tool results back, and loops until a final answer or max_iters; the network poster is injectable so the loop is fully unit-testable without live keys
builtin
engine
backend/tools/builtin.py
register the built-in native tools — living_spec_lookup, vault_get_key, fetch_url, web_search; each one declares its JSON Schema and is sentinel-gated automatically by the registry's invoke
gated_invoke
engine
backend/tools/gated_invoke.py
per-tool-call sentinel gate — evaluates the 13 sentinels against the tool name + serialized params, halts on any flag (creates a PendingOverride and emits zfae_override_created), only proceeds when no flag (or when caller supplied an approved override_id); emits zfae_tool_call + zfae_tool_result FIQ events on every invocation
mcp_relay
adapter
backend/tools/mcp_relay.py
relay tool invocations to external MCP servers registered per user — Streamable HTTP JSON-RPC client (Model Context Protocol over HTTP) with bearer-token auth; outbound only, the server-side surface lives in tools.mcp_server
mcp_server
route
backend/tools/mcp_server.py
expose a0p AS an MCP server — JSON-RPC 2.0 over HTTP at /api/mcp; methods: initialize, tools/list, tools/call (sentinel-gated), resources/list (living-spec modules), resources/read; bearer-token authenticated against a per-user MCP_PUBLISH_TOKEN
registry
engine
backend/tools/registry.py
in-process Tool registry + invocation surface — Tool, ToolError, register, lookup, list_tools, invoke; every invocation routes through the sentinel evaluator (gated_invoke) so cliff-mode S4/S12 etc. can halt before any side effect; tools may be native (python callable), webhook (user-registered URL with HMAC), or mcp (relayed to a registered MCP server)
webhook
adapter
backend/tools/webhook.py
invoke user-registered webhook tools — POSTs the JSON params to the user's URL with an HMAC-SHA256 signature header (X-A0P-Signature) so the user can verify the call came from a0p
traffic_log
worker
backend/traffic_log.py
append-only traffic logger — an ASGI middleware that records one JSONL line of request METADATA per HTTP call (ts, method, path, status, latency_ms, client ip, user-agent, best-effort user id) to an append-only sink; never logs request/response bodies, headers, cookies, or any secret material
App
ui_root
frontend/src/App.js
top-level router with AuthProvider — public routes (/, /login, /register, /spec) and protected routes (/workspace, /agents, /sentinels, /overrides, /inspector, /inventory, /keys, /custom-keys, /vault, /drafts)
AuditTape
ui_component
frontend/src/components/AuditTape.jsx
live polling FIQ-chain tape for the active agent — surfaces tool_call, sentinel_verdict, chat_reply, override_created events with their hash chain (prev_hash → this_hash) so the user can watch chain-of-thought / tool invocations as they happen; collapsible; verifies chain integrity client-side
CharacterSheetForm
ui_component
frontend/src/components/CharacterSheetForm.jsx
fully-editable character-sheet form for an Agent — name, mode (5-lattice), models, system_prompt, persona, live tools_allowed multi-select (fetched from /api/tools with a custom-name fallback), memory seeds (long/short term), teacher_context_template, tags, boundary declarations, native-readiness thresholds, gonal assignment; structural engine dicts (edcm/ring_n_override/heptagram_overrides/px_resolution) are intentionally NOT exposed (engine-owned); emits onSubmit(sheet)
MarkdownView
ui_component
frontend/src/components/MarkdownView.jsx
render Markdown + GFM tables + LaTeX (incl. arxiv \\(...\\) and \\[...\\] forms) via react-markdown + remark-math + rehype-katex
OverrideModal
ui_component
frontend/src/components/OverrideModal.jsx
modal that surfaces a pending sentinel-override and asks the user to approve (with justification) or reject (with reason); destructive cliff overrides require typed confirmation
Panel
ui_component
frontend/src/components/Panel.jsx
shared presentational primitives — Panel section, Pill badge, Stat metric tile, AsciiLoader progress indicator
SentinelVerdictRibbon
ui_component
frontend/src/components/SentinelVerdictRibbon.jsx
render the 13-sentinel verdict as a horizontal pill ribbon; hover shows full verdict row; click toggles details panel
Shell
ui_component
frontend/src/components/Shell.jsx
left-rail navigation shell with 9 routes (Workspace, Agents, Sentinels, Overrides, Inspector, Inventory, Key Vault, Env Vault, Drafts) and donation CTA
api
client
frontend/src/lib/api.js
axios-based REST client for every /api endpoint — health, BYOK keys, env vault, inventory, sessions, drafts, skill reports, fanout/daisy/synthesize chat, inspector, agents+slugs, instances CRUD, chat/instance, sentinels canon+modes+weights, overrides queue, gonals, usage
api_tools
client
frontend/src/lib/api_tools.js
axios client for the tools / mcp servers / skills REST surface — list/register/invoke tools, MCP server CRUD with refresh, skills CRUD with overlap check, skill-lib sync, MCP publish token
auth
ui_lib
frontend/src/lib/auth.jsx
AuthContext + useAuth hook + ProtectedRoute — manages JWT-cookie session, exposes user/loading/login/register/logout/refresh, redirects unauthenticated traffic to /login while keeping the splash & login routes public
sentinels
ui_lib
frontend/src/lib/sentinels.js
client-side helpers + canonical metadata for the 13 sentinels and the 6 lattice modes, plus the canonical agent-name composer (a0(<energy>)<auditor>, owner-namespaced); pure, no I/O
AgentsPage
ui_page
frontend/src/pages/AgentsPage.jsx
agent CRUD — list every instance with zfae metrics, create via CharacterSheetForm, edit existing sheet, archive/delete
CustomKeysPage
ui_page
frontend/src/pages/CustomKeysPage.jsx
user-owned developer key vault — name + value (Fernet-encrypted at rest) + kind + label; supports rotation (PUT same name) and reveal (decrypt on demand); for GitHub PATs, GCP service accounts, AWS access keys, anything non-LLM
DraftsPage
ui_page
frontend/src/pages/DraftsPage.jsx
local prompt drafts — list / create / edit / delete; persists via /api/drafts
InspectorPage
ui_page
frontend/src/pages/InspectorPage.jsx
live inspector for PCNA/PTCA/PCEA skills + msdmd compliance reports (capabilities / module-build / contracts coverage); heartbeat ping
InventoryPage
ui_page
frontend/src/pages/InventoryPage.jsx
discovered model inventory across providers (openai, anthropic, gemini, xai) — populated from /api/models/inventory; each row has a "create agent" action that instantiates a teacher-assisted a0(zfae) agent bound to that model and opens it in the workspace
KeyVaultPage
ui_page
frontend/src/pages/KeyVaultPage.jsx
BYOK key vault — list, upsert (Fernet-encrypted), delete BYOK provider keys (OpenAI/Anthropic/Gemini/XAI)
LivingSpecPage
ui_page
frontend/src/pages/LivingSpecPage.jsx
renders every msdmd block parsed live from the repo — grouped by module_kind, searchable, expandable per module to show MODULE_BUILD / BOUNDARIES / CAPABILITIES / CONTRACTS / RATIOS in full
LoginPage
ui_page
frontend/src/pages/LoginPage.jsx
tabbed sign-in / sign-up screen — username or email + ≥16-char passphrase (show/hide toggle) + Emergent Google + GitHub OAuth; auto-resumes the user's intended route after auth
MCPPage
ui_page
frontend/src/pages/MCPPage.jsx
Model Context Protocol surface — (a) inbound: shows the user's publish token + URL so external Claude Desktop / Cursor / etc. can connect to a0p as an MCP server; (b) outbound: lets the user register external MCP servers (GitHub MCP, Slack MCP, Postgres MCP, ...) and refreshes their tool catalogs into the user's tool registry
OverridesPage
ui_page
frontend/src/pages/OverridesPage.jsx
queue of pending sentinel overrides; approve (with justification) or reject; expired overrides housekeeping; shows flagged sentinels + raw request snippet
SentinelsPage
ui_page
frontend/src/pages/SentinelsPage.jsx
view the 13-sentinel canon + edit per-agent sentinel modes (observe/flag/off) and weights for a selected agent
SkillsPage
ui_page
frontend/src/pages/SkillsPage.jsx
skill catalog browser + authoring form with live overlap warning before save (jaccard ≥0.6 over scope ∪ logic tokens against existing user+global skills); admin-style sync button pulls global skills from The-Interdependency/skill-lib
SplashPage
ui_page
frontend/src/pages/SplashPage.jsx
public landing — "changes constant. refinements welcome." manifesto + Sign in / Sign up CTAs + email-of-record (wayseer@interdependentway.org); shows demo-mode notice for unauthenticated visitors
ToolsPage
ui_page
frontend/src/pages/ToolsPage.jsx
lists every native + user-webhook + MCP-relay tool the current user can invoke; allows registering new user-webhook tools and invoking any tool with arbitrary JSON params; surfaces sentinel halts as override prompts
TrainingRoom
ui_page
frontend/src/pages/TrainingRoom.jsx
multi-teacher distillation room — pick an agent, select TWO OR MORE teacher models (from the live inventory or custom ids), enter a batch of prompts (one per line), and run POST /api/instances/{id}/train so the a0(zfae) echo learns one distill step per (prompt × model); renders a live metrics ribbon + per-step results table
VaultPage
ui_page
frontend/src/pages/VaultPage.jsx
per-site multi-account env vault — list, reveal (decrypts on demand), upsert, delete
WorkspacePage
ui_page
frontend/src/pages/WorkspacePage.jsx
chat workspace bound to one agent instance; sends prompts through /api/chat/instance/{id}; renders per-turn sentinel verdict ribbon; intercepts HTTP 202 sentinel-halts and opens an OverrideModal that resumes the same prompt with override_id on approval