# Osy#

> Osy# is a programming language built for a world where agents write most of the code. One language is the whole app (the data, the rules and the screen); one command runs it on your laptop and, when hosting opens, ships it. The compiler decides where each line runs, secures every read, makes outside calls happen exactly once, and answers questions about the app (`osy model --json`, `osy explain`, `osy inspect`, `osy check`).

Everything below is public. Reference and specification pages have a raw Markdown twin at `<page>/index.md`; the whole reference and specification is one file at https://osysharp.com/llms-full.txt. Every fenced example on the reference marks how it is verified, and the compiled ones are compiled by CI against the real compiler. Status: beta; the binaries are not published yet (hello@osysharp.com to be told when).

## Start

- [Home](https://osysharp.com/): what it is, why now, what disappears, the marquee features, a recorded first session
- [Get it](https://osysharp.com/#get): status, the install commands (placeholders until the channels are live), feedback, statistics
- [Start here: the local toolchain](https://osysharp.com/reference/local/): install, the inner loop, the daily verbs
- [Anonymous statistics](https://osysharp.com/reference/project/statistics/): what the toolchain sends and `osy telemetry off`

## Why Osy# (nine chapters: why, then how, then proof)

- [Built for agents](https://osysharp.com/guides/written-by-agents/): A reader that cannot ask a colleague can ask this compiler. An agent gets the app's real shape, real access rules and real trace from four commands, not from guessing.
- [Agents as declarations](https://osysharp.com/guides/agents/): The apps that are hard everywhere else are the ordinary kind here. Declare one; its answer streams into a page a token at a time; it can park on a person for two days.
- [Workflows that wait](https://osysharp.com/guides/workflows/): A process that waits three days for a person is still just source. The state is a column on your entity; a run outlives the deploy that started it.
- [Runs exactly once](https://osysharp.com/guides/durability/): Your database is transactional. The world is not. A crash between charging a card and sending the confirmation cannot charge the card twice, and cannot send the mail twice.
- [Secure by default](https://osysharp.com/guides/security/): Say who may read it, once. Every query obeys. A caseworker may read a case if their unit handles it, they have not recused themselves, and they are senior enough for a restricted one — four rules, named once, one statement.
- [Nothing to mock](https://osysharp.com/guides/testing/): An agent can prove its code works. Not say so. The agent writes the test beside the feature, runs one command, and hands you a green that ran real functions against real rules on a real database, and looked at the screen.
- [The editor is the compiler](https://osysharp.com/guides/editor/): Your editor is never wrong about your app. Hover, rename, go-to-definition and the debugger come from the resolver that compiles your app.
- [UI in the language](https://osysharp.com/guides/ui/): The screen is written in the same language as the rules. There is no second stack. Reactivity, layout and theming are parts of one language, not three libraries.
- [Documents are data](https://osysharp.com/guides/markdown/): A document a person and an agent can edit at the same time. One type: an editor kit, nine agent tools, streaming and a memory that cites its sources follow from it — nothing to integrate.
- [One program](https://osysharp.com/guides/full-stack/): You do not place code. The compiler does. Where each line runs follows from what it touches, and the compiler prints where.

## Reference (one page per construct)

- [Reference index](https://osysharp.com/reference/): 381 pages in 24 areas
- [Agent](https://osysharp.com/reference/agent/): 15 pages — An `agent` is a declaration — instructions, tools, model — and calling it is calling a name. The first-day mistake is treating the call as…
- [API](https://osysharp.com/reference/api/): 1 pages — publishing a REST API (app.Apis)
- [Class](https://osysharp.com/reference/class/): 15 pages — A class is an in-memory shape — data plus the behaviour that belongs to it — and it never touches the database. That is the whole…
- [Config](https://osysharp.com/reference/config/): 11 pages — The cross-cutting settings an app declares in one place — the app config object. Two kinds live here: the external providers and…
- [Counter](https://osysharp.com/reference/counter/): 1 pages — Counter
- [Diagnostics](https://osysharp.com/reference/diagnostics/): 3 pages — What your app says while it runs, and what the compiler says about it. The first-day mistake is reaching for a print statement — `Log.*` is…
- [Entity](https://osysharp.com/reference/entity/): 11 pages — An entity is a table — and the rules that are true about it. Not just its columns: what must hold for a row to exist, and who may see or…
- [Enum](https://osysharp.com/reference/enum/): 3 pages — A fixed set of named values, used as a member type. By default an enum stores as a compact number; add [Type(string)] to store the member's…
- [Function](https://osysharp.com/reference/function/): 64 pages — A function is where your app's logic lives — a top-level unit of work, written like a C# method, that runs on the server. It is…
- [HTTP](https://osysharp.com/reference/http/): 4 pages — Two ways to make an outbound HTTP call. A `client` block is a typed wrapper around a known API — name the base URL once, declare each…
- [JSON](https://osysharp.com/reference/json/): 1 pages — JsonSerializer
- [Local](https://osysharp.com/reference/local/): 25 pages — The local develop-and-debug loop for an Osy# app — for the person in the editor and the coding agent at the CLI alike. Run your app on a…
- [Memory](https://osysharp.com/reference/memory/): 9 pages — How you make text findable in Osy#. You never touch a vector, an index, or an embedder — you mark a text field [Searchable] and search it…
- [Project](https://osysharp.com/reference/project/): 11 pages — A workflow run can outlive the deploy that started it. Deploying with --new-version freezes the code and data shape the running app has, so…
- [Query](https://osysharp.com/reference/query/): 23 pages — How you read data in Osy#. You write C# LINQ; it becomes one SQL statement. The rules that follow from that are the whole model: the…
- [Realtime](https://osysharp.com/reference/realtime/): 4 pages — Realtime in Osy# is one construct: a topic. A topic is a declared, addressable destination — publishing to one delivers the value to every…
- [Scheduling](https://osysharp.com/reference/scheduling/): 1 pages — Schedule (recurring work)
- [Security](https://osysharp.com/reference/security/): 17 pages — How authorization works in Osy#, end to end. Everything is denied until you grant it; a grant is compiled into every query rather than…
- [Stdlib](https://osysharp.com/reference/stdlib/): 10 pages — The pure standard library, and the one fact about it that changes how your app feels: 126 of its 155 methods run in the BROWSER, with no…
- [Storage](https://osysharp.com/reference/storage/): 5 pages — Replacing a stored file's content while keeping what it said before. The FILE is the identity — a record pointing at it never re-points…
- [Testing](https://osysharp.com/reference/testing/): 14 pages — A `[Test]` reaches the network for real — `Http.*` and a typed `client { }` operation both run inside a test, against the live endpoint. So…
- [Types](https://osysharp.com/reference/types/): 19 pages — The complete vocabulary of built-in types — the scalars you can store, the collections, the two callable spellings (`Action` and `Func`)…
- [UI](https://osysharp.com/reference/ui/): 75 pages — Two controls over a stored PDF: a reader with fit, zoom and a real text layer, and a thumbnail that draws one page as a picture. Shipped as…
- [Workflow](https://osysharp.com/reference/workflow/): 39 pages — Any call that leaves the platform — an outbound client call, an external service — is made a durable step by the compiler. In a workflow, a…

## Specification

- [Specification index](https://osysharp.com/spec/): 5 of 13 sections drafted; in progress
- [§1 Scope, conformance, and notation](https://osysharp.com/spec/01-scope-and-notation/): drafted
- [§2 Lexical structure](https://osysharp.com/spec/02-lexical-structure/): drafted
- [§6 The execution-side model](https://osysharp.com/spec/06-execution-side/): drafted
- [§9 Durability semantics](https://osysharp.com/spec/09-durability/): drafted
- [§11 Deliberate non-features, and why](https://osysharp.com/spec/11-non-features/): drafted

## Samples (complete apps, with their tests)

- [Samples index](https://osysharp.com/samples/): 20 apps; the curated ones are what `osy init <name>` writes
- [arcade](https://osysharp.com/samples/arcade/): A collection of small arcade games — the demo that pushes the UI engine hardest. (`osy init arcade`)
- [agent-expenses](https://osysharp.com/samples/agent-expenses/): agent-expenses — an expense system where agents do real work, and every cent is attributed to an outcome you can judge. (`osy init agent-expenses`)
- [chart-demo](https://osysharp.com/samples/chart-demo/): CHART DEMO — the consumer that makes `kits/chart` a library rather than a claim. (`osy init chart-demo`)
- [chat-room](https://osysharp.com/samples/chat-room/): A group chat — conversations, participants and messages, behind a login. (`osy init chat-room`)
- [ember](https://osysharp.com/samples/ember/): EMBER — a small team workspace, and the first app built entirely on the topic surface ([[M256]]/[[M261]]/[[M262]]). (`osy init ember`)
- [dialog-demo](https://osysharp.com/samples/dialog-demo/): THE CANONICAL DIALOG SAMPLE (D60/D212). (`osy init dialog-demo`)
- [dropdown-demo](https://osysharp.com/samples/dropdown-demo/): A project's LEAD, chosen from a dropdown — the sample that proves M121's `Slot(item)` renders, and that a dropdown bound to an ENTITY-typed property…
- [entity-inheritance](https://osysharp.com/samples/entity-inheritance/): entity-inheritance — one table, four kinds of document, three levels deep. (`osy init entity-inheritance`)
- [file-manager](https://osysharp.com/samples/file-manager/): Files and folders — upload, download, move and delete, with a folder tree. (`osy init file-manager`)
- [kanban](https://osysharp.com/samples/kanban/): A kanban board — cards move between lanes, and a workflow drives the states. (`osy init kanban`)
- [markdown-demo](https://osysharp.com/samples/markdown-demo/): Markdown demo — the built-in markdown control, running against real sectioned storage. (`osy init markdown-demo`)
- [memory-lab](https://osysharp.com/samples/memory-lab/): An agent with long-term memory — notes it keeps about a subject, across conversations. (`osy init memory-lab`)
- [wf-order-saga](https://osysharp.com/samples/wf-order-saga/): wf-order-saga — the ORDER-LOB workflow demo.
- [wf-approvals](https://osysharp.com/samples/wf-approvals/): A purchase-order approval workflow — it parks and waits for a human at each step. (`osy init wf-approvals`)
- [wf-expense-hitl](https://osysharp.com/samples/wf-expense-hitl/): wf-expense-hitl — the SLOT-DEPENDENCY workflow demo (ExpenseApproval).
- [wf-fanout-quorum](https://osysharp.com/samples/wf-fanout-quorum/): wf-fanout-quorum — the FAN-OUT + QUORUM workflow demo.
- [wf-signup-invite](https://osysharp.com/samples/wf-signup-invite/): An invite-and-accept signup — send an invitation, then wait for the person to accept it. (`osy init wf-signup-invite`)
- [wf-supplier-dispatch](https://osysharp.com/samples/wf-supplier-dispatch/): wf-supplier-dispatch — CORRELATION: an inbound event finds its run by a BUSINESS KEY.
- [wf-nightly-digest](https://osysharp.com/samples/wf-nightly-digest/): wf-nightly-digest — the SCHEDULED trigger, end to end.
- [wf-support-sla](https://osysharp.com/samples/wf-support-sla/): wf-support-sla — the SUPPORT-TICKET workflow demo.

## Packages (public on GitHub, MIT)

- [Packages index](https://osysharp.com/packages/): the Osy# packages we publish
- [Osysharp.Ui](https://github.com/osysharp/ui): Buttons, fields, dialogs, the data grid and the app shells. Pure Osy#, with no JavaScript: every control is ordinary source you can read and fork. (`use Osysharp.Ui@2;`)
- [Osysharp.Charts](https://github.com/osysharp/charts): Line, area, column, bar, scatter and candle charts over one shared value scale, plus a pie. Written in Osy#, with no JavaScript. (`use Osysharp.Charts@1;`)
- [Osysharp.Markdown](https://github.com/osysharp/markdown): A rich markdown editor: sections, partial saves, a block menu, tables, find and replace, maths and diagrams. (`use Osysharp.Markdown@1;`)
- [Osysharp.Pdf](https://github.com/osysharp/pdf): A PDF reader with fit, zoom and a real text layer, and a thumbnail that draws one page as a picture. (`use Osysharp.Pdf@1;`)
- [Osysharp.Barcode](https://github.com/osysharp/barcode): A live camera scanner for QR codes and barcodes. It owns the camera and the decode loop, and tells your app what it read. (`use Osysharp.Barcode@1;`)

## Optional

- [The whole reference and specification as one Markdown file](https://osysharp.com/llms-full.txt)
- [Sitemap](https://osysharp.com/sitemap.xml)
