Orientation — how to read this project
canonical· pm · updated 2026-09-05 · source
Start here. This doc describes what the system IS and how to navigate the documentation.
It is not a log or a record of PRs/processes: for "what happened" see decisions/log.md.
The healthy way to read
- Start with
knowledge/INDEX.md— the manifest: one row per doc with its topic,statusandowner. Find the canonical doc for your topic there before reading any other. - If a file exists in
knowledge/, it is current. Superseded docs are DELETED — git is the archive. There is noarchive/folder; a present doc is the current truth for its topic. - The latest decision wins. When two docs conflict,
decisions/log.mdand the frontmatter'supdateddate break the tie. - Read the frontmatter
status—canonical= source of truth for its topic ·reference= consultable/research, not normative ·historical= context only, its decisions may be superseded. - A plan IS a GitHub issue (ADR-006), mirrored to the Plan Engine graph (ADR-004/005). The MDX
plan files (
apps/admin/src/plans/) are retired — the "where we stand" view is the/plan·/roadmap·/worksurface over the graph (plan-engine.md); strategy/roadmap narrative lives here inknowledge/.
Doc map — what to read for what
| You need… | Read |
|---|---|
| The Plan Engine graph (plans + tasks SoT, MCP, sync, admin views) | plan-engine.md |
| The first client / case study (Comprender E1) | comprender-mvp-e1.md |
| Business / roadmap / MVP narrative | tedos-business-model.md · comprender-mvp-e1.md |
| How the product evolves (subplans, timeline, approval) | product-development-flow.md |
| The engine (architecture, reliability, hybrid deployment) | packages/engine/ARCHITECTURE.md |
| Engine connectors (CRM, WhatsApp, Google, HubSpot, GitHub) | packages/engine/CONNECTORS.md |
| UI — design system, screens, grid | admin-design-system.md · tedos-screens.md · grid-system.md |
| UI — component sourcing (shadcn-first, one implementation per primitive family, dedupe guards) | component-sourcing.md |
UI — the student account section (/mi-cuenta/*): holder geometry, card-grid recipe, perfil IA | portal-mi-cuenta-spec.md |
| Design — canonical source map (Paper↔repo) + principles | design-source-of-truth.md · design-principles.md |
| The operator console (superadmin / internals) | console-design.md |
| The operator surface in the portal — nav / IA + app chrome | operator-nav-ia-spec.md |
| Brand — identity + voice | brand.md · brand-tone.md · admin-tone.md |
| Infra / DevOps — deploy, support email | cd-and-domain-provisioning.md · environments.md · support-email-alias.md (hosting → decisions/log.md) |
| Architecture decisions (ADRs) | decisions/adrs/README.md |
| The self-writing wiki — pattern + the ops | llm-wiki-pattern.md |
| Dev workflow — worktree & session-ownership model | wiki/kit-worktree-session-model.md |
| Dev workflow — OpenCode kit variant (spike, go/no-go) | opencode-kit-exploration.md |
The model seam — one boundary to the open-source model (/v1, tenant routing, local/hosted/mock tiers, engine + apps/chat consumers) | wiki/model-client-seam.md |
The neutral conversation app — per-tenant RAG chat (@tedos/ui/chat + .chat scope, model-client seam) | wiki/apps-chat.md |
The operator + builder console — Cian skin, plans viewer + student aula (app.tuempresa.digital) | wiki/apps-admin.md |
The operator's multi-tenant console — Amber skin, per-org modules/memoria over @tedos/core | wiki/apps-console.md |
Typed data-fetching — the one @tedos/api-client seam every Next app reads through | wiki/typed-data-fetching.md |
| Multi-tenant client config — one console configures every org (runtime, no rebuild) | wiki/client-configuration-framework.md |
| What was decided and when (tie-breaker) | decisions/log.md |
External reference / research (sources/ layer) | sources/t3code-teardown.md · sources/mobbin-research.md · sources/design-references-bento.md · sources/marketing-site-reference-benaios.md · sources/hosted-vllm-serving-databricks.md · sources/kit-resource-inventory.md |
System status (what it is, today)
- Plan Engine graph (
@tedos/db+/plan/*API, effort #560, live): the daily-driver source of truth for plans + tasks — a Postgres graph (5 tables in a dedicatedplanschema) editable/actionable from both Claude (9plan_*MCP tools) and the admin (/plan,/roadmap,/work), kept bidirectionally synced with GitHub issues/PRs + Vercel deploys (GitHub stays a mirror; elimination deferred, ADR-005). The dev-workflow graph — never mixes with tenant data. →plan-engine.md. - Product System of Record (
@tedos/domain, effort E1, live): tenant/client data in a dedicatedproductPostgres schema — never the dev-workflow Plan Engine graph (ADR-006 hard rule). A unifiedpersondeduped across channels with fiscal data; project = tenant = Clerk org. API inapps/api(/projects,/p/:id/students*,/p/:id/summary) behind Clerk auth + role-scoped tenancy. Comprender = tenant #1. →comprender-mvp-e1.md. - Plan graph + product SoR share one Fly MPG cluster, isolated by Postgres schema (
planvsproduct) — a documented compromise (no real tenant data yet) with a tracked upgrade path to a dedicated cluster before real tenant-PII volume or any external training-data export (plan-engine.md§7). - Two-level admin shell (
apps/admin, FROZEN — ADR-017, 2026-08-31): Level 1 platform (/projectsswitcher) + Level 2 project context (/p/[projectId]with swapped sidebar + role-scoped nav). No new development; kept only untilapps/consoleabsorbs the platform level.apps/portalis the primary tenant surface now. API on Fly (tedos-api,web+worker, Fly Managed Postgres). →comprender-mvp-e1.md. - Operator console (
apps/console=@tedos/console,console.tuempresa.digital, live): the operator superadmin / internals control room — a cross-tenant surface consuming@tedos/ui/adminchrome +@tedos/sharedcontracts, pointing at the sharedtedos-api. The third Aurea matiz: warm dark + Amber/Halide accent on the ink/pergamino panel, black top-bar (one amber moment per screen). It is the single surface from which an operator configures every client org. →console-design.md. - Client Configuration Framework (effort #922, live): one operator console configures
everything about an org — identity / domain, branding tokens, locale · tier · enabled modules,
feature flags, and AES-256-GCM connector secrets — while one multi-tenant client app resolves
the tenant from its request Host and reads all config from the public
GET /tenant/config. Config edits are runtime (DB-served, no rebuild); only code changes trigger selective builds, and one deployment serves every tenant domain. →wiki/client-configuration-framework.md. apps/clients/comprender(@tedos/comprender, live, tenant #1): the live multi-screen white-label client app — its screens (Resumen, Alumnos, Ofertas, Pagos, Inscripciones, Certificados, Misión, Conexiones, Run, Reportes) render the shared@tedos/ui/admin/screensbodies, read the product API through their own@tedos/api-clientseam, and resolve the tenant per-request by Host (lib/tenant-config.ts) with runtime branding on the.clientscope. →comprender-mvp-e1.md.- apps/chat (
@tedos/chat, live) — the neutral conversation app: a per-tenant RAG chat on the@tedos/uifoundation under the.chatink-accent scope (one accent moment = Composer Send), talking to the model through the@tedos/model-clientseam (AI-SDK streaming). The fourth skin alongside admin (Cian) / console (Amber) / comprender (white-label). →wiki/apps-chat.md. - Last-mile engine (
@tedos/engine): a model-agnostic orchestrator (open-source first) with a reliability layer — evals, retries, guardrails (PII) and a human gate — plus roles and a council/board-meeting to deliberate decisions. Its model boundary (LLMProvider,ModelPolicy,selectProvider) is now re-exported from the canonical@tedos/model-clienthome (#874), not implemented twice. - Model seam —
@tedos/model-clientis the single canonical boundary to the open-source model (OpenAI-compatible/v1+x-tedos-tenant, hybridlocal/hosted/mocktiers — only the provider changes);@tedos/enginere-exports it for request/response andapps/chatconsumesresolveModelConfigfor streaming, while the Python satellites target its wire contract (CONTRACT.md) — no per-app fetcher (#874). →wiki/model-client-seam.md. - Connectors: CRM, WhatsApp (Meta / 360dialog), Google, HubSpot, GitHub; a pg-boss-style queue
(in-memory so it boots without Postgres). (The legacy in-memory
tickets.tsstore is retired, #560/#570 — ticket/Deliverable state lives in the Plan Engine graph.) - Verticals marketing + accounting over the same core — each delivery reuses the engine.
- Typed data-fetching seam —
@tedos/api-client(openapi-fetch typed by generated@tedos/api-types) is the one transport every Next app reads through; thin per-applib/api-client.tsseams inject baseUrl + Clerk token, data-fns returnApiResult(no swallowed fallbacks),no-store+React.cache, offline fixtures behind one flag. The generated types are produced bypnpm gen:apifromapps/api/openapi.json(the committed spec is the drift check). →wiki/typed-data-fetching.md. apps/admin: Run screens (launch a goal and watch the engine execute) and Timeline inside the authenticated shell; the/api/engineproxy injects the tenant from Clerk.apps/api(Fastify, on Fly): the shared product API — the engine at/engine/*(goal / jobs / decision), the product SoR routes (/projects,/p/:id/*), the operator-console config endpoints + the public Host-resolvedGET /tenant/config, and the OpenAPI spec (openapi.json) that generates@tedos/api-types.
Golden rule
The documentation describes what IS. When you change the state of the system, update the doc
for that topic (and its row in INDEX.md) in the same PR — never append to a log file.
Changelogs are only written when planning a release.
Ingested wiki pages
Auto-maintained by the self-writing engine (scripts/knowledge-ingest.sh) — each ingested page is linked here so it stays reachable (never an orphan).
- Kit knowledge CLI — ingest & query the self-writing wiki
- Client Configuration Framework
- Per-tenant model economics — the cost of a client's "own brain"
- @tedos/model-client — the model seam
- apps/chat — the neutral conversation app
- apps/admin — the operator + builder console
- apps/console — the operator's multi-tenant console
- Typed data-fetching — @tedos/api-client (the one seam every Next app reads through)
- cckit adoption — switching tedos off the in-repo plugin fork
- Canonical module registry (@tedos/core/modules)
- Student commerce backend — Stripe checkout + webhooks
- Student auth & portal — better-auth + student-scoped API