Skip to content

feat!: ship distributed 1.0 application, contracts, and render path - #186

Closed
patrickleet wants to merge 1 commit into
mainfrom
feat/distributed-1-0-compiler
Closed

feat!: ship distributed 1.0 application, contracts, and render path#186
patrickleet wants to merge 1 commit into
mainfrom
feat/distributed-1-0-compiler

Conversation

@patrickleet

@patrickleet patrickleet commented Aug 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

Breaking 1.0 slice of [[tasks/contract-lifecycle-tooling-1]]: compile a typed application to a deterministic ApplicationManifest + DeploymentPlan, replace product dctl with distributed, and render one unchanged pair to kubernetes / knative / hops-xr.

  • Workspace crate version is 1.0.0.
  • CLI [[bin]] name is distributed. distributed contracts check stays read-only / fail-closed.
  • distributed deployment validate|render consumes one manifest+plan pair.
  • e2e-ui GraphQL/client compile uses contract-only modules (from_contract) and does not construct a repository/Service.
  • Walkthrough/docs invoke distributed.

Test output

cargo test --test application_composition --all-features
11 passed

cargo test --test application_plans --all-features
7 passed  (includes atomic_separation_fails_and_eventual_split_succeeds)

cargo run -p distributed_cli --bin distributed -- contracts check --catalog distributed.contracts.json
contracts check: ok
# second run is a no-op

cargo check --manifest-path tests/fixtures/application-contract-only/Cargo.toml --no-default-features
ok

cargo test -p distributed_cli --test cli_deployment
1 passed

rg -n --glob '!target/**' -w dctl
(empty of product invocations)

Linked

Implements [[tasks/contract-lifecycle-tooling-1]] apply work (compiler / CLI / contract-only compile / render).

Follow-up PR: host realize + parseable inventories + CommandDispatcher GraphQL path.

Non-goals

Live cluster apply (task 18), remote Hops repo (task 19), distributed dev / hot code push.

Summary by CodeRabbit

  • New Features
    • Added deployment validation and rendering commands.
    • Render deployment configurations for Kubernetes, Knative, and Hops XR.
    • Generate target-specific output files in a selected directory.
    • Added deployment resolution and rendering capabilities for applications and plans.
  • Bug Fixes
    • Improved manifest and protocol compatibility checks by using consistent version and fingerprint information.
  • Tests
    • Added coverage for deployment validation, rendering across supported targets, and protocol consistency.
  • Documentation
    • Updated command and tooling references to use the current distributed naming.

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.
@coderabbitai

coderabbitai Bot commented Aug 15, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: d67b5e44-0205-40fc-aa3a-a03979421e34

📥 Commits

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

📒 Files selected for processing (24)
  • 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/mod.rs
  • src/application/render.rs
  • src/application/resolve.rs
  • src/graphql/client_manifest/codec.rs
  • src/graphql/client_manifest/mod.rs
  • src/graphql/mod.rs
  • src/graphql/sdl.rs
  • src/graphql/surface/application.rs
  • src/graphql/surface/mod.rs
  • 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/ui/src/lib/walkthrough/demos.ts
  • tests/e2e-ui/ui/vite.config.ts

📝 Walkthrough

Walkthrough

The change adds deployment resolution and rendering for three targets, exposes deployment CLI commands, derives protocol identity from library constants, and introduces portable GraphQL module contracts for the e2e UI service.

Changes

Deployment pipeline

Layer / File(s) Summary
Protocol identity and package wiring
Cargo.toml, distributed_cli/..., src/graphql/...
Manifest versions and protocol fingerprints now use distributed GraphQL sources. The CLI and library expose matching protocol identity helpers.
Resolved deployment graph
src/application/..., src/lib.rs
Manifest and plan inputs resolve into a validated, renderer-neutral deployment graph with identity checks and an inventory digest.
Portable deployment renderers
src/application/render.rs
The resolved graph renders Kubernetes, Knative, and Hops XR output. Tests compare normalized inventories and reject stale plans.
Deployment CLI workflow
distributed_cli/src/cli.rs, distributed_cli/src/lib.rs, distributed_cli/tests/cli_deployment.rs
The CLI validates manifest and plan JSON, renders selected targets, writes output files, and tests all supported targets.

Portable UI module contracts

Layer / File(s) Summary
Typed application module contracts
tests/e2e-ui/crates/service/src/modules/contracts.rs, tests/e2e-ui/crates/service/src/modules/mod.rs
Todo, Chat, and Blob commands now expose typed contracts with fields, roles, defaults, user mapping, and execution semantics.
Contract-based GraphQL surface
tests/e2e-ui/crates/service/src/modules/graphql.rs
GraphQL surface construction now uses the module inventory and contract exports. Runtime and contract-only manifests are compared.
UI reference updates
tests/e2e-ui/ui/src/lib/walkthrough/demos.ts, tests/e2e-ui/ui/vite.config.ts
Walkthrough labels and tooling documentation now use updated module paths and command names.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant DistributedCLI
  participant resolve_deployment
  participant render_resolved
  participant OutputDirectory
  DistributedCLI->>resolve_deployment: Load and validate manifest and plan JSON
  resolve_deployment-->>DistributedCLI: Return ResolvedDeployment
  DistributedCLI->>render_resolved: Select target and render resolved deployment
  render_resolved-->>DistributedCLI: Return RenderedFile values
  DistributedCLI->>OutputDirectory: Create directories and write rendered files
Loading

Possibly related PRs

  • hops-ops/distributed#53: Introduces manifest infrastructure consumed by this PR for protocol versioning and serialization.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/distributed-1-0-compiler

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

Copy link
Copy Markdown
Collaborator Author

Folded into #187 — one PR, not a stack.

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