Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 91 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# Celerity Docs

The Celerity documentation site at celerityframework.io: a Next.js and Fumadocs site, exported
statically and deployed to GitHub Pages. It documents the Celerity framework and its resource
types, the CLI, the runtimes and the SDKs, and publishes the handler manifest schema.

## Workspace

This repo is one of NewStack's. NewStack's maintainers develop it alongside the others in a
shared workspace, using the NewStack Claude Code plugin for how work is planned, reviewed,
committed and coordinated across repos. The plugin isn't public, and nothing here depends on it:
this file and the repo's own docs cover what a contribution needs.

## Layout

| Path | Holds |
|---|---|
| `content/docs/` | The docs, in MDX, one folder per section (`framework`, `cli`, the runtimes, `go-sdk`), ordered by `meta.json`. `index.mdx` is the `/docs` landing page linking each section |
| `public/schemas/handler-manifest.v1.schema.json` | A copy of the Node SDK's handler manifest schema, served at the URL its `$id` names |
| `src/` | The site: `app/` (pages, plus the `static.json` search export and `llms` routes), `components/`, `lib/`, `data/` (release data) |
| `grammars/blueprintlang.tmLanguage.json` | A copy of bluelink-vscode's grammar, for highlighting `blueprintlang` blocks |
| `scripts/` | Build steps: release data, link checks, search index sync |

## Checks

- **Tools:** Node 22 (the deploy workflow's) with Yarn 4 through corepack (`packageManager`).
`yarn install --immutable` first, which also runs `fumadocs-mdx`.
- **Release data:** `src/data/releases.json` is a committed stub, so `yarn dev` and
`next build` work without fetching. `yarn fetch-releases` overwrites it from the GitHub API;
restore it rather than commit the result, unless asked to refresh it.
- **Checks,** before a change reaches `main`: `yarn lint`, `yarn check-links`, then
`yarn next build`, which type-checks, lints, fails on MDX errors and fetches the Inter font
over the network. `yarn check-links` catches broken links to non-docs routes only: every
`/docs/...` link passes, so after moving or renaming a page, grep `content/` for the old
path.
- **Don't run `yarn build` as a check.** It runs `fetch-releases`, `check-links`, `next build`
and `post-build`, then `sync-content`, which replaces the production Algolia search index
using the secret key from the environment or `.env` (and fails without one, after the site
is built).
- **Gates:** no git hooks, no commitlint, and no build on pull requests. `deploy.yml` runs on
pushes to `main`. `schema-sync.yml` fails when the schema copy differs, byte for byte, from
the Node SDK's `main`: on pushes to `main` and pull requests that change `public/schemas/`,
and every Monday.

## Running locally

`yarn dev` serves the site on port 3000. Search queries the production Algolia index, so local
edits never appear in it; `.env.example` lists the keys with placeholder values (the real ones
are repository variables and a secret), and without `.env` search says it isn't configured. Page
dates and the sitemap come from git history, so a shallow clone gives wrong dates.

## Compatibility

- **Resource types and CLI:** the framework pages document the resource types
bluelink-transformer-celerity defines, plus planned ones ahead of it (`celerity/channel`,
`celerity/workflow`), marked with the versions they arrive in; the CLI pages document the
Celerity CLI. The docs are often written design-first, ahead of the code.
- **Handler manifest schema:** copied unchanged from celerity-node-sdk's
`packages/cli/schemas/`, never edited here; `schema-sync.yml` checks it. Its `$id` is
`https://celerityframework.io/schemas/handler-manifest.v1.schema.json`, so that path never
moves.
- **URLs:** pages are linked from the transformer's resource definitions (which reach the
registry and language server docs), its contract docs, and Celerity's and the SDKs' source,
READMEs and test fixtures. Nothing
can redirect (static export on GitHub Pages), so moving a page breaks its inbound links
unless a stub page stays at the old path.
- **Grammar:** `grammars/` is a copy of bluelink-vscode's `syntaxes/blueprintlang.tmLanguage.json`,
updated by hand when the grammar changes.
- **Persisted state:** none.

## Conventions

- Commits: mostly plain lowercase imperative subjects without a conventional-commit type
(`update workflow resource type docs ...`); nothing checks them, and there are no releases.
- Language support claims follow `content/docs/framework/versions.mdx`. Interpreted languages
(Node.js, Python) run in-process in their runtime image; C# has a runtime image providing .NET,
with its handler running as a separate process over the handler IPC protocol; natively
compiled languages (Go) run on an OS-only runtime over the same protocol.

## Safety

- **A push to `main` deploys.** `deploy.yml` builds the site, syncs the Algolia index and
publishes to GitHub Pages at celerityframework.io, and nothing builds a pull request first,
so run the checks above before a change reaches `main`.
- Don't run `yarn build` or `yarn sync-content` unless asked while Algolia credentials are
available, whether from `.env`, the shell environment or CI: they overwrite the production
search index. `.env` doesn't override variables already set in the shell.

## Known mistakes

<!-- One line per mistake an agent has made here, phrased as the rule that prevents it. -->
1 change: 1 addition & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@AGENTS.md
7 changes: 3 additions & 4 deletions content/docs/cli/reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ omitted, you are prompted to choose a template.

**Configuration Key**: `initLanguage`

**Allowed Values**: `nodejs` | `python` | `java` | `dotnet` | `go`
**Allowed Values**: `nodejs` | `python` | `dotnet` | `go`

The language or framework to use for a new Celerity project.

Expand Down Expand Up @@ -1558,17 +1558,16 @@ celerity schema codegen --lang go --out ./internal/generated/

**Type**: `string`

**Allowed Values**: `typescript` | `python` | `go` | `java` | `csharp`
**Allowed Values**: `typescript` | `python` | `go` | `csharp`

The target language for code generation. C# follows its language runtime in v1. Java follows a language runtime that is under consideration rather than committed. See [Celerity versions](/docs/framework/versions).
The target language for code generation. C# follows its language runtime in v1. See [Celerity versions](/docs/framework/versions).

| Language | Output | Status |
|---|---|---|
| `typescript` | Interfaces, column constants, table name constants | ✅ Available in v0 |
| `python` | Pydantic model classes | ✅ Available in v0 |
| `go` | Structs with `db` tags (SQL) or `json` tags (NoSQL), column/table or field/index constants, and scan or validation helpers | ✅ Available in v0 |
| `csharp` | Record types | 🚀 Planned for v1 |
| `java` | Record classes | 💬 Under consideration |

#### `--out`

Expand Down
2 changes: 1 addition & 1 deletion content/docs/csharp-runtime/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ title: Celerity C#/.NET Runtime & SDK
description: The C#/.NET runtime and SDK for Celerity applications
---

🚀 **Planned for v1** - The C#/.NET runtime and SDK are planned for the v1 release (target: February 2028), alongside the Azure deployment targets. Documentation will be available in a future v0 evolution.
🚀 **Planned for v1** - The C#/.NET runtime and SDK are planned for the v1 release (target: February 2028), alongside the Azure deployment targets. The C# runtime image provides the .NET runtime, and the core runtime runs your C# handlers as a separate process over the [Celerity IPC protocol](/docs/framework/runtime/handler-ipc-protocol). Documentation will be published as the v1 release approaches.

See the [Celerity versions](/docs/framework/versions) page for the full roadmap.
Original file line number Diff line number Diff line change
Expand Up @@ -982,10 +982,6 @@ This is a real gap rather than a Go quirk: `nullable` fields that are also requi

🚀 **Planned for v1** - C# type generation (record types) arrives with the C# runtime in v1.

### Java

💬 **Under consideration** - Type generation follows the language runtime, and Java is considered rather than committed. It would generate record classes. See [Celerity versions](/docs/framework/versions).

### Defaults

Schema `default` values are applied at construction time by generated code and are never silently injected by the SDK on write.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2070,7 +2070,7 @@ The Celerity runtime identifier is resolved to a concrete runtime in each enviro
The Celerity deploy engine chooses the closest available runtime on each target platform. If a target doesn't support the exact version, it falls back to the nearest supported version and surfaces a warning during `celerity deploy`.

<Callout title="Google Cloud Functions and OS-only runtimes" type="warning">
Google Cloud Functions does not offer a custom-runtime mechanism, so OS-only runtimes, where a pre-compiled handler binary is uploaded and executed directly, can not be deployed there. Languages that compile ahead of time are supported (Go to a native binary, Java and .NET to bytecode on a virtual machine), but the platform builds your handler from source rather than running a binary you provide.
Google Cloud Functions does not offer a custom-runtime mechanism, so OS-only runtimes, where a pre-compiled handler binary is uploaded and executed directly, can not be deployed there. Languages that compile ahead of time are supported (Go to a native binary, .NET to bytecode on a virtual machine), but the platform builds your handler from source rather than running a binary you provide.
</Callout>

<Callout title="Azure Functions and OS-only runtimes" type="info">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1017,10 +1017,6 @@ Integer widths are faithful to the column rather than collapsed: `smallint` is `

🚀 **Planned for v1** - C# type generation (record types) arrives with the C# runtime in v1.

### Java

💬 **Under consideration** - Type generation follows the language runtime, and Java is considered rather than committed. It would generate record classes. See [Celerity versions](/docs/framework/versions).

## Schema Contracts

Schema contracts allow data teams to declare which tables they depend on, so they are automatically informed when schema changes affect them. Instead of manually tracking column-level dependencies, contracts operate at the table level: any structural change to a watched table triggers the contract's policy.
Expand Down
2 changes: 1 addition & 1 deletion content/docs/framework/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ You will be prompted to select a programming language for your application, befo
- Node.js (TypeScript)
- Go

See the [runtime](docs/framework/runtime#supported-languages) documentation for more information and to see how you can implement Celerity applications in other languages.
See the [runtime](/docs/framework/runtime#supported-languages) documentation for more information and to see how you can implement Celerity applications in other languages.

## Start your API locally

Expand Down
4 changes: 2 additions & 2 deletions content/docs/framework/runtime/handler-ipc-protocol.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ description: The protocol between the Celerity core runtime and a handlers execu
**Protocol Version:** `1.0`
**Ecosystem Compatibility:** v0 (Current)

Protocol `1.0` was introduced in v0, along with the Go SDK, which is the tailored SDK built on it. What a protocol version change would mean for an existing handler binary is covered under [IPC Protocol Compatibility](/docs/framework/runtime/lifecycle#ipc-protocol-compatibility). Read more about Celerity versions [here](/docs/framework/versions).
Protocol `1.0` was introduced in v0, along with the Go SDK, which is the tailored SDK built on it. The C# SDK, planned for v1, builds on it too. What a protocol version change would mean for an existing handler binary is covered under [IPC Protocol Compatibility](/docs/framework/runtime/lifecycle#ipc-protocol-compatibility). Read more about Celerity versions [here](/docs/framework/versions).

For an interpreted language, Celerity publishes a runtime image containing that language's interpreter, and handlers run in the runtime's own process. For a compiled language there is no such image. The SDK produces a handler executable, the core runtime starts it as a separate process on an [OS-only runtime](/docs/framework/runtime/lifecycle#os-only-runtimes), and the two communicate over this protocol.
For an interpreted language, Celerity publishes a runtime image containing that language's interpreter, and handlers run in the runtime's own process. Other languages run as a separate process that the core runtime starts and communicates with over this protocol. C# has its own runtime image, which provides the .NET runtime its handler process needs. A language that compiles to a native executable, such as Go, has no image of its own: the SDK produces a handler executable that runs on an [OS-only runtime](/docs/framework/runtime/lifecycle#os-only-runtimes).

This document is for anyone implementing the handler side of that contract, which in practice means an SDK author adding a language. Application authors using an existing SDK do not need it.

Expand Down
9 changes: 6 additions & 3 deletions content/docs/framework/runtime/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,13 @@ The Celerity runtime provides tailored SDK support for the following languages.
| Python | ✅ Available in v0 |
| Go | ✅ Available in v0 |
| C# | 🚀 Planned for v1 |
| Java | 💬 Under consideration |

<Callout title="Compiled languages do not have their own runtime" type="info">
Tailored SDK support is not the same as a language-specific runtime. For an interpreted language such as Node.js or Python, Celerity publishes a runtime image containing that language's interpreter. For a compiled language such as Go, there is no Go runtime image — the SDK produces a handler executable, and that executable runs on an [OS-only runtime](/docs/framework/runtime/lifecycle#os-only-runtimes), which is a bare OS image containing only the Celerity core runtime. The core runtime starts your executable as a separate process and communicates with it over the Celerity IPC protocol. One OS-only runtime serves every compiled language, so compiled languages do not appear in the [future runtime roadmap](/docs/framework/runtime/lifecycle#future-runtime-roadmap).
<Callout title="Language runtimes and the IPC protocol" type="info">
Tailored SDK support is not the same as a language-specific runtime, and languages reach the core runtime in one of three ways:

- **Interpreted languages** such as Node.js and Python get a runtime image containing that language's interpreter, and handlers run in the runtime's own process.
- **C#** gets a runtime image containing the .NET runtime, which C# code needs to run. The core runtime starts the C# handler as a separate process and communicates with it over the [Celerity IPC protocol](/docs/framework/runtime/handler-ipc-protocol).
- **Languages that compile to a native executable**, such as Go, have no runtime image of their own. The SDK produces a handler executable that runs on an [OS-only runtime](/docs/framework/runtime/lifecycle#os-only-runtimes), a bare OS image containing only the Celerity core runtime, which starts the executable as a separate process and communicates with it over the same IPC protocol. One OS-only runtime serves every such language, so they do not appear in the [future runtime roadmap](/docs/framework/runtime/lifecycle#future-runtime-roadmap).
</Callout>

<Callout title="Ahead-of-time compiled languages" type="info">
Expand Down
Loading
Loading