Skip to content

Design decisions

The choices behind Sypnia Cases that shape these pages, and why each one was made.

Applies to EngineCloud
View as Markdown

These are the choices that shape Sypnia Cases. Each one is written on the page that uses it; this page puts them together with the reason behind them.

DecisionWhat it isWhy
Licensesthe server under AGPL-3.0; what runs inside apps under MIT, like every Sypnia SDK and CLI: @sypnia/cases, Sypnorm and the TypeScript runtime included, and the Rust crate sypnia-cases with its core; the format is open for anyone to implementthe package fits any project, open or closed; a hosted copy of the server shares its changes
The canonical fileYAML, with JSON acceptedpeople read and review YAML more easily; machines can write JSON
Reviewers have an accounta free Sypnia accountan approval is tied to a person, and the account is the same for every product
Writing cases with AI in the editorthrough Sypnia AI, paid with credits, always as a draft a person approvesit makes the map possible for people who do not program, without letting a model change the scope
Where maps livein Cases only; Sypnia Data’s console shows a summary of the linked Cases project and links to itone owner for the map and its versions; Data stays about data
Sypnorm belongs to Cases@sypnia/cases/sypnorm, with /map and the cases command; Sypnia Data is the data layer and works with any ORMthe map Sypnorm derives is the code side of the Cases map
Sypnorm’s commandscases tables for typed tables (because cases pull already brings the map from Sypnia Cloud), cases map for the code side of the map, cases link --data <ref> to link with a Data projectone command for the whole product, no clash between names
Linkingone Data project ↔ one Cases project, both ways (Data)simple to explain; enough for one app per project
Maps uploaded to Datathey are kept with the Data project and go on to its linked Cases map, as a draft proposal on behalf of the person who uploaded themone command serves both products, and a person still approves
The organizationthe same Sypnia organization as in Data (no copy), added to Cases on first useone organization per company across the suite
MCP endpointits own, mcp.cases.sypnia.com: one endpoint per product, the token decides (MCP)Cases works without Data; permissions, limits and outages stay separate
npx @sypnia/data init asks about the ORM and Caseswhich ORM (SQL, Prisma, Drizzle or Sypnorm) and whether to use Cases; Sypnorm or Cases installs @sypnia/cases and creates and links the Cases project through MCPthe agent sets up both in one step
Place idskebab-case words joined by dots (shop.order-for-tomorrow), independent of the route and of the path; one parent per place, shortcuts for the rest; data-sypnia-place in the markupthe path is always known and unique; renaming or moving never breaks a case, a screen or a trace
Typed startsin_app, external, scheduled, event instead of free-text triggers; whether a case is in the app comes from its starteach start becomes real infrastructure, and nothing is left to guess
Every case ends in a declared outcomefailures are outcomes; an undeclared error goes to Telemetry and, for event runs, to dead lettersevery ending has a name people read, the code types and Telemetry counts
Event names<area>.<case>.<Outcome>.v<N>; a breaking change needs a new versionlisteners never break by surprise
Public and internal outcomesper area, in map.yamlareas stay apart; their public outcomes are their contract
One service per areaa case is a unit of meaning; Run splits one only when needed (cases.split)fewer services, fewer cold starts, one place to look
Deliverytransactional outbox in the same Postgres transaction as the case’s rows, written only by the area’s service (a case someone listens to never runs from the browser: it is called at POST /_cases/<id>, with the person’s Data session, under row-level security), fast path plus a sweep every minute, a queue and dead letters per listener, at least once with idempotent listeners, order only by order_by; EventBridge and SQS on AWS, Postgres alone otherwisereliable by construction, the same guarantees everywhere
Loopsrefused at design time unless bounded (loop: { bounded: true, max, until }), no case listens to itself, cut at run time at depth 10 (LoopStopped)a chain never runs forever
PlansCases alone, or inside the Sypnia subscription, with extra capacity per item, always prepaid (Sypnia Cloud)you pay for what you use, never after the fact

When a decision changes, its page changes and the changelog says so.

    Search pages, sections and terms