# Oshun — Systems Deep Dive

> The `libs/oshun/` area: ~49 Nx libraries that make up the Oshun **product
> platform** — the cross-domain app shell, the canonical domain/substrate
> adapters, and the platform-wide foundations (auth, persistence, analytics,
> privacy, messaging, billing) that every Oshun surface composes.

## What this area is

Where `libs/contracts/` owns the typed wire surface, `libs/oshun/` owns the
**product runtime that sits on top of it**: the app shell a customer actually
uses, the adapters that normalize each backend domain into one stable
shell-facing interface, and the shared platform machinery (sessions,
persistence, analytics, notifications, payments) those surfaces lean on. Almost
every project carries the `scope:oshun` tag, and the `layer:` tag is the most
useful way to read the area — `layer:domain` for the per-domain and
per-substrate adapters,
`layer:foundations`/`persistence`/`auth`/`analytics`/`privacy` for the platform
spine, and `layer:agentic` for the content/creative-automation stack.

The product is organised around **six customer domains** — Tara (meditation /
practice), Veritas (story / fact-grounding), Nyx (sky / astronomy), Arete (goals
/ habits), Nisaba (study / primary texts), and Metis (learning) — and several
**AI substrates** that cut across them: Iris (memory), Sophia (evidence /
grounding), Isis (generation control), Lilith (persona policy / safety), Psyche
(real-time voice + avatar embodiment), and Aja (embodied instruction). Tara is
deliberately the experiential center; `@oshun/design-language` and
`@oshun/navigation` both encode a "Tara-centered" IA as a hard contract.

A recurring shape repeats across the domain packages: an `*ApiAdapter` contract,
a canonical `*DomainAdapter` (the shell-facing normalization), object models,
card-model builders for Home/Explore surfaces, `deep-links`/`launch-actions`
helpers, and `canonical-adapter` factories. Reading one domain package
(`domain-tara`, the largest at ~8.9K LOC) teaches you how to navigate them all.
A handful are thin facades by design — `domain-metis` is a 7-line re-export of
`@metis/api-client` — and the area is honest about that.

**Sub-systems at a glance:**

- **App shell & presentation:** `shell-core`, `shell-assistant`,
  `shell-achievements`, `shell-routines`, `shell-desktop`, `shell-wearable`,
  `navigation`, `ui`, `design-language`, `design-tokens`, `i18n`, `offline`.
- **Customer domain adapters:** `domain-arete`, `domain-metis`, `domain-nisaba`,
  `domain-nyx`, `domain-tara`, `domain-veritas`, `domain-registry`.
- **AI substrate adapters:** `memory-iris`, `evidence-sophia`,
  `generation-control-isis`, `persona-policy-lilith`, `persona-registry`,
  `embodiment-psyche`, `embodiment-aja`.
- **Agentic / content stack:** `agent-pipelines`, `agentic-studio`,
  `content-service`, `creative-orchestrator`.
- **Platform foundations:** `platform-foundations`, `persistence`, `analytics`,
  `privacy`, `trust-safety`, `auth` (`@oshun/auth-client`),
  `messaging-channels`, `render-farm`.
- **Commerce, customer & operator surfaces:** `billing-support`,
  `payments-bridge`, `customer-curation`, `customer-message-center`,
  `search-discovery`, `tenant-console`, `developer-portal`, `studio-authoring`.
- **Integrations & cross-cutting:** `concordia-integration`,
  `veritas-cascade-worker`, `color-science`.

## How it fits the wider system

These libraries are the layer the **apps** (the web shell, mobile shell, admin
console) and the **BFF** import directly. The domain adapters consume the
`libs/contracts/*` Zod schemas and the per-domain API clients (`@metis/...`,
`@iris/...`, etc.) and present one normalized interface to the shell, so a shell
surface never talks to a raw backend. The platform packages — `persistence`
(Prisma over Postgres), `auth-client`, `analytics`, `messaging-channels`,
`payments-bridge` — are the shared substrate every domain and service leans on.
A few packages are explicitly scoped down or staged: `search-discovery` is
documented as **retired from V1 scope** until the live search candidates carry
real `DiscoveryObject` metadata, and `agent-pipelines` is a small grant/pipeline
skeleton. Walk the "used by" edges on any node below to see exactly who depends
on it.

## Entity reference

### @oshun/agent-pipelines

A small (~52 LOC) agentic skeleton: `src/grants/resolver.ts` (capability-grant
resolution) plus `src/pipelines/index.ts`, re-exported from `src/index.ts`. It
reserves the agent-pipeline + grant surface and is intentionally thin rather
than a full pipeline engine.

### @oshun/agentic-studio

The operator-facing agentic studio (`layer:agentic`, ~6.9K LOC): a barrel over
twelve sub-modules — `registry`, `runs`, `plans`, `invocation`, `budgets`,
`capabilities`, `feedback`, `modes`, `pipelines`, `grants`, `handoff`,
`dashboard` (`src/index.ts`). It models agent runs, budgets, capability grants,
and a dashboard surface for governing autonomous agent invocations.

### @oshun/analytics

The platform's typed analytics layer (~43K LOC, the second-largest node): an
`AnalyticsClient` with context propagation and sink fan-out, plus the canonical
machine-readable event taxonomies (`customer-taxonomy`, `admin-taxonomy`,
`assistant-taxonomy`, `flows-taxonomy`) and a large body of V1/V3 readiness,
budget, and dashboard manifests (e.g. `v3-web-first-load-budget`,
`v1-launch-readiness-manifest`). `src/README.md` is authoritative.

### @oshun/auth-client

The client-side auth/session library (`libs/oshun/auth`, project
`@oshun/auth-client`, ~9.7K LOC): the canonical single-customer auth model
(`customer-auth-model.ts`), `AuthClient` with login/logout/refresh and
single-flight refresh protection, pluggable `AuthTransport`/`SessionStore`,
secure-storage adapters, entitlements, SSO coordination, and feature-gating for
shell and Metis surfaces.

### @oshun/billing-support

The billing + support library (~1.6K LOC): a barrel over `entitlements`,
`paywalls`, `dunning`, `self-serve`, `tax-billing`, `metered`, and
`support-cases`, plus a `billing-aje-bridge` linking billing to the Aje payment
domain. Covers the subscription/metering/support-case surface, not the raw
payment rails (see `payments-bridge`).

### @oshun/color-science

A real color-management engine (~6.4K LOC, `layer:domain`): ACES 2065-1 / ACEScg
color-space definitions and conversion matrices, OCIO v2 config generation, HDR
mastering, gamut compression, camera IDTs, and display/look transforms
(`src/lib/aces-2065-1.ts`, `acescg.ts`, `ocio-config-generation.ts`, …) with
`.spec.ts` coverage. Domain-specific math, not CRUD.

### @oshun/concordia-integration

A focused Phase-179.6 integration bridge (~159 LOC): Zod-validated nav-item,
event-subscription, telemetry-sink, and registration schemas plus
`orderNavItems` / `subscriptionsForEventType` helpers
(`src/integration-hooks.ts`) that wire the Concordia mediation domain into the
wider Oshun shell.

### @oshun/content-service

An HTTP service (`layer:agentic`, ~1.1K LOC) that stands the agentic content
stack up behind a real server: `ContentPipelineService`, a
`ContentStepDispatcher`, durable run stores
(`FileContentRunStore`/`InMemoryContentRunStore`), and an HTTP router/server
(`src/http-router.ts`, `http-server.ts`). It composes existing
content-quality-judge / release-gate / Yemaya primitives rather than inventing a
new agent loop, and exposes replay + an operator dashboard surface.

### @oshun/creative-orchestrator

The autonomous creative orchestrator (`layer:agentic`, ~1.8K LOC): turns a brief
into produced content via `decomposeBrief` (schema-validated, acyclic
`CreativePlan`), governed `routePlan` dispatch, and a bounded `reviseArtifact`
critique→revise loop, built on `@oshun/ai/agent-loop` primitives. Includes a
`BudgetGovernanceGate`, DAG validation, and LLM-judge / metric critics;
documented as fail-loud (never fabricates a plan or artifact).

### @oshun/customer-curation

The customer save/share surface (~2.8K LOC): a barrel over `collections`,
`sharing`, `share-cards`, `annotations`, `bookmarks`, and `version-awareness`
(`src/index.ts`) — the cross-domain library/curation features a customer uses to
organize and share saved content.

### @oshun/customer-message-center

A focused in-app message-center module (~423 LOC): `src/message-center.ts`
re-exported from the barrel, modeling the customer-facing message/notification
inbox.

### @oshun/design-language

The product's design-language contract (~3.4K LOC, `layer:design`): exported
const contracts such as `TARA_CENTERED_PRODUCT_LANGUAGE`, `OSHUN_UNIFIED_IA`,
`OSHUN_VISUAL_THESES`, and `OSHUN_EXPERIENCE_QUALITY_RULES`, plus
voice-and-tone, surface-language, responsive-system, scorecards,
AI-disclosure-copy, and failure-copy modules — the codified, test-backed rules
for how Oshun looks and speaks.

### @oshun/design-tokens

Centralized design tokens (`layer:design`, ~2.6K LOC): a schema-first token
model (`oshunTokenSchema`) and the canonical `oshun-v1-foundation` bundle for
color, typography, spacing, elevation, and motion, plus behavior contracts for
domain-accent, grounded-evidence, disclosure/synthetic-indicator, and
persona-switching. `src/index.ts` re-exports `./tokens` (ships a prebuilt
`tokens.js` alongside the TS source).

### @oshun/developer-portal

The developer-portal toolkit (~1.3K LOC, `layer:developer-portal`):
`openapi-builder`, `code-example-generator`, `sandbox-tenant-policy`,
`certification-suite`, and `developer-docs-registry` (`src/index.ts`) — the
machinery behind third-party developer docs, sandbox tenancy, and certification.

### @oshun/domain-arete

The canonical Arete (goals / habits) shell adapter (~8.3K LOC): object models
for habits/goals/routines/reviews, humane streak-recovery and friction-taxonomy
helpers, coaching-summary surfaces, accountability flows, and cross-domain
relationship helpers to Tara/Nisaba/Metis/Veritas, behind
`createCanonicalAreteDomainAdapter`. Follows the standard adapter shape
(`src/index.ts`, `README.md`).

### @oshun/domain-metis

A deliberately thin facade (~7 LOC): `src/adapter.ts` re-exports
`@metis/api-client`, aliasing `createMetisAdapter` to
`createMetisDomainAdapter`. The Metis (learning) domain's real logic lives in
`@metis/*`; this package just exposes it under the Oshun domain-adapter naming
convention.

### @oshun/domain-nisaba

The canonical Nisaba (study / primary texts) shell adapter (~3.2K LOC):
`NisabaApiAdapter`/`NisabaDomainAdapter` contracts, passage/concept/reminder/
workspace/search models, `createCanonicalNisabaDomainAdapter`, card-model
builders, launch-action and deep-link helpers, and shared concept-graph linkages
carrying passages into Tara/Arete/Veritas/Nyx paths (`src/index.ts`,
`README.md`).

### @oshun/domain-nyx

The canonical Nyx (sky / astronomy) shell adapter (~10K LOC, one of the larger
domain packages): the standard adapter surface plus a substantial `depth/`
sub-package of real ephemeris computations — `lunar-phase-calendar`,
`twilight-schedule`, `object-transit`, `equation-of-time`, `zodiac-position`,
`planetary-hours`, `solar-terms`, `chart-angles`, and more (`src/index.ts`).
Domain-specific astronomy, not CRUD.

### @oshun/domain-registry

The typed domain-metadata registry (~731 LOC): canonical metadata for Tara,
Veritas, Nyx, Arete, Nisaba, and Metis (name, tagline, accent, capabilities,
route, auth, analytics-id, channels), availability states, shell-narrative and
launch contracts, offline-fallback cards, and runtime guards (`src/registry.ts`,
`guards.ts`). The lookup table the whole shell keys domains by.

### @oshun/domain-tara

The canonical Tara (meditation / practice) shell adapter and the largest domain
package (~8.9K LOC): ritual object models, ritual-assembly rules composing
meditation/breathwork/passage/journaling/Nyx-perspective steps, scheduling,
edit/skip/recover operations, completion events with downstream projections,
audio-session management, plus Lilith tone-review and crisis-handoff bindings
(`src/index.ts`, `README.md`). Tara is the product's experiential center.

### @oshun/domain-veritas

The canonical Veritas (story / fact-grounding) shell adapter (~12.3K LOC):
object models for stories/claims/explanations/timelines/counterclaims, and
namespaced sub-systems for source-quality, attestor workflow, counterclaim
balance, topic-hub composition, retraction-cascade UX, contradiction detection,
and an editorial state machine (`src/index.ts`). Includes Sophia-evidence and
Nisaba-lineage relationship helpers and trust-display rules.

### @oshun/embodiment-aja

The Aja embodied-instruction adapter (~424 LOC): `src/adapter.ts` normalizes the
embodied-instruction contracts from `@oshun/contracts/aja` (demonstration,
coaching-overlay, session-handoff across fitness/yoga/dance domains) into a
versioned Oshun envelope, plus a `canonical-adapter`. A real adapter, smaller in
scope than Psyche.

### @oshun/embodiment-psyche

The canonical Psyche real-time embodiment adapter (~14.2K LOC): one normalized
embodiment-profile / live-session-state / disclosure / session-planning surface
over the fragmented Psyche orchestrator, persona-service, conferencing, and
translation/avatar-quality libraries. Covers voice orchestration, turn-taking,
backpressure, reconnect, provider-failover, latency/quality dashboards, emotion
modulation, and crisis-frame handling (`src/index.ts`, `README.md`).

### @oshun/evidence-sophia

The canonical Sophia grounding/evidence adapter (~2.9K LOC): shared evidence,
citation, source-set, source-lifecycle, and grounded-answer DTOs plus
`educational-claim-grounding`, modeled as a cross-cutting **substrate** behind
Veritas claim inspection, Nisaba study grounding, assistant grounded answers,
and Studio research-integrity flows (`src/index.ts`, `README.md`) — not a peer
shell domain.

### @oshun/generation-control-isis

The canonical Isis generation-control adapter (~9.7K LOC): one stable
control-plane contract over Isis's many surfaces — workflow-template and model
registries, provider-registry and RunPod/ComfyUI routing, environment promotion,
release gates, provenance-bundle schemas, Civitai intake/review, and ComfyUI
governance, fronted by a `generation-dispatcher` and `dispatch-guard`
(`src/index.ts`, `README.md`).

### @oshun/i18n

The V1 locale catalog and formatting library (~721 LOC): the canonical
`OSHUN_LAUNCH_LOCALES` set (en-US, es-US, fr-FR, de-DE, ar, he, ja-JP, pt-BR),
the customer-message translation maps, `Intl`-based date/number/currency/region
formatting, the documented language-fallback chain, RTL direction metadata, and
text-expansion budgets for layout QA (`src/index.ts`).

### @oshun/memory-iris

The canonical Iris memory adapter and one of the largest nodes (~18.2K LOC): a
single tier/scope/consent model unifying the divergent `@iris/contracts` and
`@iris/memory-core` taxonomies, with assistant-identity, conversation/profile/
session/notebook memory, consent-ledger, data-rights, retention-compaction,
conflict-resolution, sensitive-context, admin-inspection, and
persistence/recall/ inference sub-packages (`src/index.ts`, `README.md`).

### @oshun/messaging-channels

The shared multi-channel messaging library (`layer:shared`, ~6.8K LOC): a
transport registry + dispatcher with real transports (HTTP/2 fetch, SMTP email,
web-push) and per-channel sub-modules for Telegram (bot, inline, payments,
publishing, STT, Sophia-grounder), WhatsApp, email, SMS, Discord, Slack, and
push, plus reminder producers/scheduler/worker and deliverability tracking
(`src/index.ts`).

### @oshun/navigation

The typed route + link-helper library (~5.4K LOC, `layer:navigation`): the
unified `OSHUN_ROUTE_MAP` for shell + domain routes, the customer/admin/tenant
IA contracts (Tara-centered), canonical `oshun://` deep-link and HTTPS link
builders/parsers, and named journey models (daypart, research→practice,
story→source, sky→text, assistant-continuity) plus a shared concept graph
(`src/index.ts`, `README.md`).

### @oshun/offline

Platform-agnostic offline helpers (~318 LOC, `layer:offline`): a TTL-backed
`OfflineCache`, a retry/backoff `OfflineSyncQueue`, `computeBackoffDelay` policy
helpers, and a `canProcessQueue` connectivity gate (`src/index.ts`, `README.md`)
for mobile/web/PWA shells.

### @oshun/payments-bridge

The payment-rails bridge (~4.6K LOC, `layer:payments`): a `state-mapper`,
trust-tier disclosure, and sub-modules for `oracle-aggregator`,
`cold-spend-queue`, `receipt-signer`, `entitlement-bus`, customer/admin
surfaces, and `security-gates` (`src/index.ts`) — the lower-level
payment/entitlement plumbing beneath `billing-support`.

### @oshun/persistence

The persistence layer and by far the largest node (~174K LOC, but ~4.2K of that
hand-written — the bulk is the generated Prisma client under `src/generated/`):
a contract-persistence registry/service, contract-record repository, durable
memory/snapshot/audit stores, a gold-set-entry store, DSAR deletion-cascade and
erasure runtimes, tombstone semantics, migration plans, and Zod↔Prisma
introspection (`src/index.ts`). The Postgres-backed substrate for the platform.

### @oshun/persona-policy-lilith

The canonical Lilith persona-policy adapter (~21.4K LOC): one policy-pack /
safety-tone surface over Lilith's fragmented moderation, spiritual-guidance,
crisis-safety, and voice-safety services — contemplative-tone and
generation-gentleness-floor policies, spiritual-boundary and unsafe-claim
overlays, crisis-safety analyzer + recovery, operator-override governance,
tenant-policy constraints, and a battery of `eval-*` harnesses (`src/index.ts`,
`README.md`).

### @oshun/persona-registry

The canonical persona registry and contract layer (~26.6K LOC): an immutable
registry-snapshot record/aggregate shape with a deterministic fingerprint and
pure get/list/filter/validate operations, plus family taxonomy, mandatory
metadata, approval lifecycle, coverage, scorecards, disclosure-visibility
measurement, voice-provider abstraction, avatar packs, and impersonation/clone
red-team evals (`src/index.ts`). Dependency-free so any domain can consume it.

### @oshun/platform-foundations

The platform-foundations spine (~2K LOC, `layer:foundations`): a barrel over
`service-discovery`, `public-api`, `shared-contracts`, `role-model`, `step-up`
(auth), `secrets`, `configs`, `rollback`, and `abuse-controls` (`src/index.ts`)
— the shared platform primitives services compose at the bottom of the stack.

### @oshun/privacy

The privacy/compliance library (~1.9K LOC, `layer:privacy`): a barrel over
`consent`, `residency`, `export-deletion`, `privacy-surface`, `dsar`, and
`compliance` (`src/index.ts`) — the customer-facing and operational privacy
machinery (DSAR, residency, export/deletion) that complements the persistence
layer's erasure runtimes.

### @oshun/render-farm

Shared render-farm scheduling primitives (~2.5K LOC, `scope:shared`,
`layer:infrastructure`): priority queues, worker-node capability matching,
dependency execution, preemption, cost estimation, cloud-burst planning,
checkpoint/resume, frame previews, and dashboard snapshots
(`src/render-farm.ts`, `types.ts`, `src/index.ts`).

### @oshun/search-discovery

The discovery/ranking library (~4.1K LOC, `layer:discovery`) — **explicitly
retired from V1 scope** per the audit notice atop `src/index.ts`: its ranker
scores `DiscoveryObject` features (persona-tone fit, evidence integrity,
grounding state, per-object entitlement) the live `/v1/search` candidates do not
carry, so V1 does not adopt it rather than fabricate those signals. The modules
(`catalog`, `signals`, `aggregation`, `candidates`, `ranker`, `experiments`,
`cold-start`, `concept-graph`, `evals`) remain tested as the V1.x adoption
target.

### @oshun/shell-achievements

Cross-domain achievements + accountability (~3.4K LOC): achievement definitions
and an unlock/progress engine, social-accountability partnerships and check-ins,
and community challenge templates spanning Tara/Veritas/Nyx/Arete
(`src/achievement-engine.ts`, `src/index.ts`).

### @oshun/shell-assistant

The voice-first cross-domain assistant (~14.3K LOC): `createAssistantEngine`
orchestrates intent classification, domain action routing, conversational
response formatting, persona handoffs, safe fallbacks, cross-domain continuity,
and bridges to Iris memory and Psyche sessions across all six domains
(`src/assistant-engine.ts`, `src/index.ts`).

### @oshun/shell-core

The core app-shell library (~20.3K LOC, one of the largest): consumer-shell
entry-points and domain-navigation, home orchestration, library aggregator,
activity timeline, notification/message centers, command surface, calendar-sync
(with real execution), onboarding/feature education, feature experiments, public
profiles, account switcher, and route analytics (`src/index.ts`).

### @oshun/shell-desktop

A framework-agnostic desktop-shell surface (~3.5K LOC): window manager, system
tray + quick actions, global shortcuts, OS notifications, custom `oshun://`
protocol handler, auto-update manager, and sidebar widget engine
(`src/desktop-engine.ts`, `src/index.ts`).

### @oshun/shell-routines

The cross-domain morning/evening routine system (~3.4K LOC): routine templates
spanning Tara (meditation/breathwork/body-scan) and Arete (review/planning/
journal/reflection/gratitude) steps, a step-execution engine, personalized
recommender, and analytics (`src/routine-engine.ts`, `src/index.ts`).

### @oshun/shell-wearable

The wearable-companion system (~3.5K LOC): streak widgets, watch complications,
smart reminders with timing inference, daily/weekly summary companions, haptic
patterns, and notification payloads optimized for wearable surfaces
(`src/wearable-engine.ts`, `src/index.ts`).

### @oshun/studio-authoring

The Studio authoring toolkit (~5.4K LOC, `layer:studio`): a barrel over
`creator-roles`, `authoring-blocks`, `editorial-lifecycle`, `asset-metadata`,
`taxonomy-curation`, `localization-workflow`, `versioning`, `collaboration`, and
`templates` (`src/index.ts`) — the content-authoring/editorial machinery behind
the creator/Studio surfaces.

### @oshun/tenant-console

The tenant/operator console library (~6.2K LOC, `layer:tenant`): a barrel over
`tenant-model`, `identity`, `roles`, `audit-explorer`, `bulk-ops`,
`integrations`, `notifications`, `help-center`, and `status-page`
(`src/index.ts`) — the multi-tenant administration surface.

### @oshun/trust-safety

The trust & safety library (~2.2K LOC, `layer:safety`): a barrel over
`policy-taxonomy`, `severity`, `decisions`, `crisis`, `abuse-patterns`,
`operator-surfaces`, and `evaluation` (`src/index.ts`) — the policy/enforcement
model and operator review surfaces for safety decisions.

### @oshun/ui

The shared UI primitives + theme library (~479 LOC, `layer:ui`): real React
components — layout (`Box`, `Stack`, `Text`), controls (`Button`, `IconButton`,
`Card`), data-display (`ListRow`, `StatTile`, `Badge`, `Chip`), feedback
(`Toast`, `Banner`, `EmptyState`, `ErrorState`), overlays (`BottomSheet`,
`Modal`, `ActionSheet`, `CommandPalette`), and navigation (`BottomNav`,
`TopBar`, `DomainSwitcher`) — plus `motion` helpers and a `theme` contract, with
Storybook stories (`src/index.ts`, `README.md`).

### @oshun/veritas-cascade-worker

A focused retraction-cascade worker (~285 LOC):
`subscribeRetractionCascadeWorker` plus event-bus and contract-persistence
ports, and persistence-backed Sophia re-grounders / Metis revalidators
(`src/veritas-cascade-worker.ts`, `composition.ts`,
`persistence-regrounders.ts`). It listens for Veritas retractions and re-grounds
downstream Sophia answers and Metis lessons.

### @oshun/assistant

The agentic-runtime composition root (`layer:shared`, ~11K LOC across 52 source
files; barrel at `libs/oshun/assistant/src/index.ts`, 337 lines). The
package.json calls it the "Composition root: assembles the agentic runtime
(provider + tools + memory + channels) into one runnable multi-channel assistant
(Hermes-parity spine)". `createAssistant()` resolves a real `@oshun/ai` provider
(`createAnthropicProvider`/`createOpenAIProvider`/`createGoogleProvider`/…,
fail-loud `ProviderConfigError` when a cloud key is absent), mounts
`builtinTools`, and wires them through the governed `AgentRunManager` +
`KillSwitchRegistry` from `@iris/agents-core` into a single `Assistant.ask()`
any channel adapter can drive.

It composes engines rather than re-implementing the LLM loop — that loop and the
provider adapters live in iris and `@oshun/ai` — but the parts it owns are real
domain logic, not scaffolds. `src/channels/` carries
Telegram/Slack/Discord/email-IMAP/Signal bridges sharing one crisis-safety net
(`detectCrisis` short-circuits before the model ever runs); `src/scheduling/` a
deterministic, DST-safe NL grammar (`parseNaturalSchedule`,
`zonedWallClockToEpoch`) over cron with Postgres stores and a `RedisLeaseGuard`;
`src/skills/` real TF-IDF (`idfWeights`, `lexicalScore`) and `cosineSimilarity`
ranking; `src/subagents/` an isolated-delegation pipeline over governed child
runs; plus `InMemory`/`PostgresConversationMemory`. The Hermes-parity spine
wiring Oshun's previously-isolated agent infrastructure into one autonomous,
multi-channel assistant.

### @oshun/ai-platform

Phase 98 AI-platform completion layer (`libs/oshun/ai-platform/src`), a wide
single-package surface of 19 modules: `agents` (`AgentPlanner`,
`MultiAgentDebate`), `rag` (`UnifiedRagPipeline`, `SemanticChunker`,
`QueryRouter`), `federated` (`AgentFederationGateway`), plus `compiler`,
`compliance`, `compression`, `efficiency`, `embeddings`, `integrations`,
`knowledge-graph`, `memory`, `model-security`, `multimodal`, `observability`,
`prompts`, `reasoning`, `safety`, and `simulations` — the platform-side glue
above the Nous model runtime. `AgentFederationGateway`, `A2ATaskManager`, and
the webhook/SSE helpers are process-local prototypes, not a mounted or
conformant A2A client/server; ADR-0091 defers external A2A adoption.

### @oshun/c2pa-export

C2PA content-credential export (`libs/oshun/c2pa-export/src`): `mint` builds the
manifest, `signer` signs it, `verify` round-trips the credential — the
provenance seam the media release gates call before anything ships publicly.

### @oshun/creative-autonomy

The autonomous-creative plane (`libs/oshun/creative-autonomy/src`): a
`director/` (director, producer, scheduler — the governor genuinely sleeps
between cycles), `ideation/` with embedding-based novelty, `portfolio/`,
`quality/`, `review/`, `signals/`, `steering/`, and `concurrency/` modules with
typed `errors` — surfaced over the BFF's `/v1/agentic/autonomy/*` routes.

### @oshun/fiat-payments

Fiat payment rail (`libs/oshun/fiat-payments/src`): a `stripe/` client with
`webhook-verifier`, `event-normalizer`, `price-catalog`,
`subscription-lifecycle`, and `settlement-processor`; `wallets/` for Apple Pay
and Google Pay (including `ec-spki` key handling); and an `entitlement-emitter`
that turns settled payments into entitlement events. Fail-closed by design when
credentials are absent.

### @oshun/scene-experience

Shared scene/social experience toolkit (`libs/oshun/scene-experience/src`):
`group-sessions`, `reactions` and appreciation aggregation
(`recordAppreciation`, `buildCreatorAppreciationDigest`), `follows`,
`audience-analytics`, and a `scene-vocabulary` shared across surfaces.

### @oshun/skill-system

Phase 97 cross-domain skill system (`libs/oshun/skill-system/src`):
`SkillRegistry` (Postgres and in-memory stores), `discovery`/`source-scanner`,
semver-aware `dependencies`, `composition` and `agent-tree` execution,
`governance` with `SkillQuotaManager`, a `ProcessSandboxExecutor` with a
`bubblewrapIsolationLauncher` seam, plus `evolution`, `generation`, `quality`,
and `training` modules feeding skill telemetry back into the flywheel.
