# Sypnia Cases documentation > Sypnia Cases is the map of everything your app does, written as use cases that anyone can read: who does what, what can go wrong, what data it touches. The map is the contract of the project: what is not on it is a scope error. Your code, your data, your traces and your coding agent all point back to it. Sypnia comes two ways, and every page says which one it is about: - **Cases format and tools** (open source: the format, the cli, the server): Ingest, storage, aggregation, problem grouping, sessions, replay data and uptime checks. You read it through: The HTTP API, the MCP server, the CLI and the Console: one built-in page with the problems list and the session replay viewer. - **Sypnia Cloud** (hosted by us, paid with credits): The same engine, run by us. You read it through: The full app: replay player, performance, uptime, daily summary, search and teams. Every page is also plain Markdown: add `.md` to its address (`https://cases.docs.sypnia.com/start/open-source-and-cloud.md`). All pages in one file: https://cases.docs.sypnia.com/llms-full.txt ## Start here What Sypnia Cases is, how it works, what is open source and what is Sypnia Cloud, and the quickstarts. - [Start here: overview](https://cases.docs.sypnia.com/start.md): Section index for Sypnia Cases: the use-case map of an app as a product. An open file format (case files and a map file in the repository), a CLI and a server that are open source, and a Sypnia Cloud service with a visual editor, proposals and reviews, and live links to Data, Telemetry, Git and Agent. Read what-it-is, how-it-works, open-source-and-cloud, then a quickstart. [Engine, Cloud] - [What Sypnia Cases is](https://cases.docs.sypnia.com/start/what-it-is.md): Sypnia Cases: a map of every flow of an app as use cases (actor, goal, how it starts, where it lives, steps, outcomes and failures, data, permissions), plus the runtime that runs them (one service per area, outcomes as events through a transactional outbox, retries, dead letters, loop guard). Purposes: a shared language for non-programmers and programmers, the scope contract of a project (anything not on the map is a scope error), and the backbone that links code (Git), data (Data), production behaviour (Telemetry) and the coding agent (Agent) to each flow. Usable alone for planning without code. [Engine, Cloud] - [How it works](https://cases.docs.sypnia.com/start/how-it-works.md): Cases lifecycle: (1) write or generate use cases (visual editor, YAML files, or Sypnorm code via `map`) with their start, place and outcomes; (2) the map is versioned and approved (proposals); (3) `cases generate` writes each case's typed skeleton and people or the agent write the rules inside (useCase, ctx.db, ctx.outcome); commits carry `Case: `; (4) `cases check` compares code and map (scope errors, drift, orphans, loops, places); (5) the runtime runs each area as one service: starts become routes, endpoints, jobs and subscriptions, outcomes go to the caller, to listeners through the outbox, and always to Telemetry; (6) Telemetry measures each case and real clicks confirm the navigation map; (7) changes go back to the map as proposals. [Engine, Cloud] - [Where these ideas come from](https://cases.docs.sypnia.com/start/where-ideas-come-from.md): Sypnia Cases puts the Living Cases Manifesto (https://cases.sypnia.com/manifest/, Spanish /es/manifest/ «Manifiesto de los Casos Vivos») to work. Nine principles: the use case is the source of truth; anyone can read it; every case has a place and a start; every case ends in a declared outcome; outcomes are events with a contract; a case is a unit of meaning, not of deployment; reliable by construction (outbox in the same transaction, a queue and dead letters per listener, idempotence, loops refused or cut); production tells the truth back (Telemetry, real clicks confirm the map); people and agents agree on the map. Sources: Jacobson (use cases, Use-Case 2.0), Cockburn (goal levels, hexagonal ports → typed starts), Buhr (Use Case Maps → tree of places + graph of outcomes), Martin (use cases at the center), Evans and Vernon (ubiquitous language, bounded contexts → areas, domain events → outcomes, one aggregate per transaction), Brandolini (EventStorming policies → cases started on events), Young (CQRS; event sourcing optional), Richardson (outbox, sagas, idempotent consumers), Hohpe and Woolf (dead letter channels, correlation, aggregator → on_all), Fowler (hidden event flows → the graph), Helland (at-least-once, idempotence), Adzic (living documentation), the Agile Manifesto, infrastructure from code (Encore, Nitric), durable execution (Temporal, Inngest). [Engine, Cloud] - [Open source and Sypnia Cloud](https://cases.docs.sypnia.com/start/open-source-and-cloud.md): Open source: the Sypnia Cases format (spec and JSON Schema), the @sypnia/cases package (validator, client, CLI `cases`), the Cases server (API, storage on Postgres, checks) and the runtime (outbox, fan-out, retries, dead letters, loop guard; on AWS or on Postgres alone). Sypnia Cloud adds: the visual editor, proposals with external reviewers, live links to Data/Telemetry/Git/Agent, history and exports, SSO with the Sypnia account, and billing in credits. Licenses: the server AGPL-3.0; @sypnia/cases (Sypnorm and the TypeScript runtime included) and the Rust crate sypnia-cases MIT, since they run inside apps; the format is open for anyone to implement. [Engine, Cloud] - [Quickstart: Sypnia Cloud](https://cases.docs.sypnia.com/start/quickstart-cloud.md): Cloud quickstart: sign in at cases.app.sypnia.com with the Sypnia account; create a workspace and a map; add areas and use cases in the editor; invite a reviewer by e-mail; approve the first version; connect a repository so the files and the map stay in sync. [Cloud] - [Quickstart: the map in your repo](https://cases.docs.sypnia.com/start/quickstart-repo.md): Repo quickstart: `npx @sypnia/cases init` creates cases/map.yaml, cases/navigation.yaml and an example case; edit cases//.case.yaml (starts, where, outcomes, failures) and cases/navigation.yaml; `npx @sypnia/cases check` validates against the JSON Schema and, with Sypnorm, compares with the code; add the check to CI (exit code 1 on scope errors). [Engine] ## The map Use cases, actors, areas and journeys, what a map is made of, and how a person who does not program reads it. - [The map: overview](https://cases.docs.sypnia.com/map.md): A map = use cases (the unit: who, goal, how it starts, where it lives, how it ends), actors (people roles and systems), areas (groups of cases with their public outcomes; one service each), journeys (ordered cases a person goes through), the navigation map (a tree of places, one parent each, roots per actor) and the event graph (outcomes as events between cases). Two views that agree: a tree of places for people, a graph of outcomes for the system. Pages: use-cases, navigation, starts, outcomes-and-events, actors-areas-journeys, editor, reading-for-everyone. [Engine, Cloud] - [Use cases](https://cases.docs.sypnia.com/map/use-cases.md): Use case fields: id (kebab-case, stable), title (plain words), actor (one primary actor id), goal (one sentence), starts (how it starts: in_app | { external: webhook|api, idempotency_key, respond, input, signature } | { scheduled: 'every 2h' | cron, timezone } | { event: } | { event: { on: [...] | on_all: [...], key, within, filter, order_by } }), where (optional place id in the navigation map, only for in_app, e.g. shop.order-for-tomorrow), preconditions, steps, input (typed fields), outcomes (named, PascalCase, typed payload: { OrderPlaced: { order_id: uuid, ready_at: datetime } }; long form { payload, says }), failures (outcomes too: { SoldOut: «tell» } or long form { when, tell, payload }; the list form - name/when/tell is accepted), data (reads/writes), allowed (actor ids), ai ({ tasks: [...] } Sypnia AI tasks it calls), files ({ reads, writes }: Sypnia Files buckets), mail ({ sends: [...] }: Sypnia Mail templates), loop ({ bounded: true, max, until } only to close a reviewed cycle), retries ({ max, backoff }), status (idea|approved|building|live|retired), owner, notes. Required: id, title, actor, goal, starts, and at least one outcome. Every case ends in a declared outcome. [Engine, Cloud] - [The navigation map](https://cases.docs.sypnia.com/map/navigation.md): cases/navigation.yaml: roots[] {id, title, actors[], route} (several roots: public site, console, member app; an actor may have several), places[] {id (dotted kebab segments, e.g. shop.order-for-tomorrow, stable), title, kind screen|tab|modal|menu|panel, parent (exactly one), opened_by {label, kind button|link|item|tab} = the actionable on the parent that opens it, route?, permission?}, shortcuts[] {from, to, label} (other ways in; never a second parent). Path = titles from root to place, «Shop › Order for tomorrow», computed, never written. A case with starts: in_app may have where: . Place ids: kebab-case segments joined by dots, independent of the route and of the tree path (moving a place keeps its id). In the markup: data-sypnia-place on the element that shows a place (set by Sypnia Design's generated pieces and @sypnia/ui from the case's where), data-sypnia-opens= on an actionable; `cases nav --from-code` proposes the tree. Telemetry: every page_view and click carries place (innermost data-sypnia-place); spans carry sypnia.case and sypnia.case.outcome; the navigation check compares moves with the tree (nav-missing-edge, nav-unreached 30 days, nav-unknown-route). Feeds: «how to get there» in docs, the agent («where do I edit X?»), role editors, video breadcrumbs, Design screens. [Engine, Cloud] - [How a case starts](https://cases.docs.sypnia.com/map/starts.md): starts (required), typed: in_app (a person in a place; may have where) | { external: webhook|api, idempotency_key: , respond: outcome (default for api: wait and answer with the outcome) | accepted (202 + run_id at once; default for webhook), signature: { header, secret } (HMAC of the body) or a case key (Authorization: Bearer syp_rck_…, one case only) } → a public endpoint POST /hooks/ with the input schema; a resend with the same key within 24 h returns the first answer and runs nothing; in_app → a route of the area's service POST /_cases/ called with the person's Sypnia Data session, run under RLS (401 without one; role = app_metadata.role, else [cases] default_role of sypnia.toml; 403 for a role not in allowed, or an Origin other than the service's own host or [cases] origins); a case someone listens to always starts there, never from the browser; case keys: secret SYPNIA_CASE_KEY_, printed by `npx @sypnia/cases key `; every m|h is an elapsed interval aligned to the zone's standard time, every d runs at local midnight every n days counted from 1970-01-01 | { scheduled: 'every 2h' | '', timezone: IANA (default UTC) } → a job | { event: } | { event: { on: [a, b] (any), filter: { field: value | { gte, gt, lte, lt, in, exists } } } } | { event: { on_all: [a, b], key: , within: } } (waits for all with the same key inside the window; otherwise WindowExpired in Telemetry, case not started); order_by: delivers same-key events one at a time in order. in_app yes/no is derived from the kind. A case with no start is an orphan (check error). Only public outcomes of other areas can be listened to; a case never listens to its own outcome. [Engine, Cloud] - [Outcomes and events](https://cases.docs.sypnia.com/map/outcomes-and-events.md): Every run ends in exactly one declared outcome or failure (failures are outcomes); an undeclared error is not an outcome: it goes to Telemetry as an error and, for event-started runs, to dead letters after retries. Event name ...v (e.g. weather.check-weather.RainExpected.v1); a breaking payload change needs a new version (check: breaking-change), adding an optional field does not; a new version is declared in the outcome's long form, version: and since: (required from version 2: the day it was first emitted); the case emits both for 90 days after since, the previous one with the payload given in ctx.outcome(name, payload, { previous: { 1: … } }) or the same payload, then the old one stops (check: old-version counts the days from since: a warning with the days left, an error after the 90 days). A declared failure undoes the run's own writes; its event (when someone listens) and the delivery's record still commit. Event envelope: id (uuid v7), name, data (the payload, ≤256 KB), occurred_at, key (order_by value), traceparent, cause (chain of case ids), depth. Delivery decided by the runtime: to the caller if one waits (in_app, external api with respond: outcome), to the outbox if any case listens, always to Telemetry. Areas: outcomes internal by default; map.yaml areas[].public lists the ones other areas may listen to (the area's contract); listening to another area's internal outcome is a check error (internal-outcome). The event graph is drawn from the files and checked for loops. [Engine, Cloud] - [Actors, areas and journeys](https://cases.docs.sypnia.com/map/actors-areas-journeys.md): Actors: id, name, kind (person|system), description; a person actor maps to a role in the app (and, with Data, to RLS roles); systems include other apps (rappi) and the clock (scheduled cases). Areas: id, title, cases in order, public (outcomes other areas may listen to: .; everything else internal); an area runs as one service. Journeys: id, title, actor, an ordered list of case ids, optional branches. Defined in cases/map.yaml. [Engine, Cloud] - [The visual editor](https://cases.docs.sypnia.com/map/editor.md): The visual editor (cases.app.sypnia.com): areas as lanes, cases as cards with status and health, journeys as arrows; views of the navigation tree (places, paths, Telemetry click findings) and of the event graph (queues, retries, dead letters, cycles); case detail as a plain-language form; writing a case from a sentence (AI-assisted questions); keyboard and phone support; every edit is a change to the same files, saved as a draft proposal. [Cloud] - [Reading for everyone](https://cases.docs.sypnia.com/map/reading-for-everyone.md): Three reading levels of a case: plain (title, actor, goal, steps, failures as messages), working (adds place path, data, allowed actors, status), technical (adds types, events emitted and listened to, Sypnorm signature, tables and policies, traces, code links). The level is chosen per person (from the Sypnia knowledge test, persisted in the account) and can be switched anytime. [Engine, Cloud] ## Scope and contract The landing, the plan and the map as one contract; scope errors; versions, proposals and reviews. - [Scope and contract: overview](https://cases.docs.sypnia.com/contract.md): The project contract = the approved landing page (what is promised), the plan (how and in what order) and the approved map version (every flow). Anything built that no case describes is a scope error; the fix is a map proposal, approved before the code. Pages: the-contract, scope-errors, the-check, versions-and-reviews. [Engine, Cloud] - [The contract](https://cases.docs.sypnia.com/contract/the-contract.md): Contract documents: landing (public promise, every promise maps to at least one case via `promises` in map.yaml), plan (cases/plan.md: every `##` heading is a milestone; its cases in the heading `(cases: a, b)` or on a `Cases: a, b` line under it; delivered when the heading says `delivered` or ✓, or a line under it says `Delivered: ` or `Status: delivered`), map (approved version). Rules: every landing promise has cases; every case in a milestone exists in the map; the map's approved version is the scope. `cases check` reports `unbuilt` (an approved case of a delivered milestone with no code; status idea or retired skipped) and `invalid` for a milestone naming a case with no file; `--contract` also reports `broken-promise` for a landing promise or a milestone that names no case. The Cases server runs the check on every proposal, without the plan, which stays in the repository. [Engine, Cloud] - [Scope errors](https://cases.docs.sypnia.com/contract/scope-errors.md): Scope error kinds: unmapped (code implements a use case no case describes), unbuilt (an approved case in a delivered milestone has no code), drift (code and case disagree on data written, outcomes, failures or allowed actors), broken promise (landing promise without cases). Fix: change the map first via a proposal; never silence the check except with an explicit, reviewed waiver in map.yaml. [Engine, Cloud] - [The check](https://cases.docs.sypnia.com/contract/the-check.md): `cases check` inputs: the map files (validated with the JSON Schema; navigation tree; event graph), the code side (Sypnorm use cases from `cases map --json`; and code without Sypnorm: `Case: ` trailers of the last 2000 commits and `// case: ` notes in the sources, also with #, /* or