Skip to content

feat(provider): serve Fabric agents from the fabric provider - #12842

Merged
cv merged 3 commits into
v1from
feat/fabric-provider
Oct 8, 2026
Merged

cv merged 3 commits into
v1from
feat/fabric-provider

Conversation

@kaofelix

@kaofelix kaofelix commented Oct 8, 2026

Copy link
Copy Markdown
Collaborator

Part of #12788 (step 1a of 3; 1b moves fabric_capabilities, 2 types its inputs).

Failure

Fabric agent configuration and sandbox readiness were the last nemoclaw types that reach the OpenShell gateway. The nemoclaw provider therefore kept the gateway connection settings, a deferred connection state for settings unknown at plan time, and platform_only, which Kubernetes platform graphs needed because they run before gateway credentials exist.

Decision

New provider. terraform-provider-fabric (registry.opentofu.org/nvidia/fabric, same source-derived version as nemoclaw) serves:

Type Before
fabric_agent_configuration nemoclaw_agent_configuration
fabric_sandbox_readiness data source nemoclaw_sandbox_readiness

The name follows #12788's decision: the provider carries Fabric's configuration and its host, which Fabric is expected to own (#12444).

New crate fabric-provider. The Fabric bridge, agent configuration, and sandbox readiness move from nemoclaw-provider with git mv, changed only in imports. It depends on nemoclaw-backend, nemoclaw-tofu, openshell-provider (to reach each sandbox's Fabric host through the OpenShell client), and nemo-fabric-core; not on nemoclaw-sdk or kube.

Shared gateway settings. The openshell provider's configuration becomes GatewayConfig and GatewayClient::configure in openshell-provider, so openshell and fabric validate the same settings with the same code. Its tests move with it.

nemoclaw provider. Its only setting is destroy; every resource already names its engine or cluster. The gateway settings, deferred connection state, and platform_only are removed, along with their tests.

SDK.

  • Generated graphs require all three providers and configure the gateway connection on openshell and fabric.
  • Kubernetes platform graphs omit both gateway providers instead of setting platform_only.
  • Teardown sets destroy on all three.
  • resource_type maps agent_configuration to fabric_agent_configuration, and lifecycle classification accepts the fabric_ prefix.
  • The SDK refuses state that holds nemoclaw_agent_configuration or nemoclaw_sandbox_readiness before reading it, like the earlier OpenShell types.

Bundle. It builds and ships the third binary, and the SDK checks that it is present. End-to-end workspaces install it from beside the nemoclaw binary.

Documentation. docs/provider.md adds a Fabric section and describes the nemoclaw provider's single setting. The scope, architecture, apply-flow, build, and integration-test guides name the Fabric provider.

nemoclaw_fabric_capabilities stays until its image-reading types leave the SDK (step 1b).

Validation

  • state_with_openshell_types_from_the_nemoclaw_provider_is_rejected_before_any_read now covers the two old Fabric types; it failed first because the SDK ran OpenTofu on that state.
  • New fabric-provider schema test: the provider serves exactly agent_configuration and sandbox_readiness, with the openshell provider's gateway settings.
  • nemoclaw-provider tests assert destroy is its only setting, that only an explicit true grants teardown, and that it serves no OpenShell or Fabric types.
  • SDK graph tests assert which providers each stage configures.
  • The first full run failed 7 lifecycle tests whose hand-written HCL still set endpoint on nemoclaw; a follow-up commit fixes them.
  • cargo ci: all selected steps passed on linux_arm64, including 108 lifecycle tests.
  • cargo tree -p fabric-provider contains no nemoclaw-sdk or kube.

Fabric agent configuration and sandbox readiness were the last nemoclaw
types that reach the gateway. The nemoclaw provider therefore kept the
gateway connection, a deferred connection state, and platform_only,
which Kubernetes platform graphs needed before gateway credentials
existed.

terraform-provider-fabric serves fabric_agent_configuration and the
fabric_sandbox_readiness data source. It takes the openshell provider's
gateway settings, now GatewayConfig and GatewayClient::configure in
openshell-provider, and reaches each sandbox's Fabric host through the
OpenShell client. The Fabric bridge and agent configuration code moves
from nemoclaw-provider unchanged apart from imports.

The nemoclaw provider's only setting is destroy. Generated graphs
configure the gateway connection on the openshell and fabric
providers, Kubernetes platform graphs omit both, and teardown sets
destroy on all three. The bundle ships the third binary. The SDK
refuses state that holds nemoclaw_agent_configuration or
nemoclaw_sandbox_readiness before reading it.

Fabric capabilities stays in nemoclaw until its image-reading types
leave the SDK.

Part of #12788.
The nemoclaw provider no longer takes a gateway connection.
@kaofelix kaofelix added area: architecture Architecture, design debt, major refactors, or maintainability v1 NemoClaw v1 branch labels Oct 8, 2026
@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

The openshell and fabric providers kept an earlier destroy grant when a
later configuration was rejected, because the shared gateway check
returned before the flag was stored. Both now clear it first.

Also drop nemoclaw-provider's unused nemo-fabric-core dependency, name
Fabric types in the earlier-state refusal, and describe the shared
destroy setting without naming sandboxes.
@cv
cv merged commit 277e0c5 into v1 Oct 8, 2026
14 checks passed
@cv
cv deleted the feat/fabric-provider branch October 8, 2026 17:53
cv added a commit that referenced this pull request Oct 8, 2026
Resolved by replaying this branch's commits after #12842 onto v1, which
already contains #12842 squashed.
cv added a commit that referenced this pull request Oct 8, 2026
…#12831)

Part of #12785. Carries #12832 and #12834, which merged into this branch
while the PRs were stacked.

## Failure

Gateway resources and the service observation data sources took
SDK-compiled `spec` strings. To declare a gateway, check a runtime
image, wait for a service, or measure capacity in HCL, an author had to
reproduce the SDK's internal JSON, including layout numbers that encode
storage contract versions. Generated Docker gateway containers also
carried an entrypoint, command and environment that only the SDK
compiler could write.

## Decision

- **`nemoclaw_managed_gateway` and `nemoclaw_gateway_storage`** take
`name`, `compute_driver`, `engine`, `image`, `network_cidr` and
`endpoint` as attributes. `owner` and `generation` are optional,
computed and generated on create. The provider derives the internal
layout. Docker gateway storage rejects `endpoint`, because its data does
not depend on the listen port. The backend still builds the same
internal specification, so container and volume labels are unchanged.
The SDK reads the attributes back from OpenTofu state for bound
gateways.
- **`nemoclaw_gateway_runtime`** computes a Docker gateway container's
`entrypoint`, `command` and `env` from `name`, `endpoint` and the
storage's `data_path`. It shares one launch definition with the SDK
compiler. Generated graphs take the launch from it.
- **`nemoclaw_runtime_image`** takes `engine`, a digest-pinned `image`,
`architecture` and optional `labels`.
- **`nemoclaw_service_readiness`** takes the container's `engine`,
`name` and `container_id`, and its `contract`: the `spec` of the vLLM,
Ollama or Ollama proxy runtime data source the container runs with.
- **`nemoclaw_service_capacity`** takes `contracts` instead of `specs`
and rejects a contract listed twice.
- The provider guide documents each input. `docs/limits.md` now lists
only the Kubernetes types as taking a compiled `spec`.

The merge from `v1` keeps #12842's removal of the `nemoclaw` provider's
gateway settings. The authored HCL in the end-to-end tests uses an empty
`provider "nemoclaw"` block.

## Validation

- **Gateway resources:** a provider schema test checks their typed
attributes. Attributes round-trip to the internal specification for both
drivers, and invalid values are rejected. State bindings record typed
settings, including the null endpoint of Docker gateway storage.
- **End-to-end through pinned OpenTofu:**
  - The prerequisite protocol test writes the gateway in HCL.
- A Docker gateway written in HCL plans its launch through
`nemoclaw_gateway_runtime`.
  - The readiness and capacity tests use the typed inputs.
- **After merging `v1`:**
- `nemoclaw-sdk`, `nemoclaw-provider` and `nemoclaw-build` pass 776
tests.
- The standalone OpenTofu tests (24), the production provider tests and
the capacity test pass.
  - Workspace clippy at `-D warnings` and fmt are clean.
cv added a commit that referenced this pull request Oct 8, 2026
…12844)

Part of #12788 (step 1b of 3). Stacked on #12842; it retargets to `v1`
when #12842 merges.

## Failure

`nemoclaw_fabric_capabilities` was the last Fabric type in the
`nemoclaw` provider. It shared one data source with
`nemoclaw_engine_capabilities`, switched by a `fabric` flag, and the
code it needed (the Fabric catalog an image advertises, capability
assessment, configuration planning, the observation it reports, and the
engine read of the image label) lived in `nemoclaw-sdk` and
`nemoclaw-discovery`. The `fabric` provider could not serve it without
depending on the SDK.

## Decision

Three commits, reviewable separately:

1. **`schema_accepts` gets its own module**
(`nemoclaw-sdk/src/json_schema.rs`) with its tests. It is the offline
JSON Schema check the authoring journey uses, and lived in
`fabric_capabilities.rs` by accident; Fabric planning never called it. A
planner test named for it, which never called it, is renamed for what it
checks.
2. **New crate `nemoclaw-fabric`: Fabric's image contract.** It takes
the catalog types, capability assessment and configuration planning,
`FabricObservation`, image-metadata bundle verification and its tests,
and `valid_for`. It depends on `nemoclaw-backend`, `nemoclaw-openshell`
(image runtime layouts), and `nemo-fabric-core`. Deriving requirements
from a sandbox's YAML stays in the SDK as `requirements_for_sandbox`,
replacing `FabricRequirements::for_sandbox`. The SDK re-exports the
moved modules at their previous paths, and `diagnostic_field` becomes
public because the SDK's discovery graph labels diagnostics with it.
3. **The data source moves.**
- `observe_fabric` and `judge_image` move into `nemoclaw-fabric` behind
a default `client` feature, like `nemoclaw-docker`; the SDK leaves it
off, so it still does not link the Docker client.
- `fabric_capabilities` becomes a `fabric` provider data source with
unchanged inputs and outputs. It reads the engine named on it and needs
no gateway.
- `nemoclaw_engine_capabilities` keeps only the engine read, without the
flag.
- Generated discovery and deployment graphs use the new type, and the
SDK refuses state that holds `nemoclaw_fabric_capabilities` before
reading it.
- `docs/provider.md` lists the data source under the Fabric provider;
the Fabric harness reference links the moved assessment code.

## Validation

-
`state_with_openshell_types_from_the_nemoclaw_provider_is_rejected_before_any_read`
now covers `nemoclaw_fabric_capabilities`; it failed first because the
SDK ran OpenTofu on that state.
- The Fabric data source tests move to `fabric-provider` with it;
`nemoclaw-provider` tests assert the engine schema has no Fabric inputs
and that it no longer serves `fabric_capabilities`; the
`fabric-provider` schema test asserts it serves `capabilities` with a
required `engine`.
- `cargo ci`: all selected steps passed on linux_arm64, including 108
lifecycle tests.
- `cargo tree -p fabric-provider` contains no `nemoclaw-sdk`; `cargo
tree -p nemoclaw-sdk -i bollard` finds nothing.

---------

Co-authored-by: Carlos Villela <[email protected]>
cv pushed a commit that referenced this pull request Oct 8, 2026
…ame (#12857)

Part of #12788 (step 2 of 3, the last). Stacked on #12844, which is
stacked on #12842; it retargets as those merge.

## Failure

- `fabric_agent_configuration` checked `config_json` against Fabric's
types only while planning, and reported any failure as `observation
query failed`, without saying what was wrong.
- `fabric_sandbox_readiness` took one `sandbox` map of strings.
Generated graphs filled it with every string attribute of the sandbox,
filtering out its typed inputs, and merged in the configuration's
`config_json`. OpenTofu could not check which keys the read needed; a
missing or misspelled key surfaced only when the read failed.

## Decision

Two commits:

1. **Invalid configurations name the rejected field.** `config_json` is
checked during validation with `serde_path_to_error`, and reported as
`Invalid config_json` on that attribute: `config_json is not a valid
Fabric configuration at harness.adapter_id`. The path passes through
`diagnostic_field`; the value and Fabric's own message, which can quote
it, never appear. To build that message, `ValidateAttribute` returns
`Cow<'static, str>` instead of `&'static str`; storage's checks return
the same fixed text.
2. **Readiness takes its inputs by name.** It requires the sandbox's
`workspace`, `name`, `id`, `owner`, `generation`, `agent_name`,
`agent_runtime`, and `runtime_json`, and the configuration's
`config_json`: the keys the read already used. The checks are unchanged;
validation now also requires `runtime_json` and `config_json`. Generated
graphs reference each attribute directly, and the filter for typed
sandbox inputs goes away.

Two items in #12788 were deliberately not done; the issue records why:

- **`config` as an HCL value.** Fabric's configuration schema is open,
so generated blocks would drop extension keys. A `dynamic` attribute
would fit, but the pinned `tf-provider` decodes state without the schema
and cannot tell a dynamic attribute's `[type, value]` pair from a
two-element list. `config_json` stays a JSON string.
- **Optional `owner` and `generation` on the configuration.** They are
the sandbox's identity, which the provider verifies before acting, not
the configuration's own. They stay required.

## Validation

- New unit tests, written first: a valid configuration passes; a wrong
type at `harness.adapter_id` and malformed JSON are reported without the
input. Readiness exposes the nine required inputs and no `sandbox` map,
hands the bridge exactly those nine, defers on unknown inputs, rejects
missing or empty ones, and does not echo rejected values.
- The standalone Pi lifecycle test now plans a rejected configuration
through OpenTofu: it fails with `Invalid config_json ... at
harness.adapter_id`, never shows the value, and makes no sandbox call.
- `cargo ci`: all selected steps passed on linux_arm64, including 108
lifecycle tests.
@wscurran wscurran added area: sandbox OpenShell sandbox lifecycle, runtime, config, or recovery feature PR adds or expands user-visible functionality security area: security Security controls, permissions, secrets, or hardening and removed security labels Oct 28, 2026
@cv cv added this to the Roadmap: GTC DC 2026 milestone Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: architecture Architecture, design debt, major refactors, or maintainability area: sandbox OpenShell sandbox lifecycle, runtime, config, or recovery area: security Security controls, permissions, secrets, or hardening feature PR adds or expands user-visible functionality v1 NemoClaw v1 branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants