Skip to content

feat(provider): take Fabric requirements as a configuration and policy reads - #12910

Merged
cv merged 3 commits into
v1from
feat/fabric-capabilities-inputs
Oct 9, 2026
Merged

cv merged 3 commits into
v1from
feat/fabric-capabilities-inputs

Conversation

@kaofelix

@kaofelix kaofelix commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator

Part of #12782.

Failure

fabric_capabilities took its requirements as requirements_json: a JSON object wrapping the Fabric configuration and the sandbox policy's filesystem read grants.
Authors had to assemble that wrapper by hand, a shape no other type uses.
The grants are a plain list of paths, but inside the wrapper OpenTofu could not check them; a malformed list surfaced only as a generic decoding failure.

Decision

The data source takes two inputs instead:

  • config_json: the Fabric configuration, the same document fabric_agent_configuration takes, so a configuration can pass the same value to both.
  • filesystem_read: the policy's read grants as a list of strings.
data "fabric_capabilities" "agent" {
  engine          = var.engine
  image           = var.image
  config_json     = fabric_agent_configuration.assistant.config_json
  filesystem_read = ["/srv", "/opt/app"]
}

The configuration stays a string for the reason recorded on #12788: Fabric's configuration accepts open extension keys, and the pinned tf-provider cannot decode a value whose type is chosen by the author.

The data source builds the same internal FabricRequirements from the two inputs, so compatibility checks are unchanged.
A configuration without harness.adapter_id is still rejected, and omitting config_json still limits discovery to image metadata.
Generated graphs pass the same values under the new names.

Validation

  • A new lifecycle test plans authored HCL through pinned OpenTofu: valid inputs plan, a configuration without an adapter is rejected, and a string filesystem_read is rejected by OpenTofu at that attribute.
  • A provider test checks the schema and how the inputs become requirements; it failed before the change.
  • The pinned discovery graphs of three examples were updated by splitting each requirements_json into its two parts.
  • cargo ci passed on the branch after merging v1, including 113 lifecycle tests.

…y reads

fabric_capabilities took requirements_json, a JSON object wrapping the
Fabric configuration and the sandbox policy's filesystem read grants.
Authors had to assemble that wrapper by hand, and the grants, a plain
list of paths, could not be checked by OpenTofu.

The data source now takes config_json, the same document
fabric_agent_configuration takes, and filesystem_read, a list of
strings. A configuration without harness.adapter_id is still rejected,
and omitting config_json still limits discovery to the image metadata.
Generated graphs pass the same values under the new names.
@kaofelix kaofelix added area: architecture Architecture, design debt, major refactors, or maintainability v1 NemoClaw v1 branch labels Oct 9, 2026
@cv
cv enabled auto-merge (squash) October 9, 2026 12:18
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

@cv
cv merged commit 32386b5 into v1 Oct 9, 2026
25 checks passed
@cv
cv deleted the feat/fabric-capabilities-inputs branch October 9, 2026 12:51
@kaofelix kaofelix changed the title feat(provider): take Fabric requirements as a configuration and policy reads feat(provider): take Fabric requirements as inputs and document the finished split Oct 9, 2026
@kaofelix kaofelix changed the title feat(provider): take Fabric requirements as inputs and document the finished split feat(provider): take Fabric requirements as a configuration and policy reads Oct 9, 2026
kaofelix added a commit that referenced this pull request Oct 9, 2026
Part of #12782.

## Failure

A re-read of [the provider guide](docs/provider.md) and
[scope](docs/design/scope.md) against `v1`'s code and the bundled
providers' schemas found one error and two stale statements:

- The Fabric provider section said `destroy` permits removing agent
configurations. Removal never needs it: it releases the binding without
changing the sandbox.
- The guide named one standalone fixture as the only authored-HCL
coverage; every provider type now has an authored-HCL lifecycle test.
- The direct-use section still waited for verified implementations,
although every type now takes HCL inputs.

Scope also did not state the requirement the provider split established.

## Decision

Correct the three statements, keeping publication and the direct-use
workflow pointed at #12638 and #12645.

Add to scope's responsibilities: provider types take their backends'
inputs in HCL, not documents compiled by the SDK, except Fabric
configurations and runtime bindings, whose open schemas have no fixed
OpenTofu type.

These changes were meant for #12910, which merged before they were
pushed.

## Validation

- Each corrected statement was checked against the code on `v1` and the
schemas of the bundled `nemoclaw`, `openshell`, and `fabric` providers,
dumped through pinned OpenTofu.
- The documentation check (`cargo run -p nemoclaw-build -- fern check`)
reports no errors.
- `cargo ci` passed on the same documentation content before rebasing it
onto `v1`, including 113 lifecycle tests.
cv added a commit that referenced this pull request Oct 9, 2026
…#12913)

Stacked on #12908. Closes #12880 together with it.

## Failure

Fabric types were exercised through OpenTofu only by SDK-generated
system scenarios, and by one Pi test in `nemoclaw-e2e` that needed both
the `openshell` and `fabric` providers. Nothing checked each Fabric type
on its own, and `fabric_capabilities` had no OpenTofu test at all.

## Decision

`fabric-provider` gets a `contract` test binary that uses the shared
fake gateway from #12908.

- **`fabric_agent_configuration`:** the Pi test moves here unchanged and
applies a static fixture. It checks four things:
- An invalid configuration fails at its field without repeating the
value.
  - Updates keep the sandbox.
  - A stopped host is reconfigured.
  - A lost reply is not retried.
- **`fabric_sandbox_readiness`:** the configured agent reads ready.
Failed health reads not ready, without failing apply or writing to the
sandbox, and recovered health reads ready again.
- **`fabric_capabilities`:** this uses the `config_json` and
`filesystem_read` inputs from #12910. A fake Docker engine serves an
image that declares a Fabric catalog.
  - A compatible image reports its runtime binaries.
- Another platform is unsupported, and so is a read policy without the
runtime's paths.
  - A missing image is unknown.
  - The engine is only read.
- **Coverage:** a test requires a contract test for every Fabric type.
- **`nemoclaw-e2e`:** no longer tests a single provider type. The unused
`openshell_resources.tf` template is removed.
- **CI:** the lifecycle profile selects the Fabric contract binary.
- **Docs:** `docs/contributing/integration-tests.md` describes the
Fabric contract tests.

## Validation

- **Lifecycle profile:** locally, both contract binaries pass through
the lifecycle profile: 50 tests in 41 s wall.
- **Lint:** workspace clippy at `-D warnings` and fmt are clean.
- **Docs tests:** the `nemoclaw-build` docs tests pass.
@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