Skip to content

refactor(openshell-provider): serve the gateway installation types - #13187

Merged
cv merged 3 commits into
v1from
feat/openshell-gateway-types
Oct 14, 2026
Merged

cv merged 3 commits into
v1from
feat/openshell-gateway-types

Conversation

@cv

@cv cv commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator

Part of #13146. Part of #13131.

Based on v1; it depends only on #13142, which has merged.

Failure

The nemoclaw provider served the types that install an OpenShell gateway: the Podman gateway, gateway storage, Kubernetes storage, authentication, and gateway types, and the Docker gateway readiness and launch reads. The openshell provider reaches the same gateway, so gateway ownership was split across two providers.

Decision

The openshell provider now serves them, renamed, with unchanged schemas and behavior:

Before After
nemoclaw_managed_gateway openshell_podman_gateway
nemoclaw_gateway_storage openshell_gateway_storage
nemoclaw_kubernetes_storage, _auth, _gateway openshell_kubernetes_storage, _auth, _gateway
data nemoclaw_gateway_readiness data openshell_docker_gateway_readiness
data nemoclaw_gateway_runtime data openshell_docker_gateway_runtime
  • The implementation stays in nemoclaw-provider, because the managed-container backend it uses is shared with Ollama and vLLM. nemoclaw-provider exposes it as GatewayInstallation, and the openshell binary serves it behind a default installation feature. fabric-provider turns that feature off, so the Fabric binary doesn't pull in installers.
  • To avoid a dependency cycle, nemoclaw-provider no longer depends on openshell-provider (first commit): observe_with_wait moves to nemoclaw-openshell, and EnvironmentSecrets comes from nemoclaw-backend.
  • The installation kinds map to these types in nemoclaw-openshell. They deliberately have no type_name, because they install a gateway rather than reach one, so they take no gateway ref.
  • The Kubernetes platform stage keeps the openshell provider and drops only fabric: since Gateway refs replace provider-level gateway settings #13142 the openshell provider takes only destroy.
  • The contract tests for these types move into openshell-provider, so they run against the openshell binary Cargo built. The Docker gateway launch test now reads the computed launch from plan outputs, without the Docker provider. The openshell harness gains a check that every served type has a contract test.
  • State predating the rename is rejected with a recovery message (SDK record version 10).

Still to do for #13146: moving the gateway prerequisite check out of nemoclaw_engine_capabilities into these types. That is a behavior change, so it gets its own PR.

Validation

  • cargo ci --full passes locally (unit tests, plus 138 contract and system tests).
  • Schema snapshots show a pure move: 104 lines leave nemoclaw, and the same 104 arrive in openshell under the new names.
  • A new unit test pins the kind-to-type mapping, including that installation kinds take no gateway ref.

cv added 3 commits October 14, 2026 10:28
…-provider

The gateway installation code used openshell-provider only for
observe_with_wait and a re-export of EnvironmentSecrets. Move
observe_with_wait into nemoclaw-openshell and use nemoclaw-backend's
EnvironmentSecrets, so the openshell provider can serve the gateway
installation types without a dependency cycle. Tests that compare rules
across providers keep openshell-provider as a dev-dependency.
The nemoclaw provider served the types that install an OpenShell
gateway while the openshell provider reached it. The openshell provider
now serves them as openshell_podman_gateway, openshell_gateway_storage,
openshell_kubernetes_{storage,auth,gateway}, and the
openshell_docker_gateway_{readiness,runtime} data sources, with
unchanged schemas.

nemoclaw-provider keeps the implementation, shared with the Ollama and
vLLM containers, and exposes it as GatewayInstallation; the openshell
binary serves it behind a default installation feature that the fabric
provider turns off. The Kubernetes platform stage keeps the openshell
provider, contract tests move with the types, and state from before the
rename is rejected with a recovery message.
@github-actions

Copy link
Copy Markdown
Contributor

@cv
cv merged commit 2b13543 into v1 Oct 14, 2026
@cv
cv deleted the feat/openshell-gateway-types branch October 14, 2026 18:24
cv added a commit that referenced this pull request Oct 14, 2026
v1's tree equals this branch's base (49555c0), so the merge keeps this
branch's tree.
cv added a commit that referenced this pull request Oct 14, 2026
…sources (#13167)

Closes #13144. Part of #13131.

#13160 has merged; this targets `v1`.

## Failure

`fabric_agent_configuration` took the whole Fabric agent document as one
opaque `config_json` string. OpenTofu could not type-check it, plans
showed one JSON blob, and the sandbox it configured was a set of loose
identity strings. Nothing checked the document against the harness until
the bridge applied it.

## Decision

`fabric_agent` replaces it:

- **References:** it takes `sandbox = openshell_sandbox.<name>.ref`,
`harness = data.fabric_harness.<name>.ref`, and `gateway`.
- **Inputs:** `name` and `description` are Fabric's `metadata`, and
`settings` is `harness.settings`. Every section of Fabric's agent
configuration (`instructions`, `models`, `runtime`, `tools`, `skills`,
`mcp`, `workflow`, `environment`, `discovery`, `relay`, `telemetry`) is
a typed input derived from Fabric's published schema
(`SchemaName::Agent`). A unit test fails if Fabric adds a section that
isn't an input.
- **Planning:** plans reject a document Fabric cannot parse, naming the
field but not its value. They also reject one the harness catalog does
not accept, such as `mode = "append"` with Pi, using the adapter's
catalog records now carried in the `fabric_harness` ref. Once the
sandbox is known, plans refuse an agent name or harness the sandbox does
not launch.
- **Changes:** changing the sandbox, harness, or name replaces the
agent; any other change reconfigures it without replacing the sandbox.
Removal still releases the binding without stopping the agent; stopping
it needs a bridge operation (follow-up).
- **Old state:** state recorded before typed Fabric agents (record
version 10, which still binds `fabric_agent_configuration`) is rejected
with the recovery message; the record version is now 11.

To map Fabric's schema, `nemoclaw-tofu` now:

- maps nullable types to their optional type, and unions of one scalar
type, such as string enums, to that type;
- writes objects and values the schema leaves open as JSON text
(`jsonencode`), because tf-provider cannot decode OpenTofu's dynamic
values;
- keeps undeclared properties of objects that allow them, such as a
model's `api`, in an `extensions` JSON-text attribute, so a document
crosses OpenTofu without loss;
- accepts maps and lists of objects as top-level typed inputs (labeled
blocks such as `models "default" {}`), and adds a `validate_inputs` hook
that checks related inputs while others are still unknown.

The SDK compiles each sandbox's document into these inputs, with a
`data.fabric_harness` read named after the sandbox, so adding a sandbox
changes no existing agent. Readiness, state recovery, plan reporting,
and export use the same shared compose and split functions
(`nemoclaw_fabric::agent`). Diagnostics still name the sandbox, not the
agent.

Not in this change:

- skills and MCP servers by ref (#13150, #13151);
- harness fields other than `settings`;
- merging the two image reads per sandbox (`fabric_harnesses` for
compatibility, `fabric_harness` for the ref).

## Validation

- After merging `v1` (with #13187 and #13160), `cargo ci --full` passes
locally (138 contract and system tests).
- `cargo ci` passes locally (1495 unit, 138 contract and system tests).
- New unit tests cover the schema mapping rules, lossless round trips of
a full document (including `api` extensions), the reference and flatten
rules, and plan-time harness rejection.
- The Fabric contract test runs `fabric_agent` through pinned OpenTofu
against the fake gateway: plan-time rejection without echoing values, a
harness-unsupported field rejected at plan, apply, unchanged re-plan,
update without sandbox replacement, drift repair, a lost reply, and
teardown.
cv added a commit that referenced this pull request Oct 14, 2026
…ateway_prerequisites (#13191)

Closes #13146. Part of #13131.

Follows #13187, which moved the gateway installation types into the
`openshell` provider.

## Failure

`nemoclaw_engine_capabilities` did two jobs. It reported the engine's
facts (version, platform, CPUs, memory), which other discovery reads. It
also judged whether the engine could host a managed OpenShell gateway
with a compute driver: the Podman driver needs a Podman engine socket,
and rootless Podman needs pasta networking. That judgement is the
OpenShell provider's: since #13187, its gateway installation types
already enforce the same check when they plan and apply.

## Decision

- New `data "openshell_gateway_prerequisites"` (`engine`,
`compute_driver`) reports whether the engine can host the gateway:
`status`, `available`, and `observation_json` with the reason. The
`openshell` provider serves it with the other installation types.
- `nemoclaw_engine_capabilities` takes only `engine` and reports facts.
That is the shape #13148 needs for `host_engine`.
- For a managed gateway, the discovery graph reads both. The
postcondition "The selected engine does not meet gateway prerequisites"
moves to the prerequisite read, so an unmet prerequisite still stops
planning early.
- Plan reports fold the two reads into the existing engine observation;
its status is the less available of the two. Onboarding and authoring
see the same observation as before, and keep reporting an unmet
prerequisite before anything is installed. Until the prerequisite read
completes, the engine is reported as unresolved.
- In-process discovery (`nemoclaw-discovery`) gains
`observe_engine_facts` and `observe_gateway_prerequisites`.
`observe_engine` keeps its combined behavior.

## Validation

- `cargo ci --full` passes locally (unit tests, plus 139 contract and
system tests). The later merge of `v1` left the tree unchanged.
- New tests, each observed failing first:
- Discovery library: the facts read touches only `/info`; prerequisites
reject a non-Podman engine and rootless Podman without pasta.
- Reporting: unmet prerequisites make the engine unavailable, and an
unread prerequisite leaves it unresolved.
- Compile: the graph emits both reads, with the postcondition on the
prerequisite read.
- Contract, through pinned OpenTofu: a Docker engine is available for
the Docker driver and unavailable for the Podman driver, with the
reason.
- The pinned discovery graph snapshots change exactly as intended:
`compute_driver` and the postcondition move from the engine read to the
prerequisite read, and the discovery output gains
`gateway_prerequisites`.
- The schema snapshots show `compute_driver` leaving
`nemoclaw_engine_capabilities` and the new data source in `openshell`.
cv added a commit that referenced this pull request Oct 14, 2026
The standalone cache test's HCL declared only the nemoclaw provider
for vllm_credential_storage, so OpenTofu searched for hashicorp/vllm.
It now declares the vllm provider. The retained-storage qualification
test also declares openshell, which has served
openshell_gateway_storage since #13187.
@wscurran wscurran added area: architecture Architecture, design debt, major refactors, or maintainability area: install Install, setup, prerequisites, or uninstall flow refactor PR restructures code without intended behavior change v1 NemoClaw v1 branch labels Oct 22, 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: install Install, setup, prerequisites, or uninstall flow refactor PR restructures code without intended behavior change v1 NemoClaw v1 branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants