Skip to content

fix(kubernetes): name the object behind ownership refusals and refuse an existing namespace at plan - #13756

Merged
cv merged 1 commit into
v1from
fix/kubernetes-refusal-causes
Oct 26, 2026
Merged

cv merged 1 commit into
v1from
fix/kubernetes-refusal-causes

Conversation

@cv

@cv cv commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator

Part of #13747 (findings 4 and 6 of #12733's OpenShift Local run). This PR covers the ownership refusals; the TLS part (finding 6) follows separately.

Failure

On Kubernetes, every ownership refusal printed only "observed ownership, generation, or durable identity changed", whatever the cause: a namespace that existed before apply, a kek Secret recreated with a new UID, or a changed OpenShift UID range annotation. A user couldn't tell what to fix. Plan also didn't notice a namespace that already existed, so the refusal came only at apply, after it had started.

Decision

  • A named refusal. ObservationError::BindingChanged(detail) is a binding mismatch whose detail names the object and what changed, using only kinds, names and UIDs. Its message keeps the existing prefix, so anything matching "observed ownership, generation, or durable identity changed" still matches.
  • Cluster names the object in each refusal: create ("Namespace agents already exists, and this deployment does not adopt it"), verify ("… is missing", "… was replaced: recorded UID A, found B", "… no longer carries this deployment's owner label") and delete ("… was replaced, so it is kept").
  • OpenShift ranges: refresh and apply name the namespace and the recorded and found UID and group.
  • Plan: Operations::plan refuses a namespace that already exists when this deployment hasn't recorded one, and the provider calls it when planning a new Kubernetes resource. Plan now reads that one namespace from the cluster; apply already needed that access.

Other BindingMismatch sites (a rebuilt cluster, Helm release annotations) keep the unnamed message; they weren't among the findings.

Not changed: a refused apply can still report "Changes may already have been made". With plan catching the existing namespace, apply reaches that refusal only if the namespace appears between plan and apply.

Validation

  • RED → GREEN: new or updated tests failed against the old code for the stated reason, then passed:
    • kubernetes_storage::an_existing_namespace_is_not_taken_over_and_the_refusal_names_it
    • kubernetes_storage::a_replaced_key_secret_is_refused_by_name
    • kubernetes_openshift_reapply::reapplying_authentication_refuses_a_changed_or_missing_range_and_creates_nothing
    • kubernetes_operations::planning_refuses_a_namespace_that_already_exists_before_any_change (plus planning_accepts_a_new_namespace_and_the_one_this_deployment_created)
  • Contract updates: tests that matched the bare BindingMismatch from Cluster now assert the named detail (kubernetes_cluster, kubernetes_lost_create_response, kubernetes_operations).
  • cargo ci: passed locally, including the bundle and lifecycle steps and the kubernetes_lifecycle contract tests, which run pinned OpenTofu and the provider against an in-memory Kubernetes API.
  • Not run on a cluster: the kind and OpenShift live suites.

… an existing namespace at plan

Ownership refusals on Kubernetes reported only that ownership, generation
or durable identity changed. They now name the object and what changed: an
object that already exists, one that is missing or replaced (with both
UIDs), one without the owner label, and a namespace whose OpenShift UID or
group range changed. Plan now refuses a namespace that already exists, so
the refusal comes before apply changes anything.

Refs #13747
@github-actions

Copy link
Copy Markdown
Contributor

@cv
cv merged commit 45f1a0e into v1 Oct 26, 2026
54 checks passed
@cv
cv deleted the fix/kubernetes-refusal-causes branch October 26, 2026 23:27
cv added a commit that referenced this pull request Oct 26, 2026
… rejected (#13775)

Second part of #13747 (finding 6 of #12733's OpenShift Local run);
#13756 covers the ownership refusals.

## Failure

With an external gateway, an untrusted server certificate and a rejected
client certificate both reported only "observation transport failed".
The user couldn't tell which TLS file was wrong. Because the failure
counted as transport, waits also retried it as if the gateway were
unreachable.

## Decision

`nemoclaw_openshell::tls_failure` walks a gRPC error's sources and
recognizes a refused handshake. `remote_error` checks it before
classifying a status as a transport failure, and reports one of three
fixed messages:

- `the gateway's TLS server certificate is not signed by the configured
certificate authority`: rustls `UnknownIssuer` or `BadSignature`. A
regenerated authority with the same name gives `BadSignature`.
- `the gateway's TLS server certificate does not name the endpoint's
host`: `NotValidForName`.
- `the gateway refused the TLS client certificate`: the server's
certificate alerts, or `DecryptError` when it can't verify the client's
signature.

Two details:

- Rustls errors arrive wrapped in `std::io::Error`, whose `source()`
skips the wrapped error, so the walk unwraps them with `get_ref`.
- An alert the server sends after the handshake reaches the client only
as an I/O error holding rustls's text. It is recognized by comparing
that text with rustls's own `AlertReceived(alert).to_string()`, so it
follows the pinned rustls instead of a copied string.

The new error is a fixed backend diagnostic, not `Transport`, so waits
stop retrying a TLS configuration error. `nemoclaw-openshell` now
depends on the workspace `rustls` (already in the lock file at 0.23.45,
the version tonic uses).

## Validation

- **RED → GREEN:**
`fake_gateway_tests::a_tls_failure_names_the_refused_certificate` runs
the fake gateway with mutual TLS and certificates from `rcgen`. Before
the change, all three cases reported "observation transport failed".
After it, each reports its own message, and the gateway's API sees no
effects:
  - an unrelated authority;
  - an endpoint whose host the certificate doesn't name;
  - a client certificate from an unrelated authority.
- **`cargo ci`:** passed locally, including the bundle and lifecycle
steps.
- **Not run on a cluster:** the live suites.
@wscurran wscurran added v1 NemoClaw v1 branch area: sandbox OpenShell sandbox lifecycle, runtime, config, or recovery bug-fix PR fixes a bug or regression platform: k8s Affects Kubernetes deployments security area: security Security controls, permissions, secrets, or hardening and removed security labels Oct 27, 2026
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 added a commit that referenced this pull request Nov 11, 2026
Brings the platform guides under `docs/` in line with `v1` at
`637bdb6276`: they now name that revision and OpenShell 0.1.7, publish
the generated configuration reference instead of a stale snapshot,
restore guide text that the reorganization dropped, and correct what
they say about policy changes, OpenShell resource schemas, and
onboarding.

## Problem

The reorganization in #14195 pinned the guides to `86b8d94273` and still
describes that revision, 114 commits behind `v1`:

- The published "YAML Configuration Reference" is a hand-kept snapshot
of the generated reference at `86b8d94273`. It predates the typed
application container options (#14166), network middleware bindings, the
dropped Deep Agents Code harness, and the multi-GPU fields, and says
that `docs/reference/configuration.md` differs from it on three field
types.
- The guides name OpenShell 0.1.6 and link its `ac7f615` sources, while
`versions.json` pins 0.1.7 (`5d25211b`, #14245). #14245 left this for
the next refresh of the inspected revision.
- #14195 was written at `86b8d94273` and merged after #14186, #14132,
and #14166, so it overwrote their guide changes: the `agents` field with
each agent's runtime ID, the OIDC sign-in details for a managed
Kubernetes gateway, and the application container example.
- `docs/security/sandbox-network.md` and `docs/security/security.md` say
apply rejects a policy change that needs a new sandbox. Since #13375, a
changed sandbox specification, policy included, replaces the sandbox, as
the same page's recovery section and `docs/build-deploy/usage.md`
already say.
- `docs/references/provider.md` says the OpenShell resource schemas are
version 1; they're version 2 since #13157.
- `docs/references/cli.md` says onboarding needs a verified bundle to
read the target; since #12579 it reads the target directly, with no
bundle or OpenTofu.
- `docs/references/fabric-harnesses.md` says onboarding offers every
catalog harness; since #14233 it offers OpenClaw and Hermes, and keeps a
template's other harness as the suggestion.
- The troubleshooting table lacks the errors that #14141 and #14133
added for retained gateway storage owned by another state directory and
a missing kubeconfig context.

## Change

- **Revision:** `docs/README.md`, the architecture overview, the
container services page, and the first-deployment tutorial and its
prerequisites now name `637bdb6276`, with OpenShell 0.1.7 and `5d25211b`
from its `versions.json`. Links to NemoClaw sources at the old revision
become repository-relative links, and the two test fixtures they named
moved to `crates/nemoclaw-e2e/tests/integration/rust/`.
- **OpenShell links:** every OpenShell link in these pages moves from
`ac7f615` to `5d25211b`. The line ranges for the Docker, Podman, and
Kubernetes proxy settings in OpenShell's `configuration.mdx` are
recomputed for the new file; they cover the same blocks.
- **Field reference:** `fern/pages.json` publishes
`docs/reference/configuration.md`, which `cargo run -p nemoclaw-build --
schema` generates and CI checks, and
`docs/references/v1-configuration.md` is removed. Links to it, including
one in `docs/agents-inference/inference.md` and one in the user-guide
skill, point at the generated reference. Refreshing the snapshot instead
would keep a hand-copied file that goes stale with the next schema
change.
- **Restored from #14186:** the tutorial and the headless OpenClaw
example in `docs/agents-inference/agents.md` read the runtime ID from
`nemoclaw plan -o json` instead of `terraform.tfstate`;
`docs/references/cli.md` lists the `agents` field and the **Agents**
text; `docs/references/sdk.md` names `agents` in plan and apply results
(`OperationResult::agents`).
- **Restored from #14132:** the OIDC steps in
`docs/build-deploy/kubernetes.md` cite the manual run in #14131 and
describe the CLI's `http://127.0.0.1:<port>/callback` redirect and
`SSL_CERT_FILE` trust, and the matching row in
`docs/resources/limits.md` no longer says the steps never ran. OpenShell
0.1.7's `oidc_auth.rs` still builds that redirect.
- **Restored from #14166:** `docs/build-deploy/usage.md` links
`examples/application-container.yaml`.
- **Policy changes:** both security pages and the change table in
`usage.md` say a policy change replaces the sandbox, deleting its files
and conversations (except on mounted volumes), the wording of #14141's
CLI warning; `openshell_sandbox` has no mutable fields
(`crates/openshell-provider/src/lib.rs`).
- **Schema version:** `docs/references/provider.md` says version 2, as
`crates/openshell-provider/tests/schema.txt` records, and drops the
repeated sentence.
- **Onboarding:** `docs/references/cli.md` says onboarding reads the
target without a bundle (`nemoclaw_onboarding::author`) and that the
saved file holds only authored values, a sentence #13978 added to the
tutorial before #14195 replaced onboarding there with a copied example.
- **Onboarding harnesses and troubleshooting:** `fabric-harnesses.md`
names the harnesses onboarding offers and drops a past rehearsal list;
the troubleshooting table gains rows for the two errors above, with
their messages from `gateway_storage.rs` and `observation.rs`.
- **Smaller fixes:** `tls: terminate` and `passthrough` are rejected by
OpenShell 0.1.7 (its `l7/mod.rs` is unchanged from 0.1.6); OpenShell
0.1.7 still keeps GPU filesystem additions local to the workload
(`boundary_server.rs`); `interfaces.md` points to the prerequisites for
the tutorial's OpenShell version; `migration.md` links the onboarding
guide; the internal evidence pages record that this change removed the
snapshot; the prerequisites table no longer limits non-OpenClaw,
non-Deep Agents images to ARM64, which `docker-bake.hcl` and
`docs/build-deploy/build.md` contradict.

Checked against the code and left unchanged: the Kubernetes namespace
binding after #13756 (`operations.rs` binds an existing namespace by
UID), agent replacement rules (`fabric-provider/src/agent.rs`), state
paths and Fabric adapter pins in `docs/build-deploy/state.md`
(`f33fa19a`, as `versions.json`), the harness table and its examples,
CLI options against `args.rs`, SDK signatures and timeouts, provider
versions, the 32-sandbox and 32-provider limits, the multi-GPU limit
(#14384 is open, and `container.gpuDevices` still takes one entry), the
compatibility page's state-version error, and the threat model.

## Beyond CI

- The first-deployment tutorial hasn't been rerun at `637bdb6276`; its
commands were checked against the CLI parser, `examples/openclaw.yaml`,
and the result types.
- The OIDC `SSL_CERT_FILE` behavior was observed in #14131 with
OpenShell 0.1.6 and hasn't been rechecked with 0.1.7.
@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 bug-fix PR fixes a bug or regression platform: k8s Affects Kubernetes deployments v1 NemoClaw v1 branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants