Skip to content

Describe the app once, then run it locally or render cluster YAML - #187

Closed
patrickleet wants to merge 5 commits into
mainfrom
feat/distributed-1-0-realize-host
Closed

patrickleet wants to merge 5 commits into
mainfrom
feat/distributed-1-0-realize-host

Conversation

@patrickleet

@patrickleet patrickleet commented Aug 15, 2026

Copy link
Copy Markdown
Collaborator

What you write

You list the app’s pieces in Rust (modules, commands, models, projections). Then you say how to cut them into processes.

let module = Module::new("todo")
    .command_definitions([/* todo.create, … */])
    .models([/* TodoView */])
    .projections([/* project_todos listens to todo.created */])
    .build()?;

let manifest = Application::new("todo-app")
    .module(module)
    .build()?
    .manifest()
    .clone();

// one process that does everything
let local = compile_deployment_plan(
    "local",
    &manifest,
    [ProcessIntent::with_preset("full", &manifest, ProcessPreset::Full)?],
)?;

// or split write vs project
let split = compile_deployment_plan(
    "split",
    &manifest,
    [
        ProcessIntent::with_preset("writer", &manifest, ProcessPreset::Writer)?,
        ProcessIntent::with_preset("projector", &manifest, ProcessPreset::Projector)?,
    ],
)?;

That’s the whole description. You do not write “if postgres, connect, migrate, spawn outbox, attach GraphQL to Service…”.

What you run

Start it (same as the demo app now):

# app binary still just calls the framework
DATABASE_URL=sqlite:./app.db BIND=127.0.0.1:8791 cargo run

Under the hood that is:

let (manifest, plan) = e2e_local_plan();
let realized = RuntimeHost::realize_local(&plan, "full", options, MyApp).await?;
// realize_local: connect DB, workers, dispatcher
// then serve GraphQL

Turn the same plan into deploy files:

distributed deployment validate --manifest manifest.json --plan plan.json
distributed deployment render --manifest manifest.json --plan plan.json --target kubernetes --out out/k8s
distributed deployment render --manifest manifest.json --plan plan.json --target knative --out out/knative
distributed deployment render --manifest manifest.json --plan plan.json --target hops-xr --out out/hops

Hops YAML is real structured mounts, not debug text:

kind: DistributedApplication
spec:
  processes:
    - name: 'writer'
      mounts:
        - kind: command
          id: 'todo.create'
    - name: 'projector'
      mounts:
        - kind: projector
          id: 'project_todos'

Check contracts:

distributed contracts check --catalog distributed.contracts.json

Before → after

Before After
Author writes Domain plus a custom host: SQLite vs Postgres branches, migrations, Service, outbox/consumer loops, GraphQL wired to Service Domain + a short Application / DeploymentPlan. Framework starts the process
Local run Copy-paste host.rs per app RuntimeHost::realize_local(plan, …)
Cluster YAML Missing, or Hops output like Projector { id: "project_todos" } Same plan → k8s / knative / hops-xr. Tests parse the files
Illegal topology Easy to ship an Atomic command without its projection Plan compile fails before anything starts
CLI dctl still showed up Only distributed

Why that’s better

  • Next app doesn’t reimplement the runtime.
  • Local process and cluster YAML can’t silently disagree.
  • Bad splits fail at compile/plan time, not in production.

Not in this PR

distributed dev (watch Cargo + Vite), live cluster apply, a new Hops package repo.

Workspace version on this branch is 0.0.0-dev. Publish tags (v4, …) still own the released crate version.

Remove the copied CLI protocol fingerprint, add deployment
validate/render for kubernetes/knative/hops-xr from one
manifest+plan pair, and compile e2e-ui clients without
constructing a Service.

Implements remaining [[tasks/contract-lifecycle-tooling-1]] apply work.
Route GraphQL mutations through CommandDispatcher, emit parseable
Hops XR YAML, compare inventories from shipped files, and start
e2e-ui via RuntimeHost::realize_local.

Implements [[tasks/contract-lifecycle-tooling-1]]
@coderabbitai

coderabbitai Bot commented Aug 15, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@patrickleet, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 35 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: d0ebfbfa-e20c-415c-a90d-6e41272f000d

📥 Commits

Reviewing files that changed from the base of the PR and between b97f96a and 364b04f.

📒 Files selected for processing (36)
  • Cargo.toml
  • distributed_cli/Cargo.toml
  • distributed_cli/src/cli.rs
  • distributed_cli/src/client_compiler/manifest/mod.rs
  • distributed_cli/src/client_compiler/manifest/parse.rs
  • distributed_cli/src/client_compiler/mod.rs
  • distributed_cli/src/contracts/tests.rs
  • distributed_cli/src/lib.rs
  • distributed_cli/tests/cli_deployment.rs
  • src/application/local_sql.rs
  • src/application/mod.rs
  • src/application/mount.rs
  • src/application/plan.rs
  • src/application/render.rs
  • src/application/resolve.rs
  • src/application/runtime_host.rs
  • src/command_dispatch/local.rs
  • src/graphql/client_manifest/codec.rs
  • src/graphql/client_manifest/mod.rs
  • src/graphql/http.rs
  • src/graphql/mod.rs
  • src/graphql/schema.rs
  • src/graphql/sdl.rs
  • src/graphql/surface/application.rs
  • src/graphql/surface/mod.rs
  • src/lib.rs
  • tests/application_plans.rs
  • tests/e2e-ui/crates/service/src/application.rs
  • tests/e2e-ui/crates/service/src/host.rs
  • tests/e2e-ui/crates/service/src/lib.rs
  • tests/e2e-ui/crates/service/src/modules/contracts.rs
  • tests/e2e-ui/crates/service/src/modules/graphql.rs
  • tests/e2e-ui/crates/service/src/modules/mod.rs
  • tests/e2e-ui/crates/service/src/oidc_layer.rs
  • tests/e2e-ui/ui/src/lib/walkthrough/demos.ts
  • tests/e2e-ui/ui/vite.config.ts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@patrickleet
patrickleet changed the base branch from feat/distributed-1-0-compiler to main August 15, 2026 02:02
Publish tags own the crate major. Do not rewrite Cargo.toml to 1.0.0.
@patrickleet patrickleet changed the title feat: realize local SQL host and parse render inventories feat!: application compile, realize_local host, and deployment render Aug 15, 2026
Publish tags own the released major. Mainline Cargo.toml is a
pre-release placeholder so it cannot be mistaken for v4.
@patrickleet patrickleet changed the title feat!: application compile, realize_local host, and deployment render Stop making every app hand-wire the host, and make deploys come from one plan Aug 15, 2026
@patrickleet patrickleet changed the title Stop making every app hand-wire the host, and make deploys come from one plan Describe the app once, then run it locally or render cluster YAML Aug 15, 2026
Replace Writer/Full with Commands/All. Keep QueryApi and Projector.
@patrickleet

Copy link
Copy Markdown
Collaborator Author

Closing. We should not generate Kubernetes/Knative manifests from this layer, and the hops-xr target was a fake XR (no XRD, no reconcile).

The goal is to make the existing Service startup simpler, not add a second host/plan/render model.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant