Skip to content

refactor(config)!: key sandboxes by name - #13705

Merged
cv merged 5 commits into
v1from
refactor/13080-keyed-sandboxes
Oct 26, 2026
Merged

cv merged 5 commits into
v1from
refactor/13080-keyed-sandboxes

Conversation

@gaveezy

@gaveezy gaveezy commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Failure

spec.sandboxes is a list of 1 to 32 entries with a name in each, unlike the name-keyed maps (#13080, shape change 3). It follows #13703, which keyed inferenceProviders.

Decision

flowchart LR
    subgraph Before
        A["sandboxes:<br/>- name: assistant<br/>  harness: ..."]
    end
    subgraph After
        B["sandboxes:<br/>  assistant:<br/>    harness: ..."]
    end
    Before --> After
    After --> N["NamedSandbox:<br/>name + definition"]
    N --> K["Resource addresses and<br/>registration keys unchanged"]
Loading
  • sandboxes maps a name to a definition, 1 to 32 entries; keys keep the old name rule as propertyNames.
  • The key is the only copy of the name: Document::sandboxes() returns NamedSandbox, which borrows the name with the definition.
  • OpenTofu inputs and state don't change. Saved intent in the list shape no longer loads.
  • Onboarding keeps the template's sandbox name and no longer asks for it.
  • The multiple-sandboxes contract fixture paired three sandboxes with each other's agents; it now matches the example.

Validation

Part of #13080.

gaveezy and others added 4 commits October 22, 2026 16:25
## Failure

`spec.inferenceProviders` and `spec.sandboxes[].inferenceProviders`
were lists whose entries each carried a `name`, while `harnesses`,
`inferences`, `integrations`, and `services` are maps keyed by name.
#13080 lists this as shape change 3.

## Decision

- Both fields are maps from provider name to definition, and the
  definition has no `name`. Keys follow the rule names did,
  `^[a-z][a-z0-9-]{0,39}$`, now as `propertyNames`; like the other maps,
  an invalid key reports `propertyNames`. A repeated name is a duplicate
  YAML key. The parser still rejects a sandbox name that shadows a
  deployment name, and now says where:
  `spec.sandboxes[assistant].inferenceProviders[local]: sandbox provider
  names must not shadow deployment definitions`.
- A route's inline `provider` has no key, so it keeps `name` in a
  separate `InlineInferenceProvider` type: the name plus the flattened
  `InferenceProvider` fields, with the same schema rules. Naming it after
  its route instead would change registration names and make inline
  providers in different inferences collide.
- Registrations are keyed by the same names, so OpenTofu provider inputs
  and provider state don't change. Saved deployment intent holds the
  authored document, so intent saved with lists no longer loads; v1 does
  not carry earlier formats, and there is no alias.
- Export writes providers in name order, like the other maps.
- Schema errors name a valid provider key, as in
  `spec.inferenceProviders.local.endpoint`. Authoring addresses a
  provider as `/spec/inferenceProviders/<name>`, and onboarding's text map
  matches provider names with `*`.
- Update the examples, fixtures, guides, and tests, and regenerate the
  schema and the reference. The hosted parity test converts the
  historical v0 provider list in memory, as it does `agents`; the raw
  exports stay unchanged.

## Validation

- `config_schema::inference_providers_are_keyed_by_name_in_both_scopes`
  failed before the change with `configuration violates schema at
  spec.inferenceProviders (line 1, column 282): must be array`, and now
  passes. The onboarding label test failed on
  `/spec/inferenceProviders/nvidia-prod/api` until provider names map to
  `*`.
- `cargo ci --full` passed: 1610 unit and 156 lifecycle tests, within
  the reported budgets.
- `cargo run --locked -p nemoclaw-build -- schema --check` and
  `docs --check` passed, and `git diff --check` is clean.
- Deferred to CI: the live suites and `fern check`; this host has no
  Docker or Node.js.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
## Failure

`spec.sandboxes` was a list of one to 32 objects that each carried a
`name`, checked for uniqueness in Rust, while `harnesses`, `inferences`,
`inferenceProviders`, `integrations`, and `services` are maps keyed by
name. #13080 lists this as the second half of shape change 3.

## Decision

- `spec.sandboxes` maps each sandbox name to its definition, and a
  sandbox has no `name`. The map takes one to 32 entries
  (`minProperties`, `maxProperties`), and keys follow the rule names
  did, `^[a-z][a-z0-9-]{0,39}$`, now as `propertyNames`. A repeated name
  is a duplicate YAML key, so the Rust uniqueness check is gone.
- The key is the only copy of the name. `Document::sandboxes()` and
  `Document::sandbox(name)` return a `NamedSandbox`, which borrows the
  name with the definition and dereferences to the definition. The
  functions that need the name take it: `sandbox_harness`,
  `sandbox_inference`, `sandbox_route_provider`, `integration_bindings`,
  `fabric_config::for_sandbox`, `requirements_for_sandbox`, and
  `policy_input`.
- Resource addresses, registration keys such as the digest of
  `<sandbox>/<provider>`, discovery reads, and diagnostics use the same
  names in the same name order, so OpenTofu provider inputs and provider
  state don't change. Saved deployment intent holds the authored
  document, so intent saved with a list no longer loads; there is no
  alias.
- `Document::digest` no longer sorts sandboxes, and export writes them in
  name order.
- Schema errors name a valid sandbox key, as in
  `spec.sandboxes.reviewer.agent.name`, and the collections nested in a
  sandbox stay named. The schema helper `at` takes `*` for every value of
  a map, and the generated reference shows a map's entry bounds.
- Authoring addresses a journey's one sandbox as `/spec/sandboxes/<name>`,
  whatever its name, and never renames it; the sandbox name is no longer
  a question. `JourneyDefinition::harness_question` gives the harness
  question's ID, and guidance that names another sandbox is refused, so
  an answer cannot add a second sandbox. Onboarding asks the harness
  question for the template's sandbox, and its text map matches sandbox
  names with `*`.
- Tests that only reversed sandbox order are removed, because a map has
  no order. The OpenShell contract fixture for `multiple-sandboxes`
  changes: its generator paired discovery reads with sandboxes in
  declaration order, while compile numbers them in name order. The
  compiled graph is unchanged.
- Update the examples, fixtures, guides, and tests, and regenerate the
  schema and the reference. The hosted parity test converts the
  historical v0 sandbox list in memory, as it does providers; the raw
  exports stay unchanged.

## Validation

- `config_schema::sandboxes_are_keyed_by_name` failed before the change
  with `name-keyed sandboxes: configuration violates schema at
  spec.sandboxes (line 1, column 366): must be array`, and now passes.
  `journey_authoring_boundaries::the_single_sandbox_keeps_its_name_and_questions_use_it`
  failed with `The v1 journey requires exactly one sandbox object.`, and
  the onboarding label test failed on
  `/spec/sandboxes/assistant/agent/inference/routes/1/name` until sandbox
  names map to `*`.
- Compiling all 54 examples at the parent commit and at this one, with
  fixed generations, gives byte-identical graphs, targets, runtime and
  teardown graphs, discovery queries, and credential names.
- `cargo ci --full` passed: 1610 unit and 156 lifecycle tests, within
  the reported budgets.
- `cargo run --locked -p nemoclaw-build -- schema --check` and
  `docs --check` passed, and `git diff --check` is clean.
- Deferred to CI: the live suites and `fern check`; this host has no
  Docker or Node.js.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Bring the branch up to date with v1 df88a97, including #13636, which renamed ServicePlacement.networkCidr to networkCIDR. Git merged every file without conflicts, and the regenerated schema and reference match the merged files.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…yed-sandboxes

Bring the branch up to date with its base, which now includes v1 df88a97. Git merged every file without conflicts.

- fabric_compatibility.rs: #13687's new OpenCode test passed the list's first sandbox to fabric_config::for_sandbox. It now takes the document's one NamedSandbox, which works for both examples it loads.

The regenerated schema and reference match the merged files.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@gaveezy
gaveezy requested a review from cv October 25, 2026 18:11
Base automatically changed from refactor/13080-keyed-inference-providers to v1 October 26, 2026 07:05
#13703 merged into v1 as squash 279ccb5, so GitHub retargeted this
branch to v1 and reported conflicts: the squash repeats the provider
change this branch already holds as its own commits.

Resolution: the squash's tree equals #13703's final head (25349c6)
applied to its parent, so this merge is a three-way merge with 25349c6
as the base. The result differs from v1 by exactly this branch's change
(199 files) and from the branch's previous head by exactly the three
release-CI commits that v1 gained (#13706, #13711, #13715).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

@cv
cv merged commit 9106480 into v1 Oct 26, 2026
57 checks passed
@cv
cv deleted the refactor/13080-keyed-sandboxes branch October 26, 2026 07:46
gaveezy added a commit that referenced this pull request Oct 26, 2026
#13705 (9106480) keys `sandboxes` by name. Two files conflicted, and
this branch's own code needed the same change:

- kubernetes_live.rs: keep this branch's document builder; each sandbox
  entry is now the key `{sandbox}:` in place of `- name: {sandbox}`.
  `identities` iterates `Document::sandboxes()`, which pairs each name
  with its definition.
- fabric_live.rs: both tests take their sandbox from
  `Document::sandboxes()`, since this branch's state readers need its
  name.
- dummy_agent.rs and fabric_live.rs pass `sandbox.name` directly; it is
  already a `&str`.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
cv added a commit that referenced this pull request Oct 26, 2026
Resolve the conflicts with #13705, which keyed sandboxes by name:
- journey_definition.rs keeps v1's sandbox_path() in place of the fixed
  HARNESS path, and this branch's removal of the refusal to omit a
  supplied setting.
- journey_resolution.rs keeps this branch's assertion that an omitted
  supplied endpoint is kept.

Follow #13703 and #13705 in this branch's additions: defaults.yaml keys
nvidia-prod and assistant, and the new tests use keyed sandbox and provider
paths.

Signed-off-by: Carlos Villela <[email protected]>
gaveezy added a commit that referenced this pull request Oct 26, 2026
Bring in #13551's merge of v1 at 9106480 (d1298f6), which keys
sandboxes by name (#13705). No conflicts.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
gaveezy added a commit that referenced this pull request Oct 26, 2026
Bring in v1 at 9106480, which keys inferenceProviders and sandboxes by
name (#13703, #13705). No conflicts.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
gaveezy added a commit that referenced this pull request Oct 26, 2026
Bring the branch up to date with v1 4f1c8db, which now keys
inference providers (#13703) and sandboxes (#13705) by name. Git merged
every file without conflicts.

- config_schema.rs: the image-reference test set a sandbox image by
  list index; it now uses the openclaw example's `assistant` key.

The regenerated schema and reference match the merged files.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
cv pushed a commit that referenced this pull request Oct 26, 2026
## Failure

#13080's review asked which positional uses remain now that sandboxes
are keyed by name (#13705). One did: each sandbox's Fabric harness read
was named `sandbox_<n>`, numbered in name order. Adding a sandbox whose
name sorts first renumbered the reads, so the existing sandbox's
`openshell_sandbox` block, its read, and its inference registration all
changed.

## Decision

```mermaid
flowchart LR
    subgraph Before["Before: reads numbered in name order"]
        A1["assistant: sandbox_0"] -->|"add aaa"| A2["aaa: sandbox_0<br/>assistant: sandbox_1"]
    end
    subgraph After["After: reads named after the sandbox"]
        B1["assistant: sandbox_assistant"] -->|"add aaa"| B2["aaa: sandbox_aaa<br/>assistant: unchanged"]
    end
```

- Reads are named `sandbox_<name>` (and `sandbox_<name>_acquired`) by
one helper shared by the discovery graph and compile. Sandbox names have
no underscores, so the names can't collide with other reads such as
`gateway`.
- Stored resources were already keyed by sandbox name or image digest.
- A registration shared by several sandboxes still takes `binaries` from
the first sharing sandbox in name order; registrations are keyed by
image and harness, so every sharing sandbox's read gives the same
binaries.

## Validation

- New test
`adding_a_sandbox_that_sorts_first_leaves_existing_sandboxes_unchanged`
failed before the change on those three blocks and now passes.
- The existing add-a-sandbox test no longer has to ignore the sandbox's
`launch_json`.
- The OpenShell contract fixtures, compiled from every example, are
unchanged; their generator now finds each read by sandbox name.
- `cargo ci --full` passed on v1 `58fcea38c`: 1,714 unit and 156
lifecycle tests.

Part of #13080.

Co-authored-by: Claude Opus 5.5 <[email protected]>
@wscurran wscurran added v1 NemoClaw v1 branch area: architecture Architecture, design debt, major refactors, or maintainability area: sandbox OpenShell sandbox lifecycle, runtime, config, or recovery refactor PR restructures code without intended behavior change labels Oct 27, 2026
cv added a commit that referenced this pull request Nov 6, 2026
…ion (#14266)

This release refuses deployment state written by another release, with a
message that names both intent record versions, instead of calling the
state corrupt. The intent record is now version 16, so every deployment
created before this change is refused too, and its state is left
unchanged.

## Problem

#13703 and #13705 changed the saved intent record: `inferenceProviders`
and `sandboxes` became maps. The record version stayed at 15, so the CLI
parsed v0.1.0-rc9 state as current and failed with `deployment intent
record is corrupt; retain it for recovery`. The [compatibility
reference](docs/references/compatibility.md#deployment-state) promises
that a release refuses older state and names the cause. Nothing caught a
format change made without a version bump.

## Change

- `RECORD_FORMAT` in `crates/nemoclaw-sdk/src/state/mod.rs` pairs the
record version, now 16, with the SHA-256 fingerprint of the record's
JSON Schema. `the_intent_record_format_changes_only_with_its_version`
fails when the schema changes and prints the next version and
fingerprint to set. The fingerprint leaves out descriptions, titles,
examples, comments, and `x-` extensions, so editing a doc comment
doesn't force a bump. Rules that live in parsing code rather than the
schema, such as accepted harness kinds, aren't covered.
- `Store::load` reads the version before the rest of the record, so the
refusal doesn't depend on what an older record holds. A new error,
`StateFromOtherRelease`, says: "deployment state was written by a
different NemoClaw release (intent record version N; this release reads
M); keep using the CLI bundle that created the deployment, or destroy it
with that bundle and create a new deployment; state retained". It
replaces the release-specific "predates openshell_inference" message.
- `intent_from_another_release_is_refused_unchanged_whatever_it_holds`
replaces the older-version test. It covers an older and a newer version,
a record body this release can't read, the message, and unchanged bytes.
- The compatibility reference quotes the new message, and the release
notes say that existing deployments are refused.

No state is migrated: v1 hasn't launched.
cv added a commit that referenced this pull request Nov 11, 2026
…ms (#14413)

The release notes now list every user-visible change on `v1` since the
`v0.1.0-rc9` tag, including the breaking ones, and four example pages
drop claims that later changes made false.

## Problem

`docs/about/release-notes.md` listed three breaking changes and none of
the features, fixes, and onboarding changes that reached `v1` after
`v0.1.0-rc9`; it didn't name the configuration shapes the parser now
rejects or the intent record version `v0.1.0-rc9` writes.
Some example claims went stale:

- `examples/spark/README.md` said the pinned OpenShell has the Podman
TLS initialization blocker, ai-openshell/openshell#3427; its fix merged before
OpenShell 0.1.0, and `v1` pins 0.1.7.
- `examples/station/README.md` and `examples/gtc-dc/README.md` required
exactly one visible GPU on the host; since #13929,
`container.gpuDevices` lets a service on a host with more GPUs request
one.
- `examples/hcl/travel-team` said Fabric's Deep Agents adapter can't
turn reasoning off, NVIDIA/NeMo-Fabric#433; NVIDIA/NeMo-Fabric#439 fixed
that, and the pinned catalog's Deep Agents `reasoning_effort` accepts
`none`.
- The travel team cited #13313 for the booking key its service doesn't
receive, but #13313 closed when `openshell_api` landed.

## Change

- `docs/about/release-notes.md` gains "Changes Since v0.1.0-rc9",
grouped by area, from the commits in `v0.1.0-rc9..origin/v1`; where a
later commit changed an earlier one, the entry describes the current
code, and changes added and removed after the tag aren't listed:
- Agents and interfaces: #14037, #14038, #14269, #13981, #14024, #14186,
#14052, #14385, #13971, #13858, #13947, #14039, #14042, #14044, #14343.
- Inference: #13929, #14391, #14396, #14398, #14400, #13963, #13912,
#13964, #14388, #14390, #14397.
- Gateways and Kubernetes: #13909, #13970, #13922 (an existing
namespace, refused at plan by #13756, is now bound; cluster-wide reads
dropped), #14014, #14169, #13921.
- Plan, apply, and diagnostics: #14224, #13756, #14141, #14133, #14135,
#13775, #13744, #13701.
- Onboarding: #13693, #13695, #13741, #13757, #13851, #13978, #14228,
#14233, #14334, #14336.
- Examples and builds: #14166, #14184, #14188, #14191, #14192, #14200,
#13889, #14267, #14312, #14315, #14355, b30e9b4, #13781, #13813,
#14246, and the pins in `versions.json` and `image/fabric/Dockerfile`.
- Its breaking changes since the tag:
- the intent record moving from 15, which `v0.1.0-rc9` writes, through
16 (#14266), 17 (#14343), 18 (#13929), 19 (#14391) and 20 (#14394);
  - name-keyed `sandboxes` and `inferenceProviders` (#13703, #13705);
- a recipe `compatibility.gpu` outside every hardware profile (#13912);
- model tuning the adapter doesn't accept (#14111), and Hermes's
`max_tokens` losing its default (#14296);
  - `skills.paths` resolution (#14296);
  - endpoint and `networkCIDR` validation (#13847, #14081);
- the HCL `gateway_values` attribute (#14014), and Kubernetes ownership
receipts from before #13922 and #14014.
  The two earlier items stay, under their own heading.
- `examples/spark/README.md` replaces the closed OpenShell#3427 blocker
with the Podman and remote-model limits in `docs/resources/limits.md`.
- `examples/station/README.md` and `examples/gtc-dc/README.md` require
one GPU visible in the model container, and point to
`container.gpuDevices` for a host with more.
- `examples/hcl/travel-team/README.md` and `WALKTHROUGH.md` drop the
NeMo-Fabric#433 limitation, and the travel team's booking-key statements
link #14417 instead of #13313.

Not listed, because both changes landed after the tag: Deep Agents Code
(#14043, #14250), `compatibility.gpuCount` (#14391, #14394), and the
"Creating infrastructure state" progress step (#14169, #14248).

Checked and left unchanged: the root `README.md`,
`crates/nemoclaw-onboarding/README.md`,
`crates/nemoclaw-cli/assets/README.md`, `internal-docs/README.md`, the
other example READMEs, and every example YAML header comment. The GPU
autoscaling README and `load.sh` read the JSON fields `OperationResult`
serializes, and ai-openshell/openshell#4287 is fixed only after the pinned
0.1.7. The two pre-tag release-note items still match the schema and
SDK. `docs/README.md` is left to #14412, which retires the stale field
reference snapshot it describes.

Not verified: whether Hermes sends the booking key's placeholder to MCP
servers; #14417 tracks the live check.

## Beyond CI

Each relative link and anchor in the changed files resolves to an
existing file and heading.
@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 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.

3 participants