Skip to content

feat(provider): check Fabric configurations and readiness inputs by name - #12900

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

cv merged 3 commits into
v1from
feat/fabric-typed-inputs-v1

Conversation

@kaofelix

@kaofelix kaofelix commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator

Replaces #12857, which merged into the stale feat/fabric-capabilities branch instead of v1. Part of #12788 (step 2 of 3, the last).

The first two commits are #12857's, cherry-picked onto v1 unchanged. The third is new: v1 added two attribute checks after #12857 was written.

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

Three 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.
  3. v1's newer attribute checks adopt the owned message. The managed gateway and Kubernetes definitions pass SDK checks that return &'static str; their definitions now convert the error rather than changing those SDK signatures.

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 passed on linux_arm64 for feat(provider): check Fabric configurations and readiness inputs by name #12857's two commits, including 108 lifecycle tests.
  • On this branch (linux_amd64, 2 cores): fmt, clippy, test, and bundle pass. Lifecycle passed 111 of 112; deployment::web_search_cli_export_reapply_and_destroy reached its 300 s limit under load and passed alone in 255 s. That test timed out the same way on this host before these changes, so CI on this PR is the authoritative lifecycle result.

kaofelix and others added 3 commits October 9, 2026 09:32
…ation

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.

The resource now checks config_json during validation and reports
"Invalid config_json" on that attribute, naming the rejected field
("at harness.adapter_id") through a safe path and never the value. An
attribute check can now build its message, so ValidateAttribute
returns a Cow instead of a fixed string; storage's checks are
unchanged.

Part of #12788.
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 agent configuration's
config_json. OpenTofu could not check which keys the read needed, and
a missing or misspelled key surfaced only when the read failed.

The data source now requires the nine attributes it reads by name: the
sandbox's workspace, name, id, owner, generation, agent_name,
agent_runtime, and runtime_json, and the configuration's config_json.
The checks are unchanged; validation now also requires runtime_json and
config_json, which the read already needed. Generated graphs reference
each attribute directly.

Part of #12788.
ValidateAttribute now returns Cow<'static, str>. The managed gateway and
Kubernetes definitions, added to v1 after this change was written, pass
SDK checks that return a fixed &'static str; convert their errors instead
of changing the SDK signatures.
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

@cv
cv merged commit 15eda94 into v1 Oct 9, 2026
27 checks passed
@cv
cv deleted the feat/fabric-typed-inputs-v1 branch October 9, 2026 12:01
@cv cv added the v1 NemoClaw v1 branch label Oct 12, 2026
@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: 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