Skip to content

feat(provider): serve fabric_capabilities from the fabric provider - #12844

Merged
cv merged 7 commits into
v1from
feat/fabric-capabilities
Oct 8, 2026
Merged

cv merged 7 commits into
v1from
feat/fabric-capabilities

Conversation

@kaofelix

@kaofelix kaofelix commented Oct 8, 2026

Copy link
Copy Markdown
Collaborator

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.

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.
schema_accepts, the offline JSON Schema check that the authoring
journey uses, lived in fabric_capabilities beside Fabric planning,
which does not use it. It moves to json_schema with its tests, so the
Fabric types can leave the SDK without taking it along.

A planner test named for schema_accepts never called it; its name now
says what it checks.
The Fabric catalog an image advertises, the capability assessment and
configuration planning against a sandbox's requirements, the
observation that reports them, and image-metadata bundle verification
lived in nemoclaw-sdk beside the YAML document and compiler. The fabric
provider needs them to serve fabric_capabilities without the SDK.

nemoclaw-fabric holds them and depends on nemoclaw-backend,
nemoclaw-openshell (for 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.

Part of #12788.
nemoclaw_fabric_capabilities and nemoclaw_engine_capabilities shared
one data source with a fabric flag, and the engine read of an image's
Fabric label lived in nemoclaw-discovery.

The label read moves into nemoclaw-fabric behind its client feature,
which the SDK leaves off. 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. Generated discovery graphs and SDK graphs use
the new type, and the SDK refuses state that holds
nemoclaw_fabric_capabilities before reading it.

Part of #12788.
@kaofelix kaofelix added area: architecture Architecture, design debt, major refactors, or maintainability v1 NemoClaw v1 branch labels Oct 8, 2026
Base automatically changed from feat/fabric-provider to v1 October 8, 2026 17:53
Resolved by replaying this branch's commits after #12842 onto v1, which
already contains #12842 squashed.
@cv
cv enabled auto-merge (squash) October 8, 2026 18:08
@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

@cv
cv merged commit 7d97db0 into v1 Oct 8, 2026
14 checks passed
@cv
cv deleted the feat/fabric-capabilities branch October 8, 2026 18:59
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.
cv pushed a commit that referenced this pull request Oct 9, 2026
…nt (#12858)

Follow-up to #12844.

## Failure

#12844 moved `FabricPlanningError`, the SDK's only `thiserror` use, into
`nemoclaw-fabric`, so `nemoclaw-sdk` still declared `thiserror` without
using it. The same PR added `nemoclaw_fabric_capabilities` to the
refused earlier types, an image read, but the list's comment still
described them as OpenShell objects and Fabric agents.

## Decision

- Remove `thiserror` from `nemoclaw-sdk`'s dependencies.
- Describe `EARLIER_TYPES` as the OpenShell and Fabric types the
`nemoclaw` provider served before the `openshell` and `fabric`
providers.

No behavior changes.

## Validation

- `cargo ci fmt`, `clippy`, `build`, and `test` pass on linux_amd64.
- `cargo tree -p nemoclaw-sdk` no longer lists `thiserror` as a direct
dependency.
@wscurran wscurran added 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: 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